summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2011-05-23 15:29:24 -0400
committerBarry Warsaw <barry@python.org>2011-05-23 15:29:24 -0400
commit544fb3c1aea093f3be6e0142679c0f01ab316758 (patch)
treead1b5c56a1cd7de261e35819133502b4180278f0 /Lib/test
parent51228dcd1c23959cdd68712c8b2507bed4effccf (diff)
parentb5e277ca522d94bdbf1426bfd8c43fee2f8153f3 (diff)
downloadcpython-544fb3c1aea093f3be6e0142679c0f01ab316758.tar.gz
Null merge from 2.6 branch.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/README413
-rw-r--r--Lib/test/buffer_tests.py48
-rw-r--r--Lib/test/cjkencodings/big5-utf8.txt9
-rw-r--r--Lib/test/cjkencodings/big5.txt9
-rw-r--r--Lib/test/cjkencodings/big5hkscs-utf8.txt2
-rw-r--r--Lib/test/cjkencodings/big5hkscs.txt2
-rw-r--r--Lib/test/cjkencodings/cp949-utf8.txt9
-rw-r--r--Lib/test/cjkencodings/cp949.txt9
-rw-r--r--Lib/test/cjkencodings/euc_jisx0213-utf8.txt8
-rw-r--r--Lib/test/cjkencodings/euc_jisx0213.txt8
-rw-r--r--Lib/test/cjkencodings/euc_jp-utf8.txt7
-rw-r--r--Lib/test/cjkencodings/euc_jp.txt7
-rw-r--r--Lib/test/cjkencodings/euc_kr-utf8.txt7
-rw-r--r--Lib/test/cjkencodings/euc_kr.txt7
-rw-r--r--Lib/test/cjkencodings/gb18030-utf8.txt15
-rw-r--r--Lib/test/cjkencodings/gb18030.txt15
-rw-r--r--Lib/test/cjkencodings/gb2312-utf8.txt6
-rw-r--r--Lib/test/cjkencodings/gb2312.txt6
-rw-r--r--Lib/test/cjkencodings/gbk-utf8.txt14
-rw-r--r--Lib/test/cjkencodings/gbk.txt14
-rw-r--r--Lib/test/cjkencodings/johab-utf8.txt9
-rw-r--r--Lib/test/cjkencodings/johab.txt9
-rw-r--r--Lib/test/cjkencodings/shift_jis-utf8.txt7
-rw-r--r--Lib/test/cjkencodings/shift_jis.txt7
-rw-r--r--Lib/test/cjkencodings/shift_jisx0213-utf8.txt8
-rw-r--r--Lib/test/cjkencodings/shift_jisx0213.txt8
-rw-r--r--Lib/test/cjkencodings_test.py1019
-rw-r--r--Lib/test/crashers/README24
-rw-r--r--Lib/test/crashers/bogus_sre_bytecode.py47
-rw-r--r--Lib/test/crashers/compiler_recursion.py5
-rw-r--r--Lib/test/crashers/gc_has_finalizer.py36
-rw-r--r--Lib/test/crashers/iter.py53
-rw-r--r--Lib/test/crashers/recursion_limit_too_high.py2
-rw-r--r--Lib/test/data/README2
-rw-r--r--Lib/test/decimaltestdata/and.decTest676
-rw-r--r--Lib/test/decimaltestdata/class.decTest262
-rw-r--r--Lib/test/decimaltestdata/comparetotal.decTest1596
-rw-r--r--Lib/test/decimaltestdata/comparetotmag.decTest1580
-rw-r--r--Lib/test/decimaltestdata/copy.decTest172
-rw-r--r--Lib/test/decimaltestdata/copyabs.decTest172
-rw-r--r--Lib/test/decimaltestdata/copynegate.decTest172
-rw-r--r--Lib/test/decimaltestdata/copysign.decTest354
-rw-r--r--Lib/test/decimaltestdata/ddAbs.decTest252
-rw-r--r--Lib/test/decimaltestdata/ddAdd.decTest2656
-rw-r--r--Lib/test/decimaltestdata/ddAnd.decTest694
-rw-r--r--Lib/test/decimaltestdata/ddBase.decTest2208
-rw-r--r--Lib/test/decimaltestdata/ddCanonical.decTest714
-rw-r--r--Lib/test/decimaltestdata/ddClass.decTest152
-rw-r--r--Lib/test/decimaltestdata/ddCompare.decTest1488
-rw-r--r--Lib/test/decimaltestdata/ddCompareSig.decTest1294
-rw-r--r--Lib/test/decimaltestdata/ddCompareTotal.decTest1412
-rw-r--r--Lib/test/decimaltestdata/ddCompareTotalMag.decTest1412
-rw-r--r--Lib/test/decimaltestdata/ddCopy.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddCopyAbs.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddCopyNegate.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddCopySign.decTest350
-rw-r--r--Lib/test/decimaltestdata/ddDivide.decTest1726
-rw-r--r--Lib/test/decimaltestdata/ddDivideInt.decTest898
-rw-r--r--Lib/test/decimaltestdata/ddEncode.decTest990
-rw-r--r--Lib/test/decimaltestdata/ddFMA.decTest3396
-rw-r--r--Lib/test/decimaltestdata/ddInvert.decTest404
-rw-r--r--Lib/test/decimaltestdata/ddLogB.decTest318
-rw-r--r--Lib/test/decimaltestdata/ddMax.decTest644
-rw-r--r--Lib/test/decimaltestdata/ddMaxMag.decTest608
-rw-r--r--Lib/test/decimaltestdata/ddMin.decTest618
-rw-r--r--Lib/test/decimaltestdata/ddMinMag.decTest586
-rw-r--r--Lib/test/decimaltestdata/ddMinus.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddMultiply.decTest1106
-rw-r--r--Lib/test/decimaltestdata/ddNextMinus.decTest252
-rw-r--r--Lib/test/decimaltestdata/ddNextPlus.decTest248
-rw-r--r--Lib/test/decimaltestdata/ddNextToward.decTest748
-rw-r--r--Lib/test/decimaltestdata/ddOr.decTest584
-rw-r--r--Lib/test/decimaltestdata/ddPlus.decTest176
-rw-r--r--Lib/test/decimaltestdata/ddQuantize.decTest1666
-rw-r--r--Lib/test/decimaltestdata/ddReduce.decTest364
-rw-r--r--Lib/test/decimaltestdata/ddRemainder.decTest1200
-rw-r--r--Lib/test/decimaltestdata/ddRemainderNear.decTest1258
-rw-r--r--Lib/test/decimaltestdata/ddRotate.decTest524
-rw-r--r--Lib/test/decimaltestdata/ddSameQuantum.decTest778
-rw-r--r--Lib/test/decimaltestdata/ddScaleB.decTest486
-rw-r--r--Lib/test/decimaltestdata/ddShift.decTest524
-rw-r--r--Lib/test/decimaltestdata/ddSubtract.decTest1258
-rw-r--r--Lib/test/decimaltestdata/ddToIntegral.decTest514
-rw-r--r--Lib/test/decimaltestdata/ddXor.decTest674
-rw-r--r--Lib/test/decimaltestdata/dqAbs.decTest252
-rw-r--r--Lib/test/decimaltestdata/dqAdd.decTest2430
-rw-r--r--Lib/test/decimaltestdata/dqAnd.decTest840
-rw-r--r--Lib/test/decimaltestdata/dqBase.decTest2162
-rw-r--r--Lib/test/decimaltestdata/dqCanonical.decTest744
-rw-r--r--Lib/test/decimaltestdata/dqClass.decTest154
-rw-r--r--Lib/test/decimaltestdata/dqCompare.decTest1506
-rw-r--r--Lib/test/decimaltestdata/dqCompareSig.decTest1294
-rw-r--r--Lib/test/decimaltestdata/dqCompareTotal.decTest1412
-rw-r--r--Lib/test/decimaltestdata/dqCompareTotalMag.decTest1412
-rw-r--r--Lib/test/decimaltestdata/dqCopy.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqCopyAbs.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqCopyNegate.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqCopySign.decTest350
-rw-r--r--Lib/test/decimaltestdata/dqDivide.decTest1616
-rw-r--r--Lib/test/decimaltestdata/dqDivideInt.decTest906
-rw-r--r--Lib/test/decimaltestdata/dqEncode.decTest954
-rw-r--r--Lib/test/decimaltestdata/dqFMA.decTest3572
-rw-r--r--Lib/test/decimaltestdata/dqInvert.decTest490
-rw-r--r--Lib/test/decimaltestdata/dqLogB.decTest320
-rw-r--r--Lib/test/decimaltestdata/dqMax.decTest644
-rw-r--r--Lib/test/decimaltestdata/dqMaxMag.decTest608
-rw-r--r--Lib/test/decimaltestdata/dqMin.decTest618
-rw-r--r--Lib/test/decimaltestdata/dqMinMag.decTest586
-rw-r--r--Lib/test/decimaltestdata/dqMinus.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqMultiply.decTest1178
-rw-r--r--Lib/test/decimaltestdata/dqNextMinus.decTest252
-rw-r--r--Lib/test/decimaltestdata/dqNextPlus.decTest248
-rw-r--r--Lib/test/decimaltestdata/dqNextToward.decTest750
-rw-r--r--Lib/test/decimaltestdata/dqOr.decTest802
-rw-r--r--Lib/test/decimaltestdata/dqPlus.decTest176
-rw-r--r--Lib/test/decimaltestdata/dqQuantize.decTest1672
-rw-r--r--Lib/test/decimaltestdata/dqReduce.decTest366
-rw-r--r--Lib/test/decimaltestdata/dqRemainder.decTest1194
-rw-r--r--Lib/test/decimaltestdata/dqRemainderNear.decTest1262
-rw-r--r--Lib/test/decimaltestdata/dqRotate.decTest596
-rw-r--r--Lib/test/decimaltestdata/dqSameQuantum.decTest778
-rw-r--r--Lib/test/decimaltestdata/dqScaleB.decTest520
-rw-r--r--Lib/test/decimaltestdata/dqShift.decTest596
-rw-r--r--Lib/test/decimaltestdata/dqSubtract.decTest1270
-rw-r--r--Lib/test/decimaltestdata/dqToIntegral.decTest514
-rw-r--r--Lib/test/decimaltestdata/dqXor.decTest820
-rw-r--r--Lib/test/decimaltestdata/dsBase.decTest2124
-rw-r--r--Lib/test/decimaltestdata/dsEncode.decTest744
-rw-r--r--Lib/test/decimaltestdata/exp.decTest1348
-rw-r--r--Lib/test/decimaltestdata/extra.decTest70
-rw-r--r--Lib/test/decimaltestdata/fma.decTest6852
-rw-r--r--Lib/test/decimaltestdata/invert.decTest352
-rw-r--r--Lib/test/decimaltestdata/ln.decTest1222
-rw-r--r--Lib/test/decimaltestdata/log10.decTest1102
-rw-r--r--Lib/test/decimaltestdata/logb.decTest376
-rw-r--r--Lib/test/decimaltestdata/maxmag.decTest808
-rw-r--r--Lib/test/decimaltestdata/minmag.decTest780
-rw-r--r--Lib/test/decimaltestdata/nextminus.decTest296
-rw-r--r--Lib/test/decimaltestdata/nextplus.decTest300
-rw-r--r--Lib/test/decimaltestdata/nexttoward.decTest852
-rw-r--r--Lib/test/decimaltestdata/or.decTest668
-rw-r--r--Lib/test/decimaltestdata/powersqrt.decTest5940
-rw-r--r--Lib/test/decimaltestdata/rotate.decTest494
-rw-r--r--Lib/test/decimaltestdata/scaleb.decTest418
-rw-r--r--Lib/test/decimaltestdata/shift.decTest500
-rw-r--r--Lib/test/decimaltestdata/tointegralx.decTest510
-rw-r--r--Lib/test/decimaltestdata/xor.decTest670
-rw-r--r--Lib/test/doctest_aliases.py2
-rw-r--r--Lib/test/floating_points.txt7
-rw-r--r--Lib/test/fork_wait.py12
-rw-r--r--Lib/test/formatfloat_testcases.txt380
-rw-r--r--Lib/test/gdb_sample.py12
-rw-r--r--Lib/test/ieee754.txt6
-rw-r--r--Lib/test/leakers/test_dictself.py12
-rw-r--r--Lib/test/list_tests.py6
-rw-r--r--Lib/test/lock_tests.py12
-rw-r--r--Lib/test/mapping_tests.py101
-rw-r--r--Lib/test/math_testcases.txt447
-rw-r--r--Lib/test/pickletester.py234
-rw-r--r--Lib/test/pyclbr_input.py2
-rwxr-xr-xLib/test/regrtest.py942
-rw-r--r--Lib/test/script_helper.py164
-rw-r--r--Lib/test/seq_tests.py16
-rw-r--r--Lib/test/sha256.pem158
-rw-r--r--Lib/test/string_tests.py125
-rw-r--r--Lib/test/subprocessdata/sigchild_ignore.py6
-rw-r--r--Lib/test/test_SimpleHTTPServer.py10
-rw-r--r--Lib/test/test_StringIO.py4
-rw-r--r--Lib/test/test___all__.py14
-rw-r--r--Lib/test/test___future__.py7
-rw-r--r--Lib/test/test__locale.py33
-rw-r--r--Lib/test/test_abc.py132
-rw-r--r--Lib/test/test_abstract_numbers.py18
-rw-r--r--[-rwxr-xr-x]Lib/test/test_aepack.py5
-rw-r--r--Lib/test/test_aifc.py62
-rw-r--r--Lib/test/test_applesingle.py6
-rw-r--r--Lib/test/test_argparse.py4646
-rwxr-xr-xLib/test/test_array.py114
-rw-r--r--Lib/test/test_ascii_formatd.py58
-rw-r--r--Lib/test/test_ast.py75
-rw-r--r--Lib/test/test_asynchat.py166
-rw-r--r--Lib/test/test_asyncore.py574
-rw-r--r--Lib/test/test_augassign.py43
-rw-r--r--Lib/test/test_bigaddrspace.py2
-rw-r--r--Lib/test/test_bigmem.py634
-rw-r--r--[-rwxr-xr-x]Lib/test/test_binascii.py137
-rw-r--r--Lib/test/test_binop.py8
-rw-r--r--Lib/test/test_bisect.py18
-rw-r--r--Lib/test/test_bool.py45
-rwxr-xr-xLib/test/test_bsddb.py37
-rw-r--r--Lib/test/test_buffer.py2
-rw-r--r--Lib/test/test_bufio.py48
-rw-r--r--Lib/test/test_builtin.py273
-rw-r--r--Lib/test/test_bytes.py277
-rw-r--r--Lib/test/test_bz2.py254
-rw-r--r--Lib/test/test_calendar.py66
-rw-r--r--Lib/test/test_call.py6
-rw-r--r--Lib/test/test_capi.py102
-rwxr-xr-xLib/test/test_cd.py5
-rw-r--r--Lib/test/test_cfgparser.py183
-rw-r--r--Lib/test/test_cgi.py54
-rw-r--r--Lib/test/test_charmapcodec.py28
-rwxr-xr-xLib/test/test_cl.py5
-rw-r--r--Lib/test/test_class.py34
-rw-r--r--[-rwxr-xr-x]Lib/test/test_cmath.py170
-rw-r--r--Lib/test/test_cmd.py13
-rw-r--r--Lib/test/test_cmd_line.py37
-rw-r--r--Lib/test/test_cmd_line_script.py171
-rw-r--r--Lib/test/test_code.py45
-rw-r--r--Lib/test/test_codeccallbacks.py64
-rw-r--r--Lib/test/test_codecs.py166
-rw-r--r--Lib/test/test_codeop.py36
-rw-r--r--Lib/test/test_coding.py15
-rw-r--r--Lib/test/test_coercion.py26
-rw-r--r--Lib/test/test_collections.py613
-rw-r--r--Lib/test/test_commands.py30
-rw-r--r--Lib/test/test_compile.py61
-rw-r--r--Lib/test/test_compileall.py80
-rw-r--r--Lib/test/test_compiler.py97
-rw-r--r--Lib/test/test_complex.py309
-rw-r--r--Lib/test/test_complex_args.py2
-rw-r--r--Lib/test/test_contains.py56
-rw-r--r--Lib/test/test_contextlib.py91
-rw-r--r--Lib/test/test_cookie.py16
-rw-r--r--Lib/test/test_cookielib.py508
-rw-r--r--Lib/test/test_copy.py242
-rw-r--r--Lib/test/test_copy_reg.py20
-rw-r--r--Lib/test/test_cpickle.py8
-rw-r--r--[-rwxr-xr-x]Lib/test/test_cprofile.py2
-rw-r--r--[-rwxr-xr-x]Lib/test/test_crypt.py3
-rw-r--r--Lib/test/test_csv.py37
-rw-r--r--Lib/test/test_ctypes.py12
-rw-r--r--Lib/test/test_curses.py14
-rw-r--r--Lib/test/test_datetime.py398
-rw-r--r--[-rwxr-xr-x]Lib/test/test_dbm.py6
-rw-r--r--Lib/test/test_decimal.py849
-rw-r--r--Lib/test/test_defaultdict.py24
-rw-r--r--Lib/test/test_deque.py85
-rw-r--r--Lib/test/test_descr.py746
-rw-r--r--Lib/test/test_dict.py239
-rw-r--r--Lib/test/test_dictcomps.py54
-rw-r--r--Lib/test/test_dictviews.py154
-rw-r--r--Lib/test/test_difflib.py119
-rw-r--r--Lib/test/test_dircache.py12
-rw-r--r--Lib/test/test_dis.py44
-rwxr-xr-xLib/test/test_dl.py5
-rw-r--r--Lib/test/test_doctest.py150
-rw-r--r--Lib/test/test_doctest2.py4
-rw-r--r--Lib/test/test_docxmlrpc.py90
-rw-r--r--Lib/test/test_dummy_thread.py44
-rw-r--r--Lib/test/test_enumerate.py20
-rw-r--r--Lib/test/test_epoll.py34
-rwxr-xr-xLib/test/test_errno.py8
-rw-r--r--Lib/test/test_exceptions.py102
-rw-r--r--Lib/test/test_extcall.py47
-rw-r--r--[-rwxr-xr-x]Lib/test/test_fcntl.py11
-rw-r--r--Lib/test/test_file.py486
-rw-r--r--Lib/test/test_file2k.py680
-rw-r--r--Lib/test/test_filecmp.py50
-rw-r--r--Lib/test/test_fileinput.py6
-rw-r--r--Lib/test/test_fileio.py282
-rw-r--r--Lib/test/test_float.py723
-rw-r--r--Lib/test/test_fnmatch.py10
-rw-r--r--Lib/test/test_fork1.py12
-rw-r--r--Lib/test/test_format.py48
-rw-r--r--Lib/test/test_fpformat.py14
-rw-r--r--Lib/test/test_fractions.py353
-rw-r--r--Lib/test/test_frozen.py21
-rw-r--r--Lib/test/test_ftplib.py303
-rw-r--r--Lib/test/test_funcattrs.py201
-rw-r--r--Lib/test/test_functools.py177
-rw-r--r--Lib/test/test_future.py2
-rw-r--r--Lib/test/test_future4.py2
-rw-r--r--Lib/test/test_future5.py2
-rw-r--r--Lib/test/test_future_builtins.py1
-rw-r--r--Lib/test/test_gc.py33
-rw-r--r--Lib/test/test_gdb.py702
-rw-r--r--[-rwxr-xr-x]Lib/test/test_gdbm.py12
-rw-r--r--Lib/test/test_generators.py41
-rw-r--r--Lib/test/test_genericpath.py270
-rw-r--r--Lib/test/test_genexps.py6
-rw-r--r--Lib/test/test_getargs.py3
-rw-r--r--Lib/test/test_getargs2.py221
-rw-r--r--Lib/test/test_getopt.py36
-rw-r--r--Lib/test/test_gettext.py80
-rwxr-xr-xLib/test/test_gl.py9
-rw-r--r--Lib/test/test_glob.py6
-rw-r--r--Lib/test/test_grammar.py138
-rw-r--r--[-rwxr-xr-x]Lib/test/test_grp.py19
-rw-r--r--Lib/test/test_gzip.py266
-rw-r--r--Lib/test/test_hash.py5
-rw-r--r--Lib/test/test_hashlib.py182
-rw-r--r--Lib/test/test_heapq.py94
-rw-r--r--Lib/test/test_hmac.py28
-rw-r--r--Lib/test/test_hotshot.py8
-rw-r--r--Lib/test/test_htmllib.py18
-rw-r--r--[-rwxr-xr-x]Lib/test/test_htmlparser.py22
-rw-r--r--Lib/test/test_httplib.py164
-rw-r--r--Lib/test/test_httpservers.py230
-rwxr-xr-xLib/test/test_imageop.py1
-rw-r--r--Lib/test/test_imaplib.py78
-rw-r--r--Lib/test/test_imp.py24
-rw-r--r--Lib/test/test_import.py364
-rw-r--r--Lib/test/test_importhooks.py17
-rw-r--r--Lib/test/test_importlib.py176
-rw-r--r--Lib/test/test_index.py129
-rw-r--r--Lib/test/test_inspect.py437
-rw-r--r--Lib/test/test_int.py81
-rw-r--r--Lib/test/test_io.py2629
-rw-r--r--Lib/test/test_ioctl.py62
-rw-r--r--Lib/test/test_iter.py53
-rw-r--r--Lib/test/test_iterlen.py4
-rw-r--r--Lib/test/test_itertools.py269
-rw-r--r--Lib/test/test_kqueue.py33
-rw-r--r--Lib/test/test_largefile.py97
-rw-r--r--Lib/test/test_lib2to3.py6
-rw-r--r--Lib/test/test_linecache.py100
-rw-r--r--Lib/test/test_linuxaudiodev.py20
-rw-r--r--Lib/test/test_list.py8
-rw-r--r--Lib/test/test_locale.py55
-rw-r--r--Lib/test/test_logging.py1007
-rw-r--r--Lib/test/test_long.py179
-rw-r--r--Lib/test/test_long_future.py189
-rw-r--r--Lib/test/test_macos.py65
-rw-r--r--Lib/test/test_macostools.py10
-rw-r--r--Lib/test/test_macpath.py90
-rw-r--r--Lib/test/test_mailbox.py883
-rw-r--r--Lib/test/test_marshal.py10
-rw-r--r--Lib/test/test_math.py473
-rw-r--r--Lib/test/test_memoryio.py364
-rw-r--r--Lib/test/test_memoryview.py361
-rw-r--r--Lib/test/test_mhlib.py24
-rw-r--r--Lib/test/test_mimetools.py2
-rw-r--r--Lib/test/test_mimetypes.py28
-rw-r--r--Lib/test/test_minidom.py216
-rw-r--r--Lib/test/test_mmap.py178
-rw-r--r--Lib/test/test_module.py29
-rw-r--r--Lib/test/test_modulefinder.py22
-rw-r--r--Lib/test/test_msilib.py46
-rw-r--r--Lib/test/test_multibytecodec.py14
-rw-r--r--Lib/test/test_multibytecodec_support.py78
-rw-r--r--Lib/test/test_multiprocessing.py364
-rw-r--r--Lib/test/test_mutex.py8
-rw-r--r--Lib/test/test_netrc.py23
-rw-r--r--Lib/test/test_new.py2
-rw-r--r--Lib/test/test_nis.py5
-rw-r--r--Lib/test/test_normalization.py41
-rw-r--r--Lib/test/test_ntpath.py57
-rw-r--r--Lib/test/test_old_mailbox.py67
-rw-r--r--Lib/test/test_opcodes.py28
-rw-r--r--Lib/test/test_openpty.py4
-rw-r--r--Lib/test/test_operator.py413
-rw-r--r--Lib/test/test_optparse.py83
-rw-r--r--Lib/test/test_os.py350
-rw-r--r--Lib/test/test_ossaudiodev.py17
-rw-r--r--Lib/test/test_parser.py39
-rw-r--r--Lib/test/test_pdb.py287
-rw-r--r--Lib/test/test_peepholer.py89
-rw-r--r--Lib/test/test_pep247.py18
-rw-r--r--Lib/test/test_pep277.py174
-rw-r--r--Lib/test/test_pep352.py27
-rw-r--r--Lib/test/test_pickle.py10
-rw-r--r--Lib/test/test_pipes.py41
-rw-r--r--Lib/test/test_pkg.py41
-rw-r--r--Lib/test/test_pkgimport.py5
-rw-r--r--Lib/test/test_platform.py159
-rw-r--r--Lib/test/test_plistlib.py2
-rw-r--r--Lib/test/test_poll.py4
-rw-r--r--Lib/test/test_popen.py11
-rw-r--r--Lib/test/test_popen2.py22
-rw-r--r--Lib/test/test_poplib.py317
-rw-r--r--Lib/test/test_posix.py210
-rw-r--r--Lib/test/test_posixpath.py239
-rw-r--r--Lib/test/test_pow.py44
-rw-r--r--Lib/test/test_pprint.py4
-rw-r--r--Lib/test/test_print.py9
-rw-r--r--[-rwxr-xr-x]Lib/test/test_profile.py5
-rw-r--r--Lib/test/test_property.py45
-rw-r--r--Lib/test/test_pty.py18
-rw-r--r--Lib/test/test_pwd.py33
-rw-r--r--Lib/test/test_py3kwarn.py183
-rw-r--r--Lib/test/test_pyclbr.py14
-rw-r--r--Lib/test/test_pydoc.py73
-rw-r--r--Lib/test/test_pyexpat.py208
-rw-r--r--Lib/test/test_queue.py39
-rw-r--r--Lib/test/test_quopri.py20
-rw-r--r--Lib/test/test_random.py68
-rw-r--r--Lib/test/test_re.py95
-rw-r--r--Lib/test/test_readline.py5
-rw-r--r--Lib/test/test_repr.py57
-rw-r--r--Lib/test/test_resource.py4
-rw-r--r--Lib/test/test_rfc822.py20
-rw-r--r--Lib/test/test_richcmp.py41
-rw-r--r--Lib/test/test_rlcompleter.py73
-rw-r--r--Lib/test/test_robotparser.py51
-rw-r--r--Lib/test/test_runpy.py231
-rw-r--r--Lib/test/test_sax.py277
-rw-r--r--Lib/test/test_scope.py38
-rw-r--r--Lib/test/test_scriptpackages.py4
-rw-r--r--Lib/test/test_select.py16
-rw-r--r--Lib/test/test_set.py181
-rw-r--r--Lib/test/test_setcomps.py151
-rw-r--r--Lib/test/test_sets.py47
-rw-r--r--Lib/test/test_sha.py6
-rw-r--r--Lib/test/test_shutil.py378
-rw-r--r--Lib/test/test_signal.py112
-rw-r--r--Lib/test/test_site.py179
-rw-r--r--Lib/test/test_slice.py6
-rw-r--r--Lib/test/test_smtplib.py52
-rw-r--r--Lib/test/test_smtpnet.py13
-rw-r--r--Lib/test/test_socket.py487
-rw-r--r--Lib/test/test_socketserver.py26
-rw-r--r--Lib/test/test_sort.py2
-rw-r--r--Lib/test/test_sqlite.py9
-rw-r--r--Lib/test/test_ssl.py431
-rw-r--r--Lib/test/test_startfile.py12
-rw-r--r--Lib/test/test_str.py71
-rw-r--r--[-rwxr-xr-x]Lib/test/test_strftime.py1
-rw-r--r--Lib/test/test_string.py8
-rw-r--r--Lib/test/test_stringprep.py80
-rw-r--r--Lib/test/test_strop.py82
-rw-r--r--Lib/test/test_strptime.py118
-rw-r--r--Lib/test/test_strtod.py399
-rw-r--r--Lib/test/test_struct.py497
-rw-r--r--Lib/test/test_structmembers.py79
-rw-r--r--Lib/test/test_structseq.py16
-rw-r--r--Lib/test/test_subprocess.py966
-rw-r--r--Lib/test/test_sunaudiodev.py5
-rw-r--r--Lib/test/test_sundry.py2
-rw-r--r--Lib/test/test_support.py592
-rw-r--r--Lib/test/test_symtable.py21
-rw-r--r--Lib/test/test_syntax.py152
-rw-r--r--Lib/test/test_sys.py203
-rw-r--r--Lib/test/test_sys_setprofile.py (renamed from Lib/test/test_profilehooks.py)27
-rw-r--r--Lib/test/test_sys_settrace.py789
-rw-r--r--Lib/test/test_sysconfig.py316
-rw-r--r--Lib/test/test_tarfile.py510
-rw-r--r--Lib/test/test_tcl.py52
-rw-r--r--Lib/test/test_telnetlib.py301
-rw-r--r--Lib/test/test_tempfile.py147
-rw-r--r--Lib/test/test_textwrap.py39
-rw-r--r--Lib/test/test_thread.py43
-rw-r--r--Lib/test/test_threaded_import.py7
-rw-r--r--Lib/test/test_threadedtempfile.py9
-rw-r--r--Lib/test/test_threading.py257
-rw-r--r--Lib/test/test_threading_local.py120
-rw-r--r--Lib/test/test_threadsignals.py7
-rw-r--r--Lib/test/test_time.py80
-rw-r--r--Lib/test/test_timeout.py32
-rw-r--r--Lib/test/test_tk.py35
-rw-r--r--Lib/test/test_tokenize.py25
-rw-r--r--Lib/test/test_trace.py1095
-rw-r--r--Lib/test/test_traceback.py67
-rw-r--r--Lib/test/test_transformer.py6
-rw-r--r--Lib/test/test_ttk_guionly.py40
-rw-r--r--Lib/test/test_ttk_textonly.py19
-rw-r--r--Lib/test/test_tuple.py86
-rw-r--r--Lib/test/test_typechecks.py21
-rw-r--r--Lib/test/test_types.py125
-rw-r--r--Lib/test/test_unary.py38
-rw-r--r--Lib/test/test_undocumented_details.py5
-rw-r--r--Lib/test/test_unicode.py270
-rw-r--r--Lib/test/test_unicode_file.py58
-rw-r--r--Lib/test/test_unicodedata.py36
-rw-r--r--Lib/test/test_unittest.py2296
-rw-r--r--Lib/test/test_univnewlines.py116
-rw-r--r--Lib/test/test_univnewlines2k.py130
-rw-r--r--Lib/test/test_urllib.py83
-rw-r--r--Lib/test/test_urllib2.py145
-rw-r--r--Lib/test/test_urllib2_localnet.py106
-rw-r--r--Lib/test/test_urllib2net.py169
-rw-r--r--Lib/test/test_urllibnet.py38
-rw-r--r--Lib/test/test_urlparse.py69
-rw-r--r--Lib/test/test_userdict.py28
-rw-r--r--Lib/test/test_userlist.py2
-rwxr-xr-xLib/test/test_userstring.py6
-rw-r--r--Lib/test/test_uu.py17
-rw-r--r--Lib/test/test_wait3.py7
-rw-r--r--Lib/test/test_wait4.py13
-rw-r--r--Lib/test/test_warnings.py267
-rw-r--r--Lib/test/test_weakref.py231
-rw-r--r--Lib/test/test_weakset.py377
-rw-r--r--Lib/test/test_whichdb.py2
-rw-r--r--Lib/test/test_winreg.py271
-rw-r--r--Lib/test/test_winsound.py18
-rw-r--r--Lib/test/test_with.py110
-rw-r--r--[-rwxr-xr-x]Lib/test/test_wsgiref.py61
-rw-r--r--Lib/test/test_xdrlib.py8
-rw-r--r--Lib/test/test_xml_etree.py1639
-rw-r--r--Lib/test/test_xml_etree_c.py235
-rw-r--r--Lib/test/test_xmllib.py4
-rw-r--r--Lib/test/test_xmlrpc.py510
-rw-r--r--Lib/test/test_xpickle.py231
-rw-r--r--Lib/test/test_xrange.py35
-rw-r--r--Lib/test/test_zipfile.py1725
-rw-r--r--Lib/test/test_zipimport.py92
-rw-r--r--Lib/test/test_zipimport_support.py44
-rw-r--r--Lib/test/test_zlib.py47
-rw-r--r--Lib/test/testtar.tarbin272384 -> 281088 bytes
-rw-r--r--Lib/test/tracedmodules/__init__.py4
-rw-r--r--Lib/test/tracedmodules/testmod.py9
-rw-r--r--Lib/test/win_console_handler.py49
-rw-r--r--Lib/test/xmltestdata/simple-ns.xml7
-rw-r--r--Lib/test/xmltestdata/simple.xml6
-rw-r--r--Lib/test/xmltestdata/test.xml (renamed from Lib/test/test.xml)0
-rw-r--r--Lib/test/xmltestdata/test.xml.out (renamed from Lib/test/test.xml.out)0
506 files changed, 92575 insertions, 69118 deletions
diff --git a/Lib/test/README b/Lib/test/README
deleted file mode 100644
index 4509df4af5..0000000000
--- a/Lib/test/README
+++ /dev/null
@@ -1,413 +0,0 @@
-+++++++++++++++++++++++++++++++
-Writing Python Regression Tests
-+++++++++++++++++++++++++++++++
-
-:Author: Skip Montanaro
-:Contact: skip@pobox.com
-
-Introduction
-============
-
-If you add a new module to Python or modify the functionality of an existing
-module, you should write one or more test cases to exercise that new
-functionality. There are different ways to do this within the regression
-testing facility provided with Python; any particular test should use only
-one of these options. Each option requires writing a test module using the
-conventions of the selected option:
-
- - unittest_ based tests
- - doctest_ based tests
- - "traditional" Python test modules
-
-Regardless of the mechanics of the testing approach you choose,
-you will be writing unit tests (isolated tests of functions and objects
-defined by the module) using white box techniques. Unlike black box
-testing, where you only have the external interfaces to guide your test case
-writing, in white box testing you can see the code being tested and tailor
-your test cases to exercise it more completely. In particular, you will be
-able to refer to the C and Python code in the CVS repository when writing
-your regression test cases.
-
-.. _unittest: http://www.python.org/doc/current/lib/module-unittest.html
-.. _doctest: http://www.python.org/doc/current/lib/module-doctest.html
-
-unittest-based tests
-------------------
-The unittest_ framework is based on the ideas of unit testing as espoused
-by Kent Beck and the `Extreme Programming`_ (XP) movement. The specific
-interface provided by the framework is tightly based on the JUnit_
-Java implementation of Beck's original SmallTalk test framework. Please
-see the documentation of the unittest_ module for detailed information on
-the interface and general guidelines on writing unittest-based tests.
-
-The test_support helper module provides a function for use by
-unittest-based tests in the Python regression testing framework,
-``run_unittest()``. This is the primary way of running tests in the
-standard library. You can pass it any number of the following:
-
-- classes derived from or instances of ``unittest.TestCase`` or
- ``unittest.TestSuite``. These will be handed off to unittest for
- converting into a proper TestSuite instance.
-
-- a string; this must be a key in sys.modules. The module associated with
- that string will be scanned by ``unittest.TestLoader.loadTestsFromModule``.
- This is usually seen as ``test_support.run_unittest(__name__)`` in a test
- module's ``test_main()`` function. This has the advantage of picking up
- new tests automatically, without you having to add each new test case
- manually.
-
-All test methods in the Python regression framework have names that
-start with "``test_``" and use lower-case names with words separated with
-underscores.
-
-Test methods should *not* have docstrings! The unittest module prints
-the docstring if there is one, but otherwise prints the function name
-and the full class name. When there's a problem with a test, the
-latter information makes it easier to find the source for the test
-than the docstring.
-
-All unittest-based tests in the Python test suite use boilerplate that
-looks like this (with minor variations)::
-
- import unittest
- from test import test_support
-
- class MyTestCase1(unittest.TestCase):
-
- # Define setUp and tearDown only if needed
-
- def setUp(self):
- unittest.TestCase.setUp(self)
- ... additional initialization...
-
- def tearDown(self):
- ... additional finalization...
- unittest.TestCase.tearDown(self)
-
- def test_feature_one(self):
- # Testing feature one
- ...unit test for feature one...
-
- def test_feature_two(self):
- # Testing feature two
- ...unit test for feature two...
-
- ...etc...
-
- class MyTestCase2(unittest.TestCase):
- ...same structure as MyTestCase1...
-
- ...etc...
-
- def test_main():
- test_support.run_unittest(__name__)
-
- if __name__ == "__main__":
- test_main()
-
-This has the advantage that it allows the unittest module to be used
-as a script to run individual tests as well as working well with the
-regrtest framework.
-
-.. _Extreme Programming: http://www.extremeprogramming.org/
-.. _JUnit: http://www.junit.org/
-
-doctest based tests
--------------------
-Tests written to use doctest_ are actually part of the docstrings for
-the module being tested. Each test is written as a display of an
-interactive session, including the Python prompts, statements that would
-be typed by the user, and the output of those statements (including
-tracebacks, although only the exception msg needs to be retained then).
-The module in the test package is simply a wrapper that causes doctest
-to run over the tests in the module. The test for the difflib module
-provides a convenient example::
-
- import difflib
- from test import test_support
- test_support.run_doctest(difflib)
-
-If the test is successful, nothing is written to stdout (so you should not
-create a corresponding output/test_difflib file), but running regrtest
-with -v will give a detailed report, the same as if passing -v to doctest.
-
-A second argument can be passed to run_doctest to tell doctest to search
-``sys.argv`` for -v instead of using test_support's idea of verbosity. This
-is useful for writing doctest-based tests that aren't simply running a
-doctest'ed Lib module, but contain the doctests themselves. Then at
-times you may want to run such a test directly as a doctest, independent
-of the regrtest framework. The tail end of test_descrtut.py is a good
-example::
-
- def test_main(verbose=None):
- from test import test_support, test_descrtut
- test_support.run_doctest(test_descrtut, verbose)
-
- if __name__ == "__main__":
- test_main(1)
-
-If run via regrtest, ``test_main()`` is called (by regrtest) without
-specifying verbose, and then test_support's idea of verbosity is used. But
-when run directly, ``test_main(1)`` is called, and then doctest's idea of
-verbosity is used.
-
-See the documentation for the doctest module for information on
-writing tests using the doctest framework.
-
-"traditional" Python test modules
----------------------------------
-The mechanics of how the "traditional" test system operates are fairly
-straightforward. When a test case is run, the output is compared with the
-expected output that is stored in .../Lib/test/output. If the test runs to
-completion and the actual and expected outputs match, the test succeeds, if
-not, it fails. If an ``ImportError`` or ``test_support.TestSkipped`` error
-is raised, the test is not run.
-
-Executing Test Cases
-====================
-If you are writing test cases for module spam, you need to create a file
-in .../Lib/test named test_spam.py. In addition, if the tests are expected
-to write to stdout during a successful run, you also need to create an
-expected output file in .../Lib/test/output named test_spam ("..."
-represents the top-level directory in the Python source tree, the directory
-containing the configure script). If needed, generate the initial version
-of the test output file by executing::
-
- ./python Lib/test/regrtest.py -g test_spam.py
-
-from the top-level directory.
-
-Any time you modify test_spam.py you need to generate a new expected
-output file. Don't forget to desk check the generated output to make sure
-it's really what you expected to find! All in all it's usually better
-not to have an expected-out file (note that doctest- and unittest-based
-tests do not).
-
-To run a single test after modifying a module, simply run regrtest.py
-without the -g flag::
-
- ./python Lib/test/regrtest.py test_spam.py
-
-While debugging a regression test, you can of course execute it
-independently of the regression testing framework and see what it prints::
-
- ./python Lib/test/test_spam.py
-
-To run the entire test suite:
-
-- [UNIX, + other platforms where "make" works] Make the "test" target at the
- top level::
-
- make test
-
-- [WINDOWS] Run rt.bat from your PCBuild directory. Read the comments at
- the top of rt.bat for the use of special -d, -O and -q options processed
- by rt.bat.
-
-- [OTHER] You can simply execute the two runs of regrtest (optimized and
- non-optimized) directly::
-
- ./python Lib/test/regrtest.py
- ./python -O Lib/test/regrtest.py
-
-But note that this way picks up whatever .pyc and .pyo files happen to be
-around. The makefile and rt.bat ways run the tests twice, the first time
-removing all .pyc and .pyo files from the subtree rooted at Lib/.
-
-Test cases generate output based upon values computed by the test code.
-When executed, regrtest.py compares the actual output generated by executing
-the test case with the expected output and reports success or failure. It
-stands to reason that if the actual and expected outputs are to match, they
-must not contain any machine dependencies. This means your test cases
-should not print out absolute machine addresses (e.g. the return value of
-the id() builtin function) or floating point numbers with large numbers of
-significant digits (unless you understand what you are doing!).
-
-
-Test Case Writing Tips
-======================
-Writing good test cases is a skilled task and is too complex to discuss in
-detail in this short document. Many books have been written on the subject.
-I'll show my age by suggesting that Glenford Myers' `"The Art of Software
-Testing"`_, published in 1979, is still the best introduction to the subject
-available. It is short (177 pages), easy to read, and discusses the major
-elements of software testing, though its publication predates the
-object-oriented software revolution, so doesn't cover that subject at all.
-Unfortunately, it is very expensive (about $100 new). If you can borrow it
-or find it used (around $20), I strongly urge you to pick up a copy.
-
-The most important goal when writing test cases is to break things. A test
-case that doesn't uncover a bug is much less valuable than one that does.
-In designing test cases you should pay attention to the following:
-
- * Your test cases should exercise all the functions and objects defined
- in the module, not just the ones meant to be called by users of your
- module. This may require you to write test code that uses the module
- in ways you don't expect (explicitly calling internal functions, for
- example - see test_atexit.py).
-
- * You should consider any boundary values that may tickle exceptional
- conditions (e.g. if you were writing regression tests for division,
- you might well want to generate tests with numerators and denominators
- at the limits of floating point and integer numbers on the machine
- performing the tests as well as a denominator of zero).
-
- * You should exercise as many paths through the code as possible. This
- may not always be possible, but is a goal to strive for. In
- particular, when considering if statements (or their equivalent), you
- want to create test cases that exercise both the true and false
- branches. For loops, you should create test cases that exercise the
- loop zero, one and multiple times.
-
- * You should test with obviously invalid input. If you know that a
- function requires an integer input, try calling it with other types of
- objects to see how it responds.
-
- * You should test with obviously out-of-range input. If the domain of a
- function is only defined for positive integers, try calling it with a
- negative integer.
-
- * If you are going to fix a bug that wasn't uncovered by an existing
- test, try to write a test case that exposes the bug (preferably before
- fixing it).
-
- * If you need to create a temporary file, you can use the filename in
- ``test_support.TESTFN`` to do so. It is important to remove the file
- when done; other tests should be able to use the name without cleaning
- up after your test.
-
-.. _"The Art of Software Testing":
- http://www.amazon.com/exec/obidos/ISBN=0471043281
-
-Regression Test Writing Rules
-=============================
-Each test case is different. There is no "standard" form for a Python
-regression test case, though there are some general rules (note that
-these mostly apply only to the "classic" tests; unittest_- and doctest_-
-based tests should follow the conventions natural to those frameworks)::
-
- * If your test case detects a failure, raise ``TestFailed`` (found in
- ``test.test_support``).
-
- * Import everything you'll need as early as possible.
-
- * If you'll be importing objects from a module that is at least
- partially platform-dependent, only import those objects you need for
- the current test case to avoid spurious ``ImportError`` exceptions
- that prevent the test from running to completion.
-
- * Print all your test case results using the ``print`` statement. For
- non-fatal errors, print an error message (or omit a successful
- completion print) to indicate the failure, but proceed instead of
- raising ``TestFailed``.
-
- * Use ``assert`` sparingly, if at all. It's usually better to just print
- what you got, and rely on regrtest's got-vs-expected comparison to
- catch deviations from what you expect. ``assert`` statements aren't
- executed at all when regrtest is run in -O mode; and, because they
- cause the test to stop immediately, can lead to a long & tedious
- test-fix, test-fix, test-fix, ... cycle when things are badly broken
- (and note that "badly broken" often includes running the test suite
- for the first time on new platforms or under new implementations of
- the language).
-
-Miscellaneous
-=============
-There is a test_support module in the test package you can import for
-your test case. Import this module using either::
-
- import test.test_support
-
-or::
-
- from test import test_support
-
-test_support provides the following useful objects:
-
- * ``TestFailed`` - raise this exception when your regression test detects
- a failure.
-
- * ``TestSkipped`` - raise this if the test could not be run because the
- platform doesn't offer all the required facilities (like large
- file support), even if all the required modules are available.
-
- * ``ResourceDenied`` - this is raised when a test requires a resource that
- is not available. Primarily used by 'requires'.
-
- * ``verbose`` - you can use this variable to control print output. Many
- modules use it. Search for "verbose" in the test_*.py files to see
- lots of examples.
-
- * ``forget(module_name)`` - attempts to cause Python to "forget" that it
- loaded a module and erase any PYC files.
-
- * ``is_resource_enabled(resource)`` - Returns a boolean based on whether
- the resource is enabled or not.
-
- * ``requires(resource [, msg])`` - if the required resource is not
- available the ResourceDenied exception is raised.
-
- * ``verify(condition, reason='test failed')``. Use this instead of::
-
- assert condition[, reason]
-
- ``verify()`` has two advantages over ``assert``: it works even in -O
- mode, and it raises ``TestFailed`` on failure instead of
- ``AssertionError``.
-
- * ``have_unicode`` - true if Unicode is available, false otherwise.
-
- * ``is_jython`` - true if the interpreter is Jython, false otherwise.
-
- * ``TESTFN`` - a string that should always be used as the filename when
- you need to create a temp file. Also use ``try``/``finally`` to
- ensure that your temp files are deleted before your test completes.
- Note that you cannot unlink an open file on all operating systems, so
- also be sure to close temp files before trying to unlink them.
-
- * ``sortdict(dict)`` - acts like ``repr(dict.items())``, but sorts the
- items first. This is important when printing a dict value, because
- the order of items produced by ``dict.items()`` is not defined by the
- language.
-
- * ``findfile(file)`` - you can call this function to locate a file
- somewhere along sys.path or in the Lib/test tree - see
- test_linuxaudiodev.py for an example of its use.
-
- * ``fcmp(x,y)`` - you can call this function to compare two floating
- point numbers when you expect them to only be approximately equal
- withing a fuzz factor (``test_support.FUZZ``, which defaults to 1e-6).
-
- * ``check_syntax_error(testcase, statement)`` - make sure that the
- statement is *not* correct Python syntax.
-
-
-Some Non-Obvious regrtest Features
-==================================
- * Automagic test detection: When you create a new test file
- test_spam.py, you do not need to modify regrtest (or anything else)
- to advertise its existence. regrtest searches for and runs all
- modules in the test directory with names of the form test_xxx.py.
-
- * Miranda output: If, when running test_spam.py, regrtest does not
- find an expected-output file test/output/test_spam, regrtest
- pretends that it did find one, containing the single line
-
- test_spam
-
- This allows new tests that don't expect to print anything to stdout
- to not bother creating expected-output files.
-
- * Two-stage testing: To run test_spam.py, regrtest imports test_spam
- as a module. Most tests run to completion as a side-effect of
- getting imported. After importing test_spam, regrtest also executes
- ``test_spam.test_main()``, if test_spam has a ``test_main`` attribute.
- This is rarely required with the "traditional" Python tests, and
- you shouldn't create a module global with name test_main unless
- you're specifically exploiting this gimmick. This usage does
- prove useful with unittest-based tests as well, however; defining
- a ``test_main()`` which is run by regrtest and a script-stub in the
- test module ("``if __name__ == '__main__': test_main()``") allows
- the test to be used like any other Python test and also work
- with the unittest.py-as-a-script approach, allowing a developer
- to run specific tests from the command line.
diff --git a/Lib/test/buffer_tests.py b/Lib/test/buffer_tests.py
index db27759d79..d0d8a56f0e 100644
--- a/Lib/test/buffer_tests.py
+++ b/Lib/test/buffer_tests.py
@@ -15,32 +15,32 @@ class MixinBytesBufferCommonTests(object):
def test_islower(self):
self.assertFalse(self.marshal(b'').islower())
- self.assert_(self.marshal(b'a').islower())
+ self.assertTrue(self.marshal(b'a').islower())
self.assertFalse(self.marshal(b'A').islower())
self.assertFalse(self.marshal(b'\n').islower())
- self.assert_(self.marshal(b'abc').islower())
+ self.assertTrue(self.marshal(b'abc').islower())
self.assertFalse(self.marshal(b'aBc').islower())
- self.assert_(self.marshal(b'abc\n').islower())
+ self.assertTrue(self.marshal(b'abc\n').islower())
self.assertRaises(TypeError, self.marshal(b'abc').islower, 42)
def test_isupper(self):
self.assertFalse(self.marshal(b'').isupper())
self.assertFalse(self.marshal(b'a').isupper())
- self.assert_(self.marshal(b'A').isupper())
+ self.assertTrue(self.marshal(b'A').isupper())
self.assertFalse(self.marshal(b'\n').isupper())
- self.assert_(self.marshal(b'ABC').isupper())
+ self.assertTrue(self.marshal(b'ABC').isupper())
self.assertFalse(self.marshal(b'AbC').isupper())
- self.assert_(self.marshal(b'ABC\n').isupper())
+ self.assertTrue(self.marshal(b'ABC\n').isupper())
self.assertRaises(TypeError, self.marshal(b'abc').isupper, 42)
def test_istitle(self):
self.assertFalse(self.marshal(b'').istitle())
self.assertFalse(self.marshal(b'a').istitle())
- self.assert_(self.marshal(b'A').istitle())
+ self.assertTrue(self.marshal(b'A').istitle())
self.assertFalse(self.marshal(b'\n').istitle())
- self.assert_(self.marshal(b'A Titlecased Line').istitle())
- self.assert_(self.marshal(b'A\nTitlecased Line').istitle())
- self.assert_(self.marshal(b'A Titlecased, Line').istitle())
+ self.assertTrue(self.marshal(b'A Titlecased Line').istitle())
+ self.assertTrue(self.marshal(b'A\nTitlecased Line').istitle())
+ self.assertTrue(self.marshal(b'A Titlecased, Line').istitle())
self.assertFalse(self.marshal(b'Not a capitalized String').istitle())
self.assertFalse(self.marshal(b'Not\ta Titlecase String').istitle())
self.assertFalse(self.marshal(b'Not--a Titlecase String').istitle())
@@ -50,31 +50,31 @@ class MixinBytesBufferCommonTests(object):
def test_isspace(self):
self.assertFalse(self.marshal(b'').isspace())
self.assertFalse(self.marshal(b'a').isspace())
- self.assert_(self.marshal(b' ').isspace())
- self.assert_(self.marshal(b'\t').isspace())
- self.assert_(self.marshal(b'\r').isspace())
- self.assert_(self.marshal(b'\n').isspace())
- self.assert_(self.marshal(b' \t\r\n').isspace())
+ self.assertTrue(self.marshal(b' ').isspace())
+ self.assertTrue(self.marshal(b'\t').isspace())
+ self.assertTrue(self.marshal(b'\r').isspace())
+ self.assertTrue(self.marshal(b'\n').isspace())
+ self.assertTrue(self.marshal(b' \t\r\n').isspace())
self.assertFalse(self.marshal(b' \t\r\na').isspace())
self.assertRaises(TypeError, self.marshal(b'abc').isspace, 42)
def test_isalpha(self):
self.assertFalse(self.marshal(b'').isalpha())
- self.assert_(self.marshal(b'a').isalpha())
- self.assert_(self.marshal(b'A').isalpha())
+ self.assertTrue(self.marshal(b'a').isalpha())
+ self.assertTrue(self.marshal(b'A').isalpha())
self.assertFalse(self.marshal(b'\n').isalpha())
- self.assert_(self.marshal(b'abc').isalpha())
+ self.assertTrue(self.marshal(b'abc').isalpha())
self.assertFalse(self.marshal(b'aBc123').isalpha())
self.assertFalse(self.marshal(b'abc\n').isalpha())
self.assertRaises(TypeError, self.marshal(b'abc').isalpha, 42)
def test_isalnum(self):
self.assertFalse(self.marshal(b'').isalnum())
- self.assert_(self.marshal(b'a').isalnum())
- self.assert_(self.marshal(b'A').isalnum())
+ self.assertTrue(self.marshal(b'a').isalnum())
+ self.assertTrue(self.marshal(b'A').isalnum())
self.assertFalse(self.marshal(b'\n').isalnum())
- self.assert_(self.marshal(b'123abc456').isalnum())
- self.assert_(self.marshal(b'a1b3c').isalnum())
+ self.assertTrue(self.marshal(b'123abc456').isalnum())
+ self.assertTrue(self.marshal(b'a1b3c').isalnum())
self.assertFalse(self.marshal(b'aBc000 ').isalnum())
self.assertFalse(self.marshal(b'abc\n').isalnum())
self.assertRaises(TypeError, self.marshal(b'abc').isalnum, 42)
@@ -82,8 +82,8 @@ class MixinBytesBufferCommonTests(object):
def test_isdigit(self):
self.assertFalse(self.marshal(b'').isdigit())
self.assertFalse(self.marshal(b'a').isdigit())
- self.assert_(self.marshal(b'0').isdigit())
- self.assert_(self.marshal(b'0123456789').isdigit())
+ self.assertTrue(self.marshal(b'0').isdigit())
+ self.assertTrue(self.marshal(b'0123456789').isdigit())
self.assertFalse(self.marshal(b'0123456789a').isdigit())
self.assertRaises(TypeError, self.marshal(b'abc').isdigit, 42)
diff --git a/Lib/test/cjkencodings/big5-utf8.txt b/Lib/test/cjkencodings/big5-utf8.txt
new file mode 100644
index 0000000000..a0a534a964
--- /dev/null
+++ b/Lib/test/cjkencodings/big5-utf8.txt
@@ -0,0 +1,9 @@
+如何在 Python 中使用既有的 C library?
+ 在資訊科技快速發展的今天, 開發åŠæ¸¬è©¦è»Ÿé«”的速度是ä¸å®¹å¿½è¦–çš„
+課題. 為加快開發åŠæ¸¬è©¦çš„速度, 我們便常希望能利用一些已開發好的
+library, 並有一個 fast prototyping çš„ programming language å¯
+供使用. ç›®å‰æœ‰è¨±è¨±å¤šå¤šçš„ library 是以 C 寫æˆ, 而 Python 是一個
+fast prototyping 的 programming language. 故我們希望能將既有的
+C library 拿到 Python 的環境中測試åŠæ•´åˆ. 其中最主è¦ä¹Ÿæ˜¯æˆ‘們所
+è¦è¨Žè«–çš„å•é¡Œå°±æ˜¯:
+
diff --git a/Lib/test/cjkencodings/big5.txt b/Lib/test/cjkencodings/big5.txt
new file mode 100644
index 0000000000..f4424959e9
--- /dev/null
+++ b/Lib/test/cjkencodings/big5.txt
@@ -0,0 +1,9 @@
+¦p¦ó¦b Python ¤¤¨Ï¥Î¬J¦³ªº C library?
+¡@¦b¸ê°T¬ì§Þ§Ö³tµo®iªº¤µ¤Ñ, ¶}µo¤Î´ú¸Õ³nÅ骺³t«×¬O¤£®e©¿µøªº
+½ÒÃD. ¬°¥[§Ö¶}µo¤Î´ú¸Õªº³t«×, §Ú­Ì«K±`§Æ±æ¯à§Q¥Î¤@¨Ç¤w¶}µo¦nªº
+library, ¨Ã¦³¤@­Ó fast prototyping ªº programming language ¥i
+¨Ñ¨Ï¥Î. ¥Ø«e¦³³\³\¦h¦hªº library ¬O¥H C ¼g¦¨, ¦Ó Python ¬O¤@­Ó
+fast prototyping ªº programming language. ¬G§Ú­Ì§Æ±æ¯à±N¬J¦³ªº
+C library ®³¨ì Python ªºÀô¹Ò¤¤´ú¸Õ¤Î¾ã¦X. ¨ä¤¤³Ì¥D­n¤]¬O§Ú­Ì©Ò
+­n°Q½×ªº°ÝÃD´N¬O:
+
diff --git a/Lib/test/cjkencodings/big5hkscs-utf8.txt b/Lib/test/cjkencodings/big5hkscs-utf8.txt
new file mode 100644
index 0000000000..f744ce9ae0
--- /dev/null
+++ b/Lib/test/cjkencodings/big5hkscs-utf8.txt
@@ -0,0 +1,2 @@
+𠄌Ě鵮罓洆
+ÊÊ̄ê êê̄
diff --git a/Lib/test/cjkencodings/big5hkscs.txt b/Lib/test/cjkencodings/big5hkscs.txt
new file mode 100644
index 0000000000..81c42b3503
--- /dev/null
+++ b/Lib/test/cjkencodings/big5hkscs.txt
@@ -0,0 +1,2 @@
+ˆEˆ\Šs‹ÚØ
+ˆfˆbˆ§ ˆ§ˆ£
diff --git a/Lib/test/cjkencodings/cp949-utf8.txt b/Lib/test/cjkencodings/cp949-utf8.txt
new file mode 100644
index 0000000000..5655e38517
--- /dev/null
+++ b/Lib/test/cjkencodings/cp949-utf8.txt
@@ -0,0 +1,9 @@
+똠방ê°í•˜ 펲시콜ë¼
+
+㉯㉯납!! å› ä¹æœˆíŒ¨ë¯¤ë¦”궈 ⓡⓖ훀¿¿¿ ê¸ë’™ ⓔ뎨 ㉯. .
+亞ì˜â“”능횹 . . . . 서울뤄 ëŽí•™ä¹™ 家훀 ! ! !ã… .ã… 
+ííí ㄱㄱㄱ☆ㅠ_ã…  어릨 íƒ¸ì½°ê¸ ëŽŒì‘ ì¹‘ä¹ë“¤ä¹™ ㉯드ê¸
+설릌 家훀 . . . . 굴애쉌 ⓔ궈 â“¡ë¦˜ã‰±ê¸ å› ä»å·ï¦ä¸­ê¹Œì¦¼
+와쒀훀 ! ! 亞ì˜â“” 家능궈 ☆上관 없능궈능 亞능뒈훀 글애듴
+â“¡ë ¤ë“€ä¹ ì‹€í’”ìˆ´í›€ 어릨 å› ä»å·ï¦ä¸­ì‹â‘¨ë“¤ì•œ!! ㉯㉯납♡ ⌒⌒*
+
diff --git a/Lib/test/cjkencodings/cp949.txt b/Lib/test/cjkencodings/cp949.txt
new file mode 100644
index 0000000000..16549aa5e4
--- /dev/null
+++ b/Lib/test/cjkencodings/cp949.txt
@@ -0,0 +1,9 @@
+Œc¹æ°¢ÇÏ ¼„½ÃÄݶó
+
+¨À¨À³³!! ì×ÎúêÅÆÐ’æp±Å ¨Þ¨ÓÄR¢¯¢¯¢¯ ±àŠ– ¨Ñµ³ ¨À. .
+䬿µ¨Ñ´ÉÈ . . . . ¼­¿ï·ï µ¯ÇÐëà Ê«ÄR ! ! !¤Ð.¤Ð
+ÈåÈåÈå ¤¡¤¡¤¡¡Ù¤Ð_¤Ð ¾îŠ ÅËÄâƒO µ®ÀÀ ¯hÎúµéëà ¨ÀµåƒO
+¼³j Ê«ÄR . . . . ±¼¾Öšf ¨Ñ±Å ¨Þt¨ÂƒO ì×ìÒô¹åüñé±î£Ž
+¿Í¾¬ÄR ! ! 䬿µ¨Ñ Ê«´É±Å ¡Ùß¾°ü ¾ø´É±Å´É 䬴ɵØÄR ±Û¾ÖŠÛ
+¨Þ·ÁµàÎú šÃÇ´½¤ÄR ¾îŠ ì×ìÒô¹åüñéšÄ¨ïµéÚ!! ¨À¨À³³¢½ ¡Ò¡Ò*
+
diff --git a/Lib/test/cjkencodings/euc_jisx0213-utf8.txt b/Lib/test/cjkencodings/euc_jisx0213-utf8.txt
new file mode 100644
index 0000000000..9a56a2e18b
--- /dev/null
+++ b/Lib/test/cjkencodings/euc_jisx0213-utf8.txt
@@ -0,0 +1,8 @@
+Python ã®é–‹ç™ºã¯ã€1990 å¹´ã”ã‚ã‹ã‚‰é–‹å§‹ã•ã‚Œã¦ã„ã¾ã™ã€‚
+開発者㮠Guido van Rossum ã¯æ•™è‚²ç”¨ã®ãƒ—ログラミング言語「ABCã€ã®é–‹ç™ºã«å‚加ã—ã¦ã„ã¾ã—ãŸãŒã€ABC ã¯å®Ÿç”¨ä¸Šã®ç›®çš„ã«ã¯ã‚ã¾ã‚Šé©ã—ã¦ã„ã¾ã›ã‚“ã§ã—ãŸã€‚
+ã“ã®ãŸã‚ã€Guido ã¯ã‚ˆã‚Šå®Ÿç”¨çš„ãªãƒ—ログラミング言語ã®é–‹ç™ºã‚’開始ã—ã€è‹±å›½ BBS 放é€ã®ã‚³ãƒ¡ãƒ‡ã‚£ç•ªçµ„「モンティ パイソンã€ã®ãƒ•ã‚¡ãƒ³ã§ã‚ã‚‹ Guido ã¯ã“ã®è¨€èªžã‚’「Pythonã€ã¨åã¥ã‘ã¾ã—ãŸã€‚
+ã“ã®ã‚ˆã†ãªèƒŒæ™¯ã‹ã‚‰ç”Ÿã¾ã‚ŒãŸ Python ã®è¨€èªžè¨­è¨ˆã¯ã€ã€Œã‚·ãƒ³ãƒ—ルã€ã§ã€Œç¿’å¾—ãŒå®¹æ˜“ã€ã¨ã„ã†ç›®æ¨™ã«é‡ç‚¹ãŒç½®ã‹ã‚Œã¦ã„ã¾ã™ã€‚
+多ãã®ã‚¹ã‚¯ãƒªãƒ—ト系言語ã§ã¯ãƒ¦ãƒ¼ã‚¶ã®ç›®å…ˆã®åˆ©ä¾¿æ€§ã‚’優先ã—ã¦è‰²ã€…ãªæ©Ÿèƒ½ã‚’言語è¦ç´ ã¨ã—ã¦å–り入れる場åˆãŒå¤šã„ã®ã§ã™ãŒã€Python ã§ã¯ãã†ã„ã£ãŸå°ç´°å·¥ãŒè¿½åŠ ã•ã‚Œã‚‹ã“ã¨ã¯ã‚ã¾ã‚Šã‚ã‚Šã¾ã›ã‚“。
+言語自体ã®æ©Ÿèƒ½ã¯æœ€å°é™ã«æŠ¼ã•ãˆã€å¿…è¦ãªæ©Ÿèƒ½ã¯æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¨ã—ã¦è¿½åŠ ã™ã‚‹ã€ã¨ã„ã†ã®ãŒ Python ã®ãƒãƒªã‚·ãƒ¼ã§ã™ã€‚
+
+ノã‹ã‚š ト゚ トキ喝塀 𡚴𪎌 麀é½ð©›°
diff --git a/Lib/test/cjkencodings/euc_jisx0213.txt b/Lib/test/cjkencodings/euc_jisx0213.txt
new file mode 100644
index 0000000000..51e9268ca9
--- /dev/null
+++ b/Lib/test/cjkencodings/euc_jisx0213.txt
@@ -0,0 +1,8 @@
+Python ¤Î³«È¯¤Ï¡¢1990 ǯ¤´¤í¤«¤é³«»Ï¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
+³«È¯¼Ô¤Î Guido van Rossum ¤Ï¶µ°éÍÑ¤Î¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¡ÖABC¡×¤Î³«È¯¤Ë»²²Ã¤·¤Æ¤¤¤Þ¤·¤¿¤¬¡¢ABC ¤Ï¼ÂÍѾå¤ÎÌÜŪ¤Ë¤Ï¤¢¤Þ¤êŬ¤·¤Æ¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£
+¤³¤Î¤¿¤á¡¢Guido ¤Ï¤è¤ê¼ÂÍÑŪ¤Ê¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¤Î³«È¯¤ò³«»Ï¤·¡¢±Ñ¹ñ BBS ÊüÁ÷¤Î¥³¥á¥Ç¥£ÈÖÁÈ¡Ö¥â¥ó¥Æ¥£ ¥Ñ¥¤¥½¥ó¡×¤Î¥Õ¥¡¥ó¤Ç¤¢¤ë Guido ¤Ï¤³¤Î¸À¸ì¤ò¡ÖPython¡×¤È̾¤Å¤±¤Þ¤·¤¿¡£
+¤³¤Î¤è¤¦¤ÊÇطʤ«¤éÀ¸¤Þ¤ì¤¿ Python ¤Î¸À¸ìÀ߷פϡ¢¡Ö¥·¥ó¥×¥ë¡×¤Ç¡Ö½¬ÆÀ¤¬ÍưספȤ¤¤¦ÌÜɸ¤Ë½ÅÅÀ¤¬ÃÖ¤«¤ì¤Æ¤¤¤Þ¤¹¡£
+¿¤¯¤Î¥¹¥¯¥ê¥×¥È·Ï¸À¸ì¤Ç¤Ï¥æ¡¼¥¶¤ÎÌÜÀè¤ÎÍøÊØÀ­¤òÍ¥À褷¤Æ¿§¡¹¤Êµ¡Ç½¤ò¸À¸ìÍ×ÁǤȤ·¤Æ¼è¤êÆþ¤ì¤ë¾ì¹ç¤¬Â¿¤¤¤Î¤Ç¤¹¤¬¡¢Python ¤Ç¤Ï¤½¤¦¤¤¤Ã¤¿¾®ºÙ¹©¤¬Äɲ䵤ì¤ë¤³¤È¤Ï¤¢¤Þ¤ê¤¢¤ê¤Þ¤»¤ó¡£
+¸À¸ì¼«ÂΤε¡Ç½¤ÏºÇ¾®¸Â¤Ë²¡¤µ¤¨¡¢É¬Íפʵ¡Ç½¤Ï³ÈÄ¥¥â¥¸¥å¡¼¥ë¤È¤·¤ÆÄɲ乤롢¤È¤¤¤¦¤Î¤¬ Python ¤Î¥Ý¥ê¥·¡¼¤Ç¤¹¡£
+
+¥Î¤÷ ¥þ ¥È¥­¯¬¯Ú ÏãþØ þÔþèüÖ
diff --git a/Lib/test/cjkencodings/euc_jp-utf8.txt b/Lib/test/cjkencodings/euc_jp-utf8.txt
new file mode 100644
index 0000000000..7763250ebb
--- /dev/null
+++ b/Lib/test/cjkencodings/euc_jp-utf8.txt
@@ -0,0 +1,7 @@
+Python ã®é–‹ç™ºã¯ã€1990 å¹´ã”ã‚ã‹ã‚‰é–‹å§‹ã•ã‚Œã¦ã„ã¾ã™ã€‚
+開発者㮠Guido van Rossum ã¯æ•™è‚²ç”¨ã®ãƒ—ログラミング言語「ABCã€ã®é–‹ç™ºã«å‚加ã—ã¦ã„ã¾ã—ãŸãŒã€ABC ã¯å®Ÿç”¨ä¸Šã®ç›®çš„ã«ã¯ã‚ã¾ã‚Šé©ã—ã¦ã„ã¾ã›ã‚“ã§ã—ãŸã€‚
+ã“ã®ãŸã‚ã€Guido ã¯ã‚ˆã‚Šå®Ÿç”¨çš„ãªãƒ—ログラミング言語ã®é–‹ç™ºã‚’開始ã—ã€è‹±å›½ BBS 放é€ã®ã‚³ãƒ¡ãƒ‡ã‚£ç•ªçµ„「モンティ パイソンã€ã®ãƒ•ã‚¡ãƒ³ã§ã‚ã‚‹ Guido ã¯ã“ã®è¨€èªžã‚’「Pythonã€ã¨åã¥ã‘ã¾ã—ãŸã€‚
+ã“ã®ã‚ˆã†ãªèƒŒæ™¯ã‹ã‚‰ç”Ÿã¾ã‚ŒãŸ Python ã®è¨€èªžè¨­è¨ˆã¯ã€ã€Œã‚·ãƒ³ãƒ—ルã€ã§ã€Œç¿’å¾—ãŒå®¹æ˜“ã€ã¨ã„ã†ç›®æ¨™ã«é‡ç‚¹ãŒç½®ã‹ã‚Œã¦ã„ã¾ã™ã€‚
+多ãã®ã‚¹ã‚¯ãƒªãƒ—ト系言語ã§ã¯ãƒ¦ãƒ¼ã‚¶ã®ç›®å…ˆã®åˆ©ä¾¿æ€§ã‚’優先ã—ã¦è‰²ã€…ãªæ©Ÿèƒ½ã‚’言語è¦ç´ ã¨ã—ã¦å–り入れる場åˆãŒå¤šã„ã®ã§ã™ãŒã€Python ã§ã¯ãã†ã„ã£ãŸå°ç´°å·¥ãŒè¿½åŠ ã•ã‚Œã‚‹ã“ã¨ã¯ã‚ã¾ã‚Šã‚ã‚Šã¾ã›ã‚“。
+言語自体ã®æ©Ÿèƒ½ã¯æœ€å°é™ã«æŠ¼ã•ãˆã€å¿…è¦ãªæ©Ÿèƒ½ã¯æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¨ã—ã¦è¿½åŠ ã™ã‚‹ã€ã¨ã„ã†ã®ãŒ Python ã®ãƒãƒªã‚·ãƒ¼ã§ã™ã€‚
+
diff --git a/Lib/test/cjkencodings/euc_jp.txt b/Lib/test/cjkencodings/euc_jp.txt
new file mode 100644
index 0000000000..9da6b5d83d
--- /dev/null
+++ b/Lib/test/cjkencodings/euc_jp.txt
@@ -0,0 +1,7 @@
+Python ¤Î³«È¯¤Ï¡¢1990 ǯ¤´¤í¤«¤é³«»Ï¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
+³«È¯¼Ô¤Î Guido van Rossum ¤Ï¶µ°éÍÑ¤Î¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¡ÖABC¡×¤Î³«È¯¤Ë»²²Ã¤·¤Æ¤¤¤Þ¤·¤¿¤¬¡¢ABC ¤Ï¼ÂÍѾå¤ÎÌÜŪ¤Ë¤Ï¤¢¤Þ¤êŬ¤·¤Æ¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£
+¤³¤Î¤¿¤á¡¢Guido ¤Ï¤è¤ê¼ÂÍÑŪ¤Ê¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¤Î³«È¯¤ò³«»Ï¤·¡¢±Ñ¹ñ BBS ÊüÁ÷¤Î¥³¥á¥Ç¥£ÈÖÁÈ¡Ö¥â¥ó¥Æ¥£ ¥Ñ¥¤¥½¥ó¡×¤Î¥Õ¥¡¥ó¤Ç¤¢¤ë Guido ¤Ï¤³¤Î¸À¸ì¤ò¡ÖPython¡×¤È̾¤Å¤±¤Þ¤·¤¿¡£
+¤³¤Î¤è¤¦¤ÊÇطʤ«¤éÀ¸¤Þ¤ì¤¿ Python ¤Î¸À¸ìÀ߷פϡ¢¡Ö¥·¥ó¥×¥ë¡×¤Ç¡Ö½¬ÆÀ¤¬ÍưספȤ¤¤¦ÌÜɸ¤Ë½ÅÅÀ¤¬ÃÖ¤«¤ì¤Æ¤¤¤Þ¤¹¡£
+¿¤¯¤Î¥¹¥¯¥ê¥×¥È·Ï¸À¸ì¤Ç¤Ï¥æ¡¼¥¶¤ÎÌÜÀè¤ÎÍøÊØÀ­¤òÍ¥À褷¤Æ¿§¡¹¤Êµ¡Ç½¤ò¸À¸ìÍ×ÁǤȤ·¤Æ¼è¤êÆþ¤ì¤ë¾ì¹ç¤¬Â¿¤¤¤Î¤Ç¤¹¤¬¡¢Python ¤Ç¤Ï¤½¤¦¤¤¤Ã¤¿¾®ºÙ¹©¤¬Äɲ䵤ì¤ë¤³¤È¤Ï¤¢¤Þ¤ê¤¢¤ê¤Þ¤»¤ó¡£
+¸À¸ì¼«ÂΤε¡Ç½¤ÏºÇ¾®¸Â¤Ë²¡¤µ¤¨¡¢É¬Íפʵ¡Ç½¤Ï³ÈÄ¥¥â¥¸¥å¡¼¥ë¤È¤·¤ÆÄɲ乤롢¤È¤¤¤¦¤Î¤¬ Python ¤Î¥Ý¥ê¥·¡¼¤Ç¤¹¡£
+
diff --git a/Lib/test/cjkencodings/euc_kr-utf8.txt b/Lib/test/cjkencodings/euc_kr-utf8.txt
new file mode 100644
index 0000000000..16c37412b6
--- /dev/null
+++ b/Lib/test/cjkencodings/euc_kr-utf8.txt
@@ -0,0 +1,7 @@
+â—Ž 파ì´ì¬(Python)ì€ ë°°ìš°ê¸° 쉽고, 강력한 í”„ë¡œê·¸ëž˜ë° ì–¸ì–´ìž…ë‹ˆë‹¤. 파ì´ì¬ì€
+효율ì ì¸ 고수준 ë°ì´í„° 구조와 간단하지만 효율ì ì¸ ê°ì²´ì§€í–¥í”„로그래ë°ì„
+지ì›í•©ë‹ˆë‹¤. 파ì´ì¬ì˜ ìš°ì•„(優雅)í•œ 문법과 ë™ì  타ì´í•‘, 그리고 ì¸í„°í”„리팅
+í™˜ê²½ì€ íŒŒì´ì¬ì„ 스í¬ë¦½íŒ…ê³¼ 여러 분야ì—서와 ëŒ€ë¶€ë¶„ì˜ í”Œëž«í¼ì—ì„œì˜ ë¹ ë¥¸
+애플리케ì´ì…˜ ê°œë°œì„ í•  수 있는 ì´ìƒì ì¸ 언어로 만들어ì¤ë‹ˆë‹¤.
+
+☆첫가ë: ë‚ ì•„ë¼ ì“”ì“”ì“©~ ë‹í¼! ëœ½ê¸ˆì—†ì´ ì „í™¥ë‹ˆë‹¤. ë·. 그런거 ìŽë‹¤.
diff --git a/Lib/test/cjkencodings/euc_kr.txt b/Lib/test/cjkencodings/euc_kr.txt
new file mode 100644
index 0000000000..f68dd35028
--- /dev/null
+++ b/Lib/test/cjkencodings/euc_kr.txt
@@ -0,0 +1,7 @@
+¡Ý ÆÄÀ̽ã(Python)Àº ¹è¿ì±â ½±°í, °­·ÂÇÑ ÇÁ·Î±×·¡¹Ö ¾ð¾îÀÔ´Ï´Ù. ÆÄÀ̽ãÀº
+È¿À²ÀûÀÎ °í¼öÁØ µ¥ÀÌÅÍ ±¸Á¶¿Í °£´ÜÇÏÁö¸¸ È¿À²ÀûÀÎ °´Ã¼ÁöÇâÇÁ·Î±×·¡¹ÖÀ»
+Áö¿øÇÕ´Ï´Ù. ÆÄÀ̽ãÀÇ ¿ì¾Æ(éÐäº)ÇÑ ¹®¹ý°ú µ¿Àû ŸÀÌÇÎ, ±×¸®°í ÀÎÅÍÇÁ¸®ÆÃ
+ȯ°æÀº ÆÄÀ̽ãÀ» ½ºÅ©¸³Æðú ¿©·¯ ºÐ¾ß¿¡¼­¿Í ´ëºÎºÐÀÇ Ç÷§Æû¿¡¼­ÀÇ ºü¸¥
+¾ÖÇø®ÄÉÀÌ¼Ç °³¹ßÀ» ÇÒ ¼ö ÀÖ´Â ÀÌ»óÀûÀÎ ¾ð¾î·Î ¸¸µé¾îÁÝ´Ï´Ù.
+
+¡Ùù°¡³¡: ³¯¾Æ¶ó ¤Ô¤¶¤Ð¤Ô¤Ô¤¶¤Ð¤Ô¾±~ ¤Ô¤¤¤Ò¤·Å­! ¤Ô¤¨¤Ñ¤·±Ý¾øÀÌ Àü¤Ô¤¾¤È¤²´Ï´Ù. ¤Ô¤²¤Î¤ª. ±×·±°Å ¤Ô¤·¤Ñ¤´´Ù.
diff --git a/Lib/test/cjkencodings/gb18030-utf8.txt b/Lib/test/cjkencodings/gb18030-utf8.txt
new file mode 100644
index 0000000000..2060d2593e
--- /dev/null
+++ b/Lib/test/cjkencodings/gb18030-utf8.txt
@@ -0,0 +1,15 @@
+Python(派森)语言是一ç§åŠŸèƒ½å¼ºå¤§è€Œå®Œå–„的通用型计算机程åºè®¾è®¡è¯­è¨€ï¼Œ
+å·²ç»å…·æœ‰å多年的å‘展历å²ï¼Œæˆç†Ÿä¸”稳定。这ç§è¯­è¨€å…·æœ‰éžå¸¸ç®€æ·è€Œæ¸…æ™°
+的语法特点,适åˆå®Œæˆå„ç§é«˜å±‚任务,几乎å¯ä»¥åœ¨æ‰€æœ‰çš„æ“作系统中
+è¿è¡Œã€‚è¿™ç§è¯­è¨€ç®€å•è€Œå¼ºå¤§ï¼Œé€‚åˆå„ç§äººå£«å­¦ä¹ ä½¿ç”¨ã€‚ç›®å‰ï¼ŒåŸºäºŽè¿™
+ç§è¯­è¨€çš„相关技术正在飞速的å‘展,用户数é‡æ€¥å‰§æ‰©å¤§ï¼Œç›¸å…³çš„资æºéžå¸¸å¤šã€‚
+如何在 Python 中使用既有的 C library?
+ 在資訊科技快速發展的今天, 開發åŠæ¸¬è©¦è»Ÿé«”的速度是ä¸å®¹å¿½è¦–çš„
+課題. 為加快開發åŠæ¸¬è©¦çš„速度, 我們便常希望能利用一些已開發好的
+library, 並有一個 fast prototyping çš„ programming language å¯
+供使用. ç›®å‰æœ‰è¨±è¨±å¤šå¤šçš„ library 是以 C 寫æˆ, 而 Python 是一個
+fast prototyping 的 programming language. 故我們希望能將既有的
+C library 拿到 Python 的環境中測試åŠæ•´åˆ. 其中最主è¦ä¹Ÿæ˜¯æˆ‘們所
+è¦è¨Žè«–çš„å•é¡Œå°±æ˜¯:
+파ì´ì¬ì€ 강력한 ê¸°ëŠ¥ì„ ì§€ë‹Œ 범용 컴퓨터 í”„ë¡œê·¸ëž˜ë° ì–¸ì–´ë‹¤.
+
diff --git a/Lib/test/cjkencodings/gb18030.txt b/Lib/test/cjkencodings/gb18030.txt
new file mode 100644
index 0000000000..5d1f6dca23
--- /dev/null
+++ b/Lib/test/cjkencodings/gb18030.txt
@@ -0,0 +1,15 @@
+Python£¨ÅÉÉ­£©ÓïÑÔÊÇÒ»ÖÖ¹¦ÄÜÇ¿´ó¶øÍêÉƵÄͨÓÃÐͼÆËã»ú³ÌÐòÉè¼ÆÓïÑÔ£¬
+ÒѾ­¾ßÓÐÊ®¶àÄêµÄ·¢Õ¹ÀúÊ·£¬³ÉÊìÇÒÎȶ¨¡£ÕâÖÖÓïÑÔ¾ßÓзdz£¼ò½Ý¶øÇåÎú
+µÄÓï·¨Ìص㣬ÊʺÏÍê³É¸÷Öָ߲ãÈÎÎñ£¬¼¸ºõ¿ÉÒÔÔÚËùÓеIJÙ×÷ϵͳÖÐ
+ÔËÐС£ÕâÖÖÓïÑÔ¼òµ¥¶øÇ¿´ó£¬Êʺϸ÷ÖÖÈËʿѧϰʹÓá£Ä¿Ç°£¬»ùÓÚÕâ
+ÖÖÓïÑÔµÄÏà¹Ø¼¼ÊõÕýÔÚ·ÉËٵķ¢Õ¹£¬Óû§ÊýÁ¿¼±¾çÀ©´ó£¬Ïà¹ØµÄ×ÊÔ´·Ç³£¶à¡£
+ÈçºÎÔÚ Python ÖÐʹÓüÈÓÐµÄ C library?
+¡¡ÔÚÙYӿƼ¼¿ìËÙ°lÕ¹µÄ½ñÌì, é_°l¼°œyԇܛówµÄËÙ¶ÈÊDz»ÈݺöÒ•µÄ
+Õnî}. žé¼Ó¿ìé_°l¼°œyÔ‡µÄËÙ¶È, ÎÒ‚ƒ±ã³£Ï£ÍûÄÜÀûÓÃһЩÒÑé_°lºÃµÄ
+library, KÓÐÒ»‚€ fast prototyping µÄ programming language ¿É
+¹©Ê¹ÓÃ. Ä¿Ç°ÓÐÔSÔS¶à¶àµÄ library ÊÇÒÔ C Œ‘³É, ¶ø Python ÊÇÒ»‚€
+fast prototyping µÄ programming language. ¹ÊÎÒ‚ƒÏ£ÍûÄÜŒ¢¼ÈÓеÄ
+C library Äõ½ Python µÄ­h¾³ÖÐœyÔ‡¼°ÕûºÏ. ÆäÖÐ×îÖ÷ÒªÒ²ÊÇÎÒ‚ƒËù
+ÒªÓ‘Õ“µÄ†–î}¾ÍÊÇ:
+ƒ5Ç1ƒ3š3ƒ2±1ƒ3•1 ‚7Ñ6ƒ0Œ4ƒ6„3 ‚8‰5‚8û6ƒ3•5 ƒ3Õ1‚95 ƒ0ý9ƒ3†0 ƒ4Ü3ƒ5ö7ƒ5—5 ƒ5ù5ƒ0‘9‚8ƒ9‚9ü3ƒ0ð4 ƒ2ë9ƒ2ë5‚9ƒ9.
+
diff --git a/Lib/test/cjkencodings/gb2312-utf8.txt b/Lib/test/cjkencodings/gb2312-utf8.txt
new file mode 100644
index 0000000000..efb7d8f95c
--- /dev/null
+++ b/Lib/test/cjkencodings/gb2312-utf8.txt
@@ -0,0 +1,6 @@
+Python(派森)语言是一ç§åŠŸèƒ½å¼ºå¤§è€Œå®Œå–„的通用型计算机程åºè®¾è®¡è¯­è¨€ï¼Œ
+å·²ç»å…·æœ‰å多年的å‘展历å²ï¼Œæˆç†Ÿä¸”稳定。这ç§è¯­è¨€å…·æœ‰éžå¸¸ç®€æ·è€Œæ¸…æ™°
+的语法特点,适åˆå®Œæˆå„ç§é«˜å±‚任务,几乎å¯ä»¥åœ¨æ‰€æœ‰çš„æ“作系统中
+è¿è¡Œã€‚è¿™ç§è¯­è¨€ç®€å•è€Œå¼ºå¤§ï¼Œé€‚åˆå„ç§äººå£«å­¦ä¹ ä½¿ç”¨ã€‚ç›®å‰ï¼ŒåŸºäºŽè¿™
+ç§è¯­è¨€çš„相关技术正在飞速的å‘展,用户数é‡æ€¥å‰§æ‰©å¤§ï¼Œç›¸å…³çš„资æºéžå¸¸å¤šã€‚
+
diff --git a/Lib/test/cjkencodings/gb2312.txt b/Lib/test/cjkencodings/gb2312.txt
new file mode 100644
index 0000000000..1536ac10b9
--- /dev/null
+++ b/Lib/test/cjkencodings/gb2312.txt
@@ -0,0 +1,6 @@
+Python£¨ÅÉÉ­£©ÓïÑÔÊÇÒ»ÖÖ¹¦ÄÜÇ¿´ó¶øÍêÉƵÄͨÓÃÐͼÆËã»ú³ÌÐòÉè¼ÆÓïÑÔ£¬
+ÒѾ­¾ßÓÐÊ®¶àÄêµÄ·¢Õ¹ÀúÊ·£¬³ÉÊìÇÒÎȶ¨¡£ÕâÖÖÓïÑÔ¾ßÓзdz£¼ò½Ý¶øÇåÎú
+µÄÓï·¨Ìص㣬ÊʺÏÍê³É¸÷Öָ߲ãÈÎÎñ£¬¼¸ºõ¿ÉÒÔÔÚËùÓеIJÙ×÷ϵͳÖÐ
+ÔËÐС£ÕâÖÖÓïÑÔ¼òµ¥¶øÇ¿´ó£¬Êʺϸ÷ÖÖÈËʿѧϰʹÓá£Ä¿Ç°£¬»ùÓÚÕâ
+ÖÖÓïÑÔµÄÏà¹Ø¼¼ÊõÕýÔÚ·ÉËٵķ¢Õ¹£¬Óû§ÊýÁ¿¼±¾çÀ©´ó£¬Ïà¹ØµÄ×ÊÔ´·Ç³£¶à¡£
+
diff --git a/Lib/test/cjkencodings/gbk-utf8.txt b/Lib/test/cjkencodings/gbk-utf8.txt
new file mode 100644
index 0000000000..75bbd31ec5
--- /dev/null
+++ b/Lib/test/cjkencodings/gbk-utf8.txt
@@ -0,0 +1,14 @@
+Python(派森)语言是一ç§åŠŸèƒ½å¼ºå¤§è€Œå®Œå–„的通用型计算机程åºè®¾è®¡è¯­è¨€ï¼Œ
+å·²ç»å…·æœ‰å多年的å‘展历å²ï¼Œæˆç†Ÿä¸”稳定。这ç§è¯­è¨€å…·æœ‰éžå¸¸ç®€æ·è€Œæ¸…æ™°
+的语法特点,适åˆå®Œæˆå„ç§é«˜å±‚任务,几乎å¯ä»¥åœ¨æ‰€æœ‰çš„æ“作系统中
+è¿è¡Œã€‚è¿™ç§è¯­è¨€ç®€å•è€Œå¼ºå¤§ï¼Œé€‚åˆå„ç§äººå£«å­¦ä¹ ä½¿ç”¨ã€‚ç›®å‰ï¼ŒåŸºäºŽè¿™
+ç§è¯­è¨€çš„相关技术正在飞速的å‘展,用户数é‡æ€¥å‰§æ‰©å¤§ï¼Œç›¸å…³çš„资æºéžå¸¸å¤šã€‚
+如何在 Python 中使用既有的 C library?
+ 在資訊科技快速發展的今天, 開發åŠæ¸¬è©¦è»Ÿé«”的速度是ä¸å®¹å¿½è¦–çš„
+課題. 為加快開發åŠæ¸¬è©¦çš„速度, 我們便常希望能利用一些已開發好的
+library, 並有一個 fast prototyping çš„ programming language å¯
+供使用. ç›®å‰æœ‰è¨±è¨±å¤šå¤šçš„ library 是以 C 寫æˆ, 而 Python 是一個
+fast prototyping 的 programming language. 故我們希望能將既有的
+C library 拿到 Python 的環境中測試åŠæ•´åˆ. 其中最主è¦ä¹Ÿæ˜¯æˆ‘們所
+è¦è¨Žè«–çš„å•é¡Œå°±æ˜¯:
+
diff --git a/Lib/test/cjkencodings/gbk.txt b/Lib/test/cjkencodings/gbk.txt
new file mode 100644
index 0000000000..8788f8a2dc
--- /dev/null
+++ b/Lib/test/cjkencodings/gbk.txt
@@ -0,0 +1,14 @@
+Python£¨ÅÉÉ­£©ÓïÑÔÊÇÒ»ÖÖ¹¦ÄÜÇ¿´ó¶øÍêÉƵÄͨÓÃÐͼÆËã»ú³ÌÐòÉè¼ÆÓïÑÔ£¬
+ÒѾ­¾ßÓÐÊ®¶àÄêµÄ·¢Õ¹ÀúÊ·£¬³ÉÊìÇÒÎȶ¨¡£ÕâÖÖÓïÑÔ¾ßÓзdz£¼ò½Ý¶øÇåÎú
+µÄÓï·¨Ìص㣬ÊʺÏÍê³É¸÷Öָ߲ãÈÎÎñ£¬¼¸ºõ¿ÉÒÔÔÚËùÓеIJÙ×÷ϵͳÖÐ
+ÔËÐС£ÕâÖÖÓïÑÔ¼òµ¥¶øÇ¿´ó£¬Êʺϸ÷ÖÖÈËʿѧϰʹÓá£Ä¿Ç°£¬»ùÓÚÕâ
+ÖÖÓïÑÔµÄÏà¹Ø¼¼ÊõÕýÔÚ·ÉËٵķ¢Õ¹£¬Óû§ÊýÁ¿¼±¾çÀ©´ó£¬Ïà¹ØµÄ×ÊÔ´·Ç³£¶à¡£
+ÈçºÎÔÚ Python ÖÐʹÓüÈÓÐµÄ C library?
+¡¡ÔÚÙYӿƼ¼¿ìËÙ°lÕ¹µÄ½ñÌì, é_°l¼°œyԇܛówµÄËÙ¶ÈÊDz»ÈݺöÒ•µÄ
+Õnî}. žé¼Ó¿ìé_°l¼°œyÔ‡µÄËÙ¶È, ÎÒ‚ƒ±ã³£Ï£ÍûÄÜÀûÓÃһЩÒÑé_°lºÃµÄ
+library, KÓÐÒ»‚€ fast prototyping µÄ programming language ¿É
+¹©Ê¹ÓÃ. Ä¿Ç°ÓÐÔSÔS¶à¶àµÄ library ÊÇÒÔ C Œ‘³É, ¶ø Python ÊÇÒ»‚€
+fast prototyping µÄ programming language. ¹ÊÎÒ‚ƒÏ£ÍûÄÜŒ¢¼ÈÓеÄ
+C library Äõ½ Python µÄ­h¾³ÖÐœyÔ‡¼°ÕûºÏ. ÆäÖÐ×îÖ÷ÒªÒ²ÊÇÎÒ‚ƒËù
+ÒªÓ‘Õ“µÄ†–î}¾ÍÊÇ:
+
diff --git a/Lib/test/cjkencodings/johab-utf8.txt b/Lib/test/cjkencodings/johab-utf8.txt
new file mode 100644
index 0000000000..5655e38517
--- /dev/null
+++ b/Lib/test/cjkencodings/johab-utf8.txt
@@ -0,0 +1,9 @@
+똠방ê°í•˜ 펲시콜ë¼
+
+㉯㉯납!! å› ä¹æœˆíŒ¨ë¯¤ë¦”궈 ⓡⓖ훀¿¿¿ ê¸ë’™ ⓔ뎨 ㉯. .
+亞ì˜â“”능횹 . . . . 서울뤄 ëŽí•™ä¹™ 家훀 ! ! !ã… .ã… 
+ííí ㄱㄱㄱ☆ㅠ_ã…  어릨 íƒ¸ì½°ê¸ ëŽŒì‘ ì¹‘ä¹ë“¤ä¹™ ㉯드ê¸
+설릌 家훀 . . . . 굴애쉌 ⓔ궈 â“¡ë¦˜ã‰±ê¸ å› ä»å·ï¦ä¸­ê¹Œì¦¼
+와쒀훀 ! ! 亞ì˜â“” 家능궈 ☆上관 없능궈능 亞능뒈훀 글애듴
+â“¡ë ¤ë“€ä¹ ì‹€í’”ìˆ´í›€ 어릨 å› ä»å·ï¦ä¸­ì‹â‘¨ë“¤ì•œ!! ㉯㉯납♡ ⌒⌒*
+
diff --git a/Lib/test/cjkencodings/johab.txt b/Lib/test/cjkencodings/johab.txt
new file mode 100644
index 0000000000..067781b785
--- /dev/null
+++ b/Lib/test/cjkencodings/johab.txt
@@ -0,0 +1,9 @@
+™±¤wˆbÐa Í\¯¡Å©œa
+
+ÜÀÜÀs!! ñgâœðUÌ£‰Ÿ…Š¡ ÜÞÜÓÒzٯٯٯ ‹w–Ó ÜÑ• ÜÀ. .
+í<µwÜÑ“wÒs . . . . ¬á¶‰ž¡ •eÐbðà à;Òz ! ! !‡A.‡A
+ÓaÓaÓa ˆAˆAˆAÙi‡A_‡A ´áŸš È¡ÅÁ‹z •a·w ×✗iðà ÜÀ—a‹z
+¬éŸz à;Òz . . . . Š‰´®º ÜÑŠ¡ ÜÞŸ‰Ü‹z ñgñbõIíüóéŒa»š
+µÁ²¡Òz ! ! í<µwÜÑ à;“wŠ¡ Ùi꾉Š´ô“wŠ¡“w í<“w–ÁÒz ‹i´—z
+ÜÞa—A✠¯Î¡®¡Òz ´áŸš ñgñbõIíüó鯂Üï—i´z!! ÜÀÜÀsÙ½ ÙbÙb*
+
diff --git a/Lib/test/cjkencodings/shift_jis-utf8.txt b/Lib/test/cjkencodings/shift_jis-utf8.txt
new file mode 100644
index 0000000000..7763250ebb
--- /dev/null
+++ b/Lib/test/cjkencodings/shift_jis-utf8.txt
@@ -0,0 +1,7 @@
+Python ã®é–‹ç™ºã¯ã€1990 å¹´ã”ã‚ã‹ã‚‰é–‹å§‹ã•ã‚Œã¦ã„ã¾ã™ã€‚
+開発者㮠Guido van Rossum ã¯æ•™è‚²ç”¨ã®ãƒ—ログラミング言語「ABCã€ã®é–‹ç™ºã«å‚加ã—ã¦ã„ã¾ã—ãŸãŒã€ABC ã¯å®Ÿç”¨ä¸Šã®ç›®çš„ã«ã¯ã‚ã¾ã‚Šé©ã—ã¦ã„ã¾ã›ã‚“ã§ã—ãŸã€‚
+ã“ã®ãŸã‚ã€Guido ã¯ã‚ˆã‚Šå®Ÿç”¨çš„ãªãƒ—ログラミング言語ã®é–‹ç™ºã‚’開始ã—ã€è‹±å›½ BBS 放é€ã®ã‚³ãƒ¡ãƒ‡ã‚£ç•ªçµ„「モンティ パイソンã€ã®ãƒ•ã‚¡ãƒ³ã§ã‚ã‚‹ Guido ã¯ã“ã®è¨€èªžã‚’「Pythonã€ã¨åã¥ã‘ã¾ã—ãŸã€‚
+ã“ã®ã‚ˆã†ãªèƒŒæ™¯ã‹ã‚‰ç”Ÿã¾ã‚ŒãŸ Python ã®è¨€èªžè¨­è¨ˆã¯ã€ã€Œã‚·ãƒ³ãƒ—ルã€ã§ã€Œç¿’å¾—ãŒå®¹æ˜“ã€ã¨ã„ã†ç›®æ¨™ã«é‡ç‚¹ãŒç½®ã‹ã‚Œã¦ã„ã¾ã™ã€‚
+多ãã®ã‚¹ã‚¯ãƒªãƒ—ト系言語ã§ã¯ãƒ¦ãƒ¼ã‚¶ã®ç›®å…ˆã®åˆ©ä¾¿æ€§ã‚’優先ã—ã¦è‰²ã€…ãªæ©Ÿèƒ½ã‚’言語è¦ç´ ã¨ã—ã¦å–り入れる場åˆãŒå¤šã„ã®ã§ã™ãŒã€Python ã§ã¯ãã†ã„ã£ãŸå°ç´°å·¥ãŒè¿½åŠ ã•ã‚Œã‚‹ã“ã¨ã¯ã‚ã¾ã‚Šã‚ã‚Šã¾ã›ã‚“。
+言語自体ã®æ©Ÿèƒ½ã¯æœ€å°é™ã«æŠ¼ã•ãˆã€å¿…è¦ãªæ©Ÿèƒ½ã¯æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¨ã—ã¦è¿½åŠ ã™ã‚‹ã€ã¨ã„ã†ã®ãŒ Python ã®ãƒãƒªã‚·ãƒ¼ã§ã™ã€‚
+
diff --git a/Lib/test/cjkencodings/shift_jis.txt b/Lib/test/cjkencodings/shift_jis.txt
new file mode 100644
index 0000000000..10b760d867
--- /dev/null
+++ b/Lib/test/cjkencodings/shift_jis.txt
@@ -0,0 +1,7 @@
+Python ‚ÌŠJ”­‚ÍA1990 ”N‚²‚ë‚©‚çŠJŽn‚³‚ê‚Ä‚¢‚Ü‚·B
+ŠJ”­ŽÒ‚Ì Guido van Rossum ‚Í‹³ˆç—p‚̃vƒƒOƒ‰ƒ~ƒ“ƒOŒ¾ŒêuABCv‚ÌŠJ”­‚ÉŽQ‰Á‚µ‚Ä‚¢‚Ü‚µ‚½‚ªAABC ‚ÍŽÀ—pã‚Ì–Ú“I‚É‚Í‚ ‚Ü‚è“K‚µ‚Ä‚¢‚Ü‚¹‚ñ‚Å‚µ‚½B
+‚±‚Ì‚½‚ßAGuido ‚Í‚æ‚èŽÀ—p“I‚ȃvƒƒOƒ‰ƒ~ƒ“ƒOŒ¾Œê‚ÌŠJ”­‚ðŠJŽn‚µA‰p‘ BBS •ú‘—‚̃RƒƒfƒB”Ô‘guƒ‚ƒ“ƒeƒB ƒpƒCƒ\ƒ“v‚̃tƒ@ƒ“‚Å‚ ‚é Guido ‚Í‚±‚ÌŒ¾Œê‚ðuPythonv‚Æ–¼‚¯‚Ü‚µ‚½B
+‚±‚̂悤‚È”wŒi‚©‚綂܂ꂽ Python ‚ÌŒ¾ŒêÝŒv‚ÍAuƒVƒ“ƒvƒ‹v‚ÅuK“¾‚ª—eˆÕv‚Æ‚¢‚¤–Ú•W‚Éd“_‚ª’u‚©‚ê‚Ä‚¢‚Ü‚·B
+‘½‚­‚̃XƒNƒŠƒvƒgŒnŒ¾Œê‚ł̓†[ƒU‚Ì–Úæ‚Ì—˜•Ö«‚ð—D悵‚ÄFX‚È‹@”\‚ðŒ¾Œê—v‘f‚Æ‚µ‚ÄŽæ‚è“ü‚ê‚éꇂª‘½‚¢‚Ì‚Å‚·‚ªAPython ‚Å‚Í‚»‚¤‚¢‚Á‚½¬×H‚ª’ljÁ‚³‚ê‚邱‚Æ‚Í‚ ‚Ü‚è‚ ‚è‚Ü‚¹‚ñB
+Œ¾ŒêŽ©‘Ì‚Ì‹@”\‚ÍŬŒÀ‚ɉŸ‚³‚¦A•K—v‚È‹@”\‚ÍŠg’£ƒ‚ƒWƒ…[ƒ‹‚Æ‚µ‚ĒljÁ‚·‚éA‚Æ‚¢‚¤‚Ì‚ª Python ‚̃|ƒŠƒV[‚Å‚·B
+
diff --git a/Lib/test/cjkencodings/shift_jisx0213-utf8.txt b/Lib/test/cjkencodings/shift_jisx0213-utf8.txt
new file mode 100644
index 0000000000..9a56a2e18b
--- /dev/null
+++ b/Lib/test/cjkencodings/shift_jisx0213-utf8.txt
@@ -0,0 +1,8 @@
+Python ã®é–‹ç™ºã¯ã€1990 å¹´ã”ã‚ã‹ã‚‰é–‹å§‹ã•ã‚Œã¦ã„ã¾ã™ã€‚
+開発者㮠Guido van Rossum ã¯æ•™è‚²ç”¨ã®ãƒ—ログラミング言語「ABCã€ã®é–‹ç™ºã«å‚加ã—ã¦ã„ã¾ã—ãŸãŒã€ABC ã¯å®Ÿç”¨ä¸Šã®ç›®çš„ã«ã¯ã‚ã¾ã‚Šé©ã—ã¦ã„ã¾ã›ã‚“ã§ã—ãŸã€‚
+ã“ã®ãŸã‚ã€Guido ã¯ã‚ˆã‚Šå®Ÿç”¨çš„ãªãƒ—ログラミング言語ã®é–‹ç™ºã‚’開始ã—ã€è‹±å›½ BBS 放é€ã®ã‚³ãƒ¡ãƒ‡ã‚£ç•ªçµ„「モンティ パイソンã€ã®ãƒ•ã‚¡ãƒ³ã§ã‚ã‚‹ Guido ã¯ã“ã®è¨€èªžã‚’「Pythonã€ã¨åã¥ã‘ã¾ã—ãŸã€‚
+ã“ã®ã‚ˆã†ãªèƒŒæ™¯ã‹ã‚‰ç”Ÿã¾ã‚ŒãŸ Python ã®è¨€èªžè¨­è¨ˆã¯ã€ã€Œã‚·ãƒ³ãƒ—ルã€ã§ã€Œç¿’å¾—ãŒå®¹æ˜“ã€ã¨ã„ã†ç›®æ¨™ã«é‡ç‚¹ãŒç½®ã‹ã‚Œã¦ã„ã¾ã™ã€‚
+多ãã®ã‚¹ã‚¯ãƒªãƒ—ト系言語ã§ã¯ãƒ¦ãƒ¼ã‚¶ã®ç›®å…ˆã®åˆ©ä¾¿æ€§ã‚’優先ã—ã¦è‰²ã€…ãªæ©Ÿèƒ½ã‚’言語è¦ç´ ã¨ã—ã¦å–り入れる場åˆãŒå¤šã„ã®ã§ã™ãŒã€Python ã§ã¯ãã†ã„ã£ãŸå°ç´°å·¥ãŒè¿½åŠ ã•ã‚Œã‚‹ã“ã¨ã¯ã‚ã¾ã‚Šã‚ã‚Šã¾ã›ã‚“。
+言語自体ã®æ©Ÿèƒ½ã¯æœ€å°é™ã«æŠ¼ã•ãˆã€å¿…è¦ãªæ©Ÿèƒ½ã¯æ‹¡å¼µãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«ã¨ã—ã¦è¿½åŠ ã™ã‚‹ã€ã¨ã„ã†ã®ãŒ Python ã®ãƒãƒªã‚·ãƒ¼ã§ã™ã€‚
+
+ノã‹ã‚š ト゚ トキ喝塀 𡚴𪎌 麀é½ð©›°
diff --git a/Lib/test/cjkencodings/shift_jisx0213.txt b/Lib/test/cjkencodings/shift_jisx0213.txt
new file mode 100644
index 0000000000..08c9ef4630
--- /dev/null
+++ b/Lib/test/cjkencodings/shift_jisx0213.txt
@@ -0,0 +1,8 @@
+Python ‚ÌŠJ”­‚ÍA1990 ”N‚²‚ë‚©‚çŠJŽn‚³‚ê‚Ä‚¢‚Ü‚·B
+ŠJ”­ŽÒ‚Ì Guido van Rossum ‚Í‹³ˆç—p‚̃vƒƒOƒ‰ƒ~ƒ“ƒOŒ¾ŒêuABCv‚ÌŠJ”­‚ÉŽQ‰Á‚µ‚Ä‚¢‚Ü‚µ‚½‚ªAABC ‚ÍŽÀ—pã‚Ì–Ú“I‚É‚Í‚ ‚Ü‚è“K‚µ‚Ä‚¢‚Ü‚¹‚ñ‚Å‚µ‚½B
+‚±‚Ì‚½‚ßAGuido ‚Í‚æ‚èŽÀ—p“I‚ȃvƒƒOƒ‰ƒ~ƒ“ƒOŒ¾Œê‚ÌŠJ”­‚ðŠJŽn‚µA‰p‘ BBS •ú‘—‚̃RƒƒfƒB”Ô‘guƒ‚ƒ“ƒeƒB ƒpƒCƒ\ƒ“v‚̃tƒ@ƒ“‚Å‚ ‚é Guido ‚Í‚±‚ÌŒ¾Œê‚ðuPythonv‚Æ–¼‚¯‚Ü‚µ‚½B
+‚±‚̂悤‚È”wŒi‚©‚綂܂ꂽ Python ‚ÌŒ¾ŒêÝŒv‚ÍAuƒVƒ“ƒvƒ‹v‚ÅuK“¾‚ª—eˆÕv‚Æ‚¢‚¤–Ú•W‚Éd“_‚ª’u‚©‚ê‚Ä‚¢‚Ü‚·B
+‘½‚­‚̃XƒNƒŠƒvƒgŒnŒ¾Œê‚ł̓†[ƒU‚Ì–Úæ‚Ì—˜•Ö«‚ð—D悵‚ÄFX‚È‹@”\‚ðŒ¾Œê—v‘f‚Æ‚µ‚ÄŽæ‚è“ü‚ê‚éꇂª‘½‚¢‚Ì‚Å‚·‚ªAPython ‚Å‚Í‚»‚¤‚¢‚Á‚½¬×H‚ª’ljÁ‚³‚ê‚邱‚Æ‚Í‚ ‚Ü‚è‚ ‚è‚Ü‚¹‚ñB
+Œ¾ŒêŽ©‘Ì‚Ì‹@”\‚ÍŬŒÀ‚ɉŸ‚³‚¦A•K—v‚È‹@”\‚ÍŠg’£ƒ‚ƒWƒ…[ƒ‹‚Æ‚µ‚ĒljÁ‚·‚éA‚Æ‚¢‚¤‚Ì‚ª Python ‚̃|ƒŠƒV[‚Å‚·B
+
+ƒm‚õ ƒž ƒgƒLˆKˆy ˜ƒüÖ üÒüæûÔ
diff --git a/Lib/test/cjkencodings_test.py b/Lib/test/cjkencodings_test.py
deleted file mode 100644
index 31432d19fd..0000000000
--- a/Lib/test/cjkencodings_test.py
+++ /dev/null
@@ -1,1019 +0,0 @@
-teststring = {
-'big5': (
-"\xa6\x70\xa6\xf3\xa6\x62\x20\x50\x79\x74\x68\x6f\x6e\x20\xa4\xa4"
-"\xa8\xcf\xa5\xce\xac\x4a\xa6\xb3\xaa\xba\x20\x43\x20\x6c\x69\x62"
-"\x72\x61\x72\x79\x3f\x0a\xa1\x40\xa6\x62\xb8\xea\xb0\x54\xac\xec"
-"\xa7\xde\xa7\xd6\xb3\x74\xb5\x6f\xae\x69\xaa\xba\xa4\xb5\xa4\xd1"
-"\x2c\x20\xb6\x7d\xb5\x6f\xa4\xce\xb4\xfa\xb8\xd5\xb3\x6e\xc5\xe9"
-"\xaa\xba\xb3\x74\xab\xd7\xac\x4f\xa4\xa3\xae\x65\xa9\xbf\xb5\xf8"
-"\xaa\xba\x0a\xbd\xd2\xc3\x44\x2e\x20\xac\xb0\xa5\x5b\xa7\xd6\xb6"
-"\x7d\xb5\x6f\xa4\xce\xb4\xfa\xb8\xd5\xaa\xba\xb3\x74\xab\xd7\x2c"
-"\x20\xa7\xda\xad\xcc\xab\x4b\xb1\x60\xa7\xc6\xb1\xe6\xaf\xe0\xa7"
-"\x51\xa5\xce\xa4\x40\xa8\xc7\xa4\x77\xb6\x7d\xb5\x6f\xa6\x6e\xaa"
-"\xba\x0a\x6c\x69\x62\x72\x61\x72\x79\x2c\x20\xa8\xc3\xa6\xb3\xa4"
-"\x40\xad\xd3\x20\x66\x61\x73\x74\x20\x70\x72\x6f\x74\x6f\x74\x79"
-"\x70\x69\x6e\x67\x20\xaa\xba\x20\x70\x72\x6f\x67\x72\x61\x6d\x6d"
-"\x69\x6e\x67\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20\xa5\x69\x0a"
-"\xa8\xd1\xa8\xcf\xa5\xce\x2e\x20\xa5\xd8\xab\x65\xa6\xb3\xb3\x5c"
-"\xb3\x5c\xa6\x68\xa6\x68\xaa\xba\x20\x6c\x69\x62\x72\x61\x72\x79"
-"\x20\xac\x4f\xa5\x48\x20\x43\x20\xbc\x67\xa6\xa8\x2c\x20\xa6\xd3"
-"\x20\x50\x79\x74\x68\x6f\x6e\x20\xac\x4f\xa4\x40\xad\xd3\x0a\x66"
-"\x61\x73\x74\x20\x70\x72\x6f\x74\x6f\x74\x79\x70\x69\x6e\x67\x20"
-"\xaa\xba\x20\x70\x72\x6f\x67\x72\x61\x6d\x6d\x69\x6e\x67\x20\x6c"
-"\x61\x6e\x67\x75\x61\x67\x65\x2e\x20\xac\x47\xa7\xda\xad\xcc\xa7"
-"\xc6\xb1\xe6\xaf\xe0\xb1\x4e\xac\x4a\xa6\xb3\xaa\xba\x0a\x43\x20"
-"\x6c\x69\x62\x72\x61\x72\x79\x20\xae\xb3\xa8\xec\x20\x50\x79\x74"
-"\x68\x6f\x6e\x20\xaa\xba\xc0\xf4\xb9\xd2\xa4\xa4\xb4\xfa\xb8\xd5"
-"\xa4\xce\xbe\xe3\xa6\x58\x2e\x20\xa8\xe4\xa4\xa4\xb3\xcc\xa5\x44"
-"\xad\x6e\xa4\x5d\xac\x4f\xa7\xda\xad\xcc\xa9\xd2\x0a\xad\x6e\xb0"
-"\x51\xbd\xd7\xaa\xba\xb0\xdd\xc3\x44\xb4\x4e\xac\x4f\x3a\x0a\x0a",
-"\xe5\xa6\x82\xe4\xbd\x95\xe5\x9c\xa8\x20\x50\x79\x74\x68\x6f\x6e"
-"\x20\xe4\xb8\xad\xe4\xbd\xbf\xe7\x94\xa8\xe6\x97\xa2\xe6\x9c\x89"
-"\xe7\x9a\x84\x20\x43\x20\x6c\x69\x62\x72\x61\x72\x79\x3f\x0a\xe3"
-"\x80\x80\xe5\x9c\xa8\xe8\xb3\x87\xe8\xa8\x8a\xe7\xa7\x91\xe6\x8a"
-"\x80\xe5\xbf\xab\xe9\x80\x9f\xe7\x99\xbc\xe5\xb1\x95\xe7\x9a\x84"
-"\xe4\xbb\x8a\xe5\xa4\xa9\x2c\x20\xe9\x96\x8b\xe7\x99\xbc\xe5\x8f"
-"\x8a\xe6\xb8\xac\xe8\xa9\xa6\xe8\xbb\x9f\xe9\xab\x94\xe7\x9a\x84"
-"\xe9\x80\x9f\xe5\xba\xa6\xe6\x98\xaf\xe4\xb8\x8d\xe5\xae\xb9\xe5"
-"\xbf\xbd\xe8\xa6\x96\xe7\x9a\x84\x0a\xe8\xaa\xb2\xe9\xa1\x8c\x2e"
-"\x20\xe7\x82\xba\xe5\x8a\xa0\xe5\xbf\xab\xe9\x96\x8b\xe7\x99\xbc"
-"\xe5\x8f\x8a\xe6\xb8\xac\xe8\xa9\xa6\xe7\x9a\x84\xe9\x80\x9f\xe5"
-"\xba\xa6\x2c\x20\xe6\x88\x91\xe5\x80\x91\xe4\xbe\xbf\xe5\xb8\xb8"
-"\xe5\xb8\x8c\xe6\x9c\x9b\xe8\x83\xbd\xe5\x88\xa9\xe7\x94\xa8\xe4"
-"\xb8\x80\xe4\xba\x9b\xe5\xb7\xb2\xe9\x96\x8b\xe7\x99\xbc\xe5\xa5"
-"\xbd\xe7\x9a\x84\x0a\x6c\x69\x62\x72\x61\x72\x79\x2c\x20\xe4\xb8"
-"\xa6\xe6\x9c\x89\xe4\xb8\x80\xe5\x80\x8b\x20\x66\x61\x73\x74\x20"
-"\x70\x72\x6f\x74\x6f\x74\x79\x70\x69\x6e\x67\x20\xe7\x9a\x84\x20"
-"\x70\x72\x6f\x67\x72\x61\x6d\x6d\x69\x6e\x67\x20\x6c\x61\x6e\x67"
-"\x75\x61\x67\x65\x20\xe5\x8f\xaf\x0a\xe4\xbe\x9b\xe4\xbd\xbf\xe7"
-"\x94\xa8\x2e\x20\xe7\x9b\xae\xe5\x89\x8d\xe6\x9c\x89\xe8\xa8\xb1"
-"\xe8\xa8\xb1\xe5\xa4\x9a\xe5\xa4\x9a\xe7\x9a\x84\x20\x6c\x69\x62"
-"\x72\x61\x72\x79\x20\xe6\x98\xaf\xe4\xbb\xa5\x20\x43\x20\xe5\xaf"
-"\xab\xe6\x88\x90\x2c\x20\xe8\x80\x8c\x20\x50\x79\x74\x68\x6f\x6e"
-"\x20\xe6\x98\xaf\xe4\xb8\x80\xe5\x80\x8b\x0a\x66\x61\x73\x74\x20"
-"\x70\x72\x6f\x74\x6f\x74\x79\x70\x69\x6e\x67\x20\xe7\x9a\x84\x20"
-"\x70\x72\x6f\x67\x72\x61\x6d\x6d\x69\x6e\x67\x20\x6c\x61\x6e\x67"
-"\x75\x61\x67\x65\x2e\x20\xe6\x95\x85\xe6\x88\x91\xe5\x80\x91\xe5"
-"\xb8\x8c\xe6\x9c\x9b\xe8\x83\xbd\xe5\xb0\x87\xe6\x97\xa2\xe6\x9c"
-"\x89\xe7\x9a\x84\x0a\x43\x20\x6c\x69\x62\x72\x61\x72\x79\x20\xe6"
-"\x8b\xbf\xe5\x88\xb0\x20\x50\x79\x74\x68\x6f\x6e\x20\xe7\x9a\x84"
-"\xe7\x92\xb0\xe5\xa2\x83\xe4\xb8\xad\xe6\xb8\xac\xe8\xa9\xa6\xe5"
-"\x8f\x8a\xe6\x95\xb4\xe5\x90\x88\x2e\x20\xe5\x85\xb6\xe4\xb8\xad"
-"\xe6\x9c\x80\xe4\xb8\xbb\xe8\xa6\x81\xe4\xb9\x9f\xe6\x98\xaf\xe6"
-"\x88\x91\xe5\x80\x91\xe6\x89\x80\x0a\xe8\xa6\x81\xe8\xa8\x8e\xe8"
-"\xab\x96\xe7\x9a\x84\xe5\x95\x8f\xe9\xa1\x8c\xe5\xb0\xb1\xe6\x98"
-"\xaf\x3a\x0a\x0a"),
-'big5hkscs': (
-"\x88\x45\x88\x5c\x8a\x73\x8b\xda\x8d\xd8\x0a\x88\x66\x88\x62\x88"
-"\xa7\x20\x88\xa7\x88\xa3\x0a",
-"\xf0\xa0\x84\x8c\xc4\x9a\xe9\xb5\xae\xe7\xbd\x93\xe6\xb4\x86\x0a"
-"\xc3\x8a\xc3\x8a\xcc\x84\xc3\xaa\x20\xc3\xaa\xc3\xaa\xcc\x84\x0a"),
-'cp949': (
-"\x8c\x63\xb9\xe6\xb0\xa2\xc7\xcf\x20\xbc\x84\xbd\xc3\xc4\xdd\xb6"
-"\xf3\x0a\x0a\xa8\xc0\xa8\xc0\xb3\xb3\x21\x21\x20\xec\xd7\xce\xfa"
-"\xea\xc5\xc6\xd0\x92\xe6\x90\x70\xb1\xc5\x20\xa8\xde\xa8\xd3\xc4"
-"\x52\xa2\xaf\xa2\xaf\xa2\xaf\x20\xb1\xe0\x8a\x96\x20\xa8\xd1\xb5"
-"\xb3\x20\xa8\xc0\x2e\x20\x2e\x0a\xe4\xac\xbf\xb5\xa8\xd1\xb4\xc9"
-"\xc8\xc2\x20\x2e\x20\x2e\x20\x2e\x20\x2e\x20\xbc\xad\xbf\xef\xb7"
-"\xef\x20\xb5\xaf\xc7\xd0\xeb\xe0\x20\xca\xab\xc4\x52\x20\x21\x20"
-"\x21\x20\x21\xa4\xd0\x2e\xa4\xd0\x0a\xc8\xe5\xc8\xe5\xc8\xe5\x20"
-"\xa4\xa1\xa4\xa1\xa4\xa1\xa1\xd9\xa4\xd0\x5f\xa4\xd0\x20\xbe\xee"
-"\x90\x8a\x20\xc5\xcb\xc4\xe2\x83\x4f\x20\xb5\xae\xc0\xc0\x20\xaf"
-"\x68\xce\xfa\xb5\xe9\xeb\xe0\x20\xa8\xc0\xb5\xe5\x83\x4f\x0a\xbc"
-"\xb3\x90\x6a\x20\xca\xab\xc4\x52\x20\x2e\x20\x2e\x20\x2e\x20\x2e"
-"\x20\xb1\xbc\xbe\xd6\x9a\x66\x20\xa8\xd1\xb1\xc5\x20\xa8\xde\x90"
-"\x74\xa8\xc2\x83\x4f\x20\xec\xd7\xec\xd2\xf4\xb9\xe5\xfc\xf1\xe9"
-"\xb1\xee\xa3\x8e\x0a\xbf\xcd\xbe\xac\xc4\x52\x20\x21\x20\x21\x20"
-"\xe4\xac\xbf\xb5\xa8\xd1\x20\xca\xab\xb4\xc9\xb1\xc5\x20\xa1\xd9"
-"\xdf\xbe\xb0\xfc\x20\xbe\xf8\xb4\xc9\xb1\xc5\xb4\xc9\x20\xe4\xac"
-"\xb4\xc9\xb5\xd8\xc4\x52\x20\xb1\xdb\xbe\xd6\x8a\xdb\x0a\xa8\xde"
-"\xb7\xc1\xb5\xe0\xce\xfa\x20\x9a\xc3\xc7\xb4\xbd\xa4\xc4\x52\x20"
-"\xbe\xee\x90\x8a\x20\xec\xd7\xec\xd2\xf4\xb9\xe5\xfc\xf1\xe9\x9a"
-"\xc4\xa8\xef\xb5\xe9\x9d\xda\x21\x21\x20\xa8\xc0\xa8\xc0\xb3\xb3"
-"\xa2\xbd\x20\xa1\xd2\xa1\xd2\x2a\x0a\x0a",
-"\xeb\x98\xa0\xeb\xb0\xa9\xea\xb0\x81\xed\x95\x98\x20\xed\x8e\xb2"
-"\xec\x8b\x9c\xec\xbd\x9c\xeb\x9d\xbc\x0a\x0a\xe3\x89\xaf\xe3\x89"
-"\xaf\xeb\x82\xa9\x21\x21\x20\xe5\x9b\xa0\xe4\xb9\x9d\xe6\x9c\x88"
-"\xed\x8c\xa8\xeb\xaf\xa4\xeb\xa6\x94\xea\xb6\x88\x20\xe2\x93\xa1"
-"\xe2\x93\x96\xed\x9b\x80\xc2\xbf\xc2\xbf\xc2\xbf\x20\xea\xb8\x8d"
-"\xeb\x92\x99\x20\xe2\x93\x94\xeb\x8e\xa8\x20\xe3\x89\xaf\x2e\x20"
-"\x2e\x0a\xe4\xba\x9e\xec\x98\x81\xe2\x93\x94\xeb\x8a\xa5\xed\x9a"
-"\xb9\x20\x2e\x20\x2e\x20\x2e\x20\x2e\x20\xec\x84\x9c\xec\x9a\xb8"
-"\xeb\xa4\x84\x20\xeb\x8e\x90\xed\x95\x99\xe4\xb9\x99\x20\xe5\xae"
-"\xb6\xed\x9b\x80\x20\x21\x20\x21\x20\x21\xe3\x85\xa0\x2e\xe3\x85"
-"\xa0\x0a\xed\x9d\x90\xed\x9d\x90\xed\x9d\x90\x20\xe3\x84\xb1\xe3"
-"\x84\xb1\xe3\x84\xb1\xe2\x98\x86\xe3\x85\xa0\x5f\xe3\x85\xa0\x20"
-"\xec\x96\xb4\xeb\xa6\xa8\x20\xed\x83\xb8\xec\xbd\xb0\xea\xb8\x90"
-"\x20\xeb\x8e\x8c\xec\x9d\x91\x20\xec\xb9\x91\xe4\xb9\x9d\xeb\x93"
-"\xa4\xe4\xb9\x99\x20\xe3\x89\xaf\xeb\x93\x9c\xea\xb8\x90\x0a\xec"
-"\x84\xa4\xeb\xa6\x8c\x20\xe5\xae\xb6\xed\x9b\x80\x20\x2e\x20\x2e"
-"\x20\x2e\x20\x2e\x20\xea\xb5\xb4\xec\x95\xa0\xec\x89\x8c\x20\xe2"
-"\x93\x94\xea\xb6\x88\x20\xe2\x93\xa1\xeb\xa6\x98\xe3\x89\xb1\xea"
-"\xb8\x90\x20\xe5\x9b\xa0\xe4\xbb\x81\xe5\xb7\x9d\xef\xa6\x81\xe4"
-"\xb8\xad\xea\xb9\x8c\xec\xa6\xbc\x0a\xec\x99\x80\xec\x92\x80\xed"
-"\x9b\x80\x20\x21\x20\x21\x20\xe4\xba\x9e\xec\x98\x81\xe2\x93\x94"
-"\x20\xe5\xae\xb6\xeb\x8a\xa5\xea\xb6\x88\x20\xe2\x98\x86\xe4\xb8"
-"\x8a\xea\xb4\x80\x20\xec\x97\x86\xeb\x8a\xa5\xea\xb6\x88\xeb\x8a"
-"\xa5\x20\xe4\xba\x9e\xeb\x8a\xa5\xeb\x92\x88\xed\x9b\x80\x20\xea"
-"\xb8\x80\xec\x95\xa0\xeb\x93\xb4\x0a\xe2\x93\xa1\xeb\xa0\xa4\xeb"
-"\x93\x80\xe4\xb9\x9d\x20\xec\x8b\x80\xed\x92\x94\xec\x88\xb4\xed"
-"\x9b\x80\x20\xec\x96\xb4\xeb\xa6\xa8\x20\xe5\x9b\xa0\xe4\xbb\x81"
-"\xe5\xb7\x9d\xef\xa6\x81\xe4\xb8\xad\xec\x8b\x81\xe2\x91\xa8\xeb"
-"\x93\xa4\xec\x95\x9c\x21\x21\x20\xe3\x89\xaf\xe3\x89\xaf\xeb\x82"
-"\xa9\xe2\x99\xa1\x20\xe2\x8c\x92\xe2\x8c\x92\x2a\x0a\x0a"),
-'euc_jisx0213': (
-"\x50\x79\x74\x68\x6f\x6e\x20\xa4\xce\xb3\xab\xc8\xaf\xa4\xcf\xa1"
-"\xa2\x31\x39\x39\x30\x20\xc7\xaf\xa4\xb4\xa4\xed\xa4\xab\xa4\xe9"
-"\xb3\xab\xbb\xcf\xa4\xb5\xa4\xec\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9"
-"\xa1\xa3\x0a\xb3\xab\xc8\xaf\xbc\xd4\xa4\xce\x20\x47\x75\x69\x64"
-"\x6f\x20\x76\x61\x6e\x20\x52\x6f\x73\x73\x75\x6d\x20\xa4\xcf\xb6"
-"\xb5\xb0\xe9\xcd\xd1\xa4\xce\xa5\xd7\xa5\xed\xa5\xb0\xa5\xe9\xa5"
-"\xdf\xa5\xf3\xa5\xb0\xb8\xc0\xb8\xec\xa1\xd6\x41\x42\x43\xa1\xd7"
-"\xa4\xce\xb3\xab\xc8\xaf\xa4\xcb\xbb\xb2\xb2\xc3\xa4\xb7\xa4\xc6"
-"\xa4\xa4\xa4\xde\xa4\xb7\xa4\xbf\xa4\xac\xa1\xa2\x41\x42\x43\x20"
-"\xa4\xcf\xbc\xc2\xcd\xd1\xbe\xe5\xa4\xce\xcc\xdc\xc5\xaa\xa4\xcb"
-"\xa4\xcf\xa4\xa2\xa4\xde\xa4\xea\xc5\xac\xa4\xb7\xa4\xc6\xa4\xa4"
-"\xa4\xde\xa4\xbb\xa4\xf3\xa4\xc7\xa4\xb7\xa4\xbf\xa1\xa3\x0a\xa4"
-"\xb3\xa4\xce\xa4\xbf\xa4\xe1\xa1\xa2\x47\x75\x69\x64\x6f\x20\xa4"
-"\xcf\xa4\xe8\xa4\xea\xbc\xc2\xcd\xd1\xc5\xaa\xa4\xca\xa5\xd7\xa5"
-"\xed\xa5\xb0\xa5\xe9\xa5\xdf\xa5\xf3\xa5\xb0\xb8\xc0\xb8\xec\xa4"
-"\xce\xb3\xab\xc8\xaf\xa4\xf2\xb3\xab\xbb\xcf\xa4\xb7\xa1\xa2\xb1"
-"\xd1\xb9\xf1\x20\x42\x42\x53\x20\xca\xfc\xc1\xf7\xa4\xce\xa5\xb3"
-"\xa5\xe1\xa5\xc7\xa5\xa3\xc8\xd6\xc1\xc8\xa1\xd6\xa5\xe2\xa5\xf3"
-"\xa5\xc6\xa5\xa3\x20\xa5\xd1\xa5\xa4\xa5\xbd\xa5\xf3\xa1\xd7\xa4"
-"\xce\xa5\xd5\xa5\xa1\xa5\xf3\xa4\xc7\xa4\xa2\xa4\xeb\x20\x47\x75"
-"\x69\x64\x6f\x20\xa4\xcf\xa4\xb3\xa4\xce\xb8\xc0\xb8\xec\xa4\xf2"
-"\xa1\xd6\x50\x79\x74\x68\x6f\x6e\xa1\xd7\xa4\xc8\xcc\xbe\xa4\xc5"
-"\xa4\xb1\xa4\xde\xa4\xb7\xa4\xbf\xa1\xa3\x0a\xa4\xb3\xa4\xce\xa4"
-"\xe8\xa4\xa6\xa4\xca\xc7\xd8\xb7\xca\xa4\xab\xa4\xe9\xc0\xb8\xa4"
-"\xde\xa4\xec\xa4\xbf\x20\x50\x79\x74\x68\x6f\x6e\x20\xa4\xce\xb8"
-"\xc0\xb8\xec\xc0\xdf\xb7\xd7\xa4\xcf\xa1\xa2\xa1\xd6\xa5\xb7\xa5"
-"\xf3\xa5\xd7\xa5\xeb\xa1\xd7\xa4\xc7\xa1\xd6\xbd\xac\xc6\xc0\xa4"
-"\xac\xcd\xc6\xb0\xd7\xa1\xd7\xa4\xc8\xa4\xa4\xa4\xa6\xcc\xdc\xc9"
-"\xb8\xa4\xcb\xbd\xc5\xc5\xc0\xa4\xac\xc3\xd6\xa4\xab\xa4\xec\xa4"
-"\xc6\xa4\xa4\xa4\xde\xa4\xb9\xa1\xa3\x0a\xc2\xbf\xa4\xaf\xa4\xce"
-"\xa5\xb9\xa5\xaf\xa5\xea\xa5\xd7\xa5\xc8\xb7\xcf\xb8\xc0\xb8\xec"
-"\xa4\xc7\xa4\xcf\xa5\xe6\xa1\xbc\xa5\xb6\xa4\xce\xcc\xdc\xc0\xe8"
-"\xa4\xce\xcd\xf8\xca\xd8\xc0\xad\xa4\xf2\xcd\xa5\xc0\xe8\xa4\xb7"
-"\xa4\xc6\xbf\xa7\xa1\xb9\xa4\xca\xb5\xa1\xc7\xbd\xa4\xf2\xb8\xc0"
-"\xb8\xec\xcd\xd7\xc1\xc7\xa4\xc8\xa4\xb7\xa4\xc6\xbc\xe8\xa4\xea"
-"\xc6\xfe\xa4\xec\xa4\xeb\xbe\xec\xb9\xe7\xa4\xac\xc2\xbf\xa4\xa4"
-"\xa4\xce\xa4\xc7\xa4\xb9\xa4\xac\xa1\xa2\x50\x79\x74\x68\x6f\x6e"
-"\x20\xa4\xc7\xa4\xcf\xa4\xbd\xa4\xa6\xa4\xa4\xa4\xc3\xa4\xbf\xbe"
-"\xae\xba\xd9\xb9\xa9\xa4\xac\xc4\xc9\xb2\xc3\xa4\xb5\xa4\xec\xa4"
-"\xeb\xa4\xb3\xa4\xc8\xa4\xcf\xa4\xa2\xa4\xde\xa4\xea\xa4\xa2\xa4"
-"\xea\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3\x0a\xb8\xc0\xb8\xec\xbc\xab"
-"\xc2\xce\xa4\xce\xb5\xa1\xc7\xbd\xa4\xcf\xba\xc7\xbe\xae\xb8\xc2"
-"\xa4\xcb\xb2\xa1\xa4\xb5\xa4\xa8\xa1\xa2\xc9\xac\xcd\xd7\xa4\xca"
-"\xb5\xa1\xc7\xbd\xa4\xcf\xb3\xc8\xc4\xa5\xa5\xe2\xa5\xb8\xa5\xe5"
-"\xa1\xbc\xa5\xeb\xa4\xc8\xa4\xb7\xa4\xc6\xc4\xc9\xb2\xc3\xa4\xb9"
-"\xa4\xeb\xa1\xa2\xa4\xc8\xa4\xa4\xa4\xa6\xa4\xce\xa4\xac\x20\x50"
-"\x79\x74\x68\x6f\x6e\x20\xa4\xce\xa5\xdd\xa5\xea\xa5\xb7\xa1\xbc"
-"\xa4\xc7\xa4\xb9\xa1\xa3\x0a\x0a\xa5\xce\xa4\xf7\x20\xa5\xfe\x20"
-"\xa5\xc8\xa5\xad\xaf\xac\xaf\xda\x20\xcf\xe3\x8f\xfe\xd8\x20\x8f"
-"\xfe\xd4\x8f\xfe\xe8\x8f\xfc\xd6\x0a",
-"\x50\x79\x74\x68\x6f\x6e\x20\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba"
-"\xe3\x81\xaf\xe3\x80\x81\x31\x39\x39\x30\x20\xe5\xb9\xb4\xe3\x81"
-"\x94\xe3\x82\x8d\xe3\x81\x8b\xe3\x82\x89\xe9\x96\x8b\xe5\xa7\x8b"
-"\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3"
-"\x81\x99\xe3\x80\x82\x0a\xe9\x96\x8b\xe7\x99\xba\xe8\x80\x85\xe3"
-"\x81\xae\x20\x47\x75\x69\x64\x6f\x20\x76\x61\x6e\x20\x52\x6f\x73"
-"\x73\x75\x6d\x20\xe3\x81\xaf\xe6\x95\x99\xe8\x82\xb2\xe7\x94\xa8"
-"\xe3\x81\xae\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3"
-"\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x80"
-"\x8c\x41\x42\x43\xe3\x80\x8d\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba"
-"\xe3\x81\xab\xe5\x8f\x82\xe5\x8a\xa0\xe3\x81\x97\xe3\x81\xa6\xe3"
-"\x81\x84\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x81\x8c\xe3\x80"
-"\x81\x41\x42\x43\x20\xe3\x81\xaf\xe5\xae\x9f\xe7\x94\xa8\xe4\xb8"
-"\x8a\xe3\x81\xae\xe7\x9b\xae\xe7\x9a\x84\xe3\x81\xab\xe3\x81\xaf"
-"\xe3\x81\x82\xe3\x81\xbe\xe3\x82\x8a\xe9\x81\xa9\xe3\x81\x97\xe3"
-"\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x81"
-"\xa7\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\x0a\xe3\x81\x93\xe3\x81"
-"\xae\xe3\x81\x9f\xe3\x82\x81\xe3\x80\x81\x47\x75\x69\x64\x6f\x20"
-"\xe3\x81\xaf\xe3\x82\x88\xe3\x82\x8a\xe5\xae\x9f\xe7\x94\xa8\xe7"
-"\x9a\x84\xe3\x81\xaa\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83"
-"\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e"
-"\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x82\x92\xe9\x96\x8b\xe5"
-"\xa7\x8b\xe3\x81\x97\xe3\x80\x81\xe8\x8b\xb1\xe5\x9b\xbd\x20\x42"
-"\x42\x53\x20\xe6\x94\xbe\xe9\x80\x81\xe3\x81\xae\xe3\x82\xb3\xe3"
-"\x83\xa1\xe3\x83\x87\xe3\x82\xa3\xe7\x95\xaa\xe7\xb5\x84\xe3\x80"
-"\x8c\xe3\x83\xa2\xe3\x83\xb3\xe3\x83\x86\xe3\x82\xa3\x20\xe3\x83"
-"\x91\xe3\x82\xa4\xe3\x82\xbd\xe3\x83\xb3\xe3\x80\x8d\xe3\x81\xae"
-"\xe3\x83\x95\xe3\x82\xa1\xe3\x83\xb3\xe3\x81\xa7\xe3\x81\x82\xe3"
-"\x82\x8b\x20\x47\x75\x69\x64\x6f\x20\xe3\x81\xaf\xe3\x81\x93\xe3"
-"\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe3\x82\x92\xe3\x80\x8c\x50\x79"
-"\x74\x68\x6f\x6e\xe3\x80\x8d\xe3\x81\xa8\xe5\x90\x8d\xe3\x81\xa5"
-"\xe3\x81\x91\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\x0a"
-"\xe3\x81\x93\xe3\x81\xae\xe3\x82\x88\xe3\x81\x86\xe3\x81\xaa\xe8"
-"\x83\x8c\xe6\x99\xaf\xe3\x81\x8b\xe3\x82\x89\xe7\x94\x9f\xe3\x81"
-"\xbe\xe3\x82\x8c\xe3\x81\x9f\x20\x50\x79\x74\x68\x6f\x6e\x20\xe3"
-"\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa8\xad\xe8\xa8\x88\xe3\x81"
-"\xaf\xe3\x80\x81\xe3\x80\x8c\xe3\x82\xb7\xe3\x83\xb3\xe3\x83\x97"
-"\xe3\x83\xab\xe3\x80\x8d\xe3\x81\xa7\xe3\x80\x8c\xe7\xbf\x92\xe5"
-"\xbe\x97\xe3\x81\x8c\xe5\xae\xb9\xe6\x98\x93\xe3\x80\x8d\xe3\x81"
-"\xa8\xe3\x81\x84\xe3\x81\x86\xe7\x9b\xae\xe6\xa8\x99\xe3\x81\xab"
-"\xe9\x87\x8d\xe7\x82\xb9\xe3\x81\x8c\xe7\xbd\xae\xe3\x81\x8b\xe3"
-"\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80"
-"\x82\x0a\xe5\xa4\x9a\xe3\x81\x8f\xe3\x81\xae\xe3\x82\xb9\xe3\x82"
-"\xaf\xe3\x83\xaa\xe3\x83\x97\xe3\x83\x88\xe7\xb3\xbb\xe8\xa8\x80"
-"\xe8\xaa\x9e\xe3\x81\xa7\xe3\x81\xaf\xe3\x83\xa6\xe3\x83\xbc\xe3"
-"\x82\xb6\xe3\x81\xae\xe7\x9b\xae\xe5\x85\x88\xe3\x81\xae\xe5\x88"
-"\xa9\xe4\xbe\xbf\xe6\x80\xa7\xe3\x82\x92\xe5\x84\xaa\xe5\x85\x88"
-"\xe3\x81\x97\xe3\x81\xa6\xe8\x89\xb2\xe3\x80\x85\xe3\x81\xaa\xe6"
-"\xa9\x9f\xe8\x83\xbd\xe3\x82\x92\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa6"
-"\x81\xe7\xb4\xa0\xe3\x81\xa8\xe3\x81\x97\xe3\x81\xa6\xe5\x8f\x96"
-"\xe3\x82\x8a\xe5\x85\xa5\xe3\x82\x8c\xe3\x82\x8b\xe5\xa0\xb4\xe5"
-"\x90\x88\xe3\x81\x8c\xe5\xa4\x9a\xe3\x81\x84\xe3\x81\xae\xe3\x81"
-"\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81\x50\x79\x74\x68\x6f\x6e"
-"\x20\xe3\x81\xa7\xe3\x81\xaf\xe3\x81\x9d\xe3\x81\x86\xe3\x81\x84"
-"\xe3\x81\xa3\xe3\x81\x9f\xe5\xb0\x8f\xe7\xb4\xb0\xe5\xb7\xa5\xe3"
-"\x81\x8c\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x95\xe3\x82\x8c\xe3\x82"
-"\x8b\xe3\x81\x93\xe3\x81\xa8\xe3\x81\xaf\xe3\x81\x82\xe3\x81\xbe"
-"\xe3\x82\x8a\xe3\x81\x82\xe3\x82\x8a\xe3\x81\xbe\xe3\x81\x9b\xe3"
-"\x82\x93\xe3\x80\x82\x0a\xe8\xa8\x80\xe8\xaa\x9e\xe8\x87\xaa\xe4"
-"\xbd\x93\xe3\x81\xae\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x9c"
-"\x80\xe5\xb0\x8f\xe9\x99\x90\xe3\x81\xab\xe6\x8a\xbc\xe3\x81\x95"
-"\xe3\x81\x88\xe3\x80\x81\xe5\xbf\x85\xe8\xa6\x81\xe3\x81\xaa\xe6"
-"\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x8b\xa1\xe5\xbc\xb5\xe3\x83"
-"\xa2\xe3\x82\xb8\xe3\x83\xa5\xe3\x83\xbc\xe3\x83\xab\xe3\x81\xa8"
-"\xe3\x81\x97\xe3\x81\xa6\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x99\xe3"
-"\x82\x8b\xe3\x80\x81\xe3\x81\xa8\xe3\x81\x84\xe3\x81\x86\xe3\x81"
-"\xae\xe3\x81\x8c\x20\x50\x79\x74\x68\x6f\x6e\x20\xe3\x81\xae\xe3"
-"\x83\x9d\xe3\x83\xaa\xe3\x82\xb7\xe3\x83\xbc\xe3\x81\xa7\xe3\x81"
-"\x99\xe3\x80\x82\x0a\x0a\xe3\x83\x8e\xe3\x81\x8b\xe3\x82\x9a\x20"
-"\xe3\x83\x88\xe3\x82\x9a\x20\xe3\x83\x88\xe3\x82\xad\xef\xa8\xb6"
-"\xef\xa8\xb9\x20\xf0\xa1\x9a\xb4\xf0\xaa\x8e\x8c\x20\xe9\xba\x80"
-"\xe9\xbd\x81\xf0\xa9\x9b\xb0\x0a"),
-'euc_jp': (
-"\x50\x79\x74\x68\x6f\x6e\x20\xa4\xce\xb3\xab\xc8\xaf\xa4\xcf\xa1"
-"\xa2\x31\x39\x39\x30\x20\xc7\xaf\xa4\xb4\xa4\xed\xa4\xab\xa4\xe9"
-"\xb3\xab\xbb\xcf\xa4\xb5\xa4\xec\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9"
-"\xa1\xa3\x0a\xb3\xab\xc8\xaf\xbc\xd4\xa4\xce\x20\x47\x75\x69\x64"
-"\x6f\x20\x76\x61\x6e\x20\x52\x6f\x73\x73\x75\x6d\x20\xa4\xcf\xb6"
-"\xb5\xb0\xe9\xcd\xd1\xa4\xce\xa5\xd7\xa5\xed\xa5\xb0\xa5\xe9\xa5"
-"\xdf\xa5\xf3\xa5\xb0\xb8\xc0\xb8\xec\xa1\xd6\x41\x42\x43\xa1\xd7"
-"\xa4\xce\xb3\xab\xc8\xaf\xa4\xcb\xbb\xb2\xb2\xc3\xa4\xb7\xa4\xc6"
-"\xa4\xa4\xa4\xde\xa4\xb7\xa4\xbf\xa4\xac\xa1\xa2\x41\x42\x43\x20"
-"\xa4\xcf\xbc\xc2\xcd\xd1\xbe\xe5\xa4\xce\xcc\xdc\xc5\xaa\xa4\xcb"
-"\xa4\xcf\xa4\xa2\xa4\xde\xa4\xea\xc5\xac\xa4\xb7\xa4\xc6\xa4\xa4"
-"\xa4\xde\xa4\xbb\xa4\xf3\xa4\xc7\xa4\xb7\xa4\xbf\xa1\xa3\x0a\xa4"
-"\xb3\xa4\xce\xa4\xbf\xa4\xe1\xa1\xa2\x47\x75\x69\x64\x6f\x20\xa4"
-"\xcf\xa4\xe8\xa4\xea\xbc\xc2\xcd\xd1\xc5\xaa\xa4\xca\xa5\xd7\xa5"
-"\xed\xa5\xb0\xa5\xe9\xa5\xdf\xa5\xf3\xa5\xb0\xb8\xc0\xb8\xec\xa4"
-"\xce\xb3\xab\xc8\xaf\xa4\xf2\xb3\xab\xbb\xcf\xa4\xb7\xa1\xa2\xb1"
-"\xd1\xb9\xf1\x20\x42\x42\x53\x20\xca\xfc\xc1\xf7\xa4\xce\xa5\xb3"
-"\xa5\xe1\xa5\xc7\xa5\xa3\xc8\xd6\xc1\xc8\xa1\xd6\xa5\xe2\xa5\xf3"
-"\xa5\xc6\xa5\xa3\x20\xa5\xd1\xa5\xa4\xa5\xbd\xa5\xf3\xa1\xd7\xa4"
-"\xce\xa5\xd5\xa5\xa1\xa5\xf3\xa4\xc7\xa4\xa2\xa4\xeb\x20\x47\x75"
-"\x69\x64\x6f\x20\xa4\xcf\xa4\xb3\xa4\xce\xb8\xc0\xb8\xec\xa4\xf2"
-"\xa1\xd6\x50\x79\x74\x68\x6f\x6e\xa1\xd7\xa4\xc8\xcc\xbe\xa4\xc5"
-"\xa4\xb1\xa4\xde\xa4\xb7\xa4\xbf\xa1\xa3\x0a\xa4\xb3\xa4\xce\xa4"
-"\xe8\xa4\xa6\xa4\xca\xc7\xd8\xb7\xca\xa4\xab\xa4\xe9\xc0\xb8\xa4"
-"\xde\xa4\xec\xa4\xbf\x20\x50\x79\x74\x68\x6f\x6e\x20\xa4\xce\xb8"
-"\xc0\xb8\xec\xc0\xdf\xb7\xd7\xa4\xcf\xa1\xa2\xa1\xd6\xa5\xb7\xa5"
-"\xf3\xa5\xd7\xa5\xeb\xa1\xd7\xa4\xc7\xa1\xd6\xbd\xac\xc6\xc0\xa4"
-"\xac\xcd\xc6\xb0\xd7\xa1\xd7\xa4\xc8\xa4\xa4\xa4\xa6\xcc\xdc\xc9"
-"\xb8\xa4\xcb\xbd\xc5\xc5\xc0\xa4\xac\xc3\xd6\xa4\xab\xa4\xec\xa4"
-"\xc6\xa4\xa4\xa4\xde\xa4\xb9\xa1\xa3\x0a\xc2\xbf\xa4\xaf\xa4\xce"
-"\xa5\xb9\xa5\xaf\xa5\xea\xa5\xd7\xa5\xc8\xb7\xcf\xb8\xc0\xb8\xec"
-"\xa4\xc7\xa4\xcf\xa5\xe6\xa1\xbc\xa5\xb6\xa4\xce\xcc\xdc\xc0\xe8"
-"\xa4\xce\xcd\xf8\xca\xd8\xc0\xad\xa4\xf2\xcd\xa5\xc0\xe8\xa4\xb7"
-"\xa4\xc6\xbf\xa7\xa1\xb9\xa4\xca\xb5\xa1\xc7\xbd\xa4\xf2\xb8\xc0"
-"\xb8\xec\xcd\xd7\xc1\xc7\xa4\xc8\xa4\xb7\xa4\xc6\xbc\xe8\xa4\xea"
-"\xc6\xfe\xa4\xec\xa4\xeb\xbe\xec\xb9\xe7\xa4\xac\xc2\xbf\xa4\xa4"
-"\xa4\xce\xa4\xc7\xa4\xb9\xa4\xac\xa1\xa2\x50\x79\x74\x68\x6f\x6e"
-"\x20\xa4\xc7\xa4\xcf\xa4\xbd\xa4\xa6\xa4\xa4\xa4\xc3\xa4\xbf\xbe"
-"\xae\xba\xd9\xb9\xa9\xa4\xac\xc4\xc9\xb2\xc3\xa4\xb5\xa4\xec\xa4"
-"\xeb\xa4\xb3\xa4\xc8\xa4\xcf\xa4\xa2\xa4\xde\xa4\xea\xa4\xa2\xa4"
-"\xea\xa4\xde\xa4\xbb\xa4\xf3\xa1\xa3\x0a\xb8\xc0\xb8\xec\xbc\xab"
-"\xc2\xce\xa4\xce\xb5\xa1\xc7\xbd\xa4\xcf\xba\xc7\xbe\xae\xb8\xc2"
-"\xa4\xcb\xb2\xa1\xa4\xb5\xa4\xa8\xa1\xa2\xc9\xac\xcd\xd7\xa4\xca"
-"\xb5\xa1\xc7\xbd\xa4\xcf\xb3\xc8\xc4\xa5\xa5\xe2\xa5\xb8\xa5\xe5"
-"\xa1\xbc\xa5\xeb\xa4\xc8\xa4\xb7\xa4\xc6\xc4\xc9\xb2\xc3\xa4\xb9"
-"\xa4\xeb\xa1\xa2\xa4\xc8\xa4\xa4\xa4\xa6\xa4\xce\xa4\xac\x20\x50"
-"\x79\x74\x68\x6f\x6e\x20\xa4\xce\xa5\xdd\xa5\xea\xa5\xb7\xa1\xbc"
-"\xa4\xc7\xa4\xb9\xa1\xa3\x0a\x0a",
-"\x50\x79\x74\x68\x6f\x6e\x20\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba"
-"\xe3\x81\xaf\xe3\x80\x81\x31\x39\x39\x30\x20\xe5\xb9\xb4\xe3\x81"
-"\x94\xe3\x82\x8d\xe3\x81\x8b\xe3\x82\x89\xe9\x96\x8b\xe5\xa7\x8b"
-"\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3"
-"\x81\x99\xe3\x80\x82\x0a\xe9\x96\x8b\xe7\x99\xba\xe8\x80\x85\xe3"
-"\x81\xae\x20\x47\x75\x69\x64\x6f\x20\x76\x61\x6e\x20\x52\x6f\x73"
-"\x73\x75\x6d\x20\xe3\x81\xaf\xe6\x95\x99\xe8\x82\xb2\xe7\x94\xa8"
-"\xe3\x81\xae\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3"
-"\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x80"
-"\x8c\x41\x42\x43\xe3\x80\x8d\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba"
-"\xe3\x81\xab\xe5\x8f\x82\xe5\x8a\xa0\xe3\x81\x97\xe3\x81\xa6\xe3"
-"\x81\x84\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x81\x8c\xe3\x80"
-"\x81\x41\x42\x43\x20\xe3\x81\xaf\xe5\xae\x9f\xe7\x94\xa8\xe4\xb8"
-"\x8a\xe3\x81\xae\xe7\x9b\xae\xe7\x9a\x84\xe3\x81\xab\xe3\x81\xaf"
-"\xe3\x81\x82\xe3\x81\xbe\xe3\x82\x8a\xe9\x81\xa9\xe3\x81\x97\xe3"
-"\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x81"
-"\xa7\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\x0a\xe3\x81\x93\xe3\x81"
-"\xae\xe3\x81\x9f\xe3\x82\x81\xe3\x80\x81\x47\x75\x69\x64\x6f\x20"
-"\xe3\x81\xaf\xe3\x82\x88\xe3\x82\x8a\xe5\xae\x9f\xe7\x94\xa8\xe7"
-"\x9a\x84\xe3\x81\xaa\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83"
-"\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e"
-"\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x82\x92\xe9\x96\x8b\xe5"
-"\xa7\x8b\xe3\x81\x97\xe3\x80\x81\xe8\x8b\xb1\xe5\x9b\xbd\x20\x42"
-"\x42\x53\x20\xe6\x94\xbe\xe9\x80\x81\xe3\x81\xae\xe3\x82\xb3\xe3"
-"\x83\xa1\xe3\x83\x87\xe3\x82\xa3\xe7\x95\xaa\xe7\xb5\x84\xe3\x80"
-"\x8c\xe3\x83\xa2\xe3\x83\xb3\xe3\x83\x86\xe3\x82\xa3\x20\xe3\x83"
-"\x91\xe3\x82\xa4\xe3\x82\xbd\xe3\x83\xb3\xe3\x80\x8d\xe3\x81\xae"
-"\xe3\x83\x95\xe3\x82\xa1\xe3\x83\xb3\xe3\x81\xa7\xe3\x81\x82\xe3"
-"\x82\x8b\x20\x47\x75\x69\x64\x6f\x20\xe3\x81\xaf\xe3\x81\x93\xe3"
-"\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe3\x82\x92\xe3\x80\x8c\x50\x79"
-"\x74\x68\x6f\x6e\xe3\x80\x8d\xe3\x81\xa8\xe5\x90\x8d\xe3\x81\xa5"
-"\xe3\x81\x91\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\x0a"
-"\xe3\x81\x93\xe3\x81\xae\xe3\x82\x88\xe3\x81\x86\xe3\x81\xaa\xe8"
-"\x83\x8c\xe6\x99\xaf\xe3\x81\x8b\xe3\x82\x89\xe7\x94\x9f\xe3\x81"
-"\xbe\xe3\x82\x8c\xe3\x81\x9f\x20\x50\x79\x74\x68\x6f\x6e\x20\xe3"
-"\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa8\xad\xe8\xa8\x88\xe3\x81"
-"\xaf\xe3\x80\x81\xe3\x80\x8c\xe3\x82\xb7\xe3\x83\xb3\xe3\x83\x97"
-"\xe3\x83\xab\xe3\x80\x8d\xe3\x81\xa7\xe3\x80\x8c\xe7\xbf\x92\xe5"
-"\xbe\x97\xe3\x81\x8c\xe5\xae\xb9\xe6\x98\x93\xe3\x80\x8d\xe3\x81"
-"\xa8\xe3\x81\x84\xe3\x81\x86\xe7\x9b\xae\xe6\xa8\x99\xe3\x81\xab"
-"\xe9\x87\x8d\xe7\x82\xb9\xe3\x81\x8c\xe7\xbd\xae\xe3\x81\x8b\xe3"
-"\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80"
-"\x82\x0a\xe5\xa4\x9a\xe3\x81\x8f\xe3\x81\xae\xe3\x82\xb9\xe3\x82"
-"\xaf\xe3\x83\xaa\xe3\x83\x97\xe3\x83\x88\xe7\xb3\xbb\xe8\xa8\x80"
-"\xe8\xaa\x9e\xe3\x81\xa7\xe3\x81\xaf\xe3\x83\xa6\xe3\x83\xbc\xe3"
-"\x82\xb6\xe3\x81\xae\xe7\x9b\xae\xe5\x85\x88\xe3\x81\xae\xe5\x88"
-"\xa9\xe4\xbe\xbf\xe6\x80\xa7\xe3\x82\x92\xe5\x84\xaa\xe5\x85\x88"
-"\xe3\x81\x97\xe3\x81\xa6\xe8\x89\xb2\xe3\x80\x85\xe3\x81\xaa\xe6"
-"\xa9\x9f\xe8\x83\xbd\xe3\x82\x92\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa6"
-"\x81\xe7\xb4\xa0\xe3\x81\xa8\xe3\x81\x97\xe3\x81\xa6\xe5\x8f\x96"
-"\xe3\x82\x8a\xe5\x85\xa5\xe3\x82\x8c\xe3\x82\x8b\xe5\xa0\xb4\xe5"
-"\x90\x88\xe3\x81\x8c\xe5\xa4\x9a\xe3\x81\x84\xe3\x81\xae\xe3\x81"
-"\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81\x50\x79\x74\x68\x6f\x6e"
-"\x20\xe3\x81\xa7\xe3\x81\xaf\xe3\x81\x9d\xe3\x81\x86\xe3\x81\x84"
-"\xe3\x81\xa3\xe3\x81\x9f\xe5\xb0\x8f\xe7\xb4\xb0\xe5\xb7\xa5\xe3"
-"\x81\x8c\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x95\xe3\x82\x8c\xe3\x82"
-"\x8b\xe3\x81\x93\xe3\x81\xa8\xe3\x81\xaf\xe3\x81\x82\xe3\x81\xbe"
-"\xe3\x82\x8a\xe3\x81\x82\xe3\x82\x8a\xe3\x81\xbe\xe3\x81\x9b\xe3"
-"\x82\x93\xe3\x80\x82\x0a\xe8\xa8\x80\xe8\xaa\x9e\xe8\x87\xaa\xe4"
-"\xbd\x93\xe3\x81\xae\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x9c"
-"\x80\xe5\xb0\x8f\xe9\x99\x90\xe3\x81\xab\xe6\x8a\xbc\xe3\x81\x95"
-"\xe3\x81\x88\xe3\x80\x81\xe5\xbf\x85\xe8\xa6\x81\xe3\x81\xaa\xe6"
-"\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x8b\xa1\xe5\xbc\xb5\xe3\x83"
-"\xa2\xe3\x82\xb8\xe3\x83\xa5\xe3\x83\xbc\xe3\x83\xab\xe3\x81\xa8"
-"\xe3\x81\x97\xe3\x81\xa6\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x99\xe3"
-"\x82\x8b\xe3\x80\x81\xe3\x81\xa8\xe3\x81\x84\xe3\x81\x86\xe3\x81"
-"\xae\xe3\x81\x8c\x20\x50\x79\x74\x68\x6f\x6e\x20\xe3\x81\xae\xe3"
-"\x83\x9d\xe3\x83\xaa\xe3\x82\xb7\xe3\x83\xbc\xe3\x81\xa7\xe3\x81"
-"\x99\xe3\x80\x82\x0a\x0a"),
-'euc_kr': (
-"\xa1\xdd\x20\xc6\xc4\xc0\xcc\xbd\xe3\x28\x50\x79\x74\x68\x6f\x6e"
-"\x29\xc0\xba\x20\xb9\xe8\xbf\xec\xb1\xe2\x20\xbd\xb1\xb0\xed\x2c"
-"\x20\xb0\xad\xb7\xc2\xc7\xd1\x20\xc7\xc1\xb7\xce\xb1\xd7\xb7\xa1"
-"\xb9\xd6\x20\xbe\xf0\xbe\xee\xc0\xd4\xb4\xcf\xb4\xd9\x2e\x20\xc6"
-"\xc4\xc0\xcc\xbd\xe3\xc0\xba\x0a\xc8\xbf\xc0\xb2\xc0\xfb\xc0\xce"
-"\x20\xb0\xed\xbc\xf6\xc1\xd8\x20\xb5\xa5\xc0\xcc\xc5\xcd\x20\xb1"
-"\xb8\xc1\xb6\xbf\xcd\x20\xb0\xa3\xb4\xdc\xc7\xcf\xc1\xf6\xb8\xb8"
-"\x20\xc8\xbf\xc0\xb2\xc0\xfb\xc0\xce\x20\xb0\xb4\xc3\xbc\xc1\xf6"
-"\xc7\xe2\xc7\xc1\xb7\xce\xb1\xd7\xb7\xa1\xb9\xd6\xc0\xbb\x0a\xc1"
-"\xf6\xbf\xf8\xc7\xd5\xb4\xcf\xb4\xd9\x2e\x20\xc6\xc4\xc0\xcc\xbd"
-"\xe3\xc0\xc7\x20\xbf\xec\xbe\xc6\x28\xe9\xd0\xe4\xba\x29\xc7\xd1"
-"\x20\xb9\xae\xb9\xfd\xb0\xfa\x20\xb5\xbf\xc0\xfb\x20\xc5\xb8\xc0"
-"\xcc\xc7\xce\x2c\x20\xb1\xd7\xb8\xae\xb0\xed\x20\xc0\xce\xc5\xcd"
-"\xc7\xc1\xb8\xae\xc6\xc3\x0a\xc8\xaf\xb0\xe6\xc0\xba\x20\xc6\xc4"
-"\xc0\xcc\xbd\xe3\xc0\xbb\x20\xbd\xba\xc5\xa9\xb8\xb3\xc6\xc3\xb0"
-"\xfa\x20\xbf\xa9\xb7\xaf\x20\xba\xd0\xbe\xdf\xbf\xa1\xbc\xad\xbf"
-"\xcd\x20\xb4\xeb\xba\xce\xba\xd0\xc0\xc7\x20\xc7\xc3\xb7\xa7\xc6"
-"\xfb\xbf\xa1\xbc\xad\xc0\xc7\x20\xba\xfc\xb8\xa5\x0a\xbe\xd6\xc7"
-"\xc3\xb8\xae\xc4\xc9\xc0\xcc\xbc\xc7\x20\xb0\xb3\xb9\xdf\xc0\xbb"
-"\x20\xc7\xd2\x20\xbc\xf6\x20\xc0\xd6\xb4\xc2\x20\xc0\xcc\xbb\xf3"
-"\xc0\xfb\xc0\xce\x20\xbe\xf0\xbe\xee\xb7\xce\x20\xb8\xb8\xb5\xe9"
-"\xbe\xee\xc1\xdd\xb4\xcf\xb4\xd9\x2e\x0a\x0a\xa1\xd9\xc3\xb9\xb0"
-"\xa1\xb3\xa1\x3a\x20\xb3\xaf\xbe\xc6\xb6\xf3\x20\xa4\xd4\xa4\xb6"
-"\xa4\xd0\xa4\xd4\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xd4\xbe\xb1\x7e\x20"
-"\xa4\xd4\xa4\xa4\xa4\xd2\xa4\xb7\xc5\xad\x21\x20\xa4\xd4\xa4\xa8"
-"\xa4\xd1\xa4\xb7\xb1\xdd\xbe\xf8\xc0\xcc\x20\xc0\xfc\xa4\xd4\xa4"
-"\xbe\xa4\xc8\xa4\xb2\xb4\xcf\xb4\xd9\x2e\x20\xa4\xd4\xa4\xb2\xa4"
-"\xce\xa4\xaa\x2e\x20\xb1\xd7\xb7\xb1\xb0\xc5\x20\xa4\xd4\xa4\xb7"
-"\xa4\xd1\xa4\xb4\xb4\xd9\x2e\x0a",
-"\xe2\x97\x8e\x20\xed\x8c\x8c\xec\x9d\xb4\xec\x8d\xac\x28\x50\x79"
-"\x74\x68\x6f\x6e\x29\xec\x9d\x80\x20\xeb\xb0\xb0\xec\x9a\xb0\xea"
-"\xb8\xb0\x20\xec\x89\xbd\xea\xb3\xa0\x2c\x20\xea\xb0\x95\xeb\xa0"
-"\xa5\xed\x95\x9c\x20\xed\x94\x84\xeb\xa1\x9c\xea\xb7\xb8\xeb\x9e"
-"\x98\xeb\xb0\x8d\x20\xec\x96\xb8\xec\x96\xb4\xec\x9e\x85\xeb\x8b"
-"\x88\xeb\x8b\xa4\x2e\x20\xed\x8c\x8c\xec\x9d\xb4\xec\x8d\xac\xec"
-"\x9d\x80\x0a\xed\x9a\xa8\xec\x9c\xa8\xec\xa0\x81\xec\x9d\xb8\x20"
-"\xea\xb3\xa0\xec\x88\x98\xec\xa4\x80\x20\xeb\x8d\xb0\xec\x9d\xb4"
-"\xed\x84\xb0\x20\xea\xb5\xac\xec\xa1\xb0\xec\x99\x80\x20\xea\xb0"
-"\x84\xeb\x8b\xa8\xed\x95\x98\xec\xa7\x80\xeb\xa7\x8c\x20\xed\x9a"
-"\xa8\xec\x9c\xa8\xec\xa0\x81\xec\x9d\xb8\x20\xea\xb0\x9d\xec\xb2"
-"\xb4\xec\xa7\x80\xed\x96\xa5\xed\x94\x84\xeb\xa1\x9c\xea\xb7\xb8"
-"\xeb\x9e\x98\xeb\xb0\x8d\xec\x9d\x84\x0a\xec\xa7\x80\xec\x9b\x90"
-"\xed\x95\xa9\xeb\x8b\x88\xeb\x8b\xa4\x2e\x20\xed\x8c\x8c\xec\x9d"
-"\xb4\xec\x8d\xac\xec\x9d\x98\x20\xec\x9a\xb0\xec\x95\x84\x28\xe5"
-"\x84\xaa\xe9\x9b\x85\x29\xed\x95\x9c\x20\xeb\xac\xb8\xeb\xb2\x95"
-"\xea\xb3\xbc\x20\xeb\x8f\x99\xec\xa0\x81\x20\xed\x83\x80\xec\x9d"
-"\xb4\xed\x95\x91\x2c\x20\xea\xb7\xb8\xeb\xa6\xac\xea\xb3\xa0\x20"
-"\xec\x9d\xb8\xed\x84\xb0\xed\x94\x84\xeb\xa6\xac\xed\x8c\x85\x0a"
-"\xed\x99\x98\xea\xb2\xbd\xec\x9d\x80\x20\xed\x8c\x8c\xec\x9d\xb4"
-"\xec\x8d\xac\xec\x9d\x84\x20\xec\x8a\xa4\xed\x81\xac\xeb\xa6\xbd"
-"\xed\x8c\x85\xea\xb3\xbc\x20\xec\x97\xac\xeb\x9f\xac\x20\xeb\xb6"
-"\x84\xec\x95\xbc\xec\x97\x90\xec\x84\x9c\xec\x99\x80\x20\xeb\x8c"
-"\x80\xeb\xb6\x80\xeb\xb6\x84\xec\x9d\x98\x20\xed\x94\x8c\xeb\x9e"
-"\xab\xed\x8f\xbc\xec\x97\x90\xec\x84\x9c\xec\x9d\x98\x20\xeb\xb9"
-"\xa0\xeb\xa5\xb8\x0a\xec\x95\xa0\xed\x94\x8c\xeb\xa6\xac\xec\xbc"
-"\x80\xec\x9d\xb4\xec\x85\x98\x20\xea\xb0\x9c\xeb\xb0\x9c\xec\x9d"
-"\x84\x20\xed\x95\xa0\x20\xec\x88\x98\x20\xec\x9e\x88\xeb\x8a\x94"
-"\x20\xec\x9d\xb4\xec\x83\x81\xec\xa0\x81\xec\x9d\xb8\x20\xec\x96"
-"\xb8\xec\x96\xb4\xeb\xa1\x9c\x20\xeb\xa7\x8c\xeb\x93\xa4\xec\x96"
-"\xb4\xec\xa4\x8d\xeb\x8b\x88\xeb\x8b\xa4\x2e\x0a\x0a\xe2\x98\x86"
-"\xec\xb2\xab\xea\xb0\x80\xeb\x81\x9d\x3a\x20\xeb\x82\xa0\xec\x95"
-"\x84\xeb\x9d\xbc\x20\xec\x93\x94\xec\x93\x94\xec\x93\xa9\x7e\x20"
-"\xeb\x8b\x81\xed\x81\xbc\x21\x20\xeb\x9c\xbd\xea\xb8\x88\xec\x97"
-"\x86\xec\x9d\xb4\x20\xec\xa0\x84\xed\x99\xa5\xeb\x8b\x88\xeb\x8b"
-"\xa4\x2e\x20\xeb\xb7\x81\x2e\x20\xea\xb7\xb8\xeb\x9f\xb0\xea\xb1"
-"\xb0\x20\xec\x9d\x8e\xeb\x8b\xa4\x2e\x0a"),
-'gb18030': (
-"\x50\x79\x74\x68\x6f\x6e\xa3\xa8\xc5\xc9\xc9\xad\xa3\xa9\xd3\xef"
-"\xd1\xd4\xca\xc7\xd2\xbb\xd6\xd6\xb9\xa6\xc4\xdc\xc7\xbf\xb4\xf3"
-"\xb6\xf8\xcd\xea\xc9\xc6\xb5\xc4\xcd\xa8\xd3\xc3\xd0\xcd\xbc\xc6"
-"\xcb\xe3\xbb\xfa\xb3\xcc\xd0\xf2\xc9\xe8\xbc\xc6\xd3\xef\xd1\xd4"
-"\xa3\xac\x0a\xd2\xd1\xbe\xad\xbe\xdf\xd3\xd0\xca\xae\xb6\xe0\xc4"
-"\xea\xb5\xc4\xb7\xa2\xd5\xb9\xc0\xfa\xca\xb7\xa3\xac\xb3\xc9\xca"
-"\xec\xc7\xd2\xce\xc8\xb6\xa8\xa1\xa3\xd5\xe2\xd6\xd6\xd3\xef\xd1"
-"\xd4\xbe\xdf\xd3\xd0\xb7\xc7\xb3\xa3\xbc\xf2\xbd\xdd\xb6\xf8\xc7"
-"\xe5\xce\xfa\x0a\xb5\xc4\xd3\xef\xb7\xa8\xcc\xd8\xb5\xe3\xa3\xac"
-"\xca\xca\xba\xcf\xcd\xea\xb3\xc9\xb8\xf7\xd6\xd6\xb8\xdf\xb2\xe3"
-"\xc8\xce\xce\xf1\xa3\xac\xbc\xb8\xba\xf5\xbf\xc9\xd2\xd4\xd4\xda"
-"\xcb\xf9\xd3\xd0\xb5\xc4\xb2\xd9\xd7\xf7\xcf\xb5\xcd\xb3\xd6\xd0"
-"\x0a\xd4\xcb\xd0\xd0\xa1\xa3\xd5\xe2\xd6\xd6\xd3\xef\xd1\xd4\xbc"
-"\xf2\xb5\xa5\xb6\xf8\xc7\xbf\xb4\xf3\xa3\xac\xca\xca\xba\xcf\xb8"
-"\xf7\xd6\xd6\xc8\xcb\xca\xbf\xd1\xa7\xcf\xb0\xca\xb9\xd3\xc3\xa1"
-"\xa3\xc4\xbf\xc7\xb0\xa3\xac\xbb\xf9\xd3\xda\xd5\xe2\x0a\xd6\xd6"
-"\xd3\xef\xd1\xd4\xb5\xc4\xcf\xe0\xb9\xd8\xbc\xbc\xca\xf5\xd5\xfd"
-"\xd4\xda\xb7\xc9\xcb\xd9\xb5\xc4\xb7\xa2\xd5\xb9\xa3\xac\xd3\xc3"
-"\xbb\xa7\xca\xfd\xc1\xbf\xbc\xb1\xbe\xe7\xc0\xa9\xb4\xf3\xa3\xac"
-"\xcf\xe0\xb9\xd8\xb5\xc4\xd7\xca\xd4\xb4\xb7\xc7\xb3\xa3\xb6\xe0"
-"\xa1\xa3\x0a\xc8\xe7\xba\xce\xd4\xda\x20\x50\x79\x74\x68\x6f\x6e"
-"\x20\xd6\xd0\xca\xb9\xd3\xc3\xbc\xc8\xd3\xd0\xb5\xc4\x20\x43\x20"
-"\x6c\x69\x62\x72\x61\x72\x79\x3f\x0a\xa1\xa1\xd4\xda\xd9\x59\xd3"
-"\x8d\xbf\xc6\xbc\xbc\xbf\xec\xcb\xd9\xb0\x6c\xd5\xb9\xb5\xc4\xbd"
-"\xf1\xcc\xec\x2c\x20\xe9\x5f\xb0\x6c\xbc\xb0\x9c\x79\xd4\x87\xdc"
-"\x9b\xf3\x77\xb5\xc4\xcb\xd9\xb6\xc8\xca\xc7\xb2\xbb\xc8\xdd\xba"
-"\xf6\xd2\x95\xb5\xc4\x0a\xd5\x6e\xee\x7d\x2e\x20\x9e\xe9\xbc\xd3"
-"\xbf\xec\xe9\x5f\xb0\x6c\xbc\xb0\x9c\x79\xd4\x87\xb5\xc4\xcb\xd9"
-"\xb6\xc8\x2c\x20\xce\xd2\x82\x83\xb1\xe3\xb3\xa3\xcf\xa3\xcd\xfb"
-"\xc4\xdc\xc0\xfb\xd3\xc3\xd2\xbb\xd0\xa9\xd2\xd1\xe9\x5f\xb0\x6c"
-"\xba\xc3\xb5\xc4\x0a\x6c\x69\x62\x72\x61\x72\x79\x2c\x20\x81\x4b"
-"\xd3\xd0\xd2\xbb\x82\x80\x20\x66\x61\x73\x74\x20\x70\x72\x6f\x74"
-"\x6f\x74\x79\x70\x69\x6e\x67\x20\xb5\xc4\x20\x70\x72\x6f\x67\x72"
-"\x61\x6d\x6d\x69\x6e\x67\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20"
-"\xbf\xc9\x0a\xb9\xa9\xca\xb9\xd3\xc3\x2e\x20\xc4\xbf\xc7\xb0\xd3"
-"\xd0\xd4\x53\xd4\x53\xb6\xe0\xb6\xe0\xb5\xc4\x20\x6c\x69\x62\x72"
-"\x61\x72\x79\x20\xca\xc7\xd2\xd4\x20\x43\x20\x8c\x91\xb3\xc9\x2c"
-"\x20\xb6\xf8\x20\x50\x79\x74\x68\x6f\x6e\x20\xca\xc7\xd2\xbb\x82"
-"\x80\x0a\x66\x61\x73\x74\x20\x70\x72\x6f\x74\x6f\x74\x79\x70\x69"
-"\x6e\x67\x20\xb5\xc4\x20\x70\x72\x6f\x67\x72\x61\x6d\x6d\x69\x6e"
-"\x67\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x2e\x20\xb9\xca\xce\xd2"
-"\x82\x83\xcf\xa3\xcd\xfb\xc4\xdc\x8c\xa2\xbc\xc8\xd3\xd0\xb5\xc4"
-"\x0a\x43\x20\x6c\x69\x62\x72\x61\x72\x79\x20\xc4\xc3\xb5\xbd\x20"
-"\x50\x79\x74\x68\x6f\x6e\x20\xb5\xc4\xad\x68\xbe\xb3\xd6\xd0\x9c"
-"\x79\xd4\x87\xbc\xb0\xd5\xfb\xba\xcf\x2e\x20\xc6\xe4\xd6\xd0\xd7"
-"\xee\xd6\xf7\xd2\xaa\xd2\xb2\xca\xc7\xce\xd2\x82\x83\xcb\xf9\x0a"
-"\xd2\xaa\xd3\x91\xd5\x93\xb5\xc4\x86\x96\xee\x7d\xbe\xcd\xca\xc7"
-"\x3a\x0a\x83\x35\xc7\x31\x83\x33\x9a\x33\x83\x32\xb1\x31\x83\x33"
-"\x95\x31\x20\x82\x37\xd1\x36\x83\x30\x8c\x34\x83\x36\x84\x33\x20"
-"\x82\x38\x89\x35\x82\x38\xfb\x36\x83\x33\x95\x35\x20\x83\x33\xd5"
-"\x31\x82\x39\x81\x35\x20\x83\x30\xfd\x39\x83\x33\x86\x30\x20\x83"
-"\x34\xdc\x33\x83\x35\xf6\x37\x83\x35\x97\x35\x20\x83\x35\xf9\x35"
-"\x83\x30\x91\x39\x82\x38\x83\x39\x82\x39\xfc\x33\x83\x30\xf0\x34"
-"\x20\x83\x32\xeb\x39\x83\x32\xeb\x35\x82\x39\x83\x39\x2e\x0a\x0a",
-"\x50\x79\x74\x68\x6f\x6e\xef\xbc\x88\xe6\xb4\xbe\xe6\xa3\xae\xef"
-"\xbc\x89\xe8\xaf\xad\xe8\xa8\x80\xe6\x98\xaf\xe4\xb8\x80\xe7\xa7"
-"\x8d\xe5\x8a\x9f\xe8\x83\xbd\xe5\xbc\xba\xe5\xa4\xa7\xe8\x80\x8c"
-"\xe5\xae\x8c\xe5\x96\x84\xe7\x9a\x84\xe9\x80\x9a\xe7\x94\xa8\xe5"
-"\x9e\x8b\xe8\xae\xa1\xe7\xae\x97\xe6\x9c\xba\xe7\xa8\x8b\xe5\xba"
-"\x8f\xe8\xae\xbe\xe8\xae\xa1\xe8\xaf\xad\xe8\xa8\x80\xef\xbc\x8c"
-"\x0a\xe5\xb7\xb2\xe7\xbb\x8f\xe5\x85\xb7\xe6\x9c\x89\xe5\x8d\x81"
-"\xe5\xa4\x9a\xe5\xb9\xb4\xe7\x9a\x84\xe5\x8f\x91\xe5\xb1\x95\xe5"
-"\x8e\x86\xe5\x8f\xb2\xef\xbc\x8c\xe6\x88\x90\xe7\x86\x9f\xe4\xb8"
-"\x94\xe7\xa8\xb3\xe5\xae\x9a\xe3\x80\x82\xe8\xbf\x99\xe7\xa7\x8d"
-"\xe8\xaf\xad\xe8\xa8\x80\xe5\x85\xb7\xe6\x9c\x89\xe9\x9d\x9e\xe5"
-"\xb8\xb8\xe7\xae\x80\xe6\x8d\xb7\xe8\x80\x8c\xe6\xb8\x85\xe6\x99"
-"\xb0\x0a\xe7\x9a\x84\xe8\xaf\xad\xe6\xb3\x95\xe7\x89\xb9\xe7\x82"
-"\xb9\xef\xbc\x8c\xe9\x80\x82\xe5\x90\x88\xe5\xae\x8c\xe6\x88\x90"
-"\xe5\x90\x84\xe7\xa7\x8d\xe9\xab\x98\xe5\xb1\x82\xe4\xbb\xbb\xe5"
-"\x8a\xa1\xef\xbc\x8c\xe5\x87\xa0\xe4\xb9\x8e\xe5\x8f\xaf\xe4\xbb"
-"\xa5\xe5\x9c\xa8\xe6\x89\x80\xe6\x9c\x89\xe7\x9a\x84\xe6\x93\x8d"
-"\xe4\xbd\x9c\xe7\xb3\xbb\xe7\xbb\x9f\xe4\xb8\xad\x0a\xe8\xbf\x90"
-"\xe8\xa1\x8c\xe3\x80\x82\xe8\xbf\x99\xe7\xa7\x8d\xe8\xaf\xad\xe8"
-"\xa8\x80\xe7\xae\x80\xe5\x8d\x95\xe8\x80\x8c\xe5\xbc\xba\xe5\xa4"
-"\xa7\xef\xbc\x8c\xe9\x80\x82\xe5\x90\x88\xe5\x90\x84\xe7\xa7\x8d"
-"\xe4\xba\xba\xe5\xa3\xab\xe5\xad\xa6\xe4\xb9\xa0\xe4\xbd\xbf\xe7"
-"\x94\xa8\xe3\x80\x82\xe7\x9b\xae\xe5\x89\x8d\xef\xbc\x8c\xe5\x9f"
-"\xba\xe4\xba\x8e\xe8\xbf\x99\x0a\xe7\xa7\x8d\xe8\xaf\xad\xe8\xa8"
-"\x80\xe7\x9a\x84\xe7\x9b\xb8\xe5\x85\xb3\xe6\x8a\x80\xe6\x9c\xaf"
-"\xe6\xad\xa3\xe5\x9c\xa8\xe9\xa3\x9e\xe9\x80\x9f\xe7\x9a\x84\xe5"
-"\x8f\x91\xe5\xb1\x95\xef\xbc\x8c\xe7\x94\xa8\xe6\x88\xb7\xe6\x95"
-"\xb0\xe9\x87\x8f\xe6\x80\xa5\xe5\x89\xa7\xe6\x89\xa9\xe5\xa4\xa7"
-"\xef\xbc\x8c\xe7\x9b\xb8\xe5\x85\xb3\xe7\x9a\x84\xe8\xb5\x84\xe6"
-"\xba\x90\xe9\x9d\x9e\xe5\xb8\xb8\xe5\xa4\x9a\xe3\x80\x82\x0a\xe5"
-"\xa6\x82\xe4\xbd\x95\xe5\x9c\xa8\x20\x50\x79\x74\x68\x6f\x6e\x20"
-"\xe4\xb8\xad\xe4\xbd\xbf\xe7\x94\xa8\xe6\x97\xa2\xe6\x9c\x89\xe7"
-"\x9a\x84\x20\x43\x20\x6c\x69\x62\x72\x61\x72\x79\x3f\x0a\xe3\x80"
-"\x80\xe5\x9c\xa8\xe8\xb3\x87\xe8\xa8\x8a\xe7\xa7\x91\xe6\x8a\x80"
-"\xe5\xbf\xab\xe9\x80\x9f\xe7\x99\xbc\xe5\xb1\x95\xe7\x9a\x84\xe4"
-"\xbb\x8a\xe5\xa4\xa9\x2c\x20\xe9\x96\x8b\xe7\x99\xbc\xe5\x8f\x8a"
-"\xe6\xb8\xac\xe8\xa9\xa6\xe8\xbb\x9f\xe9\xab\x94\xe7\x9a\x84\xe9"
-"\x80\x9f\xe5\xba\xa6\xe6\x98\xaf\xe4\xb8\x8d\xe5\xae\xb9\xe5\xbf"
-"\xbd\xe8\xa6\x96\xe7\x9a\x84\x0a\xe8\xaa\xb2\xe9\xa1\x8c\x2e\x20"
-"\xe7\x82\xba\xe5\x8a\xa0\xe5\xbf\xab\xe9\x96\x8b\xe7\x99\xbc\xe5"
-"\x8f\x8a\xe6\xb8\xac\xe8\xa9\xa6\xe7\x9a\x84\xe9\x80\x9f\xe5\xba"
-"\xa6\x2c\x20\xe6\x88\x91\xe5\x80\x91\xe4\xbe\xbf\xe5\xb8\xb8\xe5"
-"\xb8\x8c\xe6\x9c\x9b\xe8\x83\xbd\xe5\x88\xa9\xe7\x94\xa8\xe4\xb8"
-"\x80\xe4\xba\x9b\xe5\xb7\xb2\xe9\x96\x8b\xe7\x99\xbc\xe5\xa5\xbd"
-"\xe7\x9a\x84\x0a\x6c\x69\x62\x72\x61\x72\x79\x2c\x20\xe4\xb8\xa6"
-"\xe6\x9c\x89\xe4\xb8\x80\xe5\x80\x8b\x20\x66\x61\x73\x74\x20\x70"
-"\x72\x6f\x74\x6f\x74\x79\x70\x69\x6e\x67\x20\xe7\x9a\x84\x20\x70"
-"\x72\x6f\x67\x72\x61\x6d\x6d\x69\x6e\x67\x20\x6c\x61\x6e\x67\x75"
-"\x61\x67\x65\x20\xe5\x8f\xaf\x0a\xe4\xbe\x9b\xe4\xbd\xbf\xe7\x94"
-"\xa8\x2e\x20\xe7\x9b\xae\xe5\x89\x8d\xe6\x9c\x89\xe8\xa8\xb1\xe8"
-"\xa8\xb1\xe5\xa4\x9a\xe5\xa4\x9a\xe7\x9a\x84\x20\x6c\x69\x62\x72"
-"\x61\x72\x79\x20\xe6\x98\xaf\xe4\xbb\xa5\x20\x43\x20\xe5\xaf\xab"
-"\xe6\x88\x90\x2c\x20\xe8\x80\x8c\x20\x50\x79\x74\x68\x6f\x6e\x20"
-"\xe6\x98\xaf\xe4\xb8\x80\xe5\x80\x8b\x0a\x66\x61\x73\x74\x20\x70"
-"\x72\x6f\x74\x6f\x74\x79\x70\x69\x6e\x67\x20\xe7\x9a\x84\x20\x70"
-"\x72\x6f\x67\x72\x61\x6d\x6d\x69\x6e\x67\x20\x6c\x61\x6e\x67\x75"
-"\x61\x67\x65\x2e\x20\xe6\x95\x85\xe6\x88\x91\xe5\x80\x91\xe5\xb8"
-"\x8c\xe6\x9c\x9b\xe8\x83\xbd\xe5\xb0\x87\xe6\x97\xa2\xe6\x9c\x89"
-"\xe7\x9a\x84\x0a\x43\x20\x6c\x69\x62\x72\x61\x72\x79\x20\xe6\x8b"
-"\xbf\xe5\x88\xb0\x20\x50\x79\x74\x68\x6f\x6e\x20\xe7\x9a\x84\xe7"
-"\x92\xb0\xe5\xa2\x83\xe4\xb8\xad\xe6\xb8\xac\xe8\xa9\xa6\xe5\x8f"
-"\x8a\xe6\x95\xb4\xe5\x90\x88\x2e\x20\xe5\x85\xb6\xe4\xb8\xad\xe6"
-"\x9c\x80\xe4\xb8\xbb\xe8\xa6\x81\xe4\xb9\x9f\xe6\x98\xaf\xe6\x88"
-"\x91\xe5\x80\x91\xe6\x89\x80\x0a\xe8\xa6\x81\xe8\xa8\x8e\xe8\xab"
-"\x96\xe7\x9a\x84\xe5\x95\x8f\xe9\xa1\x8c\xe5\xb0\xb1\xe6\x98\xaf"
-"\x3a\x0a\xed\x8c\x8c\xec\x9d\xb4\xec\x8d\xac\xec\x9d\x80\x20\xea"
-"\xb0\x95\xeb\xa0\xa5\xed\x95\x9c\x20\xea\xb8\xb0\xeb\x8a\xa5\xec"
-"\x9d\x84\x20\xec\xa7\x80\xeb\x8b\x8c\x20\xeb\xb2\x94\xec\x9a\xa9"
-"\x20\xec\xbb\xb4\xed\x93\xa8\xed\x84\xb0\x20\xed\x94\x84\xeb\xa1"
-"\x9c\xea\xb7\xb8\xeb\x9e\x98\xeb\xb0\x8d\x20\xec\x96\xb8\xec\x96"
-"\xb4\xeb\x8b\xa4\x2e\x0a\x0a"),
-'gb2312': (
-"\x50\x79\x74\x68\x6f\x6e\xa3\xa8\xc5\xc9\xc9\xad\xa3\xa9\xd3\xef"
-"\xd1\xd4\xca\xc7\xd2\xbb\xd6\xd6\xb9\xa6\xc4\xdc\xc7\xbf\xb4\xf3"
-"\xb6\xf8\xcd\xea\xc9\xc6\xb5\xc4\xcd\xa8\xd3\xc3\xd0\xcd\xbc\xc6"
-"\xcb\xe3\xbb\xfa\xb3\xcc\xd0\xf2\xc9\xe8\xbc\xc6\xd3\xef\xd1\xd4"
-"\xa3\xac\x0a\xd2\xd1\xbe\xad\xbe\xdf\xd3\xd0\xca\xae\xb6\xe0\xc4"
-"\xea\xb5\xc4\xb7\xa2\xd5\xb9\xc0\xfa\xca\xb7\xa3\xac\xb3\xc9\xca"
-"\xec\xc7\xd2\xce\xc8\xb6\xa8\xa1\xa3\xd5\xe2\xd6\xd6\xd3\xef\xd1"
-"\xd4\xbe\xdf\xd3\xd0\xb7\xc7\xb3\xa3\xbc\xf2\xbd\xdd\xb6\xf8\xc7"
-"\xe5\xce\xfa\x0a\xb5\xc4\xd3\xef\xb7\xa8\xcc\xd8\xb5\xe3\xa3\xac"
-"\xca\xca\xba\xcf\xcd\xea\xb3\xc9\xb8\xf7\xd6\xd6\xb8\xdf\xb2\xe3"
-"\xc8\xce\xce\xf1\xa3\xac\xbc\xb8\xba\xf5\xbf\xc9\xd2\xd4\xd4\xda"
-"\xcb\xf9\xd3\xd0\xb5\xc4\xb2\xd9\xd7\xf7\xcf\xb5\xcd\xb3\xd6\xd0"
-"\x0a\xd4\xcb\xd0\xd0\xa1\xa3\xd5\xe2\xd6\xd6\xd3\xef\xd1\xd4\xbc"
-"\xf2\xb5\xa5\xb6\xf8\xc7\xbf\xb4\xf3\xa3\xac\xca\xca\xba\xcf\xb8"
-"\xf7\xd6\xd6\xc8\xcb\xca\xbf\xd1\xa7\xcf\xb0\xca\xb9\xd3\xc3\xa1"
-"\xa3\xc4\xbf\xc7\xb0\xa3\xac\xbb\xf9\xd3\xda\xd5\xe2\x0a\xd6\xd6"
-"\xd3\xef\xd1\xd4\xb5\xc4\xcf\xe0\xb9\xd8\xbc\xbc\xca\xf5\xd5\xfd"
-"\xd4\xda\xb7\xc9\xcb\xd9\xb5\xc4\xb7\xa2\xd5\xb9\xa3\xac\xd3\xc3"
-"\xbb\xa7\xca\xfd\xc1\xbf\xbc\xb1\xbe\xe7\xc0\xa9\xb4\xf3\xa3\xac"
-"\xcf\xe0\xb9\xd8\xb5\xc4\xd7\xca\xd4\xb4\xb7\xc7\xb3\xa3\xb6\xe0"
-"\xa1\xa3\x0a\x0a",
-"\x50\x79\x74\x68\x6f\x6e\xef\xbc\x88\xe6\xb4\xbe\xe6\xa3\xae\xef"
-"\xbc\x89\xe8\xaf\xad\xe8\xa8\x80\xe6\x98\xaf\xe4\xb8\x80\xe7\xa7"
-"\x8d\xe5\x8a\x9f\xe8\x83\xbd\xe5\xbc\xba\xe5\xa4\xa7\xe8\x80\x8c"
-"\xe5\xae\x8c\xe5\x96\x84\xe7\x9a\x84\xe9\x80\x9a\xe7\x94\xa8\xe5"
-"\x9e\x8b\xe8\xae\xa1\xe7\xae\x97\xe6\x9c\xba\xe7\xa8\x8b\xe5\xba"
-"\x8f\xe8\xae\xbe\xe8\xae\xa1\xe8\xaf\xad\xe8\xa8\x80\xef\xbc\x8c"
-"\x0a\xe5\xb7\xb2\xe7\xbb\x8f\xe5\x85\xb7\xe6\x9c\x89\xe5\x8d\x81"
-"\xe5\xa4\x9a\xe5\xb9\xb4\xe7\x9a\x84\xe5\x8f\x91\xe5\xb1\x95\xe5"
-"\x8e\x86\xe5\x8f\xb2\xef\xbc\x8c\xe6\x88\x90\xe7\x86\x9f\xe4\xb8"
-"\x94\xe7\xa8\xb3\xe5\xae\x9a\xe3\x80\x82\xe8\xbf\x99\xe7\xa7\x8d"
-"\xe8\xaf\xad\xe8\xa8\x80\xe5\x85\xb7\xe6\x9c\x89\xe9\x9d\x9e\xe5"
-"\xb8\xb8\xe7\xae\x80\xe6\x8d\xb7\xe8\x80\x8c\xe6\xb8\x85\xe6\x99"
-"\xb0\x0a\xe7\x9a\x84\xe8\xaf\xad\xe6\xb3\x95\xe7\x89\xb9\xe7\x82"
-"\xb9\xef\xbc\x8c\xe9\x80\x82\xe5\x90\x88\xe5\xae\x8c\xe6\x88\x90"
-"\xe5\x90\x84\xe7\xa7\x8d\xe9\xab\x98\xe5\xb1\x82\xe4\xbb\xbb\xe5"
-"\x8a\xa1\xef\xbc\x8c\xe5\x87\xa0\xe4\xb9\x8e\xe5\x8f\xaf\xe4\xbb"
-"\xa5\xe5\x9c\xa8\xe6\x89\x80\xe6\x9c\x89\xe7\x9a\x84\xe6\x93\x8d"
-"\xe4\xbd\x9c\xe7\xb3\xbb\xe7\xbb\x9f\xe4\xb8\xad\x0a\xe8\xbf\x90"
-"\xe8\xa1\x8c\xe3\x80\x82\xe8\xbf\x99\xe7\xa7\x8d\xe8\xaf\xad\xe8"
-"\xa8\x80\xe7\xae\x80\xe5\x8d\x95\xe8\x80\x8c\xe5\xbc\xba\xe5\xa4"
-"\xa7\xef\xbc\x8c\xe9\x80\x82\xe5\x90\x88\xe5\x90\x84\xe7\xa7\x8d"
-"\xe4\xba\xba\xe5\xa3\xab\xe5\xad\xa6\xe4\xb9\xa0\xe4\xbd\xbf\xe7"
-"\x94\xa8\xe3\x80\x82\xe7\x9b\xae\xe5\x89\x8d\xef\xbc\x8c\xe5\x9f"
-"\xba\xe4\xba\x8e\xe8\xbf\x99\x0a\xe7\xa7\x8d\xe8\xaf\xad\xe8\xa8"
-"\x80\xe7\x9a\x84\xe7\x9b\xb8\xe5\x85\xb3\xe6\x8a\x80\xe6\x9c\xaf"
-"\xe6\xad\xa3\xe5\x9c\xa8\xe9\xa3\x9e\xe9\x80\x9f\xe7\x9a\x84\xe5"
-"\x8f\x91\xe5\xb1\x95\xef\xbc\x8c\xe7\x94\xa8\xe6\x88\xb7\xe6\x95"
-"\xb0\xe9\x87\x8f\xe6\x80\xa5\xe5\x89\xa7\xe6\x89\xa9\xe5\xa4\xa7"
-"\xef\xbc\x8c\xe7\x9b\xb8\xe5\x85\xb3\xe7\x9a\x84\xe8\xb5\x84\xe6"
-"\xba\x90\xe9\x9d\x9e\xe5\xb8\xb8\xe5\xa4\x9a\xe3\x80\x82\x0a\x0a"),
-'gbk': (
-"\x50\x79\x74\x68\x6f\x6e\xa3\xa8\xc5\xc9\xc9\xad\xa3\xa9\xd3\xef"
-"\xd1\xd4\xca\xc7\xd2\xbb\xd6\xd6\xb9\xa6\xc4\xdc\xc7\xbf\xb4\xf3"
-"\xb6\xf8\xcd\xea\xc9\xc6\xb5\xc4\xcd\xa8\xd3\xc3\xd0\xcd\xbc\xc6"
-"\xcb\xe3\xbb\xfa\xb3\xcc\xd0\xf2\xc9\xe8\xbc\xc6\xd3\xef\xd1\xd4"
-"\xa3\xac\x0a\xd2\xd1\xbe\xad\xbe\xdf\xd3\xd0\xca\xae\xb6\xe0\xc4"
-"\xea\xb5\xc4\xb7\xa2\xd5\xb9\xc0\xfa\xca\xb7\xa3\xac\xb3\xc9\xca"
-"\xec\xc7\xd2\xce\xc8\xb6\xa8\xa1\xa3\xd5\xe2\xd6\xd6\xd3\xef\xd1"
-"\xd4\xbe\xdf\xd3\xd0\xb7\xc7\xb3\xa3\xbc\xf2\xbd\xdd\xb6\xf8\xc7"
-"\xe5\xce\xfa\x0a\xb5\xc4\xd3\xef\xb7\xa8\xcc\xd8\xb5\xe3\xa3\xac"
-"\xca\xca\xba\xcf\xcd\xea\xb3\xc9\xb8\xf7\xd6\xd6\xb8\xdf\xb2\xe3"
-"\xc8\xce\xce\xf1\xa3\xac\xbc\xb8\xba\xf5\xbf\xc9\xd2\xd4\xd4\xda"
-"\xcb\xf9\xd3\xd0\xb5\xc4\xb2\xd9\xd7\xf7\xcf\xb5\xcd\xb3\xd6\xd0"
-"\x0a\xd4\xcb\xd0\xd0\xa1\xa3\xd5\xe2\xd6\xd6\xd3\xef\xd1\xd4\xbc"
-"\xf2\xb5\xa5\xb6\xf8\xc7\xbf\xb4\xf3\xa3\xac\xca\xca\xba\xcf\xb8"
-"\xf7\xd6\xd6\xc8\xcb\xca\xbf\xd1\xa7\xcf\xb0\xca\xb9\xd3\xc3\xa1"
-"\xa3\xc4\xbf\xc7\xb0\xa3\xac\xbb\xf9\xd3\xda\xd5\xe2\x0a\xd6\xd6"
-"\xd3\xef\xd1\xd4\xb5\xc4\xcf\xe0\xb9\xd8\xbc\xbc\xca\xf5\xd5\xfd"
-"\xd4\xda\xb7\xc9\xcb\xd9\xb5\xc4\xb7\xa2\xd5\xb9\xa3\xac\xd3\xc3"
-"\xbb\xa7\xca\xfd\xc1\xbf\xbc\xb1\xbe\xe7\xc0\xa9\xb4\xf3\xa3\xac"
-"\xcf\xe0\xb9\xd8\xb5\xc4\xd7\xca\xd4\xb4\xb7\xc7\xb3\xa3\xb6\xe0"
-"\xa1\xa3\x0a\xc8\xe7\xba\xce\xd4\xda\x20\x50\x79\x74\x68\x6f\x6e"
-"\x20\xd6\xd0\xca\xb9\xd3\xc3\xbc\xc8\xd3\xd0\xb5\xc4\x20\x43\x20"
-"\x6c\x69\x62\x72\x61\x72\x79\x3f\x0a\xa1\xa1\xd4\xda\xd9\x59\xd3"
-"\x8d\xbf\xc6\xbc\xbc\xbf\xec\xcb\xd9\xb0\x6c\xd5\xb9\xb5\xc4\xbd"
-"\xf1\xcc\xec\x2c\x20\xe9\x5f\xb0\x6c\xbc\xb0\x9c\x79\xd4\x87\xdc"
-"\x9b\xf3\x77\xb5\xc4\xcb\xd9\xb6\xc8\xca\xc7\xb2\xbb\xc8\xdd\xba"
-"\xf6\xd2\x95\xb5\xc4\x0a\xd5\x6e\xee\x7d\x2e\x20\x9e\xe9\xbc\xd3"
-"\xbf\xec\xe9\x5f\xb0\x6c\xbc\xb0\x9c\x79\xd4\x87\xb5\xc4\xcb\xd9"
-"\xb6\xc8\x2c\x20\xce\xd2\x82\x83\xb1\xe3\xb3\xa3\xcf\xa3\xcd\xfb"
-"\xc4\xdc\xc0\xfb\xd3\xc3\xd2\xbb\xd0\xa9\xd2\xd1\xe9\x5f\xb0\x6c"
-"\xba\xc3\xb5\xc4\x0a\x6c\x69\x62\x72\x61\x72\x79\x2c\x20\x81\x4b"
-"\xd3\xd0\xd2\xbb\x82\x80\x20\x66\x61\x73\x74\x20\x70\x72\x6f\x74"
-"\x6f\x74\x79\x70\x69\x6e\x67\x20\xb5\xc4\x20\x70\x72\x6f\x67\x72"
-"\x61\x6d\x6d\x69\x6e\x67\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20"
-"\xbf\xc9\x0a\xb9\xa9\xca\xb9\xd3\xc3\x2e\x20\xc4\xbf\xc7\xb0\xd3"
-"\xd0\xd4\x53\xd4\x53\xb6\xe0\xb6\xe0\xb5\xc4\x20\x6c\x69\x62\x72"
-"\x61\x72\x79\x20\xca\xc7\xd2\xd4\x20\x43\x20\x8c\x91\xb3\xc9\x2c"
-"\x20\xb6\xf8\x20\x50\x79\x74\x68\x6f\x6e\x20\xca\xc7\xd2\xbb\x82"
-"\x80\x0a\x66\x61\x73\x74\x20\x70\x72\x6f\x74\x6f\x74\x79\x70\x69"
-"\x6e\x67\x20\xb5\xc4\x20\x70\x72\x6f\x67\x72\x61\x6d\x6d\x69\x6e"
-"\x67\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x2e\x20\xb9\xca\xce\xd2"
-"\x82\x83\xcf\xa3\xcd\xfb\xc4\xdc\x8c\xa2\xbc\xc8\xd3\xd0\xb5\xc4"
-"\x0a\x43\x20\x6c\x69\x62\x72\x61\x72\x79\x20\xc4\xc3\xb5\xbd\x20"
-"\x50\x79\x74\x68\x6f\x6e\x20\xb5\xc4\xad\x68\xbe\xb3\xd6\xd0\x9c"
-"\x79\xd4\x87\xbc\xb0\xd5\xfb\xba\xcf\x2e\x20\xc6\xe4\xd6\xd0\xd7"
-"\xee\xd6\xf7\xd2\xaa\xd2\xb2\xca\xc7\xce\xd2\x82\x83\xcb\xf9\x0a"
-"\xd2\xaa\xd3\x91\xd5\x93\xb5\xc4\x86\x96\xee\x7d\xbe\xcd\xca\xc7"
-"\x3a\x0a\x0a",
-"\x50\x79\x74\x68\x6f\x6e\xef\xbc\x88\xe6\xb4\xbe\xe6\xa3\xae\xef"
-"\xbc\x89\xe8\xaf\xad\xe8\xa8\x80\xe6\x98\xaf\xe4\xb8\x80\xe7\xa7"
-"\x8d\xe5\x8a\x9f\xe8\x83\xbd\xe5\xbc\xba\xe5\xa4\xa7\xe8\x80\x8c"
-"\xe5\xae\x8c\xe5\x96\x84\xe7\x9a\x84\xe9\x80\x9a\xe7\x94\xa8\xe5"
-"\x9e\x8b\xe8\xae\xa1\xe7\xae\x97\xe6\x9c\xba\xe7\xa8\x8b\xe5\xba"
-"\x8f\xe8\xae\xbe\xe8\xae\xa1\xe8\xaf\xad\xe8\xa8\x80\xef\xbc\x8c"
-"\x0a\xe5\xb7\xb2\xe7\xbb\x8f\xe5\x85\xb7\xe6\x9c\x89\xe5\x8d\x81"
-"\xe5\xa4\x9a\xe5\xb9\xb4\xe7\x9a\x84\xe5\x8f\x91\xe5\xb1\x95\xe5"
-"\x8e\x86\xe5\x8f\xb2\xef\xbc\x8c\xe6\x88\x90\xe7\x86\x9f\xe4\xb8"
-"\x94\xe7\xa8\xb3\xe5\xae\x9a\xe3\x80\x82\xe8\xbf\x99\xe7\xa7\x8d"
-"\xe8\xaf\xad\xe8\xa8\x80\xe5\x85\xb7\xe6\x9c\x89\xe9\x9d\x9e\xe5"
-"\xb8\xb8\xe7\xae\x80\xe6\x8d\xb7\xe8\x80\x8c\xe6\xb8\x85\xe6\x99"
-"\xb0\x0a\xe7\x9a\x84\xe8\xaf\xad\xe6\xb3\x95\xe7\x89\xb9\xe7\x82"
-"\xb9\xef\xbc\x8c\xe9\x80\x82\xe5\x90\x88\xe5\xae\x8c\xe6\x88\x90"
-"\xe5\x90\x84\xe7\xa7\x8d\xe9\xab\x98\xe5\xb1\x82\xe4\xbb\xbb\xe5"
-"\x8a\xa1\xef\xbc\x8c\xe5\x87\xa0\xe4\xb9\x8e\xe5\x8f\xaf\xe4\xbb"
-"\xa5\xe5\x9c\xa8\xe6\x89\x80\xe6\x9c\x89\xe7\x9a\x84\xe6\x93\x8d"
-"\xe4\xbd\x9c\xe7\xb3\xbb\xe7\xbb\x9f\xe4\xb8\xad\x0a\xe8\xbf\x90"
-"\xe8\xa1\x8c\xe3\x80\x82\xe8\xbf\x99\xe7\xa7\x8d\xe8\xaf\xad\xe8"
-"\xa8\x80\xe7\xae\x80\xe5\x8d\x95\xe8\x80\x8c\xe5\xbc\xba\xe5\xa4"
-"\xa7\xef\xbc\x8c\xe9\x80\x82\xe5\x90\x88\xe5\x90\x84\xe7\xa7\x8d"
-"\xe4\xba\xba\xe5\xa3\xab\xe5\xad\xa6\xe4\xb9\xa0\xe4\xbd\xbf\xe7"
-"\x94\xa8\xe3\x80\x82\xe7\x9b\xae\xe5\x89\x8d\xef\xbc\x8c\xe5\x9f"
-"\xba\xe4\xba\x8e\xe8\xbf\x99\x0a\xe7\xa7\x8d\xe8\xaf\xad\xe8\xa8"
-"\x80\xe7\x9a\x84\xe7\x9b\xb8\xe5\x85\xb3\xe6\x8a\x80\xe6\x9c\xaf"
-"\xe6\xad\xa3\xe5\x9c\xa8\xe9\xa3\x9e\xe9\x80\x9f\xe7\x9a\x84\xe5"
-"\x8f\x91\xe5\xb1\x95\xef\xbc\x8c\xe7\x94\xa8\xe6\x88\xb7\xe6\x95"
-"\xb0\xe9\x87\x8f\xe6\x80\xa5\xe5\x89\xa7\xe6\x89\xa9\xe5\xa4\xa7"
-"\xef\xbc\x8c\xe7\x9b\xb8\xe5\x85\xb3\xe7\x9a\x84\xe8\xb5\x84\xe6"
-"\xba\x90\xe9\x9d\x9e\xe5\xb8\xb8\xe5\xa4\x9a\xe3\x80\x82\x0a\xe5"
-"\xa6\x82\xe4\xbd\x95\xe5\x9c\xa8\x20\x50\x79\x74\x68\x6f\x6e\x20"
-"\xe4\xb8\xad\xe4\xbd\xbf\xe7\x94\xa8\xe6\x97\xa2\xe6\x9c\x89\xe7"
-"\x9a\x84\x20\x43\x20\x6c\x69\x62\x72\x61\x72\x79\x3f\x0a\xe3\x80"
-"\x80\xe5\x9c\xa8\xe8\xb3\x87\xe8\xa8\x8a\xe7\xa7\x91\xe6\x8a\x80"
-"\xe5\xbf\xab\xe9\x80\x9f\xe7\x99\xbc\xe5\xb1\x95\xe7\x9a\x84\xe4"
-"\xbb\x8a\xe5\xa4\xa9\x2c\x20\xe9\x96\x8b\xe7\x99\xbc\xe5\x8f\x8a"
-"\xe6\xb8\xac\xe8\xa9\xa6\xe8\xbb\x9f\xe9\xab\x94\xe7\x9a\x84\xe9"
-"\x80\x9f\xe5\xba\xa6\xe6\x98\xaf\xe4\xb8\x8d\xe5\xae\xb9\xe5\xbf"
-"\xbd\xe8\xa6\x96\xe7\x9a\x84\x0a\xe8\xaa\xb2\xe9\xa1\x8c\x2e\x20"
-"\xe7\x82\xba\xe5\x8a\xa0\xe5\xbf\xab\xe9\x96\x8b\xe7\x99\xbc\xe5"
-"\x8f\x8a\xe6\xb8\xac\xe8\xa9\xa6\xe7\x9a\x84\xe9\x80\x9f\xe5\xba"
-"\xa6\x2c\x20\xe6\x88\x91\xe5\x80\x91\xe4\xbe\xbf\xe5\xb8\xb8\xe5"
-"\xb8\x8c\xe6\x9c\x9b\xe8\x83\xbd\xe5\x88\xa9\xe7\x94\xa8\xe4\xb8"
-"\x80\xe4\xba\x9b\xe5\xb7\xb2\xe9\x96\x8b\xe7\x99\xbc\xe5\xa5\xbd"
-"\xe7\x9a\x84\x0a\x6c\x69\x62\x72\x61\x72\x79\x2c\x20\xe4\xb8\xa6"
-"\xe6\x9c\x89\xe4\xb8\x80\xe5\x80\x8b\x20\x66\x61\x73\x74\x20\x70"
-"\x72\x6f\x74\x6f\x74\x79\x70\x69\x6e\x67\x20\xe7\x9a\x84\x20\x70"
-"\x72\x6f\x67\x72\x61\x6d\x6d\x69\x6e\x67\x20\x6c\x61\x6e\x67\x75"
-"\x61\x67\x65\x20\xe5\x8f\xaf\x0a\xe4\xbe\x9b\xe4\xbd\xbf\xe7\x94"
-"\xa8\x2e\x20\xe7\x9b\xae\xe5\x89\x8d\xe6\x9c\x89\xe8\xa8\xb1\xe8"
-"\xa8\xb1\xe5\xa4\x9a\xe5\xa4\x9a\xe7\x9a\x84\x20\x6c\x69\x62\x72"
-"\x61\x72\x79\x20\xe6\x98\xaf\xe4\xbb\xa5\x20\x43\x20\xe5\xaf\xab"
-"\xe6\x88\x90\x2c\x20\xe8\x80\x8c\x20\x50\x79\x74\x68\x6f\x6e\x20"
-"\xe6\x98\xaf\xe4\xb8\x80\xe5\x80\x8b\x0a\x66\x61\x73\x74\x20\x70"
-"\x72\x6f\x74\x6f\x74\x79\x70\x69\x6e\x67\x20\xe7\x9a\x84\x20\x70"
-"\x72\x6f\x67\x72\x61\x6d\x6d\x69\x6e\x67\x20\x6c\x61\x6e\x67\x75"
-"\x61\x67\x65\x2e\x20\xe6\x95\x85\xe6\x88\x91\xe5\x80\x91\xe5\xb8"
-"\x8c\xe6\x9c\x9b\xe8\x83\xbd\xe5\xb0\x87\xe6\x97\xa2\xe6\x9c\x89"
-"\xe7\x9a\x84\x0a\x43\x20\x6c\x69\x62\x72\x61\x72\x79\x20\xe6\x8b"
-"\xbf\xe5\x88\xb0\x20\x50\x79\x74\x68\x6f\x6e\x20\xe7\x9a\x84\xe7"
-"\x92\xb0\xe5\xa2\x83\xe4\xb8\xad\xe6\xb8\xac\xe8\xa9\xa6\xe5\x8f"
-"\x8a\xe6\x95\xb4\xe5\x90\x88\x2e\x20\xe5\x85\xb6\xe4\xb8\xad\xe6"
-"\x9c\x80\xe4\xb8\xbb\xe8\xa6\x81\xe4\xb9\x9f\xe6\x98\xaf\xe6\x88"
-"\x91\xe5\x80\x91\xe6\x89\x80\x0a\xe8\xa6\x81\xe8\xa8\x8e\xe8\xab"
-"\x96\xe7\x9a\x84\xe5\x95\x8f\xe9\xa1\x8c\xe5\xb0\xb1\xe6\x98\xaf"
-"\x3a\x0a\x0a"),
-'johab': (
-"\x99\xb1\xa4\x77\x88\x62\xd0\x61\x20\xcd\x5c\xaf\xa1\xc5\xa9\x9c"
-"\x61\x0a\x0a\xdc\xc0\xdc\xc0\x90\x73\x21\x21\x20\xf1\x67\xe2\x9c"
-"\xf0\x55\xcc\x81\xa3\x89\x9f\x85\x8a\xa1\x20\xdc\xde\xdc\xd3\xd2"
-"\x7a\xd9\xaf\xd9\xaf\xd9\xaf\x20\x8b\x77\x96\xd3\x20\xdc\xd1\x95"
-"\x81\x20\xdc\xc0\x2e\x20\x2e\x0a\xed\x3c\xb5\x77\xdc\xd1\x93\x77"
-"\xd2\x73\x20\x2e\x20\x2e\x20\x2e\x20\x2e\x20\xac\xe1\xb6\x89\x9e"
-"\xa1\x20\x95\x65\xd0\x62\xf0\xe0\x20\xe0\x3b\xd2\x7a\x20\x21\x20"
-"\x21\x20\x21\x87\x41\x2e\x87\x41\x0a\xd3\x61\xd3\x61\xd3\x61\x20"
-"\x88\x41\x88\x41\x88\x41\xd9\x69\x87\x41\x5f\x87\x41\x20\xb4\xe1"
-"\x9f\x9a\x20\xc8\xa1\xc5\xc1\x8b\x7a\x20\x95\x61\xb7\x77\x20\xc3"
-"\x97\xe2\x9c\x97\x69\xf0\xe0\x20\xdc\xc0\x97\x61\x8b\x7a\x0a\xac"
-"\xe9\x9f\x7a\x20\xe0\x3b\xd2\x7a\x20\x2e\x20\x2e\x20\x2e\x20\x2e"
-"\x20\x8a\x89\xb4\x81\xae\xba\x20\xdc\xd1\x8a\xa1\x20\xdc\xde\x9f"
-"\x89\xdc\xc2\x8b\x7a\x20\xf1\x67\xf1\x62\xf5\x49\xed\xfc\xf3\xe9"
-"\x8c\x61\xbb\x9a\x0a\xb5\xc1\xb2\xa1\xd2\x7a\x20\x21\x20\x21\x20"
-"\xed\x3c\xb5\x77\xdc\xd1\x20\xe0\x3b\x93\x77\x8a\xa1\x20\xd9\x69"
-"\xea\xbe\x89\xc5\x20\xb4\xf4\x93\x77\x8a\xa1\x93\x77\x20\xed\x3c"
-"\x93\x77\x96\xc1\xd2\x7a\x20\x8b\x69\xb4\x81\x97\x7a\x0a\xdc\xde"
-"\x9d\x61\x97\x41\xe2\x9c\x20\xaf\x81\xce\xa1\xae\xa1\xd2\x7a\x20"
-"\xb4\xe1\x9f\x9a\x20\xf1\x67\xf1\x62\xf5\x49\xed\xfc\xf3\xe9\xaf"
-"\x82\xdc\xef\x97\x69\xb4\x7a\x21\x21\x20\xdc\xc0\xdc\xc0\x90\x73"
-"\xd9\xbd\x20\xd9\x62\xd9\x62\x2a\x0a\x0a",
-"\xeb\x98\xa0\xeb\xb0\xa9\xea\xb0\x81\xed\x95\x98\x20\xed\x8e\xb2"
-"\xec\x8b\x9c\xec\xbd\x9c\xeb\x9d\xbc\x0a\x0a\xe3\x89\xaf\xe3\x89"
-"\xaf\xeb\x82\xa9\x21\x21\x20\xe5\x9b\xa0\xe4\xb9\x9d\xe6\x9c\x88"
-"\xed\x8c\xa8\xeb\xaf\xa4\xeb\xa6\x94\xea\xb6\x88\x20\xe2\x93\xa1"
-"\xe2\x93\x96\xed\x9b\x80\xc2\xbf\xc2\xbf\xc2\xbf\x20\xea\xb8\x8d"
-"\xeb\x92\x99\x20\xe2\x93\x94\xeb\x8e\xa8\x20\xe3\x89\xaf\x2e\x20"
-"\x2e\x0a\xe4\xba\x9e\xec\x98\x81\xe2\x93\x94\xeb\x8a\xa5\xed\x9a"
-"\xb9\x20\x2e\x20\x2e\x20\x2e\x20\x2e\x20\xec\x84\x9c\xec\x9a\xb8"
-"\xeb\xa4\x84\x20\xeb\x8e\x90\xed\x95\x99\xe4\xb9\x99\x20\xe5\xae"
-"\xb6\xed\x9b\x80\x20\x21\x20\x21\x20\x21\xe3\x85\xa0\x2e\xe3\x85"
-"\xa0\x0a\xed\x9d\x90\xed\x9d\x90\xed\x9d\x90\x20\xe3\x84\xb1\xe3"
-"\x84\xb1\xe3\x84\xb1\xe2\x98\x86\xe3\x85\xa0\x5f\xe3\x85\xa0\x20"
-"\xec\x96\xb4\xeb\xa6\xa8\x20\xed\x83\xb8\xec\xbd\xb0\xea\xb8\x90"
-"\x20\xeb\x8e\x8c\xec\x9d\x91\x20\xec\xb9\x91\xe4\xb9\x9d\xeb\x93"
-"\xa4\xe4\xb9\x99\x20\xe3\x89\xaf\xeb\x93\x9c\xea\xb8\x90\x0a\xec"
-"\x84\xa4\xeb\xa6\x8c\x20\xe5\xae\xb6\xed\x9b\x80\x20\x2e\x20\x2e"
-"\x20\x2e\x20\x2e\x20\xea\xb5\xb4\xec\x95\xa0\xec\x89\x8c\x20\xe2"
-"\x93\x94\xea\xb6\x88\x20\xe2\x93\xa1\xeb\xa6\x98\xe3\x89\xb1\xea"
-"\xb8\x90\x20\xe5\x9b\xa0\xe4\xbb\x81\xe5\xb7\x9d\xef\xa6\x81\xe4"
-"\xb8\xad\xea\xb9\x8c\xec\xa6\xbc\x0a\xec\x99\x80\xec\x92\x80\xed"
-"\x9b\x80\x20\x21\x20\x21\x20\xe4\xba\x9e\xec\x98\x81\xe2\x93\x94"
-"\x20\xe5\xae\xb6\xeb\x8a\xa5\xea\xb6\x88\x20\xe2\x98\x86\xe4\xb8"
-"\x8a\xea\xb4\x80\x20\xec\x97\x86\xeb\x8a\xa5\xea\xb6\x88\xeb\x8a"
-"\xa5\x20\xe4\xba\x9e\xeb\x8a\xa5\xeb\x92\x88\xed\x9b\x80\x20\xea"
-"\xb8\x80\xec\x95\xa0\xeb\x93\xb4\x0a\xe2\x93\xa1\xeb\xa0\xa4\xeb"
-"\x93\x80\xe4\xb9\x9d\x20\xec\x8b\x80\xed\x92\x94\xec\x88\xb4\xed"
-"\x9b\x80\x20\xec\x96\xb4\xeb\xa6\xa8\x20\xe5\x9b\xa0\xe4\xbb\x81"
-"\xe5\xb7\x9d\xef\xa6\x81\xe4\xb8\xad\xec\x8b\x81\xe2\x91\xa8\xeb"
-"\x93\xa4\xec\x95\x9c\x21\x21\x20\xe3\x89\xaf\xe3\x89\xaf\xeb\x82"
-"\xa9\xe2\x99\xa1\x20\xe2\x8c\x92\xe2\x8c\x92\x2a\x0a\x0a"),
-'shift_jis': (
-"\x50\x79\x74\x68\x6f\x6e\x20\x82\xcc\x8a\x4a\x94\xad\x82\xcd\x81"
-"\x41\x31\x39\x39\x30\x20\x94\x4e\x82\xb2\x82\xeb\x82\xa9\x82\xe7"
-"\x8a\x4a\x8e\x6e\x82\xb3\x82\xea\x82\xc4\x82\xa2\x82\xdc\x82\xb7"
-"\x81\x42\x0a\x8a\x4a\x94\xad\x8e\xd2\x82\xcc\x20\x47\x75\x69\x64"
-"\x6f\x20\x76\x61\x6e\x20\x52\x6f\x73\x73\x75\x6d\x20\x82\xcd\x8b"
-"\xb3\x88\xe7\x97\x70\x82\xcc\x83\x76\x83\x8d\x83\x4f\x83\x89\x83"
-"\x7e\x83\x93\x83\x4f\x8c\xbe\x8c\xea\x81\x75\x41\x42\x43\x81\x76"
-"\x82\xcc\x8a\x4a\x94\xad\x82\xc9\x8e\x51\x89\xc1\x82\xb5\x82\xc4"
-"\x82\xa2\x82\xdc\x82\xb5\x82\xbd\x82\xaa\x81\x41\x41\x42\x43\x20"
-"\x82\xcd\x8e\xc0\x97\x70\x8f\xe3\x82\xcc\x96\xda\x93\x49\x82\xc9"
-"\x82\xcd\x82\xa0\x82\xdc\x82\xe8\x93\x4b\x82\xb5\x82\xc4\x82\xa2"
-"\x82\xdc\x82\xb9\x82\xf1\x82\xc5\x82\xb5\x82\xbd\x81\x42\x0a\x82"
-"\xb1\x82\xcc\x82\xbd\x82\xdf\x81\x41\x47\x75\x69\x64\x6f\x20\x82"
-"\xcd\x82\xe6\x82\xe8\x8e\xc0\x97\x70\x93\x49\x82\xc8\x83\x76\x83"
-"\x8d\x83\x4f\x83\x89\x83\x7e\x83\x93\x83\x4f\x8c\xbe\x8c\xea\x82"
-"\xcc\x8a\x4a\x94\xad\x82\xf0\x8a\x4a\x8e\x6e\x82\xb5\x81\x41\x89"
-"\x70\x8d\x91\x20\x42\x42\x53\x20\x95\xfa\x91\x97\x82\xcc\x83\x52"
-"\x83\x81\x83\x66\x83\x42\x94\xd4\x91\x67\x81\x75\x83\x82\x83\x93"
-"\x83\x65\x83\x42\x20\x83\x70\x83\x43\x83\x5c\x83\x93\x81\x76\x82"
-"\xcc\x83\x74\x83\x40\x83\x93\x82\xc5\x82\xa0\x82\xe9\x20\x47\x75"
-"\x69\x64\x6f\x20\x82\xcd\x82\xb1\x82\xcc\x8c\xbe\x8c\xea\x82\xf0"
-"\x81\x75\x50\x79\x74\x68\x6f\x6e\x81\x76\x82\xc6\x96\xbc\x82\xc3"
-"\x82\xaf\x82\xdc\x82\xb5\x82\xbd\x81\x42\x0a\x82\xb1\x82\xcc\x82"
-"\xe6\x82\xa4\x82\xc8\x94\x77\x8c\x69\x82\xa9\x82\xe7\x90\xb6\x82"
-"\xdc\x82\xea\x82\xbd\x20\x50\x79\x74\x68\x6f\x6e\x20\x82\xcc\x8c"
-"\xbe\x8c\xea\x90\xdd\x8c\x76\x82\xcd\x81\x41\x81\x75\x83\x56\x83"
-"\x93\x83\x76\x83\x8b\x81\x76\x82\xc5\x81\x75\x8f\x4b\x93\xbe\x82"
-"\xaa\x97\x65\x88\xd5\x81\x76\x82\xc6\x82\xa2\x82\xa4\x96\xda\x95"
-"\x57\x82\xc9\x8f\x64\x93\x5f\x82\xaa\x92\x75\x82\xa9\x82\xea\x82"
-"\xc4\x82\xa2\x82\xdc\x82\xb7\x81\x42\x0a\x91\xbd\x82\xad\x82\xcc"
-"\x83\x58\x83\x4e\x83\x8a\x83\x76\x83\x67\x8c\x6e\x8c\xbe\x8c\xea"
-"\x82\xc5\x82\xcd\x83\x86\x81\x5b\x83\x55\x82\xcc\x96\xda\x90\xe6"
-"\x82\xcc\x97\x98\x95\xd6\x90\xab\x82\xf0\x97\x44\x90\xe6\x82\xb5"
-"\x82\xc4\x90\x46\x81\x58\x82\xc8\x8b\x40\x94\x5c\x82\xf0\x8c\xbe"
-"\x8c\xea\x97\x76\x91\x66\x82\xc6\x82\xb5\x82\xc4\x8e\xe6\x82\xe8"
-"\x93\xfc\x82\xea\x82\xe9\x8f\xea\x8d\x87\x82\xaa\x91\xbd\x82\xa2"
-"\x82\xcc\x82\xc5\x82\xb7\x82\xaa\x81\x41\x50\x79\x74\x68\x6f\x6e"
-"\x20\x82\xc5\x82\xcd\x82\xbb\x82\xa4\x82\xa2\x82\xc1\x82\xbd\x8f"
-"\xac\x8d\xd7\x8d\x48\x82\xaa\x92\xc7\x89\xc1\x82\xb3\x82\xea\x82"
-"\xe9\x82\xb1\x82\xc6\x82\xcd\x82\xa0\x82\xdc\x82\xe8\x82\xa0\x82"
-"\xe8\x82\xdc\x82\xb9\x82\xf1\x81\x42\x0a\x8c\xbe\x8c\xea\x8e\xa9"
-"\x91\xcc\x82\xcc\x8b\x40\x94\x5c\x82\xcd\x8d\xc5\x8f\xac\x8c\xc0"
-"\x82\xc9\x89\x9f\x82\xb3\x82\xa6\x81\x41\x95\x4b\x97\x76\x82\xc8"
-"\x8b\x40\x94\x5c\x82\xcd\x8a\x67\x92\xa3\x83\x82\x83\x57\x83\x85"
-"\x81\x5b\x83\x8b\x82\xc6\x82\xb5\x82\xc4\x92\xc7\x89\xc1\x82\xb7"
-"\x82\xe9\x81\x41\x82\xc6\x82\xa2\x82\xa4\x82\xcc\x82\xaa\x20\x50"
-"\x79\x74\x68\x6f\x6e\x20\x82\xcc\x83\x7c\x83\x8a\x83\x56\x81\x5b"
-"\x82\xc5\x82\xb7\x81\x42\x0a\x0a",
-"\x50\x79\x74\x68\x6f\x6e\x20\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba"
-"\xe3\x81\xaf\xe3\x80\x81\x31\x39\x39\x30\x20\xe5\xb9\xb4\xe3\x81"
-"\x94\xe3\x82\x8d\xe3\x81\x8b\xe3\x82\x89\xe9\x96\x8b\xe5\xa7\x8b"
-"\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3"
-"\x81\x99\xe3\x80\x82\x0a\xe9\x96\x8b\xe7\x99\xba\xe8\x80\x85\xe3"
-"\x81\xae\x20\x47\x75\x69\x64\x6f\x20\x76\x61\x6e\x20\x52\x6f\x73"
-"\x73\x75\x6d\x20\xe3\x81\xaf\xe6\x95\x99\xe8\x82\xb2\xe7\x94\xa8"
-"\xe3\x81\xae\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3"
-"\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x80"
-"\x8c\x41\x42\x43\xe3\x80\x8d\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba"
-"\xe3\x81\xab\xe5\x8f\x82\xe5\x8a\xa0\xe3\x81\x97\xe3\x81\xa6\xe3"
-"\x81\x84\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x81\x8c\xe3\x80"
-"\x81\x41\x42\x43\x20\xe3\x81\xaf\xe5\xae\x9f\xe7\x94\xa8\xe4\xb8"
-"\x8a\xe3\x81\xae\xe7\x9b\xae\xe7\x9a\x84\xe3\x81\xab\xe3\x81\xaf"
-"\xe3\x81\x82\xe3\x81\xbe\xe3\x82\x8a\xe9\x81\xa9\xe3\x81\x97\xe3"
-"\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x81"
-"\xa7\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\x0a\xe3\x81\x93\xe3\x81"
-"\xae\xe3\x81\x9f\xe3\x82\x81\xe3\x80\x81\x47\x75\x69\x64\x6f\x20"
-"\xe3\x81\xaf\xe3\x82\x88\xe3\x82\x8a\xe5\xae\x9f\xe7\x94\xa8\xe7"
-"\x9a\x84\xe3\x81\xaa\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83"
-"\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e"
-"\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x82\x92\xe9\x96\x8b\xe5"
-"\xa7\x8b\xe3\x81\x97\xe3\x80\x81\xe8\x8b\xb1\xe5\x9b\xbd\x20\x42"
-"\x42\x53\x20\xe6\x94\xbe\xe9\x80\x81\xe3\x81\xae\xe3\x82\xb3\xe3"
-"\x83\xa1\xe3\x83\x87\xe3\x82\xa3\xe7\x95\xaa\xe7\xb5\x84\xe3\x80"
-"\x8c\xe3\x83\xa2\xe3\x83\xb3\xe3\x83\x86\xe3\x82\xa3\x20\xe3\x83"
-"\x91\xe3\x82\xa4\xe3\x82\xbd\xe3\x83\xb3\xe3\x80\x8d\xe3\x81\xae"
-"\xe3\x83\x95\xe3\x82\xa1\xe3\x83\xb3\xe3\x81\xa7\xe3\x81\x82\xe3"
-"\x82\x8b\x20\x47\x75\x69\x64\x6f\x20\xe3\x81\xaf\xe3\x81\x93\xe3"
-"\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe3\x82\x92\xe3\x80\x8c\x50\x79"
-"\x74\x68\x6f\x6e\xe3\x80\x8d\xe3\x81\xa8\xe5\x90\x8d\xe3\x81\xa5"
-"\xe3\x81\x91\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\x0a"
-"\xe3\x81\x93\xe3\x81\xae\xe3\x82\x88\xe3\x81\x86\xe3\x81\xaa\xe8"
-"\x83\x8c\xe6\x99\xaf\xe3\x81\x8b\xe3\x82\x89\xe7\x94\x9f\xe3\x81"
-"\xbe\xe3\x82\x8c\xe3\x81\x9f\x20\x50\x79\x74\x68\x6f\x6e\x20\xe3"
-"\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa8\xad\xe8\xa8\x88\xe3\x81"
-"\xaf\xe3\x80\x81\xe3\x80\x8c\xe3\x82\xb7\xe3\x83\xb3\xe3\x83\x97"
-"\xe3\x83\xab\xe3\x80\x8d\xe3\x81\xa7\xe3\x80\x8c\xe7\xbf\x92\xe5"
-"\xbe\x97\xe3\x81\x8c\xe5\xae\xb9\xe6\x98\x93\xe3\x80\x8d\xe3\x81"
-"\xa8\xe3\x81\x84\xe3\x81\x86\xe7\x9b\xae\xe6\xa8\x99\xe3\x81\xab"
-"\xe9\x87\x8d\xe7\x82\xb9\xe3\x81\x8c\xe7\xbd\xae\xe3\x81\x8b\xe3"
-"\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80"
-"\x82\x0a\xe5\xa4\x9a\xe3\x81\x8f\xe3\x81\xae\xe3\x82\xb9\xe3\x82"
-"\xaf\xe3\x83\xaa\xe3\x83\x97\xe3\x83\x88\xe7\xb3\xbb\xe8\xa8\x80"
-"\xe8\xaa\x9e\xe3\x81\xa7\xe3\x81\xaf\xe3\x83\xa6\xe3\x83\xbc\xe3"
-"\x82\xb6\xe3\x81\xae\xe7\x9b\xae\xe5\x85\x88\xe3\x81\xae\xe5\x88"
-"\xa9\xe4\xbe\xbf\xe6\x80\xa7\xe3\x82\x92\xe5\x84\xaa\xe5\x85\x88"
-"\xe3\x81\x97\xe3\x81\xa6\xe8\x89\xb2\xe3\x80\x85\xe3\x81\xaa\xe6"
-"\xa9\x9f\xe8\x83\xbd\xe3\x82\x92\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa6"
-"\x81\xe7\xb4\xa0\xe3\x81\xa8\xe3\x81\x97\xe3\x81\xa6\xe5\x8f\x96"
-"\xe3\x82\x8a\xe5\x85\xa5\xe3\x82\x8c\xe3\x82\x8b\xe5\xa0\xb4\xe5"
-"\x90\x88\xe3\x81\x8c\xe5\xa4\x9a\xe3\x81\x84\xe3\x81\xae\xe3\x81"
-"\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81\x50\x79\x74\x68\x6f\x6e"
-"\x20\xe3\x81\xa7\xe3\x81\xaf\xe3\x81\x9d\xe3\x81\x86\xe3\x81\x84"
-"\xe3\x81\xa3\xe3\x81\x9f\xe5\xb0\x8f\xe7\xb4\xb0\xe5\xb7\xa5\xe3"
-"\x81\x8c\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x95\xe3\x82\x8c\xe3\x82"
-"\x8b\xe3\x81\x93\xe3\x81\xa8\xe3\x81\xaf\xe3\x81\x82\xe3\x81\xbe"
-"\xe3\x82\x8a\xe3\x81\x82\xe3\x82\x8a\xe3\x81\xbe\xe3\x81\x9b\xe3"
-"\x82\x93\xe3\x80\x82\x0a\xe8\xa8\x80\xe8\xaa\x9e\xe8\x87\xaa\xe4"
-"\xbd\x93\xe3\x81\xae\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x9c"
-"\x80\xe5\xb0\x8f\xe9\x99\x90\xe3\x81\xab\xe6\x8a\xbc\xe3\x81\x95"
-"\xe3\x81\x88\xe3\x80\x81\xe5\xbf\x85\xe8\xa6\x81\xe3\x81\xaa\xe6"
-"\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x8b\xa1\xe5\xbc\xb5\xe3\x83"
-"\xa2\xe3\x82\xb8\xe3\x83\xa5\xe3\x83\xbc\xe3\x83\xab\xe3\x81\xa8"
-"\xe3\x81\x97\xe3\x81\xa6\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x99\xe3"
-"\x82\x8b\xe3\x80\x81\xe3\x81\xa8\xe3\x81\x84\xe3\x81\x86\xe3\x81"
-"\xae\xe3\x81\x8c\x20\x50\x79\x74\x68\x6f\x6e\x20\xe3\x81\xae\xe3"
-"\x83\x9d\xe3\x83\xaa\xe3\x82\xb7\xe3\x83\xbc\xe3\x81\xa7\xe3\x81"
-"\x99\xe3\x80\x82\x0a\x0a"),
-'shift_jisx0213': (
-"\x50\x79\x74\x68\x6f\x6e\x20\x82\xcc\x8a\x4a\x94\xad\x82\xcd\x81"
-"\x41\x31\x39\x39\x30\x20\x94\x4e\x82\xb2\x82\xeb\x82\xa9\x82\xe7"
-"\x8a\x4a\x8e\x6e\x82\xb3\x82\xea\x82\xc4\x82\xa2\x82\xdc\x82\xb7"
-"\x81\x42\x0a\x8a\x4a\x94\xad\x8e\xd2\x82\xcc\x20\x47\x75\x69\x64"
-"\x6f\x20\x76\x61\x6e\x20\x52\x6f\x73\x73\x75\x6d\x20\x82\xcd\x8b"
-"\xb3\x88\xe7\x97\x70\x82\xcc\x83\x76\x83\x8d\x83\x4f\x83\x89\x83"
-"\x7e\x83\x93\x83\x4f\x8c\xbe\x8c\xea\x81\x75\x41\x42\x43\x81\x76"
-"\x82\xcc\x8a\x4a\x94\xad\x82\xc9\x8e\x51\x89\xc1\x82\xb5\x82\xc4"
-"\x82\xa2\x82\xdc\x82\xb5\x82\xbd\x82\xaa\x81\x41\x41\x42\x43\x20"
-"\x82\xcd\x8e\xc0\x97\x70\x8f\xe3\x82\xcc\x96\xda\x93\x49\x82\xc9"
-"\x82\xcd\x82\xa0\x82\xdc\x82\xe8\x93\x4b\x82\xb5\x82\xc4\x82\xa2"
-"\x82\xdc\x82\xb9\x82\xf1\x82\xc5\x82\xb5\x82\xbd\x81\x42\x0a\x82"
-"\xb1\x82\xcc\x82\xbd\x82\xdf\x81\x41\x47\x75\x69\x64\x6f\x20\x82"
-"\xcd\x82\xe6\x82\xe8\x8e\xc0\x97\x70\x93\x49\x82\xc8\x83\x76\x83"
-"\x8d\x83\x4f\x83\x89\x83\x7e\x83\x93\x83\x4f\x8c\xbe\x8c\xea\x82"
-"\xcc\x8a\x4a\x94\xad\x82\xf0\x8a\x4a\x8e\x6e\x82\xb5\x81\x41\x89"
-"\x70\x8d\x91\x20\x42\x42\x53\x20\x95\xfa\x91\x97\x82\xcc\x83\x52"
-"\x83\x81\x83\x66\x83\x42\x94\xd4\x91\x67\x81\x75\x83\x82\x83\x93"
-"\x83\x65\x83\x42\x20\x83\x70\x83\x43\x83\x5c\x83\x93\x81\x76\x82"
-"\xcc\x83\x74\x83\x40\x83\x93\x82\xc5\x82\xa0\x82\xe9\x20\x47\x75"
-"\x69\x64\x6f\x20\x82\xcd\x82\xb1\x82\xcc\x8c\xbe\x8c\xea\x82\xf0"
-"\x81\x75\x50\x79\x74\x68\x6f\x6e\x81\x76\x82\xc6\x96\xbc\x82\xc3"
-"\x82\xaf\x82\xdc\x82\xb5\x82\xbd\x81\x42\x0a\x82\xb1\x82\xcc\x82"
-"\xe6\x82\xa4\x82\xc8\x94\x77\x8c\x69\x82\xa9\x82\xe7\x90\xb6\x82"
-"\xdc\x82\xea\x82\xbd\x20\x50\x79\x74\x68\x6f\x6e\x20\x82\xcc\x8c"
-"\xbe\x8c\xea\x90\xdd\x8c\x76\x82\xcd\x81\x41\x81\x75\x83\x56\x83"
-"\x93\x83\x76\x83\x8b\x81\x76\x82\xc5\x81\x75\x8f\x4b\x93\xbe\x82"
-"\xaa\x97\x65\x88\xd5\x81\x76\x82\xc6\x82\xa2\x82\xa4\x96\xda\x95"
-"\x57\x82\xc9\x8f\x64\x93\x5f\x82\xaa\x92\x75\x82\xa9\x82\xea\x82"
-"\xc4\x82\xa2\x82\xdc\x82\xb7\x81\x42\x0a\x91\xbd\x82\xad\x82\xcc"
-"\x83\x58\x83\x4e\x83\x8a\x83\x76\x83\x67\x8c\x6e\x8c\xbe\x8c\xea"
-"\x82\xc5\x82\xcd\x83\x86\x81\x5b\x83\x55\x82\xcc\x96\xda\x90\xe6"
-"\x82\xcc\x97\x98\x95\xd6\x90\xab\x82\xf0\x97\x44\x90\xe6\x82\xb5"
-"\x82\xc4\x90\x46\x81\x58\x82\xc8\x8b\x40\x94\x5c\x82\xf0\x8c\xbe"
-"\x8c\xea\x97\x76\x91\x66\x82\xc6\x82\xb5\x82\xc4\x8e\xe6\x82\xe8"
-"\x93\xfc\x82\xea\x82\xe9\x8f\xea\x8d\x87\x82\xaa\x91\xbd\x82\xa2"
-"\x82\xcc\x82\xc5\x82\xb7\x82\xaa\x81\x41\x50\x79\x74\x68\x6f\x6e"
-"\x20\x82\xc5\x82\xcd\x82\xbb\x82\xa4\x82\xa2\x82\xc1\x82\xbd\x8f"
-"\xac\x8d\xd7\x8d\x48\x82\xaa\x92\xc7\x89\xc1\x82\xb3\x82\xea\x82"
-"\xe9\x82\xb1\x82\xc6\x82\xcd\x82\xa0\x82\xdc\x82\xe8\x82\xa0\x82"
-"\xe8\x82\xdc\x82\xb9\x82\xf1\x81\x42\x0a\x8c\xbe\x8c\xea\x8e\xa9"
-"\x91\xcc\x82\xcc\x8b\x40\x94\x5c\x82\xcd\x8d\xc5\x8f\xac\x8c\xc0"
-"\x82\xc9\x89\x9f\x82\xb3\x82\xa6\x81\x41\x95\x4b\x97\x76\x82\xc8"
-"\x8b\x40\x94\x5c\x82\xcd\x8a\x67\x92\xa3\x83\x82\x83\x57\x83\x85"
-"\x81\x5b\x83\x8b\x82\xc6\x82\xb5\x82\xc4\x92\xc7\x89\xc1\x82\xb7"
-"\x82\xe9\x81\x41\x82\xc6\x82\xa2\x82\xa4\x82\xcc\x82\xaa\x20\x50"
-"\x79\x74\x68\x6f\x6e\x20\x82\xcc\x83\x7c\x83\x8a\x83\x56\x81\x5b"
-"\x82\xc5\x82\xb7\x81\x42\x0a\x0a\x83\x6d\x82\xf5\x20\x83\x9e\x20"
-"\x83\x67\x83\x4c\x88\x4b\x88\x79\x20\x98\x83\xfc\xd6\x20\xfc\xd2"
-"\xfc\xe6\xfb\xd4\x0a",
-"\x50\x79\x74\x68\x6f\x6e\x20\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba"
-"\xe3\x81\xaf\xe3\x80\x81\x31\x39\x39\x30\x20\xe5\xb9\xb4\xe3\x81"
-"\x94\xe3\x82\x8d\xe3\x81\x8b\xe3\x82\x89\xe9\x96\x8b\xe5\xa7\x8b"
-"\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3"
-"\x81\x99\xe3\x80\x82\x0a\xe9\x96\x8b\xe7\x99\xba\xe8\x80\x85\xe3"
-"\x81\xae\x20\x47\x75\x69\x64\x6f\x20\x76\x61\x6e\x20\x52\x6f\x73"
-"\x73\x75\x6d\x20\xe3\x81\xaf\xe6\x95\x99\xe8\x82\xb2\xe7\x94\xa8"
-"\xe3\x81\xae\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3"
-"\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x80"
-"\x8c\x41\x42\x43\xe3\x80\x8d\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba"
-"\xe3\x81\xab\xe5\x8f\x82\xe5\x8a\xa0\xe3\x81\x97\xe3\x81\xa6\xe3"
-"\x81\x84\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x81\x8c\xe3\x80"
-"\x81\x41\x42\x43\x20\xe3\x81\xaf\xe5\xae\x9f\xe7\x94\xa8\xe4\xb8"
-"\x8a\xe3\x81\xae\xe7\x9b\xae\xe7\x9a\x84\xe3\x81\xab\xe3\x81\xaf"
-"\xe3\x81\x82\xe3\x81\xbe\xe3\x82\x8a\xe9\x81\xa9\xe3\x81\x97\xe3"
-"\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x81"
-"\xa7\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\x0a\xe3\x81\x93\xe3\x81"
-"\xae\xe3\x81\x9f\xe3\x82\x81\xe3\x80\x81\x47\x75\x69\x64\x6f\x20"
-"\xe3\x81\xaf\xe3\x82\x88\xe3\x82\x8a\xe5\xae\x9f\xe7\x94\xa8\xe7"
-"\x9a\x84\xe3\x81\xaa\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83"
-"\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e"
-"\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x82\x92\xe9\x96\x8b\xe5"
-"\xa7\x8b\xe3\x81\x97\xe3\x80\x81\xe8\x8b\xb1\xe5\x9b\xbd\x20\x42"
-"\x42\x53\x20\xe6\x94\xbe\xe9\x80\x81\xe3\x81\xae\xe3\x82\xb3\xe3"
-"\x83\xa1\xe3\x83\x87\xe3\x82\xa3\xe7\x95\xaa\xe7\xb5\x84\xe3\x80"
-"\x8c\xe3\x83\xa2\xe3\x83\xb3\xe3\x83\x86\xe3\x82\xa3\x20\xe3\x83"
-"\x91\xe3\x82\xa4\xe3\x82\xbd\xe3\x83\xb3\xe3\x80\x8d\xe3\x81\xae"
-"\xe3\x83\x95\xe3\x82\xa1\xe3\x83\xb3\xe3\x81\xa7\xe3\x81\x82\xe3"
-"\x82\x8b\x20\x47\x75\x69\x64\x6f\x20\xe3\x81\xaf\xe3\x81\x93\xe3"
-"\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe3\x82\x92\xe3\x80\x8c\x50\x79"
-"\x74\x68\x6f\x6e\xe3\x80\x8d\xe3\x81\xa8\xe5\x90\x8d\xe3\x81\xa5"
-"\xe3\x81\x91\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\x0a"
-"\xe3\x81\x93\xe3\x81\xae\xe3\x82\x88\xe3\x81\x86\xe3\x81\xaa\xe8"
-"\x83\x8c\xe6\x99\xaf\xe3\x81\x8b\xe3\x82\x89\xe7\x94\x9f\xe3\x81"
-"\xbe\xe3\x82\x8c\xe3\x81\x9f\x20\x50\x79\x74\x68\x6f\x6e\x20\xe3"
-"\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa8\xad\xe8\xa8\x88\xe3\x81"
-"\xaf\xe3\x80\x81\xe3\x80\x8c\xe3\x82\xb7\xe3\x83\xb3\xe3\x83\x97"
-"\xe3\x83\xab\xe3\x80\x8d\xe3\x81\xa7\xe3\x80\x8c\xe7\xbf\x92\xe5"
-"\xbe\x97\xe3\x81\x8c\xe5\xae\xb9\xe6\x98\x93\xe3\x80\x8d\xe3\x81"
-"\xa8\xe3\x81\x84\xe3\x81\x86\xe7\x9b\xae\xe6\xa8\x99\xe3\x81\xab"
-"\xe9\x87\x8d\xe7\x82\xb9\xe3\x81\x8c\xe7\xbd\xae\xe3\x81\x8b\xe3"
-"\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80"
-"\x82\x0a\xe5\xa4\x9a\xe3\x81\x8f\xe3\x81\xae\xe3\x82\xb9\xe3\x82"
-"\xaf\xe3\x83\xaa\xe3\x83\x97\xe3\x83\x88\xe7\xb3\xbb\xe8\xa8\x80"
-"\xe8\xaa\x9e\xe3\x81\xa7\xe3\x81\xaf\xe3\x83\xa6\xe3\x83\xbc\xe3"
-"\x82\xb6\xe3\x81\xae\xe7\x9b\xae\xe5\x85\x88\xe3\x81\xae\xe5\x88"
-"\xa9\xe4\xbe\xbf\xe6\x80\xa7\xe3\x82\x92\xe5\x84\xaa\xe5\x85\x88"
-"\xe3\x81\x97\xe3\x81\xa6\xe8\x89\xb2\xe3\x80\x85\xe3\x81\xaa\xe6"
-"\xa9\x9f\xe8\x83\xbd\xe3\x82\x92\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa6"
-"\x81\xe7\xb4\xa0\xe3\x81\xa8\xe3\x81\x97\xe3\x81\xa6\xe5\x8f\x96"
-"\xe3\x82\x8a\xe5\x85\xa5\xe3\x82\x8c\xe3\x82\x8b\xe5\xa0\xb4\xe5"
-"\x90\x88\xe3\x81\x8c\xe5\xa4\x9a\xe3\x81\x84\xe3\x81\xae\xe3\x81"
-"\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81\x50\x79\x74\x68\x6f\x6e"
-"\x20\xe3\x81\xa7\xe3\x81\xaf\xe3\x81\x9d\xe3\x81\x86\xe3\x81\x84"
-"\xe3\x81\xa3\xe3\x81\x9f\xe5\xb0\x8f\xe7\xb4\xb0\xe5\xb7\xa5\xe3"
-"\x81\x8c\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x95\xe3\x82\x8c\xe3\x82"
-"\x8b\xe3\x81\x93\xe3\x81\xa8\xe3\x81\xaf\xe3\x81\x82\xe3\x81\xbe"
-"\xe3\x82\x8a\xe3\x81\x82\xe3\x82\x8a\xe3\x81\xbe\xe3\x81\x9b\xe3"
-"\x82\x93\xe3\x80\x82\x0a\xe8\xa8\x80\xe8\xaa\x9e\xe8\x87\xaa\xe4"
-"\xbd\x93\xe3\x81\xae\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x9c"
-"\x80\xe5\xb0\x8f\xe9\x99\x90\xe3\x81\xab\xe6\x8a\xbc\xe3\x81\x95"
-"\xe3\x81\x88\xe3\x80\x81\xe5\xbf\x85\xe8\xa6\x81\xe3\x81\xaa\xe6"
-"\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x8b\xa1\xe5\xbc\xb5\xe3\x83"
-"\xa2\xe3\x82\xb8\xe3\x83\xa5\xe3\x83\xbc\xe3\x83\xab\xe3\x81\xa8"
-"\xe3\x81\x97\xe3\x81\xa6\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x99\xe3"
-"\x82\x8b\xe3\x80\x81\xe3\x81\xa8\xe3\x81\x84\xe3\x81\x86\xe3\x81"
-"\xae\xe3\x81\x8c\x20\x50\x79\x74\x68\x6f\x6e\x20\xe3\x81\xae\xe3"
-"\x83\x9d\xe3\x83\xaa\xe3\x82\xb7\xe3\x83\xbc\xe3\x81\xa7\xe3\x81"
-"\x99\xe3\x80\x82\x0a\x0a\xe3\x83\x8e\xe3\x81\x8b\xe3\x82\x9a\x20"
-"\xe3\x83\x88\xe3\x82\x9a\x20\xe3\x83\x88\xe3\x82\xad\xef\xa8\xb6"
-"\xef\xa8\xb9\x20\xf0\xa1\x9a\xb4\xf0\xaa\x8e\x8c\x20\xe9\xba\x80"
-"\xe9\xbd\x81\xf0\xa9\x9b\xb0\x0a"),
-}
diff --git a/Lib/test/crashers/README b/Lib/test/crashers/README
index 070c3f122a..2a73e1bbd9 100644
--- a/Lib/test/crashers/README
+++ b/Lib/test/crashers/README
@@ -1,20 +1,16 @@
-This directory only contains tests for outstanding bugs that cause
-the interpreter to segfault. Ideally this directory should always
-be empty. Sometimes it may not be easy to fix the underlying cause.
+This directory only contains tests for outstanding bugs that cause the
+interpreter to segfault. Ideally this directory should always be empty, but
+sometimes it may not be easy to fix the underlying cause and the bug is deemed
+too obscure to invest the effort.
Each test should fail when run from the command line:
./python Lib/test/crashers/weakref_in_del.py
-Each test should have a link to the bug report:
+Put as much info into a docstring or comments to help determine the cause of the
+failure, as well as a bugs.python.org issue number if it exists. Particularly
+note if the cause is system or environment dependent and what the variables are.
- # http://python.org/sf/BUG#
-
-Put as much info into a docstring or comments to help determine
-the cause of the failure. Particularly note if the cause is
-system or environment dependent and what the variables are.
-
-Once the crash is fixed, the test case should be moved into an appropriate
-test (even if it was originally from the test suite). This ensures the
-regression doesn't happen again. And if it does, it should be easier
-to track down.
+Once the crash is fixed, the test case should be moved into an appropriate test
+(even if it was originally from the test suite). This ensures the regression
+doesn't happen again. And if it does, it should be easier to track down.
diff --git a/Lib/test/crashers/bogus_sre_bytecode.py b/Lib/test/crashers/bogus_sre_bytecode.py
deleted file mode 100644
index 4bfc7300d5..0000000000
--- a/Lib/test/crashers/bogus_sre_bytecode.py
+++ /dev/null
@@ -1,47 +0,0 @@
-"""
-The regular expression engine in '_sre' can segfault when interpreting
-bogus bytecode.
-
-It is unclear whether this is a real bug or a "won't fix" case like
-bogus_code_obj.py, because it requires bytecode that is built by hand,
-as opposed to compiled by 're' from a string-source regexp. The
-difference with bogus_code_obj, though, is that the only existing regexp
-compiler is written in Python, so that the C code has no choice but
-accept arbitrary bytecode from Python-level.
-
-The test below builds and runs random bytecodes until 'match' crashes
-Python. I have not investigated why exactly segfaults occur nor how
-hard they would be to fix. Here are a few examples of 'code' that
-segfault for me:
-
- [21, 50814, 8, 29, 16]
- [21, 3967, 26, 10, 23, 54113]
- [29, 23, 0, 2, 5]
- [31, 64351, 0, 28, 3, 22281, 20, 4463, 9, 25, 59154, 15245, 2,
- 16343, 3, 11600, 24380, 10, 37556, 10, 31, 15, 31]
-
-Here is also a 'code' that triggers an infinite uninterruptible loop:
-
- [29, 1, 8, 21, 1, 43083, 6]
-
-"""
-
-import _sre, random
-
-def pick():
- n = random.randrange(-65536, 65536)
- if n < 0:
- n &= 31
- return n
-
-ss = ["", "world", "x" * 500]
-
-while 1:
- code = [pick() for i in range(random.randrange(5, 25))]
- print code
- pat = _sre.compile(None, 0, code)
- for s in ss:
- try:
- pat.match(s)
- except RuntimeError:
- pass
diff --git a/Lib/test/crashers/compiler_recursion.py b/Lib/test/crashers/compiler_recursion.py
new file mode 100644
index 0000000000..4954bdd8f0
--- /dev/null
+++ b/Lib/test/crashers/compiler_recursion.py
@@ -0,0 +1,5 @@
+"""
+The compiler (>= 2.5) recurses happily.
+"""
+
+compile('()'*9**5, '?', 'exec')
diff --git a/Lib/test/crashers/gc_has_finalizer.py b/Lib/test/crashers/gc_has_finalizer.py
new file mode 100644
index 0000000000..737959bb9b
--- /dev/null
+++ b/Lib/test/crashers/gc_has_finalizer.py
@@ -0,0 +1,36 @@
+"""
+The gc module can still invoke arbitrary Python code and crash.
+This is an attack against _PyInstance_Lookup(), which is documented
+as follows:
+
+ The point of this routine is that it never calls arbitrary Python
+ code, so is always "safe": all it does is dict lookups.
+
+But of course dict lookups can call arbitrary Python code.
+The following code causes mutation of the object graph during
+the call to has_finalizer() in gcmodule.c, and that might
+segfault.
+"""
+
+import gc
+
+
+class A:
+ def __hash__(self):
+ return hash("__del__")
+ def __eq__(self, other):
+ del self.other
+ return False
+
+a = A()
+b = A()
+
+a.__dict__[b] = 'A'
+
+a.other = b
+b.other = a
+
+gc.collect()
+del a, b
+
+gc.collect()
diff --git a/Lib/test/crashers/iter.py b/Lib/test/crashers/iter.py
deleted file mode 100644
index 081dcbc269..0000000000
--- a/Lib/test/crashers/iter.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# Calls to PyIter_Next, or direct calls to tp_iternext, on an object
-# which might no longer be an iterable because its 'next' method was
-# removed. These are all variants of Issue3720.
-
-"""
-Run this script with an argument between 1 and <N> to test for
-different crashes.
-"""
-N = 8
-
-import sys
-
-class Foo(object):
- def __iter__(self):
- return self
- def next(self):
- del Foo.next
- return (1, 2)
-
-def case1():
- list(enumerate(Foo()))
-
-def case2():
- x, y = Foo()
-
-def case3():
- filter(None, Foo())
-
-def case4():
- map(None, Foo(), Foo())
-
-def case5():
- max(Foo())
-
-def case6():
- sum(Foo(), ())
-
-def case7():
- dict(Foo())
-
-def case8():
- sys.stdout.writelines(Foo())
-
-# etc...
-
-
-if __name__ == '__main__':
- if len(sys.argv) < 2:
- print __doc__.replace('<N>', str(N))
- else:
- n = int(sys.argv[1])
- func = globals()['case%d' % n]
- func()
diff --git a/Lib/test/crashers/recursion_limit_too_high.py b/Lib/test/crashers/recursion_limit_too_high.py
index 1fa4d32543..ec64936a5d 100644
--- a/Lib/test/crashers/recursion_limit_too_high.py
+++ b/Lib/test/crashers/recursion_limit_too_high.py
@@ -5,7 +5,7 @@
# file handles.
# The point of this example is to show that sys.setrecursionlimit() is a
-# hack, and not a robust solution. This example simply exercices a path
+# hack, and not a robust solution. This example simply exercises a path
# where it takes many C-level recursions, consuming a lot of stack
# space, for each Python-level recursion. So 1000 times this amount of
# stack space may be too much for standard platforms already.
diff --git a/Lib/test/data/README b/Lib/test/data/README
new file mode 100644
index 0000000000..8bf8c9b31e
--- /dev/null
+++ b/Lib/test/data/README
@@ -0,0 +1,2 @@
+This empty directory serves as destination for temporary files
+created by some tests.
diff --git a/Lib/test/decimaltestdata/and.decTest b/Lib/test/decimaltestdata/and.decTest
index e912394877..a0cc786516 100644
--- a/Lib/test/decimaltestdata/and.decTest
+++ b/Lib/test/decimaltestdata/and.decTest
@@ -1,338 +1,338 @@
-------------------------------------------------------------------------
--- and.decTest -- digitwise logical AND --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check (truth table)
-andx001 and 0 0 -> 0
-andx002 and 0 1 -> 0
-andx003 and 1 0 -> 0
-andx004 and 1 1 -> 1
-andx005 and 1100 1010 -> 1000
-andx006 and 1111 10 -> 10
-andx007 and 1111 1010 -> 1010
-
--- and at msd and msd-1
-andx010 and 000000000 000000000 -> 0
-andx011 and 000000000 100000000 -> 0
-andx012 and 100000000 000000000 -> 0
-andx013 and 100000000 100000000 -> 100000000
-andx014 and 000000000 000000000 -> 0
-andx015 and 000000000 010000000 -> 0
-andx016 and 010000000 000000000 -> 0
-andx017 and 010000000 010000000 -> 10000000
-
--- Various lengths
--- 123456789 123456789 123456789
-andx021 and 111111111 111111111 -> 111111111
-andx022 and 111111111111 111111111 -> 111111111
-andx023 and 111111111111 11111111 -> 11111111
-andx024 and 111111111 11111111 -> 11111111
-andx025 and 111111111 1111111 -> 1111111
-andx026 and 111111111111 111111 -> 111111
-andx027 and 111111111111 11111 -> 11111
-andx028 and 111111111111 1111 -> 1111
-andx029 and 111111111111 111 -> 111
-andx031 and 111111111111 11 -> 11
-andx032 and 111111111111 1 -> 1
-andx033 and 111111111111 1111111111 -> 111111111
-andx034 and 11111111111 11111111111 -> 111111111
-andx035 and 1111111111 111111111111 -> 111111111
-andx036 and 111111111 1111111111111 -> 111111111
-
-andx040 and 111111111 111111111111 -> 111111111
-andx041 and 11111111 111111111111 -> 11111111
-andx042 and 11111111 111111111 -> 11111111
-andx043 and 1111111 111111111 -> 1111111
-andx044 and 111111 111111111 -> 111111
-andx045 and 11111 111111111 -> 11111
-andx046 and 1111 111111111 -> 1111
-andx047 and 111 111111111 -> 111
-andx048 and 11 111111111 -> 11
-andx049 and 1 111111111 -> 1
-
-andx050 and 1111111111 1 -> 1
-andx051 and 111111111 1 -> 1
-andx052 and 11111111 1 -> 1
-andx053 and 1111111 1 -> 1
-andx054 and 111111 1 -> 1
-andx055 and 11111 1 -> 1
-andx056 and 1111 1 -> 1
-andx057 and 111 1 -> 1
-andx058 and 11 1 -> 1
-andx059 and 1 1 -> 1
-
-andx060 and 1111111111 0 -> 0
-andx061 and 111111111 0 -> 0
-andx062 and 11111111 0 -> 0
-andx063 and 1111111 0 -> 0
-andx064 and 111111 0 -> 0
-andx065 and 11111 0 -> 0
-andx066 and 1111 0 -> 0
-andx067 and 111 0 -> 0
-andx068 and 11 0 -> 0
-andx069 and 1 0 -> 0
-
-andx070 and 1 1111111111 -> 1
-andx071 and 1 111111111 -> 1
-andx072 and 1 11111111 -> 1
-andx073 and 1 1111111 -> 1
-andx074 and 1 111111 -> 1
-andx075 and 1 11111 -> 1
-andx076 and 1 1111 -> 1
-andx077 and 1 111 -> 1
-andx078 and 1 11 -> 1
-andx079 and 1 1 -> 1
-
-andx080 and 0 1111111111 -> 0
-andx081 and 0 111111111 -> 0
-andx082 and 0 11111111 -> 0
-andx083 and 0 1111111 -> 0
-andx084 and 0 111111 -> 0
-andx085 and 0 11111 -> 0
-andx086 and 0 1111 -> 0
-andx087 and 0 111 -> 0
-andx088 and 0 11 -> 0
-andx089 and 0 1 -> 0
-
-andx090 and 011111111 111111111 -> 11111111
-andx091 and 101111111 111111111 -> 101111111
-andx092 and 110111111 111111111 -> 110111111
-andx093 and 111011111 111111111 -> 111011111
-andx094 and 111101111 111111111 -> 111101111
-andx095 and 111110111 111111111 -> 111110111
-andx096 and 111111011 111111111 -> 111111011
-andx097 and 111111101 111111111 -> 111111101
-andx098 and 111111110 111111111 -> 111111110
-
-andx100 and 111111111 011111111 -> 11111111
-andx101 and 111111111 101111111 -> 101111111
-andx102 and 111111111 110111111 -> 110111111
-andx103 and 111111111 111011111 -> 111011111
-andx104 and 111111111 111101111 -> 111101111
-andx105 and 111111111 111110111 -> 111110111
-andx106 and 111111111 111111011 -> 111111011
-andx107 and 111111111 111111101 -> 111111101
-andx108 and 111111111 111111110 -> 111111110
-
--- non-0/1 should not be accepted, nor should signs
-andx220 and 111111112 111111111 -> NaN Invalid_operation
-andx221 and 333333333 333333333 -> NaN Invalid_operation
-andx222 and 555555555 555555555 -> NaN Invalid_operation
-andx223 and 777777777 777777777 -> NaN Invalid_operation
-andx224 and 999999999 999999999 -> NaN Invalid_operation
-andx225 and 222222222 999999999 -> NaN Invalid_operation
-andx226 and 444444444 999999999 -> NaN Invalid_operation
-andx227 and 666666666 999999999 -> NaN Invalid_operation
-andx228 and 888888888 999999999 -> NaN Invalid_operation
-andx229 and 999999999 222222222 -> NaN Invalid_operation
-andx230 and 999999999 444444444 -> NaN Invalid_operation
-andx231 and 999999999 666666666 -> NaN Invalid_operation
-andx232 and 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-andx240 and 567468689 -934981942 -> NaN Invalid_operation
-andx241 and 567367689 934981942 -> NaN Invalid_operation
-andx242 and -631917772 -706014634 -> NaN Invalid_operation
-andx243 and -756253257 138579234 -> NaN Invalid_operation
-andx244 and 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-andx250 and 200000000 100000000 -> NaN Invalid_operation
-andx251 and 700000000 100000000 -> NaN Invalid_operation
-andx252 and 800000000 100000000 -> NaN Invalid_operation
-andx253 and 900000000 100000000 -> NaN Invalid_operation
-andx254 and 200000000 000000000 -> NaN Invalid_operation
-andx255 and 700000000 000000000 -> NaN Invalid_operation
-andx256 and 800000000 000000000 -> NaN Invalid_operation
-andx257 and 900000000 000000000 -> NaN Invalid_operation
-andx258 and 100000000 200000000 -> NaN Invalid_operation
-andx259 and 100000000 700000000 -> NaN Invalid_operation
-andx260 and 100000000 800000000 -> NaN Invalid_operation
-andx261 and 100000000 900000000 -> NaN Invalid_operation
-andx262 and 000000000 200000000 -> NaN Invalid_operation
-andx263 and 000000000 700000000 -> NaN Invalid_operation
-andx264 and 000000000 800000000 -> NaN Invalid_operation
-andx265 and 000000000 900000000 -> NaN Invalid_operation
--- test MSD-1
-andx270 and 020000000 100000000 -> NaN Invalid_operation
-andx271 and 070100000 100000000 -> NaN Invalid_operation
-andx272 and 080010000 100000001 -> NaN Invalid_operation
-andx273 and 090001000 100000010 -> NaN Invalid_operation
-andx274 and 100000100 020010100 -> NaN Invalid_operation
-andx275 and 100000000 070001000 -> NaN Invalid_operation
-andx276 and 100000010 080010100 -> NaN Invalid_operation
-andx277 and 100000000 090000010 -> NaN Invalid_operation
--- test LSD
-andx280 and 001000002 100000000 -> NaN Invalid_operation
-andx281 and 000000007 100000000 -> NaN Invalid_operation
-andx282 and 000000008 100000000 -> NaN Invalid_operation
-andx283 and 000000009 100000000 -> NaN Invalid_operation
-andx284 and 100000000 000100002 -> NaN Invalid_operation
-andx285 and 100100000 001000007 -> NaN Invalid_operation
-andx286 and 100010000 010000008 -> NaN Invalid_operation
-andx287 and 100001000 100000009 -> NaN Invalid_operation
--- test Middie
-andx288 and 001020000 100000000 -> NaN Invalid_operation
-andx289 and 000070001 100000000 -> NaN Invalid_operation
-andx290 and 000080000 100010000 -> NaN Invalid_operation
-andx291 and 000090000 100001000 -> NaN Invalid_operation
-andx292 and 100000010 000020100 -> NaN Invalid_operation
-andx293 and 100100000 000070010 -> NaN Invalid_operation
-andx294 and 100010100 000080001 -> NaN Invalid_operation
-andx295 and 100001000 000090000 -> NaN Invalid_operation
--- signs
-andx296 and -100001000 -000000000 -> NaN Invalid_operation
-andx297 and -100001000 000010000 -> NaN Invalid_operation
-andx298 and 100001000 -000000000 -> NaN Invalid_operation
-andx299 and 100001000 000011000 -> 1000
-
--- Nmax, Nmin, Ntiny
-andx331 and 2 9.99999999E+999 -> NaN Invalid_operation
-andx332 and 3 1E-999 -> NaN Invalid_operation
-andx333 and 4 1.00000000E-999 -> NaN Invalid_operation
-andx334 and 5 1E-1007 -> NaN Invalid_operation
-andx335 and 6 -1E-1007 -> NaN Invalid_operation
-andx336 and 7 -1.00000000E-999 -> NaN Invalid_operation
-andx337 and 8 -1E-999 -> NaN Invalid_operation
-andx338 and 9 -9.99999999E+999 -> NaN Invalid_operation
-andx341 and 9.99999999E+999 -18 -> NaN Invalid_operation
-andx342 and 1E-999 01 -> NaN Invalid_operation
-andx343 and 1.00000000E-999 -18 -> NaN Invalid_operation
-andx344 and 1E-1007 18 -> NaN Invalid_operation
-andx345 and -1E-1007 -10 -> NaN Invalid_operation
-andx346 and -1.00000000E-999 18 -> NaN Invalid_operation
-andx347 and -1E-999 10 -> NaN Invalid_operation
-andx348 and -9.99999999E+999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-andx361 and 1.0 1 -> NaN Invalid_operation
-andx362 and 1E+1 1 -> NaN Invalid_operation
-andx363 and 0.0 1 -> NaN Invalid_operation
-andx364 and 0E+1 1 -> NaN Invalid_operation
-andx365 and 9.9 1 -> NaN Invalid_operation
-andx366 and 9E+1 1 -> NaN Invalid_operation
-andx371 and 0 1.0 -> NaN Invalid_operation
-andx372 and 0 1E+1 -> NaN Invalid_operation
-andx373 and 0 0.0 -> NaN Invalid_operation
-andx374 and 0 0E+1 -> NaN Invalid_operation
-andx375 and 0 9.9 -> NaN Invalid_operation
-andx376 and 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-andx780 and -Inf -Inf -> NaN Invalid_operation
-andx781 and -Inf -1000 -> NaN Invalid_operation
-andx782 and -Inf -1 -> NaN Invalid_operation
-andx783 and -Inf -0 -> NaN Invalid_operation
-andx784 and -Inf 0 -> NaN Invalid_operation
-andx785 and -Inf 1 -> NaN Invalid_operation
-andx786 and -Inf 1000 -> NaN Invalid_operation
-andx787 and -1000 -Inf -> NaN Invalid_operation
-andx788 and -Inf -Inf -> NaN Invalid_operation
-andx789 and -1 -Inf -> NaN Invalid_operation
-andx790 and -0 -Inf -> NaN Invalid_operation
-andx791 and 0 -Inf -> NaN Invalid_operation
-andx792 and 1 -Inf -> NaN Invalid_operation
-andx793 and 1000 -Inf -> NaN Invalid_operation
-andx794 and Inf -Inf -> NaN Invalid_operation
-
-andx800 and Inf -Inf -> NaN Invalid_operation
-andx801 and Inf -1000 -> NaN Invalid_operation
-andx802 and Inf -1 -> NaN Invalid_operation
-andx803 and Inf -0 -> NaN Invalid_operation
-andx804 and Inf 0 -> NaN Invalid_operation
-andx805 and Inf 1 -> NaN Invalid_operation
-andx806 and Inf 1000 -> NaN Invalid_operation
-andx807 and Inf Inf -> NaN Invalid_operation
-andx808 and -1000 Inf -> NaN Invalid_operation
-andx809 and -Inf Inf -> NaN Invalid_operation
-andx810 and -1 Inf -> NaN Invalid_operation
-andx811 and -0 Inf -> NaN Invalid_operation
-andx812 and 0 Inf -> NaN Invalid_operation
-andx813 and 1 Inf -> NaN Invalid_operation
-andx814 and 1000 Inf -> NaN Invalid_operation
-andx815 and Inf Inf -> NaN Invalid_operation
-
-andx821 and NaN -Inf -> NaN Invalid_operation
-andx822 and NaN -1000 -> NaN Invalid_operation
-andx823 and NaN -1 -> NaN Invalid_operation
-andx824 and NaN -0 -> NaN Invalid_operation
-andx825 and NaN 0 -> NaN Invalid_operation
-andx826 and NaN 1 -> NaN Invalid_operation
-andx827 and NaN 1000 -> NaN Invalid_operation
-andx828 and NaN Inf -> NaN Invalid_operation
-andx829 and NaN NaN -> NaN Invalid_operation
-andx830 and -Inf NaN -> NaN Invalid_operation
-andx831 and -1000 NaN -> NaN Invalid_operation
-andx832 and -1 NaN -> NaN Invalid_operation
-andx833 and -0 NaN -> NaN Invalid_operation
-andx834 and 0 NaN -> NaN Invalid_operation
-andx835 and 1 NaN -> NaN Invalid_operation
-andx836 and 1000 NaN -> NaN Invalid_operation
-andx837 and Inf NaN -> NaN Invalid_operation
-
-andx841 and sNaN -Inf -> NaN Invalid_operation
-andx842 and sNaN -1000 -> NaN Invalid_operation
-andx843 and sNaN -1 -> NaN Invalid_operation
-andx844 and sNaN -0 -> NaN Invalid_operation
-andx845 and sNaN 0 -> NaN Invalid_operation
-andx846 and sNaN 1 -> NaN Invalid_operation
-andx847 and sNaN 1000 -> NaN Invalid_operation
-andx848 and sNaN NaN -> NaN Invalid_operation
-andx849 and sNaN sNaN -> NaN Invalid_operation
-andx850 and NaN sNaN -> NaN Invalid_operation
-andx851 and -Inf sNaN -> NaN Invalid_operation
-andx852 and -1000 sNaN -> NaN Invalid_operation
-andx853 and -1 sNaN -> NaN Invalid_operation
-andx854 and -0 sNaN -> NaN Invalid_operation
-andx855 and 0 sNaN -> NaN Invalid_operation
-andx856 and 1 sNaN -> NaN Invalid_operation
-andx857 and 1000 sNaN -> NaN Invalid_operation
-andx858 and Inf sNaN -> NaN Invalid_operation
-andx859 and NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-andx861 and NaN1 -Inf -> NaN Invalid_operation
-andx862 and +NaN2 -1000 -> NaN Invalid_operation
-andx863 and NaN3 1000 -> NaN Invalid_operation
-andx864 and NaN4 Inf -> NaN Invalid_operation
-andx865 and NaN5 +NaN6 -> NaN Invalid_operation
-andx866 and -Inf NaN7 -> NaN Invalid_operation
-andx867 and -1000 NaN8 -> NaN Invalid_operation
-andx868 and 1000 NaN9 -> NaN Invalid_operation
-andx869 and Inf +NaN10 -> NaN Invalid_operation
-andx871 and sNaN11 -Inf -> NaN Invalid_operation
-andx872 and sNaN12 -1000 -> NaN Invalid_operation
-andx873 and sNaN13 1000 -> NaN Invalid_operation
-andx874 and sNaN14 NaN17 -> NaN Invalid_operation
-andx875 and sNaN15 sNaN18 -> NaN Invalid_operation
-andx876 and NaN16 sNaN19 -> NaN Invalid_operation
-andx877 and -Inf +sNaN20 -> NaN Invalid_operation
-andx878 and -1000 sNaN21 -> NaN Invalid_operation
-andx879 and 1000 sNaN22 -> NaN Invalid_operation
-andx880 and Inf sNaN23 -> NaN Invalid_operation
-andx881 and +NaN25 +sNaN24 -> NaN Invalid_operation
-andx882 and -NaN26 NaN28 -> NaN Invalid_operation
-andx883 and -sNaN27 sNaN29 -> NaN Invalid_operation
-andx884 and 1000 -NaN30 -> NaN Invalid_operation
-andx885 and 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- and.decTest -- digitwise logical AND --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check (truth table)
+andx001 and 0 0 -> 0
+andx002 and 0 1 -> 0
+andx003 and 1 0 -> 0
+andx004 and 1 1 -> 1
+andx005 and 1100 1010 -> 1000
+andx006 and 1111 10 -> 10
+andx007 and 1111 1010 -> 1010
+
+-- and at msd and msd-1
+andx010 and 000000000 000000000 -> 0
+andx011 and 000000000 100000000 -> 0
+andx012 and 100000000 000000000 -> 0
+andx013 and 100000000 100000000 -> 100000000
+andx014 and 000000000 000000000 -> 0
+andx015 and 000000000 010000000 -> 0
+andx016 and 010000000 000000000 -> 0
+andx017 and 010000000 010000000 -> 10000000
+
+-- Various lengths
+-- 123456789 123456789 123456789
+andx021 and 111111111 111111111 -> 111111111
+andx022 and 111111111111 111111111 -> 111111111
+andx023 and 111111111111 11111111 -> 11111111
+andx024 and 111111111 11111111 -> 11111111
+andx025 and 111111111 1111111 -> 1111111
+andx026 and 111111111111 111111 -> 111111
+andx027 and 111111111111 11111 -> 11111
+andx028 and 111111111111 1111 -> 1111
+andx029 and 111111111111 111 -> 111
+andx031 and 111111111111 11 -> 11
+andx032 and 111111111111 1 -> 1
+andx033 and 111111111111 1111111111 -> 111111111
+andx034 and 11111111111 11111111111 -> 111111111
+andx035 and 1111111111 111111111111 -> 111111111
+andx036 and 111111111 1111111111111 -> 111111111
+
+andx040 and 111111111 111111111111 -> 111111111
+andx041 and 11111111 111111111111 -> 11111111
+andx042 and 11111111 111111111 -> 11111111
+andx043 and 1111111 111111111 -> 1111111
+andx044 and 111111 111111111 -> 111111
+andx045 and 11111 111111111 -> 11111
+andx046 and 1111 111111111 -> 1111
+andx047 and 111 111111111 -> 111
+andx048 and 11 111111111 -> 11
+andx049 and 1 111111111 -> 1
+
+andx050 and 1111111111 1 -> 1
+andx051 and 111111111 1 -> 1
+andx052 and 11111111 1 -> 1
+andx053 and 1111111 1 -> 1
+andx054 and 111111 1 -> 1
+andx055 and 11111 1 -> 1
+andx056 and 1111 1 -> 1
+andx057 and 111 1 -> 1
+andx058 and 11 1 -> 1
+andx059 and 1 1 -> 1
+
+andx060 and 1111111111 0 -> 0
+andx061 and 111111111 0 -> 0
+andx062 and 11111111 0 -> 0
+andx063 and 1111111 0 -> 0
+andx064 and 111111 0 -> 0
+andx065 and 11111 0 -> 0
+andx066 and 1111 0 -> 0
+andx067 and 111 0 -> 0
+andx068 and 11 0 -> 0
+andx069 and 1 0 -> 0
+
+andx070 and 1 1111111111 -> 1
+andx071 and 1 111111111 -> 1
+andx072 and 1 11111111 -> 1
+andx073 and 1 1111111 -> 1
+andx074 and 1 111111 -> 1
+andx075 and 1 11111 -> 1
+andx076 and 1 1111 -> 1
+andx077 and 1 111 -> 1
+andx078 and 1 11 -> 1
+andx079 and 1 1 -> 1
+
+andx080 and 0 1111111111 -> 0
+andx081 and 0 111111111 -> 0
+andx082 and 0 11111111 -> 0
+andx083 and 0 1111111 -> 0
+andx084 and 0 111111 -> 0
+andx085 and 0 11111 -> 0
+andx086 and 0 1111 -> 0
+andx087 and 0 111 -> 0
+andx088 and 0 11 -> 0
+andx089 and 0 1 -> 0
+
+andx090 and 011111111 111111111 -> 11111111
+andx091 and 101111111 111111111 -> 101111111
+andx092 and 110111111 111111111 -> 110111111
+andx093 and 111011111 111111111 -> 111011111
+andx094 and 111101111 111111111 -> 111101111
+andx095 and 111110111 111111111 -> 111110111
+andx096 and 111111011 111111111 -> 111111011
+andx097 and 111111101 111111111 -> 111111101
+andx098 and 111111110 111111111 -> 111111110
+
+andx100 and 111111111 011111111 -> 11111111
+andx101 and 111111111 101111111 -> 101111111
+andx102 and 111111111 110111111 -> 110111111
+andx103 and 111111111 111011111 -> 111011111
+andx104 and 111111111 111101111 -> 111101111
+andx105 and 111111111 111110111 -> 111110111
+andx106 and 111111111 111111011 -> 111111011
+andx107 and 111111111 111111101 -> 111111101
+andx108 and 111111111 111111110 -> 111111110
+
+-- non-0/1 should not be accepted, nor should signs
+andx220 and 111111112 111111111 -> NaN Invalid_operation
+andx221 and 333333333 333333333 -> NaN Invalid_operation
+andx222 and 555555555 555555555 -> NaN Invalid_operation
+andx223 and 777777777 777777777 -> NaN Invalid_operation
+andx224 and 999999999 999999999 -> NaN Invalid_operation
+andx225 and 222222222 999999999 -> NaN Invalid_operation
+andx226 and 444444444 999999999 -> NaN Invalid_operation
+andx227 and 666666666 999999999 -> NaN Invalid_operation
+andx228 and 888888888 999999999 -> NaN Invalid_operation
+andx229 and 999999999 222222222 -> NaN Invalid_operation
+andx230 and 999999999 444444444 -> NaN Invalid_operation
+andx231 and 999999999 666666666 -> NaN Invalid_operation
+andx232 and 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+andx240 and 567468689 -934981942 -> NaN Invalid_operation
+andx241 and 567367689 934981942 -> NaN Invalid_operation
+andx242 and -631917772 -706014634 -> NaN Invalid_operation
+andx243 and -756253257 138579234 -> NaN Invalid_operation
+andx244 and 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+andx250 and 200000000 100000000 -> NaN Invalid_operation
+andx251 and 700000000 100000000 -> NaN Invalid_operation
+andx252 and 800000000 100000000 -> NaN Invalid_operation
+andx253 and 900000000 100000000 -> NaN Invalid_operation
+andx254 and 200000000 000000000 -> NaN Invalid_operation
+andx255 and 700000000 000000000 -> NaN Invalid_operation
+andx256 and 800000000 000000000 -> NaN Invalid_operation
+andx257 and 900000000 000000000 -> NaN Invalid_operation
+andx258 and 100000000 200000000 -> NaN Invalid_operation
+andx259 and 100000000 700000000 -> NaN Invalid_operation
+andx260 and 100000000 800000000 -> NaN Invalid_operation
+andx261 and 100000000 900000000 -> NaN Invalid_operation
+andx262 and 000000000 200000000 -> NaN Invalid_operation
+andx263 and 000000000 700000000 -> NaN Invalid_operation
+andx264 and 000000000 800000000 -> NaN Invalid_operation
+andx265 and 000000000 900000000 -> NaN Invalid_operation
+-- test MSD-1
+andx270 and 020000000 100000000 -> NaN Invalid_operation
+andx271 and 070100000 100000000 -> NaN Invalid_operation
+andx272 and 080010000 100000001 -> NaN Invalid_operation
+andx273 and 090001000 100000010 -> NaN Invalid_operation
+andx274 and 100000100 020010100 -> NaN Invalid_operation
+andx275 and 100000000 070001000 -> NaN Invalid_operation
+andx276 and 100000010 080010100 -> NaN Invalid_operation
+andx277 and 100000000 090000010 -> NaN Invalid_operation
+-- test LSD
+andx280 and 001000002 100000000 -> NaN Invalid_operation
+andx281 and 000000007 100000000 -> NaN Invalid_operation
+andx282 and 000000008 100000000 -> NaN Invalid_operation
+andx283 and 000000009 100000000 -> NaN Invalid_operation
+andx284 and 100000000 000100002 -> NaN Invalid_operation
+andx285 and 100100000 001000007 -> NaN Invalid_operation
+andx286 and 100010000 010000008 -> NaN Invalid_operation
+andx287 and 100001000 100000009 -> NaN Invalid_operation
+-- test Middie
+andx288 and 001020000 100000000 -> NaN Invalid_operation
+andx289 and 000070001 100000000 -> NaN Invalid_operation
+andx290 and 000080000 100010000 -> NaN Invalid_operation
+andx291 and 000090000 100001000 -> NaN Invalid_operation
+andx292 and 100000010 000020100 -> NaN Invalid_operation
+andx293 and 100100000 000070010 -> NaN Invalid_operation
+andx294 and 100010100 000080001 -> NaN Invalid_operation
+andx295 and 100001000 000090000 -> NaN Invalid_operation
+-- signs
+andx296 and -100001000 -000000000 -> NaN Invalid_operation
+andx297 and -100001000 000010000 -> NaN Invalid_operation
+andx298 and 100001000 -000000000 -> NaN Invalid_operation
+andx299 and 100001000 000011000 -> 1000
+
+-- Nmax, Nmin, Ntiny
+andx331 and 2 9.99999999E+999 -> NaN Invalid_operation
+andx332 and 3 1E-999 -> NaN Invalid_operation
+andx333 and 4 1.00000000E-999 -> NaN Invalid_operation
+andx334 and 5 1E-1007 -> NaN Invalid_operation
+andx335 and 6 -1E-1007 -> NaN Invalid_operation
+andx336 and 7 -1.00000000E-999 -> NaN Invalid_operation
+andx337 and 8 -1E-999 -> NaN Invalid_operation
+andx338 and 9 -9.99999999E+999 -> NaN Invalid_operation
+andx341 and 9.99999999E+999 -18 -> NaN Invalid_operation
+andx342 and 1E-999 01 -> NaN Invalid_operation
+andx343 and 1.00000000E-999 -18 -> NaN Invalid_operation
+andx344 and 1E-1007 18 -> NaN Invalid_operation
+andx345 and -1E-1007 -10 -> NaN Invalid_operation
+andx346 and -1.00000000E-999 18 -> NaN Invalid_operation
+andx347 and -1E-999 10 -> NaN Invalid_operation
+andx348 and -9.99999999E+999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+andx361 and 1.0 1 -> NaN Invalid_operation
+andx362 and 1E+1 1 -> NaN Invalid_operation
+andx363 and 0.0 1 -> NaN Invalid_operation
+andx364 and 0E+1 1 -> NaN Invalid_operation
+andx365 and 9.9 1 -> NaN Invalid_operation
+andx366 and 9E+1 1 -> NaN Invalid_operation
+andx371 and 0 1.0 -> NaN Invalid_operation
+andx372 and 0 1E+1 -> NaN Invalid_operation
+andx373 and 0 0.0 -> NaN Invalid_operation
+andx374 and 0 0E+1 -> NaN Invalid_operation
+andx375 and 0 9.9 -> NaN Invalid_operation
+andx376 and 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+andx780 and -Inf -Inf -> NaN Invalid_operation
+andx781 and -Inf -1000 -> NaN Invalid_operation
+andx782 and -Inf -1 -> NaN Invalid_operation
+andx783 and -Inf -0 -> NaN Invalid_operation
+andx784 and -Inf 0 -> NaN Invalid_operation
+andx785 and -Inf 1 -> NaN Invalid_operation
+andx786 and -Inf 1000 -> NaN Invalid_operation
+andx787 and -1000 -Inf -> NaN Invalid_operation
+andx788 and -Inf -Inf -> NaN Invalid_operation
+andx789 and -1 -Inf -> NaN Invalid_operation
+andx790 and -0 -Inf -> NaN Invalid_operation
+andx791 and 0 -Inf -> NaN Invalid_operation
+andx792 and 1 -Inf -> NaN Invalid_operation
+andx793 and 1000 -Inf -> NaN Invalid_operation
+andx794 and Inf -Inf -> NaN Invalid_operation
+
+andx800 and Inf -Inf -> NaN Invalid_operation
+andx801 and Inf -1000 -> NaN Invalid_operation
+andx802 and Inf -1 -> NaN Invalid_operation
+andx803 and Inf -0 -> NaN Invalid_operation
+andx804 and Inf 0 -> NaN Invalid_operation
+andx805 and Inf 1 -> NaN Invalid_operation
+andx806 and Inf 1000 -> NaN Invalid_operation
+andx807 and Inf Inf -> NaN Invalid_operation
+andx808 and -1000 Inf -> NaN Invalid_operation
+andx809 and -Inf Inf -> NaN Invalid_operation
+andx810 and -1 Inf -> NaN Invalid_operation
+andx811 and -0 Inf -> NaN Invalid_operation
+andx812 and 0 Inf -> NaN Invalid_operation
+andx813 and 1 Inf -> NaN Invalid_operation
+andx814 and 1000 Inf -> NaN Invalid_operation
+andx815 and Inf Inf -> NaN Invalid_operation
+
+andx821 and NaN -Inf -> NaN Invalid_operation
+andx822 and NaN -1000 -> NaN Invalid_operation
+andx823 and NaN -1 -> NaN Invalid_operation
+andx824 and NaN -0 -> NaN Invalid_operation
+andx825 and NaN 0 -> NaN Invalid_operation
+andx826 and NaN 1 -> NaN Invalid_operation
+andx827 and NaN 1000 -> NaN Invalid_operation
+andx828 and NaN Inf -> NaN Invalid_operation
+andx829 and NaN NaN -> NaN Invalid_operation
+andx830 and -Inf NaN -> NaN Invalid_operation
+andx831 and -1000 NaN -> NaN Invalid_operation
+andx832 and -1 NaN -> NaN Invalid_operation
+andx833 and -0 NaN -> NaN Invalid_operation
+andx834 and 0 NaN -> NaN Invalid_operation
+andx835 and 1 NaN -> NaN Invalid_operation
+andx836 and 1000 NaN -> NaN Invalid_operation
+andx837 and Inf NaN -> NaN Invalid_operation
+
+andx841 and sNaN -Inf -> NaN Invalid_operation
+andx842 and sNaN -1000 -> NaN Invalid_operation
+andx843 and sNaN -1 -> NaN Invalid_operation
+andx844 and sNaN -0 -> NaN Invalid_operation
+andx845 and sNaN 0 -> NaN Invalid_operation
+andx846 and sNaN 1 -> NaN Invalid_operation
+andx847 and sNaN 1000 -> NaN Invalid_operation
+andx848 and sNaN NaN -> NaN Invalid_operation
+andx849 and sNaN sNaN -> NaN Invalid_operation
+andx850 and NaN sNaN -> NaN Invalid_operation
+andx851 and -Inf sNaN -> NaN Invalid_operation
+andx852 and -1000 sNaN -> NaN Invalid_operation
+andx853 and -1 sNaN -> NaN Invalid_operation
+andx854 and -0 sNaN -> NaN Invalid_operation
+andx855 and 0 sNaN -> NaN Invalid_operation
+andx856 and 1 sNaN -> NaN Invalid_operation
+andx857 and 1000 sNaN -> NaN Invalid_operation
+andx858 and Inf sNaN -> NaN Invalid_operation
+andx859 and NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+andx861 and NaN1 -Inf -> NaN Invalid_operation
+andx862 and +NaN2 -1000 -> NaN Invalid_operation
+andx863 and NaN3 1000 -> NaN Invalid_operation
+andx864 and NaN4 Inf -> NaN Invalid_operation
+andx865 and NaN5 +NaN6 -> NaN Invalid_operation
+andx866 and -Inf NaN7 -> NaN Invalid_operation
+andx867 and -1000 NaN8 -> NaN Invalid_operation
+andx868 and 1000 NaN9 -> NaN Invalid_operation
+andx869 and Inf +NaN10 -> NaN Invalid_operation
+andx871 and sNaN11 -Inf -> NaN Invalid_operation
+andx872 and sNaN12 -1000 -> NaN Invalid_operation
+andx873 and sNaN13 1000 -> NaN Invalid_operation
+andx874 and sNaN14 NaN17 -> NaN Invalid_operation
+andx875 and sNaN15 sNaN18 -> NaN Invalid_operation
+andx876 and NaN16 sNaN19 -> NaN Invalid_operation
+andx877 and -Inf +sNaN20 -> NaN Invalid_operation
+andx878 and -1000 sNaN21 -> NaN Invalid_operation
+andx879 and 1000 sNaN22 -> NaN Invalid_operation
+andx880 and Inf sNaN23 -> NaN Invalid_operation
+andx881 and +NaN25 +sNaN24 -> NaN Invalid_operation
+andx882 and -NaN26 NaN28 -> NaN Invalid_operation
+andx883 and -sNaN27 sNaN29 -> NaN Invalid_operation
+andx884 and 1000 -NaN30 -> NaN Invalid_operation
+andx885 and 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/class.decTest b/Lib/test/decimaltestdata/class.decTest
index 62d2fa472f..fa5bc3a12f 100644
--- a/Lib/test/decimaltestdata/class.decTest
+++ b/Lib/test/decimaltestdata/class.decTest
@@ -1,131 +1,131 @@
-------------------------------------------------------------------------
--- class.decTest -- Class operations --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- [New 2006.11.27]
-
-precision: 9
-maxExponent: 999
-minExponent: -999
-extended: 1
-clamp: 1
-rounding: half_even
-
-clasx001 class 0 -> +Zero
-clasx002 class 0.00 -> +Zero
-clasx003 class 0E+5 -> +Zero
-clasx004 class 1E-1007 -> +Subnormal
-clasx005 class 0.1E-999 -> +Subnormal
-clasx006 class 0.99999999E-999 -> +Subnormal
-clasx007 class 1.00000000E-999 -> +Normal
-clasx008 class 1E-999 -> +Normal
-clasx009 class 1E-100 -> +Normal
-clasx010 class 1E-10 -> +Normal
-clasx012 class 1E-1 -> +Normal
-clasx013 class 1 -> +Normal
-clasx014 class 2.50 -> +Normal
-clasx015 class 100.100 -> +Normal
-clasx016 class 1E+30 -> +Normal
-clasx017 class 1E+999 -> +Normal
-clasx018 class 9.99999999E+999 -> +Normal
-clasx019 class Inf -> +Infinity
-
-clasx021 class -0 -> -Zero
-clasx022 class -0.00 -> -Zero
-clasx023 class -0E+5 -> -Zero
-clasx024 class -1E-1007 -> -Subnormal
-clasx025 class -0.1E-999 -> -Subnormal
-clasx026 class -0.99999999E-999 -> -Subnormal
-clasx027 class -1.00000000E-999 -> -Normal
-clasx028 class -1E-999 -> -Normal
-clasx029 class -1E-100 -> -Normal
-clasx030 class -1E-10 -> -Normal
-clasx032 class -1E-1 -> -Normal
-clasx033 class -1 -> -Normal
-clasx034 class -2.50 -> -Normal
-clasx035 class -100.100 -> -Normal
-clasx036 class -1E+30 -> -Normal
-clasx037 class -1E+999 -> -Normal
-clasx038 class -9.99999999E+999 -> -Normal
-clasx039 class -Inf -> -Infinity
-
-clasx041 class NaN -> NaN
-clasx042 class -NaN -> NaN
-clasx043 class +NaN12345 -> NaN
-clasx044 class sNaN -> sNaN
-clasx045 class -sNaN -> sNaN
-clasx046 class +sNaN12345 -> sNaN
-
-
--- decimal64 bounds
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-clamp: 1
-rounding: half_even
-
-clasx201 class 0 -> +Zero
-clasx202 class 0.00 -> +Zero
-clasx203 class 0E+5 -> +Zero
-clasx204 class 1E-396 -> +Subnormal
-clasx205 class 0.1E-383 -> +Subnormal
-clasx206 class 0.999999999999999E-383 -> +Subnormal
-clasx207 class 1.000000000000000E-383 -> +Normal
-clasx208 class 1E-383 -> +Normal
-clasx209 class 1E-100 -> +Normal
-clasx210 class 1E-10 -> +Normal
-clasx212 class 1E-1 -> +Normal
-clasx213 class 1 -> +Normal
-clasx214 class 2.50 -> +Normal
-clasx215 class 100.100 -> +Normal
-clasx216 class 1E+30 -> +Normal
-clasx217 class 1E+384 -> +Normal
-clasx218 class 9.999999999999999E+384 -> +Normal
-clasx219 class Inf -> +Infinity
-
-clasx221 class -0 -> -Zero
-clasx222 class -0.00 -> -Zero
-clasx223 class -0E+5 -> -Zero
-clasx224 class -1E-396 -> -Subnormal
-clasx225 class -0.1E-383 -> -Subnormal
-clasx226 class -0.999999999999999E-383 -> -Subnormal
-clasx227 class -1.000000000000000E-383 -> -Normal
-clasx228 class -1E-383 -> -Normal
-clasx229 class -1E-100 -> -Normal
-clasx230 class -1E-10 -> -Normal
-clasx232 class -1E-1 -> -Normal
-clasx233 class -1 -> -Normal
-clasx234 class -2.50 -> -Normal
-clasx235 class -100.100 -> -Normal
-clasx236 class -1E+30 -> -Normal
-clasx237 class -1E+384 -> -Normal
-clasx238 class -9.999999999999999E+384 -> -Normal
-clasx239 class -Inf -> -Infinity
-
-clasx241 class NaN -> NaN
-clasx242 class -NaN -> NaN
-clasx243 class +NaN12345 -> NaN
-clasx244 class sNaN -> sNaN
-clasx245 class -sNaN -> sNaN
-clasx246 class +sNaN12345 -> sNaN
-
-
-
+------------------------------------------------------------------------
+-- class.decTest -- Class operations --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- [New 2006.11.27]
+
+precision: 9
+maxExponent: 999
+minExponent: -999
+extended: 1
+clamp: 1
+rounding: half_even
+
+clasx001 class 0 -> +Zero
+clasx002 class 0.00 -> +Zero
+clasx003 class 0E+5 -> +Zero
+clasx004 class 1E-1007 -> +Subnormal
+clasx005 class 0.1E-999 -> +Subnormal
+clasx006 class 0.99999999E-999 -> +Subnormal
+clasx007 class 1.00000000E-999 -> +Normal
+clasx008 class 1E-999 -> +Normal
+clasx009 class 1E-100 -> +Normal
+clasx010 class 1E-10 -> +Normal
+clasx012 class 1E-1 -> +Normal
+clasx013 class 1 -> +Normal
+clasx014 class 2.50 -> +Normal
+clasx015 class 100.100 -> +Normal
+clasx016 class 1E+30 -> +Normal
+clasx017 class 1E+999 -> +Normal
+clasx018 class 9.99999999E+999 -> +Normal
+clasx019 class Inf -> +Infinity
+
+clasx021 class -0 -> -Zero
+clasx022 class -0.00 -> -Zero
+clasx023 class -0E+5 -> -Zero
+clasx024 class -1E-1007 -> -Subnormal
+clasx025 class -0.1E-999 -> -Subnormal
+clasx026 class -0.99999999E-999 -> -Subnormal
+clasx027 class -1.00000000E-999 -> -Normal
+clasx028 class -1E-999 -> -Normal
+clasx029 class -1E-100 -> -Normal
+clasx030 class -1E-10 -> -Normal
+clasx032 class -1E-1 -> -Normal
+clasx033 class -1 -> -Normal
+clasx034 class -2.50 -> -Normal
+clasx035 class -100.100 -> -Normal
+clasx036 class -1E+30 -> -Normal
+clasx037 class -1E+999 -> -Normal
+clasx038 class -9.99999999E+999 -> -Normal
+clasx039 class -Inf -> -Infinity
+
+clasx041 class NaN -> NaN
+clasx042 class -NaN -> NaN
+clasx043 class +NaN12345 -> NaN
+clasx044 class sNaN -> sNaN
+clasx045 class -sNaN -> sNaN
+clasx046 class +sNaN12345 -> sNaN
+
+
+-- decimal64 bounds
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+clamp: 1
+rounding: half_even
+
+clasx201 class 0 -> +Zero
+clasx202 class 0.00 -> +Zero
+clasx203 class 0E+5 -> +Zero
+clasx204 class 1E-396 -> +Subnormal
+clasx205 class 0.1E-383 -> +Subnormal
+clasx206 class 0.999999999999999E-383 -> +Subnormal
+clasx207 class 1.000000000000000E-383 -> +Normal
+clasx208 class 1E-383 -> +Normal
+clasx209 class 1E-100 -> +Normal
+clasx210 class 1E-10 -> +Normal
+clasx212 class 1E-1 -> +Normal
+clasx213 class 1 -> +Normal
+clasx214 class 2.50 -> +Normal
+clasx215 class 100.100 -> +Normal
+clasx216 class 1E+30 -> +Normal
+clasx217 class 1E+384 -> +Normal
+clasx218 class 9.999999999999999E+384 -> +Normal
+clasx219 class Inf -> +Infinity
+
+clasx221 class -0 -> -Zero
+clasx222 class -0.00 -> -Zero
+clasx223 class -0E+5 -> -Zero
+clasx224 class -1E-396 -> -Subnormal
+clasx225 class -0.1E-383 -> -Subnormal
+clasx226 class -0.999999999999999E-383 -> -Subnormal
+clasx227 class -1.000000000000000E-383 -> -Normal
+clasx228 class -1E-383 -> -Normal
+clasx229 class -1E-100 -> -Normal
+clasx230 class -1E-10 -> -Normal
+clasx232 class -1E-1 -> -Normal
+clasx233 class -1 -> -Normal
+clasx234 class -2.50 -> -Normal
+clasx235 class -100.100 -> -Normal
+clasx236 class -1E+30 -> -Normal
+clasx237 class -1E+384 -> -Normal
+clasx238 class -9.999999999999999E+384 -> -Normal
+clasx239 class -Inf -> -Infinity
+
+clasx241 class NaN -> NaN
+clasx242 class -NaN -> NaN
+clasx243 class +NaN12345 -> NaN
+clasx244 class sNaN -> sNaN
+clasx245 class -sNaN -> sNaN
+clasx246 class +sNaN12345 -> sNaN
+
+
+
diff --git a/Lib/test/decimaltestdata/comparetotal.decTest b/Lib/test/decimaltestdata/comparetotal.decTest
index ad87b4ce29..252c49fb61 100644
--- a/Lib/test/decimaltestdata/comparetotal.decTest
+++ b/Lib/test/decimaltestdata/comparetotal.decTest
@@ -1,798 +1,798 @@
-------------------------------------------------------------------------
--- comparetotal.decTest -- decimal comparison using total ordering --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
-extended: 1
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
--- sanity checks
-cotx001 comparetotal -2 -2 -> 0
-cotx002 comparetotal -2 -1 -> -1
-cotx003 comparetotal -2 0 -> -1
-cotx004 comparetotal -2 1 -> -1
-cotx005 comparetotal -2 2 -> -1
-cotx006 comparetotal -1 -2 -> 1
-cotx007 comparetotal -1 -1 -> 0
-cotx008 comparetotal -1 0 -> -1
-cotx009 comparetotal -1 1 -> -1
-cotx010 comparetotal -1 2 -> -1
-cotx011 comparetotal 0 -2 -> 1
-cotx012 comparetotal 0 -1 -> 1
-cotx013 comparetotal 0 0 -> 0
-cotx014 comparetotal 0 1 -> -1
-cotx015 comparetotal 0 2 -> -1
-cotx016 comparetotal 1 -2 -> 1
-cotx017 comparetotal 1 -1 -> 1
-cotx018 comparetotal 1 0 -> 1
-cotx019 comparetotal 1 1 -> 0
-cotx020 comparetotal 1 2 -> -1
-cotx021 comparetotal 2 -2 -> 1
-cotx022 comparetotal 2 -1 -> 1
-cotx023 comparetotal 2 0 -> 1
-cotx025 comparetotal 2 1 -> 1
-cotx026 comparetotal 2 2 -> 0
-
-cotx031 comparetotal -20 -20 -> 0
-cotx032 comparetotal -20 -10 -> -1
-cotx033 comparetotal -20 00 -> -1
-cotx034 comparetotal -20 10 -> -1
-cotx035 comparetotal -20 20 -> -1
-cotx036 comparetotal -10 -20 -> 1
-cotx037 comparetotal -10 -10 -> 0
-cotx038 comparetotal -10 00 -> -1
-cotx039 comparetotal -10 10 -> -1
-cotx040 comparetotal -10 20 -> -1
-cotx041 comparetotal 00 -20 -> 1
-cotx042 comparetotal 00 -10 -> 1
-cotx043 comparetotal 00 00 -> 0
-cotx044 comparetotal 00 10 -> -1
-cotx045 comparetotal 00 20 -> -1
-cotx046 comparetotal 10 -20 -> 1
-cotx047 comparetotal 10 -10 -> 1
-cotx048 comparetotal 10 00 -> 1
-cotx049 comparetotal 10 10 -> 0
-cotx050 comparetotal 10 20 -> -1
-cotx051 comparetotal 20 -20 -> 1
-cotx052 comparetotal 20 -10 -> 1
-cotx053 comparetotal 20 00 -> 1
-cotx055 comparetotal 20 10 -> 1
-cotx056 comparetotal 20 20 -> 0
-
-cotx061 comparetotal -2.0 -2.0 -> 0
-cotx062 comparetotal -2.0 -1.0 -> -1
-cotx063 comparetotal -2.0 0.0 -> -1
-cotx064 comparetotal -2.0 1.0 -> -1
-cotx065 comparetotal -2.0 2.0 -> -1
-cotx066 comparetotal -1.0 -2.0 -> 1
-cotx067 comparetotal -1.0 -1.0 -> 0
-cotx068 comparetotal -1.0 0.0 -> -1
-cotx069 comparetotal -1.0 1.0 -> -1
-cotx070 comparetotal -1.0 2.0 -> -1
-cotx071 comparetotal 0.0 -2.0 -> 1
-cotx072 comparetotal 0.0 -1.0 -> 1
-cotx073 comparetotal 0.0 0.0 -> 0
-cotx074 comparetotal 0.0 1.0 -> -1
-cotx075 comparetotal 0.0 2.0 -> -1
-cotx076 comparetotal 1.0 -2.0 -> 1
-cotx077 comparetotal 1.0 -1.0 -> 1
-cotx078 comparetotal 1.0 0.0 -> 1
-cotx079 comparetotal 1.0 1.0 -> 0
-cotx080 comparetotal 1.0 2.0 -> -1
-cotx081 comparetotal 2.0 -2.0 -> 1
-cotx082 comparetotal 2.0 -1.0 -> 1
-cotx083 comparetotal 2.0 0.0 -> 1
-cotx085 comparetotal 2.0 1.0 -> 1
-cotx086 comparetotal 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-maxexponent: 999999999
-minexponent: -999999999
-cotx090 comparetotal 9.99999999E+999999999 9.99999999E+999999999 -> 0
-cotx091 comparetotal -9.99999999E+999999999 9.99999999E+999999999 -> -1
-cotx092 comparetotal 9.99999999E+999999999 -9.99999999E+999999999 -> 1
-cotx093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0
-
--- Examples
-cotx094 comparetotal 12.73 127.9 -> -1
-cotx095 comparetotal -127 12 -> -1
-cotx096 comparetotal 12.30 12.3 -> -1
-cotx097 comparetotal 12.30 12.30 -> 0
-cotx098 comparetotal 12.3 12.300 -> 1
-cotx099 comparetotal 12.3 NaN -> -1
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-cotx100 comparetotal 7.0 7.0 -> 0
-cotx101 comparetotal 7.0 7 -> -1
-cotx102 comparetotal 7 7.0 -> 1
-cotx103 comparetotal 7E+0 7.0 -> 1
-cotx104 comparetotal 70E-1 7.0 -> 0
-cotx105 comparetotal 0.7E+1 7 -> 0
-cotx106 comparetotal 70E-1 7 -> -1
-cotx107 comparetotal 7.0 7E+0 -> -1
-cotx108 comparetotal 7.0 70E-1 -> 0
-cotx109 comparetotal 7 0.7E+1 -> 0
-cotx110 comparetotal 7 70E-1 -> 1
-
-cotx120 comparetotal 8.0 7.0 -> 1
-cotx121 comparetotal 8.0 7 -> 1
-cotx122 comparetotal 8 7.0 -> 1
-cotx123 comparetotal 8E+0 7.0 -> 1
-cotx124 comparetotal 80E-1 7.0 -> 1
-cotx125 comparetotal 0.8E+1 7 -> 1
-cotx126 comparetotal 80E-1 7 -> 1
-cotx127 comparetotal 8.0 7E+0 -> 1
-cotx128 comparetotal 8.0 70E-1 -> 1
-cotx129 comparetotal 8 0.7E+1 -> 1
-cotx130 comparetotal 8 70E-1 -> 1
-
-cotx140 comparetotal 8.0 9.0 -> -1
-cotx141 comparetotal 8.0 9 -> -1
-cotx142 comparetotal 8 9.0 -> -1
-cotx143 comparetotal 8E+0 9.0 -> -1
-cotx144 comparetotal 80E-1 9.0 -> -1
-cotx145 comparetotal 0.8E+1 9 -> -1
-cotx146 comparetotal 80E-1 9 -> -1
-cotx147 comparetotal 8.0 9E+0 -> -1
-cotx148 comparetotal 8.0 90E-1 -> -1
-cotx149 comparetotal 8 0.9E+1 -> -1
-cotx150 comparetotal 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-cotx200 comparetotal -7.0 7.0 -> -1
-cotx201 comparetotal -7.0 7 -> -1
-cotx202 comparetotal -7 7.0 -> -1
-cotx203 comparetotal -7E+0 7.0 -> -1
-cotx204 comparetotal -70E-1 7.0 -> -1
-cotx205 comparetotal -0.7E+1 7 -> -1
-cotx206 comparetotal -70E-1 7 -> -1
-cotx207 comparetotal -7.0 7E+0 -> -1
-cotx208 comparetotal -7.0 70E-1 -> -1
-cotx209 comparetotal -7 0.7E+1 -> -1
-cotx210 comparetotal -7 70E-1 -> -1
-
-cotx220 comparetotal -8.0 7.0 -> -1
-cotx221 comparetotal -8.0 7 -> -1
-cotx222 comparetotal -8 7.0 -> -1
-cotx223 comparetotal -8E+0 7.0 -> -1
-cotx224 comparetotal -80E-1 7.0 -> -1
-cotx225 comparetotal -0.8E+1 7 -> -1
-cotx226 comparetotal -80E-1 7 -> -1
-cotx227 comparetotal -8.0 7E+0 -> -1
-cotx228 comparetotal -8.0 70E-1 -> -1
-cotx229 comparetotal -8 0.7E+1 -> -1
-cotx230 comparetotal -8 70E-1 -> -1
-
-cotx240 comparetotal -8.0 9.0 -> -1
-cotx241 comparetotal -8.0 9 -> -1
-cotx242 comparetotal -8 9.0 -> -1
-cotx243 comparetotal -8E+0 9.0 -> -1
-cotx244 comparetotal -80E-1 9.0 -> -1
-cotx245 comparetotal -0.8E+1 9 -> -1
-cotx246 comparetotal -80E-1 9 -> -1
-cotx247 comparetotal -8.0 9E+0 -> -1
-cotx248 comparetotal -8.0 90E-1 -> -1
-cotx249 comparetotal -8 0.9E+1 -> -1
-cotx250 comparetotal -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-cotx300 comparetotal 7.0 -7.0 -> 1
-cotx301 comparetotal 7.0 -7 -> 1
-cotx302 comparetotal 7 -7.0 -> 1
-cotx303 comparetotal 7E+0 -7.0 -> 1
-cotx304 comparetotal 70E-1 -7.0 -> 1
-cotx305 comparetotal .7E+1 -7 -> 1
-cotx306 comparetotal 70E-1 -7 -> 1
-cotx307 comparetotal 7.0 -7E+0 -> 1
-cotx308 comparetotal 7.0 -70E-1 -> 1
-cotx309 comparetotal 7 -.7E+1 -> 1
-cotx310 comparetotal 7 -70E-1 -> 1
-
-cotx320 comparetotal 8.0 -7.0 -> 1
-cotx321 comparetotal 8.0 -7 -> 1
-cotx322 comparetotal 8 -7.0 -> 1
-cotx323 comparetotal 8E+0 -7.0 -> 1
-cotx324 comparetotal 80E-1 -7.0 -> 1
-cotx325 comparetotal .8E+1 -7 -> 1
-cotx326 comparetotal 80E-1 -7 -> 1
-cotx327 comparetotal 8.0 -7E+0 -> 1
-cotx328 comparetotal 8.0 -70E-1 -> 1
-cotx329 comparetotal 8 -.7E+1 -> 1
-cotx330 comparetotal 8 -70E-1 -> 1
-
-cotx340 comparetotal 8.0 -9.0 -> 1
-cotx341 comparetotal 8.0 -9 -> 1
-cotx342 comparetotal 8 -9.0 -> 1
-cotx343 comparetotal 8E+0 -9.0 -> 1
-cotx344 comparetotal 80E-1 -9.0 -> 1
-cotx345 comparetotal .8E+1 -9 -> 1
-cotx346 comparetotal 80E-1 -9 -> 1
-cotx347 comparetotal 8.0 -9E+0 -> 1
-cotx348 comparetotal 8.0 -90E-1 -> 1
-cotx349 comparetotal 8 -.9E+1 -> 1
-cotx350 comparetotal 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-cotx400 comparetotal -7.0 -7.0 -> 0
-cotx401 comparetotal -7.0 -7 -> 1
-cotx402 comparetotal -7 -7.0 -> -1
-cotx403 comparetotal -7E+0 -7.0 -> -1
-cotx404 comparetotal -70E-1 -7.0 -> 0
-cotx405 comparetotal -.7E+1 -7 -> 0
-cotx406 comparetotal -70E-1 -7 -> 1
-cotx407 comparetotal -7.0 -7E+0 -> 1
-cotx408 comparetotal -7.0 -70E-1 -> 0
-cotx409 comparetotal -7 -.7E+1 -> 0
-cotx410 comparetotal -7 -70E-1 -> -1
-
-cotx420 comparetotal -8.0 -7.0 -> -1
-cotx421 comparetotal -8.0 -7 -> -1
-cotx422 comparetotal -8 -7.0 -> -1
-cotx423 comparetotal -8E+0 -7.0 -> -1
-cotx424 comparetotal -80E-1 -7.0 -> -1
-cotx425 comparetotal -.8E+1 -7 -> -1
-cotx426 comparetotal -80E-1 -7 -> -1
-cotx427 comparetotal -8.0 -7E+0 -> -1
-cotx428 comparetotal -8.0 -70E-1 -> -1
-cotx429 comparetotal -8 -.7E+1 -> -1
-cotx430 comparetotal -8 -70E-1 -> -1
-
-cotx440 comparetotal -8.0 -9.0 -> 1
-cotx441 comparetotal -8.0 -9 -> 1
-cotx442 comparetotal -8 -9.0 -> 1
-cotx443 comparetotal -8E+0 -9.0 -> 1
-cotx444 comparetotal -80E-1 -9.0 -> 1
-cotx445 comparetotal -.8E+1 -9 -> 1
-cotx446 comparetotal -80E-1 -9 -> 1
-cotx447 comparetotal -8.0 -9E+0 -> 1
-cotx448 comparetotal -8.0 -90E-1 -> 1
-cotx449 comparetotal -8 -.9E+1 -> 1
-cotx450 comparetotal -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-precision: 40
-cotx470 comparetotal 123.4560000000000000E789 123.456E789 -> -1
-cotx471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1
-cotx472 comparetotal 123.45600000000000E789 123.456E789 -> -1
-cotx473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
-cotx474 comparetotal 123.456000000000E789 123.456E789 -> -1
-cotx475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
-cotx476 comparetotal 123.4560000000E789 123.456E789 -> -1
-cotx477 comparetotal 123.456000000E-89 123.456E-89 -> -1
-cotx478 comparetotal 123.45600000E789 123.456E789 -> -1
-cotx479 comparetotal 123.4560000E-89 123.456E-89 -> -1
-cotx480 comparetotal 123.456000E789 123.456E789 -> -1
-cotx481 comparetotal 123.45600E-89 123.456E-89 -> -1
-cotx482 comparetotal 123.4560E789 123.456E789 -> -1
-cotx483 comparetotal 123.456E-89 123.456E-89 -> 0
-cotx484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1
-cotx485 comparetotal 123.456E789 123.456000000000000E789 -> 1
-cotx486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1
-cotx487 comparetotal 123.456E789 123.4560000000000E789 -> 1
-cotx488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
-cotx489 comparetotal 123.456E789 123.45600000000E789 -> 1
-cotx490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
-cotx491 comparetotal 123.456E789 123.456000000E789 -> 1
-cotx492 comparetotal 123.456E-89 123.45600000E-89 -> 1
-cotx493 comparetotal 123.456E789 123.4560000E789 -> 1
-cotx494 comparetotal 123.456E-89 123.456000E-89 -> 1
-cotx495 comparetotal 123.456E789 123.45600E789 -> 1
-cotx496 comparetotal 123.456E-89 123.4560E-89 -> 1
-cotx497 comparetotal 123.456E789 123.456E789 -> 0
-
--- wide-ranging, around precision; signs equal
-precision: 9
-cotx500 comparetotal 1 1E-15 -> 1
-cotx501 comparetotal 1 1E-14 -> 1
-cotx502 comparetotal 1 1E-13 -> 1
-cotx503 comparetotal 1 1E-12 -> 1
-cotx504 comparetotal 1 1E-11 -> 1
-cotx505 comparetotal 1 1E-10 -> 1
-cotx506 comparetotal 1 1E-9 -> 1
-cotx507 comparetotal 1 1E-8 -> 1
-cotx508 comparetotal 1 1E-7 -> 1
-cotx509 comparetotal 1 1E-6 -> 1
-cotx510 comparetotal 1 1E-5 -> 1
-cotx511 comparetotal 1 1E-4 -> 1
-cotx512 comparetotal 1 1E-3 -> 1
-cotx513 comparetotal 1 1E-2 -> 1
-cotx514 comparetotal 1 1E-1 -> 1
-cotx515 comparetotal 1 1E-0 -> 0
-cotx516 comparetotal 1 1E+1 -> -1
-cotx517 comparetotal 1 1E+2 -> -1
-cotx518 comparetotal 1 1E+3 -> -1
-cotx519 comparetotal 1 1E+4 -> -1
-cotx521 comparetotal 1 1E+5 -> -1
-cotx522 comparetotal 1 1E+6 -> -1
-cotx523 comparetotal 1 1E+7 -> -1
-cotx524 comparetotal 1 1E+8 -> -1
-cotx525 comparetotal 1 1E+9 -> -1
-cotx526 comparetotal 1 1E+10 -> -1
-cotx527 comparetotal 1 1E+11 -> -1
-cotx528 comparetotal 1 1E+12 -> -1
-cotx529 comparetotal 1 1E+13 -> -1
-cotx530 comparetotal 1 1E+14 -> -1
-cotx531 comparetotal 1 1E+15 -> -1
--- LR swap
-cotx540 comparetotal 1E-15 1 -> -1
-cotx541 comparetotal 1E-14 1 -> -1
-cotx542 comparetotal 1E-13 1 -> -1
-cotx543 comparetotal 1E-12 1 -> -1
-cotx544 comparetotal 1E-11 1 -> -1
-cotx545 comparetotal 1E-10 1 -> -1
-cotx546 comparetotal 1E-9 1 -> -1
-cotx547 comparetotal 1E-8 1 -> -1
-cotx548 comparetotal 1E-7 1 -> -1
-cotx549 comparetotal 1E-6 1 -> -1
-cotx550 comparetotal 1E-5 1 -> -1
-cotx551 comparetotal 1E-4 1 -> -1
-cotx552 comparetotal 1E-3 1 -> -1
-cotx553 comparetotal 1E-2 1 -> -1
-cotx554 comparetotal 1E-1 1 -> -1
-cotx555 comparetotal 1E-0 1 -> 0
-cotx556 comparetotal 1E+1 1 -> 1
-cotx557 comparetotal 1E+2 1 -> 1
-cotx558 comparetotal 1E+3 1 -> 1
-cotx559 comparetotal 1E+4 1 -> 1
-cotx561 comparetotal 1E+5 1 -> 1
-cotx562 comparetotal 1E+6 1 -> 1
-cotx563 comparetotal 1E+7 1 -> 1
-cotx564 comparetotal 1E+8 1 -> 1
-cotx565 comparetotal 1E+9 1 -> 1
-cotx566 comparetotal 1E+10 1 -> 1
-cotx567 comparetotal 1E+11 1 -> 1
-cotx568 comparetotal 1E+12 1 -> 1
-cotx569 comparetotal 1E+13 1 -> 1
-cotx570 comparetotal 1E+14 1 -> 1
-cotx571 comparetotal 1E+15 1 -> 1
--- similar with an useful coefficient, one side only
-cotx580 comparetotal 0.000000987654321 1E-15 -> 1
-cotx581 comparetotal 0.000000987654321 1E-14 -> 1
-cotx582 comparetotal 0.000000987654321 1E-13 -> 1
-cotx583 comparetotal 0.000000987654321 1E-12 -> 1
-cotx584 comparetotal 0.000000987654321 1E-11 -> 1
-cotx585 comparetotal 0.000000987654321 1E-10 -> 1
-cotx586 comparetotal 0.000000987654321 1E-9 -> 1
-cotx587 comparetotal 0.000000987654321 1E-8 -> 1
-cotx588 comparetotal 0.000000987654321 1E-7 -> 1
-cotx589 comparetotal 0.000000987654321 1E-6 -> -1
-cotx590 comparetotal 0.000000987654321 1E-5 -> -1
-cotx591 comparetotal 0.000000987654321 1E-4 -> -1
-cotx592 comparetotal 0.000000987654321 1E-3 -> -1
-cotx593 comparetotal 0.000000987654321 1E-2 -> -1
-cotx594 comparetotal 0.000000987654321 1E-1 -> -1
-cotx595 comparetotal 0.000000987654321 1E-0 -> -1
-cotx596 comparetotal 0.000000987654321 1E+1 -> -1
-cotx597 comparetotal 0.000000987654321 1E+2 -> -1
-cotx598 comparetotal 0.000000987654321 1E+3 -> -1
-cotx599 comparetotal 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-precision: 20
-cotx600 comparetotal 12 12.2345 -> -1
-cotx601 comparetotal 12.0 12.2345 -> -1
-cotx602 comparetotal 12.00 12.2345 -> -1
-cotx603 comparetotal 12.000 12.2345 -> -1
-cotx604 comparetotal 12.0000 12.2345 -> -1
-cotx605 comparetotal 12.00000 12.2345 -> -1
-cotx606 comparetotal 12.000000 12.2345 -> -1
-cotx607 comparetotal 12.0000000 12.2345 -> -1
-cotx608 comparetotal 12.00000000 12.2345 -> -1
-cotx609 comparetotal 12.000000000 12.2345 -> -1
-cotx610 comparetotal 12.1234 12 -> 1
-cotx611 comparetotal 12.1234 12.0 -> 1
-cotx612 comparetotal 12.1234 12.00 -> 1
-cotx613 comparetotal 12.1234 12.000 -> 1
-cotx614 comparetotal 12.1234 12.0000 -> 1
-cotx615 comparetotal 12.1234 12.00000 -> 1
-cotx616 comparetotal 12.1234 12.000000 -> 1
-cotx617 comparetotal 12.1234 12.0000000 -> 1
-cotx618 comparetotal 12.1234 12.00000000 -> 1
-cotx619 comparetotal 12.1234 12.000000000 -> 1
-cotx620 comparetotal -12 -12.2345 -> 1
-cotx621 comparetotal -12.0 -12.2345 -> 1
-cotx622 comparetotal -12.00 -12.2345 -> 1
-cotx623 comparetotal -12.000 -12.2345 -> 1
-cotx624 comparetotal -12.0000 -12.2345 -> 1
-cotx625 comparetotal -12.00000 -12.2345 -> 1
-cotx626 comparetotal -12.000000 -12.2345 -> 1
-cotx627 comparetotal -12.0000000 -12.2345 -> 1
-cotx628 comparetotal -12.00000000 -12.2345 -> 1
-cotx629 comparetotal -12.000000000 -12.2345 -> 1
-cotx630 comparetotal -12.1234 -12 -> -1
-cotx631 comparetotal -12.1234 -12.0 -> -1
-cotx632 comparetotal -12.1234 -12.00 -> -1
-cotx633 comparetotal -12.1234 -12.000 -> -1
-cotx634 comparetotal -12.1234 -12.0000 -> -1
-cotx635 comparetotal -12.1234 -12.00000 -> -1
-cotx636 comparetotal -12.1234 -12.000000 -> -1
-cotx637 comparetotal -12.1234 -12.0000000 -> -1
-cotx638 comparetotal -12.1234 -12.00000000 -> -1
-cotx639 comparetotal -12.1234 -12.000000000 -> -1
-precision: 9
-
--- extended zeros
-cotx640 comparetotal 0 0 -> 0
-cotx641 comparetotal 0 -0 -> 1
-cotx642 comparetotal 0 -0.0 -> 1
-cotx643 comparetotal 0 0.0 -> 1
-cotx644 comparetotal -0 0 -> -1
-cotx645 comparetotal -0 -0 -> 0
-cotx646 comparetotal -0 -0.0 -> -1
-cotx647 comparetotal -0 0.0 -> -1
-cotx648 comparetotal 0.0 0 -> -1
-cotx649 comparetotal 0.0 -0 -> 1
-cotx650 comparetotal 0.0 -0.0 -> 1
-cotx651 comparetotal 0.0 0.0 -> 0
-cotx652 comparetotal -0.0 0 -> -1
-cotx653 comparetotal -0.0 -0 -> 1
-cotx654 comparetotal -0.0 -0.0 -> 0
-cotx655 comparetotal -0.0 0.0 -> -1
-
-cotx656 comparetotal -0E1 0.0 -> -1
-cotx657 comparetotal -0E2 0.0 -> -1
-cotx658 comparetotal 0E1 0.0 -> 1
-cotx659 comparetotal 0E2 0.0 -> 1
-cotx660 comparetotal -0E1 0 -> -1
-cotx661 comparetotal -0E2 0 -> -1
-cotx662 comparetotal 0E1 0 -> 1
-cotx663 comparetotal 0E2 0 -> 1
-cotx664 comparetotal -0E1 -0E1 -> 0
-cotx665 comparetotal -0E2 -0E1 -> -1
-cotx666 comparetotal 0E1 -0E1 -> 1
-cotx667 comparetotal 0E2 -0E1 -> 1
-cotx668 comparetotal -0E1 -0E2 -> 1
-cotx669 comparetotal -0E2 -0E2 -> 0
-cotx670 comparetotal 0E1 -0E2 -> 1
-cotx671 comparetotal 0E2 -0E2 -> 1
-cotx672 comparetotal -0E1 0E1 -> -1
-cotx673 comparetotal -0E2 0E1 -> -1
-cotx674 comparetotal 0E1 0E1 -> 0
-cotx675 comparetotal 0E2 0E1 -> 1
-cotx676 comparetotal -0E1 0E2 -> -1
-cotx677 comparetotal -0E2 0E2 -> -1
-cotx678 comparetotal 0E1 0E2 -> -1
-cotx679 comparetotal 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-precision: 20
-cotx680 comparetotal 12 12 -> 0
-cotx681 comparetotal 12 12.0 -> 1
-cotx682 comparetotal 12 12.00 -> 1
-cotx683 comparetotal 12 12.000 -> 1
-cotx684 comparetotal 12 12.0000 -> 1
-cotx685 comparetotal 12 12.00000 -> 1
-cotx686 comparetotal 12 12.000000 -> 1
-cotx687 comparetotal 12 12.0000000 -> 1
-cotx688 comparetotal 12 12.00000000 -> 1
-cotx689 comparetotal 12 12.000000000 -> 1
-cotx690 comparetotal 12 12 -> 0
-cotx691 comparetotal 12.0 12 -> -1
-cotx692 comparetotal 12.00 12 -> -1
-cotx693 comparetotal 12.000 12 -> -1
-cotx694 comparetotal 12.0000 12 -> -1
-cotx695 comparetotal 12.00000 12 -> -1
-cotx696 comparetotal 12.000000 12 -> -1
-cotx697 comparetotal 12.0000000 12 -> -1
-cotx698 comparetotal 12.00000000 12 -> -1
-cotx699 comparetotal 12.000000000 12 -> -1
-
--- long operand checks
-maxexponent: 999
-minexponent: -999
-precision: 9
-cotx701 comparetotal 12345678000 1 -> 1
-cotx702 comparetotal 1 12345678000 -> -1
-cotx703 comparetotal 1234567800 1 -> 1
-cotx704 comparetotal 1 1234567800 -> -1
-cotx705 comparetotal 1234567890 1 -> 1
-cotx706 comparetotal 1 1234567890 -> -1
-cotx707 comparetotal 1234567891 1 -> 1
-cotx708 comparetotal 1 1234567891 -> -1
-cotx709 comparetotal 12345678901 1 -> 1
-cotx710 comparetotal 1 12345678901 -> -1
-cotx711 comparetotal 1234567896 1 -> 1
-cotx712 comparetotal 1 1234567896 -> -1
-cotx713 comparetotal -1234567891 1 -> -1
-cotx714 comparetotal 1 -1234567891 -> 1
-cotx715 comparetotal -12345678901 1 -> -1
-cotx716 comparetotal 1 -12345678901 -> 1
-cotx717 comparetotal -1234567896 1 -> -1
-cotx718 comparetotal 1 -1234567896 -> 1
-
-precision: 15
--- same with plenty of precision
-cotx721 comparetotal 12345678000 1 -> 1
-cotx722 comparetotal 1 12345678000 -> -1
-cotx723 comparetotal 1234567800 1 -> 1
-cotx724 comparetotal 1 1234567800 -> -1
-cotx725 comparetotal 1234567890 1 -> 1
-cotx726 comparetotal 1 1234567890 -> -1
-cotx727 comparetotal 1234567891 1 -> 1
-cotx728 comparetotal 1 1234567891 -> -1
-cotx729 comparetotal 12345678901 1 -> 1
-cotx730 comparetotal 1 12345678901 -> -1
-cotx731 comparetotal 1234567896 1 -> 1
-cotx732 comparetotal 1 1234567896 -> -1
-
--- residue cases
-precision: 5
-cotx740 comparetotal 1 0.9999999 -> 1
-cotx741 comparetotal 1 0.999999 -> 1
-cotx742 comparetotal 1 0.99999 -> 1
-cotx743 comparetotal 1 1.0000 -> 1
-cotx744 comparetotal 1 1.00001 -> -1
-cotx745 comparetotal 1 1.000001 -> -1
-cotx746 comparetotal 1 1.0000001 -> -1
-cotx750 comparetotal 0.9999999 1 -> -1
-cotx751 comparetotal 0.999999 1 -> -1
-cotx752 comparetotal 0.99999 1 -> -1
-cotx753 comparetotal 1.0000 1 -> -1
-cotx754 comparetotal 1.00001 1 -> 1
-cotx755 comparetotal 1.000001 1 -> 1
-cotx756 comparetotal 1.0000001 1 -> 1
-
--- a selection of longies
-cotx760 comparetotal -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1
-cotx761 comparetotal -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
-cotx762 comparetotal -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1
-cotx763 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
--- precisions above or below the difference should have no effect
-precision: 11
-cotx764 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 10
-cotx765 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 9
-cotx766 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 8
-cotx767 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 7
-cotx768 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 6
-cotx769 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 5
-cotx770 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 4
-cotx771 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 3
-cotx772 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 2
-cotx773 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-precision: 1
-cotx774 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
-
--- Specials
-precision: 9
-cotx780 comparetotal Inf -Inf -> 1
-cotx781 comparetotal Inf -1000 -> 1
-cotx782 comparetotal Inf -1 -> 1
-cotx783 comparetotal Inf -0 -> 1
-cotx784 comparetotal Inf 0 -> 1
-cotx785 comparetotal Inf 1 -> 1
-cotx786 comparetotal Inf 1000 -> 1
-cotx787 comparetotal Inf Inf -> 0
-cotx788 comparetotal -1000 Inf -> -1
-cotx789 comparetotal -Inf Inf -> -1
-cotx790 comparetotal -1 Inf -> -1
-cotx791 comparetotal -0 Inf -> -1
-cotx792 comparetotal 0 Inf -> -1
-cotx793 comparetotal 1 Inf -> -1
-cotx794 comparetotal 1000 Inf -> -1
-cotx795 comparetotal Inf Inf -> 0
-
-cotx800 comparetotal -Inf -Inf -> 0
-cotx801 comparetotal -Inf -1000 -> -1
-cotx802 comparetotal -Inf -1 -> -1
-cotx803 comparetotal -Inf -0 -> -1
-cotx804 comparetotal -Inf 0 -> -1
-cotx805 comparetotal -Inf 1 -> -1
-cotx806 comparetotal -Inf 1000 -> -1
-cotx807 comparetotal -Inf Inf -> -1
-cotx808 comparetotal -Inf -Inf -> 0
-cotx809 comparetotal -1000 -Inf -> 1
-cotx810 comparetotal -1 -Inf -> 1
-cotx811 comparetotal -0 -Inf -> 1
-cotx812 comparetotal 0 -Inf -> 1
-cotx813 comparetotal 1 -Inf -> 1
-cotx814 comparetotal 1000 -Inf -> 1
-cotx815 comparetotal Inf -Inf -> 1
-
-cotx821 comparetotal NaN -Inf -> 1
-cotx822 comparetotal NaN -1000 -> 1
-cotx823 comparetotal NaN -1 -> 1
-cotx824 comparetotal NaN -0 -> 1
-cotx825 comparetotal NaN 0 -> 1
-cotx826 comparetotal NaN 1 -> 1
-cotx827 comparetotal NaN 1000 -> 1
-cotx828 comparetotal NaN Inf -> 1
-cotx829 comparetotal NaN NaN -> 0
-cotx830 comparetotal -Inf NaN -> -1
-cotx831 comparetotal -1000 NaN -> -1
-cotx832 comparetotal -1 NaN -> -1
-cotx833 comparetotal -0 NaN -> -1
-cotx834 comparetotal 0 NaN -> -1
-cotx835 comparetotal 1 NaN -> -1
-cotx836 comparetotal 1000 NaN -> -1
-cotx837 comparetotal Inf NaN -> -1
-cotx838 comparetotal -NaN -NaN -> 0
-cotx839 comparetotal +NaN -NaN -> 1
-cotx840 comparetotal -NaN +NaN -> -1
-
-cotx841 comparetotal sNaN -sNaN -> 1
-cotx842 comparetotal sNaN -NaN -> 1
-cotx843 comparetotal sNaN -Inf -> 1
-cotx844 comparetotal sNaN -1000 -> 1
-cotx845 comparetotal sNaN -1 -> 1
-cotx846 comparetotal sNaN -0 -> 1
-cotx847 comparetotal sNaN 0 -> 1
-cotx848 comparetotal sNaN 1 -> 1
-cotx849 comparetotal sNaN 1000 -> 1
-cotx850 comparetotal sNaN NaN -> -1
-cotx851 comparetotal sNaN sNaN -> 0
-
-cotx852 comparetotal -sNaN sNaN -> -1
-cotx853 comparetotal -NaN sNaN -> -1
-cotx854 comparetotal -Inf sNaN -> -1
-cotx855 comparetotal -1000 sNaN -> -1
-cotx856 comparetotal -1 sNaN -> -1
-cotx857 comparetotal -0 sNaN -> -1
-cotx858 comparetotal 0 sNaN -> -1
-cotx859 comparetotal 1 sNaN -> -1
-cotx860 comparetotal 1000 sNaN -> -1
-cotx861 comparetotal Inf sNaN -> -1
-cotx862 comparetotal NaN sNaN -> 1
-cotx863 comparetotal sNaN sNaN -> 0
-
-cotx871 comparetotal -sNaN -sNaN -> 0
-cotx872 comparetotal -sNaN -NaN -> 1
-cotx873 comparetotal -sNaN -Inf -> -1
-cotx874 comparetotal -sNaN -1000 -> -1
-cotx875 comparetotal -sNaN -1 -> -1
-cotx876 comparetotal -sNaN -0 -> -1
-cotx877 comparetotal -sNaN 0 -> -1
-cotx878 comparetotal -sNaN 1 -> -1
-cotx879 comparetotal -sNaN 1000 -> -1
-cotx880 comparetotal -sNaN NaN -> -1
-cotx881 comparetotal -sNaN sNaN -> -1
-
-cotx882 comparetotal -sNaN -sNaN -> 0
-cotx883 comparetotal -NaN -sNaN -> -1
-cotx884 comparetotal -Inf -sNaN -> 1
-cotx885 comparetotal -1000 -sNaN -> 1
-cotx886 comparetotal -1 -sNaN -> 1
-cotx887 comparetotal -0 -sNaN -> 1
-cotx888 comparetotal 0 -sNaN -> 1
-cotx889 comparetotal 1 -sNaN -> 1
-cotx890 comparetotal 1000 -sNaN -> 1
-cotx891 comparetotal Inf -sNaN -> 1
-cotx892 comparetotal NaN -sNaN -> 1
-cotx893 comparetotal sNaN -sNaN -> 1
-
--- NaNs with payload
-cotx960 comparetotal NaN9 -Inf -> 1
-cotx961 comparetotal NaN8 999 -> 1
-cotx962 comparetotal NaN77 Inf -> 1
-cotx963 comparetotal -NaN67 NaN5 -> -1
-cotx964 comparetotal -Inf -NaN4 -> 1
-cotx965 comparetotal -999 -NaN33 -> 1
-cotx966 comparetotal Inf NaN2 -> -1
-
-cotx970 comparetotal -NaN41 -NaN42 -> 1
-cotx971 comparetotal +NaN41 -NaN42 -> 1
-cotx972 comparetotal -NaN41 +NaN42 -> -1
-cotx973 comparetotal +NaN41 +NaN42 -> -1
-cotx974 comparetotal -NaN42 -NaN01 -> -1
-cotx975 comparetotal +NaN42 -NaN01 -> 1
-cotx976 comparetotal -NaN42 +NaN01 -> -1
-cotx977 comparetotal +NaN42 +NaN01 -> 1
-
-cotx980 comparetotal -sNaN771 -sNaN772 -> 1
-cotx981 comparetotal +sNaN771 -sNaN772 -> 1
-cotx982 comparetotal -sNaN771 +sNaN772 -> -1
-cotx983 comparetotal +sNaN771 +sNaN772 -> -1
-cotx984 comparetotal -sNaN772 -sNaN771 -> -1
-cotx985 comparetotal +sNaN772 -sNaN771 -> 1
-cotx986 comparetotal -sNaN772 +sNaN771 -> -1
-cotx987 comparetotal +sNaN772 +sNaN771 -> 1
-
-cotx991 comparetotal -sNaN99 -Inf -> -1
-cotx992 comparetotal sNaN98 -11 -> 1
-cotx993 comparetotal sNaN97 NaN -> -1
-cotx994 comparetotal sNaN16 sNaN94 -> -1
-cotx995 comparetotal NaN85 sNaN83 -> 1
-cotx996 comparetotal -Inf sNaN92 -> -1
-cotx997 comparetotal 088 sNaN81 -> -1
-cotx998 comparetotal Inf sNaN90 -> -1
-cotx999 comparetotal NaN -sNaN89 -> 1
-
--- overflow and underflow tests .. subnormal results now allowed
-maxExponent: 999999999
-minexponent: -999999999
-cotx1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1
-cotx1081 comparetotal 9E+999999999 +1.23456789012345E-0 -> 1
-cotx1082 comparetotal +0.100 9E-999999999 -> 1
-cotx1083 comparetotal 9E-999999999 +0.100 -> -1
-cotx1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1
-cotx1086 comparetotal 9E+999999999 -1.23456789012345E-0 -> 1
-cotx1087 comparetotal -0.100 9E-999999999 -> -1
-cotx1088 comparetotal 9E-999999999 -0.100 -> 1
-
-cotx1089 comparetotal 1e-599999999 1e-400000001 -> -1
-cotx1090 comparetotal 1e-599999999 1e-400000000 -> -1
-cotx1091 comparetotal 1e-600000000 1e-400000000 -> -1
-cotx1092 comparetotal 9e-999999998 0.01 -> -1
-cotx1093 comparetotal 9e-999999998 0.1 -> -1
-cotx1094 comparetotal 0.01 9e-999999998 -> 1
-cotx1095 comparetotal 1e599999999 1e400000001 -> 1
-cotx1096 comparetotal 1e599999999 1e400000000 -> 1
-cotx1097 comparetotal 1e600000000 1e400000000 -> 1
-cotx1098 comparetotal 9e999999998 100 -> 1
-cotx1099 comparetotal 9e999999998 10 -> 1
-cotx1100 comparetotal 100 9e999999998 -> -1
--- signs
-cotx1101 comparetotal 1e+777777777 1e+411111111 -> 1
-cotx1102 comparetotal 1e+777777777 -1e+411111111 -> 1
-cotx1103 comparetotal -1e+777777777 1e+411111111 -> -1
-cotx1104 comparetotal -1e+777777777 -1e+411111111 -> -1
-cotx1105 comparetotal 1e-777777777 1e-411111111 -> -1
-cotx1106 comparetotal 1e-777777777 -1e-411111111 -> 1
-cotx1107 comparetotal -1e-777777777 1e-411111111 -> -1
-cotx1108 comparetotal -1e-777777777 -1e-411111111 -> 1
-
--- spread zeros
-cotx1110 comparetotal 0E-383 0 -> -1
-cotx1111 comparetotal 0E-383 -0 -> 1
-cotx1112 comparetotal -0E-383 0 -> -1
-cotx1113 comparetotal -0E-383 -0 -> 1
-cotx1114 comparetotal 0E-383 0E+384 -> -1
-cotx1115 comparetotal 0E-383 -0E+384 -> 1
-cotx1116 comparetotal -0E-383 0E+384 -> -1
-cotx1117 comparetotal -0E-383 -0E+384 -> 1
-cotx1118 comparetotal 0 0E+384 -> -1
-cotx1119 comparetotal 0 -0E+384 -> 1
-cotx1120 comparetotal -0 0E+384 -> -1
-cotx1121 comparetotal -0 -0E+384 -> 1
-
-cotx1130 comparetotal 0E+384 0 -> 1
-cotx1131 comparetotal 0E+384 -0 -> 1
-cotx1132 comparetotal -0E+384 0 -> -1
-cotx1133 comparetotal -0E+384 -0 -> -1
-cotx1134 comparetotal 0E+384 0E-383 -> 1
-cotx1135 comparetotal 0E+384 -0E-383 -> 1
-cotx1136 comparetotal -0E+384 0E-383 -> -1
-cotx1137 comparetotal -0E+384 -0E-383 -> -1
-cotx1138 comparetotal 0 0E-383 -> 1
-cotx1139 comparetotal 0 -0E-383 -> 1
-cotx1140 comparetotal -0 0E-383 -> -1
-cotx1141 comparetotal -0 -0E-383 -> -1
-
--- Null tests
-cotx9990 comparetotal 10 # -> NaN Invalid_operation
-cotx9991 comparetotal # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- comparetotal.decTest -- decimal comparison using total ordering --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+extended: 1
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+-- sanity checks
+cotx001 comparetotal -2 -2 -> 0
+cotx002 comparetotal -2 -1 -> -1
+cotx003 comparetotal -2 0 -> -1
+cotx004 comparetotal -2 1 -> -1
+cotx005 comparetotal -2 2 -> -1
+cotx006 comparetotal -1 -2 -> 1
+cotx007 comparetotal -1 -1 -> 0
+cotx008 comparetotal -1 0 -> -1
+cotx009 comparetotal -1 1 -> -1
+cotx010 comparetotal -1 2 -> -1
+cotx011 comparetotal 0 -2 -> 1
+cotx012 comparetotal 0 -1 -> 1
+cotx013 comparetotal 0 0 -> 0
+cotx014 comparetotal 0 1 -> -1
+cotx015 comparetotal 0 2 -> -1
+cotx016 comparetotal 1 -2 -> 1
+cotx017 comparetotal 1 -1 -> 1
+cotx018 comparetotal 1 0 -> 1
+cotx019 comparetotal 1 1 -> 0
+cotx020 comparetotal 1 2 -> -1
+cotx021 comparetotal 2 -2 -> 1
+cotx022 comparetotal 2 -1 -> 1
+cotx023 comparetotal 2 0 -> 1
+cotx025 comparetotal 2 1 -> 1
+cotx026 comparetotal 2 2 -> 0
+
+cotx031 comparetotal -20 -20 -> 0
+cotx032 comparetotal -20 -10 -> -1
+cotx033 comparetotal -20 00 -> -1
+cotx034 comparetotal -20 10 -> -1
+cotx035 comparetotal -20 20 -> -1
+cotx036 comparetotal -10 -20 -> 1
+cotx037 comparetotal -10 -10 -> 0
+cotx038 comparetotal -10 00 -> -1
+cotx039 comparetotal -10 10 -> -1
+cotx040 comparetotal -10 20 -> -1
+cotx041 comparetotal 00 -20 -> 1
+cotx042 comparetotal 00 -10 -> 1
+cotx043 comparetotal 00 00 -> 0
+cotx044 comparetotal 00 10 -> -1
+cotx045 comparetotal 00 20 -> -1
+cotx046 comparetotal 10 -20 -> 1
+cotx047 comparetotal 10 -10 -> 1
+cotx048 comparetotal 10 00 -> 1
+cotx049 comparetotal 10 10 -> 0
+cotx050 comparetotal 10 20 -> -1
+cotx051 comparetotal 20 -20 -> 1
+cotx052 comparetotal 20 -10 -> 1
+cotx053 comparetotal 20 00 -> 1
+cotx055 comparetotal 20 10 -> 1
+cotx056 comparetotal 20 20 -> 0
+
+cotx061 comparetotal -2.0 -2.0 -> 0
+cotx062 comparetotal -2.0 -1.0 -> -1
+cotx063 comparetotal -2.0 0.0 -> -1
+cotx064 comparetotal -2.0 1.0 -> -1
+cotx065 comparetotal -2.0 2.0 -> -1
+cotx066 comparetotal -1.0 -2.0 -> 1
+cotx067 comparetotal -1.0 -1.0 -> 0
+cotx068 comparetotal -1.0 0.0 -> -1
+cotx069 comparetotal -1.0 1.0 -> -1
+cotx070 comparetotal -1.0 2.0 -> -1
+cotx071 comparetotal 0.0 -2.0 -> 1
+cotx072 comparetotal 0.0 -1.0 -> 1
+cotx073 comparetotal 0.0 0.0 -> 0
+cotx074 comparetotal 0.0 1.0 -> -1
+cotx075 comparetotal 0.0 2.0 -> -1
+cotx076 comparetotal 1.0 -2.0 -> 1
+cotx077 comparetotal 1.0 -1.0 -> 1
+cotx078 comparetotal 1.0 0.0 -> 1
+cotx079 comparetotal 1.0 1.0 -> 0
+cotx080 comparetotal 1.0 2.0 -> -1
+cotx081 comparetotal 2.0 -2.0 -> 1
+cotx082 comparetotal 2.0 -1.0 -> 1
+cotx083 comparetotal 2.0 0.0 -> 1
+cotx085 comparetotal 2.0 1.0 -> 1
+cotx086 comparetotal 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+maxexponent: 999999999
+minexponent: -999999999
+cotx090 comparetotal 9.99999999E+999999999 9.99999999E+999999999 -> 0
+cotx091 comparetotal -9.99999999E+999999999 9.99999999E+999999999 -> -1
+cotx092 comparetotal 9.99999999E+999999999 -9.99999999E+999999999 -> 1
+cotx093 comparetotal -9.99999999E+999999999 -9.99999999E+999999999 -> 0
+
+-- Examples
+cotx094 comparetotal 12.73 127.9 -> -1
+cotx095 comparetotal -127 12 -> -1
+cotx096 comparetotal 12.30 12.3 -> -1
+cotx097 comparetotal 12.30 12.30 -> 0
+cotx098 comparetotal 12.3 12.300 -> 1
+cotx099 comparetotal 12.3 NaN -> -1
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+cotx100 comparetotal 7.0 7.0 -> 0
+cotx101 comparetotal 7.0 7 -> -1
+cotx102 comparetotal 7 7.0 -> 1
+cotx103 comparetotal 7E+0 7.0 -> 1
+cotx104 comparetotal 70E-1 7.0 -> 0
+cotx105 comparetotal 0.7E+1 7 -> 0
+cotx106 comparetotal 70E-1 7 -> -1
+cotx107 comparetotal 7.0 7E+0 -> -1
+cotx108 comparetotal 7.0 70E-1 -> 0
+cotx109 comparetotal 7 0.7E+1 -> 0
+cotx110 comparetotal 7 70E-1 -> 1
+
+cotx120 comparetotal 8.0 7.0 -> 1
+cotx121 comparetotal 8.0 7 -> 1
+cotx122 comparetotal 8 7.0 -> 1
+cotx123 comparetotal 8E+0 7.0 -> 1
+cotx124 comparetotal 80E-1 7.0 -> 1
+cotx125 comparetotal 0.8E+1 7 -> 1
+cotx126 comparetotal 80E-1 7 -> 1
+cotx127 comparetotal 8.0 7E+0 -> 1
+cotx128 comparetotal 8.0 70E-1 -> 1
+cotx129 comparetotal 8 0.7E+1 -> 1
+cotx130 comparetotal 8 70E-1 -> 1
+
+cotx140 comparetotal 8.0 9.0 -> -1
+cotx141 comparetotal 8.0 9 -> -1
+cotx142 comparetotal 8 9.0 -> -1
+cotx143 comparetotal 8E+0 9.0 -> -1
+cotx144 comparetotal 80E-1 9.0 -> -1
+cotx145 comparetotal 0.8E+1 9 -> -1
+cotx146 comparetotal 80E-1 9 -> -1
+cotx147 comparetotal 8.0 9E+0 -> -1
+cotx148 comparetotal 8.0 90E-1 -> -1
+cotx149 comparetotal 8 0.9E+1 -> -1
+cotx150 comparetotal 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+cotx200 comparetotal -7.0 7.0 -> -1
+cotx201 comparetotal -7.0 7 -> -1
+cotx202 comparetotal -7 7.0 -> -1
+cotx203 comparetotal -7E+0 7.0 -> -1
+cotx204 comparetotal -70E-1 7.0 -> -1
+cotx205 comparetotal -0.7E+1 7 -> -1
+cotx206 comparetotal -70E-1 7 -> -1
+cotx207 comparetotal -7.0 7E+0 -> -1
+cotx208 comparetotal -7.0 70E-1 -> -1
+cotx209 comparetotal -7 0.7E+1 -> -1
+cotx210 comparetotal -7 70E-1 -> -1
+
+cotx220 comparetotal -8.0 7.0 -> -1
+cotx221 comparetotal -8.0 7 -> -1
+cotx222 comparetotal -8 7.0 -> -1
+cotx223 comparetotal -8E+0 7.0 -> -1
+cotx224 comparetotal -80E-1 7.0 -> -1
+cotx225 comparetotal -0.8E+1 7 -> -1
+cotx226 comparetotal -80E-1 7 -> -1
+cotx227 comparetotal -8.0 7E+0 -> -1
+cotx228 comparetotal -8.0 70E-1 -> -1
+cotx229 comparetotal -8 0.7E+1 -> -1
+cotx230 comparetotal -8 70E-1 -> -1
+
+cotx240 comparetotal -8.0 9.0 -> -1
+cotx241 comparetotal -8.0 9 -> -1
+cotx242 comparetotal -8 9.0 -> -1
+cotx243 comparetotal -8E+0 9.0 -> -1
+cotx244 comparetotal -80E-1 9.0 -> -1
+cotx245 comparetotal -0.8E+1 9 -> -1
+cotx246 comparetotal -80E-1 9 -> -1
+cotx247 comparetotal -8.0 9E+0 -> -1
+cotx248 comparetotal -8.0 90E-1 -> -1
+cotx249 comparetotal -8 0.9E+1 -> -1
+cotx250 comparetotal -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+cotx300 comparetotal 7.0 -7.0 -> 1
+cotx301 comparetotal 7.0 -7 -> 1
+cotx302 comparetotal 7 -7.0 -> 1
+cotx303 comparetotal 7E+0 -7.0 -> 1
+cotx304 comparetotal 70E-1 -7.0 -> 1
+cotx305 comparetotal .7E+1 -7 -> 1
+cotx306 comparetotal 70E-1 -7 -> 1
+cotx307 comparetotal 7.0 -7E+0 -> 1
+cotx308 comparetotal 7.0 -70E-1 -> 1
+cotx309 comparetotal 7 -.7E+1 -> 1
+cotx310 comparetotal 7 -70E-1 -> 1
+
+cotx320 comparetotal 8.0 -7.0 -> 1
+cotx321 comparetotal 8.0 -7 -> 1
+cotx322 comparetotal 8 -7.0 -> 1
+cotx323 comparetotal 8E+0 -7.0 -> 1
+cotx324 comparetotal 80E-1 -7.0 -> 1
+cotx325 comparetotal .8E+1 -7 -> 1
+cotx326 comparetotal 80E-1 -7 -> 1
+cotx327 comparetotal 8.0 -7E+0 -> 1
+cotx328 comparetotal 8.0 -70E-1 -> 1
+cotx329 comparetotal 8 -.7E+1 -> 1
+cotx330 comparetotal 8 -70E-1 -> 1
+
+cotx340 comparetotal 8.0 -9.0 -> 1
+cotx341 comparetotal 8.0 -9 -> 1
+cotx342 comparetotal 8 -9.0 -> 1
+cotx343 comparetotal 8E+0 -9.0 -> 1
+cotx344 comparetotal 80E-1 -9.0 -> 1
+cotx345 comparetotal .8E+1 -9 -> 1
+cotx346 comparetotal 80E-1 -9 -> 1
+cotx347 comparetotal 8.0 -9E+0 -> 1
+cotx348 comparetotal 8.0 -90E-1 -> 1
+cotx349 comparetotal 8 -.9E+1 -> 1
+cotx350 comparetotal 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+cotx400 comparetotal -7.0 -7.0 -> 0
+cotx401 comparetotal -7.0 -7 -> 1
+cotx402 comparetotal -7 -7.0 -> -1
+cotx403 comparetotal -7E+0 -7.0 -> -1
+cotx404 comparetotal -70E-1 -7.0 -> 0
+cotx405 comparetotal -.7E+1 -7 -> 0
+cotx406 comparetotal -70E-1 -7 -> 1
+cotx407 comparetotal -7.0 -7E+0 -> 1
+cotx408 comparetotal -7.0 -70E-1 -> 0
+cotx409 comparetotal -7 -.7E+1 -> 0
+cotx410 comparetotal -7 -70E-1 -> -1
+
+cotx420 comparetotal -8.0 -7.0 -> -1
+cotx421 comparetotal -8.0 -7 -> -1
+cotx422 comparetotal -8 -7.0 -> -1
+cotx423 comparetotal -8E+0 -7.0 -> -1
+cotx424 comparetotal -80E-1 -7.0 -> -1
+cotx425 comparetotal -.8E+1 -7 -> -1
+cotx426 comparetotal -80E-1 -7 -> -1
+cotx427 comparetotal -8.0 -7E+0 -> -1
+cotx428 comparetotal -8.0 -70E-1 -> -1
+cotx429 comparetotal -8 -.7E+1 -> -1
+cotx430 comparetotal -8 -70E-1 -> -1
+
+cotx440 comparetotal -8.0 -9.0 -> 1
+cotx441 comparetotal -8.0 -9 -> 1
+cotx442 comparetotal -8 -9.0 -> 1
+cotx443 comparetotal -8E+0 -9.0 -> 1
+cotx444 comparetotal -80E-1 -9.0 -> 1
+cotx445 comparetotal -.8E+1 -9 -> 1
+cotx446 comparetotal -80E-1 -9 -> 1
+cotx447 comparetotal -8.0 -9E+0 -> 1
+cotx448 comparetotal -8.0 -90E-1 -> 1
+cotx449 comparetotal -8 -.9E+1 -> 1
+cotx450 comparetotal -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+precision: 40
+cotx470 comparetotal 123.4560000000000000E789 123.456E789 -> -1
+cotx471 comparetotal 123.456000000000000E-89 123.456E-89 -> -1
+cotx472 comparetotal 123.45600000000000E789 123.456E789 -> -1
+cotx473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
+cotx474 comparetotal 123.456000000000E789 123.456E789 -> -1
+cotx475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
+cotx476 comparetotal 123.4560000000E789 123.456E789 -> -1
+cotx477 comparetotal 123.456000000E-89 123.456E-89 -> -1
+cotx478 comparetotal 123.45600000E789 123.456E789 -> -1
+cotx479 comparetotal 123.4560000E-89 123.456E-89 -> -1
+cotx480 comparetotal 123.456000E789 123.456E789 -> -1
+cotx481 comparetotal 123.45600E-89 123.456E-89 -> -1
+cotx482 comparetotal 123.4560E789 123.456E789 -> -1
+cotx483 comparetotal 123.456E-89 123.456E-89 -> 0
+cotx484 comparetotal 123.456E-89 123.4560000000000000E-89 -> 1
+cotx485 comparetotal 123.456E789 123.456000000000000E789 -> 1
+cotx486 comparetotal 123.456E-89 123.45600000000000E-89 -> 1
+cotx487 comparetotal 123.456E789 123.4560000000000E789 -> 1
+cotx488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
+cotx489 comparetotal 123.456E789 123.45600000000E789 -> 1
+cotx490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
+cotx491 comparetotal 123.456E789 123.456000000E789 -> 1
+cotx492 comparetotal 123.456E-89 123.45600000E-89 -> 1
+cotx493 comparetotal 123.456E789 123.4560000E789 -> 1
+cotx494 comparetotal 123.456E-89 123.456000E-89 -> 1
+cotx495 comparetotal 123.456E789 123.45600E789 -> 1
+cotx496 comparetotal 123.456E-89 123.4560E-89 -> 1
+cotx497 comparetotal 123.456E789 123.456E789 -> 0
+
+-- wide-ranging, around precision; signs equal
+precision: 9
+cotx500 comparetotal 1 1E-15 -> 1
+cotx501 comparetotal 1 1E-14 -> 1
+cotx502 comparetotal 1 1E-13 -> 1
+cotx503 comparetotal 1 1E-12 -> 1
+cotx504 comparetotal 1 1E-11 -> 1
+cotx505 comparetotal 1 1E-10 -> 1
+cotx506 comparetotal 1 1E-9 -> 1
+cotx507 comparetotal 1 1E-8 -> 1
+cotx508 comparetotal 1 1E-7 -> 1
+cotx509 comparetotal 1 1E-6 -> 1
+cotx510 comparetotal 1 1E-5 -> 1
+cotx511 comparetotal 1 1E-4 -> 1
+cotx512 comparetotal 1 1E-3 -> 1
+cotx513 comparetotal 1 1E-2 -> 1
+cotx514 comparetotal 1 1E-1 -> 1
+cotx515 comparetotal 1 1E-0 -> 0
+cotx516 comparetotal 1 1E+1 -> -1
+cotx517 comparetotal 1 1E+2 -> -1
+cotx518 comparetotal 1 1E+3 -> -1
+cotx519 comparetotal 1 1E+4 -> -1
+cotx521 comparetotal 1 1E+5 -> -1
+cotx522 comparetotal 1 1E+6 -> -1
+cotx523 comparetotal 1 1E+7 -> -1
+cotx524 comparetotal 1 1E+8 -> -1
+cotx525 comparetotal 1 1E+9 -> -1
+cotx526 comparetotal 1 1E+10 -> -1
+cotx527 comparetotal 1 1E+11 -> -1
+cotx528 comparetotal 1 1E+12 -> -1
+cotx529 comparetotal 1 1E+13 -> -1
+cotx530 comparetotal 1 1E+14 -> -1
+cotx531 comparetotal 1 1E+15 -> -1
+-- LR swap
+cotx540 comparetotal 1E-15 1 -> -1
+cotx541 comparetotal 1E-14 1 -> -1
+cotx542 comparetotal 1E-13 1 -> -1
+cotx543 comparetotal 1E-12 1 -> -1
+cotx544 comparetotal 1E-11 1 -> -1
+cotx545 comparetotal 1E-10 1 -> -1
+cotx546 comparetotal 1E-9 1 -> -1
+cotx547 comparetotal 1E-8 1 -> -1
+cotx548 comparetotal 1E-7 1 -> -1
+cotx549 comparetotal 1E-6 1 -> -1
+cotx550 comparetotal 1E-5 1 -> -1
+cotx551 comparetotal 1E-4 1 -> -1
+cotx552 comparetotal 1E-3 1 -> -1
+cotx553 comparetotal 1E-2 1 -> -1
+cotx554 comparetotal 1E-1 1 -> -1
+cotx555 comparetotal 1E-0 1 -> 0
+cotx556 comparetotal 1E+1 1 -> 1
+cotx557 comparetotal 1E+2 1 -> 1
+cotx558 comparetotal 1E+3 1 -> 1
+cotx559 comparetotal 1E+4 1 -> 1
+cotx561 comparetotal 1E+5 1 -> 1
+cotx562 comparetotal 1E+6 1 -> 1
+cotx563 comparetotal 1E+7 1 -> 1
+cotx564 comparetotal 1E+8 1 -> 1
+cotx565 comparetotal 1E+9 1 -> 1
+cotx566 comparetotal 1E+10 1 -> 1
+cotx567 comparetotal 1E+11 1 -> 1
+cotx568 comparetotal 1E+12 1 -> 1
+cotx569 comparetotal 1E+13 1 -> 1
+cotx570 comparetotal 1E+14 1 -> 1
+cotx571 comparetotal 1E+15 1 -> 1
+-- similar with an useful coefficient, one side only
+cotx580 comparetotal 0.000000987654321 1E-15 -> 1
+cotx581 comparetotal 0.000000987654321 1E-14 -> 1
+cotx582 comparetotal 0.000000987654321 1E-13 -> 1
+cotx583 comparetotal 0.000000987654321 1E-12 -> 1
+cotx584 comparetotal 0.000000987654321 1E-11 -> 1
+cotx585 comparetotal 0.000000987654321 1E-10 -> 1
+cotx586 comparetotal 0.000000987654321 1E-9 -> 1
+cotx587 comparetotal 0.000000987654321 1E-8 -> 1
+cotx588 comparetotal 0.000000987654321 1E-7 -> 1
+cotx589 comparetotal 0.000000987654321 1E-6 -> -1
+cotx590 comparetotal 0.000000987654321 1E-5 -> -1
+cotx591 comparetotal 0.000000987654321 1E-4 -> -1
+cotx592 comparetotal 0.000000987654321 1E-3 -> -1
+cotx593 comparetotal 0.000000987654321 1E-2 -> -1
+cotx594 comparetotal 0.000000987654321 1E-1 -> -1
+cotx595 comparetotal 0.000000987654321 1E-0 -> -1
+cotx596 comparetotal 0.000000987654321 1E+1 -> -1
+cotx597 comparetotal 0.000000987654321 1E+2 -> -1
+cotx598 comparetotal 0.000000987654321 1E+3 -> -1
+cotx599 comparetotal 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+precision: 20
+cotx600 comparetotal 12 12.2345 -> -1
+cotx601 comparetotal 12.0 12.2345 -> -1
+cotx602 comparetotal 12.00 12.2345 -> -1
+cotx603 comparetotal 12.000 12.2345 -> -1
+cotx604 comparetotal 12.0000 12.2345 -> -1
+cotx605 comparetotal 12.00000 12.2345 -> -1
+cotx606 comparetotal 12.000000 12.2345 -> -1
+cotx607 comparetotal 12.0000000 12.2345 -> -1
+cotx608 comparetotal 12.00000000 12.2345 -> -1
+cotx609 comparetotal 12.000000000 12.2345 -> -1
+cotx610 comparetotal 12.1234 12 -> 1
+cotx611 comparetotal 12.1234 12.0 -> 1
+cotx612 comparetotal 12.1234 12.00 -> 1
+cotx613 comparetotal 12.1234 12.000 -> 1
+cotx614 comparetotal 12.1234 12.0000 -> 1
+cotx615 comparetotal 12.1234 12.00000 -> 1
+cotx616 comparetotal 12.1234 12.000000 -> 1
+cotx617 comparetotal 12.1234 12.0000000 -> 1
+cotx618 comparetotal 12.1234 12.00000000 -> 1
+cotx619 comparetotal 12.1234 12.000000000 -> 1
+cotx620 comparetotal -12 -12.2345 -> 1
+cotx621 comparetotal -12.0 -12.2345 -> 1
+cotx622 comparetotal -12.00 -12.2345 -> 1
+cotx623 comparetotal -12.000 -12.2345 -> 1
+cotx624 comparetotal -12.0000 -12.2345 -> 1
+cotx625 comparetotal -12.00000 -12.2345 -> 1
+cotx626 comparetotal -12.000000 -12.2345 -> 1
+cotx627 comparetotal -12.0000000 -12.2345 -> 1
+cotx628 comparetotal -12.00000000 -12.2345 -> 1
+cotx629 comparetotal -12.000000000 -12.2345 -> 1
+cotx630 comparetotal -12.1234 -12 -> -1
+cotx631 comparetotal -12.1234 -12.0 -> -1
+cotx632 comparetotal -12.1234 -12.00 -> -1
+cotx633 comparetotal -12.1234 -12.000 -> -1
+cotx634 comparetotal -12.1234 -12.0000 -> -1
+cotx635 comparetotal -12.1234 -12.00000 -> -1
+cotx636 comparetotal -12.1234 -12.000000 -> -1
+cotx637 comparetotal -12.1234 -12.0000000 -> -1
+cotx638 comparetotal -12.1234 -12.00000000 -> -1
+cotx639 comparetotal -12.1234 -12.000000000 -> -1
+precision: 9
+
+-- extended zeros
+cotx640 comparetotal 0 0 -> 0
+cotx641 comparetotal 0 -0 -> 1
+cotx642 comparetotal 0 -0.0 -> 1
+cotx643 comparetotal 0 0.0 -> 1
+cotx644 comparetotal -0 0 -> -1
+cotx645 comparetotal -0 -0 -> 0
+cotx646 comparetotal -0 -0.0 -> -1
+cotx647 comparetotal -0 0.0 -> -1
+cotx648 comparetotal 0.0 0 -> -1
+cotx649 comparetotal 0.0 -0 -> 1
+cotx650 comparetotal 0.0 -0.0 -> 1
+cotx651 comparetotal 0.0 0.0 -> 0
+cotx652 comparetotal -0.0 0 -> -1
+cotx653 comparetotal -0.0 -0 -> 1
+cotx654 comparetotal -0.0 -0.0 -> 0
+cotx655 comparetotal -0.0 0.0 -> -1
+
+cotx656 comparetotal -0E1 0.0 -> -1
+cotx657 comparetotal -0E2 0.0 -> -1
+cotx658 comparetotal 0E1 0.0 -> 1
+cotx659 comparetotal 0E2 0.0 -> 1
+cotx660 comparetotal -0E1 0 -> -1
+cotx661 comparetotal -0E2 0 -> -1
+cotx662 comparetotal 0E1 0 -> 1
+cotx663 comparetotal 0E2 0 -> 1
+cotx664 comparetotal -0E1 -0E1 -> 0
+cotx665 comparetotal -0E2 -0E1 -> -1
+cotx666 comparetotal 0E1 -0E1 -> 1
+cotx667 comparetotal 0E2 -0E1 -> 1
+cotx668 comparetotal -0E1 -0E2 -> 1
+cotx669 comparetotal -0E2 -0E2 -> 0
+cotx670 comparetotal 0E1 -0E2 -> 1
+cotx671 comparetotal 0E2 -0E2 -> 1
+cotx672 comparetotal -0E1 0E1 -> -1
+cotx673 comparetotal -0E2 0E1 -> -1
+cotx674 comparetotal 0E1 0E1 -> 0
+cotx675 comparetotal 0E2 0E1 -> 1
+cotx676 comparetotal -0E1 0E2 -> -1
+cotx677 comparetotal -0E2 0E2 -> -1
+cotx678 comparetotal 0E1 0E2 -> -1
+cotx679 comparetotal 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+precision: 20
+cotx680 comparetotal 12 12 -> 0
+cotx681 comparetotal 12 12.0 -> 1
+cotx682 comparetotal 12 12.00 -> 1
+cotx683 comparetotal 12 12.000 -> 1
+cotx684 comparetotal 12 12.0000 -> 1
+cotx685 comparetotal 12 12.00000 -> 1
+cotx686 comparetotal 12 12.000000 -> 1
+cotx687 comparetotal 12 12.0000000 -> 1
+cotx688 comparetotal 12 12.00000000 -> 1
+cotx689 comparetotal 12 12.000000000 -> 1
+cotx690 comparetotal 12 12 -> 0
+cotx691 comparetotal 12.0 12 -> -1
+cotx692 comparetotal 12.00 12 -> -1
+cotx693 comparetotal 12.000 12 -> -1
+cotx694 comparetotal 12.0000 12 -> -1
+cotx695 comparetotal 12.00000 12 -> -1
+cotx696 comparetotal 12.000000 12 -> -1
+cotx697 comparetotal 12.0000000 12 -> -1
+cotx698 comparetotal 12.00000000 12 -> -1
+cotx699 comparetotal 12.000000000 12 -> -1
+
+-- long operand checks
+maxexponent: 999
+minexponent: -999
+precision: 9
+cotx701 comparetotal 12345678000 1 -> 1
+cotx702 comparetotal 1 12345678000 -> -1
+cotx703 comparetotal 1234567800 1 -> 1
+cotx704 comparetotal 1 1234567800 -> -1
+cotx705 comparetotal 1234567890 1 -> 1
+cotx706 comparetotal 1 1234567890 -> -1
+cotx707 comparetotal 1234567891 1 -> 1
+cotx708 comparetotal 1 1234567891 -> -1
+cotx709 comparetotal 12345678901 1 -> 1
+cotx710 comparetotal 1 12345678901 -> -1
+cotx711 comparetotal 1234567896 1 -> 1
+cotx712 comparetotal 1 1234567896 -> -1
+cotx713 comparetotal -1234567891 1 -> -1
+cotx714 comparetotal 1 -1234567891 -> 1
+cotx715 comparetotal -12345678901 1 -> -1
+cotx716 comparetotal 1 -12345678901 -> 1
+cotx717 comparetotal -1234567896 1 -> -1
+cotx718 comparetotal 1 -1234567896 -> 1
+
+precision: 15
+-- same with plenty of precision
+cotx721 comparetotal 12345678000 1 -> 1
+cotx722 comparetotal 1 12345678000 -> -1
+cotx723 comparetotal 1234567800 1 -> 1
+cotx724 comparetotal 1 1234567800 -> -1
+cotx725 comparetotal 1234567890 1 -> 1
+cotx726 comparetotal 1 1234567890 -> -1
+cotx727 comparetotal 1234567891 1 -> 1
+cotx728 comparetotal 1 1234567891 -> -1
+cotx729 comparetotal 12345678901 1 -> 1
+cotx730 comparetotal 1 12345678901 -> -1
+cotx731 comparetotal 1234567896 1 -> 1
+cotx732 comparetotal 1 1234567896 -> -1
+
+-- residue cases
+precision: 5
+cotx740 comparetotal 1 0.9999999 -> 1
+cotx741 comparetotal 1 0.999999 -> 1
+cotx742 comparetotal 1 0.99999 -> 1
+cotx743 comparetotal 1 1.0000 -> 1
+cotx744 comparetotal 1 1.00001 -> -1
+cotx745 comparetotal 1 1.000001 -> -1
+cotx746 comparetotal 1 1.0000001 -> -1
+cotx750 comparetotal 0.9999999 1 -> -1
+cotx751 comparetotal 0.999999 1 -> -1
+cotx752 comparetotal 0.99999 1 -> -1
+cotx753 comparetotal 1.0000 1 -> -1
+cotx754 comparetotal 1.00001 1 -> 1
+cotx755 comparetotal 1.000001 1 -> 1
+cotx756 comparetotal 1.0000001 1 -> 1
+
+-- a selection of longies
+cotx760 comparetotal -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1
+cotx761 comparetotal -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
+cotx762 comparetotal -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1
+cotx763 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+-- precisions above or below the difference should have no effect
+precision: 11
+cotx764 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 10
+cotx765 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 9
+cotx766 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 8
+cotx767 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 7
+cotx768 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 6
+cotx769 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 5
+cotx770 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 4
+cotx771 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 3
+cotx772 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 2
+cotx773 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+precision: 1
+cotx774 comparetotal -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
+
+-- Specials
+precision: 9
+cotx780 comparetotal Inf -Inf -> 1
+cotx781 comparetotal Inf -1000 -> 1
+cotx782 comparetotal Inf -1 -> 1
+cotx783 comparetotal Inf -0 -> 1
+cotx784 comparetotal Inf 0 -> 1
+cotx785 comparetotal Inf 1 -> 1
+cotx786 comparetotal Inf 1000 -> 1
+cotx787 comparetotal Inf Inf -> 0
+cotx788 comparetotal -1000 Inf -> -1
+cotx789 comparetotal -Inf Inf -> -1
+cotx790 comparetotal -1 Inf -> -1
+cotx791 comparetotal -0 Inf -> -1
+cotx792 comparetotal 0 Inf -> -1
+cotx793 comparetotal 1 Inf -> -1
+cotx794 comparetotal 1000 Inf -> -1
+cotx795 comparetotal Inf Inf -> 0
+
+cotx800 comparetotal -Inf -Inf -> 0
+cotx801 comparetotal -Inf -1000 -> -1
+cotx802 comparetotal -Inf -1 -> -1
+cotx803 comparetotal -Inf -0 -> -1
+cotx804 comparetotal -Inf 0 -> -1
+cotx805 comparetotal -Inf 1 -> -1
+cotx806 comparetotal -Inf 1000 -> -1
+cotx807 comparetotal -Inf Inf -> -1
+cotx808 comparetotal -Inf -Inf -> 0
+cotx809 comparetotal -1000 -Inf -> 1
+cotx810 comparetotal -1 -Inf -> 1
+cotx811 comparetotal -0 -Inf -> 1
+cotx812 comparetotal 0 -Inf -> 1
+cotx813 comparetotal 1 -Inf -> 1
+cotx814 comparetotal 1000 -Inf -> 1
+cotx815 comparetotal Inf -Inf -> 1
+
+cotx821 comparetotal NaN -Inf -> 1
+cotx822 comparetotal NaN -1000 -> 1
+cotx823 comparetotal NaN -1 -> 1
+cotx824 comparetotal NaN -0 -> 1
+cotx825 comparetotal NaN 0 -> 1
+cotx826 comparetotal NaN 1 -> 1
+cotx827 comparetotal NaN 1000 -> 1
+cotx828 comparetotal NaN Inf -> 1
+cotx829 comparetotal NaN NaN -> 0
+cotx830 comparetotal -Inf NaN -> -1
+cotx831 comparetotal -1000 NaN -> -1
+cotx832 comparetotal -1 NaN -> -1
+cotx833 comparetotal -0 NaN -> -1
+cotx834 comparetotal 0 NaN -> -1
+cotx835 comparetotal 1 NaN -> -1
+cotx836 comparetotal 1000 NaN -> -1
+cotx837 comparetotal Inf NaN -> -1
+cotx838 comparetotal -NaN -NaN -> 0
+cotx839 comparetotal +NaN -NaN -> 1
+cotx840 comparetotal -NaN +NaN -> -1
+
+cotx841 comparetotal sNaN -sNaN -> 1
+cotx842 comparetotal sNaN -NaN -> 1
+cotx843 comparetotal sNaN -Inf -> 1
+cotx844 comparetotal sNaN -1000 -> 1
+cotx845 comparetotal sNaN -1 -> 1
+cotx846 comparetotal sNaN -0 -> 1
+cotx847 comparetotal sNaN 0 -> 1
+cotx848 comparetotal sNaN 1 -> 1
+cotx849 comparetotal sNaN 1000 -> 1
+cotx850 comparetotal sNaN NaN -> -1
+cotx851 comparetotal sNaN sNaN -> 0
+
+cotx852 comparetotal -sNaN sNaN -> -1
+cotx853 comparetotal -NaN sNaN -> -1
+cotx854 comparetotal -Inf sNaN -> -1
+cotx855 comparetotal -1000 sNaN -> -1
+cotx856 comparetotal -1 sNaN -> -1
+cotx857 comparetotal -0 sNaN -> -1
+cotx858 comparetotal 0 sNaN -> -1
+cotx859 comparetotal 1 sNaN -> -1
+cotx860 comparetotal 1000 sNaN -> -1
+cotx861 comparetotal Inf sNaN -> -1
+cotx862 comparetotal NaN sNaN -> 1
+cotx863 comparetotal sNaN sNaN -> 0
+
+cotx871 comparetotal -sNaN -sNaN -> 0
+cotx872 comparetotal -sNaN -NaN -> 1
+cotx873 comparetotal -sNaN -Inf -> -1
+cotx874 comparetotal -sNaN -1000 -> -1
+cotx875 comparetotal -sNaN -1 -> -1
+cotx876 comparetotal -sNaN -0 -> -1
+cotx877 comparetotal -sNaN 0 -> -1
+cotx878 comparetotal -sNaN 1 -> -1
+cotx879 comparetotal -sNaN 1000 -> -1
+cotx880 comparetotal -sNaN NaN -> -1
+cotx881 comparetotal -sNaN sNaN -> -1
+
+cotx882 comparetotal -sNaN -sNaN -> 0
+cotx883 comparetotal -NaN -sNaN -> -1
+cotx884 comparetotal -Inf -sNaN -> 1
+cotx885 comparetotal -1000 -sNaN -> 1
+cotx886 comparetotal -1 -sNaN -> 1
+cotx887 comparetotal -0 -sNaN -> 1
+cotx888 comparetotal 0 -sNaN -> 1
+cotx889 comparetotal 1 -sNaN -> 1
+cotx890 comparetotal 1000 -sNaN -> 1
+cotx891 comparetotal Inf -sNaN -> 1
+cotx892 comparetotal NaN -sNaN -> 1
+cotx893 comparetotal sNaN -sNaN -> 1
+
+-- NaNs with payload
+cotx960 comparetotal NaN9 -Inf -> 1
+cotx961 comparetotal NaN8 999 -> 1
+cotx962 comparetotal NaN77 Inf -> 1
+cotx963 comparetotal -NaN67 NaN5 -> -1
+cotx964 comparetotal -Inf -NaN4 -> 1
+cotx965 comparetotal -999 -NaN33 -> 1
+cotx966 comparetotal Inf NaN2 -> -1
+
+cotx970 comparetotal -NaN41 -NaN42 -> 1
+cotx971 comparetotal +NaN41 -NaN42 -> 1
+cotx972 comparetotal -NaN41 +NaN42 -> -1
+cotx973 comparetotal +NaN41 +NaN42 -> -1
+cotx974 comparetotal -NaN42 -NaN01 -> -1
+cotx975 comparetotal +NaN42 -NaN01 -> 1
+cotx976 comparetotal -NaN42 +NaN01 -> -1
+cotx977 comparetotal +NaN42 +NaN01 -> 1
+
+cotx980 comparetotal -sNaN771 -sNaN772 -> 1
+cotx981 comparetotal +sNaN771 -sNaN772 -> 1
+cotx982 comparetotal -sNaN771 +sNaN772 -> -1
+cotx983 comparetotal +sNaN771 +sNaN772 -> -1
+cotx984 comparetotal -sNaN772 -sNaN771 -> -1
+cotx985 comparetotal +sNaN772 -sNaN771 -> 1
+cotx986 comparetotal -sNaN772 +sNaN771 -> -1
+cotx987 comparetotal +sNaN772 +sNaN771 -> 1
+
+cotx991 comparetotal -sNaN99 -Inf -> -1
+cotx992 comparetotal sNaN98 -11 -> 1
+cotx993 comparetotal sNaN97 NaN -> -1
+cotx994 comparetotal sNaN16 sNaN94 -> -1
+cotx995 comparetotal NaN85 sNaN83 -> 1
+cotx996 comparetotal -Inf sNaN92 -> -1
+cotx997 comparetotal 088 sNaN81 -> -1
+cotx998 comparetotal Inf sNaN90 -> -1
+cotx999 comparetotal NaN -sNaN89 -> 1
+
+-- overflow and underflow tests .. subnormal results now allowed
+maxExponent: 999999999
+minexponent: -999999999
+cotx1080 comparetotal +1.23456789012345E-0 9E+999999999 -> -1
+cotx1081 comparetotal 9E+999999999 +1.23456789012345E-0 -> 1
+cotx1082 comparetotal +0.100 9E-999999999 -> 1
+cotx1083 comparetotal 9E-999999999 +0.100 -> -1
+cotx1085 comparetotal -1.23456789012345E-0 9E+999999999 -> -1
+cotx1086 comparetotal 9E+999999999 -1.23456789012345E-0 -> 1
+cotx1087 comparetotal -0.100 9E-999999999 -> -1
+cotx1088 comparetotal 9E-999999999 -0.100 -> 1
+
+cotx1089 comparetotal 1e-599999999 1e-400000001 -> -1
+cotx1090 comparetotal 1e-599999999 1e-400000000 -> -1
+cotx1091 comparetotal 1e-600000000 1e-400000000 -> -1
+cotx1092 comparetotal 9e-999999998 0.01 -> -1
+cotx1093 comparetotal 9e-999999998 0.1 -> -1
+cotx1094 comparetotal 0.01 9e-999999998 -> 1
+cotx1095 comparetotal 1e599999999 1e400000001 -> 1
+cotx1096 comparetotal 1e599999999 1e400000000 -> 1
+cotx1097 comparetotal 1e600000000 1e400000000 -> 1
+cotx1098 comparetotal 9e999999998 100 -> 1
+cotx1099 comparetotal 9e999999998 10 -> 1
+cotx1100 comparetotal 100 9e999999998 -> -1
+-- signs
+cotx1101 comparetotal 1e+777777777 1e+411111111 -> 1
+cotx1102 comparetotal 1e+777777777 -1e+411111111 -> 1
+cotx1103 comparetotal -1e+777777777 1e+411111111 -> -1
+cotx1104 comparetotal -1e+777777777 -1e+411111111 -> -1
+cotx1105 comparetotal 1e-777777777 1e-411111111 -> -1
+cotx1106 comparetotal 1e-777777777 -1e-411111111 -> 1
+cotx1107 comparetotal -1e-777777777 1e-411111111 -> -1
+cotx1108 comparetotal -1e-777777777 -1e-411111111 -> 1
+
+-- spread zeros
+cotx1110 comparetotal 0E-383 0 -> -1
+cotx1111 comparetotal 0E-383 -0 -> 1
+cotx1112 comparetotal -0E-383 0 -> -1
+cotx1113 comparetotal -0E-383 -0 -> 1
+cotx1114 comparetotal 0E-383 0E+384 -> -1
+cotx1115 comparetotal 0E-383 -0E+384 -> 1
+cotx1116 comparetotal -0E-383 0E+384 -> -1
+cotx1117 comparetotal -0E-383 -0E+384 -> 1
+cotx1118 comparetotal 0 0E+384 -> -1
+cotx1119 comparetotal 0 -0E+384 -> 1
+cotx1120 comparetotal -0 0E+384 -> -1
+cotx1121 comparetotal -0 -0E+384 -> 1
+
+cotx1130 comparetotal 0E+384 0 -> 1
+cotx1131 comparetotal 0E+384 -0 -> 1
+cotx1132 comparetotal -0E+384 0 -> -1
+cotx1133 comparetotal -0E+384 -0 -> -1
+cotx1134 comparetotal 0E+384 0E-383 -> 1
+cotx1135 comparetotal 0E+384 -0E-383 -> 1
+cotx1136 comparetotal -0E+384 0E-383 -> -1
+cotx1137 comparetotal -0E+384 -0E-383 -> -1
+cotx1138 comparetotal 0 0E-383 -> 1
+cotx1139 comparetotal 0 -0E-383 -> 1
+cotx1140 comparetotal -0 0E-383 -> -1
+cotx1141 comparetotal -0 -0E-383 -> -1
+
+-- Null tests
+cotx9990 comparetotal 10 # -> NaN Invalid_operation
+cotx9991 comparetotal # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/comparetotmag.decTest b/Lib/test/decimaltestdata/comparetotmag.decTest
index e87c9f2dbf..cedfdf8843 100644
--- a/Lib/test/decimaltestdata/comparetotmag.decTest
+++ b/Lib/test/decimaltestdata/comparetotmag.decTest
@@ -1,790 +1,790 @@
-------------------------------------------------------------------------
--- comparetotmag.decTest -- decimal comparison, abs. total ordering --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that it cannot be assumed that add/subtract tests cover paths
--- for this operation adequately, here, because the code might be
--- quite different (comparison cannot overflow or underflow, so
--- actual subtractions are not necessary). Similarly, comparetotal
--- will have some radically different paths than compare.
-
-extended: 1
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
--- sanity checks
-ctmx001 comparetotmag -2 -2 -> 0
-ctmx002 comparetotmag -2 -1 -> 1
-ctmx003 comparetotmag -2 0 -> 1
-ctmx004 comparetotmag -2 1 -> 1
-ctmx005 comparetotmag -2 2 -> 0
-ctmx006 comparetotmag -1 -2 -> -1
-ctmx007 comparetotmag -1 -1 -> 0
-ctmx008 comparetotmag -1 0 -> 1
-ctmx009 comparetotmag -1 1 -> 0
-ctmx010 comparetotmag -1 2 -> -1
-ctmx011 comparetotmag 0 -2 -> -1
-ctmx012 comparetotmag 0 -1 -> -1
-ctmx013 comparetotmag 0 0 -> 0
-ctmx014 comparetotmag 0 1 -> -1
-ctmx015 comparetotmag 0 2 -> -1
-ctmx016 comparetotmag 1 -2 -> -1
-ctmx017 comparetotmag 1 -1 -> 0
-ctmx018 comparetotmag 1 0 -> 1
-ctmx019 comparetotmag 1 1 -> 0
-ctmx020 comparetotmag 1 2 -> -1
-ctmx021 comparetotmag 2 -2 -> 0
-ctmx022 comparetotmag 2 -1 -> 1
-ctmx023 comparetotmag 2 0 -> 1
-ctmx025 comparetotmag 2 1 -> 1
-ctmx026 comparetotmag 2 2 -> 0
-
-ctmx031 comparetotmag -20 -20 -> 0
-ctmx032 comparetotmag -20 -10 -> 1
-ctmx033 comparetotmag -20 00 -> 1
-ctmx034 comparetotmag -20 10 -> 1
-ctmx035 comparetotmag -20 20 -> 0
-ctmx036 comparetotmag -10 -20 -> -1
-ctmx037 comparetotmag -10 -10 -> 0
-ctmx038 comparetotmag -10 00 -> 1
-ctmx039 comparetotmag -10 10 -> 0
-ctmx040 comparetotmag -10 20 -> -1
-ctmx041 comparetotmag 00 -20 -> -1
-ctmx042 comparetotmag 00 -10 -> -1
-ctmx043 comparetotmag 00 00 -> 0
-ctmx044 comparetotmag 00 10 -> -1
-ctmx045 comparetotmag 00 20 -> -1
-ctmx046 comparetotmag 10 -20 -> -1
-ctmx047 comparetotmag 10 -10 -> 0
-ctmx048 comparetotmag 10 00 -> 1
-ctmx049 comparetotmag 10 10 -> 0
-ctmx050 comparetotmag 10 20 -> -1
-ctmx051 comparetotmag 20 -20 -> 0
-ctmx052 comparetotmag 20 -10 -> 1
-ctmx053 comparetotmag 20 00 -> 1
-ctmx055 comparetotmag 20 10 -> 1
-ctmx056 comparetotmag 20 20 -> 0
-
-ctmx061 comparetotmag -2.0 -2.0 -> 0
-ctmx062 comparetotmag -2.0 -1.0 -> 1
-ctmx063 comparetotmag -2.0 0.0 -> 1
-ctmx064 comparetotmag -2.0 1.0 -> 1
-ctmx065 comparetotmag -2.0 2.0 -> 0
-ctmx066 comparetotmag -1.0 -2.0 -> -1
-ctmx067 comparetotmag -1.0 -1.0 -> 0
-ctmx068 comparetotmag -1.0 0.0 -> 1
-ctmx069 comparetotmag -1.0 1.0 -> 0
-ctmx070 comparetotmag -1.0 2.0 -> -1
-ctmx071 comparetotmag 0.0 -2.0 -> -1
-ctmx072 comparetotmag 0.0 -1.0 -> -1
-ctmx073 comparetotmag 0.0 0.0 -> 0
-ctmx074 comparetotmag 0.0 1.0 -> -1
-ctmx075 comparetotmag 0.0 2.0 -> -1
-ctmx076 comparetotmag 1.0 -2.0 -> -1
-ctmx077 comparetotmag 1.0 -1.0 -> 0
-ctmx078 comparetotmag 1.0 0.0 -> 1
-ctmx079 comparetotmag 1.0 1.0 -> 0
-ctmx080 comparetotmag 1.0 2.0 -> -1
-ctmx081 comparetotmag 2.0 -2.0 -> 0
-ctmx082 comparetotmag 2.0 -1.0 -> 1
-ctmx083 comparetotmag 2.0 0.0 -> 1
-ctmx085 comparetotmag 2.0 1.0 -> 1
-ctmx086 comparetotmag 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-maxexponent: 999999999
-minexponent: -999999999
-ctmx090 comparetotmag 9.99999999E+999999999 9.99999999E+999999999 -> 0
-ctmx091 comparetotmag -9.99999999E+999999999 9.99999999E+999999999 -> 0
-ctmx092 comparetotmag 9.99999999E+999999999 -9.99999999E+999999999 -> 0
-ctmx093 comparetotmag -9.99999999E+999999999 -9.99999999E+999999999 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-ctmx100 comparetotmag 7.0 7.0 -> 0
-ctmx101 comparetotmag 7.0 7 -> -1
-ctmx102 comparetotmag 7 7.0 -> 1
-ctmx103 comparetotmag 7E+0 7.0 -> 1
-ctmx104 comparetotmag 70E-1 7.0 -> 0
-ctmx105 comparetotmag 0.7E+1 7 -> 0
-ctmx106 comparetotmag 70E-1 7 -> -1
-ctmx107 comparetotmag 7.0 7E+0 -> -1
-ctmx108 comparetotmag 7.0 70E-1 -> 0
-ctmx109 comparetotmag 7 0.7E+1 -> 0
-ctmx110 comparetotmag 7 70E-1 -> 1
-
-ctmx120 comparetotmag 8.0 7.0 -> 1
-ctmx121 comparetotmag 8.0 7 -> 1
-ctmx122 comparetotmag 8 7.0 -> 1
-ctmx123 comparetotmag 8E+0 7.0 -> 1
-ctmx124 comparetotmag 80E-1 7.0 -> 1
-ctmx125 comparetotmag 0.8E+1 7 -> 1
-ctmx126 comparetotmag 80E-1 7 -> 1
-ctmx127 comparetotmag 8.0 7E+0 -> 1
-ctmx128 comparetotmag 8.0 70E-1 -> 1
-ctmx129 comparetotmag 8 0.7E+1 -> 1
-ctmx130 comparetotmag 8 70E-1 -> 1
-
-ctmx140 comparetotmag 8.0 9.0 -> -1
-ctmx141 comparetotmag 8.0 9 -> -1
-ctmx142 comparetotmag 8 9.0 -> -1
-ctmx143 comparetotmag 8E+0 9.0 -> -1
-ctmx144 comparetotmag 80E-1 9.0 -> -1
-ctmx145 comparetotmag 0.8E+1 9 -> -1
-ctmx146 comparetotmag 80E-1 9 -> -1
-ctmx147 comparetotmag 8.0 9E+0 -> -1
-ctmx148 comparetotmag 8.0 90E-1 -> -1
-ctmx149 comparetotmag 8 0.9E+1 -> -1
-ctmx150 comparetotmag 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ctmx200 comparetotmag -7.0 7.0 -> 0
-ctmx201 comparetotmag -7.0 7 -> -1
-ctmx202 comparetotmag -7 7.0 -> 1
-ctmx203 comparetotmag -7E+0 7.0 -> 1
-ctmx204 comparetotmag -70E-1 7.0 -> 0
-ctmx205 comparetotmag -0.7E+1 7 -> 0
-ctmx206 comparetotmag -70E-1 7 -> -1
-ctmx207 comparetotmag -7.0 7E+0 -> -1
-ctmx208 comparetotmag -7.0 70E-1 -> 0
-ctmx209 comparetotmag -7 0.7E+1 -> 0
-ctmx210 comparetotmag -7 70E-1 -> 1
-
-ctmx220 comparetotmag -8.0 7.0 -> 1
-ctmx221 comparetotmag -8.0 7 -> 1
-ctmx222 comparetotmag -8 7.0 -> 1
-ctmx223 comparetotmag -8E+0 7.0 -> 1
-ctmx224 comparetotmag -80E-1 7.0 -> 1
-ctmx225 comparetotmag -0.8E+1 7 -> 1
-ctmx226 comparetotmag -80E-1 7 -> 1
-ctmx227 comparetotmag -8.0 7E+0 -> 1
-ctmx228 comparetotmag -8.0 70E-1 -> 1
-ctmx229 comparetotmag -8 0.7E+1 -> 1
-ctmx230 comparetotmag -8 70E-1 -> 1
-
-ctmx240 comparetotmag -8.0 9.0 -> -1
-ctmx241 comparetotmag -8.0 9 -> -1
-ctmx242 comparetotmag -8 9.0 -> -1
-ctmx243 comparetotmag -8E+0 9.0 -> -1
-ctmx244 comparetotmag -80E-1 9.0 -> -1
-ctmx245 comparetotmag -0.8E+1 9 -> -1
-ctmx246 comparetotmag -80E-1 9 -> -1
-ctmx247 comparetotmag -8.0 9E+0 -> -1
-ctmx248 comparetotmag -8.0 90E-1 -> -1
-ctmx249 comparetotmag -8 0.9E+1 -> -1
-ctmx250 comparetotmag -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ctmx300 comparetotmag 7.0 -7.0 -> 0
-ctmx301 comparetotmag 7.0 -7 -> -1
-ctmx302 comparetotmag 7 -7.0 -> 1
-ctmx303 comparetotmag 7E+0 -7.0 -> 1
-ctmx304 comparetotmag 70E-1 -7.0 -> 0
-ctmx305 comparetotmag .7E+1 -7 -> 0
-ctmx306 comparetotmag 70E-1 -7 -> -1
-ctmx307 comparetotmag 7.0 -7E+0 -> -1
-ctmx308 comparetotmag 7.0 -70E-1 -> 0
-ctmx309 comparetotmag 7 -.7E+1 -> 0
-ctmx310 comparetotmag 7 -70E-1 -> 1
-
-ctmx320 comparetotmag 8.0 -7.0 -> 1
-ctmx321 comparetotmag 8.0 -7 -> 1
-ctmx322 comparetotmag 8 -7.0 -> 1
-ctmx323 comparetotmag 8E+0 -7.0 -> 1
-ctmx324 comparetotmag 80E-1 -7.0 -> 1
-ctmx325 comparetotmag .8E+1 -7 -> 1
-ctmx326 comparetotmag 80E-1 -7 -> 1
-ctmx327 comparetotmag 8.0 -7E+0 -> 1
-ctmx328 comparetotmag 8.0 -70E-1 -> 1
-ctmx329 comparetotmag 8 -.7E+1 -> 1
-ctmx330 comparetotmag 8 -70E-1 -> 1
-
-ctmx340 comparetotmag 8.0 -9.0 -> -1
-ctmx341 comparetotmag 8.0 -9 -> -1
-ctmx342 comparetotmag 8 -9.0 -> -1
-ctmx343 comparetotmag 8E+0 -9.0 -> -1
-ctmx344 comparetotmag 80E-1 -9.0 -> -1
-ctmx345 comparetotmag .8E+1 -9 -> -1
-ctmx346 comparetotmag 80E-1 -9 -> -1
-ctmx347 comparetotmag 8.0 -9E+0 -> -1
-ctmx348 comparetotmag 8.0 -90E-1 -> -1
-ctmx349 comparetotmag 8 -.9E+1 -> -1
-ctmx350 comparetotmag 8 -90E-1 -> -1
-
--- and again, with sign changes -- ..
-ctmx400 comparetotmag -7.0 -7.0 -> 0
-ctmx401 comparetotmag -7.0 -7 -> -1
-ctmx402 comparetotmag -7 -7.0 -> 1
-ctmx403 comparetotmag -7E+0 -7.0 -> 1
-ctmx404 comparetotmag -70E-1 -7.0 -> 0
-ctmx405 comparetotmag -.7E+1 -7 -> 0
-ctmx406 comparetotmag -70E-1 -7 -> -1
-ctmx407 comparetotmag -7.0 -7E+0 -> -1
-ctmx408 comparetotmag -7.0 -70E-1 -> 0
-ctmx409 comparetotmag -7 -.7E+1 -> 0
-ctmx410 comparetotmag -7 -70E-1 -> 1
-
-ctmx420 comparetotmag -8.0 -7.0 -> 1
-ctmx421 comparetotmag -8.0 -7 -> 1
-ctmx422 comparetotmag -8 -7.0 -> 1
-ctmx423 comparetotmag -8E+0 -7.0 -> 1
-ctmx424 comparetotmag -80E-1 -7.0 -> 1
-ctmx425 comparetotmag -.8E+1 -7 -> 1
-ctmx426 comparetotmag -80E-1 -7 -> 1
-ctmx427 comparetotmag -8.0 -7E+0 -> 1
-ctmx428 comparetotmag -8.0 -70E-1 -> 1
-ctmx429 comparetotmag -8 -.7E+1 -> 1
-ctmx430 comparetotmag -8 -70E-1 -> 1
-
-ctmx440 comparetotmag -8.0 -9.0 -> -1
-ctmx441 comparetotmag -8.0 -9 -> -1
-ctmx442 comparetotmag -8 -9.0 -> -1
-ctmx443 comparetotmag -8E+0 -9.0 -> -1
-ctmx444 comparetotmag -80E-1 -9.0 -> -1
-ctmx445 comparetotmag -.8E+1 -9 -> -1
-ctmx446 comparetotmag -80E-1 -9 -> -1
-ctmx447 comparetotmag -8.0 -9E+0 -> -1
-ctmx448 comparetotmag -8.0 -90E-1 -> -1
-ctmx449 comparetotmag -8 -.9E+1 -> -1
-ctmx450 comparetotmag -8 -90E-1 -> -1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-precision: 40
-ctmx470 comparetotmag 123.4560000000000000E789 123.456E789 -> -1
-ctmx471 comparetotmag 123.456000000000000E-89 123.456E-89 -> -1
-ctmx472 comparetotmag 123.45600000000000E789 123.456E789 -> -1
-ctmx473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
-ctmx474 comparetotmag 123.456000000000E789 123.456E789 -> -1
-ctmx475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
-ctmx476 comparetotmag 123.4560000000E789 123.456E789 -> -1
-ctmx477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
-ctmx478 comparetotmag 123.45600000E789 123.456E789 -> -1
-ctmx479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
-ctmx480 comparetotmag 123.456000E789 123.456E789 -> -1
-ctmx481 comparetotmag 123.45600E-89 123.456E-89 -> -1
-ctmx482 comparetotmag 123.4560E789 123.456E789 -> -1
-ctmx483 comparetotmag 123.456E-89 123.456E-89 -> 0
-ctmx484 comparetotmag 123.456E-89 123.4560000000000000E-89 -> 1
-ctmx485 comparetotmag 123.456E789 123.456000000000000E789 -> 1
-ctmx486 comparetotmag 123.456E-89 123.45600000000000E-89 -> 1
-ctmx487 comparetotmag 123.456E789 123.4560000000000E789 -> 1
-ctmx488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
-ctmx489 comparetotmag 123.456E789 123.45600000000E789 -> 1
-ctmx490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
-ctmx491 comparetotmag 123.456E789 123.456000000E789 -> 1
-ctmx492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
-ctmx493 comparetotmag 123.456E789 123.4560000E789 -> 1
-ctmx494 comparetotmag 123.456E-89 123.456000E-89 -> 1
-ctmx495 comparetotmag 123.456E789 123.45600E789 -> 1
-ctmx496 comparetotmag 123.456E-89 123.4560E-89 -> 1
-ctmx497 comparetotmag 123.456E789 123.456E789 -> 0
-
--- wide-ranging, around precision; signs equal
-precision: 9
-ctmx500 comparetotmag 1 1E-15 -> 1
-ctmx501 comparetotmag 1 1E-14 -> 1
-ctmx502 comparetotmag 1 1E-13 -> 1
-ctmx503 comparetotmag 1 1E-12 -> 1
-ctmx504 comparetotmag 1 1E-11 -> 1
-ctmx505 comparetotmag 1 1E-10 -> 1
-ctmx506 comparetotmag 1 1E-9 -> 1
-ctmx507 comparetotmag 1 1E-8 -> 1
-ctmx508 comparetotmag 1 1E-7 -> 1
-ctmx509 comparetotmag 1 1E-6 -> 1
-ctmx510 comparetotmag 1 1E-5 -> 1
-ctmx511 comparetotmag 1 1E-4 -> 1
-ctmx512 comparetotmag 1 1E-3 -> 1
-ctmx513 comparetotmag 1 1E-2 -> 1
-ctmx514 comparetotmag 1 1E-1 -> 1
-ctmx515 comparetotmag 1 1E-0 -> 0
-ctmx516 comparetotmag 1 1E+1 -> -1
-ctmx517 comparetotmag 1 1E+2 -> -1
-ctmx518 comparetotmag 1 1E+3 -> -1
-ctmx519 comparetotmag 1 1E+4 -> -1
-ctmx521 comparetotmag 1 1E+5 -> -1
-ctmx522 comparetotmag 1 1E+6 -> -1
-ctmx523 comparetotmag 1 1E+7 -> -1
-ctmx524 comparetotmag 1 1E+8 -> -1
-ctmx525 comparetotmag 1 1E+9 -> -1
-ctmx526 comparetotmag 1 1E+10 -> -1
-ctmx527 comparetotmag 1 1E+11 -> -1
-ctmx528 comparetotmag 1 1E+12 -> -1
-ctmx529 comparetotmag 1 1E+13 -> -1
-ctmx530 comparetotmag 1 1E+14 -> -1
-ctmx531 comparetotmag 1 1E+15 -> -1
--- LR swap
-ctmx540 comparetotmag 1E-15 1 -> -1
-ctmx541 comparetotmag 1E-14 1 -> -1
-ctmx542 comparetotmag 1E-13 1 -> -1
-ctmx543 comparetotmag 1E-12 1 -> -1
-ctmx544 comparetotmag 1E-11 1 -> -1
-ctmx545 comparetotmag 1E-10 1 -> -1
-ctmx546 comparetotmag 1E-9 1 -> -1
-ctmx547 comparetotmag 1E-8 1 -> -1
-ctmx548 comparetotmag 1E-7 1 -> -1
-ctmx549 comparetotmag 1E-6 1 -> -1
-ctmx550 comparetotmag 1E-5 1 -> -1
-ctmx551 comparetotmag 1E-4 1 -> -1
-ctmx552 comparetotmag 1E-3 1 -> -1
-ctmx553 comparetotmag 1E-2 1 -> -1
-ctmx554 comparetotmag 1E-1 1 -> -1
-ctmx555 comparetotmag 1E-0 1 -> 0
-ctmx556 comparetotmag 1E+1 1 -> 1
-ctmx557 comparetotmag 1E+2 1 -> 1
-ctmx558 comparetotmag 1E+3 1 -> 1
-ctmx559 comparetotmag 1E+4 1 -> 1
-ctmx561 comparetotmag 1E+5 1 -> 1
-ctmx562 comparetotmag 1E+6 1 -> 1
-ctmx563 comparetotmag 1E+7 1 -> 1
-ctmx564 comparetotmag 1E+8 1 -> 1
-ctmx565 comparetotmag 1E+9 1 -> 1
-ctmx566 comparetotmag 1E+10 1 -> 1
-ctmx567 comparetotmag 1E+11 1 -> 1
-ctmx568 comparetotmag 1E+12 1 -> 1
-ctmx569 comparetotmag 1E+13 1 -> 1
-ctmx570 comparetotmag 1E+14 1 -> 1
-ctmx571 comparetotmag 1E+15 1 -> 1
--- similar with an useful coefficient, one side only
-ctmx580 comparetotmag 0.000000987654321 1E-15 -> 1
-ctmx581 comparetotmag 0.000000987654321 1E-14 -> 1
-ctmx582 comparetotmag 0.000000987654321 1E-13 -> 1
-ctmx583 comparetotmag 0.000000987654321 1E-12 -> 1
-ctmx584 comparetotmag 0.000000987654321 1E-11 -> 1
-ctmx585 comparetotmag 0.000000987654321 1E-10 -> 1
-ctmx586 comparetotmag 0.000000987654321 1E-9 -> 1
-ctmx587 comparetotmag 0.000000987654321 1E-8 -> 1
-ctmx588 comparetotmag 0.000000987654321 1E-7 -> 1
-ctmx589 comparetotmag 0.000000987654321 1E-6 -> -1
-ctmx590 comparetotmag 0.000000987654321 1E-5 -> -1
-ctmx591 comparetotmag 0.000000987654321 1E-4 -> -1
-ctmx592 comparetotmag 0.000000987654321 1E-3 -> -1
-ctmx593 comparetotmag 0.000000987654321 1E-2 -> -1
-ctmx594 comparetotmag 0.000000987654321 1E-1 -> -1
-ctmx595 comparetotmag 0.000000987654321 1E-0 -> -1
-ctmx596 comparetotmag 0.000000987654321 1E+1 -> -1
-ctmx597 comparetotmag 0.000000987654321 1E+2 -> -1
-ctmx598 comparetotmag 0.000000987654321 1E+3 -> -1
-ctmx599 comparetotmag 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-precision: 20
-ctmx600 comparetotmag 12 12.2345 -> -1
-ctmx601 comparetotmag 12.0 12.2345 -> -1
-ctmx602 comparetotmag 12.00 12.2345 -> -1
-ctmx603 comparetotmag 12.000 12.2345 -> -1
-ctmx604 comparetotmag 12.0000 12.2345 -> -1
-ctmx605 comparetotmag 12.00000 12.2345 -> -1
-ctmx606 comparetotmag 12.000000 12.2345 -> -1
-ctmx607 comparetotmag 12.0000000 12.2345 -> -1
-ctmx608 comparetotmag 12.00000000 12.2345 -> -1
-ctmx609 comparetotmag 12.000000000 12.2345 -> -1
-ctmx610 comparetotmag 12.1234 12 -> 1
-ctmx611 comparetotmag 12.1234 12.0 -> 1
-ctmx612 comparetotmag 12.1234 12.00 -> 1
-ctmx613 comparetotmag 12.1234 12.000 -> 1
-ctmx614 comparetotmag 12.1234 12.0000 -> 1
-ctmx615 comparetotmag 12.1234 12.00000 -> 1
-ctmx616 comparetotmag 12.1234 12.000000 -> 1
-ctmx617 comparetotmag 12.1234 12.0000000 -> 1
-ctmx618 comparetotmag 12.1234 12.00000000 -> 1
-ctmx619 comparetotmag 12.1234 12.000000000 -> 1
-ctmx620 comparetotmag -12 -12.2345 -> -1
-ctmx621 comparetotmag -12.0 -12.2345 -> -1
-ctmx622 comparetotmag -12.00 -12.2345 -> -1
-ctmx623 comparetotmag -12.000 -12.2345 -> -1
-ctmx624 comparetotmag -12.0000 -12.2345 -> -1
-ctmx625 comparetotmag -12.00000 -12.2345 -> -1
-ctmx626 comparetotmag -12.000000 -12.2345 -> -1
-ctmx627 comparetotmag -12.0000000 -12.2345 -> -1
-ctmx628 comparetotmag -12.00000000 -12.2345 -> -1
-ctmx629 comparetotmag -12.000000000 -12.2345 -> -1
-ctmx630 comparetotmag -12.1234 -12 -> 1
-ctmx631 comparetotmag -12.1234 -12.0 -> 1
-ctmx632 comparetotmag -12.1234 -12.00 -> 1
-ctmx633 comparetotmag -12.1234 -12.000 -> 1
-ctmx634 comparetotmag -12.1234 -12.0000 -> 1
-ctmx635 comparetotmag -12.1234 -12.00000 -> 1
-ctmx636 comparetotmag -12.1234 -12.000000 -> 1
-ctmx637 comparetotmag -12.1234 -12.0000000 -> 1
-ctmx638 comparetotmag -12.1234 -12.00000000 -> 1
-ctmx639 comparetotmag -12.1234 -12.000000000 -> 1
-precision: 9
-
--- extended zeros
-ctmx640 comparetotmag 0 0 -> 0
-ctmx641 comparetotmag 0 -0 -> 0
-ctmx642 comparetotmag 0 -0.0 -> 1
-ctmx643 comparetotmag 0 0.0 -> 1
-ctmx644 comparetotmag -0 0 -> 0
-ctmx645 comparetotmag -0 -0 -> 0
-ctmx646 comparetotmag -0 -0.0 -> 1
-ctmx647 comparetotmag -0 0.0 -> 1
-ctmx648 comparetotmag 0.0 0 -> -1
-ctmx649 comparetotmag 0.0 -0 -> -1
-ctmx650 comparetotmag 0.0 -0.0 -> 0
-ctmx651 comparetotmag 0.0 0.0 -> 0
-ctmx652 comparetotmag -0.0 0 -> -1
-ctmx653 comparetotmag -0.0 -0 -> -1
-ctmx654 comparetotmag -0.0 -0.0 -> 0
-ctmx655 comparetotmag -0.0 0.0 -> 0
-
-ctmx656 comparetotmag -0E1 0.0 -> 1
-ctmx657 comparetotmag -0E2 0.0 -> 1
-ctmx658 comparetotmag 0E1 0.0 -> 1
-ctmx659 comparetotmag 0E2 0.0 -> 1
-ctmx660 comparetotmag -0E1 0 -> 1
-ctmx661 comparetotmag -0E2 0 -> 1
-ctmx662 comparetotmag 0E1 0 -> 1
-ctmx663 comparetotmag 0E2 0 -> 1
-ctmx664 comparetotmag -0E1 -0E1 -> 0
-ctmx665 comparetotmag -0E2 -0E1 -> 1
-ctmx666 comparetotmag 0E1 -0E1 -> 0
-ctmx667 comparetotmag 0E2 -0E1 -> 1
-ctmx668 comparetotmag -0E1 -0E2 -> -1
-ctmx669 comparetotmag -0E2 -0E2 -> 0
-ctmx670 comparetotmag 0E1 -0E2 -> -1
-ctmx671 comparetotmag 0E2 -0E2 -> 0
-ctmx672 comparetotmag -0E1 0E1 -> 0
-ctmx673 comparetotmag -0E2 0E1 -> 1
-ctmx674 comparetotmag 0E1 0E1 -> 0
-ctmx675 comparetotmag 0E2 0E1 -> 1
-ctmx676 comparetotmag -0E1 0E2 -> -1
-ctmx677 comparetotmag -0E2 0E2 -> 0
-ctmx678 comparetotmag 0E1 0E2 -> -1
-ctmx679 comparetotmag 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-precision: 20
-ctmx680 comparetotmag 12 12 -> 0
-ctmx681 comparetotmag 12 12.0 -> 1
-ctmx682 comparetotmag 12 12.00 -> 1
-ctmx683 comparetotmag 12 12.000 -> 1
-ctmx684 comparetotmag 12 12.0000 -> 1
-ctmx685 comparetotmag 12 12.00000 -> 1
-ctmx686 comparetotmag 12 12.000000 -> 1
-ctmx687 comparetotmag 12 12.0000000 -> 1
-ctmx688 comparetotmag 12 12.00000000 -> 1
-ctmx689 comparetotmag 12 12.000000000 -> 1
-ctmx690 comparetotmag 12 12 -> 0
-ctmx691 comparetotmag 12.0 12 -> -1
-ctmx692 comparetotmag 12.00 12 -> -1
-ctmx693 comparetotmag 12.000 12 -> -1
-ctmx694 comparetotmag 12.0000 12 -> -1
-ctmx695 comparetotmag 12.00000 12 -> -1
-ctmx696 comparetotmag 12.000000 12 -> -1
-ctmx697 comparetotmag 12.0000000 12 -> -1
-ctmx698 comparetotmag 12.00000000 12 -> -1
-ctmx699 comparetotmag 12.000000000 12 -> -1
-
--- long operand checks
-maxexponent: 999
-minexponent: -999
-precision: 9
-ctmx701 comparetotmag 12345678000 1 -> 1
-ctmx702 comparetotmag 1 12345678000 -> -1
-ctmx703 comparetotmag 1234567800 1 -> 1
-ctmx704 comparetotmag 1 1234567800 -> -1
-ctmx705 comparetotmag 1234567890 1 -> 1
-ctmx706 comparetotmag 1 1234567890 -> -1
-ctmx707 comparetotmag 1234567891 1 -> 1
-ctmx708 comparetotmag 1 1234567891 -> -1
-ctmx709 comparetotmag 12345678901 1 -> 1
-ctmx710 comparetotmag 1 12345678901 -> -1
-ctmx711 comparetotmag 1234567896 1 -> 1
-ctmx712 comparetotmag 1 1234567896 -> -1
-ctmx713 comparetotmag -1234567891 1 -> 1
-ctmx714 comparetotmag 1 -1234567891 -> -1
-ctmx715 comparetotmag -12345678901 1 -> 1
-ctmx716 comparetotmag 1 -12345678901 -> -1
-ctmx717 comparetotmag -1234567896 1 -> 1
-ctmx718 comparetotmag 1 -1234567896 -> -1
-
-precision: 15
--- same with plenty of precision
-ctmx721 comparetotmag 12345678000 1 -> 1
-ctmx722 comparetotmag 1 12345678000 -> -1
-ctmx723 comparetotmag 1234567800 1 -> 1
-ctmx724 comparetotmag 1 1234567800 -> -1
-ctmx725 comparetotmag 1234567890 1 -> 1
-ctmx726 comparetotmag 1 1234567890 -> -1
-ctmx727 comparetotmag 1234567891 1 -> 1
-ctmx728 comparetotmag 1 1234567891 -> -1
-ctmx729 comparetotmag 12345678901 1 -> 1
-ctmx730 comparetotmag 1 12345678901 -> -1
-ctmx731 comparetotmag 1234567896 1 -> 1
-ctmx732 comparetotmag 1 1234567896 -> -1
-
--- residue cases
-precision: 5
-ctmx740 comparetotmag 1 0.9999999 -> 1
-ctmx741 comparetotmag 1 0.999999 -> 1
-ctmx742 comparetotmag 1 0.99999 -> 1
-ctmx743 comparetotmag 1 1.0000 -> 1
-ctmx744 comparetotmag 1 1.00001 -> -1
-ctmx745 comparetotmag 1 1.000001 -> -1
-ctmx746 comparetotmag 1 1.0000001 -> -1
-ctmx750 comparetotmag 0.9999999 1 -> -1
-ctmx751 comparetotmag 0.999999 1 -> -1
-ctmx752 comparetotmag 0.99999 1 -> -1
-ctmx753 comparetotmag 1.0000 1 -> -1
-ctmx754 comparetotmag 1.00001 1 -> 1
-ctmx755 comparetotmag 1.000001 1 -> 1
-ctmx756 comparetotmag 1.0000001 1 -> 1
-
--- a selection of longies
-ctmx760 comparetotmag -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> 1
-ctmx761 comparetotmag -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
-ctmx762 comparetotmag -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> 1
-ctmx763 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
--- precisions above or below the difference should have no effect
-precision: 11
-ctmx764 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 10
-ctmx765 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 9
-ctmx766 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 8
-ctmx767 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 7
-ctmx768 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 6
-ctmx769 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 5
-ctmx770 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 4
-ctmx771 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 3
-ctmx772 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 2
-ctmx773 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-precision: 1
-ctmx774 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
-
--- Specials
-precision: 9
-ctmx780 comparetotmag Inf -Inf -> 0
-ctmx781 comparetotmag Inf -1000 -> 1
-ctmx782 comparetotmag Inf -1 -> 1
-ctmx783 comparetotmag Inf -0 -> 1
-ctmx784 comparetotmag Inf 0 -> 1
-ctmx785 comparetotmag Inf 1 -> 1
-ctmx786 comparetotmag Inf 1000 -> 1
-ctmx787 comparetotmag Inf Inf -> 0
-ctmx788 comparetotmag -1000 Inf -> -1
-ctmx789 comparetotmag -Inf Inf -> 0
-ctmx790 comparetotmag -1 Inf -> -1
-ctmx791 comparetotmag -0 Inf -> -1
-ctmx792 comparetotmag 0 Inf -> -1
-ctmx793 comparetotmag 1 Inf -> -1
-ctmx794 comparetotmag 1000 Inf -> -1
-ctmx795 comparetotmag Inf Inf -> 0
-
-ctmx800 comparetotmag -Inf -Inf -> 0
-ctmx801 comparetotmag -Inf -1000 -> 1
-ctmx802 comparetotmag -Inf -1 -> 1
-ctmx803 comparetotmag -Inf -0 -> 1
-ctmx804 comparetotmag -Inf 0 -> 1
-ctmx805 comparetotmag -Inf 1 -> 1
-ctmx806 comparetotmag -Inf 1000 -> 1
-ctmx807 comparetotmag -Inf Inf -> 0
-ctmx808 comparetotmag -Inf -Inf -> 0
-ctmx809 comparetotmag -1000 -Inf -> -1
-ctmx810 comparetotmag -1 -Inf -> -1
-ctmx811 comparetotmag -0 -Inf -> -1
-ctmx812 comparetotmag 0 -Inf -> -1
-ctmx813 comparetotmag 1 -Inf -> -1
-ctmx814 comparetotmag 1000 -Inf -> -1
-ctmx815 comparetotmag Inf -Inf -> 0
-
-ctmx821 comparetotmag NaN -Inf -> 1
-ctmx822 comparetotmag NaN -1000 -> 1
-ctmx823 comparetotmag NaN -1 -> 1
-ctmx824 comparetotmag NaN -0 -> 1
-ctmx825 comparetotmag NaN 0 -> 1
-ctmx826 comparetotmag NaN 1 -> 1
-ctmx827 comparetotmag NaN 1000 -> 1
-ctmx828 comparetotmag NaN Inf -> 1
-ctmx829 comparetotmag NaN NaN -> 0
-ctmx830 comparetotmag -Inf NaN -> -1
-ctmx831 comparetotmag -1000 NaN -> -1
-ctmx832 comparetotmag -1 NaN -> -1
-ctmx833 comparetotmag -0 NaN -> -1
-ctmx834 comparetotmag 0 NaN -> -1
-ctmx835 comparetotmag 1 NaN -> -1
-ctmx836 comparetotmag 1000 NaN -> -1
-ctmx837 comparetotmag Inf NaN -> -1
-ctmx838 comparetotmag -NaN -NaN -> 0
-ctmx839 comparetotmag +NaN -NaN -> 0
-ctmx840 comparetotmag -NaN +NaN -> 0
-
-ctmx841 comparetotmag sNaN -sNaN -> 0
-ctmx842 comparetotmag sNaN -NaN -> -1
-ctmx843 comparetotmag sNaN -Inf -> 1
-ctmx844 comparetotmag sNaN -1000 -> 1
-ctmx845 comparetotmag sNaN -1 -> 1
-ctmx846 comparetotmag sNaN -0 -> 1
-ctmx847 comparetotmag sNaN 0 -> 1
-ctmx848 comparetotmag sNaN 1 -> 1
-ctmx849 comparetotmag sNaN 1000 -> 1
-ctmx850 comparetotmag sNaN NaN -> -1
-ctmx851 comparetotmag sNaN sNaN -> 0
-
-ctmx852 comparetotmag -sNaN sNaN -> 0
-ctmx853 comparetotmag -NaN sNaN -> 1
-ctmx854 comparetotmag -Inf sNaN -> -1
-ctmx855 comparetotmag -1000 sNaN -> -1
-ctmx856 comparetotmag -1 sNaN -> -1
-ctmx857 comparetotmag -0 sNaN -> -1
-ctmx858 comparetotmag 0 sNaN -> -1
-ctmx859 comparetotmag 1 sNaN -> -1
-ctmx860 comparetotmag 1000 sNaN -> -1
-ctmx861 comparetotmag Inf sNaN -> -1
-ctmx862 comparetotmag NaN sNaN -> 1
-ctmx863 comparetotmag sNaN sNaN -> 0
-
-ctmx871 comparetotmag -sNaN -sNaN -> 0
-ctmx872 comparetotmag -sNaN -NaN -> -1
-ctmx873 comparetotmag -sNaN -Inf -> 1
-ctmx874 comparetotmag -sNaN -1000 -> 1
-ctmx875 comparetotmag -sNaN -1 -> 1
-ctmx876 comparetotmag -sNaN -0 -> 1
-ctmx877 comparetotmag -sNaN 0 -> 1
-ctmx878 comparetotmag -sNaN 1 -> 1
-ctmx879 comparetotmag -sNaN 1000 -> 1
-ctmx880 comparetotmag -sNaN NaN -> -1
-ctmx881 comparetotmag -sNaN sNaN -> 0
-
-ctmx882 comparetotmag -sNaN -sNaN -> 0
-ctmx883 comparetotmag -NaN -sNaN -> 1
-ctmx884 comparetotmag -Inf -sNaN -> -1
-ctmx885 comparetotmag -1000 -sNaN -> -1
-ctmx886 comparetotmag -1 -sNaN -> -1
-ctmx887 comparetotmag -0 -sNaN -> -1
-ctmx888 comparetotmag 0 -sNaN -> -1
-ctmx889 comparetotmag 1 -sNaN -> -1
-ctmx890 comparetotmag 1000 -sNaN -> -1
-ctmx891 comparetotmag Inf -sNaN -> -1
-ctmx892 comparetotmag NaN -sNaN -> 1
-ctmx893 comparetotmag sNaN -sNaN -> 0
-
--- NaNs with payload
-ctmx960 comparetotmag NaN9 -Inf -> 1
-ctmx961 comparetotmag NaN8 999 -> 1
-ctmx962 comparetotmag NaN77 Inf -> 1
-ctmx963 comparetotmag -NaN67 NaN5 -> 1
-ctmx964 comparetotmag -Inf -NaN4 -> -1
-ctmx965 comparetotmag -999 -NaN33 -> -1
-ctmx966 comparetotmag Inf NaN2 -> -1
-
-ctmx970 comparetotmag -NaN41 -NaN42 -> -1
-ctmx971 comparetotmag +NaN41 -NaN42 -> -1
-ctmx972 comparetotmag -NaN41 +NaN42 -> -1
-ctmx973 comparetotmag +NaN41 +NaN42 -> -1
-ctmx974 comparetotmag -NaN42 -NaN01 -> 1
-ctmx975 comparetotmag +NaN42 -NaN01 -> 1
-ctmx976 comparetotmag -NaN42 +NaN01 -> 1
-ctmx977 comparetotmag +NaN42 +NaN01 -> 1
-
-ctmx980 comparetotmag -sNaN771 -sNaN772 -> -1
-ctmx981 comparetotmag +sNaN771 -sNaN772 -> -1
-ctmx982 comparetotmag -sNaN771 +sNaN772 -> -1
-ctmx983 comparetotmag +sNaN771 +sNaN772 -> -1
-ctmx984 comparetotmag -sNaN772 -sNaN771 -> 1
-ctmx985 comparetotmag +sNaN772 -sNaN771 -> 1
-ctmx986 comparetotmag -sNaN772 +sNaN771 -> 1
-ctmx987 comparetotmag +sNaN772 +sNaN771 -> 1
-
-ctmx991 comparetotmag -sNaN99 -Inf -> 1
-ctmx992 comparetotmag sNaN98 -11 -> 1
-ctmx993 comparetotmag sNaN97 NaN -> -1
-ctmx994 comparetotmag sNaN16 sNaN94 -> -1
-ctmx995 comparetotmag NaN85 sNaN83 -> 1
-ctmx996 comparetotmag -Inf sNaN92 -> -1
-ctmx997 comparetotmag 088 sNaN81 -> -1
-ctmx998 comparetotmag Inf sNaN90 -> -1
-ctmx999 comparetotmag NaN -sNaN89 -> 1
-
--- overflow and underflow tests .. subnormal results now allowed
-maxExponent: 999999999
-minexponent: -999999999
-ctmx1080 comparetotmag +1.23456789012345E-0 9E+999999999 -> -1
-ctmx1081 comparetotmag 9E+999999999 +1.23456789012345E-0 -> 1
-ctmx1082 comparetotmag +0.100 9E-999999999 -> 1
-ctmx1083 comparetotmag 9E-999999999 +0.100 -> -1
-ctmx1085 comparetotmag -1.23456789012345E-0 9E+999999999 -> -1
-ctmx1086 comparetotmag 9E+999999999 -1.23456789012345E-0 -> 1
-ctmx1087 comparetotmag -0.100 9E-999999999 -> 1
-ctmx1088 comparetotmag 9E-999999999 -0.100 -> -1
-
-ctmx1089 comparetotmag 1e-599999999 1e-400000001 -> -1
-ctmx1090 comparetotmag 1e-599999999 1e-400000000 -> -1
-ctmx1091 comparetotmag 1e-600000000 1e-400000000 -> -1
-ctmx1092 comparetotmag 9e-999999998 0.01 -> -1
-ctmx1093 comparetotmag 9e-999999998 0.1 -> -1
-ctmx1094 comparetotmag 0.01 9e-999999998 -> 1
-ctmx1095 comparetotmag 1e599999999 1e400000001 -> 1
-ctmx1096 comparetotmag 1e599999999 1e400000000 -> 1
-ctmx1097 comparetotmag 1e600000000 1e400000000 -> 1
-ctmx1098 comparetotmag 9e999999998 100 -> 1
-ctmx1099 comparetotmag 9e999999998 10 -> 1
-ctmx1100 comparetotmag 100 9e999999998 -> -1
--- signs
-ctmx1101 comparetotmag 1e+777777777 1e+411111111 -> 1
-ctmx1102 comparetotmag 1e+777777777 -1e+411111111 -> 1
-ctmx1103 comparetotmag -1e+777777777 1e+411111111 -> 1
-ctmx1104 comparetotmag -1e+777777777 -1e+411111111 -> 1
-ctmx1105 comparetotmag 1e-777777777 1e-411111111 -> -1
-ctmx1106 comparetotmag 1e-777777777 -1e-411111111 -> -1
-ctmx1107 comparetotmag -1e-777777777 1e-411111111 -> -1
-ctmx1108 comparetotmag -1e-777777777 -1e-411111111 -> -1
-
--- spread zeros
-ctmx1110 comparetotmag 0E-383 0 -> -1
-ctmx1111 comparetotmag 0E-383 -0 -> -1
-ctmx1112 comparetotmag -0E-383 0 -> -1
-ctmx1113 comparetotmag -0E-383 -0 -> -1
-ctmx1114 comparetotmag 0E-383 0E+384 -> -1
-ctmx1115 comparetotmag 0E-383 -0E+384 -> -1
-ctmx1116 comparetotmag -0E-383 0E+384 -> -1
-ctmx1117 comparetotmag -0E-383 -0E+384 -> -1
-ctmx1118 comparetotmag 0 0E+384 -> -1
-ctmx1119 comparetotmag 0 -0E+384 -> -1
-ctmx1120 comparetotmag -0 0E+384 -> -1
-ctmx1121 comparetotmag -0 -0E+384 -> -1
-
-ctmx1130 comparetotmag 0E+384 0 -> 1
-ctmx1131 comparetotmag 0E+384 -0 -> 1
-ctmx1132 comparetotmag -0E+384 0 -> 1
-ctmx1133 comparetotmag -0E+384 -0 -> 1
-ctmx1134 comparetotmag 0E+384 0E-383 -> 1
-ctmx1135 comparetotmag 0E+384 -0E-383 -> 1
-ctmx1136 comparetotmag -0E+384 0E-383 -> 1
-ctmx1137 comparetotmag -0E+384 -0E-383 -> 1
-ctmx1138 comparetotmag 0 0E-383 -> 1
-ctmx1139 comparetotmag 0 -0E-383 -> 1
-ctmx1140 comparetotmag -0 0E-383 -> 1
-ctmx1141 comparetotmag -0 -0E-383 -> 1
-
--- Null tests
-ctmx9990 comparetotmag 10 # -> NaN Invalid_operation
-ctmx9991 comparetotmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- comparetotmag.decTest -- decimal comparison, abs. total ordering --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that it cannot be assumed that add/subtract tests cover paths
+-- for this operation adequately, here, because the code might be
+-- quite different (comparison cannot overflow or underflow, so
+-- actual subtractions are not necessary). Similarly, comparetotal
+-- will have some radically different paths than compare.
+
+extended: 1
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+-- sanity checks
+ctmx001 comparetotmag -2 -2 -> 0
+ctmx002 comparetotmag -2 -1 -> 1
+ctmx003 comparetotmag -2 0 -> 1
+ctmx004 comparetotmag -2 1 -> 1
+ctmx005 comparetotmag -2 2 -> 0
+ctmx006 comparetotmag -1 -2 -> -1
+ctmx007 comparetotmag -1 -1 -> 0
+ctmx008 comparetotmag -1 0 -> 1
+ctmx009 comparetotmag -1 1 -> 0
+ctmx010 comparetotmag -1 2 -> -1
+ctmx011 comparetotmag 0 -2 -> -1
+ctmx012 comparetotmag 0 -1 -> -1
+ctmx013 comparetotmag 0 0 -> 0
+ctmx014 comparetotmag 0 1 -> -1
+ctmx015 comparetotmag 0 2 -> -1
+ctmx016 comparetotmag 1 -2 -> -1
+ctmx017 comparetotmag 1 -1 -> 0
+ctmx018 comparetotmag 1 0 -> 1
+ctmx019 comparetotmag 1 1 -> 0
+ctmx020 comparetotmag 1 2 -> -1
+ctmx021 comparetotmag 2 -2 -> 0
+ctmx022 comparetotmag 2 -1 -> 1
+ctmx023 comparetotmag 2 0 -> 1
+ctmx025 comparetotmag 2 1 -> 1
+ctmx026 comparetotmag 2 2 -> 0
+
+ctmx031 comparetotmag -20 -20 -> 0
+ctmx032 comparetotmag -20 -10 -> 1
+ctmx033 comparetotmag -20 00 -> 1
+ctmx034 comparetotmag -20 10 -> 1
+ctmx035 comparetotmag -20 20 -> 0
+ctmx036 comparetotmag -10 -20 -> -1
+ctmx037 comparetotmag -10 -10 -> 0
+ctmx038 comparetotmag -10 00 -> 1
+ctmx039 comparetotmag -10 10 -> 0
+ctmx040 comparetotmag -10 20 -> -1
+ctmx041 comparetotmag 00 -20 -> -1
+ctmx042 comparetotmag 00 -10 -> -1
+ctmx043 comparetotmag 00 00 -> 0
+ctmx044 comparetotmag 00 10 -> -1
+ctmx045 comparetotmag 00 20 -> -1
+ctmx046 comparetotmag 10 -20 -> -1
+ctmx047 comparetotmag 10 -10 -> 0
+ctmx048 comparetotmag 10 00 -> 1
+ctmx049 comparetotmag 10 10 -> 0
+ctmx050 comparetotmag 10 20 -> -1
+ctmx051 comparetotmag 20 -20 -> 0
+ctmx052 comparetotmag 20 -10 -> 1
+ctmx053 comparetotmag 20 00 -> 1
+ctmx055 comparetotmag 20 10 -> 1
+ctmx056 comparetotmag 20 20 -> 0
+
+ctmx061 comparetotmag -2.0 -2.0 -> 0
+ctmx062 comparetotmag -2.0 -1.0 -> 1
+ctmx063 comparetotmag -2.0 0.0 -> 1
+ctmx064 comparetotmag -2.0 1.0 -> 1
+ctmx065 comparetotmag -2.0 2.0 -> 0
+ctmx066 comparetotmag -1.0 -2.0 -> -1
+ctmx067 comparetotmag -1.0 -1.0 -> 0
+ctmx068 comparetotmag -1.0 0.0 -> 1
+ctmx069 comparetotmag -1.0 1.0 -> 0
+ctmx070 comparetotmag -1.0 2.0 -> -1
+ctmx071 comparetotmag 0.0 -2.0 -> -1
+ctmx072 comparetotmag 0.0 -1.0 -> -1
+ctmx073 comparetotmag 0.0 0.0 -> 0
+ctmx074 comparetotmag 0.0 1.0 -> -1
+ctmx075 comparetotmag 0.0 2.0 -> -1
+ctmx076 comparetotmag 1.0 -2.0 -> -1
+ctmx077 comparetotmag 1.0 -1.0 -> 0
+ctmx078 comparetotmag 1.0 0.0 -> 1
+ctmx079 comparetotmag 1.0 1.0 -> 0
+ctmx080 comparetotmag 1.0 2.0 -> -1
+ctmx081 comparetotmag 2.0 -2.0 -> 0
+ctmx082 comparetotmag 2.0 -1.0 -> 1
+ctmx083 comparetotmag 2.0 0.0 -> 1
+ctmx085 comparetotmag 2.0 1.0 -> 1
+ctmx086 comparetotmag 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+maxexponent: 999999999
+minexponent: -999999999
+ctmx090 comparetotmag 9.99999999E+999999999 9.99999999E+999999999 -> 0
+ctmx091 comparetotmag -9.99999999E+999999999 9.99999999E+999999999 -> 0
+ctmx092 comparetotmag 9.99999999E+999999999 -9.99999999E+999999999 -> 0
+ctmx093 comparetotmag -9.99999999E+999999999 -9.99999999E+999999999 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+ctmx100 comparetotmag 7.0 7.0 -> 0
+ctmx101 comparetotmag 7.0 7 -> -1
+ctmx102 comparetotmag 7 7.0 -> 1
+ctmx103 comparetotmag 7E+0 7.0 -> 1
+ctmx104 comparetotmag 70E-1 7.0 -> 0
+ctmx105 comparetotmag 0.7E+1 7 -> 0
+ctmx106 comparetotmag 70E-1 7 -> -1
+ctmx107 comparetotmag 7.0 7E+0 -> -1
+ctmx108 comparetotmag 7.0 70E-1 -> 0
+ctmx109 comparetotmag 7 0.7E+1 -> 0
+ctmx110 comparetotmag 7 70E-1 -> 1
+
+ctmx120 comparetotmag 8.0 7.0 -> 1
+ctmx121 comparetotmag 8.0 7 -> 1
+ctmx122 comparetotmag 8 7.0 -> 1
+ctmx123 comparetotmag 8E+0 7.0 -> 1
+ctmx124 comparetotmag 80E-1 7.0 -> 1
+ctmx125 comparetotmag 0.8E+1 7 -> 1
+ctmx126 comparetotmag 80E-1 7 -> 1
+ctmx127 comparetotmag 8.0 7E+0 -> 1
+ctmx128 comparetotmag 8.0 70E-1 -> 1
+ctmx129 comparetotmag 8 0.7E+1 -> 1
+ctmx130 comparetotmag 8 70E-1 -> 1
+
+ctmx140 comparetotmag 8.0 9.0 -> -1
+ctmx141 comparetotmag 8.0 9 -> -1
+ctmx142 comparetotmag 8 9.0 -> -1
+ctmx143 comparetotmag 8E+0 9.0 -> -1
+ctmx144 comparetotmag 80E-1 9.0 -> -1
+ctmx145 comparetotmag 0.8E+1 9 -> -1
+ctmx146 comparetotmag 80E-1 9 -> -1
+ctmx147 comparetotmag 8.0 9E+0 -> -1
+ctmx148 comparetotmag 8.0 90E-1 -> -1
+ctmx149 comparetotmag 8 0.9E+1 -> -1
+ctmx150 comparetotmag 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ctmx200 comparetotmag -7.0 7.0 -> 0
+ctmx201 comparetotmag -7.0 7 -> -1
+ctmx202 comparetotmag -7 7.0 -> 1
+ctmx203 comparetotmag -7E+0 7.0 -> 1
+ctmx204 comparetotmag -70E-1 7.0 -> 0
+ctmx205 comparetotmag -0.7E+1 7 -> 0
+ctmx206 comparetotmag -70E-1 7 -> -1
+ctmx207 comparetotmag -7.0 7E+0 -> -1
+ctmx208 comparetotmag -7.0 70E-1 -> 0
+ctmx209 comparetotmag -7 0.7E+1 -> 0
+ctmx210 comparetotmag -7 70E-1 -> 1
+
+ctmx220 comparetotmag -8.0 7.0 -> 1
+ctmx221 comparetotmag -8.0 7 -> 1
+ctmx222 comparetotmag -8 7.0 -> 1
+ctmx223 comparetotmag -8E+0 7.0 -> 1
+ctmx224 comparetotmag -80E-1 7.0 -> 1
+ctmx225 comparetotmag -0.8E+1 7 -> 1
+ctmx226 comparetotmag -80E-1 7 -> 1
+ctmx227 comparetotmag -8.0 7E+0 -> 1
+ctmx228 comparetotmag -8.0 70E-1 -> 1
+ctmx229 comparetotmag -8 0.7E+1 -> 1
+ctmx230 comparetotmag -8 70E-1 -> 1
+
+ctmx240 comparetotmag -8.0 9.0 -> -1
+ctmx241 comparetotmag -8.0 9 -> -1
+ctmx242 comparetotmag -8 9.0 -> -1
+ctmx243 comparetotmag -8E+0 9.0 -> -1
+ctmx244 comparetotmag -80E-1 9.0 -> -1
+ctmx245 comparetotmag -0.8E+1 9 -> -1
+ctmx246 comparetotmag -80E-1 9 -> -1
+ctmx247 comparetotmag -8.0 9E+0 -> -1
+ctmx248 comparetotmag -8.0 90E-1 -> -1
+ctmx249 comparetotmag -8 0.9E+1 -> -1
+ctmx250 comparetotmag -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ctmx300 comparetotmag 7.0 -7.0 -> 0
+ctmx301 comparetotmag 7.0 -7 -> -1
+ctmx302 comparetotmag 7 -7.0 -> 1
+ctmx303 comparetotmag 7E+0 -7.0 -> 1
+ctmx304 comparetotmag 70E-1 -7.0 -> 0
+ctmx305 comparetotmag .7E+1 -7 -> 0
+ctmx306 comparetotmag 70E-1 -7 -> -1
+ctmx307 comparetotmag 7.0 -7E+0 -> -1
+ctmx308 comparetotmag 7.0 -70E-1 -> 0
+ctmx309 comparetotmag 7 -.7E+1 -> 0
+ctmx310 comparetotmag 7 -70E-1 -> 1
+
+ctmx320 comparetotmag 8.0 -7.0 -> 1
+ctmx321 comparetotmag 8.0 -7 -> 1
+ctmx322 comparetotmag 8 -7.0 -> 1
+ctmx323 comparetotmag 8E+0 -7.0 -> 1
+ctmx324 comparetotmag 80E-1 -7.0 -> 1
+ctmx325 comparetotmag .8E+1 -7 -> 1
+ctmx326 comparetotmag 80E-1 -7 -> 1
+ctmx327 comparetotmag 8.0 -7E+0 -> 1
+ctmx328 comparetotmag 8.0 -70E-1 -> 1
+ctmx329 comparetotmag 8 -.7E+1 -> 1
+ctmx330 comparetotmag 8 -70E-1 -> 1
+
+ctmx340 comparetotmag 8.0 -9.0 -> -1
+ctmx341 comparetotmag 8.0 -9 -> -1
+ctmx342 comparetotmag 8 -9.0 -> -1
+ctmx343 comparetotmag 8E+0 -9.0 -> -1
+ctmx344 comparetotmag 80E-1 -9.0 -> -1
+ctmx345 comparetotmag .8E+1 -9 -> -1
+ctmx346 comparetotmag 80E-1 -9 -> -1
+ctmx347 comparetotmag 8.0 -9E+0 -> -1
+ctmx348 comparetotmag 8.0 -90E-1 -> -1
+ctmx349 comparetotmag 8 -.9E+1 -> -1
+ctmx350 comparetotmag 8 -90E-1 -> -1
+
+-- and again, with sign changes -- ..
+ctmx400 comparetotmag -7.0 -7.0 -> 0
+ctmx401 comparetotmag -7.0 -7 -> -1
+ctmx402 comparetotmag -7 -7.0 -> 1
+ctmx403 comparetotmag -7E+0 -7.0 -> 1
+ctmx404 comparetotmag -70E-1 -7.0 -> 0
+ctmx405 comparetotmag -.7E+1 -7 -> 0
+ctmx406 comparetotmag -70E-1 -7 -> -1
+ctmx407 comparetotmag -7.0 -7E+0 -> -1
+ctmx408 comparetotmag -7.0 -70E-1 -> 0
+ctmx409 comparetotmag -7 -.7E+1 -> 0
+ctmx410 comparetotmag -7 -70E-1 -> 1
+
+ctmx420 comparetotmag -8.0 -7.0 -> 1
+ctmx421 comparetotmag -8.0 -7 -> 1
+ctmx422 comparetotmag -8 -7.0 -> 1
+ctmx423 comparetotmag -8E+0 -7.0 -> 1
+ctmx424 comparetotmag -80E-1 -7.0 -> 1
+ctmx425 comparetotmag -.8E+1 -7 -> 1
+ctmx426 comparetotmag -80E-1 -7 -> 1
+ctmx427 comparetotmag -8.0 -7E+0 -> 1
+ctmx428 comparetotmag -8.0 -70E-1 -> 1
+ctmx429 comparetotmag -8 -.7E+1 -> 1
+ctmx430 comparetotmag -8 -70E-1 -> 1
+
+ctmx440 comparetotmag -8.0 -9.0 -> -1
+ctmx441 comparetotmag -8.0 -9 -> -1
+ctmx442 comparetotmag -8 -9.0 -> -1
+ctmx443 comparetotmag -8E+0 -9.0 -> -1
+ctmx444 comparetotmag -80E-1 -9.0 -> -1
+ctmx445 comparetotmag -.8E+1 -9 -> -1
+ctmx446 comparetotmag -80E-1 -9 -> -1
+ctmx447 comparetotmag -8.0 -9E+0 -> -1
+ctmx448 comparetotmag -8.0 -90E-1 -> -1
+ctmx449 comparetotmag -8 -.9E+1 -> -1
+ctmx450 comparetotmag -8 -90E-1 -> -1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+precision: 40
+ctmx470 comparetotmag 123.4560000000000000E789 123.456E789 -> -1
+ctmx471 comparetotmag 123.456000000000000E-89 123.456E-89 -> -1
+ctmx472 comparetotmag 123.45600000000000E789 123.456E789 -> -1
+ctmx473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
+ctmx474 comparetotmag 123.456000000000E789 123.456E789 -> -1
+ctmx475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
+ctmx476 comparetotmag 123.4560000000E789 123.456E789 -> -1
+ctmx477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
+ctmx478 comparetotmag 123.45600000E789 123.456E789 -> -1
+ctmx479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
+ctmx480 comparetotmag 123.456000E789 123.456E789 -> -1
+ctmx481 comparetotmag 123.45600E-89 123.456E-89 -> -1
+ctmx482 comparetotmag 123.4560E789 123.456E789 -> -1
+ctmx483 comparetotmag 123.456E-89 123.456E-89 -> 0
+ctmx484 comparetotmag 123.456E-89 123.4560000000000000E-89 -> 1
+ctmx485 comparetotmag 123.456E789 123.456000000000000E789 -> 1
+ctmx486 comparetotmag 123.456E-89 123.45600000000000E-89 -> 1
+ctmx487 comparetotmag 123.456E789 123.4560000000000E789 -> 1
+ctmx488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
+ctmx489 comparetotmag 123.456E789 123.45600000000E789 -> 1
+ctmx490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
+ctmx491 comparetotmag 123.456E789 123.456000000E789 -> 1
+ctmx492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
+ctmx493 comparetotmag 123.456E789 123.4560000E789 -> 1
+ctmx494 comparetotmag 123.456E-89 123.456000E-89 -> 1
+ctmx495 comparetotmag 123.456E789 123.45600E789 -> 1
+ctmx496 comparetotmag 123.456E-89 123.4560E-89 -> 1
+ctmx497 comparetotmag 123.456E789 123.456E789 -> 0
+
+-- wide-ranging, around precision; signs equal
+precision: 9
+ctmx500 comparetotmag 1 1E-15 -> 1
+ctmx501 comparetotmag 1 1E-14 -> 1
+ctmx502 comparetotmag 1 1E-13 -> 1
+ctmx503 comparetotmag 1 1E-12 -> 1
+ctmx504 comparetotmag 1 1E-11 -> 1
+ctmx505 comparetotmag 1 1E-10 -> 1
+ctmx506 comparetotmag 1 1E-9 -> 1
+ctmx507 comparetotmag 1 1E-8 -> 1
+ctmx508 comparetotmag 1 1E-7 -> 1
+ctmx509 comparetotmag 1 1E-6 -> 1
+ctmx510 comparetotmag 1 1E-5 -> 1
+ctmx511 comparetotmag 1 1E-4 -> 1
+ctmx512 comparetotmag 1 1E-3 -> 1
+ctmx513 comparetotmag 1 1E-2 -> 1
+ctmx514 comparetotmag 1 1E-1 -> 1
+ctmx515 comparetotmag 1 1E-0 -> 0
+ctmx516 comparetotmag 1 1E+1 -> -1
+ctmx517 comparetotmag 1 1E+2 -> -1
+ctmx518 comparetotmag 1 1E+3 -> -1
+ctmx519 comparetotmag 1 1E+4 -> -1
+ctmx521 comparetotmag 1 1E+5 -> -1
+ctmx522 comparetotmag 1 1E+6 -> -1
+ctmx523 comparetotmag 1 1E+7 -> -1
+ctmx524 comparetotmag 1 1E+8 -> -1
+ctmx525 comparetotmag 1 1E+9 -> -1
+ctmx526 comparetotmag 1 1E+10 -> -1
+ctmx527 comparetotmag 1 1E+11 -> -1
+ctmx528 comparetotmag 1 1E+12 -> -1
+ctmx529 comparetotmag 1 1E+13 -> -1
+ctmx530 comparetotmag 1 1E+14 -> -1
+ctmx531 comparetotmag 1 1E+15 -> -1
+-- LR swap
+ctmx540 comparetotmag 1E-15 1 -> -1
+ctmx541 comparetotmag 1E-14 1 -> -1
+ctmx542 comparetotmag 1E-13 1 -> -1
+ctmx543 comparetotmag 1E-12 1 -> -1
+ctmx544 comparetotmag 1E-11 1 -> -1
+ctmx545 comparetotmag 1E-10 1 -> -1
+ctmx546 comparetotmag 1E-9 1 -> -1
+ctmx547 comparetotmag 1E-8 1 -> -1
+ctmx548 comparetotmag 1E-7 1 -> -1
+ctmx549 comparetotmag 1E-6 1 -> -1
+ctmx550 comparetotmag 1E-5 1 -> -1
+ctmx551 comparetotmag 1E-4 1 -> -1
+ctmx552 comparetotmag 1E-3 1 -> -1
+ctmx553 comparetotmag 1E-2 1 -> -1
+ctmx554 comparetotmag 1E-1 1 -> -1
+ctmx555 comparetotmag 1E-0 1 -> 0
+ctmx556 comparetotmag 1E+1 1 -> 1
+ctmx557 comparetotmag 1E+2 1 -> 1
+ctmx558 comparetotmag 1E+3 1 -> 1
+ctmx559 comparetotmag 1E+4 1 -> 1
+ctmx561 comparetotmag 1E+5 1 -> 1
+ctmx562 comparetotmag 1E+6 1 -> 1
+ctmx563 comparetotmag 1E+7 1 -> 1
+ctmx564 comparetotmag 1E+8 1 -> 1
+ctmx565 comparetotmag 1E+9 1 -> 1
+ctmx566 comparetotmag 1E+10 1 -> 1
+ctmx567 comparetotmag 1E+11 1 -> 1
+ctmx568 comparetotmag 1E+12 1 -> 1
+ctmx569 comparetotmag 1E+13 1 -> 1
+ctmx570 comparetotmag 1E+14 1 -> 1
+ctmx571 comparetotmag 1E+15 1 -> 1
+-- similar with an useful coefficient, one side only
+ctmx580 comparetotmag 0.000000987654321 1E-15 -> 1
+ctmx581 comparetotmag 0.000000987654321 1E-14 -> 1
+ctmx582 comparetotmag 0.000000987654321 1E-13 -> 1
+ctmx583 comparetotmag 0.000000987654321 1E-12 -> 1
+ctmx584 comparetotmag 0.000000987654321 1E-11 -> 1
+ctmx585 comparetotmag 0.000000987654321 1E-10 -> 1
+ctmx586 comparetotmag 0.000000987654321 1E-9 -> 1
+ctmx587 comparetotmag 0.000000987654321 1E-8 -> 1
+ctmx588 comparetotmag 0.000000987654321 1E-7 -> 1
+ctmx589 comparetotmag 0.000000987654321 1E-6 -> -1
+ctmx590 comparetotmag 0.000000987654321 1E-5 -> -1
+ctmx591 comparetotmag 0.000000987654321 1E-4 -> -1
+ctmx592 comparetotmag 0.000000987654321 1E-3 -> -1
+ctmx593 comparetotmag 0.000000987654321 1E-2 -> -1
+ctmx594 comparetotmag 0.000000987654321 1E-1 -> -1
+ctmx595 comparetotmag 0.000000987654321 1E-0 -> -1
+ctmx596 comparetotmag 0.000000987654321 1E+1 -> -1
+ctmx597 comparetotmag 0.000000987654321 1E+2 -> -1
+ctmx598 comparetotmag 0.000000987654321 1E+3 -> -1
+ctmx599 comparetotmag 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+precision: 20
+ctmx600 comparetotmag 12 12.2345 -> -1
+ctmx601 comparetotmag 12.0 12.2345 -> -1
+ctmx602 comparetotmag 12.00 12.2345 -> -1
+ctmx603 comparetotmag 12.000 12.2345 -> -1
+ctmx604 comparetotmag 12.0000 12.2345 -> -1
+ctmx605 comparetotmag 12.00000 12.2345 -> -1
+ctmx606 comparetotmag 12.000000 12.2345 -> -1
+ctmx607 comparetotmag 12.0000000 12.2345 -> -1
+ctmx608 comparetotmag 12.00000000 12.2345 -> -1
+ctmx609 comparetotmag 12.000000000 12.2345 -> -1
+ctmx610 comparetotmag 12.1234 12 -> 1
+ctmx611 comparetotmag 12.1234 12.0 -> 1
+ctmx612 comparetotmag 12.1234 12.00 -> 1
+ctmx613 comparetotmag 12.1234 12.000 -> 1
+ctmx614 comparetotmag 12.1234 12.0000 -> 1
+ctmx615 comparetotmag 12.1234 12.00000 -> 1
+ctmx616 comparetotmag 12.1234 12.000000 -> 1
+ctmx617 comparetotmag 12.1234 12.0000000 -> 1
+ctmx618 comparetotmag 12.1234 12.00000000 -> 1
+ctmx619 comparetotmag 12.1234 12.000000000 -> 1
+ctmx620 comparetotmag -12 -12.2345 -> -1
+ctmx621 comparetotmag -12.0 -12.2345 -> -1
+ctmx622 comparetotmag -12.00 -12.2345 -> -1
+ctmx623 comparetotmag -12.000 -12.2345 -> -1
+ctmx624 comparetotmag -12.0000 -12.2345 -> -1
+ctmx625 comparetotmag -12.00000 -12.2345 -> -1
+ctmx626 comparetotmag -12.000000 -12.2345 -> -1
+ctmx627 comparetotmag -12.0000000 -12.2345 -> -1
+ctmx628 comparetotmag -12.00000000 -12.2345 -> -1
+ctmx629 comparetotmag -12.000000000 -12.2345 -> -1
+ctmx630 comparetotmag -12.1234 -12 -> 1
+ctmx631 comparetotmag -12.1234 -12.0 -> 1
+ctmx632 comparetotmag -12.1234 -12.00 -> 1
+ctmx633 comparetotmag -12.1234 -12.000 -> 1
+ctmx634 comparetotmag -12.1234 -12.0000 -> 1
+ctmx635 comparetotmag -12.1234 -12.00000 -> 1
+ctmx636 comparetotmag -12.1234 -12.000000 -> 1
+ctmx637 comparetotmag -12.1234 -12.0000000 -> 1
+ctmx638 comparetotmag -12.1234 -12.00000000 -> 1
+ctmx639 comparetotmag -12.1234 -12.000000000 -> 1
+precision: 9
+
+-- extended zeros
+ctmx640 comparetotmag 0 0 -> 0
+ctmx641 comparetotmag 0 -0 -> 0
+ctmx642 comparetotmag 0 -0.0 -> 1
+ctmx643 comparetotmag 0 0.0 -> 1
+ctmx644 comparetotmag -0 0 -> 0
+ctmx645 comparetotmag -0 -0 -> 0
+ctmx646 comparetotmag -0 -0.0 -> 1
+ctmx647 comparetotmag -0 0.0 -> 1
+ctmx648 comparetotmag 0.0 0 -> -1
+ctmx649 comparetotmag 0.0 -0 -> -1
+ctmx650 comparetotmag 0.0 -0.0 -> 0
+ctmx651 comparetotmag 0.0 0.0 -> 0
+ctmx652 comparetotmag -0.0 0 -> -1
+ctmx653 comparetotmag -0.0 -0 -> -1
+ctmx654 comparetotmag -0.0 -0.0 -> 0
+ctmx655 comparetotmag -0.0 0.0 -> 0
+
+ctmx656 comparetotmag -0E1 0.0 -> 1
+ctmx657 comparetotmag -0E2 0.0 -> 1
+ctmx658 comparetotmag 0E1 0.0 -> 1
+ctmx659 comparetotmag 0E2 0.0 -> 1
+ctmx660 comparetotmag -0E1 0 -> 1
+ctmx661 comparetotmag -0E2 0 -> 1
+ctmx662 comparetotmag 0E1 0 -> 1
+ctmx663 comparetotmag 0E2 0 -> 1
+ctmx664 comparetotmag -0E1 -0E1 -> 0
+ctmx665 comparetotmag -0E2 -0E1 -> 1
+ctmx666 comparetotmag 0E1 -0E1 -> 0
+ctmx667 comparetotmag 0E2 -0E1 -> 1
+ctmx668 comparetotmag -0E1 -0E2 -> -1
+ctmx669 comparetotmag -0E2 -0E2 -> 0
+ctmx670 comparetotmag 0E1 -0E2 -> -1
+ctmx671 comparetotmag 0E2 -0E2 -> 0
+ctmx672 comparetotmag -0E1 0E1 -> 0
+ctmx673 comparetotmag -0E2 0E1 -> 1
+ctmx674 comparetotmag 0E1 0E1 -> 0
+ctmx675 comparetotmag 0E2 0E1 -> 1
+ctmx676 comparetotmag -0E1 0E2 -> -1
+ctmx677 comparetotmag -0E2 0E2 -> 0
+ctmx678 comparetotmag 0E1 0E2 -> -1
+ctmx679 comparetotmag 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+precision: 20
+ctmx680 comparetotmag 12 12 -> 0
+ctmx681 comparetotmag 12 12.0 -> 1
+ctmx682 comparetotmag 12 12.00 -> 1
+ctmx683 comparetotmag 12 12.000 -> 1
+ctmx684 comparetotmag 12 12.0000 -> 1
+ctmx685 comparetotmag 12 12.00000 -> 1
+ctmx686 comparetotmag 12 12.000000 -> 1
+ctmx687 comparetotmag 12 12.0000000 -> 1
+ctmx688 comparetotmag 12 12.00000000 -> 1
+ctmx689 comparetotmag 12 12.000000000 -> 1
+ctmx690 comparetotmag 12 12 -> 0
+ctmx691 comparetotmag 12.0 12 -> -1
+ctmx692 comparetotmag 12.00 12 -> -1
+ctmx693 comparetotmag 12.000 12 -> -1
+ctmx694 comparetotmag 12.0000 12 -> -1
+ctmx695 comparetotmag 12.00000 12 -> -1
+ctmx696 comparetotmag 12.000000 12 -> -1
+ctmx697 comparetotmag 12.0000000 12 -> -1
+ctmx698 comparetotmag 12.00000000 12 -> -1
+ctmx699 comparetotmag 12.000000000 12 -> -1
+
+-- long operand checks
+maxexponent: 999
+minexponent: -999
+precision: 9
+ctmx701 comparetotmag 12345678000 1 -> 1
+ctmx702 comparetotmag 1 12345678000 -> -1
+ctmx703 comparetotmag 1234567800 1 -> 1
+ctmx704 comparetotmag 1 1234567800 -> -1
+ctmx705 comparetotmag 1234567890 1 -> 1
+ctmx706 comparetotmag 1 1234567890 -> -1
+ctmx707 comparetotmag 1234567891 1 -> 1
+ctmx708 comparetotmag 1 1234567891 -> -1
+ctmx709 comparetotmag 12345678901 1 -> 1
+ctmx710 comparetotmag 1 12345678901 -> -1
+ctmx711 comparetotmag 1234567896 1 -> 1
+ctmx712 comparetotmag 1 1234567896 -> -1
+ctmx713 comparetotmag -1234567891 1 -> 1
+ctmx714 comparetotmag 1 -1234567891 -> -1
+ctmx715 comparetotmag -12345678901 1 -> 1
+ctmx716 comparetotmag 1 -12345678901 -> -1
+ctmx717 comparetotmag -1234567896 1 -> 1
+ctmx718 comparetotmag 1 -1234567896 -> -1
+
+precision: 15
+-- same with plenty of precision
+ctmx721 comparetotmag 12345678000 1 -> 1
+ctmx722 comparetotmag 1 12345678000 -> -1
+ctmx723 comparetotmag 1234567800 1 -> 1
+ctmx724 comparetotmag 1 1234567800 -> -1
+ctmx725 comparetotmag 1234567890 1 -> 1
+ctmx726 comparetotmag 1 1234567890 -> -1
+ctmx727 comparetotmag 1234567891 1 -> 1
+ctmx728 comparetotmag 1 1234567891 -> -1
+ctmx729 comparetotmag 12345678901 1 -> 1
+ctmx730 comparetotmag 1 12345678901 -> -1
+ctmx731 comparetotmag 1234567896 1 -> 1
+ctmx732 comparetotmag 1 1234567896 -> -1
+
+-- residue cases
+precision: 5
+ctmx740 comparetotmag 1 0.9999999 -> 1
+ctmx741 comparetotmag 1 0.999999 -> 1
+ctmx742 comparetotmag 1 0.99999 -> 1
+ctmx743 comparetotmag 1 1.0000 -> 1
+ctmx744 comparetotmag 1 1.00001 -> -1
+ctmx745 comparetotmag 1 1.000001 -> -1
+ctmx746 comparetotmag 1 1.0000001 -> -1
+ctmx750 comparetotmag 0.9999999 1 -> -1
+ctmx751 comparetotmag 0.999999 1 -> -1
+ctmx752 comparetotmag 0.99999 1 -> -1
+ctmx753 comparetotmag 1.0000 1 -> -1
+ctmx754 comparetotmag 1.00001 1 -> 1
+ctmx755 comparetotmag 1.000001 1 -> 1
+ctmx756 comparetotmag 1.0000001 1 -> 1
+
+-- a selection of longies
+ctmx760 comparetotmag -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> 1
+ctmx761 comparetotmag -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
+ctmx762 comparetotmag -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> 1
+ctmx763 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+-- precisions above or below the difference should have no effect
+precision: 11
+ctmx764 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 10
+ctmx765 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 9
+ctmx766 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 8
+ctmx767 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 7
+ctmx768 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 6
+ctmx769 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 5
+ctmx770 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 4
+ctmx771 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 3
+ctmx772 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 2
+ctmx773 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+precision: 1
+ctmx774 comparetotmag -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> -1
+
+-- Specials
+precision: 9
+ctmx780 comparetotmag Inf -Inf -> 0
+ctmx781 comparetotmag Inf -1000 -> 1
+ctmx782 comparetotmag Inf -1 -> 1
+ctmx783 comparetotmag Inf -0 -> 1
+ctmx784 comparetotmag Inf 0 -> 1
+ctmx785 comparetotmag Inf 1 -> 1
+ctmx786 comparetotmag Inf 1000 -> 1
+ctmx787 comparetotmag Inf Inf -> 0
+ctmx788 comparetotmag -1000 Inf -> -1
+ctmx789 comparetotmag -Inf Inf -> 0
+ctmx790 comparetotmag -1 Inf -> -1
+ctmx791 comparetotmag -0 Inf -> -1
+ctmx792 comparetotmag 0 Inf -> -1
+ctmx793 comparetotmag 1 Inf -> -1
+ctmx794 comparetotmag 1000 Inf -> -1
+ctmx795 comparetotmag Inf Inf -> 0
+
+ctmx800 comparetotmag -Inf -Inf -> 0
+ctmx801 comparetotmag -Inf -1000 -> 1
+ctmx802 comparetotmag -Inf -1 -> 1
+ctmx803 comparetotmag -Inf -0 -> 1
+ctmx804 comparetotmag -Inf 0 -> 1
+ctmx805 comparetotmag -Inf 1 -> 1
+ctmx806 comparetotmag -Inf 1000 -> 1
+ctmx807 comparetotmag -Inf Inf -> 0
+ctmx808 comparetotmag -Inf -Inf -> 0
+ctmx809 comparetotmag -1000 -Inf -> -1
+ctmx810 comparetotmag -1 -Inf -> -1
+ctmx811 comparetotmag -0 -Inf -> -1
+ctmx812 comparetotmag 0 -Inf -> -1
+ctmx813 comparetotmag 1 -Inf -> -1
+ctmx814 comparetotmag 1000 -Inf -> -1
+ctmx815 comparetotmag Inf -Inf -> 0
+
+ctmx821 comparetotmag NaN -Inf -> 1
+ctmx822 comparetotmag NaN -1000 -> 1
+ctmx823 comparetotmag NaN -1 -> 1
+ctmx824 comparetotmag NaN -0 -> 1
+ctmx825 comparetotmag NaN 0 -> 1
+ctmx826 comparetotmag NaN 1 -> 1
+ctmx827 comparetotmag NaN 1000 -> 1
+ctmx828 comparetotmag NaN Inf -> 1
+ctmx829 comparetotmag NaN NaN -> 0
+ctmx830 comparetotmag -Inf NaN -> -1
+ctmx831 comparetotmag -1000 NaN -> -1
+ctmx832 comparetotmag -1 NaN -> -1
+ctmx833 comparetotmag -0 NaN -> -1
+ctmx834 comparetotmag 0 NaN -> -1
+ctmx835 comparetotmag 1 NaN -> -1
+ctmx836 comparetotmag 1000 NaN -> -1
+ctmx837 comparetotmag Inf NaN -> -1
+ctmx838 comparetotmag -NaN -NaN -> 0
+ctmx839 comparetotmag +NaN -NaN -> 0
+ctmx840 comparetotmag -NaN +NaN -> 0
+
+ctmx841 comparetotmag sNaN -sNaN -> 0
+ctmx842 comparetotmag sNaN -NaN -> -1
+ctmx843 comparetotmag sNaN -Inf -> 1
+ctmx844 comparetotmag sNaN -1000 -> 1
+ctmx845 comparetotmag sNaN -1 -> 1
+ctmx846 comparetotmag sNaN -0 -> 1
+ctmx847 comparetotmag sNaN 0 -> 1
+ctmx848 comparetotmag sNaN 1 -> 1
+ctmx849 comparetotmag sNaN 1000 -> 1
+ctmx850 comparetotmag sNaN NaN -> -1
+ctmx851 comparetotmag sNaN sNaN -> 0
+
+ctmx852 comparetotmag -sNaN sNaN -> 0
+ctmx853 comparetotmag -NaN sNaN -> 1
+ctmx854 comparetotmag -Inf sNaN -> -1
+ctmx855 comparetotmag -1000 sNaN -> -1
+ctmx856 comparetotmag -1 sNaN -> -1
+ctmx857 comparetotmag -0 sNaN -> -1
+ctmx858 comparetotmag 0 sNaN -> -1
+ctmx859 comparetotmag 1 sNaN -> -1
+ctmx860 comparetotmag 1000 sNaN -> -1
+ctmx861 comparetotmag Inf sNaN -> -1
+ctmx862 comparetotmag NaN sNaN -> 1
+ctmx863 comparetotmag sNaN sNaN -> 0
+
+ctmx871 comparetotmag -sNaN -sNaN -> 0
+ctmx872 comparetotmag -sNaN -NaN -> -1
+ctmx873 comparetotmag -sNaN -Inf -> 1
+ctmx874 comparetotmag -sNaN -1000 -> 1
+ctmx875 comparetotmag -sNaN -1 -> 1
+ctmx876 comparetotmag -sNaN -0 -> 1
+ctmx877 comparetotmag -sNaN 0 -> 1
+ctmx878 comparetotmag -sNaN 1 -> 1
+ctmx879 comparetotmag -sNaN 1000 -> 1
+ctmx880 comparetotmag -sNaN NaN -> -1
+ctmx881 comparetotmag -sNaN sNaN -> 0
+
+ctmx882 comparetotmag -sNaN -sNaN -> 0
+ctmx883 comparetotmag -NaN -sNaN -> 1
+ctmx884 comparetotmag -Inf -sNaN -> -1
+ctmx885 comparetotmag -1000 -sNaN -> -1
+ctmx886 comparetotmag -1 -sNaN -> -1
+ctmx887 comparetotmag -0 -sNaN -> -1
+ctmx888 comparetotmag 0 -sNaN -> -1
+ctmx889 comparetotmag 1 -sNaN -> -1
+ctmx890 comparetotmag 1000 -sNaN -> -1
+ctmx891 comparetotmag Inf -sNaN -> -1
+ctmx892 comparetotmag NaN -sNaN -> 1
+ctmx893 comparetotmag sNaN -sNaN -> 0
+
+-- NaNs with payload
+ctmx960 comparetotmag NaN9 -Inf -> 1
+ctmx961 comparetotmag NaN8 999 -> 1
+ctmx962 comparetotmag NaN77 Inf -> 1
+ctmx963 comparetotmag -NaN67 NaN5 -> 1
+ctmx964 comparetotmag -Inf -NaN4 -> -1
+ctmx965 comparetotmag -999 -NaN33 -> -1
+ctmx966 comparetotmag Inf NaN2 -> -1
+
+ctmx970 comparetotmag -NaN41 -NaN42 -> -1
+ctmx971 comparetotmag +NaN41 -NaN42 -> -1
+ctmx972 comparetotmag -NaN41 +NaN42 -> -1
+ctmx973 comparetotmag +NaN41 +NaN42 -> -1
+ctmx974 comparetotmag -NaN42 -NaN01 -> 1
+ctmx975 comparetotmag +NaN42 -NaN01 -> 1
+ctmx976 comparetotmag -NaN42 +NaN01 -> 1
+ctmx977 comparetotmag +NaN42 +NaN01 -> 1
+
+ctmx980 comparetotmag -sNaN771 -sNaN772 -> -1
+ctmx981 comparetotmag +sNaN771 -sNaN772 -> -1
+ctmx982 comparetotmag -sNaN771 +sNaN772 -> -1
+ctmx983 comparetotmag +sNaN771 +sNaN772 -> -1
+ctmx984 comparetotmag -sNaN772 -sNaN771 -> 1
+ctmx985 comparetotmag +sNaN772 -sNaN771 -> 1
+ctmx986 comparetotmag -sNaN772 +sNaN771 -> 1
+ctmx987 comparetotmag +sNaN772 +sNaN771 -> 1
+
+ctmx991 comparetotmag -sNaN99 -Inf -> 1
+ctmx992 comparetotmag sNaN98 -11 -> 1
+ctmx993 comparetotmag sNaN97 NaN -> -1
+ctmx994 comparetotmag sNaN16 sNaN94 -> -1
+ctmx995 comparetotmag NaN85 sNaN83 -> 1
+ctmx996 comparetotmag -Inf sNaN92 -> -1
+ctmx997 comparetotmag 088 sNaN81 -> -1
+ctmx998 comparetotmag Inf sNaN90 -> -1
+ctmx999 comparetotmag NaN -sNaN89 -> 1
+
+-- overflow and underflow tests .. subnormal results now allowed
+maxExponent: 999999999
+minexponent: -999999999
+ctmx1080 comparetotmag +1.23456789012345E-0 9E+999999999 -> -1
+ctmx1081 comparetotmag 9E+999999999 +1.23456789012345E-0 -> 1
+ctmx1082 comparetotmag +0.100 9E-999999999 -> 1
+ctmx1083 comparetotmag 9E-999999999 +0.100 -> -1
+ctmx1085 comparetotmag -1.23456789012345E-0 9E+999999999 -> -1
+ctmx1086 comparetotmag 9E+999999999 -1.23456789012345E-0 -> 1
+ctmx1087 comparetotmag -0.100 9E-999999999 -> 1
+ctmx1088 comparetotmag 9E-999999999 -0.100 -> -1
+
+ctmx1089 comparetotmag 1e-599999999 1e-400000001 -> -1
+ctmx1090 comparetotmag 1e-599999999 1e-400000000 -> -1
+ctmx1091 comparetotmag 1e-600000000 1e-400000000 -> -1
+ctmx1092 comparetotmag 9e-999999998 0.01 -> -1
+ctmx1093 comparetotmag 9e-999999998 0.1 -> -1
+ctmx1094 comparetotmag 0.01 9e-999999998 -> 1
+ctmx1095 comparetotmag 1e599999999 1e400000001 -> 1
+ctmx1096 comparetotmag 1e599999999 1e400000000 -> 1
+ctmx1097 comparetotmag 1e600000000 1e400000000 -> 1
+ctmx1098 comparetotmag 9e999999998 100 -> 1
+ctmx1099 comparetotmag 9e999999998 10 -> 1
+ctmx1100 comparetotmag 100 9e999999998 -> -1
+-- signs
+ctmx1101 comparetotmag 1e+777777777 1e+411111111 -> 1
+ctmx1102 comparetotmag 1e+777777777 -1e+411111111 -> 1
+ctmx1103 comparetotmag -1e+777777777 1e+411111111 -> 1
+ctmx1104 comparetotmag -1e+777777777 -1e+411111111 -> 1
+ctmx1105 comparetotmag 1e-777777777 1e-411111111 -> -1
+ctmx1106 comparetotmag 1e-777777777 -1e-411111111 -> -1
+ctmx1107 comparetotmag -1e-777777777 1e-411111111 -> -1
+ctmx1108 comparetotmag -1e-777777777 -1e-411111111 -> -1
+
+-- spread zeros
+ctmx1110 comparetotmag 0E-383 0 -> -1
+ctmx1111 comparetotmag 0E-383 -0 -> -1
+ctmx1112 comparetotmag -0E-383 0 -> -1
+ctmx1113 comparetotmag -0E-383 -0 -> -1
+ctmx1114 comparetotmag 0E-383 0E+384 -> -1
+ctmx1115 comparetotmag 0E-383 -0E+384 -> -1
+ctmx1116 comparetotmag -0E-383 0E+384 -> -1
+ctmx1117 comparetotmag -0E-383 -0E+384 -> -1
+ctmx1118 comparetotmag 0 0E+384 -> -1
+ctmx1119 comparetotmag 0 -0E+384 -> -1
+ctmx1120 comparetotmag -0 0E+384 -> -1
+ctmx1121 comparetotmag -0 -0E+384 -> -1
+
+ctmx1130 comparetotmag 0E+384 0 -> 1
+ctmx1131 comparetotmag 0E+384 -0 -> 1
+ctmx1132 comparetotmag -0E+384 0 -> 1
+ctmx1133 comparetotmag -0E+384 -0 -> 1
+ctmx1134 comparetotmag 0E+384 0E-383 -> 1
+ctmx1135 comparetotmag 0E+384 -0E-383 -> 1
+ctmx1136 comparetotmag -0E+384 0E-383 -> 1
+ctmx1137 comparetotmag -0E+384 -0E-383 -> 1
+ctmx1138 comparetotmag 0 0E-383 -> 1
+ctmx1139 comparetotmag 0 -0E-383 -> 1
+ctmx1140 comparetotmag -0 0E-383 -> 1
+ctmx1141 comparetotmag -0 -0E-383 -> 1
+
+-- Null tests
+ctmx9990 comparetotmag 10 # -> NaN Invalid_operation
+ctmx9991 comparetotmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/copy.decTest b/Lib/test/decimaltestdata/copy.decTest
index b47e499a7b..d9f299e227 100644
--- a/Lib/test/decimaltestdata/copy.decTest
+++ b/Lib/test/decimaltestdata/copy.decTest
@@ -1,86 +1,86 @@
-------------------------------------------------------------------------
--- copy.decTest -- quiet copy --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-cpyx001 copy +7.50 -> 7.50
-
--- Infinities
-cpyx011 copy Infinity -> Infinity
-cpyx012 copy -Infinity -> -Infinity
-
--- NaNs, 0 payload
-cpyx021 copy NaN -> NaN
-cpyx022 copy -NaN -> -NaN
-cpyx023 copy sNaN -> sNaN
-cpyx024 copy -sNaN -> -sNaN
-
--- NaNs, non-0 payload
-cpyx031 copy NaN10 -> NaN10
-cpyx032 copy -NaN10 -> -NaN10
-cpyx033 copy sNaN10 -> sNaN10
-cpyx034 copy -sNaN10 -> -sNaN10
-cpyx035 copy NaN7 -> NaN7
-cpyx036 copy -NaN7 -> -NaN7
-cpyx037 copy sNaN101 -> sNaN101
-cpyx038 copy -sNaN101 -> -sNaN101
-
--- finites
-cpyx101 copy 7 -> 7
-cpyx102 copy -7 -> -7
-cpyx103 copy 75 -> 75
-cpyx104 copy -75 -> -75
-cpyx105 copy 7.50 -> 7.50
-cpyx106 copy -7.50 -> -7.50
-cpyx107 copy 7.500 -> 7.500
-cpyx108 copy -7.500 -> -7.500
-
--- zeros
-cpyx111 copy 0 -> 0
-cpyx112 copy -0 -> -0
-cpyx113 copy 0E+4 -> 0E+4
-cpyx114 copy -0E+4 -> -0E+4
-cpyx115 copy 0.0000 -> 0.0000
-cpyx116 copy -0.0000 -> -0.0000
-cpyx117 copy 0E-141 -> 0E-141
-cpyx118 copy -0E-141 -> -0E-141
-
--- full coefficients, alternating bits
-cpyx121 copy 268268268 -> 268268268
-cpyx122 copy -268268268 -> -268268268
-cpyx123 copy 134134134 -> 134134134
-cpyx124 copy -134134134 -> -134134134
-
--- Nmax, Nmin, Ntiny
-cpyx131 copy 9.99999999E+999 -> 9.99999999E+999
-cpyx132 copy 1E-999 -> 1E-999
-cpyx133 copy 1.00000000E-999 -> 1.00000000E-999
-cpyx134 copy 1E-1007 -> 1E-1007
-
-cpyx135 copy -1E-1007 -> -1E-1007
-cpyx136 copy -1.00000000E-999 -> -1.00000000E-999
-cpyx137 copy -1E-999 -> -1E-999
-cpyx138 copy -9.99999999E+999 -> -9.99999999E+999
+------------------------------------------------------------------------
+-- copy.decTest -- quiet copy --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+cpyx001 copy +7.50 -> 7.50
+
+-- Infinities
+cpyx011 copy Infinity -> Infinity
+cpyx012 copy -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+cpyx021 copy NaN -> NaN
+cpyx022 copy -NaN -> -NaN
+cpyx023 copy sNaN -> sNaN
+cpyx024 copy -sNaN -> -sNaN
+
+-- NaNs, non-0 payload
+cpyx031 copy NaN10 -> NaN10
+cpyx032 copy -NaN10 -> -NaN10
+cpyx033 copy sNaN10 -> sNaN10
+cpyx034 copy -sNaN10 -> -sNaN10
+cpyx035 copy NaN7 -> NaN7
+cpyx036 copy -NaN7 -> -NaN7
+cpyx037 copy sNaN101 -> sNaN101
+cpyx038 copy -sNaN101 -> -sNaN101
+
+-- finites
+cpyx101 copy 7 -> 7
+cpyx102 copy -7 -> -7
+cpyx103 copy 75 -> 75
+cpyx104 copy -75 -> -75
+cpyx105 copy 7.50 -> 7.50
+cpyx106 copy -7.50 -> -7.50
+cpyx107 copy 7.500 -> 7.500
+cpyx108 copy -7.500 -> -7.500
+
+-- zeros
+cpyx111 copy 0 -> 0
+cpyx112 copy -0 -> -0
+cpyx113 copy 0E+4 -> 0E+4
+cpyx114 copy -0E+4 -> -0E+4
+cpyx115 copy 0.0000 -> 0.0000
+cpyx116 copy -0.0000 -> -0.0000
+cpyx117 copy 0E-141 -> 0E-141
+cpyx118 copy -0E-141 -> -0E-141
+
+-- full coefficients, alternating bits
+cpyx121 copy 268268268 -> 268268268
+cpyx122 copy -268268268 -> -268268268
+cpyx123 copy 134134134 -> 134134134
+cpyx124 copy -134134134 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+cpyx131 copy 9.99999999E+999 -> 9.99999999E+999
+cpyx132 copy 1E-999 -> 1E-999
+cpyx133 copy 1.00000000E-999 -> 1.00000000E-999
+cpyx134 copy 1E-1007 -> 1E-1007
+
+cpyx135 copy -1E-1007 -> -1E-1007
+cpyx136 copy -1.00000000E-999 -> -1.00000000E-999
+cpyx137 copy -1E-999 -> -1E-999
+cpyx138 copy -9.99999999E+999 -> -9.99999999E+999
diff --git a/Lib/test/decimaltestdata/copyabs.decTest b/Lib/test/decimaltestdata/copyabs.decTest
index f7d0f86458..52002dc431 100644
--- a/Lib/test/decimaltestdata/copyabs.decTest
+++ b/Lib/test/decimaltestdata/copyabs.decTest
@@ -1,86 +1,86 @@
-------------------------------------------------------------------------
--- copyAbs.decTest -- quiet copy and set sign to zero --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-cpax001 copyabs +7.50 -> 7.50
-
--- Infinities
-cpax011 copyabs Infinity -> Infinity
-cpax012 copyabs -Infinity -> Infinity
-
--- NaNs, 0 payload
-cpax021 copyabs NaN -> NaN
-cpax022 copyabs -NaN -> NaN
-cpax023 copyabs sNaN -> sNaN
-cpax024 copyabs -sNaN -> sNaN
-
--- NaNs, non-0 payload
-cpax031 copyabs NaN10 -> NaN10
-cpax032 copyabs -NaN15 -> NaN15
-cpax033 copyabs sNaN15 -> sNaN15
-cpax034 copyabs -sNaN10 -> sNaN10
-cpax035 copyabs NaN7 -> NaN7
-cpax036 copyabs -NaN7 -> NaN7
-cpax037 copyabs sNaN101 -> sNaN101
-cpax038 copyabs -sNaN101 -> sNaN101
-
--- finites
-cpax101 copyabs 7 -> 7
-cpax102 copyabs -7 -> 7
-cpax103 copyabs 75 -> 75
-cpax104 copyabs -75 -> 75
-cpax105 copyabs 7.10 -> 7.10
-cpax106 copyabs -7.10 -> 7.10
-cpax107 copyabs 7.500 -> 7.500
-cpax108 copyabs -7.500 -> 7.500
-
--- zeros
-cpax111 copyabs 0 -> 0
-cpax112 copyabs -0 -> 0
-cpax113 copyabs 0E+6 -> 0E+6
-cpax114 copyabs -0E+6 -> 0E+6
-cpax115 copyabs 0.0000 -> 0.0000
-cpax116 copyabs -0.0000 -> 0.0000
-cpax117 copyabs 0E-141 -> 0E-141
-cpax118 copyabs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-cpax121 copyabs 268268268 -> 268268268
-cpax122 copyabs -268268268 -> 268268268
-cpax123 copyabs 134134134 -> 134134134
-cpax124 copyabs -134134134 -> 134134134
-
--- Nmax, Nmin, Ntiny
-cpax131 copyabs 9.99999999E+999 -> 9.99999999E+999
-cpax132 copyabs 1E-999 -> 1E-999
-cpax133 copyabs 1.00000000E-999 -> 1.00000000E-999
-cpax134 copyabs 1E-1007 -> 1E-1007
-
-cpax135 copyabs -1E-1007 -> 1E-1007
-cpax136 copyabs -1.00000000E-999 -> 1.00000000E-999
-cpax137 copyabs -1E-999 -> 1E-999
-cpax199 copyabs -9.99999999E+999 -> 9.99999999E+999
+------------------------------------------------------------------------
+-- copyAbs.decTest -- quiet copy and set sign to zero --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+cpax001 copyabs +7.50 -> 7.50
+
+-- Infinities
+cpax011 copyabs Infinity -> Infinity
+cpax012 copyabs -Infinity -> Infinity
+
+-- NaNs, 0 payload
+cpax021 copyabs NaN -> NaN
+cpax022 copyabs -NaN -> NaN
+cpax023 copyabs sNaN -> sNaN
+cpax024 copyabs -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+cpax031 copyabs NaN10 -> NaN10
+cpax032 copyabs -NaN15 -> NaN15
+cpax033 copyabs sNaN15 -> sNaN15
+cpax034 copyabs -sNaN10 -> sNaN10
+cpax035 copyabs NaN7 -> NaN7
+cpax036 copyabs -NaN7 -> NaN7
+cpax037 copyabs sNaN101 -> sNaN101
+cpax038 copyabs -sNaN101 -> sNaN101
+
+-- finites
+cpax101 copyabs 7 -> 7
+cpax102 copyabs -7 -> 7
+cpax103 copyabs 75 -> 75
+cpax104 copyabs -75 -> 75
+cpax105 copyabs 7.10 -> 7.10
+cpax106 copyabs -7.10 -> 7.10
+cpax107 copyabs 7.500 -> 7.500
+cpax108 copyabs -7.500 -> 7.500
+
+-- zeros
+cpax111 copyabs 0 -> 0
+cpax112 copyabs -0 -> 0
+cpax113 copyabs 0E+6 -> 0E+6
+cpax114 copyabs -0E+6 -> 0E+6
+cpax115 copyabs 0.0000 -> 0.0000
+cpax116 copyabs -0.0000 -> 0.0000
+cpax117 copyabs 0E-141 -> 0E-141
+cpax118 copyabs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+cpax121 copyabs 268268268 -> 268268268
+cpax122 copyabs -268268268 -> 268268268
+cpax123 copyabs 134134134 -> 134134134
+cpax124 copyabs -134134134 -> 134134134
+
+-- Nmax, Nmin, Ntiny
+cpax131 copyabs 9.99999999E+999 -> 9.99999999E+999
+cpax132 copyabs 1E-999 -> 1E-999
+cpax133 copyabs 1.00000000E-999 -> 1.00000000E-999
+cpax134 copyabs 1E-1007 -> 1E-1007
+
+cpax135 copyabs -1E-1007 -> 1E-1007
+cpax136 copyabs -1.00000000E-999 -> 1.00000000E-999
+cpax137 copyabs -1E-999 -> 1E-999
+cpax199 copyabs -9.99999999E+999 -> 9.99999999E+999
diff --git a/Lib/test/decimaltestdata/copynegate.decTest b/Lib/test/decimaltestdata/copynegate.decTest
index 38235b60f9..7f8de9d932 100644
--- a/Lib/test/decimaltestdata/copynegate.decTest
+++ b/Lib/test/decimaltestdata/copynegate.decTest
@@ -1,86 +1,86 @@
-------------------------------------------------------------------------
--- copyNegate.decTest -- quiet copy and negate --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-cpnx001 copynegate +7.50 -> -7.50
-
--- Infinities
-cpnx011 copynegate Infinity -> -Infinity
-cpnx012 copynegate -Infinity -> Infinity
-
--- NaNs, 0 payload
-cpnx021 copynegate NaN -> -NaN
-cpnx022 copynegate -NaN -> NaN
-cpnx023 copynegate sNaN -> -sNaN
-cpnx024 copynegate -sNaN -> sNaN
-
--- NaNs, non-0 payload
-cpnx031 copynegate NaN13 -> -NaN13
-cpnx032 copynegate -NaN13 -> NaN13
-cpnx033 copynegate sNaN13 -> -sNaN13
-cpnx034 copynegate -sNaN13 -> sNaN13
-cpnx035 copynegate NaN70 -> -NaN70
-cpnx036 copynegate -NaN70 -> NaN70
-cpnx037 copynegate sNaN101 -> -sNaN101
-cpnx038 copynegate -sNaN101 -> sNaN101
-
--- finites
-cpnx101 copynegate 7 -> -7
-cpnx102 copynegate -7 -> 7
-cpnx103 copynegate 75 -> -75
-cpnx104 copynegate -75 -> 75
-cpnx105 copynegate 7.50 -> -7.50
-cpnx106 copynegate -7.50 -> 7.50
-cpnx107 copynegate 7.500 -> -7.500
-cpnx108 copynegate -7.500 -> 7.500
-
--- zeros
-cpnx111 copynegate 0 -> -0
-cpnx112 copynegate -0 -> 0
-cpnx113 copynegate 0E+4 -> -0E+4
-cpnx114 copynegate -0E+4 -> 0E+4
-cpnx115 copynegate 0.0000 -> -0.0000
-cpnx116 copynegate -0.0000 -> 0.0000
-cpnx117 copynegate 0E-141 -> -0E-141
-cpnx118 copynegate -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-cpnx121 copynegate 268268268 -> -268268268
-cpnx122 copynegate -268268268 -> 268268268
-cpnx123 copynegate 134134134 -> -134134134
-cpnx124 copynegate -134134134 -> 134134134
-
--- Nmax, Nmin, Ntiny
-cpnx131 copynegate 9.99999999E+999 -> -9.99999999E+999
-cpnx132 copynegate 1E-999 -> -1E-999
-cpnx133 copynegate 1.00000000E-999 -> -1.00000000E-999
-cpnx134 copynegate 1E-1007 -> -1E-1007
-
-cpnx135 copynegate -1E-1007 -> 1E-1007
-cpnx136 copynegate -1.00000000E-999 -> 1.00000000E-999
-cpnx137 copynegate -1E-999 -> 1E-999
-cpnx138 copynegate -9.99999999E+999 -> 9.99999999E+999
+------------------------------------------------------------------------
+-- copyNegate.decTest -- quiet copy and negate --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+cpnx001 copynegate +7.50 -> -7.50
+
+-- Infinities
+cpnx011 copynegate Infinity -> -Infinity
+cpnx012 copynegate -Infinity -> Infinity
+
+-- NaNs, 0 payload
+cpnx021 copynegate NaN -> -NaN
+cpnx022 copynegate -NaN -> NaN
+cpnx023 copynegate sNaN -> -sNaN
+cpnx024 copynegate -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+cpnx031 copynegate NaN13 -> -NaN13
+cpnx032 copynegate -NaN13 -> NaN13
+cpnx033 copynegate sNaN13 -> -sNaN13
+cpnx034 copynegate -sNaN13 -> sNaN13
+cpnx035 copynegate NaN70 -> -NaN70
+cpnx036 copynegate -NaN70 -> NaN70
+cpnx037 copynegate sNaN101 -> -sNaN101
+cpnx038 copynegate -sNaN101 -> sNaN101
+
+-- finites
+cpnx101 copynegate 7 -> -7
+cpnx102 copynegate -7 -> 7
+cpnx103 copynegate 75 -> -75
+cpnx104 copynegate -75 -> 75
+cpnx105 copynegate 7.50 -> -7.50
+cpnx106 copynegate -7.50 -> 7.50
+cpnx107 copynegate 7.500 -> -7.500
+cpnx108 copynegate -7.500 -> 7.500
+
+-- zeros
+cpnx111 copynegate 0 -> -0
+cpnx112 copynegate -0 -> 0
+cpnx113 copynegate 0E+4 -> -0E+4
+cpnx114 copynegate -0E+4 -> 0E+4
+cpnx115 copynegate 0.0000 -> -0.0000
+cpnx116 copynegate -0.0000 -> 0.0000
+cpnx117 copynegate 0E-141 -> -0E-141
+cpnx118 copynegate -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+cpnx121 copynegate 268268268 -> -268268268
+cpnx122 copynegate -268268268 -> 268268268
+cpnx123 copynegate 134134134 -> -134134134
+cpnx124 copynegate -134134134 -> 134134134
+
+-- Nmax, Nmin, Ntiny
+cpnx131 copynegate 9.99999999E+999 -> -9.99999999E+999
+cpnx132 copynegate 1E-999 -> -1E-999
+cpnx133 copynegate 1.00000000E-999 -> -1.00000000E-999
+cpnx134 copynegate 1E-1007 -> -1E-1007
+
+cpnx135 copynegate -1E-1007 -> 1E-1007
+cpnx136 copynegate -1.00000000E-999 -> 1.00000000E-999
+cpnx137 copynegate -1E-999 -> 1E-999
+cpnx138 copynegate -9.99999999E+999 -> 9.99999999E+999
diff --git a/Lib/test/decimaltestdata/copysign.decTest b/Lib/test/decimaltestdata/copysign.decTest
index 8061a4219c..afdd670d3c 100644
--- a/Lib/test/decimaltestdata/copysign.decTest
+++ b/Lib/test/decimaltestdata/copysign.decTest
@@ -1,177 +1,177 @@
-------------------------------------------------------------------------
--- copysign.decTest -- quiet copy with sign from rhs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check, and examples from decArith
-cpsx001 copysign +7.50 11 -> 7.50
-cpsx002 copysign '1.50' '7.33' -> 1.50
-cpsx003 copysign '-1.50' '7.33' -> 1.50
-cpsx004 copysign '1.50' '-7.33' -> -1.50
-cpsx005 copysign '-1.50' '-7.33' -> -1.50
-
--- Infinities
-cpsx011 copysign Infinity 11 -> Infinity
-cpsx012 copysign -Infinity 11 -> Infinity
-
--- NaNs, 0 payload
-cpsx021 copysign NaN 11 -> NaN
-cpsx022 copysign -NaN 11 -> NaN
-cpsx023 copysign sNaN 11 -> sNaN
-cpsx024 copysign -sNaN 11 -> sNaN
-
--- NaNs, non-0 payload
-cpsx031 copysign NaN10 11 -> NaN10
-cpsx032 copysign -NaN10 11 -> NaN10
-cpsx033 copysign sNaN10 11 -> sNaN10
-cpsx034 copysign -sNaN10 11 -> sNaN10
-cpsx035 copysign NaN7 11 -> NaN7
-cpsx036 copysign -NaN7 11 -> NaN7
-cpsx037 copysign sNaN101 11 -> sNaN101
-cpsx038 copysign -sNaN101 11 -> sNaN101
-
--- finites
-cpsx101 copysign 7 11 -> 7
-cpsx102 copysign -7 11 -> 7
-cpsx103 copysign 75 11 -> 75
-cpsx104 copysign -75 11 -> 75
-cpsx105 copysign 7.50 11 -> 7.50
-cpsx106 copysign -7.50 11 -> 7.50
-cpsx107 copysign 7.500 11 -> 7.500
-cpsx108 copysign -7.500 11 -> 7.500
-
--- zeros
-cpsx111 copysign 0 11 -> 0
-cpsx112 copysign -0 11 -> 0
-cpsx113 copysign 0E+4 11 -> 0E+4
-cpsx114 copysign -0E+4 11 -> 0E+4
-cpsx115 copysign 0.0000 11 -> 0.0000
-cpsx116 copysign -0.0000 11 -> 0.0000
-cpsx117 copysign 0E-141 11 -> 0E-141
-cpsx118 copysign -0E-141 11 -> 0E-141
-
--- full coefficients, alternating bits
-cpsx121 copysign 268268268 11 -> 268268268
-cpsx122 copysign -268268268 11 -> 268268268
-cpsx123 copysign 134134134 11 -> 134134134
-cpsx124 copysign -134134134 11 -> 134134134
-
--- Nmax, Nmin, Ntiny
-cpsx131 copysign 9.99999999E+999 11 -> 9.99999999E+999
-cpsx132 copysign 1E-999 11 -> 1E-999
-cpsx133 copysign 1.00000000E-999 11 -> 1.00000000E-999
-cpsx134 copysign 1E-1007 11 -> 1E-1007
-
-cpsx135 copysign -1E-1007 11 -> 1E-1007
-cpsx136 copysign -1.00000000E-999 11 -> 1.00000000E-999
-cpsx137 copysign -1E-999 11 -> 1E-999
-cpsx138 copysign -9.99999999E+999 11 -> 9.99999999E+999
-
--- repeat with negative RHS
-
--- Infinities
-cpsx211 copysign Infinity -34 -> -Infinity
-cpsx212 copysign -Infinity -34 -> -Infinity
-
--- NaNs, 0 payload
-cpsx221 copysign NaN -34 -> -NaN
-cpsx222 copysign -NaN -34 -> -NaN
-cpsx223 copysign sNaN -34 -> -sNaN
-cpsx224 copysign -sNaN -34 -> -sNaN
-
--- NaNs, non-0 payload
-cpsx231 copysign NaN10 -34 -> -NaN10
-cpsx232 copysign -NaN10 -34 -> -NaN10
-cpsx233 copysign sNaN10 -34 -> -sNaN10
-cpsx234 copysign -sNaN10 -34 -> -sNaN10
-cpsx235 copysign NaN7 -34 -> -NaN7
-cpsx236 copysign -NaN7 -34 -> -NaN7
-cpsx237 copysign sNaN101 -34 -> -sNaN101
-cpsx238 copysign -sNaN101 -34 -> -sNaN101
-
--- finites
-cpsx301 copysign 7 -34 -> -7
-cpsx302 copysign -7 -34 -> -7
-cpsx303 copysign 75 -34 -> -75
-cpsx304 copysign -75 -34 -> -75
-cpsx305 copysign 7.50 -34 -> -7.50
-cpsx306 copysign -7.50 -34 -> -7.50
-cpsx307 copysign 7.500 -34 -> -7.500
-cpsx308 copysign -7.500 -34 -> -7.500
-
--- zeros
-cpsx311 copysign 0 -34 -> -0
-cpsx312 copysign -0 -34 -> -0
-cpsx313 copysign 0E+4 -34 -> -0E+4
-cpsx314 copysign -0E+4 -34 -> -0E+4
-cpsx315 copysign 0.0000 -34 -> -0.0000
-cpsx316 copysign -0.0000 -34 -> -0.0000
-cpsx317 copysign 0E-141 -34 -> -0E-141
-cpsx318 copysign -0E-141 -34 -> -0E-141
-
--- full coefficients, alternating bits
-cpsx321 copysign 268268268 -18 -> -268268268
-cpsx322 copysign -268268268 -18 -> -268268268
-cpsx323 copysign 134134134 -18 -> -134134134
-cpsx324 copysign -134134134 -18 -> -134134134
-
--- Nmax, Nmin, Ntiny
-cpsx331 copysign 9.99999999E+999 -18 -> -9.99999999E+999
-cpsx332 copysign 1E-999 -18 -> -1E-999
-cpsx333 copysign 1.00000000E-999 -18 -> -1.00000000E-999
-cpsx334 copysign 1E-1007 -18 -> -1E-1007
-
-cpsx335 copysign -1E-1007 -18 -> -1E-1007
-cpsx336 copysign -1.00000000E-999 -18 -> -1.00000000E-999
-cpsx337 copysign -1E-999 -18 -> -1E-999
-cpsx338 copysign -9.99999999E+999 -18 -> -9.99999999E+999
-
--- Other kinds of RHS
-cpsx401 copysign 701 -34 -> -701
-cpsx402 copysign -720 -34 -> -720
-cpsx403 copysign 701 -0 -> -701
-cpsx404 copysign -720 -0 -> -720
-cpsx405 copysign 701 +0 -> 701
-cpsx406 copysign -720 +0 -> 720
-cpsx407 copysign 701 +34 -> 701
-cpsx408 copysign -720 +34 -> 720
-
-cpsx413 copysign 701 -Inf -> -701
-cpsx414 copysign -720 -Inf -> -720
-cpsx415 copysign 701 +Inf -> 701
-cpsx416 copysign -720 +Inf -> 720
-
-cpsx420 copysign 701 -NaN -> -701
-cpsx421 copysign -720 -NaN -> -720
-cpsx422 copysign 701 +NaN -> 701
-cpsx423 copysign -720 +NaN -> 720
-cpsx425 copysign -720 +NaN8 -> 720
-
-cpsx426 copysign 701 -sNaN -> -701
-cpsx427 copysign -720 -sNaN -> -720
-cpsx428 copysign 701 +sNaN -> 701
-cpsx429 copysign -720 +sNaN -> 720
-cpsx430 copysign -720 +sNaN3 -> 720
-
+------------------------------------------------------------------------
+-- copysign.decTest -- quiet copy with sign from rhs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check, and examples from decArith
+cpsx001 copysign +7.50 11 -> 7.50
+cpsx002 copysign '1.50' '7.33' -> 1.50
+cpsx003 copysign '-1.50' '7.33' -> 1.50
+cpsx004 copysign '1.50' '-7.33' -> -1.50
+cpsx005 copysign '-1.50' '-7.33' -> -1.50
+
+-- Infinities
+cpsx011 copysign Infinity 11 -> Infinity
+cpsx012 copysign -Infinity 11 -> Infinity
+
+-- NaNs, 0 payload
+cpsx021 copysign NaN 11 -> NaN
+cpsx022 copysign -NaN 11 -> NaN
+cpsx023 copysign sNaN 11 -> sNaN
+cpsx024 copysign -sNaN 11 -> sNaN
+
+-- NaNs, non-0 payload
+cpsx031 copysign NaN10 11 -> NaN10
+cpsx032 copysign -NaN10 11 -> NaN10
+cpsx033 copysign sNaN10 11 -> sNaN10
+cpsx034 copysign -sNaN10 11 -> sNaN10
+cpsx035 copysign NaN7 11 -> NaN7
+cpsx036 copysign -NaN7 11 -> NaN7
+cpsx037 copysign sNaN101 11 -> sNaN101
+cpsx038 copysign -sNaN101 11 -> sNaN101
+
+-- finites
+cpsx101 copysign 7 11 -> 7
+cpsx102 copysign -7 11 -> 7
+cpsx103 copysign 75 11 -> 75
+cpsx104 copysign -75 11 -> 75
+cpsx105 copysign 7.50 11 -> 7.50
+cpsx106 copysign -7.50 11 -> 7.50
+cpsx107 copysign 7.500 11 -> 7.500
+cpsx108 copysign -7.500 11 -> 7.500
+
+-- zeros
+cpsx111 copysign 0 11 -> 0
+cpsx112 copysign -0 11 -> 0
+cpsx113 copysign 0E+4 11 -> 0E+4
+cpsx114 copysign -0E+4 11 -> 0E+4
+cpsx115 copysign 0.0000 11 -> 0.0000
+cpsx116 copysign -0.0000 11 -> 0.0000
+cpsx117 copysign 0E-141 11 -> 0E-141
+cpsx118 copysign -0E-141 11 -> 0E-141
+
+-- full coefficients, alternating bits
+cpsx121 copysign 268268268 11 -> 268268268
+cpsx122 copysign -268268268 11 -> 268268268
+cpsx123 copysign 134134134 11 -> 134134134
+cpsx124 copysign -134134134 11 -> 134134134
+
+-- Nmax, Nmin, Ntiny
+cpsx131 copysign 9.99999999E+999 11 -> 9.99999999E+999
+cpsx132 copysign 1E-999 11 -> 1E-999
+cpsx133 copysign 1.00000000E-999 11 -> 1.00000000E-999
+cpsx134 copysign 1E-1007 11 -> 1E-1007
+
+cpsx135 copysign -1E-1007 11 -> 1E-1007
+cpsx136 copysign -1.00000000E-999 11 -> 1.00000000E-999
+cpsx137 copysign -1E-999 11 -> 1E-999
+cpsx138 copysign -9.99999999E+999 11 -> 9.99999999E+999
+
+-- repeat with negative RHS
+
+-- Infinities
+cpsx211 copysign Infinity -34 -> -Infinity
+cpsx212 copysign -Infinity -34 -> -Infinity
+
+-- NaNs, 0 payload
+cpsx221 copysign NaN -34 -> -NaN
+cpsx222 copysign -NaN -34 -> -NaN
+cpsx223 copysign sNaN -34 -> -sNaN
+cpsx224 copysign -sNaN -34 -> -sNaN
+
+-- NaNs, non-0 payload
+cpsx231 copysign NaN10 -34 -> -NaN10
+cpsx232 copysign -NaN10 -34 -> -NaN10
+cpsx233 copysign sNaN10 -34 -> -sNaN10
+cpsx234 copysign -sNaN10 -34 -> -sNaN10
+cpsx235 copysign NaN7 -34 -> -NaN7
+cpsx236 copysign -NaN7 -34 -> -NaN7
+cpsx237 copysign sNaN101 -34 -> -sNaN101
+cpsx238 copysign -sNaN101 -34 -> -sNaN101
+
+-- finites
+cpsx301 copysign 7 -34 -> -7
+cpsx302 copysign -7 -34 -> -7
+cpsx303 copysign 75 -34 -> -75
+cpsx304 copysign -75 -34 -> -75
+cpsx305 copysign 7.50 -34 -> -7.50
+cpsx306 copysign -7.50 -34 -> -7.50
+cpsx307 copysign 7.500 -34 -> -7.500
+cpsx308 copysign -7.500 -34 -> -7.500
+
+-- zeros
+cpsx311 copysign 0 -34 -> -0
+cpsx312 copysign -0 -34 -> -0
+cpsx313 copysign 0E+4 -34 -> -0E+4
+cpsx314 copysign -0E+4 -34 -> -0E+4
+cpsx315 copysign 0.0000 -34 -> -0.0000
+cpsx316 copysign -0.0000 -34 -> -0.0000
+cpsx317 copysign 0E-141 -34 -> -0E-141
+cpsx318 copysign -0E-141 -34 -> -0E-141
+
+-- full coefficients, alternating bits
+cpsx321 copysign 268268268 -18 -> -268268268
+cpsx322 copysign -268268268 -18 -> -268268268
+cpsx323 copysign 134134134 -18 -> -134134134
+cpsx324 copysign -134134134 -18 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+cpsx331 copysign 9.99999999E+999 -18 -> -9.99999999E+999
+cpsx332 copysign 1E-999 -18 -> -1E-999
+cpsx333 copysign 1.00000000E-999 -18 -> -1.00000000E-999
+cpsx334 copysign 1E-1007 -18 -> -1E-1007
+
+cpsx335 copysign -1E-1007 -18 -> -1E-1007
+cpsx336 copysign -1.00000000E-999 -18 -> -1.00000000E-999
+cpsx337 copysign -1E-999 -18 -> -1E-999
+cpsx338 copysign -9.99999999E+999 -18 -> -9.99999999E+999
+
+-- Other kinds of RHS
+cpsx401 copysign 701 -34 -> -701
+cpsx402 copysign -720 -34 -> -720
+cpsx403 copysign 701 -0 -> -701
+cpsx404 copysign -720 -0 -> -720
+cpsx405 copysign 701 +0 -> 701
+cpsx406 copysign -720 +0 -> 720
+cpsx407 copysign 701 +34 -> 701
+cpsx408 copysign -720 +34 -> 720
+
+cpsx413 copysign 701 -Inf -> -701
+cpsx414 copysign -720 -Inf -> -720
+cpsx415 copysign 701 +Inf -> 701
+cpsx416 copysign -720 +Inf -> 720
+
+cpsx420 copysign 701 -NaN -> -701
+cpsx421 copysign -720 -NaN -> -720
+cpsx422 copysign 701 +NaN -> 701
+cpsx423 copysign -720 +NaN -> 720
+cpsx425 copysign -720 +NaN8 -> 720
+
+cpsx426 copysign 701 -sNaN -> -701
+cpsx427 copysign -720 -sNaN -> -720
+cpsx428 copysign 701 +sNaN -> 701
+cpsx429 copysign -720 +sNaN -> 720
+cpsx430 copysign -720 +sNaN3 -> 720
+
diff --git a/Lib/test/decimaltestdata/ddAbs.decTest b/Lib/test/decimaltestdata/ddAbs.decTest
index c6f5a7cda3..b98d64a11a 100644
--- a/Lib/test/decimaltestdata/ddAbs.decTest
+++ b/Lib/test/decimaltestdata/ddAbs.decTest
@@ -1,126 +1,126 @@
-------------------------------------------------------------------------
--- ddAbs.decTest -- decDouble absolute value, heeding sNaN --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddabs001 abs '1' -> '1'
-ddabs002 abs '-1' -> '1'
-ddabs003 abs '1.00' -> '1.00'
-ddabs004 abs '-1.00' -> '1.00'
-ddabs005 abs '0' -> '0'
-ddabs006 abs '0.00' -> '0.00'
-ddabs007 abs '00.0' -> '0.0'
-ddabs008 abs '00.00' -> '0.00'
-ddabs009 abs '00' -> '0'
-
-ddabs010 abs '-2' -> '2'
-ddabs011 abs '2' -> '2'
-ddabs012 abs '-2.00' -> '2.00'
-ddabs013 abs '2.00' -> '2.00'
-ddabs014 abs '-0' -> '0'
-ddabs015 abs '-0.00' -> '0.00'
-ddabs016 abs '-00.0' -> '0.0'
-ddabs017 abs '-00.00' -> '0.00'
-ddabs018 abs '-00' -> '0'
-
-ddabs020 abs '-2000000' -> '2000000'
-ddabs021 abs '2000000' -> '2000000'
-
-ddabs030 abs '+0.1' -> '0.1'
-ddabs031 abs '-0.1' -> '0.1'
-ddabs032 abs '+0.01' -> '0.01'
-ddabs033 abs '-0.01' -> '0.01'
-ddabs034 abs '+0.001' -> '0.001'
-ddabs035 abs '-0.001' -> '0.001'
-ddabs036 abs '+0.000001' -> '0.000001'
-ddabs037 abs '-0.000001' -> '0.000001'
-ddabs038 abs '+0.000000000001' -> '1E-12'
-ddabs039 abs '-0.000000000001' -> '1E-12'
-
--- examples from decArith
-ddabs040 abs '2.1' -> '2.1'
-ddabs041 abs '-100' -> '100'
-ddabs042 abs '101.5' -> '101.5'
-ddabs043 abs '-101.5' -> '101.5'
-
--- more fixed, potential LHS swaps/overlays if done by subtract 0
-ddabs060 abs '-56267E-10' -> '0.0000056267'
-ddabs061 abs '-56267E-5' -> '0.56267'
-ddabs062 abs '-56267E-2' -> '562.67'
-ddabs063 abs '-56267E-1' -> '5626.7'
-ddabs065 abs '-56267E-0' -> '56267'
-
--- subnormals and underflow
-
--- long operand tests
-ddabs321 abs 1234567890123456 -> 1234567890123456
-ddabs322 abs 12345678000 -> 12345678000
-ddabs323 abs 1234567800 -> 1234567800
-ddabs324 abs 1234567890 -> 1234567890
-ddabs325 abs 1234567891 -> 1234567891
-ddabs326 abs 12345678901 -> 12345678901
-ddabs327 abs 1234567896 -> 1234567896
-
--- zeros
-ddabs111 abs 0 -> 0
-ddabs112 abs -0 -> 0
-ddabs113 abs 0E+6 -> 0E+6
-ddabs114 abs -0E+6 -> 0E+6
-ddabs115 abs 0.0000 -> 0.0000
-ddabs116 abs -0.0000 -> 0.0000
-ddabs117 abs 0E-141 -> 0E-141
-ddabs118 abs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddabs121 abs 2682682682682682 -> 2682682682682682
-ddabs122 abs -2682682682682682 -> 2682682682682682
-ddabs123 abs 1341341341341341 -> 1341341341341341
-ddabs124 abs -1341341341341341 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddabs131 abs 9.999999999999999E+384 -> 9.999999999999999E+384
-ddabs132 abs 1E-383 -> 1E-383
-ddabs133 abs 1.000000000000000E-383 -> 1.000000000000000E-383
-ddabs134 abs 1E-398 -> 1E-398 Subnormal
-
-ddabs135 abs -1E-398 -> 1E-398 Subnormal
-ddabs136 abs -1.000000000000000E-383 -> 1.000000000000000E-383
-ddabs137 abs -1E-383 -> 1E-383
-ddabs138 abs -9.999999999999999E+384 -> 9.999999999999999E+384
-
--- specials
-ddabs520 abs 'Inf' -> 'Infinity'
-ddabs521 abs '-Inf' -> 'Infinity'
-ddabs522 abs NaN -> NaN
-ddabs523 abs sNaN -> NaN Invalid_operation
-ddabs524 abs NaN22 -> NaN22
-ddabs525 abs sNaN33 -> NaN33 Invalid_operation
-ddabs526 abs -NaN22 -> -NaN22
-ddabs527 abs -sNaN33 -> -NaN33 Invalid_operation
-
--- Null tests
-ddabs900 abs # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddAbs.decTest -- decDouble absolute value, heeding sNaN --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddabs001 abs '1' -> '1'
+ddabs002 abs '-1' -> '1'
+ddabs003 abs '1.00' -> '1.00'
+ddabs004 abs '-1.00' -> '1.00'
+ddabs005 abs '0' -> '0'
+ddabs006 abs '0.00' -> '0.00'
+ddabs007 abs '00.0' -> '0.0'
+ddabs008 abs '00.00' -> '0.00'
+ddabs009 abs '00' -> '0'
+
+ddabs010 abs '-2' -> '2'
+ddabs011 abs '2' -> '2'
+ddabs012 abs '-2.00' -> '2.00'
+ddabs013 abs '2.00' -> '2.00'
+ddabs014 abs '-0' -> '0'
+ddabs015 abs '-0.00' -> '0.00'
+ddabs016 abs '-00.0' -> '0.0'
+ddabs017 abs '-00.00' -> '0.00'
+ddabs018 abs '-00' -> '0'
+
+ddabs020 abs '-2000000' -> '2000000'
+ddabs021 abs '2000000' -> '2000000'
+
+ddabs030 abs '+0.1' -> '0.1'
+ddabs031 abs '-0.1' -> '0.1'
+ddabs032 abs '+0.01' -> '0.01'
+ddabs033 abs '-0.01' -> '0.01'
+ddabs034 abs '+0.001' -> '0.001'
+ddabs035 abs '-0.001' -> '0.001'
+ddabs036 abs '+0.000001' -> '0.000001'
+ddabs037 abs '-0.000001' -> '0.000001'
+ddabs038 abs '+0.000000000001' -> '1E-12'
+ddabs039 abs '-0.000000000001' -> '1E-12'
+
+-- examples from decArith
+ddabs040 abs '2.1' -> '2.1'
+ddabs041 abs '-100' -> '100'
+ddabs042 abs '101.5' -> '101.5'
+ddabs043 abs '-101.5' -> '101.5'
+
+-- more fixed, potential LHS swaps/overlays if done by subtract 0
+ddabs060 abs '-56267E-10' -> '0.0000056267'
+ddabs061 abs '-56267E-5' -> '0.56267'
+ddabs062 abs '-56267E-2' -> '562.67'
+ddabs063 abs '-56267E-1' -> '5626.7'
+ddabs065 abs '-56267E-0' -> '56267'
+
+-- subnormals and underflow
+
+-- long operand tests
+ddabs321 abs 1234567890123456 -> 1234567890123456
+ddabs322 abs 12345678000 -> 12345678000
+ddabs323 abs 1234567800 -> 1234567800
+ddabs324 abs 1234567890 -> 1234567890
+ddabs325 abs 1234567891 -> 1234567891
+ddabs326 abs 12345678901 -> 12345678901
+ddabs327 abs 1234567896 -> 1234567896
+
+-- zeros
+ddabs111 abs 0 -> 0
+ddabs112 abs -0 -> 0
+ddabs113 abs 0E+6 -> 0E+6
+ddabs114 abs -0E+6 -> 0E+6
+ddabs115 abs 0.0000 -> 0.0000
+ddabs116 abs -0.0000 -> 0.0000
+ddabs117 abs 0E-141 -> 0E-141
+ddabs118 abs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddabs121 abs 2682682682682682 -> 2682682682682682
+ddabs122 abs -2682682682682682 -> 2682682682682682
+ddabs123 abs 1341341341341341 -> 1341341341341341
+ddabs124 abs -1341341341341341 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddabs131 abs 9.999999999999999E+384 -> 9.999999999999999E+384
+ddabs132 abs 1E-383 -> 1E-383
+ddabs133 abs 1.000000000000000E-383 -> 1.000000000000000E-383
+ddabs134 abs 1E-398 -> 1E-398 Subnormal
+
+ddabs135 abs -1E-398 -> 1E-398 Subnormal
+ddabs136 abs -1.000000000000000E-383 -> 1.000000000000000E-383
+ddabs137 abs -1E-383 -> 1E-383
+ddabs138 abs -9.999999999999999E+384 -> 9.999999999999999E+384
+
+-- specials
+ddabs520 abs 'Inf' -> 'Infinity'
+ddabs521 abs '-Inf' -> 'Infinity'
+ddabs522 abs NaN -> NaN
+ddabs523 abs sNaN -> NaN Invalid_operation
+ddabs524 abs NaN22 -> NaN22
+ddabs525 abs sNaN33 -> NaN33 Invalid_operation
+ddabs526 abs -NaN22 -> -NaN22
+ddabs527 abs -sNaN33 -> -NaN33 Invalid_operation
+
+-- Null tests
+ddabs900 abs # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddAdd.decTest b/Lib/test/decimaltestdata/ddAdd.decTest
index c0a25b3413..0f12ce4445 100644
--- a/Lib/test/decimaltestdata/ddAdd.decTest
+++ b/Lib/test/decimaltestdata/ddAdd.decTest
@@ -1,1328 +1,1328 @@
-------------------------------------------------------------------------
--- ddAdd.decTest -- decDouble addition --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decDoubles only; all arguments are
--- representable in a decDouble
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- [first group are 'quick confidence check']
-ddadd001 add 1 1 -> 2
-ddadd002 add 2 3 -> 5
-ddadd003 add '5.75' '3.3' -> 9.05
-ddadd004 add '5' '-3' -> 2
-ddadd005 add '-5' '-3' -> -8
-ddadd006 add '-7' '2.5' -> -4.5
-ddadd007 add '0.7' '0.3' -> 1.0
-ddadd008 add '1.25' '1.25' -> 2.50
-ddadd009 add '1.23456789' '1.00000000' -> '2.23456789'
-ddadd010 add '1.23456789' '1.00000011' -> '2.23456800'
-
--- 1234567890123456 1234567890123456
-ddadd011 add '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
-ddadd012 add '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded
-ddadd013 add '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
-ddadd014 add '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded
-ddadd015 add '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded
-ddadd016 add '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
-ddadd017 add '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
-ddadd018 add '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
-ddadd019 add '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded
-ddadd020 add '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded
-
-ddadd021 add 0 1 -> 1
-ddadd022 add 1 1 -> 2
-ddadd023 add 2 1 -> 3
-ddadd024 add 3 1 -> 4
-ddadd025 add 4 1 -> 5
-ddadd026 add 5 1 -> 6
-ddadd027 add 6 1 -> 7
-ddadd028 add 7 1 -> 8
-ddadd029 add 8 1 -> 9
-ddadd030 add 9 1 -> 10
-
--- some carrying effects
-ddadd031 add '0.9998' '0.0000' -> '0.9998'
-ddadd032 add '0.9998' '0.0001' -> '0.9999'
-ddadd033 add '0.9998' '0.0002' -> '1.0000'
-ddadd034 add '0.9998' '0.0003' -> '1.0001'
-
-ddadd035 add '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddadd036 add '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddadd037 add '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddadd038 add '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
-ddadd039 add '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
-
--- symmetry:
-ddadd040 add '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
-ddadd041 add '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
-ddadd042 add '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
-ddadd044 add '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
-ddadd045 add '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
-
--- same, without rounding
-ddadd046 add '10000e+9' '7' -> '10000000000007'
-ddadd047 add '10000e+9' '70' -> '10000000000070'
-ddadd048 add '10000e+9' '700' -> '10000000000700'
-ddadd049 add '10000e+9' '7000' -> '10000000007000'
-ddadd050 add '10000e+9' '70000' -> '10000000070000'
-ddadd051 add '10000e+9' '700000' -> '10000000700000'
-ddadd052 add '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-ddadd053 add '12' '7.00' -> '19.00'
-ddadd054 add '1.3' '-1.07' -> '0.23'
-ddadd055 add '1.3' '-1.30' -> '0.00'
-ddadd056 add '1.3' '-2.07' -> '-0.77'
-ddadd057 add '1E+2' '1E+4' -> '1.01E+4'
-
--- leading zero preservation
-ddadd061 add 1 '0.0001' -> '1.0001'
-ddadd062 add 1 '0.00001' -> '1.00001'
-ddadd063 add 1 '0.000001' -> '1.000001'
-ddadd064 add 1 '0.0000001' -> '1.0000001'
-ddadd065 add 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-ddadd070 add 1 0 -> 1
-ddadd071 add 1 0. -> 1
-ddadd072 add 1 .0 -> 1.0
-ddadd073 add 1 0.0 -> 1.0
-ddadd074 add 1 0.00 -> 1.00
-ddadd075 add 0 1 -> 1
-ddadd076 add 0. 1 -> 1
-ddadd077 add .0 1 -> 1.0
-ddadd078 add 0.0 1 -> 1.0
-ddadd079 add 0.00 1 -> 1.00
-
--- some carries
-ddadd080 add 999999998 1 -> 999999999
-ddadd081 add 999999999 1 -> 1000000000
-ddadd082 add 99999999 1 -> 100000000
-ddadd083 add 9999999 1 -> 10000000
-ddadd084 add 999999 1 -> 1000000
-ddadd085 add 99999 1 -> 100000
-ddadd086 add 9999 1 -> 10000
-ddadd087 add 999 1 -> 1000
-ddadd088 add 99 1 -> 100
-ddadd089 add 9 1 -> 10
-
-
--- more LHS swaps
-ddadd090 add '-56267E-10' 0 -> '-0.0000056267'
-ddadd091 add '-56267E-6' 0 -> '-0.056267'
-ddadd092 add '-56267E-5' 0 -> '-0.56267'
-ddadd093 add '-56267E-4' 0 -> '-5.6267'
-ddadd094 add '-56267E-3' 0 -> '-56.267'
-ddadd095 add '-56267E-2' 0 -> '-562.67'
-ddadd096 add '-56267E-1' 0 -> '-5626.7'
-ddadd097 add '-56267E-0' 0 -> '-56267'
-ddadd098 add '-5E-10' 0 -> '-5E-10'
-ddadd099 add '-5E-7' 0 -> '-5E-7'
-ddadd100 add '-5E-6' 0 -> '-0.000005'
-ddadd101 add '-5E-5' 0 -> '-0.00005'
-ddadd102 add '-5E-4' 0 -> '-0.0005'
-ddadd103 add '-5E-1' 0 -> '-0.5'
-ddadd104 add '-5E0' 0 -> '-5'
-ddadd105 add '-5E1' 0 -> '-50'
-ddadd106 add '-5E5' 0 -> '-500000'
-ddadd107 add '-5E15' 0 -> '-5000000000000000'
-ddadd108 add '-5E16' 0 -> '-5.000000000000000E+16' Rounded
-ddadd109 add '-5E17' 0 -> '-5.000000000000000E+17' Rounded
-ddadd110 add '-5E18' 0 -> '-5.000000000000000E+18' Rounded
-ddadd111 add '-5E100' 0 -> '-5.000000000000000E+100' Rounded
-
--- more RHS swaps
-ddadd113 add 0 '-56267E-10' -> '-0.0000056267'
-ddadd114 add 0 '-56267E-6' -> '-0.056267'
-ddadd116 add 0 '-56267E-5' -> '-0.56267'
-ddadd117 add 0 '-56267E-4' -> '-5.6267'
-ddadd119 add 0 '-56267E-3' -> '-56.267'
-ddadd120 add 0 '-56267E-2' -> '-562.67'
-ddadd121 add 0 '-56267E-1' -> '-5626.7'
-ddadd122 add 0 '-56267E-0' -> '-56267'
-ddadd123 add 0 '-5E-10' -> '-5E-10'
-ddadd124 add 0 '-5E-7' -> '-5E-7'
-ddadd125 add 0 '-5E-6' -> '-0.000005'
-ddadd126 add 0 '-5E-5' -> '-0.00005'
-ddadd127 add 0 '-5E-4' -> '-0.0005'
-ddadd128 add 0 '-5E-1' -> '-0.5'
-ddadd129 add 0 '-5E0' -> '-5'
-ddadd130 add 0 '-5E1' -> '-50'
-ddadd131 add 0 '-5E5' -> '-500000'
-ddadd132 add 0 '-5E15' -> '-5000000000000000'
-ddadd133 add 0 '-5E16' -> '-5.000000000000000E+16' Rounded
-ddadd134 add 0 '-5E17' -> '-5.000000000000000E+17' Rounded
-ddadd135 add 0 '-5E18' -> '-5.000000000000000E+18' Rounded
-ddadd136 add 0 '-5E100' -> '-5.000000000000000E+100' Rounded
-
--- related
-ddadd137 add 1 '0E-19' -> '1.000000000000000' Rounded
-ddadd138 add -1 '0E-19' -> '-1.000000000000000' Rounded
-ddadd139 add '0E-19' 1 -> '1.000000000000000' Rounded
-ddadd140 add '0E-19' -1 -> '-1.000000000000000' Rounded
-ddadd141 add 1E+11 0.0000 -> '100000000000.0000'
-ddadd142 add 1E+11 0.00000 -> '100000000000.0000' Rounded
-ddadd143 add 0.000 1E+12 -> '1000000000000.000'
-ddadd144 add 0.0000 1E+12 -> '1000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-ddadd146 add '00.0' 0 -> '0.0'
-ddadd147 add '0.00' 0 -> '0.00'
-ddadd148 add 0 '0.00' -> '0.00'
-ddadd149 add 0 '00.0' -> '0.0'
-ddadd150 add '00.0' '0.00' -> '0.00'
-ddadd151 add '0.00' '00.0' -> '0.00'
-ddadd152 add '3' '.3' -> '3.3'
-ddadd153 add '3.' '.3' -> '3.3'
-ddadd154 add '3.0' '.3' -> '3.3'
-ddadd155 add '3.00' '.3' -> '3.30'
-ddadd156 add '3' '3' -> '6'
-ddadd157 add '3' '+3' -> '6'
-ddadd158 add '3' '-3' -> '0'
-ddadd159 add '0.3' '-0.3' -> '0.0'
-ddadd160 add '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-ddadd161 add '1E+12' '-1' -> '999999999999'
-ddadd162 add '1E+12' '1.11' -> '1000000000001.11'
-ddadd163 add '1.11' '1E+12' -> '1000000000001.11'
-ddadd164 add '-1' '1E+12' -> '999999999999'
-ddadd165 add '7E+12' '-1' -> '6999999999999'
-ddadd166 add '7E+12' '1.11' -> '7000000000001.11'
-ddadd167 add '1.11' '7E+12' -> '7000000000001.11'
-ddadd168 add '-1' '7E+12' -> '6999999999999'
-
-rounding: half_up
--- 1.234567890123456 1234567890123456 1 234567890123456
-ddadd170 add '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
-ddadd171 add '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
-ddadd172 add '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
-ddadd173 add '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
-ddadd174 add '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
-ddadd175 add '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
-ddadd176 add '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
-ddadd177 add '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded
-ddadd178 add '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
-ddadd179 add '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
-ddadd180 add '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
-ddadd181 add '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
-ddadd182 add '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
-ddadd183 add '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-ddadd200 add '1234560123456789' 0 -> '1234560123456789'
-ddadd201 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddadd202 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddadd203 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddadd204 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddadd205 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddadd206 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddadd207 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddadd208 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
-ddadd209 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
-ddadd210 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
-ddadd211 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
-ddadd212 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
-ddadd213 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
-ddadd214 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
-ddadd215 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
-ddadd216 add '1234560123456789' 1 -> '1234560123456790'
-ddadd217 add '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded
-ddadd218 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddadd219 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
-
-rounding: half_even
-ddadd220 add '1234560123456789' 0 -> '1234560123456789'
-ddadd221 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddadd222 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddadd223 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddadd224 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddadd225 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddadd226 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddadd227 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddadd228 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
-ddadd229 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
-ddadd230 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
-ddadd231 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
-ddadd232 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
-ddadd233 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
-ddadd234 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
-ddadd235 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
-ddadd236 add '1234560123456789' 1 -> '1234560123456790'
-ddadd237 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
-ddadd238 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddadd239 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
--- critical few with even bottom digit...
-ddadd240 add '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded
-ddadd241 add '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded
-ddadd242 add '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded
-
-rounding: down
-ddadd250 add '1234560123456789' 0 -> '1234560123456789'
-ddadd251 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddadd252 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddadd253 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddadd254 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddadd255 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddadd256 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddadd257 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddadd258 add '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded
-ddadd259 add '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded
-ddadd260 add '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded
-ddadd261 add '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded
-ddadd262 add '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded
-ddadd263 add '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded
-ddadd264 add '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded
-ddadd265 add '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded
-ddadd266 add '1234560123456789' 1 -> '1234560123456790'
-ddadd267 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
-ddadd268 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddadd269 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-ddadd301 add -1 1 -> 0
-ddadd302 add 0 1 -> 1
-ddadd303 add 1 1 -> 2
-ddadd304 add 12 1 -> 13
-ddadd305 add 98 1 -> 99
-ddadd306 add 99 1 -> 100
-ddadd307 add 100 1 -> 101
-ddadd308 add 101 1 -> 102
-ddadd309 add -1 -1 -> -2
-ddadd310 add 0 -1 -> -1
-ddadd311 add 1 -1 -> 0
-ddadd312 add 12 -1 -> 11
-ddadd313 add 98 -1 -> 97
-ddadd314 add 99 -1 -> 98
-ddadd315 add 100 -1 -> 99
-ddadd316 add 101 -1 -> 100
-
-ddadd321 add -0.01 0.01 -> 0.00
-ddadd322 add 0.00 0.01 -> 0.01
-ddadd323 add 0.01 0.01 -> 0.02
-ddadd324 add 0.12 0.01 -> 0.13
-ddadd325 add 0.98 0.01 -> 0.99
-ddadd326 add 0.99 0.01 -> 1.00
-ddadd327 add 1.00 0.01 -> 1.01
-ddadd328 add 1.01 0.01 -> 1.02
-ddadd329 add -0.01 -0.01 -> -0.02
-ddadd330 add 0.00 -0.01 -> -0.01
-ddadd331 add 0.01 -0.01 -> 0.00
-ddadd332 add 0.12 -0.01 -> 0.11
-ddadd333 add 0.98 -0.01 -> 0.97
-ddadd334 add 0.99 -0.01 -> 0.98
-ddadd335 add 1.00 -0.01 -> 0.99
-ddadd336 add 1.01 -0.01 -> 1.00
-
--- some more cases where adding 0 affects the coefficient
-ddadd340 add 1E+3 0 -> 1000
-ddadd341 add 1E+15 0 -> 1000000000000000
-ddadd342 add 1E+16 0 -> 1.000000000000000E+16 Rounded
-ddadd343 add 1E+20 0 -> 1.000000000000000E+20 Rounded
--- which simply follow from these cases ...
-ddadd344 add 1E+3 1 -> 1001
-ddadd345 add 1E+15 1 -> 1000000000000001
-ddadd346 add 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
-ddadd347 add 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded
-ddadd348 add 1E+3 7 -> 1007
-ddadd349 add 1E+15 7 -> 1000000000000007
-ddadd350 add 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
-ddadd351 add 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded
-
--- tryzeros cases
-rounding: half_up
-ddadd360 add 0E+50 10000E+1 -> 1.0000E+5
-ddadd361 add 0E-50 10000E+1 -> 100000.0000000000 Rounded
-ddadd362 add 10000E+1 0E-50 -> 100000.0000000000 Rounded
-ddadd363 add 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
-ddadd364 add 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-ddadd370 add 999999999999999 815 -> 1000000000000814
-ddadd371 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-rounding: half_up
-ddadd372 add 999999999999999 815 -> 1000000000000814
-ddadd373 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-rounding: half_even
-ddadd374 add 999999999999999 815 -> 1000000000000814
-ddadd375 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-
--- operands folded
-ddadd380 add 1E+384 1E+384 -> 2.000000000000000E+384 Clamped
-ddadd381 add 1E+380 1E+380 -> 2.00000000000E+380 Clamped
-ddadd382 add 1E+376 1E+376 -> 2.0000000E+376 Clamped
-ddadd383 add 1E+372 1E+372 -> 2.000E+372 Clamped
-ddadd384 add 1E+370 1E+370 -> 2.0E+370 Clamped
-ddadd385 add 1E+369 1E+369 -> 2E+369
-ddadd386 add 1E+368 1E+368 -> 2E+368
-
--- ulp replacement tests
-ddadd400 add 1 77e-14 -> 1.00000000000077
-ddadd401 add 1 77e-15 -> 1.000000000000077
-ddadd402 add 1 77e-16 -> 1.000000000000008 Inexact Rounded
-ddadd403 add 1 77e-17 -> 1.000000000000001 Inexact Rounded
-ddadd404 add 1 77e-18 -> 1.000000000000000 Inexact Rounded
-ddadd405 add 1 77e-19 -> 1.000000000000000 Inexact Rounded
-ddadd406 add 1 77e-299 -> 1.000000000000000 Inexact Rounded
-
-ddadd410 add 10 77e-14 -> 10.00000000000077
-ddadd411 add 10 77e-15 -> 10.00000000000008 Inexact Rounded
-ddadd412 add 10 77e-16 -> 10.00000000000001 Inexact Rounded
-ddadd413 add 10 77e-17 -> 10.00000000000000 Inexact Rounded
-ddadd414 add 10 77e-18 -> 10.00000000000000 Inexact Rounded
-ddadd415 add 10 77e-19 -> 10.00000000000000 Inexact Rounded
-ddadd416 add 10 77e-299 -> 10.00000000000000 Inexact Rounded
-
-ddadd420 add 77e-14 1 -> 1.00000000000077
-ddadd421 add 77e-15 1 -> 1.000000000000077
-ddadd422 add 77e-16 1 -> 1.000000000000008 Inexact Rounded
-ddadd423 add 77e-17 1 -> 1.000000000000001 Inexact Rounded
-ddadd424 add 77e-18 1 -> 1.000000000000000 Inexact Rounded
-ddadd425 add 77e-19 1 -> 1.000000000000000 Inexact Rounded
-ddadd426 add 77e-299 1 -> 1.000000000000000 Inexact Rounded
-
-ddadd430 add 77e-14 10 -> 10.00000000000077
-ddadd431 add 77e-15 10 -> 10.00000000000008 Inexact Rounded
-ddadd432 add 77e-16 10 -> 10.00000000000001 Inexact Rounded
-ddadd433 add 77e-17 10 -> 10.00000000000000 Inexact Rounded
-ddadd434 add 77e-18 10 -> 10.00000000000000 Inexact Rounded
-ddadd435 add 77e-19 10 -> 10.00000000000000 Inexact Rounded
-ddadd436 add 77e-299 10 -> 10.00000000000000 Inexact Rounded
-
--- fastpath boundary (more in dqadd)
--- 1234567890123456
-ddadd539 add '4444444444444444' '3333333333333333' -> '7777777777777777'
-ddadd540 add '4444444444444444' '4444444444444444' -> '8888888888888888'
-ddadd541 add '4444444444444444' '5555555555555555' -> '9999999999999999'
-ddadd542 add '3333333333333333' '4444444444444444' -> '7777777777777777'
-ddadd543 add '4444444444444444' '4444444444444444' -> '8888888888888888'
-ddadd544 add '5555555555555555' '4444444444444444' -> '9999999999999999'
-ddadd545 add '3000004000000000' '3000000000000040' -> '6000004000000040'
-ddadd546 add '3000000400000000' '4000000000000400' -> '7000000400000400'
-ddadd547 add '3000000040000000' '5000000000004000' -> '8000000040004000'
-ddadd548 add '4000000004000000' '3000000000040000' -> '7000000004040000'
-ddadd549 add '4000000000400000' '4000000000400000' -> '8000000000800000'
-ddadd550 add '4000000000040000' '5000000004000000' -> '9000000004040000'
-ddadd551 add '5000000000004000' '3000000040000000' -> '8000000040004000'
-ddadd552 add '5000000000000400' '4000000400000000' -> '9000000400000400'
-ddadd553 add '5000000000000040' '5000004000000000' -> 1.000000400000004E+16 Rounded
--- check propagation
-ddadd554 add '8999999999999999' '0000000000000001' -> 9000000000000000
-ddadd555 add '0000000000000001' '8999999999999999' -> 9000000000000000
-ddadd556 add '0999999999999999' '0000000000000001' -> 1000000000000000
-ddadd557 add '0000000000000001' '0999999999999999' -> 1000000000000000
-ddadd558 add '4444444444444444' '4555555555555556' -> 9000000000000000
-ddadd559 add '4555555555555556' '4444444444444444' -> 9000000000000000
-
--- negative ulps
-ddadd6440 add 1 -77e-14 -> 0.99999999999923
-ddadd6441 add 1 -77e-15 -> 0.999999999999923
-ddadd6442 add 1 -77e-16 -> 0.9999999999999923
-ddadd6443 add 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
-ddadd6444 add 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
-ddadd6445 add 1 -77e-19 -> 1.000000000000000 Inexact Rounded
-ddadd6446 add 1 -77e-99 -> 1.000000000000000 Inexact Rounded
-
-ddadd6450 add 10 -77e-14 -> 9.99999999999923
-ddadd6451 add 10 -77e-15 -> 9.999999999999923
-ddadd6452 add 10 -77e-16 -> 9.999999999999992 Inexact Rounded
-ddadd6453 add 10 -77e-17 -> 9.999999999999999 Inexact Rounded
-ddadd6454 add 10 -77e-18 -> 10.00000000000000 Inexact Rounded
-ddadd6455 add 10 -77e-19 -> 10.00000000000000 Inexact Rounded
-ddadd6456 add 10 -77e-99 -> 10.00000000000000 Inexact Rounded
-
-ddadd6460 add -77e-14 1 -> 0.99999999999923
-ddadd6461 add -77e-15 1 -> 0.999999999999923
-ddadd6462 add -77e-16 1 -> 0.9999999999999923
-ddadd6463 add -77e-17 1 -> 0.9999999999999992 Inexact Rounded
-ddadd6464 add -77e-18 1 -> 0.9999999999999999 Inexact Rounded
-ddadd6465 add -77e-19 1 -> 1.000000000000000 Inexact Rounded
-ddadd6466 add -77e-99 1 -> 1.000000000000000 Inexact Rounded
-
-ddadd6470 add -77e-14 10 -> 9.99999999999923
-ddadd6471 add -77e-15 10 -> 9.999999999999923
-ddadd6472 add -77e-16 10 -> 9.999999999999992 Inexact Rounded
-ddadd6473 add -77e-17 10 -> 9.999999999999999 Inexact Rounded
-ddadd6474 add -77e-18 10 -> 10.00000000000000 Inexact Rounded
-ddadd6475 add -77e-19 10 -> 10.00000000000000 Inexact Rounded
-ddadd6476 add -77e-99 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-ddadd6480 add -1 77e-14 -> -0.99999999999923
-ddadd6481 add -1 77e-15 -> -0.999999999999923
-ddadd6482 add -1 77e-16 -> -0.9999999999999923
-ddadd6483 add -1 77e-17 -> -0.9999999999999992 Inexact Rounded
-ddadd6484 add -1 77e-18 -> -0.9999999999999999 Inexact Rounded
-ddadd6485 add -1 77e-19 -> -1.000000000000000 Inexact Rounded
-ddadd6486 add -1 77e-99 -> -1.000000000000000 Inexact Rounded
-
-ddadd6490 add -10 77e-14 -> -9.99999999999923
-ddadd6491 add -10 77e-15 -> -9.999999999999923
-ddadd6492 add -10 77e-16 -> -9.999999999999992 Inexact Rounded
-ddadd6493 add -10 77e-17 -> -9.999999999999999 Inexact Rounded
-ddadd6494 add -10 77e-18 -> -10.00000000000000 Inexact Rounded
-ddadd6495 add -10 77e-19 -> -10.00000000000000 Inexact Rounded
-ddadd6496 add -10 77e-99 -> -10.00000000000000 Inexact Rounded
-
-ddadd6500 add 77e-14 -1 -> -0.99999999999923
-ddadd6501 add 77e-15 -1 -> -0.999999999999923
-ddadd6502 add 77e-16 -1 -> -0.9999999999999923
-ddadd6503 add 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
-ddadd6504 add 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
-ddadd6505 add 77e-19 -1 -> -1.000000000000000 Inexact Rounded
-ddadd6506 add 77e-99 -1 -> -1.000000000000000 Inexact Rounded
-
-ddadd6510 add 77e-14 -10 -> -9.99999999999923
-ddadd6511 add 77e-15 -10 -> -9.999999999999923
-ddadd6512 add 77e-16 -10 -> -9.999999999999992 Inexact Rounded
-ddadd6513 add 77e-17 -10 -> -9.999999999999999 Inexact Rounded
-ddadd6514 add 77e-18 -10 -> -10.00000000000000 Inexact Rounded
-ddadd6515 add 77e-19 -10 -> -10.00000000000000 Inexact Rounded
-ddadd6516 add 77e-99 -10 -> -10.00000000000000 Inexact Rounded
-
--- and some more residue effects and different roundings
-rounding: half_up
-ddadd6540 add '6543210123456789' 0 -> '6543210123456789'
-ddadd6541 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddadd6542 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddadd6543 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddadd6544 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddadd6545 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddadd6546 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddadd6547 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddadd6548 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-ddadd6549 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-ddadd6550 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-ddadd6551 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-ddadd6552 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-ddadd6553 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-ddadd6554 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-ddadd6555 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
-ddadd6556 add '6543210123456789' 1 -> '6543210123456790'
-ddadd6557 add '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
-ddadd6558 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddadd6559 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
-rounding: half_even
-ddadd6560 add '6543210123456789' 0 -> '6543210123456789'
-ddadd6561 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddadd6562 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddadd6563 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddadd6564 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddadd6565 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddadd6566 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddadd6567 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddadd6568 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-ddadd6569 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-ddadd6570 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-ddadd6571 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-ddadd6572 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-ddadd6573 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-ddadd6574 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-ddadd6575 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
-ddadd6576 add '6543210123456789' 1 -> '6543210123456790'
-ddadd6577 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-ddadd6578 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddadd6579 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
--- critical few with even bottom digit...
-ddadd7540 add '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded
-ddadd7541 add '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
-ddadd7542 add '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
-
-rounding: down
-ddadd7550 add '6543210123456789' 0 -> '6543210123456789'
-ddadd7551 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddadd7552 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddadd7553 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddadd7554 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddadd7555 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddadd7556 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddadd7557 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddadd7558 add '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
-ddadd7559 add '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
-ddadd7560 add '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
-ddadd7561 add '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
-ddadd7562 add '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
-ddadd7563 add '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
-ddadd7564 add '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
-ddadd7565 add '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded
-ddadd7566 add '6543210123456789' 1 -> '6543210123456790'
-ddadd7567 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-ddadd7568 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddadd7569 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
--- verify a query
-rounding: down
-ddadd7661 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
-ddadd7662 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
-ddadd7663 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
-ddadd7664 add 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-ddadd7701 add 5.00 1.00E-3 -> 5.00100
-ddadd7702 add 00.00 0.000 -> 0.000
-ddadd7703 add 00.00 0E-3 -> 0.000
-ddadd7704 add 0E-3 00.00 -> 0.000
-
-ddadd7710 add 0E+3 00.00 -> 0.00
-ddadd7711 add 0E+3 00.0 -> 0.0
-ddadd7712 add 0E+3 00. -> 0
-ddadd7713 add 0E+3 00.E+1 -> 0E+1
-ddadd7714 add 0E+3 00.E+2 -> 0E+2
-ddadd7715 add 0E+3 00.E+3 -> 0E+3
-ddadd7716 add 0E+3 00.E+4 -> 0E+3
-ddadd7717 add 0E+3 00.E+5 -> 0E+3
-ddadd7718 add 0E+3 -00.0 -> 0.0
-ddadd7719 add 0E+3 -00. -> 0
-ddadd7731 add 0E+3 -00.E+1 -> 0E+1
-
-ddadd7720 add 00.00 0E+3 -> 0.00
-ddadd7721 add 00.0 0E+3 -> 0.0
-ddadd7722 add 00. 0E+3 -> 0
-ddadd7723 add 00.E+1 0E+3 -> 0E+1
-ddadd7724 add 00.E+2 0E+3 -> 0E+2
-ddadd7725 add 00.E+3 0E+3 -> 0E+3
-ddadd7726 add 00.E+4 0E+3 -> 0E+3
-ddadd7727 add 00.E+5 0E+3 -> 0E+3
-ddadd7728 add -00.00 0E+3 -> 0.00
-ddadd7729 add -00.0 0E+3 -> 0.0
-ddadd7730 add -00. 0E+3 -> 0
-
-ddadd7732 add 0 0 -> 0
-ddadd7733 add 0 -0 -> 0
-ddadd7734 add -0 0 -> 0
-ddadd7735 add -0 -0 -> -0 -- IEEE 854 special case
-
-ddadd7736 add 1 -1 -> 0
-ddadd7737 add -1 -1 -> -2
-ddadd7738 add 1 1 -> 2
-ddadd7739 add -1 1 -> 0
-
-ddadd7741 add 0 -1 -> -1
-ddadd7742 add -0 -1 -> -1
-ddadd7743 add 0 1 -> 1
-ddadd7744 add -0 1 -> 1
-ddadd7745 add -1 0 -> -1
-ddadd7746 add -1 -0 -> -1
-ddadd7747 add 1 0 -> 1
-ddadd7748 add 1 -0 -> 1
-
-ddadd7751 add 0.0 -1 -> -1.0
-ddadd7752 add -0.0 -1 -> -1.0
-ddadd7753 add 0.0 1 -> 1.0
-ddadd7754 add -0.0 1 -> 1.0
-ddadd7755 add -1.0 0 -> -1.0
-ddadd7756 add -1.0 -0 -> -1.0
-ddadd7757 add 1.0 0 -> 1.0
-ddadd7758 add 1.0 -0 -> 1.0
-
-ddadd7761 add 0 -1.0 -> -1.0
-ddadd7762 add -0 -1.0 -> -1.0
-ddadd7763 add 0 1.0 -> 1.0
-ddadd7764 add -0 1.0 -> 1.0
-ddadd7765 add -1 0.0 -> -1.0
-ddadd7766 add -1 -0.0 -> -1.0
-ddadd7767 add 1 0.0 -> 1.0
-ddadd7768 add 1 -0.0 -> 1.0
-
-ddadd7771 add 0.0 -1.0 -> -1.0
-ddadd7772 add -0.0 -1.0 -> -1.0
-ddadd7773 add 0.0 1.0 -> 1.0
-ddadd7774 add -0.0 1.0 -> 1.0
-ddadd7775 add -1.0 0.0 -> -1.0
-ddadd7776 add -1.0 -0.0 -> -1.0
-ddadd7777 add 1.0 0.0 -> 1.0
-ddadd7778 add 1.0 -0.0 -> 1.0
-
--- Specials
-ddadd7780 add -Inf -Inf -> -Infinity
-ddadd7781 add -Inf -1000 -> -Infinity
-ddadd7782 add -Inf -1 -> -Infinity
-ddadd7783 add -Inf -0 -> -Infinity
-ddadd7784 add -Inf 0 -> -Infinity
-ddadd7785 add -Inf 1 -> -Infinity
-ddadd7786 add -Inf 1000 -> -Infinity
-ddadd7787 add -1000 -Inf -> -Infinity
-ddadd7788 add -Inf -Inf -> -Infinity
-ddadd7789 add -1 -Inf -> -Infinity
-ddadd7790 add -0 -Inf -> -Infinity
-ddadd7791 add 0 -Inf -> -Infinity
-ddadd7792 add 1 -Inf -> -Infinity
-ddadd7793 add 1000 -Inf -> -Infinity
-ddadd7794 add Inf -Inf -> NaN Invalid_operation
-
-ddadd7800 add Inf -Inf -> NaN Invalid_operation
-ddadd7801 add Inf -1000 -> Infinity
-ddadd7802 add Inf -1 -> Infinity
-ddadd7803 add Inf -0 -> Infinity
-ddadd7804 add Inf 0 -> Infinity
-ddadd7805 add Inf 1 -> Infinity
-ddadd7806 add Inf 1000 -> Infinity
-ddadd7807 add Inf Inf -> Infinity
-ddadd7808 add -1000 Inf -> Infinity
-ddadd7809 add -Inf Inf -> NaN Invalid_operation
-ddadd7810 add -1 Inf -> Infinity
-ddadd7811 add -0 Inf -> Infinity
-ddadd7812 add 0 Inf -> Infinity
-ddadd7813 add 1 Inf -> Infinity
-ddadd7814 add 1000 Inf -> Infinity
-ddadd7815 add Inf Inf -> Infinity
-
-ddadd7821 add NaN -Inf -> NaN
-ddadd7822 add NaN -1000 -> NaN
-ddadd7823 add NaN -1 -> NaN
-ddadd7824 add NaN -0 -> NaN
-ddadd7825 add NaN 0 -> NaN
-ddadd7826 add NaN 1 -> NaN
-ddadd7827 add NaN 1000 -> NaN
-ddadd7828 add NaN Inf -> NaN
-ddadd7829 add NaN NaN -> NaN
-ddadd7830 add -Inf NaN -> NaN
-ddadd7831 add -1000 NaN -> NaN
-ddadd7832 add -1 NaN -> NaN
-ddadd7833 add -0 NaN -> NaN
-ddadd7834 add 0 NaN -> NaN
-ddadd7835 add 1 NaN -> NaN
-ddadd7836 add 1000 NaN -> NaN
-ddadd7837 add Inf NaN -> NaN
-
-ddadd7841 add sNaN -Inf -> NaN Invalid_operation
-ddadd7842 add sNaN -1000 -> NaN Invalid_operation
-ddadd7843 add sNaN -1 -> NaN Invalid_operation
-ddadd7844 add sNaN -0 -> NaN Invalid_operation
-ddadd7845 add sNaN 0 -> NaN Invalid_operation
-ddadd7846 add sNaN 1 -> NaN Invalid_operation
-ddadd7847 add sNaN 1000 -> NaN Invalid_operation
-ddadd7848 add sNaN NaN -> NaN Invalid_operation
-ddadd7849 add sNaN sNaN -> NaN Invalid_operation
-ddadd7850 add NaN sNaN -> NaN Invalid_operation
-ddadd7851 add -Inf sNaN -> NaN Invalid_operation
-ddadd7852 add -1000 sNaN -> NaN Invalid_operation
-ddadd7853 add -1 sNaN -> NaN Invalid_operation
-ddadd7854 add -0 sNaN -> NaN Invalid_operation
-ddadd7855 add 0 sNaN -> NaN Invalid_operation
-ddadd7856 add 1 sNaN -> NaN Invalid_operation
-ddadd7857 add 1000 sNaN -> NaN Invalid_operation
-ddadd7858 add Inf sNaN -> NaN Invalid_operation
-ddadd7859 add NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddadd7861 add NaN1 -Inf -> NaN1
-ddadd7862 add +NaN2 -1000 -> NaN2
-ddadd7863 add NaN3 1000 -> NaN3
-ddadd7864 add NaN4 Inf -> NaN4
-ddadd7865 add NaN5 +NaN6 -> NaN5
-ddadd7866 add -Inf NaN7 -> NaN7
-ddadd7867 add -1000 NaN8 -> NaN8
-ddadd7868 add 1000 NaN9 -> NaN9
-ddadd7869 add Inf +NaN10 -> NaN10
-ddadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation
-ddadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation
-ddadd7873 add sNaN13 1000 -> NaN13 Invalid_operation
-ddadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation
-ddadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation
-ddadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation
-ddadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation
-ddadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation
-ddadd7880 add Inf sNaN23 -> NaN23 Invalid_operation
-ddadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddadd7882 add -NaN26 NaN28 -> -NaN26
-ddadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddadd7884 add 1000 -NaN30 -> -NaN30
-ddadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Here we explore near the boundary of rounding a subnormal to Nmin
-ddadd7575 add 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal
-ddadd7576 add -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal
-
--- and another curious case
-ddadd7577 add 7.000000000000E-385 -1.00000E-391 -> 6.999999000000E-385 Subnormal
-
--- check overflow edge case
--- 1234567890123456
-ddadd7972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
-ddadd7973 add 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7974 add 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7975 add 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
-ddadd7976 add 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
-ddadd7977 add 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
-ddadd7978 add 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
-ddadd7979 add 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
-ddadd7980 add 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
-ddadd7981 add 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7982 add 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7983 add 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddadd7984 add 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
-
-ddadd7985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
-ddadd7986 add -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7987 add -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7988 add -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
-ddadd7989 add -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7990 add -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7991 add -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7992 add -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7993 add -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
-ddadd7994 add -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7995 add -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7996 add -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddadd7997 add -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-ddadd71100 add 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
-ddadd71101 add 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
-ddadd71103 add +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
-ddadd71104 add 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
-ddadd71105 add 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
-ddadd71106 add 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
-ddadd71107 add 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
-ddadd71108 add 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
-ddadd71109 add 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-ddadd71110 add -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
-ddadd71111 add -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
-ddadd71113 add -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
-ddadd71114 add -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
-ddadd71115 add -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
-ddadd71116 add -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
-ddadd71117 add -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
-ddadd71118 add -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
-ddadd71119 add -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-ddadd71300 add 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71310 add 1E16 -0.51 -> 9999999999999999 Inexact Rounded
-ddadd71311 add 1E16 -0.501 -> 9999999999999999 Inexact Rounded
-ddadd71312 add 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
-ddadd71313 add 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
-ddadd71314 add 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
-ddadd71315 add 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
-ddadd71316 add 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
-ddadd71317 add 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
-ddadd71318 add 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
-ddadd71319 add 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
-ddadd71320 add 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
-ddadd71321 add 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
-ddadd71322 add 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
-ddadd71323 add 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
-ddadd71324 add 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
-ddadd71325 add 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71326 add 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71327 add 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71328 add 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71329 add 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71330 add 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71331 add 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71332 add 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71333 add 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71334 add 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71335 add 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71336 add 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71337 add 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71338 add 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71339 add 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
-
-ddadd71340 add 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
-ddadd71341 add 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
-
-ddadd71349 add 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
-ddadd71350 add 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
-ddadd71351 add 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
-ddadd71352 add 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
-ddadd71353 add 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
-ddadd71354 add 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
-ddadd71355 add 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
-ddadd71356 add 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
-ddadd71357 add 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
-ddadd71358 add 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
-ddadd71359 add 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
-ddadd71360 add 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
-ddadd71361 add 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
-ddadd71362 add 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
-ddadd71363 add 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
-ddadd71364 add 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
-ddadd71365 add 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71367 add 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71368 add 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71369 add 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71370 add 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71371 add 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71372 add 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71373 add 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71374 add 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71375 add 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71376 add 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71377 add 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71378 add 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71379 add 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71380 add 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71381 add 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71382 add 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71383 add 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71384 add 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71385 add 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71386 add 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71387 add 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71388 add 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71389 add 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71390 add 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71391 add 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71392 add 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71393 add 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71394 add 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71395 add 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
-ddadd71396 add 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-ddadd71420 add 0 1.123456789012345 -> 1.123456789012345
-ddadd71421 add 0 1.123456789012345E-1 -> 0.1123456789012345
-ddadd71422 add 0 1.123456789012345E-2 -> 0.01123456789012345
-ddadd71423 add 0 1.123456789012345E-3 -> 0.001123456789012345
-ddadd71424 add 0 1.123456789012345E-4 -> 0.0001123456789012345
-ddadd71425 add 0 1.123456789012345E-5 -> 0.00001123456789012345
-ddadd71426 add 0 1.123456789012345E-6 -> 0.000001123456789012345
-ddadd71427 add 0 1.123456789012345E-7 -> 1.123456789012345E-7
-ddadd71428 add 0 1.123456789012345E-8 -> 1.123456789012345E-8
-ddadd71429 add 0 1.123456789012345E-9 -> 1.123456789012345E-9
-ddadd71430 add 0 1.123456789012345E-10 -> 1.123456789012345E-10
-ddadd71431 add 0 1.123456789012345E-11 -> 1.123456789012345E-11
-ddadd71432 add 0 1.123456789012345E-12 -> 1.123456789012345E-12
-ddadd71433 add 0 1.123456789012345E-13 -> 1.123456789012345E-13
-ddadd71434 add 0 1.123456789012345E-14 -> 1.123456789012345E-14
-ddadd71435 add 0 1.123456789012345E-15 -> 1.123456789012345E-15
-ddadd71436 add 0 1.123456789012345E-16 -> 1.123456789012345E-16
-ddadd71437 add 0 1.123456789012345E-17 -> 1.123456789012345E-17
-ddadd71438 add 0 1.123456789012345E-18 -> 1.123456789012345E-18
-ddadd71439 add 0 1.123456789012345E-19 -> 1.123456789012345E-19
-
--- same, reversed 0
-ddadd71440 add 1.123456789012345 0 -> 1.123456789012345
-ddadd71441 add 1.123456789012345E-1 0 -> 0.1123456789012345
-ddadd71442 add 1.123456789012345E-2 0 -> 0.01123456789012345
-ddadd71443 add 1.123456789012345E-3 0 -> 0.001123456789012345
-ddadd71444 add 1.123456789012345E-4 0 -> 0.0001123456789012345
-ddadd71445 add 1.123456789012345E-5 0 -> 0.00001123456789012345
-ddadd71446 add 1.123456789012345E-6 0 -> 0.000001123456789012345
-ddadd71447 add 1.123456789012345E-7 0 -> 1.123456789012345E-7
-ddadd71448 add 1.123456789012345E-8 0 -> 1.123456789012345E-8
-ddadd71449 add 1.123456789012345E-9 0 -> 1.123456789012345E-9
-ddadd71450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10
-ddadd71451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11
-ddadd71452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12
-ddadd71453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13
-ddadd71454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14
-ddadd71455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15
-ddadd71456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16
-ddadd71457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17
-ddadd71458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18
-ddadd71459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19
-
--- same, Es on the 0
-ddadd71460 add 1.123456789012345 0E-0 -> 1.123456789012345
-ddadd71461 add 1.123456789012345 0E-1 -> 1.123456789012345
-ddadd71462 add 1.123456789012345 0E-2 -> 1.123456789012345
-ddadd71463 add 1.123456789012345 0E-3 -> 1.123456789012345
-ddadd71464 add 1.123456789012345 0E-4 -> 1.123456789012345
-ddadd71465 add 1.123456789012345 0E-5 -> 1.123456789012345
-ddadd71466 add 1.123456789012345 0E-6 -> 1.123456789012345
-ddadd71467 add 1.123456789012345 0E-7 -> 1.123456789012345
-ddadd71468 add 1.123456789012345 0E-8 -> 1.123456789012345
-ddadd71469 add 1.123456789012345 0E-9 -> 1.123456789012345
-ddadd71470 add 1.123456789012345 0E-10 -> 1.123456789012345
-ddadd71471 add 1.123456789012345 0E-11 -> 1.123456789012345
-ddadd71472 add 1.123456789012345 0E-12 -> 1.123456789012345
-ddadd71473 add 1.123456789012345 0E-13 -> 1.123456789012345
-ddadd71474 add 1.123456789012345 0E-14 -> 1.123456789012345
-ddadd71475 add 1.123456789012345 0E-15 -> 1.123456789012345
--- next four flag Rounded because the 0 extends the result
-ddadd71476 add 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
-ddadd71477 add 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
-ddadd71478 add 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
-ddadd71479 add 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-ddadd71500 add 0 0E-19 -> 0E-19
-ddadd71501 add -0 0E-19 -> 0E-19
-ddadd71502 add 0 -0E-19 -> 0E-19
-ddadd71503 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71511 add -11 11 -> 0
-ddadd71512 add 11 -11 -> 0
-
-rounding: half_down
--- exact zeros from zeros
-ddadd71520 add 0 0E-19 -> 0E-19
-ddadd71521 add -0 0E-19 -> 0E-19
-ddadd71522 add 0 -0E-19 -> 0E-19
-ddadd71523 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71531 add -11 11 -> 0
-ddadd71532 add 11 -11 -> 0
-
-rounding: half_even
--- exact zeros from zeros
-ddadd71540 add 0 0E-19 -> 0E-19
-ddadd71541 add -0 0E-19 -> 0E-19
-ddadd71542 add 0 -0E-19 -> 0E-19
-ddadd71543 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71551 add -11 11 -> 0
-ddadd71552 add 11 -11 -> 0
-
-rounding: up
--- exact zeros from zeros
-ddadd71560 add 0 0E-19 -> 0E-19
-ddadd71561 add -0 0E-19 -> 0E-19
-ddadd71562 add 0 -0E-19 -> 0E-19
-ddadd71563 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71571 add -11 11 -> 0
-ddadd71572 add 11 -11 -> 0
-
-rounding: down
--- exact zeros from zeros
-ddadd71580 add 0 0E-19 -> 0E-19
-ddadd71581 add -0 0E-19 -> 0E-19
-ddadd71582 add 0 -0E-19 -> 0E-19
-ddadd71583 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71591 add -11 11 -> 0
-ddadd71592 add 11 -11 -> 0
-
-rounding: ceiling
--- exact zeros from zeros
-ddadd71600 add 0 0E-19 -> 0E-19
-ddadd71601 add -0 0E-19 -> 0E-19
-ddadd71602 add 0 -0E-19 -> 0E-19
-ddadd71603 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71611 add -11 11 -> 0
-ddadd71612 add 11 -11 -> 0
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-ddadd71620 add 0 0E-19 -> 0E-19
-ddadd71621 add -0 0E-19 -> -0E-19 -- *
-ddadd71622 add 0 -0E-19 -> -0E-19 -- *
-ddadd71623 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddadd71631 add -11 11 -> -0 -- *
-ddadd71632 add 11 -11 -> -0 -- *
-
--- Examples from SQL proposal (Krishna Kulkarni)
-ddadd71701 add 130E-2 120E-2 -> 2.50
-ddadd71702 add 130E-2 12E-1 -> 2.50
-ddadd71703 add 130E-2 1E0 -> 2.30
-ddadd71704 add 1E2 1E4 -> 1.01E+4
-ddadd71705 add 130E-2 -120E-2 -> 0.10
-ddadd71706 add 130E-2 -12E-1 -> 0.10
-ddadd71707 add 130E-2 -1E0 -> 0.30
-ddadd71708 add 1E2 -1E4 -> -9.9E+3
-
--- query from Vincent Kulandaisamy
-rounding: ceiling
-ddadd71801 add 7.8822773805862E+277 -5.1757503820663E-21 -> 7.882277380586200E+277 Inexact Rounded
-ddadd71802 add 7.882277380586200E+277 12.341 -> 7.882277380586201E+277 Inexact Rounded
-ddadd71803 add 7.882277380586201E+277 2.7270545046613E-31 -> 7.882277380586202E+277 Inexact Rounded
-
-ddadd71811 add 12.341 -5.1757503820663E-21 -> 12.34100000000000 Inexact Rounded
-ddadd71812 add 12.34100000000000 2.7270545046613E-31 -> 12.34100000000001 Inexact Rounded
-ddadd71813 add 12.34100000000001 7.8822773805862E+277 -> 7.882277380586201E+277 Inexact Rounded
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-ddadd75001 add 1234567890123456 1 -> 1234567890123457
-ddadd75002 add 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
-ddadd75003 add 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
-ddadd75004 add 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
-ddadd75005 add 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
-ddadd75006 add 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
-ddadd75007 add 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
-ddadd75008 add 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
-ddadd75009 add 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
-ddadd75010 add 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
-ddadd75011 add 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
-ddadd75012 add 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
-ddadd75013 add 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
-ddadd75014 add 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
-ddadd75015 add 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
-ddadd75016 add 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
-ddadd75017 add 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
-ddadd75018 add 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
-ddadd75019 add 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
-ddadd75020 add 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
-ddadd75021 add 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
-
--- widening second argument at gap
-ddadd75030 add 12345678 1 -> 12345679
-ddadd75031 add 12345678 0.1 -> 12345678.1
-ddadd75032 add 12345678 0.12 -> 12345678.12
-ddadd75033 add 12345678 0.123 -> 12345678.123
-ddadd75034 add 12345678 0.1234 -> 12345678.1234
-ddadd75035 add 12345678 0.12345 -> 12345678.12345
-ddadd75036 add 12345678 0.123456 -> 12345678.123456
-ddadd75037 add 12345678 0.1234567 -> 12345678.1234567
-ddadd75038 add 12345678 0.12345678 -> 12345678.12345678
-ddadd75039 add 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
-ddadd75040 add 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
-ddadd75041 add 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
-ddadd75042 add 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
-ddadd75043 add 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
-ddadd75044 add 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
-ddadd75045 add 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
-ddadd75046 add 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
-ddadd75047 add 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
-ddadd75048 add 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
-ddadd75049 add 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-ddadd75050 add 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
-ddadd75051 add 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
-ddadd75052 add 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
-ddadd75053 add 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
-ddadd75054 add 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
-ddadd75055 add 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
-ddadd75056 add 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
-ddadd75057 add 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
-ddadd75060 add 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
-ddadd75061 add 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
-ddadd75062 add 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
-ddadd75063 add 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
-ddadd75064 add 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
-ddadd75065 add 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
-ddadd75066 add 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
-ddadd75067 add 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-ddadd75070 add 12345678 1E-8 -> 12345678.00000001
-ddadd75071 add 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
-ddadd75072 add 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
-ddadd75073 add 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
-ddadd75074 add 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
-ddadd75075 add 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
-ddadd75076 add 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
-ddadd75077 add 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
-ddadd75078 add 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
-ddadd75079 add 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
-ddadd75080 add 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
-ddadd75081 add 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
-ddadd75082 add 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
-ddadd75083 add 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
-ddadd75084 add 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
-ddadd75085 add 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
-ddadd75086 add 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
-ddadd75087 add 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
-ddadd75088 add 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
-ddadd75089 add 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
-
--- Punit's
-ddadd75100 add 1.000 -200.000 -> -199.000
-
--- Rounding swathe
-rounding: half_even
-ddadd81100 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81101 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81102 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81103 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81104 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81105 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81106 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81107 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81108 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81109 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81120 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81121 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: half_up
-ddadd81200 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81201 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81202 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81203 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81204 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81205 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81206 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81207 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81208 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81209 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81220 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81221 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: half_down
-ddadd81300 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81301 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81302 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81303 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81304 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81305 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81306 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81307 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81308 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81309 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81320 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81321 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: up
-ddadd81400 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81401 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81402 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81403 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81404 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81405 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81406 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81407 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81408 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81409 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81411 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
-ddadd81420 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81421 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: down
-ddadd81500 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81501 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81502 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81503 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81504 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81505 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81506 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81507 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81508 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81509 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81511 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded
-ddadd81520 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddadd81521 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
-
-rounding: ceiling
-ddadd81600 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81601 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81602 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81603 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81604 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81605 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81606 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
-ddadd81607 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81608 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81609 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81611 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded
-ddadd81620 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
-ddadd81621 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
-
-rounding: floor
-ddadd81700 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
-ddadd81701 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81702 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81703 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81704 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81705 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81706 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd81707 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81708 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81709 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded
-ddadd81711 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
-ddadd81720 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddadd81721 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
-
-rounding: 05up
-ddadd81800 add .2000 12345678901234.00 -> 12345678901234.20 Rounded
-ddadd81801 add .2001 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81802 add .2010 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81803 add .2050 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81804 add .2051 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81807 add .2060 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81808 add .2070 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81809 add .2099 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81811 add -.2099 -12345678901234.00 -> -12345678901234.21 Inexact Rounded
-ddadd81820 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddadd81821 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
-
-ddadd81900 add .2100 12345678901234.00 -> 12345678901234.21 Rounded
-ddadd81901 add .2101 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81902 add .2110 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81903 add .2150 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81904 add .2151 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81907 add .2160 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81908 add .2170 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81909 add .2199 12345678901234.00 -> 12345678901234.21 Inexact Rounded
-ddadd81911 add -.2199 -12345678901234.00 -> -12345678901234.21 Inexact Rounded
-
-ddadd82000 add .2400 12345678901234.00 -> 12345678901234.24 Rounded
-ddadd82001 add .2401 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82002 add .2410 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82003 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82004 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82007 add .2460 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82008 add .2470 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82009 add .2499 12345678901234.00 -> 12345678901234.24 Inexact Rounded
-ddadd82011 add -.2499 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
-
-ddadd82100 add .2500 12345678901234.00 -> 12345678901234.25 Rounded
-ddadd82101 add .2501 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82102 add .2510 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82103 add .2550 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82104 add .2551 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82107 add .2560 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82108 add .2570 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82109 add .2599 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82111 add -.2599 -12345678901234.00 -> -12345678901234.26 Inexact Rounded
-
-ddadd82200 add .2600 12345678901234.00 -> 12345678901234.26 Rounded
-ddadd82201 add .2601 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82202 add .2610 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82203 add .2650 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82204 add .2651 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82207 add .2660 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82208 add .2670 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82209 add .2699 12345678901234.00 -> 12345678901234.26 Inexact Rounded
-ddadd82211 add -.2699 -12345678901234.00 -> -12345678901234.26 Inexact Rounded
-
-ddadd82300 add .2900 12345678901234.00 -> 12345678901234.29 Rounded
-ddadd82301 add .2901 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82302 add .2910 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82303 add .2950 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82304 add .2951 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82307 add .2960 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82308 add .2970 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82309 add .2999 12345678901234.00 -> 12345678901234.29 Inexact Rounded
-ddadd82311 add -.2999 -12345678901234.00 -> -12345678901234.29 Inexact Rounded
-
--- Null tests
-ddadd9990 add 10 # -> NaN Invalid_operation
-ddadd9991 add # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddAdd.decTest -- decDouble addition --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decDoubles only; all arguments are
+-- representable in a decDouble
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+ddadd001 add 1 1 -> 2
+ddadd002 add 2 3 -> 5
+ddadd003 add '5.75' '3.3' -> 9.05
+ddadd004 add '5' '-3' -> 2
+ddadd005 add '-5' '-3' -> -8
+ddadd006 add '-7' '2.5' -> -4.5
+ddadd007 add '0.7' '0.3' -> 1.0
+ddadd008 add '1.25' '1.25' -> 2.50
+ddadd009 add '1.23456789' '1.00000000' -> '2.23456789'
+ddadd010 add '1.23456789' '1.00000011' -> '2.23456800'
+
+-- 1234567890123456 1234567890123456
+ddadd011 add '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
+ddadd012 add '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded
+ddadd013 add '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
+ddadd014 add '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded
+ddadd015 add '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded
+ddadd016 add '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
+ddadd017 add '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
+ddadd018 add '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
+ddadd019 add '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded
+ddadd020 add '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded
+
+ddadd021 add 0 1 -> 1
+ddadd022 add 1 1 -> 2
+ddadd023 add 2 1 -> 3
+ddadd024 add 3 1 -> 4
+ddadd025 add 4 1 -> 5
+ddadd026 add 5 1 -> 6
+ddadd027 add 6 1 -> 7
+ddadd028 add 7 1 -> 8
+ddadd029 add 8 1 -> 9
+ddadd030 add 9 1 -> 10
+
+-- some carrying effects
+ddadd031 add '0.9998' '0.0000' -> '0.9998'
+ddadd032 add '0.9998' '0.0001' -> '0.9999'
+ddadd033 add '0.9998' '0.0002' -> '1.0000'
+ddadd034 add '0.9998' '0.0003' -> '1.0001'
+
+ddadd035 add '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddadd036 add '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddadd037 add '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddadd038 add '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
+ddadd039 add '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
+
+-- symmetry:
+ddadd040 add '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
+ddadd041 add '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
+ddadd042 add '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
+ddadd044 add '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
+ddadd045 add '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
+
+-- same, without rounding
+ddadd046 add '10000e+9' '7' -> '10000000000007'
+ddadd047 add '10000e+9' '70' -> '10000000000070'
+ddadd048 add '10000e+9' '700' -> '10000000000700'
+ddadd049 add '10000e+9' '7000' -> '10000000007000'
+ddadd050 add '10000e+9' '70000' -> '10000000070000'
+ddadd051 add '10000e+9' '700000' -> '10000000700000'
+ddadd052 add '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+ddadd053 add '12' '7.00' -> '19.00'
+ddadd054 add '1.3' '-1.07' -> '0.23'
+ddadd055 add '1.3' '-1.30' -> '0.00'
+ddadd056 add '1.3' '-2.07' -> '-0.77'
+ddadd057 add '1E+2' '1E+4' -> '1.01E+4'
+
+-- leading zero preservation
+ddadd061 add 1 '0.0001' -> '1.0001'
+ddadd062 add 1 '0.00001' -> '1.00001'
+ddadd063 add 1 '0.000001' -> '1.000001'
+ddadd064 add 1 '0.0000001' -> '1.0000001'
+ddadd065 add 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+ddadd070 add 1 0 -> 1
+ddadd071 add 1 0. -> 1
+ddadd072 add 1 .0 -> 1.0
+ddadd073 add 1 0.0 -> 1.0
+ddadd074 add 1 0.00 -> 1.00
+ddadd075 add 0 1 -> 1
+ddadd076 add 0. 1 -> 1
+ddadd077 add .0 1 -> 1.0
+ddadd078 add 0.0 1 -> 1.0
+ddadd079 add 0.00 1 -> 1.00
+
+-- some carries
+ddadd080 add 999999998 1 -> 999999999
+ddadd081 add 999999999 1 -> 1000000000
+ddadd082 add 99999999 1 -> 100000000
+ddadd083 add 9999999 1 -> 10000000
+ddadd084 add 999999 1 -> 1000000
+ddadd085 add 99999 1 -> 100000
+ddadd086 add 9999 1 -> 10000
+ddadd087 add 999 1 -> 1000
+ddadd088 add 99 1 -> 100
+ddadd089 add 9 1 -> 10
+
+
+-- more LHS swaps
+ddadd090 add '-56267E-10' 0 -> '-0.0000056267'
+ddadd091 add '-56267E-6' 0 -> '-0.056267'
+ddadd092 add '-56267E-5' 0 -> '-0.56267'
+ddadd093 add '-56267E-4' 0 -> '-5.6267'
+ddadd094 add '-56267E-3' 0 -> '-56.267'
+ddadd095 add '-56267E-2' 0 -> '-562.67'
+ddadd096 add '-56267E-1' 0 -> '-5626.7'
+ddadd097 add '-56267E-0' 0 -> '-56267'
+ddadd098 add '-5E-10' 0 -> '-5E-10'
+ddadd099 add '-5E-7' 0 -> '-5E-7'
+ddadd100 add '-5E-6' 0 -> '-0.000005'
+ddadd101 add '-5E-5' 0 -> '-0.00005'
+ddadd102 add '-5E-4' 0 -> '-0.0005'
+ddadd103 add '-5E-1' 0 -> '-0.5'
+ddadd104 add '-5E0' 0 -> '-5'
+ddadd105 add '-5E1' 0 -> '-50'
+ddadd106 add '-5E5' 0 -> '-500000'
+ddadd107 add '-5E15' 0 -> '-5000000000000000'
+ddadd108 add '-5E16' 0 -> '-5.000000000000000E+16' Rounded
+ddadd109 add '-5E17' 0 -> '-5.000000000000000E+17' Rounded
+ddadd110 add '-5E18' 0 -> '-5.000000000000000E+18' Rounded
+ddadd111 add '-5E100' 0 -> '-5.000000000000000E+100' Rounded
+
+-- more RHS swaps
+ddadd113 add 0 '-56267E-10' -> '-0.0000056267'
+ddadd114 add 0 '-56267E-6' -> '-0.056267'
+ddadd116 add 0 '-56267E-5' -> '-0.56267'
+ddadd117 add 0 '-56267E-4' -> '-5.6267'
+ddadd119 add 0 '-56267E-3' -> '-56.267'
+ddadd120 add 0 '-56267E-2' -> '-562.67'
+ddadd121 add 0 '-56267E-1' -> '-5626.7'
+ddadd122 add 0 '-56267E-0' -> '-56267'
+ddadd123 add 0 '-5E-10' -> '-5E-10'
+ddadd124 add 0 '-5E-7' -> '-5E-7'
+ddadd125 add 0 '-5E-6' -> '-0.000005'
+ddadd126 add 0 '-5E-5' -> '-0.00005'
+ddadd127 add 0 '-5E-4' -> '-0.0005'
+ddadd128 add 0 '-5E-1' -> '-0.5'
+ddadd129 add 0 '-5E0' -> '-5'
+ddadd130 add 0 '-5E1' -> '-50'
+ddadd131 add 0 '-5E5' -> '-500000'
+ddadd132 add 0 '-5E15' -> '-5000000000000000'
+ddadd133 add 0 '-5E16' -> '-5.000000000000000E+16' Rounded
+ddadd134 add 0 '-5E17' -> '-5.000000000000000E+17' Rounded
+ddadd135 add 0 '-5E18' -> '-5.000000000000000E+18' Rounded
+ddadd136 add 0 '-5E100' -> '-5.000000000000000E+100' Rounded
+
+-- related
+ddadd137 add 1 '0E-19' -> '1.000000000000000' Rounded
+ddadd138 add -1 '0E-19' -> '-1.000000000000000' Rounded
+ddadd139 add '0E-19' 1 -> '1.000000000000000' Rounded
+ddadd140 add '0E-19' -1 -> '-1.000000000000000' Rounded
+ddadd141 add 1E+11 0.0000 -> '100000000000.0000'
+ddadd142 add 1E+11 0.00000 -> '100000000000.0000' Rounded
+ddadd143 add 0.000 1E+12 -> '1000000000000.000'
+ddadd144 add 0.0000 1E+12 -> '1000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+ddadd146 add '00.0' 0 -> '0.0'
+ddadd147 add '0.00' 0 -> '0.00'
+ddadd148 add 0 '0.00' -> '0.00'
+ddadd149 add 0 '00.0' -> '0.0'
+ddadd150 add '00.0' '0.00' -> '0.00'
+ddadd151 add '0.00' '00.0' -> '0.00'
+ddadd152 add '3' '.3' -> '3.3'
+ddadd153 add '3.' '.3' -> '3.3'
+ddadd154 add '3.0' '.3' -> '3.3'
+ddadd155 add '3.00' '.3' -> '3.30'
+ddadd156 add '3' '3' -> '6'
+ddadd157 add '3' '+3' -> '6'
+ddadd158 add '3' '-3' -> '0'
+ddadd159 add '0.3' '-0.3' -> '0.0'
+ddadd160 add '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+ddadd161 add '1E+12' '-1' -> '999999999999'
+ddadd162 add '1E+12' '1.11' -> '1000000000001.11'
+ddadd163 add '1.11' '1E+12' -> '1000000000001.11'
+ddadd164 add '-1' '1E+12' -> '999999999999'
+ddadd165 add '7E+12' '-1' -> '6999999999999'
+ddadd166 add '7E+12' '1.11' -> '7000000000001.11'
+ddadd167 add '1.11' '7E+12' -> '7000000000001.11'
+ddadd168 add '-1' '7E+12' -> '6999999999999'
+
+rounding: half_up
+-- 1.234567890123456 1234567890123456 1 234567890123456
+ddadd170 add '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
+ddadd171 add '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
+ddadd172 add '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
+ddadd173 add '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
+ddadd174 add '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
+ddadd175 add '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
+ddadd176 add '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
+ddadd177 add '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded
+ddadd178 add '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
+ddadd179 add '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
+ddadd180 add '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
+ddadd181 add '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
+ddadd182 add '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
+ddadd183 add '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+ddadd200 add '1234560123456789' 0 -> '1234560123456789'
+ddadd201 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddadd202 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddadd203 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddadd204 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddadd205 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddadd206 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddadd207 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddadd208 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
+ddadd209 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
+ddadd210 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
+ddadd211 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
+ddadd212 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
+ddadd213 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
+ddadd214 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
+ddadd215 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
+ddadd216 add '1234560123456789' 1 -> '1234560123456790'
+ddadd217 add '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded
+ddadd218 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddadd219 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+
+rounding: half_even
+ddadd220 add '1234560123456789' 0 -> '1234560123456789'
+ddadd221 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddadd222 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddadd223 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddadd224 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddadd225 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddadd226 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddadd227 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddadd228 add '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
+ddadd229 add '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
+ddadd230 add '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
+ddadd231 add '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
+ddadd232 add '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
+ddadd233 add '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
+ddadd234 add '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
+ddadd235 add '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
+ddadd236 add '1234560123456789' 1 -> '1234560123456790'
+ddadd237 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
+ddadd238 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddadd239 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+-- critical few with even bottom digit...
+ddadd240 add '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded
+ddadd241 add '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded
+ddadd242 add '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded
+
+rounding: down
+ddadd250 add '1234560123456789' 0 -> '1234560123456789'
+ddadd251 add '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddadd252 add '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddadd253 add '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddadd254 add '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddadd255 add '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddadd256 add '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddadd257 add '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddadd258 add '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded
+ddadd259 add '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded
+ddadd260 add '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded
+ddadd261 add '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded
+ddadd262 add '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded
+ddadd263 add '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded
+ddadd264 add '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded
+ddadd265 add '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded
+ddadd266 add '1234560123456789' 1 -> '1234560123456790'
+ddadd267 add '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
+ddadd268 add '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddadd269 add '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+ddadd301 add -1 1 -> 0
+ddadd302 add 0 1 -> 1
+ddadd303 add 1 1 -> 2
+ddadd304 add 12 1 -> 13
+ddadd305 add 98 1 -> 99
+ddadd306 add 99 1 -> 100
+ddadd307 add 100 1 -> 101
+ddadd308 add 101 1 -> 102
+ddadd309 add -1 -1 -> -2
+ddadd310 add 0 -1 -> -1
+ddadd311 add 1 -1 -> 0
+ddadd312 add 12 -1 -> 11
+ddadd313 add 98 -1 -> 97
+ddadd314 add 99 -1 -> 98
+ddadd315 add 100 -1 -> 99
+ddadd316 add 101 -1 -> 100
+
+ddadd321 add -0.01 0.01 -> 0.00
+ddadd322 add 0.00 0.01 -> 0.01
+ddadd323 add 0.01 0.01 -> 0.02
+ddadd324 add 0.12 0.01 -> 0.13
+ddadd325 add 0.98 0.01 -> 0.99
+ddadd326 add 0.99 0.01 -> 1.00
+ddadd327 add 1.00 0.01 -> 1.01
+ddadd328 add 1.01 0.01 -> 1.02
+ddadd329 add -0.01 -0.01 -> -0.02
+ddadd330 add 0.00 -0.01 -> -0.01
+ddadd331 add 0.01 -0.01 -> 0.00
+ddadd332 add 0.12 -0.01 -> 0.11
+ddadd333 add 0.98 -0.01 -> 0.97
+ddadd334 add 0.99 -0.01 -> 0.98
+ddadd335 add 1.00 -0.01 -> 0.99
+ddadd336 add 1.01 -0.01 -> 1.00
+
+-- some more cases where adding 0 affects the coefficient
+ddadd340 add 1E+3 0 -> 1000
+ddadd341 add 1E+15 0 -> 1000000000000000
+ddadd342 add 1E+16 0 -> 1.000000000000000E+16 Rounded
+ddadd343 add 1E+20 0 -> 1.000000000000000E+20 Rounded
+-- which simply follow from these cases ...
+ddadd344 add 1E+3 1 -> 1001
+ddadd345 add 1E+15 1 -> 1000000000000001
+ddadd346 add 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
+ddadd347 add 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded
+ddadd348 add 1E+3 7 -> 1007
+ddadd349 add 1E+15 7 -> 1000000000000007
+ddadd350 add 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
+ddadd351 add 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded
+
+-- tryzeros cases
+rounding: half_up
+ddadd360 add 0E+50 10000E+1 -> 1.0000E+5
+ddadd361 add 0E-50 10000E+1 -> 100000.0000000000 Rounded
+ddadd362 add 10000E+1 0E-50 -> 100000.0000000000 Rounded
+ddadd363 add 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
+ddadd364 add 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+ddadd370 add 999999999999999 815 -> 1000000000000814
+ddadd371 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+rounding: half_up
+ddadd372 add 999999999999999 815 -> 1000000000000814
+ddadd373 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+rounding: half_even
+ddadd374 add 999999999999999 815 -> 1000000000000814
+ddadd375 add 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+
+-- operands folded
+ddadd380 add 1E+384 1E+384 -> 2.000000000000000E+384 Clamped
+ddadd381 add 1E+380 1E+380 -> 2.00000000000E+380 Clamped
+ddadd382 add 1E+376 1E+376 -> 2.0000000E+376 Clamped
+ddadd383 add 1E+372 1E+372 -> 2.000E+372 Clamped
+ddadd384 add 1E+370 1E+370 -> 2.0E+370 Clamped
+ddadd385 add 1E+369 1E+369 -> 2E+369
+ddadd386 add 1E+368 1E+368 -> 2E+368
+
+-- ulp replacement tests
+ddadd400 add 1 77e-14 -> 1.00000000000077
+ddadd401 add 1 77e-15 -> 1.000000000000077
+ddadd402 add 1 77e-16 -> 1.000000000000008 Inexact Rounded
+ddadd403 add 1 77e-17 -> 1.000000000000001 Inexact Rounded
+ddadd404 add 1 77e-18 -> 1.000000000000000 Inexact Rounded
+ddadd405 add 1 77e-19 -> 1.000000000000000 Inexact Rounded
+ddadd406 add 1 77e-299 -> 1.000000000000000 Inexact Rounded
+
+ddadd410 add 10 77e-14 -> 10.00000000000077
+ddadd411 add 10 77e-15 -> 10.00000000000008 Inexact Rounded
+ddadd412 add 10 77e-16 -> 10.00000000000001 Inexact Rounded
+ddadd413 add 10 77e-17 -> 10.00000000000000 Inexact Rounded
+ddadd414 add 10 77e-18 -> 10.00000000000000 Inexact Rounded
+ddadd415 add 10 77e-19 -> 10.00000000000000 Inexact Rounded
+ddadd416 add 10 77e-299 -> 10.00000000000000 Inexact Rounded
+
+ddadd420 add 77e-14 1 -> 1.00000000000077
+ddadd421 add 77e-15 1 -> 1.000000000000077
+ddadd422 add 77e-16 1 -> 1.000000000000008 Inexact Rounded
+ddadd423 add 77e-17 1 -> 1.000000000000001 Inexact Rounded
+ddadd424 add 77e-18 1 -> 1.000000000000000 Inexact Rounded
+ddadd425 add 77e-19 1 -> 1.000000000000000 Inexact Rounded
+ddadd426 add 77e-299 1 -> 1.000000000000000 Inexact Rounded
+
+ddadd430 add 77e-14 10 -> 10.00000000000077
+ddadd431 add 77e-15 10 -> 10.00000000000008 Inexact Rounded
+ddadd432 add 77e-16 10 -> 10.00000000000001 Inexact Rounded
+ddadd433 add 77e-17 10 -> 10.00000000000000 Inexact Rounded
+ddadd434 add 77e-18 10 -> 10.00000000000000 Inexact Rounded
+ddadd435 add 77e-19 10 -> 10.00000000000000 Inexact Rounded
+ddadd436 add 77e-299 10 -> 10.00000000000000 Inexact Rounded
+
+-- fastpath boundary (more in dqadd)
+-- 1234567890123456
+ddadd539 add '4444444444444444' '3333333333333333' -> '7777777777777777'
+ddadd540 add '4444444444444444' '4444444444444444' -> '8888888888888888'
+ddadd541 add '4444444444444444' '5555555555555555' -> '9999999999999999'
+ddadd542 add '3333333333333333' '4444444444444444' -> '7777777777777777'
+ddadd543 add '4444444444444444' '4444444444444444' -> '8888888888888888'
+ddadd544 add '5555555555555555' '4444444444444444' -> '9999999999999999'
+ddadd545 add '3000004000000000' '3000000000000040' -> '6000004000000040'
+ddadd546 add '3000000400000000' '4000000000000400' -> '7000000400000400'
+ddadd547 add '3000000040000000' '5000000000004000' -> '8000000040004000'
+ddadd548 add '4000000004000000' '3000000000040000' -> '7000000004040000'
+ddadd549 add '4000000000400000' '4000000000400000' -> '8000000000800000'
+ddadd550 add '4000000000040000' '5000000004000000' -> '9000000004040000'
+ddadd551 add '5000000000004000' '3000000040000000' -> '8000000040004000'
+ddadd552 add '5000000000000400' '4000000400000000' -> '9000000400000400'
+ddadd553 add '5000000000000040' '5000004000000000' -> 1.000000400000004E+16 Rounded
+-- check propagation
+ddadd554 add '8999999999999999' '0000000000000001' -> 9000000000000000
+ddadd555 add '0000000000000001' '8999999999999999' -> 9000000000000000
+ddadd556 add '0999999999999999' '0000000000000001' -> 1000000000000000
+ddadd557 add '0000000000000001' '0999999999999999' -> 1000000000000000
+ddadd558 add '4444444444444444' '4555555555555556' -> 9000000000000000
+ddadd559 add '4555555555555556' '4444444444444444' -> 9000000000000000
+
+-- negative ulps
+ddadd6440 add 1 -77e-14 -> 0.99999999999923
+ddadd6441 add 1 -77e-15 -> 0.999999999999923
+ddadd6442 add 1 -77e-16 -> 0.9999999999999923
+ddadd6443 add 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
+ddadd6444 add 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
+ddadd6445 add 1 -77e-19 -> 1.000000000000000 Inexact Rounded
+ddadd6446 add 1 -77e-99 -> 1.000000000000000 Inexact Rounded
+
+ddadd6450 add 10 -77e-14 -> 9.99999999999923
+ddadd6451 add 10 -77e-15 -> 9.999999999999923
+ddadd6452 add 10 -77e-16 -> 9.999999999999992 Inexact Rounded
+ddadd6453 add 10 -77e-17 -> 9.999999999999999 Inexact Rounded
+ddadd6454 add 10 -77e-18 -> 10.00000000000000 Inexact Rounded
+ddadd6455 add 10 -77e-19 -> 10.00000000000000 Inexact Rounded
+ddadd6456 add 10 -77e-99 -> 10.00000000000000 Inexact Rounded
+
+ddadd6460 add -77e-14 1 -> 0.99999999999923
+ddadd6461 add -77e-15 1 -> 0.999999999999923
+ddadd6462 add -77e-16 1 -> 0.9999999999999923
+ddadd6463 add -77e-17 1 -> 0.9999999999999992 Inexact Rounded
+ddadd6464 add -77e-18 1 -> 0.9999999999999999 Inexact Rounded
+ddadd6465 add -77e-19 1 -> 1.000000000000000 Inexact Rounded
+ddadd6466 add -77e-99 1 -> 1.000000000000000 Inexact Rounded
+
+ddadd6470 add -77e-14 10 -> 9.99999999999923
+ddadd6471 add -77e-15 10 -> 9.999999999999923
+ddadd6472 add -77e-16 10 -> 9.999999999999992 Inexact Rounded
+ddadd6473 add -77e-17 10 -> 9.999999999999999 Inexact Rounded
+ddadd6474 add -77e-18 10 -> 10.00000000000000 Inexact Rounded
+ddadd6475 add -77e-19 10 -> 10.00000000000000 Inexact Rounded
+ddadd6476 add -77e-99 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+ddadd6480 add -1 77e-14 -> -0.99999999999923
+ddadd6481 add -1 77e-15 -> -0.999999999999923
+ddadd6482 add -1 77e-16 -> -0.9999999999999923
+ddadd6483 add -1 77e-17 -> -0.9999999999999992 Inexact Rounded
+ddadd6484 add -1 77e-18 -> -0.9999999999999999 Inexact Rounded
+ddadd6485 add -1 77e-19 -> -1.000000000000000 Inexact Rounded
+ddadd6486 add -1 77e-99 -> -1.000000000000000 Inexact Rounded
+
+ddadd6490 add -10 77e-14 -> -9.99999999999923
+ddadd6491 add -10 77e-15 -> -9.999999999999923
+ddadd6492 add -10 77e-16 -> -9.999999999999992 Inexact Rounded
+ddadd6493 add -10 77e-17 -> -9.999999999999999 Inexact Rounded
+ddadd6494 add -10 77e-18 -> -10.00000000000000 Inexact Rounded
+ddadd6495 add -10 77e-19 -> -10.00000000000000 Inexact Rounded
+ddadd6496 add -10 77e-99 -> -10.00000000000000 Inexact Rounded
+
+ddadd6500 add 77e-14 -1 -> -0.99999999999923
+ddadd6501 add 77e-15 -1 -> -0.999999999999923
+ddadd6502 add 77e-16 -1 -> -0.9999999999999923
+ddadd6503 add 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
+ddadd6504 add 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
+ddadd6505 add 77e-19 -1 -> -1.000000000000000 Inexact Rounded
+ddadd6506 add 77e-99 -1 -> -1.000000000000000 Inexact Rounded
+
+ddadd6510 add 77e-14 -10 -> -9.99999999999923
+ddadd6511 add 77e-15 -10 -> -9.999999999999923
+ddadd6512 add 77e-16 -10 -> -9.999999999999992 Inexact Rounded
+ddadd6513 add 77e-17 -10 -> -9.999999999999999 Inexact Rounded
+ddadd6514 add 77e-18 -10 -> -10.00000000000000 Inexact Rounded
+ddadd6515 add 77e-19 -10 -> -10.00000000000000 Inexact Rounded
+ddadd6516 add 77e-99 -10 -> -10.00000000000000 Inexact Rounded
+
+-- and some more residue effects and different roundings
+rounding: half_up
+ddadd6540 add '6543210123456789' 0 -> '6543210123456789'
+ddadd6541 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddadd6542 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddadd6543 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddadd6544 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddadd6545 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddadd6546 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddadd6547 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddadd6548 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+ddadd6549 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+ddadd6550 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+ddadd6551 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+ddadd6552 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+ddadd6553 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+ddadd6554 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+ddadd6555 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
+ddadd6556 add '6543210123456789' 1 -> '6543210123456790'
+ddadd6557 add '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
+ddadd6558 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddadd6559 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+rounding: half_even
+ddadd6560 add '6543210123456789' 0 -> '6543210123456789'
+ddadd6561 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddadd6562 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddadd6563 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddadd6564 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddadd6565 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddadd6566 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddadd6567 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddadd6568 add '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+ddadd6569 add '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+ddadd6570 add '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+ddadd6571 add '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+ddadd6572 add '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+ddadd6573 add '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+ddadd6574 add '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+ddadd6575 add '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
+ddadd6576 add '6543210123456789' 1 -> '6543210123456790'
+ddadd6577 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+ddadd6578 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddadd6579 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+-- critical few with even bottom digit...
+ddadd7540 add '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded
+ddadd7541 add '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
+ddadd7542 add '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
+
+rounding: down
+ddadd7550 add '6543210123456789' 0 -> '6543210123456789'
+ddadd7551 add '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddadd7552 add '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddadd7553 add '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddadd7554 add '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddadd7555 add '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddadd7556 add '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddadd7557 add '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddadd7558 add '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
+ddadd7559 add '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
+ddadd7560 add '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
+ddadd7561 add '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
+ddadd7562 add '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
+ddadd7563 add '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
+ddadd7564 add '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
+ddadd7565 add '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded
+ddadd7566 add '6543210123456789' 1 -> '6543210123456790'
+ddadd7567 add '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+ddadd7568 add '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddadd7569 add '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+-- verify a query
+rounding: down
+ddadd7661 add 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
+ddadd7662 add 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
+ddadd7663 add 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
+ddadd7664 add 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+ddadd7701 add 5.00 1.00E-3 -> 5.00100
+ddadd7702 add 00.00 0.000 -> 0.000
+ddadd7703 add 00.00 0E-3 -> 0.000
+ddadd7704 add 0E-3 00.00 -> 0.000
+
+ddadd7710 add 0E+3 00.00 -> 0.00
+ddadd7711 add 0E+3 00.0 -> 0.0
+ddadd7712 add 0E+3 00. -> 0
+ddadd7713 add 0E+3 00.E+1 -> 0E+1
+ddadd7714 add 0E+3 00.E+2 -> 0E+2
+ddadd7715 add 0E+3 00.E+3 -> 0E+3
+ddadd7716 add 0E+3 00.E+4 -> 0E+3
+ddadd7717 add 0E+3 00.E+5 -> 0E+3
+ddadd7718 add 0E+3 -00.0 -> 0.0
+ddadd7719 add 0E+3 -00. -> 0
+ddadd7731 add 0E+3 -00.E+1 -> 0E+1
+
+ddadd7720 add 00.00 0E+3 -> 0.00
+ddadd7721 add 00.0 0E+3 -> 0.0
+ddadd7722 add 00. 0E+3 -> 0
+ddadd7723 add 00.E+1 0E+3 -> 0E+1
+ddadd7724 add 00.E+2 0E+3 -> 0E+2
+ddadd7725 add 00.E+3 0E+3 -> 0E+3
+ddadd7726 add 00.E+4 0E+3 -> 0E+3
+ddadd7727 add 00.E+5 0E+3 -> 0E+3
+ddadd7728 add -00.00 0E+3 -> 0.00
+ddadd7729 add -00.0 0E+3 -> 0.0
+ddadd7730 add -00. 0E+3 -> 0
+
+ddadd7732 add 0 0 -> 0
+ddadd7733 add 0 -0 -> 0
+ddadd7734 add -0 0 -> 0
+ddadd7735 add -0 -0 -> -0 -- IEEE 854 special case
+
+ddadd7736 add 1 -1 -> 0
+ddadd7737 add -1 -1 -> -2
+ddadd7738 add 1 1 -> 2
+ddadd7739 add -1 1 -> 0
+
+ddadd7741 add 0 -1 -> -1
+ddadd7742 add -0 -1 -> -1
+ddadd7743 add 0 1 -> 1
+ddadd7744 add -0 1 -> 1
+ddadd7745 add -1 0 -> -1
+ddadd7746 add -1 -0 -> -1
+ddadd7747 add 1 0 -> 1
+ddadd7748 add 1 -0 -> 1
+
+ddadd7751 add 0.0 -1 -> -1.0
+ddadd7752 add -0.0 -1 -> -1.0
+ddadd7753 add 0.0 1 -> 1.0
+ddadd7754 add -0.0 1 -> 1.0
+ddadd7755 add -1.0 0 -> -1.0
+ddadd7756 add -1.0 -0 -> -1.0
+ddadd7757 add 1.0 0 -> 1.0
+ddadd7758 add 1.0 -0 -> 1.0
+
+ddadd7761 add 0 -1.0 -> -1.0
+ddadd7762 add -0 -1.0 -> -1.0
+ddadd7763 add 0 1.0 -> 1.0
+ddadd7764 add -0 1.0 -> 1.0
+ddadd7765 add -1 0.0 -> -1.0
+ddadd7766 add -1 -0.0 -> -1.0
+ddadd7767 add 1 0.0 -> 1.0
+ddadd7768 add 1 -0.0 -> 1.0
+
+ddadd7771 add 0.0 -1.0 -> -1.0
+ddadd7772 add -0.0 -1.0 -> -1.0
+ddadd7773 add 0.0 1.0 -> 1.0
+ddadd7774 add -0.0 1.0 -> 1.0
+ddadd7775 add -1.0 0.0 -> -1.0
+ddadd7776 add -1.0 -0.0 -> -1.0
+ddadd7777 add 1.0 0.0 -> 1.0
+ddadd7778 add 1.0 -0.0 -> 1.0
+
+-- Specials
+ddadd7780 add -Inf -Inf -> -Infinity
+ddadd7781 add -Inf -1000 -> -Infinity
+ddadd7782 add -Inf -1 -> -Infinity
+ddadd7783 add -Inf -0 -> -Infinity
+ddadd7784 add -Inf 0 -> -Infinity
+ddadd7785 add -Inf 1 -> -Infinity
+ddadd7786 add -Inf 1000 -> -Infinity
+ddadd7787 add -1000 -Inf -> -Infinity
+ddadd7788 add -Inf -Inf -> -Infinity
+ddadd7789 add -1 -Inf -> -Infinity
+ddadd7790 add -0 -Inf -> -Infinity
+ddadd7791 add 0 -Inf -> -Infinity
+ddadd7792 add 1 -Inf -> -Infinity
+ddadd7793 add 1000 -Inf -> -Infinity
+ddadd7794 add Inf -Inf -> NaN Invalid_operation
+
+ddadd7800 add Inf -Inf -> NaN Invalid_operation
+ddadd7801 add Inf -1000 -> Infinity
+ddadd7802 add Inf -1 -> Infinity
+ddadd7803 add Inf -0 -> Infinity
+ddadd7804 add Inf 0 -> Infinity
+ddadd7805 add Inf 1 -> Infinity
+ddadd7806 add Inf 1000 -> Infinity
+ddadd7807 add Inf Inf -> Infinity
+ddadd7808 add -1000 Inf -> Infinity
+ddadd7809 add -Inf Inf -> NaN Invalid_operation
+ddadd7810 add -1 Inf -> Infinity
+ddadd7811 add -0 Inf -> Infinity
+ddadd7812 add 0 Inf -> Infinity
+ddadd7813 add 1 Inf -> Infinity
+ddadd7814 add 1000 Inf -> Infinity
+ddadd7815 add Inf Inf -> Infinity
+
+ddadd7821 add NaN -Inf -> NaN
+ddadd7822 add NaN -1000 -> NaN
+ddadd7823 add NaN -1 -> NaN
+ddadd7824 add NaN -0 -> NaN
+ddadd7825 add NaN 0 -> NaN
+ddadd7826 add NaN 1 -> NaN
+ddadd7827 add NaN 1000 -> NaN
+ddadd7828 add NaN Inf -> NaN
+ddadd7829 add NaN NaN -> NaN
+ddadd7830 add -Inf NaN -> NaN
+ddadd7831 add -1000 NaN -> NaN
+ddadd7832 add -1 NaN -> NaN
+ddadd7833 add -0 NaN -> NaN
+ddadd7834 add 0 NaN -> NaN
+ddadd7835 add 1 NaN -> NaN
+ddadd7836 add 1000 NaN -> NaN
+ddadd7837 add Inf NaN -> NaN
+
+ddadd7841 add sNaN -Inf -> NaN Invalid_operation
+ddadd7842 add sNaN -1000 -> NaN Invalid_operation
+ddadd7843 add sNaN -1 -> NaN Invalid_operation
+ddadd7844 add sNaN -0 -> NaN Invalid_operation
+ddadd7845 add sNaN 0 -> NaN Invalid_operation
+ddadd7846 add sNaN 1 -> NaN Invalid_operation
+ddadd7847 add sNaN 1000 -> NaN Invalid_operation
+ddadd7848 add sNaN NaN -> NaN Invalid_operation
+ddadd7849 add sNaN sNaN -> NaN Invalid_operation
+ddadd7850 add NaN sNaN -> NaN Invalid_operation
+ddadd7851 add -Inf sNaN -> NaN Invalid_operation
+ddadd7852 add -1000 sNaN -> NaN Invalid_operation
+ddadd7853 add -1 sNaN -> NaN Invalid_operation
+ddadd7854 add -0 sNaN -> NaN Invalid_operation
+ddadd7855 add 0 sNaN -> NaN Invalid_operation
+ddadd7856 add 1 sNaN -> NaN Invalid_operation
+ddadd7857 add 1000 sNaN -> NaN Invalid_operation
+ddadd7858 add Inf sNaN -> NaN Invalid_operation
+ddadd7859 add NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddadd7861 add NaN1 -Inf -> NaN1
+ddadd7862 add +NaN2 -1000 -> NaN2
+ddadd7863 add NaN3 1000 -> NaN3
+ddadd7864 add NaN4 Inf -> NaN4
+ddadd7865 add NaN5 +NaN6 -> NaN5
+ddadd7866 add -Inf NaN7 -> NaN7
+ddadd7867 add -1000 NaN8 -> NaN8
+ddadd7868 add 1000 NaN9 -> NaN9
+ddadd7869 add Inf +NaN10 -> NaN10
+ddadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation
+ddadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation
+ddadd7873 add sNaN13 1000 -> NaN13 Invalid_operation
+ddadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation
+ddadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation
+ddadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation
+ddadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation
+ddadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation
+ddadd7880 add Inf sNaN23 -> NaN23 Invalid_operation
+ddadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddadd7882 add -NaN26 NaN28 -> -NaN26
+ddadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddadd7884 add 1000 -NaN30 -> -NaN30
+ddadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Here we explore near the boundary of rounding a subnormal to Nmin
+ddadd7575 add 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal
+ddadd7576 add -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal
+
+-- and another curious case
+ddadd7577 add 7.000000000000E-385 -1.00000E-391 -> 6.999999000000E-385 Subnormal
+
+-- check overflow edge case
+-- 1234567890123456
+ddadd7972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
+ddadd7973 add 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7974 add 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7975 add 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
+ddadd7976 add 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
+ddadd7977 add 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
+ddadd7978 add 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
+ddadd7979 add 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
+ddadd7980 add 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
+ddadd7981 add 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7982 add 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7983 add 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddadd7984 add 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
+
+ddadd7985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
+ddadd7986 add -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7987 add -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7988 add -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
+ddadd7989 add -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7990 add -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7991 add -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7992 add -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7993 add -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
+ddadd7994 add -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7995 add -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7996 add -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddadd7997 add -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+ddadd71100 add 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
+ddadd71101 add 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
+ddadd71103 add +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
+ddadd71104 add 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
+ddadd71105 add 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
+ddadd71106 add 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
+ddadd71107 add 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
+ddadd71108 add 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
+ddadd71109 add 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+ddadd71110 add -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
+ddadd71111 add -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
+ddadd71113 add -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
+ddadd71114 add -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
+ddadd71115 add -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
+ddadd71116 add -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
+ddadd71117 add -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
+ddadd71118 add -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
+ddadd71119 add -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+ddadd71300 add 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71310 add 1E16 -0.51 -> 9999999999999999 Inexact Rounded
+ddadd71311 add 1E16 -0.501 -> 9999999999999999 Inexact Rounded
+ddadd71312 add 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
+ddadd71313 add 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
+ddadd71314 add 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
+ddadd71315 add 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
+ddadd71316 add 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
+ddadd71317 add 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
+ddadd71318 add 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
+ddadd71319 add 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
+ddadd71320 add 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
+ddadd71321 add 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
+ddadd71322 add 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
+ddadd71323 add 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
+ddadd71324 add 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
+ddadd71325 add 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71326 add 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71327 add 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71328 add 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71329 add 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71330 add 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71331 add 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71332 add 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71333 add 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71334 add 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71335 add 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71336 add 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71337 add 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71338 add 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71339 add 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
+
+ddadd71340 add 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
+ddadd71341 add 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
+
+ddadd71349 add 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
+ddadd71350 add 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
+ddadd71351 add 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
+ddadd71352 add 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
+ddadd71353 add 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
+ddadd71354 add 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
+ddadd71355 add 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
+ddadd71356 add 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
+ddadd71357 add 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
+ddadd71358 add 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
+ddadd71359 add 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
+ddadd71360 add 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
+ddadd71361 add 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
+ddadd71362 add 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
+ddadd71363 add 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
+ddadd71364 add 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
+ddadd71365 add 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71367 add 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71368 add 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71369 add 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71370 add 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71371 add 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71372 add 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71373 add 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71374 add 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71375 add 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71376 add 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71377 add 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71378 add 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71379 add 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71380 add 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71381 add 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71382 add 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71383 add 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71384 add 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71385 add 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71386 add 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71387 add 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71388 add 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71389 add 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71390 add 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71391 add 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71392 add 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71393 add 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71394 add 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71395 add 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
+ddadd71396 add 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+ddadd71420 add 0 1.123456789012345 -> 1.123456789012345
+ddadd71421 add 0 1.123456789012345E-1 -> 0.1123456789012345
+ddadd71422 add 0 1.123456789012345E-2 -> 0.01123456789012345
+ddadd71423 add 0 1.123456789012345E-3 -> 0.001123456789012345
+ddadd71424 add 0 1.123456789012345E-4 -> 0.0001123456789012345
+ddadd71425 add 0 1.123456789012345E-5 -> 0.00001123456789012345
+ddadd71426 add 0 1.123456789012345E-6 -> 0.000001123456789012345
+ddadd71427 add 0 1.123456789012345E-7 -> 1.123456789012345E-7
+ddadd71428 add 0 1.123456789012345E-8 -> 1.123456789012345E-8
+ddadd71429 add 0 1.123456789012345E-9 -> 1.123456789012345E-9
+ddadd71430 add 0 1.123456789012345E-10 -> 1.123456789012345E-10
+ddadd71431 add 0 1.123456789012345E-11 -> 1.123456789012345E-11
+ddadd71432 add 0 1.123456789012345E-12 -> 1.123456789012345E-12
+ddadd71433 add 0 1.123456789012345E-13 -> 1.123456789012345E-13
+ddadd71434 add 0 1.123456789012345E-14 -> 1.123456789012345E-14
+ddadd71435 add 0 1.123456789012345E-15 -> 1.123456789012345E-15
+ddadd71436 add 0 1.123456789012345E-16 -> 1.123456789012345E-16
+ddadd71437 add 0 1.123456789012345E-17 -> 1.123456789012345E-17
+ddadd71438 add 0 1.123456789012345E-18 -> 1.123456789012345E-18
+ddadd71439 add 0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+ddadd71440 add 1.123456789012345 0 -> 1.123456789012345
+ddadd71441 add 1.123456789012345E-1 0 -> 0.1123456789012345
+ddadd71442 add 1.123456789012345E-2 0 -> 0.01123456789012345
+ddadd71443 add 1.123456789012345E-3 0 -> 0.001123456789012345
+ddadd71444 add 1.123456789012345E-4 0 -> 0.0001123456789012345
+ddadd71445 add 1.123456789012345E-5 0 -> 0.00001123456789012345
+ddadd71446 add 1.123456789012345E-6 0 -> 0.000001123456789012345
+ddadd71447 add 1.123456789012345E-7 0 -> 1.123456789012345E-7
+ddadd71448 add 1.123456789012345E-8 0 -> 1.123456789012345E-8
+ddadd71449 add 1.123456789012345E-9 0 -> 1.123456789012345E-9
+ddadd71450 add 1.123456789012345E-10 0 -> 1.123456789012345E-10
+ddadd71451 add 1.123456789012345E-11 0 -> 1.123456789012345E-11
+ddadd71452 add 1.123456789012345E-12 0 -> 1.123456789012345E-12
+ddadd71453 add 1.123456789012345E-13 0 -> 1.123456789012345E-13
+ddadd71454 add 1.123456789012345E-14 0 -> 1.123456789012345E-14
+ddadd71455 add 1.123456789012345E-15 0 -> 1.123456789012345E-15
+ddadd71456 add 1.123456789012345E-16 0 -> 1.123456789012345E-16
+ddadd71457 add 1.123456789012345E-17 0 -> 1.123456789012345E-17
+ddadd71458 add 1.123456789012345E-18 0 -> 1.123456789012345E-18
+ddadd71459 add 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+ddadd71460 add 1.123456789012345 0E-0 -> 1.123456789012345
+ddadd71461 add 1.123456789012345 0E-1 -> 1.123456789012345
+ddadd71462 add 1.123456789012345 0E-2 -> 1.123456789012345
+ddadd71463 add 1.123456789012345 0E-3 -> 1.123456789012345
+ddadd71464 add 1.123456789012345 0E-4 -> 1.123456789012345
+ddadd71465 add 1.123456789012345 0E-5 -> 1.123456789012345
+ddadd71466 add 1.123456789012345 0E-6 -> 1.123456789012345
+ddadd71467 add 1.123456789012345 0E-7 -> 1.123456789012345
+ddadd71468 add 1.123456789012345 0E-8 -> 1.123456789012345
+ddadd71469 add 1.123456789012345 0E-9 -> 1.123456789012345
+ddadd71470 add 1.123456789012345 0E-10 -> 1.123456789012345
+ddadd71471 add 1.123456789012345 0E-11 -> 1.123456789012345
+ddadd71472 add 1.123456789012345 0E-12 -> 1.123456789012345
+ddadd71473 add 1.123456789012345 0E-13 -> 1.123456789012345
+ddadd71474 add 1.123456789012345 0E-14 -> 1.123456789012345
+ddadd71475 add 1.123456789012345 0E-15 -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+ddadd71476 add 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
+ddadd71477 add 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
+ddadd71478 add 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
+ddadd71479 add 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+ddadd71500 add 0 0E-19 -> 0E-19
+ddadd71501 add -0 0E-19 -> 0E-19
+ddadd71502 add 0 -0E-19 -> 0E-19
+ddadd71503 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71511 add -11 11 -> 0
+ddadd71512 add 11 -11 -> 0
+
+rounding: half_down
+-- exact zeros from zeros
+ddadd71520 add 0 0E-19 -> 0E-19
+ddadd71521 add -0 0E-19 -> 0E-19
+ddadd71522 add 0 -0E-19 -> 0E-19
+ddadd71523 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71531 add -11 11 -> 0
+ddadd71532 add 11 -11 -> 0
+
+rounding: half_even
+-- exact zeros from zeros
+ddadd71540 add 0 0E-19 -> 0E-19
+ddadd71541 add -0 0E-19 -> 0E-19
+ddadd71542 add 0 -0E-19 -> 0E-19
+ddadd71543 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71551 add -11 11 -> 0
+ddadd71552 add 11 -11 -> 0
+
+rounding: up
+-- exact zeros from zeros
+ddadd71560 add 0 0E-19 -> 0E-19
+ddadd71561 add -0 0E-19 -> 0E-19
+ddadd71562 add 0 -0E-19 -> 0E-19
+ddadd71563 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71571 add -11 11 -> 0
+ddadd71572 add 11 -11 -> 0
+
+rounding: down
+-- exact zeros from zeros
+ddadd71580 add 0 0E-19 -> 0E-19
+ddadd71581 add -0 0E-19 -> 0E-19
+ddadd71582 add 0 -0E-19 -> 0E-19
+ddadd71583 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71591 add -11 11 -> 0
+ddadd71592 add 11 -11 -> 0
+
+rounding: ceiling
+-- exact zeros from zeros
+ddadd71600 add 0 0E-19 -> 0E-19
+ddadd71601 add -0 0E-19 -> 0E-19
+ddadd71602 add 0 -0E-19 -> 0E-19
+ddadd71603 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71611 add -11 11 -> 0
+ddadd71612 add 11 -11 -> 0
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+ddadd71620 add 0 0E-19 -> 0E-19
+ddadd71621 add -0 0E-19 -> -0E-19 -- *
+ddadd71622 add 0 -0E-19 -> -0E-19 -- *
+ddadd71623 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddadd71631 add -11 11 -> -0 -- *
+ddadd71632 add 11 -11 -> -0 -- *
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+ddadd71701 add 130E-2 120E-2 -> 2.50
+ddadd71702 add 130E-2 12E-1 -> 2.50
+ddadd71703 add 130E-2 1E0 -> 2.30
+ddadd71704 add 1E2 1E4 -> 1.01E+4
+ddadd71705 add 130E-2 -120E-2 -> 0.10
+ddadd71706 add 130E-2 -12E-1 -> 0.10
+ddadd71707 add 130E-2 -1E0 -> 0.30
+ddadd71708 add 1E2 -1E4 -> -9.9E+3
+
+-- query from Vincent Kulandaisamy
+rounding: ceiling
+ddadd71801 add 7.8822773805862E+277 -5.1757503820663E-21 -> 7.882277380586200E+277 Inexact Rounded
+ddadd71802 add 7.882277380586200E+277 12.341 -> 7.882277380586201E+277 Inexact Rounded
+ddadd71803 add 7.882277380586201E+277 2.7270545046613E-31 -> 7.882277380586202E+277 Inexact Rounded
+
+ddadd71811 add 12.341 -5.1757503820663E-21 -> 12.34100000000000 Inexact Rounded
+ddadd71812 add 12.34100000000000 2.7270545046613E-31 -> 12.34100000000001 Inexact Rounded
+ddadd71813 add 12.34100000000001 7.8822773805862E+277 -> 7.882277380586201E+277 Inexact Rounded
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+ddadd75001 add 1234567890123456 1 -> 1234567890123457
+ddadd75002 add 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
+ddadd75003 add 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
+ddadd75004 add 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
+ddadd75005 add 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
+ddadd75006 add 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
+ddadd75007 add 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
+ddadd75008 add 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
+ddadd75009 add 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
+ddadd75010 add 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
+ddadd75011 add 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
+ddadd75012 add 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
+ddadd75013 add 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
+ddadd75014 add 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
+ddadd75015 add 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
+ddadd75016 add 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
+ddadd75017 add 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
+ddadd75018 add 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
+ddadd75019 add 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
+ddadd75020 add 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
+ddadd75021 add 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
+
+-- widening second argument at gap
+ddadd75030 add 12345678 1 -> 12345679
+ddadd75031 add 12345678 0.1 -> 12345678.1
+ddadd75032 add 12345678 0.12 -> 12345678.12
+ddadd75033 add 12345678 0.123 -> 12345678.123
+ddadd75034 add 12345678 0.1234 -> 12345678.1234
+ddadd75035 add 12345678 0.12345 -> 12345678.12345
+ddadd75036 add 12345678 0.123456 -> 12345678.123456
+ddadd75037 add 12345678 0.1234567 -> 12345678.1234567
+ddadd75038 add 12345678 0.12345678 -> 12345678.12345678
+ddadd75039 add 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
+ddadd75040 add 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
+ddadd75041 add 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
+ddadd75042 add 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
+ddadd75043 add 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
+ddadd75044 add 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
+ddadd75045 add 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
+ddadd75046 add 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
+ddadd75047 add 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
+ddadd75048 add 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
+ddadd75049 add 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+ddadd75050 add 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
+ddadd75051 add 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
+ddadd75052 add 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
+ddadd75053 add 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
+ddadd75054 add 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
+ddadd75055 add 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
+ddadd75056 add 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
+ddadd75057 add 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
+ddadd75060 add 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
+ddadd75061 add 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
+ddadd75062 add 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
+ddadd75063 add 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
+ddadd75064 add 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
+ddadd75065 add 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
+ddadd75066 add 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
+ddadd75067 add 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+ddadd75070 add 12345678 1E-8 -> 12345678.00000001
+ddadd75071 add 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
+ddadd75072 add 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
+ddadd75073 add 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
+ddadd75074 add 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
+ddadd75075 add 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
+ddadd75076 add 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
+ddadd75077 add 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
+ddadd75078 add 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
+ddadd75079 add 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
+ddadd75080 add 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
+ddadd75081 add 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
+ddadd75082 add 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
+ddadd75083 add 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
+ddadd75084 add 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
+ddadd75085 add 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
+ddadd75086 add 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
+ddadd75087 add 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
+ddadd75088 add 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
+ddadd75089 add 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
+
+-- Punit's
+ddadd75100 add 1.000 -200.000 -> -199.000
+
+-- Rounding swathe
+rounding: half_even
+ddadd81100 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81101 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81102 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81103 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81104 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81105 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81106 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81107 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81108 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81109 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81120 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81121 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: half_up
+ddadd81200 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81201 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81202 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81203 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81204 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81205 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81206 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81207 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81208 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81209 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81220 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81221 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: half_down
+ddadd81300 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81301 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81302 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81303 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81304 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81305 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81306 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81307 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81308 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81309 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81320 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81321 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: up
+ddadd81400 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81401 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81402 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81403 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81404 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81405 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81406 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81407 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81408 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81409 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81411 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
+ddadd81420 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81421 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: down
+ddadd81500 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81501 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81502 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81503 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81504 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81505 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81506 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81507 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81508 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81509 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81511 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded
+ddadd81520 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddadd81521 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
+
+rounding: ceiling
+ddadd81600 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81601 add .2301 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81602 add .2310 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81603 add .2350 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81604 add .2351 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81605 add .2450 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81606 add .2451 12345678901234.00 -> 12345678901234.25 Inexact Rounded
+ddadd81607 add .2360 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81608 add .2370 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81609 add .2399 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81611 add -.2399 -12345678901234.00 -> -12345678901234.23 Inexact Rounded
+ddadd81620 add 9999999999999999E+369 9E+369 -> Infinity Overflow Inexact Rounded
+ddadd81621 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
+
+rounding: floor
+ddadd81700 add .2300 12345678901234.00 -> 12345678901234.23 Rounded
+ddadd81701 add .2301 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81702 add .2310 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81703 add .2350 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81704 add .2351 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81705 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81706 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd81707 add .2360 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81708 add .2370 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81709 add .2399 12345678901234.00 -> 12345678901234.23 Inexact Rounded
+ddadd81711 add -.2399 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
+ddadd81720 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddadd81721 add -9999999999999999E+369 -9E+369 -> -Infinity Overflow Inexact Rounded
+
+rounding: 05up
+ddadd81800 add .2000 12345678901234.00 -> 12345678901234.20 Rounded
+ddadd81801 add .2001 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81802 add .2010 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81803 add .2050 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81804 add .2051 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81807 add .2060 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81808 add .2070 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81809 add .2099 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81811 add -.2099 -12345678901234.00 -> -12345678901234.21 Inexact Rounded
+ddadd81820 add 9999999999999999E+369 9E+369 -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddadd81821 add -9999999999999999E+369 -9E+369 -> -9.999999999999999E+384 Overflow Inexact Rounded
+
+ddadd81900 add .2100 12345678901234.00 -> 12345678901234.21 Rounded
+ddadd81901 add .2101 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81902 add .2110 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81903 add .2150 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81904 add .2151 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81907 add .2160 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81908 add .2170 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81909 add .2199 12345678901234.00 -> 12345678901234.21 Inexact Rounded
+ddadd81911 add -.2199 -12345678901234.00 -> -12345678901234.21 Inexact Rounded
+
+ddadd82000 add .2400 12345678901234.00 -> 12345678901234.24 Rounded
+ddadd82001 add .2401 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82002 add .2410 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82003 add .2450 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82004 add .2451 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82007 add .2460 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82008 add .2470 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82009 add .2499 12345678901234.00 -> 12345678901234.24 Inexact Rounded
+ddadd82011 add -.2499 -12345678901234.00 -> -12345678901234.24 Inexact Rounded
+
+ddadd82100 add .2500 12345678901234.00 -> 12345678901234.25 Rounded
+ddadd82101 add .2501 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82102 add .2510 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82103 add .2550 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82104 add .2551 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82107 add .2560 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82108 add .2570 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82109 add .2599 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82111 add -.2599 -12345678901234.00 -> -12345678901234.26 Inexact Rounded
+
+ddadd82200 add .2600 12345678901234.00 -> 12345678901234.26 Rounded
+ddadd82201 add .2601 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82202 add .2610 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82203 add .2650 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82204 add .2651 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82207 add .2660 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82208 add .2670 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82209 add .2699 12345678901234.00 -> 12345678901234.26 Inexact Rounded
+ddadd82211 add -.2699 -12345678901234.00 -> -12345678901234.26 Inexact Rounded
+
+ddadd82300 add .2900 12345678901234.00 -> 12345678901234.29 Rounded
+ddadd82301 add .2901 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82302 add .2910 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82303 add .2950 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82304 add .2951 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82307 add .2960 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82308 add .2970 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82309 add .2999 12345678901234.00 -> 12345678901234.29 Inexact Rounded
+ddadd82311 add -.2999 -12345678901234.00 -> -12345678901234.29 Inexact Rounded
+
+-- Null tests
+ddadd9990 add 10 # -> NaN Invalid_operation
+ddadd9991 add # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddAnd.decTest b/Lib/test/decimaltestdata/ddAnd.decTest
index 676517548c..64a9f92df9 100644
--- a/Lib/test/decimaltestdata/ddAnd.decTest
+++ b/Lib/test/decimaltestdata/ddAnd.decTest
@@ -1,347 +1,347 @@
-------------------------------------------------------------------------
--- ddAnd.decTest -- digitwise logical AND for decDoubles --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check (truth table)
-ddand001 and 0 0 -> 0
-ddand002 and 0 1 -> 0
-ddand003 and 1 0 -> 0
-ddand004 and 1 1 -> 1
-ddand005 and 1100 1010 -> 1000
--- and at msd and msd-1
--- 1234567890123456 1234567890123456 1234567890123456
-ddand006 and 0000000000000000 0000000000000000 -> 0
-ddand007 and 0000000000000000 1000000000000000 -> 0
-ddand008 and 1000000000000000 0000000000000000 -> 0
-ddand009 and 1000000000000000 1000000000000000 -> 1000000000000000
-ddand010 and 0000000000000000 0000000000000000 -> 0
-ddand011 and 0000000000000000 0100000000000000 -> 0
-ddand012 and 0100000000000000 0000000000000000 -> 0
-ddand013 and 0100000000000000 0100000000000000 -> 100000000000000
-
--- Various lengths
--- 1234567890123456 1234567890123456 1234567890123456
-ddand021 and 1111111111111111 1111111111111111 -> 1111111111111111
-ddand024 and 1111111111111111 111111111111111 -> 111111111111111
-ddand025 and 1111111111111111 11111111111111 -> 11111111111111
-ddand026 and 1111111111111111 1111111111111 -> 1111111111111
-ddand027 and 1111111111111111 111111111111 -> 111111111111
-ddand028 and 1111111111111111 11111111111 -> 11111111111
-ddand029 and 1111111111111111 1111111111 -> 1111111111
-ddand030 and 1111111111111111 111111111 -> 111111111
-ddand031 and 1111111111111111 11111111 -> 11111111
-ddand032 and 1111111111111111 1111111 -> 1111111
-ddand033 and 1111111111111111 111111 -> 111111
-ddand034 and 1111111111111111 11111 -> 11111
-ddand035 and 1111111111111111 1111 -> 1111
-ddand036 and 1111111111111111 111 -> 111
-ddand037 and 1111111111111111 11 -> 11
-ddand038 and 1111111111111111 1 -> 1
-ddand039 and 1111111111111111 0 -> 0
-
-ddand040 and 1111111111111111 1111111111111111 -> 1111111111111111
-ddand041 and 111111111111111 1111111111111111 -> 111111111111111
-ddand042 and 111111111111111 1111111111111111 -> 111111111111111
-ddand043 and 11111111111111 1111111111111111 -> 11111111111111
-ddand044 and 1111111111111 1111111111111111 -> 1111111111111
-ddand045 and 111111111111 1111111111111111 -> 111111111111
-ddand046 and 11111111111 1111111111111111 -> 11111111111
-ddand047 and 1111111111 1111111111111111 -> 1111111111
-ddand048 and 111111111 1111111111111111 -> 111111111
-ddand049 and 11111111 1111111111111111 -> 11111111
-ddand050 and 1111111 1111111111111111 -> 1111111
-ddand051 and 111111 1111111111111111 -> 111111
-ddand052 and 11111 1111111111111111 -> 11111
-ddand053 and 1111 1111111111111111 -> 1111
-ddand054 and 111 1111111111111111 -> 111
-ddand055 and 11 1111111111111111 -> 11
-ddand056 and 1 1111111111111111 -> 1
-ddand057 and 0 1111111111111111 -> 0
-
-ddand150 and 1111111111 1 -> 1
-ddand151 and 111111111 1 -> 1
-ddand152 and 11111111 1 -> 1
-ddand153 and 1111111 1 -> 1
-ddand154 and 111111 1 -> 1
-ddand155 and 11111 1 -> 1
-ddand156 and 1111 1 -> 1
-ddand157 and 111 1 -> 1
-ddand158 and 11 1 -> 1
-ddand159 and 1 1 -> 1
-
-ddand160 and 1111111111 0 -> 0
-ddand161 and 111111111 0 -> 0
-ddand162 and 11111111 0 -> 0
-ddand163 and 1111111 0 -> 0
-ddand164 and 111111 0 -> 0
-ddand165 and 11111 0 -> 0
-ddand166 and 1111 0 -> 0
-ddand167 and 111 0 -> 0
-ddand168 and 11 0 -> 0
-ddand169 and 1 0 -> 0
-
-ddand170 and 1 1111111111 -> 1
-ddand171 and 1 111111111 -> 1
-ddand172 and 1 11111111 -> 1
-ddand173 and 1 1111111 -> 1
-ddand174 and 1 111111 -> 1
-ddand175 and 1 11111 -> 1
-ddand176 and 1 1111 -> 1
-ddand177 and 1 111 -> 1
-ddand178 and 1 11 -> 1
-ddand179 and 1 1 -> 1
-
-ddand180 and 0 1111111111 -> 0
-ddand181 and 0 111111111 -> 0
-ddand182 and 0 11111111 -> 0
-ddand183 and 0 1111111 -> 0
-ddand184 and 0 111111 -> 0
-ddand185 and 0 11111 -> 0
-ddand186 and 0 1111 -> 0
-ddand187 and 0 111 -> 0
-ddand188 and 0 11 -> 0
-ddand189 and 0 1 -> 0
-
-ddand090 and 011111111 111111111 -> 11111111
-ddand091 and 101111111 111111111 -> 101111111
-ddand092 and 110111111 111111111 -> 110111111
-ddand093 and 111011111 111111111 -> 111011111
-ddand094 and 111101111 111111111 -> 111101111
-ddand095 and 111110111 111111111 -> 111110111
-ddand096 and 111111011 111111111 -> 111111011
-ddand097 and 111111101 111111111 -> 111111101
-ddand098 and 111111110 111111111 -> 111111110
-
-ddand100 and 111111111 011111111 -> 11111111
-ddand101 and 111111111 101111111 -> 101111111
-ddand102 and 111111111 110111111 -> 110111111
-ddand103 and 111111111 111011111 -> 111011111
-ddand104 and 111111111 111101111 -> 111101111
-ddand105 and 111111111 111110111 -> 111110111
-ddand106 and 111111111 111111011 -> 111111011
-ddand107 and 111111111 111111101 -> 111111101
-ddand108 and 111111111 111111110 -> 111111110
-
--- non-0/1 should not be accepted, nor should signs
-ddand220 and 111111112 111111111 -> NaN Invalid_operation
-ddand221 and 333333333 333333333 -> NaN Invalid_operation
-ddand222 and 555555555 555555555 -> NaN Invalid_operation
-ddand223 and 777777777 777777777 -> NaN Invalid_operation
-ddand224 and 999999999 999999999 -> NaN Invalid_operation
-ddand225 and 222222222 999999999 -> NaN Invalid_operation
-ddand226 and 444444444 999999999 -> NaN Invalid_operation
-ddand227 and 666666666 999999999 -> NaN Invalid_operation
-ddand228 and 888888888 999999999 -> NaN Invalid_operation
-ddand229 and 999999999 222222222 -> NaN Invalid_operation
-ddand230 and 999999999 444444444 -> NaN Invalid_operation
-ddand231 and 999999999 666666666 -> NaN Invalid_operation
-ddand232 and 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-ddand240 and 567468689 -934981942 -> NaN Invalid_operation
-ddand241 and 567367689 934981942 -> NaN Invalid_operation
-ddand242 and -631917772 -706014634 -> NaN Invalid_operation
-ddand243 and -756253257 138579234 -> NaN Invalid_operation
-ddand244 and 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-ddand250 and 2000000000000000 1000000000000000 -> NaN Invalid_operation
-ddand251 and 7000000000000000 1000000000000000 -> NaN Invalid_operation
-ddand252 and 8000000000000000 1000000000000000 -> NaN Invalid_operation
-ddand253 and 9000000000000000 1000000000000000 -> NaN Invalid_operation
-ddand254 and 2000000000000000 0000000000000000 -> NaN Invalid_operation
-ddand255 and 7000000000000000 0000000000000000 -> NaN Invalid_operation
-ddand256 and 8000000000000000 0000000000000000 -> NaN Invalid_operation
-ddand257 and 9000000000000000 0000000000000000 -> NaN Invalid_operation
-ddand258 and 1000000000000000 2000000000000000 -> NaN Invalid_operation
-ddand259 and 1000000000000000 7000000000000000 -> NaN Invalid_operation
-ddand260 and 1000000000000000 8000000000000000 -> NaN Invalid_operation
-ddand261 and 1000000000000000 9000000000000000 -> NaN Invalid_operation
-ddand262 and 0000000000000000 2000000000000000 -> NaN Invalid_operation
-ddand263 and 0000000000000000 7000000000000000 -> NaN Invalid_operation
-ddand264 and 0000000000000000 8000000000000000 -> NaN Invalid_operation
-ddand265 and 0000000000000000 9000000000000000 -> NaN Invalid_operation
--- test MSD-1
-ddand270 and 0200001000000000 1000100000000010 -> NaN Invalid_operation
-ddand271 and 0700000100000000 1000010000000100 -> NaN Invalid_operation
-ddand272 and 0800000010000000 1000001000001000 -> NaN Invalid_operation
-ddand273 and 0900000001000000 1000000100010000 -> NaN Invalid_operation
-ddand274 and 1000000000100000 0200000010100000 -> NaN Invalid_operation
-ddand275 and 1000000000010000 0700000001000000 -> NaN Invalid_operation
-ddand276 and 1000000000001000 0800000010100000 -> NaN Invalid_operation
-ddand277 and 1000000000000100 0900000000010000 -> NaN Invalid_operation
--- test LSD
-ddand280 and 0010000000000002 1000000100000001 -> NaN Invalid_operation
-ddand281 and 0001000000000007 1000001000000011 -> NaN Invalid_operation
-ddand282 and 0000100000000008 1000010000000001 -> NaN Invalid_operation
-ddand283 and 0000010000000009 1000100000000001 -> NaN Invalid_operation
-ddand284 and 1000001000000000 0001000000000002 -> NaN Invalid_operation
-ddand285 and 1000000100000000 0010000000000007 -> NaN Invalid_operation
-ddand286 and 1000000010000000 0100000000000008 -> NaN Invalid_operation
-ddand287 and 1000000001000000 1000000000000009 -> NaN Invalid_operation
--- test Middie
-ddand288 and 0010000020000000 1000001000000000 -> NaN Invalid_operation
-ddand289 and 0001000070000001 1000000100000000 -> NaN Invalid_operation
-ddand290 and 0000100080000010 1000000010000000 -> NaN Invalid_operation
-ddand291 and 0000010090000100 1000000001000000 -> NaN Invalid_operation
-ddand292 and 1000001000001000 0000000020100000 -> NaN Invalid_operation
-ddand293 and 1000000100010000 0000000070010000 -> NaN Invalid_operation
-ddand294 and 1000000010100000 0000000080001000 -> NaN Invalid_operation
-ddand295 and 1000000001000000 0000000090000100 -> NaN Invalid_operation
--- signs
-ddand296 and -1000000001000000 -0000010000000100 -> NaN Invalid_operation
-ddand297 and -1000000001000000 0000000010000100 -> NaN Invalid_operation
-ddand298 and 1000000001000000 -0000001000000100 -> NaN Invalid_operation
-ddand299 and 1000000001000000 0000000011000100 -> 1000000
-
--- Nmax, Nmin, Ntiny-like
-ddand331 and 2 9.99999999E+199 -> NaN Invalid_operation
-ddand332 and 3 1E-199 -> NaN Invalid_operation
-ddand333 and 4 1.00000000E-199 -> NaN Invalid_operation
-ddand334 and 5 1E-100 -> NaN Invalid_operation
-ddand335 and 6 -1E-100 -> NaN Invalid_operation
-ddand336 and 7 -1.00000000E-199 -> NaN Invalid_operation
-ddand337 and 8 -1E-199 -> NaN Invalid_operation
-ddand338 and 9 -9.99999999E+199 -> NaN Invalid_operation
-ddand341 and 9.99999999E+199 -18 -> NaN Invalid_operation
-ddand342 and 1E-199 01 -> NaN Invalid_operation
-ddand343 and 1.00000000E-199 -18 -> NaN Invalid_operation
-ddand344 and 1E-100 18 -> NaN Invalid_operation
-ddand345 and -1E-100 -10 -> NaN Invalid_operation
-ddand346 and -1.00000000E-199 18 -> NaN Invalid_operation
-ddand347 and -1E-199 10 -> NaN Invalid_operation
-ddand348 and -9.99999999E+199 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-ddand361 and 1.0 1 -> NaN Invalid_operation
-ddand362 and 1E+1 1 -> NaN Invalid_operation
-ddand363 and 0.0 1 -> NaN Invalid_operation
-ddand364 and 0E+1 1 -> NaN Invalid_operation
-ddand365 and 9.9 1 -> NaN Invalid_operation
-ddand366 and 9E+1 1 -> NaN Invalid_operation
-ddand371 and 0 1.0 -> NaN Invalid_operation
-ddand372 and 0 1E+1 -> NaN Invalid_operation
-ddand373 and 0 0.0 -> NaN Invalid_operation
-ddand374 and 0 0E+1 -> NaN Invalid_operation
-ddand375 and 0 9.9 -> NaN Invalid_operation
-ddand376 and 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-ddand780 and -Inf -Inf -> NaN Invalid_operation
-ddand781 and -Inf -1000 -> NaN Invalid_operation
-ddand782 and -Inf -1 -> NaN Invalid_operation
-ddand783 and -Inf -0 -> NaN Invalid_operation
-ddand784 and -Inf 0 -> NaN Invalid_operation
-ddand785 and -Inf 1 -> NaN Invalid_operation
-ddand786 and -Inf 1000 -> NaN Invalid_operation
-ddand787 and -1000 -Inf -> NaN Invalid_operation
-ddand788 and -Inf -Inf -> NaN Invalid_operation
-ddand789 and -1 -Inf -> NaN Invalid_operation
-ddand790 and -0 -Inf -> NaN Invalid_operation
-ddand791 and 0 -Inf -> NaN Invalid_operation
-ddand792 and 1 -Inf -> NaN Invalid_operation
-ddand793 and 1000 -Inf -> NaN Invalid_operation
-ddand794 and Inf -Inf -> NaN Invalid_operation
-
-ddand800 and Inf -Inf -> NaN Invalid_operation
-ddand801 and Inf -1000 -> NaN Invalid_operation
-ddand802 and Inf -1 -> NaN Invalid_operation
-ddand803 and Inf -0 -> NaN Invalid_operation
-ddand804 and Inf 0 -> NaN Invalid_operation
-ddand805 and Inf 1 -> NaN Invalid_operation
-ddand806 and Inf 1000 -> NaN Invalid_operation
-ddand807 and Inf Inf -> NaN Invalid_operation
-ddand808 and -1000 Inf -> NaN Invalid_operation
-ddand809 and -Inf Inf -> NaN Invalid_operation
-ddand810 and -1 Inf -> NaN Invalid_operation
-ddand811 and -0 Inf -> NaN Invalid_operation
-ddand812 and 0 Inf -> NaN Invalid_operation
-ddand813 and 1 Inf -> NaN Invalid_operation
-ddand814 and 1000 Inf -> NaN Invalid_operation
-ddand815 and Inf Inf -> NaN Invalid_operation
-
-ddand821 and NaN -Inf -> NaN Invalid_operation
-ddand822 and NaN -1000 -> NaN Invalid_operation
-ddand823 and NaN -1 -> NaN Invalid_operation
-ddand824 and NaN -0 -> NaN Invalid_operation
-ddand825 and NaN 0 -> NaN Invalid_operation
-ddand826 and NaN 1 -> NaN Invalid_operation
-ddand827 and NaN 1000 -> NaN Invalid_operation
-ddand828 and NaN Inf -> NaN Invalid_operation
-ddand829 and NaN NaN -> NaN Invalid_operation
-ddand830 and -Inf NaN -> NaN Invalid_operation
-ddand831 and -1000 NaN -> NaN Invalid_operation
-ddand832 and -1 NaN -> NaN Invalid_operation
-ddand833 and -0 NaN -> NaN Invalid_operation
-ddand834 and 0 NaN -> NaN Invalid_operation
-ddand835 and 1 NaN -> NaN Invalid_operation
-ddand836 and 1000 NaN -> NaN Invalid_operation
-ddand837 and Inf NaN -> NaN Invalid_operation
-
-ddand841 and sNaN -Inf -> NaN Invalid_operation
-ddand842 and sNaN -1000 -> NaN Invalid_operation
-ddand843 and sNaN -1 -> NaN Invalid_operation
-ddand844 and sNaN -0 -> NaN Invalid_operation
-ddand845 and sNaN 0 -> NaN Invalid_operation
-ddand846 and sNaN 1 -> NaN Invalid_operation
-ddand847 and sNaN 1000 -> NaN Invalid_operation
-ddand848 and sNaN NaN -> NaN Invalid_operation
-ddand849 and sNaN sNaN -> NaN Invalid_operation
-ddand850 and NaN sNaN -> NaN Invalid_operation
-ddand851 and -Inf sNaN -> NaN Invalid_operation
-ddand852 and -1000 sNaN -> NaN Invalid_operation
-ddand853 and -1 sNaN -> NaN Invalid_operation
-ddand854 and -0 sNaN -> NaN Invalid_operation
-ddand855 and 0 sNaN -> NaN Invalid_operation
-ddand856 and 1 sNaN -> NaN Invalid_operation
-ddand857 and 1000 sNaN -> NaN Invalid_operation
-ddand858 and Inf sNaN -> NaN Invalid_operation
-ddand859 and NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddand861 and NaN1 -Inf -> NaN Invalid_operation
-ddand862 and +NaN2 -1000 -> NaN Invalid_operation
-ddand863 and NaN3 1000 -> NaN Invalid_operation
-ddand864 and NaN4 Inf -> NaN Invalid_operation
-ddand865 and NaN5 +NaN6 -> NaN Invalid_operation
-ddand866 and -Inf NaN7 -> NaN Invalid_operation
-ddand867 and -1000 NaN8 -> NaN Invalid_operation
-ddand868 and 1000 NaN9 -> NaN Invalid_operation
-ddand869 and Inf +NaN10 -> NaN Invalid_operation
-ddand871 and sNaN11 -Inf -> NaN Invalid_operation
-ddand872 and sNaN12 -1000 -> NaN Invalid_operation
-ddand873 and sNaN13 1000 -> NaN Invalid_operation
-ddand874 and sNaN14 NaN17 -> NaN Invalid_operation
-ddand875 and sNaN15 sNaN18 -> NaN Invalid_operation
-ddand876 and NaN16 sNaN19 -> NaN Invalid_operation
-ddand877 and -Inf +sNaN20 -> NaN Invalid_operation
-ddand878 and -1000 sNaN21 -> NaN Invalid_operation
-ddand879 and 1000 sNaN22 -> NaN Invalid_operation
-ddand880 and Inf sNaN23 -> NaN Invalid_operation
-ddand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
-ddand882 and -NaN26 NaN28 -> NaN Invalid_operation
-ddand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
-ddand884 and 1000 -NaN30 -> NaN Invalid_operation
-ddand885 and 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddAnd.decTest -- digitwise logical AND for decDoubles --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check (truth table)
+ddand001 and 0 0 -> 0
+ddand002 and 0 1 -> 0
+ddand003 and 1 0 -> 0
+ddand004 and 1 1 -> 1
+ddand005 and 1100 1010 -> 1000
+-- and at msd and msd-1
+-- 1234567890123456 1234567890123456 1234567890123456
+ddand006 and 0000000000000000 0000000000000000 -> 0
+ddand007 and 0000000000000000 1000000000000000 -> 0
+ddand008 and 1000000000000000 0000000000000000 -> 0
+ddand009 and 1000000000000000 1000000000000000 -> 1000000000000000
+ddand010 and 0000000000000000 0000000000000000 -> 0
+ddand011 and 0000000000000000 0100000000000000 -> 0
+ddand012 and 0100000000000000 0000000000000000 -> 0
+ddand013 and 0100000000000000 0100000000000000 -> 100000000000000
+
+-- Various lengths
+-- 1234567890123456 1234567890123456 1234567890123456
+ddand021 and 1111111111111111 1111111111111111 -> 1111111111111111
+ddand024 and 1111111111111111 111111111111111 -> 111111111111111
+ddand025 and 1111111111111111 11111111111111 -> 11111111111111
+ddand026 and 1111111111111111 1111111111111 -> 1111111111111
+ddand027 and 1111111111111111 111111111111 -> 111111111111
+ddand028 and 1111111111111111 11111111111 -> 11111111111
+ddand029 and 1111111111111111 1111111111 -> 1111111111
+ddand030 and 1111111111111111 111111111 -> 111111111
+ddand031 and 1111111111111111 11111111 -> 11111111
+ddand032 and 1111111111111111 1111111 -> 1111111
+ddand033 and 1111111111111111 111111 -> 111111
+ddand034 and 1111111111111111 11111 -> 11111
+ddand035 and 1111111111111111 1111 -> 1111
+ddand036 and 1111111111111111 111 -> 111
+ddand037 and 1111111111111111 11 -> 11
+ddand038 and 1111111111111111 1 -> 1
+ddand039 and 1111111111111111 0 -> 0
+
+ddand040 and 1111111111111111 1111111111111111 -> 1111111111111111
+ddand041 and 111111111111111 1111111111111111 -> 111111111111111
+ddand042 and 111111111111111 1111111111111111 -> 111111111111111
+ddand043 and 11111111111111 1111111111111111 -> 11111111111111
+ddand044 and 1111111111111 1111111111111111 -> 1111111111111
+ddand045 and 111111111111 1111111111111111 -> 111111111111
+ddand046 and 11111111111 1111111111111111 -> 11111111111
+ddand047 and 1111111111 1111111111111111 -> 1111111111
+ddand048 and 111111111 1111111111111111 -> 111111111
+ddand049 and 11111111 1111111111111111 -> 11111111
+ddand050 and 1111111 1111111111111111 -> 1111111
+ddand051 and 111111 1111111111111111 -> 111111
+ddand052 and 11111 1111111111111111 -> 11111
+ddand053 and 1111 1111111111111111 -> 1111
+ddand054 and 111 1111111111111111 -> 111
+ddand055 and 11 1111111111111111 -> 11
+ddand056 and 1 1111111111111111 -> 1
+ddand057 and 0 1111111111111111 -> 0
+
+ddand150 and 1111111111 1 -> 1
+ddand151 and 111111111 1 -> 1
+ddand152 and 11111111 1 -> 1
+ddand153 and 1111111 1 -> 1
+ddand154 and 111111 1 -> 1
+ddand155 and 11111 1 -> 1
+ddand156 and 1111 1 -> 1
+ddand157 and 111 1 -> 1
+ddand158 and 11 1 -> 1
+ddand159 and 1 1 -> 1
+
+ddand160 and 1111111111 0 -> 0
+ddand161 and 111111111 0 -> 0
+ddand162 and 11111111 0 -> 0
+ddand163 and 1111111 0 -> 0
+ddand164 and 111111 0 -> 0
+ddand165 and 11111 0 -> 0
+ddand166 and 1111 0 -> 0
+ddand167 and 111 0 -> 0
+ddand168 and 11 0 -> 0
+ddand169 and 1 0 -> 0
+
+ddand170 and 1 1111111111 -> 1
+ddand171 and 1 111111111 -> 1
+ddand172 and 1 11111111 -> 1
+ddand173 and 1 1111111 -> 1
+ddand174 and 1 111111 -> 1
+ddand175 and 1 11111 -> 1
+ddand176 and 1 1111 -> 1
+ddand177 and 1 111 -> 1
+ddand178 and 1 11 -> 1
+ddand179 and 1 1 -> 1
+
+ddand180 and 0 1111111111 -> 0
+ddand181 and 0 111111111 -> 0
+ddand182 and 0 11111111 -> 0
+ddand183 and 0 1111111 -> 0
+ddand184 and 0 111111 -> 0
+ddand185 and 0 11111 -> 0
+ddand186 and 0 1111 -> 0
+ddand187 and 0 111 -> 0
+ddand188 and 0 11 -> 0
+ddand189 and 0 1 -> 0
+
+ddand090 and 011111111 111111111 -> 11111111
+ddand091 and 101111111 111111111 -> 101111111
+ddand092 and 110111111 111111111 -> 110111111
+ddand093 and 111011111 111111111 -> 111011111
+ddand094 and 111101111 111111111 -> 111101111
+ddand095 and 111110111 111111111 -> 111110111
+ddand096 and 111111011 111111111 -> 111111011
+ddand097 and 111111101 111111111 -> 111111101
+ddand098 and 111111110 111111111 -> 111111110
+
+ddand100 and 111111111 011111111 -> 11111111
+ddand101 and 111111111 101111111 -> 101111111
+ddand102 and 111111111 110111111 -> 110111111
+ddand103 and 111111111 111011111 -> 111011111
+ddand104 and 111111111 111101111 -> 111101111
+ddand105 and 111111111 111110111 -> 111110111
+ddand106 and 111111111 111111011 -> 111111011
+ddand107 and 111111111 111111101 -> 111111101
+ddand108 and 111111111 111111110 -> 111111110
+
+-- non-0/1 should not be accepted, nor should signs
+ddand220 and 111111112 111111111 -> NaN Invalid_operation
+ddand221 and 333333333 333333333 -> NaN Invalid_operation
+ddand222 and 555555555 555555555 -> NaN Invalid_operation
+ddand223 and 777777777 777777777 -> NaN Invalid_operation
+ddand224 and 999999999 999999999 -> NaN Invalid_operation
+ddand225 and 222222222 999999999 -> NaN Invalid_operation
+ddand226 and 444444444 999999999 -> NaN Invalid_operation
+ddand227 and 666666666 999999999 -> NaN Invalid_operation
+ddand228 and 888888888 999999999 -> NaN Invalid_operation
+ddand229 and 999999999 222222222 -> NaN Invalid_operation
+ddand230 and 999999999 444444444 -> NaN Invalid_operation
+ddand231 and 999999999 666666666 -> NaN Invalid_operation
+ddand232 and 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+ddand240 and 567468689 -934981942 -> NaN Invalid_operation
+ddand241 and 567367689 934981942 -> NaN Invalid_operation
+ddand242 and -631917772 -706014634 -> NaN Invalid_operation
+ddand243 and -756253257 138579234 -> NaN Invalid_operation
+ddand244 and 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+ddand250 and 2000000000000000 1000000000000000 -> NaN Invalid_operation
+ddand251 and 7000000000000000 1000000000000000 -> NaN Invalid_operation
+ddand252 and 8000000000000000 1000000000000000 -> NaN Invalid_operation
+ddand253 and 9000000000000000 1000000000000000 -> NaN Invalid_operation
+ddand254 and 2000000000000000 0000000000000000 -> NaN Invalid_operation
+ddand255 and 7000000000000000 0000000000000000 -> NaN Invalid_operation
+ddand256 and 8000000000000000 0000000000000000 -> NaN Invalid_operation
+ddand257 and 9000000000000000 0000000000000000 -> NaN Invalid_operation
+ddand258 and 1000000000000000 2000000000000000 -> NaN Invalid_operation
+ddand259 and 1000000000000000 7000000000000000 -> NaN Invalid_operation
+ddand260 and 1000000000000000 8000000000000000 -> NaN Invalid_operation
+ddand261 and 1000000000000000 9000000000000000 -> NaN Invalid_operation
+ddand262 and 0000000000000000 2000000000000000 -> NaN Invalid_operation
+ddand263 and 0000000000000000 7000000000000000 -> NaN Invalid_operation
+ddand264 and 0000000000000000 8000000000000000 -> NaN Invalid_operation
+ddand265 and 0000000000000000 9000000000000000 -> NaN Invalid_operation
+-- test MSD-1
+ddand270 and 0200001000000000 1000100000000010 -> NaN Invalid_operation
+ddand271 and 0700000100000000 1000010000000100 -> NaN Invalid_operation
+ddand272 and 0800000010000000 1000001000001000 -> NaN Invalid_operation
+ddand273 and 0900000001000000 1000000100010000 -> NaN Invalid_operation
+ddand274 and 1000000000100000 0200000010100000 -> NaN Invalid_operation
+ddand275 and 1000000000010000 0700000001000000 -> NaN Invalid_operation
+ddand276 and 1000000000001000 0800000010100000 -> NaN Invalid_operation
+ddand277 and 1000000000000100 0900000000010000 -> NaN Invalid_operation
+-- test LSD
+ddand280 and 0010000000000002 1000000100000001 -> NaN Invalid_operation
+ddand281 and 0001000000000007 1000001000000011 -> NaN Invalid_operation
+ddand282 and 0000100000000008 1000010000000001 -> NaN Invalid_operation
+ddand283 and 0000010000000009 1000100000000001 -> NaN Invalid_operation
+ddand284 and 1000001000000000 0001000000000002 -> NaN Invalid_operation
+ddand285 and 1000000100000000 0010000000000007 -> NaN Invalid_operation
+ddand286 and 1000000010000000 0100000000000008 -> NaN Invalid_operation
+ddand287 and 1000000001000000 1000000000000009 -> NaN Invalid_operation
+-- test Middie
+ddand288 and 0010000020000000 1000001000000000 -> NaN Invalid_operation
+ddand289 and 0001000070000001 1000000100000000 -> NaN Invalid_operation
+ddand290 and 0000100080000010 1000000010000000 -> NaN Invalid_operation
+ddand291 and 0000010090000100 1000000001000000 -> NaN Invalid_operation
+ddand292 and 1000001000001000 0000000020100000 -> NaN Invalid_operation
+ddand293 and 1000000100010000 0000000070010000 -> NaN Invalid_operation
+ddand294 and 1000000010100000 0000000080001000 -> NaN Invalid_operation
+ddand295 and 1000000001000000 0000000090000100 -> NaN Invalid_operation
+-- signs
+ddand296 and -1000000001000000 -0000010000000100 -> NaN Invalid_operation
+ddand297 and -1000000001000000 0000000010000100 -> NaN Invalid_operation
+ddand298 and 1000000001000000 -0000001000000100 -> NaN Invalid_operation
+ddand299 and 1000000001000000 0000000011000100 -> 1000000
+
+-- Nmax, Nmin, Ntiny-like
+ddand331 and 2 9.99999999E+199 -> NaN Invalid_operation
+ddand332 and 3 1E-199 -> NaN Invalid_operation
+ddand333 and 4 1.00000000E-199 -> NaN Invalid_operation
+ddand334 and 5 1E-100 -> NaN Invalid_operation
+ddand335 and 6 -1E-100 -> NaN Invalid_operation
+ddand336 and 7 -1.00000000E-199 -> NaN Invalid_operation
+ddand337 and 8 -1E-199 -> NaN Invalid_operation
+ddand338 and 9 -9.99999999E+199 -> NaN Invalid_operation
+ddand341 and 9.99999999E+199 -18 -> NaN Invalid_operation
+ddand342 and 1E-199 01 -> NaN Invalid_operation
+ddand343 and 1.00000000E-199 -18 -> NaN Invalid_operation
+ddand344 and 1E-100 18 -> NaN Invalid_operation
+ddand345 and -1E-100 -10 -> NaN Invalid_operation
+ddand346 and -1.00000000E-199 18 -> NaN Invalid_operation
+ddand347 and -1E-199 10 -> NaN Invalid_operation
+ddand348 and -9.99999999E+199 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+ddand361 and 1.0 1 -> NaN Invalid_operation
+ddand362 and 1E+1 1 -> NaN Invalid_operation
+ddand363 and 0.0 1 -> NaN Invalid_operation
+ddand364 and 0E+1 1 -> NaN Invalid_operation
+ddand365 and 9.9 1 -> NaN Invalid_operation
+ddand366 and 9E+1 1 -> NaN Invalid_operation
+ddand371 and 0 1.0 -> NaN Invalid_operation
+ddand372 and 0 1E+1 -> NaN Invalid_operation
+ddand373 and 0 0.0 -> NaN Invalid_operation
+ddand374 and 0 0E+1 -> NaN Invalid_operation
+ddand375 and 0 9.9 -> NaN Invalid_operation
+ddand376 and 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+ddand780 and -Inf -Inf -> NaN Invalid_operation
+ddand781 and -Inf -1000 -> NaN Invalid_operation
+ddand782 and -Inf -1 -> NaN Invalid_operation
+ddand783 and -Inf -0 -> NaN Invalid_operation
+ddand784 and -Inf 0 -> NaN Invalid_operation
+ddand785 and -Inf 1 -> NaN Invalid_operation
+ddand786 and -Inf 1000 -> NaN Invalid_operation
+ddand787 and -1000 -Inf -> NaN Invalid_operation
+ddand788 and -Inf -Inf -> NaN Invalid_operation
+ddand789 and -1 -Inf -> NaN Invalid_operation
+ddand790 and -0 -Inf -> NaN Invalid_operation
+ddand791 and 0 -Inf -> NaN Invalid_operation
+ddand792 and 1 -Inf -> NaN Invalid_operation
+ddand793 and 1000 -Inf -> NaN Invalid_operation
+ddand794 and Inf -Inf -> NaN Invalid_operation
+
+ddand800 and Inf -Inf -> NaN Invalid_operation
+ddand801 and Inf -1000 -> NaN Invalid_operation
+ddand802 and Inf -1 -> NaN Invalid_operation
+ddand803 and Inf -0 -> NaN Invalid_operation
+ddand804 and Inf 0 -> NaN Invalid_operation
+ddand805 and Inf 1 -> NaN Invalid_operation
+ddand806 and Inf 1000 -> NaN Invalid_operation
+ddand807 and Inf Inf -> NaN Invalid_operation
+ddand808 and -1000 Inf -> NaN Invalid_operation
+ddand809 and -Inf Inf -> NaN Invalid_operation
+ddand810 and -1 Inf -> NaN Invalid_operation
+ddand811 and -0 Inf -> NaN Invalid_operation
+ddand812 and 0 Inf -> NaN Invalid_operation
+ddand813 and 1 Inf -> NaN Invalid_operation
+ddand814 and 1000 Inf -> NaN Invalid_operation
+ddand815 and Inf Inf -> NaN Invalid_operation
+
+ddand821 and NaN -Inf -> NaN Invalid_operation
+ddand822 and NaN -1000 -> NaN Invalid_operation
+ddand823 and NaN -1 -> NaN Invalid_operation
+ddand824 and NaN -0 -> NaN Invalid_operation
+ddand825 and NaN 0 -> NaN Invalid_operation
+ddand826 and NaN 1 -> NaN Invalid_operation
+ddand827 and NaN 1000 -> NaN Invalid_operation
+ddand828 and NaN Inf -> NaN Invalid_operation
+ddand829 and NaN NaN -> NaN Invalid_operation
+ddand830 and -Inf NaN -> NaN Invalid_operation
+ddand831 and -1000 NaN -> NaN Invalid_operation
+ddand832 and -1 NaN -> NaN Invalid_operation
+ddand833 and -0 NaN -> NaN Invalid_operation
+ddand834 and 0 NaN -> NaN Invalid_operation
+ddand835 and 1 NaN -> NaN Invalid_operation
+ddand836 and 1000 NaN -> NaN Invalid_operation
+ddand837 and Inf NaN -> NaN Invalid_operation
+
+ddand841 and sNaN -Inf -> NaN Invalid_operation
+ddand842 and sNaN -1000 -> NaN Invalid_operation
+ddand843 and sNaN -1 -> NaN Invalid_operation
+ddand844 and sNaN -0 -> NaN Invalid_operation
+ddand845 and sNaN 0 -> NaN Invalid_operation
+ddand846 and sNaN 1 -> NaN Invalid_operation
+ddand847 and sNaN 1000 -> NaN Invalid_operation
+ddand848 and sNaN NaN -> NaN Invalid_operation
+ddand849 and sNaN sNaN -> NaN Invalid_operation
+ddand850 and NaN sNaN -> NaN Invalid_operation
+ddand851 and -Inf sNaN -> NaN Invalid_operation
+ddand852 and -1000 sNaN -> NaN Invalid_operation
+ddand853 and -1 sNaN -> NaN Invalid_operation
+ddand854 and -0 sNaN -> NaN Invalid_operation
+ddand855 and 0 sNaN -> NaN Invalid_operation
+ddand856 and 1 sNaN -> NaN Invalid_operation
+ddand857 and 1000 sNaN -> NaN Invalid_operation
+ddand858 and Inf sNaN -> NaN Invalid_operation
+ddand859 and NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddand861 and NaN1 -Inf -> NaN Invalid_operation
+ddand862 and +NaN2 -1000 -> NaN Invalid_operation
+ddand863 and NaN3 1000 -> NaN Invalid_operation
+ddand864 and NaN4 Inf -> NaN Invalid_operation
+ddand865 and NaN5 +NaN6 -> NaN Invalid_operation
+ddand866 and -Inf NaN7 -> NaN Invalid_operation
+ddand867 and -1000 NaN8 -> NaN Invalid_operation
+ddand868 and 1000 NaN9 -> NaN Invalid_operation
+ddand869 and Inf +NaN10 -> NaN Invalid_operation
+ddand871 and sNaN11 -Inf -> NaN Invalid_operation
+ddand872 and sNaN12 -1000 -> NaN Invalid_operation
+ddand873 and sNaN13 1000 -> NaN Invalid_operation
+ddand874 and sNaN14 NaN17 -> NaN Invalid_operation
+ddand875 and sNaN15 sNaN18 -> NaN Invalid_operation
+ddand876 and NaN16 sNaN19 -> NaN Invalid_operation
+ddand877 and -Inf +sNaN20 -> NaN Invalid_operation
+ddand878 and -1000 sNaN21 -> NaN Invalid_operation
+ddand879 and 1000 sNaN22 -> NaN Invalid_operation
+ddand880 and Inf sNaN23 -> NaN Invalid_operation
+ddand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
+ddand882 and -NaN26 NaN28 -> NaN Invalid_operation
+ddand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
+ddand884 and 1000 -NaN30 -> NaN Invalid_operation
+ddand885 and 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddBase.decTest b/Lib/test/decimaltestdata/ddBase.decTest
index fbd6ccd94d..40febf86c5 100644
--- a/Lib/test/decimaltestdata/ddBase.decTest
+++ b/Lib/test/decimaltestdata/ddBase.decTest
@@ -1,1104 +1,1104 @@
-------------------------------------------------------------------------
--- ddBase.decTest -- base decDouble <--> string conversions --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests base conversions from string to a decimal number
--- and back to a string (in Scientific form)
-
--- Note that unlike other operations the operand is subject to rounding
--- to conform to emax and precision settings (that is, numbers will
--- conform to rules and exponent will be in permitted range). The
--- 'left hand side', therefore, may have numbers that cannot be
--- represented in a decDouble. Some testcases go to the limit of the
--- next-wider format, and hence these testcases may also be used to
--- test narrowing and widening operations.
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddbas001 toSci 0 -> 0
-ddbas002 toSci 1 -> 1
-ddbas003 toSci 1.0 -> 1.0
-ddbas004 toSci 1.00 -> 1.00
-ddbas005 toSci 10 -> 10
-ddbas006 toSci 1000 -> 1000
-ddbas007 toSci 10.0 -> 10.0
-ddbas008 toSci 10.1 -> 10.1
-ddbas009 toSci 10.4 -> 10.4
-ddbas010 toSci 10.5 -> 10.5
-ddbas011 toSci 10.6 -> 10.6
-ddbas012 toSci 10.9 -> 10.9
-ddbas013 toSci 11.0 -> 11.0
-ddbas014 toSci 1.234 -> 1.234
-ddbas015 toSci 0.123 -> 0.123
-ddbas016 toSci 0.012 -> 0.012
-ddbas017 toSci -0 -> -0
-ddbas018 toSci -0.0 -> -0.0
-ddbas019 toSci -00.00 -> -0.00
-
-ddbas021 toSci -1 -> -1
-ddbas022 toSci -1.0 -> -1.0
-ddbas023 toSci -0.1 -> -0.1
-ddbas024 toSci -9.1 -> -9.1
-ddbas025 toSci -9.11 -> -9.11
-ddbas026 toSci -9.119 -> -9.119
-ddbas027 toSci -9.999 -> -9.999
-
-ddbas030 toSci '123456789.123456' -> '123456789.123456'
-ddbas031 toSci '123456789.000000' -> '123456789.000000'
-ddbas032 toSci '123456789123456' -> '123456789123456'
-ddbas033 toSci '0.0000123456789' -> '0.0000123456789'
-ddbas034 toSci '0.00000123456789' -> '0.00000123456789'
-ddbas035 toSci '0.000000123456789' -> '1.23456789E-7'
-ddbas036 toSci '0.0000000123456789' -> '1.23456789E-8'
-
-ddbas037 toSci '0.123456789012344' -> '0.123456789012344'
-ddbas038 toSci '0.123456789012345' -> '0.123456789012345'
-
--- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
-ddbsn001 toSci -9.999999999999999E+384 -> -9.999999999999999E+384
-ddbsn002 toSci -1E-383 -> -1E-383
-ddbsn003 toSci -1E-398 -> -1E-398 Subnormal
-ddbsn004 toSci -0 -> -0
-ddbsn005 toSci +0 -> 0
-ddbsn006 toSci +1E-398 -> 1E-398 Subnormal
-ddbsn007 toSci +1E-383 -> 1E-383
-ddbsn008 toSci +9.999999999999999E+384 -> 9.999999999999999E+384
-
--- String [many more examples are implicitly tested elsewhere]
--- strings without E cannot generate E in result
-ddbas040 toSci "12" -> '12'
-ddbas041 toSci "-76" -> '-76'
-ddbas042 toSci "12.76" -> '12.76'
-ddbas043 toSci "+12.76" -> '12.76'
-ddbas044 toSci "012.76" -> '12.76'
-ddbas045 toSci "+0.003" -> '0.003'
-ddbas046 toSci "17." -> '17'
-ddbas047 toSci ".5" -> '0.5'
-ddbas048 toSci "044" -> '44'
-ddbas049 toSci "0044" -> '44'
-ddbas050 toSci "0.0005" -> '0.0005'
-ddbas051 toSci "00.00005" -> '0.00005'
-ddbas052 toSci "0.000005" -> '0.000005'
-ddbas053 toSci "0.0000050" -> '0.0000050'
-ddbas054 toSci "0.0000005" -> '5E-7'
-ddbas055 toSci "0.00000005" -> '5E-8'
-ddbas056 toSci "12345678.543210" -> '12345678.543210'
-ddbas057 toSci "2345678.543210" -> '2345678.543210'
-ddbas058 toSci "345678.543210" -> '345678.543210'
-ddbas059 toSci "0345678.54321" -> '345678.54321'
-ddbas060 toSci "345678.5432" -> '345678.5432'
-ddbas061 toSci "+345678.5432" -> '345678.5432'
-ddbas062 toSci "+0345678.5432" -> '345678.5432'
-ddbas063 toSci "+00345678.5432" -> '345678.5432'
-ddbas064 toSci "-345678.5432" -> '-345678.5432'
-ddbas065 toSci "-0345678.5432" -> '-345678.5432'
-ddbas066 toSci "-00345678.5432" -> '-345678.5432'
--- examples
-ddbas067 toSci "5E-6" -> '0.000005'
-ddbas068 toSci "50E-7" -> '0.0000050'
-ddbas069 toSci "5E-7" -> '5E-7'
-
--- [No exotics as no Unicode]
-
--- rounded with dots in all (including edge) places
-ddbas071 toSci .1234567890123456123 -> 0.1234567890123456 Inexact Rounded
-ddbas072 toSci 1.234567890123456123 -> 1.234567890123456 Inexact Rounded
-ddbas073 toSci 12.34567890123456123 -> 12.34567890123456 Inexact Rounded
-ddbas074 toSci 123.4567890123456123 -> 123.4567890123456 Inexact Rounded
-ddbas075 toSci 1234.567890123456123 -> 1234.567890123456 Inexact Rounded
-ddbas076 toSci 12345.67890123456123 -> 12345.67890123456 Inexact Rounded
-ddbas077 toSci 123456.7890123456123 -> 123456.7890123456 Inexact Rounded
-ddbas078 toSci 1234567.890123456123 -> 1234567.890123456 Inexact Rounded
-ddbas079 toSci 12345678.90123456123 -> 12345678.90123456 Inexact Rounded
-ddbas080 toSci 123456789.0123456123 -> 123456789.0123456 Inexact Rounded
-ddbas081 toSci 1234567890.123456123 -> 1234567890.123456 Inexact Rounded
-ddbas082 toSci 12345678901.23456123 -> 12345678901.23456 Inexact Rounded
-ddbas083 toSci 123456789012.3456123 -> 123456789012.3456 Inexact Rounded
-ddbas084 toSci 1234567890123.456123 -> 1234567890123.456 Inexact Rounded
-ddbas085 toSci 12345678901234.56123 -> 12345678901234.56 Inexact Rounded
-ddbas086 toSci 123456789012345.6123 -> 123456789012345.6 Inexact Rounded
-ddbas087 toSci 1234567890123456.123 -> 1234567890123456 Inexact Rounded
-ddbas088 toSci 12345678901234561.23 -> 1.234567890123456E+16 Inexact Rounded
-ddbas089 toSci 123456789012345612.3 -> 1.234567890123456E+17 Inexact Rounded
-ddbas090 toSci 1234567890123456123. -> 1.234567890123456E+18 Inexact Rounded
-
-
--- Numbers with E
-ddbas130 toSci "0.000E-1" -> '0.0000'
-ddbas131 toSci "0.000E-2" -> '0.00000'
-ddbas132 toSci "0.000E-3" -> '0.000000'
-ddbas133 toSci "0.000E-4" -> '0E-7'
-ddbas134 toSci "0.00E-2" -> '0.0000'
-ddbas135 toSci "0.00E-3" -> '0.00000'
-ddbas136 toSci "0.00E-4" -> '0.000000'
-ddbas137 toSci "0.00E-5" -> '0E-7'
-ddbas138 toSci "+0E+9" -> '0E+9'
-ddbas139 toSci "-0E+9" -> '-0E+9'
-ddbas140 toSci "1E+9" -> '1E+9'
-ddbas141 toSci "1e+09" -> '1E+9'
-ddbas142 toSci "1E+90" -> '1E+90'
-ddbas143 toSci "+1E+009" -> '1E+9'
-ddbas144 toSci "0E+9" -> '0E+9'
-ddbas145 toSci "1E+9" -> '1E+9'
-ddbas146 toSci "1E+09" -> '1E+9'
-ddbas147 toSci "1e+90" -> '1E+90'
-ddbas148 toSci "1E+009" -> '1E+9'
-ddbas149 toSci "000E+9" -> '0E+9'
-ddbas150 toSci "1E9" -> '1E+9'
-ddbas151 toSci "1e09" -> '1E+9'
-ddbas152 toSci "1E90" -> '1E+90'
-ddbas153 toSci "1E009" -> '1E+9'
-ddbas154 toSci "0E9" -> '0E+9'
-ddbas155 toSci "0.000e+0" -> '0.000'
-ddbas156 toSci "0.000E-1" -> '0.0000'
-ddbas157 toSci "4E+9" -> '4E+9'
-ddbas158 toSci "44E+9" -> '4.4E+10'
-ddbas159 toSci "0.73e-7" -> '7.3E-8'
-ddbas160 toSci "00E+9" -> '0E+9'
-ddbas161 toSci "00E-9" -> '0E-9'
-ddbas162 toSci "10E+9" -> '1.0E+10'
-ddbas163 toSci "10E+09" -> '1.0E+10'
-ddbas164 toSci "10e+90" -> '1.0E+91'
-ddbas165 toSci "10E+009" -> '1.0E+10'
-ddbas166 toSci "100e+9" -> '1.00E+11'
-ddbas167 toSci "100e+09" -> '1.00E+11'
-ddbas168 toSci "100E+90" -> '1.00E+92'
-ddbas169 toSci "100e+009" -> '1.00E+11'
-
-ddbas170 toSci "1.265" -> '1.265'
-ddbas171 toSci "1.265E-20" -> '1.265E-20'
-ddbas172 toSci "1.265E-8" -> '1.265E-8'
-ddbas173 toSci "1.265E-4" -> '0.0001265'
-ddbas174 toSci "1.265E-3" -> '0.001265'
-ddbas175 toSci "1.265E-2" -> '0.01265'
-ddbas176 toSci "1.265E-1" -> '0.1265'
-ddbas177 toSci "1.265E-0" -> '1.265'
-ddbas178 toSci "1.265E+1" -> '12.65'
-ddbas179 toSci "1.265E+2" -> '126.5'
-ddbas180 toSci "1.265E+3" -> '1265'
-ddbas181 toSci "1.265E+4" -> '1.265E+4'
-ddbas182 toSci "1.265E+8" -> '1.265E+8'
-ddbas183 toSci "1.265E+20" -> '1.265E+20'
-
-ddbas190 toSci "12.65" -> '12.65'
-ddbas191 toSci "12.65E-20" -> '1.265E-19'
-ddbas192 toSci "12.65E-8" -> '1.265E-7'
-ddbas193 toSci "12.65E-4" -> '0.001265'
-ddbas194 toSci "12.65E-3" -> '0.01265'
-ddbas195 toSci "12.65E-2" -> '0.1265'
-ddbas196 toSci "12.65E-1" -> '1.265'
-ddbas197 toSci "12.65E-0" -> '12.65'
-ddbas198 toSci "12.65E+1" -> '126.5'
-ddbas199 toSci "12.65E+2" -> '1265'
-ddbas200 toSci "12.65E+3" -> '1.265E+4'
-ddbas201 toSci "12.65E+4" -> '1.265E+5'
-ddbas202 toSci "12.65E+8" -> '1.265E+9'
-ddbas203 toSci "12.65E+20" -> '1.265E+21'
-
-ddbas210 toSci "126.5" -> '126.5'
-ddbas211 toSci "126.5E-20" -> '1.265E-18'
-ddbas212 toSci "126.5E-8" -> '0.000001265'
-ddbas213 toSci "126.5E-4" -> '0.01265'
-ddbas214 toSci "126.5E-3" -> '0.1265'
-ddbas215 toSci "126.5E-2" -> '1.265'
-ddbas216 toSci "126.5E-1" -> '12.65'
-ddbas217 toSci "126.5E-0" -> '126.5'
-ddbas218 toSci "126.5E+1" -> '1265'
-ddbas219 toSci "126.5E+2" -> '1.265E+4'
-ddbas220 toSci "126.5E+3" -> '1.265E+5'
-ddbas221 toSci "126.5E+4" -> '1.265E+6'
-ddbas222 toSci "126.5E+8" -> '1.265E+10'
-ddbas223 toSci "126.5E+20" -> '1.265E+22'
-
-ddbas230 toSci "1265" -> '1265'
-ddbas231 toSci "1265E-20" -> '1.265E-17'
-ddbas232 toSci "1265E-8" -> '0.00001265'
-ddbas233 toSci "1265E-4" -> '0.1265'
-ddbas234 toSci "1265E-3" -> '1.265'
-ddbas235 toSci "1265E-2" -> '12.65'
-ddbas236 toSci "1265E-1" -> '126.5'
-ddbas237 toSci "1265E-0" -> '1265'
-ddbas238 toSci "1265E+1" -> '1.265E+4'
-ddbas239 toSci "1265E+2" -> '1.265E+5'
-ddbas240 toSci "1265E+3" -> '1.265E+6'
-ddbas241 toSci "1265E+4" -> '1.265E+7'
-ddbas242 toSci "1265E+8" -> '1.265E+11'
-ddbas243 toSci "1265E+20" -> '1.265E+23'
-ddbas244 toSci "1265E-9" -> '0.000001265'
-ddbas245 toSci "1265E-10" -> '1.265E-7'
-ddbas246 toSci "1265E-11" -> '1.265E-8'
-ddbas247 toSci "1265E-12" -> '1.265E-9'
-
-ddbas250 toSci "0.1265" -> '0.1265'
-ddbas251 toSci "0.1265E-20" -> '1.265E-21'
-ddbas252 toSci "0.1265E-8" -> '1.265E-9'
-ddbas253 toSci "0.1265E-4" -> '0.00001265'
-ddbas254 toSci "0.1265E-3" -> '0.0001265'
-ddbas255 toSci "0.1265E-2" -> '0.001265'
-ddbas256 toSci "0.1265E-1" -> '0.01265'
-ddbas257 toSci "0.1265E-0" -> '0.1265'
-ddbas258 toSci "0.1265E+1" -> '1.265'
-ddbas259 toSci "0.1265E+2" -> '12.65'
-ddbas260 toSci "0.1265E+3" -> '126.5'
-ddbas261 toSci "0.1265E+4" -> '1265'
-ddbas262 toSci "0.1265E+8" -> '1.265E+7'
-ddbas263 toSci "0.1265E+20" -> '1.265E+19'
-
--- some more negative zeros [systematic tests below]
-ddbas290 toSci "-0.000E-1" -> '-0.0000'
-ddbas291 toSci "-0.000E-2" -> '-0.00000'
-ddbas292 toSci "-0.000E-3" -> '-0.000000'
-ddbas293 toSci "-0.000E-4" -> '-0E-7'
-ddbas294 toSci "-0.00E-2" -> '-0.0000'
-ddbas295 toSci "-0.00E-3" -> '-0.00000'
-ddbas296 toSci "-0.0E-2" -> '-0.000'
-ddbas297 toSci "-0.0E-3" -> '-0.0000'
-ddbas298 toSci "-0E-2" -> '-0.00'
-ddbas299 toSci "-0E-3" -> '-0.000'
-
--- Engineering notation tests
-ddbas301 toSci 10e12 -> 1.0E+13
-ddbas302 toEng 10e12 -> 10E+12
-ddbas303 toSci 10e11 -> 1.0E+12
-ddbas304 toEng 10e11 -> 1.0E+12
-ddbas305 toSci 10e10 -> 1.0E+11
-ddbas306 toEng 10e10 -> 100E+9
-ddbas307 toSci 10e9 -> 1.0E+10
-ddbas308 toEng 10e9 -> 10E+9
-ddbas309 toSci 10e8 -> 1.0E+9
-ddbas310 toEng 10e8 -> 1.0E+9
-ddbas311 toSci 10e7 -> 1.0E+8
-ddbas312 toEng 10e7 -> 100E+6
-ddbas313 toSci 10e6 -> 1.0E+7
-ddbas314 toEng 10e6 -> 10E+6
-ddbas315 toSci 10e5 -> 1.0E+6
-ddbas316 toEng 10e5 -> 1.0E+6
-ddbas317 toSci 10e4 -> 1.0E+5
-ddbas318 toEng 10e4 -> 100E+3
-ddbas319 toSci 10e3 -> 1.0E+4
-ddbas320 toEng 10e3 -> 10E+3
-ddbas321 toSci 10e2 -> 1.0E+3
-ddbas322 toEng 10e2 -> 1.0E+3
-ddbas323 toSci 10e1 -> 1.0E+2
-ddbas324 toEng 10e1 -> 100
-ddbas325 toSci 10e0 -> 10
-ddbas326 toEng 10e0 -> 10
-ddbas327 toSci 10e-1 -> 1.0
-ddbas328 toEng 10e-1 -> 1.0
-ddbas329 toSci 10e-2 -> 0.10
-ddbas330 toEng 10e-2 -> 0.10
-ddbas331 toSci 10e-3 -> 0.010
-ddbas332 toEng 10e-3 -> 0.010
-ddbas333 toSci 10e-4 -> 0.0010
-ddbas334 toEng 10e-4 -> 0.0010
-ddbas335 toSci 10e-5 -> 0.00010
-ddbas336 toEng 10e-5 -> 0.00010
-ddbas337 toSci 10e-6 -> 0.000010
-ddbas338 toEng 10e-6 -> 0.000010
-ddbas339 toSci 10e-7 -> 0.0000010
-ddbas340 toEng 10e-7 -> 0.0000010
-ddbas341 toSci 10e-8 -> 1.0E-7
-ddbas342 toEng 10e-8 -> 100E-9
-ddbas343 toSci 10e-9 -> 1.0E-8
-ddbas344 toEng 10e-9 -> 10E-9
-ddbas345 toSci 10e-10 -> 1.0E-9
-ddbas346 toEng 10e-10 -> 1.0E-9
-ddbas347 toSci 10e-11 -> 1.0E-10
-ddbas348 toEng 10e-11 -> 100E-12
-ddbas349 toSci 10e-12 -> 1.0E-11
-ddbas350 toEng 10e-12 -> 10E-12
-ddbas351 toSci 10e-13 -> 1.0E-12
-ddbas352 toEng 10e-13 -> 1.0E-12
-
-ddbas361 toSci 7E12 -> 7E+12
-ddbas362 toEng 7E12 -> 7E+12
-ddbas363 toSci 7E11 -> 7E+11
-ddbas364 toEng 7E11 -> 700E+9
-ddbas365 toSci 7E10 -> 7E+10
-ddbas366 toEng 7E10 -> 70E+9
-ddbas367 toSci 7E9 -> 7E+9
-ddbas368 toEng 7E9 -> 7E+9
-ddbas369 toSci 7E8 -> 7E+8
-ddbas370 toEng 7E8 -> 700E+6
-ddbas371 toSci 7E7 -> 7E+7
-ddbas372 toEng 7E7 -> 70E+6
-ddbas373 toSci 7E6 -> 7E+6
-ddbas374 toEng 7E6 -> 7E+6
-ddbas375 toSci 7E5 -> 7E+5
-ddbas376 toEng 7E5 -> 700E+3
-ddbas377 toSci 7E4 -> 7E+4
-ddbas378 toEng 7E4 -> 70E+3
-ddbas379 toSci 7E3 -> 7E+3
-ddbas380 toEng 7E3 -> 7E+3
-ddbas381 toSci 7E2 -> 7E+2
-ddbas382 toEng 7E2 -> 700
-ddbas383 toSci 7E1 -> 7E+1
-ddbas384 toEng 7E1 -> 70
-ddbas385 toSci 7E0 -> 7
-ddbas386 toEng 7E0 -> 7
-ddbas387 toSci 7E-1 -> 0.7
-ddbas388 toEng 7E-1 -> 0.7
-ddbas389 toSci 7E-2 -> 0.07
-ddbas390 toEng 7E-2 -> 0.07
-ddbas391 toSci 7E-3 -> 0.007
-ddbas392 toEng 7E-3 -> 0.007
-ddbas393 toSci 7E-4 -> 0.0007
-ddbas394 toEng 7E-4 -> 0.0007
-ddbas395 toSci 7E-5 -> 0.00007
-ddbas396 toEng 7E-5 -> 0.00007
-ddbas397 toSci 7E-6 -> 0.000007
-ddbas398 toEng 7E-6 -> 0.000007
-ddbas399 toSci 7E-7 -> 7E-7
-ddbas400 toEng 7E-7 -> 700E-9
-ddbas401 toSci 7E-8 -> 7E-8
-ddbas402 toEng 7E-8 -> 70E-9
-ddbas403 toSci 7E-9 -> 7E-9
-ddbas404 toEng 7E-9 -> 7E-9
-ddbas405 toSci 7E-10 -> 7E-10
-ddbas406 toEng 7E-10 -> 700E-12
-ddbas407 toSci 7E-11 -> 7E-11
-ddbas408 toEng 7E-11 -> 70E-12
-ddbas409 toSci 7E-12 -> 7E-12
-ddbas410 toEng 7E-12 -> 7E-12
-ddbas411 toSci 7E-13 -> 7E-13
-ddbas412 toEng 7E-13 -> 700E-15
-
--- Exacts remain exact up to precision ..
-rounding: half_up
-ddbas420 toSci 100 -> 100
-ddbas421 toEng 100 -> 100
-ddbas422 toSci 1000 -> 1000
-ddbas423 toEng 1000 -> 1000
-ddbas424 toSci 999.9 -> 999.9
-ddbas425 toEng 999.9 -> 999.9
-ddbas426 toSci 1000.0 -> 1000.0
-ddbas427 toEng 1000.0 -> 1000.0
-ddbas428 toSci 1000.1 -> 1000.1
-ddbas429 toEng 1000.1 -> 1000.1
-ddbas430 toSci 10000 -> 10000
-ddbas431 toEng 10000 -> 10000
-ddbas432 toSci 100000 -> 100000
-ddbas433 toEng 100000 -> 100000
-ddbas434 toSci 1000000 -> 1000000
-ddbas435 toEng 1000000 -> 1000000
-ddbas436 toSci 10000000 -> 10000000
-ddbas437 toEng 10000000 -> 10000000
-ddbas438 toSci 100000000 -> 100000000
-ddbas439 toEng 1000000000000000 -> 1000000000000000
-ddbas440 toSci 10000000000000000 -> 1.000000000000000E+16 Rounded
-ddbas441 toEng 10000000000000000 -> 10.00000000000000E+15 Rounded
-ddbas442 toSci 10000000000000001 -> 1.000000000000000E+16 Rounded Inexact
-ddbas443 toEng 10000000000000001 -> 10.00000000000000E+15 Rounded Inexact
-ddbas444 toSci 10000000000000003 -> 1.000000000000000E+16 Rounded Inexact
-ddbas445 toEng 10000000000000003 -> 10.00000000000000E+15 Rounded Inexact
-ddbas446 toSci 10000000000000005 -> 1.000000000000001E+16 Rounded Inexact
-ddbas447 toEng 10000000000000005 -> 10.00000000000001E+15 Rounded Inexact
-ddbas448 toSci 100000000000000050 -> 1.000000000000001E+17 Rounded Inexact
-ddbas449 toEng 100000000000000050 -> 100.0000000000001E+15 Rounded Inexact
-ddbas450 toSci 10000000000000009 -> 1.000000000000001E+16 Rounded Inexact
-ddbas451 toEng 10000000000000009 -> 10.00000000000001E+15 Rounded Inexact
-ddbas452 toSci 100000000000000000 -> 1.000000000000000E+17 Rounded
-ddbas453 toEng 100000000000000000 -> 100.0000000000000E+15 Rounded
-ddbas454 toSci 100000000000000003 -> 1.000000000000000E+17 Rounded Inexact
-ddbas455 toEng 100000000000000003 -> 100.0000000000000E+15 Rounded Inexact
-ddbas456 toSci 100000000000000005 -> 1.000000000000000E+17 Rounded Inexact
-ddbas457 toEng 100000000000000005 -> 100.0000000000000E+15 Rounded Inexact
-ddbas458 toSci 100000000000000009 -> 1.000000000000000E+17 Rounded Inexact
-ddbas459 toEng 100000000000000009 -> 100.0000000000000E+15 Rounded Inexact
-ddbas460 toSci 1000000000000000000 -> 1.000000000000000E+18 Rounded
-ddbas461 toEng 1000000000000000000 -> 1.000000000000000E+18 Rounded
-ddbas462 toSci 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact
-ddbas463 toEng 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact
-ddbas464 toSci 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact
-ddbas465 toEng 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact
-ddbas466 toSci 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact
-ddbas467 toEng 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact
-ddbas468 toSci 10000000000000000000 -> 1.000000000000000E+19 Rounded
-ddbas469 toEng 10000000000000000000 -> 10.00000000000000E+18 Rounded
-ddbas470 toSci 10000000000000003000 -> 1.000000000000000E+19 Rounded Inexact
-ddbas471 toEng 10000000000000003000 -> 10.00000000000000E+18 Rounded Inexact
-ddbas472 toSci 10000000000000005000 -> 1.000000000000001E+19 Rounded Inexact
-ddbas473 toEng 10000000000000005000 -> 10.00000000000001E+18 Rounded Inexact
-ddbas474 toSci 10000000000000009000 -> 1.000000000000001E+19 Rounded Inexact
-ddbas475 toEng 10000000000000009000 -> 10.00000000000001E+18 Rounded Inexact
-
--- check rounding modes heeded
-rounding: ceiling
-ddbsr401 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr402 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact
-ddbsr403 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
-ddbsr404 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
-rounding: up
-ddbsr405 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr406 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact
-ddbsr407 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
-ddbsr408 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
-rounding: floor
-ddbsr410 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr411 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr412 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
-ddbsr413 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact
-rounding: half_down
-ddbsr415 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr416 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr417 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
-ddbsr418 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact
-ddbsr419 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
-rounding: half_even
-ddbsr421 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr422 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr423 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
-ddbsr424 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact
-ddbsr425 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
-rounding: down
-ddbsr426 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr427 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr428 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
-ddbsr429 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact
-rounding: half_up
-ddbsr431 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
-ddbsr432 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
-ddbsr433 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
-ddbsr434 toSci 1.11111111111234650 -> 1.111111111112347 Rounded Inexact
-ddbsr435 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
--- negatives
-rounding: ceiling
-ddbsr501 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr502 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr503 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
-ddbsr504 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact
-rounding: up
-ddbsr505 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr506 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact
-ddbsr507 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
-ddbsr508 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-rounding: floor
-ddbsr510 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr511 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact
-ddbsr512 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
-ddbsr513 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-rounding: half_down
-ddbsr515 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr516 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr517 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
-ddbsr518 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact
-ddbsr519 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-rounding: half_even
-ddbsr521 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr522 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr523 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
-ddbsr524 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact
-ddbsr525 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-rounding: down
-ddbsr526 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr527 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr528 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
-ddbsr529 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact
-rounding: half_up
-ddbsr531 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
-ddbsr532 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
-ddbsr533 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
-ddbsr534 toSci -1.11111111111234650 -> -1.111111111112347 Rounded Inexact
-ddbsr535 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
-
-rounding: half_even
-
--- The 'baddies' tests from DiagBigDecimal, plus some new ones
-ddbas500 toSci '1..2' -> NaN Conversion_syntax
-ddbas501 toSci '.' -> NaN Conversion_syntax
-ddbas502 toSci '..' -> NaN Conversion_syntax
-ddbas503 toSci '++1' -> NaN Conversion_syntax
-ddbas504 toSci '--1' -> NaN Conversion_syntax
-ddbas505 toSci '-+1' -> NaN Conversion_syntax
-ddbas506 toSci '+-1' -> NaN Conversion_syntax
-ddbas507 toSci '12e' -> NaN Conversion_syntax
-ddbas508 toSci '12e++' -> NaN Conversion_syntax
-ddbas509 toSci '12f4' -> NaN Conversion_syntax
-ddbas510 toSci ' +1' -> NaN Conversion_syntax
-ddbas511 toSci '+ 1' -> NaN Conversion_syntax
-ddbas512 toSci '12 ' -> NaN Conversion_syntax
-ddbas513 toSci ' + 1' -> NaN Conversion_syntax
-ddbas514 toSci ' - 1 ' -> NaN Conversion_syntax
-ddbas515 toSci 'x' -> NaN Conversion_syntax
-ddbas516 toSci '-1-' -> NaN Conversion_syntax
-ddbas517 toSci '12-' -> NaN Conversion_syntax
-ddbas518 toSci '3+' -> NaN Conversion_syntax
-ddbas519 toSci '' -> NaN Conversion_syntax
-ddbas520 toSci '1e-' -> NaN Conversion_syntax
-ddbas521 toSci '7e99999a' -> NaN Conversion_syntax
-ddbas522 toSci '7e123567890x' -> NaN Conversion_syntax
-ddbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
-ddbas524 toSci '' -> NaN Conversion_syntax
-ddbas525 toSci 'e100' -> NaN Conversion_syntax
-ddbas526 toSci '\u0e5a' -> NaN Conversion_syntax
-ddbas527 toSci '\u0b65' -> NaN Conversion_syntax
-ddbas528 toSci '123,65' -> NaN Conversion_syntax
-ddbas529 toSci '1.34.5' -> NaN Conversion_syntax
-ddbas530 toSci '.123.5' -> NaN Conversion_syntax
-ddbas531 toSci '01.35.' -> NaN Conversion_syntax
-ddbas532 toSci '01.35-' -> NaN Conversion_syntax
-ddbas533 toSci '0000..' -> NaN Conversion_syntax
-ddbas534 toSci '.0000.' -> NaN Conversion_syntax
-ddbas535 toSci '00..00' -> NaN Conversion_syntax
-ddbas536 toSci '111e*123' -> NaN Conversion_syntax
-ddbas537 toSci '111e123-' -> NaN Conversion_syntax
-ddbas538 toSci '111e+12+' -> NaN Conversion_syntax
-ddbas539 toSci '111e1-3-' -> NaN Conversion_syntax
-ddbas540 toSci '111e1*23' -> NaN Conversion_syntax
-ddbas541 toSci '111e1e+3' -> NaN Conversion_syntax
-ddbas542 toSci '1e1.0' -> NaN Conversion_syntax
-ddbas543 toSci '1e123e' -> NaN Conversion_syntax
-ddbas544 toSci 'ten' -> NaN Conversion_syntax
-ddbas545 toSci 'ONE' -> NaN Conversion_syntax
-ddbas546 toSci '1e.1' -> NaN Conversion_syntax
-ddbas547 toSci '1e1.' -> NaN Conversion_syntax
-ddbas548 toSci '1ee' -> NaN Conversion_syntax
-ddbas549 toSci 'e+1' -> NaN Conversion_syntax
-ddbas550 toSci '1.23.4' -> NaN Conversion_syntax
-ddbas551 toSci '1.2.1' -> NaN Conversion_syntax
-ddbas552 toSci '1E+1.2' -> NaN Conversion_syntax
-ddbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
-ddbas554 toSci '1E++1' -> NaN Conversion_syntax
-ddbas555 toSci '1E--1' -> NaN Conversion_syntax
-ddbas556 toSci '1E+-1' -> NaN Conversion_syntax
-ddbas557 toSci '1E-+1' -> NaN Conversion_syntax
-ddbas558 toSci '1E''1' -> NaN Conversion_syntax
-ddbas559 toSci "1E""1" -> NaN Conversion_syntax
-ddbas560 toSci "1E""""" -> NaN Conversion_syntax
--- Near-specials
-ddbas561 toSci "qNaN" -> NaN Conversion_syntax
-ddbas562 toSci "NaNq" -> NaN Conversion_syntax
-ddbas563 toSci "NaNs" -> NaN Conversion_syntax
-ddbas564 toSci "Infi" -> NaN Conversion_syntax
-ddbas565 toSci "Infin" -> NaN Conversion_syntax
-ddbas566 toSci "Infini" -> NaN Conversion_syntax
-ddbas567 toSci "Infinit" -> NaN Conversion_syntax
-ddbas568 toSci "-Infinit" -> NaN Conversion_syntax
-ddbas569 toSci "0Inf" -> NaN Conversion_syntax
-ddbas570 toSci "9Inf" -> NaN Conversion_syntax
-ddbas571 toSci "-0Inf" -> NaN Conversion_syntax
-ddbas572 toSci "-9Inf" -> NaN Conversion_syntax
-ddbas573 toSci "-sNa" -> NaN Conversion_syntax
-ddbas574 toSci "xNaN" -> NaN Conversion_syntax
-ddbas575 toSci "0sNaN" -> NaN Conversion_syntax
-
--- some baddies with dots and Es and dots and specials
-ddbas576 toSci 'e+1' -> NaN Conversion_syntax
-ddbas577 toSci '.e+1' -> NaN Conversion_syntax
-ddbas578 toSci '+.e+1' -> NaN Conversion_syntax
-ddbas579 toSci '-.e+' -> NaN Conversion_syntax
-ddbas580 toSci '-.e' -> NaN Conversion_syntax
-ddbas581 toSci 'E+1' -> NaN Conversion_syntax
-ddbas582 toSci '.E+1' -> NaN Conversion_syntax
-ddbas583 toSci '+.E+1' -> NaN Conversion_syntax
-ddbas584 toSci '-.E+' -> NaN Conversion_syntax
-ddbas585 toSci '-.E' -> NaN Conversion_syntax
-
-ddbas586 toSci '.NaN' -> NaN Conversion_syntax
-ddbas587 toSci '-.NaN' -> NaN Conversion_syntax
-ddbas588 toSci '+.sNaN' -> NaN Conversion_syntax
-ddbas589 toSci '+.Inf' -> NaN Conversion_syntax
-ddbas590 toSci '.Infinity' -> NaN Conversion_syntax
-
--- Zeros
-ddbas601 toSci 0.000000000 -> 0E-9
-ddbas602 toSci 0.00000000 -> 0E-8
-ddbas603 toSci 0.0000000 -> 0E-7
-ddbas604 toSci 0.000000 -> 0.000000
-ddbas605 toSci 0.00000 -> 0.00000
-ddbas606 toSci 0.0000 -> 0.0000
-ddbas607 toSci 0.000 -> 0.000
-ddbas608 toSci 0.00 -> 0.00
-ddbas609 toSci 0.0 -> 0.0
-ddbas610 toSci .0 -> 0.0
-ddbas611 toSci 0. -> 0
-ddbas612 toSci -.0 -> -0.0
-ddbas613 toSci -0. -> -0
-ddbas614 toSci -0.0 -> -0.0
-ddbas615 toSci -0.00 -> -0.00
-ddbas616 toSci -0.000 -> -0.000
-ddbas617 toSci -0.0000 -> -0.0000
-ddbas618 toSci -0.00000 -> -0.00000
-ddbas619 toSci -0.000000 -> -0.000000
-ddbas620 toSci -0.0000000 -> -0E-7
-ddbas621 toSci -0.00000000 -> -0E-8
-ddbas622 toSci -0.000000000 -> -0E-9
-
-ddbas630 toSci 0.00E+0 -> 0.00
-ddbas631 toSci 0.00E+1 -> 0.0
-ddbas632 toSci 0.00E+2 -> 0
-ddbas633 toSci 0.00E+3 -> 0E+1
-ddbas634 toSci 0.00E+4 -> 0E+2
-ddbas635 toSci 0.00E+5 -> 0E+3
-ddbas636 toSci 0.00E+6 -> 0E+4
-ddbas637 toSci 0.00E+7 -> 0E+5
-ddbas638 toSci 0.00E+8 -> 0E+6
-ddbas639 toSci 0.00E+9 -> 0E+7
-
-ddbas640 toSci 0.0E+0 -> 0.0
-ddbas641 toSci 0.0E+1 -> 0
-ddbas642 toSci 0.0E+2 -> 0E+1
-ddbas643 toSci 0.0E+3 -> 0E+2
-ddbas644 toSci 0.0E+4 -> 0E+3
-ddbas645 toSci 0.0E+5 -> 0E+4
-ddbas646 toSci 0.0E+6 -> 0E+5
-ddbas647 toSci 0.0E+7 -> 0E+6
-ddbas648 toSci 0.0E+8 -> 0E+7
-ddbas649 toSci 0.0E+9 -> 0E+8
-
-ddbas650 toSci 0E+0 -> 0
-ddbas651 toSci 0E+1 -> 0E+1
-ddbas652 toSci 0E+2 -> 0E+2
-ddbas653 toSci 0E+3 -> 0E+3
-ddbas654 toSci 0E+4 -> 0E+4
-ddbas655 toSci 0E+5 -> 0E+5
-ddbas656 toSci 0E+6 -> 0E+6
-ddbas657 toSci 0E+7 -> 0E+7
-ddbas658 toSci 0E+8 -> 0E+8
-ddbas659 toSci 0E+9 -> 0E+9
-
-ddbas660 toSci 0.0E-0 -> 0.0
-ddbas661 toSci 0.0E-1 -> 0.00
-ddbas662 toSci 0.0E-2 -> 0.000
-ddbas663 toSci 0.0E-3 -> 0.0000
-ddbas664 toSci 0.0E-4 -> 0.00000
-ddbas665 toSci 0.0E-5 -> 0.000000
-ddbas666 toSci 0.0E-6 -> 0E-7
-ddbas667 toSci 0.0E-7 -> 0E-8
-ddbas668 toSci 0.0E-8 -> 0E-9
-ddbas669 toSci 0.0E-9 -> 0E-10
-
-ddbas670 toSci 0.00E-0 -> 0.00
-ddbas671 toSci 0.00E-1 -> 0.000
-ddbas672 toSci 0.00E-2 -> 0.0000
-ddbas673 toSci 0.00E-3 -> 0.00000
-ddbas674 toSci 0.00E-4 -> 0.000000
-ddbas675 toSci 0.00E-5 -> 0E-7
-ddbas676 toSci 0.00E-6 -> 0E-8
-ddbas677 toSci 0.00E-7 -> 0E-9
-ddbas678 toSci 0.00E-8 -> 0E-10
-ddbas679 toSci 0.00E-9 -> 0E-11
-
-ddbas680 toSci 000000. -> 0
-ddbas681 toSci 00000. -> 0
-ddbas682 toSci 0000. -> 0
-ddbas683 toSci 000. -> 0
-ddbas684 toSci 00. -> 0
-ddbas685 toSci 0. -> 0
-ddbas686 toSci +00000. -> 0
-ddbas687 toSci -00000. -> -0
-ddbas688 toSci +0. -> 0
-ddbas689 toSci -0. -> -0
-
--- Specials
-ddbas700 toSci "NaN" -> NaN
-ddbas701 toSci "nan" -> NaN
-ddbas702 toSci "nAn" -> NaN
-ddbas703 toSci "NAN" -> NaN
-ddbas704 toSci "+NaN" -> NaN
-ddbas705 toSci "+nan" -> NaN
-ddbas706 toSci "+nAn" -> NaN
-ddbas707 toSci "+NAN" -> NaN
-ddbas708 toSci "-NaN" -> -NaN
-ddbas709 toSci "-nan" -> -NaN
-ddbas710 toSci "-nAn" -> -NaN
-ddbas711 toSci "-NAN" -> -NaN
-ddbas712 toSci 'NaN0' -> NaN
-ddbas713 toSci 'NaN1' -> NaN1
-ddbas714 toSci 'NaN12' -> NaN12
-ddbas715 toSci 'NaN123' -> NaN123
-ddbas716 toSci 'NaN1234' -> NaN1234
-ddbas717 toSci 'NaN01' -> NaN1
-ddbas718 toSci 'NaN012' -> NaN12
-ddbas719 toSci 'NaN0123' -> NaN123
-ddbas720 toSci 'NaN01234' -> NaN1234
-ddbas721 toSci 'NaN001' -> NaN1
-ddbas722 toSci 'NaN0012' -> NaN12
-ddbas723 toSci 'NaN00123' -> NaN123
-ddbas724 toSci 'NaN001234' -> NaN1234
-ddbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax
-ddbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
-ddbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
-ddbas728 toSci 'NaN-12' -> NaN Conversion_syntax
-ddbas729 toSci 'NaN+12' -> NaN Conversion_syntax
-
-ddbas730 toSci "sNaN" -> sNaN
-ddbas731 toSci "snan" -> sNaN
-ddbas732 toSci "SnAn" -> sNaN
-ddbas733 toSci "SNAN" -> sNaN
-ddbas734 toSci "+sNaN" -> sNaN
-ddbas735 toSci "+snan" -> sNaN
-ddbas736 toSci "+SnAn" -> sNaN
-ddbas737 toSci "+SNAN" -> sNaN
-ddbas738 toSci "-sNaN" -> -sNaN
-ddbas739 toSci "-snan" -> -sNaN
-ddbas740 toSci "-SnAn" -> -sNaN
-ddbas741 toSci "-SNAN" -> -sNaN
-ddbas742 toSci 'sNaN0000' -> sNaN
-ddbas743 toSci 'sNaN7' -> sNaN7
-ddbas744 toSci 'sNaN007234' -> sNaN7234
-ddbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax
-ddbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
-ddbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
-
-ddbas748 toSci "Inf" -> Infinity
-ddbas749 toSci "inf" -> Infinity
-ddbas750 toSci "iNf" -> Infinity
-ddbas751 toSci "INF" -> Infinity
-ddbas752 toSci "+Inf" -> Infinity
-ddbas753 toSci "+inf" -> Infinity
-ddbas754 toSci "+iNf" -> Infinity
-ddbas755 toSci "+INF" -> Infinity
-ddbas756 toSci "-Inf" -> -Infinity
-ddbas757 toSci "-inf" -> -Infinity
-ddbas758 toSci "-iNf" -> -Infinity
-ddbas759 toSci "-INF" -> -Infinity
-
-ddbas760 toSci "Infinity" -> Infinity
-ddbas761 toSci "infinity" -> Infinity
-ddbas762 toSci "iNfInItY" -> Infinity
-ddbas763 toSci "INFINITY" -> Infinity
-ddbas764 toSci "+Infinity" -> Infinity
-ddbas765 toSci "+infinity" -> Infinity
-ddbas766 toSci "+iNfInItY" -> Infinity
-ddbas767 toSci "+INFINITY" -> Infinity
-ddbas768 toSci "-Infinity" -> -Infinity
-ddbas769 toSci "-infinity" -> -Infinity
-ddbas770 toSci "-iNfInItY" -> -Infinity
-ddbas771 toSci "-INFINITY" -> -Infinity
-
--- Specials and zeros for toEng
-ddbast772 toEng "NaN" -> NaN
-ddbast773 toEng "-Infinity" -> -Infinity
-ddbast774 toEng "-sNaN" -> -sNaN
-ddbast775 toEng "-NaN" -> -NaN
-ddbast776 toEng "+Infinity" -> Infinity
-ddbast778 toEng "+sNaN" -> sNaN
-ddbast779 toEng "+NaN" -> NaN
-ddbast780 toEng "INFINITY" -> Infinity
-ddbast781 toEng "SNAN" -> sNaN
-ddbast782 toEng "NAN" -> NaN
-ddbast783 toEng "infinity" -> Infinity
-ddbast784 toEng "snan" -> sNaN
-ddbast785 toEng "nan" -> NaN
-ddbast786 toEng "InFINITY" -> Infinity
-ddbast787 toEng "SnAN" -> sNaN
-ddbast788 toEng "nAN" -> NaN
-ddbast789 toEng "iNfinity" -> Infinity
-ddbast790 toEng "sNan" -> sNaN
-ddbast791 toEng "Nan" -> NaN
-ddbast792 toEng "Infinity" -> Infinity
-ddbast793 toEng "sNaN" -> sNaN
-
--- Zero toEng, etc.
-ddbast800 toEng 0e+1 -> "0.00E+3" -- doc example
-
-ddbast801 toEng 0.000000000 -> 0E-9
-ddbast802 toEng 0.00000000 -> 0.00E-6
-ddbast803 toEng 0.0000000 -> 0.0E-6
-ddbast804 toEng 0.000000 -> 0.000000
-ddbast805 toEng 0.00000 -> 0.00000
-ddbast806 toEng 0.0000 -> 0.0000
-ddbast807 toEng 0.000 -> 0.000
-ddbast808 toEng 0.00 -> 0.00
-ddbast809 toEng 0.0 -> 0.0
-ddbast810 toEng .0 -> 0.0
-ddbast811 toEng 0. -> 0
-ddbast812 toEng -.0 -> -0.0
-ddbast813 toEng -0. -> -0
-ddbast814 toEng -0.0 -> -0.0
-ddbast815 toEng -0.00 -> -0.00
-ddbast816 toEng -0.000 -> -0.000
-ddbast817 toEng -0.0000 -> -0.0000
-ddbast818 toEng -0.00000 -> -0.00000
-ddbast819 toEng -0.000000 -> -0.000000
-ddbast820 toEng -0.0000000 -> -0.0E-6
-ddbast821 toEng -0.00000000 -> -0.00E-6
-ddbast822 toEng -0.000000000 -> -0E-9
-
-ddbast830 toEng 0.00E+0 -> 0.00
-ddbast831 toEng 0.00E+1 -> 0.0
-ddbast832 toEng 0.00E+2 -> 0
-ddbast833 toEng 0.00E+3 -> 0.00E+3
-ddbast834 toEng 0.00E+4 -> 0.0E+3
-ddbast835 toEng 0.00E+5 -> 0E+3
-ddbast836 toEng 0.00E+6 -> 0.00E+6
-ddbast837 toEng 0.00E+7 -> 0.0E+6
-ddbast838 toEng 0.00E+8 -> 0E+6
-ddbast839 toEng 0.00E+9 -> 0.00E+9
-
-ddbast840 toEng 0.0E+0 -> 0.0
-ddbast841 toEng 0.0E+1 -> 0
-ddbast842 toEng 0.0E+2 -> 0.00E+3
-ddbast843 toEng 0.0E+3 -> 0.0E+3
-ddbast844 toEng 0.0E+4 -> 0E+3
-ddbast845 toEng 0.0E+5 -> 0.00E+6
-ddbast846 toEng 0.0E+6 -> 0.0E+6
-ddbast847 toEng 0.0E+7 -> 0E+6
-ddbast848 toEng 0.0E+8 -> 0.00E+9
-ddbast849 toEng 0.0E+9 -> 0.0E+9
-
-ddbast850 toEng 0E+0 -> 0
-ddbast851 toEng 0E+1 -> 0.00E+3
-ddbast852 toEng 0E+2 -> 0.0E+3
-ddbast853 toEng 0E+3 -> 0E+3
-ddbast854 toEng 0E+4 -> 0.00E+6
-ddbast855 toEng 0E+5 -> 0.0E+6
-ddbast856 toEng 0E+6 -> 0E+6
-ddbast857 toEng 0E+7 -> 0.00E+9
-ddbast858 toEng 0E+8 -> 0.0E+9
-ddbast859 toEng 0E+9 -> 0E+9
-
-ddbast860 toEng 0.0E-0 -> 0.0
-ddbast861 toEng 0.0E-1 -> 0.00
-ddbast862 toEng 0.0E-2 -> 0.000
-ddbast863 toEng 0.0E-3 -> 0.0000
-ddbast864 toEng 0.0E-4 -> 0.00000
-ddbast865 toEng 0.0E-5 -> 0.000000
-ddbast866 toEng 0.0E-6 -> 0.0E-6
-ddbast867 toEng 0.0E-7 -> 0.00E-6
-ddbast868 toEng 0.0E-8 -> 0E-9
-ddbast869 toEng 0.0E-9 -> 0.0E-9
-
-ddbast870 toEng 0.00E-0 -> 0.00
-ddbast871 toEng 0.00E-1 -> 0.000
-ddbast872 toEng 0.00E-2 -> 0.0000
-ddbast873 toEng 0.00E-3 -> 0.00000
-ddbast874 toEng 0.00E-4 -> 0.000000
-ddbast875 toEng 0.00E-5 -> 0.0E-6
-ddbast876 toEng 0.00E-6 -> 0.00E-6
-ddbast877 toEng 0.00E-7 -> 0E-9
-ddbast878 toEng 0.00E-8 -> 0.0E-9
-ddbast879 toEng 0.00E-9 -> 0.00E-9
-
--- long input strings
-ddbas801 tosci '01234567890123456' -> 1234567890123456
-ddbas802 tosci '001234567890123456' -> 1234567890123456
-ddbas803 tosci '0001234567890123456' -> 1234567890123456
-ddbas804 tosci '00001234567890123456' -> 1234567890123456
-ddbas805 tosci '000001234567890123456' -> 1234567890123456
-ddbas806 tosci '0000001234567890123456' -> 1234567890123456
-ddbas807 tosci '00000001234567890123456' -> 1234567890123456
-ddbas808 tosci '000000001234567890123456' -> 1234567890123456
-ddbas809 tosci '0000000001234567890123456' -> 1234567890123456
-ddbas810 tosci '00000000001234567890123456' -> 1234567890123456
-
-ddbas811 tosci '0.1234567890123456' -> 0.1234567890123456
-ddbas812 tosci '0.01234567890123456' -> 0.01234567890123456
-ddbas813 tosci '0.001234567890123456' -> 0.001234567890123456
-ddbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456
-ddbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456
-ddbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456
-ddbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7
-ddbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8
-ddbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9
-ddbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10
-
-ddbas821 tosci '12345678901234567890' -> 1.234567890123457E+19 Inexact Rounded
-ddbas822 tosci '123456789012345678901' -> 1.234567890123457E+20 Inexact Rounded
-ddbas823 tosci '1234567890123456789012' -> 1.234567890123457E+21 Inexact Rounded
-ddbas824 tosci '12345678901234567890123' -> 1.234567890123457E+22 Inexact Rounded
-ddbas825 tosci '123456789012345678901234' -> 1.234567890123457E+23 Inexact Rounded
-ddbas826 tosci '1234567890123456789012345' -> 1.234567890123457E+24 Inexact Rounded
-ddbas827 tosci '12345678901234567890123456' -> 1.234567890123457E+25 Inexact Rounded
-ddbas828 tosci '123456789012345678901234567' -> 1.234567890123457E+26 Inexact Rounded
-ddbas829 tosci '1234567890123456789012345678' -> 1.234567890123457E+27 Inexact Rounded
-
--- subnormals and overflows
-ddbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
-ddbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
-ddbas908 toSci '0.9e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas909 toSci '0.09e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
-ddbas911 toSci '10e-1000000000' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
-ddbas913 toSci '99e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
-ddbas915 toSci '1111e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas916 toSci '1111e-99999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
--- negatives the same
-ddbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
-ddbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
-ddbas920 toSci '-0.9e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas921 toSci '-0.09e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
-ddbas923 toSci '-10e-1000000000' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
-ddbas925 toSci '-99e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
-ddbas927 toSci '-1111e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas928 toSci '-1111e-99999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
-
--- overflow results at different rounding modes
-rounding: ceiling
-ddbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas931 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded
-rounding: up
-ddbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: down
-ddbas934 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddbas935 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded
-rounding: floor
-ddbas936 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded
-ddbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_up
-ddbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_even
-ddbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_down
-ddbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-ddbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_even
-
--- Now check 854/754r some subnormals and underflow to 0
-ddbem400 toSci 1.0000E-383 -> 1.0000E-383
-ddbem401 toSci 0.1E-394 -> 1E-395 Subnormal
-ddbem402 toSci 0.1000E-394 -> 1.000E-395 Subnormal
-ddbem403 toSci 0.0100E-394 -> 1.00E-396 Subnormal
-ddbem404 toSci 0.0010E-394 -> 1.0E-397 Subnormal
-ddbem405 toSci 0.0001E-394 -> 1E-398 Subnormal
-ddbem406 toSci 0.00010E-394 -> 1E-398 Subnormal Rounded
-ddbem407 toSci 0.00013E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddbem408 toSci 0.00015E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem409 toSci 0.00017E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem410 toSci 0.00023E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem411 toSci 0.00025E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem412 toSci 0.00027E-394 -> 3E-398 Underflow Subnormal Inexact Rounded
-ddbem413 toSci 0.000149E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddbem414 toSci 0.000150E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem415 toSci 0.000151E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem416 toSci 0.000249E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem417 toSci 0.000250E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddbem418 toSci 0.000251E-394 -> 3E-398 Underflow Subnormal Inexact Rounded
-ddbem419 toSci 0.00009E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddbem420 toSci 0.00005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem421 toSci 0.00003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem422 toSci 0.000009E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem423 toSci 0.000005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem424 toSci 0.000003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-ddbem425 toSci 0.001049E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
-ddbem426 toSci 0.001050E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
-ddbem427 toSci 0.001051E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded
-ddbem428 toSci 0.001149E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded
-ddbem429 toSci 0.001150E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded
-ddbem430 toSci 0.001151E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded
-
-ddbem432 toSci 0.010049E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
-ddbem433 toSci 0.010050E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
-ddbem434 toSci 0.010051E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded
-ddbem435 toSci 0.010149E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded
-ddbem436 toSci 0.010150E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded
-ddbem437 toSci 0.010151E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded
-
-ddbem440 toSci 0.10103E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded
-ddbem441 toSci 0.10105E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded
-ddbem442 toSci 0.10107E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded
-ddbem443 toSci 0.10113E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded
-ddbem444 toSci 0.10115E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded
-ddbem445 toSci 0.10117E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded
-
-ddbem450 toSci 1.10730E-395 -> 1.107E-395 Underflow Subnormal Inexact Rounded
-ddbem451 toSci 1.10750E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
-ddbem452 toSci 1.10770E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
-ddbem453 toSci 1.10830E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
-ddbem454 toSci 1.10850E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
-ddbem455 toSci 1.10870E-395 -> 1.109E-395 Underflow Subnormal Inexact Rounded
-
--- make sure sign OK
-ddbem456 toSci -0.10103E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded
-ddbem457 toSci -0.10105E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded
-ddbem458 toSci -0.10107E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded
-ddbem459 toSci -0.10113E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded
-ddbem460 toSci -0.10115E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded
-ddbem461 toSci -0.10117E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded
-
--- '999s' cases
-ddbem464 toSci 999999E-395 -> 9.99999E-390 Subnormal
-ddbem465 toSci 99999.0E-394 -> 9.99990E-390 Subnormal
-ddbem466 toSci 99999.E-394 -> 9.9999E-390 Subnormal
-ddbem467 toSci 9999.9E-394 -> 9.9999E-391 Subnormal
-ddbem468 toSci 999.99E-394 -> 9.9999E-392 Subnormal
-ddbem469 toSci 99.999E-394 -> 9.9999E-393 Subnormal
-ddbem470 toSci 9.9999E-394 -> 9.9999E-394 Subnormal
-ddbem471 toSci 0.99999E-394 -> 1.0000E-394 Underflow Subnormal Inexact Rounded
-ddbem472 toSci 0.099999E-394 -> 1.000E-395 Underflow Subnormal Inexact Rounded
-ddbem473 toSci 0.0099999E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
-ddbem474 toSci 0.00099999E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
-ddbem475 toSci 0.000099999E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddbem476 toSci 0.0000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem477 toSci 0.00000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbem478 toSci 0.000000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- Exponents with insignificant leading zeros
-ddbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
-ddbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
-ddbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
-ddbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
-ddbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
-ddbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
-ddbas1007 toSci 1e-999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1008 toSci 1e-0999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1009 toSci 1e-00999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1010 toSci 1e-000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1011 toSci 1e-000000000000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddbas1012 toSci 1e-000000000001000000007 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- check for double-rounded subnormals
-ddbas1041 toSci 1.1111111111152444E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
-ddbas1042 toSci 1.1111111111152445E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
-ddbas1043 toSci 1.1111111111152446E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
-
--- clamped large normals
-ddbas1070 toSci 1E+369 -> 1E+369
-ddbas1071 toSci 1E+370 -> 1.0E+370 Clamped
-ddbas1072 toSci 1E+378 -> 1.000000000E+378 Clamped
-ddbas1073 toSci 1E+384 -> 1.000000000000000E+384 Clamped
-ddbas1074 toSci 1E+385 -> Infinity Overflow Inexact Rounded
-
-
--- clamped zeros [see also clamp.decTest]
-ddbas1075 toSci 0e+10000 -> 0E+369 Clamped
-ddbas1076 toSci 0e-10000 -> 0E-398 Clamped
-ddbas1077 toSci -0e+10000 -> -0E+369 Clamped
-ddbas1078 toSci -0e-10000 -> -0E-398 Clamped
-
--- extreme values from next-wider
-ddbas1101 toSci -9.99999999999999999999999999999999E+6144 -> -Infinity Overflow Inexact Rounded
-ddbas1102 toSci -1E-6143 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped
-ddbas1103 toSci -1E-6176 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped
-ddbas1104 toSci -0 -> -0
-ddbas1105 toSci +0 -> 0
-ddbas1106 toSci +1E-6176 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped
-ddbas1107 toSci +1E-6173 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped
-ddbas1108 toSci +9.99999999999999999999999999999999E+6144 -> Infinity Overflow Inexact Rounded
-
+------------------------------------------------------------------------
+-- ddBase.decTest -- base decDouble <--> string conversions --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests base conversions from string to a decimal number
+-- and back to a string (in Scientific form)
+
+-- Note that unlike other operations the operand is subject to rounding
+-- to conform to emax and precision settings (that is, numbers will
+-- conform to rules and exponent will be in permitted range). The
+-- 'left hand side', therefore, may have numbers that cannot be
+-- represented in a decDouble. Some testcases go to the limit of the
+-- next-wider format, and hence these testcases may also be used to
+-- test narrowing and widening operations.
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddbas001 toSci 0 -> 0
+ddbas002 toSci 1 -> 1
+ddbas003 toSci 1.0 -> 1.0
+ddbas004 toSci 1.00 -> 1.00
+ddbas005 toSci 10 -> 10
+ddbas006 toSci 1000 -> 1000
+ddbas007 toSci 10.0 -> 10.0
+ddbas008 toSci 10.1 -> 10.1
+ddbas009 toSci 10.4 -> 10.4
+ddbas010 toSci 10.5 -> 10.5
+ddbas011 toSci 10.6 -> 10.6
+ddbas012 toSci 10.9 -> 10.9
+ddbas013 toSci 11.0 -> 11.0
+ddbas014 toSci 1.234 -> 1.234
+ddbas015 toSci 0.123 -> 0.123
+ddbas016 toSci 0.012 -> 0.012
+ddbas017 toSci -0 -> -0
+ddbas018 toSci -0.0 -> -0.0
+ddbas019 toSci -00.00 -> -0.00
+
+ddbas021 toSci -1 -> -1
+ddbas022 toSci -1.0 -> -1.0
+ddbas023 toSci -0.1 -> -0.1
+ddbas024 toSci -9.1 -> -9.1
+ddbas025 toSci -9.11 -> -9.11
+ddbas026 toSci -9.119 -> -9.119
+ddbas027 toSci -9.999 -> -9.999
+
+ddbas030 toSci '123456789.123456' -> '123456789.123456'
+ddbas031 toSci '123456789.000000' -> '123456789.000000'
+ddbas032 toSci '123456789123456' -> '123456789123456'
+ddbas033 toSci '0.0000123456789' -> '0.0000123456789'
+ddbas034 toSci '0.00000123456789' -> '0.00000123456789'
+ddbas035 toSci '0.000000123456789' -> '1.23456789E-7'
+ddbas036 toSci '0.0000000123456789' -> '1.23456789E-8'
+
+ddbas037 toSci '0.123456789012344' -> '0.123456789012344'
+ddbas038 toSci '0.123456789012345' -> '0.123456789012345'
+
+-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
+ddbsn001 toSci -9.999999999999999E+384 -> -9.999999999999999E+384
+ddbsn002 toSci -1E-383 -> -1E-383
+ddbsn003 toSci -1E-398 -> -1E-398 Subnormal
+ddbsn004 toSci -0 -> -0
+ddbsn005 toSci +0 -> 0
+ddbsn006 toSci +1E-398 -> 1E-398 Subnormal
+ddbsn007 toSci +1E-383 -> 1E-383
+ddbsn008 toSci +9.999999999999999E+384 -> 9.999999999999999E+384
+
+-- String [many more examples are implicitly tested elsewhere]
+-- strings without E cannot generate E in result
+ddbas040 toSci "12" -> '12'
+ddbas041 toSci "-76" -> '-76'
+ddbas042 toSci "12.76" -> '12.76'
+ddbas043 toSci "+12.76" -> '12.76'
+ddbas044 toSci "012.76" -> '12.76'
+ddbas045 toSci "+0.003" -> '0.003'
+ddbas046 toSci "17." -> '17'
+ddbas047 toSci ".5" -> '0.5'
+ddbas048 toSci "044" -> '44'
+ddbas049 toSci "0044" -> '44'
+ddbas050 toSci "0.0005" -> '0.0005'
+ddbas051 toSci "00.00005" -> '0.00005'
+ddbas052 toSci "0.000005" -> '0.000005'
+ddbas053 toSci "0.0000050" -> '0.0000050'
+ddbas054 toSci "0.0000005" -> '5E-7'
+ddbas055 toSci "0.00000005" -> '5E-8'
+ddbas056 toSci "12345678.543210" -> '12345678.543210'
+ddbas057 toSci "2345678.543210" -> '2345678.543210'
+ddbas058 toSci "345678.543210" -> '345678.543210'
+ddbas059 toSci "0345678.54321" -> '345678.54321'
+ddbas060 toSci "345678.5432" -> '345678.5432'
+ddbas061 toSci "+345678.5432" -> '345678.5432'
+ddbas062 toSci "+0345678.5432" -> '345678.5432'
+ddbas063 toSci "+00345678.5432" -> '345678.5432'
+ddbas064 toSci "-345678.5432" -> '-345678.5432'
+ddbas065 toSci "-0345678.5432" -> '-345678.5432'
+ddbas066 toSci "-00345678.5432" -> '-345678.5432'
+-- examples
+ddbas067 toSci "5E-6" -> '0.000005'
+ddbas068 toSci "50E-7" -> '0.0000050'
+ddbas069 toSci "5E-7" -> '5E-7'
+
+-- [No exotics as no Unicode]
+
+-- rounded with dots in all (including edge) places
+ddbas071 toSci .1234567890123456123 -> 0.1234567890123456 Inexact Rounded
+ddbas072 toSci 1.234567890123456123 -> 1.234567890123456 Inexact Rounded
+ddbas073 toSci 12.34567890123456123 -> 12.34567890123456 Inexact Rounded
+ddbas074 toSci 123.4567890123456123 -> 123.4567890123456 Inexact Rounded
+ddbas075 toSci 1234.567890123456123 -> 1234.567890123456 Inexact Rounded
+ddbas076 toSci 12345.67890123456123 -> 12345.67890123456 Inexact Rounded
+ddbas077 toSci 123456.7890123456123 -> 123456.7890123456 Inexact Rounded
+ddbas078 toSci 1234567.890123456123 -> 1234567.890123456 Inexact Rounded
+ddbas079 toSci 12345678.90123456123 -> 12345678.90123456 Inexact Rounded
+ddbas080 toSci 123456789.0123456123 -> 123456789.0123456 Inexact Rounded
+ddbas081 toSci 1234567890.123456123 -> 1234567890.123456 Inexact Rounded
+ddbas082 toSci 12345678901.23456123 -> 12345678901.23456 Inexact Rounded
+ddbas083 toSci 123456789012.3456123 -> 123456789012.3456 Inexact Rounded
+ddbas084 toSci 1234567890123.456123 -> 1234567890123.456 Inexact Rounded
+ddbas085 toSci 12345678901234.56123 -> 12345678901234.56 Inexact Rounded
+ddbas086 toSci 123456789012345.6123 -> 123456789012345.6 Inexact Rounded
+ddbas087 toSci 1234567890123456.123 -> 1234567890123456 Inexact Rounded
+ddbas088 toSci 12345678901234561.23 -> 1.234567890123456E+16 Inexact Rounded
+ddbas089 toSci 123456789012345612.3 -> 1.234567890123456E+17 Inexact Rounded
+ddbas090 toSci 1234567890123456123. -> 1.234567890123456E+18 Inexact Rounded
+
+
+-- Numbers with E
+ddbas130 toSci "0.000E-1" -> '0.0000'
+ddbas131 toSci "0.000E-2" -> '0.00000'
+ddbas132 toSci "0.000E-3" -> '0.000000'
+ddbas133 toSci "0.000E-4" -> '0E-7'
+ddbas134 toSci "0.00E-2" -> '0.0000'
+ddbas135 toSci "0.00E-3" -> '0.00000'
+ddbas136 toSci "0.00E-4" -> '0.000000'
+ddbas137 toSci "0.00E-5" -> '0E-7'
+ddbas138 toSci "+0E+9" -> '0E+9'
+ddbas139 toSci "-0E+9" -> '-0E+9'
+ddbas140 toSci "1E+9" -> '1E+9'
+ddbas141 toSci "1e+09" -> '1E+9'
+ddbas142 toSci "1E+90" -> '1E+90'
+ddbas143 toSci "+1E+009" -> '1E+9'
+ddbas144 toSci "0E+9" -> '0E+9'
+ddbas145 toSci "1E+9" -> '1E+9'
+ddbas146 toSci "1E+09" -> '1E+9'
+ddbas147 toSci "1e+90" -> '1E+90'
+ddbas148 toSci "1E+009" -> '1E+9'
+ddbas149 toSci "000E+9" -> '0E+9'
+ddbas150 toSci "1E9" -> '1E+9'
+ddbas151 toSci "1e09" -> '1E+9'
+ddbas152 toSci "1E90" -> '1E+90'
+ddbas153 toSci "1E009" -> '1E+9'
+ddbas154 toSci "0E9" -> '0E+9'
+ddbas155 toSci "0.000e+0" -> '0.000'
+ddbas156 toSci "0.000E-1" -> '0.0000'
+ddbas157 toSci "4E+9" -> '4E+9'
+ddbas158 toSci "44E+9" -> '4.4E+10'
+ddbas159 toSci "0.73e-7" -> '7.3E-8'
+ddbas160 toSci "00E+9" -> '0E+9'
+ddbas161 toSci "00E-9" -> '0E-9'
+ddbas162 toSci "10E+9" -> '1.0E+10'
+ddbas163 toSci "10E+09" -> '1.0E+10'
+ddbas164 toSci "10e+90" -> '1.0E+91'
+ddbas165 toSci "10E+009" -> '1.0E+10'
+ddbas166 toSci "100e+9" -> '1.00E+11'
+ddbas167 toSci "100e+09" -> '1.00E+11'
+ddbas168 toSci "100E+90" -> '1.00E+92'
+ddbas169 toSci "100e+009" -> '1.00E+11'
+
+ddbas170 toSci "1.265" -> '1.265'
+ddbas171 toSci "1.265E-20" -> '1.265E-20'
+ddbas172 toSci "1.265E-8" -> '1.265E-8'
+ddbas173 toSci "1.265E-4" -> '0.0001265'
+ddbas174 toSci "1.265E-3" -> '0.001265'
+ddbas175 toSci "1.265E-2" -> '0.01265'
+ddbas176 toSci "1.265E-1" -> '0.1265'
+ddbas177 toSci "1.265E-0" -> '1.265'
+ddbas178 toSci "1.265E+1" -> '12.65'
+ddbas179 toSci "1.265E+2" -> '126.5'
+ddbas180 toSci "1.265E+3" -> '1265'
+ddbas181 toSci "1.265E+4" -> '1.265E+4'
+ddbas182 toSci "1.265E+8" -> '1.265E+8'
+ddbas183 toSci "1.265E+20" -> '1.265E+20'
+
+ddbas190 toSci "12.65" -> '12.65'
+ddbas191 toSci "12.65E-20" -> '1.265E-19'
+ddbas192 toSci "12.65E-8" -> '1.265E-7'
+ddbas193 toSci "12.65E-4" -> '0.001265'
+ddbas194 toSci "12.65E-3" -> '0.01265'
+ddbas195 toSci "12.65E-2" -> '0.1265'
+ddbas196 toSci "12.65E-1" -> '1.265'
+ddbas197 toSci "12.65E-0" -> '12.65'
+ddbas198 toSci "12.65E+1" -> '126.5'
+ddbas199 toSci "12.65E+2" -> '1265'
+ddbas200 toSci "12.65E+3" -> '1.265E+4'
+ddbas201 toSci "12.65E+4" -> '1.265E+5'
+ddbas202 toSci "12.65E+8" -> '1.265E+9'
+ddbas203 toSci "12.65E+20" -> '1.265E+21'
+
+ddbas210 toSci "126.5" -> '126.5'
+ddbas211 toSci "126.5E-20" -> '1.265E-18'
+ddbas212 toSci "126.5E-8" -> '0.000001265'
+ddbas213 toSci "126.5E-4" -> '0.01265'
+ddbas214 toSci "126.5E-3" -> '0.1265'
+ddbas215 toSci "126.5E-2" -> '1.265'
+ddbas216 toSci "126.5E-1" -> '12.65'
+ddbas217 toSci "126.5E-0" -> '126.5'
+ddbas218 toSci "126.5E+1" -> '1265'
+ddbas219 toSci "126.5E+2" -> '1.265E+4'
+ddbas220 toSci "126.5E+3" -> '1.265E+5'
+ddbas221 toSci "126.5E+4" -> '1.265E+6'
+ddbas222 toSci "126.5E+8" -> '1.265E+10'
+ddbas223 toSci "126.5E+20" -> '1.265E+22'
+
+ddbas230 toSci "1265" -> '1265'
+ddbas231 toSci "1265E-20" -> '1.265E-17'
+ddbas232 toSci "1265E-8" -> '0.00001265'
+ddbas233 toSci "1265E-4" -> '0.1265'
+ddbas234 toSci "1265E-3" -> '1.265'
+ddbas235 toSci "1265E-2" -> '12.65'
+ddbas236 toSci "1265E-1" -> '126.5'
+ddbas237 toSci "1265E-0" -> '1265'
+ddbas238 toSci "1265E+1" -> '1.265E+4'
+ddbas239 toSci "1265E+2" -> '1.265E+5'
+ddbas240 toSci "1265E+3" -> '1.265E+6'
+ddbas241 toSci "1265E+4" -> '1.265E+7'
+ddbas242 toSci "1265E+8" -> '1.265E+11'
+ddbas243 toSci "1265E+20" -> '1.265E+23'
+ddbas244 toSci "1265E-9" -> '0.000001265'
+ddbas245 toSci "1265E-10" -> '1.265E-7'
+ddbas246 toSci "1265E-11" -> '1.265E-8'
+ddbas247 toSci "1265E-12" -> '1.265E-9'
+
+ddbas250 toSci "0.1265" -> '0.1265'
+ddbas251 toSci "0.1265E-20" -> '1.265E-21'
+ddbas252 toSci "0.1265E-8" -> '1.265E-9'
+ddbas253 toSci "0.1265E-4" -> '0.00001265'
+ddbas254 toSci "0.1265E-3" -> '0.0001265'
+ddbas255 toSci "0.1265E-2" -> '0.001265'
+ddbas256 toSci "0.1265E-1" -> '0.01265'
+ddbas257 toSci "0.1265E-0" -> '0.1265'
+ddbas258 toSci "0.1265E+1" -> '1.265'
+ddbas259 toSci "0.1265E+2" -> '12.65'
+ddbas260 toSci "0.1265E+3" -> '126.5'
+ddbas261 toSci "0.1265E+4" -> '1265'
+ddbas262 toSci "0.1265E+8" -> '1.265E+7'
+ddbas263 toSci "0.1265E+20" -> '1.265E+19'
+
+-- some more negative zeros [systematic tests below]
+ddbas290 toSci "-0.000E-1" -> '-0.0000'
+ddbas291 toSci "-0.000E-2" -> '-0.00000'
+ddbas292 toSci "-0.000E-3" -> '-0.000000'
+ddbas293 toSci "-0.000E-4" -> '-0E-7'
+ddbas294 toSci "-0.00E-2" -> '-0.0000'
+ddbas295 toSci "-0.00E-3" -> '-0.00000'
+ddbas296 toSci "-0.0E-2" -> '-0.000'
+ddbas297 toSci "-0.0E-3" -> '-0.0000'
+ddbas298 toSci "-0E-2" -> '-0.00'
+ddbas299 toSci "-0E-3" -> '-0.000'
+
+-- Engineering notation tests
+ddbas301 toSci 10e12 -> 1.0E+13
+ddbas302 toEng 10e12 -> 10E+12
+ddbas303 toSci 10e11 -> 1.0E+12
+ddbas304 toEng 10e11 -> 1.0E+12
+ddbas305 toSci 10e10 -> 1.0E+11
+ddbas306 toEng 10e10 -> 100E+9
+ddbas307 toSci 10e9 -> 1.0E+10
+ddbas308 toEng 10e9 -> 10E+9
+ddbas309 toSci 10e8 -> 1.0E+9
+ddbas310 toEng 10e8 -> 1.0E+9
+ddbas311 toSci 10e7 -> 1.0E+8
+ddbas312 toEng 10e7 -> 100E+6
+ddbas313 toSci 10e6 -> 1.0E+7
+ddbas314 toEng 10e6 -> 10E+6
+ddbas315 toSci 10e5 -> 1.0E+6
+ddbas316 toEng 10e5 -> 1.0E+6
+ddbas317 toSci 10e4 -> 1.0E+5
+ddbas318 toEng 10e4 -> 100E+3
+ddbas319 toSci 10e3 -> 1.0E+4
+ddbas320 toEng 10e3 -> 10E+3
+ddbas321 toSci 10e2 -> 1.0E+3
+ddbas322 toEng 10e2 -> 1.0E+3
+ddbas323 toSci 10e1 -> 1.0E+2
+ddbas324 toEng 10e1 -> 100
+ddbas325 toSci 10e0 -> 10
+ddbas326 toEng 10e0 -> 10
+ddbas327 toSci 10e-1 -> 1.0
+ddbas328 toEng 10e-1 -> 1.0
+ddbas329 toSci 10e-2 -> 0.10
+ddbas330 toEng 10e-2 -> 0.10
+ddbas331 toSci 10e-3 -> 0.010
+ddbas332 toEng 10e-3 -> 0.010
+ddbas333 toSci 10e-4 -> 0.0010
+ddbas334 toEng 10e-4 -> 0.0010
+ddbas335 toSci 10e-5 -> 0.00010
+ddbas336 toEng 10e-5 -> 0.00010
+ddbas337 toSci 10e-6 -> 0.000010
+ddbas338 toEng 10e-6 -> 0.000010
+ddbas339 toSci 10e-7 -> 0.0000010
+ddbas340 toEng 10e-7 -> 0.0000010
+ddbas341 toSci 10e-8 -> 1.0E-7
+ddbas342 toEng 10e-8 -> 100E-9
+ddbas343 toSci 10e-9 -> 1.0E-8
+ddbas344 toEng 10e-9 -> 10E-9
+ddbas345 toSci 10e-10 -> 1.0E-9
+ddbas346 toEng 10e-10 -> 1.0E-9
+ddbas347 toSci 10e-11 -> 1.0E-10
+ddbas348 toEng 10e-11 -> 100E-12
+ddbas349 toSci 10e-12 -> 1.0E-11
+ddbas350 toEng 10e-12 -> 10E-12
+ddbas351 toSci 10e-13 -> 1.0E-12
+ddbas352 toEng 10e-13 -> 1.0E-12
+
+ddbas361 toSci 7E12 -> 7E+12
+ddbas362 toEng 7E12 -> 7E+12
+ddbas363 toSci 7E11 -> 7E+11
+ddbas364 toEng 7E11 -> 700E+9
+ddbas365 toSci 7E10 -> 7E+10
+ddbas366 toEng 7E10 -> 70E+9
+ddbas367 toSci 7E9 -> 7E+9
+ddbas368 toEng 7E9 -> 7E+9
+ddbas369 toSci 7E8 -> 7E+8
+ddbas370 toEng 7E8 -> 700E+6
+ddbas371 toSci 7E7 -> 7E+7
+ddbas372 toEng 7E7 -> 70E+6
+ddbas373 toSci 7E6 -> 7E+6
+ddbas374 toEng 7E6 -> 7E+6
+ddbas375 toSci 7E5 -> 7E+5
+ddbas376 toEng 7E5 -> 700E+3
+ddbas377 toSci 7E4 -> 7E+4
+ddbas378 toEng 7E4 -> 70E+3
+ddbas379 toSci 7E3 -> 7E+3
+ddbas380 toEng 7E3 -> 7E+3
+ddbas381 toSci 7E2 -> 7E+2
+ddbas382 toEng 7E2 -> 700
+ddbas383 toSci 7E1 -> 7E+1
+ddbas384 toEng 7E1 -> 70
+ddbas385 toSci 7E0 -> 7
+ddbas386 toEng 7E0 -> 7
+ddbas387 toSci 7E-1 -> 0.7
+ddbas388 toEng 7E-1 -> 0.7
+ddbas389 toSci 7E-2 -> 0.07
+ddbas390 toEng 7E-2 -> 0.07
+ddbas391 toSci 7E-3 -> 0.007
+ddbas392 toEng 7E-3 -> 0.007
+ddbas393 toSci 7E-4 -> 0.0007
+ddbas394 toEng 7E-4 -> 0.0007
+ddbas395 toSci 7E-5 -> 0.00007
+ddbas396 toEng 7E-5 -> 0.00007
+ddbas397 toSci 7E-6 -> 0.000007
+ddbas398 toEng 7E-6 -> 0.000007
+ddbas399 toSci 7E-7 -> 7E-7
+ddbas400 toEng 7E-7 -> 700E-9
+ddbas401 toSci 7E-8 -> 7E-8
+ddbas402 toEng 7E-8 -> 70E-9
+ddbas403 toSci 7E-9 -> 7E-9
+ddbas404 toEng 7E-9 -> 7E-9
+ddbas405 toSci 7E-10 -> 7E-10
+ddbas406 toEng 7E-10 -> 700E-12
+ddbas407 toSci 7E-11 -> 7E-11
+ddbas408 toEng 7E-11 -> 70E-12
+ddbas409 toSci 7E-12 -> 7E-12
+ddbas410 toEng 7E-12 -> 7E-12
+ddbas411 toSci 7E-13 -> 7E-13
+ddbas412 toEng 7E-13 -> 700E-15
+
+-- Exacts remain exact up to precision ..
+rounding: half_up
+ddbas420 toSci 100 -> 100
+ddbas421 toEng 100 -> 100
+ddbas422 toSci 1000 -> 1000
+ddbas423 toEng 1000 -> 1000
+ddbas424 toSci 999.9 -> 999.9
+ddbas425 toEng 999.9 -> 999.9
+ddbas426 toSci 1000.0 -> 1000.0
+ddbas427 toEng 1000.0 -> 1000.0
+ddbas428 toSci 1000.1 -> 1000.1
+ddbas429 toEng 1000.1 -> 1000.1
+ddbas430 toSci 10000 -> 10000
+ddbas431 toEng 10000 -> 10000
+ddbas432 toSci 100000 -> 100000
+ddbas433 toEng 100000 -> 100000
+ddbas434 toSci 1000000 -> 1000000
+ddbas435 toEng 1000000 -> 1000000
+ddbas436 toSci 10000000 -> 10000000
+ddbas437 toEng 10000000 -> 10000000
+ddbas438 toSci 100000000 -> 100000000
+ddbas439 toEng 1000000000000000 -> 1000000000000000
+ddbas440 toSci 10000000000000000 -> 1.000000000000000E+16 Rounded
+ddbas441 toEng 10000000000000000 -> 10.00000000000000E+15 Rounded
+ddbas442 toSci 10000000000000001 -> 1.000000000000000E+16 Rounded Inexact
+ddbas443 toEng 10000000000000001 -> 10.00000000000000E+15 Rounded Inexact
+ddbas444 toSci 10000000000000003 -> 1.000000000000000E+16 Rounded Inexact
+ddbas445 toEng 10000000000000003 -> 10.00000000000000E+15 Rounded Inexact
+ddbas446 toSci 10000000000000005 -> 1.000000000000001E+16 Rounded Inexact
+ddbas447 toEng 10000000000000005 -> 10.00000000000001E+15 Rounded Inexact
+ddbas448 toSci 100000000000000050 -> 1.000000000000001E+17 Rounded Inexact
+ddbas449 toEng 100000000000000050 -> 100.0000000000001E+15 Rounded Inexact
+ddbas450 toSci 10000000000000009 -> 1.000000000000001E+16 Rounded Inexact
+ddbas451 toEng 10000000000000009 -> 10.00000000000001E+15 Rounded Inexact
+ddbas452 toSci 100000000000000000 -> 1.000000000000000E+17 Rounded
+ddbas453 toEng 100000000000000000 -> 100.0000000000000E+15 Rounded
+ddbas454 toSci 100000000000000003 -> 1.000000000000000E+17 Rounded Inexact
+ddbas455 toEng 100000000000000003 -> 100.0000000000000E+15 Rounded Inexact
+ddbas456 toSci 100000000000000005 -> 1.000000000000000E+17 Rounded Inexact
+ddbas457 toEng 100000000000000005 -> 100.0000000000000E+15 Rounded Inexact
+ddbas458 toSci 100000000000000009 -> 1.000000000000000E+17 Rounded Inexact
+ddbas459 toEng 100000000000000009 -> 100.0000000000000E+15 Rounded Inexact
+ddbas460 toSci 1000000000000000000 -> 1.000000000000000E+18 Rounded
+ddbas461 toEng 1000000000000000000 -> 1.000000000000000E+18 Rounded
+ddbas462 toSci 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact
+ddbas463 toEng 1000000000000000300 -> 1.000000000000000E+18 Rounded Inexact
+ddbas464 toSci 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact
+ddbas465 toEng 1000000000000000500 -> 1.000000000000001E+18 Rounded Inexact
+ddbas466 toSci 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact
+ddbas467 toEng 1000000000000000900 -> 1.000000000000001E+18 Rounded Inexact
+ddbas468 toSci 10000000000000000000 -> 1.000000000000000E+19 Rounded
+ddbas469 toEng 10000000000000000000 -> 10.00000000000000E+18 Rounded
+ddbas470 toSci 10000000000000003000 -> 1.000000000000000E+19 Rounded Inexact
+ddbas471 toEng 10000000000000003000 -> 10.00000000000000E+18 Rounded Inexact
+ddbas472 toSci 10000000000000005000 -> 1.000000000000001E+19 Rounded Inexact
+ddbas473 toEng 10000000000000005000 -> 10.00000000000001E+18 Rounded Inexact
+ddbas474 toSci 10000000000000009000 -> 1.000000000000001E+19 Rounded Inexact
+ddbas475 toEng 10000000000000009000 -> 10.00000000000001E+18 Rounded Inexact
+
+-- check rounding modes heeded
+rounding: ceiling
+ddbsr401 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr402 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact
+ddbsr403 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
+ddbsr404 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+rounding: up
+ddbsr405 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr406 toSci 1.11111111111234549 -> 1.111111111112346 Rounded Inexact
+ddbsr407 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
+ddbsr408 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+rounding: floor
+ddbsr410 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr411 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr412 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
+ddbsr413 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact
+rounding: half_down
+ddbsr415 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr416 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr417 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
+ddbsr418 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact
+ddbsr419 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+rounding: half_even
+ddbsr421 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr422 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr423 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
+ddbsr424 toSci 1.11111111111234650 -> 1.111111111112346 Rounded Inexact
+ddbsr425 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+rounding: down
+ddbsr426 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr427 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr428 toSci 1.11111111111234550 -> 1.111111111112345 Rounded Inexact
+ddbsr429 toSci 1.11111111111234551 -> 1.111111111112345 Rounded Inexact
+rounding: half_up
+ddbsr431 toSci 1.1111111111123450 -> 1.111111111112345 Rounded
+ddbsr432 toSci 1.11111111111234549 -> 1.111111111112345 Rounded Inexact
+ddbsr433 toSci 1.11111111111234550 -> 1.111111111112346 Rounded Inexact
+ddbsr434 toSci 1.11111111111234650 -> 1.111111111112347 Rounded Inexact
+ddbsr435 toSci 1.11111111111234551 -> 1.111111111112346 Rounded Inexact
+-- negatives
+rounding: ceiling
+ddbsr501 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr502 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr503 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
+ddbsr504 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact
+rounding: up
+ddbsr505 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr506 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact
+ddbsr507 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
+ddbsr508 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+rounding: floor
+ddbsr510 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr511 toSci -1.11111111111234549 -> -1.111111111112346 Rounded Inexact
+ddbsr512 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
+ddbsr513 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+rounding: half_down
+ddbsr515 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr516 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr517 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
+ddbsr518 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact
+ddbsr519 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+rounding: half_even
+ddbsr521 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr522 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr523 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
+ddbsr524 toSci -1.11111111111234650 -> -1.111111111112346 Rounded Inexact
+ddbsr525 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+rounding: down
+ddbsr526 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr527 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr528 toSci -1.11111111111234550 -> -1.111111111112345 Rounded Inexact
+ddbsr529 toSci -1.11111111111234551 -> -1.111111111112345 Rounded Inexact
+rounding: half_up
+ddbsr531 toSci -1.1111111111123450 -> -1.111111111112345 Rounded
+ddbsr532 toSci -1.11111111111234549 -> -1.111111111112345 Rounded Inexact
+ddbsr533 toSci -1.11111111111234550 -> -1.111111111112346 Rounded Inexact
+ddbsr534 toSci -1.11111111111234650 -> -1.111111111112347 Rounded Inexact
+ddbsr535 toSci -1.11111111111234551 -> -1.111111111112346 Rounded Inexact
+
+rounding: half_even
+
+-- The 'baddies' tests from DiagBigDecimal, plus some new ones
+ddbas500 toSci '1..2' -> NaN Conversion_syntax
+ddbas501 toSci '.' -> NaN Conversion_syntax
+ddbas502 toSci '..' -> NaN Conversion_syntax
+ddbas503 toSci '++1' -> NaN Conversion_syntax
+ddbas504 toSci '--1' -> NaN Conversion_syntax
+ddbas505 toSci '-+1' -> NaN Conversion_syntax
+ddbas506 toSci '+-1' -> NaN Conversion_syntax
+ddbas507 toSci '12e' -> NaN Conversion_syntax
+ddbas508 toSci '12e++' -> NaN Conversion_syntax
+ddbas509 toSci '12f4' -> NaN Conversion_syntax
+ddbas510 toSci ' +1' -> NaN Conversion_syntax
+ddbas511 toSci '+ 1' -> NaN Conversion_syntax
+ddbas512 toSci '12 ' -> NaN Conversion_syntax
+ddbas513 toSci ' + 1' -> NaN Conversion_syntax
+ddbas514 toSci ' - 1 ' -> NaN Conversion_syntax
+ddbas515 toSci 'x' -> NaN Conversion_syntax
+ddbas516 toSci '-1-' -> NaN Conversion_syntax
+ddbas517 toSci '12-' -> NaN Conversion_syntax
+ddbas518 toSci '3+' -> NaN Conversion_syntax
+ddbas519 toSci '' -> NaN Conversion_syntax
+ddbas520 toSci '1e-' -> NaN Conversion_syntax
+ddbas521 toSci '7e99999a' -> NaN Conversion_syntax
+ddbas522 toSci '7e123567890x' -> NaN Conversion_syntax
+ddbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
+ddbas524 toSci '' -> NaN Conversion_syntax
+ddbas525 toSci 'e100' -> NaN Conversion_syntax
+ddbas526 toSci '\u0e5a' -> NaN Conversion_syntax
+ddbas527 toSci '\u0b65' -> NaN Conversion_syntax
+ddbas528 toSci '123,65' -> NaN Conversion_syntax
+ddbas529 toSci '1.34.5' -> NaN Conversion_syntax
+ddbas530 toSci '.123.5' -> NaN Conversion_syntax
+ddbas531 toSci '01.35.' -> NaN Conversion_syntax
+ddbas532 toSci '01.35-' -> NaN Conversion_syntax
+ddbas533 toSci '0000..' -> NaN Conversion_syntax
+ddbas534 toSci '.0000.' -> NaN Conversion_syntax
+ddbas535 toSci '00..00' -> NaN Conversion_syntax
+ddbas536 toSci '111e*123' -> NaN Conversion_syntax
+ddbas537 toSci '111e123-' -> NaN Conversion_syntax
+ddbas538 toSci '111e+12+' -> NaN Conversion_syntax
+ddbas539 toSci '111e1-3-' -> NaN Conversion_syntax
+ddbas540 toSci '111e1*23' -> NaN Conversion_syntax
+ddbas541 toSci '111e1e+3' -> NaN Conversion_syntax
+ddbas542 toSci '1e1.0' -> NaN Conversion_syntax
+ddbas543 toSci '1e123e' -> NaN Conversion_syntax
+ddbas544 toSci 'ten' -> NaN Conversion_syntax
+ddbas545 toSci 'ONE' -> NaN Conversion_syntax
+ddbas546 toSci '1e.1' -> NaN Conversion_syntax
+ddbas547 toSci '1e1.' -> NaN Conversion_syntax
+ddbas548 toSci '1ee' -> NaN Conversion_syntax
+ddbas549 toSci 'e+1' -> NaN Conversion_syntax
+ddbas550 toSci '1.23.4' -> NaN Conversion_syntax
+ddbas551 toSci '1.2.1' -> NaN Conversion_syntax
+ddbas552 toSci '1E+1.2' -> NaN Conversion_syntax
+ddbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
+ddbas554 toSci '1E++1' -> NaN Conversion_syntax
+ddbas555 toSci '1E--1' -> NaN Conversion_syntax
+ddbas556 toSci '1E+-1' -> NaN Conversion_syntax
+ddbas557 toSci '1E-+1' -> NaN Conversion_syntax
+ddbas558 toSci '1E''1' -> NaN Conversion_syntax
+ddbas559 toSci "1E""1" -> NaN Conversion_syntax
+ddbas560 toSci "1E""""" -> NaN Conversion_syntax
+-- Near-specials
+ddbas561 toSci "qNaN" -> NaN Conversion_syntax
+ddbas562 toSci "NaNq" -> NaN Conversion_syntax
+ddbas563 toSci "NaNs" -> NaN Conversion_syntax
+ddbas564 toSci "Infi" -> NaN Conversion_syntax
+ddbas565 toSci "Infin" -> NaN Conversion_syntax
+ddbas566 toSci "Infini" -> NaN Conversion_syntax
+ddbas567 toSci "Infinit" -> NaN Conversion_syntax
+ddbas568 toSci "-Infinit" -> NaN Conversion_syntax
+ddbas569 toSci "0Inf" -> NaN Conversion_syntax
+ddbas570 toSci "9Inf" -> NaN Conversion_syntax
+ddbas571 toSci "-0Inf" -> NaN Conversion_syntax
+ddbas572 toSci "-9Inf" -> NaN Conversion_syntax
+ddbas573 toSci "-sNa" -> NaN Conversion_syntax
+ddbas574 toSci "xNaN" -> NaN Conversion_syntax
+ddbas575 toSci "0sNaN" -> NaN Conversion_syntax
+
+-- some baddies with dots and Es and dots and specials
+ddbas576 toSci 'e+1' -> NaN Conversion_syntax
+ddbas577 toSci '.e+1' -> NaN Conversion_syntax
+ddbas578 toSci '+.e+1' -> NaN Conversion_syntax
+ddbas579 toSci '-.e+' -> NaN Conversion_syntax
+ddbas580 toSci '-.e' -> NaN Conversion_syntax
+ddbas581 toSci 'E+1' -> NaN Conversion_syntax
+ddbas582 toSci '.E+1' -> NaN Conversion_syntax
+ddbas583 toSci '+.E+1' -> NaN Conversion_syntax
+ddbas584 toSci '-.E+' -> NaN Conversion_syntax
+ddbas585 toSci '-.E' -> NaN Conversion_syntax
+
+ddbas586 toSci '.NaN' -> NaN Conversion_syntax
+ddbas587 toSci '-.NaN' -> NaN Conversion_syntax
+ddbas588 toSci '+.sNaN' -> NaN Conversion_syntax
+ddbas589 toSci '+.Inf' -> NaN Conversion_syntax
+ddbas590 toSci '.Infinity' -> NaN Conversion_syntax
+
+-- Zeros
+ddbas601 toSci 0.000000000 -> 0E-9
+ddbas602 toSci 0.00000000 -> 0E-8
+ddbas603 toSci 0.0000000 -> 0E-7
+ddbas604 toSci 0.000000 -> 0.000000
+ddbas605 toSci 0.00000 -> 0.00000
+ddbas606 toSci 0.0000 -> 0.0000
+ddbas607 toSci 0.000 -> 0.000
+ddbas608 toSci 0.00 -> 0.00
+ddbas609 toSci 0.0 -> 0.0
+ddbas610 toSci .0 -> 0.0
+ddbas611 toSci 0. -> 0
+ddbas612 toSci -.0 -> -0.0
+ddbas613 toSci -0. -> -0
+ddbas614 toSci -0.0 -> -0.0
+ddbas615 toSci -0.00 -> -0.00
+ddbas616 toSci -0.000 -> -0.000
+ddbas617 toSci -0.0000 -> -0.0000
+ddbas618 toSci -0.00000 -> -0.00000
+ddbas619 toSci -0.000000 -> -0.000000
+ddbas620 toSci -0.0000000 -> -0E-7
+ddbas621 toSci -0.00000000 -> -0E-8
+ddbas622 toSci -0.000000000 -> -0E-9
+
+ddbas630 toSci 0.00E+0 -> 0.00
+ddbas631 toSci 0.00E+1 -> 0.0
+ddbas632 toSci 0.00E+2 -> 0
+ddbas633 toSci 0.00E+3 -> 0E+1
+ddbas634 toSci 0.00E+4 -> 0E+2
+ddbas635 toSci 0.00E+5 -> 0E+3
+ddbas636 toSci 0.00E+6 -> 0E+4
+ddbas637 toSci 0.00E+7 -> 0E+5
+ddbas638 toSci 0.00E+8 -> 0E+6
+ddbas639 toSci 0.00E+9 -> 0E+7
+
+ddbas640 toSci 0.0E+0 -> 0.0
+ddbas641 toSci 0.0E+1 -> 0
+ddbas642 toSci 0.0E+2 -> 0E+1
+ddbas643 toSci 0.0E+3 -> 0E+2
+ddbas644 toSci 0.0E+4 -> 0E+3
+ddbas645 toSci 0.0E+5 -> 0E+4
+ddbas646 toSci 0.0E+6 -> 0E+5
+ddbas647 toSci 0.0E+7 -> 0E+6
+ddbas648 toSci 0.0E+8 -> 0E+7
+ddbas649 toSci 0.0E+9 -> 0E+8
+
+ddbas650 toSci 0E+0 -> 0
+ddbas651 toSci 0E+1 -> 0E+1
+ddbas652 toSci 0E+2 -> 0E+2
+ddbas653 toSci 0E+3 -> 0E+3
+ddbas654 toSci 0E+4 -> 0E+4
+ddbas655 toSci 0E+5 -> 0E+5
+ddbas656 toSci 0E+6 -> 0E+6
+ddbas657 toSci 0E+7 -> 0E+7
+ddbas658 toSci 0E+8 -> 0E+8
+ddbas659 toSci 0E+9 -> 0E+9
+
+ddbas660 toSci 0.0E-0 -> 0.0
+ddbas661 toSci 0.0E-1 -> 0.00
+ddbas662 toSci 0.0E-2 -> 0.000
+ddbas663 toSci 0.0E-3 -> 0.0000
+ddbas664 toSci 0.0E-4 -> 0.00000
+ddbas665 toSci 0.0E-5 -> 0.000000
+ddbas666 toSci 0.0E-6 -> 0E-7
+ddbas667 toSci 0.0E-7 -> 0E-8
+ddbas668 toSci 0.0E-8 -> 0E-9
+ddbas669 toSci 0.0E-9 -> 0E-10
+
+ddbas670 toSci 0.00E-0 -> 0.00
+ddbas671 toSci 0.00E-1 -> 0.000
+ddbas672 toSci 0.00E-2 -> 0.0000
+ddbas673 toSci 0.00E-3 -> 0.00000
+ddbas674 toSci 0.00E-4 -> 0.000000
+ddbas675 toSci 0.00E-5 -> 0E-7
+ddbas676 toSci 0.00E-6 -> 0E-8
+ddbas677 toSci 0.00E-7 -> 0E-9
+ddbas678 toSci 0.00E-8 -> 0E-10
+ddbas679 toSci 0.00E-9 -> 0E-11
+
+ddbas680 toSci 000000. -> 0
+ddbas681 toSci 00000. -> 0
+ddbas682 toSci 0000. -> 0
+ddbas683 toSci 000. -> 0
+ddbas684 toSci 00. -> 0
+ddbas685 toSci 0. -> 0
+ddbas686 toSci +00000. -> 0
+ddbas687 toSci -00000. -> -0
+ddbas688 toSci +0. -> 0
+ddbas689 toSci -0. -> -0
+
+-- Specials
+ddbas700 toSci "NaN" -> NaN
+ddbas701 toSci "nan" -> NaN
+ddbas702 toSci "nAn" -> NaN
+ddbas703 toSci "NAN" -> NaN
+ddbas704 toSci "+NaN" -> NaN
+ddbas705 toSci "+nan" -> NaN
+ddbas706 toSci "+nAn" -> NaN
+ddbas707 toSci "+NAN" -> NaN
+ddbas708 toSci "-NaN" -> -NaN
+ddbas709 toSci "-nan" -> -NaN
+ddbas710 toSci "-nAn" -> -NaN
+ddbas711 toSci "-NAN" -> -NaN
+ddbas712 toSci 'NaN0' -> NaN
+ddbas713 toSci 'NaN1' -> NaN1
+ddbas714 toSci 'NaN12' -> NaN12
+ddbas715 toSci 'NaN123' -> NaN123
+ddbas716 toSci 'NaN1234' -> NaN1234
+ddbas717 toSci 'NaN01' -> NaN1
+ddbas718 toSci 'NaN012' -> NaN12
+ddbas719 toSci 'NaN0123' -> NaN123
+ddbas720 toSci 'NaN01234' -> NaN1234
+ddbas721 toSci 'NaN001' -> NaN1
+ddbas722 toSci 'NaN0012' -> NaN12
+ddbas723 toSci 'NaN00123' -> NaN123
+ddbas724 toSci 'NaN001234' -> NaN1234
+ddbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax
+ddbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
+ddbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
+ddbas728 toSci 'NaN-12' -> NaN Conversion_syntax
+ddbas729 toSci 'NaN+12' -> NaN Conversion_syntax
+
+ddbas730 toSci "sNaN" -> sNaN
+ddbas731 toSci "snan" -> sNaN
+ddbas732 toSci "SnAn" -> sNaN
+ddbas733 toSci "SNAN" -> sNaN
+ddbas734 toSci "+sNaN" -> sNaN
+ddbas735 toSci "+snan" -> sNaN
+ddbas736 toSci "+SnAn" -> sNaN
+ddbas737 toSci "+SNAN" -> sNaN
+ddbas738 toSci "-sNaN" -> -sNaN
+ddbas739 toSci "-snan" -> -sNaN
+ddbas740 toSci "-SnAn" -> -sNaN
+ddbas741 toSci "-SNAN" -> -sNaN
+ddbas742 toSci 'sNaN0000' -> sNaN
+ddbas743 toSci 'sNaN7' -> sNaN7
+ddbas744 toSci 'sNaN007234' -> sNaN7234
+ddbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax
+ddbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
+ddbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
+
+ddbas748 toSci "Inf" -> Infinity
+ddbas749 toSci "inf" -> Infinity
+ddbas750 toSci "iNf" -> Infinity
+ddbas751 toSci "INF" -> Infinity
+ddbas752 toSci "+Inf" -> Infinity
+ddbas753 toSci "+inf" -> Infinity
+ddbas754 toSci "+iNf" -> Infinity
+ddbas755 toSci "+INF" -> Infinity
+ddbas756 toSci "-Inf" -> -Infinity
+ddbas757 toSci "-inf" -> -Infinity
+ddbas758 toSci "-iNf" -> -Infinity
+ddbas759 toSci "-INF" -> -Infinity
+
+ddbas760 toSci "Infinity" -> Infinity
+ddbas761 toSci "infinity" -> Infinity
+ddbas762 toSci "iNfInItY" -> Infinity
+ddbas763 toSci "INFINITY" -> Infinity
+ddbas764 toSci "+Infinity" -> Infinity
+ddbas765 toSci "+infinity" -> Infinity
+ddbas766 toSci "+iNfInItY" -> Infinity
+ddbas767 toSci "+INFINITY" -> Infinity
+ddbas768 toSci "-Infinity" -> -Infinity
+ddbas769 toSci "-infinity" -> -Infinity
+ddbas770 toSci "-iNfInItY" -> -Infinity
+ddbas771 toSci "-INFINITY" -> -Infinity
+
+-- Specials and zeros for toEng
+ddbast772 toEng "NaN" -> NaN
+ddbast773 toEng "-Infinity" -> -Infinity
+ddbast774 toEng "-sNaN" -> -sNaN
+ddbast775 toEng "-NaN" -> -NaN
+ddbast776 toEng "+Infinity" -> Infinity
+ddbast778 toEng "+sNaN" -> sNaN
+ddbast779 toEng "+NaN" -> NaN
+ddbast780 toEng "INFINITY" -> Infinity
+ddbast781 toEng "SNAN" -> sNaN
+ddbast782 toEng "NAN" -> NaN
+ddbast783 toEng "infinity" -> Infinity
+ddbast784 toEng "snan" -> sNaN
+ddbast785 toEng "nan" -> NaN
+ddbast786 toEng "InFINITY" -> Infinity
+ddbast787 toEng "SnAN" -> sNaN
+ddbast788 toEng "nAN" -> NaN
+ddbast789 toEng "iNfinity" -> Infinity
+ddbast790 toEng "sNan" -> sNaN
+ddbast791 toEng "Nan" -> NaN
+ddbast792 toEng "Infinity" -> Infinity
+ddbast793 toEng "sNaN" -> sNaN
+
+-- Zero toEng, etc.
+ddbast800 toEng 0e+1 -> "0.00E+3" -- doc example
+
+ddbast801 toEng 0.000000000 -> 0E-9
+ddbast802 toEng 0.00000000 -> 0.00E-6
+ddbast803 toEng 0.0000000 -> 0.0E-6
+ddbast804 toEng 0.000000 -> 0.000000
+ddbast805 toEng 0.00000 -> 0.00000
+ddbast806 toEng 0.0000 -> 0.0000
+ddbast807 toEng 0.000 -> 0.000
+ddbast808 toEng 0.00 -> 0.00
+ddbast809 toEng 0.0 -> 0.0
+ddbast810 toEng .0 -> 0.0
+ddbast811 toEng 0. -> 0
+ddbast812 toEng -.0 -> -0.0
+ddbast813 toEng -0. -> -0
+ddbast814 toEng -0.0 -> -0.0
+ddbast815 toEng -0.00 -> -0.00
+ddbast816 toEng -0.000 -> -0.000
+ddbast817 toEng -0.0000 -> -0.0000
+ddbast818 toEng -0.00000 -> -0.00000
+ddbast819 toEng -0.000000 -> -0.000000
+ddbast820 toEng -0.0000000 -> -0.0E-6
+ddbast821 toEng -0.00000000 -> -0.00E-6
+ddbast822 toEng -0.000000000 -> -0E-9
+
+ddbast830 toEng 0.00E+0 -> 0.00
+ddbast831 toEng 0.00E+1 -> 0.0
+ddbast832 toEng 0.00E+2 -> 0
+ddbast833 toEng 0.00E+3 -> 0.00E+3
+ddbast834 toEng 0.00E+4 -> 0.0E+3
+ddbast835 toEng 0.00E+5 -> 0E+3
+ddbast836 toEng 0.00E+6 -> 0.00E+6
+ddbast837 toEng 0.00E+7 -> 0.0E+6
+ddbast838 toEng 0.00E+8 -> 0E+6
+ddbast839 toEng 0.00E+9 -> 0.00E+9
+
+ddbast840 toEng 0.0E+0 -> 0.0
+ddbast841 toEng 0.0E+1 -> 0
+ddbast842 toEng 0.0E+2 -> 0.00E+3
+ddbast843 toEng 0.0E+3 -> 0.0E+3
+ddbast844 toEng 0.0E+4 -> 0E+3
+ddbast845 toEng 0.0E+5 -> 0.00E+6
+ddbast846 toEng 0.0E+6 -> 0.0E+6
+ddbast847 toEng 0.0E+7 -> 0E+6
+ddbast848 toEng 0.0E+8 -> 0.00E+9
+ddbast849 toEng 0.0E+9 -> 0.0E+9
+
+ddbast850 toEng 0E+0 -> 0
+ddbast851 toEng 0E+1 -> 0.00E+3
+ddbast852 toEng 0E+2 -> 0.0E+3
+ddbast853 toEng 0E+3 -> 0E+3
+ddbast854 toEng 0E+4 -> 0.00E+6
+ddbast855 toEng 0E+5 -> 0.0E+6
+ddbast856 toEng 0E+6 -> 0E+6
+ddbast857 toEng 0E+7 -> 0.00E+9
+ddbast858 toEng 0E+8 -> 0.0E+9
+ddbast859 toEng 0E+9 -> 0E+9
+
+ddbast860 toEng 0.0E-0 -> 0.0
+ddbast861 toEng 0.0E-1 -> 0.00
+ddbast862 toEng 0.0E-2 -> 0.000
+ddbast863 toEng 0.0E-3 -> 0.0000
+ddbast864 toEng 0.0E-4 -> 0.00000
+ddbast865 toEng 0.0E-5 -> 0.000000
+ddbast866 toEng 0.0E-6 -> 0.0E-6
+ddbast867 toEng 0.0E-7 -> 0.00E-6
+ddbast868 toEng 0.0E-8 -> 0E-9
+ddbast869 toEng 0.0E-9 -> 0.0E-9
+
+ddbast870 toEng 0.00E-0 -> 0.00
+ddbast871 toEng 0.00E-1 -> 0.000
+ddbast872 toEng 0.00E-2 -> 0.0000
+ddbast873 toEng 0.00E-3 -> 0.00000
+ddbast874 toEng 0.00E-4 -> 0.000000
+ddbast875 toEng 0.00E-5 -> 0.0E-6
+ddbast876 toEng 0.00E-6 -> 0.00E-6
+ddbast877 toEng 0.00E-7 -> 0E-9
+ddbast878 toEng 0.00E-8 -> 0.0E-9
+ddbast879 toEng 0.00E-9 -> 0.00E-9
+
+-- long input strings
+ddbas801 tosci '01234567890123456' -> 1234567890123456
+ddbas802 tosci '001234567890123456' -> 1234567890123456
+ddbas803 tosci '0001234567890123456' -> 1234567890123456
+ddbas804 tosci '00001234567890123456' -> 1234567890123456
+ddbas805 tosci '000001234567890123456' -> 1234567890123456
+ddbas806 tosci '0000001234567890123456' -> 1234567890123456
+ddbas807 tosci '00000001234567890123456' -> 1234567890123456
+ddbas808 tosci '000000001234567890123456' -> 1234567890123456
+ddbas809 tosci '0000000001234567890123456' -> 1234567890123456
+ddbas810 tosci '00000000001234567890123456' -> 1234567890123456
+
+ddbas811 tosci '0.1234567890123456' -> 0.1234567890123456
+ddbas812 tosci '0.01234567890123456' -> 0.01234567890123456
+ddbas813 tosci '0.001234567890123456' -> 0.001234567890123456
+ddbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456
+ddbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456
+ddbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456
+ddbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7
+ddbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8
+ddbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9
+ddbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10
+
+ddbas821 tosci '12345678901234567890' -> 1.234567890123457E+19 Inexact Rounded
+ddbas822 tosci '123456789012345678901' -> 1.234567890123457E+20 Inexact Rounded
+ddbas823 tosci '1234567890123456789012' -> 1.234567890123457E+21 Inexact Rounded
+ddbas824 tosci '12345678901234567890123' -> 1.234567890123457E+22 Inexact Rounded
+ddbas825 tosci '123456789012345678901234' -> 1.234567890123457E+23 Inexact Rounded
+ddbas826 tosci '1234567890123456789012345' -> 1.234567890123457E+24 Inexact Rounded
+ddbas827 tosci '12345678901234567890123456' -> 1.234567890123457E+25 Inexact Rounded
+ddbas828 tosci '123456789012345678901234567' -> 1.234567890123457E+26 Inexact Rounded
+ddbas829 tosci '1234567890123456789012345678' -> 1.234567890123457E+27 Inexact Rounded
+
+-- subnormals and overflows
+ddbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
+ddbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
+ddbas908 toSci '0.9e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas909 toSci '0.09e-999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
+ddbas911 toSci '10e-1000000000' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
+ddbas913 toSci '99e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
+ddbas915 toSci '1111e-9999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas916 toSci '1111e-99999999999' -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
+-- negatives the same
+ddbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
+ddbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
+ddbas920 toSci '-0.9e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas921 toSci '-0.09e-999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
+ddbas923 toSci '-10e-1000000000' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
+ddbas925 toSci '-99e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
+ddbas927 toSci '-1111e-9999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas928 toSci '-1111e-99999999999' -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
+
+-- overflow results at different rounding modes
+rounding: ceiling
+ddbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas931 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded
+rounding: up
+ddbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: down
+ddbas934 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddbas935 toSci '-7e10000' -> -9.999999999999999E+384 Overflow Inexact Rounded
+rounding: floor
+ddbas936 toSci '7e10000' -> 9.999999999999999E+384 Overflow Inexact Rounded
+ddbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_up
+ddbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_even
+ddbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_down
+ddbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+ddbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_even
+
+-- Now check 854/754r some subnormals and underflow to 0
+ddbem400 toSci 1.0000E-383 -> 1.0000E-383
+ddbem401 toSci 0.1E-394 -> 1E-395 Subnormal
+ddbem402 toSci 0.1000E-394 -> 1.000E-395 Subnormal
+ddbem403 toSci 0.0100E-394 -> 1.00E-396 Subnormal
+ddbem404 toSci 0.0010E-394 -> 1.0E-397 Subnormal
+ddbem405 toSci 0.0001E-394 -> 1E-398 Subnormal
+ddbem406 toSci 0.00010E-394 -> 1E-398 Subnormal Rounded
+ddbem407 toSci 0.00013E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddbem408 toSci 0.00015E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem409 toSci 0.00017E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem410 toSci 0.00023E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem411 toSci 0.00025E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem412 toSci 0.00027E-394 -> 3E-398 Underflow Subnormal Inexact Rounded
+ddbem413 toSci 0.000149E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddbem414 toSci 0.000150E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem415 toSci 0.000151E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem416 toSci 0.000249E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem417 toSci 0.000250E-394 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddbem418 toSci 0.000251E-394 -> 3E-398 Underflow Subnormal Inexact Rounded
+ddbem419 toSci 0.00009E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddbem420 toSci 0.00005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem421 toSci 0.00003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem422 toSci 0.000009E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem423 toSci 0.000005E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem424 toSci 0.000003E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+ddbem425 toSci 0.001049E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
+ddbem426 toSci 0.001050E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
+ddbem427 toSci 0.001051E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded
+ddbem428 toSci 0.001149E-394 -> 1.1E-397 Underflow Subnormal Inexact Rounded
+ddbem429 toSci 0.001150E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded
+ddbem430 toSci 0.001151E-394 -> 1.2E-397 Underflow Subnormal Inexact Rounded
+
+ddbem432 toSci 0.010049E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
+ddbem433 toSci 0.010050E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
+ddbem434 toSci 0.010051E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded
+ddbem435 toSci 0.010149E-394 -> 1.01E-396 Underflow Subnormal Inexact Rounded
+ddbem436 toSci 0.010150E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded
+ddbem437 toSci 0.010151E-394 -> 1.02E-396 Underflow Subnormal Inexact Rounded
+
+ddbem440 toSci 0.10103E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded
+ddbem441 toSci 0.10105E-394 -> 1.010E-395 Underflow Subnormal Inexact Rounded
+ddbem442 toSci 0.10107E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded
+ddbem443 toSci 0.10113E-394 -> 1.011E-395 Underflow Subnormal Inexact Rounded
+ddbem444 toSci 0.10115E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded
+ddbem445 toSci 0.10117E-394 -> 1.012E-395 Underflow Subnormal Inexact Rounded
+
+ddbem450 toSci 1.10730E-395 -> 1.107E-395 Underflow Subnormal Inexact Rounded
+ddbem451 toSci 1.10750E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
+ddbem452 toSci 1.10770E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
+ddbem453 toSci 1.10830E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
+ddbem454 toSci 1.10850E-395 -> 1.108E-395 Underflow Subnormal Inexact Rounded
+ddbem455 toSci 1.10870E-395 -> 1.109E-395 Underflow Subnormal Inexact Rounded
+
+-- make sure sign OK
+ddbem456 toSci -0.10103E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded
+ddbem457 toSci -0.10105E-394 -> -1.010E-395 Underflow Subnormal Inexact Rounded
+ddbem458 toSci -0.10107E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded
+ddbem459 toSci -0.10113E-394 -> -1.011E-395 Underflow Subnormal Inexact Rounded
+ddbem460 toSci -0.10115E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded
+ddbem461 toSci -0.10117E-394 -> -1.012E-395 Underflow Subnormal Inexact Rounded
+
+-- '999s' cases
+ddbem464 toSci 999999E-395 -> 9.99999E-390 Subnormal
+ddbem465 toSci 99999.0E-394 -> 9.99990E-390 Subnormal
+ddbem466 toSci 99999.E-394 -> 9.9999E-390 Subnormal
+ddbem467 toSci 9999.9E-394 -> 9.9999E-391 Subnormal
+ddbem468 toSci 999.99E-394 -> 9.9999E-392 Subnormal
+ddbem469 toSci 99.999E-394 -> 9.9999E-393 Subnormal
+ddbem470 toSci 9.9999E-394 -> 9.9999E-394 Subnormal
+ddbem471 toSci 0.99999E-394 -> 1.0000E-394 Underflow Subnormal Inexact Rounded
+ddbem472 toSci 0.099999E-394 -> 1.000E-395 Underflow Subnormal Inexact Rounded
+ddbem473 toSci 0.0099999E-394 -> 1.00E-396 Underflow Subnormal Inexact Rounded
+ddbem474 toSci 0.00099999E-394 -> 1.0E-397 Underflow Subnormal Inexact Rounded
+ddbem475 toSci 0.000099999E-394 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddbem476 toSci 0.0000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem477 toSci 0.00000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbem478 toSci 0.000000099999E-394 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- Exponents with insignificant leading zeros
+ddbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
+ddbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
+ddbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
+ddbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
+ddbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
+ddbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
+ddbas1007 toSci 1e-999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1008 toSci 1e-0999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1009 toSci 1e-00999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1010 toSci 1e-000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1011 toSci 1e-000000000000999999999 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddbas1012 toSci 1e-000000000001000000007 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- check for double-rounded subnormals
+ddbas1041 toSci 1.1111111111152444E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
+ddbas1042 toSci 1.1111111111152445E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
+ddbas1043 toSci 1.1111111111152446E-384 -> 1.11111111111524E-384 Inexact Rounded Subnormal Underflow
+
+-- clamped large normals
+ddbas1070 toSci 1E+369 -> 1E+369
+ddbas1071 toSci 1E+370 -> 1.0E+370 Clamped
+ddbas1072 toSci 1E+378 -> 1.000000000E+378 Clamped
+ddbas1073 toSci 1E+384 -> 1.000000000000000E+384 Clamped
+ddbas1074 toSci 1E+385 -> Infinity Overflow Inexact Rounded
+
+
+-- clamped zeros [see also clamp.decTest]
+ddbas1075 toSci 0e+10000 -> 0E+369 Clamped
+ddbas1076 toSci 0e-10000 -> 0E-398 Clamped
+ddbas1077 toSci -0e+10000 -> -0E+369 Clamped
+ddbas1078 toSci -0e-10000 -> -0E-398 Clamped
+
+-- extreme values from next-wider
+ddbas1101 toSci -9.99999999999999999999999999999999E+6144 -> -Infinity Overflow Inexact Rounded
+ddbas1102 toSci -1E-6143 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped
+ddbas1103 toSci -1E-6176 -> -0E-398 Inexact Rounded Subnormal Underflow Clamped
+ddbas1104 toSci -0 -> -0
+ddbas1105 toSci +0 -> 0
+ddbas1106 toSci +1E-6176 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped
+ddbas1107 toSci +1E-6173 -> 0E-398 Inexact Rounded Subnormal Underflow Clamped
+ddbas1108 toSci +9.99999999999999999999999999999999E+6144 -> Infinity Overflow Inexact Rounded
+
diff --git a/Lib/test/decimaltestdata/ddCanonical.decTest b/Lib/test/decimaltestdata/ddCanonical.decTest
index 824de83aba..b4f9e32c98 100644
--- a/Lib/test/decimaltestdata/ddCanonical.decTest
+++ b/Lib/test/decimaltestdata/ddCanonical.decTest
@@ -1,357 +1,357 @@
-------------------------------------------------------------------------
--- ddCanonical.decTest -- test decDouble canonical results --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests that copy operations leave uncanonical operands
--- unchanged, and vice versa
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Uncanonical declets are: abc, where:
--- a=1,2,3
--- b=6,7,e,f
--- c=e,f
-
--- assert some standard (canonical) values; this tests that FromString
--- produces canonical results (many more in decimalNN)
-ddcan001 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
-ddcan002 apply 0 -> #2238000000000000
-ddcan003 apply 1 -> #2238000000000001
-ddcan004 apply -1 -> #a238000000000001
-ddcan005 apply Infinity -> #7800000000000000
-ddcan006 apply -Infinity -> #f800000000000000
-ddcan007 apply -NaN -> #fc00000000000000
-ddcan008 apply -sNaN -> #fe00000000000000
-ddcan009 apply NaN999999999999999 -> #7c00ff3fcff3fcff
-ddcan010 apply sNaN999999999999999 -> #7e00ff3fcff3fcff
-decan011 apply 9999999999999999 -> #6e38ff3fcff3fcff
-ddcan012 apply 7.50 -> #22300000000003d0
-ddcan013 apply 9.99 -> #22300000000000ff
-
--- Base tests for canonical encodings (individual operator
--- propagation is tested later)
-
--- Finites: declets in coefficient
-ddcan021 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan022 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan023 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan024 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan025 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
-ddcan026 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
-ddcan027 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
-ddcan028 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
-ddcan030 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
-ddcan031 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
-ddcan032 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
-ddcan033 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
-ddcan035 canonical #77fcff3fdff3fcff -> #77fcff3fcff3fcff
-ddcan036 canonical #77fcff3feff3fcff -> #77fcff3fcff3fcff
-
--- NaN: declets in payload
-ddcan100 canonical NaN999999999999999 -> #7c00ff3fcff3fcff
-ddcan101 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan102 canonical #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan103 canonical #7c00ffffcff3fcff -> #7c00ff3fcff3fcff
-ddcan104 canonical #7c00ff3ffff3fcff -> #7c00ff3fcff3fcff
-ddcan105 canonical #7c00ff3fcffffcff -> #7c00ff3fcff3fcff
-ddcan106 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
-ddcan107 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-ddcan110 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan112 canonical #7d00ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan113 canonical #7c80ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan114 canonical #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan115 canonical #7c20ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan116 canonical #7c10ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan117 canonical #7c08ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan118 canonical #7c04ff3fcff3fcff -> #7c00ff3fcff3fcff
-
--- sNaN: declets in payload
-ddcan120 canonical sNaN999999999999999 -> #7e00ff3fcff3fcff
-ddcan121 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan122 canonical #7e03ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan123 canonical #7e00ffffcff3fcff -> #7e00ff3fcff3fcff
-ddcan124 canonical #7e00ff3ffff3fcff -> #7e00ff3fcff3fcff
-ddcan125 canonical #7e00ff3fcffffcff -> #7e00ff3fcff3fcff
-ddcan126 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
-ddcan127 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
--- sNaN: exponent continuation bits [excluding sNaN selector]
-ddcan130 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan132 canonical #7f00ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan133 canonical #7e80ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan134 canonical #7e40ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan135 canonical #7e20ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan136 canonical #7e10ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan137 canonical #7e08ff3fcff3fcff -> #7e00ff3fcff3fcff
-ddcan138 canonical #7e04ff3fcff3fcff -> #7e00ff3fcff3fcff
-
--- Inf: exponent continuation bits
-ddcan140 canonical #7800000000000000 -> #7800000000000000
-ddcan141 canonical #7900000000000000 -> #7800000000000000
-ddcan142 canonical #7a00000000000000 -> #7800000000000000
-ddcan143 canonical #7880000000000000 -> #7800000000000000
-ddcan144 canonical #7840000000000000 -> #7800000000000000
-ddcan145 canonical #7820000000000000 -> #7800000000000000
-ddcan146 canonical #7810000000000000 -> #7800000000000000
-ddcan147 canonical #7808000000000000 -> #7800000000000000
-ddcan148 canonical #7804000000000000 -> #7800000000000000
-
--- Inf: coefficient continuation bits (first, last, and a few others)
-ddcan150 canonical #7800000000000000 -> #7800000000000000
-ddcan151 canonical #7802000000000000 -> #7800000000000000
-ddcan152 canonical #7800000000000001 -> #7800000000000000
-ddcan153 canonical #7801000000000000 -> #7800000000000000
-ddcan154 canonical #7800200000000000 -> #7800000000000000
-ddcan155 canonical #7800080000000000 -> #7800000000000000
-ddcan156 canonical #7800002000000000 -> #7800000000000000
-ddcan157 canonical #7800000400000000 -> #7800000000000000
-ddcan158 canonical #7800000040000000 -> #7800000000000000
-ddcan159 canonical #7800000008000000 -> #7800000000000000
-ddcan160 canonical #7800000000400000 -> #7800000000000000
-ddcan161 canonical #7800000000020000 -> #7800000000000000
-ddcan162 canonical #7800000000008000 -> #7800000000000000
-ddcan163 canonical #7800000000000200 -> #7800000000000000
-ddcan164 canonical #7800000000000040 -> #7800000000000000
-ddcan165 canonical #7800000000000008 -> #7800000000000000
-
-
--- Now the operators -- trying to check paths that might fail to
--- canonicalize propagated operands
-
------ Add:
--- Finites: neutral 0
-ddcan202 add 0E+384 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan203 add #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
--- tiny zero
-ddcan204 add 0E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Rounded
-ddcan205 add #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
--- tiny non zero
-ddcan206 add -1E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Inexact Rounded
-ddcan207 add #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
--- NaN: declets in payload
-ddcan211 add 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan212 add #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-ddcan213 add 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan214 add #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
--- sNaN: declets in payload
-ddcan215 add 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan216 add #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-ddcan217 add 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan218 add #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-ddcan220 add 0 #7880000000000000 -> #7800000000000000
-ddcan221 add #7880000000000000 0 -> #7800000000000000
--- Inf: coefficient continuation bits
-ddcan222 add 0 #7802000000000000 -> #7800000000000000
-ddcan223 add #7802000000000000 0 -> #7800000000000000
-ddcan224 add 0 #7800000000000001 -> #7800000000000000
-ddcan225 add #7800000000000001 0 -> #7800000000000000
-ddcan226 add 0 #7800002000000000 -> #7800000000000000
-ddcan227 add #7800002000000000 0 -> #7800000000000000
-
------ Class: [does not return encoded]
-
------ Compare:
-ddcan231 compare -Inf 1 -> #a238000000000001
-ddcan232 compare -Inf -Inf -> #2238000000000000
-ddcan233 compare 1 -Inf -> #2238000000000001
-ddcan234 compare #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff
-ddcan235 compare #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
-
------ CompareSig:
-ddcan241 comparesig -Inf 1 -> #a238000000000001
-ddcan242 comparesig -Inf -Inf -> #2238000000000000
-ddcan243 comparesig 1 -Inf -> #2238000000000001
-ddcan244 comparesig #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
-ddcan245 comparesig #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
-
------ Copy: [does not usually canonicalize]
--- finites
-ddcan250 copy #77ffff3fcff3fcff -> #77ffff3fcff3fcff
-ddcan251 copy #77fcff3fdff3fcff -> #77fcff3fdff3fcff
--- NaNs
-ddcan252 copy #7c03ff3fcff3fcff -> #7c03ff3fcff3fcff
-ddcan253 copy #7c00ff3fcff3ffff -> #7c00ff3fcff3ffff
-ddcan254 copy #7d00ff3fcff3fcff -> #7d00ff3fcff3fcff
-ddcan255 copy #7c04ff3fcff3fcff -> #7c04ff3fcff3fcff
--- sNaN
-ddcan256 copy #7e00ff3fcffffcff -> #7e00ff3fcffffcff
-ddcan257 copy #7e40ff3fcff3fcff -> #7e40ff3fcff3fcff
--- Inf
-ddcan258 copy #7a00000000000000 -> #7a00000000000000
-ddcan259 copy #7800200000000000 -> #7800200000000000
-
------ CopyAbs: [does not usually canonicalize]
--- finites
-ddcan260 copyabs #f7ffff3fcff3fcff -> #77ffff3fcff3fcff
-ddcan261 copyabs #f7fcff3fdff3fcff -> #77fcff3fdff3fcff
--- NaNs
-ddcan262 copyabs #fc03ff3fcff3fcff -> #7c03ff3fcff3fcff
-ddcan263 copyabs #fc00ff3fcff3ffff -> #7c00ff3fcff3ffff
-ddcan264 copyabs #fd00ff3fcff3fcff -> #7d00ff3fcff3fcff
-ddcan265 copyabs #fc04ff3fcff3fcff -> #7c04ff3fcff3fcff
--- sNaN
-ddcan266 copyabs #fe00ff3fcffffcff -> #7e00ff3fcffffcff
-ddcan267 copyabs #fe40ff3fcff3fcff -> #7e40ff3fcff3fcff
--- Inf
-ddcan268 copyabs #fa00000000000000 -> #7a00000000000000
-ddcan269 copyabs #f800200000000000 -> #7800200000000000
-
------ CopyNegate: [does not usually canonicalize]
--- finites
-ddcan270 copynegate #77ffff3fcff3fcff -> #f7ffff3fcff3fcff
-ddcan271 copynegate #77fcff3fdff3fcff -> #f7fcff3fdff3fcff
--- NaNs
-ddcan272 copynegate #7c03ff3fcff3fcff -> #fc03ff3fcff3fcff
-ddcan273 copynegate #7c00ff3fcff3ffff -> #fc00ff3fcff3ffff
-ddcan274 copynegate #7d00ff3fcff3fcff -> #fd00ff3fcff3fcff
-ddcan275 copynegate #7c04ff3fcff3fcff -> #fc04ff3fcff3fcff
--- sNaN
-ddcan276 copynegate #7e00ff3fcffffcff -> #fe00ff3fcffffcff
-ddcan277 copynegate #7e40ff3fcff3fcff -> #fe40ff3fcff3fcff
--- Inf
-ddcan278 copynegate #7a00000000000000 -> #fa00000000000000
-ddcan279 copynegate #7800200000000000 -> #f800200000000000
-
------ CopySign: [does not usually canonicalize]
--- finites
-ddcan280 copysign #77ffff3fcff3fcff -1 -> #f7ffff3fcff3fcff
-ddcan281 copysign #77fcff3fdff3fcff 1 -> #77fcff3fdff3fcff
--- NaNs
-ddcan282 copysign #7c03ff3fcff3fcff -1 -> #fc03ff3fcff3fcff
-ddcan283 copysign #7c00ff3fcff3ffff 1 -> #7c00ff3fcff3ffff
-ddcan284 copysign #7d00ff3fcff3fcff -1 -> #fd00ff3fcff3fcff
-ddcan285 copysign #7c04ff3fcff3fcff 1 -> #7c04ff3fcff3fcff
--- sNaN
-ddcan286 copysign #7e00ff3fcffffcff -1 -> #fe00ff3fcffffcff
-ddcan287 copysign #7e40ff3fcff3fcff 1 -> #7e40ff3fcff3fcff
--- Inf
-ddcan288 copysign #7a00000000000000 -1 -> #fa00000000000000
-ddcan289 copysign #7800200000000000 1 -> #7800200000000000
-
------ Multiply:
--- Finites: neutral 0
-ddcan302 multiply 1 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
-ddcan303 multiply #77fcffffcff3fcff 1 -> #77fcff3fcff3fcff
--- negative
-ddcan306 multiply -1 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
-ddcan307 multiply #77fcffffcff3fcff -1 -> #f7fcff3fcff3fcff
--- NaN: declets in payload
-ddcan311 multiply 1 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan312 multiply #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-ddcan313 multiply 1 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan314 multiply #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
--- sNaN: declets in payload
-ddcan315 multiply 1 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan316 multiply #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-ddcan317 multiply 1 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan318 multiply #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-ddcan320 multiply 1 #7880000000000000 -> #7800000000000000
-ddcan321 multiply #7880000000000000 1 -> #7800000000000000
--- Inf: coefficient continuation bits
-ddcan322 multiply 1 #7802000000000000 -> #7800000000000000
-ddcan323 multiply #7802000000000000 1 -> #7800000000000000
-ddcan324 multiply 1 #7800000000000001 -> #7800000000000000
-ddcan325 multiply #7800000000000001 1 -> #7800000000000000
-ddcan326 multiply 1 #7800002000000000 -> #7800000000000000
-ddcan327 multiply #7800002000000000 1 -> #7800000000000000
-
------ Quantize:
-ddcan401 quantize #6e38ff3ffff3fcff 1 -> #6e38ff3fcff3fcff
-ddcan402 quantize #6e38ff3fcff3fdff 0 -> #6e38ff3fcff3fcff
-ddcan403 quantize #7880000000000000 Inf -> #7800000000000000
-ddcan404 quantize #7802000000000000 -Inf -> #7800000000000000
-ddcan410 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
-ddcan411 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
-ddcan412 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
-ddcan413 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
-ddcan414 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
-ddcan415 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
-ddcan416 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
-ddcan417 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
-
------ Subtract:
--- Finites: neutral 0
-ddcan502 subtract 0E+384 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
-ddcan503 subtract #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
--- tiny zero
-ddcan504 subtract 0E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Rounded
-ddcan505 subtract #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
--- tiny non zero
-ddcan506 subtract -1E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Inexact Rounded
-ddcan507 subtract #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
--- NaN: declets in payload
-ddcan511 subtract 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan512 subtract #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-ddcan513 subtract 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan514 subtract #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
--- sNaN: declets in payload
-ddcan515 subtract 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan516 subtract #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-ddcan517 subtract 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan518 subtract #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-ddcan520 subtract 0 #7880000000000000 -> #f800000000000000
-ddcan521 subtract #7880000000000000 0 -> #7800000000000000
--- Inf: coefficient continuation bits
-ddcan522 subtract 0 #7802000000000000 -> #f800000000000000
-ddcan523 subtract #7802000000000000 0 -> #7800000000000000
-ddcan524 subtract 0 #7800000000000001 -> #f800000000000000
-ddcan525 subtract #7800000000000001 0 -> #7800000000000000
-ddcan526 subtract 0 #7800002000000000 -> #f800000000000000
-ddcan527 subtract #7800002000000000 0 -> #7800000000000000
-
------ ToIntegral:
-ddcan601 tointegralx #6e38ff3ffff3fcff -> #6e38ff3fcff3fcff
-ddcan602 tointegralx #6e38ff3fcff3fdff -> #6e38ff3fcff3fcff
-ddcan603 tointegralx #7880000000000000 -> #7800000000000000
-ddcan604 tointegralx #7802000000000000 -> #7800000000000000
-ddcan610 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan611 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan612 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan613 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
-ddcan614 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan615 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan616 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
-ddcan617 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
--- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
-ddcan618 tointegralx #2238000000000fff -> #2238000000000cff
-ddcan619 tointegralx #2230000000000fff -> #2238000000000040 Inexact Rounded
-ddcan620 tointegralx #222c000000000fff -> #2238000000000004 Inexact Rounded
-ddcan621 tointegralx #2228000000000fff -> #2238000000000000 Inexact Rounded
-ddcan622 tointegralx #a238000000000fff -> #a238000000000cff
-ddcan623 tointegralx #a230000000000fff -> #a238000000000040 Inexact Rounded
-ddcan624 tointegralx #a22c000000000fff -> #a238000000000004 Inexact Rounded
-ddcan625 tointegralx #a228000000000fff -> #a238000000000000 Inexact Rounded
-
-
-
+------------------------------------------------------------------------
+-- ddCanonical.decTest -- test decDouble canonical results --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests that copy operations leave uncanonical operands
+-- unchanged, and vice versa
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Uncanonical declets are: abc, where:
+-- a=1,2,3
+-- b=6,7,e,f
+-- c=e,f
+
+-- assert some standard (canonical) values; this tests that FromString
+-- produces canonical results (many more in decimalNN)
+ddcan001 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
+ddcan002 apply 0 -> #2238000000000000
+ddcan003 apply 1 -> #2238000000000001
+ddcan004 apply -1 -> #a238000000000001
+ddcan005 apply Infinity -> #7800000000000000
+ddcan006 apply -Infinity -> #f800000000000000
+ddcan007 apply -NaN -> #fc00000000000000
+ddcan008 apply -sNaN -> #fe00000000000000
+ddcan009 apply NaN999999999999999 -> #7c00ff3fcff3fcff
+ddcan010 apply sNaN999999999999999 -> #7e00ff3fcff3fcff
+decan011 apply 9999999999999999 -> #6e38ff3fcff3fcff
+ddcan012 apply 7.50 -> #22300000000003d0
+ddcan013 apply 9.99 -> #22300000000000ff
+
+-- Base tests for canonical encodings (individual operator
+-- propagation is tested later)
+
+-- Finites: declets in coefficient
+ddcan021 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan022 canonical #77fcff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan023 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan024 canonical #77ffff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan025 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
+ddcan026 canonical #77fcffffcff3fcff -> #77fcff3fcff3fcff
+ddcan027 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
+ddcan028 canonical #77fcff3ffff3fcff -> #77fcff3fcff3fcff
+ddcan030 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
+ddcan031 canonical #77fcff3fcffffcff -> #77fcff3fcff3fcff
+ddcan032 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
+ddcan033 canonical #77fcff3fcff3ffff -> #77fcff3fcff3fcff
+ddcan035 canonical #77fcff3fdff3fcff -> #77fcff3fcff3fcff
+ddcan036 canonical #77fcff3feff3fcff -> #77fcff3fcff3fcff
+
+-- NaN: declets in payload
+ddcan100 canonical NaN999999999999999 -> #7c00ff3fcff3fcff
+ddcan101 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan102 canonical #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan103 canonical #7c00ffffcff3fcff -> #7c00ff3fcff3fcff
+ddcan104 canonical #7c00ff3ffff3fcff -> #7c00ff3fcff3fcff
+ddcan105 canonical #7c00ff3fcffffcff -> #7c00ff3fcff3fcff
+ddcan106 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
+ddcan107 canonical #7c00ff3fcff3ffff -> #7c00ff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+ddcan110 canonical #7c00ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan112 canonical #7d00ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan113 canonical #7c80ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan114 canonical #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan115 canonical #7c20ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan116 canonical #7c10ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan117 canonical #7c08ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan118 canonical #7c04ff3fcff3fcff -> #7c00ff3fcff3fcff
+
+-- sNaN: declets in payload
+ddcan120 canonical sNaN999999999999999 -> #7e00ff3fcff3fcff
+ddcan121 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan122 canonical #7e03ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan123 canonical #7e00ffffcff3fcff -> #7e00ff3fcff3fcff
+ddcan124 canonical #7e00ff3ffff3fcff -> #7e00ff3fcff3fcff
+ddcan125 canonical #7e00ff3fcffffcff -> #7e00ff3fcff3fcff
+ddcan126 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
+ddcan127 canonical #7e00ff3fcff3ffff -> #7e00ff3fcff3fcff
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+ddcan130 canonical #7e00ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan132 canonical #7f00ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan133 canonical #7e80ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan134 canonical #7e40ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan135 canonical #7e20ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan136 canonical #7e10ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan137 canonical #7e08ff3fcff3fcff -> #7e00ff3fcff3fcff
+ddcan138 canonical #7e04ff3fcff3fcff -> #7e00ff3fcff3fcff
+
+-- Inf: exponent continuation bits
+ddcan140 canonical #7800000000000000 -> #7800000000000000
+ddcan141 canonical #7900000000000000 -> #7800000000000000
+ddcan142 canonical #7a00000000000000 -> #7800000000000000
+ddcan143 canonical #7880000000000000 -> #7800000000000000
+ddcan144 canonical #7840000000000000 -> #7800000000000000
+ddcan145 canonical #7820000000000000 -> #7800000000000000
+ddcan146 canonical #7810000000000000 -> #7800000000000000
+ddcan147 canonical #7808000000000000 -> #7800000000000000
+ddcan148 canonical #7804000000000000 -> #7800000000000000
+
+-- Inf: coefficient continuation bits (first, last, and a few others)
+ddcan150 canonical #7800000000000000 -> #7800000000000000
+ddcan151 canonical #7802000000000000 -> #7800000000000000
+ddcan152 canonical #7800000000000001 -> #7800000000000000
+ddcan153 canonical #7801000000000000 -> #7800000000000000
+ddcan154 canonical #7800200000000000 -> #7800000000000000
+ddcan155 canonical #7800080000000000 -> #7800000000000000
+ddcan156 canonical #7800002000000000 -> #7800000000000000
+ddcan157 canonical #7800000400000000 -> #7800000000000000
+ddcan158 canonical #7800000040000000 -> #7800000000000000
+ddcan159 canonical #7800000008000000 -> #7800000000000000
+ddcan160 canonical #7800000000400000 -> #7800000000000000
+ddcan161 canonical #7800000000020000 -> #7800000000000000
+ddcan162 canonical #7800000000008000 -> #7800000000000000
+ddcan163 canonical #7800000000000200 -> #7800000000000000
+ddcan164 canonical #7800000000000040 -> #7800000000000000
+ddcan165 canonical #7800000000000008 -> #7800000000000000
+
+
+-- Now the operators -- trying to check paths that might fail to
+-- canonicalize propagated operands
+
+----- Add:
+-- Finites: neutral 0
+ddcan202 add 0E+384 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan203 add #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
+-- tiny zero
+ddcan204 add 0E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Rounded
+ddcan205 add #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
+-- tiny non zero
+ddcan206 add -1E-398 #77ffff3fcff3fcff -> #77fcff3fcff3fcff Inexact Rounded
+ddcan207 add #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
+-- NaN: declets in payload
+ddcan211 add 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan212 add #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+ddcan213 add 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan214 add #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
+-- sNaN: declets in payload
+ddcan215 add 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan216 add #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+ddcan217 add 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan218 add #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+ddcan220 add 0 #7880000000000000 -> #7800000000000000
+ddcan221 add #7880000000000000 0 -> #7800000000000000
+-- Inf: coefficient continuation bits
+ddcan222 add 0 #7802000000000000 -> #7800000000000000
+ddcan223 add #7802000000000000 0 -> #7800000000000000
+ddcan224 add 0 #7800000000000001 -> #7800000000000000
+ddcan225 add #7800000000000001 0 -> #7800000000000000
+ddcan226 add 0 #7800002000000000 -> #7800000000000000
+ddcan227 add #7800002000000000 0 -> #7800000000000000
+
+----- Class: [does not return encoded]
+
+----- Compare:
+ddcan231 compare -Inf 1 -> #a238000000000001
+ddcan232 compare -Inf -Inf -> #2238000000000000
+ddcan233 compare 1 -Inf -> #2238000000000001
+ddcan234 compare #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff
+ddcan235 compare #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
+
+----- CompareSig:
+ddcan241 comparesig -Inf 1 -> #a238000000000001
+ddcan242 comparesig -Inf -Inf -> #2238000000000000
+ddcan243 comparesig 1 -Inf -> #2238000000000001
+ddcan244 comparesig #7c00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
+ddcan245 comparesig #7e00ff3ffff3fcff -1000 -> #7c00ff3fcff3fcff Invalid_operation
+
+----- Copy: [does not usually canonicalize]
+-- finites
+ddcan250 copy #77ffff3fcff3fcff -> #77ffff3fcff3fcff
+ddcan251 copy #77fcff3fdff3fcff -> #77fcff3fdff3fcff
+-- NaNs
+ddcan252 copy #7c03ff3fcff3fcff -> #7c03ff3fcff3fcff
+ddcan253 copy #7c00ff3fcff3ffff -> #7c00ff3fcff3ffff
+ddcan254 copy #7d00ff3fcff3fcff -> #7d00ff3fcff3fcff
+ddcan255 copy #7c04ff3fcff3fcff -> #7c04ff3fcff3fcff
+-- sNaN
+ddcan256 copy #7e00ff3fcffffcff -> #7e00ff3fcffffcff
+ddcan257 copy #7e40ff3fcff3fcff -> #7e40ff3fcff3fcff
+-- Inf
+ddcan258 copy #7a00000000000000 -> #7a00000000000000
+ddcan259 copy #7800200000000000 -> #7800200000000000
+
+----- CopyAbs: [does not usually canonicalize]
+-- finites
+ddcan260 copyabs #f7ffff3fcff3fcff -> #77ffff3fcff3fcff
+ddcan261 copyabs #f7fcff3fdff3fcff -> #77fcff3fdff3fcff
+-- NaNs
+ddcan262 copyabs #fc03ff3fcff3fcff -> #7c03ff3fcff3fcff
+ddcan263 copyabs #fc00ff3fcff3ffff -> #7c00ff3fcff3ffff
+ddcan264 copyabs #fd00ff3fcff3fcff -> #7d00ff3fcff3fcff
+ddcan265 copyabs #fc04ff3fcff3fcff -> #7c04ff3fcff3fcff
+-- sNaN
+ddcan266 copyabs #fe00ff3fcffffcff -> #7e00ff3fcffffcff
+ddcan267 copyabs #fe40ff3fcff3fcff -> #7e40ff3fcff3fcff
+-- Inf
+ddcan268 copyabs #fa00000000000000 -> #7a00000000000000
+ddcan269 copyabs #f800200000000000 -> #7800200000000000
+
+----- CopyNegate: [does not usually canonicalize]
+-- finites
+ddcan270 copynegate #77ffff3fcff3fcff -> #f7ffff3fcff3fcff
+ddcan271 copynegate #77fcff3fdff3fcff -> #f7fcff3fdff3fcff
+-- NaNs
+ddcan272 copynegate #7c03ff3fcff3fcff -> #fc03ff3fcff3fcff
+ddcan273 copynegate #7c00ff3fcff3ffff -> #fc00ff3fcff3ffff
+ddcan274 copynegate #7d00ff3fcff3fcff -> #fd00ff3fcff3fcff
+ddcan275 copynegate #7c04ff3fcff3fcff -> #fc04ff3fcff3fcff
+-- sNaN
+ddcan276 copynegate #7e00ff3fcffffcff -> #fe00ff3fcffffcff
+ddcan277 copynegate #7e40ff3fcff3fcff -> #fe40ff3fcff3fcff
+-- Inf
+ddcan278 copynegate #7a00000000000000 -> #fa00000000000000
+ddcan279 copynegate #7800200000000000 -> #f800200000000000
+
+----- CopySign: [does not usually canonicalize]
+-- finites
+ddcan280 copysign #77ffff3fcff3fcff -1 -> #f7ffff3fcff3fcff
+ddcan281 copysign #77fcff3fdff3fcff 1 -> #77fcff3fdff3fcff
+-- NaNs
+ddcan282 copysign #7c03ff3fcff3fcff -1 -> #fc03ff3fcff3fcff
+ddcan283 copysign #7c00ff3fcff3ffff 1 -> #7c00ff3fcff3ffff
+ddcan284 copysign #7d00ff3fcff3fcff -1 -> #fd00ff3fcff3fcff
+ddcan285 copysign #7c04ff3fcff3fcff 1 -> #7c04ff3fcff3fcff
+-- sNaN
+ddcan286 copysign #7e00ff3fcffffcff -1 -> #fe00ff3fcffffcff
+ddcan287 copysign #7e40ff3fcff3fcff 1 -> #7e40ff3fcff3fcff
+-- Inf
+ddcan288 copysign #7a00000000000000 -1 -> #fa00000000000000
+ddcan289 copysign #7800200000000000 1 -> #7800200000000000
+
+----- Multiply:
+-- Finites: neutral 0
+ddcan302 multiply 1 #77ffff3fcff3fcff -> #77fcff3fcff3fcff
+ddcan303 multiply #77fcffffcff3fcff 1 -> #77fcff3fcff3fcff
+-- negative
+ddcan306 multiply -1 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
+ddcan307 multiply #77fcffffcff3fcff -1 -> #f7fcff3fcff3fcff
+-- NaN: declets in payload
+ddcan311 multiply 1 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan312 multiply #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+ddcan313 multiply 1 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan314 multiply #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+-- sNaN: declets in payload
+ddcan315 multiply 1 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan316 multiply #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+ddcan317 multiply 1 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan318 multiply #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+ddcan320 multiply 1 #7880000000000000 -> #7800000000000000
+ddcan321 multiply #7880000000000000 1 -> #7800000000000000
+-- Inf: coefficient continuation bits
+ddcan322 multiply 1 #7802000000000000 -> #7800000000000000
+ddcan323 multiply #7802000000000000 1 -> #7800000000000000
+ddcan324 multiply 1 #7800000000000001 -> #7800000000000000
+ddcan325 multiply #7800000000000001 1 -> #7800000000000000
+ddcan326 multiply 1 #7800002000000000 -> #7800000000000000
+ddcan327 multiply #7800002000000000 1 -> #7800000000000000
+
+----- Quantize:
+ddcan401 quantize #6e38ff3ffff3fcff 1 -> #6e38ff3fcff3fcff
+ddcan402 quantize #6e38ff3fcff3fdff 0 -> #6e38ff3fcff3fcff
+ddcan403 quantize #7880000000000000 Inf -> #7800000000000000
+ddcan404 quantize #7802000000000000 -Inf -> #7800000000000000
+ddcan410 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+ddcan411 quantize #7c03ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+ddcan412 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+ddcan413 quantize #7c40ff3fcff3fcff 1 -> #7c00ff3fcff3fcff
+ddcan414 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+ddcan415 quantize #7e00ffffcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+ddcan416 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+ddcan417 quantize #7e80ff3fcff3fcff 1 -> #7c00ff3fcff3fcff Invalid_operation
+
+----- Subtract:
+-- Finites: neutral 0
+ddcan502 subtract 0E+384 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff
+ddcan503 subtract #77fcffffcff3fcff 0E+384 -> #77fcff3fcff3fcff
+-- tiny zero
+ddcan504 subtract 0E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Rounded
+ddcan505 subtract #77fcffffcff3fcff 0E-398 -> #77fcff3fcff3fcff Rounded
+-- tiny non zero
+ddcan506 subtract -1E-398 #77ffff3fcff3fcff -> #f7fcff3fcff3fcff Inexact Rounded
+ddcan507 subtract #77ffff3fcff3fcff -1E-398 -> #77fcff3fcff3fcff Inexact Rounded
+-- NaN: declets in payload
+ddcan511 subtract 0 #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan512 subtract #7c03ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+ddcan513 subtract 0 #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan514 subtract #7c40ff3fcff3fcff 0 -> #7c00ff3fcff3fcff
+-- sNaN: declets in payload
+ddcan515 subtract 0 #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan516 subtract #7e00ffffcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+ddcan517 subtract 0 #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan518 subtract #7e80ff3fcff3fcff 0 -> #7c00ff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+ddcan520 subtract 0 #7880000000000000 -> #f800000000000000
+ddcan521 subtract #7880000000000000 0 -> #7800000000000000
+-- Inf: coefficient continuation bits
+ddcan522 subtract 0 #7802000000000000 -> #f800000000000000
+ddcan523 subtract #7802000000000000 0 -> #7800000000000000
+ddcan524 subtract 0 #7800000000000001 -> #f800000000000000
+ddcan525 subtract #7800000000000001 0 -> #7800000000000000
+ddcan526 subtract 0 #7800002000000000 -> #f800000000000000
+ddcan527 subtract #7800002000000000 0 -> #7800000000000000
+
+----- ToIntegral:
+ddcan601 tointegralx #6e38ff3ffff3fcff -> #6e38ff3fcff3fcff
+ddcan602 tointegralx #6e38ff3fcff3fdff -> #6e38ff3fcff3fcff
+ddcan603 tointegralx #7880000000000000 -> #7800000000000000
+ddcan604 tointegralx #7802000000000000 -> #7800000000000000
+ddcan610 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan611 tointegralx #7c03ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan612 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan613 tointegralx #7c40ff3fcff3fcff -> #7c00ff3fcff3fcff
+ddcan614 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan615 tointegralx #7e00ffffcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan616 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+ddcan617 tointegralx #7e80ff3fcff3fcff -> #7c00ff3fcff3fcff Invalid_operation
+-- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
+ddcan618 tointegralx #2238000000000fff -> #2238000000000cff
+ddcan619 tointegralx #2230000000000fff -> #2238000000000040 Inexact Rounded
+ddcan620 tointegralx #222c000000000fff -> #2238000000000004 Inexact Rounded
+ddcan621 tointegralx #2228000000000fff -> #2238000000000000 Inexact Rounded
+ddcan622 tointegralx #a238000000000fff -> #a238000000000cff
+ddcan623 tointegralx #a230000000000fff -> #a238000000000040 Inexact Rounded
+ddcan624 tointegralx #a22c000000000fff -> #a238000000000004 Inexact Rounded
+ddcan625 tointegralx #a228000000000fff -> #a238000000000000 Inexact Rounded
+
+
+
diff --git a/Lib/test/decimaltestdata/ddClass.decTest b/Lib/test/decimaltestdata/ddClass.decTest
index a1d233b86d..bb34c42d4a 100644
--- a/Lib/test/decimaltestdata/ddClass.decTest
+++ b/Lib/test/decimaltestdata/ddClass.decTest
@@ -1,76 +1,76 @@
-------------------------------------------------------------------------
--- ddClass.decTest -- decDouble Class operations --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- [New 2006.11.27]
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddcla001 class 0 -> +Zero
-ddcla002 class 0.00 -> +Zero
-ddcla003 class 0E+5 -> +Zero
-ddcla004 class 1E-396 -> +Subnormal
-ddcla005 class 0.1E-383 -> +Subnormal
-ddcla006 class 0.999999999999999E-383 -> +Subnormal
-ddcla007 class 1.000000000000000E-383 -> +Normal
-ddcla008 class 1E-383 -> +Normal
-ddcla009 class 1E-100 -> +Normal
-ddcla010 class 1E-10 -> +Normal
-ddcla012 class 1E-1 -> +Normal
-ddcla013 class 1 -> +Normal
-ddcla014 class 2.50 -> +Normal
-ddcla015 class 100.100 -> +Normal
-ddcla016 class 1E+30 -> +Normal
-ddcla017 class 1E+384 -> +Normal
-ddcla018 class 9.999999999999999E+384 -> +Normal
-ddcla019 class Inf -> +Infinity
-
-ddcla021 class -0 -> -Zero
-ddcla022 class -0.00 -> -Zero
-ddcla023 class -0E+5 -> -Zero
-ddcla024 class -1E-396 -> -Subnormal
-ddcla025 class -0.1E-383 -> -Subnormal
-ddcla026 class -0.999999999999999E-383 -> -Subnormal
-ddcla027 class -1.000000000000000E-383 -> -Normal
-ddcla028 class -1E-383 -> -Normal
-ddcla029 class -1E-100 -> -Normal
-ddcla030 class -1E-10 -> -Normal
-ddcla032 class -1E-1 -> -Normal
-ddcla033 class -1 -> -Normal
-ddcla034 class -2.50 -> -Normal
-ddcla035 class -100.100 -> -Normal
-ddcla036 class -1E+30 -> -Normal
-ddcla037 class -1E+384 -> -Normal
-ddcla038 class -9.999999999999999E+384 -> -Normal
-ddcla039 class -Inf -> -Infinity
-
-ddcla041 class NaN -> NaN
-ddcla042 class -NaN -> NaN
-ddcla043 class +NaN12345 -> NaN
-ddcla044 class sNaN -> sNaN
-ddcla045 class -sNaN -> sNaN
-ddcla046 class +sNaN12345 -> sNaN
-
-
-
+------------------------------------------------------------------------
+-- ddClass.decTest -- decDouble Class operations --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- [New 2006.11.27]
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddcla001 class 0 -> +Zero
+ddcla002 class 0.00 -> +Zero
+ddcla003 class 0E+5 -> +Zero
+ddcla004 class 1E-396 -> +Subnormal
+ddcla005 class 0.1E-383 -> +Subnormal
+ddcla006 class 0.999999999999999E-383 -> +Subnormal
+ddcla007 class 1.000000000000000E-383 -> +Normal
+ddcla008 class 1E-383 -> +Normal
+ddcla009 class 1E-100 -> +Normal
+ddcla010 class 1E-10 -> +Normal
+ddcla012 class 1E-1 -> +Normal
+ddcla013 class 1 -> +Normal
+ddcla014 class 2.50 -> +Normal
+ddcla015 class 100.100 -> +Normal
+ddcla016 class 1E+30 -> +Normal
+ddcla017 class 1E+384 -> +Normal
+ddcla018 class 9.999999999999999E+384 -> +Normal
+ddcla019 class Inf -> +Infinity
+
+ddcla021 class -0 -> -Zero
+ddcla022 class -0.00 -> -Zero
+ddcla023 class -0E+5 -> -Zero
+ddcla024 class -1E-396 -> -Subnormal
+ddcla025 class -0.1E-383 -> -Subnormal
+ddcla026 class -0.999999999999999E-383 -> -Subnormal
+ddcla027 class -1.000000000000000E-383 -> -Normal
+ddcla028 class -1E-383 -> -Normal
+ddcla029 class -1E-100 -> -Normal
+ddcla030 class -1E-10 -> -Normal
+ddcla032 class -1E-1 -> -Normal
+ddcla033 class -1 -> -Normal
+ddcla034 class -2.50 -> -Normal
+ddcla035 class -100.100 -> -Normal
+ddcla036 class -1E+30 -> -Normal
+ddcla037 class -1E+384 -> -Normal
+ddcla038 class -9.999999999999999E+384 -> -Normal
+ddcla039 class -Inf -> -Infinity
+
+ddcla041 class NaN -> NaN
+ddcla042 class -NaN -> NaN
+ddcla043 class +NaN12345 -> NaN
+ddcla044 class sNaN -> sNaN
+ddcla045 class -sNaN -> sNaN
+ddcla046 class +sNaN12345 -> sNaN
+
+
+
diff --git a/Lib/test/decimaltestdata/ddCompare.decTest b/Lib/test/decimaltestdata/ddCompare.decTest
index a20ae210cc..6debfc7a13 100644
--- a/Lib/test/decimaltestdata/ddCompare.decTest
+++ b/Lib/test/decimaltestdata/ddCompare.decTest
@@ -1,744 +1,744 @@
-------------------------------------------------------------------------
--- ddCompare.decTest -- decDouble comparison that allows quiet NaNs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddcom001 compare -2 -2 -> 0
-ddcom002 compare -2 -1 -> -1
-ddcom003 compare -2 0 -> -1
-ddcom004 compare -2 1 -> -1
-ddcom005 compare -2 2 -> -1
-ddcom006 compare -1 -2 -> 1
-ddcom007 compare -1 -1 -> 0
-ddcom008 compare -1 0 -> -1
-ddcom009 compare -1 1 -> -1
-ddcom010 compare -1 2 -> -1
-ddcom011 compare 0 -2 -> 1
-ddcom012 compare 0 -1 -> 1
-ddcom013 compare 0 0 -> 0
-ddcom014 compare 0 1 -> -1
-ddcom015 compare 0 2 -> -1
-ddcom016 compare 1 -2 -> 1
-ddcom017 compare 1 -1 -> 1
-ddcom018 compare 1 0 -> 1
-ddcom019 compare 1 1 -> 0
-ddcom020 compare 1 2 -> -1
-ddcom021 compare 2 -2 -> 1
-ddcom022 compare 2 -1 -> 1
-ddcom023 compare 2 0 -> 1
-ddcom025 compare 2 1 -> 1
-ddcom026 compare 2 2 -> 0
-
-ddcom031 compare -20 -20 -> 0
-ddcom032 compare -20 -10 -> -1
-ddcom033 compare -20 00 -> -1
-ddcom034 compare -20 10 -> -1
-ddcom035 compare -20 20 -> -1
-ddcom036 compare -10 -20 -> 1
-ddcom037 compare -10 -10 -> 0
-ddcom038 compare -10 00 -> -1
-ddcom039 compare -10 10 -> -1
-ddcom040 compare -10 20 -> -1
-ddcom041 compare 00 -20 -> 1
-ddcom042 compare 00 -10 -> 1
-ddcom043 compare 00 00 -> 0
-ddcom044 compare 00 10 -> -1
-ddcom045 compare 00 20 -> -1
-ddcom046 compare 10 -20 -> 1
-ddcom047 compare 10 -10 -> 1
-ddcom048 compare 10 00 -> 1
-ddcom049 compare 10 10 -> 0
-ddcom050 compare 10 20 -> -1
-ddcom051 compare 20 -20 -> 1
-ddcom052 compare 20 -10 -> 1
-ddcom053 compare 20 00 -> 1
-ddcom055 compare 20 10 -> 1
-ddcom056 compare 20 20 -> 0
-
-ddcom061 compare -2.0 -2.0 -> 0
-ddcom062 compare -2.0 -1.0 -> -1
-ddcom063 compare -2.0 0.0 -> -1
-ddcom064 compare -2.0 1.0 -> -1
-ddcom065 compare -2.0 2.0 -> -1
-ddcom066 compare -1.0 -2.0 -> 1
-ddcom067 compare -1.0 -1.0 -> 0
-ddcom068 compare -1.0 0.0 -> -1
-ddcom069 compare -1.0 1.0 -> -1
-ddcom070 compare -1.0 2.0 -> -1
-ddcom071 compare 0.0 -2.0 -> 1
-ddcom072 compare 0.0 -1.0 -> 1
-ddcom073 compare 0.0 0.0 -> 0
-ddcom074 compare 0.0 1.0 -> -1
-ddcom075 compare 0.0 2.0 -> -1
-ddcom076 compare 1.0 -2.0 -> 1
-ddcom077 compare 1.0 -1.0 -> 1
-ddcom078 compare 1.0 0.0 -> 1
-ddcom079 compare 1.0 1.0 -> 0
-ddcom080 compare 1.0 2.0 -> -1
-ddcom081 compare 2.0 -2.0 -> 1
-ddcom082 compare 2.0 -1.0 -> 1
-ddcom083 compare 2.0 0.0 -> 1
-ddcom085 compare 2.0 1.0 -> 1
-ddcom086 compare 2.0 2.0 -> 0
-ddcom087 compare 1.0 0.1 -> 1
-ddcom088 compare 0.1 1.0 -> -1
-
--- now some cases which might overflow if subtract were used
-ddcom095 compare 9.999999999999999E+384 9.999999999999999E+384 -> 0
-ddcom096 compare -9.999999999999999E+384 9.999999999999999E+384 -> -1
-ddcom097 compare 9.999999999999999E+384 -9.999999999999999E+384 -> 1
-ddcom098 compare -9.999999999999999E+384 -9.999999999999999E+384 -> 0
-
--- some differing length/exponent cases
-ddcom100 compare 7.0 7.0 -> 0
-ddcom101 compare 7.0 7 -> 0
-ddcom102 compare 7 7.0 -> 0
-ddcom103 compare 7E+0 7.0 -> 0
-ddcom104 compare 70E-1 7.0 -> 0
-ddcom105 compare 0.7E+1 7 -> 0
-ddcom106 compare 70E-1 7 -> 0
-ddcom107 compare 7.0 7E+0 -> 0
-ddcom108 compare 7.0 70E-1 -> 0
-ddcom109 compare 7 0.7E+1 -> 0
-ddcom110 compare 7 70E-1 -> 0
-
-ddcom120 compare 8.0 7.0 -> 1
-ddcom121 compare 8.0 7 -> 1
-ddcom122 compare 8 7.0 -> 1
-ddcom123 compare 8E+0 7.0 -> 1
-ddcom124 compare 80E-1 7.0 -> 1
-ddcom125 compare 0.8E+1 7 -> 1
-ddcom126 compare 80E-1 7 -> 1
-ddcom127 compare 8.0 7E+0 -> 1
-ddcom128 compare 8.0 70E-1 -> 1
-ddcom129 compare 8 0.7E+1 -> 1
-ddcom130 compare 8 70E-1 -> 1
-
-ddcom140 compare 8.0 9.0 -> -1
-ddcom141 compare 8.0 9 -> -1
-ddcom142 compare 8 9.0 -> -1
-ddcom143 compare 8E+0 9.0 -> -1
-ddcom144 compare 80E-1 9.0 -> -1
-ddcom145 compare 0.8E+1 9 -> -1
-ddcom146 compare 80E-1 9 -> -1
-ddcom147 compare 8.0 9E+0 -> -1
-ddcom148 compare 8.0 90E-1 -> -1
-ddcom149 compare 8 0.9E+1 -> -1
-ddcom150 compare 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ddcom200 compare -7.0 7.0 -> -1
-ddcom201 compare -7.0 7 -> -1
-ddcom202 compare -7 7.0 -> -1
-ddcom203 compare -7E+0 7.0 -> -1
-ddcom204 compare -70E-1 7.0 -> -1
-ddcom205 compare -0.7E+1 7 -> -1
-ddcom206 compare -70E-1 7 -> -1
-ddcom207 compare -7.0 7E+0 -> -1
-ddcom208 compare -7.0 70E-1 -> -1
-ddcom209 compare -7 0.7E+1 -> -1
-ddcom210 compare -7 70E-1 -> -1
-
-ddcom220 compare -8.0 7.0 -> -1
-ddcom221 compare -8.0 7 -> -1
-ddcom222 compare -8 7.0 -> -1
-ddcom223 compare -8E+0 7.0 -> -1
-ddcom224 compare -80E-1 7.0 -> -1
-ddcom225 compare -0.8E+1 7 -> -1
-ddcom226 compare -80E-1 7 -> -1
-ddcom227 compare -8.0 7E+0 -> -1
-ddcom228 compare -8.0 70E-1 -> -1
-ddcom229 compare -8 0.7E+1 -> -1
-ddcom230 compare -8 70E-1 -> -1
-
-ddcom240 compare -8.0 9.0 -> -1
-ddcom241 compare -8.0 9 -> -1
-ddcom242 compare -8 9.0 -> -1
-ddcom243 compare -8E+0 9.0 -> -1
-ddcom244 compare -80E-1 9.0 -> -1
-ddcom245 compare -0.8E+1 9 -> -1
-ddcom246 compare -80E-1 9 -> -1
-ddcom247 compare -8.0 9E+0 -> -1
-ddcom248 compare -8.0 90E-1 -> -1
-ddcom249 compare -8 0.9E+1 -> -1
-ddcom250 compare -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ddcom300 compare 7.0 -7.0 -> 1
-ddcom301 compare 7.0 -7 -> 1
-ddcom302 compare 7 -7.0 -> 1
-ddcom303 compare 7E+0 -7.0 -> 1
-ddcom304 compare 70E-1 -7.0 -> 1
-ddcom305 compare .7E+1 -7 -> 1
-ddcom306 compare 70E-1 -7 -> 1
-ddcom307 compare 7.0 -7E+0 -> 1
-ddcom308 compare 7.0 -70E-1 -> 1
-ddcom309 compare 7 -.7E+1 -> 1
-ddcom310 compare 7 -70E-1 -> 1
-
-ddcom320 compare 8.0 -7.0 -> 1
-ddcom321 compare 8.0 -7 -> 1
-ddcom322 compare 8 -7.0 -> 1
-ddcom323 compare 8E+0 -7.0 -> 1
-ddcom324 compare 80E-1 -7.0 -> 1
-ddcom325 compare .8E+1 -7 -> 1
-ddcom326 compare 80E-1 -7 -> 1
-ddcom327 compare 8.0 -7E+0 -> 1
-ddcom328 compare 8.0 -70E-1 -> 1
-ddcom329 compare 8 -.7E+1 -> 1
-ddcom330 compare 8 -70E-1 -> 1
-
-ddcom340 compare 8.0 -9.0 -> 1
-ddcom341 compare 8.0 -9 -> 1
-ddcom342 compare 8 -9.0 -> 1
-ddcom343 compare 8E+0 -9.0 -> 1
-ddcom344 compare 80E-1 -9.0 -> 1
-ddcom345 compare .8E+1 -9 -> 1
-ddcom346 compare 80E-1 -9 -> 1
-ddcom347 compare 8.0 -9E+0 -> 1
-ddcom348 compare 8.0 -90E-1 -> 1
-ddcom349 compare 8 -.9E+1 -> 1
-ddcom350 compare 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-ddcom400 compare -7.0 -7.0 -> 0
-ddcom401 compare -7.0 -7 -> 0
-ddcom402 compare -7 -7.0 -> 0
-ddcom403 compare -7E+0 -7.0 -> 0
-ddcom404 compare -70E-1 -7.0 -> 0
-ddcom405 compare -.7E+1 -7 -> 0
-ddcom406 compare -70E-1 -7 -> 0
-ddcom407 compare -7.0 -7E+0 -> 0
-ddcom408 compare -7.0 -70E-1 -> 0
-ddcom409 compare -7 -.7E+1 -> 0
-ddcom410 compare -7 -70E-1 -> 0
-
-ddcom420 compare -8.0 -7.0 -> -1
-ddcom421 compare -8.0 -7 -> -1
-ddcom422 compare -8 -7.0 -> -1
-ddcom423 compare -8E+0 -7.0 -> -1
-ddcom424 compare -80E-1 -7.0 -> -1
-ddcom425 compare -.8E+1 -7 -> -1
-ddcom426 compare -80E-1 -7 -> -1
-ddcom427 compare -8.0 -7E+0 -> -1
-ddcom428 compare -8.0 -70E-1 -> -1
-ddcom429 compare -8 -.7E+1 -> -1
-ddcom430 compare -8 -70E-1 -> -1
-
-ddcom440 compare -8.0 -9.0 -> 1
-ddcom441 compare -8.0 -9 -> 1
-ddcom442 compare -8 -9.0 -> 1
-ddcom443 compare -8E+0 -9.0 -> 1
-ddcom444 compare -80E-1 -9.0 -> 1
-ddcom445 compare -.8E+1 -9 -> 1
-ddcom446 compare -80E-1 -9 -> 1
-ddcom447 compare -8.0 -9E+0 -> 1
-ddcom448 compare -8.0 -90E-1 -> 1
-ddcom449 compare -8 -.9E+1 -> 1
-ddcom450 compare -8 -90E-1 -> 1
-
--- misalignment traps for little-endian
-ddcom451 compare 1.0 0.1 -> 1
-ddcom452 compare 0.1 1.0 -> -1
-ddcom453 compare 10.0 0.1 -> 1
-ddcom454 compare 0.1 10.0 -> -1
-ddcom455 compare 100 1.0 -> 1
-ddcom456 compare 1.0 100 -> -1
-ddcom457 compare 1000 10.0 -> 1
-ddcom458 compare 10.0 1000 -> -1
-ddcom459 compare 10000 100.0 -> 1
-ddcom460 compare 100.0 10000 -> -1
-ddcom461 compare 100000 1000.0 -> 1
-ddcom462 compare 1000.0 100000 -> -1
-ddcom463 compare 1000000 10000.0 -> 1
-ddcom464 compare 10000.0 1000000 -> -1
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-ddcom473 compare 123.4560000000000E-89 123.456E-89 -> 0
-ddcom474 compare 123.456000000000E+89 123.456E+89 -> 0
-ddcom475 compare 123.45600000000E-89 123.456E-89 -> 0
-ddcom476 compare 123.4560000000E+89 123.456E+89 -> 0
-ddcom477 compare 123.456000000E-89 123.456E-89 -> 0
-ddcom478 compare 123.45600000E+89 123.456E+89 -> 0
-ddcom479 compare 123.4560000E-89 123.456E-89 -> 0
-ddcom480 compare 123.456000E+89 123.456E+89 -> 0
-ddcom481 compare 123.45600E-89 123.456E-89 -> 0
-ddcom482 compare 123.4560E+89 123.456E+89 -> 0
-ddcom483 compare 123.456E-89 123.456E-89 -> 0
-ddcom487 compare 123.456E+89 123.4560000000000E+89 -> 0
-ddcom488 compare 123.456E-89 123.456000000000E-89 -> 0
-ddcom489 compare 123.456E+89 123.45600000000E+89 -> 0
-ddcom490 compare 123.456E-89 123.4560000000E-89 -> 0
-ddcom491 compare 123.456E+89 123.456000000E+89 -> 0
-ddcom492 compare 123.456E-89 123.45600000E-89 -> 0
-ddcom493 compare 123.456E+89 123.4560000E+89 -> 0
-ddcom494 compare 123.456E-89 123.456000E-89 -> 0
-ddcom495 compare 123.456E+89 123.45600E+89 -> 0
-ddcom496 compare 123.456E-89 123.4560E-89 -> 0
-ddcom497 compare 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-ddcom500 compare 1 1E-15 -> 1
-ddcom501 compare 1 1E-14 -> 1
-ddcom502 compare 1 1E-13 -> 1
-ddcom503 compare 1 1E-12 -> 1
-ddcom504 compare 1 1E-11 -> 1
-ddcom505 compare 1 1E-10 -> 1
-ddcom506 compare 1 1E-9 -> 1
-ddcom507 compare 1 1E-8 -> 1
-ddcom508 compare 1 1E-7 -> 1
-ddcom509 compare 1 1E-6 -> 1
-ddcom510 compare 1 1E-5 -> 1
-ddcom511 compare 1 1E-4 -> 1
-ddcom512 compare 1 1E-3 -> 1
-ddcom513 compare 1 1E-2 -> 1
-ddcom514 compare 1 1E-1 -> 1
-ddcom515 compare 1 1E-0 -> 0
-ddcom516 compare 1 1E+1 -> -1
-ddcom517 compare 1 1E+2 -> -1
-ddcom518 compare 1 1E+3 -> -1
-ddcom519 compare 1 1E+4 -> -1
-ddcom521 compare 1 1E+5 -> -1
-ddcom522 compare 1 1E+6 -> -1
-ddcom523 compare 1 1E+7 -> -1
-ddcom524 compare 1 1E+8 -> -1
-ddcom525 compare 1 1E+9 -> -1
-ddcom526 compare 1 1E+10 -> -1
-ddcom527 compare 1 1E+11 -> -1
-ddcom528 compare 1 1E+12 -> -1
-ddcom529 compare 1 1E+13 -> -1
-ddcom530 compare 1 1E+14 -> -1
-ddcom531 compare 1 1E+15 -> -1
--- LR swap
-ddcom540 compare 1E-15 1 -> -1
-ddcom541 compare 1E-14 1 -> -1
-ddcom542 compare 1E-13 1 -> -1
-ddcom543 compare 1E-12 1 -> -1
-ddcom544 compare 1E-11 1 -> -1
-ddcom545 compare 1E-10 1 -> -1
-ddcom546 compare 1E-9 1 -> -1
-ddcom547 compare 1E-8 1 -> -1
-ddcom548 compare 1E-7 1 -> -1
-ddcom549 compare 1E-6 1 -> -1
-ddcom550 compare 1E-5 1 -> -1
-ddcom551 compare 1E-4 1 -> -1
-ddcom552 compare 1E-3 1 -> -1
-ddcom553 compare 1E-2 1 -> -1
-ddcom554 compare 1E-1 1 -> -1
-ddcom555 compare 1E-0 1 -> 0
-ddcom556 compare 1E+1 1 -> 1
-ddcom557 compare 1E+2 1 -> 1
-ddcom558 compare 1E+3 1 -> 1
-ddcom559 compare 1E+4 1 -> 1
-ddcom561 compare 1E+5 1 -> 1
-ddcom562 compare 1E+6 1 -> 1
-ddcom563 compare 1E+7 1 -> 1
-ddcom564 compare 1E+8 1 -> 1
-ddcom565 compare 1E+9 1 -> 1
-ddcom566 compare 1E+10 1 -> 1
-ddcom567 compare 1E+11 1 -> 1
-ddcom568 compare 1E+12 1 -> 1
-ddcom569 compare 1E+13 1 -> 1
-ddcom570 compare 1E+14 1 -> 1
-ddcom571 compare 1E+15 1 -> 1
--- similar with a useful coefficient, one side only
-ddcom580 compare 0.000000987654321 1E-15 -> 1
-ddcom581 compare 0.000000987654321 1E-14 -> 1
-ddcom582 compare 0.000000987654321 1E-13 -> 1
-ddcom583 compare 0.000000987654321 1E-12 -> 1
-ddcom584 compare 0.000000987654321 1E-11 -> 1
-ddcom585 compare 0.000000987654321 1E-10 -> 1
-ddcom586 compare 0.000000987654321 1E-9 -> 1
-ddcom587 compare 0.000000987654321 1E-8 -> 1
-ddcom588 compare 0.000000987654321 1E-7 -> 1
-ddcom589 compare 0.000000987654321 1E-6 -> -1
-ddcom590 compare 0.000000987654321 1E-5 -> -1
-ddcom591 compare 0.000000987654321 1E-4 -> -1
-ddcom592 compare 0.000000987654321 1E-3 -> -1
-ddcom593 compare 0.000000987654321 1E-2 -> -1
-ddcom594 compare 0.000000987654321 1E-1 -> -1
-ddcom595 compare 0.000000987654321 1E-0 -> -1
-ddcom596 compare 0.000000987654321 1E+1 -> -1
-ddcom597 compare 0.000000987654321 1E+2 -> -1
-ddcom598 compare 0.000000987654321 1E+3 -> -1
-ddcom599 compare 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-ddcom600 compare 12 12.2345 -> -1
-ddcom601 compare 12.0 12.2345 -> -1
-ddcom602 compare 12.00 12.2345 -> -1
-ddcom603 compare 12.000 12.2345 -> -1
-ddcom604 compare 12.0000 12.2345 -> -1
-ddcom605 compare 12.00000 12.2345 -> -1
-ddcom606 compare 12.000000 12.2345 -> -1
-ddcom607 compare 12.0000000 12.2345 -> -1
-ddcom608 compare 12.00000000 12.2345 -> -1
-ddcom609 compare 12.000000000 12.2345 -> -1
-ddcom610 compare 12.1234 12 -> 1
-ddcom611 compare 12.1234 12.0 -> 1
-ddcom612 compare 12.1234 12.00 -> 1
-ddcom613 compare 12.1234 12.000 -> 1
-ddcom614 compare 12.1234 12.0000 -> 1
-ddcom615 compare 12.1234 12.00000 -> 1
-ddcom616 compare 12.1234 12.000000 -> 1
-ddcom617 compare 12.1234 12.0000000 -> 1
-ddcom618 compare 12.1234 12.00000000 -> 1
-ddcom619 compare 12.1234 12.000000000 -> 1
-ddcom620 compare -12 -12.2345 -> 1
-ddcom621 compare -12.0 -12.2345 -> 1
-ddcom622 compare -12.00 -12.2345 -> 1
-ddcom623 compare -12.000 -12.2345 -> 1
-ddcom624 compare -12.0000 -12.2345 -> 1
-ddcom625 compare -12.00000 -12.2345 -> 1
-ddcom626 compare -12.000000 -12.2345 -> 1
-ddcom627 compare -12.0000000 -12.2345 -> 1
-ddcom628 compare -12.00000000 -12.2345 -> 1
-ddcom629 compare -12.000000000 -12.2345 -> 1
-ddcom630 compare -12.1234 -12 -> -1
-ddcom631 compare -12.1234 -12.0 -> -1
-ddcom632 compare -12.1234 -12.00 -> -1
-ddcom633 compare -12.1234 -12.000 -> -1
-ddcom634 compare -12.1234 -12.0000 -> -1
-ddcom635 compare -12.1234 -12.00000 -> -1
-ddcom636 compare -12.1234 -12.000000 -> -1
-ddcom637 compare -12.1234 -12.0000000 -> -1
-ddcom638 compare -12.1234 -12.00000000 -> -1
-ddcom639 compare -12.1234 -12.000000000 -> -1
-
--- extended zeros
-ddcom640 compare 0 0 -> 0
-ddcom641 compare 0 -0 -> 0
-ddcom642 compare 0 -0.0 -> 0
-ddcom643 compare 0 0.0 -> 0
-ddcom644 compare -0 0 -> 0
-ddcom645 compare -0 -0 -> 0
-ddcom646 compare -0 -0.0 -> 0
-ddcom647 compare -0 0.0 -> 0
-ddcom648 compare 0.0 0 -> 0
-ddcom649 compare 0.0 -0 -> 0
-ddcom650 compare 0.0 -0.0 -> 0
-ddcom651 compare 0.0 0.0 -> 0
-ddcom652 compare -0.0 0 -> 0
-ddcom653 compare -0.0 -0 -> 0
-ddcom654 compare -0.0 -0.0 -> 0
-ddcom655 compare -0.0 0.0 -> 0
-
-ddcom656 compare -0E1 0.0 -> 0
-ddcom657 compare -0E2 0.0 -> 0
-ddcom658 compare 0E1 0.0 -> 0
-ddcom659 compare 0E2 0.0 -> 0
-ddcom660 compare -0E1 0 -> 0
-ddcom661 compare -0E2 0 -> 0
-ddcom662 compare 0E1 0 -> 0
-ddcom663 compare 0E2 0 -> 0
-ddcom664 compare -0E1 -0E1 -> 0
-ddcom665 compare -0E2 -0E1 -> 0
-ddcom666 compare 0E1 -0E1 -> 0
-ddcom667 compare 0E2 -0E1 -> 0
-ddcom668 compare -0E1 -0E2 -> 0
-ddcom669 compare -0E2 -0E2 -> 0
-ddcom670 compare 0E1 -0E2 -> 0
-ddcom671 compare 0E2 -0E2 -> 0
-ddcom672 compare -0E1 0E1 -> 0
-ddcom673 compare -0E2 0E1 -> 0
-ddcom674 compare 0E1 0E1 -> 0
-ddcom675 compare 0E2 0E1 -> 0
-ddcom676 compare -0E1 0E2 -> 0
-ddcom677 compare -0E2 0E2 -> 0
-ddcom678 compare 0E1 0E2 -> 0
-ddcom679 compare 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-ddcom680 compare 12 12 -> 0
-ddcom681 compare 12 12.0 -> 0
-ddcom682 compare 12 12.00 -> 0
-ddcom683 compare 12 12.000 -> 0
-ddcom684 compare 12 12.0000 -> 0
-ddcom685 compare 12 12.00000 -> 0
-ddcom686 compare 12 12.000000 -> 0
-ddcom687 compare 12 12.0000000 -> 0
-ddcom688 compare 12 12.00000000 -> 0
-ddcom689 compare 12 12.000000000 -> 0
-ddcom690 compare 12 12 -> 0
-ddcom691 compare 12.0 12 -> 0
-ddcom692 compare 12.00 12 -> 0
-ddcom693 compare 12.000 12 -> 0
-ddcom694 compare 12.0000 12 -> 0
-ddcom695 compare 12.00000 12 -> 0
-ddcom696 compare 12.000000 12 -> 0
-ddcom697 compare 12.0000000 12 -> 0
-ddcom698 compare 12.00000000 12 -> 0
-ddcom699 compare 12.000000000 12 -> 0
-
--- first, second, & last digit
-ddcom700 compare 1234567890123456 1234567890123455 -> 1
-ddcom701 compare 1234567890123456 1234567890123456 -> 0
-ddcom702 compare 1234567890123456 1234567890123457 -> -1
-ddcom703 compare 1234567890123456 0234567890123456 -> 1
-ddcom704 compare 1234567890123456 1234567890123456 -> 0
-ddcom705 compare 1234567890123456 2234567890123456 -> -1
-ddcom706 compare 1134567890123456 1034567890123456 -> 1
-ddcom707 compare 1134567890123456 1134567890123456 -> 0
-ddcom708 compare 1134567890123456 1234567890123456 -> -1
-
--- miscellaneous
-ddcom721 compare 12345678000 1 -> 1
-ddcom722 compare 1 12345678000 -> -1
-ddcom723 compare 1234567800 1 -> 1
-ddcom724 compare 1 1234567800 -> -1
-ddcom725 compare 1234567890 1 -> 1
-ddcom726 compare 1 1234567890 -> -1
-ddcom727 compare 1234567891 1 -> 1
-ddcom728 compare 1 1234567891 -> -1
-ddcom729 compare 12345678901 1 -> 1
-ddcom730 compare 1 12345678901 -> -1
-ddcom731 compare 1234567896 1 -> 1
-ddcom732 compare 1 1234567896 -> -1
-
--- residue cases at lower precision
-ddcom740 compare 1 0.9999999 -> 1
-ddcom741 compare 1 0.999999 -> 1
-ddcom742 compare 1 0.99999 -> 1
-ddcom743 compare 1 1.0000 -> 0
-ddcom744 compare 1 1.00001 -> -1
-ddcom745 compare 1 1.000001 -> -1
-ddcom746 compare 1 1.0000001 -> -1
-ddcom750 compare 0.9999999 1 -> -1
-ddcom751 compare 0.999999 1 -> -1
-ddcom752 compare 0.99999 1 -> -1
-ddcom753 compare 1.0000 1 -> 0
-ddcom754 compare 1.00001 1 -> 1
-ddcom755 compare 1.000001 1 -> 1
-ddcom756 compare 1.0000001 1 -> 1
-
--- Specials
-ddcom780 compare Inf -Inf -> 1
-ddcom781 compare Inf -1000 -> 1
-ddcom782 compare Inf -1 -> 1
-ddcom783 compare Inf -0 -> 1
-ddcom784 compare Inf 0 -> 1
-ddcom785 compare Inf 1 -> 1
-ddcom786 compare Inf 1000 -> 1
-ddcom787 compare Inf Inf -> 0
-ddcom788 compare -1000 Inf -> -1
-ddcom789 compare -Inf Inf -> -1
-ddcom790 compare -1 Inf -> -1
-ddcom791 compare -0 Inf -> -1
-ddcom792 compare 0 Inf -> -1
-ddcom793 compare 1 Inf -> -1
-ddcom794 compare 1000 Inf -> -1
-ddcom795 compare Inf Inf -> 0
-
-ddcom800 compare -Inf -Inf -> 0
-ddcom801 compare -Inf -1000 -> -1
-ddcom802 compare -Inf -1 -> -1
-ddcom803 compare -Inf -0 -> -1
-ddcom804 compare -Inf 0 -> -1
-ddcom805 compare -Inf 1 -> -1
-ddcom806 compare -Inf 1000 -> -1
-ddcom807 compare -Inf Inf -> -1
-ddcom808 compare -Inf -Inf -> 0
-ddcom809 compare -1000 -Inf -> 1
-ddcom810 compare -1 -Inf -> 1
-ddcom811 compare -0 -Inf -> 1
-ddcom812 compare 0 -Inf -> 1
-ddcom813 compare 1 -Inf -> 1
-ddcom814 compare 1000 -Inf -> 1
-ddcom815 compare Inf -Inf -> 1
-
-ddcom821 compare NaN -Inf -> NaN
-ddcom822 compare NaN -1000 -> NaN
-ddcom823 compare NaN -1 -> NaN
-ddcom824 compare NaN -0 -> NaN
-ddcom825 compare NaN 0 -> NaN
-ddcom826 compare NaN 1 -> NaN
-ddcom827 compare NaN 1000 -> NaN
-ddcom828 compare NaN Inf -> NaN
-ddcom829 compare NaN NaN -> NaN
-ddcom830 compare -Inf NaN -> NaN
-ddcom831 compare -1000 NaN -> NaN
-ddcom832 compare -1 NaN -> NaN
-ddcom833 compare -0 NaN -> NaN
-ddcom834 compare 0 NaN -> NaN
-ddcom835 compare 1 NaN -> NaN
-ddcom836 compare 1000 NaN -> NaN
-ddcom837 compare Inf NaN -> NaN
-ddcom838 compare -NaN -NaN -> -NaN
-ddcom839 compare +NaN -NaN -> NaN
-ddcom840 compare -NaN +NaN -> -NaN
-
-ddcom841 compare sNaN -Inf -> NaN Invalid_operation
-ddcom842 compare sNaN -1000 -> NaN Invalid_operation
-ddcom843 compare sNaN -1 -> NaN Invalid_operation
-ddcom844 compare sNaN -0 -> NaN Invalid_operation
-ddcom845 compare sNaN 0 -> NaN Invalid_operation
-ddcom846 compare sNaN 1 -> NaN Invalid_operation
-ddcom847 compare sNaN 1000 -> NaN Invalid_operation
-ddcom848 compare sNaN NaN -> NaN Invalid_operation
-ddcom849 compare sNaN sNaN -> NaN Invalid_operation
-ddcom850 compare NaN sNaN -> NaN Invalid_operation
-ddcom851 compare -Inf sNaN -> NaN Invalid_operation
-ddcom852 compare -1000 sNaN -> NaN Invalid_operation
-ddcom853 compare -1 sNaN -> NaN Invalid_operation
-ddcom854 compare -0 sNaN -> NaN Invalid_operation
-ddcom855 compare 0 sNaN -> NaN Invalid_operation
-ddcom856 compare 1 sNaN -> NaN Invalid_operation
-ddcom857 compare 1000 sNaN -> NaN Invalid_operation
-ddcom858 compare Inf sNaN -> NaN Invalid_operation
-ddcom859 compare NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddcom860 compare NaN9 -Inf -> NaN9
-ddcom861 compare NaN8 999 -> NaN8
-ddcom862 compare NaN77 Inf -> NaN77
-ddcom863 compare -NaN67 NaN5 -> -NaN67
-ddcom864 compare -Inf -NaN4 -> -NaN4
-ddcom865 compare -999 -NaN33 -> -NaN33
-ddcom866 compare Inf NaN2 -> NaN2
-ddcom867 compare -NaN41 -NaN42 -> -NaN41
-ddcom868 compare +NaN41 -NaN42 -> NaN41
-ddcom869 compare -NaN41 +NaN42 -> -NaN41
-ddcom870 compare +NaN41 +NaN42 -> NaN41
-
-ddcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
-ddcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
-ddcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
-ddcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
-ddcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
-ddcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
-ddcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
-ddcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
-ddcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- wide range
-ddcom880 compare +1.23456789012345E-0 9E+384 -> -1
-ddcom881 compare 9E+384 +1.23456789012345E-0 -> 1
-ddcom882 compare +0.100 9E-383 -> 1
-ddcom883 compare 9E-383 +0.100 -> -1
-ddcom885 compare -1.23456789012345E-0 9E+384 -> -1
-ddcom886 compare 9E+384 -1.23456789012345E-0 -> 1
-ddcom887 compare -0.100 9E-383 -> -1
-ddcom888 compare 9E-383 -0.100 -> 1
-
--- spread zeros
-ddcom900 compare 0E-383 0 -> 0
-ddcom901 compare 0E-383 -0 -> 0
-ddcom902 compare -0E-383 0 -> 0
-ddcom903 compare -0E-383 -0 -> 0
-ddcom904 compare 0E-383 0E+384 -> 0
-ddcom905 compare 0E-383 -0E+384 -> 0
-ddcom906 compare -0E-383 0E+384 -> 0
-ddcom907 compare -0E-383 -0E+384 -> 0
-ddcom908 compare 0 0E+384 -> 0
-ddcom909 compare 0 -0E+384 -> 0
-ddcom910 compare -0 0E+384 -> 0
-ddcom911 compare -0 -0E+384 -> 0
-ddcom930 compare 0E+384 0 -> 0
-ddcom931 compare 0E+384 -0 -> 0
-ddcom932 compare -0E+384 0 -> 0
-ddcom933 compare -0E+384 -0 -> 0
-ddcom934 compare 0E+384 0E-383 -> 0
-ddcom935 compare 0E+384 -0E-383 -> 0
-ddcom936 compare -0E+384 0E-383 -> 0
-ddcom937 compare -0E+384 -0E-383 -> 0
-ddcom938 compare 0 0E-383 -> 0
-ddcom939 compare 0 -0E-383 -> 0
-ddcom940 compare -0 0E-383 -> 0
-ddcom941 compare -0 -0E-383 -> 0
-
--- signs
-ddcom961 compare 1e+77 1e+11 -> 1
-ddcom962 compare 1e+77 -1e+11 -> 1
-ddcom963 compare -1e+77 1e+11 -> -1
-ddcom964 compare -1e+77 -1e+11 -> -1
-ddcom965 compare 1e-77 1e-11 -> -1
-ddcom966 compare 1e-77 -1e-11 -> 1
-ddcom967 compare -1e-77 1e-11 -> -1
-ddcom968 compare -1e-77 -1e-11 -> 1
-
--- full alignment range, both ways
-ddcomp1001 compare 1 1.000000000000000 -> 0
-ddcomp1002 compare 1 1.00000000000000 -> 0
-ddcomp1003 compare 1 1.0000000000000 -> 0
-ddcomp1004 compare 1 1.000000000000 -> 0
-ddcomp1005 compare 1 1.00000000000 -> 0
-ddcomp1006 compare 1 1.0000000000 -> 0
-ddcomp1007 compare 1 1.000000000 -> 0
-ddcomp1008 compare 1 1.00000000 -> 0
-ddcomp1009 compare 1 1.0000000 -> 0
-ddcomp1010 compare 1 1.000000 -> 0
-ddcomp1011 compare 1 1.00000 -> 0
-ddcomp1012 compare 1 1.0000 -> 0
-ddcomp1013 compare 1 1.000 -> 0
-ddcomp1014 compare 1 1.00 -> 0
-ddcomp1015 compare 1 1.0 -> 0
-ddcomp1021 compare 1.000000000000000 1 -> 0
-ddcomp1022 compare 1.00000000000000 1 -> 0
-ddcomp1023 compare 1.0000000000000 1 -> 0
-ddcomp1024 compare 1.000000000000 1 -> 0
-ddcomp1025 compare 1.00000000000 1 -> 0
-ddcomp1026 compare 1.0000000000 1 -> 0
-ddcomp1027 compare 1.000000000 1 -> 0
-ddcomp1028 compare 1.00000000 1 -> 0
-ddcomp1029 compare 1.0000000 1 -> 0
-ddcomp1030 compare 1.000000 1 -> 0
-ddcomp1031 compare 1.00000 1 -> 0
-ddcomp1032 compare 1.0000 1 -> 0
-ddcomp1033 compare 1.000 1 -> 0
-ddcomp1034 compare 1.00 1 -> 0
-ddcomp1035 compare 1.0 1 -> 0
-
--- check MSD always detected non-zero
-ddcomp1040 compare 0 0.000000000000000 -> 0
-ddcomp1041 compare 0 1.000000000000000 -> -1
-ddcomp1042 compare 0 2.000000000000000 -> -1
-ddcomp1043 compare 0 3.000000000000000 -> -1
-ddcomp1044 compare 0 4.000000000000000 -> -1
-ddcomp1045 compare 0 5.000000000000000 -> -1
-ddcomp1046 compare 0 6.000000000000000 -> -1
-ddcomp1047 compare 0 7.000000000000000 -> -1
-ddcomp1048 compare 0 8.000000000000000 -> -1
-ddcomp1049 compare 0 9.000000000000000 -> -1
-ddcomp1050 compare 0.000000000000000 0 -> 0
-ddcomp1051 compare 1.000000000000000 0 -> 1
-ddcomp1052 compare 2.000000000000000 0 -> 1
-ddcomp1053 compare 3.000000000000000 0 -> 1
-ddcomp1054 compare 4.000000000000000 0 -> 1
-ddcomp1055 compare 5.000000000000000 0 -> 1
-ddcomp1056 compare 6.000000000000000 0 -> 1
-ddcomp1057 compare 7.000000000000000 0 -> 1
-ddcomp1058 compare 8.000000000000000 0 -> 1
-ddcomp1059 compare 9.000000000000000 0 -> 1
-
--- Null tests
-ddcom9990 compare 10 # -> NaN Invalid_operation
-ddcom9991 compare # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddCompare.decTest -- decDouble comparison that allows quiet NaNs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddcom001 compare -2 -2 -> 0
+ddcom002 compare -2 -1 -> -1
+ddcom003 compare -2 0 -> -1
+ddcom004 compare -2 1 -> -1
+ddcom005 compare -2 2 -> -1
+ddcom006 compare -1 -2 -> 1
+ddcom007 compare -1 -1 -> 0
+ddcom008 compare -1 0 -> -1
+ddcom009 compare -1 1 -> -1
+ddcom010 compare -1 2 -> -1
+ddcom011 compare 0 -2 -> 1
+ddcom012 compare 0 -1 -> 1
+ddcom013 compare 0 0 -> 0
+ddcom014 compare 0 1 -> -1
+ddcom015 compare 0 2 -> -1
+ddcom016 compare 1 -2 -> 1
+ddcom017 compare 1 -1 -> 1
+ddcom018 compare 1 0 -> 1
+ddcom019 compare 1 1 -> 0
+ddcom020 compare 1 2 -> -1
+ddcom021 compare 2 -2 -> 1
+ddcom022 compare 2 -1 -> 1
+ddcom023 compare 2 0 -> 1
+ddcom025 compare 2 1 -> 1
+ddcom026 compare 2 2 -> 0
+
+ddcom031 compare -20 -20 -> 0
+ddcom032 compare -20 -10 -> -1
+ddcom033 compare -20 00 -> -1
+ddcom034 compare -20 10 -> -1
+ddcom035 compare -20 20 -> -1
+ddcom036 compare -10 -20 -> 1
+ddcom037 compare -10 -10 -> 0
+ddcom038 compare -10 00 -> -1
+ddcom039 compare -10 10 -> -1
+ddcom040 compare -10 20 -> -1
+ddcom041 compare 00 -20 -> 1
+ddcom042 compare 00 -10 -> 1
+ddcom043 compare 00 00 -> 0
+ddcom044 compare 00 10 -> -1
+ddcom045 compare 00 20 -> -1
+ddcom046 compare 10 -20 -> 1
+ddcom047 compare 10 -10 -> 1
+ddcom048 compare 10 00 -> 1
+ddcom049 compare 10 10 -> 0
+ddcom050 compare 10 20 -> -1
+ddcom051 compare 20 -20 -> 1
+ddcom052 compare 20 -10 -> 1
+ddcom053 compare 20 00 -> 1
+ddcom055 compare 20 10 -> 1
+ddcom056 compare 20 20 -> 0
+
+ddcom061 compare -2.0 -2.0 -> 0
+ddcom062 compare -2.0 -1.0 -> -1
+ddcom063 compare -2.0 0.0 -> -1
+ddcom064 compare -2.0 1.0 -> -1
+ddcom065 compare -2.0 2.0 -> -1
+ddcom066 compare -1.0 -2.0 -> 1
+ddcom067 compare -1.0 -1.0 -> 0
+ddcom068 compare -1.0 0.0 -> -1
+ddcom069 compare -1.0 1.0 -> -1
+ddcom070 compare -1.0 2.0 -> -1
+ddcom071 compare 0.0 -2.0 -> 1
+ddcom072 compare 0.0 -1.0 -> 1
+ddcom073 compare 0.0 0.0 -> 0
+ddcom074 compare 0.0 1.0 -> -1
+ddcom075 compare 0.0 2.0 -> -1
+ddcom076 compare 1.0 -2.0 -> 1
+ddcom077 compare 1.0 -1.0 -> 1
+ddcom078 compare 1.0 0.0 -> 1
+ddcom079 compare 1.0 1.0 -> 0
+ddcom080 compare 1.0 2.0 -> -1
+ddcom081 compare 2.0 -2.0 -> 1
+ddcom082 compare 2.0 -1.0 -> 1
+ddcom083 compare 2.0 0.0 -> 1
+ddcom085 compare 2.0 1.0 -> 1
+ddcom086 compare 2.0 2.0 -> 0
+ddcom087 compare 1.0 0.1 -> 1
+ddcom088 compare 0.1 1.0 -> -1
+
+-- now some cases which might overflow if subtract were used
+ddcom095 compare 9.999999999999999E+384 9.999999999999999E+384 -> 0
+ddcom096 compare -9.999999999999999E+384 9.999999999999999E+384 -> -1
+ddcom097 compare 9.999999999999999E+384 -9.999999999999999E+384 -> 1
+ddcom098 compare -9.999999999999999E+384 -9.999999999999999E+384 -> 0
+
+-- some differing length/exponent cases
+ddcom100 compare 7.0 7.0 -> 0
+ddcom101 compare 7.0 7 -> 0
+ddcom102 compare 7 7.0 -> 0
+ddcom103 compare 7E+0 7.0 -> 0
+ddcom104 compare 70E-1 7.0 -> 0
+ddcom105 compare 0.7E+1 7 -> 0
+ddcom106 compare 70E-1 7 -> 0
+ddcom107 compare 7.0 7E+0 -> 0
+ddcom108 compare 7.0 70E-1 -> 0
+ddcom109 compare 7 0.7E+1 -> 0
+ddcom110 compare 7 70E-1 -> 0
+
+ddcom120 compare 8.0 7.0 -> 1
+ddcom121 compare 8.0 7 -> 1
+ddcom122 compare 8 7.0 -> 1
+ddcom123 compare 8E+0 7.0 -> 1
+ddcom124 compare 80E-1 7.0 -> 1
+ddcom125 compare 0.8E+1 7 -> 1
+ddcom126 compare 80E-1 7 -> 1
+ddcom127 compare 8.0 7E+0 -> 1
+ddcom128 compare 8.0 70E-1 -> 1
+ddcom129 compare 8 0.7E+1 -> 1
+ddcom130 compare 8 70E-1 -> 1
+
+ddcom140 compare 8.0 9.0 -> -1
+ddcom141 compare 8.0 9 -> -1
+ddcom142 compare 8 9.0 -> -1
+ddcom143 compare 8E+0 9.0 -> -1
+ddcom144 compare 80E-1 9.0 -> -1
+ddcom145 compare 0.8E+1 9 -> -1
+ddcom146 compare 80E-1 9 -> -1
+ddcom147 compare 8.0 9E+0 -> -1
+ddcom148 compare 8.0 90E-1 -> -1
+ddcom149 compare 8 0.9E+1 -> -1
+ddcom150 compare 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ddcom200 compare -7.0 7.0 -> -1
+ddcom201 compare -7.0 7 -> -1
+ddcom202 compare -7 7.0 -> -1
+ddcom203 compare -7E+0 7.0 -> -1
+ddcom204 compare -70E-1 7.0 -> -1
+ddcom205 compare -0.7E+1 7 -> -1
+ddcom206 compare -70E-1 7 -> -1
+ddcom207 compare -7.0 7E+0 -> -1
+ddcom208 compare -7.0 70E-1 -> -1
+ddcom209 compare -7 0.7E+1 -> -1
+ddcom210 compare -7 70E-1 -> -1
+
+ddcom220 compare -8.0 7.0 -> -1
+ddcom221 compare -8.0 7 -> -1
+ddcom222 compare -8 7.0 -> -1
+ddcom223 compare -8E+0 7.0 -> -1
+ddcom224 compare -80E-1 7.0 -> -1
+ddcom225 compare -0.8E+1 7 -> -1
+ddcom226 compare -80E-1 7 -> -1
+ddcom227 compare -8.0 7E+0 -> -1
+ddcom228 compare -8.0 70E-1 -> -1
+ddcom229 compare -8 0.7E+1 -> -1
+ddcom230 compare -8 70E-1 -> -1
+
+ddcom240 compare -8.0 9.0 -> -1
+ddcom241 compare -8.0 9 -> -1
+ddcom242 compare -8 9.0 -> -1
+ddcom243 compare -8E+0 9.0 -> -1
+ddcom244 compare -80E-1 9.0 -> -1
+ddcom245 compare -0.8E+1 9 -> -1
+ddcom246 compare -80E-1 9 -> -1
+ddcom247 compare -8.0 9E+0 -> -1
+ddcom248 compare -8.0 90E-1 -> -1
+ddcom249 compare -8 0.9E+1 -> -1
+ddcom250 compare -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ddcom300 compare 7.0 -7.0 -> 1
+ddcom301 compare 7.0 -7 -> 1
+ddcom302 compare 7 -7.0 -> 1
+ddcom303 compare 7E+0 -7.0 -> 1
+ddcom304 compare 70E-1 -7.0 -> 1
+ddcom305 compare .7E+1 -7 -> 1
+ddcom306 compare 70E-1 -7 -> 1
+ddcom307 compare 7.0 -7E+0 -> 1
+ddcom308 compare 7.0 -70E-1 -> 1
+ddcom309 compare 7 -.7E+1 -> 1
+ddcom310 compare 7 -70E-1 -> 1
+
+ddcom320 compare 8.0 -7.0 -> 1
+ddcom321 compare 8.0 -7 -> 1
+ddcom322 compare 8 -7.0 -> 1
+ddcom323 compare 8E+0 -7.0 -> 1
+ddcom324 compare 80E-1 -7.0 -> 1
+ddcom325 compare .8E+1 -7 -> 1
+ddcom326 compare 80E-1 -7 -> 1
+ddcom327 compare 8.0 -7E+0 -> 1
+ddcom328 compare 8.0 -70E-1 -> 1
+ddcom329 compare 8 -.7E+1 -> 1
+ddcom330 compare 8 -70E-1 -> 1
+
+ddcom340 compare 8.0 -9.0 -> 1
+ddcom341 compare 8.0 -9 -> 1
+ddcom342 compare 8 -9.0 -> 1
+ddcom343 compare 8E+0 -9.0 -> 1
+ddcom344 compare 80E-1 -9.0 -> 1
+ddcom345 compare .8E+1 -9 -> 1
+ddcom346 compare 80E-1 -9 -> 1
+ddcom347 compare 8.0 -9E+0 -> 1
+ddcom348 compare 8.0 -90E-1 -> 1
+ddcom349 compare 8 -.9E+1 -> 1
+ddcom350 compare 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+ddcom400 compare -7.0 -7.0 -> 0
+ddcom401 compare -7.0 -7 -> 0
+ddcom402 compare -7 -7.0 -> 0
+ddcom403 compare -7E+0 -7.0 -> 0
+ddcom404 compare -70E-1 -7.0 -> 0
+ddcom405 compare -.7E+1 -7 -> 0
+ddcom406 compare -70E-1 -7 -> 0
+ddcom407 compare -7.0 -7E+0 -> 0
+ddcom408 compare -7.0 -70E-1 -> 0
+ddcom409 compare -7 -.7E+1 -> 0
+ddcom410 compare -7 -70E-1 -> 0
+
+ddcom420 compare -8.0 -7.0 -> -1
+ddcom421 compare -8.0 -7 -> -1
+ddcom422 compare -8 -7.0 -> -1
+ddcom423 compare -8E+0 -7.0 -> -1
+ddcom424 compare -80E-1 -7.0 -> -1
+ddcom425 compare -.8E+1 -7 -> -1
+ddcom426 compare -80E-1 -7 -> -1
+ddcom427 compare -8.0 -7E+0 -> -1
+ddcom428 compare -8.0 -70E-1 -> -1
+ddcom429 compare -8 -.7E+1 -> -1
+ddcom430 compare -8 -70E-1 -> -1
+
+ddcom440 compare -8.0 -9.0 -> 1
+ddcom441 compare -8.0 -9 -> 1
+ddcom442 compare -8 -9.0 -> 1
+ddcom443 compare -8E+0 -9.0 -> 1
+ddcom444 compare -80E-1 -9.0 -> 1
+ddcom445 compare -.8E+1 -9 -> 1
+ddcom446 compare -80E-1 -9 -> 1
+ddcom447 compare -8.0 -9E+0 -> 1
+ddcom448 compare -8.0 -90E-1 -> 1
+ddcom449 compare -8 -.9E+1 -> 1
+ddcom450 compare -8 -90E-1 -> 1
+
+-- misalignment traps for little-endian
+ddcom451 compare 1.0 0.1 -> 1
+ddcom452 compare 0.1 1.0 -> -1
+ddcom453 compare 10.0 0.1 -> 1
+ddcom454 compare 0.1 10.0 -> -1
+ddcom455 compare 100 1.0 -> 1
+ddcom456 compare 1.0 100 -> -1
+ddcom457 compare 1000 10.0 -> 1
+ddcom458 compare 10.0 1000 -> -1
+ddcom459 compare 10000 100.0 -> 1
+ddcom460 compare 100.0 10000 -> -1
+ddcom461 compare 100000 1000.0 -> 1
+ddcom462 compare 1000.0 100000 -> -1
+ddcom463 compare 1000000 10000.0 -> 1
+ddcom464 compare 10000.0 1000000 -> -1
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+ddcom473 compare 123.4560000000000E-89 123.456E-89 -> 0
+ddcom474 compare 123.456000000000E+89 123.456E+89 -> 0
+ddcom475 compare 123.45600000000E-89 123.456E-89 -> 0
+ddcom476 compare 123.4560000000E+89 123.456E+89 -> 0
+ddcom477 compare 123.456000000E-89 123.456E-89 -> 0
+ddcom478 compare 123.45600000E+89 123.456E+89 -> 0
+ddcom479 compare 123.4560000E-89 123.456E-89 -> 0
+ddcom480 compare 123.456000E+89 123.456E+89 -> 0
+ddcom481 compare 123.45600E-89 123.456E-89 -> 0
+ddcom482 compare 123.4560E+89 123.456E+89 -> 0
+ddcom483 compare 123.456E-89 123.456E-89 -> 0
+ddcom487 compare 123.456E+89 123.4560000000000E+89 -> 0
+ddcom488 compare 123.456E-89 123.456000000000E-89 -> 0
+ddcom489 compare 123.456E+89 123.45600000000E+89 -> 0
+ddcom490 compare 123.456E-89 123.4560000000E-89 -> 0
+ddcom491 compare 123.456E+89 123.456000000E+89 -> 0
+ddcom492 compare 123.456E-89 123.45600000E-89 -> 0
+ddcom493 compare 123.456E+89 123.4560000E+89 -> 0
+ddcom494 compare 123.456E-89 123.456000E-89 -> 0
+ddcom495 compare 123.456E+89 123.45600E+89 -> 0
+ddcom496 compare 123.456E-89 123.4560E-89 -> 0
+ddcom497 compare 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+ddcom500 compare 1 1E-15 -> 1
+ddcom501 compare 1 1E-14 -> 1
+ddcom502 compare 1 1E-13 -> 1
+ddcom503 compare 1 1E-12 -> 1
+ddcom504 compare 1 1E-11 -> 1
+ddcom505 compare 1 1E-10 -> 1
+ddcom506 compare 1 1E-9 -> 1
+ddcom507 compare 1 1E-8 -> 1
+ddcom508 compare 1 1E-7 -> 1
+ddcom509 compare 1 1E-6 -> 1
+ddcom510 compare 1 1E-5 -> 1
+ddcom511 compare 1 1E-4 -> 1
+ddcom512 compare 1 1E-3 -> 1
+ddcom513 compare 1 1E-2 -> 1
+ddcom514 compare 1 1E-1 -> 1
+ddcom515 compare 1 1E-0 -> 0
+ddcom516 compare 1 1E+1 -> -1
+ddcom517 compare 1 1E+2 -> -1
+ddcom518 compare 1 1E+3 -> -1
+ddcom519 compare 1 1E+4 -> -1
+ddcom521 compare 1 1E+5 -> -1
+ddcom522 compare 1 1E+6 -> -1
+ddcom523 compare 1 1E+7 -> -1
+ddcom524 compare 1 1E+8 -> -1
+ddcom525 compare 1 1E+9 -> -1
+ddcom526 compare 1 1E+10 -> -1
+ddcom527 compare 1 1E+11 -> -1
+ddcom528 compare 1 1E+12 -> -1
+ddcom529 compare 1 1E+13 -> -1
+ddcom530 compare 1 1E+14 -> -1
+ddcom531 compare 1 1E+15 -> -1
+-- LR swap
+ddcom540 compare 1E-15 1 -> -1
+ddcom541 compare 1E-14 1 -> -1
+ddcom542 compare 1E-13 1 -> -1
+ddcom543 compare 1E-12 1 -> -1
+ddcom544 compare 1E-11 1 -> -1
+ddcom545 compare 1E-10 1 -> -1
+ddcom546 compare 1E-9 1 -> -1
+ddcom547 compare 1E-8 1 -> -1
+ddcom548 compare 1E-7 1 -> -1
+ddcom549 compare 1E-6 1 -> -1
+ddcom550 compare 1E-5 1 -> -1
+ddcom551 compare 1E-4 1 -> -1
+ddcom552 compare 1E-3 1 -> -1
+ddcom553 compare 1E-2 1 -> -1
+ddcom554 compare 1E-1 1 -> -1
+ddcom555 compare 1E-0 1 -> 0
+ddcom556 compare 1E+1 1 -> 1
+ddcom557 compare 1E+2 1 -> 1
+ddcom558 compare 1E+3 1 -> 1
+ddcom559 compare 1E+4 1 -> 1
+ddcom561 compare 1E+5 1 -> 1
+ddcom562 compare 1E+6 1 -> 1
+ddcom563 compare 1E+7 1 -> 1
+ddcom564 compare 1E+8 1 -> 1
+ddcom565 compare 1E+9 1 -> 1
+ddcom566 compare 1E+10 1 -> 1
+ddcom567 compare 1E+11 1 -> 1
+ddcom568 compare 1E+12 1 -> 1
+ddcom569 compare 1E+13 1 -> 1
+ddcom570 compare 1E+14 1 -> 1
+ddcom571 compare 1E+15 1 -> 1
+-- similar with a useful coefficient, one side only
+ddcom580 compare 0.000000987654321 1E-15 -> 1
+ddcom581 compare 0.000000987654321 1E-14 -> 1
+ddcom582 compare 0.000000987654321 1E-13 -> 1
+ddcom583 compare 0.000000987654321 1E-12 -> 1
+ddcom584 compare 0.000000987654321 1E-11 -> 1
+ddcom585 compare 0.000000987654321 1E-10 -> 1
+ddcom586 compare 0.000000987654321 1E-9 -> 1
+ddcom587 compare 0.000000987654321 1E-8 -> 1
+ddcom588 compare 0.000000987654321 1E-7 -> 1
+ddcom589 compare 0.000000987654321 1E-6 -> -1
+ddcom590 compare 0.000000987654321 1E-5 -> -1
+ddcom591 compare 0.000000987654321 1E-4 -> -1
+ddcom592 compare 0.000000987654321 1E-3 -> -1
+ddcom593 compare 0.000000987654321 1E-2 -> -1
+ddcom594 compare 0.000000987654321 1E-1 -> -1
+ddcom595 compare 0.000000987654321 1E-0 -> -1
+ddcom596 compare 0.000000987654321 1E+1 -> -1
+ddcom597 compare 0.000000987654321 1E+2 -> -1
+ddcom598 compare 0.000000987654321 1E+3 -> -1
+ddcom599 compare 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+ddcom600 compare 12 12.2345 -> -1
+ddcom601 compare 12.0 12.2345 -> -1
+ddcom602 compare 12.00 12.2345 -> -1
+ddcom603 compare 12.000 12.2345 -> -1
+ddcom604 compare 12.0000 12.2345 -> -1
+ddcom605 compare 12.00000 12.2345 -> -1
+ddcom606 compare 12.000000 12.2345 -> -1
+ddcom607 compare 12.0000000 12.2345 -> -1
+ddcom608 compare 12.00000000 12.2345 -> -1
+ddcom609 compare 12.000000000 12.2345 -> -1
+ddcom610 compare 12.1234 12 -> 1
+ddcom611 compare 12.1234 12.0 -> 1
+ddcom612 compare 12.1234 12.00 -> 1
+ddcom613 compare 12.1234 12.000 -> 1
+ddcom614 compare 12.1234 12.0000 -> 1
+ddcom615 compare 12.1234 12.00000 -> 1
+ddcom616 compare 12.1234 12.000000 -> 1
+ddcom617 compare 12.1234 12.0000000 -> 1
+ddcom618 compare 12.1234 12.00000000 -> 1
+ddcom619 compare 12.1234 12.000000000 -> 1
+ddcom620 compare -12 -12.2345 -> 1
+ddcom621 compare -12.0 -12.2345 -> 1
+ddcom622 compare -12.00 -12.2345 -> 1
+ddcom623 compare -12.000 -12.2345 -> 1
+ddcom624 compare -12.0000 -12.2345 -> 1
+ddcom625 compare -12.00000 -12.2345 -> 1
+ddcom626 compare -12.000000 -12.2345 -> 1
+ddcom627 compare -12.0000000 -12.2345 -> 1
+ddcom628 compare -12.00000000 -12.2345 -> 1
+ddcom629 compare -12.000000000 -12.2345 -> 1
+ddcom630 compare -12.1234 -12 -> -1
+ddcom631 compare -12.1234 -12.0 -> -1
+ddcom632 compare -12.1234 -12.00 -> -1
+ddcom633 compare -12.1234 -12.000 -> -1
+ddcom634 compare -12.1234 -12.0000 -> -1
+ddcom635 compare -12.1234 -12.00000 -> -1
+ddcom636 compare -12.1234 -12.000000 -> -1
+ddcom637 compare -12.1234 -12.0000000 -> -1
+ddcom638 compare -12.1234 -12.00000000 -> -1
+ddcom639 compare -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+ddcom640 compare 0 0 -> 0
+ddcom641 compare 0 -0 -> 0
+ddcom642 compare 0 -0.0 -> 0
+ddcom643 compare 0 0.0 -> 0
+ddcom644 compare -0 0 -> 0
+ddcom645 compare -0 -0 -> 0
+ddcom646 compare -0 -0.0 -> 0
+ddcom647 compare -0 0.0 -> 0
+ddcom648 compare 0.0 0 -> 0
+ddcom649 compare 0.0 -0 -> 0
+ddcom650 compare 0.0 -0.0 -> 0
+ddcom651 compare 0.0 0.0 -> 0
+ddcom652 compare -0.0 0 -> 0
+ddcom653 compare -0.0 -0 -> 0
+ddcom654 compare -0.0 -0.0 -> 0
+ddcom655 compare -0.0 0.0 -> 0
+
+ddcom656 compare -0E1 0.0 -> 0
+ddcom657 compare -0E2 0.0 -> 0
+ddcom658 compare 0E1 0.0 -> 0
+ddcom659 compare 0E2 0.0 -> 0
+ddcom660 compare -0E1 0 -> 0
+ddcom661 compare -0E2 0 -> 0
+ddcom662 compare 0E1 0 -> 0
+ddcom663 compare 0E2 0 -> 0
+ddcom664 compare -0E1 -0E1 -> 0
+ddcom665 compare -0E2 -0E1 -> 0
+ddcom666 compare 0E1 -0E1 -> 0
+ddcom667 compare 0E2 -0E1 -> 0
+ddcom668 compare -0E1 -0E2 -> 0
+ddcom669 compare -0E2 -0E2 -> 0
+ddcom670 compare 0E1 -0E2 -> 0
+ddcom671 compare 0E2 -0E2 -> 0
+ddcom672 compare -0E1 0E1 -> 0
+ddcom673 compare -0E2 0E1 -> 0
+ddcom674 compare 0E1 0E1 -> 0
+ddcom675 compare 0E2 0E1 -> 0
+ddcom676 compare -0E1 0E2 -> 0
+ddcom677 compare -0E2 0E2 -> 0
+ddcom678 compare 0E1 0E2 -> 0
+ddcom679 compare 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+ddcom680 compare 12 12 -> 0
+ddcom681 compare 12 12.0 -> 0
+ddcom682 compare 12 12.00 -> 0
+ddcom683 compare 12 12.000 -> 0
+ddcom684 compare 12 12.0000 -> 0
+ddcom685 compare 12 12.00000 -> 0
+ddcom686 compare 12 12.000000 -> 0
+ddcom687 compare 12 12.0000000 -> 0
+ddcom688 compare 12 12.00000000 -> 0
+ddcom689 compare 12 12.000000000 -> 0
+ddcom690 compare 12 12 -> 0
+ddcom691 compare 12.0 12 -> 0
+ddcom692 compare 12.00 12 -> 0
+ddcom693 compare 12.000 12 -> 0
+ddcom694 compare 12.0000 12 -> 0
+ddcom695 compare 12.00000 12 -> 0
+ddcom696 compare 12.000000 12 -> 0
+ddcom697 compare 12.0000000 12 -> 0
+ddcom698 compare 12.00000000 12 -> 0
+ddcom699 compare 12.000000000 12 -> 0
+
+-- first, second, & last digit
+ddcom700 compare 1234567890123456 1234567890123455 -> 1
+ddcom701 compare 1234567890123456 1234567890123456 -> 0
+ddcom702 compare 1234567890123456 1234567890123457 -> -1
+ddcom703 compare 1234567890123456 0234567890123456 -> 1
+ddcom704 compare 1234567890123456 1234567890123456 -> 0
+ddcom705 compare 1234567890123456 2234567890123456 -> -1
+ddcom706 compare 1134567890123456 1034567890123456 -> 1
+ddcom707 compare 1134567890123456 1134567890123456 -> 0
+ddcom708 compare 1134567890123456 1234567890123456 -> -1
+
+-- miscellaneous
+ddcom721 compare 12345678000 1 -> 1
+ddcom722 compare 1 12345678000 -> -1
+ddcom723 compare 1234567800 1 -> 1
+ddcom724 compare 1 1234567800 -> -1
+ddcom725 compare 1234567890 1 -> 1
+ddcom726 compare 1 1234567890 -> -1
+ddcom727 compare 1234567891 1 -> 1
+ddcom728 compare 1 1234567891 -> -1
+ddcom729 compare 12345678901 1 -> 1
+ddcom730 compare 1 12345678901 -> -1
+ddcom731 compare 1234567896 1 -> 1
+ddcom732 compare 1 1234567896 -> -1
+
+-- residue cases at lower precision
+ddcom740 compare 1 0.9999999 -> 1
+ddcom741 compare 1 0.999999 -> 1
+ddcom742 compare 1 0.99999 -> 1
+ddcom743 compare 1 1.0000 -> 0
+ddcom744 compare 1 1.00001 -> -1
+ddcom745 compare 1 1.000001 -> -1
+ddcom746 compare 1 1.0000001 -> -1
+ddcom750 compare 0.9999999 1 -> -1
+ddcom751 compare 0.999999 1 -> -1
+ddcom752 compare 0.99999 1 -> -1
+ddcom753 compare 1.0000 1 -> 0
+ddcom754 compare 1.00001 1 -> 1
+ddcom755 compare 1.000001 1 -> 1
+ddcom756 compare 1.0000001 1 -> 1
+
+-- Specials
+ddcom780 compare Inf -Inf -> 1
+ddcom781 compare Inf -1000 -> 1
+ddcom782 compare Inf -1 -> 1
+ddcom783 compare Inf -0 -> 1
+ddcom784 compare Inf 0 -> 1
+ddcom785 compare Inf 1 -> 1
+ddcom786 compare Inf 1000 -> 1
+ddcom787 compare Inf Inf -> 0
+ddcom788 compare -1000 Inf -> -1
+ddcom789 compare -Inf Inf -> -1
+ddcom790 compare -1 Inf -> -1
+ddcom791 compare -0 Inf -> -1
+ddcom792 compare 0 Inf -> -1
+ddcom793 compare 1 Inf -> -1
+ddcom794 compare 1000 Inf -> -1
+ddcom795 compare Inf Inf -> 0
+
+ddcom800 compare -Inf -Inf -> 0
+ddcom801 compare -Inf -1000 -> -1
+ddcom802 compare -Inf -1 -> -1
+ddcom803 compare -Inf -0 -> -1
+ddcom804 compare -Inf 0 -> -1
+ddcom805 compare -Inf 1 -> -1
+ddcom806 compare -Inf 1000 -> -1
+ddcom807 compare -Inf Inf -> -1
+ddcom808 compare -Inf -Inf -> 0
+ddcom809 compare -1000 -Inf -> 1
+ddcom810 compare -1 -Inf -> 1
+ddcom811 compare -0 -Inf -> 1
+ddcom812 compare 0 -Inf -> 1
+ddcom813 compare 1 -Inf -> 1
+ddcom814 compare 1000 -Inf -> 1
+ddcom815 compare Inf -Inf -> 1
+
+ddcom821 compare NaN -Inf -> NaN
+ddcom822 compare NaN -1000 -> NaN
+ddcom823 compare NaN -1 -> NaN
+ddcom824 compare NaN -0 -> NaN
+ddcom825 compare NaN 0 -> NaN
+ddcom826 compare NaN 1 -> NaN
+ddcom827 compare NaN 1000 -> NaN
+ddcom828 compare NaN Inf -> NaN
+ddcom829 compare NaN NaN -> NaN
+ddcom830 compare -Inf NaN -> NaN
+ddcom831 compare -1000 NaN -> NaN
+ddcom832 compare -1 NaN -> NaN
+ddcom833 compare -0 NaN -> NaN
+ddcom834 compare 0 NaN -> NaN
+ddcom835 compare 1 NaN -> NaN
+ddcom836 compare 1000 NaN -> NaN
+ddcom837 compare Inf NaN -> NaN
+ddcom838 compare -NaN -NaN -> -NaN
+ddcom839 compare +NaN -NaN -> NaN
+ddcom840 compare -NaN +NaN -> -NaN
+
+ddcom841 compare sNaN -Inf -> NaN Invalid_operation
+ddcom842 compare sNaN -1000 -> NaN Invalid_operation
+ddcom843 compare sNaN -1 -> NaN Invalid_operation
+ddcom844 compare sNaN -0 -> NaN Invalid_operation
+ddcom845 compare sNaN 0 -> NaN Invalid_operation
+ddcom846 compare sNaN 1 -> NaN Invalid_operation
+ddcom847 compare sNaN 1000 -> NaN Invalid_operation
+ddcom848 compare sNaN NaN -> NaN Invalid_operation
+ddcom849 compare sNaN sNaN -> NaN Invalid_operation
+ddcom850 compare NaN sNaN -> NaN Invalid_operation
+ddcom851 compare -Inf sNaN -> NaN Invalid_operation
+ddcom852 compare -1000 sNaN -> NaN Invalid_operation
+ddcom853 compare -1 sNaN -> NaN Invalid_operation
+ddcom854 compare -0 sNaN -> NaN Invalid_operation
+ddcom855 compare 0 sNaN -> NaN Invalid_operation
+ddcom856 compare 1 sNaN -> NaN Invalid_operation
+ddcom857 compare 1000 sNaN -> NaN Invalid_operation
+ddcom858 compare Inf sNaN -> NaN Invalid_operation
+ddcom859 compare NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddcom860 compare NaN9 -Inf -> NaN9
+ddcom861 compare NaN8 999 -> NaN8
+ddcom862 compare NaN77 Inf -> NaN77
+ddcom863 compare -NaN67 NaN5 -> -NaN67
+ddcom864 compare -Inf -NaN4 -> -NaN4
+ddcom865 compare -999 -NaN33 -> -NaN33
+ddcom866 compare Inf NaN2 -> NaN2
+ddcom867 compare -NaN41 -NaN42 -> -NaN41
+ddcom868 compare +NaN41 -NaN42 -> NaN41
+ddcom869 compare -NaN41 +NaN42 -> -NaN41
+ddcom870 compare +NaN41 +NaN42 -> NaN41
+
+ddcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
+ddcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
+ddcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
+ddcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
+ddcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
+ddcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
+ddcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
+ddcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
+ddcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- wide range
+ddcom880 compare +1.23456789012345E-0 9E+384 -> -1
+ddcom881 compare 9E+384 +1.23456789012345E-0 -> 1
+ddcom882 compare +0.100 9E-383 -> 1
+ddcom883 compare 9E-383 +0.100 -> -1
+ddcom885 compare -1.23456789012345E-0 9E+384 -> -1
+ddcom886 compare 9E+384 -1.23456789012345E-0 -> 1
+ddcom887 compare -0.100 9E-383 -> -1
+ddcom888 compare 9E-383 -0.100 -> 1
+
+-- spread zeros
+ddcom900 compare 0E-383 0 -> 0
+ddcom901 compare 0E-383 -0 -> 0
+ddcom902 compare -0E-383 0 -> 0
+ddcom903 compare -0E-383 -0 -> 0
+ddcom904 compare 0E-383 0E+384 -> 0
+ddcom905 compare 0E-383 -0E+384 -> 0
+ddcom906 compare -0E-383 0E+384 -> 0
+ddcom907 compare -0E-383 -0E+384 -> 0
+ddcom908 compare 0 0E+384 -> 0
+ddcom909 compare 0 -0E+384 -> 0
+ddcom910 compare -0 0E+384 -> 0
+ddcom911 compare -0 -0E+384 -> 0
+ddcom930 compare 0E+384 0 -> 0
+ddcom931 compare 0E+384 -0 -> 0
+ddcom932 compare -0E+384 0 -> 0
+ddcom933 compare -0E+384 -0 -> 0
+ddcom934 compare 0E+384 0E-383 -> 0
+ddcom935 compare 0E+384 -0E-383 -> 0
+ddcom936 compare -0E+384 0E-383 -> 0
+ddcom937 compare -0E+384 -0E-383 -> 0
+ddcom938 compare 0 0E-383 -> 0
+ddcom939 compare 0 -0E-383 -> 0
+ddcom940 compare -0 0E-383 -> 0
+ddcom941 compare -0 -0E-383 -> 0
+
+-- signs
+ddcom961 compare 1e+77 1e+11 -> 1
+ddcom962 compare 1e+77 -1e+11 -> 1
+ddcom963 compare -1e+77 1e+11 -> -1
+ddcom964 compare -1e+77 -1e+11 -> -1
+ddcom965 compare 1e-77 1e-11 -> -1
+ddcom966 compare 1e-77 -1e-11 -> 1
+ddcom967 compare -1e-77 1e-11 -> -1
+ddcom968 compare -1e-77 -1e-11 -> 1
+
+-- full alignment range, both ways
+ddcomp1001 compare 1 1.000000000000000 -> 0
+ddcomp1002 compare 1 1.00000000000000 -> 0
+ddcomp1003 compare 1 1.0000000000000 -> 0
+ddcomp1004 compare 1 1.000000000000 -> 0
+ddcomp1005 compare 1 1.00000000000 -> 0
+ddcomp1006 compare 1 1.0000000000 -> 0
+ddcomp1007 compare 1 1.000000000 -> 0
+ddcomp1008 compare 1 1.00000000 -> 0
+ddcomp1009 compare 1 1.0000000 -> 0
+ddcomp1010 compare 1 1.000000 -> 0
+ddcomp1011 compare 1 1.00000 -> 0
+ddcomp1012 compare 1 1.0000 -> 0
+ddcomp1013 compare 1 1.000 -> 0
+ddcomp1014 compare 1 1.00 -> 0
+ddcomp1015 compare 1 1.0 -> 0
+ddcomp1021 compare 1.000000000000000 1 -> 0
+ddcomp1022 compare 1.00000000000000 1 -> 0
+ddcomp1023 compare 1.0000000000000 1 -> 0
+ddcomp1024 compare 1.000000000000 1 -> 0
+ddcomp1025 compare 1.00000000000 1 -> 0
+ddcomp1026 compare 1.0000000000 1 -> 0
+ddcomp1027 compare 1.000000000 1 -> 0
+ddcomp1028 compare 1.00000000 1 -> 0
+ddcomp1029 compare 1.0000000 1 -> 0
+ddcomp1030 compare 1.000000 1 -> 0
+ddcomp1031 compare 1.00000 1 -> 0
+ddcomp1032 compare 1.0000 1 -> 0
+ddcomp1033 compare 1.000 1 -> 0
+ddcomp1034 compare 1.00 1 -> 0
+ddcomp1035 compare 1.0 1 -> 0
+
+-- check MSD always detected non-zero
+ddcomp1040 compare 0 0.000000000000000 -> 0
+ddcomp1041 compare 0 1.000000000000000 -> -1
+ddcomp1042 compare 0 2.000000000000000 -> -1
+ddcomp1043 compare 0 3.000000000000000 -> -1
+ddcomp1044 compare 0 4.000000000000000 -> -1
+ddcomp1045 compare 0 5.000000000000000 -> -1
+ddcomp1046 compare 0 6.000000000000000 -> -1
+ddcomp1047 compare 0 7.000000000000000 -> -1
+ddcomp1048 compare 0 8.000000000000000 -> -1
+ddcomp1049 compare 0 9.000000000000000 -> -1
+ddcomp1050 compare 0.000000000000000 0 -> 0
+ddcomp1051 compare 1.000000000000000 0 -> 1
+ddcomp1052 compare 2.000000000000000 0 -> 1
+ddcomp1053 compare 3.000000000000000 0 -> 1
+ddcomp1054 compare 4.000000000000000 0 -> 1
+ddcomp1055 compare 5.000000000000000 0 -> 1
+ddcomp1056 compare 6.000000000000000 0 -> 1
+ddcomp1057 compare 7.000000000000000 0 -> 1
+ddcomp1058 compare 8.000000000000000 0 -> 1
+ddcomp1059 compare 9.000000000000000 0 -> 1
+
+-- Null tests
+ddcom9990 compare 10 # -> NaN Invalid_operation
+ddcom9991 compare # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddCompareSig.decTest b/Lib/test/decimaltestdata/ddCompareSig.decTest
index 8d3fce08c7..c82ec45517 100644
--- a/Lib/test/decimaltestdata/ddCompareSig.decTest
+++ b/Lib/test/decimaltestdata/ddCompareSig.decTest
@@ -1,647 +1,647 @@
-------------------------------------------------------------------------
--- ddCompareSig.decTest -- decDouble comparison; all NaNs signal --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddcms001 comparesig -2 -2 -> 0
-ddcms002 comparesig -2 -1 -> -1
-ddcms003 comparesig -2 0 -> -1
-ddcms004 comparesig -2 1 -> -1
-ddcms005 comparesig -2 2 -> -1
-ddcms006 comparesig -1 -2 -> 1
-ddcms007 comparesig -1 -1 -> 0
-ddcms008 comparesig -1 0 -> -1
-ddcms009 comparesig -1 1 -> -1
-ddcms010 comparesig -1 2 -> -1
-ddcms011 comparesig 0 -2 -> 1
-ddcms012 comparesig 0 -1 -> 1
-ddcms013 comparesig 0 0 -> 0
-ddcms014 comparesig 0 1 -> -1
-ddcms015 comparesig 0 2 -> -1
-ddcms016 comparesig 1 -2 -> 1
-ddcms017 comparesig 1 -1 -> 1
-ddcms018 comparesig 1 0 -> 1
-ddcms019 comparesig 1 1 -> 0
-ddcms020 comparesig 1 2 -> -1
-ddcms021 comparesig 2 -2 -> 1
-ddcms022 comparesig 2 -1 -> 1
-ddcms023 comparesig 2 0 -> 1
-ddcms025 comparesig 2 1 -> 1
-ddcms026 comparesig 2 2 -> 0
-
-ddcms031 comparesig -20 -20 -> 0
-ddcms032 comparesig -20 -10 -> -1
-ddcms033 comparesig -20 00 -> -1
-ddcms034 comparesig -20 10 -> -1
-ddcms035 comparesig -20 20 -> -1
-ddcms036 comparesig -10 -20 -> 1
-ddcms037 comparesig -10 -10 -> 0
-ddcms038 comparesig -10 00 -> -1
-ddcms039 comparesig -10 10 -> -1
-ddcms040 comparesig -10 20 -> -1
-ddcms041 comparesig 00 -20 -> 1
-ddcms042 comparesig 00 -10 -> 1
-ddcms043 comparesig 00 00 -> 0
-ddcms044 comparesig 00 10 -> -1
-ddcms045 comparesig 00 20 -> -1
-ddcms046 comparesig 10 -20 -> 1
-ddcms047 comparesig 10 -10 -> 1
-ddcms048 comparesig 10 00 -> 1
-ddcms049 comparesig 10 10 -> 0
-ddcms050 comparesig 10 20 -> -1
-ddcms051 comparesig 20 -20 -> 1
-ddcms052 comparesig 20 -10 -> 1
-ddcms053 comparesig 20 00 -> 1
-ddcms055 comparesig 20 10 -> 1
-ddcms056 comparesig 20 20 -> 0
-
-ddcms061 comparesig -2.0 -2.0 -> 0
-ddcms062 comparesig -2.0 -1.0 -> -1
-ddcms063 comparesig -2.0 0.0 -> -1
-ddcms064 comparesig -2.0 1.0 -> -1
-ddcms065 comparesig -2.0 2.0 -> -1
-ddcms066 comparesig -1.0 -2.0 -> 1
-ddcms067 comparesig -1.0 -1.0 -> 0
-ddcms068 comparesig -1.0 0.0 -> -1
-ddcms069 comparesig -1.0 1.0 -> -1
-ddcms070 comparesig -1.0 2.0 -> -1
-ddcms071 comparesig 0.0 -2.0 -> 1
-ddcms072 comparesig 0.0 -1.0 -> 1
-ddcms073 comparesig 0.0 0.0 -> 0
-ddcms074 comparesig 0.0 1.0 -> -1
-ddcms075 comparesig 0.0 2.0 -> -1
-ddcms076 comparesig 1.0 -2.0 -> 1
-ddcms077 comparesig 1.0 -1.0 -> 1
-ddcms078 comparesig 1.0 0.0 -> 1
-ddcms079 comparesig 1.0 1.0 -> 0
-ddcms080 comparesig 1.0 2.0 -> -1
-ddcms081 comparesig 2.0 -2.0 -> 1
-ddcms082 comparesig 2.0 -1.0 -> 1
-ddcms083 comparesig 2.0 0.0 -> 1
-ddcms085 comparesig 2.0 1.0 -> 1
-ddcms086 comparesig 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-ddcms090 comparesig 9.999999999999999E+384 9.999999999999999E+384 -> 0
-ddcms091 comparesig -9.999999999999999E+384 9.999999999999999E+384 -> -1
-ddcms092 comparesig 9.999999999999999E+384 -9.999999999999999E+384 -> 1
-ddcms093 comparesig -9.999999999999999E+384 -9.999999999999999E+384 -> 0
-
--- some differing length/exponent cases
-ddcms100 comparesig 7.0 7.0 -> 0
-ddcms101 comparesig 7.0 7 -> 0
-ddcms102 comparesig 7 7.0 -> 0
-ddcms103 comparesig 7E+0 7.0 -> 0
-ddcms104 comparesig 70E-1 7.0 -> 0
-ddcms105 comparesig 0.7E+1 7 -> 0
-ddcms106 comparesig 70E-1 7 -> 0
-ddcms107 comparesig 7.0 7E+0 -> 0
-ddcms108 comparesig 7.0 70E-1 -> 0
-ddcms109 comparesig 7 0.7E+1 -> 0
-ddcms110 comparesig 7 70E-1 -> 0
-
-ddcms120 comparesig 8.0 7.0 -> 1
-ddcms121 comparesig 8.0 7 -> 1
-ddcms122 comparesig 8 7.0 -> 1
-ddcms123 comparesig 8E+0 7.0 -> 1
-ddcms124 comparesig 80E-1 7.0 -> 1
-ddcms125 comparesig 0.8E+1 7 -> 1
-ddcms126 comparesig 80E-1 7 -> 1
-ddcms127 comparesig 8.0 7E+0 -> 1
-ddcms128 comparesig 8.0 70E-1 -> 1
-ddcms129 comparesig 8 0.7E+1 -> 1
-ddcms130 comparesig 8 70E-1 -> 1
-
-ddcms140 comparesig 8.0 9.0 -> -1
-ddcms141 comparesig 8.0 9 -> -1
-ddcms142 comparesig 8 9.0 -> -1
-ddcms143 comparesig 8E+0 9.0 -> -1
-ddcms144 comparesig 80E-1 9.0 -> -1
-ddcms145 comparesig 0.8E+1 9 -> -1
-ddcms146 comparesig 80E-1 9 -> -1
-ddcms147 comparesig 8.0 9E+0 -> -1
-ddcms148 comparesig 8.0 90E-1 -> -1
-ddcms149 comparesig 8 0.9E+1 -> -1
-ddcms150 comparesig 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ddcms200 comparesig -7.0 7.0 -> -1
-ddcms201 comparesig -7.0 7 -> -1
-ddcms202 comparesig -7 7.0 -> -1
-ddcms203 comparesig -7E+0 7.0 -> -1
-ddcms204 comparesig -70E-1 7.0 -> -1
-ddcms205 comparesig -0.7E+1 7 -> -1
-ddcms206 comparesig -70E-1 7 -> -1
-ddcms207 comparesig -7.0 7E+0 -> -1
-ddcms208 comparesig -7.0 70E-1 -> -1
-ddcms209 comparesig -7 0.7E+1 -> -1
-ddcms210 comparesig -7 70E-1 -> -1
-
-ddcms220 comparesig -8.0 7.0 -> -1
-ddcms221 comparesig -8.0 7 -> -1
-ddcms222 comparesig -8 7.0 -> -1
-ddcms223 comparesig -8E+0 7.0 -> -1
-ddcms224 comparesig -80E-1 7.0 -> -1
-ddcms225 comparesig -0.8E+1 7 -> -1
-ddcms226 comparesig -80E-1 7 -> -1
-ddcms227 comparesig -8.0 7E+0 -> -1
-ddcms228 comparesig -8.0 70E-1 -> -1
-ddcms229 comparesig -8 0.7E+1 -> -1
-ddcms230 comparesig -8 70E-1 -> -1
-
-ddcms240 comparesig -8.0 9.0 -> -1
-ddcms241 comparesig -8.0 9 -> -1
-ddcms242 comparesig -8 9.0 -> -1
-ddcms243 comparesig -8E+0 9.0 -> -1
-ddcms244 comparesig -80E-1 9.0 -> -1
-ddcms245 comparesig -0.8E+1 9 -> -1
-ddcms246 comparesig -80E-1 9 -> -1
-ddcms247 comparesig -8.0 9E+0 -> -1
-ddcms248 comparesig -8.0 90E-1 -> -1
-ddcms249 comparesig -8 0.9E+1 -> -1
-ddcms250 comparesig -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ddcms300 comparesig 7.0 -7.0 -> 1
-ddcms301 comparesig 7.0 -7 -> 1
-ddcms302 comparesig 7 -7.0 -> 1
-ddcms303 comparesig 7E+0 -7.0 -> 1
-ddcms304 comparesig 70E-1 -7.0 -> 1
-ddcms305 comparesig .7E+1 -7 -> 1
-ddcms306 comparesig 70E-1 -7 -> 1
-ddcms307 comparesig 7.0 -7E+0 -> 1
-ddcms308 comparesig 7.0 -70E-1 -> 1
-ddcms309 comparesig 7 -.7E+1 -> 1
-ddcms310 comparesig 7 -70E-1 -> 1
-
-ddcms320 comparesig 8.0 -7.0 -> 1
-ddcms321 comparesig 8.0 -7 -> 1
-ddcms322 comparesig 8 -7.0 -> 1
-ddcms323 comparesig 8E+0 -7.0 -> 1
-ddcms324 comparesig 80E-1 -7.0 -> 1
-ddcms325 comparesig .8E+1 -7 -> 1
-ddcms326 comparesig 80E-1 -7 -> 1
-ddcms327 comparesig 8.0 -7E+0 -> 1
-ddcms328 comparesig 8.0 -70E-1 -> 1
-ddcms329 comparesig 8 -.7E+1 -> 1
-ddcms330 comparesig 8 -70E-1 -> 1
-
-ddcms340 comparesig 8.0 -9.0 -> 1
-ddcms341 comparesig 8.0 -9 -> 1
-ddcms342 comparesig 8 -9.0 -> 1
-ddcms343 comparesig 8E+0 -9.0 -> 1
-ddcms344 comparesig 80E-1 -9.0 -> 1
-ddcms345 comparesig .8E+1 -9 -> 1
-ddcms346 comparesig 80E-1 -9 -> 1
-ddcms347 comparesig 8.0 -9E+0 -> 1
-ddcms348 comparesig 8.0 -90E-1 -> 1
-ddcms349 comparesig 8 -.9E+1 -> 1
-ddcms350 comparesig 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-ddcms400 comparesig -7.0 -7.0 -> 0
-ddcms401 comparesig -7.0 -7 -> 0
-ddcms402 comparesig -7 -7.0 -> 0
-ddcms403 comparesig -7E+0 -7.0 -> 0
-ddcms404 comparesig -70E-1 -7.0 -> 0
-ddcms405 comparesig -.7E+1 -7 -> 0
-ddcms406 comparesig -70E-1 -7 -> 0
-ddcms407 comparesig -7.0 -7E+0 -> 0
-ddcms408 comparesig -7.0 -70E-1 -> 0
-ddcms409 comparesig -7 -.7E+1 -> 0
-ddcms410 comparesig -7 -70E-1 -> 0
-
-ddcms420 comparesig -8.0 -7.0 -> -1
-ddcms421 comparesig -8.0 -7 -> -1
-ddcms422 comparesig -8 -7.0 -> -1
-ddcms423 comparesig -8E+0 -7.0 -> -1
-ddcms424 comparesig -80E-1 -7.0 -> -1
-ddcms425 comparesig -.8E+1 -7 -> -1
-ddcms426 comparesig -80E-1 -7 -> -1
-ddcms427 comparesig -8.0 -7E+0 -> -1
-ddcms428 comparesig -8.0 -70E-1 -> -1
-ddcms429 comparesig -8 -.7E+1 -> -1
-ddcms430 comparesig -8 -70E-1 -> -1
-
-ddcms440 comparesig -8.0 -9.0 -> 1
-ddcms441 comparesig -8.0 -9 -> 1
-ddcms442 comparesig -8 -9.0 -> 1
-ddcms443 comparesig -8E+0 -9.0 -> 1
-ddcms444 comparesig -80E-1 -9.0 -> 1
-ddcms445 comparesig -.8E+1 -9 -> 1
-ddcms446 comparesig -80E-1 -9 -> 1
-ddcms447 comparesig -8.0 -9E+0 -> 1
-ddcms448 comparesig -8.0 -90E-1 -> 1
-ddcms449 comparesig -8 -.9E+1 -> 1
-ddcms450 comparesig -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-ddcms473 comparesig 123.4560000000000E-89 123.456E-89 -> 0
-ddcms474 comparesig 123.456000000000E+89 123.456E+89 -> 0
-ddcms475 comparesig 123.45600000000E-89 123.456E-89 -> 0
-ddcms476 comparesig 123.4560000000E+89 123.456E+89 -> 0
-ddcms477 comparesig 123.456000000E-89 123.456E-89 -> 0
-ddcms478 comparesig 123.45600000E+89 123.456E+89 -> 0
-ddcms479 comparesig 123.4560000E-89 123.456E-89 -> 0
-ddcms480 comparesig 123.456000E+89 123.456E+89 -> 0
-ddcms481 comparesig 123.45600E-89 123.456E-89 -> 0
-ddcms482 comparesig 123.4560E+89 123.456E+89 -> 0
-ddcms483 comparesig 123.456E-89 123.456E-89 -> 0
-ddcms487 comparesig 123.456E+89 123.4560000000000E+89 -> 0
-ddcms488 comparesig 123.456E-89 123.456000000000E-89 -> 0
-ddcms489 comparesig 123.456E+89 123.45600000000E+89 -> 0
-ddcms490 comparesig 123.456E-89 123.4560000000E-89 -> 0
-ddcms491 comparesig 123.456E+89 123.456000000E+89 -> 0
-ddcms492 comparesig 123.456E-89 123.45600000E-89 -> 0
-ddcms493 comparesig 123.456E+89 123.4560000E+89 -> 0
-ddcms494 comparesig 123.456E-89 123.456000E-89 -> 0
-ddcms495 comparesig 123.456E+89 123.45600E+89 -> 0
-ddcms496 comparesig 123.456E-89 123.4560E-89 -> 0
-ddcms497 comparesig 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-ddcms500 comparesig 1 1E-15 -> 1
-ddcms501 comparesig 1 1E-14 -> 1
-ddcms502 comparesig 1 1E-13 -> 1
-ddcms503 comparesig 1 1E-12 -> 1
-ddcms504 comparesig 1 1E-11 -> 1
-ddcms505 comparesig 1 1E-10 -> 1
-ddcms506 comparesig 1 1E-9 -> 1
-ddcms507 comparesig 1 1E-8 -> 1
-ddcms508 comparesig 1 1E-7 -> 1
-ddcms509 comparesig 1 1E-6 -> 1
-ddcms510 comparesig 1 1E-5 -> 1
-ddcms511 comparesig 1 1E-4 -> 1
-ddcms512 comparesig 1 1E-3 -> 1
-ddcms513 comparesig 1 1E-2 -> 1
-ddcms514 comparesig 1 1E-1 -> 1
-ddcms515 comparesig 1 1E-0 -> 0
-ddcms516 comparesig 1 1E+1 -> -1
-ddcms517 comparesig 1 1E+2 -> -1
-ddcms518 comparesig 1 1E+3 -> -1
-ddcms519 comparesig 1 1E+4 -> -1
-ddcms521 comparesig 1 1E+5 -> -1
-ddcms522 comparesig 1 1E+6 -> -1
-ddcms523 comparesig 1 1E+7 -> -1
-ddcms524 comparesig 1 1E+8 -> -1
-ddcms525 comparesig 1 1E+9 -> -1
-ddcms526 comparesig 1 1E+10 -> -1
-ddcms527 comparesig 1 1E+11 -> -1
-ddcms528 comparesig 1 1E+12 -> -1
-ddcms529 comparesig 1 1E+13 -> -1
-ddcms530 comparesig 1 1E+14 -> -1
-ddcms531 comparesig 1 1E+15 -> -1
--- LR swap
-ddcms540 comparesig 1E-15 1 -> -1
-ddcms541 comparesig 1E-14 1 -> -1
-ddcms542 comparesig 1E-13 1 -> -1
-ddcms543 comparesig 1E-12 1 -> -1
-ddcms544 comparesig 1E-11 1 -> -1
-ddcms545 comparesig 1E-10 1 -> -1
-ddcms546 comparesig 1E-9 1 -> -1
-ddcms547 comparesig 1E-8 1 -> -1
-ddcms548 comparesig 1E-7 1 -> -1
-ddcms549 comparesig 1E-6 1 -> -1
-ddcms550 comparesig 1E-5 1 -> -1
-ddcms551 comparesig 1E-4 1 -> -1
-ddcms552 comparesig 1E-3 1 -> -1
-ddcms553 comparesig 1E-2 1 -> -1
-ddcms554 comparesig 1E-1 1 -> -1
-ddcms555 comparesig 1E-0 1 -> 0
-ddcms556 comparesig 1E+1 1 -> 1
-ddcms557 comparesig 1E+2 1 -> 1
-ddcms558 comparesig 1E+3 1 -> 1
-ddcms559 comparesig 1E+4 1 -> 1
-ddcms561 comparesig 1E+5 1 -> 1
-ddcms562 comparesig 1E+6 1 -> 1
-ddcms563 comparesig 1E+7 1 -> 1
-ddcms564 comparesig 1E+8 1 -> 1
-ddcms565 comparesig 1E+9 1 -> 1
-ddcms566 comparesig 1E+10 1 -> 1
-ddcms567 comparesig 1E+11 1 -> 1
-ddcms568 comparesig 1E+12 1 -> 1
-ddcms569 comparesig 1E+13 1 -> 1
-ddcms570 comparesig 1E+14 1 -> 1
-ddcms571 comparesig 1E+15 1 -> 1
--- similar with a useful coefficient, one side only
-ddcms580 comparesig 0.000000987654321 1E-15 -> 1
-ddcms581 comparesig 0.000000987654321 1E-14 -> 1
-ddcms582 comparesig 0.000000987654321 1E-13 -> 1
-ddcms583 comparesig 0.000000987654321 1E-12 -> 1
-ddcms584 comparesig 0.000000987654321 1E-11 -> 1
-ddcms585 comparesig 0.000000987654321 1E-10 -> 1
-ddcms586 comparesig 0.000000987654321 1E-9 -> 1
-ddcms587 comparesig 0.000000987654321 1E-8 -> 1
-ddcms588 comparesig 0.000000987654321 1E-7 -> 1
-ddcms589 comparesig 0.000000987654321 1E-6 -> -1
-ddcms590 comparesig 0.000000987654321 1E-5 -> -1
-ddcms591 comparesig 0.000000987654321 1E-4 -> -1
-ddcms592 comparesig 0.000000987654321 1E-3 -> -1
-ddcms593 comparesig 0.000000987654321 1E-2 -> -1
-ddcms594 comparesig 0.000000987654321 1E-1 -> -1
-ddcms595 comparesig 0.000000987654321 1E-0 -> -1
-ddcms596 comparesig 0.000000987654321 1E+1 -> -1
-ddcms597 comparesig 0.000000987654321 1E+2 -> -1
-ddcms598 comparesig 0.000000987654321 1E+3 -> -1
-ddcms599 comparesig 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-ddcms600 comparesig 12 12.2345 -> -1
-ddcms601 comparesig 12.0 12.2345 -> -1
-ddcms602 comparesig 12.00 12.2345 -> -1
-ddcms603 comparesig 12.000 12.2345 -> -1
-ddcms604 comparesig 12.0000 12.2345 -> -1
-ddcms605 comparesig 12.00000 12.2345 -> -1
-ddcms606 comparesig 12.000000 12.2345 -> -1
-ddcms607 comparesig 12.0000000 12.2345 -> -1
-ddcms608 comparesig 12.00000000 12.2345 -> -1
-ddcms609 comparesig 12.000000000 12.2345 -> -1
-ddcms610 comparesig 12.1234 12 -> 1
-ddcms611 comparesig 12.1234 12.0 -> 1
-ddcms612 comparesig 12.1234 12.00 -> 1
-ddcms613 comparesig 12.1234 12.000 -> 1
-ddcms614 comparesig 12.1234 12.0000 -> 1
-ddcms615 comparesig 12.1234 12.00000 -> 1
-ddcms616 comparesig 12.1234 12.000000 -> 1
-ddcms617 comparesig 12.1234 12.0000000 -> 1
-ddcms618 comparesig 12.1234 12.00000000 -> 1
-ddcms619 comparesig 12.1234 12.000000000 -> 1
-ddcms620 comparesig -12 -12.2345 -> 1
-ddcms621 comparesig -12.0 -12.2345 -> 1
-ddcms622 comparesig -12.00 -12.2345 -> 1
-ddcms623 comparesig -12.000 -12.2345 -> 1
-ddcms624 comparesig -12.0000 -12.2345 -> 1
-ddcms625 comparesig -12.00000 -12.2345 -> 1
-ddcms626 comparesig -12.000000 -12.2345 -> 1
-ddcms627 comparesig -12.0000000 -12.2345 -> 1
-ddcms628 comparesig -12.00000000 -12.2345 -> 1
-ddcms629 comparesig -12.000000000 -12.2345 -> 1
-ddcms630 comparesig -12.1234 -12 -> -1
-ddcms631 comparesig -12.1234 -12.0 -> -1
-ddcms632 comparesig -12.1234 -12.00 -> -1
-ddcms633 comparesig -12.1234 -12.000 -> -1
-ddcms634 comparesig -12.1234 -12.0000 -> -1
-ddcms635 comparesig -12.1234 -12.00000 -> -1
-ddcms636 comparesig -12.1234 -12.000000 -> -1
-ddcms637 comparesig -12.1234 -12.0000000 -> -1
-ddcms638 comparesig -12.1234 -12.00000000 -> -1
-ddcms639 comparesig -12.1234 -12.000000000 -> -1
-
--- extended zeros
-ddcms640 comparesig 0 0 -> 0
-ddcms641 comparesig 0 -0 -> 0
-ddcms642 comparesig 0 -0.0 -> 0
-ddcms643 comparesig 0 0.0 -> 0
-ddcms644 comparesig -0 0 -> 0
-ddcms645 comparesig -0 -0 -> 0
-ddcms646 comparesig -0 -0.0 -> 0
-ddcms647 comparesig -0 0.0 -> 0
-ddcms648 comparesig 0.0 0 -> 0
-ddcms649 comparesig 0.0 -0 -> 0
-ddcms650 comparesig 0.0 -0.0 -> 0
-ddcms651 comparesig 0.0 0.0 -> 0
-ddcms652 comparesig -0.0 0 -> 0
-ddcms653 comparesig -0.0 -0 -> 0
-ddcms654 comparesig -0.0 -0.0 -> 0
-ddcms655 comparesig -0.0 0.0 -> 0
-
-ddcms656 comparesig -0E1 0.0 -> 0
-ddcms657 comparesig -0E2 0.0 -> 0
-ddcms658 comparesig 0E1 0.0 -> 0
-ddcms659 comparesig 0E2 0.0 -> 0
-ddcms660 comparesig -0E1 0 -> 0
-ddcms661 comparesig -0E2 0 -> 0
-ddcms662 comparesig 0E1 0 -> 0
-ddcms663 comparesig 0E2 0 -> 0
-ddcms664 comparesig -0E1 -0E1 -> 0
-ddcms665 comparesig -0E2 -0E1 -> 0
-ddcms666 comparesig 0E1 -0E1 -> 0
-ddcms667 comparesig 0E2 -0E1 -> 0
-ddcms668 comparesig -0E1 -0E2 -> 0
-ddcms669 comparesig -0E2 -0E2 -> 0
-ddcms670 comparesig 0E1 -0E2 -> 0
-ddcms671 comparesig 0E2 -0E2 -> 0
-ddcms672 comparesig -0E1 0E1 -> 0
-ddcms673 comparesig -0E2 0E1 -> 0
-ddcms674 comparesig 0E1 0E1 -> 0
-ddcms675 comparesig 0E2 0E1 -> 0
-ddcms676 comparesig -0E1 0E2 -> 0
-ddcms677 comparesig -0E2 0E2 -> 0
-ddcms678 comparesig 0E1 0E2 -> 0
-ddcms679 comparesig 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-ddcms680 comparesig 12 12 -> 0
-ddcms681 comparesig 12 12.0 -> 0
-ddcms682 comparesig 12 12.00 -> 0
-ddcms683 comparesig 12 12.000 -> 0
-ddcms684 comparesig 12 12.0000 -> 0
-ddcms685 comparesig 12 12.00000 -> 0
-ddcms686 comparesig 12 12.000000 -> 0
-ddcms687 comparesig 12 12.0000000 -> 0
-ddcms688 comparesig 12 12.00000000 -> 0
-ddcms689 comparesig 12 12.000000000 -> 0
-ddcms690 comparesig 12 12 -> 0
-ddcms691 comparesig 12.0 12 -> 0
-ddcms692 comparesig 12.00 12 -> 0
-ddcms693 comparesig 12.000 12 -> 0
-ddcms694 comparesig 12.0000 12 -> 0
-ddcms695 comparesig 12.00000 12 -> 0
-ddcms696 comparesig 12.000000 12 -> 0
-ddcms697 comparesig 12.0000000 12 -> 0
-ddcms698 comparesig 12.00000000 12 -> 0
-ddcms699 comparesig 12.000000000 12 -> 0
-
--- first, second, & last digit
-ddcms700 comparesig 1234567890123456 1234567890123455 -> 1
-ddcms701 comparesig 1234567890123456 1234567890123456 -> 0
-ddcms702 comparesig 1234567890123456 1234567890123457 -> -1
-ddcms703 comparesig 1234567890123456 0234567890123456 -> 1
-ddcms704 comparesig 1234567890123456 1234567890123456 -> 0
-ddcms705 comparesig 1234567890123456 2234567890123456 -> -1
-ddcms706 comparesig 1134567890123456 1034567890123456 -> 1
-ddcms707 comparesig 1134567890123456 1134567890123456 -> 0
-ddcms708 comparesig 1134567890123456 1234567890123456 -> -1
-
--- miscellaneous
-ddcms721 comparesig 12345678000 1 -> 1
-ddcms722 comparesig 1 12345678000 -> -1
-ddcms723 comparesig 1234567800 1 -> 1
-ddcms724 comparesig 1 1234567800 -> -1
-ddcms725 comparesig 1234567890 1 -> 1
-ddcms726 comparesig 1 1234567890 -> -1
-ddcms727 comparesig 1234567891 1 -> 1
-ddcms728 comparesig 1 1234567891 -> -1
-ddcms729 comparesig 12345678901 1 -> 1
-ddcms730 comparesig 1 12345678901 -> -1
-ddcms731 comparesig 1234567896 1 -> 1
-ddcms732 comparesig 1 1234567896 -> -1
-
--- residue cases at lower precision
-ddcms740 comparesig 1 0.9999999 -> 1
-ddcms741 comparesig 1 0.999999 -> 1
-ddcms742 comparesig 1 0.99999 -> 1
-ddcms743 comparesig 1 1.0000 -> 0
-ddcms744 comparesig 1 1.00001 -> -1
-ddcms745 comparesig 1 1.000001 -> -1
-ddcms746 comparesig 1 1.0000001 -> -1
-ddcms750 comparesig 0.9999999 1 -> -1
-ddcms751 comparesig 0.999999 1 -> -1
-ddcms752 comparesig 0.99999 1 -> -1
-ddcms753 comparesig 1.0000 1 -> 0
-ddcms754 comparesig 1.00001 1 -> 1
-ddcms755 comparesig 1.000001 1 -> 1
-ddcms756 comparesig 1.0000001 1 -> 1
-
--- Specials
-ddcms780 comparesig Inf -Inf -> 1
-ddcms781 comparesig Inf -1000 -> 1
-ddcms782 comparesig Inf -1 -> 1
-ddcms783 comparesig Inf -0 -> 1
-ddcms784 comparesig Inf 0 -> 1
-ddcms785 comparesig Inf 1 -> 1
-ddcms786 comparesig Inf 1000 -> 1
-ddcms787 comparesig Inf Inf -> 0
-ddcms788 comparesig -1000 Inf -> -1
-ddcms789 comparesig -Inf Inf -> -1
-ddcms790 comparesig -1 Inf -> -1
-ddcms791 comparesig -0 Inf -> -1
-ddcms792 comparesig 0 Inf -> -1
-ddcms793 comparesig 1 Inf -> -1
-ddcms794 comparesig 1000 Inf -> -1
-ddcms795 comparesig Inf Inf -> 0
-
-ddcms800 comparesig -Inf -Inf -> 0
-ddcms801 comparesig -Inf -1000 -> -1
-ddcms802 comparesig -Inf -1 -> -1
-ddcms803 comparesig -Inf -0 -> -1
-ddcms804 comparesig -Inf 0 -> -1
-ddcms805 comparesig -Inf 1 -> -1
-ddcms806 comparesig -Inf 1000 -> -1
-ddcms807 comparesig -Inf Inf -> -1
-ddcms808 comparesig -Inf -Inf -> 0
-ddcms809 comparesig -1000 -Inf -> 1
-ddcms810 comparesig -1 -Inf -> 1
-ddcms811 comparesig -0 -Inf -> 1
-ddcms812 comparesig 0 -Inf -> 1
-ddcms813 comparesig 1 -Inf -> 1
-ddcms814 comparesig 1000 -Inf -> 1
-ddcms815 comparesig Inf -Inf -> 1
-
-ddcms821 comparesig NaN -Inf -> NaN Invalid_operation
-ddcms822 comparesig NaN -1000 -> NaN Invalid_operation
-ddcms823 comparesig NaN -1 -> NaN Invalid_operation
-ddcms824 comparesig NaN -0 -> NaN Invalid_operation
-ddcms825 comparesig NaN 0 -> NaN Invalid_operation
-ddcms826 comparesig NaN 1 -> NaN Invalid_operation
-ddcms827 comparesig NaN 1000 -> NaN Invalid_operation
-ddcms828 comparesig NaN Inf -> NaN Invalid_operation
-ddcms829 comparesig NaN NaN -> NaN Invalid_operation
-ddcms830 comparesig -Inf NaN -> NaN Invalid_operation
-ddcms831 comparesig -1000 NaN -> NaN Invalid_operation
-ddcms832 comparesig -1 NaN -> NaN Invalid_operation
-ddcms833 comparesig -0 NaN -> NaN Invalid_operation
-ddcms834 comparesig 0 NaN -> NaN Invalid_operation
-ddcms835 comparesig 1 NaN -> NaN Invalid_operation
-ddcms836 comparesig 1000 NaN -> NaN Invalid_operation
-ddcms837 comparesig Inf NaN -> NaN Invalid_operation
-ddcms838 comparesig -NaN -NaN -> -NaN Invalid_operation
-ddcms839 comparesig +NaN -NaN -> NaN Invalid_operation
-ddcms840 comparesig -NaN +NaN -> -NaN Invalid_operation
-
-ddcms841 comparesig sNaN -Inf -> NaN Invalid_operation
-ddcms842 comparesig sNaN -1000 -> NaN Invalid_operation
-ddcms843 comparesig sNaN -1 -> NaN Invalid_operation
-ddcms844 comparesig sNaN -0 -> NaN Invalid_operation
-ddcms845 comparesig sNaN 0 -> NaN Invalid_operation
-ddcms846 comparesig sNaN 1 -> NaN Invalid_operation
-ddcms847 comparesig sNaN 1000 -> NaN Invalid_operation
-ddcms848 comparesig sNaN NaN -> NaN Invalid_operation
-ddcms849 comparesig sNaN sNaN -> NaN Invalid_operation
-ddcms850 comparesig NaN sNaN -> NaN Invalid_operation
-ddcms851 comparesig -Inf sNaN -> NaN Invalid_operation
-ddcms852 comparesig -1000 sNaN -> NaN Invalid_operation
-ddcms853 comparesig -1 sNaN -> NaN Invalid_operation
-ddcms854 comparesig -0 sNaN -> NaN Invalid_operation
-ddcms855 comparesig 0 sNaN -> NaN Invalid_operation
-ddcms856 comparesig 1 sNaN -> NaN Invalid_operation
-ddcms857 comparesig 1000 sNaN -> NaN Invalid_operation
-ddcms858 comparesig Inf sNaN -> NaN Invalid_operation
-ddcms859 comparesig NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation
-ddcms861 comparesig NaN8 999 -> NaN8 Invalid_operation
-ddcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation
-ddcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation
-ddcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation
-ddcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation
-ddcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation
-ddcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation
-ddcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation
-ddcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation
-ddcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation
-
-ddcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation
-ddcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation
-ddcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation
-ddcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation
-ddcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation
-ddcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation
-ddcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation
-ddcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation
-ddcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- wide range
-ddcms880 comparesig +1.23456789012345E-0 9E+384 -> -1
-ddcms881 comparesig 9E+384 +1.23456789012345E-0 -> 1
-ddcms882 comparesig +0.100 9E-383 -> 1
-ddcms883 comparesig 9E-383 +0.100 -> -1
-ddcms885 comparesig -1.23456789012345E-0 9E+384 -> -1
-ddcms886 comparesig 9E+384 -1.23456789012345E-0 -> 1
-ddcms887 comparesig -0.100 9E-383 -> -1
-ddcms888 comparesig 9E-383 -0.100 -> 1
-
--- signs
-ddcms901 comparesig 1e+77 1e+11 -> 1
-ddcms902 comparesig 1e+77 -1e+11 -> 1
-ddcms903 comparesig -1e+77 1e+11 -> -1
-ddcms904 comparesig -1e+77 -1e+11 -> -1
-ddcms905 comparesig 1e-77 1e-11 -> -1
-ddcms906 comparesig 1e-77 -1e-11 -> 1
-ddcms907 comparesig -1e-77 1e-11 -> -1
-ddcms908 comparesig -1e-77 -1e-11 -> 1
-
--- Null tests
-ddcms990 comparesig 10 # -> NaN Invalid_operation
-ddcms991 comparesig # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddCompareSig.decTest -- decDouble comparison; all NaNs signal --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddcms001 comparesig -2 -2 -> 0
+ddcms002 comparesig -2 -1 -> -1
+ddcms003 comparesig -2 0 -> -1
+ddcms004 comparesig -2 1 -> -1
+ddcms005 comparesig -2 2 -> -1
+ddcms006 comparesig -1 -2 -> 1
+ddcms007 comparesig -1 -1 -> 0
+ddcms008 comparesig -1 0 -> -1
+ddcms009 comparesig -1 1 -> -1
+ddcms010 comparesig -1 2 -> -1
+ddcms011 comparesig 0 -2 -> 1
+ddcms012 comparesig 0 -1 -> 1
+ddcms013 comparesig 0 0 -> 0
+ddcms014 comparesig 0 1 -> -1
+ddcms015 comparesig 0 2 -> -1
+ddcms016 comparesig 1 -2 -> 1
+ddcms017 comparesig 1 -1 -> 1
+ddcms018 comparesig 1 0 -> 1
+ddcms019 comparesig 1 1 -> 0
+ddcms020 comparesig 1 2 -> -1
+ddcms021 comparesig 2 -2 -> 1
+ddcms022 comparesig 2 -1 -> 1
+ddcms023 comparesig 2 0 -> 1
+ddcms025 comparesig 2 1 -> 1
+ddcms026 comparesig 2 2 -> 0
+
+ddcms031 comparesig -20 -20 -> 0
+ddcms032 comparesig -20 -10 -> -1
+ddcms033 comparesig -20 00 -> -1
+ddcms034 comparesig -20 10 -> -1
+ddcms035 comparesig -20 20 -> -1
+ddcms036 comparesig -10 -20 -> 1
+ddcms037 comparesig -10 -10 -> 0
+ddcms038 comparesig -10 00 -> -1
+ddcms039 comparesig -10 10 -> -1
+ddcms040 comparesig -10 20 -> -1
+ddcms041 comparesig 00 -20 -> 1
+ddcms042 comparesig 00 -10 -> 1
+ddcms043 comparesig 00 00 -> 0
+ddcms044 comparesig 00 10 -> -1
+ddcms045 comparesig 00 20 -> -1
+ddcms046 comparesig 10 -20 -> 1
+ddcms047 comparesig 10 -10 -> 1
+ddcms048 comparesig 10 00 -> 1
+ddcms049 comparesig 10 10 -> 0
+ddcms050 comparesig 10 20 -> -1
+ddcms051 comparesig 20 -20 -> 1
+ddcms052 comparesig 20 -10 -> 1
+ddcms053 comparesig 20 00 -> 1
+ddcms055 comparesig 20 10 -> 1
+ddcms056 comparesig 20 20 -> 0
+
+ddcms061 comparesig -2.0 -2.0 -> 0
+ddcms062 comparesig -2.0 -1.0 -> -1
+ddcms063 comparesig -2.0 0.0 -> -1
+ddcms064 comparesig -2.0 1.0 -> -1
+ddcms065 comparesig -2.0 2.0 -> -1
+ddcms066 comparesig -1.0 -2.0 -> 1
+ddcms067 comparesig -1.0 -1.0 -> 0
+ddcms068 comparesig -1.0 0.0 -> -1
+ddcms069 comparesig -1.0 1.0 -> -1
+ddcms070 comparesig -1.0 2.0 -> -1
+ddcms071 comparesig 0.0 -2.0 -> 1
+ddcms072 comparesig 0.0 -1.0 -> 1
+ddcms073 comparesig 0.0 0.0 -> 0
+ddcms074 comparesig 0.0 1.0 -> -1
+ddcms075 comparesig 0.0 2.0 -> -1
+ddcms076 comparesig 1.0 -2.0 -> 1
+ddcms077 comparesig 1.0 -1.0 -> 1
+ddcms078 comparesig 1.0 0.0 -> 1
+ddcms079 comparesig 1.0 1.0 -> 0
+ddcms080 comparesig 1.0 2.0 -> -1
+ddcms081 comparesig 2.0 -2.0 -> 1
+ddcms082 comparesig 2.0 -1.0 -> 1
+ddcms083 comparesig 2.0 0.0 -> 1
+ddcms085 comparesig 2.0 1.0 -> 1
+ddcms086 comparesig 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+ddcms090 comparesig 9.999999999999999E+384 9.999999999999999E+384 -> 0
+ddcms091 comparesig -9.999999999999999E+384 9.999999999999999E+384 -> -1
+ddcms092 comparesig 9.999999999999999E+384 -9.999999999999999E+384 -> 1
+ddcms093 comparesig -9.999999999999999E+384 -9.999999999999999E+384 -> 0
+
+-- some differing length/exponent cases
+ddcms100 comparesig 7.0 7.0 -> 0
+ddcms101 comparesig 7.0 7 -> 0
+ddcms102 comparesig 7 7.0 -> 0
+ddcms103 comparesig 7E+0 7.0 -> 0
+ddcms104 comparesig 70E-1 7.0 -> 0
+ddcms105 comparesig 0.7E+1 7 -> 0
+ddcms106 comparesig 70E-1 7 -> 0
+ddcms107 comparesig 7.0 7E+0 -> 0
+ddcms108 comparesig 7.0 70E-1 -> 0
+ddcms109 comparesig 7 0.7E+1 -> 0
+ddcms110 comparesig 7 70E-1 -> 0
+
+ddcms120 comparesig 8.0 7.0 -> 1
+ddcms121 comparesig 8.0 7 -> 1
+ddcms122 comparesig 8 7.0 -> 1
+ddcms123 comparesig 8E+0 7.0 -> 1
+ddcms124 comparesig 80E-1 7.0 -> 1
+ddcms125 comparesig 0.8E+1 7 -> 1
+ddcms126 comparesig 80E-1 7 -> 1
+ddcms127 comparesig 8.0 7E+0 -> 1
+ddcms128 comparesig 8.0 70E-1 -> 1
+ddcms129 comparesig 8 0.7E+1 -> 1
+ddcms130 comparesig 8 70E-1 -> 1
+
+ddcms140 comparesig 8.0 9.0 -> -1
+ddcms141 comparesig 8.0 9 -> -1
+ddcms142 comparesig 8 9.0 -> -1
+ddcms143 comparesig 8E+0 9.0 -> -1
+ddcms144 comparesig 80E-1 9.0 -> -1
+ddcms145 comparesig 0.8E+1 9 -> -1
+ddcms146 comparesig 80E-1 9 -> -1
+ddcms147 comparesig 8.0 9E+0 -> -1
+ddcms148 comparesig 8.0 90E-1 -> -1
+ddcms149 comparesig 8 0.9E+1 -> -1
+ddcms150 comparesig 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ddcms200 comparesig -7.0 7.0 -> -1
+ddcms201 comparesig -7.0 7 -> -1
+ddcms202 comparesig -7 7.0 -> -1
+ddcms203 comparesig -7E+0 7.0 -> -1
+ddcms204 comparesig -70E-1 7.0 -> -1
+ddcms205 comparesig -0.7E+1 7 -> -1
+ddcms206 comparesig -70E-1 7 -> -1
+ddcms207 comparesig -7.0 7E+0 -> -1
+ddcms208 comparesig -7.0 70E-1 -> -1
+ddcms209 comparesig -7 0.7E+1 -> -1
+ddcms210 comparesig -7 70E-1 -> -1
+
+ddcms220 comparesig -8.0 7.0 -> -1
+ddcms221 comparesig -8.0 7 -> -1
+ddcms222 comparesig -8 7.0 -> -1
+ddcms223 comparesig -8E+0 7.0 -> -1
+ddcms224 comparesig -80E-1 7.0 -> -1
+ddcms225 comparesig -0.8E+1 7 -> -1
+ddcms226 comparesig -80E-1 7 -> -1
+ddcms227 comparesig -8.0 7E+0 -> -1
+ddcms228 comparesig -8.0 70E-1 -> -1
+ddcms229 comparesig -8 0.7E+1 -> -1
+ddcms230 comparesig -8 70E-1 -> -1
+
+ddcms240 comparesig -8.0 9.0 -> -1
+ddcms241 comparesig -8.0 9 -> -1
+ddcms242 comparesig -8 9.0 -> -1
+ddcms243 comparesig -8E+0 9.0 -> -1
+ddcms244 comparesig -80E-1 9.0 -> -1
+ddcms245 comparesig -0.8E+1 9 -> -1
+ddcms246 comparesig -80E-1 9 -> -1
+ddcms247 comparesig -8.0 9E+0 -> -1
+ddcms248 comparesig -8.0 90E-1 -> -1
+ddcms249 comparesig -8 0.9E+1 -> -1
+ddcms250 comparesig -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ddcms300 comparesig 7.0 -7.0 -> 1
+ddcms301 comparesig 7.0 -7 -> 1
+ddcms302 comparesig 7 -7.0 -> 1
+ddcms303 comparesig 7E+0 -7.0 -> 1
+ddcms304 comparesig 70E-1 -7.0 -> 1
+ddcms305 comparesig .7E+1 -7 -> 1
+ddcms306 comparesig 70E-1 -7 -> 1
+ddcms307 comparesig 7.0 -7E+0 -> 1
+ddcms308 comparesig 7.0 -70E-1 -> 1
+ddcms309 comparesig 7 -.7E+1 -> 1
+ddcms310 comparesig 7 -70E-1 -> 1
+
+ddcms320 comparesig 8.0 -7.0 -> 1
+ddcms321 comparesig 8.0 -7 -> 1
+ddcms322 comparesig 8 -7.0 -> 1
+ddcms323 comparesig 8E+0 -7.0 -> 1
+ddcms324 comparesig 80E-1 -7.0 -> 1
+ddcms325 comparesig .8E+1 -7 -> 1
+ddcms326 comparesig 80E-1 -7 -> 1
+ddcms327 comparesig 8.0 -7E+0 -> 1
+ddcms328 comparesig 8.0 -70E-1 -> 1
+ddcms329 comparesig 8 -.7E+1 -> 1
+ddcms330 comparesig 8 -70E-1 -> 1
+
+ddcms340 comparesig 8.0 -9.0 -> 1
+ddcms341 comparesig 8.0 -9 -> 1
+ddcms342 comparesig 8 -9.0 -> 1
+ddcms343 comparesig 8E+0 -9.0 -> 1
+ddcms344 comparesig 80E-1 -9.0 -> 1
+ddcms345 comparesig .8E+1 -9 -> 1
+ddcms346 comparesig 80E-1 -9 -> 1
+ddcms347 comparesig 8.0 -9E+0 -> 1
+ddcms348 comparesig 8.0 -90E-1 -> 1
+ddcms349 comparesig 8 -.9E+1 -> 1
+ddcms350 comparesig 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+ddcms400 comparesig -7.0 -7.0 -> 0
+ddcms401 comparesig -7.0 -7 -> 0
+ddcms402 comparesig -7 -7.0 -> 0
+ddcms403 comparesig -7E+0 -7.0 -> 0
+ddcms404 comparesig -70E-1 -7.0 -> 0
+ddcms405 comparesig -.7E+1 -7 -> 0
+ddcms406 comparesig -70E-1 -7 -> 0
+ddcms407 comparesig -7.0 -7E+0 -> 0
+ddcms408 comparesig -7.0 -70E-1 -> 0
+ddcms409 comparesig -7 -.7E+1 -> 0
+ddcms410 comparesig -7 -70E-1 -> 0
+
+ddcms420 comparesig -8.0 -7.0 -> -1
+ddcms421 comparesig -8.0 -7 -> -1
+ddcms422 comparesig -8 -7.0 -> -1
+ddcms423 comparesig -8E+0 -7.0 -> -1
+ddcms424 comparesig -80E-1 -7.0 -> -1
+ddcms425 comparesig -.8E+1 -7 -> -1
+ddcms426 comparesig -80E-1 -7 -> -1
+ddcms427 comparesig -8.0 -7E+0 -> -1
+ddcms428 comparesig -8.0 -70E-1 -> -1
+ddcms429 comparesig -8 -.7E+1 -> -1
+ddcms430 comparesig -8 -70E-1 -> -1
+
+ddcms440 comparesig -8.0 -9.0 -> 1
+ddcms441 comparesig -8.0 -9 -> 1
+ddcms442 comparesig -8 -9.0 -> 1
+ddcms443 comparesig -8E+0 -9.0 -> 1
+ddcms444 comparesig -80E-1 -9.0 -> 1
+ddcms445 comparesig -.8E+1 -9 -> 1
+ddcms446 comparesig -80E-1 -9 -> 1
+ddcms447 comparesig -8.0 -9E+0 -> 1
+ddcms448 comparesig -8.0 -90E-1 -> 1
+ddcms449 comparesig -8 -.9E+1 -> 1
+ddcms450 comparesig -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+ddcms473 comparesig 123.4560000000000E-89 123.456E-89 -> 0
+ddcms474 comparesig 123.456000000000E+89 123.456E+89 -> 0
+ddcms475 comparesig 123.45600000000E-89 123.456E-89 -> 0
+ddcms476 comparesig 123.4560000000E+89 123.456E+89 -> 0
+ddcms477 comparesig 123.456000000E-89 123.456E-89 -> 0
+ddcms478 comparesig 123.45600000E+89 123.456E+89 -> 0
+ddcms479 comparesig 123.4560000E-89 123.456E-89 -> 0
+ddcms480 comparesig 123.456000E+89 123.456E+89 -> 0
+ddcms481 comparesig 123.45600E-89 123.456E-89 -> 0
+ddcms482 comparesig 123.4560E+89 123.456E+89 -> 0
+ddcms483 comparesig 123.456E-89 123.456E-89 -> 0
+ddcms487 comparesig 123.456E+89 123.4560000000000E+89 -> 0
+ddcms488 comparesig 123.456E-89 123.456000000000E-89 -> 0
+ddcms489 comparesig 123.456E+89 123.45600000000E+89 -> 0
+ddcms490 comparesig 123.456E-89 123.4560000000E-89 -> 0
+ddcms491 comparesig 123.456E+89 123.456000000E+89 -> 0
+ddcms492 comparesig 123.456E-89 123.45600000E-89 -> 0
+ddcms493 comparesig 123.456E+89 123.4560000E+89 -> 0
+ddcms494 comparesig 123.456E-89 123.456000E-89 -> 0
+ddcms495 comparesig 123.456E+89 123.45600E+89 -> 0
+ddcms496 comparesig 123.456E-89 123.4560E-89 -> 0
+ddcms497 comparesig 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+ddcms500 comparesig 1 1E-15 -> 1
+ddcms501 comparesig 1 1E-14 -> 1
+ddcms502 comparesig 1 1E-13 -> 1
+ddcms503 comparesig 1 1E-12 -> 1
+ddcms504 comparesig 1 1E-11 -> 1
+ddcms505 comparesig 1 1E-10 -> 1
+ddcms506 comparesig 1 1E-9 -> 1
+ddcms507 comparesig 1 1E-8 -> 1
+ddcms508 comparesig 1 1E-7 -> 1
+ddcms509 comparesig 1 1E-6 -> 1
+ddcms510 comparesig 1 1E-5 -> 1
+ddcms511 comparesig 1 1E-4 -> 1
+ddcms512 comparesig 1 1E-3 -> 1
+ddcms513 comparesig 1 1E-2 -> 1
+ddcms514 comparesig 1 1E-1 -> 1
+ddcms515 comparesig 1 1E-0 -> 0
+ddcms516 comparesig 1 1E+1 -> -1
+ddcms517 comparesig 1 1E+2 -> -1
+ddcms518 comparesig 1 1E+3 -> -1
+ddcms519 comparesig 1 1E+4 -> -1
+ddcms521 comparesig 1 1E+5 -> -1
+ddcms522 comparesig 1 1E+6 -> -1
+ddcms523 comparesig 1 1E+7 -> -1
+ddcms524 comparesig 1 1E+8 -> -1
+ddcms525 comparesig 1 1E+9 -> -1
+ddcms526 comparesig 1 1E+10 -> -1
+ddcms527 comparesig 1 1E+11 -> -1
+ddcms528 comparesig 1 1E+12 -> -1
+ddcms529 comparesig 1 1E+13 -> -1
+ddcms530 comparesig 1 1E+14 -> -1
+ddcms531 comparesig 1 1E+15 -> -1
+-- LR swap
+ddcms540 comparesig 1E-15 1 -> -1
+ddcms541 comparesig 1E-14 1 -> -1
+ddcms542 comparesig 1E-13 1 -> -1
+ddcms543 comparesig 1E-12 1 -> -1
+ddcms544 comparesig 1E-11 1 -> -1
+ddcms545 comparesig 1E-10 1 -> -1
+ddcms546 comparesig 1E-9 1 -> -1
+ddcms547 comparesig 1E-8 1 -> -1
+ddcms548 comparesig 1E-7 1 -> -1
+ddcms549 comparesig 1E-6 1 -> -1
+ddcms550 comparesig 1E-5 1 -> -1
+ddcms551 comparesig 1E-4 1 -> -1
+ddcms552 comparesig 1E-3 1 -> -1
+ddcms553 comparesig 1E-2 1 -> -1
+ddcms554 comparesig 1E-1 1 -> -1
+ddcms555 comparesig 1E-0 1 -> 0
+ddcms556 comparesig 1E+1 1 -> 1
+ddcms557 comparesig 1E+2 1 -> 1
+ddcms558 comparesig 1E+3 1 -> 1
+ddcms559 comparesig 1E+4 1 -> 1
+ddcms561 comparesig 1E+5 1 -> 1
+ddcms562 comparesig 1E+6 1 -> 1
+ddcms563 comparesig 1E+7 1 -> 1
+ddcms564 comparesig 1E+8 1 -> 1
+ddcms565 comparesig 1E+9 1 -> 1
+ddcms566 comparesig 1E+10 1 -> 1
+ddcms567 comparesig 1E+11 1 -> 1
+ddcms568 comparesig 1E+12 1 -> 1
+ddcms569 comparesig 1E+13 1 -> 1
+ddcms570 comparesig 1E+14 1 -> 1
+ddcms571 comparesig 1E+15 1 -> 1
+-- similar with a useful coefficient, one side only
+ddcms580 comparesig 0.000000987654321 1E-15 -> 1
+ddcms581 comparesig 0.000000987654321 1E-14 -> 1
+ddcms582 comparesig 0.000000987654321 1E-13 -> 1
+ddcms583 comparesig 0.000000987654321 1E-12 -> 1
+ddcms584 comparesig 0.000000987654321 1E-11 -> 1
+ddcms585 comparesig 0.000000987654321 1E-10 -> 1
+ddcms586 comparesig 0.000000987654321 1E-9 -> 1
+ddcms587 comparesig 0.000000987654321 1E-8 -> 1
+ddcms588 comparesig 0.000000987654321 1E-7 -> 1
+ddcms589 comparesig 0.000000987654321 1E-6 -> -1
+ddcms590 comparesig 0.000000987654321 1E-5 -> -1
+ddcms591 comparesig 0.000000987654321 1E-4 -> -1
+ddcms592 comparesig 0.000000987654321 1E-3 -> -1
+ddcms593 comparesig 0.000000987654321 1E-2 -> -1
+ddcms594 comparesig 0.000000987654321 1E-1 -> -1
+ddcms595 comparesig 0.000000987654321 1E-0 -> -1
+ddcms596 comparesig 0.000000987654321 1E+1 -> -1
+ddcms597 comparesig 0.000000987654321 1E+2 -> -1
+ddcms598 comparesig 0.000000987654321 1E+3 -> -1
+ddcms599 comparesig 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+ddcms600 comparesig 12 12.2345 -> -1
+ddcms601 comparesig 12.0 12.2345 -> -1
+ddcms602 comparesig 12.00 12.2345 -> -1
+ddcms603 comparesig 12.000 12.2345 -> -1
+ddcms604 comparesig 12.0000 12.2345 -> -1
+ddcms605 comparesig 12.00000 12.2345 -> -1
+ddcms606 comparesig 12.000000 12.2345 -> -1
+ddcms607 comparesig 12.0000000 12.2345 -> -1
+ddcms608 comparesig 12.00000000 12.2345 -> -1
+ddcms609 comparesig 12.000000000 12.2345 -> -1
+ddcms610 comparesig 12.1234 12 -> 1
+ddcms611 comparesig 12.1234 12.0 -> 1
+ddcms612 comparesig 12.1234 12.00 -> 1
+ddcms613 comparesig 12.1234 12.000 -> 1
+ddcms614 comparesig 12.1234 12.0000 -> 1
+ddcms615 comparesig 12.1234 12.00000 -> 1
+ddcms616 comparesig 12.1234 12.000000 -> 1
+ddcms617 comparesig 12.1234 12.0000000 -> 1
+ddcms618 comparesig 12.1234 12.00000000 -> 1
+ddcms619 comparesig 12.1234 12.000000000 -> 1
+ddcms620 comparesig -12 -12.2345 -> 1
+ddcms621 comparesig -12.0 -12.2345 -> 1
+ddcms622 comparesig -12.00 -12.2345 -> 1
+ddcms623 comparesig -12.000 -12.2345 -> 1
+ddcms624 comparesig -12.0000 -12.2345 -> 1
+ddcms625 comparesig -12.00000 -12.2345 -> 1
+ddcms626 comparesig -12.000000 -12.2345 -> 1
+ddcms627 comparesig -12.0000000 -12.2345 -> 1
+ddcms628 comparesig -12.00000000 -12.2345 -> 1
+ddcms629 comparesig -12.000000000 -12.2345 -> 1
+ddcms630 comparesig -12.1234 -12 -> -1
+ddcms631 comparesig -12.1234 -12.0 -> -1
+ddcms632 comparesig -12.1234 -12.00 -> -1
+ddcms633 comparesig -12.1234 -12.000 -> -1
+ddcms634 comparesig -12.1234 -12.0000 -> -1
+ddcms635 comparesig -12.1234 -12.00000 -> -1
+ddcms636 comparesig -12.1234 -12.000000 -> -1
+ddcms637 comparesig -12.1234 -12.0000000 -> -1
+ddcms638 comparesig -12.1234 -12.00000000 -> -1
+ddcms639 comparesig -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+ddcms640 comparesig 0 0 -> 0
+ddcms641 comparesig 0 -0 -> 0
+ddcms642 comparesig 0 -0.0 -> 0
+ddcms643 comparesig 0 0.0 -> 0
+ddcms644 comparesig -0 0 -> 0
+ddcms645 comparesig -0 -0 -> 0
+ddcms646 comparesig -0 -0.0 -> 0
+ddcms647 comparesig -0 0.0 -> 0
+ddcms648 comparesig 0.0 0 -> 0
+ddcms649 comparesig 0.0 -0 -> 0
+ddcms650 comparesig 0.0 -0.0 -> 0
+ddcms651 comparesig 0.0 0.0 -> 0
+ddcms652 comparesig -0.0 0 -> 0
+ddcms653 comparesig -0.0 -0 -> 0
+ddcms654 comparesig -0.0 -0.0 -> 0
+ddcms655 comparesig -0.0 0.0 -> 0
+
+ddcms656 comparesig -0E1 0.0 -> 0
+ddcms657 comparesig -0E2 0.0 -> 0
+ddcms658 comparesig 0E1 0.0 -> 0
+ddcms659 comparesig 0E2 0.0 -> 0
+ddcms660 comparesig -0E1 0 -> 0
+ddcms661 comparesig -0E2 0 -> 0
+ddcms662 comparesig 0E1 0 -> 0
+ddcms663 comparesig 0E2 0 -> 0
+ddcms664 comparesig -0E1 -0E1 -> 0
+ddcms665 comparesig -0E2 -0E1 -> 0
+ddcms666 comparesig 0E1 -0E1 -> 0
+ddcms667 comparesig 0E2 -0E1 -> 0
+ddcms668 comparesig -0E1 -0E2 -> 0
+ddcms669 comparesig -0E2 -0E2 -> 0
+ddcms670 comparesig 0E1 -0E2 -> 0
+ddcms671 comparesig 0E2 -0E2 -> 0
+ddcms672 comparesig -0E1 0E1 -> 0
+ddcms673 comparesig -0E2 0E1 -> 0
+ddcms674 comparesig 0E1 0E1 -> 0
+ddcms675 comparesig 0E2 0E1 -> 0
+ddcms676 comparesig -0E1 0E2 -> 0
+ddcms677 comparesig -0E2 0E2 -> 0
+ddcms678 comparesig 0E1 0E2 -> 0
+ddcms679 comparesig 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+ddcms680 comparesig 12 12 -> 0
+ddcms681 comparesig 12 12.0 -> 0
+ddcms682 comparesig 12 12.00 -> 0
+ddcms683 comparesig 12 12.000 -> 0
+ddcms684 comparesig 12 12.0000 -> 0
+ddcms685 comparesig 12 12.00000 -> 0
+ddcms686 comparesig 12 12.000000 -> 0
+ddcms687 comparesig 12 12.0000000 -> 0
+ddcms688 comparesig 12 12.00000000 -> 0
+ddcms689 comparesig 12 12.000000000 -> 0
+ddcms690 comparesig 12 12 -> 0
+ddcms691 comparesig 12.0 12 -> 0
+ddcms692 comparesig 12.00 12 -> 0
+ddcms693 comparesig 12.000 12 -> 0
+ddcms694 comparesig 12.0000 12 -> 0
+ddcms695 comparesig 12.00000 12 -> 0
+ddcms696 comparesig 12.000000 12 -> 0
+ddcms697 comparesig 12.0000000 12 -> 0
+ddcms698 comparesig 12.00000000 12 -> 0
+ddcms699 comparesig 12.000000000 12 -> 0
+
+-- first, second, & last digit
+ddcms700 comparesig 1234567890123456 1234567890123455 -> 1
+ddcms701 comparesig 1234567890123456 1234567890123456 -> 0
+ddcms702 comparesig 1234567890123456 1234567890123457 -> -1
+ddcms703 comparesig 1234567890123456 0234567890123456 -> 1
+ddcms704 comparesig 1234567890123456 1234567890123456 -> 0
+ddcms705 comparesig 1234567890123456 2234567890123456 -> -1
+ddcms706 comparesig 1134567890123456 1034567890123456 -> 1
+ddcms707 comparesig 1134567890123456 1134567890123456 -> 0
+ddcms708 comparesig 1134567890123456 1234567890123456 -> -1
+
+-- miscellaneous
+ddcms721 comparesig 12345678000 1 -> 1
+ddcms722 comparesig 1 12345678000 -> -1
+ddcms723 comparesig 1234567800 1 -> 1
+ddcms724 comparesig 1 1234567800 -> -1
+ddcms725 comparesig 1234567890 1 -> 1
+ddcms726 comparesig 1 1234567890 -> -1
+ddcms727 comparesig 1234567891 1 -> 1
+ddcms728 comparesig 1 1234567891 -> -1
+ddcms729 comparesig 12345678901 1 -> 1
+ddcms730 comparesig 1 12345678901 -> -1
+ddcms731 comparesig 1234567896 1 -> 1
+ddcms732 comparesig 1 1234567896 -> -1
+
+-- residue cases at lower precision
+ddcms740 comparesig 1 0.9999999 -> 1
+ddcms741 comparesig 1 0.999999 -> 1
+ddcms742 comparesig 1 0.99999 -> 1
+ddcms743 comparesig 1 1.0000 -> 0
+ddcms744 comparesig 1 1.00001 -> -1
+ddcms745 comparesig 1 1.000001 -> -1
+ddcms746 comparesig 1 1.0000001 -> -1
+ddcms750 comparesig 0.9999999 1 -> -1
+ddcms751 comparesig 0.999999 1 -> -1
+ddcms752 comparesig 0.99999 1 -> -1
+ddcms753 comparesig 1.0000 1 -> 0
+ddcms754 comparesig 1.00001 1 -> 1
+ddcms755 comparesig 1.000001 1 -> 1
+ddcms756 comparesig 1.0000001 1 -> 1
+
+-- Specials
+ddcms780 comparesig Inf -Inf -> 1
+ddcms781 comparesig Inf -1000 -> 1
+ddcms782 comparesig Inf -1 -> 1
+ddcms783 comparesig Inf -0 -> 1
+ddcms784 comparesig Inf 0 -> 1
+ddcms785 comparesig Inf 1 -> 1
+ddcms786 comparesig Inf 1000 -> 1
+ddcms787 comparesig Inf Inf -> 0
+ddcms788 comparesig -1000 Inf -> -1
+ddcms789 comparesig -Inf Inf -> -1
+ddcms790 comparesig -1 Inf -> -1
+ddcms791 comparesig -0 Inf -> -1
+ddcms792 comparesig 0 Inf -> -1
+ddcms793 comparesig 1 Inf -> -1
+ddcms794 comparesig 1000 Inf -> -1
+ddcms795 comparesig Inf Inf -> 0
+
+ddcms800 comparesig -Inf -Inf -> 0
+ddcms801 comparesig -Inf -1000 -> -1
+ddcms802 comparesig -Inf -1 -> -1
+ddcms803 comparesig -Inf -0 -> -1
+ddcms804 comparesig -Inf 0 -> -1
+ddcms805 comparesig -Inf 1 -> -1
+ddcms806 comparesig -Inf 1000 -> -1
+ddcms807 comparesig -Inf Inf -> -1
+ddcms808 comparesig -Inf -Inf -> 0
+ddcms809 comparesig -1000 -Inf -> 1
+ddcms810 comparesig -1 -Inf -> 1
+ddcms811 comparesig -0 -Inf -> 1
+ddcms812 comparesig 0 -Inf -> 1
+ddcms813 comparesig 1 -Inf -> 1
+ddcms814 comparesig 1000 -Inf -> 1
+ddcms815 comparesig Inf -Inf -> 1
+
+ddcms821 comparesig NaN -Inf -> NaN Invalid_operation
+ddcms822 comparesig NaN -1000 -> NaN Invalid_operation
+ddcms823 comparesig NaN -1 -> NaN Invalid_operation
+ddcms824 comparesig NaN -0 -> NaN Invalid_operation
+ddcms825 comparesig NaN 0 -> NaN Invalid_operation
+ddcms826 comparesig NaN 1 -> NaN Invalid_operation
+ddcms827 comparesig NaN 1000 -> NaN Invalid_operation
+ddcms828 comparesig NaN Inf -> NaN Invalid_operation
+ddcms829 comparesig NaN NaN -> NaN Invalid_operation
+ddcms830 comparesig -Inf NaN -> NaN Invalid_operation
+ddcms831 comparesig -1000 NaN -> NaN Invalid_operation
+ddcms832 comparesig -1 NaN -> NaN Invalid_operation
+ddcms833 comparesig -0 NaN -> NaN Invalid_operation
+ddcms834 comparesig 0 NaN -> NaN Invalid_operation
+ddcms835 comparesig 1 NaN -> NaN Invalid_operation
+ddcms836 comparesig 1000 NaN -> NaN Invalid_operation
+ddcms837 comparesig Inf NaN -> NaN Invalid_operation
+ddcms838 comparesig -NaN -NaN -> -NaN Invalid_operation
+ddcms839 comparesig +NaN -NaN -> NaN Invalid_operation
+ddcms840 comparesig -NaN +NaN -> -NaN Invalid_operation
+
+ddcms841 comparesig sNaN -Inf -> NaN Invalid_operation
+ddcms842 comparesig sNaN -1000 -> NaN Invalid_operation
+ddcms843 comparesig sNaN -1 -> NaN Invalid_operation
+ddcms844 comparesig sNaN -0 -> NaN Invalid_operation
+ddcms845 comparesig sNaN 0 -> NaN Invalid_operation
+ddcms846 comparesig sNaN 1 -> NaN Invalid_operation
+ddcms847 comparesig sNaN 1000 -> NaN Invalid_operation
+ddcms848 comparesig sNaN NaN -> NaN Invalid_operation
+ddcms849 comparesig sNaN sNaN -> NaN Invalid_operation
+ddcms850 comparesig NaN sNaN -> NaN Invalid_operation
+ddcms851 comparesig -Inf sNaN -> NaN Invalid_operation
+ddcms852 comparesig -1000 sNaN -> NaN Invalid_operation
+ddcms853 comparesig -1 sNaN -> NaN Invalid_operation
+ddcms854 comparesig -0 sNaN -> NaN Invalid_operation
+ddcms855 comparesig 0 sNaN -> NaN Invalid_operation
+ddcms856 comparesig 1 sNaN -> NaN Invalid_operation
+ddcms857 comparesig 1000 sNaN -> NaN Invalid_operation
+ddcms858 comparesig Inf sNaN -> NaN Invalid_operation
+ddcms859 comparesig NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation
+ddcms861 comparesig NaN8 999 -> NaN8 Invalid_operation
+ddcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation
+ddcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation
+ddcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation
+ddcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation
+ddcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation
+ddcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation
+ddcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation
+ddcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation
+ddcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation
+
+ddcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation
+ddcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation
+ddcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation
+ddcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation
+ddcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation
+ddcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation
+ddcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation
+ddcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation
+ddcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- wide range
+ddcms880 comparesig +1.23456789012345E-0 9E+384 -> -1
+ddcms881 comparesig 9E+384 +1.23456789012345E-0 -> 1
+ddcms882 comparesig +0.100 9E-383 -> 1
+ddcms883 comparesig 9E-383 +0.100 -> -1
+ddcms885 comparesig -1.23456789012345E-0 9E+384 -> -1
+ddcms886 comparesig 9E+384 -1.23456789012345E-0 -> 1
+ddcms887 comparesig -0.100 9E-383 -> -1
+ddcms888 comparesig 9E-383 -0.100 -> 1
+
+-- signs
+ddcms901 comparesig 1e+77 1e+11 -> 1
+ddcms902 comparesig 1e+77 -1e+11 -> 1
+ddcms903 comparesig -1e+77 1e+11 -> -1
+ddcms904 comparesig -1e+77 -1e+11 -> -1
+ddcms905 comparesig 1e-77 1e-11 -> -1
+ddcms906 comparesig 1e-77 -1e-11 -> 1
+ddcms907 comparesig -1e-77 1e-11 -> -1
+ddcms908 comparesig -1e-77 -1e-11 -> 1
+
+-- Null tests
+ddcms990 comparesig 10 # -> NaN Invalid_operation
+ddcms991 comparesig # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddCompareTotal.decTest b/Lib/test/decimaltestdata/ddCompareTotal.decTest
index 76beed5681..10c984c7ff 100644
--- a/Lib/test/decimaltestdata/ddCompareTotal.decTest
+++ b/Lib/test/decimaltestdata/ddCompareTotal.decTest
@@ -1,706 +1,706 @@
-------------------------------------------------------------------------
--- ddCompareTotal.decTest -- decDouble comparison using total ordering--
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddcot001 comparetotal -2 -2 -> 0
-ddcot002 comparetotal -2 -1 -> -1
-ddcot003 comparetotal -2 0 -> -1
-ddcot004 comparetotal -2 1 -> -1
-ddcot005 comparetotal -2 2 -> -1
-ddcot006 comparetotal -1 -2 -> 1
-ddcot007 comparetotal -1 -1 -> 0
-ddcot008 comparetotal -1 0 -> -1
-ddcot009 comparetotal -1 1 -> -1
-ddcot010 comparetotal -1 2 -> -1
-ddcot011 comparetotal 0 -2 -> 1
-ddcot012 comparetotal 0 -1 -> 1
-ddcot013 comparetotal 0 0 -> 0
-ddcot014 comparetotal 0 1 -> -1
-ddcot015 comparetotal 0 2 -> -1
-ddcot016 comparetotal 1 -2 -> 1
-ddcot017 comparetotal 1 -1 -> 1
-ddcot018 comparetotal 1 0 -> 1
-ddcot019 comparetotal 1 1 -> 0
-ddcot020 comparetotal 1 2 -> -1
-ddcot021 comparetotal 2 -2 -> 1
-ddcot022 comparetotal 2 -1 -> 1
-ddcot023 comparetotal 2 0 -> 1
-ddcot025 comparetotal 2 1 -> 1
-ddcot026 comparetotal 2 2 -> 0
-
-ddcot031 comparetotal -20 -20 -> 0
-ddcot032 comparetotal -20 -10 -> -1
-ddcot033 comparetotal -20 00 -> -1
-ddcot034 comparetotal -20 10 -> -1
-ddcot035 comparetotal -20 20 -> -1
-ddcot036 comparetotal -10 -20 -> 1
-ddcot037 comparetotal -10 -10 -> 0
-ddcot038 comparetotal -10 00 -> -1
-ddcot039 comparetotal -10 10 -> -1
-ddcot040 comparetotal -10 20 -> -1
-ddcot041 comparetotal 00 -20 -> 1
-ddcot042 comparetotal 00 -10 -> 1
-ddcot043 comparetotal 00 00 -> 0
-ddcot044 comparetotal 00 10 -> -1
-ddcot045 comparetotal 00 20 -> -1
-ddcot046 comparetotal 10 -20 -> 1
-ddcot047 comparetotal 10 -10 -> 1
-ddcot048 comparetotal 10 00 -> 1
-ddcot049 comparetotal 10 10 -> 0
-ddcot050 comparetotal 10 20 -> -1
-ddcot051 comparetotal 20 -20 -> 1
-ddcot052 comparetotal 20 -10 -> 1
-ddcot053 comparetotal 20 00 -> 1
-ddcot055 comparetotal 20 10 -> 1
-ddcot056 comparetotal 20 20 -> 0
-
-ddcot061 comparetotal -2.0 -2.0 -> 0
-ddcot062 comparetotal -2.0 -1.0 -> -1
-ddcot063 comparetotal -2.0 0.0 -> -1
-ddcot064 comparetotal -2.0 1.0 -> -1
-ddcot065 comparetotal -2.0 2.0 -> -1
-ddcot066 comparetotal -1.0 -2.0 -> 1
-ddcot067 comparetotal -1.0 -1.0 -> 0
-ddcot068 comparetotal -1.0 0.0 -> -1
-ddcot069 comparetotal -1.0 1.0 -> -1
-ddcot070 comparetotal -1.0 2.0 -> -1
-ddcot071 comparetotal 0.0 -2.0 -> 1
-ddcot072 comparetotal 0.0 -1.0 -> 1
-ddcot073 comparetotal 0.0 0.0 -> 0
-ddcot074 comparetotal 0.0 1.0 -> -1
-ddcot075 comparetotal 0.0 2.0 -> -1
-ddcot076 comparetotal 1.0 -2.0 -> 1
-ddcot077 comparetotal 1.0 -1.0 -> 1
-ddcot078 comparetotal 1.0 0.0 -> 1
-ddcot079 comparetotal 1.0 1.0 -> 0
-ddcot080 comparetotal 1.0 2.0 -> -1
-ddcot081 comparetotal 2.0 -2.0 -> 1
-ddcot082 comparetotal 2.0 -1.0 -> 1
-ddcot083 comparetotal 2.0 0.0 -> 1
-ddcot085 comparetotal 2.0 1.0 -> 1
-ddcot086 comparetotal 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-ddcot090 comparetotal 9.99999999E+384 9.99999999E+384 -> 0
-ddcot091 comparetotal -9.99999999E+384 9.99999999E+384 -> -1
-ddcot092 comparetotal 9.99999999E+384 -9.99999999E+384 -> 1
-ddcot093 comparetotal -9.99999999E+384 -9.99999999E+384 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-ddcot100 comparetotal 7.0 7.0 -> 0
-ddcot101 comparetotal 7.0 7 -> -1
-ddcot102 comparetotal 7 7.0 -> 1
-ddcot103 comparetotal 7E+0 7.0 -> 1
-ddcot104 comparetotal 70E-1 7.0 -> 0
-ddcot105 comparetotal 0.7E+1 7 -> 0
-ddcot106 comparetotal 70E-1 7 -> -1
-ddcot107 comparetotal 7.0 7E+0 -> -1
-ddcot108 comparetotal 7.0 70E-1 -> 0
-ddcot109 comparetotal 7 0.7E+1 -> 0
-ddcot110 comparetotal 7 70E-1 -> 1
-
-ddcot120 comparetotal 8.0 7.0 -> 1
-ddcot121 comparetotal 8.0 7 -> 1
-ddcot122 comparetotal 8 7.0 -> 1
-ddcot123 comparetotal 8E+0 7.0 -> 1
-ddcot124 comparetotal 80E-1 7.0 -> 1
-ddcot125 comparetotal 0.8E+1 7 -> 1
-ddcot126 comparetotal 80E-1 7 -> 1
-ddcot127 comparetotal 8.0 7E+0 -> 1
-ddcot128 comparetotal 8.0 70E-1 -> 1
-ddcot129 comparetotal 8 0.7E+1 -> 1
-ddcot130 comparetotal 8 70E-1 -> 1
-
-ddcot140 comparetotal 8.0 9.0 -> -1
-ddcot141 comparetotal 8.0 9 -> -1
-ddcot142 comparetotal 8 9.0 -> -1
-ddcot143 comparetotal 8E+0 9.0 -> -1
-ddcot144 comparetotal 80E-1 9.0 -> -1
-ddcot145 comparetotal 0.8E+1 9 -> -1
-ddcot146 comparetotal 80E-1 9 -> -1
-ddcot147 comparetotal 8.0 9E+0 -> -1
-ddcot148 comparetotal 8.0 90E-1 -> -1
-ddcot149 comparetotal 8 0.9E+1 -> -1
-ddcot150 comparetotal 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ddcot200 comparetotal -7.0 7.0 -> -1
-ddcot201 comparetotal -7.0 7 -> -1
-ddcot202 comparetotal -7 7.0 -> -1
-ddcot203 comparetotal -7E+0 7.0 -> -1
-ddcot204 comparetotal -70E-1 7.0 -> -1
-ddcot205 comparetotal -0.7E+1 7 -> -1
-ddcot206 comparetotal -70E-1 7 -> -1
-ddcot207 comparetotal -7.0 7E+0 -> -1
-ddcot208 comparetotal -7.0 70E-1 -> -1
-ddcot209 comparetotal -7 0.7E+1 -> -1
-ddcot210 comparetotal -7 70E-1 -> -1
-
-ddcot220 comparetotal -8.0 7.0 -> -1
-ddcot221 comparetotal -8.0 7 -> -1
-ddcot222 comparetotal -8 7.0 -> -1
-ddcot223 comparetotal -8E+0 7.0 -> -1
-ddcot224 comparetotal -80E-1 7.0 -> -1
-ddcot225 comparetotal -0.8E+1 7 -> -1
-ddcot226 comparetotal -80E-1 7 -> -1
-ddcot227 comparetotal -8.0 7E+0 -> -1
-ddcot228 comparetotal -8.0 70E-1 -> -1
-ddcot229 comparetotal -8 0.7E+1 -> -1
-ddcot230 comparetotal -8 70E-1 -> -1
-
-ddcot240 comparetotal -8.0 9.0 -> -1
-ddcot241 comparetotal -8.0 9 -> -1
-ddcot242 comparetotal -8 9.0 -> -1
-ddcot243 comparetotal -8E+0 9.0 -> -1
-ddcot244 comparetotal -80E-1 9.0 -> -1
-ddcot245 comparetotal -0.8E+1 9 -> -1
-ddcot246 comparetotal -80E-1 9 -> -1
-ddcot247 comparetotal -8.0 9E+0 -> -1
-ddcot248 comparetotal -8.0 90E-1 -> -1
-ddcot249 comparetotal -8 0.9E+1 -> -1
-ddcot250 comparetotal -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ddcot300 comparetotal 7.0 -7.0 -> 1
-ddcot301 comparetotal 7.0 -7 -> 1
-ddcot302 comparetotal 7 -7.0 -> 1
-ddcot303 comparetotal 7E+0 -7.0 -> 1
-ddcot304 comparetotal 70E-1 -7.0 -> 1
-ddcot305 comparetotal .7E+1 -7 -> 1
-ddcot306 comparetotal 70E-1 -7 -> 1
-ddcot307 comparetotal 7.0 -7E+0 -> 1
-ddcot308 comparetotal 7.0 -70E-1 -> 1
-ddcot309 comparetotal 7 -.7E+1 -> 1
-ddcot310 comparetotal 7 -70E-1 -> 1
-
-ddcot320 comparetotal 8.0 -7.0 -> 1
-ddcot321 comparetotal 8.0 -7 -> 1
-ddcot322 comparetotal 8 -7.0 -> 1
-ddcot323 comparetotal 8E+0 -7.0 -> 1
-ddcot324 comparetotal 80E-1 -7.0 -> 1
-ddcot325 comparetotal .8E+1 -7 -> 1
-ddcot326 comparetotal 80E-1 -7 -> 1
-ddcot327 comparetotal 8.0 -7E+0 -> 1
-ddcot328 comparetotal 8.0 -70E-1 -> 1
-ddcot329 comparetotal 8 -.7E+1 -> 1
-ddcot330 comparetotal 8 -70E-1 -> 1
-
-ddcot340 comparetotal 8.0 -9.0 -> 1
-ddcot341 comparetotal 8.0 -9 -> 1
-ddcot342 comparetotal 8 -9.0 -> 1
-ddcot343 comparetotal 8E+0 -9.0 -> 1
-ddcot344 comparetotal 80E-1 -9.0 -> 1
-ddcot345 comparetotal .8E+1 -9 -> 1
-ddcot346 comparetotal 80E-1 -9 -> 1
-ddcot347 comparetotal 8.0 -9E+0 -> 1
-ddcot348 comparetotal 8.0 -90E-1 -> 1
-ddcot349 comparetotal 8 -.9E+1 -> 1
-ddcot350 comparetotal 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-ddcot400 comparetotal -7.0 -7.0 -> 0
-ddcot401 comparetotal -7.0 -7 -> 1
-ddcot402 comparetotal -7 -7.0 -> -1
-ddcot403 comparetotal -7E+0 -7.0 -> -1
-ddcot404 comparetotal -70E-1 -7.0 -> 0
-ddcot405 comparetotal -.7E+1 -7 -> 0
-ddcot406 comparetotal -70E-1 -7 -> 1
-ddcot407 comparetotal -7.0 -7E+0 -> 1
-ddcot408 comparetotal -7.0 -70E-1 -> 0
-ddcot409 comparetotal -7 -.7E+1 -> 0
-ddcot410 comparetotal -7 -70E-1 -> -1
-
-ddcot420 comparetotal -8.0 -7.0 -> -1
-ddcot421 comparetotal -8.0 -7 -> -1
-ddcot422 comparetotal -8 -7.0 -> -1
-ddcot423 comparetotal -8E+0 -7.0 -> -1
-ddcot424 comparetotal -80E-1 -7.0 -> -1
-ddcot425 comparetotal -.8E+1 -7 -> -1
-ddcot426 comparetotal -80E-1 -7 -> -1
-ddcot427 comparetotal -8.0 -7E+0 -> -1
-ddcot428 comparetotal -8.0 -70E-1 -> -1
-ddcot429 comparetotal -8 -.7E+1 -> -1
-ddcot430 comparetotal -8 -70E-1 -> -1
-
-ddcot440 comparetotal -8.0 -9.0 -> 1
-ddcot441 comparetotal -8.0 -9 -> 1
-ddcot442 comparetotal -8 -9.0 -> 1
-ddcot443 comparetotal -8E+0 -9.0 -> 1
-ddcot444 comparetotal -80E-1 -9.0 -> 1
-ddcot445 comparetotal -.8E+1 -9 -> 1
-ddcot446 comparetotal -80E-1 -9 -> 1
-ddcot447 comparetotal -8.0 -9E+0 -> 1
-ddcot448 comparetotal -8.0 -90E-1 -> 1
-ddcot449 comparetotal -8 -.9E+1 -> 1
-ddcot450 comparetotal -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-ddcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
-ddcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1
-ddcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
-ddcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1
-ddcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
-ddcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1
-ddcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
-ddcot480 comparetotal 123.456000E+89 123.456E+89 -> -1
-ddcot481 comparetotal 123.45600E-89 123.456E-89 -> -1
-ddcot482 comparetotal 123.4560E+89 123.456E+89 -> -1
-ddcot483 comparetotal 123.456E-89 123.456E-89 -> 0
-ddcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1
-ddcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
-ddcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1
-ddcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
-ddcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1
-ddcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
-ddcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1
-ddcot494 comparetotal 123.456E-89 123.456000E-89 -> 1
-ddcot495 comparetotal 123.456E+89 123.45600E+89 -> 1
-ddcot496 comparetotal 123.456E-89 123.4560E-89 -> 1
-ddcot497 comparetotal 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-ddcot498 comparetotal 1 1E-17 -> 1
-ddcot499 comparetotal 1 1E-16 -> 1
-ddcot500 comparetotal 1 1E-15 -> 1
-ddcot501 comparetotal 1 1E-14 -> 1
-ddcot502 comparetotal 1 1E-13 -> 1
-ddcot503 comparetotal 1 1E-12 -> 1
-ddcot504 comparetotal 1 1E-11 -> 1
-ddcot505 comparetotal 1 1E-10 -> 1
-ddcot506 comparetotal 1 1E-9 -> 1
-ddcot507 comparetotal 1 1E-8 -> 1
-ddcot508 comparetotal 1 1E-7 -> 1
-ddcot509 comparetotal 1 1E-6 -> 1
-ddcot510 comparetotal 1 1E-5 -> 1
-ddcot511 comparetotal 1 1E-4 -> 1
-ddcot512 comparetotal 1 1E-3 -> 1
-ddcot513 comparetotal 1 1E-2 -> 1
-ddcot514 comparetotal 1 1E-1 -> 1
-ddcot515 comparetotal 1 1E-0 -> 0
-ddcot516 comparetotal 1 1E+1 -> -1
-ddcot517 comparetotal 1 1E+2 -> -1
-ddcot518 comparetotal 1 1E+3 -> -1
-ddcot519 comparetotal 1 1E+4 -> -1
-ddcot521 comparetotal 1 1E+5 -> -1
-ddcot522 comparetotal 1 1E+6 -> -1
-ddcot523 comparetotal 1 1E+7 -> -1
-ddcot524 comparetotal 1 1E+8 -> -1
-ddcot525 comparetotal 1 1E+9 -> -1
-ddcot526 comparetotal 1 1E+10 -> -1
-ddcot527 comparetotal 1 1E+11 -> -1
-ddcot528 comparetotal 1 1E+12 -> -1
-ddcot529 comparetotal 1 1E+13 -> -1
-ddcot530 comparetotal 1 1E+14 -> -1
-ddcot531 comparetotal 1 1E+15 -> -1
-ddcot532 comparetotal 1 1E+16 -> -1
-ddcot533 comparetotal 1 1E+17 -> -1
--- LR swap
-ddcot538 comparetotal 1E-17 1 -> -1
-ddcot539 comparetotal 1E-16 1 -> -1
-ddcot540 comparetotal 1E-15 1 -> -1
-ddcot541 comparetotal 1E-14 1 -> -1
-ddcot542 comparetotal 1E-13 1 -> -1
-ddcot543 comparetotal 1E-12 1 -> -1
-ddcot544 comparetotal 1E-11 1 -> -1
-ddcot545 comparetotal 1E-10 1 -> -1
-ddcot546 comparetotal 1E-9 1 -> -1
-ddcot547 comparetotal 1E-8 1 -> -1
-ddcot548 comparetotal 1E-7 1 -> -1
-ddcot549 comparetotal 1E-6 1 -> -1
-ddcot550 comparetotal 1E-5 1 -> -1
-ddcot551 comparetotal 1E-4 1 -> -1
-ddcot552 comparetotal 1E-3 1 -> -1
-ddcot553 comparetotal 1E-2 1 -> -1
-ddcot554 comparetotal 1E-1 1 -> -1
-ddcot555 comparetotal 1E-0 1 -> 0
-ddcot556 comparetotal 1E+1 1 -> 1
-ddcot557 comparetotal 1E+2 1 -> 1
-ddcot558 comparetotal 1E+3 1 -> 1
-ddcot559 comparetotal 1E+4 1 -> 1
-ddcot561 comparetotal 1E+5 1 -> 1
-ddcot562 comparetotal 1E+6 1 -> 1
-ddcot563 comparetotal 1E+7 1 -> 1
-ddcot564 comparetotal 1E+8 1 -> 1
-ddcot565 comparetotal 1E+9 1 -> 1
-ddcot566 comparetotal 1E+10 1 -> 1
-ddcot567 comparetotal 1E+11 1 -> 1
-ddcot568 comparetotal 1E+12 1 -> 1
-ddcot569 comparetotal 1E+13 1 -> 1
-ddcot570 comparetotal 1E+14 1 -> 1
-ddcot571 comparetotal 1E+15 1 -> 1
-ddcot572 comparetotal 1E+16 1 -> 1
-ddcot573 comparetotal 1E+17 1 -> 1
--- similar with a useful coefficient, one side only
-ddcot578 comparetotal 0.000000987654321 1E-17 -> 1
-ddcot579 comparetotal 0.000000987654321 1E-16 -> 1
-ddcot580 comparetotal 0.000000987654321 1E-15 -> 1
-ddcot581 comparetotal 0.000000987654321 1E-14 -> 1
-ddcot582 comparetotal 0.000000987654321 1E-13 -> 1
-ddcot583 comparetotal 0.000000987654321 1E-12 -> 1
-ddcot584 comparetotal 0.000000987654321 1E-11 -> 1
-ddcot585 comparetotal 0.000000987654321 1E-10 -> 1
-ddcot586 comparetotal 0.000000987654321 1E-9 -> 1
-ddcot587 comparetotal 0.000000987654321 1E-8 -> 1
-ddcot588 comparetotal 0.000000987654321 1E-7 -> 1
-ddcot589 comparetotal 0.000000987654321 1E-6 -> -1
-ddcot590 comparetotal 0.000000987654321 1E-5 -> -1
-ddcot591 comparetotal 0.000000987654321 1E-4 -> -1
-ddcot592 comparetotal 0.000000987654321 1E-3 -> -1
-ddcot593 comparetotal 0.000000987654321 1E-2 -> -1
-ddcot594 comparetotal 0.000000987654321 1E-1 -> -1
-ddcot595 comparetotal 0.000000987654321 1E-0 -> -1
-ddcot596 comparetotal 0.000000987654321 1E+1 -> -1
-ddcot597 comparetotal 0.000000987654321 1E+2 -> -1
-ddcot598 comparetotal 0.000000987654321 1E+3 -> -1
-ddcot599 comparetotal 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-ddcot600 comparetotal 12 12.2345 -> -1
-ddcot601 comparetotal 12.0 12.2345 -> -1
-ddcot602 comparetotal 12.00 12.2345 -> -1
-ddcot603 comparetotal 12.000 12.2345 -> -1
-ddcot604 comparetotal 12.0000 12.2345 -> -1
-ddcot605 comparetotal 12.00000 12.2345 -> -1
-ddcot606 comparetotal 12.000000 12.2345 -> -1
-ddcot607 comparetotal 12.0000000 12.2345 -> -1
-ddcot608 comparetotal 12.00000000 12.2345 -> -1
-ddcot609 comparetotal 12.000000000 12.2345 -> -1
-ddcot610 comparetotal 12.1234 12 -> 1
-ddcot611 comparetotal 12.1234 12.0 -> 1
-ddcot612 comparetotal 12.1234 12.00 -> 1
-ddcot613 comparetotal 12.1234 12.000 -> 1
-ddcot614 comparetotal 12.1234 12.0000 -> 1
-ddcot615 comparetotal 12.1234 12.00000 -> 1
-ddcot616 comparetotal 12.1234 12.000000 -> 1
-ddcot617 comparetotal 12.1234 12.0000000 -> 1
-ddcot618 comparetotal 12.1234 12.00000000 -> 1
-ddcot619 comparetotal 12.1234 12.000000000 -> 1
-ddcot620 comparetotal -12 -12.2345 -> 1
-ddcot621 comparetotal -12.0 -12.2345 -> 1
-ddcot622 comparetotal -12.00 -12.2345 -> 1
-ddcot623 comparetotal -12.000 -12.2345 -> 1
-ddcot624 comparetotal -12.0000 -12.2345 -> 1
-ddcot625 comparetotal -12.00000 -12.2345 -> 1
-ddcot626 comparetotal -12.000000 -12.2345 -> 1
-ddcot627 comparetotal -12.0000000 -12.2345 -> 1
-ddcot628 comparetotal -12.00000000 -12.2345 -> 1
-ddcot629 comparetotal -12.000000000 -12.2345 -> 1
-ddcot630 comparetotal -12.1234 -12 -> -1
-ddcot631 comparetotal -12.1234 -12.0 -> -1
-ddcot632 comparetotal -12.1234 -12.00 -> -1
-ddcot633 comparetotal -12.1234 -12.000 -> -1
-ddcot634 comparetotal -12.1234 -12.0000 -> -1
-ddcot635 comparetotal -12.1234 -12.00000 -> -1
-ddcot636 comparetotal -12.1234 -12.000000 -> -1
-ddcot637 comparetotal -12.1234 -12.0000000 -> -1
-ddcot638 comparetotal -12.1234 -12.00000000 -> -1
-ddcot639 comparetotal -12.1234 -12.000000000 -> -1
-
--- extended zeros
-ddcot640 comparetotal 0 0 -> 0
-ddcot641 comparetotal 0 -0 -> 1
-ddcot642 comparetotal 0 -0.0 -> 1
-ddcot643 comparetotal 0 0.0 -> 1
-ddcot644 comparetotal -0 0 -> -1
-ddcot645 comparetotal -0 -0 -> 0
-ddcot646 comparetotal -0 -0.0 -> -1
-ddcot647 comparetotal -0 0.0 -> -1
-ddcot648 comparetotal 0.0 0 -> -1
-ddcot649 comparetotal 0.0 -0 -> 1
-ddcot650 comparetotal 0.0 -0.0 -> 1
-ddcot651 comparetotal 0.0 0.0 -> 0
-ddcot652 comparetotal -0.0 0 -> -1
-ddcot653 comparetotal -0.0 -0 -> 1
-ddcot654 comparetotal -0.0 -0.0 -> 0
-ddcot655 comparetotal -0.0 0.0 -> -1
-
-ddcot656 comparetotal -0E1 0.0 -> -1
-ddcot657 comparetotal -0E2 0.0 -> -1
-ddcot658 comparetotal 0E1 0.0 -> 1
-ddcot659 comparetotal 0E2 0.0 -> 1
-ddcot660 comparetotal -0E1 0 -> -1
-ddcot661 comparetotal -0E2 0 -> -1
-ddcot662 comparetotal 0E1 0 -> 1
-ddcot663 comparetotal 0E2 0 -> 1
-ddcot664 comparetotal -0E1 -0E1 -> 0
-ddcot665 comparetotal -0E2 -0E1 -> -1
-ddcot666 comparetotal 0E1 -0E1 -> 1
-ddcot667 comparetotal 0E2 -0E1 -> 1
-ddcot668 comparetotal -0E1 -0E2 -> 1
-ddcot669 comparetotal -0E2 -0E2 -> 0
-ddcot670 comparetotal 0E1 -0E2 -> 1
-ddcot671 comparetotal 0E2 -0E2 -> 1
-ddcot672 comparetotal -0E1 0E1 -> -1
-ddcot673 comparetotal -0E2 0E1 -> -1
-ddcot674 comparetotal 0E1 0E1 -> 0
-ddcot675 comparetotal 0E2 0E1 -> 1
-ddcot676 comparetotal -0E1 0E2 -> -1
-ddcot677 comparetotal -0E2 0E2 -> -1
-ddcot678 comparetotal 0E1 0E2 -> -1
-ddcot679 comparetotal 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-ddcot680 comparetotal 12 12 -> 0
-ddcot681 comparetotal 12 12.0 -> 1
-ddcot682 comparetotal 12 12.00 -> 1
-ddcot683 comparetotal 12 12.000 -> 1
-ddcot684 comparetotal 12 12.0000 -> 1
-ddcot685 comparetotal 12 12.00000 -> 1
-ddcot686 comparetotal 12 12.000000 -> 1
-ddcot687 comparetotal 12 12.0000000 -> 1
-ddcot688 comparetotal 12 12.00000000 -> 1
-ddcot689 comparetotal 12 12.000000000 -> 1
-ddcot690 comparetotal 12 12 -> 0
-ddcot691 comparetotal 12.0 12 -> -1
-ddcot692 comparetotal 12.00 12 -> -1
-ddcot693 comparetotal 12.000 12 -> -1
-ddcot694 comparetotal 12.0000 12 -> -1
-ddcot695 comparetotal 12.00000 12 -> -1
-ddcot696 comparetotal 12.000000 12 -> -1
-ddcot697 comparetotal 12.0000000 12 -> -1
-ddcot698 comparetotal 12.00000000 12 -> -1
-ddcot699 comparetotal 12.000000000 12 -> -1
-
--- old long operand checks
-ddcot701 comparetotal 12345678000 1 -> 1
-ddcot702 comparetotal 1 12345678000 -> -1
-ddcot703 comparetotal 1234567800 1 -> 1
-ddcot704 comparetotal 1 1234567800 -> -1
-ddcot705 comparetotal 1234567890 1 -> 1
-ddcot706 comparetotal 1 1234567890 -> -1
-ddcot707 comparetotal 1234567891 1 -> 1
-ddcot708 comparetotal 1 1234567891 -> -1
-ddcot709 comparetotal 12345678901 1 -> 1
-ddcot710 comparetotal 1 12345678901 -> -1
-ddcot711 comparetotal 1234567896 1 -> 1
-ddcot712 comparetotal 1 1234567896 -> -1
-ddcot713 comparetotal -1234567891 1 -> -1
-ddcot714 comparetotal 1 -1234567891 -> 1
-ddcot715 comparetotal -12345678901 1 -> -1
-ddcot716 comparetotal 1 -12345678901 -> 1
-ddcot717 comparetotal -1234567896 1 -> -1
-ddcot718 comparetotal 1 -1234567896 -> 1
-
--- old residue cases
-ddcot740 comparetotal 1 0.9999999 -> 1
-ddcot741 comparetotal 1 0.999999 -> 1
-ddcot742 comparetotal 1 0.99999 -> 1
-ddcot743 comparetotal 1 1.0000 -> 1
-ddcot744 comparetotal 1 1.00001 -> -1
-ddcot745 comparetotal 1 1.000001 -> -1
-ddcot746 comparetotal 1 1.0000001 -> -1
-ddcot750 comparetotal 0.9999999 1 -> -1
-ddcot751 comparetotal 0.999999 1 -> -1
-ddcot752 comparetotal 0.99999 1 -> -1
-ddcot753 comparetotal 1.0000 1 -> -1
-ddcot754 comparetotal 1.00001 1 -> 1
-ddcot755 comparetotal 1.000001 1 -> 1
-ddcot756 comparetotal 1.0000001 1 -> 1
-
--- Specials
-ddcot780 comparetotal Inf -Inf -> 1
-ddcot781 comparetotal Inf -1000 -> 1
-ddcot782 comparetotal Inf -1 -> 1
-ddcot783 comparetotal Inf -0 -> 1
-ddcot784 comparetotal Inf 0 -> 1
-ddcot785 comparetotal Inf 1 -> 1
-ddcot786 comparetotal Inf 1000 -> 1
-ddcot787 comparetotal Inf Inf -> 0
-ddcot788 comparetotal -1000 Inf -> -1
-ddcot789 comparetotal -Inf Inf -> -1
-ddcot790 comparetotal -1 Inf -> -1
-ddcot791 comparetotal -0 Inf -> -1
-ddcot792 comparetotal 0 Inf -> -1
-ddcot793 comparetotal 1 Inf -> -1
-ddcot794 comparetotal 1000 Inf -> -1
-ddcot795 comparetotal Inf Inf -> 0
-
-ddcot800 comparetotal -Inf -Inf -> 0
-ddcot801 comparetotal -Inf -1000 -> -1
-ddcot802 comparetotal -Inf -1 -> -1
-ddcot803 comparetotal -Inf -0 -> -1
-ddcot804 comparetotal -Inf 0 -> -1
-ddcot805 comparetotal -Inf 1 -> -1
-ddcot806 comparetotal -Inf 1000 -> -1
-ddcot807 comparetotal -Inf Inf -> -1
-ddcot808 comparetotal -Inf -Inf -> 0
-ddcot809 comparetotal -1000 -Inf -> 1
-ddcot810 comparetotal -1 -Inf -> 1
-ddcot811 comparetotal -0 -Inf -> 1
-ddcot812 comparetotal 0 -Inf -> 1
-ddcot813 comparetotal 1 -Inf -> 1
-ddcot814 comparetotal 1000 -Inf -> 1
-ddcot815 comparetotal Inf -Inf -> 1
-
-ddcot821 comparetotal NaN -Inf -> 1
-ddcot822 comparetotal NaN -1000 -> 1
-ddcot823 comparetotal NaN -1 -> 1
-ddcot824 comparetotal NaN -0 -> 1
-ddcot825 comparetotal NaN 0 -> 1
-ddcot826 comparetotal NaN 1 -> 1
-ddcot827 comparetotal NaN 1000 -> 1
-ddcot828 comparetotal NaN Inf -> 1
-ddcot829 comparetotal NaN NaN -> 0
-ddcot830 comparetotal -Inf NaN -> -1
-ddcot831 comparetotal -1000 NaN -> -1
-ddcot832 comparetotal -1 NaN -> -1
-ddcot833 comparetotal -0 NaN -> -1
-ddcot834 comparetotal 0 NaN -> -1
-ddcot835 comparetotal 1 NaN -> -1
-ddcot836 comparetotal 1000 NaN -> -1
-ddcot837 comparetotal Inf NaN -> -1
-ddcot838 comparetotal -NaN -NaN -> 0
-ddcot839 comparetotal +NaN -NaN -> 1
-ddcot840 comparetotal -NaN +NaN -> -1
-
-ddcot841 comparetotal sNaN -sNaN -> 1
-ddcot842 comparetotal sNaN -NaN -> 1
-ddcot843 comparetotal sNaN -Inf -> 1
-ddcot844 comparetotal sNaN -1000 -> 1
-ddcot845 comparetotal sNaN -1 -> 1
-ddcot846 comparetotal sNaN -0 -> 1
-ddcot847 comparetotal sNaN 0 -> 1
-ddcot848 comparetotal sNaN 1 -> 1
-ddcot849 comparetotal sNaN 1000 -> 1
-ddcot850 comparetotal sNaN NaN -> -1
-ddcot851 comparetotal sNaN sNaN -> 0
-
-ddcot852 comparetotal -sNaN sNaN -> -1
-ddcot853 comparetotal -NaN sNaN -> -1
-ddcot854 comparetotal -Inf sNaN -> -1
-ddcot855 comparetotal -1000 sNaN -> -1
-ddcot856 comparetotal -1 sNaN -> -1
-ddcot857 comparetotal -0 sNaN -> -1
-ddcot858 comparetotal 0 sNaN -> -1
-ddcot859 comparetotal 1 sNaN -> -1
-ddcot860 comparetotal 1000 sNaN -> -1
-ddcot861 comparetotal Inf sNaN -> -1
-ddcot862 comparetotal NaN sNaN -> 1
-ddcot863 comparetotal sNaN sNaN -> 0
-
-ddcot871 comparetotal -sNaN -sNaN -> 0
-ddcot872 comparetotal -sNaN -NaN -> 1
-ddcot873 comparetotal -sNaN -Inf -> -1
-ddcot874 comparetotal -sNaN -1000 -> -1
-ddcot875 comparetotal -sNaN -1 -> -1
-ddcot876 comparetotal -sNaN -0 -> -1
-ddcot877 comparetotal -sNaN 0 -> -1
-ddcot878 comparetotal -sNaN 1 -> -1
-ddcot879 comparetotal -sNaN 1000 -> -1
-ddcot880 comparetotal -sNaN NaN -> -1
-ddcot881 comparetotal -sNaN sNaN -> -1
-
-ddcot882 comparetotal -sNaN -sNaN -> 0
-ddcot883 comparetotal -NaN -sNaN -> -1
-ddcot884 comparetotal -Inf -sNaN -> 1
-ddcot885 comparetotal -1000 -sNaN -> 1
-ddcot886 comparetotal -1 -sNaN -> 1
-ddcot887 comparetotal -0 -sNaN -> 1
-ddcot888 comparetotal 0 -sNaN -> 1
-ddcot889 comparetotal 1 -sNaN -> 1
-ddcot890 comparetotal 1000 -sNaN -> 1
-ddcot891 comparetotal Inf -sNaN -> 1
-ddcot892 comparetotal NaN -sNaN -> 1
-ddcot893 comparetotal sNaN -sNaN -> 1
-
--- NaNs with payload
-ddcot960 comparetotal NaN9 -Inf -> 1
-ddcot961 comparetotal NaN8 999 -> 1
-ddcot962 comparetotal NaN77 Inf -> 1
-ddcot963 comparetotal -NaN67 NaN5 -> -1
-ddcot964 comparetotal -Inf -NaN4 -> 1
-ddcot965 comparetotal -999 -NaN33 -> 1
-ddcot966 comparetotal Inf NaN2 -> -1
-
-ddcot970 comparetotal -NaN41 -NaN42 -> 1
-ddcot971 comparetotal +NaN41 -NaN42 -> 1
-ddcot972 comparetotal -NaN41 +NaN42 -> -1
-ddcot973 comparetotal +NaN41 +NaN42 -> -1
-ddcot974 comparetotal -NaN42 -NaN01 -> -1
-ddcot975 comparetotal +NaN42 -NaN01 -> 1
-ddcot976 comparetotal -NaN42 +NaN01 -> -1
-ddcot977 comparetotal +NaN42 +NaN01 -> 1
-
-ddcot980 comparetotal -sNaN771 -sNaN772 -> 1
-ddcot981 comparetotal +sNaN771 -sNaN772 -> 1
-ddcot982 comparetotal -sNaN771 +sNaN772 -> -1
-ddcot983 comparetotal +sNaN771 +sNaN772 -> -1
-ddcot984 comparetotal -sNaN772 -sNaN771 -> -1
-ddcot985 comparetotal +sNaN772 -sNaN771 -> 1
-ddcot986 comparetotal -sNaN772 +sNaN771 -> -1
-ddcot987 comparetotal +sNaN772 +sNaN771 -> 1
-
-ddcot991 comparetotal -sNaN99 -Inf -> -1
-ddcot992 comparetotal sNaN98 -11 -> 1
-ddcot993 comparetotal sNaN97 NaN -> -1
-ddcot994 comparetotal sNaN16 sNaN94 -> -1
-ddcot995 comparetotal NaN85 sNaN83 -> 1
-ddcot996 comparetotal -Inf sNaN92 -> -1
-ddcot997 comparetotal 088 sNaN81 -> -1
-ddcot998 comparetotal Inf sNaN90 -> -1
-ddcot999 comparetotal NaN -sNaN89 -> 1
-
--- spread zeros
-ddcot1110 comparetotal 0E-383 0 -> -1
-ddcot1111 comparetotal 0E-383 -0 -> 1
-ddcot1112 comparetotal -0E-383 0 -> -1
-ddcot1113 comparetotal -0E-383 -0 -> 1
-ddcot1114 comparetotal 0E-383 0E+384 -> -1
-ddcot1115 comparetotal 0E-383 -0E+384 -> 1
-ddcot1116 comparetotal -0E-383 0E+384 -> -1
-ddcot1117 comparetotal -0E-383 -0E+384 -> 1
-ddcot1118 comparetotal 0 0E+384 -> -1
-ddcot1119 comparetotal 0 -0E+384 -> 1
-ddcot1120 comparetotal -0 0E+384 -> -1
-ddcot1121 comparetotal -0 -0E+384 -> 1
-
-ddcot1130 comparetotal 0E+384 0 -> 1
-ddcot1131 comparetotal 0E+384 -0 -> 1
-ddcot1132 comparetotal -0E+384 0 -> -1
-ddcot1133 comparetotal -0E+384 -0 -> -1
-ddcot1134 comparetotal 0E+384 0E-383 -> 1
-ddcot1135 comparetotal 0E+384 -0E-383 -> 1
-ddcot1136 comparetotal -0E+384 0E-383 -> -1
-ddcot1137 comparetotal -0E+384 -0E-383 -> -1
-ddcot1138 comparetotal 0 0E-383 -> 1
-ddcot1139 comparetotal 0 -0E-383 -> 1
-ddcot1140 comparetotal -0 0E-383 -> -1
-ddcot1141 comparetotal -0 -0E-383 -> -1
-
--- Null tests
-ddcot9990 comparetotal 10 # -> NaN Invalid_operation
-ddcot9991 comparetotal # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddCompareTotal.decTest -- decDouble comparison using total ordering--
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddcot001 comparetotal -2 -2 -> 0
+ddcot002 comparetotal -2 -1 -> -1
+ddcot003 comparetotal -2 0 -> -1
+ddcot004 comparetotal -2 1 -> -1
+ddcot005 comparetotal -2 2 -> -1
+ddcot006 comparetotal -1 -2 -> 1
+ddcot007 comparetotal -1 -1 -> 0
+ddcot008 comparetotal -1 0 -> -1
+ddcot009 comparetotal -1 1 -> -1
+ddcot010 comparetotal -1 2 -> -1
+ddcot011 comparetotal 0 -2 -> 1
+ddcot012 comparetotal 0 -1 -> 1
+ddcot013 comparetotal 0 0 -> 0
+ddcot014 comparetotal 0 1 -> -1
+ddcot015 comparetotal 0 2 -> -1
+ddcot016 comparetotal 1 -2 -> 1
+ddcot017 comparetotal 1 -1 -> 1
+ddcot018 comparetotal 1 0 -> 1
+ddcot019 comparetotal 1 1 -> 0
+ddcot020 comparetotal 1 2 -> -1
+ddcot021 comparetotal 2 -2 -> 1
+ddcot022 comparetotal 2 -1 -> 1
+ddcot023 comparetotal 2 0 -> 1
+ddcot025 comparetotal 2 1 -> 1
+ddcot026 comparetotal 2 2 -> 0
+
+ddcot031 comparetotal -20 -20 -> 0
+ddcot032 comparetotal -20 -10 -> -1
+ddcot033 comparetotal -20 00 -> -1
+ddcot034 comparetotal -20 10 -> -1
+ddcot035 comparetotal -20 20 -> -1
+ddcot036 comparetotal -10 -20 -> 1
+ddcot037 comparetotal -10 -10 -> 0
+ddcot038 comparetotal -10 00 -> -1
+ddcot039 comparetotal -10 10 -> -1
+ddcot040 comparetotal -10 20 -> -1
+ddcot041 comparetotal 00 -20 -> 1
+ddcot042 comparetotal 00 -10 -> 1
+ddcot043 comparetotal 00 00 -> 0
+ddcot044 comparetotal 00 10 -> -1
+ddcot045 comparetotal 00 20 -> -1
+ddcot046 comparetotal 10 -20 -> 1
+ddcot047 comparetotal 10 -10 -> 1
+ddcot048 comparetotal 10 00 -> 1
+ddcot049 comparetotal 10 10 -> 0
+ddcot050 comparetotal 10 20 -> -1
+ddcot051 comparetotal 20 -20 -> 1
+ddcot052 comparetotal 20 -10 -> 1
+ddcot053 comparetotal 20 00 -> 1
+ddcot055 comparetotal 20 10 -> 1
+ddcot056 comparetotal 20 20 -> 0
+
+ddcot061 comparetotal -2.0 -2.0 -> 0
+ddcot062 comparetotal -2.0 -1.0 -> -1
+ddcot063 comparetotal -2.0 0.0 -> -1
+ddcot064 comparetotal -2.0 1.0 -> -1
+ddcot065 comparetotal -2.0 2.0 -> -1
+ddcot066 comparetotal -1.0 -2.0 -> 1
+ddcot067 comparetotal -1.0 -1.0 -> 0
+ddcot068 comparetotal -1.0 0.0 -> -1
+ddcot069 comparetotal -1.0 1.0 -> -1
+ddcot070 comparetotal -1.0 2.0 -> -1
+ddcot071 comparetotal 0.0 -2.0 -> 1
+ddcot072 comparetotal 0.0 -1.0 -> 1
+ddcot073 comparetotal 0.0 0.0 -> 0
+ddcot074 comparetotal 0.0 1.0 -> -1
+ddcot075 comparetotal 0.0 2.0 -> -1
+ddcot076 comparetotal 1.0 -2.0 -> 1
+ddcot077 comparetotal 1.0 -1.0 -> 1
+ddcot078 comparetotal 1.0 0.0 -> 1
+ddcot079 comparetotal 1.0 1.0 -> 0
+ddcot080 comparetotal 1.0 2.0 -> -1
+ddcot081 comparetotal 2.0 -2.0 -> 1
+ddcot082 comparetotal 2.0 -1.0 -> 1
+ddcot083 comparetotal 2.0 0.0 -> 1
+ddcot085 comparetotal 2.0 1.0 -> 1
+ddcot086 comparetotal 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+ddcot090 comparetotal 9.99999999E+384 9.99999999E+384 -> 0
+ddcot091 comparetotal -9.99999999E+384 9.99999999E+384 -> -1
+ddcot092 comparetotal 9.99999999E+384 -9.99999999E+384 -> 1
+ddcot093 comparetotal -9.99999999E+384 -9.99999999E+384 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+ddcot100 comparetotal 7.0 7.0 -> 0
+ddcot101 comparetotal 7.0 7 -> -1
+ddcot102 comparetotal 7 7.0 -> 1
+ddcot103 comparetotal 7E+0 7.0 -> 1
+ddcot104 comparetotal 70E-1 7.0 -> 0
+ddcot105 comparetotal 0.7E+1 7 -> 0
+ddcot106 comparetotal 70E-1 7 -> -1
+ddcot107 comparetotal 7.0 7E+0 -> -1
+ddcot108 comparetotal 7.0 70E-1 -> 0
+ddcot109 comparetotal 7 0.7E+1 -> 0
+ddcot110 comparetotal 7 70E-1 -> 1
+
+ddcot120 comparetotal 8.0 7.0 -> 1
+ddcot121 comparetotal 8.0 7 -> 1
+ddcot122 comparetotal 8 7.0 -> 1
+ddcot123 comparetotal 8E+0 7.0 -> 1
+ddcot124 comparetotal 80E-1 7.0 -> 1
+ddcot125 comparetotal 0.8E+1 7 -> 1
+ddcot126 comparetotal 80E-1 7 -> 1
+ddcot127 comparetotal 8.0 7E+0 -> 1
+ddcot128 comparetotal 8.0 70E-1 -> 1
+ddcot129 comparetotal 8 0.7E+1 -> 1
+ddcot130 comparetotal 8 70E-1 -> 1
+
+ddcot140 comparetotal 8.0 9.0 -> -1
+ddcot141 comparetotal 8.0 9 -> -1
+ddcot142 comparetotal 8 9.0 -> -1
+ddcot143 comparetotal 8E+0 9.0 -> -1
+ddcot144 comparetotal 80E-1 9.0 -> -1
+ddcot145 comparetotal 0.8E+1 9 -> -1
+ddcot146 comparetotal 80E-1 9 -> -1
+ddcot147 comparetotal 8.0 9E+0 -> -1
+ddcot148 comparetotal 8.0 90E-1 -> -1
+ddcot149 comparetotal 8 0.9E+1 -> -1
+ddcot150 comparetotal 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ddcot200 comparetotal -7.0 7.0 -> -1
+ddcot201 comparetotal -7.0 7 -> -1
+ddcot202 comparetotal -7 7.0 -> -1
+ddcot203 comparetotal -7E+0 7.0 -> -1
+ddcot204 comparetotal -70E-1 7.0 -> -1
+ddcot205 comparetotal -0.7E+1 7 -> -1
+ddcot206 comparetotal -70E-1 7 -> -1
+ddcot207 comparetotal -7.0 7E+0 -> -1
+ddcot208 comparetotal -7.0 70E-1 -> -1
+ddcot209 comparetotal -7 0.7E+1 -> -1
+ddcot210 comparetotal -7 70E-1 -> -1
+
+ddcot220 comparetotal -8.0 7.0 -> -1
+ddcot221 comparetotal -8.0 7 -> -1
+ddcot222 comparetotal -8 7.0 -> -1
+ddcot223 comparetotal -8E+0 7.0 -> -1
+ddcot224 comparetotal -80E-1 7.0 -> -1
+ddcot225 comparetotal -0.8E+1 7 -> -1
+ddcot226 comparetotal -80E-1 7 -> -1
+ddcot227 comparetotal -8.0 7E+0 -> -1
+ddcot228 comparetotal -8.0 70E-1 -> -1
+ddcot229 comparetotal -8 0.7E+1 -> -1
+ddcot230 comparetotal -8 70E-1 -> -1
+
+ddcot240 comparetotal -8.0 9.0 -> -1
+ddcot241 comparetotal -8.0 9 -> -1
+ddcot242 comparetotal -8 9.0 -> -1
+ddcot243 comparetotal -8E+0 9.0 -> -1
+ddcot244 comparetotal -80E-1 9.0 -> -1
+ddcot245 comparetotal -0.8E+1 9 -> -1
+ddcot246 comparetotal -80E-1 9 -> -1
+ddcot247 comparetotal -8.0 9E+0 -> -1
+ddcot248 comparetotal -8.0 90E-1 -> -1
+ddcot249 comparetotal -8 0.9E+1 -> -1
+ddcot250 comparetotal -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ddcot300 comparetotal 7.0 -7.0 -> 1
+ddcot301 comparetotal 7.0 -7 -> 1
+ddcot302 comparetotal 7 -7.0 -> 1
+ddcot303 comparetotal 7E+0 -7.0 -> 1
+ddcot304 comparetotal 70E-1 -7.0 -> 1
+ddcot305 comparetotal .7E+1 -7 -> 1
+ddcot306 comparetotal 70E-1 -7 -> 1
+ddcot307 comparetotal 7.0 -7E+0 -> 1
+ddcot308 comparetotal 7.0 -70E-1 -> 1
+ddcot309 comparetotal 7 -.7E+1 -> 1
+ddcot310 comparetotal 7 -70E-1 -> 1
+
+ddcot320 comparetotal 8.0 -7.0 -> 1
+ddcot321 comparetotal 8.0 -7 -> 1
+ddcot322 comparetotal 8 -7.0 -> 1
+ddcot323 comparetotal 8E+0 -7.0 -> 1
+ddcot324 comparetotal 80E-1 -7.0 -> 1
+ddcot325 comparetotal .8E+1 -7 -> 1
+ddcot326 comparetotal 80E-1 -7 -> 1
+ddcot327 comparetotal 8.0 -7E+0 -> 1
+ddcot328 comparetotal 8.0 -70E-1 -> 1
+ddcot329 comparetotal 8 -.7E+1 -> 1
+ddcot330 comparetotal 8 -70E-1 -> 1
+
+ddcot340 comparetotal 8.0 -9.0 -> 1
+ddcot341 comparetotal 8.0 -9 -> 1
+ddcot342 comparetotal 8 -9.0 -> 1
+ddcot343 comparetotal 8E+0 -9.0 -> 1
+ddcot344 comparetotal 80E-1 -9.0 -> 1
+ddcot345 comparetotal .8E+1 -9 -> 1
+ddcot346 comparetotal 80E-1 -9 -> 1
+ddcot347 comparetotal 8.0 -9E+0 -> 1
+ddcot348 comparetotal 8.0 -90E-1 -> 1
+ddcot349 comparetotal 8 -.9E+1 -> 1
+ddcot350 comparetotal 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+ddcot400 comparetotal -7.0 -7.0 -> 0
+ddcot401 comparetotal -7.0 -7 -> 1
+ddcot402 comparetotal -7 -7.0 -> -1
+ddcot403 comparetotal -7E+0 -7.0 -> -1
+ddcot404 comparetotal -70E-1 -7.0 -> 0
+ddcot405 comparetotal -.7E+1 -7 -> 0
+ddcot406 comparetotal -70E-1 -7 -> 1
+ddcot407 comparetotal -7.0 -7E+0 -> 1
+ddcot408 comparetotal -7.0 -70E-1 -> 0
+ddcot409 comparetotal -7 -.7E+1 -> 0
+ddcot410 comparetotal -7 -70E-1 -> -1
+
+ddcot420 comparetotal -8.0 -7.0 -> -1
+ddcot421 comparetotal -8.0 -7 -> -1
+ddcot422 comparetotal -8 -7.0 -> -1
+ddcot423 comparetotal -8E+0 -7.0 -> -1
+ddcot424 comparetotal -80E-1 -7.0 -> -1
+ddcot425 comparetotal -.8E+1 -7 -> -1
+ddcot426 comparetotal -80E-1 -7 -> -1
+ddcot427 comparetotal -8.0 -7E+0 -> -1
+ddcot428 comparetotal -8.0 -70E-1 -> -1
+ddcot429 comparetotal -8 -.7E+1 -> -1
+ddcot430 comparetotal -8 -70E-1 -> -1
+
+ddcot440 comparetotal -8.0 -9.0 -> 1
+ddcot441 comparetotal -8.0 -9 -> 1
+ddcot442 comparetotal -8 -9.0 -> 1
+ddcot443 comparetotal -8E+0 -9.0 -> 1
+ddcot444 comparetotal -80E-1 -9.0 -> 1
+ddcot445 comparetotal -.8E+1 -9 -> 1
+ddcot446 comparetotal -80E-1 -9 -> 1
+ddcot447 comparetotal -8.0 -9E+0 -> 1
+ddcot448 comparetotal -8.0 -90E-1 -> 1
+ddcot449 comparetotal -8 -.9E+1 -> 1
+ddcot450 comparetotal -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+ddcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
+ddcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1
+ddcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
+ddcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1
+ddcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
+ddcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1
+ddcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
+ddcot480 comparetotal 123.456000E+89 123.456E+89 -> -1
+ddcot481 comparetotal 123.45600E-89 123.456E-89 -> -1
+ddcot482 comparetotal 123.4560E+89 123.456E+89 -> -1
+ddcot483 comparetotal 123.456E-89 123.456E-89 -> 0
+ddcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1
+ddcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
+ddcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1
+ddcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
+ddcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1
+ddcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
+ddcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1
+ddcot494 comparetotal 123.456E-89 123.456000E-89 -> 1
+ddcot495 comparetotal 123.456E+89 123.45600E+89 -> 1
+ddcot496 comparetotal 123.456E-89 123.4560E-89 -> 1
+ddcot497 comparetotal 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+ddcot498 comparetotal 1 1E-17 -> 1
+ddcot499 comparetotal 1 1E-16 -> 1
+ddcot500 comparetotal 1 1E-15 -> 1
+ddcot501 comparetotal 1 1E-14 -> 1
+ddcot502 comparetotal 1 1E-13 -> 1
+ddcot503 comparetotal 1 1E-12 -> 1
+ddcot504 comparetotal 1 1E-11 -> 1
+ddcot505 comparetotal 1 1E-10 -> 1
+ddcot506 comparetotal 1 1E-9 -> 1
+ddcot507 comparetotal 1 1E-8 -> 1
+ddcot508 comparetotal 1 1E-7 -> 1
+ddcot509 comparetotal 1 1E-6 -> 1
+ddcot510 comparetotal 1 1E-5 -> 1
+ddcot511 comparetotal 1 1E-4 -> 1
+ddcot512 comparetotal 1 1E-3 -> 1
+ddcot513 comparetotal 1 1E-2 -> 1
+ddcot514 comparetotal 1 1E-1 -> 1
+ddcot515 comparetotal 1 1E-0 -> 0
+ddcot516 comparetotal 1 1E+1 -> -1
+ddcot517 comparetotal 1 1E+2 -> -1
+ddcot518 comparetotal 1 1E+3 -> -1
+ddcot519 comparetotal 1 1E+4 -> -1
+ddcot521 comparetotal 1 1E+5 -> -1
+ddcot522 comparetotal 1 1E+6 -> -1
+ddcot523 comparetotal 1 1E+7 -> -1
+ddcot524 comparetotal 1 1E+8 -> -1
+ddcot525 comparetotal 1 1E+9 -> -1
+ddcot526 comparetotal 1 1E+10 -> -1
+ddcot527 comparetotal 1 1E+11 -> -1
+ddcot528 comparetotal 1 1E+12 -> -1
+ddcot529 comparetotal 1 1E+13 -> -1
+ddcot530 comparetotal 1 1E+14 -> -1
+ddcot531 comparetotal 1 1E+15 -> -1
+ddcot532 comparetotal 1 1E+16 -> -1
+ddcot533 comparetotal 1 1E+17 -> -1
+-- LR swap
+ddcot538 comparetotal 1E-17 1 -> -1
+ddcot539 comparetotal 1E-16 1 -> -1
+ddcot540 comparetotal 1E-15 1 -> -1
+ddcot541 comparetotal 1E-14 1 -> -1
+ddcot542 comparetotal 1E-13 1 -> -1
+ddcot543 comparetotal 1E-12 1 -> -1
+ddcot544 comparetotal 1E-11 1 -> -1
+ddcot545 comparetotal 1E-10 1 -> -1
+ddcot546 comparetotal 1E-9 1 -> -1
+ddcot547 comparetotal 1E-8 1 -> -1
+ddcot548 comparetotal 1E-7 1 -> -1
+ddcot549 comparetotal 1E-6 1 -> -1
+ddcot550 comparetotal 1E-5 1 -> -1
+ddcot551 comparetotal 1E-4 1 -> -1
+ddcot552 comparetotal 1E-3 1 -> -1
+ddcot553 comparetotal 1E-2 1 -> -1
+ddcot554 comparetotal 1E-1 1 -> -1
+ddcot555 comparetotal 1E-0 1 -> 0
+ddcot556 comparetotal 1E+1 1 -> 1
+ddcot557 comparetotal 1E+2 1 -> 1
+ddcot558 comparetotal 1E+3 1 -> 1
+ddcot559 comparetotal 1E+4 1 -> 1
+ddcot561 comparetotal 1E+5 1 -> 1
+ddcot562 comparetotal 1E+6 1 -> 1
+ddcot563 comparetotal 1E+7 1 -> 1
+ddcot564 comparetotal 1E+8 1 -> 1
+ddcot565 comparetotal 1E+9 1 -> 1
+ddcot566 comparetotal 1E+10 1 -> 1
+ddcot567 comparetotal 1E+11 1 -> 1
+ddcot568 comparetotal 1E+12 1 -> 1
+ddcot569 comparetotal 1E+13 1 -> 1
+ddcot570 comparetotal 1E+14 1 -> 1
+ddcot571 comparetotal 1E+15 1 -> 1
+ddcot572 comparetotal 1E+16 1 -> 1
+ddcot573 comparetotal 1E+17 1 -> 1
+-- similar with a useful coefficient, one side only
+ddcot578 comparetotal 0.000000987654321 1E-17 -> 1
+ddcot579 comparetotal 0.000000987654321 1E-16 -> 1
+ddcot580 comparetotal 0.000000987654321 1E-15 -> 1
+ddcot581 comparetotal 0.000000987654321 1E-14 -> 1
+ddcot582 comparetotal 0.000000987654321 1E-13 -> 1
+ddcot583 comparetotal 0.000000987654321 1E-12 -> 1
+ddcot584 comparetotal 0.000000987654321 1E-11 -> 1
+ddcot585 comparetotal 0.000000987654321 1E-10 -> 1
+ddcot586 comparetotal 0.000000987654321 1E-9 -> 1
+ddcot587 comparetotal 0.000000987654321 1E-8 -> 1
+ddcot588 comparetotal 0.000000987654321 1E-7 -> 1
+ddcot589 comparetotal 0.000000987654321 1E-6 -> -1
+ddcot590 comparetotal 0.000000987654321 1E-5 -> -1
+ddcot591 comparetotal 0.000000987654321 1E-4 -> -1
+ddcot592 comparetotal 0.000000987654321 1E-3 -> -1
+ddcot593 comparetotal 0.000000987654321 1E-2 -> -1
+ddcot594 comparetotal 0.000000987654321 1E-1 -> -1
+ddcot595 comparetotal 0.000000987654321 1E-0 -> -1
+ddcot596 comparetotal 0.000000987654321 1E+1 -> -1
+ddcot597 comparetotal 0.000000987654321 1E+2 -> -1
+ddcot598 comparetotal 0.000000987654321 1E+3 -> -1
+ddcot599 comparetotal 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+ddcot600 comparetotal 12 12.2345 -> -1
+ddcot601 comparetotal 12.0 12.2345 -> -1
+ddcot602 comparetotal 12.00 12.2345 -> -1
+ddcot603 comparetotal 12.000 12.2345 -> -1
+ddcot604 comparetotal 12.0000 12.2345 -> -1
+ddcot605 comparetotal 12.00000 12.2345 -> -1
+ddcot606 comparetotal 12.000000 12.2345 -> -1
+ddcot607 comparetotal 12.0000000 12.2345 -> -1
+ddcot608 comparetotal 12.00000000 12.2345 -> -1
+ddcot609 comparetotal 12.000000000 12.2345 -> -1
+ddcot610 comparetotal 12.1234 12 -> 1
+ddcot611 comparetotal 12.1234 12.0 -> 1
+ddcot612 comparetotal 12.1234 12.00 -> 1
+ddcot613 comparetotal 12.1234 12.000 -> 1
+ddcot614 comparetotal 12.1234 12.0000 -> 1
+ddcot615 comparetotal 12.1234 12.00000 -> 1
+ddcot616 comparetotal 12.1234 12.000000 -> 1
+ddcot617 comparetotal 12.1234 12.0000000 -> 1
+ddcot618 comparetotal 12.1234 12.00000000 -> 1
+ddcot619 comparetotal 12.1234 12.000000000 -> 1
+ddcot620 comparetotal -12 -12.2345 -> 1
+ddcot621 comparetotal -12.0 -12.2345 -> 1
+ddcot622 comparetotal -12.00 -12.2345 -> 1
+ddcot623 comparetotal -12.000 -12.2345 -> 1
+ddcot624 comparetotal -12.0000 -12.2345 -> 1
+ddcot625 comparetotal -12.00000 -12.2345 -> 1
+ddcot626 comparetotal -12.000000 -12.2345 -> 1
+ddcot627 comparetotal -12.0000000 -12.2345 -> 1
+ddcot628 comparetotal -12.00000000 -12.2345 -> 1
+ddcot629 comparetotal -12.000000000 -12.2345 -> 1
+ddcot630 comparetotal -12.1234 -12 -> -1
+ddcot631 comparetotal -12.1234 -12.0 -> -1
+ddcot632 comparetotal -12.1234 -12.00 -> -1
+ddcot633 comparetotal -12.1234 -12.000 -> -1
+ddcot634 comparetotal -12.1234 -12.0000 -> -1
+ddcot635 comparetotal -12.1234 -12.00000 -> -1
+ddcot636 comparetotal -12.1234 -12.000000 -> -1
+ddcot637 comparetotal -12.1234 -12.0000000 -> -1
+ddcot638 comparetotal -12.1234 -12.00000000 -> -1
+ddcot639 comparetotal -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+ddcot640 comparetotal 0 0 -> 0
+ddcot641 comparetotal 0 -0 -> 1
+ddcot642 comparetotal 0 -0.0 -> 1
+ddcot643 comparetotal 0 0.0 -> 1
+ddcot644 comparetotal -0 0 -> -1
+ddcot645 comparetotal -0 -0 -> 0
+ddcot646 comparetotal -0 -0.0 -> -1
+ddcot647 comparetotal -0 0.0 -> -1
+ddcot648 comparetotal 0.0 0 -> -1
+ddcot649 comparetotal 0.0 -0 -> 1
+ddcot650 comparetotal 0.0 -0.0 -> 1
+ddcot651 comparetotal 0.0 0.0 -> 0
+ddcot652 comparetotal -0.0 0 -> -1
+ddcot653 comparetotal -0.0 -0 -> 1
+ddcot654 comparetotal -0.0 -0.0 -> 0
+ddcot655 comparetotal -0.0 0.0 -> -1
+
+ddcot656 comparetotal -0E1 0.0 -> -1
+ddcot657 comparetotal -0E2 0.0 -> -1
+ddcot658 comparetotal 0E1 0.0 -> 1
+ddcot659 comparetotal 0E2 0.0 -> 1
+ddcot660 comparetotal -0E1 0 -> -1
+ddcot661 comparetotal -0E2 0 -> -1
+ddcot662 comparetotal 0E1 0 -> 1
+ddcot663 comparetotal 0E2 0 -> 1
+ddcot664 comparetotal -0E1 -0E1 -> 0
+ddcot665 comparetotal -0E2 -0E1 -> -1
+ddcot666 comparetotal 0E1 -0E1 -> 1
+ddcot667 comparetotal 0E2 -0E1 -> 1
+ddcot668 comparetotal -0E1 -0E2 -> 1
+ddcot669 comparetotal -0E2 -0E2 -> 0
+ddcot670 comparetotal 0E1 -0E2 -> 1
+ddcot671 comparetotal 0E2 -0E2 -> 1
+ddcot672 comparetotal -0E1 0E1 -> -1
+ddcot673 comparetotal -0E2 0E1 -> -1
+ddcot674 comparetotal 0E1 0E1 -> 0
+ddcot675 comparetotal 0E2 0E1 -> 1
+ddcot676 comparetotal -0E1 0E2 -> -1
+ddcot677 comparetotal -0E2 0E2 -> -1
+ddcot678 comparetotal 0E1 0E2 -> -1
+ddcot679 comparetotal 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+ddcot680 comparetotal 12 12 -> 0
+ddcot681 comparetotal 12 12.0 -> 1
+ddcot682 comparetotal 12 12.00 -> 1
+ddcot683 comparetotal 12 12.000 -> 1
+ddcot684 comparetotal 12 12.0000 -> 1
+ddcot685 comparetotal 12 12.00000 -> 1
+ddcot686 comparetotal 12 12.000000 -> 1
+ddcot687 comparetotal 12 12.0000000 -> 1
+ddcot688 comparetotal 12 12.00000000 -> 1
+ddcot689 comparetotal 12 12.000000000 -> 1
+ddcot690 comparetotal 12 12 -> 0
+ddcot691 comparetotal 12.0 12 -> -1
+ddcot692 comparetotal 12.00 12 -> -1
+ddcot693 comparetotal 12.000 12 -> -1
+ddcot694 comparetotal 12.0000 12 -> -1
+ddcot695 comparetotal 12.00000 12 -> -1
+ddcot696 comparetotal 12.000000 12 -> -1
+ddcot697 comparetotal 12.0000000 12 -> -1
+ddcot698 comparetotal 12.00000000 12 -> -1
+ddcot699 comparetotal 12.000000000 12 -> -1
+
+-- old long operand checks
+ddcot701 comparetotal 12345678000 1 -> 1
+ddcot702 comparetotal 1 12345678000 -> -1
+ddcot703 comparetotal 1234567800 1 -> 1
+ddcot704 comparetotal 1 1234567800 -> -1
+ddcot705 comparetotal 1234567890 1 -> 1
+ddcot706 comparetotal 1 1234567890 -> -1
+ddcot707 comparetotal 1234567891 1 -> 1
+ddcot708 comparetotal 1 1234567891 -> -1
+ddcot709 comparetotal 12345678901 1 -> 1
+ddcot710 comparetotal 1 12345678901 -> -1
+ddcot711 comparetotal 1234567896 1 -> 1
+ddcot712 comparetotal 1 1234567896 -> -1
+ddcot713 comparetotal -1234567891 1 -> -1
+ddcot714 comparetotal 1 -1234567891 -> 1
+ddcot715 comparetotal -12345678901 1 -> -1
+ddcot716 comparetotal 1 -12345678901 -> 1
+ddcot717 comparetotal -1234567896 1 -> -1
+ddcot718 comparetotal 1 -1234567896 -> 1
+
+-- old residue cases
+ddcot740 comparetotal 1 0.9999999 -> 1
+ddcot741 comparetotal 1 0.999999 -> 1
+ddcot742 comparetotal 1 0.99999 -> 1
+ddcot743 comparetotal 1 1.0000 -> 1
+ddcot744 comparetotal 1 1.00001 -> -1
+ddcot745 comparetotal 1 1.000001 -> -1
+ddcot746 comparetotal 1 1.0000001 -> -1
+ddcot750 comparetotal 0.9999999 1 -> -1
+ddcot751 comparetotal 0.999999 1 -> -1
+ddcot752 comparetotal 0.99999 1 -> -1
+ddcot753 comparetotal 1.0000 1 -> -1
+ddcot754 comparetotal 1.00001 1 -> 1
+ddcot755 comparetotal 1.000001 1 -> 1
+ddcot756 comparetotal 1.0000001 1 -> 1
+
+-- Specials
+ddcot780 comparetotal Inf -Inf -> 1
+ddcot781 comparetotal Inf -1000 -> 1
+ddcot782 comparetotal Inf -1 -> 1
+ddcot783 comparetotal Inf -0 -> 1
+ddcot784 comparetotal Inf 0 -> 1
+ddcot785 comparetotal Inf 1 -> 1
+ddcot786 comparetotal Inf 1000 -> 1
+ddcot787 comparetotal Inf Inf -> 0
+ddcot788 comparetotal -1000 Inf -> -1
+ddcot789 comparetotal -Inf Inf -> -1
+ddcot790 comparetotal -1 Inf -> -1
+ddcot791 comparetotal -0 Inf -> -1
+ddcot792 comparetotal 0 Inf -> -1
+ddcot793 comparetotal 1 Inf -> -1
+ddcot794 comparetotal 1000 Inf -> -1
+ddcot795 comparetotal Inf Inf -> 0
+
+ddcot800 comparetotal -Inf -Inf -> 0
+ddcot801 comparetotal -Inf -1000 -> -1
+ddcot802 comparetotal -Inf -1 -> -1
+ddcot803 comparetotal -Inf -0 -> -1
+ddcot804 comparetotal -Inf 0 -> -1
+ddcot805 comparetotal -Inf 1 -> -1
+ddcot806 comparetotal -Inf 1000 -> -1
+ddcot807 comparetotal -Inf Inf -> -1
+ddcot808 comparetotal -Inf -Inf -> 0
+ddcot809 comparetotal -1000 -Inf -> 1
+ddcot810 comparetotal -1 -Inf -> 1
+ddcot811 comparetotal -0 -Inf -> 1
+ddcot812 comparetotal 0 -Inf -> 1
+ddcot813 comparetotal 1 -Inf -> 1
+ddcot814 comparetotal 1000 -Inf -> 1
+ddcot815 comparetotal Inf -Inf -> 1
+
+ddcot821 comparetotal NaN -Inf -> 1
+ddcot822 comparetotal NaN -1000 -> 1
+ddcot823 comparetotal NaN -1 -> 1
+ddcot824 comparetotal NaN -0 -> 1
+ddcot825 comparetotal NaN 0 -> 1
+ddcot826 comparetotal NaN 1 -> 1
+ddcot827 comparetotal NaN 1000 -> 1
+ddcot828 comparetotal NaN Inf -> 1
+ddcot829 comparetotal NaN NaN -> 0
+ddcot830 comparetotal -Inf NaN -> -1
+ddcot831 comparetotal -1000 NaN -> -1
+ddcot832 comparetotal -1 NaN -> -1
+ddcot833 comparetotal -0 NaN -> -1
+ddcot834 comparetotal 0 NaN -> -1
+ddcot835 comparetotal 1 NaN -> -1
+ddcot836 comparetotal 1000 NaN -> -1
+ddcot837 comparetotal Inf NaN -> -1
+ddcot838 comparetotal -NaN -NaN -> 0
+ddcot839 comparetotal +NaN -NaN -> 1
+ddcot840 comparetotal -NaN +NaN -> -1
+
+ddcot841 comparetotal sNaN -sNaN -> 1
+ddcot842 comparetotal sNaN -NaN -> 1
+ddcot843 comparetotal sNaN -Inf -> 1
+ddcot844 comparetotal sNaN -1000 -> 1
+ddcot845 comparetotal sNaN -1 -> 1
+ddcot846 comparetotal sNaN -0 -> 1
+ddcot847 comparetotal sNaN 0 -> 1
+ddcot848 comparetotal sNaN 1 -> 1
+ddcot849 comparetotal sNaN 1000 -> 1
+ddcot850 comparetotal sNaN NaN -> -1
+ddcot851 comparetotal sNaN sNaN -> 0
+
+ddcot852 comparetotal -sNaN sNaN -> -1
+ddcot853 comparetotal -NaN sNaN -> -1
+ddcot854 comparetotal -Inf sNaN -> -1
+ddcot855 comparetotal -1000 sNaN -> -1
+ddcot856 comparetotal -1 sNaN -> -1
+ddcot857 comparetotal -0 sNaN -> -1
+ddcot858 comparetotal 0 sNaN -> -1
+ddcot859 comparetotal 1 sNaN -> -1
+ddcot860 comparetotal 1000 sNaN -> -1
+ddcot861 comparetotal Inf sNaN -> -1
+ddcot862 comparetotal NaN sNaN -> 1
+ddcot863 comparetotal sNaN sNaN -> 0
+
+ddcot871 comparetotal -sNaN -sNaN -> 0
+ddcot872 comparetotal -sNaN -NaN -> 1
+ddcot873 comparetotal -sNaN -Inf -> -1
+ddcot874 comparetotal -sNaN -1000 -> -1
+ddcot875 comparetotal -sNaN -1 -> -1
+ddcot876 comparetotal -sNaN -0 -> -1
+ddcot877 comparetotal -sNaN 0 -> -1
+ddcot878 comparetotal -sNaN 1 -> -1
+ddcot879 comparetotal -sNaN 1000 -> -1
+ddcot880 comparetotal -sNaN NaN -> -1
+ddcot881 comparetotal -sNaN sNaN -> -1
+
+ddcot882 comparetotal -sNaN -sNaN -> 0
+ddcot883 comparetotal -NaN -sNaN -> -1
+ddcot884 comparetotal -Inf -sNaN -> 1
+ddcot885 comparetotal -1000 -sNaN -> 1
+ddcot886 comparetotal -1 -sNaN -> 1
+ddcot887 comparetotal -0 -sNaN -> 1
+ddcot888 comparetotal 0 -sNaN -> 1
+ddcot889 comparetotal 1 -sNaN -> 1
+ddcot890 comparetotal 1000 -sNaN -> 1
+ddcot891 comparetotal Inf -sNaN -> 1
+ddcot892 comparetotal NaN -sNaN -> 1
+ddcot893 comparetotal sNaN -sNaN -> 1
+
+-- NaNs with payload
+ddcot960 comparetotal NaN9 -Inf -> 1
+ddcot961 comparetotal NaN8 999 -> 1
+ddcot962 comparetotal NaN77 Inf -> 1
+ddcot963 comparetotal -NaN67 NaN5 -> -1
+ddcot964 comparetotal -Inf -NaN4 -> 1
+ddcot965 comparetotal -999 -NaN33 -> 1
+ddcot966 comparetotal Inf NaN2 -> -1
+
+ddcot970 comparetotal -NaN41 -NaN42 -> 1
+ddcot971 comparetotal +NaN41 -NaN42 -> 1
+ddcot972 comparetotal -NaN41 +NaN42 -> -1
+ddcot973 comparetotal +NaN41 +NaN42 -> -1
+ddcot974 comparetotal -NaN42 -NaN01 -> -1
+ddcot975 comparetotal +NaN42 -NaN01 -> 1
+ddcot976 comparetotal -NaN42 +NaN01 -> -1
+ddcot977 comparetotal +NaN42 +NaN01 -> 1
+
+ddcot980 comparetotal -sNaN771 -sNaN772 -> 1
+ddcot981 comparetotal +sNaN771 -sNaN772 -> 1
+ddcot982 comparetotal -sNaN771 +sNaN772 -> -1
+ddcot983 comparetotal +sNaN771 +sNaN772 -> -1
+ddcot984 comparetotal -sNaN772 -sNaN771 -> -1
+ddcot985 comparetotal +sNaN772 -sNaN771 -> 1
+ddcot986 comparetotal -sNaN772 +sNaN771 -> -1
+ddcot987 comparetotal +sNaN772 +sNaN771 -> 1
+
+ddcot991 comparetotal -sNaN99 -Inf -> -1
+ddcot992 comparetotal sNaN98 -11 -> 1
+ddcot993 comparetotal sNaN97 NaN -> -1
+ddcot994 comparetotal sNaN16 sNaN94 -> -1
+ddcot995 comparetotal NaN85 sNaN83 -> 1
+ddcot996 comparetotal -Inf sNaN92 -> -1
+ddcot997 comparetotal 088 sNaN81 -> -1
+ddcot998 comparetotal Inf sNaN90 -> -1
+ddcot999 comparetotal NaN -sNaN89 -> 1
+
+-- spread zeros
+ddcot1110 comparetotal 0E-383 0 -> -1
+ddcot1111 comparetotal 0E-383 -0 -> 1
+ddcot1112 comparetotal -0E-383 0 -> -1
+ddcot1113 comparetotal -0E-383 -0 -> 1
+ddcot1114 comparetotal 0E-383 0E+384 -> -1
+ddcot1115 comparetotal 0E-383 -0E+384 -> 1
+ddcot1116 comparetotal -0E-383 0E+384 -> -1
+ddcot1117 comparetotal -0E-383 -0E+384 -> 1
+ddcot1118 comparetotal 0 0E+384 -> -1
+ddcot1119 comparetotal 0 -0E+384 -> 1
+ddcot1120 comparetotal -0 0E+384 -> -1
+ddcot1121 comparetotal -0 -0E+384 -> 1
+
+ddcot1130 comparetotal 0E+384 0 -> 1
+ddcot1131 comparetotal 0E+384 -0 -> 1
+ddcot1132 comparetotal -0E+384 0 -> -1
+ddcot1133 comparetotal -0E+384 -0 -> -1
+ddcot1134 comparetotal 0E+384 0E-383 -> 1
+ddcot1135 comparetotal 0E+384 -0E-383 -> 1
+ddcot1136 comparetotal -0E+384 0E-383 -> -1
+ddcot1137 comparetotal -0E+384 -0E-383 -> -1
+ddcot1138 comparetotal 0 0E-383 -> 1
+ddcot1139 comparetotal 0 -0E-383 -> 1
+ddcot1140 comparetotal -0 0E-383 -> -1
+ddcot1141 comparetotal -0 -0E-383 -> -1
+
+-- Null tests
+ddcot9990 comparetotal 10 # -> NaN Invalid_operation
+ddcot9991 comparetotal # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddCompareTotalMag.decTest b/Lib/test/decimaltestdata/ddCompareTotalMag.decTest
index f16537a35d..087a092f0b 100644
--- a/Lib/test/decimaltestdata/ddCompareTotalMag.decTest
+++ b/Lib/test/decimaltestdata/ddCompareTotalMag.decTest
@@ -1,706 +1,706 @@
-------------------------------------------------------------------------
--- ddCompareTotalMag.decTest -- decDouble comparison; abs. total order--
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddctm001 comparetotmag -2 -2 -> 0
-ddctm002 comparetotmag -2 -1 -> 1
-ddctm003 comparetotmag -2 0 -> 1
-ddctm004 comparetotmag -2 1 -> 1
-ddctm005 comparetotmag -2 2 -> 0
-ddctm006 comparetotmag -1 -2 -> -1
-ddctm007 comparetotmag -1 -1 -> 0
-ddctm008 comparetotmag -1 0 -> 1
-ddctm009 comparetotmag -1 1 -> 0
-ddctm010 comparetotmag -1 2 -> -1
-ddctm011 comparetotmag 0 -2 -> -1
-ddctm012 comparetotmag 0 -1 -> -1
-ddctm013 comparetotmag 0 0 -> 0
-ddctm014 comparetotmag 0 1 -> -1
-ddctm015 comparetotmag 0 2 -> -1
-ddctm016 comparetotmag 1 -2 -> -1
-ddctm017 comparetotmag 1 -1 -> 0
-ddctm018 comparetotmag 1 0 -> 1
-ddctm019 comparetotmag 1 1 -> 0
-ddctm020 comparetotmag 1 2 -> -1
-ddctm021 comparetotmag 2 -2 -> 0
-ddctm022 comparetotmag 2 -1 -> 1
-ddctm023 comparetotmag 2 0 -> 1
-ddctm025 comparetotmag 2 1 -> 1
-ddctm026 comparetotmag 2 2 -> 0
-
-ddctm031 comparetotmag -20 -20 -> 0
-ddctm032 comparetotmag -20 -10 -> 1
-ddctm033 comparetotmag -20 00 -> 1
-ddctm034 comparetotmag -20 10 -> 1
-ddctm035 comparetotmag -20 20 -> 0
-ddctm036 comparetotmag -10 -20 -> -1
-ddctm037 comparetotmag -10 -10 -> 0
-ddctm038 comparetotmag -10 00 -> 1
-ddctm039 comparetotmag -10 10 -> 0
-ddctm040 comparetotmag -10 20 -> -1
-ddctm041 comparetotmag 00 -20 -> -1
-ddctm042 comparetotmag 00 -10 -> -1
-ddctm043 comparetotmag 00 00 -> 0
-ddctm044 comparetotmag 00 10 -> -1
-ddctm045 comparetotmag 00 20 -> -1
-ddctm046 comparetotmag 10 -20 -> -1
-ddctm047 comparetotmag 10 -10 -> 0
-ddctm048 comparetotmag 10 00 -> 1
-ddctm049 comparetotmag 10 10 -> 0
-ddctm050 comparetotmag 10 20 -> -1
-ddctm051 comparetotmag 20 -20 -> 0
-ddctm052 comparetotmag 20 -10 -> 1
-ddctm053 comparetotmag 20 00 -> 1
-ddctm055 comparetotmag 20 10 -> 1
-ddctm056 comparetotmag 20 20 -> 0
-
-ddctm061 comparetotmag -2.0 -2.0 -> 0
-ddctm062 comparetotmag -2.0 -1.0 -> 1
-ddctm063 comparetotmag -2.0 0.0 -> 1
-ddctm064 comparetotmag -2.0 1.0 -> 1
-ddctm065 comparetotmag -2.0 2.0 -> 0
-ddctm066 comparetotmag -1.0 -2.0 -> -1
-ddctm067 comparetotmag -1.0 -1.0 -> 0
-ddctm068 comparetotmag -1.0 0.0 -> 1
-ddctm069 comparetotmag -1.0 1.0 -> 0
-ddctm070 comparetotmag -1.0 2.0 -> -1
-ddctm071 comparetotmag 0.0 -2.0 -> -1
-ddctm072 comparetotmag 0.0 -1.0 -> -1
-ddctm073 comparetotmag 0.0 0.0 -> 0
-ddctm074 comparetotmag 0.0 1.0 -> -1
-ddctm075 comparetotmag 0.0 2.0 -> -1
-ddctm076 comparetotmag 1.0 -2.0 -> -1
-ddctm077 comparetotmag 1.0 -1.0 -> 0
-ddctm078 comparetotmag 1.0 0.0 -> 1
-ddctm079 comparetotmag 1.0 1.0 -> 0
-ddctm080 comparetotmag 1.0 2.0 -> -1
-ddctm081 comparetotmag 2.0 -2.0 -> 0
-ddctm082 comparetotmag 2.0 -1.0 -> 1
-ddctm083 comparetotmag 2.0 0.0 -> 1
-ddctm085 comparetotmag 2.0 1.0 -> 1
-ddctm086 comparetotmag 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-ddctm090 comparetotmag 9.99999999E+384 9.99999999E+384 -> 0
-ddctm091 comparetotmag -9.99999999E+384 9.99999999E+384 -> 0
-ddctm092 comparetotmag 9.99999999E+384 -9.99999999E+384 -> 0
-ddctm093 comparetotmag -9.99999999E+384 -9.99999999E+384 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-ddctm100 comparetotmag 7.0 7.0 -> 0
-ddctm101 comparetotmag 7.0 7 -> -1
-ddctm102 comparetotmag 7 7.0 -> 1
-ddctm103 comparetotmag 7E+0 7.0 -> 1
-ddctm104 comparetotmag 70E-1 7.0 -> 0
-ddctm105 comparetotmag 0.7E+1 7 -> 0
-ddctm106 comparetotmag 70E-1 7 -> -1
-ddctm107 comparetotmag 7.0 7E+0 -> -1
-ddctm108 comparetotmag 7.0 70E-1 -> 0
-ddctm109 comparetotmag 7 0.7E+1 -> 0
-ddctm110 comparetotmag 7 70E-1 -> 1
-
-ddctm120 comparetotmag 8.0 7.0 -> 1
-ddctm121 comparetotmag 8.0 7 -> 1
-ddctm122 comparetotmag 8 7.0 -> 1
-ddctm123 comparetotmag 8E+0 7.0 -> 1
-ddctm124 comparetotmag 80E-1 7.0 -> 1
-ddctm125 comparetotmag 0.8E+1 7 -> 1
-ddctm126 comparetotmag 80E-1 7 -> 1
-ddctm127 comparetotmag 8.0 7E+0 -> 1
-ddctm128 comparetotmag 8.0 70E-1 -> 1
-ddctm129 comparetotmag 8 0.7E+1 -> 1
-ddctm130 comparetotmag 8 70E-1 -> 1
-
-ddctm140 comparetotmag 8.0 9.0 -> -1
-ddctm141 comparetotmag 8.0 9 -> -1
-ddctm142 comparetotmag 8 9.0 -> -1
-ddctm143 comparetotmag 8E+0 9.0 -> -1
-ddctm144 comparetotmag 80E-1 9.0 -> -1
-ddctm145 comparetotmag 0.8E+1 9 -> -1
-ddctm146 comparetotmag 80E-1 9 -> -1
-ddctm147 comparetotmag 8.0 9E+0 -> -1
-ddctm148 comparetotmag 8.0 90E-1 -> -1
-ddctm149 comparetotmag 8 0.9E+1 -> -1
-ddctm150 comparetotmag 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-ddctm200 comparetotmag -7.0 7.0 -> 0
-ddctm201 comparetotmag -7.0 7 -> -1
-ddctm202 comparetotmag -7 7.0 -> 1
-ddctm203 comparetotmag -7E+0 7.0 -> 1
-ddctm204 comparetotmag -70E-1 7.0 -> 0
-ddctm205 comparetotmag -0.7E+1 7 -> 0
-ddctm206 comparetotmag -70E-1 7 -> -1
-ddctm207 comparetotmag -7.0 7E+0 -> -1
-ddctm208 comparetotmag -7.0 70E-1 -> 0
-ddctm209 comparetotmag -7 0.7E+1 -> 0
-ddctm210 comparetotmag -7 70E-1 -> 1
-
-ddctm220 comparetotmag -8.0 7.0 -> 1
-ddctm221 comparetotmag -8.0 7 -> 1
-ddctm222 comparetotmag -8 7.0 -> 1
-ddctm223 comparetotmag -8E+0 7.0 -> 1
-ddctm224 comparetotmag -80E-1 7.0 -> 1
-ddctm225 comparetotmag -0.8E+1 7 -> 1
-ddctm226 comparetotmag -80E-1 7 -> 1
-ddctm227 comparetotmag -8.0 7E+0 -> 1
-ddctm228 comparetotmag -8.0 70E-1 -> 1
-ddctm229 comparetotmag -8 0.7E+1 -> 1
-ddctm230 comparetotmag -8 70E-1 -> 1
-
-ddctm240 comparetotmag -8.0 9.0 -> -1
-ddctm241 comparetotmag -8.0 9 -> -1
-ddctm242 comparetotmag -8 9.0 -> -1
-ddctm243 comparetotmag -8E+0 9.0 -> -1
-ddctm244 comparetotmag -80E-1 9.0 -> -1
-ddctm245 comparetotmag -0.8E+1 9 -> -1
-ddctm246 comparetotmag -80E-1 9 -> -1
-ddctm247 comparetotmag -8.0 9E+0 -> -1
-ddctm248 comparetotmag -8.0 90E-1 -> -1
-ddctm249 comparetotmag -8 0.9E+1 -> -1
-ddctm250 comparetotmag -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-ddctm300 comparetotmag 7.0 -7.0 -> 0
-ddctm301 comparetotmag 7.0 -7 -> -1
-ddctm302 comparetotmag 7 -7.0 -> 1
-ddctm303 comparetotmag 7E+0 -7.0 -> 1
-ddctm304 comparetotmag 70E-1 -7.0 -> 0
-ddctm305 comparetotmag .7E+1 -7 -> 0
-ddctm306 comparetotmag 70E-1 -7 -> -1
-ddctm307 comparetotmag 7.0 -7E+0 -> -1
-ddctm308 comparetotmag 7.0 -70E-1 -> 0
-ddctm309 comparetotmag 7 -.7E+1 -> 0
-ddctm310 comparetotmag 7 -70E-1 -> 1
-
-ddctm320 comparetotmag 8.0 -7.0 -> 1
-ddctm321 comparetotmag 8.0 -7 -> 1
-ddctm322 comparetotmag 8 -7.0 -> 1
-ddctm323 comparetotmag 8E+0 -7.0 -> 1
-ddctm324 comparetotmag 80E-1 -7.0 -> 1
-ddctm325 comparetotmag .8E+1 -7 -> 1
-ddctm326 comparetotmag 80E-1 -7 -> 1
-ddctm327 comparetotmag 8.0 -7E+0 -> 1
-ddctm328 comparetotmag 8.0 -70E-1 -> 1
-ddctm329 comparetotmag 8 -.7E+1 -> 1
-ddctm330 comparetotmag 8 -70E-1 -> 1
-
-ddctm340 comparetotmag 8.0 -9.0 -> -1
-ddctm341 comparetotmag 8.0 -9 -> -1
-ddctm342 comparetotmag 8 -9.0 -> -1
-ddctm343 comparetotmag 8E+0 -9.0 -> -1
-ddctm344 comparetotmag 80E-1 -9.0 -> -1
-ddctm345 comparetotmag .8E+1 -9 -> -1
-ddctm346 comparetotmag 80E-1 -9 -> -1
-ddctm347 comparetotmag 8.0 -9E+0 -> -1
-ddctm348 comparetotmag 8.0 -90E-1 -> -1
-ddctm349 comparetotmag 8 -.9E+1 -> -1
-ddctm350 comparetotmag 8 -90E-1 -> -1
-
--- and again, with sign changes -- ..
-ddctm400 comparetotmag -7.0 -7.0 -> 0
-ddctm401 comparetotmag -7.0 -7 -> -1
-ddctm402 comparetotmag -7 -7.0 -> 1
-ddctm403 comparetotmag -7E+0 -7.0 -> 1
-ddctm404 comparetotmag -70E-1 -7.0 -> 0
-ddctm405 comparetotmag -.7E+1 -7 -> 0
-ddctm406 comparetotmag -70E-1 -7 -> -1
-ddctm407 comparetotmag -7.0 -7E+0 -> -1
-ddctm408 comparetotmag -7.0 -70E-1 -> 0
-ddctm409 comparetotmag -7 -.7E+1 -> 0
-ddctm410 comparetotmag -7 -70E-1 -> 1
-
-ddctm420 comparetotmag -8.0 -7.0 -> 1
-ddctm421 comparetotmag -8.0 -7 -> 1
-ddctm422 comparetotmag -8 -7.0 -> 1
-ddctm423 comparetotmag -8E+0 -7.0 -> 1
-ddctm424 comparetotmag -80E-1 -7.0 -> 1
-ddctm425 comparetotmag -.8E+1 -7 -> 1
-ddctm426 comparetotmag -80E-1 -7 -> 1
-ddctm427 comparetotmag -8.0 -7E+0 -> 1
-ddctm428 comparetotmag -8.0 -70E-1 -> 1
-ddctm429 comparetotmag -8 -.7E+1 -> 1
-ddctm430 comparetotmag -8 -70E-1 -> 1
-
-ddctm440 comparetotmag -8.0 -9.0 -> -1
-ddctm441 comparetotmag -8.0 -9 -> -1
-ddctm442 comparetotmag -8 -9.0 -> -1
-ddctm443 comparetotmag -8E+0 -9.0 -> -1
-ddctm444 comparetotmag -80E-1 -9.0 -> -1
-ddctm445 comparetotmag -.8E+1 -9 -> -1
-ddctm446 comparetotmag -80E-1 -9 -> -1
-ddctm447 comparetotmag -8.0 -9E+0 -> -1
-ddctm448 comparetotmag -8.0 -90E-1 -> -1
-ddctm449 comparetotmag -8 -.9E+1 -> -1
-ddctm450 comparetotmag -8 -90E-1 -> -1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-ddctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
-ddctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
-ddctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
-ddctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
-ddctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
-ddctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
-ddctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
-ddctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
-ddctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
-ddctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
-ddctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
-ddctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
-ddctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
-ddctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
-ddctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
-ddctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
-ddctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
-ddctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
-ddctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
-ddctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
-ddctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
-ddctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-ddctm498 comparetotmag 1 1E-17 -> 1
-ddctm499 comparetotmag 1 1E-16 -> 1
-ddctm500 comparetotmag 1 1E-15 -> 1
-ddctm501 comparetotmag 1 1E-14 -> 1
-ddctm502 comparetotmag 1 1E-13 -> 1
-ddctm503 comparetotmag 1 1E-12 -> 1
-ddctm504 comparetotmag 1 1E-11 -> 1
-ddctm505 comparetotmag 1 1E-10 -> 1
-ddctm506 comparetotmag 1 1E-9 -> 1
-ddctm507 comparetotmag 1 1E-8 -> 1
-ddctm508 comparetotmag 1 1E-7 -> 1
-ddctm509 comparetotmag 1 1E-6 -> 1
-ddctm510 comparetotmag 1 1E-5 -> 1
-ddctm511 comparetotmag 1 1E-4 -> 1
-ddctm512 comparetotmag 1 1E-3 -> 1
-ddctm513 comparetotmag 1 1E-2 -> 1
-ddctm514 comparetotmag 1 1E-1 -> 1
-ddctm515 comparetotmag 1 1E-0 -> 0
-ddctm516 comparetotmag 1 1E+1 -> -1
-ddctm517 comparetotmag 1 1E+2 -> -1
-ddctm518 comparetotmag 1 1E+3 -> -1
-ddctm519 comparetotmag 1 1E+4 -> -1
-ddctm521 comparetotmag 1 1E+5 -> -1
-ddctm522 comparetotmag 1 1E+6 -> -1
-ddctm523 comparetotmag 1 1E+7 -> -1
-ddctm524 comparetotmag 1 1E+8 -> -1
-ddctm525 comparetotmag 1 1E+9 -> -1
-ddctm526 comparetotmag 1 1E+10 -> -1
-ddctm527 comparetotmag 1 1E+11 -> -1
-ddctm528 comparetotmag 1 1E+12 -> -1
-ddctm529 comparetotmag 1 1E+13 -> -1
-ddctm530 comparetotmag 1 1E+14 -> -1
-ddctm531 comparetotmag 1 1E+15 -> -1
-ddctm532 comparetotmag 1 1E+16 -> -1
-ddctm533 comparetotmag 1 1E+17 -> -1
--- LR swap
-ddctm538 comparetotmag 1E-17 1 -> -1
-ddctm539 comparetotmag 1E-16 1 -> -1
-ddctm540 comparetotmag 1E-15 1 -> -1
-ddctm541 comparetotmag 1E-14 1 -> -1
-ddctm542 comparetotmag 1E-13 1 -> -1
-ddctm543 comparetotmag 1E-12 1 -> -1
-ddctm544 comparetotmag 1E-11 1 -> -1
-ddctm545 comparetotmag 1E-10 1 -> -1
-ddctm546 comparetotmag 1E-9 1 -> -1
-ddctm547 comparetotmag 1E-8 1 -> -1
-ddctm548 comparetotmag 1E-7 1 -> -1
-ddctm549 comparetotmag 1E-6 1 -> -1
-ddctm550 comparetotmag 1E-5 1 -> -1
-ddctm551 comparetotmag 1E-4 1 -> -1
-ddctm552 comparetotmag 1E-3 1 -> -1
-ddctm553 comparetotmag 1E-2 1 -> -1
-ddctm554 comparetotmag 1E-1 1 -> -1
-ddctm555 comparetotmag 1E-0 1 -> 0
-ddctm556 comparetotmag 1E+1 1 -> 1
-ddctm557 comparetotmag 1E+2 1 -> 1
-ddctm558 comparetotmag 1E+3 1 -> 1
-ddctm559 comparetotmag 1E+4 1 -> 1
-ddctm561 comparetotmag 1E+5 1 -> 1
-ddctm562 comparetotmag 1E+6 1 -> 1
-ddctm563 comparetotmag 1E+7 1 -> 1
-ddctm564 comparetotmag 1E+8 1 -> 1
-ddctm565 comparetotmag 1E+9 1 -> 1
-ddctm566 comparetotmag 1E+10 1 -> 1
-ddctm567 comparetotmag 1E+11 1 -> 1
-ddctm568 comparetotmag 1E+12 1 -> 1
-ddctm569 comparetotmag 1E+13 1 -> 1
-ddctm570 comparetotmag 1E+14 1 -> 1
-ddctm571 comparetotmag 1E+15 1 -> 1
-ddctm572 comparetotmag 1E+16 1 -> 1
-ddctm573 comparetotmag 1E+17 1 -> 1
--- similar with a useful coefficient, one side only
-ddctm578 comparetotmag 0.000000987654321 1E-17 -> 1
-ddctm579 comparetotmag 0.000000987654321 1E-16 -> 1
-ddctm580 comparetotmag 0.000000987654321 1E-15 -> 1
-ddctm581 comparetotmag 0.000000987654321 1E-14 -> 1
-ddctm582 comparetotmag 0.000000987654321 1E-13 -> 1
-ddctm583 comparetotmag 0.000000987654321 1E-12 -> 1
-ddctm584 comparetotmag 0.000000987654321 1E-11 -> 1
-ddctm585 comparetotmag 0.000000987654321 1E-10 -> 1
-ddctm586 comparetotmag 0.000000987654321 1E-9 -> 1
-ddctm587 comparetotmag 0.000000987654321 1E-8 -> 1
-ddctm588 comparetotmag 0.000000987654321 1E-7 -> 1
-ddctm589 comparetotmag 0.000000987654321 1E-6 -> -1
-ddctm590 comparetotmag 0.000000987654321 1E-5 -> -1
-ddctm591 comparetotmag 0.000000987654321 1E-4 -> -1
-ddctm592 comparetotmag 0.000000987654321 1E-3 -> -1
-ddctm593 comparetotmag 0.000000987654321 1E-2 -> -1
-ddctm594 comparetotmag 0.000000987654321 1E-1 -> -1
-ddctm595 comparetotmag 0.000000987654321 1E-0 -> -1
-ddctm596 comparetotmag 0.000000987654321 1E+1 -> -1
-ddctm597 comparetotmag 0.000000987654321 1E+2 -> -1
-ddctm598 comparetotmag 0.000000987654321 1E+3 -> -1
-ddctm599 comparetotmag 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-ddctm600 comparetotmag 12 12.2345 -> -1
-ddctm601 comparetotmag 12.0 12.2345 -> -1
-ddctm602 comparetotmag 12.00 12.2345 -> -1
-ddctm603 comparetotmag 12.000 12.2345 -> -1
-ddctm604 comparetotmag 12.0000 12.2345 -> -1
-ddctm605 comparetotmag 12.00000 12.2345 -> -1
-ddctm606 comparetotmag 12.000000 12.2345 -> -1
-ddctm607 comparetotmag 12.0000000 12.2345 -> -1
-ddctm608 comparetotmag 12.00000000 12.2345 -> -1
-ddctm609 comparetotmag 12.000000000 12.2345 -> -1
-ddctm610 comparetotmag 12.1234 12 -> 1
-ddctm611 comparetotmag 12.1234 12.0 -> 1
-ddctm612 comparetotmag 12.1234 12.00 -> 1
-ddctm613 comparetotmag 12.1234 12.000 -> 1
-ddctm614 comparetotmag 12.1234 12.0000 -> 1
-ddctm615 comparetotmag 12.1234 12.00000 -> 1
-ddctm616 comparetotmag 12.1234 12.000000 -> 1
-ddctm617 comparetotmag 12.1234 12.0000000 -> 1
-ddctm618 comparetotmag 12.1234 12.00000000 -> 1
-ddctm619 comparetotmag 12.1234 12.000000000 -> 1
-ddctm620 comparetotmag -12 -12.2345 -> -1
-ddctm621 comparetotmag -12.0 -12.2345 -> -1
-ddctm622 comparetotmag -12.00 -12.2345 -> -1
-ddctm623 comparetotmag -12.000 -12.2345 -> -1
-ddctm624 comparetotmag -12.0000 -12.2345 -> -1
-ddctm625 comparetotmag -12.00000 -12.2345 -> -1
-ddctm626 comparetotmag -12.000000 -12.2345 -> -1
-ddctm627 comparetotmag -12.0000000 -12.2345 -> -1
-ddctm628 comparetotmag -12.00000000 -12.2345 -> -1
-ddctm629 comparetotmag -12.000000000 -12.2345 -> -1
-ddctm630 comparetotmag -12.1234 -12 -> 1
-ddctm631 comparetotmag -12.1234 -12.0 -> 1
-ddctm632 comparetotmag -12.1234 -12.00 -> 1
-ddctm633 comparetotmag -12.1234 -12.000 -> 1
-ddctm634 comparetotmag -12.1234 -12.0000 -> 1
-ddctm635 comparetotmag -12.1234 -12.00000 -> 1
-ddctm636 comparetotmag -12.1234 -12.000000 -> 1
-ddctm637 comparetotmag -12.1234 -12.0000000 -> 1
-ddctm638 comparetotmag -12.1234 -12.00000000 -> 1
-ddctm639 comparetotmag -12.1234 -12.000000000 -> 1
-
--- extended zeros
-ddctm640 comparetotmag 0 0 -> 0
-ddctm641 comparetotmag 0 -0 -> 0
-ddctm642 comparetotmag 0 -0.0 -> 1
-ddctm643 comparetotmag 0 0.0 -> 1
-ddctm644 comparetotmag -0 0 -> 0
-ddctm645 comparetotmag -0 -0 -> 0
-ddctm646 comparetotmag -0 -0.0 -> 1
-ddctm647 comparetotmag -0 0.0 -> 1
-ddctm648 comparetotmag 0.0 0 -> -1
-ddctm649 comparetotmag 0.0 -0 -> -1
-ddctm650 comparetotmag 0.0 -0.0 -> 0
-ddctm651 comparetotmag 0.0 0.0 -> 0
-ddctm652 comparetotmag -0.0 0 -> -1
-ddctm653 comparetotmag -0.0 -0 -> -1
-ddctm654 comparetotmag -0.0 -0.0 -> 0
-ddctm655 comparetotmag -0.0 0.0 -> 0
-
-ddctm656 comparetotmag -0E1 0.0 -> 1
-ddctm657 comparetotmag -0E2 0.0 -> 1
-ddctm658 comparetotmag 0E1 0.0 -> 1
-ddctm659 comparetotmag 0E2 0.0 -> 1
-ddctm660 comparetotmag -0E1 0 -> 1
-ddctm661 comparetotmag -0E2 0 -> 1
-ddctm662 comparetotmag 0E1 0 -> 1
-ddctm663 comparetotmag 0E2 0 -> 1
-ddctm664 comparetotmag -0E1 -0E1 -> 0
-ddctm665 comparetotmag -0E2 -0E1 -> 1
-ddctm666 comparetotmag 0E1 -0E1 -> 0
-ddctm667 comparetotmag 0E2 -0E1 -> 1
-ddctm668 comparetotmag -0E1 -0E2 -> -1
-ddctm669 comparetotmag -0E2 -0E2 -> 0
-ddctm670 comparetotmag 0E1 -0E2 -> -1
-ddctm671 comparetotmag 0E2 -0E2 -> 0
-ddctm672 comparetotmag -0E1 0E1 -> 0
-ddctm673 comparetotmag -0E2 0E1 -> 1
-ddctm674 comparetotmag 0E1 0E1 -> 0
-ddctm675 comparetotmag 0E2 0E1 -> 1
-ddctm676 comparetotmag -0E1 0E2 -> -1
-ddctm677 comparetotmag -0E2 0E2 -> 0
-ddctm678 comparetotmag 0E1 0E2 -> -1
-ddctm679 comparetotmag 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-ddctm680 comparetotmag 12 12 -> 0
-ddctm681 comparetotmag 12 12.0 -> 1
-ddctm682 comparetotmag 12 12.00 -> 1
-ddctm683 comparetotmag 12 12.000 -> 1
-ddctm684 comparetotmag 12 12.0000 -> 1
-ddctm685 comparetotmag 12 12.00000 -> 1
-ddctm686 comparetotmag 12 12.000000 -> 1
-ddctm687 comparetotmag 12 12.0000000 -> 1
-ddctm688 comparetotmag 12 12.00000000 -> 1
-ddctm689 comparetotmag 12 12.000000000 -> 1
-ddctm690 comparetotmag 12 12 -> 0
-ddctm691 comparetotmag 12.0 12 -> -1
-ddctm692 comparetotmag 12.00 12 -> -1
-ddctm693 comparetotmag 12.000 12 -> -1
-ddctm694 comparetotmag 12.0000 12 -> -1
-ddctm695 comparetotmag 12.00000 12 -> -1
-ddctm696 comparetotmag 12.000000 12 -> -1
-ddctm697 comparetotmag 12.0000000 12 -> -1
-ddctm698 comparetotmag 12.00000000 12 -> -1
-ddctm699 comparetotmag 12.000000000 12 -> -1
-
--- old long operand checks
-ddctm701 comparetotmag 12345678000 1 -> 1
-ddctm702 comparetotmag 1 12345678000 -> -1
-ddctm703 comparetotmag 1234567800 1 -> 1
-ddctm704 comparetotmag 1 1234567800 -> -1
-ddctm705 comparetotmag 1234567890 1 -> 1
-ddctm706 comparetotmag 1 1234567890 -> -1
-ddctm707 comparetotmag 1234567891 1 -> 1
-ddctm708 comparetotmag 1 1234567891 -> -1
-ddctm709 comparetotmag 12345678901 1 -> 1
-ddctm710 comparetotmag 1 12345678901 -> -1
-ddctm711 comparetotmag 1234567896 1 -> 1
-ddctm712 comparetotmag 1 1234567896 -> -1
-ddctm713 comparetotmag -1234567891 1 -> 1
-ddctm714 comparetotmag 1 -1234567891 -> -1
-ddctm715 comparetotmag -12345678901 1 -> 1
-ddctm716 comparetotmag 1 -12345678901 -> -1
-ddctm717 comparetotmag -1234567896 1 -> 1
-ddctm718 comparetotmag 1 -1234567896 -> -1
-
--- old residue cases
-ddctm740 comparetotmag 1 0.9999999 -> 1
-ddctm741 comparetotmag 1 0.999999 -> 1
-ddctm742 comparetotmag 1 0.99999 -> 1
-ddctm743 comparetotmag 1 1.0000 -> 1
-ddctm744 comparetotmag 1 1.00001 -> -1
-ddctm745 comparetotmag 1 1.000001 -> -1
-ddctm746 comparetotmag 1 1.0000001 -> -1
-ddctm750 comparetotmag 0.9999999 1 -> -1
-ddctm751 comparetotmag 0.999999 1 -> -1
-ddctm752 comparetotmag 0.99999 1 -> -1
-ddctm753 comparetotmag 1.0000 1 -> -1
-ddctm754 comparetotmag 1.00001 1 -> 1
-ddctm755 comparetotmag 1.000001 1 -> 1
-ddctm756 comparetotmag 1.0000001 1 -> 1
-
--- Specials
-ddctm780 comparetotmag Inf -Inf -> 0
-ddctm781 comparetotmag Inf -1000 -> 1
-ddctm782 comparetotmag Inf -1 -> 1
-ddctm783 comparetotmag Inf -0 -> 1
-ddctm784 comparetotmag Inf 0 -> 1
-ddctm785 comparetotmag Inf 1 -> 1
-ddctm786 comparetotmag Inf 1000 -> 1
-ddctm787 comparetotmag Inf Inf -> 0
-ddctm788 comparetotmag -1000 Inf -> -1
-ddctm789 comparetotmag -Inf Inf -> 0
-ddctm790 comparetotmag -1 Inf -> -1
-ddctm791 comparetotmag -0 Inf -> -1
-ddctm792 comparetotmag 0 Inf -> -1
-ddctm793 comparetotmag 1 Inf -> -1
-ddctm794 comparetotmag 1000 Inf -> -1
-ddctm795 comparetotmag Inf Inf -> 0
-
-ddctm800 comparetotmag -Inf -Inf -> 0
-ddctm801 comparetotmag -Inf -1000 -> 1
-ddctm802 comparetotmag -Inf -1 -> 1
-ddctm803 comparetotmag -Inf -0 -> 1
-ddctm804 comparetotmag -Inf 0 -> 1
-ddctm805 comparetotmag -Inf 1 -> 1
-ddctm806 comparetotmag -Inf 1000 -> 1
-ddctm807 comparetotmag -Inf Inf -> 0
-ddctm808 comparetotmag -Inf -Inf -> 0
-ddctm809 comparetotmag -1000 -Inf -> -1
-ddctm810 comparetotmag -1 -Inf -> -1
-ddctm811 comparetotmag -0 -Inf -> -1
-ddctm812 comparetotmag 0 -Inf -> -1
-ddctm813 comparetotmag 1 -Inf -> -1
-ddctm814 comparetotmag 1000 -Inf -> -1
-ddctm815 comparetotmag Inf -Inf -> 0
-
-ddctm821 comparetotmag NaN -Inf -> 1
-ddctm822 comparetotmag NaN -1000 -> 1
-ddctm823 comparetotmag NaN -1 -> 1
-ddctm824 comparetotmag NaN -0 -> 1
-ddctm825 comparetotmag NaN 0 -> 1
-ddctm826 comparetotmag NaN 1 -> 1
-ddctm827 comparetotmag NaN 1000 -> 1
-ddctm828 comparetotmag NaN Inf -> 1
-ddctm829 comparetotmag NaN NaN -> 0
-ddctm830 comparetotmag -Inf NaN -> -1
-ddctm831 comparetotmag -1000 NaN -> -1
-ddctm832 comparetotmag -1 NaN -> -1
-ddctm833 comparetotmag -0 NaN -> -1
-ddctm834 comparetotmag 0 NaN -> -1
-ddctm835 comparetotmag 1 NaN -> -1
-ddctm836 comparetotmag 1000 NaN -> -1
-ddctm837 comparetotmag Inf NaN -> -1
-ddctm838 comparetotmag -NaN -NaN -> 0
-ddctm839 comparetotmag +NaN -NaN -> 0
-ddctm840 comparetotmag -NaN +NaN -> 0
-
-ddctm841 comparetotmag sNaN -sNaN -> 0
-ddctm842 comparetotmag sNaN -NaN -> -1
-ddctm843 comparetotmag sNaN -Inf -> 1
-ddctm844 comparetotmag sNaN -1000 -> 1
-ddctm845 comparetotmag sNaN -1 -> 1
-ddctm846 comparetotmag sNaN -0 -> 1
-ddctm847 comparetotmag sNaN 0 -> 1
-ddctm848 comparetotmag sNaN 1 -> 1
-ddctm849 comparetotmag sNaN 1000 -> 1
-ddctm850 comparetotmag sNaN NaN -> -1
-ddctm851 comparetotmag sNaN sNaN -> 0
-
-ddctm852 comparetotmag -sNaN sNaN -> 0
-ddctm853 comparetotmag -NaN sNaN -> 1
-ddctm854 comparetotmag -Inf sNaN -> -1
-ddctm855 comparetotmag -1000 sNaN -> -1
-ddctm856 comparetotmag -1 sNaN -> -1
-ddctm857 comparetotmag -0 sNaN -> -1
-ddctm858 comparetotmag 0 sNaN -> -1
-ddctm859 comparetotmag 1 sNaN -> -1
-ddctm860 comparetotmag 1000 sNaN -> -1
-ddctm861 comparetotmag Inf sNaN -> -1
-ddctm862 comparetotmag NaN sNaN -> 1
-ddctm863 comparetotmag sNaN sNaN -> 0
-
-ddctm871 comparetotmag -sNaN -sNaN -> 0
-ddctm872 comparetotmag -sNaN -NaN -> -1
-ddctm873 comparetotmag -sNaN -Inf -> 1
-ddctm874 comparetotmag -sNaN -1000 -> 1
-ddctm875 comparetotmag -sNaN -1 -> 1
-ddctm876 comparetotmag -sNaN -0 -> 1
-ddctm877 comparetotmag -sNaN 0 -> 1
-ddctm878 comparetotmag -sNaN 1 -> 1
-ddctm879 comparetotmag -sNaN 1000 -> 1
-ddctm880 comparetotmag -sNaN NaN -> -1
-ddctm881 comparetotmag -sNaN sNaN -> 0
-
-ddctm882 comparetotmag -sNaN -sNaN -> 0
-ddctm883 comparetotmag -NaN -sNaN -> 1
-ddctm884 comparetotmag -Inf -sNaN -> -1
-ddctm885 comparetotmag -1000 -sNaN -> -1
-ddctm886 comparetotmag -1 -sNaN -> -1
-ddctm887 comparetotmag -0 -sNaN -> -1
-ddctm888 comparetotmag 0 -sNaN -> -1
-ddctm889 comparetotmag 1 -sNaN -> -1
-ddctm890 comparetotmag 1000 -sNaN -> -1
-ddctm891 comparetotmag Inf -sNaN -> -1
-ddctm892 comparetotmag NaN -sNaN -> 1
-ddctm893 comparetotmag sNaN -sNaN -> 0
-
--- NaNs with payload
-ddctm960 comparetotmag NaN9 -Inf -> 1
-ddctm961 comparetotmag NaN8 999 -> 1
-ddctm962 comparetotmag NaN77 Inf -> 1
-ddctm963 comparetotmag -NaN67 NaN5 -> 1
-ddctm964 comparetotmag -Inf -NaN4 -> -1
-ddctm965 comparetotmag -999 -NaN33 -> -1
-ddctm966 comparetotmag Inf NaN2 -> -1
-
-ddctm970 comparetotmag -NaN41 -NaN42 -> -1
-ddctm971 comparetotmag +NaN41 -NaN42 -> -1
-ddctm972 comparetotmag -NaN41 +NaN42 -> -1
-ddctm973 comparetotmag +NaN41 +NaN42 -> -1
-ddctm974 comparetotmag -NaN42 -NaN01 -> 1
-ddctm975 comparetotmag +NaN42 -NaN01 -> 1
-ddctm976 comparetotmag -NaN42 +NaN01 -> 1
-ddctm977 comparetotmag +NaN42 +NaN01 -> 1
-
-ddctm980 comparetotmag -sNaN771 -sNaN772 -> -1
-ddctm981 comparetotmag +sNaN771 -sNaN772 -> -1
-ddctm982 comparetotmag -sNaN771 +sNaN772 -> -1
-ddctm983 comparetotmag +sNaN771 +sNaN772 -> -1
-ddctm984 comparetotmag -sNaN772 -sNaN771 -> 1
-ddctm985 comparetotmag +sNaN772 -sNaN771 -> 1
-ddctm986 comparetotmag -sNaN772 +sNaN771 -> 1
-ddctm987 comparetotmag +sNaN772 +sNaN771 -> 1
-
-ddctm991 comparetotmag -sNaN99 -Inf -> 1
-ddctm992 comparetotmag sNaN98 -11 -> 1
-ddctm993 comparetotmag sNaN97 NaN -> -1
-ddctm994 comparetotmag sNaN16 sNaN94 -> -1
-ddctm995 comparetotmag NaN85 sNaN83 -> 1
-ddctm996 comparetotmag -Inf sNaN92 -> -1
-ddctm997 comparetotmag 088 sNaN81 -> -1
-ddctm998 comparetotmag Inf sNaN90 -> -1
-ddctm999 comparetotmag NaN -sNaN89 -> 1
-
--- spread zeros
-ddctm1110 comparetotmag 0E-383 0 -> -1
-ddctm1111 comparetotmag 0E-383 -0 -> -1
-ddctm1112 comparetotmag -0E-383 0 -> -1
-ddctm1113 comparetotmag -0E-383 -0 -> -1
-ddctm1114 comparetotmag 0E-383 0E+384 -> -1
-ddctm1115 comparetotmag 0E-383 -0E+384 -> -1
-ddctm1116 comparetotmag -0E-383 0E+384 -> -1
-ddctm1117 comparetotmag -0E-383 -0E+384 -> -1
-ddctm1118 comparetotmag 0 0E+384 -> -1
-ddctm1119 comparetotmag 0 -0E+384 -> -1
-ddctm1120 comparetotmag -0 0E+384 -> -1
-ddctm1121 comparetotmag -0 -0E+384 -> -1
-
-ddctm1130 comparetotmag 0E+384 0 -> 1
-ddctm1131 comparetotmag 0E+384 -0 -> 1
-ddctm1132 comparetotmag -0E+384 0 -> 1
-ddctm1133 comparetotmag -0E+384 -0 -> 1
-ddctm1134 comparetotmag 0E+384 0E-383 -> 1
-ddctm1135 comparetotmag 0E+384 -0E-383 -> 1
-ddctm1136 comparetotmag -0E+384 0E-383 -> 1
-ddctm1137 comparetotmag -0E+384 -0E-383 -> 1
-ddctm1138 comparetotmag 0 0E-383 -> 1
-ddctm1139 comparetotmag 0 -0E-383 -> 1
-ddctm1140 comparetotmag -0 0E-383 -> 1
-ddctm1141 comparetotmag -0 -0E-383 -> 1
-
--- Null tests
-ddctm9990 comparetotmag 10 # -> NaN Invalid_operation
-ddctm9991 comparetotmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddCompareTotalMag.decTest -- decDouble comparison; abs. total order--
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddctm001 comparetotmag -2 -2 -> 0
+ddctm002 comparetotmag -2 -1 -> 1
+ddctm003 comparetotmag -2 0 -> 1
+ddctm004 comparetotmag -2 1 -> 1
+ddctm005 comparetotmag -2 2 -> 0
+ddctm006 comparetotmag -1 -2 -> -1
+ddctm007 comparetotmag -1 -1 -> 0
+ddctm008 comparetotmag -1 0 -> 1
+ddctm009 comparetotmag -1 1 -> 0
+ddctm010 comparetotmag -1 2 -> -1
+ddctm011 comparetotmag 0 -2 -> -1
+ddctm012 comparetotmag 0 -1 -> -1
+ddctm013 comparetotmag 0 0 -> 0
+ddctm014 comparetotmag 0 1 -> -1
+ddctm015 comparetotmag 0 2 -> -1
+ddctm016 comparetotmag 1 -2 -> -1
+ddctm017 comparetotmag 1 -1 -> 0
+ddctm018 comparetotmag 1 0 -> 1
+ddctm019 comparetotmag 1 1 -> 0
+ddctm020 comparetotmag 1 2 -> -1
+ddctm021 comparetotmag 2 -2 -> 0
+ddctm022 comparetotmag 2 -1 -> 1
+ddctm023 comparetotmag 2 0 -> 1
+ddctm025 comparetotmag 2 1 -> 1
+ddctm026 comparetotmag 2 2 -> 0
+
+ddctm031 comparetotmag -20 -20 -> 0
+ddctm032 comparetotmag -20 -10 -> 1
+ddctm033 comparetotmag -20 00 -> 1
+ddctm034 comparetotmag -20 10 -> 1
+ddctm035 comparetotmag -20 20 -> 0
+ddctm036 comparetotmag -10 -20 -> -1
+ddctm037 comparetotmag -10 -10 -> 0
+ddctm038 comparetotmag -10 00 -> 1
+ddctm039 comparetotmag -10 10 -> 0
+ddctm040 comparetotmag -10 20 -> -1
+ddctm041 comparetotmag 00 -20 -> -1
+ddctm042 comparetotmag 00 -10 -> -1
+ddctm043 comparetotmag 00 00 -> 0
+ddctm044 comparetotmag 00 10 -> -1
+ddctm045 comparetotmag 00 20 -> -1
+ddctm046 comparetotmag 10 -20 -> -1
+ddctm047 comparetotmag 10 -10 -> 0
+ddctm048 comparetotmag 10 00 -> 1
+ddctm049 comparetotmag 10 10 -> 0
+ddctm050 comparetotmag 10 20 -> -1
+ddctm051 comparetotmag 20 -20 -> 0
+ddctm052 comparetotmag 20 -10 -> 1
+ddctm053 comparetotmag 20 00 -> 1
+ddctm055 comparetotmag 20 10 -> 1
+ddctm056 comparetotmag 20 20 -> 0
+
+ddctm061 comparetotmag -2.0 -2.0 -> 0
+ddctm062 comparetotmag -2.0 -1.0 -> 1
+ddctm063 comparetotmag -2.0 0.0 -> 1
+ddctm064 comparetotmag -2.0 1.0 -> 1
+ddctm065 comparetotmag -2.0 2.0 -> 0
+ddctm066 comparetotmag -1.0 -2.0 -> -1
+ddctm067 comparetotmag -1.0 -1.0 -> 0
+ddctm068 comparetotmag -1.0 0.0 -> 1
+ddctm069 comparetotmag -1.0 1.0 -> 0
+ddctm070 comparetotmag -1.0 2.0 -> -1
+ddctm071 comparetotmag 0.0 -2.0 -> -1
+ddctm072 comparetotmag 0.0 -1.0 -> -1
+ddctm073 comparetotmag 0.0 0.0 -> 0
+ddctm074 comparetotmag 0.0 1.0 -> -1
+ddctm075 comparetotmag 0.0 2.0 -> -1
+ddctm076 comparetotmag 1.0 -2.0 -> -1
+ddctm077 comparetotmag 1.0 -1.0 -> 0
+ddctm078 comparetotmag 1.0 0.0 -> 1
+ddctm079 comparetotmag 1.0 1.0 -> 0
+ddctm080 comparetotmag 1.0 2.0 -> -1
+ddctm081 comparetotmag 2.0 -2.0 -> 0
+ddctm082 comparetotmag 2.0 -1.0 -> 1
+ddctm083 comparetotmag 2.0 0.0 -> 1
+ddctm085 comparetotmag 2.0 1.0 -> 1
+ddctm086 comparetotmag 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+ddctm090 comparetotmag 9.99999999E+384 9.99999999E+384 -> 0
+ddctm091 comparetotmag -9.99999999E+384 9.99999999E+384 -> 0
+ddctm092 comparetotmag 9.99999999E+384 -9.99999999E+384 -> 0
+ddctm093 comparetotmag -9.99999999E+384 -9.99999999E+384 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+ddctm100 comparetotmag 7.0 7.0 -> 0
+ddctm101 comparetotmag 7.0 7 -> -1
+ddctm102 comparetotmag 7 7.0 -> 1
+ddctm103 comparetotmag 7E+0 7.0 -> 1
+ddctm104 comparetotmag 70E-1 7.0 -> 0
+ddctm105 comparetotmag 0.7E+1 7 -> 0
+ddctm106 comparetotmag 70E-1 7 -> -1
+ddctm107 comparetotmag 7.0 7E+0 -> -1
+ddctm108 comparetotmag 7.0 70E-1 -> 0
+ddctm109 comparetotmag 7 0.7E+1 -> 0
+ddctm110 comparetotmag 7 70E-1 -> 1
+
+ddctm120 comparetotmag 8.0 7.0 -> 1
+ddctm121 comparetotmag 8.0 7 -> 1
+ddctm122 comparetotmag 8 7.0 -> 1
+ddctm123 comparetotmag 8E+0 7.0 -> 1
+ddctm124 comparetotmag 80E-1 7.0 -> 1
+ddctm125 comparetotmag 0.8E+1 7 -> 1
+ddctm126 comparetotmag 80E-1 7 -> 1
+ddctm127 comparetotmag 8.0 7E+0 -> 1
+ddctm128 comparetotmag 8.0 70E-1 -> 1
+ddctm129 comparetotmag 8 0.7E+1 -> 1
+ddctm130 comparetotmag 8 70E-1 -> 1
+
+ddctm140 comparetotmag 8.0 9.0 -> -1
+ddctm141 comparetotmag 8.0 9 -> -1
+ddctm142 comparetotmag 8 9.0 -> -1
+ddctm143 comparetotmag 8E+0 9.0 -> -1
+ddctm144 comparetotmag 80E-1 9.0 -> -1
+ddctm145 comparetotmag 0.8E+1 9 -> -1
+ddctm146 comparetotmag 80E-1 9 -> -1
+ddctm147 comparetotmag 8.0 9E+0 -> -1
+ddctm148 comparetotmag 8.0 90E-1 -> -1
+ddctm149 comparetotmag 8 0.9E+1 -> -1
+ddctm150 comparetotmag 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+ddctm200 comparetotmag -7.0 7.0 -> 0
+ddctm201 comparetotmag -7.0 7 -> -1
+ddctm202 comparetotmag -7 7.0 -> 1
+ddctm203 comparetotmag -7E+0 7.0 -> 1
+ddctm204 comparetotmag -70E-1 7.0 -> 0
+ddctm205 comparetotmag -0.7E+1 7 -> 0
+ddctm206 comparetotmag -70E-1 7 -> -1
+ddctm207 comparetotmag -7.0 7E+0 -> -1
+ddctm208 comparetotmag -7.0 70E-1 -> 0
+ddctm209 comparetotmag -7 0.7E+1 -> 0
+ddctm210 comparetotmag -7 70E-1 -> 1
+
+ddctm220 comparetotmag -8.0 7.0 -> 1
+ddctm221 comparetotmag -8.0 7 -> 1
+ddctm222 comparetotmag -8 7.0 -> 1
+ddctm223 comparetotmag -8E+0 7.0 -> 1
+ddctm224 comparetotmag -80E-1 7.0 -> 1
+ddctm225 comparetotmag -0.8E+1 7 -> 1
+ddctm226 comparetotmag -80E-1 7 -> 1
+ddctm227 comparetotmag -8.0 7E+0 -> 1
+ddctm228 comparetotmag -8.0 70E-1 -> 1
+ddctm229 comparetotmag -8 0.7E+1 -> 1
+ddctm230 comparetotmag -8 70E-1 -> 1
+
+ddctm240 comparetotmag -8.0 9.0 -> -1
+ddctm241 comparetotmag -8.0 9 -> -1
+ddctm242 comparetotmag -8 9.0 -> -1
+ddctm243 comparetotmag -8E+0 9.0 -> -1
+ddctm244 comparetotmag -80E-1 9.0 -> -1
+ddctm245 comparetotmag -0.8E+1 9 -> -1
+ddctm246 comparetotmag -80E-1 9 -> -1
+ddctm247 comparetotmag -8.0 9E+0 -> -1
+ddctm248 comparetotmag -8.0 90E-1 -> -1
+ddctm249 comparetotmag -8 0.9E+1 -> -1
+ddctm250 comparetotmag -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+ddctm300 comparetotmag 7.0 -7.0 -> 0
+ddctm301 comparetotmag 7.0 -7 -> -1
+ddctm302 comparetotmag 7 -7.0 -> 1
+ddctm303 comparetotmag 7E+0 -7.0 -> 1
+ddctm304 comparetotmag 70E-1 -7.0 -> 0
+ddctm305 comparetotmag .7E+1 -7 -> 0
+ddctm306 comparetotmag 70E-1 -7 -> -1
+ddctm307 comparetotmag 7.0 -7E+0 -> -1
+ddctm308 comparetotmag 7.0 -70E-1 -> 0
+ddctm309 comparetotmag 7 -.7E+1 -> 0
+ddctm310 comparetotmag 7 -70E-1 -> 1
+
+ddctm320 comparetotmag 8.0 -7.0 -> 1
+ddctm321 comparetotmag 8.0 -7 -> 1
+ddctm322 comparetotmag 8 -7.0 -> 1
+ddctm323 comparetotmag 8E+0 -7.0 -> 1
+ddctm324 comparetotmag 80E-1 -7.0 -> 1
+ddctm325 comparetotmag .8E+1 -7 -> 1
+ddctm326 comparetotmag 80E-1 -7 -> 1
+ddctm327 comparetotmag 8.0 -7E+0 -> 1
+ddctm328 comparetotmag 8.0 -70E-1 -> 1
+ddctm329 comparetotmag 8 -.7E+1 -> 1
+ddctm330 comparetotmag 8 -70E-1 -> 1
+
+ddctm340 comparetotmag 8.0 -9.0 -> -1
+ddctm341 comparetotmag 8.0 -9 -> -1
+ddctm342 comparetotmag 8 -9.0 -> -1
+ddctm343 comparetotmag 8E+0 -9.0 -> -1
+ddctm344 comparetotmag 80E-1 -9.0 -> -1
+ddctm345 comparetotmag .8E+1 -9 -> -1
+ddctm346 comparetotmag 80E-1 -9 -> -1
+ddctm347 comparetotmag 8.0 -9E+0 -> -1
+ddctm348 comparetotmag 8.0 -90E-1 -> -1
+ddctm349 comparetotmag 8 -.9E+1 -> -1
+ddctm350 comparetotmag 8 -90E-1 -> -1
+
+-- and again, with sign changes -- ..
+ddctm400 comparetotmag -7.0 -7.0 -> 0
+ddctm401 comparetotmag -7.0 -7 -> -1
+ddctm402 comparetotmag -7 -7.0 -> 1
+ddctm403 comparetotmag -7E+0 -7.0 -> 1
+ddctm404 comparetotmag -70E-1 -7.0 -> 0
+ddctm405 comparetotmag -.7E+1 -7 -> 0
+ddctm406 comparetotmag -70E-1 -7 -> -1
+ddctm407 comparetotmag -7.0 -7E+0 -> -1
+ddctm408 comparetotmag -7.0 -70E-1 -> 0
+ddctm409 comparetotmag -7 -.7E+1 -> 0
+ddctm410 comparetotmag -7 -70E-1 -> 1
+
+ddctm420 comparetotmag -8.0 -7.0 -> 1
+ddctm421 comparetotmag -8.0 -7 -> 1
+ddctm422 comparetotmag -8 -7.0 -> 1
+ddctm423 comparetotmag -8E+0 -7.0 -> 1
+ddctm424 comparetotmag -80E-1 -7.0 -> 1
+ddctm425 comparetotmag -.8E+1 -7 -> 1
+ddctm426 comparetotmag -80E-1 -7 -> 1
+ddctm427 comparetotmag -8.0 -7E+0 -> 1
+ddctm428 comparetotmag -8.0 -70E-1 -> 1
+ddctm429 comparetotmag -8 -.7E+1 -> 1
+ddctm430 comparetotmag -8 -70E-1 -> 1
+
+ddctm440 comparetotmag -8.0 -9.0 -> -1
+ddctm441 comparetotmag -8.0 -9 -> -1
+ddctm442 comparetotmag -8 -9.0 -> -1
+ddctm443 comparetotmag -8E+0 -9.0 -> -1
+ddctm444 comparetotmag -80E-1 -9.0 -> -1
+ddctm445 comparetotmag -.8E+1 -9 -> -1
+ddctm446 comparetotmag -80E-1 -9 -> -1
+ddctm447 comparetotmag -8.0 -9E+0 -> -1
+ddctm448 comparetotmag -8.0 -90E-1 -> -1
+ddctm449 comparetotmag -8 -.9E+1 -> -1
+ddctm450 comparetotmag -8 -90E-1 -> -1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+ddctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
+ddctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
+ddctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
+ddctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
+ddctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
+ddctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
+ddctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
+ddctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
+ddctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
+ddctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
+ddctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
+ddctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
+ddctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
+ddctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
+ddctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
+ddctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
+ddctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
+ddctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
+ddctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
+ddctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
+ddctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
+ddctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+ddctm498 comparetotmag 1 1E-17 -> 1
+ddctm499 comparetotmag 1 1E-16 -> 1
+ddctm500 comparetotmag 1 1E-15 -> 1
+ddctm501 comparetotmag 1 1E-14 -> 1
+ddctm502 comparetotmag 1 1E-13 -> 1
+ddctm503 comparetotmag 1 1E-12 -> 1
+ddctm504 comparetotmag 1 1E-11 -> 1
+ddctm505 comparetotmag 1 1E-10 -> 1
+ddctm506 comparetotmag 1 1E-9 -> 1
+ddctm507 comparetotmag 1 1E-8 -> 1
+ddctm508 comparetotmag 1 1E-7 -> 1
+ddctm509 comparetotmag 1 1E-6 -> 1
+ddctm510 comparetotmag 1 1E-5 -> 1
+ddctm511 comparetotmag 1 1E-4 -> 1
+ddctm512 comparetotmag 1 1E-3 -> 1
+ddctm513 comparetotmag 1 1E-2 -> 1
+ddctm514 comparetotmag 1 1E-1 -> 1
+ddctm515 comparetotmag 1 1E-0 -> 0
+ddctm516 comparetotmag 1 1E+1 -> -1
+ddctm517 comparetotmag 1 1E+2 -> -1
+ddctm518 comparetotmag 1 1E+3 -> -1
+ddctm519 comparetotmag 1 1E+4 -> -1
+ddctm521 comparetotmag 1 1E+5 -> -1
+ddctm522 comparetotmag 1 1E+6 -> -1
+ddctm523 comparetotmag 1 1E+7 -> -1
+ddctm524 comparetotmag 1 1E+8 -> -1
+ddctm525 comparetotmag 1 1E+9 -> -1
+ddctm526 comparetotmag 1 1E+10 -> -1
+ddctm527 comparetotmag 1 1E+11 -> -1
+ddctm528 comparetotmag 1 1E+12 -> -1
+ddctm529 comparetotmag 1 1E+13 -> -1
+ddctm530 comparetotmag 1 1E+14 -> -1
+ddctm531 comparetotmag 1 1E+15 -> -1
+ddctm532 comparetotmag 1 1E+16 -> -1
+ddctm533 comparetotmag 1 1E+17 -> -1
+-- LR swap
+ddctm538 comparetotmag 1E-17 1 -> -1
+ddctm539 comparetotmag 1E-16 1 -> -1
+ddctm540 comparetotmag 1E-15 1 -> -1
+ddctm541 comparetotmag 1E-14 1 -> -1
+ddctm542 comparetotmag 1E-13 1 -> -1
+ddctm543 comparetotmag 1E-12 1 -> -1
+ddctm544 comparetotmag 1E-11 1 -> -1
+ddctm545 comparetotmag 1E-10 1 -> -1
+ddctm546 comparetotmag 1E-9 1 -> -1
+ddctm547 comparetotmag 1E-8 1 -> -1
+ddctm548 comparetotmag 1E-7 1 -> -1
+ddctm549 comparetotmag 1E-6 1 -> -1
+ddctm550 comparetotmag 1E-5 1 -> -1
+ddctm551 comparetotmag 1E-4 1 -> -1
+ddctm552 comparetotmag 1E-3 1 -> -1
+ddctm553 comparetotmag 1E-2 1 -> -1
+ddctm554 comparetotmag 1E-1 1 -> -1
+ddctm555 comparetotmag 1E-0 1 -> 0
+ddctm556 comparetotmag 1E+1 1 -> 1
+ddctm557 comparetotmag 1E+2 1 -> 1
+ddctm558 comparetotmag 1E+3 1 -> 1
+ddctm559 comparetotmag 1E+4 1 -> 1
+ddctm561 comparetotmag 1E+5 1 -> 1
+ddctm562 comparetotmag 1E+6 1 -> 1
+ddctm563 comparetotmag 1E+7 1 -> 1
+ddctm564 comparetotmag 1E+8 1 -> 1
+ddctm565 comparetotmag 1E+9 1 -> 1
+ddctm566 comparetotmag 1E+10 1 -> 1
+ddctm567 comparetotmag 1E+11 1 -> 1
+ddctm568 comparetotmag 1E+12 1 -> 1
+ddctm569 comparetotmag 1E+13 1 -> 1
+ddctm570 comparetotmag 1E+14 1 -> 1
+ddctm571 comparetotmag 1E+15 1 -> 1
+ddctm572 comparetotmag 1E+16 1 -> 1
+ddctm573 comparetotmag 1E+17 1 -> 1
+-- similar with a useful coefficient, one side only
+ddctm578 comparetotmag 0.000000987654321 1E-17 -> 1
+ddctm579 comparetotmag 0.000000987654321 1E-16 -> 1
+ddctm580 comparetotmag 0.000000987654321 1E-15 -> 1
+ddctm581 comparetotmag 0.000000987654321 1E-14 -> 1
+ddctm582 comparetotmag 0.000000987654321 1E-13 -> 1
+ddctm583 comparetotmag 0.000000987654321 1E-12 -> 1
+ddctm584 comparetotmag 0.000000987654321 1E-11 -> 1
+ddctm585 comparetotmag 0.000000987654321 1E-10 -> 1
+ddctm586 comparetotmag 0.000000987654321 1E-9 -> 1
+ddctm587 comparetotmag 0.000000987654321 1E-8 -> 1
+ddctm588 comparetotmag 0.000000987654321 1E-7 -> 1
+ddctm589 comparetotmag 0.000000987654321 1E-6 -> -1
+ddctm590 comparetotmag 0.000000987654321 1E-5 -> -1
+ddctm591 comparetotmag 0.000000987654321 1E-4 -> -1
+ddctm592 comparetotmag 0.000000987654321 1E-3 -> -1
+ddctm593 comparetotmag 0.000000987654321 1E-2 -> -1
+ddctm594 comparetotmag 0.000000987654321 1E-1 -> -1
+ddctm595 comparetotmag 0.000000987654321 1E-0 -> -1
+ddctm596 comparetotmag 0.000000987654321 1E+1 -> -1
+ddctm597 comparetotmag 0.000000987654321 1E+2 -> -1
+ddctm598 comparetotmag 0.000000987654321 1E+3 -> -1
+ddctm599 comparetotmag 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+ddctm600 comparetotmag 12 12.2345 -> -1
+ddctm601 comparetotmag 12.0 12.2345 -> -1
+ddctm602 comparetotmag 12.00 12.2345 -> -1
+ddctm603 comparetotmag 12.000 12.2345 -> -1
+ddctm604 comparetotmag 12.0000 12.2345 -> -1
+ddctm605 comparetotmag 12.00000 12.2345 -> -1
+ddctm606 comparetotmag 12.000000 12.2345 -> -1
+ddctm607 comparetotmag 12.0000000 12.2345 -> -1
+ddctm608 comparetotmag 12.00000000 12.2345 -> -1
+ddctm609 comparetotmag 12.000000000 12.2345 -> -1
+ddctm610 comparetotmag 12.1234 12 -> 1
+ddctm611 comparetotmag 12.1234 12.0 -> 1
+ddctm612 comparetotmag 12.1234 12.00 -> 1
+ddctm613 comparetotmag 12.1234 12.000 -> 1
+ddctm614 comparetotmag 12.1234 12.0000 -> 1
+ddctm615 comparetotmag 12.1234 12.00000 -> 1
+ddctm616 comparetotmag 12.1234 12.000000 -> 1
+ddctm617 comparetotmag 12.1234 12.0000000 -> 1
+ddctm618 comparetotmag 12.1234 12.00000000 -> 1
+ddctm619 comparetotmag 12.1234 12.000000000 -> 1
+ddctm620 comparetotmag -12 -12.2345 -> -1
+ddctm621 comparetotmag -12.0 -12.2345 -> -1
+ddctm622 comparetotmag -12.00 -12.2345 -> -1
+ddctm623 comparetotmag -12.000 -12.2345 -> -1
+ddctm624 comparetotmag -12.0000 -12.2345 -> -1
+ddctm625 comparetotmag -12.00000 -12.2345 -> -1
+ddctm626 comparetotmag -12.000000 -12.2345 -> -1
+ddctm627 comparetotmag -12.0000000 -12.2345 -> -1
+ddctm628 comparetotmag -12.00000000 -12.2345 -> -1
+ddctm629 comparetotmag -12.000000000 -12.2345 -> -1
+ddctm630 comparetotmag -12.1234 -12 -> 1
+ddctm631 comparetotmag -12.1234 -12.0 -> 1
+ddctm632 comparetotmag -12.1234 -12.00 -> 1
+ddctm633 comparetotmag -12.1234 -12.000 -> 1
+ddctm634 comparetotmag -12.1234 -12.0000 -> 1
+ddctm635 comparetotmag -12.1234 -12.00000 -> 1
+ddctm636 comparetotmag -12.1234 -12.000000 -> 1
+ddctm637 comparetotmag -12.1234 -12.0000000 -> 1
+ddctm638 comparetotmag -12.1234 -12.00000000 -> 1
+ddctm639 comparetotmag -12.1234 -12.000000000 -> 1
+
+-- extended zeros
+ddctm640 comparetotmag 0 0 -> 0
+ddctm641 comparetotmag 0 -0 -> 0
+ddctm642 comparetotmag 0 -0.0 -> 1
+ddctm643 comparetotmag 0 0.0 -> 1
+ddctm644 comparetotmag -0 0 -> 0
+ddctm645 comparetotmag -0 -0 -> 0
+ddctm646 comparetotmag -0 -0.0 -> 1
+ddctm647 comparetotmag -0 0.0 -> 1
+ddctm648 comparetotmag 0.0 0 -> -1
+ddctm649 comparetotmag 0.0 -0 -> -1
+ddctm650 comparetotmag 0.0 -0.0 -> 0
+ddctm651 comparetotmag 0.0 0.0 -> 0
+ddctm652 comparetotmag -0.0 0 -> -1
+ddctm653 comparetotmag -0.0 -0 -> -1
+ddctm654 comparetotmag -0.0 -0.0 -> 0
+ddctm655 comparetotmag -0.0 0.0 -> 0
+
+ddctm656 comparetotmag -0E1 0.0 -> 1
+ddctm657 comparetotmag -0E2 0.0 -> 1
+ddctm658 comparetotmag 0E1 0.0 -> 1
+ddctm659 comparetotmag 0E2 0.0 -> 1
+ddctm660 comparetotmag -0E1 0 -> 1
+ddctm661 comparetotmag -0E2 0 -> 1
+ddctm662 comparetotmag 0E1 0 -> 1
+ddctm663 comparetotmag 0E2 0 -> 1
+ddctm664 comparetotmag -0E1 -0E1 -> 0
+ddctm665 comparetotmag -0E2 -0E1 -> 1
+ddctm666 comparetotmag 0E1 -0E1 -> 0
+ddctm667 comparetotmag 0E2 -0E1 -> 1
+ddctm668 comparetotmag -0E1 -0E2 -> -1
+ddctm669 comparetotmag -0E2 -0E2 -> 0
+ddctm670 comparetotmag 0E1 -0E2 -> -1
+ddctm671 comparetotmag 0E2 -0E2 -> 0
+ddctm672 comparetotmag -0E1 0E1 -> 0
+ddctm673 comparetotmag -0E2 0E1 -> 1
+ddctm674 comparetotmag 0E1 0E1 -> 0
+ddctm675 comparetotmag 0E2 0E1 -> 1
+ddctm676 comparetotmag -0E1 0E2 -> -1
+ddctm677 comparetotmag -0E2 0E2 -> 0
+ddctm678 comparetotmag 0E1 0E2 -> -1
+ddctm679 comparetotmag 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+ddctm680 comparetotmag 12 12 -> 0
+ddctm681 comparetotmag 12 12.0 -> 1
+ddctm682 comparetotmag 12 12.00 -> 1
+ddctm683 comparetotmag 12 12.000 -> 1
+ddctm684 comparetotmag 12 12.0000 -> 1
+ddctm685 comparetotmag 12 12.00000 -> 1
+ddctm686 comparetotmag 12 12.000000 -> 1
+ddctm687 comparetotmag 12 12.0000000 -> 1
+ddctm688 comparetotmag 12 12.00000000 -> 1
+ddctm689 comparetotmag 12 12.000000000 -> 1
+ddctm690 comparetotmag 12 12 -> 0
+ddctm691 comparetotmag 12.0 12 -> -1
+ddctm692 comparetotmag 12.00 12 -> -1
+ddctm693 comparetotmag 12.000 12 -> -1
+ddctm694 comparetotmag 12.0000 12 -> -1
+ddctm695 comparetotmag 12.00000 12 -> -1
+ddctm696 comparetotmag 12.000000 12 -> -1
+ddctm697 comparetotmag 12.0000000 12 -> -1
+ddctm698 comparetotmag 12.00000000 12 -> -1
+ddctm699 comparetotmag 12.000000000 12 -> -1
+
+-- old long operand checks
+ddctm701 comparetotmag 12345678000 1 -> 1
+ddctm702 comparetotmag 1 12345678000 -> -1
+ddctm703 comparetotmag 1234567800 1 -> 1
+ddctm704 comparetotmag 1 1234567800 -> -1
+ddctm705 comparetotmag 1234567890 1 -> 1
+ddctm706 comparetotmag 1 1234567890 -> -1
+ddctm707 comparetotmag 1234567891 1 -> 1
+ddctm708 comparetotmag 1 1234567891 -> -1
+ddctm709 comparetotmag 12345678901 1 -> 1
+ddctm710 comparetotmag 1 12345678901 -> -1
+ddctm711 comparetotmag 1234567896 1 -> 1
+ddctm712 comparetotmag 1 1234567896 -> -1
+ddctm713 comparetotmag -1234567891 1 -> 1
+ddctm714 comparetotmag 1 -1234567891 -> -1
+ddctm715 comparetotmag -12345678901 1 -> 1
+ddctm716 comparetotmag 1 -12345678901 -> -1
+ddctm717 comparetotmag -1234567896 1 -> 1
+ddctm718 comparetotmag 1 -1234567896 -> -1
+
+-- old residue cases
+ddctm740 comparetotmag 1 0.9999999 -> 1
+ddctm741 comparetotmag 1 0.999999 -> 1
+ddctm742 comparetotmag 1 0.99999 -> 1
+ddctm743 comparetotmag 1 1.0000 -> 1
+ddctm744 comparetotmag 1 1.00001 -> -1
+ddctm745 comparetotmag 1 1.000001 -> -1
+ddctm746 comparetotmag 1 1.0000001 -> -1
+ddctm750 comparetotmag 0.9999999 1 -> -1
+ddctm751 comparetotmag 0.999999 1 -> -1
+ddctm752 comparetotmag 0.99999 1 -> -1
+ddctm753 comparetotmag 1.0000 1 -> -1
+ddctm754 comparetotmag 1.00001 1 -> 1
+ddctm755 comparetotmag 1.000001 1 -> 1
+ddctm756 comparetotmag 1.0000001 1 -> 1
+
+-- Specials
+ddctm780 comparetotmag Inf -Inf -> 0
+ddctm781 comparetotmag Inf -1000 -> 1
+ddctm782 comparetotmag Inf -1 -> 1
+ddctm783 comparetotmag Inf -0 -> 1
+ddctm784 comparetotmag Inf 0 -> 1
+ddctm785 comparetotmag Inf 1 -> 1
+ddctm786 comparetotmag Inf 1000 -> 1
+ddctm787 comparetotmag Inf Inf -> 0
+ddctm788 comparetotmag -1000 Inf -> -1
+ddctm789 comparetotmag -Inf Inf -> 0
+ddctm790 comparetotmag -1 Inf -> -1
+ddctm791 comparetotmag -0 Inf -> -1
+ddctm792 comparetotmag 0 Inf -> -1
+ddctm793 comparetotmag 1 Inf -> -1
+ddctm794 comparetotmag 1000 Inf -> -1
+ddctm795 comparetotmag Inf Inf -> 0
+
+ddctm800 comparetotmag -Inf -Inf -> 0
+ddctm801 comparetotmag -Inf -1000 -> 1
+ddctm802 comparetotmag -Inf -1 -> 1
+ddctm803 comparetotmag -Inf -0 -> 1
+ddctm804 comparetotmag -Inf 0 -> 1
+ddctm805 comparetotmag -Inf 1 -> 1
+ddctm806 comparetotmag -Inf 1000 -> 1
+ddctm807 comparetotmag -Inf Inf -> 0
+ddctm808 comparetotmag -Inf -Inf -> 0
+ddctm809 comparetotmag -1000 -Inf -> -1
+ddctm810 comparetotmag -1 -Inf -> -1
+ddctm811 comparetotmag -0 -Inf -> -1
+ddctm812 comparetotmag 0 -Inf -> -1
+ddctm813 comparetotmag 1 -Inf -> -1
+ddctm814 comparetotmag 1000 -Inf -> -1
+ddctm815 comparetotmag Inf -Inf -> 0
+
+ddctm821 comparetotmag NaN -Inf -> 1
+ddctm822 comparetotmag NaN -1000 -> 1
+ddctm823 comparetotmag NaN -1 -> 1
+ddctm824 comparetotmag NaN -0 -> 1
+ddctm825 comparetotmag NaN 0 -> 1
+ddctm826 comparetotmag NaN 1 -> 1
+ddctm827 comparetotmag NaN 1000 -> 1
+ddctm828 comparetotmag NaN Inf -> 1
+ddctm829 comparetotmag NaN NaN -> 0
+ddctm830 comparetotmag -Inf NaN -> -1
+ddctm831 comparetotmag -1000 NaN -> -1
+ddctm832 comparetotmag -1 NaN -> -1
+ddctm833 comparetotmag -0 NaN -> -1
+ddctm834 comparetotmag 0 NaN -> -1
+ddctm835 comparetotmag 1 NaN -> -1
+ddctm836 comparetotmag 1000 NaN -> -1
+ddctm837 comparetotmag Inf NaN -> -1
+ddctm838 comparetotmag -NaN -NaN -> 0
+ddctm839 comparetotmag +NaN -NaN -> 0
+ddctm840 comparetotmag -NaN +NaN -> 0
+
+ddctm841 comparetotmag sNaN -sNaN -> 0
+ddctm842 comparetotmag sNaN -NaN -> -1
+ddctm843 comparetotmag sNaN -Inf -> 1
+ddctm844 comparetotmag sNaN -1000 -> 1
+ddctm845 comparetotmag sNaN -1 -> 1
+ddctm846 comparetotmag sNaN -0 -> 1
+ddctm847 comparetotmag sNaN 0 -> 1
+ddctm848 comparetotmag sNaN 1 -> 1
+ddctm849 comparetotmag sNaN 1000 -> 1
+ddctm850 comparetotmag sNaN NaN -> -1
+ddctm851 comparetotmag sNaN sNaN -> 0
+
+ddctm852 comparetotmag -sNaN sNaN -> 0
+ddctm853 comparetotmag -NaN sNaN -> 1
+ddctm854 comparetotmag -Inf sNaN -> -1
+ddctm855 comparetotmag -1000 sNaN -> -1
+ddctm856 comparetotmag -1 sNaN -> -1
+ddctm857 comparetotmag -0 sNaN -> -1
+ddctm858 comparetotmag 0 sNaN -> -1
+ddctm859 comparetotmag 1 sNaN -> -1
+ddctm860 comparetotmag 1000 sNaN -> -1
+ddctm861 comparetotmag Inf sNaN -> -1
+ddctm862 comparetotmag NaN sNaN -> 1
+ddctm863 comparetotmag sNaN sNaN -> 0
+
+ddctm871 comparetotmag -sNaN -sNaN -> 0
+ddctm872 comparetotmag -sNaN -NaN -> -1
+ddctm873 comparetotmag -sNaN -Inf -> 1
+ddctm874 comparetotmag -sNaN -1000 -> 1
+ddctm875 comparetotmag -sNaN -1 -> 1
+ddctm876 comparetotmag -sNaN -0 -> 1
+ddctm877 comparetotmag -sNaN 0 -> 1
+ddctm878 comparetotmag -sNaN 1 -> 1
+ddctm879 comparetotmag -sNaN 1000 -> 1
+ddctm880 comparetotmag -sNaN NaN -> -1
+ddctm881 comparetotmag -sNaN sNaN -> 0
+
+ddctm882 comparetotmag -sNaN -sNaN -> 0
+ddctm883 comparetotmag -NaN -sNaN -> 1
+ddctm884 comparetotmag -Inf -sNaN -> -1
+ddctm885 comparetotmag -1000 -sNaN -> -1
+ddctm886 comparetotmag -1 -sNaN -> -1
+ddctm887 comparetotmag -0 -sNaN -> -1
+ddctm888 comparetotmag 0 -sNaN -> -1
+ddctm889 comparetotmag 1 -sNaN -> -1
+ddctm890 comparetotmag 1000 -sNaN -> -1
+ddctm891 comparetotmag Inf -sNaN -> -1
+ddctm892 comparetotmag NaN -sNaN -> 1
+ddctm893 comparetotmag sNaN -sNaN -> 0
+
+-- NaNs with payload
+ddctm960 comparetotmag NaN9 -Inf -> 1
+ddctm961 comparetotmag NaN8 999 -> 1
+ddctm962 comparetotmag NaN77 Inf -> 1
+ddctm963 comparetotmag -NaN67 NaN5 -> 1
+ddctm964 comparetotmag -Inf -NaN4 -> -1
+ddctm965 comparetotmag -999 -NaN33 -> -1
+ddctm966 comparetotmag Inf NaN2 -> -1
+
+ddctm970 comparetotmag -NaN41 -NaN42 -> -1
+ddctm971 comparetotmag +NaN41 -NaN42 -> -1
+ddctm972 comparetotmag -NaN41 +NaN42 -> -1
+ddctm973 comparetotmag +NaN41 +NaN42 -> -1
+ddctm974 comparetotmag -NaN42 -NaN01 -> 1
+ddctm975 comparetotmag +NaN42 -NaN01 -> 1
+ddctm976 comparetotmag -NaN42 +NaN01 -> 1
+ddctm977 comparetotmag +NaN42 +NaN01 -> 1
+
+ddctm980 comparetotmag -sNaN771 -sNaN772 -> -1
+ddctm981 comparetotmag +sNaN771 -sNaN772 -> -1
+ddctm982 comparetotmag -sNaN771 +sNaN772 -> -1
+ddctm983 comparetotmag +sNaN771 +sNaN772 -> -1
+ddctm984 comparetotmag -sNaN772 -sNaN771 -> 1
+ddctm985 comparetotmag +sNaN772 -sNaN771 -> 1
+ddctm986 comparetotmag -sNaN772 +sNaN771 -> 1
+ddctm987 comparetotmag +sNaN772 +sNaN771 -> 1
+
+ddctm991 comparetotmag -sNaN99 -Inf -> 1
+ddctm992 comparetotmag sNaN98 -11 -> 1
+ddctm993 comparetotmag sNaN97 NaN -> -1
+ddctm994 comparetotmag sNaN16 sNaN94 -> -1
+ddctm995 comparetotmag NaN85 sNaN83 -> 1
+ddctm996 comparetotmag -Inf sNaN92 -> -1
+ddctm997 comparetotmag 088 sNaN81 -> -1
+ddctm998 comparetotmag Inf sNaN90 -> -1
+ddctm999 comparetotmag NaN -sNaN89 -> 1
+
+-- spread zeros
+ddctm1110 comparetotmag 0E-383 0 -> -1
+ddctm1111 comparetotmag 0E-383 -0 -> -1
+ddctm1112 comparetotmag -0E-383 0 -> -1
+ddctm1113 comparetotmag -0E-383 -0 -> -1
+ddctm1114 comparetotmag 0E-383 0E+384 -> -1
+ddctm1115 comparetotmag 0E-383 -0E+384 -> -1
+ddctm1116 comparetotmag -0E-383 0E+384 -> -1
+ddctm1117 comparetotmag -0E-383 -0E+384 -> -1
+ddctm1118 comparetotmag 0 0E+384 -> -1
+ddctm1119 comparetotmag 0 -0E+384 -> -1
+ddctm1120 comparetotmag -0 0E+384 -> -1
+ddctm1121 comparetotmag -0 -0E+384 -> -1
+
+ddctm1130 comparetotmag 0E+384 0 -> 1
+ddctm1131 comparetotmag 0E+384 -0 -> 1
+ddctm1132 comparetotmag -0E+384 0 -> 1
+ddctm1133 comparetotmag -0E+384 -0 -> 1
+ddctm1134 comparetotmag 0E+384 0E-383 -> 1
+ddctm1135 comparetotmag 0E+384 -0E-383 -> 1
+ddctm1136 comparetotmag -0E+384 0E-383 -> 1
+ddctm1137 comparetotmag -0E+384 -0E-383 -> 1
+ddctm1138 comparetotmag 0 0E-383 -> 1
+ddctm1139 comparetotmag 0 -0E-383 -> 1
+ddctm1140 comparetotmag -0 0E-383 -> 1
+ddctm1141 comparetotmag -0 -0E-383 -> 1
+
+-- Null tests
+ddctm9990 comparetotmag 10 # -> NaN Invalid_operation
+ddctm9991 comparetotmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddCopy.decTest b/Lib/test/decimaltestdata/ddCopy.decTest
index f99d86a426..9a175c5ea7 100644
--- a/Lib/test/decimaltestdata/ddCopy.decTest
+++ b/Lib/test/decimaltestdata/ddCopy.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddCopy.decTest -- quiet decDouble copy --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddcpy001 copy +7.50 -> 7.50
-
--- Infinities
-ddcpy011 copy Infinity -> Infinity
-ddcpy012 copy -Infinity -> -Infinity
-
--- NaNs, 0 payload
-ddcpy021 copy NaN -> NaN
-ddcpy022 copy -NaN -> -NaN
-ddcpy023 copy sNaN -> sNaN
-ddcpy024 copy -sNaN -> -sNaN
-
--- NaNs, non-0 payload
-ddcpy031 copy NaN10 -> NaN10
-ddcpy032 copy -NaN10 -> -NaN10
-ddcpy033 copy sNaN10 -> sNaN10
-ddcpy034 copy -sNaN10 -> -sNaN10
-ddcpy035 copy NaN7 -> NaN7
-ddcpy036 copy -NaN7 -> -NaN7
-ddcpy037 copy sNaN101 -> sNaN101
-ddcpy038 copy -sNaN101 -> -sNaN101
-
--- finites
-ddcpy101 copy 7 -> 7
-ddcpy102 copy -7 -> -7
-ddcpy103 copy 75 -> 75
-ddcpy104 copy -75 -> -75
-ddcpy105 copy 7.50 -> 7.50
-ddcpy106 copy -7.50 -> -7.50
-ddcpy107 copy 7.500 -> 7.500
-ddcpy108 copy -7.500 -> -7.500
-
--- zeros
-ddcpy111 copy 0 -> 0
-ddcpy112 copy -0 -> -0
-ddcpy113 copy 0E+4 -> 0E+4
-ddcpy114 copy -0E+4 -> -0E+4
-ddcpy115 copy 0.0000 -> 0.0000
-ddcpy116 copy -0.0000 -> -0.0000
-ddcpy117 copy 0E-141 -> 0E-141
-ddcpy118 copy -0E-141 -> -0E-141
-
--- full coefficients, alternating bits
-ddcpy121 copy 2682682682682682 -> 2682682682682682
-ddcpy122 copy -2682682682682682 -> -2682682682682682
-ddcpy123 copy 1341341341341341 -> 1341341341341341
-ddcpy124 copy -1341341341341341 -> -1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcpy131 copy 9.999999999999999E+384 -> 9.999999999999999E+384
-ddcpy132 copy 1E-383 -> 1E-383
-ddcpy133 copy 1.000000000000000E-383 -> 1.000000000000000E-383
-ddcpy134 copy 1E-398 -> 1E-398
-
-ddcpy135 copy -1E-398 -> -1E-398
-ddcpy136 copy -1.000000000000000E-383 -> -1.000000000000000E-383
-ddcpy137 copy -1E-383 -> -1E-383
-ddcpy138 copy -9.999999999999999E+384 -> -9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddCopy.decTest -- quiet decDouble copy --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddcpy001 copy +7.50 -> 7.50
+
+-- Infinities
+ddcpy011 copy Infinity -> Infinity
+ddcpy012 copy -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+ddcpy021 copy NaN -> NaN
+ddcpy022 copy -NaN -> -NaN
+ddcpy023 copy sNaN -> sNaN
+ddcpy024 copy -sNaN -> -sNaN
+
+-- NaNs, non-0 payload
+ddcpy031 copy NaN10 -> NaN10
+ddcpy032 copy -NaN10 -> -NaN10
+ddcpy033 copy sNaN10 -> sNaN10
+ddcpy034 copy -sNaN10 -> -sNaN10
+ddcpy035 copy NaN7 -> NaN7
+ddcpy036 copy -NaN7 -> -NaN7
+ddcpy037 copy sNaN101 -> sNaN101
+ddcpy038 copy -sNaN101 -> -sNaN101
+
+-- finites
+ddcpy101 copy 7 -> 7
+ddcpy102 copy -7 -> -7
+ddcpy103 copy 75 -> 75
+ddcpy104 copy -75 -> -75
+ddcpy105 copy 7.50 -> 7.50
+ddcpy106 copy -7.50 -> -7.50
+ddcpy107 copy 7.500 -> 7.500
+ddcpy108 copy -7.500 -> -7.500
+
+-- zeros
+ddcpy111 copy 0 -> 0
+ddcpy112 copy -0 -> -0
+ddcpy113 copy 0E+4 -> 0E+4
+ddcpy114 copy -0E+4 -> -0E+4
+ddcpy115 copy 0.0000 -> 0.0000
+ddcpy116 copy -0.0000 -> -0.0000
+ddcpy117 copy 0E-141 -> 0E-141
+ddcpy118 copy -0E-141 -> -0E-141
+
+-- full coefficients, alternating bits
+ddcpy121 copy 2682682682682682 -> 2682682682682682
+ddcpy122 copy -2682682682682682 -> -2682682682682682
+ddcpy123 copy 1341341341341341 -> 1341341341341341
+ddcpy124 copy -1341341341341341 -> -1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcpy131 copy 9.999999999999999E+384 -> 9.999999999999999E+384
+ddcpy132 copy 1E-383 -> 1E-383
+ddcpy133 copy 1.000000000000000E-383 -> 1.000000000000000E-383
+ddcpy134 copy 1E-398 -> 1E-398
+
+ddcpy135 copy -1E-398 -> -1E-398
+ddcpy136 copy -1.000000000000000E-383 -> -1.000000000000000E-383
+ddcpy137 copy -1E-383 -> -1E-383
+ddcpy138 copy -9.999999999999999E+384 -> -9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddCopyAbs.decTest b/Lib/test/decimaltestdata/ddCopyAbs.decTest
index d436a1940c..4823cf2d77 100644
--- a/Lib/test/decimaltestdata/ddCopyAbs.decTest
+++ b/Lib/test/decimaltestdata/ddCopyAbs.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddCopyAbs.decTest -- quiet decDouble copy and set sign to zero --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddcpa001 copyabs +7.50 -> 7.50
-
--- Infinities
-ddcpa011 copyabs Infinity -> Infinity
-ddcpa012 copyabs -Infinity -> Infinity
-
--- NaNs, 0 payload
-ddcpa021 copyabs NaN -> NaN
-ddcpa022 copyabs -NaN -> NaN
-ddcpa023 copyabs sNaN -> sNaN
-ddcpa024 copyabs -sNaN -> sNaN
-
--- NaNs, non-0 payload
-ddcpa031 copyabs NaN10 -> NaN10
-ddcpa032 copyabs -NaN15 -> NaN15
-ddcpa033 copyabs sNaN15 -> sNaN15
-ddcpa034 copyabs -sNaN10 -> sNaN10
-ddcpa035 copyabs NaN7 -> NaN7
-ddcpa036 copyabs -NaN7 -> NaN7
-ddcpa037 copyabs sNaN101 -> sNaN101
-ddcpa038 copyabs -sNaN101 -> sNaN101
-
--- finites
-ddcpa101 copyabs 7 -> 7
-ddcpa102 copyabs -7 -> 7
-ddcpa103 copyabs 75 -> 75
-ddcpa104 copyabs -75 -> 75
-ddcpa105 copyabs 7.10 -> 7.10
-ddcpa106 copyabs -7.10 -> 7.10
-ddcpa107 copyabs 7.500 -> 7.500
-ddcpa108 copyabs -7.500 -> 7.500
-
--- zeros
-ddcpa111 copyabs 0 -> 0
-ddcpa112 copyabs -0 -> 0
-ddcpa113 copyabs 0E+6 -> 0E+6
-ddcpa114 copyabs -0E+6 -> 0E+6
-ddcpa115 copyabs 0.0000 -> 0.0000
-ddcpa116 copyabs -0.0000 -> 0.0000
-ddcpa117 copyabs 0E-141 -> 0E-141
-ddcpa118 copyabs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddcpa121 copyabs 2682682682682682 -> 2682682682682682
-ddcpa122 copyabs -2682682682682682 -> 2682682682682682
-ddcpa123 copyabs 1341341341341341 -> 1341341341341341
-ddcpa124 copyabs -1341341341341341 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcpa131 copyabs 9.999999999999999E+384 -> 9.999999999999999E+384
-ddcpa132 copyabs 1E-383 -> 1E-383
-ddcpa133 copyabs 1.000000000000000E-383 -> 1.000000000000000E-383
-ddcpa134 copyabs 1E-398 -> 1E-398
-
-ddcpa135 copyabs -1E-398 -> 1E-398
-ddcpa136 copyabs -1.000000000000000E-383 -> 1.000000000000000E-383
-ddcpa137 copyabs -1E-383 -> 1E-383
-ddcpa138 copyabs -9.999999999999999E+384 -> 9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddCopyAbs.decTest -- quiet decDouble copy and set sign to zero --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddcpa001 copyabs +7.50 -> 7.50
+
+-- Infinities
+ddcpa011 copyabs Infinity -> Infinity
+ddcpa012 copyabs -Infinity -> Infinity
+
+-- NaNs, 0 payload
+ddcpa021 copyabs NaN -> NaN
+ddcpa022 copyabs -NaN -> NaN
+ddcpa023 copyabs sNaN -> sNaN
+ddcpa024 copyabs -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+ddcpa031 copyabs NaN10 -> NaN10
+ddcpa032 copyabs -NaN15 -> NaN15
+ddcpa033 copyabs sNaN15 -> sNaN15
+ddcpa034 copyabs -sNaN10 -> sNaN10
+ddcpa035 copyabs NaN7 -> NaN7
+ddcpa036 copyabs -NaN7 -> NaN7
+ddcpa037 copyabs sNaN101 -> sNaN101
+ddcpa038 copyabs -sNaN101 -> sNaN101
+
+-- finites
+ddcpa101 copyabs 7 -> 7
+ddcpa102 copyabs -7 -> 7
+ddcpa103 copyabs 75 -> 75
+ddcpa104 copyabs -75 -> 75
+ddcpa105 copyabs 7.10 -> 7.10
+ddcpa106 copyabs -7.10 -> 7.10
+ddcpa107 copyabs 7.500 -> 7.500
+ddcpa108 copyabs -7.500 -> 7.500
+
+-- zeros
+ddcpa111 copyabs 0 -> 0
+ddcpa112 copyabs -0 -> 0
+ddcpa113 copyabs 0E+6 -> 0E+6
+ddcpa114 copyabs -0E+6 -> 0E+6
+ddcpa115 copyabs 0.0000 -> 0.0000
+ddcpa116 copyabs -0.0000 -> 0.0000
+ddcpa117 copyabs 0E-141 -> 0E-141
+ddcpa118 copyabs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddcpa121 copyabs 2682682682682682 -> 2682682682682682
+ddcpa122 copyabs -2682682682682682 -> 2682682682682682
+ddcpa123 copyabs 1341341341341341 -> 1341341341341341
+ddcpa124 copyabs -1341341341341341 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcpa131 copyabs 9.999999999999999E+384 -> 9.999999999999999E+384
+ddcpa132 copyabs 1E-383 -> 1E-383
+ddcpa133 copyabs 1.000000000000000E-383 -> 1.000000000000000E-383
+ddcpa134 copyabs 1E-398 -> 1E-398
+
+ddcpa135 copyabs -1E-398 -> 1E-398
+ddcpa136 copyabs -1.000000000000000E-383 -> 1.000000000000000E-383
+ddcpa137 copyabs -1E-383 -> 1E-383
+ddcpa138 copyabs -9.999999999999999E+384 -> 9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddCopyNegate.decTest b/Lib/test/decimaltestdata/ddCopyNegate.decTest
index a4c4274372..121945c755 100644
--- a/Lib/test/decimaltestdata/ddCopyNegate.decTest
+++ b/Lib/test/decimaltestdata/ddCopyNegate.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddCopyNegate.decTest -- quiet decDouble copy and negate --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddcpn001 copynegate +7.50 -> -7.50
-
--- Infinities
-ddcpn011 copynegate Infinity -> -Infinity
-ddcpn012 copynegate -Infinity -> Infinity
-
--- NaNs, 0 payload
-ddcpn021 copynegate NaN -> -NaN
-ddcpn022 copynegate -NaN -> NaN
-ddcpn023 copynegate sNaN -> -sNaN
-ddcpn024 copynegate -sNaN -> sNaN
-
--- NaNs, non-0 payload
-ddcpn031 copynegate NaN13 -> -NaN13
-ddcpn032 copynegate -NaN13 -> NaN13
-ddcpn033 copynegate sNaN13 -> -sNaN13
-ddcpn034 copynegate -sNaN13 -> sNaN13
-ddcpn035 copynegate NaN70 -> -NaN70
-ddcpn036 copynegate -NaN70 -> NaN70
-ddcpn037 copynegate sNaN101 -> -sNaN101
-ddcpn038 copynegate -sNaN101 -> sNaN101
-
--- finites
-ddcpn101 copynegate 7 -> -7
-ddcpn102 copynegate -7 -> 7
-ddcpn103 copynegate 75 -> -75
-ddcpn104 copynegate -75 -> 75
-ddcpn105 copynegate 7.50 -> -7.50
-ddcpn106 copynegate -7.50 -> 7.50
-ddcpn107 copynegate 7.500 -> -7.500
-ddcpn108 copynegate -7.500 -> 7.500
-
--- zeros
-ddcpn111 copynegate 0 -> -0
-ddcpn112 copynegate -0 -> 0
-ddcpn113 copynegate 0E+4 -> -0E+4
-ddcpn114 copynegate -0E+4 -> 0E+4
-ddcpn115 copynegate 0.0000 -> -0.0000
-ddcpn116 copynegate -0.0000 -> 0.0000
-ddcpn117 copynegate 0E-141 -> -0E-141
-ddcpn118 copynegate -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddcpn121 copynegate 2682682682682682 -> -2682682682682682
-ddcpn122 copynegate -2682682682682682 -> 2682682682682682
-ddcpn123 copynegate 1341341341341341 -> -1341341341341341
-ddcpn124 copynegate -1341341341341341 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcpn131 copynegate 9.999999999999999E+384 -> -9.999999999999999E+384
-ddcpn132 copynegate 1E-383 -> -1E-383
-ddcpn133 copynegate 1.000000000000000E-383 -> -1.000000000000000E-383
-ddcpn134 copynegate 1E-398 -> -1E-398
-
-ddcpn135 copynegate -1E-398 -> 1E-398
-ddcpn136 copynegate -1.000000000000000E-383 -> 1.000000000000000E-383
-ddcpn137 copynegate -1E-383 -> 1E-383
-ddcpn138 copynegate -9.999999999999999E+384 -> 9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddCopyNegate.decTest -- quiet decDouble copy and negate --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddcpn001 copynegate +7.50 -> -7.50
+
+-- Infinities
+ddcpn011 copynegate Infinity -> -Infinity
+ddcpn012 copynegate -Infinity -> Infinity
+
+-- NaNs, 0 payload
+ddcpn021 copynegate NaN -> -NaN
+ddcpn022 copynegate -NaN -> NaN
+ddcpn023 copynegate sNaN -> -sNaN
+ddcpn024 copynegate -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+ddcpn031 copynegate NaN13 -> -NaN13
+ddcpn032 copynegate -NaN13 -> NaN13
+ddcpn033 copynegate sNaN13 -> -sNaN13
+ddcpn034 copynegate -sNaN13 -> sNaN13
+ddcpn035 copynegate NaN70 -> -NaN70
+ddcpn036 copynegate -NaN70 -> NaN70
+ddcpn037 copynegate sNaN101 -> -sNaN101
+ddcpn038 copynegate -sNaN101 -> sNaN101
+
+-- finites
+ddcpn101 copynegate 7 -> -7
+ddcpn102 copynegate -7 -> 7
+ddcpn103 copynegate 75 -> -75
+ddcpn104 copynegate -75 -> 75
+ddcpn105 copynegate 7.50 -> -7.50
+ddcpn106 copynegate -7.50 -> 7.50
+ddcpn107 copynegate 7.500 -> -7.500
+ddcpn108 copynegate -7.500 -> 7.500
+
+-- zeros
+ddcpn111 copynegate 0 -> -0
+ddcpn112 copynegate -0 -> 0
+ddcpn113 copynegate 0E+4 -> -0E+4
+ddcpn114 copynegate -0E+4 -> 0E+4
+ddcpn115 copynegate 0.0000 -> -0.0000
+ddcpn116 copynegate -0.0000 -> 0.0000
+ddcpn117 copynegate 0E-141 -> -0E-141
+ddcpn118 copynegate -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddcpn121 copynegate 2682682682682682 -> -2682682682682682
+ddcpn122 copynegate -2682682682682682 -> 2682682682682682
+ddcpn123 copynegate 1341341341341341 -> -1341341341341341
+ddcpn124 copynegate -1341341341341341 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcpn131 copynegate 9.999999999999999E+384 -> -9.999999999999999E+384
+ddcpn132 copynegate 1E-383 -> -1E-383
+ddcpn133 copynegate 1.000000000000000E-383 -> -1.000000000000000E-383
+ddcpn134 copynegate 1E-398 -> -1E-398
+
+ddcpn135 copynegate -1E-398 -> 1E-398
+ddcpn136 copynegate -1.000000000000000E-383 -> 1.000000000000000E-383
+ddcpn137 copynegate -1E-383 -> 1E-383
+ddcpn138 copynegate -9.999999999999999E+384 -> 9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddCopySign.decTest b/Lib/test/decimaltestdata/ddCopySign.decTest
index 6a78083ad5..c99544d9ab 100644
--- a/Lib/test/decimaltestdata/ddCopySign.decTest
+++ b/Lib/test/decimaltestdata/ddCopySign.decTest
@@ -1,175 +1,175 @@
-------------------------------------------------------------------------
--- ddCopySign.decTest -- quiet decDouble copy with sign from rhs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddcps001 copysign +7.50 11 -> 7.50
-
--- Infinities
-ddcps011 copysign Infinity 11 -> Infinity
-ddcps012 copysign -Infinity 11 -> Infinity
-
--- NaNs, 0 payload
-ddcps021 copysign NaN 11 -> NaN
-ddcps022 copysign -NaN 11 -> NaN
-ddcps023 copysign sNaN 11 -> sNaN
-ddcps024 copysign -sNaN 11 -> sNaN
-
--- NaNs, non-0 payload
-ddcps031 copysign NaN10 11 -> NaN10
-ddcps032 copysign -NaN10 11 -> NaN10
-ddcps033 copysign sNaN10 11 -> sNaN10
-ddcps034 copysign -sNaN10 11 -> sNaN10
-ddcps035 copysign NaN7 11 -> NaN7
-ddcps036 copysign -NaN7 11 -> NaN7
-ddcps037 copysign sNaN101 11 -> sNaN101
-ddcps038 copysign -sNaN101 11 -> sNaN101
-
--- finites
-ddcps101 copysign 7 11 -> 7
-ddcps102 copysign -7 11 -> 7
-ddcps103 copysign 75 11 -> 75
-ddcps104 copysign -75 11 -> 75
-ddcps105 copysign 7.50 11 -> 7.50
-ddcps106 copysign -7.50 11 -> 7.50
-ddcps107 copysign 7.500 11 -> 7.500
-ddcps108 copysign -7.500 11 -> 7.500
-
--- zeros
-ddcps111 copysign 0 11 -> 0
-ddcps112 copysign -0 11 -> 0
-ddcps113 copysign 0E+4 11 -> 0E+4
-ddcps114 copysign -0E+4 11 -> 0E+4
-ddcps115 copysign 0.0000 11 -> 0.0000
-ddcps116 copysign -0.0000 11 -> 0.0000
-ddcps117 copysign 0E-141 11 -> 0E-141
-ddcps118 copysign -0E-141 11 -> 0E-141
-
--- full coefficients, alternating bits
-ddcps121 copysign 2682682682682682 11 -> 2682682682682682
-ddcps122 copysign -2682682682682682 11 -> 2682682682682682
-ddcps123 copysign 1341341341341341 11 -> 1341341341341341
-ddcps124 copysign -1341341341341341 11 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcps131 copysign 9.999999999999999E+384 11 -> 9.999999999999999E+384
-ddcps132 copysign 1E-383 11 -> 1E-383
-ddcps133 copysign 1.000000000000000E-383 11 -> 1.000000000000000E-383
-ddcps134 copysign 1E-398 11 -> 1E-398
-
-ddcps135 copysign -1E-398 11 -> 1E-398
-ddcps136 copysign -1.000000000000000E-383 11 -> 1.000000000000000E-383
-ddcps137 copysign -1E-383 11 -> 1E-383
-ddcps138 copysign -9.999999999999999E+384 11 -> 9.999999999999999E+384
-
--- repeat with negative RHS
-
--- Infinities
-ddcps211 copysign Infinity -34 -> -Infinity
-ddcps212 copysign -Infinity -34 -> -Infinity
-
--- NaNs, 0 payload
-ddcps221 copysign NaN -34 -> -NaN
-ddcps222 copysign -NaN -34 -> -NaN
-ddcps223 copysign sNaN -34 -> -sNaN
-ddcps224 copysign -sNaN -34 -> -sNaN
-
--- NaNs, non-0 payload
-ddcps231 copysign NaN10 -34 -> -NaN10
-ddcps232 copysign -NaN10 -34 -> -NaN10
-ddcps233 copysign sNaN10 -34 -> -sNaN10
-ddcps234 copysign -sNaN10 -34 -> -sNaN10
-ddcps235 copysign NaN7 -34 -> -NaN7
-ddcps236 copysign -NaN7 -34 -> -NaN7
-ddcps237 copysign sNaN101 -34 -> -sNaN101
-ddcps238 copysign -sNaN101 -34 -> -sNaN101
-
--- finites
-ddcps301 copysign 7 -34 -> -7
-ddcps302 copysign -7 -34 -> -7
-ddcps303 copysign 75 -34 -> -75
-ddcps304 copysign -75 -34 -> -75
-ddcps305 copysign 7.50 -34 -> -7.50
-ddcps306 copysign -7.50 -34 -> -7.50
-ddcps307 copysign 7.500 -34 -> -7.500
-ddcps308 copysign -7.500 -34 -> -7.500
-
--- zeros
-ddcps311 copysign 0 -34 -> -0
-ddcps312 copysign -0 -34 -> -0
-ddcps313 copysign 0E+4 -34 -> -0E+4
-ddcps314 copysign -0E+4 -34 -> -0E+4
-ddcps315 copysign 0.0000 -34 -> -0.0000
-ddcps316 copysign -0.0000 -34 -> -0.0000
-ddcps317 copysign 0E-141 -34 -> -0E-141
-ddcps318 copysign -0E-141 -34 -> -0E-141
-
--- full coefficients, alternating bits
-ddcps321 copysign 2682682682682682 -34 -> -2682682682682682
-ddcps322 copysign -2682682682682682 -34 -> -2682682682682682
-ddcps323 copysign 1341341341341341 -34 -> -1341341341341341
-ddcps324 copysign -1341341341341341 -34 -> -1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddcps331 copysign 9.999999999999999E+384 -34 -> -9.999999999999999E+384
-ddcps332 copysign 1E-383 -34 -> -1E-383
-ddcps333 copysign 1.000000000000000E-383 -34 -> -1.000000000000000E-383
-ddcps334 copysign 1E-398 -34 -> -1E-398
-
-ddcps335 copysign -1E-398 -34 -> -1E-398
-ddcps336 copysign -1.000000000000000E-383 -34 -> -1.000000000000000E-383
-ddcps337 copysign -1E-383 -34 -> -1E-383
-ddcps338 copysign -9.999999999999999E+384 -34 -> -9.999999999999999E+384
-
--- Other kinds of RHS
-ddcps401 copysign 701 -34 -> -701
-ddcps402 copysign -720 -34 -> -720
-ddcps403 copysign 701 -0 -> -701
-ddcps404 copysign -720 -0 -> -720
-ddcps405 copysign 701 +0 -> 701
-ddcps406 copysign -720 +0 -> 720
-ddcps407 copysign 701 +34 -> 701
-ddcps408 copysign -720 +34 -> 720
-
-ddcps413 copysign 701 -Inf -> -701
-ddcps414 copysign -720 -Inf -> -720
-ddcps415 copysign 701 +Inf -> 701
-ddcps416 copysign -720 +Inf -> 720
-
-ddcps420 copysign 701 -NaN -> -701
-ddcps421 copysign -720 -NaN -> -720
-ddcps422 copysign 701 +NaN -> 701
-ddcps423 copysign -720 +NaN -> 720
-ddcps425 copysign -720 +NaN8 -> 720
-
-ddcps426 copysign 701 -sNaN -> -701
-ddcps427 copysign -720 -sNaN -> -720
-ddcps428 copysign 701 +sNaN -> 701
-ddcps429 copysign -720 +sNaN -> 720
-ddcps430 copysign -720 +sNaN3 -> 720
-
+------------------------------------------------------------------------
+-- ddCopySign.decTest -- quiet decDouble copy with sign from rhs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddcps001 copysign +7.50 11 -> 7.50
+
+-- Infinities
+ddcps011 copysign Infinity 11 -> Infinity
+ddcps012 copysign -Infinity 11 -> Infinity
+
+-- NaNs, 0 payload
+ddcps021 copysign NaN 11 -> NaN
+ddcps022 copysign -NaN 11 -> NaN
+ddcps023 copysign sNaN 11 -> sNaN
+ddcps024 copysign -sNaN 11 -> sNaN
+
+-- NaNs, non-0 payload
+ddcps031 copysign NaN10 11 -> NaN10
+ddcps032 copysign -NaN10 11 -> NaN10
+ddcps033 copysign sNaN10 11 -> sNaN10
+ddcps034 copysign -sNaN10 11 -> sNaN10
+ddcps035 copysign NaN7 11 -> NaN7
+ddcps036 copysign -NaN7 11 -> NaN7
+ddcps037 copysign sNaN101 11 -> sNaN101
+ddcps038 copysign -sNaN101 11 -> sNaN101
+
+-- finites
+ddcps101 copysign 7 11 -> 7
+ddcps102 copysign -7 11 -> 7
+ddcps103 copysign 75 11 -> 75
+ddcps104 copysign -75 11 -> 75
+ddcps105 copysign 7.50 11 -> 7.50
+ddcps106 copysign -7.50 11 -> 7.50
+ddcps107 copysign 7.500 11 -> 7.500
+ddcps108 copysign -7.500 11 -> 7.500
+
+-- zeros
+ddcps111 copysign 0 11 -> 0
+ddcps112 copysign -0 11 -> 0
+ddcps113 copysign 0E+4 11 -> 0E+4
+ddcps114 copysign -0E+4 11 -> 0E+4
+ddcps115 copysign 0.0000 11 -> 0.0000
+ddcps116 copysign -0.0000 11 -> 0.0000
+ddcps117 copysign 0E-141 11 -> 0E-141
+ddcps118 copysign -0E-141 11 -> 0E-141
+
+-- full coefficients, alternating bits
+ddcps121 copysign 2682682682682682 11 -> 2682682682682682
+ddcps122 copysign -2682682682682682 11 -> 2682682682682682
+ddcps123 copysign 1341341341341341 11 -> 1341341341341341
+ddcps124 copysign -1341341341341341 11 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcps131 copysign 9.999999999999999E+384 11 -> 9.999999999999999E+384
+ddcps132 copysign 1E-383 11 -> 1E-383
+ddcps133 copysign 1.000000000000000E-383 11 -> 1.000000000000000E-383
+ddcps134 copysign 1E-398 11 -> 1E-398
+
+ddcps135 copysign -1E-398 11 -> 1E-398
+ddcps136 copysign -1.000000000000000E-383 11 -> 1.000000000000000E-383
+ddcps137 copysign -1E-383 11 -> 1E-383
+ddcps138 copysign -9.999999999999999E+384 11 -> 9.999999999999999E+384
+
+-- repeat with negative RHS
+
+-- Infinities
+ddcps211 copysign Infinity -34 -> -Infinity
+ddcps212 copysign -Infinity -34 -> -Infinity
+
+-- NaNs, 0 payload
+ddcps221 copysign NaN -34 -> -NaN
+ddcps222 copysign -NaN -34 -> -NaN
+ddcps223 copysign sNaN -34 -> -sNaN
+ddcps224 copysign -sNaN -34 -> -sNaN
+
+-- NaNs, non-0 payload
+ddcps231 copysign NaN10 -34 -> -NaN10
+ddcps232 copysign -NaN10 -34 -> -NaN10
+ddcps233 copysign sNaN10 -34 -> -sNaN10
+ddcps234 copysign -sNaN10 -34 -> -sNaN10
+ddcps235 copysign NaN7 -34 -> -NaN7
+ddcps236 copysign -NaN7 -34 -> -NaN7
+ddcps237 copysign sNaN101 -34 -> -sNaN101
+ddcps238 copysign -sNaN101 -34 -> -sNaN101
+
+-- finites
+ddcps301 copysign 7 -34 -> -7
+ddcps302 copysign -7 -34 -> -7
+ddcps303 copysign 75 -34 -> -75
+ddcps304 copysign -75 -34 -> -75
+ddcps305 copysign 7.50 -34 -> -7.50
+ddcps306 copysign -7.50 -34 -> -7.50
+ddcps307 copysign 7.500 -34 -> -7.500
+ddcps308 copysign -7.500 -34 -> -7.500
+
+-- zeros
+ddcps311 copysign 0 -34 -> -0
+ddcps312 copysign -0 -34 -> -0
+ddcps313 copysign 0E+4 -34 -> -0E+4
+ddcps314 copysign -0E+4 -34 -> -0E+4
+ddcps315 copysign 0.0000 -34 -> -0.0000
+ddcps316 copysign -0.0000 -34 -> -0.0000
+ddcps317 copysign 0E-141 -34 -> -0E-141
+ddcps318 copysign -0E-141 -34 -> -0E-141
+
+-- full coefficients, alternating bits
+ddcps321 copysign 2682682682682682 -34 -> -2682682682682682
+ddcps322 copysign -2682682682682682 -34 -> -2682682682682682
+ddcps323 copysign 1341341341341341 -34 -> -1341341341341341
+ddcps324 copysign -1341341341341341 -34 -> -1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddcps331 copysign 9.999999999999999E+384 -34 -> -9.999999999999999E+384
+ddcps332 copysign 1E-383 -34 -> -1E-383
+ddcps333 copysign 1.000000000000000E-383 -34 -> -1.000000000000000E-383
+ddcps334 copysign 1E-398 -34 -> -1E-398
+
+ddcps335 copysign -1E-398 -34 -> -1E-398
+ddcps336 copysign -1.000000000000000E-383 -34 -> -1.000000000000000E-383
+ddcps337 copysign -1E-383 -34 -> -1E-383
+ddcps338 copysign -9.999999999999999E+384 -34 -> -9.999999999999999E+384
+
+-- Other kinds of RHS
+ddcps401 copysign 701 -34 -> -701
+ddcps402 copysign -720 -34 -> -720
+ddcps403 copysign 701 -0 -> -701
+ddcps404 copysign -720 -0 -> -720
+ddcps405 copysign 701 +0 -> 701
+ddcps406 copysign -720 +0 -> 720
+ddcps407 copysign 701 +34 -> 701
+ddcps408 copysign -720 +34 -> 720
+
+ddcps413 copysign 701 -Inf -> -701
+ddcps414 copysign -720 -Inf -> -720
+ddcps415 copysign 701 +Inf -> 701
+ddcps416 copysign -720 +Inf -> 720
+
+ddcps420 copysign 701 -NaN -> -701
+ddcps421 copysign -720 -NaN -> -720
+ddcps422 copysign 701 +NaN -> 701
+ddcps423 copysign -720 +NaN -> 720
+ddcps425 copysign -720 +NaN8 -> 720
+
+ddcps426 copysign 701 -sNaN -> -701
+ddcps427 copysign -720 -sNaN -> -720
+ddcps428 copysign 701 +sNaN -> 701
+ddcps429 copysign -720 +sNaN -> 720
+ddcps430 copysign -720 +sNaN3 -> 720
+
diff --git a/Lib/test/decimaltestdata/ddDivide.decTest b/Lib/test/decimaltestdata/ddDivide.decTest
index 5531d0e031..019db228d4 100644
--- a/Lib/test/decimaltestdata/ddDivide.decTest
+++ b/Lib/test/decimaltestdata/ddDivide.decTest
@@ -1,863 +1,863 @@
-------------------------------------------------------------------------
--- ddDivide.decTest -- decDouble division --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-dddiv001 divide 1 1 -> 1
-dddiv002 divide 2 1 -> 2
-dddiv003 divide 1 2 -> 0.5
-dddiv004 divide 2 2 -> 1
-dddiv005 divide 0 1 -> 0
-dddiv006 divide 0 2 -> 0
-dddiv007 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv008 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv009 divide 3 3 -> 1
-
-dddiv010 divide 2.4 1 -> 2.4
-dddiv011 divide 2.4 -1 -> -2.4
-dddiv012 divide -2.4 1 -> -2.4
-dddiv013 divide -2.4 -1 -> 2.4
-dddiv014 divide 2.40 1 -> 2.40
-dddiv015 divide 2.400 1 -> 2.400
-dddiv016 divide 2.4 2 -> 1.2
-dddiv017 divide 2.400 2 -> 1.200
-dddiv018 divide 2. 2 -> 1
-dddiv019 divide 20 20 -> 1
-
-dddiv020 divide 187 187 -> 1
-dddiv021 divide 5 2 -> 2.5
-dddiv022 divide 50 20 -> 2.5
-dddiv023 divide 500 200 -> 2.5
-dddiv024 divide 50.0 20.0 -> 2.5
-dddiv025 divide 5.00 2.00 -> 2.5
-dddiv026 divide 5 2.0 -> 2.5
-dddiv027 divide 5 2.000 -> 2.5
-dddiv028 divide 5 0.20 -> 25
-dddiv029 divide 5 0.200 -> 25
-dddiv030 divide 10 1 -> 10
-dddiv031 divide 100 1 -> 100
-dddiv032 divide 1000 1 -> 1000
-dddiv033 divide 1000 100 -> 10
-
-dddiv035 divide 1 2 -> 0.5
-dddiv036 divide 1 4 -> 0.25
-dddiv037 divide 1 8 -> 0.125
-dddiv038 divide 1 16 -> 0.0625
-dddiv039 divide 1 32 -> 0.03125
-dddiv040 divide 1 64 -> 0.015625
-dddiv041 divide 1 -2 -> -0.5
-dddiv042 divide 1 -4 -> -0.25
-dddiv043 divide 1 -8 -> -0.125
-dddiv044 divide 1 -16 -> -0.0625
-dddiv045 divide 1 -32 -> -0.03125
-dddiv046 divide 1 -64 -> -0.015625
-dddiv047 divide -1 2 -> -0.5
-dddiv048 divide -1 4 -> -0.25
-dddiv049 divide -1 8 -> -0.125
-dddiv050 divide -1 16 -> -0.0625
-dddiv051 divide -1 32 -> -0.03125
-dddiv052 divide -1 64 -> -0.015625
-dddiv053 divide -1 -2 -> 0.5
-dddiv054 divide -1 -4 -> 0.25
-dddiv055 divide -1 -8 -> 0.125
-dddiv056 divide -1 -16 -> 0.0625
-dddiv057 divide -1 -32 -> 0.03125
-dddiv058 divide -1 -64 -> 0.015625
-
--- bcdTime
-dddiv060 divide 1 7 -> 0.1428571428571429 Inexact Rounded
-dddiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717 Inexact Rounded
-
--- 1234567890123456
-dddiv071 divide 9999999999999999 1 -> 9999999999999999
-dddiv072 divide 999999999999999 1 -> 999999999999999
-dddiv073 divide 99999999999999 1 -> 99999999999999
-dddiv074 divide 9999999999999 1 -> 9999999999999
-dddiv075 divide 999999999999 1 -> 999999999999
-dddiv076 divide 99999999999 1 -> 99999999999
-dddiv077 divide 9999999999 1 -> 9999999999
-dddiv078 divide 999999999 1 -> 999999999
-dddiv079 divide 99999999 1 -> 99999999
-dddiv080 divide 9999999 1 -> 9999999
-dddiv081 divide 999999 1 -> 999999
-dddiv082 divide 99999 1 -> 99999
-dddiv083 divide 9999 1 -> 9999
-dddiv084 divide 999 1 -> 999
-dddiv085 divide 99 1 -> 99
-dddiv086 divide 9 1 -> 9
-
-dddiv090 divide 0. 1 -> 0
-dddiv091 divide .0 1 -> 0.0
-dddiv092 divide 0.00 1 -> 0.00
-dddiv093 divide 0.00E+9 1 -> 0E+7
-dddiv094 divide 0.0000E-50 1 -> 0E-54
-
-dddiv095 divide 1 1E-8 -> 1E+8
-dddiv096 divide 1 1E-9 -> 1E+9
-dddiv097 divide 1 1E-10 -> 1E+10
-dddiv098 divide 1 1E-11 -> 1E+11
-dddiv099 divide 1 1E-12 -> 1E+12
-
-dddiv100 divide 1 1 -> 1
-dddiv101 divide 1 2 -> 0.5
-dddiv102 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv103 divide 1 4 -> 0.25
-dddiv104 divide 1 5 -> 0.2
-dddiv105 divide 1 6 -> 0.1666666666666667 Inexact Rounded
-dddiv106 divide 1 7 -> 0.1428571428571429 Inexact Rounded
-dddiv107 divide 1 8 -> 0.125
-dddiv108 divide 1 9 -> 0.1111111111111111 Inexact Rounded
-dddiv109 divide 1 10 -> 0.1
-dddiv110 divide 1 1 -> 1
-dddiv111 divide 2 1 -> 2
-dddiv112 divide 3 1 -> 3
-dddiv113 divide 4 1 -> 4
-dddiv114 divide 5 1 -> 5
-dddiv115 divide 6 1 -> 6
-dddiv116 divide 7 1 -> 7
-dddiv117 divide 8 1 -> 8
-dddiv118 divide 9 1 -> 9
-dddiv119 divide 10 1 -> 10
-
-dddiv120 divide 3E+1 0.001 -> 3E+4
-dddiv121 divide 2.200 2 -> 1.100
-
-dddiv130 divide 12345 4.999 -> 2469.493898779756 Inexact Rounded
-dddiv131 divide 12345 4.99 -> 2473.947895791583 Inexact Rounded
-dddiv132 divide 12345 4.9 -> 2519.387755102041 Inexact Rounded
-dddiv133 divide 12345 5 -> 2469
-dddiv134 divide 12345 5.1 -> 2420.588235294118 Inexact Rounded
-dddiv135 divide 12345 5.01 -> 2464.071856287425 Inexact Rounded
-dddiv136 divide 12345 5.001 -> 2468.506298740252 Inexact Rounded
-
--- test possibly imprecise results
-dddiv220 divide 391 597 -> 0.6549413735343384 Inexact Rounded
-dddiv221 divide 391 -597 -> -0.6549413735343384 Inexact Rounded
-dddiv222 divide -391 597 -> -0.6549413735343384 Inexact Rounded
-dddiv223 divide -391 -597 -> 0.6549413735343384 Inexact Rounded
-
--- test some cases that are close to exponent overflow, some with coefficient padding
-dddiv270 divide 1 1e384 -> 1E-384 Subnormal
-dddiv271 divide 1 0.9e384 -> 1.11111111111111E-384 Rounded Inexact Subnormal Underflow
-dddiv272 divide 1 0.99e384 -> 1.01010101010101E-384 Rounded Inexact Subnormal Underflow
-dddiv273 divide 1 0.9999999999999999e384 -> 1.00000000000000E-384 Rounded Inexact Subnormal Underflow
-dddiv274 divide 9e384 1 -> 9.000000000000000E+384 Clamped
-dddiv275 divide 9.9e384 1 -> 9.900000000000000E+384 Clamped
-dddiv276 divide 9.99e384 1 -> 9.990000000000000E+384 Clamped
-dddiv277 divide 9.9999999999999e384 1 -> 9.999999999999900E+384 Clamped
-dddiv278 divide 9.99999999999999e384 1 -> 9.999999999999990E+384 Clamped
-dddiv279 divide 9.999999999999999e384 1 -> 9.999999999999999E+384
-
-dddiv285 divide 9.9e384 1.1 -> 9.000000000000000E+384 Clamped
-dddiv286 divide 9.99e384 1.1 -> 9.081818181818182E+384 Inexact Rounded
-dddiv287 divide 9.9999999999999e384 1.1 -> 9.090909090909000E+384 Clamped
-dddiv288 divide 9.99999999999999e384 1.1 -> 9.090909090909082E+384 Inexact Rounded
-dddiv289 divide 9.999999999999999e384 1.1 -> 9.090909090909090E+384 Clamped
-
-
--- Divide into 0 tests
-dddiv301 divide 0 7 -> 0
-dddiv302 divide 0 7E-5 -> 0E+5
-dddiv303 divide 0 7E-1 -> 0E+1
-dddiv304 divide 0 7E+1 -> 0.0
-dddiv305 divide 0 7E+5 -> 0.00000
-dddiv306 divide 0 7E+6 -> 0.000000
-dddiv307 divide 0 7E+7 -> 0E-7
-dddiv308 divide 0 70E-5 -> 0E+5
-dddiv309 divide 0 70E-1 -> 0E+1
-dddiv310 divide 0 70E+0 -> 0
-dddiv311 divide 0 70E+1 -> 0.0
-dddiv312 divide 0 70E+5 -> 0.00000
-dddiv313 divide 0 70E+6 -> 0.000000
-dddiv314 divide 0 70E+7 -> 0E-7
-dddiv315 divide 0 700E-5 -> 0E+5
-dddiv316 divide 0 700E-1 -> 0E+1
-dddiv317 divide 0 700E+0 -> 0
-dddiv318 divide 0 700E+1 -> 0.0
-dddiv319 divide 0 700E+5 -> 0.00000
-dddiv320 divide 0 700E+6 -> 0.000000
-dddiv321 divide 0 700E+7 -> 0E-7
-dddiv322 divide 0 700E+77 -> 0E-77
-
-dddiv331 divide 0E-3 7E-5 -> 0E+2
-dddiv332 divide 0E-3 7E-1 -> 0.00
-dddiv333 divide 0E-3 7E+1 -> 0.0000
-dddiv334 divide 0E-3 7E+5 -> 0E-8
-dddiv335 divide 0E-1 7E-5 -> 0E+4
-dddiv336 divide 0E-1 7E-1 -> 0
-dddiv337 divide 0E-1 7E+1 -> 0.00
-dddiv338 divide 0E-1 7E+5 -> 0.000000
-dddiv339 divide 0E+1 7E-5 -> 0E+6
-dddiv340 divide 0E+1 7E-1 -> 0E+2
-dddiv341 divide 0E+1 7E+1 -> 0
-dddiv342 divide 0E+1 7E+5 -> 0.0000
-dddiv343 divide 0E+3 7E-5 -> 0E+8
-dddiv344 divide 0E+3 7E-1 -> 0E+4
-dddiv345 divide 0E+3 7E+1 -> 0E+2
-dddiv346 divide 0E+3 7E+5 -> 0.00
-
--- These were 'input rounding'
-dddiv441 divide 12345678000 1 -> 12345678000
-dddiv442 divide 1 12345678000 -> 8.100000664200054E-11 Inexact Rounded
-dddiv443 divide 1234567800 1 -> 1234567800
-dddiv444 divide 1 1234567800 -> 8.100000664200054E-10 Inexact Rounded
-dddiv445 divide 1234567890 1 -> 1234567890
-dddiv446 divide 1 1234567890 -> 8.100000073710001E-10 Inexact Rounded
-dddiv447 divide 1234567891 1 -> 1234567891
-dddiv448 divide 1 1234567891 -> 8.100000067149001E-10 Inexact Rounded
-dddiv449 divide 12345678901 1 -> 12345678901
-dddiv450 divide 1 12345678901 -> 8.100000073053901E-11 Inexact Rounded
-dddiv451 divide 1234567896 1 -> 1234567896
-dddiv452 divide 1 1234567896 -> 8.100000034344000E-10 Inexact Rounded
-
--- high-lows
-dddiv453 divide 1e+1 1 -> 1E+1
-dddiv454 divide 1e+1 1.0 -> 1E+1
-dddiv455 divide 1e+1 1.00 -> 1E+1
-dddiv456 divide 1e+2 2 -> 5E+1
-dddiv457 divide 1e+2 2.0 -> 5E+1
-dddiv458 divide 1e+2 2.00 -> 5E+1
-
--- some from IEEE discussions
-dddiv460 divide 3e0 2e0 -> 1.5
-dddiv461 divide 30e-1 2e0 -> 1.5
-dddiv462 divide 300e-2 2e0 -> 1.50
-dddiv464 divide 3000e-3 2e0 -> 1.500
-dddiv465 divide 3e0 20e-1 -> 1.5
-dddiv466 divide 30e-1 20e-1 -> 1.5
-dddiv467 divide 300e-2 20e-1 -> 1.5
-dddiv468 divide 3000e-3 20e-1 -> 1.50
-dddiv469 divide 3e0 200e-2 -> 1.5
-dddiv470 divide 30e-1 200e-2 -> 1.5
-dddiv471 divide 300e-2 200e-2 -> 1.5
-dddiv472 divide 3000e-3 200e-2 -> 1.5
-dddiv473 divide 3e0 2000e-3 -> 1.5
-dddiv474 divide 30e-1 2000e-3 -> 1.5
-dddiv475 divide 300e-2 2000e-3 -> 1.5
-dddiv476 divide 3000e-3 2000e-3 -> 1.5
-
--- some reciprocals
-dddiv480 divide 1 1.0E+33 -> 1E-33
-dddiv481 divide 1 10E+33 -> 1E-34
-dddiv482 divide 1 1.0E-33 -> 1E+33
-dddiv483 divide 1 10E-33 -> 1E+32
-
--- RMS discussion table
-dddiv484 divide 0e5 1e3 -> 0E+2
-dddiv485 divide 0e5 2e3 -> 0E+2
-dddiv486 divide 0e5 10e2 -> 0E+3
-dddiv487 divide 0e5 20e2 -> 0E+3
-dddiv488 divide 0e5 100e1 -> 0E+4
-dddiv489 divide 0e5 200e1 -> 0E+4
-
-dddiv491 divide 1e5 1e3 -> 1E+2
-dddiv492 divide 1e5 2e3 -> 5E+1
-dddiv493 divide 1e5 10e2 -> 1E+2
-dddiv494 divide 1e5 20e2 -> 5E+1
-dddiv495 divide 1e5 100e1 -> 1E+2
-dddiv496 divide 1e5 200e1 -> 5E+1
-
--- tryzeros cases
-rounding: half_up
-dddiv497 divide 0E+380 1000E-13 -> 0E+369 Clamped
-dddiv498 divide 0E-390 1000E+13 -> 0E-398 Clamped
-
-rounding: half_up
-
--- focus on trailing zeros issues
-dddiv500 divide 1 9.9 -> 0.1010101010101010 Inexact Rounded
-dddiv501 divide 1 9.09 -> 0.1100110011001100 Inexact Rounded
-dddiv502 divide 1 9.009 -> 0.1110001110001110 Inexact Rounded
-
-dddiv511 divide 1 2 -> 0.5
-dddiv512 divide 1.0 2 -> 0.5
-dddiv513 divide 1.00 2 -> 0.50
-dddiv514 divide 1.000 2 -> 0.500
-dddiv515 divide 1.0000 2 -> 0.5000
-dddiv516 divide 1.00000 2 -> 0.50000
-dddiv517 divide 1.000000 2 -> 0.500000
-dddiv518 divide 1.0000000 2 -> 0.5000000
-dddiv519 divide 1.00 2.00 -> 0.5
-
-dddiv521 divide 2 1 -> 2
-dddiv522 divide 2 1.0 -> 2
-dddiv523 divide 2 1.00 -> 2
-dddiv524 divide 2 1.000 -> 2
-dddiv525 divide 2 1.0000 -> 2
-dddiv526 divide 2 1.00000 -> 2
-dddiv527 divide 2 1.000000 -> 2
-dddiv528 divide 2 1.0000000 -> 2
-dddiv529 divide 2.00 1.00 -> 2
-
-dddiv530 divide 2.40 2 -> 1.20
-dddiv531 divide 2.40 4 -> 0.60
-dddiv532 divide 2.40 10 -> 0.24
-dddiv533 divide 2.40 2.0 -> 1.2
-dddiv534 divide 2.40 4.0 -> 0.6
-dddiv535 divide 2.40 10.0 -> 0.24
-dddiv536 divide 2.40 2.00 -> 1.2
-dddiv537 divide 2.40 4.00 -> 0.6
-dddiv538 divide 2.40 10.00 -> 0.24
-dddiv539 divide 0.9 0.1 -> 9
-dddiv540 divide 0.9 0.01 -> 9E+1
-dddiv541 divide 0.9 0.001 -> 9E+2
-dddiv542 divide 5 2 -> 2.5
-dddiv543 divide 5 2.0 -> 2.5
-dddiv544 divide 5 2.00 -> 2.5
-dddiv545 divide 5 20 -> 0.25
-dddiv546 divide 5 20.0 -> 0.25
-dddiv547 divide 2.400 2 -> 1.200
-dddiv548 divide 2.400 2.0 -> 1.20
-dddiv549 divide 2.400 2.400 -> 1
-
-dddiv550 divide 240 1 -> 240
-dddiv551 divide 240 10 -> 24
-dddiv552 divide 240 100 -> 2.4
-dddiv553 divide 240 1000 -> 0.24
-dddiv554 divide 2400 1 -> 2400
-dddiv555 divide 2400 10 -> 240
-dddiv556 divide 2400 100 -> 24
-dddiv557 divide 2400 1000 -> 2.4
-
--- +ve exponent
-dddiv600 divide 2.4E+9 2 -> 1.2E+9
-dddiv601 divide 2.40E+9 2 -> 1.20E+9
-dddiv602 divide 2.400E+9 2 -> 1.200E+9
-dddiv603 divide 2.4000E+9 2 -> 1.2000E+9
-dddiv604 divide 24E+8 2 -> 1.2E+9
-dddiv605 divide 240E+7 2 -> 1.20E+9
-dddiv606 divide 2400E+6 2 -> 1.200E+9
-dddiv607 divide 24000E+5 2 -> 1.2000E+9
-
--- more zeros, etc.
-dddiv731 divide 5.00 1E-3 -> 5.00E+3
-dddiv732 divide 00.00 0.000 -> NaN Division_undefined
-dddiv733 divide 00.00 0E-3 -> NaN Division_undefined
-dddiv734 divide 0 -0 -> NaN Division_undefined
-dddiv735 divide -0 0 -> NaN Division_undefined
-dddiv736 divide -0 -0 -> NaN Division_undefined
-
-dddiv741 divide 0 -1 -> -0
-dddiv742 divide -0 -1 -> 0
-dddiv743 divide 0 1 -> 0
-dddiv744 divide -0 1 -> -0
-dddiv745 divide -1 0 -> -Infinity Division_by_zero
-dddiv746 divide -1 -0 -> Infinity Division_by_zero
-dddiv747 divide 1 0 -> Infinity Division_by_zero
-dddiv748 divide 1 -0 -> -Infinity Division_by_zero
-
-dddiv751 divide 0.0 -1 -> -0.0
-dddiv752 divide -0.0 -1 -> 0.0
-dddiv753 divide 0.0 1 -> 0.0
-dddiv754 divide -0.0 1 -> -0.0
-dddiv755 divide -1.0 0 -> -Infinity Division_by_zero
-dddiv756 divide -1.0 -0 -> Infinity Division_by_zero
-dddiv757 divide 1.0 0 -> Infinity Division_by_zero
-dddiv758 divide 1.0 -0 -> -Infinity Division_by_zero
-
-dddiv761 divide 0 -1.0 -> -0E+1
-dddiv762 divide -0 -1.0 -> 0E+1
-dddiv763 divide 0 1.0 -> 0E+1
-dddiv764 divide -0 1.0 -> -0E+1
-dddiv765 divide -1 0.0 -> -Infinity Division_by_zero
-dddiv766 divide -1 -0.0 -> Infinity Division_by_zero
-dddiv767 divide 1 0.0 -> Infinity Division_by_zero
-dddiv768 divide 1 -0.0 -> -Infinity Division_by_zero
-
-dddiv771 divide 0.0 -1.0 -> -0
-dddiv772 divide -0.0 -1.0 -> 0
-dddiv773 divide 0.0 1.0 -> 0
-dddiv774 divide -0.0 1.0 -> -0
-dddiv775 divide -1.0 0.0 -> -Infinity Division_by_zero
-dddiv776 divide -1.0 -0.0 -> Infinity Division_by_zero
-dddiv777 divide 1.0 0.0 -> Infinity Division_by_zero
-dddiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero
-
--- Specials
-dddiv780 divide Inf -Inf -> NaN Invalid_operation
-dddiv781 divide Inf -1000 -> -Infinity
-dddiv782 divide Inf -1 -> -Infinity
-dddiv783 divide Inf -0 -> -Infinity
-dddiv784 divide Inf 0 -> Infinity
-dddiv785 divide Inf 1 -> Infinity
-dddiv786 divide Inf 1000 -> Infinity
-dddiv787 divide Inf Inf -> NaN Invalid_operation
-dddiv788 divide -1000 Inf -> -0E-398 Clamped
-dddiv789 divide -Inf Inf -> NaN Invalid_operation
-dddiv790 divide -1 Inf -> -0E-398 Clamped
-dddiv791 divide -0 Inf -> -0E-398 Clamped
-dddiv792 divide 0 Inf -> 0E-398 Clamped
-dddiv793 divide 1 Inf -> 0E-398 Clamped
-dddiv794 divide 1000 Inf -> 0E-398 Clamped
-dddiv795 divide Inf Inf -> NaN Invalid_operation
-
-dddiv800 divide -Inf -Inf -> NaN Invalid_operation
-dddiv801 divide -Inf -1000 -> Infinity
-dddiv802 divide -Inf -1 -> Infinity
-dddiv803 divide -Inf -0 -> Infinity
-dddiv804 divide -Inf 0 -> -Infinity
-dddiv805 divide -Inf 1 -> -Infinity
-dddiv806 divide -Inf 1000 -> -Infinity
-dddiv807 divide -Inf Inf -> NaN Invalid_operation
-dddiv808 divide -1000 Inf -> -0E-398 Clamped
-dddiv809 divide -Inf -Inf -> NaN Invalid_operation
-dddiv810 divide -1 -Inf -> 0E-398 Clamped
-dddiv811 divide -0 -Inf -> 0E-398 Clamped
-dddiv812 divide 0 -Inf -> -0E-398 Clamped
-dddiv813 divide 1 -Inf -> -0E-398 Clamped
-dddiv814 divide 1000 -Inf -> -0E-398 Clamped
-dddiv815 divide Inf -Inf -> NaN Invalid_operation
-
-dddiv821 divide NaN -Inf -> NaN
-dddiv822 divide NaN -1000 -> NaN
-dddiv823 divide NaN -1 -> NaN
-dddiv824 divide NaN -0 -> NaN
-dddiv825 divide NaN 0 -> NaN
-dddiv826 divide NaN 1 -> NaN
-dddiv827 divide NaN 1000 -> NaN
-dddiv828 divide NaN Inf -> NaN
-dddiv829 divide NaN NaN -> NaN
-dddiv830 divide -Inf NaN -> NaN
-dddiv831 divide -1000 NaN -> NaN
-dddiv832 divide -1 NaN -> NaN
-dddiv833 divide -0 NaN -> NaN
-dddiv834 divide 0 NaN -> NaN
-dddiv835 divide 1 NaN -> NaN
-dddiv836 divide 1000 NaN -> NaN
-dddiv837 divide Inf NaN -> NaN
-
-dddiv841 divide sNaN -Inf -> NaN Invalid_operation
-dddiv842 divide sNaN -1000 -> NaN Invalid_operation
-dddiv843 divide sNaN -1 -> NaN Invalid_operation
-dddiv844 divide sNaN -0 -> NaN Invalid_operation
-dddiv845 divide sNaN 0 -> NaN Invalid_operation
-dddiv846 divide sNaN 1 -> NaN Invalid_operation
-dddiv847 divide sNaN 1000 -> NaN Invalid_operation
-dddiv848 divide sNaN NaN -> NaN Invalid_operation
-dddiv849 divide sNaN sNaN -> NaN Invalid_operation
-dddiv850 divide NaN sNaN -> NaN Invalid_operation
-dddiv851 divide -Inf sNaN -> NaN Invalid_operation
-dddiv852 divide -1000 sNaN -> NaN Invalid_operation
-dddiv853 divide -1 sNaN -> NaN Invalid_operation
-dddiv854 divide -0 sNaN -> NaN Invalid_operation
-dddiv855 divide 0 sNaN -> NaN Invalid_operation
-dddiv856 divide 1 sNaN -> NaN Invalid_operation
-dddiv857 divide 1000 sNaN -> NaN Invalid_operation
-dddiv858 divide Inf sNaN -> NaN Invalid_operation
-dddiv859 divide NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dddiv861 divide NaN9 -Inf -> NaN9
-dddiv862 divide NaN8 1000 -> NaN8
-dddiv863 divide NaN7 Inf -> NaN7
-dddiv864 divide NaN6 NaN5 -> NaN6
-dddiv865 divide -Inf NaN4 -> NaN4
-dddiv866 divide -1000 NaN3 -> NaN3
-dddiv867 divide Inf NaN2 -> NaN2
-
-dddiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation
-dddiv872 divide sNaN98 -1 -> NaN98 Invalid_operation
-dddiv873 divide sNaN97 NaN -> NaN97 Invalid_operation
-dddiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
-dddiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
-dddiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation
-dddiv877 divide 0 sNaN91 -> NaN91 Invalid_operation
-dddiv878 divide Inf sNaN90 -> NaN90 Invalid_operation
-dddiv879 divide NaN sNaN89 -> NaN89 Invalid_operation
-
-dddiv881 divide -NaN9 -Inf -> -NaN9
-dddiv882 divide -NaN8 1000 -> -NaN8
-dddiv883 divide -NaN7 Inf -> -NaN7
-dddiv884 divide -NaN6 -NaN5 -> -NaN6
-dddiv885 divide -Inf -NaN4 -> -NaN4
-dddiv886 divide -1000 -NaN3 -> -NaN3
-dddiv887 divide Inf -NaN2 -> -NaN2
-
-dddiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
-dddiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
-dddiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
-dddiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
-dddiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-dddiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
-dddiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
-dddiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
-dddiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- Various flavours of divide by 0
-dddiv901 divide 0 0 -> NaN Division_undefined
-dddiv902 divide 0.0E5 0 -> NaN Division_undefined
-dddiv903 divide 0.000 0 -> NaN Division_undefined
-dddiv904 divide 0.0001 0 -> Infinity Division_by_zero
-dddiv905 divide 0.01 0 -> Infinity Division_by_zero
-dddiv906 divide 0.1 0 -> Infinity Division_by_zero
-dddiv907 divide 1 0 -> Infinity Division_by_zero
-dddiv908 divide 1 0.0 -> Infinity Division_by_zero
-dddiv909 divide 10 0.0 -> Infinity Division_by_zero
-dddiv910 divide 1E+100 0.0 -> Infinity Division_by_zero
-dddiv911 divide 1E+100 0 -> Infinity Division_by_zero
-
-dddiv921 divide -0.0001 0 -> -Infinity Division_by_zero
-dddiv922 divide -0.01 0 -> -Infinity Division_by_zero
-dddiv923 divide -0.1 0 -> -Infinity Division_by_zero
-dddiv924 divide -1 0 -> -Infinity Division_by_zero
-dddiv925 divide -1 0.0 -> -Infinity Division_by_zero
-dddiv926 divide -10 0.0 -> -Infinity Division_by_zero
-dddiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero
-dddiv928 divide -1E+100 0 -> -Infinity Division_by_zero
-
-dddiv931 divide 0.0001 -0 -> -Infinity Division_by_zero
-dddiv932 divide 0.01 -0 -> -Infinity Division_by_zero
-dddiv933 divide 0.1 -0 -> -Infinity Division_by_zero
-dddiv934 divide 1 -0 -> -Infinity Division_by_zero
-dddiv935 divide 1 -0.0 -> -Infinity Division_by_zero
-dddiv936 divide 10 -0.0 -> -Infinity Division_by_zero
-dddiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
-dddiv938 divide 1E+100 -0 -> -Infinity Division_by_zero
-
-dddiv941 divide -0.0001 -0 -> Infinity Division_by_zero
-dddiv942 divide -0.01 -0 -> Infinity Division_by_zero
-dddiv943 divide -0.1 -0 -> Infinity Division_by_zero
-dddiv944 divide -1 -0 -> Infinity Division_by_zero
-dddiv945 divide -1 -0.0 -> Infinity Division_by_zero
-dddiv946 divide -10 -0.0 -> Infinity Division_by_zero
-dddiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero
-dddiv948 divide -1E+100 -0 -> Infinity Division_by_zero
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dddiv1021 divide 1E0 1E0 -> 1
-dddiv1022 divide 1E0 2E0 -> 0.5
-dddiv1023 divide 1E0 3E0 -> 0.3333333333333333 Inexact Rounded
-dddiv1024 divide 100E-2 1000E-3 -> 1
-dddiv1025 divide 24E-1 2E0 -> 1.2
-dddiv1026 divide 2400E-3 2E0 -> 1.200
-dddiv1027 divide 5E0 2E0 -> 2.5
-dddiv1028 divide 5E0 20E-1 -> 2.5
-dddiv1029 divide 5E0 2000E-3 -> 2.5
-dddiv1030 divide 5E0 2E-1 -> 25
-dddiv1031 divide 5E0 20E-2 -> 25
-dddiv1032 divide 480E-2 3E0 -> 1.60
-dddiv1033 divide 47E-1 2E0 -> 2.35
-
--- ECMAScript bad examples
-rounding: half_down
-dddiv1040 divide 5 9 -> 0.5555555555555556 Inexact Rounded
-rounding: half_even
-dddiv1041 divide 6 11 -> 0.5454545454545455 Inexact Rounded
-
--- overflow and underflow tests .. note subnormal results
--- signs
-dddiv1051 divide 1e+277 1e-311 -> Infinity Overflow Inexact Rounded
-dddiv1052 divide 1e+277 -1e-311 -> -Infinity Overflow Inexact Rounded
-dddiv1053 divide -1e+277 1e-311 -> -Infinity Overflow Inexact Rounded
-dddiv1054 divide -1e+277 -1e-311 -> Infinity Overflow Inexact Rounded
-dddiv1055 divide 1e-277 1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1056 divide 1e-277 -1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1057 divide -1e-277 1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1058 divide -1e-277 -1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dddiv1060 divide 1e-291 1e+101 -> 1E-392 Subnormal
-dddiv1061 divide 1e-291 1e+102 -> 1E-393 Subnormal
-dddiv1062 divide 1e-291 1e+103 -> 1E-394 Subnormal
-dddiv1063 divide 1e-291 1e+104 -> 1E-395 Subnormal
-dddiv1064 divide 1e-291 1e+105 -> 1E-396 Subnormal
-dddiv1065 divide 1e-291 1e+106 -> 1E-397 Subnormal
-dddiv1066 divide 1e-291 1e+107 -> 1E-398 Subnormal
-dddiv1067 divide 1e-291 1e+108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1068 divide 1e-291 1e+109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1069 divide 1e-291 1e+110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-dddiv1070 divide 1e+60 1e-321 -> 1.000000000000E+381 Clamped
-dddiv1071 divide 1e+60 1e-322 -> 1.0000000000000E+382 Clamped
-dddiv1072 divide 1e+60 1e-323 -> 1.00000000000000E+383 Clamped
-dddiv1073 divide 1e+60 1e-324 -> 1.000000000000000E+384 Clamped
-dddiv1074 divide 1e+60 1e-325 -> Infinity Overflow Inexact Rounded
-dddiv1075 divide 1e+60 1e-326 -> Infinity Overflow Inexact Rounded
-dddiv1076 divide 1e+60 1e-327 -> Infinity Overflow Inexact Rounded
-dddiv1077 divide 1e+60 1e-328 -> Infinity Overflow Inexact Rounded
-dddiv1078 divide 1e+60 1e-329 -> Infinity Overflow Inexact Rounded
-dddiv1079 divide 1e+60 1e-330 -> Infinity Overflow Inexact Rounded
-
-dddiv1101 divide 1.0000E-394 1 -> 1.0000E-394 Subnormal
-dddiv1102 divide 1.000E-394 1e+1 -> 1.000E-395 Subnormal
-dddiv1103 divide 1.00E-394 1e+2 -> 1.00E-396 Subnormal
-dddiv1104 divide 1.0E-394 1e+3 -> 1.0E-397 Subnormal
-dddiv1105 divide 1.0E-394 1e+4 -> 1E-398 Subnormal Rounded
-dddiv1106 divide 1.3E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
-dddiv1107 divide 1.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1108 divide 1.7E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1109 divide 2.3E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1110 divide 2.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1111 divide 2.7E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
-dddiv1112 divide 1.49E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
-dddiv1113 divide 1.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1114 divide 1.51E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1115 divide 2.49E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1116 divide 2.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
-dddiv1117 divide 2.51E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
-
-dddiv1118 divide 1E-394 1e+4 -> 1E-398 Subnormal
-dddiv1119 divide 3E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1120 divide 5E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1121 divide 7E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
-dddiv1122 divide 9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
-dddiv1123 divide 9.9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
-
-dddiv1124 divide 1E-394 -1e+4 -> -1E-398 Subnormal
-dddiv1125 divide 3E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1126 divide -5E-394 1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1127 divide 7E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
-dddiv1128 divide -9E-394 1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
-dddiv1129 divide 9.9E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
-dddiv1130 divide 3.0E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-dddiv1131 divide 1.0E-199 1e+200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-dddiv1132 divide 1.0E-199 1e+199 -> 1E-398 Subnormal Rounded
-dddiv1133 divide 1.0E-199 1e+198 -> 1.0E-397 Subnormal
-dddiv1134 divide 2.0E-199 2e+198 -> 1.0E-397 Subnormal
-dddiv1135 divide 4.0E-199 4e+198 -> 1.0E-397 Subnormal
-dddiv1136 divide 10.0E-199 10e+198 -> 1.0E-397 Subnormal
-dddiv1137 divide 30.0E-199 30e+198 -> 1.0E-397 Subnormal
-
--- randoms
-dddiv2010 divide -3.303226714900711E-35 8.796578842713183E+73 -> -3.755126594058783E-109 Inexact Rounded
-dddiv2011 divide 933153327821073.6 68782181090246.25 -> 13.56678885475763 Inexact Rounded
-dddiv2012 divide 5.04752436057906E-72 -8.179481771238642E+64 -> -6.170958627632835E-137 Inexact Rounded
-dddiv2013 divide -3707613309582318 3394911196503.048 -> -1092.109070010836 Inexact Rounded
-dddiv2014 divide 99689.0555190461 -4.735208553891464 -> -21052.72753765411 Inexact Rounded
-dddiv2015 divide -1447915775613329 269750797.8184875 -> -5367605.164925653 Inexact Rounded
-dddiv2016 divide -9.394881304225258E-19 -830585.0252671636 -> 1.131116143251358E-24 Inexact Rounded
-dddiv2017 divide -1.056283432738934 88.58754555124013 -> -0.01192361100159352 Inexact Rounded
-dddiv2018 divide 5763220933343.081 689089567025052.1 -> 0.008363529516524456 Inexact Rounded
-dddiv2019 divide 873819.122103216 9.740612494523300E-49 -> 8.970884763093948E+53 Inexact Rounded
-dddiv2020 divide 8022914.838533576 6178.566801742713 -> 1298.507420243583 Inexact Rounded
-dddiv2021 divide 203982.7605650363 -2158.283639053435 -> -94.51156320422168 Inexact Rounded
-dddiv2022 divide 803.6310547013030 7101143795399.238 -> 1.131692411611166E-10 Inexact Rounded
-dddiv2023 divide 9.251697842123399E-82 -1.342350220606119E-7 -> -6.892163982321936E-75 Inexact Rounded
-dddiv2024 divide -1.980600645637992E-53 -5.474262753214457E+77 -> 3.618022617703168E-131 Inexact Rounded
-dddiv2025 divide -210.0322996351690 -8.580951835872843E+80 -> 2.447657365434971E-79 Inexact Rounded
-dddiv2026 divide -1.821980314020370E+85 -3.018915267138165 -> 6.035215144503042E+84 Inexact Rounded
-dddiv2027 divide -772264503601.1047 5.158258271408988E-86 -> -1.497141986630614E+97 Inexact Rounded
-dddiv2028 divide -767.0532415847106 2.700027228028939E-59 -> -2.840909282772941E+61 Inexact Rounded
-dddiv2029 divide 496724.8548250093 7.32700588163100E+66 -> 6.779370220929013E-62 Inexact Rounded
-dddiv2030 divide -304232651447703.9 -108.9730808657440 -> 2791814721862.565 Inexact Rounded
-dddiv2031 divide -7.233817192699405E+42 -5711302004.149411 -> 1.266579352211430E+33 Inexact Rounded
-dddiv2032 divide -9.999221444912745E+96 4010569406446197 -> -2.493217404202250E+81 Inexact Rounded
-dddiv2033 divide -1837272.061937622 8.356322838066762 -> -219866.0939196882 Inexact Rounded
-dddiv2034 divide 2168.517555606529 209.1910258615061 -> 10.36620737756784 Inexact Rounded
-dddiv2035 divide -1.884389790576371E+88 2.95181953870583E+20 -> -6.383824505079828E+67 Inexact Rounded
-dddiv2036 divide 732263.6037438196 961222.3634446889 -> 0.7618045850698269 Inexact Rounded
-dddiv2037 divide -813461419.0348336 5.376293753809143E+84 -> -1.513052404285927E-76 Inexact Rounded
-dddiv2038 divide -45562133508108.50 -9.776843494690107E+51 -> 4.660208945029519E-39 Inexact Rounded
-dddiv2039 divide -6.489393172441016E+80 -9101965.097852113 -> 7.129661674897421E+73 Inexact Rounded
-dddiv2040 divide 3.694576237117349E+93 6683512.012622003 -> 5.527896456443912E+86 Inexact Rounded
-dddiv2041 divide -2.252877726403272E+19 -7451913256.181367 -> 3023220546.125531 Inexact Rounded
-dddiv2042 divide 518303.1989111842 50.01587020474133 -> 10362.77479107123 Inexact Rounded
-dddiv2043 divide 2.902087881880103E+24 33.32400992305702 -> 8.708699488989578E+22 Inexact Rounded
-dddiv2044 divide 549619.4559510557 1660824845196338 -> 3.309316196351104E-10 Inexact Rounded
-dddiv2045 divide -6775670774684043 8292152023.077262 -> -817118.4941891062 Inexact Rounded
-dddiv2046 divide -77.50923921524079 -5.636882655425815E+74 -> 1.375037302588405E-73 Inexact Rounded
-dddiv2047 divide -2.984889459605149E-10 -88106156784122.99 -> 3.387833005721384E-24 Inexact Rounded
-dddiv2048 divide 0.949517293997085 44767115.96450998 -> 2.121015110175589E-8 Inexact Rounded
-dddiv2049 divide -2760937211.084521 -1087015876975408 -> 0.000002539923537057024 Inexact Rounded
-dddiv2050 divide 28438351.85030536 -4.209397904088624E-47 -> -6.755919135770688E+53 Inexact Rounded
-dddiv2051 divide -85562731.6820956 -7.166045442530185E+45 -> 1.194002080621542E-38 Inexact Rounded
-dddiv2052 divide 2533802852165.25 7154.119606235955 -> 354173957.3317501 Inexact Rounded
-dddiv2053 divide -8858831346851.474 97.59734208801716 -> -90769186509.83577 Inexact Rounded
-dddiv2054 divide 176783629801387.5 840073263.3109817 -> 210438.3480848206 Inexact Rounded
-dddiv2055 divide -493506471796175.6 79733894790822.03 -> -6.189418854940746 Inexact Rounded
-dddiv2056 divide 790.1682542103445 829.9449370367435 -> 0.9520731062371214 Inexact Rounded
-dddiv2057 divide -8920459838.583164 -4767.889187899214 -> 1870945.294035581 Inexact Rounded
-dddiv2058 divide 53536687164422.1 53137.5007032689 -> 1007512330.385698 Inexact Rounded
-dddiv2059 divide 4.051532311146561E-74 -2.343089768972261E+94 -> -1.729140882606332E-168 Inexact Rounded
-dddiv2060 divide -14847758778636.88 3.062543516383807E-43 -> -4.848178874587497E+55 Inexact Rounded
-
--- Division probably has pre-rounding, so need to test rounding
--- explicitly rather than assume included through other tests;
--- tests include simple rounding and also the tricky cases of sticky
--- bits following two zeros
---
--- 1/99999 gives 0.0000100001000010000100001000010000100001
--- 1234567890123456
---
--- 1/999999 gives 0.000001000001000001000001000001000001000001
--- 1234567890123456
-
-rounding: ceiling
-dddiv3001 divide 1 3 -> 0.3333333333333334 Inexact Rounded
-dddiv3002 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3003 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
-dddiv3004 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
-
-rounding: floor
-dddiv3011 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3012 divide 2 3 -> 0.6666666666666666 Inexact Rounded
-dddiv3013 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3014 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: up
-dddiv3021 divide 1 3 -> 0.3333333333333334 Inexact Rounded
-dddiv3022 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3023 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
-dddiv3024 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
-
-rounding: down
-dddiv3031 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3032 divide 2 3 -> 0.6666666666666666 Inexact Rounded
-dddiv3033 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3034 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: half_up
-dddiv3041 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3042 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3043 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3044 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: half_down
-dddiv3051 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3052 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3053 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3054 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: half_even
-dddiv3061 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3062 divide 2 3 -> 0.6666666666666667 Inexact Rounded
-dddiv3063 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3064 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
-
-rounding: 05up
-dddiv3071 divide 1 3 -> 0.3333333333333333 Inexact Rounded
-dddiv3072 divide 2 3 -> 0.6666666666666666 Inexact Rounded
-dddiv3073 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
-dddiv3074 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
-
--- random divide tests with result near 1
-rounding: half_even
-dddiv4001 divide 3195385192916917 3195385192946695 -> 0.9999999999906809 Inexact Rounded
-dddiv4002 divide 1393723067526993 1393723067519475 -> 1.000000000005394 Inexact Rounded
-dddiv4003 divide 759985543702302 759985543674015 -> 1.000000000037220 Inexact Rounded
-dddiv4004 divide 9579158456027302 9579158456036864 -> 0.9999999999990018 Inexact Rounded
-dddiv4005 divide 7079398299143569 7079398299156904 -> 0.9999999999981164 Inexact Rounded
-dddiv4006 divide 6636169255366598 6636169255336386 -> 1.000000000004553 Inexact Rounded
-dddiv4007 divide 6964813971340090 6964813971321554 -> 1.000000000002661 Inexact Rounded
-dddiv4008 divide 4182275225480784 4182275225454009 -> 1.000000000006402 Inexact Rounded
-dddiv4009 divide 9228325124938029 9228325124918730 -> 1.000000000002091 Inexact Rounded
-dddiv4010 divide 3428346338630192 3428346338609843 -> 1.000000000005936 Inexact Rounded
-dddiv4011 divide 2143511550722893 2143511550751754 -> 0.9999999999865356 Inexact Rounded
-dddiv4012 divide 1672732924396785 1672732924401811 -> 0.9999999999969953 Inexact Rounded
-dddiv4013 divide 4190714611948216 4190714611948664 -> 0.9999999999998931 Inexact Rounded
-dddiv4014 divide 3942254800848877 3942254800814556 -> 1.000000000008706 Inexact Rounded
-dddiv4015 divide 2854459826952334 2854459826960762 -> 0.9999999999970474 Inexact Rounded
-dddiv4016 divide 2853258953664731 2853258953684471 -> 0.9999999999930816 Inexact Rounded
-dddiv4017 divide 9453512638125978 9453512638146425 -> 0.9999999999978371 Inexact Rounded
-dddiv4018 divide 339476633940369 339476633912887 -> 1.000000000080954 Inexact Rounded
-dddiv4019 divide 4542181492688467 4542181492697735 -> 0.9999999999979596 Inexact Rounded
-dddiv4020 divide 7312600192399197 7312600192395424 -> 1.000000000000516 Inexact Rounded
-dddiv4021 divide 1811674985570111 1811674985603935 -> 0.9999999999813300 Inexact Rounded
-dddiv4022 divide 1706462639003481 1706462639017740 -> 0.9999999999916441 Inexact Rounded
-dddiv4023 divide 6697052654940368 6697052654934110 -> 1.000000000000934 Inexact Rounded
-dddiv4024 divide 5015283664277539 5015283664310719 -> 0.9999999999933842 Inexact Rounded
-dddiv4025 divide 2359501561537464 2359501561502464 -> 1.000000000014834 Inexact Rounded
-dddiv4026 divide 2669850227909157 2669850227901548 -> 1.000000000002850 Inexact Rounded
-dddiv4027 divide 9329725546974648 9329725547002445 -> 0.9999999999970206 Inexact Rounded
-dddiv4028 divide 3228562867071248 3228562867106206 -> 0.9999999999891723 Inexact Rounded
-dddiv4029 divide 4862226644921175 4862226644909380 -> 1.000000000002426 Inexact Rounded
-dddiv4030 divide 1022267997054529 1022267997071329 -> 0.9999999999835660 Inexact Rounded
-dddiv4031 divide 1048777482023719 1048777482000948 -> 1.000000000021712 Inexact Rounded
-dddiv4032 divide 9980113777337098 9980113777330539 -> 1.000000000000657 Inexact Rounded
-dddiv4033 divide 7506839167963908 7506839167942901 -> 1.000000000002798 Inexact Rounded
-dddiv4034 divide 231119751977860 231119751962453 -> 1.000000000066662 Inexact Rounded
-dddiv4035 divide 4034903664762962 4034903664795526 -> 0.9999999999919294 Inexact Rounded
-dddiv4036 divide 5700122152274696 5700122152251386 -> 1.000000000004089 Inexact Rounded
-dddiv4037 divide 6869599590293110 6869599590293495 -> 0.9999999999999440 Inexact Rounded
-dddiv4038 divide 5576281960092797 5576281960105579 -> 0.9999999999977078 Inexact Rounded
-dddiv4039 divide 2304844888381318 2304844888353073 -> 1.000000000012255 Inexact Rounded
-dddiv4040 divide 3265933651656452 3265933651682779 -> 0.9999999999919389 Inexact Rounded
-dddiv4041 divide 5235714985079914 5235714985066131 -> 1.000000000002632 Inexact Rounded
-dddiv4042 divide 5578481572827551 5578481572822945 -> 1.000000000000826 Inexact Rounded
-dddiv4043 divide 4909616081396134 4909616081373076 -> 1.000000000004696 Inexact Rounded
-dddiv4044 divide 636447224349537 636447224338757 -> 1.000000000016938 Inexact Rounded
-dddiv4045 divide 1539373428396640 1539373428364727 -> 1.000000000020731 Inexact Rounded
-dddiv4046 divide 2028786707377893 2028786707378866 -> 0.9999999999995204 Inexact Rounded
-dddiv4047 divide 137643260486222 137643260487419 -> 0.9999999999913036 Inexact Rounded
-dddiv4048 divide 247451519746765 247451519752267 -> 0.9999999999777653 Inexact Rounded
-dddiv4049 divide 7877858475022054 7877858474999794 -> 1.000000000002826 Inexact Rounded
-dddiv4050 divide 7333242694766258 7333242694744628 -> 1.000000000002950 Inexact Rounded
-dddiv4051 divide 124051503698592 124051503699397 -> 0.9999999999935108 Inexact Rounded
-dddiv4052 divide 8944737432385188 8944737432406860 -> 0.9999999999975771 Inexact Rounded
-dddiv4053 divide 9883948923406874 9883948923424843 -> 0.9999999999981820 Inexact Rounded
-dddiv4054 divide 6829178741654284 6829178741671973 -> 0.9999999999974098 Inexact Rounded
-dddiv4055 divide 7342752479768122 7342752479793385 -> 0.9999999999965595 Inexact Rounded
-dddiv4056 divide 8066426579008783 8066426578977563 -> 1.000000000003870 Inexact Rounded
-dddiv4057 divide 8992775071383295 8992775071352712 -> 1.000000000003401 Inexact Rounded
-dddiv4058 divide 5485011755545641 5485011755543611 -> 1.000000000000370 Inexact Rounded
-dddiv4059 divide 5779983054353918 5779983054365300 -> 0.9999999999980308 Inexact Rounded
-dddiv4060 divide 9502265102713774 9502265102735208 -> 0.9999999999977443 Inexact Rounded
-dddiv4061 divide 2109558399130981 2109558399116281 -> 1.000000000006968 Inexact Rounded
-dddiv4062 divide 5296182636350471 5296182636351521 -> 0.9999999999998017 Inexact Rounded
-dddiv4063 divide 1440019225591883 1440019225601844 -> 0.9999999999930827 Inexact Rounded
-dddiv4064 divide 8182110791881341 8182110791847174 -> 1.000000000004176 Inexact Rounded
-dddiv4065 divide 489098235512060 489098235534516 -> 0.9999999999540869 Inexact Rounded
-dddiv4066 divide 6475687084782038 6475687084756089 -> 1.000000000004007 Inexact Rounded
-dddiv4067 divide 8094348555736948 8094348555759236 -> 0.9999999999972465 Inexact Rounded
-dddiv4068 divide 1982766816291543 1982766816309463 -> 0.9999999999909621 Inexact Rounded
-dddiv4069 divide 9277314300113251 9277314300084467 -> 1.000000000003103 Inexact Rounded
-dddiv4070 divide 4335532959318934 4335532959293167 -> 1.000000000005943 Inexact Rounded
-dddiv4071 divide 7767113032981348 7767113032968132 -> 1.000000000001702 Inexact Rounded
-dddiv4072 divide 1578548053342868 1578548053370448 -> 0.9999999999825282 Inexact Rounded
-dddiv4073 divide 3790420686666898 3790420686636315 -> 1.000000000008068 Inexact Rounded
-dddiv4074 divide 871682421955147 871682421976441 -> 0.9999999999755714 Inexact Rounded
-dddiv4075 divide 744141054479940 744141054512329 -> 0.9999999999564746 Inexact Rounded
-dddiv4076 divide 8956824183670735 8956824183641741 -> 1.000000000003237 Inexact Rounded
-dddiv4077 divide 8337291694485682 8337291694451193 -> 1.000000000004137 Inexact Rounded
-dddiv4078 divide 4107775944683669 4107775944657097 -> 1.000000000006469 Inexact Rounded
-dddiv4079 divide 8691900057964648 8691900057997555 -> 0.9999999999962141 Inexact Rounded
-dddiv4080 divide 2229528520536462 2229528520502337 -> 1.000000000015306 Inexact Rounded
-dddiv4081 divide 398442083774322 398442083746273 -> 1.000000000070397 Inexact Rounded
-dddiv4082 divide 5319819776808759 5319819776838313 -> 0.9999999999944445 Inexact Rounded
-dddiv4083 divide 7710491299066855 7710491299041858 -> 1.000000000003242 Inexact Rounded
-dddiv4084 divide 9083231296087266 9083231296058160 -> 1.000000000003204 Inexact Rounded
-dddiv4085 divide 3566873574904559 3566873574890328 -> 1.000000000003990 Inexact Rounded
-dddiv4086 divide 596343290550525 596343290555614 -> 0.9999999999914663 Inexact Rounded
-dddiv4087 divide 278227925093192 278227925068104 -> 1.000000000090171 Inexact Rounded
-dddiv4088 divide 3292902958490649 3292902958519881 -> 0.9999999999911227 Inexact Rounded
-dddiv4089 divide 5521871364245881 5521871364229536 -> 1.000000000002960 Inexact Rounded
-dddiv4090 divide 2406505602883617 2406505602857997 -> 1.000000000010646 Inexact Rounded
-dddiv4091 divide 7741146984869208 7741146984867255 -> 1.000000000000252 Inexact Rounded
-dddiv4092 divide 4576041832414909 4576041832405102 -> 1.000000000002143 Inexact Rounded
-dddiv4093 divide 9183756982878057 9183756982901934 -> 0.9999999999974001 Inexact Rounded
-dddiv4094 divide 6215736513855159 6215736513870342 -> 0.9999999999975573 Inexact Rounded
-dddiv4095 divide 248554968534533 248554968551417 -> 0.9999999999320714 Inexact Rounded
-dddiv4096 divide 376314165668645 376314165659755 -> 1.000000000023624 Inexact Rounded
-dddiv4097 divide 5513569249809718 5513569249808906 -> 1.000000000000147 Inexact Rounded
-dddiv4098 divide 3367992242167904 3367992242156228 -> 1.000000000003467 Inexact Rounded
-dddiv4099 divide 6134869538966967 6134869538985986 -> 0.9999999999968999 Inexact Rounded
-
--- Null tests
-dddiv9998 divide 10 # -> NaN Invalid_operation
-dddiv9999 divide # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddDivide.decTest -- decDouble division --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+dddiv001 divide 1 1 -> 1
+dddiv002 divide 2 1 -> 2
+dddiv003 divide 1 2 -> 0.5
+dddiv004 divide 2 2 -> 1
+dddiv005 divide 0 1 -> 0
+dddiv006 divide 0 2 -> 0
+dddiv007 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv008 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv009 divide 3 3 -> 1
+
+dddiv010 divide 2.4 1 -> 2.4
+dddiv011 divide 2.4 -1 -> -2.4
+dddiv012 divide -2.4 1 -> -2.4
+dddiv013 divide -2.4 -1 -> 2.4
+dddiv014 divide 2.40 1 -> 2.40
+dddiv015 divide 2.400 1 -> 2.400
+dddiv016 divide 2.4 2 -> 1.2
+dddiv017 divide 2.400 2 -> 1.200
+dddiv018 divide 2. 2 -> 1
+dddiv019 divide 20 20 -> 1
+
+dddiv020 divide 187 187 -> 1
+dddiv021 divide 5 2 -> 2.5
+dddiv022 divide 50 20 -> 2.5
+dddiv023 divide 500 200 -> 2.5
+dddiv024 divide 50.0 20.0 -> 2.5
+dddiv025 divide 5.00 2.00 -> 2.5
+dddiv026 divide 5 2.0 -> 2.5
+dddiv027 divide 5 2.000 -> 2.5
+dddiv028 divide 5 0.20 -> 25
+dddiv029 divide 5 0.200 -> 25
+dddiv030 divide 10 1 -> 10
+dddiv031 divide 100 1 -> 100
+dddiv032 divide 1000 1 -> 1000
+dddiv033 divide 1000 100 -> 10
+
+dddiv035 divide 1 2 -> 0.5
+dddiv036 divide 1 4 -> 0.25
+dddiv037 divide 1 8 -> 0.125
+dddiv038 divide 1 16 -> 0.0625
+dddiv039 divide 1 32 -> 0.03125
+dddiv040 divide 1 64 -> 0.015625
+dddiv041 divide 1 -2 -> -0.5
+dddiv042 divide 1 -4 -> -0.25
+dddiv043 divide 1 -8 -> -0.125
+dddiv044 divide 1 -16 -> -0.0625
+dddiv045 divide 1 -32 -> -0.03125
+dddiv046 divide 1 -64 -> -0.015625
+dddiv047 divide -1 2 -> -0.5
+dddiv048 divide -1 4 -> -0.25
+dddiv049 divide -1 8 -> -0.125
+dddiv050 divide -1 16 -> -0.0625
+dddiv051 divide -1 32 -> -0.03125
+dddiv052 divide -1 64 -> -0.015625
+dddiv053 divide -1 -2 -> 0.5
+dddiv054 divide -1 -4 -> 0.25
+dddiv055 divide -1 -8 -> 0.125
+dddiv056 divide -1 -16 -> 0.0625
+dddiv057 divide -1 -32 -> 0.03125
+dddiv058 divide -1 -64 -> 0.015625
+
+-- bcdTime
+dddiv060 divide 1 7 -> 0.1428571428571429 Inexact Rounded
+dddiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717 Inexact Rounded
+
+-- 1234567890123456
+dddiv071 divide 9999999999999999 1 -> 9999999999999999
+dddiv072 divide 999999999999999 1 -> 999999999999999
+dddiv073 divide 99999999999999 1 -> 99999999999999
+dddiv074 divide 9999999999999 1 -> 9999999999999
+dddiv075 divide 999999999999 1 -> 999999999999
+dddiv076 divide 99999999999 1 -> 99999999999
+dddiv077 divide 9999999999 1 -> 9999999999
+dddiv078 divide 999999999 1 -> 999999999
+dddiv079 divide 99999999 1 -> 99999999
+dddiv080 divide 9999999 1 -> 9999999
+dddiv081 divide 999999 1 -> 999999
+dddiv082 divide 99999 1 -> 99999
+dddiv083 divide 9999 1 -> 9999
+dddiv084 divide 999 1 -> 999
+dddiv085 divide 99 1 -> 99
+dddiv086 divide 9 1 -> 9
+
+dddiv090 divide 0. 1 -> 0
+dddiv091 divide .0 1 -> 0.0
+dddiv092 divide 0.00 1 -> 0.00
+dddiv093 divide 0.00E+9 1 -> 0E+7
+dddiv094 divide 0.0000E-50 1 -> 0E-54
+
+dddiv095 divide 1 1E-8 -> 1E+8
+dddiv096 divide 1 1E-9 -> 1E+9
+dddiv097 divide 1 1E-10 -> 1E+10
+dddiv098 divide 1 1E-11 -> 1E+11
+dddiv099 divide 1 1E-12 -> 1E+12
+
+dddiv100 divide 1 1 -> 1
+dddiv101 divide 1 2 -> 0.5
+dddiv102 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv103 divide 1 4 -> 0.25
+dddiv104 divide 1 5 -> 0.2
+dddiv105 divide 1 6 -> 0.1666666666666667 Inexact Rounded
+dddiv106 divide 1 7 -> 0.1428571428571429 Inexact Rounded
+dddiv107 divide 1 8 -> 0.125
+dddiv108 divide 1 9 -> 0.1111111111111111 Inexact Rounded
+dddiv109 divide 1 10 -> 0.1
+dddiv110 divide 1 1 -> 1
+dddiv111 divide 2 1 -> 2
+dddiv112 divide 3 1 -> 3
+dddiv113 divide 4 1 -> 4
+dddiv114 divide 5 1 -> 5
+dddiv115 divide 6 1 -> 6
+dddiv116 divide 7 1 -> 7
+dddiv117 divide 8 1 -> 8
+dddiv118 divide 9 1 -> 9
+dddiv119 divide 10 1 -> 10
+
+dddiv120 divide 3E+1 0.001 -> 3E+4
+dddiv121 divide 2.200 2 -> 1.100
+
+dddiv130 divide 12345 4.999 -> 2469.493898779756 Inexact Rounded
+dddiv131 divide 12345 4.99 -> 2473.947895791583 Inexact Rounded
+dddiv132 divide 12345 4.9 -> 2519.387755102041 Inexact Rounded
+dddiv133 divide 12345 5 -> 2469
+dddiv134 divide 12345 5.1 -> 2420.588235294118 Inexact Rounded
+dddiv135 divide 12345 5.01 -> 2464.071856287425 Inexact Rounded
+dddiv136 divide 12345 5.001 -> 2468.506298740252 Inexact Rounded
+
+-- test possibly imprecise results
+dddiv220 divide 391 597 -> 0.6549413735343384 Inexact Rounded
+dddiv221 divide 391 -597 -> -0.6549413735343384 Inexact Rounded
+dddiv222 divide -391 597 -> -0.6549413735343384 Inexact Rounded
+dddiv223 divide -391 -597 -> 0.6549413735343384 Inexact Rounded
+
+-- test some cases that are close to exponent overflow, some with coefficient padding
+dddiv270 divide 1 1e384 -> 1E-384 Subnormal
+dddiv271 divide 1 0.9e384 -> 1.11111111111111E-384 Rounded Inexact Subnormal Underflow
+dddiv272 divide 1 0.99e384 -> 1.01010101010101E-384 Rounded Inexact Subnormal Underflow
+dddiv273 divide 1 0.9999999999999999e384 -> 1.00000000000000E-384 Rounded Inexact Subnormal Underflow
+dddiv274 divide 9e384 1 -> 9.000000000000000E+384 Clamped
+dddiv275 divide 9.9e384 1 -> 9.900000000000000E+384 Clamped
+dddiv276 divide 9.99e384 1 -> 9.990000000000000E+384 Clamped
+dddiv277 divide 9.9999999999999e384 1 -> 9.999999999999900E+384 Clamped
+dddiv278 divide 9.99999999999999e384 1 -> 9.999999999999990E+384 Clamped
+dddiv279 divide 9.999999999999999e384 1 -> 9.999999999999999E+384
+
+dddiv285 divide 9.9e384 1.1 -> 9.000000000000000E+384 Clamped
+dddiv286 divide 9.99e384 1.1 -> 9.081818181818182E+384 Inexact Rounded
+dddiv287 divide 9.9999999999999e384 1.1 -> 9.090909090909000E+384 Clamped
+dddiv288 divide 9.99999999999999e384 1.1 -> 9.090909090909082E+384 Inexact Rounded
+dddiv289 divide 9.999999999999999e384 1.1 -> 9.090909090909090E+384 Clamped
+
+
+-- Divide into 0 tests
+dddiv301 divide 0 7 -> 0
+dddiv302 divide 0 7E-5 -> 0E+5
+dddiv303 divide 0 7E-1 -> 0E+1
+dddiv304 divide 0 7E+1 -> 0.0
+dddiv305 divide 0 7E+5 -> 0.00000
+dddiv306 divide 0 7E+6 -> 0.000000
+dddiv307 divide 0 7E+7 -> 0E-7
+dddiv308 divide 0 70E-5 -> 0E+5
+dddiv309 divide 0 70E-1 -> 0E+1
+dddiv310 divide 0 70E+0 -> 0
+dddiv311 divide 0 70E+1 -> 0.0
+dddiv312 divide 0 70E+5 -> 0.00000
+dddiv313 divide 0 70E+6 -> 0.000000
+dddiv314 divide 0 70E+7 -> 0E-7
+dddiv315 divide 0 700E-5 -> 0E+5
+dddiv316 divide 0 700E-1 -> 0E+1
+dddiv317 divide 0 700E+0 -> 0
+dddiv318 divide 0 700E+1 -> 0.0
+dddiv319 divide 0 700E+5 -> 0.00000
+dddiv320 divide 0 700E+6 -> 0.000000
+dddiv321 divide 0 700E+7 -> 0E-7
+dddiv322 divide 0 700E+77 -> 0E-77
+
+dddiv331 divide 0E-3 7E-5 -> 0E+2
+dddiv332 divide 0E-3 7E-1 -> 0.00
+dddiv333 divide 0E-3 7E+1 -> 0.0000
+dddiv334 divide 0E-3 7E+5 -> 0E-8
+dddiv335 divide 0E-1 7E-5 -> 0E+4
+dddiv336 divide 0E-1 7E-1 -> 0
+dddiv337 divide 0E-1 7E+1 -> 0.00
+dddiv338 divide 0E-1 7E+5 -> 0.000000
+dddiv339 divide 0E+1 7E-5 -> 0E+6
+dddiv340 divide 0E+1 7E-1 -> 0E+2
+dddiv341 divide 0E+1 7E+1 -> 0
+dddiv342 divide 0E+1 7E+5 -> 0.0000
+dddiv343 divide 0E+3 7E-5 -> 0E+8
+dddiv344 divide 0E+3 7E-1 -> 0E+4
+dddiv345 divide 0E+3 7E+1 -> 0E+2
+dddiv346 divide 0E+3 7E+5 -> 0.00
+
+-- These were 'input rounding'
+dddiv441 divide 12345678000 1 -> 12345678000
+dddiv442 divide 1 12345678000 -> 8.100000664200054E-11 Inexact Rounded
+dddiv443 divide 1234567800 1 -> 1234567800
+dddiv444 divide 1 1234567800 -> 8.100000664200054E-10 Inexact Rounded
+dddiv445 divide 1234567890 1 -> 1234567890
+dddiv446 divide 1 1234567890 -> 8.100000073710001E-10 Inexact Rounded
+dddiv447 divide 1234567891 1 -> 1234567891
+dddiv448 divide 1 1234567891 -> 8.100000067149001E-10 Inexact Rounded
+dddiv449 divide 12345678901 1 -> 12345678901
+dddiv450 divide 1 12345678901 -> 8.100000073053901E-11 Inexact Rounded
+dddiv451 divide 1234567896 1 -> 1234567896
+dddiv452 divide 1 1234567896 -> 8.100000034344000E-10 Inexact Rounded
+
+-- high-lows
+dddiv453 divide 1e+1 1 -> 1E+1
+dddiv454 divide 1e+1 1.0 -> 1E+1
+dddiv455 divide 1e+1 1.00 -> 1E+1
+dddiv456 divide 1e+2 2 -> 5E+1
+dddiv457 divide 1e+2 2.0 -> 5E+1
+dddiv458 divide 1e+2 2.00 -> 5E+1
+
+-- some from IEEE discussions
+dddiv460 divide 3e0 2e0 -> 1.5
+dddiv461 divide 30e-1 2e0 -> 1.5
+dddiv462 divide 300e-2 2e0 -> 1.50
+dddiv464 divide 3000e-3 2e0 -> 1.500
+dddiv465 divide 3e0 20e-1 -> 1.5
+dddiv466 divide 30e-1 20e-1 -> 1.5
+dddiv467 divide 300e-2 20e-1 -> 1.5
+dddiv468 divide 3000e-3 20e-1 -> 1.50
+dddiv469 divide 3e0 200e-2 -> 1.5
+dddiv470 divide 30e-1 200e-2 -> 1.5
+dddiv471 divide 300e-2 200e-2 -> 1.5
+dddiv472 divide 3000e-3 200e-2 -> 1.5
+dddiv473 divide 3e0 2000e-3 -> 1.5
+dddiv474 divide 30e-1 2000e-3 -> 1.5
+dddiv475 divide 300e-2 2000e-3 -> 1.5
+dddiv476 divide 3000e-3 2000e-3 -> 1.5
+
+-- some reciprocals
+dddiv480 divide 1 1.0E+33 -> 1E-33
+dddiv481 divide 1 10E+33 -> 1E-34
+dddiv482 divide 1 1.0E-33 -> 1E+33
+dddiv483 divide 1 10E-33 -> 1E+32
+
+-- RMS discussion table
+dddiv484 divide 0e5 1e3 -> 0E+2
+dddiv485 divide 0e5 2e3 -> 0E+2
+dddiv486 divide 0e5 10e2 -> 0E+3
+dddiv487 divide 0e5 20e2 -> 0E+3
+dddiv488 divide 0e5 100e1 -> 0E+4
+dddiv489 divide 0e5 200e1 -> 0E+4
+
+dddiv491 divide 1e5 1e3 -> 1E+2
+dddiv492 divide 1e5 2e3 -> 5E+1
+dddiv493 divide 1e5 10e2 -> 1E+2
+dddiv494 divide 1e5 20e2 -> 5E+1
+dddiv495 divide 1e5 100e1 -> 1E+2
+dddiv496 divide 1e5 200e1 -> 5E+1
+
+-- tryzeros cases
+rounding: half_up
+dddiv497 divide 0E+380 1000E-13 -> 0E+369 Clamped
+dddiv498 divide 0E-390 1000E+13 -> 0E-398 Clamped
+
+rounding: half_up
+
+-- focus on trailing zeros issues
+dddiv500 divide 1 9.9 -> 0.1010101010101010 Inexact Rounded
+dddiv501 divide 1 9.09 -> 0.1100110011001100 Inexact Rounded
+dddiv502 divide 1 9.009 -> 0.1110001110001110 Inexact Rounded
+
+dddiv511 divide 1 2 -> 0.5
+dddiv512 divide 1.0 2 -> 0.5
+dddiv513 divide 1.00 2 -> 0.50
+dddiv514 divide 1.000 2 -> 0.500
+dddiv515 divide 1.0000 2 -> 0.5000
+dddiv516 divide 1.00000 2 -> 0.50000
+dddiv517 divide 1.000000 2 -> 0.500000
+dddiv518 divide 1.0000000 2 -> 0.5000000
+dddiv519 divide 1.00 2.00 -> 0.5
+
+dddiv521 divide 2 1 -> 2
+dddiv522 divide 2 1.0 -> 2
+dddiv523 divide 2 1.00 -> 2
+dddiv524 divide 2 1.000 -> 2
+dddiv525 divide 2 1.0000 -> 2
+dddiv526 divide 2 1.00000 -> 2
+dddiv527 divide 2 1.000000 -> 2
+dddiv528 divide 2 1.0000000 -> 2
+dddiv529 divide 2.00 1.00 -> 2
+
+dddiv530 divide 2.40 2 -> 1.20
+dddiv531 divide 2.40 4 -> 0.60
+dddiv532 divide 2.40 10 -> 0.24
+dddiv533 divide 2.40 2.0 -> 1.2
+dddiv534 divide 2.40 4.0 -> 0.6
+dddiv535 divide 2.40 10.0 -> 0.24
+dddiv536 divide 2.40 2.00 -> 1.2
+dddiv537 divide 2.40 4.00 -> 0.6
+dddiv538 divide 2.40 10.00 -> 0.24
+dddiv539 divide 0.9 0.1 -> 9
+dddiv540 divide 0.9 0.01 -> 9E+1
+dddiv541 divide 0.9 0.001 -> 9E+2
+dddiv542 divide 5 2 -> 2.5
+dddiv543 divide 5 2.0 -> 2.5
+dddiv544 divide 5 2.00 -> 2.5
+dddiv545 divide 5 20 -> 0.25
+dddiv546 divide 5 20.0 -> 0.25
+dddiv547 divide 2.400 2 -> 1.200
+dddiv548 divide 2.400 2.0 -> 1.20
+dddiv549 divide 2.400 2.400 -> 1
+
+dddiv550 divide 240 1 -> 240
+dddiv551 divide 240 10 -> 24
+dddiv552 divide 240 100 -> 2.4
+dddiv553 divide 240 1000 -> 0.24
+dddiv554 divide 2400 1 -> 2400
+dddiv555 divide 2400 10 -> 240
+dddiv556 divide 2400 100 -> 24
+dddiv557 divide 2400 1000 -> 2.4
+
+-- +ve exponent
+dddiv600 divide 2.4E+9 2 -> 1.2E+9
+dddiv601 divide 2.40E+9 2 -> 1.20E+9
+dddiv602 divide 2.400E+9 2 -> 1.200E+9
+dddiv603 divide 2.4000E+9 2 -> 1.2000E+9
+dddiv604 divide 24E+8 2 -> 1.2E+9
+dddiv605 divide 240E+7 2 -> 1.20E+9
+dddiv606 divide 2400E+6 2 -> 1.200E+9
+dddiv607 divide 24000E+5 2 -> 1.2000E+9
+
+-- more zeros, etc.
+dddiv731 divide 5.00 1E-3 -> 5.00E+3
+dddiv732 divide 00.00 0.000 -> NaN Division_undefined
+dddiv733 divide 00.00 0E-3 -> NaN Division_undefined
+dddiv734 divide 0 -0 -> NaN Division_undefined
+dddiv735 divide -0 0 -> NaN Division_undefined
+dddiv736 divide -0 -0 -> NaN Division_undefined
+
+dddiv741 divide 0 -1 -> -0
+dddiv742 divide -0 -1 -> 0
+dddiv743 divide 0 1 -> 0
+dddiv744 divide -0 1 -> -0
+dddiv745 divide -1 0 -> -Infinity Division_by_zero
+dddiv746 divide -1 -0 -> Infinity Division_by_zero
+dddiv747 divide 1 0 -> Infinity Division_by_zero
+dddiv748 divide 1 -0 -> -Infinity Division_by_zero
+
+dddiv751 divide 0.0 -1 -> -0.0
+dddiv752 divide -0.0 -1 -> 0.0
+dddiv753 divide 0.0 1 -> 0.0
+dddiv754 divide -0.0 1 -> -0.0
+dddiv755 divide -1.0 0 -> -Infinity Division_by_zero
+dddiv756 divide -1.0 -0 -> Infinity Division_by_zero
+dddiv757 divide 1.0 0 -> Infinity Division_by_zero
+dddiv758 divide 1.0 -0 -> -Infinity Division_by_zero
+
+dddiv761 divide 0 -1.0 -> -0E+1
+dddiv762 divide -0 -1.0 -> 0E+1
+dddiv763 divide 0 1.0 -> 0E+1
+dddiv764 divide -0 1.0 -> -0E+1
+dddiv765 divide -1 0.0 -> -Infinity Division_by_zero
+dddiv766 divide -1 -0.0 -> Infinity Division_by_zero
+dddiv767 divide 1 0.0 -> Infinity Division_by_zero
+dddiv768 divide 1 -0.0 -> -Infinity Division_by_zero
+
+dddiv771 divide 0.0 -1.0 -> -0
+dddiv772 divide -0.0 -1.0 -> 0
+dddiv773 divide 0.0 1.0 -> 0
+dddiv774 divide -0.0 1.0 -> -0
+dddiv775 divide -1.0 0.0 -> -Infinity Division_by_zero
+dddiv776 divide -1.0 -0.0 -> Infinity Division_by_zero
+dddiv777 divide 1.0 0.0 -> Infinity Division_by_zero
+dddiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero
+
+-- Specials
+dddiv780 divide Inf -Inf -> NaN Invalid_operation
+dddiv781 divide Inf -1000 -> -Infinity
+dddiv782 divide Inf -1 -> -Infinity
+dddiv783 divide Inf -0 -> -Infinity
+dddiv784 divide Inf 0 -> Infinity
+dddiv785 divide Inf 1 -> Infinity
+dddiv786 divide Inf 1000 -> Infinity
+dddiv787 divide Inf Inf -> NaN Invalid_operation
+dddiv788 divide -1000 Inf -> -0E-398 Clamped
+dddiv789 divide -Inf Inf -> NaN Invalid_operation
+dddiv790 divide -1 Inf -> -0E-398 Clamped
+dddiv791 divide -0 Inf -> -0E-398 Clamped
+dddiv792 divide 0 Inf -> 0E-398 Clamped
+dddiv793 divide 1 Inf -> 0E-398 Clamped
+dddiv794 divide 1000 Inf -> 0E-398 Clamped
+dddiv795 divide Inf Inf -> NaN Invalid_operation
+
+dddiv800 divide -Inf -Inf -> NaN Invalid_operation
+dddiv801 divide -Inf -1000 -> Infinity
+dddiv802 divide -Inf -1 -> Infinity
+dddiv803 divide -Inf -0 -> Infinity
+dddiv804 divide -Inf 0 -> -Infinity
+dddiv805 divide -Inf 1 -> -Infinity
+dddiv806 divide -Inf 1000 -> -Infinity
+dddiv807 divide -Inf Inf -> NaN Invalid_operation
+dddiv808 divide -1000 Inf -> -0E-398 Clamped
+dddiv809 divide -Inf -Inf -> NaN Invalid_operation
+dddiv810 divide -1 -Inf -> 0E-398 Clamped
+dddiv811 divide -0 -Inf -> 0E-398 Clamped
+dddiv812 divide 0 -Inf -> -0E-398 Clamped
+dddiv813 divide 1 -Inf -> -0E-398 Clamped
+dddiv814 divide 1000 -Inf -> -0E-398 Clamped
+dddiv815 divide Inf -Inf -> NaN Invalid_operation
+
+dddiv821 divide NaN -Inf -> NaN
+dddiv822 divide NaN -1000 -> NaN
+dddiv823 divide NaN -1 -> NaN
+dddiv824 divide NaN -0 -> NaN
+dddiv825 divide NaN 0 -> NaN
+dddiv826 divide NaN 1 -> NaN
+dddiv827 divide NaN 1000 -> NaN
+dddiv828 divide NaN Inf -> NaN
+dddiv829 divide NaN NaN -> NaN
+dddiv830 divide -Inf NaN -> NaN
+dddiv831 divide -1000 NaN -> NaN
+dddiv832 divide -1 NaN -> NaN
+dddiv833 divide -0 NaN -> NaN
+dddiv834 divide 0 NaN -> NaN
+dddiv835 divide 1 NaN -> NaN
+dddiv836 divide 1000 NaN -> NaN
+dddiv837 divide Inf NaN -> NaN
+
+dddiv841 divide sNaN -Inf -> NaN Invalid_operation
+dddiv842 divide sNaN -1000 -> NaN Invalid_operation
+dddiv843 divide sNaN -1 -> NaN Invalid_operation
+dddiv844 divide sNaN -0 -> NaN Invalid_operation
+dddiv845 divide sNaN 0 -> NaN Invalid_operation
+dddiv846 divide sNaN 1 -> NaN Invalid_operation
+dddiv847 divide sNaN 1000 -> NaN Invalid_operation
+dddiv848 divide sNaN NaN -> NaN Invalid_operation
+dddiv849 divide sNaN sNaN -> NaN Invalid_operation
+dddiv850 divide NaN sNaN -> NaN Invalid_operation
+dddiv851 divide -Inf sNaN -> NaN Invalid_operation
+dddiv852 divide -1000 sNaN -> NaN Invalid_operation
+dddiv853 divide -1 sNaN -> NaN Invalid_operation
+dddiv854 divide -0 sNaN -> NaN Invalid_operation
+dddiv855 divide 0 sNaN -> NaN Invalid_operation
+dddiv856 divide 1 sNaN -> NaN Invalid_operation
+dddiv857 divide 1000 sNaN -> NaN Invalid_operation
+dddiv858 divide Inf sNaN -> NaN Invalid_operation
+dddiv859 divide NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dddiv861 divide NaN9 -Inf -> NaN9
+dddiv862 divide NaN8 1000 -> NaN8
+dddiv863 divide NaN7 Inf -> NaN7
+dddiv864 divide NaN6 NaN5 -> NaN6
+dddiv865 divide -Inf NaN4 -> NaN4
+dddiv866 divide -1000 NaN3 -> NaN3
+dddiv867 divide Inf NaN2 -> NaN2
+
+dddiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation
+dddiv872 divide sNaN98 -1 -> NaN98 Invalid_operation
+dddiv873 divide sNaN97 NaN -> NaN97 Invalid_operation
+dddiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
+dddiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
+dddiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation
+dddiv877 divide 0 sNaN91 -> NaN91 Invalid_operation
+dddiv878 divide Inf sNaN90 -> NaN90 Invalid_operation
+dddiv879 divide NaN sNaN89 -> NaN89 Invalid_operation
+
+dddiv881 divide -NaN9 -Inf -> -NaN9
+dddiv882 divide -NaN8 1000 -> -NaN8
+dddiv883 divide -NaN7 Inf -> -NaN7
+dddiv884 divide -NaN6 -NaN5 -> -NaN6
+dddiv885 divide -Inf -NaN4 -> -NaN4
+dddiv886 divide -1000 -NaN3 -> -NaN3
+dddiv887 divide Inf -NaN2 -> -NaN2
+
+dddiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
+dddiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
+dddiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
+dddiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
+dddiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+dddiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
+dddiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
+dddiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
+dddiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- Various flavours of divide by 0
+dddiv901 divide 0 0 -> NaN Division_undefined
+dddiv902 divide 0.0E5 0 -> NaN Division_undefined
+dddiv903 divide 0.000 0 -> NaN Division_undefined
+dddiv904 divide 0.0001 0 -> Infinity Division_by_zero
+dddiv905 divide 0.01 0 -> Infinity Division_by_zero
+dddiv906 divide 0.1 0 -> Infinity Division_by_zero
+dddiv907 divide 1 0 -> Infinity Division_by_zero
+dddiv908 divide 1 0.0 -> Infinity Division_by_zero
+dddiv909 divide 10 0.0 -> Infinity Division_by_zero
+dddiv910 divide 1E+100 0.0 -> Infinity Division_by_zero
+dddiv911 divide 1E+100 0 -> Infinity Division_by_zero
+
+dddiv921 divide -0.0001 0 -> -Infinity Division_by_zero
+dddiv922 divide -0.01 0 -> -Infinity Division_by_zero
+dddiv923 divide -0.1 0 -> -Infinity Division_by_zero
+dddiv924 divide -1 0 -> -Infinity Division_by_zero
+dddiv925 divide -1 0.0 -> -Infinity Division_by_zero
+dddiv926 divide -10 0.0 -> -Infinity Division_by_zero
+dddiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero
+dddiv928 divide -1E+100 0 -> -Infinity Division_by_zero
+
+dddiv931 divide 0.0001 -0 -> -Infinity Division_by_zero
+dddiv932 divide 0.01 -0 -> -Infinity Division_by_zero
+dddiv933 divide 0.1 -0 -> -Infinity Division_by_zero
+dddiv934 divide 1 -0 -> -Infinity Division_by_zero
+dddiv935 divide 1 -0.0 -> -Infinity Division_by_zero
+dddiv936 divide 10 -0.0 -> -Infinity Division_by_zero
+dddiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
+dddiv938 divide 1E+100 -0 -> -Infinity Division_by_zero
+
+dddiv941 divide -0.0001 -0 -> Infinity Division_by_zero
+dddiv942 divide -0.01 -0 -> Infinity Division_by_zero
+dddiv943 divide -0.1 -0 -> Infinity Division_by_zero
+dddiv944 divide -1 -0 -> Infinity Division_by_zero
+dddiv945 divide -1 -0.0 -> Infinity Division_by_zero
+dddiv946 divide -10 -0.0 -> Infinity Division_by_zero
+dddiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero
+dddiv948 divide -1E+100 -0 -> Infinity Division_by_zero
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dddiv1021 divide 1E0 1E0 -> 1
+dddiv1022 divide 1E0 2E0 -> 0.5
+dddiv1023 divide 1E0 3E0 -> 0.3333333333333333 Inexact Rounded
+dddiv1024 divide 100E-2 1000E-3 -> 1
+dddiv1025 divide 24E-1 2E0 -> 1.2
+dddiv1026 divide 2400E-3 2E0 -> 1.200
+dddiv1027 divide 5E0 2E0 -> 2.5
+dddiv1028 divide 5E0 20E-1 -> 2.5
+dddiv1029 divide 5E0 2000E-3 -> 2.5
+dddiv1030 divide 5E0 2E-1 -> 25
+dddiv1031 divide 5E0 20E-2 -> 25
+dddiv1032 divide 480E-2 3E0 -> 1.60
+dddiv1033 divide 47E-1 2E0 -> 2.35
+
+-- ECMAScript bad examples
+rounding: half_down
+dddiv1040 divide 5 9 -> 0.5555555555555556 Inexact Rounded
+rounding: half_even
+dddiv1041 divide 6 11 -> 0.5454545454545455 Inexact Rounded
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+dddiv1051 divide 1e+277 1e-311 -> Infinity Overflow Inexact Rounded
+dddiv1052 divide 1e+277 -1e-311 -> -Infinity Overflow Inexact Rounded
+dddiv1053 divide -1e+277 1e-311 -> -Infinity Overflow Inexact Rounded
+dddiv1054 divide -1e+277 -1e-311 -> Infinity Overflow Inexact Rounded
+dddiv1055 divide 1e-277 1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1056 divide 1e-277 -1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1057 divide -1e-277 1e+311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1058 divide -1e-277 -1e+311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dddiv1060 divide 1e-291 1e+101 -> 1E-392 Subnormal
+dddiv1061 divide 1e-291 1e+102 -> 1E-393 Subnormal
+dddiv1062 divide 1e-291 1e+103 -> 1E-394 Subnormal
+dddiv1063 divide 1e-291 1e+104 -> 1E-395 Subnormal
+dddiv1064 divide 1e-291 1e+105 -> 1E-396 Subnormal
+dddiv1065 divide 1e-291 1e+106 -> 1E-397 Subnormal
+dddiv1066 divide 1e-291 1e+107 -> 1E-398 Subnormal
+dddiv1067 divide 1e-291 1e+108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1068 divide 1e-291 1e+109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1069 divide 1e-291 1e+110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+dddiv1070 divide 1e+60 1e-321 -> 1.000000000000E+381 Clamped
+dddiv1071 divide 1e+60 1e-322 -> 1.0000000000000E+382 Clamped
+dddiv1072 divide 1e+60 1e-323 -> 1.00000000000000E+383 Clamped
+dddiv1073 divide 1e+60 1e-324 -> 1.000000000000000E+384 Clamped
+dddiv1074 divide 1e+60 1e-325 -> Infinity Overflow Inexact Rounded
+dddiv1075 divide 1e+60 1e-326 -> Infinity Overflow Inexact Rounded
+dddiv1076 divide 1e+60 1e-327 -> Infinity Overflow Inexact Rounded
+dddiv1077 divide 1e+60 1e-328 -> Infinity Overflow Inexact Rounded
+dddiv1078 divide 1e+60 1e-329 -> Infinity Overflow Inexact Rounded
+dddiv1079 divide 1e+60 1e-330 -> Infinity Overflow Inexact Rounded
+
+dddiv1101 divide 1.0000E-394 1 -> 1.0000E-394 Subnormal
+dddiv1102 divide 1.000E-394 1e+1 -> 1.000E-395 Subnormal
+dddiv1103 divide 1.00E-394 1e+2 -> 1.00E-396 Subnormal
+dddiv1104 divide 1.0E-394 1e+3 -> 1.0E-397 Subnormal
+dddiv1105 divide 1.0E-394 1e+4 -> 1E-398 Subnormal Rounded
+dddiv1106 divide 1.3E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
+dddiv1107 divide 1.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1108 divide 1.7E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1109 divide 2.3E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1110 divide 2.5E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1111 divide 2.7E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
+dddiv1112 divide 1.49E-394 1e+4 -> 1E-398 Underflow Subnormal Inexact Rounded
+dddiv1113 divide 1.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1114 divide 1.51E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1115 divide 2.49E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1116 divide 2.50E-394 1e+4 -> 2E-398 Underflow Subnormal Inexact Rounded
+dddiv1117 divide 2.51E-394 1e+4 -> 3E-398 Underflow Subnormal Inexact Rounded
+
+dddiv1118 divide 1E-394 1e+4 -> 1E-398 Subnormal
+dddiv1119 divide 3E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1120 divide 5E-394 1e+5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1121 divide 7E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
+dddiv1122 divide 9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
+dddiv1123 divide 9.9E-394 1e+5 -> 1E-398 Underflow Subnormal Inexact Rounded
+
+dddiv1124 divide 1E-394 -1e+4 -> -1E-398 Subnormal
+dddiv1125 divide 3E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1126 divide -5E-394 1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1127 divide 7E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
+dddiv1128 divide -9E-394 1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
+dddiv1129 divide 9.9E-394 -1e+5 -> -1E-398 Underflow Subnormal Inexact Rounded
+dddiv1130 divide 3.0E-394 -1e+5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+dddiv1131 divide 1.0E-199 1e+200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+dddiv1132 divide 1.0E-199 1e+199 -> 1E-398 Subnormal Rounded
+dddiv1133 divide 1.0E-199 1e+198 -> 1.0E-397 Subnormal
+dddiv1134 divide 2.0E-199 2e+198 -> 1.0E-397 Subnormal
+dddiv1135 divide 4.0E-199 4e+198 -> 1.0E-397 Subnormal
+dddiv1136 divide 10.0E-199 10e+198 -> 1.0E-397 Subnormal
+dddiv1137 divide 30.0E-199 30e+198 -> 1.0E-397 Subnormal
+
+-- randoms
+dddiv2010 divide -3.303226714900711E-35 8.796578842713183E+73 -> -3.755126594058783E-109 Inexact Rounded
+dddiv2011 divide 933153327821073.6 68782181090246.25 -> 13.56678885475763 Inexact Rounded
+dddiv2012 divide 5.04752436057906E-72 -8.179481771238642E+64 -> -6.170958627632835E-137 Inexact Rounded
+dddiv2013 divide -3707613309582318 3394911196503.048 -> -1092.109070010836 Inexact Rounded
+dddiv2014 divide 99689.0555190461 -4.735208553891464 -> -21052.72753765411 Inexact Rounded
+dddiv2015 divide -1447915775613329 269750797.8184875 -> -5367605.164925653 Inexact Rounded
+dddiv2016 divide -9.394881304225258E-19 -830585.0252671636 -> 1.131116143251358E-24 Inexact Rounded
+dddiv2017 divide -1.056283432738934 88.58754555124013 -> -0.01192361100159352 Inexact Rounded
+dddiv2018 divide 5763220933343.081 689089567025052.1 -> 0.008363529516524456 Inexact Rounded
+dddiv2019 divide 873819.122103216 9.740612494523300E-49 -> 8.970884763093948E+53 Inexact Rounded
+dddiv2020 divide 8022914.838533576 6178.566801742713 -> 1298.507420243583 Inexact Rounded
+dddiv2021 divide 203982.7605650363 -2158.283639053435 -> -94.51156320422168 Inexact Rounded
+dddiv2022 divide 803.6310547013030 7101143795399.238 -> 1.131692411611166E-10 Inexact Rounded
+dddiv2023 divide 9.251697842123399E-82 -1.342350220606119E-7 -> -6.892163982321936E-75 Inexact Rounded
+dddiv2024 divide -1.980600645637992E-53 -5.474262753214457E+77 -> 3.618022617703168E-131 Inexact Rounded
+dddiv2025 divide -210.0322996351690 -8.580951835872843E+80 -> 2.447657365434971E-79 Inexact Rounded
+dddiv2026 divide -1.821980314020370E+85 -3.018915267138165 -> 6.035215144503042E+84 Inexact Rounded
+dddiv2027 divide -772264503601.1047 5.158258271408988E-86 -> -1.497141986630614E+97 Inexact Rounded
+dddiv2028 divide -767.0532415847106 2.700027228028939E-59 -> -2.840909282772941E+61 Inexact Rounded
+dddiv2029 divide 496724.8548250093 7.32700588163100E+66 -> 6.779370220929013E-62 Inexact Rounded
+dddiv2030 divide -304232651447703.9 -108.9730808657440 -> 2791814721862.565 Inexact Rounded
+dddiv2031 divide -7.233817192699405E+42 -5711302004.149411 -> 1.266579352211430E+33 Inexact Rounded
+dddiv2032 divide -9.999221444912745E+96 4010569406446197 -> -2.493217404202250E+81 Inexact Rounded
+dddiv2033 divide -1837272.061937622 8.356322838066762 -> -219866.0939196882 Inexact Rounded
+dddiv2034 divide 2168.517555606529 209.1910258615061 -> 10.36620737756784 Inexact Rounded
+dddiv2035 divide -1.884389790576371E+88 2.95181953870583E+20 -> -6.383824505079828E+67 Inexact Rounded
+dddiv2036 divide 732263.6037438196 961222.3634446889 -> 0.7618045850698269 Inexact Rounded
+dddiv2037 divide -813461419.0348336 5.376293753809143E+84 -> -1.513052404285927E-76 Inexact Rounded
+dddiv2038 divide -45562133508108.50 -9.776843494690107E+51 -> 4.660208945029519E-39 Inexact Rounded
+dddiv2039 divide -6.489393172441016E+80 -9101965.097852113 -> 7.129661674897421E+73 Inexact Rounded
+dddiv2040 divide 3.694576237117349E+93 6683512.012622003 -> 5.527896456443912E+86 Inexact Rounded
+dddiv2041 divide -2.252877726403272E+19 -7451913256.181367 -> 3023220546.125531 Inexact Rounded
+dddiv2042 divide 518303.1989111842 50.01587020474133 -> 10362.77479107123 Inexact Rounded
+dddiv2043 divide 2.902087881880103E+24 33.32400992305702 -> 8.708699488989578E+22 Inexact Rounded
+dddiv2044 divide 549619.4559510557 1660824845196338 -> 3.309316196351104E-10 Inexact Rounded
+dddiv2045 divide -6775670774684043 8292152023.077262 -> -817118.4941891062 Inexact Rounded
+dddiv2046 divide -77.50923921524079 -5.636882655425815E+74 -> 1.375037302588405E-73 Inexact Rounded
+dddiv2047 divide -2.984889459605149E-10 -88106156784122.99 -> 3.387833005721384E-24 Inexact Rounded
+dddiv2048 divide 0.949517293997085 44767115.96450998 -> 2.121015110175589E-8 Inexact Rounded
+dddiv2049 divide -2760937211.084521 -1087015876975408 -> 0.000002539923537057024 Inexact Rounded
+dddiv2050 divide 28438351.85030536 -4.209397904088624E-47 -> -6.755919135770688E+53 Inexact Rounded
+dddiv2051 divide -85562731.6820956 -7.166045442530185E+45 -> 1.194002080621542E-38 Inexact Rounded
+dddiv2052 divide 2533802852165.25 7154.119606235955 -> 354173957.3317501 Inexact Rounded
+dddiv2053 divide -8858831346851.474 97.59734208801716 -> -90769186509.83577 Inexact Rounded
+dddiv2054 divide 176783629801387.5 840073263.3109817 -> 210438.3480848206 Inexact Rounded
+dddiv2055 divide -493506471796175.6 79733894790822.03 -> -6.189418854940746 Inexact Rounded
+dddiv2056 divide 790.1682542103445 829.9449370367435 -> 0.9520731062371214 Inexact Rounded
+dddiv2057 divide -8920459838.583164 -4767.889187899214 -> 1870945.294035581 Inexact Rounded
+dddiv2058 divide 53536687164422.1 53137.5007032689 -> 1007512330.385698 Inexact Rounded
+dddiv2059 divide 4.051532311146561E-74 -2.343089768972261E+94 -> -1.729140882606332E-168 Inexact Rounded
+dddiv2060 divide -14847758778636.88 3.062543516383807E-43 -> -4.848178874587497E+55 Inexact Rounded
+
+-- Division probably has pre-rounding, so need to test rounding
+-- explicitly rather than assume included through other tests;
+-- tests include simple rounding and also the tricky cases of sticky
+-- bits following two zeros
+--
+-- 1/99999 gives 0.0000100001000010000100001000010000100001
+-- 1234567890123456
+--
+-- 1/999999 gives 0.000001000001000001000001000001000001000001
+-- 1234567890123456
+
+rounding: ceiling
+dddiv3001 divide 1 3 -> 0.3333333333333334 Inexact Rounded
+dddiv3002 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3003 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
+dddiv3004 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
+
+rounding: floor
+dddiv3011 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3012 divide 2 3 -> 0.6666666666666666 Inexact Rounded
+dddiv3013 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3014 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: up
+dddiv3021 divide 1 3 -> 0.3333333333333334 Inexact Rounded
+dddiv3022 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3023 divide 1 99999 -> 0.00001000010000100002 Inexact Rounded
+dddiv3024 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
+
+rounding: down
+dddiv3031 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3032 divide 2 3 -> 0.6666666666666666 Inexact Rounded
+dddiv3033 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3034 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: half_up
+dddiv3041 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3042 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3043 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3044 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: half_down
+dddiv3051 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3052 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3053 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3054 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: half_even
+dddiv3061 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3062 divide 2 3 -> 0.6666666666666667 Inexact Rounded
+dddiv3063 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3064 divide 1 999999 -> 0.000001000001000001000 Inexact Rounded
+
+rounding: 05up
+dddiv3071 divide 1 3 -> 0.3333333333333333 Inexact Rounded
+dddiv3072 divide 2 3 -> 0.6666666666666666 Inexact Rounded
+dddiv3073 divide 1 99999 -> 0.00001000010000100001 Inexact Rounded
+dddiv3074 divide 1 999999 -> 0.000001000001000001001 Inexact Rounded
+
+-- random divide tests with result near 1
+rounding: half_even
+dddiv4001 divide 3195385192916917 3195385192946695 -> 0.9999999999906809 Inexact Rounded
+dddiv4002 divide 1393723067526993 1393723067519475 -> 1.000000000005394 Inexact Rounded
+dddiv4003 divide 759985543702302 759985543674015 -> 1.000000000037220 Inexact Rounded
+dddiv4004 divide 9579158456027302 9579158456036864 -> 0.9999999999990018 Inexact Rounded
+dddiv4005 divide 7079398299143569 7079398299156904 -> 0.9999999999981164 Inexact Rounded
+dddiv4006 divide 6636169255366598 6636169255336386 -> 1.000000000004553 Inexact Rounded
+dddiv4007 divide 6964813971340090 6964813971321554 -> 1.000000000002661 Inexact Rounded
+dddiv4008 divide 4182275225480784 4182275225454009 -> 1.000000000006402 Inexact Rounded
+dddiv4009 divide 9228325124938029 9228325124918730 -> 1.000000000002091 Inexact Rounded
+dddiv4010 divide 3428346338630192 3428346338609843 -> 1.000000000005936 Inexact Rounded
+dddiv4011 divide 2143511550722893 2143511550751754 -> 0.9999999999865356 Inexact Rounded
+dddiv4012 divide 1672732924396785 1672732924401811 -> 0.9999999999969953 Inexact Rounded
+dddiv4013 divide 4190714611948216 4190714611948664 -> 0.9999999999998931 Inexact Rounded
+dddiv4014 divide 3942254800848877 3942254800814556 -> 1.000000000008706 Inexact Rounded
+dddiv4015 divide 2854459826952334 2854459826960762 -> 0.9999999999970474 Inexact Rounded
+dddiv4016 divide 2853258953664731 2853258953684471 -> 0.9999999999930816 Inexact Rounded
+dddiv4017 divide 9453512638125978 9453512638146425 -> 0.9999999999978371 Inexact Rounded
+dddiv4018 divide 339476633940369 339476633912887 -> 1.000000000080954 Inexact Rounded
+dddiv4019 divide 4542181492688467 4542181492697735 -> 0.9999999999979596 Inexact Rounded
+dddiv4020 divide 7312600192399197 7312600192395424 -> 1.000000000000516 Inexact Rounded
+dddiv4021 divide 1811674985570111 1811674985603935 -> 0.9999999999813300 Inexact Rounded
+dddiv4022 divide 1706462639003481 1706462639017740 -> 0.9999999999916441 Inexact Rounded
+dddiv4023 divide 6697052654940368 6697052654934110 -> 1.000000000000934 Inexact Rounded
+dddiv4024 divide 5015283664277539 5015283664310719 -> 0.9999999999933842 Inexact Rounded
+dddiv4025 divide 2359501561537464 2359501561502464 -> 1.000000000014834 Inexact Rounded
+dddiv4026 divide 2669850227909157 2669850227901548 -> 1.000000000002850 Inexact Rounded
+dddiv4027 divide 9329725546974648 9329725547002445 -> 0.9999999999970206 Inexact Rounded
+dddiv4028 divide 3228562867071248 3228562867106206 -> 0.9999999999891723 Inexact Rounded
+dddiv4029 divide 4862226644921175 4862226644909380 -> 1.000000000002426 Inexact Rounded
+dddiv4030 divide 1022267997054529 1022267997071329 -> 0.9999999999835660 Inexact Rounded
+dddiv4031 divide 1048777482023719 1048777482000948 -> 1.000000000021712 Inexact Rounded
+dddiv4032 divide 9980113777337098 9980113777330539 -> 1.000000000000657 Inexact Rounded
+dddiv4033 divide 7506839167963908 7506839167942901 -> 1.000000000002798 Inexact Rounded
+dddiv4034 divide 231119751977860 231119751962453 -> 1.000000000066662 Inexact Rounded
+dddiv4035 divide 4034903664762962 4034903664795526 -> 0.9999999999919294 Inexact Rounded
+dddiv4036 divide 5700122152274696 5700122152251386 -> 1.000000000004089 Inexact Rounded
+dddiv4037 divide 6869599590293110 6869599590293495 -> 0.9999999999999440 Inexact Rounded
+dddiv4038 divide 5576281960092797 5576281960105579 -> 0.9999999999977078 Inexact Rounded
+dddiv4039 divide 2304844888381318 2304844888353073 -> 1.000000000012255 Inexact Rounded
+dddiv4040 divide 3265933651656452 3265933651682779 -> 0.9999999999919389 Inexact Rounded
+dddiv4041 divide 5235714985079914 5235714985066131 -> 1.000000000002632 Inexact Rounded
+dddiv4042 divide 5578481572827551 5578481572822945 -> 1.000000000000826 Inexact Rounded
+dddiv4043 divide 4909616081396134 4909616081373076 -> 1.000000000004696 Inexact Rounded
+dddiv4044 divide 636447224349537 636447224338757 -> 1.000000000016938 Inexact Rounded
+dddiv4045 divide 1539373428396640 1539373428364727 -> 1.000000000020731 Inexact Rounded
+dddiv4046 divide 2028786707377893 2028786707378866 -> 0.9999999999995204 Inexact Rounded
+dddiv4047 divide 137643260486222 137643260487419 -> 0.9999999999913036 Inexact Rounded
+dddiv4048 divide 247451519746765 247451519752267 -> 0.9999999999777653 Inexact Rounded
+dddiv4049 divide 7877858475022054 7877858474999794 -> 1.000000000002826 Inexact Rounded
+dddiv4050 divide 7333242694766258 7333242694744628 -> 1.000000000002950 Inexact Rounded
+dddiv4051 divide 124051503698592 124051503699397 -> 0.9999999999935108 Inexact Rounded
+dddiv4052 divide 8944737432385188 8944737432406860 -> 0.9999999999975771 Inexact Rounded
+dddiv4053 divide 9883948923406874 9883948923424843 -> 0.9999999999981820 Inexact Rounded
+dddiv4054 divide 6829178741654284 6829178741671973 -> 0.9999999999974098 Inexact Rounded
+dddiv4055 divide 7342752479768122 7342752479793385 -> 0.9999999999965595 Inexact Rounded
+dddiv4056 divide 8066426579008783 8066426578977563 -> 1.000000000003870 Inexact Rounded
+dddiv4057 divide 8992775071383295 8992775071352712 -> 1.000000000003401 Inexact Rounded
+dddiv4058 divide 5485011755545641 5485011755543611 -> 1.000000000000370 Inexact Rounded
+dddiv4059 divide 5779983054353918 5779983054365300 -> 0.9999999999980308 Inexact Rounded
+dddiv4060 divide 9502265102713774 9502265102735208 -> 0.9999999999977443 Inexact Rounded
+dddiv4061 divide 2109558399130981 2109558399116281 -> 1.000000000006968 Inexact Rounded
+dddiv4062 divide 5296182636350471 5296182636351521 -> 0.9999999999998017 Inexact Rounded
+dddiv4063 divide 1440019225591883 1440019225601844 -> 0.9999999999930827 Inexact Rounded
+dddiv4064 divide 8182110791881341 8182110791847174 -> 1.000000000004176 Inexact Rounded
+dddiv4065 divide 489098235512060 489098235534516 -> 0.9999999999540869 Inexact Rounded
+dddiv4066 divide 6475687084782038 6475687084756089 -> 1.000000000004007 Inexact Rounded
+dddiv4067 divide 8094348555736948 8094348555759236 -> 0.9999999999972465 Inexact Rounded
+dddiv4068 divide 1982766816291543 1982766816309463 -> 0.9999999999909621 Inexact Rounded
+dddiv4069 divide 9277314300113251 9277314300084467 -> 1.000000000003103 Inexact Rounded
+dddiv4070 divide 4335532959318934 4335532959293167 -> 1.000000000005943 Inexact Rounded
+dddiv4071 divide 7767113032981348 7767113032968132 -> 1.000000000001702 Inexact Rounded
+dddiv4072 divide 1578548053342868 1578548053370448 -> 0.9999999999825282 Inexact Rounded
+dddiv4073 divide 3790420686666898 3790420686636315 -> 1.000000000008068 Inexact Rounded
+dddiv4074 divide 871682421955147 871682421976441 -> 0.9999999999755714 Inexact Rounded
+dddiv4075 divide 744141054479940 744141054512329 -> 0.9999999999564746 Inexact Rounded
+dddiv4076 divide 8956824183670735 8956824183641741 -> 1.000000000003237 Inexact Rounded
+dddiv4077 divide 8337291694485682 8337291694451193 -> 1.000000000004137 Inexact Rounded
+dddiv4078 divide 4107775944683669 4107775944657097 -> 1.000000000006469 Inexact Rounded
+dddiv4079 divide 8691900057964648 8691900057997555 -> 0.9999999999962141 Inexact Rounded
+dddiv4080 divide 2229528520536462 2229528520502337 -> 1.000000000015306 Inexact Rounded
+dddiv4081 divide 398442083774322 398442083746273 -> 1.000000000070397 Inexact Rounded
+dddiv4082 divide 5319819776808759 5319819776838313 -> 0.9999999999944445 Inexact Rounded
+dddiv4083 divide 7710491299066855 7710491299041858 -> 1.000000000003242 Inexact Rounded
+dddiv4084 divide 9083231296087266 9083231296058160 -> 1.000000000003204 Inexact Rounded
+dddiv4085 divide 3566873574904559 3566873574890328 -> 1.000000000003990 Inexact Rounded
+dddiv4086 divide 596343290550525 596343290555614 -> 0.9999999999914663 Inexact Rounded
+dddiv4087 divide 278227925093192 278227925068104 -> 1.000000000090171 Inexact Rounded
+dddiv4088 divide 3292902958490649 3292902958519881 -> 0.9999999999911227 Inexact Rounded
+dddiv4089 divide 5521871364245881 5521871364229536 -> 1.000000000002960 Inexact Rounded
+dddiv4090 divide 2406505602883617 2406505602857997 -> 1.000000000010646 Inexact Rounded
+dddiv4091 divide 7741146984869208 7741146984867255 -> 1.000000000000252 Inexact Rounded
+dddiv4092 divide 4576041832414909 4576041832405102 -> 1.000000000002143 Inexact Rounded
+dddiv4093 divide 9183756982878057 9183756982901934 -> 0.9999999999974001 Inexact Rounded
+dddiv4094 divide 6215736513855159 6215736513870342 -> 0.9999999999975573 Inexact Rounded
+dddiv4095 divide 248554968534533 248554968551417 -> 0.9999999999320714 Inexact Rounded
+dddiv4096 divide 376314165668645 376314165659755 -> 1.000000000023624 Inexact Rounded
+dddiv4097 divide 5513569249809718 5513569249808906 -> 1.000000000000147 Inexact Rounded
+dddiv4098 divide 3367992242167904 3367992242156228 -> 1.000000000003467 Inexact Rounded
+dddiv4099 divide 6134869538966967 6134869538985986 -> 0.9999999999968999 Inexact Rounded
+
+-- Null tests
+dddiv9998 divide 10 # -> NaN Invalid_operation
+dddiv9999 divide # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddDivideInt.decTest b/Lib/test/decimaltestdata/ddDivideInt.decTest
index 1555b4217d..bec567986f 100644
--- a/Lib/test/decimaltestdata/ddDivideInt.decTest
+++ b/Lib/test/decimaltestdata/ddDivideInt.decTest
@@ -1,449 +1,449 @@
-------------------------------------------------------------------------
--- ddDivideInt.decTest -- decDouble integer division --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-dddvi001 divideint 1 1 -> 1
-dddvi002 divideint 2 1 -> 2
-dddvi003 divideint 1 2 -> 0
-dddvi004 divideint 2 2 -> 1
-dddvi005 divideint 0 1 -> 0
-dddvi006 divideint 0 2 -> 0
-dddvi007 divideint 1 3 -> 0
-dddvi008 divideint 2 3 -> 0
-dddvi009 divideint 3 3 -> 1
-
-dddvi010 divideint 2.4 1 -> 2
-dddvi011 divideint 2.4 -1 -> -2
-dddvi012 divideint -2.4 1 -> -2
-dddvi013 divideint -2.4 -1 -> 2
-dddvi014 divideint 2.40 1 -> 2
-dddvi015 divideint 2.400 1 -> 2
-dddvi016 divideint 2.4 2 -> 1
-dddvi017 divideint 2.400 2 -> 1
-dddvi018 divideint 2. 2 -> 1
-dddvi019 divideint 20 20 -> 1
-
-dddvi020 divideint 187 187 -> 1
-dddvi021 divideint 5 2 -> 2
-dddvi022 divideint 5 2.0 -> 2
-dddvi023 divideint 5 2.000 -> 2
-dddvi024 divideint 5 0.200 -> 25
-dddvi025 divideint 5 0.200 -> 25
-
-dddvi030 divideint 1 2 -> 0
-dddvi031 divideint 1 4 -> 0
-dddvi032 divideint 1 8 -> 0
-dddvi033 divideint 1 16 -> 0
-dddvi034 divideint 1 32 -> 0
-dddvi035 divideint 1 64 -> 0
-dddvi040 divideint 1 -2 -> -0
-dddvi041 divideint 1 -4 -> -0
-dddvi042 divideint 1 -8 -> -0
-dddvi043 divideint 1 -16 -> -0
-dddvi044 divideint 1 -32 -> -0
-dddvi045 divideint 1 -64 -> -0
-dddvi050 divideint -1 2 -> -0
-dddvi051 divideint -1 4 -> -0
-dddvi052 divideint -1 8 -> -0
-dddvi053 divideint -1 16 -> -0
-dddvi054 divideint -1 32 -> -0
-dddvi055 divideint -1 64 -> -0
-dddvi060 divideint -1 -2 -> 0
-dddvi061 divideint -1 -4 -> 0
-dddvi062 divideint -1 -8 -> 0
-dddvi063 divideint -1 -16 -> 0
-dddvi064 divideint -1 -32 -> 0
-dddvi065 divideint -1 -64 -> 0
-
--- similar with powers of ten
-dddvi160 divideint 1 1 -> 1
-dddvi161 divideint 1 10 -> 0
-dddvi162 divideint 1 100 -> 0
-dddvi163 divideint 1 1000 -> 0
-dddvi164 divideint 1 10000 -> 0
-dddvi165 divideint 1 100000 -> 0
-dddvi166 divideint 1 1000000 -> 0
-dddvi167 divideint 1 10000000 -> 0
-dddvi168 divideint 1 100000000 -> 0
-dddvi170 divideint 1 -1 -> -1
-dddvi171 divideint 1 -10 -> -0
-dddvi172 divideint 1 -100 -> -0
-dddvi173 divideint 1 -1000 -> -0
-dddvi174 divideint 1 -10000 -> -0
-dddvi175 divideint 1 -100000 -> -0
-dddvi176 divideint 1 -1000000 -> -0
-dddvi177 divideint 1 -10000000 -> -0
-dddvi178 divideint 1 -100000000 -> -0
-dddvi180 divideint -1 1 -> -1
-dddvi181 divideint -1 10 -> -0
-dddvi182 divideint -1 100 -> -0
-dddvi183 divideint -1 1000 -> -0
-dddvi184 divideint -1 10000 -> -0
-dddvi185 divideint -1 100000 -> -0
-dddvi186 divideint -1 1000000 -> -0
-dddvi187 divideint -1 10000000 -> -0
-dddvi188 divideint -1 100000000 -> -0
-dddvi190 divideint -1 -1 -> 1
-dddvi191 divideint -1 -10 -> 0
-dddvi192 divideint -1 -100 -> 0
-dddvi193 divideint -1 -1000 -> 0
-dddvi194 divideint -1 -10000 -> 0
-dddvi195 divideint -1 -100000 -> 0
-dddvi196 divideint -1 -1000000 -> 0
-dddvi197 divideint -1 -10000000 -> 0
-dddvi198 divideint -1 -100000000 -> 0
-
--- some long operand (at p=9) cases
-dddvi070 divideint 999999999 1 -> 999999999
-dddvi071 divideint 999999999.4 1 -> 999999999
-dddvi072 divideint 999999999.5 1 -> 999999999
-dddvi073 divideint 999999999.9 1 -> 999999999
-dddvi074 divideint 999999999.999 1 -> 999999999
-
-dddvi090 divideint 0. 1 -> 0
-dddvi091 divideint .0 1 -> 0
-dddvi092 divideint 0.00 1 -> 0
-dddvi093 divideint 0.00E+9 1 -> 0
-dddvi094 divideint 0.0000E-50 1 -> 0
-
-dddvi100 divideint 1 1 -> 1
-dddvi101 divideint 1 2 -> 0
-dddvi102 divideint 1 3 -> 0
-dddvi103 divideint 1 4 -> 0
-dddvi104 divideint 1 5 -> 0
-dddvi105 divideint 1 6 -> 0
-dddvi106 divideint 1 7 -> 0
-dddvi107 divideint 1 8 -> 0
-dddvi108 divideint 1 9 -> 0
-dddvi109 divideint 1 10 -> 0
-dddvi110 divideint 1 1 -> 1
-dddvi111 divideint 2 1 -> 2
-dddvi112 divideint 3 1 -> 3
-dddvi113 divideint 4 1 -> 4
-dddvi114 divideint 5 1 -> 5
-dddvi115 divideint 6 1 -> 6
-dddvi116 divideint 7 1 -> 7
-dddvi117 divideint 8 1 -> 8
-dddvi118 divideint 9 1 -> 9
-dddvi119 divideint 10 1 -> 10
-
--- from DiagBigDecimal
-dddvi131 divideint 101.3 1 -> 101
-dddvi132 divideint 101.0 1 -> 101
-dddvi133 divideint 101.3 3 -> 33
-dddvi134 divideint 101.0 3 -> 33
-dddvi135 divideint 2.4 1 -> 2
-dddvi136 divideint 2.400 1 -> 2
-dddvi137 divideint 18 18 -> 1
-dddvi138 divideint 1120 1000 -> 1
-dddvi139 divideint 2.4 2 -> 1
-dddvi140 divideint 2.400 2 -> 1
-dddvi141 divideint 0.5 2.000 -> 0
-dddvi142 divideint 8.005 7 -> 1
-dddvi143 divideint 5 2 -> 2
-dddvi144 divideint 0 2 -> 0
-dddvi145 divideint 0.00 2 -> 0
-
--- Others
-dddvi150 divideint 12345 4.999 -> 2469
-dddvi151 divideint 12345 4.99 -> 2473
-dddvi152 divideint 12345 4.9 -> 2519
-dddvi153 divideint 12345 5 -> 2469
-dddvi154 divideint 12345 5.1 -> 2420
-dddvi155 divideint 12345 5.01 -> 2464
-dddvi156 divideint 12345 5.001 -> 2468
-dddvi157 divideint 101 7.6 -> 13
-
--- Various flavours of divideint by 0
-dddvi201 divideint 0 0 -> NaN Division_undefined
-dddvi202 divideint 0.0E5 0 -> NaN Division_undefined
-dddvi203 divideint 0.000 0 -> NaN Division_undefined
-dddvi204 divideint 0.0001 0 -> Infinity Division_by_zero
-dddvi205 divideint 0.01 0 -> Infinity Division_by_zero
-dddvi206 divideint 0.1 0 -> Infinity Division_by_zero
-dddvi207 divideint 1 0 -> Infinity Division_by_zero
-dddvi208 divideint 1 0.0 -> Infinity Division_by_zero
-dddvi209 divideint 10 0.0 -> Infinity Division_by_zero
-dddvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero
-dddvi211 divideint 1E+380 0 -> Infinity Division_by_zero
-dddvi214 divideint -0.0001 0 -> -Infinity Division_by_zero
-dddvi215 divideint -0.01 0 -> -Infinity Division_by_zero
-dddvi216 divideint -0.1 0 -> -Infinity Division_by_zero
-dddvi217 divideint -1 0 -> -Infinity Division_by_zero
-dddvi218 divideint -1 0.0 -> -Infinity Division_by_zero
-dddvi219 divideint -10 0.0 -> -Infinity Division_by_zero
-dddvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero
-dddvi221 divideint -1E+380 0 -> -Infinity Division_by_zero
-
--- test some cases that are close to exponent overflow
-dddvi270 divideint 1 1e384 -> 0
-dddvi271 divideint 1 0.9e384 -> 0
-dddvi272 divideint 1 0.99e384 -> 0
-dddvi273 divideint 1 0.9999999999999999e384 -> 0
-dddvi274 divideint 9e384 1 -> NaN Division_impossible
-dddvi275 divideint 9.9e384 1 -> NaN Division_impossible
-dddvi276 divideint 9.99e384 1 -> NaN Division_impossible
-dddvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible
-
-dddvi280 divideint 0.1 9e-383 -> NaN Division_impossible
-dddvi281 divideint 0.1 99e-383 -> NaN Division_impossible
-dddvi282 divideint 0.1 999e-383 -> NaN Division_impossible
-dddvi283 divideint 0.1 9e-382 -> NaN Division_impossible
-dddvi284 divideint 0.1 99e-382 -> NaN Division_impossible
-
--- GD edge cases: lhs smaller than rhs but more digits
-dddvi301 divideint 0.9 2 -> 0
-dddvi302 divideint 0.9 2.0 -> 0
-dddvi303 divideint 0.9 2.1 -> 0
-dddvi304 divideint 0.9 2.00 -> 0
-dddvi305 divideint 0.9 2.01 -> 0
-dddvi306 divideint 0.12 1 -> 0
-dddvi307 divideint 0.12 1.0 -> 0
-dddvi308 divideint 0.12 1.00 -> 0
-dddvi309 divideint 0.12 1.0 -> 0
-dddvi310 divideint 0.12 1.00 -> 0
-dddvi311 divideint 0.12 2 -> 0
-dddvi312 divideint 0.12 2.0 -> 0
-dddvi313 divideint 0.12 2.1 -> 0
-dddvi314 divideint 0.12 2.00 -> 0
-dddvi315 divideint 0.12 2.01 -> 0
-
--- edge cases of impossible
-dddvi330 divideint 1234567890123456 10 -> 123456789012345
-dddvi331 divideint 1234567890123456 1 -> 1234567890123456
-dddvi332 divideint 1234567890123456 0.1 -> NaN Division_impossible
-dddvi333 divideint 1234567890123456 0.01 -> NaN Division_impossible
-
--- overflow and underflow tests [from divide]
-dddvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible
-dddvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible
-dddvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible
-dddvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible
-dddvi1055 divideint 1e-277 1e+311 -> 0
-dddvi1056 divideint 1e-277 -1e+311 -> -0
-dddvi1057 divideint -1e-277 1e+311 -> -0
-dddvi1058 divideint -1e-277 -1e+311 -> 0
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dddvi1060 divideint 1e-291 1e+101 -> 0
-dddvi1061 divideint 1e-291 1e+102 -> 0
-dddvi1062 divideint 1e-291 1e+103 -> 0
-dddvi1063 divideint 1e-291 1e+104 -> 0
-dddvi1064 divideint 1e-291 1e+105 -> 0
-dddvi1065 divideint 1e-291 1e+106 -> 0
-dddvi1066 divideint 1e-291 1e+107 -> 0
-dddvi1067 divideint 1e-291 1e+108 -> 0
-dddvi1068 divideint 1e-291 1e+109 -> 0
-dddvi1069 divideint 1e-291 1e+110 -> 0
-
-dddvi1101 divideint 1.0000E-394 1 -> 0
-dddvi1102 divideint 1.000E-394 1e+1 -> 0
-dddvi1103 divideint 1.00E-394 1e+2 -> 0
-
-dddvi1118 divideint 1E-394 1e+4 -> 0
-dddvi1119 divideint 3E-394 -1e+5 -> -0
-dddvi1120 divideint 5E-394 1e+5 -> 0
-
-dddvi1124 divideint 1E-394 -1e+4 -> -0
-dddvi1130 divideint 3.0E-394 -1e+5 -> -0
-
-dddvi1131 divideint 1.0E-199 1e+200 -> 0
-dddvi1132 divideint 1.0E-199 1e+199 -> 0
-dddvi1133 divideint 1.0E-199 1e+198 -> 0
-dddvi1134 divideint 2.0E-199 2e+198 -> 0
-dddvi1135 divideint 4.0E-199 4e+198 -> 0
-
--- long operand checks
-dddvi401 divideint 12345678000 100 -> 123456780
-dddvi402 divideint 1 12345678000 -> 0
-dddvi403 divideint 1234567800 10 -> 123456780
-dddvi404 divideint 1 1234567800 -> 0
-dddvi405 divideint 1234567890 10 -> 123456789
-dddvi406 divideint 1 1234567890 -> 0
-dddvi407 divideint 1234567891 10 -> 123456789
-dddvi408 divideint 1 1234567891 -> 0
-dddvi409 divideint 12345678901 100 -> 123456789
-dddvi410 divideint 1 12345678901 -> 0
-dddvi411 divideint 1234567896 10 -> 123456789
-dddvi412 divideint 1 1234567896 -> 0
-dddvi413 divideint 12345678948 100 -> 123456789
-dddvi414 divideint 12345678949 100 -> 123456789
-dddvi415 divideint 12345678950 100 -> 123456789
-dddvi416 divideint 12345678951 100 -> 123456789
-dddvi417 divideint 12345678999 100 -> 123456789
-dddvi441 divideint 12345678000 1 -> 12345678000
-dddvi442 divideint 1 12345678000 -> 0
-dddvi443 divideint 1234567800 1 -> 1234567800
-dddvi444 divideint 1 1234567800 -> 0
-dddvi445 divideint 1234567890 1 -> 1234567890
-dddvi446 divideint 1 1234567890 -> 0
-dddvi447 divideint 1234567891 1 -> 1234567891
-dddvi448 divideint 1 1234567891 -> 0
-dddvi449 divideint 12345678901 1 -> 12345678901
-dddvi450 divideint 1 12345678901 -> 0
-dddvi451 divideint 1234567896 1 -> 1234567896
-dddvi452 divideint 1 1234567896 -> 0
-
--- more zeros, etc.
-dddvi531 divideint 5.00 1E-3 -> 5000
-dddvi532 divideint 00.00 0.000 -> NaN Division_undefined
-dddvi533 divideint 00.00 0E-3 -> NaN Division_undefined
-dddvi534 divideint 0 -0 -> NaN Division_undefined
-dddvi535 divideint -0 0 -> NaN Division_undefined
-dddvi536 divideint -0 -0 -> NaN Division_undefined
-
-dddvi541 divideint 0 -1 -> -0
-dddvi542 divideint -0 -1 -> 0
-dddvi543 divideint 0 1 -> 0
-dddvi544 divideint -0 1 -> -0
-dddvi545 divideint -1 0 -> -Infinity Division_by_zero
-dddvi546 divideint -1 -0 -> Infinity Division_by_zero
-dddvi547 divideint 1 0 -> Infinity Division_by_zero
-dddvi548 divideint 1 -0 -> -Infinity Division_by_zero
-
-dddvi551 divideint 0.0 -1 -> -0
-dddvi552 divideint -0.0 -1 -> 0
-dddvi553 divideint 0.0 1 -> 0
-dddvi554 divideint -0.0 1 -> -0
-dddvi555 divideint -1.0 0 -> -Infinity Division_by_zero
-dddvi556 divideint -1.0 -0 -> Infinity Division_by_zero
-dddvi557 divideint 1.0 0 -> Infinity Division_by_zero
-dddvi558 divideint 1.0 -0 -> -Infinity Division_by_zero
-
-dddvi561 divideint 0 -1.0 -> -0
-dddvi562 divideint -0 -1.0 -> 0
-dddvi563 divideint 0 1.0 -> 0
-dddvi564 divideint -0 1.0 -> -0
-dddvi565 divideint -1 0.0 -> -Infinity Division_by_zero
-dddvi566 divideint -1 -0.0 -> Infinity Division_by_zero
-dddvi567 divideint 1 0.0 -> Infinity Division_by_zero
-dddvi568 divideint 1 -0.0 -> -Infinity Division_by_zero
-
-dddvi571 divideint 0.0 -1.0 -> -0
-dddvi572 divideint -0.0 -1.0 -> 0
-dddvi573 divideint 0.0 1.0 -> 0
-dddvi574 divideint -0.0 1.0 -> -0
-dddvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero
-dddvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero
-dddvi577 divideint 1.0 0.0 -> Infinity Division_by_zero
-dddvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero
-
--- Specials
-dddvi580 divideint Inf -Inf -> NaN Invalid_operation
-dddvi581 divideint Inf -1000 -> -Infinity
-dddvi582 divideint Inf -1 -> -Infinity
-dddvi583 divideint Inf -0 -> -Infinity
-dddvi584 divideint Inf 0 -> Infinity
-dddvi585 divideint Inf 1 -> Infinity
-dddvi586 divideint Inf 1000 -> Infinity
-dddvi587 divideint Inf Inf -> NaN Invalid_operation
-dddvi588 divideint -1000 Inf -> -0
-dddvi589 divideint -Inf Inf -> NaN Invalid_operation
-dddvi590 divideint -1 Inf -> -0
-dddvi591 divideint -0 Inf -> -0
-dddvi592 divideint 0 Inf -> 0
-dddvi593 divideint 1 Inf -> 0
-dddvi594 divideint 1000 Inf -> 0
-dddvi595 divideint Inf Inf -> NaN Invalid_operation
-
-dddvi600 divideint -Inf -Inf -> NaN Invalid_operation
-dddvi601 divideint -Inf -1000 -> Infinity
-dddvi602 divideint -Inf -1 -> Infinity
-dddvi603 divideint -Inf -0 -> Infinity
-dddvi604 divideint -Inf 0 -> -Infinity
-dddvi605 divideint -Inf 1 -> -Infinity
-dddvi606 divideint -Inf 1000 -> -Infinity
-dddvi607 divideint -Inf Inf -> NaN Invalid_operation
-dddvi608 divideint -1000 Inf -> -0
-dddvi609 divideint -Inf -Inf -> NaN Invalid_operation
-dddvi610 divideint -1 -Inf -> 0
-dddvi611 divideint -0 -Inf -> 0
-dddvi612 divideint 0 -Inf -> -0
-dddvi613 divideint 1 -Inf -> -0
-dddvi614 divideint 1000 -Inf -> -0
-dddvi615 divideint Inf -Inf -> NaN Invalid_operation
-
-dddvi621 divideint NaN -Inf -> NaN
-dddvi622 divideint NaN -1000 -> NaN
-dddvi623 divideint NaN -1 -> NaN
-dddvi624 divideint NaN -0 -> NaN
-dddvi625 divideint NaN 0 -> NaN
-dddvi626 divideint NaN 1 -> NaN
-dddvi627 divideint NaN 1000 -> NaN
-dddvi628 divideint NaN Inf -> NaN
-dddvi629 divideint NaN NaN -> NaN
-dddvi630 divideint -Inf NaN -> NaN
-dddvi631 divideint -1000 NaN -> NaN
-dddvi632 divideint -1 NaN -> NaN
-dddvi633 divideint -0 NaN -> NaN
-dddvi634 divideint 0 NaN -> NaN
-dddvi635 divideint 1 NaN -> NaN
-dddvi636 divideint 1000 NaN -> NaN
-dddvi637 divideint Inf NaN -> NaN
-
-dddvi641 divideint sNaN -Inf -> NaN Invalid_operation
-dddvi642 divideint sNaN -1000 -> NaN Invalid_operation
-dddvi643 divideint sNaN -1 -> NaN Invalid_operation
-dddvi644 divideint sNaN -0 -> NaN Invalid_operation
-dddvi645 divideint sNaN 0 -> NaN Invalid_operation
-dddvi646 divideint sNaN 1 -> NaN Invalid_operation
-dddvi647 divideint sNaN 1000 -> NaN Invalid_operation
-dddvi648 divideint sNaN NaN -> NaN Invalid_operation
-dddvi649 divideint sNaN sNaN -> NaN Invalid_operation
-dddvi650 divideint NaN sNaN -> NaN Invalid_operation
-dddvi651 divideint -Inf sNaN -> NaN Invalid_operation
-dddvi652 divideint -1000 sNaN -> NaN Invalid_operation
-dddvi653 divideint -1 sNaN -> NaN Invalid_operation
-dddvi654 divideint -0 sNaN -> NaN Invalid_operation
-dddvi655 divideint 0 sNaN -> NaN Invalid_operation
-dddvi656 divideint 1 sNaN -> NaN Invalid_operation
-dddvi657 divideint 1000 sNaN -> NaN Invalid_operation
-dddvi658 divideint Inf sNaN -> NaN Invalid_operation
-dddvi659 divideint NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dddvi661 divideint NaN9 -Inf -> NaN9
-dddvi662 divideint NaN8 1000 -> NaN8
-dddvi663 divideint NaN7 Inf -> NaN7
-dddvi664 divideint -NaN6 NaN5 -> -NaN6
-dddvi665 divideint -Inf NaN4 -> NaN4
-dddvi666 divideint -1000 NaN3 -> NaN3
-dddvi667 divideint Inf -NaN2 -> -NaN2
-
-dddvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
-dddvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation
-dddvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation
-dddvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
-dddvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
-dddvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
-dddvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation
-dddvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
-dddvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation
-
--- Null tests
-dddvi900 divideint 10 # -> NaN Invalid_operation
-dddvi901 divideint # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddDivideInt.decTest -- decDouble integer division --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+dddvi001 divideint 1 1 -> 1
+dddvi002 divideint 2 1 -> 2
+dddvi003 divideint 1 2 -> 0
+dddvi004 divideint 2 2 -> 1
+dddvi005 divideint 0 1 -> 0
+dddvi006 divideint 0 2 -> 0
+dddvi007 divideint 1 3 -> 0
+dddvi008 divideint 2 3 -> 0
+dddvi009 divideint 3 3 -> 1
+
+dddvi010 divideint 2.4 1 -> 2
+dddvi011 divideint 2.4 -1 -> -2
+dddvi012 divideint -2.4 1 -> -2
+dddvi013 divideint -2.4 -1 -> 2
+dddvi014 divideint 2.40 1 -> 2
+dddvi015 divideint 2.400 1 -> 2
+dddvi016 divideint 2.4 2 -> 1
+dddvi017 divideint 2.400 2 -> 1
+dddvi018 divideint 2. 2 -> 1
+dddvi019 divideint 20 20 -> 1
+
+dddvi020 divideint 187 187 -> 1
+dddvi021 divideint 5 2 -> 2
+dddvi022 divideint 5 2.0 -> 2
+dddvi023 divideint 5 2.000 -> 2
+dddvi024 divideint 5 0.200 -> 25
+dddvi025 divideint 5 0.200 -> 25
+
+dddvi030 divideint 1 2 -> 0
+dddvi031 divideint 1 4 -> 0
+dddvi032 divideint 1 8 -> 0
+dddvi033 divideint 1 16 -> 0
+dddvi034 divideint 1 32 -> 0
+dddvi035 divideint 1 64 -> 0
+dddvi040 divideint 1 -2 -> -0
+dddvi041 divideint 1 -4 -> -0
+dddvi042 divideint 1 -8 -> -0
+dddvi043 divideint 1 -16 -> -0
+dddvi044 divideint 1 -32 -> -0
+dddvi045 divideint 1 -64 -> -0
+dddvi050 divideint -1 2 -> -0
+dddvi051 divideint -1 4 -> -0
+dddvi052 divideint -1 8 -> -0
+dddvi053 divideint -1 16 -> -0
+dddvi054 divideint -1 32 -> -0
+dddvi055 divideint -1 64 -> -0
+dddvi060 divideint -1 -2 -> 0
+dddvi061 divideint -1 -4 -> 0
+dddvi062 divideint -1 -8 -> 0
+dddvi063 divideint -1 -16 -> 0
+dddvi064 divideint -1 -32 -> 0
+dddvi065 divideint -1 -64 -> 0
+
+-- similar with powers of ten
+dddvi160 divideint 1 1 -> 1
+dddvi161 divideint 1 10 -> 0
+dddvi162 divideint 1 100 -> 0
+dddvi163 divideint 1 1000 -> 0
+dddvi164 divideint 1 10000 -> 0
+dddvi165 divideint 1 100000 -> 0
+dddvi166 divideint 1 1000000 -> 0
+dddvi167 divideint 1 10000000 -> 0
+dddvi168 divideint 1 100000000 -> 0
+dddvi170 divideint 1 -1 -> -1
+dddvi171 divideint 1 -10 -> -0
+dddvi172 divideint 1 -100 -> -0
+dddvi173 divideint 1 -1000 -> -0
+dddvi174 divideint 1 -10000 -> -0
+dddvi175 divideint 1 -100000 -> -0
+dddvi176 divideint 1 -1000000 -> -0
+dddvi177 divideint 1 -10000000 -> -0
+dddvi178 divideint 1 -100000000 -> -0
+dddvi180 divideint -1 1 -> -1
+dddvi181 divideint -1 10 -> -0
+dddvi182 divideint -1 100 -> -0
+dddvi183 divideint -1 1000 -> -0
+dddvi184 divideint -1 10000 -> -0
+dddvi185 divideint -1 100000 -> -0
+dddvi186 divideint -1 1000000 -> -0
+dddvi187 divideint -1 10000000 -> -0
+dddvi188 divideint -1 100000000 -> -0
+dddvi190 divideint -1 -1 -> 1
+dddvi191 divideint -1 -10 -> 0
+dddvi192 divideint -1 -100 -> 0
+dddvi193 divideint -1 -1000 -> 0
+dddvi194 divideint -1 -10000 -> 0
+dddvi195 divideint -1 -100000 -> 0
+dddvi196 divideint -1 -1000000 -> 0
+dddvi197 divideint -1 -10000000 -> 0
+dddvi198 divideint -1 -100000000 -> 0
+
+-- some long operand (at p=9) cases
+dddvi070 divideint 999999999 1 -> 999999999
+dddvi071 divideint 999999999.4 1 -> 999999999
+dddvi072 divideint 999999999.5 1 -> 999999999
+dddvi073 divideint 999999999.9 1 -> 999999999
+dddvi074 divideint 999999999.999 1 -> 999999999
+
+dddvi090 divideint 0. 1 -> 0
+dddvi091 divideint .0 1 -> 0
+dddvi092 divideint 0.00 1 -> 0
+dddvi093 divideint 0.00E+9 1 -> 0
+dddvi094 divideint 0.0000E-50 1 -> 0
+
+dddvi100 divideint 1 1 -> 1
+dddvi101 divideint 1 2 -> 0
+dddvi102 divideint 1 3 -> 0
+dddvi103 divideint 1 4 -> 0
+dddvi104 divideint 1 5 -> 0
+dddvi105 divideint 1 6 -> 0
+dddvi106 divideint 1 7 -> 0
+dddvi107 divideint 1 8 -> 0
+dddvi108 divideint 1 9 -> 0
+dddvi109 divideint 1 10 -> 0
+dddvi110 divideint 1 1 -> 1
+dddvi111 divideint 2 1 -> 2
+dddvi112 divideint 3 1 -> 3
+dddvi113 divideint 4 1 -> 4
+dddvi114 divideint 5 1 -> 5
+dddvi115 divideint 6 1 -> 6
+dddvi116 divideint 7 1 -> 7
+dddvi117 divideint 8 1 -> 8
+dddvi118 divideint 9 1 -> 9
+dddvi119 divideint 10 1 -> 10
+
+-- from DiagBigDecimal
+dddvi131 divideint 101.3 1 -> 101
+dddvi132 divideint 101.0 1 -> 101
+dddvi133 divideint 101.3 3 -> 33
+dddvi134 divideint 101.0 3 -> 33
+dddvi135 divideint 2.4 1 -> 2
+dddvi136 divideint 2.400 1 -> 2
+dddvi137 divideint 18 18 -> 1
+dddvi138 divideint 1120 1000 -> 1
+dddvi139 divideint 2.4 2 -> 1
+dddvi140 divideint 2.400 2 -> 1
+dddvi141 divideint 0.5 2.000 -> 0
+dddvi142 divideint 8.005 7 -> 1
+dddvi143 divideint 5 2 -> 2
+dddvi144 divideint 0 2 -> 0
+dddvi145 divideint 0.00 2 -> 0
+
+-- Others
+dddvi150 divideint 12345 4.999 -> 2469
+dddvi151 divideint 12345 4.99 -> 2473
+dddvi152 divideint 12345 4.9 -> 2519
+dddvi153 divideint 12345 5 -> 2469
+dddvi154 divideint 12345 5.1 -> 2420
+dddvi155 divideint 12345 5.01 -> 2464
+dddvi156 divideint 12345 5.001 -> 2468
+dddvi157 divideint 101 7.6 -> 13
+
+-- Various flavours of divideint by 0
+dddvi201 divideint 0 0 -> NaN Division_undefined
+dddvi202 divideint 0.0E5 0 -> NaN Division_undefined
+dddvi203 divideint 0.000 0 -> NaN Division_undefined
+dddvi204 divideint 0.0001 0 -> Infinity Division_by_zero
+dddvi205 divideint 0.01 0 -> Infinity Division_by_zero
+dddvi206 divideint 0.1 0 -> Infinity Division_by_zero
+dddvi207 divideint 1 0 -> Infinity Division_by_zero
+dddvi208 divideint 1 0.0 -> Infinity Division_by_zero
+dddvi209 divideint 10 0.0 -> Infinity Division_by_zero
+dddvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero
+dddvi211 divideint 1E+380 0 -> Infinity Division_by_zero
+dddvi214 divideint -0.0001 0 -> -Infinity Division_by_zero
+dddvi215 divideint -0.01 0 -> -Infinity Division_by_zero
+dddvi216 divideint -0.1 0 -> -Infinity Division_by_zero
+dddvi217 divideint -1 0 -> -Infinity Division_by_zero
+dddvi218 divideint -1 0.0 -> -Infinity Division_by_zero
+dddvi219 divideint -10 0.0 -> -Infinity Division_by_zero
+dddvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero
+dddvi221 divideint -1E+380 0 -> -Infinity Division_by_zero
+
+-- test some cases that are close to exponent overflow
+dddvi270 divideint 1 1e384 -> 0
+dddvi271 divideint 1 0.9e384 -> 0
+dddvi272 divideint 1 0.99e384 -> 0
+dddvi273 divideint 1 0.9999999999999999e384 -> 0
+dddvi274 divideint 9e384 1 -> NaN Division_impossible
+dddvi275 divideint 9.9e384 1 -> NaN Division_impossible
+dddvi276 divideint 9.99e384 1 -> NaN Division_impossible
+dddvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible
+
+dddvi280 divideint 0.1 9e-383 -> NaN Division_impossible
+dddvi281 divideint 0.1 99e-383 -> NaN Division_impossible
+dddvi282 divideint 0.1 999e-383 -> NaN Division_impossible
+dddvi283 divideint 0.1 9e-382 -> NaN Division_impossible
+dddvi284 divideint 0.1 99e-382 -> NaN Division_impossible
+
+-- GD edge cases: lhs smaller than rhs but more digits
+dddvi301 divideint 0.9 2 -> 0
+dddvi302 divideint 0.9 2.0 -> 0
+dddvi303 divideint 0.9 2.1 -> 0
+dddvi304 divideint 0.9 2.00 -> 0
+dddvi305 divideint 0.9 2.01 -> 0
+dddvi306 divideint 0.12 1 -> 0
+dddvi307 divideint 0.12 1.0 -> 0
+dddvi308 divideint 0.12 1.00 -> 0
+dddvi309 divideint 0.12 1.0 -> 0
+dddvi310 divideint 0.12 1.00 -> 0
+dddvi311 divideint 0.12 2 -> 0
+dddvi312 divideint 0.12 2.0 -> 0
+dddvi313 divideint 0.12 2.1 -> 0
+dddvi314 divideint 0.12 2.00 -> 0
+dddvi315 divideint 0.12 2.01 -> 0
+
+-- edge cases of impossible
+dddvi330 divideint 1234567890123456 10 -> 123456789012345
+dddvi331 divideint 1234567890123456 1 -> 1234567890123456
+dddvi332 divideint 1234567890123456 0.1 -> NaN Division_impossible
+dddvi333 divideint 1234567890123456 0.01 -> NaN Division_impossible
+
+-- overflow and underflow tests [from divide]
+dddvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible
+dddvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible
+dddvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible
+dddvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible
+dddvi1055 divideint 1e-277 1e+311 -> 0
+dddvi1056 divideint 1e-277 -1e+311 -> -0
+dddvi1057 divideint -1e-277 1e+311 -> -0
+dddvi1058 divideint -1e-277 -1e+311 -> 0
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dddvi1060 divideint 1e-291 1e+101 -> 0
+dddvi1061 divideint 1e-291 1e+102 -> 0
+dddvi1062 divideint 1e-291 1e+103 -> 0
+dddvi1063 divideint 1e-291 1e+104 -> 0
+dddvi1064 divideint 1e-291 1e+105 -> 0
+dddvi1065 divideint 1e-291 1e+106 -> 0
+dddvi1066 divideint 1e-291 1e+107 -> 0
+dddvi1067 divideint 1e-291 1e+108 -> 0
+dddvi1068 divideint 1e-291 1e+109 -> 0
+dddvi1069 divideint 1e-291 1e+110 -> 0
+
+dddvi1101 divideint 1.0000E-394 1 -> 0
+dddvi1102 divideint 1.000E-394 1e+1 -> 0
+dddvi1103 divideint 1.00E-394 1e+2 -> 0
+
+dddvi1118 divideint 1E-394 1e+4 -> 0
+dddvi1119 divideint 3E-394 -1e+5 -> -0
+dddvi1120 divideint 5E-394 1e+5 -> 0
+
+dddvi1124 divideint 1E-394 -1e+4 -> -0
+dddvi1130 divideint 3.0E-394 -1e+5 -> -0
+
+dddvi1131 divideint 1.0E-199 1e+200 -> 0
+dddvi1132 divideint 1.0E-199 1e+199 -> 0
+dddvi1133 divideint 1.0E-199 1e+198 -> 0
+dddvi1134 divideint 2.0E-199 2e+198 -> 0
+dddvi1135 divideint 4.0E-199 4e+198 -> 0
+
+-- long operand checks
+dddvi401 divideint 12345678000 100 -> 123456780
+dddvi402 divideint 1 12345678000 -> 0
+dddvi403 divideint 1234567800 10 -> 123456780
+dddvi404 divideint 1 1234567800 -> 0
+dddvi405 divideint 1234567890 10 -> 123456789
+dddvi406 divideint 1 1234567890 -> 0
+dddvi407 divideint 1234567891 10 -> 123456789
+dddvi408 divideint 1 1234567891 -> 0
+dddvi409 divideint 12345678901 100 -> 123456789
+dddvi410 divideint 1 12345678901 -> 0
+dddvi411 divideint 1234567896 10 -> 123456789
+dddvi412 divideint 1 1234567896 -> 0
+dddvi413 divideint 12345678948 100 -> 123456789
+dddvi414 divideint 12345678949 100 -> 123456789
+dddvi415 divideint 12345678950 100 -> 123456789
+dddvi416 divideint 12345678951 100 -> 123456789
+dddvi417 divideint 12345678999 100 -> 123456789
+dddvi441 divideint 12345678000 1 -> 12345678000
+dddvi442 divideint 1 12345678000 -> 0
+dddvi443 divideint 1234567800 1 -> 1234567800
+dddvi444 divideint 1 1234567800 -> 0
+dddvi445 divideint 1234567890 1 -> 1234567890
+dddvi446 divideint 1 1234567890 -> 0
+dddvi447 divideint 1234567891 1 -> 1234567891
+dddvi448 divideint 1 1234567891 -> 0
+dddvi449 divideint 12345678901 1 -> 12345678901
+dddvi450 divideint 1 12345678901 -> 0
+dddvi451 divideint 1234567896 1 -> 1234567896
+dddvi452 divideint 1 1234567896 -> 0
+
+-- more zeros, etc.
+dddvi531 divideint 5.00 1E-3 -> 5000
+dddvi532 divideint 00.00 0.000 -> NaN Division_undefined
+dddvi533 divideint 00.00 0E-3 -> NaN Division_undefined
+dddvi534 divideint 0 -0 -> NaN Division_undefined
+dddvi535 divideint -0 0 -> NaN Division_undefined
+dddvi536 divideint -0 -0 -> NaN Division_undefined
+
+dddvi541 divideint 0 -1 -> -0
+dddvi542 divideint -0 -1 -> 0
+dddvi543 divideint 0 1 -> 0
+dddvi544 divideint -0 1 -> -0
+dddvi545 divideint -1 0 -> -Infinity Division_by_zero
+dddvi546 divideint -1 -0 -> Infinity Division_by_zero
+dddvi547 divideint 1 0 -> Infinity Division_by_zero
+dddvi548 divideint 1 -0 -> -Infinity Division_by_zero
+
+dddvi551 divideint 0.0 -1 -> -0
+dddvi552 divideint -0.0 -1 -> 0
+dddvi553 divideint 0.0 1 -> 0
+dddvi554 divideint -0.0 1 -> -0
+dddvi555 divideint -1.0 0 -> -Infinity Division_by_zero
+dddvi556 divideint -1.0 -0 -> Infinity Division_by_zero
+dddvi557 divideint 1.0 0 -> Infinity Division_by_zero
+dddvi558 divideint 1.0 -0 -> -Infinity Division_by_zero
+
+dddvi561 divideint 0 -1.0 -> -0
+dddvi562 divideint -0 -1.0 -> 0
+dddvi563 divideint 0 1.0 -> 0
+dddvi564 divideint -0 1.0 -> -0
+dddvi565 divideint -1 0.0 -> -Infinity Division_by_zero
+dddvi566 divideint -1 -0.0 -> Infinity Division_by_zero
+dddvi567 divideint 1 0.0 -> Infinity Division_by_zero
+dddvi568 divideint 1 -0.0 -> -Infinity Division_by_zero
+
+dddvi571 divideint 0.0 -1.0 -> -0
+dddvi572 divideint -0.0 -1.0 -> 0
+dddvi573 divideint 0.0 1.0 -> 0
+dddvi574 divideint -0.0 1.0 -> -0
+dddvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero
+dddvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero
+dddvi577 divideint 1.0 0.0 -> Infinity Division_by_zero
+dddvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero
+
+-- Specials
+dddvi580 divideint Inf -Inf -> NaN Invalid_operation
+dddvi581 divideint Inf -1000 -> -Infinity
+dddvi582 divideint Inf -1 -> -Infinity
+dddvi583 divideint Inf -0 -> -Infinity
+dddvi584 divideint Inf 0 -> Infinity
+dddvi585 divideint Inf 1 -> Infinity
+dddvi586 divideint Inf 1000 -> Infinity
+dddvi587 divideint Inf Inf -> NaN Invalid_operation
+dddvi588 divideint -1000 Inf -> -0
+dddvi589 divideint -Inf Inf -> NaN Invalid_operation
+dddvi590 divideint -1 Inf -> -0
+dddvi591 divideint -0 Inf -> -0
+dddvi592 divideint 0 Inf -> 0
+dddvi593 divideint 1 Inf -> 0
+dddvi594 divideint 1000 Inf -> 0
+dddvi595 divideint Inf Inf -> NaN Invalid_operation
+
+dddvi600 divideint -Inf -Inf -> NaN Invalid_operation
+dddvi601 divideint -Inf -1000 -> Infinity
+dddvi602 divideint -Inf -1 -> Infinity
+dddvi603 divideint -Inf -0 -> Infinity
+dddvi604 divideint -Inf 0 -> -Infinity
+dddvi605 divideint -Inf 1 -> -Infinity
+dddvi606 divideint -Inf 1000 -> -Infinity
+dddvi607 divideint -Inf Inf -> NaN Invalid_operation
+dddvi608 divideint -1000 Inf -> -0
+dddvi609 divideint -Inf -Inf -> NaN Invalid_operation
+dddvi610 divideint -1 -Inf -> 0
+dddvi611 divideint -0 -Inf -> 0
+dddvi612 divideint 0 -Inf -> -0
+dddvi613 divideint 1 -Inf -> -0
+dddvi614 divideint 1000 -Inf -> -0
+dddvi615 divideint Inf -Inf -> NaN Invalid_operation
+
+dddvi621 divideint NaN -Inf -> NaN
+dddvi622 divideint NaN -1000 -> NaN
+dddvi623 divideint NaN -1 -> NaN
+dddvi624 divideint NaN -0 -> NaN
+dddvi625 divideint NaN 0 -> NaN
+dddvi626 divideint NaN 1 -> NaN
+dddvi627 divideint NaN 1000 -> NaN
+dddvi628 divideint NaN Inf -> NaN
+dddvi629 divideint NaN NaN -> NaN
+dddvi630 divideint -Inf NaN -> NaN
+dddvi631 divideint -1000 NaN -> NaN
+dddvi632 divideint -1 NaN -> NaN
+dddvi633 divideint -0 NaN -> NaN
+dddvi634 divideint 0 NaN -> NaN
+dddvi635 divideint 1 NaN -> NaN
+dddvi636 divideint 1000 NaN -> NaN
+dddvi637 divideint Inf NaN -> NaN
+
+dddvi641 divideint sNaN -Inf -> NaN Invalid_operation
+dddvi642 divideint sNaN -1000 -> NaN Invalid_operation
+dddvi643 divideint sNaN -1 -> NaN Invalid_operation
+dddvi644 divideint sNaN -0 -> NaN Invalid_operation
+dddvi645 divideint sNaN 0 -> NaN Invalid_operation
+dddvi646 divideint sNaN 1 -> NaN Invalid_operation
+dddvi647 divideint sNaN 1000 -> NaN Invalid_operation
+dddvi648 divideint sNaN NaN -> NaN Invalid_operation
+dddvi649 divideint sNaN sNaN -> NaN Invalid_operation
+dddvi650 divideint NaN sNaN -> NaN Invalid_operation
+dddvi651 divideint -Inf sNaN -> NaN Invalid_operation
+dddvi652 divideint -1000 sNaN -> NaN Invalid_operation
+dddvi653 divideint -1 sNaN -> NaN Invalid_operation
+dddvi654 divideint -0 sNaN -> NaN Invalid_operation
+dddvi655 divideint 0 sNaN -> NaN Invalid_operation
+dddvi656 divideint 1 sNaN -> NaN Invalid_operation
+dddvi657 divideint 1000 sNaN -> NaN Invalid_operation
+dddvi658 divideint Inf sNaN -> NaN Invalid_operation
+dddvi659 divideint NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dddvi661 divideint NaN9 -Inf -> NaN9
+dddvi662 divideint NaN8 1000 -> NaN8
+dddvi663 divideint NaN7 Inf -> NaN7
+dddvi664 divideint -NaN6 NaN5 -> -NaN6
+dddvi665 divideint -Inf NaN4 -> NaN4
+dddvi666 divideint -1000 NaN3 -> NaN3
+dddvi667 divideint Inf -NaN2 -> -NaN2
+
+dddvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
+dddvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation
+dddvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation
+dddvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
+dddvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
+dddvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
+dddvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation
+dddvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
+dddvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation
+
+-- Null tests
+dddvi900 divideint 10 # -> NaN Invalid_operation
+dddvi901 divideint # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddEncode.decTest b/Lib/test/decimaltestdata/ddEncode.decTest
index e91ec6143c..de9d31c0a6 100644
--- a/Lib/test/decimaltestdata/ddEncode.decTest
+++ b/Lib/test/decimaltestdata/ddEncode.decTest
@@ -1,495 +1,495 @@
-------------------------------------------------------------------------
--- ddEncode.decTest -- decimal eight-byte format testcases --
--- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
--- [Previously called decimal64.decTest]
-version: 2.59
-
--- This set of tests is for the eight-byte concrete representation.
--- Its characteristics are:
---
--- 1 bit sign
--- 5 bits combination field
--- 8 bits exponent continuation
--- 50 bits coefficient continuation
---
--- Total exponent length 10 bits
--- Total coefficient length 54 bits (16 digits)
---
--- Elimit = 767 (maximum encoded exponent)
--- Emax = 384 (largest exponent value)
--- Emin = -383 (smallest exponent value)
--- bias = 398 (subtracted from encoded exponent) = -Etiny
-
--- The testcases here have only exactly representable data on the
--- 'left-hand-side'; rounding from strings is tested in 'base'
--- testcase groups.
-
-extended: 1
-clamp: 1
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
--- General testcases
--- (mostly derived from the Strawman 4 document and examples)
-dece001 apply #A2300000000003D0 -> -7.50
-dece002 apply -7.50 -> #A2300000000003D0
--- derivative canonical plain strings
-dece003 apply #A23c0000000003D0 -> -7.50E+3
-dece004 apply -7.50E+3 -> #A23c0000000003D0
-dece005 apply #A2380000000003D0 -> -750
-dece006 apply -750 -> #A2380000000003D0
-dece007 apply #A2340000000003D0 -> -75.0
-dece008 apply -75.0 -> #A2340000000003D0
-dece009 apply #A22c0000000003D0 -> -0.750
-dece010 apply -0.750 -> #A22c0000000003D0
-dece011 apply #A2280000000003D0 -> -0.0750
-dece012 apply -0.0750 -> #A2280000000003D0
-dece013 apply #A2200000000003D0 -> -0.000750
-dece014 apply -0.000750 -> #A2200000000003D0
-dece015 apply #A2180000000003D0 -> -0.00000750
-dece016 apply -0.00000750 -> #A2180000000003D0
-dece017 apply #A2140000000003D0 -> -7.50E-7
-dece018 apply -7.50E-7 -> #A2140000000003D0
-
--- Normality
-dece020 apply 1234567890123456 -> #263934b9c1e28e56
-dece021 apply -1234567890123456 -> #a63934b9c1e28e56
-dece022 apply 1234.567890123456 -> #260934b9c1e28e56
-dece023 apply #260934b9c1e28e56 -> 1234.567890123456
-dece024 apply 1111111111111111 -> #2638912449124491
-dece025 apply 9999999999999999 -> #6e38ff3fcff3fcff
-
--- Nmax and similar
-dece031 apply 9999999999999999E+369 -> #77fcff3fcff3fcff
-dece032 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
-dece033 apply #77fcff3fcff3fcff -> 9.999999999999999E+384
-dece034 apply 1.234567890123456E+384 -> #47fd34b9c1e28e56
-dece035 apply #47fd34b9c1e28e56 -> 1.234567890123456E+384
--- fold-downs (more below)
-dece036 apply 1.23E+384 -> #47fd300000000000 Clamped
-dece037 apply #47fd300000000000 -> 1.230000000000000E+384
-decd038 apply 1E+384 -> #47fc000000000000 Clamped
-decd039 apply #47fc000000000000 -> 1.000000000000000E+384
-
-decd051 apply 12345 -> #22380000000049c5
-decd052 apply #22380000000049c5 -> 12345
-decd053 apply 1234 -> #2238000000000534
-decd054 apply #2238000000000534 -> 1234
-decd055 apply 123 -> #22380000000000a3
-decd056 apply #22380000000000a3 -> 123
-decd057 apply 12 -> #2238000000000012
-decd058 apply #2238000000000012 -> 12
-decd059 apply 1 -> #2238000000000001
-decd060 apply #2238000000000001 -> 1
-decd061 apply 1.23 -> #22300000000000a3
-decd062 apply #22300000000000a3 -> 1.23
-decd063 apply 123.45 -> #22300000000049c5
-decd064 apply #22300000000049c5 -> 123.45
-
--- Nmin and below
-decd071 apply 1E-383 -> #003c000000000001
-decd072 apply #003c000000000001 -> 1E-383
-decd073 apply 1.000000000000000E-383 -> #0400000000000000
-decd074 apply #0400000000000000 -> 1.000000000000000E-383
-decd075 apply 1.000000000000001E-383 -> #0400000000000001
-decd076 apply #0400000000000001 -> 1.000000000000001E-383
-
-decd077 apply 0.100000000000000E-383 -> #0000800000000000 Subnormal
-decd078 apply #0000800000000000 -> 1.00000000000000E-384 Subnormal
-decd079 apply 0.000000000000010E-383 -> #0000000000000010 Subnormal
-decd080 apply #0000000000000010 -> 1.0E-397 Subnormal
-decd081 apply 0.00000000000001E-383 -> #0004000000000001 Subnormal
-decd082 apply #0004000000000001 -> 1E-397 Subnormal
-decd083 apply 0.000000000000001E-383 -> #0000000000000001 Subnormal
-decd084 apply #0000000000000001 -> 1E-398 Subnormal
--- next is smallest all-nines
-decd085 apply 9999999999999999E-398 -> #6400ff3fcff3fcff
-decd086 apply #6400ff3fcff3fcff -> 9.999999999999999E-383
--- and a problematic divide result
-decd088 apply 1.111111111111111E-383 -> #0400912449124491
-decd089 apply #0400912449124491 -> 1.111111111111111E-383
-
--- forties
-decd090 apply 40 -> #2238000000000040
-decd091 apply 39.99 -> #2230000000000cff
-
--- underflows cannot be tested as all LHS exact
-
--- Same again, negatives
--- Nmax and similar
-decd122 apply -9.999999999999999E+384 -> #f7fcff3fcff3fcff
-decd123 apply #f7fcff3fcff3fcff -> -9.999999999999999E+384
-decd124 apply -1.234567890123456E+384 -> #c7fd34b9c1e28e56
-decd125 apply #c7fd34b9c1e28e56 -> -1.234567890123456E+384
--- fold-downs (more below)
-decd130 apply -1.23E+384 -> #c7fd300000000000 Clamped
-decd131 apply #c7fd300000000000 -> -1.230000000000000E+384
-decd132 apply -1E+384 -> #c7fc000000000000 Clamped
-decd133 apply #c7fc000000000000 -> -1.000000000000000E+384
-
--- overflows
-decd151 apply -12345 -> #a2380000000049c5
-decd152 apply #a2380000000049c5 -> -12345
-decd153 apply -1234 -> #a238000000000534
-decd154 apply #a238000000000534 -> -1234
-decd155 apply -123 -> #a2380000000000a3
-decd156 apply #a2380000000000a3 -> -123
-decd157 apply -12 -> #a238000000000012
-decd158 apply #a238000000000012 -> -12
-decd159 apply -1 -> #a238000000000001
-decd160 apply #a238000000000001 -> -1
-decd161 apply -1.23 -> #a2300000000000a3
-decd162 apply #a2300000000000a3 -> -1.23
-decd163 apply -123.45 -> #a2300000000049c5
-decd164 apply #a2300000000049c5 -> -123.45
-
--- Nmin and below
-decd171 apply -1E-383 -> #803c000000000001
-decd172 apply #803c000000000001 -> -1E-383
-decd173 apply -1.000000000000000E-383 -> #8400000000000000
-decd174 apply #8400000000000000 -> -1.000000000000000E-383
-decd175 apply -1.000000000000001E-383 -> #8400000000000001
-decd176 apply #8400000000000001 -> -1.000000000000001E-383
-
-decd177 apply -0.100000000000000E-383 -> #8000800000000000 Subnormal
-decd178 apply #8000800000000000 -> -1.00000000000000E-384 Subnormal
-decd179 apply -0.000000000000010E-383 -> #8000000000000010 Subnormal
-decd180 apply #8000000000000010 -> -1.0E-397 Subnormal
-decd181 apply -0.00000000000001E-383 -> #8004000000000001 Subnormal
-decd182 apply #8004000000000001 -> -1E-397 Subnormal
-decd183 apply -0.000000000000001E-383 -> #8000000000000001 Subnormal
-decd184 apply #8000000000000001 -> -1E-398 Subnormal
--- next is smallest all-nines
-decd185 apply -9999999999999999E-398 -> #e400ff3fcff3fcff
-decd186 apply #e400ff3fcff3fcff -> -9.999999999999999E-383
--- and a tricky subnormal
-decd187 apply 1.11111111111524E-384 -> #00009124491246a4 Subnormal
-decd188 apply #00009124491246a4 -> 1.11111111111524E-384 Subnormal
-
--- near-underflows
-decd189 apply -1e-398 -> #8000000000000001 Subnormal
-decd190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded
-
--- zeros
-decd401 apply 0E-500 -> #0000000000000000 Clamped
-decd402 apply 0E-400 -> #0000000000000000 Clamped
-decd403 apply 0E-398 -> #0000000000000000
-decd404 apply #0000000000000000 -> 0E-398
-decd405 apply 0.000000000000000E-383 -> #0000000000000000
-decd406 apply #0000000000000000 -> 0E-398
-decd407 apply 0E-2 -> #2230000000000000
-decd408 apply #2230000000000000 -> 0.00
-decd409 apply 0 -> #2238000000000000
-decd410 apply #2238000000000000 -> 0
-decd411 apply 0E+3 -> #2244000000000000
-decd412 apply #2244000000000000 -> 0E+3
-decd413 apply 0E+369 -> #43fc000000000000
-decd414 apply #43fc000000000000 -> 0E+369
--- clamped zeros...
-decd415 apply 0E+370 -> #43fc000000000000 Clamped
-decd416 apply #43fc000000000000 -> 0E+369
-decd417 apply 0E+384 -> #43fc000000000000 Clamped
-decd418 apply #43fc000000000000 -> 0E+369
-decd419 apply 0E+400 -> #43fc000000000000 Clamped
-decd420 apply #43fc000000000000 -> 0E+369
-decd421 apply 0E+500 -> #43fc000000000000 Clamped
-decd422 apply #43fc000000000000 -> 0E+369
-
--- negative zeros
-decd431 apply -0E-400 -> #8000000000000000 Clamped
-decd432 apply -0E-400 -> #8000000000000000 Clamped
-decd433 apply -0E-398 -> #8000000000000000
-decd434 apply #8000000000000000 -> -0E-398
-decd435 apply -0.000000000000000E-383 -> #8000000000000000
-decd436 apply #8000000000000000 -> -0E-398
-decd437 apply -0E-2 -> #a230000000000000
-decd438 apply #a230000000000000 -> -0.00
-decd439 apply -0 -> #a238000000000000
-decd440 apply #a238000000000000 -> -0
-decd441 apply -0E+3 -> #a244000000000000
-decd442 apply #a244000000000000 -> -0E+3
-decd443 apply -0E+369 -> #c3fc000000000000
-decd444 apply #c3fc000000000000 -> -0E+369
--- clamped zeros...
-decd445 apply -0E+370 -> #c3fc000000000000 Clamped
-decd446 apply #c3fc000000000000 -> -0E+369
-decd447 apply -0E+384 -> #c3fc000000000000 Clamped
-decd448 apply #c3fc000000000000 -> -0E+369
-decd449 apply -0E+400 -> #c3fc000000000000 Clamped
-decd450 apply #c3fc000000000000 -> -0E+369
-decd451 apply -0E+500 -> #c3fc000000000000 Clamped
-decd452 apply #c3fc000000000000 -> -0E+369
-
--- exponents
-decd460 apply #225c000000000007 -> 7E+9
-decd461 apply 7E+9 -> #225c000000000007
-decd462 apply #23c4000000000007 -> 7E+99
-decd463 apply 7E+99 -> #23c4000000000007
-
--- Specials
-decd500 apply Infinity -> #7800000000000000
-decd501 apply #7878787878787878 -> #7800000000000000
-decd502 apply #7800000000000000 -> Infinity
-decd503 apply #7979797979797979 -> #7800000000000000
-decd504 apply #7900000000000000 -> Infinity
-decd505 apply #7a7a7a7a7a7a7a7a -> #7800000000000000
-decd506 apply #7a00000000000000 -> Infinity
-decd507 apply #7b7b7b7b7b7b7b7b -> #7800000000000000
-decd508 apply #7b00000000000000 -> Infinity
-
-decd509 apply NaN -> #7c00000000000000
-decd510 apply #7c7c7c7c7c7c7c7c -> #7c007c7c7c7c7c7c
-decd511 apply #7c00000000000000 -> NaN
-decd512 apply #7d7d7d7d7d7d7d7d -> #7c017d7d7d7d7d7d
-decd513 apply #7d00000000000000 -> NaN
-decd514 apply #7e7e7e7e7e7e7e7e -> #7e007e7e7e7e7c7e
-decd515 apply #7e00000000000000 -> sNaN
-decd516 apply #7f7f7f7f7f7f7f7f -> #7e007f7f7f7f7c7f
-decd517 apply #7f00000000000000 -> sNaN
-decd518 apply #7fffffffffffffff -> sNaN999999999999999
-decd519 apply #7fffffffffffffff -> #7e00ff3fcff3fcff
-
-decd520 apply -Infinity -> #f800000000000000
-decd521 apply #f878787878787878 -> #f800000000000000
-decd522 apply #f800000000000000 -> -Infinity
-decd523 apply #f979797979797979 -> #f800000000000000
-decd524 apply #f900000000000000 -> -Infinity
-decd525 apply #fa7a7a7a7a7a7a7a -> #f800000000000000
-decd526 apply #fa00000000000000 -> -Infinity
-decd527 apply #fb7b7b7b7b7b7b7b -> #f800000000000000
-decd528 apply #fb00000000000000 -> -Infinity
-
-decd529 apply -NaN -> #fc00000000000000
-decd530 apply #fc7c7c7c7c7c7c7c -> #fc007c7c7c7c7c7c
-decd531 apply #fc00000000000000 -> -NaN
-decd532 apply #fd7d7d7d7d7d7d7d -> #fc017d7d7d7d7d7d
-decd533 apply #fd00000000000000 -> -NaN
-decd534 apply #fe7e7e7e7e7e7e7e -> #fe007e7e7e7e7c7e
-decd535 apply #fe00000000000000 -> -sNaN
-decd536 apply #ff7f7f7f7f7f7f7f -> #fe007f7f7f7f7c7f
-decd537 apply #ff00000000000000 -> -sNaN
-decd538 apply #ffffffffffffffff -> -sNaN999999999999999
-decd539 apply #ffffffffffffffff -> #fe00ff3fcff3fcff
-
--- diagnostic NaNs
-decd540 apply NaN -> #7c00000000000000
-decd541 apply NaN0 -> #7c00000000000000
-decd542 apply NaN1 -> #7c00000000000001
-decd543 apply NaN12 -> #7c00000000000012
-decd544 apply NaN79 -> #7c00000000000079
-decd545 apply NaN12345 -> #7c000000000049c5
-decd546 apply NaN123456 -> #7c00000000028e56
-decd547 apply NaN799799 -> #7c000000000f7fdf
-decd548 apply NaN799799799799799 -> #7c03dff7fdff7fdf
-decd549 apply NaN999999999999999 -> #7c00ff3fcff3fcff
--- too many digits
-
--- fold-down full sequence
-decd601 apply 1E+384 -> #47fc000000000000 Clamped
-decd602 apply #47fc000000000000 -> 1.000000000000000E+384
-decd603 apply 1E+383 -> #43fc800000000000 Clamped
-decd604 apply #43fc800000000000 -> 1.00000000000000E+383
-decd605 apply 1E+382 -> #43fc100000000000 Clamped
-decd606 apply #43fc100000000000 -> 1.0000000000000E+382
-decd607 apply 1E+381 -> #43fc010000000000 Clamped
-decd608 apply #43fc010000000000 -> 1.000000000000E+381
-decd609 apply 1E+380 -> #43fc002000000000 Clamped
-decd610 apply #43fc002000000000 -> 1.00000000000E+380
-decd611 apply 1E+379 -> #43fc000400000000 Clamped
-decd612 apply #43fc000400000000 -> 1.0000000000E+379
-decd613 apply 1E+378 -> #43fc000040000000 Clamped
-decd614 apply #43fc000040000000 -> 1.000000000E+378
-decd615 apply 1E+377 -> #43fc000008000000 Clamped
-decd616 apply #43fc000008000000 -> 1.00000000E+377
-decd617 apply 1E+376 -> #43fc000001000000 Clamped
-decd618 apply #43fc000001000000 -> 1.0000000E+376
-decd619 apply 1E+375 -> #43fc000000100000 Clamped
-decd620 apply #43fc000000100000 -> 1.000000E+375
-decd621 apply 1E+374 -> #43fc000000020000 Clamped
-decd622 apply #43fc000000020000 -> 1.00000E+374
-decd623 apply 1E+373 -> #43fc000000004000 Clamped
-decd624 apply #43fc000000004000 -> 1.0000E+373
-decd625 apply 1E+372 -> #43fc000000000400 Clamped
-decd626 apply #43fc000000000400 -> 1.000E+372
-decd627 apply 1E+371 -> #43fc000000000080 Clamped
-decd628 apply #43fc000000000080 -> 1.00E+371
-decd629 apply 1E+370 -> #43fc000000000010 Clamped
-decd630 apply #43fc000000000010 -> 1.0E+370
-decd631 apply 1E+369 -> #43fc000000000001
-decd632 apply #43fc000000000001 -> 1E+369
-decd633 apply 1E+368 -> #43f8000000000001
-decd634 apply #43f8000000000001 -> 1E+368
--- same with 9s
-decd641 apply 9E+384 -> #77fc000000000000 Clamped
-decd642 apply #77fc000000000000 -> 9.000000000000000E+384
-decd643 apply 9E+383 -> #43fc8c0000000000 Clamped
-decd644 apply #43fc8c0000000000 -> 9.00000000000000E+383
-decd645 apply 9E+382 -> #43fc1a0000000000 Clamped
-decd646 apply #43fc1a0000000000 -> 9.0000000000000E+382
-decd647 apply 9E+381 -> #43fc090000000000 Clamped
-decd648 apply #43fc090000000000 -> 9.000000000000E+381
-decd649 apply 9E+380 -> #43fc002300000000 Clamped
-decd650 apply #43fc002300000000 -> 9.00000000000E+380
-decd651 apply 9E+379 -> #43fc000680000000 Clamped
-decd652 apply #43fc000680000000 -> 9.0000000000E+379
-decd653 apply 9E+378 -> #43fc000240000000 Clamped
-decd654 apply #43fc000240000000 -> 9.000000000E+378
-decd655 apply 9E+377 -> #43fc000008c00000 Clamped
-decd656 apply #43fc000008c00000 -> 9.00000000E+377
-decd657 apply 9E+376 -> #43fc000001a00000 Clamped
-decd658 apply #43fc000001a00000 -> 9.0000000E+376
-decd659 apply 9E+375 -> #43fc000000900000 Clamped
-decd660 apply #43fc000000900000 -> 9.000000E+375
-decd661 apply 9E+374 -> #43fc000000023000 Clamped
-decd662 apply #43fc000000023000 -> 9.00000E+374
-decd663 apply 9E+373 -> #43fc000000006800 Clamped
-decd664 apply #43fc000000006800 -> 9.0000E+373
-decd665 apply 9E+372 -> #43fc000000002400 Clamped
-decd666 apply #43fc000000002400 -> 9.000E+372
-decd667 apply 9E+371 -> #43fc00000000008c Clamped
-decd668 apply #43fc00000000008c -> 9.00E+371
-decd669 apply 9E+370 -> #43fc00000000001a Clamped
-decd670 apply #43fc00000000001a -> 9.0E+370
-decd671 apply 9E+369 -> #43fc000000000009
-decd672 apply #43fc000000000009 -> 9E+369
-decd673 apply 9E+368 -> #43f8000000000009
-decd674 apply #43f8000000000009 -> 9E+368
-
-
--- Selected DPD codes
-decd700 apply #2238000000000000 -> 0
-decd701 apply #2238000000000009 -> 9
-decd702 apply #2238000000000010 -> 10
-decd703 apply #2238000000000019 -> 19
-decd704 apply #2238000000000020 -> 20
-decd705 apply #2238000000000029 -> 29
-decd706 apply #2238000000000030 -> 30
-decd707 apply #2238000000000039 -> 39
-decd708 apply #2238000000000040 -> 40
-decd709 apply #2238000000000049 -> 49
-decd710 apply #2238000000000050 -> 50
-decd711 apply #2238000000000059 -> 59
-decd712 apply #2238000000000060 -> 60
-decd713 apply #2238000000000069 -> 69
-decd714 apply #2238000000000070 -> 70
-decd715 apply #2238000000000071 -> 71
-decd716 apply #2238000000000072 -> 72
-decd717 apply #2238000000000073 -> 73
-decd718 apply #2238000000000074 -> 74
-decd719 apply #2238000000000075 -> 75
-decd720 apply #2238000000000076 -> 76
-decd721 apply #2238000000000077 -> 77
-decd722 apply #2238000000000078 -> 78
-decd723 apply #2238000000000079 -> 79
-
-decd725 apply #223800000000029e -> 994
-decd726 apply #223800000000029f -> 995
-decd727 apply #22380000000002a0 -> 520
-decd728 apply #22380000000002a1 -> 521
--- from telco test data
-decd730 apply #2238000000000188 -> 308
-decd731 apply #22380000000001a3 -> 323
-decd732 apply #223800000000002a -> 82
-decd733 apply #22380000000001a9 -> 329
-decd734 apply #2238000000000081 -> 101
-decd735 apply #22380000000002a2 -> 522
-
--- DPD: one of each of the huffman groups
-decd740 apply #22380000000003f7 -> 777
-decd741 apply #22380000000003f8 -> 778
-decd742 apply #22380000000003eb -> 787
-decd743 apply #223800000000037d -> 877
-decd744 apply #223800000000039f -> 997
-decd745 apply #22380000000003bf -> 979
-decd746 apply #22380000000003df -> 799
-decd747 apply #223800000000006e -> 888
-
--- DPD all-highs cases (includes the 24 redundant codes)
-decd750 apply #223800000000006e -> 888
-decd751 apply #223800000000016e -> 888
-decd752 apply #223800000000026e -> 888
-decd753 apply #223800000000036e -> 888
-decd754 apply #223800000000006f -> 889
-decd755 apply #223800000000016f -> 889
-decd756 apply #223800000000026f -> 889
-decd757 apply #223800000000036f -> 889
-
-decd760 apply #223800000000007e -> 898
-decd761 apply #223800000000017e -> 898
-decd762 apply #223800000000027e -> 898
-decd763 apply #223800000000037e -> 898
-decd764 apply #223800000000007f -> 899
-decd765 apply #223800000000017f -> 899
-decd766 apply #223800000000027f -> 899
-decd767 apply #223800000000037f -> 899
-
-decd770 apply #22380000000000ee -> 988
-decd771 apply #22380000000001ee -> 988
-decd772 apply #22380000000002ee -> 988
-decd773 apply #22380000000003ee -> 988
-decd774 apply #22380000000000ef -> 989
-decd775 apply #22380000000001ef -> 989
-decd776 apply #22380000000002ef -> 989
-decd777 apply #22380000000003ef -> 989
-
-decd780 apply #22380000000000fe -> 998
-decd781 apply #22380000000001fe -> 998
-decd782 apply #22380000000002fe -> 998
-decd783 apply #22380000000003fe -> 998
-decd784 apply #22380000000000ff -> 999
-decd785 apply #22380000000001ff -> 999
-decd786 apply #22380000000002ff -> 999
-decd787 apply #22380000000003ff -> 999
-
--- values around [u]int32 edges (zeros done earlier)
-decd800 apply -2147483646 -> #a23800008c78af46
-decd801 apply -2147483647 -> #a23800008c78af47
-decd802 apply -2147483648 -> #a23800008c78af48
-decd803 apply -2147483649 -> #a23800008c78af49
-decd804 apply 2147483646 -> #223800008c78af46
-decd805 apply 2147483647 -> #223800008c78af47
-decd806 apply 2147483648 -> #223800008c78af48
-decd807 apply 2147483649 -> #223800008c78af49
-decd808 apply 4294967294 -> #2238000115afb55a
-decd809 apply 4294967295 -> #2238000115afb55b
-decd810 apply 4294967296 -> #2238000115afb57a
-decd811 apply 4294967297 -> #2238000115afb57b
-
-decd820 apply #a23800008c78af46 -> -2147483646
-decd821 apply #a23800008c78af47 -> -2147483647
-decd822 apply #a23800008c78af48 -> -2147483648
-decd823 apply #a23800008c78af49 -> -2147483649
-decd824 apply #223800008c78af46 -> 2147483646
-decd825 apply #223800008c78af47 -> 2147483647
-decd826 apply #223800008c78af48 -> 2147483648
-decd827 apply #223800008c78af49 -> 2147483649
-decd828 apply #2238000115afb55a -> 4294967294
-decd829 apply #2238000115afb55b -> 4294967295
-decd830 apply #2238000115afb57a -> 4294967296
-decd831 apply #2238000115afb57b -> 4294967297
-
--- for narrowing
-decd840 apply #2870000000000000 -> 2.000000000000000E-99
-
--- some miscellaneous
-decd850 apply #0004070000000000 -> 7.000000000000E-385 Subnormal
-decd851 apply #0008000000020000 -> 1.00000E-391 Subnormal
-
+------------------------------------------------------------------------
+-- ddEncode.decTest -- decimal eight-byte format testcases --
+-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+-- [Previously called decimal64.decTest]
+version: 2.59
+
+-- This set of tests is for the eight-byte concrete representation.
+-- Its characteristics are:
+--
+-- 1 bit sign
+-- 5 bits combination field
+-- 8 bits exponent continuation
+-- 50 bits coefficient continuation
+--
+-- Total exponent length 10 bits
+-- Total coefficient length 54 bits (16 digits)
+--
+-- Elimit = 767 (maximum encoded exponent)
+-- Emax = 384 (largest exponent value)
+-- Emin = -383 (smallest exponent value)
+-- bias = 398 (subtracted from encoded exponent) = -Etiny
+
+-- The testcases here have only exactly representable data on the
+-- 'left-hand-side'; rounding from strings is tested in 'base'
+-- testcase groups.
+
+extended: 1
+clamp: 1
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+-- General testcases
+-- (mostly derived from the Strawman 4 document and examples)
+dece001 apply #A2300000000003D0 -> -7.50
+dece002 apply -7.50 -> #A2300000000003D0
+-- derivative canonical plain strings
+dece003 apply #A23c0000000003D0 -> -7.50E+3
+dece004 apply -7.50E+3 -> #A23c0000000003D0
+dece005 apply #A2380000000003D0 -> -750
+dece006 apply -750 -> #A2380000000003D0
+dece007 apply #A2340000000003D0 -> -75.0
+dece008 apply -75.0 -> #A2340000000003D0
+dece009 apply #A22c0000000003D0 -> -0.750
+dece010 apply -0.750 -> #A22c0000000003D0
+dece011 apply #A2280000000003D0 -> -0.0750
+dece012 apply -0.0750 -> #A2280000000003D0
+dece013 apply #A2200000000003D0 -> -0.000750
+dece014 apply -0.000750 -> #A2200000000003D0
+dece015 apply #A2180000000003D0 -> -0.00000750
+dece016 apply -0.00000750 -> #A2180000000003D0
+dece017 apply #A2140000000003D0 -> -7.50E-7
+dece018 apply -7.50E-7 -> #A2140000000003D0
+
+-- Normality
+dece020 apply 1234567890123456 -> #263934b9c1e28e56
+dece021 apply -1234567890123456 -> #a63934b9c1e28e56
+dece022 apply 1234.567890123456 -> #260934b9c1e28e56
+dece023 apply #260934b9c1e28e56 -> 1234.567890123456
+dece024 apply 1111111111111111 -> #2638912449124491
+dece025 apply 9999999999999999 -> #6e38ff3fcff3fcff
+
+-- Nmax and similar
+dece031 apply 9999999999999999E+369 -> #77fcff3fcff3fcff
+dece032 apply 9.999999999999999E+384 -> #77fcff3fcff3fcff
+dece033 apply #77fcff3fcff3fcff -> 9.999999999999999E+384
+dece034 apply 1.234567890123456E+384 -> #47fd34b9c1e28e56
+dece035 apply #47fd34b9c1e28e56 -> 1.234567890123456E+384
+-- fold-downs (more below)
+dece036 apply 1.23E+384 -> #47fd300000000000 Clamped
+dece037 apply #47fd300000000000 -> 1.230000000000000E+384
+decd038 apply 1E+384 -> #47fc000000000000 Clamped
+decd039 apply #47fc000000000000 -> 1.000000000000000E+384
+
+decd051 apply 12345 -> #22380000000049c5
+decd052 apply #22380000000049c5 -> 12345
+decd053 apply 1234 -> #2238000000000534
+decd054 apply #2238000000000534 -> 1234
+decd055 apply 123 -> #22380000000000a3
+decd056 apply #22380000000000a3 -> 123
+decd057 apply 12 -> #2238000000000012
+decd058 apply #2238000000000012 -> 12
+decd059 apply 1 -> #2238000000000001
+decd060 apply #2238000000000001 -> 1
+decd061 apply 1.23 -> #22300000000000a3
+decd062 apply #22300000000000a3 -> 1.23
+decd063 apply 123.45 -> #22300000000049c5
+decd064 apply #22300000000049c5 -> 123.45
+
+-- Nmin and below
+decd071 apply 1E-383 -> #003c000000000001
+decd072 apply #003c000000000001 -> 1E-383
+decd073 apply 1.000000000000000E-383 -> #0400000000000000
+decd074 apply #0400000000000000 -> 1.000000000000000E-383
+decd075 apply 1.000000000000001E-383 -> #0400000000000001
+decd076 apply #0400000000000001 -> 1.000000000000001E-383
+
+decd077 apply 0.100000000000000E-383 -> #0000800000000000 Subnormal
+decd078 apply #0000800000000000 -> 1.00000000000000E-384 Subnormal
+decd079 apply 0.000000000000010E-383 -> #0000000000000010 Subnormal
+decd080 apply #0000000000000010 -> 1.0E-397 Subnormal
+decd081 apply 0.00000000000001E-383 -> #0004000000000001 Subnormal
+decd082 apply #0004000000000001 -> 1E-397 Subnormal
+decd083 apply 0.000000000000001E-383 -> #0000000000000001 Subnormal
+decd084 apply #0000000000000001 -> 1E-398 Subnormal
+-- next is smallest all-nines
+decd085 apply 9999999999999999E-398 -> #6400ff3fcff3fcff
+decd086 apply #6400ff3fcff3fcff -> 9.999999999999999E-383
+-- and a problematic divide result
+decd088 apply 1.111111111111111E-383 -> #0400912449124491
+decd089 apply #0400912449124491 -> 1.111111111111111E-383
+
+-- forties
+decd090 apply 40 -> #2238000000000040
+decd091 apply 39.99 -> #2230000000000cff
+
+-- underflows cannot be tested as all LHS exact
+
+-- Same again, negatives
+-- Nmax and similar
+decd122 apply -9.999999999999999E+384 -> #f7fcff3fcff3fcff
+decd123 apply #f7fcff3fcff3fcff -> -9.999999999999999E+384
+decd124 apply -1.234567890123456E+384 -> #c7fd34b9c1e28e56
+decd125 apply #c7fd34b9c1e28e56 -> -1.234567890123456E+384
+-- fold-downs (more below)
+decd130 apply -1.23E+384 -> #c7fd300000000000 Clamped
+decd131 apply #c7fd300000000000 -> -1.230000000000000E+384
+decd132 apply -1E+384 -> #c7fc000000000000 Clamped
+decd133 apply #c7fc000000000000 -> -1.000000000000000E+384
+
+-- overflows
+decd151 apply -12345 -> #a2380000000049c5
+decd152 apply #a2380000000049c5 -> -12345
+decd153 apply -1234 -> #a238000000000534
+decd154 apply #a238000000000534 -> -1234
+decd155 apply -123 -> #a2380000000000a3
+decd156 apply #a2380000000000a3 -> -123
+decd157 apply -12 -> #a238000000000012
+decd158 apply #a238000000000012 -> -12
+decd159 apply -1 -> #a238000000000001
+decd160 apply #a238000000000001 -> -1
+decd161 apply -1.23 -> #a2300000000000a3
+decd162 apply #a2300000000000a3 -> -1.23
+decd163 apply -123.45 -> #a2300000000049c5
+decd164 apply #a2300000000049c5 -> -123.45
+
+-- Nmin and below
+decd171 apply -1E-383 -> #803c000000000001
+decd172 apply #803c000000000001 -> -1E-383
+decd173 apply -1.000000000000000E-383 -> #8400000000000000
+decd174 apply #8400000000000000 -> -1.000000000000000E-383
+decd175 apply -1.000000000000001E-383 -> #8400000000000001
+decd176 apply #8400000000000001 -> -1.000000000000001E-383
+
+decd177 apply -0.100000000000000E-383 -> #8000800000000000 Subnormal
+decd178 apply #8000800000000000 -> -1.00000000000000E-384 Subnormal
+decd179 apply -0.000000000000010E-383 -> #8000000000000010 Subnormal
+decd180 apply #8000000000000010 -> -1.0E-397 Subnormal
+decd181 apply -0.00000000000001E-383 -> #8004000000000001 Subnormal
+decd182 apply #8004000000000001 -> -1E-397 Subnormal
+decd183 apply -0.000000000000001E-383 -> #8000000000000001 Subnormal
+decd184 apply #8000000000000001 -> -1E-398 Subnormal
+-- next is smallest all-nines
+decd185 apply -9999999999999999E-398 -> #e400ff3fcff3fcff
+decd186 apply #e400ff3fcff3fcff -> -9.999999999999999E-383
+-- and a tricky subnormal
+decd187 apply 1.11111111111524E-384 -> #00009124491246a4 Subnormal
+decd188 apply #00009124491246a4 -> 1.11111111111524E-384 Subnormal
+
+-- near-underflows
+decd189 apply -1e-398 -> #8000000000000001 Subnormal
+decd190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded
+
+-- zeros
+decd401 apply 0E-500 -> #0000000000000000 Clamped
+decd402 apply 0E-400 -> #0000000000000000 Clamped
+decd403 apply 0E-398 -> #0000000000000000
+decd404 apply #0000000000000000 -> 0E-398
+decd405 apply 0.000000000000000E-383 -> #0000000000000000
+decd406 apply #0000000000000000 -> 0E-398
+decd407 apply 0E-2 -> #2230000000000000
+decd408 apply #2230000000000000 -> 0.00
+decd409 apply 0 -> #2238000000000000
+decd410 apply #2238000000000000 -> 0
+decd411 apply 0E+3 -> #2244000000000000
+decd412 apply #2244000000000000 -> 0E+3
+decd413 apply 0E+369 -> #43fc000000000000
+decd414 apply #43fc000000000000 -> 0E+369
+-- clamped zeros...
+decd415 apply 0E+370 -> #43fc000000000000 Clamped
+decd416 apply #43fc000000000000 -> 0E+369
+decd417 apply 0E+384 -> #43fc000000000000 Clamped
+decd418 apply #43fc000000000000 -> 0E+369
+decd419 apply 0E+400 -> #43fc000000000000 Clamped
+decd420 apply #43fc000000000000 -> 0E+369
+decd421 apply 0E+500 -> #43fc000000000000 Clamped
+decd422 apply #43fc000000000000 -> 0E+369
+
+-- negative zeros
+decd431 apply -0E-400 -> #8000000000000000 Clamped
+decd432 apply -0E-400 -> #8000000000000000 Clamped
+decd433 apply -0E-398 -> #8000000000000000
+decd434 apply #8000000000000000 -> -0E-398
+decd435 apply -0.000000000000000E-383 -> #8000000000000000
+decd436 apply #8000000000000000 -> -0E-398
+decd437 apply -0E-2 -> #a230000000000000
+decd438 apply #a230000000000000 -> -0.00
+decd439 apply -0 -> #a238000000000000
+decd440 apply #a238000000000000 -> -0
+decd441 apply -0E+3 -> #a244000000000000
+decd442 apply #a244000000000000 -> -0E+3
+decd443 apply -0E+369 -> #c3fc000000000000
+decd444 apply #c3fc000000000000 -> -0E+369
+-- clamped zeros...
+decd445 apply -0E+370 -> #c3fc000000000000 Clamped
+decd446 apply #c3fc000000000000 -> -0E+369
+decd447 apply -0E+384 -> #c3fc000000000000 Clamped
+decd448 apply #c3fc000000000000 -> -0E+369
+decd449 apply -0E+400 -> #c3fc000000000000 Clamped
+decd450 apply #c3fc000000000000 -> -0E+369
+decd451 apply -0E+500 -> #c3fc000000000000 Clamped
+decd452 apply #c3fc000000000000 -> -0E+369
+
+-- exponents
+decd460 apply #225c000000000007 -> 7E+9
+decd461 apply 7E+9 -> #225c000000000007
+decd462 apply #23c4000000000007 -> 7E+99
+decd463 apply 7E+99 -> #23c4000000000007
+
+-- Specials
+decd500 apply Infinity -> #7800000000000000
+decd501 apply #7878787878787878 -> #7800000000000000
+decd502 apply #7800000000000000 -> Infinity
+decd503 apply #7979797979797979 -> #7800000000000000
+decd504 apply #7900000000000000 -> Infinity
+decd505 apply #7a7a7a7a7a7a7a7a -> #7800000000000000
+decd506 apply #7a00000000000000 -> Infinity
+decd507 apply #7b7b7b7b7b7b7b7b -> #7800000000000000
+decd508 apply #7b00000000000000 -> Infinity
+
+decd509 apply NaN -> #7c00000000000000
+decd510 apply #7c7c7c7c7c7c7c7c -> #7c007c7c7c7c7c7c
+decd511 apply #7c00000000000000 -> NaN
+decd512 apply #7d7d7d7d7d7d7d7d -> #7c017d7d7d7d7d7d
+decd513 apply #7d00000000000000 -> NaN
+decd514 apply #7e7e7e7e7e7e7e7e -> #7e007e7e7e7e7c7e
+decd515 apply #7e00000000000000 -> sNaN
+decd516 apply #7f7f7f7f7f7f7f7f -> #7e007f7f7f7f7c7f
+decd517 apply #7f00000000000000 -> sNaN
+decd518 apply #7fffffffffffffff -> sNaN999999999999999
+decd519 apply #7fffffffffffffff -> #7e00ff3fcff3fcff
+
+decd520 apply -Infinity -> #f800000000000000
+decd521 apply #f878787878787878 -> #f800000000000000
+decd522 apply #f800000000000000 -> -Infinity
+decd523 apply #f979797979797979 -> #f800000000000000
+decd524 apply #f900000000000000 -> -Infinity
+decd525 apply #fa7a7a7a7a7a7a7a -> #f800000000000000
+decd526 apply #fa00000000000000 -> -Infinity
+decd527 apply #fb7b7b7b7b7b7b7b -> #f800000000000000
+decd528 apply #fb00000000000000 -> -Infinity
+
+decd529 apply -NaN -> #fc00000000000000
+decd530 apply #fc7c7c7c7c7c7c7c -> #fc007c7c7c7c7c7c
+decd531 apply #fc00000000000000 -> -NaN
+decd532 apply #fd7d7d7d7d7d7d7d -> #fc017d7d7d7d7d7d
+decd533 apply #fd00000000000000 -> -NaN
+decd534 apply #fe7e7e7e7e7e7e7e -> #fe007e7e7e7e7c7e
+decd535 apply #fe00000000000000 -> -sNaN
+decd536 apply #ff7f7f7f7f7f7f7f -> #fe007f7f7f7f7c7f
+decd537 apply #ff00000000000000 -> -sNaN
+decd538 apply #ffffffffffffffff -> -sNaN999999999999999
+decd539 apply #ffffffffffffffff -> #fe00ff3fcff3fcff
+
+-- diagnostic NaNs
+decd540 apply NaN -> #7c00000000000000
+decd541 apply NaN0 -> #7c00000000000000
+decd542 apply NaN1 -> #7c00000000000001
+decd543 apply NaN12 -> #7c00000000000012
+decd544 apply NaN79 -> #7c00000000000079
+decd545 apply NaN12345 -> #7c000000000049c5
+decd546 apply NaN123456 -> #7c00000000028e56
+decd547 apply NaN799799 -> #7c000000000f7fdf
+decd548 apply NaN799799799799799 -> #7c03dff7fdff7fdf
+decd549 apply NaN999999999999999 -> #7c00ff3fcff3fcff
+-- too many digits
+
+-- fold-down full sequence
+decd601 apply 1E+384 -> #47fc000000000000 Clamped
+decd602 apply #47fc000000000000 -> 1.000000000000000E+384
+decd603 apply 1E+383 -> #43fc800000000000 Clamped
+decd604 apply #43fc800000000000 -> 1.00000000000000E+383
+decd605 apply 1E+382 -> #43fc100000000000 Clamped
+decd606 apply #43fc100000000000 -> 1.0000000000000E+382
+decd607 apply 1E+381 -> #43fc010000000000 Clamped
+decd608 apply #43fc010000000000 -> 1.000000000000E+381
+decd609 apply 1E+380 -> #43fc002000000000 Clamped
+decd610 apply #43fc002000000000 -> 1.00000000000E+380
+decd611 apply 1E+379 -> #43fc000400000000 Clamped
+decd612 apply #43fc000400000000 -> 1.0000000000E+379
+decd613 apply 1E+378 -> #43fc000040000000 Clamped
+decd614 apply #43fc000040000000 -> 1.000000000E+378
+decd615 apply 1E+377 -> #43fc000008000000 Clamped
+decd616 apply #43fc000008000000 -> 1.00000000E+377
+decd617 apply 1E+376 -> #43fc000001000000 Clamped
+decd618 apply #43fc000001000000 -> 1.0000000E+376
+decd619 apply 1E+375 -> #43fc000000100000 Clamped
+decd620 apply #43fc000000100000 -> 1.000000E+375
+decd621 apply 1E+374 -> #43fc000000020000 Clamped
+decd622 apply #43fc000000020000 -> 1.00000E+374
+decd623 apply 1E+373 -> #43fc000000004000 Clamped
+decd624 apply #43fc000000004000 -> 1.0000E+373
+decd625 apply 1E+372 -> #43fc000000000400 Clamped
+decd626 apply #43fc000000000400 -> 1.000E+372
+decd627 apply 1E+371 -> #43fc000000000080 Clamped
+decd628 apply #43fc000000000080 -> 1.00E+371
+decd629 apply 1E+370 -> #43fc000000000010 Clamped
+decd630 apply #43fc000000000010 -> 1.0E+370
+decd631 apply 1E+369 -> #43fc000000000001
+decd632 apply #43fc000000000001 -> 1E+369
+decd633 apply 1E+368 -> #43f8000000000001
+decd634 apply #43f8000000000001 -> 1E+368
+-- same with 9s
+decd641 apply 9E+384 -> #77fc000000000000 Clamped
+decd642 apply #77fc000000000000 -> 9.000000000000000E+384
+decd643 apply 9E+383 -> #43fc8c0000000000 Clamped
+decd644 apply #43fc8c0000000000 -> 9.00000000000000E+383
+decd645 apply 9E+382 -> #43fc1a0000000000 Clamped
+decd646 apply #43fc1a0000000000 -> 9.0000000000000E+382
+decd647 apply 9E+381 -> #43fc090000000000 Clamped
+decd648 apply #43fc090000000000 -> 9.000000000000E+381
+decd649 apply 9E+380 -> #43fc002300000000 Clamped
+decd650 apply #43fc002300000000 -> 9.00000000000E+380
+decd651 apply 9E+379 -> #43fc000680000000 Clamped
+decd652 apply #43fc000680000000 -> 9.0000000000E+379
+decd653 apply 9E+378 -> #43fc000240000000 Clamped
+decd654 apply #43fc000240000000 -> 9.000000000E+378
+decd655 apply 9E+377 -> #43fc000008c00000 Clamped
+decd656 apply #43fc000008c00000 -> 9.00000000E+377
+decd657 apply 9E+376 -> #43fc000001a00000 Clamped
+decd658 apply #43fc000001a00000 -> 9.0000000E+376
+decd659 apply 9E+375 -> #43fc000000900000 Clamped
+decd660 apply #43fc000000900000 -> 9.000000E+375
+decd661 apply 9E+374 -> #43fc000000023000 Clamped
+decd662 apply #43fc000000023000 -> 9.00000E+374
+decd663 apply 9E+373 -> #43fc000000006800 Clamped
+decd664 apply #43fc000000006800 -> 9.0000E+373
+decd665 apply 9E+372 -> #43fc000000002400 Clamped
+decd666 apply #43fc000000002400 -> 9.000E+372
+decd667 apply 9E+371 -> #43fc00000000008c Clamped
+decd668 apply #43fc00000000008c -> 9.00E+371
+decd669 apply 9E+370 -> #43fc00000000001a Clamped
+decd670 apply #43fc00000000001a -> 9.0E+370
+decd671 apply 9E+369 -> #43fc000000000009
+decd672 apply #43fc000000000009 -> 9E+369
+decd673 apply 9E+368 -> #43f8000000000009
+decd674 apply #43f8000000000009 -> 9E+368
+
+
+-- Selected DPD codes
+decd700 apply #2238000000000000 -> 0
+decd701 apply #2238000000000009 -> 9
+decd702 apply #2238000000000010 -> 10
+decd703 apply #2238000000000019 -> 19
+decd704 apply #2238000000000020 -> 20
+decd705 apply #2238000000000029 -> 29
+decd706 apply #2238000000000030 -> 30
+decd707 apply #2238000000000039 -> 39
+decd708 apply #2238000000000040 -> 40
+decd709 apply #2238000000000049 -> 49
+decd710 apply #2238000000000050 -> 50
+decd711 apply #2238000000000059 -> 59
+decd712 apply #2238000000000060 -> 60
+decd713 apply #2238000000000069 -> 69
+decd714 apply #2238000000000070 -> 70
+decd715 apply #2238000000000071 -> 71
+decd716 apply #2238000000000072 -> 72
+decd717 apply #2238000000000073 -> 73
+decd718 apply #2238000000000074 -> 74
+decd719 apply #2238000000000075 -> 75
+decd720 apply #2238000000000076 -> 76
+decd721 apply #2238000000000077 -> 77
+decd722 apply #2238000000000078 -> 78
+decd723 apply #2238000000000079 -> 79
+
+decd725 apply #223800000000029e -> 994
+decd726 apply #223800000000029f -> 995
+decd727 apply #22380000000002a0 -> 520
+decd728 apply #22380000000002a1 -> 521
+-- from telco test data
+decd730 apply #2238000000000188 -> 308
+decd731 apply #22380000000001a3 -> 323
+decd732 apply #223800000000002a -> 82
+decd733 apply #22380000000001a9 -> 329
+decd734 apply #2238000000000081 -> 101
+decd735 apply #22380000000002a2 -> 522
+
+-- DPD: one of each of the huffman groups
+decd740 apply #22380000000003f7 -> 777
+decd741 apply #22380000000003f8 -> 778
+decd742 apply #22380000000003eb -> 787
+decd743 apply #223800000000037d -> 877
+decd744 apply #223800000000039f -> 997
+decd745 apply #22380000000003bf -> 979
+decd746 apply #22380000000003df -> 799
+decd747 apply #223800000000006e -> 888
+
+-- DPD all-highs cases (includes the 24 redundant codes)
+decd750 apply #223800000000006e -> 888
+decd751 apply #223800000000016e -> 888
+decd752 apply #223800000000026e -> 888
+decd753 apply #223800000000036e -> 888
+decd754 apply #223800000000006f -> 889
+decd755 apply #223800000000016f -> 889
+decd756 apply #223800000000026f -> 889
+decd757 apply #223800000000036f -> 889
+
+decd760 apply #223800000000007e -> 898
+decd761 apply #223800000000017e -> 898
+decd762 apply #223800000000027e -> 898
+decd763 apply #223800000000037e -> 898
+decd764 apply #223800000000007f -> 899
+decd765 apply #223800000000017f -> 899
+decd766 apply #223800000000027f -> 899
+decd767 apply #223800000000037f -> 899
+
+decd770 apply #22380000000000ee -> 988
+decd771 apply #22380000000001ee -> 988
+decd772 apply #22380000000002ee -> 988
+decd773 apply #22380000000003ee -> 988
+decd774 apply #22380000000000ef -> 989
+decd775 apply #22380000000001ef -> 989
+decd776 apply #22380000000002ef -> 989
+decd777 apply #22380000000003ef -> 989
+
+decd780 apply #22380000000000fe -> 998
+decd781 apply #22380000000001fe -> 998
+decd782 apply #22380000000002fe -> 998
+decd783 apply #22380000000003fe -> 998
+decd784 apply #22380000000000ff -> 999
+decd785 apply #22380000000001ff -> 999
+decd786 apply #22380000000002ff -> 999
+decd787 apply #22380000000003ff -> 999
+
+-- values around [u]int32 edges (zeros done earlier)
+decd800 apply -2147483646 -> #a23800008c78af46
+decd801 apply -2147483647 -> #a23800008c78af47
+decd802 apply -2147483648 -> #a23800008c78af48
+decd803 apply -2147483649 -> #a23800008c78af49
+decd804 apply 2147483646 -> #223800008c78af46
+decd805 apply 2147483647 -> #223800008c78af47
+decd806 apply 2147483648 -> #223800008c78af48
+decd807 apply 2147483649 -> #223800008c78af49
+decd808 apply 4294967294 -> #2238000115afb55a
+decd809 apply 4294967295 -> #2238000115afb55b
+decd810 apply 4294967296 -> #2238000115afb57a
+decd811 apply 4294967297 -> #2238000115afb57b
+
+decd820 apply #a23800008c78af46 -> -2147483646
+decd821 apply #a23800008c78af47 -> -2147483647
+decd822 apply #a23800008c78af48 -> -2147483648
+decd823 apply #a23800008c78af49 -> -2147483649
+decd824 apply #223800008c78af46 -> 2147483646
+decd825 apply #223800008c78af47 -> 2147483647
+decd826 apply #223800008c78af48 -> 2147483648
+decd827 apply #223800008c78af49 -> 2147483649
+decd828 apply #2238000115afb55a -> 4294967294
+decd829 apply #2238000115afb55b -> 4294967295
+decd830 apply #2238000115afb57a -> 4294967296
+decd831 apply #2238000115afb57b -> 4294967297
+
+-- for narrowing
+decd840 apply #2870000000000000 -> 2.000000000000000E-99
+
+-- some miscellaneous
+decd850 apply #0004070000000000 -> 7.000000000000E-385 Subnormal
+decd851 apply #0008000000020000 -> 1.00000E-391 Subnormal
+
diff --git a/Lib/test/decimaltestdata/ddFMA.decTest b/Lib/test/decimaltestdata/ddFMA.decTest
index f0acfc74d5..8ae92a7f9a 100644
--- a/Lib/test/decimaltestdata/ddFMA.decTest
+++ b/Lib/test/decimaltestdata/ddFMA.decTest
@@ -1,1698 +1,1698 @@
-------------------------------------------------------------------------
--- ddFMA.decTest -- decDouble Fused Multiply Add --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- These tests comprese three parts:
--- 1. Sanity checks and other three-operand tests (especially those
--- where the fused operation makes a difference)
--- 2. Multiply tests (third operand is neutral zero [0E+emax])
--- 3. Addition tests (first operand is 1)
--- The multiply and addition tests are extensive because FMA may have
--- its own dedicated multiplication or addition routine(s), and they
--- also inherently check the left-to-right properties.
-
--- Sanity checks
-ddfma0001 fma 1 1 1 -> 2
-ddfma0002 fma 1 1 2 -> 3
-ddfma0003 fma 2 2 3 -> 7
-ddfma0004 fma 9 9 9 -> 90
-ddfma0005 fma -1 1 1 -> 0
-ddfma0006 fma -1 1 2 -> 1
-ddfma0007 fma -2 2 3 -> -1
-ddfma0008 fma -9 9 9 -> -72
-ddfma0011 fma 1 -1 1 -> 0
-ddfma0012 fma 1 -1 2 -> 1
-ddfma0013 fma 2 -2 3 -> -1
-ddfma0014 fma 9 -9 9 -> -72
-ddfma0015 fma 1 1 -1 -> 0
-ddfma0016 fma 1 1 -2 -> -1
-ddfma0017 fma 2 2 -3 -> 1
-ddfma0018 fma 9 9 -9 -> 72
-
--- non-integer exacts
-ddfma0100 fma 25.2 63.6 -438 -> 1164.72
-ddfma0101 fma 0.301 0.380 334 -> 334.114380
-ddfma0102 fma 49.2 -4.8 23.3 -> -212.86
-ddfma0103 fma 4.22 0.079 -94.6 -> -94.26662
-ddfma0104 fma 903 0.797 0.887 -> 720.578
-ddfma0105 fma 6.13 -161 65.9 -> -921.03
-ddfma0106 fma 28.2 727 5.45 -> 20506.85
-ddfma0107 fma 4 605 688 -> 3108
-ddfma0108 fma 93.3 0.19 0.226 -> 17.953
-ddfma0109 fma 0.169 -341 5.61 -> -52.019
-ddfma0110 fma -72.2 30 -51.2 -> -2217.2
-ddfma0111 fma -0.409 13 20.4 -> 15.083
-ddfma0112 fma 317 77.0 19.0 -> 24428.0
-ddfma0113 fma 47 6.58 1.62 -> 310.88
-ddfma0114 fma 1.36 0.984 0.493 -> 1.83124
-ddfma0115 fma 72.7 274 1.56 -> 19921.36
-ddfma0116 fma 335 847 83 -> 283828
-ddfma0117 fma 666 0.247 25.4 -> 189.902
-ddfma0118 fma -3.87 3.06 78.0 -> 66.1578
-ddfma0119 fma 0.742 192 35.6 -> 178.064
-ddfma0120 fma -91.6 5.29 0.153 -> -484.411
-
--- cases where result is different from separate multiply + add; each
--- is preceded by the result of unfused multiply and add
--- [this is about 20% of all similar cases in general]
--- -> 7.123356429257969E+16
-ddfma0201 fma 27583489.6645 2582471078.04 2593183.42371 -> 7.123356429257970E+16 Inexact Rounded
--- -> 22813275328.80506
-ddfma0208 fma 24280.355566 939577.397653 2032.013252 -> 22813275328.80507 Inexact Rounded
--- -> -2.030397734278062E+16
-ddfma0209 fma 7848976432 -2586831.2281 137903.517909 -> -2.030397734278061E+16 Inexact Rounded
--- -> 2040774094814.077
-ddfma0217 fma 56890.388731 35872030.4255 339337.123410 -> 2040774094814.078 Inexact Rounded
--- -> 2.714469575205049E+18
-ddfma0220 fma 7533543.57445 360317763928 5073392.31638 -> 2.714469575205050E+18 Inexact Rounded
--- -> 1.011676297716716E+19
-ddfma0223 fma 739945255.563 13672312784.1 -994381.53572 -> 1.011676297716715E+19 Inexact Rounded
--- -> -2.914135721455315E+23
-ddfma0224 fma -413510957218 704729988550 9234162614.0 -> -2.914135721455314E+23 Inexact Rounded
--- -> 2.620119863365786E+17
-ddfma0226 fma 437484.00601 598906432790 894450638.442 -> 2.620119863365787E+17 Inexact Rounded
--- -> 1.272647995808178E+19
-ddfma0253 fma 73287556929 173651305.784 -358312568.389 -> 1.272647995808177E+19 Inexact Rounded
--- -> -1.753769320861851E+18
-ddfma0257 fma 203258304486 -8628278.8066 153127.446727 -> -1.753769320861850E+18 Inexact Rounded
--- -> -1.550737835263346E+17
-ddfma0260 fma 42560533.1774 -3643605282.86 178277.96377 -> -1.550737835263347E+17 Inexact Rounded
--- -> 2.897624620576005E+22
-ddfma0269 fma 142656587375 203118879670 604576103991 -> 2.897624620576004E+22 Inexact Rounded
-
--- Cases where multiply would overflow or underflow if separate
-fma0300 fma 9e+384 10 0 -> Infinity Overflow Inexact Rounded
-fma0301 fma 1e+384 10 0 -> Infinity Overflow Inexact Rounded
-fma0302 fma 1e+384 10 -1e+384 -> 9.000000000000000E+384 Clamped
-fma0303 fma 1e+384 10 -9e+384 -> 1.000000000000000E+384 Clamped
--- subnormal etc.
-fma0305 fma 1e-398 0.1 0 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-fma0306 fma 1e-398 0.1 1 -> 1.000000000000000 Inexact Rounded
-fma0307 fma 1e-398 0.1 1e-398 -> 1E-398 Underflow Subnormal Inexact Rounded
-
--- Infinite combinations
-ddfma0800 fma Inf Inf Inf -> Infinity
-ddfma0801 fma Inf Inf -Inf -> NaN Invalid_operation
-ddfma0802 fma Inf -Inf Inf -> NaN Invalid_operation
-ddfma0803 fma Inf -Inf -Inf -> -Infinity
-ddfma0804 fma -Inf Inf Inf -> NaN Invalid_operation
-ddfma0805 fma -Inf Inf -Inf -> -Infinity
-ddfma0806 fma -Inf -Inf Inf -> Infinity
-ddfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
-
--- Triple NaN propagation
-ddfma0900 fma NaN2 NaN3 NaN5 -> NaN2
-ddfma0901 fma 0 NaN3 NaN5 -> NaN3
-ddfma0902 fma 0 0 NaN5 -> NaN5
--- first sNaN wins (consider qNaN from earlier sNaN being
--- overridden by an sNaN in third operand)
-ddfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-ddfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
-ddfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
-ddfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-ddfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
-ddfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
-
--- MULTIPLICATION TESTS ------------------------------------------------
-
--- sanity checks
-ddfma2000 fma 2 2 0e+384 -> 4
-ddfma2001 fma 2 3 0e+384 -> 6
-ddfma2002 fma 5 1 0e+384 -> 5
-ddfma2003 fma 5 2 0e+384 -> 10
-ddfma2004 fma 1.20 2 0e+384 -> 2.40
-ddfma2005 fma 1.20 0 0e+384 -> 0.00
-ddfma2006 fma 1.20 -2 0e+384 -> -2.40
-ddfma2007 fma -1.20 2 0e+384 -> -2.40
-ddfma2008 fma -1.20 0 0e+384 -> 0.00
-ddfma2009 fma -1.20 -2 0e+384 -> 2.40
-ddfma2010 fma 5.09 7.1 0e+384 -> 36.139
-ddfma2011 fma 2.5 4 0e+384 -> 10.0
-ddfma2012 fma 2.50 4 0e+384 -> 10.00
-ddfma2013 fma 1.23456789 1.00000000 0e+384 -> 1.234567890000000 Rounded
-ddfma2015 fma 2.50 4 0e+384 -> 10.00
-ddfma2016 fma 9.999999999 9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded
-ddfma2017 fma 9.999999999 -9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded
-ddfma2018 fma -9.999999999 9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded
-ddfma2019 fma -9.999999999 -9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded
-
--- zeros, etc.
-ddfma2021 fma 0 0 0e+384 -> 0
-ddfma2022 fma 0 -0 0e+384 -> 0
-ddfma2023 fma -0 0 0e+384 -> 0
-ddfma2024 fma -0 -0 0e+384 -> 0
-ddfma2025 fma -0.0 -0.0 0e+384 -> 0.00
-ddfma2026 fma -0.0 -0.0 0e+384 -> 0.00
-ddfma2027 fma -0.0 -0.0 0e+384 -> 0.00
-ddfma2028 fma -0.0 -0.0 0e+384 -> 0.00
-ddfma2030 fma 5.00 1E-3 0e+384 -> 0.00500
-ddfma2031 fma 00.00 0.000 0e+384 -> 0.00000
-ddfma2032 fma 00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0
-ddfma2033 fma 0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0
-ddfma2034 fma -5.00 1E-3 0e+384 -> -0.00500
-ddfma2035 fma -00.00 0.000 0e+384 -> 0.00000
-ddfma2036 fma -00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0
-ddfma2037 fma -0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0
-ddfma2038 fma 5.00 -1E-3 0e+384 -> -0.00500
-ddfma2039 fma 00.00 -0.000 0e+384 -> 0.00000
-ddfma2040 fma 00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0
-ddfma2041 fma 0E-3 -00.00 0e+384 -> 0.00000 -- lhs is 0
-ddfma2042 fma -5.00 -1E-3 0e+384 -> 0.00500
-ddfma2043 fma -00.00 -0.000 0e+384 -> 0.00000
-ddfma2044 fma -00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0
-ddfma2045 fma -0E-3 -00.00 -0e+384 -> 0.00000 -- lhs is 0
-ddfma2046 fma -0E-3 00.00 -0e+384 -> -0.00000
-ddfma2047 fma 0E-3 -00.00 -0e+384 -> -0.00000
-ddfma2048 fma 0E-3 00.00 -0e+384 -> 0.00000
-
--- examples from decarith
-ddfma2050 fma 1.20 3 0e+384 -> 3.60
-ddfma2051 fma 7 3 0e+384 -> 21
-ddfma2052 fma 0.9 0.8 0e+384 -> 0.72
-ddfma2053 fma 0.9 -0 0e+384 -> 0.0
-ddfma2054 fma 654321 654321 0e+384 -> 428135971041
-
-ddfma2060 fma 123.45 1e7 0e+384 -> 1.2345E+9
-ddfma2061 fma 123.45 1e8 0e+384 -> 1.2345E+10
-ddfma2062 fma 123.45 1e+9 0e+384 -> 1.2345E+11
-ddfma2063 fma 123.45 1e10 0e+384 -> 1.2345E+12
-ddfma2064 fma 123.45 1e11 0e+384 -> 1.2345E+13
-ddfma2065 fma 123.45 1e12 0e+384 -> 1.2345E+14
-ddfma2066 fma 123.45 1e13 0e+384 -> 1.2345E+15
-
-
--- test some intermediate lengths
--- 1234567890123456
-ddfma2080 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9
-ddfma2084 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9
-ddfma2090 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9
-ddfma2094 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9
-
--- test some more edge cases and carries
-ddfma2101 fma 9 9 0e+384 -> 81
-ddfma2102 fma 9 90 0e+384 -> 810
-ddfma2103 fma 9 900 0e+384 -> 8100
-ddfma2104 fma 9 9000 0e+384 -> 81000
-ddfma2105 fma 9 90000 0e+384 -> 810000
-ddfma2106 fma 9 900000 0e+384 -> 8100000
-ddfma2107 fma 9 9000000 0e+384 -> 81000000
-ddfma2108 fma 9 90000000 0e+384 -> 810000000
-ddfma2109 fma 9 900000000 0e+384 -> 8100000000
-ddfma2110 fma 9 9000000000 0e+384 -> 81000000000
-ddfma2111 fma 9 90000000000 0e+384 -> 810000000000
-ddfma2112 fma 9 900000000000 0e+384 -> 8100000000000
-ddfma2113 fma 9 9000000000000 0e+384 -> 81000000000000
-ddfma2114 fma 9 90000000000000 0e+384 -> 810000000000000
-ddfma2115 fma 9 900000000000000 0e+384 -> 8100000000000000
---ddfma2116 fma 9 9000000000000000 0e+384 -> 81000000000000000
---ddfma2117 fma 9 90000000000000000 0e+384 -> 810000000000000000
---ddfma2118 fma 9 900000000000000000 0e+384 -> 8100000000000000000
---ddfma2119 fma 9 9000000000000000000 0e+384 -> 81000000000000000000
---ddfma2120 fma 9 90000000000000000000 0e+384 -> 810000000000000000000
---ddfma2121 fma 9 900000000000000000000 0e+384 -> 8100000000000000000000
---ddfma2122 fma 9 9000000000000000000000 0e+384 -> 81000000000000000000000
---ddfma2123 fma 9 90000000000000000000000 0e+384 -> 810000000000000000000000
--- test some more edge cases without carries
-ddfma2131 fma 3 3 0e+384 -> 9
-ddfma2132 fma 3 30 0e+384 -> 90
-ddfma2133 fma 3 300 0e+384 -> 900
-ddfma2134 fma 3 3000 0e+384 -> 9000
-ddfma2135 fma 3 30000 0e+384 -> 90000
-ddfma2136 fma 3 300000 0e+384 -> 900000
-ddfma2137 fma 3 3000000 0e+384 -> 9000000
-ddfma2138 fma 3 30000000 0e+384 -> 90000000
-ddfma2139 fma 3 300000000 0e+384 -> 900000000
-ddfma2140 fma 3 3000000000 0e+384 -> 9000000000
-ddfma2141 fma 3 30000000000 0e+384 -> 90000000000
-ddfma2142 fma 3 300000000000 0e+384 -> 900000000000
-ddfma2143 fma 3 3000000000000 0e+384 -> 9000000000000
-ddfma2144 fma 3 30000000000000 0e+384 -> 90000000000000
-ddfma2145 fma 3 300000000000000 0e+384 -> 900000000000000
-
--- test some edge cases with exact rounding
-ddfma2301 fma 9 9 0e+384 -> 81
-ddfma2302 fma 9 90 0e+384 -> 810
-ddfma2303 fma 9 900 0e+384 -> 8100
-ddfma2304 fma 9 9000 0e+384 -> 81000
-ddfma2305 fma 9 90000 0e+384 -> 810000
-ddfma2306 fma 9 900000 0e+384 -> 8100000
-ddfma2307 fma 9 9000000 0e+384 -> 81000000
-ddfma2308 fma 9 90000000 0e+384 -> 810000000
-ddfma2309 fma 9 900000000 0e+384 -> 8100000000
-ddfma2310 fma 9 9000000000 0e+384 -> 81000000000
-ddfma2311 fma 9 90000000000 0e+384 -> 810000000000
-ddfma2312 fma 9 900000000000 0e+384 -> 8100000000000
-ddfma2313 fma 9 9000000000000 0e+384 -> 81000000000000
-ddfma2314 fma 9 90000000000000 0e+384 -> 810000000000000
-ddfma2315 fma 9 900000000000000 0e+384 -> 8100000000000000
-ddfma2316 fma 9 9000000000000000 0e+384 -> 8.100000000000000E+16 Rounded
-ddfma2317 fma 90 9000000000000000 0e+384 -> 8.100000000000000E+17 Rounded
-ddfma2318 fma 900 9000000000000000 0e+384 -> 8.100000000000000E+18 Rounded
-ddfma2319 fma 9000 9000000000000000 0e+384 -> 8.100000000000000E+19 Rounded
-ddfma2320 fma 90000 9000000000000000 0e+384 -> 8.100000000000000E+20 Rounded
-ddfma2321 fma 900000 9000000000000000 0e+384 -> 8.100000000000000E+21 Rounded
-ddfma2322 fma 9000000 9000000000000000 0e+384 -> 8.100000000000000E+22 Rounded
-ddfma2323 fma 90000000 9000000000000000 0e+384 -> 8.100000000000000E+23 Rounded
-
--- tryzeros cases
-ddfma2504 fma 0E-260 1000E-260 0e+384 -> 0E-398 Clamped
-ddfma2505 fma 100E+260 0E+260 0e+384 -> 0E+369 Clamped
-
--- mixed with zeros
-ddfma2541 fma 0 -1 0e+384 -> 0
-ddfma2542 fma -0 -1 0e+384 -> 0
-ddfma2543 fma 0 1 0e+384 -> 0
-ddfma2544 fma -0 1 0e+384 -> 0
-ddfma2545 fma -1 0 0e+384 -> 0
-ddfma2546 fma -1 -0 0e+384 -> 0
-ddfma2547 fma 1 0 0e+384 -> 0
-ddfma2548 fma 1 -0 0e+384 -> 0
-
-ddfma2551 fma 0.0 -1 0e+384 -> 0.0
-ddfma2552 fma -0.0 -1 0e+384 -> 0.0
-ddfma2553 fma 0.0 1 0e+384 -> 0.0
-ddfma2554 fma -0.0 1 0e+384 -> 0.0
-ddfma2555 fma -1.0 0 0e+384 -> 0.0
-ddfma2556 fma -1.0 -0 0e+384 -> 0.0
-ddfma2557 fma 1.0 0 0e+384 -> 0.0
-ddfma2558 fma 1.0 -0 0e+384 -> 0.0
-
-ddfma2561 fma 0 -1.0 0e+384 -> 0.0
-ddfma2562 fma -0 -1.0 0e+384 -> 0.0
-ddfma2563 fma 0 1.0 0e+384 -> 0.0
-ddfma2564 fma -0 1.0 0e+384 -> 0.0
-ddfma2565 fma -1 0.0 0e+384 -> 0.0
-ddfma2566 fma -1 -0.0 0e+384 -> 0.0
-ddfma2567 fma 1 0.0 0e+384 -> 0.0
-ddfma2568 fma 1 -0.0 0e+384 -> 0.0
-
-ddfma2571 fma 0.0 -1.0 0e+384 -> 0.00
-ddfma2572 fma -0.0 -1.0 0e+384 -> 0.00
-ddfma2573 fma 0.0 1.0 0e+384 -> 0.00
-ddfma2574 fma -0.0 1.0 0e+384 -> 0.00
-ddfma2575 fma -1.0 0.0 0e+384 -> 0.00
-ddfma2576 fma -1.0 -0.0 0e+384 -> 0.00
-ddfma2577 fma 1.0 0.0 0e+384 -> 0.00
-ddfma2578 fma 1.0 -0.0 0e+384 -> 0.00
-
--- Specials
-ddfma2580 fma Inf -Inf 0e+384 -> -Infinity
-ddfma2581 fma Inf -1000 0e+384 -> -Infinity
-ddfma2582 fma Inf -1 0e+384 -> -Infinity
-ddfma2583 fma Inf -0 0e+384 -> NaN Invalid_operation
-ddfma2584 fma Inf 0 0e+384 -> NaN Invalid_operation
-ddfma2585 fma Inf 1 0e+384 -> Infinity
-ddfma2586 fma Inf 1000 0e+384 -> Infinity
-ddfma2587 fma Inf Inf 0e+384 -> Infinity
-ddfma2588 fma -1000 Inf 0e+384 -> -Infinity
-ddfma2589 fma -Inf Inf 0e+384 -> -Infinity
-ddfma2590 fma -1 Inf 0e+384 -> -Infinity
-ddfma2591 fma -0 Inf 0e+384 -> NaN Invalid_operation
-ddfma2592 fma 0 Inf 0e+384 -> NaN Invalid_operation
-ddfma2593 fma 1 Inf 0e+384 -> Infinity
-ddfma2594 fma 1000 Inf 0e+384 -> Infinity
-ddfma2595 fma Inf Inf 0e+384 -> Infinity
-
-ddfma2600 fma -Inf -Inf 0e+384 -> Infinity
-ddfma2601 fma -Inf -1000 0e+384 -> Infinity
-ddfma2602 fma -Inf -1 0e+384 -> Infinity
-ddfma2603 fma -Inf -0 0e+384 -> NaN Invalid_operation
-ddfma2604 fma -Inf 0 0e+384 -> NaN Invalid_operation
-ddfma2605 fma -Inf 1 0e+384 -> -Infinity
-ddfma2606 fma -Inf 1000 0e+384 -> -Infinity
-ddfma2607 fma -Inf Inf 0e+384 -> -Infinity
-ddfma2608 fma -1000 Inf 0e+384 -> -Infinity
-ddfma2609 fma -Inf -Inf 0e+384 -> Infinity
-ddfma2610 fma -1 -Inf 0e+384 -> Infinity
-ddfma2611 fma -0 -Inf 0e+384 -> NaN Invalid_operation
-ddfma2612 fma 0 -Inf 0e+384 -> NaN Invalid_operation
-ddfma2613 fma 1 -Inf 0e+384 -> -Infinity
-ddfma2614 fma 1000 -Inf 0e+384 -> -Infinity
-ddfma2615 fma Inf -Inf 0e+384 -> -Infinity
-
-ddfma2621 fma NaN -Inf 0e+384 -> NaN
-ddfma2622 fma NaN -1000 0e+384 -> NaN
-ddfma2623 fma NaN -1 0e+384 -> NaN
-ddfma2624 fma NaN -0 0e+384 -> NaN
-ddfma2625 fma NaN 0 0e+384 -> NaN
-ddfma2626 fma NaN 1 0e+384 -> NaN
-ddfma2627 fma NaN 1000 0e+384 -> NaN
-ddfma2628 fma NaN Inf 0e+384 -> NaN
-ddfma2629 fma NaN NaN 0e+384 -> NaN
-ddfma2630 fma -Inf NaN 0e+384 -> NaN
-ddfma2631 fma -1000 NaN 0e+384 -> NaN
-ddfma2632 fma -1 NaN 0e+384 -> NaN
-ddfma2633 fma -0 NaN 0e+384 -> NaN
-ddfma2634 fma 0 NaN 0e+384 -> NaN
-ddfma2635 fma 1 NaN 0e+384 -> NaN
-ddfma2636 fma 1000 NaN 0e+384 -> NaN
-ddfma2637 fma Inf NaN 0e+384 -> NaN
-
-ddfma2641 fma sNaN -Inf 0e+384 -> NaN Invalid_operation
-ddfma2642 fma sNaN -1000 0e+384 -> NaN Invalid_operation
-ddfma2643 fma sNaN -1 0e+384 -> NaN Invalid_operation
-ddfma2644 fma sNaN -0 0e+384 -> NaN Invalid_operation
-ddfma2645 fma sNaN 0 0e+384 -> NaN Invalid_operation
-ddfma2646 fma sNaN 1 0e+384 -> NaN Invalid_operation
-ddfma2647 fma sNaN 1000 0e+384 -> NaN Invalid_operation
-ddfma2648 fma sNaN NaN 0e+384 -> NaN Invalid_operation
-ddfma2649 fma sNaN sNaN 0e+384 -> NaN Invalid_operation
-ddfma2650 fma NaN sNaN 0e+384 -> NaN Invalid_operation
-ddfma2651 fma -Inf sNaN 0e+384 -> NaN Invalid_operation
-ddfma2652 fma -1000 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2653 fma -1 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2654 fma -0 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2655 fma 0 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2656 fma 1 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2657 fma 1000 sNaN 0e+384 -> NaN Invalid_operation
-ddfma2658 fma Inf sNaN 0e+384 -> NaN Invalid_operation
-ddfma2659 fma NaN sNaN 0e+384 -> NaN Invalid_operation
-
--- propagating NaNs
-ddfma2661 fma NaN9 -Inf 0e+384 -> NaN9
-ddfma2662 fma NaN8 999 0e+384 -> NaN8
-ddfma2663 fma NaN71 Inf 0e+384 -> NaN71
-ddfma2664 fma NaN6 NaN5 0e+384 -> NaN6
-ddfma2665 fma -Inf NaN4 0e+384 -> NaN4
-ddfma2666 fma -999 NaN33 0e+384 -> NaN33
-ddfma2667 fma Inf NaN2 0e+384 -> NaN2
-
-ddfma2671 fma sNaN99 -Inf 0e+384 -> NaN99 Invalid_operation
-ddfma2672 fma sNaN98 -11 0e+384 -> NaN98 Invalid_operation
-ddfma2673 fma sNaN97 NaN 0e+384 -> NaN97 Invalid_operation
-ddfma2674 fma sNaN16 sNaN94 0e+384 -> NaN16 Invalid_operation
-ddfma2675 fma NaN95 sNaN93 0e+384 -> NaN93 Invalid_operation
-ddfma2676 fma -Inf sNaN92 0e+384 -> NaN92 Invalid_operation
-ddfma2677 fma 088 sNaN91 0e+384 -> NaN91 Invalid_operation
-ddfma2678 fma Inf sNaN90 0e+384 -> NaN90 Invalid_operation
-ddfma2679 fma NaN sNaN89 0e+384 -> NaN89 Invalid_operation
-
-ddfma2681 fma -NaN9 -Inf 0e+384 -> -NaN9
-ddfma2682 fma -NaN8 999 0e+384 -> -NaN8
-ddfma2683 fma -NaN71 Inf 0e+384 -> -NaN71
-ddfma2684 fma -NaN6 -NaN5 0e+384 -> -NaN6
-ddfma2685 fma -Inf -NaN4 0e+384 -> -NaN4
-ddfma2686 fma -999 -NaN33 0e+384 -> -NaN33
-ddfma2687 fma Inf -NaN2 0e+384 -> -NaN2
-
-ddfma2691 fma -sNaN99 -Inf 0e+384 -> -NaN99 Invalid_operation
-ddfma2692 fma -sNaN98 -11 0e+384 -> -NaN98 Invalid_operation
-ddfma2693 fma -sNaN97 NaN 0e+384 -> -NaN97 Invalid_operation
-ddfma2694 fma -sNaN16 -sNaN94 0e+384 -> -NaN16 Invalid_operation
-ddfma2695 fma -NaN95 -sNaN93 0e+384 -> -NaN93 Invalid_operation
-ddfma2696 fma -Inf -sNaN92 0e+384 -> -NaN92 Invalid_operation
-ddfma2697 fma 088 -sNaN91 0e+384 -> -NaN91 Invalid_operation
-ddfma2698 fma Inf -sNaN90 0e+384 -> -NaN90 Invalid_operation
-ddfma2699 fma -NaN -sNaN89 0e+384 -> -NaN89 Invalid_operation
-
-ddfma2701 fma -NaN -Inf 0e+384 -> -NaN
-ddfma2702 fma -NaN 999 0e+384 -> -NaN
-ddfma2703 fma -NaN Inf 0e+384 -> -NaN
-ddfma2704 fma -NaN -NaN 0e+384 -> -NaN
-ddfma2705 fma -Inf -NaN0 0e+384 -> -NaN
-ddfma2706 fma -999 -NaN 0e+384 -> -NaN
-ddfma2707 fma Inf -NaN 0e+384 -> -NaN
-
-ddfma2711 fma -sNaN -Inf 0e+384 -> -NaN Invalid_operation
-ddfma2712 fma -sNaN -11 0e+384 -> -NaN Invalid_operation
-ddfma2713 fma -sNaN00 NaN 0e+384 -> -NaN Invalid_operation
-ddfma2714 fma -sNaN -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2715 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2716 fma -Inf -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2717 fma 088 -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2718 fma Inf -sNaN 0e+384 -> -NaN Invalid_operation
-ddfma2719 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
--- signs
-ddfma2751 fma 1e+277 1e+311 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2752 fma 1e+277 -1e+311 0e+384 -> -Infinity Overflow Inexact Rounded
-ddfma2753 fma -1e+277 1e+311 0e+384 -> -Infinity Overflow Inexact Rounded
-ddfma2754 fma -1e+277 -1e+311 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2755 fma 1e-277 1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2756 fma 1e-277 -1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2757 fma -1e-277 1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2758 fma -1e-277 -1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-ddfma2760 fma 1e-291 1e-101 0e+384 -> 1E-392 Subnormal
-ddfma2761 fma 1e-291 1e-102 0e+384 -> 1E-393 Subnormal
-ddfma2762 fma 1e-291 1e-103 0e+384 -> 1E-394 Subnormal
-ddfma2763 fma 1e-291 1e-104 0e+384 -> 1E-395 Subnormal
-ddfma2764 fma 1e-291 1e-105 0e+384 -> 1E-396 Subnormal
-ddfma2765 fma 1e-291 1e-106 0e+384 -> 1E-397 Subnormal
-ddfma2766 fma 1e-291 1e-107 0e+384 -> 1E-398 Subnormal
-ddfma2767 fma 1e-291 1e-108 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2768 fma 1e-291 1e-109 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2769 fma 1e-291 1e-110 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-ddfma2770 fma 1e+60 1e+321 0e+384 -> 1.000000000000E+381 Clamped
-ddfma2771 fma 1e+60 1e+322 0e+384 -> 1.0000000000000E+382 Clamped
-ddfma2772 fma 1e+60 1e+323 0e+384 -> 1.00000000000000E+383 Clamped
-ddfma2773 fma 1e+60 1e+324 0e+384 -> 1.000000000000000E+384 Clamped
-ddfma2774 fma 1e+60 1e+325 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2775 fma 1e+60 1e+326 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2776 fma 1e+60 1e+327 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2777 fma 1e+60 1e+328 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2778 fma 1e+60 1e+329 0e+384 -> Infinity Overflow Inexact Rounded
-ddfma2779 fma 1e+60 1e+330 0e+384 -> Infinity Overflow Inexact Rounded
-
-ddfma2801 fma 1.0000E-394 1 0e+384 -> 1.0000E-394 Subnormal
-ddfma2802 fma 1.000E-394 1e-1 0e+384 -> 1.000E-395 Subnormal
-ddfma2803 fma 1.00E-394 1e-2 0e+384 -> 1.00E-396 Subnormal
-ddfma2804 fma 1.0E-394 1e-3 0e+384 -> 1.0E-397 Subnormal
-ddfma2805 fma 1.0E-394 1e-4 0e+384 -> 1E-398 Subnormal Rounded
-ddfma2806 fma 1.3E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddfma2807 fma 1.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2808 fma 1.7E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2809 fma 2.3E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2810 fma 2.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2811 fma 2.7E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded
-ddfma2812 fma 1.49E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddfma2813 fma 1.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2814 fma 1.51E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2815 fma 2.49E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2816 fma 2.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddfma2817 fma 2.51E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded
-
-ddfma2818 fma 1E-394 1e-4 0e+384 -> 1E-398 Subnormal
-ddfma2819 fma 3E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2820 fma 5E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2821 fma 7E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddfma2822 fma 9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddfma2823 fma 9.9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
-
-ddfma2824 fma 1E-394 -1e-4 0e+384 -> -1E-398 Subnormal
-ddfma2825 fma 3E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2826 fma -5E-394 1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2827 fma 7E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddfma2828 fma -9E-394 1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddfma2829 fma 9.9E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddfma2830 fma 3.0E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-ddfma2831 fma 1.0E-199 1e-200 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddfma2832 fma 1.0E-199 1e-199 0e+384 -> 1E-398 Subnormal Rounded
-ddfma2833 fma 1.0E-199 1e-198 0e+384 -> 1.0E-397 Subnormal
-ddfma2834 fma 2.0E-199 2e-198 0e+384 -> 4.0E-397 Subnormal
-ddfma2835 fma 4.0E-199 4e-198 0e+384 -> 1.60E-396 Subnormal
-ddfma2836 fma 10.0E-199 10e-198 0e+384 -> 1.000E-395 Subnormal
-ddfma2837 fma 30.0E-199 30e-198 0e+384 -> 9.000E-395 Subnormal
-ddfma2838 fma 40.0E-199 40e-188 0e+384 -> 1.6000E-384 Subnormal
-ddfma2839 fma 40.0E-199 40e-187 0e+384 -> 1.6000E-383
-ddfma2840 fma 40.0E-199 40e-186 0e+384 -> 1.6000E-382
-
--- Long operand overflow may be a different path
-ddfma2870 fma 100 9.999E+383 0e+384 -> Infinity Inexact Overflow Rounded
-ddfma2871 fma 100 -9.999E+383 0e+384 -> -Infinity Inexact Overflow Rounded
-ddfma2872 fma 9.999E+383 100 0e+384 -> Infinity Inexact Overflow Rounded
-ddfma2873 fma -9.999E+383 100 0e+384 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-ddfma2881 fma 1.2347E-355 1.2347E-40 0e+384 -> 1.524E-395 Inexact Rounded Subnormal Underflow
-ddfma2882 fma 1.234E-355 1.234E-40 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddfma2883 fma 1.23E-355 1.23E-40 0e+384 -> 1.513E-395 Inexact Rounded Subnormal Underflow
-ddfma2884 fma 1.2E-355 1.2E-40 0e+384 -> 1.44E-395 Subnormal
-ddfma2885 fma 1.2E-355 1.2E-41 0e+384 -> 1.44E-396 Subnormal
-ddfma2886 fma 1.2E-355 1.2E-42 0e+384 -> 1.4E-397 Subnormal Inexact Rounded Underflow
-ddfma2887 fma 1.2E-355 1.3E-42 0e+384 -> 1.6E-397 Subnormal Inexact Rounded Underflow
-ddfma2888 fma 1.3E-355 1.3E-42 0e+384 -> 1.7E-397 Subnormal Inexact Rounded Underflow
-ddfma2889 fma 1.3E-355 1.3E-43 0e+384 -> 2E-398 Subnormal Inexact Rounded Underflow
-ddfma2890 fma 1.3E-356 1.3E-43 0e+384 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow
-
-ddfma2891 fma 1.2345E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
-ddfma2892 fma 1.23456E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
-ddfma2893 fma 1.2345E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddfma2894 fma 1.23456E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddfma2895 fma 1.2345E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow
-ddfma2896 fma 1.23456E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
-ddfma2900 fma 0.3000000000E-191 0.3000000000E-191 0e+384 -> 9.00000000000000E-384 Subnormal Rounded
-ddfma2901 fma 0.3000000001E-191 0.3000000001E-191 0e+384 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
-ddfma2902 fma 9.999999999999999E-383 0.0999999999999 0e+384 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
-ddfma2903 fma 9.999999999999999E-383 0.09999999999999 0e+384 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
-ddfma2904 fma 9.999999999999999E-383 0.099999999999999 0e+384 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
-ddfma2905 fma 9.999999999999999E-383 0.0999999999999999 0e+384 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
--- prove operands are exact
-ddfma2906 fma 9.999999999999999E-383 1 0e+384 -> 9.999999999999999E-383
-ddfma2907 fma 1 0.09999999999999999 0e+384 -> 0.09999999999999999
--- the next rounds to Nmin
-ddfma2908 fma 9.999999999999999E-383 0.09999999999999999 0e+384 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-
--- hugest
-ddfma2909 fma 9999999999999999 9999999999999999 0e+384 -> 9.999999999999998E+31 Inexact Rounded
-
--- Null tests
-ddfma2990 fma 10 # 0e+384 -> NaN Invalid_operation
-ddfma2991 fma # 10 0e+384 -> NaN Invalid_operation
-
-
--- ADDITION TESTS ------------------------------------------------------
-
--- [first group are 'quick confidence check']
-ddfma3001 fma 1 1 1 -> 2
-ddfma3002 fma 1 2 3 -> 5
-ddfma3003 fma 1 '5.75' '3.3' -> 9.05
-ddfma3004 fma 1 '5' '-3' -> 2
-ddfma3005 fma 1 '-5' '-3' -> -8
-ddfma3006 fma 1 '-7' '2.5' -> -4.5
-ddfma3007 fma 1 '0.7' '0.3' -> 1.0
-ddfma3008 fma 1 '1.25' '1.25' -> 2.50
-ddfma3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
-ddfma3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
-
--- 1234567890123456 1234567890123456
-ddfma3011 fma 1 '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
-ddfma3012 fma 1 '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded
-ddfma3013 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
-ddfma3014 fma 1 '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded
-ddfma3015 fma 1 '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded
-ddfma3016 fma 1 '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
-ddfma3017 fma 1 '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
-ddfma3018 fma 1 '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
-ddfma3019 fma 1 '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded
-ddfma3020 fma 1 '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded
-
-ddfma3021 fma 1 0 1 -> 1
-ddfma3022 fma 1 1 1 -> 2
-ddfma3023 fma 1 2 1 -> 3
-ddfma3024 fma 1 3 1 -> 4
-ddfma3025 fma 1 4 1 -> 5
-ddfma3026 fma 1 5 1 -> 6
-ddfma3027 fma 1 6 1 -> 7
-ddfma3028 fma 1 7 1 -> 8
-ddfma3029 fma 1 8 1 -> 9
-ddfma3030 fma 1 9 1 -> 10
-
--- some carrying effects
-ddfma3031 fma 1 '0.9998' '0.0000' -> '0.9998'
-ddfma3032 fma 1 '0.9998' '0.0001' -> '0.9999'
-ddfma3033 fma 1 '0.9998' '0.0002' -> '1.0000'
-ddfma3034 fma 1 '0.9998' '0.0003' -> '1.0001'
-
-ddfma3035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
-ddfma3039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
-
--- symmetry:
-ddfma3040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
-ddfma3044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
-ddfma3045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
-
--- same, without rounding
-ddfma3046 fma 1 '10000e+9' '7' -> '10000000000007'
-ddfma3047 fma 1 '10000e+9' '70' -> '10000000000070'
-ddfma3048 fma 1 '10000e+9' '700' -> '10000000000700'
-ddfma3049 fma 1 '10000e+9' '7000' -> '10000000007000'
-ddfma3050 fma 1 '10000e+9' '70000' -> '10000000070000'
-ddfma3051 fma 1 '10000e+9' '700000' -> '10000000700000'
-ddfma3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-ddfma3053 fma 1 '12' '7.00' -> '19.00'
-ddfma3054 fma 1 '1.3' '-1.07' -> '0.23'
-ddfma3055 fma 1 '1.3' '-1.30' -> '0.00'
-ddfma3056 fma 1 '1.3' '-2.07' -> '-0.77'
-ddfma3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
-
--- leading zero preservation
-ddfma3061 fma 1 1 '0.0001' -> '1.0001'
-ddfma3062 fma 1 1 '0.00001' -> '1.00001'
-ddfma3063 fma 1 1 '0.000001' -> '1.000001'
-ddfma3064 fma 1 1 '0.0000001' -> '1.0000001'
-ddfma3065 fma 1 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-ddfma3070 fma 1 1 0 -> 1
-ddfma3071 fma 1 1 0. -> 1
-ddfma3072 fma 1 1 .0 -> 1.0
-ddfma3073 fma 1 1 0.0 -> 1.0
-ddfma3074 fma 1 1 0.00 -> 1.00
-ddfma3075 fma 1 0 1 -> 1
-ddfma3076 fma 1 0. 1 -> 1
-ddfma3077 fma 1 .0 1 -> 1.0
-ddfma3078 fma 1 0.0 1 -> 1.0
-ddfma3079 fma 1 0.00 1 -> 1.00
-
--- some carries
-ddfma3080 fma 1 999999998 1 -> 999999999
-ddfma3081 fma 1 999999999 1 -> 1000000000
-ddfma3082 fma 1 99999999 1 -> 100000000
-ddfma3083 fma 1 9999999 1 -> 10000000
-ddfma3084 fma 1 999999 1 -> 1000000
-ddfma3085 fma 1 99999 1 -> 100000
-ddfma3086 fma 1 9999 1 -> 10000
-ddfma3087 fma 1 999 1 -> 1000
-ddfma3088 fma 1 99 1 -> 100
-ddfma3089 fma 1 9 1 -> 10
-
-
--- more LHS swaps
-ddfma3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
-ddfma3091 fma 1 '-56267E-6' 0 -> '-0.056267'
-ddfma3092 fma 1 '-56267E-5' 0 -> '-0.56267'
-ddfma3093 fma 1 '-56267E-4' 0 -> '-5.6267'
-ddfma3094 fma 1 '-56267E-3' 0 -> '-56.267'
-ddfma3095 fma 1 '-56267E-2' 0 -> '-562.67'
-ddfma3096 fma 1 '-56267E-1' 0 -> '-5626.7'
-ddfma3097 fma 1 '-56267E-0' 0 -> '-56267'
-ddfma3098 fma 1 '-5E-10' 0 -> '-5E-10'
-ddfma3099 fma 1 '-5E-7' 0 -> '-5E-7'
-ddfma3100 fma 1 '-5E-6' 0 -> '-0.000005'
-ddfma3101 fma 1 '-5E-5' 0 -> '-0.00005'
-ddfma3102 fma 1 '-5E-4' 0 -> '-0.0005'
-ddfma3103 fma 1 '-5E-1' 0 -> '-0.5'
-ddfma3104 fma 1 '-5E0' 0 -> '-5'
-ddfma3105 fma 1 '-5E1' 0 -> '-50'
-ddfma3106 fma 1 '-5E5' 0 -> '-500000'
-ddfma3107 fma 1 '-5E15' 0 -> '-5000000000000000'
-ddfma3108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded
-ddfma3109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded
-ddfma3110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded
-ddfma3111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded
-
--- more RHS swaps
-ddfma3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
-ddfma3114 fma 1 0 '-56267E-6' -> '-0.056267'
-ddfma3116 fma 1 0 '-56267E-5' -> '-0.56267'
-ddfma3117 fma 1 0 '-56267E-4' -> '-5.6267'
-ddfma3119 fma 1 0 '-56267E-3' -> '-56.267'
-ddfma3120 fma 1 0 '-56267E-2' -> '-562.67'
-ddfma3121 fma 1 0 '-56267E-1' -> '-5626.7'
-ddfma3122 fma 1 0 '-56267E-0' -> '-56267'
-ddfma3123 fma 1 0 '-5E-10' -> '-5E-10'
-ddfma3124 fma 1 0 '-5E-7' -> '-5E-7'
-ddfma3125 fma 1 0 '-5E-6' -> '-0.000005'
-ddfma3126 fma 1 0 '-5E-5' -> '-0.00005'
-ddfma3127 fma 1 0 '-5E-4' -> '-0.0005'
-ddfma3128 fma 1 0 '-5E-1' -> '-0.5'
-ddfma3129 fma 1 0 '-5E0' -> '-5'
-ddfma3130 fma 1 0 '-5E1' -> '-50'
-ddfma3131 fma 1 0 '-5E5' -> '-500000'
-ddfma3132 fma 1 0 '-5E15' -> '-5000000000000000'
-ddfma3133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded
-ddfma3134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded
-ddfma3135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded
-ddfma3136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded
-
--- related
-ddfma3137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded
-ddfma3138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded
-ddfma3139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded
-ddfma3140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded
-ddfma3141 fma 1 1E+11 0.0000 -> '100000000000.0000'
-ddfma3142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded
-ddfma3143 fma 1 0.000 1E+12 -> '1000000000000.000'
-ddfma3144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-ddfma3146 fma 1 '00.0' 0 -> '0.0'
-ddfma3147 fma 1 '0.00' 0 -> '0.00'
-ddfma3148 fma 1 0 '0.00' -> '0.00'
-ddfma3149 fma 1 0 '00.0' -> '0.0'
-ddfma3150 fma 1 '00.0' '0.00' -> '0.00'
-ddfma3151 fma 1 '0.00' '00.0' -> '0.00'
-ddfma3152 fma 1 '3' '.3' -> '3.3'
-ddfma3153 fma 1 '3.' '.3' -> '3.3'
-ddfma3154 fma 1 '3.0' '.3' -> '3.3'
-ddfma3155 fma 1 '3.00' '.3' -> '3.30'
-ddfma3156 fma 1 '3' '3' -> '6'
-ddfma3157 fma 1 '3' '+3' -> '6'
-ddfma3158 fma 1 '3' '-3' -> '0'
-ddfma3159 fma 1 '0.3' '-0.3' -> '0.0'
-ddfma3160 fma 1 '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-ddfma3161 fma 1 '1E+12' '-1' -> '999999999999'
-ddfma3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
-ddfma3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
-ddfma3164 fma 1 '-1' '1E+12' -> '999999999999'
-ddfma3165 fma 1 '7E+12' '-1' -> '6999999999999'
-ddfma3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
-ddfma3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
-ddfma3168 fma 1 '-1' '7E+12' -> '6999999999999'
-
-rounding: half_up
--- 1.234567890123456 1234567890123456 1 234567890123456
-ddfma3170 fma 1 '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
-ddfma3171 fma 1 '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
-ddfma3172 fma 1 '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
-ddfma3173 fma 1 '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
-ddfma3174 fma 1 '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
-ddfma3175 fma 1 '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
-ddfma3176 fma 1 '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
-ddfma3177 fma 1 '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded
-ddfma3178 fma 1 '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
-ddfma3179 fma 1 '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
-ddfma3180 fma 1 '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
-ddfma3181 fma 1 '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
-ddfma3182 fma 1 '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
-ddfma3183 fma 1 '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-ddfma3200 fma 1 '1234560123456789' 0 -> '1234560123456789'
-ddfma3201 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddfma3202 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddfma3203 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddfma3204 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddfma3205 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddfma3206 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddfma3207 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddfma3208 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
-ddfma3209 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
-ddfma3210 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
-ddfma3211 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
-ddfma3212 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
-ddfma3213 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
-ddfma3214 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
-ddfma3215 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
-ddfma3216 fma 1 '1234560123456789' 1 -> '1234560123456790'
-ddfma3217 fma 1 '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded
-ddfma3218 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddfma3219 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
-
-rounding: half_even
-ddfma3220 fma 1 '1234560123456789' 0 -> '1234560123456789'
-ddfma3221 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddfma3222 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddfma3223 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddfma3224 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddfma3225 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddfma3226 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddfma3227 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddfma3228 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
-ddfma3229 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
-ddfma3230 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
-ddfma3231 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
-ddfma3232 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
-ddfma3233 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
-ddfma3234 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
-ddfma3235 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
-ddfma3236 fma 1 '1234560123456789' 1 -> '1234560123456790'
-ddfma3237 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
-ddfma3238 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddfma3239 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
--- critical few with even bottom digit...
-ddfma3240 fma 1 '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded
-ddfma3241 fma 1 '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded
-ddfma3242 fma 1 '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded
-
-rounding: down
-ddfma3250 fma 1 '1234560123456789' 0 -> '1234560123456789'
-ddfma3251 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
-ddfma3252 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
-ddfma3253 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
-ddfma3254 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
-ddfma3255 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
-ddfma3256 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
-ddfma3257 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
-ddfma3258 fma 1 '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded
-ddfma3259 fma 1 '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded
-ddfma3260 fma 1 '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded
-ddfma3261 fma 1 '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded
-ddfma3262 fma 1 '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded
-ddfma3263 fma 1 '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded
-ddfma3264 fma 1 '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded
-ddfma3265 fma 1 '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded
-ddfma3266 fma 1 '1234560123456789' 1 -> '1234560123456790'
-ddfma3267 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
-ddfma3268 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
-ddfma3269 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-ddfma3301 fma 1 -1 1 -> 0
-ddfma3302 fma 1 0 1 -> 1
-ddfma3303 fma 1 1 1 -> 2
-ddfma3304 fma 1 12 1 -> 13
-ddfma3305 fma 1 98 1 -> 99
-ddfma3306 fma 1 99 1 -> 100
-ddfma3307 fma 1 100 1 -> 101
-ddfma3308 fma 1 101 1 -> 102
-ddfma3309 fma 1 -1 -1 -> -2
-ddfma3310 fma 1 0 -1 -> -1
-ddfma3311 fma 1 1 -1 -> 0
-ddfma3312 fma 1 12 -1 -> 11
-ddfma3313 fma 1 98 -1 -> 97
-ddfma3314 fma 1 99 -1 -> 98
-ddfma3315 fma 1 100 -1 -> 99
-ddfma3316 fma 1 101 -1 -> 100
-
-ddfma3321 fma 1 -0.01 0.01 -> 0.00
-ddfma3322 fma 1 0.00 0.01 -> 0.01
-ddfma3323 fma 1 0.01 0.01 -> 0.02
-ddfma3324 fma 1 0.12 0.01 -> 0.13
-ddfma3325 fma 1 0.98 0.01 -> 0.99
-ddfma3326 fma 1 0.99 0.01 -> 1.00
-ddfma3327 fma 1 1.00 0.01 -> 1.01
-ddfma3328 fma 1 1.01 0.01 -> 1.02
-ddfma3329 fma 1 -0.01 -0.01 -> -0.02
-ddfma3330 fma 1 0.00 -0.01 -> -0.01
-ddfma3331 fma 1 0.01 -0.01 -> 0.00
-ddfma3332 fma 1 0.12 -0.01 -> 0.11
-ddfma3333 fma 1 0.98 -0.01 -> 0.97
-ddfma3334 fma 1 0.99 -0.01 -> 0.98
-ddfma3335 fma 1 1.00 -0.01 -> 0.99
-ddfma3336 fma 1 1.01 -0.01 -> 1.00
-
--- some more cases where adding 0 affects the coefficient
-ddfma3340 fma 1 1E+3 0 -> 1000
-ddfma3341 fma 1 1E+15 0 -> 1000000000000000
-ddfma3342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded
-ddfma3343 fma 1 1E+20 0 -> 1.000000000000000E+20 Rounded
--- which simply follow from these cases ...
-ddfma3344 fma 1 1E+3 1 -> 1001
-ddfma3345 fma 1 1E+15 1 -> 1000000000000001
-ddfma3346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
-ddfma3347 fma 1 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded
-ddfma3348 fma 1 1E+3 7 -> 1007
-ddfma3349 fma 1 1E+15 7 -> 1000000000000007
-ddfma3350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
-ddfma3351 fma 1 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded
-
--- tryzeros cases
-rounding: half_up
-ddfma3360 fma 1 0E+50 10000E+1 -> 1.0000E+5
-ddfma3361 fma 1 0E-50 10000E+1 -> 100000.0000000000 Rounded
-ddfma3362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded
-ddfma3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
-ddfma3364 fma 1 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-ddfma3370 fma 1 999999999999999 815 -> 1000000000000814
-ddfma3371 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-rounding: half_up
-ddfma3372 fma 1 999999999999999 815 -> 1000000000000814
-ddfma3373 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-rounding: half_even
-ddfma3374 fma 1 999999999999999 815 -> 1000000000000814
-ddfma3375 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
-
--- ulp replacement tests
-ddfma3400 fma 1 1 77e-14 -> 1.00000000000077
-ddfma3401 fma 1 1 77e-15 -> 1.000000000000077
-ddfma3402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded
-ddfma3403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded
-ddfma3404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded
-ddfma3405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded
-ddfma3406 fma 1 1 77e-299 -> 1.000000000000000 Inexact Rounded
-
-ddfma3410 fma 1 10 77e-14 -> 10.00000000000077
-ddfma3411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded
-ddfma3412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded
-ddfma3413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded
-ddfma3414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded
-ddfma3415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded
-ddfma3416 fma 1 10 77e-299 -> 10.00000000000000 Inexact Rounded
-
-ddfma3420 fma 1 77e-14 1 -> 1.00000000000077
-ddfma3421 fma 1 77e-15 1 -> 1.000000000000077
-ddfma3422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded
-ddfma3423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded
-ddfma3424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded
-ddfma3425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded
-ddfma3426 fma 1 77e-299 1 -> 1.000000000000000 Inexact Rounded
-
-ddfma3430 fma 1 77e-14 10 -> 10.00000000000077
-ddfma3431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded
-ddfma3432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded
-ddfma3433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded
-ddfma3434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded
-ddfma3435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded
-ddfma3436 fma 1 77e-299 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-ddfma36440 fma 1 1 -77e-14 -> 0.99999999999923
-ddfma36441 fma 1 1 -77e-15 -> 0.999999999999923
-ddfma36442 fma 1 1 -77e-16 -> 0.9999999999999923
-ddfma36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
-ddfma36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
-ddfma36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded
-ddfma36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded
-
-ddfma36450 fma 1 10 -77e-14 -> 9.99999999999923
-ddfma36451 fma 1 10 -77e-15 -> 9.999999999999923
-ddfma36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded
-ddfma36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded
-ddfma36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded
-ddfma36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded
-ddfma36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded
-
-ddfma36460 fma 1 -77e-14 1 -> 0.99999999999923
-ddfma36461 fma 1 -77e-15 1 -> 0.999999999999923
-ddfma36462 fma 1 -77e-16 1 -> 0.9999999999999923
-ddfma36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded
-ddfma36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded
-ddfma36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded
-ddfma36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded
-
-ddfma36470 fma 1 -77e-14 10 -> 9.99999999999923
-ddfma36471 fma 1 -77e-15 10 -> 9.999999999999923
-ddfma36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded
-ddfma36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded
-ddfma36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded
-ddfma36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded
-ddfma36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-ddfma36480 fma 1 -1 77e-14 -> -0.99999999999923
-ddfma36481 fma 1 -1 77e-15 -> -0.999999999999923
-ddfma36482 fma 1 -1 77e-16 -> -0.9999999999999923
-ddfma36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded
-ddfma36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded
-ddfma36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded
-ddfma36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded
-
-ddfma36490 fma 1 -10 77e-14 -> -9.99999999999923
-ddfma36491 fma 1 -10 77e-15 -> -9.999999999999923
-ddfma36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded
-ddfma36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded
-ddfma36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded
-ddfma36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded
-ddfma36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded
-
-ddfma36500 fma 1 77e-14 -1 -> -0.99999999999923
-ddfma36501 fma 1 77e-15 -1 -> -0.999999999999923
-ddfma36502 fma 1 77e-16 -1 -> -0.9999999999999923
-ddfma36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
-ddfma36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
-ddfma36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded
-ddfma36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded
-
-ddfma36510 fma 1 77e-14 -10 -> -9.99999999999923
-ddfma36511 fma 1 77e-15 -10 -> -9.999999999999923
-ddfma36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded
-ddfma36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded
-ddfma36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded
-ddfma36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded
-ddfma36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded
-
--- and a couple more with longer RHS
-ddfma36520 fma 1 1 -7777e-16 -> 0.9999999999992223
-ddfma36521 fma 1 1 -7777e-17 -> 0.9999999999999222 Inexact Rounded
-ddfma36522 fma 1 1 -7777e-18 -> 0.9999999999999922 Inexact Rounded
-ddfma36523 fma 1 1 -7777e-19 -> 0.9999999999999992 Inexact Rounded
-ddfma36524 fma 1 1 -7777e-20 -> 0.9999999999999999 Inexact Rounded
-ddfma36525 fma 1 1 -7777e-21 -> 1.000000000000000 Inexact Rounded
-ddfma36526 fma 1 1 -7777e-22 -> 1.000000000000000 Inexact Rounded
-
-
--- and some more residue effects and different roundings
-rounding: half_up
-ddfma36540 fma 1 '6543210123456789' 0 -> '6543210123456789'
-ddfma36541 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddfma36542 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddfma36543 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddfma36544 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddfma36545 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddfma36546 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddfma36547 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddfma36548 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-ddfma36549 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-ddfma36550 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-ddfma36551 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-ddfma36552 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-ddfma36553 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-ddfma36554 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-ddfma36555 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
-ddfma36556 fma 1 '6543210123456789' 1 -> '6543210123456790'
-ddfma36557 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
-ddfma36558 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddfma36559 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
-rounding: half_even
-ddfma36560 fma 1 '6543210123456789' 0 -> '6543210123456789'
-ddfma36561 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddfma36562 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddfma36563 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddfma36564 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddfma36565 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddfma36566 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddfma36567 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddfma36568 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-ddfma36569 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-ddfma36570 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-ddfma36571 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-ddfma36572 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-ddfma36573 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-ddfma36574 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-ddfma36575 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
-ddfma36576 fma 1 '6543210123456789' 1 -> '6543210123456790'
-ddfma36577 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-ddfma36578 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddfma36579 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
--- critical few with even bottom digit...
-ddfma37540 fma 1 '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded
-ddfma37541 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
-ddfma37542 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
-
-rounding: down
-ddfma37550 fma 1 '6543210123456789' 0 -> '6543210123456789'
-ddfma37551 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-ddfma37552 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-ddfma37553 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-ddfma37554 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-ddfma37555 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-ddfma37556 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-ddfma37557 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
-ddfma37558 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
-ddfma37559 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
-ddfma37560 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
-ddfma37561 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
-ddfma37562 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
-ddfma37563 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
-ddfma37564 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
-ddfma37565 fma 1 '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded
-ddfma37566 fma 1 '6543210123456789' 1 -> '6543210123456790'
-ddfma37567 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-ddfma37568 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-ddfma37569 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
-
--- verify a query
-rounding: down
-ddfma37661 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
-ddfma37662 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
-ddfma37663 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
-ddfma37664 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-ddfma37701 fma 1 5.00 1.00E-3 -> 5.00100
-ddfma37702 fma 1 00.00 0.000 -> 0.000
-ddfma37703 fma 1 00.00 0E-3 -> 0.000
-ddfma37704 fma 1 0E-3 00.00 -> 0.000
-
-ddfma37710 fma 1 0E+3 00.00 -> 0.00
-ddfma37711 fma 1 0E+3 00.0 -> 0.0
-ddfma37712 fma 1 0E+3 00. -> 0
-ddfma37713 fma 1 0E+3 00.E+1 -> 0E+1
-ddfma37714 fma 1 0E+3 00.E+2 -> 0E+2
-ddfma37715 fma 1 0E+3 00.E+3 -> 0E+3
-ddfma37716 fma 1 0E+3 00.E+4 -> 0E+3
-ddfma37717 fma 1 0E+3 00.E+5 -> 0E+3
-ddfma37718 fma 1 0E+3 -00.0 -> 0.0
-ddfma37719 fma 1 0E+3 -00. -> 0
-ddfma37731 fma 1 0E+3 -00.E+1 -> 0E+1
-
-ddfma37720 fma 1 00.00 0E+3 -> 0.00
-ddfma37721 fma 1 00.0 0E+3 -> 0.0
-ddfma37722 fma 1 00. 0E+3 -> 0
-ddfma37723 fma 1 00.E+1 0E+3 -> 0E+1
-ddfma37724 fma 1 00.E+2 0E+3 -> 0E+2
-ddfma37725 fma 1 00.E+3 0E+3 -> 0E+3
-ddfma37726 fma 1 00.E+4 0E+3 -> 0E+3
-ddfma37727 fma 1 00.E+5 0E+3 -> 0E+3
-ddfma37728 fma 1 -00.00 0E+3 -> 0.00
-ddfma37729 fma 1 -00.0 0E+3 -> 0.0
-ddfma37730 fma 1 -00. 0E+3 -> 0
-
-ddfma37732 fma 1 0 0 -> 0
-ddfma37733 fma 1 0 -0 -> 0
-ddfma37734 fma 1 -0 0 -> 0
-ddfma37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
-
-ddfma37736 fma 1 1 -1 -> 0
-ddfma37737 fma 1 -1 -1 -> -2
-ddfma37738 fma 1 1 1 -> 2
-ddfma37739 fma 1 -1 1 -> 0
-
-ddfma37741 fma 1 0 -1 -> -1
-ddfma37742 fma 1 -0 -1 -> -1
-ddfma37743 fma 1 0 1 -> 1
-ddfma37744 fma 1 -0 1 -> 1
-ddfma37745 fma 1 -1 0 -> -1
-ddfma37746 fma 1 -1 -0 -> -1
-ddfma37747 fma 1 1 0 -> 1
-ddfma37748 fma 1 1 -0 -> 1
-
-ddfma37751 fma 1 0.0 -1 -> -1.0
-ddfma37752 fma 1 -0.0 -1 -> -1.0
-ddfma37753 fma 1 0.0 1 -> 1.0
-ddfma37754 fma 1 -0.0 1 -> 1.0
-ddfma37755 fma 1 -1.0 0 -> -1.0
-ddfma37756 fma 1 -1.0 -0 -> -1.0
-ddfma37757 fma 1 1.0 0 -> 1.0
-ddfma37758 fma 1 1.0 -0 -> 1.0
-
-ddfma37761 fma 1 0 -1.0 -> -1.0
-ddfma37762 fma 1 -0 -1.0 -> -1.0
-ddfma37763 fma 1 0 1.0 -> 1.0
-ddfma37764 fma 1 -0 1.0 -> 1.0
-ddfma37765 fma 1 -1 0.0 -> -1.0
-ddfma37766 fma 1 -1 -0.0 -> -1.0
-ddfma37767 fma 1 1 0.0 -> 1.0
-ddfma37768 fma 1 1 -0.0 -> 1.0
-
-ddfma37771 fma 1 0.0 -1.0 -> -1.0
-ddfma37772 fma 1 -0.0 -1.0 -> -1.0
-ddfma37773 fma 1 0.0 1.0 -> 1.0
-ddfma37774 fma 1 -0.0 1.0 -> 1.0
-ddfma37775 fma 1 -1.0 0.0 -> -1.0
-ddfma37776 fma 1 -1.0 -0.0 -> -1.0
-ddfma37777 fma 1 1.0 0.0 -> 1.0
-ddfma37778 fma 1 1.0 -0.0 -> 1.0
-
--- Specials
-ddfma37780 fma 1 -Inf -Inf -> -Infinity
-ddfma37781 fma 1 -Inf -1000 -> -Infinity
-ddfma37782 fma 1 -Inf -1 -> -Infinity
-ddfma37783 fma 1 -Inf -0 -> -Infinity
-ddfma37784 fma 1 -Inf 0 -> -Infinity
-ddfma37785 fma 1 -Inf 1 -> -Infinity
-ddfma37786 fma 1 -Inf 1000 -> -Infinity
-ddfma37787 fma 1 -1000 -Inf -> -Infinity
-ddfma37788 fma 1 -Inf -Inf -> -Infinity
-ddfma37789 fma 1 -1 -Inf -> -Infinity
-ddfma37790 fma 1 -0 -Inf -> -Infinity
-ddfma37791 fma 1 0 -Inf -> -Infinity
-ddfma37792 fma 1 1 -Inf -> -Infinity
-ddfma37793 fma 1 1000 -Inf -> -Infinity
-ddfma37794 fma 1 Inf -Inf -> NaN Invalid_operation
-
-ddfma37800 fma 1 Inf -Inf -> NaN Invalid_operation
-ddfma37801 fma 1 Inf -1000 -> Infinity
-ddfma37802 fma 1 Inf -1 -> Infinity
-ddfma37803 fma 1 Inf -0 -> Infinity
-ddfma37804 fma 1 Inf 0 -> Infinity
-ddfma37805 fma 1 Inf 1 -> Infinity
-ddfma37806 fma 1 Inf 1000 -> Infinity
-ddfma37807 fma 1 Inf Inf -> Infinity
-ddfma37808 fma 1 -1000 Inf -> Infinity
-ddfma37809 fma 1 -Inf Inf -> NaN Invalid_operation
-ddfma37810 fma 1 -1 Inf -> Infinity
-ddfma37811 fma 1 -0 Inf -> Infinity
-ddfma37812 fma 1 0 Inf -> Infinity
-ddfma37813 fma 1 1 Inf -> Infinity
-ddfma37814 fma 1 1000 Inf -> Infinity
-ddfma37815 fma 1 Inf Inf -> Infinity
-
-ddfma37821 fma 1 NaN -Inf -> NaN
-ddfma37822 fma 1 NaN -1000 -> NaN
-ddfma37823 fma 1 NaN -1 -> NaN
-ddfma37824 fma 1 NaN -0 -> NaN
-ddfma37825 fma 1 NaN 0 -> NaN
-ddfma37826 fma 1 NaN 1 -> NaN
-ddfma37827 fma 1 NaN 1000 -> NaN
-ddfma37828 fma 1 NaN Inf -> NaN
-ddfma37829 fma 1 NaN NaN -> NaN
-ddfma37830 fma 1 -Inf NaN -> NaN
-ddfma37831 fma 1 -1000 NaN -> NaN
-ddfma37832 fma 1 -1 NaN -> NaN
-ddfma37833 fma 1 -0 NaN -> NaN
-ddfma37834 fma 1 0 NaN -> NaN
-ddfma37835 fma 1 1 NaN -> NaN
-ddfma37836 fma 1 1000 NaN -> NaN
-ddfma37837 fma 1 Inf NaN -> NaN
-
-ddfma37841 fma 1 sNaN -Inf -> NaN Invalid_operation
-ddfma37842 fma 1 sNaN -1000 -> NaN Invalid_operation
-ddfma37843 fma 1 sNaN -1 -> NaN Invalid_operation
-ddfma37844 fma 1 sNaN -0 -> NaN Invalid_operation
-ddfma37845 fma 1 sNaN 0 -> NaN Invalid_operation
-ddfma37846 fma 1 sNaN 1 -> NaN Invalid_operation
-ddfma37847 fma 1 sNaN 1000 -> NaN Invalid_operation
-ddfma37848 fma 1 sNaN NaN -> NaN Invalid_operation
-ddfma37849 fma 1 sNaN sNaN -> NaN Invalid_operation
-ddfma37850 fma 1 NaN sNaN -> NaN Invalid_operation
-ddfma37851 fma 1 -Inf sNaN -> NaN Invalid_operation
-ddfma37852 fma 1 -1000 sNaN -> NaN Invalid_operation
-ddfma37853 fma 1 -1 sNaN -> NaN Invalid_operation
-ddfma37854 fma 1 -0 sNaN -> NaN Invalid_operation
-ddfma37855 fma 1 0 sNaN -> NaN Invalid_operation
-ddfma37856 fma 1 1 sNaN -> NaN Invalid_operation
-ddfma37857 fma 1 1000 sNaN -> NaN Invalid_operation
-ddfma37858 fma 1 Inf sNaN -> NaN Invalid_operation
-ddfma37859 fma 1 NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddfma37861 fma 1 NaN1 -Inf -> NaN1
-ddfma37862 fma 1 +NaN2 -1000 -> NaN2
-ddfma37863 fma 1 NaN3 1000 -> NaN3
-ddfma37864 fma 1 NaN4 Inf -> NaN4
-ddfma37865 fma 1 NaN5 +NaN6 -> NaN5
-ddfma37866 fma 1 -Inf NaN7 -> NaN7
-ddfma37867 fma 1 -1000 NaN8 -> NaN8
-ddfma37868 fma 1 1000 NaN9 -> NaN9
-ddfma37869 fma 1 Inf +NaN10 -> NaN10
-ddfma37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
-ddfma37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
-ddfma37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
-ddfma37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
-ddfma37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddfma37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
-ddfma37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
-ddfma37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
-ddfma37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
-ddfma37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
-ddfma37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddfma37882 fma 1 -NaN26 NaN28 -> -NaN26
-ddfma37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddfma37884 fma 1 1000 -NaN30 -> -NaN30
-ddfma37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Here we explore near the boundary of rounding a subnormal to Nmin
-ddfma37575 fma 1 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal
-ddfma37576 fma 1 -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal
-
--- check overflow edge case
--- 1234567890123456
-ddfma37972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
-ddfma37973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
-ddfma37976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
-ddfma37977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
-ddfma37978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
-ddfma37979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
-ddfma37980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
-ddfma37981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
-ddfma37984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
-
-ddfma37985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
-ddfma37986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
-ddfma37989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
-ddfma37994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
-ddfma37997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-ddfma371100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
-ddfma371101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
-ddfma371103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
-ddfma371104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
-ddfma371105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
-ddfma371106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
-ddfma371107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
-ddfma371108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
-ddfma371109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-ddfma371110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
-ddfma371111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
-ddfma371113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
-ddfma371114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
-ddfma371115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
-ddfma371116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
-ddfma371117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
-ddfma371118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
-ddfma371119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-ddfma371300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
-ddfma371311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
-ddfma371312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
-ddfma371313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
-ddfma371314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
-ddfma371315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
-ddfma371316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
-ddfma371317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
-ddfma371318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
-ddfma371319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
-ddfma371320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
-ddfma371321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
-ddfma371322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
-ddfma371323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
-ddfma371324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
-ddfma371325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
-
-ddfma371340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
-ddfma371341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
-
-ddfma371349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
-ddfma371350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
-ddfma371351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
-ddfma371352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
-ddfma371353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
-ddfma371354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
-ddfma371355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
-ddfma371356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
-ddfma371357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
-ddfma371358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
-ddfma371359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
-ddfma371360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
-ddfma371361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
-ddfma371362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
-ddfma371363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
-ddfma371364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
-ddfma371365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
-ddfma371396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-ddfma371420 fma 1 0 1.123456789012345 -> 1.123456789012345
-ddfma371421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
-ddfma371422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
-ddfma371423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
-ddfma371424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
-ddfma371425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
-ddfma371426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
-ddfma371427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
-ddfma371428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
-ddfma371429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
-ddfma371430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
-ddfma371431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
-ddfma371432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
-ddfma371433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
-ddfma371434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
-ddfma371435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
-ddfma371436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
-ddfma371437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
-ddfma371438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
-ddfma371439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
-
--- same, reversed 0
-ddfma371440 fma 1 1.123456789012345 0 -> 1.123456789012345
-ddfma371441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
-ddfma371442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
-ddfma371443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
-ddfma371444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
-ddfma371445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
-ddfma371446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
-ddfma371447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
-ddfma371448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
-ddfma371449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
-ddfma371450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
-ddfma371451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
-ddfma371452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
-ddfma371453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
-ddfma371454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
-ddfma371455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
-ddfma371456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
-ddfma371457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
-ddfma371458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
-ddfma371459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
-
--- same, Es on the 0
-ddfma371460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
-ddfma371461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
-ddfma371462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
-ddfma371463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
-ddfma371464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
-ddfma371465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
-ddfma371466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
-ddfma371467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
-ddfma371468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
-ddfma371469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
-ddfma371470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
-ddfma371471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
-ddfma371472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
-ddfma371473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
-ddfma371474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
-ddfma371475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
--- next four flag Rounded because the 0 extends the result
-ddfma371476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
-ddfma371477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
-ddfma371478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
-ddfma371479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-ddfma371500 fma 1 0 0E-19 -> 0E-19
-ddfma371501 fma 1 -0 0E-19 -> 0E-19
-ddfma371502 fma 1 0 -0E-19 -> 0E-19
-ddfma371503 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371511 fma 1 -11 11 -> 0
-ddfma371512 fma 1 11 -11 -> 0
-
-rounding: half_down
--- exact zeros from zeros
-ddfma371520 fma 1 0 0E-19 -> 0E-19
-ddfma371521 fma 1 -0 0E-19 -> 0E-19
-ddfma371522 fma 1 0 -0E-19 -> 0E-19
-ddfma371523 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371531 fma 1 -11 11 -> 0
-ddfma371532 fma 1 11 -11 -> 0
-
-rounding: half_even
--- exact zeros from zeros
-ddfma371540 fma 1 0 0E-19 -> 0E-19
-ddfma371541 fma 1 -0 0E-19 -> 0E-19
-ddfma371542 fma 1 0 -0E-19 -> 0E-19
-ddfma371543 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371551 fma 1 -11 11 -> 0
-ddfma371552 fma 1 11 -11 -> 0
-
-rounding: up
--- exact zeros from zeros
-ddfma371560 fma 1 0 0E-19 -> 0E-19
-ddfma371561 fma 1 -0 0E-19 -> 0E-19
-ddfma371562 fma 1 0 -0E-19 -> 0E-19
-ddfma371563 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371571 fma 1 -11 11 -> 0
-ddfma371572 fma 1 11 -11 -> 0
-
-rounding: down
--- exact zeros from zeros
-ddfma371580 fma 1 0 0E-19 -> 0E-19
-ddfma371581 fma 1 -0 0E-19 -> 0E-19
-ddfma371582 fma 1 0 -0E-19 -> 0E-19
-ddfma371583 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371591 fma 1 -11 11 -> 0
-ddfma371592 fma 1 11 -11 -> 0
-
-rounding: ceiling
--- exact zeros from zeros
-ddfma371600 fma 1 0 0E-19 -> 0E-19
-ddfma371601 fma 1 -0 0E-19 -> 0E-19
-ddfma371602 fma 1 0 -0E-19 -> 0E-19
-ddfma371603 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371611 fma 1 -11 11 -> 0
-ddfma371612 fma 1 11 -11 -> 0
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-ddfma371620 fma 1 0 0E-19 -> 0E-19
-ddfma371621 fma 1 -0 0E-19 -> -0E-19 -- *
-ddfma371622 fma 1 0 -0E-19 -> -0E-19 -- *
-ddfma371623 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-ddfma371631 fma 1 -11 11 -> -0 -- *
-ddfma371632 fma 1 11 -11 -> -0 -- *
-
--- Examples from SQL proposal (Krishna Kulkarni)
-ddfma371701 fma 1 130E-2 120E-2 -> 2.50
-ddfma371702 fma 1 130E-2 12E-1 -> 2.50
-ddfma371703 fma 1 130E-2 1E0 -> 2.30
-ddfma371704 fma 1 1E2 1E4 -> 1.01E+4
-ddfma371705 fma 1 130E-2 -120E-2 -> 0.10
-ddfma371706 fma 1 130E-2 -12E-1 -> 0.10
-ddfma371707 fma 1 130E-2 -1E0 -> 0.30
-ddfma371708 fma 1 1E2 -1E4 -> -9.9E+3
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-ddfma375001 fma 1 1234567890123456 1 -> 1234567890123457
-ddfma375002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
-ddfma375003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
-ddfma375004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
-ddfma375005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
-ddfma375006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
-ddfma375007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
-ddfma375008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
-ddfma375009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
-ddfma375010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
-ddfma375011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
-ddfma375012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
-ddfma375013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
-ddfma375014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
-ddfma375015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
-ddfma375016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
-ddfma375017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
-ddfma375018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
-ddfma375019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
-ddfma375020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
-ddfma375021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
-
--- widening second argument at gap
-ddfma375030 fma 1 12345678 1 -> 12345679
-ddfma375031 fma 1 12345678 0.1 -> 12345678.1
-ddfma375032 fma 1 12345678 0.12 -> 12345678.12
-ddfma375033 fma 1 12345678 0.123 -> 12345678.123
-ddfma375034 fma 1 12345678 0.1234 -> 12345678.1234
-ddfma375035 fma 1 12345678 0.12345 -> 12345678.12345
-ddfma375036 fma 1 12345678 0.123456 -> 12345678.123456
-ddfma375037 fma 1 12345678 0.1234567 -> 12345678.1234567
-ddfma375038 fma 1 12345678 0.12345678 -> 12345678.12345678
-ddfma375039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
-ddfma375040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
-ddfma375041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
-ddfma375042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
-ddfma375043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
-ddfma375044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
-ddfma375045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
-ddfma375046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
-ddfma375047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
-ddfma375048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
-ddfma375049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-ddfma375050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
-ddfma375051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
-ddfma375052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
-ddfma375053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
-ddfma375054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
-ddfma375055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
-ddfma375056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
-ddfma375057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
-ddfma375060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
-ddfma375061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
-ddfma375062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
-ddfma375063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
-ddfma375064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
-ddfma375065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
-ddfma375066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
-ddfma375067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-ddfma375070 fma 1 12345678 1E-8 -> 12345678.00000001
-ddfma375071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
-ddfma375072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
-ddfma375073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
-ddfma375074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
-ddfma375075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
-ddfma375076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
-ddfma375077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
-ddfma375078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
-ddfma375079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
-ddfma375080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
-ddfma375081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
-ddfma375082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
-ddfma375083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
-ddfma375084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
-ddfma375085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
-ddfma375086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
-ddfma375087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
-ddfma375088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
-ddfma375089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
-
--- desctructive subtraction (from remainder tests)
-
--- +++ some of these will be off-by-one remainder vs remainderNear
-
-ddfma4000 fma -1234567890123454 1.000000000000001 1234567890123456 -> 0.765432109876546
-ddfma4001 fma -1234567890123443 1.00000000000001 1234567890123456 -> 0.65432109876557
-ddfma4002 fma -1234567890123332 1.0000000000001 1234567890123456 -> 0.5432109876668
-ddfma4003 fma -308641972530863 4.000000000000001 1234567890123455 -> 2.691358027469137
-ddfma4004 fma -308641972530863 4.000000000000001 1234567890123456 -> 3.691358027469137
-ddfma4005 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696
-ddfma4006 fma -246913578024691 4.99999999999999 1234567890123456 -> 3.46913578024691
-ddfma4007 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691
-ddfma4008 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309
-ddfma4009 fma -246913578024690 5.00000000000001 1234567890123456 -> 3.53086421975310
-ddfma4010 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314
-ddfma4011 fma -1234567890123455 1.000000000000001 1234567890123456 -> -0.234567890123455
-ddfma4012 fma -1234567890123444 1.00000000000001 1234567890123456 -> -0.34567890123444
-ddfma4013 fma -1234567890123333 1.0000000000001 1234567890123456 -> -0.4567890123333
-ddfma4014 fma -308641972530864 4.000000000000001 1234567890123455 -> -1.308641972530864
-ddfma4015 fma -308641972530864 4.000000000000001 1234567890123456 -> -0.308641972530864
-ddfma4016 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696
-ddfma4017 fma -246913578024692 4.99999999999999 1234567890123456 -> -1.53086421975308
-ddfma4018 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691
-ddfma4019 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309
-ddfma4020 fma -246913578024691 5.00000000000001 1234567890123456 -> -1.46913578024691
-ddfma4021 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314
-
-
--- Null tests
-ddfma39990 fma 1 10 # -> NaN Invalid_operation
-ddfma39991 fma 1 # 10 -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- ddFMA.decTest -- decDouble Fused Multiply Add --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- These tests comprese three parts:
+-- 1. Sanity checks and other three-operand tests (especially those
+-- where the fused operation makes a difference)
+-- 2. Multiply tests (third operand is neutral zero [0E+emax])
+-- 3. Addition tests (first operand is 1)
+-- The multiply and addition tests are extensive because FMA may have
+-- its own dedicated multiplication or addition routine(s), and they
+-- also inherently check the left-to-right properties.
+
+-- Sanity checks
+ddfma0001 fma 1 1 1 -> 2
+ddfma0002 fma 1 1 2 -> 3
+ddfma0003 fma 2 2 3 -> 7
+ddfma0004 fma 9 9 9 -> 90
+ddfma0005 fma -1 1 1 -> 0
+ddfma0006 fma -1 1 2 -> 1
+ddfma0007 fma -2 2 3 -> -1
+ddfma0008 fma -9 9 9 -> -72
+ddfma0011 fma 1 -1 1 -> 0
+ddfma0012 fma 1 -1 2 -> 1
+ddfma0013 fma 2 -2 3 -> -1
+ddfma0014 fma 9 -9 9 -> -72
+ddfma0015 fma 1 1 -1 -> 0
+ddfma0016 fma 1 1 -2 -> -1
+ddfma0017 fma 2 2 -3 -> 1
+ddfma0018 fma 9 9 -9 -> 72
+
+-- non-integer exacts
+ddfma0100 fma 25.2 63.6 -438 -> 1164.72
+ddfma0101 fma 0.301 0.380 334 -> 334.114380
+ddfma0102 fma 49.2 -4.8 23.3 -> -212.86
+ddfma0103 fma 4.22 0.079 -94.6 -> -94.26662
+ddfma0104 fma 903 0.797 0.887 -> 720.578
+ddfma0105 fma 6.13 -161 65.9 -> -921.03
+ddfma0106 fma 28.2 727 5.45 -> 20506.85
+ddfma0107 fma 4 605 688 -> 3108
+ddfma0108 fma 93.3 0.19 0.226 -> 17.953
+ddfma0109 fma 0.169 -341 5.61 -> -52.019
+ddfma0110 fma -72.2 30 -51.2 -> -2217.2
+ddfma0111 fma -0.409 13 20.4 -> 15.083
+ddfma0112 fma 317 77.0 19.0 -> 24428.0
+ddfma0113 fma 47 6.58 1.62 -> 310.88
+ddfma0114 fma 1.36 0.984 0.493 -> 1.83124
+ddfma0115 fma 72.7 274 1.56 -> 19921.36
+ddfma0116 fma 335 847 83 -> 283828
+ddfma0117 fma 666 0.247 25.4 -> 189.902
+ddfma0118 fma -3.87 3.06 78.0 -> 66.1578
+ddfma0119 fma 0.742 192 35.6 -> 178.064
+ddfma0120 fma -91.6 5.29 0.153 -> -484.411
+
+-- cases where result is different from separate multiply + add; each
+-- is preceded by the result of unfused multiply and add
+-- [this is about 20% of all similar cases in general]
+-- -> 7.123356429257969E+16
+ddfma0201 fma 27583489.6645 2582471078.04 2593183.42371 -> 7.123356429257970E+16 Inexact Rounded
+-- -> 22813275328.80506
+ddfma0208 fma 24280.355566 939577.397653 2032.013252 -> 22813275328.80507 Inexact Rounded
+-- -> -2.030397734278062E+16
+ddfma0209 fma 7848976432 -2586831.2281 137903.517909 -> -2.030397734278061E+16 Inexact Rounded
+-- -> 2040774094814.077
+ddfma0217 fma 56890.388731 35872030.4255 339337.123410 -> 2040774094814.078 Inexact Rounded
+-- -> 2.714469575205049E+18
+ddfma0220 fma 7533543.57445 360317763928 5073392.31638 -> 2.714469575205050E+18 Inexact Rounded
+-- -> 1.011676297716716E+19
+ddfma0223 fma 739945255.563 13672312784.1 -994381.53572 -> 1.011676297716715E+19 Inexact Rounded
+-- -> -2.914135721455315E+23
+ddfma0224 fma -413510957218 704729988550 9234162614.0 -> -2.914135721455314E+23 Inexact Rounded
+-- -> 2.620119863365786E+17
+ddfma0226 fma 437484.00601 598906432790 894450638.442 -> 2.620119863365787E+17 Inexact Rounded
+-- -> 1.272647995808178E+19
+ddfma0253 fma 73287556929 173651305.784 -358312568.389 -> 1.272647995808177E+19 Inexact Rounded
+-- -> -1.753769320861851E+18
+ddfma0257 fma 203258304486 -8628278.8066 153127.446727 -> -1.753769320861850E+18 Inexact Rounded
+-- -> -1.550737835263346E+17
+ddfma0260 fma 42560533.1774 -3643605282.86 178277.96377 -> -1.550737835263347E+17 Inexact Rounded
+-- -> 2.897624620576005E+22
+ddfma0269 fma 142656587375 203118879670 604576103991 -> 2.897624620576004E+22 Inexact Rounded
+
+-- Cases where multiply would overflow or underflow if separate
+fma0300 fma 9e+384 10 0 -> Infinity Overflow Inexact Rounded
+fma0301 fma 1e+384 10 0 -> Infinity Overflow Inexact Rounded
+fma0302 fma 1e+384 10 -1e+384 -> 9.000000000000000E+384 Clamped
+fma0303 fma 1e+384 10 -9e+384 -> 1.000000000000000E+384 Clamped
+-- subnormal etc.
+fma0305 fma 1e-398 0.1 0 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+fma0306 fma 1e-398 0.1 1 -> 1.000000000000000 Inexact Rounded
+fma0307 fma 1e-398 0.1 1e-398 -> 1E-398 Underflow Subnormal Inexact Rounded
+
+-- Infinite combinations
+ddfma0800 fma Inf Inf Inf -> Infinity
+ddfma0801 fma Inf Inf -Inf -> NaN Invalid_operation
+ddfma0802 fma Inf -Inf Inf -> NaN Invalid_operation
+ddfma0803 fma Inf -Inf -Inf -> -Infinity
+ddfma0804 fma -Inf Inf Inf -> NaN Invalid_operation
+ddfma0805 fma -Inf Inf -Inf -> -Infinity
+ddfma0806 fma -Inf -Inf Inf -> Infinity
+ddfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
+
+-- Triple NaN propagation
+ddfma0900 fma NaN2 NaN3 NaN5 -> NaN2
+ddfma0901 fma 0 NaN3 NaN5 -> NaN3
+ddfma0902 fma 0 0 NaN5 -> NaN5
+-- first sNaN wins (consider qNaN from earlier sNaN being
+-- overridden by an sNaN in third operand)
+ddfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+ddfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
+ddfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
+ddfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+ddfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
+ddfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
+
+-- MULTIPLICATION TESTS ------------------------------------------------
+
+-- sanity checks
+ddfma2000 fma 2 2 0e+384 -> 4
+ddfma2001 fma 2 3 0e+384 -> 6
+ddfma2002 fma 5 1 0e+384 -> 5
+ddfma2003 fma 5 2 0e+384 -> 10
+ddfma2004 fma 1.20 2 0e+384 -> 2.40
+ddfma2005 fma 1.20 0 0e+384 -> 0.00
+ddfma2006 fma 1.20 -2 0e+384 -> -2.40
+ddfma2007 fma -1.20 2 0e+384 -> -2.40
+ddfma2008 fma -1.20 0 0e+384 -> 0.00
+ddfma2009 fma -1.20 -2 0e+384 -> 2.40
+ddfma2010 fma 5.09 7.1 0e+384 -> 36.139
+ddfma2011 fma 2.5 4 0e+384 -> 10.0
+ddfma2012 fma 2.50 4 0e+384 -> 10.00
+ddfma2013 fma 1.23456789 1.00000000 0e+384 -> 1.234567890000000 Rounded
+ddfma2015 fma 2.50 4 0e+384 -> 10.00
+ddfma2016 fma 9.999999999 9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded
+ddfma2017 fma 9.999999999 -9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded
+ddfma2018 fma -9.999999999 9.999999999 0e+384 -> -99.99999998000000 Inexact Rounded
+ddfma2019 fma -9.999999999 -9.999999999 0e+384 -> 99.99999998000000 Inexact Rounded
+
+-- zeros, etc.
+ddfma2021 fma 0 0 0e+384 -> 0
+ddfma2022 fma 0 -0 0e+384 -> 0
+ddfma2023 fma -0 0 0e+384 -> 0
+ddfma2024 fma -0 -0 0e+384 -> 0
+ddfma2025 fma -0.0 -0.0 0e+384 -> 0.00
+ddfma2026 fma -0.0 -0.0 0e+384 -> 0.00
+ddfma2027 fma -0.0 -0.0 0e+384 -> 0.00
+ddfma2028 fma -0.0 -0.0 0e+384 -> 0.00
+ddfma2030 fma 5.00 1E-3 0e+384 -> 0.00500
+ddfma2031 fma 00.00 0.000 0e+384 -> 0.00000
+ddfma2032 fma 00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0
+ddfma2033 fma 0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0
+ddfma2034 fma -5.00 1E-3 0e+384 -> -0.00500
+ddfma2035 fma -00.00 0.000 0e+384 -> 0.00000
+ddfma2036 fma -00.00 0E-3 0e+384 -> 0.00000 -- rhs is 0
+ddfma2037 fma -0E-3 00.00 0e+384 -> 0.00000 -- lhs is 0
+ddfma2038 fma 5.00 -1E-3 0e+384 -> -0.00500
+ddfma2039 fma 00.00 -0.000 0e+384 -> 0.00000
+ddfma2040 fma 00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0
+ddfma2041 fma 0E-3 -00.00 0e+384 -> 0.00000 -- lhs is 0
+ddfma2042 fma -5.00 -1E-3 0e+384 -> 0.00500
+ddfma2043 fma -00.00 -0.000 0e+384 -> 0.00000
+ddfma2044 fma -00.00 -0E-3 0e+384 -> 0.00000 -- rhs is 0
+ddfma2045 fma -0E-3 -00.00 -0e+384 -> 0.00000 -- lhs is 0
+ddfma2046 fma -0E-3 00.00 -0e+384 -> -0.00000
+ddfma2047 fma 0E-3 -00.00 -0e+384 -> -0.00000
+ddfma2048 fma 0E-3 00.00 -0e+384 -> 0.00000
+
+-- examples from decarith
+ddfma2050 fma 1.20 3 0e+384 -> 3.60
+ddfma2051 fma 7 3 0e+384 -> 21
+ddfma2052 fma 0.9 0.8 0e+384 -> 0.72
+ddfma2053 fma 0.9 -0 0e+384 -> 0.0
+ddfma2054 fma 654321 654321 0e+384 -> 428135971041
+
+ddfma2060 fma 123.45 1e7 0e+384 -> 1.2345E+9
+ddfma2061 fma 123.45 1e8 0e+384 -> 1.2345E+10
+ddfma2062 fma 123.45 1e+9 0e+384 -> 1.2345E+11
+ddfma2063 fma 123.45 1e10 0e+384 -> 1.2345E+12
+ddfma2064 fma 123.45 1e11 0e+384 -> 1.2345E+13
+ddfma2065 fma 123.45 1e12 0e+384 -> 1.2345E+14
+ddfma2066 fma 123.45 1e13 0e+384 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+-- 1234567890123456
+ddfma2080 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9
+ddfma2084 fma 0.1 1230123456456789 0e+384 -> 123012345645678.9
+ddfma2090 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9
+ddfma2094 fma 1230123456456789 0.1 0e+384 -> 123012345645678.9
+
+-- test some more edge cases and carries
+ddfma2101 fma 9 9 0e+384 -> 81
+ddfma2102 fma 9 90 0e+384 -> 810
+ddfma2103 fma 9 900 0e+384 -> 8100
+ddfma2104 fma 9 9000 0e+384 -> 81000
+ddfma2105 fma 9 90000 0e+384 -> 810000
+ddfma2106 fma 9 900000 0e+384 -> 8100000
+ddfma2107 fma 9 9000000 0e+384 -> 81000000
+ddfma2108 fma 9 90000000 0e+384 -> 810000000
+ddfma2109 fma 9 900000000 0e+384 -> 8100000000
+ddfma2110 fma 9 9000000000 0e+384 -> 81000000000
+ddfma2111 fma 9 90000000000 0e+384 -> 810000000000
+ddfma2112 fma 9 900000000000 0e+384 -> 8100000000000
+ddfma2113 fma 9 9000000000000 0e+384 -> 81000000000000
+ddfma2114 fma 9 90000000000000 0e+384 -> 810000000000000
+ddfma2115 fma 9 900000000000000 0e+384 -> 8100000000000000
+--ddfma2116 fma 9 9000000000000000 0e+384 -> 81000000000000000
+--ddfma2117 fma 9 90000000000000000 0e+384 -> 810000000000000000
+--ddfma2118 fma 9 900000000000000000 0e+384 -> 8100000000000000000
+--ddfma2119 fma 9 9000000000000000000 0e+384 -> 81000000000000000000
+--ddfma2120 fma 9 90000000000000000000 0e+384 -> 810000000000000000000
+--ddfma2121 fma 9 900000000000000000000 0e+384 -> 8100000000000000000000
+--ddfma2122 fma 9 9000000000000000000000 0e+384 -> 81000000000000000000000
+--ddfma2123 fma 9 90000000000000000000000 0e+384 -> 810000000000000000000000
+-- test some more edge cases without carries
+ddfma2131 fma 3 3 0e+384 -> 9
+ddfma2132 fma 3 30 0e+384 -> 90
+ddfma2133 fma 3 300 0e+384 -> 900
+ddfma2134 fma 3 3000 0e+384 -> 9000
+ddfma2135 fma 3 30000 0e+384 -> 90000
+ddfma2136 fma 3 300000 0e+384 -> 900000
+ddfma2137 fma 3 3000000 0e+384 -> 9000000
+ddfma2138 fma 3 30000000 0e+384 -> 90000000
+ddfma2139 fma 3 300000000 0e+384 -> 900000000
+ddfma2140 fma 3 3000000000 0e+384 -> 9000000000
+ddfma2141 fma 3 30000000000 0e+384 -> 90000000000
+ddfma2142 fma 3 300000000000 0e+384 -> 900000000000
+ddfma2143 fma 3 3000000000000 0e+384 -> 9000000000000
+ddfma2144 fma 3 30000000000000 0e+384 -> 90000000000000
+ddfma2145 fma 3 300000000000000 0e+384 -> 900000000000000
+
+-- test some edge cases with exact rounding
+ddfma2301 fma 9 9 0e+384 -> 81
+ddfma2302 fma 9 90 0e+384 -> 810
+ddfma2303 fma 9 900 0e+384 -> 8100
+ddfma2304 fma 9 9000 0e+384 -> 81000
+ddfma2305 fma 9 90000 0e+384 -> 810000
+ddfma2306 fma 9 900000 0e+384 -> 8100000
+ddfma2307 fma 9 9000000 0e+384 -> 81000000
+ddfma2308 fma 9 90000000 0e+384 -> 810000000
+ddfma2309 fma 9 900000000 0e+384 -> 8100000000
+ddfma2310 fma 9 9000000000 0e+384 -> 81000000000
+ddfma2311 fma 9 90000000000 0e+384 -> 810000000000
+ddfma2312 fma 9 900000000000 0e+384 -> 8100000000000
+ddfma2313 fma 9 9000000000000 0e+384 -> 81000000000000
+ddfma2314 fma 9 90000000000000 0e+384 -> 810000000000000
+ddfma2315 fma 9 900000000000000 0e+384 -> 8100000000000000
+ddfma2316 fma 9 9000000000000000 0e+384 -> 8.100000000000000E+16 Rounded
+ddfma2317 fma 90 9000000000000000 0e+384 -> 8.100000000000000E+17 Rounded
+ddfma2318 fma 900 9000000000000000 0e+384 -> 8.100000000000000E+18 Rounded
+ddfma2319 fma 9000 9000000000000000 0e+384 -> 8.100000000000000E+19 Rounded
+ddfma2320 fma 90000 9000000000000000 0e+384 -> 8.100000000000000E+20 Rounded
+ddfma2321 fma 900000 9000000000000000 0e+384 -> 8.100000000000000E+21 Rounded
+ddfma2322 fma 9000000 9000000000000000 0e+384 -> 8.100000000000000E+22 Rounded
+ddfma2323 fma 90000000 9000000000000000 0e+384 -> 8.100000000000000E+23 Rounded
+
+-- tryzeros cases
+ddfma2504 fma 0E-260 1000E-260 0e+384 -> 0E-398 Clamped
+ddfma2505 fma 100E+260 0E+260 0e+384 -> 0E+369 Clamped
+
+-- mixed with zeros
+ddfma2541 fma 0 -1 0e+384 -> 0
+ddfma2542 fma -0 -1 0e+384 -> 0
+ddfma2543 fma 0 1 0e+384 -> 0
+ddfma2544 fma -0 1 0e+384 -> 0
+ddfma2545 fma -1 0 0e+384 -> 0
+ddfma2546 fma -1 -0 0e+384 -> 0
+ddfma2547 fma 1 0 0e+384 -> 0
+ddfma2548 fma 1 -0 0e+384 -> 0
+
+ddfma2551 fma 0.0 -1 0e+384 -> 0.0
+ddfma2552 fma -0.0 -1 0e+384 -> 0.0
+ddfma2553 fma 0.0 1 0e+384 -> 0.0
+ddfma2554 fma -0.0 1 0e+384 -> 0.0
+ddfma2555 fma -1.0 0 0e+384 -> 0.0
+ddfma2556 fma -1.0 -0 0e+384 -> 0.0
+ddfma2557 fma 1.0 0 0e+384 -> 0.0
+ddfma2558 fma 1.0 -0 0e+384 -> 0.0
+
+ddfma2561 fma 0 -1.0 0e+384 -> 0.0
+ddfma2562 fma -0 -1.0 0e+384 -> 0.0
+ddfma2563 fma 0 1.0 0e+384 -> 0.0
+ddfma2564 fma -0 1.0 0e+384 -> 0.0
+ddfma2565 fma -1 0.0 0e+384 -> 0.0
+ddfma2566 fma -1 -0.0 0e+384 -> 0.0
+ddfma2567 fma 1 0.0 0e+384 -> 0.0
+ddfma2568 fma 1 -0.0 0e+384 -> 0.0
+
+ddfma2571 fma 0.0 -1.0 0e+384 -> 0.00
+ddfma2572 fma -0.0 -1.0 0e+384 -> 0.00
+ddfma2573 fma 0.0 1.0 0e+384 -> 0.00
+ddfma2574 fma -0.0 1.0 0e+384 -> 0.00
+ddfma2575 fma -1.0 0.0 0e+384 -> 0.00
+ddfma2576 fma -1.0 -0.0 0e+384 -> 0.00
+ddfma2577 fma 1.0 0.0 0e+384 -> 0.00
+ddfma2578 fma 1.0 -0.0 0e+384 -> 0.00
+
+-- Specials
+ddfma2580 fma Inf -Inf 0e+384 -> -Infinity
+ddfma2581 fma Inf -1000 0e+384 -> -Infinity
+ddfma2582 fma Inf -1 0e+384 -> -Infinity
+ddfma2583 fma Inf -0 0e+384 -> NaN Invalid_operation
+ddfma2584 fma Inf 0 0e+384 -> NaN Invalid_operation
+ddfma2585 fma Inf 1 0e+384 -> Infinity
+ddfma2586 fma Inf 1000 0e+384 -> Infinity
+ddfma2587 fma Inf Inf 0e+384 -> Infinity
+ddfma2588 fma -1000 Inf 0e+384 -> -Infinity
+ddfma2589 fma -Inf Inf 0e+384 -> -Infinity
+ddfma2590 fma -1 Inf 0e+384 -> -Infinity
+ddfma2591 fma -0 Inf 0e+384 -> NaN Invalid_operation
+ddfma2592 fma 0 Inf 0e+384 -> NaN Invalid_operation
+ddfma2593 fma 1 Inf 0e+384 -> Infinity
+ddfma2594 fma 1000 Inf 0e+384 -> Infinity
+ddfma2595 fma Inf Inf 0e+384 -> Infinity
+
+ddfma2600 fma -Inf -Inf 0e+384 -> Infinity
+ddfma2601 fma -Inf -1000 0e+384 -> Infinity
+ddfma2602 fma -Inf -1 0e+384 -> Infinity
+ddfma2603 fma -Inf -0 0e+384 -> NaN Invalid_operation
+ddfma2604 fma -Inf 0 0e+384 -> NaN Invalid_operation
+ddfma2605 fma -Inf 1 0e+384 -> -Infinity
+ddfma2606 fma -Inf 1000 0e+384 -> -Infinity
+ddfma2607 fma -Inf Inf 0e+384 -> -Infinity
+ddfma2608 fma -1000 Inf 0e+384 -> -Infinity
+ddfma2609 fma -Inf -Inf 0e+384 -> Infinity
+ddfma2610 fma -1 -Inf 0e+384 -> Infinity
+ddfma2611 fma -0 -Inf 0e+384 -> NaN Invalid_operation
+ddfma2612 fma 0 -Inf 0e+384 -> NaN Invalid_operation
+ddfma2613 fma 1 -Inf 0e+384 -> -Infinity
+ddfma2614 fma 1000 -Inf 0e+384 -> -Infinity
+ddfma2615 fma Inf -Inf 0e+384 -> -Infinity
+
+ddfma2621 fma NaN -Inf 0e+384 -> NaN
+ddfma2622 fma NaN -1000 0e+384 -> NaN
+ddfma2623 fma NaN -1 0e+384 -> NaN
+ddfma2624 fma NaN -0 0e+384 -> NaN
+ddfma2625 fma NaN 0 0e+384 -> NaN
+ddfma2626 fma NaN 1 0e+384 -> NaN
+ddfma2627 fma NaN 1000 0e+384 -> NaN
+ddfma2628 fma NaN Inf 0e+384 -> NaN
+ddfma2629 fma NaN NaN 0e+384 -> NaN
+ddfma2630 fma -Inf NaN 0e+384 -> NaN
+ddfma2631 fma -1000 NaN 0e+384 -> NaN
+ddfma2632 fma -1 NaN 0e+384 -> NaN
+ddfma2633 fma -0 NaN 0e+384 -> NaN
+ddfma2634 fma 0 NaN 0e+384 -> NaN
+ddfma2635 fma 1 NaN 0e+384 -> NaN
+ddfma2636 fma 1000 NaN 0e+384 -> NaN
+ddfma2637 fma Inf NaN 0e+384 -> NaN
+
+ddfma2641 fma sNaN -Inf 0e+384 -> NaN Invalid_operation
+ddfma2642 fma sNaN -1000 0e+384 -> NaN Invalid_operation
+ddfma2643 fma sNaN -1 0e+384 -> NaN Invalid_operation
+ddfma2644 fma sNaN -0 0e+384 -> NaN Invalid_operation
+ddfma2645 fma sNaN 0 0e+384 -> NaN Invalid_operation
+ddfma2646 fma sNaN 1 0e+384 -> NaN Invalid_operation
+ddfma2647 fma sNaN 1000 0e+384 -> NaN Invalid_operation
+ddfma2648 fma sNaN NaN 0e+384 -> NaN Invalid_operation
+ddfma2649 fma sNaN sNaN 0e+384 -> NaN Invalid_operation
+ddfma2650 fma NaN sNaN 0e+384 -> NaN Invalid_operation
+ddfma2651 fma -Inf sNaN 0e+384 -> NaN Invalid_operation
+ddfma2652 fma -1000 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2653 fma -1 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2654 fma -0 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2655 fma 0 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2656 fma 1 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2657 fma 1000 sNaN 0e+384 -> NaN Invalid_operation
+ddfma2658 fma Inf sNaN 0e+384 -> NaN Invalid_operation
+ddfma2659 fma NaN sNaN 0e+384 -> NaN Invalid_operation
+
+-- propagating NaNs
+ddfma2661 fma NaN9 -Inf 0e+384 -> NaN9
+ddfma2662 fma NaN8 999 0e+384 -> NaN8
+ddfma2663 fma NaN71 Inf 0e+384 -> NaN71
+ddfma2664 fma NaN6 NaN5 0e+384 -> NaN6
+ddfma2665 fma -Inf NaN4 0e+384 -> NaN4
+ddfma2666 fma -999 NaN33 0e+384 -> NaN33
+ddfma2667 fma Inf NaN2 0e+384 -> NaN2
+
+ddfma2671 fma sNaN99 -Inf 0e+384 -> NaN99 Invalid_operation
+ddfma2672 fma sNaN98 -11 0e+384 -> NaN98 Invalid_operation
+ddfma2673 fma sNaN97 NaN 0e+384 -> NaN97 Invalid_operation
+ddfma2674 fma sNaN16 sNaN94 0e+384 -> NaN16 Invalid_operation
+ddfma2675 fma NaN95 sNaN93 0e+384 -> NaN93 Invalid_operation
+ddfma2676 fma -Inf sNaN92 0e+384 -> NaN92 Invalid_operation
+ddfma2677 fma 088 sNaN91 0e+384 -> NaN91 Invalid_operation
+ddfma2678 fma Inf sNaN90 0e+384 -> NaN90 Invalid_operation
+ddfma2679 fma NaN sNaN89 0e+384 -> NaN89 Invalid_operation
+
+ddfma2681 fma -NaN9 -Inf 0e+384 -> -NaN9
+ddfma2682 fma -NaN8 999 0e+384 -> -NaN8
+ddfma2683 fma -NaN71 Inf 0e+384 -> -NaN71
+ddfma2684 fma -NaN6 -NaN5 0e+384 -> -NaN6
+ddfma2685 fma -Inf -NaN4 0e+384 -> -NaN4
+ddfma2686 fma -999 -NaN33 0e+384 -> -NaN33
+ddfma2687 fma Inf -NaN2 0e+384 -> -NaN2
+
+ddfma2691 fma -sNaN99 -Inf 0e+384 -> -NaN99 Invalid_operation
+ddfma2692 fma -sNaN98 -11 0e+384 -> -NaN98 Invalid_operation
+ddfma2693 fma -sNaN97 NaN 0e+384 -> -NaN97 Invalid_operation
+ddfma2694 fma -sNaN16 -sNaN94 0e+384 -> -NaN16 Invalid_operation
+ddfma2695 fma -NaN95 -sNaN93 0e+384 -> -NaN93 Invalid_operation
+ddfma2696 fma -Inf -sNaN92 0e+384 -> -NaN92 Invalid_operation
+ddfma2697 fma 088 -sNaN91 0e+384 -> -NaN91 Invalid_operation
+ddfma2698 fma Inf -sNaN90 0e+384 -> -NaN90 Invalid_operation
+ddfma2699 fma -NaN -sNaN89 0e+384 -> -NaN89 Invalid_operation
+
+ddfma2701 fma -NaN -Inf 0e+384 -> -NaN
+ddfma2702 fma -NaN 999 0e+384 -> -NaN
+ddfma2703 fma -NaN Inf 0e+384 -> -NaN
+ddfma2704 fma -NaN -NaN 0e+384 -> -NaN
+ddfma2705 fma -Inf -NaN0 0e+384 -> -NaN
+ddfma2706 fma -999 -NaN 0e+384 -> -NaN
+ddfma2707 fma Inf -NaN 0e+384 -> -NaN
+
+ddfma2711 fma -sNaN -Inf 0e+384 -> -NaN Invalid_operation
+ddfma2712 fma -sNaN -11 0e+384 -> -NaN Invalid_operation
+ddfma2713 fma -sNaN00 NaN 0e+384 -> -NaN Invalid_operation
+ddfma2714 fma -sNaN -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2715 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2716 fma -Inf -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2717 fma 088 -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2718 fma Inf -sNaN 0e+384 -> -NaN Invalid_operation
+ddfma2719 fma -NaN -sNaN 0e+384 -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+ddfma2751 fma 1e+277 1e+311 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2752 fma 1e+277 -1e+311 0e+384 -> -Infinity Overflow Inexact Rounded
+ddfma2753 fma -1e+277 1e+311 0e+384 -> -Infinity Overflow Inexact Rounded
+ddfma2754 fma -1e+277 -1e+311 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2755 fma 1e-277 1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2756 fma 1e-277 -1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2757 fma -1e-277 1e-311 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2758 fma -1e-277 -1e-311 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+ddfma2760 fma 1e-291 1e-101 0e+384 -> 1E-392 Subnormal
+ddfma2761 fma 1e-291 1e-102 0e+384 -> 1E-393 Subnormal
+ddfma2762 fma 1e-291 1e-103 0e+384 -> 1E-394 Subnormal
+ddfma2763 fma 1e-291 1e-104 0e+384 -> 1E-395 Subnormal
+ddfma2764 fma 1e-291 1e-105 0e+384 -> 1E-396 Subnormal
+ddfma2765 fma 1e-291 1e-106 0e+384 -> 1E-397 Subnormal
+ddfma2766 fma 1e-291 1e-107 0e+384 -> 1E-398 Subnormal
+ddfma2767 fma 1e-291 1e-108 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2768 fma 1e-291 1e-109 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2769 fma 1e-291 1e-110 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+ddfma2770 fma 1e+60 1e+321 0e+384 -> 1.000000000000E+381 Clamped
+ddfma2771 fma 1e+60 1e+322 0e+384 -> 1.0000000000000E+382 Clamped
+ddfma2772 fma 1e+60 1e+323 0e+384 -> 1.00000000000000E+383 Clamped
+ddfma2773 fma 1e+60 1e+324 0e+384 -> 1.000000000000000E+384 Clamped
+ddfma2774 fma 1e+60 1e+325 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2775 fma 1e+60 1e+326 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2776 fma 1e+60 1e+327 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2777 fma 1e+60 1e+328 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2778 fma 1e+60 1e+329 0e+384 -> Infinity Overflow Inexact Rounded
+ddfma2779 fma 1e+60 1e+330 0e+384 -> Infinity Overflow Inexact Rounded
+
+ddfma2801 fma 1.0000E-394 1 0e+384 -> 1.0000E-394 Subnormal
+ddfma2802 fma 1.000E-394 1e-1 0e+384 -> 1.000E-395 Subnormal
+ddfma2803 fma 1.00E-394 1e-2 0e+384 -> 1.00E-396 Subnormal
+ddfma2804 fma 1.0E-394 1e-3 0e+384 -> 1.0E-397 Subnormal
+ddfma2805 fma 1.0E-394 1e-4 0e+384 -> 1E-398 Subnormal Rounded
+ddfma2806 fma 1.3E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddfma2807 fma 1.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2808 fma 1.7E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2809 fma 2.3E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2810 fma 2.5E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2811 fma 2.7E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded
+ddfma2812 fma 1.49E-394 1e-4 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddfma2813 fma 1.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2814 fma 1.51E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2815 fma 2.49E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2816 fma 2.50E-394 1e-4 0e+384 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddfma2817 fma 2.51E-394 1e-4 0e+384 -> 3E-398 Underflow Subnormal Inexact Rounded
+
+ddfma2818 fma 1E-394 1e-4 0e+384 -> 1E-398 Subnormal
+ddfma2819 fma 3E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2820 fma 5E-394 1e-5 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2821 fma 7E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddfma2822 fma 9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddfma2823 fma 9.9E-394 1e-5 0e+384 -> 1E-398 Underflow Subnormal Inexact Rounded
+
+ddfma2824 fma 1E-394 -1e-4 0e+384 -> -1E-398 Subnormal
+ddfma2825 fma 3E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2826 fma -5E-394 1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2827 fma 7E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddfma2828 fma -9E-394 1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddfma2829 fma 9.9E-394 -1e-5 0e+384 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddfma2830 fma 3.0E-394 -1e-5 0e+384 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+ddfma2831 fma 1.0E-199 1e-200 0e+384 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddfma2832 fma 1.0E-199 1e-199 0e+384 -> 1E-398 Subnormal Rounded
+ddfma2833 fma 1.0E-199 1e-198 0e+384 -> 1.0E-397 Subnormal
+ddfma2834 fma 2.0E-199 2e-198 0e+384 -> 4.0E-397 Subnormal
+ddfma2835 fma 4.0E-199 4e-198 0e+384 -> 1.60E-396 Subnormal
+ddfma2836 fma 10.0E-199 10e-198 0e+384 -> 1.000E-395 Subnormal
+ddfma2837 fma 30.0E-199 30e-198 0e+384 -> 9.000E-395 Subnormal
+ddfma2838 fma 40.0E-199 40e-188 0e+384 -> 1.6000E-384 Subnormal
+ddfma2839 fma 40.0E-199 40e-187 0e+384 -> 1.6000E-383
+ddfma2840 fma 40.0E-199 40e-186 0e+384 -> 1.6000E-382
+
+-- Long operand overflow may be a different path
+ddfma2870 fma 100 9.999E+383 0e+384 -> Infinity Inexact Overflow Rounded
+ddfma2871 fma 100 -9.999E+383 0e+384 -> -Infinity Inexact Overflow Rounded
+ddfma2872 fma 9.999E+383 100 0e+384 -> Infinity Inexact Overflow Rounded
+ddfma2873 fma -9.999E+383 100 0e+384 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+ddfma2881 fma 1.2347E-355 1.2347E-40 0e+384 -> 1.524E-395 Inexact Rounded Subnormal Underflow
+ddfma2882 fma 1.234E-355 1.234E-40 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddfma2883 fma 1.23E-355 1.23E-40 0e+384 -> 1.513E-395 Inexact Rounded Subnormal Underflow
+ddfma2884 fma 1.2E-355 1.2E-40 0e+384 -> 1.44E-395 Subnormal
+ddfma2885 fma 1.2E-355 1.2E-41 0e+384 -> 1.44E-396 Subnormal
+ddfma2886 fma 1.2E-355 1.2E-42 0e+384 -> 1.4E-397 Subnormal Inexact Rounded Underflow
+ddfma2887 fma 1.2E-355 1.3E-42 0e+384 -> 1.6E-397 Subnormal Inexact Rounded Underflow
+ddfma2888 fma 1.3E-355 1.3E-42 0e+384 -> 1.7E-397 Subnormal Inexact Rounded Underflow
+ddfma2889 fma 1.3E-355 1.3E-43 0e+384 -> 2E-398 Subnormal Inexact Rounded Underflow
+ddfma2890 fma 1.3E-356 1.3E-43 0e+384 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow
+
+ddfma2891 fma 1.2345E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
+ddfma2892 fma 1.23456E-39 1.234E-355 0e+384 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
+ddfma2893 fma 1.2345E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddfma2894 fma 1.23456E-40 1.234E-355 0e+384 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddfma2895 fma 1.2345E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow
+ddfma2896 fma 1.23456E-41 1.234E-355 0e+384 -> 1.52E-396 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+ddfma2900 fma 0.3000000000E-191 0.3000000000E-191 0e+384 -> 9.00000000000000E-384 Subnormal Rounded
+ddfma2901 fma 0.3000000001E-191 0.3000000001E-191 0e+384 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
+ddfma2902 fma 9.999999999999999E-383 0.0999999999999 0e+384 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
+ddfma2903 fma 9.999999999999999E-383 0.09999999999999 0e+384 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
+ddfma2904 fma 9.999999999999999E-383 0.099999999999999 0e+384 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
+ddfma2905 fma 9.999999999999999E-383 0.0999999999999999 0e+384 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
+-- prove operands are exact
+ddfma2906 fma 9.999999999999999E-383 1 0e+384 -> 9.999999999999999E-383
+ddfma2907 fma 1 0.09999999999999999 0e+384 -> 0.09999999999999999
+-- the next rounds to Nmin
+ddfma2908 fma 9.999999999999999E-383 0.09999999999999999 0e+384 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+-- hugest
+ddfma2909 fma 9999999999999999 9999999999999999 0e+384 -> 9.999999999999998E+31 Inexact Rounded
+
+-- Null tests
+ddfma2990 fma 10 # 0e+384 -> NaN Invalid_operation
+ddfma2991 fma # 10 0e+384 -> NaN Invalid_operation
+
+
+-- ADDITION TESTS ------------------------------------------------------
+
+-- [first group are 'quick confidence check']
+ddfma3001 fma 1 1 1 -> 2
+ddfma3002 fma 1 2 3 -> 5
+ddfma3003 fma 1 '5.75' '3.3' -> 9.05
+ddfma3004 fma 1 '5' '-3' -> 2
+ddfma3005 fma 1 '-5' '-3' -> -8
+ddfma3006 fma 1 '-7' '2.5' -> -4.5
+ddfma3007 fma 1 '0.7' '0.3' -> 1.0
+ddfma3008 fma 1 '1.25' '1.25' -> 2.50
+ddfma3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
+ddfma3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
+
+-- 1234567890123456 1234567890123456
+ddfma3011 fma 1 '0.4444444444444446' '0.5555555555555555' -> '1.000000000000000' Inexact Rounded
+ddfma3012 fma 1 '0.4444444444444445' '0.5555555555555555' -> '1.000000000000000' Rounded
+ddfma3013 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
+ddfma3014 fma 1 '4444444444444444' '0.49' -> '4444444444444444' Inexact Rounded
+ddfma3015 fma 1 '4444444444444444' '0.499' -> '4444444444444444' Inexact Rounded
+ddfma3016 fma 1 '4444444444444444' '0.4999' -> '4444444444444444' Inexact Rounded
+ddfma3017 fma 1 '4444444444444444' '0.5000' -> '4444444444444444' Inexact Rounded
+ddfma3018 fma 1 '4444444444444444' '0.5001' -> '4444444444444445' Inexact Rounded
+ddfma3019 fma 1 '4444444444444444' '0.501' -> '4444444444444445' Inexact Rounded
+ddfma3020 fma 1 '4444444444444444' '0.51' -> '4444444444444445' Inexact Rounded
+
+ddfma3021 fma 1 0 1 -> 1
+ddfma3022 fma 1 1 1 -> 2
+ddfma3023 fma 1 2 1 -> 3
+ddfma3024 fma 1 3 1 -> 4
+ddfma3025 fma 1 4 1 -> 5
+ddfma3026 fma 1 5 1 -> 6
+ddfma3027 fma 1 6 1 -> 7
+ddfma3028 fma 1 7 1 -> 8
+ddfma3029 fma 1 8 1 -> 9
+ddfma3030 fma 1 9 1 -> 10
+
+-- some carrying effects
+ddfma3031 fma 1 '0.9998' '0.0000' -> '0.9998'
+ddfma3032 fma 1 '0.9998' '0.0001' -> '0.9999'
+ddfma3033 fma 1 '0.9998' '0.0002' -> '1.0000'
+ddfma3034 fma 1 '0.9998' '0.0003' -> '1.0001'
+
+ddfma3035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
+ddfma3039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
+
+-- symmetry:
+ddfma3040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
+ddfma3044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
+ddfma3045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
+
+-- same, without rounding
+ddfma3046 fma 1 '10000e+9' '7' -> '10000000000007'
+ddfma3047 fma 1 '10000e+9' '70' -> '10000000000070'
+ddfma3048 fma 1 '10000e+9' '700' -> '10000000000700'
+ddfma3049 fma 1 '10000e+9' '7000' -> '10000000007000'
+ddfma3050 fma 1 '10000e+9' '70000' -> '10000000070000'
+ddfma3051 fma 1 '10000e+9' '700000' -> '10000000700000'
+ddfma3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+ddfma3053 fma 1 '12' '7.00' -> '19.00'
+ddfma3054 fma 1 '1.3' '-1.07' -> '0.23'
+ddfma3055 fma 1 '1.3' '-1.30' -> '0.00'
+ddfma3056 fma 1 '1.3' '-2.07' -> '-0.77'
+ddfma3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
+
+-- leading zero preservation
+ddfma3061 fma 1 1 '0.0001' -> '1.0001'
+ddfma3062 fma 1 1 '0.00001' -> '1.00001'
+ddfma3063 fma 1 1 '0.000001' -> '1.000001'
+ddfma3064 fma 1 1 '0.0000001' -> '1.0000001'
+ddfma3065 fma 1 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+ddfma3070 fma 1 1 0 -> 1
+ddfma3071 fma 1 1 0. -> 1
+ddfma3072 fma 1 1 .0 -> 1.0
+ddfma3073 fma 1 1 0.0 -> 1.0
+ddfma3074 fma 1 1 0.00 -> 1.00
+ddfma3075 fma 1 0 1 -> 1
+ddfma3076 fma 1 0. 1 -> 1
+ddfma3077 fma 1 .0 1 -> 1.0
+ddfma3078 fma 1 0.0 1 -> 1.0
+ddfma3079 fma 1 0.00 1 -> 1.00
+
+-- some carries
+ddfma3080 fma 1 999999998 1 -> 999999999
+ddfma3081 fma 1 999999999 1 -> 1000000000
+ddfma3082 fma 1 99999999 1 -> 100000000
+ddfma3083 fma 1 9999999 1 -> 10000000
+ddfma3084 fma 1 999999 1 -> 1000000
+ddfma3085 fma 1 99999 1 -> 100000
+ddfma3086 fma 1 9999 1 -> 10000
+ddfma3087 fma 1 999 1 -> 1000
+ddfma3088 fma 1 99 1 -> 100
+ddfma3089 fma 1 9 1 -> 10
+
+
+-- more LHS swaps
+ddfma3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
+ddfma3091 fma 1 '-56267E-6' 0 -> '-0.056267'
+ddfma3092 fma 1 '-56267E-5' 0 -> '-0.56267'
+ddfma3093 fma 1 '-56267E-4' 0 -> '-5.6267'
+ddfma3094 fma 1 '-56267E-3' 0 -> '-56.267'
+ddfma3095 fma 1 '-56267E-2' 0 -> '-562.67'
+ddfma3096 fma 1 '-56267E-1' 0 -> '-5626.7'
+ddfma3097 fma 1 '-56267E-0' 0 -> '-56267'
+ddfma3098 fma 1 '-5E-10' 0 -> '-5E-10'
+ddfma3099 fma 1 '-5E-7' 0 -> '-5E-7'
+ddfma3100 fma 1 '-5E-6' 0 -> '-0.000005'
+ddfma3101 fma 1 '-5E-5' 0 -> '-0.00005'
+ddfma3102 fma 1 '-5E-4' 0 -> '-0.0005'
+ddfma3103 fma 1 '-5E-1' 0 -> '-0.5'
+ddfma3104 fma 1 '-5E0' 0 -> '-5'
+ddfma3105 fma 1 '-5E1' 0 -> '-50'
+ddfma3106 fma 1 '-5E5' 0 -> '-500000'
+ddfma3107 fma 1 '-5E15' 0 -> '-5000000000000000'
+ddfma3108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded
+ddfma3109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded
+ddfma3110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded
+ddfma3111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded
+
+-- more RHS swaps
+ddfma3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
+ddfma3114 fma 1 0 '-56267E-6' -> '-0.056267'
+ddfma3116 fma 1 0 '-56267E-5' -> '-0.56267'
+ddfma3117 fma 1 0 '-56267E-4' -> '-5.6267'
+ddfma3119 fma 1 0 '-56267E-3' -> '-56.267'
+ddfma3120 fma 1 0 '-56267E-2' -> '-562.67'
+ddfma3121 fma 1 0 '-56267E-1' -> '-5626.7'
+ddfma3122 fma 1 0 '-56267E-0' -> '-56267'
+ddfma3123 fma 1 0 '-5E-10' -> '-5E-10'
+ddfma3124 fma 1 0 '-5E-7' -> '-5E-7'
+ddfma3125 fma 1 0 '-5E-6' -> '-0.000005'
+ddfma3126 fma 1 0 '-5E-5' -> '-0.00005'
+ddfma3127 fma 1 0 '-5E-4' -> '-0.0005'
+ddfma3128 fma 1 0 '-5E-1' -> '-0.5'
+ddfma3129 fma 1 0 '-5E0' -> '-5'
+ddfma3130 fma 1 0 '-5E1' -> '-50'
+ddfma3131 fma 1 0 '-5E5' -> '-500000'
+ddfma3132 fma 1 0 '-5E15' -> '-5000000000000000'
+ddfma3133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded
+ddfma3134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded
+ddfma3135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded
+ddfma3136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded
+
+-- related
+ddfma3137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded
+ddfma3138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded
+ddfma3139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded
+ddfma3140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded
+ddfma3141 fma 1 1E+11 0.0000 -> '100000000000.0000'
+ddfma3142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded
+ddfma3143 fma 1 0.000 1E+12 -> '1000000000000.000'
+ddfma3144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+ddfma3146 fma 1 '00.0' 0 -> '0.0'
+ddfma3147 fma 1 '0.00' 0 -> '0.00'
+ddfma3148 fma 1 0 '0.00' -> '0.00'
+ddfma3149 fma 1 0 '00.0' -> '0.0'
+ddfma3150 fma 1 '00.0' '0.00' -> '0.00'
+ddfma3151 fma 1 '0.00' '00.0' -> '0.00'
+ddfma3152 fma 1 '3' '.3' -> '3.3'
+ddfma3153 fma 1 '3.' '.3' -> '3.3'
+ddfma3154 fma 1 '3.0' '.3' -> '3.3'
+ddfma3155 fma 1 '3.00' '.3' -> '3.30'
+ddfma3156 fma 1 '3' '3' -> '6'
+ddfma3157 fma 1 '3' '+3' -> '6'
+ddfma3158 fma 1 '3' '-3' -> '0'
+ddfma3159 fma 1 '0.3' '-0.3' -> '0.0'
+ddfma3160 fma 1 '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+ddfma3161 fma 1 '1E+12' '-1' -> '999999999999'
+ddfma3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
+ddfma3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
+ddfma3164 fma 1 '-1' '1E+12' -> '999999999999'
+ddfma3165 fma 1 '7E+12' '-1' -> '6999999999999'
+ddfma3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
+ddfma3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
+ddfma3168 fma 1 '-1' '7E+12' -> '6999999999999'
+
+rounding: half_up
+-- 1.234567890123456 1234567890123456 1 234567890123456
+ddfma3170 fma 1 '4.444444444444444' '0.5555555555555567' -> '5.000000000000001' Inexact Rounded
+ddfma3171 fma 1 '4.444444444444444' '0.5555555555555566' -> '5.000000000000001' Inexact Rounded
+ddfma3172 fma 1 '4.444444444444444' '0.5555555555555565' -> '5.000000000000001' Inexact Rounded
+ddfma3173 fma 1 '4.444444444444444' '0.5555555555555564' -> '5.000000000000000' Inexact Rounded
+ddfma3174 fma 1 '4.444444444444444' '0.5555555555555553' -> '4.999999999999999' Inexact Rounded
+ddfma3175 fma 1 '4.444444444444444' '0.5555555555555552' -> '4.999999999999999' Inexact Rounded
+ddfma3176 fma 1 '4.444444444444444' '0.5555555555555551' -> '4.999999999999999' Inexact Rounded
+ddfma3177 fma 1 '4.444444444444444' '0.5555555555555550' -> '4.999999999999999' Rounded
+ddfma3178 fma 1 '4.444444444444444' '0.5555555555555545' -> '4.999999999999999' Inexact Rounded
+ddfma3179 fma 1 '4.444444444444444' '0.5555555555555544' -> '4.999999999999998' Inexact Rounded
+ddfma3180 fma 1 '4.444444444444444' '0.5555555555555543' -> '4.999999999999998' Inexact Rounded
+ddfma3181 fma 1 '4.444444444444444' '0.5555555555555542' -> '4.999999999999998' Inexact Rounded
+ddfma3182 fma 1 '4.444444444444444' '0.5555555555555541' -> '4.999999999999998' Inexact Rounded
+ddfma3183 fma 1 '4.444444444444444' '0.5555555555555540' -> '4.999999999999998' Rounded
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+ddfma3200 fma 1 '1234560123456789' 0 -> '1234560123456789'
+ddfma3201 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddfma3202 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddfma3203 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddfma3204 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddfma3205 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddfma3206 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddfma3207 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddfma3208 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
+ddfma3209 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
+ddfma3210 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
+ddfma3211 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
+ddfma3212 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
+ddfma3213 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
+ddfma3214 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
+ddfma3215 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
+ddfma3216 fma 1 '1234560123456789' 1 -> '1234560123456790'
+ddfma3217 fma 1 '1234560123456789' 1.000000001 -> '1234560123456790' Inexact Rounded
+ddfma3218 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddfma3219 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+
+rounding: half_even
+ddfma3220 fma 1 '1234560123456789' 0 -> '1234560123456789'
+ddfma3221 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddfma3222 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddfma3223 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddfma3224 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddfma3225 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddfma3226 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddfma3227 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddfma3228 fma 1 '1234560123456789' 0.5 -> '1234560123456790' Inexact Rounded
+ddfma3229 fma 1 '1234560123456789' 0.500000001 -> '1234560123456790' Inexact Rounded
+ddfma3230 fma 1 '1234560123456789' 0.500001 -> '1234560123456790' Inexact Rounded
+ddfma3231 fma 1 '1234560123456789' 0.51 -> '1234560123456790' Inexact Rounded
+ddfma3232 fma 1 '1234560123456789' 0.6 -> '1234560123456790' Inexact Rounded
+ddfma3233 fma 1 '1234560123456789' 0.9 -> '1234560123456790' Inexact Rounded
+ddfma3234 fma 1 '1234560123456789' 0.99999 -> '1234560123456790' Inexact Rounded
+ddfma3235 fma 1 '1234560123456789' 0.999999999 -> '1234560123456790' Inexact Rounded
+ddfma3236 fma 1 '1234560123456789' 1 -> '1234560123456790'
+ddfma3237 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
+ddfma3238 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddfma3239 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+-- critical few with even bottom digit...
+ddfma3240 fma 1 '1234560123456788' 0.499999999 -> '1234560123456788' Inexact Rounded
+ddfma3241 fma 1 '1234560123456788' 0.5 -> '1234560123456788' Inexact Rounded
+ddfma3242 fma 1 '1234560123456788' 0.500000001 -> '1234560123456789' Inexact Rounded
+
+rounding: down
+ddfma3250 fma 1 '1234560123456789' 0 -> '1234560123456789'
+ddfma3251 fma 1 '1234560123456789' 0.000000001 -> '1234560123456789' Inexact Rounded
+ddfma3252 fma 1 '1234560123456789' 0.000001 -> '1234560123456789' Inexact Rounded
+ddfma3253 fma 1 '1234560123456789' 0.1 -> '1234560123456789' Inexact Rounded
+ddfma3254 fma 1 '1234560123456789' 0.4 -> '1234560123456789' Inexact Rounded
+ddfma3255 fma 1 '1234560123456789' 0.49 -> '1234560123456789' Inexact Rounded
+ddfma3256 fma 1 '1234560123456789' 0.499999 -> '1234560123456789' Inexact Rounded
+ddfma3257 fma 1 '1234560123456789' 0.499999999 -> '1234560123456789' Inexact Rounded
+ddfma3258 fma 1 '1234560123456789' 0.5 -> '1234560123456789' Inexact Rounded
+ddfma3259 fma 1 '1234560123456789' 0.500000001 -> '1234560123456789' Inexact Rounded
+ddfma3260 fma 1 '1234560123456789' 0.500001 -> '1234560123456789' Inexact Rounded
+ddfma3261 fma 1 '1234560123456789' 0.51 -> '1234560123456789' Inexact Rounded
+ddfma3262 fma 1 '1234560123456789' 0.6 -> '1234560123456789' Inexact Rounded
+ddfma3263 fma 1 '1234560123456789' 0.9 -> '1234560123456789' Inexact Rounded
+ddfma3264 fma 1 '1234560123456789' 0.99999 -> '1234560123456789' Inexact Rounded
+ddfma3265 fma 1 '1234560123456789' 0.999999999 -> '1234560123456789' Inexact Rounded
+ddfma3266 fma 1 '1234560123456789' 1 -> '1234560123456790'
+ddfma3267 fma 1 '1234560123456789' 1.00000001 -> '1234560123456790' Inexact Rounded
+ddfma3268 fma 1 '1234560123456789' 1.00001 -> '1234560123456790' Inexact Rounded
+ddfma3269 fma 1 '1234560123456789' 1.1 -> '1234560123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+ddfma3301 fma 1 -1 1 -> 0
+ddfma3302 fma 1 0 1 -> 1
+ddfma3303 fma 1 1 1 -> 2
+ddfma3304 fma 1 12 1 -> 13
+ddfma3305 fma 1 98 1 -> 99
+ddfma3306 fma 1 99 1 -> 100
+ddfma3307 fma 1 100 1 -> 101
+ddfma3308 fma 1 101 1 -> 102
+ddfma3309 fma 1 -1 -1 -> -2
+ddfma3310 fma 1 0 -1 -> -1
+ddfma3311 fma 1 1 -1 -> 0
+ddfma3312 fma 1 12 -1 -> 11
+ddfma3313 fma 1 98 -1 -> 97
+ddfma3314 fma 1 99 -1 -> 98
+ddfma3315 fma 1 100 -1 -> 99
+ddfma3316 fma 1 101 -1 -> 100
+
+ddfma3321 fma 1 -0.01 0.01 -> 0.00
+ddfma3322 fma 1 0.00 0.01 -> 0.01
+ddfma3323 fma 1 0.01 0.01 -> 0.02
+ddfma3324 fma 1 0.12 0.01 -> 0.13
+ddfma3325 fma 1 0.98 0.01 -> 0.99
+ddfma3326 fma 1 0.99 0.01 -> 1.00
+ddfma3327 fma 1 1.00 0.01 -> 1.01
+ddfma3328 fma 1 1.01 0.01 -> 1.02
+ddfma3329 fma 1 -0.01 -0.01 -> -0.02
+ddfma3330 fma 1 0.00 -0.01 -> -0.01
+ddfma3331 fma 1 0.01 -0.01 -> 0.00
+ddfma3332 fma 1 0.12 -0.01 -> 0.11
+ddfma3333 fma 1 0.98 -0.01 -> 0.97
+ddfma3334 fma 1 0.99 -0.01 -> 0.98
+ddfma3335 fma 1 1.00 -0.01 -> 0.99
+ddfma3336 fma 1 1.01 -0.01 -> 1.00
+
+-- some more cases where adding 0 affects the coefficient
+ddfma3340 fma 1 1E+3 0 -> 1000
+ddfma3341 fma 1 1E+15 0 -> 1000000000000000
+ddfma3342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded
+ddfma3343 fma 1 1E+20 0 -> 1.000000000000000E+20 Rounded
+-- which simply follow from these cases ...
+ddfma3344 fma 1 1E+3 1 -> 1001
+ddfma3345 fma 1 1E+15 1 -> 1000000000000001
+ddfma3346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
+ddfma3347 fma 1 1E+20 1 -> 1.000000000000000E+20 Inexact Rounded
+ddfma3348 fma 1 1E+3 7 -> 1007
+ddfma3349 fma 1 1E+15 7 -> 1000000000000007
+ddfma3350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
+ddfma3351 fma 1 1E+20 7 -> 1.000000000000000E+20 Inexact Rounded
+
+-- tryzeros cases
+rounding: half_up
+ddfma3360 fma 1 0E+50 10000E+1 -> 1.0000E+5
+ddfma3361 fma 1 0E-50 10000E+1 -> 100000.0000000000 Rounded
+ddfma3362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded
+ddfma3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
+ddfma3364 fma 1 9.999999999999999E+384 -9.999999999999999E+384 -> 0E+369
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+ddfma3370 fma 1 999999999999999 815 -> 1000000000000814
+ddfma3371 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+rounding: half_up
+ddfma3372 fma 1 999999999999999 815 -> 1000000000000814
+ddfma3373 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+rounding: half_even
+ddfma3374 fma 1 999999999999999 815 -> 1000000000000814
+ddfma3375 fma 1 9999999999999999 815 -> 1.000000000000081E+16 Rounded Inexact
+
+-- ulp replacement tests
+ddfma3400 fma 1 1 77e-14 -> 1.00000000000077
+ddfma3401 fma 1 1 77e-15 -> 1.000000000000077
+ddfma3402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded
+ddfma3403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded
+ddfma3404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded
+ddfma3405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded
+ddfma3406 fma 1 1 77e-299 -> 1.000000000000000 Inexact Rounded
+
+ddfma3410 fma 1 10 77e-14 -> 10.00000000000077
+ddfma3411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded
+ddfma3412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded
+ddfma3413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded
+ddfma3414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded
+ddfma3415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded
+ddfma3416 fma 1 10 77e-299 -> 10.00000000000000 Inexact Rounded
+
+ddfma3420 fma 1 77e-14 1 -> 1.00000000000077
+ddfma3421 fma 1 77e-15 1 -> 1.000000000000077
+ddfma3422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded
+ddfma3423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded
+ddfma3424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded
+ddfma3425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded
+ddfma3426 fma 1 77e-299 1 -> 1.000000000000000 Inexact Rounded
+
+ddfma3430 fma 1 77e-14 10 -> 10.00000000000077
+ddfma3431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded
+ddfma3432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded
+ddfma3433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded
+ddfma3434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded
+ddfma3435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded
+ddfma3436 fma 1 77e-299 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+ddfma36440 fma 1 1 -77e-14 -> 0.99999999999923
+ddfma36441 fma 1 1 -77e-15 -> 0.999999999999923
+ddfma36442 fma 1 1 -77e-16 -> 0.9999999999999923
+ddfma36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
+ddfma36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
+ddfma36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded
+ddfma36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded
+
+ddfma36450 fma 1 10 -77e-14 -> 9.99999999999923
+ddfma36451 fma 1 10 -77e-15 -> 9.999999999999923
+ddfma36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded
+ddfma36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded
+ddfma36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded
+ddfma36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded
+ddfma36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded
+
+ddfma36460 fma 1 -77e-14 1 -> 0.99999999999923
+ddfma36461 fma 1 -77e-15 1 -> 0.999999999999923
+ddfma36462 fma 1 -77e-16 1 -> 0.9999999999999923
+ddfma36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded
+ddfma36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded
+ddfma36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded
+ddfma36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded
+
+ddfma36470 fma 1 -77e-14 10 -> 9.99999999999923
+ddfma36471 fma 1 -77e-15 10 -> 9.999999999999923
+ddfma36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded
+ddfma36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded
+ddfma36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded
+ddfma36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded
+ddfma36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+ddfma36480 fma 1 -1 77e-14 -> -0.99999999999923
+ddfma36481 fma 1 -1 77e-15 -> -0.999999999999923
+ddfma36482 fma 1 -1 77e-16 -> -0.9999999999999923
+ddfma36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded
+ddfma36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded
+ddfma36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded
+ddfma36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded
+
+ddfma36490 fma 1 -10 77e-14 -> -9.99999999999923
+ddfma36491 fma 1 -10 77e-15 -> -9.999999999999923
+ddfma36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded
+ddfma36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded
+ddfma36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded
+ddfma36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded
+ddfma36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded
+
+ddfma36500 fma 1 77e-14 -1 -> -0.99999999999923
+ddfma36501 fma 1 77e-15 -1 -> -0.999999999999923
+ddfma36502 fma 1 77e-16 -1 -> -0.9999999999999923
+ddfma36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
+ddfma36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
+ddfma36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded
+ddfma36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded
+
+ddfma36510 fma 1 77e-14 -10 -> -9.99999999999923
+ddfma36511 fma 1 77e-15 -10 -> -9.999999999999923
+ddfma36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded
+ddfma36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded
+ddfma36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded
+ddfma36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded
+ddfma36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded
+
+-- and a couple more with longer RHS
+ddfma36520 fma 1 1 -7777e-16 -> 0.9999999999992223
+ddfma36521 fma 1 1 -7777e-17 -> 0.9999999999999222 Inexact Rounded
+ddfma36522 fma 1 1 -7777e-18 -> 0.9999999999999922 Inexact Rounded
+ddfma36523 fma 1 1 -7777e-19 -> 0.9999999999999992 Inexact Rounded
+ddfma36524 fma 1 1 -7777e-20 -> 0.9999999999999999 Inexact Rounded
+ddfma36525 fma 1 1 -7777e-21 -> 1.000000000000000 Inexact Rounded
+ddfma36526 fma 1 1 -7777e-22 -> 1.000000000000000 Inexact Rounded
+
+
+-- and some more residue effects and different roundings
+rounding: half_up
+ddfma36540 fma 1 '6543210123456789' 0 -> '6543210123456789'
+ddfma36541 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddfma36542 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddfma36543 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddfma36544 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddfma36545 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddfma36546 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddfma36547 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddfma36548 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+ddfma36549 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+ddfma36550 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+ddfma36551 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+ddfma36552 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+ddfma36553 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+ddfma36554 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+ddfma36555 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
+ddfma36556 fma 1 '6543210123456789' 1 -> '6543210123456790'
+ddfma36557 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
+ddfma36558 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddfma36559 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+rounding: half_even
+ddfma36560 fma 1 '6543210123456789' 0 -> '6543210123456789'
+ddfma36561 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddfma36562 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddfma36563 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddfma36564 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddfma36565 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddfma36566 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddfma36567 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddfma36568 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+ddfma36569 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+ddfma36570 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+ddfma36571 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+ddfma36572 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+ddfma36573 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+ddfma36574 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+ddfma36575 fma 1 '6543210123456789' 0.999999999 -> '6543210123456790' Inexact Rounded
+ddfma36576 fma 1 '6543210123456789' 1 -> '6543210123456790'
+ddfma36577 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+ddfma36578 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddfma36579 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+-- critical few with even bottom digit...
+ddfma37540 fma 1 '6543210123456788' 0.499999999 -> '6543210123456788' Inexact Rounded
+ddfma37541 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
+ddfma37542 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
+
+rounding: down
+ddfma37550 fma 1 '6543210123456789' 0 -> '6543210123456789'
+ddfma37551 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+ddfma37552 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+ddfma37553 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+ddfma37554 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+ddfma37555 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+ddfma37556 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+ddfma37557 fma 1 '6543210123456789' 0.499999999 -> '6543210123456789' Inexact Rounded
+ddfma37558 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
+ddfma37559 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
+ddfma37560 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
+ddfma37561 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
+ddfma37562 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
+ddfma37563 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
+ddfma37564 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
+ddfma37565 fma 1 '6543210123456789' 0.999999999 -> '6543210123456789' Inexact Rounded
+ddfma37566 fma 1 '6543210123456789' 1 -> '6543210123456790'
+ddfma37567 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+ddfma37568 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+ddfma37569 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+
+-- verify a query
+rounding: down
+ddfma37661 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
+ddfma37662 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
+ddfma37663 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
+ddfma37664 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+ddfma37701 fma 1 5.00 1.00E-3 -> 5.00100
+ddfma37702 fma 1 00.00 0.000 -> 0.000
+ddfma37703 fma 1 00.00 0E-3 -> 0.000
+ddfma37704 fma 1 0E-3 00.00 -> 0.000
+
+ddfma37710 fma 1 0E+3 00.00 -> 0.00
+ddfma37711 fma 1 0E+3 00.0 -> 0.0
+ddfma37712 fma 1 0E+3 00. -> 0
+ddfma37713 fma 1 0E+3 00.E+1 -> 0E+1
+ddfma37714 fma 1 0E+3 00.E+2 -> 0E+2
+ddfma37715 fma 1 0E+3 00.E+3 -> 0E+3
+ddfma37716 fma 1 0E+3 00.E+4 -> 0E+3
+ddfma37717 fma 1 0E+3 00.E+5 -> 0E+3
+ddfma37718 fma 1 0E+3 -00.0 -> 0.0
+ddfma37719 fma 1 0E+3 -00. -> 0
+ddfma37731 fma 1 0E+3 -00.E+1 -> 0E+1
+
+ddfma37720 fma 1 00.00 0E+3 -> 0.00
+ddfma37721 fma 1 00.0 0E+3 -> 0.0
+ddfma37722 fma 1 00. 0E+3 -> 0
+ddfma37723 fma 1 00.E+1 0E+3 -> 0E+1
+ddfma37724 fma 1 00.E+2 0E+3 -> 0E+2
+ddfma37725 fma 1 00.E+3 0E+3 -> 0E+3
+ddfma37726 fma 1 00.E+4 0E+3 -> 0E+3
+ddfma37727 fma 1 00.E+5 0E+3 -> 0E+3
+ddfma37728 fma 1 -00.00 0E+3 -> 0.00
+ddfma37729 fma 1 -00.0 0E+3 -> 0.0
+ddfma37730 fma 1 -00. 0E+3 -> 0
+
+ddfma37732 fma 1 0 0 -> 0
+ddfma37733 fma 1 0 -0 -> 0
+ddfma37734 fma 1 -0 0 -> 0
+ddfma37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
+
+ddfma37736 fma 1 1 -1 -> 0
+ddfma37737 fma 1 -1 -1 -> -2
+ddfma37738 fma 1 1 1 -> 2
+ddfma37739 fma 1 -1 1 -> 0
+
+ddfma37741 fma 1 0 -1 -> -1
+ddfma37742 fma 1 -0 -1 -> -1
+ddfma37743 fma 1 0 1 -> 1
+ddfma37744 fma 1 -0 1 -> 1
+ddfma37745 fma 1 -1 0 -> -1
+ddfma37746 fma 1 -1 -0 -> -1
+ddfma37747 fma 1 1 0 -> 1
+ddfma37748 fma 1 1 -0 -> 1
+
+ddfma37751 fma 1 0.0 -1 -> -1.0
+ddfma37752 fma 1 -0.0 -1 -> -1.0
+ddfma37753 fma 1 0.0 1 -> 1.0
+ddfma37754 fma 1 -0.0 1 -> 1.0
+ddfma37755 fma 1 -1.0 0 -> -1.0
+ddfma37756 fma 1 -1.0 -0 -> -1.0
+ddfma37757 fma 1 1.0 0 -> 1.0
+ddfma37758 fma 1 1.0 -0 -> 1.0
+
+ddfma37761 fma 1 0 -1.0 -> -1.0
+ddfma37762 fma 1 -0 -1.0 -> -1.0
+ddfma37763 fma 1 0 1.0 -> 1.0
+ddfma37764 fma 1 -0 1.0 -> 1.0
+ddfma37765 fma 1 -1 0.0 -> -1.0
+ddfma37766 fma 1 -1 -0.0 -> -1.0
+ddfma37767 fma 1 1 0.0 -> 1.0
+ddfma37768 fma 1 1 -0.0 -> 1.0
+
+ddfma37771 fma 1 0.0 -1.0 -> -1.0
+ddfma37772 fma 1 -0.0 -1.0 -> -1.0
+ddfma37773 fma 1 0.0 1.0 -> 1.0
+ddfma37774 fma 1 -0.0 1.0 -> 1.0
+ddfma37775 fma 1 -1.0 0.0 -> -1.0
+ddfma37776 fma 1 -1.0 -0.0 -> -1.0
+ddfma37777 fma 1 1.0 0.0 -> 1.0
+ddfma37778 fma 1 1.0 -0.0 -> 1.0
+
+-- Specials
+ddfma37780 fma 1 -Inf -Inf -> -Infinity
+ddfma37781 fma 1 -Inf -1000 -> -Infinity
+ddfma37782 fma 1 -Inf -1 -> -Infinity
+ddfma37783 fma 1 -Inf -0 -> -Infinity
+ddfma37784 fma 1 -Inf 0 -> -Infinity
+ddfma37785 fma 1 -Inf 1 -> -Infinity
+ddfma37786 fma 1 -Inf 1000 -> -Infinity
+ddfma37787 fma 1 -1000 -Inf -> -Infinity
+ddfma37788 fma 1 -Inf -Inf -> -Infinity
+ddfma37789 fma 1 -1 -Inf -> -Infinity
+ddfma37790 fma 1 -0 -Inf -> -Infinity
+ddfma37791 fma 1 0 -Inf -> -Infinity
+ddfma37792 fma 1 1 -Inf -> -Infinity
+ddfma37793 fma 1 1000 -Inf -> -Infinity
+ddfma37794 fma 1 Inf -Inf -> NaN Invalid_operation
+
+ddfma37800 fma 1 Inf -Inf -> NaN Invalid_operation
+ddfma37801 fma 1 Inf -1000 -> Infinity
+ddfma37802 fma 1 Inf -1 -> Infinity
+ddfma37803 fma 1 Inf -0 -> Infinity
+ddfma37804 fma 1 Inf 0 -> Infinity
+ddfma37805 fma 1 Inf 1 -> Infinity
+ddfma37806 fma 1 Inf 1000 -> Infinity
+ddfma37807 fma 1 Inf Inf -> Infinity
+ddfma37808 fma 1 -1000 Inf -> Infinity
+ddfma37809 fma 1 -Inf Inf -> NaN Invalid_operation
+ddfma37810 fma 1 -1 Inf -> Infinity
+ddfma37811 fma 1 -0 Inf -> Infinity
+ddfma37812 fma 1 0 Inf -> Infinity
+ddfma37813 fma 1 1 Inf -> Infinity
+ddfma37814 fma 1 1000 Inf -> Infinity
+ddfma37815 fma 1 Inf Inf -> Infinity
+
+ddfma37821 fma 1 NaN -Inf -> NaN
+ddfma37822 fma 1 NaN -1000 -> NaN
+ddfma37823 fma 1 NaN -1 -> NaN
+ddfma37824 fma 1 NaN -0 -> NaN
+ddfma37825 fma 1 NaN 0 -> NaN
+ddfma37826 fma 1 NaN 1 -> NaN
+ddfma37827 fma 1 NaN 1000 -> NaN
+ddfma37828 fma 1 NaN Inf -> NaN
+ddfma37829 fma 1 NaN NaN -> NaN
+ddfma37830 fma 1 -Inf NaN -> NaN
+ddfma37831 fma 1 -1000 NaN -> NaN
+ddfma37832 fma 1 -1 NaN -> NaN
+ddfma37833 fma 1 -0 NaN -> NaN
+ddfma37834 fma 1 0 NaN -> NaN
+ddfma37835 fma 1 1 NaN -> NaN
+ddfma37836 fma 1 1000 NaN -> NaN
+ddfma37837 fma 1 Inf NaN -> NaN
+
+ddfma37841 fma 1 sNaN -Inf -> NaN Invalid_operation
+ddfma37842 fma 1 sNaN -1000 -> NaN Invalid_operation
+ddfma37843 fma 1 sNaN -1 -> NaN Invalid_operation
+ddfma37844 fma 1 sNaN -0 -> NaN Invalid_operation
+ddfma37845 fma 1 sNaN 0 -> NaN Invalid_operation
+ddfma37846 fma 1 sNaN 1 -> NaN Invalid_operation
+ddfma37847 fma 1 sNaN 1000 -> NaN Invalid_operation
+ddfma37848 fma 1 sNaN NaN -> NaN Invalid_operation
+ddfma37849 fma 1 sNaN sNaN -> NaN Invalid_operation
+ddfma37850 fma 1 NaN sNaN -> NaN Invalid_operation
+ddfma37851 fma 1 -Inf sNaN -> NaN Invalid_operation
+ddfma37852 fma 1 -1000 sNaN -> NaN Invalid_operation
+ddfma37853 fma 1 -1 sNaN -> NaN Invalid_operation
+ddfma37854 fma 1 -0 sNaN -> NaN Invalid_operation
+ddfma37855 fma 1 0 sNaN -> NaN Invalid_operation
+ddfma37856 fma 1 1 sNaN -> NaN Invalid_operation
+ddfma37857 fma 1 1000 sNaN -> NaN Invalid_operation
+ddfma37858 fma 1 Inf sNaN -> NaN Invalid_operation
+ddfma37859 fma 1 NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddfma37861 fma 1 NaN1 -Inf -> NaN1
+ddfma37862 fma 1 +NaN2 -1000 -> NaN2
+ddfma37863 fma 1 NaN3 1000 -> NaN3
+ddfma37864 fma 1 NaN4 Inf -> NaN4
+ddfma37865 fma 1 NaN5 +NaN6 -> NaN5
+ddfma37866 fma 1 -Inf NaN7 -> NaN7
+ddfma37867 fma 1 -1000 NaN8 -> NaN8
+ddfma37868 fma 1 1000 NaN9 -> NaN9
+ddfma37869 fma 1 Inf +NaN10 -> NaN10
+ddfma37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
+ddfma37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
+ddfma37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
+ddfma37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
+ddfma37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddfma37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
+ddfma37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
+ddfma37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
+ddfma37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
+ddfma37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
+ddfma37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddfma37882 fma 1 -NaN26 NaN28 -> -NaN26
+ddfma37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddfma37884 fma 1 1000 -NaN30 -> -NaN30
+ddfma37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Here we explore near the boundary of rounding a subnormal to Nmin
+ddfma37575 fma 1 1E-383 -1E-398 -> 9.99999999999999E-384 Subnormal
+ddfma37576 fma 1 -1E-383 +1E-398 -> -9.99999999999999E-384 Subnormal
+
+-- check overflow edge case
+-- 1234567890123456
+ddfma37972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
+ddfma37973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
+ddfma37976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
+ddfma37977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
+ddfma37978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
+ddfma37979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
+ddfma37980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
+ddfma37981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
+ddfma37984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
+
+ddfma37985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
+ddfma37986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
+ddfma37989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
+ddfma37994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
+ddfma37997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+ddfma371100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
+ddfma371101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
+ddfma371103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
+ddfma371104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
+ddfma371105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
+ddfma371106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
+ddfma371107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
+ddfma371108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
+ddfma371109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+ddfma371110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
+ddfma371111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
+ddfma371113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
+ddfma371114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
+ddfma371115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
+ddfma371116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
+ddfma371117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
+ddfma371118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
+ddfma371119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+ddfma371300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
+ddfma371311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
+ddfma371312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
+ddfma371313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
+ddfma371314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
+ddfma371315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
+ddfma371316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
+ddfma371317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
+ddfma371318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
+ddfma371319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
+ddfma371320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
+ddfma371321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
+ddfma371322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
+ddfma371323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
+ddfma371324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
+ddfma371325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
+
+ddfma371340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
+ddfma371341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
+
+ddfma371349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
+ddfma371350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
+ddfma371351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
+ddfma371352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
+ddfma371353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
+ddfma371354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
+ddfma371355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
+ddfma371356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
+ddfma371357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
+ddfma371358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
+ddfma371359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
+ddfma371360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
+ddfma371361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
+ddfma371362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
+ddfma371363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
+ddfma371364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
+ddfma371365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
+ddfma371396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+ddfma371420 fma 1 0 1.123456789012345 -> 1.123456789012345
+ddfma371421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
+ddfma371422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
+ddfma371423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
+ddfma371424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
+ddfma371425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
+ddfma371426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
+ddfma371427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
+ddfma371428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
+ddfma371429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
+ddfma371430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
+ddfma371431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
+ddfma371432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
+ddfma371433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
+ddfma371434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
+ddfma371435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
+ddfma371436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
+ddfma371437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
+ddfma371438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
+ddfma371439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+ddfma371440 fma 1 1.123456789012345 0 -> 1.123456789012345
+ddfma371441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
+ddfma371442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
+ddfma371443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
+ddfma371444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
+ddfma371445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
+ddfma371446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
+ddfma371447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
+ddfma371448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
+ddfma371449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
+ddfma371450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
+ddfma371451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
+ddfma371452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
+ddfma371453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
+ddfma371454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
+ddfma371455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
+ddfma371456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
+ddfma371457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
+ddfma371458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
+ddfma371459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+ddfma371460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
+ddfma371461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
+ddfma371462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
+ddfma371463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
+ddfma371464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
+ddfma371465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
+ddfma371466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
+ddfma371467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
+ddfma371468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
+ddfma371469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
+ddfma371470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
+ddfma371471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
+ddfma371472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
+ddfma371473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
+ddfma371474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
+ddfma371475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+ddfma371476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
+ddfma371477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
+ddfma371478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
+ddfma371479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+ddfma371500 fma 1 0 0E-19 -> 0E-19
+ddfma371501 fma 1 -0 0E-19 -> 0E-19
+ddfma371502 fma 1 0 -0E-19 -> 0E-19
+ddfma371503 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371511 fma 1 -11 11 -> 0
+ddfma371512 fma 1 11 -11 -> 0
+
+rounding: half_down
+-- exact zeros from zeros
+ddfma371520 fma 1 0 0E-19 -> 0E-19
+ddfma371521 fma 1 -0 0E-19 -> 0E-19
+ddfma371522 fma 1 0 -0E-19 -> 0E-19
+ddfma371523 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371531 fma 1 -11 11 -> 0
+ddfma371532 fma 1 11 -11 -> 0
+
+rounding: half_even
+-- exact zeros from zeros
+ddfma371540 fma 1 0 0E-19 -> 0E-19
+ddfma371541 fma 1 -0 0E-19 -> 0E-19
+ddfma371542 fma 1 0 -0E-19 -> 0E-19
+ddfma371543 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371551 fma 1 -11 11 -> 0
+ddfma371552 fma 1 11 -11 -> 0
+
+rounding: up
+-- exact zeros from zeros
+ddfma371560 fma 1 0 0E-19 -> 0E-19
+ddfma371561 fma 1 -0 0E-19 -> 0E-19
+ddfma371562 fma 1 0 -0E-19 -> 0E-19
+ddfma371563 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371571 fma 1 -11 11 -> 0
+ddfma371572 fma 1 11 -11 -> 0
+
+rounding: down
+-- exact zeros from zeros
+ddfma371580 fma 1 0 0E-19 -> 0E-19
+ddfma371581 fma 1 -0 0E-19 -> 0E-19
+ddfma371582 fma 1 0 -0E-19 -> 0E-19
+ddfma371583 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371591 fma 1 -11 11 -> 0
+ddfma371592 fma 1 11 -11 -> 0
+
+rounding: ceiling
+-- exact zeros from zeros
+ddfma371600 fma 1 0 0E-19 -> 0E-19
+ddfma371601 fma 1 -0 0E-19 -> 0E-19
+ddfma371602 fma 1 0 -0E-19 -> 0E-19
+ddfma371603 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371611 fma 1 -11 11 -> 0
+ddfma371612 fma 1 11 -11 -> 0
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+ddfma371620 fma 1 0 0E-19 -> 0E-19
+ddfma371621 fma 1 -0 0E-19 -> -0E-19 -- *
+ddfma371622 fma 1 0 -0E-19 -> -0E-19 -- *
+ddfma371623 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+ddfma371631 fma 1 -11 11 -> -0 -- *
+ddfma371632 fma 1 11 -11 -> -0 -- *
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+ddfma371701 fma 1 130E-2 120E-2 -> 2.50
+ddfma371702 fma 1 130E-2 12E-1 -> 2.50
+ddfma371703 fma 1 130E-2 1E0 -> 2.30
+ddfma371704 fma 1 1E2 1E4 -> 1.01E+4
+ddfma371705 fma 1 130E-2 -120E-2 -> 0.10
+ddfma371706 fma 1 130E-2 -12E-1 -> 0.10
+ddfma371707 fma 1 130E-2 -1E0 -> 0.30
+ddfma371708 fma 1 1E2 -1E4 -> -9.9E+3
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+ddfma375001 fma 1 1234567890123456 1 -> 1234567890123457
+ddfma375002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
+ddfma375003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
+ddfma375004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
+ddfma375005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
+ddfma375006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
+ddfma375007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
+ddfma375008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
+ddfma375009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
+ddfma375010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
+ddfma375011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
+ddfma375012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
+ddfma375013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
+ddfma375014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
+ddfma375015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
+ddfma375016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
+ddfma375017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
+ddfma375018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
+ddfma375019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
+ddfma375020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
+ddfma375021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
+
+-- widening second argument at gap
+ddfma375030 fma 1 12345678 1 -> 12345679
+ddfma375031 fma 1 12345678 0.1 -> 12345678.1
+ddfma375032 fma 1 12345678 0.12 -> 12345678.12
+ddfma375033 fma 1 12345678 0.123 -> 12345678.123
+ddfma375034 fma 1 12345678 0.1234 -> 12345678.1234
+ddfma375035 fma 1 12345678 0.12345 -> 12345678.12345
+ddfma375036 fma 1 12345678 0.123456 -> 12345678.123456
+ddfma375037 fma 1 12345678 0.1234567 -> 12345678.1234567
+ddfma375038 fma 1 12345678 0.12345678 -> 12345678.12345678
+ddfma375039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
+ddfma375040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
+ddfma375041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
+ddfma375042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
+ddfma375043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
+ddfma375044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
+ddfma375045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
+ddfma375046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
+ddfma375047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
+ddfma375048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
+ddfma375049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+ddfma375050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
+ddfma375051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
+ddfma375052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
+ddfma375053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
+ddfma375054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
+ddfma375055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
+ddfma375056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
+ddfma375057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
+ddfma375060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
+ddfma375061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
+ddfma375062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
+ddfma375063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
+ddfma375064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
+ddfma375065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
+ddfma375066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
+ddfma375067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+ddfma375070 fma 1 12345678 1E-8 -> 12345678.00000001
+ddfma375071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
+ddfma375072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
+ddfma375073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
+ddfma375074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
+ddfma375075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
+ddfma375076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
+ddfma375077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
+ddfma375078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
+ddfma375079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
+ddfma375080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
+ddfma375081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
+ddfma375082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
+ddfma375083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
+ddfma375084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
+ddfma375085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
+ddfma375086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
+ddfma375087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
+ddfma375088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
+ddfma375089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
+
+-- desctructive subtraction (from remainder tests)
+
+-- +++ some of these will be off-by-one remainder vs remainderNear
+
+ddfma4000 fma -1234567890123454 1.000000000000001 1234567890123456 -> 0.765432109876546
+ddfma4001 fma -1234567890123443 1.00000000000001 1234567890123456 -> 0.65432109876557
+ddfma4002 fma -1234567890123332 1.0000000000001 1234567890123456 -> 0.5432109876668
+ddfma4003 fma -308641972530863 4.000000000000001 1234567890123455 -> 2.691358027469137
+ddfma4004 fma -308641972530863 4.000000000000001 1234567890123456 -> 3.691358027469137
+ddfma4005 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696
+ddfma4006 fma -246913578024691 4.99999999999999 1234567890123456 -> 3.46913578024691
+ddfma4007 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691
+ddfma4008 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309
+ddfma4009 fma -246913578024690 5.00000000000001 1234567890123456 -> 3.53086421975310
+ddfma4010 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314
+ddfma4011 fma -1234567890123455 1.000000000000001 1234567890123456 -> -0.234567890123455
+ddfma4012 fma -1234567890123444 1.00000000000001 1234567890123456 -> -0.34567890123444
+ddfma4013 fma -1234567890123333 1.0000000000001 1234567890123456 -> -0.4567890123333
+ddfma4014 fma -308641972530864 4.000000000000001 1234567890123455 -> -1.308641972530864
+ddfma4015 fma -308641972530864 4.000000000000001 1234567890123456 -> -0.308641972530864
+ddfma4016 fma -246913578024696 4.9999999999999 1234567890123456 -> 0.6913578024696
+ddfma4017 fma -246913578024692 4.99999999999999 1234567890123456 -> -1.53086421975308
+ddfma4018 fma -246913578024691 4.999999999999999 1234567890123456 -> 1.246913578024691
+ddfma4019 fma -246913578024691 5.000000000000001 1234567890123456 -> 0.753086421975309
+ddfma4020 fma -246913578024691 5.00000000000001 1234567890123456 -> -1.46913578024691
+ddfma4021 fma -246913578024686 5.0000000000001 1234567890123456 -> 1.3086421975314
+
+
+-- Null tests
+ddfma39990 fma 1 10 # -> NaN Invalid_operation
+ddfma39991 fma 1 # 10 -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/ddInvert.decTest b/Lib/test/decimaltestdata/ddInvert.decTest
index 321e4e9ee9..5d19fba829 100644
--- a/Lib/test/decimaltestdata/ddInvert.decTest
+++ b/Lib/test/decimaltestdata/ddInvert.decTest
@@ -1,202 +1,202 @@
-------------------------------------------------------------------------
--- ddInvert.decTest -- digitwise logical INVERT for decDoubles --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check (truth table)
-ddinv001 invert 0 -> 1111111111111111
-ddinv002 invert 1 -> 1111111111111110
-ddinv003 invert 10 -> 1111111111111101
-ddinv004 invert 111111111 -> 1111111000000000
-ddinv005 invert 000000000 -> 1111111111111111
--- and at msd and msd-1
-ddinv007 invert 0000000000000000 -> 1111111111111111
-ddinv008 invert 1000000000000000 -> 111111111111111
-ddinv009 invert 0000000000000000 -> 1111111111111111
-ddinv010 invert 0100000000000000 -> 1011111111111111
-ddinv011 invert 0111111111111111 -> 1000000000000000
-ddinv012 invert 1111111111111111 -> 0
-ddinv013 invert 0011111111111111 -> 1100000000000000
-ddinv014 invert 0111111111111111 -> 1000000000000000
-
--- Various lengths
--- 123456789 1234567890123456
-ddinv021 invert 111111111 -> 1111111000000000
-ddinv022 invert 111111111111 -> 1111000000000000
-ddinv023 invert 11111111 -> 1111111100000000
-ddinv025 invert 1111111 -> 1111111110000000
-ddinv026 invert 111111 -> 1111111111000000
-ddinv027 invert 11111 -> 1111111111100000
-ddinv028 invert 1111 -> 1111111111110000
-ddinv029 invert 111 -> 1111111111111000
-ddinv031 invert 11 -> 1111111111111100
-ddinv032 invert 1 -> 1111111111111110
-ddinv033 invert 111111111111 -> 1111000000000000
-ddinv034 invert 11111111111 -> 1111100000000000
-ddinv035 invert 1111111111 -> 1111110000000000
-ddinv036 invert 111111111 -> 1111111000000000
-
-ddinv040 invert 011111111 -> 1111111100000000
-ddinv041 invert 101111111 -> 1111111010000000
-ddinv042 invert 110111111 -> 1111111001000000
-ddinv043 invert 111011111 -> 1111111000100000
-ddinv044 invert 111101111 -> 1111111000010000
-ddinv045 invert 111110111 -> 1111111000001000
-ddinv046 invert 111111011 -> 1111111000000100
-ddinv047 invert 111111101 -> 1111111000000010
-ddinv048 invert 111111110 -> 1111111000000001
-ddinv049 invert 011111011 -> 1111111100000100
-ddinv050 invert 101111101 -> 1111111010000010
-ddinv051 invert 110111110 -> 1111111001000001
-ddinv052 invert 111011101 -> 1111111000100010
-ddinv053 invert 111101011 -> 1111111000010100
-ddinv054 invert 111110111 -> 1111111000001000
-ddinv055 invert 111101011 -> 1111111000010100
-ddinv056 invert 111011101 -> 1111111000100010
-ddinv057 invert 110111110 -> 1111111001000001
-ddinv058 invert 101111101 -> 1111111010000010
-ddinv059 invert 011111011 -> 1111111100000100
-
-ddinv080 invert 1000000011111111 -> 111111100000000
-ddinv081 invert 0100000101111111 -> 1011111010000000
-ddinv082 invert 0010000110111111 -> 1101111001000000
-ddinv083 invert 0001000111011111 -> 1110111000100000
-ddinv084 invert 0000100111101111 -> 1111011000010000
-ddinv085 invert 0000010111110111 -> 1111101000001000
-ddinv086 invert 0000001111111011 -> 1111110000000100
-ddinv087 invert 0000010111111101 -> 1111101000000010
-ddinv088 invert 0000100111111110 -> 1111011000000001
-ddinv089 invert 0001000011111011 -> 1110111100000100
-ddinv090 invert 0010000101111101 -> 1101111010000010
-ddinv091 invert 0100000110111110 -> 1011111001000001
-ddinv092 invert 1000000111011101 -> 111111000100010
-ddinv093 invert 0100000111101011 -> 1011111000010100
-ddinv094 invert 0010000111110111 -> 1101111000001000
-ddinv095 invert 0001000111101011 -> 1110111000010100
-ddinv096 invert 0000100111011101 -> 1111011000100010
-ddinv097 invert 0000010110111110 -> 1111101001000001
-ddinv098 invert 0000001101111101 -> 1111110010000010
-ddinv099 invert 0000010011111011 -> 1111101100000100
-
--- non-0/1 should not be accepted, nor should signs
-ddinv220 invert 111111112 -> NaN Invalid_operation
-ddinv221 invert 333333333 -> NaN Invalid_operation
-ddinv222 invert 555555555 -> NaN Invalid_operation
-ddinv223 invert 777777777 -> NaN Invalid_operation
-ddinv224 invert 999999999 -> NaN Invalid_operation
-ddinv225 invert 222222222 -> NaN Invalid_operation
-ddinv226 invert 444444444 -> NaN Invalid_operation
-ddinv227 invert 666666666 -> NaN Invalid_operation
-ddinv228 invert 888888888 -> NaN Invalid_operation
-ddinv229 invert 999999999 -> NaN Invalid_operation
-ddinv230 invert 999999999 -> NaN Invalid_operation
-ddinv231 invert 999999999 -> NaN Invalid_operation
-ddinv232 invert 999999999 -> NaN Invalid_operation
--- a few randoms
-ddinv240 invert 567468689 -> NaN Invalid_operation
-ddinv241 invert 567367689 -> NaN Invalid_operation
-ddinv242 invert -631917772 -> NaN Invalid_operation
-ddinv243 invert -756253257 -> NaN Invalid_operation
-ddinv244 invert 835590149 -> NaN Invalid_operation
--- test MSD
-ddinv250 invert 2000000000000000 -> NaN Invalid_operation
-ddinv251 invert 3000000000000000 -> NaN Invalid_operation
-ddinv252 invert 4000000000000000 -> NaN Invalid_operation
-ddinv253 invert 5000000000000000 -> NaN Invalid_operation
-ddinv254 invert 6000000000000000 -> NaN Invalid_operation
-ddinv255 invert 7000000000000000 -> NaN Invalid_operation
-ddinv256 invert 8000000000000000 -> NaN Invalid_operation
-ddinv257 invert 9000000000000000 -> NaN Invalid_operation
--- test MSD-1
-ddinv270 invert 0200001000000000 -> NaN Invalid_operation
-ddinv271 invert 0300000100000000 -> NaN Invalid_operation
-ddinv272 invert 0400000010000000 -> NaN Invalid_operation
-ddinv273 invert 0500000001000000 -> NaN Invalid_operation
-ddinv274 invert 1600000000100000 -> NaN Invalid_operation
-ddinv275 invert 1700000000010000 -> NaN Invalid_operation
-ddinv276 invert 1800000000001000 -> NaN Invalid_operation
-ddinv277 invert 1900000000000100 -> NaN Invalid_operation
--- test LSD
-ddinv280 invert 0010000000000002 -> NaN Invalid_operation
-ddinv281 invert 0001000000000003 -> NaN Invalid_operation
-ddinv282 invert 0000100000000004 -> NaN Invalid_operation
-ddinv283 invert 0000010000000005 -> NaN Invalid_operation
-ddinv284 invert 1000001000000006 -> NaN Invalid_operation
-ddinv285 invert 1000000100000007 -> NaN Invalid_operation
-ddinv286 invert 1000000010000008 -> NaN Invalid_operation
-ddinv287 invert 1000000001000009 -> NaN Invalid_operation
--- test Middie
-ddinv288 invert 0010000020000000 -> NaN Invalid_operation
-ddinv289 invert 0001000030000001 -> NaN Invalid_operation
-ddinv290 invert 0000100040000010 -> NaN Invalid_operation
-ddinv291 invert 0000010050000100 -> NaN Invalid_operation
-ddinv292 invert 1000001060001000 -> NaN Invalid_operation
-ddinv293 invert 1000000170010000 -> NaN Invalid_operation
-ddinv294 invert 1000000080100000 -> NaN Invalid_operation
-ddinv295 invert 1000000091000000 -> NaN Invalid_operation
--- sign
-ddinv296 invert -1000000001000000 -> NaN Invalid_operation
-ddinv299 invert 1000000001000000 -> 111111110111111
-
-
--- Nmax, Nmin, Ntiny-like
-ddinv341 invert 9.99999999E+299 -> NaN Invalid_operation
-ddinv342 invert 1E-299 -> NaN Invalid_operation
-ddinv343 invert 1.00000000E-299 -> NaN Invalid_operation
-ddinv344 invert 1E-207 -> NaN Invalid_operation
-ddinv345 invert -1E-207 -> NaN Invalid_operation
-ddinv346 invert -1.00000000E-299 -> NaN Invalid_operation
-ddinv347 invert -1E-299 -> NaN Invalid_operation
-ddinv348 invert -9.99999999E+299 -> NaN Invalid_operation
-
--- A few other non-integers
-ddinv361 invert 1.0 -> NaN Invalid_operation
-ddinv362 invert 1E+1 -> NaN Invalid_operation
-ddinv363 invert 0.0 -> NaN Invalid_operation
-ddinv364 invert 0E+1 -> NaN Invalid_operation
-ddinv365 invert 9.9 -> NaN Invalid_operation
-ddinv366 invert 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-ddinv788 invert -Inf -> NaN Invalid_operation
-ddinv794 invert Inf -> NaN Invalid_operation
-ddinv821 invert NaN -> NaN Invalid_operation
-ddinv841 invert sNaN -> NaN Invalid_operation
--- propagating NaNs
-ddinv861 invert NaN1 -> NaN Invalid_operation
-ddinv862 invert +NaN2 -> NaN Invalid_operation
-ddinv863 invert NaN3 -> NaN Invalid_operation
-ddinv864 invert NaN4 -> NaN Invalid_operation
-ddinv865 invert NaN5 -> NaN Invalid_operation
-ddinv871 invert sNaN11 -> NaN Invalid_operation
-ddinv872 invert sNaN12 -> NaN Invalid_operation
-ddinv873 invert sNaN13 -> NaN Invalid_operation
-ddinv874 invert sNaN14 -> NaN Invalid_operation
-ddinv875 invert sNaN15 -> NaN Invalid_operation
-ddinv876 invert NaN16 -> NaN Invalid_operation
-ddinv881 invert +NaN25 -> NaN Invalid_operation
-ddinv882 invert -NaN26 -> NaN Invalid_operation
-ddinv883 invert -sNaN27 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddInvert.decTest -- digitwise logical INVERT for decDoubles --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check (truth table)
+ddinv001 invert 0 -> 1111111111111111
+ddinv002 invert 1 -> 1111111111111110
+ddinv003 invert 10 -> 1111111111111101
+ddinv004 invert 111111111 -> 1111111000000000
+ddinv005 invert 000000000 -> 1111111111111111
+-- and at msd and msd-1
+ddinv007 invert 0000000000000000 -> 1111111111111111
+ddinv008 invert 1000000000000000 -> 111111111111111
+ddinv009 invert 0000000000000000 -> 1111111111111111
+ddinv010 invert 0100000000000000 -> 1011111111111111
+ddinv011 invert 0111111111111111 -> 1000000000000000
+ddinv012 invert 1111111111111111 -> 0
+ddinv013 invert 0011111111111111 -> 1100000000000000
+ddinv014 invert 0111111111111111 -> 1000000000000000
+
+-- Various lengths
+-- 123456789 1234567890123456
+ddinv021 invert 111111111 -> 1111111000000000
+ddinv022 invert 111111111111 -> 1111000000000000
+ddinv023 invert 11111111 -> 1111111100000000
+ddinv025 invert 1111111 -> 1111111110000000
+ddinv026 invert 111111 -> 1111111111000000
+ddinv027 invert 11111 -> 1111111111100000
+ddinv028 invert 1111 -> 1111111111110000
+ddinv029 invert 111 -> 1111111111111000
+ddinv031 invert 11 -> 1111111111111100
+ddinv032 invert 1 -> 1111111111111110
+ddinv033 invert 111111111111 -> 1111000000000000
+ddinv034 invert 11111111111 -> 1111100000000000
+ddinv035 invert 1111111111 -> 1111110000000000
+ddinv036 invert 111111111 -> 1111111000000000
+
+ddinv040 invert 011111111 -> 1111111100000000
+ddinv041 invert 101111111 -> 1111111010000000
+ddinv042 invert 110111111 -> 1111111001000000
+ddinv043 invert 111011111 -> 1111111000100000
+ddinv044 invert 111101111 -> 1111111000010000
+ddinv045 invert 111110111 -> 1111111000001000
+ddinv046 invert 111111011 -> 1111111000000100
+ddinv047 invert 111111101 -> 1111111000000010
+ddinv048 invert 111111110 -> 1111111000000001
+ddinv049 invert 011111011 -> 1111111100000100
+ddinv050 invert 101111101 -> 1111111010000010
+ddinv051 invert 110111110 -> 1111111001000001
+ddinv052 invert 111011101 -> 1111111000100010
+ddinv053 invert 111101011 -> 1111111000010100
+ddinv054 invert 111110111 -> 1111111000001000
+ddinv055 invert 111101011 -> 1111111000010100
+ddinv056 invert 111011101 -> 1111111000100010
+ddinv057 invert 110111110 -> 1111111001000001
+ddinv058 invert 101111101 -> 1111111010000010
+ddinv059 invert 011111011 -> 1111111100000100
+
+ddinv080 invert 1000000011111111 -> 111111100000000
+ddinv081 invert 0100000101111111 -> 1011111010000000
+ddinv082 invert 0010000110111111 -> 1101111001000000
+ddinv083 invert 0001000111011111 -> 1110111000100000
+ddinv084 invert 0000100111101111 -> 1111011000010000
+ddinv085 invert 0000010111110111 -> 1111101000001000
+ddinv086 invert 0000001111111011 -> 1111110000000100
+ddinv087 invert 0000010111111101 -> 1111101000000010
+ddinv088 invert 0000100111111110 -> 1111011000000001
+ddinv089 invert 0001000011111011 -> 1110111100000100
+ddinv090 invert 0010000101111101 -> 1101111010000010
+ddinv091 invert 0100000110111110 -> 1011111001000001
+ddinv092 invert 1000000111011101 -> 111111000100010
+ddinv093 invert 0100000111101011 -> 1011111000010100
+ddinv094 invert 0010000111110111 -> 1101111000001000
+ddinv095 invert 0001000111101011 -> 1110111000010100
+ddinv096 invert 0000100111011101 -> 1111011000100010
+ddinv097 invert 0000010110111110 -> 1111101001000001
+ddinv098 invert 0000001101111101 -> 1111110010000010
+ddinv099 invert 0000010011111011 -> 1111101100000100
+
+-- non-0/1 should not be accepted, nor should signs
+ddinv220 invert 111111112 -> NaN Invalid_operation
+ddinv221 invert 333333333 -> NaN Invalid_operation
+ddinv222 invert 555555555 -> NaN Invalid_operation
+ddinv223 invert 777777777 -> NaN Invalid_operation
+ddinv224 invert 999999999 -> NaN Invalid_operation
+ddinv225 invert 222222222 -> NaN Invalid_operation
+ddinv226 invert 444444444 -> NaN Invalid_operation
+ddinv227 invert 666666666 -> NaN Invalid_operation
+ddinv228 invert 888888888 -> NaN Invalid_operation
+ddinv229 invert 999999999 -> NaN Invalid_operation
+ddinv230 invert 999999999 -> NaN Invalid_operation
+ddinv231 invert 999999999 -> NaN Invalid_operation
+ddinv232 invert 999999999 -> NaN Invalid_operation
+-- a few randoms
+ddinv240 invert 567468689 -> NaN Invalid_operation
+ddinv241 invert 567367689 -> NaN Invalid_operation
+ddinv242 invert -631917772 -> NaN Invalid_operation
+ddinv243 invert -756253257 -> NaN Invalid_operation
+ddinv244 invert 835590149 -> NaN Invalid_operation
+-- test MSD
+ddinv250 invert 2000000000000000 -> NaN Invalid_operation
+ddinv251 invert 3000000000000000 -> NaN Invalid_operation
+ddinv252 invert 4000000000000000 -> NaN Invalid_operation
+ddinv253 invert 5000000000000000 -> NaN Invalid_operation
+ddinv254 invert 6000000000000000 -> NaN Invalid_operation
+ddinv255 invert 7000000000000000 -> NaN Invalid_operation
+ddinv256 invert 8000000000000000 -> NaN Invalid_operation
+ddinv257 invert 9000000000000000 -> NaN Invalid_operation
+-- test MSD-1
+ddinv270 invert 0200001000000000 -> NaN Invalid_operation
+ddinv271 invert 0300000100000000 -> NaN Invalid_operation
+ddinv272 invert 0400000010000000 -> NaN Invalid_operation
+ddinv273 invert 0500000001000000 -> NaN Invalid_operation
+ddinv274 invert 1600000000100000 -> NaN Invalid_operation
+ddinv275 invert 1700000000010000 -> NaN Invalid_operation
+ddinv276 invert 1800000000001000 -> NaN Invalid_operation
+ddinv277 invert 1900000000000100 -> NaN Invalid_operation
+-- test LSD
+ddinv280 invert 0010000000000002 -> NaN Invalid_operation
+ddinv281 invert 0001000000000003 -> NaN Invalid_operation
+ddinv282 invert 0000100000000004 -> NaN Invalid_operation
+ddinv283 invert 0000010000000005 -> NaN Invalid_operation
+ddinv284 invert 1000001000000006 -> NaN Invalid_operation
+ddinv285 invert 1000000100000007 -> NaN Invalid_operation
+ddinv286 invert 1000000010000008 -> NaN Invalid_operation
+ddinv287 invert 1000000001000009 -> NaN Invalid_operation
+-- test Middie
+ddinv288 invert 0010000020000000 -> NaN Invalid_operation
+ddinv289 invert 0001000030000001 -> NaN Invalid_operation
+ddinv290 invert 0000100040000010 -> NaN Invalid_operation
+ddinv291 invert 0000010050000100 -> NaN Invalid_operation
+ddinv292 invert 1000001060001000 -> NaN Invalid_operation
+ddinv293 invert 1000000170010000 -> NaN Invalid_operation
+ddinv294 invert 1000000080100000 -> NaN Invalid_operation
+ddinv295 invert 1000000091000000 -> NaN Invalid_operation
+-- sign
+ddinv296 invert -1000000001000000 -> NaN Invalid_operation
+ddinv299 invert 1000000001000000 -> 111111110111111
+
+
+-- Nmax, Nmin, Ntiny-like
+ddinv341 invert 9.99999999E+299 -> NaN Invalid_operation
+ddinv342 invert 1E-299 -> NaN Invalid_operation
+ddinv343 invert 1.00000000E-299 -> NaN Invalid_operation
+ddinv344 invert 1E-207 -> NaN Invalid_operation
+ddinv345 invert -1E-207 -> NaN Invalid_operation
+ddinv346 invert -1.00000000E-299 -> NaN Invalid_operation
+ddinv347 invert -1E-299 -> NaN Invalid_operation
+ddinv348 invert -9.99999999E+299 -> NaN Invalid_operation
+
+-- A few other non-integers
+ddinv361 invert 1.0 -> NaN Invalid_operation
+ddinv362 invert 1E+1 -> NaN Invalid_operation
+ddinv363 invert 0.0 -> NaN Invalid_operation
+ddinv364 invert 0E+1 -> NaN Invalid_operation
+ddinv365 invert 9.9 -> NaN Invalid_operation
+ddinv366 invert 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+ddinv788 invert -Inf -> NaN Invalid_operation
+ddinv794 invert Inf -> NaN Invalid_operation
+ddinv821 invert NaN -> NaN Invalid_operation
+ddinv841 invert sNaN -> NaN Invalid_operation
+-- propagating NaNs
+ddinv861 invert NaN1 -> NaN Invalid_operation
+ddinv862 invert +NaN2 -> NaN Invalid_operation
+ddinv863 invert NaN3 -> NaN Invalid_operation
+ddinv864 invert NaN4 -> NaN Invalid_operation
+ddinv865 invert NaN5 -> NaN Invalid_operation
+ddinv871 invert sNaN11 -> NaN Invalid_operation
+ddinv872 invert sNaN12 -> NaN Invalid_operation
+ddinv873 invert sNaN13 -> NaN Invalid_operation
+ddinv874 invert sNaN14 -> NaN Invalid_operation
+ddinv875 invert sNaN15 -> NaN Invalid_operation
+ddinv876 invert NaN16 -> NaN Invalid_operation
+ddinv881 invert +NaN25 -> NaN Invalid_operation
+ddinv882 invert -NaN26 -> NaN Invalid_operation
+ddinv883 invert -sNaN27 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddLogB.decTest b/Lib/test/decimaltestdata/ddLogB.decTest
index 00589b60c3..de728e5968 100644
--- a/Lib/test/decimaltestdata/ddLogB.decTest
+++ b/Lib/test/decimaltestdata/ddLogB.decTest
@@ -1,159 +1,159 @@
-------------------------------------------------------------------------
--- ddLogB.decTest -- integral 754r adjusted exponent, for decDoubles --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- basics
-ddlogb000 logb 0 -> -Infinity Division_by_zero
-ddlogb001 logb 1E-398 -> -398
-ddlogb002 logb 1E-383 -> -383
-ddlogb003 logb 0.001 -> -3
-ddlogb004 logb 0.03 -> -2
-ddlogb005 logb 1 -> 0
-ddlogb006 logb 2 -> 0
-ddlogb007 logb 2.5 -> 0
-ddlogb008 logb 2.500 -> 0
-ddlogb009 logb 10 -> 1
-ddlogb010 logb 70 -> 1
-ddlogb011 logb 100 -> 2
-ddlogb012 logb 333 -> 2
-ddlogb013 logb 9E+384 -> 384
-ddlogb014 logb +Infinity -> Infinity
-
--- negatives appear to be treated as positives
-ddlogb021 logb -0 -> -Infinity Division_by_zero
-ddlogb022 logb -1E-398 -> -398
-ddlogb023 logb -9E-383 -> -383
-ddlogb024 logb -0.001 -> -3
-ddlogb025 logb -1 -> 0
-ddlogb026 logb -2 -> 0
-ddlogb027 logb -10 -> 1
-ddlogb028 logb -70 -> 1
-ddlogb029 logb -100 -> 2
-ddlogb030 logb -9E+384 -> 384
-ddlogb031 logb -Infinity -> Infinity
-
--- zeros
-ddlogb111 logb 0 -> -Infinity Division_by_zero
-ddlogb112 logb -0 -> -Infinity Division_by_zero
-ddlogb113 logb 0E+4 -> -Infinity Division_by_zero
-ddlogb114 logb -0E+4 -> -Infinity Division_by_zero
-ddlogb115 logb 0.0000 -> -Infinity Division_by_zero
-ddlogb116 logb -0.0000 -> -Infinity Division_by_zero
-ddlogb117 logb 0E-141 -> -Infinity Division_by_zero
-ddlogb118 logb -0E-141 -> -Infinity Division_by_zero
-
--- full coefficients, alternating bits
-ddlogb121 logb 268268268 -> 8
-ddlogb122 logb -268268268 -> 8
-ddlogb123 logb 134134134 -> 8
-ddlogb124 logb -134134134 -> 8
-
--- Nmax, Nmin, Ntiny
-ddlogb131 logb 9.999999999999999E+384 -> 384
-ddlogb132 logb 1E-383 -> -383
-ddlogb133 logb 1.000000000000000E-383 -> -383
-ddlogb134 logb 1E-398 -> -398
-
-ddlogb135 logb -1E-398 -> -398
-ddlogb136 logb -1.000000000000000E-383 -> -383
-ddlogb137 logb -1E-383 -> -383
-ddlogb138 logb -9.999999999999999E+384 -> 384
-
--- ones
-ddlogb0061 logb 1 -> 0
-ddlogb0062 logb 1.0 -> 0
-ddlogb0063 logb 1.000000000000000 -> 0
-
--- notable cases -- exact powers of 10
-ddlogb1100 logb 1 -> 0
-ddlogb1101 logb 10 -> 1
-ddlogb1102 logb 100 -> 2
-ddlogb1103 logb 1000 -> 3
-ddlogb1104 logb 10000 -> 4
-ddlogb1105 logb 100000 -> 5
-ddlogb1106 logb 1000000 -> 6
-ddlogb1107 logb 10000000 -> 7
-ddlogb1108 logb 100000000 -> 8
-ddlogb1109 logb 1000000000 -> 9
-ddlogb1110 logb 10000000000 -> 10
-ddlogb1111 logb 100000000000 -> 11
-ddlogb1112 logb 1000000000000 -> 12
-ddlogb1113 logb 0.00000000001 -> -11
-ddlogb1114 logb 0.0000000001 -> -10
-ddlogb1115 logb 0.000000001 -> -9
-ddlogb1116 logb 0.00000001 -> -8
-ddlogb1117 logb 0.0000001 -> -7
-ddlogb1118 logb 0.000001 -> -6
-ddlogb1119 logb 0.00001 -> -5
-ddlogb1120 logb 0.0001 -> -4
-ddlogb1121 logb 0.001 -> -3
-ddlogb1122 logb 0.01 -> -2
-ddlogb1123 logb 0.1 -> -1
-ddlogb1124 logb 1E-99 -> -99
-ddlogb1125 logb 1E-100 -> -100
-ddlogb1127 logb 1E-299 -> -299
-ddlogb1126 logb 1E-383 -> -383
-
--- suggestions from Ilan Nehama
-ddlogb1400 logb 10E-3 -> -2
-ddlogb1401 logb 10E-2 -> -1
-ddlogb1402 logb 100E-2 -> 0
-ddlogb1403 logb 1000E-2 -> 1
-ddlogb1404 logb 10000E-2 -> 2
-ddlogb1405 logb 10E-1 -> 0
-ddlogb1406 logb 100E-1 -> 1
-ddlogb1407 logb 1000E-1 -> 2
-ddlogb1408 logb 10000E-1 -> 3
-ddlogb1409 logb 10E0 -> 1
-ddlogb1410 logb 100E0 -> 2
-ddlogb1411 logb 1000E0 -> 3
-ddlogb1412 logb 10000E0 -> 4
-ddlogb1413 logb 10E1 -> 2
-ddlogb1414 logb 100E1 -> 3
-ddlogb1415 logb 1000E1 -> 4
-ddlogb1416 logb 10000E1 -> 5
-ddlogb1417 logb 10E2 -> 3
-ddlogb1418 logb 100E2 -> 4
-ddlogb1419 logb 1000E2 -> 5
-ddlogb1420 logb 10000E2 -> 6
-
--- special values
-ddlogb820 logb Infinity -> Infinity
-ddlogb821 logb 0 -> -Infinity Division_by_zero
-ddlogb822 logb NaN -> NaN
-ddlogb823 logb sNaN -> NaN Invalid_operation
--- propagating NaNs
-ddlogb824 logb sNaN123 -> NaN123 Invalid_operation
-ddlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
-ddlogb826 logb NaN456 -> NaN456
-ddlogb827 logb -NaN654 -> -NaN654
-ddlogb828 logb NaN1 -> NaN1
-
--- Null test
-ddlogb900 logb # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- ddLogB.decTest -- integral 754r adjusted exponent, for decDoubles --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- basics
+ddlogb000 logb 0 -> -Infinity Division_by_zero
+ddlogb001 logb 1E-398 -> -398
+ddlogb002 logb 1E-383 -> -383
+ddlogb003 logb 0.001 -> -3
+ddlogb004 logb 0.03 -> -2
+ddlogb005 logb 1 -> 0
+ddlogb006 logb 2 -> 0
+ddlogb007 logb 2.5 -> 0
+ddlogb008 logb 2.500 -> 0
+ddlogb009 logb 10 -> 1
+ddlogb010 logb 70 -> 1
+ddlogb011 logb 100 -> 2
+ddlogb012 logb 333 -> 2
+ddlogb013 logb 9E+384 -> 384
+ddlogb014 logb +Infinity -> Infinity
+
+-- negatives appear to be treated as positives
+ddlogb021 logb -0 -> -Infinity Division_by_zero
+ddlogb022 logb -1E-398 -> -398
+ddlogb023 logb -9E-383 -> -383
+ddlogb024 logb -0.001 -> -3
+ddlogb025 logb -1 -> 0
+ddlogb026 logb -2 -> 0
+ddlogb027 logb -10 -> 1
+ddlogb028 logb -70 -> 1
+ddlogb029 logb -100 -> 2
+ddlogb030 logb -9E+384 -> 384
+ddlogb031 logb -Infinity -> Infinity
+
+-- zeros
+ddlogb111 logb 0 -> -Infinity Division_by_zero
+ddlogb112 logb -0 -> -Infinity Division_by_zero
+ddlogb113 logb 0E+4 -> -Infinity Division_by_zero
+ddlogb114 logb -0E+4 -> -Infinity Division_by_zero
+ddlogb115 logb 0.0000 -> -Infinity Division_by_zero
+ddlogb116 logb -0.0000 -> -Infinity Division_by_zero
+ddlogb117 logb 0E-141 -> -Infinity Division_by_zero
+ddlogb118 logb -0E-141 -> -Infinity Division_by_zero
+
+-- full coefficients, alternating bits
+ddlogb121 logb 268268268 -> 8
+ddlogb122 logb -268268268 -> 8
+ddlogb123 logb 134134134 -> 8
+ddlogb124 logb -134134134 -> 8
+
+-- Nmax, Nmin, Ntiny
+ddlogb131 logb 9.999999999999999E+384 -> 384
+ddlogb132 logb 1E-383 -> -383
+ddlogb133 logb 1.000000000000000E-383 -> -383
+ddlogb134 logb 1E-398 -> -398
+
+ddlogb135 logb -1E-398 -> -398
+ddlogb136 logb -1.000000000000000E-383 -> -383
+ddlogb137 logb -1E-383 -> -383
+ddlogb138 logb -9.999999999999999E+384 -> 384
+
+-- ones
+ddlogb0061 logb 1 -> 0
+ddlogb0062 logb 1.0 -> 0
+ddlogb0063 logb 1.000000000000000 -> 0
+
+-- notable cases -- exact powers of 10
+ddlogb1100 logb 1 -> 0
+ddlogb1101 logb 10 -> 1
+ddlogb1102 logb 100 -> 2
+ddlogb1103 logb 1000 -> 3
+ddlogb1104 logb 10000 -> 4
+ddlogb1105 logb 100000 -> 5
+ddlogb1106 logb 1000000 -> 6
+ddlogb1107 logb 10000000 -> 7
+ddlogb1108 logb 100000000 -> 8
+ddlogb1109 logb 1000000000 -> 9
+ddlogb1110 logb 10000000000 -> 10
+ddlogb1111 logb 100000000000 -> 11
+ddlogb1112 logb 1000000000000 -> 12
+ddlogb1113 logb 0.00000000001 -> -11
+ddlogb1114 logb 0.0000000001 -> -10
+ddlogb1115 logb 0.000000001 -> -9
+ddlogb1116 logb 0.00000001 -> -8
+ddlogb1117 logb 0.0000001 -> -7
+ddlogb1118 logb 0.000001 -> -6
+ddlogb1119 logb 0.00001 -> -5
+ddlogb1120 logb 0.0001 -> -4
+ddlogb1121 logb 0.001 -> -3
+ddlogb1122 logb 0.01 -> -2
+ddlogb1123 logb 0.1 -> -1
+ddlogb1124 logb 1E-99 -> -99
+ddlogb1125 logb 1E-100 -> -100
+ddlogb1127 logb 1E-299 -> -299
+ddlogb1126 logb 1E-383 -> -383
+
+-- suggestions from Ilan Nehama
+ddlogb1400 logb 10E-3 -> -2
+ddlogb1401 logb 10E-2 -> -1
+ddlogb1402 logb 100E-2 -> 0
+ddlogb1403 logb 1000E-2 -> 1
+ddlogb1404 logb 10000E-2 -> 2
+ddlogb1405 logb 10E-1 -> 0
+ddlogb1406 logb 100E-1 -> 1
+ddlogb1407 logb 1000E-1 -> 2
+ddlogb1408 logb 10000E-1 -> 3
+ddlogb1409 logb 10E0 -> 1
+ddlogb1410 logb 100E0 -> 2
+ddlogb1411 logb 1000E0 -> 3
+ddlogb1412 logb 10000E0 -> 4
+ddlogb1413 logb 10E1 -> 2
+ddlogb1414 logb 100E1 -> 3
+ddlogb1415 logb 1000E1 -> 4
+ddlogb1416 logb 10000E1 -> 5
+ddlogb1417 logb 10E2 -> 3
+ddlogb1418 logb 100E2 -> 4
+ddlogb1419 logb 1000E2 -> 5
+ddlogb1420 logb 10000E2 -> 6
+
+-- special values
+ddlogb820 logb Infinity -> Infinity
+ddlogb821 logb 0 -> -Infinity Division_by_zero
+ddlogb822 logb NaN -> NaN
+ddlogb823 logb sNaN -> NaN Invalid_operation
+-- propagating NaNs
+ddlogb824 logb sNaN123 -> NaN123 Invalid_operation
+ddlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
+ddlogb826 logb NaN456 -> NaN456
+ddlogb827 logb -NaN654 -> -NaN654
+ddlogb828 logb NaN1 -> NaN1
+
+-- Null test
+ddlogb900 logb # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/ddMax.decTest b/Lib/test/decimaltestdata/ddMax.decTest
index 45ea9b4c93..1ac63958b8 100644
--- a/Lib/test/decimaltestdata/ddMax.decTest
+++ b/Lib/test/decimaltestdata/ddMax.decTest
@@ -1,322 +1,322 @@
-------------------------------------------------------------------------
--- ddMax.decTest -- decDouble maxnum --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmax001 max -2 -2 -> -2
-ddmax002 max -2 -1 -> -1
-ddmax003 max -2 0 -> 0
-ddmax004 max -2 1 -> 1
-ddmax005 max -2 2 -> 2
-ddmax006 max -1 -2 -> -1
-ddmax007 max -1 -1 -> -1
-ddmax008 max -1 0 -> 0
-ddmax009 max -1 1 -> 1
-ddmax010 max -1 2 -> 2
-ddmax011 max 0 -2 -> 0
-ddmax012 max 0 -1 -> 0
-ddmax013 max 0 0 -> 0
-ddmax014 max 0 1 -> 1
-ddmax015 max 0 2 -> 2
-ddmax016 max 1 -2 -> 1
-ddmax017 max 1 -1 -> 1
-ddmax018 max 1 0 -> 1
-ddmax019 max 1 1 -> 1
-ddmax020 max 1 2 -> 2
-ddmax021 max 2 -2 -> 2
-ddmax022 max 2 -1 -> 2
-ddmax023 max 2 0 -> 2
-ddmax025 max 2 1 -> 2
-ddmax026 max 2 2 -> 2
-
--- extended zeros
-ddmax030 max 0 0 -> 0
-ddmax031 max 0 -0 -> 0
-ddmax032 max 0 -0.0 -> 0
-ddmax033 max 0 0.0 -> 0
-ddmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-ddmax035 max -0 -0 -> -0
-ddmax036 max -0 -0.0 -> -0.0
-ddmax037 max -0 0.0 -> 0.0
-ddmax038 max 0.0 0 -> 0
-ddmax039 max 0.0 -0 -> 0.0
-ddmax040 max 0.0 -0.0 -> 0.0
-ddmax041 max 0.0 0.0 -> 0.0
-ddmax042 max -0.0 0 -> 0
-ddmax043 max -0.0 -0 -> -0.0
-ddmax044 max -0.0 -0.0 -> -0.0
-ddmax045 max -0.0 0.0 -> 0.0
-
-ddmax050 max -0E1 0E1 -> 0E+1
-ddmax051 max -0E2 0E2 -> 0E+2
-ddmax052 max -0E2 0E1 -> 0E+1
-ddmax053 max -0E1 0E2 -> 0E+2
-ddmax054 max 0E1 -0E1 -> 0E+1
-ddmax055 max 0E2 -0E2 -> 0E+2
-ddmax056 max 0E2 -0E1 -> 0E+2
-ddmax057 max 0E1 -0E2 -> 0E+1
-
-ddmax058 max 0E1 0E1 -> 0E+1
-ddmax059 max 0E2 0E2 -> 0E+2
-ddmax060 max 0E2 0E1 -> 0E+2
-ddmax061 max 0E1 0E2 -> 0E+2
-ddmax062 max -0E1 -0E1 -> -0E+1
-ddmax063 max -0E2 -0E2 -> -0E+2
-ddmax064 max -0E2 -0E1 -> -0E+1
-ddmax065 max -0E1 -0E2 -> -0E+1
-
--- Specials
-ddmax090 max Inf -Inf -> Infinity
-ddmax091 max Inf -1000 -> Infinity
-ddmax092 max Inf -1 -> Infinity
-ddmax093 max Inf -0 -> Infinity
-ddmax094 max Inf 0 -> Infinity
-ddmax095 max Inf 1 -> Infinity
-ddmax096 max Inf 1000 -> Infinity
-ddmax097 max Inf Inf -> Infinity
-ddmax098 max -1000 Inf -> Infinity
-ddmax099 max -Inf Inf -> Infinity
-ddmax100 max -1 Inf -> Infinity
-ddmax101 max -0 Inf -> Infinity
-ddmax102 max 0 Inf -> Infinity
-ddmax103 max 1 Inf -> Infinity
-ddmax104 max 1000 Inf -> Infinity
-ddmax105 max Inf Inf -> Infinity
-
-ddmax120 max -Inf -Inf -> -Infinity
-ddmax121 max -Inf -1000 -> -1000
-ddmax122 max -Inf -1 -> -1
-ddmax123 max -Inf -0 -> -0
-ddmax124 max -Inf 0 -> 0
-ddmax125 max -Inf 1 -> 1
-ddmax126 max -Inf 1000 -> 1000
-ddmax127 max -Inf Inf -> Infinity
-ddmax128 max -Inf -Inf -> -Infinity
-ddmax129 max -1000 -Inf -> -1000
-ddmax130 max -1 -Inf -> -1
-ddmax131 max -0 -Inf -> -0
-ddmax132 max 0 -Inf -> 0
-ddmax133 max 1 -Inf -> 1
-ddmax134 max 1000 -Inf -> 1000
-ddmax135 max Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-ddmax141 max NaN -Inf -> -Infinity
-ddmax142 max NaN -1000 -> -1000
-ddmax143 max NaN -1 -> -1
-ddmax144 max NaN -0 -> -0
-ddmax145 max NaN 0 -> 0
-ddmax146 max NaN 1 -> 1
-ddmax147 max NaN 1000 -> 1000
-ddmax148 max NaN Inf -> Infinity
-ddmax149 max NaN NaN -> NaN
-ddmax150 max -Inf NaN -> -Infinity
-ddmax151 max -1000 NaN -> -1000
-ddmax152 max -1 NaN -> -1
-ddmax153 max -0 NaN -> -0
-ddmax154 max 0 NaN -> 0
-ddmax155 max 1 NaN -> 1
-ddmax156 max 1000 NaN -> 1000
-ddmax157 max Inf NaN -> Infinity
-
-ddmax161 max sNaN -Inf -> NaN Invalid_operation
-ddmax162 max sNaN -1000 -> NaN Invalid_operation
-ddmax163 max sNaN -1 -> NaN Invalid_operation
-ddmax164 max sNaN -0 -> NaN Invalid_operation
-ddmax165 max sNaN 0 -> NaN Invalid_operation
-ddmax166 max sNaN 1 -> NaN Invalid_operation
-ddmax167 max sNaN 1000 -> NaN Invalid_operation
-ddmax168 max sNaN NaN -> NaN Invalid_operation
-ddmax169 max sNaN sNaN -> NaN Invalid_operation
-ddmax170 max NaN sNaN -> NaN Invalid_operation
-ddmax171 max -Inf sNaN -> NaN Invalid_operation
-ddmax172 max -1000 sNaN -> NaN Invalid_operation
-ddmax173 max -1 sNaN -> NaN Invalid_operation
-ddmax174 max -0 sNaN -> NaN Invalid_operation
-ddmax175 max 0 sNaN -> NaN Invalid_operation
-ddmax176 max 1 sNaN -> NaN Invalid_operation
-ddmax177 max 1000 sNaN -> NaN Invalid_operation
-ddmax178 max Inf sNaN -> NaN Invalid_operation
-ddmax179 max NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmax181 max NaN9 -Inf -> -Infinity
-ddmax182 max NaN8 9 -> 9
-ddmax183 max -NaN7 Inf -> Infinity
-
-ddmax184 max -NaN1 NaN11 -> -NaN1
-ddmax185 max NaN2 NaN12 -> NaN2
-ddmax186 max -NaN13 -NaN7 -> -NaN13
-ddmax187 max NaN14 -NaN5 -> NaN14
-
-ddmax188 max -Inf NaN4 -> -Infinity
-ddmax189 max -9 -NaN3 -> -9
-ddmax190 max Inf NaN2 -> Infinity
-
-ddmax191 max sNaN99 -Inf -> NaN99 Invalid_operation
-ddmax192 max sNaN98 -1 -> NaN98 Invalid_operation
-ddmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation
-ddmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
-ddmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmax196 max -Inf sNaN92 -> NaN92 Invalid_operation
-ddmax197 max 0 sNaN91 -> NaN91 Invalid_operation
-ddmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmax199 max NaN sNaN89 -> NaN89 Invalid_operation
-
--- old rounding checks
-ddmax221 max 12345678000 1 -> 12345678000
-ddmax222 max 1 12345678000 -> 12345678000
-ddmax223 max 1234567800 1 -> 1234567800
-ddmax224 max 1 1234567800 -> 1234567800
-ddmax225 max 1234567890 1 -> 1234567890
-ddmax226 max 1 1234567890 -> 1234567890
-ddmax227 max 1234567891 1 -> 1234567891
-ddmax228 max 1 1234567891 -> 1234567891
-ddmax229 max 12345678901 1 -> 12345678901
-ddmax230 max 1 12345678901 -> 12345678901
-ddmax231 max 1234567896 1 -> 1234567896
-ddmax232 max 1 1234567896 -> 1234567896
-ddmax233 max -1234567891 1 -> 1
-ddmax234 max 1 -1234567891 -> 1
-ddmax235 max -12345678901 1 -> 1
-ddmax236 max 1 -12345678901 -> 1
-ddmax237 max -1234567896 1 -> 1
-ddmax238 max 1 -1234567896 -> 1
-
--- from examples
-ddmax280 max '3' '2' -> '3'
-ddmax281 max '-10' '3' -> '3'
-ddmax282 max '1.0' '1' -> '1'
-ddmax283 max '1' '1.0' -> '1'
-ddmax284 max '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-ddmax401 max Inf 1.1 -> Infinity
-ddmax402 max 1.1 1 -> 1.1
-ddmax403 max 1 1.0 -> 1
-ddmax404 max 1.0 0.1 -> 1.0
-ddmax405 max 0.1 0.10 -> 0.1
-ddmax406 max 0.10 0.100 -> 0.10
-ddmax407 max 0.10 0 -> 0.10
-ddmax408 max 0 0.0 -> 0
-ddmax409 max 0.0 -0 -> 0.0
-ddmax410 max 0.0 -0.0 -> 0.0
-ddmax411 max 0.00 -0.0 -> 0.00
-ddmax412 max 0.0 -0.00 -> 0.0
-ddmax413 max 0 -0.0 -> 0
-ddmax414 max 0 -0 -> 0
-ddmax415 max -0.0 -0 -> -0.0
-ddmax416 max -0 -0.100 -> -0
-ddmax417 max -0.100 -0.10 -> -0.100
-ddmax418 max -0.10 -0.1 -> -0.10
-ddmax419 max -0.1 -1.0 -> -0.1
-ddmax420 max -1.0 -1 -> -1.0
-ddmax421 max -1 -1.1 -> -1
-ddmax423 max -1.1 -Inf -> -1.1
--- same with operands reversed
-ddmax431 max 1.1 Inf -> Infinity
-ddmax432 max 1 1.1 -> 1.1
-ddmax433 max 1.0 1 -> 1
-ddmax434 max 0.1 1.0 -> 1.0
-ddmax435 max 0.10 0.1 -> 0.1
-ddmax436 max 0.100 0.10 -> 0.10
-ddmax437 max 0 0.10 -> 0.10
-ddmax438 max 0.0 0 -> 0
-ddmax439 max -0 0.0 -> 0.0
-ddmax440 max -0.0 0.0 -> 0.0
-ddmax441 max -0.0 0.00 -> 0.00
-ddmax442 max -0.00 0.0 -> 0.0
-ddmax443 max -0.0 0 -> 0
-ddmax444 max -0 0 -> 0
-ddmax445 max -0 -0.0 -> -0.0
-ddmax446 max -0.100 -0 -> -0
-ddmax447 max -0.10 -0.100 -> -0.100
-ddmax448 max -0.1 -0.10 -> -0.10
-ddmax449 max -1.0 -0.1 -> -0.1
-ddmax450 max -1 -1.0 -> -1.0
-ddmax451 max -1.1 -1 -> -1
-ddmax453 max -Inf -1.1 -> -1.1
--- largies
-ddmax460 max 1000 1E+3 -> 1E+3
-ddmax461 max 1E+3 1000 -> 1E+3
-ddmax462 max 1000 -1E+3 -> 1000
-ddmax463 max 1E+3 -1000 -> 1E+3
-ddmax464 max -1000 1E+3 -> 1E+3
-ddmax465 max -1E+3 1000 -> 1000
-ddmax466 max -1000 -1E+3 -> -1000
-ddmax467 max -1E+3 -1000 -> -1000
-
--- misalignment traps for little-endian
-ddmax471 max 1.0 0.1 -> 1.0
-ddmax472 max 0.1 1.0 -> 1.0
-ddmax473 max 10.0 0.1 -> 10.0
-ddmax474 max 0.1 10.0 -> 10.0
-ddmax475 max 100 1.0 -> 100
-ddmax476 max 1.0 100 -> 100
-ddmax477 max 1000 10.0 -> 1000
-ddmax478 max 10.0 1000 -> 1000
-ddmax479 max 10000 100.0 -> 10000
-ddmax480 max 100.0 10000 -> 10000
-ddmax481 max 100000 1000.0 -> 100000
-ddmax482 max 1000.0 100000 -> 100000
-ddmax483 max 1000000 10000.0 -> 1000000
-ddmax484 max 10000.0 1000000 -> 1000000
-
--- subnormals
-ddmax510 max 1.00E-383 0 -> 1.00E-383
-ddmax511 max 0.1E-383 0 -> 1E-384 Subnormal
-ddmax512 max 0.10E-383 0 -> 1.0E-384 Subnormal
-ddmax513 max 0.100E-383 0 -> 1.00E-384 Subnormal
-ddmax514 max 0.01E-383 0 -> 1E-385 Subnormal
-ddmax515 max 0.999E-383 0 -> 9.99E-384 Subnormal
-ddmax516 max 0.099E-383 0 -> 9.9E-385 Subnormal
-ddmax517 max 0.009E-383 0 -> 9E-386 Subnormal
-ddmax518 max 0.001E-383 0 -> 1E-386 Subnormal
-ddmax519 max 0.0009E-383 0 -> 9E-387 Subnormal
-ddmax520 max 0.0001E-383 0 -> 1E-387 Subnormal
-
-ddmax530 max -1.00E-383 0 -> 0
-ddmax531 max -0.1E-383 0 -> 0
-ddmax532 max -0.10E-383 0 -> 0
-ddmax533 max -0.100E-383 0 -> 0
-ddmax534 max -0.01E-383 0 -> 0
-ddmax535 max -0.999E-383 0 -> 0
-ddmax536 max -0.099E-383 0 -> 0
-ddmax537 max -0.009E-383 0 -> 0
-ddmax538 max -0.001E-383 0 -> 0
-ddmax539 max -0.0009E-383 0 -> 0
-ddmax540 max -0.0001E-383 0 -> 0
-
--- Null tests
-ddmax900 max 10 # -> NaN Invalid_operation
-ddmax901 max # 10 -> NaN Invalid_operation
-
-
-
+------------------------------------------------------------------------
+-- ddMax.decTest -- decDouble maxnum --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmax001 max -2 -2 -> -2
+ddmax002 max -2 -1 -> -1
+ddmax003 max -2 0 -> 0
+ddmax004 max -2 1 -> 1
+ddmax005 max -2 2 -> 2
+ddmax006 max -1 -2 -> -1
+ddmax007 max -1 -1 -> -1
+ddmax008 max -1 0 -> 0
+ddmax009 max -1 1 -> 1
+ddmax010 max -1 2 -> 2
+ddmax011 max 0 -2 -> 0
+ddmax012 max 0 -1 -> 0
+ddmax013 max 0 0 -> 0
+ddmax014 max 0 1 -> 1
+ddmax015 max 0 2 -> 2
+ddmax016 max 1 -2 -> 1
+ddmax017 max 1 -1 -> 1
+ddmax018 max 1 0 -> 1
+ddmax019 max 1 1 -> 1
+ddmax020 max 1 2 -> 2
+ddmax021 max 2 -2 -> 2
+ddmax022 max 2 -1 -> 2
+ddmax023 max 2 0 -> 2
+ddmax025 max 2 1 -> 2
+ddmax026 max 2 2 -> 2
+
+-- extended zeros
+ddmax030 max 0 0 -> 0
+ddmax031 max 0 -0 -> 0
+ddmax032 max 0 -0.0 -> 0
+ddmax033 max 0 0.0 -> 0
+ddmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+ddmax035 max -0 -0 -> -0
+ddmax036 max -0 -0.0 -> -0.0
+ddmax037 max -0 0.0 -> 0.0
+ddmax038 max 0.0 0 -> 0
+ddmax039 max 0.0 -0 -> 0.0
+ddmax040 max 0.0 -0.0 -> 0.0
+ddmax041 max 0.0 0.0 -> 0.0
+ddmax042 max -0.0 0 -> 0
+ddmax043 max -0.0 -0 -> -0.0
+ddmax044 max -0.0 -0.0 -> -0.0
+ddmax045 max -0.0 0.0 -> 0.0
+
+ddmax050 max -0E1 0E1 -> 0E+1
+ddmax051 max -0E2 0E2 -> 0E+2
+ddmax052 max -0E2 0E1 -> 0E+1
+ddmax053 max -0E1 0E2 -> 0E+2
+ddmax054 max 0E1 -0E1 -> 0E+1
+ddmax055 max 0E2 -0E2 -> 0E+2
+ddmax056 max 0E2 -0E1 -> 0E+2
+ddmax057 max 0E1 -0E2 -> 0E+1
+
+ddmax058 max 0E1 0E1 -> 0E+1
+ddmax059 max 0E2 0E2 -> 0E+2
+ddmax060 max 0E2 0E1 -> 0E+2
+ddmax061 max 0E1 0E2 -> 0E+2
+ddmax062 max -0E1 -0E1 -> -0E+1
+ddmax063 max -0E2 -0E2 -> -0E+2
+ddmax064 max -0E2 -0E1 -> -0E+1
+ddmax065 max -0E1 -0E2 -> -0E+1
+
+-- Specials
+ddmax090 max Inf -Inf -> Infinity
+ddmax091 max Inf -1000 -> Infinity
+ddmax092 max Inf -1 -> Infinity
+ddmax093 max Inf -0 -> Infinity
+ddmax094 max Inf 0 -> Infinity
+ddmax095 max Inf 1 -> Infinity
+ddmax096 max Inf 1000 -> Infinity
+ddmax097 max Inf Inf -> Infinity
+ddmax098 max -1000 Inf -> Infinity
+ddmax099 max -Inf Inf -> Infinity
+ddmax100 max -1 Inf -> Infinity
+ddmax101 max -0 Inf -> Infinity
+ddmax102 max 0 Inf -> Infinity
+ddmax103 max 1 Inf -> Infinity
+ddmax104 max 1000 Inf -> Infinity
+ddmax105 max Inf Inf -> Infinity
+
+ddmax120 max -Inf -Inf -> -Infinity
+ddmax121 max -Inf -1000 -> -1000
+ddmax122 max -Inf -1 -> -1
+ddmax123 max -Inf -0 -> -0
+ddmax124 max -Inf 0 -> 0
+ddmax125 max -Inf 1 -> 1
+ddmax126 max -Inf 1000 -> 1000
+ddmax127 max -Inf Inf -> Infinity
+ddmax128 max -Inf -Inf -> -Infinity
+ddmax129 max -1000 -Inf -> -1000
+ddmax130 max -1 -Inf -> -1
+ddmax131 max -0 -Inf -> -0
+ddmax132 max 0 -Inf -> 0
+ddmax133 max 1 -Inf -> 1
+ddmax134 max 1000 -Inf -> 1000
+ddmax135 max Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+ddmax141 max NaN -Inf -> -Infinity
+ddmax142 max NaN -1000 -> -1000
+ddmax143 max NaN -1 -> -1
+ddmax144 max NaN -0 -> -0
+ddmax145 max NaN 0 -> 0
+ddmax146 max NaN 1 -> 1
+ddmax147 max NaN 1000 -> 1000
+ddmax148 max NaN Inf -> Infinity
+ddmax149 max NaN NaN -> NaN
+ddmax150 max -Inf NaN -> -Infinity
+ddmax151 max -1000 NaN -> -1000
+ddmax152 max -1 NaN -> -1
+ddmax153 max -0 NaN -> -0
+ddmax154 max 0 NaN -> 0
+ddmax155 max 1 NaN -> 1
+ddmax156 max 1000 NaN -> 1000
+ddmax157 max Inf NaN -> Infinity
+
+ddmax161 max sNaN -Inf -> NaN Invalid_operation
+ddmax162 max sNaN -1000 -> NaN Invalid_operation
+ddmax163 max sNaN -1 -> NaN Invalid_operation
+ddmax164 max sNaN -0 -> NaN Invalid_operation
+ddmax165 max sNaN 0 -> NaN Invalid_operation
+ddmax166 max sNaN 1 -> NaN Invalid_operation
+ddmax167 max sNaN 1000 -> NaN Invalid_operation
+ddmax168 max sNaN NaN -> NaN Invalid_operation
+ddmax169 max sNaN sNaN -> NaN Invalid_operation
+ddmax170 max NaN sNaN -> NaN Invalid_operation
+ddmax171 max -Inf sNaN -> NaN Invalid_operation
+ddmax172 max -1000 sNaN -> NaN Invalid_operation
+ddmax173 max -1 sNaN -> NaN Invalid_operation
+ddmax174 max -0 sNaN -> NaN Invalid_operation
+ddmax175 max 0 sNaN -> NaN Invalid_operation
+ddmax176 max 1 sNaN -> NaN Invalid_operation
+ddmax177 max 1000 sNaN -> NaN Invalid_operation
+ddmax178 max Inf sNaN -> NaN Invalid_operation
+ddmax179 max NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmax181 max NaN9 -Inf -> -Infinity
+ddmax182 max NaN8 9 -> 9
+ddmax183 max -NaN7 Inf -> Infinity
+
+ddmax184 max -NaN1 NaN11 -> -NaN1
+ddmax185 max NaN2 NaN12 -> NaN2
+ddmax186 max -NaN13 -NaN7 -> -NaN13
+ddmax187 max NaN14 -NaN5 -> NaN14
+
+ddmax188 max -Inf NaN4 -> -Infinity
+ddmax189 max -9 -NaN3 -> -9
+ddmax190 max Inf NaN2 -> Infinity
+
+ddmax191 max sNaN99 -Inf -> NaN99 Invalid_operation
+ddmax192 max sNaN98 -1 -> NaN98 Invalid_operation
+ddmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation
+ddmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
+ddmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmax196 max -Inf sNaN92 -> NaN92 Invalid_operation
+ddmax197 max 0 sNaN91 -> NaN91 Invalid_operation
+ddmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmax199 max NaN sNaN89 -> NaN89 Invalid_operation
+
+-- old rounding checks
+ddmax221 max 12345678000 1 -> 12345678000
+ddmax222 max 1 12345678000 -> 12345678000
+ddmax223 max 1234567800 1 -> 1234567800
+ddmax224 max 1 1234567800 -> 1234567800
+ddmax225 max 1234567890 1 -> 1234567890
+ddmax226 max 1 1234567890 -> 1234567890
+ddmax227 max 1234567891 1 -> 1234567891
+ddmax228 max 1 1234567891 -> 1234567891
+ddmax229 max 12345678901 1 -> 12345678901
+ddmax230 max 1 12345678901 -> 12345678901
+ddmax231 max 1234567896 1 -> 1234567896
+ddmax232 max 1 1234567896 -> 1234567896
+ddmax233 max -1234567891 1 -> 1
+ddmax234 max 1 -1234567891 -> 1
+ddmax235 max -12345678901 1 -> 1
+ddmax236 max 1 -12345678901 -> 1
+ddmax237 max -1234567896 1 -> 1
+ddmax238 max 1 -1234567896 -> 1
+
+-- from examples
+ddmax280 max '3' '2' -> '3'
+ddmax281 max '-10' '3' -> '3'
+ddmax282 max '1.0' '1' -> '1'
+ddmax283 max '1' '1.0' -> '1'
+ddmax284 max '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+ddmax401 max Inf 1.1 -> Infinity
+ddmax402 max 1.1 1 -> 1.1
+ddmax403 max 1 1.0 -> 1
+ddmax404 max 1.0 0.1 -> 1.0
+ddmax405 max 0.1 0.10 -> 0.1
+ddmax406 max 0.10 0.100 -> 0.10
+ddmax407 max 0.10 0 -> 0.10
+ddmax408 max 0 0.0 -> 0
+ddmax409 max 0.0 -0 -> 0.0
+ddmax410 max 0.0 -0.0 -> 0.0
+ddmax411 max 0.00 -0.0 -> 0.00
+ddmax412 max 0.0 -0.00 -> 0.0
+ddmax413 max 0 -0.0 -> 0
+ddmax414 max 0 -0 -> 0
+ddmax415 max -0.0 -0 -> -0.0
+ddmax416 max -0 -0.100 -> -0
+ddmax417 max -0.100 -0.10 -> -0.100
+ddmax418 max -0.10 -0.1 -> -0.10
+ddmax419 max -0.1 -1.0 -> -0.1
+ddmax420 max -1.0 -1 -> -1.0
+ddmax421 max -1 -1.1 -> -1
+ddmax423 max -1.1 -Inf -> -1.1
+-- same with operands reversed
+ddmax431 max 1.1 Inf -> Infinity
+ddmax432 max 1 1.1 -> 1.1
+ddmax433 max 1.0 1 -> 1
+ddmax434 max 0.1 1.0 -> 1.0
+ddmax435 max 0.10 0.1 -> 0.1
+ddmax436 max 0.100 0.10 -> 0.10
+ddmax437 max 0 0.10 -> 0.10
+ddmax438 max 0.0 0 -> 0
+ddmax439 max -0 0.0 -> 0.0
+ddmax440 max -0.0 0.0 -> 0.0
+ddmax441 max -0.0 0.00 -> 0.00
+ddmax442 max -0.00 0.0 -> 0.0
+ddmax443 max -0.0 0 -> 0
+ddmax444 max -0 0 -> 0
+ddmax445 max -0 -0.0 -> -0.0
+ddmax446 max -0.100 -0 -> -0
+ddmax447 max -0.10 -0.100 -> -0.100
+ddmax448 max -0.1 -0.10 -> -0.10
+ddmax449 max -1.0 -0.1 -> -0.1
+ddmax450 max -1 -1.0 -> -1.0
+ddmax451 max -1.1 -1 -> -1
+ddmax453 max -Inf -1.1 -> -1.1
+-- largies
+ddmax460 max 1000 1E+3 -> 1E+3
+ddmax461 max 1E+3 1000 -> 1E+3
+ddmax462 max 1000 -1E+3 -> 1000
+ddmax463 max 1E+3 -1000 -> 1E+3
+ddmax464 max -1000 1E+3 -> 1E+3
+ddmax465 max -1E+3 1000 -> 1000
+ddmax466 max -1000 -1E+3 -> -1000
+ddmax467 max -1E+3 -1000 -> -1000
+
+-- misalignment traps for little-endian
+ddmax471 max 1.0 0.1 -> 1.0
+ddmax472 max 0.1 1.0 -> 1.0
+ddmax473 max 10.0 0.1 -> 10.0
+ddmax474 max 0.1 10.0 -> 10.0
+ddmax475 max 100 1.0 -> 100
+ddmax476 max 1.0 100 -> 100
+ddmax477 max 1000 10.0 -> 1000
+ddmax478 max 10.0 1000 -> 1000
+ddmax479 max 10000 100.0 -> 10000
+ddmax480 max 100.0 10000 -> 10000
+ddmax481 max 100000 1000.0 -> 100000
+ddmax482 max 1000.0 100000 -> 100000
+ddmax483 max 1000000 10000.0 -> 1000000
+ddmax484 max 10000.0 1000000 -> 1000000
+
+-- subnormals
+ddmax510 max 1.00E-383 0 -> 1.00E-383
+ddmax511 max 0.1E-383 0 -> 1E-384 Subnormal
+ddmax512 max 0.10E-383 0 -> 1.0E-384 Subnormal
+ddmax513 max 0.100E-383 0 -> 1.00E-384 Subnormal
+ddmax514 max 0.01E-383 0 -> 1E-385 Subnormal
+ddmax515 max 0.999E-383 0 -> 9.99E-384 Subnormal
+ddmax516 max 0.099E-383 0 -> 9.9E-385 Subnormal
+ddmax517 max 0.009E-383 0 -> 9E-386 Subnormal
+ddmax518 max 0.001E-383 0 -> 1E-386 Subnormal
+ddmax519 max 0.0009E-383 0 -> 9E-387 Subnormal
+ddmax520 max 0.0001E-383 0 -> 1E-387 Subnormal
+
+ddmax530 max -1.00E-383 0 -> 0
+ddmax531 max -0.1E-383 0 -> 0
+ddmax532 max -0.10E-383 0 -> 0
+ddmax533 max -0.100E-383 0 -> 0
+ddmax534 max -0.01E-383 0 -> 0
+ddmax535 max -0.999E-383 0 -> 0
+ddmax536 max -0.099E-383 0 -> 0
+ddmax537 max -0.009E-383 0 -> 0
+ddmax538 max -0.001E-383 0 -> 0
+ddmax539 max -0.0009E-383 0 -> 0
+ddmax540 max -0.0001E-383 0 -> 0
+
+-- Null tests
+ddmax900 max 10 # -> NaN Invalid_operation
+ddmax901 max # 10 -> NaN Invalid_operation
+
+
+
diff --git a/Lib/test/decimaltestdata/ddMaxMag.decTest b/Lib/test/decimaltestdata/ddMaxMag.decTest
index ec2b830541..19c3e9085c 100644
--- a/Lib/test/decimaltestdata/ddMaxMag.decTest
+++ b/Lib/test/decimaltestdata/ddMaxMag.decTest
@@ -1,304 +1,304 @@
-------------------------------------------------------------------------
--- ddMaxMag.decTest -- decDouble maxnummag --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmxg001 maxmag -2 -2 -> -2
-ddmxg002 maxmag -2 -1 -> -2
-ddmxg003 maxmag -2 0 -> -2
-ddmxg004 maxmag -2 1 -> -2
-ddmxg005 maxmag -2 2 -> 2
-ddmxg006 maxmag -1 -2 -> -2
-ddmxg007 maxmag -1 -1 -> -1
-ddmxg008 maxmag -1 0 -> -1
-ddmxg009 maxmag -1 1 -> 1
-ddmxg010 maxmag -1 2 -> 2
-ddmxg011 maxmag 0 -2 -> -2
-ddmxg012 maxmag 0 -1 -> -1
-ddmxg013 maxmag 0 0 -> 0
-ddmxg014 maxmag 0 1 -> 1
-ddmxg015 maxmag 0 2 -> 2
-ddmxg016 maxmag 1 -2 -> -2
-ddmxg017 maxmag 1 -1 -> 1
-ddmxg018 maxmag 1 0 -> 1
-ddmxg019 maxmag 1 1 -> 1
-ddmxg020 maxmag 1 2 -> 2
-ddmxg021 maxmag 2 -2 -> 2
-ddmxg022 maxmag 2 -1 -> 2
-ddmxg023 maxmag 2 0 -> 2
-ddmxg025 maxmag 2 1 -> 2
-ddmxg026 maxmag 2 2 -> 2
-
--- extended zeros
-ddmxg030 maxmag 0 0 -> 0
-ddmxg031 maxmag 0 -0 -> 0
-ddmxg032 maxmag 0 -0.0 -> 0
-ddmxg033 maxmag 0 0.0 -> 0
-ddmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-ddmxg035 maxmag -0 -0 -> -0
-ddmxg036 maxmag -0 -0.0 -> -0.0
-ddmxg037 maxmag -0 0.0 -> 0.0
-ddmxg038 maxmag 0.0 0 -> 0
-ddmxg039 maxmag 0.0 -0 -> 0.0
-ddmxg040 maxmag 0.0 -0.0 -> 0.0
-ddmxg041 maxmag 0.0 0.0 -> 0.0
-ddmxg042 maxmag -0.0 0 -> 0
-ddmxg043 maxmag -0.0 -0 -> -0.0
-ddmxg044 maxmag -0.0 -0.0 -> -0.0
-ddmxg045 maxmag -0.0 0.0 -> 0.0
-
-ddmxg050 maxmag -0E1 0E1 -> 0E+1
-ddmxg051 maxmag -0E2 0E2 -> 0E+2
-ddmxg052 maxmag -0E2 0E1 -> 0E+1
-ddmxg053 maxmag -0E1 0E2 -> 0E+2
-ddmxg054 maxmag 0E1 -0E1 -> 0E+1
-ddmxg055 maxmag 0E2 -0E2 -> 0E+2
-ddmxg056 maxmag 0E2 -0E1 -> 0E+2
-ddmxg057 maxmag 0E1 -0E2 -> 0E+1
-
-ddmxg058 maxmag 0E1 0E1 -> 0E+1
-ddmxg059 maxmag 0E2 0E2 -> 0E+2
-ddmxg060 maxmag 0E2 0E1 -> 0E+2
-ddmxg061 maxmag 0E1 0E2 -> 0E+2
-ddmxg062 maxmag -0E1 -0E1 -> -0E+1
-ddmxg063 maxmag -0E2 -0E2 -> -0E+2
-ddmxg064 maxmag -0E2 -0E1 -> -0E+1
-ddmxg065 maxmag -0E1 -0E2 -> -0E+1
-
--- Specials
-ddmxg090 maxmag Inf -Inf -> Infinity
-ddmxg091 maxmag Inf -1000 -> Infinity
-ddmxg092 maxmag Inf -1 -> Infinity
-ddmxg093 maxmag Inf -0 -> Infinity
-ddmxg094 maxmag Inf 0 -> Infinity
-ddmxg095 maxmag Inf 1 -> Infinity
-ddmxg096 maxmag Inf 1000 -> Infinity
-ddmxg097 maxmag Inf Inf -> Infinity
-ddmxg098 maxmag -1000 Inf -> Infinity
-ddmxg099 maxmag -Inf Inf -> Infinity
-ddmxg100 maxmag -1 Inf -> Infinity
-ddmxg101 maxmag -0 Inf -> Infinity
-ddmxg102 maxmag 0 Inf -> Infinity
-ddmxg103 maxmag 1 Inf -> Infinity
-ddmxg104 maxmag 1000 Inf -> Infinity
-ddmxg105 maxmag Inf Inf -> Infinity
-
-ddmxg120 maxmag -Inf -Inf -> -Infinity
-ddmxg121 maxmag -Inf -1000 -> -Infinity
-ddmxg122 maxmag -Inf -1 -> -Infinity
-ddmxg123 maxmag -Inf -0 -> -Infinity
-ddmxg124 maxmag -Inf 0 -> -Infinity
-ddmxg125 maxmag -Inf 1 -> -Infinity
-ddmxg126 maxmag -Inf 1000 -> -Infinity
-ddmxg127 maxmag -Inf Inf -> Infinity
-ddmxg128 maxmag -Inf -Inf -> -Infinity
-ddmxg129 maxmag -1000 -Inf -> -Infinity
-ddmxg130 maxmag -1 -Inf -> -Infinity
-ddmxg131 maxmag -0 -Inf -> -Infinity
-ddmxg132 maxmag 0 -Inf -> -Infinity
-ddmxg133 maxmag 1 -Inf -> -Infinity
-ddmxg134 maxmag 1000 -Inf -> -Infinity
-ddmxg135 maxmag Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-ddmxg141 maxmag NaN -Inf -> -Infinity
-ddmxg142 maxmag NaN -1000 -> -1000
-ddmxg143 maxmag NaN -1 -> -1
-ddmxg144 maxmag NaN -0 -> -0
-ddmxg145 maxmag NaN 0 -> 0
-ddmxg146 maxmag NaN 1 -> 1
-ddmxg147 maxmag NaN 1000 -> 1000
-ddmxg148 maxmag NaN Inf -> Infinity
-ddmxg149 maxmag NaN NaN -> NaN
-ddmxg150 maxmag -Inf NaN -> -Infinity
-ddmxg151 maxmag -1000 NaN -> -1000
-ddmxg152 maxmag -1 NaN -> -1
-ddmxg153 maxmag -0 NaN -> -0
-ddmxg154 maxmag 0 NaN -> 0
-ddmxg155 maxmag 1 NaN -> 1
-ddmxg156 maxmag 1000 NaN -> 1000
-ddmxg157 maxmag Inf NaN -> Infinity
-
-ddmxg161 maxmag sNaN -Inf -> NaN Invalid_operation
-ddmxg162 maxmag sNaN -1000 -> NaN Invalid_operation
-ddmxg163 maxmag sNaN -1 -> NaN Invalid_operation
-ddmxg164 maxmag sNaN -0 -> NaN Invalid_operation
-ddmxg165 maxmag sNaN 0 -> NaN Invalid_operation
-ddmxg166 maxmag sNaN 1 -> NaN Invalid_operation
-ddmxg167 maxmag sNaN 1000 -> NaN Invalid_operation
-ddmxg168 maxmag sNaN NaN -> NaN Invalid_operation
-ddmxg169 maxmag sNaN sNaN -> NaN Invalid_operation
-ddmxg170 maxmag NaN sNaN -> NaN Invalid_operation
-ddmxg171 maxmag -Inf sNaN -> NaN Invalid_operation
-ddmxg172 maxmag -1000 sNaN -> NaN Invalid_operation
-ddmxg173 maxmag -1 sNaN -> NaN Invalid_operation
-ddmxg174 maxmag -0 sNaN -> NaN Invalid_operation
-ddmxg175 maxmag 0 sNaN -> NaN Invalid_operation
-ddmxg176 maxmag 1 sNaN -> NaN Invalid_operation
-ddmxg177 maxmag 1000 sNaN -> NaN Invalid_operation
-ddmxg178 maxmag Inf sNaN -> NaN Invalid_operation
-ddmxg179 maxmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmxg181 maxmag NaN9 -Inf -> -Infinity
-ddmxg182 maxmag NaN8 9 -> 9
-ddmxg183 maxmag -NaN7 Inf -> Infinity
-
-ddmxg184 maxmag -NaN1 NaN11 -> -NaN1
-ddmxg185 maxmag NaN2 NaN12 -> NaN2
-ddmxg186 maxmag -NaN13 -NaN7 -> -NaN13
-ddmxg187 maxmag NaN14 -NaN5 -> NaN14
-
-ddmxg188 maxmag -Inf NaN4 -> -Infinity
-ddmxg189 maxmag -9 -NaN3 -> -9
-ddmxg190 maxmag Inf NaN2 -> Infinity
-
-ddmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
-ddmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
-ddmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
-ddmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
-ddmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
-ddmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
-ddmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
-
--- old rounding checks
-ddmxg221 maxmag 12345678000 1 -> 12345678000
-ddmxg222 maxmag 1 12345678000 -> 12345678000
-ddmxg223 maxmag 1234567800 1 -> 1234567800
-ddmxg224 maxmag 1 1234567800 -> 1234567800
-ddmxg225 maxmag 1234567890 1 -> 1234567890
-ddmxg226 maxmag 1 1234567890 -> 1234567890
-ddmxg227 maxmag 1234567891 1 -> 1234567891
-ddmxg228 maxmag 1 1234567891 -> 1234567891
-ddmxg229 maxmag 12345678901 1 -> 12345678901
-ddmxg230 maxmag 1 12345678901 -> 12345678901
-ddmxg231 maxmag 1234567896 1 -> 1234567896
-ddmxg232 maxmag 1 1234567896 -> 1234567896
-ddmxg233 maxmag -1234567891 1 -> -1234567891
-ddmxg234 maxmag 1 -1234567891 -> -1234567891
-ddmxg235 maxmag -12345678901 1 -> -12345678901
-ddmxg236 maxmag 1 -12345678901 -> -12345678901
-ddmxg237 maxmag -1234567896 1 -> -1234567896
-ddmxg238 maxmag 1 -1234567896 -> -1234567896
-
--- from examples
-ddmxg280 maxmag '3' '2' -> '3'
-ddmxg281 maxmag '-10' '3' -> '-10'
-ddmxg282 maxmag '1.0' '1' -> '1'
-ddmxg283 maxmag '1' '1.0' -> '1'
-ddmxg284 maxmag '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-ddmxg401 maxmag Inf 1.1 -> Infinity
-ddmxg402 maxmag 1.1 1 -> 1.1
-ddmxg403 maxmag 1 1.0 -> 1
-ddmxg404 maxmag 1.0 0.1 -> 1.0
-ddmxg405 maxmag 0.1 0.10 -> 0.1
-ddmxg406 maxmag 0.10 0.100 -> 0.10
-ddmxg407 maxmag 0.10 0 -> 0.10
-ddmxg408 maxmag 0 0.0 -> 0
-ddmxg409 maxmag 0.0 -0 -> 0.0
-ddmxg410 maxmag 0.0 -0.0 -> 0.0
-ddmxg411 maxmag 0.00 -0.0 -> 0.00
-ddmxg412 maxmag 0.0 -0.00 -> 0.0
-ddmxg413 maxmag 0 -0.0 -> 0
-ddmxg414 maxmag 0 -0 -> 0
-ddmxg415 maxmag -0.0 -0 -> -0.0
-ddmxg416 maxmag -0 -0.100 -> -0.100
-ddmxg417 maxmag -0.100 -0.10 -> -0.100
-ddmxg418 maxmag -0.10 -0.1 -> -0.10
-ddmxg419 maxmag -0.1 -1.0 -> -1.0
-ddmxg420 maxmag -1.0 -1 -> -1.0
-ddmxg421 maxmag -1 -1.1 -> -1.1
-ddmxg423 maxmag -1.1 -Inf -> -Infinity
--- same with operands reversed
-ddmxg431 maxmag 1.1 Inf -> Infinity
-ddmxg432 maxmag 1 1.1 -> 1.1
-ddmxg433 maxmag 1.0 1 -> 1
-ddmxg434 maxmag 0.1 1.0 -> 1.0
-ddmxg435 maxmag 0.10 0.1 -> 0.1
-ddmxg436 maxmag 0.100 0.10 -> 0.10
-ddmxg437 maxmag 0 0.10 -> 0.10
-ddmxg438 maxmag 0.0 0 -> 0
-ddmxg439 maxmag -0 0.0 -> 0.0
-ddmxg440 maxmag -0.0 0.0 -> 0.0
-ddmxg441 maxmag -0.0 0.00 -> 0.00
-ddmxg442 maxmag -0.00 0.0 -> 0.0
-ddmxg443 maxmag -0.0 0 -> 0
-ddmxg444 maxmag -0 0 -> 0
-ddmxg445 maxmag -0 -0.0 -> -0.0
-ddmxg446 maxmag -0.100 -0 -> -0.100
-ddmxg447 maxmag -0.10 -0.100 -> -0.100
-ddmxg448 maxmag -0.1 -0.10 -> -0.10
-ddmxg449 maxmag -1.0 -0.1 -> -1.0
-ddmxg450 maxmag -1 -1.0 -> -1.0
-ddmxg451 maxmag -1.1 -1 -> -1.1
-ddmxg453 maxmag -Inf -1.1 -> -Infinity
--- largies
-ddmxg460 maxmag 1000 1E+3 -> 1E+3
-ddmxg461 maxmag 1E+3 1000 -> 1E+3
-ddmxg462 maxmag 1000 -1E+3 -> 1000
-ddmxg463 maxmag 1E+3 -1000 -> 1E+3
-ddmxg464 maxmag -1000 1E+3 -> 1E+3
-ddmxg465 maxmag -1E+3 1000 -> 1000
-ddmxg466 maxmag -1000 -1E+3 -> -1000
-ddmxg467 maxmag -1E+3 -1000 -> -1000
-
--- subnormals
-ddmxg510 maxmag 1.00E-383 0 -> 1.00E-383
-ddmxg511 maxmag 0.1E-383 0 -> 1E-384 Subnormal
-ddmxg512 maxmag 0.10E-383 0 -> 1.0E-384 Subnormal
-ddmxg513 maxmag 0.100E-383 0 -> 1.00E-384 Subnormal
-ddmxg514 maxmag 0.01E-383 0 -> 1E-385 Subnormal
-ddmxg515 maxmag 0.999E-383 0 -> 9.99E-384 Subnormal
-ddmxg516 maxmag 0.099E-383 0 -> 9.9E-385 Subnormal
-ddmxg517 maxmag 0.009E-383 0 -> 9E-386 Subnormal
-ddmxg518 maxmag 0.001E-383 0 -> 1E-386 Subnormal
-ddmxg519 maxmag 0.0009E-383 0 -> 9E-387 Subnormal
-ddmxg520 maxmag 0.0001E-383 0 -> 1E-387 Subnormal
-
-ddmxg530 maxmag -1.00E-383 0 -> -1.00E-383
-ddmxg531 maxmag -0.1E-383 0 -> -1E-384 Subnormal
-ddmxg532 maxmag -0.10E-383 0 -> -1.0E-384 Subnormal
-ddmxg533 maxmag -0.100E-383 0 -> -1.00E-384 Subnormal
-ddmxg534 maxmag -0.01E-383 0 -> -1E-385 Subnormal
-ddmxg535 maxmag -0.999E-383 0 -> -9.99E-384 Subnormal
-ddmxg536 maxmag -0.099E-383 0 -> -9.9E-385 Subnormal
-ddmxg537 maxmag -0.009E-383 0 -> -9E-386 Subnormal
-ddmxg538 maxmag -0.001E-383 0 -> -1E-386 Subnormal
-ddmxg539 maxmag -0.0009E-383 0 -> -9E-387 Subnormal
-ddmxg540 maxmag -0.0001E-383 0 -> -1E-387 Subnormal
-
--- Null tests
-ddmxg900 maxmag 10 # -> NaN Invalid_operation
-ddmxg901 maxmag # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddMaxMag.decTest -- decDouble maxnummag --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmxg001 maxmag -2 -2 -> -2
+ddmxg002 maxmag -2 -1 -> -2
+ddmxg003 maxmag -2 0 -> -2
+ddmxg004 maxmag -2 1 -> -2
+ddmxg005 maxmag -2 2 -> 2
+ddmxg006 maxmag -1 -2 -> -2
+ddmxg007 maxmag -1 -1 -> -1
+ddmxg008 maxmag -1 0 -> -1
+ddmxg009 maxmag -1 1 -> 1
+ddmxg010 maxmag -1 2 -> 2
+ddmxg011 maxmag 0 -2 -> -2
+ddmxg012 maxmag 0 -1 -> -1
+ddmxg013 maxmag 0 0 -> 0
+ddmxg014 maxmag 0 1 -> 1
+ddmxg015 maxmag 0 2 -> 2
+ddmxg016 maxmag 1 -2 -> -2
+ddmxg017 maxmag 1 -1 -> 1
+ddmxg018 maxmag 1 0 -> 1
+ddmxg019 maxmag 1 1 -> 1
+ddmxg020 maxmag 1 2 -> 2
+ddmxg021 maxmag 2 -2 -> 2
+ddmxg022 maxmag 2 -1 -> 2
+ddmxg023 maxmag 2 0 -> 2
+ddmxg025 maxmag 2 1 -> 2
+ddmxg026 maxmag 2 2 -> 2
+
+-- extended zeros
+ddmxg030 maxmag 0 0 -> 0
+ddmxg031 maxmag 0 -0 -> 0
+ddmxg032 maxmag 0 -0.0 -> 0
+ddmxg033 maxmag 0 0.0 -> 0
+ddmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+ddmxg035 maxmag -0 -0 -> -0
+ddmxg036 maxmag -0 -0.0 -> -0.0
+ddmxg037 maxmag -0 0.0 -> 0.0
+ddmxg038 maxmag 0.0 0 -> 0
+ddmxg039 maxmag 0.0 -0 -> 0.0
+ddmxg040 maxmag 0.0 -0.0 -> 0.0
+ddmxg041 maxmag 0.0 0.0 -> 0.0
+ddmxg042 maxmag -0.0 0 -> 0
+ddmxg043 maxmag -0.0 -0 -> -0.0
+ddmxg044 maxmag -0.0 -0.0 -> -0.0
+ddmxg045 maxmag -0.0 0.0 -> 0.0
+
+ddmxg050 maxmag -0E1 0E1 -> 0E+1
+ddmxg051 maxmag -0E2 0E2 -> 0E+2
+ddmxg052 maxmag -0E2 0E1 -> 0E+1
+ddmxg053 maxmag -0E1 0E2 -> 0E+2
+ddmxg054 maxmag 0E1 -0E1 -> 0E+1
+ddmxg055 maxmag 0E2 -0E2 -> 0E+2
+ddmxg056 maxmag 0E2 -0E1 -> 0E+2
+ddmxg057 maxmag 0E1 -0E2 -> 0E+1
+
+ddmxg058 maxmag 0E1 0E1 -> 0E+1
+ddmxg059 maxmag 0E2 0E2 -> 0E+2
+ddmxg060 maxmag 0E2 0E1 -> 0E+2
+ddmxg061 maxmag 0E1 0E2 -> 0E+2
+ddmxg062 maxmag -0E1 -0E1 -> -0E+1
+ddmxg063 maxmag -0E2 -0E2 -> -0E+2
+ddmxg064 maxmag -0E2 -0E1 -> -0E+1
+ddmxg065 maxmag -0E1 -0E2 -> -0E+1
+
+-- Specials
+ddmxg090 maxmag Inf -Inf -> Infinity
+ddmxg091 maxmag Inf -1000 -> Infinity
+ddmxg092 maxmag Inf -1 -> Infinity
+ddmxg093 maxmag Inf -0 -> Infinity
+ddmxg094 maxmag Inf 0 -> Infinity
+ddmxg095 maxmag Inf 1 -> Infinity
+ddmxg096 maxmag Inf 1000 -> Infinity
+ddmxg097 maxmag Inf Inf -> Infinity
+ddmxg098 maxmag -1000 Inf -> Infinity
+ddmxg099 maxmag -Inf Inf -> Infinity
+ddmxg100 maxmag -1 Inf -> Infinity
+ddmxg101 maxmag -0 Inf -> Infinity
+ddmxg102 maxmag 0 Inf -> Infinity
+ddmxg103 maxmag 1 Inf -> Infinity
+ddmxg104 maxmag 1000 Inf -> Infinity
+ddmxg105 maxmag Inf Inf -> Infinity
+
+ddmxg120 maxmag -Inf -Inf -> -Infinity
+ddmxg121 maxmag -Inf -1000 -> -Infinity
+ddmxg122 maxmag -Inf -1 -> -Infinity
+ddmxg123 maxmag -Inf -0 -> -Infinity
+ddmxg124 maxmag -Inf 0 -> -Infinity
+ddmxg125 maxmag -Inf 1 -> -Infinity
+ddmxg126 maxmag -Inf 1000 -> -Infinity
+ddmxg127 maxmag -Inf Inf -> Infinity
+ddmxg128 maxmag -Inf -Inf -> -Infinity
+ddmxg129 maxmag -1000 -Inf -> -Infinity
+ddmxg130 maxmag -1 -Inf -> -Infinity
+ddmxg131 maxmag -0 -Inf -> -Infinity
+ddmxg132 maxmag 0 -Inf -> -Infinity
+ddmxg133 maxmag 1 -Inf -> -Infinity
+ddmxg134 maxmag 1000 -Inf -> -Infinity
+ddmxg135 maxmag Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+ddmxg141 maxmag NaN -Inf -> -Infinity
+ddmxg142 maxmag NaN -1000 -> -1000
+ddmxg143 maxmag NaN -1 -> -1
+ddmxg144 maxmag NaN -0 -> -0
+ddmxg145 maxmag NaN 0 -> 0
+ddmxg146 maxmag NaN 1 -> 1
+ddmxg147 maxmag NaN 1000 -> 1000
+ddmxg148 maxmag NaN Inf -> Infinity
+ddmxg149 maxmag NaN NaN -> NaN
+ddmxg150 maxmag -Inf NaN -> -Infinity
+ddmxg151 maxmag -1000 NaN -> -1000
+ddmxg152 maxmag -1 NaN -> -1
+ddmxg153 maxmag -0 NaN -> -0
+ddmxg154 maxmag 0 NaN -> 0
+ddmxg155 maxmag 1 NaN -> 1
+ddmxg156 maxmag 1000 NaN -> 1000
+ddmxg157 maxmag Inf NaN -> Infinity
+
+ddmxg161 maxmag sNaN -Inf -> NaN Invalid_operation
+ddmxg162 maxmag sNaN -1000 -> NaN Invalid_operation
+ddmxg163 maxmag sNaN -1 -> NaN Invalid_operation
+ddmxg164 maxmag sNaN -0 -> NaN Invalid_operation
+ddmxg165 maxmag sNaN 0 -> NaN Invalid_operation
+ddmxg166 maxmag sNaN 1 -> NaN Invalid_operation
+ddmxg167 maxmag sNaN 1000 -> NaN Invalid_operation
+ddmxg168 maxmag sNaN NaN -> NaN Invalid_operation
+ddmxg169 maxmag sNaN sNaN -> NaN Invalid_operation
+ddmxg170 maxmag NaN sNaN -> NaN Invalid_operation
+ddmxg171 maxmag -Inf sNaN -> NaN Invalid_operation
+ddmxg172 maxmag -1000 sNaN -> NaN Invalid_operation
+ddmxg173 maxmag -1 sNaN -> NaN Invalid_operation
+ddmxg174 maxmag -0 sNaN -> NaN Invalid_operation
+ddmxg175 maxmag 0 sNaN -> NaN Invalid_operation
+ddmxg176 maxmag 1 sNaN -> NaN Invalid_operation
+ddmxg177 maxmag 1000 sNaN -> NaN Invalid_operation
+ddmxg178 maxmag Inf sNaN -> NaN Invalid_operation
+ddmxg179 maxmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmxg181 maxmag NaN9 -Inf -> -Infinity
+ddmxg182 maxmag NaN8 9 -> 9
+ddmxg183 maxmag -NaN7 Inf -> Infinity
+
+ddmxg184 maxmag -NaN1 NaN11 -> -NaN1
+ddmxg185 maxmag NaN2 NaN12 -> NaN2
+ddmxg186 maxmag -NaN13 -NaN7 -> -NaN13
+ddmxg187 maxmag NaN14 -NaN5 -> NaN14
+
+ddmxg188 maxmag -Inf NaN4 -> -Infinity
+ddmxg189 maxmag -9 -NaN3 -> -9
+ddmxg190 maxmag Inf NaN2 -> Infinity
+
+ddmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
+ddmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
+ddmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
+ddmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
+ddmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
+ddmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
+ddmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
+
+-- old rounding checks
+ddmxg221 maxmag 12345678000 1 -> 12345678000
+ddmxg222 maxmag 1 12345678000 -> 12345678000
+ddmxg223 maxmag 1234567800 1 -> 1234567800
+ddmxg224 maxmag 1 1234567800 -> 1234567800
+ddmxg225 maxmag 1234567890 1 -> 1234567890
+ddmxg226 maxmag 1 1234567890 -> 1234567890
+ddmxg227 maxmag 1234567891 1 -> 1234567891
+ddmxg228 maxmag 1 1234567891 -> 1234567891
+ddmxg229 maxmag 12345678901 1 -> 12345678901
+ddmxg230 maxmag 1 12345678901 -> 12345678901
+ddmxg231 maxmag 1234567896 1 -> 1234567896
+ddmxg232 maxmag 1 1234567896 -> 1234567896
+ddmxg233 maxmag -1234567891 1 -> -1234567891
+ddmxg234 maxmag 1 -1234567891 -> -1234567891
+ddmxg235 maxmag -12345678901 1 -> -12345678901
+ddmxg236 maxmag 1 -12345678901 -> -12345678901
+ddmxg237 maxmag -1234567896 1 -> -1234567896
+ddmxg238 maxmag 1 -1234567896 -> -1234567896
+
+-- from examples
+ddmxg280 maxmag '3' '2' -> '3'
+ddmxg281 maxmag '-10' '3' -> '-10'
+ddmxg282 maxmag '1.0' '1' -> '1'
+ddmxg283 maxmag '1' '1.0' -> '1'
+ddmxg284 maxmag '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+ddmxg401 maxmag Inf 1.1 -> Infinity
+ddmxg402 maxmag 1.1 1 -> 1.1
+ddmxg403 maxmag 1 1.0 -> 1
+ddmxg404 maxmag 1.0 0.1 -> 1.0
+ddmxg405 maxmag 0.1 0.10 -> 0.1
+ddmxg406 maxmag 0.10 0.100 -> 0.10
+ddmxg407 maxmag 0.10 0 -> 0.10
+ddmxg408 maxmag 0 0.0 -> 0
+ddmxg409 maxmag 0.0 -0 -> 0.0
+ddmxg410 maxmag 0.0 -0.0 -> 0.0
+ddmxg411 maxmag 0.00 -0.0 -> 0.00
+ddmxg412 maxmag 0.0 -0.00 -> 0.0
+ddmxg413 maxmag 0 -0.0 -> 0
+ddmxg414 maxmag 0 -0 -> 0
+ddmxg415 maxmag -0.0 -0 -> -0.0
+ddmxg416 maxmag -0 -0.100 -> -0.100
+ddmxg417 maxmag -0.100 -0.10 -> -0.100
+ddmxg418 maxmag -0.10 -0.1 -> -0.10
+ddmxg419 maxmag -0.1 -1.0 -> -1.0
+ddmxg420 maxmag -1.0 -1 -> -1.0
+ddmxg421 maxmag -1 -1.1 -> -1.1
+ddmxg423 maxmag -1.1 -Inf -> -Infinity
+-- same with operands reversed
+ddmxg431 maxmag 1.1 Inf -> Infinity
+ddmxg432 maxmag 1 1.1 -> 1.1
+ddmxg433 maxmag 1.0 1 -> 1
+ddmxg434 maxmag 0.1 1.0 -> 1.0
+ddmxg435 maxmag 0.10 0.1 -> 0.1
+ddmxg436 maxmag 0.100 0.10 -> 0.10
+ddmxg437 maxmag 0 0.10 -> 0.10
+ddmxg438 maxmag 0.0 0 -> 0
+ddmxg439 maxmag -0 0.0 -> 0.0
+ddmxg440 maxmag -0.0 0.0 -> 0.0
+ddmxg441 maxmag -0.0 0.00 -> 0.00
+ddmxg442 maxmag -0.00 0.0 -> 0.0
+ddmxg443 maxmag -0.0 0 -> 0
+ddmxg444 maxmag -0 0 -> 0
+ddmxg445 maxmag -0 -0.0 -> -0.0
+ddmxg446 maxmag -0.100 -0 -> -0.100
+ddmxg447 maxmag -0.10 -0.100 -> -0.100
+ddmxg448 maxmag -0.1 -0.10 -> -0.10
+ddmxg449 maxmag -1.0 -0.1 -> -1.0
+ddmxg450 maxmag -1 -1.0 -> -1.0
+ddmxg451 maxmag -1.1 -1 -> -1.1
+ddmxg453 maxmag -Inf -1.1 -> -Infinity
+-- largies
+ddmxg460 maxmag 1000 1E+3 -> 1E+3
+ddmxg461 maxmag 1E+3 1000 -> 1E+3
+ddmxg462 maxmag 1000 -1E+3 -> 1000
+ddmxg463 maxmag 1E+3 -1000 -> 1E+3
+ddmxg464 maxmag -1000 1E+3 -> 1E+3
+ddmxg465 maxmag -1E+3 1000 -> 1000
+ddmxg466 maxmag -1000 -1E+3 -> -1000
+ddmxg467 maxmag -1E+3 -1000 -> -1000
+
+-- subnormals
+ddmxg510 maxmag 1.00E-383 0 -> 1.00E-383
+ddmxg511 maxmag 0.1E-383 0 -> 1E-384 Subnormal
+ddmxg512 maxmag 0.10E-383 0 -> 1.0E-384 Subnormal
+ddmxg513 maxmag 0.100E-383 0 -> 1.00E-384 Subnormal
+ddmxg514 maxmag 0.01E-383 0 -> 1E-385 Subnormal
+ddmxg515 maxmag 0.999E-383 0 -> 9.99E-384 Subnormal
+ddmxg516 maxmag 0.099E-383 0 -> 9.9E-385 Subnormal
+ddmxg517 maxmag 0.009E-383 0 -> 9E-386 Subnormal
+ddmxg518 maxmag 0.001E-383 0 -> 1E-386 Subnormal
+ddmxg519 maxmag 0.0009E-383 0 -> 9E-387 Subnormal
+ddmxg520 maxmag 0.0001E-383 0 -> 1E-387 Subnormal
+
+ddmxg530 maxmag -1.00E-383 0 -> -1.00E-383
+ddmxg531 maxmag -0.1E-383 0 -> -1E-384 Subnormal
+ddmxg532 maxmag -0.10E-383 0 -> -1.0E-384 Subnormal
+ddmxg533 maxmag -0.100E-383 0 -> -1.00E-384 Subnormal
+ddmxg534 maxmag -0.01E-383 0 -> -1E-385 Subnormal
+ddmxg535 maxmag -0.999E-383 0 -> -9.99E-384 Subnormal
+ddmxg536 maxmag -0.099E-383 0 -> -9.9E-385 Subnormal
+ddmxg537 maxmag -0.009E-383 0 -> -9E-386 Subnormal
+ddmxg538 maxmag -0.001E-383 0 -> -1E-386 Subnormal
+ddmxg539 maxmag -0.0009E-383 0 -> -9E-387 Subnormal
+ddmxg540 maxmag -0.0001E-383 0 -> -1E-387 Subnormal
+
+-- Null tests
+ddmxg900 maxmag 10 # -> NaN Invalid_operation
+ddmxg901 maxmag # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddMin.decTest b/Lib/test/decimaltestdata/ddMin.decTest
index 9ce4282463..eb942ff159 100644
--- a/Lib/test/decimaltestdata/ddMin.decTest
+++ b/Lib/test/decimaltestdata/ddMin.decTest
@@ -1,309 +1,309 @@
-------------------------------------------------------------------------
--- ddMin.decTest -- decDouble minnum --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmin001 min -2 -2 -> -2
-ddmin002 min -2 -1 -> -2
-ddmin003 min -2 0 -> -2
-ddmin004 min -2 1 -> -2
-ddmin005 min -2 2 -> -2
-ddmin006 min -1 -2 -> -2
-ddmin007 min -1 -1 -> -1
-ddmin008 min -1 0 -> -1
-ddmin009 min -1 1 -> -1
-ddmin010 min -1 2 -> -1
-ddmin011 min 0 -2 -> -2
-ddmin012 min 0 -1 -> -1
-ddmin013 min 0 0 -> 0
-ddmin014 min 0 1 -> 0
-ddmin015 min 0 2 -> 0
-ddmin016 min 1 -2 -> -2
-ddmin017 min 1 -1 -> -1
-ddmin018 min 1 0 -> 0
-ddmin019 min 1 1 -> 1
-ddmin020 min 1 2 -> 1
-ddmin021 min 2 -2 -> -2
-ddmin022 min 2 -1 -> -1
-ddmin023 min 2 0 -> 0
-ddmin025 min 2 1 -> 1
-ddmin026 min 2 2 -> 2
-
--- extended zeros
-ddmin030 min 0 0 -> 0
-ddmin031 min 0 -0 -> -0
-ddmin032 min 0 -0.0 -> -0.0
-ddmin033 min 0 0.0 -> 0.0
-ddmin034 min -0 0 -> -0
-ddmin035 min -0 -0 -> -0
-ddmin036 min -0 -0.0 -> -0
-ddmin037 min -0 0.0 -> -0
-ddmin038 min 0.0 0 -> 0.0
-ddmin039 min 0.0 -0 -> -0
-ddmin040 min 0.0 -0.0 -> -0.0
-ddmin041 min 0.0 0.0 -> 0.0
-ddmin042 min -0.0 0 -> -0.0
-ddmin043 min -0.0 -0 -> -0
-ddmin044 min -0.0 -0.0 -> -0.0
-ddmin045 min -0.0 0.0 -> -0.0
-
-ddmin046 min 0E1 -0E1 -> -0E+1
-ddmin047 min -0E1 0E2 -> -0E+1
-ddmin048 min 0E2 0E1 -> 0E+1
-ddmin049 min 0E1 0E2 -> 0E+1
-ddmin050 min -0E3 -0E2 -> -0E+3
-ddmin051 min -0E2 -0E3 -> -0E+3
-
--- Specials
-ddmin090 min Inf -Inf -> -Infinity
-ddmin091 min Inf -1000 -> -1000
-ddmin092 min Inf -1 -> -1
-ddmin093 min Inf -0 -> -0
-ddmin094 min Inf 0 -> 0
-ddmin095 min Inf 1 -> 1
-ddmin096 min Inf 1000 -> 1000
-ddmin097 min Inf Inf -> Infinity
-ddmin098 min -1000 Inf -> -1000
-ddmin099 min -Inf Inf -> -Infinity
-ddmin100 min -1 Inf -> -1
-ddmin101 min -0 Inf -> -0
-ddmin102 min 0 Inf -> 0
-ddmin103 min 1 Inf -> 1
-ddmin104 min 1000 Inf -> 1000
-ddmin105 min Inf Inf -> Infinity
-
-ddmin120 min -Inf -Inf -> -Infinity
-ddmin121 min -Inf -1000 -> -Infinity
-ddmin122 min -Inf -1 -> -Infinity
-ddmin123 min -Inf -0 -> -Infinity
-ddmin124 min -Inf 0 -> -Infinity
-ddmin125 min -Inf 1 -> -Infinity
-ddmin126 min -Inf 1000 -> -Infinity
-ddmin127 min -Inf Inf -> -Infinity
-ddmin128 min -Inf -Inf -> -Infinity
-ddmin129 min -1000 -Inf -> -Infinity
-ddmin130 min -1 -Inf -> -Infinity
-ddmin131 min -0 -Inf -> -Infinity
-ddmin132 min 0 -Inf -> -Infinity
-ddmin133 min 1 -Inf -> -Infinity
-ddmin134 min 1000 -Inf -> -Infinity
-ddmin135 min Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-ddmin141 min NaN -Inf -> -Infinity
-ddmin142 min NaN -1000 -> -1000
-ddmin143 min NaN -1 -> -1
-ddmin144 min NaN -0 -> -0
-ddmin145 min NaN 0 -> 0
-ddmin146 min NaN 1 -> 1
-ddmin147 min NaN 1000 -> 1000
-ddmin148 min NaN Inf -> Infinity
-ddmin149 min NaN NaN -> NaN
-ddmin150 min -Inf NaN -> -Infinity
-ddmin151 min -1000 NaN -> -1000
-ddmin152 min -1 -NaN -> -1
-ddmin153 min -0 NaN -> -0
-ddmin154 min 0 -NaN -> 0
-ddmin155 min 1 NaN -> 1
-ddmin156 min 1000 NaN -> 1000
-ddmin157 min Inf NaN -> Infinity
-
-ddmin161 min sNaN -Inf -> NaN Invalid_operation
-ddmin162 min sNaN -1000 -> NaN Invalid_operation
-ddmin163 min sNaN -1 -> NaN Invalid_operation
-ddmin164 min sNaN -0 -> NaN Invalid_operation
-ddmin165 min -sNaN 0 -> -NaN Invalid_operation
-ddmin166 min -sNaN 1 -> -NaN Invalid_operation
-ddmin167 min sNaN 1000 -> NaN Invalid_operation
-ddmin168 min sNaN NaN -> NaN Invalid_operation
-ddmin169 min sNaN sNaN -> NaN Invalid_operation
-ddmin170 min NaN sNaN -> NaN Invalid_operation
-ddmin171 min -Inf sNaN -> NaN Invalid_operation
-ddmin172 min -1000 sNaN -> NaN Invalid_operation
-ddmin173 min -1 sNaN -> NaN Invalid_operation
-ddmin174 min -0 sNaN -> NaN Invalid_operation
-ddmin175 min 0 sNaN -> NaN Invalid_operation
-ddmin176 min 1 sNaN -> NaN Invalid_operation
-ddmin177 min 1000 sNaN -> NaN Invalid_operation
-ddmin178 min Inf sNaN -> NaN Invalid_operation
-ddmin179 min NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmin181 min NaN9 -Inf -> -Infinity
-ddmin182 min -NaN8 9990 -> 9990
-ddmin183 min NaN71 Inf -> Infinity
-
-ddmin184 min NaN1 NaN54 -> NaN1
-ddmin185 min NaN22 -NaN53 -> NaN22
-ddmin186 min -NaN3 NaN6 -> -NaN3
-ddmin187 min -NaN44 NaN7 -> -NaN44
-
-ddmin188 min -Inf NaN41 -> -Infinity
-ddmin189 min -9999 -NaN33 -> -9999
-ddmin190 min Inf NaN2 -> Infinity
-
-ddmin191 min sNaN99 -Inf -> NaN99 Invalid_operation
-ddmin192 min sNaN98 -11 -> NaN98 Invalid_operation
-ddmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation
-ddmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
-ddmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmin196 min -Inf sNaN92 -> NaN92 Invalid_operation
-ddmin197 min 088 sNaN91 -> NaN91 Invalid_operation
-ddmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmin199 min NaN sNaN86 -> NaN86 Invalid_operation
-
--- old rounding checks
-ddmin221 min -12345678000 1 -> -12345678000
-ddmin222 min 1 -12345678000 -> -12345678000
-ddmin223 min -1234567800 1 -> -1234567800
-ddmin224 min 1 -1234567800 -> -1234567800
-ddmin225 min -1234567890 1 -> -1234567890
-ddmin226 min 1 -1234567890 -> -1234567890
-ddmin227 min -1234567891 1 -> -1234567891
-ddmin228 min 1 -1234567891 -> -1234567891
-ddmin229 min -12345678901 1 -> -12345678901
-ddmin230 min 1 -12345678901 -> -12345678901
-ddmin231 min -1234567896 1 -> -1234567896
-ddmin232 min 1 -1234567896 -> -1234567896
-ddmin233 min 1234567891 1 -> 1
-ddmin234 min 1 1234567891 -> 1
-ddmin235 min 12345678901 1 -> 1
-ddmin236 min 1 12345678901 -> 1
-ddmin237 min 1234567896 1 -> 1
-ddmin238 min 1 1234567896 -> 1
-
--- from examples
-ddmin280 min '3' '2' -> '2'
-ddmin281 min '-10' '3' -> '-10'
-ddmin282 min '1.0' '1' -> '1.0'
-ddmin283 min '1' '1.0' -> '1.0'
-ddmin284 min '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-ddmin401 min Inf 1.1 -> 1.1
-ddmin402 min 1.1 1 -> 1
-ddmin403 min 1 1.0 -> 1.0
-ddmin404 min 1.0 0.1 -> 0.1
-ddmin405 min 0.1 0.10 -> 0.10
-ddmin406 min 0.10 0.100 -> 0.100
-ddmin407 min 0.10 0 -> 0
-ddmin408 min 0 0.0 -> 0.0
-ddmin409 min 0.0 -0 -> -0
-ddmin410 min 0.0 -0.0 -> -0.0
-ddmin411 min 0.00 -0.0 -> -0.0
-ddmin412 min 0.0 -0.00 -> -0.00
-ddmin413 min 0 -0.0 -> -0.0
-ddmin414 min 0 -0 -> -0
-ddmin415 min -0.0 -0 -> -0
-ddmin416 min -0 -0.100 -> -0.100
-ddmin417 min -0.100 -0.10 -> -0.10
-ddmin418 min -0.10 -0.1 -> -0.1
-ddmin419 min -0.1 -1.0 -> -1.0
-ddmin420 min -1.0 -1 -> -1
-ddmin421 min -1 -1.1 -> -1.1
-ddmin423 min -1.1 -Inf -> -Infinity
--- same with operands reversed
-ddmin431 min 1.1 Inf -> 1.1
-ddmin432 min 1 1.1 -> 1
-ddmin433 min 1.0 1 -> 1.0
-ddmin434 min 0.1 1.0 -> 0.1
-ddmin435 min 0.10 0.1 -> 0.10
-ddmin436 min 0.100 0.10 -> 0.100
-ddmin437 min 0 0.10 -> 0
-ddmin438 min 0.0 0 -> 0.0
-ddmin439 min -0 0.0 -> -0
-ddmin440 min -0.0 0.0 -> -0.0
-ddmin441 min -0.0 0.00 -> -0.0
-ddmin442 min -0.00 0.0 -> -0.00
-ddmin443 min -0.0 0 -> -0.0
-ddmin444 min -0 0 -> -0
-ddmin445 min -0 -0.0 -> -0
-ddmin446 min -0.100 -0 -> -0.100
-ddmin447 min -0.10 -0.100 -> -0.10
-ddmin448 min -0.1 -0.10 -> -0.1
-ddmin449 min -1.0 -0.1 -> -1.0
-ddmin450 min -1 -1.0 -> -1
-ddmin451 min -1.1 -1 -> -1.1
-ddmin453 min -Inf -1.1 -> -Infinity
--- largies
-ddmin460 min 1000 1E+3 -> 1000
-ddmin461 min 1E+3 1000 -> 1000
-ddmin462 min 1000 -1E+3 -> -1E+3
-ddmin463 min 1E+3 -384 -> -384
-ddmin464 min -384 1E+3 -> -384
-ddmin465 min -1E+3 1000 -> -1E+3
-ddmin466 min -384 -1E+3 -> -1E+3
-ddmin467 min -1E+3 -384 -> -1E+3
-
--- misalignment traps for little-endian
-ddmin471 min 1.0 0.1 -> 0.1
-ddmin472 min 0.1 1.0 -> 0.1
-ddmin473 min 10.0 0.1 -> 0.1
-ddmin474 min 0.1 10.0 -> 0.1
-ddmin475 min 100 1.0 -> 1.0
-ddmin476 min 1.0 100 -> 1.0
-ddmin477 min 1000 10.0 -> 10.0
-ddmin478 min 10.0 1000 -> 10.0
-ddmin479 min 10000 100.0 -> 100.0
-ddmin480 min 100.0 10000 -> 100.0
-ddmin481 min 100000 1000.0 -> 1000.0
-ddmin482 min 1000.0 100000 -> 1000.0
-ddmin483 min 1000000 10000.0 -> 10000.0
-ddmin484 min 10000.0 1000000 -> 10000.0
-
--- subnormals
-ddmin510 min 1.00E-383 0 -> 0
-ddmin511 min 0.1E-383 0 -> 0
-ddmin512 min 0.10E-383 0 -> 0
-ddmin513 min 0.100E-383 0 -> 0
-ddmin514 min 0.01E-383 0 -> 0
-ddmin515 min 0.999E-383 0 -> 0
-ddmin516 min 0.099E-383 0 -> 0
-ddmin517 min 0.009E-383 0 -> 0
-ddmin518 min 0.001E-383 0 -> 0
-ddmin519 min 0.0009E-383 0 -> 0
-ddmin520 min 0.0001E-383 0 -> 0
-
-ddmin530 min -1.00E-383 0 -> -1.00E-383
-ddmin531 min -0.1E-383 0 -> -1E-384 Subnormal
-ddmin532 min -0.10E-383 0 -> -1.0E-384 Subnormal
-ddmin533 min -0.100E-383 0 -> -1.00E-384 Subnormal
-ddmin534 min -0.01E-383 0 -> -1E-385 Subnormal
-ddmin535 min -0.999E-383 0 -> -9.99E-384 Subnormal
-ddmin536 min -0.099E-383 0 -> -9.9E-385 Subnormal
-ddmin537 min -0.009E-383 0 -> -9E-386 Subnormal
-ddmin538 min -0.001E-383 0 -> -1E-386 Subnormal
-ddmin539 min -0.0009E-383 0 -> -9E-387 Subnormal
-ddmin540 min -0.0001E-383 0 -> -1E-387 Subnormal
-
-
--- Null tests
-ddmin900 min 10 # -> NaN Invalid_operation
-ddmin901 min # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddMin.decTest -- decDouble minnum --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmin001 min -2 -2 -> -2
+ddmin002 min -2 -1 -> -2
+ddmin003 min -2 0 -> -2
+ddmin004 min -2 1 -> -2
+ddmin005 min -2 2 -> -2
+ddmin006 min -1 -2 -> -2
+ddmin007 min -1 -1 -> -1
+ddmin008 min -1 0 -> -1
+ddmin009 min -1 1 -> -1
+ddmin010 min -1 2 -> -1
+ddmin011 min 0 -2 -> -2
+ddmin012 min 0 -1 -> -1
+ddmin013 min 0 0 -> 0
+ddmin014 min 0 1 -> 0
+ddmin015 min 0 2 -> 0
+ddmin016 min 1 -2 -> -2
+ddmin017 min 1 -1 -> -1
+ddmin018 min 1 0 -> 0
+ddmin019 min 1 1 -> 1
+ddmin020 min 1 2 -> 1
+ddmin021 min 2 -2 -> -2
+ddmin022 min 2 -1 -> -1
+ddmin023 min 2 0 -> 0
+ddmin025 min 2 1 -> 1
+ddmin026 min 2 2 -> 2
+
+-- extended zeros
+ddmin030 min 0 0 -> 0
+ddmin031 min 0 -0 -> -0
+ddmin032 min 0 -0.0 -> -0.0
+ddmin033 min 0 0.0 -> 0.0
+ddmin034 min -0 0 -> -0
+ddmin035 min -0 -0 -> -0
+ddmin036 min -0 -0.0 -> -0
+ddmin037 min -0 0.0 -> -0
+ddmin038 min 0.0 0 -> 0.0
+ddmin039 min 0.0 -0 -> -0
+ddmin040 min 0.0 -0.0 -> -0.0
+ddmin041 min 0.0 0.0 -> 0.0
+ddmin042 min -0.0 0 -> -0.0
+ddmin043 min -0.0 -0 -> -0
+ddmin044 min -0.0 -0.0 -> -0.0
+ddmin045 min -0.0 0.0 -> -0.0
+
+ddmin046 min 0E1 -0E1 -> -0E+1
+ddmin047 min -0E1 0E2 -> -0E+1
+ddmin048 min 0E2 0E1 -> 0E+1
+ddmin049 min 0E1 0E2 -> 0E+1
+ddmin050 min -0E3 -0E2 -> -0E+3
+ddmin051 min -0E2 -0E3 -> -0E+3
+
+-- Specials
+ddmin090 min Inf -Inf -> -Infinity
+ddmin091 min Inf -1000 -> -1000
+ddmin092 min Inf -1 -> -1
+ddmin093 min Inf -0 -> -0
+ddmin094 min Inf 0 -> 0
+ddmin095 min Inf 1 -> 1
+ddmin096 min Inf 1000 -> 1000
+ddmin097 min Inf Inf -> Infinity
+ddmin098 min -1000 Inf -> -1000
+ddmin099 min -Inf Inf -> -Infinity
+ddmin100 min -1 Inf -> -1
+ddmin101 min -0 Inf -> -0
+ddmin102 min 0 Inf -> 0
+ddmin103 min 1 Inf -> 1
+ddmin104 min 1000 Inf -> 1000
+ddmin105 min Inf Inf -> Infinity
+
+ddmin120 min -Inf -Inf -> -Infinity
+ddmin121 min -Inf -1000 -> -Infinity
+ddmin122 min -Inf -1 -> -Infinity
+ddmin123 min -Inf -0 -> -Infinity
+ddmin124 min -Inf 0 -> -Infinity
+ddmin125 min -Inf 1 -> -Infinity
+ddmin126 min -Inf 1000 -> -Infinity
+ddmin127 min -Inf Inf -> -Infinity
+ddmin128 min -Inf -Inf -> -Infinity
+ddmin129 min -1000 -Inf -> -Infinity
+ddmin130 min -1 -Inf -> -Infinity
+ddmin131 min -0 -Inf -> -Infinity
+ddmin132 min 0 -Inf -> -Infinity
+ddmin133 min 1 -Inf -> -Infinity
+ddmin134 min 1000 -Inf -> -Infinity
+ddmin135 min Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+ddmin141 min NaN -Inf -> -Infinity
+ddmin142 min NaN -1000 -> -1000
+ddmin143 min NaN -1 -> -1
+ddmin144 min NaN -0 -> -0
+ddmin145 min NaN 0 -> 0
+ddmin146 min NaN 1 -> 1
+ddmin147 min NaN 1000 -> 1000
+ddmin148 min NaN Inf -> Infinity
+ddmin149 min NaN NaN -> NaN
+ddmin150 min -Inf NaN -> -Infinity
+ddmin151 min -1000 NaN -> -1000
+ddmin152 min -1 -NaN -> -1
+ddmin153 min -0 NaN -> -0
+ddmin154 min 0 -NaN -> 0
+ddmin155 min 1 NaN -> 1
+ddmin156 min 1000 NaN -> 1000
+ddmin157 min Inf NaN -> Infinity
+
+ddmin161 min sNaN -Inf -> NaN Invalid_operation
+ddmin162 min sNaN -1000 -> NaN Invalid_operation
+ddmin163 min sNaN -1 -> NaN Invalid_operation
+ddmin164 min sNaN -0 -> NaN Invalid_operation
+ddmin165 min -sNaN 0 -> -NaN Invalid_operation
+ddmin166 min -sNaN 1 -> -NaN Invalid_operation
+ddmin167 min sNaN 1000 -> NaN Invalid_operation
+ddmin168 min sNaN NaN -> NaN Invalid_operation
+ddmin169 min sNaN sNaN -> NaN Invalid_operation
+ddmin170 min NaN sNaN -> NaN Invalid_operation
+ddmin171 min -Inf sNaN -> NaN Invalid_operation
+ddmin172 min -1000 sNaN -> NaN Invalid_operation
+ddmin173 min -1 sNaN -> NaN Invalid_operation
+ddmin174 min -0 sNaN -> NaN Invalid_operation
+ddmin175 min 0 sNaN -> NaN Invalid_operation
+ddmin176 min 1 sNaN -> NaN Invalid_operation
+ddmin177 min 1000 sNaN -> NaN Invalid_operation
+ddmin178 min Inf sNaN -> NaN Invalid_operation
+ddmin179 min NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmin181 min NaN9 -Inf -> -Infinity
+ddmin182 min -NaN8 9990 -> 9990
+ddmin183 min NaN71 Inf -> Infinity
+
+ddmin184 min NaN1 NaN54 -> NaN1
+ddmin185 min NaN22 -NaN53 -> NaN22
+ddmin186 min -NaN3 NaN6 -> -NaN3
+ddmin187 min -NaN44 NaN7 -> -NaN44
+
+ddmin188 min -Inf NaN41 -> -Infinity
+ddmin189 min -9999 -NaN33 -> -9999
+ddmin190 min Inf NaN2 -> Infinity
+
+ddmin191 min sNaN99 -Inf -> NaN99 Invalid_operation
+ddmin192 min sNaN98 -11 -> NaN98 Invalid_operation
+ddmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation
+ddmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
+ddmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmin196 min -Inf sNaN92 -> NaN92 Invalid_operation
+ddmin197 min 088 sNaN91 -> NaN91 Invalid_operation
+ddmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmin199 min NaN sNaN86 -> NaN86 Invalid_operation
+
+-- old rounding checks
+ddmin221 min -12345678000 1 -> -12345678000
+ddmin222 min 1 -12345678000 -> -12345678000
+ddmin223 min -1234567800 1 -> -1234567800
+ddmin224 min 1 -1234567800 -> -1234567800
+ddmin225 min -1234567890 1 -> -1234567890
+ddmin226 min 1 -1234567890 -> -1234567890
+ddmin227 min -1234567891 1 -> -1234567891
+ddmin228 min 1 -1234567891 -> -1234567891
+ddmin229 min -12345678901 1 -> -12345678901
+ddmin230 min 1 -12345678901 -> -12345678901
+ddmin231 min -1234567896 1 -> -1234567896
+ddmin232 min 1 -1234567896 -> -1234567896
+ddmin233 min 1234567891 1 -> 1
+ddmin234 min 1 1234567891 -> 1
+ddmin235 min 12345678901 1 -> 1
+ddmin236 min 1 12345678901 -> 1
+ddmin237 min 1234567896 1 -> 1
+ddmin238 min 1 1234567896 -> 1
+
+-- from examples
+ddmin280 min '3' '2' -> '2'
+ddmin281 min '-10' '3' -> '-10'
+ddmin282 min '1.0' '1' -> '1.0'
+ddmin283 min '1' '1.0' -> '1.0'
+ddmin284 min '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+ddmin401 min Inf 1.1 -> 1.1
+ddmin402 min 1.1 1 -> 1
+ddmin403 min 1 1.0 -> 1.0
+ddmin404 min 1.0 0.1 -> 0.1
+ddmin405 min 0.1 0.10 -> 0.10
+ddmin406 min 0.10 0.100 -> 0.100
+ddmin407 min 0.10 0 -> 0
+ddmin408 min 0 0.0 -> 0.0
+ddmin409 min 0.0 -0 -> -0
+ddmin410 min 0.0 -0.0 -> -0.0
+ddmin411 min 0.00 -0.0 -> -0.0
+ddmin412 min 0.0 -0.00 -> -0.00
+ddmin413 min 0 -0.0 -> -0.0
+ddmin414 min 0 -0 -> -0
+ddmin415 min -0.0 -0 -> -0
+ddmin416 min -0 -0.100 -> -0.100
+ddmin417 min -0.100 -0.10 -> -0.10
+ddmin418 min -0.10 -0.1 -> -0.1
+ddmin419 min -0.1 -1.0 -> -1.0
+ddmin420 min -1.0 -1 -> -1
+ddmin421 min -1 -1.1 -> -1.1
+ddmin423 min -1.1 -Inf -> -Infinity
+-- same with operands reversed
+ddmin431 min 1.1 Inf -> 1.1
+ddmin432 min 1 1.1 -> 1
+ddmin433 min 1.0 1 -> 1.0
+ddmin434 min 0.1 1.0 -> 0.1
+ddmin435 min 0.10 0.1 -> 0.10
+ddmin436 min 0.100 0.10 -> 0.100
+ddmin437 min 0 0.10 -> 0
+ddmin438 min 0.0 0 -> 0.0
+ddmin439 min -0 0.0 -> -0
+ddmin440 min -0.0 0.0 -> -0.0
+ddmin441 min -0.0 0.00 -> -0.0
+ddmin442 min -0.00 0.0 -> -0.00
+ddmin443 min -0.0 0 -> -0.0
+ddmin444 min -0 0 -> -0
+ddmin445 min -0 -0.0 -> -0
+ddmin446 min -0.100 -0 -> -0.100
+ddmin447 min -0.10 -0.100 -> -0.10
+ddmin448 min -0.1 -0.10 -> -0.1
+ddmin449 min -1.0 -0.1 -> -1.0
+ddmin450 min -1 -1.0 -> -1
+ddmin451 min -1.1 -1 -> -1.1
+ddmin453 min -Inf -1.1 -> -Infinity
+-- largies
+ddmin460 min 1000 1E+3 -> 1000
+ddmin461 min 1E+3 1000 -> 1000
+ddmin462 min 1000 -1E+3 -> -1E+3
+ddmin463 min 1E+3 -384 -> -384
+ddmin464 min -384 1E+3 -> -384
+ddmin465 min -1E+3 1000 -> -1E+3
+ddmin466 min -384 -1E+3 -> -1E+3
+ddmin467 min -1E+3 -384 -> -1E+3
+
+-- misalignment traps for little-endian
+ddmin471 min 1.0 0.1 -> 0.1
+ddmin472 min 0.1 1.0 -> 0.1
+ddmin473 min 10.0 0.1 -> 0.1
+ddmin474 min 0.1 10.0 -> 0.1
+ddmin475 min 100 1.0 -> 1.0
+ddmin476 min 1.0 100 -> 1.0
+ddmin477 min 1000 10.0 -> 10.0
+ddmin478 min 10.0 1000 -> 10.0
+ddmin479 min 10000 100.0 -> 100.0
+ddmin480 min 100.0 10000 -> 100.0
+ddmin481 min 100000 1000.0 -> 1000.0
+ddmin482 min 1000.0 100000 -> 1000.0
+ddmin483 min 1000000 10000.0 -> 10000.0
+ddmin484 min 10000.0 1000000 -> 10000.0
+
+-- subnormals
+ddmin510 min 1.00E-383 0 -> 0
+ddmin511 min 0.1E-383 0 -> 0
+ddmin512 min 0.10E-383 0 -> 0
+ddmin513 min 0.100E-383 0 -> 0
+ddmin514 min 0.01E-383 0 -> 0
+ddmin515 min 0.999E-383 0 -> 0
+ddmin516 min 0.099E-383 0 -> 0
+ddmin517 min 0.009E-383 0 -> 0
+ddmin518 min 0.001E-383 0 -> 0
+ddmin519 min 0.0009E-383 0 -> 0
+ddmin520 min 0.0001E-383 0 -> 0
+
+ddmin530 min -1.00E-383 0 -> -1.00E-383
+ddmin531 min -0.1E-383 0 -> -1E-384 Subnormal
+ddmin532 min -0.10E-383 0 -> -1.0E-384 Subnormal
+ddmin533 min -0.100E-383 0 -> -1.00E-384 Subnormal
+ddmin534 min -0.01E-383 0 -> -1E-385 Subnormal
+ddmin535 min -0.999E-383 0 -> -9.99E-384 Subnormal
+ddmin536 min -0.099E-383 0 -> -9.9E-385 Subnormal
+ddmin537 min -0.009E-383 0 -> -9E-386 Subnormal
+ddmin538 min -0.001E-383 0 -> -1E-386 Subnormal
+ddmin539 min -0.0009E-383 0 -> -9E-387 Subnormal
+ddmin540 min -0.0001E-383 0 -> -1E-387 Subnormal
+
+
+-- Null tests
+ddmin900 min 10 # -> NaN Invalid_operation
+ddmin901 min # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddMinMag.decTest b/Lib/test/decimaltestdata/ddMinMag.decTest
index 5537cc8a7e..1012f1ec81 100644
--- a/Lib/test/decimaltestdata/ddMinMag.decTest
+++ b/Lib/test/decimaltestdata/ddMinMag.decTest
@@ -1,293 +1,293 @@
-------------------------------------------------------------------------
--- ddMinMag.decTest -- decDouble minnummag --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmng001 minmag -2 -2 -> -2
-ddmng002 minmag -2 -1 -> -1
-ddmng003 minmag -2 0 -> 0
-ddmng004 minmag -2 1 -> 1
-ddmng005 minmag -2 2 -> -2
-ddmng006 minmag -1 -2 -> -1
-ddmng007 minmag -1 -1 -> -1
-ddmng008 minmag -1 0 -> 0
-ddmng009 minmag -1 1 -> -1
-ddmng010 minmag -1 2 -> -1
-ddmng011 minmag 0 -2 -> 0
-ddmng012 minmag 0 -1 -> 0
-ddmng013 minmag 0 0 -> 0
-ddmng014 minmag 0 1 -> 0
-ddmng015 minmag 0 2 -> 0
-ddmng016 minmag 1 -2 -> 1
-ddmng017 minmag 1 -1 -> -1
-ddmng018 minmag 1 0 -> 0
-ddmng019 minmag 1 1 -> 1
-ddmng020 minmag 1 2 -> 1
-ddmng021 minmag 2 -2 -> -2
-ddmng022 minmag 2 -1 -> -1
-ddmng023 minmag 2 0 -> 0
-ddmng025 minmag 2 1 -> 1
-ddmng026 minmag 2 2 -> 2
-
--- extended zeros
-ddmng030 minmag 0 0 -> 0
-ddmng031 minmag 0 -0 -> -0
-ddmng032 minmag 0 -0.0 -> -0.0
-ddmng033 minmag 0 0.0 -> 0.0
-ddmng034 minmag -0 0 -> -0
-ddmng035 minmag -0 -0 -> -0
-ddmng036 minmag -0 -0.0 -> -0
-ddmng037 minmag -0 0.0 -> -0
-ddmng038 minmag 0.0 0 -> 0.0
-ddmng039 minmag 0.0 -0 -> -0
-ddmng040 minmag 0.0 -0.0 -> -0.0
-ddmng041 minmag 0.0 0.0 -> 0.0
-ddmng042 minmag -0.0 0 -> -0.0
-ddmng043 minmag -0.0 -0 -> -0
-ddmng044 minmag -0.0 -0.0 -> -0.0
-ddmng045 minmag -0.0 0.0 -> -0.0
-
-ddmng046 minmag 0E1 -0E1 -> -0E+1
-ddmng047 minmag -0E1 0E2 -> -0E+1
-ddmng048 minmag 0E2 0E1 -> 0E+1
-ddmng049 minmag 0E1 0E2 -> 0E+1
-ddmng050 minmag -0E3 -0E2 -> -0E+3
-ddmng051 minmag -0E2 -0E3 -> -0E+3
-
--- Specials
-ddmng090 minmag Inf -Inf -> -Infinity
-ddmng091 minmag Inf -1000 -> -1000
-ddmng092 minmag Inf -1 -> -1
-ddmng093 minmag Inf -0 -> -0
-ddmng094 minmag Inf 0 -> 0
-ddmng095 minmag Inf 1 -> 1
-ddmng096 minmag Inf 1000 -> 1000
-ddmng097 minmag Inf Inf -> Infinity
-ddmng098 minmag -1000 Inf -> -1000
-ddmng099 minmag -Inf Inf -> -Infinity
-ddmng100 minmag -1 Inf -> -1
-ddmng101 minmag -0 Inf -> -0
-ddmng102 minmag 0 Inf -> 0
-ddmng103 minmag 1 Inf -> 1
-ddmng104 minmag 1000 Inf -> 1000
-ddmng105 minmag Inf Inf -> Infinity
-
-ddmng120 minmag -Inf -Inf -> -Infinity
-ddmng121 minmag -Inf -1000 -> -1000
-ddmng122 minmag -Inf -1 -> -1
-ddmng123 minmag -Inf -0 -> -0
-ddmng124 minmag -Inf 0 -> 0
-ddmng125 minmag -Inf 1 -> 1
-ddmng126 minmag -Inf 1000 -> 1000
-ddmng127 minmag -Inf Inf -> -Infinity
-ddmng128 minmag -Inf -Inf -> -Infinity
-ddmng129 minmag -1000 -Inf -> -1000
-ddmng130 minmag -1 -Inf -> -1
-ddmng131 minmag -0 -Inf -> -0
-ddmng132 minmag 0 -Inf -> 0
-ddmng133 minmag 1 -Inf -> 1
-ddmng134 minmag 1000 -Inf -> 1000
-ddmng135 minmag Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-ddmng141 minmag NaN -Inf -> -Infinity
-ddmng142 minmag NaN -1000 -> -1000
-ddmng143 minmag NaN -1 -> -1
-ddmng144 minmag NaN -0 -> -0
-ddmng145 minmag NaN 0 -> 0
-ddmng146 minmag NaN 1 -> 1
-ddmng147 minmag NaN 1000 -> 1000
-ddmng148 minmag NaN Inf -> Infinity
-ddmng149 minmag NaN NaN -> NaN
-ddmng150 minmag -Inf NaN -> -Infinity
-ddmng151 minmag -1000 NaN -> -1000
-ddmng152 minmag -1 -NaN -> -1
-ddmng153 minmag -0 NaN -> -0
-ddmng154 minmag 0 -NaN -> 0
-ddmng155 minmag 1 NaN -> 1
-ddmng156 minmag 1000 NaN -> 1000
-ddmng157 minmag Inf NaN -> Infinity
-
-ddmng161 minmag sNaN -Inf -> NaN Invalid_operation
-ddmng162 minmag sNaN -1000 -> NaN Invalid_operation
-ddmng163 minmag sNaN -1 -> NaN Invalid_operation
-ddmng164 minmag sNaN -0 -> NaN Invalid_operation
-ddmng165 minmag -sNaN 0 -> -NaN Invalid_operation
-ddmng166 minmag -sNaN 1 -> -NaN Invalid_operation
-ddmng167 minmag sNaN 1000 -> NaN Invalid_operation
-ddmng168 minmag sNaN NaN -> NaN Invalid_operation
-ddmng169 minmag sNaN sNaN -> NaN Invalid_operation
-ddmng170 minmag NaN sNaN -> NaN Invalid_operation
-ddmng171 minmag -Inf sNaN -> NaN Invalid_operation
-ddmng172 minmag -1000 sNaN -> NaN Invalid_operation
-ddmng173 minmag -1 sNaN -> NaN Invalid_operation
-ddmng174 minmag -0 sNaN -> NaN Invalid_operation
-ddmng175 minmag 0 sNaN -> NaN Invalid_operation
-ddmng176 minmag 1 sNaN -> NaN Invalid_operation
-ddmng177 minmag 1000 sNaN -> NaN Invalid_operation
-ddmng178 minmag Inf sNaN -> NaN Invalid_operation
-ddmng179 minmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmng181 minmag NaN9 -Inf -> -Infinity
-ddmng182 minmag -NaN8 9990 -> 9990
-ddmng183 minmag NaN71 Inf -> Infinity
-
-ddmng184 minmag NaN1 NaN54 -> NaN1
-ddmng185 minmag NaN22 -NaN53 -> NaN22
-ddmng186 minmag -NaN3 NaN6 -> -NaN3
-ddmng187 minmag -NaN44 NaN7 -> -NaN44
-
-ddmng188 minmag -Inf NaN41 -> -Infinity
-ddmng189 minmag -9999 -NaN33 -> -9999
-ddmng190 minmag Inf NaN2 -> Infinity
-
-ddmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
-ddmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation
-ddmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
-ddmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
-ddmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
-ddmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation
-ddmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation
-
--- old rounding checks
-ddmng221 minmag -12345678000 1 -> 1
-ddmng222 minmag 1 -12345678000 -> 1
-ddmng223 minmag -1234567800 1 -> 1
-ddmng224 minmag 1 -1234567800 -> 1
-ddmng225 minmag -1234567890 1 -> 1
-ddmng226 minmag 1 -1234567890 -> 1
-ddmng227 minmag -1234567891 1 -> 1
-ddmng228 minmag 1 -1234567891 -> 1
-ddmng229 minmag -12345678901 1 -> 1
-ddmng230 minmag 1 -12345678901 -> 1
-ddmng231 minmag -1234567896 1 -> 1
-ddmng232 minmag 1 -1234567896 -> 1
-ddmng233 minmag 1234567891 1 -> 1
-ddmng234 minmag 1 1234567891 -> 1
-ddmng235 minmag 12345678901 1 -> 1
-ddmng236 minmag 1 12345678901 -> 1
-ddmng237 minmag 1234567896 1 -> 1
-ddmng238 minmag 1 1234567896 -> 1
-
--- from examples
-ddmng280 minmag '3' '2' -> '2'
-ddmng281 minmag '-10' '3' -> '3'
-ddmng282 minmag '1.0' '1' -> '1.0'
-ddmng283 minmag '1' '1.0' -> '1.0'
-ddmng284 minmag '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-ddmng401 minmag Inf 1.1 -> 1.1
-ddmng402 minmag 1.1 1 -> 1
-ddmng403 minmag 1 1.0 -> 1.0
-ddmng404 minmag 1.0 0.1 -> 0.1
-ddmng405 minmag 0.1 0.10 -> 0.10
-ddmng406 minmag 0.10 0.100 -> 0.100
-ddmng407 minmag 0.10 0 -> 0
-ddmng408 minmag 0 0.0 -> 0.0
-ddmng409 minmag 0.0 -0 -> -0
-ddmng410 minmag 0.0 -0.0 -> -0.0
-ddmng411 minmag 0.00 -0.0 -> -0.0
-ddmng412 minmag 0.0 -0.00 -> -0.00
-ddmng413 minmag 0 -0.0 -> -0.0
-ddmng414 minmag 0 -0 -> -0
-ddmng415 minmag -0.0 -0 -> -0
-ddmng416 minmag -0 -0.100 -> -0
-ddmng417 minmag -0.100 -0.10 -> -0.10
-ddmng418 minmag -0.10 -0.1 -> -0.1
-ddmng419 minmag -0.1 -1.0 -> -0.1
-ddmng420 minmag -1.0 -1 -> -1
-ddmng421 minmag -1 -1.1 -> -1
-ddmng423 minmag -1.1 -Inf -> -1.1
--- same with operands reversed
-ddmng431 minmag 1.1 Inf -> 1.1
-ddmng432 minmag 1 1.1 -> 1
-ddmng433 minmag 1.0 1 -> 1.0
-ddmng434 minmag 0.1 1.0 -> 0.1
-ddmng435 minmag 0.10 0.1 -> 0.10
-ddmng436 minmag 0.100 0.10 -> 0.100
-ddmng437 minmag 0 0.10 -> 0
-ddmng438 minmag 0.0 0 -> 0.0
-ddmng439 minmag -0 0.0 -> -0
-ddmng440 minmag -0.0 0.0 -> -0.0
-ddmng441 minmag -0.0 0.00 -> -0.0
-ddmng442 minmag -0.00 0.0 -> -0.00
-ddmng443 minmag -0.0 0 -> -0.0
-ddmng444 minmag -0 0 -> -0
-ddmng445 minmag -0 -0.0 -> -0
-ddmng446 minmag -0.100 -0 -> -0
-ddmng447 minmag -0.10 -0.100 -> -0.10
-ddmng448 minmag -0.1 -0.10 -> -0.1
-ddmng449 minmag -1.0 -0.1 -> -0.1
-ddmng450 minmag -1 -1.0 -> -1
-ddmng451 minmag -1.1 -1 -> -1
-ddmng453 minmag -Inf -1.1 -> -1.1
--- largies
-ddmng460 minmag 1000 1E+3 -> 1000
-ddmng461 minmag 1E+3 1000 -> 1000
-ddmng462 minmag 1000 -1E+3 -> -1E+3
-ddmng463 minmag 1E+3 -384 -> -384
-ddmng464 minmag -384 1E+3 -> -384
-ddmng465 minmag -1E+3 1000 -> -1E+3
-ddmng466 minmag -384 -1E+3 -> -384
-ddmng467 minmag -1E+3 -384 -> -384
-
--- subnormals
-ddmng510 minmag 1.00E-383 0 -> 0
-ddmng511 minmag 0.1E-383 0 -> 0
-ddmng512 minmag 0.10E-383 0 -> 0
-ddmng513 minmag 0.100E-383 0 -> 0
-ddmng514 minmag 0.01E-383 0 -> 0
-ddmng515 minmag 0.999E-383 0 -> 0
-ddmng516 minmag 0.099E-383 0 -> 0
-ddmng517 minmag 0.009E-383 0 -> 0
-ddmng518 minmag 0.001E-383 0 -> 0
-ddmng519 minmag 0.0009E-383 0 -> 0
-ddmng520 minmag 0.0001E-383 0 -> 0
-
-ddmng530 minmag -1.00E-383 0 -> 0
-ddmng531 minmag -0.1E-383 0 -> 0
-ddmng532 minmag -0.10E-383 0 -> 0
-ddmng533 minmag -0.100E-383 0 -> 0
-ddmng534 minmag -0.01E-383 0 -> 0
-ddmng535 minmag -0.999E-383 0 -> 0
-ddmng536 minmag -0.099E-383 0 -> 0
-ddmng537 minmag -0.009E-383 0 -> 0
-ddmng538 minmag -0.001E-383 0 -> 0
-ddmng539 minmag -0.0009E-383 0 -> 0
-ddmng540 minmag -0.0001E-383 0 -> 0
-
-
--- Null tests
-ddmng900 minmag 10 # -> NaN Invalid_operation
-ddmng901 minmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddMinMag.decTest -- decDouble minnummag --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmng001 minmag -2 -2 -> -2
+ddmng002 minmag -2 -1 -> -1
+ddmng003 minmag -2 0 -> 0
+ddmng004 minmag -2 1 -> 1
+ddmng005 minmag -2 2 -> -2
+ddmng006 minmag -1 -2 -> -1
+ddmng007 minmag -1 -1 -> -1
+ddmng008 minmag -1 0 -> 0
+ddmng009 minmag -1 1 -> -1
+ddmng010 minmag -1 2 -> -1
+ddmng011 minmag 0 -2 -> 0
+ddmng012 minmag 0 -1 -> 0
+ddmng013 minmag 0 0 -> 0
+ddmng014 minmag 0 1 -> 0
+ddmng015 minmag 0 2 -> 0
+ddmng016 minmag 1 -2 -> 1
+ddmng017 minmag 1 -1 -> -1
+ddmng018 minmag 1 0 -> 0
+ddmng019 minmag 1 1 -> 1
+ddmng020 minmag 1 2 -> 1
+ddmng021 minmag 2 -2 -> -2
+ddmng022 minmag 2 -1 -> -1
+ddmng023 minmag 2 0 -> 0
+ddmng025 minmag 2 1 -> 1
+ddmng026 minmag 2 2 -> 2
+
+-- extended zeros
+ddmng030 minmag 0 0 -> 0
+ddmng031 minmag 0 -0 -> -0
+ddmng032 minmag 0 -0.0 -> -0.0
+ddmng033 minmag 0 0.0 -> 0.0
+ddmng034 minmag -0 0 -> -0
+ddmng035 minmag -0 -0 -> -0
+ddmng036 minmag -0 -0.0 -> -0
+ddmng037 minmag -0 0.0 -> -0
+ddmng038 minmag 0.0 0 -> 0.0
+ddmng039 minmag 0.0 -0 -> -0
+ddmng040 minmag 0.0 -0.0 -> -0.0
+ddmng041 minmag 0.0 0.0 -> 0.0
+ddmng042 minmag -0.0 0 -> -0.0
+ddmng043 minmag -0.0 -0 -> -0
+ddmng044 minmag -0.0 -0.0 -> -0.0
+ddmng045 minmag -0.0 0.0 -> -0.0
+
+ddmng046 minmag 0E1 -0E1 -> -0E+1
+ddmng047 minmag -0E1 0E2 -> -0E+1
+ddmng048 minmag 0E2 0E1 -> 0E+1
+ddmng049 minmag 0E1 0E2 -> 0E+1
+ddmng050 minmag -0E3 -0E2 -> -0E+3
+ddmng051 minmag -0E2 -0E3 -> -0E+3
+
+-- Specials
+ddmng090 minmag Inf -Inf -> -Infinity
+ddmng091 minmag Inf -1000 -> -1000
+ddmng092 minmag Inf -1 -> -1
+ddmng093 minmag Inf -0 -> -0
+ddmng094 minmag Inf 0 -> 0
+ddmng095 minmag Inf 1 -> 1
+ddmng096 minmag Inf 1000 -> 1000
+ddmng097 minmag Inf Inf -> Infinity
+ddmng098 minmag -1000 Inf -> -1000
+ddmng099 minmag -Inf Inf -> -Infinity
+ddmng100 minmag -1 Inf -> -1
+ddmng101 minmag -0 Inf -> -0
+ddmng102 minmag 0 Inf -> 0
+ddmng103 minmag 1 Inf -> 1
+ddmng104 minmag 1000 Inf -> 1000
+ddmng105 minmag Inf Inf -> Infinity
+
+ddmng120 minmag -Inf -Inf -> -Infinity
+ddmng121 minmag -Inf -1000 -> -1000
+ddmng122 minmag -Inf -1 -> -1
+ddmng123 minmag -Inf -0 -> -0
+ddmng124 minmag -Inf 0 -> 0
+ddmng125 minmag -Inf 1 -> 1
+ddmng126 minmag -Inf 1000 -> 1000
+ddmng127 minmag -Inf Inf -> -Infinity
+ddmng128 minmag -Inf -Inf -> -Infinity
+ddmng129 minmag -1000 -Inf -> -1000
+ddmng130 minmag -1 -Inf -> -1
+ddmng131 minmag -0 -Inf -> -0
+ddmng132 minmag 0 -Inf -> 0
+ddmng133 minmag 1 -Inf -> 1
+ddmng134 minmag 1000 -Inf -> 1000
+ddmng135 minmag Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+ddmng141 minmag NaN -Inf -> -Infinity
+ddmng142 minmag NaN -1000 -> -1000
+ddmng143 minmag NaN -1 -> -1
+ddmng144 minmag NaN -0 -> -0
+ddmng145 minmag NaN 0 -> 0
+ddmng146 minmag NaN 1 -> 1
+ddmng147 minmag NaN 1000 -> 1000
+ddmng148 minmag NaN Inf -> Infinity
+ddmng149 minmag NaN NaN -> NaN
+ddmng150 minmag -Inf NaN -> -Infinity
+ddmng151 minmag -1000 NaN -> -1000
+ddmng152 minmag -1 -NaN -> -1
+ddmng153 minmag -0 NaN -> -0
+ddmng154 minmag 0 -NaN -> 0
+ddmng155 minmag 1 NaN -> 1
+ddmng156 minmag 1000 NaN -> 1000
+ddmng157 minmag Inf NaN -> Infinity
+
+ddmng161 minmag sNaN -Inf -> NaN Invalid_operation
+ddmng162 minmag sNaN -1000 -> NaN Invalid_operation
+ddmng163 minmag sNaN -1 -> NaN Invalid_operation
+ddmng164 minmag sNaN -0 -> NaN Invalid_operation
+ddmng165 minmag -sNaN 0 -> -NaN Invalid_operation
+ddmng166 minmag -sNaN 1 -> -NaN Invalid_operation
+ddmng167 minmag sNaN 1000 -> NaN Invalid_operation
+ddmng168 minmag sNaN NaN -> NaN Invalid_operation
+ddmng169 minmag sNaN sNaN -> NaN Invalid_operation
+ddmng170 minmag NaN sNaN -> NaN Invalid_operation
+ddmng171 minmag -Inf sNaN -> NaN Invalid_operation
+ddmng172 minmag -1000 sNaN -> NaN Invalid_operation
+ddmng173 minmag -1 sNaN -> NaN Invalid_operation
+ddmng174 minmag -0 sNaN -> NaN Invalid_operation
+ddmng175 minmag 0 sNaN -> NaN Invalid_operation
+ddmng176 minmag 1 sNaN -> NaN Invalid_operation
+ddmng177 minmag 1000 sNaN -> NaN Invalid_operation
+ddmng178 minmag Inf sNaN -> NaN Invalid_operation
+ddmng179 minmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmng181 minmag NaN9 -Inf -> -Infinity
+ddmng182 minmag -NaN8 9990 -> 9990
+ddmng183 minmag NaN71 Inf -> Infinity
+
+ddmng184 minmag NaN1 NaN54 -> NaN1
+ddmng185 minmag NaN22 -NaN53 -> NaN22
+ddmng186 minmag -NaN3 NaN6 -> -NaN3
+ddmng187 minmag -NaN44 NaN7 -> -NaN44
+
+ddmng188 minmag -Inf NaN41 -> -Infinity
+ddmng189 minmag -9999 -NaN33 -> -9999
+ddmng190 minmag Inf NaN2 -> Infinity
+
+ddmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
+ddmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation
+ddmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
+ddmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
+ddmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
+ddmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation
+ddmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation
+
+-- old rounding checks
+ddmng221 minmag -12345678000 1 -> 1
+ddmng222 minmag 1 -12345678000 -> 1
+ddmng223 minmag -1234567800 1 -> 1
+ddmng224 minmag 1 -1234567800 -> 1
+ddmng225 minmag -1234567890 1 -> 1
+ddmng226 minmag 1 -1234567890 -> 1
+ddmng227 minmag -1234567891 1 -> 1
+ddmng228 minmag 1 -1234567891 -> 1
+ddmng229 minmag -12345678901 1 -> 1
+ddmng230 minmag 1 -12345678901 -> 1
+ddmng231 minmag -1234567896 1 -> 1
+ddmng232 minmag 1 -1234567896 -> 1
+ddmng233 minmag 1234567891 1 -> 1
+ddmng234 minmag 1 1234567891 -> 1
+ddmng235 minmag 12345678901 1 -> 1
+ddmng236 minmag 1 12345678901 -> 1
+ddmng237 minmag 1234567896 1 -> 1
+ddmng238 minmag 1 1234567896 -> 1
+
+-- from examples
+ddmng280 minmag '3' '2' -> '2'
+ddmng281 minmag '-10' '3' -> '3'
+ddmng282 minmag '1.0' '1' -> '1.0'
+ddmng283 minmag '1' '1.0' -> '1.0'
+ddmng284 minmag '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+ddmng401 minmag Inf 1.1 -> 1.1
+ddmng402 minmag 1.1 1 -> 1
+ddmng403 minmag 1 1.0 -> 1.0
+ddmng404 minmag 1.0 0.1 -> 0.1
+ddmng405 minmag 0.1 0.10 -> 0.10
+ddmng406 minmag 0.10 0.100 -> 0.100
+ddmng407 minmag 0.10 0 -> 0
+ddmng408 minmag 0 0.0 -> 0.0
+ddmng409 minmag 0.0 -0 -> -0
+ddmng410 minmag 0.0 -0.0 -> -0.0
+ddmng411 minmag 0.00 -0.0 -> -0.0
+ddmng412 minmag 0.0 -0.00 -> -0.00
+ddmng413 minmag 0 -0.0 -> -0.0
+ddmng414 minmag 0 -0 -> -0
+ddmng415 minmag -0.0 -0 -> -0
+ddmng416 minmag -0 -0.100 -> -0
+ddmng417 minmag -0.100 -0.10 -> -0.10
+ddmng418 minmag -0.10 -0.1 -> -0.1
+ddmng419 minmag -0.1 -1.0 -> -0.1
+ddmng420 minmag -1.0 -1 -> -1
+ddmng421 minmag -1 -1.1 -> -1
+ddmng423 minmag -1.1 -Inf -> -1.1
+-- same with operands reversed
+ddmng431 minmag 1.1 Inf -> 1.1
+ddmng432 minmag 1 1.1 -> 1
+ddmng433 minmag 1.0 1 -> 1.0
+ddmng434 minmag 0.1 1.0 -> 0.1
+ddmng435 minmag 0.10 0.1 -> 0.10
+ddmng436 minmag 0.100 0.10 -> 0.100
+ddmng437 minmag 0 0.10 -> 0
+ddmng438 minmag 0.0 0 -> 0.0
+ddmng439 minmag -0 0.0 -> -0
+ddmng440 minmag -0.0 0.0 -> -0.0
+ddmng441 minmag -0.0 0.00 -> -0.0
+ddmng442 minmag -0.00 0.0 -> -0.00
+ddmng443 minmag -0.0 0 -> -0.0
+ddmng444 minmag -0 0 -> -0
+ddmng445 minmag -0 -0.0 -> -0
+ddmng446 minmag -0.100 -0 -> -0
+ddmng447 minmag -0.10 -0.100 -> -0.10
+ddmng448 minmag -0.1 -0.10 -> -0.1
+ddmng449 minmag -1.0 -0.1 -> -0.1
+ddmng450 minmag -1 -1.0 -> -1
+ddmng451 minmag -1.1 -1 -> -1
+ddmng453 minmag -Inf -1.1 -> -1.1
+-- largies
+ddmng460 minmag 1000 1E+3 -> 1000
+ddmng461 minmag 1E+3 1000 -> 1000
+ddmng462 minmag 1000 -1E+3 -> -1E+3
+ddmng463 minmag 1E+3 -384 -> -384
+ddmng464 minmag -384 1E+3 -> -384
+ddmng465 minmag -1E+3 1000 -> -1E+3
+ddmng466 minmag -384 -1E+3 -> -384
+ddmng467 minmag -1E+3 -384 -> -384
+
+-- subnormals
+ddmng510 minmag 1.00E-383 0 -> 0
+ddmng511 minmag 0.1E-383 0 -> 0
+ddmng512 minmag 0.10E-383 0 -> 0
+ddmng513 minmag 0.100E-383 0 -> 0
+ddmng514 minmag 0.01E-383 0 -> 0
+ddmng515 minmag 0.999E-383 0 -> 0
+ddmng516 minmag 0.099E-383 0 -> 0
+ddmng517 minmag 0.009E-383 0 -> 0
+ddmng518 minmag 0.001E-383 0 -> 0
+ddmng519 minmag 0.0009E-383 0 -> 0
+ddmng520 minmag 0.0001E-383 0 -> 0
+
+ddmng530 minmag -1.00E-383 0 -> 0
+ddmng531 minmag -0.1E-383 0 -> 0
+ddmng532 minmag -0.10E-383 0 -> 0
+ddmng533 minmag -0.100E-383 0 -> 0
+ddmng534 minmag -0.01E-383 0 -> 0
+ddmng535 minmag -0.999E-383 0 -> 0
+ddmng536 minmag -0.099E-383 0 -> 0
+ddmng537 minmag -0.009E-383 0 -> 0
+ddmng538 minmag -0.001E-383 0 -> 0
+ddmng539 minmag -0.0009E-383 0 -> 0
+ddmng540 minmag -0.0001E-383 0 -> 0
+
+
+-- Null tests
+ddmng900 minmag 10 # -> NaN Invalid_operation
+ddmng901 minmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddMinus.decTest b/Lib/test/decimaltestdata/ddMinus.decTest
index 2705e79ea2..b7ffff7d89 100644
--- a/Lib/test/decimaltestdata/ddMinus.decTest
+++ b/Lib/test/decimaltestdata/ddMinus.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddMinus.decTest -- decDouble 0-x --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddmns001 minus +7.50 -> -7.50
-
--- Infinities
-ddmns011 minus Infinity -> -Infinity
-ddmns012 minus -Infinity -> Infinity
-
--- NaNs, 0 payload
-ddmns021 minus NaN -> NaN
-ddmns022 minus -NaN -> -NaN
-ddmns023 minus sNaN -> NaN Invalid_operation
-ddmns024 minus -sNaN -> -NaN Invalid_operation
-
--- NaNs, non-0 payload
-ddmns031 minus NaN13 -> NaN13
-ddmns032 minus -NaN13 -> -NaN13
-ddmns033 minus sNaN13 -> NaN13 Invalid_operation
-ddmns034 minus -sNaN13 -> -NaN13 Invalid_operation
-ddmns035 minus NaN70 -> NaN70
-ddmns036 minus -NaN70 -> -NaN70
-ddmns037 minus sNaN101 -> NaN101 Invalid_operation
-ddmns038 minus -sNaN101 -> -NaN101 Invalid_operation
-
--- finites
-ddmns101 minus 7 -> -7
-ddmns102 minus -7 -> 7
-ddmns103 minus 75 -> -75
-ddmns104 minus -75 -> 75
-ddmns105 minus 7.50 -> -7.50
-ddmns106 minus -7.50 -> 7.50
-ddmns107 minus 7.500 -> -7.500
-ddmns108 minus -7.500 -> 7.500
-
--- zeros
-ddmns111 minus 0 -> 0
-ddmns112 minus -0 -> 0
-ddmns113 minus 0E+4 -> 0E+4
-ddmns114 minus -0E+4 -> 0E+4
-ddmns115 minus 0.0000 -> 0.0000
-ddmns116 minus -0.0000 -> 0.0000
-ddmns117 minus 0E-141 -> 0E-141
-ddmns118 minus -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddmns121 minus 2682682682682682 -> -2682682682682682
-ddmns122 minus -2682682682682682 -> 2682682682682682
-ddmns123 minus 1341341341341341 -> -1341341341341341
-ddmns124 minus -1341341341341341 -> 1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddmns131 minus 9.999999999999999E+384 -> -9.999999999999999E+384
-ddmns132 minus 1E-383 -> -1E-383
-ddmns133 minus 1.000000000000000E-383 -> -1.000000000000000E-383
-ddmns134 minus 1E-398 -> -1E-398 Subnormal
-
-ddmns135 minus -1E-398 -> 1E-398 Subnormal
-ddmns136 minus -1.000000000000000E-383 -> 1.000000000000000E-383
-ddmns137 minus -1E-383 -> 1E-383
-ddmns138 minus -9.999999999999999E+384 -> 9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddMinus.decTest -- decDouble 0-x --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddmns001 minus +7.50 -> -7.50
+
+-- Infinities
+ddmns011 minus Infinity -> -Infinity
+ddmns012 minus -Infinity -> Infinity
+
+-- NaNs, 0 payload
+ddmns021 minus NaN -> NaN
+ddmns022 minus -NaN -> -NaN
+ddmns023 minus sNaN -> NaN Invalid_operation
+ddmns024 minus -sNaN -> -NaN Invalid_operation
+
+-- NaNs, non-0 payload
+ddmns031 minus NaN13 -> NaN13
+ddmns032 minus -NaN13 -> -NaN13
+ddmns033 minus sNaN13 -> NaN13 Invalid_operation
+ddmns034 minus -sNaN13 -> -NaN13 Invalid_operation
+ddmns035 minus NaN70 -> NaN70
+ddmns036 minus -NaN70 -> -NaN70
+ddmns037 minus sNaN101 -> NaN101 Invalid_operation
+ddmns038 minus -sNaN101 -> -NaN101 Invalid_operation
+
+-- finites
+ddmns101 minus 7 -> -7
+ddmns102 minus -7 -> 7
+ddmns103 minus 75 -> -75
+ddmns104 minus -75 -> 75
+ddmns105 minus 7.50 -> -7.50
+ddmns106 minus -7.50 -> 7.50
+ddmns107 minus 7.500 -> -7.500
+ddmns108 minus -7.500 -> 7.500
+
+-- zeros
+ddmns111 minus 0 -> 0
+ddmns112 minus -0 -> 0
+ddmns113 minus 0E+4 -> 0E+4
+ddmns114 minus -0E+4 -> 0E+4
+ddmns115 minus 0.0000 -> 0.0000
+ddmns116 minus -0.0000 -> 0.0000
+ddmns117 minus 0E-141 -> 0E-141
+ddmns118 minus -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddmns121 minus 2682682682682682 -> -2682682682682682
+ddmns122 minus -2682682682682682 -> 2682682682682682
+ddmns123 minus 1341341341341341 -> -1341341341341341
+ddmns124 minus -1341341341341341 -> 1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddmns131 minus 9.999999999999999E+384 -> -9.999999999999999E+384
+ddmns132 minus 1E-383 -> -1E-383
+ddmns133 minus 1.000000000000000E-383 -> -1.000000000000000E-383
+ddmns134 minus 1E-398 -> -1E-398 Subnormal
+
+ddmns135 minus -1E-398 -> 1E-398 Subnormal
+ddmns136 minus -1.000000000000000E-383 -> 1.000000000000000E-383
+ddmns137 minus -1E-383 -> 1E-383
+ddmns138 minus -9.999999999999999E+384 -> 9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddMultiply.decTest b/Lib/test/decimaltestdata/ddMultiply.decTest
index 45a381dc61..5873f80345 100644
--- a/Lib/test/decimaltestdata/ddMultiply.decTest
+++ b/Lib/test/decimaltestdata/ddMultiply.decTest
@@ -1,553 +1,553 @@
-------------------------------------------------------------------------
--- ddMultiply.decTest -- decDouble multiplication --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decDoubles only; all arguments are
--- representable in a decDouble
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddmul000 multiply 2 2 -> 4
-ddmul001 multiply 2 3 -> 6
-ddmul002 multiply 5 1 -> 5
-ddmul003 multiply 5 2 -> 10
-ddmul004 multiply 1.20 2 -> 2.40
-ddmul005 multiply 1.20 0 -> 0.00
-ddmul006 multiply 1.20 -2 -> -2.40
-ddmul007 multiply -1.20 2 -> -2.40
-ddmul008 multiply -1.20 0 -> -0.00
-ddmul009 multiply -1.20 -2 -> 2.40
-ddmul010 multiply 5.09 7.1 -> 36.139
-ddmul011 multiply 2.5 4 -> 10.0
-ddmul012 multiply 2.50 4 -> 10.00
-ddmul013 multiply 1.23456789 1.00000000 -> 1.234567890000000 Rounded
-ddmul015 multiply 2.50 4 -> 10.00
-ddmul016 multiply 9.999999999 9.999999999 -> 99.99999998000000 Inexact Rounded
-ddmul017 multiply 9.999999999 -9.999999999 -> -99.99999998000000 Inexact Rounded
-ddmul018 multiply -9.999999999 9.999999999 -> -99.99999998000000 Inexact Rounded
-ddmul019 multiply -9.999999999 -9.999999999 -> 99.99999998000000 Inexact Rounded
-
--- zeros, etc.
-ddmul021 multiply 0 0 -> 0
-ddmul022 multiply 0 -0 -> -0
-ddmul023 multiply -0 0 -> -0
-ddmul024 multiply -0 -0 -> 0
-ddmul025 multiply -0.0 -0.0 -> 0.00
-ddmul026 multiply -0.0 -0.0 -> 0.00
-ddmul027 multiply -0.0 -0.0 -> 0.00
-ddmul028 multiply -0.0 -0.0 -> 0.00
-ddmul030 multiply 5.00 1E-3 -> 0.00500
-ddmul031 multiply 00.00 0.000 -> 0.00000
-ddmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
-ddmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
-ddmul034 multiply -5.00 1E-3 -> -0.00500
-ddmul035 multiply -00.00 0.000 -> -0.00000
-ddmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
-ddmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
-ddmul038 multiply 5.00 -1E-3 -> -0.00500
-ddmul039 multiply 00.00 -0.000 -> -0.00000
-ddmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
-ddmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
-ddmul042 multiply -5.00 -1E-3 -> 0.00500
-ddmul043 multiply -00.00 -0.000 -> 0.00000
-ddmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
-ddmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
-
--- examples from decarith
-ddmul050 multiply 1.20 3 -> 3.60
-ddmul051 multiply 7 3 -> 21
-ddmul052 multiply 0.9 0.8 -> 0.72
-ddmul053 multiply 0.9 -0 -> -0.0
-ddmul054 multiply 654321 654321 -> 428135971041
-
-ddmul060 multiply 123.45 1e7 -> 1.2345E+9
-ddmul061 multiply 123.45 1e8 -> 1.2345E+10
-ddmul062 multiply 123.45 1e+9 -> 1.2345E+11
-ddmul063 multiply 123.45 1e10 -> 1.2345E+12
-ddmul064 multiply 123.45 1e11 -> 1.2345E+13
-ddmul065 multiply 123.45 1e12 -> 1.2345E+14
-ddmul066 multiply 123.45 1e13 -> 1.2345E+15
-
-
--- test some intermediate lengths
--- 1234567890123456
-ddmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
-ddmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
-ddmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
-ddmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
-
--- test some more edge cases and carries
-ddmul101 multiply 9 9 -> 81
-ddmul102 multiply 9 90 -> 810
-ddmul103 multiply 9 900 -> 8100
-ddmul104 multiply 9 9000 -> 81000
-ddmul105 multiply 9 90000 -> 810000
-ddmul106 multiply 9 900000 -> 8100000
-ddmul107 multiply 9 9000000 -> 81000000
-ddmul108 multiply 9 90000000 -> 810000000
-ddmul109 multiply 9 900000000 -> 8100000000
-ddmul110 multiply 9 9000000000 -> 81000000000
-ddmul111 multiply 9 90000000000 -> 810000000000
-ddmul112 multiply 9 900000000000 -> 8100000000000
-ddmul113 multiply 9 9000000000000 -> 81000000000000
-ddmul114 multiply 9 90000000000000 -> 810000000000000
-ddmul115 multiply 9 900000000000000 -> 8100000000000000
---ddmul116 multiply 9 9000000000000000 -> 81000000000000000
---ddmul117 multiply 9 90000000000000000 -> 810000000000000000
---ddmul118 multiply 9 900000000000000000 -> 8100000000000000000
---ddmul119 multiply 9 9000000000000000000 -> 81000000000000000000
---ddmul120 multiply 9 90000000000000000000 -> 810000000000000000000
---ddmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
---ddmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
---ddmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
--- test some more edge cases without carries
-ddmul131 multiply 3 3 -> 9
-ddmul132 multiply 3 30 -> 90
-ddmul133 multiply 3 300 -> 900
-ddmul134 multiply 3 3000 -> 9000
-ddmul135 multiply 3 30000 -> 90000
-ddmul136 multiply 3 300000 -> 900000
-ddmul137 multiply 3 3000000 -> 9000000
-ddmul138 multiply 3 30000000 -> 90000000
-ddmul139 multiply 3 300000000 -> 900000000
-ddmul140 multiply 3 3000000000 -> 9000000000
-ddmul141 multiply 3 30000000000 -> 90000000000
-ddmul142 multiply 3 300000000000 -> 900000000000
-ddmul143 multiply 3 3000000000000 -> 9000000000000
-ddmul144 multiply 3 30000000000000 -> 90000000000000
-ddmul145 multiply 3 300000000000000 -> 900000000000000
-
--- test some edge cases with exact rounding
-ddmul301 multiply 9 9 -> 81
-ddmul302 multiply 9 90 -> 810
-ddmul303 multiply 9 900 -> 8100
-ddmul304 multiply 9 9000 -> 81000
-ddmul305 multiply 9 90000 -> 810000
-ddmul306 multiply 9 900000 -> 8100000
-ddmul307 multiply 9 9000000 -> 81000000
-ddmul308 multiply 9 90000000 -> 810000000
-ddmul309 multiply 9 900000000 -> 8100000000
-ddmul310 multiply 9 9000000000 -> 81000000000
-ddmul311 multiply 9 90000000000 -> 810000000000
-ddmul312 multiply 9 900000000000 -> 8100000000000
-ddmul313 multiply 9 9000000000000 -> 81000000000000
-ddmul314 multiply 9 90000000000000 -> 810000000000000
-ddmul315 multiply 9 900000000000000 -> 8100000000000000
-ddmul316 multiply 9 9000000000000000 -> 8.100000000000000E+16 Rounded
-ddmul317 multiply 90 9000000000000000 -> 8.100000000000000E+17 Rounded
-ddmul318 multiply 900 9000000000000000 -> 8.100000000000000E+18 Rounded
-ddmul319 multiply 9000 9000000000000000 -> 8.100000000000000E+19 Rounded
-ddmul320 multiply 90000 9000000000000000 -> 8.100000000000000E+20 Rounded
-ddmul321 multiply 900000 9000000000000000 -> 8.100000000000000E+21 Rounded
-ddmul322 multiply 9000000 9000000000000000 -> 8.100000000000000E+22 Rounded
-ddmul323 multiply 90000000 9000000000000000 -> 8.100000000000000E+23 Rounded
-
--- tryzeros cases
-ddmul504 multiply 0E-260 1000E-260 -> 0E-398 Clamped
-ddmul505 multiply 100E+260 0E+260 -> 0E+369 Clamped
--- 65K-1 case
-ddmul506 multiply 77.1 850 -> 65535.0
-
--- mixed with zeros
-ddmul541 multiply 0 -1 -> -0
-ddmul542 multiply -0 -1 -> 0
-ddmul543 multiply 0 1 -> 0
-ddmul544 multiply -0 1 -> -0
-ddmul545 multiply -1 0 -> -0
-ddmul546 multiply -1 -0 -> 0
-ddmul547 multiply 1 0 -> 0
-ddmul548 multiply 1 -0 -> -0
-
-ddmul551 multiply 0.0 -1 -> -0.0
-ddmul552 multiply -0.0 -1 -> 0.0
-ddmul553 multiply 0.0 1 -> 0.0
-ddmul554 multiply -0.0 1 -> -0.0
-ddmul555 multiply -1.0 0 -> -0.0
-ddmul556 multiply -1.0 -0 -> 0.0
-ddmul557 multiply 1.0 0 -> 0.0
-ddmul558 multiply 1.0 -0 -> -0.0
-
-ddmul561 multiply 0 -1.0 -> -0.0
-ddmul562 multiply -0 -1.0 -> 0.0
-ddmul563 multiply 0 1.0 -> 0.0
-ddmul564 multiply -0 1.0 -> -0.0
-ddmul565 multiply -1 0.0 -> -0.0
-ddmul566 multiply -1 -0.0 -> 0.0
-ddmul567 multiply 1 0.0 -> 0.0
-ddmul568 multiply 1 -0.0 -> -0.0
-
-ddmul571 multiply 0.0 -1.0 -> -0.00
-ddmul572 multiply -0.0 -1.0 -> 0.00
-ddmul573 multiply 0.0 1.0 -> 0.00
-ddmul574 multiply -0.0 1.0 -> -0.00
-ddmul575 multiply -1.0 0.0 -> -0.00
-ddmul576 multiply -1.0 -0.0 -> 0.00
-ddmul577 multiply 1.0 0.0 -> 0.00
-ddmul578 multiply 1.0 -0.0 -> -0.00
-
-
--- Specials
-ddmul580 multiply Inf -Inf -> -Infinity
-ddmul581 multiply Inf -1000 -> -Infinity
-ddmul582 multiply Inf -1 -> -Infinity
-ddmul583 multiply Inf -0 -> NaN Invalid_operation
-ddmul584 multiply Inf 0 -> NaN Invalid_operation
-ddmul585 multiply Inf 1 -> Infinity
-ddmul586 multiply Inf 1000 -> Infinity
-ddmul587 multiply Inf Inf -> Infinity
-ddmul588 multiply -1000 Inf -> -Infinity
-ddmul589 multiply -Inf Inf -> -Infinity
-ddmul590 multiply -1 Inf -> -Infinity
-ddmul591 multiply -0 Inf -> NaN Invalid_operation
-ddmul592 multiply 0 Inf -> NaN Invalid_operation
-ddmul593 multiply 1 Inf -> Infinity
-ddmul594 multiply 1000 Inf -> Infinity
-ddmul595 multiply Inf Inf -> Infinity
-
-ddmul600 multiply -Inf -Inf -> Infinity
-ddmul601 multiply -Inf -1000 -> Infinity
-ddmul602 multiply -Inf -1 -> Infinity
-ddmul603 multiply -Inf -0 -> NaN Invalid_operation
-ddmul604 multiply -Inf 0 -> NaN Invalid_operation
-ddmul605 multiply -Inf 1 -> -Infinity
-ddmul606 multiply -Inf 1000 -> -Infinity
-ddmul607 multiply -Inf Inf -> -Infinity
-ddmul608 multiply -1000 Inf -> -Infinity
-ddmul609 multiply -Inf -Inf -> Infinity
-ddmul610 multiply -1 -Inf -> Infinity
-ddmul611 multiply -0 -Inf -> NaN Invalid_operation
-ddmul612 multiply 0 -Inf -> NaN Invalid_operation
-ddmul613 multiply 1 -Inf -> -Infinity
-ddmul614 multiply 1000 -Inf -> -Infinity
-ddmul615 multiply Inf -Inf -> -Infinity
-
-ddmul621 multiply NaN -Inf -> NaN
-ddmul622 multiply NaN -1000 -> NaN
-ddmul623 multiply NaN -1 -> NaN
-ddmul624 multiply NaN -0 -> NaN
-ddmul625 multiply NaN 0 -> NaN
-ddmul626 multiply NaN 1 -> NaN
-ddmul627 multiply NaN 1000 -> NaN
-ddmul628 multiply NaN Inf -> NaN
-ddmul629 multiply NaN NaN -> NaN
-ddmul630 multiply -Inf NaN -> NaN
-ddmul631 multiply -1000 NaN -> NaN
-ddmul632 multiply -1 NaN -> NaN
-ddmul633 multiply -0 NaN -> NaN
-ddmul634 multiply 0 NaN -> NaN
-ddmul635 multiply 1 NaN -> NaN
-ddmul636 multiply 1000 NaN -> NaN
-ddmul637 multiply Inf NaN -> NaN
-
-ddmul641 multiply sNaN -Inf -> NaN Invalid_operation
-ddmul642 multiply sNaN -1000 -> NaN Invalid_operation
-ddmul643 multiply sNaN -1 -> NaN Invalid_operation
-ddmul644 multiply sNaN -0 -> NaN Invalid_operation
-ddmul645 multiply sNaN 0 -> NaN Invalid_operation
-ddmul646 multiply sNaN 1 -> NaN Invalid_operation
-ddmul647 multiply sNaN 1000 -> NaN Invalid_operation
-ddmul648 multiply sNaN NaN -> NaN Invalid_operation
-ddmul649 multiply sNaN sNaN -> NaN Invalid_operation
-ddmul650 multiply NaN sNaN -> NaN Invalid_operation
-ddmul651 multiply -Inf sNaN -> NaN Invalid_operation
-ddmul652 multiply -1000 sNaN -> NaN Invalid_operation
-ddmul653 multiply -1 sNaN -> NaN Invalid_operation
-ddmul654 multiply -0 sNaN -> NaN Invalid_operation
-ddmul655 multiply 0 sNaN -> NaN Invalid_operation
-ddmul656 multiply 1 sNaN -> NaN Invalid_operation
-ddmul657 multiply 1000 sNaN -> NaN Invalid_operation
-ddmul658 multiply Inf sNaN -> NaN Invalid_operation
-ddmul659 multiply NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddmul661 multiply NaN9 -Inf -> NaN9
-ddmul662 multiply NaN8 999 -> NaN8
-ddmul663 multiply NaN71 Inf -> NaN71
-ddmul664 multiply NaN6 NaN5 -> NaN6
-ddmul665 multiply -Inf NaN4 -> NaN4
-ddmul666 multiply -999 NaN33 -> NaN33
-ddmul667 multiply Inf NaN2 -> NaN2
-
-ddmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
-ddmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
-ddmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
-ddmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
-ddmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
-ddmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
-ddmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
-ddmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
-ddmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
-
-ddmul681 multiply -NaN9 -Inf -> -NaN9
-ddmul682 multiply -NaN8 999 -> -NaN8
-ddmul683 multiply -NaN71 Inf -> -NaN71
-ddmul684 multiply -NaN6 -NaN5 -> -NaN6
-ddmul685 multiply -Inf -NaN4 -> -NaN4
-ddmul686 multiply -999 -NaN33 -> -NaN33
-ddmul687 multiply Inf -NaN2 -> -NaN2
-
-ddmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
-ddmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
-ddmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
-ddmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
-ddmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-ddmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
-ddmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
-ddmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
-ddmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
-
-ddmul701 multiply -NaN -Inf -> -NaN
-ddmul702 multiply -NaN 999 -> -NaN
-ddmul703 multiply -NaN Inf -> -NaN
-ddmul704 multiply -NaN -NaN -> -NaN
-ddmul705 multiply -Inf -NaN0 -> -NaN
-ddmul706 multiply -999 -NaN -> -NaN
-ddmul707 multiply Inf -NaN -> -NaN
-
-ddmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
-ddmul712 multiply -sNaN -11 -> -NaN Invalid_operation
-ddmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
-ddmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
-ddmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
-ddmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
-ddmul717 multiply 088 -sNaN -> -NaN Invalid_operation
-ddmul718 multiply Inf -sNaN -> -NaN Invalid_operation
-ddmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
--- signs
-ddmul751 multiply 1e+277 1e+311 -> Infinity Overflow Inexact Rounded
-ddmul752 multiply 1e+277 -1e+311 -> -Infinity Overflow Inexact Rounded
-ddmul753 multiply -1e+277 1e+311 -> -Infinity Overflow Inexact Rounded
-ddmul754 multiply -1e+277 -1e+311 -> Infinity Overflow Inexact Rounded
-ddmul755 multiply 1e-277 1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul756 multiply 1e-277 -1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul757 multiply -1e-277 1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul758 multiply -1e-277 -1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-ddmul760 multiply 1e-291 1e-101 -> 1E-392 Subnormal
-ddmul761 multiply 1e-291 1e-102 -> 1E-393 Subnormal
-ddmul762 multiply 1e-291 1e-103 -> 1E-394 Subnormal
-ddmul763 multiply 1e-291 1e-104 -> 1E-395 Subnormal
-ddmul764 multiply 1e-291 1e-105 -> 1E-396 Subnormal
-ddmul765 multiply 1e-291 1e-106 -> 1E-397 Subnormal
-ddmul766 multiply 1e-291 1e-107 -> 1E-398 Subnormal
-ddmul767 multiply 1e-291 1e-108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul768 multiply 1e-291 1e-109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul769 multiply 1e-291 1e-110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-ddmul770 multiply 1e+60 1e+321 -> 1.000000000000E+381 Clamped
-ddmul771 multiply 1e+60 1e+322 -> 1.0000000000000E+382 Clamped
-ddmul772 multiply 1e+60 1e+323 -> 1.00000000000000E+383 Clamped
-ddmul773 multiply 1e+60 1e+324 -> 1.000000000000000E+384 Clamped
-ddmul774 multiply 1e+60 1e+325 -> Infinity Overflow Inexact Rounded
-ddmul775 multiply 1e+60 1e+326 -> Infinity Overflow Inexact Rounded
-ddmul776 multiply 1e+60 1e+327 -> Infinity Overflow Inexact Rounded
-ddmul777 multiply 1e+60 1e+328 -> Infinity Overflow Inexact Rounded
-ddmul778 multiply 1e+60 1e+329 -> Infinity Overflow Inexact Rounded
-ddmul779 multiply 1e+60 1e+330 -> Infinity Overflow Inexact Rounded
-
-ddmul801 multiply 1.0000E-394 1 -> 1.0000E-394 Subnormal
-ddmul802 multiply 1.000E-394 1e-1 -> 1.000E-395 Subnormal
-ddmul803 multiply 1.00E-394 1e-2 -> 1.00E-396 Subnormal
-ddmul804 multiply 1.0E-394 1e-3 -> 1.0E-397 Subnormal
-ddmul805 multiply 1.0E-394 1e-4 -> 1E-398 Subnormal Rounded
-ddmul806 multiply 1.3E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddmul807 multiply 1.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul808 multiply 1.7E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul809 multiply 2.3E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul810 multiply 2.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul811 multiply 2.7E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
-ddmul812 multiply 1.49E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddmul813 multiply 1.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul814 multiply 1.51E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul815 multiply 2.49E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul816 multiply 2.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
-ddmul817 multiply 2.51E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
-
-ddmul818 multiply 1E-394 1e-4 -> 1E-398 Subnormal
-ddmul819 multiply 3E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul820 multiply 5E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul821 multiply 7E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddmul822 multiply 9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddmul823 multiply 9.9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
-
-ddmul824 multiply 1E-394 -1e-4 -> -1E-398 Subnormal
-ddmul825 multiply 3E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul826 multiply -5E-394 1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul827 multiply 7E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddmul828 multiply -9E-394 1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddmul829 multiply 9.9E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddmul830 multiply 3.0E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-ddmul831 multiply 1.0E-199 1e-200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddmul832 multiply 1.0E-199 1e-199 -> 1E-398 Subnormal Rounded
-ddmul833 multiply 1.0E-199 1e-198 -> 1.0E-397 Subnormal
-ddmul834 multiply 2.0E-199 2e-198 -> 4.0E-397 Subnormal
-ddmul835 multiply 4.0E-199 4e-198 -> 1.60E-396 Subnormal
-ddmul836 multiply 10.0E-199 10e-198 -> 1.000E-395 Subnormal
-ddmul837 multiply 30.0E-199 30e-198 -> 9.000E-395 Subnormal
-ddmul838 multiply 40.0E-199 40e-188 -> 1.6000E-384 Subnormal
-ddmul839 multiply 40.0E-199 40e-187 -> 1.6000E-383
-ddmul840 multiply 40.0E-199 40e-186 -> 1.6000E-382
-
--- Long operand overflow may be a different path
-ddmul870 multiply 100 9.999E+383 -> Infinity Inexact Overflow Rounded
-ddmul871 multiply 100 -9.999E+383 -> -Infinity Inexact Overflow Rounded
-ddmul872 multiply 9.999E+383 100 -> Infinity Inexact Overflow Rounded
-ddmul873 multiply -9.999E+383 100 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-ddmul881 multiply 1.2347E-355 1.2347E-40 -> 1.524E-395 Inexact Rounded Subnormal Underflow
-ddmul882 multiply 1.234E-355 1.234E-40 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddmul883 multiply 1.23E-355 1.23E-40 -> 1.513E-395 Inexact Rounded Subnormal Underflow
-ddmul884 multiply 1.2E-355 1.2E-40 -> 1.44E-395 Subnormal
-ddmul885 multiply 1.2E-355 1.2E-41 -> 1.44E-396 Subnormal
-ddmul886 multiply 1.2E-355 1.2E-42 -> 1.4E-397 Subnormal Inexact Rounded Underflow
-ddmul887 multiply 1.2E-355 1.3E-42 -> 1.6E-397 Subnormal Inexact Rounded Underflow
-ddmul888 multiply 1.3E-355 1.3E-42 -> 1.7E-397 Subnormal Inexact Rounded Underflow
-ddmul889 multiply 1.3E-355 1.3E-43 -> 2E-398 Subnormal Inexact Rounded Underflow
-ddmul890 multiply 1.3E-356 1.3E-43 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow
-
-ddmul891 multiply 1.2345E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
-ddmul892 multiply 1.23456E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
-ddmul893 multiply 1.2345E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddmul894 multiply 1.23456E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
-ddmul895 multiply 1.2345E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
-ddmul896 multiply 1.23456E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
--- 1 234567890123456
-ddmul900 multiply 0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded
-ddmul901 multiply 0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
-ddmul902 multiply 9.999999999999999E-383 0.0999999999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
-ddmul903 multiply 9.999999999999999E-383 0.09999999999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
-ddmul904 multiply 9.999999999999999E-383 0.099999999999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
-ddmul905 multiply 9.999999999999999E-383 0.0999999999999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
--- The next rounds to Nmin (b**emin); this is the distinguishing case
--- for detecting tininess (before or after rounding) -- if after
--- rounding then the result would be the same, but the Underflow flag
--- would not be set
-ddmul906 multiply 9.999999999999999E-383 0.09999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
--- prove those operands were exact
-ddmul907 multiply 9.999999999999999E-383 1 -> 9.999999999999999E-383
-ddmul908 multiply 1 0.09999999999999999 -> 0.09999999999999999
-
--- reducing tiniest
-ddmul910 multiply 1e-398 0.99 -> 1E-398 Subnormal Inexact Rounded Underflow
-ddmul911 multiply 1e-398 0.75 -> 1E-398 Subnormal Inexact Rounded Underflow
-ddmul912 multiply 1e-398 0.5 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-ddmul913 multiply 1e-398 0.25 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-ddmul914 multiply 1e-398 0.01 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-
--- hugest
-ddmul920 multiply 9999999999999999 9999999999999999 -> 9.999999999999998E+31 Inexact Rounded
-
--- power-of-ten edge cases
-ddmul1001 multiply 1 10 -> 10
-ddmul1002 multiply 1 100 -> 100
-ddmul1003 multiply 1 1000 -> 1000
-ddmul1004 multiply 1 10000 -> 10000
-ddmul1005 multiply 1 100000 -> 100000
-ddmul1006 multiply 1 1000000 -> 1000000
-ddmul1007 multiply 1 10000000 -> 10000000
-ddmul1008 multiply 1 100000000 -> 100000000
-ddmul1009 multiply 1 1000000000 -> 1000000000
-ddmul1010 multiply 1 10000000000 -> 10000000000
-ddmul1011 multiply 1 100000000000 -> 100000000000
-ddmul1012 multiply 1 1000000000000 -> 1000000000000
-ddmul1013 multiply 1 10000000000000 -> 10000000000000
-ddmul1014 multiply 1 100000000000000 -> 100000000000000
-ddmul1015 multiply 1 1000000000000000 -> 1000000000000000
-ddmul1021 multiply 10 1 -> 10
-ddmul1022 multiply 10 10 -> 100
-ddmul1023 multiply 10 100 -> 1000
-ddmul1024 multiply 10 1000 -> 10000
-ddmul1025 multiply 10 10000 -> 100000
-ddmul1026 multiply 10 100000 -> 1000000
-ddmul1027 multiply 10 1000000 -> 10000000
-ddmul1028 multiply 10 10000000 -> 100000000
-ddmul1029 multiply 10 100000000 -> 1000000000
-ddmul1030 multiply 10 1000000000 -> 10000000000
-ddmul1031 multiply 10 10000000000 -> 100000000000
-ddmul1032 multiply 10 100000000000 -> 1000000000000
-ddmul1033 multiply 10 1000000000000 -> 10000000000000
-ddmul1034 multiply 10 10000000000000 -> 100000000000000
-ddmul1035 multiply 10 100000000000000 -> 1000000000000000
-ddmul1041 multiply 100 0.1 -> 10.0
-ddmul1042 multiply 100 1 -> 100
-ddmul1043 multiply 100 10 -> 1000
-ddmul1044 multiply 100 100 -> 10000
-ddmul1045 multiply 100 1000 -> 100000
-ddmul1046 multiply 100 10000 -> 1000000
-ddmul1047 multiply 100 100000 -> 10000000
-ddmul1048 multiply 100 1000000 -> 100000000
-ddmul1049 multiply 100 10000000 -> 1000000000
-ddmul1050 multiply 100 100000000 -> 10000000000
-ddmul1051 multiply 100 1000000000 -> 100000000000
-ddmul1052 multiply 100 10000000000 -> 1000000000000
-ddmul1053 multiply 100 100000000000 -> 10000000000000
-ddmul1054 multiply 100 1000000000000 -> 100000000000000
-ddmul1055 multiply 100 10000000000000 -> 1000000000000000
-ddmul1061 multiply 1000 0.01 -> 10.00
-ddmul1062 multiply 1000 0.1 -> 100.0
-ddmul1063 multiply 1000 1 -> 1000
-ddmul1064 multiply 1000 10 -> 10000
-ddmul1065 multiply 1000 100 -> 100000
-ddmul1066 multiply 1000 1000 -> 1000000
-ddmul1067 multiply 1000 10000 -> 10000000
-ddmul1068 multiply 1000 100000 -> 100000000
-ddmul1069 multiply 1000 1000000 -> 1000000000
-ddmul1070 multiply 1000 10000000 -> 10000000000
-ddmul1071 multiply 1000 100000000 -> 100000000000
-ddmul1072 multiply 1000 1000000000 -> 1000000000000
-ddmul1073 multiply 1000 10000000000 -> 10000000000000
-ddmul1074 multiply 1000 100000000000 -> 100000000000000
-ddmul1075 multiply 1000 1000000000000 -> 1000000000000000
-ddmul1081 multiply 10000 0.001 -> 10.000
-ddmul1082 multiply 10000 0.01 -> 100.00
-ddmul1083 multiply 10000 0.1 -> 1000.0
-ddmul1084 multiply 10000 1 -> 10000
-ddmul1085 multiply 10000 10 -> 100000
-ddmul1086 multiply 10000 100 -> 1000000
-ddmul1087 multiply 10000 1000 -> 10000000
-ddmul1088 multiply 10000 10000 -> 100000000
-ddmul1089 multiply 10000 100000 -> 1000000000
-ddmul1090 multiply 10000 1000000 -> 10000000000
-ddmul1091 multiply 10000 10000000 -> 100000000000
-ddmul1092 multiply 10000 100000000 -> 1000000000000
-ddmul1093 multiply 10000 1000000000 -> 10000000000000
-ddmul1094 multiply 10000 10000000000 -> 100000000000000
-ddmul1095 multiply 10000 100000000000 -> 1000000000000000
-
-ddmul1097 multiply 10000 99999999999 -> 999999999990000
-ddmul1098 multiply 10000 99999999999 -> 999999999990000
-
-
--- Null tests
-ddmul9990 multiply 10 # -> NaN Invalid_operation
-ddmul9991 multiply # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddMultiply.decTest -- decDouble multiplication --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decDoubles only; all arguments are
+-- representable in a decDouble
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddmul000 multiply 2 2 -> 4
+ddmul001 multiply 2 3 -> 6
+ddmul002 multiply 5 1 -> 5
+ddmul003 multiply 5 2 -> 10
+ddmul004 multiply 1.20 2 -> 2.40
+ddmul005 multiply 1.20 0 -> 0.00
+ddmul006 multiply 1.20 -2 -> -2.40
+ddmul007 multiply -1.20 2 -> -2.40
+ddmul008 multiply -1.20 0 -> -0.00
+ddmul009 multiply -1.20 -2 -> 2.40
+ddmul010 multiply 5.09 7.1 -> 36.139
+ddmul011 multiply 2.5 4 -> 10.0
+ddmul012 multiply 2.50 4 -> 10.00
+ddmul013 multiply 1.23456789 1.00000000 -> 1.234567890000000 Rounded
+ddmul015 multiply 2.50 4 -> 10.00
+ddmul016 multiply 9.999999999 9.999999999 -> 99.99999998000000 Inexact Rounded
+ddmul017 multiply 9.999999999 -9.999999999 -> -99.99999998000000 Inexact Rounded
+ddmul018 multiply -9.999999999 9.999999999 -> -99.99999998000000 Inexact Rounded
+ddmul019 multiply -9.999999999 -9.999999999 -> 99.99999998000000 Inexact Rounded
+
+-- zeros, etc.
+ddmul021 multiply 0 0 -> 0
+ddmul022 multiply 0 -0 -> -0
+ddmul023 multiply -0 0 -> -0
+ddmul024 multiply -0 -0 -> 0
+ddmul025 multiply -0.0 -0.0 -> 0.00
+ddmul026 multiply -0.0 -0.0 -> 0.00
+ddmul027 multiply -0.0 -0.0 -> 0.00
+ddmul028 multiply -0.0 -0.0 -> 0.00
+ddmul030 multiply 5.00 1E-3 -> 0.00500
+ddmul031 multiply 00.00 0.000 -> 0.00000
+ddmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
+ddmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
+ddmul034 multiply -5.00 1E-3 -> -0.00500
+ddmul035 multiply -00.00 0.000 -> -0.00000
+ddmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
+ddmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
+ddmul038 multiply 5.00 -1E-3 -> -0.00500
+ddmul039 multiply 00.00 -0.000 -> -0.00000
+ddmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
+ddmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
+ddmul042 multiply -5.00 -1E-3 -> 0.00500
+ddmul043 multiply -00.00 -0.000 -> 0.00000
+ddmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
+ddmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
+
+-- examples from decarith
+ddmul050 multiply 1.20 3 -> 3.60
+ddmul051 multiply 7 3 -> 21
+ddmul052 multiply 0.9 0.8 -> 0.72
+ddmul053 multiply 0.9 -0 -> -0.0
+ddmul054 multiply 654321 654321 -> 428135971041
+
+ddmul060 multiply 123.45 1e7 -> 1.2345E+9
+ddmul061 multiply 123.45 1e8 -> 1.2345E+10
+ddmul062 multiply 123.45 1e+9 -> 1.2345E+11
+ddmul063 multiply 123.45 1e10 -> 1.2345E+12
+ddmul064 multiply 123.45 1e11 -> 1.2345E+13
+ddmul065 multiply 123.45 1e12 -> 1.2345E+14
+ddmul066 multiply 123.45 1e13 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+-- 1234567890123456
+ddmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
+ddmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
+ddmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
+ddmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
+
+-- test some more edge cases and carries
+ddmul101 multiply 9 9 -> 81
+ddmul102 multiply 9 90 -> 810
+ddmul103 multiply 9 900 -> 8100
+ddmul104 multiply 9 9000 -> 81000
+ddmul105 multiply 9 90000 -> 810000
+ddmul106 multiply 9 900000 -> 8100000
+ddmul107 multiply 9 9000000 -> 81000000
+ddmul108 multiply 9 90000000 -> 810000000
+ddmul109 multiply 9 900000000 -> 8100000000
+ddmul110 multiply 9 9000000000 -> 81000000000
+ddmul111 multiply 9 90000000000 -> 810000000000
+ddmul112 multiply 9 900000000000 -> 8100000000000
+ddmul113 multiply 9 9000000000000 -> 81000000000000
+ddmul114 multiply 9 90000000000000 -> 810000000000000
+ddmul115 multiply 9 900000000000000 -> 8100000000000000
+--ddmul116 multiply 9 9000000000000000 -> 81000000000000000
+--ddmul117 multiply 9 90000000000000000 -> 810000000000000000
+--ddmul118 multiply 9 900000000000000000 -> 8100000000000000000
+--ddmul119 multiply 9 9000000000000000000 -> 81000000000000000000
+--ddmul120 multiply 9 90000000000000000000 -> 810000000000000000000
+--ddmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
+--ddmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
+--ddmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
+-- test some more edge cases without carries
+ddmul131 multiply 3 3 -> 9
+ddmul132 multiply 3 30 -> 90
+ddmul133 multiply 3 300 -> 900
+ddmul134 multiply 3 3000 -> 9000
+ddmul135 multiply 3 30000 -> 90000
+ddmul136 multiply 3 300000 -> 900000
+ddmul137 multiply 3 3000000 -> 9000000
+ddmul138 multiply 3 30000000 -> 90000000
+ddmul139 multiply 3 300000000 -> 900000000
+ddmul140 multiply 3 3000000000 -> 9000000000
+ddmul141 multiply 3 30000000000 -> 90000000000
+ddmul142 multiply 3 300000000000 -> 900000000000
+ddmul143 multiply 3 3000000000000 -> 9000000000000
+ddmul144 multiply 3 30000000000000 -> 90000000000000
+ddmul145 multiply 3 300000000000000 -> 900000000000000
+
+-- test some edge cases with exact rounding
+ddmul301 multiply 9 9 -> 81
+ddmul302 multiply 9 90 -> 810
+ddmul303 multiply 9 900 -> 8100
+ddmul304 multiply 9 9000 -> 81000
+ddmul305 multiply 9 90000 -> 810000
+ddmul306 multiply 9 900000 -> 8100000
+ddmul307 multiply 9 9000000 -> 81000000
+ddmul308 multiply 9 90000000 -> 810000000
+ddmul309 multiply 9 900000000 -> 8100000000
+ddmul310 multiply 9 9000000000 -> 81000000000
+ddmul311 multiply 9 90000000000 -> 810000000000
+ddmul312 multiply 9 900000000000 -> 8100000000000
+ddmul313 multiply 9 9000000000000 -> 81000000000000
+ddmul314 multiply 9 90000000000000 -> 810000000000000
+ddmul315 multiply 9 900000000000000 -> 8100000000000000
+ddmul316 multiply 9 9000000000000000 -> 8.100000000000000E+16 Rounded
+ddmul317 multiply 90 9000000000000000 -> 8.100000000000000E+17 Rounded
+ddmul318 multiply 900 9000000000000000 -> 8.100000000000000E+18 Rounded
+ddmul319 multiply 9000 9000000000000000 -> 8.100000000000000E+19 Rounded
+ddmul320 multiply 90000 9000000000000000 -> 8.100000000000000E+20 Rounded
+ddmul321 multiply 900000 9000000000000000 -> 8.100000000000000E+21 Rounded
+ddmul322 multiply 9000000 9000000000000000 -> 8.100000000000000E+22 Rounded
+ddmul323 multiply 90000000 9000000000000000 -> 8.100000000000000E+23 Rounded
+
+-- tryzeros cases
+ddmul504 multiply 0E-260 1000E-260 -> 0E-398 Clamped
+ddmul505 multiply 100E+260 0E+260 -> 0E+369 Clamped
+-- 65K-1 case
+ddmul506 multiply 77.1 850 -> 65535.0
+
+-- mixed with zeros
+ddmul541 multiply 0 -1 -> -0
+ddmul542 multiply -0 -1 -> 0
+ddmul543 multiply 0 1 -> 0
+ddmul544 multiply -0 1 -> -0
+ddmul545 multiply -1 0 -> -0
+ddmul546 multiply -1 -0 -> 0
+ddmul547 multiply 1 0 -> 0
+ddmul548 multiply 1 -0 -> -0
+
+ddmul551 multiply 0.0 -1 -> -0.0
+ddmul552 multiply -0.0 -1 -> 0.0
+ddmul553 multiply 0.0 1 -> 0.0
+ddmul554 multiply -0.0 1 -> -0.0
+ddmul555 multiply -1.0 0 -> -0.0
+ddmul556 multiply -1.0 -0 -> 0.0
+ddmul557 multiply 1.0 0 -> 0.0
+ddmul558 multiply 1.0 -0 -> -0.0
+
+ddmul561 multiply 0 -1.0 -> -0.0
+ddmul562 multiply -0 -1.0 -> 0.0
+ddmul563 multiply 0 1.0 -> 0.0
+ddmul564 multiply -0 1.0 -> -0.0
+ddmul565 multiply -1 0.0 -> -0.0
+ddmul566 multiply -1 -0.0 -> 0.0
+ddmul567 multiply 1 0.0 -> 0.0
+ddmul568 multiply 1 -0.0 -> -0.0
+
+ddmul571 multiply 0.0 -1.0 -> -0.00
+ddmul572 multiply -0.0 -1.0 -> 0.00
+ddmul573 multiply 0.0 1.0 -> 0.00
+ddmul574 multiply -0.0 1.0 -> -0.00
+ddmul575 multiply -1.0 0.0 -> -0.00
+ddmul576 multiply -1.0 -0.0 -> 0.00
+ddmul577 multiply 1.0 0.0 -> 0.00
+ddmul578 multiply 1.0 -0.0 -> -0.00
+
+
+-- Specials
+ddmul580 multiply Inf -Inf -> -Infinity
+ddmul581 multiply Inf -1000 -> -Infinity
+ddmul582 multiply Inf -1 -> -Infinity
+ddmul583 multiply Inf -0 -> NaN Invalid_operation
+ddmul584 multiply Inf 0 -> NaN Invalid_operation
+ddmul585 multiply Inf 1 -> Infinity
+ddmul586 multiply Inf 1000 -> Infinity
+ddmul587 multiply Inf Inf -> Infinity
+ddmul588 multiply -1000 Inf -> -Infinity
+ddmul589 multiply -Inf Inf -> -Infinity
+ddmul590 multiply -1 Inf -> -Infinity
+ddmul591 multiply -0 Inf -> NaN Invalid_operation
+ddmul592 multiply 0 Inf -> NaN Invalid_operation
+ddmul593 multiply 1 Inf -> Infinity
+ddmul594 multiply 1000 Inf -> Infinity
+ddmul595 multiply Inf Inf -> Infinity
+
+ddmul600 multiply -Inf -Inf -> Infinity
+ddmul601 multiply -Inf -1000 -> Infinity
+ddmul602 multiply -Inf -1 -> Infinity
+ddmul603 multiply -Inf -0 -> NaN Invalid_operation
+ddmul604 multiply -Inf 0 -> NaN Invalid_operation
+ddmul605 multiply -Inf 1 -> -Infinity
+ddmul606 multiply -Inf 1000 -> -Infinity
+ddmul607 multiply -Inf Inf -> -Infinity
+ddmul608 multiply -1000 Inf -> -Infinity
+ddmul609 multiply -Inf -Inf -> Infinity
+ddmul610 multiply -1 -Inf -> Infinity
+ddmul611 multiply -0 -Inf -> NaN Invalid_operation
+ddmul612 multiply 0 -Inf -> NaN Invalid_operation
+ddmul613 multiply 1 -Inf -> -Infinity
+ddmul614 multiply 1000 -Inf -> -Infinity
+ddmul615 multiply Inf -Inf -> -Infinity
+
+ddmul621 multiply NaN -Inf -> NaN
+ddmul622 multiply NaN -1000 -> NaN
+ddmul623 multiply NaN -1 -> NaN
+ddmul624 multiply NaN -0 -> NaN
+ddmul625 multiply NaN 0 -> NaN
+ddmul626 multiply NaN 1 -> NaN
+ddmul627 multiply NaN 1000 -> NaN
+ddmul628 multiply NaN Inf -> NaN
+ddmul629 multiply NaN NaN -> NaN
+ddmul630 multiply -Inf NaN -> NaN
+ddmul631 multiply -1000 NaN -> NaN
+ddmul632 multiply -1 NaN -> NaN
+ddmul633 multiply -0 NaN -> NaN
+ddmul634 multiply 0 NaN -> NaN
+ddmul635 multiply 1 NaN -> NaN
+ddmul636 multiply 1000 NaN -> NaN
+ddmul637 multiply Inf NaN -> NaN
+
+ddmul641 multiply sNaN -Inf -> NaN Invalid_operation
+ddmul642 multiply sNaN -1000 -> NaN Invalid_operation
+ddmul643 multiply sNaN -1 -> NaN Invalid_operation
+ddmul644 multiply sNaN -0 -> NaN Invalid_operation
+ddmul645 multiply sNaN 0 -> NaN Invalid_operation
+ddmul646 multiply sNaN 1 -> NaN Invalid_operation
+ddmul647 multiply sNaN 1000 -> NaN Invalid_operation
+ddmul648 multiply sNaN NaN -> NaN Invalid_operation
+ddmul649 multiply sNaN sNaN -> NaN Invalid_operation
+ddmul650 multiply NaN sNaN -> NaN Invalid_operation
+ddmul651 multiply -Inf sNaN -> NaN Invalid_operation
+ddmul652 multiply -1000 sNaN -> NaN Invalid_operation
+ddmul653 multiply -1 sNaN -> NaN Invalid_operation
+ddmul654 multiply -0 sNaN -> NaN Invalid_operation
+ddmul655 multiply 0 sNaN -> NaN Invalid_operation
+ddmul656 multiply 1 sNaN -> NaN Invalid_operation
+ddmul657 multiply 1000 sNaN -> NaN Invalid_operation
+ddmul658 multiply Inf sNaN -> NaN Invalid_operation
+ddmul659 multiply NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddmul661 multiply NaN9 -Inf -> NaN9
+ddmul662 multiply NaN8 999 -> NaN8
+ddmul663 multiply NaN71 Inf -> NaN71
+ddmul664 multiply NaN6 NaN5 -> NaN6
+ddmul665 multiply -Inf NaN4 -> NaN4
+ddmul666 multiply -999 NaN33 -> NaN33
+ddmul667 multiply Inf NaN2 -> NaN2
+
+ddmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
+ddmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
+ddmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
+ddmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
+ddmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
+ddmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
+ddmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
+ddmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
+ddmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
+
+ddmul681 multiply -NaN9 -Inf -> -NaN9
+ddmul682 multiply -NaN8 999 -> -NaN8
+ddmul683 multiply -NaN71 Inf -> -NaN71
+ddmul684 multiply -NaN6 -NaN5 -> -NaN6
+ddmul685 multiply -Inf -NaN4 -> -NaN4
+ddmul686 multiply -999 -NaN33 -> -NaN33
+ddmul687 multiply Inf -NaN2 -> -NaN2
+
+ddmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
+ddmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
+ddmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
+ddmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
+ddmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+ddmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
+ddmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
+ddmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
+ddmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
+
+ddmul701 multiply -NaN -Inf -> -NaN
+ddmul702 multiply -NaN 999 -> -NaN
+ddmul703 multiply -NaN Inf -> -NaN
+ddmul704 multiply -NaN -NaN -> -NaN
+ddmul705 multiply -Inf -NaN0 -> -NaN
+ddmul706 multiply -999 -NaN -> -NaN
+ddmul707 multiply Inf -NaN -> -NaN
+
+ddmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
+ddmul712 multiply -sNaN -11 -> -NaN Invalid_operation
+ddmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
+ddmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
+ddmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
+ddmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
+ddmul717 multiply 088 -sNaN -> -NaN Invalid_operation
+ddmul718 multiply Inf -sNaN -> -NaN Invalid_operation
+ddmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+ddmul751 multiply 1e+277 1e+311 -> Infinity Overflow Inexact Rounded
+ddmul752 multiply 1e+277 -1e+311 -> -Infinity Overflow Inexact Rounded
+ddmul753 multiply -1e+277 1e+311 -> -Infinity Overflow Inexact Rounded
+ddmul754 multiply -1e+277 -1e+311 -> Infinity Overflow Inexact Rounded
+ddmul755 multiply 1e-277 1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul756 multiply 1e-277 -1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul757 multiply -1e-277 1e-311 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul758 multiply -1e-277 -1e-311 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+ddmul760 multiply 1e-291 1e-101 -> 1E-392 Subnormal
+ddmul761 multiply 1e-291 1e-102 -> 1E-393 Subnormal
+ddmul762 multiply 1e-291 1e-103 -> 1E-394 Subnormal
+ddmul763 multiply 1e-291 1e-104 -> 1E-395 Subnormal
+ddmul764 multiply 1e-291 1e-105 -> 1E-396 Subnormal
+ddmul765 multiply 1e-291 1e-106 -> 1E-397 Subnormal
+ddmul766 multiply 1e-291 1e-107 -> 1E-398 Subnormal
+ddmul767 multiply 1e-291 1e-108 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul768 multiply 1e-291 1e-109 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul769 multiply 1e-291 1e-110 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+ddmul770 multiply 1e+60 1e+321 -> 1.000000000000E+381 Clamped
+ddmul771 multiply 1e+60 1e+322 -> 1.0000000000000E+382 Clamped
+ddmul772 multiply 1e+60 1e+323 -> 1.00000000000000E+383 Clamped
+ddmul773 multiply 1e+60 1e+324 -> 1.000000000000000E+384 Clamped
+ddmul774 multiply 1e+60 1e+325 -> Infinity Overflow Inexact Rounded
+ddmul775 multiply 1e+60 1e+326 -> Infinity Overflow Inexact Rounded
+ddmul776 multiply 1e+60 1e+327 -> Infinity Overflow Inexact Rounded
+ddmul777 multiply 1e+60 1e+328 -> Infinity Overflow Inexact Rounded
+ddmul778 multiply 1e+60 1e+329 -> Infinity Overflow Inexact Rounded
+ddmul779 multiply 1e+60 1e+330 -> Infinity Overflow Inexact Rounded
+
+ddmul801 multiply 1.0000E-394 1 -> 1.0000E-394 Subnormal
+ddmul802 multiply 1.000E-394 1e-1 -> 1.000E-395 Subnormal
+ddmul803 multiply 1.00E-394 1e-2 -> 1.00E-396 Subnormal
+ddmul804 multiply 1.0E-394 1e-3 -> 1.0E-397 Subnormal
+ddmul805 multiply 1.0E-394 1e-4 -> 1E-398 Subnormal Rounded
+ddmul806 multiply 1.3E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddmul807 multiply 1.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul808 multiply 1.7E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul809 multiply 2.3E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul810 multiply 2.5E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul811 multiply 2.7E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
+ddmul812 multiply 1.49E-394 1e-4 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddmul813 multiply 1.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul814 multiply 1.51E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul815 multiply 2.49E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul816 multiply 2.50E-394 1e-4 -> 2E-398 Underflow Subnormal Inexact Rounded
+ddmul817 multiply 2.51E-394 1e-4 -> 3E-398 Underflow Subnormal Inexact Rounded
+
+ddmul818 multiply 1E-394 1e-4 -> 1E-398 Subnormal
+ddmul819 multiply 3E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul820 multiply 5E-394 1e-5 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul821 multiply 7E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddmul822 multiply 9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddmul823 multiply 9.9E-394 1e-5 -> 1E-398 Underflow Subnormal Inexact Rounded
+
+ddmul824 multiply 1E-394 -1e-4 -> -1E-398 Subnormal
+ddmul825 multiply 3E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul826 multiply -5E-394 1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul827 multiply 7E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddmul828 multiply -9E-394 1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddmul829 multiply 9.9E-394 -1e-5 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddmul830 multiply 3.0E-394 -1e-5 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+ddmul831 multiply 1.0E-199 1e-200 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddmul832 multiply 1.0E-199 1e-199 -> 1E-398 Subnormal Rounded
+ddmul833 multiply 1.0E-199 1e-198 -> 1.0E-397 Subnormal
+ddmul834 multiply 2.0E-199 2e-198 -> 4.0E-397 Subnormal
+ddmul835 multiply 4.0E-199 4e-198 -> 1.60E-396 Subnormal
+ddmul836 multiply 10.0E-199 10e-198 -> 1.000E-395 Subnormal
+ddmul837 multiply 30.0E-199 30e-198 -> 9.000E-395 Subnormal
+ddmul838 multiply 40.0E-199 40e-188 -> 1.6000E-384 Subnormal
+ddmul839 multiply 40.0E-199 40e-187 -> 1.6000E-383
+ddmul840 multiply 40.0E-199 40e-186 -> 1.6000E-382
+
+-- Long operand overflow may be a different path
+ddmul870 multiply 100 9.999E+383 -> Infinity Inexact Overflow Rounded
+ddmul871 multiply 100 -9.999E+383 -> -Infinity Inexact Overflow Rounded
+ddmul872 multiply 9.999E+383 100 -> Infinity Inexact Overflow Rounded
+ddmul873 multiply -9.999E+383 100 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+ddmul881 multiply 1.2347E-355 1.2347E-40 -> 1.524E-395 Inexact Rounded Subnormal Underflow
+ddmul882 multiply 1.234E-355 1.234E-40 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddmul883 multiply 1.23E-355 1.23E-40 -> 1.513E-395 Inexact Rounded Subnormal Underflow
+ddmul884 multiply 1.2E-355 1.2E-40 -> 1.44E-395 Subnormal
+ddmul885 multiply 1.2E-355 1.2E-41 -> 1.44E-396 Subnormal
+ddmul886 multiply 1.2E-355 1.2E-42 -> 1.4E-397 Subnormal Inexact Rounded Underflow
+ddmul887 multiply 1.2E-355 1.3E-42 -> 1.6E-397 Subnormal Inexact Rounded Underflow
+ddmul888 multiply 1.3E-355 1.3E-42 -> 1.7E-397 Subnormal Inexact Rounded Underflow
+ddmul889 multiply 1.3E-355 1.3E-43 -> 2E-398 Subnormal Inexact Rounded Underflow
+ddmul890 multiply 1.3E-356 1.3E-43 -> 0E-398 Clamped Subnormal Inexact Rounded Underflow
+
+ddmul891 multiply 1.2345E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
+ddmul892 multiply 1.23456E-39 1.234E-355 -> 1.5234E-394 Inexact Rounded Subnormal Underflow
+ddmul893 multiply 1.2345E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddmul894 multiply 1.23456E-40 1.234E-355 -> 1.523E-395 Inexact Rounded Subnormal Underflow
+ddmul895 multiply 1.2345E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
+ddmul896 multiply 1.23456E-41 1.234E-355 -> 1.52E-396 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+-- 1 234567890123456
+ddmul900 multiply 0.3000000000E-191 0.3000000000E-191 -> 9.00000000000000E-384 Subnormal Rounded
+ddmul901 multiply 0.3000000001E-191 0.3000000001E-191 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
+ddmul902 multiply 9.999999999999999E-383 0.0999999999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
+ddmul903 multiply 9.999999999999999E-383 0.09999999999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
+ddmul904 multiply 9.999999999999999E-383 0.099999999999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
+ddmul905 multiply 9.999999999999999E-383 0.0999999999999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
+-- The next rounds to Nmin (b**emin); this is the distinguishing case
+-- for detecting tininess (before or after rounding) -- if after
+-- rounding then the result would be the same, but the Underflow flag
+-- would not be set
+ddmul906 multiply 9.999999999999999E-383 0.09999999999999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+-- prove those operands were exact
+ddmul907 multiply 9.999999999999999E-383 1 -> 9.999999999999999E-383
+ddmul908 multiply 1 0.09999999999999999 -> 0.09999999999999999
+
+-- reducing tiniest
+ddmul910 multiply 1e-398 0.99 -> 1E-398 Subnormal Inexact Rounded Underflow
+ddmul911 multiply 1e-398 0.75 -> 1E-398 Subnormal Inexact Rounded Underflow
+ddmul912 multiply 1e-398 0.5 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+ddmul913 multiply 1e-398 0.25 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+ddmul914 multiply 1e-398 0.01 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+-- hugest
+ddmul920 multiply 9999999999999999 9999999999999999 -> 9.999999999999998E+31 Inexact Rounded
+
+-- power-of-ten edge cases
+ddmul1001 multiply 1 10 -> 10
+ddmul1002 multiply 1 100 -> 100
+ddmul1003 multiply 1 1000 -> 1000
+ddmul1004 multiply 1 10000 -> 10000
+ddmul1005 multiply 1 100000 -> 100000
+ddmul1006 multiply 1 1000000 -> 1000000
+ddmul1007 multiply 1 10000000 -> 10000000
+ddmul1008 multiply 1 100000000 -> 100000000
+ddmul1009 multiply 1 1000000000 -> 1000000000
+ddmul1010 multiply 1 10000000000 -> 10000000000
+ddmul1011 multiply 1 100000000000 -> 100000000000
+ddmul1012 multiply 1 1000000000000 -> 1000000000000
+ddmul1013 multiply 1 10000000000000 -> 10000000000000
+ddmul1014 multiply 1 100000000000000 -> 100000000000000
+ddmul1015 multiply 1 1000000000000000 -> 1000000000000000
+ddmul1021 multiply 10 1 -> 10
+ddmul1022 multiply 10 10 -> 100
+ddmul1023 multiply 10 100 -> 1000
+ddmul1024 multiply 10 1000 -> 10000
+ddmul1025 multiply 10 10000 -> 100000
+ddmul1026 multiply 10 100000 -> 1000000
+ddmul1027 multiply 10 1000000 -> 10000000
+ddmul1028 multiply 10 10000000 -> 100000000
+ddmul1029 multiply 10 100000000 -> 1000000000
+ddmul1030 multiply 10 1000000000 -> 10000000000
+ddmul1031 multiply 10 10000000000 -> 100000000000
+ddmul1032 multiply 10 100000000000 -> 1000000000000
+ddmul1033 multiply 10 1000000000000 -> 10000000000000
+ddmul1034 multiply 10 10000000000000 -> 100000000000000
+ddmul1035 multiply 10 100000000000000 -> 1000000000000000
+ddmul1041 multiply 100 0.1 -> 10.0
+ddmul1042 multiply 100 1 -> 100
+ddmul1043 multiply 100 10 -> 1000
+ddmul1044 multiply 100 100 -> 10000
+ddmul1045 multiply 100 1000 -> 100000
+ddmul1046 multiply 100 10000 -> 1000000
+ddmul1047 multiply 100 100000 -> 10000000
+ddmul1048 multiply 100 1000000 -> 100000000
+ddmul1049 multiply 100 10000000 -> 1000000000
+ddmul1050 multiply 100 100000000 -> 10000000000
+ddmul1051 multiply 100 1000000000 -> 100000000000
+ddmul1052 multiply 100 10000000000 -> 1000000000000
+ddmul1053 multiply 100 100000000000 -> 10000000000000
+ddmul1054 multiply 100 1000000000000 -> 100000000000000
+ddmul1055 multiply 100 10000000000000 -> 1000000000000000
+ddmul1061 multiply 1000 0.01 -> 10.00
+ddmul1062 multiply 1000 0.1 -> 100.0
+ddmul1063 multiply 1000 1 -> 1000
+ddmul1064 multiply 1000 10 -> 10000
+ddmul1065 multiply 1000 100 -> 100000
+ddmul1066 multiply 1000 1000 -> 1000000
+ddmul1067 multiply 1000 10000 -> 10000000
+ddmul1068 multiply 1000 100000 -> 100000000
+ddmul1069 multiply 1000 1000000 -> 1000000000
+ddmul1070 multiply 1000 10000000 -> 10000000000
+ddmul1071 multiply 1000 100000000 -> 100000000000
+ddmul1072 multiply 1000 1000000000 -> 1000000000000
+ddmul1073 multiply 1000 10000000000 -> 10000000000000
+ddmul1074 multiply 1000 100000000000 -> 100000000000000
+ddmul1075 multiply 1000 1000000000000 -> 1000000000000000
+ddmul1081 multiply 10000 0.001 -> 10.000
+ddmul1082 multiply 10000 0.01 -> 100.00
+ddmul1083 multiply 10000 0.1 -> 1000.0
+ddmul1084 multiply 10000 1 -> 10000
+ddmul1085 multiply 10000 10 -> 100000
+ddmul1086 multiply 10000 100 -> 1000000
+ddmul1087 multiply 10000 1000 -> 10000000
+ddmul1088 multiply 10000 10000 -> 100000000
+ddmul1089 multiply 10000 100000 -> 1000000000
+ddmul1090 multiply 10000 1000000 -> 10000000000
+ddmul1091 multiply 10000 10000000 -> 100000000000
+ddmul1092 multiply 10000 100000000 -> 1000000000000
+ddmul1093 multiply 10000 1000000000 -> 10000000000000
+ddmul1094 multiply 10000 10000000000 -> 100000000000000
+ddmul1095 multiply 10000 100000000000 -> 1000000000000000
+
+ddmul1097 multiply 10000 99999999999 -> 999999999990000
+ddmul1098 multiply 10000 99999999999 -> 999999999990000
+
+
+-- Null tests
+ddmul9990 multiply 10 # -> NaN Invalid_operation
+ddmul9991 multiply # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddNextMinus.decTest b/Lib/test/decimaltestdata/ddNextMinus.decTest
index f8a3c0eb32..39f58c14a4 100644
--- a/Lib/test/decimaltestdata/ddNextMinus.decTest
+++ b/Lib/test/decimaltestdata/ddNextMinus.decTest
@@ -1,126 +1,126 @@
-------------------------------------------------------------------------
--- ddNextMinus.decTest -- decDouble next that is less [754r nextdown] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddnextm001 nextminus 0.9999999999999995 -> 0.9999999999999994
-ddnextm002 nextminus 0.9999999999999996 -> 0.9999999999999995
-ddnextm003 nextminus 0.9999999999999997 -> 0.9999999999999996
-ddnextm004 nextminus 0.9999999999999998 -> 0.9999999999999997
-ddnextm005 nextminus 0.9999999999999999 -> 0.9999999999999998
-ddnextm006 nextminus 1.000000000000000 -> 0.9999999999999999
-ddnextm007 nextminus 1.0 -> 0.9999999999999999
-ddnextm008 nextminus 1 -> 0.9999999999999999
-ddnextm009 nextminus 1.000000000000001 -> 1.000000000000000
-ddnextm010 nextminus 1.000000000000002 -> 1.000000000000001
-ddnextm011 nextminus 1.000000000000003 -> 1.000000000000002
-ddnextm012 nextminus 1.000000000000004 -> 1.000000000000003
-ddnextm013 nextminus 1.000000000000005 -> 1.000000000000004
-ddnextm014 nextminus 1.000000000000006 -> 1.000000000000005
-ddnextm015 nextminus 1.000000000000007 -> 1.000000000000006
-ddnextm016 nextminus 1.000000000000008 -> 1.000000000000007
-ddnextm017 nextminus 1.000000000000009 -> 1.000000000000008
-ddnextm018 nextminus 1.000000000000010 -> 1.000000000000009
-ddnextm019 nextminus 1.000000000000011 -> 1.000000000000010
-ddnextm020 nextminus 1.000000000000012 -> 1.000000000000011
-
-ddnextm021 nextminus -0.9999999999999995 -> -0.9999999999999996
-ddnextm022 nextminus -0.9999999999999996 -> -0.9999999999999997
-ddnextm023 nextminus -0.9999999999999997 -> -0.9999999999999998
-ddnextm024 nextminus -0.9999999999999998 -> -0.9999999999999999
-ddnextm025 nextminus -0.9999999999999999 -> -1.000000000000000
-ddnextm026 nextminus -1.000000000000000 -> -1.000000000000001
-ddnextm027 nextminus -1.0 -> -1.000000000000001
-ddnextm028 nextminus -1 -> -1.000000000000001
-ddnextm029 nextminus -1.000000000000001 -> -1.000000000000002
-ddnextm030 nextminus -1.000000000000002 -> -1.000000000000003
-ddnextm031 nextminus -1.000000000000003 -> -1.000000000000004
-ddnextm032 nextminus -1.000000000000004 -> -1.000000000000005
-ddnextm033 nextminus -1.000000000000005 -> -1.000000000000006
-ddnextm034 nextminus -1.000000000000006 -> -1.000000000000007
-ddnextm035 nextminus -1.000000000000007 -> -1.000000000000008
-ddnextm036 nextminus -1.000000000000008 -> -1.000000000000009
-ddnextm037 nextminus -1.000000000000009 -> -1.000000000000010
-ddnextm038 nextminus -1.000000000000010 -> -1.000000000000011
-ddnextm039 nextminus -1.000000000000011 -> -1.000000000000012
-
--- ultra-tiny inputs
-ddnextm062 nextminus 1E-398 -> 0E-398
-ddnextm065 nextminus -1E-398 -> -2E-398
-
--- Zeros
-ddnextm100 nextminus -0 -> -1E-398
-ddnextm101 nextminus 0 -> -1E-398
-ddnextm102 nextminus 0.00 -> -1E-398
-ddnextm103 nextminus -0.00 -> -1E-398
-ddnextm104 nextminus 0E-300 -> -1E-398
-ddnextm105 nextminus 0E+300 -> -1E-398
-ddnextm106 nextminus 0E+30000 -> -1E-398
-ddnextm107 nextminus -0E+30000 -> -1E-398
-
--- specials
-ddnextm150 nextminus Inf -> 9.999999999999999E+384
-ddnextm151 nextminus -Inf -> -Infinity
-ddnextm152 nextminus NaN -> NaN
-ddnextm153 nextminus sNaN -> NaN Invalid_operation
-ddnextm154 nextminus NaN77 -> NaN77
-ddnextm155 nextminus sNaN88 -> NaN88 Invalid_operation
-ddnextm156 nextminus -NaN -> -NaN
-ddnextm157 nextminus -sNaN -> -NaN Invalid_operation
-ddnextm158 nextminus -NaN77 -> -NaN77
-ddnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-ddnextm170 nextminus 9.999999999999999E+384 -> 9.999999999999998E+384
-ddnextm171 nextminus 9.999999999999998E+384 -> 9.999999999999997E+384
-ddnextm172 nextminus 1E-383 -> 9.99999999999999E-384
-ddnextm173 nextminus 1.000000000000000E-383 -> 9.99999999999999E-384
-ddnextm174 nextminus 9E-398 -> 8E-398
-ddnextm175 nextminus 9.9E-397 -> 9.8E-397
-ddnextm176 nextminus 9.99999999999E-387 -> 9.99999999998E-387
-ddnextm177 nextminus 9.99999999999999E-384 -> 9.99999999999998E-384
-ddnextm178 nextminus 9.99999999999998E-384 -> 9.99999999999997E-384
-ddnextm179 nextminus 9.99999999999997E-384 -> 9.99999999999996E-384
-ddnextm180 nextminus 0E-398 -> -1E-398
-ddnextm181 nextminus 1E-398 -> 0E-398
-ddnextm182 nextminus 2E-398 -> 1E-398
-
-ddnextm183 nextminus -0E-398 -> -1E-398
-ddnextm184 nextminus -1E-398 -> -2E-398
-ddnextm185 nextminus -2E-398 -> -3E-398
-ddnextm186 nextminus -10E-398 -> -1.1E-397
-ddnextm187 nextminus -100E-398 -> -1.01E-396
-ddnextm188 nextminus -100000E-398 -> -1.00001E-393
-ddnextm189 nextminus -1.00000000000E-383 -> -1.000000000000001E-383
-ddnextm190 nextminus -1.000000000000000E-383 -> -1.000000000000001E-383
-ddnextm191 nextminus -1E-383 -> -1.000000000000001E-383
-ddnextm192 nextminus -9.999999999999998E+384 -> -9.999999999999999E+384
-ddnextm193 nextminus -9.999999999999999E+384 -> -Infinity
-
--- Null tests
-ddnextm900 nextminus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddNextMinus.decTest -- decDouble next that is less [754r nextdown] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddnextm001 nextminus 0.9999999999999995 -> 0.9999999999999994
+ddnextm002 nextminus 0.9999999999999996 -> 0.9999999999999995
+ddnextm003 nextminus 0.9999999999999997 -> 0.9999999999999996
+ddnextm004 nextminus 0.9999999999999998 -> 0.9999999999999997
+ddnextm005 nextminus 0.9999999999999999 -> 0.9999999999999998
+ddnextm006 nextminus 1.000000000000000 -> 0.9999999999999999
+ddnextm007 nextminus 1.0 -> 0.9999999999999999
+ddnextm008 nextminus 1 -> 0.9999999999999999
+ddnextm009 nextminus 1.000000000000001 -> 1.000000000000000
+ddnextm010 nextminus 1.000000000000002 -> 1.000000000000001
+ddnextm011 nextminus 1.000000000000003 -> 1.000000000000002
+ddnextm012 nextminus 1.000000000000004 -> 1.000000000000003
+ddnextm013 nextminus 1.000000000000005 -> 1.000000000000004
+ddnextm014 nextminus 1.000000000000006 -> 1.000000000000005
+ddnextm015 nextminus 1.000000000000007 -> 1.000000000000006
+ddnextm016 nextminus 1.000000000000008 -> 1.000000000000007
+ddnextm017 nextminus 1.000000000000009 -> 1.000000000000008
+ddnextm018 nextminus 1.000000000000010 -> 1.000000000000009
+ddnextm019 nextminus 1.000000000000011 -> 1.000000000000010
+ddnextm020 nextminus 1.000000000000012 -> 1.000000000000011
+
+ddnextm021 nextminus -0.9999999999999995 -> -0.9999999999999996
+ddnextm022 nextminus -0.9999999999999996 -> -0.9999999999999997
+ddnextm023 nextminus -0.9999999999999997 -> -0.9999999999999998
+ddnextm024 nextminus -0.9999999999999998 -> -0.9999999999999999
+ddnextm025 nextminus -0.9999999999999999 -> -1.000000000000000
+ddnextm026 nextminus -1.000000000000000 -> -1.000000000000001
+ddnextm027 nextminus -1.0 -> -1.000000000000001
+ddnextm028 nextminus -1 -> -1.000000000000001
+ddnextm029 nextminus -1.000000000000001 -> -1.000000000000002
+ddnextm030 nextminus -1.000000000000002 -> -1.000000000000003
+ddnextm031 nextminus -1.000000000000003 -> -1.000000000000004
+ddnextm032 nextminus -1.000000000000004 -> -1.000000000000005
+ddnextm033 nextminus -1.000000000000005 -> -1.000000000000006
+ddnextm034 nextminus -1.000000000000006 -> -1.000000000000007
+ddnextm035 nextminus -1.000000000000007 -> -1.000000000000008
+ddnextm036 nextminus -1.000000000000008 -> -1.000000000000009
+ddnextm037 nextminus -1.000000000000009 -> -1.000000000000010
+ddnextm038 nextminus -1.000000000000010 -> -1.000000000000011
+ddnextm039 nextminus -1.000000000000011 -> -1.000000000000012
+
+-- ultra-tiny inputs
+ddnextm062 nextminus 1E-398 -> 0E-398
+ddnextm065 nextminus -1E-398 -> -2E-398
+
+-- Zeros
+ddnextm100 nextminus -0 -> -1E-398
+ddnextm101 nextminus 0 -> -1E-398
+ddnextm102 nextminus 0.00 -> -1E-398
+ddnextm103 nextminus -0.00 -> -1E-398
+ddnextm104 nextminus 0E-300 -> -1E-398
+ddnextm105 nextminus 0E+300 -> -1E-398
+ddnextm106 nextminus 0E+30000 -> -1E-398
+ddnextm107 nextminus -0E+30000 -> -1E-398
+
+-- specials
+ddnextm150 nextminus Inf -> 9.999999999999999E+384
+ddnextm151 nextminus -Inf -> -Infinity
+ddnextm152 nextminus NaN -> NaN
+ddnextm153 nextminus sNaN -> NaN Invalid_operation
+ddnextm154 nextminus NaN77 -> NaN77
+ddnextm155 nextminus sNaN88 -> NaN88 Invalid_operation
+ddnextm156 nextminus -NaN -> -NaN
+ddnextm157 nextminus -sNaN -> -NaN Invalid_operation
+ddnextm158 nextminus -NaN77 -> -NaN77
+ddnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+ddnextm170 nextminus 9.999999999999999E+384 -> 9.999999999999998E+384
+ddnextm171 nextminus 9.999999999999998E+384 -> 9.999999999999997E+384
+ddnextm172 nextminus 1E-383 -> 9.99999999999999E-384
+ddnextm173 nextminus 1.000000000000000E-383 -> 9.99999999999999E-384
+ddnextm174 nextminus 9E-398 -> 8E-398
+ddnextm175 nextminus 9.9E-397 -> 9.8E-397
+ddnextm176 nextminus 9.99999999999E-387 -> 9.99999999998E-387
+ddnextm177 nextminus 9.99999999999999E-384 -> 9.99999999999998E-384
+ddnextm178 nextminus 9.99999999999998E-384 -> 9.99999999999997E-384
+ddnextm179 nextminus 9.99999999999997E-384 -> 9.99999999999996E-384
+ddnextm180 nextminus 0E-398 -> -1E-398
+ddnextm181 nextminus 1E-398 -> 0E-398
+ddnextm182 nextminus 2E-398 -> 1E-398
+
+ddnextm183 nextminus -0E-398 -> -1E-398
+ddnextm184 nextminus -1E-398 -> -2E-398
+ddnextm185 nextminus -2E-398 -> -3E-398
+ddnextm186 nextminus -10E-398 -> -1.1E-397
+ddnextm187 nextminus -100E-398 -> -1.01E-396
+ddnextm188 nextminus -100000E-398 -> -1.00001E-393
+ddnextm189 nextminus -1.00000000000E-383 -> -1.000000000000001E-383
+ddnextm190 nextminus -1.000000000000000E-383 -> -1.000000000000001E-383
+ddnextm191 nextminus -1E-383 -> -1.000000000000001E-383
+ddnextm192 nextminus -9.999999999999998E+384 -> -9.999999999999999E+384
+ddnextm193 nextminus -9.999999999999999E+384 -> -Infinity
+
+-- Null tests
+ddnextm900 nextminus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddNextPlus.decTest b/Lib/test/decimaltestdata/ddNextPlus.decTest
index 4a749a18c9..d41dfbab3f 100644
--- a/Lib/test/decimaltestdata/ddNextPlus.decTest
+++ b/Lib/test/decimaltestdata/ddNextPlus.decTest
@@ -1,124 +1,124 @@
-------------------------------------------------------------------------
--- ddNextPlus.decTest -- decDouble next that is greater [754r nextup] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddnextp001 nextplus 0.9999999999999995 -> 0.9999999999999996
-ddnextp002 nextplus 0.9999999999999996 -> 0.9999999999999997
-ddnextp003 nextplus 0.9999999999999997 -> 0.9999999999999998
-ddnextp004 nextplus 0.9999999999999998 -> 0.9999999999999999
-ddnextp005 nextplus 0.9999999999999999 -> 1.000000000000000
-ddnextp006 nextplus 1.000000000000000 -> 1.000000000000001
-ddnextp007 nextplus 1.0 -> 1.000000000000001
-ddnextp008 nextplus 1 -> 1.000000000000001
-ddnextp009 nextplus 1.000000000000001 -> 1.000000000000002
-ddnextp010 nextplus 1.000000000000002 -> 1.000000000000003
-ddnextp011 nextplus 1.000000000000003 -> 1.000000000000004
-ddnextp012 nextplus 1.000000000000004 -> 1.000000000000005
-ddnextp013 nextplus 1.000000000000005 -> 1.000000000000006
-ddnextp014 nextplus 1.000000000000006 -> 1.000000000000007
-ddnextp015 nextplus 1.000000000000007 -> 1.000000000000008
-ddnextp016 nextplus 1.000000000000008 -> 1.000000000000009
-ddnextp017 nextplus 1.000000000000009 -> 1.000000000000010
-ddnextp018 nextplus 1.000000000000010 -> 1.000000000000011
-ddnextp019 nextplus 1.000000000000011 -> 1.000000000000012
-
-ddnextp021 nextplus -0.9999999999999995 -> -0.9999999999999994
-ddnextp022 nextplus -0.9999999999999996 -> -0.9999999999999995
-ddnextp023 nextplus -0.9999999999999997 -> -0.9999999999999996
-ddnextp024 nextplus -0.9999999999999998 -> -0.9999999999999997
-ddnextp025 nextplus -0.9999999999999999 -> -0.9999999999999998
-ddnextp026 nextplus -1.000000000000000 -> -0.9999999999999999
-ddnextp027 nextplus -1.0 -> -0.9999999999999999
-ddnextp028 nextplus -1 -> -0.9999999999999999
-ddnextp029 nextplus -1.000000000000001 -> -1.000000000000000
-ddnextp030 nextplus -1.000000000000002 -> -1.000000000000001
-ddnextp031 nextplus -1.000000000000003 -> -1.000000000000002
-ddnextp032 nextplus -1.000000000000004 -> -1.000000000000003
-ddnextp033 nextplus -1.000000000000005 -> -1.000000000000004
-ddnextp034 nextplus -1.000000000000006 -> -1.000000000000005
-ddnextp035 nextplus -1.000000000000007 -> -1.000000000000006
-ddnextp036 nextplus -1.000000000000008 -> -1.000000000000007
-ddnextp037 nextplus -1.000000000000009 -> -1.000000000000008
-ddnextp038 nextplus -1.000000000000010 -> -1.000000000000009
-ddnextp039 nextplus -1.000000000000011 -> -1.000000000000010
-ddnextp040 nextplus -1.000000000000012 -> -1.000000000000011
-
--- Zeros
-ddnextp100 nextplus 0 -> 1E-398
-ddnextp101 nextplus 0.00 -> 1E-398
-ddnextp102 nextplus 0E-300 -> 1E-398
-ddnextp103 nextplus 0E+300 -> 1E-398
-ddnextp104 nextplus 0E+30000 -> 1E-398
-ddnextp105 nextplus -0 -> 1E-398
-ddnextp106 nextplus -0.00 -> 1E-398
-ddnextp107 nextplus -0E-300 -> 1E-398
-ddnextp108 nextplus -0E+300 -> 1E-398
-ddnextp109 nextplus -0E+30000 -> 1E-398
-
--- specials
-ddnextp150 nextplus Inf -> Infinity
-ddnextp151 nextplus -Inf -> -9.999999999999999E+384
-ddnextp152 nextplus NaN -> NaN
-ddnextp153 nextplus sNaN -> NaN Invalid_operation
-ddnextp154 nextplus NaN77 -> NaN77
-ddnextp155 nextplus sNaN88 -> NaN88 Invalid_operation
-ddnextp156 nextplus -NaN -> -NaN
-ddnextp157 nextplus -sNaN -> -NaN Invalid_operation
-ddnextp158 nextplus -NaN77 -> -NaN77
-ddnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-ddnextp170 nextplus -9.999999999999999E+384 -> -9.999999999999998E+384
-ddnextp171 nextplus -9.999999999999998E+384 -> -9.999999999999997E+384
-ddnextp172 nextplus -1E-383 -> -9.99999999999999E-384
-ddnextp173 nextplus -1.000000000000000E-383 -> -9.99999999999999E-384
-ddnextp174 nextplus -9E-398 -> -8E-398
-ddnextp175 nextplus -9.9E-397 -> -9.8E-397
-ddnextp176 nextplus -9.99999999999E-387 -> -9.99999999998E-387
-ddnextp177 nextplus -9.99999999999999E-384 -> -9.99999999999998E-384
-ddnextp178 nextplus -9.99999999999998E-384 -> -9.99999999999997E-384
-ddnextp179 nextplus -9.99999999999997E-384 -> -9.99999999999996E-384
-ddnextp180 nextplus -0E-398 -> 1E-398
-ddnextp181 nextplus -1E-398 -> -0E-398
-ddnextp182 nextplus -2E-398 -> -1E-398
-
-ddnextp183 nextplus 0E-398 -> 1E-398
-ddnextp184 nextplus 1E-398 -> 2E-398
-ddnextp185 nextplus 2E-398 -> 3E-398
-ddnextp186 nextplus 10E-398 -> 1.1E-397
-ddnextp187 nextplus 100E-398 -> 1.01E-396
-ddnextp188 nextplus 100000E-398 -> 1.00001E-393
-ddnextp189 nextplus 1.00000000000E-383 -> 1.000000000000001E-383
-ddnextp190 nextplus 1.000000000000000E-383 -> 1.000000000000001E-383
-ddnextp191 nextplus 1E-383 -> 1.000000000000001E-383
-ddnextp192 nextplus 9.999999999999998E+384 -> 9.999999999999999E+384
-ddnextp193 nextplus 9.999999999999999E+384 -> Infinity
-
--- Null tests
-ddnextp900 nextplus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddNextPlus.decTest -- decDouble next that is greater [754r nextup] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddnextp001 nextplus 0.9999999999999995 -> 0.9999999999999996
+ddnextp002 nextplus 0.9999999999999996 -> 0.9999999999999997
+ddnextp003 nextplus 0.9999999999999997 -> 0.9999999999999998
+ddnextp004 nextplus 0.9999999999999998 -> 0.9999999999999999
+ddnextp005 nextplus 0.9999999999999999 -> 1.000000000000000
+ddnextp006 nextplus 1.000000000000000 -> 1.000000000000001
+ddnextp007 nextplus 1.0 -> 1.000000000000001
+ddnextp008 nextplus 1 -> 1.000000000000001
+ddnextp009 nextplus 1.000000000000001 -> 1.000000000000002
+ddnextp010 nextplus 1.000000000000002 -> 1.000000000000003
+ddnextp011 nextplus 1.000000000000003 -> 1.000000000000004
+ddnextp012 nextplus 1.000000000000004 -> 1.000000000000005
+ddnextp013 nextplus 1.000000000000005 -> 1.000000000000006
+ddnextp014 nextplus 1.000000000000006 -> 1.000000000000007
+ddnextp015 nextplus 1.000000000000007 -> 1.000000000000008
+ddnextp016 nextplus 1.000000000000008 -> 1.000000000000009
+ddnextp017 nextplus 1.000000000000009 -> 1.000000000000010
+ddnextp018 nextplus 1.000000000000010 -> 1.000000000000011
+ddnextp019 nextplus 1.000000000000011 -> 1.000000000000012
+
+ddnextp021 nextplus -0.9999999999999995 -> -0.9999999999999994
+ddnextp022 nextplus -0.9999999999999996 -> -0.9999999999999995
+ddnextp023 nextplus -0.9999999999999997 -> -0.9999999999999996
+ddnextp024 nextplus -0.9999999999999998 -> -0.9999999999999997
+ddnextp025 nextplus -0.9999999999999999 -> -0.9999999999999998
+ddnextp026 nextplus -1.000000000000000 -> -0.9999999999999999
+ddnextp027 nextplus -1.0 -> -0.9999999999999999
+ddnextp028 nextplus -1 -> -0.9999999999999999
+ddnextp029 nextplus -1.000000000000001 -> -1.000000000000000
+ddnextp030 nextplus -1.000000000000002 -> -1.000000000000001
+ddnextp031 nextplus -1.000000000000003 -> -1.000000000000002
+ddnextp032 nextplus -1.000000000000004 -> -1.000000000000003
+ddnextp033 nextplus -1.000000000000005 -> -1.000000000000004
+ddnextp034 nextplus -1.000000000000006 -> -1.000000000000005
+ddnextp035 nextplus -1.000000000000007 -> -1.000000000000006
+ddnextp036 nextplus -1.000000000000008 -> -1.000000000000007
+ddnextp037 nextplus -1.000000000000009 -> -1.000000000000008
+ddnextp038 nextplus -1.000000000000010 -> -1.000000000000009
+ddnextp039 nextplus -1.000000000000011 -> -1.000000000000010
+ddnextp040 nextplus -1.000000000000012 -> -1.000000000000011
+
+-- Zeros
+ddnextp100 nextplus 0 -> 1E-398
+ddnextp101 nextplus 0.00 -> 1E-398
+ddnextp102 nextplus 0E-300 -> 1E-398
+ddnextp103 nextplus 0E+300 -> 1E-398
+ddnextp104 nextplus 0E+30000 -> 1E-398
+ddnextp105 nextplus -0 -> 1E-398
+ddnextp106 nextplus -0.00 -> 1E-398
+ddnextp107 nextplus -0E-300 -> 1E-398
+ddnextp108 nextplus -0E+300 -> 1E-398
+ddnextp109 nextplus -0E+30000 -> 1E-398
+
+-- specials
+ddnextp150 nextplus Inf -> Infinity
+ddnextp151 nextplus -Inf -> -9.999999999999999E+384
+ddnextp152 nextplus NaN -> NaN
+ddnextp153 nextplus sNaN -> NaN Invalid_operation
+ddnextp154 nextplus NaN77 -> NaN77
+ddnextp155 nextplus sNaN88 -> NaN88 Invalid_operation
+ddnextp156 nextplus -NaN -> -NaN
+ddnextp157 nextplus -sNaN -> -NaN Invalid_operation
+ddnextp158 nextplus -NaN77 -> -NaN77
+ddnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+ddnextp170 nextplus -9.999999999999999E+384 -> -9.999999999999998E+384
+ddnextp171 nextplus -9.999999999999998E+384 -> -9.999999999999997E+384
+ddnextp172 nextplus -1E-383 -> -9.99999999999999E-384
+ddnextp173 nextplus -1.000000000000000E-383 -> -9.99999999999999E-384
+ddnextp174 nextplus -9E-398 -> -8E-398
+ddnextp175 nextplus -9.9E-397 -> -9.8E-397
+ddnextp176 nextplus -9.99999999999E-387 -> -9.99999999998E-387
+ddnextp177 nextplus -9.99999999999999E-384 -> -9.99999999999998E-384
+ddnextp178 nextplus -9.99999999999998E-384 -> -9.99999999999997E-384
+ddnextp179 nextplus -9.99999999999997E-384 -> -9.99999999999996E-384
+ddnextp180 nextplus -0E-398 -> 1E-398
+ddnextp181 nextplus -1E-398 -> -0E-398
+ddnextp182 nextplus -2E-398 -> -1E-398
+
+ddnextp183 nextplus 0E-398 -> 1E-398
+ddnextp184 nextplus 1E-398 -> 2E-398
+ddnextp185 nextplus 2E-398 -> 3E-398
+ddnextp186 nextplus 10E-398 -> 1.1E-397
+ddnextp187 nextplus 100E-398 -> 1.01E-396
+ddnextp188 nextplus 100000E-398 -> 1.00001E-393
+ddnextp189 nextplus 1.00000000000E-383 -> 1.000000000000001E-383
+ddnextp190 nextplus 1.000000000000000E-383 -> 1.000000000000001E-383
+ddnextp191 nextplus 1E-383 -> 1.000000000000001E-383
+ddnextp192 nextplus 9.999999999999998E+384 -> 9.999999999999999E+384
+ddnextp193 nextplus 9.999999999999999E+384 -> Infinity
+
+-- Null tests
+ddnextp900 nextplus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddNextToward.decTest b/Lib/test/decimaltestdata/ddNextToward.decTest
index 75386add31..f9e474d70f 100644
--- a/Lib/test/decimaltestdata/ddNextToward.decTest
+++ b/Lib/test/decimaltestdata/ddNextToward.decTest
@@ -1,374 +1,374 @@
-------------------------------------------------------------------------
--- ddNextToward.decTest -- decDouble next toward rhs [754r nextafter] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check with a scattering of numerics
-ddnextt001 nexttoward 10 10 -> 10
-ddnextt002 nexttoward -10 -10 -> -10
-ddnextt003 nexttoward 1 10 -> 1.000000000000001
-ddnextt004 nexttoward 1 -10 -> 0.9999999999999999
-ddnextt005 nexttoward -1 10 -> -0.9999999999999999
-ddnextt006 nexttoward -1 -10 -> -1.000000000000001
-ddnextt007 nexttoward 0 10 -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt008 nexttoward 0 -10 -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt009 nexttoward 9.999999999999999E+384 +Infinity -> Infinity Overflow Inexact Rounded
-ddnextt010 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
-ddnextt011 nexttoward 9.999999999999999 10 -> 10.00000000000000
-ddnextt012 nexttoward 10 9.999999999999999 -> 9.999999999999999
-ddnextt013 nexttoward -9.999999999999999 -10 -> -10.00000000000000
-ddnextt014 nexttoward -10 -9.999999999999999 -> -9.999999999999999
-ddnextt015 nexttoward 9.999999999999998 10 -> 9.999999999999999
-ddnextt016 nexttoward 10 9.999999999999998 -> 9.999999999999999
-ddnextt017 nexttoward -9.999999999999998 -10 -> -9.999999999999999
-ddnextt018 nexttoward -10 -9.999999999999998 -> -9.999999999999999
-
-------- lhs=rhs
--- finites
-ddnextt101 nexttoward 7 7 -> 7
-ddnextt102 nexttoward -7 -7 -> -7
-ddnextt103 nexttoward 75 75 -> 75
-ddnextt104 nexttoward -75 -75 -> -75
-ddnextt105 nexttoward 7.50 7.5 -> 7.50
-ddnextt106 nexttoward -7.50 -7.50 -> -7.50
-ddnextt107 nexttoward 7.500 7.5000 -> 7.500
-ddnextt108 nexttoward -7.500 -7.5 -> -7.500
-
--- zeros
-ddnextt111 nexttoward 0 0 -> 0
-ddnextt112 nexttoward -0 -0 -> -0
-ddnextt113 nexttoward 0E+4 0 -> 0E+4
-ddnextt114 nexttoward -0E+4 -0 -> -0E+4
-ddnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11
-ddnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11
-ddnextt117 nexttoward 0E-141 0 -> 0E-141
-ddnextt118 nexttoward -0E-141 -000 -> -0E-141
-
--- full coefficients, alternating bits
-ddnextt121 nexttoward 268268268 268268268 -> 268268268
-ddnextt122 nexttoward -268268268 -268268268 -> -268268268
-ddnextt123 nexttoward 134134134 134134134 -> 134134134
-ddnextt124 nexttoward -134134134 -134134134 -> -134134134
-
--- Nmax, Nmin, Ntiny
-ddnextt131 nexttoward 9.999999999999999E+384 9.999999999999999E+384 -> 9.999999999999999E+384
-ddnextt132 nexttoward 1E-383 1E-383 -> 1E-383
-ddnextt133 nexttoward 1.000000000000000E-383 1.000000000000000E-383 -> 1.000000000000000E-383
-ddnextt134 nexttoward 1E-398 1E-398 -> 1E-398
-
-ddnextt135 nexttoward -1E-398 -1E-398 -> -1E-398
-ddnextt136 nexttoward -1.000000000000000E-383 -1.000000000000000E-383 -> -1.000000000000000E-383
-ddnextt137 nexttoward -1E-383 -1E-383 -> -1E-383
-ddnextt138 nexttoward -9.999999999999999E+384 -9.999999999999999E+384 -> -9.999999999999999E+384
-
-------- lhs<rhs
-ddnextt201 nexttoward 0.9999999999999995 Infinity -> 0.9999999999999996
-ddnextt202 nexttoward 0.9999999999999996 Infinity -> 0.9999999999999997
-ddnextt203 nexttoward 0.9999999999999997 Infinity -> 0.9999999999999998
-ddnextt204 nexttoward 0.9999999999999998 Infinity -> 0.9999999999999999
-ddnextt205 nexttoward 0.9999999999999999 Infinity -> 1.000000000000000
-ddnextt206 nexttoward 1.000000000000000 Infinity -> 1.000000000000001
-ddnextt207 nexttoward 1.0 Infinity -> 1.000000000000001
-ddnextt208 nexttoward 1 Infinity -> 1.000000000000001
-ddnextt209 nexttoward 1.000000000000001 Infinity -> 1.000000000000002
-ddnextt210 nexttoward 1.000000000000002 Infinity -> 1.000000000000003
-ddnextt211 nexttoward 1.000000000000003 Infinity -> 1.000000000000004
-ddnextt212 nexttoward 1.000000000000004 Infinity -> 1.000000000000005
-ddnextt213 nexttoward 1.000000000000005 Infinity -> 1.000000000000006
-ddnextt214 nexttoward 1.000000000000006 Infinity -> 1.000000000000007
-ddnextt215 nexttoward 1.000000000000007 Infinity -> 1.000000000000008
-ddnextt216 nexttoward 1.000000000000008 Infinity -> 1.000000000000009
-ddnextt217 nexttoward 1.000000000000009 Infinity -> 1.000000000000010
-ddnextt218 nexttoward 1.000000000000010 Infinity -> 1.000000000000011
-ddnextt219 nexttoward 1.000000000000011 Infinity -> 1.000000000000012
-
-ddnextt221 nexttoward -0.9999999999999995 Infinity -> -0.9999999999999994
-ddnextt222 nexttoward -0.9999999999999996 Infinity -> -0.9999999999999995
-ddnextt223 nexttoward -0.9999999999999997 Infinity -> -0.9999999999999996
-ddnextt224 nexttoward -0.9999999999999998 Infinity -> -0.9999999999999997
-ddnextt225 nexttoward -0.9999999999999999 Infinity -> -0.9999999999999998
-ddnextt226 nexttoward -1.000000000000000 Infinity -> -0.9999999999999999
-ddnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999
-ddnextt228 nexttoward -1 Infinity -> -0.9999999999999999
-ddnextt229 nexttoward -1.000000000000001 Infinity -> -1.000000000000000
-ddnextt230 nexttoward -1.000000000000002 Infinity -> -1.000000000000001
-ddnextt231 nexttoward -1.000000000000003 Infinity -> -1.000000000000002
-ddnextt232 nexttoward -1.000000000000004 Infinity -> -1.000000000000003
-ddnextt233 nexttoward -1.000000000000005 Infinity -> -1.000000000000004
-ddnextt234 nexttoward -1.000000000000006 Infinity -> -1.000000000000005
-ddnextt235 nexttoward -1.000000000000007 Infinity -> -1.000000000000006
-ddnextt236 nexttoward -1.000000000000008 Infinity -> -1.000000000000007
-ddnextt237 nexttoward -1.000000000000009 Infinity -> -1.000000000000008
-ddnextt238 nexttoward -1.000000000000010 Infinity -> -1.000000000000009
-ddnextt239 nexttoward -1.000000000000011 Infinity -> -1.000000000000010
-ddnextt240 nexttoward -1.000000000000012 Infinity -> -1.000000000000011
-
--- Zeros
-ddnextt300 nexttoward 0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt301 nexttoward 0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt302 nexttoward 0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt303 nexttoward 0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt304 nexttoward 0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt305 nexttoward -0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt306 nexttoward -0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt307 nexttoward -0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt308 nexttoward -0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt309 nexttoward -0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-
--- specials
-ddnextt350 nexttoward Inf Infinity -> Infinity
-ddnextt351 nexttoward -Inf Infinity -> -9.999999999999999E+384
-ddnextt352 nexttoward NaN Infinity -> NaN
-ddnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
-ddnextt354 nexttoward NaN77 Infinity -> NaN77
-ddnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
-ddnextt356 nexttoward -NaN Infinity -> -NaN
-ddnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
-ddnextt358 nexttoward -NaN77 Infinity -> -NaN77
-ddnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-ddnextt370 nexttoward -9.999999999999999E+384 Infinity -> -9.999999999999998E+384
-ddnextt371 nexttoward -9.999999999999998E+384 Infinity -> -9.999999999999997E+384
-ddnextt372 nexttoward -1E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
-ddnextt373 nexttoward -1.000000000000000E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
-ddnextt374 nexttoward -9E-398 Infinity -> -8E-398 Underflow Subnormal Inexact Rounded
-ddnextt375 nexttoward -9.9E-397 Infinity -> -9.8E-397 Underflow Subnormal Inexact Rounded
-ddnextt376 nexttoward -9.99999999999E-387 Infinity -> -9.99999999998E-387 Underflow Subnormal Inexact Rounded
-ddnextt377 nexttoward -9.99999999999999E-384 Infinity -> -9.99999999999998E-384 Underflow Subnormal Inexact Rounded
-ddnextt378 nexttoward -9.99999999999998E-384 Infinity -> -9.99999999999997E-384 Underflow Subnormal Inexact Rounded
-ddnextt379 nexttoward -9.99999999999997E-384 Infinity -> -9.99999999999996E-384 Underflow Subnormal Inexact Rounded
-ddnextt380 nexttoward -0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt381 nexttoward -1E-398 Infinity -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddnextt382 nexttoward -2E-398 Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-
-ddnextt383 nexttoward 0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt384 nexttoward 1E-398 Infinity -> 2E-398 Underflow Subnormal Inexact Rounded
-ddnextt385 nexttoward 2E-398 Infinity -> 3E-398 Underflow Subnormal Inexact Rounded
-ddnextt386 nexttoward 10E-398 Infinity -> 1.1E-397 Underflow Subnormal Inexact Rounded
-ddnextt387 nexttoward 100E-398 Infinity -> 1.01E-396 Underflow Subnormal Inexact Rounded
-ddnextt388 nexttoward 100000E-398 Infinity -> 1.00001E-393 Underflow Subnormal Inexact Rounded
-ddnextt389 nexttoward 1.00000000000E-383 Infinity -> 1.000000000000001E-383
-ddnextt390 nexttoward 1.000000000000000E-383 Infinity -> 1.000000000000001E-383
-ddnextt391 nexttoward 1E-383 Infinity -> 1.000000000000001E-383
-ddnextt392 nexttoward 9.999999999999997E+384 Infinity -> 9.999999999999998E+384
-ddnextt393 nexttoward 9.999999999999998E+384 Infinity -> 9.999999999999999E+384
-ddnextt394 nexttoward 9.999999999999999E+384 Infinity -> Infinity Overflow Inexact Rounded
-
-------- lhs>rhs
-ddnextt401 nexttoward 0.9999999999999995 -Infinity -> 0.9999999999999994
-ddnextt402 nexttoward 0.9999999999999996 -Infinity -> 0.9999999999999995
-ddnextt403 nexttoward 0.9999999999999997 -Infinity -> 0.9999999999999996
-ddnextt404 nexttoward 0.9999999999999998 -Infinity -> 0.9999999999999997
-ddnextt405 nexttoward 0.9999999999999999 -Infinity -> 0.9999999999999998
-ddnextt406 nexttoward 1.000000000000000 -Infinity -> 0.9999999999999999
-ddnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999
-ddnextt408 nexttoward 1 -Infinity -> 0.9999999999999999
-ddnextt409 nexttoward 1.000000000000001 -Infinity -> 1.000000000000000
-ddnextt410 nexttoward 1.000000000000002 -Infinity -> 1.000000000000001
-ddnextt411 nexttoward 1.000000000000003 -Infinity -> 1.000000000000002
-ddnextt412 nexttoward 1.000000000000004 -Infinity -> 1.000000000000003
-ddnextt413 nexttoward 1.000000000000005 -Infinity -> 1.000000000000004
-ddnextt414 nexttoward 1.000000000000006 -Infinity -> 1.000000000000005
-ddnextt415 nexttoward 1.000000000000007 -Infinity -> 1.000000000000006
-ddnextt416 nexttoward 1.000000000000008 -Infinity -> 1.000000000000007
-ddnextt417 nexttoward 1.000000000000009 -Infinity -> 1.000000000000008
-ddnextt418 nexttoward 1.000000000000010 -Infinity -> 1.000000000000009
-ddnextt419 nexttoward 1.000000000000011 -Infinity -> 1.000000000000010
-ddnextt420 nexttoward 1.000000000000012 -Infinity -> 1.000000000000011
-
-ddnextt421 nexttoward -0.9999999999999995 -Infinity -> -0.9999999999999996
-ddnextt422 nexttoward -0.9999999999999996 -Infinity -> -0.9999999999999997
-ddnextt423 nexttoward -0.9999999999999997 -Infinity -> -0.9999999999999998
-ddnextt424 nexttoward -0.9999999999999998 -Infinity -> -0.9999999999999999
-ddnextt425 nexttoward -0.9999999999999999 -Infinity -> -1.000000000000000
-ddnextt426 nexttoward -1.000000000000000 -Infinity -> -1.000000000000001
-ddnextt427 nexttoward -1.0 -Infinity -> -1.000000000000001
-ddnextt428 nexttoward -1 -Infinity -> -1.000000000000001
-ddnextt429 nexttoward -1.000000000000001 -Infinity -> -1.000000000000002
-ddnextt430 nexttoward -1.000000000000002 -Infinity -> -1.000000000000003
-ddnextt431 nexttoward -1.000000000000003 -Infinity -> -1.000000000000004
-ddnextt432 nexttoward -1.000000000000004 -Infinity -> -1.000000000000005
-ddnextt433 nexttoward -1.000000000000005 -Infinity -> -1.000000000000006
-ddnextt434 nexttoward -1.000000000000006 -Infinity -> -1.000000000000007
-ddnextt435 nexttoward -1.000000000000007 -Infinity -> -1.000000000000008
-ddnextt436 nexttoward -1.000000000000008 -Infinity -> -1.000000000000009
-ddnextt437 nexttoward -1.000000000000009 -Infinity -> -1.000000000000010
-ddnextt438 nexttoward -1.000000000000010 -Infinity -> -1.000000000000011
-ddnextt439 nexttoward -1.000000000000011 -Infinity -> -1.000000000000012
-
--- Zeros
-ddnextt500 nexttoward -0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt501 nexttoward 0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt502 nexttoward 0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt503 nexttoward -0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt504 nexttoward 0E-300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt505 nexttoward 0E+300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt506 nexttoward 0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt507 nexttoward -0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-
--- specials
-ddnextt550 nexttoward Inf -Infinity -> 9.999999999999999E+384
-ddnextt551 nexttoward -Inf -Infinity -> -Infinity
-ddnextt552 nexttoward NaN -Infinity -> NaN
-ddnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
-ddnextt554 nexttoward NaN77 -Infinity -> NaN77
-ddnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
-ddnextt556 nexttoward -NaN -Infinity -> -NaN
-ddnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
-ddnextt558 nexttoward -NaN77 -Infinity -> -NaN77
-ddnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-ddnextt670 nexttoward 9.999999999999999E+384 -Infinity -> 9.999999999999998E+384
-ddnextt671 nexttoward 9.999999999999998E+384 -Infinity -> 9.999999999999997E+384
-ddnextt672 nexttoward 1E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
-ddnextt673 nexttoward 1.000000000000000E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
-ddnextt674 nexttoward 9E-398 -Infinity -> 8E-398 Underflow Subnormal Inexact Rounded
-ddnextt675 nexttoward 9.9E-397 -Infinity -> 9.8E-397 Underflow Subnormal Inexact Rounded
-ddnextt676 nexttoward 9.99999999999E-387 -Infinity -> 9.99999999998E-387 Underflow Subnormal Inexact Rounded
-ddnextt677 nexttoward 9.99999999999999E-384 -Infinity -> 9.99999999999998E-384 Underflow Subnormal Inexact Rounded
-ddnextt678 nexttoward 9.99999999999998E-384 -Infinity -> 9.99999999999997E-384 Underflow Subnormal Inexact Rounded
-ddnextt679 nexttoward 9.99999999999997E-384 -Infinity -> 9.99999999999996E-384 Underflow Subnormal Inexact Rounded
-ddnextt680 nexttoward 0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt681 nexttoward 1E-398 -Infinity -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddnextt682 nexttoward 2E-398 -Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
-
-ddnextt683 nexttoward -0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt684 nexttoward -1E-398 -Infinity -> -2E-398 Underflow Subnormal Inexact Rounded
-ddnextt685 nexttoward -2E-398 -Infinity -> -3E-398 Underflow Subnormal Inexact Rounded
-ddnextt686 nexttoward -10E-398 -Infinity -> -1.1E-397 Underflow Subnormal Inexact Rounded
-ddnextt687 nexttoward -100E-398 -Infinity -> -1.01E-396 Underflow Subnormal Inexact Rounded
-ddnextt688 nexttoward -100000E-398 -Infinity -> -1.00001E-393 Underflow Subnormal Inexact Rounded
-ddnextt689 nexttoward -1.00000000000E-383 -Infinity -> -1.000000000000001E-383
-ddnextt690 nexttoward -1.000000000000000E-383 -Infinity -> -1.000000000000001E-383
-ddnextt691 nexttoward -1E-383 -Infinity -> -1.000000000000001E-383
-ddnextt692 nexttoward -9.999999999999998E+384 -Infinity -> -9.999999999999999E+384
-ddnextt693 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
-
-------- Specials
-ddnextt780 nexttoward -Inf -Inf -> -Infinity
-ddnextt781 nexttoward -Inf -1000 -> -9.999999999999999E+384
-ddnextt782 nexttoward -Inf -1 -> -9.999999999999999E+384
-ddnextt783 nexttoward -Inf -0 -> -9.999999999999999E+384
-ddnextt784 nexttoward -Inf 0 -> -9.999999999999999E+384
-ddnextt785 nexttoward -Inf 1 -> -9.999999999999999E+384
-ddnextt786 nexttoward -Inf 1000 -> -9.999999999999999E+384
-ddnextt787 nexttoward -1000 -Inf -> -1000.000000000001
-ddnextt788 nexttoward -Inf -Inf -> -Infinity
-ddnextt789 nexttoward -1 -Inf -> -1.000000000000001
-ddnextt790 nexttoward -0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt791 nexttoward 0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
-ddnextt792 nexttoward 1 -Inf -> 0.9999999999999999
-ddnextt793 nexttoward 1000 -Inf -> 999.9999999999999
-ddnextt794 nexttoward Inf -Inf -> 9.999999999999999E+384
-
-ddnextt800 nexttoward Inf -Inf -> 9.999999999999999E+384
-ddnextt801 nexttoward Inf -1000 -> 9.999999999999999E+384
-ddnextt802 nexttoward Inf -1 -> 9.999999999999999E+384
-ddnextt803 nexttoward Inf -0 -> 9.999999999999999E+384
-ddnextt804 nexttoward Inf 0 -> 9.999999999999999E+384
-ddnextt805 nexttoward Inf 1 -> 9.999999999999999E+384
-ddnextt806 nexttoward Inf 1000 -> 9.999999999999999E+384
-ddnextt807 nexttoward Inf Inf -> Infinity
-ddnextt808 nexttoward -1000 Inf -> -999.9999999999999
-ddnextt809 nexttoward -Inf Inf -> -9.999999999999999E+384
-ddnextt810 nexttoward -1 Inf -> -0.9999999999999999
-ddnextt811 nexttoward -0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt812 nexttoward 0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
-ddnextt813 nexttoward 1 Inf -> 1.000000000000001
-ddnextt814 nexttoward 1000 Inf -> 1000.000000000001
-ddnextt815 nexttoward Inf Inf -> Infinity
-
-ddnextt821 nexttoward NaN -Inf -> NaN
-ddnextt822 nexttoward NaN -1000 -> NaN
-ddnextt823 nexttoward NaN -1 -> NaN
-ddnextt824 nexttoward NaN -0 -> NaN
-ddnextt825 nexttoward NaN 0 -> NaN
-ddnextt826 nexttoward NaN 1 -> NaN
-ddnextt827 nexttoward NaN 1000 -> NaN
-ddnextt828 nexttoward NaN Inf -> NaN
-ddnextt829 nexttoward NaN NaN -> NaN
-ddnextt830 nexttoward -Inf NaN -> NaN
-ddnextt831 nexttoward -1000 NaN -> NaN
-ddnextt832 nexttoward -1 NaN -> NaN
-ddnextt833 nexttoward -0 NaN -> NaN
-ddnextt834 nexttoward 0 NaN -> NaN
-ddnextt835 nexttoward 1 NaN -> NaN
-ddnextt836 nexttoward 1000 NaN -> NaN
-ddnextt837 nexttoward Inf NaN -> NaN
-
-ddnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
-ddnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
-ddnextt843 nexttoward sNaN -1 -> NaN Invalid_operation
-ddnextt844 nexttoward sNaN -0 -> NaN Invalid_operation
-ddnextt845 nexttoward sNaN 0 -> NaN Invalid_operation
-ddnextt846 nexttoward sNaN 1 -> NaN Invalid_operation
-ddnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
-ddnextt848 nexttoward sNaN NaN -> NaN Invalid_operation
-ddnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
-ddnextt850 nexttoward NaN sNaN -> NaN Invalid_operation
-ddnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
-ddnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
-ddnextt853 nexttoward -1 sNaN -> NaN Invalid_operation
-ddnextt854 nexttoward -0 sNaN -> NaN Invalid_operation
-ddnextt855 nexttoward 0 sNaN -> NaN Invalid_operation
-ddnextt856 nexttoward 1 sNaN -> NaN Invalid_operation
-ddnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
-ddnextt858 nexttoward Inf sNaN -> NaN Invalid_operation
-ddnextt859 nexttoward NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddnextt861 nexttoward NaN1 -Inf -> NaN1
-ddnextt862 nexttoward +NaN2 -1000 -> NaN2
-ddnextt863 nexttoward NaN3 1000 -> NaN3
-ddnextt864 nexttoward NaN4 Inf -> NaN4
-ddnextt865 nexttoward NaN5 +NaN6 -> NaN5
-ddnextt866 nexttoward -Inf NaN7 -> NaN7
-ddnextt867 nexttoward -1000 NaN8 -> NaN8
-ddnextt868 nexttoward 1000 NaN9 -> NaN9
-ddnextt869 nexttoward Inf +NaN10 -> NaN10
-ddnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
-ddnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
-ddnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
-ddnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
-ddnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
-ddnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
-ddnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
-ddnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
-ddnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
-ddnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddnextt882 nexttoward -NaN26 NaN28 -> -NaN26
-ddnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddnextt884 nexttoward 1000 -NaN30 -> -NaN30
-ddnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Null tests
-ddnextt900 nexttoward 1 # -> NaN Invalid_operation
-ddnextt901 nexttoward # 1 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddNextToward.decTest -- decDouble next toward rhs [754r nextafter] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check with a scattering of numerics
+ddnextt001 nexttoward 10 10 -> 10
+ddnextt002 nexttoward -10 -10 -> -10
+ddnextt003 nexttoward 1 10 -> 1.000000000000001
+ddnextt004 nexttoward 1 -10 -> 0.9999999999999999
+ddnextt005 nexttoward -1 10 -> -0.9999999999999999
+ddnextt006 nexttoward -1 -10 -> -1.000000000000001
+ddnextt007 nexttoward 0 10 -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt008 nexttoward 0 -10 -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt009 nexttoward 9.999999999999999E+384 +Infinity -> Infinity Overflow Inexact Rounded
+ddnextt010 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
+ddnextt011 nexttoward 9.999999999999999 10 -> 10.00000000000000
+ddnextt012 nexttoward 10 9.999999999999999 -> 9.999999999999999
+ddnextt013 nexttoward -9.999999999999999 -10 -> -10.00000000000000
+ddnextt014 nexttoward -10 -9.999999999999999 -> -9.999999999999999
+ddnextt015 nexttoward 9.999999999999998 10 -> 9.999999999999999
+ddnextt016 nexttoward 10 9.999999999999998 -> 9.999999999999999
+ddnextt017 nexttoward -9.999999999999998 -10 -> -9.999999999999999
+ddnextt018 nexttoward -10 -9.999999999999998 -> -9.999999999999999
+
+------- lhs=rhs
+-- finites
+ddnextt101 nexttoward 7 7 -> 7
+ddnextt102 nexttoward -7 -7 -> -7
+ddnextt103 nexttoward 75 75 -> 75
+ddnextt104 nexttoward -75 -75 -> -75
+ddnextt105 nexttoward 7.50 7.5 -> 7.50
+ddnextt106 nexttoward -7.50 -7.50 -> -7.50
+ddnextt107 nexttoward 7.500 7.5000 -> 7.500
+ddnextt108 nexttoward -7.500 -7.5 -> -7.500
+
+-- zeros
+ddnextt111 nexttoward 0 0 -> 0
+ddnextt112 nexttoward -0 -0 -> -0
+ddnextt113 nexttoward 0E+4 0 -> 0E+4
+ddnextt114 nexttoward -0E+4 -0 -> -0E+4
+ddnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11
+ddnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11
+ddnextt117 nexttoward 0E-141 0 -> 0E-141
+ddnextt118 nexttoward -0E-141 -000 -> -0E-141
+
+-- full coefficients, alternating bits
+ddnextt121 nexttoward 268268268 268268268 -> 268268268
+ddnextt122 nexttoward -268268268 -268268268 -> -268268268
+ddnextt123 nexttoward 134134134 134134134 -> 134134134
+ddnextt124 nexttoward -134134134 -134134134 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+ddnextt131 nexttoward 9.999999999999999E+384 9.999999999999999E+384 -> 9.999999999999999E+384
+ddnextt132 nexttoward 1E-383 1E-383 -> 1E-383
+ddnextt133 nexttoward 1.000000000000000E-383 1.000000000000000E-383 -> 1.000000000000000E-383
+ddnextt134 nexttoward 1E-398 1E-398 -> 1E-398
+
+ddnextt135 nexttoward -1E-398 -1E-398 -> -1E-398
+ddnextt136 nexttoward -1.000000000000000E-383 -1.000000000000000E-383 -> -1.000000000000000E-383
+ddnextt137 nexttoward -1E-383 -1E-383 -> -1E-383
+ddnextt138 nexttoward -9.999999999999999E+384 -9.999999999999999E+384 -> -9.999999999999999E+384
+
+------- lhs<rhs
+ddnextt201 nexttoward 0.9999999999999995 Infinity -> 0.9999999999999996
+ddnextt202 nexttoward 0.9999999999999996 Infinity -> 0.9999999999999997
+ddnextt203 nexttoward 0.9999999999999997 Infinity -> 0.9999999999999998
+ddnextt204 nexttoward 0.9999999999999998 Infinity -> 0.9999999999999999
+ddnextt205 nexttoward 0.9999999999999999 Infinity -> 1.000000000000000
+ddnextt206 nexttoward 1.000000000000000 Infinity -> 1.000000000000001
+ddnextt207 nexttoward 1.0 Infinity -> 1.000000000000001
+ddnextt208 nexttoward 1 Infinity -> 1.000000000000001
+ddnextt209 nexttoward 1.000000000000001 Infinity -> 1.000000000000002
+ddnextt210 nexttoward 1.000000000000002 Infinity -> 1.000000000000003
+ddnextt211 nexttoward 1.000000000000003 Infinity -> 1.000000000000004
+ddnextt212 nexttoward 1.000000000000004 Infinity -> 1.000000000000005
+ddnextt213 nexttoward 1.000000000000005 Infinity -> 1.000000000000006
+ddnextt214 nexttoward 1.000000000000006 Infinity -> 1.000000000000007
+ddnextt215 nexttoward 1.000000000000007 Infinity -> 1.000000000000008
+ddnextt216 nexttoward 1.000000000000008 Infinity -> 1.000000000000009
+ddnextt217 nexttoward 1.000000000000009 Infinity -> 1.000000000000010
+ddnextt218 nexttoward 1.000000000000010 Infinity -> 1.000000000000011
+ddnextt219 nexttoward 1.000000000000011 Infinity -> 1.000000000000012
+
+ddnextt221 nexttoward -0.9999999999999995 Infinity -> -0.9999999999999994
+ddnextt222 nexttoward -0.9999999999999996 Infinity -> -0.9999999999999995
+ddnextt223 nexttoward -0.9999999999999997 Infinity -> -0.9999999999999996
+ddnextt224 nexttoward -0.9999999999999998 Infinity -> -0.9999999999999997
+ddnextt225 nexttoward -0.9999999999999999 Infinity -> -0.9999999999999998
+ddnextt226 nexttoward -1.000000000000000 Infinity -> -0.9999999999999999
+ddnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999
+ddnextt228 nexttoward -1 Infinity -> -0.9999999999999999
+ddnextt229 nexttoward -1.000000000000001 Infinity -> -1.000000000000000
+ddnextt230 nexttoward -1.000000000000002 Infinity -> -1.000000000000001
+ddnextt231 nexttoward -1.000000000000003 Infinity -> -1.000000000000002
+ddnextt232 nexttoward -1.000000000000004 Infinity -> -1.000000000000003
+ddnextt233 nexttoward -1.000000000000005 Infinity -> -1.000000000000004
+ddnextt234 nexttoward -1.000000000000006 Infinity -> -1.000000000000005
+ddnextt235 nexttoward -1.000000000000007 Infinity -> -1.000000000000006
+ddnextt236 nexttoward -1.000000000000008 Infinity -> -1.000000000000007
+ddnextt237 nexttoward -1.000000000000009 Infinity -> -1.000000000000008
+ddnextt238 nexttoward -1.000000000000010 Infinity -> -1.000000000000009
+ddnextt239 nexttoward -1.000000000000011 Infinity -> -1.000000000000010
+ddnextt240 nexttoward -1.000000000000012 Infinity -> -1.000000000000011
+
+-- Zeros
+ddnextt300 nexttoward 0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt301 nexttoward 0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt302 nexttoward 0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt303 nexttoward 0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt304 nexttoward 0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt305 nexttoward -0 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt306 nexttoward -0.00 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt307 nexttoward -0E-300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt308 nexttoward -0E+300 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt309 nexttoward -0E+30000 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+
+-- specials
+ddnextt350 nexttoward Inf Infinity -> Infinity
+ddnextt351 nexttoward -Inf Infinity -> -9.999999999999999E+384
+ddnextt352 nexttoward NaN Infinity -> NaN
+ddnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
+ddnextt354 nexttoward NaN77 Infinity -> NaN77
+ddnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
+ddnextt356 nexttoward -NaN Infinity -> -NaN
+ddnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
+ddnextt358 nexttoward -NaN77 Infinity -> -NaN77
+ddnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+ddnextt370 nexttoward -9.999999999999999E+384 Infinity -> -9.999999999999998E+384
+ddnextt371 nexttoward -9.999999999999998E+384 Infinity -> -9.999999999999997E+384
+ddnextt372 nexttoward -1E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
+ddnextt373 nexttoward -1.000000000000000E-383 Infinity -> -9.99999999999999E-384 Underflow Subnormal Inexact Rounded
+ddnextt374 nexttoward -9E-398 Infinity -> -8E-398 Underflow Subnormal Inexact Rounded
+ddnextt375 nexttoward -9.9E-397 Infinity -> -9.8E-397 Underflow Subnormal Inexact Rounded
+ddnextt376 nexttoward -9.99999999999E-387 Infinity -> -9.99999999998E-387 Underflow Subnormal Inexact Rounded
+ddnextt377 nexttoward -9.99999999999999E-384 Infinity -> -9.99999999999998E-384 Underflow Subnormal Inexact Rounded
+ddnextt378 nexttoward -9.99999999999998E-384 Infinity -> -9.99999999999997E-384 Underflow Subnormal Inexact Rounded
+ddnextt379 nexttoward -9.99999999999997E-384 Infinity -> -9.99999999999996E-384 Underflow Subnormal Inexact Rounded
+ddnextt380 nexttoward -0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt381 nexttoward -1E-398 Infinity -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddnextt382 nexttoward -2E-398 Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+
+ddnextt383 nexttoward 0E-398 Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt384 nexttoward 1E-398 Infinity -> 2E-398 Underflow Subnormal Inexact Rounded
+ddnextt385 nexttoward 2E-398 Infinity -> 3E-398 Underflow Subnormal Inexact Rounded
+ddnextt386 nexttoward 10E-398 Infinity -> 1.1E-397 Underflow Subnormal Inexact Rounded
+ddnextt387 nexttoward 100E-398 Infinity -> 1.01E-396 Underflow Subnormal Inexact Rounded
+ddnextt388 nexttoward 100000E-398 Infinity -> 1.00001E-393 Underflow Subnormal Inexact Rounded
+ddnextt389 nexttoward 1.00000000000E-383 Infinity -> 1.000000000000001E-383
+ddnextt390 nexttoward 1.000000000000000E-383 Infinity -> 1.000000000000001E-383
+ddnextt391 nexttoward 1E-383 Infinity -> 1.000000000000001E-383
+ddnextt392 nexttoward 9.999999999999997E+384 Infinity -> 9.999999999999998E+384
+ddnextt393 nexttoward 9.999999999999998E+384 Infinity -> 9.999999999999999E+384
+ddnextt394 nexttoward 9.999999999999999E+384 Infinity -> Infinity Overflow Inexact Rounded
+
+------- lhs>rhs
+ddnextt401 nexttoward 0.9999999999999995 -Infinity -> 0.9999999999999994
+ddnextt402 nexttoward 0.9999999999999996 -Infinity -> 0.9999999999999995
+ddnextt403 nexttoward 0.9999999999999997 -Infinity -> 0.9999999999999996
+ddnextt404 nexttoward 0.9999999999999998 -Infinity -> 0.9999999999999997
+ddnextt405 nexttoward 0.9999999999999999 -Infinity -> 0.9999999999999998
+ddnextt406 nexttoward 1.000000000000000 -Infinity -> 0.9999999999999999
+ddnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999
+ddnextt408 nexttoward 1 -Infinity -> 0.9999999999999999
+ddnextt409 nexttoward 1.000000000000001 -Infinity -> 1.000000000000000
+ddnextt410 nexttoward 1.000000000000002 -Infinity -> 1.000000000000001
+ddnextt411 nexttoward 1.000000000000003 -Infinity -> 1.000000000000002
+ddnextt412 nexttoward 1.000000000000004 -Infinity -> 1.000000000000003
+ddnextt413 nexttoward 1.000000000000005 -Infinity -> 1.000000000000004
+ddnextt414 nexttoward 1.000000000000006 -Infinity -> 1.000000000000005
+ddnextt415 nexttoward 1.000000000000007 -Infinity -> 1.000000000000006
+ddnextt416 nexttoward 1.000000000000008 -Infinity -> 1.000000000000007
+ddnextt417 nexttoward 1.000000000000009 -Infinity -> 1.000000000000008
+ddnextt418 nexttoward 1.000000000000010 -Infinity -> 1.000000000000009
+ddnextt419 nexttoward 1.000000000000011 -Infinity -> 1.000000000000010
+ddnextt420 nexttoward 1.000000000000012 -Infinity -> 1.000000000000011
+
+ddnextt421 nexttoward -0.9999999999999995 -Infinity -> -0.9999999999999996
+ddnextt422 nexttoward -0.9999999999999996 -Infinity -> -0.9999999999999997
+ddnextt423 nexttoward -0.9999999999999997 -Infinity -> -0.9999999999999998
+ddnextt424 nexttoward -0.9999999999999998 -Infinity -> -0.9999999999999999
+ddnextt425 nexttoward -0.9999999999999999 -Infinity -> -1.000000000000000
+ddnextt426 nexttoward -1.000000000000000 -Infinity -> -1.000000000000001
+ddnextt427 nexttoward -1.0 -Infinity -> -1.000000000000001
+ddnextt428 nexttoward -1 -Infinity -> -1.000000000000001
+ddnextt429 nexttoward -1.000000000000001 -Infinity -> -1.000000000000002
+ddnextt430 nexttoward -1.000000000000002 -Infinity -> -1.000000000000003
+ddnextt431 nexttoward -1.000000000000003 -Infinity -> -1.000000000000004
+ddnextt432 nexttoward -1.000000000000004 -Infinity -> -1.000000000000005
+ddnextt433 nexttoward -1.000000000000005 -Infinity -> -1.000000000000006
+ddnextt434 nexttoward -1.000000000000006 -Infinity -> -1.000000000000007
+ddnextt435 nexttoward -1.000000000000007 -Infinity -> -1.000000000000008
+ddnextt436 nexttoward -1.000000000000008 -Infinity -> -1.000000000000009
+ddnextt437 nexttoward -1.000000000000009 -Infinity -> -1.000000000000010
+ddnextt438 nexttoward -1.000000000000010 -Infinity -> -1.000000000000011
+ddnextt439 nexttoward -1.000000000000011 -Infinity -> -1.000000000000012
+
+-- Zeros
+ddnextt500 nexttoward -0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt501 nexttoward 0 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt502 nexttoward 0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt503 nexttoward -0.00 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt504 nexttoward 0E-300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt505 nexttoward 0E+300 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt506 nexttoward 0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt507 nexttoward -0E+30000 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+
+-- specials
+ddnextt550 nexttoward Inf -Infinity -> 9.999999999999999E+384
+ddnextt551 nexttoward -Inf -Infinity -> -Infinity
+ddnextt552 nexttoward NaN -Infinity -> NaN
+ddnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
+ddnextt554 nexttoward NaN77 -Infinity -> NaN77
+ddnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
+ddnextt556 nexttoward -NaN -Infinity -> -NaN
+ddnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
+ddnextt558 nexttoward -NaN77 -Infinity -> -NaN77
+ddnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+ddnextt670 nexttoward 9.999999999999999E+384 -Infinity -> 9.999999999999998E+384
+ddnextt671 nexttoward 9.999999999999998E+384 -Infinity -> 9.999999999999997E+384
+ddnextt672 nexttoward 1E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
+ddnextt673 nexttoward 1.000000000000000E-383 -Infinity -> 9.99999999999999E-384 Underflow Subnormal Inexact Rounded
+ddnextt674 nexttoward 9E-398 -Infinity -> 8E-398 Underflow Subnormal Inexact Rounded
+ddnextt675 nexttoward 9.9E-397 -Infinity -> 9.8E-397 Underflow Subnormal Inexact Rounded
+ddnextt676 nexttoward 9.99999999999E-387 -Infinity -> 9.99999999998E-387 Underflow Subnormal Inexact Rounded
+ddnextt677 nexttoward 9.99999999999999E-384 -Infinity -> 9.99999999999998E-384 Underflow Subnormal Inexact Rounded
+ddnextt678 nexttoward 9.99999999999998E-384 -Infinity -> 9.99999999999997E-384 Underflow Subnormal Inexact Rounded
+ddnextt679 nexttoward 9.99999999999997E-384 -Infinity -> 9.99999999999996E-384 Underflow Subnormal Inexact Rounded
+ddnextt680 nexttoward 0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt681 nexttoward 1E-398 -Infinity -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddnextt682 nexttoward 2E-398 -Infinity -> 1E-398 Underflow Subnormal Inexact Rounded
+
+ddnextt683 nexttoward -0E-398 -Infinity -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt684 nexttoward -1E-398 -Infinity -> -2E-398 Underflow Subnormal Inexact Rounded
+ddnextt685 nexttoward -2E-398 -Infinity -> -3E-398 Underflow Subnormal Inexact Rounded
+ddnextt686 nexttoward -10E-398 -Infinity -> -1.1E-397 Underflow Subnormal Inexact Rounded
+ddnextt687 nexttoward -100E-398 -Infinity -> -1.01E-396 Underflow Subnormal Inexact Rounded
+ddnextt688 nexttoward -100000E-398 -Infinity -> -1.00001E-393 Underflow Subnormal Inexact Rounded
+ddnextt689 nexttoward -1.00000000000E-383 -Infinity -> -1.000000000000001E-383
+ddnextt690 nexttoward -1.000000000000000E-383 -Infinity -> -1.000000000000001E-383
+ddnextt691 nexttoward -1E-383 -Infinity -> -1.000000000000001E-383
+ddnextt692 nexttoward -9.999999999999998E+384 -Infinity -> -9.999999999999999E+384
+ddnextt693 nexttoward -9.999999999999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
+
+------- Specials
+ddnextt780 nexttoward -Inf -Inf -> -Infinity
+ddnextt781 nexttoward -Inf -1000 -> -9.999999999999999E+384
+ddnextt782 nexttoward -Inf -1 -> -9.999999999999999E+384
+ddnextt783 nexttoward -Inf -0 -> -9.999999999999999E+384
+ddnextt784 nexttoward -Inf 0 -> -9.999999999999999E+384
+ddnextt785 nexttoward -Inf 1 -> -9.999999999999999E+384
+ddnextt786 nexttoward -Inf 1000 -> -9.999999999999999E+384
+ddnextt787 nexttoward -1000 -Inf -> -1000.000000000001
+ddnextt788 nexttoward -Inf -Inf -> -Infinity
+ddnextt789 nexttoward -1 -Inf -> -1.000000000000001
+ddnextt790 nexttoward -0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt791 nexttoward 0 -Inf -> -1E-398 Underflow Subnormal Inexact Rounded
+ddnextt792 nexttoward 1 -Inf -> 0.9999999999999999
+ddnextt793 nexttoward 1000 -Inf -> 999.9999999999999
+ddnextt794 nexttoward Inf -Inf -> 9.999999999999999E+384
+
+ddnextt800 nexttoward Inf -Inf -> 9.999999999999999E+384
+ddnextt801 nexttoward Inf -1000 -> 9.999999999999999E+384
+ddnextt802 nexttoward Inf -1 -> 9.999999999999999E+384
+ddnextt803 nexttoward Inf -0 -> 9.999999999999999E+384
+ddnextt804 nexttoward Inf 0 -> 9.999999999999999E+384
+ddnextt805 nexttoward Inf 1 -> 9.999999999999999E+384
+ddnextt806 nexttoward Inf 1000 -> 9.999999999999999E+384
+ddnextt807 nexttoward Inf Inf -> Infinity
+ddnextt808 nexttoward -1000 Inf -> -999.9999999999999
+ddnextt809 nexttoward -Inf Inf -> -9.999999999999999E+384
+ddnextt810 nexttoward -1 Inf -> -0.9999999999999999
+ddnextt811 nexttoward -0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt812 nexttoward 0 Inf -> 1E-398 Underflow Subnormal Inexact Rounded
+ddnextt813 nexttoward 1 Inf -> 1.000000000000001
+ddnextt814 nexttoward 1000 Inf -> 1000.000000000001
+ddnextt815 nexttoward Inf Inf -> Infinity
+
+ddnextt821 nexttoward NaN -Inf -> NaN
+ddnextt822 nexttoward NaN -1000 -> NaN
+ddnextt823 nexttoward NaN -1 -> NaN
+ddnextt824 nexttoward NaN -0 -> NaN
+ddnextt825 nexttoward NaN 0 -> NaN
+ddnextt826 nexttoward NaN 1 -> NaN
+ddnextt827 nexttoward NaN 1000 -> NaN
+ddnextt828 nexttoward NaN Inf -> NaN
+ddnextt829 nexttoward NaN NaN -> NaN
+ddnextt830 nexttoward -Inf NaN -> NaN
+ddnextt831 nexttoward -1000 NaN -> NaN
+ddnextt832 nexttoward -1 NaN -> NaN
+ddnextt833 nexttoward -0 NaN -> NaN
+ddnextt834 nexttoward 0 NaN -> NaN
+ddnextt835 nexttoward 1 NaN -> NaN
+ddnextt836 nexttoward 1000 NaN -> NaN
+ddnextt837 nexttoward Inf NaN -> NaN
+
+ddnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
+ddnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
+ddnextt843 nexttoward sNaN -1 -> NaN Invalid_operation
+ddnextt844 nexttoward sNaN -0 -> NaN Invalid_operation
+ddnextt845 nexttoward sNaN 0 -> NaN Invalid_operation
+ddnextt846 nexttoward sNaN 1 -> NaN Invalid_operation
+ddnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
+ddnextt848 nexttoward sNaN NaN -> NaN Invalid_operation
+ddnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
+ddnextt850 nexttoward NaN sNaN -> NaN Invalid_operation
+ddnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
+ddnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
+ddnextt853 nexttoward -1 sNaN -> NaN Invalid_operation
+ddnextt854 nexttoward -0 sNaN -> NaN Invalid_operation
+ddnextt855 nexttoward 0 sNaN -> NaN Invalid_operation
+ddnextt856 nexttoward 1 sNaN -> NaN Invalid_operation
+ddnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
+ddnextt858 nexttoward Inf sNaN -> NaN Invalid_operation
+ddnextt859 nexttoward NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddnextt861 nexttoward NaN1 -Inf -> NaN1
+ddnextt862 nexttoward +NaN2 -1000 -> NaN2
+ddnextt863 nexttoward NaN3 1000 -> NaN3
+ddnextt864 nexttoward NaN4 Inf -> NaN4
+ddnextt865 nexttoward NaN5 +NaN6 -> NaN5
+ddnextt866 nexttoward -Inf NaN7 -> NaN7
+ddnextt867 nexttoward -1000 NaN8 -> NaN8
+ddnextt868 nexttoward 1000 NaN9 -> NaN9
+ddnextt869 nexttoward Inf +NaN10 -> NaN10
+ddnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
+ddnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
+ddnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
+ddnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
+ddnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
+ddnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
+ddnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
+ddnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
+ddnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
+ddnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddnextt882 nexttoward -NaN26 NaN28 -> -NaN26
+ddnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddnextt884 nexttoward 1000 -NaN30 -> -NaN30
+ddnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Null tests
+ddnextt900 nexttoward 1 # -> NaN Invalid_operation
+ddnextt901 nexttoward # 1 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddOr.decTest b/Lib/test/decimaltestdata/ddOr.decTest
index d36580bf66..f3a702b0ef 100644
--- a/Lib/test/decimaltestdata/ddOr.decTest
+++ b/Lib/test/decimaltestdata/ddOr.decTest
@@ -1,292 +1,292 @@
-------------------------------------------------------------------------
--- ddOr.decTest -- digitwise logical OR for decDoubles --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check (truth table)
-ddor001 or 0 0 -> 0
-ddor002 or 0 1 -> 1
-ddor003 or 1 0 -> 1
-ddor004 or 1 1 -> 1
-ddor005 or 1100 1010 -> 1110
--- and at msd and msd-1
-ddor006 or 0000000000000000 0000000000000000 -> 0
-ddor007 or 0000000000000000 1000000000000000 -> 1000000000000000
-ddor008 or 1000000000000000 0000000000000000 -> 1000000000000000
-ddor009 or 1000000000000000 1000000000000000 -> 1000000000000000
-ddor010 or 0000000000000000 0000000000000000 -> 0
-ddor011 or 0000000000000000 0100000000000000 -> 100000000000000
-ddor012 or 0100000000000000 0000000000000000 -> 100000000000000
-ddor013 or 0100000000000000 0100000000000000 -> 100000000000000
-
--- Various lengths
--- 1234567890123456 1234567890123456 1234567890123456
-ddor020 or 1111111111111111 1111111111111111 -> 1111111111111111
-ddor021 or 111111111111111 111111111111111 -> 111111111111111
-ddor022 or 11111111111111 11111111111111 -> 11111111111111
-ddor023 or 1111111111111 1111111111111 -> 1111111111111
-ddor024 or 111111111111 111111111111 -> 111111111111
-ddor025 or 11111111111 11111111111 -> 11111111111
-ddor026 or 1111111111 1111111111 -> 1111111111
-ddor027 or 111111111 111111111 -> 111111111
-ddor028 or 11111111 11111111 -> 11111111
-ddor029 or 1111111 1111111 -> 1111111
-ddor030 or 111111 111111 -> 111111
-ddor031 or 11111 11111 -> 11111
-ddor032 or 1111 1111 -> 1111
-ddor033 or 111 111 -> 111
-ddor034 or 11 11 -> 11
-ddor035 or 1 1 -> 1
-ddor036 or 0 0 -> 0
-
-ddor042 or 111111110000000 1111111110000000 -> 1111111110000000
-ddor043 or 11111110000000 1000000100000000 -> 1011111110000000
-ddor044 or 1111110000000 1000001000000000 -> 1001111110000000
-ddor045 or 111110000000 1000010000000000 -> 1000111110000000
-ddor046 or 11110000000 1000100000000000 -> 1000111110000000
-ddor047 or 1110000000 1001000000000000 -> 1001001110000000
-ddor048 or 110000000 1010000000000000 -> 1010000110000000
-ddor049 or 10000000 1100000000000000 -> 1100000010000000
-
-ddor090 or 011111111 111101111 -> 111111111
-ddor091 or 101111111 111101111 -> 111111111
-ddor092 or 110111111 111101111 -> 111111111
-ddor093 or 111011111 111101111 -> 111111111
-ddor094 or 111101111 111101111 -> 111101111
-ddor095 or 111110111 111101111 -> 111111111
-ddor096 or 111111011 111101111 -> 111111111
-ddor097 or 111111101 111101111 -> 111111111
-ddor098 or 111111110 111101111 -> 111111111
-
-ddor100 or 111101111 011111111 -> 111111111
-ddor101 or 111101111 101111111 -> 111111111
-ddor102 or 111101111 110111111 -> 111111111
-ddor103 or 111101111 111011111 -> 111111111
-ddor104 or 111101111 111101111 -> 111101111
-ddor105 or 111101111 111110111 -> 111111111
-ddor106 or 111101111 111111011 -> 111111111
-ddor107 or 111101111 111111101 -> 111111111
-ddor108 or 111101111 111111110 -> 111111111
-
--- non-0/1 should not be accepted, nor should signs
-ddor220 or 111111112 111111111 -> NaN Invalid_operation
-ddor221 or 333333333 333333333 -> NaN Invalid_operation
-ddor222 or 555555555 555555555 -> NaN Invalid_operation
-ddor223 or 777777777 777777777 -> NaN Invalid_operation
-ddor224 or 999999999 999999999 -> NaN Invalid_operation
-ddor225 or 222222222 999999999 -> NaN Invalid_operation
-ddor226 or 444444444 999999999 -> NaN Invalid_operation
-ddor227 or 666666666 999999999 -> NaN Invalid_operation
-ddor228 or 888888888 999999999 -> NaN Invalid_operation
-ddor229 or 999999999 222222222 -> NaN Invalid_operation
-ddor230 or 999999999 444444444 -> NaN Invalid_operation
-ddor231 or 999999999 666666666 -> NaN Invalid_operation
-ddor232 or 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-ddor240 or 567468689 -934981942 -> NaN Invalid_operation
-ddor241 or 567367689 934981942 -> NaN Invalid_operation
-ddor242 or -631917772 -706014634 -> NaN Invalid_operation
-ddor243 or -756253257 138579234 -> NaN Invalid_operation
-ddor244 or 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-ddor250 or 2000000000000000 1000000000000000 -> NaN Invalid_operation
-ddor251 or 7000000000000000 1000000000000000 -> NaN Invalid_operation
-ddor252 or 8000000000000000 1000000000000000 -> NaN Invalid_operation
-ddor253 or 9000000000000000 1000000000000000 -> NaN Invalid_operation
-ddor254 or 2000000000000000 0000000000000000 -> NaN Invalid_operation
-ddor255 or 7000000000000000 0000000000000000 -> NaN Invalid_operation
-ddor256 or 8000000000000000 0000000000000000 -> NaN Invalid_operation
-ddor257 or 9000000000000000 0000000000000000 -> NaN Invalid_operation
-ddor258 or 1000000000000000 2000000000000000 -> NaN Invalid_operation
-ddor259 or 1000000000000000 7000000000000000 -> NaN Invalid_operation
-ddor260 or 1000000000000000 8000000000000000 -> NaN Invalid_operation
-ddor261 or 1000000000000000 9000000000000000 -> NaN Invalid_operation
-ddor262 or 0000000000000000 2000000000000000 -> NaN Invalid_operation
-ddor263 or 0000000000000000 7000000000000000 -> NaN Invalid_operation
-ddor264 or 0000000000000000 8000000000000000 -> NaN Invalid_operation
-ddor265 or 0000000000000000 9000000000000000 -> NaN Invalid_operation
--- test MSD-1
-ddor270 or 0200001000000000 1000100000000010 -> NaN Invalid_operation
-ddor271 or 0700000100000000 1000010000000100 -> NaN Invalid_operation
-ddor272 or 0800000010000000 1000001000001000 -> NaN Invalid_operation
-ddor273 or 0900000001000000 1000000100010000 -> NaN Invalid_operation
-ddor274 or 1000000000100000 0200000010100000 -> NaN Invalid_operation
-ddor275 or 1000000000010000 0700000001000000 -> NaN Invalid_operation
-ddor276 or 1000000000001000 0800000010100000 -> NaN Invalid_operation
-ddor277 or 1000000000000100 0900000000010000 -> NaN Invalid_operation
--- test LSD
-ddor280 or 0010000000000002 1000000100000001 -> NaN Invalid_operation
-ddor281 or 0001000000000007 1000001000000011 -> NaN Invalid_operation
-ddor282 or 0000100000000008 1000010000000001 -> NaN Invalid_operation
-ddor283 or 0000010000000009 1000100000000001 -> NaN Invalid_operation
-ddor284 or 1000001000000000 0001000000000002 -> NaN Invalid_operation
-ddor285 or 1000000100000000 0010000000000007 -> NaN Invalid_operation
-ddor286 or 1000000010000000 0100000000000008 -> NaN Invalid_operation
-ddor287 or 1000000001000000 1000000000000009 -> NaN Invalid_operation
--- test Middie
-ddor288 or 0010000020000000 1000001000000000 -> NaN Invalid_operation
-ddor289 or 0001000070000001 1000000100000000 -> NaN Invalid_operation
-ddor290 or 0000100080000010 1000000010000000 -> NaN Invalid_operation
-ddor291 or 0000010090000100 1000000001000000 -> NaN Invalid_operation
-ddor292 or 1000001000001000 0000000020100000 -> NaN Invalid_operation
-ddor293 or 1000000100010000 0000000070010000 -> NaN Invalid_operation
-ddor294 or 1000000010100000 0000000080001000 -> NaN Invalid_operation
-ddor295 or 1000000001000000 0000000090000100 -> NaN Invalid_operation
--- signs
-ddor296 or -1000000001000000 -0000010000000100 -> NaN Invalid_operation
-ddor297 or -1000000001000000 0000000010000100 -> NaN Invalid_operation
-ddor298 or 1000000001000000 -0000001000000100 -> NaN Invalid_operation
-ddor299 or 1000000001000000 0000000011000100 -> 1000000011000100
-
--- Nmax, Nmin, Ntiny-like
-ddor331 or 2 9.99999999E+199 -> NaN Invalid_operation
-ddor332 or 3 1E-199 -> NaN Invalid_operation
-ddor333 or 4 1.00000000E-199 -> NaN Invalid_operation
-ddor334 or 5 1E-100 -> NaN Invalid_operation
-ddor335 or 6 -1E-100 -> NaN Invalid_operation
-ddor336 or 7 -1.00000000E-199 -> NaN Invalid_operation
-ddor337 or 8 -1E-199 -> NaN Invalid_operation
-ddor338 or 9 -9.99999999E+199 -> NaN Invalid_operation
-ddor341 or 9.99999999E+299 -18 -> NaN Invalid_operation
-ddor342 or 1E-299 01 -> NaN Invalid_operation
-ddor343 or 1.00000000E-299 -18 -> NaN Invalid_operation
-ddor344 or 1E-100 18 -> NaN Invalid_operation
-ddor345 or -1E-100 -10 -> NaN Invalid_operation
-ddor346 or -1.00000000E-299 18 -> NaN Invalid_operation
-ddor347 or -1E-299 10 -> NaN Invalid_operation
-ddor348 or -9.99999999E+299 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-ddor361 or 1.0 1 -> NaN Invalid_operation
-ddor362 or 1E+1 1 -> NaN Invalid_operation
-ddor363 or 0.0 1 -> NaN Invalid_operation
-ddor364 or 0E+1 1 -> NaN Invalid_operation
-ddor365 or 9.9 1 -> NaN Invalid_operation
-ddor366 or 9E+1 1 -> NaN Invalid_operation
-ddor371 or 0 1.0 -> NaN Invalid_operation
-ddor372 or 0 1E+1 -> NaN Invalid_operation
-ddor373 or 0 0.0 -> NaN Invalid_operation
-ddor374 or 0 0E+1 -> NaN Invalid_operation
-ddor375 or 0 9.9 -> NaN Invalid_operation
-ddor376 or 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-ddor780 or -Inf -Inf -> NaN Invalid_operation
-ddor781 or -Inf -1000 -> NaN Invalid_operation
-ddor782 or -Inf -1 -> NaN Invalid_operation
-ddor783 or -Inf -0 -> NaN Invalid_operation
-ddor784 or -Inf 0 -> NaN Invalid_operation
-ddor785 or -Inf 1 -> NaN Invalid_operation
-ddor786 or -Inf 1000 -> NaN Invalid_operation
-ddor787 or -1000 -Inf -> NaN Invalid_operation
-ddor788 or -Inf -Inf -> NaN Invalid_operation
-ddor789 or -1 -Inf -> NaN Invalid_operation
-ddor790 or -0 -Inf -> NaN Invalid_operation
-ddor791 or 0 -Inf -> NaN Invalid_operation
-ddor792 or 1 -Inf -> NaN Invalid_operation
-ddor793 or 1000 -Inf -> NaN Invalid_operation
-ddor794 or Inf -Inf -> NaN Invalid_operation
-
-ddor800 or Inf -Inf -> NaN Invalid_operation
-ddor801 or Inf -1000 -> NaN Invalid_operation
-ddor802 or Inf -1 -> NaN Invalid_operation
-ddor803 or Inf -0 -> NaN Invalid_operation
-ddor804 or Inf 0 -> NaN Invalid_operation
-ddor805 or Inf 1 -> NaN Invalid_operation
-ddor806 or Inf 1000 -> NaN Invalid_operation
-ddor807 or Inf Inf -> NaN Invalid_operation
-ddor808 or -1000 Inf -> NaN Invalid_operation
-ddor809 or -Inf Inf -> NaN Invalid_operation
-ddor810 or -1 Inf -> NaN Invalid_operation
-ddor811 or -0 Inf -> NaN Invalid_operation
-ddor812 or 0 Inf -> NaN Invalid_operation
-ddor813 or 1 Inf -> NaN Invalid_operation
-ddor814 or 1000 Inf -> NaN Invalid_operation
-ddor815 or Inf Inf -> NaN Invalid_operation
-
-ddor821 or NaN -Inf -> NaN Invalid_operation
-ddor822 or NaN -1000 -> NaN Invalid_operation
-ddor823 or NaN -1 -> NaN Invalid_operation
-ddor824 or NaN -0 -> NaN Invalid_operation
-ddor825 or NaN 0 -> NaN Invalid_operation
-ddor826 or NaN 1 -> NaN Invalid_operation
-ddor827 or NaN 1000 -> NaN Invalid_operation
-ddor828 or NaN Inf -> NaN Invalid_operation
-ddor829 or NaN NaN -> NaN Invalid_operation
-ddor830 or -Inf NaN -> NaN Invalid_operation
-ddor831 or -1000 NaN -> NaN Invalid_operation
-ddor832 or -1 NaN -> NaN Invalid_operation
-ddor833 or -0 NaN -> NaN Invalid_operation
-ddor834 or 0 NaN -> NaN Invalid_operation
-ddor835 or 1 NaN -> NaN Invalid_operation
-ddor836 or 1000 NaN -> NaN Invalid_operation
-ddor837 or Inf NaN -> NaN Invalid_operation
-
-ddor841 or sNaN -Inf -> NaN Invalid_operation
-ddor842 or sNaN -1000 -> NaN Invalid_operation
-ddor843 or sNaN -1 -> NaN Invalid_operation
-ddor844 or sNaN -0 -> NaN Invalid_operation
-ddor845 or sNaN 0 -> NaN Invalid_operation
-ddor846 or sNaN 1 -> NaN Invalid_operation
-ddor847 or sNaN 1000 -> NaN Invalid_operation
-ddor848 or sNaN NaN -> NaN Invalid_operation
-ddor849 or sNaN sNaN -> NaN Invalid_operation
-ddor850 or NaN sNaN -> NaN Invalid_operation
-ddor851 or -Inf sNaN -> NaN Invalid_operation
-ddor852 or -1000 sNaN -> NaN Invalid_operation
-ddor853 or -1 sNaN -> NaN Invalid_operation
-ddor854 or -0 sNaN -> NaN Invalid_operation
-ddor855 or 0 sNaN -> NaN Invalid_operation
-ddor856 or 1 sNaN -> NaN Invalid_operation
-ddor857 or 1000 sNaN -> NaN Invalid_operation
-ddor858 or Inf sNaN -> NaN Invalid_operation
-ddor859 or NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddor861 or NaN1 -Inf -> NaN Invalid_operation
-ddor862 or +NaN2 -1000 -> NaN Invalid_operation
-ddor863 or NaN3 1000 -> NaN Invalid_operation
-ddor864 or NaN4 Inf -> NaN Invalid_operation
-ddor865 or NaN5 +NaN6 -> NaN Invalid_operation
-ddor866 or -Inf NaN7 -> NaN Invalid_operation
-ddor867 or -1000 NaN8 -> NaN Invalid_operation
-ddor868 or 1000 NaN9 -> NaN Invalid_operation
-ddor869 or Inf +NaN10 -> NaN Invalid_operation
-ddor871 or sNaN11 -Inf -> NaN Invalid_operation
-ddor872 or sNaN12 -1000 -> NaN Invalid_operation
-ddor873 or sNaN13 1000 -> NaN Invalid_operation
-ddor874 or sNaN14 NaN17 -> NaN Invalid_operation
-ddor875 or sNaN15 sNaN18 -> NaN Invalid_operation
-ddor876 or NaN16 sNaN19 -> NaN Invalid_operation
-ddor877 or -Inf +sNaN20 -> NaN Invalid_operation
-ddor878 or -1000 sNaN21 -> NaN Invalid_operation
-ddor879 or 1000 sNaN22 -> NaN Invalid_operation
-ddor880 or Inf sNaN23 -> NaN Invalid_operation
-ddor881 or +NaN25 +sNaN24 -> NaN Invalid_operation
-ddor882 or -NaN26 NaN28 -> NaN Invalid_operation
-ddor883 or -sNaN27 sNaN29 -> NaN Invalid_operation
-ddor884 or 1000 -NaN30 -> NaN Invalid_operation
-ddor885 or 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddOr.decTest -- digitwise logical OR for decDoubles --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check (truth table)
+ddor001 or 0 0 -> 0
+ddor002 or 0 1 -> 1
+ddor003 or 1 0 -> 1
+ddor004 or 1 1 -> 1
+ddor005 or 1100 1010 -> 1110
+-- and at msd and msd-1
+ddor006 or 0000000000000000 0000000000000000 -> 0
+ddor007 or 0000000000000000 1000000000000000 -> 1000000000000000
+ddor008 or 1000000000000000 0000000000000000 -> 1000000000000000
+ddor009 or 1000000000000000 1000000000000000 -> 1000000000000000
+ddor010 or 0000000000000000 0000000000000000 -> 0
+ddor011 or 0000000000000000 0100000000000000 -> 100000000000000
+ddor012 or 0100000000000000 0000000000000000 -> 100000000000000
+ddor013 or 0100000000000000 0100000000000000 -> 100000000000000
+
+-- Various lengths
+-- 1234567890123456 1234567890123456 1234567890123456
+ddor020 or 1111111111111111 1111111111111111 -> 1111111111111111
+ddor021 or 111111111111111 111111111111111 -> 111111111111111
+ddor022 or 11111111111111 11111111111111 -> 11111111111111
+ddor023 or 1111111111111 1111111111111 -> 1111111111111
+ddor024 or 111111111111 111111111111 -> 111111111111
+ddor025 or 11111111111 11111111111 -> 11111111111
+ddor026 or 1111111111 1111111111 -> 1111111111
+ddor027 or 111111111 111111111 -> 111111111
+ddor028 or 11111111 11111111 -> 11111111
+ddor029 or 1111111 1111111 -> 1111111
+ddor030 or 111111 111111 -> 111111
+ddor031 or 11111 11111 -> 11111
+ddor032 or 1111 1111 -> 1111
+ddor033 or 111 111 -> 111
+ddor034 or 11 11 -> 11
+ddor035 or 1 1 -> 1
+ddor036 or 0 0 -> 0
+
+ddor042 or 111111110000000 1111111110000000 -> 1111111110000000
+ddor043 or 11111110000000 1000000100000000 -> 1011111110000000
+ddor044 or 1111110000000 1000001000000000 -> 1001111110000000
+ddor045 or 111110000000 1000010000000000 -> 1000111110000000
+ddor046 or 11110000000 1000100000000000 -> 1000111110000000
+ddor047 or 1110000000 1001000000000000 -> 1001001110000000
+ddor048 or 110000000 1010000000000000 -> 1010000110000000
+ddor049 or 10000000 1100000000000000 -> 1100000010000000
+
+ddor090 or 011111111 111101111 -> 111111111
+ddor091 or 101111111 111101111 -> 111111111
+ddor092 or 110111111 111101111 -> 111111111
+ddor093 or 111011111 111101111 -> 111111111
+ddor094 or 111101111 111101111 -> 111101111
+ddor095 or 111110111 111101111 -> 111111111
+ddor096 or 111111011 111101111 -> 111111111
+ddor097 or 111111101 111101111 -> 111111111
+ddor098 or 111111110 111101111 -> 111111111
+
+ddor100 or 111101111 011111111 -> 111111111
+ddor101 or 111101111 101111111 -> 111111111
+ddor102 or 111101111 110111111 -> 111111111
+ddor103 or 111101111 111011111 -> 111111111
+ddor104 or 111101111 111101111 -> 111101111
+ddor105 or 111101111 111110111 -> 111111111
+ddor106 or 111101111 111111011 -> 111111111
+ddor107 or 111101111 111111101 -> 111111111
+ddor108 or 111101111 111111110 -> 111111111
+
+-- non-0/1 should not be accepted, nor should signs
+ddor220 or 111111112 111111111 -> NaN Invalid_operation
+ddor221 or 333333333 333333333 -> NaN Invalid_operation
+ddor222 or 555555555 555555555 -> NaN Invalid_operation
+ddor223 or 777777777 777777777 -> NaN Invalid_operation
+ddor224 or 999999999 999999999 -> NaN Invalid_operation
+ddor225 or 222222222 999999999 -> NaN Invalid_operation
+ddor226 or 444444444 999999999 -> NaN Invalid_operation
+ddor227 or 666666666 999999999 -> NaN Invalid_operation
+ddor228 or 888888888 999999999 -> NaN Invalid_operation
+ddor229 or 999999999 222222222 -> NaN Invalid_operation
+ddor230 or 999999999 444444444 -> NaN Invalid_operation
+ddor231 or 999999999 666666666 -> NaN Invalid_operation
+ddor232 or 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+ddor240 or 567468689 -934981942 -> NaN Invalid_operation
+ddor241 or 567367689 934981942 -> NaN Invalid_operation
+ddor242 or -631917772 -706014634 -> NaN Invalid_operation
+ddor243 or -756253257 138579234 -> NaN Invalid_operation
+ddor244 or 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+ddor250 or 2000000000000000 1000000000000000 -> NaN Invalid_operation
+ddor251 or 7000000000000000 1000000000000000 -> NaN Invalid_operation
+ddor252 or 8000000000000000 1000000000000000 -> NaN Invalid_operation
+ddor253 or 9000000000000000 1000000000000000 -> NaN Invalid_operation
+ddor254 or 2000000000000000 0000000000000000 -> NaN Invalid_operation
+ddor255 or 7000000000000000 0000000000000000 -> NaN Invalid_operation
+ddor256 or 8000000000000000 0000000000000000 -> NaN Invalid_operation
+ddor257 or 9000000000000000 0000000000000000 -> NaN Invalid_operation
+ddor258 or 1000000000000000 2000000000000000 -> NaN Invalid_operation
+ddor259 or 1000000000000000 7000000000000000 -> NaN Invalid_operation
+ddor260 or 1000000000000000 8000000000000000 -> NaN Invalid_operation
+ddor261 or 1000000000000000 9000000000000000 -> NaN Invalid_operation
+ddor262 or 0000000000000000 2000000000000000 -> NaN Invalid_operation
+ddor263 or 0000000000000000 7000000000000000 -> NaN Invalid_operation
+ddor264 or 0000000000000000 8000000000000000 -> NaN Invalid_operation
+ddor265 or 0000000000000000 9000000000000000 -> NaN Invalid_operation
+-- test MSD-1
+ddor270 or 0200001000000000 1000100000000010 -> NaN Invalid_operation
+ddor271 or 0700000100000000 1000010000000100 -> NaN Invalid_operation
+ddor272 or 0800000010000000 1000001000001000 -> NaN Invalid_operation
+ddor273 or 0900000001000000 1000000100010000 -> NaN Invalid_operation
+ddor274 or 1000000000100000 0200000010100000 -> NaN Invalid_operation
+ddor275 or 1000000000010000 0700000001000000 -> NaN Invalid_operation
+ddor276 or 1000000000001000 0800000010100000 -> NaN Invalid_operation
+ddor277 or 1000000000000100 0900000000010000 -> NaN Invalid_operation
+-- test LSD
+ddor280 or 0010000000000002 1000000100000001 -> NaN Invalid_operation
+ddor281 or 0001000000000007 1000001000000011 -> NaN Invalid_operation
+ddor282 or 0000100000000008 1000010000000001 -> NaN Invalid_operation
+ddor283 or 0000010000000009 1000100000000001 -> NaN Invalid_operation
+ddor284 or 1000001000000000 0001000000000002 -> NaN Invalid_operation
+ddor285 or 1000000100000000 0010000000000007 -> NaN Invalid_operation
+ddor286 or 1000000010000000 0100000000000008 -> NaN Invalid_operation
+ddor287 or 1000000001000000 1000000000000009 -> NaN Invalid_operation
+-- test Middie
+ddor288 or 0010000020000000 1000001000000000 -> NaN Invalid_operation
+ddor289 or 0001000070000001 1000000100000000 -> NaN Invalid_operation
+ddor290 or 0000100080000010 1000000010000000 -> NaN Invalid_operation
+ddor291 or 0000010090000100 1000000001000000 -> NaN Invalid_operation
+ddor292 or 1000001000001000 0000000020100000 -> NaN Invalid_operation
+ddor293 or 1000000100010000 0000000070010000 -> NaN Invalid_operation
+ddor294 or 1000000010100000 0000000080001000 -> NaN Invalid_operation
+ddor295 or 1000000001000000 0000000090000100 -> NaN Invalid_operation
+-- signs
+ddor296 or -1000000001000000 -0000010000000100 -> NaN Invalid_operation
+ddor297 or -1000000001000000 0000000010000100 -> NaN Invalid_operation
+ddor298 or 1000000001000000 -0000001000000100 -> NaN Invalid_operation
+ddor299 or 1000000001000000 0000000011000100 -> 1000000011000100
+
+-- Nmax, Nmin, Ntiny-like
+ddor331 or 2 9.99999999E+199 -> NaN Invalid_operation
+ddor332 or 3 1E-199 -> NaN Invalid_operation
+ddor333 or 4 1.00000000E-199 -> NaN Invalid_operation
+ddor334 or 5 1E-100 -> NaN Invalid_operation
+ddor335 or 6 -1E-100 -> NaN Invalid_operation
+ddor336 or 7 -1.00000000E-199 -> NaN Invalid_operation
+ddor337 or 8 -1E-199 -> NaN Invalid_operation
+ddor338 or 9 -9.99999999E+199 -> NaN Invalid_operation
+ddor341 or 9.99999999E+299 -18 -> NaN Invalid_operation
+ddor342 or 1E-299 01 -> NaN Invalid_operation
+ddor343 or 1.00000000E-299 -18 -> NaN Invalid_operation
+ddor344 or 1E-100 18 -> NaN Invalid_operation
+ddor345 or -1E-100 -10 -> NaN Invalid_operation
+ddor346 or -1.00000000E-299 18 -> NaN Invalid_operation
+ddor347 or -1E-299 10 -> NaN Invalid_operation
+ddor348 or -9.99999999E+299 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+ddor361 or 1.0 1 -> NaN Invalid_operation
+ddor362 or 1E+1 1 -> NaN Invalid_operation
+ddor363 or 0.0 1 -> NaN Invalid_operation
+ddor364 or 0E+1 1 -> NaN Invalid_operation
+ddor365 or 9.9 1 -> NaN Invalid_operation
+ddor366 or 9E+1 1 -> NaN Invalid_operation
+ddor371 or 0 1.0 -> NaN Invalid_operation
+ddor372 or 0 1E+1 -> NaN Invalid_operation
+ddor373 or 0 0.0 -> NaN Invalid_operation
+ddor374 or 0 0E+1 -> NaN Invalid_operation
+ddor375 or 0 9.9 -> NaN Invalid_operation
+ddor376 or 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+ddor780 or -Inf -Inf -> NaN Invalid_operation
+ddor781 or -Inf -1000 -> NaN Invalid_operation
+ddor782 or -Inf -1 -> NaN Invalid_operation
+ddor783 or -Inf -0 -> NaN Invalid_operation
+ddor784 or -Inf 0 -> NaN Invalid_operation
+ddor785 or -Inf 1 -> NaN Invalid_operation
+ddor786 or -Inf 1000 -> NaN Invalid_operation
+ddor787 or -1000 -Inf -> NaN Invalid_operation
+ddor788 or -Inf -Inf -> NaN Invalid_operation
+ddor789 or -1 -Inf -> NaN Invalid_operation
+ddor790 or -0 -Inf -> NaN Invalid_operation
+ddor791 or 0 -Inf -> NaN Invalid_operation
+ddor792 or 1 -Inf -> NaN Invalid_operation
+ddor793 or 1000 -Inf -> NaN Invalid_operation
+ddor794 or Inf -Inf -> NaN Invalid_operation
+
+ddor800 or Inf -Inf -> NaN Invalid_operation
+ddor801 or Inf -1000 -> NaN Invalid_operation
+ddor802 or Inf -1 -> NaN Invalid_operation
+ddor803 or Inf -0 -> NaN Invalid_operation
+ddor804 or Inf 0 -> NaN Invalid_operation
+ddor805 or Inf 1 -> NaN Invalid_operation
+ddor806 or Inf 1000 -> NaN Invalid_operation
+ddor807 or Inf Inf -> NaN Invalid_operation
+ddor808 or -1000 Inf -> NaN Invalid_operation
+ddor809 or -Inf Inf -> NaN Invalid_operation
+ddor810 or -1 Inf -> NaN Invalid_operation
+ddor811 or -0 Inf -> NaN Invalid_operation
+ddor812 or 0 Inf -> NaN Invalid_operation
+ddor813 or 1 Inf -> NaN Invalid_operation
+ddor814 or 1000 Inf -> NaN Invalid_operation
+ddor815 or Inf Inf -> NaN Invalid_operation
+
+ddor821 or NaN -Inf -> NaN Invalid_operation
+ddor822 or NaN -1000 -> NaN Invalid_operation
+ddor823 or NaN -1 -> NaN Invalid_operation
+ddor824 or NaN -0 -> NaN Invalid_operation
+ddor825 or NaN 0 -> NaN Invalid_operation
+ddor826 or NaN 1 -> NaN Invalid_operation
+ddor827 or NaN 1000 -> NaN Invalid_operation
+ddor828 or NaN Inf -> NaN Invalid_operation
+ddor829 or NaN NaN -> NaN Invalid_operation
+ddor830 or -Inf NaN -> NaN Invalid_operation
+ddor831 or -1000 NaN -> NaN Invalid_operation
+ddor832 or -1 NaN -> NaN Invalid_operation
+ddor833 or -0 NaN -> NaN Invalid_operation
+ddor834 or 0 NaN -> NaN Invalid_operation
+ddor835 or 1 NaN -> NaN Invalid_operation
+ddor836 or 1000 NaN -> NaN Invalid_operation
+ddor837 or Inf NaN -> NaN Invalid_operation
+
+ddor841 or sNaN -Inf -> NaN Invalid_operation
+ddor842 or sNaN -1000 -> NaN Invalid_operation
+ddor843 or sNaN -1 -> NaN Invalid_operation
+ddor844 or sNaN -0 -> NaN Invalid_operation
+ddor845 or sNaN 0 -> NaN Invalid_operation
+ddor846 or sNaN 1 -> NaN Invalid_operation
+ddor847 or sNaN 1000 -> NaN Invalid_operation
+ddor848 or sNaN NaN -> NaN Invalid_operation
+ddor849 or sNaN sNaN -> NaN Invalid_operation
+ddor850 or NaN sNaN -> NaN Invalid_operation
+ddor851 or -Inf sNaN -> NaN Invalid_operation
+ddor852 or -1000 sNaN -> NaN Invalid_operation
+ddor853 or -1 sNaN -> NaN Invalid_operation
+ddor854 or -0 sNaN -> NaN Invalid_operation
+ddor855 or 0 sNaN -> NaN Invalid_operation
+ddor856 or 1 sNaN -> NaN Invalid_operation
+ddor857 or 1000 sNaN -> NaN Invalid_operation
+ddor858 or Inf sNaN -> NaN Invalid_operation
+ddor859 or NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddor861 or NaN1 -Inf -> NaN Invalid_operation
+ddor862 or +NaN2 -1000 -> NaN Invalid_operation
+ddor863 or NaN3 1000 -> NaN Invalid_operation
+ddor864 or NaN4 Inf -> NaN Invalid_operation
+ddor865 or NaN5 +NaN6 -> NaN Invalid_operation
+ddor866 or -Inf NaN7 -> NaN Invalid_operation
+ddor867 or -1000 NaN8 -> NaN Invalid_operation
+ddor868 or 1000 NaN9 -> NaN Invalid_operation
+ddor869 or Inf +NaN10 -> NaN Invalid_operation
+ddor871 or sNaN11 -Inf -> NaN Invalid_operation
+ddor872 or sNaN12 -1000 -> NaN Invalid_operation
+ddor873 or sNaN13 1000 -> NaN Invalid_operation
+ddor874 or sNaN14 NaN17 -> NaN Invalid_operation
+ddor875 or sNaN15 sNaN18 -> NaN Invalid_operation
+ddor876 or NaN16 sNaN19 -> NaN Invalid_operation
+ddor877 or -Inf +sNaN20 -> NaN Invalid_operation
+ddor878 or -1000 sNaN21 -> NaN Invalid_operation
+ddor879 or 1000 sNaN22 -> NaN Invalid_operation
+ddor880 or Inf sNaN23 -> NaN Invalid_operation
+ddor881 or +NaN25 +sNaN24 -> NaN Invalid_operation
+ddor882 or -NaN26 NaN28 -> NaN Invalid_operation
+ddor883 or -sNaN27 sNaN29 -> NaN Invalid_operation
+ddor884 or 1000 -NaN30 -> NaN Invalid_operation
+ddor885 or 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddPlus.decTest b/Lib/test/decimaltestdata/ddPlus.decTest
index 5191239bf7..17aa08af9f 100644
--- a/Lib/test/decimaltestdata/ddPlus.decTest
+++ b/Lib/test/decimaltestdata/ddPlus.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- ddPlus.decTest -- decDouble 0+x --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddpls001 plus +7.50 -> 7.50
-
--- Infinities
-ddpls011 plus Infinity -> Infinity
-ddpls012 plus -Infinity -> -Infinity
-
--- NaNs, 0 payload
-ddpls021 plus NaN -> NaN
-ddpls022 plus -NaN -> -NaN
-ddpls023 plus sNaN -> NaN Invalid_operation
-ddpls024 plus -sNaN -> -NaN Invalid_operation
-
--- NaNs, non-0 payload
-ddpls031 plus NaN13 -> NaN13
-ddpls032 plus -NaN13 -> -NaN13
-ddpls033 plus sNaN13 -> NaN13 Invalid_operation
-ddpls034 plus -sNaN13 -> -NaN13 Invalid_operation
-ddpls035 plus NaN70 -> NaN70
-ddpls036 plus -NaN70 -> -NaN70
-ddpls037 plus sNaN101 -> NaN101 Invalid_operation
-ddpls038 plus -sNaN101 -> -NaN101 Invalid_operation
-
--- finites
-ddpls101 plus 7 -> 7
-ddpls102 plus -7 -> -7
-ddpls103 plus 75 -> 75
-ddpls104 plus -75 -> -75
-ddpls105 plus 7.50 -> 7.50
-ddpls106 plus -7.50 -> -7.50
-ddpls107 plus 7.500 -> 7.500
-ddpls108 plus -7.500 -> -7.500
-
--- zeros
-ddpls111 plus 0 -> 0
-ddpls112 plus -0 -> 0
-ddpls113 plus 0E+4 -> 0E+4
-ddpls114 plus -0E+4 -> 0E+4
-ddpls115 plus 0.0000 -> 0.0000
-ddpls116 plus -0.0000 -> 0.0000
-ddpls117 plus 0E-141 -> 0E-141
-ddpls118 plus -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-ddpls121 plus 2682682682682682 -> 2682682682682682
-ddpls122 plus -2682682682682682 -> -2682682682682682
-ddpls123 plus 1341341341341341 -> 1341341341341341
-ddpls124 plus -1341341341341341 -> -1341341341341341
-
--- Nmax, Nmin, Ntiny
-ddpls131 plus 9.999999999999999E+384 -> 9.999999999999999E+384
-ddpls132 plus 1E-383 -> 1E-383
-ddpls133 plus 1.000000000000000E-383 -> 1.000000000000000E-383
-ddpls134 plus 1E-398 -> 1E-398 Subnormal
-
-ddpls135 plus -1E-398 -> -1E-398 Subnormal
-ddpls136 plus -1.000000000000000E-383 -> -1.000000000000000E-383
-ddpls137 plus -1E-383 -> -1E-383
-ddpls138 plus -9.999999999999999E+384 -> -9.999999999999999E+384
+------------------------------------------------------------------------
+-- ddPlus.decTest -- decDouble 0+x --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddpls001 plus +7.50 -> 7.50
+
+-- Infinities
+ddpls011 plus Infinity -> Infinity
+ddpls012 plus -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+ddpls021 plus NaN -> NaN
+ddpls022 plus -NaN -> -NaN
+ddpls023 plus sNaN -> NaN Invalid_operation
+ddpls024 plus -sNaN -> -NaN Invalid_operation
+
+-- NaNs, non-0 payload
+ddpls031 plus NaN13 -> NaN13
+ddpls032 plus -NaN13 -> -NaN13
+ddpls033 plus sNaN13 -> NaN13 Invalid_operation
+ddpls034 plus -sNaN13 -> -NaN13 Invalid_operation
+ddpls035 plus NaN70 -> NaN70
+ddpls036 plus -NaN70 -> -NaN70
+ddpls037 plus sNaN101 -> NaN101 Invalid_operation
+ddpls038 plus -sNaN101 -> -NaN101 Invalid_operation
+
+-- finites
+ddpls101 plus 7 -> 7
+ddpls102 plus -7 -> -7
+ddpls103 plus 75 -> 75
+ddpls104 plus -75 -> -75
+ddpls105 plus 7.50 -> 7.50
+ddpls106 plus -7.50 -> -7.50
+ddpls107 plus 7.500 -> 7.500
+ddpls108 plus -7.500 -> -7.500
+
+-- zeros
+ddpls111 plus 0 -> 0
+ddpls112 plus -0 -> 0
+ddpls113 plus 0E+4 -> 0E+4
+ddpls114 plus -0E+4 -> 0E+4
+ddpls115 plus 0.0000 -> 0.0000
+ddpls116 plus -0.0000 -> 0.0000
+ddpls117 plus 0E-141 -> 0E-141
+ddpls118 plus -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+ddpls121 plus 2682682682682682 -> 2682682682682682
+ddpls122 plus -2682682682682682 -> -2682682682682682
+ddpls123 plus 1341341341341341 -> 1341341341341341
+ddpls124 plus -1341341341341341 -> -1341341341341341
+
+-- Nmax, Nmin, Ntiny
+ddpls131 plus 9.999999999999999E+384 -> 9.999999999999999E+384
+ddpls132 plus 1E-383 -> 1E-383
+ddpls133 plus 1.000000000000000E-383 -> 1.000000000000000E-383
+ddpls134 plus 1E-398 -> 1E-398 Subnormal
+
+ddpls135 plus -1E-398 -> -1E-398 Subnormal
+ddpls136 plus -1.000000000000000E-383 -> -1.000000000000000E-383
+ddpls137 plus -1E-383 -> -1E-383
+ddpls138 plus -9.999999999999999E+384 -> -9.999999999999999E+384
diff --git a/Lib/test/decimaltestdata/ddQuantize.decTest b/Lib/test/decimaltestdata/ddQuantize.decTest
index 9177620169..0d19c9dcec 100644
--- a/Lib/test/decimaltestdata/ddQuantize.decTest
+++ b/Lib/test/decimaltestdata/ddQuantize.decTest
@@ -1,833 +1,833 @@
-------------------------------------------------------------------------
--- ddQuantize.decTest -- decDouble quantize operation --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Most of the tests here assume a "regular pattern", where the
--- sign and coefficient are +1.
--- 2004.03.15 Underflow for quantize is suppressed
--- 2005.06.08 More extensive tests for 'does not fit'
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks
-ddqua001 quantize 0 1e0 -> 0
-ddqua002 quantize 1 1e0 -> 1
-ddqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
-ddqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
-ddqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
-ddqua007 quantize 0.1 1e-1 -> 0.1
-ddqua008 quantize 0.1 1e-2 -> 0.10
-ddqua009 quantize 0.1 1e-3 -> 0.100
-ddqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
-ddqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
-ddqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
-ddqua013 quantize 0.9 1e-1 -> 0.9
-ddqua014 quantize 0.9 1e-2 -> 0.90
-ddqua015 quantize 0.9 1e-3 -> 0.900
--- negatives
-ddqua021 quantize -0 1e0 -> -0
-ddqua022 quantize -1 1e0 -> -1
-ddqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
-ddqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
-ddqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
-ddqua027 quantize -0.1 1e-1 -> -0.1
-ddqua028 quantize -0.1 1e-2 -> -0.10
-ddqua029 quantize -0.1 1e-3 -> -0.100
-ddqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
-ddqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
-ddqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
-ddqua033 quantize -0.9 1e-1 -> -0.9
-ddqua034 quantize -0.9 1e-2 -> -0.90
-ddqua035 quantize -0.9 1e-3 -> -0.900
-ddqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
-ddqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
-ddqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
-ddqua039 quantize -0.5 1e-1 -> -0.5
-ddqua040 quantize -0.5 1e-2 -> -0.50
-ddqua041 quantize -0.5 1e-3 -> -0.500
-ddqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
-ddqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
-ddqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
-ddqua045 quantize -0.9 1e-1 -> -0.9
-ddqua046 quantize -0.9 1e-2 -> -0.90
-ddqua047 quantize -0.9 1e-3 -> -0.900
-
--- examples from Specification
-ddqua060 quantize 2.17 0.001 -> 2.170
-ddqua061 quantize 2.17 0.01 -> 2.17
-ddqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
-ddqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
-ddqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
-ddqua065 quantize -Inf Inf -> -Infinity
-ddqua066 quantize 2 Inf -> NaN Invalid_operation
-ddqua067 quantize -0.1 1 -> -0 Inexact Rounded
-ddqua068 quantize -0 1e+5 -> -0E+5
-ddqua069 quantize +123456789012345.6 1e-2 -> NaN Invalid_operation
-ddqua070 quantize -987654335236450.6 1e-2 -> NaN Invalid_operation
-ddqua071 quantize 217 1e-1 -> 217.0
-ddqua072 quantize 217 1e+0 -> 217
-ddqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
-ddqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
-
--- general tests ..
-ddqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
-ddqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
-ddqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
-ddqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
-ddqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
-ddqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
-ddqua095 quantize 1.2345 1e-6 -> 1.234500
-ddqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
-ddqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
-ddqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
-ddqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
-ddqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
-
-ddqua101 quantize -1 1e0 -> -1
-ddqua102 quantize -1 1e-1 -> -1.0
-ddqua103 quantize -1 1e-2 -> -1.00
-ddqua104 quantize 0 1e0 -> 0
-ddqua105 quantize 0 1e-1 -> 0.0
-ddqua106 quantize 0 1e-2 -> 0.00
-ddqua107 quantize 0.00 1e0 -> 0
-ddqua108 quantize 0 1e+1 -> 0E+1
-ddqua109 quantize 0 1e+2 -> 0E+2
-ddqua110 quantize +1 1e0 -> 1
-ddqua111 quantize +1 1e-1 -> 1.0
-ddqua112 quantize +1 1e-2 -> 1.00
-
-ddqua120 quantize 1.04 1e-3 -> 1.040
-ddqua121 quantize 1.04 1e-2 -> 1.04
-ddqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
-ddqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
-ddqua124 quantize 1.05 1e-3 -> 1.050
-ddqua125 quantize 1.05 1e-2 -> 1.05
-ddqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
-ddqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
-ddqua132 quantize 1.06 1e-3 -> 1.060
-ddqua133 quantize 1.06 1e-2 -> 1.06
-ddqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
-ddqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
-
-ddqua140 quantize -10 1e-2 -> -10.00
-ddqua141 quantize +1 1e-2 -> 1.00
-ddqua142 quantize +10 1e-2 -> 10.00
-ddqua143 quantize 1E+17 1e-2 -> NaN Invalid_operation
-ddqua144 quantize 1E-17 1e-2 -> 0.00 Inexact Rounded
-ddqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
-ddqua146 quantize 1E-2 1e-2 -> 0.01
-ddqua147 quantize 1E-1 1e-2 -> 0.10
-ddqua148 quantize 0E-17 1e-2 -> 0.00
-
-ddqua150 quantize 1.0600 1e-5 -> 1.06000
-ddqua151 quantize 1.0600 1e-4 -> 1.0600
-ddqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
-ddqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
-ddqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
-ddqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
-
--- a couple where rounding was different in base tests
-rounding: half_up
-ddqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
-ddqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
-ddqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
-rounding: half_even
-
--- base tests with non-1 coefficients
-ddqua161 quantize 0 -9e0 -> 0
-ddqua162 quantize 1 -7e0 -> 1
-ddqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
-ddqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
-ddqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
-ddqua167 quantize 0.1 3e-1 -> 0.1
-ddqua168 quantize 0.1 44e-2 -> 0.10
-ddqua169 quantize 0.1 555e-3 -> 0.100
-ddqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
-ddqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
-ddqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
-ddqua173 quantize 0.9 -9e-1 -> 0.9
-ddqua174 quantize 0.9 0e-2 -> 0.90
-ddqua175 quantize 0.9 1.1e-3 -> 0.9000
--- negatives
-ddqua181 quantize -0 1.1e0 -> -0.0
-ddqua182 quantize -1 -1e0 -> -1
-ddqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
-ddqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
-ddqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
-ddqua187 quantize -0.1 -91e-1 -> -0.1
-ddqua188 quantize -0.1 -.1e-2 -> -0.100
-ddqua189 quantize -0.1 -1e-3 -> -0.100
-ddqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
-ddqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
-ddqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
-ddqua193 quantize -0.9 100e-1 -> -0.9
-ddqua194 quantize -0.9 999e-2 -> -0.90
-
--- +ve exponents ..
-ddqua201 quantize -1 1e+0 -> -1
-ddqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
-ddqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
-ddqua204 quantize 0 1e+0 -> 0
-ddqua205 quantize 0 1e+1 -> 0E+1
-ddqua206 quantize 0 1e+2 -> 0E+2
-ddqua207 quantize +1 1e+0 -> 1
-ddqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
-ddqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
-
-ddqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
-ddqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
-ddqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
-ddqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
-ddqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
-ddqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
-ddqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
-ddqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
-ddqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
-ddqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
-ddqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
-ddqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
-ddqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
-ddqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
-ddqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
-ddqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
-
-ddqua240 quantize -10 1e+1 -> -1E+1 Rounded
-ddqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
-ddqua242 quantize +10 1e+1 -> 1E+1 Rounded
-ddqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
-ddqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
-ddqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
-ddqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
-ddqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
-ddqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
-ddqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
-ddqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
-ddqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
--- next one tries to add 9 zeros
-ddqua252 quantize 1E+17 1e+1 -> NaN Invalid_operation
-ddqua253 quantize 1E-17 1e+1 -> 0E+1 Inexact Rounded
-ddqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
-ddqua255 quantize 0E-17 1e+1 -> 0E+1
-ddqua256 quantize -0E-17 1e+1 -> -0E+1
-ddqua257 quantize -0E-1 1e+1 -> -0E+1
-ddqua258 quantize -0 1e+1 -> -0E+1
-ddqua259 quantize -0E+1 1e+1 -> -0E+1
-
-ddqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
-ddqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
-ddqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
-ddqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
-ddqua264 quantize 1E+2 1e+2 -> 1E+2
-ddqua265 quantize 1E+3 1e+2 -> 1.0E+3
-ddqua266 quantize 1E+4 1e+2 -> 1.00E+4
-ddqua267 quantize 1E+5 1e+2 -> 1.000E+5
-ddqua268 quantize 1E+6 1e+2 -> 1.0000E+6
-ddqua269 quantize 1E+7 1e+2 -> 1.00000E+7
-ddqua270 quantize 1E+8 1e+2 -> 1.000000E+8
-ddqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
-ddqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
-ddqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
-ddqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
-ddqua275 quantize 0E-10 1e+2 -> 0E+2
-
-ddqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
-ddqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
-ddqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
-ddqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
-ddqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
-ddqua285 quantize 1E+3 1e+3 -> 1E+3
-ddqua286 quantize 1E+4 1e+3 -> 1.0E+4
-ddqua287 quantize 1E+5 1e+3 -> 1.00E+5
-ddqua288 quantize 1E+6 1e+3 -> 1.000E+6
-ddqua289 quantize 1E+7 1e+3 -> 1.0000E+7
-ddqua290 quantize 1E+8 1e+3 -> 1.00000E+8
-ddqua291 quantize 1E+9 1e+3 -> 1.000000E+9
-ddqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
-ddqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
-ddqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
-ddqua295 quantize 0E-10 1e+3 -> 0E+3
-
--- round up from below [sign wrong in JIT compiler once]
-ddqua300 quantize 0.0078 1e-5 -> 0.00780
-ddqua301 quantize 0.0078 1e-4 -> 0.0078
-ddqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
-ddqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
-ddqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
-ddqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
-ddqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
-ddqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
-
-ddqua310 quantize -0.0078 1e-5 -> -0.00780
-ddqua311 quantize -0.0078 1e-4 -> -0.0078
-ddqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
-ddqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
-ddqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
-ddqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
-ddqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
-ddqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
-
-ddqua320 quantize 0.078 1e-5 -> 0.07800
-ddqua321 quantize 0.078 1e-4 -> 0.0780
-ddqua322 quantize 0.078 1e-3 -> 0.078
-ddqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
-ddqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
-ddqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
-ddqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
-ddqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
-
-ddqua330 quantize -0.078 1e-5 -> -0.07800
-ddqua331 quantize -0.078 1e-4 -> -0.0780
-ddqua332 quantize -0.078 1e-3 -> -0.078
-ddqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
-ddqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
-ddqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
-ddqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
-ddqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
-
-ddqua340 quantize 0.78 1e-5 -> 0.78000
-ddqua341 quantize 0.78 1e-4 -> 0.7800
-ddqua342 quantize 0.78 1e-3 -> 0.780
-ddqua343 quantize 0.78 1e-2 -> 0.78
-ddqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
-ddqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
-ddqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
-ddqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
-
-ddqua350 quantize -0.78 1e-5 -> -0.78000
-ddqua351 quantize -0.78 1e-4 -> -0.7800
-ddqua352 quantize -0.78 1e-3 -> -0.780
-ddqua353 quantize -0.78 1e-2 -> -0.78
-ddqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
-ddqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
-ddqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
-ddqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
-
-ddqua360 quantize 7.8 1e-5 -> 7.80000
-ddqua361 quantize 7.8 1e-4 -> 7.8000
-ddqua362 quantize 7.8 1e-3 -> 7.800
-ddqua363 quantize 7.8 1e-2 -> 7.80
-ddqua364 quantize 7.8 1e-1 -> 7.8
-ddqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
-ddqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
-ddqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
-ddqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
-
-ddqua370 quantize -7.8 1e-5 -> -7.80000
-ddqua371 quantize -7.8 1e-4 -> -7.8000
-ddqua372 quantize -7.8 1e-3 -> -7.800
-ddqua373 quantize -7.8 1e-2 -> -7.80
-ddqua374 quantize -7.8 1e-1 -> -7.8
-ddqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
-ddqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
-ddqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
-ddqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
-
--- some individuals
-ddqua380 quantize 1234567352364.506 1e-2 -> 1234567352364.51 Inexact Rounded
-ddqua381 quantize 12345673523645.06 1e-2 -> 12345673523645.06
-ddqua382 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
-ddqua383 quantize 1234567352364506 1e-2 -> NaN Invalid_operation
-ddqua384 quantize -1234567352364.506 1e-2 -> -1234567352364.51 Inexact Rounded
-ddqua385 quantize -12345673523645.06 1e-2 -> -12345673523645.06
-ddqua386 quantize -123456735236450.6 1e-2 -> NaN Invalid_operation
-ddqua387 quantize -1234567352364506 1e-2 -> NaN Invalid_operation
-
-rounding: down
-ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
--- ? should that one instead have been:
--- ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
-rounding: half_up
-
--- and a few more from e-mail discussions
-ddqua391 quantize 12345678912.34567 1e-3 -> 12345678912.346 Inexact Rounded
-ddqua392 quantize 123456789123.4567 1e-3 -> 123456789123.457 Inexact Rounded
-ddqua393 quantize 1234567891234.567 1e-3 -> 1234567891234.567
-ddqua394 quantize 12345678912345.67 1e-3 -> NaN Invalid_operation
-ddqua395 quantize 123456789123456.7 1e-3 -> NaN Invalid_operation
-ddqua396 quantize 1234567891234567. 1e-3 -> NaN Invalid_operation
-
--- some 9999 round-up cases
-ddqua400 quantize 9.999 1e-5 -> 9.99900
-ddqua401 quantize 9.999 1e-4 -> 9.9990
-ddqua402 quantize 9.999 1e-3 -> 9.999
-ddqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
-ddqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
-ddqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
-ddqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
-ddqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
-
-ddqua410 quantize 0.999 1e-5 -> 0.99900
-ddqua411 quantize 0.999 1e-4 -> 0.9990
-ddqua412 quantize 0.999 1e-3 -> 0.999
-ddqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
-ddqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
-ddqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
-ddqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
-
-ddqua420 quantize 0.0999 1e-5 -> 0.09990
-ddqua421 quantize 0.0999 1e-4 -> 0.0999
-ddqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
-ddqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
-ddqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
-ddqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
-ddqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
-
-ddqua430 quantize 0.00999 1e-5 -> 0.00999
-ddqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
-ddqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
-ddqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
-ddqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
-ddqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
-ddqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
-
-ddqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
-ddqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
-ddqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
-ddqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
-ddqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
-ddqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
-ddqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
-
-ddqua1001 quantize 0.000 0.001 -> 0.000
-ddqua1002 quantize 0.001 0.001 -> 0.001
-ddqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
-ddqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
-ddqua1005 quantize 0.501 0.001 -> 0.501
-ddqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
-ddqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
-ddqua1008 quantize 0.999 0.001 -> 0.999
-
-ddqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
-ddqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
-ddqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
-ddqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
-ddqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
-ddqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
--- a potential double-round
-ddqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
-ddqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
-
-ddqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
-ddqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
-ddqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
-ddqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
-ddqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
-ddqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
-ddqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
-ddqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
-
--- Zeros
-ddqua500 quantize 0 1e1 -> 0E+1
-ddqua501 quantize 0 1e0 -> 0
-ddqua502 quantize 0 1e-1 -> 0.0
-ddqua503 quantize 0.0 1e-1 -> 0.0
-ddqua504 quantize 0.0 1e0 -> 0
-ddqua505 quantize 0.0 1e+1 -> 0E+1
-ddqua506 quantize 0E+1 1e-1 -> 0.0
-ddqua507 quantize 0E+1 1e0 -> 0
-ddqua508 quantize 0E+1 1e+1 -> 0E+1
-ddqua509 quantize -0 1e1 -> -0E+1
-ddqua510 quantize -0 1e0 -> -0
-ddqua511 quantize -0 1e-1 -> -0.0
-ddqua512 quantize -0.0 1e-1 -> -0.0
-ddqua513 quantize -0.0 1e0 -> -0
-ddqua514 quantize -0.0 1e+1 -> -0E+1
-ddqua515 quantize -0E+1 1e-1 -> -0.0
-ddqua516 quantize -0E+1 1e0 -> -0
-ddqua517 quantize -0E+1 1e+1 -> -0E+1
-
--- Suspicious RHS values
-ddqua520 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
-ddqua521 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
-ddqua522 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
-ddqua523 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
--- next four are "won't fit" overfl
-ddqua526 quantize 1.234 1e-299 -> NaN Invalid_operation
-ddqua527 quantize 123.456 1e-299 -> NaN Invalid_operation
-ddqua528 quantize 1.234 1e-299 -> NaN Invalid_operation
-ddqua529 quantize 123.456 1e-299 -> NaN Invalid_operation
-
-ddqua532 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
-ddqua533 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
-ddqua534 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
-ddqua537 quantize 0 1e-299 -> 0E-299
--- next two are "won't fit" overflows
-ddqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
-ddqua539 quantize 1.234 1e-300 -> NaN Invalid_operation
--- [more below]
-
--- Specials
-ddqua580 quantize Inf -Inf -> Infinity
-ddqua581 quantize Inf 1e-299 -> NaN Invalid_operation
-ddqua582 quantize Inf 1e-1 -> NaN Invalid_operation
-ddqua583 quantize Inf 1e0 -> NaN Invalid_operation
-ddqua584 quantize Inf 1e1 -> NaN Invalid_operation
-ddqua585 quantize Inf 1e299 -> NaN Invalid_operation
-ddqua586 quantize Inf Inf -> Infinity
-ddqua587 quantize -1000 Inf -> NaN Invalid_operation
-ddqua588 quantize -Inf Inf -> -Infinity
-ddqua589 quantize -1 Inf -> NaN Invalid_operation
-ddqua590 quantize 0 Inf -> NaN Invalid_operation
-ddqua591 quantize 1 Inf -> NaN Invalid_operation
-ddqua592 quantize 1000 Inf -> NaN Invalid_operation
-ddqua593 quantize Inf Inf -> Infinity
-ddqua594 quantize Inf 1e-0 -> NaN Invalid_operation
-ddqua595 quantize -0 Inf -> NaN Invalid_operation
-
-ddqua600 quantize -Inf -Inf -> -Infinity
-ddqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
-ddqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
-ddqua603 quantize -Inf 1e0 -> NaN Invalid_operation
-ddqua604 quantize -Inf 1e1 -> NaN Invalid_operation
-ddqua605 quantize -Inf 1e299 -> NaN Invalid_operation
-ddqua606 quantize -Inf Inf -> -Infinity
-ddqua607 quantize -1000 Inf -> NaN Invalid_operation
-ddqua608 quantize -Inf -Inf -> -Infinity
-ddqua609 quantize -1 -Inf -> NaN Invalid_operation
-ddqua610 quantize 0 -Inf -> NaN Invalid_operation
-ddqua611 quantize 1 -Inf -> NaN Invalid_operation
-ddqua612 quantize 1000 -Inf -> NaN Invalid_operation
-ddqua613 quantize Inf -Inf -> Infinity
-ddqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
-ddqua615 quantize -0 -Inf -> NaN Invalid_operation
-
-ddqua621 quantize NaN -Inf -> NaN
-ddqua622 quantize NaN 1e-299 -> NaN
-ddqua623 quantize NaN 1e-1 -> NaN
-ddqua624 quantize NaN 1e0 -> NaN
-ddqua625 quantize NaN 1e1 -> NaN
-ddqua626 quantize NaN 1e299 -> NaN
-ddqua627 quantize NaN Inf -> NaN
-ddqua628 quantize NaN NaN -> NaN
-ddqua629 quantize -Inf NaN -> NaN
-ddqua630 quantize -1000 NaN -> NaN
-ddqua631 quantize -1 NaN -> NaN
-ddqua632 quantize 0 NaN -> NaN
-ddqua633 quantize 1 NaN -> NaN
-ddqua634 quantize 1000 NaN -> NaN
-ddqua635 quantize Inf NaN -> NaN
-ddqua636 quantize NaN 1e-0 -> NaN
-ddqua637 quantize -0 NaN -> NaN
-
-ddqua641 quantize sNaN -Inf -> NaN Invalid_operation
-ddqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
-ddqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
-ddqua644 quantize sNaN 1e0 -> NaN Invalid_operation
-ddqua645 quantize sNaN 1e1 -> NaN Invalid_operation
-ddqua646 quantize sNaN 1e299 -> NaN Invalid_operation
-ddqua647 quantize sNaN NaN -> NaN Invalid_operation
-ddqua648 quantize sNaN sNaN -> NaN Invalid_operation
-ddqua649 quantize NaN sNaN -> NaN Invalid_operation
-ddqua650 quantize -Inf sNaN -> NaN Invalid_operation
-ddqua651 quantize -1000 sNaN -> NaN Invalid_operation
-ddqua652 quantize -1 sNaN -> NaN Invalid_operation
-ddqua653 quantize 0 sNaN -> NaN Invalid_operation
-ddqua654 quantize 1 sNaN -> NaN Invalid_operation
-ddqua655 quantize 1000 sNaN -> NaN Invalid_operation
-ddqua656 quantize Inf sNaN -> NaN Invalid_operation
-ddqua657 quantize NaN sNaN -> NaN Invalid_operation
-ddqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
-ddqua659 quantize -0 sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddqua661 quantize NaN9 -Inf -> NaN9
-ddqua662 quantize NaN8 919 -> NaN8
-ddqua663 quantize NaN71 Inf -> NaN71
-ddqua664 quantize NaN6 NaN5 -> NaN6
-ddqua665 quantize -Inf NaN4 -> NaN4
-ddqua666 quantize -919 NaN31 -> NaN31
-ddqua667 quantize Inf NaN2 -> NaN2
-
-ddqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
-ddqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
-ddqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
-ddqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
-ddqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
-ddqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
-ddqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
-ddqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
-ddqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
-
-ddqua681 quantize -NaN9 -Inf -> -NaN9
-ddqua682 quantize -NaN8 919 -> -NaN8
-ddqua683 quantize -NaN71 Inf -> -NaN71
-ddqua684 quantize -NaN6 -NaN5 -> -NaN6
-ddqua685 quantize -Inf -NaN4 -> -NaN4
-ddqua686 quantize -919 -NaN31 -> -NaN31
-ddqua687 quantize Inf -NaN2 -> -NaN2
-
-ddqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
-ddqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
-ddqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
-ddqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
-ddqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-ddqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
-ddqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
-ddqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
-ddqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
-
--- subnormals and underflow
-ddqua710 quantize 1.00E-383 1e-383 -> 1E-383 Rounded
-ddqua711 quantize 0.1E-383 2e-384 -> 1E-384 Subnormal
-ddqua712 quantize 0.10E-383 3e-384 -> 1E-384 Subnormal Rounded
-ddqua713 quantize 0.100E-383 4e-384 -> 1E-384 Subnormal Rounded
-ddqua714 quantize 0.01E-383 5e-385 -> 1E-385 Subnormal
--- next is rounded to Emin
-ddqua715 quantize 0.999E-383 1e-383 -> 1E-383 Inexact Rounded
-ddqua716 quantize 0.099E-383 10e-384 -> 1E-384 Inexact Rounded Subnormal
-
-ddqua717 quantize 0.009E-383 1e-385 -> 1E-385 Inexact Rounded Subnormal
-ddqua718 quantize 0.001E-383 1e-385 -> 0E-385 Inexact Rounded
-ddqua719 quantize 0.0009E-383 1e-385 -> 0E-385 Inexact Rounded
-ddqua720 quantize 0.0001E-383 1e-385 -> 0E-385 Inexact Rounded
-
-ddqua730 quantize -1.00E-383 1e-383 -> -1E-383 Rounded
-ddqua731 quantize -0.1E-383 1e-383 -> -0E-383 Rounded Inexact
-ddqua732 quantize -0.10E-383 1e-383 -> -0E-383 Rounded Inexact
-ddqua733 quantize -0.100E-383 1e-383 -> -0E-383 Rounded Inexact
-ddqua734 quantize -0.01E-383 1e-383 -> -0E-383 Inexact Rounded
--- next is rounded to Emin
-ddqua735 quantize -0.999E-383 90e-383 -> -1E-383 Inexact Rounded
-ddqua736 quantize -0.099E-383 -1e-383 -> -0E-383 Inexact Rounded
-ddqua737 quantize -0.009E-383 -1e-383 -> -0E-383 Inexact Rounded
-ddqua738 quantize -0.001E-383 -0e-383 -> -0E-383 Inexact Rounded
-ddqua739 quantize -0.0001E-383 0e-383 -> -0E-383 Inexact Rounded
-
-ddqua740 quantize -1.00E-383 1e-384 -> -1.0E-383 Rounded
-ddqua741 quantize -0.1E-383 1e-384 -> -1E-384 Subnormal
-ddqua742 quantize -0.10E-383 1e-384 -> -1E-384 Subnormal Rounded
-ddqua743 quantize -0.100E-383 1e-384 -> -1E-384 Subnormal Rounded
-ddqua744 quantize -0.01E-383 1e-384 -> -0E-384 Inexact Rounded
--- next is rounded to Emin
-ddqua745 quantize -0.999E-383 1e-384 -> -1.0E-383 Inexact Rounded
-ddqua746 quantize -0.099E-383 1e-384 -> -1E-384 Inexact Rounded Subnormal
-ddqua747 quantize -0.009E-383 1e-384 -> -0E-384 Inexact Rounded
-ddqua748 quantize -0.001E-383 1e-384 -> -0E-384 Inexact Rounded
-ddqua749 quantize -0.0001E-383 1e-384 -> -0E-384 Inexact Rounded
-
-ddqua750 quantize -1.00E-383 1e-385 -> -1.00E-383
-ddqua751 quantize -0.1E-383 1e-385 -> -1.0E-384 Subnormal
-ddqua752 quantize -0.10E-383 1e-385 -> -1.0E-384 Subnormal
-ddqua753 quantize -0.100E-383 1e-385 -> -1.0E-384 Subnormal Rounded
-ddqua754 quantize -0.01E-383 1e-385 -> -1E-385 Subnormal
--- next is rounded to Emin
-ddqua755 quantize -0.999E-383 1e-385 -> -1.00E-383 Inexact Rounded
-ddqua756 quantize -0.099E-383 1e-385 -> -1.0E-384 Inexact Rounded Subnormal
-ddqua757 quantize -0.009E-383 1e-385 -> -1E-385 Inexact Rounded Subnormal
-ddqua758 quantize -0.001E-383 1e-385 -> -0E-385 Inexact Rounded
-ddqua759 quantize -0.0001E-383 1e-385 -> -0E-385 Inexact Rounded
-
-ddqua760 quantize -1.00E-383 1e-386 -> -1.000E-383
-ddqua761 quantize -0.1E-383 1e-386 -> -1.00E-384 Subnormal
-ddqua762 quantize -0.10E-383 1e-386 -> -1.00E-384 Subnormal
-ddqua763 quantize -0.100E-383 1e-386 -> -1.00E-384 Subnormal
-ddqua764 quantize -0.01E-383 1e-386 -> -1.0E-385 Subnormal
-ddqua765 quantize -0.999E-383 1e-386 -> -9.99E-384 Subnormal
-ddqua766 quantize -0.099E-383 1e-386 -> -9.9E-385 Subnormal
-ddqua767 quantize -0.009E-383 1e-386 -> -9E-386 Subnormal
-ddqua768 quantize -0.001E-383 1e-386 -> -1E-386 Subnormal
-ddqua769 quantize -0.0001E-383 1e-386 -> -0E-386 Inexact Rounded
-
--- More from Fung Lee
-ddqua1021 quantize 8.666666666666000E+384 1.000000000000000E+384 -> 8.666666666666000E+384
-ddqua1022 quantize -8.666666666666000E+384 1.000000000000000E+384 -> -8.666666666666000E+384
-ddqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
-ddqua1029 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
-
-
---ddqua1030 quantize 8.666666666666000E+384 1E+384 -> 9.000000000000000E+384 Rounded Inexact
---ddqua1031 quantize 8.666666666666000E+384 1E+384 -> 8.666666666666000E+384 Rounded
---ddqua1032 quantize 8.666666666666000E+384 1E+383 -> 8.666666666666000E+384 Rounded
---ddqua1033 quantize 8.666666666666000E+384 1E+382 -> 8.666666666666000E+384 Rounded
---ddqua1034 quantize 8.666666666666000E+384 1E+381 -> 8.666666666666000E+384 Rounded
---ddqua1035 quantize 8.666666666666000E+384 1E+380 -> 8.666666666666000E+384 Rounded
-
--- Int and uInt32 edge values for testing conversions
-ddqua1040 quantize -2147483646 0 -> -2147483646
-ddqua1041 quantize -2147483647 0 -> -2147483647
-ddqua1042 quantize -2147483648 0 -> -2147483648
-ddqua1043 quantize -2147483649 0 -> -2147483649
-ddqua1044 quantize 2147483646 0 -> 2147483646
-ddqua1045 quantize 2147483647 0 -> 2147483647
-ddqua1046 quantize 2147483648 0 -> 2147483648
-ddqua1047 quantize 2147483649 0 -> 2147483649
-ddqua1048 quantize 4294967294 0 -> 4294967294
-ddqua1049 quantize 4294967295 0 -> 4294967295
-ddqua1050 quantize 4294967296 0 -> 4294967296
-ddqua1051 quantize 4294967297 0 -> 4294967297
-
--- Rounding swathe
-rounding: half_even
-ddqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-ddqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: half_up
-ddqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-ddqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-ddqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: half_down
-ddqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-ddqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: up
-ddqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
-ddqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
-ddqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-ddqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-ddqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-ddqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
-
-rounding: down
-ddqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-ddqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
-ddqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-ddqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
-ddqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
-ddqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
-ddqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
-
-rounding: ceiling
-ddqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
-ddqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
-ddqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-ddqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-ddqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-ddqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-ddqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-ddqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-ddqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-ddqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
-
-rounding: floor
-ddqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
-ddqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-ddqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-ddqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-ddqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
-ddqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-ddqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
-ddqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
-ddqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
-ddqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
-
-rounding: 05up
-ddqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
-ddqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
-ddqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
-ddqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
-ddqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
-ddqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
-ddqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
-ddqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
-ddqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
-
-ddqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
-ddqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
-ddqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
-ddqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
-ddqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
-ddqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
-ddqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
-ddqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
-ddqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
-
-ddqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
-ddqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
-ddqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
-ddqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-ddqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-ddqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
-ddqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
-ddqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
-ddqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
-
-ddqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
-ddqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
-ddqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
-ddqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
-ddqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
-ddqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
-ddqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
-ddqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
-ddqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
-
-ddqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
-ddqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
-ddqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
-ddqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
-ddqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
-ddqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
-ddqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
-ddqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
-ddqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
-
-ddqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
-ddqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
-ddqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
-ddqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
-ddqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
-ddqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
-ddqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
-ddqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
-ddqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
-
--- Null tests
-rounding: half_even
-ddqua998 quantize 10 # -> NaN Invalid_operation
-ddqua999 quantize # 1e10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddQuantize.decTest -- decDouble quantize operation --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Most of the tests here assume a "regular pattern", where the
+-- sign and coefficient are +1.
+-- 2004.03.15 Underflow for quantize is suppressed
+-- 2005.06.08 More extensive tests for 'does not fit'
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks
+ddqua001 quantize 0 1e0 -> 0
+ddqua002 quantize 1 1e0 -> 1
+ddqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
+ddqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
+ddqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
+ddqua007 quantize 0.1 1e-1 -> 0.1
+ddqua008 quantize 0.1 1e-2 -> 0.10
+ddqua009 quantize 0.1 1e-3 -> 0.100
+ddqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
+ddqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
+ddqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
+ddqua013 quantize 0.9 1e-1 -> 0.9
+ddqua014 quantize 0.9 1e-2 -> 0.90
+ddqua015 quantize 0.9 1e-3 -> 0.900
+-- negatives
+ddqua021 quantize -0 1e0 -> -0
+ddqua022 quantize -1 1e0 -> -1
+ddqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
+ddqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
+ddqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
+ddqua027 quantize -0.1 1e-1 -> -0.1
+ddqua028 quantize -0.1 1e-2 -> -0.10
+ddqua029 quantize -0.1 1e-3 -> -0.100
+ddqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
+ddqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
+ddqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
+ddqua033 quantize -0.9 1e-1 -> -0.9
+ddqua034 quantize -0.9 1e-2 -> -0.90
+ddqua035 quantize -0.9 1e-3 -> -0.900
+ddqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
+ddqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
+ddqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
+ddqua039 quantize -0.5 1e-1 -> -0.5
+ddqua040 quantize -0.5 1e-2 -> -0.50
+ddqua041 quantize -0.5 1e-3 -> -0.500
+ddqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
+ddqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
+ddqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
+ddqua045 quantize -0.9 1e-1 -> -0.9
+ddqua046 quantize -0.9 1e-2 -> -0.90
+ddqua047 quantize -0.9 1e-3 -> -0.900
+
+-- examples from Specification
+ddqua060 quantize 2.17 0.001 -> 2.170
+ddqua061 quantize 2.17 0.01 -> 2.17
+ddqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
+ddqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
+ddqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
+ddqua065 quantize -Inf Inf -> -Infinity
+ddqua066 quantize 2 Inf -> NaN Invalid_operation
+ddqua067 quantize -0.1 1 -> -0 Inexact Rounded
+ddqua068 quantize -0 1e+5 -> -0E+5
+ddqua069 quantize +123456789012345.6 1e-2 -> NaN Invalid_operation
+ddqua070 quantize -987654335236450.6 1e-2 -> NaN Invalid_operation
+ddqua071 quantize 217 1e-1 -> 217.0
+ddqua072 quantize 217 1e+0 -> 217
+ddqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
+ddqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
+
+-- general tests ..
+ddqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
+ddqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
+ddqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
+ddqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
+ddqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
+ddqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
+ddqua095 quantize 1.2345 1e-6 -> 1.234500
+ddqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
+ddqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
+ddqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
+ddqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
+ddqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
+
+ddqua101 quantize -1 1e0 -> -1
+ddqua102 quantize -1 1e-1 -> -1.0
+ddqua103 quantize -1 1e-2 -> -1.00
+ddqua104 quantize 0 1e0 -> 0
+ddqua105 quantize 0 1e-1 -> 0.0
+ddqua106 quantize 0 1e-2 -> 0.00
+ddqua107 quantize 0.00 1e0 -> 0
+ddqua108 quantize 0 1e+1 -> 0E+1
+ddqua109 quantize 0 1e+2 -> 0E+2
+ddqua110 quantize +1 1e0 -> 1
+ddqua111 quantize +1 1e-1 -> 1.0
+ddqua112 quantize +1 1e-2 -> 1.00
+
+ddqua120 quantize 1.04 1e-3 -> 1.040
+ddqua121 quantize 1.04 1e-2 -> 1.04
+ddqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
+ddqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
+ddqua124 quantize 1.05 1e-3 -> 1.050
+ddqua125 quantize 1.05 1e-2 -> 1.05
+ddqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
+ddqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
+ddqua132 quantize 1.06 1e-3 -> 1.060
+ddqua133 quantize 1.06 1e-2 -> 1.06
+ddqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
+ddqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
+
+ddqua140 quantize -10 1e-2 -> -10.00
+ddqua141 quantize +1 1e-2 -> 1.00
+ddqua142 quantize +10 1e-2 -> 10.00
+ddqua143 quantize 1E+17 1e-2 -> NaN Invalid_operation
+ddqua144 quantize 1E-17 1e-2 -> 0.00 Inexact Rounded
+ddqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
+ddqua146 quantize 1E-2 1e-2 -> 0.01
+ddqua147 quantize 1E-1 1e-2 -> 0.10
+ddqua148 quantize 0E-17 1e-2 -> 0.00
+
+ddqua150 quantize 1.0600 1e-5 -> 1.06000
+ddqua151 quantize 1.0600 1e-4 -> 1.0600
+ddqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
+ddqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
+ddqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
+ddqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
+
+-- a couple where rounding was different in base tests
+rounding: half_up
+ddqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
+ddqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
+ddqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
+rounding: half_even
+
+-- base tests with non-1 coefficients
+ddqua161 quantize 0 -9e0 -> 0
+ddqua162 quantize 1 -7e0 -> 1
+ddqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
+ddqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
+ddqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
+ddqua167 quantize 0.1 3e-1 -> 0.1
+ddqua168 quantize 0.1 44e-2 -> 0.10
+ddqua169 quantize 0.1 555e-3 -> 0.100
+ddqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
+ddqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
+ddqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
+ddqua173 quantize 0.9 -9e-1 -> 0.9
+ddqua174 quantize 0.9 0e-2 -> 0.90
+ddqua175 quantize 0.9 1.1e-3 -> 0.9000
+-- negatives
+ddqua181 quantize -0 1.1e0 -> -0.0
+ddqua182 quantize -1 -1e0 -> -1
+ddqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
+ddqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
+ddqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
+ddqua187 quantize -0.1 -91e-1 -> -0.1
+ddqua188 quantize -0.1 -.1e-2 -> -0.100
+ddqua189 quantize -0.1 -1e-3 -> -0.100
+ddqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
+ddqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
+ddqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
+ddqua193 quantize -0.9 100e-1 -> -0.9
+ddqua194 quantize -0.9 999e-2 -> -0.90
+
+-- +ve exponents ..
+ddqua201 quantize -1 1e+0 -> -1
+ddqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
+ddqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
+ddqua204 quantize 0 1e+0 -> 0
+ddqua205 quantize 0 1e+1 -> 0E+1
+ddqua206 quantize 0 1e+2 -> 0E+2
+ddqua207 quantize +1 1e+0 -> 1
+ddqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
+ddqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
+
+ddqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
+ddqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
+ddqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
+ddqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
+ddqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
+ddqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
+ddqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
+ddqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
+ddqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
+ddqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
+ddqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
+ddqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
+ddqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
+ddqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
+ddqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
+ddqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
+
+ddqua240 quantize -10 1e+1 -> -1E+1 Rounded
+ddqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
+ddqua242 quantize +10 1e+1 -> 1E+1 Rounded
+ddqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
+ddqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
+ddqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
+ddqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
+ddqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
+ddqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
+ddqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
+ddqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
+ddqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
+-- next one tries to add 9 zeros
+ddqua252 quantize 1E+17 1e+1 -> NaN Invalid_operation
+ddqua253 quantize 1E-17 1e+1 -> 0E+1 Inexact Rounded
+ddqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
+ddqua255 quantize 0E-17 1e+1 -> 0E+1
+ddqua256 quantize -0E-17 1e+1 -> -0E+1
+ddqua257 quantize -0E-1 1e+1 -> -0E+1
+ddqua258 quantize -0 1e+1 -> -0E+1
+ddqua259 quantize -0E+1 1e+1 -> -0E+1
+
+ddqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
+ddqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
+ddqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
+ddqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
+ddqua264 quantize 1E+2 1e+2 -> 1E+2
+ddqua265 quantize 1E+3 1e+2 -> 1.0E+3
+ddqua266 quantize 1E+4 1e+2 -> 1.00E+4
+ddqua267 quantize 1E+5 1e+2 -> 1.000E+5
+ddqua268 quantize 1E+6 1e+2 -> 1.0000E+6
+ddqua269 quantize 1E+7 1e+2 -> 1.00000E+7
+ddqua270 quantize 1E+8 1e+2 -> 1.000000E+8
+ddqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
+ddqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
+ddqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
+ddqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
+ddqua275 quantize 0E-10 1e+2 -> 0E+2
+
+ddqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
+ddqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
+ddqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
+ddqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
+ddqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
+ddqua285 quantize 1E+3 1e+3 -> 1E+3
+ddqua286 quantize 1E+4 1e+3 -> 1.0E+4
+ddqua287 quantize 1E+5 1e+3 -> 1.00E+5
+ddqua288 quantize 1E+6 1e+3 -> 1.000E+6
+ddqua289 quantize 1E+7 1e+3 -> 1.0000E+7
+ddqua290 quantize 1E+8 1e+3 -> 1.00000E+8
+ddqua291 quantize 1E+9 1e+3 -> 1.000000E+9
+ddqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
+ddqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
+ddqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
+ddqua295 quantize 0E-10 1e+3 -> 0E+3
+
+-- round up from below [sign wrong in JIT compiler once]
+ddqua300 quantize 0.0078 1e-5 -> 0.00780
+ddqua301 quantize 0.0078 1e-4 -> 0.0078
+ddqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
+ddqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
+ddqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
+ddqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
+ddqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
+ddqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
+
+ddqua310 quantize -0.0078 1e-5 -> -0.00780
+ddqua311 quantize -0.0078 1e-4 -> -0.0078
+ddqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
+ddqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
+ddqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
+ddqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
+ddqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
+ddqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
+
+ddqua320 quantize 0.078 1e-5 -> 0.07800
+ddqua321 quantize 0.078 1e-4 -> 0.0780
+ddqua322 quantize 0.078 1e-3 -> 0.078
+ddqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
+ddqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
+ddqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
+ddqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
+ddqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
+
+ddqua330 quantize -0.078 1e-5 -> -0.07800
+ddqua331 quantize -0.078 1e-4 -> -0.0780
+ddqua332 quantize -0.078 1e-3 -> -0.078
+ddqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
+ddqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
+ddqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
+ddqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
+ddqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
+
+ddqua340 quantize 0.78 1e-5 -> 0.78000
+ddqua341 quantize 0.78 1e-4 -> 0.7800
+ddqua342 quantize 0.78 1e-3 -> 0.780
+ddqua343 quantize 0.78 1e-2 -> 0.78
+ddqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
+ddqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
+ddqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
+ddqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
+
+ddqua350 quantize -0.78 1e-5 -> -0.78000
+ddqua351 quantize -0.78 1e-4 -> -0.7800
+ddqua352 quantize -0.78 1e-3 -> -0.780
+ddqua353 quantize -0.78 1e-2 -> -0.78
+ddqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
+ddqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
+ddqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
+ddqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
+
+ddqua360 quantize 7.8 1e-5 -> 7.80000
+ddqua361 quantize 7.8 1e-4 -> 7.8000
+ddqua362 quantize 7.8 1e-3 -> 7.800
+ddqua363 quantize 7.8 1e-2 -> 7.80
+ddqua364 quantize 7.8 1e-1 -> 7.8
+ddqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
+ddqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
+ddqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
+ddqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
+
+ddqua370 quantize -7.8 1e-5 -> -7.80000
+ddqua371 quantize -7.8 1e-4 -> -7.8000
+ddqua372 quantize -7.8 1e-3 -> -7.800
+ddqua373 quantize -7.8 1e-2 -> -7.80
+ddqua374 quantize -7.8 1e-1 -> -7.8
+ddqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
+ddqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
+ddqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
+ddqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
+
+-- some individuals
+ddqua380 quantize 1234567352364.506 1e-2 -> 1234567352364.51 Inexact Rounded
+ddqua381 quantize 12345673523645.06 1e-2 -> 12345673523645.06
+ddqua382 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
+ddqua383 quantize 1234567352364506 1e-2 -> NaN Invalid_operation
+ddqua384 quantize -1234567352364.506 1e-2 -> -1234567352364.51 Inexact Rounded
+ddqua385 quantize -12345673523645.06 1e-2 -> -12345673523645.06
+ddqua386 quantize -123456735236450.6 1e-2 -> NaN Invalid_operation
+ddqua387 quantize -1234567352364506 1e-2 -> NaN Invalid_operation
+
+rounding: down
+ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
+-- ? should that one instead have been:
+-- ddqua389 quantize 123456735236450.6 1e-2 -> NaN Invalid_operation
+rounding: half_up
+
+-- and a few more from e-mail discussions
+ddqua391 quantize 12345678912.34567 1e-3 -> 12345678912.346 Inexact Rounded
+ddqua392 quantize 123456789123.4567 1e-3 -> 123456789123.457 Inexact Rounded
+ddqua393 quantize 1234567891234.567 1e-3 -> 1234567891234.567
+ddqua394 quantize 12345678912345.67 1e-3 -> NaN Invalid_operation
+ddqua395 quantize 123456789123456.7 1e-3 -> NaN Invalid_operation
+ddqua396 quantize 1234567891234567. 1e-3 -> NaN Invalid_operation
+
+-- some 9999 round-up cases
+ddqua400 quantize 9.999 1e-5 -> 9.99900
+ddqua401 quantize 9.999 1e-4 -> 9.9990
+ddqua402 quantize 9.999 1e-3 -> 9.999
+ddqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
+ddqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
+ddqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
+ddqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
+ddqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
+
+ddqua410 quantize 0.999 1e-5 -> 0.99900
+ddqua411 quantize 0.999 1e-4 -> 0.9990
+ddqua412 quantize 0.999 1e-3 -> 0.999
+ddqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
+ddqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
+ddqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
+ddqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
+
+ddqua420 quantize 0.0999 1e-5 -> 0.09990
+ddqua421 quantize 0.0999 1e-4 -> 0.0999
+ddqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
+ddqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
+ddqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
+ddqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
+ddqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
+
+ddqua430 quantize 0.00999 1e-5 -> 0.00999
+ddqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
+ddqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
+ddqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
+ddqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
+ddqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
+ddqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
+
+ddqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
+ddqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
+ddqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
+ddqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
+ddqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
+ddqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
+ddqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
+
+ddqua1001 quantize 0.000 0.001 -> 0.000
+ddqua1002 quantize 0.001 0.001 -> 0.001
+ddqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
+ddqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
+ddqua1005 quantize 0.501 0.001 -> 0.501
+ddqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
+ddqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
+ddqua1008 quantize 0.999 0.001 -> 0.999
+
+ddqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
+ddqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
+ddqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
+ddqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
+ddqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
+ddqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
+-- a potential double-round
+ddqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
+ddqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
+
+ddqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
+ddqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
+ddqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
+ddqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
+ddqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
+ddqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
+ddqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
+ddqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
+
+-- Zeros
+ddqua500 quantize 0 1e1 -> 0E+1
+ddqua501 quantize 0 1e0 -> 0
+ddqua502 quantize 0 1e-1 -> 0.0
+ddqua503 quantize 0.0 1e-1 -> 0.0
+ddqua504 quantize 0.0 1e0 -> 0
+ddqua505 quantize 0.0 1e+1 -> 0E+1
+ddqua506 quantize 0E+1 1e-1 -> 0.0
+ddqua507 quantize 0E+1 1e0 -> 0
+ddqua508 quantize 0E+1 1e+1 -> 0E+1
+ddqua509 quantize -0 1e1 -> -0E+1
+ddqua510 quantize -0 1e0 -> -0
+ddqua511 quantize -0 1e-1 -> -0.0
+ddqua512 quantize -0.0 1e-1 -> -0.0
+ddqua513 quantize -0.0 1e0 -> -0
+ddqua514 quantize -0.0 1e+1 -> -0E+1
+ddqua515 quantize -0E+1 1e-1 -> -0.0
+ddqua516 quantize -0E+1 1e0 -> -0
+ddqua517 quantize -0E+1 1e+1 -> -0E+1
+
+-- Suspicious RHS values
+ddqua520 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
+ddqua521 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
+ddqua522 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
+ddqua523 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
+-- next four are "won't fit" overfl
+ddqua526 quantize 1.234 1e-299 -> NaN Invalid_operation
+ddqua527 quantize 123.456 1e-299 -> NaN Invalid_operation
+ddqua528 quantize 1.234 1e-299 -> NaN Invalid_operation
+ddqua529 quantize 123.456 1e-299 -> NaN Invalid_operation
+
+ddqua532 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
+ddqua533 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
+ddqua534 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
+ddqua537 quantize 0 1e-299 -> 0E-299
+-- next two are "won't fit" overflows
+ddqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
+ddqua539 quantize 1.234 1e-300 -> NaN Invalid_operation
+-- [more below]
+
+-- Specials
+ddqua580 quantize Inf -Inf -> Infinity
+ddqua581 quantize Inf 1e-299 -> NaN Invalid_operation
+ddqua582 quantize Inf 1e-1 -> NaN Invalid_operation
+ddqua583 quantize Inf 1e0 -> NaN Invalid_operation
+ddqua584 quantize Inf 1e1 -> NaN Invalid_operation
+ddqua585 quantize Inf 1e299 -> NaN Invalid_operation
+ddqua586 quantize Inf Inf -> Infinity
+ddqua587 quantize -1000 Inf -> NaN Invalid_operation
+ddqua588 quantize -Inf Inf -> -Infinity
+ddqua589 quantize -1 Inf -> NaN Invalid_operation
+ddqua590 quantize 0 Inf -> NaN Invalid_operation
+ddqua591 quantize 1 Inf -> NaN Invalid_operation
+ddqua592 quantize 1000 Inf -> NaN Invalid_operation
+ddqua593 quantize Inf Inf -> Infinity
+ddqua594 quantize Inf 1e-0 -> NaN Invalid_operation
+ddqua595 quantize -0 Inf -> NaN Invalid_operation
+
+ddqua600 quantize -Inf -Inf -> -Infinity
+ddqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
+ddqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
+ddqua603 quantize -Inf 1e0 -> NaN Invalid_operation
+ddqua604 quantize -Inf 1e1 -> NaN Invalid_operation
+ddqua605 quantize -Inf 1e299 -> NaN Invalid_operation
+ddqua606 quantize -Inf Inf -> -Infinity
+ddqua607 quantize -1000 Inf -> NaN Invalid_operation
+ddqua608 quantize -Inf -Inf -> -Infinity
+ddqua609 quantize -1 -Inf -> NaN Invalid_operation
+ddqua610 quantize 0 -Inf -> NaN Invalid_operation
+ddqua611 quantize 1 -Inf -> NaN Invalid_operation
+ddqua612 quantize 1000 -Inf -> NaN Invalid_operation
+ddqua613 quantize Inf -Inf -> Infinity
+ddqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
+ddqua615 quantize -0 -Inf -> NaN Invalid_operation
+
+ddqua621 quantize NaN -Inf -> NaN
+ddqua622 quantize NaN 1e-299 -> NaN
+ddqua623 quantize NaN 1e-1 -> NaN
+ddqua624 quantize NaN 1e0 -> NaN
+ddqua625 quantize NaN 1e1 -> NaN
+ddqua626 quantize NaN 1e299 -> NaN
+ddqua627 quantize NaN Inf -> NaN
+ddqua628 quantize NaN NaN -> NaN
+ddqua629 quantize -Inf NaN -> NaN
+ddqua630 quantize -1000 NaN -> NaN
+ddqua631 quantize -1 NaN -> NaN
+ddqua632 quantize 0 NaN -> NaN
+ddqua633 quantize 1 NaN -> NaN
+ddqua634 quantize 1000 NaN -> NaN
+ddqua635 quantize Inf NaN -> NaN
+ddqua636 quantize NaN 1e-0 -> NaN
+ddqua637 quantize -0 NaN -> NaN
+
+ddqua641 quantize sNaN -Inf -> NaN Invalid_operation
+ddqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
+ddqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
+ddqua644 quantize sNaN 1e0 -> NaN Invalid_operation
+ddqua645 quantize sNaN 1e1 -> NaN Invalid_operation
+ddqua646 quantize sNaN 1e299 -> NaN Invalid_operation
+ddqua647 quantize sNaN NaN -> NaN Invalid_operation
+ddqua648 quantize sNaN sNaN -> NaN Invalid_operation
+ddqua649 quantize NaN sNaN -> NaN Invalid_operation
+ddqua650 quantize -Inf sNaN -> NaN Invalid_operation
+ddqua651 quantize -1000 sNaN -> NaN Invalid_operation
+ddqua652 quantize -1 sNaN -> NaN Invalid_operation
+ddqua653 quantize 0 sNaN -> NaN Invalid_operation
+ddqua654 quantize 1 sNaN -> NaN Invalid_operation
+ddqua655 quantize 1000 sNaN -> NaN Invalid_operation
+ddqua656 quantize Inf sNaN -> NaN Invalid_operation
+ddqua657 quantize NaN sNaN -> NaN Invalid_operation
+ddqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
+ddqua659 quantize -0 sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddqua661 quantize NaN9 -Inf -> NaN9
+ddqua662 quantize NaN8 919 -> NaN8
+ddqua663 quantize NaN71 Inf -> NaN71
+ddqua664 quantize NaN6 NaN5 -> NaN6
+ddqua665 quantize -Inf NaN4 -> NaN4
+ddqua666 quantize -919 NaN31 -> NaN31
+ddqua667 quantize Inf NaN2 -> NaN2
+
+ddqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
+ddqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
+ddqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
+ddqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
+ddqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
+ddqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
+ddqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
+ddqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
+ddqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
+
+ddqua681 quantize -NaN9 -Inf -> -NaN9
+ddqua682 quantize -NaN8 919 -> -NaN8
+ddqua683 quantize -NaN71 Inf -> -NaN71
+ddqua684 quantize -NaN6 -NaN5 -> -NaN6
+ddqua685 quantize -Inf -NaN4 -> -NaN4
+ddqua686 quantize -919 -NaN31 -> -NaN31
+ddqua687 quantize Inf -NaN2 -> -NaN2
+
+ddqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
+ddqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
+ddqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
+ddqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
+ddqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+ddqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
+ddqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
+ddqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
+ddqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
+
+-- subnormals and underflow
+ddqua710 quantize 1.00E-383 1e-383 -> 1E-383 Rounded
+ddqua711 quantize 0.1E-383 2e-384 -> 1E-384 Subnormal
+ddqua712 quantize 0.10E-383 3e-384 -> 1E-384 Subnormal Rounded
+ddqua713 quantize 0.100E-383 4e-384 -> 1E-384 Subnormal Rounded
+ddqua714 quantize 0.01E-383 5e-385 -> 1E-385 Subnormal
+-- next is rounded to Emin
+ddqua715 quantize 0.999E-383 1e-383 -> 1E-383 Inexact Rounded
+ddqua716 quantize 0.099E-383 10e-384 -> 1E-384 Inexact Rounded Subnormal
+
+ddqua717 quantize 0.009E-383 1e-385 -> 1E-385 Inexact Rounded Subnormal
+ddqua718 quantize 0.001E-383 1e-385 -> 0E-385 Inexact Rounded
+ddqua719 quantize 0.0009E-383 1e-385 -> 0E-385 Inexact Rounded
+ddqua720 quantize 0.0001E-383 1e-385 -> 0E-385 Inexact Rounded
+
+ddqua730 quantize -1.00E-383 1e-383 -> -1E-383 Rounded
+ddqua731 quantize -0.1E-383 1e-383 -> -0E-383 Rounded Inexact
+ddqua732 quantize -0.10E-383 1e-383 -> -0E-383 Rounded Inexact
+ddqua733 quantize -0.100E-383 1e-383 -> -0E-383 Rounded Inexact
+ddqua734 quantize -0.01E-383 1e-383 -> -0E-383 Inexact Rounded
+-- next is rounded to Emin
+ddqua735 quantize -0.999E-383 90e-383 -> -1E-383 Inexact Rounded
+ddqua736 quantize -0.099E-383 -1e-383 -> -0E-383 Inexact Rounded
+ddqua737 quantize -0.009E-383 -1e-383 -> -0E-383 Inexact Rounded
+ddqua738 quantize -0.001E-383 -0e-383 -> -0E-383 Inexact Rounded
+ddqua739 quantize -0.0001E-383 0e-383 -> -0E-383 Inexact Rounded
+
+ddqua740 quantize -1.00E-383 1e-384 -> -1.0E-383 Rounded
+ddqua741 quantize -0.1E-383 1e-384 -> -1E-384 Subnormal
+ddqua742 quantize -0.10E-383 1e-384 -> -1E-384 Subnormal Rounded
+ddqua743 quantize -0.100E-383 1e-384 -> -1E-384 Subnormal Rounded
+ddqua744 quantize -0.01E-383 1e-384 -> -0E-384 Inexact Rounded
+-- next is rounded to Emin
+ddqua745 quantize -0.999E-383 1e-384 -> -1.0E-383 Inexact Rounded
+ddqua746 quantize -0.099E-383 1e-384 -> -1E-384 Inexact Rounded Subnormal
+ddqua747 quantize -0.009E-383 1e-384 -> -0E-384 Inexact Rounded
+ddqua748 quantize -0.001E-383 1e-384 -> -0E-384 Inexact Rounded
+ddqua749 quantize -0.0001E-383 1e-384 -> -0E-384 Inexact Rounded
+
+ddqua750 quantize -1.00E-383 1e-385 -> -1.00E-383
+ddqua751 quantize -0.1E-383 1e-385 -> -1.0E-384 Subnormal
+ddqua752 quantize -0.10E-383 1e-385 -> -1.0E-384 Subnormal
+ddqua753 quantize -0.100E-383 1e-385 -> -1.0E-384 Subnormal Rounded
+ddqua754 quantize -0.01E-383 1e-385 -> -1E-385 Subnormal
+-- next is rounded to Emin
+ddqua755 quantize -0.999E-383 1e-385 -> -1.00E-383 Inexact Rounded
+ddqua756 quantize -0.099E-383 1e-385 -> -1.0E-384 Inexact Rounded Subnormal
+ddqua757 quantize -0.009E-383 1e-385 -> -1E-385 Inexact Rounded Subnormal
+ddqua758 quantize -0.001E-383 1e-385 -> -0E-385 Inexact Rounded
+ddqua759 quantize -0.0001E-383 1e-385 -> -0E-385 Inexact Rounded
+
+ddqua760 quantize -1.00E-383 1e-386 -> -1.000E-383
+ddqua761 quantize -0.1E-383 1e-386 -> -1.00E-384 Subnormal
+ddqua762 quantize -0.10E-383 1e-386 -> -1.00E-384 Subnormal
+ddqua763 quantize -0.100E-383 1e-386 -> -1.00E-384 Subnormal
+ddqua764 quantize -0.01E-383 1e-386 -> -1.0E-385 Subnormal
+ddqua765 quantize -0.999E-383 1e-386 -> -9.99E-384 Subnormal
+ddqua766 quantize -0.099E-383 1e-386 -> -9.9E-385 Subnormal
+ddqua767 quantize -0.009E-383 1e-386 -> -9E-386 Subnormal
+ddqua768 quantize -0.001E-383 1e-386 -> -1E-386 Subnormal
+ddqua769 quantize -0.0001E-383 1e-386 -> -0E-386 Inexact Rounded
+
+-- More from Fung Lee
+ddqua1021 quantize 8.666666666666000E+384 1.000000000000000E+384 -> 8.666666666666000E+384
+ddqua1022 quantize -8.666666666666000E+384 1.000000000000000E+384 -> -8.666666666666000E+384
+ddqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
+ddqua1029 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
+
+
+--ddqua1030 quantize 8.666666666666000E+384 1E+384 -> 9.000000000000000E+384 Rounded Inexact
+--ddqua1031 quantize 8.666666666666000E+384 1E+384 -> 8.666666666666000E+384 Rounded
+--ddqua1032 quantize 8.666666666666000E+384 1E+383 -> 8.666666666666000E+384 Rounded
+--ddqua1033 quantize 8.666666666666000E+384 1E+382 -> 8.666666666666000E+384 Rounded
+--ddqua1034 quantize 8.666666666666000E+384 1E+381 -> 8.666666666666000E+384 Rounded
+--ddqua1035 quantize 8.666666666666000E+384 1E+380 -> 8.666666666666000E+384 Rounded
+
+-- Int and uInt32 edge values for testing conversions
+ddqua1040 quantize -2147483646 0 -> -2147483646
+ddqua1041 quantize -2147483647 0 -> -2147483647
+ddqua1042 quantize -2147483648 0 -> -2147483648
+ddqua1043 quantize -2147483649 0 -> -2147483649
+ddqua1044 quantize 2147483646 0 -> 2147483646
+ddqua1045 quantize 2147483647 0 -> 2147483647
+ddqua1046 quantize 2147483648 0 -> 2147483648
+ddqua1047 quantize 2147483649 0 -> 2147483649
+ddqua1048 quantize 4294967294 0 -> 4294967294
+ddqua1049 quantize 4294967295 0 -> 4294967295
+ddqua1050 quantize 4294967296 0 -> 4294967296
+ddqua1051 quantize 4294967297 0 -> 4294967297
+
+-- Rounding swathe
+rounding: half_even
+ddqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+ddqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: half_up
+ddqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+ddqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+ddqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: half_down
+ddqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+ddqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: up
+ddqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
+ddqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
+ddqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+ddqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+ddqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+ddqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
+
+rounding: down
+ddqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+ddqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
+ddqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+ddqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
+ddqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
+ddqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
+ddqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
+
+rounding: ceiling
+ddqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
+ddqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
+ddqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+ddqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+ddqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+ddqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+ddqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+ddqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+ddqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+ddqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
+
+rounding: floor
+ddqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
+ddqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+ddqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+ddqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+ddqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
+ddqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+ddqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
+ddqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
+ddqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
+ddqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
+
+rounding: 05up
+ddqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
+ddqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
+ddqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
+ddqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
+ddqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
+ddqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
+ddqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
+ddqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
+ddqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
+
+ddqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
+ddqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
+ddqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
+ddqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
+ddqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
+ddqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
+ddqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
+ddqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
+ddqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
+
+ddqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
+ddqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
+ddqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
+ddqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+ddqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+ddqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
+ddqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
+ddqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
+ddqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
+
+ddqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
+ddqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
+ddqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
+ddqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
+ddqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
+ddqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
+ddqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
+ddqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
+ddqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
+
+ddqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
+ddqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
+ddqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
+ddqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
+ddqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
+ddqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
+ddqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
+ddqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
+ddqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
+
+ddqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
+ddqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
+ddqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
+ddqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
+ddqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
+ddqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
+ddqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
+ddqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
+ddqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
+
+-- Null tests
+rounding: half_even
+ddqua998 quantize 10 # -> NaN Invalid_operation
+ddqua999 quantize # 1e10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddReduce.decTest b/Lib/test/decimaltestdata/ddReduce.decTest
index bdfd060492..9529e50a75 100644
--- a/Lib/test/decimaltestdata/ddReduce.decTest
+++ b/Lib/test/decimaltestdata/ddReduce.decTest
@@ -1,182 +1,182 @@
-------------------------------------------------------------------------
--- ddReduce.decTest -- remove trailing zeros from a decDouble --
--- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddred001 reduce '1' -> '1'
-ddred002 reduce '-1' -> '-1'
-ddred003 reduce '1.00' -> '1'
-ddred004 reduce '-1.00' -> '-1'
-ddred005 reduce '0' -> '0'
-ddred006 reduce '0.00' -> '0'
-ddred007 reduce '00.0' -> '0'
-ddred008 reduce '00.00' -> '0'
-ddred009 reduce '00' -> '0'
-ddred010 reduce '0E+1' -> '0'
-ddred011 reduce '0E+5' -> '0'
-
-ddred012 reduce '-2' -> '-2'
-ddred013 reduce '2' -> '2'
-ddred014 reduce '-2.00' -> '-2'
-ddred015 reduce '2.00' -> '2'
-ddred016 reduce '-0' -> '-0'
-ddred017 reduce '-0.00' -> '-0'
-ddred018 reduce '-00.0' -> '-0'
-ddred019 reduce '-00.00' -> '-0'
-ddred020 reduce '-00' -> '-0'
-ddred021 reduce '-0E+5' -> '-0'
-ddred022 reduce '-0E+1' -> '-0'
-
-ddred030 reduce '+0.1' -> '0.1'
-ddred031 reduce '-0.1' -> '-0.1'
-ddred032 reduce '+0.01' -> '0.01'
-ddred033 reduce '-0.01' -> '-0.01'
-ddred034 reduce '+0.001' -> '0.001'
-ddred035 reduce '-0.001' -> '-0.001'
-ddred036 reduce '+0.000001' -> '0.000001'
-ddred037 reduce '-0.000001' -> '-0.000001'
-ddred038 reduce '+0.000000000001' -> '1E-12'
-ddred039 reduce '-0.000000000001' -> '-1E-12'
-
-ddred041 reduce 1.1 -> 1.1
-ddred042 reduce 1.10 -> 1.1
-ddred043 reduce 1.100 -> 1.1
-ddred044 reduce 1.110 -> 1.11
-ddred045 reduce -1.1 -> -1.1
-ddred046 reduce -1.10 -> -1.1
-ddred047 reduce -1.100 -> -1.1
-ddred048 reduce -1.110 -> -1.11
-ddred049 reduce 9.9 -> 9.9
-ddred050 reduce 9.90 -> 9.9
-ddred051 reduce 9.900 -> 9.9
-ddred052 reduce 9.990 -> 9.99
-ddred053 reduce -9.9 -> -9.9
-ddred054 reduce -9.90 -> -9.9
-ddred055 reduce -9.900 -> -9.9
-ddred056 reduce -9.990 -> -9.99
-
--- some trailing fractional zeros with zeros in units
-ddred060 reduce 10.0 -> 1E+1
-ddred061 reduce 10.00 -> 1E+1
-ddred062 reduce 100.0 -> 1E+2
-ddred063 reduce 100.00 -> 1E+2
-ddred064 reduce 1.1000E+3 -> 1.1E+3
-ddred065 reduce 1.10000E+3 -> 1.1E+3
-ddred066 reduce -10.0 -> -1E+1
-ddred067 reduce -10.00 -> -1E+1
-ddred068 reduce -100.0 -> -1E+2
-ddred069 reduce -100.00 -> -1E+2
-ddred070 reduce -1.1000E+3 -> -1.1E+3
-ddred071 reduce -1.10000E+3 -> -1.1E+3
-
--- some insignificant trailing zeros with positive exponent
-ddred080 reduce 10E+1 -> 1E+2
-ddred081 reduce 100E+1 -> 1E+3
-ddred082 reduce 1.0E+2 -> 1E+2
-ddred083 reduce 1.0E+3 -> 1E+3
-ddred084 reduce 1.1E+3 -> 1.1E+3
-ddred085 reduce 1.00E+3 -> 1E+3
-ddred086 reduce 1.10E+3 -> 1.1E+3
-ddred087 reduce -10E+1 -> -1E+2
-ddred088 reduce -100E+1 -> -1E+3
-ddred089 reduce -1.0E+2 -> -1E+2
-ddred090 reduce -1.0E+3 -> -1E+3
-ddred091 reduce -1.1E+3 -> -1.1E+3
-ddred092 reduce -1.00E+3 -> -1E+3
-ddred093 reduce -1.10E+3 -> -1.1E+3
-
--- some significant trailing zeros, were we to be trimming
-ddred100 reduce 11 -> 11
-ddred101 reduce 10 -> 1E+1
-ddred102 reduce 10. -> 1E+1
-ddred103 reduce 1.1E+1 -> 11
-ddred104 reduce 1.0E+1 -> 1E+1
-ddred105 reduce 1.10E+2 -> 1.1E+2
-ddred106 reduce 1.00E+2 -> 1E+2
-ddred107 reduce 1.100E+3 -> 1.1E+3
-ddred108 reduce 1.000E+3 -> 1E+3
-ddred109 reduce 1.000000E+6 -> 1E+6
-ddred110 reduce -11 -> -11
-ddred111 reduce -10 -> -1E+1
-ddred112 reduce -10. -> -1E+1
-ddred113 reduce -1.1E+1 -> -11
-ddred114 reduce -1.0E+1 -> -1E+1
-ddred115 reduce -1.10E+2 -> -1.1E+2
-ddred116 reduce -1.00E+2 -> -1E+2
-ddred117 reduce -1.100E+3 -> -1.1E+3
-ddred118 reduce -1.000E+3 -> -1E+3
-ddred119 reduce -1.00000E+5 -> -1E+5
-ddred120 reduce -1.000000E+6 -> -1E+6
-ddred121 reduce -10.00000E+6 -> -1E+7
-ddred122 reduce -100.0000E+6 -> -1E+8
-ddred123 reduce -1000.000E+6 -> -1E+9
-ddred124 reduce -10000.00E+6 -> -1E+10
-ddred125 reduce -100000.0E+6 -> -1E+11
-ddred126 reduce -1000000.E+6 -> -1E+12
-
--- examples from decArith
-ddred140 reduce '2.1' -> '2.1'
-ddred141 reduce '-2.0' -> '-2'
-ddred142 reduce '1.200' -> '1.2'
-ddred143 reduce '-120' -> '-1.2E+2'
-ddred144 reduce '120.00' -> '1.2E+2'
-ddred145 reduce '0.00' -> '0'
-
--- Nmax, Nmin, Ntiny
--- note origami effect on some of these
-ddred151 reduce 9.999999999999999E+384 -> 9.999999999999999E+384
-ddred152 reduce 9.999999000000000E+380 -> 9.99999900000E+380
-ddred153 reduce 9.999999999990000E+384 -> 9.999999999990000E+384
-ddred154 reduce 1E-383 -> 1E-383
-ddred155 reduce 1.000000000000000E-383 -> 1E-383
-ddred156 reduce 2.000E-395 -> 2E-395 Subnormal
-ddred157 reduce 1E-398 -> 1E-398 Subnormal
-
-ddred161 reduce -1E-398 -> -1E-398 Subnormal
-ddred162 reduce -2.000E-395 -> -2E-395 Subnormal
-ddred163 reduce -1.000000000000000E-383 -> -1E-383
-ddred164 reduce -1E-383 -> -1E-383
-ddred165 reduce -9.999999000000000E+380 -> -9.99999900000E+380
-ddred166 reduce -9.999999999990000E+384 -> -9.999999999990000E+384
-ddred167 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
-ddred168 reduce -9.999999999999999E+384 -> -9.999999999999999E+384
-ddred169 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
-
-
--- specials (reduce does not affect payload)
-ddred820 reduce 'Inf' -> 'Infinity'
-ddred821 reduce '-Inf' -> '-Infinity'
-ddred822 reduce NaN -> NaN
-ddred823 reduce sNaN -> NaN Invalid_operation
-ddred824 reduce NaN101 -> NaN101
-ddred825 reduce sNaN010 -> NaN10 Invalid_operation
-ddred827 reduce -NaN -> -NaN
-ddred828 reduce -sNaN -> -NaN Invalid_operation
-ddred829 reduce -NaN101 -> -NaN101
-ddred830 reduce -sNaN010 -> -NaN10 Invalid_operation
-
--- Null test
-ddred900 reduce # -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddReduce.decTest -- remove trailing zeros from a decDouble --
+-- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddred001 reduce '1' -> '1'
+ddred002 reduce '-1' -> '-1'
+ddred003 reduce '1.00' -> '1'
+ddred004 reduce '-1.00' -> '-1'
+ddred005 reduce '0' -> '0'
+ddred006 reduce '0.00' -> '0'
+ddred007 reduce '00.0' -> '0'
+ddred008 reduce '00.00' -> '0'
+ddred009 reduce '00' -> '0'
+ddred010 reduce '0E+1' -> '0'
+ddred011 reduce '0E+5' -> '0'
+
+ddred012 reduce '-2' -> '-2'
+ddred013 reduce '2' -> '2'
+ddred014 reduce '-2.00' -> '-2'
+ddred015 reduce '2.00' -> '2'
+ddred016 reduce '-0' -> '-0'
+ddred017 reduce '-0.00' -> '-0'
+ddred018 reduce '-00.0' -> '-0'
+ddred019 reduce '-00.00' -> '-0'
+ddred020 reduce '-00' -> '-0'
+ddred021 reduce '-0E+5' -> '-0'
+ddred022 reduce '-0E+1' -> '-0'
+
+ddred030 reduce '+0.1' -> '0.1'
+ddred031 reduce '-0.1' -> '-0.1'
+ddred032 reduce '+0.01' -> '0.01'
+ddred033 reduce '-0.01' -> '-0.01'
+ddred034 reduce '+0.001' -> '0.001'
+ddred035 reduce '-0.001' -> '-0.001'
+ddred036 reduce '+0.000001' -> '0.000001'
+ddred037 reduce '-0.000001' -> '-0.000001'
+ddred038 reduce '+0.000000000001' -> '1E-12'
+ddred039 reduce '-0.000000000001' -> '-1E-12'
+
+ddred041 reduce 1.1 -> 1.1
+ddred042 reduce 1.10 -> 1.1
+ddred043 reduce 1.100 -> 1.1
+ddred044 reduce 1.110 -> 1.11
+ddred045 reduce -1.1 -> -1.1
+ddred046 reduce -1.10 -> -1.1
+ddred047 reduce -1.100 -> -1.1
+ddred048 reduce -1.110 -> -1.11
+ddred049 reduce 9.9 -> 9.9
+ddred050 reduce 9.90 -> 9.9
+ddred051 reduce 9.900 -> 9.9
+ddred052 reduce 9.990 -> 9.99
+ddred053 reduce -9.9 -> -9.9
+ddred054 reduce -9.90 -> -9.9
+ddred055 reduce -9.900 -> -9.9
+ddred056 reduce -9.990 -> -9.99
+
+-- some trailing fractional zeros with zeros in units
+ddred060 reduce 10.0 -> 1E+1
+ddred061 reduce 10.00 -> 1E+1
+ddred062 reduce 100.0 -> 1E+2
+ddred063 reduce 100.00 -> 1E+2
+ddred064 reduce 1.1000E+3 -> 1.1E+3
+ddred065 reduce 1.10000E+3 -> 1.1E+3
+ddred066 reduce -10.0 -> -1E+1
+ddred067 reduce -10.00 -> -1E+1
+ddred068 reduce -100.0 -> -1E+2
+ddred069 reduce -100.00 -> -1E+2
+ddred070 reduce -1.1000E+3 -> -1.1E+3
+ddred071 reduce -1.10000E+3 -> -1.1E+3
+
+-- some insignificant trailing zeros with positive exponent
+ddred080 reduce 10E+1 -> 1E+2
+ddred081 reduce 100E+1 -> 1E+3
+ddred082 reduce 1.0E+2 -> 1E+2
+ddred083 reduce 1.0E+3 -> 1E+3
+ddred084 reduce 1.1E+3 -> 1.1E+3
+ddred085 reduce 1.00E+3 -> 1E+3
+ddred086 reduce 1.10E+3 -> 1.1E+3
+ddred087 reduce -10E+1 -> -1E+2
+ddred088 reduce -100E+1 -> -1E+3
+ddred089 reduce -1.0E+2 -> -1E+2
+ddred090 reduce -1.0E+3 -> -1E+3
+ddred091 reduce -1.1E+3 -> -1.1E+3
+ddred092 reduce -1.00E+3 -> -1E+3
+ddred093 reduce -1.10E+3 -> -1.1E+3
+
+-- some significant trailing zeros, were we to be trimming
+ddred100 reduce 11 -> 11
+ddred101 reduce 10 -> 1E+1
+ddred102 reduce 10. -> 1E+1
+ddred103 reduce 1.1E+1 -> 11
+ddred104 reduce 1.0E+1 -> 1E+1
+ddred105 reduce 1.10E+2 -> 1.1E+2
+ddred106 reduce 1.00E+2 -> 1E+2
+ddred107 reduce 1.100E+3 -> 1.1E+3
+ddred108 reduce 1.000E+3 -> 1E+3
+ddred109 reduce 1.000000E+6 -> 1E+6
+ddred110 reduce -11 -> -11
+ddred111 reduce -10 -> -1E+1
+ddred112 reduce -10. -> -1E+1
+ddred113 reduce -1.1E+1 -> -11
+ddred114 reduce -1.0E+1 -> -1E+1
+ddred115 reduce -1.10E+2 -> -1.1E+2
+ddred116 reduce -1.00E+2 -> -1E+2
+ddred117 reduce -1.100E+3 -> -1.1E+3
+ddred118 reduce -1.000E+3 -> -1E+3
+ddred119 reduce -1.00000E+5 -> -1E+5
+ddred120 reduce -1.000000E+6 -> -1E+6
+ddred121 reduce -10.00000E+6 -> -1E+7
+ddred122 reduce -100.0000E+6 -> -1E+8
+ddred123 reduce -1000.000E+6 -> -1E+9
+ddred124 reduce -10000.00E+6 -> -1E+10
+ddred125 reduce -100000.0E+6 -> -1E+11
+ddred126 reduce -1000000.E+6 -> -1E+12
+
+-- examples from decArith
+ddred140 reduce '2.1' -> '2.1'
+ddred141 reduce '-2.0' -> '-2'
+ddred142 reduce '1.200' -> '1.2'
+ddred143 reduce '-120' -> '-1.2E+2'
+ddred144 reduce '120.00' -> '1.2E+2'
+ddred145 reduce '0.00' -> '0'
+
+-- Nmax, Nmin, Ntiny
+-- note origami effect on some of these
+ddred151 reduce 9.999999999999999E+384 -> 9.999999999999999E+384
+ddred152 reduce 9.999999000000000E+380 -> 9.99999900000E+380
+ddred153 reduce 9.999999999990000E+384 -> 9.999999999990000E+384
+ddred154 reduce 1E-383 -> 1E-383
+ddred155 reduce 1.000000000000000E-383 -> 1E-383
+ddred156 reduce 2.000E-395 -> 2E-395 Subnormal
+ddred157 reduce 1E-398 -> 1E-398 Subnormal
+
+ddred161 reduce -1E-398 -> -1E-398 Subnormal
+ddred162 reduce -2.000E-395 -> -2E-395 Subnormal
+ddred163 reduce -1.000000000000000E-383 -> -1E-383
+ddred164 reduce -1E-383 -> -1E-383
+ddred165 reduce -9.999999000000000E+380 -> -9.99999900000E+380
+ddred166 reduce -9.999999999990000E+384 -> -9.999999999990000E+384
+ddred167 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
+ddred168 reduce -9.999999999999999E+384 -> -9.999999999999999E+384
+ddred169 reduce -9.999999999999990E+384 -> -9.999999999999990E+384
+
+
+-- specials (reduce does not affect payload)
+ddred820 reduce 'Inf' -> 'Infinity'
+ddred821 reduce '-Inf' -> '-Infinity'
+ddred822 reduce NaN -> NaN
+ddred823 reduce sNaN -> NaN Invalid_operation
+ddred824 reduce NaN101 -> NaN101
+ddred825 reduce sNaN010 -> NaN10 Invalid_operation
+ddred827 reduce -NaN -> -NaN
+ddred828 reduce -sNaN -> -NaN Invalid_operation
+ddred829 reduce -NaN101 -> -NaN101
+ddred830 reduce -sNaN010 -> -NaN10 Invalid_operation
+
+-- Null test
+ddred900 reduce # -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddRemainder.decTest b/Lib/test/decimaltestdata/ddRemainder.decTest
index 5bd1e32d01..85d86f9457 100644
--- a/Lib/test/decimaltestdata/ddRemainder.decTest
+++ b/Lib/test/decimaltestdata/ddRemainder.decTest
@@ -1,600 +1,600 @@
-------------------------------------------------------------------------
--- ddRemainder.decTest -- decDouble remainder --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks (as base, above)
-ddrem001 remainder 1 1 -> 0
-ddrem002 remainder 2 1 -> 0
-ddrem003 remainder 1 2 -> 1
-ddrem004 remainder 2 2 -> 0
-ddrem005 remainder 0 1 -> 0
-ddrem006 remainder 0 2 -> 0
-ddrem007 remainder 1 3 -> 1
-ddrem008 remainder 2 3 -> 2
-ddrem009 remainder 3 3 -> 0
-
-ddrem010 remainder 2.4 1 -> 0.4
-ddrem011 remainder 2.4 -1 -> 0.4
-ddrem012 remainder -2.4 1 -> -0.4
-ddrem013 remainder -2.4 -1 -> -0.4
-ddrem014 remainder 2.40 1 -> 0.40
-ddrem015 remainder 2.400 1 -> 0.400
-ddrem016 remainder 2.4 2 -> 0.4
-ddrem017 remainder 2.400 2 -> 0.400
-ddrem018 remainder 2. 2 -> 0
-ddrem019 remainder 20 20 -> 0
-
-ddrem020 remainder 187 187 -> 0
-ddrem021 remainder 5 2 -> 1
-ddrem022 remainder 5 2.0 -> 1.0
-ddrem023 remainder 5 2.000 -> 1.000
-ddrem024 remainder 5 0.200 -> 0.000
-ddrem025 remainder 5 0.200 -> 0.000
-
-ddrem030 remainder 1 2 -> 1
-ddrem031 remainder 1 4 -> 1
-ddrem032 remainder 1 8 -> 1
-
-ddrem033 remainder 1 16 -> 1
-ddrem034 remainder 1 32 -> 1
-ddrem035 remainder 1 64 -> 1
-ddrem040 remainder 1 -2 -> 1
-ddrem041 remainder 1 -4 -> 1
-ddrem042 remainder 1 -8 -> 1
-ddrem043 remainder 1 -16 -> 1
-ddrem044 remainder 1 -32 -> 1
-ddrem045 remainder 1 -64 -> 1
-ddrem050 remainder -1 2 -> -1
-ddrem051 remainder -1 4 -> -1
-ddrem052 remainder -1 8 -> -1
-ddrem053 remainder -1 16 -> -1
-ddrem054 remainder -1 32 -> -1
-ddrem055 remainder -1 64 -> -1
-ddrem060 remainder -1 -2 -> -1
-ddrem061 remainder -1 -4 -> -1
-ddrem062 remainder -1 -8 -> -1
-ddrem063 remainder -1 -16 -> -1
-ddrem064 remainder -1 -32 -> -1
-ddrem065 remainder -1 -64 -> -1
-
-ddrem066 remainder 999999999 1 -> 0
-ddrem067 remainder 999999999.4 1 -> 0.4
-ddrem068 remainder 999999999.5 1 -> 0.5
-ddrem069 remainder 999999999.9 1 -> 0.9
-ddrem070 remainder 999999999.999 1 -> 0.999
-ddrem071 remainder 999999.999999 1 -> 0.999999
-ddrem072 remainder 9 1 -> 0
-ddrem073 remainder 9999999999999999 1 -> 0
-ddrem074 remainder 9999999999999999 2 -> 1
-ddrem075 remainder 9999999999999999 3 -> 0
-ddrem076 remainder 9999999999999999 4 -> 3
-
-ddrem080 remainder 0. 1 -> 0
-ddrem081 remainder .0 1 -> 0.0
-ddrem082 remainder 0.00 1 -> 0.00
-ddrem083 remainder 0.00E+9 1 -> 0
-ddrem084 remainder 0.00E+3 1 -> 0
-ddrem085 remainder 0.00E+2 1 -> 0
-ddrem086 remainder 0.00E+1 1 -> 0.0
-ddrem087 remainder 0.00E+0 1 -> 0.00
-ddrem088 remainder 0.00E-0 1 -> 0.00
-ddrem089 remainder 0.00E-1 1 -> 0.000
-ddrem090 remainder 0.00E-2 1 -> 0.0000
-ddrem091 remainder 0.00E-3 1 -> 0.00000
-ddrem092 remainder 0.00E-4 1 -> 0.000000
-ddrem093 remainder 0.00E-5 1 -> 0E-7
-ddrem094 remainder 0.00E-6 1 -> 0E-8
-ddrem095 remainder 0.0000E-50 1 -> 0E-54
-
--- Various flavours of remainder by 0
-ddrem101 remainder 0 0 -> NaN Division_undefined
-ddrem102 remainder 0 -0 -> NaN Division_undefined
-ddrem103 remainder -0 0 -> NaN Division_undefined
-ddrem104 remainder -0 -0 -> NaN Division_undefined
-ddrem105 remainder 0.0E5 0 -> NaN Division_undefined
-ddrem106 remainder 0.000 0 -> NaN Division_undefined
--- [Some think this next group should be Division_by_zero exception, but
--- IEEE 854 is explicit that it is Invalid operation .. for
--- remainder-near, anyway]
-ddrem107 remainder 0.0001 0 -> NaN Invalid_operation
-ddrem108 remainder 0.01 0 -> NaN Invalid_operation
-ddrem109 remainder 0.1 0 -> NaN Invalid_operation
-ddrem110 remainder 1 0 -> NaN Invalid_operation
-ddrem111 remainder 1 0.0 -> NaN Invalid_operation
-ddrem112 remainder 10 0.0 -> NaN Invalid_operation
-ddrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
-ddrem114 remainder 1E+380 0 -> NaN Invalid_operation
-ddrem115 remainder 0.0001 -0 -> NaN Invalid_operation
-ddrem116 remainder 0.01 -0 -> NaN Invalid_operation
-ddrem119 remainder 0.1 -0 -> NaN Invalid_operation
-ddrem120 remainder 1 -0 -> NaN Invalid_operation
-ddrem121 remainder 1 -0.0 -> NaN Invalid_operation
-ddrem122 remainder 10 -0.0 -> NaN Invalid_operation
-ddrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
-ddrem124 remainder 1E+384 -0 -> NaN Invalid_operation
--- and zeros on left
-ddrem130 remainder 0 1 -> 0
-ddrem131 remainder 0 -1 -> 0
-ddrem132 remainder 0.0 1 -> 0.0
-ddrem133 remainder 0.0 -1 -> 0.0
-ddrem134 remainder -0 1 -> -0
-ddrem135 remainder -0 -1 -> -0
-ddrem136 remainder -0.0 1 -> -0.0
-ddrem137 remainder -0.0 -1 -> -0.0
-
--- 0.5ers
-ddrem143 remainder 0.5 2 -> 0.5
-ddrem144 remainder 0.5 2.1 -> 0.5
-ddrem145 remainder 0.5 2.01 -> 0.50
-ddrem146 remainder 0.5 2.001 -> 0.500
-ddrem147 remainder 0.50 2 -> 0.50
-ddrem148 remainder 0.50 2.01 -> 0.50
-ddrem149 remainder 0.50 2.001 -> 0.500
-
--- steadies
-ddrem150 remainder 1 1 -> 0
-ddrem151 remainder 1 2 -> 1
-ddrem152 remainder 1 3 -> 1
-ddrem153 remainder 1 4 -> 1
-ddrem154 remainder 1 5 -> 1
-ddrem155 remainder 1 6 -> 1
-ddrem156 remainder 1 7 -> 1
-ddrem157 remainder 1 8 -> 1
-ddrem158 remainder 1 9 -> 1
-ddrem159 remainder 1 10 -> 1
-ddrem160 remainder 1 1 -> 0
-ddrem161 remainder 2 1 -> 0
-ddrem162 remainder 3 1 -> 0
-ddrem163 remainder 4 1 -> 0
-ddrem164 remainder 5 1 -> 0
-ddrem165 remainder 6 1 -> 0
-ddrem166 remainder 7 1 -> 0
-ddrem167 remainder 8 1 -> 0
-ddrem168 remainder 9 1 -> 0
-ddrem169 remainder 10 1 -> 0
-
--- some differences from remainderNear
-ddrem171 remainder 0.4 1.020 -> 0.400
-ddrem172 remainder 0.50 1.020 -> 0.500
-ddrem173 remainder 0.51 1.020 -> 0.510
-ddrem174 remainder 0.52 1.020 -> 0.520
-ddrem175 remainder 0.6 1.020 -> 0.600
-
--- More flavours of remainder by 0
-ddrem201 remainder 0 0 -> NaN Division_undefined
-ddrem202 remainder 0.0E5 0 -> NaN Division_undefined
-ddrem203 remainder 0.000 0 -> NaN Division_undefined
-ddrem204 remainder 0.0001 0 -> NaN Invalid_operation
-ddrem205 remainder 0.01 0 -> NaN Invalid_operation
-ddrem206 remainder 0.1 0 -> NaN Invalid_operation
-ddrem207 remainder 1 0 -> NaN Invalid_operation
-ddrem208 remainder 1 0.0 -> NaN Invalid_operation
-ddrem209 remainder 10 0.0 -> NaN Invalid_operation
-ddrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
-ddrem211 remainder 1E+380 0 -> NaN Invalid_operation
-
--- some differences from remainderNear
-ddrem231 remainder -0.4 1.020 -> -0.400
-ddrem232 remainder -0.50 1.020 -> -0.500
-ddrem233 remainder -0.51 1.020 -> -0.510
-ddrem234 remainder -0.52 1.020 -> -0.520
-ddrem235 remainder -0.6 1.020 -> -0.600
-
--- high Xs
-ddrem240 remainder 1E+2 1.00 -> 0.00
-
--- ddrem3xx are from DiagBigDecimal
-ddrem301 remainder 1 3 -> 1
-ddrem302 remainder 5 5 -> 0
-ddrem303 remainder 13 10 -> 3
-ddrem304 remainder 13 50 -> 13
-ddrem305 remainder 13 100 -> 13
-ddrem306 remainder 13 1000 -> 13
-ddrem307 remainder .13 1 -> 0.13
-ddrem308 remainder 0.133 1 -> 0.133
-ddrem309 remainder 0.1033 1 -> 0.1033
-ddrem310 remainder 1.033 1 -> 0.033
-ddrem311 remainder 10.33 1 -> 0.33
-ddrem312 remainder 10.33 10 -> 0.33
-ddrem313 remainder 103.3 1 -> 0.3
-ddrem314 remainder 133 10 -> 3
-ddrem315 remainder 1033 10 -> 3
-ddrem316 remainder 1033 50 -> 33
-ddrem317 remainder 101.0 3 -> 2.0
-ddrem318 remainder 102.0 3 -> 0.0
-ddrem319 remainder 103.0 3 -> 1.0
-ddrem320 remainder 2.40 1 -> 0.40
-ddrem321 remainder 2.400 1 -> 0.400
-ddrem322 remainder 2.4 1 -> 0.4
-ddrem323 remainder 2.4 2 -> 0.4
-ddrem324 remainder 2.400 2 -> 0.400
-ddrem325 remainder 1 0.3 -> 0.1
-ddrem326 remainder 1 0.30 -> 0.10
-ddrem327 remainder 1 0.300 -> 0.100
-ddrem328 remainder 1 0.3000 -> 0.1000
-ddrem329 remainder 1.0 0.3 -> 0.1
-ddrem330 remainder 1.00 0.3 -> 0.10
-ddrem331 remainder 1.000 0.3 -> 0.100
-ddrem332 remainder 1.0000 0.3 -> 0.1000
-ddrem333 remainder 0.5 2 -> 0.5
-ddrem334 remainder 0.5 2.1 -> 0.5
-ddrem335 remainder 0.5 2.01 -> 0.50
-ddrem336 remainder 0.5 2.001 -> 0.500
-ddrem337 remainder 0.50 2 -> 0.50
-ddrem338 remainder 0.50 2.01 -> 0.50
-ddrem339 remainder 0.50 2.001 -> 0.500
-
-ddrem340 remainder 0.5 0.5000001 -> 0.5000000
-ddrem341 remainder 0.5 0.50000001 -> 0.50000000
-ddrem342 remainder 0.5 0.500000001 -> 0.500000000
-ddrem343 remainder 0.5 0.5000000001 -> 0.5000000000
-ddrem344 remainder 0.5 0.50000000001 -> 0.50000000000
-ddrem345 remainder 0.5 0.4999999 -> 1E-7
-ddrem346 remainder 0.5 0.49999999 -> 1E-8
-ddrem347 remainder 0.5 0.499999999 -> 1E-9
-ddrem348 remainder 0.5 0.4999999999 -> 1E-10
-ddrem349 remainder 0.5 0.49999999999 -> 1E-11
-ddrem350 remainder 0.5 0.499999999999 -> 1E-12
-
-ddrem351 remainder 0.03 7 -> 0.03
-ddrem352 remainder 5 2 -> 1
-ddrem353 remainder 4.1 2 -> 0.1
-ddrem354 remainder 4.01 2 -> 0.01
-ddrem355 remainder 4.001 2 -> 0.001
-ddrem356 remainder 4.0001 2 -> 0.0001
-ddrem357 remainder 4.00001 2 -> 0.00001
-ddrem358 remainder 4.000001 2 -> 0.000001
-ddrem359 remainder 4.0000001 2 -> 1E-7
-
-ddrem360 remainder 1.2 0.7345 -> 0.4655
-ddrem361 remainder 0.8 12 -> 0.8
-ddrem362 remainder 0.8 0.2 -> 0.0
-ddrem363 remainder 0.8 0.3 -> 0.2
-ddrem364 remainder 0.800 12 -> 0.800
-ddrem365 remainder 0.800 1.7 -> 0.800
-ddrem366 remainder 2.400 2 -> 0.400
-
-ddrem371 remainder 2.400 2 -> 0.400
-
-ddrem381 remainder 12345 1 -> 0
-ddrem382 remainder 12345 1.0001 -> 0.7657
-ddrem383 remainder 12345 1.001 -> 0.668
-ddrem384 remainder 12345 1.01 -> 0.78
-ddrem385 remainder 12345 1.1 -> 0.8
-ddrem386 remainder 12355 4 -> 3
-ddrem387 remainder 12345 4 -> 1
-ddrem388 remainder 12355 4.0001 -> 2.6912
-ddrem389 remainder 12345 4.0001 -> 0.6914
-ddrem390 remainder 12345 4.9 -> 1.9
-ddrem391 remainder 12345 4.99 -> 4.73
-ddrem392 remainder 12345 4.999 -> 2.469
-ddrem393 remainder 12345 4.9999 -> 0.2469
-ddrem394 remainder 12345 5 -> 0
-ddrem395 remainder 12345 5.0001 -> 4.7532
-ddrem396 remainder 12345 5.001 -> 2.532
-ddrem397 remainder 12345 5.01 -> 0.36
-ddrem398 remainder 12345 5.1 -> 3.0
-
--- the nasty division-by-1 cases
-ddrem401 remainder 0.5 1 -> 0.5
-ddrem402 remainder 0.55 1 -> 0.55
-ddrem403 remainder 0.555 1 -> 0.555
-ddrem404 remainder 0.5555 1 -> 0.5555
-ddrem405 remainder 0.55555 1 -> 0.55555
-ddrem406 remainder 0.555555 1 -> 0.555555
-ddrem407 remainder 0.5555555 1 -> 0.5555555
-ddrem408 remainder 0.55555555 1 -> 0.55555555
-ddrem409 remainder 0.555555555 1 -> 0.555555555
-
--- folddowns
-ddrem421 remainder 1E+384 1 -> NaN Division_impossible
-ddrem422 remainder 1E+384 1E+383 -> 0E+369 Clamped
-ddrem423 remainder 1E+384 2E+383 -> 0E+369 Clamped
-ddrem424 remainder 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
-ddrem425 remainder 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
-ddrem426 remainder 1E+384 5E+383 -> 0E+369 Clamped
-ddrem427 remainder 1E+384 6E+383 -> 4.00000000000000E+383 Clamped
-ddrem428 remainder 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
-ddrem429 remainder 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
-ddrem430 remainder 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
--- tinies
-ddrem431 remainder 1E-397 1E-398 -> 0E-398
-ddrem432 remainder 1E-397 2E-398 -> 0E-398
-ddrem433 remainder 1E-397 3E-398 -> 1E-398 Subnormal
-ddrem434 remainder 1E-397 4E-398 -> 2E-398 Subnormal
-ddrem435 remainder 1E-397 5E-398 -> 0E-398
-ddrem436 remainder 1E-397 6E-398 -> 4E-398 Subnormal
-ddrem437 remainder 1E-397 7E-398 -> 3E-398 Subnormal
-ddrem438 remainder 1E-397 8E-398 -> 2E-398 Subnormal
-ddrem439 remainder 1E-397 9E-398 -> 1E-398 Subnormal
-ddrem440 remainder 1E-397 10E-398 -> 0E-398
-ddrem441 remainder 1E-397 11E-398 -> 1.0E-397 Subnormal
-ddrem442 remainder 100E-397 11E-398 -> 1.0E-397 Subnormal
-ddrem443 remainder 100E-397 20E-398 -> 0E-398
-ddrem444 remainder 100E-397 21E-398 -> 1.3E-397 Subnormal
-ddrem445 remainder 100E-397 30E-398 -> 1.0E-397 Subnormal
-
--- zero signs
-ddrem650 remainder 1 1 -> 0
-ddrem651 remainder -1 1 -> -0
-ddrem652 remainder 1 -1 -> 0
-ddrem653 remainder -1 -1 -> -0
-ddrem654 remainder 0 1 -> 0
-ddrem655 remainder -0 1 -> -0
-ddrem656 remainder 0 -1 -> 0
-ddrem657 remainder -0 -1 -> -0
-ddrem658 remainder 0.00 1 -> 0.00
-ddrem659 remainder -0.00 1 -> -0.00
-
--- Specials
-ddrem680 remainder Inf -Inf -> NaN Invalid_operation
-ddrem681 remainder Inf -1000 -> NaN Invalid_operation
-ddrem682 remainder Inf -1 -> NaN Invalid_operation
-ddrem683 remainder Inf 0 -> NaN Invalid_operation
-ddrem684 remainder Inf -0 -> NaN Invalid_operation
-ddrem685 remainder Inf 1 -> NaN Invalid_operation
-ddrem686 remainder Inf 1000 -> NaN Invalid_operation
-ddrem687 remainder Inf Inf -> NaN Invalid_operation
-ddrem688 remainder -1000 Inf -> -1000
-ddrem689 remainder -Inf Inf -> NaN Invalid_operation
-ddrem691 remainder -1 Inf -> -1
-ddrem692 remainder 0 Inf -> 0
-ddrem693 remainder -0 Inf -> -0
-ddrem694 remainder 1 Inf -> 1
-ddrem695 remainder 1000 Inf -> 1000
-ddrem696 remainder Inf Inf -> NaN Invalid_operation
-
-ddrem700 remainder -Inf -Inf -> NaN Invalid_operation
-ddrem701 remainder -Inf -1000 -> NaN Invalid_operation
-ddrem702 remainder -Inf -1 -> NaN Invalid_operation
-ddrem703 remainder -Inf -0 -> NaN Invalid_operation
-ddrem704 remainder -Inf 0 -> NaN Invalid_operation
-ddrem705 remainder -Inf 1 -> NaN Invalid_operation
-ddrem706 remainder -Inf 1000 -> NaN Invalid_operation
-ddrem707 remainder -Inf Inf -> NaN Invalid_operation
-ddrem708 remainder -Inf -Inf -> NaN Invalid_operation
-ddrem709 remainder -1000 Inf -> -1000
-ddrem710 remainder -1 -Inf -> -1
-ddrem711 remainder -0 -Inf -> -0
-ddrem712 remainder 0 -Inf -> 0
-ddrem713 remainder 1 -Inf -> 1
-ddrem714 remainder 1000 -Inf -> 1000
-ddrem715 remainder Inf -Inf -> NaN Invalid_operation
-
-ddrem721 remainder NaN -Inf -> NaN
-ddrem722 remainder NaN -1000 -> NaN
-ddrem723 remainder NaN -1 -> NaN
-ddrem724 remainder NaN -0 -> NaN
-ddrem725 remainder -NaN 0 -> -NaN
-ddrem726 remainder NaN 1 -> NaN
-ddrem727 remainder NaN 1000 -> NaN
-ddrem728 remainder NaN Inf -> NaN
-ddrem729 remainder NaN -NaN -> NaN
-ddrem730 remainder -Inf NaN -> NaN
-ddrem731 remainder -1000 NaN -> NaN
-ddrem732 remainder -1 NaN -> NaN
-ddrem733 remainder -0 -NaN -> -NaN
-ddrem734 remainder 0 NaN -> NaN
-ddrem735 remainder 1 -NaN -> -NaN
-ddrem736 remainder 1000 NaN -> NaN
-ddrem737 remainder Inf NaN -> NaN
-
-ddrem741 remainder sNaN -Inf -> NaN Invalid_operation
-ddrem742 remainder sNaN -1000 -> NaN Invalid_operation
-ddrem743 remainder -sNaN -1 -> -NaN Invalid_operation
-ddrem744 remainder sNaN -0 -> NaN Invalid_operation
-ddrem745 remainder sNaN 0 -> NaN Invalid_operation
-ddrem746 remainder sNaN 1 -> NaN Invalid_operation
-ddrem747 remainder sNaN 1000 -> NaN Invalid_operation
-ddrem749 remainder sNaN NaN -> NaN Invalid_operation
-ddrem750 remainder sNaN sNaN -> NaN Invalid_operation
-ddrem751 remainder NaN sNaN -> NaN Invalid_operation
-ddrem752 remainder -Inf sNaN -> NaN Invalid_operation
-ddrem753 remainder -1000 sNaN -> NaN Invalid_operation
-ddrem754 remainder -1 sNaN -> NaN Invalid_operation
-ddrem755 remainder -0 sNaN -> NaN Invalid_operation
-ddrem756 remainder 0 sNaN -> NaN Invalid_operation
-ddrem757 remainder 1 sNaN -> NaN Invalid_operation
-ddrem758 remainder 1000 sNaN -> NaN Invalid_operation
-ddrem759 remainder Inf -sNaN -> -NaN Invalid_operation
-
--- propaging NaNs
-ddrem760 remainder NaN1 NaN7 -> NaN1
-ddrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
-ddrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
-ddrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
-ddrem764 remainder 15 NaN11 -> NaN11
-ddrem765 remainder NaN6 NaN12 -> NaN6
-ddrem766 remainder Inf NaN13 -> NaN13
-ddrem767 remainder NaN14 -Inf -> NaN14
-ddrem768 remainder 0 NaN15 -> NaN15
-ddrem769 remainder NaN16 -0 -> NaN16
-
--- edge cases of impossible
-ddrem770 remainder 1234567890123456 10 -> 6
-ddrem771 remainder 1234567890123456 1 -> 0
-ddrem772 remainder 1234567890123456 0.1 -> NaN Division_impossible
-ddrem773 remainder 1234567890123456 0.01 -> NaN Division_impossible
-
--- long operand checks
-ddrem801 remainder 12345678000 100 -> 0
-ddrem802 remainder 1 12345678000 -> 1
-ddrem803 remainder 1234567800 10 -> 0
-ddrem804 remainder 1 1234567800 -> 1
-ddrem805 remainder 1234567890 10 -> 0
-ddrem806 remainder 1 1234567890 -> 1
-ddrem807 remainder 1234567891 10 -> 1
-ddrem808 remainder 1 1234567891 -> 1
-ddrem809 remainder 12345678901 100 -> 1
-ddrem810 remainder 1 12345678901 -> 1
-ddrem811 remainder 1234567896 10 -> 6
-ddrem812 remainder 1 1234567896 -> 1
-
-ddrem821 remainder 12345678000 100 -> 0
-ddrem822 remainder 1 12345678000 -> 1
-ddrem823 remainder 1234567800 10 -> 0
-ddrem824 remainder 1 1234567800 -> 1
-ddrem825 remainder 1234567890 10 -> 0
-ddrem826 remainder 1 1234567890 -> 1
-ddrem827 remainder 1234567891 10 -> 1
-ddrem828 remainder 1 1234567891 -> 1
-ddrem829 remainder 12345678901 100 -> 1
-ddrem830 remainder 1 12345678901 -> 1
-ddrem831 remainder 1234567896 10 -> 6
-ddrem832 remainder 1 1234567896 -> 1
-
--- from divideint
-ddrem840 remainder 100000000.0 1 -> 0.0
-ddrem841 remainder 100000000.4 1 -> 0.4
-ddrem842 remainder 100000000.5 1 -> 0.5
-ddrem843 remainder 100000000.9 1 -> 0.9
-ddrem844 remainder 100000000.999 1 -> 0.999
-ddrem850 remainder 100000003 5 -> 3
-ddrem851 remainder 10000003 5 -> 3
-ddrem852 remainder 1000003 5 -> 3
-ddrem853 remainder 100003 5 -> 3
-ddrem854 remainder 10003 5 -> 3
-ddrem855 remainder 1003 5 -> 3
-ddrem856 remainder 103 5 -> 3
-ddrem857 remainder 13 5 -> 3
-ddrem858 remainder 1 5 -> 1
-
--- Vladimir's cases 1234567890123456
-ddrem860 remainder 123.0e1 1000000000000000 -> 1230
-ddrem861 remainder 1230 1000000000000000 -> 1230
-ddrem862 remainder 12.3e2 1000000000000000 -> 1230
-ddrem863 remainder 1.23e3 1000000000000000 -> 1230
-ddrem864 remainder 123e1 1000000000000000 -> 1230
-ddrem870 remainder 123e1 1000000000000000 -> 1230
-ddrem871 remainder 123e1 100000000000000 -> 1230
-ddrem872 remainder 123e1 10000000000000 -> 1230
-ddrem873 remainder 123e1 1000000000000 -> 1230
-ddrem874 remainder 123e1 100000000000 -> 1230
-ddrem875 remainder 123e1 10000000000 -> 1230
-ddrem876 remainder 123e1 1000000000 -> 1230
-ddrem877 remainder 123e1 100000000 -> 1230
-ddrem878 remainder 1230 100000000 -> 1230
-ddrem879 remainder 123e1 10000000 -> 1230
-ddrem880 remainder 123e1 1000000 -> 1230
-ddrem881 remainder 123e1 100000 -> 1230
-ddrem882 remainder 123e1 10000 -> 1230
-ddrem883 remainder 123e1 1000 -> 230
-ddrem884 remainder 123e1 100 -> 30
-ddrem885 remainder 123e1 10 -> 0
-ddrem886 remainder 123e1 1 -> 0
-
-ddrem890 remainder 123e1 2000000000000000 -> 1230
-ddrem891 remainder 123e1 200000000000000 -> 1230
-ddrem892 remainder 123e1 20000000000000 -> 1230
-ddrem893 remainder 123e1 2000000000000 -> 1230
-ddrem894 remainder 123e1 200000000000 -> 1230
-ddrem895 remainder 123e1 20000000000 -> 1230
-ddrem896 remainder 123e1 2000000000 -> 1230
-ddrem897 remainder 123e1 200000000 -> 1230
-ddrem899 remainder 123e1 20000000 -> 1230
-ddrem900 remainder 123e1 2000000 -> 1230
-ddrem901 remainder 123e1 200000 -> 1230
-ddrem902 remainder 123e1 20000 -> 1230
-ddrem903 remainder 123e1 2000 -> 1230
-ddrem904 remainder 123e1 200 -> 30
-ddrem905 remainder 123e1 20 -> 10
-ddrem906 remainder 123e1 2 -> 0
-
-ddrem910 remainder 123e1 5000000000000000 -> 1230
-ddrem911 remainder 123e1 500000000000000 -> 1230
-ddrem912 remainder 123e1 50000000000000 -> 1230
-ddrem913 remainder 123e1 5000000000000 -> 1230
-ddrem914 remainder 123e1 500000000000 -> 1230
-ddrem915 remainder 123e1 50000000000 -> 1230
-ddrem916 remainder 123e1 5000000000 -> 1230
-ddrem917 remainder 123e1 500000000 -> 1230
-ddrem919 remainder 123e1 50000000 -> 1230
-ddrem920 remainder 123e1 5000000 -> 1230
-ddrem921 remainder 123e1 500000 -> 1230
-ddrem922 remainder 123e1 50000 -> 1230
-ddrem923 remainder 123e1 5000 -> 1230
-ddrem924 remainder 123e1 500 -> 230
-ddrem925 remainder 123e1 50 -> 30
-ddrem926 remainder 123e1 5 -> 0
-
-ddrem930 remainder 123e1 9000000000000000 -> 1230
-ddrem931 remainder 123e1 900000000000000 -> 1230
-ddrem932 remainder 123e1 90000000000000 -> 1230
-ddrem933 remainder 123e1 9000000000000 -> 1230
-ddrem934 remainder 123e1 900000000000 -> 1230
-ddrem935 remainder 123e1 90000000000 -> 1230
-ddrem936 remainder 123e1 9000000000 -> 1230
-ddrem937 remainder 123e1 900000000 -> 1230
-ddrem939 remainder 123e1 90000000 -> 1230
-ddrem940 remainder 123e1 9000000 -> 1230
-ddrem941 remainder 123e1 900000 -> 1230
-ddrem942 remainder 123e1 90000 -> 1230
-ddrem943 remainder 123e1 9000 -> 1230
-ddrem944 remainder 123e1 900 -> 330
-ddrem945 remainder 123e1 90 -> 60
-ddrem946 remainder 123e1 9 -> 6
-
-ddrem950 remainder 123e1 1000000000000000 -> 1230
-ddrem961 remainder 123e1 2999999999999999 -> 1230
-ddrem962 remainder 123e1 3999999999999999 -> 1230
-ddrem963 remainder 123e1 4999999999999999 -> 1230
-ddrem964 remainder 123e1 5999999999999999 -> 1230
-ddrem965 remainder 123e1 6999999999999999 -> 1230
-ddrem966 remainder 123e1 7999999999999999 -> 1230
-ddrem967 remainder 123e1 8999999999999999 -> 1230
-ddrem968 remainder 123e1 9999999999999999 -> 1230
-ddrem969 remainder 123e1 9876543210987654 -> 1230
-
-ddrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
-
--- overflow and underflow tests [from divide]
-ddrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
-ddrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
-ddrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
-ddrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
-ddrem1055 remainder 1e-277 1e+311 -> 1E-277
-ddrem1056 remainder 1e-277 -1e+311 -> 1E-277
-ddrem1057 remainder -1e-277 1e+311 -> -1E-277
-ddrem1058 remainder -1e-277 -1e+311 -> -1E-277
-
--- destructive subtract
-ddrem1101 remainder 1234567890123456 1.000000000000001 -> 0.765432109876546
-ddrem1102 remainder 1234567890123456 1.00000000000001 -> 0.65432109876557
-ddrem1103 remainder 1234567890123456 1.0000000000001 -> 0.5432109876668
-ddrem1104 remainder 1234567890123455 4.000000000000001 -> 2.691358027469137
-ddrem1105 remainder 1234567890123456 4.000000000000001 -> 3.691358027469137
-ddrem1106 remainder 1234567890123456 4.9999999999999 -> 0.6913578024696
-ddrem1107 remainder 1234567890123456 4.99999999999999 -> 3.46913578024691
-ddrem1108 remainder 1234567890123456 4.999999999999999 -> 1.246913578024691
-ddrem1109 remainder 1234567890123456 5.000000000000001 -> 0.753086421975309
-ddrem1110 remainder 1234567890123456 5.00000000000001 -> 3.53086421975310
-ddrem1111 remainder 1234567890123456 5.0000000000001 -> 1.3086421975314
-
--- Null tests
-ddrem1000 remainder 10 # -> NaN Invalid_operation
-ddrem1001 remainder # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddRemainder.decTest -- decDouble remainder --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks (as base, above)
+ddrem001 remainder 1 1 -> 0
+ddrem002 remainder 2 1 -> 0
+ddrem003 remainder 1 2 -> 1
+ddrem004 remainder 2 2 -> 0
+ddrem005 remainder 0 1 -> 0
+ddrem006 remainder 0 2 -> 0
+ddrem007 remainder 1 3 -> 1
+ddrem008 remainder 2 3 -> 2
+ddrem009 remainder 3 3 -> 0
+
+ddrem010 remainder 2.4 1 -> 0.4
+ddrem011 remainder 2.4 -1 -> 0.4
+ddrem012 remainder -2.4 1 -> -0.4
+ddrem013 remainder -2.4 -1 -> -0.4
+ddrem014 remainder 2.40 1 -> 0.40
+ddrem015 remainder 2.400 1 -> 0.400
+ddrem016 remainder 2.4 2 -> 0.4
+ddrem017 remainder 2.400 2 -> 0.400
+ddrem018 remainder 2. 2 -> 0
+ddrem019 remainder 20 20 -> 0
+
+ddrem020 remainder 187 187 -> 0
+ddrem021 remainder 5 2 -> 1
+ddrem022 remainder 5 2.0 -> 1.0
+ddrem023 remainder 5 2.000 -> 1.000
+ddrem024 remainder 5 0.200 -> 0.000
+ddrem025 remainder 5 0.200 -> 0.000
+
+ddrem030 remainder 1 2 -> 1
+ddrem031 remainder 1 4 -> 1
+ddrem032 remainder 1 8 -> 1
+
+ddrem033 remainder 1 16 -> 1
+ddrem034 remainder 1 32 -> 1
+ddrem035 remainder 1 64 -> 1
+ddrem040 remainder 1 -2 -> 1
+ddrem041 remainder 1 -4 -> 1
+ddrem042 remainder 1 -8 -> 1
+ddrem043 remainder 1 -16 -> 1
+ddrem044 remainder 1 -32 -> 1
+ddrem045 remainder 1 -64 -> 1
+ddrem050 remainder -1 2 -> -1
+ddrem051 remainder -1 4 -> -1
+ddrem052 remainder -1 8 -> -1
+ddrem053 remainder -1 16 -> -1
+ddrem054 remainder -1 32 -> -1
+ddrem055 remainder -1 64 -> -1
+ddrem060 remainder -1 -2 -> -1
+ddrem061 remainder -1 -4 -> -1
+ddrem062 remainder -1 -8 -> -1
+ddrem063 remainder -1 -16 -> -1
+ddrem064 remainder -1 -32 -> -1
+ddrem065 remainder -1 -64 -> -1
+
+ddrem066 remainder 999999999 1 -> 0
+ddrem067 remainder 999999999.4 1 -> 0.4
+ddrem068 remainder 999999999.5 1 -> 0.5
+ddrem069 remainder 999999999.9 1 -> 0.9
+ddrem070 remainder 999999999.999 1 -> 0.999
+ddrem071 remainder 999999.999999 1 -> 0.999999
+ddrem072 remainder 9 1 -> 0
+ddrem073 remainder 9999999999999999 1 -> 0
+ddrem074 remainder 9999999999999999 2 -> 1
+ddrem075 remainder 9999999999999999 3 -> 0
+ddrem076 remainder 9999999999999999 4 -> 3
+
+ddrem080 remainder 0. 1 -> 0
+ddrem081 remainder .0 1 -> 0.0
+ddrem082 remainder 0.00 1 -> 0.00
+ddrem083 remainder 0.00E+9 1 -> 0
+ddrem084 remainder 0.00E+3 1 -> 0
+ddrem085 remainder 0.00E+2 1 -> 0
+ddrem086 remainder 0.00E+1 1 -> 0.0
+ddrem087 remainder 0.00E+0 1 -> 0.00
+ddrem088 remainder 0.00E-0 1 -> 0.00
+ddrem089 remainder 0.00E-1 1 -> 0.000
+ddrem090 remainder 0.00E-2 1 -> 0.0000
+ddrem091 remainder 0.00E-3 1 -> 0.00000
+ddrem092 remainder 0.00E-4 1 -> 0.000000
+ddrem093 remainder 0.00E-5 1 -> 0E-7
+ddrem094 remainder 0.00E-6 1 -> 0E-8
+ddrem095 remainder 0.0000E-50 1 -> 0E-54
+
+-- Various flavours of remainder by 0
+ddrem101 remainder 0 0 -> NaN Division_undefined
+ddrem102 remainder 0 -0 -> NaN Division_undefined
+ddrem103 remainder -0 0 -> NaN Division_undefined
+ddrem104 remainder -0 -0 -> NaN Division_undefined
+ddrem105 remainder 0.0E5 0 -> NaN Division_undefined
+ddrem106 remainder 0.000 0 -> NaN Division_undefined
+-- [Some think this next group should be Division_by_zero exception, but
+-- IEEE 854 is explicit that it is Invalid operation .. for
+-- remainder-near, anyway]
+ddrem107 remainder 0.0001 0 -> NaN Invalid_operation
+ddrem108 remainder 0.01 0 -> NaN Invalid_operation
+ddrem109 remainder 0.1 0 -> NaN Invalid_operation
+ddrem110 remainder 1 0 -> NaN Invalid_operation
+ddrem111 remainder 1 0.0 -> NaN Invalid_operation
+ddrem112 remainder 10 0.0 -> NaN Invalid_operation
+ddrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
+ddrem114 remainder 1E+380 0 -> NaN Invalid_operation
+ddrem115 remainder 0.0001 -0 -> NaN Invalid_operation
+ddrem116 remainder 0.01 -0 -> NaN Invalid_operation
+ddrem119 remainder 0.1 -0 -> NaN Invalid_operation
+ddrem120 remainder 1 -0 -> NaN Invalid_operation
+ddrem121 remainder 1 -0.0 -> NaN Invalid_operation
+ddrem122 remainder 10 -0.0 -> NaN Invalid_operation
+ddrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
+ddrem124 remainder 1E+384 -0 -> NaN Invalid_operation
+-- and zeros on left
+ddrem130 remainder 0 1 -> 0
+ddrem131 remainder 0 -1 -> 0
+ddrem132 remainder 0.0 1 -> 0.0
+ddrem133 remainder 0.0 -1 -> 0.0
+ddrem134 remainder -0 1 -> -0
+ddrem135 remainder -0 -1 -> -0
+ddrem136 remainder -0.0 1 -> -0.0
+ddrem137 remainder -0.0 -1 -> -0.0
+
+-- 0.5ers
+ddrem143 remainder 0.5 2 -> 0.5
+ddrem144 remainder 0.5 2.1 -> 0.5
+ddrem145 remainder 0.5 2.01 -> 0.50
+ddrem146 remainder 0.5 2.001 -> 0.500
+ddrem147 remainder 0.50 2 -> 0.50
+ddrem148 remainder 0.50 2.01 -> 0.50
+ddrem149 remainder 0.50 2.001 -> 0.500
+
+-- steadies
+ddrem150 remainder 1 1 -> 0
+ddrem151 remainder 1 2 -> 1
+ddrem152 remainder 1 3 -> 1
+ddrem153 remainder 1 4 -> 1
+ddrem154 remainder 1 5 -> 1
+ddrem155 remainder 1 6 -> 1
+ddrem156 remainder 1 7 -> 1
+ddrem157 remainder 1 8 -> 1
+ddrem158 remainder 1 9 -> 1
+ddrem159 remainder 1 10 -> 1
+ddrem160 remainder 1 1 -> 0
+ddrem161 remainder 2 1 -> 0
+ddrem162 remainder 3 1 -> 0
+ddrem163 remainder 4 1 -> 0
+ddrem164 remainder 5 1 -> 0
+ddrem165 remainder 6 1 -> 0
+ddrem166 remainder 7 1 -> 0
+ddrem167 remainder 8 1 -> 0
+ddrem168 remainder 9 1 -> 0
+ddrem169 remainder 10 1 -> 0
+
+-- some differences from remainderNear
+ddrem171 remainder 0.4 1.020 -> 0.400
+ddrem172 remainder 0.50 1.020 -> 0.500
+ddrem173 remainder 0.51 1.020 -> 0.510
+ddrem174 remainder 0.52 1.020 -> 0.520
+ddrem175 remainder 0.6 1.020 -> 0.600
+
+-- More flavours of remainder by 0
+ddrem201 remainder 0 0 -> NaN Division_undefined
+ddrem202 remainder 0.0E5 0 -> NaN Division_undefined
+ddrem203 remainder 0.000 0 -> NaN Division_undefined
+ddrem204 remainder 0.0001 0 -> NaN Invalid_operation
+ddrem205 remainder 0.01 0 -> NaN Invalid_operation
+ddrem206 remainder 0.1 0 -> NaN Invalid_operation
+ddrem207 remainder 1 0 -> NaN Invalid_operation
+ddrem208 remainder 1 0.0 -> NaN Invalid_operation
+ddrem209 remainder 10 0.0 -> NaN Invalid_operation
+ddrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
+ddrem211 remainder 1E+380 0 -> NaN Invalid_operation
+
+-- some differences from remainderNear
+ddrem231 remainder -0.4 1.020 -> -0.400
+ddrem232 remainder -0.50 1.020 -> -0.500
+ddrem233 remainder -0.51 1.020 -> -0.510
+ddrem234 remainder -0.52 1.020 -> -0.520
+ddrem235 remainder -0.6 1.020 -> -0.600
+
+-- high Xs
+ddrem240 remainder 1E+2 1.00 -> 0.00
+
+-- ddrem3xx are from DiagBigDecimal
+ddrem301 remainder 1 3 -> 1
+ddrem302 remainder 5 5 -> 0
+ddrem303 remainder 13 10 -> 3
+ddrem304 remainder 13 50 -> 13
+ddrem305 remainder 13 100 -> 13
+ddrem306 remainder 13 1000 -> 13
+ddrem307 remainder .13 1 -> 0.13
+ddrem308 remainder 0.133 1 -> 0.133
+ddrem309 remainder 0.1033 1 -> 0.1033
+ddrem310 remainder 1.033 1 -> 0.033
+ddrem311 remainder 10.33 1 -> 0.33
+ddrem312 remainder 10.33 10 -> 0.33
+ddrem313 remainder 103.3 1 -> 0.3
+ddrem314 remainder 133 10 -> 3
+ddrem315 remainder 1033 10 -> 3
+ddrem316 remainder 1033 50 -> 33
+ddrem317 remainder 101.0 3 -> 2.0
+ddrem318 remainder 102.0 3 -> 0.0
+ddrem319 remainder 103.0 3 -> 1.0
+ddrem320 remainder 2.40 1 -> 0.40
+ddrem321 remainder 2.400 1 -> 0.400
+ddrem322 remainder 2.4 1 -> 0.4
+ddrem323 remainder 2.4 2 -> 0.4
+ddrem324 remainder 2.400 2 -> 0.400
+ddrem325 remainder 1 0.3 -> 0.1
+ddrem326 remainder 1 0.30 -> 0.10
+ddrem327 remainder 1 0.300 -> 0.100
+ddrem328 remainder 1 0.3000 -> 0.1000
+ddrem329 remainder 1.0 0.3 -> 0.1
+ddrem330 remainder 1.00 0.3 -> 0.10
+ddrem331 remainder 1.000 0.3 -> 0.100
+ddrem332 remainder 1.0000 0.3 -> 0.1000
+ddrem333 remainder 0.5 2 -> 0.5
+ddrem334 remainder 0.5 2.1 -> 0.5
+ddrem335 remainder 0.5 2.01 -> 0.50
+ddrem336 remainder 0.5 2.001 -> 0.500
+ddrem337 remainder 0.50 2 -> 0.50
+ddrem338 remainder 0.50 2.01 -> 0.50
+ddrem339 remainder 0.50 2.001 -> 0.500
+
+ddrem340 remainder 0.5 0.5000001 -> 0.5000000
+ddrem341 remainder 0.5 0.50000001 -> 0.50000000
+ddrem342 remainder 0.5 0.500000001 -> 0.500000000
+ddrem343 remainder 0.5 0.5000000001 -> 0.5000000000
+ddrem344 remainder 0.5 0.50000000001 -> 0.50000000000
+ddrem345 remainder 0.5 0.4999999 -> 1E-7
+ddrem346 remainder 0.5 0.49999999 -> 1E-8
+ddrem347 remainder 0.5 0.499999999 -> 1E-9
+ddrem348 remainder 0.5 0.4999999999 -> 1E-10
+ddrem349 remainder 0.5 0.49999999999 -> 1E-11
+ddrem350 remainder 0.5 0.499999999999 -> 1E-12
+
+ddrem351 remainder 0.03 7 -> 0.03
+ddrem352 remainder 5 2 -> 1
+ddrem353 remainder 4.1 2 -> 0.1
+ddrem354 remainder 4.01 2 -> 0.01
+ddrem355 remainder 4.001 2 -> 0.001
+ddrem356 remainder 4.0001 2 -> 0.0001
+ddrem357 remainder 4.00001 2 -> 0.00001
+ddrem358 remainder 4.000001 2 -> 0.000001
+ddrem359 remainder 4.0000001 2 -> 1E-7
+
+ddrem360 remainder 1.2 0.7345 -> 0.4655
+ddrem361 remainder 0.8 12 -> 0.8
+ddrem362 remainder 0.8 0.2 -> 0.0
+ddrem363 remainder 0.8 0.3 -> 0.2
+ddrem364 remainder 0.800 12 -> 0.800
+ddrem365 remainder 0.800 1.7 -> 0.800
+ddrem366 remainder 2.400 2 -> 0.400
+
+ddrem371 remainder 2.400 2 -> 0.400
+
+ddrem381 remainder 12345 1 -> 0
+ddrem382 remainder 12345 1.0001 -> 0.7657
+ddrem383 remainder 12345 1.001 -> 0.668
+ddrem384 remainder 12345 1.01 -> 0.78
+ddrem385 remainder 12345 1.1 -> 0.8
+ddrem386 remainder 12355 4 -> 3
+ddrem387 remainder 12345 4 -> 1
+ddrem388 remainder 12355 4.0001 -> 2.6912
+ddrem389 remainder 12345 4.0001 -> 0.6914
+ddrem390 remainder 12345 4.9 -> 1.9
+ddrem391 remainder 12345 4.99 -> 4.73
+ddrem392 remainder 12345 4.999 -> 2.469
+ddrem393 remainder 12345 4.9999 -> 0.2469
+ddrem394 remainder 12345 5 -> 0
+ddrem395 remainder 12345 5.0001 -> 4.7532
+ddrem396 remainder 12345 5.001 -> 2.532
+ddrem397 remainder 12345 5.01 -> 0.36
+ddrem398 remainder 12345 5.1 -> 3.0
+
+-- the nasty division-by-1 cases
+ddrem401 remainder 0.5 1 -> 0.5
+ddrem402 remainder 0.55 1 -> 0.55
+ddrem403 remainder 0.555 1 -> 0.555
+ddrem404 remainder 0.5555 1 -> 0.5555
+ddrem405 remainder 0.55555 1 -> 0.55555
+ddrem406 remainder 0.555555 1 -> 0.555555
+ddrem407 remainder 0.5555555 1 -> 0.5555555
+ddrem408 remainder 0.55555555 1 -> 0.55555555
+ddrem409 remainder 0.555555555 1 -> 0.555555555
+
+-- folddowns
+ddrem421 remainder 1E+384 1 -> NaN Division_impossible
+ddrem422 remainder 1E+384 1E+383 -> 0E+369 Clamped
+ddrem423 remainder 1E+384 2E+383 -> 0E+369 Clamped
+ddrem424 remainder 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
+ddrem425 remainder 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
+ddrem426 remainder 1E+384 5E+383 -> 0E+369 Clamped
+ddrem427 remainder 1E+384 6E+383 -> 4.00000000000000E+383 Clamped
+ddrem428 remainder 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
+ddrem429 remainder 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
+ddrem430 remainder 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
+-- tinies
+ddrem431 remainder 1E-397 1E-398 -> 0E-398
+ddrem432 remainder 1E-397 2E-398 -> 0E-398
+ddrem433 remainder 1E-397 3E-398 -> 1E-398 Subnormal
+ddrem434 remainder 1E-397 4E-398 -> 2E-398 Subnormal
+ddrem435 remainder 1E-397 5E-398 -> 0E-398
+ddrem436 remainder 1E-397 6E-398 -> 4E-398 Subnormal
+ddrem437 remainder 1E-397 7E-398 -> 3E-398 Subnormal
+ddrem438 remainder 1E-397 8E-398 -> 2E-398 Subnormal
+ddrem439 remainder 1E-397 9E-398 -> 1E-398 Subnormal
+ddrem440 remainder 1E-397 10E-398 -> 0E-398
+ddrem441 remainder 1E-397 11E-398 -> 1.0E-397 Subnormal
+ddrem442 remainder 100E-397 11E-398 -> 1.0E-397 Subnormal
+ddrem443 remainder 100E-397 20E-398 -> 0E-398
+ddrem444 remainder 100E-397 21E-398 -> 1.3E-397 Subnormal
+ddrem445 remainder 100E-397 30E-398 -> 1.0E-397 Subnormal
+
+-- zero signs
+ddrem650 remainder 1 1 -> 0
+ddrem651 remainder -1 1 -> -0
+ddrem652 remainder 1 -1 -> 0
+ddrem653 remainder -1 -1 -> -0
+ddrem654 remainder 0 1 -> 0
+ddrem655 remainder -0 1 -> -0
+ddrem656 remainder 0 -1 -> 0
+ddrem657 remainder -0 -1 -> -0
+ddrem658 remainder 0.00 1 -> 0.00
+ddrem659 remainder -0.00 1 -> -0.00
+
+-- Specials
+ddrem680 remainder Inf -Inf -> NaN Invalid_operation
+ddrem681 remainder Inf -1000 -> NaN Invalid_operation
+ddrem682 remainder Inf -1 -> NaN Invalid_operation
+ddrem683 remainder Inf 0 -> NaN Invalid_operation
+ddrem684 remainder Inf -0 -> NaN Invalid_operation
+ddrem685 remainder Inf 1 -> NaN Invalid_operation
+ddrem686 remainder Inf 1000 -> NaN Invalid_operation
+ddrem687 remainder Inf Inf -> NaN Invalid_operation
+ddrem688 remainder -1000 Inf -> -1000
+ddrem689 remainder -Inf Inf -> NaN Invalid_operation
+ddrem691 remainder -1 Inf -> -1
+ddrem692 remainder 0 Inf -> 0
+ddrem693 remainder -0 Inf -> -0
+ddrem694 remainder 1 Inf -> 1
+ddrem695 remainder 1000 Inf -> 1000
+ddrem696 remainder Inf Inf -> NaN Invalid_operation
+
+ddrem700 remainder -Inf -Inf -> NaN Invalid_operation
+ddrem701 remainder -Inf -1000 -> NaN Invalid_operation
+ddrem702 remainder -Inf -1 -> NaN Invalid_operation
+ddrem703 remainder -Inf -0 -> NaN Invalid_operation
+ddrem704 remainder -Inf 0 -> NaN Invalid_operation
+ddrem705 remainder -Inf 1 -> NaN Invalid_operation
+ddrem706 remainder -Inf 1000 -> NaN Invalid_operation
+ddrem707 remainder -Inf Inf -> NaN Invalid_operation
+ddrem708 remainder -Inf -Inf -> NaN Invalid_operation
+ddrem709 remainder -1000 Inf -> -1000
+ddrem710 remainder -1 -Inf -> -1
+ddrem711 remainder -0 -Inf -> -0
+ddrem712 remainder 0 -Inf -> 0
+ddrem713 remainder 1 -Inf -> 1
+ddrem714 remainder 1000 -Inf -> 1000
+ddrem715 remainder Inf -Inf -> NaN Invalid_operation
+
+ddrem721 remainder NaN -Inf -> NaN
+ddrem722 remainder NaN -1000 -> NaN
+ddrem723 remainder NaN -1 -> NaN
+ddrem724 remainder NaN -0 -> NaN
+ddrem725 remainder -NaN 0 -> -NaN
+ddrem726 remainder NaN 1 -> NaN
+ddrem727 remainder NaN 1000 -> NaN
+ddrem728 remainder NaN Inf -> NaN
+ddrem729 remainder NaN -NaN -> NaN
+ddrem730 remainder -Inf NaN -> NaN
+ddrem731 remainder -1000 NaN -> NaN
+ddrem732 remainder -1 NaN -> NaN
+ddrem733 remainder -0 -NaN -> -NaN
+ddrem734 remainder 0 NaN -> NaN
+ddrem735 remainder 1 -NaN -> -NaN
+ddrem736 remainder 1000 NaN -> NaN
+ddrem737 remainder Inf NaN -> NaN
+
+ddrem741 remainder sNaN -Inf -> NaN Invalid_operation
+ddrem742 remainder sNaN -1000 -> NaN Invalid_operation
+ddrem743 remainder -sNaN -1 -> -NaN Invalid_operation
+ddrem744 remainder sNaN -0 -> NaN Invalid_operation
+ddrem745 remainder sNaN 0 -> NaN Invalid_operation
+ddrem746 remainder sNaN 1 -> NaN Invalid_operation
+ddrem747 remainder sNaN 1000 -> NaN Invalid_operation
+ddrem749 remainder sNaN NaN -> NaN Invalid_operation
+ddrem750 remainder sNaN sNaN -> NaN Invalid_operation
+ddrem751 remainder NaN sNaN -> NaN Invalid_operation
+ddrem752 remainder -Inf sNaN -> NaN Invalid_operation
+ddrem753 remainder -1000 sNaN -> NaN Invalid_operation
+ddrem754 remainder -1 sNaN -> NaN Invalid_operation
+ddrem755 remainder -0 sNaN -> NaN Invalid_operation
+ddrem756 remainder 0 sNaN -> NaN Invalid_operation
+ddrem757 remainder 1 sNaN -> NaN Invalid_operation
+ddrem758 remainder 1000 sNaN -> NaN Invalid_operation
+ddrem759 remainder Inf -sNaN -> -NaN Invalid_operation
+
+-- propaging NaNs
+ddrem760 remainder NaN1 NaN7 -> NaN1
+ddrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
+ddrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
+ddrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
+ddrem764 remainder 15 NaN11 -> NaN11
+ddrem765 remainder NaN6 NaN12 -> NaN6
+ddrem766 remainder Inf NaN13 -> NaN13
+ddrem767 remainder NaN14 -Inf -> NaN14
+ddrem768 remainder 0 NaN15 -> NaN15
+ddrem769 remainder NaN16 -0 -> NaN16
+
+-- edge cases of impossible
+ddrem770 remainder 1234567890123456 10 -> 6
+ddrem771 remainder 1234567890123456 1 -> 0
+ddrem772 remainder 1234567890123456 0.1 -> NaN Division_impossible
+ddrem773 remainder 1234567890123456 0.01 -> NaN Division_impossible
+
+-- long operand checks
+ddrem801 remainder 12345678000 100 -> 0
+ddrem802 remainder 1 12345678000 -> 1
+ddrem803 remainder 1234567800 10 -> 0
+ddrem804 remainder 1 1234567800 -> 1
+ddrem805 remainder 1234567890 10 -> 0
+ddrem806 remainder 1 1234567890 -> 1
+ddrem807 remainder 1234567891 10 -> 1
+ddrem808 remainder 1 1234567891 -> 1
+ddrem809 remainder 12345678901 100 -> 1
+ddrem810 remainder 1 12345678901 -> 1
+ddrem811 remainder 1234567896 10 -> 6
+ddrem812 remainder 1 1234567896 -> 1
+
+ddrem821 remainder 12345678000 100 -> 0
+ddrem822 remainder 1 12345678000 -> 1
+ddrem823 remainder 1234567800 10 -> 0
+ddrem824 remainder 1 1234567800 -> 1
+ddrem825 remainder 1234567890 10 -> 0
+ddrem826 remainder 1 1234567890 -> 1
+ddrem827 remainder 1234567891 10 -> 1
+ddrem828 remainder 1 1234567891 -> 1
+ddrem829 remainder 12345678901 100 -> 1
+ddrem830 remainder 1 12345678901 -> 1
+ddrem831 remainder 1234567896 10 -> 6
+ddrem832 remainder 1 1234567896 -> 1
+
+-- from divideint
+ddrem840 remainder 100000000.0 1 -> 0.0
+ddrem841 remainder 100000000.4 1 -> 0.4
+ddrem842 remainder 100000000.5 1 -> 0.5
+ddrem843 remainder 100000000.9 1 -> 0.9
+ddrem844 remainder 100000000.999 1 -> 0.999
+ddrem850 remainder 100000003 5 -> 3
+ddrem851 remainder 10000003 5 -> 3
+ddrem852 remainder 1000003 5 -> 3
+ddrem853 remainder 100003 5 -> 3
+ddrem854 remainder 10003 5 -> 3
+ddrem855 remainder 1003 5 -> 3
+ddrem856 remainder 103 5 -> 3
+ddrem857 remainder 13 5 -> 3
+ddrem858 remainder 1 5 -> 1
+
+-- Vladimir's cases 1234567890123456
+ddrem860 remainder 123.0e1 1000000000000000 -> 1230
+ddrem861 remainder 1230 1000000000000000 -> 1230
+ddrem862 remainder 12.3e2 1000000000000000 -> 1230
+ddrem863 remainder 1.23e3 1000000000000000 -> 1230
+ddrem864 remainder 123e1 1000000000000000 -> 1230
+ddrem870 remainder 123e1 1000000000000000 -> 1230
+ddrem871 remainder 123e1 100000000000000 -> 1230
+ddrem872 remainder 123e1 10000000000000 -> 1230
+ddrem873 remainder 123e1 1000000000000 -> 1230
+ddrem874 remainder 123e1 100000000000 -> 1230
+ddrem875 remainder 123e1 10000000000 -> 1230
+ddrem876 remainder 123e1 1000000000 -> 1230
+ddrem877 remainder 123e1 100000000 -> 1230
+ddrem878 remainder 1230 100000000 -> 1230
+ddrem879 remainder 123e1 10000000 -> 1230
+ddrem880 remainder 123e1 1000000 -> 1230
+ddrem881 remainder 123e1 100000 -> 1230
+ddrem882 remainder 123e1 10000 -> 1230
+ddrem883 remainder 123e1 1000 -> 230
+ddrem884 remainder 123e1 100 -> 30
+ddrem885 remainder 123e1 10 -> 0
+ddrem886 remainder 123e1 1 -> 0
+
+ddrem890 remainder 123e1 2000000000000000 -> 1230
+ddrem891 remainder 123e1 200000000000000 -> 1230
+ddrem892 remainder 123e1 20000000000000 -> 1230
+ddrem893 remainder 123e1 2000000000000 -> 1230
+ddrem894 remainder 123e1 200000000000 -> 1230
+ddrem895 remainder 123e1 20000000000 -> 1230
+ddrem896 remainder 123e1 2000000000 -> 1230
+ddrem897 remainder 123e1 200000000 -> 1230
+ddrem899 remainder 123e1 20000000 -> 1230
+ddrem900 remainder 123e1 2000000 -> 1230
+ddrem901 remainder 123e1 200000 -> 1230
+ddrem902 remainder 123e1 20000 -> 1230
+ddrem903 remainder 123e1 2000 -> 1230
+ddrem904 remainder 123e1 200 -> 30
+ddrem905 remainder 123e1 20 -> 10
+ddrem906 remainder 123e1 2 -> 0
+
+ddrem910 remainder 123e1 5000000000000000 -> 1230
+ddrem911 remainder 123e1 500000000000000 -> 1230
+ddrem912 remainder 123e1 50000000000000 -> 1230
+ddrem913 remainder 123e1 5000000000000 -> 1230
+ddrem914 remainder 123e1 500000000000 -> 1230
+ddrem915 remainder 123e1 50000000000 -> 1230
+ddrem916 remainder 123e1 5000000000 -> 1230
+ddrem917 remainder 123e1 500000000 -> 1230
+ddrem919 remainder 123e1 50000000 -> 1230
+ddrem920 remainder 123e1 5000000 -> 1230
+ddrem921 remainder 123e1 500000 -> 1230
+ddrem922 remainder 123e1 50000 -> 1230
+ddrem923 remainder 123e1 5000 -> 1230
+ddrem924 remainder 123e1 500 -> 230
+ddrem925 remainder 123e1 50 -> 30
+ddrem926 remainder 123e1 5 -> 0
+
+ddrem930 remainder 123e1 9000000000000000 -> 1230
+ddrem931 remainder 123e1 900000000000000 -> 1230
+ddrem932 remainder 123e1 90000000000000 -> 1230
+ddrem933 remainder 123e1 9000000000000 -> 1230
+ddrem934 remainder 123e1 900000000000 -> 1230
+ddrem935 remainder 123e1 90000000000 -> 1230
+ddrem936 remainder 123e1 9000000000 -> 1230
+ddrem937 remainder 123e1 900000000 -> 1230
+ddrem939 remainder 123e1 90000000 -> 1230
+ddrem940 remainder 123e1 9000000 -> 1230
+ddrem941 remainder 123e1 900000 -> 1230
+ddrem942 remainder 123e1 90000 -> 1230
+ddrem943 remainder 123e1 9000 -> 1230
+ddrem944 remainder 123e1 900 -> 330
+ddrem945 remainder 123e1 90 -> 60
+ddrem946 remainder 123e1 9 -> 6
+
+ddrem950 remainder 123e1 1000000000000000 -> 1230
+ddrem961 remainder 123e1 2999999999999999 -> 1230
+ddrem962 remainder 123e1 3999999999999999 -> 1230
+ddrem963 remainder 123e1 4999999999999999 -> 1230
+ddrem964 remainder 123e1 5999999999999999 -> 1230
+ddrem965 remainder 123e1 6999999999999999 -> 1230
+ddrem966 remainder 123e1 7999999999999999 -> 1230
+ddrem967 remainder 123e1 8999999999999999 -> 1230
+ddrem968 remainder 123e1 9999999999999999 -> 1230
+ddrem969 remainder 123e1 9876543210987654 -> 1230
+
+ddrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
+
+-- overflow and underflow tests [from divide]
+ddrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
+ddrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
+ddrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
+ddrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
+ddrem1055 remainder 1e-277 1e+311 -> 1E-277
+ddrem1056 remainder 1e-277 -1e+311 -> 1E-277
+ddrem1057 remainder -1e-277 1e+311 -> -1E-277
+ddrem1058 remainder -1e-277 -1e+311 -> -1E-277
+
+-- destructive subtract
+ddrem1101 remainder 1234567890123456 1.000000000000001 -> 0.765432109876546
+ddrem1102 remainder 1234567890123456 1.00000000000001 -> 0.65432109876557
+ddrem1103 remainder 1234567890123456 1.0000000000001 -> 0.5432109876668
+ddrem1104 remainder 1234567890123455 4.000000000000001 -> 2.691358027469137
+ddrem1105 remainder 1234567890123456 4.000000000000001 -> 3.691358027469137
+ddrem1106 remainder 1234567890123456 4.9999999999999 -> 0.6913578024696
+ddrem1107 remainder 1234567890123456 4.99999999999999 -> 3.46913578024691
+ddrem1108 remainder 1234567890123456 4.999999999999999 -> 1.246913578024691
+ddrem1109 remainder 1234567890123456 5.000000000000001 -> 0.753086421975309
+ddrem1110 remainder 1234567890123456 5.00000000000001 -> 3.53086421975310
+ddrem1111 remainder 1234567890123456 5.0000000000001 -> 1.3086421975314
+
+-- Null tests
+ddrem1000 remainder 10 # -> NaN Invalid_operation
+ddrem1001 remainder # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddRemainderNear.decTest b/Lib/test/decimaltestdata/ddRemainderNear.decTest
index 6ba64ebafe..8da9afc4c3 100644
--- a/Lib/test/decimaltestdata/ddRemainderNear.decTest
+++ b/Lib/test/decimaltestdata/ddRemainderNear.decTest
@@ -1,629 +1,629 @@
-------------------------------------------------------------------------
--- ddRemainderNear.decTest -- decDouble remainder-near --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- sanity checks (as base, above)
-ddrmn001 remaindernear 1 1 -> 0
-ddrmn002 remaindernear 2 1 -> 0
-ddrmn003 remaindernear 1 2 -> 1
-ddrmn004 remaindernear 2 2 -> 0
-ddrmn005 remaindernear 0 1 -> 0
-ddrmn006 remaindernear 0 2 -> 0
-ddrmn007 remaindernear 1 3 -> 1
-ddrmn008 remaindernear 2 3 -> -1
-ddrmn009 remaindernear 3 3 -> 0
-
-ddrmn010 remaindernear 2.4 1 -> 0.4
-ddrmn011 remaindernear 2.4 -1 -> 0.4
-ddrmn012 remaindernear -2.4 1 -> -0.4
-ddrmn013 remaindernear -2.4 -1 -> -0.4
-ddrmn014 remaindernear 2.40 1 -> 0.40
-ddrmn015 remaindernear 2.400 1 -> 0.400
-ddrmn016 remaindernear 2.4 2 -> 0.4
-ddrmn017 remaindernear 2.400 2 -> 0.400
-ddrmn018 remaindernear 2. 2 -> 0
-ddrmn019 remaindernear 20 20 -> 0
-
-ddrmn020 remaindernear 187 187 -> 0
-ddrmn021 remaindernear 5 2 -> 1
-ddrmn022 remaindernear 5 2.0 -> 1.0
-ddrmn023 remaindernear 5 2.000 -> 1.000
-ddrmn024 remaindernear 5 0.200 -> 0.000
-ddrmn025 remaindernear 5 0.200 -> 0.000
-
-ddrmn030 remaindernear 1 2 -> 1
-ddrmn031 remaindernear 1 4 -> 1
-ddrmn032 remaindernear 1 8 -> 1
-
-ddrmn033 remaindernear 1 16 -> 1
-ddrmn034 remaindernear 1 32 -> 1
-ddrmn035 remaindernear 1 64 -> 1
-ddrmn040 remaindernear 1 -2 -> 1
-ddrmn041 remaindernear 1 -4 -> 1
-ddrmn042 remaindernear 1 -8 -> 1
-ddrmn043 remaindernear 1 -16 -> 1
-ddrmn044 remaindernear 1 -32 -> 1
-ddrmn045 remaindernear 1 -64 -> 1
-ddrmn050 remaindernear -1 2 -> -1
-ddrmn051 remaindernear -1 4 -> -1
-ddrmn052 remaindernear -1 8 -> -1
-ddrmn053 remaindernear -1 16 -> -1
-ddrmn054 remaindernear -1 32 -> -1
-ddrmn055 remaindernear -1 64 -> -1
-ddrmn060 remaindernear -1 -2 -> -1
-ddrmn061 remaindernear -1 -4 -> -1
-ddrmn062 remaindernear -1 -8 -> -1
-ddrmn063 remaindernear -1 -16 -> -1
-ddrmn064 remaindernear -1 -32 -> -1
-ddrmn065 remaindernear -1 -64 -> -1
-
-ddrmn066 remaindernear 9.9 1 -> -0.1
-ddrmn067 remaindernear 99.7 1 -> -0.3
-ddrmn068 remaindernear 999999999 1 -> 0
-ddrmn069 remaindernear 999999999.4 1 -> 0.4
-ddrmn070 remaindernear 999999999.5 1 -> -0.5
-ddrmn071 remaindernear 999999999.9 1 -> -0.1
-ddrmn072 remaindernear 999999999.999 1 -> -0.001
-ddrmn073 remaindernear 999999.999999 1 -> -0.000001
-ddrmn074 remaindernear 9 1 -> 0
-ddrmn075 remaindernear 9999999999999999 1 -> 0
-ddrmn076 remaindernear 9999999999999999 2 -> -1
-ddrmn077 remaindernear 9999999999999999 3 -> 0
-ddrmn078 remaindernear 9999999999999999 4 -> -1
-
-ddrmn080 remaindernear 0. 1 -> 0
-ddrmn081 remaindernear .0 1 -> 0.0
-ddrmn082 remaindernear 0.00 1 -> 0.00
-ddrmn083 remaindernear 0.00E+9 1 -> 0
-ddrmn084 remaindernear 0.00E+3 1 -> 0
-ddrmn085 remaindernear 0.00E+2 1 -> 0
-ddrmn086 remaindernear 0.00E+1 1 -> 0.0
-ddrmn087 remaindernear 0.00E+0 1 -> 0.00
-ddrmn088 remaindernear 0.00E-0 1 -> 0.00
-ddrmn089 remaindernear 0.00E-1 1 -> 0.000
-ddrmn090 remaindernear 0.00E-2 1 -> 0.0000
-ddrmn091 remaindernear 0.00E-3 1 -> 0.00000
-ddrmn092 remaindernear 0.00E-4 1 -> 0.000000
-ddrmn093 remaindernear 0.00E-5 1 -> 0E-7
-ddrmn094 remaindernear 0.00E-6 1 -> 0E-8
-ddrmn095 remaindernear 0.0000E-50 1 -> 0E-54
-
--- Various flavours of remaindernear by 0
-ddrmn101 remaindernear 0 0 -> NaN Division_undefined
-ddrmn102 remaindernear 0 -0 -> NaN Division_undefined
-ddrmn103 remaindernear -0 0 -> NaN Division_undefined
-ddrmn104 remaindernear -0 -0 -> NaN Division_undefined
-ddrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined
-ddrmn106 remaindernear 0.000 0 -> NaN Division_undefined
--- [Some think this next group should be Division_by_zero exception, but
--- IEEE 854 is explicit that it is Invalid operation .. for
--- remainder-near, anyway]
-ddrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation
-ddrmn108 remaindernear 0.01 0 -> NaN Invalid_operation
-ddrmn109 remaindernear 0.1 0 -> NaN Invalid_operation
-ddrmn110 remaindernear 1 0 -> NaN Invalid_operation
-ddrmn111 remaindernear 1 0.0 -> NaN Invalid_operation
-ddrmn112 remaindernear 10 0.0 -> NaN Invalid_operation
-ddrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation
-ddrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation
-ddrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation
-ddrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation
-ddrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation
-ddrmn120 remaindernear 1 -0 -> NaN Invalid_operation
-ddrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation
-ddrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation
-ddrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation
-ddrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation
--- and zeros on left
-ddrmn130 remaindernear 0 1 -> 0
-ddrmn131 remaindernear 0 -1 -> 0
-ddrmn132 remaindernear 0.0 1 -> 0.0
-ddrmn133 remaindernear 0.0 -1 -> 0.0
-ddrmn134 remaindernear -0 1 -> -0
-ddrmn135 remaindernear -0 -1 -> -0
-ddrmn136 remaindernear -0.0 1 -> -0.0
-ddrmn137 remaindernear -0.0 -1 -> -0.0
-
--- 0.5ers
-ddrmn143 remaindernear 0.5 2 -> 0.5
-ddrmn144 remaindernear 0.5 2.1 -> 0.5
-ddrmn145 remaindernear 0.5 2.01 -> 0.50
-ddrmn146 remaindernear 0.5 2.001 -> 0.500
-ddrmn147 remaindernear 0.50 2 -> 0.50
-ddrmn148 remaindernear 0.50 2.01 -> 0.50
-ddrmn149 remaindernear 0.50 2.001 -> 0.500
-
--- steadies
-ddrmn150 remaindernear 1 1 -> 0
-ddrmn151 remaindernear 1 2 -> 1
-ddrmn152 remaindernear 1 3 -> 1
-ddrmn153 remaindernear 1 4 -> 1
-ddrmn154 remaindernear 1 5 -> 1
-ddrmn155 remaindernear 1 6 -> 1
-ddrmn156 remaindernear 1 7 -> 1
-ddrmn157 remaindernear 1 8 -> 1
-ddrmn158 remaindernear 1 9 -> 1
-ddrmn159 remaindernear 1 10 -> 1
-ddrmn160 remaindernear 1 1 -> 0
-ddrmn161 remaindernear 2 1 -> 0
-ddrmn162 remaindernear 3 1 -> 0
-ddrmn163 remaindernear 4 1 -> 0
-ddrmn164 remaindernear 5 1 -> 0
-ddrmn165 remaindernear 6 1 -> 0
-ddrmn166 remaindernear 7 1 -> 0
-ddrmn167 remaindernear 8 1 -> 0
-ddrmn168 remaindernear 9 1 -> 0
-ddrmn169 remaindernear 10 1 -> 0
-
--- some differences from remainder
-ddrmn171 remaindernear 0.4 1.020 -> 0.400
-ddrmn172 remaindernear 0.50 1.020 -> 0.500
-ddrmn173 remaindernear 0.51 1.020 -> 0.510
-ddrmn174 remaindernear 0.52 1.020 -> -0.500
-ddrmn175 remaindernear 0.6 1.020 -> -0.420
-
--- More flavours of remaindernear by 0
-ddrmn201 remaindernear 0 0 -> NaN Division_undefined
-ddrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined
-ddrmn203 remaindernear 0.000 0 -> NaN Division_undefined
-ddrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation
-ddrmn205 remaindernear 0.01 0 -> NaN Invalid_operation
-ddrmn206 remaindernear 0.1 0 -> NaN Invalid_operation
-ddrmn207 remaindernear 1 0 -> NaN Invalid_operation
-ddrmn208 remaindernear 1 0.0 -> NaN Invalid_operation
-ddrmn209 remaindernear 10 0.0 -> NaN Invalid_operation
-ddrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation
-ddrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation
-
--- tests from the extended specification
-ddrmn221 remaindernear 2.1 3 -> -0.9
-ddrmn222 remaindernear 10 6 -> -2
-ddrmn223 remaindernear 10 3 -> 1
-ddrmn224 remaindernear -10 3 -> -1
-ddrmn225 remaindernear 10.2 1 -> 0.2
-ddrmn226 remaindernear 10 0.3 -> 0.1
-ddrmn227 remaindernear 3.6 1.3 -> -0.3
-
--- some differences from remainder
-ddrmn231 remaindernear -0.4 1.020 -> -0.400
-ddrmn232 remaindernear -0.50 1.020 -> -0.500
-ddrmn233 remaindernear -0.51 1.020 -> -0.510
-ddrmn234 remaindernear -0.52 1.020 -> 0.500
-ddrmn235 remaindernear -0.6 1.020 -> 0.420
-
--- high Xs
-ddrmn240 remaindernear 1E+2 1.00 -> 0.00
-
--- ddrmn3xx are from DiagBigDecimal
-ddrmn301 remaindernear 1 3 -> 1
-ddrmn302 remaindernear 5 5 -> 0
-ddrmn303 remaindernear 13 10 -> 3
-ddrmn304 remaindernear 13 50 -> 13
-ddrmn305 remaindernear 13 100 -> 13
-ddrmn306 remaindernear 13 1000 -> 13
-ddrmn307 remaindernear .13 1 -> 0.13
-ddrmn308 remaindernear 0.133 1 -> 0.133
-ddrmn309 remaindernear 0.1033 1 -> 0.1033
-ddrmn310 remaindernear 1.033 1 -> 0.033
-ddrmn311 remaindernear 10.33 1 -> 0.33
-ddrmn312 remaindernear 10.33 10 -> 0.33
-ddrmn313 remaindernear 103.3 1 -> 0.3
-ddrmn314 remaindernear 133 10 -> 3
-ddrmn315 remaindernear 1033 10 -> 3
-ddrmn316 remaindernear 1033 50 -> -17
-ddrmn317 remaindernear 101.0 3 -> -1.0
-ddrmn318 remaindernear 102.0 3 -> 0.0
-ddrmn319 remaindernear 103.0 3 -> 1.0
-ddrmn320 remaindernear 2.40 1 -> 0.40
-ddrmn321 remaindernear 2.400 1 -> 0.400
-ddrmn322 remaindernear 2.4 1 -> 0.4
-ddrmn323 remaindernear 2.4 2 -> 0.4
-ddrmn324 remaindernear 2.400 2 -> 0.400
-ddrmn325 remaindernear 1 0.3 -> 0.1
-ddrmn326 remaindernear 1 0.30 -> 0.10
-ddrmn327 remaindernear 1 0.300 -> 0.100
-ddrmn328 remaindernear 1 0.3000 -> 0.1000
-ddrmn329 remaindernear 1.0 0.3 -> 0.1
-ddrmn330 remaindernear 1.00 0.3 -> 0.10
-ddrmn331 remaindernear 1.000 0.3 -> 0.100
-ddrmn332 remaindernear 1.0000 0.3 -> 0.1000
-ddrmn333 remaindernear 0.5 2 -> 0.5
-ddrmn334 remaindernear 0.5 2.1 -> 0.5
-ddrmn335 remaindernear 0.5 2.01 -> 0.50
-ddrmn336 remaindernear 0.5 2.001 -> 0.500
-ddrmn337 remaindernear 0.50 2 -> 0.50
-ddrmn338 remaindernear 0.50 2.01 -> 0.50
-ddrmn339 remaindernear 0.50 2.001 -> 0.500
-
-ddrmn340 remaindernear 0.5 0.5000001 -> -1E-7
-ddrmn341 remaindernear 0.5 0.50000001 -> -1E-8
-ddrmn342 remaindernear 0.5 0.500000001 -> -1E-9
-ddrmn343 remaindernear 0.5 0.5000000001 -> -1E-10
-ddrmn344 remaindernear 0.5 0.50000000001 -> -1E-11
-ddrmn345 remaindernear 0.5 0.4999999 -> 1E-7
-ddrmn346 remaindernear 0.5 0.49999999 -> 1E-8
-ddrmn347 remaindernear 0.5 0.499999999 -> 1E-9
-ddrmn348 remaindernear 0.5 0.4999999999 -> 1E-10
-ddrmn349 remaindernear 0.5 0.49999999999 -> 1E-11
-ddrmn350 remaindernear 0.5 0.499999999999 -> 1E-12
-
-ddrmn351 remaindernear 0.03 7 -> 0.03
-ddrmn352 remaindernear 5 2 -> 1
-ddrmn353 remaindernear 4.1 2 -> 0.1
-ddrmn354 remaindernear 4.01 2 -> 0.01
-ddrmn355 remaindernear 4.001 2 -> 0.001
-ddrmn356 remaindernear 4.0001 2 -> 0.0001
-ddrmn357 remaindernear 4.00001 2 -> 0.00001
-ddrmn358 remaindernear 4.000001 2 -> 0.000001
-ddrmn359 remaindernear 4.0000001 2 -> 1E-7
-
-ddrmn360 remaindernear 1.2 0.7345 -> -0.2690
-ddrmn361 remaindernear 0.8 12 -> 0.8
-ddrmn362 remaindernear 0.8 0.2 -> 0.0
-ddrmn363 remaindernear 0.8 0.3 -> -0.1
-ddrmn364 remaindernear 0.800 12 -> 0.800
-ddrmn365 remaindernear 0.800 1.7 -> 0.800
-ddrmn366 remaindernear 2.400 2 -> 0.400
-
--- round to even
-ddrmn371 remaindernear 121 2 -> 1
-ddrmn372 remaindernear 122 2 -> 0
-ddrmn373 remaindernear 123 2 -> -1
-ddrmn374 remaindernear 124 2 -> 0
-ddrmn375 remaindernear 125 2 -> 1
-ddrmn376 remaindernear 126 2 -> 0
-ddrmn377 remaindernear 127 2 -> -1
-
-ddrmn381 remaindernear 12345 1 -> 0
-ddrmn382 remaindernear 12345 1.0001 -> -0.2344
-ddrmn383 remaindernear 12345 1.001 -> -0.333
-ddrmn384 remaindernear 12345 1.01 -> -0.23
-ddrmn385 remaindernear 12345 1.1 -> -0.3
-ddrmn386 remaindernear 12355 4 -> -1
-ddrmn387 remaindernear 12345 4 -> 1
-ddrmn388 remaindernear 12355 4.0001 -> -1.3089
-ddrmn389 remaindernear 12345 4.0001 -> 0.6914
-ddrmn390 remaindernear 12345 4.9 -> 1.9
-ddrmn391 remaindernear 12345 4.99 -> -0.26
-ddrmn392 remaindernear 12345 4.999 -> 2.469
-ddrmn393 remaindernear 12345 4.9999 -> 0.2469
-ddrmn394 remaindernear 12345 5 -> 0
-ddrmn395 remaindernear 12345 5.0001 -> -0.2469
-ddrmn396 remaindernear 12345 5.001 -> -2.469
-ddrmn397 remaindernear 12345 5.01 -> 0.36
-ddrmn398 remaindernear 12345 5.1 -> -2.1
-
--- the nasty division-by-1 cases
-ddrmn401 remaindernear 0.4 1 -> 0.4
-ddrmn402 remaindernear 0.45 1 -> 0.45
-ddrmn403 remaindernear 0.455 1 -> 0.455
-ddrmn404 remaindernear 0.4555 1 -> 0.4555
-ddrmn405 remaindernear 0.45555 1 -> 0.45555
-ddrmn406 remaindernear 0.455555 1 -> 0.455555
-ddrmn407 remaindernear 0.4555555 1 -> 0.4555555
-ddrmn408 remaindernear 0.45555555 1 -> 0.45555555
-ddrmn409 remaindernear 0.455555555 1 -> 0.455555555
--- with spill... [412 exercises sticktab loop]
-ddrmn411 remaindernear 0.5 1 -> 0.5
-ddrmn412 remaindernear 0.55 1 -> -0.45
-ddrmn413 remaindernear 0.555 1 -> -0.445
-ddrmn414 remaindernear 0.5555 1 -> -0.4445
-ddrmn415 remaindernear 0.55555 1 -> -0.44445
-ddrmn416 remaindernear 0.555555 1 -> -0.444445
-ddrmn417 remaindernear 0.5555555 1 -> -0.4444445
-ddrmn418 remaindernear 0.55555555 1 -> -0.44444445
-ddrmn419 remaindernear 0.555555555 1 -> -0.444444445
-
--- folddowns
-ddrmn421 remaindernear 1E+384 1 -> NaN Division_impossible
-ddrmn422 remaindernear 1E+384 1E+383 -> 0E+369 Clamped
-ddrmn423 remaindernear 1E+384 2E+383 -> 0E+369 Clamped
-ddrmn424 remaindernear 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
-ddrmn425 remaindernear 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
-ddrmn426 remaindernear 1E+384 5E+383 -> 0E+369 Clamped
-ddrmn427 remaindernear 1E+384 6E+383 -> -2.00000000000000E+383 Clamped
-ddrmn428 remaindernear 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
-ddrmn429 remaindernear 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
-ddrmn430 remaindernear 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
--- tinies
-ddrmn431 remaindernear 1E-397 1E-398 -> 0E-398
-ddrmn432 remaindernear 1E-397 2E-398 -> 0E-398
-ddrmn433 remaindernear 1E-397 3E-398 -> 1E-398 Subnormal
-ddrmn434 remaindernear 1E-397 4E-398 -> 2E-398 Subnormal
-ddrmn435 remaindernear 1E-397 5E-398 -> 0E-398
-ddrmn436 remaindernear 1E-397 6E-398 -> -2E-398 Subnormal
-ddrmn437 remaindernear 1E-397 7E-398 -> 3E-398 Subnormal
-ddrmn438 remaindernear 1E-397 8E-398 -> 2E-398 Subnormal
-ddrmn439 remaindernear 1E-397 9E-398 -> 1E-398 Subnormal
-ddrmn440 remaindernear 1E-397 10E-398 -> 0E-398
-ddrmn441 remaindernear 1E-397 11E-398 -> -1E-398 Subnormal
-ddrmn442 remaindernear 100E-397 11E-398 -> -1E-398 Subnormal
-ddrmn443 remaindernear 100E-397 20E-398 -> 0E-398
-ddrmn444 remaindernear 100E-397 21E-398 -> -8E-398 Subnormal
-ddrmn445 remaindernear 100E-397 30E-398 -> 1.0E-397 Subnormal
-
--- zero signs
-ddrmn650 remaindernear 1 1 -> 0
-ddrmn651 remaindernear -1 1 -> -0
-ddrmn652 remaindernear 1 -1 -> 0
-ddrmn653 remaindernear -1 -1 -> -0
-ddrmn654 remaindernear 0 1 -> 0
-ddrmn655 remaindernear -0 1 -> -0
-ddrmn656 remaindernear 0 -1 -> 0
-ddrmn657 remaindernear -0 -1 -> -0
-ddrmn658 remaindernear 0.00 1 -> 0.00
-ddrmn659 remaindernear -0.00 1 -> -0.00
-
--- Specials
-ddrmn680 remaindernear Inf -Inf -> NaN Invalid_operation
-ddrmn681 remaindernear Inf -1000 -> NaN Invalid_operation
-ddrmn682 remaindernear Inf -1 -> NaN Invalid_operation
-ddrmn683 remaindernear Inf 0 -> NaN Invalid_operation
-ddrmn684 remaindernear Inf -0 -> NaN Invalid_operation
-ddrmn685 remaindernear Inf 1 -> NaN Invalid_operation
-ddrmn686 remaindernear Inf 1000 -> NaN Invalid_operation
-ddrmn687 remaindernear Inf Inf -> NaN Invalid_operation
-ddrmn688 remaindernear -1000 Inf -> -1000
-ddrmn689 remaindernear -Inf Inf -> NaN Invalid_operation
-ddrmn691 remaindernear -1 Inf -> -1
-ddrmn692 remaindernear 0 Inf -> 0
-ddrmn693 remaindernear -0 Inf -> -0
-ddrmn694 remaindernear 1 Inf -> 1
-ddrmn695 remaindernear 1000 Inf -> 1000
-ddrmn696 remaindernear Inf Inf -> NaN Invalid_operation
-
-ddrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation
-ddrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation
-ddrmn702 remaindernear -Inf -1 -> NaN Invalid_operation
-ddrmn703 remaindernear -Inf -0 -> NaN Invalid_operation
-ddrmn704 remaindernear -Inf 0 -> NaN Invalid_operation
-ddrmn705 remaindernear -Inf 1 -> NaN Invalid_operation
-ddrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation
-ddrmn707 remaindernear -Inf Inf -> NaN Invalid_operation
-ddrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation
-ddrmn709 remaindernear -1000 Inf -> -1000
-ddrmn710 remaindernear -1 -Inf -> -1
-ddrmn711 remaindernear -0 -Inf -> -0
-ddrmn712 remaindernear 0 -Inf -> 0
-ddrmn713 remaindernear 1 -Inf -> 1
-ddrmn714 remaindernear 1000 -Inf -> 1000
-ddrmn715 remaindernear Inf -Inf -> NaN Invalid_operation
-
-ddrmn721 remaindernear NaN -Inf -> NaN
-ddrmn722 remaindernear NaN -1000 -> NaN
-ddrmn723 remaindernear NaN -1 -> NaN
-ddrmn724 remaindernear NaN -0 -> NaN
-ddrmn725 remaindernear -NaN 0 -> -NaN
-ddrmn726 remaindernear NaN 1 -> NaN
-ddrmn727 remaindernear NaN 1000 -> NaN
-ddrmn728 remaindernear NaN Inf -> NaN
-ddrmn729 remaindernear NaN -NaN -> NaN
-ddrmn730 remaindernear -Inf NaN -> NaN
-ddrmn731 remaindernear -1000 NaN -> NaN
-ddrmn732 remaindernear -1 NaN -> NaN
-ddrmn733 remaindernear -0 -NaN -> -NaN
-ddrmn734 remaindernear 0 NaN -> NaN
-ddrmn735 remaindernear 1 -NaN -> -NaN
-ddrmn736 remaindernear 1000 NaN -> NaN
-ddrmn737 remaindernear Inf NaN -> NaN
-
-ddrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation
-ddrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation
-ddrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation
-ddrmn744 remaindernear sNaN -0 -> NaN Invalid_operation
-ddrmn745 remaindernear sNaN 0 -> NaN Invalid_operation
-ddrmn746 remaindernear sNaN 1 -> NaN Invalid_operation
-ddrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation
-ddrmn749 remaindernear sNaN NaN -> NaN Invalid_operation
-ddrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation
-ddrmn751 remaindernear NaN sNaN -> NaN Invalid_operation
-ddrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation
-ddrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation
-ddrmn754 remaindernear -1 sNaN -> NaN Invalid_operation
-ddrmn755 remaindernear -0 sNaN -> NaN Invalid_operation
-ddrmn756 remaindernear 0 sNaN -> NaN Invalid_operation
-ddrmn757 remaindernear 1 sNaN -> NaN Invalid_operation
-ddrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation
-ddrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation
-
--- propaging NaNs
-ddrmn760 remaindernear NaN1 NaN7 -> NaN1
-ddrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
-ddrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation
-ddrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
-ddrmn764 remaindernear 15 NaN11 -> NaN11
-ddrmn765 remaindernear NaN6 NaN12 -> NaN6
-ddrmn766 remaindernear Inf NaN13 -> NaN13
-ddrmn767 remaindernear NaN14 -Inf -> NaN14
-ddrmn768 remaindernear 0 NaN15 -> NaN15
-ddrmn769 remaindernear NaN16 -0 -> NaN16
-
--- edge cases of impossible
-ddrmn770 remaindernear 1234567890123456 10 -> -4
-ddrmn771 remaindernear 1234567890123456 1 -> 0
-ddrmn772 remaindernear 1234567890123456 0.1 -> NaN Division_impossible
-ddrmn773 remaindernear 1234567890123456 0.01 -> NaN Division_impossible
-
--- long operand checks
-ddrmn801 remaindernear 12345678000 100 -> 0
-ddrmn802 remaindernear 1 12345678000 -> 1
-ddrmn803 remaindernear 1234567800 10 -> 0
-ddrmn804 remaindernear 1 1234567800 -> 1
-ddrmn805 remaindernear 1234567890 10 -> 0
-ddrmn806 remaindernear 1 1234567890 -> 1
-ddrmn807 remaindernear 1234567891 10 -> 1
-ddrmn808 remaindernear 1 1234567891 -> 1
-ddrmn809 remaindernear 12345678901 100 -> 1
-ddrmn810 remaindernear 1 12345678901 -> 1
-ddrmn811 remaindernear 1234567896 10 -> -4
-ddrmn812 remaindernear 1 1234567896 -> 1
-
-ddrmn821 remaindernear 12345678000 100 -> 0
-ddrmn822 remaindernear 1 12345678000 -> 1
-ddrmn823 remaindernear 1234567800 10 -> 0
-ddrmn824 remaindernear 1 1234567800 -> 1
-ddrmn825 remaindernear 1234567890 10 -> 0
-ddrmn826 remaindernear 1 1234567890 -> 1
-ddrmn827 remaindernear 1234567891 10 -> 1
-ddrmn828 remaindernear 1 1234567891 -> 1
-ddrmn829 remaindernear 12345678901 100 -> 1
-ddrmn830 remaindernear 1 12345678901 -> 1
-ddrmn831 remaindernear 1234567896 10 -> -4
-ddrmn832 remaindernear 1 1234567896 -> 1
-
--- from divideint
-ddrmn840 remaindernear 100000000.0 1 -> 0.0
-ddrmn841 remaindernear 100000000.4 1 -> 0.4
-ddrmn842 remaindernear 100000000.5 1 -> 0.5
-ddrmn843 remaindernear 100000000.9 1 -> -0.1
-ddrmn844 remaindernear 100000000.999 1 -> -0.001
-ddrmn850 remaindernear 100000003 5 -> -2
-ddrmn851 remaindernear 10000003 5 -> -2
-ddrmn852 remaindernear 1000003 5 -> -2
-ddrmn853 remaindernear 100003 5 -> -2
-ddrmn854 remaindernear 10003 5 -> -2
-ddrmn855 remaindernear 1003 5 -> -2
-ddrmn856 remaindernear 103 5 -> -2
-ddrmn857 remaindernear 13 5 -> -2
-ddrmn858 remaindernear 1 5 -> 1
-
--- Vladimir's cases 1234567890123456
-ddrmn860 remaindernear 123.0e1 1000000000000000 -> 1230
-ddrmn861 remaindernear 1230 1000000000000000 -> 1230
-ddrmn862 remaindernear 12.3e2 1000000000000000 -> 1230
-ddrmn863 remaindernear 1.23e3 1000000000000000 -> 1230
-ddrmn864 remaindernear 123e1 1000000000000000 -> 1230
-ddrmn870 remaindernear 123e1 1000000000000000 -> 1230
-ddrmn871 remaindernear 123e1 100000000000000 -> 1230
-ddrmn872 remaindernear 123e1 10000000000000 -> 1230
-ddrmn873 remaindernear 123e1 1000000000000 -> 1230
-ddrmn874 remaindernear 123e1 100000000000 -> 1230
-ddrmn875 remaindernear 123e1 10000000000 -> 1230
-ddrmn876 remaindernear 123e1 1000000000 -> 1230
-ddrmn877 remaindernear 123e1 100000000 -> 1230
-ddrmn878 remaindernear 1230 100000000 -> 1230
-ddrmn879 remaindernear 123e1 10000000 -> 1230
-ddrmn880 remaindernear 123e1 1000000 -> 1230
-ddrmn881 remaindernear 123e1 100000 -> 1230
-ddrmn882 remaindernear 123e1 10000 -> 1230
-ddrmn883 remaindernear 123e1 1000 -> 230
-ddrmn884 remaindernear 123e1 100 -> 30
-ddrmn885 remaindernear 123e1 10 -> 0
-ddrmn886 remaindernear 123e1 1 -> 0
-
-ddrmn890 remaindernear 123e1 2000000000000000 -> 1230
-ddrmn891 remaindernear 123e1 200000000000000 -> 1230
-ddrmn892 remaindernear 123e1 20000000000000 -> 1230
-ddrmn893 remaindernear 123e1 2000000000000 -> 1230
-ddrmn894 remaindernear 123e1 200000000000 -> 1230
-ddrmn895 remaindernear 123e1 20000000000 -> 1230
-ddrmn896 remaindernear 123e1 2000000000 -> 1230
-ddrmn897 remaindernear 123e1 200000000 -> 1230
-ddrmn899 remaindernear 123e1 20000000 -> 1230
-ddrmn900 remaindernear 123e1 2000000 -> 1230
-ddrmn901 remaindernear 123e1 200000 -> 1230
-ddrmn902 remaindernear 123e1 20000 -> 1230
-ddrmn903 remaindernear 123e1 2000 -> -770
-ddrmn904 remaindernear 123e1 200 -> 30
-ddrmn905 remaindernear 123e1 20 -> -10
-ddrmn906 remaindernear 123e1 2 -> 0
-
-ddrmn910 remaindernear 123e1 5000000000000000 -> 1230
-ddrmn911 remaindernear 123e1 500000000000000 -> 1230
-ddrmn912 remaindernear 123e1 50000000000000 -> 1230
-ddrmn913 remaindernear 123e1 5000000000000 -> 1230
-ddrmn914 remaindernear 123e1 500000000000 -> 1230
-ddrmn915 remaindernear 123e1 50000000000 -> 1230
-ddrmn916 remaindernear 123e1 5000000000 -> 1230
-ddrmn917 remaindernear 123e1 500000000 -> 1230
-ddrmn919 remaindernear 123e1 50000000 -> 1230
-ddrmn920 remaindernear 123e1 5000000 -> 1230
-ddrmn921 remaindernear 123e1 500000 -> 1230
-ddrmn922 remaindernear 123e1 50000 -> 1230
-ddrmn923 remaindernear 123e1 5000 -> 1230
-ddrmn924 remaindernear 123e1 500 -> 230
-ddrmn925 remaindernear 123e1 50 -> -20
-ddrmn926 remaindernear 123e1 5 -> 0
-
-ddrmn930 remaindernear 123e1 9000000000000000 -> 1230
-ddrmn931 remaindernear 123e1 900000000000000 -> 1230
-ddrmn932 remaindernear 123e1 90000000000000 -> 1230
-ddrmn933 remaindernear 123e1 9000000000000 -> 1230
-ddrmn934 remaindernear 123e1 900000000000 -> 1230
-ddrmn935 remaindernear 123e1 90000000000 -> 1230
-ddrmn936 remaindernear 123e1 9000000000 -> 1230
-ddrmn937 remaindernear 123e1 900000000 -> 1230
-ddrmn939 remaindernear 123e1 90000000 -> 1230
-ddrmn940 remaindernear 123e1 9000000 -> 1230
-ddrmn941 remaindernear 123e1 900000 -> 1230
-ddrmn942 remaindernear 123e1 90000 -> 1230
-ddrmn943 remaindernear 123e1 9000 -> 1230
-ddrmn944 remaindernear 123e1 900 -> 330
-ddrmn945 remaindernear 123e1 90 -> -30
-ddrmn946 remaindernear 123e1 9 -> -3
-
-ddrmn950 remaindernear 123e1 1000000000000000 -> 1230
-ddrmn961 remaindernear 123e1 2999999999999999 -> 1230
-ddrmn962 remaindernear 123e1 3999999999999999 -> 1230
-ddrmn963 remaindernear 123e1 4999999999999999 -> 1230
-ddrmn964 remaindernear 123e1 5999999999999999 -> 1230
-ddrmn965 remaindernear 123e1 6999999999999999 -> 1230
-ddrmn966 remaindernear 123e1 7999999999999999 -> 1230
-ddrmn967 remaindernear 123e1 8999999999999999 -> 1230
-ddrmn968 remaindernear 123e1 9999999999999999 -> 1230
-ddrmn969 remaindernear 123e1 9876543210987654 -> 1230
-
-ddrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
-
-
--- overflow and underflow tests [from divide]
-ddrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible
-ddrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible
-ddrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible
-ddrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible
-ddrmn1055 remaindernear 1e-277 1e+311 -> 1E-277
-ddrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277
-ddrmn1057 remaindernear -1e-277 1e+311 -> -1E-277
-ddrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
-
--- destructive subtract
-ddrmn1100 remainderNear 1234567890123456 1.000000000000001 -> -0.234567890123455
-ddrmn1101 remainderNear 1234567890123456 1.00000000000001 -> -0.34567890123444
-ddrmn1102 remainderNear 1234567890123456 1.0000000000001 -> -0.4567890123333
-ddrmn1103 remainderNear 1234567890123455 4.000000000000001 -> -1.308641972530864
-ddrmn1104 remainderNear 1234567890123456 4.000000000000001 -> -0.308641972530864
-ddrmn1115 remainderNear 1234567890123456 4.9999999999999 -> 0.6913578024696
-ddrmn1116 remainderNear 1234567890123456 4.99999999999999 -> -1.53086421975308
-ddrmn1117 remainderNear 1234567890123456 4.999999999999999 -> 1.246913578024691
-ddrmn1118 remainderNear 1234567890123456 5.000000000000001 -> 0.753086421975309
-ddrmn1119 remainderNear 1234567890123456 5.00000000000001 -> -1.46913578024691
-ddrmn1110 remainderNear 1234567890123456 5.0000000000001 -> 1.3086421975314
-
--- Null tests
-ddrmn1000 remaindernear 10 # -> NaN Invalid_operation
-ddrmn1001 remaindernear # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- ddRemainderNear.decTest -- decDouble remainder-near --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- sanity checks (as base, above)
+ddrmn001 remaindernear 1 1 -> 0
+ddrmn002 remaindernear 2 1 -> 0
+ddrmn003 remaindernear 1 2 -> 1
+ddrmn004 remaindernear 2 2 -> 0
+ddrmn005 remaindernear 0 1 -> 0
+ddrmn006 remaindernear 0 2 -> 0
+ddrmn007 remaindernear 1 3 -> 1
+ddrmn008 remaindernear 2 3 -> -1
+ddrmn009 remaindernear 3 3 -> 0
+
+ddrmn010 remaindernear 2.4 1 -> 0.4
+ddrmn011 remaindernear 2.4 -1 -> 0.4
+ddrmn012 remaindernear -2.4 1 -> -0.4
+ddrmn013 remaindernear -2.4 -1 -> -0.4
+ddrmn014 remaindernear 2.40 1 -> 0.40
+ddrmn015 remaindernear 2.400 1 -> 0.400
+ddrmn016 remaindernear 2.4 2 -> 0.4
+ddrmn017 remaindernear 2.400 2 -> 0.400
+ddrmn018 remaindernear 2. 2 -> 0
+ddrmn019 remaindernear 20 20 -> 0
+
+ddrmn020 remaindernear 187 187 -> 0
+ddrmn021 remaindernear 5 2 -> 1
+ddrmn022 remaindernear 5 2.0 -> 1.0
+ddrmn023 remaindernear 5 2.000 -> 1.000
+ddrmn024 remaindernear 5 0.200 -> 0.000
+ddrmn025 remaindernear 5 0.200 -> 0.000
+
+ddrmn030 remaindernear 1 2 -> 1
+ddrmn031 remaindernear 1 4 -> 1
+ddrmn032 remaindernear 1 8 -> 1
+
+ddrmn033 remaindernear 1 16 -> 1
+ddrmn034 remaindernear 1 32 -> 1
+ddrmn035 remaindernear 1 64 -> 1
+ddrmn040 remaindernear 1 -2 -> 1
+ddrmn041 remaindernear 1 -4 -> 1
+ddrmn042 remaindernear 1 -8 -> 1
+ddrmn043 remaindernear 1 -16 -> 1
+ddrmn044 remaindernear 1 -32 -> 1
+ddrmn045 remaindernear 1 -64 -> 1
+ddrmn050 remaindernear -1 2 -> -1
+ddrmn051 remaindernear -1 4 -> -1
+ddrmn052 remaindernear -1 8 -> -1
+ddrmn053 remaindernear -1 16 -> -1
+ddrmn054 remaindernear -1 32 -> -1
+ddrmn055 remaindernear -1 64 -> -1
+ddrmn060 remaindernear -1 -2 -> -1
+ddrmn061 remaindernear -1 -4 -> -1
+ddrmn062 remaindernear -1 -8 -> -1
+ddrmn063 remaindernear -1 -16 -> -1
+ddrmn064 remaindernear -1 -32 -> -1
+ddrmn065 remaindernear -1 -64 -> -1
+
+ddrmn066 remaindernear 9.9 1 -> -0.1
+ddrmn067 remaindernear 99.7 1 -> -0.3
+ddrmn068 remaindernear 999999999 1 -> 0
+ddrmn069 remaindernear 999999999.4 1 -> 0.4
+ddrmn070 remaindernear 999999999.5 1 -> -0.5
+ddrmn071 remaindernear 999999999.9 1 -> -0.1
+ddrmn072 remaindernear 999999999.999 1 -> -0.001
+ddrmn073 remaindernear 999999.999999 1 -> -0.000001
+ddrmn074 remaindernear 9 1 -> 0
+ddrmn075 remaindernear 9999999999999999 1 -> 0
+ddrmn076 remaindernear 9999999999999999 2 -> -1
+ddrmn077 remaindernear 9999999999999999 3 -> 0
+ddrmn078 remaindernear 9999999999999999 4 -> -1
+
+ddrmn080 remaindernear 0. 1 -> 0
+ddrmn081 remaindernear .0 1 -> 0.0
+ddrmn082 remaindernear 0.00 1 -> 0.00
+ddrmn083 remaindernear 0.00E+9 1 -> 0
+ddrmn084 remaindernear 0.00E+3 1 -> 0
+ddrmn085 remaindernear 0.00E+2 1 -> 0
+ddrmn086 remaindernear 0.00E+1 1 -> 0.0
+ddrmn087 remaindernear 0.00E+0 1 -> 0.00
+ddrmn088 remaindernear 0.00E-0 1 -> 0.00
+ddrmn089 remaindernear 0.00E-1 1 -> 0.000
+ddrmn090 remaindernear 0.00E-2 1 -> 0.0000
+ddrmn091 remaindernear 0.00E-3 1 -> 0.00000
+ddrmn092 remaindernear 0.00E-4 1 -> 0.000000
+ddrmn093 remaindernear 0.00E-5 1 -> 0E-7
+ddrmn094 remaindernear 0.00E-6 1 -> 0E-8
+ddrmn095 remaindernear 0.0000E-50 1 -> 0E-54
+
+-- Various flavours of remaindernear by 0
+ddrmn101 remaindernear 0 0 -> NaN Division_undefined
+ddrmn102 remaindernear 0 -0 -> NaN Division_undefined
+ddrmn103 remaindernear -0 0 -> NaN Division_undefined
+ddrmn104 remaindernear -0 -0 -> NaN Division_undefined
+ddrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined
+ddrmn106 remaindernear 0.000 0 -> NaN Division_undefined
+-- [Some think this next group should be Division_by_zero exception, but
+-- IEEE 854 is explicit that it is Invalid operation .. for
+-- remainder-near, anyway]
+ddrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation
+ddrmn108 remaindernear 0.01 0 -> NaN Invalid_operation
+ddrmn109 remaindernear 0.1 0 -> NaN Invalid_operation
+ddrmn110 remaindernear 1 0 -> NaN Invalid_operation
+ddrmn111 remaindernear 1 0.0 -> NaN Invalid_operation
+ddrmn112 remaindernear 10 0.0 -> NaN Invalid_operation
+ddrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation
+ddrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation
+ddrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation
+ddrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation
+ddrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation
+ddrmn120 remaindernear 1 -0 -> NaN Invalid_operation
+ddrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation
+ddrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation
+ddrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation
+ddrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation
+-- and zeros on left
+ddrmn130 remaindernear 0 1 -> 0
+ddrmn131 remaindernear 0 -1 -> 0
+ddrmn132 remaindernear 0.0 1 -> 0.0
+ddrmn133 remaindernear 0.0 -1 -> 0.0
+ddrmn134 remaindernear -0 1 -> -0
+ddrmn135 remaindernear -0 -1 -> -0
+ddrmn136 remaindernear -0.0 1 -> -0.0
+ddrmn137 remaindernear -0.0 -1 -> -0.0
+
+-- 0.5ers
+ddrmn143 remaindernear 0.5 2 -> 0.5
+ddrmn144 remaindernear 0.5 2.1 -> 0.5
+ddrmn145 remaindernear 0.5 2.01 -> 0.50
+ddrmn146 remaindernear 0.5 2.001 -> 0.500
+ddrmn147 remaindernear 0.50 2 -> 0.50
+ddrmn148 remaindernear 0.50 2.01 -> 0.50
+ddrmn149 remaindernear 0.50 2.001 -> 0.500
+
+-- steadies
+ddrmn150 remaindernear 1 1 -> 0
+ddrmn151 remaindernear 1 2 -> 1
+ddrmn152 remaindernear 1 3 -> 1
+ddrmn153 remaindernear 1 4 -> 1
+ddrmn154 remaindernear 1 5 -> 1
+ddrmn155 remaindernear 1 6 -> 1
+ddrmn156 remaindernear 1 7 -> 1
+ddrmn157 remaindernear 1 8 -> 1
+ddrmn158 remaindernear 1 9 -> 1
+ddrmn159 remaindernear 1 10 -> 1
+ddrmn160 remaindernear 1 1 -> 0
+ddrmn161 remaindernear 2 1 -> 0
+ddrmn162 remaindernear 3 1 -> 0
+ddrmn163 remaindernear 4 1 -> 0
+ddrmn164 remaindernear 5 1 -> 0
+ddrmn165 remaindernear 6 1 -> 0
+ddrmn166 remaindernear 7 1 -> 0
+ddrmn167 remaindernear 8 1 -> 0
+ddrmn168 remaindernear 9 1 -> 0
+ddrmn169 remaindernear 10 1 -> 0
+
+-- some differences from remainder
+ddrmn171 remaindernear 0.4 1.020 -> 0.400
+ddrmn172 remaindernear 0.50 1.020 -> 0.500
+ddrmn173 remaindernear 0.51 1.020 -> 0.510
+ddrmn174 remaindernear 0.52 1.020 -> -0.500
+ddrmn175 remaindernear 0.6 1.020 -> -0.420
+
+-- More flavours of remaindernear by 0
+ddrmn201 remaindernear 0 0 -> NaN Division_undefined
+ddrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined
+ddrmn203 remaindernear 0.000 0 -> NaN Division_undefined
+ddrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation
+ddrmn205 remaindernear 0.01 0 -> NaN Invalid_operation
+ddrmn206 remaindernear 0.1 0 -> NaN Invalid_operation
+ddrmn207 remaindernear 1 0 -> NaN Invalid_operation
+ddrmn208 remaindernear 1 0.0 -> NaN Invalid_operation
+ddrmn209 remaindernear 10 0.0 -> NaN Invalid_operation
+ddrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation
+ddrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation
+
+-- tests from the extended specification
+ddrmn221 remaindernear 2.1 3 -> -0.9
+ddrmn222 remaindernear 10 6 -> -2
+ddrmn223 remaindernear 10 3 -> 1
+ddrmn224 remaindernear -10 3 -> -1
+ddrmn225 remaindernear 10.2 1 -> 0.2
+ddrmn226 remaindernear 10 0.3 -> 0.1
+ddrmn227 remaindernear 3.6 1.3 -> -0.3
+
+-- some differences from remainder
+ddrmn231 remaindernear -0.4 1.020 -> -0.400
+ddrmn232 remaindernear -0.50 1.020 -> -0.500
+ddrmn233 remaindernear -0.51 1.020 -> -0.510
+ddrmn234 remaindernear -0.52 1.020 -> 0.500
+ddrmn235 remaindernear -0.6 1.020 -> 0.420
+
+-- high Xs
+ddrmn240 remaindernear 1E+2 1.00 -> 0.00
+
+-- ddrmn3xx are from DiagBigDecimal
+ddrmn301 remaindernear 1 3 -> 1
+ddrmn302 remaindernear 5 5 -> 0
+ddrmn303 remaindernear 13 10 -> 3
+ddrmn304 remaindernear 13 50 -> 13
+ddrmn305 remaindernear 13 100 -> 13
+ddrmn306 remaindernear 13 1000 -> 13
+ddrmn307 remaindernear .13 1 -> 0.13
+ddrmn308 remaindernear 0.133 1 -> 0.133
+ddrmn309 remaindernear 0.1033 1 -> 0.1033
+ddrmn310 remaindernear 1.033 1 -> 0.033
+ddrmn311 remaindernear 10.33 1 -> 0.33
+ddrmn312 remaindernear 10.33 10 -> 0.33
+ddrmn313 remaindernear 103.3 1 -> 0.3
+ddrmn314 remaindernear 133 10 -> 3
+ddrmn315 remaindernear 1033 10 -> 3
+ddrmn316 remaindernear 1033 50 -> -17
+ddrmn317 remaindernear 101.0 3 -> -1.0
+ddrmn318 remaindernear 102.0 3 -> 0.0
+ddrmn319 remaindernear 103.0 3 -> 1.0
+ddrmn320 remaindernear 2.40 1 -> 0.40
+ddrmn321 remaindernear 2.400 1 -> 0.400
+ddrmn322 remaindernear 2.4 1 -> 0.4
+ddrmn323 remaindernear 2.4 2 -> 0.4
+ddrmn324 remaindernear 2.400 2 -> 0.400
+ddrmn325 remaindernear 1 0.3 -> 0.1
+ddrmn326 remaindernear 1 0.30 -> 0.10
+ddrmn327 remaindernear 1 0.300 -> 0.100
+ddrmn328 remaindernear 1 0.3000 -> 0.1000
+ddrmn329 remaindernear 1.0 0.3 -> 0.1
+ddrmn330 remaindernear 1.00 0.3 -> 0.10
+ddrmn331 remaindernear 1.000 0.3 -> 0.100
+ddrmn332 remaindernear 1.0000 0.3 -> 0.1000
+ddrmn333 remaindernear 0.5 2 -> 0.5
+ddrmn334 remaindernear 0.5 2.1 -> 0.5
+ddrmn335 remaindernear 0.5 2.01 -> 0.50
+ddrmn336 remaindernear 0.5 2.001 -> 0.500
+ddrmn337 remaindernear 0.50 2 -> 0.50
+ddrmn338 remaindernear 0.50 2.01 -> 0.50
+ddrmn339 remaindernear 0.50 2.001 -> 0.500
+
+ddrmn340 remaindernear 0.5 0.5000001 -> -1E-7
+ddrmn341 remaindernear 0.5 0.50000001 -> -1E-8
+ddrmn342 remaindernear 0.5 0.500000001 -> -1E-9
+ddrmn343 remaindernear 0.5 0.5000000001 -> -1E-10
+ddrmn344 remaindernear 0.5 0.50000000001 -> -1E-11
+ddrmn345 remaindernear 0.5 0.4999999 -> 1E-7
+ddrmn346 remaindernear 0.5 0.49999999 -> 1E-8
+ddrmn347 remaindernear 0.5 0.499999999 -> 1E-9
+ddrmn348 remaindernear 0.5 0.4999999999 -> 1E-10
+ddrmn349 remaindernear 0.5 0.49999999999 -> 1E-11
+ddrmn350 remaindernear 0.5 0.499999999999 -> 1E-12
+
+ddrmn351 remaindernear 0.03 7 -> 0.03
+ddrmn352 remaindernear 5 2 -> 1
+ddrmn353 remaindernear 4.1 2 -> 0.1
+ddrmn354 remaindernear 4.01 2 -> 0.01
+ddrmn355 remaindernear 4.001 2 -> 0.001
+ddrmn356 remaindernear 4.0001 2 -> 0.0001
+ddrmn357 remaindernear 4.00001 2 -> 0.00001
+ddrmn358 remaindernear 4.000001 2 -> 0.000001
+ddrmn359 remaindernear 4.0000001 2 -> 1E-7
+
+ddrmn360 remaindernear 1.2 0.7345 -> -0.2690
+ddrmn361 remaindernear 0.8 12 -> 0.8
+ddrmn362 remaindernear 0.8 0.2 -> 0.0
+ddrmn363 remaindernear 0.8 0.3 -> -0.1
+ddrmn364 remaindernear 0.800 12 -> 0.800
+ddrmn365 remaindernear 0.800 1.7 -> 0.800
+ddrmn366 remaindernear 2.400 2 -> 0.400
+
+-- round to even
+ddrmn371 remaindernear 121 2 -> 1
+ddrmn372 remaindernear 122 2 -> 0
+ddrmn373 remaindernear 123 2 -> -1
+ddrmn374 remaindernear 124 2 -> 0
+ddrmn375 remaindernear 125 2 -> 1
+ddrmn376 remaindernear 126 2 -> 0
+ddrmn377 remaindernear 127 2 -> -1
+
+ddrmn381 remaindernear 12345 1 -> 0
+ddrmn382 remaindernear 12345 1.0001 -> -0.2344
+ddrmn383 remaindernear 12345 1.001 -> -0.333
+ddrmn384 remaindernear 12345 1.01 -> -0.23
+ddrmn385 remaindernear 12345 1.1 -> -0.3
+ddrmn386 remaindernear 12355 4 -> -1
+ddrmn387 remaindernear 12345 4 -> 1
+ddrmn388 remaindernear 12355 4.0001 -> -1.3089
+ddrmn389 remaindernear 12345 4.0001 -> 0.6914
+ddrmn390 remaindernear 12345 4.9 -> 1.9
+ddrmn391 remaindernear 12345 4.99 -> -0.26
+ddrmn392 remaindernear 12345 4.999 -> 2.469
+ddrmn393 remaindernear 12345 4.9999 -> 0.2469
+ddrmn394 remaindernear 12345 5 -> 0
+ddrmn395 remaindernear 12345 5.0001 -> -0.2469
+ddrmn396 remaindernear 12345 5.001 -> -2.469
+ddrmn397 remaindernear 12345 5.01 -> 0.36
+ddrmn398 remaindernear 12345 5.1 -> -2.1
+
+-- the nasty division-by-1 cases
+ddrmn401 remaindernear 0.4 1 -> 0.4
+ddrmn402 remaindernear 0.45 1 -> 0.45
+ddrmn403 remaindernear 0.455 1 -> 0.455
+ddrmn404 remaindernear 0.4555 1 -> 0.4555
+ddrmn405 remaindernear 0.45555 1 -> 0.45555
+ddrmn406 remaindernear 0.455555 1 -> 0.455555
+ddrmn407 remaindernear 0.4555555 1 -> 0.4555555
+ddrmn408 remaindernear 0.45555555 1 -> 0.45555555
+ddrmn409 remaindernear 0.455555555 1 -> 0.455555555
+-- with spill... [412 exercises sticktab loop]
+ddrmn411 remaindernear 0.5 1 -> 0.5
+ddrmn412 remaindernear 0.55 1 -> -0.45
+ddrmn413 remaindernear 0.555 1 -> -0.445
+ddrmn414 remaindernear 0.5555 1 -> -0.4445
+ddrmn415 remaindernear 0.55555 1 -> -0.44445
+ddrmn416 remaindernear 0.555555 1 -> -0.444445
+ddrmn417 remaindernear 0.5555555 1 -> -0.4444445
+ddrmn418 remaindernear 0.55555555 1 -> -0.44444445
+ddrmn419 remaindernear 0.555555555 1 -> -0.444444445
+
+-- folddowns
+ddrmn421 remaindernear 1E+384 1 -> NaN Division_impossible
+ddrmn422 remaindernear 1E+384 1E+383 -> 0E+369 Clamped
+ddrmn423 remaindernear 1E+384 2E+383 -> 0E+369 Clamped
+ddrmn424 remaindernear 1E+384 3E+383 -> 1.00000000000000E+383 Clamped
+ddrmn425 remaindernear 1E+384 4E+383 -> 2.00000000000000E+383 Clamped
+ddrmn426 remaindernear 1E+384 5E+383 -> 0E+369 Clamped
+ddrmn427 remaindernear 1E+384 6E+383 -> -2.00000000000000E+383 Clamped
+ddrmn428 remaindernear 1E+384 7E+383 -> 3.00000000000000E+383 Clamped
+ddrmn429 remaindernear 1E+384 8E+383 -> 2.00000000000000E+383 Clamped
+ddrmn430 remaindernear 1E+384 9E+383 -> 1.00000000000000E+383 Clamped
+-- tinies
+ddrmn431 remaindernear 1E-397 1E-398 -> 0E-398
+ddrmn432 remaindernear 1E-397 2E-398 -> 0E-398
+ddrmn433 remaindernear 1E-397 3E-398 -> 1E-398 Subnormal
+ddrmn434 remaindernear 1E-397 4E-398 -> 2E-398 Subnormal
+ddrmn435 remaindernear 1E-397 5E-398 -> 0E-398
+ddrmn436 remaindernear 1E-397 6E-398 -> -2E-398 Subnormal
+ddrmn437 remaindernear 1E-397 7E-398 -> 3E-398 Subnormal
+ddrmn438 remaindernear 1E-397 8E-398 -> 2E-398 Subnormal
+ddrmn439 remaindernear 1E-397 9E-398 -> 1E-398 Subnormal
+ddrmn440 remaindernear 1E-397 10E-398 -> 0E-398
+ddrmn441 remaindernear 1E-397 11E-398 -> -1E-398 Subnormal
+ddrmn442 remaindernear 100E-397 11E-398 -> -1E-398 Subnormal
+ddrmn443 remaindernear 100E-397 20E-398 -> 0E-398
+ddrmn444 remaindernear 100E-397 21E-398 -> -8E-398 Subnormal
+ddrmn445 remaindernear 100E-397 30E-398 -> 1.0E-397 Subnormal
+
+-- zero signs
+ddrmn650 remaindernear 1 1 -> 0
+ddrmn651 remaindernear -1 1 -> -0
+ddrmn652 remaindernear 1 -1 -> 0
+ddrmn653 remaindernear -1 -1 -> -0
+ddrmn654 remaindernear 0 1 -> 0
+ddrmn655 remaindernear -0 1 -> -0
+ddrmn656 remaindernear 0 -1 -> 0
+ddrmn657 remaindernear -0 -1 -> -0
+ddrmn658 remaindernear 0.00 1 -> 0.00
+ddrmn659 remaindernear -0.00 1 -> -0.00
+
+-- Specials
+ddrmn680 remaindernear Inf -Inf -> NaN Invalid_operation
+ddrmn681 remaindernear Inf -1000 -> NaN Invalid_operation
+ddrmn682 remaindernear Inf -1 -> NaN Invalid_operation
+ddrmn683 remaindernear Inf 0 -> NaN Invalid_operation
+ddrmn684 remaindernear Inf -0 -> NaN Invalid_operation
+ddrmn685 remaindernear Inf 1 -> NaN Invalid_operation
+ddrmn686 remaindernear Inf 1000 -> NaN Invalid_operation
+ddrmn687 remaindernear Inf Inf -> NaN Invalid_operation
+ddrmn688 remaindernear -1000 Inf -> -1000
+ddrmn689 remaindernear -Inf Inf -> NaN Invalid_operation
+ddrmn691 remaindernear -1 Inf -> -1
+ddrmn692 remaindernear 0 Inf -> 0
+ddrmn693 remaindernear -0 Inf -> -0
+ddrmn694 remaindernear 1 Inf -> 1
+ddrmn695 remaindernear 1000 Inf -> 1000
+ddrmn696 remaindernear Inf Inf -> NaN Invalid_operation
+
+ddrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation
+ddrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation
+ddrmn702 remaindernear -Inf -1 -> NaN Invalid_operation
+ddrmn703 remaindernear -Inf -0 -> NaN Invalid_operation
+ddrmn704 remaindernear -Inf 0 -> NaN Invalid_operation
+ddrmn705 remaindernear -Inf 1 -> NaN Invalid_operation
+ddrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation
+ddrmn707 remaindernear -Inf Inf -> NaN Invalid_operation
+ddrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation
+ddrmn709 remaindernear -1000 Inf -> -1000
+ddrmn710 remaindernear -1 -Inf -> -1
+ddrmn711 remaindernear -0 -Inf -> -0
+ddrmn712 remaindernear 0 -Inf -> 0
+ddrmn713 remaindernear 1 -Inf -> 1
+ddrmn714 remaindernear 1000 -Inf -> 1000
+ddrmn715 remaindernear Inf -Inf -> NaN Invalid_operation
+
+ddrmn721 remaindernear NaN -Inf -> NaN
+ddrmn722 remaindernear NaN -1000 -> NaN
+ddrmn723 remaindernear NaN -1 -> NaN
+ddrmn724 remaindernear NaN -0 -> NaN
+ddrmn725 remaindernear -NaN 0 -> -NaN
+ddrmn726 remaindernear NaN 1 -> NaN
+ddrmn727 remaindernear NaN 1000 -> NaN
+ddrmn728 remaindernear NaN Inf -> NaN
+ddrmn729 remaindernear NaN -NaN -> NaN
+ddrmn730 remaindernear -Inf NaN -> NaN
+ddrmn731 remaindernear -1000 NaN -> NaN
+ddrmn732 remaindernear -1 NaN -> NaN
+ddrmn733 remaindernear -0 -NaN -> -NaN
+ddrmn734 remaindernear 0 NaN -> NaN
+ddrmn735 remaindernear 1 -NaN -> -NaN
+ddrmn736 remaindernear 1000 NaN -> NaN
+ddrmn737 remaindernear Inf NaN -> NaN
+
+ddrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation
+ddrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation
+ddrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation
+ddrmn744 remaindernear sNaN -0 -> NaN Invalid_operation
+ddrmn745 remaindernear sNaN 0 -> NaN Invalid_operation
+ddrmn746 remaindernear sNaN 1 -> NaN Invalid_operation
+ddrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation
+ddrmn749 remaindernear sNaN NaN -> NaN Invalid_operation
+ddrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation
+ddrmn751 remaindernear NaN sNaN -> NaN Invalid_operation
+ddrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation
+ddrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation
+ddrmn754 remaindernear -1 sNaN -> NaN Invalid_operation
+ddrmn755 remaindernear -0 sNaN -> NaN Invalid_operation
+ddrmn756 remaindernear 0 sNaN -> NaN Invalid_operation
+ddrmn757 remaindernear 1 sNaN -> NaN Invalid_operation
+ddrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation
+ddrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation
+
+-- propaging NaNs
+ddrmn760 remaindernear NaN1 NaN7 -> NaN1
+ddrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
+ddrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation
+ddrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
+ddrmn764 remaindernear 15 NaN11 -> NaN11
+ddrmn765 remaindernear NaN6 NaN12 -> NaN6
+ddrmn766 remaindernear Inf NaN13 -> NaN13
+ddrmn767 remaindernear NaN14 -Inf -> NaN14
+ddrmn768 remaindernear 0 NaN15 -> NaN15
+ddrmn769 remaindernear NaN16 -0 -> NaN16
+
+-- edge cases of impossible
+ddrmn770 remaindernear 1234567890123456 10 -> -4
+ddrmn771 remaindernear 1234567890123456 1 -> 0
+ddrmn772 remaindernear 1234567890123456 0.1 -> NaN Division_impossible
+ddrmn773 remaindernear 1234567890123456 0.01 -> NaN Division_impossible
+
+-- long operand checks
+ddrmn801 remaindernear 12345678000 100 -> 0
+ddrmn802 remaindernear 1 12345678000 -> 1
+ddrmn803 remaindernear 1234567800 10 -> 0
+ddrmn804 remaindernear 1 1234567800 -> 1
+ddrmn805 remaindernear 1234567890 10 -> 0
+ddrmn806 remaindernear 1 1234567890 -> 1
+ddrmn807 remaindernear 1234567891 10 -> 1
+ddrmn808 remaindernear 1 1234567891 -> 1
+ddrmn809 remaindernear 12345678901 100 -> 1
+ddrmn810 remaindernear 1 12345678901 -> 1
+ddrmn811 remaindernear 1234567896 10 -> -4
+ddrmn812 remaindernear 1 1234567896 -> 1
+
+ddrmn821 remaindernear 12345678000 100 -> 0
+ddrmn822 remaindernear 1 12345678000 -> 1
+ddrmn823 remaindernear 1234567800 10 -> 0
+ddrmn824 remaindernear 1 1234567800 -> 1
+ddrmn825 remaindernear 1234567890 10 -> 0
+ddrmn826 remaindernear 1 1234567890 -> 1
+ddrmn827 remaindernear 1234567891 10 -> 1
+ddrmn828 remaindernear 1 1234567891 -> 1
+ddrmn829 remaindernear 12345678901 100 -> 1
+ddrmn830 remaindernear 1 12345678901 -> 1
+ddrmn831 remaindernear 1234567896 10 -> -4
+ddrmn832 remaindernear 1 1234567896 -> 1
+
+-- from divideint
+ddrmn840 remaindernear 100000000.0 1 -> 0.0
+ddrmn841 remaindernear 100000000.4 1 -> 0.4
+ddrmn842 remaindernear 100000000.5 1 -> 0.5
+ddrmn843 remaindernear 100000000.9 1 -> -0.1
+ddrmn844 remaindernear 100000000.999 1 -> -0.001
+ddrmn850 remaindernear 100000003 5 -> -2
+ddrmn851 remaindernear 10000003 5 -> -2
+ddrmn852 remaindernear 1000003 5 -> -2
+ddrmn853 remaindernear 100003 5 -> -2
+ddrmn854 remaindernear 10003 5 -> -2
+ddrmn855 remaindernear 1003 5 -> -2
+ddrmn856 remaindernear 103 5 -> -2
+ddrmn857 remaindernear 13 5 -> -2
+ddrmn858 remaindernear 1 5 -> 1
+
+-- Vladimir's cases 1234567890123456
+ddrmn860 remaindernear 123.0e1 1000000000000000 -> 1230
+ddrmn861 remaindernear 1230 1000000000000000 -> 1230
+ddrmn862 remaindernear 12.3e2 1000000000000000 -> 1230
+ddrmn863 remaindernear 1.23e3 1000000000000000 -> 1230
+ddrmn864 remaindernear 123e1 1000000000000000 -> 1230
+ddrmn870 remaindernear 123e1 1000000000000000 -> 1230
+ddrmn871 remaindernear 123e1 100000000000000 -> 1230
+ddrmn872 remaindernear 123e1 10000000000000 -> 1230
+ddrmn873 remaindernear 123e1 1000000000000 -> 1230
+ddrmn874 remaindernear 123e1 100000000000 -> 1230
+ddrmn875 remaindernear 123e1 10000000000 -> 1230
+ddrmn876 remaindernear 123e1 1000000000 -> 1230
+ddrmn877 remaindernear 123e1 100000000 -> 1230
+ddrmn878 remaindernear 1230 100000000 -> 1230
+ddrmn879 remaindernear 123e1 10000000 -> 1230
+ddrmn880 remaindernear 123e1 1000000 -> 1230
+ddrmn881 remaindernear 123e1 100000 -> 1230
+ddrmn882 remaindernear 123e1 10000 -> 1230
+ddrmn883 remaindernear 123e1 1000 -> 230
+ddrmn884 remaindernear 123e1 100 -> 30
+ddrmn885 remaindernear 123e1 10 -> 0
+ddrmn886 remaindernear 123e1 1 -> 0
+
+ddrmn890 remaindernear 123e1 2000000000000000 -> 1230
+ddrmn891 remaindernear 123e1 200000000000000 -> 1230
+ddrmn892 remaindernear 123e1 20000000000000 -> 1230
+ddrmn893 remaindernear 123e1 2000000000000 -> 1230
+ddrmn894 remaindernear 123e1 200000000000 -> 1230
+ddrmn895 remaindernear 123e1 20000000000 -> 1230
+ddrmn896 remaindernear 123e1 2000000000 -> 1230
+ddrmn897 remaindernear 123e1 200000000 -> 1230
+ddrmn899 remaindernear 123e1 20000000 -> 1230
+ddrmn900 remaindernear 123e1 2000000 -> 1230
+ddrmn901 remaindernear 123e1 200000 -> 1230
+ddrmn902 remaindernear 123e1 20000 -> 1230
+ddrmn903 remaindernear 123e1 2000 -> -770
+ddrmn904 remaindernear 123e1 200 -> 30
+ddrmn905 remaindernear 123e1 20 -> -10
+ddrmn906 remaindernear 123e1 2 -> 0
+
+ddrmn910 remaindernear 123e1 5000000000000000 -> 1230
+ddrmn911 remaindernear 123e1 500000000000000 -> 1230
+ddrmn912 remaindernear 123e1 50000000000000 -> 1230
+ddrmn913 remaindernear 123e1 5000000000000 -> 1230
+ddrmn914 remaindernear 123e1 500000000000 -> 1230
+ddrmn915 remaindernear 123e1 50000000000 -> 1230
+ddrmn916 remaindernear 123e1 5000000000 -> 1230
+ddrmn917 remaindernear 123e1 500000000 -> 1230
+ddrmn919 remaindernear 123e1 50000000 -> 1230
+ddrmn920 remaindernear 123e1 5000000 -> 1230
+ddrmn921 remaindernear 123e1 500000 -> 1230
+ddrmn922 remaindernear 123e1 50000 -> 1230
+ddrmn923 remaindernear 123e1 5000 -> 1230
+ddrmn924 remaindernear 123e1 500 -> 230
+ddrmn925 remaindernear 123e1 50 -> -20
+ddrmn926 remaindernear 123e1 5 -> 0
+
+ddrmn930 remaindernear 123e1 9000000000000000 -> 1230
+ddrmn931 remaindernear 123e1 900000000000000 -> 1230
+ddrmn932 remaindernear 123e1 90000000000000 -> 1230
+ddrmn933 remaindernear 123e1 9000000000000 -> 1230
+ddrmn934 remaindernear 123e1 900000000000 -> 1230
+ddrmn935 remaindernear 123e1 90000000000 -> 1230
+ddrmn936 remaindernear 123e1 9000000000 -> 1230
+ddrmn937 remaindernear 123e1 900000000 -> 1230
+ddrmn939 remaindernear 123e1 90000000 -> 1230
+ddrmn940 remaindernear 123e1 9000000 -> 1230
+ddrmn941 remaindernear 123e1 900000 -> 1230
+ddrmn942 remaindernear 123e1 90000 -> 1230
+ddrmn943 remaindernear 123e1 9000 -> 1230
+ddrmn944 remaindernear 123e1 900 -> 330
+ddrmn945 remaindernear 123e1 90 -> -30
+ddrmn946 remaindernear 123e1 9 -> -3
+
+ddrmn950 remaindernear 123e1 1000000000000000 -> 1230
+ddrmn961 remaindernear 123e1 2999999999999999 -> 1230
+ddrmn962 remaindernear 123e1 3999999999999999 -> 1230
+ddrmn963 remaindernear 123e1 4999999999999999 -> 1230
+ddrmn964 remaindernear 123e1 5999999999999999 -> 1230
+ddrmn965 remaindernear 123e1 6999999999999999 -> 1230
+ddrmn966 remaindernear 123e1 7999999999999999 -> 1230
+ddrmn967 remaindernear 123e1 8999999999999999 -> 1230
+ddrmn968 remaindernear 123e1 9999999999999999 -> 1230
+ddrmn969 remaindernear 123e1 9876543210987654 -> 1230
+
+ddrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
+
+
+-- overflow and underflow tests [from divide]
+ddrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible
+ddrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible
+ddrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible
+ddrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible
+ddrmn1055 remaindernear 1e-277 1e+311 -> 1E-277
+ddrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277
+ddrmn1057 remaindernear -1e-277 1e+311 -> -1E-277
+ddrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
+
+-- destructive subtract
+ddrmn1100 remainderNear 1234567890123456 1.000000000000001 -> -0.234567890123455
+ddrmn1101 remainderNear 1234567890123456 1.00000000000001 -> -0.34567890123444
+ddrmn1102 remainderNear 1234567890123456 1.0000000000001 -> -0.4567890123333
+ddrmn1103 remainderNear 1234567890123455 4.000000000000001 -> -1.308641972530864
+ddrmn1104 remainderNear 1234567890123456 4.000000000000001 -> -0.308641972530864
+ddrmn1115 remainderNear 1234567890123456 4.9999999999999 -> 0.6913578024696
+ddrmn1116 remainderNear 1234567890123456 4.99999999999999 -> -1.53086421975308
+ddrmn1117 remainderNear 1234567890123456 4.999999999999999 -> 1.246913578024691
+ddrmn1118 remainderNear 1234567890123456 5.000000000000001 -> 0.753086421975309
+ddrmn1119 remainderNear 1234567890123456 5.00000000000001 -> -1.46913578024691
+ddrmn1110 remainderNear 1234567890123456 5.0000000000001 -> 1.3086421975314
+
+-- Null tests
+ddrmn1000 remaindernear 10 # -> NaN Invalid_operation
+ddrmn1001 remaindernear # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/ddRotate.decTest b/Lib/test/decimaltestdata/ddRotate.decTest
index 87eeb1c0f1..8b0fe2620d 100644
--- a/Lib/test/decimaltestdata/ddRotate.decTest
+++ b/Lib/test/decimaltestdata/ddRotate.decTest
@@ -1,262 +1,262 @@
-------------------------------------------------------------------------
--- ddRotate.decTest -- rotate a decDouble coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddrot001 rotate 0 0 -> 0
-ddrot002 rotate 0 2 -> 0
-ddrot003 rotate 1 2 -> 100
-ddrot004 rotate 1 15 -> 1000000000000000
-ddrot005 rotate 1 16 -> 1
-ddrot006 rotate 1 -1 -> 1000000000000000
-ddrot007 rotate 0 -2 -> 0
-ddrot008 rotate 1234567890123456 -1 -> 6123456789012345
-ddrot009 rotate 1234567890123456 -15 -> 2345678901234561
-ddrot010 rotate 1234567890123456 -16 -> 1234567890123456
-ddrot011 rotate 9934567890123456 -15 -> 9345678901234569
-ddrot012 rotate 9934567890123456 -16 -> 9934567890123456
-
--- rhs must be an integer
-ddrot015 rotate 1 1.5 -> NaN Invalid_operation
-ddrot016 rotate 1 1.0 -> NaN Invalid_operation
-ddrot017 rotate 1 0.1 -> NaN Invalid_operation
-ddrot018 rotate 1 0.0 -> NaN Invalid_operation
-ddrot019 rotate 1 1E+1 -> NaN Invalid_operation
-ddrot020 rotate 1 1E+99 -> NaN Invalid_operation
-ddrot021 rotate 1 Inf -> NaN Invalid_operation
-ddrot022 rotate 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-ddrot025 rotate 1 -1000 -> NaN Invalid_operation
-ddrot026 rotate 1 -17 -> NaN Invalid_operation
-ddrot027 rotate 1 17 -> NaN Invalid_operation
-ddrot028 rotate 1 1000 -> NaN Invalid_operation
-
--- full pattern
-ddrot030 rotate 1234567890123456 -16 -> 1234567890123456
-ddrot031 rotate 1234567890123456 -15 -> 2345678901234561
-ddrot032 rotate 1234567890123456 -14 -> 3456789012345612
-ddrot033 rotate 1234567890123456 -13 -> 4567890123456123
-ddrot034 rotate 1234567890123456 -12 -> 5678901234561234
-ddrot035 rotate 1234567890123456 -11 -> 6789012345612345
-ddrot036 rotate 1234567890123456 -10 -> 7890123456123456
-ddrot037 rotate 1234567890123456 -9 -> 8901234561234567
-ddrot038 rotate 1234567890123456 -8 -> 9012345612345678
-ddrot039 rotate 1234567890123456 -7 -> 123456123456789
-ddrot040 rotate 1234567890123456 -6 -> 1234561234567890
-ddrot041 rotate 1234567890123456 -5 -> 2345612345678901
-ddrot042 rotate 1234567890123456 -4 -> 3456123456789012
-ddrot043 rotate 1234567890123456 -3 -> 4561234567890123
-ddrot044 rotate 1234567890123456 -2 -> 5612345678901234
-ddrot045 rotate 1234567890123456 -1 -> 6123456789012345
-ddrot046 rotate 1234567890123456 -0 -> 1234567890123456
-
-ddrot047 rotate 1234567890123456 +0 -> 1234567890123456
-ddrot048 rotate 1234567890123456 +1 -> 2345678901234561
-ddrot049 rotate 1234567890123456 +2 -> 3456789012345612
-ddrot050 rotate 1234567890123456 +3 -> 4567890123456123
-ddrot051 rotate 1234567890123456 +4 -> 5678901234561234
-ddrot052 rotate 1234567890123456 +5 -> 6789012345612345
-ddrot053 rotate 1234567890123456 +6 -> 7890123456123456
-ddrot054 rotate 1234567890123456 +7 -> 8901234561234567
-ddrot055 rotate 1234567890123456 +8 -> 9012345612345678
-ddrot056 rotate 1234567890123456 +9 -> 123456123456789
-ddrot057 rotate 1234567890123456 +10 -> 1234561234567890
-ddrot058 rotate 1234567890123456 +11 -> 2345612345678901
-ddrot059 rotate 1234567890123456 +12 -> 3456123456789012
-ddrot060 rotate 1234567890123456 +13 -> 4561234567890123
-ddrot061 rotate 1234567890123456 +14 -> 5612345678901234
-ddrot062 rotate 1234567890123456 +15 -> 6123456789012345
-ddrot063 rotate 1234567890123456 +16 -> 1234567890123456
-
--- zeros
-ddrot070 rotate 0E-10 +9 -> 0E-10
-ddrot071 rotate 0E-10 -9 -> 0E-10
-ddrot072 rotate 0.000 +9 -> 0.000
-ddrot073 rotate 0.000 -9 -> 0.000
-ddrot074 rotate 0E+10 +9 -> 0E+10
-ddrot075 rotate 0E+10 -9 -> 0E+10
-ddrot076 rotate -0E-10 +9 -> -0E-10
-ddrot077 rotate -0E-10 -9 -> -0E-10
-ddrot078 rotate -0.000 +9 -> -0.000
-ddrot079 rotate -0.000 -9 -> -0.000
-ddrot080 rotate -0E+10 +9 -> -0E+10
-ddrot081 rotate -0E+10 -9 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-ddrot141 rotate 9.999999999999999E+384 -1 -> 9.999999999999999E+384
-ddrot142 rotate 9.999999999999999E+384 -15 -> 9.999999999999999E+384
-ddrot143 rotate 9.999999999999999E+384 1 -> 9.999999999999999E+384
-ddrot144 rotate 9.999999999999999E+384 15 -> 9.999999999999999E+384
-ddrot145 rotate 1E-383 -1 -> 1.000000000000000E-368
-ddrot146 rotate 1E-383 -15 -> 1.0E-382
-ddrot147 rotate 1E-383 1 -> 1.0E-382
-ddrot148 rotate 1E-383 15 -> 1.000000000000000E-368
-ddrot151 rotate 1.000000000000000E-383 -1 -> 1.00000000000000E-384
-ddrot152 rotate 1.000000000000000E-383 -15 -> 1E-398
-ddrot153 rotate 1.000000000000000E-383 1 -> 1E-398
-ddrot154 rotate 1.000000000000000E-383 15 -> 1.00000000000000E-384
-ddrot155 rotate 9.000000000000000E-383 -1 -> 9.00000000000000E-384
-ddrot156 rotate 9.000000000000000E-383 -15 -> 9E-398
-ddrot157 rotate 9.000000000000000E-383 1 -> 9E-398
-ddrot158 rotate 9.000000000000000E-383 15 -> 9.00000000000000E-384
-ddrot160 rotate 1E-398 -1 -> 1.000000000000000E-383
-ddrot161 rotate 1E-398 -15 -> 1.0E-397
-ddrot162 rotate 1E-398 1 -> 1.0E-397
-ddrot163 rotate 1E-398 15 -> 1.000000000000000E-383
--- negatives
-ddrot171 rotate -9.999999999999999E+384 -1 -> -9.999999999999999E+384
-ddrot172 rotate -9.999999999999999E+384 -15 -> -9.999999999999999E+384
-ddrot173 rotate -9.999999999999999E+384 1 -> -9.999999999999999E+384
-ddrot174 rotate -9.999999999999999E+384 15 -> -9.999999999999999E+384
-ddrot175 rotate -1E-383 -1 -> -1.000000000000000E-368
-ddrot176 rotate -1E-383 -15 -> -1.0E-382
-ddrot177 rotate -1E-383 1 -> -1.0E-382
-ddrot178 rotate -1E-383 15 -> -1.000000000000000E-368
-ddrot181 rotate -1.000000000000000E-383 -1 -> -1.00000000000000E-384
-ddrot182 rotate -1.000000000000000E-383 -15 -> -1E-398
-ddrot183 rotate -1.000000000000000E-383 1 -> -1E-398
-ddrot184 rotate -1.000000000000000E-383 15 -> -1.00000000000000E-384
-ddrot185 rotate -9.000000000000000E-383 -1 -> -9.00000000000000E-384
-ddrot186 rotate -9.000000000000000E-383 -15 -> -9E-398
-ddrot187 rotate -9.000000000000000E-383 1 -> -9E-398
-ddrot188 rotate -9.000000000000000E-383 15 -> -9.00000000000000E-384
-ddrot190 rotate -1E-398 -1 -> -1.000000000000000E-383
-ddrot191 rotate -1E-398 -15 -> -1.0E-397
-ddrot192 rotate -1E-398 1 -> -1.0E-397
-ddrot193 rotate -1E-398 15 -> -1.000000000000000E-383
-
--- more negatives (of sanities)
-ddrot201 rotate -0 0 -> -0
-ddrot202 rotate -0 2 -> -0
-ddrot203 rotate -1 2 -> -100
-ddrot204 rotate -1 15 -> -1000000000000000
-ddrot205 rotate -1 16 -> -1
-ddrot206 rotate -1 -1 -> -1000000000000000
-ddrot207 rotate -0 -2 -> -0
-ddrot208 rotate -1234567890123456 -1 -> -6123456789012345
-ddrot209 rotate -1234567890123456 -15 -> -2345678901234561
-ddrot210 rotate -1234567890123456 -16 -> -1234567890123456
-ddrot211 rotate -9934567890123456 -15 -> -9345678901234569
-ddrot212 rotate -9934567890123456 -16 -> -9934567890123456
-
-
--- Specials; NaNs are handled as usual
-ddrot781 rotate -Inf -8 -> -Infinity
-ddrot782 rotate -Inf -1 -> -Infinity
-ddrot783 rotate -Inf -0 -> -Infinity
-ddrot784 rotate -Inf 0 -> -Infinity
-ddrot785 rotate -Inf 1 -> -Infinity
-ddrot786 rotate -Inf 8 -> -Infinity
-ddrot787 rotate -1000 -Inf -> NaN Invalid_operation
-ddrot788 rotate -Inf -Inf -> NaN Invalid_operation
-ddrot789 rotate -1 -Inf -> NaN Invalid_operation
-ddrot790 rotate -0 -Inf -> NaN Invalid_operation
-ddrot791 rotate 0 -Inf -> NaN Invalid_operation
-ddrot792 rotate 1 -Inf -> NaN Invalid_operation
-ddrot793 rotate 1000 -Inf -> NaN Invalid_operation
-ddrot794 rotate Inf -Inf -> NaN Invalid_operation
-
-ddrot800 rotate Inf -Inf -> NaN Invalid_operation
-ddrot801 rotate Inf -8 -> Infinity
-ddrot802 rotate Inf -1 -> Infinity
-ddrot803 rotate Inf -0 -> Infinity
-ddrot804 rotate Inf 0 -> Infinity
-ddrot805 rotate Inf 1 -> Infinity
-ddrot806 rotate Inf 8 -> Infinity
-ddrot807 rotate Inf Inf -> NaN Invalid_operation
-ddrot808 rotate -1000 Inf -> NaN Invalid_operation
-ddrot809 rotate -Inf Inf -> NaN Invalid_operation
-ddrot810 rotate -1 Inf -> NaN Invalid_operation
-ddrot811 rotate -0 Inf -> NaN Invalid_operation
-ddrot812 rotate 0 Inf -> NaN Invalid_operation
-ddrot813 rotate 1 Inf -> NaN Invalid_operation
-ddrot814 rotate 1000 Inf -> NaN Invalid_operation
-ddrot815 rotate Inf Inf -> NaN Invalid_operation
-
-ddrot821 rotate NaN -Inf -> NaN
-ddrot822 rotate NaN -1000 -> NaN
-ddrot823 rotate NaN -1 -> NaN
-ddrot824 rotate NaN -0 -> NaN
-ddrot825 rotate NaN 0 -> NaN
-ddrot826 rotate NaN 1 -> NaN
-ddrot827 rotate NaN 1000 -> NaN
-ddrot828 rotate NaN Inf -> NaN
-ddrot829 rotate NaN NaN -> NaN
-ddrot830 rotate -Inf NaN -> NaN
-ddrot831 rotate -1000 NaN -> NaN
-ddrot832 rotate -1 NaN -> NaN
-ddrot833 rotate -0 NaN -> NaN
-ddrot834 rotate 0 NaN -> NaN
-ddrot835 rotate 1 NaN -> NaN
-ddrot836 rotate 1000 NaN -> NaN
-ddrot837 rotate Inf NaN -> NaN
-
-ddrot841 rotate sNaN -Inf -> NaN Invalid_operation
-ddrot842 rotate sNaN -1000 -> NaN Invalid_operation
-ddrot843 rotate sNaN -1 -> NaN Invalid_operation
-ddrot844 rotate sNaN -0 -> NaN Invalid_operation
-ddrot845 rotate sNaN 0 -> NaN Invalid_operation
-ddrot846 rotate sNaN 1 -> NaN Invalid_operation
-ddrot847 rotate sNaN 1000 -> NaN Invalid_operation
-ddrot848 rotate sNaN NaN -> NaN Invalid_operation
-ddrot849 rotate sNaN sNaN -> NaN Invalid_operation
-ddrot850 rotate NaN sNaN -> NaN Invalid_operation
-ddrot851 rotate -Inf sNaN -> NaN Invalid_operation
-ddrot852 rotate -1000 sNaN -> NaN Invalid_operation
-ddrot853 rotate -1 sNaN -> NaN Invalid_operation
-ddrot854 rotate -0 sNaN -> NaN Invalid_operation
-ddrot855 rotate 0 sNaN -> NaN Invalid_operation
-ddrot856 rotate 1 sNaN -> NaN Invalid_operation
-ddrot857 rotate 1000 sNaN -> NaN Invalid_operation
-ddrot858 rotate Inf sNaN -> NaN Invalid_operation
-ddrot859 rotate NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddrot861 rotate NaN1 -Inf -> NaN1
-ddrot862 rotate +NaN2 -1000 -> NaN2
-ddrot863 rotate NaN3 1000 -> NaN3
-ddrot864 rotate NaN4 Inf -> NaN4
-ddrot865 rotate NaN5 +NaN6 -> NaN5
-ddrot866 rotate -Inf NaN7 -> NaN7
-ddrot867 rotate -1000 NaN8 -> NaN8
-ddrot868 rotate 1000 NaN9 -> NaN9
-ddrot869 rotate Inf +NaN10 -> NaN10
-ddrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
-ddrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
-ddrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation
-ddrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
-ddrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
-ddrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
-ddrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
-ddrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
-ddrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation
-ddrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddrot882 rotate -NaN26 NaN28 -> -NaN26
-ddrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddrot884 rotate 1000 -NaN30 -> -NaN30
-ddrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- ddRotate.decTest -- rotate a decDouble coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddrot001 rotate 0 0 -> 0
+ddrot002 rotate 0 2 -> 0
+ddrot003 rotate 1 2 -> 100
+ddrot004 rotate 1 15 -> 1000000000000000
+ddrot005 rotate 1 16 -> 1
+ddrot006 rotate 1 -1 -> 1000000000000000
+ddrot007 rotate 0 -2 -> 0
+ddrot008 rotate 1234567890123456 -1 -> 6123456789012345
+ddrot009 rotate 1234567890123456 -15 -> 2345678901234561
+ddrot010 rotate 1234567890123456 -16 -> 1234567890123456
+ddrot011 rotate 9934567890123456 -15 -> 9345678901234569
+ddrot012 rotate 9934567890123456 -16 -> 9934567890123456
+
+-- rhs must be an integer
+ddrot015 rotate 1 1.5 -> NaN Invalid_operation
+ddrot016 rotate 1 1.0 -> NaN Invalid_operation
+ddrot017 rotate 1 0.1 -> NaN Invalid_operation
+ddrot018 rotate 1 0.0 -> NaN Invalid_operation
+ddrot019 rotate 1 1E+1 -> NaN Invalid_operation
+ddrot020 rotate 1 1E+99 -> NaN Invalid_operation
+ddrot021 rotate 1 Inf -> NaN Invalid_operation
+ddrot022 rotate 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+ddrot025 rotate 1 -1000 -> NaN Invalid_operation
+ddrot026 rotate 1 -17 -> NaN Invalid_operation
+ddrot027 rotate 1 17 -> NaN Invalid_operation
+ddrot028 rotate 1 1000 -> NaN Invalid_operation
+
+-- full pattern
+ddrot030 rotate 1234567890123456 -16 -> 1234567890123456
+ddrot031 rotate 1234567890123456 -15 -> 2345678901234561
+ddrot032 rotate 1234567890123456 -14 -> 3456789012345612
+ddrot033 rotate 1234567890123456 -13 -> 4567890123456123
+ddrot034 rotate 1234567890123456 -12 -> 5678901234561234
+ddrot035 rotate 1234567890123456 -11 -> 6789012345612345
+ddrot036 rotate 1234567890123456 -10 -> 7890123456123456
+ddrot037 rotate 1234567890123456 -9 -> 8901234561234567
+ddrot038 rotate 1234567890123456 -8 -> 9012345612345678
+ddrot039 rotate 1234567890123456 -7 -> 123456123456789
+ddrot040 rotate 1234567890123456 -6 -> 1234561234567890
+ddrot041 rotate 1234567890123456 -5 -> 2345612345678901
+ddrot042 rotate 1234567890123456 -4 -> 3456123456789012
+ddrot043 rotate 1234567890123456 -3 -> 4561234567890123
+ddrot044 rotate 1234567890123456 -2 -> 5612345678901234
+ddrot045 rotate 1234567890123456 -1 -> 6123456789012345
+ddrot046 rotate 1234567890123456 -0 -> 1234567890123456
+
+ddrot047 rotate 1234567890123456 +0 -> 1234567890123456
+ddrot048 rotate 1234567890123456 +1 -> 2345678901234561
+ddrot049 rotate 1234567890123456 +2 -> 3456789012345612
+ddrot050 rotate 1234567890123456 +3 -> 4567890123456123
+ddrot051 rotate 1234567890123456 +4 -> 5678901234561234
+ddrot052 rotate 1234567890123456 +5 -> 6789012345612345
+ddrot053 rotate 1234567890123456 +6 -> 7890123456123456
+ddrot054 rotate 1234567890123456 +7 -> 8901234561234567
+ddrot055 rotate 1234567890123456 +8 -> 9012345612345678
+ddrot056 rotate 1234567890123456 +9 -> 123456123456789
+ddrot057 rotate 1234567890123456 +10 -> 1234561234567890
+ddrot058 rotate 1234567890123456 +11 -> 2345612345678901
+ddrot059 rotate 1234567890123456 +12 -> 3456123456789012
+ddrot060 rotate 1234567890123456 +13 -> 4561234567890123
+ddrot061 rotate 1234567890123456 +14 -> 5612345678901234
+ddrot062 rotate 1234567890123456 +15 -> 6123456789012345
+ddrot063 rotate 1234567890123456 +16 -> 1234567890123456
+
+-- zeros
+ddrot070 rotate 0E-10 +9 -> 0E-10
+ddrot071 rotate 0E-10 -9 -> 0E-10
+ddrot072 rotate 0.000 +9 -> 0.000
+ddrot073 rotate 0.000 -9 -> 0.000
+ddrot074 rotate 0E+10 +9 -> 0E+10
+ddrot075 rotate 0E+10 -9 -> 0E+10
+ddrot076 rotate -0E-10 +9 -> -0E-10
+ddrot077 rotate -0E-10 -9 -> -0E-10
+ddrot078 rotate -0.000 +9 -> -0.000
+ddrot079 rotate -0.000 -9 -> -0.000
+ddrot080 rotate -0E+10 +9 -> -0E+10
+ddrot081 rotate -0E+10 -9 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+ddrot141 rotate 9.999999999999999E+384 -1 -> 9.999999999999999E+384
+ddrot142 rotate 9.999999999999999E+384 -15 -> 9.999999999999999E+384
+ddrot143 rotate 9.999999999999999E+384 1 -> 9.999999999999999E+384
+ddrot144 rotate 9.999999999999999E+384 15 -> 9.999999999999999E+384
+ddrot145 rotate 1E-383 -1 -> 1.000000000000000E-368
+ddrot146 rotate 1E-383 -15 -> 1.0E-382
+ddrot147 rotate 1E-383 1 -> 1.0E-382
+ddrot148 rotate 1E-383 15 -> 1.000000000000000E-368
+ddrot151 rotate 1.000000000000000E-383 -1 -> 1.00000000000000E-384
+ddrot152 rotate 1.000000000000000E-383 -15 -> 1E-398
+ddrot153 rotate 1.000000000000000E-383 1 -> 1E-398
+ddrot154 rotate 1.000000000000000E-383 15 -> 1.00000000000000E-384
+ddrot155 rotate 9.000000000000000E-383 -1 -> 9.00000000000000E-384
+ddrot156 rotate 9.000000000000000E-383 -15 -> 9E-398
+ddrot157 rotate 9.000000000000000E-383 1 -> 9E-398
+ddrot158 rotate 9.000000000000000E-383 15 -> 9.00000000000000E-384
+ddrot160 rotate 1E-398 -1 -> 1.000000000000000E-383
+ddrot161 rotate 1E-398 -15 -> 1.0E-397
+ddrot162 rotate 1E-398 1 -> 1.0E-397
+ddrot163 rotate 1E-398 15 -> 1.000000000000000E-383
+-- negatives
+ddrot171 rotate -9.999999999999999E+384 -1 -> -9.999999999999999E+384
+ddrot172 rotate -9.999999999999999E+384 -15 -> -9.999999999999999E+384
+ddrot173 rotate -9.999999999999999E+384 1 -> -9.999999999999999E+384
+ddrot174 rotate -9.999999999999999E+384 15 -> -9.999999999999999E+384
+ddrot175 rotate -1E-383 -1 -> -1.000000000000000E-368
+ddrot176 rotate -1E-383 -15 -> -1.0E-382
+ddrot177 rotate -1E-383 1 -> -1.0E-382
+ddrot178 rotate -1E-383 15 -> -1.000000000000000E-368
+ddrot181 rotate -1.000000000000000E-383 -1 -> -1.00000000000000E-384
+ddrot182 rotate -1.000000000000000E-383 -15 -> -1E-398
+ddrot183 rotate -1.000000000000000E-383 1 -> -1E-398
+ddrot184 rotate -1.000000000000000E-383 15 -> -1.00000000000000E-384
+ddrot185 rotate -9.000000000000000E-383 -1 -> -9.00000000000000E-384
+ddrot186 rotate -9.000000000000000E-383 -15 -> -9E-398
+ddrot187 rotate -9.000000000000000E-383 1 -> -9E-398
+ddrot188 rotate -9.000000000000000E-383 15 -> -9.00000000000000E-384
+ddrot190 rotate -1E-398 -1 -> -1.000000000000000E-383
+ddrot191 rotate -1E-398 -15 -> -1.0E-397
+ddrot192 rotate -1E-398 1 -> -1.0E-397
+ddrot193 rotate -1E-398 15 -> -1.000000000000000E-383
+
+-- more negatives (of sanities)
+ddrot201 rotate -0 0 -> -0
+ddrot202 rotate -0 2 -> -0
+ddrot203 rotate -1 2 -> -100
+ddrot204 rotate -1 15 -> -1000000000000000
+ddrot205 rotate -1 16 -> -1
+ddrot206 rotate -1 -1 -> -1000000000000000
+ddrot207 rotate -0 -2 -> -0
+ddrot208 rotate -1234567890123456 -1 -> -6123456789012345
+ddrot209 rotate -1234567890123456 -15 -> -2345678901234561
+ddrot210 rotate -1234567890123456 -16 -> -1234567890123456
+ddrot211 rotate -9934567890123456 -15 -> -9345678901234569
+ddrot212 rotate -9934567890123456 -16 -> -9934567890123456
+
+
+-- Specials; NaNs are handled as usual
+ddrot781 rotate -Inf -8 -> -Infinity
+ddrot782 rotate -Inf -1 -> -Infinity
+ddrot783 rotate -Inf -0 -> -Infinity
+ddrot784 rotate -Inf 0 -> -Infinity
+ddrot785 rotate -Inf 1 -> -Infinity
+ddrot786 rotate -Inf 8 -> -Infinity
+ddrot787 rotate -1000 -Inf -> NaN Invalid_operation
+ddrot788 rotate -Inf -Inf -> NaN Invalid_operation
+ddrot789 rotate -1 -Inf -> NaN Invalid_operation
+ddrot790 rotate -0 -Inf -> NaN Invalid_operation
+ddrot791 rotate 0 -Inf -> NaN Invalid_operation
+ddrot792 rotate 1 -Inf -> NaN Invalid_operation
+ddrot793 rotate 1000 -Inf -> NaN Invalid_operation
+ddrot794 rotate Inf -Inf -> NaN Invalid_operation
+
+ddrot800 rotate Inf -Inf -> NaN Invalid_operation
+ddrot801 rotate Inf -8 -> Infinity
+ddrot802 rotate Inf -1 -> Infinity
+ddrot803 rotate Inf -0 -> Infinity
+ddrot804 rotate Inf 0 -> Infinity
+ddrot805 rotate Inf 1 -> Infinity
+ddrot806 rotate Inf 8 -> Infinity
+ddrot807 rotate Inf Inf -> NaN Invalid_operation
+ddrot808 rotate -1000 Inf -> NaN Invalid_operation
+ddrot809 rotate -Inf Inf -> NaN Invalid_operation
+ddrot810 rotate -1 Inf -> NaN Invalid_operation
+ddrot811 rotate -0 Inf -> NaN Invalid_operation
+ddrot812 rotate 0 Inf -> NaN Invalid_operation
+ddrot813 rotate 1 Inf -> NaN Invalid_operation
+ddrot814 rotate 1000 Inf -> NaN Invalid_operation
+ddrot815 rotate Inf Inf -> NaN Invalid_operation
+
+ddrot821 rotate NaN -Inf -> NaN
+ddrot822 rotate NaN -1000 -> NaN
+ddrot823 rotate NaN -1 -> NaN
+ddrot824 rotate NaN -0 -> NaN
+ddrot825 rotate NaN 0 -> NaN
+ddrot826 rotate NaN 1 -> NaN
+ddrot827 rotate NaN 1000 -> NaN
+ddrot828 rotate NaN Inf -> NaN
+ddrot829 rotate NaN NaN -> NaN
+ddrot830 rotate -Inf NaN -> NaN
+ddrot831 rotate -1000 NaN -> NaN
+ddrot832 rotate -1 NaN -> NaN
+ddrot833 rotate -0 NaN -> NaN
+ddrot834 rotate 0 NaN -> NaN
+ddrot835 rotate 1 NaN -> NaN
+ddrot836 rotate 1000 NaN -> NaN
+ddrot837 rotate Inf NaN -> NaN
+
+ddrot841 rotate sNaN -Inf -> NaN Invalid_operation
+ddrot842 rotate sNaN -1000 -> NaN Invalid_operation
+ddrot843 rotate sNaN -1 -> NaN Invalid_operation
+ddrot844 rotate sNaN -0 -> NaN Invalid_operation
+ddrot845 rotate sNaN 0 -> NaN Invalid_operation
+ddrot846 rotate sNaN 1 -> NaN Invalid_operation
+ddrot847 rotate sNaN 1000 -> NaN Invalid_operation
+ddrot848 rotate sNaN NaN -> NaN Invalid_operation
+ddrot849 rotate sNaN sNaN -> NaN Invalid_operation
+ddrot850 rotate NaN sNaN -> NaN Invalid_operation
+ddrot851 rotate -Inf sNaN -> NaN Invalid_operation
+ddrot852 rotate -1000 sNaN -> NaN Invalid_operation
+ddrot853 rotate -1 sNaN -> NaN Invalid_operation
+ddrot854 rotate -0 sNaN -> NaN Invalid_operation
+ddrot855 rotate 0 sNaN -> NaN Invalid_operation
+ddrot856 rotate 1 sNaN -> NaN Invalid_operation
+ddrot857 rotate 1000 sNaN -> NaN Invalid_operation
+ddrot858 rotate Inf sNaN -> NaN Invalid_operation
+ddrot859 rotate NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddrot861 rotate NaN1 -Inf -> NaN1
+ddrot862 rotate +NaN2 -1000 -> NaN2
+ddrot863 rotate NaN3 1000 -> NaN3
+ddrot864 rotate NaN4 Inf -> NaN4
+ddrot865 rotate NaN5 +NaN6 -> NaN5
+ddrot866 rotate -Inf NaN7 -> NaN7
+ddrot867 rotate -1000 NaN8 -> NaN8
+ddrot868 rotate 1000 NaN9 -> NaN9
+ddrot869 rotate Inf +NaN10 -> NaN10
+ddrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
+ddrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
+ddrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation
+ddrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
+ddrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
+ddrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
+ddrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
+ddrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
+ddrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation
+ddrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddrot882 rotate -NaN26 NaN28 -> -NaN26
+ddrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddrot884 rotate 1000 -NaN30 -> -NaN30
+ddrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddSameQuantum.decTest b/Lib/test/decimaltestdata/ddSameQuantum.decTest
index 54a763cccf..465b36a858 100644
--- a/Lib/test/decimaltestdata/ddSameQuantum.decTest
+++ b/Lib/test/decimaltestdata/ddSameQuantum.decTest
@@ -1,389 +1,389 @@
-------------------------------------------------------------------------
--- ddSameQuantum.decTest -- check decDouble quantums match --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decDoubles.
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddsamq001 samequantum 0 0 -> 1
-ddsamq002 samequantum 0 1 -> 1
-ddsamq003 samequantum 1 0 -> 1
-ddsamq004 samequantum 1 1 -> 1
-
-ddsamq011 samequantum 10 1E+1 -> 0
-ddsamq012 samequantum 10E+1 10E+1 -> 1
-ddsamq013 samequantum 100 10E+1 -> 0
-ddsamq014 samequantum 100 1E+2 -> 0
-ddsamq015 samequantum 0.1 1E-2 -> 0
-ddsamq016 samequantum 0.1 1E-1 -> 1
-ddsamq017 samequantum 0.1 1E-0 -> 0
-ddsamq018 samequantum 999 999 -> 1
-ddsamq019 samequantum 999E-1 99.9 -> 1
-ddsamq020 samequantum 111E-1 22.2 -> 1
-ddsamq021 samequantum 111E-1 1234.2 -> 1
-
--- zeros
-ddsamq030 samequantum 0.0 1.1 -> 1
-ddsamq031 samequantum 0.0 1.11 -> 0
-ddsamq032 samequantum 0.0 0 -> 0
-ddsamq033 samequantum 0.0 0.0 -> 1
-ddsamq034 samequantum 0.0 0.00 -> 0
-ddsamq035 samequantum 0E+1 0E+0 -> 0
-ddsamq036 samequantum 0E+1 0E+1 -> 1
-ddsamq037 samequantum 0E+1 0E+2 -> 0
-ddsamq038 samequantum 0E-17 0E-16 -> 0
-ddsamq039 samequantum 0E-17 0E-17 -> 1
-ddsamq040 samequantum 0E-17 0E-18 -> 0
-ddsamq041 samequantum 0E-17 0.0E-15 -> 0
-ddsamq042 samequantum 0E-17 0.0E-16 -> 1
-ddsamq043 samequantum 0E-17 0.0E-17 -> 0
-ddsamq044 samequantum -0E-17 0.0E-16 -> 1
-ddsamq045 samequantum 0E-17 -0.0E-17 -> 0
-ddsamq046 samequantum 0E-17 -0.0E-16 -> 1
-ddsamq047 samequantum -0E-17 0.0E-17 -> 0
-ddsamq048 samequantum -0E-17 -0.0E-16 -> 1
-ddsamq049 samequantum -0E-17 -0.0E-17 -> 0
-
--- Nmax, Nmin, Ntiny
-ddsamq051 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
-ddsamq052 samequantum 1E-383 1E-383 -> 1
-ddsamq053 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
-ddsamq054 samequantum 1E-398 1E-398 -> 1
-ddsamq055 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
-ddsamq056 samequantum 1E-383 1E-383 -> 1
-ddsamq057 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
-ddsamq058 samequantum 1E-398 1E-398 -> 1
-
-ddsamq061 samequantum -1E-398 -1E-398 -> 1
-ddsamq062 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
-ddsamq063 samequantum -1E-383 -1E-383 -> 1
-ddsamq064 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
-ddsamq065 samequantum -1E-398 -1E-398 -> 1
-ddsamq066 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
-ddsamq067 samequantum -1E-383 -1E-383 -> 1
-ddsamq068 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
-
-ddsamq071 samequantum -4E-398 -1E-398 -> 1
-ddsamq072 samequantum -4.000000000000000E-383 -1.000040000000000E-383 -> 1
-ddsamq073 samequantum -4E-383 -1E-383 -> 1
-ddsamq074 samequantum -4.999999999999999E+384 -9.999999999949999E+384 -> 1
-ddsamq075 samequantum -4E-398 -1E-398 -> 1
-ddsamq076 samequantum -4.000000000000000E-383 -1.004000000000000E-383 -> 1
-ddsamq077 samequantum -4E-383 -1E-383 -> 1
-ddsamq078 samequantum -4.999999999999999E+384 -9.949999999999999E+384 -> 1
-
-ddsamq081 samequantum -4E-397 -1E-398 -> 0
-ddsamq082 samequantum -4.000000000000000E-383 -1.000040000000000E-336 -> 0
-ddsamq083 samequantum -4E-346 -1E-383 -> 0
-ddsamq084 samequantum -4.999999999999999E+384 -9.999499999999999E+336 -> 0
-ddsamq085 samequantum -4E-397 -1E-398 -> 0
-ddsamq086 samequantum -4.000000000000000E-383 -1.004000000000000E-336 -> 0
-ddsamq087 samequantum -4E-346 -1E-383 -> 0
-ddsamq088 samequantum -4.999999999999999E+384 -9.949999999999999E+336 -> 0
-
--- specials & combinations
-ddsamq0110 samequantum -Inf -Inf -> 1
-ddsamq0111 samequantum -Inf Inf -> 1
-ddsamq0112 samequantum -Inf NaN -> 0
-ddsamq0113 samequantum -Inf -7E+3 -> 0
-ddsamq0114 samequantum -Inf -7 -> 0
-ddsamq0115 samequantum -Inf -7E-3 -> 0
-ddsamq0116 samequantum -Inf -0E-3 -> 0
-ddsamq0117 samequantum -Inf -0 -> 0
-ddsamq0118 samequantum -Inf -0E+3 -> 0
-ddsamq0119 samequantum -Inf 0E-3 -> 0
-ddsamq0120 samequantum -Inf 0 -> 0
-ddsamq0121 samequantum -Inf 0E+3 -> 0
-ddsamq0122 samequantum -Inf 7E-3 -> 0
-ddsamq0123 samequantum -Inf 7 -> 0
-ddsamq0124 samequantum -Inf 7E+3 -> 0
-ddsamq0125 samequantum -Inf sNaN -> 0
-
-ddsamq0210 samequantum Inf -Inf -> 1
-ddsamq0211 samequantum Inf Inf -> 1
-ddsamq0212 samequantum Inf NaN -> 0
-ddsamq0213 samequantum Inf -7E+3 -> 0
-ddsamq0214 samequantum Inf -7 -> 0
-ddsamq0215 samequantum Inf -7E-3 -> 0
-ddsamq0216 samequantum Inf -0E-3 -> 0
-ddsamq0217 samequantum Inf -0 -> 0
-ddsamq0218 samequantum Inf -0E+3 -> 0
-ddsamq0219 samequantum Inf 0E-3 -> 0
-ddsamq0220 samequantum Inf 0 -> 0
-ddsamq0221 samequantum Inf 0E+3 -> 0
-ddsamq0222 samequantum Inf 7E-3 -> 0
-ddsamq0223 samequantum Inf 7 -> 0
-ddsamq0224 samequantum Inf 7E+3 -> 0
-ddsamq0225 samequantum Inf sNaN -> 0
-
-ddsamq0310 samequantum NaN -Inf -> 0
-ddsamq0311 samequantum NaN Inf -> 0
-ddsamq0312 samequantum NaN NaN -> 1
-ddsamq0313 samequantum NaN -7E+3 -> 0
-ddsamq0314 samequantum NaN -7 -> 0
-ddsamq0315 samequantum NaN -7E-3 -> 0
-ddsamq0316 samequantum NaN -0E-3 -> 0
-ddsamq0317 samequantum NaN -0 -> 0
-ddsamq0318 samequantum NaN -0E+3 -> 0
-ddsamq0319 samequantum NaN 0E-3 -> 0
-ddsamq0320 samequantum NaN 0 -> 0
-ddsamq0321 samequantum NaN 0E+3 -> 0
-ddsamq0322 samequantum NaN 7E-3 -> 0
-ddsamq0323 samequantum NaN 7 -> 0
-ddsamq0324 samequantum NaN 7E+3 -> 0
-ddsamq0325 samequantum NaN sNaN -> 1
-
-ddsamq0410 samequantum -7E+3 -Inf -> 0
-ddsamq0411 samequantum -7E+3 Inf -> 0
-ddsamq0412 samequantum -7E+3 NaN -> 0
-ddsamq0413 samequantum -7E+3 -7E+3 -> 1
-ddsamq0414 samequantum -7E+3 -7 -> 0
-ddsamq0415 samequantum -7E+3 -7E-3 -> 0
-ddsamq0416 samequantum -7E+3 -0E-3 -> 0
-ddsamq0417 samequantum -7E+3 -0 -> 0
-ddsamq0418 samequantum -7E+3 -0E+3 -> 1
-ddsamq0419 samequantum -7E+3 0E-3 -> 0
-ddsamq0420 samequantum -7E+3 0 -> 0
-ddsamq0421 samequantum -7E+3 0E+3 -> 1
-ddsamq0422 samequantum -7E+3 7E-3 -> 0
-ddsamq0423 samequantum -7E+3 7 -> 0
-ddsamq0424 samequantum -7E+3 7E+3 -> 1
-ddsamq0425 samequantum -7E+3 sNaN -> 0
-
-ddsamq0510 samequantum -7 -Inf -> 0
-ddsamq0511 samequantum -7 Inf -> 0
-ddsamq0512 samequantum -7 NaN -> 0
-ddsamq0513 samequantum -7 -7E+3 -> 0
-ddsamq0514 samequantum -7 -7 -> 1
-ddsamq0515 samequantum -7 -7E-3 -> 0
-ddsamq0516 samequantum -7 -0E-3 -> 0
-ddsamq0517 samequantum -7 -0 -> 1
-ddsamq0518 samequantum -7 -0E+3 -> 0
-ddsamq0519 samequantum -7 0E-3 -> 0
-ddsamq0520 samequantum -7 0 -> 1
-ddsamq0521 samequantum -7 0E+3 -> 0
-ddsamq0522 samequantum -7 7E-3 -> 0
-ddsamq0523 samequantum -7 7 -> 1
-ddsamq0524 samequantum -7 7E+3 -> 0
-ddsamq0525 samequantum -7 sNaN -> 0
-
-ddsamq0610 samequantum -7E-3 -Inf -> 0
-ddsamq0611 samequantum -7E-3 Inf -> 0
-ddsamq0612 samequantum -7E-3 NaN -> 0
-ddsamq0613 samequantum -7E-3 -7E+3 -> 0
-ddsamq0614 samequantum -7E-3 -7 -> 0
-ddsamq0615 samequantum -7E-3 -7E-3 -> 1
-ddsamq0616 samequantum -7E-3 -0E-3 -> 1
-ddsamq0617 samequantum -7E-3 -0 -> 0
-ddsamq0618 samequantum -7E-3 -0E+3 -> 0
-ddsamq0619 samequantum -7E-3 0E-3 -> 1
-ddsamq0620 samequantum -7E-3 0 -> 0
-ddsamq0621 samequantum -7E-3 0E+3 -> 0
-ddsamq0622 samequantum -7E-3 7E-3 -> 1
-ddsamq0623 samequantum -7E-3 7 -> 0
-ddsamq0624 samequantum -7E-3 7E+3 -> 0
-ddsamq0625 samequantum -7E-3 sNaN -> 0
-
-ddsamq0710 samequantum -0E-3 -Inf -> 0
-ddsamq0711 samequantum -0E-3 Inf -> 0
-ddsamq0712 samequantum -0E-3 NaN -> 0
-ddsamq0713 samequantum -0E-3 -7E+3 -> 0
-ddsamq0714 samequantum -0E-3 -7 -> 0
-ddsamq0715 samequantum -0E-3 -7E-3 -> 1
-ddsamq0716 samequantum -0E-3 -0E-3 -> 1
-ddsamq0717 samequantum -0E-3 -0 -> 0
-ddsamq0718 samequantum -0E-3 -0E+3 -> 0
-ddsamq0719 samequantum -0E-3 0E-3 -> 1
-ddsamq0720 samequantum -0E-3 0 -> 0
-ddsamq0721 samequantum -0E-3 0E+3 -> 0
-ddsamq0722 samequantum -0E-3 7E-3 -> 1
-ddsamq0723 samequantum -0E-3 7 -> 0
-ddsamq0724 samequantum -0E-3 7E+3 -> 0
-ddsamq0725 samequantum -0E-3 sNaN -> 0
-
-ddsamq0810 samequantum -0 -Inf -> 0
-ddsamq0811 samequantum -0 Inf -> 0
-ddsamq0812 samequantum -0 NaN -> 0
-ddsamq0813 samequantum -0 -7E+3 -> 0
-ddsamq0814 samequantum -0 -7 -> 1
-ddsamq0815 samequantum -0 -7E-3 -> 0
-ddsamq0816 samequantum -0 -0E-3 -> 0
-ddsamq0817 samequantum -0 -0 -> 1
-ddsamq0818 samequantum -0 -0E+3 -> 0
-ddsamq0819 samequantum -0 0E-3 -> 0
-ddsamq0820 samequantum -0 0 -> 1
-ddsamq0821 samequantum -0 0E+3 -> 0
-ddsamq0822 samequantum -0 7E-3 -> 0
-ddsamq0823 samequantum -0 7 -> 1
-ddsamq0824 samequantum -0 7E+3 -> 0
-ddsamq0825 samequantum -0 sNaN -> 0
-
-ddsamq0910 samequantum -0E+3 -Inf -> 0
-ddsamq0911 samequantum -0E+3 Inf -> 0
-ddsamq0912 samequantum -0E+3 NaN -> 0
-ddsamq0913 samequantum -0E+3 -7E+3 -> 1
-ddsamq0914 samequantum -0E+3 -7 -> 0
-ddsamq0915 samequantum -0E+3 -7E-3 -> 0
-ddsamq0916 samequantum -0E+3 -0E-3 -> 0
-ddsamq0917 samequantum -0E+3 -0 -> 0
-ddsamq0918 samequantum -0E+3 -0E+3 -> 1
-ddsamq0919 samequantum -0E+3 0E-3 -> 0
-ddsamq0920 samequantum -0E+3 0 -> 0
-ddsamq0921 samequantum -0E+3 0E+3 -> 1
-ddsamq0922 samequantum -0E+3 7E-3 -> 0
-ddsamq0923 samequantum -0E+3 7 -> 0
-ddsamq0924 samequantum -0E+3 7E+3 -> 1
-ddsamq0925 samequantum -0E+3 sNaN -> 0
-
-ddsamq1110 samequantum 0E-3 -Inf -> 0
-ddsamq1111 samequantum 0E-3 Inf -> 0
-ddsamq1112 samequantum 0E-3 NaN -> 0
-ddsamq1113 samequantum 0E-3 -7E+3 -> 0
-ddsamq1114 samequantum 0E-3 -7 -> 0
-ddsamq1115 samequantum 0E-3 -7E-3 -> 1
-ddsamq1116 samequantum 0E-3 -0E-3 -> 1
-ddsamq1117 samequantum 0E-3 -0 -> 0
-ddsamq1118 samequantum 0E-3 -0E+3 -> 0
-ddsamq1119 samequantum 0E-3 0E-3 -> 1
-ddsamq1120 samequantum 0E-3 0 -> 0
-ddsamq1121 samequantum 0E-3 0E+3 -> 0
-ddsamq1122 samequantum 0E-3 7E-3 -> 1
-ddsamq1123 samequantum 0E-3 7 -> 0
-ddsamq1124 samequantum 0E-3 7E+3 -> 0
-ddsamq1125 samequantum 0E-3 sNaN -> 0
-
-ddsamq1210 samequantum 0 -Inf -> 0
-ddsamq1211 samequantum 0 Inf -> 0
-ddsamq1212 samequantum 0 NaN -> 0
-ddsamq1213 samequantum 0 -7E+3 -> 0
-ddsamq1214 samequantum 0 -7 -> 1
-ddsamq1215 samequantum 0 -7E-3 -> 0
-ddsamq1216 samequantum 0 -0E-3 -> 0
-ddsamq1217 samequantum 0 -0 -> 1
-ddsamq1218 samequantum 0 -0E+3 -> 0
-ddsamq1219 samequantum 0 0E-3 -> 0
-ddsamq1220 samequantum 0 0 -> 1
-ddsamq1221 samequantum 0 0E+3 -> 0
-ddsamq1222 samequantum 0 7E-3 -> 0
-ddsamq1223 samequantum 0 7 -> 1
-ddsamq1224 samequantum 0 7E+3 -> 0
-ddsamq1225 samequantum 0 sNaN -> 0
-
-ddsamq1310 samequantum 0E+3 -Inf -> 0
-ddsamq1311 samequantum 0E+3 Inf -> 0
-ddsamq1312 samequantum 0E+3 NaN -> 0
-ddsamq1313 samequantum 0E+3 -7E+3 -> 1
-ddsamq1314 samequantum 0E+3 -7 -> 0
-ddsamq1315 samequantum 0E+3 -7E-3 -> 0
-ddsamq1316 samequantum 0E+3 -0E-3 -> 0
-ddsamq1317 samequantum 0E+3 -0 -> 0
-ddsamq1318 samequantum 0E+3 -0E+3 -> 1
-ddsamq1319 samequantum 0E+3 0E-3 -> 0
-ddsamq1320 samequantum 0E+3 0 -> 0
-ddsamq1321 samequantum 0E+3 0E+3 -> 1
-ddsamq1322 samequantum 0E+3 7E-3 -> 0
-ddsamq1323 samequantum 0E+3 7 -> 0
-ddsamq1324 samequantum 0E+3 7E+3 -> 1
-ddsamq1325 samequantum 0E+3 sNaN -> 0
-
-ddsamq1410 samequantum 7E-3 -Inf -> 0
-ddsamq1411 samequantum 7E-3 Inf -> 0
-ddsamq1412 samequantum 7E-3 NaN -> 0
-ddsamq1413 samequantum 7E-3 -7E+3 -> 0
-ddsamq1414 samequantum 7E-3 -7 -> 0
-ddsamq1415 samequantum 7E-3 -7E-3 -> 1
-ddsamq1416 samequantum 7E-3 -0E-3 -> 1
-ddsamq1417 samequantum 7E-3 -0 -> 0
-ddsamq1418 samequantum 7E-3 -0E+3 -> 0
-ddsamq1419 samequantum 7E-3 0E-3 -> 1
-ddsamq1420 samequantum 7E-3 0 -> 0
-ddsamq1421 samequantum 7E-3 0E+3 -> 0
-ddsamq1422 samequantum 7E-3 7E-3 -> 1
-ddsamq1423 samequantum 7E-3 7 -> 0
-ddsamq1424 samequantum 7E-3 7E+3 -> 0
-ddsamq1425 samequantum 7E-3 sNaN -> 0
-
-ddsamq1510 samequantum 7 -Inf -> 0
-ddsamq1511 samequantum 7 Inf -> 0
-ddsamq1512 samequantum 7 NaN -> 0
-ddsamq1513 samequantum 7 -7E+3 -> 0
-ddsamq1514 samequantum 7 -7 -> 1
-ddsamq1515 samequantum 7 -7E-3 -> 0
-ddsamq1516 samequantum 7 -0E-3 -> 0
-ddsamq1517 samequantum 7 -0 -> 1
-ddsamq1518 samequantum 7 -0E+3 -> 0
-ddsamq1519 samequantum 7 0E-3 -> 0
-ddsamq1520 samequantum 7 0 -> 1
-ddsamq1521 samequantum 7 0E+3 -> 0
-ddsamq1522 samequantum 7 7E-3 -> 0
-ddsamq1523 samequantum 7 7 -> 1
-ddsamq1524 samequantum 7 7E+3 -> 0
-ddsamq1525 samequantum 7 sNaN -> 0
-
-ddsamq1610 samequantum 7E+3 -Inf -> 0
-ddsamq1611 samequantum 7E+3 Inf -> 0
-ddsamq1612 samequantum 7E+3 NaN -> 0
-ddsamq1613 samequantum 7E+3 -7E+3 -> 1
-ddsamq1614 samequantum 7E+3 -7 -> 0
-ddsamq1615 samequantum 7E+3 -7E-3 -> 0
-ddsamq1616 samequantum 7E+3 -0E-3 -> 0
-ddsamq1617 samequantum 7E+3 -0 -> 0
-ddsamq1618 samequantum 7E+3 -0E+3 -> 1
-ddsamq1619 samequantum 7E+3 0E-3 -> 0
-ddsamq1620 samequantum 7E+3 0 -> 0
-ddsamq1621 samequantum 7E+3 0E+3 -> 1
-ddsamq1622 samequantum 7E+3 7E-3 -> 0
-ddsamq1623 samequantum 7E+3 7 -> 0
-ddsamq1624 samequantum 7E+3 7E+3 -> 1
-ddsamq1625 samequantum 7E+3 sNaN -> 0
-
-ddsamq1710 samequantum sNaN -Inf -> 0
-ddsamq1711 samequantum sNaN Inf -> 0
-ddsamq1712 samequantum sNaN NaN -> 1
-ddsamq1713 samequantum sNaN -7E+3 -> 0
-ddsamq1714 samequantum sNaN -7 -> 0
-ddsamq1715 samequantum sNaN -7E-3 -> 0
-ddsamq1716 samequantum sNaN -0E-3 -> 0
-ddsamq1717 samequantum sNaN -0 -> 0
-ddsamq1718 samequantum sNaN -0E+3 -> 0
-ddsamq1719 samequantum sNaN 0E-3 -> 0
-ddsamq1720 samequantum sNaN 0 -> 0
-ddsamq1721 samequantum sNaN 0E+3 -> 0
-ddsamq1722 samequantum sNaN 7E-3 -> 0
-ddsamq1723 samequantum sNaN 7 -> 0
-ddsamq1724 samequantum sNaN 7E+3 -> 0
-ddsamq1725 samequantum sNaN sNaN -> 1
--- noisy NaNs
-ddsamq1730 samequantum sNaN3 sNaN3 -> 1
-ddsamq1731 samequantum sNaN3 sNaN4 -> 1
-ddsamq1732 samequantum NaN3 NaN3 -> 1
-ddsamq1733 samequantum NaN3 NaN4 -> 1
-ddsamq1734 samequantum sNaN3 3 -> 0
-ddsamq1735 samequantum NaN3 3 -> 0
-ddsamq1736 samequantum 4 sNaN4 -> 0
-ddsamq1737 samequantum 3 NaN3 -> 0
-ddsamq1738 samequantum Inf sNaN4 -> 0
-ddsamq1739 samequantum -Inf NaN3 -> 0
-
+------------------------------------------------------------------------
+-- ddSameQuantum.decTest -- check decDouble quantums match --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decDoubles.
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddsamq001 samequantum 0 0 -> 1
+ddsamq002 samequantum 0 1 -> 1
+ddsamq003 samequantum 1 0 -> 1
+ddsamq004 samequantum 1 1 -> 1
+
+ddsamq011 samequantum 10 1E+1 -> 0
+ddsamq012 samequantum 10E+1 10E+1 -> 1
+ddsamq013 samequantum 100 10E+1 -> 0
+ddsamq014 samequantum 100 1E+2 -> 0
+ddsamq015 samequantum 0.1 1E-2 -> 0
+ddsamq016 samequantum 0.1 1E-1 -> 1
+ddsamq017 samequantum 0.1 1E-0 -> 0
+ddsamq018 samequantum 999 999 -> 1
+ddsamq019 samequantum 999E-1 99.9 -> 1
+ddsamq020 samequantum 111E-1 22.2 -> 1
+ddsamq021 samequantum 111E-1 1234.2 -> 1
+
+-- zeros
+ddsamq030 samequantum 0.0 1.1 -> 1
+ddsamq031 samequantum 0.0 1.11 -> 0
+ddsamq032 samequantum 0.0 0 -> 0
+ddsamq033 samequantum 0.0 0.0 -> 1
+ddsamq034 samequantum 0.0 0.00 -> 0
+ddsamq035 samequantum 0E+1 0E+0 -> 0
+ddsamq036 samequantum 0E+1 0E+1 -> 1
+ddsamq037 samequantum 0E+1 0E+2 -> 0
+ddsamq038 samequantum 0E-17 0E-16 -> 0
+ddsamq039 samequantum 0E-17 0E-17 -> 1
+ddsamq040 samequantum 0E-17 0E-18 -> 0
+ddsamq041 samequantum 0E-17 0.0E-15 -> 0
+ddsamq042 samequantum 0E-17 0.0E-16 -> 1
+ddsamq043 samequantum 0E-17 0.0E-17 -> 0
+ddsamq044 samequantum -0E-17 0.0E-16 -> 1
+ddsamq045 samequantum 0E-17 -0.0E-17 -> 0
+ddsamq046 samequantum 0E-17 -0.0E-16 -> 1
+ddsamq047 samequantum -0E-17 0.0E-17 -> 0
+ddsamq048 samequantum -0E-17 -0.0E-16 -> 1
+ddsamq049 samequantum -0E-17 -0.0E-17 -> 0
+
+-- Nmax, Nmin, Ntiny
+ddsamq051 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
+ddsamq052 samequantum 1E-383 1E-383 -> 1
+ddsamq053 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
+ddsamq054 samequantum 1E-398 1E-398 -> 1
+ddsamq055 samequantum 9.999999999999999E+384 9.999999999999999E+384 -> 1
+ddsamq056 samequantum 1E-383 1E-383 -> 1
+ddsamq057 samequantum 1.000000000000000E-383 1.000000000000000E-383 -> 1
+ddsamq058 samequantum 1E-398 1E-398 -> 1
+
+ddsamq061 samequantum -1E-398 -1E-398 -> 1
+ddsamq062 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
+ddsamq063 samequantum -1E-383 -1E-383 -> 1
+ddsamq064 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
+ddsamq065 samequantum -1E-398 -1E-398 -> 1
+ddsamq066 samequantum -1.000000000000000E-383 -1.000000000000000E-383 -> 1
+ddsamq067 samequantum -1E-383 -1E-383 -> 1
+ddsamq068 samequantum -9.999999999999999E+384 -9.999999999999999E+384 -> 1
+
+ddsamq071 samequantum -4E-398 -1E-398 -> 1
+ddsamq072 samequantum -4.000000000000000E-383 -1.000040000000000E-383 -> 1
+ddsamq073 samequantum -4E-383 -1E-383 -> 1
+ddsamq074 samequantum -4.999999999999999E+384 -9.999999999949999E+384 -> 1
+ddsamq075 samequantum -4E-398 -1E-398 -> 1
+ddsamq076 samequantum -4.000000000000000E-383 -1.004000000000000E-383 -> 1
+ddsamq077 samequantum -4E-383 -1E-383 -> 1
+ddsamq078 samequantum -4.999999999999999E+384 -9.949999999999999E+384 -> 1
+
+ddsamq081 samequantum -4E-397 -1E-398 -> 0
+ddsamq082 samequantum -4.000000000000000E-383 -1.000040000000000E-336 -> 0
+ddsamq083 samequantum -4E-346 -1E-383 -> 0
+ddsamq084 samequantum -4.999999999999999E+384 -9.999499999999999E+336 -> 0
+ddsamq085 samequantum -4E-397 -1E-398 -> 0
+ddsamq086 samequantum -4.000000000000000E-383 -1.004000000000000E-336 -> 0
+ddsamq087 samequantum -4E-346 -1E-383 -> 0
+ddsamq088 samequantum -4.999999999999999E+384 -9.949999999999999E+336 -> 0
+
+-- specials & combinations
+ddsamq0110 samequantum -Inf -Inf -> 1
+ddsamq0111 samequantum -Inf Inf -> 1
+ddsamq0112 samequantum -Inf NaN -> 0
+ddsamq0113 samequantum -Inf -7E+3 -> 0
+ddsamq0114 samequantum -Inf -7 -> 0
+ddsamq0115 samequantum -Inf -7E-3 -> 0
+ddsamq0116 samequantum -Inf -0E-3 -> 0
+ddsamq0117 samequantum -Inf -0 -> 0
+ddsamq0118 samequantum -Inf -0E+3 -> 0
+ddsamq0119 samequantum -Inf 0E-3 -> 0
+ddsamq0120 samequantum -Inf 0 -> 0
+ddsamq0121 samequantum -Inf 0E+3 -> 0
+ddsamq0122 samequantum -Inf 7E-3 -> 0
+ddsamq0123 samequantum -Inf 7 -> 0
+ddsamq0124 samequantum -Inf 7E+3 -> 0
+ddsamq0125 samequantum -Inf sNaN -> 0
+
+ddsamq0210 samequantum Inf -Inf -> 1
+ddsamq0211 samequantum Inf Inf -> 1
+ddsamq0212 samequantum Inf NaN -> 0
+ddsamq0213 samequantum Inf -7E+3 -> 0
+ddsamq0214 samequantum Inf -7 -> 0
+ddsamq0215 samequantum Inf -7E-3 -> 0
+ddsamq0216 samequantum Inf -0E-3 -> 0
+ddsamq0217 samequantum Inf -0 -> 0
+ddsamq0218 samequantum Inf -0E+3 -> 0
+ddsamq0219 samequantum Inf 0E-3 -> 0
+ddsamq0220 samequantum Inf 0 -> 0
+ddsamq0221 samequantum Inf 0E+3 -> 0
+ddsamq0222 samequantum Inf 7E-3 -> 0
+ddsamq0223 samequantum Inf 7 -> 0
+ddsamq0224 samequantum Inf 7E+3 -> 0
+ddsamq0225 samequantum Inf sNaN -> 0
+
+ddsamq0310 samequantum NaN -Inf -> 0
+ddsamq0311 samequantum NaN Inf -> 0
+ddsamq0312 samequantum NaN NaN -> 1
+ddsamq0313 samequantum NaN -7E+3 -> 0
+ddsamq0314 samequantum NaN -7 -> 0
+ddsamq0315 samequantum NaN -7E-3 -> 0
+ddsamq0316 samequantum NaN -0E-3 -> 0
+ddsamq0317 samequantum NaN -0 -> 0
+ddsamq0318 samequantum NaN -0E+3 -> 0
+ddsamq0319 samequantum NaN 0E-3 -> 0
+ddsamq0320 samequantum NaN 0 -> 0
+ddsamq0321 samequantum NaN 0E+3 -> 0
+ddsamq0322 samequantum NaN 7E-3 -> 0
+ddsamq0323 samequantum NaN 7 -> 0
+ddsamq0324 samequantum NaN 7E+3 -> 0
+ddsamq0325 samequantum NaN sNaN -> 1
+
+ddsamq0410 samequantum -7E+3 -Inf -> 0
+ddsamq0411 samequantum -7E+3 Inf -> 0
+ddsamq0412 samequantum -7E+3 NaN -> 0
+ddsamq0413 samequantum -7E+3 -7E+3 -> 1
+ddsamq0414 samequantum -7E+3 -7 -> 0
+ddsamq0415 samequantum -7E+3 -7E-3 -> 0
+ddsamq0416 samequantum -7E+3 -0E-3 -> 0
+ddsamq0417 samequantum -7E+3 -0 -> 0
+ddsamq0418 samequantum -7E+3 -0E+3 -> 1
+ddsamq0419 samequantum -7E+3 0E-3 -> 0
+ddsamq0420 samequantum -7E+3 0 -> 0
+ddsamq0421 samequantum -7E+3 0E+3 -> 1
+ddsamq0422 samequantum -7E+3 7E-3 -> 0
+ddsamq0423 samequantum -7E+3 7 -> 0
+ddsamq0424 samequantum -7E+3 7E+3 -> 1
+ddsamq0425 samequantum -7E+3 sNaN -> 0
+
+ddsamq0510 samequantum -7 -Inf -> 0
+ddsamq0511 samequantum -7 Inf -> 0
+ddsamq0512 samequantum -7 NaN -> 0
+ddsamq0513 samequantum -7 -7E+3 -> 0
+ddsamq0514 samequantum -7 -7 -> 1
+ddsamq0515 samequantum -7 -7E-3 -> 0
+ddsamq0516 samequantum -7 -0E-3 -> 0
+ddsamq0517 samequantum -7 -0 -> 1
+ddsamq0518 samequantum -7 -0E+3 -> 0
+ddsamq0519 samequantum -7 0E-3 -> 0
+ddsamq0520 samequantum -7 0 -> 1
+ddsamq0521 samequantum -7 0E+3 -> 0
+ddsamq0522 samequantum -7 7E-3 -> 0
+ddsamq0523 samequantum -7 7 -> 1
+ddsamq0524 samequantum -7 7E+3 -> 0
+ddsamq0525 samequantum -7 sNaN -> 0
+
+ddsamq0610 samequantum -7E-3 -Inf -> 0
+ddsamq0611 samequantum -7E-3 Inf -> 0
+ddsamq0612 samequantum -7E-3 NaN -> 0
+ddsamq0613 samequantum -7E-3 -7E+3 -> 0
+ddsamq0614 samequantum -7E-3 -7 -> 0
+ddsamq0615 samequantum -7E-3 -7E-3 -> 1
+ddsamq0616 samequantum -7E-3 -0E-3 -> 1
+ddsamq0617 samequantum -7E-3 -0 -> 0
+ddsamq0618 samequantum -7E-3 -0E+3 -> 0
+ddsamq0619 samequantum -7E-3 0E-3 -> 1
+ddsamq0620 samequantum -7E-3 0 -> 0
+ddsamq0621 samequantum -7E-3 0E+3 -> 0
+ddsamq0622 samequantum -7E-3 7E-3 -> 1
+ddsamq0623 samequantum -7E-3 7 -> 0
+ddsamq0624 samequantum -7E-3 7E+3 -> 0
+ddsamq0625 samequantum -7E-3 sNaN -> 0
+
+ddsamq0710 samequantum -0E-3 -Inf -> 0
+ddsamq0711 samequantum -0E-3 Inf -> 0
+ddsamq0712 samequantum -0E-3 NaN -> 0
+ddsamq0713 samequantum -0E-3 -7E+3 -> 0
+ddsamq0714 samequantum -0E-3 -7 -> 0
+ddsamq0715 samequantum -0E-3 -7E-3 -> 1
+ddsamq0716 samequantum -0E-3 -0E-3 -> 1
+ddsamq0717 samequantum -0E-3 -0 -> 0
+ddsamq0718 samequantum -0E-3 -0E+3 -> 0
+ddsamq0719 samequantum -0E-3 0E-3 -> 1
+ddsamq0720 samequantum -0E-3 0 -> 0
+ddsamq0721 samequantum -0E-3 0E+3 -> 0
+ddsamq0722 samequantum -0E-3 7E-3 -> 1
+ddsamq0723 samequantum -0E-3 7 -> 0
+ddsamq0724 samequantum -0E-3 7E+3 -> 0
+ddsamq0725 samequantum -0E-3 sNaN -> 0
+
+ddsamq0810 samequantum -0 -Inf -> 0
+ddsamq0811 samequantum -0 Inf -> 0
+ddsamq0812 samequantum -0 NaN -> 0
+ddsamq0813 samequantum -0 -7E+3 -> 0
+ddsamq0814 samequantum -0 -7 -> 1
+ddsamq0815 samequantum -0 -7E-3 -> 0
+ddsamq0816 samequantum -0 -0E-3 -> 0
+ddsamq0817 samequantum -0 -0 -> 1
+ddsamq0818 samequantum -0 -0E+3 -> 0
+ddsamq0819 samequantum -0 0E-3 -> 0
+ddsamq0820 samequantum -0 0 -> 1
+ddsamq0821 samequantum -0 0E+3 -> 0
+ddsamq0822 samequantum -0 7E-3 -> 0
+ddsamq0823 samequantum -0 7 -> 1
+ddsamq0824 samequantum -0 7E+3 -> 0
+ddsamq0825 samequantum -0 sNaN -> 0
+
+ddsamq0910 samequantum -0E+3 -Inf -> 0
+ddsamq0911 samequantum -0E+3 Inf -> 0
+ddsamq0912 samequantum -0E+3 NaN -> 0
+ddsamq0913 samequantum -0E+3 -7E+3 -> 1
+ddsamq0914 samequantum -0E+3 -7 -> 0
+ddsamq0915 samequantum -0E+3 -7E-3 -> 0
+ddsamq0916 samequantum -0E+3 -0E-3 -> 0
+ddsamq0917 samequantum -0E+3 -0 -> 0
+ddsamq0918 samequantum -0E+3 -0E+3 -> 1
+ddsamq0919 samequantum -0E+3 0E-3 -> 0
+ddsamq0920 samequantum -0E+3 0 -> 0
+ddsamq0921 samequantum -0E+3 0E+3 -> 1
+ddsamq0922 samequantum -0E+3 7E-3 -> 0
+ddsamq0923 samequantum -0E+3 7 -> 0
+ddsamq0924 samequantum -0E+3 7E+3 -> 1
+ddsamq0925 samequantum -0E+3 sNaN -> 0
+
+ddsamq1110 samequantum 0E-3 -Inf -> 0
+ddsamq1111 samequantum 0E-3 Inf -> 0
+ddsamq1112 samequantum 0E-3 NaN -> 0
+ddsamq1113 samequantum 0E-3 -7E+3 -> 0
+ddsamq1114 samequantum 0E-3 -7 -> 0
+ddsamq1115 samequantum 0E-3 -7E-3 -> 1
+ddsamq1116 samequantum 0E-3 -0E-3 -> 1
+ddsamq1117 samequantum 0E-3 -0 -> 0
+ddsamq1118 samequantum 0E-3 -0E+3 -> 0
+ddsamq1119 samequantum 0E-3 0E-3 -> 1
+ddsamq1120 samequantum 0E-3 0 -> 0
+ddsamq1121 samequantum 0E-3 0E+3 -> 0
+ddsamq1122 samequantum 0E-3 7E-3 -> 1
+ddsamq1123 samequantum 0E-3 7 -> 0
+ddsamq1124 samequantum 0E-3 7E+3 -> 0
+ddsamq1125 samequantum 0E-3 sNaN -> 0
+
+ddsamq1210 samequantum 0 -Inf -> 0
+ddsamq1211 samequantum 0 Inf -> 0
+ddsamq1212 samequantum 0 NaN -> 0
+ddsamq1213 samequantum 0 -7E+3 -> 0
+ddsamq1214 samequantum 0 -7 -> 1
+ddsamq1215 samequantum 0 -7E-3 -> 0
+ddsamq1216 samequantum 0 -0E-3 -> 0
+ddsamq1217 samequantum 0 -0 -> 1
+ddsamq1218 samequantum 0 -0E+3 -> 0
+ddsamq1219 samequantum 0 0E-3 -> 0
+ddsamq1220 samequantum 0 0 -> 1
+ddsamq1221 samequantum 0 0E+3 -> 0
+ddsamq1222 samequantum 0 7E-3 -> 0
+ddsamq1223 samequantum 0 7 -> 1
+ddsamq1224 samequantum 0 7E+3 -> 0
+ddsamq1225 samequantum 0 sNaN -> 0
+
+ddsamq1310 samequantum 0E+3 -Inf -> 0
+ddsamq1311 samequantum 0E+3 Inf -> 0
+ddsamq1312 samequantum 0E+3 NaN -> 0
+ddsamq1313 samequantum 0E+3 -7E+3 -> 1
+ddsamq1314 samequantum 0E+3 -7 -> 0
+ddsamq1315 samequantum 0E+3 -7E-3 -> 0
+ddsamq1316 samequantum 0E+3 -0E-3 -> 0
+ddsamq1317 samequantum 0E+3 -0 -> 0
+ddsamq1318 samequantum 0E+3 -0E+3 -> 1
+ddsamq1319 samequantum 0E+3 0E-3 -> 0
+ddsamq1320 samequantum 0E+3 0 -> 0
+ddsamq1321 samequantum 0E+3 0E+3 -> 1
+ddsamq1322 samequantum 0E+3 7E-3 -> 0
+ddsamq1323 samequantum 0E+3 7 -> 0
+ddsamq1324 samequantum 0E+3 7E+3 -> 1
+ddsamq1325 samequantum 0E+3 sNaN -> 0
+
+ddsamq1410 samequantum 7E-3 -Inf -> 0
+ddsamq1411 samequantum 7E-3 Inf -> 0
+ddsamq1412 samequantum 7E-3 NaN -> 0
+ddsamq1413 samequantum 7E-3 -7E+3 -> 0
+ddsamq1414 samequantum 7E-3 -7 -> 0
+ddsamq1415 samequantum 7E-3 -7E-3 -> 1
+ddsamq1416 samequantum 7E-3 -0E-3 -> 1
+ddsamq1417 samequantum 7E-3 -0 -> 0
+ddsamq1418 samequantum 7E-3 -0E+3 -> 0
+ddsamq1419 samequantum 7E-3 0E-3 -> 1
+ddsamq1420 samequantum 7E-3 0 -> 0
+ddsamq1421 samequantum 7E-3 0E+3 -> 0
+ddsamq1422 samequantum 7E-3 7E-3 -> 1
+ddsamq1423 samequantum 7E-3 7 -> 0
+ddsamq1424 samequantum 7E-3 7E+3 -> 0
+ddsamq1425 samequantum 7E-3 sNaN -> 0
+
+ddsamq1510 samequantum 7 -Inf -> 0
+ddsamq1511 samequantum 7 Inf -> 0
+ddsamq1512 samequantum 7 NaN -> 0
+ddsamq1513 samequantum 7 -7E+3 -> 0
+ddsamq1514 samequantum 7 -7 -> 1
+ddsamq1515 samequantum 7 -7E-3 -> 0
+ddsamq1516 samequantum 7 -0E-3 -> 0
+ddsamq1517 samequantum 7 -0 -> 1
+ddsamq1518 samequantum 7 -0E+3 -> 0
+ddsamq1519 samequantum 7 0E-3 -> 0
+ddsamq1520 samequantum 7 0 -> 1
+ddsamq1521 samequantum 7 0E+3 -> 0
+ddsamq1522 samequantum 7 7E-3 -> 0
+ddsamq1523 samequantum 7 7 -> 1
+ddsamq1524 samequantum 7 7E+3 -> 0
+ddsamq1525 samequantum 7 sNaN -> 0
+
+ddsamq1610 samequantum 7E+3 -Inf -> 0
+ddsamq1611 samequantum 7E+3 Inf -> 0
+ddsamq1612 samequantum 7E+3 NaN -> 0
+ddsamq1613 samequantum 7E+3 -7E+3 -> 1
+ddsamq1614 samequantum 7E+3 -7 -> 0
+ddsamq1615 samequantum 7E+3 -7E-3 -> 0
+ddsamq1616 samequantum 7E+3 -0E-3 -> 0
+ddsamq1617 samequantum 7E+3 -0 -> 0
+ddsamq1618 samequantum 7E+3 -0E+3 -> 1
+ddsamq1619 samequantum 7E+3 0E-3 -> 0
+ddsamq1620 samequantum 7E+3 0 -> 0
+ddsamq1621 samequantum 7E+3 0E+3 -> 1
+ddsamq1622 samequantum 7E+3 7E-3 -> 0
+ddsamq1623 samequantum 7E+3 7 -> 0
+ddsamq1624 samequantum 7E+3 7E+3 -> 1
+ddsamq1625 samequantum 7E+3 sNaN -> 0
+
+ddsamq1710 samequantum sNaN -Inf -> 0
+ddsamq1711 samequantum sNaN Inf -> 0
+ddsamq1712 samequantum sNaN NaN -> 1
+ddsamq1713 samequantum sNaN -7E+3 -> 0
+ddsamq1714 samequantum sNaN -7 -> 0
+ddsamq1715 samequantum sNaN -7E-3 -> 0
+ddsamq1716 samequantum sNaN -0E-3 -> 0
+ddsamq1717 samequantum sNaN -0 -> 0
+ddsamq1718 samequantum sNaN -0E+3 -> 0
+ddsamq1719 samequantum sNaN 0E-3 -> 0
+ddsamq1720 samequantum sNaN 0 -> 0
+ddsamq1721 samequantum sNaN 0E+3 -> 0
+ddsamq1722 samequantum sNaN 7E-3 -> 0
+ddsamq1723 samequantum sNaN 7 -> 0
+ddsamq1724 samequantum sNaN 7E+3 -> 0
+ddsamq1725 samequantum sNaN sNaN -> 1
+-- noisy NaNs
+ddsamq1730 samequantum sNaN3 sNaN3 -> 1
+ddsamq1731 samequantum sNaN3 sNaN4 -> 1
+ddsamq1732 samequantum NaN3 NaN3 -> 1
+ddsamq1733 samequantum NaN3 NaN4 -> 1
+ddsamq1734 samequantum sNaN3 3 -> 0
+ddsamq1735 samequantum NaN3 3 -> 0
+ddsamq1736 samequantum 4 sNaN4 -> 0
+ddsamq1737 samequantum 3 NaN3 -> 0
+ddsamq1738 samequantum Inf sNaN4 -> 0
+ddsamq1739 samequantum -Inf NaN3 -> 0
+
diff --git a/Lib/test/decimaltestdata/ddScaleB.decTest b/Lib/test/decimaltestdata/ddScaleB.decTest
index 6ba3e3976f..edee11bccc 100644
--- a/Lib/test/decimaltestdata/ddScaleB.decTest
+++ b/Lib/test/decimaltestdata/ddScaleB.decTest
@@ -1,243 +1,243 @@
-------------------------------------------------------------------------
--- ddScalebB.decTest -- scale a decDouble by powers of 10 --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Max |rhs| is 2*(384+16) = 800
-
--- Sanity checks
-ddscb001 scaleb 7.50 10 -> 7.50E+10
-ddscb002 scaleb 7.50 3 -> 7.50E+3
-ddscb003 scaleb 7.50 2 -> 750
-ddscb004 scaleb 7.50 1 -> 75.0
-ddscb005 scaleb 7.50 0 -> 7.50
-ddscb006 scaleb 7.50 -1 -> 0.750
-ddscb007 scaleb 7.50 -2 -> 0.0750
-ddscb008 scaleb 7.50 -10 -> 7.50E-10
-ddscb009 scaleb -7.50 3 -> -7.50E+3
-ddscb010 scaleb -7.50 2 -> -750
-ddscb011 scaleb -7.50 1 -> -75.0
-ddscb012 scaleb -7.50 0 -> -7.50
-ddscb013 scaleb -7.50 -1 -> -0.750
-
--- Infinities
-ddscb014 scaleb Infinity 1 -> Infinity
-ddscb015 scaleb -Infinity 2 -> -Infinity
-ddscb016 scaleb Infinity -1 -> Infinity
-ddscb017 scaleb -Infinity -2 -> -Infinity
-
--- Next two are somewhat undefined in 754r; treat as non-integer
-ddscb018 scaleb 10 Infinity -> NaN Invalid_operation
-ddscb019 scaleb 10 -Infinity -> NaN Invalid_operation
-
--- NaNs are undefined in 754r; assume usual processing
--- NaNs, 0 payload
-ddscb021 scaleb NaN 1 -> NaN
-ddscb022 scaleb -NaN -1 -> -NaN
-ddscb023 scaleb sNaN 1 -> NaN Invalid_operation
-ddscb024 scaleb -sNaN 1 -> -NaN Invalid_operation
-ddscb025 scaleb 4 NaN -> NaN
-ddscb026 scaleb -Inf -NaN -> -NaN
-ddscb027 scaleb 4 sNaN -> NaN Invalid_operation
-ddscb028 scaleb Inf -sNaN -> -NaN Invalid_operation
-
--- non-integer RHS
-ddscb030 scaleb 1.23 1 -> 12.3
-ddscb031 scaleb 1.23 1.00 -> NaN Invalid_operation
-ddscb032 scaleb 1.23 1.1 -> NaN Invalid_operation
-ddscb033 scaleb 1.23 1.01 -> NaN Invalid_operation
-ddscb034 scaleb 1.23 0.01 -> NaN Invalid_operation
-ddscb035 scaleb 1.23 0.11 -> NaN Invalid_operation
-ddscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
-ddscb037 scaleb 1.23 -1 -> 0.123
-ddscb038 scaleb 1.23 -1.00 -> NaN Invalid_operation
-ddscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation
-ddscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation
-ddscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation
-ddscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation
-ddscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
-ddscb044 scaleb 1.23 0.1 -> NaN Invalid_operation
-ddscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation
-ddscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
-ddscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
-
--- out-of range RHS
-ddscb120 scaleb 1.23 799 -> Infinity Overflow Inexact Rounded
-ddscb121 scaleb 1.23 800 -> Infinity Overflow Inexact Rounded
-ddscb122 scaleb 1.23 801 -> NaN Invalid_operation
-ddscb123 scaleb 1.23 802 -> NaN Invalid_operation
-ddscb124 scaleb 1.23 -799 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddscb125 scaleb 1.23 -800 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddscb126 scaleb 1.23 -801 -> NaN Invalid_operation
-ddscb127 scaleb 1.23 -802 -> NaN Invalid_operation
-
--- NaNs, non-0 payload
--- propagating NaNs
-ddscb861 scaleb NaN01 -Inf -> NaN1
-ddscb862 scaleb -NaN02 -1000 -> -NaN2
-ddscb863 scaleb NaN03 1000 -> NaN3
-ddscb864 scaleb NaN04 Inf -> NaN4
-ddscb865 scaleb NaN05 NaN61 -> NaN5
-ddscb866 scaleb -Inf -NaN71 -> -NaN71
-ddscb867 scaleb -1000 NaN81 -> NaN81
-ddscb868 scaleb 1000 NaN91 -> NaN91
-ddscb869 scaleb Inf NaN101 -> NaN101
-ddscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
-ddscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
-ddscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
-ddscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
-ddscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
-ddscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
-ddscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
-ddscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
-ddscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
-ddscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
-ddscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- finites
-ddscb051 scaleb 7 -2 -> 0.07
-ddscb052 scaleb -7 -2 -> -0.07
-ddscb053 scaleb 75 -2 -> 0.75
-ddscb054 scaleb -75 -2 -> -0.75
-ddscb055 scaleb 7.50 -2 -> 0.0750
-ddscb056 scaleb -7.50 -2 -> -0.0750
-ddscb057 scaleb 7.500 -2 -> 0.07500
-ddscb058 scaleb -7.500 -2 -> -0.07500
-ddscb061 scaleb 7 -1 -> 0.7
-ddscb062 scaleb -7 -1 -> -0.7
-ddscb063 scaleb 75 -1 -> 7.5
-ddscb064 scaleb -75 -1 -> -7.5
-ddscb065 scaleb 7.50 -1 -> 0.750
-ddscb066 scaleb -7.50 -1 -> -0.750
-ddscb067 scaleb 7.500 -1 -> 0.7500
-ddscb068 scaleb -7.500 -1 -> -0.7500
-ddscb071 scaleb 7 0 -> 7
-ddscb072 scaleb -7 0 -> -7
-ddscb073 scaleb 75 0 -> 75
-ddscb074 scaleb -75 0 -> -75
-ddscb075 scaleb 7.50 0 -> 7.50
-ddscb076 scaleb -7.50 0 -> -7.50
-ddscb077 scaleb 7.500 0 -> 7.500
-ddscb078 scaleb -7.500 0 -> -7.500
-ddscb081 scaleb 7 1 -> 7E+1
-ddscb082 scaleb -7 1 -> -7E+1
-ddscb083 scaleb 75 1 -> 7.5E+2
-ddscb084 scaleb -75 1 -> -7.5E+2
-ddscb085 scaleb 7.50 1 -> 75.0
-ddscb086 scaleb -7.50 1 -> -75.0
-ddscb087 scaleb 7.500 1 -> 75.00
-ddscb088 scaleb -7.500 1 -> -75.00
-ddscb091 scaleb 7 2 -> 7E+2
-ddscb092 scaleb -7 2 -> -7E+2
-ddscb093 scaleb 75 2 -> 7.5E+3
-ddscb094 scaleb -75 2 -> -7.5E+3
-ddscb095 scaleb 7.50 2 -> 750
-ddscb096 scaleb -7.50 2 -> -750
-ddscb097 scaleb 7.500 2 -> 750.0
-ddscb098 scaleb -7.500 2 -> -750.0
-
--- zeros
-ddscb111 scaleb 0 1 -> 0E+1
-ddscb112 scaleb -0 2 -> -0E+2
-ddscb113 scaleb 0E+4 3 -> 0E+7
-ddscb114 scaleb -0E+4 4 -> -0E+8
-ddscb115 scaleb 0.0000 5 -> 0E+1
-ddscb116 scaleb -0.0000 6 -> -0E+2
-ddscb117 scaleb 0E-141 7 -> 0E-134
-ddscb118 scaleb -0E-141 8 -> -0E-133
-
--- Nmax, Nmin, Ntiny
-ddscb132 scaleb 9.999999999999999E+384 +384 -> Infinity Overflow Inexact Rounded
-ddscb133 scaleb 9.999999999999999E+384 +10 -> Infinity Overflow Inexact Rounded
-ddscb134 scaleb 9.999999999999999E+384 +1 -> Infinity Overflow Inexact Rounded
-ddscb135 scaleb 9.999999999999999E+384 0 -> 9.999999999999999E+384
-ddscb136 scaleb 9.999999999999999E+384 -1 -> 9.999999999999999E+383
-ddscb137 scaleb 1E-383 +1 -> 1E-382
-ddscb138 scaleb 1E-383 -0 -> 1E-383
-ddscb139 scaleb 1E-383 -1 -> 1E-384 Subnormal
-ddscb140 scaleb 1.000000000000000E-383 +1 -> 1.000000000000000E-382
-ddscb141 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
-ddscb142 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
-ddscb143 scaleb 1E-398 +1 -> 1E-397 Subnormal
-ddscb144 scaleb 1E-398 -0 -> 1E-398 Subnormal
-ddscb145 scaleb 1E-398 -1 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
-ddscb150 scaleb -1E-398 +1 -> -1E-397 Subnormal
-ddscb151 scaleb -1E-398 -0 -> -1E-398 Subnormal
-ddscb152 scaleb -1E-398 -1 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddscb153 scaleb -1.000000000000000E-383 +1 -> -1.000000000000000E-382
-ddscb154 scaleb -1.000000000000000E-383 +0 -> -1.000000000000000E-383
-ddscb155 scaleb -1.000000000000000E-383 -1 -> -1.00000000000000E-384 Subnormal Rounded
-ddscb156 scaleb -1E-383 +1 -> -1E-382
-ddscb157 scaleb -1E-383 -0 -> -1E-383
-ddscb158 scaleb -1E-383 -1 -> -1E-384 Subnormal
-ddscb159 scaleb -9.999999999999999E+384 +1 -> -Infinity Overflow Inexact Rounded
-ddscb160 scaleb -9.999999999999999E+384 +0 -> -9.999999999999999E+384
-ddscb161 scaleb -9.999999999999999E+384 -1 -> -9.999999999999999E+383
-ddscb162 scaleb -9E+384 +1 -> -Infinity Overflow Inexact Rounded
-ddscb163 scaleb -1E+384 +1 -> -Infinity Overflow Inexact Rounded
-
--- some Origami
--- (these check that overflow is being done correctly)
-ddscb171 scaleb 1000E+365 +1 -> 1.000E+369
-ddscb172 scaleb 1000E+366 +1 -> 1.000E+370
-ddscb173 scaleb 1000E+367 +1 -> 1.000E+371
-ddscb174 scaleb 1000E+368 +1 -> 1.000E+372
-ddscb175 scaleb 1000E+369 +1 -> 1.0000E+373 Clamped
-ddscb176 scaleb 1000E+370 +1 -> 1.00000E+374 Clamped
-ddscb177 scaleb 1000E+371 +1 -> 1.000000E+375 Clamped
-ddscb178 scaleb 1000E+372 +1 -> 1.0000000E+376 Clamped
-ddscb179 scaleb 1000E+373 +1 -> 1.00000000E+377 Clamped
-ddscb180 scaleb 1000E+374 +1 -> 1.000000000E+378 Clamped
-ddscb181 scaleb 1000E+375 +1 -> 1.0000000000E+379 Clamped
-ddscb182 scaleb 1000E+376 +1 -> 1.00000000000E+380 Clamped
-ddscb183 scaleb 1000E+377 +1 -> 1.000000000000E+381 Clamped
-ddscb184 scaleb 1000E+378 +1 -> 1.0000000000000E+382 Clamped
-ddscb185 scaleb 1000E+379 +1 -> 1.00000000000000E+383 Clamped
-ddscb186 scaleb 1000E+380 +1 -> 1.000000000000000E+384 Clamped
-ddscb187 scaleb 1000E+381 +1 -> Infinity Overflow Inexact Rounded
-
--- and a few more subnormal truncations
--- (these check that underflow is being done correctly)
-ddscb201 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
-ddscb202 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
-ddscb203 scaleb 1.000000000000000E-383 -2 -> 1.0000000000000E-385 Subnormal Rounded
-ddscb204 scaleb 1.000000000000000E-383 -3 -> 1.000000000000E-386 Subnormal Rounded
-ddscb205 scaleb 1.000000000000000E-383 -4 -> 1.00000000000E-387 Subnormal Rounded
-ddscb206 scaleb 1.000000000000000E-383 -5 -> 1.0000000000E-388 Subnormal Rounded
-ddscb207 scaleb 1.000000000000000E-383 -6 -> 1.000000000E-389 Subnormal Rounded
-ddscb208 scaleb 1.000000000000000E-383 -7 -> 1.00000000E-390 Subnormal Rounded
-ddscb209 scaleb 1.000000000000000E-383 -8 -> 1.0000000E-391 Subnormal Rounded
-ddscb210 scaleb 1.000000000000000E-383 -9 -> 1.000000E-392 Subnormal Rounded
-ddscb211 scaleb 1.000000000000000E-383 -10 -> 1.00000E-393 Subnormal Rounded
-ddscb212 scaleb 1.000000000000000E-383 -11 -> 1.0000E-394 Subnormal Rounded
-ddscb213 scaleb 1.000000000000000E-383 -12 -> 1.000E-395 Subnormal Rounded
-ddscb214 scaleb 1.000000000000000E-383 -13 -> 1.00E-396 Subnormal Rounded
-ddscb215 scaleb 1.000000000000000E-383 -14 -> 1.0E-397 Subnormal Rounded
-ddscb216 scaleb 1.000000000000000E-383 -15 -> 1E-398 Subnormal Rounded
-ddscb217 scaleb 1.000000000000000E-383 -16 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-ddscb218 scaleb 1.000000000000000E-383 -17 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
-
+------------------------------------------------------------------------
+-- ddScalebB.decTest -- scale a decDouble by powers of 10 --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Max |rhs| is 2*(384+16) = 800
+
+-- Sanity checks
+ddscb001 scaleb 7.50 10 -> 7.50E+10
+ddscb002 scaleb 7.50 3 -> 7.50E+3
+ddscb003 scaleb 7.50 2 -> 750
+ddscb004 scaleb 7.50 1 -> 75.0
+ddscb005 scaleb 7.50 0 -> 7.50
+ddscb006 scaleb 7.50 -1 -> 0.750
+ddscb007 scaleb 7.50 -2 -> 0.0750
+ddscb008 scaleb 7.50 -10 -> 7.50E-10
+ddscb009 scaleb -7.50 3 -> -7.50E+3
+ddscb010 scaleb -7.50 2 -> -750
+ddscb011 scaleb -7.50 1 -> -75.0
+ddscb012 scaleb -7.50 0 -> -7.50
+ddscb013 scaleb -7.50 -1 -> -0.750
+
+-- Infinities
+ddscb014 scaleb Infinity 1 -> Infinity
+ddscb015 scaleb -Infinity 2 -> -Infinity
+ddscb016 scaleb Infinity -1 -> Infinity
+ddscb017 scaleb -Infinity -2 -> -Infinity
+
+-- Next two are somewhat undefined in 754r; treat as non-integer
+ddscb018 scaleb 10 Infinity -> NaN Invalid_operation
+ddscb019 scaleb 10 -Infinity -> NaN Invalid_operation
+
+-- NaNs are undefined in 754r; assume usual processing
+-- NaNs, 0 payload
+ddscb021 scaleb NaN 1 -> NaN
+ddscb022 scaleb -NaN -1 -> -NaN
+ddscb023 scaleb sNaN 1 -> NaN Invalid_operation
+ddscb024 scaleb -sNaN 1 -> -NaN Invalid_operation
+ddscb025 scaleb 4 NaN -> NaN
+ddscb026 scaleb -Inf -NaN -> -NaN
+ddscb027 scaleb 4 sNaN -> NaN Invalid_operation
+ddscb028 scaleb Inf -sNaN -> -NaN Invalid_operation
+
+-- non-integer RHS
+ddscb030 scaleb 1.23 1 -> 12.3
+ddscb031 scaleb 1.23 1.00 -> NaN Invalid_operation
+ddscb032 scaleb 1.23 1.1 -> NaN Invalid_operation
+ddscb033 scaleb 1.23 1.01 -> NaN Invalid_operation
+ddscb034 scaleb 1.23 0.01 -> NaN Invalid_operation
+ddscb035 scaleb 1.23 0.11 -> NaN Invalid_operation
+ddscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
+ddscb037 scaleb 1.23 -1 -> 0.123
+ddscb038 scaleb 1.23 -1.00 -> NaN Invalid_operation
+ddscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation
+ddscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation
+ddscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation
+ddscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation
+ddscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
+ddscb044 scaleb 1.23 0.1 -> NaN Invalid_operation
+ddscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation
+ddscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
+ddscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
+
+-- out-of range RHS
+ddscb120 scaleb 1.23 799 -> Infinity Overflow Inexact Rounded
+ddscb121 scaleb 1.23 800 -> Infinity Overflow Inexact Rounded
+ddscb122 scaleb 1.23 801 -> NaN Invalid_operation
+ddscb123 scaleb 1.23 802 -> NaN Invalid_operation
+ddscb124 scaleb 1.23 -799 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddscb125 scaleb 1.23 -800 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddscb126 scaleb 1.23 -801 -> NaN Invalid_operation
+ddscb127 scaleb 1.23 -802 -> NaN Invalid_operation
+
+-- NaNs, non-0 payload
+-- propagating NaNs
+ddscb861 scaleb NaN01 -Inf -> NaN1
+ddscb862 scaleb -NaN02 -1000 -> -NaN2
+ddscb863 scaleb NaN03 1000 -> NaN3
+ddscb864 scaleb NaN04 Inf -> NaN4
+ddscb865 scaleb NaN05 NaN61 -> NaN5
+ddscb866 scaleb -Inf -NaN71 -> -NaN71
+ddscb867 scaleb -1000 NaN81 -> NaN81
+ddscb868 scaleb 1000 NaN91 -> NaN91
+ddscb869 scaleb Inf NaN101 -> NaN101
+ddscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
+ddscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
+ddscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
+ddscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
+ddscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
+ddscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
+ddscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
+ddscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
+ddscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
+ddscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
+ddscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- finites
+ddscb051 scaleb 7 -2 -> 0.07
+ddscb052 scaleb -7 -2 -> -0.07
+ddscb053 scaleb 75 -2 -> 0.75
+ddscb054 scaleb -75 -2 -> -0.75
+ddscb055 scaleb 7.50 -2 -> 0.0750
+ddscb056 scaleb -7.50 -2 -> -0.0750
+ddscb057 scaleb 7.500 -2 -> 0.07500
+ddscb058 scaleb -7.500 -2 -> -0.07500
+ddscb061 scaleb 7 -1 -> 0.7
+ddscb062 scaleb -7 -1 -> -0.7
+ddscb063 scaleb 75 -1 -> 7.5
+ddscb064 scaleb -75 -1 -> -7.5
+ddscb065 scaleb 7.50 -1 -> 0.750
+ddscb066 scaleb -7.50 -1 -> -0.750
+ddscb067 scaleb 7.500 -1 -> 0.7500
+ddscb068 scaleb -7.500 -1 -> -0.7500
+ddscb071 scaleb 7 0 -> 7
+ddscb072 scaleb -7 0 -> -7
+ddscb073 scaleb 75 0 -> 75
+ddscb074 scaleb -75 0 -> -75
+ddscb075 scaleb 7.50 0 -> 7.50
+ddscb076 scaleb -7.50 0 -> -7.50
+ddscb077 scaleb 7.500 0 -> 7.500
+ddscb078 scaleb -7.500 0 -> -7.500
+ddscb081 scaleb 7 1 -> 7E+1
+ddscb082 scaleb -7 1 -> -7E+1
+ddscb083 scaleb 75 1 -> 7.5E+2
+ddscb084 scaleb -75 1 -> -7.5E+2
+ddscb085 scaleb 7.50 1 -> 75.0
+ddscb086 scaleb -7.50 1 -> -75.0
+ddscb087 scaleb 7.500 1 -> 75.00
+ddscb088 scaleb -7.500 1 -> -75.00
+ddscb091 scaleb 7 2 -> 7E+2
+ddscb092 scaleb -7 2 -> -7E+2
+ddscb093 scaleb 75 2 -> 7.5E+3
+ddscb094 scaleb -75 2 -> -7.5E+3
+ddscb095 scaleb 7.50 2 -> 750
+ddscb096 scaleb -7.50 2 -> -750
+ddscb097 scaleb 7.500 2 -> 750.0
+ddscb098 scaleb -7.500 2 -> -750.0
+
+-- zeros
+ddscb111 scaleb 0 1 -> 0E+1
+ddscb112 scaleb -0 2 -> -0E+2
+ddscb113 scaleb 0E+4 3 -> 0E+7
+ddscb114 scaleb -0E+4 4 -> -0E+8
+ddscb115 scaleb 0.0000 5 -> 0E+1
+ddscb116 scaleb -0.0000 6 -> -0E+2
+ddscb117 scaleb 0E-141 7 -> 0E-134
+ddscb118 scaleb -0E-141 8 -> -0E-133
+
+-- Nmax, Nmin, Ntiny
+ddscb132 scaleb 9.999999999999999E+384 +384 -> Infinity Overflow Inexact Rounded
+ddscb133 scaleb 9.999999999999999E+384 +10 -> Infinity Overflow Inexact Rounded
+ddscb134 scaleb 9.999999999999999E+384 +1 -> Infinity Overflow Inexact Rounded
+ddscb135 scaleb 9.999999999999999E+384 0 -> 9.999999999999999E+384
+ddscb136 scaleb 9.999999999999999E+384 -1 -> 9.999999999999999E+383
+ddscb137 scaleb 1E-383 +1 -> 1E-382
+ddscb138 scaleb 1E-383 -0 -> 1E-383
+ddscb139 scaleb 1E-383 -1 -> 1E-384 Subnormal
+ddscb140 scaleb 1.000000000000000E-383 +1 -> 1.000000000000000E-382
+ddscb141 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
+ddscb142 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
+ddscb143 scaleb 1E-398 +1 -> 1E-397 Subnormal
+ddscb144 scaleb 1E-398 -0 -> 1E-398 Subnormal
+ddscb145 scaleb 1E-398 -1 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
+ddscb150 scaleb -1E-398 +1 -> -1E-397 Subnormal
+ddscb151 scaleb -1E-398 -0 -> -1E-398 Subnormal
+ddscb152 scaleb -1E-398 -1 -> -0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddscb153 scaleb -1.000000000000000E-383 +1 -> -1.000000000000000E-382
+ddscb154 scaleb -1.000000000000000E-383 +0 -> -1.000000000000000E-383
+ddscb155 scaleb -1.000000000000000E-383 -1 -> -1.00000000000000E-384 Subnormal Rounded
+ddscb156 scaleb -1E-383 +1 -> -1E-382
+ddscb157 scaleb -1E-383 -0 -> -1E-383
+ddscb158 scaleb -1E-383 -1 -> -1E-384 Subnormal
+ddscb159 scaleb -9.999999999999999E+384 +1 -> -Infinity Overflow Inexact Rounded
+ddscb160 scaleb -9.999999999999999E+384 +0 -> -9.999999999999999E+384
+ddscb161 scaleb -9.999999999999999E+384 -1 -> -9.999999999999999E+383
+ddscb162 scaleb -9E+384 +1 -> -Infinity Overflow Inexact Rounded
+ddscb163 scaleb -1E+384 +1 -> -Infinity Overflow Inexact Rounded
+
+-- some Origami
+-- (these check that overflow is being done correctly)
+ddscb171 scaleb 1000E+365 +1 -> 1.000E+369
+ddscb172 scaleb 1000E+366 +1 -> 1.000E+370
+ddscb173 scaleb 1000E+367 +1 -> 1.000E+371
+ddscb174 scaleb 1000E+368 +1 -> 1.000E+372
+ddscb175 scaleb 1000E+369 +1 -> 1.0000E+373 Clamped
+ddscb176 scaleb 1000E+370 +1 -> 1.00000E+374 Clamped
+ddscb177 scaleb 1000E+371 +1 -> 1.000000E+375 Clamped
+ddscb178 scaleb 1000E+372 +1 -> 1.0000000E+376 Clamped
+ddscb179 scaleb 1000E+373 +1 -> 1.00000000E+377 Clamped
+ddscb180 scaleb 1000E+374 +1 -> 1.000000000E+378 Clamped
+ddscb181 scaleb 1000E+375 +1 -> 1.0000000000E+379 Clamped
+ddscb182 scaleb 1000E+376 +1 -> 1.00000000000E+380 Clamped
+ddscb183 scaleb 1000E+377 +1 -> 1.000000000000E+381 Clamped
+ddscb184 scaleb 1000E+378 +1 -> 1.0000000000000E+382 Clamped
+ddscb185 scaleb 1000E+379 +1 -> 1.00000000000000E+383 Clamped
+ddscb186 scaleb 1000E+380 +1 -> 1.000000000000000E+384 Clamped
+ddscb187 scaleb 1000E+381 +1 -> Infinity Overflow Inexact Rounded
+
+-- and a few more subnormal truncations
+-- (these check that underflow is being done correctly)
+ddscb201 scaleb 1.000000000000000E-383 0 -> 1.000000000000000E-383
+ddscb202 scaleb 1.000000000000000E-383 -1 -> 1.00000000000000E-384 Subnormal Rounded
+ddscb203 scaleb 1.000000000000000E-383 -2 -> 1.0000000000000E-385 Subnormal Rounded
+ddscb204 scaleb 1.000000000000000E-383 -3 -> 1.000000000000E-386 Subnormal Rounded
+ddscb205 scaleb 1.000000000000000E-383 -4 -> 1.00000000000E-387 Subnormal Rounded
+ddscb206 scaleb 1.000000000000000E-383 -5 -> 1.0000000000E-388 Subnormal Rounded
+ddscb207 scaleb 1.000000000000000E-383 -6 -> 1.000000000E-389 Subnormal Rounded
+ddscb208 scaleb 1.000000000000000E-383 -7 -> 1.00000000E-390 Subnormal Rounded
+ddscb209 scaleb 1.000000000000000E-383 -8 -> 1.0000000E-391 Subnormal Rounded
+ddscb210 scaleb 1.000000000000000E-383 -9 -> 1.000000E-392 Subnormal Rounded
+ddscb211 scaleb 1.000000000000000E-383 -10 -> 1.00000E-393 Subnormal Rounded
+ddscb212 scaleb 1.000000000000000E-383 -11 -> 1.0000E-394 Subnormal Rounded
+ddscb213 scaleb 1.000000000000000E-383 -12 -> 1.000E-395 Subnormal Rounded
+ddscb214 scaleb 1.000000000000000E-383 -13 -> 1.00E-396 Subnormal Rounded
+ddscb215 scaleb 1.000000000000000E-383 -14 -> 1.0E-397 Subnormal Rounded
+ddscb216 scaleb 1.000000000000000E-383 -15 -> 1E-398 Subnormal Rounded
+ddscb217 scaleb 1.000000000000000E-383 -16 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+ddscb218 scaleb 1.000000000000000E-383 -17 -> 0E-398 Underflow Subnormal Inexact Rounded Clamped
+
diff --git a/Lib/test/decimaltestdata/ddShift.decTest b/Lib/test/decimaltestdata/ddShift.decTest
index ec472403e6..f62a236b2e 100644
--- a/Lib/test/decimaltestdata/ddShift.decTest
+++ b/Lib/test/decimaltestdata/ddShift.decTest
@@ -1,262 +1,262 @@
-------------------------------------------------------------------------
--- ddShift.decTest -- shift decDouble coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check
-ddshi001 shift 0 0 -> 0
-ddshi002 shift 0 2 -> 0
-ddshi003 shift 1 2 -> 100
-ddshi004 shift 1 15 -> 1000000000000000
-ddshi005 shift 1 16 -> 0
-ddshi006 shift 1 -1 -> 0
-ddshi007 shift 0 -2 -> 0
-ddshi008 shift 1234567890123456 -1 -> 123456789012345
-ddshi009 shift 1234567890123456 -15 -> 1
-ddshi010 shift 1234567890123456 -16 -> 0
-ddshi011 shift 9934567890123456 -15 -> 9
-ddshi012 shift 9934567890123456 -16 -> 0
-
--- rhs must be an integer
-ddshi015 shift 1 1.5 -> NaN Invalid_operation
-ddshi016 shift 1 1.0 -> NaN Invalid_operation
-ddshi017 shift 1 0.1 -> NaN Invalid_operation
-ddshi018 shift 1 0.0 -> NaN Invalid_operation
-ddshi019 shift 1 1E+1 -> NaN Invalid_operation
-ddshi020 shift 1 1E+99 -> NaN Invalid_operation
-ddshi021 shift 1 Inf -> NaN Invalid_operation
-ddshi022 shift 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-ddshi025 shift 1 -1000 -> NaN Invalid_operation
-ddshi026 shift 1 -17 -> NaN Invalid_operation
-ddshi027 shift 1 17 -> NaN Invalid_operation
-ddshi028 shift 1 1000 -> NaN Invalid_operation
-
--- full shifting pattern
-ddshi030 shift 1234567890123456 -16 -> 0
-ddshi031 shift 1234567890123456 -15 -> 1
-ddshi032 shift 1234567890123456 -14 -> 12
-ddshi033 shift 1234567890123456 -13 -> 123
-ddshi034 shift 1234567890123456 -12 -> 1234
-ddshi035 shift 1234567890123456 -11 -> 12345
-ddshi036 shift 1234567890123456 -10 -> 123456
-ddshi037 shift 1234567890123456 -9 -> 1234567
-ddshi038 shift 1234567890123456 -8 -> 12345678
-ddshi039 shift 1234567890123456 -7 -> 123456789
-ddshi040 shift 1234567890123456 -6 -> 1234567890
-ddshi041 shift 1234567890123456 -5 -> 12345678901
-ddshi042 shift 1234567890123456 -4 -> 123456789012
-ddshi043 shift 1234567890123456 -3 -> 1234567890123
-ddshi044 shift 1234567890123456 -2 -> 12345678901234
-ddshi045 shift 1234567890123456 -1 -> 123456789012345
-ddshi046 shift 1234567890123456 -0 -> 1234567890123456
-
-ddshi047 shift 1234567890123456 +0 -> 1234567890123456
-ddshi048 shift 1234567890123456 +1 -> 2345678901234560
-ddshi049 shift 1234567890123456 +2 -> 3456789012345600
-ddshi050 shift 1234567890123456 +3 -> 4567890123456000
-ddshi051 shift 1234567890123456 +4 -> 5678901234560000
-ddshi052 shift 1234567890123456 +5 -> 6789012345600000
-ddshi053 shift 1234567890123456 +6 -> 7890123456000000
-ddshi054 shift 1234567890123456 +7 -> 8901234560000000
-ddshi055 shift 1234567890123456 +8 -> 9012345600000000
-ddshi056 shift 1234567890123456 +9 -> 123456000000000
-ddshi057 shift 1234567890123456 +10 -> 1234560000000000
-ddshi058 shift 1234567890123456 +11 -> 2345600000000000
-ddshi059 shift 1234567890123456 +12 -> 3456000000000000
-ddshi060 shift 1234567890123456 +13 -> 4560000000000000
-ddshi061 shift 1234567890123456 +14 -> 5600000000000000
-ddshi062 shift 1234567890123456 +15 -> 6000000000000000
-ddshi063 shift 1234567890123456 +16 -> 0
-
--- zeros
-ddshi070 shift 0E-10 +9 -> 0E-10
-ddshi071 shift 0E-10 -9 -> 0E-10
-ddshi072 shift 0.000 +9 -> 0.000
-ddshi073 shift 0.000 -9 -> 0.000
-ddshi074 shift 0E+10 +9 -> 0E+10
-ddshi075 shift 0E+10 -9 -> 0E+10
-ddshi076 shift -0E-10 +9 -> -0E-10
-ddshi077 shift -0E-10 -9 -> -0E-10
-ddshi078 shift -0.000 +9 -> -0.000
-ddshi079 shift -0.000 -9 -> -0.000
-ddshi080 shift -0E+10 +9 -> -0E+10
-ddshi081 shift -0E+10 -9 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-ddshi141 shift 9.999999999999999E+384 -1 -> 9.99999999999999E+383
-ddshi142 shift 9.999999999999999E+384 -15 -> 9E+369
-ddshi143 shift 9.999999999999999E+384 1 -> 9.999999999999990E+384
-ddshi144 shift 9.999999999999999E+384 15 -> 9.000000000000000E+384
-ddshi145 shift 1E-383 -1 -> 0E-383
-ddshi146 shift 1E-383 -15 -> 0E-383
-ddshi147 shift 1E-383 1 -> 1.0E-382
-ddshi148 shift 1E-383 15 -> 1.000000000000000E-368
-ddshi151 shift 1.000000000000000E-383 -1 -> 1.00000000000000E-384
-ddshi152 shift 1.000000000000000E-383 -15 -> 1E-398
-ddshi153 shift 1.000000000000000E-383 1 -> 0E-398
-ddshi154 shift 1.000000000000000E-383 15 -> 0E-398
-ddshi155 shift 9.000000000000000E-383 -1 -> 9.00000000000000E-384
-ddshi156 shift 9.000000000000000E-383 -15 -> 9E-398
-ddshi157 shift 9.000000000000000E-383 1 -> 0E-398
-ddshi158 shift 9.000000000000000E-383 15 -> 0E-398
-ddshi160 shift 1E-398 -1 -> 0E-398
-ddshi161 shift 1E-398 -15 -> 0E-398
-ddshi162 shift 1E-398 1 -> 1.0E-397
-ddshi163 shift 1E-398 15 -> 1.000000000000000E-383
--- negatives
-ddshi171 shift -9.999999999999999E+384 -1 -> -9.99999999999999E+383
-ddshi172 shift -9.999999999999999E+384 -15 -> -9E+369
-ddshi173 shift -9.999999999999999E+384 1 -> -9.999999999999990E+384
-ddshi174 shift -9.999999999999999E+384 15 -> -9.000000000000000E+384
-ddshi175 shift -1E-383 -1 -> -0E-383
-ddshi176 shift -1E-383 -15 -> -0E-383
-ddshi177 shift -1E-383 1 -> -1.0E-382
-ddshi178 shift -1E-383 15 -> -1.000000000000000E-368
-ddshi181 shift -1.000000000000000E-383 -1 -> -1.00000000000000E-384
-ddshi182 shift -1.000000000000000E-383 -15 -> -1E-398
-ddshi183 shift -1.000000000000000E-383 1 -> -0E-398
-ddshi184 shift -1.000000000000000E-383 15 -> -0E-398
-ddshi185 shift -9.000000000000000E-383 -1 -> -9.00000000000000E-384
-ddshi186 shift -9.000000000000000E-383 -15 -> -9E-398
-ddshi187 shift -9.000000000000000E-383 1 -> -0E-398
-ddshi188 shift -9.000000000000000E-383 15 -> -0E-398
-ddshi190 shift -1E-398 -1 -> -0E-398
-ddshi191 shift -1E-398 -15 -> -0E-398
-ddshi192 shift -1E-398 1 -> -1.0E-397
-ddshi193 shift -1E-398 15 -> -1.000000000000000E-383
-
--- more negatives (of sanities)
-ddshi201 shift -0 0 -> -0
-ddshi202 shift -0 2 -> -0
-ddshi203 shift -1 2 -> -100
-ddshi204 shift -1 15 -> -1000000000000000
-ddshi205 shift -1 16 -> -0
-ddshi206 shift -1 -1 -> -0
-ddshi207 shift -0 -2 -> -0
-ddshi208 shift -1234567890123456 -1 -> -123456789012345
-ddshi209 shift -1234567890123456 -15 -> -1
-ddshi210 shift -1234567890123456 -16 -> -0
-ddshi211 shift -9934567890123456 -15 -> -9
-ddshi212 shift -9934567890123456 -16 -> -0
-
-
--- Specials; NaNs are handled as usual
-ddshi781 shift -Inf -8 -> -Infinity
-ddshi782 shift -Inf -1 -> -Infinity
-ddshi783 shift -Inf -0 -> -Infinity
-ddshi784 shift -Inf 0 -> -Infinity
-ddshi785 shift -Inf 1 -> -Infinity
-ddshi786 shift -Inf 8 -> -Infinity
-ddshi787 shift -1000 -Inf -> NaN Invalid_operation
-ddshi788 shift -Inf -Inf -> NaN Invalid_operation
-ddshi789 shift -1 -Inf -> NaN Invalid_operation
-ddshi790 shift -0 -Inf -> NaN Invalid_operation
-ddshi791 shift 0 -Inf -> NaN Invalid_operation
-ddshi792 shift 1 -Inf -> NaN Invalid_operation
-ddshi793 shift 1000 -Inf -> NaN Invalid_operation
-ddshi794 shift Inf -Inf -> NaN Invalid_operation
-
-ddshi800 shift Inf -Inf -> NaN Invalid_operation
-ddshi801 shift Inf -8 -> Infinity
-ddshi802 shift Inf -1 -> Infinity
-ddshi803 shift Inf -0 -> Infinity
-ddshi804 shift Inf 0 -> Infinity
-ddshi805 shift Inf 1 -> Infinity
-ddshi806 shift Inf 8 -> Infinity
-ddshi807 shift Inf Inf -> NaN Invalid_operation
-ddshi808 shift -1000 Inf -> NaN Invalid_operation
-ddshi809 shift -Inf Inf -> NaN Invalid_operation
-ddshi810 shift -1 Inf -> NaN Invalid_operation
-ddshi811 shift -0 Inf -> NaN Invalid_operation
-ddshi812 shift 0 Inf -> NaN Invalid_operation
-ddshi813 shift 1 Inf -> NaN Invalid_operation
-ddshi814 shift 1000 Inf -> NaN Invalid_operation
-ddshi815 shift Inf Inf -> NaN Invalid_operation
-
-ddshi821 shift NaN -Inf -> NaN
-ddshi822 shift NaN -1000 -> NaN
-ddshi823 shift NaN -1 -> NaN
-ddshi824 shift NaN -0 -> NaN
-ddshi825 shift NaN 0 -> NaN
-ddshi826 shift NaN 1 -> NaN
-ddshi827 shift NaN 1000 -> NaN
-ddshi828 shift NaN Inf -> NaN
-ddshi829 shift NaN NaN -> NaN
-ddshi830 shift -Inf NaN -> NaN
-ddshi831 shift -1000 NaN -> NaN
-ddshi832 shift -1 NaN -> NaN
-ddshi833 shift -0 NaN -> NaN
-ddshi834 shift 0 NaN -> NaN
-ddshi835 shift 1 NaN -> NaN
-ddshi836 shift 1000 NaN -> NaN
-ddshi837 shift Inf NaN -> NaN
-
-ddshi841 shift sNaN -Inf -> NaN Invalid_operation
-ddshi842 shift sNaN -1000 -> NaN Invalid_operation
-ddshi843 shift sNaN -1 -> NaN Invalid_operation
-ddshi844 shift sNaN -0 -> NaN Invalid_operation
-ddshi845 shift sNaN 0 -> NaN Invalid_operation
-ddshi846 shift sNaN 1 -> NaN Invalid_operation
-ddshi847 shift sNaN 1000 -> NaN Invalid_operation
-ddshi848 shift sNaN NaN -> NaN Invalid_operation
-ddshi849 shift sNaN sNaN -> NaN Invalid_operation
-ddshi850 shift NaN sNaN -> NaN Invalid_operation
-ddshi851 shift -Inf sNaN -> NaN Invalid_operation
-ddshi852 shift -1000 sNaN -> NaN Invalid_operation
-ddshi853 shift -1 sNaN -> NaN Invalid_operation
-ddshi854 shift -0 sNaN -> NaN Invalid_operation
-ddshi855 shift 0 sNaN -> NaN Invalid_operation
-ddshi856 shift 1 sNaN -> NaN Invalid_operation
-ddshi857 shift 1000 sNaN -> NaN Invalid_operation
-ddshi858 shift Inf sNaN -> NaN Invalid_operation
-ddshi859 shift NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddshi861 shift NaN1 -Inf -> NaN1
-ddshi862 shift +NaN2 -1000 -> NaN2
-ddshi863 shift NaN3 1000 -> NaN3
-ddshi864 shift NaN4 Inf -> NaN4
-ddshi865 shift NaN5 +NaN6 -> NaN5
-ddshi866 shift -Inf NaN7 -> NaN7
-ddshi867 shift -1000 NaN8 -> NaN8
-ddshi868 shift 1000 NaN9 -> NaN9
-ddshi869 shift Inf +NaN10 -> NaN10
-ddshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation
-ddshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation
-ddshi873 shift sNaN13 1000 -> NaN13 Invalid_operation
-ddshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
-ddshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
-ddshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
-ddshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
-ddshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation
-ddshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation
-ddshi880 shift Inf sNaN23 -> NaN23 Invalid_operation
-ddshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
-ddshi882 shift -NaN26 NaN28 -> -NaN26
-ddshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-ddshi884 shift 1000 -NaN30 -> -NaN30
-ddshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- ddShift.decTest -- shift decDouble coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check
+ddshi001 shift 0 0 -> 0
+ddshi002 shift 0 2 -> 0
+ddshi003 shift 1 2 -> 100
+ddshi004 shift 1 15 -> 1000000000000000
+ddshi005 shift 1 16 -> 0
+ddshi006 shift 1 -1 -> 0
+ddshi007 shift 0 -2 -> 0
+ddshi008 shift 1234567890123456 -1 -> 123456789012345
+ddshi009 shift 1234567890123456 -15 -> 1
+ddshi010 shift 1234567890123456 -16 -> 0
+ddshi011 shift 9934567890123456 -15 -> 9
+ddshi012 shift 9934567890123456 -16 -> 0
+
+-- rhs must be an integer
+ddshi015 shift 1 1.5 -> NaN Invalid_operation
+ddshi016 shift 1 1.0 -> NaN Invalid_operation
+ddshi017 shift 1 0.1 -> NaN Invalid_operation
+ddshi018 shift 1 0.0 -> NaN Invalid_operation
+ddshi019 shift 1 1E+1 -> NaN Invalid_operation
+ddshi020 shift 1 1E+99 -> NaN Invalid_operation
+ddshi021 shift 1 Inf -> NaN Invalid_operation
+ddshi022 shift 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+ddshi025 shift 1 -1000 -> NaN Invalid_operation
+ddshi026 shift 1 -17 -> NaN Invalid_operation
+ddshi027 shift 1 17 -> NaN Invalid_operation
+ddshi028 shift 1 1000 -> NaN Invalid_operation
+
+-- full shifting pattern
+ddshi030 shift 1234567890123456 -16 -> 0
+ddshi031 shift 1234567890123456 -15 -> 1
+ddshi032 shift 1234567890123456 -14 -> 12
+ddshi033 shift 1234567890123456 -13 -> 123
+ddshi034 shift 1234567890123456 -12 -> 1234
+ddshi035 shift 1234567890123456 -11 -> 12345
+ddshi036 shift 1234567890123456 -10 -> 123456
+ddshi037 shift 1234567890123456 -9 -> 1234567
+ddshi038 shift 1234567890123456 -8 -> 12345678
+ddshi039 shift 1234567890123456 -7 -> 123456789
+ddshi040 shift 1234567890123456 -6 -> 1234567890
+ddshi041 shift 1234567890123456 -5 -> 12345678901
+ddshi042 shift 1234567890123456 -4 -> 123456789012
+ddshi043 shift 1234567890123456 -3 -> 1234567890123
+ddshi044 shift 1234567890123456 -2 -> 12345678901234
+ddshi045 shift 1234567890123456 -1 -> 123456789012345
+ddshi046 shift 1234567890123456 -0 -> 1234567890123456
+
+ddshi047 shift 1234567890123456 +0 -> 1234567890123456
+ddshi048 shift 1234567890123456 +1 -> 2345678901234560
+ddshi049 shift 1234567890123456 +2 -> 3456789012345600
+ddshi050 shift 1234567890123456 +3 -> 4567890123456000
+ddshi051 shift 1234567890123456 +4 -> 5678901234560000
+ddshi052 shift 1234567890123456 +5 -> 6789012345600000
+ddshi053 shift 1234567890123456 +6 -> 7890123456000000
+ddshi054 shift 1234567890123456 +7 -> 8901234560000000
+ddshi055 shift 1234567890123456 +8 -> 9012345600000000
+ddshi056 shift 1234567890123456 +9 -> 123456000000000
+ddshi057 shift 1234567890123456 +10 -> 1234560000000000
+ddshi058 shift 1234567890123456 +11 -> 2345600000000000
+ddshi059 shift 1234567890123456 +12 -> 3456000000000000
+ddshi060 shift 1234567890123456 +13 -> 4560000000000000
+ddshi061 shift 1234567890123456 +14 -> 5600000000000000
+ddshi062 shift 1234567890123456 +15 -> 6000000000000000
+ddshi063 shift 1234567890123456 +16 -> 0
+
+-- zeros
+ddshi070 shift 0E-10 +9 -> 0E-10
+ddshi071 shift 0E-10 -9 -> 0E-10
+ddshi072 shift 0.000 +9 -> 0.000
+ddshi073 shift 0.000 -9 -> 0.000
+ddshi074 shift 0E+10 +9 -> 0E+10
+ddshi075 shift 0E+10 -9 -> 0E+10
+ddshi076 shift -0E-10 +9 -> -0E-10
+ddshi077 shift -0E-10 -9 -> -0E-10
+ddshi078 shift -0.000 +9 -> -0.000
+ddshi079 shift -0.000 -9 -> -0.000
+ddshi080 shift -0E+10 +9 -> -0E+10
+ddshi081 shift -0E+10 -9 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+ddshi141 shift 9.999999999999999E+384 -1 -> 9.99999999999999E+383
+ddshi142 shift 9.999999999999999E+384 -15 -> 9E+369
+ddshi143 shift 9.999999999999999E+384 1 -> 9.999999999999990E+384
+ddshi144 shift 9.999999999999999E+384 15 -> 9.000000000000000E+384
+ddshi145 shift 1E-383 -1 -> 0E-383
+ddshi146 shift 1E-383 -15 -> 0E-383
+ddshi147 shift 1E-383 1 -> 1.0E-382
+ddshi148 shift 1E-383 15 -> 1.000000000000000E-368
+ddshi151 shift 1.000000000000000E-383 -1 -> 1.00000000000000E-384
+ddshi152 shift 1.000000000000000E-383 -15 -> 1E-398
+ddshi153 shift 1.000000000000000E-383 1 -> 0E-398
+ddshi154 shift 1.000000000000000E-383 15 -> 0E-398
+ddshi155 shift 9.000000000000000E-383 -1 -> 9.00000000000000E-384
+ddshi156 shift 9.000000000000000E-383 -15 -> 9E-398
+ddshi157 shift 9.000000000000000E-383 1 -> 0E-398
+ddshi158 shift 9.000000000000000E-383 15 -> 0E-398
+ddshi160 shift 1E-398 -1 -> 0E-398
+ddshi161 shift 1E-398 -15 -> 0E-398
+ddshi162 shift 1E-398 1 -> 1.0E-397
+ddshi163 shift 1E-398 15 -> 1.000000000000000E-383
+-- negatives
+ddshi171 shift -9.999999999999999E+384 -1 -> -9.99999999999999E+383
+ddshi172 shift -9.999999999999999E+384 -15 -> -9E+369
+ddshi173 shift -9.999999999999999E+384 1 -> -9.999999999999990E+384
+ddshi174 shift -9.999999999999999E+384 15 -> -9.000000000000000E+384
+ddshi175 shift -1E-383 -1 -> -0E-383
+ddshi176 shift -1E-383 -15 -> -0E-383
+ddshi177 shift -1E-383 1 -> -1.0E-382
+ddshi178 shift -1E-383 15 -> -1.000000000000000E-368
+ddshi181 shift -1.000000000000000E-383 -1 -> -1.00000000000000E-384
+ddshi182 shift -1.000000000000000E-383 -15 -> -1E-398
+ddshi183 shift -1.000000000000000E-383 1 -> -0E-398
+ddshi184 shift -1.000000000000000E-383 15 -> -0E-398
+ddshi185 shift -9.000000000000000E-383 -1 -> -9.00000000000000E-384
+ddshi186 shift -9.000000000000000E-383 -15 -> -9E-398
+ddshi187 shift -9.000000000000000E-383 1 -> -0E-398
+ddshi188 shift -9.000000000000000E-383 15 -> -0E-398
+ddshi190 shift -1E-398 -1 -> -0E-398
+ddshi191 shift -1E-398 -15 -> -0E-398
+ddshi192 shift -1E-398 1 -> -1.0E-397
+ddshi193 shift -1E-398 15 -> -1.000000000000000E-383
+
+-- more negatives (of sanities)
+ddshi201 shift -0 0 -> -0
+ddshi202 shift -0 2 -> -0
+ddshi203 shift -1 2 -> -100
+ddshi204 shift -1 15 -> -1000000000000000
+ddshi205 shift -1 16 -> -0
+ddshi206 shift -1 -1 -> -0
+ddshi207 shift -0 -2 -> -0
+ddshi208 shift -1234567890123456 -1 -> -123456789012345
+ddshi209 shift -1234567890123456 -15 -> -1
+ddshi210 shift -1234567890123456 -16 -> -0
+ddshi211 shift -9934567890123456 -15 -> -9
+ddshi212 shift -9934567890123456 -16 -> -0
+
+
+-- Specials; NaNs are handled as usual
+ddshi781 shift -Inf -8 -> -Infinity
+ddshi782 shift -Inf -1 -> -Infinity
+ddshi783 shift -Inf -0 -> -Infinity
+ddshi784 shift -Inf 0 -> -Infinity
+ddshi785 shift -Inf 1 -> -Infinity
+ddshi786 shift -Inf 8 -> -Infinity
+ddshi787 shift -1000 -Inf -> NaN Invalid_operation
+ddshi788 shift -Inf -Inf -> NaN Invalid_operation
+ddshi789 shift -1 -Inf -> NaN Invalid_operation
+ddshi790 shift -0 -Inf -> NaN Invalid_operation
+ddshi791 shift 0 -Inf -> NaN Invalid_operation
+ddshi792 shift 1 -Inf -> NaN Invalid_operation
+ddshi793 shift 1000 -Inf -> NaN Invalid_operation
+ddshi794 shift Inf -Inf -> NaN Invalid_operation
+
+ddshi800 shift Inf -Inf -> NaN Invalid_operation
+ddshi801 shift Inf -8 -> Infinity
+ddshi802 shift Inf -1 -> Infinity
+ddshi803 shift Inf -0 -> Infinity
+ddshi804 shift Inf 0 -> Infinity
+ddshi805 shift Inf 1 -> Infinity
+ddshi806 shift Inf 8 -> Infinity
+ddshi807 shift Inf Inf -> NaN Invalid_operation
+ddshi808 shift -1000 Inf -> NaN Invalid_operation
+ddshi809 shift -Inf Inf -> NaN Invalid_operation
+ddshi810 shift -1 Inf -> NaN Invalid_operation
+ddshi811 shift -0 Inf -> NaN Invalid_operation
+ddshi812 shift 0 Inf -> NaN Invalid_operation
+ddshi813 shift 1 Inf -> NaN Invalid_operation
+ddshi814 shift 1000 Inf -> NaN Invalid_operation
+ddshi815 shift Inf Inf -> NaN Invalid_operation
+
+ddshi821 shift NaN -Inf -> NaN
+ddshi822 shift NaN -1000 -> NaN
+ddshi823 shift NaN -1 -> NaN
+ddshi824 shift NaN -0 -> NaN
+ddshi825 shift NaN 0 -> NaN
+ddshi826 shift NaN 1 -> NaN
+ddshi827 shift NaN 1000 -> NaN
+ddshi828 shift NaN Inf -> NaN
+ddshi829 shift NaN NaN -> NaN
+ddshi830 shift -Inf NaN -> NaN
+ddshi831 shift -1000 NaN -> NaN
+ddshi832 shift -1 NaN -> NaN
+ddshi833 shift -0 NaN -> NaN
+ddshi834 shift 0 NaN -> NaN
+ddshi835 shift 1 NaN -> NaN
+ddshi836 shift 1000 NaN -> NaN
+ddshi837 shift Inf NaN -> NaN
+
+ddshi841 shift sNaN -Inf -> NaN Invalid_operation
+ddshi842 shift sNaN -1000 -> NaN Invalid_operation
+ddshi843 shift sNaN -1 -> NaN Invalid_operation
+ddshi844 shift sNaN -0 -> NaN Invalid_operation
+ddshi845 shift sNaN 0 -> NaN Invalid_operation
+ddshi846 shift sNaN 1 -> NaN Invalid_operation
+ddshi847 shift sNaN 1000 -> NaN Invalid_operation
+ddshi848 shift sNaN NaN -> NaN Invalid_operation
+ddshi849 shift sNaN sNaN -> NaN Invalid_operation
+ddshi850 shift NaN sNaN -> NaN Invalid_operation
+ddshi851 shift -Inf sNaN -> NaN Invalid_operation
+ddshi852 shift -1000 sNaN -> NaN Invalid_operation
+ddshi853 shift -1 sNaN -> NaN Invalid_operation
+ddshi854 shift -0 sNaN -> NaN Invalid_operation
+ddshi855 shift 0 sNaN -> NaN Invalid_operation
+ddshi856 shift 1 sNaN -> NaN Invalid_operation
+ddshi857 shift 1000 sNaN -> NaN Invalid_operation
+ddshi858 shift Inf sNaN -> NaN Invalid_operation
+ddshi859 shift NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddshi861 shift NaN1 -Inf -> NaN1
+ddshi862 shift +NaN2 -1000 -> NaN2
+ddshi863 shift NaN3 1000 -> NaN3
+ddshi864 shift NaN4 Inf -> NaN4
+ddshi865 shift NaN5 +NaN6 -> NaN5
+ddshi866 shift -Inf NaN7 -> NaN7
+ddshi867 shift -1000 NaN8 -> NaN8
+ddshi868 shift 1000 NaN9 -> NaN9
+ddshi869 shift Inf +NaN10 -> NaN10
+ddshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation
+ddshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation
+ddshi873 shift sNaN13 1000 -> NaN13 Invalid_operation
+ddshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
+ddshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
+ddshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
+ddshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
+ddshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation
+ddshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation
+ddshi880 shift Inf sNaN23 -> NaN23 Invalid_operation
+ddshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
+ddshi882 shift -NaN26 NaN28 -> -NaN26
+ddshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+ddshi884 shift 1000 -NaN30 -> -NaN30
+ddshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddSubtract.decTest b/Lib/test/decimaltestdata/ddSubtract.decTest
index 15d47779eb..5ebc4878f0 100644
--- a/Lib/test/decimaltestdata/ddSubtract.decTest
+++ b/Lib/test/decimaltestdata/ddSubtract.decTest
@@ -1,629 +1,629 @@
-------------------------------------------------------------------------
--- ddSubtract.decTest -- decDouble subtraction --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decDoubles only; all arguments are
--- representable in a decDouble
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- [first group are 'quick confidence check']
-ddsub001 subtract 0 0 -> '0'
-ddsub002 subtract 1 1 -> '0'
-ddsub003 subtract 1 2 -> '-1'
-ddsub004 subtract 2 1 -> '1'
-ddsub005 subtract 2 2 -> '0'
-ddsub006 subtract 3 2 -> '1'
-ddsub007 subtract 2 3 -> '-1'
-
-ddsub011 subtract -0 0 -> '-0'
-ddsub012 subtract -1 1 -> '-2'
-ddsub013 subtract -1 2 -> '-3'
-ddsub014 subtract -2 1 -> '-3'
-ddsub015 subtract -2 2 -> '-4'
-ddsub016 subtract -3 2 -> '-5'
-ddsub017 subtract -2 3 -> '-5'
-
-ddsub021 subtract 0 -0 -> '0'
-ddsub022 subtract 1 -1 -> '2'
-ddsub023 subtract 1 -2 -> '3'
-ddsub024 subtract 2 -1 -> '3'
-ddsub025 subtract 2 -2 -> '4'
-ddsub026 subtract 3 -2 -> '5'
-ddsub027 subtract 2 -3 -> '5'
-
-ddsub030 subtract 11 1 -> 10
-ddsub031 subtract 10 1 -> 9
-ddsub032 subtract 9 1 -> 8
-ddsub033 subtract 1 1 -> 0
-ddsub034 subtract 0 1 -> -1
-ddsub035 subtract -1 1 -> -2
-ddsub036 subtract -9 1 -> -10
-ddsub037 subtract -10 1 -> -11
-ddsub038 subtract -11 1 -> -12
-
-ddsub040 subtract '5.75' '3.3' -> '2.45'
-ddsub041 subtract '5' '-3' -> '8'
-ddsub042 subtract '-5' '-3' -> '-2'
-ddsub043 subtract '-7' '2.5' -> '-9.5'
-ddsub044 subtract '0.7' '0.3' -> '0.4'
-ddsub045 subtract '1.3' '0.3' -> '1.0'
-ddsub046 subtract '1.25' '1.25' -> '0.00'
-
-ddsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
-ddsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
-
-ddsub060 subtract '70' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
-ddsub061 subtract '700' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
-ddsub062 subtract '7000' '10000e+16' -> '-9.999999999999999E+19' Inexact Rounded
-ddsub063 subtract '70000' '10000e+16' -> '-9.999999999999993E+19' Rounded
-ddsub064 subtract '700000' '10000e+16' -> '-9.999999999999930E+19' Rounded
- -- symmetry:
-ddsub065 subtract '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
-ddsub066 subtract '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
-ddsub067 subtract '10000e+16' '7000' -> '9.999999999999999E+19' Inexact Rounded
-ddsub068 subtract '10000e+16' '70000' -> '9.999999999999993E+19' Rounded
-ddsub069 subtract '10000e+16' '700000' -> '9.999999999999930E+19' Rounded
-
- -- some of the next group are really constructor tests
-ddsub090 subtract '00.0' '0.0' -> '0.0'
-ddsub091 subtract '00.0' '0.00' -> '0.00'
-ddsub092 subtract '0.00' '00.0' -> '0.00'
-ddsub093 subtract '00.0' '0.00' -> '0.00'
-ddsub094 subtract '0.00' '00.0' -> '0.00'
-ddsub095 subtract '3' '.3' -> '2.7'
-ddsub096 subtract '3.' '.3' -> '2.7'
-ddsub097 subtract '3.0' '.3' -> '2.7'
-ddsub098 subtract '3.00' '.3' -> '2.70'
-ddsub099 subtract '3' '3' -> '0'
-ddsub100 subtract '3' '+3' -> '0'
-ddsub101 subtract '3' '-3' -> '6'
-ddsub102 subtract '3' '0.3' -> '2.7'
-ddsub103 subtract '3.' '0.3' -> '2.7'
-ddsub104 subtract '3.0' '0.3' -> '2.7'
-ddsub105 subtract '3.00' '0.3' -> '2.70'
-ddsub106 subtract '3' '3.0' -> '0.0'
-ddsub107 subtract '3' '+3.0' -> '0.0'
-ddsub108 subtract '3' '-3.0' -> '6.0'
-
--- the above all from add; massaged and extended. Now some new ones...
--- [particularly important for comparisons]
--- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
--- with input rounding.
-ddsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
-ddsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
-ddsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
-ddsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
-ddsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
-ddsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
-ddsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
-ddsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
-ddsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
-ddsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
-ddsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
-ddsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
-ddsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
-ddsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
-ddsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
-ddsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
-ddsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
-ddsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
-ddsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
-ddsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
-ddsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
-ddsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
-ddsub142 subtract '1' '0.999999999' -> '1E-9'
-ddsub143 subtract '0.999999999' '1' -> '-1E-9'
-ddsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
-ddsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
-ddsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
-
--- additional scaled arithmetic tests [0.97 problem]
-ddsub160 subtract '0' '.1' -> '-0.1'
-ddsub161 subtract '00' '.97983' -> '-0.97983'
-ddsub162 subtract '0' '.9' -> '-0.9'
-ddsub163 subtract '0' '0.102' -> '-0.102'
-ddsub164 subtract '0' '.4' -> '-0.4'
-ddsub165 subtract '0' '.307' -> '-0.307'
-ddsub166 subtract '0' '.43822' -> '-0.43822'
-ddsub167 subtract '0' '.911' -> '-0.911'
-ddsub168 subtract '.0' '.02' -> '-0.02'
-ddsub169 subtract '00' '.392' -> '-0.392'
-ddsub170 subtract '0' '.26' -> '-0.26'
-ddsub171 subtract '0' '0.51' -> '-0.51'
-ddsub172 subtract '0' '.2234' -> '-0.2234'
-ddsub173 subtract '0' '.2' -> '-0.2'
-ddsub174 subtract '.0' '.0008' -> '-0.0008'
--- 0. on left
-ddsub180 subtract '0.0' '-.1' -> '0.1'
-ddsub181 subtract '0.00' '-.97983' -> '0.97983'
-ddsub182 subtract '0.0' '-.9' -> '0.9'
-ddsub183 subtract '0.0' '-0.102' -> '0.102'
-ddsub184 subtract '0.0' '-.4' -> '0.4'
-ddsub185 subtract '0.0' '-.307' -> '0.307'
-ddsub186 subtract '0.0' '-.43822' -> '0.43822'
-ddsub187 subtract '0.0' '-.911' -> '0.911'
-ddsub188 subtract '0.0' '-.02' -> '0.02'
-ddsub189 subtract '0.00' '-.392' -> '0.392'
-ddsub190 subtract '0.0' '-.26' -> '0.26'
-ddsub191 subtract '0.0' '-0.51' -> '0.51'
-ddsub192 subtract '0.0' '-.2234' -> '0.2234'
-ddsub193 subtract '0.0' '-.2' -> '0.2'
-ddsub194 subtract '0.0' '-.0008' -> '0.0008'
--- negatives of same
-ddsub200 subtract '0' '-.1' -> '0.1'
-ddsub201 subtract '00' '-.97983' -> '0.97983'
-ddsub202 subtract '0' '-.9' -> '0.9'
-ddsub203 subtract '0' '-0.102' -> '0.102'
-ddsub204 subtract '0' '-.4' -> '0.4'
-ddsub205 subtract '0' '-.307' -> '0.307'
-ddsub206 subtract '0' '-.43822' -> '0.43822'
-ddsub207 subtract '0' '-.911' -> '0.911'
-ddsub208 subtract '.0' '-.02' -> '0.02'
-ddsub209 subtract '00' '-.392' -> '0.392'
-ddsub210 subtract '0' '-.26' -> '0.26'
-ddsub211 subtract '0' '-0.51' -> '0.51'
-ddsub212 subtract '0' '-.2234' -> '0.2234'
-ddsub213 subtract '0' '-.2' -> '0.2'
-ddsub214 subtract '.0' '-.0008' -> '0.0008'
-
--- more fixed, LHS swaps [really the same as testcases under add]
-ddsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
-ddsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
-ddsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
-ddsub223 subtract '-56267E-9' 0 -> '-0.000056267'
-ddsub224 subtract '-56267E-8' 0 -> '-0.00056267'
-ddsub225 subtract '-56267E-7' 0 -> '-0.0056267'
-ddsub226 subtract '-56267E-6' 0 -> '-0.056267'
-ddsub227 subtract '-56267E-5' 0 -> '-0.56267'
-ddsub228 subtract '-56267E-2' 0 -> '-562.67'
-ddsub229 subtract '-56267E-1' 0 -> '-5626.7'
-ddsub230 subtract '-56267E-0' 0 -> '-56267'
--- symmetry ...
-ddsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
-ddsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
-ddsub242 subtract 0 '-56267E-10' -> '0.0000056267'
-ddsub243 subtract 0 '-56267E-9' -> '0.000056267'
-ddsub244 subtract 0 '-56267E-8' -> '0.00056267'
-ddsub245 subtract 0 '-56267E-7' -> '0.0056267'
-ddsub246 subtract 0 '-56267E-6' -> '0.056267'
-ddsub247 subtract 0 '-56267E-5' -> '0.56267'
-ddsub248 subtract 0 '-56267E-2' -> '562.67'
-ddsub249 subtract 0 '-56267E-1' -> '5626.7'
-ddsub250 subtract 0 '-56267E-0' -> '56267'
-
--- now some more from the 'new' add
-ddsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
-ddsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
-
--- some carrying effects
-ddsub321 subtract '0.9998' '0.0000' -> '0.9998'
-ddsub322 subtract '0.9998' '0.0001' -> '0.9997'
-ddsub323 subtract '0.9998' '0.0002' -> '0.9996'
-ddsub324 subtract '0.9998' '0.0003' -> '0.9995'
-ddsub325 subtract '0.9998' '-0.0000' -> '0.9998'
-ddsub326 subtract '0.9998' '-0.0001' -> '0.9999'
-ddsub327 subtract '0.9998' '-0.0002' -> '1.0000'
-ddsub328 subtract '0.9998' '-0.0003' -> '1.0001'
-
--- internal boundaries
-ddsub346 subtract '10000e+9' '7' -> '9999999999993'
-ddsub347 subtract '10000e+9' '70' -> '9999999999930'
-ddsub348 subtract '10000e+9' '700' -> '9999999999300'
-ddsub349 subtract '10000e+9' '7000' -> '9999999993000'
-ddsub350 subtract '10000e+9' '70000' -> '9999999930000'
-ddsub351 subtract '10000e+9' '700000' -> '9999999300000'
-ddsub352 subtract '7' '10000e+9' -> '-9999999999993'
-ddsub353 subtract '70' '10000e+9' -> '-9999999999930'
-ddsub354 subtract '700' '10000e+9' -> '-9999999999300'
-ddsub355 subtract '7000' '10000e+9' -> '-9999999993000'
-ddsub356 subtract '70000' '10000e+9' -> '-9999999930000'
-ddsub357 subtract '700000' '10000e+9' -> '-9999999300000'
-
--- zero preservation
-ddsub361 subtract 1 '0.0001' -> '0.9999'
-ddsub362 subtract 1 '0.00001' -> '0.99999'
-ddsub363 subtract 1 '0.000001' -> '0.999999'
-ddsub364 subtract 1 '0.0000000000000001' -> '0.9999999999999999'
-ddsub365 subtract 1 '0.00000000000000001' -> '1.000000000000000' Inexact Rounded
-ddsub366 subtract 1 '0.000000000000000001' -> '1.000000000000000' Inexact Rounded
-
--- some funny zeros [in case of bad signum]
-ddsub370 subtract 1 0 -> 1
-ddsub371 subtract 1 0. -> 1
-ddsub372 subtract 1 .0 -> 1.0
-ddsub373 subtract 1 0.0 -> 1.0
-ddsub374 subtract 0 1 -> -1
-ddsub375 subtract 0. 1 -> -1
-ddsub376 subtract .0 1 -> -1.0
-ddsub377 subtract 0.0 1 -> -1.0
-
--- leading 0 digit before round
-ddsub910 subtract -103519362 -51897955.3 -> -51621406.7
-ddsub911 subtract 159579.444 89827.5229 -> 69751.9211
-
-ddsub920 subtract 333.0000000123456 33.00000001234566 -> 299.9999999999999 Inexact Rounded
-ddsub921 subtract 333.0000000123456 33.00000001234565 -> 300.0000000000000 Inexact Rounded
-ddsub922 subtract 133.0000000123456 33.00000001234565 -> 99.99999999999995
-ddsub923 subtract 133.0000000123456 33.00000001234564 -> 99.99999999999996
-ddsub924 subtract 133.0000000123456 33.00000001234540 -> 100.0000000000002 Rounded
-ddsub925 subtract 133.0000000123456 43.00000001234560 -> 90.00000000000000
-ddsub926 subtract 133.0000000123456 43.00000001234561 -> 89.99999999999999
-ddsub927 subtract 133.0000000123456 43.00000001234566 -> 89.99999999999994
-ddsub928 subtract 101.0000000123456 91.00000001234566 -> 9.99999999999994
-ddsub929 subtract 101.0000000123456 99.00000001234566 -> 1.99999999999994
-
--- more LHS swaps [were fixed]
-ddsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
-ddsub391 subtract '-56267E-6' 0 -> '-0.056267'
-ddsub392 subtract '-56267E-5' 0 -> '-0.56267'
-ddsub393 subtract '-56267E-4' 0 -> '-5.6267'
-ddsub394 subtract '-56267E-3' 0 -> '-56.267'
-ddsub395 subtract '-56267E-2' 0 -> '-562.67'
-ddsub396 subtract '-56267E-1' 0 -> '-5626.7'
-ddsub397 subtract '-56267E-0' 0 -> '-56267'
-ddsub398 subtract '-5E-10' 0 -> '-5E-10'
-ddsub399 subtract '-5E-7' 0 -> '-5E-7'
-ddsub400 subtract '-5E-6' 0 -> '-0.000005'
-ddsub401 subtract '-5E-5' 0 -> '-0.00005'
-ddsub402 subtract '-5E-4' 0 -> '-0.0005'
-ddsub403 subtract '-5E-1' 0 -> '-0.5'
-ddsub404 subtract '-5E0' 0 -> '-5'
-ddsub405 subtract '-5E1' 0 -> '-50'
-ddsub406 subtract '-5E5' 0 -> '-500000'
-ddsub407 subtract '-5E15' 0 -> '-5000000000000000'
-ddsub408 subtract '-5E16' 0 -> '-5.000000000000000E+16' Rounded
-ddsub409 subtract '-5E17' 0 -> '-5.000000000000000E+17' Rounded
-ddsub410 subtract '-5E18' 0 -> '-5.000000000000000E+18' Rounded
-ddsub411 subtract '-5E100' 0 -> '-5.000000000000000E+100' Rounded
-
--- more RHS swaps [were fixed]
-ddsub420 subtract 0 '-56267E-10' -> '0.0000056267'
-ddsub421 subtract 0 '-56267E-6' -> '0.056267'
-ddsub422 subtract 0 '-56267E-5' -> '0.56267'
-ddsub423 subtract 0 '-56267E-4' -> '5.6267'
-ddsub424 subtract 0 '-56267E-3' -> '56.267'
-ddsub425 subtract 0 '-56267E-2' -> '562.67'
-ddsub426 subtract 0 '-56267E-1' -> '5626.7'
-ddsub427 subtract 0 '-56267E-0' -> '56267'
-ddsub428 subtract 0 '-5E-10' -> '5E-10'
-ddsub429 subtract 0 '-5E-7' -> '5E-7'
-ddsub430 subtract 0 '-5E-6' -> '0.000005'
-ddsub431 subtract 0 '-5E-5' -> '0.00005'
-ddsub432 subtract 0 '-5E-4' -> '0.0005'
-ddsub433 subtract 0 '-5E-1' -> '0.5'
-ddsub434 subtract 0 '-5E0' -> '5'
-ddsub435 subtract 0 '-5E1' -> '50'
-ddsub436 subtract 0 '-5E5' -> '500000'
-ddsub437 subtract 0 '-5E15' -> '5000000000000000'
-ddsub438 subtract 0 '-5E16' -> '5.000000000000000E+16' Rounded
-ddsub439 subtract 0 '-5E17' -> '5.000000000000000E+17' Rounded
-ddsub440 subtract 0 '-5E18' -> '5.000000000000000E+18' Rounded
-ddsub441 subtract 0 '-5E100' -> '5.000000000000000E+100' Rounded
-
-
--- try borderline precision, with carries, etc.
-ddsub461 subtract '1E+16' '1' -> '9999999999999999'
-ddsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
-ddsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
-ddsub464 subtract '-1' '-1E+16' -> '9999999999999999'
-ddsub465 subtract '7E+15' '1' -> '6999999999999999'
-ddsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
-ddsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
-ddsub468 subtract '-1' '-7E+15' -> '6999999999999999'
-
--- 1234567890123456 1234567890123456 1 23456789012345
-ddsub470 subtract '0.4444444444444444' '-0.5555555555555563' -> '1.000000000000001' Inexact Rounded
-ddsub471 subtract '0.4444444444444444' '-0.5555555555555562' -> '1.000000000000001' Inexact Rounded
-ddsub472 subtract '0.4444444444444444' '-0.5555555555555561' -> '1.000000000000000' Inexact Rounded
-ddsub473 subtract '0.4444444444444444' '-0.5555555555555560' -> '1.000000000000000' Inexact Rounded
-ddsub474 subtract '0.4444444444444444' '-0.5555555555555559' -> '1.000000000000000' Inexact Rounded
-ddsub475 subtract '0.4444444444444444' '-0.5555555555555558' -> '1.000000000000000' Inexact Rounded
-ddsub476 subtract '0.4444444444444444' '-0.5555555555555557' -> '1.000000000000000' Inexact Rounded
-ddsub477 subtract '0.4444444444444444' '-0.5555555555555556' -> '1.000000000000000' Rounded
-ddsub478 subtract '0.4444444444444444' '-0.5555555555555555' -> '0.9999999999999999'
-ddsub479 subtract '0.4444444444444444' '-0.5555555555555554' -> '0.9999999999999998'
-ddsub480 subtract '0.4444444444444444' '-0.5555555555555553' -> '0.9999999999999997'
-ddsub481 subtract '0.4444444444444444' '-0.5555555555555552' -> '0.9999999999999996'
-ddsub482 subtract '0.4444444444444444' '-0.5555555555555551' -> '0.9999999999999995'
-ddsub483 subtract '0.4444444444444444' '-0.5555555555555550' -> '0.9999999999999994'
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-ddsub500 subtract '1231234567456789' 0 -> '1231234567456789'
-ddsub501 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
-ddsub502 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
-ddsub503 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
-ddsub504 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
-ddsub505 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
-ddsub506 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
-ddsub507 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
-ddsub508 subtract '1231234567456789' 0.5 -> '1231234567456789' Inexact Rounded
-ddsub509 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
-ddsub510 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
-ddsub511 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
-ddsub512 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
-ddsub513 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
-ddsub514 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
-ddsub515 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
-ddsub516 subtract '1231234567456789' 1 -> '1231234567456788'
-ddsub517 subtract '1231234567456789' 1.000000001 -> '1231234567456788' Inexact Rounded
-ddsub518 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
-ddsub519 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
-
-rounding: half_even
-ddsub520 subtract '1231234567456789' 0 -> '1231234567456789'
-ddsub521 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
-ddsub522 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
-ddsub523 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
-ddsub524 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
-ddsub525 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
-ddsub526 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
-ddsub527 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
-ddsub528 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
-ddsub529 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
-ddsub530 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
-ddsub531 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
-ddsub532 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
-ddsub533 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
-ddsub534 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
-ddsub535 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
-ddsub536 subtract '1231234567456789' 1 -> '1231234567456788'
-ddsub537 subtract '1231234567456789' 1.00000001 -> '1231234567456788' Inexact Rounded
-ddsub538 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
-ddsub539 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
--- critical few with even bottom digit...
-ddsub540 subtract '1231234567456788' 0.499999999 -> '1231234567456788' Inexact Rounded
-ddsub541 subtract '1231234567456788' 0.5 -> '1231234567456788' Inexact Rounded
-ddsub542 subtract '1231234567456788' 0.500000001 -> '1231234567456787' Inexact Rounded
-
-rounding: down
-ddsub550 subtract '1231234567456789' 0 -> '1231234567456789'
-ddsub551 subtract '1231234567456789' 0.000000001 -> '1231234567456788' Inexact Rounded
-ddsub552 subtract '1231234567456789' 0.000001 -> '1231234567456788' Inexact Rounded
-ddsub553 subtract '1231234567456789' 0.1 -> '1231234567456788' Inexact Rounded
-ddsub554 subtract '1231234567456789' 0.4 -> '1231234567456788' Inexact Rounded
-ddsub555 subtract '1231234567456789' 0.49 -> '1231234567456788' Inexact Rounded
-ddsub556 subtract '1231234567456789' 0.499999 -> '1231234567456788' Inexact Rounded
-ddsub557 subtract '1231234567456789' 0.499999999 -> '1231234567456788' Inexact Rounded
-ddsub558 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
-ddsub559 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
-ddsub560 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
-ddsub561 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
-ddsub562 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
-ddsub563 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
-ddsub564 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
-ddsub565 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
-ddsub566 subtract '1231234567456789' 1 -> '1231234567456788'
-ddsub567 subtract '1231234567456789' 1.00000001 -> '1231234567456787' Inexact Rounded
-ddsub568 subtract '1231234567456789' 1.00001 -> '1231234567456787' Inexact Rounded
-ddsub569 subtract '1231234567456789' 1.1 -> '1231234567456787' Inexact Rounded
-
--- symmetry...
-rounding: half_up
-ddsub600 subtract 0 '1231234567456789' -> '-1231234567456789'
-ddsub601 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub602 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub603 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub604 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub605 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub606 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub607 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub608 subtract 0.5 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub609 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub610 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub611 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub612 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub613 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub614 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub615 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub616 subtract 1 '1231234567456789' -> '-1231234567456788'
-ddsub617 subtract 1.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub618 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub619 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-
-rounding: half_even
-ddsub620 subtract 0 '1231234567456789' -> '-1231234567456789'
-ddsub621 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub622 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub623 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub624 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub625 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub626 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub627 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
-ddsub628 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub629 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub630 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub631 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub632 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub633 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub634 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub635 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub636 subtract 1 '1231234567456789' -> '-1231234567456788'
-ddsub637 subtract 1.00000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub638 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub639 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
--- critical few with even bottom digit...
-ddsub640 subtract 0.499999999 '1231234567456788' -> '-1231234567456788' Inexact Rounded
-ddsub641 subtract 0.5 '1231234567456788' -> '-1231234567456788' Inexact Rounded
-ddsub642 subtract 0.500000001 '1231234567456788' -> '-1231234567456787' Inexact Rounded
-
-rounding: down
-ddsub650 subtract 0 '1231234567456789' -> '-1231234567456789'
-ddsub651 subtract 0.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub652 subtract 0.000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub653 subtract 0.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub654 subtract 0.4 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub655 subtract 0.49 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub656 subtract 0.499999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub657 subtract 0.499999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub658 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub659 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub660 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub661 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub662 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub663 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub664 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub665 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
-ddsub666 subtract 1 '1231234567456789' -> '-1231234567456788'
-ddsub667 subtract 1.00000001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
-ddsub668 subtract 1.00001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
-ddsub669 subtract 1.1 '1231234567456789' -> '-1231234567456787' Inexact Rounded
-
-
--- lots of leading zeros in intermediate result, and showing effects of
--- input rounding would have affected the following
-rounding: half_up
-ddsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
-ddsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
-ddsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
-ddsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
-ddsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
-
-rounding: half_even
-ddsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
-ddsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
-ddsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
-ddsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
-ddsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
-
-ddsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
-ddsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
-ddsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
-ddsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
-ddsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
-
-rounding: down
-ddsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
-ddsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
-ddsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
-ddsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
-ddsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
-
--- Specials
-ddsub780 subtract -Inf Inf -> -Infinity
-ddsub781 subtract -Inf 1000 -> -Infinity
-ddsub782 subtract -Inf 1 -> -Infinity
-ddsub783 subtract -Inf -0 -> -Infinity
-ddsub784 subtract -Inf -1 -> -Infinity
-ddsub785 subtract -Inf -1000 -> -Infinity
-ddsub787 subtract -1000 Inf -> -Infinity
-ddsub788 subtract -Inf Inf -> -Infinity
-ddsub789 subtract -1 Inf -> -Infinity
-ddsub790 subtract 0 Inf -> -Infinity
-ddsub791 subtract 1 Inf -> -Infinity
-ddsub792 subtract 1000 Inf -> -Infinity
-
-ddsub800 subtract Inf Inf -> NaN Invalid_operation
-ddsub801 subtract Inf 1000 -> Infinity
-ddsub802 subtract Inf 1 -> Infinity
-ddsub803 subtract Inf 0 -> Infinity
-ddsub804 subtract Inf -0 -> Infinity
-ddsub805 subtract Inf -1 -> Infinity
-ddsub806 subtract Inf -1000 -> Infinity
-ddsub807 subtract Inf -Inf -> Infinity
-ddsub808 subtract -1000 -Inf -> Infinity
-ddsub809 subtract -Inf -Inf -> NaN Invalid_operation
-ddsub810 subtract -1 -Inf -> Infinity
-ddsub811 subtract -0 -Inf -> Infinity
-ddsub812 subtract 0 -Inf -> Infinity
-ddsub813 subtract 1 -Inf -> Infinity
-ddsub814 subtract 1000 -Inf -> Infinity
-ddsub815 subtract Inf -Inf -> Infinity
-
-ddsub821 subtract NaN Inf -> NaN
-ddsub822 subtract -NaN 1000 -> -NaN
-ddsub823 subtract NaN 1 -> NaN
-ddsub824 subtract NaN 0 -> NaN
-ddsub825 subtract NaN -0 -> NaN
-ddsub826 subtract NaN -1 -> NaN
-ddsub827 subtract NaN -1000 -> NaN
-ddsub828 subtract NaN -Inf -> NaN
-ddsub829 subtract -NaN NaN -> -NaN
-ddsub830 subtract -Inf NaN -> NaN
-ddsub831 subtract -1000 NaN -> NaN
-ddsub832 subtract -1 NaN -> NaN
-ddsub833 subtract -0 NaN -> NaN
-ddsub834 subtract 0 NaN -> NaN
-ddsub835 subtract 1 NaN -> NaN
-ddsub836 subtract 1000 -NaN -> -NaN
-ddsub837 subtract Inf NaN -> NaN
-
-ddsub841 subtract sNaN Inf -> NaN Invalid_operation
-ddsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
-ddsub843 subtract sNaN 1 -> NaN Invalid_operation
-ddsub844 subtract sNaN 0 -> NaN Invalid_operation
-ddsub845 subtract sNaN -0 -> NaN Invalid_operation
-ddsub846 subtract sNaN -1 -> NaN Invalid_operation
-ddsub847 subtract sNaN -1000 -> NaN Invalid_operation
-ddsub848 subtract sNaN NaN -> NaN Invalid_operation
-ddsub849 subtract sNaN sNaN -> NaN Invalid_operation
-ddsub850 subtract NaN sNaN -> NaN Invalid_operation
-ddsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
-ddsub852 subtract -1000 sNaN -> NaN Invalid_operation
-ddsub853 subtract -1 sNaN -> NaN Invalid_operation
-ddsub854 subtract -0 sNaN -> NaN Invalid_operation
-ddsub855 subtract 0 sNaN -> NaN Invalid_operation
-ddsub856 subtract 1 sNaN -> NaN Invalid_operation
-ddsub857 subtract 1000 sNaN -> NaN Invalid_operation
-ddsub858 subtract Inf sNaN -> NaN Invalid_operation
-ddsub859 subtract NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddsub861 subtract NaN01 -Inf -> NaN1
-ddsub862 subtract -NaN02 -1000 -> -NaN2
-ddsub863 subtract NaN03 1000 -> NaN3
-ddsub864 subtract NaN04 Inf -> NaN4
-ddsub865 subtract NaN05 NaN61 -> NaN5
-ddsub866 subtract -Inf -NaN71 -> -NaN71
-ddsub867 subtract -1000 NaN81 -> NaN81
-ddsub868 subtract 1000 NaN91 -> NaN91
-ddsub869 subtract Inf NaN101 -> NaN101
-ddsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
-ddsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
-ddsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
-ddsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
-ddsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
-ddsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
-ddsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
-ddsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
-ddsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
-ddsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
-ddsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- edge case spills
-ddsub901 subtract 2.E-3 1.002 -> -1.000
-ddsub902 subtract 2.0E-3 1.002 -> -1.0000
-ddsub903 subtract 2.00E-3 1.0020 -> -1.00000
-ddsub904 subtract 2.000E-3 1.00200 -> -1.000000
-ddsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
-ddsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
-ddsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
-ddsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
-
--- subnormals and overflows covered under Add
-
--- Null tests
-ddsub9990 subtract 10 # -> NaN Invalid_operation
-ddsub9991 subtract # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddSubtract.decTest -- decDouble subtraction --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decDoubles only; all arguments are
+-- representable in a decDouble
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+ddsub001 subtract 0 0 -> '0'
+ddsub002 subtract 1 1 -> '0'
+ddsub003 subtract 1 2 -> '-1'
+ddsub004 subtract 2 1 -> '1'
+ddsub005 subtract 2 2 -> '0'
+ddsub006 subtract 3 2 -> '1'
+ddsub007 subtract 2 3 -> '-1'
+
+ddsub011 subtract -0 0 -> '-0'
+ddsub012 subtract -1 1 -> '-2'
+ddsub013 subtract -1 2 -> '-3'
+ddsub014 subtract -2 1 -> '-3'
+ddsub015 subtract -2 2 -> '-4'
+ddsub016 subtract -3 2 -> '-5'
+ddsub017 subtract -2 3 -> '-5'
+
+ddsub021 subtract 0 -0 -> '0'
+ddsub022 subtract 1 -1 -> '2'
+ddsub023 subtract 1 -2 -> '3'
+ddsub024 subtract 2 -1 -> '3'
+ddsub025 subtract 2 -2 -> '4'
+ddsub026 subtract 3 -2 -> '5'
+ddsub027 subtract 2 -3 -> '5'
+
+ddsub030 subtract 11 1 -> 10
+ddsub031 subtract 10 1 -> 9
+ddsub032 subtract 9 1 -> 8
+ddsub033 subtract 1 1 -> 0
+ddsub034 subtract 0 1 -> -1
+ddsub035 subtract -1 1 -> -2
+ddsub036 subtract -9 1 -> -10
+ddsub037 subtract -10 1 -> -11
+ddsub038 subtract -11 1 -> -12
+
+ddsub040 subtract '5.75' '3.3' -> '2.45'
+ddsub041 subtract '5' '-3' -> '8'
+ddsub042 subtract '-5' '-3' -> '-2'
+ddsub043 subtract '-7' '2.5' -> '-9.5'
+ddsub044 subtract '0.7' '0.3' -> '0.4'
+ddsub045 subtract '1.3' '0.3' -> '1.0'
+ddsub046 subtract '1.25' '1.25' -> '0.00'
+
+ddsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
+ddsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
+
+ddsub060 subtract '70' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
+ddsub061 subtract '700' '10000e+16' -> '-1.000000000000000E+20' Inexact Rounded
+ddsub062 subtract '7000' '10000e+16' -> '-9.999999999999999E+19' Inexact Rounded
+ddsub063 subtract '70000' '10000e+16' -> '-9.999999999999993E+19' Rounded
+ddsub064 subtract '700000' '10000e+16' -> '-9.999999999999930E+19' Rounded
+ -- symmetry:
+ddsub065 subtract '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
+ddsub066 subtract '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
+ddsub067 subtract '10000e+16' '7000' -> '9.999999999999999E+19' Inexact Rounded
+ddsub068 subtract '10000e+16' '70000' -> '9.999999999999993E+19' Rounded
+ddsub069 subtract '10000e+16' '700000' -> '9.999999999999930E+19' Rounded
+
+ -- some of the next group are really constructor tests
+ddsub090 subtract '00.0' '0.0' -> '0.0'
+ddsub091 subtract '00.0' '0.00' -> '0.00'
+ddsub092 subtract '0.00' '00.0' -> '0.00'
+ddsub093 subtract '00.0' '0.00' -> '0.00'
+ddsub094 subtract '0.00' '00.0' -> '0.00'
+ddsub095 subtract '3' '.3' -> '2.7'
+ddsub096 subtract '3.' '.3' -> '2.7'
+ddsub097 subtract '3.0' '.3' -> '2.7'
+ddsub098 subtract '3.00' '.3' -> '2.70'
+ddsub099 subtract '3' '3' -> '0'
+ddsub100 subtract '3' '+3' -> '0'
+ddsub101 subtract '3' '-3' -> '6'
+ddsub102 subtract '3' '0.3' -> '2.7'
+ddsub103 subtract '3.' '0.3' -> '2.7'
+ddsub104 subtract '3.0' '0.3' -> '2.7'
+ddsub105 subtract '3.00' '0.3' -> '2.70'
+ddsub106 subtract '3' '3.0' -> '0.0'
+ddsub107 subtract '3' '+3.0' -> '0.0'
+ddsub108 subtract '3' '-3.0' -> '6.0'
+
+-- the above all from add; massaged and extended. Now some new ones...
+-- [particularly important for comparisons]
+-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
+-- with input rounding.
+ddsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
+ddsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
+ddsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
+ddsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
+ddsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
+ddsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
+ddsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
+ddsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
+ddsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
+ddsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
+ddsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
+ddsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
+ddsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
+ddsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
+ddsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
+ddsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
+ddsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
+ddsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
+ddsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
+ddsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
+ddsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
+ddsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
+ddsub142 subtract '1' '0.999999999' -> '1E-9'
+ddsub143 subtract '0.999999999' '1' -> '-1E-9'
+ddsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
+ddsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
+ddsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
+
+-- additional scaled arithmetic tests [0.97 problem]
+ddsub160 subtract '0' '.1' -> '-0.1'
+ddsub161 subtract '00' '.97983' -> '-0.97983'
+ddsub162 subtract '0' '.9' -> '-0.9'
+ddsub163 subtract '0' '0.102' -> '-0.102'
+ddsub164 subtract '0' '.4' -> '-0.4'
+ddsub165 subtract '0' '.307' -> '-0.307'
+ddsub166 subtract '0' '.43822' -> '-0.43822'
+ddsub167 subtract '0' '.911' -> '-0.911'
+ddsub168 subtract '.0' '.02' -> '-0.02'
+ddsub169 subtract '00' '.392' -> '-0.392'
+ddsub170 subtract '0' '.26' -> '-0.26'
+ddsub171 subtract '0' '0.51' -> '-0.51'
+ddsub172 subtract '0' '.2234' -> '-0.2234'
+ddsub173 subtract '0' '.2' -> '-0.2'
+ddsub174 subtract '.0' '.0008' -> '-0.0008'
+-- 0. on left
+ddsub180 subtract '0.0' '-.1' -> '0.1'
+ddsub181 subtract '0.00' '-.97983' -> '0.97983'
+ddsub182 subtract '0.0' '-.9' -> '0.9'
+ddsub183 subtract '0.0' '-0.102' -> '0.102'
+ddsub184 subtract '0.0' '-.4' -> '0.4'
+ddsub185 subtract '0.0' '-.307' -> '0.307'
+ddsub186 subtract '0.0' '-.43822' -> '0.43822'
+ddsub187 subtract '0.0' '-.911' -> '0.911'
+ddsub188 subtract '0.0' '-.02' -> '0.02'
+ddsub189 subtract '0.00' '-.392' -> '0.392'
+ddsub190 subtract '0.0' '-.26' -> '0.26'
+ddsub191 subtract '0.0' '-0.51' -> '0.51'
+ddsub192 subtract '0.0' '-.2234' -> '0.2234'
+ddsub193 subtract '0.0' '-.2' -> '0.2'
+ddsub194 subtract '0.0' '-.0008' -> '0.0008'
+-- negatives of same
+ddsub200 subtract '0' '-.1' -> '0.1'
+ddsub201 subtract '00' '-.97983' -> '0.97983'
+ddsub202 subtract '0' '-.9' -> '0.9'
+ddsub203 subtract '0' '-0.102' -> '0.102'
+ddsub204 subtract '0' '-.4' -> '0.4'
+ddsub205 subtract '0' '-.307' -> '0.307'
+ddsub206 subtract '0' '-.43822' -> '0.43822'
+ddsub207 subtract '0' '-.911' -> '0.911'
+ddsub208 subtract '.0' '-.02' -> '0.02'
+ddsub209 subtract '00' '-.392' -> '0.392'
+ddsub210 subtract '0' '-.26' -> '0.26'
+ddsub211 subtract '0' '-0.51' -> '0.51'
+ddsub212 subtract '0' '-.2234' -> '0.2234'
+ddsub213 subtract '0' '-.2' -> '0.2'
+ddsub214 subtract '.0' '-.0008' -> '0.0008'
+
+-- more fixed, LHS swaps [really the same as testcases under add]
+ddsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
+ddsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
+ddsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
+ddsub223 subtract '-56267E-9' 0 -> '-0.000056267'
+ddsub224 subtract '-56267E-8' 0 -> '-0.00056267'
+ddsub225 subtract '-56267E-7' 0 -> '-0.0056267'
+ddsub226 subtract '-56267E-6' 0 -> '-0.056267'
+ddsub227 subtract '-56267E-5' 0 -> '-0.56267'
+ddsub228 subtract '-56267E-2' 0 -> '-562.67'
+ddsub229 subtract '-56267E-1' 0 -> '-5626.7'
+ddsub230 subtract '-56267E-0' 0 -> '-56267'
+-- symmetry ...
+ddsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
+ddsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
+ddsub242 subtract 0 '-56267E-10' -> '0.0000056267'
+ddsub243 subtract 0 '-56267E-9' -> '0.000056267'
+ddsub244 subtract 0 '-56267E-8' -> '0.00056267'
+ddsub245 subtract 0 '-56267E-7' -> '0.0056267'
+ddsub246 subtract 0 '-56267E-6' -> '0.056267'
+ddsub247 subtract 0 '-56267E-5' -> '0.56267'
+ddsub248 subtract 0 '-56267E-2' -> '562.67'
+ddsub249 subtract 0 '-56267E-1' -> '5626.7'
+ddsub250 subtract 0 '-56267E-0' -> '56267'
+
+-- now some more from the 'new' add
+ddsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
+ddsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
+
+-- some carrying effects
+ddsub321 subtract '0.9998' '0.0000' -> '0.9998'
+ddsub322 subtract '0.9998' '0.0001' -> '0.9997'
+ddsub323 subtract '0.9998' '0.0002' -> '0.9996'
+ddsub324 subtract '0.9998' '0.0003' -> '0.9995'
+ddsub325 subtract '0.9998' '-0.0000' -> '0.9998'
+ddsub326 subtract '0.9998' '-0.0001' -> '0.9999'
+ddsub327 subtract '0.9998' '-0.0002' -> '1.0000'
+ddsub328 subtract '0.9998' '-0.0003' -> '1.0001'
+
+-- internal boundaries
+ddsub346 subtract '10000e+9' '7' -> '9999999999993'
+ddsub347 subtract '10000e+9' '70' -> '9999999999930'
+ddsub348 subtract '10000e+9' '700' -> '9999999999300'
+ddsub349 subtract '10000e+9' '7000' -> '9999999993000'
+ddsub350 subtract '10000e+9' '70000' -> '9999999930000'
+ddsub351 subtract '10000e+9' '700000' -> '9999999300000'
+ddsub352 subtract '7' '10000e+9' -> '-9999999999993'
+ddsub353 subtract '70' '10000e+9' -> '-9999999999930'
+ddsub354 subtract '700' '10000e+9' -> '-9999999999300'
+ddsub355 subtract '7000' '10000e+9' -> '-9999999993000'
+ddsub356 subtract '70000' '10000e+9' -> '-9999999930000'
+ddsub357 subtract '700000' '10000e+9' -> '-9999999300000'
+
+-- zero preservation
+ddsub361 subtract 1 '0.0001' -> '0.9999'
+ddsub362 subtract 1 '0.00001' -> '0.99999'
+ddsub363 subtract 1 '0.000001' -> '0.999999'
+ddsub364 subtract 1 '0.0000000000000001' -> '0.9999999999999999'
+ddsub365 subtract 1 '0.00000000000000001' -> '1.000000000000000' Inexact Rounded
+ddsub366 subtract 1 '0.000000000000000001' -> '1.000000000000000' Inexact Rounded
+
+-- some funny zeros [in case of bad signum]
+ddsub370 subtract 1 0 -> 1
+ddsub371 subtract 1 0. -> 1
+ddsub372 subtract 1 .0 -> 1.0
+ddsub373 subtract 1 0.0 -> 1.0
+ddsub374 subtract 0 1 -> -1
+ddsub375 subtract 0. 1 -> -1
+ddsub376 subtract .0 1 -> -1.0
+ddsub377 subtract 0.0 1 -> -1.0
+
+-- leading 0 digit before round
+ddsub910 subtract -103519362 -51897955.3 -> -51621406.7
+ddsub911 subtract 159579.444 89827.5229 -> 69751.9211
+
+ddsub920 subtract 333.0000000123456 33.00000001234566 -> 299.9999999999999 Inexact Rounded
+ddsub921 subtract 333.0000000123456 33.00000001234565 -> 300.0000000000000 Inexact Rounded
+ddsub922 subtract 133.0000000123456 33.00000001234565 -> 99.99999999999995
+ddsub923 subtract 133.0000000123456 33.00000001234564 -> 99.99999999999996
+ddsub924 subtract 133.0000000123456 33.00000001234540 -> 100.0000000000002 Rounded
+ddsub925 subtract 133.0000000123456 43.00000001234560 -> 90.00000000000000
+ddsub926 subtract 133.0000000123456 43.00000001234561 -> 89.99999999999999
+ddsub927 subtract 133.0000000123456 43.00000001234566 -> 89.99999999999994
+ddsub928 subtract 101.0000000123456 91.00000001234566 -> 9.99999999999994
+ddsub929 subtract 101.0000000123456 99.00000001234566 -> 1.99999999999994
+
+-- more LHS swaps [were fixed]
+ddsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
+ddsub391 subtract '-56267E-6' 0 -> '-0.056267'
+ddsub392 subtract '-56267E-5' 0 -> '-0.56267'
+ddsub393 subtract '-56267E-4' 0 -> '-5.6267'
+ddsub394 subtract '-56267E-3' 0 -> '-56.267'
+ddsub395 subtract '-56267E-2' 0 -> '-562.67'
+ddsub396 subtract '-56267E-1' 0 -> '-5626.7'
+ddsub397 subtract '-56267E-0' 0 -> '-56267'
+ddsub398 subtract '-5E-10' 0 -> '-5E-10'
+ddsub399 subtract '-5E-7' 0 -> '-5E-7'
+ddsub400 subtract '-5E-6' 0 -> '-0.000005'
+ddsub401 subtract '-5E-5' 0 -> '-0.00005'
+ddsub402 subtract '-5E-4' 0 -> '-0.0005'
+ddsub403 subtract '-5E-1' 0 -> '-0.5'
+ddsub404 subtract '-5E0' 0 -> '-5'
+ddsub405 subtract '-5E1' 0 -> '-50'
+ddsub406 subtract '-5E5' 0 -> '-500000'
+ddsub407 subtract '-5E15' 0 -> '-5000000000000000'
+ddsub408 subtract '-5E16' 0 -> '-5.000000000000000E+16' Rounded
+ddsub409 subtract '-5E17' 0 -> '-5.000000000000000E+17' Rounded
+ddsub410 subtract '-5E18' 0 -> '-5.000000000000000E+18' Rounded
+ddsub411 subtract '-5E100' 0 -> '-5.000000000000000E+100' Rounded
+
+-- more RHS swaps [were fixed]
+ddsub420 subtract 0 '-56267E-10' -> '0.0000056267'
+ddsub421 subtract 0 '-56267E-6' -> '0.056267'
+ddsub422 subtract 0 '-56267E-5' -> '0.56267'
+ddsub423 subtract 0 '-56267E-4' -> '5.6267'
+ddsub424 subtract 0 '-56267E-3' -> '56.267'
+ddsub425 subtract 0 '-56267E-2' -> '562.67'
+ddsub426 subtract 0 '-56267E-1' -> '5626.7'
+ddsub427 subtract 0 '-56267E-0' -> '56267'
+ddsub428 subtract 0 '-5E-10' -> '5E-10'
+ddsub429 subtract 0 '-5E-7' -> '5E-7'
+ddsub430 subtract 0 '-5E-6' -> '0.000005'
+ddsub431 subtract 0 '-5E-5' -> '0.00005'
+ddsub432 subtract 0 '-5E-4' -> '0.0005'
+ddsub433 subtract 0 '-5E-1' -> '0.5'
+ddsub434 subtract 0 '-5E0' -> '5'
+ddsub435 subtract 0 '-5E1' -> '50'
+ddsub436 subtract 0 '-5E5' -> '500000'
+ddsub437 subtract 0 '-5E15' -> '5000000000000000'
+ddsub438 subtract 0 '-5E16' -> '5.000000000000000E+16' Rounded
+ddsub439 subtract 0 '-5E17' -> '5.000000000000000E+17' Rounded
+ddsub440 subtract 0 '-5E18' -> '5.000000000000000E+18' Rounded
+ddsub441 subtract 0 '-5E100' -> '5.000000000000000E+100' Rounded
+
+
+-- try borderline precision, with carries, etc.
+ddsub461 subtract '1E+16' '1' -> '9999999999999999'
+ddsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
+ddsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
+ddsub464 subtract '-1' '-1E+16' -> '9999999999999999'
+ddsub465 subtract '7E+15' '1' -> '6999999999999999'
+ddsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
+ddsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
+ddsub468 subtract '-1' '-7E+15' -> '6999999999999999'
+
+-- 1234567890123456 1234567890123456 1 23456789012345
+ddsub470 subtract '0.4444444444444444' '-0.5555555555555563' -> '1.000000000000001' Inexact Rounded
+ddsub471 subtract '0.4444444444444444' '-0.5555555555555562' -> '1.000000000000001' Inexact Rounded
+ddsub472 subtract '0.4444444444444444' '-0.5555555555555561' -> '1.000000000000000' Inexact Rounded
+ddsub473 subtract '0.4444444444444444' '-0.5555555555555560' -> '1.000000000000000' Inexact Rounded
+ddsub474 subtract '0.4444444444444444' '-0.5555555555555559' -> '1.000000000000000' Inexact Rounded
+ddsub475 subtract '0.4444444444444444' '-0.5555555555555558' -> '1.000000000000000' Inexact Rounded
+ddsub476 subtract '0.4444444444444444' '-0.5555555555555557' -> '1.000000000000000' Inexact Rounded
+ddsub477 subtract '0.4444444444444444' '-0.5555555555555556' -> '1.000000000000000' Rounded
+ddsub478 subtract '0.4444444444444444' '-0.5555555555555555' -> '0.9999999999999999'
+ddsub479 subtract '0.4444444444444444' '-0.5555555555555554' -> '0.9999999999999998'
+ddsub480 subtract '0.4444444444444444' '-0.5555555555555553' -> '0.9999999999999997'
+ddsub481 subtract '0.4444444444444444' '-0.5555555555555552' -> '0.9999999999999996'
+ddsub482 subtract '0.4444444444444444' '-0.5555555555555551' -> '0.9999999999999995'
+ddsub483 subtract '0.4444444444444444' '-0.5555555555555550' -> '0.9999999999999994'
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+ddsub500 subtract '1231234567456789' 0 -> '1231234567456789'
+ddsub501 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
+ddsub502 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
+ddsub503 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
+ddsub504 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
+ddsub505 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
+ddsub506 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
+ddsub507 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
+ddsub508 subtract '1231234567456789' 0.5 -> '1231234567456789' Inexact Rounded
+ddsub509 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
+ddsub510 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
+ddsub511 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
+ddsub512 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
+ddsub513 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
+ddsub514 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
+ddsub515 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
+ddsub516 subtract '1231234567456789' 1 -> '1231234567456788'
+ddsub517 subtract '1231234567456789' 1.000000001 -> '1231234567456788' Inexact Rounded
+ddsub518 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
+ddsub519 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
+
+rounding: half_even
+ddsub520 subtract '1231234567456789' 0 -> '1231234567456789'
+ddsub521 subtract '1231234567456789' 0.000000001 -> '1231234567456789' Inexact Rounded
+ddsub522 subtract '1231234567456789' 0.000001 -> '1231234567456789' Inexact Rounded
+ddsub523 subtract '1231234567456789' 0.1 -> '1231234567456789' Inexact Rounded
+ddsub524 subtract '1231234567456789' 0.4 -> '1231234567456789' Inexact Rounded
+ddsub525 subtract '1231234567456789' 0.49 -> '1231234567456789' Inexact Rounded
+ddsub526 subtract '1231234567456789' 0.499999 -> '1231234567456789' Inexact Rounded
+ddsub527 subtract '1231234567456789' 0.499999999 -> '1231234567456789' Inexact Rounded
+ddsub528 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
+ddsub529 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
+ddsub530 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
+ddsub531 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
+ddsub532 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
+ddsub533 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
+ddsub534 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
+ddsub535 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
+ddsub536 subtract '1231234567456789' 1 -> '1231234567456788'
+ddsub537 subtract '1231234567456789' 1.00000001 -> '1231234567456788' Inexact Rounded
+ddsub538 subtract '1231234567456789' 1.00001 -> '1231234567456788' Inexact Rounded
+ddsub539 subtract '1231234567456789' 1.1 -> '1231234567456788' Inexact Rounded
+-- critical few with even bottom digit...
+ddsub540 subtract '1231234567456788' 0.499999999 -> '1231234567456788' Inexact Rounded
+ddsub541 subtract '1231234567456788' 0.5 -> '1231234567456788' Inexact Rounded
+ddsub542 subtract '1231234567456788' 0.500000001 -> '1231234567456787' Inexact Rounded
+
+rounding: down
+ddsub550 subtract '1231234567456789' 0 -> '1231234567456789'
+ddsub551 subtract '1231234567456789' 0.000000001 -> '1231234567456788' Inexact Rounded
+ddsub552 subtract '1231234567456789' 0.000001 -> '1231234567456788' Inexact Rounded
+ddsub553 subtract '1231234567456789' 0.1 -> '1231234567456788' Inexact Rounded
+ddsub554 subtract '1231234567456789' 0.4 -> '1231234567456788' Inexact Rounded
+ddsub555 subtract '1231234567456789' 0.49 -> '1231234567456788' Inexact Rounded
+ddsub556 subtract '1231234567456789' 0.499999 -> '1231234567456788' Inexact Rounded
+ddsub557 subtract '1231234567456789' 0.499999999 -> '1231234567456788' Inexact Rounded
+ddsub558 subtract '1231234567456789' 0.5 -> '1231234567456788' Inexact Rounded
+ddsub559 subtract '1231234567456789' 0.500000001 -> '1231234567456788' Inexact Rounded
+ddsub560 subtract '1231234567456789' 0.500001 -> '1231234567456788' Inexact Rounded
+ddsub561 subtract '1231234567456789' 0.51 -> '1231234567456788' Inexact Rounded
+ddsub562 subtract '1231234567456789' 0.6 -> '1231234567456788' Inexact Rounded
+ddsub563 subtract '1231234567456789' 0.9 -> '1231234567456788' Inexact Rounded
+ddsub564 subtract '1231234567456789' 0.99999 -> '1231234567456788' Inexact Rounded
+ddsub565 subtract '1231234567456789' 0.999999999 -> '1231234567456788' Inexact Rounded
+ddsub566 subtract '1231234567456789' 1 -> '1231234567456788'
+ddsub567 subtract '1231234567456789' 1.00000001 -> '1231234567456787' Inexact Rounded
+ddsub568 subtract '1231234567456789' 1.00001 -> '1231234567456787' Inexact Rounded
+ddsub569 subtract '1231234567456789' 1.1 -> '1231234567456787' Inexact Rounded
+
+-- symmetry...
+rounding: half_up
+ddsub600 subtract 0 '1231234567456789' -> '-1231234567456789'
+ddsub601 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub602 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub603 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub604 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub605 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub606 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub607 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub608 subtract 0.5 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub609 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub610 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub611 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub612 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub613 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub614 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub615 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub616 subtract 1 '1231234567456789' -> '-1231234567456788'
+ddsub617 subtract 1.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub618 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub619 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+
+rounding: half_even
+ddsub620 subtract 0 '1231234567456789' -> '-1231234567456789'
+ddsub621 subtract 0.000000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub622 subtract 0.000001 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub623 subtract 0.1 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub624 subtract 0.4 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub625 subtract 0.49 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub626 subtract 0.499999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub627 subtract 0.499999999 '1231234567456789' -> '-1231234567456789' Inexact Rounded
+ddsub628 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub629 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub630 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub631 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub632 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub633 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub634 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub635 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub636 subtract 1 '1231234567456789' -> '-1231234567456788'
+ddsub637 subtract 1.00000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub638 subtract 1.00001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub639 subtract 1.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+-- critical few with even bottom digit...
+ddsub640 subtract 0.499999999 '1231234567456788' -> '-1231234567456788' Inexact Rounded
+ddsub641 subtract 0.5 '1231234567456788' -> '-1231234567456788' Inexact Rounded
+ddsub642 subtract 0.500000001 '1231234567456788' -> '-1231234567456787' Inexact Rounded
+
+rounding: down
+ddsub650 subtract 0 '1231234567456789' -> '-1231234567456789'
+ddsub651 subtract 0.000000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub652 subtract 0.000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub653 subtract 0.1 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub654 subtract 0.4 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub655 subtract 0.49 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub656 subtract 0.499999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub657 subtract 0.499999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub658 subtract 0.5 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub659 subtract 0.500000001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub660 subtract 0.500001 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub661 subtract 0.51 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub662 subtract 0.6 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub663 subtract 0.9 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub664 subtract 0.99999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub665 subtract 0.999999999 '1231234567456789' -> '-1231234567456788' Inexact Rounded
+ddsub666 subtract 1 '1231234567456789' -> '-1231234567456788'
+ddsub667 subtract 1.00000001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
+ddsub668 subtract 1.00001 '1231234567456789' -> '-1231234567456787' Inexact Rounded
+ddsub669 subtract 1.1 '1231234567456789' -> '-1231234567456787' Inexact Rounded
+
+
+-- lots of leading zeros in intermediate result, and showing effects of
+-- input rounding would have affected the following
+rounding: half_up
+ddsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
+ddsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
+ddsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
+ddsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
+ddsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+rounding: half_even
+ddsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
+ddsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
+ddsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
+ddsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
+ddsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+ddsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
+ddsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
+ddsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
+ddsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
+ddsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
+
+rounding: down
+ddsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
+ddsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
+ddsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
+ddsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
+ddsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+-- Specials
+ddsub780 subtract -Inf Inf -> -Infinity
+ddsub781 subtract -Inf 1000 -> -Infinity
+ddsub782 subtract -Inf 1 -> -Infinity
+ddsub783 subtract -Inf -0 -> -Infinity
+ddsub784 subtract -Inf -1 -> -Infinity
+ddsub785 subtract -Inf -1000 -> -Infinity
+ddsub787 subtract -1000 Inf -> -Infinity
+ddsub788 subtract -Inf Inf -> -Infinity
+ddsub789 subtract -1 Inf -> -Infinity
+ddsub790 subtract 0 Inf -> -Infinity
+ddsub791 subtract 1 Inf -> -Infinity
+ddsub792 subtract 1000 Inf -> -Infinity
+
+ddsub800 subtract Inf Inf -> NaN Invalid_operation
+ddsub801 subtract Inf 1000 -> Infinity
+ddsub802 subtract Inf 1 -> Infinity
+ddsub803 subtract Inf 0 -> Infinity
+ddsub804 subtract Inf -0 -> Infinity
+ddsub805 subtract Inf -1 -> Infinity
+ddsub806 subtract Inf -1000 -> Infinity
+ddsub807 subtract Inf -Inf -> Infinity
+ddsub808 subtract -1000 -Inf -> Infinity
+ddsub809 subtract -Inf -Inf -> NaN Invalid_operation
+ddsub810 subtract -1 -Inf -> Infinity
+ddsub811 subtract -0 -Inf -> Infinity
+ddsub812 subtract 0 -Inf -> Infinity
+ddsub813 subtract 1 -Inf -> Infinity
+ddsub814 subtract 1000 -Inf -> Infinity
+ddsub815 subtract Inf -Inf -> Infinity
+
+ddsub821 subtract NaN Inf -> NaN
+ddsub822 subtract -NaN 1000 -> -NaN
+ddsub823 subtract NaN 1 -> NaN
+ddsub824 subtract NaN 0 -> NaN
+ddsub825 subtract NaN -0 -> NaN
+ddsub826 subtract NaN -1 -> NaN
+ddsub827 subtract NaN -1000 -> NaN
+ddsub828 subtract NaN -Inf -> NaN
+ddsub829 subtract -NaN NaN -> -NaN
+ddsub830 subtract -Inf NaN -> NaN
+ddsub831 subtract -1000 NaN -> NaN
+ddsub832 subtract -1 NaN -> NaN
+ddsub833 subtract -0 NaN -> NaN
+ddsub834 subtract 0 NaN -> NaN
+ddsub835 subtract 1 NaN -> NaN
+ddsub836 subtract 1000 -NaN -> -NaN
+ddsub837 subtract Inf NaN -> NaN
+
+ddsub841 subtract sNaN Inf -> NaN Invalid_operation
+ddsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
+ddsub843 subtract sNaN 1 -> NaN Invalid_operation
+ddsub844 subtract sNaN 0 -> NaN Invalid_operation
+ddsub845 subtract sNaN -0 -> NaN Invalid_operation
+ddsub846 subtract sNaN -1 -> NaN Invalid_operation
+ddsub847 subtract sNaN -1000 -> NaN Invalid_operation
+ddsub848 subtract sNaN NaN -> NaN Invalid_operation
+ddsub849 subtract sNaN sNaN -> NaN Invalid_operation
+ddsub850 subtract NaN sNaN -> NaN Invalid_operation
+ddsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
+ddsub852 subtract -1000 sNaN -> NaN Invalid_operation
+ddsub853 subtract -1 sNaN -> NaN Invalid_operation
+ddsub854 subtract -0 sNaN -> NaN Invalid_operation
+ddsub855 subtract 0 sNaN -> NaN Invalid_operation
+ddsub856 subtract 1 sNaN -> NaN Invalid_operation
+ddsub857 subtract 1000 sNaN -> NaN Invalid_operation
+ddsub858 subtract Inf sNaN -> NaN Invalid_operation
+ddsub859 subtract NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddsub861 subtract NaN01 -Inf -> NaN1
+ddsub862 subtract -NaN02 -1000 -> -NaN2
+ddsub863 subtract NaN03 1000 -> NaN3
+ddsub864 subtract NaN04 Inf -> NaN4
+ddsub865 subtract NaN05 NaN61 -> NaN5
+ddsub866 subtract -Inf -NaN71 -> -NaN71
+ddsub867 subtract -1000 NaN81 -> NaN81
+ddsub868 subtract 1000 NaN91 -> NaN91
+ddsub869 subtract Inf NaN101 -> NaN101
+ddsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
+ddsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
+ddsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
+ddsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
+ddsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
+ddsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
+ddsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
+ddsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
+ddsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
+ddsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
+ddsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- edge case spills
+ddsub901 subtract 2.E-3 1.002 -> -1.000
+ddsub902 subtract 2.0E-3 1.002 -> -1.0000
+ddsub903 subtract 2.00E-3 1.0020 -> -1.00000
+ddsub904 subtract 2.000E-3 1.00200 -> -1.000000
+ddsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
+ddsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
+ddsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
+ddsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
+
+-- subnormals and overflows covered under Add
+
+-- Null tests
+ddsub9990 subtract 10 # -> NaN Invalid_operation
+ddsub9991 subtract # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ddToIntegral.decTest b/Lib/test/decimaltestdata/ddToIntegral.decTest
index 900bd4ac3a..bf6d61fa56 100644
--- a/Lib/test/decimaltestdata/ddToIntegral.decTest
+++ b/Lib/test/decimaltestdata/ddToIntegral.decTest
@@ -1,257 +1,257 @@
-------------------------------------------------------------------------
--- ddToIntegral.decTest -- round Double to integral value --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests tests the extended specification 'round-to-integral
--- value-exact' operations (from IEEE 854, later modified in 754r).
--- All non-zero results are defined as being those from either copy or
--- quantize, so those are assumed to have been tested extensively
--- elsewhere; the tests here are for integrity, rounding mode, etc.
--- Also, it is assumed the test harness will use these tests for both
--- ToIntegralExact (which does set Inexact) and the fixed-name
--- functions (which do not set Inexact).
-
--- Note that decNumber implements an earlier definition of toIntegral
--- which never sets Inexact; the decTest operator for that is called
--- 'tointegral' instead of 'tointegralx'.
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
-ddintx001 tointegralx 0 -> 0
-ddintx002 tointegralx 0.0 -> 0
-ddintx003 tointegralx 0.1 -> 0 Inexact Rounded
-ddintx004 tointegralx 0.2 -> 0 Inexact Rounded
-ddintx005 tointegralx 0.3 -> 0 Inexact Rounded
-ddintx006 tointegralx 0.4 -> 0 Inexact Rounded
-ddintx007 tointegralx 0.5 -> 0 Inexact Rounded
-ddintx008 tointegralx 0.6 -> 1 Inexact Rounded
-ddintx009 tointegralx 0.7 -> 1 Inexact Rounded
-ddintx010 tointegralx 0.8 -> 1 Inexact Rounded
-ddintx011 tointegralx 0.9 -> 1 Inexact Rounded
-ddintx012 tointegralx 1 -> 1
-ddintx013 tointegralx 1.0 -> 1 Rounded
-ddintx014 tointegralx 1.1 -> 1 Inexact Rounded
-ddintx015 tointegralx 1.2 -> 1 Inexact Rounded
-ddintx016 tointegralx 1.3 -> 1 Inexact Rounded
-ddintx017 tointegralx 1.4 -> 1 Inexact Rounded
-ddintx018 tointegralx 1.5 -> 2 Inexact Rounded
-ddintx019 tointegralx 1.6 -> 2 Inexact Rounded
-ddintx020 tointegralx 1.7 -> 2 Inexact Rounded
-ddintx021 tointegralx 1.8 -> 2 Inexact Rounded
-ddintx022 tointegralx 1.9 -> 2 Inexact Rounded
--- negatives
-ddintx031 tointegralx -0 -> -0
-ddintx032 tointegralx -0.0 -> -0
-ddintx033 tointegralx -0.1 -> -0 Inexact Rounded
-ddintx034 tointegralx -0.2 -> -0 Inexact Rounded
-ddintx035 tointegralx -0.3 -> -0 Inexact Rounded
-ddintx036 tointegralx -0.4 -> -0 Inexact Rounded
-ddintx037 tointegralx -0.5 -> -0 Inexact Rounded
-ddintx038 tointegralx -0.6 -> -1 Inexact Rounded
-ddintx039 tointegralx -0.7 -> -1 Inexact Rounded
-ddintx040 tointegralx -0.8 -> -1 Inexact Rounded
-ddintx041 tointegralx -0.9 -> -1 Inexact Rounded
-ddintx042 tointegralx -1 -> -1
-ddintx043 tointegralx -1.0 -> -1 Rounded
-ddintx044 tointegralx -1.1 -> -1 Inexact Rounded
-ddintx045 tointegralx -1.2 -> -1 Inexact Rounded
-ddintx046 tointegralx -1.3 -> -1 Inexact Rounded
-ddintx047 tointegralx -1.4 -> -1 Inexact Rounded
-ddintx048 tointegralx -1.5 -> -2 Inexact Rounded
-ddintx049 tointegralx -1.6 -> -2 Inexact Rounded
-ddintx050 tointegralx -1.7 -> -2 Inexact Rounded
-ddintx051 tointegralx -1.8 -> -2 Inexact Rounded
-ddintx052 tointegralx -1.9 -> -2 Inexact Rounded
--- next two would be NaN using quantize(x, 0)
-ddintx053 tointegralx 10E+60 -> 1.0E+61
-ddintx054 tointegralx -10E+60 -> -1.0E+61
-
--- numbers around precision
-ddintx060 tointegralx '56267E-17' -> '0' Inexact Rounded
-ddintx061 tointegralx '56267E-5' -> '1' Inexact Rounded
-ddintx062 tointegralx '56267E-2' -> '563' Inexact Rounded
-ddintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
-ddintx065 tointegralx '56267E-0' -> '56267'
-ddintx066 tointegralx '56267E+0' -> '56267'
-ddintx067 tointegralx '56267E+1' -> '5.6267E+5'
-ddintx068 tointegralx '56267E+9' -> '5.6267E+13'
-ddintx069 tointegralx '56267E+10' -> '5.6267E+14'
-ddintx070 tointegralx '56267E+11' -> '5.6267E+15'
-ddintx071 tointegralx '56267E+12' -> '5.6267E+16'
-ddintx072 tointegralx '56267E+13' -> '5.6267E+17'
-ddintx073 tointegralx '1.23E+96' -> '1.23E+96'
-ddintx074 tointegralx '1.23E+384' -> #47fd300000000000 Clamped
-
-ddintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
-ddintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
-ddintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
-ddintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
-ddintx085 tointegralx '-56267E-0' -> '-56267'
-ddintx086 tointegralx '-56267E+0' -> '-56267'
-ddintx087 tointegralx '-56267E+1' -> '-5.6267E+5'
-ddintx088 tointegralx '-56267E+9' -> '-5.6267E+13'
-ddintx089 tointegralx '-56267E+10' -> '-5.6267E+14'
-ddintx090 tointegralx '-56267E+11' -> '-5.6267E+15'
-ddintx091 tointegralx '-56267E+12' -> '-5.6267E+16'
-ddintx092 tointegralx '-56267E+13' -> '-5.6267E+17'
-ddintx093 tointegralx '-1.23E+96' -> '-1.23E+96'
-ddintx094 tointegralx '-1.23E+384' -> #c7fd300000000000 Clamped
-
--- subnormal inputs
-ddintx100 tointegralx 1E-299 -> 0 Inexact Rounded
-ddintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded
-ddintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded
-ddintx103 tointegralx 0E-299 -> 0
-
--- specials and zeros
-ddintx120 tointegralx 'Inf' -> Infinity
-ddintx121 tointegralx '-Inf' -> -Infinity
-ddintx122 tointegralx NaN -> NaN
-ddintx123 tointegralx sNaN -> NaN Invalid_operation
-ddintx124 tointegralx 0 -> 0
-ddintx125 tointegralx -0 -> -0
-ddintx126 tointegralx 0.000 -> 0
-ddintx127 tointegralx 0.00 -> 0
-ddintx128 tointegralx 0.0 -> 0
-ddintx129 tointegralx 0 -> 0
-ddintx130 tointegralx 0E-3 -> 0
-ddintx131 tointegralx 0E-2 -> 0
-ddintx132 tointegralx 0E-1 -> 0
-ddintx133 tointegralx 0E-0 -> 0
-ddintx134 tointegralx 0E+1 -> 0E+1
-ddintx135 tointegralx 0E+2 -> 0E+2
-ddintx136 tointegralx 0E+3 -> 0E+3
-ddintx137 tointegralx 0E+4 -> 0E+4
-ddintx138 tointegralx 0E+5 -> 0E+5
-ddintx139 tointegralx -0.000 -> -0
-ddintx140 tointegralx -0.00 -> -0
-ddintx141 tointegralx -0.0 -> -0
-ddintx142 tointegralx -0 -> -0
-ddintx143 tointegralx -0E-3 -> -0
-ddintx144 tointegralx -0E-2 -> -0
-ddintx145 tointegralx -0E-1 -> -0
-ddintx146 tointegralx -0E-0 -> -0
-ddintx147 tointegralx -0E+1 -> -0E+1
-ddintx148 tointegralx -0E+2 -> -0E+2
-ddintx149 tointegralx -0E+3 -> -0E+3
-ddintx150 tointegralx -0E+4 -> -0E+4
-ddintx151 tointegralx -0E+5 -> -0E+5
--- propagating NaNs
-ddintx152 tointegralx NaN808 -> NaN808
-ddintx153 tointegralx sNaN080 -> NaN80 Invalid_operation
-ddintx154 tointegralx -NaN808 -> -NaN808
-ddintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
-ddintx156 tointegralx -NaN -> -NaN
-ddintx157 tointegralx -sNaN -> -NaN Invalid_operation
-
--- examples
-rounding: half_up
-ddintx200 tointegralx 2.1 -> 2 Inexact Rounded
-ddintx201 tointegralx 100 -> 100
-ddintx202 tointegralx 100.0 -> 100 Rounded
-ddintx203 tointegralx 101.5 -> 102 Inexact Rounded
-ddintx204 tointegralx -101.5 -> -102 Inexact Rounded
-ddintx205 tointegralx 10E+5 -> 1.0E+6
-ddintx206 tointegralx 7.89E+77 -> 7.89E+77
-ddintx207 tointegralx -Inf -> -Infinity
-
-
--- all rounding modes
-rounding: half_even
-ddintx210 tointegralx 55.5 -> 56 Inexact Rounded
-ddintx211 tointegralx 56.5 -> 56 Inexact Rounded
-ddintx212 tointegralx 57.5 -> 58 Inexact Rounded
-ddintx213 tointegralx -55.5 -> -56 Inexact Rounded
-ddintx214 tointegralx -56.5 -> -56 Inexact Rounded
-ddintx215 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_up
-
-ddintx220 tointegralx 55.5 -> 56 Inexact Rounded
-ddintx221 tointegralx 56.5 -> 57 Inexact Rounded
-ddintx222 tointegralx 57.5 -> 58 Inexact Rounded
-ddintx223 tointegralx -55.5 -> -56 Inexact Rounded
-ddintx224 tointegralx -56.5 -> -57 Inexact Rounded
-ddintx225 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_down
-
-ddintx230 tointegralx 55.5 -> 55 Inexact Rounded
-ddintx231 tointegralx 56.5 -> 56 Inexact Rounded
-ddintx232 tointegralx 57.5 -> 57 Inexact Rounded
-ddintx233 tointegralx -55.5 -> -55 Inexact Rounded
-ddintx234 tointegralx -56.5 -> -56 Inexact Rounded
-ddintx235 tointegralx -57.5 -> -57 Inexact Rounded
-
-rounding: up
-
-ddintx240 tointegralx 55.3 -> 56 Inexact Rounded
-ddintx241 tointegralx 56.3 -> 57 Inexact Rounded
-ddintx242 tointegralx 57.3 -> 58 Inexact Rounded
-ddintx243 tointegralx -55.3 -> -56 Inexact Rounded
-ddintx244 tointegralx -56.3 -> -57 Inexact Rounded
-ddintx245 tointegralx -57.3 -> -58 Inexact Rounded
-
-rounding: down
-
-ddintx250 tointegralx 55.7 -> 55 Inexact Rounded
-ddintx251 tointegralx 56.7 -> 56 Inexact Rounded
-ddintx252 tointegralx 57.7 -> 57 Inexact Rounded
-ddintx253 tointegralx -55.7 -> -55 Inexact Rounded
-ddintx254 tointegralx -56.7 -> -56 Inexact Rounded
-ddintx255 tointegralx -57.7 -> -57 Inexact Rounded
-
-rounding: ceiling
-
-ddintx260 tointegralx 55.3 -> 56 Inexact Rounded
-ddintx261 tointegralx 56.3 -> 57 Inexact Rounded
-ddintx262 tointegralx 57.3 -> 58 Inexact Rounded
-ddintx263 tointegralx -55.3 -> -55 Inexact Rounded
-ddintx264 tointegralx -56.3 -> -56 Inexact Rounded
-ddintx265 tointegralx -57.3 -> -57 Inexact Rounded
-
-rounding: floor
-
-ddintx270 tointegralx 55.7 -> 55 Inexact Rounded
-ddintx271 tointegralx 56.7 -> 56 Inexact Rounded
-ddintx272 tointegralx 57.7 -> 57 Inexact Rounded
-ddintx273 tointegralx -55.7 -> -56 Inexact Rounded
-ddintx274 tointegralx -56.7 -> -57 Inexact Rounded
-ddintx275 tointegralx -57.7 -> -58 Inexact Rounded
-
--- Int and uInt32 edge values for testing conversions
-ddintx300 tointegralx -2147483646 -> -2147483646
-ddintx301 tointegralx -2147483647 -> -2147483647
-ddintx302 tointegralx -2147483648 -> -2147483648
-ddintx303 tointegralx -2147483649 -> -2147483649
-ddintx304 tointegralx 2147483646 -> 2147483646
-ddintx305 tointegralx 2147483647 -> 2147483647
-ddintx306 tointegralx 2147483648 -> 2147483648
-ddintx307 tointegralx 2147483649 -> 2147483649
-ddintx308 tointegralx 4294967294 -> 4294967294
-ddintx309 tointegralx 4294967295 -> 4294967295
-ddintx310 tointegralx 4294967296 -> 4294967296
-ddintx311 tointegralx 4294967297 -> 4294967297
-
+------------------------------------------------------------------------
+-- ddToIntegral.decTest -- round Double to integral value --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests tests the extended specification 'round-to-integral
+-- value-exact' operations (from IEEE 854, later modified in 754r).
+-- All non-zero results are defined as being those from either copy or
+-- quantize, so those are assumed to have been tested extensively
+-- elsewhere; the tests here are for integrity, rounding mode, etc.
+-- Also, it is assumed the test harness will use these tests for both
+-- ToIntegralExact (which does set Inexact) and the fixed-name
+-- functions (which do not set Inexact).
+
+-- Note that decNumber implements an earlier definition of toIntegral
+-- which never sets Inexact; the decTest operator for that is called
+-- 'tointegral' instead of 'tointegralx'.
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+ddintx001 tointegralx 0 -> 0
+ddintx002 tointegralx 0.0 -> 0
+ddintx003 tointegralx 0.1 -> 0 Inexact Rounded
+ddintx004 tointegralx 0.2 -> 0 Inexact Rounded
+ddintx005 tointegralx 0.3 -> 0 Inexact Rounded
+ddintx006 tointegralx 0.4 -> 0 Inexact Rounded
+ddintx007 tointegralx 0.5 -> 0 Inexact Rounded
+ddintx008 tointegralx 0.6 -> 1 Inexact Rounded
+ddintx009 tointegralx 0.7 -> 1 Inexact Rounded
+ddintx010 tointegralx 0.8 -> 1 Inexact Rounded
+ddintx011 tointegralx 0.9 -> 1 Inexact Rounded
+ddintx012 tointegralx 1 -> 1
+ddintx013 tointegralx 1.0 -> 1 Rounded
+ddintx014 tointegralx 1.1 -> 1 Inexact Rounded
+ddintx015 tointegralx 1.2 -> 1 Inexact Rounded
+ddintx016 tointegralx 1.3 -> 1 Inexact Rounded
+ddintx017 tointegralx 1.4 -> 1 Inexact Rounded
+ddintx018 tointegralx 1.5 -> 2 Inexact Rounded
+ddintx019 tointegralx 1.6 -> 2 Inexact Rounded
+ddintx020 tointegralx 1.7 -> 2 Inexact Rounded
+ddintx021 tointegralx 1.8 -> 2 Inexact Rounded
+ddintx022 tointegralx 1.9 -> 2 Inexact Rounded
+-- negatives
+ddintx031 tointegralx -0 -> -0
+ddintx032 tointegralx -0.0 -> -0
+ddintx033 tointegralx -0.1 -> -0 Inexact Rounded
+ddintx034 tointegralx -0.2 -> -0 Inexact Rounded
+ddintx035 tointegralx -0.3 -> -0 Inexact Rounded
+ddintx036 tointegralx -0.4 -> -0 Inexact Rounded
+ddintx037 tointegralx -0.5 -> -0 Inexact Rounded
+ddintx038 tointegralx -0.6 -> -1 Inexact Rounded
+ddintx039 tointegralx -0.7 -> -1 Inexact Rounded
+ddintx040 tointegralx -0.8 -> -1 Inexact Rounded
+ddintx041 tointegralx -0.9 -> -1 Inexact Rounded
+ddintx042 tointegralx -1 -> -1
+ddintx043 tointegralx -1.0 -> -1 Rounded
+ddintx044 tointegralx -1.1 -> -1 Inexact Rounded
+ddintx045 tointegralx -1.2 -> -1 Inexact Rounded
+ddintx046 tointegralx -1.3 -> -1 Inexact Rounded
+ddintx047 tointegralx -1.4 -> -1 Inexact Rounded
+ddintx048 tointegralx -1.5 -> -2 Inexact Rounded
+ddintx049 tointegralx -1.6 -> -2 Inexact Rounded
+ddintx050 tointegralx -1.7 -> -2 Inexact Rounded
+ddintx051 tointegralx -1.8 -> -2 Inexact Rounded
+ddintx052 tointegralx -1.9 -> -2 Inexact Rounded
+-- next two would be NaN using quantize(x, 0)
+ddintx053 tointegralx 10E+60 -> 1.0E+61
+ddintx054 tointegralx -10E+60 -> -1.0E+61
+
+-- numbers around precision
+ddintx060 tointegralx '56267E-17' -> '0' Inexact Rounded
+ddintx061 tointegralx '56267E-5' -> '1' Inexact Rounded
+ddintx062 tointegralx '56267E-2' -> '563' Inexact Rounded
+ddintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
+ddintx065 tointegralx '56267E-0' -> '56267'
+ddintx066 tointegralx '56267E+0' -> '56267'
+ddintx067 tointegralx '56267E+1' -> '5.6267E+5'
+ddintx068 tointegralx '56267E+9' -> '5.6267E+13'
+ddintx069 tointegralx '56267E+10' -> '5.6267E+14'
+ddintx070 tointegralx '56267E+11' -> '5.6267E+15'
+ddintx071 tointegralx '56267E+12' -> '5.6267E+16'
+ddintx072 tointegralx '56267E+13' -> '5.6267E+17'
+ddintx073 tointegralx '1.23E+96' -> '1.23E+96'
+ddintx074 tointegralx '1.23E+384' -> #47fd300000000000 Clamped
+
+ddintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
+ddintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
+ddintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
+ddintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
+ddintx085 tointegralx '-56267E-0' -> '-56267'
+ddintx086 tointegralx '-56267E+0' -> '-56267'
+ddintx087 tointegralx '-56267E+1' -> '-5.6267E+5'
+ddintx088 tointegralx '-56267E+9' -> '-5.6267E+13'
+ddintx089 tointegralx '-56267E+10' -> '-5.6267E+14'
+ddintx090 tointegralx '-56267E+11' -> '-5.6267E+15'
+ddintx091 tointegralx '-56267E+12' -> '-5.6267E+16'
+ddintx092 tointegralx '-56267E+13' -> '-5.6267E+17'
+ddintx093 tointegralx '-1.23E+96' -> '-1.23E+96'
+ddintx094 tointegralx '-1.23E+384' -> #c7fd300000000000 Clamped
+
+-- subnormal inputs
+ddintx100 tointegralx 1E-299 -> 0 Inexact Rounded
+ddintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded
+ddintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded
+ddintx103 tointegralx 0E-299 -> 0
+
+-- specials and zeros
+ddintx120 tointegralx 'Inf' -> Infinity
+ddintx121 tointegralx '-Inf' -> -Infinity
+ddintx122 tointegralx NaN -> NaN
+ddintx123 tointegralx sNaN -> NaN Invalid_operation
+ddintx124 tointegralx 0 -> 0
+ddintx125 tointegralx -0 -> -0
+ddintx126 tointegralx 0.000 -> 0
+ddintx127 tointegralx 0.00 -> 0
+ddintx128 tointegralx 0.0 -> 0
+ddintx129 tointegralx 0 -> 0
+ddintx130 tointegralx 0E-3 -> 0
+ddintx131 tointegralx 0E-2 -> 0
+ddintx132 tointegralx 0E-1 -> 0
+ddintx133 tointegralx 0E-0 -> 0
+ddintx134 tointegralx 0E+1 -> 0E+1
+ddintx135 tointegralx 0E+2 -> 0E+2
+ddintx136 tointegralx 0E+3 -> 0E+3
+ddintx137 tointegralx 0E+4 -> 0E+4
+ddintx138 tointegralx 0E+5 -> 0E+5
+ddintx139 tointegralx -0.000 -> -0
+ddintx140 tointegralx -0.00 -> -0
+ddintx141 tointegralx -0.0 -> -0
+ddintx142 tointegralx -0 -> -0
+ddintx143 tointegralx -0E-3 -> -0
+ddintx144 tointegralx -0E-2 -> -0
+ddintx145 tointegralx -0E-1 -> -0
+ddintx146 tointegralx -0E-0 -> -0
+ddintx147 tointegralx -0E+1 -> -0E+1
+ddintx148 tointegralx -0E+2 -> -0E+2
+ddintx149 tointegralx -0E+3 -> -0E+3
+ddintx150 tointegralx -0E+4 -> -0E+4
+ddintx151 tointegralx -0E+5 -> -0E+5
+-- propagating NaNs
+ddintx152 tointegralx NaN808 -> NaN808
+ddintx153 tointegralx sNaN080 -> NaN80 Invalid_operation
+ddintx154 tointegralx -NaN808 -> -NaN808
+ddintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
+ddintx156 tointegralx -NaN -> -NaN
+ddintx157 tointegralx -sNaN -> -NaN Invalid_operation
+
+-- examples
+rounding: half_up
+ddintx200 tointegralx 2.1 -> 2 Inexact Rounded
+ddintx201 tointegralx 100 -> 100
+ddintx202 tointegralx 100.0 -> 100 Rounded
+ddintx203 tointegralx 101.5 -> 102 Inexact Rounded
+ddintx204 tointegralx -101.5 -> -102 Inexact Rounded
+ddintx205 tointegralx 10E+5 -> 1.0E+6
+ddintx206 tointegralx 7.89E+77 -> 7.89E+77
+ddintx207 tointegralx -Inf -> -Infinity
+
+
+-- all rounding modes
+rounding: half_even
+ddintx210 tointegralx 55.5 -> 56 Inexact Rounded
+ddintx211 tointegralx 56.5 -> 56 Inexact Rounded
+ddintx212 tointegralx 57.5 -> 58 Inexact Rounded
+ddintx213 tointegralx -55.5 -> -56 Inexact Rounded
+ddintx214 tointegralx -56.5 -> -56 Inexact Rounded
+ddintx215 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_up
+
+ddintx220 tointegralx 55.5 -> 56 Inexact Rounded
+ddintx221 tointegralx 56.5 -> 57 Inexact Rounded
+ddintx222 tointegralx 57.5 -> 58 Inexact Rounded
+ddintx223 tointegralx -55.5 -> -56 Inexact Rounded
+ddintx224 tointegralx -56.5 -> -57 Inexact Rounded
+ddintx225 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_down
+
+ddintx230 tointegralx 55.5 -> 55 Inexact Rounded
+ddintx231 tointegralx 56.5 -> 56 Inexact Rounded
+ddintx232 tointegralx 57.5 -> 57 Inexact Rounded
+ddintx233 tointegralx -55.5 -> -55 Inexact Rounded
+ddintx234 tointegralx -56.5 -> -56 Inexact Rounded
+ddintx235 tointegralx -57.5 -> -57 Inexact Rounded
+
+rounding: up
+
+ddintx240 tointegralx 55.3 -> 56 Inexact Rounded
+ddintx241 tointegralx 56.3 -> 57 Inexact Rounded
+ddintx242 tointegralx 57.3 -> 58 Inexact Rounded
+ddintx243 tointegralx -55.3 -> -56 Inexact Rounded
+ddintx244 tointegralx -56.3 -> -57 Inexact Rounded
+ddintx245 tointegralx -57.3 -> -58 Inexact Rounded
+
+rounding: down
+
+ddintx250 tointegralx 55.7 -> 55 Inexact Rounded
+ddintx251 tointegralx 56.7 -> 56 Inexact Rounded
+ddintx252 tointegralx 57.7 -> 57 Inexact Rounded
+ddintx253 tointegralx -55.7 -> -55 Inexact Rounded
+ddintx254 tointegralx -56.7 -> -56 Inexact Rounded
+ddintx255 tointegralx -57.7 -> -57 Inexact Rounded
+
+rounding: ceiling
+
+ddintx260 tointegralx 55.3 -> 56 Inexact Rounded
+ddintx261 tointegralx 56.3 -> 57 Inexact Rounded
+ddintx262 tointegralx 57.3 -> 58 Inexact Rounded
+ddintx263 tointegralx -55.3 -> -55 Inexact Rounded
+ddintx264 tointegralx -56.3 -> -56 Inexact Rounded
+ddintx265 tointegralx -57.3 -> -57 Inexact Rounded
+
+rounding: floor
+
+ddintx270 tointegralx 55.7 -> 55 Inexact Rounded
+ddintx271 tointegralx 56.7 -> 56 Inexact Rounded
+ddintx272 tointegralx 57.7 -> 57 Inexact Rounded
+ddintx273 tointegralx -55.7 -> -56 Inexact Rounded
+ddintx274 tointegralx -56.7 -> -57 Inexact Rounded
+ddintx275 tointegralx -57.7 -> -58 Inexact Rounded
+
+-- Int and uInt32 edge values for testing conversions
+ddintx300 tointegralx -2147483646 -> -2147483646
+ddintx301 tointegralx -2147483647 -> -2147483647
+ddintx302 tointegralx -2147483648 -> -2147483648
+ddintx303 tointegralx -2147483649 -> -2147483649
+ddintx304 tointegralx 2147483646 -> 2147483646
+ddintx305 tointegralx 2147483647 -> 2147483647
+ddintx306 tointegralx 2147483648 -> 2147483648
+ddintx307 tointegralx 2147483649 -> 2147483649
+ddintx308 tointegralx 4294967294 -> 4294967294
+ddintx309 tointegralx 4294967295 -> 4294967295
+ddintx310 tointegralx 4294967296 -> 4294967296
+ddintx311 tointegralx 4294967297 -> 4294967297
+
diff --git a/Lib/test/decimaltestdata/ddXor.decTest b/Lib/test/decimaltestdata/ddXor.decTest
index 3c55548e5e..131c7eb4b0 100644
--- a/Lib/test/decimaltestdata/ddXor.decTest
+++ b/Lib/test/decimaltestdata/ddXor.decTest
@@ -1,337 +1,337 @@
-------------------------------------------------------------------------
--- ddXor.decTest -- digitwise logical XOR for decDoubles --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-precision: 16
-maxExponent: 384
-minExponent: -383
-extended: 1
-clamp: 1
-rounding: half_even
-
--- Sanity check (truth table)
-ddxor001 xor 0 0 -> 0
-ddxor002 xor 0 1 -> 1
-ddxor003 xor 1 0 -> 1
-ddxor004 xor 1 1 -> 0
-ddxor005 xor 1100 1010 -> 110
--- and at msd and msd-1
-ddxor006 xor 0000000000000000 0000000000000000 -> 0
-ddxor007 xor 0000000000000000 1000000000000000 -> 1000000000000000
-ddxor008 xor 1000000000000000 0000000000000000 -> 1000000000000000
-ddxor009 xor 1000000000000000 1000000000000000 -> 0
-ddxor010 xor 0000000000000000 0000000000000000 -> 0
-ddxor011 xor 0000000000000000 0100000000000000 -> 100000000000000
-ddxor012 xor 0100000000000000 0000000000000000 -> 100000000000000
-ddxor013 xor 0100000000000000 0100000000000000 -> 0
-
--- Various lengths
--- 1234567890123456 1234567890123456 1234567890123456
-ddxor021 xor 1111111110000000 1111111110000000 -> 0
-ddxor022 xor 111111110000000 111111110000000 -> 0
-ddxor023 xor 11111110000000 11111110000000 -> 0
-ddxor024 xor 1111110000000 1111110000000 -> 0
-ddxor025 xor 111110000000 111110000000 -> 0
-ddxor026 xor 11110000000 11110000000 -> 0
-ddxor027 xor 1110000000 1110000000 -> 0
-ddxor028 xor 110000000 110000000 -> 0
-ddxor029 xor 10000000 10000000 -> 0
-ddxor030 xor 1000000 1000000 -> 0
-ddxor031 xor 100000 100000 -> 0
-ddxor032 xor 10000 10000 -> 0
-ddxor033 xor 1000 1000 -> 0
-ddxor034 xor 100 100 -> 0
-ddxor035 xor 10 10 -> 0
-ddxor036 xor 1 1 -> 0
-
-ddxor040 xor 111111111 111111111111 -> 111000000000
-ddxor041 xor 11111111 111111111111 -> 111100000000
-ddxor042 xor 11111111 111111111 -> 100000000
-ddxor043 xor 1111111 100000010 -> 101111101
-ddxor044 xor 111111 100000100 -> 100111011
-ddxor045 xor 11111 100001000 -> 100010111
-ddxor046 xor 1111 100010000 -> 100011111
-ddxor047 xor 111 100100000 -> 100100111
-ddxor048 xor 11 101000000 -> 101000011
-ddxor049 xor 1 110000000 -> 110000001
-
-ddxor050 xor 1111111111 1 -> 1111111110
-ddxor051 xor 111111111 1 -> 111111110
-ddxor052 xor 11111111 1 -> 11111110
-ddxor053 xor 1111111 1 -> 1111110
-ddxor054 xor 111111 1 -> 111110
-ddxor055 xor 11111 1 -> 11110
-ddxor056 xor 1111 1 -> 1110
-ddxor057 xor 111 1 -> 110
-ddxor058 xor 11 1 -> 10
-ddxor059 xor 1 1 -> 0
-
-ddxor060 xor 1111111111 0 -> 1111111111
-ddxor061 xor 111111111 0 -> 111111111
-ddxor062 xor 11111111 0 -> 11111111
-ddxor063 xor 1111111 0 -> 1111111
-ddxor064 xor 111111 0 -> 111111
-ddxor065 xor 11111 0 -> 11111
-ddxor066 xor 1111 0 -> 1111
-ddxor067 xor 111 0 -> 111
-ddxor068 xor 11 0 -> 11
-ddxor069 xor 1 0 -> 1
-
-ddxor070 xor 1 1111111111 -> 1111111110
-ddxor071 xor 1 111111111 -> 111111110
-ddxor072 xor 1 11111111 -> 11111110
-ddxor073 xor 1 1111111 -> 1111110
-ddxor074 xor 1 111111 -> 111110
-ddxor075 xor 1 11111 -> 11110
-ddxor076 xor 1 1111 -> 1110
-ddxor077 xor 1 111 -> 110
-ddxor078 xor 1 11 -> 10
-ddxor079 xor 1 1 -> 0
-
-ddxor080 xor 0 1111111111 -> 1111111111
-ddxor081 xor 0 111111111 -> 111111111
-ddxor082 xor 0 11111111 -> 11111111
-ddxor083 xor 0 1111111 -> 1111111
-ddxor084 xor 0 111111 -> 111111
-ddxor085 xor 0 11111 -> 11111
-ddxor086 xor 0 1111 -> 1111
-ddxor087 xor 0 111 -> 111
-ddxor088 xor 0 11 -> 11
-ddxor089 xor 0 1 -> 1
-
-ddxor090 xor 011111111 111101111 -> 100010000
-ddxor091 xor 101111111 111101111 -> 10010000
-ddxor092 xor 110111111 111101111 -> 1010000
-ddxor093 xor 111011111 111101111 -> 110000
-ddxor094 xor 111101111 111101111 -> 0
-ddxor095 xor 111110111 111101111 -> 11000
-ddxor096 xor 111111011 111101111 -> 10100
-ddxor097 xor 111111101 111101111 -> 10010
-ddxor098 xor 111111110 111101111 -> 10001
-
-ddxor100 xor 111101111 011111111 -> 100010000
-ddxor101 xor 111101111 101111111 -> 10010000
-ddxor102 xor 111101111 110111111 -> 1010000
-ddxor103 xor 111101111 111011111 -> 110000
-ddxor104 xor 111101111 111101111 -> 0
-ddxor105 xor 111101111 111110111 -> 11000
-ddxor106 xor 111101111 111111011 -> 10100
-ddxor107 xor 111101111 111111101 -> 10010
-ddxor108 xor 111101111 111111110 -> 10001
-
--- non-0/1 should not be accepted, nor should signs
-ddxor220 xor 111111112 111111111 -> NaN Invalid_operation
-ddxor221 xor 333333333 333333333 -> NaN Invalid_operation
-ddxor222 xor 555555555 555555555 -> NaN Invalid_operation
-ddxor223 xor 777777777 777777777 -> NaN Invalid_operation
-ddxor224 xor 999999999 999999999 -> NaN Invalid_operation
-ddxor225 xor 222222222 999999999 -> NaN Invalid_operation
-ddxor226 xor 444444444 999999999 -> NaN Invalid_operation
-ddxor227 xor 666666666 999999999 -> NaN Invalid_operation
-ddxor228 xor 888888888 999999999 -> NaN Invalid_operation
-ddxor229 xor 999999999 222222222 -> NaN Invalid_operation
-ddxor230 xor 999999999 444444444 -> NaN Invalid_operation
-ddxor231 xor 999999999 666666666 -> NaN Invalid_operation
-ddxor232 xor 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-ddxor240 xor 567468689 -934981942 -> NaN Invalid_operation
-ddxor241 xor 567367689 934981942 -> NaN Invalid_operation
-ddxor242 xor -631917772 -706014634 -> NaN Invalid_operation
-ddxor243 xor -756253257 138579234 -> NaN Invalid_operation
-ddxor244 xor 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-ddxor250 xor 2000000000000000 1000000000000000 -> NaN Invalid_operation
-ddxor251 xor 7000000000000000 1000000000000000 -> NaN Invalid_operation
-ddxor252 xor 8000000000000000 1000000000000000 -> NaN Invalid_operation
-ddxor253 xor 9000000000000000 1000000000000000 -> NaN Invalid_operation
-ddxor254 xor 2000000000000000 0000000000000000 -> NaN Invalid_operation
-ddxor255 xor 7000000000000000 0000000000000000 -> NaN Invalid_operation
-ddxor256 xor 8000000000000000 0000000000000000 -> NaN Invalid_operation
-ddxor257 xor 9000000000000000 0000000000000000 -> NaN Invalid_operation
-ddxor258 xor 1000000000000000 2000000000000000 -> NaN Invalid_operation
-ddxor259 xor 1000000000000000 7000000000000000 -> NaN Invalid_operation
-ddxor260 xor 1000000000000000 8000000000000000 -> NaN Invalid_operation
-ddxor261 xor 1000000000000000 9000000000000000 -> NaN Invalid_operation
-ddxor262 xor 0000000000000000 2000000000000000 -> NaN Invalid_operation
-ddxor263 xor 0000000000000000 7000000000000000 -> NaN Invalid_operation
-ddxor264 xor 0000000000000000 8000000000000000 -> NaN Invalid_operation
-ddxor265 xor 0000000000000000 9000000000000000 -> NaN Invalid_operation
--- test MSD-1
-ddxor270 xor 0200001000000000 1000100000000010 -> NaN Invalid_operation
-ddxor271 xor 0700000100000000 1000010000000100 -> NaN Invalid_operation
-ddxor272 xor 0800000010000000 1000001000001000 -> NaN Invalid_operation
-ddxor273 xor 0900000001000000 1000000100010000 -> NaN Invalid_operation
-ddxor274 xor 1000000000100000 0200000010100000 -> NaN Invalid_operation
-ddxor275 xor 1000000000010000 0700000001000000 -> NaN Invalid_operation
-ddxor276 xor 1000000000001000 0800000010100000 -> NaN Invalid_operation
-ddxor277 xor 1000000000000100 0900000000010000 -> NaN Invalid_operation
--- test LSD
-ddxor280 xor 0010000000000002 1000000100000001 -> NaN Invalid_operation
-ddxor281 xor 0001000000000007 1000001000000011 -> NaN Invalid_operation
-ddxor282 xor 0000100000000008 1000010000000001 -> NaN Invalid_operation
-ddxor283 xor 0000010000000009 1000100000000001 -> NaN Invalid_operation
-ddxor284 xor 1000001000000000 0001000000000002 -> NaN Invalid_operation
-ddxor285 xor 1000000100000000 0010000000000007 -> NaN Invalid_operation
-ddxor286 xor 1000000010000000 0100000000000008 -> NaN Invalid_operation
-ddxor287 xor 1000000001000000 1000000000000009 -> NaN Invalid_operation
--- test Middie
-ddxor288 xor 0010000020000000 1000001000000000 -> NaN Invalid_operation
-ddxor289 xor 0001000070000001 1000000100000000 -> NaN Invalid_operation
-ddxor290 xor 0000100080000010 1000000010000000 -> NaN Invalid_operation
-ddxor291 xor 0000010090000100 1000000001000000 -> NaN Invalid_operation
-ddxor292 xor 1000001000001000 0000000020100000 -> NaN Invalid_operation
-ddxor293 xor 1000000100010000 0000000070010000 -> NaN Invalid_operation
-ddxor294 xor 1000000010100000 0000000080001000 -> NaN Invalid_operation
-ddxor295 xor 1000000001000000 0000000090000100 -> NaN Invalid_operation
--- signs
-ddxor296 xor -1000000001000000 -0000010000000100 -> NaN Invalid_operation
-ddxor297 xor -1000000001000000 0000000010000100 -> NaN Invalid_operation
-ddxor298 xor 1000000001000000 -0000001000000100 -> NaN Invalid_operation
-ddxor299 xor 1000000001000000 0000000011000100 -> 1000000010000100
-
--- Nmax, Nmin, Ntiny-like
-ddxor331 xor 2 9.99999999E+299 -> NaN Invalid_operation
-ddxor332 xor 3 1E-299 -> NaN Invalid_operation
-ddxor333 xor 4 1.00000000E-299 -> NaN Invalid_operation
-ddxor334 xor 5 1E-200 -> NaN Invalid_operation
-ddxor335 xor 6 -1E-200 -> NaN Invalid_operation
-ddxor336 xor 7 -1.00000000E-299 -> NaN Invalid_operation
-ddxor337 xor 8 -1E-299 -> NaN Invalid_operation
-ddxor338 xor 9 -9.99999999E+299 -> NaN Invalid_operation
-ddxor341 xor 9.99999999E+299 -18 -> NaN Invalid_operation
-ddxor342 xor 1E-299 01 -> NaN Invalid_operation
-ddxor343 xor 1.00000000E-299 -18 -> NaN Invalid_operation
-ddxor344 xor 1E-208 18 -> NaN Invalid_operation
-ddxor345 xor -1E-207 -10 -> NaN Invalid_operation
-ddxor346 xor -1.00000000E-299 18 -> NaN Invalid_operation
-ddxor347 xor -1E-299 10 -> NaN Invalid_operation
-ddxor348 xor -9.99999999E+299 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-ddxor361 xor 1.0 1 -> NaN Invalid_operation
-ddxor362 xor 1E+1 1 -> NaN Invalid_operation
-ddxor363 xor 0.0 1 -> NaN Invalid_operation
-ddxor364 xor 0E+1 1 -> NaN Invalid_operation
-ddxor365 xor 9.9 1 -> NaN Invalid_operation
-ddxor366 xor 9E+1 1 -> NaN Invalid_operation
-ddxor371 xor 0 1.0 -> NaN Invalid_operation
-ddxor372 xor 0 1E+1 -> NaN Invalid_operation
-ddxor373 xor 0 0.0 -> NaN Invalid_operation
-ddxor374 xor 0 0E+1 -> NaN Invalid_operation
-ddxor375 xor 0 9.9 -> NaN Invalid_operation
-ddxor376 xor 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-ddxor780 xor -Inf -Inf -> NaN Invalid_operation
-ddxor781 xor -Inf -1000 -> NaN Invalid_operation
-ddxor782 xor -Inf -1 -> NaN Invalid_operation
-ddxor783 xor -Inf -0 -> NaN Invalid_operation
-ddxor784 xor -Inf 0 -> NaN Invalid_operation
-ddxor785 xor -Inf 1 -> NaN Invalid_operation
-ddxor786 xor -Inf 1000 -> NaN Invalid_operation
-ddxor787 xor -1000 -Inf -> NaN Invalid_operation
-ddxor788 xor -Inf -Inf -> NaN Invalid_operation
-ddxor789 xor -1 -Inf -> NaN Invalid_operation
-ddxor790 xor -0 -Inf -> NaN Invalid_operation
-ddxor791 xor 0 -Inf -> NaN Invalid_operation
-ddxor792 xor 1 -Inf -> NaN Invalid_operation
-ddxor793 xor 1000 -Inf -> NaN Invalid_operation
-ddxor794 xor Inf -Inf -> NaN Invalid_operation
-
-ddxor800 xor Inf -Inf -> NaN Invalid_operation
-ddxor801 xor Inf -1000 -> NaN Invalid_operation
-ddxor802 xor Inf -1 -> NaN Invalid_operation
-ddxor803 xor Inf -0 -> NaN Invalid_operation
-ddxor804 xor Inf 0 -> NaN Invalid_operation
-ddxor805 xor Inf 1 -> NaN Invalid_operation
-ddxor806 xor Inf 1000 -> NaN Invalid_operation
-ddxor807 xor Inf Inf -> NaN Invalid_operation
-ddxor808 xor -1000 Inf -> NaN Invalid_operation
-ddxor809 xor -Inf Inf -> NaN Invalid_operation
-ddxor810 xor -1 Inf -> NaN Invalid_operation
-ddxor811 xor -0 Inf -> NaN Invalid_operation
-ddxor812 xor 0 Inf -> NaN Invalid_operation
-ddxor813 xor 1 Inf -> NaN Invalid_operation
-ddxor814 xor 1000 Inf -> NaN Invalid_operation
-ddxor815 xor Inf Inf -> NaN Invalid_operation
-
-ddxor821 xor NaN -Inf -> NaN Invalid_operation
-ddxor822 xor NaN -1000 -> NaN Invalid_operation
-ddxor823 xor NaN -1 -> NaN Invalid_operation
-ddxor824 xor NaN -0 -> NaN Invalid_operation
-ddxor825 xor NaN 0 -> NaN Invalid_operation
-ddxor826 xor NaN 1 -> NaN Invalid_operation
-ddxor827 xor NaN 1000 -> NaN Invalid_operation
-ddxor828 xor NaN Inf -> NaN Invalid_operation
-ddxor829 xor NaN NaN -> NaN Invalid_operation
-ddxor830 xor -Inf NaN -> NaN Invalid_operation
-ddxor831 xor -1000 NaN -> NaN Invalid_operation
-ddxor832 xor -1 NaN -> NaN Invalid_operation
-ddxor833 xor -0 NaN -> NaN Invalid_operation
-ddxor834 xor 0 NaN -> NaN Invalid_operation
-ddxor835 xor 1 NaN -> NaN Invalid_operation
-ddxor836 xor 1000 NaN -> NaN Invalid_operation
-ddxor837 xor Inf NaN -> NaN Invalid_operation
-
-ddxor841 xor sNaN -Inf -> NaN Invalid_operation
-ddxor842 xor sNaN -1000 -> NaN Invalid_operation
-ddxor843 xor sNaN -1 -> NaN Invalid_operation
-ddxor844 xor sNaN -0 -> NaN Invalid_operation
-ddxor845 xor sNaN 0 -> NaN Invalid_operation
-ddxor846 xor sNaN 1 -> NaN Invalid_operation
-ddxor847 xor sNaN 1000 -> NaN Invalid_operation
-ddxor848 xor sNaN NaN -> NaN Invalid_operation
-ddxor849 xor sNaN sNaN -> NaN Invalid_operation
-ddxor850 xor NaN sNaN -> NaN Invalid_operation
-ddxor851 xor -Inf sNaN -> NaN Invalid_operation
-ddxor852 xor -1000 sNaN -> NaN Invalid_operation
-ddxor853 xor -1 sNaN -> NaN Invalid_operation
-ddxor854 xor -0 sNaN -> NaN Invalid_operation
-ddxor855 xor 0 sNaN -> NaN Invalid_operation
-ddxor856 xor 1 sNaN -> NaN Invalid_operation
-ddxor857 xor 1000 sNaN -> NaN Invalid_operation
-ddxor858 xor Inf sNaN -> NaN Invalid_operation
-ddxor859 xor NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-ddxor861 xor NaN1 -Inf -> NaN Invalid_operation
-ddxor862 xor +NaN2 -1000 -> NaN Invalid_operation
-ddxor863 xor NaN3 1000 -> NaN Invalid_operation
-ddxor864 xor NaN4 Inf -> NaN Invalid_operation
-ddxor865 xor NaN5 +NaN6 -> NaN Invalid_operation
-ddxor866 xor -Inf NaN7 -> NaN Invalid_operation
-ddxor867 xor -1000 NaN8 -> NaN Invalid_operation
-ddxor868 xor 1000 NaN9 -> NaN Invalid_operation
-ddxor869 xor Inf +NaN10 -> NaN Invalid_operation
-ddxor871 xor sNaN11 -Inf -> NaN Invalid_operation
-ddxor872 xor sNaN12 -1000 -> NaN Invalid_operation
-ddxor873 xor sNaN13 1000 -> NaN Invalid_operation
-ddxor874 xor sNaN14 NaN17 -> NaN Invalid_operation
-ddxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation
-ddxor876 xor NaN16 sNaN19 -> NaN Invalid_operation
-ddxor877 xor -Inf +sNaN20 -> NaN Invalid_operation
-ddxor878 xor -1000 sNaN21 -> NaN Invalid_operation
-ddxor879 xor 1000 sNaN22 -> NaN Invalid_operation
-ddxor880 xor Inf sNaN23 -> NaN Invalid_operation
-ddxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
-ddxor882 xor -NaN26 NaN28 -> NaN Invalid_operation
-ddxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
-ddxor884 xor 1000 -NaN30 -> NaN Invalid_operation
-ddxor885 xor 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- ddXor.decTest -- digitwise logical XOR for decDoubles --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+precision: 16
+maxExponent: 384
+minExponent: -383
+extended: 1
+clamp: 1
+rounding: half_even
+
+-- Sanity check (truth table)
+ddxor001 xor 0 0 -> 0
+ddxor002 xor 0 1 -> 1
+ddxor003 xor 1 0 -> 1
+ddxor004 xor 1 1 -> 0
+ddxor005 xor 1100 1010 -> 110
+-- and at msd and msd-1
+ddxor006 xor 0000000000000000 0000000000000000 -> 0
+ddxor007 xor 0000000000000000 1000000000000000 -> 1000000000000000
+ddxor008 xor 1000000000000000 0000000000000000 -> 1000000000000000
+ddxor009 xor 1000000000000000 1000000000000000 -> 0
+ddxor010 xor 0000000000000000 0000000000000000 -> 0
+ddxor011 xor 0000000000000000 0100000000000000 -> 100000000000000
+ddxor012 xor 0100000000000000 0000000000000000 -> 100000000000000
+ddxor013 xor 0100000000000000 0100000000000000 -> 0
+
+-- Various lengths
+-- 1234567890123456 1234567890123456 1234567890123456
+ddxor021 xor 1111111110000000 1111111110000000 -> 0
+ddxor022 xor 111111110000000 111111110000000 -> 0
+ddxor023 xor 11111110000000 11111110000000 -> 0
+ddxor024 xor 1111110000000 1111110000000 -> 0
+ddxor025 xor 111110000000 111110000000 -> 0
+ddxor026 xor 11110000000 11110000000 -> 0
+ddxor027 xor 1110000000 1110000000 -> 0
+ddxor028 xor 110000000 110000000 -> 0
+ddxor029 xor 10000000 10000000 -> 0
+ddxor030 xor 1000000 1000000 -> 0
+ddxor031 xor 100000 100000 -> 0
+ddxor032 xor 10000 10000 -> 0
+ddxor033 xor 1000 1000 -> 0
+ddxor034 xor 100 100 -> 0
+ddxor035 xor 10 10 -> 0
+ddxor036 xor 1 1 -> 0
+
+ddxor040 xor 111111111 111111111111 -> 111000000000
+ddxor041 xor 11111111 111111111111 -> 111100000000
+ddxor042 xor 11111111 111111111 -> 100000000
+ddxor043 xor 1111111 100000010 -> 101111101
+ddxor044 xor 111111 100000100 -> 100111011
+ddxor045 xor 11111 100001000 -> 100010111
+ddxor046 xor 1111 100010000 -> 100011111
+ddxor047 xor 111 100100000 -> 100100111
+ddxor048 xor 11 101000000 -> 101000011
+ddxor049 xor 1 110000000 -> 110000001
+
+ddxor050 xor 1111111111 1 -> 1111111110
+ddxor051 xor 111111111 1 -> 111111110
+ddxor052 xor 11111111 1 -> 11111110
+ddxor053 xor 1111111 1 -> 1111110
+ddxor054 xor 111111 1 -> 111110
+ddxor055 xor 11111 1 -> 11110
+ddxor056 xor 1111 1 -> 1110
+ddxor057 xor 111 1 -> 110
+ddxor058 xor 11 1 -> 10
+ddxor059 xor 1 1 -> 0
+
+ddxor060 xor 1111111111 0 -> 1111111111
+ddxor061 xor 111111111 0 -> 111111111
+ddxor062 xor 11111111 0 -> 11111111
+ddxor063 xor 1111111 0 -> 1111111
+ddxor064 xor 111111 0 -> 111111
+ddxor065 xor 11111 0 -> 11111
+ddxor066 xor 1111 0 -> 1111
+ddxor067 xor 111 0 -> 111
+ddxor068 xor 11 0 -> 11
+ddxor069 xor 1 0 -> 1
+
+ddxor070 xor 1 1111111111 -> 1111111110
+ddxor071 xor 1 111111111 -> 111111110
+ddxor072 xor 1 11111111 -> 11111110
+ddxor073 xor 1 1111111 -> 1111110
+ddxor074 xor 1 111111 -> 111110
+ddxor075 xor 1 11111 -> 11110
+ddxor076 xor 1 1111 -> 1110
+ddxor077 xor 1 111 -> 110
+ddxor078 xor 1 11 -> 10
+ddxor079 xor 1 1 -> 0
+
+ddxor080 xor 0 1111111111 -> 1111111111
+ddxor081 xor 0 111111111 -> 111111111
+ddxor082 xor 0 11111111 -> 11111111
+ddxor083 xor 0 1111111 -> 1111111
+ddxor084 xor 0 111111 -> 111111
+ddxor085 xor 0 11111 -> 11111
+ddxor086 xor 0 1111 -> 1111
+ddxor087 xor 0 111 -> 111
+ddxor088 xor 0 11 -> 11
+ddxor089 xor 0 1 -> 1
+
+ddxor090 xor 011111111 111101111 -> 100010000
+ddxor091 xor 101111111 111101111 -> 10010000
+ddxor092 xor 110111111 111101111 -> 1010000
+ddxor093 xor 111011111 111101111 -> 110000
+ddxor094 xor 111101111 111101111 -> 0
+ddxor095 xor 111110111 111101111 -> 11000
+ddxor096 xor 111111011 111101111 -> 10100
+ddxor097 xor 111111101 111101111 -> 10010
+ddxor098 xor 111111110 111101111 -> 10001
+
+ddxor100 xor 111101111 011111111 -> 100010000
+ddxor101 xor 111101111 101111111 -> 10010000
+ddxor102 xor 111101111 110111111 -> 1010000
+ddxor103 xor 111101111 111011111 -> 110000
+ddxor104 xor 111101111 111101111 -> 0
+ddxor105 xor 111101111 111110111 -> 11000
+ddxor106 xor 111101111 111111011 -> 10100
+ddxor107 xor 111101111 111111101 -> 10010
+ddxor108 xor 111101111 111111110 -> 10001
+
+-- non-0/1 should not be accepted, nor should signs
+ddxor220 xor 111111112 111111111 -> NaN Invalid_operation
+ddxor221 xor 333333333 333333333 -> NaN Invalid_operation
+ddxor222 xor 555555555 555555555 -> NaN Invalid_operation
+ddxor223 xor 777777777 777777777 -> NaN Invalid_operation
+ddxor224 xor 999999999 999999999 -> NaN Invalid_operation
+ddxor225 xor 222222222 999999999 -> NaN Invalid_operation
+ddxor226 xor 444444444 999999999 -> NaN Invalid_operation
+ddxor227 xor 666666666 999999999 -> NaN Invalid_operation
+ddxor228 xor 888888888 999999999 -> NaN Invalid_operation
+ddxor229 xor 999999999 222222222 -> NaN Invalid_operation
+ddxor230 xor 999999999 444444444 -> NaN Invalid_operation
+ddxor231 xor 999999999 666666666 -> NaN Invalid_operation
+ddxor232 xor 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+ddxor240 xor 567468689 -934981942 -> NaN Invalid_operation
+ddxor241 xor 567367689 934981942 -> NaN Invalid_operation
+ddxor242 xor -631917772 -706014634 -> NaN Invalid_operation
+ddxor243 xor -756253257 138579234 -> NaN Invalid_operation
+ddxor244 xor 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+ddxor250 xor 2000000000000000 1000000000000000 -> NaN Invalid_operation
+ddxor251 xor 7000000000000000 1000000000000000 -> NaN Invalid_operation
+ddxor252 xor 8000000000000000 1000000000000000 -> NaN Invalid_operation
+ddxor253 xor 9000000000000000 1000000000000000 -> NaN Invalid_operation
+ddxor254 xor 2000000000000000 0000000000000000 -> NaN Invalid_operation
+ddxor255 xor 7000000000000000 0000000000000000 -> NaN Invalid_operation
+ddxor256 xor 8000000000000000 0000000000000000 -> NaN Invalid_operation
+ddxor257 xor 9000000000000000 0000000000000000 -> NaN Invalid_operation
+ddxor258 xor 1000000000000000 2000000000000000 -> NaN Invalid_operation
+ddxor259 xor 1000000000000000 7000000000000000 -> NaN Invalid_operation
+ddxor260 xor 1000000000000000 8000000000000000 -> NaN Invalid_operation
+ddxor261 xor 1000000000000000 9000000000000000 -> NaN Invalid_operation
+ddxor262 xor 0000000000000000 2000000000000000 -> NaN Invalid_operation
+ddxor263 xor 0000000000000000 7000000000000000 -> NaN Invalid_operation
+ddxor264 xor 0000000000000000 8000000000000000 -> NaN Invalid_operation
+ddxor265 xor 0000000000000000 9000000000000000 -> NaN Invalid_operation
+-- test MSD-1
+ddxor270 xor 0200001000000000 1000100000000010 -> NaN Invalid_operation
+ddxor271 xor 0700000100000000 1000010000000100 -> NaN Invalid_operation
+ddxor272 xor 0800000010000000 1000001000001000 -> NaN Invalid_operation
+ddxor273 xor 0900000001000000 1000000100010000 -> NaN Invalid_operation
+ddxor274 xor 1000000000100000 0200000010100000 -> NaN Invalid_operation
+ddxor275 xor 1000000000010000 0700000001000000 -> NaN Invalid_operation
+ddxor276 xor 1000000000001000 0800000010100000 -> NaN Invalid_operation
+ddxor277 xor 1000000000000100 0900000000010000 -> NaN Invalid_operation
+-- test LSD
+ddxor280 xor 0010000000000002 1000000100000001 -> NaN Invalid_operation
+ddxor281 xor 0001000000000007 1000001000000011 -> NaN Invalid_operation
+ddxor282 xor 0000100000000008 1000010000000001 -> NaN Invalid_operation
+ddxor283 xor 0000010000000009 1000100000000001 -> NaN Invalid_operation
+ddxor284 xor 1000001000000000 0001000000000002 -> NaN Invalid_operation
+ddxor285 xor 1000000100000000 0010000000000007 -> NaN Invalid_operation
+ddxor286 xor 1000000010000000 0100000000000008 -> NaN Invalid_operation
+ddxor287 xor 1000000001000000 1000000000000009 -> NaN Invalid_operation
+-- test Middie
+ddxor288 xor 0010000020000000 1000001000000000 -> NaN Invalid_operation
+ddxor289 xor 0001000070000001 1000000100000000 -> NaN Invalid_operation
+ddxor290 xor 0000100080000010 1000000010000000 -> NaN Invalid_operation
+ddxor291 xor 0000010090000100 1000000001000000 -> NaN Invalid_operation
+ddxor292 xor 1000001000001000 0000000020100000 -> NaN Invalid_operation
+ddxor293 xor 1000000100010000 0000000070010000 -> NaN Invalid_operation
+ddxor294 xor 1000000010100000 0000000080001000 -> NaN Invalid_operation
+ddxor295 xor 1000000001000000 0000000090000100 -> NaN Invalid_operation
+-- signs
+ddxor296 xor -1000000001000000 -0000010000000100 -> NaN Invalid_operation
+ddxor297 xor -1000000001000000 0000000010000100 -> NaN Invalid_operation
+ddxor298 xor 1000000001000000 -0000001000000100 -> NaN Invalid_operation
+ddxor299 xor 1000000001000000 0000000011000100 -> 1000000010000100
+
+-- Nmax, Nmin, Ntiny-like
+ddxor331 xor 2 9.99999999E+299 -> NaN Invalid_operation
+ddxor332 xor 3 1E-299 -> NaN Invalid_operation
+ddxor333 xor 4 1.00000000E-299 -> NaN Invalid_operation
+ddxor334 xor 5 1E-200 -> NaN Invalid_operation
+ddxor335 xor 6 -1E-200 -> NaN Invalid_operation
+ddxor336 xor 7 -1.00000000E-299 -> NaN Invalid_operation
+ddxor337 xor 8 -1E-299 -> NaN Invalid_operation
+ddxor338 xor 9 -9.99999999E+299 -> NaN Invalid_operation
+ddxor341 xor 9.99999999E+299 -18 -> NaN Invalid_operation
+ddxor342 xor 1E-299 01 -> NaN Invalid_operation
+ddxor343 xor 1.00000000E-299 -18 -> NaN Invalid_operation
+ddxor344 xor 1E-208 18 -> NaN Invalid_operation
+ddxor345 xor -1E-207 -10 -> NaN Invalid_operation
+ddxor346 xor -1.00000000E-299 18 -> NaN Invalid_operation
+ddxor347 xor -1E-299 10 -> NaN Invalid_operation
+ddxor348 xor -9.99999999E+299 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+ddxor361 xor 1.0 1 -> NaN Invalid_operation
+ddxor362 xor 1E+1 1 -> NaN Invalid_operation
+ddxor363 xor 0.0 1 -> NaN Invalid_operation
+ddxor364 xor 0E+1 1 -> NaN Invalid_operation
+ddxor365 xor 9.9 1 -> NaN Invalid_operation
+ddxor366 xor 9E+1 1 -> NaN Invalid_operation
+ddxor371 xor 0 1.0 -> NaN Invalid_operation
+ddxor372 xor 0 1E+1 -> NaN Invalid_operation
+ddxor373 xor 0 0.0 -> NaN Invalid_operation
+ddxor374 xor 0 0E+1 -> NaN Invalid_operation
+ddxor375 xor 0 9.9 -> NaN Invalid_operation
+ddxor376 xor 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+ddxor780 xor -Inf -Inf -> NaN Invalid_operation
+ddxor781 xor -Inf -1000 -> NaN Invalid_operation
+ddxor782 xor -Inf -1 -> NaN Invalid_operation
+ddxor783 xor -Inf -0 -> NaN Invalid_operation
+ddxor784 xor -Inf 0 -> NaN Invalid_operation
+ddxor785 xor -Inf 1 -> NaN Invalid_operation
+ddxor786 xor -Inf 1000 -> NaN Invalid_operation
+ddxor787 xor -1000 -Inf -> NaN Invalid_operation
+ddxor788 xor -Inf -Inf -> NaN Invalid_operation
+ddxor789 xor -1 -Inf -> NaN Invalid_operation
+ddxor790 xor -0 -Inf -> NaN Invalid_operation
+ddxor791 xor 0 -Inf -> NaN Invalid_operation
+ddxor792 xor 1 -Inf -> NaN Invalid_operation
+ddxor793 xor 1000 -Inf -> NaN Invalid_operation
+ddxor794 xor Inf -Inf -> NaN Invalid_operation
+
+ddxor800 xor Inf -Inf -> NaN Invalid_operation
+ddxor801 xor Inf -1000 -> NaN Invalid_operation
+ddxor802 xor Inf -1 -> NaN Invalid_operation
+ddxor803 xor Inf -0 -> NaN Invalid_operation
+ddxor804 xor Inf 0 -> NaN Invalid_operation
+ddxor805 xor Inf 1 -> NaN Invalid_operation
+ddxor806 xor Inf 1000 -> NaN Invalid_operation
+ddxor807 xor Inf Inf -> NaN Invalid_operation
+ddxor808 xor -1000 Inf -> NaN Invalid_operation
+ddxor809 xor -Inf Inf -> NaN Invalid_operation
+ddxor810 xor -1 Inf -> NaN Invalid_operation
+ddxor811 xor -0 Inf -> NaN Invalid_operation
+ddxor812 xor 0 Inf -> NaN Invalid_operation
+ddxor813 xor 1 Inf -> NaN Invalid_operation
+ddxor814 xor 1000 Inf -> NaN Invalid_operation
+ddxor815 xor Inf Inf -> NaN Invalid_operation
+
+ddxor821 xor NaN -Inf -> NaN Invalid_operation
+ddxor822 xor NaN -1000 -> NaN Invalid_operation
+ddxor823 xor NaN -1 -> NaN Invalid_operation
+ddxor824 xor NaN -0 -> NaN Invalid_operation
+ddxor825 xor NaN 0 -> NaN Invalid_operation
+ddxor826 xor NaN 1 -> NaN Invalid_operation
+ddxor827 xor NaN 1000 -> NaN Invalid_operation
+ddxor828 xor NaN Inf -> NaN Invalid_operation
+ddxor829 xor NaN NaN -> NaN Invalid_operation
+ddxor830 xor -Inf NaN -> NaN Invalid_operation
+ddxor831 xor -1000 NaN -> NaN Invalid_operation
+ddxor832 xor -1 NaN -> NaN Invalid_operation
+ddxor833 xor -0 NaN -> NaN Invalid_operation
+ddxor834 xor 0 NaN -> NaN Invalid_operation
+ddxor835 xor 1 NaN -> NaN Invalid_operation
+ddxor836 xor 1000 NaN -> NaN Invalid_operation
+ddxor837 xor Inf NaN -> NaN Invalid_operation
+
+ddxor841 xor sNaN -Inf -> NaN Invalid_operation
+ddxor842 xor sNaN -1000 -> NaN Invalid_operation
+ddxor843 xor sNaN -1 -> NaN Invalid_operation
+ddxor844 xor sNaN -0 -> NaN Invalid_operation
+ddxor845 xor sNaN 0 -> NaN Invalid_operation
+ddxor846 xor sNaN 1 -> NaN Invalid_operation
+ddxor847 xor sNaN 1000 -> NaN Invalid_operation
+ddxor848 xor sNaN NaN -> NaN Invalid_operation
+ddxor849 xor sNaN sNaN -> NaN Invalid_operation
+ddxor850 xor NaN sNaN -> NaN Invalid_operation
+ddxor851 xor -Inf sNaN -> NaN Invalid_operation
+ddxor852 xor -1000 sNaN -> NaN Invalid_operation
+ddxor853 xor -1 sNaN -> NaN Invalid_operation
+ddxor854 xor -0 sNaN -> NaN Invalid_operation
+ddxor855 xor 0 sNaN -> NaN Invalid_operation
+ddxor856 xor 1 sNaN -> NaN Invalid_operation
+ddxor857 xor 1000 sNaN -> NaN Invalid_operation
+ddxor858 xor Inf sNaN -> NaN Invalid_operation
+ddxor859 xor NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+ddxor861 xor NaN1 -Inf -> NaN Invalid_operation
+ddxor862 xor +NaN2 -1000 -> NaN Invalid_operation
+ddxor863 xor NaN3 1000 -> NaN Invalid_operation
+ddxor864 xor NaN4 Inf -> NaN Invalid_operation
+ddxor865 xor NaN5 +NaN6 -> NaN Invalid_operation
+ddxor866 xor -Inf NaN7 -> NaN Invalid_operation
+ddxor867 xor -1000 NaN8 -> NaN Invalid_operation
+ddxor868 xor 1000 NaN9 -> NaN Invalid_operation
+ddxor869 xor Inf +NaN10 -> NaN Invalid_operation
+ddxor871 xor sNaN11 -Inf -> NaN Invalid_operation
+ddxor872 xor sNaN12 -1000 -> NaN Invalid_operation
+ddxor873 xor sNaN13 1000 -> NaN Invalid_operation
+ddxor874 xor sNaN14 NaN17 -> NaN Invalid_operation
+ddxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation
+ddxor876 xor NaN16 sNaN19 -> NaN Invalid_operation
+ddxor877 xor -Inf +sNaN20 -> NaN Invalid_operation
+ddxor878 xor -1000 sNaN21 -> NaN Invalid_operation
+ddxor879 xor 1000 sNaN22 -> NaN Invalid_operation
+ddxor880 xor Inf sNaN23 -> NaN Invalid_operation
+ddxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
+ddxor882 xor -NaN26 NaN28 -> NaN Invalid_operation
+ddxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
+ddxor884 xor 1000 -NaN30 -> NaN Invalid_operation
+ddxor885 xor 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqAbs.decTest b/Lib/test/decimaltestdata/dqAbs.decTest
index f9119a9e79..baaa063bbc 100644
--- a/Lib/test/decimaltestdata/dqAbs.decTest
+++ b/Lib/test/decimaltestdata/dqAbs.decTest
@@ -1,126 +1,126 @@
-------------------------------------------------------------------------
--- dqAbs.decTest -- decQuad absolute value, heeding sNaN --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqabs001 abs '1' -> '1'
-dqabs002 abs '-1' -> '1'
-dqabs003 abs '1.00' -> '1.00'
-dqabs004 abs '-1.00' -> '1.00'
-dqabs005 abs '0' -> '0'
-dqabs006 abs '0.00' -> '0.00'
-dqabs007 abs '00.0' -> '0.0'
-dqabs008 abs '00.00' -> '0.00'
-dqabs009 abs '00' -> '0'
-
-dqabs010 abs '-2' -> '2'
-dqabs011 abs '2' -> '2'
-dqabs012 abs '-2.00' -> '2.00'
-dqabs013 abs '2.00' -> '2.00'
-dqabs014 abs '-0' -> '0'
-dqabs015 abs '-0.00' -> '0.00'
-dqabs016 abs '-00.0' -> '0.0'
-dqabs017 abs '-00.00' -> '0.00'
-dqabs018 abs '-00' -> '0'
-
-dqabs020 abs '-2000000' -> '2000000'
-dqabs021 abs '2000000' -> '2000000'
-
-dqabs030 abs '+0.1' -> '0.1'
-dqabs031 abs '-0.1' -> '0.1'
-dqabs032 abs '+0.01' -> '0.01'
-dqabs033 abs '-0.01' -> '0.01'
-dqabs034 abs '+0.001' -> '0.001'
-dqabs035 abs '-0.001' -> '0.001'
-dqabs036 abs '+0.000001' -> '0.000001'
-dqabs037 abs '-0.000001' -> '0.000001'
-dqabs038 abs '+0.000000000001' -> '1E-12'
-dqabs039 abs '-0.000000000001' -> '1E-12'
-
--- examples from decArith
-dqabs040 abs '2.1' -> '2.1'
-dqabs041 abs '-100' -> '100'
-dqabs042 abs '101.5' -> '101.5'
-dqabs043 abs '-101.5' -> '101.5'
-
--- more fixed, potential LHS swaps/overlays if done by subtract 0
-dqabs060 abs '-56267E-10' -> '0.0000056267'
-dqabs061 abs '-56267E-5' -> '0.56267'
-dqabs062 abs '-56267E-2' -> '562.67'
-dqabs063 abs '-56267E-1' -> '5626.7'
-dqabs065 abs '-56267E-0' -> '56267'
-
--- subnormals and underflow
-
--- long operand tests
-dqabs321 abs 1234567890123456 -> 1234567890123456
-dqabs322 abs 12345678000 -> 12345678000
-dqabs323 abs 1234567800 -> 1234567800
-dqabs324 abs 1234567890 -> 1234567890
-dqabs325 abs 1234567891 -> 1234567891
-dqabs326 abs 12345678901 -> 12345678901
-dqabs327 abs 1234567896 -> 1234567896
-
--- zeros
-dqabs111 abs 0 -> 0
-dqabs112 abs -0 -> 0
-dqabs113 abs 0E+6 -> 0E+6
-dqabs114 abs -0E+6 -> 0E+6
-dqabs115 abs 0.0000 -> 0.0000
-dqabs116 abs -0.0000 -> 0.0000
-dqabs117 abs 0E-141 -> 0E-141
-dqabs118 abs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqabs121 abs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqabs122 abs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqabs123 abs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-dqabs124 abs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqabs131 abs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqabs132 abs 1E-6143 -> 1E-6143
-dqabs133 abs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqabs134 abs 1E-6176 -> 1E-6176 Subnormal
-
-dqabs135 abs -1E-6176 -> 1E-6176 Subnormal
-dqabs136 abs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqabs137 abs -1E-6143 -> 1E-6143
-dqabs138 abs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-
--- specials
-dqabs520 abs 'Inf' -> 'Infinity'
-dqabs521 abs '-Inf' -> 'Infinity'
-dqabs522 abs NaN -> NaN
-dqabs523 abs sNaN -> NaN Invalid_operation
-dqabs524 abs NaN22 -> NaN22
-dqabs525 abs sNaN33 -> NaN33 Invalid_operation
-dqabs526 abs -NaN22 -> -NaN22
-dqabs527 abs -sNaN33 -> -NaN33 Invalid_operation
-
--- Null tests
-dqabs900 abs # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqAbs.decTest -- decQuad absolute value, heeding sNaN --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqabs001 abs '1' -> '1'
+dqabs002 abs '-1' -> '1'
+dqabs003 abs '1.00' -> '1.00'
+dqabs004 abs '-1.00' -> '1.00'
+dqabs005 abs '0' -> '0'
+dqabs006 abs '0.00' -> '0.00'
+dqabs007 abs '00.0' -> '0.0'
+dqabs008 abs '00.00' -> '0.00'
+dqabs009 abs '00' -> '0'
+
+dqabs010 abs '-2' -> '2'
+dqabs011 abs '2' -> '2'
+dqabs012 abs '-2.00' -> '2.00'
+dqabs013 abs '2.00' -> '2.00'
+dqabs014 abs '-0' -> '0'
+dqabs015 abs '-0.00' -> '0.00'
+dqabs016 abs '-00.0' -> '0.0'
+dqabs017 abs '-00.00' -> '0.00'
+dqabs018 abs '-00' -> '0'
+
+dqabs020 abs '-2000000' -> '2000000'
+dqabs021 abs '2000000' -> '2000000'
+
+dqabs030 abs '+0.1' -> '0.1'
+dqabs031 abs '-0.1' -> '0.1'
+dqabs032 abs '+0.01' -> '0.01'
+dqabs033 abs '-0.01' -> '0.01'
+dqabs034 abs '+0.001' -> '0.001'
+dqabs035 abs '-0.001' -> '0.001'
+dqabs036 abs '+0.000001' -> '0.000001'
+dqabs037 abs '-0.000001' -> '0.000001'
+dqabs038 abs '+0.000000000001' -> '1E-12'
+dqabs039 abs '-0.000000000001' -> '1E-12'
+
+-- examples from decArith
+dqabs040 abs '2.1' -> '2.1'
+dqabs041 abs '-100' -> '100'
+dqabs042 abs '101.5' -> '101.5'
+dqabs043 abs '-101.5' -> '101.5'
+
+-- more fixed, potential LHS swaps/overlays if done by subtract 0
+dqabs060 abs '-56267E-10' -> '0.0000056267'
+dqabs061 abs '-56267E-5' -> '0.56267'
+dqabs062 abs '-56267E-2' -> '562.67'
+dqabs063 abs '-56267E-1' -> '5626.7'
+dqabs065 abs '-56267E-0' -> '56267'
+
+-- subnormals and underflow
+
+-- long operand tests
+dqabs321 abs 1234567890123456 -> 1234567890123456
+dqabs322 abs 12345678000 -> 12345678000
+dqabs323 abs 1234567800 -> 1234567800
+dqabs324 abs 1234567890 -> 1234567890
+dqabs325 abs 1234567891 -> 1234567891
+dqabs326 abs 12345678901 -> 12345678901
+dqabs327 abs 1234567896 -> 1234567896
+
+-- zeros
+dqabs111 abs 0 -> 0
+dqabs112 abs -0 -> 0
+dqabs113 abs 0E+6 -> 0E+6
+dqabs114 abs -0E+6 -> 0E+6
+dqabs115 abs 0.0000 -> 0.0000
+dqabs116 abs -0.0000 -> 0.0000
+dqabs117 abs 0E-141 -> 0E-141
+dqabs118 abs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqabs121 abs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqabs122 abs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqabs123 abs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+dqabs124 abs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqabs131 abs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqabs132 abs 1E-6143 -> 1E-6143
+dqabs133 abs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqabs134 abs 1E-6176 -> 1E-6176 Subnormal
+
+dqabs135 abs -1E-6176 -> 1E-6176 Subnormal
+dqabs136 abs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqabs137 abs -1E-6143 -> 1E-6143
+dqabs138 abs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+
+-- specials
+dqabs520 abs 'Inf' -> 'Infinity'
+dqabs521 abs '-Inf' -> 'Infinity'
+dqabs522 abs NaN -> NaN
+dqabs523 abs sNaN -> NaN Invalid_operation
+dqabs524 abs NaN22 -> NaN22
+dqabs525 abs sNaN33 -> NaN33 Invalid_operation
+dqabs526 abs -NaN22 -> -NaN22
+dqabs527 abs -sNaN33 -> -NaN33 Invalid_operation
+
+-- Null tests
+dqabs900 abs # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqAdd.decTest b/Lib/test/decimaltestdata/dqAdd.decTest
index b3ad892bc1..b1df77abc6 100644
--- a/Lib/test/decimaltestdata/dqAdd.decTest
+++ b/Lib/test/decimaltestdata/dqAdd.decTest
@@ -1,1215 +1,1215 @@
-------------------------------------------------------------------------
--- dqAdd.decTest -- decQuad addition --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decQuads only; all arguments are
--- representable in a decQuad
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- [first group are 'quick confidence check']
-dqadd001 add 1 1 -> 2
-dqadd002 add 2 3 -> 5
-dqadd003 add '5.75' '3.3' -> 9.05
-dqadd004 add '5' '-3' -> 2
-dqadd005 add '-5' '-3' -> -8
-dqadd006 add '-7' '2.5' -> -4.5
-dqadd007 add '0.7' '0.3' -> 1.0
-dqadd008 add '1.25' '1.25' -> 2.50
-dqadd009 add '1.23456789' '1.00000000' -> '2.23456789'
-dqadd010 add '1.23456789' '1.00000011' -> '2.23456800'
-
--- 1234567890123456 1234567890123456
-dqadd011 add '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqadd012 add '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded
-dqadd013 add '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
-dqadd014 add '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd015 add '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd016 add '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd017 add '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd018 add '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded
-dqadd019 add '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded
-dqadd020 add '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded
-
-dqadd021 add 0 1 -> 1
-dqadd022 add 1 1 -> 2
-dqadd023 add 2 1 -> 3
-dqadd024 add 3 1 -> 4
-dqadd025 add 4 1 -> 5
-dqadd026 add 5 1 -> 6
-dqadd027 add 6 1 -> 7
-dqadd028 add 7 1 -> 8
-dqadd029 add 8 1 -> 9
-dqadd030 add 9 1 -> 10
-
--- some carrying effects
-dqadd031 add '0.9998' '0.0000' -> '0.9998'
-dqadd032 add '0.9998' '0.0001' -> '0.9999'
-dqadd033 add '0.9998' '0.0002' -> '1.0000'
-dqadd034 add '0.9998' '0.0003' -> '1.0001'
-
-dqadd035 add '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd036 add '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd037 add '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd038 add '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
-dqadd039 add '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded
-
--- symmetry:
-dqadd040 add '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd041 add '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd042 add '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd044 add '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
-dqadd045 add '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded
-
--- same, without rounding
-dqadd046 add '10000e+9' '7' -> '10000000000007'
-dqadd047 add '10000e+9' '70' -> '10000000000070'
-dqadd048 add '10000e+9' '700' -> '10000000000700'
-dqadd049 add '10000e+9' '7000' -> '10000000007000'
-dqadd050 add '10000e+9' '70000' -> '10000000070000'
-dqadd051 add '10000e+9' '700000' -> '10000000700000'
-dqadd052 add '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-dqadd053 add '12' '7.00' -> '19.00'
-dqadd054 add '1.3' '-1.07' -> '0.23'
-dqadd055 add '1.3' '-1.30' -> '0.00'
-dqadd056 add '1.3' '-2.07' -> '-0.77'
-dqadd057 add '1E+2' '1E+4' -> '1.01E+4'
-
--- leading zero preservation
-dqadd061 add 1 '0.0001' -> '1.0001'
-dqadd062 add 1 '0.00001' -> '1.00001'
-dqadd063 add 1 '0.000001' -> '1.000001'
-dqadd064 add 1 '0.0000001' -> '1.0000001'
-dqadd065 add 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-dqadd070 add 1 0 -> 1
-dqadd071 add 1 0. -> 1
-dqadd072 add 1 .0 -> 1.0
-dqadd073 add 1 0.0 -> 1.0
-dqadd074 add 1 0.00 -> 1.00
-dqadd075 add 0 1 -> 1
-dqadd076 add 0. 1 -> 1
-dqadd077 add .0 1 -> 1.0
-dqadd078 add 0.0 1 -> 1.0
-dqadd079 add 0.00 1 -> 1.00
-
--- some carries
-dqadd080 add 999999998 1 -> 999999999
-dqadd081 add 999999999 1 -> 1000000000
-dqadd082 add 99999999 1 -> 100000000
-dqadd083 add 9999999 1 -> 10000000
-dqadd084 add 999999 1 -> 1000000
-dqadd085 add 99999 1 -> 100000
-dqadd086 add 9999 1 -> 10000
-dqadd087 add 999 1 -> 1000
-dqadd088 add 99 1 -> 100
-dqadd089 add 9 1 -> 10
-
-
--- more LHS swaps
-dqadd090 add '-56267E-10' 0 -> '-0.0000056267'
-dqadd091 add '-56267E-6' 0 -> '-0.056267'
-dqadd092 add '-56267E-5' 0 -> '-0.56267'
-dqadd093 add '-56267E-4' 0 -> '-5.6267'
-dqadd094 add '-56267E-3' 0 -> '-56.267'
-dqadd095 add '-56267E-2' 0 -> '-562.67'
-dqadd096 add '-56267E-1' 0 -> '-5626.7'
-dqadd097 add '-56267E-0' 0 -> '-56267'
-dqadd098 add '-5E-10' 0 -> '-5E-10'
-dqadd099 add '-5E-7' 0 -> '-5E-7'
-dqadd100 add '-5E-6' 0 -> '-0.000005'
-dqadd101 add '-5E-5' 0 -> '-0.00005'
-dqadd102 add '-5E-4' 0 -> '-0.0005'
-dqadd103 add '-5E-1' 0 -> '-0.5'
-dqadd104 add '-5E0' 0 -> '-5'
-dqadd105 add '-5E1' 0 -> '-50'
-dqadd106 add '-5E5' 0 -> '-500000'
-dqadd107 add '-5E33' 0 -> '-5000000000000000000000000000000000'
-dqadd108 add '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
-dqadd109 add '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
-dqadd110 add '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
-dqadd111 add '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- more RHS swaps
-dqadd113 add 0 '-56267E-10' -> '-0.0000056267'
-dqadd114 add 0 '-56267E-6' -> '-0.056267'
-dqadd116 add 0 '-56267E-5' -> '-0.56267'
-dqadd117 add 0 '-56267E-4' -> '-5.6267'
-dqadd119 add 0 '-56267E-3' -> '-56.267'
-dqadd120 add 0 '-56267E-2' -> '-562.67'
-dqadd121 add 0 '-56267E-1' -> '-5626.7'
-dqadd122 add 0 '-56267E-0' -> '-56267'
-dqadd123 add 0 '-5E-10' -> '-5E-10'
-dqadd124 add 0 '-5E-7' -> '-5E-7'
-dqadd125 add 0 '-5E-6' -> '-0.000005'
-dqadd126 add 0 '-5E-5' -> '-0.00005'
-dqadd127 add 0 '-5E-4' -> '-0.0005'
-dqadd128 add 0 '-5E-1' -> '-0.5'
-dqadd129 add 0 '-5E0' -> '-5'
-dqadd130 add 0 '-5E1' -> '-50'
-dqadd131 add 0 '-5E5' -> '-500000'
-dqadd132 add 0 '-5E33' -> '-5000000000000000000000000000000000'
-dqadd133 add 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded
-dqadd134 add 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded
-dqadd135 add 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded
-dqadd136 add 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- related
-dqadd137 add 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded
-dqadd138 add -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded
-dqadd139 add '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded
-dqadd140 add '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded
-dqadd141 add 1E+29 0.0000 -> '100000000000000000000000000000.0000'
-dqadd142 add 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded
-dqadd143 add 0.000 1E+30 -> '1000000000000000000000000000000.000'
-dqadd144 add 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-dqadd146 add '00.0' 0 -> '0.0'
-dqadd147 add '0.00' 0 -> '0.00'
-dqadd148 add 0 '0.00' -> '0.00'
-dqadd149 add 0 '00.0' -> '0.0'
-dqadd150 add '00.0' '0.00' -> '0.00'
-dqadd151 add '0.00' '00.0' -> '0.00'
-dqadd152 add '3' '.3' -> '3.3'
-dqadd153 add '3.' '.3' -> '3.3'
-dqadd154 add '3.0' '.3' -> '3.3'
-dqadd155 add '3.00' '.3' -> '3.30'
-dqadd156 add '3' '3' -> '6'
-dqadd157 add '3' '+3' -> '6'
-dqadd158 add '3' '-3' -> '0'
-dqadd159 add '0.3' '-0.3' -> '0.0'
-dqadd160 add '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-dqadd161 add '1E+12' '-1' -> '999999999999'
-dqadd162 add '1E+12' '1.11' -> '1000000000001.11'
-dqadd163 add '1.11' '1E+12' -> '1000000000001.11'
-dqadd164 add '-1' '1E+12' -> '999999999999'
-dqadd165 add '7E+12' '-1' -> '6999999999999'
-dqadd166 add '7E+12' '1.11' -> '7000000000001.11'
-dqadd167 add '1.11' '7E+12' -> '7000000000001.11'
-dqadd168 add '-1' '7E+12' -> '6999999999999'
-
-rounding: half_up
-dqadd170 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd171 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd172 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd173 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded
-dqadd174 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd175 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd176 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd177 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded
-dqadd178 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd179 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd180 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd181 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd182 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd183 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-dqadd200 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd201 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd202 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd203 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd204 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd205 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd206 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd207 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd208 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd209 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd210 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd211 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd212 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd213 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd214 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd215 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd216 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd217 add '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd218 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd219 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
-
-rounding: half_even
-dqadd220 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd221 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd222 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd223 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd224 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd225 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd226 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd227 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd228 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd229 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd230 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd231 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd232 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd233 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd234 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd235 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd236 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd237 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd238 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd239 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
--- critical few with even bottom digit...
-dqadd240 add '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded
-dqadd241 add '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded
-dqadd242 add '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
-
-rounding: down
-dqadd250 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd251 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd252 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd253 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd254 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd255 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd256 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd257 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd258 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd259 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd260 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd261 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd262 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd263 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd264 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd265 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd266 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd267 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd268 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd269 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-dqadd301 add -1 1 -> 0
-dqadd302 add 0 1 -> 1
-dqadd303 add 1 1 -> 2
-dqadd304 add 12 1 -> 13
-dqadd305 add 98 1 -> 99
-dqadd306 add 99 1 -> 100
-dqadd307 add 100 1 -> 101
-dqadd308 add 101 1 -> 102
-dqadd309 add -1 -1 -> -2
-dqadd310 add 0 -1 -> -1
-dqadd311 add 1 -1 -> 0
-dqadd312 add 12 -1 -> 11
-dqadd313 add 98 -1 -> 97
-dqadd314 add 99 -1 -> 98
-dqadd315 add 100 -1 -> 99
-dqadd316 add 101 -1 -> 100
-
-dqadd321 add -0.01 0.01 -> 0.00
-dqadd322 add 0.00 0.01 -> 0.01
-dqadd323 add 0.01 0.01 -> 0.02
-dqadd324 add 0.12 0.01 -> 0.13
-dqadd325 add 0.98 0.01 -> 0.99
-dqadd326 add 0.99 0.01 -> 1.00
-dqadd327 add 1.00 0.01 -> 1.01
-dqadd328 add 1.01 0.01 -> 1.02
-dqadd329 add -0.01 -0.01 -> -0.02
-dqadd330 add 0.00 -0.01 -> -0.01
-dqadd331 add 0.01 -0.01 -> 0.00
-dqadd332 add 0.12 -0.01 -> 0.11
-dqadd333 add 0.98 -0.01 -> 0.97
-dqadd334 add 0.99 -0.01 -> 0.98
-dqadd335 add 1.00 -0.01 -> 0.99
-dqadd336 add 1.01 -0.01 -> 1.00
-
--- some more cases where adding 0 affects the coefficient
-dqadd340 add 1E+3 0 -> 1000
-dqadd341 add 1E+33 0 -> 1000000000000000000000000000000000
-dqadd342 add 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded
-dqadd343 add 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded
--- which simply follow from these cases ...
-dqadd344 add 1E+3 1 -> 1001
-dqadd345 add 1E+33 1 -> 1000000000000000000000000000000001
-dqadd346 add 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd347 add 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
-dqadd348 add 1E+3 7 -> 1007
-dqadd349 add 1E+33 7 -> 1000000000000000000000000000000007
-dqadd350 add 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded
-dqadd351 add 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
-
--- tryzeros cases
-rounding: half_up
-dqadd360 add 0E+50 10000E+1 -> 1.0000E+5
-dqadd361 add 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded
-dqadd362 add 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded
-dqadd363 add 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact
-dqadd364 add 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111
--- 1 234567890123456789012345678901234
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-dqadd370 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd371 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-rounding: half_up
-dqadd372 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd373 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-rounding: half_even
-dqadd374 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd375 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-
--- ulp replacement tests
-dqadd400 add 1 77e-32 -> 1.00000000000000000000000000000077
-dqadd401 add 1 77e-33 -> 1.000000000000000000000000000000077
-dqadd402 add 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded
-dqadd403 add 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded
-dqadd404 add 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd405 add 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd406 add 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd410 add 10 77e-32 -> 10.00000000000000000000000000000077
-dqadd411 add 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded
-dqadd412 add 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded
-dqadd413 add 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd414 add 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd415 add 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd416 add 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd420 add 77e-32 1 -> 1.00000000000000000000000000000077
-dqadd421 add 77e-33 1 -> 1.000000000000000000000000000000077
-dqadd422 add 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded
-dqadd423 add 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded
-dqadd424 add 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd425 add 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd426 add 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd430 add 77e-32 10 -> 10.00000000000000000000000000000077
-dqadd431 add 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded
-dqadd432 add 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded
-dqadd433 add 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd434 add 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd435 add 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd436 add 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-
--- fastpath boundaries
--- 1234567890123456789012345678901234
-dqadd501 add '4444444444444444444444444444444444' '5555555555555555555555555555555555' -> '9999999999999999999999999999999999'
-dqadd502 add '4444444444444444444444444444444444' '4555555555555555555555555555555555' -> '8999999999999999999999999999999999'
-dqadd503 add '4444444444444444444444444444444444' '3555555555555555555055555555555555' -> '7999999999999999999499999999999999'
-dqadd504 add '4444444444444444444444444444444444' '3955555555555555555555555555555555' -> '8399999999999999999999999999999999'
-dqadd505 add '4444444444444444444444444444444444' '4955555555555555555555555555555555' -> '9399999999999999999999999999999999'
-dqadd506 add '4444444444444444444444444444444444' '5955555555555555555555555555555555' -> 1.040000000000000000000000000000000E+34 Inexact Rounded
-dqadd511 add '344444444444444444444444444444444' '555555555555555555555555555555555' -> '899999999999999999999999999999999'
-dqadd512 add '34444444444444444444444444444444' '55555555555555555555555555555555' -> '89999999999999999999999999999999'
-dqadd513 add '3444444444444444444444444444444' '5555555555555555555555555555555' -> '8999999999999999999999999999999'
-dqadd514 add '344444444444444444444444444444' '555555555555555555555555555555' -> '899999999999999999999999999999'
-dqadd515 add '34444444444444444444444444444' '55555555555555555555555555555' -> '89999999999999999999999999999'
-dqadd516 add '3444444444444444444444444444' '5555555555555555555555555555' -> '8999999999999999999999999999'
-dqadd517 add '344444444444444444444444444' '555555555555555555555555555' -> '899999999999999999999999999'
-dqadd518 add '34444444444444444444444444' '55555555555555555555555555' -> '89999999999999999999999999'
-dqadd519 add '3444444444444444444444444' '5555555555555555555555555' -> '8999999999999999999999999'
-dqadd520 add '344444444444444444444444' '555555555555555555555555' -> '899999999999999999999999'
-dqadd521 add '34444444444444444444444' '55555555555555555555555' -> '89999999999999999999999'
-dqadd522 add '3444444444444444444444' '5555555555555555555555' -> '8999999999999999999999'
-dqadd523 add '4444444444444444444444' '3333333333333333333333' -> '7777777777777777777777'
-dqadd524 add '344444444444444444444' '555555555555555555555' -> '899999999999999999999'
-dqadd525 add '34444444444444444444' '55555555555555555555' -> '89999999999999999999'
-dqadd526 add '3444444444444444444' '5555555555555555555' -> '8999999999999999999'
-dqadd527 add '344444444444444444' '555555555555555555' -> '899999999999999999'
-dqadd528 add '34444444444444444' '55555555555555555' -> '89999999999999999'
-dqadd529 add '3444444444444444' '5555555555555555' -> '8999999999999999'
-dqadd530 add '344444444444444' '555555555555555' -> '899999999999999'
-dqadd531 add '34444444444444' '55555555555555' -> '89999999999999'
-dqadd532 add '3444444444444' '5555555555555' -> '8999999999999'
-dqadd533 add '344444444444' '555555555555' -> '899999999999'
-dqadd534 add '34444444444' '55555555555' -> '89999999999'
-dqadd535 add '3444444444' '5555555555' -> '8999999999'
-dqadd536 add '344444444' '555555555' -> '899999999'
-dqadd537 add '34444444' '55555555' -> '89999999'
-dqadd538 add '3444444' '5555555' -> '8999999'
-dqadd539 add '344444' '555555' -> '899999'
-dqadd540 add '34444' '55555' -> '89999'
-dqadd541 add '3444' '5555' -> '8999'
-dqadd542 add '344' '555' -> '899'
-dqadd543 add '34' '55' -> '89'
-dqadd544 add '3' '5' -> '8'
-
-dqadd545 add '3000004000000000000000000000000000' '3000000000000040000000000000000000' -> '6000004000000040000000000000000000'
-dqadd546 add '3000000400000000000000000000000000' '4000000000000400000000000000000000' -> '7000000400000400000000000000000000'
-dqadd547 add '3000000040000000000000000000000000' '5000000000004000000000000000000000' -> '8000000040004000000000000000000000'
-dqadd548 add '4000000004000000000000000000000000' '3000000000040000000000000000000000' -> '7000000004040000000000000000000000'
-dqadd549 add '4000000000400000000000000000000000' '4000000000400000000000000000000000' -> '8000000000800000000000000000000000'
-dqadd550 add '4000000000040000000000000000000000' '5000000004000000000000000000000000' -> '9000000004040000000000000000000000'
-dqadd551 add '5000000000004000000000000000000000' '3000000040000000000000000000000000' -> '8000000040004000000000000000000000'
-dqadd552 add '5000000000000400000000000000000000' '4000000400000000000000000000000000' -> '9000000400000400000000000000000000'
-dqadd553 add '5000000000000040000000000000000000' '5000004000000000000000000000000000' -> 1.000000400000004000000000000000000E+34 Rounded
--- check propagation
-dqadd554 add '8999999999999999999999999999999999' '0000000000000000000000000000000001' -> 9000000000000000000000000000000000
-dqadd555 add '0000000000000000000000000000000001' '8999999999999999999999999999999999' -> 9000000000000000000000000000000000
-dqadd556 add '4444444444444444444444444444444444' '4555555555555555555555555555555556' -> 9000000000000000000000000000000000
-dqadd557 add '4555555555555555555555555555555556' '4444444444444444444444444444444444' -> 9000000000000000000000000000000000
-
--- negative ulps
-dqadd6440 add 1 -77e-32 -> 0.99999999999999999999999999999923
-dqadd6441 add 1 -77e-33 -> 0.999999999999999999999999999999923
-dqadd6442 add 1 -77e-34 -> 0.9999999999999999999999999999999923
-dqadd6443 add 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded
-dqadd6444 add 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded
-dqadd6445 add 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd6446 add 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd6450 add 10 -77e-32 -> 9.99999999999999999999999999999923
-dqadd6451 add 10 -77e-33 -> 9.999999999999999999999999999999923
-dqadd6452 add 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded
-dqadd6453 add 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded
-dqadd6454 add 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd6455 add 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd6456 add 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd6460 add -77e-32 1 -> 0.99999999999999999999999999999923
-dqadd6461 add -77e-33 1 -> 0.999999999999999999999999999999923
-dqadd6462 add -77e-34 1 -> 0.9999999999999999999999999999999923
-dqadd6463 add -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded
-dqadd6464 add -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded
-dqadd6465 add -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd6466 add -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd6470 add -77e-32 10 -> 9.99999999999999999999999999999923
-dqadd6471 add -77e-33 10 -> 9.999999999999999999999999999999923
-dqadd6472 add -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded
-dqadd6473 add -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded
-dqadd6474 add -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd6475 add -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd6476 add -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-
--- negative ulps
-dqadd6480 add -1 77e-32 -> -0.99999999999999999999999999999923
-dqadd6481 add -1 77e-33 -> -0.999999999999999999999999999999923
-dqadd6482 add -1 77e-34 -> -0.9999999999999999999999999999999923
-dqadd6483 add -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded
-dqadd6484 add -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded
-dqadd6485 add -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded
-dqadd6486 add -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd6490 add -10 77e-32 -> -9.99999999999999999999999999999923
-dqadd6491 add -10 77e-33 -> -9.999999999999999999999999999999923
-dqadd6492 add -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded
-dqadd6493 add -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded
-dqadd6494 add -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd6495 add -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd6496 add -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd6500 add 77e-32 -1 -> -0.99999999999999999999999999999923
-dqadd6501 add 77e-33 -1 -> -0.999999999999999999999999999999923
-dqadd6502 add 77e-34 -1 -> -0.9999999999999999999999999999999923
-dqadd6503 add 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded
-dqadd6504 add 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded
-dqadd6505 add 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
-dqadd6506 add 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd6510 add 77e-32 -10 -> -9.99999999999999999999999999999923
-dqadd6511 add 77e-33 -10 -> -9.999999999999999999999999999999923
-dqadd6512 add 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded
-dqadd6513 add 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded
-dqadd6514 add 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd6515 add 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd6516 add 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-
--- and some more residue effects and different roundings
-rounding: half_up
-dqadd6540 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd6541 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6542 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6543 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6544 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6545 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6546 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6547 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6548 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6549 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6550 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6551 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6552 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6553 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6554 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6555 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6556 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd6557 add '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6558 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6559 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
-rounding: half_even
-dqadd6560 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd6561 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6562 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6563 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6564 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6565 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6566 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6567 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd6568 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6569 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6570 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6571 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6572 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6573 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6574 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6575 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6576 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd6577 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6578 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd6579 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
--- critical few with even bottom digit...
-dqadd7540 add '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded
-dqadd7541 add '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded
-dqadd7542 add '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
-
-rounding: down
-dqadd7550 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd7551 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7552 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7553 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7554 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7555 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7556 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7557 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7558 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7559 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7560 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7561 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7562 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7563 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7564 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7565 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd7566 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd7567 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd7568 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd7569 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-dqadd7701 add 5.00 1.00E-3 -> 5.00100
-dqadd7702 add 00.00 0.000 -> 0.000
-dqadd7703 add 00.00 0E-3 -> 0.000
-dqadd7704 add 0E-3 00.00 -> 0.000
-
-dqadd7710 add 0E+3 00.00 -> 0.00
-dqadd7711 add 0E+3 00.0 -> 0.0
-dqadd7712 add 0E+3 00. -> 0
-dqadd7713 add 0E+3 00.E+1 -> 0E+1
-dqadd7714 add 0E+3 00.E+2 -> 0E+2
-dqadd7715 add 0E+3 00.E+3 -> 0E+3
-dqadd7716 add 0E+3 00.E+4 -> 0E+3
-dqadd7717 add 0E+3 00.E+5 -> 0E+3
-dqadd7718 add 0E+3 -00.0 -> 0.0
-dqadd7719 add 0E+3 -00. -> 0
-dqadd7731 add 0E+3 -00.E+1 -> 0E+1
-
-dqadd7720 add 00.00 0E+3 -> 0.00
-dqadd7721 add 00.0 0E+3 -> 0.0
-dqadd7722 add 00. 0E+3 -> 0
-dqadd7723 add 00.E+1 0E+3 -> 0E+1
-dqadd7724 add 00.E+2 0E+3 -> 0E+2
-dqadd7725 add 00.E+3 0E+3 -> 0E+3
-dqadd7726 add 00.E+4 0E+3 -> 0E+3
-dqadd7727 add 00.E+5 0E+3 -> 0E+3
-dqadd7728 add -00.00 0E+3 -> 0.00
-dqadd7729 add -00.0 0E+3 -> 0.0
-dqadd7730 add -00. 0E+3 -> 0
-
-dqadd7732 add 0 0 -> 0
-dqadd7733 add 0 -0 -> 0
-dqadd7734 add -0 0 -> 0
-dqadd7735 add -0 -0 -> -0 -- IEEE 754 special case
-
-dqadd7736 add 1 -1 -> 0
-dqadd7737 add -1 -1 -> -2
-dqadd7738 add 1 1 -> 2
-dqadd7739 add -1 1 -> 0
-
-dqadd7741 add 0 -1 -> -1
-dqadd7742 add -0 -1 -> -1
-dqadd7743 add 0 1 -> 1
-dqadd7744 add -0 1 -> 1
-dqadd7745 add -1 0 -> -1
-dqadd7746 add -1 -0 -> -1
-dqadd7747 add 1 0 -> 1
-dqadd7748 add 1 -0 -> 1
-
-dqadd7751 add 0.0 -1 -> -1.0
-dqadd7752 add -0.0 -1 -> -1.0
-dqadd7753 add 0.0 1 -> 1.0
-dqadd7754 add -0.0 1 -> 1.0
-dqadd7755 add -1.0 0 -> -1.0
-dqadd7756 add -1.0 -0 -> -1.0
-dqadd7757 add 1.0 0 -> 1.0
-dqadd7758 add 1.0 -0 -> 1.0
-
-dqadd7761 add 0 -1.0 -> -1.0
-dqadd7762 add -0 -1.0 -> -1.0
-dqadd7763 add 0 1.0 -> 1.0
-dqadd7764 add -0 1.0 -> 1.0
-dqadd7765 add -1 0.0 -> -1.0
-dqadd7766 add -1 -0.0 -> -1.0
-dqadd7767 add 1 0.0 -> 1.0
-dqadd7768 add 1 -0.0 -> 1.0
-
-dqadd7771 add 0.0 -1.0 -> -1.0
-dqadd7772 add -0.0 -1.0 -> -1.0
-dqadd7773 add 0.0 1.0 -> 1.0
-dqadd7774 add -0.0 1.0 -> 1.0
-dqadd7775 add -1.0 0.0 -> -1.0
-dqadd7776 add -1.0 -0.0 -> -1.0
-dqadd7777 add 1.0 0.0 -> 1.0
-dqadd7778 add 1.0 -0.0 -> 1.0
-
--- Specials
-dqadd7780 add -Inf -Inf -> -Infinity
-dqadd7781 add -Inf -1000 -> -Infinity
-dqadd7782 add -Inf -1 -> -Infinity
-dqadd7783 add -Inf -0 -> -Infinity
-dqadd7784 add -Inf 0 -> -Infinity
-dqadd7785 add -Inf 1 -> -Infinity
-dqadd7786 add -Inf 1000 -> -Infinity
-dqadd7787 add -1000 -Inf -> -Infinity
-dqadd7788 add -Inf -Inf -> -Infinity
-dqadd7789 add -1 -Inf -> -Infinity
-dqadd7790 add -0 -Inf -> -Infinity
-dqadd7791 add 0 -Inf -> -Infinity
-dqadd7792 add 1 -Inf -> -Infinity
-dqadd7793 add 1000 -Inf -> -Infinity
-dqadd7794 add Inf -Inf -> NaN Invalid_operation
-
-dqadd7800 add Inf -Inf -> NaN Invalid_operation
-dqadd7801 add Inf -1000 -> Infinity
-dqadd7802 add Inf -1 -> Infinity
-dqadd7803 add Inf -0 -> Infinity
-dqadd7804 add Inf 0 -> Infinity
-dqadd7805 add Inf 1 -> Infinity
-dqadd7806 add Inf 1000 -> Infinity
-dqadd7807 add Inf Inf -> Infinity
-dqadd7808 add -1000 Inf -> Infinity
-dqadd7809 add -Inf Inf -> NaN Invalid_operation
-dqadd7810 add -1 Inf -> Infinity
-dqadd7811 add -0 Inf -> Infinity
-dqadd7812 add 0 Inf -> Infinity
-dqadd7813 add 1 Inf -> Infinity
-dqadd7814 add 1000 Inf -> Infinity
-dqadd7815 add Inf Inf -> Infinity
-
-dqadd7821 add NaN -Inf -> NaN
-dqadd7822 add NaN -1000 -> NaN
-dqadd7823 add NaN -1 -> NaN
-dqadd7824 add NaN -0 -> NaN
-dqadd7825 add NaN 0 -> NaN
-dqadd7826 add NaN 1 -> NaN
-dqadd7827 add NaN 1000 -> NaN
-dqadd7828 add NaN Inf -> NaN
-dqadd7829 add NaN NaN -> NaN
-dqadd7830 add -Inf NaN -> NaN
-dqadd7831 add -1000 NaN -> NaN
-dqadd7832 add -1 NaN -> NaN
-dqadd7833 add -0 NaN -> NaN
-dqadd7834 add 0 NaN -> NaN
-dqadd7835 add 1 NaN -> NaN
-dqadd7836 add 1000 NaN -> NaN
-dqadd7837 add Inf NaN -> NaN
-
-dqadd7841 add sNaN -Inf -> NaN Invalid_operation
-dqadd7842 add sNaN -1000 -> NaN Invalid_operation
-dqadd7843 add sNaN -1 -> NaN Invalid_operation
-dqadd7844 add sNaN -0 -> NaN Invalid_operation
-dqadd7845 add sNaN 0 -> NaN Invalid_operation
-dqadd7846 add sNaN 1 -> NaN Invalid_operation
-dqadd7847 add sNaN 1000 -> NaN Invalid_operation
-dqadd7848 add sNaN NaN -> NaN Invalid_operation
-dqadd7849 add sNaN sNaN -> NaN Invalid_operation
-dqadd7850 add NaN sNaN -> NaN Invalid_operation
-dqadd7851 add -Inf sNaN -> NaN Invalid_operation
-dqadd7852 add -1000 sNaN -> NaN Invalid_operation
-dqadd7853 add -1 sNaN -> NaN Invalid_operation
-dqadd7854 add -0 sNaN -> NaN Invalid_operation
-dqadd7855 add 0 sNaN -> NaN Invalid_operation
-dqadd7856 add 1 sNaN -> NaN Invalid_operation
-dqadd7857 add 1000 sNaN -> NaN Invalid_operation
-dqadd7858 add Inf sNaN -> NaN Invalid_operation
-dqadd7859 add NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqadd7861 add NaN1 -Inf -> NaN1
-dqadd7862 add +NaN2 -1000 -> NaN2
-dqadd7863 add NaN3 1000 -> NaN3
-dqadd7864 add NaN4 Inf -> NaN4
-dqadd7865 add NaN5 +NaN6 -> NaN5
-dqadd7866 add -Inf NaN7 -> NaN7
-dqadd7867 add -1000 NaN8 -> NaN8
-dqadd7868 add 1000 NaN9 -> NaN9
-dqadd7869 add Inf +NaN10 -> NaN10
-dqadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation
-dqadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation
-dqadd7873 add sNaN13 1000 -> NaN13 Invalid_operation
-dqadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation
-dqadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation
-dqadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation
-dqadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation
-dqadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation
-dqadd7880 add Inf sNaN23 -> NaN23 Invalid_operation
-dqadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqadd7882 add -NaN26 NaN28 -> -NaN26
-dqadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqadd7884 add 1000 -NaN30 -> -NaN30
-dqadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Here we explore near the boundary of rounding a subnormal to Nmin
-dqadd7575 add 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal
-dqadd7576 add -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal
-
--- check overflow edge case
--- 1234567890123456
-dqadd7972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqadd7973 add 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7974 add 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7975 add 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded
-dqadd7976 add 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7977 add 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7978 add 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7979 add 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7980 add 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded
-dqadd7981 add 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7982 add 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7983 add 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7984 add 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-
-dqadd7985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqadd7986 add -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7987 add -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7988 add -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded
-dqadd7989 add -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7990 add -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7991 add -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7992 add -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7993 add -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd7994 add -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7995 add -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7996 add -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd7997 add -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-dqadd71100 add 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact
-dqadd71101 add 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact
-dqadd71103 add +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact
-dqadd71104 add 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact
-dqadd71105 add 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact
-dqadd71106 add 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact
-dqadd71107 add 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact
-dqadd71108 add 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact
-dqadd71109 add 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-dqadd71110 add -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact
-dqadd71111 add -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact
-dqadd71113 add -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact
-dqadd71114 add -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact
-dqadd71115 add -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact
-dqadd71116 add -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact
-dqadd71117 add -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact
-dqadd71118 add -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact
-dqadd71119 add -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-dqadd71300 add 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71310 add 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71311 add 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71312 add 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71313 add 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71314 add 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71315 add 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71316 add 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71317 add 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71318 add 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71319 add 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71320 add 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71321 add 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71322 add 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71323 add 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71324 add 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71325 add 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71326 add 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71327 add 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71328 add 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71329 add 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71330 add 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71331 add 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71332 add 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71333 add 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71334 add 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71335 add 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71336 add 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71337 add 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71338 add 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71339 add 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-
-dqadd71340 add 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded
-dqadd71341 add 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded
-
-dqadd71349 add 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71350 add 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71351 add 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71352 add 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71353 add 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71354 add 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71355 add 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71356 add 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71357 add 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71358 add 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71359 add 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71360 add 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71361 add 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71362 add 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71363 add 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71364 add 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd71365 add 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71367 add 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71368 add 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71369 add 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71370 add 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71371 add 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71372 add 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71373 add 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71374 add 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71375 add 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71376 add 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71377 add 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71378 add 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71379 add 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71380 add 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71381 add 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71382 add 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71383 add 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71384 add 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71385 add 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71386 add 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71387 add 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71388 add 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71389 add 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71390 add 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71391 add 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71392 add 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71393 add 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71394 add 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71395 add 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd71396 add 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-dqadd71420 add 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345
-dqadd71421 add 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345
-dqadd71422 add 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345
-dqadd71423 add 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345
-dqadd71424 add 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345
-dqadd71425 add 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345
-dqadd71426 add 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345
-dqadd71427 add 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7
-dqadd71428 add 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8
-dqadd71429 add 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9
-dqadd71430 add 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10
-dqadd71431 add 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11
-dqadd71432 add 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12
-dqadd71433 add 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13
-dqadd71434 add 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14
-dqadd71435 add 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15
-dqadd71436 add 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16
-dqadd71437 add 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17
-dqadd71438 add 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18
-dqadd71439 add 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19
-dqadd71440 add 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20
-dqadd71441 add 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21
-dqadd71442 add 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22
-dqadd71443 add 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23
-dqadd71444 add 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24
-dqadd71445 add 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25
-dqadd71446 add 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26
-dqadd71447 add 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27
-dqadd71448 add 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28
-dqadd71449 add 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29
-dqadd71450 add 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30
-dqadd71451 add 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31
-dqadd71452 add 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32
-dqadd71453 add 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33
-dqadd71454 add 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34
-dqadd71455 add 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35
-dqadd71456 add 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36
-
--- same, reversed 0
-dqadd71460 add 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345
-dqadd71461 add 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345
-dqadd71462 add 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345
-dqadd71463 add 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345
-dqadd71464 add 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345
-dqadd71465 add 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345
-dqadd71466 add 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345
-dqadd71467 add 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7
-dqadd71468 add 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8
-dqadd71469 add 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9
-dqadd71470 add 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10
-dqadd71471 add 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11
-dqadd71472 add 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12
-dqadd71473 add 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13
-dqadd71474 add 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14
-dqadd71475 add 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15
-dqadd71476 add 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16
-dqadd71477 add 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17
-dqadd71478 add 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18
-dqadd71479 add 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19
-dqadd71480 add 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20
-dqadd71481 add 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21
-dqadd71482 add 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22
-dqadd71483 add 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23
-dqadd71484 add 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24
-dqadd71485 add 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25
-dqadd71486 add 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26
-dqadd71487 add 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27
-dqadd71488 add 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28
-dqadd71489 add 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29
-dqadd71490 add 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30
-dqadd71491 add 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31
-dqadd71492 add 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32
-dqadd71493 add 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33
-dqadd71494 add 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34
-dqadd71495 add 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35
-dqadd71496 add 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36
-
--- same, Es on the 0
-dqadd71500 add 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345
-dqadd71501 add 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345
-dqadd71502 add 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345
-dqadd71503 add 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345
-dqadd71504 add 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345
-dqadd71505 add 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345
-dqadd71506 add 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345
-dqadd71507 add 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345
-dqadd71508 add 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345
-dqadd71509 add 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345
-dqadd71510 add 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345
-dqadd71511 add 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345
-dqadd71512 add 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345
-dqadd71513 add 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345
-dqadd71514 add 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345
-dqadd71515 add 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345
-dqadd71516 add 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345
-dqadd71517 add 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345
-dqadd71518 add 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345
-dqadd71519 add 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345
-dqadd71520 add 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345
-dqadd71521 add 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345
-dqadd71522 add 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345
-dqadd71523 add 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345
-dqadd71524 add 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345
-dqadd71525 add 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345
-dqadd71526 add 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345
-dqadd71527 add 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345
-dqadd71528 add 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345
-dqadd71529 add 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345
-dqadd71530 add 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345
-dqadd71531 add 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345
-dqadd71532 add 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345
-dqadd71533 add 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345
--- next four flag Rounded because the 0 extends the result
-dqadd71534 add 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded
-dqadd71535 add 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded
-dqadd71536 add 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded
-dqadd71537 add 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-dqadd71600 add 0 0E-19 -> 0E-19
-dqadd71601 add -0 0E-19 -> 0E-19
-dqadd71602 add 0 -0E-19 -> 0E-19
-dqadd71603 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71611 add -11 11 -> 0
-dqadd71612 add 11 -11 -> 0
-
-rounding: half_down
--- exact zeros from zeros
-dqadd71620 add 0 0E-19 -> 0E-19
-dqadd71621 add -0 0E-19 -> 0E-19
-dqadd71622 add 0 -0E-19 -> 0E-19
-dqadd71623 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71631 add -11 11 -> 0
-dqadd71632 add 11 -11 -> 0
-
-rounding: half_even
--- exact zeros from zeros
-dqadd71640 add 0 0E-19 -> 0E-19
-dqadd71641 add -0 0E-19 -> 0E-19
-dqadd71642 add 0 -0E-19 -> 0E-19
-dqadd71643 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71651 add -11 11 -> 0
-dqadd71652 add 11 -11 -> 0
-
-rounding: up
--- exact zeros from zeros
-dqadd71660 add 0 0E-19 -> 0E-19
-dqadd71661 add -0 0E-19 -> 0E-19
-dqadd71662 add 0 -0E-19 -> 0E-19
-dqadd71663 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71671 add -11 11 -> 0
-dqadd71672 add 11 -11 -> 0
-
-rounding: down
--- exact zeros from zeros
-dqadd71680 add 0 0E-19 -> 0E-19
-dqadd71681 add -0 0E-19 -> 0E-19
-dqadd71682 add 0 -0E-19 -> 0E-19
-dqadd71683 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71691 add -11 11 -> 0
-dqadd71692 add 11 -11 -> 0
-
-rounding: ceiling
--- exact zeros from zeros
-dqadd71700 add 0 0E-19 -> 0E-19
-dqadd71701 add -0 0E-19 -> 0E-19
-dqadd71702 add 0 -0E-19 -> 0E-19
-dqadd71703 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71711 add -11 11 -> 0
-dqadd71712 add 11 -11 -> 0
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-dqadd71720 add 0 0E-19 -> 0E-19
-dqadd71721 add -0 0E-19 -> -0E-19 -- *
-dqadd71722 add 0 -0E-19 -> -0E-19 -- *
-dqadd71723 add -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd71731 add -11 11 -> -0 -- *
-dqadd71732 add 11 -11 -> -0 -- *
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dqadd71741 add 130E-2 120E-2 -> 2.50
-dqadd71742 add 130E-2 12E-1 -> 2.50
-dqadd71743 add 130E-2 1E0 -> 2.30
-dqadd71744 add 1E2 1E4 -> 1.01E+4
-dqadd71745 add 130E-2 -120E-2 -> 0.10
-dqadd71746 add 130E-2 -12E-1 -> 0.10
-dqadd71747 add 130E-2 -1E0 -> 0.30
-dqadd71748 add 1E2 -1E4 -> -9.9E+3
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-dqadd75001 add 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457
-dqadd75002 add 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded
-dqadd75003 add 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75004 add 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75005 add 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75006 add 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75007 add 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75008 add 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75009 add 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75010 add 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75011 add 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75012 add 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75013 add 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75014 add 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75015 add 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75016 add 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75017 add 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75018 add 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75019 add 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75020 add 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd75021 add 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded
-
--- widening second argument at gap
-dqadd75030 add 12398765432112345678945678 1 -> 12398765432112345678945679
-dqadd75031 add 12398765432112345678945678 0.1 -> 12398765432112345678945678.1
-dqadd75032 add 12398765432112345678945678 0.12 -> 12398765432112345678945678.12
-dqadd75033 add 12398765432112345678945678 0.123 -> 12398765432112345678945678.123
-dqadd75034 add 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234
-dqadd75035 add 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345
-dqadd75036 add 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456
-dqadd75037 add 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567
-dqadd75038 add 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678
-dqadd75039 add 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75040 add 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded
-dqadd75041 add 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded
-dqadd75042 add 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75043 add 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75044 add 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75045 add 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75046 add 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75047 add 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75048 add 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd75049 add 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-dqadd75050 add 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded
-dqadd75051 add 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded
-dqadd75052 add 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded
-dqadd75053 add 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded
-dqadd75054 add 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded
-dqadd75055 add 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded
-dqadd75056 add 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded
-dqadd75057 add 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded
-dqadd75060 add 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded
-dqadd75061 add 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded
-dqadd75062 add 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded
-dqadd75063 add 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded
-dqadd75064 add 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded
-dqadd75065 add 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded
-dqadd75066 add 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded
-dqadd75067 add 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-dqadd75070 add 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001
-dqadd75071 add 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75072 add 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75073 add 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75074 add 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75075 add 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75076 add 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75077 add 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75078 add 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75079 add 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75080 add 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75081 add 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75082 add 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75083 add 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75084 add 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75085 add 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75086 add 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75087 add 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75088 add 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd75089 add 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded
-
--- Null tests
-dqadd9990 add 10 # -> NaN Invalid_operation
-dqadd9991 add # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqAdd.decTest -- decQuad addition --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decQuads only; all arguments are
+-- representable in a decQuad
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+dqadd001 add 1 1 -> 2
+dqadd002 add 2 3 -> 5
+dqadd003 add '5.75' '3.3' -> 9.05
+dqadd004 add '5' '-3' -> 2
+dqadd005 add '-5' '-3' -> -8
+dqadd006 add '-7' '2.5' -> -4.5
+dqadd007 add '0.7' '0.3' -> 1.0
+dqadd008 add '1.25' '1.25' -> 2.50
+dqadd009 add '1.23456789' '1.00000000' -> '2.23456789'
+dqadd010 add '1.23456789' '1.00000011' -> '2.23456800'
+
+-- 1234567890123456 1234567890123456
+dqadd011 add '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqadd012 add '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded
+dqadd013 add '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
+dqadd014 add '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd015 add '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd016 add '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd017 add '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd018 add '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded
+dqadd019 add '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded
+dqadd020 add '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded
+
+dqadd021 add 0 1 -> 1
+dqadd022 add 1 1 -> 2
+dqadd023 add 2 1 -> 3
+dqadd024 add 3 1 -> 4
+dqadd025 add 4 1 -> 5
+dqadd026 add 5 1 -> 6
+dqadd027 add 6 1 -> 7
+dqadd028 add 7 1 -> 8
+dqadd029 add 8 1 -> 9
+dqadd030 add 9 1 -> 10
+
+-- some carrying effects
+dqadd031 add '0.9998' '0.0000' -> '0.9998'
+dqadd032 add '0.9998' '0.0001' -> '0.9999'
+dqadd033 add '0.9998' '0.0002' -> '1.0000'
+dqadd034 add '0.9998' '0.0003' -> '1.0001'
+
+dqadd035 add '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd036 add '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd037 add '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd038 add '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
+dqadd039 add '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded
+
+-- symmetry:
+dqadd040 add '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd041 add '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd042 add '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd044 add '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
+dqadd045 add '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded
+
+-- same, without rounding
+dqadd046 add '10000e+9' '7' -> '10000000000007'
+dqadd047 add '10000e+9' '70' -> '10000000000070'
+dqadd048 add '10000e+9' '700' -> '10000000000700'
+dqadd049 add '10000e+9' '7000' -> '10000000007000'
+dqadd050 add '10000e+9' '70000' -> '10000000070000'
+dqadd051 add '10000e+9' '700000' -> '10000000700000'
+dqadd052 add '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+dqadd053 add '12' '7.00' -> '19.00'
+dqadd054 add '1.3' '-1.07' -> '0.23'
+dqadd055 add '1.3' '-1.30' -> '0.00'
+dqadd056 add '1.3' '-2.07' -> '-0.77'
+dqadd057 add '1E+2' '1E+4' -> '1.01E+4'
+
+-- leading zero preservation
+dqadd061 add 1 '0.0001' -> '1.0001'
+dqadd062 add 1 '0.00001' -> '1.00001'
+dqadd063 add 1 '0.000001' -> '1.000001'
+dqadd064 add 1 '0.0000001' -> '1.0000001'
+dqadd065 add 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+dqadd070 add 1 0 -> 1
+dqadd071 add 1 0. -> 1
+dqadd072 add 1 .0 -> 1.0
+dqadd073 add 1 0.0 -> 1.0
+dqadd074 add 1 0.00 -> 1.00
+dqadd075 add 0 1 -> 1
+dqadd076 add 0. 1 -> 1
+dqadd077 add .0 1 -> 1.0
+dqadd078 add 0.0 1 -> 1.0
+dqadd079 add 0.00 1 -> 1.00
+
+-- some carries
+dqadd080 add 999999998 1 -> 999999999
+dqadd081 add 999999999 1 -> 1000000000
+dqadd082 add 99999999 1 -> 100000000
+dqadd083 add 9999999 1 -> 10000000
+dqadd084 add 999999 1 -> 1000000
+dqadd085 add 99999 1 -> 100000
+dqadd086 add 9999 1 -> 10000
+dqadd087 add 999 1 -> 1000
+dqadd088 add 99 1 -> 100
+dqadd089 add 9 1 -> 10
+
+
+-- more LHS swaps
+dqadd090 add '-56267E-10' 0 -> '-0.0000056267'
+dqadd091 add '-56267E-6' 0 -> '-0.056267'
+dqadd092 add '-56267E-5' 0 -> '-0.56267'
+dqadd093 add '-56267E-4' 0 -> '-5.6267'
+dqadd094 add '-56267E-3' 0 -> '-56.267'
+dqadd095 add '-56267E-2' 0 -> '-562.67'
+dqadd096 add '-56267E-1' 0 -> '-5626.7'
+dqadd097 add '-56267E-0' 0 -> '-56267'
+dqadd098 add '-5E-10' 0 -> '-5E-10'
+dqadd099 add '-5E-7' 0 -> '-5E-7'
+dqadd100 add '-5E-6' 0 -> '-0.000005'
+dqadd101 add '-5E-5' 0 -> '-0.00005'
+dqadd102 add '-5E-4' 0 -> '-0.0005'
+dqadd103 add '-5E-1' 0 -> '-0.5'
+dqadd104 add '-5E0' 0 -> '-5'
+dqadd105 add '-5E1' 0 -> '-50'
+dqadd106 add '-5E5' 0 -> '-500000'
+dqadd107 add '-5E33' 0 -> '-5000000000000000000000000000000000'
+dqadd108 add '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
+dqadd109 add '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
+dqadd110 add '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
+dqadd111 add '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- more RHS swaps
+dqadd113 add 0 '-56267E-10' -> '-0.0000056267'
+dqadd114 add 0 '-56267E-6' -> '-0.056267'
+dqadd116 add 0 '-56267E-5' -> '-0.56267'
+dqadd117 add 0 '-56267E-4' -> '-5.6267'
+dqadd119 add 0 '-56267E-3' -> '-56.267'
+dqadd120 add 0 '-56267E-2' -> '-562.67'
+dqadd121 add 0 '-56267E-1' -> '-5626.7'
+dqadd122 add 0 '-56267E-0' -> '-56267'
+dqadd123 add 0 '-5E-10' -> '-5E-10'
+dqadd124 add 0 '-5E-7' -> '-5E-7'
+dqadd125 add 0 '-5E-6' -> '-0.000005'
+dqadd126 add 0 '-5E-5' -> '-0.00005'
+dqadd127 add 0 '-5E-4' -> '-0.0005'
+dqadd128 add 0 '-5E-1' -> '-0.5'
+dqadd129 add 0 '-5E0' -> '-5'
+dqadd130 add 0 '-5E1' -> '-50'
+dqadd131 add 0 '-5E5' -> '-500000'
+dqadd132 add 0 '-5E33' -> '-5000000000000000000000000000000000'
+dqadd133 add 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded
+dqadd134 add 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded
+dqadd135 add 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded
+dqadd136 add 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- related
+dqadd137 add 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded
+dqadd138 add -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded
+dqadd139 add '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded
+dqadd140 add '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded
+dqadd141 add 1E+29 0.0000 -> '100000000000000000000000000000.0000'
+dqadd142 add 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded
+dqadd143 add 0.000 1E+30 -> '1000000000000000000000000000000.000'
+dqadd144 add 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+dqadd146 add '00.0' 0 -> '0.0'
+dqadd147 add '0.00' 0 -> '0.00'
+dqadd148 add 0 '0.00' -> '0.00'
+dqadd149 add 0 '00.0' -> '0.0'
+dqadd150 add '00.0' '0.00' -> '0.00'
+dqadd151 add '0.00' '00.0' -> '0.00'
+dqadd152 add '3' '.3' -> '3.3'
+dqadd153 add '3.' '.3' -> '3.3'
+dqadd154 add '3.0' '.3' -> '3.3'
+dqadd155 add '3.00' '.3' -> '3.30'
+dqadd156 add '3' '3' -> '6'
+dqadd157 add '3' '+3' -> '6'
+dqadd158 add '3' '-3' -> '0'
+dqadd159 add '0.3' '-0.3' -> '0.0'
+dqadd160 add '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+dqadd161 add '1E+12' '-1' -> '999999999999'
+dqadd162 add '1E+12' '1.11' -> '1000000000001.11'
+dqadd163 add '1.11' '1E+12' -> '1000000000001.11'
+dqadd164 add '-1' '1E+12' -> '999999999999'
+dqadd165 add '7E+12' '-1' -> '6999999999999'
+dqadd166 add '7E+12' '1.11' -> '7000000000001.11'
+dqadd167 add '1.11' '7E+12' -> '7000000000001.11'
+dqadd168 add '-1' '7E+12' -> '6999999999999'
+
+rounding: half_up
+dqadd170 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd171 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd172 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd173 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded
+dqadd174 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd175 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd176 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd177 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded
+dqadd178 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd179 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd180 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd181 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd182 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd183 add '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+dqadd200 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd201 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd202 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd203 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd204 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd205 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd206 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd207 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd208 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd209 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd210 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd211 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd212 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd213 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd214 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd215 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd216 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd217 add '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd218 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd219 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+
+rounding: half_even
+dqadd220 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd221 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd222 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd223 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd224 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd225 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd226 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd227 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd228 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd229 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd230 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd231 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd232 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd233 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd234 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd235 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd236 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd237 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd238 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd239 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+-- critical few with even bottom digit...
+dqadd240 add '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded
+dqadd241 add '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded
+dqadd242 add '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
+
+rounding: down
+dqadd250 add '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd251 add '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd252 add '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd253 add '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd254 add '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd255 add '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd256 add '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd257 add '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd258 add '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd259 add '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd260 add '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd261 add '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd262 add '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd263 add '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd264 add '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd265 add '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd266 add '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd267 add '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd268 add '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd269 add '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+dqadd301 add -1 1 -> 0
+dqadd302 add 0 1 -> 1
+dqadd303 add 1 1 -> 2
+dqadd304 add 12 1 -> 13
+dqadd305 add 98 1 -> 99
+dqadd306 add 99 1 -> 100
+dqadd307 add 100 1 -> 101
+dqadd308 add 101 1 -> 102
+dqadd309 add -1 -1 -> -2
+dqadd310 add 0 -1 -> -1
+dqadd311 add 1 -1 -> 0
+dqadd312 add 12 -1 -> 11
+dqadd313 add 98 -1 -> 97
+dqadd314 add 99 -1 -> 98
+dqadd315 add 100 -1 -> 99
+dqadd316 add 101 -1 -> 100
+
+dqadd321 add -0.01 0.01 -> 0.00
+dqadd322 add 0.00 0.01 -> 0.01
+dqadd323 add 0.01 0.01 -> 0.02
+dqadd324 add 0.12 0.01 -> 0.13
+dqadd325 add 0.98 0.01 -> 0.99
+dqadd326 add 0.99 0.01 -> 1.00
+dqadd327 add 1.00 0.01 -> 1.01
+dqadd328 add 1.01 0.01 -> 1.02
+dqadd329 add -0.01 -0.01 -> -0.02
+dqadd330 add 0.00 -0.01 -> -0.01
+dqadd331 add 0.01 -0.01 -> 0.00
+dqadd332 add 0.12 -0.01 -> 0.11
+dqadd333 add 0.98 -0.01 -> 0.97
+dqadd334 add 0.99 -0.01 -> 0.98
+dqadd335 add 1.00 -0.01 -> 0.99
+dqadd336 add 1.01 -0.01 -> 1.00
+
+-- some more cases where adding 0 affects the coefficient
+dqadd340 add 1E+3 0 -> 1000
+dqadd341 add 1E+33 0 -> 1000000000000000000000000000000000
+dqadd342 add 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded
+dqadd343 add 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded
+-- which simply follow from these cases ...
+dqadd344 add 1E+3 1 -> 1001
+dqadd345 add 1E+33 1 -> 1000000000000000000000000000000001
+dqadd346 add 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd347 add 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
+dqadd348 add 1E+3 7 -> 1007
+dqadd349 add 1E+33 7 -> 1000000000000000000000000000000007
+dqadd350 add 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded
+dqadd351 add 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
+
+-- tryzeros cases
+rounding: half_up
+dqadd360 add 0E+50 10000E+1 -> 1.0000E+5
+dqadd361 add 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded
+dqadd362 add 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded
+dqadd363 add 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact
+dqadd364 add 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111
+-- 1 234567890123456789012345678901234
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+dqadd370 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd371 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+rounding: half_up
+dqadd372 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd373 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+rounding: half_even
+dqadd374 add 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd375 add 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+
+-- ulp replacement tests
+dqadd400 add 1 77e-32 -> 1.00000000000000000000000000000077
+dqadd401 add 1 77e-33 -> 1.000000000000000000000000000000077
+dqadd402 add 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded
+dqadd403 add 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded
+dqadd404 add 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd405 add 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd406 add 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd410 add 10 77e-32 -> 10.00000000000000000000000000000077
+dqadd411 add 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded
+dqadd412 add 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded
+dqadd413 add 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd414 add 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd415 add 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd416 add 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd420 add 77e-32 1 -> 1.00000000000000000000000000000077
+dqadd421 add 77e-33 1 -> 1.000000000000000000000000000000077
+dqadd422 add 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded
+dqadd423 add 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded
+dqadd424 add 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd425 add 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd426 add 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd430 add 77e-32 10 -> 10.00000000000000000000000000000077
+dqadd431 add 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded
+dqadd432 add 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded
+dqadd433 add 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd434 add 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd435 add 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd436 add 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+-- fastpath boundaries
+-- 1234567890123456789012345678901234
+dqadd501 add '4444444444444444444444444444444444' '5555555555555555555555555555555555' -> '9999999999999999999999999999999999'
+dqadd502 add '4444444444444444444444444444444444' '4555555555555555555555555555555555' -> '8999999999999999999999999999999999'
+dqadd503 add '4444444444444444444444444444444444' '3555555555555555555055555555555555' -> '7999999999999999999499999999999999'
+dqadd504 add '4444444444444444444444444444444444' '3955555555555555555555555555555555' -> '8399999999999999999999999999999999'
+dqadd505 add '4444444444444444444444444444444444' '4955555555555555555555555555555555' -> '9399999999999999999999999999999999'
+dqadd506 add '4444444444444444444444444444444444' '5955555555555555555555555555555555' -> 1.040000000000000000000000000000000E+34 Inexact Rounded
+dqadd511 add '344444444444444444444444444444444' '555555555555555555555555555555555' -> '899999999999999999999999999999999'
+dqadd512 add '34444444444444444444444444444444' '55555555555555555555555555555555' -> '89999999999999999999999999999999'
+dqadd513 add '3444444444444444444444444444444' '5555555555555555555555555555555' -> '8999999999999999999999999999999'
+dqadd514 add '344444444444444444444444444444' '555555555555555555555555555555' -> '899999999999999999999999999999'
+dqadd515 add '34444444444444444444444444444' '55555555555555555555555555555' -> '89999999999999999999999999999'
+dqadd516 add '3444444444444444444444444444' '5555555555555555555555555555' -> '8999999999999999999999999999'
+dqadd517 add '344444444444444444444444444' '555555555555555555555555555' -> '899999999999999999999999999'
+dqadd518 add '34444444444444444444444444' '55555555555555555555555555' -> '89999999999999999999999999'
+dqadd519 add '3444444444444444444444444' '5555555555555555555555555' -> '8999999999999999999999999'
+dqadd520 add '344444444444444444444444' '555555555555555555555555' -> '899999999999999999999999'
+dqadd521 add '34444444444444444444444' '55555555555555555555555' -> '89999999999999999999999'
+dqadd522 add '3444444444444444444444' '5555555555555555555555' -> '8999999999999999999999'
+dqadd523 add '4444444444444444444444' '3333333333333333333333' -> '7777777777777777777777'
+dqadd524 add '344444444444444444444' '555555555555555555555' -> '899999999999999999999'
+dqadd525 add '34444444444444444444' '55555555555555555555' -> '89999999999999999999'
+dqadd526 add '3444444444444444444' '5555555555555555555' -> '8999999999999999999'
+dqadd527 add '344444444444444444' '555555555555555555' -> '899999999999999999'
+dqadd528 add '34444444444444444' '55555555555555555' -> '89999999999999999'
+dqadd529 add '3444444444444444' '5555555555555555' -> '8999999999999999'
+dqadd530 add '344444444444444' '555555555555555' -> '899999999999999'
+dqadd531 add '34444444444444' '55555555555555' -> '89999999999999'
+dqadd532 add '3444444444444' '5555555555555' -> '8999999999999'
+dqadd533 add '344444444444' '555555555555' -> '899999999999'
+dqadd534 add '34444444444' '55555555555' -> '89999999999'
+dqadd535 add '3444444444' '5555555555' -> '8999999999'
+dqadd536 add '344444444' '555555555' -> '899999999'
+dqadd537 add '34444444' '55555555' -> '89999999'
+dqadd538 add '3444444' '5555555' -> '8999999'
+dqadd539 add '344444' '555555' -> '899999'
+dqadd540 add '34444' '55555' -> '89999'
+dqadd541 add '3444' '5555' -> '8999'
+dqadd542 add '344' '555' -> '899'
+dqadd543 add '34' '55' -> '89'
+dqadd544 add '3' '5' -> '8'
+
+dqadd545 add '3000004000000000000000000000000000' '3000000000000040000000000000000000' -> '6000004000000040000000000000000000'
+dqadd546 add '3000000400000000000000000000000000' '4000000000000400000000000000000000' -> '7000000400000400000000000000000000'
+dqadd547 add '3000000040000000000000000000000000' '5000000000004000000000000000000000' -> '8000000040004000000000000000000000'
+dqadd548 add '4000000004000000000000000000000000' '3000000000040000000000000000000000' -> '7000000004040000000000000000000000'
+dqadd549 add '4000000000400000000000000000000000' '4000000000400000000000000000000000' -> '8000000000800000000000000000000000'
+dqadd550 add '4000000000040000000000000000000000' '5000000004000000000000000000000000' -> '9000000004040000000000000000000000'
+dqadd551 add '5000000000004000000000000000000000' '3000000040000000000000000000000000' -> '8000000040004000000000000000000000'
+dqadd552 add '5000000000000400000000000000000000' '4000000400000000000000000000000000' -> '9000000400000400000000000000000000'
+dqadd553 add '5000000000000040000000000000000000' '5000004000000000000000000000000000' -> 1.000000400000004000000000000000000E+34 Rounded
+-- check propagation
+dqadd554 add '8999999999999999999999999999999999' '0000000000000000000000000000000001' -> 9000000000000000000000000000000000
+dqadd555 add '0000000000000000000000000000000001' '8999999999999999999999999999999999' -> 9000000000000000000000000000000000
+dqadd556 add '4444444444444444444444444444444444' '4555555555555555555555555555555556' -> 9000000000000000000000000000000000
+dqadd557 add '4555555555555555555555555555555556' '4444444444444444444444444444444444' -> 9000000000000000000000000000000000
+
+-- negative ulps
+dqadd6440 add 1 -77e-32 -> 0.99999999999999999999999999999923
+dqadd6441 add 1 -77e-33 -> 0.999999999999999999999999999999923
+dqadd6442 add 1 -77e-34 -> 0.9999999999999999999999999999999923
+dqadd6443 add 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded
+dqadd6444 add 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded
+dqadd6445 add 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd6446 add 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd6450 add 10 -77e-32 -> 9.99999999999999999999999999999923
+dqadd6451 add 10 -77e-33 -> 9.999999999999999999999999999999923
+dqadd6452 add 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded
+dqadd6453 add 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded
+dqadd6454 add 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd6455 add 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd6456 add 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd6460 add -77e-32 1 -> 0.99999999999999999999999999999923
+dqadd6461 add -77e-33 1 -> 0.999999999999999999999999999999923
+dqadd6462 add -77e-34 1 -> 0.9999999999999999999999999999999923
+dqadd6463 add -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded
+dqadd6464 add -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded
+dqadd6465 add -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd6466 add -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd6470 add -77e-32 10 -> 9.99999999999999999999999999999923
+dqadd6471 add -77e-33 10 -> 9.999999999999999999999999999999923
+dqadd6472 add -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded
+dqadd6473 add -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded
+dqadd6474 add -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd6475 add -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd6476 add -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+-- negative ulps
+dqadd6480 add -1 77e-32 -> -0.99999999999999999999999999999923
+dqadd6481 add -1 77e-33 -> -0.999999999999999999999999999999923
+dqadd6482 add -1 77e-34 -> -0.9999999999999999999999999999999923
+dqadd6483 add -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded
+dqadd6484 add -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded
+dqadd6485 add -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded
+dqadd6486 add -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd6490 add -10 77e-32 -> -9.99999999999999999999999999999923
+dqadd6491 add -10 77e-33 -> -9.999999999999999999999999999999923
+dqadd6492 add -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded
+dqadd6493 add -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded
+dqadd6494 add -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd6495 add -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd6496 add -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd6500 add 77e-32 -1 -> -0.99999999999999999999999999999923
+dqadd6501 add 77e-33 -1 -> -0.999999999999999999999999999999923
+dqadd6502 add 77e-34 -1 -> -0.9999999999999999999999999999999923
+dqadd6503 add 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded
+dqadd6504 add 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded
+dqadd6505 add 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
+dqadd6506 add 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd6510 add 77e-32 -10 -> -9.99999999999999999999999999999923
+dqadd6511 add 77e-33 -10 -> -9.999999999999999999999999999999923
+dqadd6512 add 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded
+dqadd6513 add 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded
+dqadd6514 add 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd6515 add 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd6516 add 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+
+-- and some more residue effects and different roundings
+rounding: half_up
+dqadd6540 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd6541 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6542 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6543 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6544 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6545 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6546 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6547 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6548 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6549 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6550 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6551 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6552 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6553 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6554 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6555 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6556 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd6557 add '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6558 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6559 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+rounding: half_even
+dqadd6560 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd6561 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6562 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6563 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6564 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6565 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6566 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6567 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd6568 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6569 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6570 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6571 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6572 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6573 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6574 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6575 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6576 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd6577 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6578 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd6579 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+-- critical few with even bottom digit...
+dqadd7540 add '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded
+dqadd7541 add '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded
+dqadd7542 add '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
+
+rounding: down
+dqadd7550 add '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd7551 add '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7552 add '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7553 add '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7554 add '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7555 add '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7556 add '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7557 add '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7558 add '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7559 add '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7560 add '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7561 add '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7562 add '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7563 add '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7564 add '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7565 add '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd7566 add '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd7567 add '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd7568 add '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd7569 add '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+dqadd7701 add 5.00 1.00E-3 -> 5.00100
+dqadd7702 add 00.00 0.000 -> 0.000
+dqadd7703 add 00.00 0E-3 -> 0.000
+dqadd7704 add 0E-3 00.00 -> 0.000
+
+dqadd7710 add 0E+3 00.00 -> 0.00
+dqadd7711 add 0E+3 00.0 -> 0.0
+dqadd7712 add 0E+3 00. -> 0
+dqadd7713 add 0E+3 00.E+1 -> 0E+1
+dqadd7714 add 0E+3 00.E+2 -> 0E+2
+dqadd7715 add 0E+3 00.E+3 -> 0E+3
+dqadd7716 add 0E+3 00.E+4 -> 0E+3
+dqadd7717 add 0E+3 00.E+5 -> 0E+3
+dqadd7718 add 0E+3 -00.0 -> 0.0
+dqadd7719 add 0E+3 -00. -> 0
+dqadd7731 add 0E+3 -00.E+1 -> 0E+1
+
+dqadd7720 add 00.00 0E+3 -> 0.00
+dqadd7721 add 00.0 0E+3 -> 0.0
+dqadd7722 add 00. 0E+3 -> 0
+dqadd7723 add 00.E+1 0E+3 -> 0E+1
+dqadd7724 add 00.E+2 0E+3 -> 0E+2
+dqadd7725 add 00.E+3 0E+3 -> 0E+3
+dqadd7726 add 00.E+4 0E+3 -> 0E+3
+dqadd7727 add 00.E+5 0E+3 -> 0E+3
+dqadd7728 add -00.00 0E+3 -> 0.00
+dqadd7729 add -00.0 0E+3 -> 0.0
+dqadd7730 add -00. 0E+3 -> 0
+
+dqadd7732 add 0 0 -> 0
+dqadd7733 add 0 -0 -> 0
+dqadd7734 add -0 0 -> 0
+dqadd7735 add -0 -0 -> -0 -- IEEE 754 special case
+
+dqadd7736 add 1 -1 -> 0
+dqadd7737 add -1 -1 -> -2
+dqadd7738 add 1 1 -> 2
+dqadd7739 add -1 1 -> 0
+
+dqadd7741 add 0 -1 -> -1
+dqadd7742 add -0 -1 -> -1
+dqadd7743 add 0 1 -> 1
+dqadd7744 add -0 1 -> 1
+dqadd7745 add -1 0 -> -1
+dqadd7746 add -1 -0 -> -1
+dqadd7747 add 1 0 -> 1
+dqadd7748 add 1 -0 -> 1
+
+dqadd7751 add 0.0 -1 -> -1.0
+dqadd7752 add -0.0 -1 -> -1.0
+dqadd7753 add 0.0 1 -> 1.0
+dqadd7754 add -0.0 1 -> 1.0
+dqadd7755 add -1.0 0 -> -1.0
+dqadd7756 add -1.0 -0 -> -1.0
+dqadd7757 add 1.0 0 -> 1.0
+dqadd7758 add 1.0 -0 -> 1.0
+
+dqadd7761 add 0 -1.0 -> -1.0
+dqadd7762 add -0 -1.0 -> -1.0
+dqadd7763 add 0 1.0 -> 1.0
+dqadd7764 add -0 1.0 -> 1.0
+dqadd7765 add -1 0.0 -> -1.0
+dqadd7766 add -1 -0.0 -> -1.0
+dqadd7767 add 1 0.0 -> 1.0
+dqadd7768 add 1 -0.0 -> 1.0
+
+dqadd7771 add 0.0 -1.0 -> -1.0
+dqadd7772 add -0.0 -1.0 -> -1.0
+dqadd7773 add 0.0 1.0 -> 1.0
+dqadd7774 add -0.0 1.0 -> 1.0
+dqadd7775 add -1.0 0.0 -> -1.0
+dqadd7776 add -1.0 -0.0 -> -1.0
+dqadd7777 add 1.0 0.0 -> 1.0
+dqadd7778 add 1.0 -0.0 -> 1.0
+
+-- Specials
+dqadd7780 add -Inf -Inf -> -Infinity
+dqadd7781 add -Inf -1000 -> -Infinity
+dqadd7782 add -Inf -1 -> -Infinity
+dqadd7783 add -Inf -0 -> -Infinity
+dqadd7784 add -Inf 0 -> -Infinity
+dqadd7785 add -Inf 1 -> -Infinity
+dqadd7786 add -Inf 1000 -> -Infinity
+dqadd7787 add -1000 -Inf -> -Infinity
+dqadd7788 add -Inf -Inf -> -Infinity
+dqadd7789 add -1 -Inf -> -Infinity
+dqadd7790 add -0 -Inf -> -Infinity
+dqadd7791 add 0 -Inf -> -Infinity
+dqadd7792 add 1 -Inf -> -Infinity
+dqadd7793 add 1000 -Inf -> -Infinity
+dqadd7794 add Inf -Inf -> NaN Invalid_operation
+
+dqadd7800 add Inf -Inf -> NaN Invalid_operation
+dqadd7801 add Inf -1000 -> Infinity
+dqadd7802 add Inf -1 -> Infinity
+dqadd7803 add Inf -0 -> Infinity
+dqadd7804 add Inf 0 -> Infinity
+dqadd7805 add Inf 1 -> Infinity
+dqadd7806 add Inf 1000 -> Infinity
+dqadd7807 add Inf Inf -> Infinity
+dqadd7808 add -1000 Inf -> Infinity
+dqadd7809 add -Inf Inf -> NaN Invalid_operation
+dqadd7810 add -1 Inf -> Infinity
+dqadd7811 add -0 Inf -> Infinity
+dqadd7812 add 0 Inf -> Infinity
+dqadd7813 add 1 Inf -> Infinity
+dqadd7814 add 1000 Inf -> Infinity
+dqadd7815 add Inf Inf -> Infinity
+
+dqadd7821 add NaN -Inf -> NaN
+dqadd7822 add NaN -1000 -> NaN
+dqadd7823 add NaN -1 -> NaN
+dqadd7824 add NaN -0 -> NaN
+dqadd7825 add NaN 0 -> NaN
+dqadd7826 add NaN 1 -> NaN
+dqadd7827 add NaN 1000 -> NaN
+dqadd7828 add NaN Inf -> NaN
+dqadd7829 add NaN NaN -> NaN
+dqadd7830 add -Inf NaN -> NaN
+dqadd7831 add -1000 NaN -> NaN
+dqadd7832 add -1 NaN -> NaN
+dqadd7833 add -0 NaN -> NaN
+dqadd7834 add 0 NaN -> NaN
+dqadd7835 add 1 NaN -> NaN
+dqadd7836 add 1000 NaN -> NaN
+dqadd7837 add Inf NaN -> NaN
+
+dqadd7841 add sNaN -Inf -> NaN Invalid_operation
+dqadd7842 add sNaN -1000 -> NaN Invalid_operation
+dqadd7843 add sNaN -1 -> NaN Invalid_operation
+dqadd7844 add sNaN -0 -> NaN Invalid_operation
+dqadd7845 add sNaN 0 -> NaN Invalid_operation
+dqadd7846 add sNaN 1 -> NaN Invalid_operation
+dqadd7847 add sNaN 1000 -> NaN Invalid_operation
+dqadd7848 add sNaN NaN -> NaN Invalid_operation
+dqadd7849 add sNaN sNaN -> NaN Invalid_operation
+dqadd7850 add NaN sNaN -> NaN Invalid_operation
+dqadd7851 add -Inf sNaN -> NaN Invalid_operation
+dqadd7852 add -1000 sNaN -> NaN Invalid_operation
+dqadd7853 add -1 sNaN -> NaN Invalid_operation
+dqadd7854 add -0 sNaN -> NaN Invalid_operation
+dqadd7855 add 0 sNaN -> NaN Invalid_operation
+dqadd7856 add 1 sNaN -> NaN Invalid_operation
+dqadd7857 add 1000 sNaN -> NaN Invalid_operation
+dqadd7858 add Inf sNaN -> NaN Invalid_operation
+dqadd7859 add NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqadd7861 add NaN1 -Inf -> NaN1
+dqadd7862 add +NaN2 -1000 -> NaN2
+dqadd7863 add NaN3 1000 -> NaN3
+dqadd7864 add NaN4 Inf -> NaN4
+dqadd7865 add NaN5 +NaN6 -> NaN5
+dqadd7866 add -Inf NaN7 -> NaN7
+dqadd7867 add -1000 NaN8 -> NaN8
+dqadd7868 add 1000 NaN9 -> NaN9
+dqadd7869 add Inf +NaN10 -> NaN10
+dqadd7871 add sNaN11 -Inf -> NaN11 Invalid_operation
+dqadd7872 add sNaN12 -1000 -> NaN12 Invalid_operation
+dqadd7873 add sNaN13 1000 -> NaN13 Invalid_operation
+dqadd7874 add sNaN14 NaN17 -> NaN14 Invalid_operation
+dqadd7875 add sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqadd7876 add NaN16 sNaN19 -> NaN19 Invalid_operation
+dqadd7877 add -Inf +sNaN20 -> NaN20 Invalid_operation
+dqadd7878 add -1000 sNaN21 -> NaN21 Invalid_operation
+dqadd7879 add 1000 sNaN22 -> NaN22 Invalid_operation
+dqadd7880 add Inf sNaN23 -> NaN23 Invalid_operation
+dqadd7881 add +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqadd7882 add -NaN26 NaN28 -> -NaN26
+dqadd7883 add -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqadd7884 add 1000 -NaN30 -> -NaN30
+dqadd7885 add 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Here we explore near the boundary of rounding a subnormal to Nmin
+dqadd7575 add 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal
+dqadd7576 add -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal
+
+-- check overflow edge case
+-- 1234567890123456
+dqadd7972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqadd7973 add 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7974 add 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7975 add 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded
+dqadd7976 add 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7977 add 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7978 add 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7979 add 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7980 add 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded
+dqadd7981 add 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7982 add 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7983 add 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7984 add 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+
+dqadd7985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqadd7986 add -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7987 add -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7988 add -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded
+dqadd7989 add -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7990 add -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7991 add -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7992 add -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7993 add -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd7994 add -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7995 add -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7996 add -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd7997 add -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+dqadd71100 add 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact
+dqadd71101 add 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact
+dqadd71103 add +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact
+dqadd71104 add 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact
+dqadd71105 add 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact
+dqadd71106 add 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact
+dqadd71107 add 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact
+dqadd71108 add 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact
+dqadd71109 add 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+dqadd71110 add -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact
+dqadd71111 add -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact
+dqadd71113 add -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact
+dqadd71114 add -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact
+dqadd71115 add -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact
+dqadd71116 add -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact
+dqadd71117 add -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact
+dqadd71118 add -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact
+dqadd71119 add -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+dqadd71300 add 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71310 add 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71311 add 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71312 add 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71313 add 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71314 add 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71315 add 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71316 add 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71317 add 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71318 add 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71319 add 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71320 add 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71321 add 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71322 add 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71323 add 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71324 add 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71325 add 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71326 add 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71327 add 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71328 add 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71329 add 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71330 add 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71331 add 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71332 add 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71333 add 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71334 add 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71335 add 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71336 add 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71337 add 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71338 add 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71339 add 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+
+dqadd71340 add 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded
+dqadd71341 add 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded
+
+dqadd71349 add 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71350 add 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71351 add 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71352 add 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71353 add 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71354 add 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71355 add 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71356 add 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71357 add 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71358 add 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71359 add 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71360 add 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71361 add 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71362 add 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71363 add 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71364 add 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd71365 add 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71367 add 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71368 add 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71369 add 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71370 add 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71371 add 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71372 add 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71373 add 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71374 add 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71375 add 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71376 add 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71377 add 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71378 add 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71379 add 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71380 add 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71381 add 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71382 add 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71383 add 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71384 add 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71385 add 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71386 add 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71387 add 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71388 add 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71389 add 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71390 add 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71391 add 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71392 add 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71393 add 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71394 add 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71395 add 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd71396 add 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+dqadd71420 add 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345
+dqadd71421 add 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345
+dqadd71422 add 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345
+dqadd71423 add 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345
+dqadd71424 add 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345
+dqadd71425 add 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345
+dqadd71426 add 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345
+dqadd71427 add 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7
+dqadd71428 add 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8
+dqadd71429 add 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9
+dqadd71430 add 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10
+dqadd71431 add 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11
+dqadd71432 add 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12
+dqadd71433 add 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13
+dqadd71434 add 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14
+dqadd71435 add 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15
+dqadd71436 add 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16
+dqadd71437 add 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17
+dqadd71438 add 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18
+dqadd71439 add 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19
+dqadd71440 add 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20
+dqadd71441 add 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21
+dqadd71442 add 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22
+dqadd71443 add 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23
+dqadd71444 add 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24
+dqadd71445 add 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25
+dqadd71446 add 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26
+dqadd71447 add 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27
+dqadd71448 add 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28
+dqadd71449 add 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29
+dqadd71450 add 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30
+dqadd71451 add 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31
+dqadd71452 add 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32
+dqadd71453 add 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33
+dqadd71454 add 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34
+dqadd71455 add 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35
+dqadd71456 add 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36
+
+-- same, reversed 0
+dqadd71460 add 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345
+dqadd71461 add 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345
+dqadd71462 add 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345
+dqadd71463 add 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345
+dqadd71464 add 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345
+dqadd71465 add 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345
+dqadd71466 add 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345
+dqadd71467 add 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7
+dqadd71468 add 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8
+dqadd71469 add 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9
+dqadd71470 add 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10
+dqadd71471 add 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11
+dqadd71472 add 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12
+dqadd71473 add 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13
+dqadd71474 add 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14
+dqadd71475 add 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15
+dqadd71476 add 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16
+dqadd71477 add 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17
+dqadd71478 add 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18
+dqadd71479 add 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19
+dqadd71480 add 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20
+dqadd71481 add 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21
+dqadd71482 add 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22
+dqadd71483 add 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23
+dqadd71484 add 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24
+dqadd71485 add 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25
+dqadd71486 add 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26
+dqadd71487 add 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27
+dqadd71488 add 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28
+dqadd71489 add 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29
+dqadd71490 add 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30
+dqadd71491 add 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31
+dqadd71492 add 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32
+dqadd71493 add 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33
+dqadd71494 add 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34
+dqadd71495 add 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35
+dqadd71496 add 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36
+
+-- same, Es on the 0
+dqadd71500 add 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345
+dqadd71501 add 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345
+dqadd71502 add 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345
+dqadd71503 add 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345
+dqadd71504 add 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345
+dqadd71505 add 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345
+dqadd71506 add 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345
+dqadd71507 add 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345
+dqadd71508 add 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345
+dqadd71509 add 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345
+dqadd71510 add 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345
+dqadd71511 add 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345
+dqadd71512 add 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345
+dqadd71513 add 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345
+dqadd71514 add 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345
+dqadd71515 add 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345
+dqadd71516 add 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345
+dqadd71517 add 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345
+dqadd71518 add 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345
+dqadd71519 add 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345
+dqadd71520 add 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345
+dqadd71521 add 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345
+dqadd71522 add 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345
+dqadd71523 add 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345
+dqadd71524 add 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345
+dqadd71525 add 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345
+dqadd71526 add 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345
+dqadd71527 add 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345
+dqadd71528 add 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345
+dqadd71529 add 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345
+dqadd71530 add 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345
+dqadd71531 add 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345
+dqadd71532 add 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345
+dqadd71533 add 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345
+-- next four flag Rounded because the 0 extends the result
+dqadd71534 add 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded
+dqadd71535 add 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded
+dqadd71536 add 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded
+dqadd71537 add 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+dqadd71600 add 0 0E-19 -> 0E-19
+dqadd71601 add -0 0E-19 -> 0E-19
+dqadd71602 add 0 -0E-19 -> 0E-19
+dqadd71603 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71611 add -11 11 -> 0
+dqadd71612 add 11 -11 -> 0
+
+rounding: half_down
+-- exact zeros from zeros
+dqadd71620 add 0 0E-19 -> 0E-19
+dqadd71621 add -0 0E-19 -> 0E-19
+dqadd71622 add 0 -0E-19 -> 0E-19
+dqadd71623 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71631 add -11 11 -> 0
+dqadd71632 add 11 -11 -> 0
+
+rounding: half_even
+-- exact zeros from zeros
+dqadd71640 add 0 0E-19 -> 0E-19
+dqadd71641 add -0 0E-19 -> 0E-19
+dqadd71642 add 0 -0E-19 -> 0E-19
+dqadd71643 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71651 add -11 11 -> 0
+dqadd71652 add 11 -11 -> 0
+
+rounding: up
+-- exact zeros from zeros
+dqadd71660 add 0 0E-19 -> 0E-19
+dqadd71661 add -0 0E-19 -> 0E-19
+dqadd71662 add 0 -0E-19 -> 0E-19
+dqadd71663 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71671 add -11 11 -> 0
+dqadd71672 add 11 -11 -> 0
+
+rounding: down
+-- exact zeros from zeros
+dqadd71680 add 0 0E-19 -> 0E-19
+dqadd71681 add -0 0E-19 -> 0E-19
+dqadd71682 add 0 -0E-19 -> 0E-19
+dqadd71683 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71691 add -11 11 -> 0
+dqadd71692 add 11 -11 -> 0
+
+rounding: ceiling
+-- exact zeros from zeros
+dqadd71700 add 0 0E-19 -> 0E-19
+dqadd71701 add -0 0E-19 -> 0E-19
+dqadd71702 add 0 -0E-19 -> 0E-19
+dqadd71703 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71711 add -11 11 -> 0
+dqadd71712 add 11 -11 -> 0
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+dqadd71720 add 0 0E-19 -> 0E-19
+dqadd71721 add -0 0E-19 -> -0E-19 -- *
+dqadd71722 add 0 -0E-19 -> -0E-19 -- *
+dqadd71723 add -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd71731 add -11 11 -> -0 -- *
+dqadd71732 add 11 -11 -> -0 -- *
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dqadd71741 add 130E-2 120E-2 -> 2.50
+dqadd71742 add 130E-2 12E-1 -> 2.50
+dqadd71743 add 130E-2 1E0 -> 2.30
+dqadd71744 add 1E2 1E4 -> 1.01E+4
+dqadd71745 add 130E-2 -120E-2 -> 0.10
+dqadd71746 add 130E-2 -12E-1 -> 0.10
+dqadd71747 add 130E-2 -1E0 -> 0.30
+dqadd71748 add 1E2 -1E4 -> -9.9E+3
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+dqadd75001 add 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457
+dqadd75002 add 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded
+dqadd75003 add 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75004 add 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75005 add 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75006 add 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75007 add 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75008 add 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75009 add 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75010 add 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75011 add 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75012 add 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75013 add 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75014 add 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75015 add 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75016 add 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75017 add 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75018 add 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75019 add 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75020 add 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd75021 add 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded
+
+-- widening second argument at gap
+dqadd75030 add 12398765432112345678945678 1 -> 12398765432112345678945679
+dqadd75031 add 12398765432112345678945678 0.1 -> 12398765432112345678945678.1
+dqadd75032 add 12398765432112345678945678 0.12 -> 12398765432112345678945678.12
+dqadd75033 add 12398765432112345678945678 0.123 -> 12398765432112345678945678.123
+dqadd75034 add 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234
+dqadd75035 add 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345
+dqadd75036 add 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456
+dqadd75037 add 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567
+dqadd75038 add 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678
+dqadd75039 add 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75040 add 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded
+dqadd75041 add 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded
+dqadd75042 add 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75043 add 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75044 add 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75045 add 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75046 add 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75047 add 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75048 add 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd75049 add 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+dqadd75050 add 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded
+dqadd75051 add 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded
+dqadd75052 add 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded
+dqadd75053 add 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded
+dqadd75054 add 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded
+dqadd75055 add 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded
+dqadd75056 add 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded
+dqadd75057 add 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded
+dqadd75060 add 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded
+dqadd75061 add 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded
+dqadd75062 add 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded
+dqadd75063 add 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded
+dqadd75064 add 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded
+dqadd75065 add 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded
+dqadd75066 add 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded
+dqadd75067 add 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+dqadd75070 add 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001
+dqadd75071 add 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75072 add 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75073 add 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75074 add 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75075 add 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75076 add 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75077 add 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75078 add 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75079 add 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75080 add 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75081 add 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75082 add 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75083 add 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75084 add 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75085 add 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75086 add 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75087 add 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75088 add 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd75089 add 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded
+
+-- Null tests
+dqadd9990 add 10 # -> NaN Invalid_operation
+dqadd9991 add # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqAnd.decTest b/Lib/test/decimaltestdata/dqAnd.decTest
index 57c416b48c..d609bc1c3b 100644
--- a/Lib/test/decimaltestdata/dqAnd.decTest
+++ b/Lib/test/decimaltestdata/dqAnd.decTest
@@ -1,420 +1,420 @@
-------------------------------------------------------------------------
--- dqAnd.decTest -- digitwise logical AND for decQuads --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check (truth table)
-dqand001 and 0 0 -> 0
-dqand002 and 0 1 -> 0
-dqand003 and 1 0 -> 0
-dqand004 and 1 1 -> 1
-dqand005 and 1100 1010 -> 1000
--- and at msd and msd-1
--- 1234567890123456789012345678901234
-dqand006 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqand007 and 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 0
-dqand008 and 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqand009 and 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqand010 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqand011 and 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 0
-dqand012 and 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqand013 and 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
-
--- Various lengths
--- 1234567890123456789012345678901234
-
-dqand601 and 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 111111111111111111111111111111111
-dqand602 and 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 1011111111111111111111111111111111
-dqand603 and 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 1101111111111111111111111111111111
-dqand604 and 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1110111111111111111111111111111111
-dqand605 and 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 1111011111111111111111111111111111
-dqand606 and 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 1111101111111111111111111111111111
-dqand607 and 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1111110111111111111111111111111111
-dqand608 and 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 1111111011111111111111111111111111
-dqand609 and 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 1111111101111111111111111111111111
-dqand610 and 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1111111110111111111111111111111111
-dqand611 and 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 1111111111011111111111111111111111
-dqand612 and 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 1111111111101111111111111111111111
-dqand613 and 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1111111111110111111111111111111111
-dqand614 and 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 1111111111111011111111111111111111
-dqand615 and 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 1111111111111101111111111111111111
-dqand616 and 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1111111111111110111111111111111111
-dqand617 and 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 1111111111111111011111111111111111
-dqand618 and 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 1111111111111111101111111111111111
-dqand619 and 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1111111111111111110111111111111111
-dqand620 and 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 1111111111111111111011111111111111
-dqand621 and 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 1111111111111111111101111111111111
-dqand622 and 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1111111111111111111110111111111111
-dqand623 and 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 1111111111111111111111011111111111
-dqand624 and 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 1111111111111111111111101111111111
-dqand625 and 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1111111111111111111111110111111111
-dqand626 and 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 1111111111111111111111111011111111
-dqand627 and 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 1111111111111111111111111101111111
-dqand628 and 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1111111111111111111111111110111111
-dqand629 and 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 1111111111111111111111111111011111
-dqand630 and 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 1111111111111111111111111111101111
-dqand631 and 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1111111111111111111111111111110111
-dqand632 and 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 1111111111111111111111111111111011
-dqand633 and 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 1111111111111111111111111111111101
-dqand634 and 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1111111111111111111111111111111110
-
-dqand641 and 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 111111111111111111111111111111111
-dqand642 and 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 1011111111111111111111111111111111
-dqand643 and 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 1101111111111111111111111111111111
-dqand644 and 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1110111111111111111111111111111111
-dqand645 and 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 1111011111111111111111111111111111
-dqand646 and 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 1111101111111111111111111111111111
-dqand647 and 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1111110111111111111111111111111111
-dqand648 and 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 1111111011111111111111111111111111
-dqand649 and 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 1111111101111111111111111111111111
-dqand650 and 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1111111110111111111111111111111111
-dqand651 and 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 1111111111011111111111111111111111
-dqand652 and 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 1111111111101111111111111111111111
-dqand653 and 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1111111111110111111111111111111111
-dqand654 and 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 1111111111111011111111111111111111
-dqand655 and 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 1111111111111101111111111111111111
-dqand656 and 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1111111111111110111111111111111111
-dqand657 and 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 1111111111111111011111111111111111
-dqand658 and 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 1111111111111111101111111111111111
-dqand659 and 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1111111111111111110111111111111111
-dqand660 and 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111011111111111111
-dqand661 and 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111101111111111111
-dqand662 and 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111110111111111111
-dqand663 and 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111011111111111
-dqand664 and 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111101111111111
-dqand665 and 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111110111111111
-dqand666 and 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111011111111
-dqand667 and 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111101111111
-dqand668 and 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111110111111
-dqand669 and 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111011111
-dqand670 and 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111101111
-dqand671 and 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111110111
-dqand672 and 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111011
-dqand673 and 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111101
-dqand674 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
-dqand675 and 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 111111111111111111111111111111110
-dqand676 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
-
-dqand021 and 1111111111111111 1111111111111111 -> 1111111111111111
-dqand024 and 1111111111111111 111111111111111 -> 111111111111111
-dqand025 and 1111111111111111 11111111111111 -> 11111111111111
-dqand026 and 1111111111111111 1111111111111 -> 1111111111111
-dqand027 and 1111111111111111 111111111111 -> 111111111111
-dqand028 and 1111111111111111 11111111111 -> 11111111111
-dqand029 and 1111111111111111 1111111111 -> 1111111111
-dqand030 and 1111111111111111 111111111 -> 111111111
-dqand031 and 1111111111111111 11111111 -> 11111111
-dqand032 and 1111111111111111 1111111 -> 1111111
-dqand033 and 1111111111111111 111111 -> 111111
-dqand034 and 1111111111111111 11111 -> 11111
-dqand035 and 1111111111111111 1111 -> 1111
-dqand036 and 1111111111111111 111 -> 111
-dqand037 and 1111111111111111 11 -> 11
-dqand038 and 1111111111111111 1 -> 1
-dqand039 and 1111111111111111 0 -> 0
-
-dqand040 and 1111111111111111 1111111111111111 -> 1111111111111111
-dqand041 and 111111111111111 1111111111111111 -> 111111111111111
-dqand042 and 111111111111111 1111111111111111 -> 111111111111111
-dqand043 and 11111111111111 1111111111111111 -> 11111111111111
-dqand044 and 1111111111111 1111111111111111 -> 1111111111111
-dqand045 and 111111111111 1111111111111111 -> 111111111111
-dqand046 and 11111111111 1111111111111111 -> 11111111111
-dqand047 and 1111111111 1111111111111111 -> 1111111111
-dqand048 and 111111111 1111111111111111 -> 111111111
-dqand049 and 11111111 1111111111111111 -> 11111111
-dqand050 and 1111111 1111111111111111 -> 1111111
-dqand051 and 111111 1111111111111111 -> 111111
-dqand052 and 11111 1111111111111111 -> 11111
-dqand053 and 1111 1111111111111111 -> 1111
-dqand054 and 111 1111111111111111 -> 111
-dqand055 and 11 1111111111111111 -> 11
-dqand056 and 1 1111111111111111 -> 1
-dqand057 and 0 1111111111111111 -> 0
-
-dqand150 and 1111111111 1 -> 1
-dqand151 and 111111111 1 -> 1
-dqand152 and 11111111 1 -> 1
-dqand153 and 1111111 1 -> 1
-dqand154 and 111111 1 -> 1
-dqand155 and 11111 1 -> 1
-dqand156 and 1111 1 -> 1
-dqand157 and 111 1 -> 1
-dqand158 and 11 1 -> 1
-dqand159 and 1 1 -> 1
-
-dqand160 and 1111111111 0 -> 0
-dqand161 and 111111111 0 -> 0
-dqand162 and 11111111 0 -> 0
-dqand163 and 1111111 0 -> 0
-dqand164 and 111111 0 -> 0
-dqand165 and 11111 0 -> 0
-dqand166 and 1111 0 -> 0
-dqand167 and 111 0 -> 0
-dqand168 and 11 0 -> 0
-dqand169 and 1 0 -> 0
-
-dqand170 and 1 1111111111 -> 1
-dqand171 and 1 111111111 -> 1
-dqand172 and 1 11111111 -> 1
-dqand173 and 1 1111111 -> 1
-dqand174 and 1 111111 -> 1
-dqand175 and 1 11111 -> 1
-dqand176 and 1 1111 -> 1
-dqand177 and 1 111 -> 1
-dqand178 and 1 11 -> 1
-dqand179 and 1 1 -> 1
-
-dqand180 and 0 1111111111 -> 0
-dqand181 and 0 111111111 -> 0
-dqand182 and 0 11111111 -> 0
-dqand183 and 0 1111111 -> 0
-dqand184 and 0 111111 -> 0
-dqand185 and 0 11111 -> 0
-dqand186 and 0 1111 -> 0
-dqand187 and 0 111 -> 0
-dqand188 and 0 11 -> 0
-dqand189 and 0 1 -> 0
-
-dqand090 and 011111111 111111111 -> 11111111
-dqand091 and 101111111 111111111 -> 101111111
-dqand092 and 110111111 111111111 -> 110111111
-dqand093 and 111011111 111111111 -> 111011111
-dqand094 and 111101111 111111111 -> 111101111
-dqand095 and 111110111 111111111 -> 111110111
-dqand096 and 111111011 111111111 -> 111111011
-dqand097 and 111111101 111111111 -> 111111101
-dqand098 and 111111110 111111111 -> 111111110
-
-dqand100 and 111111111 011111111 -> 11111111
-dqand101 and 111111111 101111111 -> 101111111
-dqand102 and 111111111 110111111 -> 110111111
-dqand103 and 111111111 111011111 -> 111011111
-dqand104 and 111111111 111101111 -> 111101111
-dqand105 and 111111111 111110111 -> 111110111
-dqand106 and 111111111 111111011 -> 111111011
-dqand107 and 111111111 111111101 -> 111111101
-dqand108 and 111111111 111111110 -> 111111110
-
--- non-0/1 should not be accepted, nor should signs
-dqand220 and 111111112 111111111 -> NaN Invalid_operation
-dqand221 and 333333333 333333333 -> NaN Invalid_operation
-dqand222 and 555555555 555555555 -> NaN Invalid_operation
-dqand223 and 777777777 777777777 -> NaN Invalid_operation
-dqand224 and 999999999 999999999 -> NaN Invalid_operation
-dqand225 and 222222222 999999999 -> NaN Invalid_operation
-dqand226 and 444444444 999999999 -> NaN Invalid_operation
-dqand227 and 666666666 999999999 -> NaN Invalid_operation
-dqand228 and 888888888 999999999 -> NaN Invalid_operation
-dqand229 and 999999999 222222222 -> NaN Invalid_operation
-dqand230 and 999999999 444444444 -> NaN Invalid_operation
-dqand231 and 999999999 666666666 -> NaN Invalid_operation
-dqand232 and 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-dqand240 and 567468689 -934981942 -> NaN Invalid_operation
-dqand241 and 567367689 934981942 -> NaN Invalid_operation
-dqand242 and -631917772 -706014634 -> NaN Invalid_operation
-dqand243 and -756253257 138579234 -> NaN Invalid_operation
-dqand244 and 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-dqand250 and 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqand251 and 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqand252 and 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqand253 and 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqand254 and 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqand255 and 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqand256 and 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqand257 and 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqand258 and 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqand259 and 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqand260 and 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqand261 and 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
-dqand262 and 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqand263 and 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqand264 and 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqand265 and 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
--- test MSD-1
-dqand270 and 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
-dqand271 and 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
-dqand272 and 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
-dqand273 and 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
-dqand274 and 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
-dqand275 and 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
-dqand276 and 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
-dqand277 and 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
--- test LSD
-dqand280 and 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
-dqand281 and 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
-dqand282 and 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
-dqand283 and 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
-dqand284 and 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
-dqand285 and 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
-dqand286 and 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
-dqand287 and 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
--- test Middie
-dqand288 and 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
-dqand289 and 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
-dqand290 and 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
-dqand291 and 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
-dqand292 and 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
-dqand293 and 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
-dqand294 and 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
-dqand295 and 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
--- signs
-dqand296 and -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
-dqand297 and -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
-dqand298 and 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
-dqand299 and 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 110000110000110000001000000
-
--- Nmax, Nmin, Ntiny-like
-dqand331 and 2 9.99999999E+999 -> NaN Invalid_operation
-dqand332 and 3 1E-999 -> NaN Invalid_operation
-dqand333 and 4 1.00000000E-999 -> NaN Invalid_operation
-dqand334 and 5 1E-900 -> NaN Invalid_operation
-dqand335 and 6 -1E-900 -> NaN Invalid_operation
-dqand336 and 7 -1.00000000E-999 -> NaN Invalid_operation
-dqand337 and 8 -1E-999 -> NaN Invalid_operation
-dqand338 and 9 -9.99999999E+999 -> NaN Invalid_operation
-dqand341 and 9.99999999E+999 -18 -> NaN Invalid_operation
-dqand342 and 1E-999 01 -> NaN Invalid_operation
-dqand343 and 1.00000000E-999 -18 -> NaN Invalid_operation
-dqand344 and 1E-900 18 -> NaN Invalid_operation
-dqand345 and -1E-900 -10 -> NaN Invalid_operation
-dqand346 and -1.00000000E-999 18 -> NaN Invalid_operation
-dqand347 and -1E-999 10 -> NaN Invalid_operation
-dqand348 and -9.99999999E+999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-dqand361 and 1.0 1 -> NaN Invalid_operation
-dqand362 and 1E+1 1 -> NaN Invalid_operation
-dqand363 and 0.0 1 -> NaN Invalid_operation
-dqand364 and 0E+1 1 -> NaN Invalid_operation
-dqand365 and 9.9 1 -> NaN Invalid_operation
-dqand366 and 9E+1 1 -> NaN Invalid_operation
-dqand371 and 0 1.0 -> NaN Invalid_operation
-dqand372 and 0 1E+1 -> NaN Invalid_operation
-dqand373 and 0 0.0 -> NaN Invalid_operation
-dqand374 and 0 0E+1 -> NaN Invalid_operation
-dqand375 and 0 9.9 -> NaN Invalid_operation
-dqand376 and 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-dqand780 and -Inf -Inf -> NaN Invalid_operation
-dqand781 and -Inf -1000 -> NaN Invalid_operation
-dqand782 and -Inf -1 -> NaN Invalid_operation
-dqand783 and -Inf -0 -> NaN Invalid_operation
-dqand784 and -Inf 0 -> NaN Invalid_operation
-dqand785 and -Inf 1 -> NaN Invalid_operation
-dqand786 and -Inf 1000 -> NaN Invalid_operation
-dqand787 and -1000 -Inf -> NaN Invalid_operation
-dqand788 and -Inf -Inf -> NaN Invalid_operation
-dqand789 and -1 -Inf -> NaN Invalid_operation
-dqand790 and -0 -Inf -> NaN Invalid_operation
-dqand791 and 0 -Inf -> NaN Invalid_operation
-dqand792 and 1 -Inf -> NaN Invalid_operation
-dqand793 and 1000 -Inf -> NaN Invalid_operation
-dqand794 and Inf -Inf -> NaN Invalid_operation
-
-dqand800 and Inf -Inf -> NaN Invalid_operation
-dqand801 and Inf -1000 -> NaN Invalid_operation
-dqand802 and Inf -1 -> NaN Invalid_operation
-dqand803 and Inf -0 -> NaN Invalid_operation
-dqand804 and Inf 0 -> NaN Invalid_operation
-dqand805 and Inf 1 -> NaN Invalid_operation
-dqand806 and Inf 1000 -> NaN Invalid_operation
-dqand807 and Inf Inf -> NaN Invalid_operation
-dqand808 and -1000 Inf -> NaN Invalid_operation
-dqand809 and -Inf Inf -> NaN Invalid_operation
-dqand810 and -1 Inf -> NaN Invalid_operation
-dqand811 and -0 Inf -> NaN Invalid_operation
-dqand812 and 0 Inf -> NaN Invalid_operation
-dqand813 and 1 Inf -> NaN Invalid_operation
-dqand814 and 1000 Inf -> NaN Invalid_operation
-dqand815 and Inf Inf -> NaN Invalid_operation
-
-dqand821 and NaN -Inf -> NaN Invalid_operation
-dqand822 and NaN -1000 -> NaN Invalid_operation
-dqand823 and NaN -1 -> NaN Invalid_operation
-dqand824 and NaN -0 -> NaN Invalid_operation
-dqand825 and NaN 0 -> NaN Invalid_operation
-dqand826 and NaN 1 -> NaN Invalid_operation
-dqand827 and NaN 1000 -> NaN Invalid_operation
-dqand828 and NaN Inf -> NaN Invalid_operation
-dqand829 and NaN NaN -> NaN Invalid_operation
-dqand830 and -Inf NaN -> NaN Invalid_operation
-dqand831 and -1000 NaN -> NaN Invalid_operation
-dqand832 and -1 NaN -> NaN Invalid_operation
-dqand833 and -0 NaN -> NaN Invalid_operation
-dqand834 and 0 NaN -> NaN Invalid_operation
-dqand835 and 1 NaN -> NaN Invalid_operation
-dqand836 and 1000 NaN -> NaN Invalid_operation
-dqand837 and Inf NaN -> NaN Invalid_operation
-
-dqand841 and sNaN -Inf -> NaN Invalid_operation
-dqand842 and sNaN -1000 -> NaN Invalid_operation
-dqand843 and sNaN -1 -> NaN Invalid_operation
-dqand844 and sNaN -0 -> NaN Invalid_operation
-dqand845 and sNaN 0 -> NaN Invalid_operation
-dqand846 and sNaN 1 -> NaN Invalid_operation
-dqand847 and sNaN 1000 -> NaN Invalid_operation
-dqand848 and sNaN NaN -> NaN Invalid_operation
-dqand849 and sNaN sNaN -> NaN Invalid_operation
-dqand850 and NaN sNaN -> NaN Invalid_operation
-dqand851 and -Inf sNaN -> NaN Invalid_operation
-dqand852 and -1000 sNaN -> NaN Invalid_operation
-dqand853 and -1 sNaN -> NaN Invalid_operation
-dqand854 and -0 sNaN -> NaN Invalid_operation
-dqand855 and 0 sNaN -> NaN Invalid_operation
-dqand856 and 1 sNaN -> NaN Invalid_operation
-dqand857 and 1000 sNaN -> NaN Invalid_operation
-dqand858 and Inf sNaN -> NaN Invalid_operation
-dqand859 and NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqand861 and NaN1 -Inf -> NaN Invalid_operation
-dqand862 and +NaN2 -1000 -> NaN Invalid_operation
-dqand863 and NaN3 1000 -> NaN Invalid_operation
-dqand864 and NaN4 Inf -> NaN Invalid_operation
-dqand865 and NaN5 +NaN6 -> NaN Invalid_operation
-dqand866 and -Inf NaN7 -> NaN Invalid_operation
-dqand867 and -1000 NaN8 -> NaN Invalid_operation
-dqand868 and 1000 NaN9 -> NaN Invalid_operation
-dqand869 and Inf +NaN10 -> NaN Invalid_operation
-dqand871 and sNaN11 -Inf -> NaN Invalid_operation
-dqand872 and sNaN12 -1000 -> NaN Invalid_operation
-dqand873 and sNaN13 1000 -> NaN Invalid_operation
-dqand874 and sNaN14 NaN17 -> NaN Invalid_operation
-dqand875 and sNaN15 sNaN18 -> NaN Invalid_operation
-dqand876 and NaN16 sNaN19 -> NaN Invalid_operation
-dqand877 and -Inf +sNaN20 -> NaN Invalid_operation
-dqand878 and -1000 sNaN21 -> NaN Invalid_operation
-dqand879 and 1000 sNaN22 -> NaN Invalid_operation
-dqand880 and Inf sNaN23 -> NaN Invalid_operation
-dqand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
-dqand882 and -NaN26 NaN28 -> NaN Invalid_operation
-dqand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
-dqand884 and 1000 -NaN30 -> NaN Invalid_operation
-dqand885 and 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqAnd.decTest -- digitwise logical AND for decQuads --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check (truth table)
+dqand001 and 0 0 -> 0
+dqand002 and 0 1 -> 0
+dqand003 and 1 0 -> 0
+dqand004 and 1 1 -> 1
+dqand005 and 1100 1010 -> 1000
+-- and at msd and msd-1
+-- 1234567890123456789012345678901234
+dqand006 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqand007 and 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 0
+dqand008 and 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqand009 and 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqand010 and 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqand011 and 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 0
+dqand012 and 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqand013 and 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
+
+-- Various lengths
+-- 1234567890123456789012345678901234
+
+dqand601 and 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 111111111111111111111111111111111
+dqand602 and 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 1011111111111111111111111111111111
+dqand603 and 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 1101111111111111111111111111111111
+dqand604 and 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1110111111111111111111111111111111
+dqand605 and 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 1111011111111111111111111111111111
+dqand606 and 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 1111101111111111111111111111111111
+dqand607 and 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1111110111111111111111111111111111
+dqand608 and 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 1111111011111111111111111111111111
+dqand609 and 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 1111111101111111111111111111111111
+dqand610 and 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1111111110111111111111111111111111
+dqand611 and 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 1111111111011111111111111111111111
+dqand612 and 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 1111111111101111111111111111111111
+dqand613 and 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1111111111110111111111111111111111
+dqand614 and 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 1111111111111011111111111111111111
+dqand615 and 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 1111111111111101111111111111111111
+dqand616 and 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1111111111111110111111111111111111
+dqand617 and 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 1111111111111111011111111111111111
+dqand618 and 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 1111111111111111101111111111111111
+dqand619 and 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1111111111111111110111111111111111
+dqand620 and 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 1111111111111111111011111111111111
+dqand621 and 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 1111111111111111111101111111111111
+dqand622 and 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1111111111111111111110111111111111
+dqand623 and 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 1111111111111111111111011111111111
+dqand624 and 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 1111111111111111111111101111111111
+dqand625 and 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1111111111111111111111110111111111
+dqand626 and 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 1111111111111111111111111011111111
+dqand627 and 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 1111111111111111111111111101111111
+dqand628 and 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1111111111111111111111111110111111
+dqand629 and 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 1111111111111111111111111111011111
+dqand630 and 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 1111111111111111111111111111101111
+dqand631 and 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1111111111111111111111111111110111
+dqand632 and 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 1111111111111111111111111111111011
+dqand633 and 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 1111111111111111111111111111111101
+dqand634 and 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1111111111111111111111111111111110
+
+dqand641 and 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 111111111111111111111111111111111
+dqand642 and 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 1011111111111111111111111111111111
+dqand643 and 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 1101111111111111111111111111111111
+dqand644 and 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1110111111111111111111111111111111
+dqand645 and 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 1111011111111111111111111111111111
+dqand646 and 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 1111101111111111111111111111111111
+dqand647 and 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1111110111111111111111111111111111
+dqand648 and 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 1111111011111111111111111111111111
+dqand649 and 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 1111111101111111111111111111111111
+dqand650 and 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1111111110111111111111111111111111
+dqand651 and 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 1111111111011111111111111111111111
+dqand652 and 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 1111111111101111111111111111111111
+dqand653 and 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1111111111110111111111111111111111
+dqand654 and 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 1111111111111011111111111111111111
+dqand655 and 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 1111111111111101111111111111111111
+dqand656 and 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1111111111111110111111111111111111
+dqand657 and 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 1111111111111111011111111111111111
+dqand658 and 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 1111111111111111101111111111111111
+dqand659 and 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1111111111111111110111111111111111
+dqand660 and 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111011111111111111
+dqand661 and 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111101111111111111
+dqand662 and 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111110111111111111
+dqand663 and 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111011111111111
+dqand664 and 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111101111111111
+dqand665 and 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111110111111111
+dqand666 and 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111011111111
+dqand667 and 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111101111111
+dqand668 and 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111110111111
+dqand669 and 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111011111
+dqand670 and 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111101111
+dqand671 and 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111110111
+dqand672 and 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111011
+dqand673 and 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111101
+dqand674 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
+dqand675 and 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 111111111111111111111111111111110
+dqand676 and 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
+
+dqand021 and 1111111111111111 1111111111111111 -> 1111111111111111
+dqand024 and 1111111111111111 111111111111111 -> 111111111111111
+dqand025 and 1111111111111111 11111111111111 -> 11111111111111
+dqand026 and 1111111111111111 1111111111111 -> 1111111111111
+dqand027 and 1111111111111111 111111111111 -> 111111111111
+dqand028 and 1111111111111111 11111111111 -> 11111111111
+dqand029 and 1111111111111111 1111111111 -> 1111111111
+dqand030 and 1111111111111111 111111111 -> 111111111
+dqand031 and 1111111111111111 11111111 -> 11111111
+dqand032 and 1111111111111111 1111111 -> 1111111
+dqand033 and 1111111111111111 111111 -> 111111
+dqand034 and 1111111111111111 11111 -> 11111
+dqand035 and 1111111111111111 1111 -> 1111
+dqand036 and 1111111111111111 111 -> 111
+dqand037 and 1111111111111111 11 -> 11
+dqand038 and 1111111111111111 1 -> 1
+dqand039 and 1111111111111111 0 -> 0
+
+dqand040 and 1111111111111111 1111111111111111 -> 1111111111111111
+dqand041 and 111111111111111 1111111111111111 -> 111111111111111
+dqand042 and 111111111111111 1111111111111111 -> 111111111111111
+dqand043 and 11111111111111 1111111111111111 -> 11111111111111
+dqand044 and 1111111111111 1111111111111111 -> 1111111111111
+dqand045 and 111111111111 1111111111111111 -> 111111111111
+dqand046 and 11111111111 1111111111111111 -> 11111111111
+dqand047 and 1111111111 1111111111111111 -> 1111111111
+dqand048 and 111111111 1111111111111111 -> 111111111
+dqand049 and 11111111 1111111111111111 -> 11111111
+dqand050 and 1111111 1111111111111111 -> 1111111
+dqand051 and 111111 1111111111111111 -> 111111
+dqand052 and 11111 1111111111111111 -> 11111
+dqand053 and 1111 1111111111111111 -> 1111
+dqand054 and 111 1111111111111111 -> 111
+dqand055 and 11 1111111111111111 -> 11
+dqand056 and 1 1111111111111111 -> 1
+dqand057 and 0 1111111111111111 -> 0
+
+dqand150 and 1111111111 1 -> 1
+dqand151 and 111111111 1 -> 1
+dqand152 and 11111111 1 -> 1
+dqand153 and 1111111 1 -> 1
+dqand154 and 111111 1 -> 1
+dqand155 and 11111 1 -> 1
+dqand156 and 1111 1 -> 1
+dqand157 and 111 1 -> 1
+dqand158 and 11 1 -> 1
+dqand159 and 1 1 -> 1
+
+dqand160 and 1111111111 0 -> 0
+dqand161 and 111111111 0 -> 0
+dqand162 and 11111111 0 -> 0
+dqand163 and 1111111 0 -> 0
+dqand164 and 111111 0 -> 0
+dqand165 and 11111 0 -> 0
+dqand166 and 1111 0 -> 0
+dqand167 and 111 0 -> 0
+dqand168 and 11 0 -> 0
+dqand169 and 1 0 -> 0
+
+dqand170 and 1 1111111111 -> 1
+dqand171 and 1 111111111 -> 1
+dqand172 and 1 11111111 -> 1
+dqand173 and 1 1111111 -> 1
+dqand174 and 1 111111 -> 1
+dqand175 and 1 11111 -> 1
+dqand176 and 1 1111 -> 1
+dqand177 and 1 111 -> 1
+dqand178 and 1 11 -> 1
+dqand179 and 1 1 -> 1
+
+dqand180 and 0 1111111111 -> 0
+dqand181 and 0 111111111 -> 0
+dqand182 and 0 11111111 -> 0
+dqand183 and 0 1111111 -> 0
+dqand184 and 0 111111 -> 0
+dqand185 and 0 11111 -> 0
+dqand186 and 0 1111 -> 0
+dqand187 and 0 111 -> 0
+dqand188 and 0 11 -> 0
+dqand189 and 0 1 -> 0
+
+dqand090 and 011111111 111111111 -> 11111111
+dqand091 and 101111111 111111111 -> 101111111
+dqand092 and 110111111 111111111 -> 110111111
+dqand093 and 111011111 111111111 -> 111011111
+dqand094 and 111101111 111111111 -> 111101111
+dqand095 and 111110111 111111111 -> 111110111
+dqand096 and 111111011 111111111 -> 111111011
+dqand097 and 111111101 111111111 -> 111111101
+dqand098 and 111111110 111111111 -> 111111110
+
+dqand100 and 111111111 011111111 -> 11111111
+dqand101 and 111111111 101111111 -> 101111111
+dqand102 and 111111111 110111111 -> 110111111
+dqand103 and 111111111 111011111 -> 111011111
+dqand104 and 111111111 111101111 -> 111101111
+dqand105 and 111111111 111110111 -> 111110111
+dqand106 and 111111111 111111011 -> 111111011
+dqand107 and 111111111 111111101 -> 111111101
+dqand108 and 111111111 111111110 -> 111111110
+
+-- non-0/1 should not be accepted, nor should signs
+dqand220 and 111111112 111111111 -> NaN Invalid_operation
+dqand221 and 333333333 333333333 -> NaN Invalid_operation
+dqand222 and 555555555 555555555 -> NaN Invalid_operation
+dqand223 and 777777777 777777777 -> NaN Invalid_operation
+dqand224 and 999999999 999999999 -> NaN Invalid_operation
+dqand225 and 222222222 999999999 -> NaN Invalid_operation
+dqand226 and 444444444 999999999 -> NaN Invalid_operation
+dqand227 and 666666666 999999999 -> NaN Invalid_operation
+dqand228 and 888888888 999999999 -> NaN Invalid_operation
+dqand229 and 999999999 222222222 -> NaN Invalid_operation
+dqand230 and 999999999 444444444 -> NaN Invalid_operation
+dqand231 and 999999999 666666666 -> NaN Invalid_operation
+dqand232 and 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+dqand240 and 567468689 -934981942 -> NaN Invalid_operation
+dqand241 and 567367689 934981942 -> NaN Invalid_operation
+dqand242 and -631917772 -706014634 -> NaN Invalid_operation
+dqand243 and -756253257 138579234 -> NaN Invalid_operation
+dqand244 and 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+dqand250 and 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqand251 and 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqand252 and 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqand253 and 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqand254 and 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqand255 and 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqand256 and 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqand257 and 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqand258 and 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqand259 and 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqand260 and 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqand261 and 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+dqand262 and 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqand263 and 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqand264 and 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqand265 and 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+-- test MSD-1
+dqand270 and 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
+dqand271 and 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
+dqand272 and 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
+dqand273 and 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
+dqand274 and 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
+dqand275 and 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
+dqand276 and 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
+dqand277 and 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
+-- test LSD
+dqand280 and 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
+dqand281 and 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
+dqand282 and 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
+dqand283 and 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
+dqand284 and 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
+dqand285 and 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
+dqand286 and 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
+dqand287 and 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
+-- test Middie
+dqand288 and 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
+dqand289 and 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
+dqand290 and 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
+dqand291 and 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
+dqand292 and 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
+dqand293 and 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
+dqand294 and 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
+dqand295 and 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
+-- signs
+dqand296 and -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
+dqand297 and -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
+dqand298 and 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
+dqand299 and 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 110000110000110000001000000
+
+-- Nmax, Nmin, Ntiny-like
+dqand331 and 2 9.99999999E+999 -> NaN Invalid_operation
+dqand332 and 3 1E-999 -> NaN Invalid_operation
+dqand333 and 4 1.00000000E-999 -> NaN Invalid_operation
+dqand334 and 5 1E-900 -> NaN Invalid_operation
+dqand335 and 6 -1E-900 -> NaN Invalid_operation
+dqand336 and 7 -1.00000000E-999 -> NaN Invalid_operation
+dqand337 and 8 -1E-999 -> NaN Invalid_operation
+dqand338 and 9 -9.99999999E+999 -> NaN Invalid_operation
+dqand341 and 9.99999999E+999 -18 -> NaN Invalid_operation
+dqand342 and 1E-999 01 -> NaN Invalid_operation
+dqand343 and 1.00000000E-999 -18 -> NaN Invalid_operation
+dqand344 and 1E-900 18 -> NaN Invalid_operation
+dqand345 and -1E-900 -10 -> NaN Invalid_operation
+dqand346 and -1.00000000E-999 18 -> NaN Invalid_operation
+dqand347 and -1E-999 10 -> NaN Invalid_operation
+dqand348 and -9.99999999E+999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+dqand361 and 1.0 1 -> NaN Invalid_operation
+dqand362 and 1E+1 1 -> NaN Invalid_operation
+dqand363 and 0.0 1 -> NaN Invalid_operation
+dqand364 and 0E+1 1 -> NaN Invalid_operation
+dqand365 and 9.9 1 -> NaN Invalid_operation
+dqand366 and 9E+1 1 -> NaN Invalid_operation
+dqand371 and 0 1.0 -> NaN Invalid_operation
+dqand372 and 0 1E+1 -> NaN Invalid_operation
+dqand373 and 0 0.0 -> NaN Invalid_operation
+dqand374 and 0 0E+1 -> NaN Invalid_operation
+dqand375 and 0 9.9 -> NaN Invalid_operation
+dqand376 and 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+dqand780 and -Inf -Inf -> NaN Invalid_operation
+dqand781 and -Inf -1000 -> NaN Invalid_operation
+dqand782 and -Inf -1 -> NaN Invalid_operation
+dqand783 and -Inf -0 -> NaN Invalid_operation
+dqand784 and -Inf 0 -> NaN Invalid_operation
+dqand785 and -Inf 1 -> NaN Invalid_operation
+dqand786 and -Inf 1000 -> NaN Invalid_operation
+dqand787 and -1000 -Inf -> NaN Invalid_operation
+dqand788 and -Inf -Inf -> NaN Invalid_operation
+dqand789 and -1 -Inf -> NaN Invalid_operation
+dqand790 and -0 -Inf -> NaN Invalid_operation
+dqand791 and 0 -Inf -> NaN Invalid_operation
+dqand792 and 1 -Inf -> NaN Invalid_operation
+dqand793 and 1000 -Inf -> NaN Invalid_operation
+dqand794 and Inf -Inf -> NaN Invalid_operation
+
+dqand800 and Inf -Inf -> NaN Invalid_operation
+dqand801 and Inf -1000 -> NaN Invalid_operation
+dqand802 and Inf -1 -> NaN Invalid_operation
+dqand803 and Inf -0 -> NaN Invalid_operation
+dqand804 and Inf 0 -> NaN Invalid_operation
+dqand805 and Inf 1 -> NaN Invalid_operation
+dqand806 and Inf 1000 -> NaN Invalid_operation
+dqand807 and Inf Inf -> NaN Invalid_operation
+dqand808 and -1000 Inf -> NaN Invalid_operation
+dqand809 and -Inf Inf -> NaN Invalid_operation
+dqand810 and -1 Inf -> NaN Invalid_operation
+dqand811 and -0 Inf -> NaN Invalid_operation
+dqand812 and 0 Inf -> NaN Invalid_operation
+dqand813 and 1 Inf -> NaN Invalid_operation
+dqand814 and 1000 Inf -> NaN Invalid_operation
+dqand815 and Inf Inf -> NaN Invalid_operation
+
+dqand821 and NaN -Inf -> NaN Invalid_operation
+dqand822 and NaN -1000 -> NaN Invalid_operation
+dqand823 and NaN -1 -> NaN Invalid_operation
+dqand824 and NaN -0 -> NaN Invalid_operation
+dqand825 and NaN 0 -> NaN Invalid_operation
+dqand826 and NaN 1 -> NaN Invalid_operation
+dqand827 and NaN 1000 -> NaN Invalid_operation
+dqand828 and NaN Inf -> NaN Invalid_operation
+dqand829 and NaN NaN -> NaN Invalid_operation
+dqand830 and -Inf NaN -> NaN Invalid_operation
+dqand831 and -1000 NaN -> NaN Invalid_operation
+dqand832 and -1 NaN -> NaN Invalid_operation
+dqand833 and -0 NaN -> NaN Invalid_operation
+dqand834 and 0 NaN -> NaN Invalid_operation
+dqand835 and 1 NaN -> NaN Invalid_operation
+dqand836 and 1000 NaN -> NaN Invalid_operation
+dqand837 and Inf NaN -> NaN Invalid_operation
+
+dqand841 and sNaN -Inf -> NaN Invalid_operation
+dqand842 and sNaN -1000 -> NaN Invalid_operation
+dqand843 and sNaN -1 -> NaN Invalid_operation
+dqand844 and sNaN -0 -> NaN Invalid_operation
+dqand845 and sNaN 0 -> NaN Invalid_operation
+dqand846 and sNaN 1 -> NaN Invalid_operation
+dqand847 and sNaN 1000 -> NaN Invalid_operation
+dqand848 and sNaN NaN -> NaN Invalid_operation
+dqand849 and sNaN sNaN -> NaN Invalid_operation
+dqand850 and NaN sNaN -> NaN Invalid_operation
+dqand851 and -Inf sNaN -> NaN Invalid_operation
+dqand852 and -1000 sNaN -> NaN Invalid_operation
+dqand853 and -1 sNaN -> NaN Invalid_operation
+dqand854 and -0 sNaN -> NaN Invalid_operation
+dqand855 and 0 sNaN -> NaN Invalid_operation
+dqand856 and 1 sNaN -> NaN Invalid_operation
+dqand857 and 1000 sNaN -> NaN Invalid_operation
+dqand858 and Inf sNaN -> NaN Invalid_operation
+dqand859 and NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqand861 and NaN1 -Inf -> NaN Invalid_operation
+dqand862 and +NaN2 -1000 -> NaN Invalid_operation
+dqand863 and NaN3 1000 -> NaN Invalid_operation
+dqand864 and NaN4 Inf -> NaN Invalid_operation
+dqand865 and NaN5 +NaN6 -> NaN Invalid_operation
+dqand866 and -Inf NaN7 -> NaN Invalid_operation
+dqand867 and -1000 NaN8 -> NaN Invalid_operation
+dqand868 and 1000 NaN9 -> NaN Invalid_operation
+dqand869 and Inf +NaN10 -> NaN Invalid_operation
+dqand871 and sNaN11 -Inf -> NaN Invalid_operation
+dqand872 and sNaN12 -1000 -> NaN Invalid_operation
+dqand873 and sNaN13 1000 -> NaN Invalid_operation
+dqand874 and sNaN14 NaN17 -> NaN Invalid_operation
+dqand875 and sNaN15 sNaN18 -> NaN Invalid_operation
+dqand876 and NaN16 sNaN19 -> NaN Invalid_operation
+dqand877 and -Inf +sNaN20 -> NaN Invalid_operation
+dqand878 and -1000 sNaN21 -> NaN Invalid_operation
+dqand879 and 1000 sNaN22 -> NaN Invalid_operation
+dqand880 and Inf sNaN23 -> NaN Invalid_operation
+dqand881 and +NaN25 +sNaN24 -> NaN Invalid_operation
+dqand882 and -NaN26 NaN28 -> NaN Invalid_operation
+dqand883 and -sNaN27 sNaN29 -> NaN Invalid_operation
+dqand884 and 1000 -NaN30 -> NaN Invalid_operation
+dqand885 and 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqBase.decTest b/Lib/test/decimaltestdata/dqBase.decTest
index 6bb463388e..d09c6bf02c 100644
--- a/Lib/test/decimaltestdata/dqBase.decTest
+++ b/Lib/test/decimaltestdata/dqBase.decTest
@@ -1,1081 +1,1081 @@
-------------------------------------------------------------------------
--- dqBase.decTest -- base decQuad <--> string conversions --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests base conversions from string to a decimal number
--- and back to a string (in Scientific form)
-
--- Note that unlike other operations the operand is subject to rounding
--- to conform to emax and precision settings (that is, numbers will
--- conform to rules and exponent will be in permitted range). The
--- 'left hand side', therefore, may have numbers that cannot be
--- represented in a decQuad. Some testcases go to the limit of the
--- next-wider format, and hence these testcases may also be used to
--- test narrowing and widening operations.
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqbas001 toSci 0 -> 0
-dqbas002 toSci 1 -> 1
-dqbas003 toSci 1.0 -> 1.0
-dqbas004 toSci 1.00 -> 1.00
-dqbas005 toSci 10 -> 10
-dqbas006 toSci 1000 -> 1000
-dqbas007 toSci 10.0 -> 10.0
-dqbas008 toSci 10.1 -> 10.1
-dqbas009 toSci 10.4 -> 10.4
-dqbas010 toSci 10.5 -> 10.5
-dqbas011 toSci 10.6 -> 10.6
-dqbas012 toSci 10.9 -> 10.9
-dqbas013 toSci 11.0 -> 11.0
-dqbas014 toSci 1.234 -> 1.234
-dqbas015 toSci 0.123 -> 0.123
-dqbas016 toSci 0.012 -> 0.012
-dqbas017 toSci -0 -> -0
-dqbas018 toSci -0.0 -> -0.0
-dqbas019 toSci -00.00 -> -0.00
-
-dqbas021 toSci -1 -> -1
-dqbas022 toSci -1.0 -> -1.0
-dqbas023 toSci -0.1 -> -0.1
-dqbas024 toSci -9.1 -> -9.1
-dqbas025 toSci -9.11 -> -9.11
-dqbas026 toSci -9.119 -> -9.119
-dqbas027 toSci -9.999 -> -9.999
-
-dqbas030 toSci '123456789.123456' -> '123456789.123456'
-dqbas031 toSci '123456789.000000' -> '123456789.000000'
-dqbas032 toSci '123456789123456' -> '123456789123456'
-dqbas033 toSci '0.0000123456789' -> '0.0000123456789'
-dqbas034 toSci '0.00000123456789' -> '0.00000123456789'
-dqbas035 toSci '0.000000123456789' -> '1.23456789E-7'
-dqbas036 toSci '0.0000000123456789' -> '1.23456789E-8'
-
-dqbas037 toSci '0.123456789012344' -> '0.123456789012344'
-dqbas038 toSci '0.123456789012345' -> '0.123456789012345'
-
--- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
-dqbsn001 toSci -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqbsn002 toSci -1E-6143 -> -1E-6143
-dqbsn003 toSci -1E-6176 -> -1E-6176 Subnormal
-dqbsn004 toSci -0 -> -0
-dqbsn005 toSci +0 -> 0
-dqbsn006 toSci +1E-6176 -> 1E-6176 Subnormal
-dqbsn007 toSci +1E-6143 -> 1E-6143
-dqbsn008 toSci +9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-
--- String [many more examples are implicitly tested elsewhere]
--- strings without E cannot generate E in result
-dqbas040 toSci "12" -> '12'
-dqbas041 toSci "-76" -> '-76'
-dqbas042 toSci "12.76" -> '12.76'
-dqbas043 toSci "+12.76" -> '12.76'
-dqbas044 toSci "012.76" -> '12.76'
-dqbas045 toSci "+0.003" -> '0.003'
-dqbas046 toSci "17." -> '17'
-dqbas047 toSci ".5" -> '0.5'
-dqbas048 toSci "044" -> '44'
-dqbas049 toSci "0044" -> '44'
-dqbas050 toSci "0.0005" -> '0.0005'
-dqbas051 toSci "00.00005" -> '0.00005'
-dqbas052 toSci "0.000005" -> '0.000005'
-dqbas053 toSci "0.0000050" -> '0.0000050'
-dqbas054 toSci "0.0000005" -> '5E-7'
-dqbas055 toSci "0.00000005" -> '5E-8'
-dqbas056 toSci "12345678.543210" -> '12345678.543210'
-dqbas057 toSci "2345678.543210" -> '2345678.543210'
-dqbas058 toSci "345678.543210" -> '345678.543210'
-dqbas059 toSci "0345678.54321" -> '345678.54321'
-dqbas060 toSci "345678.5432" -> '345678.5432'
-dqbas061 toSci "+345678.5432" -> '345678.5432'
-dqbas062 toSci "+0345678.5432" -> '345678.5432'
-dqbas063 toSci "+00345678.5432" -> '345678.5432'
-dqbas064 toSci "-345678.5432" -> '-345678.5432'
-dqbas065 toSci "-0345678.5432" -> '-345678.5432'
-dqbas066 toSci "-00345678.5432" -> '-345678.5432'
--- examples
-dqbas067 toSci "5E-6" -> '0.000005'
-dqbas068 toSci "50E-7" -> '0.0000050'
-dqbas069 toSci "5E-7" -> '5E-7'
-
--- [No exotics as no Unicode]
-
--- rounded with dots in all (including edge) places
-dqbas071 toSci .1234567891234567890123456780123456123 -> 0.1234567891234567890123456780123456 Inexact Rounded
-dqbas072 toSci 1.234567891234567890123456780123456123 -> 1.234567891234567890123456780123456 Inexact Rounded
-dqbas073 toSci 12.34567891234567890123456780123456123 -> 12.34567891234567890123456780123456 Inexact Rounded
-dqbas074 toSci 123.4567891234567890123456780123456123 -> 123.4567891234567890123456780123456 Inexact Rounded
-dqbas075 toSci 1234.567891234567890123456780123456123 -> 1234.567891234567890123456780123456 Inexact Rounded
-dqbas076 toSci 12345.67891234567890123456780123456123 -> 12345.67891234567890123456780123456 Inexact Rounded
-dqbas077 toSci 123456.7891234567890123456780123456123 -> 123456.7891234567890123456780123456 Inexact Rounded
-dqbas078 toSci 1234567.891234567890123456780123456123 -> 1234567.891234567890123456780123456 Inexact Rounded
-dqbas079 toSci 12345678.91234567890123456780123456123 -> 12345678.91234567890123456780123456 Inexact Rounded
-dqbas080 toSci 123456789.1234567890123456780123456123 -> 123456789.1234567890123456780123456 Inexact Rounded
-dqbas081 toSci 1234567891.234567890123456780123456123 -> 1234567891.234567890123456780123456 Inexact Rounded
-dqbas082 toSci 12345678912.34567890123456780123456123 -> 12345678912.34567890123456780123456 Inexact Rounded
-dqbas083 toSci 123456789123.4567890123456780123456123 -> 123456789123.4567890123456780123456 Inexact Rounded
-dqbas084 toSci 1234567891234.567890123456780123456123 -> 1234567891234.567890123456780123456 Inexact Rounded
-dqbas085 toSci 12345678912345.67890123456780123456123 -> 12345678912345.67890123456780123456 Inexact Rounded
-dqbas086 toSci 123456789123456.7890123456780123456123 -> 123456789123456.7890123456780123456 Inexact Rounded
-dqbas087 toSci 1234567891234567.890123456780123456123 -> 1234567891234567.890123456780123456 Inexact Rounded
-dqbas088 toSci 12345678912345678.90123456780123456123 -> 12345678912345678.90123456780123456 Inexact Rounded
-dqbas089 toSci 123456789123456789.0123456780123456123 -> 123456789123456789.0123456780123456 Inexact Rounded
-dqbas090 toSci 1234567891234567890.123456780123456123 -> 1234567891234567890.123456780123456 Inexact Rounded
-dqbas091 toSci 12345678912345678901.23456780123456123 -> 12345678912345678901.23456780123456 Inexact Rounded
-dqbas092 toSci 123456789123456789012.3456780123456123 -> 123456789123456789012.3456780123456 Inexact Rounded
-dqbas093 toSci 1234567891234567890123.456780123456123 -> 1234567891234567890123.456780123456 Inexact Rounded
-dqbas094 toSci 12345678912345678901234.56780123456123 -> 12345678912345678901234.56780123456 Inexact Rounded
-dqbas095 toSci 123456789123456789012345.6780123456123 -> 123456789123456789012345.6780123456 Inexact Rounded
-dqbas096 toSci 1234567891234567890123456.780123456123 -> 1234567891234567890123456.780123456 Inexact Rounded
-dqbas097 toSci 12345678912345678901234567.80123456123 -> 12345678912345678901234567.80123456 Inexact Rounded
-dqbas098 toSci 123456789123456789012345678.0123456123 -> 123456789123456789012345678.0123456 Inexact Rounded
-dqbas099 toSci 1234567891234567890123456780.123456123 -> 1234567891234567890123456780.123456 Inexact Rounded
-dqbas100 toSci 12345678912345678901234567801.23456123 -> 12345678912345678901234567801.23456 Inexact Rounded
-dqbas101 toSci 123456789123456789012345678012.3456123 -> 123456789123456789012345678012.3456 Inexact Rounded
-dqbas102 toSci 1234567891234567890123456780123.456123 -> 1234567891234567890123456780123.456 Inexact Rounded
-dqbas103 toSci 12345678912345678901234567801234.56123 -> 12345678912345678901234567801234.56 Inexact Rounded
-dqbas104 toSci 123456789123456789012345678012345.6123 -> 123456789123456789012345678012345.6 Inexact Rounded
-dqbas105 toSci 1234567891234567890123456780123456.123 -> 1234567891234567890123456780123456 Inexact Rounded
-dqbas106 toSci 12345678912345678901234567801234561.23 -> 1.234567891234567890123456780123456E+34 Inexact Rounded
-dqbas107 toSci 123456789123456789012345678012345612.3 -> 1.234567891234567890123456780123456E+35 Inexact Rounded
-dqbas108 toSci 1234567891234567890123456780123456123. -> 1.234567891234567890123456780123456E+36 Inexact Rounded
--- 123456789012345678
-
--- Numbers with E
-dqbas130 toSci "0.000E-1" -> '0.0000'
-dqbas131 toSci "0.000E-2" -> '0.00000'
-dqbas132 toSci "0.000E-3" -> '0.000000'
-dqbas133 toSci "0.000E-4" -> '0E-7'
-dqbas134 toSci "0.00E-2" -> '0.0000'
-dqbas135 toSci "0.00E-3" -> '0.00000'
-dqbas136 toSci "0.00E-4" -> '0.000000'
-dqbas137 toSci "0.00E-5" -> '0E-7'
-dqbas138 toSci "+0E+9" -> '0E+9'
-dqbas139 toSci "-0E+9" -> '-0E+9'
-dqbas140 toSci "1E+9" -> '1E+9'
-dqbas141 toSci "1e+09" -> '1E+9'
-dqbas142 toSci "1E+90" -> '1E+90'
-dqbas143 toSci "+1E+009" -> '1E+9'
-dqbas144 toSci "0E+9" -> '0E+9'
-dqbas145 toSci "1E+9" -> '1E+9'
-dqbas146 toSci "1E+09" -> '1E+9'
-dqbas147 toSci "1e+90" -> '1E+90'
-dqbas148 toSci "1E+009" -> '1E+9'
-dqbas149 toSci "000E+9" -> '0E+9'
-dqbas150 toSci "1E9" -> '1E+9'
-dqbas151 toSci "1e09" -> '1E+9'
-dqbas152 toSci "1E90" -> '1E+90'
-dqbas153 toSci "1E009" -> '1E+9'
-dqbas154 toSci "0E9" -> '0E+9'
-dqbas155 toSci "0.000e+0" -> '0.000'
-dqbas156 toSci "0.000E-1" -> '0.0000'
-dqbas157 toSci "4E+9" -> '4E+9'
-dqbas158 toSci "44E+9" -> '4.4E+10'
-dqbas159 toSci "0.73e-7" -> '7.3E-8'
-dqbas160 toSci "00E+9" -> '0E+9'
-dqbas161 toSci "00E-9" -> '0E-9'
-dqbas162 toSci "10E+9" -> '1.0E+10'
-dqbas163 toSci "10E+09" -> '1.0E+10'
-dqbas164 toSci "10e+90" -> '1.0E+91'
-dqbas165 toSci "10E+009" -> '1.0E+10'
-dqbas166 toSci "100e+9" -> '1.00E+11'
-dqbas167 toSci "100e+09" -> '1.00E+11'
-dqbas168 toSci "100E+90" -> '1.00E+92'
-dqbas169 toSci "100e+009" -> '1.00E+11'
-
-dqbas170 toSci "1.265" -> '1.265'
-dqbas171 toSci "1.265E-20" -> '1.265E-20'
-dqbas172 toSci "1.265E-8" -> '1.265E-8'
-dqbas173 toSci "1.265E-4" -> '0.0001265'
-dqbas174 toSci "1.265E-3" -> '0.001265'
-dqbas175 toSci "1.265E-2" -> '0.01265'
-dqbas176 toSci "1.265E-1" -> '0.1265'
-dqbas177 toSci "1.265E-0" -> '1.265'
-dqbas178 toSci "1.265E+1" -> '12.65'
-dqbas179 toSci "1.265E+2" -> '126.5'
-dqbas180 toSci "1.265E+3" -> '1265'
-dqbas181 toSci "1.265E+4" -> '1.265E+4'
-dqbas182 toSci "1.265E+8" -> '1.265E+8'
-dqbas183 toSci "1.265E+20" -> '1.265E+20'
-
-dqbas190 toSci "12.65" -> '12.65'
-dqbas191 toSci "12.65E-20" -> '1.265E-19'
-dqbas192 toSci "12.65E-8" -> '1.265E-7'
-dqbas193 toSci "12.65E-4" -> '0.001265'
-dqbas194 toSci "12.65E-3" -> '0.01265'
-dqbas195 toSci "12.65E-2" -> '0.1265'
-dqbas196 toSci "12.65E-1" -> '1.265'
-dqbas197 toSci "12.65E-0" -> '12.65'
-dqbas198 toSci "12.65E+1" -> '126.5'
-dqbas199 toSci "12.65E+2" -> '1265'
-dqbas200 toSci "12.65E+3" -> '1.265E+4'
-dqbas201 toSci "12.65E+4" -> '1.265E+5'
-dqbas202 toSci "12.65E+8" -> '1.265E+9'
-dqbas203 toSci "12.65E+20" -> '1.265E+21'
-
-dqbas210 toSci "126.5" -> '126.5'
-dqbas211 toSci "126.5E-20" -> '1.265E-18'
-dqbas212 toSci "126.5E-8" -> '0.000001265'
-dqbas213 toSci "126.5E-4" -> '0.01265'
-dqbas214 toSci "126.5E-3" -> '0.1265'
-dqbas215 toSci "126.5E-2" -> '1.265'
-dqbas216 toSci "126.5E-1" -> '12.65'
-dqbas217 toSci "126.5E-0" -> '126.5'
-dqbas218 toSci "126.5E+1" -> '1265'
-dqbas219 toSci "126.5E+2" -> '1.265E+4'
-dqbas220 toSci "126.5E+3" -> '1.265E+5'
-dqbas221 toSci "126.5E+4" -> '1.265E+6'
-dqbas222 toSci "126.5E+8" -> '1.265E+10'
-dqbas223 toSci "126.5E+20" -> '1.265E+22'
-
-dqbas230 toSci "1265" -> '1265'
-dqbas231 toSci "1265E-20" -> '1.265E-17'
-dqbas232 toSci "1265E-8" -> '0.00001265'
-dqbas233 toSci "1265E-4" -> '0.1265'
-dqbas234 toSci "1265E-3" -> '1.265'
-dqbas235 toSci "1265E-2" -> '12.65'
-dqbas236 toSci "1265E-1" -> '126.5'
-dqbas237 toSci "1265E-0" -> '1265'
-dqbas238 toSci "1265E+1" -> '1.265E+4'
-dqbas239 toSci "1265E+2" -> '1.265E+5'
-dqbas240 toSci "1265E+3" -> '1.265E+6'
-dqbas241 toSci "1265E+4" -> '1.265E+7'
-dqbas242 toSci "1265E+8" -> '1.265E+11'
-dqbas243 toSci "1265E+20" -> '1.265E+23'
-
-dqbas250 toSci "0.1265" -> '0.1265'
-dqbas251 toSci "0.1265E-20" -> '1.265E-21'
-dqbas252 toSci "0.1265E-8" -> '1.265E-9'
-dqbas253 toSci "0.1265E-4" -> '0.00001265'
-dqbas254 toSci "0.1265E-3" -> '0.0001265'
-dqbas255 toSci "0.1265E-2" -> '0.001265'
-dqbas256 toSci "0.1265E-1" -> '0.01265'
-dqbas257 toSci "0.1265E-0" -> '0.1265'
-dqbas258 toSci "0.1265E+1" -> '1.265'
-dqbas259 toSci "0.1265E+2" -> '12.65'
-dqbas260 toSci "0.1265E+3" -> '126.5'
-dqbas261 toSci "0.1265E+4" -> '1265'
-dqbas262 toSci "0.1265E+8" -> '1.265E+7'
-dqbas263 toSci "0.1265E+20" -> '1.265E+19'
-
--- some more negative zeros [systematic tests below]
-dqbas290 toSci "-0.000E-1" -> '-0.0000'
-dqbas291 toSci "-0.000E-2" -> '-0.00000'
-dqbas292 toSci "-0.000E-3" -> '-0.000000'
-dqbas293 toSci "-0.000E-4" -> '-0E-7'
-dqbas294 toSci "-0.00E-2" -> '-0.0000'
-dqbas295 toSci "-0.00E-3" -> '-0.00000'
-dqbas296 toSci "-0.0E-2" -> '-0.000'
-dqbas297 toSci "-0.0E-3" -> '-0.0000'
-dqbas298 toSci "-0E-2" -> '-0.00'
-dqbas299 toSci "-0E-3" -> '-0.000'
-
--- Engineering notation tests
-dqbas301 toSci 10e12 -> 1.0E+13
-dqbas302 toEng 10e12 -> 10E+12
-dqbas303 toSci 10e11 -> 1.0E+12
-dqbas304 toEng 10e11 -> 1.0E+12
-dqbas305 toSci 10e10 -> 1.0E+11
-dqbas306 toEng 10e10 -> 100E+9
-dqbas307 toSci 10e9 -> 1.0E+10
-dqbas308 toEng 10e9 -> 10E+9
-dqbas309 toSci 10e8 -> 1.0E+9
-dqbas310 toEng 10e8 -> 1.0E+9
-dqbas311 toSci 10e7 -> 1.0E+8
-dqbas312 toEng 10e7 -> 100E+6
-dqbas313 toSci 10e6 -> 1.0E+7
-dqbas314 toEng 10e6 -> 10E+6
-dqbas315 toSci 10e5 -> 1.0E+6
-dqbas316 toEng 10e5 -> 1.0E+6
-dqbas317 toSci 10e4 -> 1.0E+5
-dqbas318 toEng 10e4 -> 100E+3
-dqbas319 toSci 10e3 -> 1.0E+4
-dqbas320 toEng 10e3 -> 10E+3
-dqbas321 toSci 10e2 -> 1.0E+3
-dqbas322 toEng 10e2 -> 1.0E+3
-dqbas323 toSci 10e1 -> 1.0E+2
-dqbas324 toEng 10e1 -> 100
-dqbas325 toSci 10e0 -> 10
-dqbas326 toEng 10e0 -> 10
-dqbas327 toSci 10e-1 -> 1.0
-dqbas328 toEng 10e-1 -> 1.0
-dqbas329 toSci 10e-2 -> 0.10
-dqbas330 toEng 10e-2 -> 0.10
-dqbas331 toSci 10e-3 -> 0.010
-dqbas332 toEng 10e-3 -> 0.010
-dqbas333 toSci 10e-4 -> 0.0010
-dqbas334 toEng 10e-4 -> 0.0010
-dqbas335 toSci 10e-5 -> 0.00010
-dqbas336 toEng 10e-5 -> 0.00010
-dqbas337 toSci 10e-6 -> 0.000010
-dqbas338 toEng 10e-6 -> 0.000010
-dqbas339 toSci 10e-7 -> 0.0000010
-dqbas340 toEng 10e-7 -> 0.0000010
-dqbas341 toSci 10e-8 -> 1.0E-7
-dqbas342 toEng 10e-8 -> 100E-9
-dqbas343 toSci 10e-9 -> 1.0E-8
-dqbas344 toEng 10e-9 -> 10E-9
-dqbas345 toSci 10e-10 -> 1.0E-9
-dqbas346 toEng 10e-10 -> 1.0E-9
-dqbas347 toSci 10e-11 -> 1.0E-10
-dqbas348 toEng 10e-11 -> 100E-12
-dqbas349 toSci 10e-12 -> 1.0E-11
-dqbas350 toEng 10e-12 -> 10E-12
-dqbas351 toSci 10e-13 -> 1.0E-12
-dqbas352 toEng 10e-13 -> 1.0E-12
-
-dqbas361 toSci 7E12 -> 7E+12
-dqbas362 toEng 7E12 -> 7E+12
-dqbas363 toSci 7E11 -> 7E+11
-dqbas364 toEng 7E11 -> 700E+9
-dqbas365 toSci 7E10 -> 7E+10
-dqbas366 toEng 7E10 -> 70E+9
-dqbas367 toSci 7E9 -> 7E+9
-dqbas368 toEng 7E9 -> 7E+9
-dqbas369 toSci 7E8 -> 7E+8
-dqbas370 toEng 7E8 -> 700E+6
-dqbas371 toSci 7E7 -> 7E+7
-dqbas372 toEng 7E7 -> 70E+6
-dqbas373 toSci 7E6 -> 7E+6
-dqbas374 toEng 7E6 -> 7E+6
-dqbas375 toSci 7E5 -> 7E+5
-dqbas376 toEng 7E5 -> 700E+3
-dqbas377 toSci 7E4 -> 7E+4
-dqbas378 toEng 7E4 -> 70E+3
-dqbas379 toSci 7E3 -> 7E+3
-dqbas380 toEng 7E3 -> 7E+3
-dqbas381 toSci 7E2 -> 7E+2
-dqbas382 toEng 7E2 -> 700
-dqbas383 toSci 7E1 -> 7E+1
-dqbas384 toEng 7E1 -> 70
-dqbas385 toSci 7E0 -> 7
-dqbas386 toEng 7E0 -> 7
-dqbas387 toSci 7E-1 -> 0.7
-dqbas388 toEng 7E-1 -> 0.7
-dqbas389 toSci 7E-2 -> 0.07
-dqbas390 toEng 7E-2 -> 0.07
-dqbas391 toSci 7E-3 -> 0.007
-dqbas392 toEng 7E-3 -> 0.007
-dqbas393 toSci 7E-4 -> 0.0007
-dqbas394 toEng 7E-4 -> 0.0007
-dqbas395 toSci 7E-5 -> 0.00007
-dqbas396 toEng 7E-5 -> 0.00007
-dqbas397 toSci 7E-6 -> 0.000007
-dqbas398 toEng 7E-6 -> 0.000007
-dqbas399 toSci 7E-7 -> 7E-7
-dqbas400 toEng 7E-7 -> 700E-9
-dqbas401 toSci 7E-8 -> 7E-8
-dqbas402 toEng 7E-8 -> 70E-9
-dqbas403 toSci 7E-9 -> 7E-9
-dqbas404 toEng 7E-9 -> 7E-9
-dqbas405 toSci 7E-10 -> 7E-10
-dqbas406 toEng 7E-10 -> 700E-12
-dqbas407 toSci 7E-11 -> 7E-11
-dqbas408 toEng 7E-11 -> 70E-12
-dqbas409 toSci 7E-12 -> 7E-12
-dqbas410 toEng 7E-12 -> 7E-12
-dqbas411 toSci 7E-13 -> 7E-13
-dqbas412 toEng 7E-13 -> 700E-15
-
--- Exacts remain exact up to precision ..
-dqbas420 toSci 100 -> 100
-dqbas422 toSci 1000 -> 1000
-dqbas424 toSci 999.9 -> 999.9
-dqbas426 toSci 1000.0 -> 1000.0
-dqbas428 toSci 1000.1 -> 1000.1
-dqbas430 toSci 10000 -> 10000
-dqbas432 toSci 1000000000000000000000000000000 -> 1000000000000000000000000000000
-dqbas434 toSci 10000000000000000000000000000000 -> 10000000000000000000000000000000
-dqbas436 toSci 100000000000000000000000000000000 -> 100000000000000000000000000000000
-dqbas438 toSci 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqbas440 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded
-dqbas442 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded
-dqbas444 toSci 10000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+34 Rounded Inexact
-dqbas446 toSci 10000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+34 Rounded Inexact
-dqbas448 toSci 100000000000000000000000000000000050 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
-dqbas450 toSci 10000000000000000000000000000000009 -> 1.000000000000000000000000000000001E+34 Rounded Inexact
-dqbas452 toSci 100000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+35 Rounded
-dqbas454 toSci 100000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
-dqbas456 toSci 100000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
-dqbas458 toSci 100000000000000000000000000000000009 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
-dqbas460 toSci 1000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+36 Rounded
-dqbas462 toSci 1000000000000000000000000000000000300 -> 1.000000000000000000000000000000000E+36 Rounded Inexact
-dqbas464 toSci 1000000000000000000000000000000000500 -> 1.000000000000000000000000000000000E+36 Rounded Inexact
-dqbas466 toSci 1000000000000000000000000000000000900 -> 1.000000000000000000000000000000001E+36 Rounded Inexact
-dqbas468 toSci 10000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+37 Rounded
-dqbas470 toSci 10000000000000000000000000000000003000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact
-dqbas472 toSci 10000000000000000000000000000000005000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact
-dqbas474 toSci 10000000000000000000000000000000009000 -> 1.000000000000000000000000000000001E+37 Rounded Inexact
-
--- check rounding modes heeded
-rounding: ceiling
-dqbsr401 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr402 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr403 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr404 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
-rounding: up
-dqbsr405 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr406 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr407 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr408 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
-rounding: floor
-dqbsr410 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr411 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr412 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr413 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact
-rounding: half_down
-dqbsr415 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr416 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr417 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr418 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr419 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
-rounding: half_even
-dqbsr421 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr422 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr423 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr424 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr425 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
-rounding: down
-dqbsr426 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr427 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr428 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr429 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact
-rounding: half_up
-dqbsr431 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
-dqbsr432 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
-dqbsr433 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
-dqbsr434 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112347 Rounded Inexact
-dqbsr435 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
--- negatives
-rounding: ceiling
-dqbsr501 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr502 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr503 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr504 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact
-rounding: up
-dqbsr505 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr506 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr507 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr508 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-rounding: floor
-dqbsr510 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr511 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr512 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr513 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-rounding: half_down
-dqbsr515 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr516 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr517 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr518 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr519 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-rounding: half_even
-dqbsr521 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr522 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr523 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr524 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr525 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-rounding: down
-dqbsr526 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr527 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr528 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr529 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact
-rounding: half_up
-dqbsr531 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
-dqbsr532 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
-dqbsr533 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
-dqbsr534 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112347 Rounded Inexact
-dqbsr535 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
-
-rounding: half_even
-
--- The 'baddies' tests from DiagBigDecimal, plus some new ones
-dqbas500 toSci '1..2' -> NaN Conversion_syntax
-dqbas501 toSci '.' -> NaN Conversion_syntax
-dqbas502 toSci '..' -> NaN Conversion_syntax
-dqbas503 toSci '++1' -> NaN Conversion_syntax
-dqbas504 toSci '--1' -> NaN Conversion_syntax
-dqbas505 toSci '-+1' -> NaN Conversion_syntax
-dqbas506 toSci '+-1' -> NaN Conversion_syntax
-dqbas507 toSci '12e' -> NaN Conversion_syntax
-dqbas508 toSci '12e++' -> NaN Conversion_syntax
-dqbas509 toSci '12f4' -> NaN Conversion_syntax
-dqbas510 toSci ' +1' -> NaN Conversion_syntax
-dqbas511 toSci '+ 1' -> NaN Conversion_syntax
-dqbas512 toSci '12 ' -> NaN Conversion_syntax
-dqbas513 toSci ' + 1' -> NaN Conversion_syntax
-dqbas514 toSci ' - 1 ' -> NaN Conversion_syntax
-dqbas515 toSci 'x' -> NaN Conversion_syntax
-dqbas516 toSci '-1-' -> NaN Conversion_syntax
-dqbas517 toSci '12-' -> NaN Conversion_syntax
-dqbas518 toSci '3+' -> NaN Conversion_syntax
-dqbas519 toSci '' -> NaN Conversion_syntax
-dqbas520 toSci '1e-' -> NaN Conversion_syntax
-dqbas521 toSci '7e99999a' -> NaN Conversion_syntax
-dqbas522 toSci '7e123567890x' -> NaN Conversion_syntax
-dqbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
-dqbas524 toSci '' -> NaN Conversion_syntax
-dqbas525 toSci 'e100' -> NaN Conversion_syntax
-dqbas526 toSci '\u0e5a' -> NaN Conversion_syntax
-dqbas527 toSci '\u0b65' -> NaN Conversion_syntax
-dqbas528 toSci '123,65' -> NaN Conversion_syntax
-dqbas529 toSci '1.34.5' -> NaN Conversion_syntax
-dqbas530 toSci '.123.5' -> NaN Conversion_syntax
-dqbas531 toSci '01.35.' -> NaN Conversion_syntax
-dqbas532 toSci '01.35-' -> NaN Conversion_syntax
-dqbas533 toSci '0000..' -> NaN Conversion_syntax
-dqbas534 toSci '.0000.' -> NaN Conversion_syntax
-dqbas535 toSci '00..00' -> NaN Conversion_syntax
-dqbas536 toSci '111e*123' -> NaN Conversion_syntax
-dqbas537 toSci '111e123-' -> NaN Conversion_syntax
-dqbas538 toSci '111e+12+' -> NaN Conversion_syntax
-dqbas539 toSci '111e1-3-' -> NaN Conversion_syntax
-dqbas540 toSci '111e1*23' -> NaN Conversion_syntax
-dqbas541 toSci '111e1e+3' -> NaN Conversion_syntax
-dqbas542 toSci '1e1.0' -> NaN Conversion_syntax
-dqbas543 toSci '1e123e' -> NaN Conversion_syntax
-dqbas544 toSci 'ten' -> NaN Conversion_syntax
-dqbas545 toSci 'ONE' -> NaN Conversion_syntax
-dqbas546 toSci '1e.1' -> NaN Conversion_syntax
-dqbas547 toSci '1e1.' -> NaN Conversion_syntax
-dqbas548 toSci '1ee' -> NaN Conversion_syntax
-dqbas549 toSci 'e+1' -> NaN Conversion_syntax
-dqbas550 toSci '1.23.4' -> NaN Conversion_syntax
-dqbas551 toSci '1.2.1' -> NaN Conversion_syntax
-dqbas552 toSci '1E+1.2' -> NaN Conversion_syntax
-dqbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
-dqbas554 toSci '1E++1' -> NaN Conversion_syntax
-dqbas555 toSci '1E--1' -> NaN Conversion_syntax
-dqbas556 toSci '1E+-1' -> NaN Conversion_syntax
-dqbas557 toSci '1E-+1' -> NaN Conversion_syntax
-dqbas558 toSci '1E''1' -> NaN Conversion_syntax
-dqbas559 toSci "1E""1" -> NaN Conversion_syntax
-dqbas560 toSci "1E""""" -> NaN Conversion_syntax
--- Near-specials
-dqbas561 toSci "qNaN" -> NaN Conversion_syntax
-dqbas562 toSci "NaNq" -> NaN Conversion_syntax
-dqbas563 toSci "NaNs" -> NaN Conversion_syntax
-dqbas564 toSci "Infi" -> NaN Conversion_syntax
-dqbas565 toSci "Infin" -> NaN Conversion_syntax
-dqbas566 toSci "Infini" -> NaN Conversion_syntax
-dqbas567 toSci "Infinit" -> NaN Conversion_syntax
-dqbas568 toSci "-Infinit" -> NaN Conversion_syntax
-dqbas569 toSci "0Inf" -> NaN Conversion_syntax
-dqbas570 toSci "9Inf" -> NaN Conversion_syntax
-dqbas571 toSci "-0Inf" -> NaN Conversion_syntax
-dqbas572 toSci "-9Inf" -> NaN Conversion_syntax
-dqbas573 toSci "-sNa" -> NaN Conversion_syntax
-dqbas574 toSci "xNaN" -> NaN Conversion_syntax
-dqbas575 toSci "0sNaN" -> NaN Conversion_syntax
-
--- some baddies with dots and Es and dots and specials
-dqbas576 toSci 'e+1' -> NaN Conversion_syntax
-dqbas577 toSci '.e+1' -> NaN Conversion_syntax
-dqbas578 toSci '+.e+1' -> NaN Conversion_syntax
-dqbas579 toSci '-.e+' -> NaN Conversion_syntax
-dqbas580 toSci '-.e' -> NaN Conversion_syntax
-dqbas581 toSci 'E+1' -> NaN Conversion_syntax
-dqbas582 toSci '.E+1' -> NaN Conversion_syntax
-dqbas583 toSci '+.E+1' -> NaN Conversion_syntax
-dqbas584 toSci '-.E+' -> NaN Conversion_syntax
-dqbas585 toSci '-.E' -> NaN Conversion_syntax
-
-dqbas586 toSci '.NaN' -> NaN Conversion_syntax
-dqbas587 toSci '-.NaN' -> NaN Conversion_syntax
-dqbas588 toSci '+.sNaN' -> NaN Conversion_syntax
-dqbas589 toSci '+.Inf' -> NaN Conversion_syntax
-dqbas590 toSci '.Infinity' -> NaN Conversion_syntax
-
--- Zeros
-dqbas601 toSci 0.000000000 -> 0E-9
-dqbas602 toSci 0.00000000 -> 0E-8
-dqbas603 toSci 0.0000000 -> 0E-7
-dqbas604 toSci 0.000000 -> 0.000000
-dqbas605 toSci 0.00000 -> 0.00000
-dqbas606 toSci 0.0000 -> 0.0000
-dqbas607 toSci 0.000 -> 0.000
-dqbas608 toSci 0.00 -> 0.00
-dqbas609 toSci 0.0 -> 0.0
-dqbas610 toSci .0 -> 0.0
-dqbas611 toSci 0. -> 0
-dqbas612 toSci -.0 -> -0.0
-dqbas613 toSci -0. -> -0
-dqbas614 toSci -0.0 -> -0.0
-dqbas615 toSci -0.00 -> -0.00
-dqbas616 toSci -0.000 -> -0.000
-dqbas617 toSci -0.0000 -> -0.0000
-dqbas618 toSci -0.00000 -> -0.00000
-dqbas619 toSci -0.000000 -> -0.000000
-dqbas620 toSci -0.0000000 -> -0E-7
-dqbas621 toSci -0.00000000 -> -0E-8
-dqbas622 toSci -0.000000000 -> -0E-9
-
-dqbas630 toSci 0.00E+0 -> 0.00
-dqbas631 toSci 0.00E+1 -> 0.0
-dqbas632 toSci 0.00E+2 -> 0
-dqbas633 toSci 0.00E+3 -> 0E+1
-dqbas634 toSci 0.00E+4 -> 0E+2
-dqbas635 toSci 0.00E+5 -> 0E+3
-dqbas636 toSci 0.00E+6 -> 0E+4
-dqbas637 toSci 0.00E+7 -> 0E+5
-dqbas638 toSci 0.00E+8 -> 0E+6
-dqbas639 toSci 0.00E+9 -> 0E+7
-
-dqbas640 toSci 0.0E+0 -> 0.0
-dqbas641 toSci 0.0E+1 -> 0
-dqbas642 toSci 0.0E+2 -> 0E+1
-dqbas643 toSci 0.0E+3 -> 0E+2
-dqbas644 toSci 0.0E+4 -> 0E+3
-dqbas645 toSci 0.0E+5 -> 0E+4
-dqbas646 toSci 0.0E+6 -> 0E+5
-dqbas647 toSci 0.0E+7 -> 0E+6
-dqbas648 toSci 0.0E+8 -> 0E+7
-dqbas649 toSci 0.0E+9 -> 0E+8
-
-dqbas650 toSci 0E+0 -> 0
-dqbas651 toSci 0E+1 -> 0E+1
-dqbas652 toSci 0E+2 -> 0E+2
-dqbas653 toSci 0E+3 -> 0E+3
-dqbas654 toSci 0E+4 -> 0E+4
-dqbas655 toSci 0E+5 -> 0E+5
-dqbas656 toSci 0E+6 -> 0E+6
-dqbas657 toSci 0E+7 -> 0E+7
-dqbas658 toSci 0E+8 -> 0E+8
-dqbas659 toSci 0E+9 -> 0E+9
-
-dqbas660 toSci 0.0E-0 -> 0.0
-dqbas661 toSci 0.0E-1 -> 0.00
-dqbas662 toSci 0.0E-2 -> 0.000
-dqbas663 toSci 0.0E-3 -> 0.0000
-dqbas664 toSci 0.0E-4 -> 0.00000
-dqbas665 toSci 0.0E-5 -> 0.000000
-dqbas666 toSci 0.0E-6 -> 0E-7
-dqbas667 toSci 0.0E-7 -> 0E-8
-dqbas668 toSci 0.0E-8 -> 0E-9
-dqbas669 toSci 0.0E-9 -> 0E-10
-
-dqbas670 toSci 0.00E-0 -> 0.00
-dqbas671 toSci 0.00E-1 -> 0.000
-dqbas672 toSci 0.00E-2 -> 0.0000
-dqbas673 toSci 0.00E-3 -> 0.00000
-dqbas674 toSci 0.00E-4 -> 0.000000
-dqbas675 toSci 0.00E-5 -> 0E-7
-dqbas676 toSci 0.00E-6 -> 0E-8
-dqbas677 toSci 0.00E-7 -> 0E-9
-dqbas678 toSci 0.00E-8 -> 0E-10
-dqbas679 toSci 0.00E-9 -> 0E-11
-
-dqbas680 toSci 000000. -> 0
-dqbas681 toSci 00000. -> 0
-dqbas682 toSci 0000. -> 0
-dqbas683 toSci 000. -> 0
-dqbas684 toSci 00. -> 0
-dqbas685 toSci 0. -> 0
-dqbas686 toSci +00000. -> 0
-dqbas687 toSci -00000. -> -0
-dqbas688 toSci +0. -> 0
-dqbas689 toSci -0. -> -0
-
--- Specials
-dqbas700 toSci "NaN" -> NaN
-dqbas701 toSci "nan" -> NaN
-dqbas702 toSci "nAn" -> NaN
-dqbas703 toSci "NAN" -> NaN
-dqbas704 toSci "+NaN" -> NaN
-dqbas705 toSci "+nan" -> NaN
-dqbas706 toSci "+nAn" -> NaN
-dqbas707 toSci "+NAN" -> NaN
-dqbas708 toSci "-NaN" -> -NaN
-dqbas709 toSci "-nan" -> -NaN
-dqbas710 toSci "-nAn" -> -NaN
-dqbas711 toSci "-NAN" -> -NaN
-dqbas712 toSci 'NaN0' -> NaN
-dqbas713 toSci 'NaN1' -> NaN1
-dqbas714 toSci 'NaN12' -> NaN12
-dqbas715 toSci 'NaN123' -> NaN123
-dqbas716 toSci 'NaN1234' -> NaN1234
-dqbas717 toSci 'NaN01' -> NaN1
-dqbas718 toSci 'NaN012' -> NaN12
-dqbas719 toSci 'NaN0123' -> NaN123
-dqbas720 toSci 'NaN01234' -> NaN1234
-dqbas721 toSci 'NaN001' -> NaN1
-dqbas722 toSci 'NaN0012' -> NaN12
-dqbas723 toSci 'NaN00123' -> NaN123
-dqbas724 toSci 'NaN001234' -> NaN1234
-dqbas725 toSci 'NaN1234567890123456781234567890123456' -> NaN Conversion_syntax
-dqbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
-dqbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
-dqbas728 toSci 'NaN-12' -> NaN Conversion_syntax
-dqbas729 toSci 'NaN+12' -> NaN Conversion_syntax
-
-dqbas730 toSci "sNaN" -> sNaN
-dqbas731 toSci "snan" -> sNaN
-dqbas732 toSci "SnAn" -> sNaN
-dqbas733 toSci "SNAN" -> sNaN
-dqbas734 toSci "+sNaN" -> sNaN
-dqbas735 toSci "+snan" -> sNaN
-dqbas736 toSci "+SnAn" -> sNaN
-dqbas737 toSci "+SNAN" -> sNaN
-dqbas738 toSci "-sNaN" -> -sNaN
-dqbas739 toSci "-snan" -> -sNaN
-dqbas740 toSci "-SnAn" -> -sNaN
-dqbas741 toSci "-SNAN" -> -sNaN
-dqbas742 toSci 'sNaN0000' -> sNaN
-dqbas743 toSci 'sNaN7' -> sNaN7
-dqbas744 toSci 'sNaN007234' -> sNaN7234
-dqbas745 toSci 'sNaN1234567890123456787234561234567890' -> NaN Conversion_syntax
-dqbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
-dqbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
-
-dqbas748 toSci "Inf" -> Infinity
-dqbas749 toSci "inf" -> Infinity
-dqbas750 toSci "iNf" -> Infinity
-dqbas751 toSci "INF" -> Infinity
-dqbas752 toSci "+Inf" -> Infinity
-dqbas753 toSci "+inf" -> Infinity
-dqbas754 toSci "+iNf" -> Infinity
-dqbas755 toSci "+INF" -> Infinity
-dqbas756 toSci "-Inf" -> -Infinity
-dqbas757 toSci "-inf" -> -Infinity
-dqbas758 toSci "-iNf" -> -Infinity
-dqbas759 toSci "-INF" -> -Infinity
-
-dqbas760 toSci "Infinity" -> Infinity
-dqbas761 toSci "infinity" -> Infinity
-dqbas762 toSci "iNfInItY" -> Infinity
-dqbas763 toSci "INFINITY" -> Infinity
-dqbas764 toSci "+Infinity" -> Infinity
-dqbas765 toSci "+infinity" -> Infinity
-dqbas766 toSci "+iNfInItY" -> Infinity
-dqbas767 toSci "+INFINITY" -> Infinity
-dqbas768 toSci "-Infinity" -> -Infinity
-dqbas769 toSci "-infinity" -> -Infinity
-dqbas770 toSci "-iNfInItY" -> -Infinity
-dqbas771 toSci "-INFINITY" -> -Infinity
-
--- Specials and zeros for toEng
-dqbast772 toEng "NaN" -> NaN
-dqbast773 toEng "-Infinity" -> -Infinity
-dqbast774 toEng "-sNaN" -> -sNaN
-dqbast775 toEng "-NaN" -> -NaN
-dqbast776 toEng "+Infinity" -> Infinity
-dqbast778 toEng "+sNaN" -> sNaN
-dqbast779 toEng "+NaN" -> NaN
-dqbast780 toEng "INFINITY" -> Infinity
-dqbast781 toEng "SNAN" -> sNaN
-dqbast782 toEng "NAN" -> NaN
-dqbast783 toEng "infinity" -> Infinity
-dqbast784 toEng "snan" -> sNaN
-dqbast785 toEng "nan" -> NaN
-dqbast786 toEng "InFINITY" -> Infinity
-dqbast787 toEng "SnAN" -> sNaN
-dqbast788 toEng "nAN" -> NaN
-dqbast789 toEng "iNfinity" -> Infinity
-dqbast790 toEng "sNan" -> sNaN
-dqbast791 toEng "Nan" -> NaN
-dqbast792 toEng "Infinity" -> Infinity
-dqbast793 toEng "sNaN" -> sNaN
-
--- Zero toEng, etc.
-dqbast800 toEng 0e+1 -> "0.00E+3" -- doc example
-
-dqbast801 toEng 0.000000000 -> 0E-9
-dqbast802 toEng 0.00000000 -> 0.00E-6
-dqbast803 toEng 0.0000000 -> 0.0E-6
-dqbast804 toEng 0.000000 -> 0.000000
-dqbast805 toEng 0.00000 -> 0.00000
-dqbast806 toEng 0.0000 -> 0.0000
-dqbast807 toEng 0.000 -> 0.000
-dqbast808 toEng 0.00 -> 0.00
-dqbast809 toEng 0.0 -> 0.0
-dqbast810 toEng .0 -> 0.0
-dqbast811 toEng 0. -> 0
-dqbast812 toEng -.0 -> -0.0
-dqbast813 toEng -0. -> -0
-dqbast814 toEng -0.0 -> -0.0
-dqbast815 toEng -0.00 -> -0.00
-dqbast816 toEng -0.000 -> -0.000
-dqbast817 toEng -0.0000 -> -0.0000
-dqbast818 toEng -0.00000 -> -0.00000
-dqbast819 toEng -0.000000 -> -0.000000
-dqbast820 toEng -0.0000000 -> -0.0E-6
-dqbast821 toEng -0.00000000 -> -0.00E-6
-dqbast822 toEng -0.000000000 -> -0E-9
-
-dqbast830 toEng 0.00E+0 -> 0.00
-dqbast831 toEng 0.00E+1 -> 0.0
-dqbast832 toEng 0.00E+2 -> 0
-dqbast833 toEng 0.00E+3 -> 0.00E+3
-dqbast834 toEng 0.00E+4 -> 0.0E+3
-dqbast835 toEng 0.00E+5 -> 0E+3
-dqbast836 toEng 0.00E+6 -> 0.00E+6
-dqbast837 toEng 0.00E+7 -> 0.0E+6
-dqbast838 toEng 0.00E+8 -> 0E+6
-dqbast839 toEng 0.00E+9 -> 0.00E+9
-
-dqbast840 toEng 0.0E+0 -> 0.0
-dqbast841 toEng 0.0E+1 -> 0
-dqbast842 toEng 0.0E+2 -> 0.00E+3
-dqbast843 toEng 0.0E+3 -> 0.0E+3
-dqbast844 toEng 0.0E+4 -> 0E+3
-dqbast845 toEng 0.0E+5 -> 0.00E+6
-dqbast846 toEng 0.0E+6 -> 0.0E+6
-dqbast847 toEng 0.0E+7 -> 0E+6
-dqbast848 toEng 0.0E+8 -> 0.00E+9
-dqbast849 toEng 0.0E+9 -> 0.0E+9
-
-dqbast850 toEng 0E+0 -> 0
-dqbast851 toEng 0E+1 -> 0.00E+3
-dqbast852 toEng 0E+2 -> 0.0E+3
-dqbast853 toEng 0E+3 -> 0E+3
-dqbast854 toEng 0E+4 -> 0.00E+6
-dqbast855 toEng 0E+5 -> 0.0E+6
-dqbast856 toEng 0E+6 -> 0E+6
-dqbast857 toEng 0E+7 -> 0.00E+9
-dqbast858 toEng 0E+8 -> 0.0E+9
-dqbast859 toEng 0E+9 -> 0E+9
-
-dqbast860 toEng 0.0E-0 -> 0.0
-dqbast861 toEng 0.0E-1 -> 0.00
-dqbast862 toEng 0.0E-2 -> 0.000
-dqbast863 toEng 0.0E-3 -> 0.0000
-dqbast864 toEng 0.0E-4 -> 0.00000
-dqbast865 toEng 0.0E-5 -> 0.000000
-dqbast866 toEng 0.0E-6 -> 0.0E-6
-dqbast867 toEng 0.0E-7 -> 0.00E-6
-dqbast868 toEng 0.0E-8 -> 0E-9
-dqbast869 toEng 0.0E-9 -> 0.0E-9
-
-dqbast870 toEng 0.00E-0 -> 0.00
-dqbast871 toEng 0.00E-1 -> 0.000
-dqbast872 toEng 0.00E-2 -> 0.0000
-dqbast873 toEng 0.00E-3 -> 0.00000
-dqbast874 toEng 0.00E-4 -> 0.000000
-dqbast875 toEng 0.00E-5 -> 0.0E-6
-dqbast876 toEng 0.00E-6 -> 0.00E-6
-dqbast877 toEng 0.00E-7 -> 0E-9
-dqbast878 toEng 0.00E-8 -> 0.0E-9
-dqbast879 toEng 0.00E-9 -> 0.00E-9
-
--- long input strings
-dqbas801 tosci '01234567890123456' -> 1234567890123456
-dqbas802 tosci '001234567890123456' -> 1234567890123456
-dqbas803 tosci '0001234567890123456' -> 1234567890123456
-dqbas804 tosci '00001234567890123456' -> 1234567890123456
-dqbas805 tosci '000001234567890123456' -> 1234567890123456
-dqbas806 tosci '0000001234567890123456' -> 1234567890123456
-dqbas807 tosci '00000001234567890123456' -> 1234567890123456
-dqbas808 tosci '000000001234567890123456' -> 1234567890123456
-dqbas809 tosci '0000000001234567890123456' -> 1234567890123456
-dqbas810 tosci '00000000001234567890123456' -> 1234567890123456
-
-dqbas811 tosci '0.1234567890123456' -> 0.1234567890123456
-dqbas812 tosci '0.01234567890123456' -> 0.01234567890123456
-dqbas813 tosci '0.001234567890123456' -> 0.001234567890123456
-dqbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456
-dqbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456
-dqbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456
-dqbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7
-dqbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8
-dqbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9
-dqbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10
-
-dqbas821 tosci '12345678912345678901234567801234567890' -> 1.234567891234567890123456780123457E+37 Inexact Rounded
-dqbas822 tosci '123456789123456789012345678012345678901' -> 1.234567891234567890123456780123457E+38 Inexact Rounded
-dqbas823 tosci '1234567891234567890123456780123456789012' -> 1.234567891234567890123456780123457E+39 Inexact Rounded
-dqbas824 tosci '12345678912345678901234567801234567890123' -> 1.234567891234567890123456780123457E+40 Inexact Rounded
-dqbas825 tosci '123456789123456789012345678012345678901234' -> 1.234567891234567890123456780123457E+41 Inexact Rounded
-dqbas826 tosci '1234567891234567890123456780123456789012345' -> 1.234567891234567890123456780123457E+42 Inexact Rounded
-dqbas827 tosci '12345678912345678901234567801234567890123456' -> 1.234567891234567890123456780123457E+43 Inexact Rounded
-dqbas828 tosci '123456789123456789012345678012345678901234567' -> 1.234567891234567890123456780123457E+44 Inexact Rounded
-dqbas829 tosci '1234567891234567890123456780123456789012345678' -> 1.234567891234567890123456780123457E+45 Inexact Rounded
-
--- subnormals and overflows
-dqbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
-dqbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
-dqbas908 toSci '0.9e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas909 toSci '0.09e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
-dqbas911 toSci '10e-1000000000' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
-dqbas913 toSci '99e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
-dqbas915 toSci '1111e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas916 toSci '1111e-99999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
--- negatives the same
-dqbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
-dqbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
-dqbas920 toSci '-0.9e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas921 toSci '-0.09e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
-dqbas923 toSci '-10e-1000000000' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
-dqbas925 toSci '-99e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
-dqbas927 toSci '-1111e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas928 toSci '-1111e-99999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
-
--- overflow results at different rounding modes
-rounding: ceiling
-dqbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas931 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-rounding: up
-dqbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: down
-dqbas934 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqbas935 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-rounding: floor
-dqbas936 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_up
-dqbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_even
-dqbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_down
-dqbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dqbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_even
-
--- Now check 854/754r some subnormals and underflow to 0
-dqbem400 toSci 1.0000E-383 -> 1.0000E-383
-dqbem401 toSci 0.1E-6172 -> 1E-6173 Subnormal
-dqbem402 toSci 0.1000E-6172 -> 1.000E-6173 Subnormal
-dqbem403 toSci 0.0100E-6172 -> 1.00E-6174 Subnormal
-dqbem404 toSci 0.0010E-6172 -> 1.0E-6175 Subnormal
-dqbem405 toSci 0.0001E-6172 -> 1E-6176 Subnormal
-dqbem406 toSci 0.00010E-6172 -> 1E-6176 Subnormal Rounded
-dqbem407 toSci 0.00013E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqbem408 toSci 0.00015E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem409 toSci 0.00017E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem410 toSci 0.00023E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem411 toSci 0.00025E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem412 toSci 0.00027E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqbem413 toSci 0.000149E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqbem414 toSci 0.000150E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem415 toSci 0.000151E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem416 toSci 0.000249E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem417 toSci 0.000250E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqbem418 toSci 0.000251E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqbem419 toSci 0.00009E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqbem420 toSci 0.00005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem421 toSci 0.00003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem422 toSci 0.000009E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem423 toSci 0.000005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem424 toSci 0.000003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqbem425 toSci 0.001049E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
-dqbem426 toSci 0.001050E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
-dqbem427 toSci 0.001051E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded
-dqbem428 toSci 0.001149E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded
-dqbem429 toSci 0.001150E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded
-dqbem430 toSci 0.001151E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded
-
-dqbem432 toSci 0.010049E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
-dqbem433 toSci 0.010050E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
-dqbem434 toSci 0.010051E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded
-dqbem435 toSci 0.010149E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded
-dqbem436 toSci 0.010150E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded
-dqbem437 toSci 0.010151E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded
-
-dqbem440 toSci 0.10103E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded
-dqbem441 toSci 0.10105E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded
-dqbem442 toSci 0.10107E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded
-dqbem443 toSci 0.10113E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded
-dqbem444 toSci 0.10115E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded
-dqbem445 toSci 0.10117E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded
-
-dqbem450 toSci 1.10730E-6173 -> 1.107E-6173 Underflow Subnormal Inexact Rounded
-dqbem451 toSci 1.10750E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
-dqbem452 toSci 1.10770E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
-dqbem453 toSci 1.10830E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
-dqbem454 toSci 1.10850E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
-dqbem455 toSci 1.10870E-6173 -> 1.109E-6173 Underflow Subnormal Inexact Rounded
-
--- make sure sign OK
-dqbem456 toSci -0.10103E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded
-dqbem457 toSci -0.10105E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded
-dqbem458 toSci -0.10107E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded
-dqbem459 toSci -0.10113E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded
-dqbem460 toSci -0.10115E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded
-dqbem461 toSci -0.10117E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded
-
--- '999s' cases
-dqbem464 toSci 999999E-6173 -> 9.99999E-6168 Subnormal
-dqbem465 toSci 99999.0E-6172 -> 9.99990E-6168 Subnormal
-dqbem466 toSci 99999.E-6172 -> 9.9999E-6168 Subnormal
-dqbem467 toSci 9999.9E-6172 -> 9.9999E-6169 Subnormal
-dqbem468 toSci 999.99E-6172 -> 9.9999E-6170 Subnormal
-dqbem469 toSci 99.999E-6172 -> 9.9999E-6171 Subnormal
-dqbem470 toSci 9.9999E-6172 -> 9.9999E-6172 Subnormal
-dqbem471 toSci 0.99999E-6172 -> 1.0000E-6172 Underflow Subnormal Inexact Rounded
-dqbem472 toSci 0.099999E-6172 -> 1.000E-6173 Underflow Subnormal Inexact Rounded
-dqbem473 toSci 0.0099999E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
-dqbem474 toSci 0.00099999E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
-dqbem475 toSci 0.000099999E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqbem476 toSci 0.0000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem477 toSci 0.00000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbem478 toSci 0.000000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- Exponents with insignificant leading zeros
-dqbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
-dqbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
-dqbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
-dqbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
-dqbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
-dqbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
-dqbas1007 toSci 1e-999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1008 toSci 1e-0999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1009 toSci 1e-00999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1010 toSci 1e-000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1011 toSci 1e-000000000000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqbas1012 toSci 1e-000000000001000000007 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- check for double-rounded subnormals
-dqbas1041 toSci 1.1111111111111111111111111111152444E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
-dqbas1042 toSci 1.1111111111111111111111111111152445E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
-dqbas1043 toSci 1.1111111111111111111111111111152446E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
-
--- clamped zeros [see also clamp.decTest]
-dqbas1075 toSci 0e+10000 -> 0E+6111 Clamped
-dqbas1076 toSci 0e-10000 -> 0E-6176 Clamped
-dqbas1077 toSci -0e+10000 -> -0E+6111 Clamped
-dqbas1078 toSci -0e-10000 -> -0E-6176 Clamped
-
--- extreme values from next-wider
-dqbas1101 toSci -9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> -Infinity Overflow Inexact Rounded
-dqbas1102 toSci -1E-1572863 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped
-dqbas1103 toSci -1E-1572932 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped
-dqbas1104 toSci -0 -> -0
-dqbas1105 toSci +0 -> 0
-dqbas1106 toSci +1E-1572932 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped
-dqbas1107 toSci +1E-1572863 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped
-dqbas1108 toSci +9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> Infinity Overflow Inexact Rounded
-
+------------------------------------------------------------------------
+-- dqBase.decTest -- base decQuad <--> string conversions --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests base conversions from string to a decimal number
+-- and back to a string (in Scientific form)
+
+-- Note that unlike other operations the operand is subject to rounding
+-- to conform to emax and precision settings (that is, numbers will
+-- conform to rules and exponent will be in permitted range). The
+-- 'left hand side', therefore, may have numbers that cannot be
+-- represented in a decQuad. Some testcases go to the limit of the
+-- next-wider format, and hence these testcases may also be used to
+-- test narrowing and widening operations.
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqbas001 toSci 0 -> 0
+dqbas002 toSci 1 -> 1
+dqbas003 toSci 1.0 -> 1.0
+dqbas004 toSci 1.00 -> 1.00
+dqbas005 toSci 10 -> 10
+dqbas006 toSci 1000 -> 1000
+dqbas007 toSci 10.0 -> 10.0
+dqbas008 toSci 10.1 -> 10.1
+dqbas009 toSci 10.4 -> 10.4
+dqbas010 toSci 10.5 -> 10.5
+dqbas011 toSci 10.6 -> 10.6
+dqbas012 toSci 10.9 -> 10.9
+dqbas013 toSci 11.0 -> 11.0
+dqbas014 toSci 1.234 -> 1.234
+dqbas015 toSci 0.123 -> 0.123
+dqbas016 toSci 0.012 -> 0.012
+dqbas017 toSci -0 -> -0
+dqbas018 toSci -0.0 -> -0.0
+dqbas019 toSci -00.00 -> -0.00
+
+dqbas021 toSci -1 -> -1
+dqbas022 toSci -1.0 -> -1.0
+dqbas023 toSci -0.1 -> -0.1
+dqbas024 toSci -9.1 -> -9.1
+dqbas025 toSci -9.11 -> -9.11
+dqbas026 toSci -9.119 -> -9.119
+dqbas027 toSci -9.999 -> -9.999
+
+dqbas030 toSci '123456789.123456' -> '123456789.123456'
+dqbas031 toSci '123456789.000000' -> '123456789.000000'
+dqbas032 toSci '123456789123456' -> '123456789123456'
+dqbas033 toSci '0.0000123456789' -> '0.0000123456789'
+dqbas034 toSci '0.00000123456789' -> '0.00000123456789'
+dqbas035 toSci '0.000000123456789' -> '1.23456789E-7'
+dqbas036 toSci '0.0000000123456789' -> '1.23456789E-8'
+
+dqbas037 toSci '0.123456789012344' -> '0.123456789012344'
+dqbas038 toSci '0.123456789012345' -> '0.123456789012345'
+
+-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
+dqbsn001 toSci -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqbsn002 toSci -1E-6143 -> -1E-6143
+dqbsn003 toSci -1E-6176 -> -1E-6176 Subnormal
+dqbsn004 toSci -0 -> -0
+dqbsn005 toSci +0 -> 0
+dqbsn006 toSci +1E-6176 -> 1E-6176 Subnormal
+dqbsn007 toSci +1E-6143 -> 1E-6143
+dqbsn008 toSci +9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+
+-- String [many more examples are implicitly tested elsewhere]
+-- strings without E cannot generate E in result
+dqbas040 toSci "12" -> '12'
+dqbas041 toSci "-76" -> '-76'
+dqbas042 toSci "12.76" -> '12.76'
+dqbas043 toSci "+12.76" -> '12.76'
+dqbas044 toSci "012.76" -> '12.76'
+dqbas045 toSci "+0.003" -> '0.003'
+dqbas046 toSci "17." -> '17'
+dqbas047 toSci ".5" -> '0.5'
+dqbas048 toSci "044" -> '44'
+dqbas049 toSci "0044" -> '44'
+dqbas050 toSci "0.0005" -> '0.0005'
+dqbas051 toSci "00.00005" -> '0.00005'
+dqbas052 toSci "0.000005" -> '0.000005'
+dqbas053 toSci "0.0000050" -> '0.0000050'
+dqbas054 toSci "0.0000005" -> '5E-7'
+dqbas055 toSci "0.00000005" -> '5E-8'
+dqbas056 toSci "12345678.543210" -> '12345678.543210'
+dqbas057 toSci "2345678.543210" -> '2345678.543210'
+dqbas058 toSci "345678.543210" -> '345678.543210'
+dqbas059 toSci "0345678.54321" -> '345678.54321'
+dqbas060 toSci "345678.5432" -> '345678.5432'
+dqbas061 toSci "+345678.5432" -> '345678.5432'
+dqbas062 toSci "+0345678.5432" -> '345678.5432'
+dqbas063 toSci "+00345678.5432" -> '345678.5432'
+dqbas064 toSci "-345678.5432" -> '-345678.5432'
+dqbas065 toSci "-0345678.5432" -> '-345678.5432'
+dqbas066 toSci "-00345678.5432" -> '-345678.5432'
+-- examples
+dqbas067 toSci "5E-6" -> '0.000005'
+dqbas068 toSci "50E-7" -> '0.0000050'
+dqbas069 toSci "5E-7" -> '5E-7'
+
+-- [No exotics as no Unicode]
+
+-- rounded with dots in all (including edge) places
+dqbas071 toSci .1234567891234567890123456780123456123 -> 0.1234567891234567890123456780123456 Inexact Rounded
+dqbas072 toSci 1.234567891234567890123456780123456123 -> 1.234567891234567890123456780123456 Inexact Rounded
+dqbas073 toSci 12.34567891234567890123456780123456123 -> 12.34567891234567890123456780123456 Inexact Rounded
+dqbas074 toSci 123.4567891234567890123456780123456123 -> 123.4567891234567890123456780123456 Inexact Rounded
+dqbas075 toSci 1234.567891234567890123456780123456123 -> 1234.567891234567890123456780123456 Inexact Rounded
+dqbas076 toSci 12345.67891234567890123456780123456123 -> 12345.67891234567890123456780123456 Inexact Rounded
+dqbas077 toSci 123456.7891234567890123456780123456123 -> 123456.7891234567890123456780123456 Inexact Rounded
+dqbas078 toSci 1234567.891234567890123456780123456123 -> 1234567.891234567890123456780123456 Inexact Rounded
+dqbas079 toSci 12345678.91234567890123456780123456123 -> 12345678.91234567890123456780123456 Inexact Rounded
+dqbas080 toSci 123456789.1234567890123456780123456123 -> 123456789.1234567890123456780123456 Inexact Rounded
+dqbas081 toSci 1234567891.234567890123456780123456123 -> 1234567891.234567890123456780123456 Inexact Rounded
+dqbas082 toSci 12345678912.34567890123456780123456123 -> 12345678912.34567890123456780123456 Inexact Rounded
+dqbas083 toSci 123456789123.4567890123456780123456123 -> 123456789123.4567890123456780123456 Inexact Rounded
+dqbas084 toSci 1234567891234.567890123456780123456123 -> 1234567891234.567890123456780123456 Inexact Rounded
+dqbas085 toSci 12345678912345.67890123456780123456123 -> 12345678912345.67890123456780123456 Inexact Rounded
+dqbas086 toSci 123456789123456.7890123456780123456123 -> 123456789123456.7890123456780123456 Inexact Rounded
+dqbas087 toSci 1234567891234567.890123456780123456123 -> 1234567891234567.890123456780123456 Inexact Rounded
+dqbas088 toSci 12345678912345678.90123456780123456123 -> 12345678912345678.90123456780123456 Inexact Rounded
+dqbas089 toSci 123456789123456789.0123456780123456123 -> 123456789123456789.0123456780123456 Inexact Rounded
+dqbas090 toSci 1234567891234567890.123456780123456123 -> 1234567891234567890.123456780123456 Inexact Rounded
+dqbas091 toSci 12345678912345678901.23456780123456123 -> 12345678912345678901.23456780123456 Inexact Rounded
+dqbas092 toSci 123456789123456789012.3456780123456123 -> 123456789123456789012.3456780123456 Inexact Rounded
+dqbas093 toSci 1234567891234567890123.456780123456123 -> 1234567891234567890123.456780123456 Inexact Rounded
+dqbas094 toSci 12345678912345678901234.56780123456123 -> 12345678912345678901234.56780123456 Inexact Rounded
+dqbas095 toSci 123456789123456789012345.6780123456123 -> 123456789123456789012345.6780123456 Inexact Rounded
+dqbas096 toSci 1234567891234567890123456.780123456123 -> 1234567891234567890123456.780123456 Inexact Rounded
+dqbas097 toSci 12345678912345678901234567.80123456123 -> 12345678912345678901234567.80123456 Inexact Rounded
+dqbas098 toSci 123456789123456789012345678.0123456123 -> 123456789123456789012345678.0123456 Inexact Rounded
+dqbas099 toSci 1234567891234567890123456780.123456123 -> 1234567891234567890123456780.123456 Inexact Rounded
+dqbas100 toSci 12345678912345678901234567801.23456123 -> 12345678912345678901234567801.23456 Inexact Rounded
+dqbas101 toSci 123456789123456789012345678012.3456123 -> 123456789123456789012345678012.3456 Inexact Rounded
+dqbas102 toSci 1234567891234567890123456780123.456123 -> 1234567891234567890123456780123.456 Inexact Rounded
+dqbas103 toSci 12345678912345678901234567801234.56123 -> 12345678912345678901234567801234.56 Inexact Rounded
+dqbas104 toSci 123456789123456789012345678012345.6123 -> 123456789123456789012345678012345.6 Inexact Rounded
+dqbas105 toSci 1234567891234567890123456780123456.123 -> 1234567891234567890123456780123456 Inexact Rounded
+dqbas106 toSci 12345678912345678901234567801234561.23 -> 1.234567891234567890123456780123456E+34 Inexact Rounded
+dqbas107 toSci 123456789123456789012345678012345612.3 -> 1.234567891234567890123456780123456E+35 Inexact Rounded
+dqbas108 toSci 1234567891234567890123456780123456123. -> 1.234567891234567890123456780123456E+36 Inexact Rounded
+-- 123456789012345678
+
+-- Numbers with E
+dqbas130 toSci "0.000E-1" -> '0.0000'
+dqbas131 toSci "0.000E-2" -> '0.00000'
+dqbas132 toSci "0.000E-3" -> '0.000000'
+dqbas133 toSci "0.000E-4" -> '0E-7'
+dqbas134 toSci "0.00E-2" -> '0.0000'
+dqbas135 toSci "0.00E-3" -> '0.00000'
+dqbas136 toSci "0.00E-4" -> '0.000000'
+dqbas137 toSci "0.00E-5" -> '0E-7'
+dqbas138 toSci "+0E+9" -> '0E+9'
+dqbas139 toSci "-0E+9" -> '-0E+9'
+dqbas140 toSci "1E+9" -> '1E+9'
+dqbas141 toSci "1e+09" -> '1E+9'
+dqbas142 toSci "1E+90" -> '1E+90'
+dqbas143 toSci "+1E+009" -> '1E+9'
+dqbas144 toSci "0E+9" -> '0E+9'
+dqbas145 toSci "1E+9" -> '1E+9'
+dqbas146 toSci "1E+09" -> '1E+9'
+dqbas147 toSci "1e+90" -> '1E+90'
+dqbas148 toSci "1E+009" -> '1E+9'
+dqbas149 toSci "000E+9" -> '0E+9'
+dqbas150 toSci "1E9" -> '1E+9'
+dqbas151 toSci "1e09" -> '1E+9'
+dqbas152 toSci "1E90" -> '1E+90'
+dqbas153 toSci "1E009" -> '1E+9'
+dqbas154 toSci "0E9" -> '0E+9'
+dqbas155 toSci "0.000e+0" -> '0.000'
+dqbas156 toSci "0.000E-1" -> '0.0000'
+dqbas157 toSci "4E+9" -> '4E+9'
+dqbas158 toSci "44E+9" -> '4.4E+10'
+dqbas159 toSci "0.73e-7" -> '7.3E-8'
+dqbas160 toSci "00E+9" -> '0E+9'
+dqbas161 toSci "00E-9" -> '0E-9'
+dqbas162 toSci "10E+9" -> '1.0E+10'
+dqbas163 toSci "10E+09" -> '1.0E+10'
+dqbas164 toSci "10e+90" -> '1.0E+91'
+dqbas165 toSci "10E+009" -> '1.0E+10'
+dqbas166 toSci "100e+9" -> '1.00E+11'
+dqbas167 toSci "100e+09" -> '1.00E+11'
+dqbas168 toSci "100E+90" -> '1.00E+92'
+dqbas169 toSci "100e+009" -> '1.00E+11'
+
+dqbas170 toSci "1.265" -> '1.265'
+dqbas171 toSci "1.265E-20" -> '1.265E-20'
+dqbas172 toSci "1.265E-8" -> '1.265E-8'
+dqbas173 toSci "1.265E-4" -> '0.0001265'
+dqbas174 toSci "1.265E-3" -> '0.001265'
+dqbas175 toSci "1.265E-2" -> '0.01265'
+dqbas176 toSci "1.265E-1" -> '0.1265'
+dqbas177 toSci "1.265E-0" -> '1.265'
+dqbas178 toSci "1.265E+1" -> '12.65'
+dqbas179 toSci "1.265E+2" -> '126.5'
+dqbas180 toSci "1.265E+3" -> '1265'
+dqbas181 toSci "1.265E+4" -> '1.265E+4'
+dqbas182 toSci "1.265E+8" -> '1.265E+8'
+dqbas183 toSci "1.265E+20" -> '1.265E+20'
+
+dqbas190 toSci "12.65" -> '12.65'
+dqbas191 toSci "12.65E-20" -> '1.265E-19'
+dqbas192 toSci "12.65E-8" -> '1.265E-7'
+dqbas193 toSci "12.65E-4" -> '0.001265'
+dqbas194 toSci "12.65E-3" -> '0.01265'
+dqbas195 toSci "12.65E-2" -> '0.1265'
+dqbas196 toSci "12.65E-1" -> '1.265'
+dqbas197 toSci "12.65E-0" -> '12.65'
+dqbas198 toSci "12.65E+1" -> '126.5'
+dqbas199 toSci "12.65E+2" -> '1265'
+dqbas200 toSci "12.65E+3" -> '1.265E+4'
+dqbas201 toSci "12.65E+4" -> '1.265E+5'
+dqbas202 toSci "12.65E+8" -> '1.265E+9'
+dqbas203 toSci "12.65E+20" -> '1.265E+21'
+
+dqbas210 toSci "126.5" -> '126.5'
+dqbas211 toSci "126.5E-20" -> '1.265E-18'
+dqbas212 toSci "126.5E-8" -> '0.000001265'
+dqbas213 toSci "126.5E-4" -> '0.01265'
+dqbas214 toSci "126.5E-3" -> '0.1265'
+dqbas215 toSci "126.5E-2" -> '1.265'
+dqbas216 toSci "126.5E-1" -> '12.65'
+dqbas217 toSci "126.5E-0" -> '126.5'
+dqbas218 toSci "126.5E+1" -> '1265'
+dqbas219 toSci "126.5E+2" -> '1.265E+4'
+dqbas220 toSci "126.5E+3" -> '1.265E+5'
+dqbas221 toSci "126.5E+4" -> '1.265E+6'
+dqbas222 toSci "126.5E+8" -> '1.265E+10'
+dqbas223 toSci "126.5E+20" -> '1.265E+22'
+
+dqbas230 toSci "1265" -> '1265'
+dqbas231 toSci "1265E-20" -> '1.265E-17'
+dqbas232 toSci "1265E-8" -> '0.00001265'
+dqbas233 toSci "1265E-4" -> '0.1265'
+dqbas234 toSci "1265E-3" -> '1.265'
+dqbas235 toSci "1265E-2" -> '12.65'
+dqbas236 toSci "1265E-1" -> '126.5'
+dqbas237 toSci "1265E-0" -> '1265'
+dqbas238 toSci "1265E+1" -> '1.265E+4'
+dqbas239 toSci "1265E+2" -> '1.265E+5'
+dqbas240 toSci "1265E+3" -> '1.265E+6'
+dqbas241 toSci "1265E+4" -> '1.265E+7'
+dqbas242 toSci "1265E+8" -> '1.265E+11'
+dqbas243 toSci "1265E+20" -> '1.265E+23'
+
+dqbas250 toSci "0.1265" -> '0.1265'
+dqbas251 toSci "0.1265E-20" -> '1.265E-21'
+dqbas252 toSci "0.1265E-8" -> '1.265E-9'
+dqbas253 toSci "0.1265E-4" -> '0.00001265'
+dqbas254 toSci "0.1265E-3" -> '0.0001265'
+dqbas255 toSci "0.1265E-2" -> '0.001265'
+dqbas256 toSci "0.1265E-1" -> '0.01265'
+dqbas257 toSci "0.1265E-0" -> '0.1265'
+dqbas258 toSci "0.1265E+1" -> '1.265'
+dqbas259 toSci "0.1265E+2" -> '12.65'
+dqbas260 toSci "0.1265E+3" -> '126.5'
+dqbas261 toSci "0.1265E+4" -> '1265'
+dqbas262 toSci "0.1265E+8" -> '1.265E+7'
+dqbas263 toSci "0.1265E+20" -> '1.265E+19'
+
+-- some more negative zeros [systematic tests below]
+dqbas290 toSci "-0.000E-1" -> '-0.0000'
+dqbas291 toSci "-0.000E-2" -> '-0.00000'
+dqbas292 toSci "-0.000E-3" -> '-0.000000'
+dqbas293 toSci "-0.000E-4" -> '-0E-7'
+dqbas294 toSci "-0.00E-2" -> '-0.0000'
+dqbas295 toSci "-0.00E-3" -> '-0.00000'
+dqbas296 toSci "-0.0E-2" -> '-0.000'
+dqbas297 toSci "-0.0E-3" -> '-0.0000'
+dqbas298 toSci "-0E-2" -> '-0.00'
+dqbas299 toSci "-0E-3" -> '-0.000'
+
+-- Engineering notation tests
+dqbas301 toSci 10e12 -> 1.0E+13
+dqbas302 toEng 10e12 -> 10E+12
+dqbas303 toSci 10e11 -> 1.0E+12
+dqbas304 toEng 10e11 -> 1.0E+12
+dqbas305 toSci 10e10 -> 1.0E+11
+dqbas306 toEng 10e10 -> 100E+9
+dqbas307 toSci 10e9 -> 1.0E+10
+dqbas308 toEng 10e9 -> 10E+9
+dqbas309 toSci 10e8 -> 1.0E+9
+dqbas310 toEng 10e8 -> 1.0E+9
+dqbas311 toSci 10e7 -> 1.0E+8
+dqbas312 toEng 10e7 -> 100E+6
+dqbas313 toSci 10e6 -> 1.0E+7
+dqbas314 toEng 10e6 -> 10E+6
+dqbas315 toSci 10e5 -> 1.0E+6
+dqbas316 toEng 10e5 -> 1.0E+6
+dqbas317 toSci 10e4 -> 1.0E+5
+dqbas318 toEng 10e4 -> 100E+3
+dqbas319 toSci 10e3 -> 1.0E+4
+dqbas320 toEng 10e3 -> 10E+3
+dqbas321 toSci 10e2 -> 1.0E+3
+dqbas322 toEng 10e2 -> 1.0E+3
+dqbas323 toSci 10e1 -> 1.0E+2
+dqbas324 toEng 10e1 -> 100
+dqbas325 toSci 10e0 -> 10
+dqbas326 toEng 10e0 -> 10
+dqbas327 toSci 10e-1 -> 1.0
+dqbas328 toEng 10e-1 -> 1.0
+dqbas329 toSci 10e-2 -> 0.10
+dqbas330 toEng 10e-2 -> 0.10
+dqbas331 toSci 10e-3 -> 0.010
+dqbas332 toEng 10e-3 -> 0.010
+dqbas333 toSci 10e-4 -> 0.0010
+dqbas334 toEng 10e-4 -> 0.0010
+dqbas335 toSci 10e-5 -> 0.00010
+dqbas336 toEng 10e-5 -> 0.00010
+dqbas337 toSci 10e-6 -> 0.000010
+dqbas338 toEng 10e-6 -> 0.000010
+dqbas339 toSci 10e-7 -> 0.0000010
+dqbas340 toEng 10e-7 -> 0.0000010
+dqbas341 toSci 10e-8 -> 1.0E-7
+dqbas342 toEng 10e-8 -> 100E-9
+dqbas343 toSci 10e-9 -> 1.0E-8
+dqbas344 toEng 10e-9 -> 10E-9
+dqbas345 toSci 10e-10 -> 1.0E-9
+dqbas346 toEng 10e-10 -> 1.0E-9
+dqbas347 toSci 10e-11 -> 1.0E-10
+dqbas348 toEng 10e-11 -> 100E-12
+dqbas349 toSci 10e-12 -> 1.0E-11
+dqbas350 toEng 10e-12 -> 10E-12
+dqbas351 toSci 10e-13 -> 1.0E-12
+dqbas352 toEng 10e-13 -> 1.0E-12
+
+dqbas361 toSci 7E12 -> 7E+12
+dqbas362 toEng 7E12 -> 7E+12
+dqbas363 toSci 7E11 -> 7E+11
+dqbas364 toEng 7E11 -> 700E+9
+dqbas365 toSci 7E10 -> 7E+10
+dqbas366 toEng 7E10 -> 70E+9
+dqbas367 toSci 7E9 -> 7E+9
+dqbas368 toEng 7E9 -> 7E+9
+dqbas369 toSci 7E8 -> 7E+8
+dqbas370 toEng 7E8 -> 700E+6
+dqbas371 toSci 7E7 -> 7E+7
+dqbas372 toEng 7E7 -> 70E+6
+dqbas373 toSci 7E6 -> 7E+6
+dqbas374 toEng 7E6 -> 7E+6
+dqbas375 toSci 7E5 -> 7E+5
+dqbas376 toEng 7E5 -> 700E+3
+dqbas377 toSci 7E4 -> 7E+4
+dqbas378 toEng 7E4 -> 70E+3
+dqbas379 toSci 7E3 -> 7E+3
+dqbas380 toEng 7E3 -> 7E+3
+dqbas381 toSci 7E2 -> 7E+2
+dqbas382 toEng 7E2 -> 700
+dqbas383 toSci 7E1 -> 7E+1
+dqbas384 toEng 7E1 -> 70
+dqbas385 toSci 7E0 -> 7
+dqbas386 toEng 7E0 -> 7
+dqbas387 toSci 7E-1 -> 0.7
+dqbas388 toEng 7E-1 -> 0.7
+dqbas389 toSci 7E-2 -> 0.07
+dqbas390 toEng 7E-2 -> 0.07
+dqbas391 toSci 7E-3 -> 0.007
+dqbas392 toEng 7E-3 -> 0.007
+dqbas393 toSci 7E-4 -> 0.0007
+dqbas394 toEng 7E-4 -> 0.0007
+dqbas395 toSci 7E-5 -> 0.00007
+dqbas396 toEng 7E-5 -> 0.00007
+dqbas397 toSci 7E-6 -> 0.000007
+dqbas398 toEng 7E-6 -> 0.000007
+dqbas399 toSci 7E-7 -> 7E-7
+dqbas400 toEng 7E-7 -> 700E-9
+dqbas401 toSci 7E-8 -> 7E-8
+dqbas402 toEng 7E-8 -> 70E-9
+dqbas403 toSci 7E-9 -> 7E-9
+dqbas404 toEng 7E-9 -> 7E-9
+dqbas405 toSci 7E-10 -> 7E-10
+dqbas406 toEng 7E-10 -> 700E-12
+dqbas407 toSci 7E-11 -> 7E-11
+dqbas408 toEng 7E-11 -> 70E-12
+dqbas409 toSci 7E-12 -> 7E-12
+dqbas410 toEng 7E-12 -> 7E-12
+dqbas411 toSci 7E-13 -> 7E-13
+dqbas412 toEng 7E-13 -> 700E-15
+
+-- Exacts remain exact up to precision ..
+dqbas420 toSci 100 -> 100
+dqbas422 toSci 1000 -> 1000
+dqbas424 toSci 999.9 -> 999.9
+dqbas426 toSci 1000.0 -> 1000.0
+dqbas428 toSci 1000.1 -> 1000.1
+dqbas430 toSci 10000 -> 10000
+dqbas432 toSci 1000000000000000000000000000000 -> 1000000000000000000000000000000
+dqbas434 toSci 10000000000000000000000000000000 -> 10000000000000000000000000000000
+dqbas436 toSci 100000000000000000000000000000000 -> 100000000000000000000000000000000
+dqbas438 toSci 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqbas440 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded
+dqbas442 toSci 10000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+34 Rounded
+dqbas444 toSci 10000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+34 Rounded Inexact
+dqbas446 toSci 10000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+34 Rounded Inexact
+dqbas448 toSci 100000000000000000000000000000000050 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
+dqbas450 toSci 10000000000000000000000000000000009 -> 1.000000000000000000000000000000001E+34 Rounded Inexact
+dqbas452 toSci 100000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+35 Rounded
+dqbas454 toSci 100000000000000000000000000000000003 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
+dqbas456 toSci 100000000000000000000000000000000005 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
+dqbas458 toSci 100000000000000000000000000000000009 -> 1.000000000000000000000000000000000E+35 Rounded Inexact
+dqbas460 toSci 1000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+36 Rounded
+dqbas462 toSci 1000000000000000000000000000000000300 -> 1.000000000000000000000000000000000E+36 Rounded Inexact
+dqbas464 toSci 1000000000000000000000000000000000500 -> 1.000000000000000000000000000000000E+36 Rounded Inexact
+dqbas466 toSci 1000000000000000000000000000000000900 -> 1.000000000000000000000000000000001E+36 Rounded Inexact
+dqbas468 toSci 10000000000000000000000000000000000000 -> 1.000000000000000000000000000000000E+37 Rounded
+dqbas470 toSci 10000000000000000000000000000000003000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact
+dqbas472 toSci 10000000000000000000000000000000005000 -> 1.000000000000000000000000000000000E+37 Rounded Inexact
+dqbas474 toSci 10000000000000000000000000000000009000 -> 1.000000000000000000000000000000001E+37 Rounded Inexact
+
+-- check rounding modes heeded
+rounding: ceiling
+dqbsr401 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr402 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr403 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr404 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+rounding: up
+dqbsr405 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr406 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr407 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr408 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+rounding: floor
+dqbsr410 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr411 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr412 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr413 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact
+rounding: half_down
+dqbsr415 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr416 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr417 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr418 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr419 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+rounding: half_even
+dqbsr421 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr422 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr423 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr424 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr425 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+rounding: down
+dqbsr426 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr427 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr428 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr429 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112345 Rounded Inexact
+rounding: half_up
+dqbsr431 toSci 1.1111111111111111111111111111123450 -> 1.111111111111111111111111111112345 Rounded
+dqbsr432 toSci 1.11111111111111111111111111111234549 -> 1.111111111111111111111111111112345 Rounded Inexact
+dqbsr433 toSci 1.11111111111111111111111111111234550 -> 1.111111111111111111111111111112346 Rounded Inexact
+dqbsr434 toSci 1.11111111111111111111111111111234650 -> 1.111111111111111111111111111112347 Rounded Inexact
+dqbsr435 toSci 1.11111111111111111111111111111234551 -> 1.111111111111111111111111111112346 Rounded Inexact
+-- negatives
+rounding: ceiling
+dqbsr501 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr502 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr503 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr504 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact
+rounding: up
+dqbsr505 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr506 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr507 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr508 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+rounding: floor
+dqbsr510 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr511 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr512 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr513 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+rounding: half_down
+dqbsr515 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr516 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr517 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr518 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr519 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+rounding: half_even
+dqbsr521 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr522 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr523 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr524 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr525 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+rounding: down
+dqbsr526 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr527 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr528 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr529 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112345 Rounded Inexact
+rounding: half_up
+dqbsr531 toSci -1.1111111111111111111111111111123450 -> -1.111111111111111111111111111112345 Rounded
+dqbsr532 toSci -1.11111111111111111111111111111234549 -> -1.111111111111111111111111111112345 Rounded Inexact
+dqbsr533 toSci -1.11111111111111111111111111111234550 -> -1.111111111111111111111111111112346 Rounded Inexact
+dqbsr534 toSci -1.11111111111111111111111111111234650 -> -1.111111111111111111111111111112347 Rounded Inexact
+dqbsr535 toSci -1.11111111111111111111111111111234551 -> -1.111111111111111111111111111112346 Rounded Inexact
+
+rounding: half_even
+
+-- The 'baddies' tests from DiagBigDecimal, plus some new ones
+dqbas500 toSci '1..2' -> NaN Conversion_syntax
+dqbas501 toSci '.' -> NaN Conversion_syntax
+dqbas502 toSci '..' -> NaN Conversion_syntax
+dqbas503 toSci '++1' -> NaN Conversion_syntax
+dqbas504 toSci '--1' -> NaN Conversion_syntax
+dqbas505 toSci '-+1' -> NaN Conversion_syntax
+dqbas506 toSci '+-1' -> NaN Conversion_syntax
+dqbas507 toSci '12e' -> NaN Conversion_syntax
+dqbas508 toSci '12e++' -> NaN Conversion_syntax
+dqbas509 toSci '12f4' -> NaN Conversion_syntax
+dqbas510 toSci ' +1' -> NaN Conversion_syntax
+dqbas511 toSci '+ 1' -> NaN Conversion_syntax
+dqbas512 toSci '12 ' -> NaN Conversion_syntax
+dqbas513 toSci ' + 1' -> NaN Conversion_syntax
+dqbas514 toSci ' - 1 ' -> NaN Conversion_syntax
+dqbas515 toSci 'x' -> NaN Conversion_syntax
+dqbas516 toSci '-1-' -> NaN Conversion_syntax
+dqbas517 toSci '12-' -> NaN Conversion_syntax
+dqbas518 toSci '3+' -> NaN Conversion_syntax
+dqbas519 toSci '' -> NaN Conversion_syntax
+dqbas520 toSci '1e-' -> NaN Conversion_syntax
+dqbas521 toSci '7e99999a' -> NaN Conversion_syntax
+dqbas522 toSci '7e123567890x' -> NaN Conversion_syntax
+dqbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
+dqbas524 toSci '' -> NaN Conversion_syntax
+dqbas525 toSci 'e100' -> NaN Conversion_syntax
+dqbas526 toSci '\u0e5a' -> NaN Conversion_syntax
+dqbas527 toSci '\u0b65' -> NaN Conversion_syntax
+dqbas528 toSci '123,65' -> NaN Conversion_syntax
+dqbas529 toSci '1.34.5' -> NaN Conversion_syntax
+dqbas530 toSci '.123.5' -> NaN Conversion_syntax
+dqbas531 toSci '01.35.' -> NaN Conversion_syntax
+dqbas532 toSci '01.35-' -> NaN Conversion_syntax
+dqbas533 toSci '0000..' -> NaN Conversion_syntax
+dqbas534 toSci '.0000.' -> NaN Conversion_syntax
+dqbas535 toSci '00..00' -> NaN Conversion_syntax
+dqbas536 toSci '111e*123' -> NaN Conversion_syntax
+dqbas537 toSci '111e123-' -> NaN Conversion_syntax
+dqbas538 toSci '111e+12+' -> NaN Conversion_syntax
+dqbas539 toSci '111e1-3-' -> NaN Conversion_syntax
+dqbas540 toSci '111e1*23' -> NaN Conversion_syntax
+dqbas541 toSci '111e1e+3' -> NaN Conversion_syntax
+dqbas542 toSci '1e1.0' -> NaN Conversion_syntax
+dqbas543 toSci '1e123e' -> NaN Conversion_syntax
+dqbas544 toSci 'ten' -> NaN Conversion_syntax
+dqbas545 toSci 'ONE' -> NaN Conversion_syntax
+dqbas546 toSci '1e.1' -> NaN Conversion_syntax
+dqbas547 toSci '1e1.' -> NaN Conversion_syntax
+dqbas548 toSci '1ee' -> NaN Conversion_syntax
+dqbas549 toSci 'e+1' -> NaN Conversion_syntax
+dqbas550 toSci '1.23.4' -> NaN Conversion_syntax
+dqbas551 toSci '1.2.1' -> NaN Conversion_syntax
+dqbas552 toSci '1E+1.2' -> NaN Conversion_syntax
+dqbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
+dqbas554 toSci '1E++1' -> NaN Conversion_syntax
+dqbas555 toSci '1E--1' -> NaN Conversion_syntax
+dqbas556 toSci '1E+-1' -> NaN Conversion_syntax
+dqbas557 toSci '1E-+1' -> NaN Conversion_syntax
+dqbas558 toSci '1E''1' -> NaN Conversion_syntax
+dqbas559 toSci "1E""1" -> NaN Conversion_syntax
+dqbas560 toSci "1E""""" -> NaN Conversion_syntax
+-- Near-specials
+dqbas561 toSci "qNaN" -> NaN Conversion_syntax
+dqbas562 toSci "NaNq" -> NaN Conversion_syntax
+dqbas563 toSci "NaNs" -> NaN Conversion_syntax
+dqbas564 toSci "Infi" -> NaN Conversion_syntax
+dqbas565 toSci "Infin" -> NaN Conversion_syntax
+dqbas566 toSci "Infini" -> NaN Conversion_syntax
+dqbas567 toSci "Infinit" -> NaN Conversion_syntax
+dqbas568 toSci "-Infinit" -> NaN Conversion_syntax
+dqbas569 toSci "0Inf" -> NaN Conversion_syntax
+dqbas570 toSci "9Inf" -> NaN Conversion_syntax
+dqbas571 toSci "-0Inf" -> NaN Conversion_syntax
+dqbas572 toSci "-9Inf" -> NaN Conversion_syntax
+dqbas573 toSci "-sNa" -> NaN Conversion_syntax
+dqbas574 toSci "xNaN" -> NaN Conversion_syntax
+dqbas575 toSci "0sNaN" -> NaN Conversion_syntax
+
+-- some baddies with dots and Es and dots and specials
+dqbas576 toSci 'e+1' -> NaN Conversion_syntax
+dqbas577 toSci '.e+1' -> NaN Conversion_syntax
+dqbas578 toSci '+.e+1' -> NaN Conversion_syntax
+dqbas579 toSci '-.e+' -> NaN Conversion_syntax
+dqbas580 toSci '-.e' -> NaN Conversion_syntax
+dqbas581 toSci 'E+1' -> NaN Conversion_syntax
+dqbas582 toSci '.E+1' -> NaN Conversion_syntax
+dqbas583 toSci '+.E+1' -> NaN Conversion_syntax
+dqbas584 toSci '-.E+' -> NaN Conversion_syntax
+dqbas585 toSci '-.E' -> NaN Conversion_syntax
+
+dqbas586 toSci '.NaN' -> NaN Conversion_syntax
+dqbas587 toSci '-.NaN' -> NaN Conversion_syntax
+dqbas588 toSci '+.sNaN' -> NaN Conversion_syntax
+dqbas589 toSci '+.Inf' -> NaN Conversion_syntax
+dqbas590 toSci '.Infinity' -> NaN Conversion_syntax
+
+-- Zeros
+dqbas601 toSci 0.000000000 -> 0E-9
+dqbas602 toSci 0.00000000 -> 0E-8
+dqbas603 toSci 0.0000000 -> 0E-7
+dqbas604 toSci 0.000000 -> 0.000000
+dqbas605 toSci 0.00000 -> 0.00000
+dqbas606 toSci 0.0000 -> 0.0000
+dqbas607 toSci 0.000 -> 0.000
+dqbas608 toSci 0.00 -> 0.00
+dqbas609 toSci 0.0 -> 0.0
+dqbas610 toSci .0 -> 0.0
+dqbas611 toSci 0. -> 0
+dqbas612 toSci -.0 -> -0.0
+dqbas613 toSci -0. -> -0
+dqbas614 toSci -0.0 -> -0.0
+dqbas615 toSci -0.00 -> -0.00
+dqbas616 toSci -0.000 -> -0.000
+dqbas617 toSci -0.0000 -> -0.0000
+dqbas618 toSci -0.00000 -> -0.00000
+dqbas619 toSci -0.000000 -> -0.000000
+dqbas620 toSci -0.0000000 -> -0E-7
+dqbas621 toSci -0.00000000 -> -0E-8
+dqbas622 toSci -0.000000000 -> -0E-9
+
+dqbas630 toSci 0.00E+0 -> 0.00
+dqbas631 toSci 0.00E+1 -> 0.0
+dqbas632 toSci 0.00E+2 -> 0
+dqbas633 toSci 0.00E+3 -> 0E+1
+dqbas634 toSci 0.00E+4 -> 0E+2
+dqbas635 toSci 0.00E+5 -> 0E+3
+dqbas636 toSci 0.00E+6 -> 0E+4
+dqbas637 toSci 0.00E+7 -> 0E+5
+dqbas638 toSci 0.00E+8 -> 0E+6
+dqbas639 toSci 0.00E+9 -> 0E+7
+
+dqbas640 toSci 0.0E+0 -> 0.0
+dqbas641 toSci 0.0E+1 -> 0
+dqbas642 toSci 0.0E+2 -> 0E+1
+dqbas643 toSci 0.0E+3 -> 0E+2
+dqbas644 toSci 0.0E+4 -> 0E+3
+dqbas645 toSci 0.0E+5 -> 0E+4
+dqbas646 toSci 0.0E+6 -> 0E+5
+dqbas647 toSci 0.0E+7 -> 0E+6
+dqbas648 toSci 0.0E+8 -> 0E+7
+dqbas649 toSci 0.0E+9 -> 0E+8
+
+dqbas650 toSci 0E+0 -> 0
+dqbas651 toSci 0E+1 -> 0E+1
+dqbas652 toSci 0E+2 -> 0E+2
+dqbas653 toSci 0E+3 -> 0E+3
+dqbas654 toSci 0E+4 -> 0E+4
+dqbas655 toSci 0E+5 -> 0E+5
+dqbas656 toSci 0E+6 -> 0E+6
+dqbas657 toSci 0E+7 -> 0E+7
+dqbas658 toSci 0E+8 -> 0E+8
+dqbas659 toSci 0E+9 -> 0E+9
+
+dqbas660 toSci 0.0E-0 -> 0.0
+dqbas661 toSci 0.0E-1 -> 0.00
+dqbas662 toSci 0.0E-2 -> 0.000
+dqbas663 toSci 0.0E-3 -> 0.0000
+dqbas664 toSci 0.0E-4 -> 0.00000
+dqbas665 toSci 0.0E-5 -> 0.000000
+dqbas666 toSci 0.0E-6 -> 0E-7
+dqbas667 toSci 0.0E-7 -> 0E-8
+dqbas668 toSci 0.0E-8 -> 0E-9
+dqbas669 toSci 0.0E-9 -> 0E-10
+
+dqbas670 toSci 0.00E-0 -> 0.00
+dqbas671 toSci 0.00E-1 -> 0.000
+dqbas672 toSci 0.00E-2 -> 0.0000
+dqbas673 toSci 0.00E-3 -> 0.00000
+dqbas674 toSci 0.00E-4 -> 0.000000
+dqbas675 toSci 0.00E-5 -> 0E-7
+dqbas676 toSci 0.00E-6 -> 0E-8
+dqbas677 toSci 0.00E-7 -> 0E-9
+dqbas678 toSci 0.00E-8 -> 0E-10
+dqbas679 toSci 0.00E-9 -> 0E-11
+
+dqbas680 toSci 000000. -> 0
+dqbas681 toSci 00000. -> 0
+dqbas682 toSci 0000. -> 0
+dqbas683 toSci 000. -> 0
+dqbas684 toSci 00. -> 0
+dqbas685 toSci 0. -> 0
+dqbas686 toSci +00000. -> 0
+dqbas687 toSci -00000. -> -0
+dqbas688 toSci +0. -> 0
+dqbas689 toSci -0. -> -0
+
+-- Specials
+dqbas700 toSci "NaN" -> NaN
+dqbas701 toSci "nan" -> NaN
+dqbas702 toSci "nAn" -> NaN
+dqbas703 toSci "NAN" -> NaN
+dqbas704 toSci "+NaN" -> NaN
+dqbas705 toSci "+nan" -> NaN
+dqbas706 toSci "+nAn" -> NaN
+dqbas707 toSci "+NAN" -> NaN
+dqbas708 toSci "-NaN" -> -NaN
+dqbas709 toSci "-nan" -> -NaN
+dqbas710 toSci "-nAn" -> -NaN
+dqbas711 toSci "-NAN" -> -NaN
+dqbas712 toSci 'NaN0' -> NaN
+dqbas713 toSci 'NaN1' -> NaN1
+dqbas714 toSci 'NaN12' -> NaN12
+dqbas715 toSci 'NaN123' -> NaN123
+dqbas716 toSci 'NaN1234' -> NaN1234
+dqbas717 toSci 'NaN01' -> NaN1
+dqbas718 toSci 'NaN012' -> NaN12
+dqbas719 toSci 'NaN0123' -> NaN123
+dqbas720 toSci 'NaN01234' -> NaN1234
+dqbas721 toSci 'NaN001' -> NaN1
+dqbas722 toSci 'NaN0012' -> NaN12
+dqbas723 toSci 'NaN00123' -> NaN123
+dqbas724 toSci 'NaN001234' -> NaN1234
+dqbas725 toSci 'NaN1234567890123456781234567890123456' -> NaN Conversion_syntax
+dqbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
+dqbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
+dqbas728 toSci 'NaN-12' -> NaN Conversion_syntax
+dqbas729 toSci 'NaN+12' -> NaN Conversion_syntax
+
+dqbas730 toSci "sNaN" -> sNaN
+dqbas731 toSci "snan" -> sNaN
+dqbas732 toSci "SnAn" -> sNaN
+dqbas733 toSci "SNAN" -> sNaN
+dqbas734 toSci "+sNaN" -> sNaN
+dqbas735 toSci "+snan" -> sNaN
+dqbas736 toSci "+SnAn" -> sNaN
+dqbas737 toSci "+SNAN" -> sNaN
+dqbas738 toSci "-sNaN" -> -sNaN
+dqbas739 toSci "-snan" -> -sNaN
+dqbas740 toSci "-SnAn" -> -sNaN
+dqbas741 toSci "-SNAN" -> -sNaN
+dqbas742 toSci 'sNaN0000' -> sNaN
+dqbas743 toSci 'sNaN7' -> sNaN7
+dqbas744 toSci 'sNaN007234' -> sNaN7234
+dqbas745 toSci 'sNaN1234567890123456787234561234567890' -> NaN Conversion_syntax
+dqbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
+dqbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
+
+dqbas748 toSci "Inf" -> Infinity
+dqbas749 toSci "inf" -> Infinity
+dqbas750 toSci "iNf" -> Infinity
+dqbas751 toSci "INF" -> Infinity
+dqbas752 toSci "+Inf" -> Infinity
+dqbas753 toSci "+inf" -> Infinity
+dqbas754 toSci "+iNf" -> Infinity
+dqbas755 toSci "+INF" -> Infinity
+dqbas756 toSci "-Inf" -> -Infinity
+dqbas757 toSci "-inf" -> -Infinity
+dqbas758 toSci "-iNf" -> -Infinity
+dqbas759 toSci "-INF" -> -Infinity
+
+dqbas760 toSci "Infinity" -> Infinity
+dqbas761 toSci "infinity" -> Infinity
+dqbas762 toSci "iNfInItY" -> Infinity
+dqbas763 toSci "INFINITY" -> Infinity
+dqbas764 toSci "+Infinity" -> Infinity
+dqbas765 toSci "+infinity" -> Infinity
+dqbas766 toSci "+iNfInItY" -> Infinity
+dqbas767 toSci "+INFINITY" -> Infinity
+dqbas768 toSci "-Infinity" -> -Infinity
+dqbas769 toSci "-infinity" -> -Infinity
+dqbas770 toSci "-iNfInItY" -> -Infinity
+dqbas771 toSci "-INFINITY" -> -Infinity
+
+-- Specials and zeros for toEng
+dqbast772 toEng "NaN" -> NaN
+dqbast773 toEng "-Infinity" -> -Infinity
+dqbast774 toEng "-sNaN" -> -sNaN
+dqbast775 toEng "-NaN" -> -NaN
+dqbast776 toEng "+Infinity" -> Infinity
+dqbast778 toEng "+sNaN" -> sNaN
+dqbast779 toEng "+NaN" -> NaN
+dqbast780 toEng "INFINITY" -> Infinity
+dqbast781 toEng "SNAN" -> sNaN
+dqbast782 toEng "NAN" -> NaN
+dqbast783 toEng "infinity" -> Infinity
+dqbast784 toEng "snan" -> sNaN
+dqbast785 toEng "nan" -> NaN
+dqbast786 toEng "InFINITY" -> Infinity
+dqbast787 toEng "SnAN" -> sNaN
+dqbast788 toEng "nAN" -> NaN
+dqbast789 toEng "iNfinity" -> Infinity
+dqbast790 toEng "sNan" -> sNaN
+dqbast791 toEng "Nan" -> NaN
+dqbast792 toEng "Infinity" -> Infinity
+dqbast793 toEng "sNaN" -> sNaN
+
+-- Zero toEng, etc.
+dqbast800 toEng 0e+1 -> "0.00E+3" -- doc example
+
+dqbast801 toEng 0.000000000 -> 0E-9
+dqbast802 toEng 0.00000000 -> 0.00E-6
+dqbast803 toEng 0.0000000 -> 0.0E-6
+dqbast804 toEng 0.000000 -> 0.000000
+dqbast805 toEng 0.00000 -> 0.00000
+dqbast806 toEng 0.0000 -> 0.0000
+dqbast807 toEng 0.000 -> 0.000
+dqbast808 toEng 0.00 -> 0.00
+dqbast809 toEng 0.0 -> 0.0
+dqbast810 toEng .0 -> 0.0
+dqbast811 toEng 0. -> 0
+dqbast812 toEng -.0 -> -0.0
+dqbast813 toEng -0. -> -0
+dqbast814 toEng -0.0 -> -0.0
+dqbast815 toEng -0.00 -> -0.00
+dqbast816 toEng -0.000 -> -0.000
+dqbast817 toEng -0.0000 -> -0.0000
+dqbast818 toEng -0.00000 -> -0.00000
+dqbast819 toEng -0.000000 -> -0.000000
+dqbast820 toEng -0.0000000 -> -0.0E-6
+dqbast821 toEng -0.00000000 -> -0.00E-6
+dqbast822 toEng -0.000000000 -> -0E-9
+
+dqbast830 toEng 0.00E+0 -> 0.00
+dqbast831 toEng 0.00E+1 -> 0.0
+dqbast832 toEng 0.00E+2 -> 0
+dqbast833 toEng 0.00E+3 -> 0.00E+3
+dqbast834 toEng 0.00E+4 -> 0.0E+3
+dqbast835 toEng 0.00E+5 -> 0E+3
+dqbast836 toEng 0.00E+6 -> 0.00E+6
+dqbast837 toEng 0.00E+7 -> 0.0E+6
+dqbast838 toEng 0.00E+8 -> 0E+6
+dqbast839 toEng 0.00E+9 -> 0.00E+9
+
+dqbast840 toEng 0.0E+0 -> 0.0
+dqbast841 toEng 0.0E+1 -> 0
+dqbast842 toEng 0.0E+2 -> 0.00E+3
+dqbast843 toEng 0.0E+3 -> 0.0E+3
+dqbast844 toEng 0.0E+4 -> 0E+3
+dqbast845 toEng 0.0E+5 -> 0.00E+6
+dqbast846 toEng 0.0E+6 -> 0.0E+6
+dqbast847 toEng 0.0E+7 -> 0E+6
+dqbast848 toEng 0.0E+8 -> 0.00E+9
+dqbast849 toEng 0.0E+9 -> 0.0E+9
+
+dqbast850 toEng 0E+0 -> 0
+dqbast851 toEng 0E+1 -> 0.00E+3
+dqbast852 toEng 0E+2 -> 0.0E+3
+dqbast853 toEng 0E+3 -> 0E+3
+dqbast854 toEng 0E+4 -> 0.00E+6
+dqbast855 toEng 0E+5 -> 0.0E+6
+dqbast856 toEng 0E+6 -> 0E+6
+dqbast857 toEng 0E+7 -> 0.00E+9
+dqbast858 toEng 0E+8 -> 0.0E+9
+dqbast859 toEng 0E+9 -> 0E+9
+
+dqbast860 toEng 0.0E-0 -> 0.0
+dqbast861 toEng 0.0E-1 -> 0.00
+dqbast862 toEng 0.0E-2 -> 0.000
+dqbast863 toEng 0.0E-3 -> 0.0000
+dqbast864 toEng 0.0E-4 -> 0.00000
+dqbast865 toEng 0.0E-5 -> 0.000000
+dqbast866 toEng 0.0E-6 -> 0.0E-6
+dqbast867 toEng 0.0E-7 -> 0.00E-6
+dqbast868 toEng 0.0E-8 -> 0E-9
+dqbast869 toEng 0.0E-9 -> 0.0E-9
+
+dqbast870 toEng 0.00E-0 -> 0.00
+dqbast871 toEng 0.00E-1 -> 0.000
+dqbast872 toEng 0.00E-2 -> 0.0000
+dqbast873 toEng 0.00E-3 -> 0.00000
+dqbast874 toEng 0.00E-4 -> 0.000000
+dqbast875 toEng 0.00E-5 -> 0.0E-6
+dqbast876 toEng 0.00E-6 -> 0.00E-6
+dqbast877 toEng 0.00E-7 -> 0E-9
+dqbast878 toEng 0.00E-8 -> 0.0E-9
+dqbast879 toEng 0.00E-9 -> 0.00E-9
+
+-- long input strings
+dqbas801 tosci '01234567890123456' -> 1234567890123456
+dqbas802 tosci '001234567890123456' -> 1234567890123456
+dqbas803 tosci '0001234567890123456' -> 1234567890123456
+dqbas804 tosci '00001234567890123456' -> 1234567890123456
+dqbas805 tosci '000001234567890123456' -> 1234567890123456
+dqbas806 tosci '0000001234567890123456' -> 1234567890123456
+dqbas807 tosci '00000001234567890123456' -> 1234567890123456
+dqbas808 tosci '000000001234567890123456' -> 1234567890123456
+dqbas809 tosci '0000000001234567890123456' -> 1234567890123456
+dqbas810 tosci '00000000001234567890123456' -> 1234567890123456
+
+dqbas811 tosci '0.1234567890123456' -> 0.1234567890123456
+dqbas812 tosci '0.01234567890123456' -> 0.01234567890123456
+dqbas813 tosci '0.001234567890123456' -> 0.001234567890123456
+dqbas814 tosci '0.0001234567890123456' -> 0.0001234567890123456
+dqbas815 tosci '0.00001234567890123456' -> 0.00001234567890123456
+dqbas816 tosci '0.000001234567890123456' -> 0.000001234567890123456
+dqbas817 tosci '0.0000001234567890123456' -> 1.234567890123456E-7
+dqbas818 tosci '0.00000001234567890123456' -> 1.234567890123456E-8
+dqbas819 tosci '0.000000001234567890123456' -> 1.234567890123456E-9
+dqbas820 tosci '0.0000000001234567890123456' -> 1.234567890123456E-10
+
+dqbas821 tosci '12345678912345678901234567801234567890' -> 1.234567891234567890123456780123457E+37 Inexact Rounded
+dqbas822 tosci '123456789123456789012345678012345678901' -> 1.234567891234567890123456780123457E+38 Inexact Rounded
+dqbas823 tosci '1234567891234567890123456780123456789012' -> 1.234567891234567890123456780123457E+39 Inexact Rounded
+dqbas824 tosci '12345678912345678901234567801234567890123' -> 1.234567891234567890123456780123457E+40 Inexact Rounded
+dqbas825 tosci '123456789123456789012345678012345678901234' -> 1.234567891234567890123456780123457E+41 Inexact Rounded
+dqbas826 tosci '1234567891234567890123456780123456789012345' -> 1.234567891234567890123456780123457E+42 Inexact Rounded
+dqbas827 tosci '12345678912345678901234567801234567890123456' -> 1.234567891234567890123456780123457E+43 Inexact Rounded
+dqbas828 tosci '123456789123456789012345678012345678901234567' -> 1.234567891234567890123456780123457E+44 Inexact Rounded
+dqbas829 tosci '1234567891234567890123456780123456789012345678' -> 1.234567891234567890123456780123457E+45 Inexact Rounded
+
+-- subnormals and overflows
+dqbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
+dqbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
+dqbas908 toSci '0.9e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas909 toSci '0.09e-999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
+dqbas911 toSci '10e-1000000000' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
+dqbas913 toSci '99e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
+dqbas915 toSci '1111e-9999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas916 toSci '1111e-99999999999' -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
+-- negatives the same
+dqbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
+dqbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
+dqbas920 toSci '-0.9e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas921 toSci '-0.09e-999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
+dqbas923 toSci '-10e-1000000000' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
+dqbas925 toSci '-99e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
+dqbas927 toSci '-1111e-9999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas928 toSci '-1111e-99999999999' -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
+
+-- overflow results at different rounding modes
+rounding: ceiling
+dqbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas931 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+rounding: up
+dqbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: down
+dqbas934 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqbas935 toSci '-7e10000' -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+rounding: floor
+dqbas936 toSci '7e10000' -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_up
+dqbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_even
+dqbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_down
+dqbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dqbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_even
+
+-- Now check 854/754r some subnormals and underflow to 0
+dqbem400 toSci 1.0000E-383 -> 1.0000E-383
+dqbem401 toSci 0.1E-6172 -> 1E-6173 Subnormal
+dqbem402 toSci 0.1000E-6172 -> 1.000E-6173 Subnormal
+dqbem403 toSci 0.0100E-6172 -> 1.00E-6174 Subnormal
+dqbem404 toSci 0.0010E-6172 -> 1.0E-6175 Subnormal
+dqbem405 toSci 0.0001E-6172 -> 1E-6176 Subnormal
+dqbem406 toSci 0.00010E-6172 -> 1E-6176 Subnormal Rounded
+dqbem407 toSci 0.00013E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqbem408 toSci 0.00015E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem409 toSci 0.00017E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem410 toSci 0.00023E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem411 toSci 0.00025E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem412 toSci 0.00027E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqbem413 toSci 0.000149E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqbem414 toSci 0.000150E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem415 toSci 0.000151E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem416 toSci 0.000249E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem417 toSci 0.000250E-6172 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqbem418 toSci 0.000251E-6172 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqbem419 toSci 0.00009E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqbem420 toSci 0.00005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem421 toSci 0.00003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem422 toSci 0.000009E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem423 toSci 0.000005E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem424 toSci 0.000003E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqbem425 toSci 0.001049E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
+dqbem426 toSci 0.001050E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
+dqbem427 toSci 0.001051E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded
+dqbem428 toSci 0.001149E-6172 -> 1.1E-6175 Underflow Subnormal Inexact Rounded
+dqbem429 toSci 0.001150E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded
+dqbem430 toSci 0.001151E-6172 -> 1.2E-6175 Underflow Subnormal Inexact Rounded
+
+dqbem432 toSci 0.010049E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
+dqbem433 toSci 0.010050E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
+dqbem434 toSci 0.010051E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded
+dqbem435 toSci 0.010149E-6172 -> 1.01E-6174 Underflow Subnormal Inexact Rounded
+dqbem436 toSci 0.010150E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded
+dqbem437 toSci 0.010151E-6172 -> 1.02E-6174 Underflow Subnormal Inexact Rounded
+
+dqbem440 toSci 0.10103E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded
+dqbem441 toSci 0.10105E-6172 -> 1.010E-6173 Underflow Subnormal Inexact Rounded
+dqbem442 toSci 0.10107E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded
+dqbem443 toSci 0.10113E-6172 -> 1.011E-6173 Underflow Subnormal Inexact Rounded
+dqbem444 toSci 0.10115E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded
+dqbem445 toSci 0.10117E-6172 -> 1.012E-6173 Underflow Subnormal Inexact Rounded
+
+dqbem450 toSci 1.10730E-6173 -> 1.107E-6173 Underflow Subnormal Inexact Rounded
+dqbem451 toSci 1.10750E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
+dqbem452 toSci 1.10770E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
+dqbem453 toSci 1.10830E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
+dqbem454 toSci 1.10850E-6173 -> 1.108E-6173 Underflow Subnormal Inexact Rounded
+dqbem455 toSci 1.10870E-6173 -> 1.109E-6173 Underflow Subnormal Inexact Rounded
+
+-- make sure sign OK
+dqbem456 toSci -0.10103E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded
+dqbem457 toSci -0.10105E-6172 -> -1.010E-6173 Underflow Subnormal Inexact Rounded
+dqbem458 toSci -0.10107E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded
+dqbem459 toSci -0.10113E-6172 -> -1.011E-6173 Underflow Subnormal Inexact Rounded
+dqbem460 toSci -0.10115E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded
+dqbem461 toSci -0.10117E-6172 -> -1.012E-6173 Underflow Subnormal Inexact Rounded
+
+-- '999s' cases
+dqbem464 toSci 999999E-6173 -> 9.99999E-6168 Subnormal
+dqbem465 toSci 99999.0E-6172 -> 9.99990E-6168 Subnormal
+dqbem466 toSci 99999.E-6172 -> 9.9999E-6168 Subnormal
+dqbem467 toSci 9999.9E-6172 -> 9.9999E-6169 Subnormal
+dqbem468 toSci 999.99E-6172 -> 9.9999E-6170 Subnormal
+dqbem469 toSci 99.999E-6172 -> 9.9999E-6171 Subnormal
+dqbem470 toSci 9.9999E-6172 -> 9.9999E-6172 Subnormal
+dqbem471 toSci 0.99999E-6172 -> 1.0000E-6172 Underflow Subnormal Inexact Rounded
+dqbem472 toSci 0.099999E-6172 -> 1.000E-6173 Underflow Subnormal Inexact Rounded
+dqbem473 toSci 0.0099999E-6172 -> 1.00E-6174 Underflow Subnormal Inexact Rounded
+dqbem474 toSci 0.00099999E-6172 -> 1.0E-6175 Underflow Subnormal Inexact Rounded
+dqbem475 toSci 0.000099999E-6172 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqbem476 toSci 0.0000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem477 toSci 0.00000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbem478 toSci 0.000000099999E-6172 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- Exponents with insignificant leading zeros
+dqbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
+dqbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
+dqbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
+dqbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
+dqbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
+dqbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
+dqbas1007 toSci 1e-999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1008 toSci 1e-0999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1009 toSci 1e-00999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1010 toSci 1e-000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1011 toSci 1e-000000000000999999999 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqbas1012 toSci 1e-000000000001000000007 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- check for double-rounded subnormals
+dqbas1041 toSci 1.1111111111111111111111111111152444E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
+dqbas1042 toSci 1.1111111111111111111111111111152445E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
+dqbas1043 toSci 1.1111111111111111111111111111152446E-6144 -> 1.11111111111111111111111111111524E-6144 Inexact Rounded Subnormal Underflow
+
+-- clamped zeros [see also clamp.decTest]
+dqbas1075 toSci 0e+10000 -> 0E+6111 Clamped
+dqbas1076 toSci 0e-10000 -> 0E-6176 Clamped
+dqbas1077 toSci -0e+10000 -> -0E+6111 Clamped
+dqbas1078 toSci -0e-10000 -> -0E-6176 Clamped
+
+-- extreme values from next-wider
+dqbas1101 toSci -9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> -Infinity Overflow Inexact Rounded
+dqbas1102 toSci -1E-1572863 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped
+dqbas1103 toSci -1E-1572932 -> -0E-6176 Inexact Rounded Subnormal Underflow Clamped
+dqbas1104 toSci -0 -> -0
+dqbas1105 toSci +0 -> 0
+dqbas1106 toSci +1E-1572932 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped
+dqbas1107 toSci +1E-1572863 -> 0E-6176 Inexact Rounded Subnormal Underflow Clamped
+dqbas1108 toSci +9.9999999999999999999999999999999999999999999999999999999999999999999E+1572864 -> Infinity Overflow Inexact Rounded
+
diff --git a/Lib/test/decimaltestdata/dqCanonical.decTest b/Lib/test/decimaltestdata/dqCanonical.decTest
index 3ddf6eab2d..006db8595c 100644
--- a/Lib/test/decimaltestdata/dqCanonical.decTest
+++ b/Lib/test/decimaltestdata/dqCanonical.decTest
@@ -1,372 +1,372 @@
-------------------------------------------------------------------------
--- dqCanonical.decTest -- test decQuad canonical results --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests that copy operations leave uncanonical operands
--- unchanged, and vice versa
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Uncanonical declets are: abc, where:
--- a=1,2,3
--- b=6,7,e,f
--- c=e,f
-
--- assert some standard (canonical) values; this tests that FromString
--- produces canonical results (many more in decimalNN)
-dqcan001 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan002 apply 0 -> #22080000000000000000000000000000
-dqcan003 apply 1 -> #22080000000000000000000000000001
-dqcan004 apply -1 -> #a2080000000000000000000000000001
-dqcan005 apply Infinity -> #78000000000000000000000000000000
-dqcan006 apply -Infinity -> #f8000000000000000000000000000000
-dqcan007 apply -NaN -> #fc000000000000000000000000000000
-dqcan008 apply -sNaN -> #fe000000000000000000000000000000
-dqcan009 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan010 apply sNaN999999999999999999999999999999999 -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-decan011 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff
-dqcan012 apply 7.50 -> #220780000000000000000000000003d0
-dqcan013 apply 9.99 -> #220780000000000000000000000000ff
-
--- Base tests for canonical encodings (individual operator
--- propagation is tested later)
-
--- Finites: declets in coefficient
-dqcan021 canonical #77ffcff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan022 canonical #77fffff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan023 canonical #77ffcffffcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan024 canonical #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan025 canonical #77ffcff3fcffffcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan026 canonical #77ffcff3fcff3ffff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan027 canonical #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan028 canonical #77ffcff3fcff3fcff3ffff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan029 canonical #77ffcff3fcff3fcff3fcffffcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan030 canonical #77ffcff3fcff3fcff3fcff3ffff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan031 canonical #77ffcff3fcff3fcff3fcff3fcffffcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan032 canonical #77ffcff3fcff3fcff3fcff3fcff3ffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-
--- NaN: declets in payload
-dqcan061 canonical #7c000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan062 canonical #7c000ffffcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan063 canonical #7c000ff3ffff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan064 canonical #7c000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan065 canonical #7c000ff3fcff3ffff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan066 canonical #7c000ff3fcff3fcffffcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan067 canonical #7c000ff3fcff3fcff3ffff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan068 canonical #7c000ff3fcff3fcff3fcffffcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan069 canonical #7c000ff3fcff3fcff3fcff3ffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan070 canonical #7c000ff3fcff3fcff3fcff3fcffffcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan071 canonical #7c000ff3fcff3fcff3fcff3fcff3ffff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-dqcan081 canonical #7d000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan082 canonical #7c800ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan083 canonical #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan084 canonical #7c200ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan085 canonical #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan086 canonical #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan087 canonical #7c040ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan088 canonical #7c020ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan089 canonical #7c010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan090 canonical #7c008ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan091 canonical #7c004ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-
--- sNaN: declets in payload
-dqcan101 canonical #7e000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan102 canonical #7e000ffffcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan103 canonical #7e000ff3ffff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan104 canonical #7e000ff3fcffffcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan105 canonical #7e000ff3fcff3ffff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan106 canonical #7e000ff3fcff3fcffffcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan107 canonical #7e000ff3fcff3fcff3ffff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan108 canonical #7e000ff3fcff3fcff3fcffffcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan109 canonical #7e000ff3fcff3fcff3fcff3ffff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan100 canonical #7e000ff3fcff3fcff3fcff3fcffffcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan111 canonical #7e000ff3fcff3fcff3fcff3fcff3ffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
--- sNaN: exponent continuation bits [excluding sNaN selector]
-dqcan121 canonical #7f000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan122 canonical #7e800ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan123 canonical #7e400ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan124 canonical #7e200ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan125 canonical #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan126 canonical #7e080ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan127 canonical #7e040ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan128 canonical #7e020ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan129 canonical #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan130 canonical #7e008ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-dqcan131 canonical #7e004ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-
--- Inf: exponent continuation bits
-dqcan137 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan138 canonical #79000000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan139 canonical #7a000000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan140 canonical #78800000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan141 canonical #78400000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan142 canonical #78200000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan143 canonical #78100000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan144 canonical #78080000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan145 canonical #78040000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan146 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan147 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan148 canonical #78008000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan149 canonical #78004000000000000000000000000000 -> #78000000000000000000000000000000
-
--- Inf: coefficient continuation bits (first, last, and a few others)
-dqcan150 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan151 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan152 canonical #78000000000000000000000000000001 -> #78000000000000000000000000000000
-dqcan153 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan154 canonical #78002000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan155 canonical #78000800000000000000000000000000 -> #78000000000000000000000000000000
-dqcan156 canonical #78000020000000000000000000000000 -> #78000000000000000000000000000000
-dqcan157 canonical #78000004000000000000000000000000 -> #78000000000000000000000000000000
-dqcan158 canonical #78000000400000000000000000000000 -> #78000000000000000000000000000000
-dqcan159 canonical #78000000080000000000000000000000 -> #78000000000000000000000000000000
-dqcan160 canonical #78000000004000000000000000000000 -> #78000000000000000000000000000000
-dqcan161 canonical #78000000000200000000000000000000 -> #78000000000000000000000000000000
-dqcan162 canonical #78000000000080000000000000000000 -> #78000000000000000000000000000000
-dqcan163 canonical #78000000000002000000000000000000 -> #78000000000000000000000000000000
-dqcan164 canonical #78000000000000400000000000000000 -> #78000000000000000000000000000000
-dqcan165 canonical #78000000000000080000000000000000 -> #78000000000000000000000000000000
-dqcan166 canonical #78000000000000001000000000000000 -> #78000000000000000000000000000000
-dqcan167 canonical #78000000000000000200000000000000 -> #78000000000000000000000000000000
-dqcan168 canonical #78000000000000000080000000000000 -> #78000000000000000000000000000000
-dqcan169 canonical #78000000000000000004000000000000 -> #78000000000000000000000000000000
-dqcan170 canonical #78000000000000000000400000000000 -> #78000000000000000000000000000000
-dqcan171 canonical #78000000000000000000010000000000 -> #78000000000000000000000000000000
-dqcan172 canonical #78000000000000000000002000000000 -> #78000000000000000000000000000000
-dqcan173 canonical #78000000000000000000000400000000 -> #78000000000000000000000000000000
-dqcan174 canonical #78000000000000000000000080000000 -> #78000000000000000000000000000000
-dqcan175 canonical #78000000000000000000000002000000 -> #78000000000000000000000000000000
-dqcan176 canonical #78000000000000000000000000400000 -> #78000000000000000000000000000000
-dqcan177 canonical #78000000000000000000000000020000 -> #78000000000000000000000000000000
-dqcan178 canonical #78000000000000000000000000001000 -> #78000000000000000000000000000000
-dqcan179 canonical #78000000000000000000000000000400 -> #78000000000000000000000000000000
-dqcan180 canonical #78000000000000000000000000000020 -> #78000000000000000000000000000000
-dqcan181 canonical #78000000000000000000000000000008 -> #78000000000000000000000000000000
-
-
--- Now the operators -- trying to check paths that might fail to
--- canonicalize propagated operands
-
------ Add:
--- Finites: neutral 0
-dqcan202 add 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan203 add #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
--- tiny zero
-dqcan204 add 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
-dqcan205 add #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
--- tiny non zero
-dqcan206 add -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
-dqcan207 add #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
--- NaN: declets in payload
-dqcan211 add 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan212 add #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-dqcan213 add 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan214 add #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- sNaN: declets in payload
-dqcan215 add 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan216 add #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-dqcan217 add 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan218 add #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-dqcan220 add 0 #78010000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan221 add #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
--- Inf: coefficient continuation bits
-dqcan222 add 0 #78002000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan223 add #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
-dqcan224 add 0 #78000002000000000000000000000000 -> #78000000000000000000000000000000
-dqcan225 add #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
-dqcan226 add 0 #78000000000000000005000000000000 -> #78000000000000000000000000000000
-dqcan227 add #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
-
------ Class: [does not return encoded]
-
------ Compare:
-dqcan231 compare -Inf 1 -> #a2080000000000000000000000000001
-dqcan232 compare -Inf -Inf -> #22080000000000000000000000000000
-dqcan233 compare 1 -Inf -> #22080000000000000000000000000001
-dqcan234 compare #7c010ff3fcff3fcff3fcff3ffffffcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan235 compare #7e004ff3fcff3fcff3ffffffcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-
------ CompareSig:
-dqcan241 comparesig -Inf 1 -> #a2080000000000000000000000000001
-dqcan242 comparesig -Inf -Inf -> #22080000000000000000000000000000
-dqcan243 comparesig 1 -Inf -> #22080000000000000000000000000001
-dqcan244 comparesig #7c400ff3ffff3fcff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan245 comparesig #7e050ff3fcfffffff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-
------ Copy: [does not usually canonicalize]
--- finites
-dqcan250 copy #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
-dqcan251 copy #ee080ff3fcff3ffff3fcff3ffff3fcff -> #ee080ff3fcff3ffff3fcff3ffff3fcff
--- NaNs
-dqcan252 copy #7c000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
-dqcan253 copy #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
--- sNaN
-dqcan254 copy #7e003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
-dqcan255 copy #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
--- Inf
-dqcan258 copy #78002000000000000000000000000000 -> #78002000000000000000000000000000
-dqcan259 copy #78000000000010000000000000100000 -> #78000000000010000000000000100000
-
------ CopyAbs: [does not usually canonicalize]
--- finites
-dqcan260 copyabs #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
-dqcan261 copyabs #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
--- NaNs
-dqcan262 copyabs #fc000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
-dqcan263 copyabs #fc080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
--- sNaN
-dqcan264 copyabs #fe003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
-dqcan265 copyabs #fe100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
--- Inf
-dqcan268 copyabs #f8002000000000000000000000000000 -> #78002000000000000000000000000000
-dqcan269 copyabs #f8000000000000700700700000000000 -> #78000000000000700700700000000000
-
------ CopyNegate: [does not usually canonicalize]
--- finites
-dqcan270 copynegate #6e080ff3fcff3fcfffffff3fcfffffff -> #ee080ff3fcff3fcfffffff3fcfffffff
-dqcan271 copynegate #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
--- NaNs
-dqcan272 copynegate #7c000ff3fcffffffffffff3fcff3fcff -> #fc000ff3fcffffffffffff3fcff3fcff
-dqcan273 copynegate #7c080ff3fcff3fcff3fcff3fcff3fcff -> #fc080ff3fcff3fcff3fcff3fcff3fcff
--- sNaN
-dqcan274 copynegate #7e003ff3fcffffffffffffffcff3fcff -> #fe003ff3fcffffffffffffffcff3fcff
-dqcan275 copynegate #7e100ff3fcff3fcff3fcff3fcff3fcff -> #fe100ff3fcff3fcff3fcff3fcff3fcff
--- Inf
-dqcan278 copynegate #78002000000000000000000000000000 -> #f8002000000000000000000000000000
-dqcan279 copynegate #78000000000010000000000000100000 -> #f8000000000010000000000000100000
-
------ CopySign: [does not usually canonicalize]
--- finites
-dqcan280 copysign #6e080ff3fcff3fcfffffff3fcfffffff -1 -> #ee080ff3fcff3fcfffffff3fcfffffff
-dqcan281 copysign #ee080ff3fcff3ffff3fcff3ffff3fcff 1 -> #6e080ff3fcff3ffff3fcff3ffff3fcff
--- NaNs
-dqcan282 copysign #7c000ff3fcffffffffffffffcff3fcff -1 -> #fc000ff3fcffffffffffffffcff3fcff
-dqcan283 copysign #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c080ff3fcff3fcff3fcff3fcff3fcff
--- sNaN
-dqcan284 copysign #7e003ff3fcffffffffffffffcff3fcff -1 -> #fe003ff3fcffffffffffffffcff3fcff
-dqcan285 copysign #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7e100ff3fcff3fcff3fcff3fcff3fcff
--- Inf
-dqcan288 copysign #78002000000000000000000000000000 -1 -> #f8002000000000000000000000000000
-dqcan289 copysign #78000000000010000000000000100000 1 -> #78000000000010000000000000100000
-
------ Multiply:
--- Finites: neutral 0
-dqcan302 multiply 1 #77ffff3fcff3fcff0000000000000000 -> #77ffff3fcff3fcff0000000000000000
-dqcan303 multiply #77fcffffcff3fcff0000000000000000 1 -> #77fccfffcff3fcff0000000000000000
--- negative
-dqcan306 multiply -1 #77ffff3fcff3fcff0000000000000000 -> #f7ffff3fcff3fcff0000000000000000
-dqcan307 multiply #77fcffffcff3fcff0000000000000000 -1 -> #f7fccfffcff3fcff0000000000000000
--- NaN: declets in payload
-dqcan311 multiply 1 #7c03ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
-dqcan312 multiply #7c03ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
--- NaN: exponent continuation bits [excluding sNaN selector]
-dqcan313 multiply 1 #7c40ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
-dqcan314 multiply #7c40ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
--- sNaN: declets in payload
-dqcan315 multiply 1 #7e00ffffcff3fcff0000000000000000 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
-dqcan316 multiply #7e00ffffcff3fcff0000000000000000 1 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-dqcan317 multiply 1 #7e80ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
-dqcan318 multiply #7e80ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
--- Inf: exponent continuation bits
-dqcan320 multiply 1 #78800000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan321 multiply #78800000000000000000000000000000 1 -> #78000000000000000000000000000000
--- Inf: coefficient continuation bits
-dqcan322 multiply 1 #78020000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan323 multiply #78020000000000000000000000000000 1 -> #78000000000000000000000000000000
-dqcan324 multiply 1 #78000000000000010000000000000000 -> #78000000000000000000000000000000
-dqcan325 multiply #78000000000000010000000000000000 1 -> #78000000000000000000000000000000
-dqcan326 multiply 1 #78000020000000000000000000000000 -> #78000000000000000000000000000000
-dqcan327 multiply #78000020000000000000000000000000 1 -> #78000000000000000000000000000000
-
------ Quantize:
-dqcan401 quantize #ee080ff3fcff3fcff3fffffffff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
-dqcan402 quantize #ee080ff3fffffffffffcff3fcff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
-dqcan403 quantize #78800000000000000000000000000000 Inf -> #78000000000000000000000000000000
-dqcan404 quantize #78020000000000000000000000000000 -Inf -> #78000000000000000000000000000000
-dqcan410 quantize #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan411 quantize #fc000ff3fcfffffff3fcff3fcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff
-dqcan412 quantize #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan413 quantize #fe000ff3fcff3fcff3ffffffcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-
------ Subtract:
--- Finites: neutral 0
-dqcan502 subtract 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
-dqcan503 subtract #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
--- tiny zero
-dqcan504 subtract 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Rounded
-dqcan505 subtract #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
--- tiny non zero
-dqcan506 subtract -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
-dqcan507 subtract #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
--- NaN: declets in payload
-dqcan511 subtract 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan512 subtract #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- NaN: exponent continuation bits [excluding sNaN selector]
-dqcan513 subtract 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan514 subtract #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
--- sNaN: declets in payload
-dqcan515 subtract 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan516 subtract #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- sNaN: exponent continuation bits [excluding sNaN selector]
-dqcan517 subtract 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan518 subtract #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- Inf: exponent continuation bits
-dqcan520 subtract 0 #78010000000000000000000000000000 -> #f8000000000000000000000000000000
-dqcan521 subtract #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
--- Inf: coefficient continuation bits
-dqcan522 subtract 0 #78002000000000000000000000000000 -> #f8000000000000000000000000000000
-dqcan523 subtract #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
-dqcan524 subtract 0 #78000002000000000000000000000000 -> #f8000000000000000000000000000000
-dqcan525 subtract #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
-dqcan526 subtract 0 #78000000000000000005000000000000 -> #f8000000000000000000000000000000
-dqcan527 subtract #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
-
------ ToIntegral:
-dqcan601 tointegralx #6e080ff3fdff3fcff3fcff3fcff3fcff -> #6e080ff3fcff3fcff3fcff3fcff3fcff
-dqcan602 tointegralx #ee080ff3fcff3ffff3fcff3fcff3fcff -> #ee080ff3fcff3fcff3fcff3fcff3fcff
-dqcan603 tointegralx #78800000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan604 tointegralx #78020000000000000000000000000000 -> #78000000000000000000000000000000
-dqcan614 tointegralx #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-dqcan615 tointegralx #fc000ff3fcff3fcff3fcffffcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff
-dqcan616 tointegralx #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
-dqcan617 tointegralx #fe000ff3fcff3fcff3fdff3fcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
--- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
-dqcan618 tointegralx #22080000000000000000000000000fff -> #22080000000000000000000000000cff
-dqcan619 tointegralx #22078000000000000000000000000fff -> #22080000000000000000000000000040 Inexact Rounded
-dqcan620 tointegralx #22074000000000000000000000000fff -> #22080000000000000000000000000004 Inexact Rounded
-dqcan621 tointegralx #22070000000000000000000000000fff -> #22080000000000000000000000000000 Inexact Rounded
-dqcan622 tointegralx #a2080000000000000000000000000fff -> #a2080000000000000000000000000cff
-dqcan623 tointegralx #a2078000000000000000000000000fff -> #a2080000000000000000000000000040 Inexact Rounded
-dqcan624 tointegralx #a2074000000000000000000000000fff -> #a2080000000000000000000000000004 Inexact Rounded
-dqcan625 tointegralx #a2070000000000000000000000000fff -> #a2080000000000000000000000000000 Inexact Rounded
-
-
-
+------------------------------------------------------------------------
+-- dqCanonical.decTest -- test decQuad canonical results --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests that copy operations leave uncanonical operands
+-- unchanged, and vice versa
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Uncanonical declets are: abc, where:
+-- a=1,2,3
+-- b=6,7,e,f
+-- c=e,f
+
+-- assert some standard (canonical) values; this tests that FromString
+-- produces canonical results (many more in decimalNN)
+dqcan001 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan002 apply 0 -> #22080000000000000000000000000000
+dqcan003 apply 1 -> #22080000000000000000000000000001
+dqcan004 apply -1 -> #a2080000000000000000000000000001
+dqcan005 apply Infinity -> #78000000000000000000000000000000
+dqcan006 apply -Infinity -> #f8000000000000000000000000000000
+dqcan007 apply -NaN -> #fc000000000000000000000000000000
+dqcan008 apply -sNaN -> #fe000000000000000000000000000000
+dqcan009 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan010 apply sNaN999999999999999999999999999999999 -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+decan011 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff
+dqcan012 apply 7.50 -> #220780000000000000000000000003d0
+dqcan013 apply 9.99 -> #220780000000000000000000000000ff
+
+-- Base tests for canonical encodings (individual operator
+-- propagation is tested later)
+
+-- Finites: declets in coefficient
+dqcan021 canonical #77ffcff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan022 canonical #77fffff3fcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan023 canonical #77ffcffffcff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan024 canonical #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan025 canonical #77ffcff3fcffffcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan026 canonical #77ffcff3fcff3ffff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan027 canonical #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan028 canonical #77ffcff3fcff3fcff3ffff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan029 canonical #77ffcff3fcff3fcff3fcffffcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan030 canonical #77ffcff3fcff3fcff3fcff3ffff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan031 canonical #77ffcff3fcff3fcff3fcff3fcffffcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan032 canonical #77ffcff3fcff3fcff3fcff3fcff3ffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+
+-- NaN: declets in payload
+dqcan061 canonical #7c000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan062 canonical #7c000ffffcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan063 canonical #7c000ff3ffff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan064 canonical #7c000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan065 canonical #7c000ff3fcff3ffff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan066 canonical #7c000ff3fcff3fcffffcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan067 canonical #7c000ff3fcff3fcff3ffff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan068 canonical #7c000ff3fcff3fcff3fcffffcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan069 canonical #7c000ff3fcff3fcff3fcff3ffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan070 canonical #7c000ff3fcff3fcff3fcff3fcffffcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan071 canonical #7c000ff3fcff3fcff3fcff3fcff3ffff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+dqcan081 canonical #7d000ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan082 canonical #7c800ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan083 canonical #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan084 canonical #7c200ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan085 canonical #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan086 canonical #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan087 canonical #7c040ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan088 canonical #7c020ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan089 canonical #7c010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan090 canonical #7c008ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan091 canonical #7c004ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+
+-- sNaN: declets in payload
+dqcan101 canonical #7e000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan102 canonical #7e000ffffcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan103 canonical #7e000ff3ffff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan104 canonical #7e000ff3fcffffcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan105 canonical #7e000ff3fcff3ffff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan106 canonical #7e000ff3fcff3fcffffcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan107 canonical #7e000ff3fcff3fcff3ffff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan108 canonical #7e000ff3fcff3fcff3fcffffcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan109 canonical #7e000ff3fcff3fcff3fcff3ffff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan100 canonical #7e000ff3fcff3fcff3fcff3fcffffcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan111 canonical #7e000ff3fcff3fcff3fcff3fcff3ffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+dqcan121 canonical #7f000ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan122 canonical #7e800ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan123 canonical #7e400ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan124 canonical #7e200ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan125 canonical #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan126 canonical #7e080ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan127 canonical #7e040ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan128 canonical #7e020ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan129 canonical #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan130 canonical #7e008ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+dqcan131 canonical #7e004ff3fcff3fcff3fcff3fcff3fcff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+
+-- Inf: exponent continuation bits
+dqcan137 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan138 canonical #79000000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan139 canonical #7a000000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan140 canonical #78800000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan141 canonical #78400000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan142 canonical #78200000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan143 canonical #78100000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan144 canonical #78080000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan145 canonical #78040000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan146 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan147 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan148 canonical #78008000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan149 canonical #78004000000000000000000000000000 -> #78000000000000000000000000000000
+
+-- Inf: coefficient continuation bits (first, last, and a few others)
+dqcan150 canonical #78000000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan151 canonical #78020000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan152 canonical #78000000000000000000000000000001 -> #78000000000000000000000000000000
+dqcan153 canonical #78010000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan154 canonical #78002000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan155 canonical #78000800000000000000000000000000 -> #78000000000000000000000000000000
+dqcan156 canonical #78000020000000000000000000000000 -> #78000000000000000000000000000000
+dqcan157 canonical #78000004000000000000000000000000 -> #78000000000000000000000000000000
+dqcan158 canonical #78000000400000000000000000000000 -> #78000000000000000000000000000000
+dqcan159 canonical #78000000080000000000000000000000 -> #78000000000000000000000000000000
+dqcan160 canonical #78000000004000000000000000000000 -> #78000000000000000000000000000000
+dqcan161 canonical #78000000000200000000000000000000 -> #78000000000000000000000000000000
+dqcan162 canonical #78000000000080000000000000000000 -> #78000000000000000000000000000000
+dqcan163 canonical #78000000000002000000000000000000 -> #78000000000000000000000000000000
+dqcan164 canonical #78000000000000400000000000000000 -> #78000000000000000000000000000000
+dqcan165 canonical #78000000000000080000000000000000 -> #78000000000000000000000000000000
+dqcan166 canonical #78000000000000001000000000000000 -> #78000000000000000000000000000000
+dqcan167 canonical #78000000000000000200000000000000 -> #78000000000000000000000000000000
+dqcan168 canonical #78000000000000000080000000000000 -> #78000000000000000000000000000000
+dqcan169 canonical #78000000000000000004000000000000 -> #78000000000000000000000000000000
+dqcan170 canonical #78000000000000000000400000000000 -> #78000000000000000000000000000000
+dqcan171 canonical #78000000000000000000010000000000 -> #78000000000000000000000000000000
+dqcan172 canonical #78000000000000000000002000000000 -> #78000000000000000000000000000000
+dqcan173 canonical #78000000000000000000000400000000 -> #78000000000000000000000000000000
+dqcan174 canonical #78000000000000000000000080000000 -> #78000000000000000000000000000000
+dqcan175 canonical #78000000000000000000000002000000 -> #78000000000000000000000000000000
+dqcan176 canonical #78000000000000000000000000400000 -> #78000000000000000000000000000000
+dqcan177 canonical #78000000000000000000000000020000 -> #78000000000000000000000000000000
+dqcan178 canonical #78000000000000000000000000001000 -> #78000000000000000000000000000000
+dqcan179 canonical #78000000000000000000000000000400 -> #78000000000000000000000000000000
+dqcan180 canonical #78000000000000000000000000000020 -> #78000000000000000000000000000000
+dqcan181 canonical #78000000000000000000000000000008 -> #78000000000000000000000000000000
+
+
+-- Now the operators -- trying to check paths that might fail to
+-- canonicalize propagated operands
+
+----- Add:
+-- Finites: neutral 0
+dqcan202 add 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan203 add #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+-- tiny zero
+dqcan204 add 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
+dqcan205 add #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
+-- tiny non zero
+dqcan206 add -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
+dqcan207 add #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
+-- NaN: declets in payload
+dqcan211 add 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan212 add #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+dqcan213 add 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan214 add #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN: declets in payload
+dqcan215 add 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan216 add #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+dqcan217 add 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan218 add #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+dqcan220 add 0 #78010000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan221 add #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
+-- Inf: coefficient continuation bits
+dqcan222 add 0 #78002000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan223 add #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
+dqcan224 add 0 #78000002000000000000000000000000 -> #78000000000000000000000000000000
+dqcan225 add #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
+dqcan226 add 0 #78000000000000000005000000000000 -> #78000000000000000000000000000000
+dqcan227 add #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
+
+----- Class: [does not return encoded]
+
+----- Compare:
+dqcan231 compare -Inf 1 -> #a2080000000000000000000000000001
+dqcan232 compare -Inf -Inf -> #22080000000000000000000000000000
+dqcan233 compare 1 -Inf -> #22080000000000000000000000000001
+dqcan234 compare #7c010ff3fcff3fcff3fcff3ffffffcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan235 compare #7e004ff3fcff3fcff3ffffffcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+
+----- CompareSig:
+dqcan241 comparesig -Inf 1 -> #a2080000000000000000000000000001
+dqcan242 comparesig -Inf -Inf -> #22080000000000000000000000000000
+dqcan243 comparesig 1 -Inf -> #22080000000000000000000000000001
+dqcan244 comparesig #7c400ff3ffff3fcff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan245 comparesig #7e050ff3fcfffffff3fcff3fcff3fcff -1000 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+
+----- Copy: [does not usually canonicalize]
+-- finites
+dqcan250 copy #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
+dqcan251 copy #ee080ff3fcff3ffff3fcff3ffff3fcff -> #ee080ff3fcff3ffff3fcff3ffff3fcff
+-- NaNs
+dqcan252 copy #7c000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
+dqcan253 copy #7c080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN
+dqcan254 copy #7e003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
+dqcan255 copy #7e100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
+-- Inf
+dqcan258 copy #78002000000000000000000000000000 -> #78002000000000000000000000000000
+dqcan259 copy #78000000000010000000000000100000 -> #78000000000010000000000000100000
+
+----- CopyAbs: [does not usually canonicalize]
+-- finites
+dqcan260 copyabs #6e080ff3fcff3fcfffffff3fcfffffff -> #6e080ff3fcff3fcfffffff3fcfffffff
+dqcan261 copyabs #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
+-- NaNs
+dqcan262 copyabs #fc000ff3fcffffffffffffffcff3fcff -> #7c000ff3fcffffffffffffffcff3fcff
+dqcan263 copyabs #fc080ff3fcff3fcff3fcff3fcff3fcff -> #7c080ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN
+dqcan264 copyabs #fe003ff3fcffffffffffffffcff3fcff -> #7e003ff3fcffffffffffffffcff3fcff
+dqcan265 copyabs #fe100ff3fcff3fcff3fcff3fcff3fcff -> #7e100ff3fcff3fcff3fcff3fcff3fcff
+-- Inf
+dqcan268 copyabs #f8002000000000000000000000000000 -> #78002000000000000000000000000000
+dqcan269 copyabs #f8000000000000700700700000000000 -> #78000000000000700700700000000000
+
+----- CopyNegate: [does not usually canonicalize]
+-- finites
+dqcan270 copynegate #6e080ff3fcff3fcfffffff3fcfffffff -> #ee080ff3fcff3fcfffffff3fcfffffff
+dqcan271 copynegate #ee080ff3fcff3ffff3fcff3ffff3fcff -> #6e080ff3fcff3ffff3fcff3ffff3fcff
+-- NaNs
+dqcan272 copynegate #7c000ff3fcffffffffffff3fcff3fcff -> #fc000ff3fcffffffffffff3fcff3fcff
+dqcan273 copynegate #7c080ff3fcff3fcff3fcff3fcff3fcff -> #fc080ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN
+dqcan274 copynegate #7e003ff3fcffffffffffffffcff3fcff -> #fe003ff3fcffffffffffffffcff3fcff
+dqcan275 copynegate #7e100ff3fcff3fcff3fcff3fcff3fcff -> #fe100ff3fcff3fcff3fcff3fcff3fcff
+-- Inf
+dqcan278 copynegate #78002000000000000000000000000000 -> #f8002000000000000000000000000000
+dqcan279 copynegate #78000000000010000000000000100000 -> #f8000000000010000000000000100000
+
+----- CopySign: [does not usually canonicalize]
+-- finites
+dqcan280 copysign #6e080ff3fcff3fcfffffff3fcfffffff -1 -> #ee080ff3fcff3fcfffffff3fcfffffff
+dqcan281 copysign #ee080ff3fcff3ffff3fcff3ffff3fcff 1 -> #6e080ff3fcff3ffff3fcff3ffff3fcff
+-- NaNs
+dqcan282 copysign #7c000ff3fcffffffffffffffcff3fcff -1 -> #fc000ff3fcffffffffffffffcff3fcff
+dqcan283 copysign #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c080ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN
+dqcan284 copysign #7e003ff3fcffffffffffffffcff3fcff -1 -> #fe003ff3fcffffffffffffffcff3fcff
+dqcan285 copysign #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7e100ff3fcff3fcff3fcff3fcff3fcff
+-- Inf
+dqcan288 copysign #78002000000000000000000000000000 -1 -> #f8002000000000000000000000000000
+dqcan289 copysign #78000000000010000000000000100000 1 -> #78000000000010000000000000100000
+
+----- Multiply:
+-- Finites: neutral 0
+dqcan302 multiply 1 #77ffff3fcff3fcff0000000000000000 -> #77ffff3fcff3fcff0000000000000000
+dqcan303 multiply #77fcffffcff3fcff0000000000000000 1 -> #77fccfffcff3fcff0000000000000000
+-- negative
+dqcan306 multiply -1 #77ffff3fcff3fcff0000000000000000 -> #f7ffff3fcff3fcff0000000000000000
+dqcan307 multiply #77fcffffcff3fcff0000000000000000 -1 -> #f7fccfffcff3fcff0000000000000000
+-- NaN: declets in payload
+dqcan311 multiply 1 #7c03ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
+dqcan312 multiply #7c03ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
+-- NaN: exponent continuation bits [excluding sNaN selector]
+dqcan313 multiply 1 #7c40ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000
+dqcan314 multiply #7c40ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000
+-- sNaN: declets in payload
+dqcan315 multiply 1 #7e00ffffcff3fcff0000000000000000 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
+dqcan316 multiply #7e00ffffcff3fcff0000000000000000 1 -> #7c000fffcff3fcff0000000000000000 Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+dqcan317 multiply 1 #7e80ff3fcff3fcff0000000000000000 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
+dqcan318 multiply #7e80ff3fcff3fcff0000000000000000 1 -> #7c003f3fcff3fcff0000000000000000 Invalid_operation
+-- Inf: exponent continuation bits
+dqcan320 multiply 1 #78800000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan321 multiply #78800000000000000000000000000000 1 -> #78000000000000000000000000000000
+-- Inf: coefficient continuation bits
+dqcan322 multiply 1 #78020000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan323 multiply #78020000000000000000000000000000 1 -> #78000000000000000000000000000000
+dqcan324 multiply 1 #78000000000000010000000000000000 -> #78000000000000000000000000000000
+dqcan325 multiply #78000000000000010000000000000000 1 -> #78000000000000000000000000000000
+dqcan326 multiply 1 #78000020000000000000000000000000 -> #78000000000000000000000000000000
+dqcan327 multiply #78000020000000000000000000000000 1 -> #78000000000000000000000000000000
+
+----- Quantize:
+dqcan401 quantize #ee080ff3fcff3fcff3fffffffff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
+dqcan402 quantize #ee080ff3fffffffffffcff3fcff3fcff 0 -> #ee080ff3fcff3fcff3fcff3fcff3fcff
+dqcan403 quantize #78800000000000000000000000000000 Inf -> #78000000000000000000000000000000
+dqcan404 quantize #78020000000000000000000000000000 -Inf -> #78000000000000000000000000000000
+dqcan410 quantize #7c080ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan411 quantize #fc000ff3fcfffffff3fcff3fcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff
+dqcan412 quantize #7e100ff3fcff3fcff3fcff3fcff3fcff 1 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan413 quantize #fe000ff3fcff3fcff3ffffffcff3fcff 1 -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+
+----- Subtract:
+-- Finites: neutral 0
+dqcan502 subtract 0E+6144 #77ffcff3fcff3fcffffcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
+dqcan503 subtract #77ffcff3fcff3fcff3fcff3ffff3fcff 0E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+-- tiny zero
+dqcan504 subtract 0E-6176 #77ffcff3ffff3fcff3fcff3fcff3fcff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Rounded
+dqcan505 subtract #77ffcff3fcff3fcff3fcff3fcff3ffff 0E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Rounded
+-- tiny non zero
+dqcan506 subtract -1E-6176 #77ffcff3fcff3fcff3fcff3fcfffffff -> #f7ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
+dqcan507 subtract #77ffcffffffffffffffffffffff3fcff -1E-6176 -> #77ffcff3fcff3fcff3fcff3fcff3fcff Inexact Rounded
+-- NaN: declets in payload
+dqcan511 subtract 0 #7c000ff3fcff3fcff3fcfffffff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan512 subtract #7c000ff3fcff3fcfffffff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- NaN: exponent continuation bits [excluding sNaN selector]
+dqcan513 subtract 0 #7c400ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan514 subtract #7c020ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+-- sNaN: declets in payload
+dqcan515 subtract 0 #7e000ff3fcffffcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan516 subtract #7e003ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- sNaN: exponent continuation bits [excluding sNaN selector]
+dqcan517 subtract 0 #7e500ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan518 subtract #7e0e0ff3fcff3fcff3fcff3fcff3fcff 0 -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- Inf: exponent continuation bits
+dqcan520 subtract 0 #78010000000000000000000000000000 -> #f8000000000000000000000000000000
+dqcan521 subtract #78680000000000000000000000000000 0 -> #78000000000000000000000000000000
+-- Inf: coefficient continuation bits
+dqcan522 subtract 0 #78002000000000000000000000000000 -> #f8000000000000000000000000000000
+dqcan523 subtract #78000000000000000000000000000001 0 -> #78000000000000000000000000000000
+dqcan524 subtract 0 #78000002000000000000000000000000 -> #f8000000000000000000000000000000
+dqcan525 subtract #780000000000f0000000000000000000 0 -> #78000000000000000000000000000000
+dqcan526 subtract 0 #78000000000000000005000000000000 -> #f8000000000000000000000000000000
+dqcan527 subtract #780000000000000000000000000a0000 0 -> #78000000000000000000000000000000
+
+----- ToIntegral:
+dqcan601 tointegralx #6e080ff3fdff3fcff3fcff3fcff3fcff -> #6e080ff3fcff3fcff3fcff3fcff3fcff
+dqcan602 tointegralx #ee080ff3fcff3ffff3fcff3fcff3fcff -> #ee080ff3fcff3fcff3fcff3fcff3fcff
+dqcan603 tointegralx #78800000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan604 tointegralx #78020000000000000000000000000000 -> #78000000000000000000000000000000
+dqcan614 tointegralx #7c100ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+dqcan615 tointegralx #fc000ff3fcff3fcff3fcffffcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff
+dqcan616 tointegralx #7e010ff3fcff3fcff3fcff3fcff3fcff -> #7c000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+dqcan617 tointegralx #fe000ff3fcff3fcff3fdff3fcff3fcff -> #fc000ff3fcff3fcff3fcff3fcff3fcff Invalid_operation
+-- uncanonical 3999, 39.99, 3.99, 0.399, and negatives
+dqcan618 tointegralx #22080000000000000000000000000fff -> #22080000000000000000000000000cff
+dqcan619 tointegralx #22078000000000000000000000000fff -> #22080000000000000000000000000040 Inexact Rounded
+dqcan620 tointegralx #22074000000000000000000000000fff -> #22080000000000000000000000000004 Inexact Rounded
+dqcan621 tointegralx #22070000000000000000000000000fff -> #22080000000000000000000000000000 Inexact Rounded
+dqcan622 tointegralx #a2080000000000000000000000000fff -> #a2080000000000000000000000000cff
+dqcan623 tointegralx #a2078000000000000000000000000fff -> #a2080000000000000000000000000040 Inexact Rounded
+dqcan624 tointegralx #a2074000000000000000000000000fff -> #a2080000000000000000000000000004 Inexact Rounded
+dqcan625 tointegralx #a2070000000000000000000000000fff -> #a2080000000000000000000000000000 Inexact Rounded
+
+
+
diff --git a/Lib/test/decimaltestdata/dqClass.decTest b/Lib/test/decimaltestdata/dqClass.decTest
index f341933878..d7e19b3829 100644
--- a/Lib/test/decimaltestdata/dqClass.decTest
+++ b/Lib/test/decimaltestdata/dqClass.decTest
@@ -1,77 +1,77 @@
-------------------------------------------------------------------------
--- dqClass.decTest -- decQuad Class operations --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- [New 2006.11.27]
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqcla001 class 0 -> +Zero
-dqcla002 class 0.00 -> +Zero
-dqcla003 class 0E+5 -> +Zero
-dqcla004 class 1E-6176 -> +Subnormal
-dqcla005 class 0.1E-6143 -> +Subnormal
-dqcla006 class 0.99999999999999999999999999999999E-6143 -> +Subnormal
-dqcla007 class 1.00000000000000000000000000000000E-6143 -> +Normal
-dqcla008 class 1E-6143 -> +Normal
-dqcla009 class 1E-100 -> +Normal
-dqcla010 class 1E-10 -> +Normal
-dqcla012 class 1E-1 -> +Normal
-dqcla013 class 1 -> +Normal
-dqcla014 class 2.50 -> +Normal
-dqcla015 class 100.100 -> +Normal
-dqcla016 class 1E+30 -> +Normal
-dqcla017 class 1E+6144 -> +Normal
-dqcla018 class 9.99999999999999999999999999999999E+6144 -> +Normal
-dqcla019 class Inf -> +Infinity
-
-dqcla021 class -0 -> -Zero
-dqcla022 class -0.00 -> -Zero
-dqcla023 class -0E+5 -> -Zero
-dqcla024 class -1E-6176 -> -Subnormal
-dqcla025 class -0.1E-6143 -> -Subnormal
-dqcla026 class -0.99999999999999999999999999999999E-6143 -> -Subnormal
-dqcla027 class -1.00000000000000000000000000000000E-6143 -> -Normal
-dqcla028 class -1E-6143 -> -Normal
-dqcla029 class -1E-100 -> -Normal
-dqcla030 class -1E-10 -> -Normal
-dqcla032 class -1E-1 -> -Normal
-dqcla033 class -1 -> -Normal
-dqcla034 class -2.50 -> -Normal
-dqcla035 class -100.100 -> -Normal
-dqcla036 class -1E+30 -> -Normal
-dqcla037 class -1E+6144 -> -Normal
-dqcla0614 class -9.99999999999999999999999999999999E+6144 -> -Normal
-dqcla039 class -Inf -> -Infinity
-
-dqcla041 class NaN -> NaN
-dqcla042 class -NaN -> NaN
-dqcla043 class +NaN12345 -> NaN
-dqcla044 class sNaN -> sNaN
-dqcla045 class -sNaN -> sNaN
-dqcla046 class +sNaN12345 -> sNaN
-
-
-
+------------------------------------------------------------------------
+-- dqClass.decTest -- decQuad Class operations --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- [New 2006.11.27]
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqcla001 class 0 -> +Zero
+dqcla002 class 0.00 -> +Zero
+dqcla003 class 0E+5 -> +Zero
+dqcla004 class 1E-6176 -> +Subnormal
+dqcla005 class 0.1E-6143 -> +Subnormal
+dqcla006 class 0.99999999999999999999999999999999E-6143 -> +Subnormal
+dqcla007 class 1.00000000000000000000000000000000E-6143 -> +Normal
+dqcla008 class 1E-6143 -> +Normal
+dqcla009 class 1E-100 -> +Normal
+dqcla010 class 1E-10 -> +Normal
+dqcla012 class 1E-1 -> +Normal
+dqcla013 class 1 -> +Normal
+dqcla014 class 2.50 -> +Normal
+dqcla015 class 100.100 -> +Normal
+dqcla016 class 1E+30 -> +Normal
+dqcla017 class 1E+6144 -> +Normal
+dqcla018 class 9.99999999999999999999999999999999E+6144 -> +Normal
+dqcla019 class Inf -> +Infinity
+
+dqcla021 class -0 -> -Zero
+dqcla022 class -0.00 -> -Zero
+dqcla023 class -0E+5 -> -Zero
+dqcla024 class -1E-6176 -> -Subnormal
+dqcla025 class -0.1E-6143 -> -Subnormal
+dqcla026 class -0.99999999999999999999999999999999E-6143 -> -Subnormal
+dqcla027 class -1.00000000000000000000000000000000E-6143 -> -Normal
+dqcla028 class -1E-6143 -> -Normal
+dqcla029 class -1E-100 -> -Normal
+dqcla030 class -1E-10 -> -Normal
+dqcla032 class -1E-1 -> -Normal
+dqcla033 class -1 -> -Normal
+dqcla034 class -2.50 -> -Normal
+dqcla035 class -100.100 -> -Normal
+dqcla036 class -1E+30 -> -Normal
+dqcla037 class -1E+6144 -> -Normal
+dqcla0614 class -9.99999999999999999999999999999999E+6144 -> -Normal
+dqcla039 class -Inf -> -Infinity
+
+dqcla041 class NaN -> NaN
+dqcla042 class -NaN -> NaN
+dqcla043 class +NaN12345 -> NaN
+dqcla044 class sNaN -> sNaN
+dqcla045 class -sNaN -> sNaN
+dqcla046 class +sNaN12345 -> sNaN
+
+
+
diff --git a/Lib/test/decimaltestdata/dqCompare.decTest b/Lib/test/decimaltestdata/dqCompare.decTest
index a617ad110a..b7b5ee6b8e 100644
--- a/Lib/test/decimaltestdata/dqCompare.decTest
+++ b/Lib/test/decimaltestdata/dqCompare.decTest
@@ -1,753 +1,753 @@
-------------------------------------------------------------------------
--- dqCompare.decTest -- decQuad comparison that allows quiet NaNs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqcom001 compare -2 -2 -> 0
-dqcom002 compare -2 -1 -> -1
-dqcom003 compare -2 0 -> -1
-dqcom004 compare -2 1 -> -1
-dqcom005 compare -2 2 -> -1
-dqcom006 compare -1 -2 -> 1
-dqcom007 compare -1 -1 -> 0
-dqcom008 compare -1 0 -> -1
-dqcom009 compare -1 1 -> -1
-dqcom010 compare -1 2 -> -1
-dqcom011 compare 0 -2 -> 1
-dqcom012 compare 0 -1 -> 1
-dqcom013 compare 0 0 -> 0
-dqcom014 compare 0 1 -> -1
-dqcom015 compare 0 2 -> -1
-dqcom016 compare 1 -2 -> 1
-dqcom017 compare 1 -1 -> 1
-dqcom018 compare 1 0 -> 1
-dqcom019 compare 1 1 -> 0
-dqcom020 compare 1 2 -> -1
-dqcom021 compare 2 -2 -> 1
-dqcom022 compare 2 -1 -> 1
-dqcom023 compare 2 0 -> 1
-dqcom025 compare 2 1 -> 1
-dqcom026 compare 2 2 -> 0
-
-dqcom031 compare -20 -20 -> 0
-dqcom032 compare -20 -10 -> -1
-dqcom033 compare -20 00 -> -1
-dqcom034 compare -20 10 -> -1
-dqcom035 compare -20 20 -> -1
-dqcom036 compare -10 -20 -> 1
-dqcom037 compare -10 -10 -> 0
-dqcom038 compare -10 00 -> -1
-dqcom039 compare -10 10 -> -1
-dqcom040 compare -10 20 -> -1
-dqcom041 compare 00 -20 -> 1
-dqcom042 compare 00 -10 -> 1
-dqcom043 compare 00 00 -> 0
-dqcom044 compare 00 10 -> -1
-dqcom045 compare 00 20 -> -1
-dqcom046 compare 10 -20 -> 1
-dqcom047 compare 10 -10 -> 1
-dqcom048 compare 10 00 -> 1
-dqcom049 compare 10 10 -> 0
-dqcom050 compare 10 20 -> -1
-dqcom051 compare 20 -20 -> 1
-dqcom052 compare 20 -10 -> 1
-dqcom053 compare 20 00 -> 1
-dqcom055 compare 20 10 -> 1
-dqcom056 compare 20 20 -> 0
-
-dqcom061 compare -2.0 -2.0 -> 0
-dqcom062 compare -2.0 -1.0 -> -1
-dqcom063 compare -2.0 0.0 -> -1
-dqcom064 compare -2.0 1.0 -> -1
-dqcom065 compare -2.0 2.0 -> -1
-dqcom066 compare -1.0 -2.0 -> 1
-dqcom067 compare -1.0 -1.0 -> 0
-dqcom068 compare -1.0 0.0 -> -1
-dqcom069 compare -1.0 1.0 -> -1
-dqcom070 compare -1.0 2.0 -> -1
-dqcom071 compare 0.0 -2.0 -> 1
-dqcom072 compare 0.0 -1.0 -> 1
-dqcom073 compare 0.0 0.0 -> 0
-dqcom074 compare 0.0 1.0 -> -1
-dqcom075 compare 0.0 2.0 -> -1
-dqcom076 compare 1.0 -2.0 -> 1
-dqcom077 compare 1.0 -1.0 -> 1
-dqcom078 compare 1.0 0.0 -> 1
-dqcom079 compare 1.0 1.0 -> 0
-dqcom080 compare 1.0 2.0 -> -1
-dqcom081 compare 2.0 -2.0 -> 1
-dqcom082 compare 2.0 -1.0 -> 1
-dqcom083 compare 2.0 0.0 -> 1
-dqcom085 compare 2.0 1.0 -> 1
-dqcom086 compare 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-dqcom090 compare 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0
-dqcom091 compare -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1
-dqcom092 compare 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1
-dqcom093 compare -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0
-
--- some differing length/exponent cases
-dqcom100 compare 7.0 7.0 -> 0
-dqcom101 compare 7.0 7 -> 0
-dqcom102 compare 7 7.0 -> 0
-dqcom103 compare 7E+0 7.0 -> 0
-dqcom104 compare 70E-1 7.0 -> 0
-dqcom105 compare 0.7E+1 7 -> 0
-dqcom106 compare 70E-1 7 -> 0
-dqcom107 compare 7.0 7E+0 -> 0
-dqcom108 compare 7.0 70E-1 -> 0
-dqcom109 compare 7 0.7E+1 -> 0
-dqcom110 compare 7 70E-1 -> 0
-
-dqcom120 compare 8.0 7.0 -> 1
-dqcom121 compare 8.0 7 -> 1
-dqcom122 compare 8 7.0 -> 1
-dqcom123 compare 8E+0 7.0 -> 1
-dqcom124 compare 80E-1 7.0 -> 1
-dqcom125 compare 0.8E+1 7 -> 1
-dqcom126 compare 80E-1 7 -> 1
-dqcom127 compare 8.0 7E+0 -> 1
-dqcom128 compare 8.0 70E-1 -> 1
-dqcom129 compare 8 0.7E+1 -> 1
-dqcom130 compare 8 70E-1 -> 1
-
-dqcom140 compare 8.0 9.0 -> -1
-dqcom141 compare 8.0 9 -> -1
-dqcom142 compare 8 9.0 -> -1
-dqcom143 compare 8E+0 9.0 -> -1
-dqcom144 compare 80E-1 9.0 -> -1
-dqcom145 compare 0.8E+1 9 -> -1
-dqcom146 compare 80E-1 9 -> -1
-dqcom147 compare 8.0 9E+0 -> -1
-dqcom148 compare 8.0 90E-1 -> -1
-dqcom149 compare 8 0.9E+1 -> -1
-dqcom150 compare 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-dqcom200 compare -7.0 7.0 -> -1
-dqcom201 compare -7.0 7 -> -1
-dqcom202 compare -7 7.0 -> -1
-dqcom203 compare -7E+0 7.0 -> -1
-dqcom204 compare -70E-1 7.0 -> -1
-dqcom205 compare -0.7E+1 7 -> -1
-dqcom206 compare -70E-1 7 -> -1
-dqcom207 compare -7.0 7E+0 -> -1
-dqcom208 compare -7.0 70E-1 -> -1
-dqcom209 compare -7 0.7E+1 -> -1
-dqcom210 compare -7 70E-1 -> -1
-
-dqcom220 compare -8.0 7.0 -> -1
-dqcom221 compare -8.0 7 -> -1
-dqcom222 compare -8 7.0 -> -1
-dqcom223 compare -8E+0 7.0 -> -1
-dqcom224 compare -80E-1 7.0 -> -1
-dqcom225 compare -0.8E+1 7 -> -1
-dqcom226 compare -80E-1 7 -> -1
-dqcom227 compare -8.0 7E+0 -> -1
-dqcom228 compare -8.0 70E-1 -> -1
-dqcom229 compare -8 0.7E+1 -> -1
-dqcom230 compare -8 70E-1 -> -1
-
-dqcom240 compare -8.0 9.0 -> -1
-dqcom241 compare -8.0 9 -> -1
-dqcom242 compare -8 9.0 -> -1
-dqcom243 compare -8E+0 9.0 -> -1
-dqcom244 compare -80E-1 9.0 -> -1
-dqcom245 compare -0.8E+1 9 -> -1
-dqcom246 compare -80E-1 9 -> -1
-dqcom247 compare -8.0 9E+0 -> -1
-dqcom248 compare -8.0 90E-1 -> -1
-dqcom249 compare -8 0.9E+1 -> -1
-dqcom250 compare -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-dqcom300 compare 7.0 -7.0 -> 1
-dqcom301 compare 7.0 -7 -> 1
-dqcom302 compare 7 -7.0 -> 1
-dqcom303 compare 7E+0 -7.0 -> 1
-dqcom304 compare 70E-1 -7.0 -> 1
-dqcom305 compare .7E+1 -7 -> 1
-dqcom306 compare 70E-1 -7 -> 1
-dqcom307 compare 7.0 -7E+0 -> 1
-dqcom308 compare 7.0 -70E-1 -> 1
-dqcom309 compare 7 -.7E+1 -> 1
-dqcom310 compare 7 -70E-1 -> 1
-
-dqcom320 compare 8.0 -7.0 -> 1
-dqcom321 compare 8.0 -7 -> 1
-dqcom322 compare 8 -7.0 -> 1
-dqcom323 compare 8E+0 -7.0 -> 1
-dqcom324 compare 80E-1 -7.0 -> 1
-dqcom325 compare .8E+1 -7 -> 1
-dqcom326 compare 80E-1 -7 -> 1
-dqcom327 compare 8.0 -7E+0 -> 1
-dqcom328 compare 8.0 -70E-1 -> 1
-dqcom329 compare 8 -.7E+1 -> 1
-dqcom330 compare 8 -70E-1 -> 1
-
-dqcom340 compare 8.0 -9.0 -> 1
-dqcom341 compare 8.0 -9 -> 1
-dqcom342 compare 8 -9.0 -> 1
-dqcom343 compare 8E+0 -9.0 -> 1
-dqcom344 compare 80E-1 -9.0 -> 1
-dqcom345 compare .8E+1 -9 -> 1
-dqcom346 compare 80E-1 -9 -> 1
-dqcom347 compare 8.0 -9E+0 -> 1
-dqcom348 compare 8.0 -90E-1 -> 1
-dqcom349 compare 8 -.9E+1 -> 1
-dqcom350 compare 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-dqcom400 compare -7.0 -7.0 -> 0
-dqcom401 compare -7.0 -7 -> 0
-dqcom402 compare -7 -7.0 -> 0
-dqcom403 compare -7E+0 -7.0 -> 0
-dqcom404 compare -70E-1 -7.0 -> 0
-dqcom405 compare -.7E+1 -7 -> 0
-dqcom406 compare -70E-1 -7 -> 0
-dqcom407 compare -7.0 -7E+0 -> 0
-dqcom408 compare -7.0 -70E-1 -> 0
-dqcom409 compare -7 -.7E+1 -> 0
-dqcom410 compare -7 -70E-1 -> 0
-
-dqcom420 compare -8.0 -7.0 -> -1
-dqcom421 compare -8.0 -7 -> -1
-dqcom422 compare -8 -7.0 -> -1
-dqcom423 compare -8E+0 -7.0 -> -1
-dqcom424 compare -80E-1 -7.0 -> -1
-dqcom425 compare -.8E+1 -7 -> -1
-dqcom426 compare -80E-1 -7 -> -1
-dqcom427 compare -8.0 -7E+0 -> -1
-dqcom428 compare -8.0 -70E-1 -> -1
-dqcom429 compare -8 -.7E+1 -> -1
-dqcom430 compare -8 -70E-1 -> -1
-
-dqcom440 compare -8.0 -9.0 -> 1
-dqcom441 compare -8.0 -9 -> 1
-dqcom442 compare -8 -9.0 -> 1
-dqcom443 compare -8E+0 -9.0 -> 1
-dqcom444 compare -80E-1 -9.0 -> 1
-dqcom445 compare -.8E+1 -9 -> 1
-dqcom446 compare -80E-1 -9 -> 1
-dqcom447 compare -8.0 -9E+0 -> 1
-dqcom448 compare -8.0 -90E-1 -> 1
-dqcom449 compare -8 -.9E+1 -> 1
-dqcom450 compare -8 -90E-1 -> 1
-
--- misalignment traps for little-endian
-dqcom451 compare 1.0 0.1 -> 1
-dqcom452 compare 0.1 1.0 -> -1
-dqcom453 compare 10.0 0.1 -> 1
-dqcom454 compare 0.1 10.0 -> -1
-dqcom455 compare 100 1.0 -> 1
-dqcom456 compare 1.0 100 -> -1
-dqcom457 compare 1000 10.0 -> 1
-dqcom458 compare 10.0 1000 -> -1
-dqcom459 compare 10000 100.0 -> 1
-dqcom460 compare 100.0 10000 -> -1
-dqcom461 compare 100000 1000.0 -> 1
-dqcom462 compare 1000.0 100000 -> -1
-dqcom463 compare 1000000 10000.0 -> 1
-dqcom464 compare 10000.0 1000000 -> -1
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-dqcom473 compare 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0
-dqcom474 compare 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0
-dqcom475 compare 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0
-dqcom476 compare 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0
-dqcom477 compare 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0
-dqcom478 compare 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0
-dqcom479 compare 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0
-dqcom480 compare 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0
-dqcom481 compare 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0
-dqcom482 compare 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0
-dqcom483 compare 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0
-dqcom487 compare 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0
-dqcom488 compare 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0
-dqcom489 compare 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0
-dqcom490 compare 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0
-dqcom491 compare 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0
-dqcom492 compare 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0
-dqcom493 compare 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0
-dqcom494 compare 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0
-dqcom495 compare 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0
-dqcom496 compare 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0
-dqcom497 compare 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-dqcom500 compare 1 1E-15 -> 1
-dqcom501 compare 1 1E-14 -> 1
-dqcom502 compare 1 1E-13 -> 1
-dqcom503 compare 1 1E-12 -> 1
-dqcom504 compare 1 1E-11 -> 1
-dqcom505 compare 1 1E-10 -> 1
-dqcom506 compare 1 1E-9 -> 1
-dqcom507 compare 1 1E-8 -> 1
-dqcom508 compare 1 1E-7 -> 1
-dqcom509 compare 1 1E-6 -> 1
-dqcom510 compare 1 1E-5 -> 1
-dqcom511 compare 1 1E-4 -> 1
-dqcom512 compare 1 1E-3 -> 1
-dqcom513 compare 1 1E-2 -> 1
-dqcom514 compare 1 1E-1 -> 1
-dqcom515 compare 1 1E-0 -> 0
-dqcom516 compare 1 1E+1 -> -1
-dqcom517 compare 1 1E+2 -> -1
-dqcom518 compare 1 1E+3 -> -1
-dqcom519 compare 1 1E+4 -> -1
-dqcom521 compare 1 1E+5 -> -1
-dqcom522 compare 1 1E+6 -> -1
-dqcom523 compare 1 1E+7 -> -1
-dqcom524 compare 1 1E+8 -> -1
-dqcom525 compare 1 1E+9 -> -1
-dqcom526 compare 1 1E+10 -> -1
-dqcom527 compare 1 1E+11 -> -1
-dqcom528 compare 1 1E+12 -> -1
-dqcom529 compare 1 1E+13 -> -1
-dqcom530 compare 1 1E+14 -> -1
-dqcom531 compare 1 1E+15 -> -1
--- LR swap
-dqcom540 compare 1E-15 1 -> -1
-dqcom541 compare 1E-14 1 -> -1
-dqcom542 compare 1E-13 1 -> -1
-dqcom543 compare 1E-12 1 -> -1
-dqcom544 compare 1E-11 1 -> -1
-dqcom545 compare 1E-10 1 -> -1
-dqcom546 compare 1E-9 1 -> -1
-dqcom547 compare 1E-8 1 -> -1
-dqcom548 compare 1E-7 1 -> -1
-dqcom549 compare 1E-6 1 -> -1
-dqcom550 compare 1E-5 1 -> -1
-dqcom551 compare 1E-4 1 -> -1
-dqcom552 compare 1E-3 1 -> -1
-dqcom553 compare 1E-2 1 -> -1
-dqcom554 compare 1E-1 1 -> -1
-dqcom555 compare 1E-0 1 -> 0
-dqcom556 compare 1E+1 1 -> 1
-dqcom557 compare 1E+2 1 -> 1
-dqcom558 compare 1E+3 1 -> 1
-dqcom559 compare 1E+4 1 -> 1
-dqcom561 compare 1E+5 1 -> 1
-dqcom562 compare 1E+6 1 -> 1
-dqcom563 compare 1E+7 1 -> 1
-dqcom564 compare 1E+8 1 -> 1
-dqcom565 compare 1E+9 1 -> 1
-dqcom566 compare 1E+10 1 -> 1
-dqcom567 compare 1E+11 1 -> 1
-dqcom568 compare 1E+12 1 -> 1
-dqcom569 compare 1E+13 1 -> 1
-dqcom570 compare 1E+14 1 -> 1
-dqcom571 compare 1E+15 1 -> 1
--- similar with a useful coefficient, one side only
-dqcom580 compare 0.000000987654321 1E-15 -> 1
-dqcom581 compare 0.000000987654321 1E-14 -> 1
-dqcom582 compare 0.000000987654321 1E-13 -> 1
-dqcom583 compare 0.000000987654321 1E-12 -> 1
-dqcom584 compare 0.000000987654321 1E-11 -> 1
-dqcom585 compare 0.000000987654321 1E-10 -> 1
-dqcom586 compare 0.000000987654321 1E-9 -> 1
-dqcom587 compare 0.000000987654321 1E-8 -> 1
-dqcom588 compare 0.000000987654321 1E-7 -> 1
-dqcom589 compare 0.000000987654321 1E-6 -> -1
-dqcom590 compare 0.000000987654321 1E-5 -> -1
-dqcom591 compare 0.000000987654321 1E-4 -> -1
-dqcom592 compare 0.000000987654321 1E-3 -> -1
-dqcom593 compare 0.000000987654321 1E-2 -> -1
-dqcom594 compare 0.000000987654321 1E-1 -> -1
-dqcom595 compare 0.000000987654321 1E-0 -> -1
-dqcom596 compare 0.000000987654321 1E+1 -> -1
-dqcom597 compare 0.000000987654321 1E+2 -> -1
-dqcom598 compare 0.000000987654321 1E+3 -> -1
-dqcom599 compare 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-dqcom600 compare 12 12.2345 -> -1
-dqcom601 compare 12.0 12.2345 -> -1
-dqcom602 compare 12.00 12.2345 -> -1
-dqcom603 compare 12.000 12.2345 -> -1
-dqcom604 compare 12.0000 12.2345 -> -1
-dqcom605 compare 12.00000 12.2345 -> -1
-dqcom606 compare 12.000000 12.2345 -> -1
-dqcom607 compare 12.0000000 12.2345 -> -1
-dqcom608 compare 12.00000000 12.2345 -> -1
-dqcom609 compare 12.000000000 12.2345 -> -1
-dqcom610 compare 12.1234 12 -> 1
-dqcom611 compare 12.1234 12.0 -> 1
-dqcom612 compare 12.1234 12.00 -> 1
-dqcom613 compare 12.1234 12.000 -> 1
-dqcom614 compare 12.1234 12.0000 -> 1
-dqcom615 compare 12.1234 12.00000 -> 1
-dqcom616 compare 12.1234 12.000000 -> 1
-dqcom617 compare 12.1234 12.0000000 -> 1
-dqcom618 compare 12.1234 12.00000000 -> 1
-dqcom619 compare 12.1234 12.000000000 -> 1
-dqcom620 compare -12 -12.2345 -> 1
-dqcom621 compare -12.0 -12.2345 -> 1
-dqcom622 compare -12.00 -12.2345 -> 1
-dqcom623 compare -12.000 -12.2345 -> 1
-dqcom624 compare -12.0000 -12.2345 -> 1
-dqcom625 compare -12.00000 -12.2345 -> 1
-dqcom626 compare -12.000000 -12.2345 -> 1
-dqcom627 compare -12.0000000 -12.2345 -> 1
-dqcom628 compare -12.00000000 -12.2345 -> 1
-dqcom629 compare -12.000000000 -12.2345 -> 1
-dqcom630 compare -12.1234 -12 -> -1
-dqcom631 compare -12.1234 -12.0 -> -1
-dqcom632 compare -12.1234 -12.00 -> -1
-dqcom633 compare -12.1234 -12.000 -> -1
-dqcom634 compare -12.1234 -12.0000 -> -1
-dqcom635 compare -12.1234 -12.00000 -> -1
-dqcom636 compare -12.1234 -12.000000 -> -1
-dqcom637 compare -12.1234 -12.0000000 -> -1
-dqcom638 compare -12.1234 -12.00000000 -> -1
-dqcom639 compare -12.1234 -12.000000000 -> -1
-
--- extended zeros
-dqcom640 compare 0 0 -> 0
-dqcom641 compare 0 -0 -> 0
-dqcom642 compare 0 -0.0 -> 0
-dqcom643 compare 0 0.0 -> 0
-dqcom644 compare -0 0 -> 0
-dqcom645 compare -0 -0 -> 0
-dqcom646 compare -0 -0.0 -> 0
-dqcom647 compare -0 0.0 -> 0
-dqcom648 compare 0.0 0 -> 0
-dqcom649 compare 0.0 -0 -> 0
-dqcom650 compare 0.0 -0.0 -> 0
-dqcom651 compare 0.0 0.0 -> 0
-dqcom652 compare -0.0 0 -> 0
-dqcom653 compare -0.0 -0 -> 0
-dqcom654 compare -0.0 -0.0 -> 0
-dqcom655 compare -0.0 0.0 -> 0
-
-dqcom656 compare -0E1 0.0 -> 0
-dqcom657 compare -0E2 0.0 -> 0
-dqcom658 compare 0E1 0.0 -> 0
-dqcom659 compare 0E2 0.0 -> 0
-dqcom660 compare -0E1 0 -> 0
-dqcom661 compare -0E2 0 -> 0
-dqcom662 compare 0E1 0 -> 0
-dqcom663 compare 0E2 0 -> 0
-dqcom664 compare -0E1 -0E1 -> 0
-dqcom665 compare -0E2 -0E1 -> 0
-dqcom666 compare 0E1 -0E1 -> 0
-dqcom667 compare 0E2 -0E1 -> 0
-dqcom668 compare -0E1 -0E2 -> 0
-dqcom669 compare -0E2 -0E2 -> 0
-dqcom670 compare 0E1 -0E2 -> 0
-dqcom671 compare 0E2 -0E2 -> 0
-dqcom672 compare -0E1 0E1 -> 0
-dqcom673 compare -0E2 0E1 -> 0
-dqcom674 compare 0E1 0E1 -> 0
-dqcom675 compare 0E2 0E1 -> 0
-dqcom676 compare -0E1 0E2 -> 0
-dqcom677 compare -0E2 0E2 -> 0
-dqcom678 compare 0E1 0E2 -> 0
-dqcom679 compare 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-dqcom680 compare 12 12 -> 0
-dqcom681 compare 12 12.0 -> 0
-dqcom682 compare 12 12.00 -> 0
-dqcom683 compare 12 12.000 -> 0
-dqcom684 compare 12 12.0000 -> 0
-dqcom685 compare 12 12.00000 -> 0
-dqcom686 compare 12 12.000000 -> 0
-dqcom687 compare 12 12.0000000 -> 0
-dqcom688 compare 12 12.00000000 -> 0
-dqcom689 compare 12 12.000000000 -> 0
-dqcom690 compare 12 12 -> 0
-dqcom691 compare 12.0 12 -> 0
-dqcom692 compare 12.00 12 -> 0
-dqcom693 compare 12.000 12 -> 0
-dqcom694 compare 12.0000 12 -> 0
-dqcom695 compare 12.00000 12 -> 0
-dqcom696 compare 12.000000 12 -> 0
-dqcom697 compare 12.0000000 12 -> 0
-dqcom698 compare 12.00000000 12 -> 0
-dqcom699 compare 12.000000000 12 -> 0
-
--- first, second, & last digit
-dqcom700 compare 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1
-dqcom701 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
-dqcom702 compare 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1
-dqcom703 compare 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1
-dqcom704 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
-dqcom705 compare 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1
-dqcom706 compare 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1
-dqcom707 compare 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0
-dqcom708 compare 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1
-
--- miscellaneous
-dqcom721 compare 12345678000 1 -> 1
-dqcom722 compare 1 12345678000 -> -1
-dqcom723 compare 1234567800 1 -> 1
-dqcom724 compare 1 1234567800 -> -1
-dqcom725 compare 1234567890 1 -> 1
-dqcom726 compare 1 1234567890 -> -1
-dqcom727 compare 1234567891 1 -> 1
-dqcom728 compare 1 1234567891 -> -1
-dqcom729 compare 12345678901 1 -> 1
-dqcom730 compare 1 12345678901 -> -1
-dqcom731 compare 1234567896 1 -> 1
-dqcom732 compare 1 1234567896 -> -1
-
--- residue cases at lower precision
-dqcom740 compare 1 0.9999999 -> 1
-dqcom741 compare 1 0.999999 -> 1
-dqcom742 compare 1 0.99999 -> 1
-dqcom743 compare 1 1.0000 -> 0
-dqcom744 compare 1 1.00001 -> -1
-dqcom745 compare 1 1.000001 -> -1
-dqcom746 compare 1 1.0000001 -> -1
-dqcom750 compare 0.9999999 1 -> -1
-dqcom751 compare 0.999999 1 -> -1
-dqcom752 compare 0.99999 1 -> -1
-dqcom753 compare 1.0000 1 -> 0
-dqcom754 compare 1.00001 1 -> 1
-dqcom755 compare 1.000001 1 -> 1
-dqcom756 compare 1.0000001 1 -> 1
-
--- Specials
-dqcom780 compare Inf -Inf -> 1
-dqcom781 compare Inf -1000 -> 1
-dqcom782 compare Inf -1 -> 1
-dqcom783 compare Inf -0 -> 1
-dqcom784 compare Inf 0 -> 1
-dqcom785 compare Inf 1 -> 1
-dqcom786 compare Inf 1000 -> 1
-dqcom787 compare Inf Inf -> 0
-dqcom788 compare -1000 Inf -> -1
-dqcom789 compare -Inf Inf -> -1
-dqcom790 compare -1 Inf -> -1
-dqcom791 compare -0 Inf -> -1
-dqcom792 compare 0 Inf -> -1
-dqcom793 compare 1 Inf -> -1
-dqcom794 compare 1000 Inf -> -1
-dqcom795 compare Inf Inf -> 0
-
-dqcom800 compare -Inf -Inf -> 0
-dqcom801 compare -Inf -1000 -> -1
-dqcom802 compare -Inf -1 -> -1
-dqcom803 compare -Inf -0 -> -1
-dqcom804 compare -Inf 0 -> -1
-dqcom805 compare -Inf 1 -> -1
-dqcom806 compare -Inf 1000 -> -1
-dqcom807 compare -Inf Inf -> -1
-dqcom808 compare -Inf -Inf -> 0
-dqcom809 compare -1000 -Inf -> 1
-dqcom810 compare -1 -Inf -> 1
-dqcom811 compare -0 -Inf -> 1
-dqcom812 compare 0 -Inf -> 1
-dqcom813 compare 1 -Inf -> 1
-dqcom814 compare 1000 -Inf -> 1
-dqcom815 compare Inf -Inf -> 1
-
-dqcom821 compare NaN -Inf -> NaN
-dqcom822 compare NaN -1000 -> NaN
-dqcom823 compare NaN -1 -> NaN
-dqcom824 compare NaN -0 -> NaN
-dqcom825 compare NaN 0 -> NaN
-dqcom826 compare NaN 1 -> NaN
-dqcom827 compare NaN 1000 -> NaN
-dqcom828 compare NaN Inf -> NaN
-dqcom829 compare NaN NaN -> NaN
-dqcom830 compare -Inf NaN -> NaN
-dqcom831 compare -1000 NaN -> NaN
-dqcom832 compare -1 NaN -> NaN
-dqcom833 compare -0 NaN -> NaN
-dqcom834 compare 0 NaN -> NaN
-dqcom835 compare 1 NaN -> NaN
-dqcom836 compare 1000 NaN -> NaN
-dqcom837 compare Inf NaN -> NaN
-dqcom838 compare -NaN -NaN -> -NaN
-dqcom839 compare +NaN -NaN -> NaN
-dqcom840 compare -NaN +NaN -> -NaN
-
-dqcom841 compare sNaN -Inf -> NaN Invalid_operation
-dqcom842 compare sNaN -1000 -> NaN Invalid_operation
-dqcom843 compare sNaN -1 -> NaN Invalid_operation
-dqcom844 compare sNaN -0 -> NaN Invalid_operation
-dqcom845 compare sNaN 0 -> NaN Invalid_operation
-dqcom846 compare sNaN 1 -> NaN Invalid_operation
-dqcom847 compare sNaN 1000 -> NaN Invalid_operation
-dqcom848 compare sNaN NaN -> NaN Invalid_operation
-dqcom849 compare sNaN sNaN -> NaN Invalid_operation
-dqcom850 compare NaN sNaN -> NaN Invalid_operation
-dqcom851 compare -Inf sNaN -> NaN Invalid_operation
-dqcom852 compare -1000 sNaN -> NaN Invalid_operation
-dqcom853 compare -1 sNaN -> NaN Invalid_operation
-dqcom854 compare -0 sNaN -> NaN Invalid_operation
-dqcom855 compare 0 sNaN -> NaN Invalid_operation
-dqcom856 compare 1 sNaN -> NaN Invalid_operation
-dqcom857 compare 1000 sNaN -> NaN Invalid_operation
-dqcom858 compare Inf sNaN -> NaN Invalid_operation
-dqcom859 compare NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqcom860 compare NaN9 -Inf -> NaN9
-dqcom861 compare NaN8 999 -> NaN8
-dqcom862 compare NaN77 Inf -> NaN77
-dqcom863 compare -NaN67 NaN5 -> -NaN67
-dqcom864 compare -Inf -NaN4 -> -NaN4
-dqcom865 compare -999 -NaN33 -> -NaN33
-dqcom866 compare Inf NaN2 -> NaN2
-dqcom867 compare -NaN41 -NaN42 -> -NaN41
-dqcom868 compare +NaN41 -NaN42 -> NaN41
-dqcom869 compare -NaN41 +NaN42 -> -NaN41
-dqcom870 compare +NaN41 +NaN42 -> NaN41
-
-dqcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
-dqcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
-dqcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
-dqcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
-dqcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
-dqcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
-dqcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
-dqcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- wide range
-dqcom880 compare +1.23456789012345E-0 9E+6144 -> -1
-dqcom881 compare 9E+6144 +1.23456789012345E-0 -> 1
-dqcom882 compare +0.100 9E-6143 -> 1
-dqcom883 compare 9E-6143 +0.100 -> -1
-dqcom885 compare -1.23456789012345E-0 9E+6144 -> -1
-dqcom886 compare 9E+6144 -1.23456789012345E-0 -> 1
-dqcom887 compare -0.100 9E-6143 -> -1
-dqcom888 compare 9E-6143 -0.100 -> 1
-
--- signs
-dqcom901 compare 1e+77 1e+11 -> 1
-dqcom902 compare 1e+77 -1e+11 -> 1
-dqcom903 compare -1e+77 1e+11 -> -1
-dqcom904 compare -1e+77 -1e+11 -> -1
-dqcom905 compare 1e-77 1e-11 -> -1
-dqcom906 compare 1e-77 -1e-11 -> 1
-dqcom907 compare -1e-77 1e-11 -> -1
-dqcom908 compare -1e-77 -1e-11 -> 1
-
--- full alignment range, both ways
-dqcomp1001 compare 1 1.000000000000000000000000000000000 -> 0
-dqcomp1002 compare 1 1.00000000000000000000000000000000 -> 0
-dqcomp1003 compare 1 1.0000000000000000000000000000000 -> 0
-dqcomp1004 compare 1 1.000000000000000000000000000000 -> 0
-dqcomp1005 compare 1 1.00000000000000000000000000000 -> 0
-dqcomp1006 compare 1 1.0000000000000000000000000000 -> 0
-dqcomp1007 compare 1 1.000000000000000000000000000 -> 0
-dqcomp1008 compare 1 1.00000000000000000000000000 -> 0
-dqcomp1009 compare 1 1.0000000000000000000000000 -> 0
-dqcomp1010 compare 1 1.000000000000000000000000 -> 0
-dqcomp1011 compare 1 1.00000000000000000000000 -> 0
-dqcomp1012 compare 1 1.0000000000000000000000 -> 0
-dqcomp1013 compare 1 1.000000000000000000000 -> 0
-dqcomp1014 compare 1 1.00000000000000000000 -> 0
-dqcomp1015 compare 1 1.0000000000000000000 -> 0
-dqcomp1016 compare 1 1.000000000000000000 -> 0
-dqcomp1017 compare 1 1.00000000000000000 -> 0
-dqcomp1018 compare 1 1.0000000000000000 -> 0
-dqcomp1019 compare 1 1.000000000000000 -> 0
-dqcomp1020 compare 1 1.00000000000000 -> 0
-dqcomp1021 compare 1 1.0000000000000 -> 0
-dqcomp1022 compare 1 1.000000000000 -> 0
-dqcomp1023 compare 1 1.00000000000 -> 0
-dqcomp1024 compare 1 1.0000000000 -> 0
-dqcomp1025 compare 1 1.000000000 -> 0
-dqcomp1026 compare 1 1.00000000 -> 0
-dqcomp1027 compare 1 1.0000000 -> 0
-dqcomp1028 compare 1 1.000000 -> 0
-dqcomp1029 compare 1 1.00000 -> 0
-dqcomp1030 compare 1 1.0000 -> 0
-dqcomp1031 compare 1 1.000 -> 0
-dqcomp1032 compare 1 1.00 -> 0
-dqcomp1033 compare 1 1.0 -> 0
-
-dqcomp1041 compare 1.000000000000000000000000000000000 1 -> 0
-dqcomp1042 compare 1.00000000000000000000000000000000 1 -> 0
-dqcomp1043 compare 1.0000000000000000000000000000000 1 -> 0
-dqcomp1044 compare 1.000000000000000000000000000000 1 -> 0
-dqcomp1045 compare 1.00000000000000000000000000000 1 -> 0
-dqcomp1046 compare 1.0000000000000000000000000000 1 -> 0
-dqcomp1047 compare 1.000000000000000000000000000 1 -> 0
-dqcomp1048 compare 1.00000000000000000000000000 1 -> 0
-dqcomp1049 compare 1.0000000000000000000000000 1 -> 0
-dqcomp1050 compare 1.000000000000000000000000 1 -> 0
-dqcomp1051 compare 1.00000000000000000000000 1 -> 0
-dqcomp1052 compare 1.0000000000000000000000 1 -> 0
-dqcomp1053 compare 1.000000000000000000000 1 -> 0
-dqcomp1054 compare 1.00000000000000000000 1 -> 0
-dqcomp1055 compare 1.0000000000000000000 1 -> 0
-dqcomp1056 compare 1.000000000000000000 1 -> 0
-dqcomp1057 compare 1.00000000000000000 1 -> 0
-dqcomp1058 compare 1.0000000000000000 1 -> 0
-dqcomp1059 compare 1.000000000000000 1 -> 0
-dqcomp1060 compare 1.00000000000000 1 -> 0
-dqcomp1061 compare 1.0000000000000 1 -> 0
-dqcomp1062 compare 1.000000000000 1 -> 0
-dqcomp1063 compare 1.00000000000 1 -> 0
-dqcomp1064 compare 1.0000000000 1 -> 0
-dqcomp1065 compare 1.000000000 1 -> 0
-dqcomp1066 compare 1.00000000 1 -> 0
-dqcomp1067 compare 1.0000000 1 -> 0
-dqcomp1068 compare 1.000000 1 -> 0
-dqcomp1069 compare 1.00000 1 -> 0
-dqcomp1070 compare 1.0000 1 -> 0
-dqcomp1071 compare 1.000 1 -> 0
-dqcomp1072 compare 1.00 1 -> 0
-dqcomp1073 compare 1.0 1 -> 0
-
--- check MSD always detected non-zero
-dqcomp1080 compare 0 0.000000000000000000000000000000000 -> 0
-dqcomp1081 compare 0 1.000000000000000000000000000000000 -> -1
-dqcomp1082 compare 0 2.000000000000000000000000000000000 -> -1
-dqcomp1083 compare 0 3.000000000000000000000000000000000 -> -1
-dqcomp1084 compare 0 4.000000000000000000000000000000000 -> -1
-dqcomp1085 compare 0 5.000000000000000000000000000000000 -> -1
-dqcomp1086 compare 0 6.000000000000000000000000000000000 -> -1
-dqcomp1087 compare 0 7.000000000000000000000000000000000 -> -1
-dqcomp1088 compare 0 8.000000000000000000000000000000000 -> -1
-dqcomp1089 compare 0 9.000000000000000000000000000000000 -> -1
-dqcomp1090 compare 0.000000000000000000000000000000000 0 -> 0
-dqcomp1091 compare 1.000000000000000000000000000000000 0 -> 1
-dqcomp1092 compare 2.000000000000000000000000000000000 0 -> 1
-dqcomp1093 compare 3.000000000000000000000000000000000 0 -> 1
-dqcomp1094 compare 4.000000000000000000000000000000000 0 -> 1
-dqcomp1095 compare 5.000000000000000000000000000000000 0 -> 1
-dqcomp1096 compare 6.000000000000000000000000000000000 0 -> 1
-dqcomp1097 compare 7.000000000000000000000000000000000 0 -> 1
-dqcomp1098 compare 8.000000000000000000000000000000000 0 -> 1
-dqcomp1099 compare 9.000000000000000000000000000000000 0 -> 1
-
--- Null tests
-dqcom990 compare 10 # -> NaN Invalid_operation
-dqcom991 compare # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqCompare.decTest -- decQuad comparison that allows quiet NaNs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqcom001 compare -2 -2 -> 0
+dqcom002 compare -2 -1 -> -1
+dqcom003 compare -2 0 -> -1
+dqcom004 compare -2 1 -> -1
+dqcom005 compare -2 2 -> -1
+dqcom006 compare -1 -2 -> 1
+dqcom007 compare -1 -1 -> 0
+dqcom008 compare -1 0 -> -1
+dqcom009 compare -1 1 -> -1
+dqcom010 compare -1 2 -> -1
+dqcom011 compare 0 -2 -> 1
+dqcom012 compare 0 -1 -> 1
+dqcom013 compare 0 0 -> 0
+dqcom014 compare 0 1 -> -1
+dqcom015 compare 0 2 -> -1
+dqcom016 compare 1 -2 -> 1
+dqcom017 compare 1 -1 -> 1
+dqcom018 compare 1 0 -> 1
+dqcom019 compare 1 1 -> 0
+dqcom020 compare 1 2 -> -1
+dqcom021 compare 2 -2 -> 1
+dqcom022 compare 2 -1 -> 1
+dqcom023 compare 2 0 -> 1
+dqcom025 compare 2 1 -> 1
+dqcom026 compare 2 2 -> 0
+
+dqcom031 compare -20 -20 -> 0
+dqcom032 compare -20 -10 -> -1
+dqcom033 compare -20 00 -> -1
+dqcom034 compare -20 10 -> -1
+dqcom035 compare -20 20 -> -1
+dqcom036 compare -10 -20 -> 1
+dqcom037 compare -10 -10 -> 0
+dqcom038 compare -10 00 -> -1
+dqcom039 compare -10 10 -> -1
+dqcom040 compare -10 20 -> -1
+dqcom041 compare 00 -20 -> 1
+dqcom042 compare 00 -10 -> 1
+dqcom043 compare 00 00 -> 0
+dqcom044 compare 00 10 -> -1
+dqcom045 compare 00 20 -> -1
+dqcom046 compare 10 -20 -> 1
+dqcom047 compare 10 -10 -> 1
+dqcom048 compare 10 00 -> 1
+dqcom049 compare 10 10 -> 0
+dqcom050 compare 10 20 -> -1
+dqcom051 compare 20 -20 -> 1
+dqcom052 compare 20 -10 -> 1
+dqcom053 compare 20 00 -> 1
+dqcom055 compare 20 10 -> 1
+dqcom056 compare 20 20 -> 0
+
+dqcom061 compare -2.0 -2.0 -> 0
+dqcom062 compare -2.0 -1.0 -> -1
+dqcom063 compare -2.0 0.0 -> -1
+dqcom064 compare -2.0 1.0 -> -1
+dqcom065 compare -2.0 2.0 -> -1
+dqcom066 compare -1.0 -2.0 -> 1
+dqcom067 compare -1.0 -1.0 -> 0
+dqcom068 compare -1.0 0.0 -> -1
+dqcom069 compare -1.0 1.0 -> -1
+dqcom070 compare -1.0 2.0 -> -1
+dqcom071 compare 0.0 -2.0 -> 1
+dqcom072 compare 0.0 -1.0 -> 1
+dqcom073 compare 0.0 0.0 -> 0
+dqcom074 compare 0.0 1.0 -> -1
+dqcom075 compare 0.0 2.0 -> -1
+dqcom076 compare 1.0 -2.0 -> 1
+dqcom077 compare 1.0 -1.0 -> 1
+dqcom078 compare 1.0 0.0 -> 1
+dqcom079 compare 1.0 1.0 -> 0
+dqcom080 compare 1.0 2.0 -> -1
+dqcom081 compare 2.0 -2.0 -> 1
+dqcom082 compare 2.0 -1.0 -> 1
+dqcom083 compare 2.0 0.0 -> 1
+dqcom085 compare 2.0 1.0 -> 1
+dqcom086 compare 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+dqcom090 compare 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0
+dqcom091 compare -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1
+dqcom092 compare 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1
+dqcom093 compare -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0
+
+-- some differing length/exponent cases
+dqcom100 compare 7.0 7.0 -> 0
+dqcom101 compare 7.0 7 -> 0
+dqcom102 compare 7 7.0 -> 0
+dqcom103 compare 7E+0 7.0 -> 0
+dqcom104 compare 70E-1 7.0 -> 0
+dqcom105 compare 0.7E+1 7 -> 0
+dqcom106 compare 70E-1 7 -> 0
+dqcom107 compare 7.0 7E+0 -> 0
+dqcom108 compare 7.0 70E-1 -> 0
+dqcom109 compare 7 0.7E+1 -> 0
+dqcom110 compare 7 70E-1 -> 0
+
+dqcom120 compare 8.0 7.0 -> 1
+dqcom121 compare 8.0 7 -> 1
+dqcom122 compare 8 7.0 -> 1
+dqcom123 compare 8E+0 7.0 -> 1
+dqcom124 compare 80E-1 7.0 -> 1
+dqcom125 compare 0.8E+1 7 -> 1
+dqcom126 compare 80E-1 7 -> 1
+dqcom127 compare 8.0 7E+0 -> 1
+dqcom128 compare 8.0 70E-1 -> 1
+dqcom129 compare 8 0.7E+1 -> 1
+dqcom130 compare 8 70E-1 -> 1
+
+dqcom140 compare 8.0 9.0 -> -1
+dqcom141 compare 8.0 9 -> -1
+dqcom142 compare 8 9.0 -> -1
+dqcom143 compare 8E+0 9.0 -> -1
+dqcom144 compare 80E-1 9.0 -> -1
+dqcom145 compare 0.8E+1 9 -> -1
+dqcom146 compare 80E-1 9 -> -1
+dqcom147 compare 8.0 9E+0 -> -1
+dqcom148 compare 8.0 90E-1 -> -1
+dqcom149 compare 8 0.9E+1 -> -1
+dqcom150 compare 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+dqcom200 compare -7.0 7.0 -> -1
+dqcom201 compare -7.0 7 -> -1
+dqcom202 compare -7 7.0 -> -1
+dqcom203 compare -7E+0 7.0 -> -1
+dqcom204 compare -70E-1 7.0 -> -1
+dqcom205 compare -0.7E+1 7 -> -1
+dqcom206 compare -70E-1 7 -> -1
+dqcom207 compare -7.0 7E+0 -> -1
+dqcom208 compare -7.0 70E-1 -> -1
+dqcom209 compare -7 0.7E+1 -> -1
+dqcom210 compare -7 70E-1 -> -1
+
+dqcom220 compare -8.0 7.0 -> -1
+dqcom221 compare -8.0 7 -> -1
+dqcom222 compare -8 7.0 -> -1
+dqcom223 compare -8E+0 7.0 -> -1
+dqcom224 compare -80E-1 7.0 -> -1
+dqcom225 compare -0.8E+1 7 -> -1
+dqcom226 compare -80E-1 7 -> -1
+dqcom227 compare -8.0 7E+0 -> -1
+dqcom228 compare -8.0 70E-1 -> -1
+dqcom229 compare -8 0.7E+1 -> -1
+dqcom230 compare -8 70E-1 -> -1
+
+dqcom240 compare -8.0 9.0 -> -1
+dqcom241 compare -8.0 9 -> -1
+dqcom242 compare -8 9.0 -> -1
+dqcom243 compare -8E+0 9.0 -> -1
+dqcom244 compare -80E-1 9.0 -> -1
+dqcom245 compare -0.8E+1 9 -> -1
+dqcom246 compare -80E-1 9 -> -1
+dqcom247 compare -8.0 9E+0 -> -1
+dqcom248 compare -8.0 90E-1 -> -1
+dqcom249 compare -8 0.9E+1 -> -1
+dqcom250 compare -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+dqcom300 compare 7.0 -7.0 -> 1
+dqcom301 compare 7.0 -7 -> 1
+dqcom302 compare 7 -7.0 -> 1
+dqcom303 compare 7E+0 -7.0 -> 1
+dqcom304 compare 70E-1 -7.0 -> 1
+dqcom305 compare .7E+1 -7 -> 1
+dqcom306 compare 70E-1 -7 -> 1
+dqcom307 compare 7.0 -7E+0 -> 1
+dqcom308 compare 7.0 -70E-1 -> 1
+dqcom309 compare 7 -.7E+1 -> 1
+dqcom310 compare 7 -70E-1 -> 1
+
+dqcom320 compare 8.0 -7.0 -> 1
+dqcom321 compare 8.0 -7 -> 1
+dqcom322 compare 8 -7.0 -> 1
+dqcom323 compare 8E+0 -7.0 -> 1
+dqcom324 compare 80E-1 -7.0 -> 1
+dqcom325 compare .8E+1 -7 -> 1
+dqcom326 compare 80E-1 -7 -> 1
+dqcom327 compare 8.0 -7E+0 -> 1
+dqcom328 compare 8.0 -70E-1 -> 1
+dqcom329 compare 8 -.7E+1 -> 1
+dqcom330 compare 8 -70E-1 -> 1
+
+dqcom340 compare 8.0 -9.0 -> 1
+dqcom341 compare 8.0 -9 -> 1
+dqcom342 compare 8 -9.0 -> 1
+dqcom343 compare 8E+0 -9.0 -> 1
+dqcom344 compare 80E-1 -9.0 -> 1
+dqcom345 compare .8E+1 -9 -> 1
+dqcom346 compare 80E-1 -9 -> 1
+dqcom347 compare 8.0 -9E+0 -> 1
+dqcom348 compare 8.0 -90E-1 -> 1
+dqcom349 compare 8 -.9E+1 -> 1
+dqcom350 compare 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+dqcom400 compare -7.0 -7.0 -> 0
+dqcom401 compare -7.0 -7 -> 0
+dqcom402 compare -7 -7.0 -> 0
+dqcom403 compare -7E+0 -7.0 -> 0
+dqcom404 compare -70E-1 -7.0 -> 0
+dqcom405 compare -.7E+1 -7 -> 0
+dqcom406 compare -70E-1 -7 -> 0
+dqcom407 compare -7.0 -7E+0 -> 0
+dqcom408 compare -7.0 -70E-1 -> 0
+dqcom409 compare -7 -.7E+1 -> 0
+dqcom410 compare -7 -70E-1 -> 0
+
+dqcom420 compare -8.0 -7.0 -> -1
+dqcom421 compare -8.0 -7 -> -1
+dqcom422 compare -8 -7.0 -> -1
+dqcom423 compare -8E+0 -7.0 -> -1
+dqcom424 compare -80E-1 -7.0 -> -1
+dqcom425 compare -.8E+1 -7 -> -1
+dqcom426 compare -80E-1 -7 -> -1
+dqcom427 compare -8.0 -7E+0 -> -1
+dqcom428 compare -8.0 -70E-1 -> -1
+dqcom429 compare -8 -.7E+1 -> -1
+dqcom430 compare -8 -70E-1 -> -1
+
+dqcom440 compare -8.0 -9.0 -> 1
+dqcom441 compare -8.0 -9 -> 1
+dqcom442 compare -8 -9.0 -> 1
+dqcom443 compare -8E+0 -9.0 -> 1
+dqcom444 compare -80E-1 -9.0 -> 1
+dqcom445 compare -.8E+1 -9 -> 1
+dqcom446 compare -80E-1 -9 -> 1
+dqcom447 compare -8.0 -9E+0 -> 1
+dqcom448 compare -8.0 -90E-1 -> 1
+dqcom449 compare -8 -.9E+1 -> 1
+dqcom450 compare -8 -90E-1 -> 1
+
+-- misalignment traps for little-endian
+dqcom451 compare 1.0 0.1 -> 1
+dqcom452 compare 0.1 1.0 -> -1
+dqcom453 compare 10.0 0.1 -> 1
+dqcom454 compare 0.1 10.0 -> -1
+dqcom455 compare 100 1.0 -> 1
+dqcom456 compare 1.0 100 -> -1
+dqcom457 compare 1000 10.0 -> 1
+dqcom458 compare 10.0 1000 -> -1
+dqcom459 compare 10000 100.0 -> 1
+dqcom460 compare 100.0 10000 -> -1
+dqcom461 compare 100000 1000.0 -> 1
+dqcom462 compare 1000.0 100000 -> -1
+dqcom463 compare 1000000 10000.0 -> 1
+dqcom464 compare 10000.0 1000000 -> -1
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+dqcom473 compare 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0
+dqcom474 compare 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0
+dqcom475 compare 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0
+dqcom476 compare 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0
+dqcom477 compare 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0
+dqcom478 compare 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0
+dqcom479 compare 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0
+dqcom480 compare 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0
+dqcom481 compare 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0
+dqcom482 compare 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0
+dqcom483 compare 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0
+dqcom487 compare 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0
+dqcom488 compare 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0
+dqcom489 compare 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0
+dqcom490 compare 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0
+dqcom491 compare 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0
+dqcom492 compare 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0
+dqcom493 compare 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0
+dqcom494 compare 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0
+dqcom495 compare 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0
+dqcom496 compare 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0
+dqcom497 compare 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+dqcom500 compare 1 1E-15 -> 1
+dqcom501 compare 1 1E-14 -> 1
+dqcom502 compare 1 1E-13 -> 1
+dqcom503 compare 1 1E-12 -> 1
+dqcom504 compare 1 1E-11 -> 1
+dqcom505 compare 1 1E-10 -> 1
+dqcom506 compare 1 1E-9 -> 1
+dqcom507 compare 1 1E-8 -> 1
+dqcom508 compare 1 1E-7 -> 1
+dqcom509 compare 1 1E-6 -> 1
+dqcom510 compare 1 1E-5 -> 1
+dqcom511 compare 1 1E-4 -> 1
+dqcom512 compare 1 1E-3 -> 1
+dqcom513 compare 1 1E-2 -> 1
+dqcom514 compare 1 1E-1 -> 1
+dqcom515 compare 1 1E-0 -> 0
+dqcom516 compare 1 1E+1 -> -1
+dqcom517 compare 1 1E+2 -> -1
+dqcom518 compare 1 1E+3 -> -1
+dqcom519 compare 1 1E+4 -> -1
+dqcom521 compare 1 1E+5 -> -1
+dqcom522 compare 1 1E+6 -> -1
+dqcom523 compare 1 1E+7 -> -1
+dqcom524 compare 1 1E+8 -> -1
+dqcom525 compare 1 1E+9 -> -1
+dqcom526 compare 1 1E+10 -> -1
+dqcom527 compare 1 1E+11 -> -1
+dqcom528 compare 1 1E+12 -> -1
+dqcom529 compare 1 1E+13 -> -1
+dqcom530 compare 1 1E+14 -> -1
+dqcom531 compare 1 1E+15 -> -1
+-- LR swap
+dqcom540 compare 1E-15 1 -> -1
+dqcom541 compare 1E-14 1 -> -1
+dqcom542 compare 1E-13 1 -> -1
+dqcom543 compare 1E-12 1 -> -1
+dqcom544 compare 1E-11 1 -> -1
+dqcom545 compare 1E-10 1 -> -1
+dqcom546 compare 1E-9 1 -> -1
+dqcom547 compare 1E-8 1 -> -1
+dqcom548 compare 1E-7 1 -> -1
+dqcom549 compare 1E-6 1 -> -1
+dqcom550 compare 1E-5 1 -> -1
+dqcom551 compare 1E-4 1 -> -1
+dqcom552 compare 1E-3 1 -> -1
+dqcom553 compare 1E-2 1 -> -1
+dqcom554 compare 1E-1 1 -> -1
+dqcom555 compare 1E-0 1 -> 0
+dqcom556 compare 1E+1 1 -> 1
+dqcom557 compare 1E+2 1 -> 1
+dqcom558 compare 1E+3 1 -> 1
+dqcom559 compare 1E+4 1 -> 1
+dqcom561 compare 1E+5 1 -> 1
+dqcom562 compare 1E+6 1 -> 1
+dqcom563 compare 1E+7 1 -> 1
+dqcom564 compare 1E+8 1 -> 1
+dqcom565 compare 1E+9 1 -> 1
+dqcom566 compare 1E+10 1 -> 1
+dqcom567 compare 1E+11 1 -> 1
+dqcom568 compare 1E+12 1 -> 1
+dqcom569 compare 1E+13 1 -> 1
+dqcom570 compare 1E+14 1 -> 1
+dqcom571 compare 1E+15 1 -> 1
+-- similar with a useful coefficient, one side only
+dqcom580 compare 0.000000987654321 1E-15 -> 1
+dqcom581 compare 0.000000987654321 1E-14 -> 1
+dqcom582 compare 0.000000987654321 1E-13 -> 1
+dqcom583 compare 0.000000987654321 1E-12 -> 1
+dqcom584 compare 0.000000987654321 1E-11 -> 1
+dqcom585 compare 0.000000987654321 1E-10 -> 1
+dqcom586 compare 0.000000987654321 1E-9 -> 1
+dqcom587 compare 0.000000987654321 1E-8 -> 1
+dqcom588 compare 0.000000987654321 1E-7 -> 1
+dqcom589 compare 0.000000987654321 1E-6 -> -1
+dqcom590 compare 0.000000987654321 1E-5 -> -1
+dqcom591 compare 0.000000987654321 1E-4 -> -1
+dqcom592 compare 0.000000987654321 1E-3 -> -1
+dqcom593 compare 0.000000987654321 1E-2 -> -1
+dqcom594 compare 0.000000987654321 1E-1 -> -1
+dqcom595 compare 0.000000987654321 1E-0 -> -1
+dqcom596 compare 0.000000987654321 1E+1 -> -1
+dqcom597 compare 0.000000987654321 1E+2 -> -1
+dqcom598 compare 0.000000987654321 1E+3 -> -1
+dqcom599 compare 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+dqcom600 compare 12 12.2345 -> -1
+dqcom601 compare 12.0 12.2345 -> -1
+dqcom602 compare 12.00 12.2345 -> -1
+dqcom603 compare 12.000 12.2345 -> -1
+dqcom604 compare 12.0000 12.2345 -> -1
+dqcom605 compare 12.00000 12.2345 -> -1
+dqcom606 compare 12.000000 12.2345 -> -1
+dqcom607 compare 12.0000000 12.2345 -> -1
+dqcom608 compare 12.00000000 12.2345 -> -1
+dqcom609 compare 12.000000000 12.2345 -> -1
+dqcom610 compare 12.1234 12 -> 1
+dqcom611 compare 12.1234 12.0 -> 1
+dqcom612 compare 12.1234 12.00 -> 1
+dqcom613 compare 12.1234 12.000 -> 1
+dqcom614 compare 12.1234 12.0000 -> 1
+dqcom615 compare 12.1234 12.00000 -> 1
+dqcom616 compare 12.1234 12.000000 -> 1
+dqcom617 compare 12.1234 12.0000000 -> 1
+dqcom618 compare 12.1234 12.00000000 -> 1
+dqcom619 compare 12.1234 12.000000000 -> 1
+dqcom620 compare -12 -12.2345 -> 1
+dqcom621 compare -12.0 -12.2345 -> 1
+dqcom622 compare -12.00 -12.2345 -> 1
+dqcom623 compare -12.000 -12.2345 -> 1
+dqcom624 compare -12.0000 -12.2345 -> 1
+dqcom625 compare -12.00000 -12.2345 -> 1
+dqcom626 compare -12.000000 -12.2345 -> 1
+dqcom627 compare -12.0000000 -12.2345 -> 1
+dqcom628 compare -12.00000000 -12.2345 -> 1
+dqcom629 compare -12.000000000 -12.2345 -> 1
+dqcom630 compare -12.1234 -12 -> -1
+dqcom631 compare -12.1234 -12.0 -> -1
+dqcom632 compare -12.1234 -12.00 -> -1
+dqcom633 compare -12.1234 -12.000 -> -1
+dqcom634 compare -12.1234 -12.0000 -> -1
+dqcom635 compare -12.1234 -12.00000 -> -1
+dqcom636 compare -12.1234 -12.000000 -> -1
+dqcom637 compare -12.1234 -12.0000000 -> -1
+dqcom638 compare -12.1234 -12.00000000 -> -1
+dqcom639 compare -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+dqcom640 compare 0 0 -> 0
+dqcom641 compare 0 -0 -> 0
+dqcom642 compare 0 -0.0 -> 0
+dqcom643 compare 0 0.0 -> 0
+dqcom644 compare -0 0 -> 0
+dqcom645 compare -0 -0 -> 0
+dqcom646 compare -0 -0.0 -> 0
+dqcom647 compare -0 0.0 -> 0
+dqcom648 compare 0.0 0 -> 0
+dqcom649 compare 0.0 -0 -> 0
+dqcom650 compare 0.0 -0.0 -> 0
+dqcom651 compare 0.0 0.0 -> 0
+dqcom652 compare -0.0 0 -> 0
+dqcom653 compare -0.0 -0 -> 0
+dqcom654 compare -0.0 -0.0 -> 0
+dqcom655 compare -0.0 0.0 -> 0
+
+dqcom656 compare -0E1 0.0 -> 0
+dqcom657 compare -0E2 0.0 -> 0
+dqcom658 compare 0E1 0.0 -> 0
+dqcom659 compare 0E2 0.0 -> 0
+dqcom660 compare -0E1 0 -> 0
+dqcom661 compare -0E2 0 -> 0
+dqcom662 compare 0E1 0 -> 0
+dqcom663 compare 0E2 0 -> 0
+dqcom664 compare -0E1 -0E1 -> 0
+dqcom665 compare -0E2 -0E1 -> 0
+dqcom666 compare 0E1 -0E1 -> 0
+dqcom667 compare 0E2 -0E1 -> 0
+dqcom668 compare -0E1 -0E2 -> 0
+dqcom669 compare -0E2 -0E2 -> 0
+dqcom670 compare 0E1 -0E2 -> 0
+dqcom671 compare 0E2 -0E2 -> 0
+dqcom672 compare -0E1 0E1 -> 0
+dqcom673 compare -0E2 0E1 -> 0
+dqcom674 compare 0E1 0E1 -> 0
+dqcom675 compare 0E2 0E1 -> 0
+dqcom676 compare -0E1 0E2 -> 0
+dqcom677 compare -0E2 0E2 -> 0
+dqcom678 compare 0E1 0E2 -> 0
+dqcom679 compare 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+dqcom680 compare 12 12 -> 0
+dqcom681 compare 12 12.0 -> 0
+dqcom682 compare 12 12.00 -> 0
+dqcom683 compare 12 12.000 -> 0
+dqcom684 compare 12 12.0000 -> 0
+dqcom685 compare 12 12.00000 -> 0
+dqcom686 compare 12 12.000000 -> 0
+dqcom687 compare 12 12.0000000 -> 0
+dqcom688 compare 12 12.00000000 -> 0
+dqcom689 compare 12 12.000000000 -> 0
+dqcom690 compare 12 12 -> 0
+dqcom691 compare 12.0 12 -> 0
+dqcom692 compare 12.00 12 -> 0
+dqcom693 compare 12.000 12 -> 0
+dqcom694 compare 12.0000 12 -> 0
+dqcom695 compare 12.00000 12 -> 0
+dqcom696 compare 12.000000 12 -> 0
+dqcom697 compare 12.0000000 12 -> 0
+dqcom698 compare 12.00000000 12 -> 0
+dqcom699 compare 12.000000000 12 -> 0
+
+-- first, second, & last digit
+dqcom700 compare 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1
+dqcom701 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
+dqcom702 compare 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1
+dqcom703 compare 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1
+dqcom704 compare 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
+dqcom705 compare 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1
+dqcom706 compare 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1
+dqcom707 compare 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0
+dqcom708 compare 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1
+
+-- miscellaneous
+dqcom721 compare 12345678000 1 -> 1
+dqcom722 compare 1 12345678000 -> -1
+dqcom723 compare 1234567800 1 -> 1
+dqcom724 compare 1 1234567800 -> -1
+dqcom725 compare 1234567890 1 -> 1
+dqcom726 compare 1 1234567890 -> -1
+dqcom727 compare 1234567891 1 -> 1
+dqcom728 compare 1 1234567891 -> -1
+dqcom729 compare 12345678901 1 -> 1
+dqcom730 compare 1 12345678901 -> -1
+dqcom731 compare 1234567896 1 -> 1
+dqcom732 compare 1 1234567896 -> -1
+
+-- residue cases at lower precision
+dqcom740 compare 1 0.9999999 -> 1
+dqcom741 compare 1 0.999999 -> 1
+dqcom742 compare 1 0.99999 -> 1
+dqcom743 compare 1 1.0000 -> 0
+dqcom744 compare 1 1.00001 -> -1
+dqcom745 compare 1 1.000001 -> -1
+dqcom746 compare 1 1.0000001 -> -1
+dqcom750 compare 0.9999999 1 -> -1
+dqcom751 compare 0.999999 1 -> -1
+dqcom752 compare 0.99999 1 -> -1
+dqcom753 compare 1.0000 1 -> 0
+dqcom754 compare 1.00001 1 -> 1
+dqcom755 compare 1.000001 1 -> 1
+dqcom756 compare 1.0000001 1 -> 1
+
+-- Specials
+dqcom780 compare Inf -Inf -> 1
+dqcom781 compare Inf -1000 -> 1
+dqcom782 compare Inf -1 -> 1
+dqcom783 compare Inf -0 -> 1
+dqcom784 compare Inf 0 -> 1
+dqcom785 compare Inf 1 -> 1
+dqcom786 compare Inf 1000 -> 1
+dqcom787 compare Inf Inf -> 0
+dqcom788 compare -1000 Inf -> -1
+dqcom789 compare -Inf Inf -> -1
+dqcom790 compare -1 Inf -> -1
+dqcom791 compare -0 Inf -> -1
+dqcom792 compare 0 Inf -> -1
+dqcom793 compare 1 Inf -> -1
+dqcom794 compare 1000 Inf -> -1
+dqcom795 compare Inf Inf -> 0
+
+dqcom800 compare -Inf -Inf -> 0
+dqcom801 compare -Inf -1000 -> -1
+dqcom802 compare -Inf -1 -> -1
+dqcom803 compare -Inf -0 -> -1
+dqcom804 compare -Inf 0 -> -1
+dqcom805 compare -Inf 1 -> -1
+dqcom806 compare -Inf 1000 -> -1
+dqcom807 compare -Inf Inf -> -1
+dqcom808 compare -Inf -Inf -> 0
+dqcom809 compare -1000 -Inf -> 1
+dqcom810 compare -1 -Inf -> 1
+dqcom811 compare -0 -Inf -> 1
+dqcom812 compare 0 -Inf -> 1
+dqcom813 compare 1 -Inf -> 1
+dqcom814 compare 1000 -Inf -> 1
+dqcom815 compare Inf -Inf -> 1
+
+dqcom821 compare NaN -Inf -> NaN
+dqcom822 compare NaN -1000 -> NaN
+dqcom823 compare NaN -1 -> NaN
+dqcom824 compare NaN -0 -> NaN
+dqcom825 compare NaN 0 -> NaN
+dqcom826 compare NaN 1 -> NaN
+dqcom827 compare NaN 1000 -> NaN
+dqcom828 compare NaN Inf -> NaN
+dqcom829 compare NaN NaN -> NaN
+dqcom830 compare -Inf NaN -> NaN
+dqcom831 compare -1000 NaN -> NaN
+dqcom832 compare -1 NaN -> NaN
+dqcom833 compare -0 NaN -> NaN
+dqcom834 compare 0 NaN -> NaN
+dqcom835 compare 1 NaN -> NaN
+dqcom836 compare 1000 NaN -> NaN
+dqcom837 compare Inf NaN -> NaN
+dqcom838 compare -NaN -NaN -> -NaN
+dqcom839 compare +NaN -NaN -> NaN
+dqcom840 compare -NaN +NaN -> -NaN
+
+dqcom841 compare sNaN -Inf -> NaN Invalid_operation
+dqcom842 compare sNaN -1000 -> NaN Invalid_operation
+dqcom843 compare sNaN -1 -> NaN Invalid_operation
+dqcom844 compare sNaN -0 -> NaN Invalid_operation
+dqcom845 compare sNaN 0 -> NaN Invalid_operation
+dqcom846 compare sNaN 1 -> NaN Invalid_operation
+dqcom847 compare sNaN 1000 -> NaN Invalid_operation
+dqcom848 compare sNaN NaN -> NaN Invalid_operation
+dqcom849 compare sNaN sNaN -> NaN Invalid_operation
+dqcom850 compare NaN sNaN -> NaN Invalid_operation
+dqcom851 compare -Inf sNaN -> NaN Invalid_operation
+dqcom852 compare -1000 sNaN -> NaN Invalid_operation
+dqcom853 compare -1 sNaN -> NaN Invalid_operation
+dqcom854 compare -0 sNaN -> NaN Invalid_operation
+dqcom855 compare 0 sNaN -> NaN Invalid_operation
+dqcom856 compare 1 sNaN -> NaN Invalid_operation
+dqcom857 compare 1000 sNaN -> NaN Invalid_operation
+dqcom858 compare Inf sNaN -> NaN Invalid_operation
+dqcom859 compare NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqcom860 compare NaN9 -Inf -> NaN9
+dqcom861 compare NaN8 999 -> NaN8
+dqcom862 compare NaN77 Inf -> NaN77
+dqcom863 compare -NaN67 NaN5 -> -NaN67
+dqcom864 compare -Inf -NaN4 -> -NaN4
+dqcom865 compare -999 -NaN33 -> -NaN33
+dqcom866 compare Inf NaN2 -> NaN2
+dqcom867 compare -NaN41 -NaN42 -> -NaN41
+dqcom868 compare +NaN41 -NaN42 -> NaN41
+dqcom869 compare -NaN41 +NaN42 -> -NaN41
+dqcom870 compare +NaN41 +NaN42 -> NaN41
+
+dqcom871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqcom872 compare sNaN98 -11 -> NaN98 Invalid_operation
+dqcom873 compare sNaN97 NaN -> NaN97 Invalid_operation
+dqcom874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
+dqcom875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
+dqcom876 compare -Inf sNaN92 -> NaN92 Invalid_operation
+dqcom877 compare 088 sNaN81 -> NaN81 Invalid_operation
+dqcom878 compare Inf sNaN90 -> NaN90 Invalid_operation
+dqcom879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- wide range
+dqcom880 compare +1.23456789012345E-0 9E+6144 -> -1
+dqcom881 compare 9E+6144 +1.23456789012345E-0 -> 1
+dqcom882 compare +0.100 9E-6143 -> 1
+dqcom883 compare 9E-6143 +0.100 -> -1
+dqcom885 compare -1.23456789012345E-0 9E+6144 -> -1
+dqcom886 compare 9E+6144 -1.23456789012345E-0 -> 1
+dqcom887 compare -0.100 9E-6143 -> -1
+dqcom888 compare 9E-6143 -0.100 -> 1
+
+-- signs
+dqcom901 compare 1e+77 1e+11 -> 1
+dqcom902 compare 1e+77 -1e+11 -> 1
+dqcom903 compare -1e+77 1e+11 -> -1
+dqcom904 compare -1e+77 -1e+11 -> -1
+dqcom905 compare 1e-77 1e-11 -> -1
+dqcom906 compare 1e-77 -1e-11 -> 1
+dqcom907 compare -1e-77 1e-11 -> -1
+dqcom908 compare -1e-77 -1e-11 -> 1
+
+-- full alignment range, both ways
+dqcomp1001 compare 1 1.000000000000000000000000000000000 -> 0
+dqcomp1002 compare 1 1.00000000000000000000000000000000 -> 0
+dqcomp1003 compare 1 1.0000000000000000000000000000000 -> 0
+dqcomp1004 compare 1 1.000000000000000000000000000000 -> 0
+dqcomp1005 compare 1 1.00000000000000000000000000000 -> 0
+dqcomp1006 compare 1 1.0000000000000000000000000000 -> 0
+dqcomp1007 compare 1 1.000000000000000000000000000 -> 0
+dqcomp1008 compare 1 1.00000000000000000000000000 -> 0
+dqcomp1009 compare 1 1.0000000000000000000000000 -> 0
+dqcomp1010 compare 1 1.000000000000000000000000 -> 0
+dqcomp1011 compare 1 1.00000000000000000000000 -> 0
+dqcomp1012 compare 1 1.0000000000000000000000 -> 0
+dqcomp1013 compare 1 1.000000000000000000000 -> 0
+dqcomp1014 compare 1 1.00000000000000000000 -> 0
+dqcomp1015 compare 1 1.0000000000000000000 -> 0
+dqcomp1016 compare 1 1.000000000000000000 -> 0
+dqcomp1017 compare 1 1.00000000000000000 -> 0
+dqcomp1018 compare 1 1.0000000000000000 -> 0
+dqcomp1019 compare 1 1.000000000000000 -> 0
+dqcomp1020 compare 1 1.00000000000000 -> 0
+dqcomp1021 compare 1 1.0000000000000 -> 0
+dqcomp1022 compare 1 1.000000000000 -> 0
+dqcomp1023 compare 1 1.00000000000 -> 0
+dqcomp1024 compare 1 1.0000000000 -> 0
+dqcomp1025 compare 1 1.000000000 -> 0
+dqcomp1026 compare 1 1.00000000 -> 0
+dqcomp1027 compare 1 1.0000000 -> 0
+dqcomp1028 compare 1 1.000000 -> 0
+dqcomp1029 compare 1 1.00000 -> 0
+dqcomp1030 compare 1 1.0000 -> 0
+dqcomp1031 compare 1 1.000 -> 0
+dqcomp1032 compare 1 1.00 -> 0
+dqcomp1033 compare 1 1.0 -> 0
+
+dqcomp1041 compare 1.000000000000000000000000000000000 1 -> 0
+dqcomp1042 compare 1.00000000000000000000000000000000 1 -> 0
+dqcomp1043 compare 1.0000000000000000000000000000000 1 -> 0
+dqcomp1044 compare 1.000000000000000000000000000000 1 -> 0
+dqcomp1045 compare 1.00000000000000000000000000000 1 -> 0
+dqcomp1046 compare 1.0000000000000000000000000000 1 -> 0
+dqcomp1047 compare 1.000000000000000000000000000 1 -> 0
+dqcomp1048 compare 1.00000000000000000000000000 1 -> 0
+dqcomp1049 compare 1.0000000000000000000000000 1 -> 0
+dqcomp1050 compare 1.000000000000000000000000 1 -> 0
+dqcomp1051 compare 1.00000000000000000000000 1 -> 0
+dqcomp1052 compare 1.0000000000000000000000 1 -> 0
+dqcomp1053 compare 1.000000000000000000000 1 -> 0
+dqcomp1054 compare 1.00000000000000000000 1 -> 0
+dqcomp1055 compare 1.0000000000000000000 1 -> 0
+dqcomp1056 compare 1.000000000000000000 1 -> 0
+dqcomp1057 compare 1.00000000000000000 1 -> 0
+dqcomp1058 compare 1.0000000000000000 1 -> 0
+dqcomp1059 compare 1.000000000000000 1 -> 0
+dqcomp1060 compare 1.00000000000000 1 -> 0
+dqcomp1061 compare 1.0000000000000 1 -> 0
+dqcomp1062 compare 1.000000000000 1 -> 0
+dqcomp1063 compare 1.00000000000 1 -> 0
+dqcomp1064 compare 1.0000000000 1 -> 0
+dqcomp1065 compare 1.000000000 1 -> 0
+dqcomp1066 compare 1.00000000 1 -> 0
+dqcomp1067 compare 1.0000000 1 -> 0
+dqcomp1068 compare 1.000000 1 -> 0
+dqcomp1069 compare 1.00000 1 -> 0
+dqcomp1070 compare 1.0000 1 -> 0
+dqcomp1071 compare 1.000 1 -> 0
+dqcomp1072 compare 1.00 1 -> 0
+dqcomp1073 compare 1.0 1 -> 0
+
+-- check MSD always detected non-zero
+dqcomp1080 compare 0 0.000000000000000000000000000000000 -> 0
+dqcomp1081 compare 0 1.000000000000000000000000000000000 -> -1
+dqcomp1082 compare 0 2.000000000000000000000000000000000 -> -1
+dqcomp1083 compare 0 3.000000000000000000000000000000000 -> -1
+dqcomp1084 compare 0 4.000000000000000000000000000000000 -> -1
+dqcomp1085 compare 0 5.000000000000000000000000000000000 -> -1
+dqcomp1086 compare 0 6.000000000000000000000000000000000 -> -1
+dqcomp1087 compare 0 7.000000000000000000000000000000000 -> -1
+dqcomp1088 compare 0 8.000000000000000000000000000000000 -> -1
+dqcomp1089 compare 0 9.000000000000000000000000000000000 -> -1
+dqcomp1090 compare 0.000000000000000000000000000000000 0 -> 0
+dqcomp1091 compare 1.000000000000000000000000000000000 0 -> 1
+dqcomp1092 compare 2.000000000000000000000000000000000 0 -> 1
+dqcomp1093 compare 3.000000000000000000000000000000000 0 -> 1
+dqcomp1094 compare 4.000000000000000000000000000000000 0 -> 1
+dqcomp1095 compare 5.000000000000000000000000000000000 0 -> 1
+dqcomp1096 compare 6.000000000000000000000000000000000 0 -> 1
+dqcomp1097 compare 7.000000000000000000000000000000000 0 -> 1
+dqcomp1098 compare 8.000000000000000000000000000000000 0 -> 1
+dqcomp1099 compare 9.000000000000000000000000000000000 0 -> 1
+
+-- Null tests
+dqcom990 compare 10 # -> NaN Invalid_operation
+dqcom991 compare # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqCompareSig.decTest b/Lib/test/decimaltestdata/dqCompareSig.decTest
index c068d471c1..795f0916dd 100644
--- a/Lib/test/decimaltestdata/dqCompareSig.decTest
+++ b/Lib/test/decimaltestdata/dqCompareSig.decTest
@@ -1,647 +1,647 @@
-------------------------------------------------------------------------
--- dqCompareSig.decTest -- decQuad comparison; all NaNs signal --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqcms001 comparesig -2 -2 -> 0
-dqcms002 comparesig -2 -1 -> -1
-dqcms003 comparesig -2 0 -> -1
-dqcms004 comparesig -2 1 -> -1
-dqcms005 comparesig -2 2 -> -1
-dqcms006 comparesig -1 -2 -> 1
-dqcms007 comparesig -1 -1 -> 0
-dqcms008 comparesig -1 0 -> -1
-dqcms009 comparesig -1 1 -> -1
-dqcms010 comparesig -1 2 -> -1
-dqcms011 comparesig 0 -2 -> 1
-dqcms012 comparesig 0 -1 -> 1
-dqcms013 comparesig 0 0 -> 0
-dqcms014 comparesig 0 1 -> -1
-dqcms015 comparesig 0 2 -> -1
-dqcms016 comparesig 1 -2 -> 1
-dqcms017 comparesig 1 -1 -> 1
-dqcms018 comparesig 1 0 -> 1
-dqcms019 comparesig 1 1 -> 0
-dqcms020 comparesig 1 2 -> -1
-dqcms021 comparesig 2 -2 -> 1
-dqcms022 comparesig 2 -1 -> 1
-dqcms023 comparesig 2 0 -> 1
-dqcms025 comparesig 2 1 -> 1
-dqcms026 comparesig 2 2 -> 0
-
-dqcms031 comparesig -20 -20 -> 0
-dqcms032 comparesig -20 -10 -> -1
-dqcms033 comparesig -20 00 -> -1
-dqcms034 comparesig -20 10 -> -1
-dqcms035 comparesig -20 20 -> -1
-dqcms036 comparesig -10 -20 -> 1
-dqcms037 comparesig -10 -10 -> 0
-dqcms038 comparesig -10 00 -> -1
-dqcms039 comparesig -10 10 -> -1
-dqcms040 comparesig -10 20 -> -1
-dqcms041 comparesig 00 -20 -> 1
-dqcms042 comparesig 00 -10 -> 1
-dqcms043 comparesig 00 00 -> 0
-dqcms044 comparesig 00 10 -> -1
-dqcms045 comparesig 00 20 -> -1
-dqcms046 comparesig 10 -20 -> 1
-dqcms047 comparesig 10 -10 -> 1
-dqcms048 comparesig 10 00 -> 1
-dqcms049 comparesig 10 10 -> 0
-dqcms050 comparesig 10 20 -> -1
-dqcms051 comparesig 20 -20 -> 1
-dqcms052 comparesig 20 -10 -> 1
-dqcms053 comparesig 20 00 -> 1
-dqcms055 comparesig 20 10 -> 1
-dqcms056 comparesig 20 20 -> 0
-
-dqcms061 comparesig -2.0 -2.0 -> 0
-dqcms062 comparesig -2.0 -1.0 -> -1
-dqcms063 comparesig -2.0 0.0 -> -1
-dqcms064 comparesig -2.0 1.0 -> -1
-dqcms065 comparesig -2.0 2.0 -> -1
-dqcms066 comparesig -1.0 -2.0 -> 1
-dqcms067 comparesig -1.0 -1.0 -> 0
-dqcms068 comparesig -1.0 0.0 -> -1
-dqcms069 comparesig -1.0 1.0 -> -1
-dqcms070 comparesig -1.0 2.0 -> -1
-dqcms071 comparesig 0.0 -2.0 -> 1
-dqcms072 comparesig 0.0 -1.0 -> 1
-dqcms073 comparesig 0.0 0.0 -> 0
-dqcms074 comparesig 0.0 1.0 -> -1
-dqcms075 comparesig 0.0 2.0 -> -1
-dqcms076 comparesig 1.0 -2.0 -> 1
-dqcms077 comparesig 1.0 -1.0 -> 1
-dqcms078 comparesig 1.0 0.0 -> 1
-dqcms079 comparesig 1.0 1.0 -> 0
-dqcms080 comparesig 1.0 2.0 -> -1
-dqcms081 comparesig 2.0 -2.0 -> 1
-dqcms082 comparesig 2.0 -1.0 -> 1
-dqcms083 comparesig 2.0 0.0 -> 1
-dqcms085 comparesig 2.0 1.0 -> 1
-dqcms086 comparesig 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-dqcms090 comparesig 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0
-dqcms091 comparesig -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1
-dqcms092 comparesig 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1
-dqcms093 comparesig -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0
-
--- some differing length/exponent cases
-dqcms100 comparesig 7.0 7.0 -> 0
-dqcms101 comparesig 7.0 7 -> 0
-dqcms102 comparesig 7 7.0 -> 0
-dqcms103 comparesig 7E+0 7.0 -> 0
-dqcms104 comparesig 70E-1 7.0 -> 0
-dqcms105 comparesig 0.7E+1 7 -> 0
-dqcms106 comparesig 70E-1 7 -> 0
-dqcms107 comparesig 7.0 7E+0 -> 0
-dqcms108 comparesig 7.0 70E-1 -> 0
-dqcms109 comparesig 7 0.7E+1 -> 0
-dqcms110 comparesig 7 70E-1 -> 0
-
-dqcms120 comparesig 8.0 7.0 -> 1
-dqcms121 comparesig 8.0 7 -> 1
-dqcms122 comparesig 8 7.0 -> 1
-dqcms123 comparesig 8E+0 7.0 -> 1
-dqcms124 comparesig 80E-1 7.0 -> 1
-dqcms125 comparesig 0.8E+1 7 -> 1
-dqcms126 comparesig 80E-1 7 -> 1
-dqcms127 comparesig 8.0 7E+0 -> 1
-dqcms128 comparesig 8.0 70E-1 -> 1
-dqcms129 comparesig 8 0.7E+1 -> 1
-dqcms130 comparesig 8 70E-1 -> 1
-
-dqcms140 comparesig 8.0 9.0 -> -1
-dqcms141 comparesig 8.0 9 -> -1
-dqcms142 comparesig 8 9.0 -> -1
-dqcms143 comparesig 8E+0 9.0 -> -1
-dqcms144 comparesig 80E-1 9.0 -> -1
-dqcms145 comparesig 0.8E+1 9 -> -1
-dqcms146 comparesig 80E-1 9 -> -1
-dqcms147 comparesig 8.0 9E+0 -> -1
-dqcms148 comparesig 8.0 90E-1 -> -1
-dqcms149 comparesig 8 0.9E+1 -> -1
-dqcms150 comparesig 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-dqcms200 comparesig -7.0 7.0 -> -1
-dqcms201 comparesig -7.0 7 -> -1
-dqcms202 comparesig -7 7.0 -> -1
-dqcms203 comparesig -7E+0 7.0 -> -1
-dqcms204 comparesig -70E-1 7.0 -> -1
-dqcms205 comparesig -0.7E+1 7 -> -1
-dqcms206 comparesig -70E-1 7 -> -1
-dqcms207 comparesig -7.0 7E+0 -> -1
-dqcms208 comparesig -7.0 70E-1 -> -1
-dqcms209 comparesig -7 0.7E+1 -> -1
-dqcms210 comparesig -7 70E-1 -> -1
-
-dqcms220 comparesig -8.0 7.0 -> -1
-dqcms221 comparesig -8.0 7 -> -1
-dqcms222 comparesig -8 7.0 -> -1
-dqcms223 comparesig -8E+0 7.0 -> -1
-dqcms224 comparesig -80E-1 7.0 -> -1
-dqcms225 comparesig -0.8E+1 7 -> -1
-dqcms226 comparesig -80E-1 7 -> -1
-dqcms227 comparesig -8.0 7E+0 -> -1
-dqcms228 comparesig -8.0 70E-1 -> -1
-dqcms229 comparesig -8 0.7E+1 -> -1
-dqcms230 comparesig -8 70E-1 -> -1
-
-dqcms240 comparesig -8.0 9.0 -> -1
-dqcms241 comparesig -8.0 9 -> -1
-dqcms242 comparesig -8 9.0 -> -1
-dqcms243 comparesig -8E+0 9.0 -> -1
-dqcms244 comparesig -80E-1 9.0 -> -1
-dqcms245 comparesig -0.8E+1 9 -> -1
-dqcms246 comparesig -80E-1 9 -> -1
-dqcms247 comparesig -8.0 9E+0 -> -1
-dqcms248 comparesig -8.0 90E-1 -> -1
-dqcms249 comparesig -8 0.9E+1 -> -1
-dqcms250 comparesig -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-dqcms300 comparesig 7.0 -7.0 -> 1
-dqcms301 comparesig 7.0 -7 -> 1
-dqcms302 comparesig 7 -7.0 -> 1
-dqcms303 comparesig 7E+0 -7.0 -> 1
-dqcms304 comparesig 70E-1 -7.0 -> 1
-dqcms305 comparesig .7E+1 -7 -> 1
-dqcms306 comparesig 70E-1 -7 -> 1
-dqcms307 comparesig 7.0 -7E+0 -> 1
-dqcms308 comparesig 7.0 -70E-1 -> 1
-dqcms309 comparesig 7 -.7E+1 -> 1
-dqcms310 comparesig 7 -70E-1 -> 1
-
-dqcms320 comparesig 8.0 -7.0 -> 1
-dqcms321 comparesig 8.0 -7 -> 1
-dqcms322 comparesig 8 -7.0 -> 1
-dqcms323 comparesig 8E+0 -7.0 -> 1
-dqcms324 comparesig 80E-1 -7.0 -> 1
-dqcms325 comparesig .8E+1 -7 -> 1
-dqcms326 comparesig 80E-1 -7 -> 1
-dqcms327 comparesig 8.0 -7E+0 -> 1
-dqcms328 comparesig 8.0 -70E-1 -> 1
-dqcms329 comparesig 8 -.7E+1 -> 1
-dqcms330 comparesig 8 -70E-1 -> 1
-
-dqcms340 comparesig 8.0 -9.0 -> 1
-dqcms341 comparesig 8.0 -9 -> 1
-dqcms342 comparesig 8 -9.0 -> 1
-dqcms343 comparesig 8E+0 -9.0 -> 1
-dqcms344 comparesig 80E-1 -9.0 -> 1
-dqcms345 comparesig .8E+1 -9 -> 1
-dqcms346 comparesig 80E-1 -9 -> 1
-dqcms347 comparesig 8.0 -9E+0 -> 1
-dqcms348 comparesig 8.0 -90E-1 -> 1
-dqcms349 comparesig 8 -.9E+1 -> 1
-dqcms350 comparesig 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-dqcms400 comparesig -7.0 -7.0 -> 0
-dqcms401 comparesig -7.0 -7 -> 0
-dqcms402 comparesig -7 -7.0 -> 0
-dqcms403 comparesig -7E+0 -7.0 -> 0
-dqcms404 comparesig -70E-1 -7.0 -> 0
-dqcms405 comparesig -.7E+1 -7 -> 0
-dqcms406 comparesig -70E-1 -7 -> 0
-dqcms407 comparesig -7.0 -7E+0 -> 0
-dqcms408 comparesig -7.0 -70E-1 -> 0
-dqcms409 comparesig -7 -.7E+1 -> 0
-dqcms410 comparesig -7 -70E-1 -> 0
-
-dqcms420 comparesig -8.0 -7.0 -> -1
-dqcms421 comparesig -8.0 -7 -> -1
-dqcms422 comparesig -8 -7.0 -> -1
-dqcms423 comparesig -8E+0 -7.0 -> -1
-dqcms424 comparesig -80E-1 -7.0 -> -1
-dqcms425 comparesig -.8E+1 -7 -> -1
-dqcms426 comparesig -80E-1 -7 -> -1
-dqcms427 comparesig -8.0 -7E+0 -> -1
-dqcms428 comparesig -8.0 -70E-1 -> -1
-dqcms429 comparesig -8 -.7E+1 -> -1
-dqcms430 comparesig -8 -70E-1 -> -1
-
-dqcms440 comparesig -8.0 -9.0 -> 1
-dqcms441 comparesig -8.0 -9 -> 1
-dqcms442 comparesig -8 -9.0 -> 1
-dqcms443 comparesig -8E+0 -9.0 -> 1
-dqcms444 comparesig -80E-1 -9.0 -> 1
-dqcms445 comparesig -.8E+1 -9 -> 1
-dqcms446 comparesig -80E-1 -9 -> 1
-dqcms447 comparesig -8.0 -9E+0 -> 1
-dqcms448 comparesig -8.0 -90E-1 -> 1
-dqcms449 comparesig -8 -.9E+1 -> 1
-dqcms450 comparesig -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-dqcms473 comparesig 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0
-dqcms474 comparesig 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0
-dqcms475 comparesig 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0
-dqcms476 comparesig 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0
-dqcms477 comparesig 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0
-dqcms478 comparesig 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0
-dqcms479 comparesig 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0
-dqcms480 comparesig 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0
-dqcms481 comparesig 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0
-dqcms482 comparesig 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0
-dqcms483 comparesig 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0
-dqcms487 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0
-dqcms488 comparesig 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0
-dqcms489 comparesig 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0
-dqcms490 comparesig 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0
-dqcms491 comparesig 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0
-dqcms492 comparesig 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0
-dqcms493 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0
-dqcms494 comparesig 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0
-dqcms495 comparesig 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0
-dqcms496 comparesig 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0
-dqcms497 comparesig 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-dqcms500 comparesig 1 1E-15 -> 1
-dqcms501 comparesig 1 1E-14 -> 1
-dqcms502 comparesig 1 1E-13 -> 1
-dqcms503 comparesig 1 1E-12 -> 1
-dqcms504 comparesig 1 1E-11 -> 1
-dqcms505 comparesig 1 1E-10 -> 1
-dqcms506 comparesig 1 1E-9 -> 1
-dqcms507 comparesig 1 1E-8 -> 1
-dqcms508 comparesig 1 1E-7 -> 1
-dqcms509 comparesig 1 1E-6 -> 1
-dqcms510 comparesig 1 1E-5 -> 1
-dqcms511 comparesig 1 1E-4 -> 1
-dqcms512 comparesig 1 1E-3 -> 1
-dqcms513 comparesig 1 1E-2 -> 1
-dqcms514 comparesig 1 1E-1 -> 1
-dqcms515 comparesig 1 1E-0 -> 0
-dqcms516 comparesig 1 1E+1 -> -1
-dqcms517 comparesig 1 1E+2 -> -1
-dqcms518 comparesig 1 1E+3 -> -1
-dqcms519 comparesig 1 1E+4 -> -1
-dqcms521 comparesig 1 1E+5 -> -1
-dqcms522 comparesig 1 1E+6 -> -1
-dqcms523 comparesig 1 1E+7 -> -1
-dqcms524 comparesig 1 1E+8 -> -1
-dqcms525 comparesig 1 1E+9 -> -1
-dqcms526 comparesig 1 1E+10 -> -1
-dqcms527 comparesig 1 1E+11 -> -1
-dqcms528 comparesig 1 1E+12 -> -1
-dqcms529 comparesig 1 1E+13 -> -1
-dqcms530 comparesig 1 1E+14 -> -1
-dqcms531 comparesig 1 1E+15 -> -1
--- LR swap
-dqcms540 comparesig 1E-15 1 -> -1
-dqcms541 comparesig 1E-14 1 -> -1
-dqcms542 comparesig 1E-13 1 -> -1
-dqcms543 comparesig 1E-12 1 -> -1
-dqcms544 comparesig 1E-11 1 -> -1
-dqcms545 comparesig 1E-10 1 -> -1
-dqcms546 comparesig 1E-9 1 -> -1
-dqcms547 comparesig 1E-8 1 -> -1
-dqcms548 comparesig 1E-7 1 -> -1
-dqcms549 comparesig 1E-6 1 -> -1
-dqcms550 comparesig 1E-5 1 -> -1
-dqcms551 comparesig 1E-4 1 -> -1
-dqcms552 comparesig 1E-3 1 -> -1
-dqcms553 comparesig 1E-2 1 -> -1
-dqcms554 comparesig 1E-1 1 -> -1
-dqcms555 comparesig 1E-0 1 -> 0
-dqcms556 comparesig 1E+1 1 -> 1
-dqcms557 comparesig 1E+2 1 -> 1
-dqcms558 comparesig 1E+3 1 -> 1
-dqcms559 comparesig 1E+4 1 -> 1
-dqcms561 comparesig 1E+5 1 -> 1
-dqcms562 comparesig 1E+6 1 -> 1
-dqcms563 comparesig 1E+7 1 -> 1
-dqcms564 comparesig 1E+8 1 -> 1
-dqcms565 comparesig 1E+9 1 -> 1
-dqcms566 comparesig 1E+10 1 -> 1
-dqcms567 comparesig 1E+11 1 -> 1
-dqcms568 comparesig 1E+12 1 -> 1
-dqcms569 comparesig 1E+13 1 -> 1
-dqcms570 comparesig 1E+14 1 -> 1
-dqcms571 comparesig 1E+15 1 -> 1
--- similar with a useful coefficient, one side only
-dqcms580 comparesig 0.000000987654321 1E-15 -> 1
-dqcms581 comparesig 0.000000987654321 1E-14 -> 1
-dqcms582 comparesig 0.000000987654321 1E-13 -> 1
-dqcms583 comparesig 0.000000987654321 1E-12 -> 1
-dqcms584 comparesig 0.000000987654321 1E-11 -> 1
-dqcms585 comparesig 0.000000987654321 1E-10 -> 1
-dqcms586 comparesig 0.000000987654321 1E-9 -> 1
-dqcms587 comparesig 0.000000987654321 1E-8 -> 1
-dqcms588 comparesig 0.000000987654321 1E-7 -> 1
-dqcms589 comparesig 0.000000987654321 1E-6 -> -1
-dqcms590 comparesig 0.000000987654321 1E-5 -> -1
-dqcms591 comparesig 0.000000987654321 1E-4 -> -1
-dqcms592 comparesig 0.000000987654321 1E-3 -> -1
-dqcms593 comparesig 0.000000987654321 1E-2 -> -1
-dqcms594 comparesig 0.000000987654321 1E-1 -> -1
-dqcms595 comparesig 0.000000987654321 1E-0 -> -1
-dqcms596 comparesig 0.000000987654321 1E+1 -> -1
-dqcms597 comparesig 0.000000987654321 1E+2 -> -1
-dqcms598 comparesig 0.000000987654321 1E+3 -> -1
-dqcms599 comparesig 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-dqcms600 comparesig 12 12.2345 -> -1
-dqcms601 comparesig 12.0 12.2345 -> -1
-dqcms602 comparesig 12.00 12.2345 -> -1
-dqcms603 comparesig 12.000 12.2345 -> -1
-dqcms604 comparesig 12.0000 12.2345 -> -1
-dqcms605 comparesig 12.00000 12.2345 -> -1
-dqcms606 comparesig 12.000000 12.2345 -> -1
-dqcms607 comparesig 12.0000000 12.2345 -> -1
-dqcms608 comparesig 12.00000000 12.2345 -> -1
-dqcms609 comparesig 12.000000000 12.2345 -> -1
-dqcms610 comparesig 12.1234 12 -> 1
-dqcms611 comparesig 12.1234 12.0 -> 1
-dqcms612 comparesig 12.1234 12.00 -> 1
-dqcms613 comparesig 12.1234 12.000 -> 1
-dqcms614 comparesig 12.1234 12.0000 -> 1
-dqcms615 comparesig 12.1234 12.00000 -> 1
-dqcms616 comparesig 12.1234 12.000000 -> 1
-dqcms617 comparesig 12.1234 12.0000000 -> 1
-dqcms618 comparesig 12.1234 12.00000000 -> 1
-dqcms619 comparesig 12.1234 12.000000000 -> 1
-dqcms620 comparesig -12 -12.2345 -> 1
-dqcms621 comparesig -12.0 -12.2345 -> 1
-dqcms622 comparesig -12.00 -12.2345 -> 1
-dqcms623 comparesig -12.000 -12.2345 -> 1
-dqcms624 comparesig -12.0000 -12.2345 -> 1
-dqcms625 comparesig -12.00000 -12.2345 -> 1
-dqcms626 comparesig -12.000000 -12.2345 -> 1
-dqcms627 comparesig -12.0000000 -12.2345 -> 1
-dqcms628 comparesig -12.00000000 -12.2345 -> 1
-dqcms629 comparesig -12.000000000 -12.2345 -> 1
-dqcms630 comparesig -12.1234 -12 -> -1
-dqcms631 comparesig -12.1234 -12.0 -> -1
-dqcms632 comparesig -12.1234 -12.00 -> -1
-dqcms633 comparesig -12.1234 -12.000 -> -1
-dqcms634 comparesig -12.1234 -12.0000 -> -1
-dqcms635 comparesig -12.1234 -12.00000 -> -1
-dqcms636 comparesig -12.1234 -12.000000 -> -1
-dqcms637 comparesig -12.1234 -12.0000000 -> -1
-dqcms638 comparesig -12.1234 -12.00000000 -> -1
-dqcms639 comparesig -12.1234 -12.000000000 -> -1
-
--- extended zeros
-dqcms640 comparesig 0 0 -> 0
-dqcms641 comparesig 0 -0 -> 0
-dqcms642 comparesig 0 -0.0 -> 0
-dqcms643 comparesig 0 0.0 -> 0
-dqcms644 comparesig -0 0 -> 0
-dqcms645 comparesig -0 -0 -> 0
-dqcms646 comparesig -0 -0.0 -> 0
-dqcms647 comparesig -0 0.0 -> 0
-dqcms648 comparesig 0.0 0 -> 0
-dqcms649 comparesig 0.0 -0 -> 0
-dqcms650 comparesig 0.0 -0.0 -> 0
-dqcms651 comparesig 0.0 0.0 -> 0
-dqcms652 comparesig -0.0 0 -> 0
-dqcms653 comparesig -0.0 -0 -> 0
-dqcms654 comparesig -0.0 -0.0 -> 0
-dqcms655 comparesig -0.0 0.0 -> 0
-
-dqcms656 comparesig -0E1 0.0 -> 0
-dqcms657 comparesig -0E2 0.0 -> 0
-dqcms658 comparesig 0E1 0.0 -> 0
-dqcms659 comparesig 0E2 0.0 -> 0
-dqcms660 comparesig -0E1 0 -> 0
-dqcms661 comparesig -0E2 0 -> 0
-dqcms662 comparesig 0E1 0 -> 0
-dqcms663 comparesig 0E2 0 -> 0
-dqcms664 comparesig -0E1 -0E1 -> 0
-dqcms665 comparesig -0E2 -0E1 -> 0
-dqcms666 comparesig 0E1 -0E1 -> 0
-dqcms667 comparesig 0E2 -0E1 -> 0
-dqcms668 comparesig -0E1 -0E2 -> 0
-dqcms669 comparesig -0E2 -0E2 -> 0
-dqcms670 comparesig 0E1 -0E2 -> 0
-dqcms671 comparesig 0E2 -0E2 -> 0
-dqcms672 comparesig -0E1 0E1 -> 0
-dqcms673 comparesig -0E2 0E1 -> 0
-dqcms674 comparesig 0E1 0E1 -> 0
-dqcms675 comparesig 0E2 0E1 -> 0
-dqcms676 comparesig -0E1 0E2 -> 0
-dqcms677 comparesig -0E2 0E2 -> 0
-dqcms678 comparesig 0E1 0E2 -> 0
-dqcms679 comparesig 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-dqcms680 comparesig 12 12 -> 0
-dqcms681 comparesig 12 12.0 -> 0
-dqcms682 comparesig 12 12.00 -> 0
-dqcms683 comparesig 12 12.000 -> 0
-dqcms684 comparesig 12 12.0000 -> 0
-dqcms685 comparesig 12 12.00000 -> 0
-dqcms686 comparesig 12 12.000000 -> 0
-dqcms687 comparesig 12 12.0000000 -> 0
-dqcms688 comparesig 12 12.00000000 -> 0
-dqcms689 comparesig 12 12.000000000 -> 0
-dqcms690 comparesig 12 12 -> 0
-dqcms691 comparesig 12.0 12 -> 0
-dqcms692 comparesig 12.00 12 -> 0
-dqcms693 comparesig 12.000 12 -> 0
-dqcms694 comparesig 12.0000 12 -> 0
-dqcms695 comparesig 12.00000 12 -> 0
-dqcms696 comparesig 12.000000 12 -> 0
-dqcms697 comparesig 12.0000000 12 -> 0
-dqcms698 comparesig 12.00000000 12 -> 0
-dqcms699 comparesig 12.000000000 12 -> 0
-
--- first, second, & last digit
-dqcms700 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1
-dqcms701 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
-dqcms702 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1
-dqcms703 comparesig 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1
-dqcms704 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
-dqcms705 comparesig 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1
-dqcms706 comparesig 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1
-dqcms707 comparesig 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0
-dqcms708 comparesig 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1
-
--- miscellaneous
-dqcms721 comparesig 12345678000 1 -> 1
-dqcms722 comparesig 1 12345678000 -> -1
-dqcms723 comparesig 1234567800 1 -> 1
-dqcms724 comparesig 1 1234567800 -> -1
-dqcms725 comparesig 1234567890 1 -> 1
-dqcms726 comparesig 1 1234567890 -> -1
-dqcms727 comparesig 1234567891 1 -> 1
-dqcms728 comparesig 1 1234567891 -> -1
-dqcms729 comparesig 12345678901 1 -> 1
-dqcms730 comparesig 1 12345678901 -> -1
-dqcms731 comparesig 1234567896 1 -> 1
-dqcms732 comparesig 1 1234567896 -> -1
-
--- residue cases at lower precision
-dqcms740 comparesig 1 0.9999999 -> 1
-dqcms741 comparesig 1 0.999999 -> 1
-dqcms742 comparesig 1 0.99999 -> 1
-dqcms743 comparesig 1 1.0000 -> 0
-dqcms744 comparesig 1 1.00001 -> -1
-dqcms745 comparesig 1 1.000001 -> -1
-dqcms746 comparesig 1 1.0000001 -> -1
-dqcms750 comparesig 0.9999999 1 -> -1
-dqcms751 comparesig 0.999999 1 -> -1
-dqcms752 comparesig 0.99999 1 -> -1
-dqcms753 comparesig 1.0000 1 -> 0
-dqcms754 comparesig 1.00001 1 -> 1
-dqcms755 comparesig 1.000001 1 -> 1
-dqcms756 comparesig 1.0000001 1 -> 1
-
--- Specials
-dqcms780 comparesig Inf -Inf -> 1
-dqcms781 comparesig Inf -1000 -> 1
-dqcms782 comparesig Inf -1 -> 1
-dqcms783 comparesig Inf -0 -> 1
-dqcms784 comparesig Inf 0 -> 1
-dqcms785 comparesig Inf 1 -> 1
-dqcms786 comparesig Inf 1000 -> 1
-dqcms787 comparesig Inf Inf -> 0
-dqcms788 comparesig -1000 Inf -> -1
-dqcms789 comparesig -Inf Inf -> -1
-dqcms790 comparesig -1 Inf -> -1
-dqcms791 comparesig -0 Inf -> -1
-dqcms792 comparesig 0 Inf -> -1
-dqcms793 comparesig 1 Inf -> -1
-dqcms794 comparesig 1000 Inf -> -1
-dqcms795 comparesig Inf Inf -> 0
-
-dqcms800 comparesig -Inf -Inf -> 0
-dqcms801 comparesig -Inf -1000 -> -1
-dqcms802 comparesig -Inf -1 -> -1
-dqcms803 comparesig -Inf -0 -> -1
-dqcms804 comparesig -Inf 0 -> -1
-dqcms805 comparesig -Inf 1 -> -1
-dqcms806 comparesig -Inf 1000 -> -1
-dqcms807 comparesig -Inf Inf -> -1
-dqcms808 comparesig -Inf -Inf -> 0
-dqcms809 comparesig -1000 -Inf -> 1
-dqcms810 comparesig -1 -Inf -> 1
-dqcms811 comparesig -0 -Inf -> 1
-dqcms812 comparesig 0 -Inf -> 1
-dqcms813 comparesig 1 -Inf -> 1
-dqcms814 comparesig 1000 -Inf -> 1
-dqcms815 comparesig Inf -Inf -> 1
-
-dqcms821 comparesig NaN -Inf -> NaN Invalid_operation
-dqcms822 comparesig NaN -1000 -> NaN Invalid_operation
-dqcms823 comparesig NaN -1 -> NaN Invalid_operation
-dqcms824 comparesig NaN -0 -> NaN Invalid_operation
-dqcms825 comparesig NaN 0 -> NaN Invalid_operation
-dqcms826 comparesig NaN 1 -> NaN Invalid_operation
-dqcms827 comparesig NaN 1000 -> NaN Invalid_operation
-dqcms828 comparesig NaN Inf -> NaN Invalid_operation
-dqcms829 comparesig NaN NaN -> NaN Invalid_operation
-dqcms830 comparesig -Inf NaN -> NaN Invalid_operation
-dqcms831 comparesig -1000 NaN -> NaN Invalid_operation
-dqcms832 comparesig -1 NaN -> NaN Invalid_operation
-dqcms833 comparesig -0 NaN -> NaN Invalid_operation
-dqcms834 comparesig 0 NaN -> NaN Invalid_operation
-dqcms835 comparesig 1 NaN -> NaN Invalid_operation
-dqcms836 comparesig 1000 NaN -> NaN Invalid_operation
-dqcms837 comparesig Inf NaN -> NaN Invalid_operation
-dqcms838 comparesig -NaN -NaN -> -NaN Invalid_operation
-dqcms839 comparesig +NaN -NaN -> NaN Invalid_operation
-dqcms840 comparesig -NaN +NaN -> -NaN Invalid_operation
-
-dqcms841 comparesig sNaN -Inf -> NaN Invalid_operation
-dqcms842 comparesig sNaN -1000 -> NaN Invalid_operation
-dqcms843 comparesig sNaN -1 -> NaN Invalid_operation
-dqcms844 comparesig sNaN -0 -> NaN Invalid_operation
-dqcms845 comparesig sNaN 0 -> NaN Invalid_operation
-dqcms846 comparesig sNaN 1 -> NaN Invalid_operation
-dqcms847 comparesig sNaN 1000 -> NaN Invalid_operation
-dqcms848 comparesig sNaN NaN -> NaN Invalid_operation
-dqcms849 comparesig sNaN sNaN -> NaN Invalid_operation
-dqcms850 comparesig NaN sNaN -> NaN Invalid_operation
-dqcms851 comparesig -Inf sNaN -> NaN Invalid_operation
-dqcms852 comparesig -1000 sNaN -> NaN Invalid_operation
-dqcms853 comparesig -1 sNaN -> NaN Invalid_operation
-dqcms854 comparesig -0 sNaN -> NaN Invalid_operation
-dqcms855 comparesig 0 sNaN -> NaN Invalid_operation
-dqcms856 comparesig 1 sNaN -> NaN Invalid_operation
-dqcms857 comparesig 1000 sNaN -> NaN Invalid_operation
-dqcms858 comparesig Inf sNaN -> NaN Invalid_operation
-dqcms859 comparesig NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation
-dqcms861 comparesig NaN8 999 -> NaN8 Invalid_operation
-dqcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation
-dqcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation
-dqcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation
-dqcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation
-dqcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation
-dqcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation
-dqcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation
-dqcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation
-dqcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation
-
-dqcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation
-dqcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation
-dqcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation
-dqcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation
-dqcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation
-dqcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation
-dqcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation
-dqcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- wide range
-dqcms880 comparesig +1.23456789012345E-0 9E+6144 -> -1
-dqcms881 comparesig 9E+6144 +1.23456789012345E-0 -> 1
-dqcms882 comparesig +0.100 9E-6143 -> 1
-dqcms883 comparesig 9E-6143 +0.100 -> -1
-dqcms885 comparesig -1.23456789012345E-0 9E+6144 -> -1
-dqcms886 comparesig 9E+6144 -1.23456789012345E-0 -> 1
-dqcms887 comparesig -0.100 9E-6143 -> -1
-dqcms888 comparesig 9E-6143 -0.100 -> 1
-
--- signs
-dqcms901 comparesig 1e+77 1e+11 -> 1
-dqcms902 comparesig 1e+77 -1e+11 -> 1
-dqcms903 comparesig -1e+77 1e+11 -> -1
-dqcms904 comparesig -1e+77 -1e+11 -> -1
-dqcms905 comparesig 1e-77 1e-11 -> -1
-dqcms906 comparesig 1e-77 -1e-11 -> 1
-dqcms907 comparesig -1e-77 1e-11 -> -1
-dqcms908 comparesig -1e-77 -1e-11 -> 1
-
--- Null tests
-dqcms990 comparesig 10 # -> NaN Invalid_operation
-dqcms991 comparesig # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqCompareSig.decTest -- decQuad comparison; all NaNs signal --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqcms001 comparesig -2 -2 -> 0
+dqcms002 comparesig -2 -1 -> -1
+dqcms003 comparesig -2 0 -> -1
+dqcms004 comparesig -2 1 -> -1
+dqcms005 comparesig -2 2 -> -1
+dqcms006 comparesig -1 -2 -> 1
+dqcms007 comparesig -1 -1 -> 0
+dqcms008 comparesig -1 0 -> -1
+dqcms009 comparesig -1 1 -> -1
+dqcms010 comparesig -1 2 -> -1
+dqcms011 comparesig 0 -2 -> 1
+dqcms012 comparesig 0 -1 -> 1
+dqcms013 comparesig 0 0 -> 0
+dqcms014 comparesig 0 1 -> -1
+dqcms015 comparesig 0 2 -> -1
+dqcms016 comparesig 1 -2 -> 1
+dqcms017 comparesig 1 -1 -> 1
+dqcms018 comparesig 1 0 -> 1
+dqcms019 comparesig 1 1 -> 0
+dqcms020 comparesig 1 2 -> -1
+dqcms021 comparesig 2 -2 -> 1
+dqcms022 comparesig 2 -1 -> 1
+dqcms023 comparesig 2 0 -> 1
+dqcms025 comparesig 2 1 -> 1
+dqcms026 comparesig 2 2 -> 0
+
+dqcms031 comparesig -20 -20 -> 0
+dqcms032 comparesig -20 -10 -> -1
+dqcms033 comparesig -20 00 -> -1
+dqcms034 comparesig -20 10 -> -1
+dqcms035 comparesig -20 20 -> -1
+dqcms036 comparesig -10 -20 -> 1
+dqcms037 comparesig -10 -10 -> 0
+dqcms038 comparesig -10 00 -> -1
+dqcms039 comparesig -10 10 -> -1
+dqcms040 comparesig -10 20 -> -1
+dqcms041 comparesig 00 -20 -> 1
+dqcms042 comparesig 00 -10 -> 1
+dqcms043 comparesig 00 00 -> 0
+dqcms044 comparesig 00 10 -> -1
+dqcms045 comparesig 00 20 -> -1
+dqcms046 comparesig 10 -20 -> 1
+dqcms047 comparesig 10 -10 -> 1
+dqcms048 comparesig 10 00 -> 1
+dqcms049 comparesig 10 10 -> 0
+dqcms050 comparesig 10 20 -> -1
+dqcms051 comparesig 20 -20 -> 1
+dqcms052 comparesig 20 -10 -> 1
+dqcms053 comparesig 20 00 -> 1
+dqcms055 comparesig 20 10 -> 1
+dqcms056 comparesig 20 20 -> 0
+
+dqcms061 comparesig -2.0 -2.0 -> 0
+dqcms062 comparesig -2.0 -1.0 -> -1
+dqcms063 comparesig -2.0 0.0 -> -1
+dqcms064 comparesig -2.0 1.0 -> -1
+dqcms065 comparesig -2.0 2.0 -> -1
+dqcms066 comparesig -1.0 -2.0 -> 1
+dqcms067 comparesig -1.0 -1.0 -> 0
+dqcms068 comparesig -1.0 0.0 -> -1
+dqcms069 comparesig -1.0 1.0 -> -1
+dqcms070 comparesig -1.0 2.0 -> -1
+dqcms071 comparesig 0.0 -2.0 -> 1
+dqcms072 comparesig 0.0 -1.0 -> 1
+dqcms073 comparesig 0.0 0.0 -> 0
+dqcms074 comparesig 0.0 1.0 -> -1
+dqcms075 comparesig 0.0 2.0 -> -1
+dqcms076 comparesig 1.0 -2.0 -> 1
+dqcms077 comparesig 1.0 -1.0 -> 1
+dqcms078 comparesig 1.0 0.0 -> 1
+dqcms079 comparesig 1.0 1.0 -> 0
+dqcms080 comparesig 1.0 2.0 -> -1
+dqcms081 comparesig 2.0 -2.0 -> 1
+dqcms082 comparesig 2.0 -1.0 -> 1
+dqcms083 comparesig 2.0 0.0 -> 1
+dqcms085 comparesig 2.0 1.0 -> 1
+dqcms086 comparesig 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+dqcms090 comparesig 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 0
+dqcms091 comparesig -9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> -1
+dqcms092 comparesig 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 1
+dqcms093 comparesig -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0
+
+-- some differing length/exponent cases
+dqcms100 comparesig 7.0 7.0 -> 0
+dqcms101 comparesig 7.0 7 -> 0
+dqcms102 comparesig 7 7.0 -> 0
+dqcms103 comparesig 7E+0 7.0 -> 0
+dqcms104 comparesig 70E-1 7.0 -> 0
+dqcms105 comparesig 0.7E+1 7 -> 0
+dqcms106 comparesig 70E-1 7 -> 0
+dqcms107 comparesig 7.0 7E+0 -> 0
+dqcms108 comparesig 7.0 70E-1 -> 0
+dqcms109 comparesig 7 0.7E+1 -> 0
+dqcms110 comparesig 7 70E-1 -> 0
+
+dqcms120 comparesig 8.0 7.0 -> 1
+dqcms121 comparesig 8.0 7 -> 1
+dqcms122 comparesig 8 7.0 -> 1
+dqcms123 comparesig 8E+0 7.0 -> 1
+dqcms124 comparesig 80E-1 7.0 -> 1
+dqcms125 comparesig 0.8E+1 7 -> 1
+dqcms126 comparesig 80E-1 7 -> 1
+dqcms127 comparesig 8.0 7E+0 -> 1
+dqcms128 comparesig 8.0 70E-1 -> 1
+dqcms129 comparesig 8 0.7E+1 -> 1
+dqcms130 comparesig 8 70E-1 -> 1
+
+dqcms140 comparesig 8.0 9.0 -> -1
+dqcms141 comparesig 8.0 9 -> -1
+dqcms142 comparesig 8 9.0 -> -1
+dqcms143 comparesig 8E+0 9.0 -> -1
+dqcms144 comparesig 80E-1 9.0 -> -1
+dqcms145 comparesig 0.8E+1 9 -> -1
+dqcms146 comparesig 80E-1 9 -> -1
+dqcms147 comparesig 8.0 9E+0 -> -1
+dqcms148 comparesig 8.0 90E-1 -> -1
+dqcms149 comparesig 8 0.9E+1 -> -1
+dqcms150 comparesig 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+dqcms200 comparesig -7.0 7.0 -> -1
+dqcms201 comparesig -7.0 7 -> -1
+dqcms202 comparesig -7 7.0 -> -1
+dqcms203 comparesig -7E+0 7.0 -> -1
+dqcms204 comparesig -70E-1 7.0 -> -1
+dqcms205 comparesig -0.7E+1 7 -> -1
+dqcms206 comparesig -70E-1 7 -> -1
+dqcms207 comparesig -7.0 7E+0 -> -1
+dqcms208 comparesig -7.0 70E-1 -> -1
+dqcms209 comparesig -7 0.7E+1 -> -1
+dqcms210 comparesig -7 70E-1 -> -1
+
+dqcms220 comparesig -8.0 7.0 -> -1
+dqcms221 comparesig -8.0 7 -> -1
+dqcms222 comparesig -8 7.0 -> -1
+dqcms223 comparesig -8E+0 7.0 -> -1
+dqcms224 comparesig -80E-1 7.0 -> -1
+dqcms225 comparesig -0.8E+1 7 -> -1
+dqcms226 comparesig -80E-1 7 -> -1
+dqcms227 comparesig -8.0 7E+0 -> -1
+dqcms228 comparesig -8.0 70E-1 -> -1
+dqcms229 comparesig -8 0.7E+1 -> -1
+dqcms230 comparesig -8 70E-1 -> -1
+
+dqcms240 comparesig -8.0 9.0 -> -1
+dqcms241 comparesig -8.0 9 -> -1
+dqcms242 comparesig -8 9.0 -> -1
+dqcms243 comparesig -8E+0 9.0 -> -1
+dqcms244 comparesig -80E-1 9.0 -> -1
+dqcms245 comparesig -0.8E+1 9 -> -1
+dqcms246 comparesig -80E-1 9 -> -1
+dqcms247 comparesig -8.0 9E+0 -> -1
+dqcms248 comparesig -8.0 90E-1 -> -1
+dqcms249 comparesig -8 0.9E+1 -> -1
+dqcms250 comparesig -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+dqcms300 comparesig 7.0 -7.0 -> 1
+dqcms301 comparesig 7.0 -7 -> 1
+dqcms302 comparesig 7 -7.0 -> 1
+dqcms303 comparesig 7E+0 -7.0 -> 1
+dqcms304 comparesig 70E-1 -7.0 -> 1
+dqcms305 comparesig .7E+1 -7 -> 1
+dqcms306 comparesig 70E-1 -7 -> 1
+dqcms307 comparesig 7.0 -7E+0 -> 1
+dqcms308 comparesig 7.0 -70E-1 -> 1
+dqcms309 comparesig 7 -.7E+1 -> 1
+dqcms310 comparesig 7 -70E-1 -> 1
+
+dqcms320 comparesig 8.0 -7.0 -> 1
+dqcms321 comparesig 8.0 -7 -> 1
+dqcms322 comparesig 8 -7.0 -> 1
+dqcms323 comparesig 8E+0 -7.0 -> 1
+dqcms324 comparesig 80E-1 -7.0 -> 1
+dqcms325 comparesig .8E+1 -7 -> 1
+dqcms326 comparesig 80E-1 -7 -> 1
+dqcms327 comparesig 8.0 -7E+0 -> 1
+dqcms328 comparesig 8.0 -70E-1 -> 1
+dqcms329 comparesig 8 -.7E+1 -> 1
+dqcms330 comparesig 8 -70E-1 -> 1
+
+dqcms340 comparesig 8.0 -9.0 -> 1
+dqcms341 comparesig 8.0 -9 -> 1
+dqcms342 comparesig 8 -9.0 -> 1
+dqcms343 comparesig 8E+0 -9.0 -> 1
+dqcms344 comparesig 80E-1 -9.0 -> 1
+dqcms345 comparesig .8E+1 -9 -> 1
+dqcms346 comparesig 80E-1 -9 -> 1
+dqcms347 comparesig 8.0 -9E+0 -> 1
+dqcms348 comparesig 8.0 -90E-1 -> 1
+dqcms349 comparesig 8 -.9E+1 -> 1
+dqcms350 comparesig 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+dqcms400 comparesig -7.0 -7.0 -> 0
+dqcms401 comparesig -7.0 -7 -> 0
+dqcms402 comparesig -7 -7.0 -> 0
+dqcms403 comparesig -7E+0 -7.0 -> 0
+dqcms404 comparesig -70E-1 -7.0 -> 0
+dqcms405 comparesig -.7E+1 -7 -> 0
+dqcms406 comparesig -70E-1 -7 -> 0
+dqcms407 comparesig -7.0 -7E+0 -> 0
+dqcms408 comparesig -7.0 -70E-1 -> 0
+dqcms409 comparesig -7 -.7E+1 -> 0
+dqcms410 comparesig -7 -70E-1 -> 0
+
+dqcms420 comparesig -8.0 -7.0 -> -1
+dqcms421 comparesig -8.0 -7 -> -1
+dqcms422 comparesig -8 -7.0 -> -1
+dqcms423 comparesig -8E+0 -7.0 -> -1
+dqcms424 comparesig -80E-1 -7.0 -> -1
+dqcms425 comparesig -.8E+1 -7 -> -1
+dqcms426 comparesig -80E-1 -7 -> -1
+dqcms427 comparesig -8.0 -7E+0 -> -1
+dqcms428 comparesig -8.0 -70E-1 -> -1
+dqcms429 comparesig -8 -.7E+1 -> -1
+dqcms430 comparesig -8 -70E-1 -> -1
+
+dqcms440 comparesig -8.0 -9.0 -> 1
+dqcms441 comparesig -8.0 -9 -> 1
+dqcms442 comparesig -8 -9.0 -> 1
+dqcms443 comparesig -8E+0 -9.0 -> 1
+dqcms444 comparesig -80E-1 -9.0 -> 1
+dqcms445 comparesig -.8E+1 -9 -> 1
+dqcms446 comparesig -80E-1 -9 -> 1
+dqcms447 comparesig -8.0 -9E+0 -> 1
+dqcms448 comparesig -8.0 -90E-1 -> 1
+dqcms449 comparesig -8 -.9E+1 -> 1
+dqcms450 comparesig -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+dqcms473 comparesig 123.9999999999999999994560000000000E-89 123.999999999999999999456E-89 -> 0
+dqcms474 comparesig 123.999999999999999999456000000000E+89 123.999999999999999999456E+89 -> 0
+dqcms475 comparesig 123.99999999999999999945600000000E-89 123.999999999999999999456E-89 -> 0
+dqcms476 comparesig 123.9999999999999999994560000000E+89 123.999999999999999999456E+89 -> 0
+dqcms477 comparesig 123.999999999999999999456000000E-89 123.999999999999999999456E-89 -> 0
+dqcms478 comparesig 123.99999999999999999945600000E+89 123.999999999999999999456E+89 -> 0
+dqcms479 comparesig 123.9999999999999999994560000E-89 123.999999999999999999456E-89 -> 0
+dqcms480 comparesig 123.999999999999999999456000E+89 123.999999999999999999456E+89 -> 0
+dqcms481 comparesig 123.99999999999999999945600E-89 123.999999999999999999456E-89 -> 0
+dqcms482 comparesig 123.9999999999999999994560E+89 123.999999999999999999456E+89 -> 0
+dqcms483 comparesig 123.999999999999999999456E-89 123.999999999999999999456E-89 -> 0
+dqcms487 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000000000E+89 -> 0
+dqcms488 comparesig 123.999999999999999999456E-89 123.999999999999999999456000000000E-89 -> 0
+dqcms489 comparesig 123.999999999999999999456E+89 123.99999999999999999945600000000E+89 -> 0
+dqcms490 comparesig 123.999999999999999999456E-89 123.9999999999999999994560000000E-89 -> 0
+dqcms491 comparesig 123.999999999999999999456E+89 123.999999999999999999456000000E+89 -> 0
+dqcms492 comparesig 123.999999999999999999456E-89 123.99999999999999999945600000E-89 -> 0
+dqcms493 comparesig 123.999999999999999999456E+89 123.9999999999999999994560000E+89 -> 0
+dqcms494 comparesig 123.999999999999999999456E-89 123.999999999999999999456000E-89 -> 0
+dqcms495 comparesig 123.999999999999999999456E+89 123.99999999999999999945600E+89 -> 0
+dqcms496 comparesig 123.999999999999999999456E-89 123.9999999999999999994560E-89 -> 0
+dqcms497 comparesig 123.999999999999999999456E+89 123.999999999999999999456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+dqcms500 comparesig 1 1E-15 -> 1
+dqcms501 comparesig 1 1E-14 -> 1
+dqcms502 comparesig 1 1E-13 -> 1
+dqcms503 comparesig 1 1E-12 -> 1
+dqcms504 comparesig 1 1E-11 -> 1
+dqcms505 comparesig 1 1E-10 -> 1
+dqcms506 comparesig 1 1E-9 -> 1
+dqcms507 comparesig 1 1E-8 -> 1
+dqcms508 comparesig 1 1E-7 -> 1
+dqcms509 comparesig 1 1E-6 -> 1
+dqcms510 comparesig 1 1E-5 -> 1
+dqcms511 comparesig 1 1E-4 -> 1
+dqcms512 comparesig 1 1E-3 -> 1
+dqcms513 comparesig 1 1E-2 -> 1
+dqcms514 comparesig 1 1E-1 -> 1
+dqcms515 comparesig 1 1E-0 -> 0
+dqcms516 comparesig 1 1E+1 -> -1
+dqcms517 comparesig 1 1E+2 -> -1
+dqcms518 comparesig 1 1E+3 -> -1
+dqcms519 comparesig 1 1E+4 -> -1
+dqcms521 comparesig 1 1E+5 -> -1
+dqcms522 comparesig 1 1E+6 -> -1
+dqcms523 comparesig 1 1E+7 -> -1
+dqcms524 comparesig 1 1E+8 -> -1
+dqcms525 comparesig 1 1E+9 -> -1
+dqcms526 comparesig 1 1E+10 -> -1
+dqcms527 comparesig 1 1E+11 -> -1
+dqcms528 comparesig 1 1E+12 -> -1
+dqcms529 comparesig 1 1E+13 -> -1
+dqcms530 comparesig 1 1E+14 -> -1
+dqcms531 comparesig 1 1E+15 -> -1
+-- LR swap
+dqcms540 comparesig 1E-15 1 -> -1
+dqcms541 comparesig 1E-14 1 -> -1
+dqcms542 comparesig 1E-13 1 -> -1
+dqcms543 comparesig 1E-12 1 -> -1
+dqcms544 comparesig 1E-11 1 -> -1
+dqcms545 comparesig 1E-10 1 -> -1
+dqcms546 comparesig 1E-9 1 -> -1
+dqcms547 comparesig 1E-8 1 -> -1
+dqcms548 comparesig 1E-7 1 -> -1
+dqcms549 comparesig 1E-6 1 -> -1
+dqcms550 comparesig 1E-5 1 -> -1
+dqcms551 comparesig 1E-4 1 -> -1
+dqcms552 comparesig 1E-3 1 -> -1
+dqcms553 comparesig 1E-2 1 -> -1
+dqcms554 comparesig 1E-1 1 -> -1
+dqcms555 comparesig 1E-0 1 -> 0
+dqcms556 comparesig 1E+1 1 -> 1
+dqcms557 comparesig 1E+2 1 -> 1
+dqcms558 comparesig 1E+3 1 -> 1
+dqcms559 comparesig 1E+4 1 -> 1
+dqcms561 comparesig 1E+5 1 -> 1
+dqcms562 comparesig 1E+6 1 -> 1
+dqcms563 comparesig 1E+7 1 -> 1
+dqcms564 comparesig 1E+8 1 -> 1
+dqcms565 comparesig 1E+9 1 -> 1
+dqcms566 comparesig 1E+10 1 -> 1
+dqcms567 comparesig 1E+11 1 -> 1
+dqcms568 comparesig 1E+12 1 -> 1
+dqcms569 comparesig 1E+13 1 -> 1
+dqcms570 comparesig 1E+14 1 -> 1
+dqcms571 comparesig 1E+15 1 -> 1
+-- similar with a useful coefficient, one side only
+dqcms580 comparesig 0.000000987654321 1E-15 -> 1
+dqcms581 comparesig 0.000000987654321 1E-14 -> 1
+dqcms582 comparesig 0.000000987654321 1E-13 -> 1
+dqcms583 comparesig 0.000000987654321 1E-12 -> 1
+dqcms584 comparesig 0.000000987654321 1E-11 -> 1
+dqcms585 comparesig 0.000000987654321 1E-10 -> 1
+dqcms586 comparesig 0.000000987654321 1E-9 -> 1
+dqcms587 comparesig 0.000000987654321 1E-8 -> 1
+dqcms588 comparesig 0.000000987654321 1E-7 -> 1
+dqcms589 comparesig 0.000000987654321 1E-6 -> -1
+dqcms590 comparesig 0.000000987654321 1E-5 -> -1
+dqcms591 comparesig 0.000000987654321 1E-4 -> -1
+dqcms592 comparesig 0.000000987654321 1E-3 -> -1
+dqcms593 comparesig 0.000000987654321 1E-2 -> -1
+dqcms594 comparesig 0.000000987654321 1E-1 -> -1
+dqcms595 comparesig 0.000000987654321 1E-0 -> -1
+dqcms596 comparesig 0.000000987654321 1E+1 -> -1
+dqcms597 comparesig 0.000000987654321 1E+2 -> -1
+dqcms598 comparesig 0.000000987654321 1E+3 -> -1
+dqcms599 comparesig 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+dqcms600 comparesig 12 12.2345 -> -1
+dqcms601 comparesig 12.0 12.2345 -> -1
+dqcms602 comparesig 12.00 12.2345 -> -1
+dqcms603 comparesig 12.000 12.2345 -> -1
+dqcms604 comparesig 12.0000 12.2345 -> -1
+dqcms605 comparesig 12.00000 12.2345 -> -1
+dqcms606 comparesig 12.000000 12.2345 -> -1
+dqcms607 comparesig 12.0000000 12.2345 -> -1
+dqcms608 comparesig 12.00000000 12.2345 -> -1
+dqcms609 comparesig 12.000000000 12.2345 -> -1
+dqcms610 comparesig 12.1234 12 -> 1
+dqcms611 comparesig 12.1234 12.0 -> 1
+dqcms612 comparesig 12.1234 12.00 -> 1
+dqcms613 comparesig 12.1234 12.000 -> 1
+dqcms614 comparesig 12.1234 12.0000 -> 1
+dqcms615 comparesig 12.1234 12.00000 -> 1
+dqcms616 comparesig 12.1234 12.000000 -> 1
+dqcms617 comparesig 12.1234 12.0000000 -> 1
+dqcms618 comparesig 12.1234 12.00000000 -> 1
+dqcms619 comparesig 12.1234 12.000000000 -> 1
+dqcms620 comparesig -12 -12.2345 -> 1
+dqcms621 comparesig -12.0 -12.2345 -> 1
+dqcms622 comparesig -12.00 -12.2345 -> 1
+dqcms623 comparesig -12.000 -12.2345 -> 1
+dqcms624 comparesig -12.0000 -12.2345 -> 1
+dqcms625 comparesig -12.00000 -12.2345 -> 1
+dqcms626 comparesig -12.000000 -12.2345 -> 1
+dqcms627 comparesig -12.0000000 -12.2345 -> 1
+dqcms628 comparesig -12.00000000 -12.2345 -> 1
+dqcms629 comparesig -12.000000000 -12.2345 -> 1
+dqcms630 comparesig -12.1234 -12 -> -1
+dqcms631 comparesig -12.1234 -12.0 -> -1
+dqcms632 comparesig -12.1234 -12.00 -> -1
+dqcms633 comparesig -12.1234 -12.000 -> -1
+dqcms634 comparesig -12.1234 -12.0000 -> -1
+dqcms635 comparesig -12.1234 -12.00000 -> -1
+dqcms636 comparesig -12.1234 -12.000000 -> -1
+dqcms637 comparesig -12.1234 -12.0000000 -> -1
+dqcms638 comparesig -12.1234 -12.00000000 -> -1
+dqcms639 comparesig -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+dqcms640 comparesig 0 0 -> 0
+dqcms641 comparesig 0 -0 -> 0
+dqcms642 comparesig 0 -0.0 -> 0
+dqcms643 comparesig 0 0.0 -> 0
+dqcms644 comparesig -0 0 -> 0
+dqcms645 comparesig -0 -0 -> 0
+dqcms646 comparesig -0 -0.0 -> 0
+dqcms647 comparesig -0 0.0 -> 0
+dqcms648 comparesig 0.0 0 -> 0
+dqcms649 comparesig 0.0 -0 -> 0
+dqcms650 comparesig 0.0 -0.0 -> 0
+dqcms651 comparesig 0.0 0.0 -> 0
+dqcms652 comparesig -0.0 0 -> 0
+dqcms653 comparesig -0.0 -0 -> 0
+dqcms654 comparesig -0.0 -0.0 -> 0
+dqcms655 comparesig -0.0 0.0 -> 0
+
+dqcms656 comparesig -0E1 0.0 -> 0
+dqcms657 comparesig -0E2 0.0 -> 0
+dqcms658 comparesig 0E1 0.0 -> 0
+dqcms659 comparesig 0E2 0.0 -> 0
+dqcms660 comparesig -0E1 0 -> 0
+dqcms661 comparesig -0E2 0 -> 0
+dqcms662 comparesig 0E1 0 -> 0
+dqcms663 comparesig 0E2 0 -> 0
+dqcms664 comparesig -0E1 -0E1 -> 0
+dqcms665 comparesig -0E2 -0E1 -> 0
+dqcms666 comparesig 0E1 -0E1 -> 0
+dqcms667 comparesig 0E2 -0E1 -> 0
+dqcms668 comparesig -0E1 -0E2 -> 0
+dqcms669 comparesig -0E2 -0E2 -> 0
+dqcms670 comparesig 0E1 -0E2 -> 0
+dqcms671 comparesig 0E2 -0E2 -> 0
+dqcms672 comparesig -0E1 0E1 -> 0
+dqcms673 comparesig -0E2 0E1 -> 0
+dqcms674 comparesig 0E1 0E1 -> 0
+dqcms675 comparesig 0E2 0E1 -> 0
+dqcms676 comparesig -0E1 0E2 -> 0
+dqcms677 comparesig -0E2 0E2 -> 0
+dqcms678 comparesig 0E1 0E2 -> 0
+dqcms679 comparesig 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+dqcms680 comparesig 12 12 -> 0
+dqcms681 comparesig 12 12.0 -> 0
+dqcms682 comparesig 12 12.00 -> 0
+dqcms683 comparesig 12 12.000 -> 0
+dqcms684 comparesig 12 12.0000 -> 0
+dqcms685 comparesig 12 12.00000 -> 0
+dqcms686 comparesig 12 12.000000 -> 0
+dqcms687 comparesig 12 12.0000000 -> 0
+dqcms688 comparesig 12 12.00000000 -> 0
+dqcms689 comparesig 12 12.000000000 -> 0
+dqcms690 comparesig 12 12 -> 0
+dqcms691 comparesig 12.0 12 -> 0
+dqcms692 comparesig 12.00 12 -> 0
+dqcms693 comparesig 12.000 12 -> 0
+dqcms694 comparesig 12.0000 12 -> 0
+dqcms695 comparesig 12.00000 12 -> 0
+dqcms696 comparesig 12.000000 12 -> 0
+dqcms697 comparesig 12.0000000 12 -> 0
+dqcms698 comparesig 12.00000000 12 -> 0
+dqcms699 comparesig 12.000000000 12 -> 0
+
+-- first, second, & last digit
+dqcms700 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123455 -> 1
+dqcms701 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
+dqcms702 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123457 -> -1
+dqcms703 comparesig 1234567899999999999999999990123456 0234567899999999999999999990123456 -> 1
+dqcms704 comparesig 1234567899999999999999999990123456 1234567899999999999999999990123456 -> 0
+dqcms705 comparesig 1234567899999999999999999990123456 2234567899999999999999999990123456 -> -1
+dqcms706 comparesig 1134567899999999999999999990123456 1034567899999999999999999990123456 -> 1
+dqcms707 comparesig 1134567899999999999999999990123456 1134567899999999999999999990123456 -> 0
+dqcms708 comparesig 1134567899999999999999999990123456 1234567899999999999999999990123456 -> -1
+
+-- miscellaneous
+dqcms721 comparesig 12345678000 1 -> 1
+dqcms722 comparesig 1 12345678000 -> -1
+dqcms723 comparesig 1234567800 1 -> 1
+dqcms724 comparesig 1 1234567800 -> -1
+dqcms725 comparesig 1234567890 1 -> 1
+dqcms726 comparesig 1 1234567890 -> -1
+dqcms727 comparesig 1234567891 1 -> 1
+dqcms728 comparesig 1 1234567891 -> -1
+dqcms729 comparesig 12345678901 1 -> 1
+dqcms730 comparesig 1 12345678901 -> -1
+dqcms731 comparesig 1234567896 1 -> 1
+dqcms732 comparesig 1 1234567896 -> -1
+
+-- residue cases at lower precision
+dqcms740 comparesig 1 0.9999999 -> 1
+dqcms741 comparesig 1 0.999999 -> 1
+dqcms742 comparesig 1 0.99999 -> 1
+dqcms743 comparesig 1 1.0000 -> 0
+dqcms744 comparesig 1 1.00001 -> -1
+dqcms745 comparesig 1 1.000001 -> -1
+dqcms746 comparesig 1 1.0000001 -> -1
+dqcms750 comparesig 0.9999999 1 -> -1
+dqcms751 comparesig 0.999999 1 -> -1
+dqcms752 comparesig 0.99999 1 -> -1
+dqcms753 comparesig 1.0000 1 -> 0
+dqcms754 comparesig 1.00001 1 -> 1
+dqcms755 comparesig 1.000001 1 -> 1
+dqcms756 comparesig 1.0000001 1 -> 1
+
+-- Specials
+dqcms780 comparesig Inf -Inf -> 1
+dqcms781 comparesig Inf -1000 -> 1
+dqcms782 comparesig Inf -1 -> 1
+dqcms783 comparesig Inf -0 -> 1
+dqcms784 comparesig Inf 0 -> 1
+dqcms785 comparesig Inf 1 -> 1
+dqcms786 comparesig Inf 1000 -> 1
+dqcms787 comparesig Inf Inf -> 0
+dqcms788 comparesig -1000 Inf -> -1
+dqcms789 comparesig -Inf Inf -> -1
+dqcms790 comparesig -1 Inf -> -1
+dqcms791 comparesig -0 Inf -> -1
+dqcms792 comparesig 0 Inf -> -1
+dqcms793 comparesig 1 Inf -> -1
+dqcms794 comparesig 1000 Inf -> -1
+dqcms795 comparesig Inf Inf -> 0
+
+dqcms800 comparesig -Inf -Inf -> 0
+dqcms801 comparesig -Inf -1000 -> -1
+dqcms802 comparesig -Inf -1 -> -1
+dqcms803 comparesig -Inf -0 -> -1
+dqcms804 comparesig -Inf 0 -> -1
+dqcms805 comparesig -Inf 1 -> -1
+dqcms806 comparesig -Inf 1000 -> -1
+dqcms807 comparesig -Inf Inf -> -1
+dqcms808 comparesig -Inf -Inf -> 0
+dqcms809 comparesig -1000 -Inf -> 1
+dqcms810 comparesig -1 -Inf -> 1
+dqcms811 comparesig -0 -Inf -> 1
+dqcms812 comparesig 0 -Inf -> 1
+dqcms813 comparesig 1 -Inf -> 1
+dqcms814 comparesig 1000 -Inf -> 1
+dqcms815 comparesig Inf -Inf -> 1
+
+dqcms821 comparesig NaN -Inf -> NaN Invalid_operation
+dqcms822 comparesig NaN -1000 -> NaN Invalid_operation
+dqcms823 comparesig NaN -1 -> NaN Invalid_operation
+dqcms824 comparesig NaN -0 -> NaN Invalid_operation
+dqcms825 comparesig NaN 0 -> NaN Invalid_operation
+dqcms826 comparesig NaN 1 -> NaN Invalid_operation
+dqcms827 comparesig NaN 1000 -> NaN Invalid_operation
+dqcms828 comparesig NaN Inf -> NaN Invalid_operation
+dqcms829 comparesig NaN NaN -> NaN Invalid_operation
+dqcms830 comparesig -Inf NaN -> NaN Invalid_operation
+dqcms831 comparesig -1000 NaN -> NaN Invalid_operation
+dqcms832 comparesig -1 NaN -> NaN Invalid_operation
+dqcms833 comparesig -0 NaN -> NaN Invalid_operation
+dqcms834 comparesig 0 NaN -> NaN Invalid_operation
+dqcms835 comparesig 1 NaN -> NaN Invalid_operation
+dqcms836 comparesig 1000 NaN -> NaN Invalid_operation
+dqcms837 comparesig Inf NaN -> NaN Invalid_operation
+dqcms838 comparesig -NaN -NaN -> -NaN Invalid_operation
+dqcms839 comparesig +NaN -NaN -> NaN Invalid_operation
+dqcms840 comparesig -NaN +NaN -> -NaN Invalid_operation
+
+dqcms841 comparesig sNaN -Inf -> NaN Invalid_operation
+dqcms842 comparesig sNaN -1000 -> NaN Invalid_operation
+dqcms843 comparesig sNaN -1 -> NaN Invalid_operation
+dqcms844 comparesig sNaN -0 -> NaN Invalid_operation
+dqcms845 comparesig sNaN 0 -> NaN Invalid_operation
+dqcms846 comparesig sNaN 1 -> NaN Invalid_operation
+dqcms847 comparesig sNaN 1000 -> NaN Invalid_operation
+dqcms848 comparesig sNaN NaN -> NaN Invalid_operation
+dqcms849 comparesig sNaN sNaN -> NaN Invalid_operation
+dqcms850 comparesig NaN sNaN -> NaN Invalid_operation
+dqcms851 comparesig -Inf sNaN -> NaN Invalid_operation
+dqcms852 comparesig -1000 sNaN -> NaN Invalid_operation
+dqcms853 comparesig -1 sNaN -> NaN Invalid_operation
+dqcms854 comparesig -0 sNaN -> NaN Invalid_operation
+dqcms855 comparesig 0 sNaN -> NaN Invalid_operation
+dqcms856 comparesig 1 sNaN -> NaN Invalid_operation
+dqcms857 comparesig 1000 sNaN -> NaN Invalid_operation
+dqcms858 comparesig Inf sNaN -> NaN Invalid_operation
+dqcms859 comparesig NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqcms860 comparesig NaN9 -Inf -> NaN9 Invalid_operation
+dqcms861 comparesig NaN8 999 -> NaN8 Invalid_operation
+dqcms862 comparesig NaN77 Inf -> NaN77 Invalid_operation
+dqcms863 comparesig -NaN67 NaN5 -> -NaN67 Invalid_operation
+dqcms864 comparesig -Inf -NaN4 -> -NaN4 Invalid_operation
+dqcms865 comparesig -999 -NaN33 -> -NaN33 Invalid_operation
+dqcms866 comparesig Inf NaN2 -> NaN2 Invalid_operation
+dqcms867 comparesig -NaN41 -NaN42 -> -NaN41 Invalid_operation
+dqcms868 comparesig +NaN41 -NaN42 -> NaN41 Invalid_operation
+dqcms869 comparesig -NaN41 +NaN42 -> -NaN41 Invalid_operation
+dqcms870 comparesig +NaN41 +NaN42 -> NaN41 Invalid_operation
+
+dqcms871 comparesig -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqcms872 comparesig sNaN98 -11 -> NaN98 Invalid_operation
+dqcms873 comparesig sNaN97 NaN -> NaN97 Invalid_operation
+dqcms874 comparesig sNaN16 sNaN94 -> NaN16 Invalid_operation
+dqcms875 comparesig NaN85 sNaN83 -> NaN83 Invalid_operation
+dqcms876 comparesig -Inf sNaN92 -> NaN92 Invalid_operation
+dqcms877 comparesig 088 sNaN81 -> NaN81 Invalid_operation
+dqcms878 comparesig Inf sNaN90 -> NaN90 Invalid_operation
+dqcms879 comparesig NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- wide range
+dqcms880 comparesig +1.23456789012345E-0 9E+6144 -> -1
+dqcms881 comparesig 9E+6144 +1.23456789012345E-0 -> 1
+dqcms882 comparesig +0.100 9E-6143 -> 1
+dqcms883 comparesig 9E-6143 +0.100 -> -1
+dqcms885 comparesig -1.23456789012345E-0 9E+6144 -> -1
+dqcms886 comparesig 9E+6144 -1.23456789012345E-0 -> 1
+dqcms887 comparesig -0.100 9E-6143 -> -1
+dqcms888 comparesig 9E-6143 -0.100 -> 1
+
+-- signs
+dqcms901 comparesig 1e+77 1e+11 -> 1
+dqcms902 comparesig 1e+77 -1e+11 -> 1
+dqcms903 comparesig -1e+77 1e+11 -> -1
+dqcms904 comparesig -1e+77 -1e+11 -> -1
+dqcms905 comparesig 1e-77 1e-11 -> -1
+dqcms906 comparesig 1e-77 -1e-11 -> 1
+dqcms907 comparesig -1e-77 1e-11 -> -1
+dqcms908 comparesig -1e-77 -1e-11 -> 1
+
+-- Null tests
+dqcms990 comparesig 10 # -> NaN Invalid_operation
+dqcms991 comparesig # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqCompareTotal.decTest b/Lib/test/decimaltestdata/dqCompareTotal.decTest
index bae3761909..13701ccb57 100644
--- a/Lib/test/decimaltestdata/dqCompareTotal.decTest
+++ b/Lib/test/decimaltestdata/dqCompareTotal.decTest
@@ -1,706 +1,706 @@
-------------------------------------------------------------------------
--- dqCompareTotal.decTest -- decQuad comparison using total ordering --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqcot001 comparetotal -2 -2 -> 0
-dqcot002 comparetotal -2 -1 -> -1
-dqcot003 comparetotal -2 0 -> -1
-dqcot004 comparetotal -2 1 -> -1
-dqcot005 comparetotal -2 2 -> -1
-dqcot006 comparetotal -1 -2 -> 1
-dqcot007 comparetotal -1 -1 -> 0
-dqcot008 comparetotal -1 0 -> -1
-dqcot009 comparetotal -1 1 -> -1
-dqcot010 comparetotal -1 2 -> -1
-dqcot011 comparetotal 0 -2 -> 1
-dqcot012 comparetotal 0 -1 -> 1
-dqcot013 comparetotal 0 0 -> 0
-dqcot014 comparetotal 0 1 -> -1
-dqcot015 comparetotal 0 2 -> -1
-dqcot016 comparetotal 1 -2 -> 1
-dqcot017 comparetotal 1 -1 -> 1
-dqcot018 comparetotal 1 0 -> 1
-dqcot019 comparetotal 1 1 -> 0
-dqcot020 comparetotal 1 2 -> -1
-dqcot021 comparetotal 2 -2 -> 1
-dqcot022 comparetotal 2 -1 -> 1
-dqcot023 comparetotal 2 0 -> 1
-dqcot025 comparetotal 2 1 -> 1
-dqcot026 comparetotal 2 2 -> 0
-
-dqcot031 comparetotal -20 -20 -> 0
-dqcot032 comparetotal -20 -10 -> -1
-dqcot033 comparetotal -20 00 -> -1
-dqcot034 comparetotal -20 10 -> -1
-dqcot035 comparetotal -20 20 -> -1
-dqcot036 comparetotal -10 -20 -> 1
-dqcot037 comparetotal -10 -10 -> 0
-dqcot038 comparetotal -10 00 -> -1
-dqcot039 comparetotal -10 10 -> -1
-dqcot040 comparetotal -10 20 -> -1
-dqcot041 comparetotal 00 -20 -> 1
-dqcot042 comparetotal 00 -10 -> 1
-dqcot043 comparetotal 00 00 -> 0
-dqcot044 comparetotal 00 10 -> -1
-dqcot045 comparetotal 00 20 -> -1
-dqcot046 comparetotal 10 -20 -> 1
-dqcot047 comparetotal 10 -10 -> 1
-dqcot048 comparetotal 10 00 -> 1
-dqcot049 comparetotal 10 10 -> 0
-dqcot050 comparetotal 10 20 -> -1
-dqcot051 comparetotal 20 -20 -> 1
-dqcot052 comparetotal 20 -10 -> 1
-dqcot053 comparetotal 20 00 -> 1
-dqcot055 comparetotal 20 10 -> 1
-dqcot056 comparetotal 20 20 -> 0
-
-dqcot061 comparetotal -2.0 -2.0 -> 0
-dqcot062 comparetotal -2.0 -1.0 -> -1
-dqcot063 comparetotal -2.0 0.0 -> -1
-dqcot064 comparetotal -2.0 1.0 -> -1
-dqcot065 comparetotal -2.0 2.0 -> -1
-dqcot066 comparetotal -1.0 -2.0 -> 1
-dqcot067 comparetotal -1.0 -1.0 -> 0
-dqcot068 comparetotal -1.0 0.0 -> -1
-dqcot069 comparetotal -1.0 1.0 -> -1
-dqcot070 comparetotal -1.0 2.0 -> -1
-dqcot071 comparetotal 0.0 -2.0 -> 1
-dqcot072 comparetotal 0.0 -1.0 -> 1
-dqcot073 comparetotal 0.0 0.0 -> 0
-dqcot074 comparetotal 0.0 1.0 -> -1
-dqcot075 comparetotal 0.0 2.0 -> -1
-dqcot076 comparetotal 1.0 -2.0 -> 1
-dqcot077 comparetotal 1.0 -1.0 -> 1
-dqcot078 comparetotal 1.0 0.0 -> 1
-dqcot079 comparetotal 1.0 1.0 -> 0
-dqcot080 comparetotal 1.0 2.0 -> -1
-dqcot081 comparetotal 2.0 -2.0 -> 1
-dqcot082 comparetotal 2.0 -1.0 -> 1
-dqcot083 comparetotal 2.0 0.0 -> 1
-dqcot085 comparetotal 2.0 1.0 -> 1
-dqcot086 comparetotal 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-dqcot090 comparetotal 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
-dqcot091 comparetotal -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> -1
-dqcot092 comparetotal 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 1
-dqcot093 comparetotal -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-dqcot100 comparetotal 7.0 7.0 -> 0
-dqcot101 comparetotal 7.0 7 -> -1
-dqcot102 comparetotal 7 7.0 -> 1
-dqcot103 comparetotal 7E+0 7.0 -> 1
-dqcot104 comparetotal 70E-1 7.0 -> 0
-dqcot105 comparetotal 0.7E+1 7 -> 0
-dqcot106 comparetotal 70E-1 7 -> -1
-dqcot107 comparetotal 7.0 7E+0 -> -1
-dqcot108 comparetotal 7.0 70E-1 -> 0
-dqcot109 comparetotal 7 0.7E+1 -> 0
-dqcot110 comparetotal 7 70E-1 -> 1
-
-dqcot120 comparetotal 8.0 7.0 -> 1
-dqcot121 comparetotal 8.0 7 -> 1
-dqcot122 comparetotal 8 7.0 -> 1
-dqcot123 comparetotal 8E+0 7.0 -> 1
-dqcot124 comparetotal 80E-1 7.0 -> 1
-dqcot125 comparetotal 0.8E+1 7 -> 1
-dqcot126 comparetotal 80E-1 7 -> 1
-dqcot127 comparetotal 8.0 7E+0 -> 1
-dqcot128 comparetotal 8.0 70E-1 -> 1
-dqcot129 comparetotal 8 0.7E+1 -> 1
-dqcot130 comparetotal 8 70E-1 -> 1
-
-dqcot140 comparetotal 8.0 9.0 -> -1
-dqcot141 comparetotal 8.0 9 -> -1
-dqcot142 comparetotal 8 9.0 -> -1
-dqcot143 comparetotal 8E+0 9.0 -> -1
-dqcot144 comparetotal 80E-1 9.0 -> -1
-dqcot145 comparetotal 0.8E+1 9 -> -1
-dqcot146 comparetotal 80E-1 9 -> -1
-dqcot147 comparetotal 8.0 9E+0 -> -1
-dqcot148 comparetotal 8.0 90E-1 -> -1
-dqcot149 comparetotal 8 0.9E+1 -> -1
-dqcot150 comparetotal 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-dqcot200 comparetotal -7.0 7.0 -> -1
-dqcot201 comparetotal -7.0 7 -> -1
-dqcot202 comparetotal -7 7.0 -> -1
-dqcot203 comparetotal -7E+0 7.0 -> -1
-dqcot204 comparetotal -70E-1 7.0 -> -1
-dqcot205 comparetotal -0.7E+1 7 -> -1
-dqcot206 comparetotal -70E-1 7 -> -1
-dqcot207 comparetotal -7.0 7E+0 -> -1
-dqcot208 comparetotal -7.0 70E-1 -> -1
-dqcot209 comparetotal -7 0.7E+1 -> -1
-dqcot210 comparetotal -7 70E-1 -> -1
-
-dqcot220 comparetotal -8.0 7.0 -> -1
-dqcot221 comparetotal -8.0 7 -> -1
-dqcot222 comparetotal -8 7.0 -> -1
-dqcot223 comparetotal -8E+0 7.0 -> -1
-dqcot224 comparetotal -80E-1 7.0 -> -1
-dqcot225 comparetotal -0.8E+1 7 -> -1
-dqcot226 comparetotal -80E-1 7 -> -1
-dqcot227 comparetotal -8.0 7E+0 -> -1
-dqcot228 comparetotal -8.0 70E-1 -> -1
-dqcot229 comparetotal -8 0.7E+1 -> -1
-dqcot230 comparetotal -8 70E-1 -> -1
-
-dqcot240 comparetotal -8.0 9.0 -> -1
-dqcot241 comparetotal -8.0 9 -> -1
-dqcot242 comparetotal -8 9.0 -> -1
-dqcot243 comparetotal -8E+0 9.0 -> -1
-dqcot244 comparetotal -80E-1 9.0 -> -1
-dqcot245 comparetotal -0.8E+1 9 -> -1
-dqcot246 comparetotal -80E-1 9 -> -1
-dqcot247 comparetotal -8.0 9E+0 -> -1
-dqcot248 comparetotal -8.0 90E-1 -> -1
-dqcot249 comparetotal -8 0.9E+1 -> -1
-dqcot250 comparetotal -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-dqcot300 comparetotal 7.0 -7.0 -> 1
-dqcot301 comparetotal 7.0 -7 -> 1
-dqcot302 comparetotal 7 -7.0 -> 1
-dqcot303 comparetotal 7E+0 -7.0 -> 1
-dqcot304 comparetotal 70E-1 -7.0 -> 1
-dqcot305 comparetotal .7E+1 -7 -> 1
-dqcot306 comparetotal 70E-1 -7 -> 1
-dqcot307 comparetotal 7.0 -7E+0 -> 1
-dqcot308 comparetotal 7.0 -70E-1 -> 1
-dqcot309 comparetotal 7 -.7E+1 -> 1
-dqcot310 comparetotal 7 -70E-1 -> 1
-
-dqcot320 comparetotal 8.0 -7.0 -> 1
-dqcot321 comparetotal 8.0 -7 -> 1
-dqcot322 comparetotal 8 -7.0 -> 1
-dqcot323 comparetotal 8E+0 -7.0 -> 1
-dqcot324 comparetotal 80E-1 -7.0 -> 1
-dqcot325 comparetotal .8E+1 -7 -> 1
-dqcot326 comparetotal 80E-1 -7 -> 1
-dqcot327 comparetotal 8.0 -7E+0 -> 1
-dqcot328 comparetotal 8.0 -70E-1 -> 1
-dqcot329 comparetotal 8 -.7E+1 -> 1
-dqcot330 comparetotal 8 -70E-1 -> 1
-
-dqcot340 comparetotal 8.0 -9.0 -> 1
-dqcot341 comparetotal 8.0 -9 -> 1
-dqcot342 comparetotal 8 -9.0 -> 1
-dqcot343 comparetotal 8E+0 -9.0 -> 1
-dqcot344 comparetotal 80E-1 -9.0 -> 1
-dqcot345 comparetotal .8E+1 -9 -> 1
-dqcot346 comparetotal 80E-1 -9 -> 1
-dqcot347 comparetotal 8.0 -9E+0 -> 1
-dqcot348 comparetotal 8.0 -90E-1 -> 1
-dqcot349 comparetotal 8 -.9E+1 -> 1
-dqcot350 comparetotal 8 -90E-1 -> 1
-
--- and again, with sign changes -- ..
-dqcot400 comparetotal -7.0 -7.0 -> 0
-dqcot401 comparetotal -7.0 -7 -> 1
-dqcot402 comparetotal -7 -7.0 -> -1
-dqcot403 comparetotal -7E+0 -7.0 -> -1
-dqcot404 comparetotal -70E-1 -7.0 -> 0
-dqcot405 comparetotal -.7E+1 -7 -> 0
-dqcot406 comparetotal -70E-1 -7 -> 1
-dqcot407 comparetotal -7.0 -7E+0 -> 1
-dqcot408 comparetotal -7.0 -70E-1 -> 0
-dqcot409 comparetotal -7 -.7E+1 -> 0
-dqcot410 comparetotal -7 -70E-1 -> -1
-
-dqcot420 comparetotal -8.0 -7.0 -> -1
-dqcot421 comparetotal -8.0 -7 -> -1
-dqcot422 comparetotal -8 -7.0 -> -1
-dqcot423 comparetotal -8E+0 -7.0 -> -1
-dqcot424 comparetotal -80E-1 -7.0 -> -1
-dqcot425 comparetotal -.8E+1 -7 -> -1
-dqcot426 comparetotal -80E-1 -7 -> -1
-dqcot427 comparetotal -8.0 -7E+0 -> -1
-dqcot428 comparetotal -8.0 -70E-1 -> -1
-dqcot429 comparetotal -8 -.7E+1 -> -1
-dqcot430 comparetotal -8 -70E-1 -> -1
-
-dqcot440 comparetotal -8.0 -9.0 -> 1
-dqcot441 comparetotal -8.0 -9 -> 1
-dqcot442 comparetotal -8 -9.0 -> 1
-dqcot443 comparetotal -8E+0 -9.0 -> 1
-dqcot444 comparetotal -80E-1 -9.0 -> 1
-dqcot445 comparetotal -.8E+1 -9 -> 1
-dqcot446 comparetotal -80E-1 -9 -> 1
-dqcot447 comparetotal -8.0 -9E+0 -> 1
-dqcot448 comparetotal -8.0 -90E-1 -> 1
-dqcot449 comparetotal -8 -.9E+1 -> 1
-dqcot450 comparetotal -8 -90E-1 -> 1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-dqcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
-dqcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1
-dqcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
-dqcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1
-dqcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
-dqcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1
-dqcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
-dqcot480 comparetotal 123.456000E+89 123.456E+89 -> -1
-dqcot481 comparetotal 123.45600E-89 123.456E-89 -> -1
-dqcot482 comparetotal 123.4560E+89 123.456E+89 -> -1
-dqcot483 comparetotal 123.456E-89 123.456E-89 -> 0
-dqcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1
-dqcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
-dqcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1
-dqcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
-dqcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1
-dqcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
-dqcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1
-dqcot494 comparetotal 123.456E-89 123.456000E-89 -> 1
-dqcot495 comparetotal 123.456E+89 123.45600E+89 -> 1
-dqcot496 comparetotal 123.456E-89 123.4560E-89 -> 1
-dqcot497 comparetotal 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-dqcot498 comparetotal 1 1E-17 -> 1
-dqcot499 comparetotal 1 1E-16 -> 1
-dqcot500 comparetotal 1 1E-15 -> 1
-dqcot501 comparetotal 1 1E-14 -> 1
-dqcot502 comparetotal 1 1E-13 -> 1
-dqcot503 comparetotal 1 1E-12 -> 1
-dqcot504 comparetotal 1 1E-11 -> 1
-dqcot505 comparetotal 1 1E-10 -> 1
-dqcot506 comparetotal 1 1E-9 -> 1
-dqcot507 comparetotal 1 1E-8 -> 1
-dqcot508 comparetotal 1 1E-7 -> 1
-dqcot509 comparetotal 1 1E-6 -> 1
-dqcot510 comparetotal 1 1E-5 -> 1
-dqcot511 comparetotal 1 1E-4 -> 1
-dqcot512 comparetotal 1 1E-3 -> 1
-dqcot513 comparetotal 1 1E-2 -> 1
-dqcot514 comparetotal 1 1E-1 -> 1
-dqcot515 comparetotal 1 1E-0 -> 0
-dqcot516 comparetotal 1 1E+1 -> -1
-dqcot517 comparetotal 1 1E+2 -> -1
-dqcot518 comparetotal 1 1E+3 -> -1
-dqcot519 comparetotal 1 1E+4 -> -1
-dqcot521 comparetotal 1 1E+5 -> -1
-dqcot522 comparetotal 1 1E+6 -> -1
-dqcot523 comparetotal 1 1E+7 -> -1
-dqcot524 comparetotal 1 1E+8 -> -1
-dqcot525 comparetotal 1 1E+9 -> -1
-dqcot526 comparetotal 1 1E+10 -> -1
-dqcot527 comparetotal 1 1E+11 -> -1
-dqcot528 comparetotal 1 1E+12 -> -1
-dqcot529 comparetotal 1 1E+13 -> -1
-dqcot530 comparetotal 1 1E+14 -> -1
-dqcot531 comparetotal 1 1E+15 -> -1
-dqcot532 comparetotal 1 1E+16 -> -1
-dqcot533 comparetotal 1 1E+17 -> -1
--- LR swap
-dqcot538 comparetotal 1E-17 1 -> -1
-dqcot539 comparetotal 1E-16 1 -> -1
-dqcot540 comparetotal 1E-15 1 -> -1
-dqcot541 comparetotal 1E-14 1 -> -1
-dqcot542 comparetotal 1E-13 1 -> -1
-dqcot543 comparetotal 1E-12 1 -> -1
-dqcot544 comparetotal 1E-11 1 -> -1
-dqcot545 comparetotal 1E-10 1 -> -1
-dqcot546 comparetotal 1E-9 1 -> -1
-dqcot547 comparetotal 1E-8 1 -> -1
-dqcot548 comparetotal 1E-7 1 -> -1
-dqcot549 comparetotal 1E-6 1 -> -1
-dqcot550 comparetotal 1E-5 1 -> -1
-dqcot551 comparetotal 1E-4 1 -> -1
-dqcot552 comparetotal 1E-3 1 -> -1
-dqcot553 comparetotal 1E-2 1 -> -1
-dqcot554 comparetotal 1E-1 1 -> -1
-dqcot555 comparetotal 1E-0 1 -> 0
-dqcot556 comparetotal 1E+1 1 -> 1
-dqcot557 comparetotal 1E+2 1 -> 1
-dqcot558 comparetotal 1E+3 1 -> 1
-dqcot559 comparetotal 1E+4 1 -> 1
-dqcot561 comparetotal 1E+5 1 -> 1
-dqcot562 comparetotal 1E+6 1 -> 1
-dqcot563 comparetotal 1E+7 1 -> 1
-dqcot564 comparetotal 1E+8 1 -> 1
-dqcot565 comparetotal 1E+9 1 -> 1
-dqcot566 comparetotal 1E+10 1 -> 1
-dqcot567 comparetotal 1E+11 1 -> 1
-dqcot568 comparetotal 1E+12 1 -> 1
-dqcot569 comparetotal 1E+13 1 -> 1
-dqcot570 comparetotal 1E+14 1 -> 1
-dqcot571 comparetotal 1E+15 1 -> 1
-dqcot572 comparetotal 1E+16 1 -> 1
-dqcot573 comparetotal 1E+17 1 -> 1
--- similar with a useful coefficient, one side only
-dqcot578 comparetotal 0.000000987654321 1E-17 -> 1
-dqcot579 comparetotal 0.000000987654321 1E-16 -> 1
-dqcot580 comparetotal 0.000000987654321 1E-15 -> 1
-dqcot581 comparetotal 0.000000987654321 1E-14 -> 1
-dqcot582 comparetotal 0.000000987654321 1E-13 -> 1
-dqcot583 comparetotal 0.000000987654321 1E-12 -> 1
-dqcot584 comparetotal 0.000000987654321 1E-11 -> 1
-dqcot585 comparetotal 0.000000987654321 1E-10 -> 1
-dqcot586 comparetotal 0.000000987654321 1E-9 -> 1
-dqcot587 comparetotal 0.000000987654321 1E-8 -> 1
-dqcot588 comparetotal 0.000000987654321 1E-7 -> 1
-dqcot589 comparetotal 0.000000987654321 1E-6 -> -1
-dqcot590 comparetotal 0.000000987654321 1E-5 -> -1
-dqcot591 comparetotal 0.000000987654321 1E-4 -> -1
-dqcot592 comparetotal 0.000000987654321 1E-3 -> -1
-dqcot593 comparetotal 0.000000987654321 1E-2 -> -1
-dqcot594 comparetotal 0.000000987654321 1E-1 -> -1
-dqcot595 comparetotal 0.000000987654321 1E-0 -> -1
-dqcot596 comparetotal 0.000000987654321 1E+1 -> -1
-dqcot597 comparetotal 0.000000987654321 1E+2 -> -1
-dqcot598 comparetotal 0.000000987654321 1E+3 -> -1
-dqcot599 comparetotal 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-dqcot600 comparetotal 12 12.2345 -> -1
-dqcot601 comparetotal 12.0 12.2345 -> -1
-dqcot602 comparetotal 12.00 12.2345 -> -1
-dqcot603 comparetotal 12.000 12.2345 -> -1
-dqcot604 comparetotal 12.0000 12.2345 -> -1
-dqcot605 comparetotal 12.00000 12.2345 -> -1
-dqcot606 comparetotal 12.000000 12.2345 -> -1
-dqcot607 comparetotal 12.0000000 12.2345 -> -1
-dqcot608 comparetotal 12.00000000 12.2345 -> -1
-dqcot609 comparetotal 12.000000000 12.2345 -> -1
-dqcot610 comparetotal 12.1234 12 -> 1
-dqcot611 comparetotal 12.1234 12.0 -> 1
-dqcot612 comparetotal 12.1234 12.00 -> 1
-dqcot613 comparetotal 12.1234 12.000 -> 1
-dqcot614 comparetotal 12.1234 12.0000 -> 1
-dqcot615 comparetotal 12.1234 12.00000 -> 1
-dqcot616 comparetotal 12.1234 12.000000 -> 1
-dqcot617 comparetotal 12.1234 12.0000000 -> 1
-dqcot618 comparetotal 12.1234 12.00000000 -> 1
-dqcot619 comparetotal 12.1234 12.000000000 -> 1
-dqcot620 comparetotal -12 -12.2345 -> 1
-dqcot621 comparetotal -12.0 -12.2345 -> 1
-dqcot622 comparetotal -12.00 -12.2345 -> 1
-dqcot623 comparetotal -12.000 -12.2345 -> 1
-dqcot624 comparetotal -12.0000 -12.2345 -> 1
-dqcot625 comparetotal -12.00000 -12.2345 -> 1
-dqcot626 comparetotal -12.000000 -12.2345 -> 1
-dqcot627 comparetotal -12.0000000 -12.2345 -> 1
-dqcot628 comparetotal -12.00000000 -12.2345 -> 1
-dqcot629 comparetotal -12.000000000 -12.2345 -> 1
-dqcot630 comparetotal -12.1234 -12 -> -1
-dqcot631 comparetotal -12.1234 -12.0 -> -1
-dqcot632 comparetotal -12.1234 -12.00 -> -1
-dqcot633 comparetotal -12.1234 -12.000 -> -1
-dqcot634 comparetotal -12.1234 -12.0000 -> -1
-dqcot635 comparetotal -12.1234 -12.00000 -> -1
-dqcot636 comparetotal -12.1234 -12.000000 -> -1
-dqcot637 comparetotal -12.1234 -12.0000000 -> -1
-dqcot638 comparetotal -12.1234 -12.00000000 -> -1
-dqcot639 comparetotal -12.1234 -12.000000000 -> -1
-
--- extended zeros
-dqcot640 comparetotal 0 0 -> 0
-dqcot641 comparetotal 0 -0 -> 1
-dqcot642 comparetotal 0 -0.0 -> 1
-dqcot643 comparetotal 0 0.0 -> 1
-dqcot644 comparetotal -0 0 -> -1
-dqcot645 comparetotal -0 -0 -> 0
-dqcot646 comparetotal -0 -0.0 -> -1
-dqcot647 comparetotal -0 0.0 -> -1
-dqcot648 comparetotal 0.0 0 -> -1
-dqcot649 comparetotal 0.0 -0 -> 1
-dqcot650 comparetotal 0.0 -0.0 -> 1
-dqcot651 comparetotal 0.0 0.0 -> 0
-dqcot652 comparetotal -0.0 0 -> -1
-dqcot653 comparetotal -0.0 -0 -> 1
-dqcot654 comparetotal -0.0 -0.0 -> 0
-dqcot655 comparetotal -0.0 0.0 -> -1
-
-dqcot656 comparetotal -0E1 0.0 -> -1
-dqcot657 comparetotal -0E2 0.0 -> -1
-dqcot658 comparetotal 0E1 0.0 -> 1
-dqcot659 comparetotal 0E2 0.0 -> 1
-dqcot660 comparetotal -0E1 0 -> -1
-dqcot661 comparetotal -0E2 0 -> -1
-dqcot662 comparetotal 0E1 0 -> 1
-dqcot663 comparetotal 0E2 0 -> 1
-dqcot664 comparetotal -0E1 -0E1 -> 0
-dqcot665 comparetotal -0E2 -0E1 -> -1
-dqcot666 comparetotal 0E1 -0E1 -> 1
-dqcot667 comparetotal 0E2 -0E1 -> 1
-dqcot668 comparetotal -0E1 -0E2 -> 1
-dqcot669 comparetotal -0E2 -0E2 -> 0
-dqcot670 comparetotal 0E1 -0E2 -> 1
-dqcot671 comparetotal 0E2 -0E2 -> 1
-dqcot672 comparetotal -0E1 0E1 -> -1
-dqcot673 comparetotal -0E2 0E1 -> -1
-dqcot674 comparetotal 0E1 0E1 -> 0
-dqcot675 comparetotal 0E2 0E1 -> 1
-dqcot676 comparetotal -0E1 0E2 -> -1
-dqcot677 comparetotal -0E2 0E2 -> -1
-dqcot678 comparetotal 0E1 0E2 -> -1
-dqcot679 comparetotal 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-dqcot680 comparetotal 12 12 -> 0
-dqcot681 comparetotal 12 12.0 -> 1
-dqcot682 comparetotal 12 12.00 -> 1
-dqcot683 comparetotal 12 12.000 -> 1
-dqcot684 comparetotal 12 12.0000 -> 1
-dqcot685 comparetotal 12 12.00000 -> 1
-dqcot686 comparetotal 12 12.000000 -> 1
-dqcot687 comparetotal 12 12.0000000 -> 1
-dqcot688 comparetotal 12 12.00000000 -> 1
-dqcot689 comparetotal 12 12.000000000 -> 1
-dqcot690 comparetotal 12 12 -> 0
-dqcot691 comparetotal 12.0 12 -> -1
-dqcot692 comparetotal 12.00 12 -> -1
-dqcot693 comparetotal 12.000 12 -> -1
-dqcot694 comparetotal 12.0000 12 -> -1
-dqcot695 comparetotal 12.00000 12 -> -1
-dqcot696 comparetotal 12.000000 12 -> -1
-dqcot697 comparetotal 12.0000000 12 -> -1
-dqcot698 comparetotal 12.00000000 12 -> -1
-dqcot699 comparetotal 12.000000000 12 -> -1
-
--- old long operand checks
-dqcot701 comparetotal 12345678000 1 -> 1
-dqcot702 comparetotal 1 12345678000 -> -1
-dqcot703 comparetotal 1234567800 1 -> 1
-dqcot704 comparetotal 1 1234567800 -> -1
-dqcot705 comparetotal 1234567890 1 -> 1
-dqcot706 comparetotal 1 1234567890 -> -1
-dqcot707 comparetotal 1234567891 1 -> 1
-dqcot708 comparetotal 1 1234567891 -> -1
-dqcot709 comparetotal 12345678901 1 -> 1
-dqcot710 comparetotal 1 12345678901 -> -1
-dqcot711 comparetotal 1234567896 1 -> 1
-dqcot712 comparetotal 1 1234567896 -> -1
-dqcot713 comparetotal -1234567891 1 -> -1
-dqcot714 comparetotal 1 -1234567891 -> 1
-dqcot715 comparetotal -12345678901 1 -> -1
-dqcot716 comparetotal 1 -12345678901 -> 1
-dqcot717 comparetotal -1234567896 1 -> -1
-dqcot718 comparetotal 1 -1234567896 -> 1
-
--- old residue cases
-dqcot740 comparetotal 1 0.9999999 -> 1
-dqcot741 comparetotal 1 0.999999 -> 1
-dqcot742 comparetotal 1 0.99999 -> 1
-dqcot743 comparetotal 1 1.0000 -> 1
-dqcot744 comparetotal 1 1.00001 -> -1
-dqcot745 comparetotal 1 1.000001 -> -1
-dqcot746 comparetotal 1 1.0000001 -> -1
-dqcot750 comparetotal 0.9999999 1 -> -1
-dqcot751 comparetotal 0.999999 1 -> -1
-dqcot752 comparetotal 0.99999 1 -> -1
-dqcot753 comparetotal 1.0000 1 -> -1
-dqcot754 comparetotal 1.00001 1 -> 1
-dqcot755 comparetotal 1.000001 1 -> 1
-dqcot756 comparetotal 1.0000001 1 -> 1
-
--- Specials
-dqcot780 comparetotal Inf -Inf -> 1
-dqcot781 comparetotal Inf -1000 -> 1
-dqcot782 comparetotal Inf -1 -> 1
-dqcot783 comparetotal Inf -0 -> 1
-dqcot784 comparetotal Inf 0 -> 1
-dqcot785 comparetotal Inf 1 -> 1
-dqcot786 comparetotal Inf 1000 -> 1
-dqcot787 comparetotal Inf Inf -> 0
-dqcot788 comparetotal -1000 Inf -> -1
-dqcot789 comparetotal -Inf Inf -> -1
-dqcot790 comparetotal -1 Inf -> -1
-dqcot791 comparetotal -0 Inf -> -1
-dqcot792 comparetotal 0 Inf -> -1
-dqcot793 comparetotal 1 Inf -> -1
-dqcot794 comparetotal 1000 Inf -> -1
-dqcot795 comparetotal Inf Inf -> 0
-
-dqcot800 comparetotal -Inf -Inf -> 0
-dqcot801 comparetotal -Inf -1000 -> -1
-dqcot802 comparetotal -Inf -1 -> -1
-dqcot803 comparetotal -Inf -0 -> -1
-dqcot804 comparetotal -Inf 0 -> -1
-dqcot805 comparetotal -Inf 1 -> -1
-dqcot806 comparetotal -Inf 1000 -> -1
-dqcot807 comparetotal -Inf Inf -> -1
-dqcot808 comparetotal -Inf -Inf -> 0
-dqcot809 comparetotal -1000 -Inf -> 1
-dqcot810 comparetotal -1 -Inf -> 1
-dqcot811 comparetotal -0 -Inf -> 1
-dqcot812 comparetotal 0 -Inf -> 1
-dqcot813 comparetotal 1 -Inf -> 1
-dqcot814 comparetotal 1000 -Inf -> 1
-dqcot815 comparetotal Inf -Inf -> 1
-
-dqcot821 comparetotal NaN -Inf -> 1
-dqcot822 comparetotal NaN -1000 -> 1
-dqcot823 comparetotal NaN -1 -> 1
-dqcot824 comparetotal NaN -0 -> 1
-dqcot825 comparetotal NaN 0 -> 1
-dqcot826 comparetotal NaN 1 -> 1
-dqcot827 comparetotal NaN 1000 -> 1
-dqcot828 comparetotal NaN Inf -> 1
-dqcot829 comparetotal NaN NaN -> 0
-dqcot830 comparetotal -Inf NaN -> -1
-dqcot831 comparetotal -1000 NaN -> -1
-dqcot832 comparetotal -1 NaN -> -1
-dqcot833 comparetotal -0 NaN -> -1
-dqcot834 comparetotal 0 NaN -> -1
-dqcot835 comparetotal 1 NaN -> -1
-dqcot836 comparetotal 1000 NaN -> -1
-dqcot837 comparetotal Inf NaN -> -1
-dqcot838 comparetotal -NaN -NaN -> 0
-dqcot839 comparetotal +NaN -NaN -> 1
-dqcot840 comparetotal -NaN +NaN -> -1
-
-dqcot841 comparetotal sNaN -sNaN -> 1
-dqcot842 comparetotal sNaN -NaN -> 1
-dqcot843 comparetotal sNaN -Inf -> 1
-dqcot844 comparetotal sNaN -1000 -> 1
-dqcot845 comparetotal sNaN -1 -> 1
-dqcot846 comparetotal sNaN -0 -> 1
-dqcot847 comparetotal sNaN 0 -> 1
-dqcot848 comparetotal sNaN 1 -> 1
-dqcot849 comparetotal sNaN 1000 -> 1
-dqcot850 comparetotal sNaN NaN -> -1
-dqcot851 comparetotal sNaN sNaN -> 0
-
-dqcot852 comparetotal -sNaN sNaN -> -1
-dqcot853 comparetotal -NaN sNaN -> -1
-dqcot854 comparetotal -Inf sNaN -> -1
-dqcot855 comparetotal -1000 sNaN -> -1
-dqcot856 comparetotal -1 sNaN -> -1
-dqcot857 comparetotal -0 sNaN -> -1
-dqcot858 comparetotal 0 sNaN -> -1
-dqcot859 comparetotal 1 sNaN -> -1
-dqcot860 comparetotal 1000 sNaN -> -1
-dqcot861 comparetotal Inf sNaN -> -1
-dqcot862 comparetotal NaN sNaN -> 1
-dqcot863 comparetotal sNaN sNaN -> 0
-
-dqcot871 comparetotal -sNaN -sNaN -> 0
-dqcot872 comparetotal -sNaN -NaN -> 1
-dqcot873 comparetotal -sNaN -Inf -> -1
-dqcot874 comparetotal -sNaN -1000 -> -1
-dqcot875 comparetotal -sNaN -1 -> -1
-dqcot876 comparetotal -sNaN -0 -> -1
-dqcot877 comparetotal -sNaN 0 -> -1
-dqcot878 comparetotal -sNaN 1 -> -1
-dqcot879 comparetotal -sNaN 1000 -> -1
-dqcot880 comparetotal -sNaN NaN -> -1
-dqcot881 comparetotal -sNaN sNaN -> -1
-
-dqcot882 comparetotal -sNaN -sNaN -> 0
-dqcot883 comparetotal -NaN -sNaN -> -1
-dqcot884 comparetotal -Inf -sNaN -> 1
-dqcot885 comparetotal -1000 -sNaN -> 1
-dqcot886 comparetotal -1 -sNaN -> 1
-dqcot887 comparetotal -0 -sNaN -> 1
-dqcot888 comparetotal 0 -sNaN -> 1
-dqcot889 comparetotal 1 -sNaN -> 1
-dqcot890 comparetotal 1000 -sNaN -> 1
-dqcot891 comparetotal Inf -sNaN -> 1
-dqcot892 comparetotal NaN -sNaN -> 1
-dqcot893 comparetotal sNaN -sNaN -> 1
-
--- NaNs with payload
-dqcot960 comparetotal NaN9 -Inf -> 1
-dqcot961 comparetotal NaN8 999 -> 1
-dqcot962 comparetotal NaN77 Inf -> 1
-dqcot963 comparetotal -NaN67 NaN5 -> -1
-dqcot964 comparetotal -Inf -NaN4 -> 1
-dqcot965 comparetotal -999 -NaN33 -> 1
-dqcot966 comparetotal Inf NaN2 -> -1
-
-dqcot970 comparetotal -NaN41 -NaN42 -> 1
-dqcot971 comparetotal +NaN41 -NaN42 -> 1
-dqcot972 comparetotal -NaN41 +NaN42 -> -1
-dqcot973 comparetotal +NaN41 +NaN42 -> -1
-dqcot974 comparetotal -NaN42 -NaN01 -> -1
-dqcot975 comparetotal +NaN42 -NaN01 -> 1
-dqcot976 comparetotal -NaN42 +NaN01 -> -1
-dqcot977 comparetotal +NaN42 +NaN01 -> 1
-
-dqcot980 comparetotal -sNaN771 -sNaN772 -> 1
-dqcot981 comparetotal +sNaN771 -sNaN772 -> 1
-dqcot982 comparetotal -sNaN771 +sNaN772 -> -1
-dqcot983 comparetotal +sNaN771 +sNaN772 -> -1
-dqcot984 comparetotal -sNaN772 -sNaN771 -> -1
-dqcot985 comparetotal +sNaN772 -sNaN771 -> 1
-dqcot986 comparetotal -sNaN772 +sNaN771 -> -1
-dqcot987 comparetotal +sNaN772 +sNaN771 -> 1
-
-dqcot991 comparetotal -sNaN99 -Inf -> -1
-dqcot992 comparetotal sNaN98 -11 -> 1
-dqcot993 comparetotal sNaN97 NaN -> -1
-dqcot994 comparetotal sNaN16 sNaN94 -> -1
-dqcot995 comparetotal NaN85 sNaN83 -> 1
-dqcot996 comparetotal -Inf sNaN92 -> -1
-dqcot997 comparetotal 088 sNaN81 -> -1
-dqcot998 comparetotal Inf sNaN90 -> -1
-dqcot999 comparetotal NaN -sNaN89 -> 1
-
--- spread zeros
-dqcot1110 comparetotal 0E-6143 0 -> -1
-dqcot1111 comparetotal 0E-6143 -0 -> 1
-dqcot1112 comparetotal -0E-6143 0 -> -1
-dqcot1113 comparetotal -0E-6143 -0 -> 1
-dqcot1114 comparetotal 0E-6143 0E+6144 -> -1
-dqcot1115 comparetotal 0E-6143 -0E+6144 -> 1
-dqcot1116 comparetotal -0E-6143 0E+6144 -> -1
-dqcot1117 comparetotal -0E-6143 -0E+6144 -> 1
-dqcot1118 comparetotal 0 0E+6144 -> -1
-dqcot1119 comparetotal 0 -0E+6144 -> 1
-dqcot1120 comparetotal -0 0E+6144 -> -1
-dqcot1121 comparetotal -0 -0E+6144 -> 1
-
-dqcot1130 comparetotal 0E+6144 0 -> 1
-dqcot1131 comparetotal 0E+6144 -0 -> 1
-dqcot1132 comparetotal -0E+6144 0 -> -1
-dqcot1133 comparetotal -0E+6144 -0 -> -1
-dqcot1134 comparetotal 0E+6144 0E-6143 -> 1
-dqcot1135 comparetotal 0E+6144 -0E-6143 -> 1
-dqcot1136 comparetotal -0E+6144 0E-6143 -> -1
-dqcot1137 comparetotal -0E+6144 -0E-6143 -> -1
-dqcot1138 comparetotal 0 0E-6143 -> 1
-dqcot1139 comparetotal 0 -0E-6143 -> 1
-dqcot1140 comparetotal -0 0E-6143 -> -1
-dqcot1141 comparetotal -0 -0E-6143 -> -1
-
--- Null tests
-dqcot9990 comparetotal 10 # -> NaN Invalid_operation
-dqcot9991 comparetotal # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqCompareTotal.decTest -- decQuad comparison using total ordering --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqcot001 comparetotal -2 -2 -> 0
+dqcot002 comparetotal -2 -1 -> -1
+dqcot003 comparetotal -2 0 -> -1
+dqcot004 comparetotal -2 1 -> -1
+dqcot005 comparetotal -2 2 -> -1
+dqcot006 comparetotal -1 -2 -> 1
+dqcot007 comparetotal -1 -1 -> 0
+dqcot008 comparetotal -1 0 -> -1
+dqcot009 comparetotal -1 1 -> -1
+dqcot010 comparetotal -1 2 -> -1
+dqcot011 comparetotal 0 -2 -> 1
+dqcot012 comparetotal 0 -1 -> 1
+dqcot013 comparetotal 0 0 -> 0
+dqcot014 comparetotal 0 1 -> -1
+dqcot015 comparetotal 0 2 -> -1
+dqcot016 comparetotal 1 -2 -> 1
+dqcot017 comparetotal 1 -1 -> 1
+dqcot018 comparetotal 1 0 -> 1
+dqcot019 comparetotal 1 1 -> 0
+dqcot020 comparetotal 1 2 -> -1
+dqcot021 comparetotal 2 -2 -> 1
+dqcot022 comparetotal 2 -1 -> 1
+dqcot023 comparetotal 2 0 -> 1
+dqcot025 comparetotal 2 1 -> 1
+dqcot026 comparetotal 2 2 -> 0
+
+dqcot031 comparetotal -20 -20 -> 0
+dqcot032 comparetotal -20 -10 -> -1
+dqcot033 comparetotal -20 00 -> -1
+dqcot034 comparetotal -20 10 -> -1
+dqcot035 comparetotal -20 20 -> -1
+dqcot036 comparetotal -10 -20 -> 1
+dqcot037 comparetotal -10 -10 -> 0
+dqcot038 comparetotal -10 00 -> -1
+dqcot039 comparetotal -10 10 -> -1
+dqcot040 comparetotal -10 20 -> -1
+dqcot041 comparetotal 00 -20 -> 1
+dqcot042 comparetotal 00 -10 -> 1
+dqcot043 comparetotal 00 00 -> 0
+dqcot044 comparetotal 00 10 -> -1
+dqcot045 comparetotal 00 20 -> -1
+dqcot046 comparetotal 10 -20 -> 1
+dqcot047 comparetotal 10 -10 -> 1
+dqcot048 comparetotal 10 00 -> 1
+dqcot049 comparetotal 10 10 -> 0
+dqcot050 comparetotal 10 20 -> -1
+dqcot051 comparetotal 20 -20 -> 1
+dqcot052 comparetotal 20 -10 -> 1
+dqcot053 comparetotal 20 00 -> 1
+dqcot055 comparetotal 20 10 -> 1
+dqcot056 comparetotal 20 20 -> 0
+
+dqcot061 comparetotal -2.0 -2.0 -> 0
+dqcot062 comparetotal -2.0 -1.0 -> -1
+dqcot063 comparetotal -2.0 0.0 -> -1
+dqcot064 comparetotal -2.0 1.0 -> -1
+dqcot065 comparetotal -2.0 2.0 -> -1
+dqcot066 comparetotal -1.0 -2.0 -> 1
+dqcot067 comparetotal -1.0 -1.0 -> 0
+dqcot068 comparetotal -1.0 0.0 -> -1
+dqcot069 comparetotal -1.0 1.0 -> -1
+dqcot070 comparetotal -1.0 2.0 -> -1
+dqcot071 comparetotal 0.0 -2.0 -> 1
+dqcot072 comparetotal 0.0 -1.0 -> 1
+dqcot073 comparetotal 0.0 0.0 -> 0
+dqcot074 comparetotal 0.0 1.0 -> -1
+dqcot075 comparetotal 0.0 2.0 -> -1
+dqcot076 comparetotal 1.0 -2.0 -> 1
+dqcot077 comparetotal 1.0 -1.0 -> 1
+dqcot078 comparetotal 1.0 0.0 -> 1
+dqcot079 comparetotal 1.0 1.0 -> 0
+dqcot080 comparetotal 1.0 2.0 -> -1
+dqcot081 comparetotal 2.0 -2.0 -> 1
+dqcot082 comparetotal 2.0 -1.0 -> 1
+dqcot083 comparetotal 2.0 0.0 -> 1
+dqcot085 comparetotal 2.0 1.0 -> 1
+dqcot086 comparetotal 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+dqcot090 comparetotal 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
+dqcot091 comparetotal -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> -1
+dqcot092 comparetotal 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 1
+dqcot093 comparetotal -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+dqcot100 comparetotal 7.0 7.0 -> 0
+dqcot101 comparetotal 7.0 7 -> -1
+dqcot102 comparetotal 7 7.0 -> 1
+dqcot103 comparetotal 7E+0 7.0 -> 1
+dqcot104 comparetotal 70E-1 7.0 -> 0
+dqcot105 comparetotal 0.7E+1 7 -> 0
+dqcot106 comparetotal 70E-1 7 -> -1
+dqcot107 comparetotal 7.0 7E+0 -> -1
+dqcot108 comparetotal 7.0 70E-1 -> 0
+dqcot109 comparetotal 7 0.7E+1 -> 0
+dqcot110 comparetotal 7 70E-1 -> 1
+
+dqcot120 comparetotal 8.0 7.0 -> 1
+dqcot121 comparetotal 8.0 7 -> 1
+dqcot122 comparetotal 8 7.0 -> 1
+dqcot123 comparetotal 8E+0 7.0 -> 1
+dqcot124 comparetotal 80E-1 7.0 -> 1
+dqcot125 comparetotal 0.8E+1 7 -> 1
+dqcot126 comparetotal 80E-1 7 -> 1
+dqcot127 comparetotal 8.0 7E+0 -> 1
+dqcot128 comparetotal 8.0 70E-1 -> 1
+dqcot129 comparetotal 8 0.7E+1 -> 1
+dqcot130 comparetotal 8 70E-1 -> 1
+
+dqcot140 comparetotal 8.0 9.0 -> -1
+dqcot141 comparetotal 8.0 9 -> -1
+dqcot142 comparetotal 8 9.0 -> -1
+dqcot143 comparetotal 8E+0 9.0 -> -1
+dqcot144 comparetotal 80E-1 9.0 -> -1
+dqcot145 comparetotal 0.8E+1 9 -> -1
+dqcot146 comparetotal 80E-1 9 -> -1
+dqcot147 comparetotal 8.0 9E+0 -> -1
+dqcot148 comparetotal 8.0 90E-1 -> -1
+dqcot149 comparetotal 8 0.9E+1 -> -1
+dqcot150 comparetotal 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+dqcot200 comparetotal -7.0 7.0 -> -1
+dqcot201 comparetotal -7.0 7 -> -1
+dqcot202 comparetotal -7 7.0 -> -1
+dqcot203 comparetotal -7E+0 7.0 -> -1
+dqcot204 comparetotal -70E-1 7.0 -> -1
+dqcot205 comparetotal -0.7E+1 7 -> -1
+dqcot206 comparetotal -70E-1 7 -> -1
+dqcot207 comparetotal -7.0 7E+0 -> -1
+dqcot208 comparetotal -7.0 70E-1 -> -1
+dqcot209 comparetotal -7 0.7E+1 -> -1
+dqcot210 comparetotal -7 70E-1 -> -1
+
+dqcot220 comparetotal -8.0 7.0 -> -1
+dqcot221 comparetotal -8.0 7 -> -1
+dqcot222 comparetotal -8 7.0 -> -1
+dqcot223 comparetotal -8E+0 7.0 -> -1
+dqcot224 comparetotal -80E-1 7.0 -> -1
+dqcot225 comparetotal -0.8E+1 7 -> -1
+dqcot226 comparetotal -80E-1 7 -> -1
+dqcot227 comparetotal -8.0 7E+0 -> -1
+dqcot228 comparetotal -8.0 70E-1 -> -1
+dqcot229 comparetotal -8 0.7E+1 -> -1
+dqcot230 comparetotal -8 70E-1 -> -1
+
+dqcot240 comparetotal -8.0 9.0 -> -1
+dqcot241 comparetotal -8.0 9 -> -1
+dqcot242 comparetotal -8 9.0 -> -1
+dqcot243 comparetotal -8E+0 9.0 -> -1
+dqcot244 comparetotal -80E-1 9.0 -> -1
+dqcot245 comparetotal -0.8E+1 9 -> -1
+dqcot246 comparetotal -80E-1 9 -> -1
+dqcot247 comparetotal -8.0 9E+0 -> -1
+dqcot248 comparetotal -8.0 90E-1 -> -1
+dqcot249 comparetotal -8 0.9E+1 -> -1
+dqcot250 comparetotal -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+dqcot300 comparetotal 7.0 -7.0 -> 1
+dqcot301 comparetotal 7.0 -7 -> 1
+dqcot302 comparetotal 7 -7.0 -> 1
+dqcot303 comparetotal 7E+0 -7.0 -> 1
+dqcot304 comparetotal 70E-1 -7.0 -> 1
+dqcot305 comparetotal .7E+1 -7 -> 1
+dqcot306 comparetotal 70E-1 -7 -> 1
+dqcot307 comparetotal 7.0 -7E+0 -> 1
+dqcot308 comparetotal 7.0 -70E-1 -> 1
+dqcot309 comparetotal 7 -.7E+1 -> 1
+dqcot310 comparetotal 7 -70E-1 -> 1
+
+dqcot320 comparetotal 8.0 -7.0 -> 1
+dqcot321 comparetotal 8.0 -7 -> 1
+dqcot322 comparetotal 8 -7.0 -> 1
+dqcot323 comparetotal 8E+0 -7.0 -> 1
+dqcot324 comparetotal 80E-1 -7.0 -> 1
+dqcot325 comparetotal .8E+1 -7 -> 1
+dqcot326 comparetotal 80E-1 -7 -> 1
+dqcot327 comparetotal 8.0 -7E+0 -> 1
+dqcot328 comparetotal 8.0 -70E-1 -> 1
+dqcot329 comparetotal 8 -.7E+1 -> 1
+dqcot330 comparetotal 8 -70E-1 -> 1
+
+dqcot340 comparetotal 8.0 -9.0 -> 1
+dqcot341 comparetotal 8.0 -9 -> 1
+dqcot342 comparetotal 8 -9.0 -> 1
+dqcot343 comparetotal 8E+0 -9.0 -> 1
+dqcot344 comparetotal 80E-1 -9.0 -> 1
+dqcot345 comparetotal .8E+1 -9 -> 1
+dqcot346 comparetotal 80E-1 -9 -> 1
+dqcot347 comparetotal 8.0 -9E+0 -> 1
+dqcot348 comparetotal 8.0 -90E-1 -> 1
+dqcot349 comparetotal 8 -.9E+1 -> 1
+dqcot350 comparetotal 8 -90E-1 -> 1
+
+-- and again, with sign changes -- ..
+dqcot400 comparetotal -7.0 -7.0 -> 0
+dqcot401 comparetotal -7.0 -7 -> 1
+dqcot402 comparetotal -7 -7.0 -> -1
+dqcot403 comparetotal -7E+0 -7.0 -> -1
+dqcot404 comparetotal -70E-1 -7.0 -> 0
+dqcot405 comparetotal -.7E+1 -7 -> 0
+dqcot406 comparetotal -70E-1 -7 -> 1
+dqcot407 comparetotal -7.0 -7E+0 -> 1
+dqcot408 comparetotal -7.0 -70E-1 -> 0
+dqcot409 comparetotal -7 -.7E+1 -> 0
+dqcot410 comparetotal -7 -70E-1 -> -1
+
+dqcot420 comparetotal -8.0 -7.0 -> -1
+dqcot421 comparetotal -8.0 -7 -> -1
+dqcot422 comparetotal -8 -7.0 -> -1
+dqcot423 comparetotal -8E+0 -7.0 -> -1
+dqcot424 comparetotal -80E-1 -7.0 -> -1
+dqcot425 comparetotal -.8E+1 -7 -> -1
+dqcot426 comparetotal -80E-1 -7 -> -1
+dqcot427 comparetotal -8.0 -7E+0 -> -1
+dqcot428 comparetotal -8.0 -70E-1 -> -1
+dqcot429 comparetotal -8 -.7E+1 -> -1
+dqcot430 comparetotal -8 -70E-1 -> -1
+
+dqcot440 comparetotal -8.0 -9.0 -> 1
+dqcot441 comparetotal -8.0 -9 -> 1
+dqcot442 comparetotal -8 -9.0 -> 1
+dqcot443 comparetotal -8E+0 -9.0 -> 1
+dqcot444 comparetotal -80E-1 -9.0 -> 1
+dqcot445 comparetotal -.8E+1 -9 -> 1
+dqcot446 comparetotal -80E-1 -9 -> 1
+dqcot447 comparetotal -8.0 -9E+0 -> 1
+dqcot448 comparetotal -8.0 -90E-1 -> 1
+dqcot449 comparetotal -8 -.9E+1 -> 1
+dqcot450 comparetotal -8 -90E-1 -> 1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+dqcot473 comparetotal 123.4560000000000E-89 123.456E-89 -> -1
+dqcot474 comparetotal 123.456000000000E+89 123.456E+89 -> -1
+dqcot475 comparetotal 123.45600000000E-89 123.456E-89 -> -1
+dqcot476 comparetotal 123.4560000000E+89 123.456E+89 -> -1
+dqcot477 comparetotal 123.456000000E-89 123.456E-89 -> -1
+dqcot478 comparetotal 123.45600000E+89 123.456E+89 -> -1
+dqcot479 comparetotal 123.4560000E-89 123.456E-89 -> -1
+dqcot480 comparetotal 123.456000E+89 123.456E+89 -> -1
+dqcot481 comparetotal 123.45600E-89 123.456E-89 -> -1
+dqcot482 comparetotal 123.4560E+89 123.456E+89 -> -1
+dqcot483 comparetotal 123.456E-89 123.456E-89 -> 0
+dqcot487 comparetotal 123.456E+89 123.4560000000000E+89 -> 1
+dqcot488 comparetotal 123.456E-89 123.456000000000E-89 -> 1
+dqcot489 comparetotal 123.456E+89 123.45600000000E+89 -> 1
+dqcot490 comparetotal 123.456E-89 123.4560000000E-89 -> 1
+dqcot491 comparetotal 123.456E+89 123.456000000E+89 -> 1
+dqcot492 comparetotal 123.456E-89 123.45600000E-89 -> 1
+dqcot493 comparetotal 123.456E+89 123.4560000E+89 -> 1
+dqcot494 comparetotal 123.456E-89 123.456000E-89 -> 1
+dqcot495 comparetotal 123.456E+89 123.45600E+89 -> 1
+dqcot496 comparetotal 123.456E-89 123.4560E-89 -> 1
+dqcot497 comparetotal 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+dqcot498 comparetotal 1 1E-17 -> 1
+dqcot499 comparetotal 1 1E-16 -> 1
+dqcot500 comparetotal 1 1E-15 -> 1
+dqcot501 comparetotal 1 1E-14 -> 1
+dqcot502 comparetotal 1 1E-13 -> 1
+dqcot503 comparetotal 1 1E-12 -> 1
+dqcot504 comparetotal 1 1E-11 -> 1
+dqcot505 comparetotal 1 1E-10 -> 1
+dqcot506 comparetotal 1 1E-9 -> 1
+dqcot507 comparetotal 1 1E-8 -> 1
+dqcot508 comparetotal 1 1E-7 -> 1
+dqcot509 comparetotal 1 1E-6 -> 1
+dqcot510 comparetotal 1 1E-5 -> 1
+dqcot511 comparetotal 1 1E-4 -> 1
+dqcot512 comparetotal 1 1E-3 -> 1
+dqcot513 comparetotal 1 1E-2 -> 1
+dqcot514 comparetotal 1 1E-1 -> 1
+dqcot515 comparetotal 1 1E-0 -> 0
+dqcot516 comparetotal 1 1E+1 -> -1
+dqcot517 comparetotal 1 1E+2 -> -1
+dqcot518 comparetotal 1 1E+3 -> -1
+dqcot519 comparetotal 1 1E+4 -> -1
+dqcot521 comparetotal 1 1E+5 -> -1
+dqcot522 comparetotal 1 1E+6 -> -1
+dqcot523 comparetotal 1 1E+7 -> -1
+dqcot524 comparetotal 1 1E+8 -> -1
+dqcot525 comparetotal 1 1E+9 -> -1
+dqcot526 comparetotal 1 1E+10 -> -1
+dqcot527 comparetotal 1 1E+11 -> -1
+dqcot528 comparetotal 1 1E+12 -> -1
+dqcot529 comparetotal 1 1E+13 -> -1
+dqcot530 comparetotal 1 1E+14 -> -1
+dqcot531 comparetotal 1 1E+15 -> -1
+dqcot532 comparetotal 1 1E+16 -> -1
+dqcot533 comparetotal 1 1E+17 -> -1
+-- LR swap
+dqcot538 comparetotal 1E-17 1 -> -1
+dqcot539 comparetotal 1E-16 1 -> -1
+dqcot540 comparetotal 1E-15 1 -> -1
+dqcot541 comparetotal 1E-14 1 -> -1
+dqcot542 comparetotal 1E-13 1 -> -1
+dqcot543 comparetotal 1E-12 1 -> -1
+dqcot544 comparetotal 1E-11 1 -> -1
+dqcot545 comparetotal 1E-10 1 -> -1
+dqcot546 comparetotal 1E-9 1 -> -1
+dqcot547 comparetotal 1E-8 1 -> -1
+dqcot548 comparetotal 1E-7 1 -> -1
+dqcot549 comparetotal 1E-6 1 -> -1
+dqcot550 comparetotal 1E-5 1 -> -1
+dqcot551 comparetotal 1E-4 1 -> -1
+dqcot552 comparetotal 1E-3 1 -> -1
+dqcot553 comparetotal 1E-2 1 -> -1
+dqcot554 comparetotal 1E-1 1 -> -1
+dqcot555 comparetotal 1E-0 1 -> 0
+dqcot556 comparetotal 1E+1 1 -> 1
+dqcot557 comparetotal 1E+2 1 -> 1
+dqcot558 comparetotal 1E+3 1 -> 1
+dqcot559 comparetotal 1E+4 1 -> 1
+dqcot561 comparetotal 1E+5 1 -> 1
+dqcot562 comparetotal 1E+6 1 -> 1
+dqcot563 comparetotal 1E+7 1 -> 1
+dqcot564 comparetotal 1E+8 1 -> 1
+dqcot565 comparetotal 1E+9 1 -> 1
+dqcot566 comparetotal 1E+10 1 -> 1
+dqcot567 comparetotal 1E+11 1 -> 1
+dqcot568 comparetotal 1E+12 1 -> 1
+dqcot569 comparetotal 1E+13 1 -> 1
+dqcot570 comparetotal 1E+14 1 -> 1
+dqcot571 comparetotal 1E+15 1 -> 1
+dqcot572 comparetotal 1E+16 1 -> 1
+dqcot573 comparetotal 1E+17 1 -> 1
+-- similar with a useful coefficient, one side only
+dqcot578 comparetotal 0.000000987654321 1E-17 -> 1
+dqcot579 comparetotal 0.000000987654321 1E-16 -> 1
+dqcot580 comparetotal 0.000000987654321 1E-15 -> 1
+dqcot581 comparetotal 0.000000987654321 1E-14 -> 1
+dqcot582 comparetotal 0.000000987654321 1E-13 -> 1
+dqcot583 comparetotal 0.000000987654321 1E-12 -> 1
+dqcot584 comparetotal 0.000000987654321 1E-11 -> 1
+dqcot585 comparetotal 0.000000987654321 1E-10 -> 1
+dqcot586 comparetotal 0.000000987654321 1E-9 -> 1
+dqcot587 comparetotal 0.000000987654321 1E-8 -> 1
+dqcot588 comparetotal 0.000000987654321 1E-7 -> 1
+dqcot589 comparetotal 0.000000987654321 1E-6 -> -1
+dqcot590 comparetotal 0.000000987654321 1E-5 -> -1
+dqcot591 comparetotal 0.000000987654321 1E-4 -> -1
+dqcot592 comparetotal 0.000000987654321 1E-3 -> -1
+dqcot593 comparetotal 0.000000987654321 1E-2 -> -1
+dqcot594 comparetotal 0.000000987654321 1E-1 -> -1
+dqcot595 comparetotal 0.000000987654321 1E-0 -> -1
+dqcot596 comparetotal 0.000000987654321 1E+1 -> -1
+dqcot597 comparetotal 0.000000987654321 1E+2 -> -1
+dqcot598 comparetotal 0.000000987654321 1E+3 -> -1
+dqcot599 comparetotal 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+dqcot600 comparetotal 12 12.2345 -> -1
+dqcot601 comparetotal 12.0 12.2345 -> -1
+dqcot602 comparetotal 12.00 12.2345 -> -1
+dqcot603 comparetotal 12.000 12.2345 -> -1
+dqcot604 comparetotal 12.0000 12.2345 -> -1
+dqcot605 comparetotal 12.00000 12.2345 -> -1
+dqcot606 comparetotal 12.000000 12.2345 -> -1
+dqcot607 comparetotal 12.0000000 12.2345 -> -1
+dqcot608 comparetotal 12.00000000 12.2345 -> -1
+dqcot609 comparetotal 12.000000000 12.2345 -> -1
+dqcot610 comparetotal 12.1234 12 -> 1
+dqcot611 comparetotal 12.1234 12.0 -> 1
+dqcot612 comparetotal 12.1234 12.00 -> 1
+dqcot613 comparetotal 12.1234 12.000 -> 1
+dqcot614 comparetotal 12.1234 12.0000 -> 1
+dqcot615 comparetotal 12.1234 12.00000 -> 1
+dqcot616 comparetotal 12.1234 12.000000 -> 1
+dqcot617 comparetotal 12.1234 12.0000000 -> 1
+dqcot618 comparetotal 12.1234 12.00000000 -> 1
+dqcot619 comparetotal 12.1234 12.000000000 -> 1
+dqcot620 comparetotal -12 -12.2345 -> 1
+dqcot621 comparetotal -12.0 -12.2345 -> 1
+dqcot622 comparetotal -12.00 -12.2345 -> 1
+dqcot623 comparetotal -12.000 -12.2345 -> 1
+dqcot624 comparetotal -12.0000 -12.2345 -> 1
+dqcot625 comparetotal -12.00000 -12.2345 -> 1
+dqcot626 comparetotal -12.000000 -12.2345 -> 1
+dqcot627 comparetotal -12.0000000 -12.2345 -> 1
+dqcot628 comparetotal -12.00000000 -12.2345 -> 1
+dqcot629 comparetotal -12.000000000 -12.2345 -> 1
+dqcot630 comparetotal -12.1234 -12 -> -1
+dqcot631 comparetotal -12.1234 -12.0 -> -1
+dqcot632 comparetotal -12.1234 -12.00 -> -1
+dqcot633 comparetotal -12.1234 -12.000 -> -1
+dqcot634 comparetotal -12.1234 -12.0000 -> -1
+dqcot635 comparetotal -12.1234 -12.00000 -> -1
+dqcot636 comparetotal -12.1234 -12.000000 -> -1
+dqcot637 comparetotal -12.1234 -12.0000000 -> -1
+dqcot638 comparetotal -12.1234 -12.00000000 -> -1
+dqcot639 comparetotal -12.1234 -12.000000000 -> -1
+
+-- extended zeros
+dqcot640 comparetotal 0 0 -> 0
+dqcot641 comparetotal 0 -0 -> 1
+dqcot642 comparetotal 0 -0.0 -> 1
+dqcot643 comparetotal 0 0.0 -> 1
+dqcot644 comparetotal -0 0 -> -1
+dqcot645 comparetotal -0 -0 -> 0
+dqcot646 comparetotal -0 -0.0 -> -1
+dqcot647 comparetotal -0 0.0 -> -1
+dqcot648 comparetotal 0.0 0 -> -1
+dqcot649 comparetotal 0.0 -0 -> 1
+dqcot650 comparetotal 0.0 -0.0 -> 1
+dqcot651 comparetotal 0.0 0.0 -> 0
+dqcot652 comparetotal -0.0 0 -> -1
+dqcot653 comparetotal -0.0 -0 -> 1
+dqcot654 comparetotal -0.0 -0.0 -> 0
+dqcot655 comparetotal -0.0 0.0 -> -1
+
+dqcot656 comparetotal -0E1 0.0 -> -1
+dqcot657 comparetotal -0E2 0.0 -> -1
+dqcot658 comparetotal 0E1 0.0 -> 1
+dqcot659 comparetotal 0E2 0.0 -> 1
+dqcot660 comparetotal -0E1 0 -> -1
+dqcot661 comparetotal -0E2 0 -> -1
+dqcot662 comparetotal 0E1 0 -> 1
+dqcot663 comparetotal 0E2 0 -> 1
+dqcot664 comparetotal -0E1 -0E1 -> 0
+dqcot665 comparetotal -0E2 -0E1 -> -1
+dqcot666 comparetotal 0E1 -0E1 -> 1
+dqcot667 comparetotal 0E2 -0E1 -> 1
+dqcot668 comparetotal -0E1 -0E2 -> 1
+dqcot669 comparetotal -0E2 -0E2 -> 0
+dqcot670 comparetotal 0E1 -0E2 -> 1
+dqcot671 comparetotal 0E2 -0E2 -> 1
+dqcot672 comparetotal -0E1 0E1 -> -1
+dqcot673 comparetotal -0E2 0E1 -> -1
+dqcot674 comparetotal 0E1 0E1 -> 0
+dqcot675 comparetotal 0E2 0E1 -> 1
+dqcot676 comparetotal -0E1 0E2 -> -1
+dqcot677 comparetotal -0E2 0E2 -> -1
+dqcot678 comparetotal 0E1 0E2 -> -1
+dqcot679 comparetotal 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+dqcot680 comparetotal 12 12 -> 0
+dqcot681 comparetotal 12 12.0 -> 1
+dqcot682 comparetotal 12 12.00 -> 1
+dqcot683 comparetotal 12 12.000 -> 1
+dqcot684 comparetotal 12 12.0000 -> 1
+dqcot685 comparetotal 12 12.00000 -> 1
+dqcot686 comparetotal 12 12.000000 -> 1
+dqcot687 comparetotal 12 12.0000000 -> 1
+dqcot688 comparetotal 12 12.00000000 -> 1
+dqcot689 comparetotal 12 12.000000000 -> 1
+dqcot690 comparetotal 12 12 -> 0
+dqcot691 comparetotal 12.0 12 -> -1
+dqcot692 comparetotal 12.00 12 -> -1
+dqcot693 comparetotal 12.000 12 -> -1
+dqcot694 comparetotal 12.0000 12 -> -1
+dqcot695 comparetotal 12.00000 12 -> -1
+dqcot696 comparetotal 12.000000 12 -> -1
+dqcot697 comparetotal 12.0000000 12 -> -1
+dqcot698 comparetotal 12.00000000 12 -> -1
+dqcot699 comparetotal 12.000000000 12 -> -1
+
+-- old long operand checks
+dqcot701 comparetotal 12345678000 1 -> 1
+dqcot702 comparetotal 1 12345678000 -> -1
+dqcot703 comparetotal 1234567800 1 -> 1
+dqcot704 comparetotal 1 1234567800 -> -1
+dqcot705 comparetotal 1234567890 1 -> 1
+dqcot706 comparetotal 1 1234567890 -> -1
+dqcot707 comparetotal 1234567891 1 -> 1
+dqcot708 comparetotal 1 1234567891 -> -1
+dqcot709 comparetotal 12345678901 1 -> 1
+dqcot710 comparetotal 1 12345678901 -> -1
+dqcot711 comparetotal 1234567896 1 -> 1
+dqcot712 comparetotal 1 1234567896 -> -1
+dqcot713 comparetotal -1234567891 1 -> -1
+dqcot714 comparetotal 1 -1234567891 -> 1
+dqcot715 comparetotal -12345678901 1 -> -1
+dqcot716 comparetotal 1 -12345678901 -> 1
+dqcot717 comparetotal -1234567896 1 -> -1
+dqcot718 comparetotal 1 -1234567896 -> 1
+
+-- old residue cases
+dqcot740 comparetotal 1 0.9999999 -> 1
+dqcot741 comparetotal 1 0.999999 -> 1
+dqcot742 comparetotal 1 0.99999 -> 1
+dqcot743 comparetotal 1 1.0000 -> 1
+dqcot744 comparetotal 1 1.00001 -> -1
+dqcot745 comparetotal 1 1.000001 -> -1
+dqcot746 comparetotal 1 1.0000001 -> -1
+dqcot750 comparetotal 0.9999999 1 -> -1
+dqcot751 comparetotal 0.999999 1 -> -1
+dqcot752 comparetotal 0.99999 1 -> -1
+dqcot753 comparetotal 1.0000 1 -> -1
+dqcot754 comparetotal 1.00001 1 -> 1
+dqcot755 comparetotal 1.000001 1 -> 1
+dqcot756 comparetotal 1.0000001 1 -> 1
+
+-- Specials
+dqcot780 comparetotal Inf -Inf -> 1
+dqcot781 comparetotal Inf -1000 -> 1
+dqcot782 comparetotal Inf -1 -> 1
+dqcot783 comparetotal Inf -0 -> 1
+dqcot784 comparetotal Inf 0 -> 1
+dqcot785 comparetotal Inf 1 -> 1
+dqcot786 comparetotal Inf 1000 -> 1
+dqcot787 comparetotal Inf Inf -> 0
+dqcot788 comparetotal -1000 Inf -> -1
+dqcot789 comparetotal -Inf Inf -> -1
+dqcot790 comparetotal -1 Inf -> -1
+dqcot791 comparetotal -0 Inf -> -1
+dqcot792 comparetotal 0 Inf -> -1
+dqcot793 comparetotal 1 Inf -> -1
+dqcot794 comparetotal 1000 Inf -> -1
+dqcot795 comparetotal Inf Inf -> 0
+
+dqcot800 comparetotal -Inf -Inf -> 0
+dqcot801 comparetotal -Inf -1000 -> -1
+dqcot802 comparetotal -Inf -1 -> -1
+dqcot803 comparetotal -Inf -0 -> -1
+dqcot804 comparetotal -Inf 0 -> -1
+dqcot805 comparetotal -Inf 1 -> -1
+dqcot806 comparetotal -Inf 1000 -> -1
+dqcot807 comparetotal -Inf Inf -> -1
+dqcot808 comparetotal -Inf -Inf -> 0
+dqcot809 comparetotal -1000 -Inf -> 1
+dqcot810 comparetotal -1 -Inf -> 1
+dqcot811 comparetotal -0 -Inf -> 1
+dqcot812 comparetotal 0 -Inf -> 1
+dqcot813 comparetotal 1 -Inf -> 1
+dqcot814 comparetotal 1000 -Inf -> 1
+dqcot815 comparetotal Inf -Inf -> 1
+
+dqcot821 comparetotal NaN -Inf -> 1
+dqcot822 comparetotal NaN -1000 -> 1
+dqcot823 comparetotal NaN -1 -> 1
+dqcot824 comparetotal NaN -0 -> 1
+dqcot825 comparetotal NaN 0 -> 1
+dqcot826 comparetotal NaN 1 -> 1
+dqcot827 comparetotal NaN 1000 -> 1
+dqcot828 comparetotal NaN Inf -> 1
+dqcot829 comparetotal NaN NaN -> 0
+dqcot830 comparetotal -Inf NaN -> -1
+dqcot831 comparetotal -1000 NaN -> -1
+dqcot832 comparetotal -1 NaN -> -1
+dqcot833 comparetotal -0 NaN -> -1
+dqcot834 comparetotal 0 NaN -> -1
+dqcot835 comparetotal 1 NaN -> -1
+dqcot836 comparetotal 1000 NaN -> -1
+dqcot837 comparetotal Inf NaN -> -1
+dqcot838 comparetotal -NaN -NaN -> 0
+dqcot839 comparetotal +NaN -NaN -> 1
+dqcot840 comparetotal -NaN +NaN -> -1
+
+dqcot841 comparetotal sNaN -sNaN -> 1
+dqcot842 comparetotal sNaN -NaN -> 1
+dqcot843 comparetotal sNaN -Inf -> 1
+dqcot844 comparetotal sNaN -1000 -> 1
+dqcot845 comparetotal sNaN -1 -> 1
+dqcot846 comparetotal sNaN -0 -> 1
+dqcot847 comparetotal sNaN 0 -> 1
+dqcot848 comparetotal sNaN 1 -> 1
+dqcot849 comparetotal sNaN 1000 -> 1
+dqcot850 comparetotal sNaN NaN -> -1
+dqcot851 comparetotal sNaN sNaN -> 0
+
+dqcot852 comparetotal -sNaN sNaN -> -1
+dqcot853 comparetotal -NaN sNaN -> -1
+dqcot854 comparetotal -Inf sNaN -> -1
+dqcot855 comparetotal -1000 sNaN -> -1
+dqcot856 comparetotal -1 sNaN -> -1
+dqcot857 comparetotal -0 sNaN -> -1
+dqcot858 comparetotal 0 sNaN -> -1
+dqcot859 comparetotal 1 sNaN -> -1
+dqcot860 comparetotal 1000 sNaN -> -1
+dqcot861 comparetotal Inf sNaN -> -1
+dqcot862 comparetotal NaN sNaN -> 1
+dqcot863 comparetotal sNaN sNaN -> 0
+
+dqcot871 comparetotal -sNaN -sNaN -> 0
+dqcot872 comparetotal -sNaN -NaN -> 1
+dqcot873 comparetotal -sNaN -Inf -> -1
+dqcot874 comparetotal -sNaN -1000 -> -1
+dqcot875 comparetotal -sNaN -1 -> -1
+dqcot876 comparetotal -sNaN -0 -> -1
+dqcot877 comparetotal -sNaN 0 -> -1
+dqcot878 comparetotal -sNaN 1 -> -1
+dqcot879 comparetotal -sNaN 1000 -> -1
+dqcot880 comparetotal -sNaN NaN -> -1
+dqcot881 comparetotal -sNaN sNaN -> -1
+
+dqcot882 comparetotal -sNaN -sNaN -> 0
+dqcot883 comparetotal -NaN -sNaN -> -1
+dqcot884 comparetotal -Inf -sNaN -> 1
+dqcot885 comparetotal -1000 -sNaN -> 1
+dqcot886 comparetotal -1 -sNaN -> 1
+dqcot887 comparetotal -0 -sNaN -> 1
+dqcot888 comparetotal 0 -sNaN -> 1
+dqcot889 comparetotal 1 -sNaN -> 1
+dqcot890 comparetotal 1000 -sNaN -> 1
+dqcot891 comparetotal Inf -sNaN -> 1
+dqcot892 comparetotal NaN -sNaN -> 1
+dqcot893 comparetotal sNaN -sNaN -> 1
+
+-- NaNs with payload
+dqcot960 comparetotal NaN9 -Inf -> 1
+dqcot961 comparetotal NaN8 999 -> 1
+dqcot962 comparetotal NaN77 Inf -> 1
+dqcot963 comparetotal -NaN67 NaN5 -> -1
+dqcot964 comparetotal -Inf -NaN4 -> 1
+dqcot965 comparetotal -999 -NaN33 -> 1
+dqcot966 comparetotal Inf NaN2 -> -1
+
+dqcot970 comparetotal -NaN41 -NaN42 -> 1
+dqcot971 comparetotal +NaN41 -NaN42 -> 1
+dqcot972 comparetotal -NaN41 +NaN42 -> -1
+dqcot973 comparetotal +NaN41 +NaN42 -> -1
+dqcot974 comparetotal -NaN42 -NaN01 -> -1
+dqcot975 comparetotal +NaN42 -NaN01 -> 1
+dqcot976 comparetotal -NaN42 +NaN01 -> -1
+dqcot977 comparetotal +NaN42 +NaN01 -> 1
+
+dqcot980 comparetotal -sNaN771 -sNaN772 -> 1
+dqcot981 comparetotal +sNaN771 -sNaN772 -> 1
+dqcot982 comparetotal -sNaN771 +sNaN772 -> -1
+dqcot983 comparetotal +sNaN771 +sNaN772 -> -1
+dqcot984 comparetotal -sNaN772 -sNaN771 -> -1
+dqcot985 comparetotal +sNaN772 -sNaN771 -> 1
+dqcot986 comparetotal -sNaN772 +sNaN771 -> -1
+dqcot987 comparetotal +sNaN772 +sNaN771 -> 1
+
+dqcot991 comparetotal -sNaN99 -Inf -> -1
+dqcot992 comparetotal sNaN98 -11 -> 1
+dqcot993 comparetotal sNaN97 NaN -> -1
+dqcot994 comparetotal sNaN16 sNaN94 -> -1
+dqcot995 comparetotal NaN85 sNaN83 -> 1
+dqcot996 comparetotal -Inf sNaN92 -> -1
+dqcot997 comparetotal 088 sNaN81 -> -1
+dqcot998 comparetotal Inf sNaN90 -> -1
+dqcot999 comparetotal NaN -sNaN89 -> 1
+
+-- spread zeros
+dqcot1110 comparetotal 0E-6143 0 -> -1
+dqcot1111 comparetotal 0E-6143 -0 -> 1
+dqcot1112 comparetotal -0E-6143 0 -> -1
+dqcot1113 comparetotal -0E-6143 -0 -> 1
+dqcot1114 comparetotal 0E-6143 0E+6144 -> -1
+dqcot1115 comparetotal 0E-6143 -0E+6144 -> 1
+dqcot1116 comparetotal -0E-6143 0E+6144 -> -1
+dqcot1117 comparetotal -0E-6143 -0E+6144 -> 1
+dqcot1118 comparetotal 0 0E+6144 -> -1
+dqcot1119 comparetotal 0 -0E+6144 -> 1
+dqcot1120 comparetotal -0 0E+6144 -> -1
+dqcot1121 comparetotal -0 -0E+6144 -> 1
+
+dqcot1130 comparetotal 0E+6144 0 -> 1
+dqcot1131 comparetotal 0E+6144 -0 -> 1
+dqcot1132 comparetotal -0E+6144 0 -> -1
+dqcot1133 comparetotal -0E+6144 -0 -> -1
+dqcot1134 comparetotal 0E+6144 0E-6143 -> 1
+dqcot1135 comparetotal 0E+6144 -0E-6143 -> 1
+dqcot1136 comparetotal -0E+6144 0E-6143 -> -1
+dqcot1137 comparetotal -0E+6144 -0E-6143 -> -1
+dqcot1138 comparetotal 0 0E-6143 -> 1
+dqcot1139 comparetotal 0 -0E-6143 -> 1
+dqcot1140 comparetotal -0 0E-6143 -> -1
+dqcot1141 comparetotal -0 -0E-6143 -> -1
+
+-- Null tests
+dqcot9990 comparetotal 10 # -> NaN Invalid_operation
+dqcot9991 comparetotal # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqCompareTotalMag.decTest b/Lib/test/decimaltestdata/dqCompareTotalMag.decTest
index 48b3e086b1..0b81bfbc24 100644
--- a/Lib/test/decimaltestdata/dqCompareTotalMag.decTest
+++ b/Lib/test/decimaltestdata/dqCompareTotalMag.decTest
@@ -1,706 +1,706 @@
-------------------------------------------------------------------------
--- dqCompareTotalMag.decTest -- decQuad comparison; abs. total order --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Note that we cannot assume add/subtract tests cover paths adequately,
--- here, because the code might be quite different (comparison cannot
--- overflow or underflow, so actual subtractions are not necessary).
--- Similarly, comparetotal will have some radically different paths
--- than compare.
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqctm001 comparetotmag -2 -2 -> 0
-dqctm002 comparetotmag -2 -1 -> 1
-dqctm003 comparetotmag -2 0 -> 1
-dqctm004 comparetotmag -2 1 -> 1
-dqctm005 comparetotmag -2 2 -> 0
-dqctm006 comparetotmag -1 -2 -> -1
-dqctm007 comparetotmag -1 -1 -> 0
-dqctm008 comparetotmag -1 0 -> 1
-dqctm009 comparetotmag -1 1 -> 0
-dqctm010 comparetotmag -1 2 -> -1
-dqctm011 comparetotmag 0 -2 -> -1
-dqctm012 comparetotmag 0 -1 -> -1
-dqctm013 comparetotmag 0 0 -> 0
-dqctm014 comparetotmag 0 1 -> -1
-dqctm015 comparetotmag 0 2 -> -1
-dqctm016 comparetotmag 1 -2 -> -1
-dqctm017 comparetotmag 1 -1 -> 0
-dqctm018 comparetotmag 1 0 -> 1
-dqctm019 comparetotmag 1 1 -> 0
-dqctm020 comparetotmag 1 2 -> -1
-dqctm021 comparetotmag 2 -2 -> 0
-dqctm022 comparetotmag 2 -1 -> 1
-dqctm023 comparetotmag 2 0 -> 1
-dqctm025 comparetotmag 2 1 -> 1
-dqctm026 comparetotmag 2 2 -> 0
-
-dqctm031 comparetotmag -20 -20 -> 0
-dqctm032 comparetotmag -20 -10 -> 1
-dqctm033 comparetotmag -20 00 -> 1
-dqctm034 comparetotmag -20 10 -> 1
-dqctm035 comparetotmag -20 20 -> 0
-dqctm036 comparetotmag -10 -20 -> -1
-dqctm037 comparetotmag -10 -10 -> 0
-dqctm038 comparetotmag -10 00 -> 1
-dqctm039 comparetotmag -10 10 -> 0
-dqctm040 comparetotmag -10 20 -> -1
-dqctm041 comparetotmag 00 -20 -> -1
-dqctm042 comparetotmag 00 -10 -> -1
-dqctm043 comparetotmag 00 00 -> 0
-dqctm044 comparetotmag 00 10 -> -1
-dqctm045 comparetotmag 00 20 -> -1
-dqctm046 comparetotmag 10 -20 -> -1
-dqctm047 comparetotmag 10 -10 -> 0
-dqctm048 comparetotmag 10 00 -> 1
-dqctm049 comparetotmag 10 10 -> 0
-dqctm050 comparetotmag 10 20 -> -1
-dqctm051 comparetotmag 20 -20 -> 0
-dqctm052 comparetotmag 20 -10 -> 1
-dqctm053 comparetotmag 20 00 -> 1
-dqctm055 comparetotmag 20 10 -> 1
-dqctm056 comparetotmag 20 20 -> 0
-
-dqctm061 comparetotmag -2.0 -2.0 -> 0
-dqctm062 comparetotmag -2.0 -1.0 -> 1
-dqctm063 comparetotmag -2.0 0.0 -> 1
-dqctm064 comparetotmag -2.0 1.0 -> 1
-dqctm065 comparetotmag -2.0 2.0 -> 0
-dqctm066 comparetotmag -1.0 -2.0 -> -1
-dqctm067 comparetotmag -1.0 -1.0 -> 0
-dqctm068 comparetotmag -1.0 0.0 -> 1
-dqctm069 comparetotmag -1.0 1.0 -> 0
-dqctm070 comparetotmag -1.0 2.0 -> -1
-dqctm071 comparetotmag 0.0 -2.0 -> -1
-dqctm072 comparetotmag 0.0 -1.0 -> -1
-dqctm073 comparetotmag 0.0 0.0 -> 0
-dqctm074 comparetotmag 0.0 1.0 -> -1
-dqctm075 comparetotmag 0.0 2.0 -> -1
-dqctm076 comparetotmag 1.0 -2.0 -> -1
-dqctm077 comparetotmag 1.0 -1.0 -> 0
-dqctm078 comparetotmag 1.0 0.0 -> 1
-dqctm079 comparetotmag 1.0 1.0 -> 0
-dqctm080 comparetotmag 1.0 2.0 -> -1
-dqctm081 comparetotmag 2.0 -2.0 -> 0
-dqctm082 comparetotmag 2.0 -1.0 -> 1
-dqctm083 comparetotmag 2.0 0.0 -> 1
-dqctm085 comparetotmag 2.0 1.0 -> 1
-dqctm086 comparetotmag 2.0 2.0 -> 0
-
--- now some cases which might overflow if subtract were used
-dqctm090 comparetotmag 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
-dqctm091 comparetotmag -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
-dqctm092 comparetotmag 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
-dqctm093 comparetotmag -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
-
--- some differing length/exponent cases
--- in this first group, compare would compare all equal
-dqctm100 comparetotmag 7.0 7.0 -> 0
-dqctm101 comparetotmag 7.0 7 -> -1
-dqctm102 comparetotmag 7 7.0 -> 1
-dqctm103 comparetotmag 7E+0 7.0 -> 1
-dqctm104 comparetotmag 70E-1 7.0 -> 0
-dqctm105 comparetotmag 0.7E+1 7 -> 0
-dqctm106 comparetotmag 70E-1 7 -> -1
-dqctm107 comparetotmag 7.0 7E+0 -> -1
-dqctm108 comparetotmag 7.0 70E-1 -> 0
-dqctm109 comparetotmag 7 0.7E+1 -> 0
-dqctm110 comparetotmag 7 70E-1 -> 1
-
-dqctm120 comparetotmag 8.0 7.0 -> 1
-dqctm121 comparetotmag 8.0 7 -> 1
-dqctm122 comparetotmag 8 7.0 -> 1
-dqctm123 comparetotmag 8E+0 7.0 -> 1
-dqctm124 comparetotmag 80E-1 7.0 -> 1
-dqctm125 comparetotmag 0.8E+1 7 -> 1
-dqctm126 comparetotmag 80E-1 7 -> 1
-dqctm127 comparetotmag 8.0 7E+0 -> 1
-dqctm128 comparetotmag 8.0 70E-1 -> 1
-dqctm129 comparetotmag 8 0.7E+1 -> 1
-dqctm130 comparetotmag 8 70E-1 -> 1
-
-dqctm140 comparetotmag 8.0 9.0 -> -1
-dqctm141 comparetotmag 8.0 9 -> -1
-dqctm142 comparetotmag 8 9.0 -> -1
-dqctm143 comparetotmag 8E+0 9.0 -> -1
-dqctm144 comparetotmag 80E-1 9.0 -> -1
-dqctm145 comparetotmag 0.8E+1 9 -> -1
-dqctm146 comparetotmag 80E-1 9 -> -1
-dqctm147 comparetotmag 8.0 9E+0 -> -1
-dqctm148 comparetotmag 8.0 90E-1 -> -1
-dqctm149 comparetotmag 8 0.9E+1 -> -1
-dqctm150 comparetotmag 8 90E-1 -> -1
-
--- and again, with sign changes -+ ..
-dqctm200 comparetotmag -7.0 7.0 -> 0
-dqctm201 comparetotmag -7.0 7 -> -1
-dqctm202 comparetotmag -7 7.0 -> 1
-dqctm203 comparetotmag -7E+0 7.0 -> 1
-dqctm204 comparetotmag -70E-1 7.0 -> 0
-dqctm205 comparetotmag -0.7E+1 7 -> 0
-dqctm206 comparetotmag -70E-1 7 -> -1
-dqctm207 comparetotmag -7.0 7E+0 -> -1
-dqctm208 comparetotmag -7.0 70E-1 -> 0
-dqctm209 comparetotmag -7 0.7E+1 -> 0
-dqctm210 comparetotmag -7 70E-1 -> 1
-
-dqctm220 comparetotmag -8.0 7.0 -> 1
-dqctm221 comparetotmag -8.0 7 -> 1
-dqctm222 comparetotmag -8 7.0 -> 1
-dqctm223 comparetotmag -8E+0 7.0 -> 1
-dqctm224 comparetotmag -80E-1 7.0 -> 1
-dqctm225 comparetotmag -0.8E+1 7 -> 1
-dqctm226 comparetotmag -80E-1 7 -> 1
-dqctm227 comparetotmag -8.0 7E+0 -> 1
-dqctm228 comparetotmag -8.0 70E-1 -> 1
-dqctm229 comparetotmag -8 0.7E+1 -> 1
-dqctm230 comparetotmag -8 70E-1 -> 1
-
-dqctm240 comparetotmag -8.0 9.0 -> -1
-dqctm241 comparetotmag -8.0 9 -> -1
-dqctm242 comparetotmag -8 9.0 -> -1
-dqctm243 comparetotmag -8E+0 9.0 -> -1
-dqctm244 comparetotmag -80E-1 9.0 -> -1
-dqctm245 comparetotmag -0.8E+1 9 -> -1
-dqctm246 comparetotmag -80E-1 9 -> -1
-dqctm247 comparetotmag -8.0 9E+0 -> -1
-dqctm248 comparetotmag -8.0 90E-1 -> -1
-dqctm249 comparetotmag -8 0.9E+1 -> -1
-dqctm250 comparetotmag -8 90E-1 -> -1
-
--- and again, with sign changes +- ..
-dqctm300 comparetotmag 7.0 -7.0 -> 0
-dqctm301 comparetotmag 7.0 -7 -> -1
-dqctm302 comparetotmag 7 -7.0 -> 1
-dqctm303 comparetotmag 7E+0 -7.0 -> 1
-dqctm304 comparetotmag 70E-1 -7.0 -> 0
-dqctm305 comparetotmag .7E+1 -7 -> 0
-dqctm306 comparetotmag 70E-1 -7 -> -1
-dqctm307 comparetotmag 7.0 -7E+0 -> -1
-dqctm308 comparetotmag 7.0 -70E-1 -> 0
-dqctm309 comparetotmag 7 -.7E+1 -> 0
-dqctm310 comparetotmag 7 -70E-1 -> 1
-
-dqctm320 comparetotmag 8.0 -7.0 -> 1
-dqctm321 comparetotmag 8.0 -7 -> 1
-dqctm322 comparetotmag 8 -7.0 -> 1
-dqctm323 comparetotmag 8E+0 -7.0 -> 1
-dqctm324 comparetotmag 80E-1 -7.0 -> 1
-dqctm325 comparetotmag .8E+1 -7 -> 1
-dqctm326 comparetotmag 80E-1 -7 -> 1
-dqctm327 comparetotmag 8.0 -7E+0 -> 1
-dqctm328 comparetotmag 8.0 -70E-1 -> 1
-dqctm329 comparetotmag 8 -.7E+1 -> 1
-dqctm330 comparetotmag 8 -70E-1 -> 1
-
-dqctm340 comparetotmag 8.0 -9.0 -> -1
-dqctm341 comparetotmag 8.0 -9 -> -1
-dqctm342 comparetotmag 8 -9.0 -> -1
-dqctm343 comparetotmag 8E+0 -9.0 -> -1
-dqctm344 comparetotmag 80E-1 -9.0 -> -1
-dqctm345 comparetotmag .8E+1 -9 -> -1
-dqctm346 comparetotmag 80E-1 -9 -> -1
-dqctm347 comparetotmag 8.0 -9E+0 -> -1
-dqctm348 comparetotmag 8.0 -90E-1 -> -1
-dqctm349 comparetotmag 8 -.9E+1 -> -1
-dqctm350 comparetotmag 8 -90E-1 -> -1
-
--- and again, with sign changes -- ..
-dqctm400 comparetotmag -7.0 -7.0 -> 0
-dqctm401 comparetotmag -7.0 -7 -> -1
-dqctm402 comparetotmag -7 -7.0 -> 1
-dqctm403 comparetotmag -7E+0 -7.0 -> 1
-dqctm404 comparetotmag -70E-1 -7.0 -> 0
-dqctm405 comparetotmag -.7E+1 -7 -> 0
-dqctm406 comparetotmag -70E-1 -7 -> -1
-dqctm407 comparetotmag -7.0 -7E+0 -> -1
-dqctm408 comparetotmag -7.0 -70E-1 -> 0
-dqctm409 comparetotmag -7 -.7E+1 -> 0
-dqctm410 comparetotmag -7 -70E-1 -> 1
-
-dqctm420 comparetotmag -8.0 -7.0 -> 1
-dqctm421 comparetotmag -8.0 -7 -> 1
-dqctm422 comparetotmag -8 -7.0 -> 1
-dqctm423 comparetotmag -8E+0 -7.0 -> 1
-dqctm424 comparetotmag -80E-1 -7.0 -> 1
-dqctm425 comparetotmag -.8E+1 -7 -> 1
-dqctm426 comparetotmag -80E-1 -7 -> 1
-dqctm427 comparetotmag -8.0 -7E+0 -> 1
-dqctm428 comparetotmag -8.0 -70E-1 -> 1
-dqctm429 comparetotmag -8 -.7E+1 -> 1
-dqctm430 comparetotmag -8 -70E-1 -> 1
-
-dqctm440 comparetotmag -8.0 -9.0 -> -1
-dqctm441 comparetotmag -8.0 -9 -> -1
-dqctm442 comparetotmag -8 -9.0 -> -1
-dqctm443 comparetotmag -8E+0 -9.0 -> -1
-dqctm444 comparetotmag -80E-1 -9.0 -> -1
-dqctm445 comparetotmag -.8E+1 -9 -> -1
-dqctm446 comparetotmag -80E-1 -9 -> -1
-dqctm447 comparetotmag -8.0 -9E+0 -> -1
-dqctm448 comparetotmag -8.0 -90E-1 -> -1
-dqctm449 comparetotmag -8 -.9E+1 -> -1
-dqctm450 comparetotmag -8 -90E-1 -> -1
-
-
--- testcases that subtract to lots of zeros at boundaries [pgr]
-dqctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
-dqctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
-dqctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
-dqctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
-dqctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
-dqctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
-dqctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
-dqctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
-dqctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
-dqctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
-dqctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
-dqctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
-dqctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
-dqctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
-dqctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
-dqctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
-dqctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
-dqctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
-dqctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
-dqctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
-dqctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
-dqctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
-
--- wide-ranging, around precision; signs equal
-dqctm498 comparetotmag 1 1E-17 -> 1
-dqctm499 comparetotmag 1 1E-16 -> 1
-dqctm500 comparetotmag 1 1E-15 -> 1
-dqctm501 comparetotmag 1 1E-14 -> 1
-dqctm502 comparetotmag 1 1E-13 -> 1
-dqctm503 comparetotmag 1 1E-12 -> 1
-dqctm504 comparetotmag 1 1E-11 -> 1
-dqctm505 comparetotmag 1 1E-10 -> 1
-dqctm506 comparetotmag 1 1E-9 -> 1
-dqctm507 comparetotmag 1 1E-8 -> 1
-dqctm508 comparetotmag 1 1E-7 -> 1
-dqctm509 comparetotmag 1 1E-6 -> 1
-dqctm510 comparetotmag 1 1E-5 -> 1
-dqctm511 comparetotmag 1 1E-4 -> 1
-dqctm512 comparetotmag 1 1E-3 -> 1
-dqctm513 comparetotmag 1 1E-2 -> 1
-dqctm514 comparetotmag 1 1E-1 -> 1
-dqctm515 comparetotmag 1 1E-0 -> 0
-dqctm516 comparetotmag 1 1E+1 -> -1
-dqctm517 comparetotmag 1 1E+2 -> -1
-dqctm518 comparetotmag 1 1E+3 -> -1
-dqctm519 comparetotmag 1 1E+4 -> -1
-dqctm521 comparetotmag 1 1E+5 -> -1
-dqctm522 comparetotmag 1 1E+6 -> -1
-dqctm523 comparetotmag 1 1E+7 -> -1
-dqctm524 comparetotmag 1 1E+8 -> -1
-dqctm525 comparetotmag 1 1E+9 -> -1
-dqctm526 comparetotmag 1 1E+10 -> -1
-dqctm527 comparetotmag 1 1E+11 -> -1
-dqctm528 comparetotmag 1 1E+12 -> -1
-dqctm529 comparetotmag 1 1E+13 -> -1
-dqctm530 comparetotmag 1 1E+14 -> -1
-dqctm531 comparetotmag 1 1E+15 -> -1
-dqctm532 comparetotmag 1 1E+16 -> -1
-dqctm533 comparetotmag 1 1E+17 -> -1
--- LR swap
-dqctm538 comparetotmag 1E-17 1 -> -1
-dqctm539 comparetotmag 1E-16 1 -> -1
-dqctm540 comparetotmag 1E-15 1 -> -1
-dqctm541 comparetotmag 1E-14 1 -> -1
-dqctm542 comparetotmag 1E-13 1 -> -1
-dqctm543 comparetotmag 1E-12 1 -> -1
-dqctm544 comparetotmag 1E-11 1 -> -1
-dqctm545 comparetotmag 1E-10 1 -> -1
-dqctm546 comparetotmag 1E-9 1 -> -1
-dqctm547 comparetotmag 1E-8 1 -> -1
-dqctm548 comparetotmag 1E-7 1 -> -1
-dqctm549 comparetotmag 1E-6 1 -> -1
-dqctm550 comparetotmag 1E-5 1 -> -1
-dqctm551 comparetotmag 1E-4 1 -> -1
-dqctm552 comparetotmag 1E-3 1 -> -1
-dqctm553 comparetotmag 1E-2 1 -> -1
-dqctm554 comparetotmag 1E-1 1 -> -1
-dqctm555 comparetotmag 1E-0 1 -> 0
-dqctm556 comparetotmag 1E+1 1 -> 1
-dqctm557 comparetotmag 1E+2 1 -> 1
-dqctm558 comparetotmag 1E+3 1 -> 1
-dqctm559 comparetotmag 1E+4 1 -> 1
-dqctm561 comparetotmag 1E+5 1 -> 1
-dqctm562 comparetotmag 1E+6 1 -> 1
-dqctm563 comparetotmag 1E+7 1 -> 1
-dqctm564 comparetotmag 1E+8 1 -> 1
-dqctm565 comparetotmag 1E+9 1 -> 1
-dqctm566 comparetotmag 1E+10 1 -> 1
-dqctm567 comparetotmag 1E+11 1 -> 1
-dqctm568 comparetotmag 1E+12 1 -> 1
-dqctm569 comparetotmag 1E+13 1 -> 1
-dqctm570 comparetotmag 1E+14 1 -> 1
-dqctm571 comparetotmag 1E+15 1 -> 1
-dqctm572 comparetotmag 1E+16 1 -> 1
-dqctm573 comparetotmag 1E+17 1 -> 1
--- similar with a useful coefficient, one side only
-dqctm578 comparetotmag 0.000000987654321 1E-17 -> 1
-dqctm579 comparetotmag 0.000000987654321 1E-16 -> 1
-dqctm580 comparetotmag 0.000000987654321 1E-15 -> 1
-dqctm581 comparetotmag 0.000000987654321 1E-14 -> 1
-dqctm582 comparetotmag 0.000000987654321 1E-13 -> 1
-dqctm583 comparetotmag 0.000000987654321 1E-12 -> 1
-dqctm584 comparetotmag 0.000000987654321 1E-11 -> 1
-dqctm585 comparetotmag 0.000000987654321 1E-10 -> 1
-dqctm586 comparetotmag 0.000000987654321 1E-9 -> 1
-dqctm587 comparetotmag 0.000000987654321 1E-8 -> 1
-dqctm588 comparetotmag 0.000000987654321 1E-7 -> 1
-dqctm589 comparetotmag 0.000000987654321 1E-6 -> -1
-dqctm590 comparetotmag 0.000000987654321 1E-5 -> -1
-dqctm591 comparetotmag 0.000000987654321 1E-4 -> -1
-dqctm592 comparetotmag 0.000000987654321 1E-3 -> -1
-dqctm593 comparetotmag 0.000000987654321 1E-2 -> -1
-dqctm594 comparetotmag 0.000000987654321 1E-1 -> -1
-dqctm595 comparetotmag 0.000000987654321 1E-0 -> -1
-dqctm596 comparetotmag 0.000000987654321 1E+1 -> -1
-dqctm597 comparetotmag 0.000000987654321 1E+2 -> -1
-dqctm598 comparetotmag 0.000000987654321 1E+3 -> -1
-dqctm599 comparetotmag 0.000000987654321 1E+4 -> -1
-
--- check some unit-y traps
-dqctm600 comparetotmag 12 12.2345 -> -1
-dqctm601 comparetotmag 12.0 12.2345 -> -1
-dqctm602 comparetotmag 12.00 12.2345 -> -1
-dqctm603 comparetotmag 12.000 12.2345 -> -1
-dqctm604 comparetotmag 12.0000 12.2345 -> -1
-dqctm605 comparetotmag 12.00000 12.2345 -> -1
-dqctm606 comparetotmag 12.000000 12.2345 -> -1
-dqctm607 comparetotmag 12.0000000 12.2345 -> -1
-dqctm608 comparetotmag 12.00000000 12.2345 -> -1
-dqctm609 comparetotmag 12.000000000 12.2345 -> -1
-dqctm610 comparetotmag 12.1234 12 -> 1
-dqctm611 comparetotmag 12.1234 12.0 -> 1
-dqctm612 comparetotmag 12.1234 12.00 -> 1
-dqctm613 comparetotmag 12.1234 12.000 -> 1
-dqctm614 comparetotmag 12.1234 12.0000 -> 1
-dqctm615 comparetotmag 12.1234 12.00000 -> 1
-dqctm616 comparetotmag 12.1234 12.000000 -> 1
-dqctm617 comparetotmag 12.1234 12.0000000 -> 1
-dqctm618 comparetotmag 12.1234 12.00000000 -> 1
-dqctm619 comparetotmag 12.1234 12.000000000 -> 1
-dqctm620 comparetotmag -12 -12.2345 -> -1
-dqctm621 comparetotmag -12.0 -12.2345 -> -1
-dqctm622 comparetotmag -12.00 -12.2345 -> -1
-dqctm623 comparetotmag -12.000 -12.2345 -> -1
-dqctm624 comparetotmag -12.0000 -12.2345 -> -1
-dqctm625 comparetotmag -12.00000 -12.2345 -> -1
-dqctm626 comparetotmag -12.000000 -12.2345 -> -1
-dqctm627 comparetotmag -12.0000000 -12.2345 -> -1
-dqctm628 comparetotmag -12.00000000 -12.2345 -> -1
-dqctm629 comparetotmag -12.000000000 -12.2345 -> -1
-dqctm630 comparetotmag -12.1234 -12 -> 1
-dqctm631 comparetotmag -12.1234 -12.0 -> 1
-dqctm632 comparetotmag -12.1234 -12.00 -> 1
-dqctm633 comparetotmag -12.1234 -12.000 -> 1
-dqctm634 comparetotmag -12.1234 -12.0000 -> 1
-dqctm635 comparetotmag -12.1234 -12.00000 -> 1
-dqctm636 comparetotmag -12.1234 -12.000000 -> 1
-dqctm637 comparetotmag -12.1234 -12.0000000 -> 1
-dqctm638 comparetotmag -12.1234 -12.00000000 -> 1
-dqctm639 comparetotmag -12.1234 -12.000000000 -> 1
-
--- extended zeros
-dqctm640 comparetotmag 0 0 -> 0
-dqctm641 comparetotmag 0 -0 -> 0
-dqctm642 comparetotmag 0 -0.0 -> 1
-dqctm643 comparetotmag 0 0.0 -> 1
-dqctm644 comparetotmag -0 0 -> 0
-dqctm645 comparetotmag -0 -0 -> 0
-dqctm646 comparetotmag -0 -0.0 -> 1
-dqctm647 comparetotmag -0 0.0 -> 1
-dqctm648 comparetotmag 0.0 0 -> -1
-dqctm649 comparetotmag 0.0 -0 -> -1
-dqctm650 comparetotmag 0.0 -0.0 -> 0
-dqctm651 comparetotmag 0.0 0.0 -> 0
-dqctm652 comparetotmag -0.0 0 -> -1
-dqctm653 comparetotmag -0.0 -0 -> -1
-dqctm654 comparetotmag -0.0 -0.0 -> 0
-dqctm655 comparetotmag -0.0 0.0 -> 0
-
-dqctm656 comparetotmag -0E1 0.0 -> 1
-dqctm657 comparetotmag -0E2 0.0 -> 1
-dqctm658 comparetotmag 0E1 0.0 -> 1
-dqctm659 comparetotmag 0E2 0.0 -> 1
-dqctm660 comparetotmag -0E1 0 -> 1
-dqctm661 comparetotmag -0E2 0 -> 1
-dqctm662 comparetotmag 0E1 0 -> 1
-dqctm663 comparetotmag 0E2 0 -> 1
-dqctm664 comparetotmag -0E1 -0E1 -> 0
-dqctm665 comparetotmag -0E2 -0E1 -> 1
-dqctm666 comparetotmag 0E1 -0E1 -> 0
-dqctm667 comparetotmag 0E2 -0E1 -> 1
-dqctm668 comparetotmag -0E1 -0E2 -> -1
-dqctm669 comparetotmag -0E2 -0E2 -> 0
-dqctm670 comparetotmag 0E1 -0E2 -> -1
-dqctm671 comparetotmag 0E2 -0E2 -> 0
-dqctm672 comparetotmag -0E1 0E1 -> 0
-dqctm673 comparetotmag -0E2 0E1 -> 1
-dqctm674 comparetotmag 0E1 0E1 -> 0
-dqctm675 comparetotmag 0E2 0E1 -> 1
-dqctm676 comparetotmag -0E1 0E2 -> -1
-dqctm677 comparetotmag -0E2 0E2 -> 0
-dqctm678 comparetotmag 0E1 0E2 -> -1
-dqctm679 comparetotmag 0E2 0E2 -> 0
-
--- trailing zeros; unit-y
-dqctm680 comparetotmag 12 12 -> 0
-dqctm681 comparetotmag 12 12.0 -> 1
-dqctm682 comparetotmag 12 12.00 -> 1
-dqctm683 comparetotmag 12 12.000 -> 1
-dqctm684 comparetotmag 12 12.0000 -> 1
-dqctm685 comparetotmag 12 12.00000 -> 1
-dqctm686 comparetotmag 12 12.000000 -> 1
-dqctm687 comparetotmag 12 12.0000000 -> 1
-dqctm688 comparetotmag 12 12.00000000 -> 1
-dqctm689 comparetotmag 12 12.000000000 -> 1
-dqctm690 comparetotmag 12 12 -> 0
-dqctm691 comparetotmag 12.0 12 -> -1
-dqctm692 comparetotmag 12.00 12 -> -1
-dqctm693 comparetotmag 12.000 12 -> -1
-dqctm694 comparetotmag 12.0000 12 -> -1
-dqctm695 comparetotmag 12.00000 12 -> -1
-dqctm696 comparetotmag 12.000000 12 -> -1
-dqctm697 comparetotmag 12.0000000 12 -> -1
-dqctm698 comparetotmag 12.00000000 12 -> -1
-dqctm699 comparetotmag 12.000000000 12 -> -1
-
--- old long operand checks
-dqctm701 comparetotmag 12345678000 1 -> 1
-dqctm702 comparetotmag 1 12345678000 -> -1
-dqctm703 comparetotmag 1234567800 1 -> 1
-dqctm704 comparetotmag 1 1234567800 -> -1
-dqctm705 comparetotmag 1234567890 1 -> 1
-dqctm706 comparetotmag 1 1234567890 -> -1
-dqctm707 comparetotmag 1234567891 1 -> 1
-dqctm708 comparetotmag 1 1234567891 -> -1
-dqctm709 comparetotmag 12345678901 1 -> 1
-dqctm710 comparetotmag 1 12345678901 -> -1
-dqctm711 comparetotmag 1234567896 1 -> 1
-dqctm712 comparetotmag 1 1234567896 -> -1
-dqctm713 comparetotmag -1234567891 1 -> 1
-dqctm714 comparetotmag 1 -1234567891 -> -1
-dqctm715 comparetotmag -12345678901 1 -> 1
-dqctm716 comparetotmag 1 -12345678901 -> -1
-dqctm717 comparetotmag -1234567896 1 -> 1
-dqctm718 comparetotmag 1 -1234567896 -> -1
-
--- old residue cases
-dqctm740 comparetotmag 1 0.9999999 -> 1
-dqctm741 comparetotmag 1 0.999999 -> 1
-dqctm742 comparetotmag 1 0.99999 -> 1
-dqctm743 comparetotmag 1 1.0000 -> 1
-dqctm744 comparetotmag 1 1.00001 -> -1
-dqctm745 comparetotmag 1 1.000001 -> -1
-dqctm746 comparetotmag 1 1.0000001 -> -1
-dqctm750 comparetotmag 0.9999999 1 -> -1
-dqctm751 comparetotmag 0.999999 1 -> -1
-dqctm752 comparetotmag 0.99999 1 -> -1
-dqctm753 comparetotmag 1.0000 1 -> -1
-dqctm754 comparetotmag 1.00001 1 -> 1
-dqctm755 comparetotmag 1.000001 1 -> 1
-dqctm756 comparetotmag 1.0000001 1 -> 1
-
--- Specials
-dqctm780 comparetotmag Inf -Inf -> 0
-dqctm781 comparetotmag Inf -1000 -> 1
-dqctm782 comparetotmag Inf -1 -> 1
-dqctm783 comparetotmag Inf -0 -> 1
-dqctm784 comparetotmag Inf 0 -> 1
-dqctm785 comparetotmag Inf 1 -> 1
-dqctm786 comparetotmag Inf 1000 -> 1
-dqctm787 comparetotmag Inf Inf -> 0
-dqctm788 comparetotmag -1000 Inf -> -1
-dqctm789 comparetotmag -Inf Inf -> 0
-dqctm790 comparetotmag -1 Inf -> -1
-dqctm791 comparetotmag -0 Inf -> -1
-dqctm792 comparetotmag 0 Inf -> -1
-dqctm793 comparetotmag 1 Inf -> -1
-dqctm794 comparetotmag 1000 Inf -> -1
-dqctm795 comparetotmag Inf Inf -> 0
-
-dqctm800 comparetotmag -Inf -Inf -> 0
-dqctm801 comparetotmag -Inf -1000 -> 1
-dqctm802 comparetotmag -Inf -1 -> 1
-dqctm803 comparetotmag -Inf -0 -> 1
-dqctm804 comparetotmag -Inf 0 -> 1
-dqctm805 comparetotmag -Inf 1 -> 1
-dqctm806 comparetotmag -Inf 1000 -> 1
-dqctm807 comparetotmag -Inf Inf -> 0
-dqctm808 comparetotmag -Inf -Inf -> 0
-dqctm809 comparetotmag -1000 -Inf -> -1
-dqctm810 comparetotmag -1 -Inf -> -1
-dqctm811 comparetotmag -0 -Inf -> -1
-dqctm812 comparetotmag 0 -Inf -> -1
-dqctm813 comparetotmag 1 -Inf -> -1
-dqctm814 comparetotmag 1000 -Inf -> -1
-dqctm815 comparetotmag Inf -Inf -> 0
-
-dqctm821 comparetotmag NaN -Inf -> 1
-dqctm822 comparetotmag NaN -1000 -> 1
-dqctm823 comparetotmag NaN -1 -> 1
-dqctm824 comparetotmag NaN -0 -> 1
-dqctm825 comparetotmag NaN 0 -> 1
-dqctm826 comparetotmag NaN 1 -> 1
-dqctm827 comparetotmag NaN 1000 -> 1
-dqctm828 comparetotmag NaN Inf -> 1
-dqctm829 comparetotmag NaN NaN -> 0
-dqctm830 comparetotmag -Inf NaN -> -1
-dqctm831 comparetotmag -1000 NaN -> -1
-dqctm832 comparetotmag -1 NaN -> -1
-dqctm833 comparetotmag -0 NaN -> -1
-dqctm834 comparetotmag 0 NaN -> -1
-dqctm835 comparetotmag 1 NaN -> -1
-dqctm836 comparetotmag 1000 NaN -> -1
-dqctm837 comparetotmag Inf NaN -> -1
-dqctm838 comparetotmag -NaN -NaN -> 0
-dqctm839 comparetotmag +NaN -NaN -> 0
-dqctm840 comparetotmag -NaN +NaN -> 0
-
-dqctm841 comparetotmag sNaN -sNaN -> 0
-dqctm842 comparetotmag sNaN -NaN -> -1
-dqctm843 comparetotmag sNaN -Inf -> 1
-dqctm844 comparetotmag sNaN -1000 -> 1
-dqctm845 comparetotmag sNaN -1 -> 1
-dqctm846 comparetotmag sNaN -0 -> 1
-dqctm847 comparetotmag sNaN 0 -> 1
-dqctm848 comparetotmag sNaN 1 -> 1
-dqctm849 comparetotmag sNaN 1000 -> 1
-dqctm850 comparetotmag sNaN NaN -> -1
-dqctm851 comparetotmag sNaN sNaN -> 0
-
-dqctm852 comparetotmag -sNaN sNaN -> 0
-dqctm853 comparetotmag -NaN sNaN -> 1
-dqctm854 comparetotmag -Inf sNaN -> -1
-dqctm855 comparetotmag -1000 sNaN -> -1
-dqctm856 comparetotmag -1 sNaN -> -1
-dqctm857 comparetotmag -0 sNaN -> -1
-dqctm858 comparetotmag 0 sNaN -> -1
-dqctm859 comparetotmag 1 sNaN -> -1
-dqctm860 comparetotmag 1000 sNaN -> -1
-dqctm861 comparetotmag Inf sNaN -> -1
-dqctm862 comparetotmag NaN sNaN -> 1
-dqctm863 comparetotmag sNaN sNaN -> 0
-
-dqctm871 comparetotmag -sNaN -sNaN -> 0
-dqctm872 comparetotmag -sNaN -NaN -> -1
-dqctm873 comparetotmag -sNaN -Inf -> 1
-dqctm874 comparetotmag -sNaN -1000 -> 1
-dqctm875 comparetotmag -sNaN -1 -> 1
-dqctm876 comparetotmag -sNaN -0 -> 1
-dqctm877 comparetotmag -sNaN 0 -> 1
-dqctm878 comparetotmag -sNaN 1 -> 1
-dqctm879 comparetotmag -sNaN 1000 -> 1
-dqctm880 comparetotmag -sNaN NaN -> -1
-dqctm881 comparetotmag -sNaN sNaN -> 0
-
-dqctm882 comparetotmag -sNaN -sNaN -> 0
-dqctm883 comparetotmag -NaN -sNaN -> 1
-dqctm884 comparetotmag -Inf -sNaN -> -1
-dqctm885 comparetotmag -1000 -sNaN -> -1
-dqctm886 comparetotmag -1 -sNaN -> -1
-dqctm887 comparetotmag -0 -sNaN -> -1
-dqctm888 comparetotmag 0 -sNaN -> -1
-dqctm889 comparetotmag 1 -sNaN -> -1
-dqctm890 comparetotmag 1000 -sNaN -> -1
-dqctm891 comparetotmag Inf -sNaN -> -1
-dqctm892 comparetotmag NaN -sNaN -> 1
-dqctm893 comparetotmag sNaN -sNaN -> 0
-
--- NaNs with payload
-dqctm960 comparetotmag NaN9 -Inf -> 1
-dqctm961 comparetotmag NaN8 999 -> 1
-dqctm962 comparetotmag NaN77 Inf -> 1
-dqctm963 comparetotmag -NaN67 NaN5 -> 1
-dqctm964 comparetotmag -Inf -NaN4 -> -1
-dqctm965 comparetotmag -999 -NaN33 -> -1
-dqctm966 comparetotmag Inf NaN2 -> -1
-
-dqctm970 comparetotmag -NaN41 -NaN42 -> -1
-dqctm971 comparetotmag +NaN41 -NaN42 -> -1
-dqctm972 comparetotmag -NaN41 +NaN42 -> -1
-dqctm973 comparetotmag +NaN41 +NaN42 -> -1
-dqctm974 comparetotmag -NaN42 -NaN01 -> 1
-dqctm975 comparetotmag +NaN42 -NaN01 -> 1
-dqctm976 comparetotmag -NaN42 +NaN01 -> 1
-dqctm977 comparetotmag +NaN42 +NaN01 -> 1
-
-dqctm980 comparetotmag -sNaN771 -sNaN772 -> -1
-dqctm981 comparetotmag +sNaN771 -sNaN772 -> -1
-dqctm982 comparetotmag -sNaN771 +sNaN772 -> -1
-dqctm983 comparetotmag +sNaN771 +sNaN772 -> -1
-dqctm984 comparetotmag -sNaN772 -sNaN771 -> 1
-dqctm985 comparetotmag +sNaN772 -sNaN771 -> 1
-dqctm986 comparetotmag -sNaN772 +sNaN771 -> 1
-dqctm987 comparetotmag +sNaN772 +sNaN771 -> 1
-
-dqctm991 comparetotmag -sNaN99 -Inf -> 1
-dqctm992 comparetotmag sNaN98 -11 -> 1
-dqctm993 comparetotmag sNaN97 NaN -> -1
-dqctm994 comparetotmag sNaN16 sNaN94 -> -1
-dqctm995 comparetotmag NaN85 sNaN83 -> 1
-dqctm996 comparetotmag -Inf sNaN92 -> -1
-dqctm997 comparetotmag 088 sNaN81 -> -1
-dqctm998 comparetotmag Inf sNaN90 -> -1
-dqctm999 comparetotmag NaN -sNaN89 -> 1
-
--- spread zeros
-dqctm1110 comparetotmag 0E-6143 0 -> -1
-dqctm1111 comparetotmag 0E-6143 -0 -> -1
-dqctm1112 comparetotmag -0E-6143 0 -> -1
-dqctm1113 comparetotmag -0E-6143 -0 -> -1
-dqctm1114 comparetotmag 0E-6143 0E+6144 -> -1
-dqctm1115 comparetotmag 0E-6143 -0E+6144 -> -1
-dqctm1116 comparetotmag -0E-6143 0E+6144 -> -1
-dqctm1117 comparetotmag -0E-6143 -0E+6144 -> -1
-dqctm1118 comparetotmag 0 0E+6144 -> -1
-dqctm1119 comparetotmag 0 -0E+6144 -> -1
-dqctm1120 comparetotmag -0 0E+6144 -> -1
-dqctm1121 comparetotmag -0 -0E+6144 -> -1
-
-dqctm1130 comparetotmag 0E+6144 0 -> 1
-dqctm1131 comparetotmag 0E+6144 -0 -> 1
-dqctm1132 comparetotmag -0E+6144 0 -> 1
-dqctm1133 comparetotmag -0E+6144 -0 -> 1
-dqctm1134 comparetotmag 0E+6144 0E-6143 -> 1
-dqctm1135 comparetotmag 0E+6144 -0E-6143 -> 1
-dqctm1136 comparetotmag -0E+6144 0E-6143 -> 1
-dqctm1137 comparetotmag -0E+6144 -0E-6143 -> 1
-dqctm1138 comparetotmag 0 0E-6143 -> 1
-dqctm1139 comparetotmag 0 -0E-6143 -> 1
-dqctm1140 comparetotmag -0 0E-6143 -> 1
-dqctm1141 comparetotmag -0 -0E-6143 -> 1
-
--- Null tests
-dqctm9990 comparetotmag 10 # -> NaN Invalid_operation
-dqctm9991 comparetotmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqCompareTotalMag.decTest -- decQuad comparison; abs. total order --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Note that we cannot assume add/subtract tests cover paths adequately,
+-- here, because the code might be quite different (comparison cannot
+-- overflow or underflow, so actual subtractions are not necessary).
+-- Similarly, comparetotal will have some radically different paths
+-- than compare.
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqctm001 comparetotmag -2 -2 -> 0
+dqctm002 comparetotmag -2 -1 -> 1
+dqctm003 comparetotmag -2 0 -> 1
+dqctm004 comparetotmag -2 1 -> 1
+dqctm005 comparetotmag -2 2 -> 0
+dqctm006 comparetotmag -1 -2 -> -1
+dqctm007 comparetotmag -1 -1 -> 0
+dqctm008 comparetotmag -1 0 -> 1
+dqctm009 comparetotmag -1 1 -> 0
+dqctm010 comparetotmag -1 2 -> -1
+dqctm011 comparetotmag 0 -2 -> -1
+dqctm012 comparetotmag 0 -1 -> -1
+dqctm013 comparetotmag 0 0 -> 0
+dqctm014 comparetotmag 0 1 -> -1
+dqctm015 comparetotmag 0 2 -> -1
+dqctm016 comparetotmag 1 -2 -> -1
+dqctm017 comparetotmag 1 -1 -> 0
+dqctm018 comparetotmag 1 0 -> 1
+dqctm019 comparetotmag 1 1 -> 0
+dqctm020 comparetotmag 1 2 -> -1
+dqctm021 comparetotmag 2 -2 -> 0
+dqctm022 comparetotmag 2 -1 -> 1
+dqctm023 comparetotmag 2 0 -> 1
+dqctm025 comparetotmag 2 1 -> 1
+dqctm026 comparetotmag 2 2 -> 0
+
+dqctm031 comparetotmag -20 -20 -> 0
+dqctm032 comparetotmag -20 -10 -> 1
+dqctm033 comparetotmag -20 00 -> 1
+dqctm034 comparetotmag -20 10 -> 1
+dqctm035 comparetotmag -20 20 -> 0
+dqctm036 comparetotmag -10 -20 -> -1
+dqctm037 comparetotmag -10 -10 -> 0
+dqctm038 comparetotmag -10 00 -> 1
+dqctm039 comparetotmag -10 10 -> 0
+dqctm040 comparetotmag -10 20 -> -1
+dqctm041 comparetotmag 00 -20 -> -1
+dqctm042 comparetotmag 00 -10 -> -1
+dqctm043 comparetotmag 00 00 -> 0
+dqctm044 comparetotmag 00 10 -> -1
+dqctm045 comparetotmag 00 20 -> -1
+dqctm046 comparetotmag 10 -20 -> -1
+dqctm047 comparetotmag 10 -10 -> 0
+dqctm048 comparetotmag 10 00 -> 1
+dqctm049 comparetotmag 10 10 -> 0
+dqctm050 comparetotmag 10 20 -> -1
+dqctm051 comparetotmag 20 -20 -> 0
+dqctm052 comparetotmag 20 -10 -> 1
+dqctm053 comparetotmag 20 00 -> 1
+dqctm055 comparetotmag 20 10 -> 1
+dqctm056 comparetotmag 20 20 -> 0
+
+dqctm061 comparetotmag -2.0 -2.0 -> 0
+dqctm062 comparetotmag -2.0 -1.0 -> 1
+dqctm063 comparetotmag -2.0 0.0 -> 1
+dqctm064 comparetotmag -2.0 1.0 -> 1
+dqctm065 comparetotmag -2.0 2.0 -> 0
+dqctm066 comparetotmag -1.0 -2.0 -> -1
+dqctm067 comparetotmag -1.0 -1.0 -> 0
+dqctm068 comparetotmag -1.0 0.0 -> 1
+dqctm069 comparetotmag -1.0 1.0 -> 0
+dqctm070 comparetotmag -1.0 2.0 -> -1
+dqctm071 comparetotmag 0.0 -2.0 -> -1
+dqctm072 comparetotmag 0.0 -1.0 -> -1
+dqctm073 comparetotmag 0.0 0.0 -> 0
+dqctm074 comparetotmag 0.0 1.0 -> -1
+dqctm075 comparetotmag 0.0 2.0 -> -1
+dqctm076 comparetotmag 1.0 -2.0 -> -1
+dqctm077 comparetotmag 1.0 -1.0 -> 0
+dqctm078 comparetotmag 1.0 0.0 -> 1
+dqctm079 comparetotmag 1.0 1.0 -> 0
+dqctm080 comparetotmag 1.0 2.0 -> -1
+dqctm081 comparetotmag 2.0 -2.0 -> 0
+dqctm082 comparetotmag 2.0 -1.0 -> 1
+dqctm083 comparetotmag 2.0 0.0 -> 1
+dqctm085 comparetotmag 2.0 1.0 -> 1
+dqctm086 comparetotmag 2.0 2.0 -> 0
+
+-- now some cases which might overflow if subtract were used
+dqctm090 comparetotmag 9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
+dqctm091 comparetotmag -9.99999999999999999999999999999E+6144 9.99999999999999999999999999999E+6144 -> 0
+dqctm092 comparetotmag 9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
+dqctm093 comparetotmag -9.99999999999999999999999999999E+6144 -9.99999999999999999999999999999E+6144 -> 0
+
+-- some differing length/exponent cases
+-- in this first group, compare would compare all equal
+dqctm100 comparetotmag 7.0 7.0 -> 0
+dqctm101 comparetotmag 7.0 7 -> -1
+dqctm102 comparetotmag 7 7.0 -> 1
+dqctm103 comparetotmag 7E+0 7.0 -> 1
+dqctm104 comparetotmag 70E-1 7.0 -> 0
+dqctm105 comparetotmag 0.7E+1 7 -> 0
+dqctm106 comparetotmag 70E-1 7 -> -1
+dqctm107 comparetotmag 7.0 7E+0 -> -1
+dqctm108 comparetotmag 7.0 70E-1 -> 0
+dqctm109 comparetotmag 7 0.7E+1 -> 0
+dqctm110 comparetotmag 7 70E-1 -> 1
+
+dqctm120 comparetotmag 8.0 7.0 -> 1
+dqctm121 comparetotmag 8.0 7 -> 1
+dqctm122 comparetotmag 8 7.0 -> 1
+dqctm123 comparetotmag 8E+0 7.0 -> 1
+dqctm124 comparetotmag 80E-1 7.0 -> 1
+dqctm125 comparetotmag 0.8E+1 7 -> 1
+dqctm126 comparetotmag 80E-1 7 -> 1
+dqctm127 comparetotmag 8.0 7E+0 -> 1
+dqctm128 comparetotmag 8.0 70E-1 -> 1
+dqctm129 comparetotmag 8 0.7E+1 -> 1
+dqctm130 comparetotmag 8 70E-1 -> 1
+
+dqctm140 comparetotmag 8.0 9.0 -> -1
+dqctm141 comparetotmag 8.0 9 -> -1
+dqctm142 comparetotmag 8 9.0 -> -1
+dqctm143 comparetotmag 8E+0 9.0 -> -1
+dqctm144 comparetotmag 80E-1 9.0 -> -1
+dqctm145 comparetotmag 0.8E+1 9 -> -1
+dqctm146 comparetotmag 80E-1 9 -> -1
+dqctm147 comparetotmag 8.0 9E+0 -> -1
+dqctm148 comparetotmag 8.0 90E-1 -> -1
+dqctm149 comparetotmag 8 0.9E+1 -> -1
+dqctm150 comparetotmag 8 90E-1 -> -1
+
+-- and again, with sign changes -+ ..
+dqctm200 comparetotmag -7.0 7.0 -> 0
+dqctm201 comparetotmag -7.0 7 -> -1
+dqctm202 comparetotmag -7 7.0 -> 1
+dqctm203 comparetotmag -7E+0 7.0 -> 1
+dqctm204 comparetotmag -70E-1 7.0 -> 0
+dqctm205 comparetotmag -0.7E+1 7 -> 0
+dqctm206 comparetotmag -70E-1 7 -> -1
+dqctm207 comparetotmag -7.0 7E+0 -> -1
+dqctm208 comparetotmag -7.0 70E-1 -> 0
+dqctm209 comparetotmag -7 0.7E+1 -> 0
+dqctm210 comparetotmag -7 70E-1 -> 1
+
+dqctm220 comparetotmag -8.0 7.0 -> 1
+dqctm221 comparetotmag -8.0 7 -> 1
+dqctm222 comparetotmag -8 7.0 -> 1
+dqctm223 comparetotmag -8E+0 7.0 -> 1
+dqctm224 comparetotmag -80E-1 7.0 -> 1
+dqctm225 comparetotmag -0.8E+1 7 -> 1
+dqctm226 comparetotmag -80E-1 7 -> 1
+dqctm227 comparetotmag -8.0 7E+0 -> 1
+dqctm228 comparetotmag -8.0 70E-1 -> 1
+dqctm229 comparetotmag -8 0.7E+1 -> 1
+dqctm230 comparetotmag -8 70E-1 -> 1
+
+dqctm240 comparetotmag -8.0 9.0 -> -1
+dqctm241 comparetotmag -8.0 9 -> -1
+dqctm242 comparetotmag -8 9.0 -> -1
+dqctm243 comparetotmag -8E+0 9.0 -> -1
+dqctm244 comparetotmag -80E-1 9.0 -> -1
+dqctm245 comparetotmag -0.8E+1 9 -> -1
+dqctm246 comparetotmag -80E-1 9 -> -1
+dqctm247 comparetotmag -8.0 9E+0 -> -1
+dqctm248 comparetotmag -8.0 90E-1 -> -1
+dqctm249 comparetotmag -8 0.9E+1 -> -1
+dqctm250 comparetotmag -8 90E-1 -> -1
+
+-- and again, with sign changes +- ..
+dqctm300 comparetotmag 7.0 -7.0 -> 0
+dqctm301 comparetotmag 7.0 -7 -> -1
+dqctm302 comparetotmag 7 -7.0 -> 1
+dqctm303 comparetotmag 7E+0 -7.0 -> 1
+dqctm304 comparetotmag 70E-1 -7.0 -> 0
+dqctm305 comparetotmag .7E+1 -7 -> 0
+dqctm306 comparetotmag 70E-1 -7 -> -1
+dqctm307 comparetotmag 7.0 -7E+0 -> -1
+dqctm308 comparetotmag 7.0 -70E-1 -> 0
+dqctm309 comparetotmag 7 -.7E+1 -> 0
+dqctm310 comparetotmag 7 -70E-1 -> 1
+
+dqctm320 comparetotmag 8.0 -7.0 -> 1
+dqctm321 comparetotmag 8.0 -7 -> 1
+dqctm322 comparetotmag 8 -7.0 -> 1
+dqctm323 comparetotmag 8E+0 -7.0 -> 1
+dqctm324 comparetotmag 80E-1 -7.0 -> 1
+dqctm325 comparetotmag .8E+1 -7 -> 1
+dqctm326 comparetotmag 80E-1 -7 -> 1
+dqctm327 comparetotmag 8.0 -7E+0 -> 1
+dqctm328 comparetotmag 8.0 -70E-1 -> 1
+dqctm329 comparetotmag 8 -.7E+1 -> 1
+dqctm330 comparetotmag 8 -70E-1 -> 1
+
+dqctm340 comparetotmag 8.0 -9.0 -> -1
+dqctm341 comparetotmag 8.0 -9 -> -1
+dqctm342 comparetotmag 8 -9.0 -> -1
+dqctm343 comparetotmag 8E+0 -9.0 -> -1
+dqctm344 comparetotmag 80E-1 -9.0 -> -1
+dqctm345 comparetotmag .8E+1 -9 -> -1
+dqctm346 comparetotmag 80E-1 -9 -> -1
+dqctm347 comparetotmag 8.0 -9E+0 -> -1
+dqctm348 comparetotmag 8.0 -90E-1 -> -1
+dqctm349 comparetotmag 8 -.9E+1 -> -1
+dqctm350 comparetotmag 8 -90E-1 -> -1
+
+-- and again, with sign changes -- ..
+dqctm400 comparetotmag -7.0 -7.0 -> 0
+dqctm401 comparetotmag -7.0 -7 -> -1
+dqctm402 comparetotmag -7 -7.0 -> 1
+dqctm403 comparetotmag -7E+0 -7.0 -> 1
+dqctm404 comparetotmag -70E-1 -7.0 -> 0
+dqctm405 comparetotmag -.7E+1 -7 -> 0
+dqctm406 comparetotmag -70E-1 -7 -> -1
+dqctm407 comparetotmag -7.0 -7E+0 -> -1
+dqctm408 comparetotmag -7.0 -70E-1 -> 0
+dqctm409 comparetotmag -7 -.7E+1 -> 0
+dqctm410 comparetotmag -7 -70E-1 -> 1
+
+dqctm420 comparetotmag -8.0 -7.0 -> 1
+dqctm421 comparetotmag -8.0 -7 -> 1
+dqctm422 comparetotmag -8 -7.0 -> 1
+dqctm423 comparetotmag -8E+0 -7.0 -> 1
+dqctm424 comparetotmag -80E-1 -7.0 -> 1
+dqctm425 comparetotmag -.8E+1 -7 -> 1
+dqctm426 comparetotmag -80E-1 -7 -> 1
+dqctm427 comparetotmag -8.0 -7E+0 -> 1
+dqctm428 comparetotmag -8.0 -70E-1 -> 1
+dqctm429 comparetotmag -8 -.7E+1 -> 1
+dqctm430 comparetotmag -8 -70E-1 -> 1
+
+dqctm440 comparetotmag -8.0 -9.0 -> -1
+dqctm441 comparetotmag -8.0 -9 -> -1
+dqctm442 comparetotmag -8 -9.0 -> -1
+dqctm443 comparetotmag -8E+0 -9.0 -> -1
+dqctm444 comparetotmag -80E-1 -9.0 -> -1
+dqctm445 comparetotmag -.8E+1 -9 -> -1
+dqctm446 comparetotmag -80E-1 -9 -> -1
+dqctm447 comparetotmag -8.0 -9E+0 -> -1
+dqctm448 comparetotmag -8.0 -90E-1 -> -1
+dqctm449 comparetotmag -8 -.9E+1 -> -1
+dqctm450 comparetotmag -8 -90E-1 -> -1
+
+
+-- testcases that subtract to lots of zeros at boundaries [pgr]
+dqctm473 comparetotmag 123.4560000000000E-89 123.456E-89 -> -1
+dqctm474 comparetotmag 123.456000000000E+89 123.456E+89 -> -1
+dqctm475 comparetotmag 123.45600000000E-89 123.456E-89 -> -1
+dqctm476 comparetotmag 123.4560000000E+89 123.456E+89 -> -1
+dqctm477 comparetotmag 123.456000000E-89 123.456E-89 -> -1
+dqctm478 comparetotmag 123.45600000E+89 123.456E+89 -> -1
+dqctm479 comparetotmag 123.4560000E-89 123.456E-89 -> -1
+dqctm480 comparetotmag 123.456000E+89 123.456E+89 -> -1
+dqctm481 comparetotmag 123.45600E-89 123.456E-89 -> -1
+dqctm482 comparetotmag 123.4560E+89 123.456E+89 -> -1
+dqctm483 comparetotmag 123.456E-89 123.456E-89 -> 0
+dqctm487 comparetotmag 123.456E+89 123.4560000000000E+89 -> 1
+dqctm488 comparetotmag 123.456E-89 123.456000000000E-89 -> 1
+dqctm489 comparetotmag 123.456E+89 123.45600000000E+89 -> 1
+dqctm490 comparetotmag 123.456E-89 123.4560000000E-89 -> 1
+dqctm491 comparetotmag 123.456E+89 123.456000000E+89 -> 1
+dqctm492 comparetotmag 123.456E-89 123.45600000E-89 -> 1
+dqctm493 comparetotmag 123.456E+89 123.4560000E+89 -> 1
+dqctm494 comparetotmag 123.456E-89 123.456000E-89 -> 1
+dqctm495 comparetotmag 123.456E+89 123.45600E+89 -> 1
+dqctm496 comparetotmag 123.456E-89 123.4560E-89 -> 1
+dqctm497 comparetotmag 123.456E+89 123.456E+89 -> 0
+
+-- wide-ranging, around precision; signs equal
+dqctm498 comparetotmag 1 1E-17 -> 1
+dqctm499 comparetotmag 1 1E-16 -> 1
+dqctm500 comparetotmag 1 1E-15 -> 1
+dqctm501 comparetotmag 1 1E-14 -> 1
+dqctm502 comparetotmag 1 1E-13 -> 1
+dqctm503 comparetotmag 1 1E-12 -> 1
+dqctm504 comparetotmag 1 1E-11 -> 1
+dqctm505 comparetotmag 1 1E-10 -> 1
+dqctm506 comparetotmag 1 1E-9 -> 1
+dqctm507 comparetotmag 1 1E-8 -> 1
+dqctm508 comparetotmag 1 1E-7 -> 1
+dqctm509 comparetotmag 1 1E-6 -> 1
+dqctm510 comparetotmag 1 1E-5 -> 1
+dqctm511 comparetotmag 1 1E-4 -> 1
+dqctm512 comparetotmag 1 1E-3 -> 1
+dqctm513 comparetotmag 1 1E-2 -> 1
+dqctm514 comparetotmag 1 1E-1 -> 1
+dqctm515 comparetotmag 1 1E-0 -> 0
+dqctm516 comparetotmag 1 1E+1 -> -1
+dqctm517 comparetotmag 1 1E+2 -> -1
+dqctm518 comparetotmag 1 1E+3 -> -1
+dqctm519 comparetotmag 1 1E+4 -> -1
+dqctm521 comparetotmag 1 1E+5 -> -1
+dqctm522 comparetotmag 1 1E+6 -> -1
+dqctm523 comparetotmag 1 1E+7 -> -1
+dqctm524 comparetotmag 1 1E+8 -> -1
+dqctm525 comparetotmag 1 1E+9 -> -1
+dqctm526 comparetotmag 1 1E+10 -> -1
+dqctm527 comparetotmag 1 1E+11 -> -1
+dqctm528 comparetotmag 1 1E+12 -> -1
+dqctm529 comparetotmag 1 1E+13 -> -1
+dqctm530 comparetotmag 1 1E+14 -> -1
+dqctm531 comparetotmag 1 1E+15 -> -1
+dqctm532 comparetotmag 1 1E+16 -> -1
+dqctm533 comparetotmag 1 1E+17 -> -1
+-- LR swap
+dqctm538 comparetotmag 1E-17 1 -> -1
+dqctm539 comparetotmag 1E-16 1 -> -1
+dqctm540 comparetotmag 1E-15 1 -> -1
+dqctm541 comparetotmag 1E-14 1 -> -1
+dqctm542 comparetotmag 1E-13 1 -> -1
+dqctm543 comparetotmag 1E-12 1 -> -1
+dqctm544 comparetotmag 1E-11 1 -> -1
+dqctm545 comparetotmag 1E-10 1 -> -1
+dqctm546 comparetotmag 1E-9 1 -> -1
+dqctm547 comparetotmag 1E-8 1 -> -1
+dqctm548 comparetotmag 1E-7 1 -> -1
+dqctm549 comparetotmag 1E-6 1 -> -1
+dqctm550 comparetotmag 1E-5 1 -> -1
+dqctm551 comparetotmag 1E-4 1 -> -1
+dqctm552 comparetotmag 1E-3 1 -> -1
+dqctm553 comparetotmag 1E-2 1 -> -1
+dqctm554 comparetotmag 1E-1 1 -> -1
+dqctm555 comparetotmag 1E-0 1 -> 0
+dqctm556 comparetotmag 1E+1 1 -> 1
+dqctm557 comparetotmag 1E+2 1 -> 1
+dqctm558 comparetotmag 1E+3 1 -> 1
+dqctm559 comparetotmag 1E+4 1 -> 1
+dqctm561 comparetotmag 1E+5 1 -> 1
+dqctm562 comparetotmag 1E+6 1 -> 1
+dqctm563 comparetotmag 1E+7 1 -> 1
+dqctm564 comparetotmag 1E+8 1 -> 1
+dqctm565 comparetotmag 1E+9 1 -> 1
+dqctm566 comparetotmag 1E+10 1 -> 1
+dqctm567 comparetotmag 1E+11 1 -> 1
+dqctm568 comparetotmag 1E+12 1 -> 1
+dqctm569 comparetotmag 1E+13 1 -> 1
+dqctm570 comparetotmag 1E+14 1 -> 1
+dqctm571 comparetotmag 1E+15 1 -> 1
+dqctm572 comparetotmag 1E+16 1 -> 1
+dqctm573 comparetotmag 1E+17 1 -> 1
+-- similar with a useful coefficient, one side only
+dqctm578 comparetotmag 0.000000987654321 1E-17 -> 1
+dqctm579 comparetotmag 0.000000987654321 1E-16 -> 1
+dqctm580 comparetotmag 0.000000987654321 1E-15 -> 1
+dqctm581 comparetotmag 0.000000987654321 1E-14 -> 1
+dqctm582 comparetotmag 0.000000987654321 1E-13 -> 1
+dqctm583 comparetotmag 0.000000987654321 1E-12 -> 1
+dqctm584 comparetotmag 0.000000987654321 1E-11 -> 1
+dqctm585 comparetotmag 0.000000987654321 1E-10 -> 1
+dqctm586 comparetotmag 0.000000987654321 1E-9 -> 1
+dqctm587 comparetotmag 0.000000987654321 1E-8 -> 1
+dqctm588 comparetotmag 0.000000987654321 1E-7 -> 1
+dqctm589 comparetotmag 0.000000987654321 1E-6 -> -1
+dqctm590 comparetotmag 0.000000987654321 1E-5 -> -1
+dqctm591 comparetotmag 0.000000987654321 1E-4 -> -1
+dqctm592 comparetotmag 0.000000987654321 1E-3 -> -1
+dqctm593 comparetotmag 0.000000987654321 1E-2 -> -1
+dqctm594 comparetotmag 0.000000987654321 1E-1 -> -1
+dqctm595 comparetotmag 0.000000987654321 1E-0 -> -1
+dqctm596 comparetotmag 0.000000987654321 1E+1 -> -1
+dqctm597 comparetotmag 0.000000987654321 1E+2 -> -1
+dqctm598 comparetotmag 0.000000987654321 1E+3 -> -1
+dqctm599 comparetotmag 0.000000987654321 1E+4 -> -1
+
+-- check some unit-y traps
+dqctm600 comparetotmag 12 12.2345 -> -1
+dqctm601 comparetotmag 12.0 12.2345 -> -1
+dqctm602 comparetotmag 12.00 12.2345 -> -1
+dqctm603 comparetotmag 12.000 12.2345 -> -1
+dqctm604 comparetotmag 12.0000 12.2345 -> -1
+dqctm605 comparetotmag 12.00000 12.2345 -> -1
+dqctm606 comparetotmag 12.000000 12.2345 -> -1
+dqctm607 comparetotmag 12.0000000 12.2345 -> -1
+dqctm608 comparetotmag 12.00000000 12.2345 -> -1
+dqctm609 comparetotmag 12.000000000 12.2345 -> -1
+dqctm610 comparetotmag 12.1234 12 -> 1
+dqctm611 comparetotmag 12.1234 12.0 -> 1
+dqctm612 comparetotmag 12.1234 12.00 -> 1
+dqctm613 comparetotmag 12.1234 12.000 -> 1
+dqctm614 comparetotmag 12.1234 12.0000 -> 1
+dqctm615 comparetotmag 12.1234 12.00000 -> 1
+dqctm616 comparetotmag 12.1234 12.000000 -> 1
+dqctm617 comparetotmag 12.1234 12.0000000 -> 1
+dqctm618 comparetotmag 12.1234 12.00000000 -> 1
+dqctm619 comparetotmag 12.1234 12.000000000 -> 1
+dqctm620 comparetotmag -12 -12.2345 -> -1
+dqctm621 comparetotmag -12.0 -12.2345 -> -1
+dqctm622 comparetotmag -12.00 -12.2345 -> -1
+dqctm623 comparetotmag -12.000 -12.2345 -> -1
+dqctm624 comparetotmag -12.0000 -12.2345 -> -1
+dqctm625 comparetotmag -12.00000 -12.2345 -> -1
+dqctm626 comparetotmag -12.000000 -12.2345 -> -1
+dqctm627 comparetotmag -12.0000000 -12.2345 -> -1
+dqctm628 comparetotmag -12.00000000 -12.2345 -> -1
+dqctm629 comparetotmag -12.000000000 -12.2345 -> -1
+dqctm630 comparetotmag -12.1234 -12 -> 1
+dqctm631 comparetotmag -12.1234 -12.0 -> 1
+dqctm632 comparetotmag -12.1234 -12.00 -> 1
+dqctm633 comparetotmag -12.1234 -12.000 -> 1
+dqctm634 comparetotmag -12.1234 -12.0000 -> 1
+dqctm635 comparetotmag -12.1234 -12.00000 -> 1
+dqctm636 comparetotmag -12.1234 -12.000000 -> 1
+dqctm637 comparetotmag -12.1234 -12.0000000 -> 1
+dqctm638 comparetotmag -12.1234 -12.00000000 -> 1
+dqctm639 comparetotmag -12.1234 -12.000000000 -> 1
+
+-- extended zeros
+dqctm640 comparetotmag 0 0 -> 0
+dqctm641 comparetotmag 0 -0 -> 0
+dqctm642 comparetotmag 0 -0.0 -> 1
+dqctm643 comparetotmag 0 0.0 -> 1
+dqctm644 comparetotmag -0 0 -> 0
+dqctm645 comparetotmag -0 -0 -> 0
+dqctm646 comparetotmag -0 -0.0 -> 1
+dqctm647 comparetotmag -0 0.0 -> 1
+dqctm648 comparetotmag 0.0 0 -> -1
+dqctm649 comparetotmag 0.0 -0 -> -1
+dqctm650 comparetotmag 0.0 -0.0 -> 0
+dqctm651 comparetotmag 0.0 0.0 -> 0
+dqctm652 comparetotmag -0.0 0 -> -1
+dqctm653 comparetotmag -0.0 -0 -> -1
+dqctm654 comparetotmag -0.0 -0.0 -> 0
+dqctm655 comparetotmag -0.0 0.0 -> 0
+
+dqctm656 comparetotmag -0E1 0.0 -> 1
+dqctm657 comparetotmag -0E2 0.0 -> 1
+dqctm658 comparetotmag 0E1 0.0 -> 1
+dqctm659 comparetotmag 0E2 0.0 -> 1
+dqctm660 comparetotmag -0E1 0 -> 1
+dqctm661 comparetotmag -0E2 0 -> 1
+dqctm662 comparetotmag 0E1 0 -> 1
+dqctm663 comparetotmag 0E2 0 -> 1
+dqctm664 comparetotmag -0E1 -0E1 -> 0
+dqctm665 comparetotmag -0E2 -0E1 -> 1
+dqctm666 comparetotmag 0E1 -0E1 -> 0
+dqctm667 comparetotmag 0E2 -0E1 -> 1
+dqctm668 comparetotmag -0E1 -0E2 -> -1
+dqctm669 comparetotmag -0E2 -0E2 -> 0
+dqctm670 comparetotmag 0E1 -0E2 -> -1
+dqctm671 comparetotmag 0E2 -0E2 -> 0
+dqctm672 comparetotmag -0E1 0E1 -> 0
+dqctm673 comparetotmag -0E2 0E1 -> 1
+dqctm674 comparetotmag 0E1 0E1 -> 0
+dqctm675 comparetotmag 0E2 0E1 -> 1
+dqctm676 comparetotmag -0E1 0E2 -> -1
+dqctm677 comparetotmag -0E2 0E2 -> 0
+dqctm678 comparetotmag 0E1 0E2 -> -1
+dqctm679 comparetotmag 0E2 0E2 -> 0
+
+-- trailing zeros; unit-y
+dqctm680 comparetotmag 12 12 -> 0
+dqctm681 comparetotmag 12 12.0 -> 1
+dqctm682 comparetotmag 12 12.00 -> 1
+dqctm683 comparetotmag 12 12.000 -> 1
+dqctm684 comparetotmag 12 12.0000 -> 1
+dqctm685 comparetotmag 12 12.00000 -> 1
+dqctm686 comparetotmag 12 12.000000 -> 1
+dqctm687 comparetotmag 12 12.0000000 -> 1
+dqctm688 comparetotmag 12 12.00000000 -> 1
+dqctm689 comparetotmag 12 12.000000000 -> 1
+dqctm690 comparetotmag 12 12 -> 0
+dqctm691 comparetotmag 12.0 12 -> -1
+dqctm692 comparetotmag 12.00 12 -> -1
+dqctm693 comparetotmag 12.000 12 -> -1
+dqctm694 comparetotmag 12.0000 12 -> -1
+dqctm695 comparetotmag 12.00000 12 -> -1
+dqctm696 comparetotmag 12.000000 12 -> -1
+dqctm697 comparetotmag 12.0000000 12 -> -1
+dqctm698 comparetotmag 12.00000000 12 -> -1
+dqctm699 comparetotmag 12.000000000 12 -> -1
+
+-- old long operand checks
+dqctm701 comparetotmag 12345678000 1 -> 1
+dqctm702 comparetotmag 1 12345678000 -> -1
+dqctm703 comparetotmag 1234567800 1 -> 1
+dqctm704 comparetotmag 1 1234567800 -> -1
+dqctm705 comparetotmag 1234567890 1 -> 1
+dqctm706 comparetotmag 1 1234567890 -> -1
+dqctm707 comparetotmag 1234567891 1 -> 1
+dqctm708 comparetotmag 1 1234567891 -> -1
+dqctm709 comparetotmag 12345678901 1 -> 1
+dqctm710 comparetotmag 1 12345678901 -> -1
+dqctm711 comparetotmag 1234567896 1 -> 1
+dqctm712 comparetotmag 1 1234567896 -> -1
+dqctm713 comparetotmag -1234567891 1 -> 1
+dqctm714 comparetotmag 1 -1234567891 -> -1
+dqctm715 comparetotmag -12345678901 1 -> 1
+dqctm716 comparetotmag 1 -12345678901 -> -1
+dqctm717 comparetotmag -1234567896 1 -> 1
+dqctm718 comparetotmag 1 -1234567896 -> -1
+
+-- old residue cases
+dqctm740 comparetotmag 1 0.9999999 -> 1
+dqctm741 comparetotmag 1 0.999999 -> 1
+dqctm742 comparetotmag 1 0.99999 -> 1
+dqctm743 comparetotmag 1 1.0000 -> 1
+dqctm744 comparetotmag 1 1.00001 -> -1
+dqctm745 comparetotmag 1 1.000001 -> -1
+dqctm746 comparetotmag 1 1.0000001 -> -1
+dqctm750 comparetotmag 0.9999999 1 -> -1
+dqctm751 comparetotmag 0.999999 1 -> -1
+dqctm752 comparetotmag 0.99999 1 -> -1
+dqctm753 comparetotmag 1.0000 1 -> -1
+dqctm754 comparetotmag 1.00001 1 -> 1
+dqctm755 comparetotmag 1.000001 1 -> 1
+dqctm756 comparetotmag 1.0000001 1 -> 1
+
+-- Specials
+dqctm780 comparetotmag Inf -Inf -> 0
+dqctm781 comparetotmag Inf -1000 -> 1
+dqctm782 comparetotmag Inf -1 -> 1
+dqctm783 comparetotmag Inf -0 -> 1
+dqctm784 comparetotmag Inf 0 -> 1
+dqctm785 comparetotmag Inf 1 -> 1
+dqctm786 comparetotmag Inf 1000 -> 1
+dqctm787 comparetotmag Inf Inf -> 0
+dqctm788 comparetotmag -1000 Inf -> -1
+dqctm789 comparetotmag -Inf Inf -> 0
+dqctm790 comparetotmag -1 Inf -> -1
+dqctm791 comparetotmag -0 Inf -> -1
+dqctm792 comparetotmag 0 Inf -> -1
+dqctm793 comparetotmag 1 Inf -> -1
+dqctm794 comparetotmag 1000 Inf -> -1
+dqctm795 comparetotmag Inf Inf -> 0
+
+dqctm800 comparetotmag -Inf -Inf -> 0
+dqctm801 comparetotmag -Inf -1000 -> 1
+dqctm802 comparetotmag -Inf -1 -> 1
+dqctm803 comparetotmag -Inf -0 -> 1
+dqctm804 comparetotmag -Inf 0 -> 1
+dqctm805 comparetotmag -Inf 1 -> 1
+dqctm806 comparetotmag -Inf 1000 -> 1
+dqctm807 comparetotmag -Inf Inf -> 0
+dqctm808 comparetotmag -Inf -Inf -> 0
+dqctm809 comparetotmag -1000 -Inf -> -1
+dqctm810 comparetotmag -1 -Inf -> -1
+dqctm811 comparetotmag -0 -Inf -> -1
+dqctm812 comparetotmag 0 -Inf -> -1
+dqctm813 comparetotmag 1 -Inf -> -1
+dqctm814 comparetotmag 1000 -Inf -> -1
+dqctm815 comparetotmag Inf -Inf -> 0
+
+dqctm821 comparetotmag NaN -Inf -> 1
+dqctm822 comparetotmag NaN -1000 -> 1
+dqctm823 comparetotmag NaN -1 -> 1
+dqctm824 comparetotmag NaN -0 -> 1
+dqctm825 comparetotmag NaN 0 -> 1
+dqctm826 comparetotmag NaN 1 -> 1
+dqctm827 comparetotmag NaN 1000 -> 1
+dqctm828 comparetotmag NaN Inf -> 1
+dqctm829 comparetotmag NaN NaN -> 0
+dqctm830 comparetotmag -Inf NaN -> -1
+dqctm831 comparetotmag -1000 NaN -> -1
+dqctm832 comparetotmag -1 NaN -> -1
+dqctm833 comparetotmag -0 NaN -> -1
+dqctm834 comparetotmag 0 NaN -> -1
+dqctm835 comparetotmag 1 NaN -> -1
+dqctm836 comparetotmag 1000 NaN -> -1
+dqctm837 comparetotmag Inf NaN -> -1
+dqctm838 comparetotmag -NaN -NaN -> 0
+dqctm839 comparetotmag +NaN -NaN -> 0
+dqctm840 comparetotmag -NaN +NaN -> 0
+
+dqctm841 comparetotmag sNaN -sNaN -> 0
+dqctm842 comparetotmag sNaN -NaN -> -1
+dqctm843 comparetotmag sNaN -Inf -> 1
+dqctm844 comparetotmag sNaN -1000 -> 1
+dqctm845 comparetotmag sNaN -1 -> 1
+dqctm846 comparetotmag sNaN -0 -> 1
+dqctm847 comparetotmag sNaN 0 -> 1
+dqctm848 comparetotmag sNaN 1 -> 1
+dqctm849 comparetotmag sNaN 1000 -> 1
+dqctm850 comparetotmag sNaN NaN -> -1
+dqctm851 comparetotmag sNaN sNaN -> 0
+
+dqctm852 comparetotmag -sNaN sNaN -> 0
+dqctm853 comparetotmag -NaN sNaN -> 1
+dqctm854 comparetotmag -Inf sNaN -> -1
+dqctm855 comparetotmag -1000 sNaN -> -1
+dqctm856 comparetotmag -1 sNaN -> -1
+dqctm857 comparetotmag -0 sNaN -> -1
+dqctm858 comparetotmag 0 sNaN -> -1
+dqctm859 comparetotmag 1 sNaN -> -1
+dqctm860 comparetotmag 1000 sNaN -> -1
+dqctm861 comparetotmag Inf sNaN -> -1
+dqctm862 comparetotmag NaN sNaN -> 1
+dqctm863 comparetotmag sNaN sNaN -> 0
+
+dqctm871 comparetotmag -sNaN -sNaN -> 0
+dqctm872 comparetotmag -sNaN -NaN -> -1
+dqctm873 comparetotmag -sNaN -Inf -> 1
+dqctm874 comparetotmag -sNaN -1000 -> 1
+dqctm875 comparetotmag -sNaN -1 -> 1
+dqctm876 comparetotmag -sNaN -0 -> 1
+dqctm877 comparetotmag -sNaN 0 -> 1
+dqctm878 comparetotmag -sNaN 1 -> 1
+dqctm879 comparetotmag -sNaN 1000 -> 1
+dqctm880 comparetotmag -sNaN NaN -> -1
+dqctm881 comparetotmag -sNaN sNaN -> 0
+
+dqctm882 comparetotmag -sNaN -sNaN -> 0
+dqctm883 comparetotmag -NaN -sNaN -> 1
+dqctm884 comparetotmag -Inf -sNaN -> -1
+dqctm885 comparetotmag -1000 -sNaN -> -1
+dqctm886 comparetotmag -1 -sNaN -> -1
+dqctm887 comparetotmag -0 -sNaN -> -1
+dqctm888 comparetotmag 0 -sNaN -> -1
+dqctm889 comparetotmag 1 -sNaN -> -1
+dqctm890 comparetotmag 1000 -sNaN -> -1
+dqctm891 comparetotmag Inf -sNaN -> -1
+dqctm892 comparetotmag NaN -sNaN -> 1
+dqctm893 comparetotmag sNaN -sNaN -> 0
+
+-- NaNs with payload
+dqctm960 comparetotmag NaN9 -Inf -> 1
+dqctm961 comparetotmag NaN8 999 -> 1
+dqctm962 comparetotmag NaN77 Inf -> 1
+dqctm963 comparetotmag -NaN67 NaN5 -> 1
+dqctm964 comparetotmag -Inf -NaN4 -> -1
+dqctm965 comparetotmag -999 -NaN33 -> -1
+dqctm966 comparetotmag Inf NaN2 -> -1
+
+dqctm970 comparetotmag -NaN41 -NaN42 -> -1
+dqctm971 comparetotmag +NaN41 -NaN42 -> -1
+dqctm972 comparetotmag -NaN41 +NaN42 -> -1
+dqctm973 comparetotmag +NaN41 +NaN42 -> -1
+dqctm974 comparetotmag -NaN42 -NaN01 -> 1
+dqctm975 comparetotmag +NaN42 -NaN01 -> 1
+dqctm976 comparetotmag -NaN42 +NaN01 -> 1
+dqctm977 comparetotmag +NaN42 +NaN01 -> 1
+
+dqctm980 comparetotmag -sNaN771 -sNaN772 -> -1
+dqctm981 comparetotmag +sNaN771 -sNaN772 -> -1
+dqctm982 comparetotmag -sNaN771 +sNaN772 -> -1
+dqctm983 comparetotmag +sNaN771 +sNaN772 -> -1
+dqctm984 comparetotmag -sNaN772 -sNaN771 -> 1
+dqctm985 comparetotmag +sNaN772 -sNaN771 -> 1
+dqctm986 comparetotmag -sNaN772 +sNaN771 -> 1
+dqctm987 comparetotmag +sNaN772 +sNaN771 -> 1
+
+dqctm991 comparetotmag -sNaN99 -Inf -> 1
+dqctm992 comparetotmag sNaN98 -11 -> 1
+dqctm993 comparetotmag sNaN97 NaN -> -1
+dqctm994 comparetotmag sNaN16 sNaN94 -> -1
+dqctm995 comparetotmag NaN85 sNaN83 -> 1
+dqctm996 comparetotmag -Inf sNaN92 -> -1
+dqctm997 comparetotmag 088 sNaN81 -> -1
+dqctm998 comparetotmag Inf sNaN90 -> -1
+dqctm999 comparetotmag NaN -sNaN89 -> 1
+
+-- spread zeros
+dqctm1110 comparetotmag 0E-6143 0 -> -1
+dqctm1111 comparetotmag 0E-6143 -0 -> -1
+dqctm1112 comparetotmag -0E-6143 0 -> -1
+dqctm1113 comparetotmag -0E-6143 -0 -> -1
+dqctm1114 comparetotmag 0E-6143 0E+6144 -> -1
+dqctm1115 comparetotmag 0E-6143 -0E+6144 -> -1
+dqctm1116 comparetotmag -0E-6143 0E+6144 -> -1
+dqctm1117 comparetotmag -0E-6143 -0E+6144 -> -1
+dqctm1118 comparetotmag 0 0E+6144 -> -1
+dqctm1119 comparetotmag 0 -0E+6144 -> -1
+dqctm1120 comparetotmag -0 0E+6144 -> -1
+dqctm1121 comparetotmag -0 -0E+6144 -> -1
+
+dqctm1130 comparetotmag 0E+6144 0 -> 1
+dqctm1131 comparetotmag 0E+6144 -0 -> 1
+dqctm1132 comparetotmag -0E+6144 0 -> 1
+dqctm1133 comparetotmag -0E+6144 -0 -> 1
+dqctm1134 comparetotmag 0E+6144 0E-6143 -> 1
+dqctm1135 comparetotmag 0E+6144 -0E-6143 -> 1
+dqctm1136 comparetotmag -0E+6144 0E-6143 -> 1
+dqctm1137 comparetotmag -0E+6144 -0E-6143 -> 1
+dqctm1138 comparetotmag 0 0E-6143 -> 1
+dqctm1139 comparetotmag 0 -0E-6143 -> 1
+dqctm1140 comparetotmag -0 0E-6143 -> 1
+dqctm1141 comparetotmag -0 -0E-6143 -> 1
+
+-- Null tests
+dqctm9990 comparetotmag 10 # -> NaN Invalid_operation
+dqctm9991 comparetotmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqCopy.decTest b/Lib/test/decimaltestdata/dqCopy.decTest
index 7254d68bb7..0c6243158f 100644
--- a/Lib/test/decimaltestdata/dqCopy.decTest
+++ b/Lib/test/decimaltestdata/dqCopy.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqCopy.decTest -- quiet decQuad copy --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqcpy001 copy +7.50 -> 7.50
-
--- Infinities
-dqcpy011 copy Infinity -> Infinity
-dqcpy012 copy -Infinity -> -Infinity
-
--- NaNs, 0 payload
-dqcpy021 copy NaN -> NaN
-dqcpy022 copy -NaN -> -NaN
-dqcpy023 copy sNaN -> sNaN
-dqcpy024 copy -sNaN -> -sNaN
-
--- NaNs, non-0 payload
-dqcpy031 copy NaN10 -> NaN10
-dqcpy032 copy -NaN10 -> -NaN10
-dqcpy033 copy sNaN10 -> sNaN10
-dqcpy034 copy -sNaN10 -> -sNaN10
-dqcpy035 copy NaN7 -> NaN7
-dqcpy036 copy -NaN7 -> -NaN7
-dqcpy037 copy sNaN101 -> sNaN101
-dqcpy038 copy -sNaN101 -> -sNaN101
-
--- finites
-dqcpy101 copy 7 -> 7
-dqcpy102 copy -7 -> -7
-dqcpy103 copy 75 -> 75
-dqcpy104 copy -75 -> -75
-dqcpy105 copy 7.50 -> 7.50
-dqcpy106 copy -7.50 -> -7.50
-dqcpy107 copy 7.500 -> 7.500
-dqcpy108 copy -7.500 -> -7.500
-
--- zeros
-dqcpy111 copy 0 -> 0
-dqcpy112 copy -0 -> -0
-dqcpy113 copy 0E+4 -> 0E+4
-dqcpy114 copy -0E+4 -> -0E+4
-dqcpy115 copy 0.0000 -> 0.0000
-dqcpy116 copy -0.0000 -> -0.0000
-dqcpy117 copy 0E-141 -> 0E-141
-dqcpy118 copy -0E-141 -> -0E-141
-
--- full coefficients, alternating bits
-dqcpy121 copy 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqcpy122 copy -2682682682682682682682682682682682 -> -2682682682682682682682682682682682
-dqcpy123 copy 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-dqcpy124 copy -1341341341341341341341341341341341 -> -1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcpy131 copy 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqcpy132 copy 1E-6143 -> 1E-6143
-dqcpy133 copy 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqcpy134 copy 1E-6176 -> 1E-6176
-
-dqcpy135 copy -1E-6176 -> -1E-6176
-dqcpy136 copy -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqcpy137 copy -1E-6143 -> -1E-6143
-dqcpy138 copy -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqCopy.decTest -- quiet decQuad copy --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqcpy001 copy +7.50 -> 7.50
+
+-- Infinities
+dqcpy011 copy Infinity -> Infinity
+dqcpy012 copy -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+dqcpy021 copy NaN -> NaN
+dqcpy022 copy -NaN -> -NaN
+dqcpy023 copy sNaN -> sNaN
+dqcpy024 copy -sNaN -> -sNaN
+
+-- NaNs, non-0 payload
+dqcpy031 copy NaN10 -> NaN10
+dqcpy032 copy -NaN10 -> -NaN10
+dqcpy033 copy sNaN10 -> sNaN10
+dqcpy034 copy -sNaN10 -> -sNaN10
+dqcpy035 copy NaN7 -> NaN7
+dqcpy036 copy -NaN7 -> -NaN7
+dqcpy037 copy sNaN101 -> sNaN101
+dqcpy038 copy -sNaN101 -> -sNaN101
+
+-- finites
+dqcpy101 copy 7 -> 7
+dqcpy102 copy -7 -> -7
+dqcpy103 copy 75 -> 75
+dqcpy104 copy -75 -> -75
+dqcpy105 copy 7.50 -> 7.50
+dqcpy106 copy -7.50 -> -7.50
+dqcpy107 copy 7.500 -> 7.500
+dqcpy108 copy -7.500 -> -7.500
+
+-- zeros
+dqcpy111 copy 0 -> 0
+dqcpy112 copy -0 -> -0
+dqcpy113 copy 0E+4 -> 0E+4
+dqcpy114 copy -0E+4 -> -0E+4
+dqcpy115 copy 0.0000 -> 0.0000
+dqcpy116 copy -0.0000 -> -0.0000
+dqcpy117 copy 0E-141 -> 0E-141
+dqcpy118 copy -0E-141 -> -0E-141
+
+-- full coefficients, alternating bits
+dqcpy121 copy 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqcpy122 copy -2682682682682682682682682682682682 -> -2682682682682682682682682682682682
+dqcpy123 copy 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+dqcpy124 copy -1341341341341341341341341341341341 -> -1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcpy131 copy 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqcpy132 copy 1E-6143 -> 1E-6143
+dqcpy133 copy 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqcpy134 copy 1E-6176 -> 1E-6176
+
+dqcpy135 copy -1E-6176 -> -1E-6176
+dqcpy136 copy -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqcpy137 copy -1E-6143 -> -1E-6143
+dqcpy138 copy -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqCopyAbs.decTest b/Lib/test/decimaltestdata/dqCopyAbs.decTest
index bdec0206de..16bcb4eaed 100644
--- a/Lib/test/decimaltestdata/dqCopyAbs.decTest
+++ b/Lib/test/decimaltestdata/dqCopyAbs.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqCopyAbs.decTest -- quiet decQuad copy and set sign to zero --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqcpa001 copyabs +7.50 -> 7.50
-
--- Infinities
-dqcpa011 copyabs Infinity -> Infinity
-dqcpa012 copyabs -Infinity -> Infinity
-
--- NaNs, 0 payload
-dqcpa021 copyabs NaN -> NaN
-dqcpa022 copyabs -NaN -> NaN
-dqcpa023 copyabs sNaN -> sNaN
-dqcpa024 copyabs -sNaN -> sNaN
-
--- NaNs, non-0 payload
-dqcpa031 copyabs NaN10 -> NaN10
-dqcpa032 copyabs -NaN15 -> NaN15
-dqcpa033 copyabs sNaN15 -> sNaN15
-dqcpa034 copyabs -sNaN10 -> sNaN10
-dqcpa035 copyabs NaN7 -> NaN7
-dqcpa036 copyabs -NaN7 -> NaN7
-dqcpa037 copyabs sNaN101 -> sNaN101
-dqcpa038 copyabs -sNaN101 -> sNaN101
-
--- finites
-dqcpa101 copyabs 7 -> 7
-dqcpa102 copyabs -7 -> 7
-dqcpa103 copyabs 75 -> 75
-dqcpa104 copyabs -75 -> 75
-dqcpa105 copyabs 7.10 -> 7.10
-dqcpa106 copyabs -7.10 -> 7.10
-dqcpa107 copyabs 7.500 -> 7.500
-dqcpa108 copyabs -7.500 -> 7.500
-
--- zeros
-dqcpa111 copyabs 0 -> 0
-dqcpa112 copyabs -0 -> 0
-dqcpa113 copyabs 0E+6 -> 0E+6
-dqcpa114 copyabs -0E+6 -> 0E+6
-dqcpa115 copyabs 0.0000 -> 0.0000
-dqcpa116 copyabs -0.0000 -> 0.0000
-dqcpa117 copyabs 0E-141 -> 0E-141
-dqcpa118 copyabs -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqcpa121 copyabs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqcpa122 copyabs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqcpa123 copyabs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-dqcpa124 copyabs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcpa131 copyabs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqcpa132 copyabs 1E-6143 -> 1E-6143
-dqcpa133 copyabs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqcpa134 copyabs 1E-6176 -> 1E-6176
-
-dqcpa135 copyabs -1E-6176 -> 1E-6176
-dqcpa136 copyabs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqcpa137 copyabs -1E-6143 -> 1E-6143
-dqcpa138 copyabs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqCopyAbs.decTest -- quiet decQuad copy and set sign to zero --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqcpa001 copyabs +7.50 -> 7.50
+
+-- Infinities
+dqcpa011 copyabs Infinity -> Infinity
+dqcpa012 copyabs -Infinity -> Infinity
+
+-- NaNs, 0 payload
+dqcpa021 copyabs NaN -> NaN
+dqcpa022 copyabs -NaN -> NaN
+dqcpa023 copyabs sNaN -> sNaN
+dqcpa024 copyabs -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+dqcpa031 copyabs NaN10 -> NaN10
+dqcpa032 copyabs -NaN15 -> NaN15
+dqcpa033 copyabs sNaN15 -> sNaN15
+dqcpa034 copyabs -sNaN10 -> sNaN10
+dqcpa035 copyabs NaN7 -> NaN7
+dqcpa036 copyabs -NaN7 -> NaN7
+dqcpa037 copyabs sNaN101 -> sNaN101
+dqcpa038 copyabs -sNaN101 -> sNaN101
+
+-- finites
+dqcpa101 copyabs 7 -> 7
+dqcpa102 copyabs -7 -> 7
+dqcpa103 copyabs 75 -> 75
+dqcpa104 copyabs -75 -> 75
+dqcpa105 copyabs 7.10 -> 7.10
+dqcpa106 copyabs -7.10 -> 7.10
+dqcpa107 copyabs 7.500 -> 7.500
+dqcpa108 copyabs -7.500 -> 7.500
+
+-- zeros
+dqcpa111 copyabs 0 -> 0
+dqcpa112 copyabs -0 -> 0
+dqcpa113 copyabs 0E+6 -> 0E+6
+dqcpa114 copyabs -0E+6 -> 0E+6
+dqcpa115 copyabs 0.0000 -> 0.0000
+dqcpa116 copyabs -0.0000 -> 0.0000
+dqcpa117 copyabs 0E-141 -> 0E-141
+dqcpa118 copyabs -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqcpa121 copyabs 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqcpa122 copyabs -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqcpa123 copyabs 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+dqcpa124 copyabs -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcpa131 copyabs 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqcpa132 copyabs 1E-6143 -> 1E-6143
+dqcpa133 copyabs 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqcpa134 copyabs 1E-6176 -> 1E-6176
+
+dqcpa135 copyabs -1E-6176 -> 1E-6176
+dqcpa136 copyabs -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqcpa137 copyabs -1E-6143 -> 1E-6143
+dqcpa138 copyabs -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqCopyNegate.decTest b/Lib/test/decimaltestdata/dqCopyNegate.decTest
index ea00855772..6253f5a355 100644
--- a/Lib/test/decimaltestdata/dqCopyNegate.decTest
+++ b/Lib/test/decimaltestdata/dqCopyNegate.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqCopyNegate.decTest -- quiet decQuad copy and negate --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqcpn001 copynegate +7.50 -> -7.50
-
--- Infinities
-dqcpn011 copynegate Infinity -> -Infinity
-dqcpn012 copynegate -Infinity -> Infinity
-
--- NaNs, 0 payload
-dqcpn021 copynegate NaN -> -NaN
-dqcpn022 copynegate -NaN -> NaN
-dqcpn023 copynegate sNaN -> -sNaN
-dqcpn024 copynegate -sNaN -> sNaN
-
--- NaNs, non-0 payload
-dqcpn031 copynegate NaN13 -> -NaN13
-dqcpn032 copynegate -NaN13 -> NaN13
-dqcpn033 copynegate sNaN13 -> -sNaN13
-dqcpn034 copynegate -sNaN13 -> sNaN13
-dqcpn035 copynegate NaN70 -> -NaN70
-dqcpn036 copynegate -NaN70 -> NaN70
-dqcpn037 copynegate sNaN101 -> -sNaN101
-dqcpn038 copynegate -sNaN101 -> sNaN101
-
--- finites
-dqcpn101 copynegate 7 -> -7
-dqcpn102 copynegate -7 -> 7
-dqcpn103 copynegate 75 -> -75
-dqcpn104 copynegate -75 -> 75
-dqcpn105 copynegate 7.50 -> -7.50
-dqcpn106 copynegate -7.50 -> 7.50
-dqcpn107 copynegate 7.500 -> -7.500
-dqcpn108 copynegate -7.500 -> 7.500
-
--- zeros
-dqcpn111 copynegate 0 -> -0
-dqcpn112 copynegate -0 -> 0
-dqcpn113 copynegate 0E+4 -> -0E+4
-dqcpn114 copynegate -0E+4 -> 0E+4
-dqcpn115 copynegate 0.0000 -> -0.0000
-dqcpn116 copynegate -0.0000 -> 0.0000
-dqcpn117 copynegate 0E-141 -> -0E-141
-dqcpn118 copynegate -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqcpn121 copynegate 2682682682682682682682682682682682 -> -2682682682682682682682682682682682
-dqcpn122 copynegate -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqcpn123 copynegate 1341341341341341341341341341341341 -> -1341341341341341341341341341341341
-dqcpn124 copynegate -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcpn131 copynegate 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqcpn132 copynegate 1E-6143 -> -1E-6143
-dqcpn133 copynegate 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqcpn134 copynegate 1E-6176 -> -1E-6176
-
-dqcpn135 copynegate -1E-6176 -> 1E-6176
-dqcpn136 copynegate -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqcpn137 copynegate -1E-6143 -> 1E-6143
-dqcpn138 copynegate -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqCopyNegate.decTest -- quiet decQuad copy and negate --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqcpn001 copynegate +7.50 -> -7.50
+
+-- Infinities
+dqcpn011 copynegate Infinity -> -Infinity
+dqcpn012 copynegate -Infinity -> Infinity
+
+-- NaNs, 0 payload
+dqcpn021 copynegate NaN -> -NaN
+dqcpn022 copynegate -NaN -> NaN
+dqcpn023 copynegate sNaN -> -sNaN
+dqcpn024 copynegate -sNaN -> sNaN
+
+-- NaNs, non-0 payload
+dqcpn031 copynegate NaN13 -> -NaN13
+dqcpn032 copynegate -NaN13 -> NaN13
+dqcpn033 copynegate sNaN13 -> -sNaN13
+dqcpn034 copynegate -sNaN13 -> sNaN13
+dqcpn035 copynegate NaN70 -> -NaN70
+dqcpn036 copynegate -NaN70 -> NaN70
+dqcpn037 copynegate sNaN101 -> -sNaN101
+dqcpn038 copynegate -sNaN101 -> sNaN101
+
+-- finites
+dqcpn101 copynegate 7 -> -7
+dqcpn102 copynegate -7 -> 7
+dqcpn103 copynegate 75 -> -75
+dqcpn104 copynegate -75 -> 75
+dqcpn105 copynegate 7.50 -> -7.50
+dqcpn106 copynegate -7.50 -> 7.50
+dqcpn107 copynegate 7.500 -> -7.500
+dqcpn108 copynegate -7.500 -> 7.500
+
+-- zeros
+dqcpn111 copynegate 0 -> -0
+dqcpn112 copynegate -0 -> 0
+dqcpn113 copynegate 0E+4 -> -0E+4
+dqcpn114 copynegate -0E+4 -> 0E+4
+dqcpn115 copynegate 0.0000 -> -0.0000
+dqcpn116 copynegate -0.0000 -> 0.0000
+dqcpn117 copynegate 0E-141 -> -0E-141
+dqcpn118 copynegate -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqcpn121 copynegate 2682682682682682682682682682682682 -> -2682682682682682682682682682682682
+dqcpn122 copynegate -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqcpn123 copynegate 1341341341341341341341341341341341 -> -1341341341341341341341341341341341
+dqcpn124 copynegate -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcpn131 copynegate 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqcpn132 copynegate 1E-6143 -> -1E-6143
+dqcpn133 copynegate 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqcpn134 copynegate 1E-6176 -> -1E-6176
+
+dqcpn135 copynegate -1E-6176 -> 1E-6176
+dqcpn136 copynegate -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqcpn137 copynegate -1E-6143 -> 1E-6143
+dqcpn138 copynegate -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqCopySign.decTest b/Lib/test/decimaltestdata/dqCopySign.decTest
index ce794b7c35..97b5e6e955 100644
--- a/Lib/test/decimaltestdata/dqCopySign.decTest
+++ b/Lib/test/decimaltestdata/dqCopySign.decTest
@@ -1,175 +1,175 @@
-------------------------------------------------------------------------
--- dqCopySign.decTest -- quiet decQuad copy with sign from rhs --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqcps001 copysign +7.50 11 -> 7.50
-
--- Infinities
-dqcps011 copysign Infinity 11 -> Infinity
-dqcps012 copysign -Infinity 11 -> Infinity
-
--- NaNs, 0 payload
-dqcps021 copysign NaN 11 -> NaN
-dqcps022 copysign -NaN 11 -> NaN
-dqcps023 copysign sNaN 11 -> sNaN
-dqcps024 copysign -sNaN 11 -> sNaN
-
--- NaNs, non-0 payload
-dqcps031 copysign NaN10 11 -> NaN10
-dqcps032 copysign -NaN10 11 -> NaN10
-dqcps033 copysign sNaN10 11 -> sNaN10
-dqcps034 copysign -sNaN10 11 -> sNaN10
-dqcps035 copysign NaN7 11 -> NaN7
-dqcps036 copysign -NaN7 11 -> NaN7
-dqcps037 copysign sNaN101 11 -> sNaN101
-dqcps038 copysign -sNaN101 11 -> sNaN101
-
--- finites
-dqcps101 copysign 7 11 -> 7
-dqcps102 copysign -7 11 -> 7
-dqcps103 copysign 75 11 -> 75
-dqcps104 copysign -75 11 -> 75
-dqcps105 copysign 7.50 11 -> 7.50
-dqcps106 copysign -7.50 11 -> 7.50
-dqcps107 copysign 7.500 11 -> 7.500
-dqcps108 copysign -7.500 11 -> 7.500
-
--- zeros
-dqcps111 copysign 0 11 -> 0
-dqcps112 copysign -0 11 -> 0
-dqcps113 copysign 0E+4 11 -> 0E+4
-dqcps114 copysign -0E+4 11 -> 0E+4
-dqcps115 copysign 0.0000 11 -> 0.0000
-dqcps116 copysign -0.0000 11 -> 0.0000
-dqcps117 copysign 0E-141 11 -> 0E-141
-dqcps118 copysign -0E-141 11 -> 0E-141
-
--- full coefficients, alternating bits
-dqcps121 copysign 2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682
-dqcps122 copysign -2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682
-dqcps123 copysign 1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341
-dqcps124 copysign -1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcps131 copysign 9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144
-dqcps132 copysign 1E-6143 8 -> 1E-6143
-dqcps133 copysign 1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143
-dqcps134 copysign 1E-6176 8 -> 1E-6176
-
-dqcps135 copysign -1E-6176 8 -> 1E-6176
-dqcps136 copysign -1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143
-dqcps137 copysign -1E-6143 8 -> 1E-6143
-dqcps138 copysign -9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144
-
--- repeat with negative RHS
-
--- Infinities
-dqcps211 copysign Infinity -34 -> -Infinity
-dqcps212 copysign -Infinity -34 -> -Infinity
-
--- NaNs, 0 payload
-dqcps221 copysign NaN -34 -> -NaN
-dqcps222 copysign -NaN -34 -> -NaN
-dqcps223 copysign sNaN -34 -> -sNaN
-dqcps224 copysign -sNaN -34 -> -sNaN
-
--- NaNs, non-0 payload
-dqcps231 copysign NaN10 -34 -> -NaN10
-dqcps232 copysign -NaN10 -34 -> -NaN10
-dqcps233 copysign sNaN10 -34 -> -sNaN10
-dqcps234 copysign -sNaN10 -34 -> -sNaN10
-dqcps235 copysign NaN7 -34 -> -NaN7
-dqcps236 copysign -NaN7 -34 -> -NaN7
-dqcps237 copysign sNaN101 -34 -> -sNaN101
-dqcps238 copysign -sNaN101 -34 -> -sNaN101
-
--- finites
-dqcps301 copysign 7 -34 -> -7
-dqcps302 copysign -7 -34 -> -7
-dqcps303 copysign 75 -34 -> -75
-dqcps304 copysign -75 -34 -> -75
-dqcps305 copysign 7.50 -34 -> -7.50
-dqcps306 copysign -7.50 -34 -> -7.50
-dqcps307 copysign 7.500 -34 -> -7.500
-dqcps308 copysign -7.500 -34 -> -7.500
-
--- zeros
-dqcps311 copysign 0 -34 -> -0
-dqcps312 copysign -0 -34 -> -0
-dqcps313 copysign 0E+4 -34 -> -0E+4
-dqcps314 copysign -0E+4 -34 -> -0E+4
-dqcps315 copysign 0.0000 -34 -> -0.0000
-dqcps316 copysign -0.0000 -34 -> -0.0000
-dqcps317 copysign 0E-141 -34 -> -0E-141
-dqcps318 copysign -0E-141 -34 -> -0E-141
-
--- full coefficients, alternating bits
-dqcps321 copysign 2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
-dqcps322 copysign -2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
-dqcps323 copysign 1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
-dqcps324 copysign -1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqcps331 copysign 9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144
-dqcps332 copysign 1E-6143 -1 -> -1E-6143
-dqcps333 copysign 1.000000000000000000000000000000000E-6143 -1 -> -1.000000000000000000000000000000000E-6143
-dqcps334 copysign 1E-6176 -1 -> -1E-6176
-
-dqcps335 copysign -1E-6176 -3 -> -1E-6176
-dqcps336 copysign -1.000000000000000000000000000000000E-6143 -3 -> -1.000000000000000000000000000000000E-6143
-dqcps337 copysign -1E-6143 -3 -> -1E-6143
-dqcps338 copysign -9.999999999999999999999999999999999E+6144 -3 -> -9.999999999999999999999999999999999E+6144
-
--- Other kinds of RHS
-dqcps401 copysign 701 -34 -> -701
-dqcps402 copysign -720 -34 -> -720
-dqcps403 copysign 701 -0 -> -701
-dqcps404 copysign -720 -0 -> -720
-dqcps405 copysign 701 +0 -> 701
-dqcps406 copysign -720 +0 -> 720
-dqcps407 copysign 701 +34 -> 701
-dqcps408 copysign -720 +34 -> 720
-
-dqcps413 copysign 701 -Inf -> -701
-dqcps414 copysign -720 -Inf -> -720
-dqcps415 copysign 701 +Inf -> 701
-dqcps416 copysign -720 +Inf -> 720
-
-dqcps420 copysign 701 -NaN -> -701
-dqcps421 copysign -720 -NaN -> -720
-dqcps422 copysign 701 +NaN -> 701
-dqcps423 copysign -720 +NaN -> 720
-dqcps425 copysign -720 +NaN8 -> 720
-
-dqcps426 copysign 701 -sNaN -> -701
-dqcps427 copysign -720 -sNaN -> -720
-dqcps428 copysign 701 +sNaN -> 701
-dqcps429 copysign -720 +sNaN -> 720
-dqcps430 copysign -720 +sNaN3 -> 720
-
+------------------------------------------------------------------------
+-- dqCopySign.decTest -- quiet decQuad copy with sign from rhs --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqcps001 copysign +7.50 11 -> 7.50
+
+-- Infinities
+dqcps011 copysign Infinity 11 -> Infinity
+dqcps012 copysign -Infinity 11 -> Infinity
+
+-- NaNs, 0 payload
+dqcps021 copysign NaN 11 -> NaN
+dqcps022 copysign -NaN 11 -> NaN
+dqcps023 copysign sNaN 11 -> sNaN
+dqcps024 copysign -sNaN 11 -> sNaN
+
+-- NaNs, non-0 payload
+dqcps031 copysign NaN10 11 -> NaN10
+dqcps032 copysign -NaN10 11 -> NaN10
+dqcps033 copysign sNaN10 11 -> sNaN10
+dqcps034 copysign -sNaN10 11 -> sNaN10
+dqcps035 copysign NaN7 11 -> NaN7
+dqcps036 copysign -NaN7 11 -> NaN7
+dqcps037 copysign sNaN101 11 -> sNaN101
+dqcps038 copysign -sNaN101 11 -> sNaN101
+
+-- finites
+dqcps101 copysign 7 11 -> 7
+dqcps102 copysign -7 11 -> 7
+dqcps103 copysign 75 11 -> 75
+dqcps104 copysign -75 11 -> 75
+dqcps105 copysign 7.50 11 -> 7.50
+dqcps106 copysign -7.50 11 -> 7.50
+dqcps107 copysign 7.500 11 -> 7.500
+dqcps108 copysign -7.500 11 -> 7.500
+
+-- zeros
+dqcps111 copysign 0 11 -> 0
+dqcps112 copysign -0 11 -> 0
+dqcps113 copysign 0E+4 11 -> 0E+4
+dqcps114 copysign -0E+4 11 -> 0E+4
+dqcps115 copysign 0.0000 11 -> 0.0000
+dqcps116 copysign -0.0000 11 -> 0.0000
+dqcps117 copysign 0E-141 11 -> 0E-141
+dqcps118 copysign -0E-141 11 -> 0E-141
+
+-- full coefficients, alternating bits
+dqcps121 copysign 2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682
+dqcps122 copysign -2682682682682682682682682682682682 8 -> 2682682682682682682682682682682682
+dqcps123 copysign 1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341
+dqcps124 copysign -1341341341341341341341341341341341 8 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcps131 copysign 9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144
+dqcps132 copysign 1E-6143 8 -> 1E-6143
+dqcps133 copysign 1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143
+dqcps134 copysign 1E-6176 8 -> 1E-6176
+
+dqcps135 copysign -1E-6176 8 -> 1E-6176
+dqcps136 copysign -1.000000000000000000000000000000000E-6143 8 -> 1.000000000000000000000000000000000E-6143
+dqcps137 copysign -1E-6143 8 -> 1E-6143
+dqcps138 copysign -9.999999999999999999999999999999999E+6144 8 -> 9.999999999999999999999999999999999E+6144
+
+-- repeat with negative RHS
+
+-- Infinities
+dqcps211 copysign Infinity -34 -> -Infinity
+dqcps212 copysign -Infinity -34 -> -Infinity
+
+-- NaNs, 0 payload
+dqcps221 copysign NaN -34 -> -NaN
+dqcps222 copysign -NaN -34 -> -NaN
+dqcps223 copysign sNaN -34 -> -sNaN
+dqcps224 copysign -sNaN -34 -> -sNaN
+
+-- NaNs, non-0 payload
+dqcps231 copysign NaN10 -34 -> -NaN10
+dqcps232 copysign -NaN10 -34 -> -NaN10
+dqcps233 copysign sNaN10 -34 -> -sNaN10
+dqcps234 copysign -sNaN10 -34 -> -sNaN10
+dqcps235 copysign NaN7 -34 -> -NaN7
+dqcps236 copysign -NaN7 -34 -> -NaN7
+dqcps237 copysign sNaN101 -34 -> -sNaN101
+dqcps238 copysign -sNaN101 -34 -> -sNaN101
+
+-- finites
+dqcps301 copysign 7 -34 -> -7
+dqcps302 copysign -7 -34 -> -7
+dqcps303 copysign 75 -34 -> -75
+dqcps304 copysign -75 -34 -> -75
+dqcps305 copysign 7.50 -34 -> -7.50
+dqcps306 copysign -7.50 -34 -> -7.50
+dqcps307 copysign 7.500 -34 -> -7.500
+dqcps308 copysign -7.500 -34 -> -7.500
+
+-- zeros
+dqcps311 copysign 0 -34 -> -0
+dqcps312 copysign -0 -34 -> -0
+dqcps313 copysign 0E+4 -34 -> -0E+4
+dqcps314 copysign -0E+4 -34 -> -0E+4
+dqcps315 copysign 0.0000 -34 -> -0.0000
+dqcps316 copysign -0.0000 -34 -> -0.0000
+dqcps317 copysign 0E-141 -34 -> -0E-141
+dqcps318 copysign -0E-141 -34 -> -0E-141
+
+-- full coefficients, alternating bits
+dqcps321 copysign 2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
+dqcps322 copysign -2682682682682682682682682682682682 -9 -> -2682682682682682682682682682682682
+dqcps323 copysign 1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
+dqcps324 copysign -1341341341341341341341341341341341 -9 -> -1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqcps331 copysign 9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144
+dqcps332 copysign 1E-6143 -1 -> -1E-6143
+dqcps333 copysign 1.000000000000000000000000000000000E-6143 -1 -> -1.000000000000000000000000000000000E-6143
+dqcps334 copysign 1E-6176 -1 -> -1E-6176
+
+dqcps335 copysign -1E-6176 -3 -> -1E-6176
+dqcps336 copysign -1.000000000000000000000000000000000E-6143 -3 -> -1.000000000000000000000000000000000E-6143
+dqcps337 copysign -1E-6143 -3 -> -1E-6143
+dqcps338 copysign -9.999999999999999999999999999999999E+6144 -3 -> -9.999999999999999999999999999999999E+6144
+
+-- Other kinds of RHS
+dqcps401 copysign 701 -34 -> -701
+dqcps402 copysign -720 -34 -> -720
+dqcps403 copysign 701 -0 -> -701
+dqcps404 copysign -720 -0 -> -720
+dqcps405 copysign 701 +0 -> 701
+dqcps406 copysign -720 +0 -> 720
+dqcps407 copysign 701 +34 -> 701
+dqcps408 copysign -720 +34 -> 720
+
+dqcps413 copysign 701 -Inf -> -701
+dqcps414 copysign -720 -Inf -> -720
+dqcps415 copysign 701 +Inf -> 701
+dqcps416 copysign -720 +Inf -> 720
+
+dqcps420 copysign 701 -NaN -> -701
+dqcps421 copysign -720 -NaN -> -720
+dqcps422 copysign 701 +NaN -> 701
+dqcps423 copysign -720 +NaN -> 720
+dqcps425 copysign -720 +NaN8 -> 720
+
+dqcps426 copysign 701 -sNaN -> -701
+dqcps427 copysign -720 -sNaN -> -720
+dqcps428 copysign 701 +sNaN -> 701
+dqcps429 copysign -720 +sNaN -> 720
+dqcps430 copysign -720 +sNaN3 -> 720
+
diff --git a/Lib/test/decimaltestdata/dqDivide.decTest b/Lib/test/decimaltestdata/dqDivide.decTest
index 3cf60c6024..2abb939d54 100644
--- a/Lib/test/decimaltestdata/dqDivide.decTest
+++ b/Lib/test/decimaltestdata/dqDivide.decTest
@@ -1,808 +1,808 @@
-------------------------------------------------------------------------
--- dqDivide.decTest -- decQuad division --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqdiv001 divide 1 1 -> 1
-dqdiv002 divide 2 1 -> 2
-dqdiv003 divide 1 2 -> 0.5
-dqdiv004 divide 2 2 -> 1
-dqdiv005 divide 0 1 -> 0
-dqdiv006 divide 0 2 -> 0
-dqdiv007 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded
-dqdiv008 divide 2 3 -> 0.6666666666666666666666666666666667 Inexact Rounded
-dqdiv009 divide 3 3 -> 1
-
-dqdiv010 divide 2.4 1 -> 2.4
-dqdiv011 divide 2.4 -1 -> -2.4
-dqdiv012 divide -2.4 1 -> -2.4
-dqdiv013 divide -2.4 -1 -> 2.4
-dqdiv014 divide 2.40 1 -> 2.40
-dqdiv015 divide 2.400 1 -> 2.400
-dqdiv016 divide 2.4 2 -> 1.2
-dqdiv017 divide 2.400 2 -> 1.200
-dqdiv018 divide 2. 2 -> 1
-dqdiv019 divide 20 20 -> 1
-
-dqdiv020 divide 187 187 -> 1
-dqdiv021 divide 5 2 -> 2.5
-dqdiv022 divide 50 20 -> 2.5
-dqdiv023 divide 500 200 -> 2.5
-dqdiv024 divide 50.0 20.0 -> 2.5
-dqdiv025 divide 5.00 2.00 -> 2.5
-dqdiv026 divide 5 2.0 -> 2.5
-dqdiv027 divide 5 2.000 -> 2.5
-dqdiv028 divide 5 0.20 -> 25
-dqdiv029 divide 5 0.200 -> 25
-dqdiv030 divide 10 1 -> 10
-dqdiv031 divide 100 1 -> 100
-dqdiv032 divide 1000 1 -> 1000
-dqdiv033 divide 1000 100 -> 10
-
-dqdiv035 divide 1 2 -> 0.5
-dqdiv036 divide 1 4 -> 0.25
-dqdiv037 divide 1 8 -> 0.125
-dqdiv038 divide 1 16 -> 0.0625
-dqdiv039 divide 1 32 -> 0.03125
-dqdiv040 divide 1 64 -> 0.015625
-dqdiv041 divide 1 -2 -> -0.5
-dqdiv042 divide 1 -4 -> -0.25
-dqdiv043 divide 1 -8 -> -0.125
-dqdiv044 divide 1 -16 -> -0.0625
-dqdiv045 divide 1 -32 -> -0.03125
-dqdiv046 divide 1 -64 -> -0.015625
-dqdiv047 divide -1 2 -> -0.5
-dqdiv048 divide -1 4 -> -0.25
-dqdiv049 divide -1 8 -> -0.125
-dqdiv050 divide -1 16 -> -0.0625
-dqdiv051 divide -1 32 -> -0.03125
-dqdiv052 divide -1 64 -> -0.015625
-dqdiv053 divide -1 -2 -> 0.5
-dqdiv054 divide -1 -4 -> 0.25
-dqdiv055 divide -1 -8 -> 0.125
-dqdiv056 divide -1 -16 -> 0.0625
-dqdiv057 divide -1 -32 -> 0.03125
-dqdiv058 divide -1 -64 -> 0.015625
-
--- bcdTime
-dqdiv060 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded
-dqdiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717123193907511985359 Inexact Rounded
-
--- 1234567890123456
-dqdiv067 divide 9999999999999999999999999999999999 1 -> 9999999999999999999999999999999999
-dqdiv068 divide 999999999999999999999999999999999 1 -> 999999999999999999999999999999999
-dqdiv069 divide 99999999999999999999999999999999 1 -> 99999999999999999999999999999999
-dqdiv070 divide 99999999999999999 1 -> 99999999999999999
-dqdiv071 divide 9999999999999999 1 -> 9999999999999999
-dqdiv072 divide 999999999999999 1 -> 999999999999999
-dqdiv073 divide 99999999999999 1 -> 99999999999999
-dqdiv074 divide 9999999999999 1 -> 9999999999999
-dqdiv075 divide 999999999999 1 -> 999999999999
-dqdiv076 divide 99999999999 1 -> 99999999999
-dqdiv077 divide 9999999999 1 -> 9999999999
-dqdiv078 divide 999999999 1 -> 999999999
-dqdiv079 divide 99999999 1 -> 99999999
-dqdiv080 divide 9999999 1 -> 9999999
-dqdiv081 divide 999999 1 -> 999999
-dqdiv082 divide 99999 1 -> 99999
-dqdiv083 divide 9999 1 -> 9999
-dqdiv084 divide 999 1 -> 999
-dqdiv085 divide 99 1 -> 99
-dqdiv086 divide 9 1 -> 9
-
-dqdiv090 divide 0. 1 -> 0
-dqdiv091 divide .0 1 -> 0.0
-dqdiv092 divide 0.00 1 -> 0.00
-dqdiv093 divide 0.00E+9 1 -> 0E+7
-dqdiv094 divide 0.0000E-50 1 -> 0E-54
-
-dqdiv095 divide 1 1E-8 -> 1E+8
-dqdiv096 divide 1 1E-9 -> 1E+9
-dqdiv097 divide 1 1E-10 -> 1E+10
-dqdiv098 divide 1 1E-11 -> 1E+11
-dqdiv099 divide 1 1E-12 -> 1E+12
-
-dqdiv100 divide 1 1 -> 1
-dqdiv101 divide 1 2 -> 0.5
-dqdiv102 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded
-dqdiv103 divide 1 4 -> 0.25
-dqdiv104 divide 1 5 -> 0.2
-dqdiv105 divide 1 6 -> 0.1666666666666666666666666666666667 Inexact Rounded
-dqdiv106 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded
-dqdiv107 divide 1 8 -> 0.125
-dqdiv108 divide 1 9 -> 0.1111111111111111111111111111111111 Inexact Rounded
-dqdiv109 divide 1 10 -> 0.1
-dqdiv110 divide 1 1 -> 1
-dqdiv111 divide 2 1 -> 2
-dqdiv112 divide 3 1 -> 3
-dqdiv113 divide 4 1 -> 4
-dqdiv114 divide 5 1 -> 5
-dqdiv115 divide 6 1 -> 6
-dqdiv116 divide 7 1 -> 7
-dqdiv117 divide 8 1 -> 8
-dqdiv118 divide 9 1 -> 9
-dqdiv119 divide 10 1 -> 10
-
-dqdiv120 divide 3E+1 0.001 -> 3E+4
-dqdiv121 divide 2.200 2 -> 1.100
-
-dqdiv130 divide 12345 4.999 -> 2469.493898779755951190238047609522 Inexact Rounded
-dqdiv131 divide 12345 4.99 -> 2473.947895791583166332665330661323 Inexact Rounded
-dqdiv132 divide 12345 4.9 -> 2519.387755102040816326530612244898 Inexact Rounded
-dqdiv133 divide 12345 5 -> 2469
-dqdiv134 divide 12345 5.1 -> 2420.588235294117647058823529411765 Inexact Rounded
-dqdiv135 divide 12345 5.01 -> 2464.071856287425149700598802395210 Inexact Rounded
-dqdiv136 divide 12345 5.001 -> 2468.506298740251949610077984403119 Inexact Rounded
-
--- test possibly imprecise results
-dqdiv220 divide 391 597 -> 0.6549413735343383584589614740368509 Inexact Rounded
-dqdiv221 divide 391 -597 -> -0.6549413735343383584589614740368509 Inexact Rounded
-dqdiv222 divide -391 597 -> -0.6549413735343383584589614740368509 Inexact Rounded
-dqdiv223 divide -391 -597 -> 0.6549413735343383584589614740368509 Inexact Rounded
-
--- test some cases that are close to exponent overflow
-dqdiv270 divide 1 1e6144 -> 1E-6144 Subnormal
-dqdiv271 divide 1 0.9e6144 -> 1.11111111111111111111111111111111E-6144 Rounded Inexact Subnormal Underflow
-dqdiv272 divide 1 0.99e6144 -> 1.01010101010101010101010101010101E-6144 Rounded Inexact Subnormal Underflow
-dqdiv273 divide 1 0.9999999999999999e6144 -> 1.00000000000000010000000000000001E-6144 Rounded Inexact Subnormal Underflow
-dqdiv274 divide 9e6144 1 -> 9.000000000000000000000000000000000E+6144 Clamped
-dqdiv275 divide 9.9e6144 1 -> 9.900000000000000000000000000000000E+6144 Clamped
-dqdiv276 divide 9.99e6144 1 -> 9.990000000000000000000000000000000E+6144 Clamped
-dqdiv277 divide 9.999999999999999e6144 1 -> 9.999999999999999000000000000000000E+6144 Clamped
-
-dqdiv278 divide 1 0.9999999999999999999999999999999999e6144 -> 1.00000000000000000000000000000000E-6144 Rounded Inexact Subnormal Underflow
-dqdiv279 divide 9.999999999999999999999999999999999e6144 1 -> 9.999999999999999999999999999999999E+6144
-
--- Divide into 0 tests
-dqdiv301 divide 0 7 -> 0
-dqdiv302 divide 0 7E-5 -> 0E+5
-dqdiv303 divide 0 7E-1 -> 0E+1
-dqdiv304 divide 0 7E+1 -> 0.0
-dqdiv305 divide 0 7E+5 -> 0.00000
-dqdiv306 divide 0 7E+6 -> 0.000000
-dqdiv307 divide 0 7E+7 -> 0E-7
-dqdiv308 divide 0 70E-5 -> 0E+5
-dqdiv309 divide 0 70E-1 -> 0E+1
-dqdiv310 divide 0 70E+0 -> 0
-dqdiv311 divide 0 70E+1 -> 0.0
-dqdiv312 divide 0 70E+5 -> 0.00000
-dqdiv313 divide 0 70E+6 -> 0.000000
-dqdiv314 divide 0 70E+7 -> 0E-7
-dqdiv315 divide 0 700E-5 -> 0E+5
-dqdiv316 divide 0 700E-1 -> 0E+1
-dqdiv317 divide 0 700E+0 -> 0
-dqdiv318 divide 0 700E+1 -> 0.0
-dqdiv319 divide 0 700E+5 -> 0.00000
-dqdiv320 divide 0 700E+6 -> 0.000000
-dqdiv321 divide 0 700E+7 -> 0E-7
-dqdiv322 divide 0 700E+77 -> 0E-77
-
-dqdiv331 divide 0E-3 7E-5 -> 0E+2
-dqdiv332 divide 0E-3 7E-1 -> 0.00
-dqdiv333 divide 0E-3 7E+1 -> 0.0000
-dqdiv334 divide 0E-3 7E+5 -> 0E-8
-dqdiv335 divide 0E-1 7E-5 -> 0E+4
-dqdiv336 divide 0E-1 7E-1 -> 0
-dqdiv337 divide 0E-1 7E+1 -> 0.00
-dqdiv338 divide 0E-1 7E+5 -> 0.000000
-dqdiv339 divide 0E+1 7E-5 -> 0E+6
-dqdiv340 divide 0E+1 7E-1 -> 0E+2
-dqdiv341 divide 0E+1 7E+1 -> 0
-dqdiv342 divide 0E+1 7E+5 -> 0.0000
-dqdiv343 divide 0E+3 7E-5 -> 0E+8
-dqdiv344 divide 0E+3 7E-1 -> 0E+4
-dqdiv345 divide 0E+3 7E+1 -> 0E+2
-dqdiv346 divide 0E+3 7E+5 -> 0.00
-
--- These were 'input rounding'
-dqdiv441 divide 12345678000 1 -> 12345678000
-dqdiv442 divide 1 12345678000 -> 8.100000664200054464404466081166219E-11 Inexact Rounded
-dqdiv443 divide 1234567800 1 -> 1234567800
-dqdiv444 divide 1 1234567800 -> 8.100000664200054464404466081166219E-10 Inexact Rounded
-dqdiv445 divide 1234567890 1 -> 1234567890
-dqdiv446 divide 1 1234567890 -> 8.100000073710000670761006103925156E-10 Inexact Rounded
-dqdiv447 divide 1234567891 1 -> 1234567891
-dqdiv448 divide 1 1234567891 -> 8.100000067149000556665214614754629E-10 Inexact Rounded
-dqdiv449 divide 12345678901 1 -> 12345678901
-dqdiv450 divide 1 12345678901 -> 8.100000073053900658873130042376760E-11 Inexact Rounded
-dqdiv451 divide 1234567896 1 -> 1234567896
-dqdiv452 divide 1 1234567896 -> 8.100000034344000145618560617422697E-10 Inexact Rounded
-
--- high-lows
-dqdiv453 divide 1e+1 1 -> 1E+1
-dqdiv454 divide 1e+1 1.0 -> 1E+1
-dqdiv455 divide 1e+1 1.00 -> 1E+1
-dqdiv456 divide 1e+2 2 -> 5E+1
-dqdiv457 divide 1e+2 2.0 -> 5E+1
-dqdiv458 divide 1e+2 2.00 -> 5E+1
-
--- some from IEEE discussions
-dqdiv460 divide 3e0 2e0 -> 1.5
-dqdiv461 divide 30e-1 2e0 -> 1.5
-dqdiv462 divide 300e-2 2e0 -> 1.50
-dqdiv464 divide 3000e-3 2e0 -> 1.500
-dqdiv465 divide 3e0 20e-1 -> 1.5
-dqdiv466 divide 30e-1 20e-1 -> 1.5
-dqdiv467 divide 300e-2 20e-1 -> 1.5
-dqdiv468 divide 3000e-3 20e-1 -> 1.50
-dqdiv469 divide 3e0 200e-2 -> 1.5
-dqdiv470 divide 30e-1 200e-2 -> 1.5
-dqdiv471 divide 300e-2 200e-2 -> 1.5
-dqdiv472 divide 3000e-3 200e-2 -> 1.5
-dqdiv473 divide 3e0 2000e-3 -> 1.5
-dqdiv474 divide 30e-1 2000e-3 -> 1.5
-dqdiv475 divide 300e-2 2000e-3 -> 1.5
-dqdiv476 divide 3000e-3 2000e-3 -> 1.5
-
--- some reciprocals
-dqdiv480 divide 1 1.0E+33 -> 1E-33
-dqdiv481 divide 1 10E+33 -> 1E-34
-dqdiv482 divide 1 1.0E-33 -> 1E+33
-dqdiv483 divide 1 10E-33 -> 1E+32
-
--- RMS discussion table
-dqdiv484 divide 0e5 1e3 -> 0E+2
-dqdiv485 divide 0e5 2e3 -> 0E+2
-dqdiv486 divide 0e5 10e2 -> 0E+3
-dqdiv487 divide 0e5 20e2 -> 0E+3
-dqdiv488 divide 0e5 100e1 -> 0E+4
-dqdiv489 divide 0e5 200e1 -> 0E+4
-
-dqdiv491 divide 1e5 1e3 -> 1E+2
-dqdiv492 divide 1e5 2e3 -> 5E+1
-dqdiv493 divide 1e5 10e2 -> 1E+2
-dqdiv494 divide 1e5 20e2 -> 5E+1
-dqdiv495 divide 1e5 100e1 -> 1E+2
-dqdiv496 divide 1e5 200e1 -> 5E+1
-
--- tryzeros cases
-rounding: half_up
-dqdiv497 divide 0E+6108 1000E-33 -> 0E+6111 Clamped
-dqdiv498 divide 0E-6170 1000E+33 -> 0E-6176 Clamped
-
-rounding: half_up
-
--- focus on trailing zeros issues
-dqdiv500 divide 1 9.9 -> 0.1010101010101010101010101010101010 Inexact Rounded
-dqdiv501 divide 1 9.09 -> 0.1100110011001100110011001100110011 Inexact Rounded
-dqdiv502 divide 1 9.009 -> 0.1110001110001110001110001110001110 Inexact Rounded
-
-dqdiv511 divide 1 2 -> 0.5
-dqdiv512 divide 1.0 2 -> 0.5
-dqdiv513 divide 1.00 2 -> 0.50
-dqdiv514 divide 1.000 2 -> 0.500
-dqdiv515 divide 1.0000 2 -> 0.5000
-dqdiv516 divide 1.00000 2 -> 0.50000
-dqdiv517 divide 1.000000 2 -> 0.500000
-dqdiv518 divide 1.0000000 2 -> 0.5000000
-dqdiv519 divide 1.00 2.00 -> 0.5
-
-dqdiv521 divide 2 1 -> 2
-dqdiv522 divide 2 1.0 -> 2
-dqdiv523 divide 2 1.00 -> 2
-dqdiv524 divide 2 1.000 -> 2
-dqdiv525 divide 2 1.0000 -> 2
-dqdiv526 divide 2 1.00000 -> 2
-dqdiv527 divide 2 1.000000 -> 2
-dqdiv528 divide 2 1.0000000 -> 2
-dqdiv529 divide 2.00 1.00 -> 2
-
-dqdiv530 divide 2.40 2 -> 1.20
-dqdiv531 divide 2.40 4 -> 0.60
-dqdiv532 divide 2.40 10 -> 0.24
-dqdiv533 divide 2.40 2.0 -> 1.2
-dqdiv534 divide 2.40 4.0 -> 0.6
-dqdiv535 divide 2.40 10.0 -> 0.24
-dqdiv536 divide 2.40 2.00 -> 1.2
-dqdiv537 divide 2.40 4.00 -> 0.6
-dqdiv538 divide 2.40 10.00 -> 0.24
-dqdiv539 divide 0.9 0.1 -> 9
-dqdiv540 divide 0.9 0.01 -> 9E+1
-dqdiv541 divide 0.9 0.001 -> 9E+2
-dqdiv542 divide 5 2 -> 2.5
-dqdiv543 divide 5 2.0 -> 2.5
-dqdiv544 divide 5 2.00 -> 2.5
-dqdiv545 divide 5 20 -> 0.25
-dqdiv546 divide 5 20.0 -> 0.25
-dqdiv547 divide 2.400 2 -> 1.200
-dqdiv548 divide 2.400 2.0 -> 1.20
-dqdiv549 divide 2.400 2.400 -> 1
-
-dqdiv550 divide 240 1 -> 240
-dqdiv551 divide 240 10 -> 24
-dqdiv552 divide 240 100 -> 2.4
-dqdiv553 divide 240 1000 -> 0.24
-dqdiv554 divide 2400 1 -> 2400
-dqdiv555 divide 2400 10 -> 240
-dqdiv556 divide 2400 100 -> 24
-dqdiv557 divide 2400 1000 -> 2.4
-
--- +ve exponent
-dqdiv600 divide 2.4E+9 2 -> 1.2E+9
-dqdiv601 divide 2.40E+9 2 -> 1.20E+9
-dqdiv602 divide 2.400E+9 2 -> 1.200E+9
-dqdiv603 divide 2.4000E+9 2 -> 1.2000E+9
-dqdiv604 divide 24E+8 2 -> 1.2E+9
-dqdiv605 divide 240E+7 2 -> 1.20E+9
-dqdiv606 divide 2400E+6 2 -> 1.200E+9
-dqdiv607 divide 24000E+5 2 -> 1.2000E+9
-
--- more zeros, etc.
-dqdiv731 divide 5.00 1E-3 -> 5.00E+3
-dqdiv732 divide 00.00 0.000 -> NaN Division_undefined
-dqdiv733 divide 00.00 0E-3 -> NaN Division_undefined
-dqdiv734 divide 0 -0 -> NaN Division_undefined
-dqdiv735 divide -0 0 -> NaN Division_undefined
-dqdiv736 divide -0 -0 -> NaN Division_undefined
-
-dqdiv741 divide 0 -1 -> -0
-dqdiv742 divide -0 -1 -> 0
-dqdiv743 divide 0 1 -> 0
-dqdiv744 divide -0 1 -> -0
-dqdiv745 divide -1 0 -> -Infinity Division_by_zero
-dqdiv746 divide -1 -0 -> Infinity Division_by_zero
-dqdiv747 divide 1 0 -> Infinity Division_by_zero
-dqdiv748 divide 1 -0 -> -Infinity Division_by_zero
-
-dqdiv751 divide 0.0 -1 -> -0.0
-dqdiv752 divide -0.0 -1 -> 0.0
-dqdiv753 divide 0.0 1 -> 0.0
-dqdiv754 divide -0.0 1 -> -0.0
-dqdiv755 divide -1.0 0 -> -Infinity Division_by_zero
-dqdiv756 divide -1.0 -0 -> Infinity Division_by_zero
-dqdiv757 divide 1.0 0 -> Infinity Division_by_zero
-dqdiv758 divide 1.0 -0 -> -Infinity Division_by_zero
-
-dqdiv761 divide 0 -1.0 -> -0E+1
-dqdiv762 divide -0 -1.0 -> 0E+1
-dqdiv763 divide 0 1.0 -> 0E+1
-dqdiv764 divide -0 1.0 -> -0E+1
-dqdiv765 divide -1 0.0 -> -Infinity Division_by_zero
-dqdiv766 divide -1 -0.0 -> Infinity Division_by_zero
-dqdiv767 divide 1 0.0 -> Infinity Division_by_zero
-dqdiv768 divide 1 -0.0 -> -Infinity Division_by_zero
-
-dqdiv771 divide 0.0 -1.0 -> -0
-dqdiv772 divide -0.0 -1.0 -> 0
-dqdiv773 divide 0.0 1.0 -> 0
-dqdiv774 divide -0.0 1.0 -> -0
-dqdiv775 divide -1.0 0.0 -> -Infinity Division_by_zero
-dqdiv776 divide -1.0 -0.0 -> Infinity Division_by_zero
-dqdiv777 divide 1.0 0.0 -> Infinity Division_by_zero
-dqdiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero
-
--- Specials
-dqdiv780 divide Inf -Inf -> NaN Invalid_operation
-dqdiv781 divide Inf -1000 -> -Infinity
-dqdiv782 divide Inf -1 -> -Infinity
-dqdiv783 divide Inf -0 -> -Infinity
-dqdiv784 divide Inf 0 -> Infinity
-dqdiv785 divide Inf 1 -> Infinity
-dqdiv786 divide Inf 1000 -> Infinity
-dqdiv787 divide Inf Inf -> NaN Invalid_operation
-dqdiv788 divide -1000 Inf -> -0E-6176 Clamped
-dqdiv789 divide -Inf Inf -> NaN Invalid_operation
-dqdiv790 divide -1 Inf -> -0E-6176 Clamped
-dqdiv791 divide -0 Inf -> -0E-6176 Clamped
-dqdiv792 divide 0 Inf -> 0E-6176 Clamped
-dqdiv793 divide 1 Inf -> 0E-6176 Clamped
-dqdiv794 divide 1000 Inf -> 0E-6176 Clamped
-dqdiv795 divide Inf Inf -> NaN Invalid_operation
-
-dqdiv800 divide -Inf -Inf -> NaN Invalid_operation
-dqdiv801 divide -Inf -1000 -> Infinity
-dqdiv802 divide -Inf -1 -> Infinity
-dqdiv803 divide -Inf -0 -> Infinity
-dqdiv804 divide -Inf 0 -> -Infinity
-dqdiv805 divide -Inf 1 -> -Infinity
-dqdiv806 divide -Inf 1000 -> -Infinity
-dqdiv807 divide -Inf Inf -> NaN Invalid_operation
-dqdiv808 divide -1000 Inf -> -0E-6176 Clamped
-dqdiv809 divide -Inf -Inf -> NaN Invalid_operation
-dqdiv810 divide -1 -Inf -> 0E-6176 Clamped
-dqdiv811 divide -0 -Inf -> 0E-6176 Clamped
-dqdiv812 divide 0 -Inf -> -0E-6176 Clamped
-dqdiv813 divide 1 -Inf -> -0E-6176 Clamped
-dqdiv814 divide 1000 -Inf -> -0E-6176 Clamped
-dqdiv815 divide Inf -Inf -> NaN Invalid_operation
-
-dqdiv821 divide NaN -Inf -> NaN
-dqdiv822 divide NaN -1000 -> NaN
-dqdiv823 divide NaN -1 -> NaN
-dqdiv824 divide NaN -0 -> NaN
-dqdiv825 divide NaN 0 -> NaN
-dqdiv826 divide NaN 1 -> NaN
-dqdiv827 divide NaN 1000 -> NaN
-dqdiv828 divide NaN Inf -> NaN
-dqdiv829 divide NaN NaN -> NaN
-dqdiv830 divide -Inf NaN -> NaN
-dqdiv831 divide -1000 NaN -> NaN
-dqdiv832 divide -1 NaN -> NaN
-dqdiv833 divide -0 NaN -> NaN
-dqdiv834 divide 0 NaN -> NaN
-dqdiv835 divide 1 NaN -> NaN
-dqdiv836 divide 1000 NaN -> NaN
-dqdiv837 divide Inf NaN -> NaN
-
-dqdiv841 divide sNaN -Inf -> NaN Invalid_operation
-dqdiv842 divide sNaN -1000 -> NaN Invalid_operation
-dqdiv843 divide sNaN -1 -> NaN Invalid_operation
-dqdiv844 divide sNaN -0 -> NaN Invalid_operation
-dqdiv845 divide sNaN 0 -> NaN Invalid_operation
-dqdiv846 divide sNaN 1 -> NaN Invalid_operation
-dqdiv847 divide sNaN 1000 -> NaN Invalid_operation
-dqdiv848 divide sNaN NaN -> NaN Invalid_operation
-dqdiv849 divide sNaN sNaN -> NaN Invalid_operation
-dqdiv850 divide NaN sNaN -> NaN Invalid_operation
-dqdiv851 divide -Inf sNaN -> NaN Invalid_operation
-dqdiv852 divide -1000 sNaN -> NaN Invalid_operation
-dqdiv853 divide -1 sNaN -> NaN Invalid_operation
-dqdiv854 divide -0 sNaN -> NaN Invalid_operation
-dqdiv855 divide 0 sNaN -> NaN Invalid_operation
-dqdiv856 divide 1 sNaN -> NaN Invalid_operation
-dqdiv857 divide 1000 sNaN -> NaN Invalid_operation
-dqdiv858 divide Inf sNaN -> NaN Invalid_operation
-dqdiv859 divide NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqdiv861 divide NaN9 -Inf -> NaN9
-dqdiv862 divide NaN8 1000 -> NaN8
-dqdiv863 divide NaN7 Inf -> NaN7
-dqdiv864 divide NaN6 NaN5 -> NaN6
-dqdiv865 divide -Inf NaN4 -> NaN4
-dqdiv866 divide -1000 NaN3 -> NaN3
-dqdiv867 divide Inf NaN2 -> NaN2
-
-dqdiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation
-dqdiv872 divide sNaN98 -1 -> NaN98 Invalid_operation
-dqdiv873 divide sNaN97 NaN -> NaN97 Invalid_operation
-dqdiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
-dqdiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
-dqdiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation
-dqdiv877 divide 0 sNaN91 -> NaN91 Invalid_operation
-dqdiv878 divide Inf sNaN90 -> NaN90 Invalid_operation
-dqdiv879 divide NaN sNaN89 -> NaN89 Invalid_operation
-
-dqdiv881 divide -NaN9 -Inf -> -NaN9
-dqdiv882 divide -NaN8 1000 -> -NaN8
-dqdiv883 divide -NaN7 Inf -> -NaN7
-dqdiv884 divide -NaN6 -NaN5 -> -NaN6
-dqdiv885 divide -Inf -NaN4 -> -NaN4
-dqdiv886 divide -1000 -NaN3 -> -NaN3
-dqdiv887 divide Inf -NaN2 -> -NaN2
-
-dqdiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqdiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
-dqdiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
-dqdiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
-dqdiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-dqdiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
-dqdiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
-dqdiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
-dqdiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
-
--- Various flavours of divide by 0
-dqdiv901 divide 0 0 -> NaN Division_undefined
-dqdiv902 divide 0.0E5 0 -> NaN Division_undefined
-dqdiv903 divide 0.000 0 -> NaN Division_undefined
-dqdiv904 divide 0.0001 0 -> Infinity Division_by_zero
-dqdiv905 divide 0.01 0 -> Infinity Division_by_zero
-dqdiv906 divide 0.1 0 -> Infinity Division_by_zero
-dqdiv907 divide 1 0 -> Infinity Division_by_zero
-dqdiv908 divide 1 0.0 -> Infinity Division_by_zero
-dqdiv909 divide 10 0.0 -> Infinity Division_by_zero
-dqdiv910 divide 1E+100 0.0 -> Infinity Division_by_zero
-dqdiv911 divide 1E+100 0 -> Infinity Division_by_zero
-
-dqdiv921 divide -0.0001 0 -> -Infinity Division_by_zero
-dqdiv922 divide -0.01 0 -> -Infinity Division_by_zero
-dqdiv923 divide -0.1 0 -> -Infinity Division_by_zero
-dqdiv924 divide -1 0 -> -Infinity Division_by_zero
-dqdiv925 divide -1 0.0 -> -Infinity Division_by_zero
-dqdiv926 divide -10 0.0 -> -Infinity Division_by_zero
-dqdiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero
-dqdiv928 divide -1E+100 0 -> -Infinity Division_by_zero
-
-dqdiv931 divide 0.0001 -0 -> -Infinity Division_by_zero
-dqdiv932 divide 0.01 -0 -> -Infinity Division_by_zero
-dqdiv933 divide 0.1 -0 -> -Infinity Division_by_zero
-dqdiv934 divide 1 -0 -> -Infinity Division_by_zero
-dqdiv935 divide 1 -0.0 -> -Infinity Division_by_zero
-dqdiv936 divide 10 -0.0 -> -Infinity Division_by_zero
-dqdiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
-dqdiv938 divide 1E+100 -0 -> -Infinity Division_by_zero
-
-dqdiv941 divide -0.0001 -0 -> Infinity Division_by_zero
-dqdiv942 divide -0.01 -0 -> Infinity Division_by_zero
-dqdiv943 divide -0.1 -0 -> Infinity Division_by_zero
-dqdiv944 divide -1 -0 -> Infinity Division_by_zero
-dqdiv945 divide -1 -0.0 -> Infinity Division_by_zero
-dqdiv946 divide -10 -0.0 -> Infinity Division_by_zero
-dqdiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero
-dqdiv948 divide -1E+100 -0 -> Infinity Division_by_zero
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dqdiv1021 divide 1E0 1E0 -> 1
-dqdiv1022 divide 1E0 2E0 -> 0.5
-dqdiv1023 divide 1E0 3E0 -> 0.3333333333333333333333333333333333 Inexact Rounded
-dqdiv1024 divide 100E-2 1000E-3 -> 1
-dqdiv1025 divide 24E-1 2E0 -> 1.2
-dqdiv1026 divide 2400E-3 2E0 -> 1.200
-dqdiv1027 divide 5E0 2E0 -> 2.5
-dqdiv1028 divide 5E0 20E-1 -> 2.5
-dqdiv1029 divide 5E0 2000E-3 -> 2.5
-dqdiv1030 divide 5E0 2E-1 -> 25
-dqdiv1031 divide 5E0 20E-2 -> 25
-dqdiv1032 divide 480E-2 3E0 -> 1.60
-dqdiv1033 divide 47E-1 2E0 -> 2.35
-
--- ECMAScript bad examples
-rounding: half_down
-dqdiv1040 divide 5 9 -> 0.5555555555555555555555555555555556 Inexact Rounded
-rounding: half_even
-dqdiv1041 divide 6 11 -> 0.5454545454545454545454545454545455 Inexact Rounded
-
--- Gyuris example
-dqdiv1050 divide 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0.9999999999999999999999999999991254 Inexact Rounded
-
--- overflow and underflow tests .. note subnormal results
--- signs
-dqdiv1751 divide 1e+4277 1e-3311 -> Infinity Overflow Inexact Rounded
-dqdiv1752 divide 1e+4277 -1e-3311 -> -Infinity Overflow Inexact Rounded
-dqdiv1753 divide -1e+4277 1e-3311 -> -Infinity Overflow Inexact Rounded
-dqdiv1754 divide -1e+4277 -1e-3311 -> Infinity Overflow Inexact Rounded
-dqdiv1755 divide 1e-4277 1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1756 divide 1e-4277 -1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1757 divide -1e-4277 1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1758 divide -1e-4277 -1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dqdiv1760 divide 1e-6069 1e+101 -> 1E-6170 Subnormal
-dqdiv1761 divide 1e-6069 1e+102 -> 1E-6171 Subnormal
-dqdiv1762 divide 1e-6069 1e+103 -> 1E-6172 Subnormal
-dqdiv1763 divide 1e-6069 1e+104 -> 1E-6173 Subnormal
-dqdiv1764 divide 1e-6069 1e+105 -> 1E-6174 Subnormal
-dqdiv1765 divide 1e-6069 1e+106 -> 1E-6175 Subnormal
-dqdiv1766 divide 1e-6069 1e+107 -> 1E-6176 Subnormal
-dqdiv1767 divide 1e-6069 1e+108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1768 divide 1e-6069 1e+109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1769 divide 1e-6069 1e+110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-dqdiv1770 divide 1e+40 1e-6101 -> 1.000000000000000000000000000000E+6141 Clamped
-dqdiv1771 divide 1e+40 1e-6102 -> 1.0000000000000000000000000000000E+6142 Clamped
-dqdiv1772 divide 1e+40 1e-6103 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqdiv1773 divide 1e+40 1e-6104 -> 1.000000000000000000000000000000000E+6144 Clamped
-dqdiv1774 divide 1e+40 1e-6105 -> Infinity Overflow Inexact Rounded
-dqdiv1775 divide 1e+40 1e-6106 -> Infinity Overflow Inexact Rounded
-dqdiv1776 divide 1e+40 1e-6107 -> Infinity Overflow Inexact Rounded
-dqdiv1777 divide 1e+40 1e-6108 -> Infinity Overflow Inexact Rounded
-dqdiv1778 divide 1e+40 1e-6109 -> Infinity Overflow Inexact Rounded
-dqdiv1779 divide 1e+40 1e-6110 -> Infinity Overflow Inexact Rounded
-
-dqdiv1801 divide 1.0000E-6172 1 -> 1.0000E-6172 Subnormal
-dqdiv1802 divide 1.000E-6172 1e+1 -> 1.000E-6173 Subnormal
-dqdiv1803 divide 1.00E-6172 1e+2 -> 1.00E-6174 Subnormal
-dqdiv1804 divide 1.0E-6172 1e+3 -> 1.0E-6175 Subnormal
-dqdiv1805 divide 1.0E-6172 1e+4 -> 1E-6176 Subnormal Rounded
-dqdiv1806 divide 1.3E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1807 divide 1.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1808 divide 1.7E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1809 divide 2.3E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1810 divide 2.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1811 divide 2.7E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1812 divide 1.49E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1813 divide 1.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1814 divide 1.51E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1815 divide 2.49E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1816 divide 2.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1817 divide 2.51E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded
-
-dqdiv1818 divide 1E-6172 1e+4 -> 1E-6176 Subnormal
-dqdiv1819 divide 3E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1820 divide 5E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1821 divide 7E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1822 divide 9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1823 divide 9.9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-
-dqdiv1824 divide 1E-6172 -1e+4 -> -1E-6176 Subnormal
-dqdiv1825 divide 3E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1826 divide -5E-6172 1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1827 divide 7E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1828 divide -9E-6172 1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1829 divide 9.9E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqdiv1830 divide 3.0E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqdiv1831 divide 1.0E-5977 1e+200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqdiv1832 divide 1.0E-5977 1e+199 -> 1E-6176 Subnormal Rounded
-dqdiv1833 divide 1.0E-5977 1e+198 -> 1.0E-6175 Subnormal
-dqdiv1834 divide 2.0E-5977 2e+198 -> 1.0E-6175 Subnormal
-dqdiv1835 divide 4.0E-5977 4e+198 -> 1.0E-6175 Subnormal
-dqdiv1836 divide 10.0E-5977 10e+198 -> 1.0E-6175 Subnormal
-dqdiv1837 divide 30.0E-5977 30e+198 -> 1.0E-6175 Subnormal
-dqdiv1838 divide 40.0E-5982 40e+166 -> 1.0E-6148 Subnormal
-dqdiv1839 divide 40.0E-5982 40e+165 -> 1.0E-6147 Subnormal
-dqdiv1840 divide 40.0E-5982 40e+164 -> 1.0E-6146 Subnormal
-
--- randoms
-rounding: half_even
-dqdiv2010 divide -5231195652931651968034356117118850 -7243718664422548573203260970.34995 -> 722169.9095831284624736051460550680 Inexact Rounded
-dqdiv2011 divide -89584669773927.82711237350022515352 -42077943728529635884.21142627532985 -> 0.000002129017291146471565928125887527266 Inexact Rounded
-dqdiv2012 divide -2.828201693360723203806974891946180E-232 812596541221823960386384403089240.9 -> -3.480450075640521320040055759125120E-265 Inexact Rounded
-dqdiv2013 divide -6442775372761069267502937539408720 24904085056.69185465145182606089196 -> -258703556388226463687701.4884719589 Inexact Rounded
-dqdiv2014 divide 5.535520011272625629610079879714705 -44343664650.57203052003068113531208 -> -1.248322630728089308975940533493562E-10 Inexact Rounded
-dqdiv2015 divide 65919273712517865964325.99419625010 -314733354141381737378622515.7789054 -> -0.0002094448295521490616379784758911632 Inexact Rounded
-dqdiv2016 divide -7.779172568193197107115275140431129E+759 -140453015639.3988987652895178782143 -> 5.538629792161641534962774244238115E+748 Inexact Rounded
-dqdiv2017 divide 644314832597569.0181226067518178797 -115024585257425.1635759521565201075 -> -5.601540150356479257367687450922795 Inexact Rounded
-dqdiv2018 divide 6.898640941579611450676592553286870E-47 -11272429881407851485163914999.25943 -> -6.119923578285338689371137648319280E-75 Inexact Rounded
-dqdiv2019 divide -3591344544888727133.30819750163254 5329395.423792795661446561090331037 -> -673874662941.1968525589460533725290 Inexact Rounded
-dqdiv2020 divide -7.682356781384631313156462724425838E+747 -6.60375855512219057281922141809940E+703 -> 1.163330960279556016678379128875149E+44 Inexact Rounded
-dqdiv2021 divide -4511495596596941820863224.274679699 3365395017.263329795449661616090724 -> -1340554548115304.904166888018346299 Inexact Rounded
-dqdiv2022 divide 5.211164127840931517263639608151299 164.5566381356276567012533847006453 -> 0.03166790587655228864478260157156510 Inexact Rounded
-dqdiv2023 divide -49891.2243893458830384077684620383 -47179.9312961860747554053371171530 -> 1.057467084386767291602189656430268 Inexact Rounded
-dqdiv2024 divide 15065477.47214268488077415462413353 4366211.120892953261309529740552596 -> 3.450469309661227984244545513441359 Inexact Rounded
-dqdiv2025 divide 1.575670269440761846109602429612644E+370 653199649324740300.006185482643439 -> 2.412233795700359170904588548041481E+352 Inexact Rounded
-dqdiv2026 divide -2112422311733448924573432192.620145 -80067206.03590693153848215848613406 -> 26383115089417660175.20102646756574 Inexact Rounded
-dqdiv2027 divide -67096536051279809.32218611548721839 -869685412881941081664251990181.1049 -> 7.715035236584805921278566365231168E-14 Inexact Rounded
-dqdiv2028 divide -58612908548962047.21866913425488972 -978449597531.3873665583475633831644 -> 59903.86085991703091236507859837023 Inexact Rounded
-dqdiv2029 divide -133032412010942.1476864138213319796 -7.882059293498670705446528648201359E-428 -> 1.687787506504433064549515681693715E+441 Inexact Rounded
-dqdiv2030 divide 1.83746698338966029492299716360513E+977 -9.897926608979649951672839879128603E+154 -> -1.856416051542212552042390218062458E+822 Inexact Rounded
-dqdiv2031 divide -113742475841399236307128962.1507063 8298602.203049834732657567965262989 -> -13706221006665137826.16557393919929 Inexact Rounded
-dqdiv2032 divide 196.4787574650754152995941808331862 929.6553388472318094427422117172394 -> 0.2113458066176526651006917922814018 Inexact Rounded
-dqdiv2033 divide 71931221465.43867996282803628130350 3838685934206426257090718.402248853 -> 1.873850132527423413607199513324021E-14 Inexact Rounded
-dqdiv2034 divide 488.4282502289651653783596246312885 -80.68940956806634280078706577953188 -> -6.053189047280693318844801899473272 Inexact Rounded
-dqdiv2035 divide 9.001764344963921754981762913247394E-162 -8.585540973667205753734967645386919E-729 -> -1.048479574271827326396012573232934E+567 Inexact Rounded
-dqdiv2036 divide -7.404133959409894743706402857145471E-828 -51.38159929460289711134684843086265 -> 1.441008855516029461032061785219773E-829 Inexact Rounded
-dqdiv2037 divide 2.967520235574419794048994436040717E-613 -6252513855.91394894949879262731889 -> -4.746123405656409127572998751885338E-623 Inexact Rounded
-dqdiv2038 divide -18826852654824040505.83920366765051 -6336924877942437992590557460147340 -> 2.970976146546494669807886278519194E-15 Inexact Rounded
-dqdiv2039 divide -8.101406784809197604949584001735949E+561 4.823300306948942821076681658771635E+361 -> -1.679639721610839204738445747238987E+200 Inexact Rounded
-dqdiv2040 divide -6.11981977773094052331062585191723E+295 1.507610253755339328302779005586534E+238 -> -4.059285058911577244044418416044763E+57 Inexact Rounded
-dqdiv2041 divide 6.472638850046815880599220534274055E-596 -4.475233712083047516933911786159972 -> -1.446324207062261745520496475778879E-596 Inexact Rounded
-dqdiv2042 divide -84438593330.71277839631144509397112 -586684596204401664208947.4054879633 -> 1.439250218550041228759983937772504E-13 Inexact Rounded
-dqdiv2043 divide 9.354533233294022616695815656704369E-24 405.500390626135304252144163591746 -> 2.306911028827774549740571229736198E-26 Inexact Rounded
-dqdiv2044 divide 985606423350210.7374876650149957881 -36811563697.41925681866694859828794 -> -26774.36990864119445335813354717711 Inexact Rounded
-dqdiv2045 divide -8.187280774177715706278002247766311E-123 -38784124393.91212870828430001300068 -> 2.110987653356139147357240727794365E-133 Inexact Rounded
-dqdiv2046 divide -4.612203126350070903459245798371657E+912 7.971562182727956290901984736800519E+64 -> -5.785820922708683237098826662769748E+847 Inexact Rounded
-dqdiv2047 divide 4.661015909421485298247928967977089E+888 -6.360911253323922338737311563845581E+388 -> -7.327591478321365980156654539638836E+499 Inexact Rounded
-dqdiv2048 divide 9156078172903.257500003260710833030 7.189796653262147139071634237964074E-90 -> 1.273482215766000994365201545096026E+102 Inexact Rounded
-dqdiv2049 divide -1.710722303327476586373477781276586E-311 -3167561628260156837329323.729380695 -> 5.400754599578613984875752958645655E-336 Inexact Rounded
-dqdiv2050 divide -4.647935210881806238321616345413021E-878 209388.5431867744648177308460639582 -> -2.219765771394593733140494297388140E-883 Inexact Rounded
-dqdiv2051 divide 5958.694728395760992719084781582700 4.541510156564315632536353171846096E-746 -> 1.312051393253638664947852693005480E+749 Inexact Rounded
-dqdiv2052 divide -7.935732544649702175256699886872093E-489 -7.433329073664793138998765647467971E+360 -> 1.067587949626076917672271619664656E-849 Inexact Rounded
-dqdiv2053 divide -2746650864601157.863589959939901350 7.016684945507647528907184694359598E+548 -> -3.914456593009309529351254950429932E-534 Inexact Rounded
-dqdiv2054 divide 3605149408631197365447953.994569178 -75614025825649082.78264864428237833 -> -47678315.88472693507060063188020532 Inexact Rounded
-dqdiv2055 divide 788194320921798404906375214.196349 -6.222718148433247384932573401976337E-418 -> -1.266639918634671803982222244977287E+444 Inexact Rounded
-dqdiv2056 divide 5620722730534752.758208943447603211 6.843552841168538319123000917657759E-139 -> 8.213164800485434666629970443739554E+153 Inexact Rounded
-dqdiv2057 divide 7304534676713703938102.403949019402 -576169.3685010935108153023803590835 -> -12677756014201995.31969237144394772 Inexact Rounded
-dqdiv2058 divide 8067918762.134621639254916786945547 -8.774771480055536009105596163864758E+954 -> -9.194448858836332156766764605125245E-946 Inexact Rounded
-dqdiv2059 divide 8.702093454123046507578256899537563E-324 -5.875399733016018404580201176576293E-401 -> -1.481106622452052581470443526957335E+77 Inexact Rounded
-dqdiv2060 divide -41426.01662518451861386352415092356 90.00146621684478300510769802013464 -> -460.2815750287318692732067709176200 Inexact Rounded
-
--- random divide tests with result near 1
-dqdiv4001 divide 2003100352770753969878925664524900 2003100352770753969878925664497824 -> 1.000000000000000000000000000013517 Inexact Rounded
-dqdiv4002 divide 4817785793916490652579552318371645 4817785793916490652579552318362097 -> 1.000000000000000000000000000001982 Inexact Rounded
-dqdiv4003 divide 8299187410920067325648068439560282 8299187410920067325648068439591159 -> 0.9999999999999999999999999999962795 Inexact Rounded
-dqdiv4004 divide 5641088455897407044544461785365899 5641088455897407044544461785389965 -> 0.9999999999999999999999999999957338 Inexact Rounded
-dqdiv4005 divide 5752274694706545359326361313490424 5752274694706545359326361313502723 -> 0.9999999999999999999999999999978619 Inexact Rounded
-dqdiv4006 divide 6762079477373670594829319346099665 6762079477373670594829319346132579 -> 0.9999999999999999999999999999951326 Inexact Rounded
-dqdiv4007 divide 7286425153691890341633023222602916 7286425153691890341633023222606556 -> 0.9999999999999999999999999999995004 Inexact Rounded
-dqdiv4008 divide 9481233991901305727648306421946655 9481233991901305727648306421919124 -> 1.000000000000000000000000000002904 Inexact Rounded
-dqdiv4009 divide 4282053941893951742029444065614311 4282053941893951742029444065583077 -> 1.000000000000000000000000000007294 Inexact Rounded
-dqdiv4010 divide 626888225441250639741781850338695 626888225441250639741781850327299 -> 1.000000000000000000000000000018179 Inexact Rounded
-dqdiv4011 divide 3860973649222028009456598604468547 3860973649222028009456598604476849 -> 0.9999999999999999999999999999978498 Inexact Rounded
-dqdiv4012 divide 4753157080127468127908060607821839 4753157080127468127908060607788379 -> 1.000000000000000000000000000007040 Inexact Rounded
-dqdiv4013 divide 552448546203754062805706277880419 552448546203754062805706277881903 -> 0.9999999999999999999999999999973138 Inexact Rounded
-dqdiv4014 divide 8405954527952158455323713728917395 8405954527952158455323713728933866 -> 0.9999999999999999999999999999980406 Inexact Rounded
-dqdiv4015 divide 7554096502235321142555802238016116 7554096502235321142555802238026546 -> 0.9999999999999999999999999999986193 Inexact Rounded
-dqdiv4016 divide 4053257674127518606871054934746782 4053257674127518606871054934767355 -> 0.9999999999999999999999999999949243 Inexact Rounded
-dqdiv4017 divide 7112419420755090454716888844011582 7112419420755090454716888844038105 -> 0.9999999999999999999999999999962709 Inexact Rounded
-dqdiv4018 divide 3132302137520072728164549730911846 3132302137520072728164549730908416 -> 1.000000000000000000000000000001095 Inexact Rounded
-dqdiv4019 divide 4788374045841416355706715048161013 4788374045841416355706715048190077 -> 0.9999999999999999999999999999939303 Inexact Rounded
-dqdiv4020 divide 9466021636047630218238075099510597 9466021636047630218238075099484053 -> 1.000000000000000000000000000002804 Inexact Rounded
-dqdiv4021 divide 912742745646765625597399692138650 912742745646765625597399692139042 -> 0.9999999999999999999999999999995705 Inexact Rounded
-dqdiv4022 divide 9508402742933643208806264897188504 9508402742933643208806264897195973 -> 0.9999999999999999999999999999992145 Inexact Rounded
-dqdiv4023 divide 1186956795727233704962361914360895 1186956795727233704962361914329577 -> 1.000000000000000000000000000026385 Inexact Rounded
-dqdiv4024 divide 5972210268839014812696916170967938 5972210268839014812696916170954974 -> 1.000000000000000000000000000002171 Inexact Rounded
-dqdiv4025 divide 2303801625521619930894460139793140 2303801625521619930894460139799643 -> 0.9999999999999999999999999999971773 Inexact Rounded
-dqdiv4026 divide 6022231560002898264777393473966595 6022231560002898264777393473947198 -> 1.000000000000000000000000000003221 Inexact Rounded
-dqdiv4027 divide 8426148335801396199969346032210893 8426148335801396199969346032203179 -> 1.000000000000000000000000000000915 Inexact Rounded
-dqdiv4028 divide 8812278947028784637382847098411749 8812278947028784637382847098385317 -> 1.000000000000000000000000000002999 Inexact Rounded
-dqdiv4029 divide 8145282002348367383264197170116146 8145282002348367383264197170083988 -> 1.000000000000000000000000000003948 Inexact Rounded
-dqdiv4030 divide 6821577571876840153123510107387026 6821577571876840153123510107418008 -> 0.9999999999999999999999999999954582 Inexact Rounded
-dqdiv4031 divide 9018555319518966970480565482023720 9018555319518966970480565482013346 -> 1.000000000000000000000000000001150 Inexact Rounded
-dqdiv4032 divide 4602155712998228449640717252788864 4602155712998228449640717252818502 -> 0.9999999999999999999999999999935600 Inexact Rounded
-dqdiv4033 divide 6675607481522785614506828292264472 6675607481522785614506828292277100 -> 0.9999999999999999999999999999981083 Inexact Rounded
-dqdiv4034 divide 4015881516871833897766945836264472 4015881516871833897766945836262645 -> 1.000000000000000000000000000000455 Inexact Rounded
-dqdiv4035 divide 1415580205933411837595459716910365 1415580205933411837595459716880139 -> 1.000000000000000000000000000021352 Inexact Rounded
-dqdiv4036 divide 9432968297069542816752035276361552 9432968297069542816752035276353054 -> 1.000000000000000000000000000000901 Inexact Rounded
-dqdiv4037 divide 4799319591303848500532766682140658 4799319591303848500532766682172655 -> 0.9999999999999999999999999999933330 Inexact Rounded
-dqdiv4038 divide 316854270732839529790584284987472 316854270732839529790584285004832 -> 0.9999999999999999999999999999452114 Inexact Rounded
-dqdiv4039 divide 3598981300592490427826027975697415 3598981300592490427826027975686712 -> 1.000000000000000000000000000002974 Inexact Rounded
-dqdiv4040 divide 1664315435694461371155800682196520 1664315435694461371155800682195617 -> 1.000000000000000000000000000000543 Inexact Rounded
-dqdiv4041 divide 1680872316531128890102855316510581 1680872316531128890102855316495545 -> 1.000000000000000000000000000008945 Inexact Rounded
-dqdiv4042 divide 9881274879566405475755499281644730 9881274879566405475755499281615743 -> 1.000000000000000000000000000002934 Inexact Rounded
-dqdiv4043 divide 4737225957717466960447204232279216 4737225957717466960447204232277452 -> 1.000000000000000000000000000000372 Inexact Rounded
-dqdiv4044 divide 2482097379414867061213319346418288 2482097379414867061213319346387936 -> 1.000000000000000000000000000012228 Inexact Rounded
-dqdiv4045 divide 7406977595233762723576434122161868 7406977595233762723576434122189042 -> 0.9999999999999999999999999999963313 Inexact Rounded
-dqdiv4046 divide 228782057757566047086593281773577 228782057757566047086593281769727 -> 1.000000000000000000000000000016828 Inexact Rounded
-dqdiv4047 divide 2956594270240579648823270540367653 2956594270240579648823270540368556 -> 0.9999999999999999999999999999996946 Inexact Rounded
-dqdiv4048 divide 6326964098897620620534136767634340 6326964098897620620534136767619339 -> 1.000000000000000000000000000002371 Inexact Rounded
-dqdiv4049 divide 414586440456590215247002678327800 414586440456590215247002678316922 -> 1.000000000000000000000000000026238 Inexact Rounded
-dqdiv4050 divide 7364552208570039386220505636779125 7364552208570039386220505636803548 -> 0.9999999999999999999999999999966837 Inexact Rounded
-dqdiv4051 divide 5626266749902369710022824950590056 5626266749902369710022824950591008 -> 0.9999999999999999999999999999998308 Inexact Rounded
-dqdiv4052 divide 4863278293916197454987481343460484 4863278293916197454987481343442522 -> 1.000000000000000000000000000003693 Inexact Rounded
-dqdiv4053 divide 1170713582030637359713249796835483 1170713582030637359713249796823345 -> 1.000000000000000000000000000010368 Inexact Rounded
-dqdiv4054 divide 9838062494725965667776326556052931 9838062494725965667776326556061002 -> 0.9999999999999999999999999999991796 Inexact Rounded
-dqdiv4055 divide 4071388731298861093005687091498922 4071388731298861093005687091498278 -> 1.000000000000000000000000000000158 Inexact Rounded
-dqdiv4056 divide 8753155722324706795855038590272526 8753155722324706795855038590276656 -> 0.9999999999999999999999999999995282 Inexact Rounded
-dqdiv4057 divide 4399941911533273418844742658240485 4399941911533273418844742658219891 -> 1.000000000000000000000000000004681 Inexact Rounded
-dqdiv4058 divide 4127884159949503677776430620050269 4127884159949503677776430620026091 -> 1.000000000000000000000000000005857 Inexact Rounded
-dqdiv4059 divide 5536160822360800067042528317438808 5536160822360800067042528317450687 -> 0.9999999999999999999999999999978543 Inexact Rounded
-dqdiv4060 divide 3973234998468664936671088237710246 3973234998468664936671088237741886 -> 0.9999999999999999999999999999920367 Inexact Rounded
-dqdiv4061 divide 9824855935638263593410444142327358 9824855935638263593410444142328576 -> 0.9999999999999999999999999999998760 Inexact Rounded
-dqdiv4062 divide 5917078517340218131867327300814867 5917078517340218131867327300788701 -> 1.000000000000000000000000000004422 Inexact Rounded
-dqdiv4063 divide 4354236601830544882286139612521362 4354236601830544882286139612543223 -> 0.9999999999999999999999999999949794 Inexact Rounded
-dqdiv4064 divide 8058474772375259017342110013891294 8058474772375259017342110013906792 -> 0.9999999999999999999999999999980768 Inexact Rounded
-dqdiv4065 divide 5519604020981748170517093746166328 5519604020981748170517093746181763 -> 0.9999999999999999999999999999972036 Inexact Rounded
-dqdiv4066 divide 1502130966879805458831323782443139 1502130966879805458831323782412213 -> 1.000000000000000000000000000020588 Inexact Rounded
-dqdiv4067 divide 562795633719481212915159787980270 562795633719481212915159788007066 -> 0.9999999999999999999999999999523877 Inexact Rounded
-dqdiv4068 divide 6584743324494664273941281557268878 6584743324494664273941281557258945 -> 1.000000000000000000000000000001508 Inexact Rounded
-dqdiv4069 divide 3632000327285743997976431109416500 3632000327285743997976431109408107 -> 1.000000000000000000000000000002311 Inexact Rounded
-dqdiv4070 divide 1145827237315430089388953838561450 1145827237315430089388953838527332 -> 1.000000000000000000000000000029776 Inexact Rounded
-dqdiv4071 divide 8874431010357691869725372317350380 8874431010357691869725372317316472 -> 1.000000000000000000000000000003821 Inexact Rounded
-dqdiv4072 divide 992948718902804648119753141202196 992948718902804648119753141235222 -> 0.9999999999999999999999999999667395 Inexact Rounded
-dqdiv4073 divide 2522735183374218505142417265439989 2522735183374218505142417265453779 -> 0.9999999999999999999999999999945337 Inexact Rounded
-dqdiv4074 divide 2668419161912936508006872303501052 2668419161912936508006872303471036 -> 1.000000000000000000000000000011249 Inexact Rounded
-dqdiv4075 divide 3036169085665186712590941111775092 3036169085665186712590941111808846 -> 0.9999999999999999999999999999888827 Inexact Rounded
-dqdiv4076 divide 9441634604917231638508898934006147 9441634604917231638508898934000288 -> 1.000000000000000000000000000000621 Inexact Rounded
-dqdiv4077 divide 2677301353164377091111458811839190 2677301353164377091111458811867722 -> 0.9999999999999999999999999999893430 Inexact Rounded
-dqdiv4078 divide 6844979203112066166583765857171426 6844979203112066166583765857189682 -> 0.9999999999999999999999999999973329 Inexact Rounded
-dqdiv4079 divide 2220337435141796724323783960231661 2220337435141796724323783960208778 -> 1.000000000000000000000000000010306 Inexact Rounded
-dqdiv4080 divide 6447424700019783931569996989561380 6447424700019783931569996989572454 -> 0.9999999999999999999999999999982824 Inexact Rounded
-dqdiv4081 divide 7512856762696607119847092195587180 7512856762696607119847092195557346 -> 1.000000000000000000000000000003971 Inexact Rounded
-dqdiv4082 divide 7395261981193960399087819077237482 7395261981193960399087819077242487 -> 0.9999999999999999999999999999993232 Inexact Rounded
-dqdiv4083 divide 2253442467682584035792724884376735 2253442467682584035792724884407178 -> 0.9999999999999999999999999999864904 Inexact Rounded
-dqdiv4084 divide 8153138680300213135577336466190997 8153138680300213135577336466220607 -> 0.9999999999999999999999999999963683 Inexact Rounded
-dqdiv4085 divide 4668731252254148074041022681801390 4668731252254148074041022681778101 -> 1.000000000000000000000000000004988 Inexact Rounded
-dqdiv4086 divide 6078404557993669696040425501815056 6078404557993669696040425501797612 -> 1.000000000000000000000000000002870 Inexact Rounded
-dqdiv4087 divide 2306352359874261623223356878316278 2306352359874261623223356878335612 -> 0.9999999999999999999999999999916171 Inexact Rounded
-dqdiv4088 divide 3264842186668480362900909564091908 3264842186668480362900909564058658 -> 1.000000000000000000000000000010184 Inexact Rounded
-dqdiv4089 divide 6971985047279636878957959608612204 6971985047279636878957959608615088 -> 0.9999999999999999999999999999995863 Inexact Rounded
-dqdiv4090 divide 5262810889952721235466445973816257 5262810889952721235466445973783077 -> 1.000000000000000000000000000006305 Inexact Rounded
-dqdiv4091 divide 7947944731035267178548357070080288 7947944731035267178548357070061339 -> 1.000000000000000000000000000002384 Inexact Rounded
-dqdiv4092 divide 5071808908395375108383035800443229 5071808908395375108383035800412429 -> 1.000000000000000000000000000006073 Inexact Rounded
-dqdiv4093 divide 2043146542084503655511507209262969 2043146542084503655511507209249263 -> 1.000000000000000000000000000006708 Inexact Rounded
-dqdiv4094 divide 4097632735384534181661959731264802 4097632735384534181661959731234499 -> 1.000000000000000000000000000007395 Inexact Rounded
-dqdiv4095 divide 3061477642831387489729464587044430 3061477642831387489729464587059452 -> 0.9999999999999999999999999999950932 Inexact Rounded
-dqdiv4096 divide 3429854941039776159498802936252638 3429854941039776159498802936246415 -> 1.000000000000000000000000000001814 Inexact Rounded
-dqdiv4097 divide 4874324979578599700024133278284545 4874324979578599700024133278262131 -> 1.000000000000000000000000000004598 Inexact Rounded
-dqdiv4098 divide 5701652369691833541455978515820882 5701652369691833541455978515834854 -> 0.9999999999999999999999999999975495 Inexact Rounded
-dqdiv4099 divide 2928205728402945266953255632343113 2928205728402945266953255632373794 -> 0.9999999999999999999999999999895223 Inexact Rounded
-
--- Null tests
-dqdiv9998 divide 10 # -> NaN Invalid_operation
-dqdiv9999 divide # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqDivide.decTest -- decQuad division --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqdiv001 divide 1 1 -> 1
+dqdiv002 divide 2 1 -> 2
+dqdiv003 divide 1 2 -> 0.5
+dqdiv004 divide 2 2 -> 1
+dqdiv005 divide 0 1 -> 0
+dqdiv006 divide 0 2 -> 0
+dqdiv007 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded
+dqdiv008 divide 2 3 -> 0.6666666666666666666666666666666667 Inexact Rounded
+dqdiv009 divide 3 3 -> 1
+
+dqdiv010 divide 2.4 1 -> 2.4
+dqdiv011 divide 2.4 -1 -> -2.4
+dqdiv012 divide -2.4 1 -> -2.4
+dqdiv013 divide -2.4 -1 -> 2.4
+dqdiv014 divide 2.40 1 -> 2.40
+dqdiv015 divide 2.400 1 -> 2.400
+dqdiv016 divide 2.4 2 -> 1.2
+dqdiv017 divide 2.400 2 -> 1.200
+dqdiv018 divide 2. 2 -> 1
+dqdiv019 divide 20 20 -> 1
+
+dqdiv020 divide 187 187 -> 1
+dqdiv021 divide 5 2 -> 2.5
+dqdiv022 divide 50 20 -> 2.5
+dqdiv023 divide 500 200 -> 2.5
+dqdiv024 divide 50.0 20.0 -> 2.5
+dqdiv025 divide 5.00 2.00 -> 2.5
+dqdiv026 divide 5 2.0 -> 2.5
+dqdiv027 divide 5 2.000 -> 2.5
+dqdiv028 divide 5 0.20 -> 25
+dqdiv029 divide 5 0.200 -> 25
+dqdiv030 divide 10 1 -> 10
+dqdiv031 divide 100 1 -> 100
+dqdiv032 divide 1000 1 -> 1000
+dqdiv033 divide 1000 100 -> 10
+
+dqdiv035 divide 1 2 -> 0.5
+dqdiv036 divide 1 4 -> 0.25
+dqdiv037 divide 1 8 -> 0.125
+dqdiv038 divide 1 16 -> 0.0625
+dqdiv039 divide 1 32 -> 0.03125
+dqdiv040 divide 1 64 -> 0.015625
+dqdiv041 divide 1 -2 -> -0.5
+dqdiv042 divide 1 -4 -> -0.25
+dqdiv043 divide 1 -8 -> -0.125
+dqdiv044 divide 1 -16 -> -0.0625
+dqdiv045 divide 1 -32 -> -0.03125
+dqdiv046 divide 1 -64 -> -0.015625
+dqdiv047 divide -1 2 -> -0.5
+dqdiv048 divide -1 4 -> -0.25
+dqdiv049 divide -1 8 -> -0.125
+dqdiv050 divide -1 16 -> -0.0625
+dqdiv051 divide -1 32 -> -0.03125
+dqdiv052 divide -1 64 -> -0.015625
+dqdiv053 divide -1 -2 -> 0.5
+dqdiv054 divide -1 -4 -> 0.25
+dqdiv055 divide -1 -8 -> 0.125
+dqdiv056 divide -1 -16 -> 0.0625
+dqdiv057 divide -1 -32 -> 0.03125
+dqdiv058 divide -1 -64 -> 0.015625
+
+-- bcdTime
+dqdiv060 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded
+dqdiv061 divide 1.2345678 1.9876543 -> 0.6211179680490717123193907511985359 Inexact Rounded
+
+-- 1234567890123456
+dqdiv067 divide 9999999999999999999999999999999999 1 -> 9999999999999999999999999999999999
+dqdiv068 divide 999999999999999999999999999999999 1 -> 999999999999999999999999999999999
+dqdiv069 divide 99999999999999999999999999999999 1 -> 99999999999999999999999999999999
+dqdiv070 divide 99999999999999999 1 -> 99999999999999999
+dqdiv071 divide 9999999999999999 1 -> 9999999999999999
+dqdiv072 divide 999999999999999 1 -> 999999999999999
+dqdiv073 divide 99999999999999 1 -> 99999999999999
+dqdiv074 divide 9999999999999 1 -> 9999999999999
+dqdiv075 divide 999999999999 1 -> 999999999999
+dqdiv076 divide 99999999999 1 -> 99999999999
+dqdiv077 divide 9999999999 1 -> 9999999999
+dqdiv078 divide 999999999 1 -> 999999999
+dqdiv079 divide 99999999 1 -> 99999999
+dqdiv080 divide 9999999 1 -> 9999999
+dqdiv081 divide 999999 1 -> 999999
+dqdiv082 divide 99999 1 -> 99999
+dqdiv083 divide 9999 1 -> 9999
+dqdiv084 divide 999 1 -> 999
+dqdiv085 divide 99 1 -> 99
+dqdiv086 divide 9 1 -> 9
+
+dqdiv090 divide 0. 1 -> 0
+dqdiv091 divide .0 1 -> 0.0
+dqdiv092 divide 0.00 1 -> 0.00
+dqdiv093 divide 0.00E+9 1 -> 0E+7
+dqdiv094 divide 0.0000E-50 1 -> 0E-54
+
+dqdiv095 divide 1 1E-8 -> 1E+8
+dqdiv096 divide 1 1E-9 -> 1E+9
+dqdiv097 divide 1 1E-10 -> 1E+10
+dqdiv098 divide 1 1E-11 -> 1E+11
+dqdiv099 divide 1 1E-12 -> 1E+12
+
+dqdiv100 divide 1 1 -> 1
+dqdiv101 divide 1 2 -> 0.5
+dqdiv102 divide 1 3 -> 0.3333333333333333333333333333333333 Inexact Rounded
+dqdiv103 divide 1 4 -> 0.25
+dqdiv104 divide 1 5 -> 0.2
+dqdiv105 divide 1 6 -> 0.1666666666666666666666666666666667 Inexact Rounded
+dqdiv106 divide 1 7 -> 0.1428571428571428571428571428571429 Inexact Rounded
+dqdiv107 divide 1 8 -> 0.125
+dqdiv108 divide 1 9 -> 0.1111111111111111111111111111111111 Inexact Rounded
+dqdiv109 divide 1 10 -> 0.1
+dqdiv110 divide 1 1 -> 1
+dqdiv111 divide 2 1 -> 2
+dqdiv112 divide 3 1 -> 3
+dqdiv113 divide 4 1 -> 4
+dqdiv114 divide 5 1 -> 5
+dqdiv115 divide 6 1 -> 6
+dqdiv116 divide 7 1 -> 7
+dqdiv117 divide 8 1 -> 8
+dqdiv118 divide 9 1 -> 9
+dqdiv119 divide 10 1 -> 10
+
+dqdiv120 divide 3E+1 0.001 -> 3E+4
+dqdiv121 divide 2.200 2 -> 1.100
+
+dqdiv130 divide 12345 4.999 -> 2469.493898779755951190238047609522 Inexact Rounded
+dqdiv131 divide 12345 4.99 -> 2473.947895791583166332665330661323 Inexact Rounded
+dqdiv132 divide 12345 4.9 -> 2519.387755102040816326530612244898 Inexact Rounded
+dqdiv133 divide 12345 5 -> 2469
+dqdiv134 divide 12345 5.1 -> 2420.588235294117647058823529411765 Inexact Rounded
+dqdiv135 divide 12345 5.01 -> 2464.071856287425149700598802395210 Inexact Rounded
+dqdiv136 divide 12345 5.001 -> 2468.506298740251949610077984403119 Inexact Rounded
+
+-- test possibly imprecise results
+dqdiv220 divide 391 597 -> 0.6549413735343383584589614740368509 Inexact Rounded
+dqdiv221 divide 391 -597 -> -0.6549413735343383584589614740368509 Inexact Rounded
+dqdiv222 divide -391 597 -> -0.6549413735343383584589614740368509 Inexact Rounded
+dqdiv223 divide -391 -597 -> 0.6549413735343383584589614740368509 Inexact Rounded
+
+-- test some cases that are close to exponent overflow
+dqdiv270 divide 1 1e6144 -> 1E-6144 Subnormal
+dqdiv271 divide 1 0.9e6144 -> 1.11111111111111111111111111111111E-6144 Rounded Inexact Subnormal Underflow
+dqdiv272 divide 1 0.99e6144 -> 1.01010101010101010101010101010101E-6144 Rounded Inexact Subnormal Underflow
+dqdiv273 divide 1 0.9999999999999999e6144 -> 1.00000000000000010000000000000001E-6144 Rounded Inexact Subnormal Underflow
+dqdiv274 divide 9e6144 1 -> 9.000000000000000000000000000000000E+6144 Clamped
+dqdiv275 divide 9.9e6144 1 -> 9.900000000000000000000000000000000E+6144 Clamped
+dqdiv276 divide 9.99e6144 1 -> 9.990000000000000000000000000000000E+6144 Clamped
+dqdiv277 divide 9.999999999999999e6144 1 -> 9.999999999999999000000000000000000E+6144 Clamped
+
+dqdiv278 divide 1 0.9999999999999999999999999999999999e6144 -> 1.00000000000000000000000000000000E-6144 Rounded Inexact Subnormal Underflow
+dqdiv279 divide 9.999999999999999999999999999999999e6144 1 -> 9.999999999999999999999999999999999E+6144
+
+-- Divide into 0 tests
+dqdiv301 divide 0 7 -> 0
+dqdiv302 divide 0 7E-5 -> 0E+5
+dqdiv303 divide 0 7E-1 -> 0E+1
+dqdiv304 divide 0 7E+1 -> 0.0
+dqdiv305 divide 0 7E+5 -> 0.00000
+dqdiv306 divide 0 7E+6 -> 0.000000
+dqdiv307 divide 0 7E+7 -> 0E-7
+dqdiv308 divide 0 70E-5 -> 0E+5
+dqdiv309 divide 0 70E-1 -> 0E+1
+dqdiv310 divide 0 70E+0 -> 0
+dqdiv311 divide 0 70E+1 -> 0.0
+dqdiv312 divide 0 70E+5 -> 0.00000
+dqdiv313 divide 0 70E+6 -> 0.000000
+dqdiv314 divide 0 70E+7 -> 0E-7
+dqdiv315 divide 0 700E-5 -> 0E+5
+dqdiv316 divide 0 700E-1 -> 0E+1
+dqdiv317 divide 0 700E+0 -> 0
+dqdiv318 divide 0 700E+1 -> 0.0
+dqdiv319 divide 0 700E+5 -> 0.00000
+dqdiv320 divide 0 700E+6 -> 0.000000
+dqdiv321 divide 0 700E+7 -> 0E-7
+dqdiv322 divide 0 700E+77 -> 0E-77
+
+dqdiv331 divide 0E-3 7E-5 -> 0E+2
+dqdiv332 divide 0E-3 7E-1 -> 0.00
+dqdiv333 divide 0E-3 7E+1 -> 0.0000
+dqdiv334 divide 0E-3 7E+5 -> 0E-8
+dqdiv335 divide 0E-1 7E-5 -> 0E+4
+dqdiv336 divide 0E-1 7E-1 -> 0
+dqdiv337 divide 0E-1 7E+1 -> 0.00
+dqdiv338 divide 0E-1 7E+5 -> 0.000000
+dqdiv339 divide 0E+1 7E-5 -> 0E+6
+dqdiv340 divide 0E+1 7E-1 -> 0E+2
+dqdiv341 divide 0E+1 7E+1 -> 0
+dqdiv342 divide 0E+1 7E+5 -> 0.0000
+dqdiv343 divide 0E+3 7E-5 -> 0E+8
+dqdiv344 divide 0E+3 7E-1 -> 0E+4
+dqdiv345 divide 0E+3 7E+1 -> 0E+2
+dqdiv346 divide 0E+3 7E+5 -> 0.00
+
+-- These were 'input rounding'
+dqdiv441 divide 12345678000 1 -> 12345678000
+dqdiv442 divide 1 12345678000 -> 8.100000664200054464404466081166219E-11 Inexact Rounded
+dqdiv443 divide 1234567800 1 -> 1234567800
+dqdiv444 divide 1 1234567800 -> 8.100000664200054464404466081166219E-10 Inexact Rounded
+dqdiv445 divide 1234567890 1 -> 1234567890
+dqdiv446 divide 1 1234567890 -> 8.100000073710000670761006103925156E-10 Inexact Rounded
+dqdiv447 divide 1234567891 1 -> 1234567891
+dqdiv448 divide 1 1234567891 -> 8.100000067149000556665214614754629E-10 Inexact Rounded
+dqdiv449 divide 12345678901 1 -> 12345678901
+dqdiv450 divide 1 12345678901 -> 8.100000073053900658873130042376760E-11 Inexact Rounded
+dqdiv451 divide 1234567896 1 -> 1234567896
+dqdiv452 divide 1 1234567896 -> 8.100000034344000145618560617422697E-10 Inexact Rounded
+
+-- high-lows
+dqdiv453 divide 1e+1 1 -> 1E+1
+dqdiv454 divide 1e+1 1.0 -> 1E+1
+dqdiv455 divide 1e+1 1.00 -> 1E+1
+dqdiv456 divide 1e+2 2 -> 5E+1
+dqdiv457 divide 1e+2 2.0 -> 5E+1
+dqdiv458 divide 1e+2 2.00 -> 5E+1
+
+-- some from IEEE discussions
+dqdiv460 divide 3e0 2e0 -> 1.5
+dqdiv461 divide 30e-1 2e0 -> 1.5
+dqdiv462 divide 300e-2 2e0 -> 1.50
+dqdiv464 divide 3000e-3 2e0 -> 1.500
+dqdiv465 divide 3e0 20e-1 -> 1.5
+dqdiv466 divide 30e-1 20e-1 -> 1.5
+dqdiv467 divide 300e-2 20e-1 -> 1.5
+dqdiv468 divide 3000e-3 20e-1 -> 1.50
+dqdiv469 divide 3e0 200e-2 -> 1.5
+dqdiv470 divide 30e-1 200e-2 -> 1.5
+dqdiv471 divide 300e-2 200e-2 -> 1.5
+dqdiv472 divide 3000e-3 200e-2 -> 1.5
+dqdiv473 divide 3e0 2000e-3 -> 1.5
+dqdiv474 divide 30e-1 2000e-3 -> 1.5
+dqdiv475 divide 300e-2 2000e-3 -> 1.5
+dqdiv476 divide 3000e-3 2000e-3 -> 1.5
+
+-- some reciprocals
+dqdiv480 divide 1 1.0E+33 -> 1E-33
+dqdiv481 divide 1 10E+33 -> 1E-34
+dqdiv482 divide 1 1.0E-33 -> 1E+33
+dqdiv483 divide 1 10E-33 -> 1E+32
+
+-- RMS discussion table
+dqdiv484 divide 0e5 1e3 -> 0E+2
+dqdiv485 divide 0e5 2e3 -> 0E+2
+dqdiv486 divide 0e5 10e2 -> 0E+3
+dqdiv487 divide 0e5 20e2 -> 0E+3
+dqdiv488 divide 0e5 100e1 -> 0E+4
+dqdiv489 divide 0e5 200e1 -> 0E+4
+
+dqdiv491 divide 1e5 1e3 -> 1E+2
+dqdiv492 divide 1e5 2e3 -> 5E+1
+dqdiv493 divide 1e5 10e2 -> 1E+2
+dqdiv494 divide 1e5 20e2 -> 5E+1
+dqdiv495 divide 1e5 100e1 -> 1E+2
+dqdiv496 divide 1e5 200e1 -> 5E+1
+
+-- tryzeros cases
+rounding: half_up
+dqdiv497 divide 0E+6108 1000E-33 -> 0E+6111 Clamped
+dqdiv498 divide 0E-6170 1000E+33 -> 0E-6176 Clamped
+
+rounding: half_up
+
+-- focus on trailing zeros issues
+dqdiv500 divide 1 9.9 -> 0.1010101010101010101010101010101010 Inexact Rounded
+dqdiv501 divide 1 9.09 -> 0.1100110011001100110011001100110011 Inexact Rounded
+dqdiv502 divide 1 9.009 -> 0.1110001110001110001110001110001110 Inexact Rounded
+
+dqdiv511 divide 1 2 -> 0.5
+dqdiv512 divide 1.0 2 -> 0.5
+dqdiv513 divide 1.00 2 -> 0.50
+dqdiv514 divide 1.000 2 -> 0.500
+dqdiv515 divide 1.0000 2 -> 0.5000
+dqdiv516 divide 1.00000 2 -> 0.50000
+dqdiv517 divide 1.000000 2 -> 0.500000
+dqdiv518 divide 1.0000000 2 -> 0.5000000
+dqdiv519 divide 1.00 2.00 -> 0.5
+
+dqdiv521 divide 2 1 -> 2
+dqdiv522 divide 2 1.0 -> 2
+dqdiv523 divide 2 1.00 -> 2
+dqdiv524 divide 2 1.000 -> 2
+dqdiv525 divide 2 1.0000 -> 2
+dqdiv526 divide 2 1.00000 -> 2
+dqdiv527 divide 2 1.000000 -> 2
+dqdiv528 divide 2 1.0000000 -> 2
+dqdiv529 divide 2.00 1.00 -> 2
+
+dqdiv530 divide 2.40 2 -> 1.20
+dqdiv531 divide 2.40 4 -> 0.60
+dqdiv532 divide 2.40 10 -> 0.24
+dqdiv533 divide 2.40 2.0 -> 1.2
+dqdiv534 divide 2.40 4.0 -> 0.6
+dqdiv535 divide 2.40 10.0 -> 0.24
+dqdiv536 divide 2.40 2.00 -> 1.2
+dqdiv537 divide 2.40 4.00 -> 0.6
+dqdiv538 divide 2.40 10.00 -> 0.24
+dqdiv539 divide 0.9 0.1 -> 9
+dqdiv540 divide 0.9 0.01 -> 9E+1
+dqdiv541 divide 0.9 0.001 -> 9E+2
+dqdiv542 divide 5 2 -> 2.5
+dqdiv543 divide 5 2.0 -> 2.5
+dqdiv544 divide 5 2.00 -> 2.5
+dqdiv545 divide 5 20 -> 0.25
+dqdiv546 divide 5 20.0 -> 0.25
+dqdiv547 divide 2.400 2 -> 1.200
+dqdiv548 divide 2.400 2.0 -> 1.20
+dqdiv549 divide 2.400 2.400 -> 1
+
+dqdiv550 divide 240 1 -> 240
+dqdiv551 divide 240 10 -> 24
+dqdiv552 divide 240 100 -> 2.4
+dqdiv553 divide 240 1000 -> 0.24
+dqdiv554 divide 2400 1 -> 2400
+dqdiv555 divide 2400 10 -> 240
+dqdiv556 divide 2400 100 -> 24
+dqdiv557 divide 2400 1000 -> 2.4
+
+-- +ve exponent
+dqdiv600 divide 2.4E+9 2 -> 1.2E+9
+dqdiv601 divide 2.40E+9 2 -> 1.20E+9
+dqdiv602 divide 2.400E+9 2 -> 1.200E+9
+dqdiv603 divide 2.4000E+9 2 -> 1.2000E+9
+dqdiv604 divide 24E+8 2 -> 1.2E+9
+dqdiv605 divide 240E+7 2 -> 1.20E+9
+dqdiv606 divide 2400E+6 2 -> 1.200E+9
+dqdiv607 divide 24000E+5 2 -> 1.2000E+9
+
+-- more zeros, etc.
+dqdiv731 divide 5.00 1E-3 -> 5.00E+3
+dqdiv732 divide 00.00 0.000 -> NaN Division_undefined
+dqdiv733 divide 00.00 0E-3 -> NaN Division_undefined
+dqdiv734 divide 0 -0 -> NaN Division_undefined
+dqdiv735 divide -0 0 -> NaN Division_undefined
+dqdiv736 divide -0 -0 -> NaN Division_undefined
+
+dqdiv741 divide 0 -1 -> -0
+dqdiv742 divide -0 -1 -> 0
+dqdiv743 divide 0 1 -> 0
+dqdiv744 divide -0 1 -> -0
+dqdiv745 divide -1 0 -> -Infinity Division_by_zero
+dqdiv746 divide -1 -0 -> Infinity Division_by_zero
+dqdiv747 divide 1 0 -> Infinity Division_by_zero
+dqdiv748 divide 1 -0 -> -Infinity Division_by_zero
+
+dqdiv751 divide 0.0 -1 -> -0.0
+dqdiv752 divide -0.0 -1 -> 0.0
+dqdiv753 divide 0.0 1 -> 0.0
+dqdiv754 divide -0.0 1 -> -0.0
+dqdiv755 divide -1.0 0 -> -Infinity Division_by_zero
+dqdiv756 divide -1.0 -0 -> Infinity Division_by_zero
+dqdiv757 divide 1.0 0 -> Infinity Division_by_zero
+dqdiv758 divide 1.0 -0 -> -Infinity Division_by_zero
+
+dqdiv761 divide 0 -1.0 -> -0E+1
+dqdiv762 divide -0 -1.0 -> 0E+1
+dqdiv763 divide 0 1.0 -> 0E+1
+dqdiv764 divide -0 1.0 -> -0E+1
+dqdiv765 divide -1 0.0 -> -Infinity Division_by_zero
+dqdiv766 divide -1 -0.0 -> Infinity Division_by_zero
+dqdiv767 divide 1 0.0 -> Infinity Division_by_zero
+dqdiv768 divide 1 -0.0 -> -Infinity Division_by_zero
+
+dqdiv771 divide 0.0 -1.0 -> -0
+dqdiv772 divide -0.0 -1.0 -> 0
+dqdiv773 divide 0.0 1.0 -> 0
+dqdiv774 divide -0.0 1.0 -> -0
+dqdiv775 divide -1.0 0.0 -> -Infinity Division_by_zero
+dqdiv776 divide -1.0 -0.0 -> Infinity Division_by_zero
+dqdiv777 divide 1.0 0.0 -> Infinity Division_by_zero
+dqdiv778 divide 1.0 -0.0 -> -Infinity Division_by_zero
+
+-- Specials
+dqdiv780 divide Inf -Inf -> NaN Invalid_operation
+dqdiv781 divide Inf -1000 -> -Infinity
+dqdiv782 divide Inf -1 -> -Infinity
+dqdiv783 divide Inf -0 -> -Infinity
+dqdiv784 divide Inf 0 -> Infinity
+dqdiv785 divide Inf 1 -> Infinity
+dqdiv786 divide Inf 1000 -> Infinity
+dqdiv787 divide Inf Inf -> NaN Invalid_operation
+dqdiv788 divide -1000 Inf -> -0E-6176 Clamped
+dqdiv789 divide -Inf Inf -> NaN Invalid_operation
+dqdiv790 divide -1 Inf -> -0E-6176 Clamped
+dqdiv791 divide -0 Inf -> -0E-6176 Clamped
+dqdiv792 divide 0 Inf -> 0E-6176 Clamped
+dqdiv793 divide 1 Inf -> 0E-6176 Clamped
+dqdiv794 divide 1000 Inf -> 0E-6176 Clamped
+dqdiv795 divide Inf Inf -> NaN Invalid_operation
+
+dqdiv800 divide -Inf -Inf -> NaN Invalid_operation
+dqdiv801 divide -Inf -1000 -> Infinity
+dqdiv802 divide -Inf -1 -> Infinity
+dqdiv803 divide -Inf -0 -> Infinity
+dqdiv804 divide -Inf 0 -> -Infinity
+dqdiv805 divide -Inf 1 -> -Infinity
+dqdiv806 divide -Inf 1000 -> -Infinity
+dqdiv807 divide -Inf Inf -> NaN Invalid_operation
+dqdiv808 divide -1000 Inf -> -0E-6176 Clamped
+dqdiv809 divide -Inf -Inf -> NaN Invalid_operation
+dqdiv810 divide -1 -Inf -> 0E-6176 Clamped
+dqdiv811 divide -0 -Inf -> 0E-6176 Clamped
+dqdiv812 divide 0 -Inf -> -0E-6176 Clamped
+dqdiv813 divide 1 -Inf -> -0E-6176 Clamped
+dqdiv814 divide 1000 -Inf -> -0E-6176 Clamped
+dqdiv815 divide Inf -Inf -> NaN Invalid_operation
+
+dqdiv821 divide NaN -Inf -> NaN
+dqdiv822 divide NaN -1000 -> NaN
+dqdiv823 divide NaN -1 -> NaN
+dqdiv824 divide NaN -0 -> NaN
+dqdiv825 divide NaN 0 -> NaN
+dqdiv826 divide NaN 1 -> NaN
+dqdiv827 divide NaN 1000 -> NaN
+dqdiv828 divide NaN Inf -> NaN
+dqdiv829 divide NaN NaN -> NaN
+dqdiv830 divide -Inf NaN -> NaN
+dqdiv831 divide -1000 NaN -> NaN
+dqdiv832 divide -1 NaN -> NaN
+dqdiv833 divide -0 NaN -> NaN
+dqdiv834 divide 0 NaN -> NaN
+dqdiv835 divide 1 NaN -> NaN
+dqdiv836 divide 1000 NaN -> NaN
+dqdiv837 divide Inf NaN -> NaN
+
+dqdiv841 divide sNaN -Inf -> NaN Invalid_operation
+dqdiv842 divide sNaN -1000 -> NaN Invalid_operation
+dqdiv843 divide sNaN -1 -> NaN Invalid_operation
+dqdiv844 divide sNaN -0 -> NaN Invalid_operation
+dqdiv845 divide sNaN 0 -> NaN Invalid_operation
+dqdiv846 divide sNaN 1 -> NaN Invalid_operation
+dqdiv847 divide sNaN 1000 -> NaN Invalid_operation
+dqdiv848 divide sNaN NaN -> NaN Invalid_operation
+dqdiv849 divide sNaN sNaN -> NaN Invalid_operation
+dqdiv850 divide NaN sNaN -> NaN Invalid_operation
+dqdiv851 divide -Inf sNaN -> NaN Invalid_operation
+dqdiv852 divide -1000 sNaN -> NaN Invalid_operation
+dqdiv853 divide -1 sNaN -> NaN Invalid_operation
+dqdiv854 divide -0 sNaN -> NaN Invalid_operation
+dqdiv855 divide 0 sNaN -> NaN Invalid_operation
+dqdiv856 divide 1 sNaN -> NaN Invalid_operation
+dqdiv857 divide 1000 sNaN -> NaN Invalid_operation
+dqdiv858 divide Inf sNaN -> NaN Invalid_operation
+dqdiv859 divide NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqdiv861 divide NaN9 -Inf -> NaN9
+dqdiv862 divide NaN8 1000 -> NaN8
+dqdiv863 divide NaN7 Inf -> NaN7
+dqdiv864 divide NaN6 NaN5 -> NaN6
+dqdiv865 divide -Inf NaN4 -> NaN4
+dqdiv866 divide -1000 NaN3 -> NaN3
+dqdiv867 divide Inf NaN2 -> NaN2
+
+dqdiv871 divide sNaN99 -Inf -> NaN99 Invalid_operation
+dqdiv872 divide sNaN98 -1 -> NaN98 Invalid_operation
+dqdiv873 divide sNaN97 NaN -> NaN97 Invalid_operation
+dqdiv874 divide sNaN96 sNaN94 -> NaN96 Invalid_operation
+dqdiv875 divide NaN95 sNaN93 -> NaN93 Invalid_operation
+dqdiv876 divide -Inf sNaN92 -> NaN92 Invalid_operation
+dqdiv877 divide 0 sNaN91 -> NaN91 Invalid_operation
+dqdiv878 divide Inf sNaN90 -> NaN90 Invalid_operation
+dqdiv879 divide NaN sNaN89 -> NaN89 Invalid_operation
+
+dqdiv881 divide -NaN9 -Inf -> -NaN9
+dqdiv882 divide -NaN8 1000 -> -NaN8
+dqdiv883 divide -NaN7 Inf -> -NaN7
+dqdiv884 divide -NaN6 -NaN5 -> -NaN6
+dqdiv885 divide -Inf -NaN4 -> -NaN4
+dqdiv886 divide -1000 -NaN3 -> -NaN3
+dqdiv887 divide Inf -NaN2 -> -NaN2
+
+dqdiv891 divide -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqdiv892 divide -sNaN98 -1 -> -NaN98 Invalid_operation
+dqdiv893 divide -sNaN97 NaN -> -NaN97 Invalid_operation
+dqdiv894 divide -sNaN96 -sNaN94 -> -NaN96 Invalid_operation
+dqdiv895 divide -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+dqdiv896 divide -Inf -sNaN92 -> -NaN92 Invalid_operation
+dqdiv897 divide 0 -sNaN91 -> -NaN91 Invalid_operation
+dqdiv898 divide Inf -sNaN90 -> -NaN90 Invalid_operation
+dqdiv899 divide -NaN -sNaN89 -> -NaN89 Invalid_operation
+
+-- Various flavours of divide by 0
+dqdiv901 divide 0 0 -> NaN Division_undefined
+dqdiv902 divide 0.0E5 0 -> NaN Division_undefined
+dqdiv903 divide 0.000 0 -> NaN Division_undefined
+dqdiv904 divide 0.0001 0 -> Infinity Division_by_zero
+dqdiv905 divide 0.01 0 -> Infinity Division_by_zero
+dqdiv906 divide 0.1 0 -> Infinity Division_by_zero
+dqdiv907 divide 1 0 -> Infinity Division_by_zero
+dqdiv908 divide 1 0.0 -> Infinity Division_by_zero
+dqdiv909 divide 10 0.0 -> Infinity Division_by_zero
+dqdiv910 divide 1E+100 0.0 -> Infinity Division_by_zero
+dqdiv911 divide 1E+100 0 -> Infinity Division_by_zero
+
+dqdiv921 divide -0.0001 0 -> -Infinity Division_by_zero
+dqdiv922 divide -0.01 0 -> -Infinity Division_by_zero
+dqdiv923 divide -0.1 0 -> -Infinity Division_by_zero
+dqdiv924 divide -1 0 -> -Infinity Division_by_zero
+dqdiv925 divide -1 0.0 -> -Infinity Division_by_zero
+dqdiv926 divide -10 0.0 -> -Infinity Division_by_zero
+dqdiv927 divide -1E+100 0.0 -> -Infinity Division_by_zero
+dqdiv928 divide -1E+100 0 -> -Infinity Division_by_zero
+
+dqdiv931 divide 0.0001 -0 -> -Infinity Division_by_zero
+dqdiv932 divide 0.01 -0 -> -Infinity Division_by_zero
+dqdiv933 divide 0.1 -0 -> -Infinity Division_by_zero
+dqdiv934 divide 1 -0 -> -Infinity Division_by_zero
+dqdiv935 divide 1 -0.0 -> -Infinity Division_by_zero
+dqdiv936 divide 10 -0.0 -> -Infinity Division_by_zero
+dqdiv937 divide 1E+100 -0.0 -> -Infinity Division_by_zero
+dqdiv938 divide 1E+100 -0 -> -Infinity Division_by_zero
+
+dqdiv941 divide -0.0001 -0 -> Infinity Division_by_zero
+dqdiv942 divide -0.01 -0 -> Infinity Division_by_zero
+dqdiv943 divide -0.1 -0 -> Infinity Division_by_zero
+dqdiv944 divide -1 -0 -> Infinity Division_by_zero
+dqdiv945 divide -1 -0.0 -> Infinity Division_by_zero
+dqdiv946 divide -10 -0.0 -> Infinity Division_by_zero
+dqdiv947 divide -1E+100 -0.0 -> Infinity Division_by_zero
+dqdiv948 divide -1E+100 -0 -> Infinity Division_by_zero
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dqdiv1021 divide 1E0 1E0 -> 1
+dqdiv1022 divide 1E0 2E0 -> 0.5
+dqdiv1023 divide 1E0 3E0 -> 0.3333333333333333333333333333333333 Inexact Rounded
+dqdiv1024 divide 100E-2 1000E-3 -> 1
+dqdiv1025 divide 24E-1 2E0 -> 1.2
+dqdiv1026 divide 2400E-3 2E0 -> 1.200
+dqdiv1027 divide 5E0 2E0 -> 2.5
+dqdiv1028 divide 5E0 20E-1 -> 2.5
+dqdiv1029 divide 5E0 2000E-3 -> 2.5
+dqdiv1030 divide 5E0 2E-1 -> 25
+dqdiv1031 divide 5E0 20E-2 -> 25
+dqdiv1032 divide 480E-2 3E0 -> 1.60
+dqdiv1033 divide 47E-1 2E0 -> 2.35
+
+-- ECMAScript bad examples
+rounding: half_down
+dqdiv1040 divide 5 9 -> 0.5555555555555555555555555555555556 Inexact Rounded
+rounding: half_even
+dqdiv1041 divide 6 11 -> 0.5454545454545454545454545454545455 Inexact Rounded
+
+-- Gyuris example
+dqdiv1050 divide 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0.9999999999999999999999999999991254 Inexact Rounded
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+dqdiv1751 divide 1e+4277 1e-3311 -> Infinity Overflow Inexact Rounded
+dqdiv1752 divide 1e+4277 -1e-3311 -> -Infinity Overflow Inexact Rounded
+dqdiv1753 divide -1e+4277 1e-3311 -> -Infinity Overflow Inexact Rounded
+dqdiv1754 divide -1e+4277 -1e-3311 -> Infinity Overflow Inexact Rounded
+dqdiv1755 divide 1e-4277 1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1756 divide 1e-4277 -1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1757 divide -1e-4277 1e+3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1758 divide -1e-4277 -1e+3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dqdiv1760 divide 1e-6069 1e+101 -> 1E-6170 Subnormal
+dqdiv1761 divide 1e-6069 1e+102 -> 1E-6171 Subnormal
+dqdiv1762 divide 1e-6069 1e+103 -> 1E-6172 Subnormal
+dqdiv1763 divide 1e-6069 1e+104 -> 1E-6173 Subnormal
+dqdiv1764 divide 1e-6069 1e+105 -> 1E-6174 Subnormal
+dqdiv1765 divide 1e-6069 1e+106 -> 1E-6175 Subnormal
+dqdiv1766 divide 1e-6069 1e+107 -> 1E-6176 Subnormal
+dqdiv1767 divide 1e-6069 1e+108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1768 divide 1e-6069 1e+109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1769 divide 1e-6069 1e+110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+dqdiv1770 divide 1e+40 1e-6101 -> 1.000000000000000000000000000000E+6141 Clamped
+dqdiv1771 divide 1e+40 1e-6102 -> 1.0000000000000000000000000000000E+6142 Clamped
+dqdiv1772 divide 1e+40 1e-6103 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqdiv1773 divide 1e+40 1e-6104 -> 1.000000000000000000000000000000000E+6144 Clamped
+dqdiv1774 divide 1e+40 1e-6105 -> Infinity Overflow Inexact Rounded
+dqdiv1775 divide 1e+40 1e-6106 -> Infinity Overflow Inexact Rounded
+dqdiv1776 divide 1e+40 1e-6107 -> Infinity Overflow Inexact Rounded
+dqdiv1777 divide 1e+40 1e-6108 -> Infinity Overflow Inexact Rounded
+dqdiv1778 divide 1e+40 1e-6109 -> Infinity Overflow Inexact Rounded
+dqdiv1779 divide 1e+40 1e-6110 -> Infinity Overflow Inexact Rounded
+
+dqdiv1801 divide 1.0000E-6172 1 -> 1.0000E-6172 Subnormal
+dqdiv1802 divide 1.000E-6172 1e+1 -> 1.000E-6173 Subnormal
+dqdiv1803 divide 1.00E-6172 1e+2 -> 1.00E-6174 Subnormal
+dqdiv1804 divide 1.0E-6172 1e+3 -> 1.0E-6175 Subnormal
+dqdiv1805 divide 1.0E-6172 1e+4 -> 1E-6176 Subnormal Rounded
+dqdiv1806 divide 1.3E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1807 divide 1.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1808 divide 1.7E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1809 divide 2.3E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1810 divide 2.5E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1811 divide 2.7E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1812 divide 1.49E-6172 1e+4 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1813 divide 1.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1814 divide 1.51E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1815 divide 2.49E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1816 divide 2.50E-6172 1e+4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1817 divide 2.51E-6172 1e+4 -> 3E-6176 Underflow Subnormal Inexact Rounded
+
+dqdiv1818 divide 1E-6172 1e+4 -> 1E-6176 Subnormal
+dqdiv1819 divide 3E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1820 divide 5E-6172 1e+5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1821 divide 7E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1822 divide 9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1823 divide 9.9E-6172 1e+5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+dqdiv1824 divide 1E-6172 -1e+4 -> -1E-6176 Subnormal
+dqdiv1825 divide 3E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1826 divide -5E-6172 1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1827 divide 7E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1828 divide -9E-6172 1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1829 divide 9.9E-6172 -1e+5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqdiv1830 divide 3.0E-6172 -1e+5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqdiv1831 divide 1.0E-5977 1e+200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqdiv1832 divide 1.0E-5977 1e+199 -> 1E-6176 Subnormal Rounded
+dqdiv1833 divide 1.0E-5977 1e+198 -> 1.0E-6175 Subnormal
+dqdiv1834 divide 2.0E-5977 2e+198 -> 1.0E-6175 Subnormal
+dqdiv1835 divide 4.0E-5977 4e+198 -> 1.0E-6175 Subnormal
+dqdiv1836 divide 10.0E-5977 10e+198 -> 1.0E-6175 Subnormal
+dqdiv1837 divide 30.0E-5977 30e+198 -> 1.0E-6175 Subnormal
+dqdiv1838 divide 40.0E-5982 40e+166 -> 1.0E-6148 Subnormal
+dqdiv1839 divide 40.0E-5982 40e+165 -> 1.0E-6147 Subnormal
+dqdiv1840 divide 40.0E-5982 40e+164 -> 1.0E-6146 Subnormal
+
+-- randoms
+rounding: half_even
+dqdiv2010 divide -5231195652931651968034356117118850 -7243718664422548573203260970.34995 -> 722169.9095831284624736051460550680 Inexact Rounded
+dqdiv2011 divide -89584669773927.82711237350022515352 -42077943728529635884.21142627532985 -> 0.000002129017291146471565928125887527266 Inexact Rounded
+dqdiv2012 divide -2.828201693360723203806974891946180E-232 812596541221823960386384403089240.9 -> -3.480450075640521320040055759125120E-265 Inexact Rounded
+dqdiv2013 divide -6442775372761069267502937539408720 24904085056.69185465145182606089196 -> -258703556388226463687701.4884719589 Inexact Rounded
+dqdiv2014 divide 5.535520011272625629610079879714705 -44343664650.57203052003068113531208 -> -1.248322630728089308975940533493562E-10 Inexact Rounded
+dqdiv2015 divide 65919273712517865964325.99419625010 -314733354141381737378622515.7789054 -> -0.0002094448295521490616379784758911632 Inexact Rounded
+dqdiv2016 divide -7.779172568193197107115275140431129E+759 -140453015639.3988987652895178782143 -> 5.538629792161641534962774244238115E+748 Inexact Rounded
+dqdiv2017 divide 644314832597569.0181226067518178797 -115024585257425.1635759521565201075 -> -5.601540150356479257367687450922795 Inexact Rounded
+dqdiv2018 divide 6.898640941579611450676592553286870E-47 -11272429881407851485163914999.25943 -> -6.119923578285338689371137648319280E-75 Inexact Rounded
+dqdiv2019 divide -3591344544888727133.30819750163254 5329395.423792795661446561090331037 -> -673874662941.1968525589460533725290 Inexact Rounded
+dqdiv2020 divide -7.682356781384631313156462724425838E+747 -6.60375855512219057281922141809940E+703 -> 1.163330960279556016678379128875149E+44 Inexact Rounded
+dqdiv2021 divide -4511495596596941820863224.274679699 3365395017.263329795449661616090724 -> -1340554548115304.904166888018346299 Inexact Rounded
+dqdiv2022 divide 5.211164127840931517263639608151299 164.5566381356276567012533847006453 -> 0.03166790587655228864478260157156510 Inexact Rounded
+dqdiv2023 divide -49891.2243893458830384077684620383 -47179.9312961860747554053371171530 -> 1.057467084386767291602189656430268 Inexact Rounded
+dqdiv2024 divide 15065477.47214268488077415462413353 4366211.120892953261309529740552596 -> 3.450469309661227984244545513441359 Inexact Rounded
+dqdiv2025 divide 1.575670269440761846109602429612644E+370 653199649324740300.006185482643439 -> 2.412233795700359170904588548041481E+352 Inexact Rounded
+dqdiv2026 divide -2112422311733448924573432192.620145 -80067206.03590693153848215848613406 -> 26383115089417660175.20102646756574 Inexact Rounded
+dqdiv2027 divide -67096536051279809.32218611548721839 -869685412881941081664251990181.1049 -> 7.715035236584805921278566365231168E-14 Inexact Rounded
+dqdiv2028 divide -58612908548962047.21866913425488972 -978449597531.3873665583475633831644 -> 59903.86085991703091236507859837023 Inexact Rounded
+dqdiv2029 divide -133032412010942.1476864138213319796 -7.882059293498670705446528648201359E-428 -> 1.687787506504433064549515681693715E+441 Inexact Rounded
+dqdiv2030 divide 1.83746698338966029492299716360513E+977 -9.897926608979649951672839879128603E+154 -> -1.856416051542212552042390218062458E+822 Inexact Rounded
+dqdiv2031 divide -113742475841399236307128962.1507063 8298602.203049834732657567965262989 -> -13706221006665137826.16557393919929 Inexact Rounded
+dqdiv2032 divide 196.4787574650754152995941808331862 929.6553388472318094427422117172394 -> 0.2113458066176526651006917922814018 Inexact Rounded
+dqdiv2033 divide 71931221465.43867996282803628130350 3838685934206426257090718.402248853 -> 1.873850132527423413607199513324021E-14 Inexact Rounded
+dqdiv2034 divide 488.4282502289651653783596246312885 -80.68940956806634280078706577953188 -> -6.053189047280693318844801899473272 Inexact Rounded
+dqdiv2035 divide 9.001764344963921754981762913247394E-162 -8.585540973667205753734967645386919E-729 -> -1.048479574271827326396012573232934E+567 Inexact Rounded
+dqdiv2036 divide -7.404133959409894743706402857145471E-828 -51.38159929460289711134684843086265 -> 1.441008855516029461032061785219773E-829 Inexact Rounded
+dqdiv2037 divide 2.967520235574419794048994436040717E-613 -6252513855.91394894949879262731889 -> -4.746123405656409127572998751885338E-623 Inexact Rounded
+dqdiv2038 divide -18826852654824040505.83920366765051 -6336924877942437992590557460147340 -> 2.970976146546494669807886278519194E-15 Inexact Rounded
+dqdiv2039 divide -8.101406784809197604949584001735949E+561 4.823300306948942821076681658771635E+361 -> -1.679639721610839204738445747238987E+200 Inexact Rounded
+dqdiv2040 divide -6.11981977773094052331062585191723E+295 1.507610253755339328302779005586534E+238 -> -4.059285058911577244044418416044763E+57 Inexact Rounded
+dqdiv2041 divide 6.472638850046815880599220534274055E-596 -4.475233712083047516933911786159972 -> -1.446324207062261745520496475778879E-596 Inexact Rounded
+dqdiv2042 divide -84438593330.71277839631144509397112 -586684596204401664208947.4054879633 -> 1.439250218550041228759983937772504E-13 Inexact Rounded
+dqdiv2043 divide 9.354533233294022616695815656704369E-24 405.500390626135304252144163591746 -> 2.306911028827774549740571229736198E-26 Inexact Rounded
+dqdiv2044 divide 985606423350210.7374876650149957881 -36811563697.41925681866694859828794 -> -26774.36990864119445335813354717711 Inexact Rounded
+dqdiv2045 divide -8.187280774177715706278002247766311E-123 -38784124393.91212870828430001300068 -> 2.110987653356139147357240727794365E-133 Inexact Rounded
+dqdiv2046 divide -4.612203126350070903459245798371657E+912 7.971562182727956290901984736800519E+64 -> -5.785820922708683237098826662769748E+847 Inexact Rounded
+dqdiv2047 divide 4.661015909421485298247928967977089E+888 -6.360911253323922338737311563845581E+388 -> -7.327591478321365980156654539638836E+499 Inexact Rounded
+dqdiv2048 divide 9156078172903.257500003260710833030 7.189796653262147139071634237964074E-90 -> 1.273482215766000994365201545096026E+102 Inexact Rounded
+dqdiv2049 divide -1.710722303327476586373477781276586E-311 -3167561628260156837329323.729380695 -> 5.400754599578613984875752958645655E-336 Inexact Rounded
+dqdiv2050 divide -4.647935210881806238321616345413021E-878 209388.5431867744648177308460639582 -> -2.219765771394593733140494297388140E-883 Inexact Rounded
+dqdiv2051 divide 5958.694728395760992719084781582700 4.541510156564315632536353171846096E-746 -> 1.312051393253638664947852693005480E+749 Inexact Rounded
+dqdiv2052 divide -7.935732544649702175256699886872093E-489 -7.433329073664793138998765647467971E+360 -> 1.067587949626076917672271619664656E-849 Inexact Rounded
+dqdiv2053 divide -2746650864601157.863589959939901350 7.016684945507647528907184694359598E+548 -> -3.914456593009309529351254950429932E-534 Inexact Rounded
+dqdiv2054 divide 3605149408631197365447953.994569178 -75614025825649082.78264864428237833 -> -47678315.88472693507060063188020532 Inexact Rounded
+dqdiv2055 divide 788194320921798404906375214.196349 -6.222718148433247384932573401976337E-418 -> -1.266639918634671803982222244977287E+444 Inexact Rounded
+dqdiv2056 divide 5620722730534752.758208943447603211 6.843552841168538319123000917657759E-139 -> 8.213164800485434666629970443739554E+153 Inexact Rounded
+dqdiv2057 divide 7304534676713703938102.403949019402 -576169.3685010935108153023803590835 -> -12677756014201995.31969237144394772 Inexact Rounded
+dqdiv2058 divide 8067918762.134621639254916786945547 -8.774771480055536009105596163864758E+954 -> -9.194448858836332156766764605125245E-946 Inexact Rounded
+dqdiv2059 divide 8.702093454123046507578256899537563E-324 -5.875399733016018404580201176576293E-401 -> -1.481106622452052581470443526957335E+77 Inexact Rounded
+dqdiv2060 divide -41426.01662518451861386352415092356 90.00146621684478300510769802013464 -> -460.2815750287318692732067709176200 Inexact Rounded
+
+-- random divide tests with result near 1
+dqdiv4001 divide 2003100352770753969878925664524900 2003100352770753969878925664497824 -> 1.000000000000000000000000000013517 Inexact Rounded
+dqdiv4002 divide 4817785793916490652579552318371645 4817785793916490652579552318362097 -> 1.000000000000000000000000000001982 Inexact Rounded
+dqdiv4003 divide 8299187410920067325648068439560282 8299187410920067325648068439591159 -> 0.9999999999999999999999999999962795 Inexact Rounded
+dqdiv4004 divide 5641088455897407044544461785365899 5641088455897407044544461785389965 -> 0.9999999999999999999999999999957338 Inexact Rounded
+dqdiv4005 divide 5752274694706545359326361313490424 5752274694706545359326361313502723 -> 0.9999999999999999999999999999978619 Inexact Rounded
+dqdiv4006 divide 6762079477373670594829319346099665 6762079477373670594829319346132579 -> 0.9999999999999999999999999999951326 Inexact Rounded
+dqdiv4007 divide 7286425153691890341633023222602916 7286425153691890341633023222606556 -> 0.9999999999999999999999999999995004 Inexact Rounded
+dqdiv4008 divide 9481233991901305727648306421946655 9481233991901305727648306421919124 -> 1.000000000000000000000000000002904 Inexact Rounded
+dqdiv4009 divide 4282053941893951742029444065614311 4282053941893951742029444065583077 -> 1.000000000000000000000000000007294 Inexact Rounded
+dqdiv4010 divide 626888225441250639741781850338695 626888225441250639741781850327299 -> 1.000000000000000000000000000018179 Inexact Rounded
+dqdiv4011 divide 3860973649222028009456598604468547 3860973649222028009456598604476849 -> 0.9999999999999999999999999999978498 Inexact Rounded
+dqdiv4012 divide 4753157080127468127908060607821839 4753157080127468127908060607788379 -> 1.000000000000000000000000000007040 Inexact Rounded
+dqdiv4013 divide 552448546203754062805706277880419 552448546203754062805706277881903 -> 0.9999999999999999999999999999973138 Inexact Rounded
+dqdiv4014 divide 8405954527952158455323713728917395 8405954527952158455323713728933866 -> 0.9999999999999999999999999999980406 Inexact Rounded
+dqdiv4015 divide 7554096502235321142555802238016116 7554096502235321142555802238026546 -> 0.9999999999999999999999999999986193 Inexact Rounded
+dqdiv4016 divide 4053257674127518606871054934746782 4053257674127518606871054934767355 -> 0.9999999999999999999999999999949243 Inexact Rounded
+dqdiv4017 divide 7112419420755090454716888844011582 7112419420755090454716888844038105 -> 0.9999999999999999999999999999962709 Inexact Rounded
+dqdiv4018 divide 3132302137520072728164549730911846 3132302137520072728164549730908416 -> 1.000000000000000000000000000001095 Inexact Rounded
+dqdiv4019 divide 4788374045841416355706715048161013 4788374045841416355706715048190077 -> 0.9999999999999999999999999999939303 Inexact Rounded
+dqdiv4020 divide 9466021636047630218238075099510597 9466021636047630218238075099484053 -> 1.000000000000000000000000000002804 Inexact Rounded
+dqdiv4021 divide 912742745646765625597399692138650 912742745646765625597399692139042 -> 0.9999999999999999999999999999995705 Inexact Rounded
+dqdiv4022 divide 9508402742933643208806264897188504 9508402742933643208806264897195973 -> 0.9999999999999999999999999999992145 Inexact Rounded
+dqdiv4023 divide 1186956795727233704962361914360895 1186956795727233704962361914329577 -> 1.000000000000000000000000000026385 Inexact Rounded
+dqdiv4024 divide 5972210268839014812696916170967938 5972210268839014812696916170954974 -> 1.000000000000000000000000000002171 Inexact Rounded
+dqdiv4025 divide 2303801625521619930894460139793140 2303801625521619930894460139799643 -> 0.9999999999999999999999999999971773 Inexact Rounded
+dqdiv4026 divide 6022231560002898264777393473966595 6022231560002898264777393473947198 -> 1.000000000000000000000000000003221 Inexact Rounded
+dqdiv4027 divide 8426148335801396199969346032210893 8426148335801396199969346032203179 -> 1.000000000000000000000000000000915 Inexact Rounded
+dqdiv4028 divide 8812278947028784637382847098411749 8812278947028784637382847098385317 -> 1.000000000000000000000000000002999 Inexact Rounded
+dqdiv4029 divide 8145282002348367383264197170116146 8145282002348367383264197170083988 -> 1.000000000000000000000000000003948 Inexact Rounded
+dqdiv4030 divide 6821577571876840153123510107387026 6821577571876840153123510107418008 -> 0.9999999999999999999999999999954582 Inexact Rounded
+dqdiv4031 divide 9018555319518966970480565482023720 9018555319518966970480565482013346 -> 1.000000000000000000000000000001150 Inexact Rounded
+dqdiv4032 divide 4602155712998228449640717252788864 4602155712998228449640717252818502 -> 0.9999999999999999999999999999935600 Inexact Rounded
+dqdiv4033 divide 6675607481522785614506828292264472 6675607481522785614506828292277100 -> 0.9999999999999999999999999999981083 Inexact Rounded
+dqdiv4034 divide 4015881516871833897766945836264472 4015881516871833897766945836262645 -> 1.000000000000000000000000000000455 Inexact Rounded
+dqdiv4035 divide 1415580205933411837595459716910365 1415580205933411837595459716880139 -> 1.000000000000000000000000000021352 Inexact Rounded
+dqdiv4036 divide 9432968297069542816752035276361552 9432968297069542816752035276353054 -> 1.000000000000000000000000000000901 Inexact Rounded
+dqdiv4037 divide 4799319591303848500532766682140658 4799319591303848500532766682172655 -> 0.9999999999999999999999999999933330 Inexact Rounded
+dqdiv4038 divide 316854270732839529790584284987472 316854270732839529790584285004832 -> 0.9999999999999999999999999999452114 Inexact Rounded
+dqdiv4039 divide 3598981300592490427826027975697415 3598981300592490427826027975686712 -> 1.000000000000000000000000000002974 Inexact Rounded
+dqdiv4040 divide 1664315435694461371155800682196520 1664315435694461371155800682195617 -> 1.000000000000000000000000000000543 Inexact Rounded
+dqdiv4041 divide 1680872316531128890102855316510581 1680872316531128890102855316495545 -> 1.000000000000000000000000000008945 Inexact Rounded
+dqdiv4042 divide 9881274879566405475755499281644730 9881274879566405475755499281615743 -> 1.000000000000000000000000000002934 Inexact Rounded
+dqdiv4043 divide 4737225957717466960447204232279216 4737225957717466960447204232277452 -> 1.000000000000000000000000000000372 Inexact Rounded
+dqdiv4044 divide 2482097379414867061213319346418288 2482097379414867061213319346387936 -> 1.000000000000000000000000000012228 Inexact Rounded
+dqdiv4045 divide 7406977595233762723576434122161868 7406977595233762723576434122189042 -> 0.9999999999999999999999999999963313 Inexact Rounded
+dqdiv4046 divide 228782057757566047086593281773577 228782057757566047086593281769727 -> 1.000000000000000000000000000016828 Inexact Rounded
+dqdiv4047 divide 2956594270240579648823270540367653 2956594270240579648823270540368556 -> 0.9999999999999999999999999999996946 Inexact Rounded
+dqdiv4048 divide 6326964098897620620534136767634340 6326964098897620620534136767619339 -> 1.000000000000000000000000000002371 Inexact Rounded
+dqdiv4049 divide 414586440456590215247002678327800 414586440456590215247002678316922 -> 1.000000000000000000000000000026238 Inexact Rounded
+dqdiv4050 divide 7364552208570039386220505636779125 7364552208570039386220505636803548 -> 0.9999999999999999999999999999966837 Inexact Rounded
+dqdiv4051 divide 5626266749902369710022824950590056 5626266749902369710022824950591008 -> 0.9999999999999999999999999999998308 Inexact Rounded
+dqdiv4052 divide 4863278293916197454987481343460484 4863278293916197454987481343442522 -> 1.000000000000000000000000000003693 Inexact Rounded
+dqdiv4053 divide 1170713582030637359713249796835483 1170713582030637359713249796823345 -> 1.000000000000000000000000000010368 Inexact Rounded
+dqdiv4054 divide 9838062494725965667776326556052931 9838062494725965667776326556061002 -> 0.9999999999999999999999999999991796 Inexact Rounded
+dqdiv4055 divide 4071388731298861093005687091498922 4071388731298861093005687091498278 -> 1.000000000000000000000000000000158 Inexact Rounded
+dqdiv4056 divide 8753155722324706795855038590272526 8753155722324706795855038590276656 -> 0.9999999999999999999999999999995282 Inexact Rounded
+dqdiv4057 divide 4399941911533273418844742658240485 4399941911533273418844742658219891 -> 1.000000000000000000000000000004681 Inexact Rounded
+dqdiv4058 divide 4127884159949503677776430620050269 4127884159949503677776430620026091 -> 1.000000000000000000000000000005857 Inexact Rounded
+dqdiv4059 divide 5536160822360800067042528317438808 5536160822360800067042528317450687 -> 0.9999999999999999999999999999978543 Inexact Rounded
+dqdiv4060 divide 3973234998468664936671088237710246 3973234998468664936671088237741886 -> 0.9999999999999999999999999999920367 Inexact Rounded
+dqdiv4061 divide 9824855935638263593410444142327358 9824855935638263593410444142328576 -> 0.9999999999999999999999999999998760 Inexact Rounded
+dqdiv4062 divide 5917078517340218131867327300814867 5917078517340218131867327300788701 -> 1.000000000000000000000000000004422 Inexact Rounded
+dqdiv4063 divide 4354236601830544882286139612521362 4354236601830544882286139612543223 -> 0.9999999999999999999999999999949794 Inexact Rounded
+dqdiv4064 divide 8058474772375259017342110013891294 8058474772375259017342110013906792 -> 0.9999999999999999999999999999980768 Inexact Rounded
+dqdiv4065 divide 5519604020981748170517093746166328 5519604020981748170517093746181763 -> 0.9999999999999999999999999999972036 Inexact Rounded
+dqdiv4066 divide 1502130966879805458831323782443139 1502130966879805458831323782412213 -> 1.000000000000000000000000000020588 Inexact Rounded
+dqdiv4067 divide 562795633719481212915159787980270 562795633719481212915159788007066 -> 0.9999999999999999999999999999523877 Inexact Rounded
+dqdiv4068 divide 6584743324494664273941281557268878 6584743324494664273941281557258945 -> 1.000000000000000000000000000001508 Inexact Rounded
+dqdiv4069 divide 3632000327285743997976431109416500 3632000327285743997976431109408107 -> 1.000000000000000000000000000002311 Inexact Rounded
+dqdiv4070 divide 1145827237315430089388953838561450 1145827237315430089388953838527332 -> 1.000000000000000000000000000029776 Inexact Rounded
+dqdiv4071 divide 8874431010357691869725372317350380 8874431010357691869725372317316472 -> 1.000000000000000000000000000003821 Inexact Rounded
+dqdiv4072 divide 992948718902804648119753141202196 992948718902804648119753141235222 -> 0.9999999999999999999999999999667395 Inexact Rounded
+dqdiv4073 divide 2522735183374218505142417265439989 2522735183374218505142417265453779 -> 0.9999999999999999999999999999945337 Inexact Rounded
+dqdiv4074 divide 2668419161912936508006872303501052 2668419161912936508006872303471036 -> 1.000000000000000000000000000011249 Inexact Rounded
+dqdiv4075 divide 3036169085665186712590941111775092 3036169085665186712590941111808846 -> 0.9999999999999999999999999999888827 Inexact Rounded
+dqdiv4076 divide 9441634604917231638508898934006147 9441634604917231638508898934000288 -> 1.000000000000000000000000000000621 Inexact Rounded
+dqdiv4077 divide 2677301353164377091111458811839190 2677301353164377091111458811867722 -> 0.9999999999999999999999999999893430 Inexact Rounded
+dqdiv4078 divide 6844979203112066166583765857171426 6844979203112066166583765857189682 -> 0.9999999999999999999999999999973329 Inexact Rounded
+dqdiv4079 divide 2220337435141796724323783960231661 2220337435141796724323783960208778 -> 1.000000000000000000000000000010306 Inexact Rounded
+dqdiv4080 divide 6447424700019783931569996989561380 6447424700019783931569996989572454 -> 0.9999999999999999999999999999982824 Inexact Rounded
+dqdiv4081 divide 7512856762696607119847092195587180 7512856762696607119847092195557346 -> 1.000000000000000000000000000003971 Inexact Rounded
+dqdiv4082 divide 7395261981193960399087819077237482 7395261981193960399087819077242487 -> 0.9999999999999999999999999999993232 Inexact Rounded
+dqdiv4083 divide 2253442467682584035792724884376735 2253442467682584035792724884407178 -> 0.9999999999999999999999999999864904 Inexact Rounded
+dqdiv4084 divide 8153138680300213135577336466190997 8153138680300213135577336466220607 -> 0.9999999999999999999999999999963683 Inexact Rounded
+dqdiv4085 divide 4668731252254148074041022681801390 4668731252254148074041022681778101 -> 1.000000000000000000000000000004988 Inexact Rounded
+dqdiv4086 divide 6078404557993669696040425501815056 6078404557993669696040425501797612 -> 1.000000000000000000000000000002870 Inexact Rounded
+dqdiv4087 divide 2306352359874261623223356878316278 2306352359874261623223356878335612 -> 0.9999999999999999999999999999916171 Inexact Rounded
+dqdiv4088 divide 3264842186668480362900909564091908 3264842186668480362900909564058658 -> 1.000000000000000000000000000010184 Inexact Rounded
+dqdiv4089 divide 6971985047279636878957959608612204 6971985047279636878957959608615088 -> 0.9999999999999999999999999999995863 Inexact Rounded
+dqdiv4090 divide 5262810889952721235466445973816257 5262810889952721235466445973783077 -> 1.000000000000000000000000000006305 Inexact Rounded
+dqdiv4091 divide 7947944731035267178548357070080288 7947944731035267178548357070061339 -> 1.000000000000000000000000000002384 Inexact Rounded
+dqdiv4092 divide 5071808908395375108383035800443229 5071808908395375108383035800412429 -> 1.000000000000000000000000000006073 Inexact Rounded
+dqdiv4093 divide 2043146542084503655511507209262969 2043146542084503655511507209249263 -> 1.000000000000000000000000000006708 Inexact Rounded
+dqdiv4094 divide 4097632735384534181661959731264802 4097632735384534181661959731234499 -> 1.000000000000000000000000000007395 Inexact Rounded
+dqdiv4095 divide 3061477642831387489729464587044430 3061477642831387489729464587059452 -> 0.9999999999999999999999999999950932 Inexact Rounded
+dqdiv4096 divide 3429854941039776159498802936252638 3429854941039776159498802936246415 -> 1.000000000000000000000000000001814 Inexact Rounded
+dqdiv4097 divide 4874324979578599700024133278284545 4874324979578599700024133278262131 -> 1.000000000000000000000000000004598 Inexact Rounded
+dqdiv4098 divide 5701652369691833541455978515820882 5701652369691833541455978515834854 -> 0.9999999999999999999999999999975495 Inexact Rounded
+dqdiv4099 divide 2928205728402945266953255632343113 2928205728402945266953255632373794 -> 0.9999999999999999999999999999895223 Inexact Rounded
+
+-- Null tests
+dqdiv9998 divide 10 # -> NaN Invalid_operation
+dqdiv9999 divide # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqDivideInt.decTest b/Lib/test/decimaltestdata/dqDivideInt.decTest
index 3fec6dbaa3..c29035119f 100644
--- a/Lib/test/decimaltestdata/dqDivideInt.decTest
+++ b/Lib/test/decimaltestdata/dqDivideInt.decTest
@@ -1,453 +1,453 @@
-------------------------------------------------------------------------
--- dqDivideInt.decTest -- decQuad integer division --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-
-dqdvi001 divideint 1 1 -> 1
-dqdvi002 divideint 2 1 -> 2
-dqdvi003 divideint 1 2 -> 0
-dqdvi004 divideint 2 2 -> 1
-dqdvi005 divideint 0 1 -> 0
-dqdvi006 divideint 0 2 -> 0
-dqdvi007 divideint 1 3 -> 0
-dqdvi008 divideint 2 3 -> 0
-dqdvi009 divideint 3 3 -> 1
-
-dqdvi010 divideint 2.4 1 -> 2
-dqdvi011 divideint 2.4 -1 -> -2
-dqdvi012 divideint -2.4 1 -> -2
-dqdvi013 divideint -2.4 -1 -> 2
-dqdvi014 divideint 2.40 1 -> 2
-dqdvi015 divideint 2.400 1 -> 2
-dqdvi016 divideint 2.4 2 -> 1
-dqdvi017 divideint 2.400 2 -> 1
-dqdvi018 divideint 2. 2 -> 1
-dqdvi019 divideint 20 20 -> 1
-
-dqdvi020 divideint 187 187 -> 1
-dqdvi021 divideint 5 2 -> 2
-dqdvi022 divideint 5 2.0 -> 2
-dqdvi023 divideint 5 2.000 -> 2
-dqdvi024 divideint 5 0.200 -> 25
-dqdvi025 divideint 5 0.200 -> 25
-
-dqdvi030 divideint 1 2 -> 0
-dqdvi031 divideint 1 4 -> 0
-dqdvi032 divideint 1 8 -> 0
-dqdvi033 divideint 1 16 -> 0
-dqdvi034 divideint 1 32 -> 0
-dqdvi035 divideint 1 64 -> 0
-dqdvi040 divideint 1 -2 -> -0
-dqdvi041 divideint 1 -4 -> -0
-dqdvi042 divideint 1 -8 -> -0
-dqdvi043 divideint 1 -16 -> -0
-dqdvi044 divideint 1 -32 -> -0
-dqdvi045 divideint 1 -64 -> -0
-dqdvi050 divideint -1 2 -> -0
-dqdvi051 divideint -1 4 -> -0
-dqdvi052 divideint -1 8 -> -0
-dqdvi053 divideint -1 16 -> -0
-dqdvi054 divideint -1 32 -> -0
-dqdvi055 divideint -1 64 -> -0
-dqdvi060 divideint -1 -2 -> 0
-dqdvi061 divideint -1 -4 -> 0
-dqdvi062 divideint -1 -8 -> 0
-dqdvi063 divideint -1 -16 -> 0
-dqdvi064 divideint -1 -32 -> 0
-dqdvi065 divideint -1 -64 -> 0
-
--- similar with powers of ten
-dqdvi160 divideint 1 1 -> 1
-dqdvi161 divideint 1 10 -> 0
-dqdvi162 divideint 1 100 -> 0
-dqdvi163 divideint 1 1000 -> 0
-dqdvi164 divideint 1 10000 -> 0
-dqdvi165 divideint 1 100000 -> 0
-dqdvi166 divideint 1 1000000 -> 0
-dqdvi167 divideint 1 10000000 -> 0
-dqdvi168 divideint 1 100000000 -> 0
-dqdvi170 divideint 1 -1 -> -1
-dqdvi171 divideint 1 -10 -> -0
-dqdvi172 divideint 1 -100 -> -0
-dqdvi173 divideint 1 -1000 -> -0
-dqdvi174 divideint 1 -10000 -> -0
-dqdvi175 divideint 1 -100000 -> -0
-dqdvi176 divideint 1 -1000000 -> -0
-dqdvi177 divideint 1 -10000000 -> -0
-dqdvi178 divideint 1 -100000000 -> -0
-dqdvi180 divideint -1 1 -> -1
-dqdvi181 divideint -1 10 -> -0
-dqdvi182 divideint -1 100 -> -0
-dqdvi183 divideint -1 1000 -> -0
-dqdvi184 divideint -1 10000 -> -0
-dqdvi185 divideint -1 100000 -> -0
-dqdvi186 divideint -1 1000000 -> -0
-dqdvi187 divideint -1 10000000 -> -0
-dqdvi188 divideint -1 100000000 -> -0
-dqdvi190 divideint -1 -1 -> 1
-dqdvi191 divideint -1 -10 -> 0
-dqdvi192 divideint -1 -100 -> 0
-dqdvi193 divideint -1 -1000 -> 0
-dqdvi194 divideint -1 -10000 -> 0
-dqdvi195 divideint -1 -100000 -> 0
-dqdvi196 divideint -1 -1000000 -> 0
-dqdvi197 divideint -1 -10000000 -> 0
-dqdvi198 divideint -1 -100000000 -> 0
-
--- some long operand (at p=9) cases
-dqdvi070 divideint 999999999 1 -> 999999999
-dqdvi071 divideint 999999999.4 1 -> 999999999
-dqdvi072 divideint 999999999.5 1 -> 999999999
-dqdvi073 divideint 999999999.9 1 -> 999999999
-dqdvi074 divideint 999999999.999 1 -> 999999999
-
-dqdvi090 divideint 0. 1 -> 0
-dqdvi091 divideint .0 1 -> 0
-dqdvi092 divideint 0.00 1 -> 0
-dqdvi093 divideint 0.00E+9 1 -> 0
-dqdvi094 divideint 0.0000E-50 1 -> 0
-
-dqdvi100 divideint 1 1 -> 1
-dqdvi101 divideint 1 2 -> 0
-dqdvi102 divideint 1 3 -> 0
-dqdvi103 divideint 1 4 -> 0
-dqdvi104 divideint 1 5 -> 0
-dqdvi105 divideint 1 6 -> 0
-dqdvi106 divideint 1 7 -> 0
-dqdvi107 divideint 1 8 -> 0
-dqdvi108 divideint 1 9 -> 0
-dqdvi109 divideint 1 10 -> 0
-dqdvi110 divideint 1 1 -> 1
-dqdvi111 divideint 2 1 -> 2
-dqdvi112 divideint 3 1 -> 3
-dqdvi113 divideint 4 1 -> 4
-dqdvi114 divideint 5 1 -> 5
-dqdvi115 divideint 6 1 -> 6
-dqdvi116 divideint 7 1 -> 7
-dqdvi117 divideint 8 1 -> 8
-dqdvi118 divideint 9 1 -> 9
-dqdvi119 divideint 10 1 -> 10
-
--- from DiagBigDecimal
-dqdvi131 divideint 101.3 1 -> 101
-dqdvi132 divideint 101.0 1 -> 101
-dqdvi133 divideint 101.3 3 -> 33
-dqdvi134 divideint 101.0 3 -> 33
-dqdvi135 divideint 2.4 1 -> 2
-dqdvi136 divideint 2.400 1 -> 2
-dqdvi137 divideint 18 18 -> 1
-dqdvi138 divideint 1120 1000 -> 1
-dqdvi139 divideint 2.4 2 -> 1
-dqdvi140 divideint 2.400 2 -> 1
-dqdvi141 divideint 0.5 2.000 -> 0
-dqdvi142 divideint 8.005 7 -> 1
-dqdvi143 divideint 5 2 -> 2
-dqdvi144 divideint 0 2 -> 0
-dqdvi145 divideint 0.00 2 -> 0
-
--- Others
-dqdvi150 divideint 12345 4.999 -> 2469
-dqdvi151 divideint 12345 4.99 -> 2473
-dqdvi152 divideint 12345 4.9 -> 2519
-dqdvi153 divideint 12345 5 -> 2469
-dqdvi154 divideint 12345 5.1 -> 2420
-dqdvi155 divideint 12345 5.01 -> 2464
-dqdvi156 divideint 12345 5.001 -> 2468
-dqdvi157 divideint 101 7.6 -> 13
-
--- Various flavours of divideint by 0
-dqdvi201 divideint 0 0 -> NaN Division_undefined
-dqdvi202 divideint 0.0E5 0 -> NaN Division_undefined
-dqdvi203 divideint 0.000 0 -> NaN Division_undefined
-dqdvi204 divideint 0.0001 0 -> Infinity Division_by_zero
-dqdvi205 divideint 0.01 0 -> Infinity Division_by_zero
-dqdvi206 divideint 0.1 0 -> Infinity Division_by_zero
-dqdvi207 divideint 1 0 -> Infinity Division_by_zero
-dqdvi208 divideint 1 0.0 -> Infinity Division_by_zero
-dqdvi209 divideint 10 0.0 -> Infinity Division_by_zero
-dqdvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero
-dqdvi211 divideint 1E+380 0 -> Infinity Division_by_zero
-dqdvi214 divideint -0.0001 0 -> -Infinity Division_by_zero
-dqdvi215 divideint -0.01 0 -> -Infinity Division_by_zero
-dqdvi216 divideint -0.1 0 -> -Infinity Division_by_zero
-dqdvi217 divideint -1 0 -> -Infinity Division_by_zero
-dqdvi218 divideint -1 0.0 -> -Infinity Division_by_zero
-dqdvi219 divideint -10 0.0 -> -Infinity Division_by_zero
-dqdvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero
-dqdvi221 divideint -1E+380 0 -> -Infinity Division_by_zero
-
--- test some cases that are close to exponent overflow
-dqdvi270 divideint 1 1e384 -> 0
-dqdvi271 divideint 1 0.9e384 -> 0
-dqdvi272 divideint 1 0.99e384 -> 0
-dqdvi273 divideint 1 0.9999999999999999e384 -> 0
-dqdvi274 divideint 9e384 1 -> NaN Division_impossible
-dqdvi275 divideint 9.9e384 1 -> NaN Division_impossible
-dqdvi276 divideint 9.99e384 1 -> NaN Division_impossible
-dqdvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible
-
-dqdvi280 divideint 0.1 9e-383 -> NaN Division_impossible
-dqdvi281 divideint 0.1 99e-383 -> NaN Division_impossible
-dqdvi282 divideint 0.1 999e-383 -> NaN Division_impossible
-dqdvi283 divideint 0.1 9e-382 -> NaN Division_impossible
-dqdvi284 divideint 0.1 99e-382 -> NaN Division_impossible
-
--- GD edge cases: lhs smaller than rhs but more digits
-dqdvi301 divideint 0.9 2 -> 0
-dqdvi302 divideint 0.9 2.0 -> 0
-dqdvi303 divideint 0.9 2.1 -> 0
-dqdvi304 divideint 0.9 2.00 -> 0
-dqdvi305 divideint 0.9 2.01 -> 0
-dqdvi306 divideint 0.12 1 -> 0
-dqdvi307 divideint 0.12 1.0 -> 0
-dqdvi308 divideint 0.12 1.00 -> 0
-dqdvi309 divideint 0.12 1.0 -> 0
-dqdvi310 divideint 0.12 1.00 -> 0
-dqdvi311 divideint 0.12 2 -> 0
-dqdvi312 divideint 0.12 2.0 -> 0
-dqdvi313 divideint 0.12 2.1 -> 0
-dqdvi314 divideint 0.12 2.00 -> 0
-dqdvi315 divideint 0.12 2.01 -> 0
-
--- edge cases of impossible
-dqdvi330 divideint 1234567987654321987654321890123456 10 -> 123456798765432198765432189012345
-dqdvi331 divideint 1234567987654321987654321890123456 1 -> 1234567987654321987654321890123456
-dqdvi332 divideint 1234567987654321987654321890123456 0.1 -> NaN Division_impossible
-dqdvi333 divideint 1234567987654321987654321890123456 0.01 -> NaN Division_impossible
-
--- overflow and underflow tests [from divide]
-dqdvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible
-dqdvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible
-dqdvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible
-dqdvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible
-dqdvi1055 divideint 1e-277 1e+311 -> 0
-dqdvi1056 divideint 1e-277 -1e+311 -> -0
-dqdvi1057 divideint -1e-277 1e+311 -> -0
-dqdvi1058 divideint -1e-277 -1e+311 -> 0
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dqdvi1060 divideint 1e-291 1e+101 -> 0
-dqdvi1061 divideint 1e-291 1e+102 -> 0
-dqdvi1062 divideint 1e-291 1e+103 -> 0
-dqdvi1063 divideint 1e-291 1e+104 -> 0
-dqdvi1064 divideint 1e-291 1e+105 -> 0
-dqdvi1065 divideint 1e-291 1e+106 -> 0
-dqdvi1066 divideint 1e-291 1e+107 -> 0
-dqdvi1067 divideint 1e-291 1e+108 -> 0
-dqdvi1068 divideint 1e-291 1e+109 -> 0
-dqdvi1069 divideint 1e-291 1e+110 -> 0
-
-dqdvi1101 divideint 1.0000E-394 1 -> 0
-dqdvi1102 divideint 1.000E-394 1e+1 -> 0
-dqdvi1103 divideint 1.00E-394 1e+2 -> 0
-
-dqdvi1118 divideint 1E-394 1e+4 -> 0
-dqdvi1119 divideint 3E-394 -1e+5 -> -0
-dqdvi1120 divideint 5E-394 1e+5 -> 0
-
-dqdvi1124 divideint 1E-394 -1e+4 -> -0
-dqdvi1130 divideint 3.0E-394 -1e+5 -> -0
-
-dqdvi1131 divideint 1.0E-199 1e+200 -> 0
-dqdvi1132 divideint 1.0E-199 1e+199 -> 0
-dqdvi1133 divideint 1.0E-199 1e+198 -> 0
-dqdvi1134 divideint 2.0E-199 2e+198 -> 0
-dqdvi1135 divideint 4.0E-199 4e+198 -> 0
-
--- long operand checks
-dqdvi401 divideint 12345678000 100 -> 123456780
-dqdvi402 divideint 1 12345678000 -> 0
-dqdvi403 divideint 1234567800 10 -> 123456780
-dqdvi404 divideint 1 1234567800 -> 0
-dqdvi405 divideint 1234567890 10 -> 123456789
-dqdvi406 divideint 1 1234567890 -> 0
-dqdvi407 divideint 1234567891 10 -> 123456789
-dqdvi408 divideint 1 1234567891 -> 0
-dqdvi409 divideint 12345678901 100 -> 123456789
-dqdvi410 divideint 1 12345678901 -> 0
-dqdvi411 divideint 1234567896 10 -> 123456789
-dqdvi412 divideint 1 1234567896 -> 0
-dqdvi413 divideint 12345678948 100 -> 123456789
-dqdvi414 divideint 12345678949 100 -> 123456789
-dqdvi415 divideint 12345678950 100 -> 123456789
-dqdvi416 divideint 12345678951 100 -> 123456789
-dqdvi417 divideint 12345678999 100 -> 123456789
-dqdvi441 divideint 12345678000 1 -> 12345678000
-dqdvi442 divideint 1 12345678000 -> 0
-dqdvi443 divideint 1234567800 1 -> 1234567800
-dqdvi444 divideint 1 1234567800 -> 0
-dqdvi445 divideint 1234567890 1 -> 1234567890
-dqdvi446 divideint 1 1234567890 -> 0
-dqdvi447 divideint 1234567891 1 -> 1234567891
-dqdvi448 divideint 1 1234567891 -> 0
-dqdvi449 divideint 12345678901 1 -> 12345678901
-dqdvi450 divideint 1 12345678901 -> 0
-dqdvi451 divideint 1234567896 1 -> 1234567896
-dqdvi452 divideint 1 1234567896 -> 0
-
--- more zeros, etc.
-dqdvi531 divideint 5.00 1E-3 -> 5000
-dqdvi532 divideint 00.00 0.000 -> NaN Division_undefined
-dqdvi533 divideint 00.00 0E-3 -> NaN Division_undefined
-dqdvi534 divideint 0 -0 -> NaN Division_undefined
-dqdvi535 divideint -0 0 -> NaN Division_undefined
-dqdvi536 divideint -0 -0 -> NaN Division_undefined
-
-dqdvi541 divideint 0 -1 -> -0
-dqdvi542 divideint -0 -1 -> 0
-dqdvi543 divideint 0 1 -> 0
-dqdvi544 divideint -0 1 -> -0
-dqdvi545 divideint -1 0 -> -Infinity Division_by_zero
-dqdvi546 divideint -1 -0 -> Infinity Division_by_zero
-dqdvi547 divideint 1 0 -> Infinity Division_by_zero
-dqdvi548 divideint 1 -0 -> -Infinity Division_by_zero
-
-dqdvi551 divideint 0.0 -1 -> -0
-dqdvi552 divideint -0.0 -1 -> 0
-dqdvi553 divideint 0.0 1 -> 0
-dqdvi554 divideint -0.0 1 -> -0
-dqdvi555 divideint -1.0 0 -> -Infinity Division_by_zero
-dqdvi556 divideint -1.0 -0 -> Infinity Division_by_zero
-dqdvi557 divideint 1.0 0 -> Infinity Division_by_zero
-dqdvi558 divideint 1.0 -0 -> -Infinity Division_by_zero
-
-dqdvi561 divideint 0 -1.0 -> -0
-dqdvi562 divideint -0 -1.0 -> 0
-dqdvi563 divideint 0 1.0 -> 0
-dqdvi564 divideint -0 1.0 -> -0
-dqdvi565 divideint -1 0.0 -> -Infinity Division_by_zero
-dqdvi566 divideint -1 -0.0 -> Infinity Division_by_zero
-dqdvi567 divideint 1 0.0 -> Infinity Division_by_zero
-dqdvi568 divideint 1 -0.0 -> -Infinity Division_by_zero
-
-dqdvi571 divideint 0.0 -1.0 -> -0
-dqdvi572 divideint -0.0 -1.0 -> 0
-dqdvi573 divideint 0.0 1.0 -> 0
-dqdvi574 divideint -0.0 1.0 -> -0
-dqdvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero
-dqdvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero
-dqdvi577 divideint 1.0 0.0 -> Infinity Division_by_zero
-dqdvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero
-
--- Specials
-dqdvi580 divideint Inf -Inf -> NaN Invalid_operation
-dqdvi581 divideint Inf -1000 -> -Infinity
-dqdvi582 divideint Inf -1 -> -Infinity
-dqdvi583 divideint Inf -0 -> -Infinity
-dqdvi584 divideint Inf 0 -> Infinity
-dqdvi585 divideint Inf 1 -> Infinity
-dqdvi586 divideint Inf 1000 -> Infinity
-dqdvi587 divideint Inf Inf -> NaN Invalid_operation
-dqdvi588 divideint -1000 Inf -> -0
-dqdvi589 divideint -Inf Inf -> NaN Invalid_operation
-dqdvi590 divideint -1 Inf -> -0
-dqdvi591 divideint -0 Inf -> -0
-dqdvi592 divideint 0 Inf -> 0
-dqdvi593 divideint 1 Inf -> 0
-dqdvi594 divideint 1000 Inf -> 0
-dqdvi595 divideint Inf Inf -> NaN Invalid_operation
-
-dqdvi600 divideint -Inf -Inf -> NaN Invalid_operation
-dqdvi601 divideint -Inf -1000 -> Infinity
-dqdvi602 divideint -Inf -1 -> Infinity
-dqdvi603 divideint -Inf -0 -> Infinity
-dqdvi604 divideint -Inf 0 -> -Infinity
-dqdvi605 divideint -Inf 1 -> -Infinity
-dqdvi606 divideint -Inf 1000 -> -Infinity
-dqdvi607 divideint -Inf Inf -> NaN Invalid_operation
-dqdvi608 divideint -1000 Inf -> -0
-dqdvi609 divideint -Inf -Inf -> NaN Invalid_operation
-dqdvi610 divideint -1 -Inf -> 0
-dqdvi611 divideint -0 -Inf -> 0
-dqdvi612 divideint 0 -Inf -> -0
-dqdvi613 divideint 1 -Inf -> -0
-dqdvi614 divideint 1000 -Inf -> -0
-dqdvi615 divideint Inf -Inf -> NaN Invalid_operation
-
-dqdvi621 divideint NaN -Inf -> NaN
-dqdvi622 divideint NaN -1000 -> NaN
-dqdvi623 divideint NaN -1 -> NaN
-dqdvi624 divideint NaN -0 -> NaN
-dqdvi625 divideint NaN 0 -> NaN
-dqdvi626 divideint NaN 1 -> NaN
-dqdvi627 divideint NaN 1000 -> NaN
-dqdvi628 divideint NaN Inf -> NaN
-dqdvi629 divideint NaN NaN -> NaN
-dqdvi630 divideint -Inf NaN -> NaN
-dqdvi631 divideint -1000 NaN -> NaN
-dqdvi632 divideint -1 NaN -> NaN
-dqdvi633 divideint -0 NaN -> NaN
-dqdvi634 divideint 0 NaN -> NaN
-dqdvi635 divideint 1 NaN -> NaN
-dqdvi636 divideint 1000 NaN -> NaN
-dqdvi637 divideint Inf NaN -> NaN
-
-dqdvi641 divideint sNaN -Inf -> NaN Invalid_operation
-dqdvi642 divideint sNaN -1000 -> NaN Invalid_operation
-dqdvi643 divideint sNaN -1 -> NaN Invalid_operation
-dqdvi644 divideint sNaN -0 -> NaN Invalid_operation
-dqdvi645 divideint sNaN 0 -> NaN Invalid_operation
-dqdvi646 divideint sNaN 1 -> NaN Invalid_operation
-dqdvi647 divideint sNaN 1000 -> NaN Invalid_operation
-dqdvi648 divideint sNaN NaN -> NaN Invalid_operation
-dqdvi649 divideint sNaN sNaN -> NaN Invalid_operation
-dqdvi650 divideint NaN sNaN -> NaN Invalid_operation
-dqdvi651 divideint -Inf sNaN -> NaN Invalid_operation
-dqdvi652 divideint -1000 sNaN -> NaN Invalid_operation
-dqdvi653 divideint -1 sNaN -> NaN Invalid_operation
-dqdvi654 divideint -0 sNaN -> NaN Invalid_operation
-dqdvi655 divideint 0 sNaN -> NaN Invalid_operation
-dqdvi656 divideint 1 sNaN -> NaN Invalid_operation
-dqdvi657 divideint 1000 sNaN -> NaN Invalid_operation
-dqdvi658 divideint Inf sNaN -> NaN Invalid_operation
-dqdvi659 divideint NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqdvi661 divideint NaN9 -Inf -> NaN9
-dqdvi662 divideint NaN8 1000 -> NaN8
-dqdvi663 divideint NaN7 Inf -> NaN7
-dqdvi664 divideint -NaN6 NaN5 -> -NaN6
-dqdvi665 divideint -Inf NaN4 -> NaN4
-dqdvi666 divideint -1000 NaN3 -> NaN3
-dqdvi667 divideint Inf -NaN2 -> -NaN2
-
-dqdvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqdvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation
-dqdvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation
-dqdvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
-dqdvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
-dqdvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
-dqdvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation
-dqdvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
-dqdvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation
-
--- Gyuris example
-dqdvi700 divideint 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0
-
--- Null tests
-dqdvi900 divideint 10 # -> NaN Invalid_operation
-dqdvi901 divideint # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqDivideInt.decTest -- decQuad integer division --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+
+dqdvi001 divideint 1 1 -> 1
+dqdvi002 divideint 2 1 -> 2
+dqdvi003 divideint 1 2 -> 0
+dqdvi004 divideint 2 2 -> 1
+dqdvi005 divideint 0 1 -> 0
+dqdvi006 divideint 0 2 -> 0
+dqdvi007 divideint 1 3 -> 0
+dqdvi008 divideint 2 3 -> 0
+dqdvi009 divideint 3 3 -> 1
+
+dqdvi010 divideint 2.4 1 -> 2
+dqdvi011 divideint 2.4 -1 -> -2
+dqdvi012 divideint -2.4 1 -> -2
+dqdvi013 divideint -2.4 -1 -> 2
+dqdvi014 divideint 2.40 1 -> 2
+dqdvi015 divideint 2.400 1 -> 2
+dqdvi016 divideint 2.4 2 -> 1
+dqdvi017 divideint 2.400 2 -> 1
+dqdvi018 divideint 2. 2 -> 1
+dqdvi019 divideint 20 20 -> 1
+
+dqdvi020 divideint 187 187 -> 1
+dqdvi021 divideint 5 2 -> 2
+dqdvi022 divideint 5 2.0 -> 2
+dqdvi023 divideint 5 2.000 -> 2
+dqdvi024 divideint 5 0.200 -> 25
+dqdvi025 divideint 5 0.200 -> 25
+
+dqdvi030 divideint 1 2 -> 0
+dqdvi031 divideint 1 4 -> 0
+dqdvi032 divideint 1 8 -> 0
+dqdvi033 divideint 1 16 -> 0
+dqdvi034 divideint 1 32 -> 0
+dqdvi035 divideint 1 64 -> 0
+dqdvi040 divideint 1 -2 -> -0
+dqdvi041 divideint 1 -4 -> -0
+dqdvi042 divideint 1 -8 -> -0
+dqdvi043 divideint 1 -16 -> -0
+dqdvi044 divideint 1 -32 -> -0
+dqdvi045 divideint 1 -64 -> -0
+dqdvi050 divideint -1 2 -> -0
+dqdvi051 divideint -1 4 -> -0
+dqdvi052 divideint -1 8 -> -0
+dqdvi053 divideint -1 16 -> -0
+dqdvi054 divideint -1 32 -> -0
+dqdvi055 divideint -1 64 -> -0
+dqdvi060 divideint -1 -2 -> 0
+dqdvi061 divideint -1 -4 -> 0
+dqdvi062 divideint -1 -8 -> 0
+dqdvi063 divideint -1 -16 -> 0
+dqdvi064 divideint -1 -32 -> 0
+dqdvi065 divideint -1 -64 -> 0
+
+-- similar with powers of ten
+dqdvi160 divideint 1 1 -> 1
+dqdvi161 divideint 1 10 -> 0
+dqdvi162 divideint 1 100 -> 0
+dqdvi163 divideint 1 1000 -> 0
+dqdvi164 divideint 1 10000 -> 0
+dqdvi165 divideint 1 100000 -> 0
+dqdvi166 divideint 1 1000000 -> 0
+dqdvi167 divideint 1 10000000 -> 0
+dqdvi168 divideint 1 100000000 -> 0
+dqdvi170 divideint 1 -1 -> -1
+dqdvi171 divideint 1 -10 -> -0
+dqdvi172 divideint 1 -100 -> -0
+dqdvi173 divideint 1 -1000 -> -0
+dqdvi174 divideint 1 -10000 -> -0
+dqdvi175 divideint 1 -100000 -> -0
+dqdvi176 divideint 1 -1000000 -> -0
+dqdvi177 divideint 1 -10000000 -> -0
+dqdvi178 divideint 1 -100000000 -> -0
+dqdvi180 divideint -1 1 -> -1
+dqdvi181 divideint -1 10 -> -0
+dqdvi182 divideint -1 100 -> -0
+dqdvi183 divideint -1 1000 -> -0
+dqdvi184 divideint -1 10000 -> -0
+dqdvi185 divideint -1 100000 -> -0
+dqdvi186 divideint -1 1000000 -> -0
+dqdvi187 divideint -1 10000000 -> -0
+dqdvi188 divideint -1 100000000 -> -0
+dqdvi190 divideint -1 -1 -> 1
+dqdvi191 divideint -1 -10 -> 0
+dqdvi192 divideint -1 -100 -> 0
+dqdvi193 divideint -1 -1000 -> 0
+dqdvi194 divideint -1 -10000 -> 0
+dqdvi195 divideint -1 -100000 -> 0
+dqdvi196 divideint -1 -1000000 -> 0
+dqdvi197 divideint -1 -10000000 -> 0
+dqdvi198 divideint -1 -100000000 -> 0
+
+-- some long operand (at p=9) cases
+dqdvi070 divideint 999999999 1 -> 999999999
+dqdvi071 divideint 999999999.4 1 -> 999999999
+dqdvi072 divideint 999999999.5 1 -> 999999999
+dqdvi073 divideint 999999999.9 1 -> 999999999
+dqdvi074 divideint 999999999.999 1 -> 999999999
+
+dqdvi090 divideint 0. 1 -> 0
+dqdvi091 divideint .0 1 -> 0
+dqdvi092 divideint 0.00 1 -> 0
+dqdvi093 divideint 0.00E+9 1 -> 0
+dqdvi094 divideint 0.0000E-50 1 -> 0
+
+dqdvi100 divideint 1 1 -> 1
+dqdvi101 divideint 1 2 -> 0
+dqdvi102 divideint 1 3 -> 0
+dqdvi103 divideint 1 4 -> 0
+dqdvi104 divideint 1 5 -> 0
+dqdvi105 divideint 1 6 -> 0
+dqdvi106 divideint 1 7 -> 0
+dqdvi107 divideint 1 8 -> 0
+dqdvi108 divideint 1 9 -> 0
+dqdvi109 divideint 1 10 -> 0
+dqdvi110 divideint 1 1 -> 1
+dqdvi111 divideint 2 1 -> 2
+dqdvi112 divideint 3 1 -> 3
+dqdvi113 divideint 4 1 -> 4
+dqdvi114 divideint 5 1 -> 5
+dqdvi115 divideint 6 1 -> 6
+dqdvi116 divideint 7 1 -> 7
+dqdvi117 divideint 8 1 -> 8
+dqdvi118 divideint 9 1 -> 9
+dqdvi119 divideint 10 1 -> 10
+
+-- from DiagBigDecimal
+dqdvi131 divideint 101.3 1 -> 101
+dqdvi132 divideint 101.0 1 -> 101
+dqdvi133 divideint 101.3 3 -> 33
+dqdvi134 divideint 101.0 3 -> 33
+dqdvi135 divideint 2.4 1 -> 2
+dqdvi136 divideint 2.400 1 -> 2
+dqdvi137 divideint 18 18 -> 1
+dqdvi138 divideint 1120 1000 -> 1
+dqdvi139 divideint 2.4 2 -> 1
+dqdvi140 divideint 2.400 2 -> 1
+dqdvi141 divideint 0.5 2.000 -> 0
+dqdvi142 divideint 8.005 7 -> 1
+dqdvi143 divideint 5 2 -> 2
+dqdvi144 divideint 0 2 -> 0
+dqdvi145 divideint 0.00 2 -> 0
+
+-- Others
+dqdvi150 divideint 12345 4.999 -> 2469
+dqdvi151 divideint 12345 4.99 -> 2473
+dqdvi152 divideint 12345 4.9 -> 2519
+dqdvi153 divideint 12345 5 -> 2469
+dqdvi154 divideint 12345 5.1 -> 2420
+dqdvi155 divideint 12345 5.01 -> 2464
+dqdvi156 divideint 12345 5.001 -> 2468
+dqdvi157 divideint 101 7.6 -> 13
+
+-- Various flavours of divideint by 0
+dqdvi201 divideint 0 0 -> NaN Division_undefined
+dqdvi202 divideint 0.0E5 0 -> NaN Division_undefined
+dqdvi203 divideint 0.000 0 -> NaN Division_undefined
+dqdvi204 divideint 0.0001 0 -> Infinity Division_by_zero
+dqdvi205 divideint 0.01 0 -> Infinity Division_by_zero
+dqdvi206 divideint 0.1 0 -> Infinity Division_by_zero
+dqdvi207 divideint 1 0 -> Infinity Division_by_zero
+dqdvi208 divideint 1 0.0 -> Infinity Division_by_zero
+dqdvi209 divideint 10 0.0 -> Infinity Division_by_zero
+dqdvi210 divideint 1E+100 0.0 -> Infinity Division_by_zero
+dqdvi211 divideint 1E+380 0 -> Infinity Division_by_zero
+dqdvi214 divideint -0.0001 0 -> -Infinity Division_by_zero
+dqdvi215 divideint -0.01 0 -> -Infinity Division_by_zero
+dqdvi216 divideint -0.1 0 -> -Infinity Division_by_zero
+dqdvi217 divideint -1 0 -> -Infinity Division_by_zero
+dqdvi218 divideint -1 0.0 -> -Infinity Division_by_zero
+dqdvi219 divideint -10 0.0 -> -Infinity Division_by_zero
+dqdvi220 divideint -1E+100 0.0 -> -Infinity Division_by_zero
+dqdvi221 divideint -1E+380 0 -> -Infinity Division_by_zero
+
+-- test some cases that are close to exponent overflow
+dqdvi270 divideint 1 1e384 -> 0
+dqdvi271 divideint 1 0.9e384 -> 0
+dqdvi272 divideint 1 0.99e384 -> 0
+dqdvi273 divideint 1 0.9999999999999999e384 -> 0
+dqdvi274 divideint 9e384 1 -> NaN Division_impossible
+dqdvi275 divideint 9.9e384 1 -> NaN Division_impossible
+dqdvi276 divideint 9.99e384 1 -> NaN Division_impossible
+dqdvi277 divideint 9.999999999999999e384 1 -> NaN Division_impossible
+
+dqdvi280 divideint 0.1 9e-383 -> NaN Division_impossible
+dqdvi281 divideint 0.1 99e-383 -> NaN Division_impossible
+dqdvi282 divideint 0.1 999e-383 -> NaN Division_impossible
+dqdvi283 divideint 0.1 9e-382 -> NaN Division_impossible
+dqdvi284 divideint 0.1 99e-382 -> NaN Division_impossible
+
+-- GD edge cases: lhs smaller than rhs but more digits
+dqdvi301 divideint 0.9 2 -> 0
+dqdvi302 divideint 0.9 2.0 -> 0
+dqdvi303 divideint 0.9 2.1 -> 0
+dqdvi304 divideint 0.9 2.00 -> 0
+dqdvi305 divideint 0.9 2.01 -> 0
+dqdvi306 divideint 0.12 1 -> 0
+dqdvi307 divideint 0.12 1.0 -> 0
+dqdvi308 divideint 0.12 1.00 -> 0
+dqdvi309 divideint 0.12 1.0 -> 0
+dqdvi310 divideint 0.12 1.00 -> 0
+dqdvi311 divideint 0.12 2 -> 0
+dqdvi312 divideint 0.12 2.0 -> 0
+dqdvi313 divideint 0.12 2.1 -> 0
+dqdvi314 divideint 0.12 2.00 -> 0
+dqdvi315 divideint 0.12 2.01 -> 0
+
+-- edge cases of impossible
+dqdvi330 divideint 1234567987654321987654321890123456 10 -> 123456798765432198765432189012345
+dqdvi331 divideint 1234567987654321987654321890123456 1 -> 1234567987654321987654321890123456
+dqdvi332 divideint 1234567987654321987654321890123456 0.1 -> NaN Division_impossible
+dqdvi333 divideint 1234567987654321987654321890123456 0.01 -> NaN Division_impossible
+
+-- overflow and underflow tests [from divide]
+dqdvi1051 divideint 1e+277 1e-311 -> NaN Division_impossible
+dqdvi1052 divideint 1e+277 -1e-311 -> NaN Division_impossible
+dqdvi1053 divideint -1e+277 1e-311 -> NaN Division_impossible
+dqdvi1054 divideint -1e+277 -1e-311 -> NaN Division_impossible
+dqdvi1055 divideint 1e-277 1e+311 -> 0
+dqdvi1056 divideint 1e-277 -1e+311 -> -0
+dqdvi1057 divideint -1e-277 1e+311 -> -0
+dqdvi1058 divideint -1e-277 -1e+311 -> 0
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dqdvi1060 divideint 1e-291 1e+101 -> 0
+dqdvi1061 divideint 1e-291 1e+102 -> 0
+dqdvi1062 divideint 1e-291 1e+103 -> 0
+dqdvi1063 divideint 1e-291 1e+104 -> 0
+dqdvi1064 divideint 1e-291 1e+105 -> 0
+dqdvi1065 divideint 1e-291 1e+106 -> 0
+dqdvi1066 divideint 1e-291 1e+107 -> 0
+dqdvi1067 divideint 1e-291 1e+108 -> 0
+dqdvi1068 divideint 1e-291 1e+109 -> 0
+dqdvi1069 divideint 1e-291 1e+110 -> 0
+
+dqdvi1101 divideint 1.0000E-394 1 -> 0
+dqdvi1102 divideint 1.000E-394 1e+1 -> 0
+dqdvi1103 divideint 1.00E-394 1e+2 -> 0
+
+dqdvi1118 divideint 1E-394 1e+4 -> 0
+dqdvi1119 divideint 3E-394 -1e+5 -> -0
+dqdvi1120 divideint 5E-394 1e+5 -> 0
+
+dqdvi1124 divideint 1E-394 -1e+4 -> -0
+dqdvi1130 divideint 3.0E-394 -1e+5 -> -0
+
+dqdvi1131 divideint 1.0E-199 1e+200 -> 0
+dqdvi1132 divideint 1.0E-199 1e+199 -> 0
+dqdvi1133 divideint 1.0E-199 1e+198 -> 0
+dqdvi1134 divideint 2.0E-199 2e+198 -> 0
+dqdvi1135 divideint 4.0E-199 4e+198 -> 0
+
+-- long operand checks
+dqdvi401 divideint 12345678000 100 -> 123456780
+dqdvi402 divideint 1 12345678000 -> 0
+dqdvi403 divideint 1234567800 10 -> 123456780
+dqdvi404 divideint 1 1234567800 -> 0
+dqdvi405 divideint 1234567890 10 -> 123456789
+dqdvi406 divideint 1 1234567890 -> 0
+dqdvi407 divideint 1234567891 10 -> 123456789
+dqdvi408 divideint 1 1234567891 -> 0
+dqdvi409 divideint 12345678901 100 -> 123456789
+dqdvi410 divideint 1 12345678901 -> 0
+dqdvi411 divideint 1234567896 10 -> 123456789
+dqdvi412 divideint 1 1234567896 -> 0
+dqdvi413 divideint 12345678948 100 -> 123456789
+dqdvi414 divideint 12345678949 100 -> 123456789
+dqdvi415 divideint 12345678950 100 -> 123456789
+dqdvi416 divideint 12345678951 100 -> 123456789
+dqdvi417 divideint 12345678999 100 -> 123456789
+dqdvi441 divideint 12345678000 1 -> 12345678000
+dqdvi442 divideint 1 12345678000 -> 0
+dqdvi443 divideint 1234567800 1 -> 1234567800
+dqdvi444 divideint 1 1234567800 -> 0
+dqdvi445 divideint 1234567890 1 -> 1234567890
+dqdvi446 divideint 1 1234567890 -> 0
+dqdvi447 divideint 1234567891 1 -> 1234567891
+dqdvi448 divideint 1 1234567891 -> 0
+dqdvi449 divideint 12345678901 1 -> 12345678901
+dqdvi450 divideint 1 12345678901 -> 0
+dqdvi451 divideint 1234567896 1 -> 1234567896
+dqdvi452 divideint 1 1234567896 -> 0
+
+-- more zeros, etc.
+dqdvi531 divideint 5.00 1E-3 -> 5000
+dqdvi532 divideint 00.00 0.000 -> NaN Division_undefined
+dqdvi533 divideint 00.00 0E-3 -> NaN Division_undefined
+dqdvi534 divideint 0 -0 -> NaN Division_undefined
+dqdvi535 divideint -0 0 -> NaN Division_undefined
+dqdvi536 divideint -0 -0 -> NaN Division_undefined
+
+dqdvi541 divideint 0 -1 -> -0
+dqdvi542 divideint -0 -1 -> 0
+dqdvi543 divideint 0 1 -> 0
+dqdvi544 divideint -0 1 -> -0
+dqdvi545 divideint -1 0 -> -Infinity Division_by_zero
+dqdvi546 divideint -1 -0 -> Infinity Division_by_zero
+dqdvi547 divideint 1 0 -> Infinity Division_by_zero
+dqdvi548 divideint 1 -0 -> -Infinity Division_by_zero
+
+dqdvi551 divideint 0.0 -1 -> -0
+dqdvi552 divideint -0.0 -1 -> 0
+dqdvi553 divideint 0.0 1 -> 0
+dqdvi554 divideint -0.0 1 -> -0
+dqdvi555 divideint -1.0 0 -> -Infinity Division_by_zero
+dqdvi556 divideint -1.0 -0 -> Infinity Division_by_zero
+dqdvi557 divideint 1.0 0 -> Infinity Division_by_zero
+dqdvi558 divideint 1.0 -0 -> -Infinity Division_by_zero
+
+dqdvi561 divideint 0 -1.0 -> -0
+dqdvi562 divideint -0 -1.0 -> 0
+dqdvi563 divideint 0 1.0 -> 0
+dqdvi564 divideint -0 1.0 -> -0
+dqdvi565 divideint -1 0.0 -> -Infinity Division_by_zero
+dqdvi566 divideint -1 -0.0 -> Infinity Division_by_zero
+dqdvi567 divideint 1 0.0 -> Infinity Division_by_zero
+dqdvi568 divideint 1 -0.0 -> -Infinity Division_by_zero
+
+dqdvi571 divideint 0.0 -1.0 -> -0
+dqdvi572 divideint -0.0 -1.0 -> 0
+dqdvi573 divideint 0.0 1.0 -> 0
+dqdvi574 divideint -0.0 1.0 -> -0
+dqdvi575 divideint -1.0 0.0 -> -Infinity Division_by_zero
+dqdvi576 divideint -1.0 -0.0 -> Infinity Division_by_zero
+dqdvi577 divideint 1.0 0.0 -> Infinity Division_by_zero
+dqdvi578 divideint 1.0 -0.0 -> -Infinity Division_by_zero
+
+-- Specials
+dqdvi580 divideint Inf -Inf -> NaN Invalid_operation
+dqdvi581 divideint Inf -1000 -> -Infinity
+dqdvi582 divideint Inf -1 -> -Infinity
+dqdvi583 divideint Inf -0 -> -Infinity
+dqdvi584 divideint Inf 0 -> Infinity
+dqdvi585 divideint Inf 1 -> Infinity
+dqdvi586 divideint Inf 1000 -> Infinity
+dqdvi587 divideint Inf Inf -> NaN Invalid_operation
+dqdvi588 divideint -1000 Inf -> -0
+dqdvi589 divideint -Inf Inf -> NaN Invalid_operation
+dqdvi590 divideint -1 Inf -> -0
+dqdvi591 divideint -0 Inf -> -0
+dqdvi592 divideint 0 Inf -> 0
+dqdvi593 divideint 1 Inf -> 0
+dqdvi594 divideint 1000 Inf -> 0
+dqdvi595 divideint Inf Inf -> NaN Invalid_operation
+
+dqdvi600 divideint -Inf -Inf -> NaN Invalid_operation
+dqdvi601 divideint -Inf -1000 -> Infinity
+dqdvi602 divideint -Inf -1 -> Infinity
+dqdvi603 divideint -Inf -0 -> Infinity
+dqdvi604 divideint -Inf 0 -> -Infinity
+dqdvi605 divideint -Inf 1 -> -Infinity
+dqdvi606 divideint -Inf 1000 -> -Infinity
+dqdvi607 divideint -Inf Inf -> NaN Invalid_operation
+dqdvi608 divideint -1000 Inf -> -0
+dqdvi609 divideint -Inf -Inf -> NaN Invalid_operation
+dqdvi610 divideint -1 -Inf -> 0
+dqdvi611 divideint -0 -Inf -> 0
+dqdvi612 divideint 0 -Inf -> -0
+dqdvi613 divideint 1 -Inf -> -0
+dqdvi614 divideint 1000 -Inf -> -0
+dqdvi615 divideint Inf -Inf -> NaN Invalid_operation
+
+dqdvi621 divideint NaN -Inf -> NaN
+dqdvi622 divideint NaN -1000 -> NaN
+dqdvi623 divideint NaN -1 -> NaN
+dqdvi624 divideint NaN -0 -> NaN
+dqdvi625 divideint NaN 0 -> NaN
+dqdvi626 divideint NaN 1 -> NaN
+dqdvi627 divideint NaN 1000 -> NaN
+dqdvi628 divideint NaN Inf -> NaN
+dqdvi629 divideint NaN NaN -> NaN
+dqdvi630 divideint -Inf NaN -> NaN
+dqdvi631 divideint -1000 NaN -> NaN
+dqdvi632 divideint -1 NaN -> NaN
+dqdvi633 divideint -0 NaN -> NaN
+dqdvi634 divideint 0 NaN -> NaN
+dqdvi635 divideint 1 NaN -> NaN
+dqdvi636 divideint 1000 NaN -> NaN
+dqdvi637 divideint Inf NaN -> NaN
+
+dqdvi641 divideint sNaN -Inf -> NaN Invalid_operation
+dqdvi642 divideint sNaN -1000 -> NaN Invalid_operation
+dqdvi643 divideint sNaN -1 -> NaN Invalid_operation
+dqdvi644 divideint sNaN -0 -> NaN Invalid_operation
+dqdvi645 divideint sNaN 0 -> NaN Invalid_operation
+dqdvi646 divideint sNaN 1 -> NaN Invalid_operation
+dqdvi647 divideint sNaN 1000 -> NaN Invalid_operation
+dqdvi648 divideint sNaN NaN -> NaN Invalid_operation
+dqdvi649 divideint sNaN sNaN -> NaN Invalid_operation
+dqdvi650 divideint NaN sNaN -> NaN Invalid_operation
+dqdvi651 divideint -Inf sNaN -> NaN Invalid_operation
+dqdvi652 divideint -1000 sNaN -> NaN Invalid_operation
+dqdvi653 divideint -1 sNaN -> NaN Invalid_operation
+dqdvi654 divideint -0 sNaN -> NaN Invalid_operation
+dqdvi655 divideint 0 sNaN -> NaN Invalid_operation
+dqdvi656 divideint 1 sNaN -> NaN Invalid_operation
+dqdvi657 divideint 1000 sNaN -> NaN Invalid_operation
+dqdvi658 divideint Inf sNaN -> NaN Invalid_operation
+dqdvi659 divideint NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqdvi661 divideint NaN9 -Inf -> NaN9
+dqdvi662 divideint NaN8 1000 -> NaN8
+dqdvi663 divideint NaN7 Inf -> NaN7
+dqdvi664 divideint -NaN6 NaN5 -> -NaN6
+dqdvi665 divideint -Inf NaN4 -> NaN4
+dqdvi666 divideint -1000 NaN3 -> NaN3
+dqdvi667 divideint Inf -NaN2 -> -NaN2
+
+dqdvi671 divideint -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqdvi672 divideint sNaN98 -1 -> NaN98 Invalid_operation
+dqdvi673 divideint sNaN97 NaN -> NaN97 Invalid_operation
+dqdvi674 divideint sNaN96 sNaN94 -> NaN96 Invalid_operation
+dqdvi675 divideint NaN95 sNaN93 -> NaN93 Invalid_operation
+dqdvi676 divideint -Inf sNaN92 -> NaN92 Invalid_operation
+dqdvi677 divideint 0 sNaN91 -> NaN91 Invalid_operation
+dqdvi678 divideint Inf -sNaN90 -> -NaN90 Invalid_operation
+dqdvi679 divideint NaN sNaN89 -> NaN89 Invalid_operation
+
+-- Gyuris example
+dqdvi700 divideint 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 0
+
+-- Null tests
+dqdvi900 divideint 10 # -> NaN Invalid_operation
+dqdvi901 divideint # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqEncode.decTest b/Lib/test/decimaltestdata/dqEncode.decTest
index 8c5d7b9b30..49edf5b280 100644
--- a/Lib/test/decimaltestdata/dqEncode.decTest
+++ b/Lib/test/decimaltestdata/dqEncode.decTest
@@ -1,477 +1,477 @@
-------------------------------------------------------------------------
--- dqEncode.decTest -- decimal sixteen-byte format testcases --
--- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
--- [Previously called decimal128.decTest]
-version: 2.59
-
--- This set of tests is for the sixteen-byte concrete representation.
--- Its characteristics are:
---
--- 1 bit sign
--- 5 bits combination field
--- 12 bits exponent continuation
--- 110 bits coefficient continuation
---
--- Total exponent length 14 bits
--- Total coefficient length 114 bits (34 digits)
---
--- Elimit = 12287 (maximum encoded exponent)
--- Emax = 6144 (largest exponent value)
--- Emin = -6143 (smallest exponent value)
--- bias = 6176 (subtracted from encoded exponent) = -Etiny
-
--- The testcases here have only exactly representable data on the
--- 'left-hand-side'; rounding from strings is tested in 'base'
--- testcase groups.
-
-extended: 1
-clamp: 1
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
-
--- General testcases
--- (mostly derived from the Strawman 4 document and examples)
-decq001 apply #A20780000000000000000000000003D0 -> -7.50
-decq002 apply -7.50 -> #A20780000000000000000000000003D0
--- derivative canonical plain strings
-decq003 apply #A20840000000000000000000000003D0 -> -7.50E+3
-decq004 apply -7.50E+3 -> #A20840000000000000000000000003D0
-decq005 apply #A20800000000000000000000000003D0 -> -750
-decq006 apply -750 -> #A20800000000000000000000000003D0
-decq007 apply #A207c0000000000000000000000003D0 -> -75.0
-decq008 apply -75.0 -> #A207c0000000000000000000000003D0
-decq009 apply #A20740000000000000000000000003D0 -> -0.750
-decq010 apply -0.750 -> #A20740000000000000000000000003D0
-decq011 apply #A20700000000000000000000000003D0 -> -0.0750
-decq012 apply -0.0750 -> #A20700000000000000000000000003D0
-decq013 apply #A20680000000000000000000000003D0 -> -0.000750
-decq014 apply -0.000750 -> #A20680000000000000000000000003D0
-decq015 apply #A20600000000000000000000000003D0 -> -0.00000750
-decq016 apply -0.00000750 -> #A20600000000000000000000000003D0
-decq017 apply #A205c0000000000000000000000003D0 -> -7.50E-7
-decq018 apply -7.50E-7 -> #A205c0000000000000000000000003D0
-
--- Normality
-decq020 apply 1234567890123456789012345678901234 -> #2608134b9c1e28e56f3c127177823534
-decq021 apply -1234567890123456789012345678901234 -> #a608134b9c1e28e56f3c127177823534
-decq022 apply 1111111111111111111111111111111111 -> #26080912449124491244912449124491
-
--- Nmax and similar
-decq031 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
-decq032 apply #77ffcff3fcff3fcff3fcff3fcff3fcff -> 9.999999999999999999999999999999999E+6144
-decq033 apply 1.234567890123456789012345678901234E+6144 -> #47ffd34b9c1e28e56f3c127177823534
-decq034 apply #47ffd34b9c1e28e56f3c127177823534 -> 1.234567890123456789012345678901234E+6144
--- fold-downs (more below)
-decq035 apply 1.23E+6144 -> #47ffd300000000000000000000000000 Clamped
-decq036 apply #47ffd300000000000000000000000000 -> 1.230000000000000000000000000000000E+6144
-decq037 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped
-decq038 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144
-
-decq051 apply 12345 -> #220800000000000000000000000049c5
-decq052 apply #220800000000000000000000000049c5 -> 12345
-decq053 apply 1234 -> #22080000000000000000000000000534
-decq054 apply #22080000000000000000000000000534 -> 1234
-decq055 apply 123 -> #220800000000000000000000000000a3
-decq056 apply #220800000000000000000000000000a3 -> 123
-decq057 apply 12 -> #22080000000000000000000000000012
-decq058 apply #22080000000000000000000000000012 -> 12
-decq059 apply 1 -> #22080000000000000000000000000001
-decq060 apply #22080000000000000000000000000001 -> 1
-decq061 apply 1.23 -> #220780000000000000000000000000a3
-decq062 apply #220780000000000000000000000000a3 -> 1.23
-decq063 apply 123.45 -> #220780000000000000000000000049c5
-decq064 apply #220780000000000000000000000049c5 -> 123.45
-
--- Nmin and below
-decq071 apply 1E-6143 -> #00084000000000000000000000000001
-decq072 apply #00084000000000000000000000000001 -> 1E-6143
-decq073 apply 1.000000000000000000000000000000000E-6143 -> #04000000000000000000000000000000
-decq074 apply #04000000000000000000000000000000 -> 1.000000000000000000000000000000000E-6143
-decq075 apply 1.000000000000000000000000000000001E-6143 -> #04000000000000000000000000000001
-decq076 apply #04000000000000000000000000000001 -> 1.000000000000000000000000000000001E-6143
-
-decq077 apply 0.100000000000000000000000000000000E-6143 -> #00000800000000000000000000000000 Subnormal
-decq078 apply #00000800000000000000000000000000 -> 1.00000000000000000000000000000000E-6144 Subnormal
-decq079 apply 0.000000000000000000000000000000010E-6143 -> #00000000000000000000000000000010 Subnormal
-decq080 apply #00000000000000000000000000000010 -> 1.0E-6175 Subnormal
-decq081 apply 0.00000000000000000000000000000001E-6143 -> #00004000000000000000000000000001 Subnormal
-decq082 apply #00004000000000000000000000000001 -> 1E-6175 Subnormal
-decq083 apply 0.000000000000000000000000000000001E-6143 -> #00000000000000000000000000000001 Subnormal
-decq084 apply #00000000000000000000000000000001 -> 1E-6176 Subnormal
-
--- underflows cannot be tested for simple copies, check edge cases
-decq090 apply 1e-6176 -> #00000000000000000000000000000001 Subnormal
-decq100 apply 999999999999999999999999999999999e-6176 -> #00000ff3fcff3fcff3fcff3fcff3fcff Subnormal
-
--- same again, negatives
--- Nmax and similar
-decq122 apply -9.999999999999999999999999999999999E+6144 -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
-decq123 apply #f7ffcff3fcff3fcff3fcff3fcff3fcff -> -9.999999999999999999999999999999999E+6144
-decq124 apply -1.234567890123456789012345678901234E+6144 -> #c7ffd34b9c1e28e56f3c127177823534
-decq125 apply #c7ffd34b9c1e28e56f3c127177823534 -> -1.234567890123456789012345678901234E+6144
--- fold-downs (more below)
-decq130 apply -1.23E+6144 -> #c7ffd300000000000000000000000000 Clamped
-decq131 apply #c7ffd300000000000000000000000000 -> -1.230000000000000000000000000000000E+6144
-decq132 apply -1E+6144 -> #c7ffc000000000000000000000000000 Clamped
-decq133 apply #c7ffc000000000000000000000000000 -> -1.000000000000000000000000000000000E+6144
-
-decq151 apply -12345 -> #a20800000000000000000000000049c5
-decq152 apply #a20800000000000000000000000049c5 -> -12345
-decq153 apply -1234 -> #a2080000000000000000000000000534
-decq154 apply #a2080000000000000000000000000534 -> -1234
-decq155 apply -123 -> #a20800000000000000000000000000a3
-decq156 apply #a20800000000000000000000000000a3 -> -123
-decq157 apply -12 -> #a2080000000000000000000000000012
-decq158 apply #a2080000000000000000000000000012 -> -12
-decq159 apply -1 -> #a2080000000000000000000000000001
-decq160 apply #a2080000000000000000000000000001 -> -1
-decq161 apply -1.23 -> #a20780000000000000000000000000a3
-decq162 apply #a20780000000000000000000000000a3 -> -1.23
-decq163 apply -123.45 -> #a20780000000000000000000000049c5
-decq164 apply #a20780000000000000000000000049c5 -> -123.45
-
--- Nmin and below
-decq171 apply -1E-6143 -> #80084000000000000000000000000001
-decq172 apply #80084000000000000000000000000001 -> -1E-6143
-decq173 apply -1.000000000000000000000000000000000E-6143 -> #84000000000000000000000000000000
-decq174 apply #84000000000000000000000000000000 -> -1.000000000000000000000000000000000E-6143
-decq175 apply -1.000000000000000000000000000000001E-6143 -> #84000000000000000000000000000001
-decq176 apply #84000000000000000000000000000001 -> -1.000000000000000000000000000000001E-6143
-
-decq177 apply -0.100000000000000000000000000000000E-6143 -> #80000800000000000000000000000000 Subnormal
-decq178 apply #80000800000000000000000000000000 -> -1.00000000000000000000000000000000E-6144 Subnormal
-decq179 apply -0.000000000000000000000000000000010E-6143 -> #80000000000000000000000000000010 Subnormal
-decq180 apply #80000000000000000000000000000010 -> -1.0E-6175 Subnormal
-decq181 apply -0.00000000000000000000000000000001E-6143 -> #80004000000000000000000000000001 Subnormal
-decq182 apply #80004000000000000000000000000001 -> -1E-6175 Subnormal
-decq183 apply -0.000000000000000000000000000000001E-6143 -> #80000000000000000000000000000001 Subnormal
-decq184 apply #80000000000000000000000000000001 -> -1E-6176 Subnormal
-
--- underflow edge cases
-decq190 apply -1e-6176 -> #80000000000000000000000000000001 Subnormal
-decq200 apply -999999999999999999999999999999999e-6176 -> #80000ff3fcff3fcff3fcff3fcff3fcff Subnormal
-
--- zeros
-decq400 apply 0E-8000 -> #00000000000000000000000000000000 Clamped
-decq401 apply 0E-6177 -> #00000000000000000000000000000000 Clamped
-decq402 apply 0E-6176 -> #00000000000000000000000000000000
-decq403 apply #00000000000000000000000000000000 -> 0E-6176
-decq404 apply 0.000000000000000000000000000000000E-6143 -> #00000000000000000000000000000000
-decq405 apply #00000000000000000000000000000000 -> 0E-6176
-decq406 apply 0E-2 -> #22078000000000000000000000000000
-decq407 apply #22078000000000000000000000000000 -> 0.00
-decq408 apply 0 -> #22080000000000000000000000000000
-decq409 apply #22080000000000000000000000000000 -> 0
-decq410 apply 0E+3 -> #2208c000000000000000000000000000
-decq411 apply #2208c000000000000000000000000000 -> 0E+3
-decq412 apply 0E+6111 -> #43ffc000000000000000000000000000
-decq413 apply #43ffc000000000000000000000000000 -> 0E+6111
--- clamped zeros...
-decq414 apply 0E+6112 -> #43ffc000000000000000000000000000 Clamped
-decq415 apply #43ffc000000000000000000000000000 -> 0E+6111
-decq416 apply 0E+6144 -> #43ffc000000000000000000000000000 Clamped
-decq417 apply #43ffc000000000000000000000000000 -> 0E+6111
-decq418 apply 0E+8000 -> #43ffc000000000000000000000000000 Clamped
-decq419 apply #43ffc000000000000000000000000000 -> 0E+6111
-
--- negative zeros
-decq420 apply -0E-8000 -> #80000000000000000000000000000000 Clamped
-decq421 apply -0E-6177 -> #80000000000000000000000000000000 Clamped
-decq422 apply -0E-6176 -> #80000000000000000000000000000000
-decq423 apply #80000000000000000000000000000000 -> -0E-6176
-decq424 apply -0.000000000000000000000000000000000E-6143 -> #80000000000000000000000000000000
-decq425 apply #80000000000000000000000000000000 -> -0E-6176
-decq426 apply -0E-2 -> #a2078000000000000000000000000000
-decq427 apply #a2078000000000000000000000000000 -> -0.00
-decq428 apply -0 -> #a2080000000000000000000000000000
-decq429 apply #a2080000000000000000000000000000 -> -0
-decq430 apply -0E+3 -> #a208c000000000000000000000000000
-decq431 apply #a208c000000000000000000000000000 -> -0E+3
-decq432 apply -0E+6111 -> #c3ffc000000000000000000000000000
-decq433 apply #c3ffc000000000000000000000000000 -> -0E+6111
--- clamped zeros...
-decq434 apply -0E+6112 -> #c3ffc000000000000000000000000000 Clamped
-decq435 apply #c3ffc000000000000000000000000000 -> -0E+6111
-decq436 apply -0E+6144 -> #c3ffc000000000000000000000000000 Clamped
-decq437 apply #c3ffc000000000000000000000000000 -> -0E+6111
-decq438 apply -0E+8000 -> #c3ffc000000000000000000000000000 Clamped
-decq439 apply #c3ffc000000000000000000000000000 -> -0E+6111
-
--- exponent lengths
-decq440 apply #22080000000000000000000000000007 -> 7
-decq441 apply 7 -> #22080000000000000000000000000007
-decq442 apply #220a4000000000000000000000000007 -> 7E+9
-decq443 apply 7E+9 -> #220a4000000000000000000000000007
-decq444 apply #2220c000000000000000000000000007 -> 7E+99
-decq445 apply 7E+99 -> #2220c000000000000000000000000007
-decq446 apply #2301c000000000000000000000000007 -> 7E+999
-decq447 apply 7E+999 -> #2301c000000000000000000000000007
-decq448 apply #43e3c000000000000000000000000007 -> 7E+5999
-decq449 apply 7E+5999 -> #43e3c000000000000000000000000007
-
--- Specials
-decq500 apply Infinity -> #78000000000000000000000000000000
-decq501 apply #78787878787878787878787878787878 -> #78000000000000000000000000000000
-decq502 apply #78000000000000000000000000000000 -> Infinity
-decq503 apply #79797979797979797979797979797979 -> #78000000000000000000000000000000
-decq504 apply #79000000000000000000000000000000 -> Infinity
-decq505 apply #7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #78000000000000000000000000000000
-decq506 apply #7a000000000000000000000000000000 -> Infinity
-decq507 apply #7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #78000000000000000000000000000000
-decq508 apply #7b000000000000000000000000000000 -> Infinity
-
-decq509 apply NaN -> #7c000000000000000000000000000000
-decq510 apply #7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #7c003c7c7c7c7c7c7c7c7c7c7c7c7c7c
-decq511 apply #7c000000000000000000000000000000 -> NaN
-decq512 apply #7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #7c003d7d7d7d7d7d7d7d7d7d7d7d7d7d
-decq513 apply #7d000000000000000000000000000000 -> NaN
-decq514 apply #7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #7e003e7e7c7e7e7e7e7c7e7e7e7e7c7e
-decq515 apply #7e000000000000000000000000000000 -> sNaN
-decq516 apply #7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #7e003f7f7c7f7f7f7f7c7f7f7f7f7c7f
-decq517 apply #7f000000000000000000000000000000 -> sNaN
-decq518 apply #7fffffffffffffffffffffffffffffff -> sNaN999999999999999999999999999999999
-decq519 apply #7fffffffffffffffffffffffffffffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
-
-decq520 apply -Infinity -> #f8000000000000000000000000000000
-decq521 apply #f8787878787878787878787878787878 -> #f8000000000000000000000000000000
-decq522 apply #f8000000000000000000000000000000 -> -Infinity
-decq523 apply #f9797979797979797979797979797979 -> #f8000000000000000000000000000000
-decq524 apply #f9000000000000000000000000000000 -> -Infinity
-decq525 apply #fa7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #f8000000000000000000000000000000
-decq526 apply #fa000000000000000000000000000000 -> -Infinity
-decq527 apply #fb7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #f8000000000000000000000000000000
-decq528 apply #fb000000000000000000000000000000 -> -Infinity
-
-decq529 apply -NaN -> #fc000000000000000000000000000000
-decq530 apply #fc7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #fc003c7c7c7c7c7c7c7c7c7c7c7c7c7c
-decq531 apply #fc000000000000000000000000000000 -> -NaN
-decq532 apply #fd7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #fc003d7d7d7d7d7d7d7d7d7d7d7d7d7d
-decq533 apply #fd000000000000000000000000000000 -> -NaN
-decq534 apply #fe7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #fe003e7e7c7e7e7e7e7c7e7e7e7e7c7e
-decq535 apply #fe000000000000000000000000000000 -> -sNaN
-decq536 apply #ff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #fe003f7f7c7f7f7f7f7c7f7f7f7f7c7f
-decq537 apply #ff000000000000000000000000000000 -> -sNaN
-decq538 apply #ffffffffffffffffffffffffffffffff -> -sNaN999999999999999999999999999999999
-decq539 apply #ffffffffffffffffffffffffffffffff -> #fe000ff3fcff3fcff3fcff3fcff3fcff
-
-decq540 apply NaN -> #7c000000000000000000000000000000
-decq541 apply NaN0 -> #7c000000000000000000000000000000
-decq542 apply NaN1 -> #7c000000000000000000000000000001
-decq543 apply NaN12 -> #7c000000000000000000000000000012
-decq544 apply NaN79 -> #7c000000000000000000000000000079
-decq545 apply NaN12345 -> #7c0000000000000000000000000049c5
-decq546 apply NaN123456 -> #7c000000000000000000000000028e56
-decq547 apply NaN799799 -> #7c0000000000000000000000000f7fdf
-decq548 apply NaN799799799799799799799799799799799 -> #7c003dff7fdff7fdff7fdff7fdff7fdf
-decq549 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
-decq550 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff
-
--- fold-down full sequence
-decq601 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped
-decq602 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144
-decq603 apply 1E+6143 -> #43ffc800000000000000000000000000 Clamped
-decq604 apply #43ffc800000000000000000000000000 -> 1.00000000000000000000000000000000E+6143
-decq605 apply 1E+6142 -> #43ffc100000000000000000000000000 Clamped
-decq606 apply #43ffc100000000000000000000000000 -> 1.0000000000000000000000000000000E+6142
-decq607 apply 1E+6141 -> #43ffc010000000000000000000000000 Clamped
-decq608 apply #43ffc010000000000000000000000000 -> 1.000000000000000000000000000000E+6141
-decq609 apply 1E+6140 -> #43ffc002000000000000000000000000 Clamped
-decq610 apply #43ffc002000000000000000000000000 -> 1.00000000000000000000000000000E+6140
-decq611 apply 1E+6139 -> #43ffc000400000000000000000000000 Clamped
-decq612 apply #43ffc000400000000000000000000000 -> 1.0000000000000000000000000000E+6139
-decq613 apply 1E+6138 -> #43ffc000040000000000000000000000 Clamped
-decq614 apply #43ffc000040000000000000000000000 -> 1.000000000000000000000000000E+6138
-decq615 apply 1E+6137 -> #43ffc000008000000000000000000000 Clamped
-decq616 apply #43ffc000008000000000000000000000 -> 1.00000000000000000000000000E+6137
-decq617 apply 1E+6136 -> #43ffc000001000000000000000000000 Clamped
-decq618 apply #43ffc000001000000000000000000000 -> 1.0000000000000000000000000E+6136
-decq619 apply 1E+6135 -> #43ffc000000100000000000000000000 Clamped
-decq620 apply #43ffc000000100000000000000000000 -> 1.000000000000000000000000E+6135
-decq621 apply 1E+6134 -> #43ffc000000020000000000000000000 Clamped
-decq622 apply #43ffc000000020000000000000000000 -> 1.00000000000000000000000E+6134
-decq623 apply 1E+6133 -> #43ffc000000004000000000000000000 Clamped
-decq624 apply #43ffc000000004000000000000000000 -> 1.0000000000000000000000E+6133
-decq625 apply 1E+6132 -> #43ffc000000000400000000000000000 Clamped
-decq626 apply #43ffc000000000400000000000000000 -> 1.000000000000000000000E+6132
-decq627 apply 1E+6131 -> #43ffc000000000080000000000000000 Clamped
-decq628 apply #43ffc000000000080000000000000000 -> 1.00000000000000000000E+6131
-decq629 apply 1E+6130 -> #43ffc000000000010000000000000000 Clamped
-decq630 apply #43ffc000000000010000000000000000 -> 1.0000000000000000000E+6130
-decq631 apply 1E+6129 -> #43ffc000000000001000000000000000 Clamped
-decq632 apply #43ffc000000000001000000000000000 -> 1.000000000000000000E+6129
-decq633 apply 1E+6128 -> #43ffc000000000000200000000000000 Clamped
-decq634 apply #43ffc000000000000200000000000000 -> 1.00000000000000000E+6128
-decq635 apply 1E+6127 -> #43ffc000000000000040000000000000 Clamped
-decq636 apply #43ffc000000000000040000000000000 -> 1.0000000000000000E+6127
-decq637 apply 1E+6126 -> #43ffc000000000000004000000000000 Clamped
-decq638 apply #43ffc000000000000004000000000000 -> 1.000000000000000E+6126
-decq639 apply 1E+6125 -> #43ffc000000000000000800000000000 Clamped
-decq640 apply #43ffc000000000000000800000000000 -> 1.00000000000000E+6125
-decq641 apply 1E+6124 -> #43ffc000000000000000100000000000 Clamped
-decq642 apply #43ffc000000000000000100000000000 -> 1.0000000000000E+6124
-decq643 apply 1E+6123 -> #43ffc000000000000000010000000000 Clamped
-decq644 apply #43ffc000000000000000010000000000 -> 1.000000000000E+6123
-decq645 apply 1E+6122 -> #43ffc000000000000000002000000000 Clamped
-decq646 apply #43ffc000000000000000002000000000 -> 1.00000000000E+6122
-decq647 apply 1E+6121 -> #43ffc000000000000000000400000000 Clamped
-decq648 apply #43ffc000000000000000000400000000 -> 1.0000000000E+6121
-decq649 apply 1E+6120 -> #43ffc000000000000000000040000000 Clamped
-decq650 apply #43ffc000000000000000000040000000 -> 1.000000000E+6120
-decq651 apply 1E+6119 -> #43ffc000000000000000000008000000 Clamped
-decq652 apply #43ffc000000000000000000008000000 -> 1.00000000E+6119
-decq653 apply 1E+6118 -> #43ffc000000000000000000001000000 Clamped
-decq654 apply #43ffc000000000000000000001000000 -> 1.0000000E+6118
-decq655 apply 1E+6117 -> #43ffc000000000000000000000100000 Clamped
-decq656 apply #43ffc000000000000000000000100000 -> 1.000000E+6117
-decq657 apply 1E+6116 -> #43ffc000000000000000000000020000 Clamped
-decq658 apply #43ffc000000000000000000000020000 -> 1.00000E+6116
-decq659 apply 1E+6115 -> #43ffc000000000000000000000004000 Clamped
-decq660 apply #43ffc000000000000000000000004000 -> 1.0000E+6115
-decq661 apply 1E+6114 -> #43ffc000000000000000000000000400 Clamped
-decq662 apply #43ffc000000000000000000000000400 -> 1.000E+6114
-decq663 apply 1E+6113 -> #43ffc000000000000000000000000080 Clamped
-decq664 apply #43ffc000000000000000000000000080 -> 1.00E+6113
-decq665 apply 1E+6112 -> #43ffc000000000000000000000000010 Clamped
-decq666 apply #43ffc000000000000000000000000010 -> 1.0E+6112
-decq667 apply 1E+6111 -> #43ffc000000000000000000000000001
-decq668 apply #43ffc000000000000000000000000001 -> 1E+6111
-decq669 apply 1E+6110 -> #43ff8000000000000000000000000001
-decq670 apply #43ff8000000000000000000000000001 -> 1E+6110
-
--- Selected DPD codes
-decq700 apply #22080000000000000000000000000000 -> 0
-decq701 apply #22080000000000000000000000000009 -> 9
-decq702 apply #22080000000000000000000000000010 -> 10
-decq703 apply #22080000000000000000000000000019 -> 19
-decq704 apply #22080000000000000000000000000020 -> 20
-decq705 apply #22080000000000000000000000000029 -> 29
-decq706 apply #22080000000000000000000000000030 -> 30
-decq707 apply #22080000000000000000000000000039 -> 39
-decq708 apply #22080000000000000000000000000040 -> 40
-decq709 apply #22080000000000000000000000000049 -> 49
-decq710 apply #22080000000000000000000000000050 -> 50
-decq711 apply #22080000000000000000000000000059 -> 59
-decq712 apply #22080000000000000000000000000060 -> 60
-decq713 apply #22080000000000000000000000000069 -> 69
-decq714 apply #22080000000000000000000000000070 -> 70
-decq715 apply #22080000000000000000000000000071 -> 71
-decq716 apply #22080000000000000000000000000072 -> 72
-decq717 apply #22080000000000000000000000000073 -> 73
-decq718 apply #22080000000000000000000000000074 -> 74
-decq719 apply #22080000000000000000000000000075 -> 75
-decq720 apply #22080000000000000000000000000076 -> 76
-decq721 apply #22080000000000000000000000000077 -> 77
-decq722 apply #22080000000000000000000000000078 -> 78
-decq723 apply #22080000000000000000000000000079 -> 79
-
-decq730 apply #2208000000000000000000000000029e -> 994
-decq731 apply #2208000000000000000000000000029f -> 995
-decq732 apply #220800000000000000000000000002a0 -> 520
-decq733 apply #220800000000000000000000000002a1 -> 521
-
--- DPD: one of each of the huffman groups
-decq740 apply #220800000000000000000000000003f7 -> 777
-decq741 apply #220800000000000000000000000003f8 -> 778
-decq742 apply #220800000000000000000000000003eb -> 787
-decq743 apply #2208000000000000000000000000037d -> 877
-decq744 apply #2208000000000000000000000000039f -> 997
-decq745 apply #220800000000000000000000000003bf -> 979
-decq746 apply #220800000000000000000000000003df -> 799
-decq747 apply #2208000000000000000000000000006e -> 888
-
-
--- DPD all-highs cases (includes the 24 redundant codes)
-decq750 apply #2208000000000000000000000000006e -> 888
-decq751 apply #2208000000000000000000000000016e -> 888
-decq752 apply #2208000000000000000000000000026e -> 888
-decq753 apply #2208000000000000000000000000036e -> 888
-decq754 apply #2208000000000000000000000000006f -> 889
-decq755 apply #2208000000000000000000000000016f -> 889
-decq756 apply #2208000000000000000000000000026f -> 889
-decq757 apply #2208000000000000000000000000036f -> 889
-
-decq760 apply #2208000000000000000000000000007e -> 898
-decq761 apply #2208000000000000000000000000017e -> 898
-decq762 apply #2208000000000000000000000000027e -> 898
-decq763 apply #2208000000000000000000000000037e -> 898
-decq764 apply #2208000000000000000000000000007f -> 899
-decq765 apply #2208000000000000000000000000017f -> 899
-decq766 apply #2208000000000000000000000000027f -> 899
-decq767 apply #2208000000000000000000000000037f -> 899
-
-decq770 apply #220800000000000000000000000000ee -> 988
-decq771 apply #220800000000000000000000000001ee -> 988
-decq772 apply #220800000000000000000000000002ee -> 988
-decq773 apply #220800000000000000000000000003ee -> 988
-decq774 apply #220800000000000000000000000000ef -> 989
-decq775 apply #220800000000000000000000000001ef -> 989
-decq776 apply #220800000000000000000000000002ef -> 989
-decq777 apply #220800000000000000000000000003ef -> 989
-
-decq780 apply #220800000000000000000000000000fe -> 998
-decq781 apply #220800000000000000000000000001fe -> 998
-decq782 apply #220800000000000000000000000002fe -> 998
-decq783 apply #220800000000000000000000000003fe -> 998
-decq784 apply #220800000000000000000000000000ff -> 999
-decq785 apply #220800000000000000000000000001ff -> 999
-decq786 apply #220800000000000000000000000002ff -> 999
-decq787 apply #220800000000000000000000000003ff -> 999
-
--- Miscellaneous (testers' queries, etc.)
-
-decq790 apply #2208000000000000000000000000c000 -> 30000
-decq791 apply #22080000000000000000000000007800 -> 890000
-decq792 apply 30000 -> #2208000000000000000000000000c000
-decq793 apply 890000 -> #22080000000000000000000000007800
-
--- values around [u]int32 edges (zeros done earlier)
-decq800 apply -2147483646 -> #a208000000000000000000008c78af46
-decq801 apply -2147483647 -> #a208000000000000000000008c78af47
-decq802 apply -2147483648 -> #a208000000000000000000008c78af48
-decq803 apply -2147483649 -> #a208000000000000000000008c78af49
-decq804 apply 2147483646 -> #2208000000000000000000008c78af46
-decq805 apply 2147483647 -> #2208000000000000000000008c78af47
-decq806 apply 2147483648 -> #2208000000000000000000008c78af48
-decq807 apply 2147483649 -> #2208000000000000000000008c78af49
-decq808 apply 4294967294 -> #22080000000000000000000115afb55a
-decq809 apply 4294967295 -> #22080000000000000000000115afb55b
-decq810 apply 4294967296 -> #22080000000000000000000115afb57a
-decq811 apply 4294967297 -> #22080000000000000000000115afb57b
-
-decq820 apply #a208000000000000000000008c78af46 -> -2147483646
-decq821 apply #a208000000000000000000008c78af47 -> -2147483647
-decq822 apply #a208000000000000000000008c78af48 -> -2147483648
-decq823 apply #a208000000000000000000008c78af49 -> -2147483649
-decq824 apply #2208000000000000000000008c78af46 -> 2147483646
-decq825 apply #2208000000000000000000008c78af47 -> 2147483647
-decq826 apply #2208000000000000000000008c78af48 -> 2147483648
-decq827 apply #2208000000000000000000008c78af49 -> 2147483649
-decq828 apply #22080000000000000000000115afb55a -> 4294967294
-decq829 apply #22080000000000000000000115afb55b -> 4294967295
-decq830 apply #22080000000000000000000115afb57a -> 4294967296
-decq831 apply #22080000000000000000000115afb57b -> 4294967297
-
--- VG testcase
-decq840 apply #2080000000000000F294000000172636 -> 8.81125000000001349436E-1548
-decq841 apply #20800000000000008000000000000000 -> 8.000000000000000000E-1550
-decq842 apply #1EF98490000000010F6E4E0000000000 -> 7.049000000000010795488000000000000E-3097
-decq843 multiply #20800000000000008000000000000000 #2080000000000000F294000000172636 -> #1EF98490000000010F6E4E0000000000 Rounded
-
+------------------------------------------------------------------------
+-- dqEncode.decTest -- decimal sixteen-byte format testcases --
+-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+-- [Previously called decimal128.decTest]
+version: 2.59
+
+-- This set of tests is for the sixteen-byte concrete representation.
+-- Its characteristics are:
+--
+-- 1 bit sign
+-- 5 bits combination field
+-- 12 bits exponent continuation
+-- 110 bits coefficient continuation
+--
+-- Total exponent length 14 bits
+-- Total coefficient length 114 bits (34 digits)
+--
+-- Elimit = 12287 (maximum encoded exponent)
+-- Emax = 6144 (largest exponent value)
+-- Emin = -6143 (smallest exponent value)
+-- bias = 6176 (subtracted from encoded exponent) = -Etiny
+
+-- The testcases here have only exactly representable data on the
+-- 'left-hand-side'; rounding from strings is tested in 'base'
+-- testcase groups.
+
+extended: 1
+clamp: 1
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+
+-- General testcases
+-- (mostly derived from the Strawman 4 document and examples)
+decq001 apply #A20780000000000000000000000003D0 -> -7.50
+decq002 apply -7.50 -> #A20780000000000000000000000003D0
+-- derivative canonical plain strings
+decq003 apply #A20840000000000000000000000003D0 -> -7.50E+3
+decq004 apply -7.50E+3 -> #A20840000000000000000000000003D0
+decq005 apply #A20800000000000000000000000003D0 -> -750
+decq006 apply -750 -> #A20800000000000000000000000003D0
+decq007 apply #A207c0000000000000000000000003D0 -> -75.0
+decq008 apply -75.0 -> #A207c0000000000000000000000003D0
+decq009 apply #A20740000000000000000000000003D0 -> -0.750
+decq010 apply -0.750 -> #A20740000000000000000000000003D0
+decq011 apply #A20700000000000000000000000003D0 -> -0.0750
+decq012 apply -0.0750 -> #A20700000000000000000000000003D0
+decq013 apply #A20680000000000000000000000003D0 -> -0.000750
+decq014 apply -0.000750 -> #A20680000000000000000000000003D0
+decq015 apply #A20600000000000000000000000003D0 -> -0.00000750
+decq016 apply -0.00000750 -> #A20600000000000000000000000003D0
+decq017 apply #A205c0000000000000000000000003D0 -> -7.50E-7
+decq018 apply -7.50E-7 -> #A205c0000000000000000000000003D0
+
+-- Normality
+decq020 apply 1234567890123456789012345678901234 -> #2608134b9c1e28e56f3c127177823534
+decq021 apply -1234567890123456789012345678901234 -> #a608134b9c1e28e56f3c127177823534
+decq022 apply 1111111111111111111111111111111111 -> #26080912449124491244912449124491
+
+-- Nmax and similar
+decq031 apply 9.999999999999999999999999999999999E+6144 -> #77ffcff3fcff3fcff3fcff3fcff3fcff
+decq032 apply #77ffcff3fcff3fcff3fcff3fcff3fcff -> 9.999999999999999999999999999999999E+6144
+decq033 apply 1.234567890123456789012345678901234E+6144 -> #47ffd34b9c1e28e56f3c127177823534
+decq034 apply #47ffd34b9c1e28e56f3c127177823534 -> 1.234567890123456789012345678901234E+6144
+-- fold-downs (more below)
+decq035 apply 1.23E+6144 -> #47ffd300000000000000000000000000 Clamped
+decq036 apply #47ffd300000000000000000000000000 -> 1.230000000000000000000000000000000E+6144
+decq037 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped
+decq038 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144
+
+decq051 apply 12345 -> #220800000000000000000000000049c5
+decq052 apply #220800000000000000000000000049c5 -> 12345
+decq053 apply 1234 -> #22080000000000000000000000000534
+decq054 apply #22080000000000000000000000000534 -> 1234
+decq055 apply 123 -> #220800000000000000000000000000a3
+decq056 apply #220800000000000000000000000000a3 -> 123
+decq057 apply 12 -> #22080000000000000000000000000012
+decq058 apply #22080000000000000000000000000012 -> 12
+decq059 apply 1 -> #22080000000000000000000000000001
+decq060 apply #22080000000000000000000000000001 -> 1
+decq061 apply 1.23 -> #220780000000000000000000000000a3
+decq062 apply #220780000000000000000000000000a3 -> 1.23
+decq063 apply 123.45 -> #220780000000000000000000000049c5
+decq064 apply #220780000000000000000000000049c5 -> 123.45
+
+-- Nmin and below
+decq071 apply 1E-6143 -> #00084000000000000000000000000001
+decq072 apply #00084000000000000000000000000001 -> 1E-6143
+decq073 apply 1.000000000000000000000000000000000E-6143 -> #04000000000000000000000000000000
+decq074 apply #04000000000000000000000000000000 -> 1.000000000000000000000000000000000E-6143
+decq075 apply 1.000000000000000000000000000000001E-6143 -> #04000000000000000000000000000001
+decq076 apply #04000000000000000000000000000001 -> 1.000000000000000000000000000000001E-6143
+
+decq077 apply 0.100000000000000000000000000000000E-6143 -> #00000800000000000000000000000000 Subnormal
+decq078 apply #00000800000000000000000000000000 -> 1.00000000000000000000000000000000E-6144 Subnormal
+decq079 apply 0.000000000000000000000000000000010E-6143 -> #00000000000000000000000000000010 Subnormal
+decq080 apply #00000000000000000000000000000010 -> 1.0E-6175 Subnormal
+decq081 apply 0.00000000000000000000000000000001E-6143 -> #00004000000000000000000000000001 Subnormal
+decq082 apply #00004000000000000000000000000001 -> 1E-6175 Subnormal
+decq083 apply 0.000000000000000000000000000000001E-6143 -> #00000000000000000000000000000001 Subnormal
+decq084 apply #00000000000000000000000000000001 -> 1E-6176 Subnormal
+
+-- underflows cannot be tested for simple copies, check edge cases
+decq090 apply 1e-6176 -> #00000000000000000000000000000001 Subnormal
+decq100 apply 999999999999999999999999999999999e-6176 -> #00000ff3fcff3fcff3fcff3fcff3fcff Subnormal
+
+-- same again, negatives
+-- Nmax and similar
+decq122 apply -9.999999999999999999999999999999999E+6144 -> #f7ffcff3fcff3fcff3fcff3fcff3fcff
+decq123 apply #f7ffcff3fcff3fcff3fcff3fcff3fcff -> -9.999999999999999999999999999999999E+6144
+decq124 apply -1.234567890123456789012345678901234E+6144 -> #c7ffd34b9c1e28e56f3c127177823534
+decq125 apply #c7ffd34b9c1e28e56f3c127177823534 -> -1.234567890123456789012345678901234E+6144
+-- fold-downs (more below)
+decq130 apply -1.23E+6144 -> #c7ffd300000000000000000000000000 Clamped
+decq131 apply #c7ffd300000000000000000000000000 -> -1.230000000000000000000000000000000E+6144
+decq132 apply -1E+6144 -> #c7ffc000000000000000000000000000 Clamped
+decq133 apply #c7ffc000000000000000000000000000 -> -1.000000000000000000000000000000000E+6144
+
+decq151 apply -12345 -> #a20800000000000000000000000049c5
+decq152 apply #a20800000000000000000000000049c5 -> -12345
+decq153 apply -1234 -> #a2080000000000000000000000000534
+decq154 apply #a2080000000000000000000000000534 -> -1234
+decq155 apply -123 -> #a20800000000000000000000000000a3
+decq156 apply #a20800000000000000000000000000a3 -> -123
+decq157 apply -12 -> #a2080000000000000000000000000012
+decq158 apply #a2080000000000000000000000000012 -> -12
+decq159 apply -1 -> #a2080000000000000000000000000001
+decq160 apply #a2080000000000000000000000000001 -> -1
+decq161 apply -1.23 -> #a20780000000000000000000000000a3
+decq162 apply #a20780000000000000000000000000a3 -> -1.23
+decq163 apply -123.45 -> #a20780000000000000000000000049c5
+decq164 apply #a20780000000000000000000000049c5 -> -123.45
+
+-- Nmin and below
+decq171 apply -1E-6143 -> #80084000000000000000000000000001
+decq172 apply #80084000000000000000000000000001 -> -1E-6143
+decq173 apply -1.000000000000000000000000000000000E-6143 -> #84000000000000000000000000000000
+decq174 apply #84000000000000000000000000000000 -> -1.000000000000000000000000000000000E-6143
+decq175 apply -1.000000000000000000000000000000001E-6143 -> #84000000000000000000000000000001
+decq176 apply #84000000000000000000000000000001 -> -1.000000000000000000000000000000001E-6143
+
+decq177 apply -0.100000000000000000000000000000000E-6143 -> #80000800000000000000000000000000 Subnormal
+decq178 apply #80000800000000000000000000000000 -> -1.00000000000000000000000000000000E-6144 Subnormal
+decq179 apply -0.000000000000000000000000000000010E-6143 -> #80000000000000000000000000000010 Subnormal
+decq180 apply #80000000000000000000000000000010 -> -1.0E-6175 Subnormal
+decq181 apply -0.00000000000000000000000000000001E-6143 -> #80004000000000000000000000000001 Subnormal
+decq182 apply #80004000000000000000000000000001 -> -1E-6175 Subnormal
+decq183 apply -0.000000000000000000000000000000001E-6143 -> #80000000000000000000000000000001 Subnormal
+decq184 apply #80000000000000000000000000000001 -> -1E-6176 Subnormal
+
+-- underflow edge cases
+decq190 apply -1e-6176 -> #80000000000000000000000000000001 Subnormal
+decq200 apply -999999999999999999999999999999999e-6176 -> #80000ff3fcff3fcff3fcff3fcff3fcff Subnormal
+
+-- zeros
+decq400 apply 0E-8000 -> #00000000000000000000000000000000 Clamped
+decq401 apply 0E-6177 -> #00000000000000000000000000000000 Clamped
+decq402 apply 0E-6176 -> #00000000000000000000000000000000
+decq403 apply #00000000000000000000000000000000 -> 0E-6176
+decq404 apply 0.000000000000000000000000000000000E-6143 -> #00000000000000000000000000000000
+decq405 apply #00000000000000000000000000000000 -> 0E-6176
+decq406 apply 0E-2 -> #22078000000000000000000000000000
+decq407 apply #22078000000000000000000000000000 -> 0.00
+decq408 apply 0 -> #22080000000000000000000000000000
+decq409 apply #22080000000000000000000000000000 -> 0
+decq410 apply 0E+3 -> #2208c000000000000000000000000000
+decq411 apply #2208c000000000000000000000000000 -> 0E+3
+decq412 apply 0E+6111 -> #43ffc000000000000000000000000000
+decq413 apply #43ffc000000000000000000000000000 -> 0E+6111
+-- clamped zeros...
+decq414 apply 0E+6112 -> #43ffc000000000000000000000000000 Clamped
+decq415 apply #43ffc000000000000000000000000000 -> 0E+6111
+decq416 apply 0E+6144 -> #43ffc000000000000000000000000000 Clamped
+decq417 apply #43ffc000000000000000000000000000 -> 0E+6111
+decq418 apply 0E+8000 -> #43ffc000000000000000000000000000 Clamped
+decq419 apply #43ffc000000000000000000000000000 -> 0E+6111
+
+-- negative zeros
+decq420 apply -0E-8000 -> #80000000000000000000000000000000 Clamped
+decq421 apply -0E-6177 -> #80000000000000000000000000000000 Clamped
+decq422 apply -0E-6176 -> #80000000000000000000000000000000
+decq423 apply #80000000000000000000000000000000 -> -0E-6176
+decq424 apply -0.000000000000000000000000000000000E-6143 -> #80000000000000000000000000000000
+decq425 apply #80000000000000000000000000000000 -> -0E-6176
+decq426 apply -0E-2 -> #a2078000000000000000000000000000
+decq427 apply #a2078000000000000000000000000000 -> -0.00
+decq428 apply -0 -> #a2080000000000000000000000000000
+decq429 apply #a2080000000000000000000000000000 -> -0
+decq430 apply -0E+3 -> #a208c000000000000000000000000000
+decq431 apply #a208c000000000000000000000000000 -> -0E+3
+decq432 apply -0E+6111 -> #c3ffc000000000000000000000000000
+decq433 apply #c3ffc000000000000000000000000000 -> -0E+6111
+-- clamped zeros...
+decq434 apply -0E+6112 -> #c3ffc000000000000000000000000000 Clamped
+decq435 apply #c3ffc000000000000000000000000000 -> -0E+6111
+decq436 apply -0E+6144 -> #c3ffc000000000000000000000000000 Clamped
+decq437 apply #c3ffc000000000000000000000000000 -> -0E+6111
+decq438 apply -0E+8000 -> #c3ffc000000000000000000000000000 Clamped
+decq439 apply #c3ffc000000000000000000000000000 -> -0E+6111
+
+-- exponent lengths
+decq440 apply #22080000000000000000000000000007 -> 7
+decq441 apply 7 -> #22080000000000000000000000000007
+decq442 apply #220a4000000000000000000000000007 -> 7E+9
+decq443 apply 7E+9 -> #220a4000000000000000000000000007
+decq444 apply #2220c000000000000000000000000007 -> 7E+99
+decq445 apply 7E+99 -> #2220c000000000000000000000000007
+decq446 apply #2301c000000000000000000000000007 -> 7E+999
+decq447 apply 7E+999 -> #2301c000000000000000000000000007
+decq448 apply #43e3c000000000000000000000000007 -> 7E+5999
+decq449 apply 7E+5999 -> #43e3c000000000000000000000000007
+
+-- Specials
+decq500 apply Infinity -> #78000000000000000000000000000000
+decq501 apply #78787878787878787878787878787878 -> #78000000000000000000000000000000
+decq502 apply #78000000000000000000000000000000 -> Infinity
+decq503 apply #79797979797979797979797979797979 -> #78000000000000000000000000000000
+decq504 apply #79000000000000000000000000000000 -> Infinity
+decq505 apply #7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #78000000000000000000000000000000
+decq506 apply #7a000000000000000000000000000000 -> Infinity
+decq507 apply #7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #78000000000000000000000000000000
+decq508 apply #7b000000000000000000000000000000 -> Infinity
+
+decq509 apply NaN -> #7c000000000000000000000000000000
+decq510 apply #7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #7c003c7c7c7c7c7c7c7c7c7c7c7c7c7c
+decq511 apply #7c000000000000000000000000000000 -> NaN
+decq512 apply #7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #7c003d7d7d7d7d7d7d7d7d7d7d7d7d7d
+decq513 apply #7d000000000000000000000000000000 -> NaN
+decq514 apply #7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #7e003e7e7c7e7e7e7e7c7e7e7e7e7c7e
+decq515 apply #7e000000000000000000000000000000 -> sNaN
+decq516 apply #7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #7e003f7f7c7f7f7f7f7c7f7f7f7f7c7f
+decq517 apply #7f000000000000000000000000000000 -> sNaN
+decq518 apply #7fffffffffffffffffffffffffffffff -> sNaN999999999999999999999999999999999
+decq519 apply #7fffffffffffffffffffffffffffffff -> #7e000ff3fcff3fcff3fcff3fcff3fcff
+
+decq520 apply -Infinity -> #f8000000000000000000000000000000
+decq521 apply #f8787878787878787878787878787878 -> #f8000000000000000000000000000000
+decq522 apply #f8000000000000000000000000000000 -> -Infinity
+decq523 apply #f9797979797979797979797979797979 -> #f8000000000000000000000000000000
+decq524 apply #f9000000000000000000000000000000 -> -Infinity
+decq525 apply #fa7a7a7a7a7a7a7a7a7a7a7a7a7a7a7a -> #f8000000000000000000000000000000
+decq526 apply #fa000000000000000000000000000000 -> -Infinity
+decq527 apply #fb7b7b7b7b7b7b7b7b7b7b7b7b7b7b7b -> #f8000000000000000000000000000000
+decq528 apply #fb000000000000000000000000000000 -> -Infinity
+
+decq529 apply -NaN -> #fc000000000000000000000000000000
+decq530 apply #fc7c7c7c7c7c7c7c7c7c7c7c7c7c7c7c -> #fc003c7c7c7c7c7c7c7c7c7c7c7c7c7c
+decq531 apply #fc000000000000000000000000000000 -> -NaN
+decq532 apply #fd7d7d7d7d7d7d7d7d7d7d7d7d7d7d7d -> #fc003d7d7d7d7d7d7d7d7d7d7d7d7d7d
+decq533 apply #fd000000000000000000000000000000 -> -NaN
+decq534 apply #fe7e7e7e7e7e7e7e7e7e7e7e7e7e7e7e -> #fe003e7e7c7e7e7e7e7c7e7e7e7e7c7e
+decq535 apply #fe000000000000000000000000000000 -> -sNaN
+decq536 apply #ff7f7f7f7f7f7f7f7f7f7f7f7f7f7f7f -> #fe003f7f7c7f7f7f7f7c7f7f7f7f7c7f
+decq537 apply #ff000000000000000000000000000000 -> -sNaN
+decq538 apply #ffffffffffffffffffffffffffffffff -> -sNaN999999999999999999999999999999999
+decq539 apply #ffffffffffffffffffffffffffffffff -> #fe000ff3fcff3fcff3fcff3fcff3fcff
+
+decq540 apply NaN -> #7c000000000000000000000000000000
+decq541 apply NaN0 -> #7c000000000000000000000000000000
+decq542 apply NaN1 -> #7c000000000000000000000000000001
+decq543 apply NaN12 -> #7c000000000000000000000000000012
+decq544 apply NaN79 -> #7c000000000000000000000000000079
+decq545 apply NaN12345 -> #7c0000000000000000000000000049c5
+decq546 apply NaN123456 -> #7c000000000000000000000000028e56
+decq547 apply NaN799799 -> #7c0000000000000000000000000f7fdf
+decq548 apply NaN799799799799799799799799799799799 -> #7c003dff7fdff7fdff7fdff7fdff7fdf
+decq549 apply NaN999999999999999999999999999999999 -> #7c000ff3fcff3fcff3fcff3fcff3fcff
+decq550 apply 9999999999999999999999999999999999 -> #6e080ff3fcff3fcff3fcff3fcff3fcff
+
+-- fold-down full sequence
+decq601 apply 1E+6144 -> #47ffc000000000000000000000000000 Clamped
+decq602 apply #47ffc000000000000000000000000000 -> 1.000000000000000000000000000000000E+6144
+decq603 apply 1E+6143 -> #43ffc800000000000000000000000000 Clamped
+decq604 apply #43ffc800000000000000000000000000 -> 1.00000000000000000000000000000000E+6143
+decq605 apply 1E+6142 -> #43ffc100000000000000000000000000 Clamped
+decq606 apply #43ffc100000000000000000000000000 -> 1.0000000000000000000000000000000E+6142
+decq607 apply 1E+6141 -> #43ffc010000000000000000000000000 Clamped
+decq608 apply #43ffc010000000000000000000000000 -> 1.000000000000000000000000000000E+6141
+decq609 apply 1E+6140 -> #43ffc002000000000000000000000000 Clamped
+decq610 apply #43ffc002000000000000000000000000 -> 1.00000000000000000000000000000E+6140
+decq611 apply 1E+6139 -> #43ffc000400000000000000000000000 Clamped
+decq612 apply #43ffc000400000000000000000000000 -> 1.0000000000000000000000000000E+6139
+decq613 apply 1E+6138 -> #43ffc000040000000000000000000000 Clamped
+decq614 apply #43ffc000040000000000000000000000 -> 1.000000000000000000000000000E+6138
+decq615 apply 1E+6137 -> #43ffc000008000000000000000000000 Clamped
+decq616 apply #43ffc000008000000000000000000000 -> 1.00000000000000000000000000E+6137
+decq617 apply 1E+6136 -> #43ffc000001000000000000000000000 Clamped
+decq618 apply #43ffc000001000000000000000000000 -> 1.0000000000000000000000000E+6136
+decq619 apply 1E+6135 -> #43ffc000000100000000000000000000 Clamped
+decq620 apply #43ffc000000100000000000000000000 -> 1.000000000000000000000000E+6135
+decq621 apply 1E+6134 -> #43ffc000000020000000000000000000 Clamped
+decq622 apply #43ffc000000020000000000000000000 -> 1.00000000000000000000000E+6134
+decq623 apply 1E+6133 -> #43ffc000000004000000000000000000 Clamped
+decq624 apply #43ffc000000004000000000000000000 -> 1.0000000000000000000000E+6133
+decq625 apply 1E+6132 -> #43ffc000000000400000000000000000 Clamped
+decq626 apply #43ffc000000000400000000000000000 -> 1.000000000000000000000E+6132
+decq627 apply 1E+6131 -> #43ffc000000000080000000000000000 Clamped
+decq628 apply #43ffc000000000080000000000000000 -> 1.00000000000000000000E+6131
+decq629 apply 1E+6130 -> #43ffc000000000010000000000000000 Clamped
+decq630 apply #43ffc000000000010000000000000000 -> 1.0000000000000000000E+6130
+decq631 apply 1E+6129 -> #43ffc000000000001000000000000000 Clamped
+decq632 apply #43ffc000000000001000000000000000 -> 1.000000000000000000E+6129
+decq633 apply 1E+6128 -> #43ffc000000000000200000000000000 Clamped
+decq634 apply #43ffc000000000000200000000000000 -> 1.00000000000000000E+6128
+decq635 apply 1E+6127 -> #43ffc000000000000040000000000000 Clamped
+decq636 apply #43ffc000000000000040000000000000 -> 1.0000000000000000E+6127
+decq637 apply 1E+6126 -> #43ffc000000000000004000000000000 Clamped
+decq638 apply #43ffc000000000000004000000000000 -> 1.000000000000000E+6126
+decq639 apply 1E+6125 -> #43ffc000000000000000800000000000 Clamped
+decq640 apply #43ffc000000000000000800000000000 -> 1.00000000000000E+6125
+decq641 apply 1E+6124 -> #43ffc000000000000000100000000000 Clamped
+decq642 apply #43ffc000000000000000100000000000 -> 1.0000000000000E+6124
+decq643 apply 1E+6123 -> #43ffc000000000000000010000000000 Clamped
+decq644 apply #43ffc000000000000000010000000000 -> 1.000000000000E+6123
+decq645 apply 1E+6122 -> #43ffc000000000000000002000000000 Clamped
+decq646 apply #43ffc000000000000000002000000000 -> 1.00000000000E+6122
+decq647 apply 1E+6121 -> #43ffc000000000000000000400000000 Clamped
+decq648 apply #43ffc000000000000000000400000000 -> 1.0000000000E+6121
+decq649 apply 1E+6120 -> #43ffc000000000000000000040000000 Clamped
+decq650 apply #43ffc000000000000000000040000000 -> 1.000000000E+6120
+decq651 apply 1E+6119 -> #43ffc000000000000000000008000000 Clamped
+decq652 apply #43ffc000000000000000000008000000 -> 1.00000000E+6119
+decq653 apply 1E+6118 -> #43ffc000000000000000000001000000 Clamped
+decq654 apply #43ffc000000000000000000001000000 -> 1.0000000E+6118
+decq655 apply 1E+6117 -> #43ffc000000000000000000000100000 Clamped
+decq656 apply #43ffc000000000000000000000100000 -> 1.000000E+6117
+decq657 apply 1E+6116 -> #43ffc000000000000000000000020000 Clamped
+decq658 apply #43ffc000000000000000000000020000 -> 1.00000E+6116
+decq659 apply 1E+6115 -> #43ffc000000000000000000000004000 Clamped
+decq660 apply #43ffc000000000000000000000004000 -> 1.0000E+6115
+decq661 apply 1E+6114 -> #43ffc000000000000000000000000400 Clamped
+decq662 apply #43ffc000000000000000000000000400 -> 1.000E+6114
+decq663 apply 1E+6113 -> #43ffc000000000000000000000000080 Clamped
+decq664 apply #43ffc000000000000000000000000080 -> 1.00E+6113
+decq665 apply 1E+6112 -> #43ffc000000000000000000000000010 Clamped
+decq666 apply #43ffc000000000000000000000000010 -> 1.0E+6112
+decq667 apply 1E+6111 -> #43ffc000000000000000000000000001
+decq668 apply #43ffc000000000000000000000000001 -> 1E+6111
+decq669 apply 1E+6110 -> #43ff8000000000000000000000000001
+decq670 apply #43ff8000000000000000000000000001 -> 1E+6110
+
+-- Selected DPD codes
+decq700 apply #22080000000000000000000000000000 -> 0
+decq701 apply #22080000000000000000000000000009 -> 9
+decq702 apply #22080000000000000000000000000010 -> 10
+decq703 apply #22080000000000000000000000000019 -> 19
+decq704 apply #22080000000000000000000000000020 -> 20
+decq705 apply #22080000000000000000000000000029 -> 29
+decq706 apply #22080000000000000000000000000030 -> 30
+decq707 apply #22080000000000000000000000000039 -> 39
+decq708 apply #22080000000000000000000000000040 -> 40
+decq709 apply #22080000000000000000000000000049 -> 49
+decq710 apply #22080000000000000000000000000050 -> 50
+decq711 apply #22080000000000000000000000000059 -> 59
+decq712 apply #22080000000000000000000000000060 -> 60
+decq713 apply #22080000000000000000000000000069 -> 69
+decq714 apply #22080000000000000000000000000070 -> 70
+decq715 apply #22080000000000000000000000000071 -> 71
+decq716 apply #22080000000000000000000000000072 -> 72
+decq717 apply #22080000000000000000000000000073 -> 73
+decq718 apply #22080000000000000000000000000074 -> 74
+decq719 apply #22080000000000000000000000000075 -> 75
+decq720 apply #22080000000000000000000000000076 -> 76
+decq721 apply #22080000000000000000000000000077 -> 77
+decq722 apply #22080000000000000000000000000078 -> 78
+decq723 apply #22080000000000000000000000000079 -> 79
+
+decq730 apply #2208000000000000000000000000029e -> 994
+decq731 apply #2208000000000000000000000000029f -> 995
+decq732 apply #220800000000000000000000000002a0 -> 520
+decq733 apply #220800000000000000000000000002a1 -> 521
+
+-- DPD: one of each of the huffman groups
+decq740 apply #220800000000000000000000000003f7 -> 777
+decq741 apply #220800000000000000000000000003f8 -> 778
+decq742 apply #220800000000000000000000000003eb -> 787
+decq743 apply #2208000000000000000000000000037d -> 877
+decq744 apply #2208000000000000000000000000039f -> 997
+decq745 apply #220800000000000000000000000003bf -> 979
+decq746 apply #220800000000000000000000000003df -> 799
+decq747 apply #2208000000000000000000000000006e -> 888
+
+
+-- DPD all-highs cases (includes the 24 redundant codes)
+decq750 apply #2208000000000000000000000000006e -> 888
+decq751 apply #2208000000000000000000000000016e -> 888
+decq752 apply #2208000000000000000000000000026e -> 888
+decq753 apply #2208000000000000000000000000036e -> 888
+decq754 apply #2208000000000000000000000000006f -> 889
+decq755 apply #2208000000000000000000000000016f -> 889
+decq756 apply #2208000000000000000000000000026f -> 889
+decq757 apply #2208000000000000000000000000036f -> 889
+
+decq760 apply #2208000000000000000000000000007e -> 898
+decq761 apply #2208000000000000000000000000017e -> 898
+decq762 apply #2208000000000000000000000000027e -> 898
+decq763 apply #2208000000000000000000000000037e -> 898
+decq764 apply #2208000000000000000000000000007f -> 899
+decq765 apply #2208000000000000000000000000017f -> 899
+decq766 apply #2208000000000000000000000000027f -> 899
+decq767 apply #2208000000000000000000000000037f -> 899
+
+decq770 apply #220800000000000000000000000000ee -> 988
+decq771 apply #220800000000000000000000000001ee -> 988
+decq772 apply #220800000000000000000000000002ee -> 988
+decq773 apply #220800000000000000000000000003ee -> 988
+decq774 apply #220800000000000000000000000000ef -> 989
+decq775 apply #220800000000000000000000000001ef -> 989
+decq776 apply #220800000000000000000000000002ef -> 989
+decq777 apply #220800000000000000000000000003ef -> 989
+
+decq780 apply #220800000000000000000000000000fe -> 998
+decq781 apply #220800000000000000000000000001fe -> 998
+decq782 apply #220800000000000000000000000002fe -> 998
+decq783 apply #220800000000000000000000000003fe -> 998
+decq784 apply #220800000000000000000000000000ff -> 999
+decq785 apply #220800000000000000000000000001ff -> 999
+decq786 apply #220800000000000000000000000002ff -> 999
+decq787 apply #220800000000000000000000000003ff -> 999
+
+-- Miscellaneous (testers' queries, etc.)
+
+decq790 apply #2208000000000000000000000000c000 -> 30000
+decq791 apply #22080000000000000000000000007800 -> 890000
+decq792 apply 30000 -> #2208000000000000000000000000c000
+decq793 apply 890000 -> #22080000000000000000000000007800
+
+-- values around [u]int32 edges (zeros done earlier)
+decq800 apply -2147483646 -> #a208000000000000000000008c78af46
+decq801 apply -2147483647 -> #a208000000000000000000008c78af47
+decq802 apply -2147483648 -> #a208000000000000000000008c78af48
+decq803 apply -2147483649 -> #a208000000000000000000008c78af49
+decq804 apply 2147483646 -> #2208000000000000000000008c78af46
+decq805 apply 2147483647 -> #2208000000000000000000008c78af47
+decq806 apply 2147483648 -> #2208000000000000000000008c78af48
+decq807 apply 2147483649 -> #2208000000000000000000008c78af49
+decq808 apply 4294967294 -> #22080000000000000000000115afb55a
+decq809 apply 4294967295 -> #22080000000000000000000115afb55b
+decq810 apply 4294967296 -> #22080000000000000000000115afb57a
+decq811 apply 4294967297 -> #22080000000000000000000115afb57b
+
+decq820 apply #a208000000000000000000008c78af46 -> -2147483646
+decq821 apply #a208000000000000000000008c78af47 -> -2147483647
+decq822 apply #a208000000000000000000008c78af48 -> -2147483648
+decq823 apply #a208000000000000000000008c78af49 -> -2147483649
+decq824 apply #2208000000000000000000008c78af46 -> 2147483646
+decq825 apply #2208000000000000000000008c78af47 -> 2147483647
+decq826 apply #2208000000000000000000008c78af48 -> 2147483648
+decq827 apply #2208000000000000000000008c78af49 -> 2147483649
+decq828 apply #22080000000000000000000115afb55a -> 4294967294
+decq829 apply #22080000000000000000000115afb55b -> 4294967295
+decq830 apply #22080000000000000000000115afb57a -> 4294967296
+decq831 apply #22080000000000000000000115afb57b -> 4294967297
+
+-- VG testcase
+decq840 apply #2080000000000000F294000000172636 -> 8.81125000000001349436E-1548
+decq841 apply #20800000000000008000000000000000 -> 8.000000000000000000E-1550
+decq842 apply #1EF98490000000010F6E4E0000000000 -> 7.049000000000010795488000000000000E-3097
+decq843 multiply #20800000000000008000000000000000 #2080000000000000F294000000172636 -> #1EF98490000000010F6E4E0000000000 Rounded
+
diff --git a/Lib/test/decimaltestdata/dqFMA.decTest b/Lib/test/decimaltestdata/dqFMA.decTest
index 2353f2fa2c..d884553b8a 100644
--- a/Lib/test/decimaltestdata/dqFMA.decTest
+++ b/Lib/test/decimaltestdata/dqFMA.decTest
@@ -1,1786 +1,1786 @@
-------------------------------------------------------------------------
--- dqFMA.decTest -- decQuad Fused Multiply Add --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- These tests comprese three parts:
--- 1. Sanity checks and other three-operand tests (especially those
--- where the fused operation makes a difference)
--- 2. Multiply tests (third operand is neutral zero [0E+emax])
--- 3. Addition tests (first operand is 1)
--- The multiply and addition tests are extensive because FMA may have
--- its own dedicated multiplication or addition routine(s), and they
--- also inherently check the left-to-right properties.
-
--- Sanity checks
-dqfma0001 fma 1 1 1 -> 2
-dqfma0002 fma 1 1 2 -> 3
-dqfma0003 fma 2 2 3 -> 7
-dqfma0004 fma 9 9 9 -> 90
-dqfma0005 fma -1 1 1 -> 0
-dqfma0006 fma -1 1 2 -> 1
-dqfma0007 fma -2 2 3 -> -1
-dqfma0008 fma -9 9 9 -> -72
-dqfma0011 fma 1 -1 1 -> 0
-dqfma0012 fma 1 -1 2 -> 1
-dqfma0013 fma 2 -2 3 -> -1
-dqfma0014 fma 9 -9 9 -> -72
-dqfma0015 fma 1 1 -1 -> 0
-dqfma0016 fma 1 1 -2 -> -1
-dqfma0017 fma 2 2 -3 -> 1
-dqfma0018 fma 9 9 -9 -> 72
-
--- non-integer exacts
-dqfma0100 fma 25.2 63.6 -438 -> 1164.72
-dqfma0101 fma 0.301 0.380 334 -> 334.114380
-dqfma0102 fma 49.2 -4.8 23.3 -> -212.86
-dqfma0103 fma 4.22 0.079 -94.6 -> -94.26662
-dqfma0104 fma 903 0.797 0.887 -> 720.578
-dqfma0105 fma 6.13 -161 65.9 -> -921.03
-dqfma0106 fma 28.2 727 5.45 -> 20506.85
-dqfma0107 fma 4 605 688 -> 3108
-dqfma0108 fma 93.3 0.19 0.226 -> 17.953
-dqfma0109 fma 0.169 -341 5.61 -> -52.019
-dqfma0110 fma -72.2 30 -51.2 -> -2217.2
-dqfma0111 fma -0.409 13 20.4 -> 15.083
-dqfma0112 fma 317 77.0 19.0 -> 24428.0
-dqfma0113 fma 47 6.58 1.62 -> 310.88
-dqfma0114 fma 1.36 0.984 0.493 -> 1.83124
-dqfma0115 fma 72.7 274 1.56 -> 19921.36
-dqfma0116 fma 335 847 83 -> 283828
-dqfma0117 fma 666 0.247 25.4 -> 189.902
-dqfma0118 fma -3.87 3.06 78.0 -> 66.1578
-dqfma0119 fma 0.742 192 35.6 -> 178.064
-dqfma0120 fma -91.6 5.29 0.153 -> -484.411
-
--- cases where result is different from separate multiply + add; each
--- is preceded by the result of unfused multiply and add
--- [this is about 20% of all similar cases in general]
--- -> 4.500119002100000209469729375698778E+38
-dqfma0202 fma 68537985861355864457.5694 6565875762972086605.85969 35892634447236753.172812 -> 4.500119002100000209469729375698779E+38 Inexact Rounded
--- -> 5.996248469584594346858881620185514E+41
-dqfma0208 fma 89261822344727628571.9 6717595845654131383336.89 5061036497288796076266.11 -> 5.996248469584594346858881620185513E+41 Inexact Rounded
--- -> 1.899242968678256924021594770874070E+34
-dqfma0210 fma 320506237232448685.495971 59257597764017967.984448 3205615239077711589912.85 -> 1.899242968678256924021594770874071E+34 Inexact Rounded
--- -> 7.078596978842809537929699954860309E+37
-dqfma0215 fma 220247843259112263.17995 321392340287987979002.80 47533279819997167655440 -> 7.078596978842809537929699954860308E+37 Inexact Rounded
--- -> 1.224955667581427559754106862350743E+37
-dqfma0226 fma 23880729790368880412.1449 512947333827064719.55407 217117438419590824502.963 -> 1.224955667581427559754106862350744E+37 Inexact Rounded
--- -> -2.530094043253148806272276368579144E+42
-dqfma0229 fma 2539892357016099706.4126 -996142232667504817717435 53682082598315949425.937 -> -2.530094043253148806272276368579143E+42 Inexact Rounded
--- -> 1.713387085759711954319391412788454E+37
-dqfma0233 fma 4546339491341624464.0804 3768717864169205581 83578980278690395184.620 -> 1.713387085759711954319391412788453E+37 Inexact Rounded
--- -> 4.062275663405823716411579117771547E+35
-dqfma0235 fma 409242119433816131.42253 992633815166741501.477249 70179636544416756129546 -> 4.062275663405823716411579117771548E+35 Inexact Rounded
--- -> 6.002604327732568490562249875306823E+47
-dqfma0258 fma 817941336593541742159684 733867339769310729266598 78563844650942419311830.8 -> 6.002604327732568490562249875306822E+47 Inexact Rounded
--- -> -2.027022514381452197510103395283874E+39
-dqfma0264 fma 387617310169161270.737532 -5229442703414956061216.62 57665666816652967150473.5 -> -2.027022514381452197510103395283873E+39 Inexact Rounded
--- -> -7.856525039803554001144089842730361E+37
-dqfma0267 fma -847655845720565274701.210 92685316564117739.83984 22780950041376424429.5686 -> -7.856525039803554001144089842730360E+37 Inexact Rounded
--- -> 1.695515562011520746125607502237559E+38
-dqfma0268 fma 21590290365127685.3675 7853139227576541379426.8 -3275859437236180.761544 -> 1.695515562011520746125607502237558E+38 Inexact Rounded
--- -> -8.448422935783289219748115038014710E+38
-dqfma0269 fma -974320636272862697.971586 867109103641860247440.756 -9775170775902454762.98 -> -8.448422935783289219748115038014709E+38 Inexact Rounded
-
--- Cases where multiply would overflow or underflow if separate
-dqfma0300 fma 9e+6144 10 0 -> Infinity Overflow Inexact Rounded
-dqfma0301 fma 1e+6144 10 0 -> Infinity Overflow Inexact Rounded
-dqfma0302 fma 1e+6144 10 -1e+6144 -> 9.000000000000000000000000000000000E+6144 Clamped
-dqfma0303 fma 1e+6144 10 -9e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped
--- subnormal etc.
-dqfma0305 fma 1e-6176 0.1 0 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma0306 fma 1e-6176 0.1 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqfma0307 fma 1e-6176 0.1 1e-6176 -> 1E-6176 Underflow Subnormal Inexact Rounded
-
--- Infinite combinations
-dqfma0800 fma Inf Inf Inf -> Infinity
-dqfma0801 fma Inf Inf -Inf -> NaN Invalid_operation
-dqfma0802 fma Inf -Inf Inf -> NaN Invalid_operation
-dqfma0803 fma Inf -Inf -Inf -> -Infinity
-dqfma0804 fma -Inf Inf Inf -> NaN Invalid_operation
-dqfma0805 fma -Inf Inf -Inf -> -Infinity
-dqfma0806 fma -Inf -Inf Inf -> Infinity
-dqfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
-
--- Triple NaN propagation
-dqfma0900 fma NaN2 NaN3 NaN5 -> NaN2
-dqfma0901 fma 0 NaN3 NaN5 -> NaN3
-dqfma0902 fma 0 0 NaN5 -> NaN5
--- first sNaN wins (consider qNaN from earlier sNaN being
--- overridden by an sNaN in third operand)
-dqfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-dqfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
-dqfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
-dqfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-dqfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
-dqfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
-
--- MULTIPLICATION TESTS ------------------------------------------------
-rounding: half_even
-
--- sanity checks
-dqfma2000 fma 2 2 0e+6144 -> 4
-dqfma2001 fma 2 3 0e+6144 -> 6
-dqfma2002 fma 5 1 0e+6144 -> 5
-dqfma2003 fma 5 2 0e+6144 -> 10
-dqfma2004 fma 1.20 2 0e+6144 -> 2.40
-dqfma2005 fma 1.20 0 0e+6144 -> 0.00
-dqfma2006 fma 1.20 -2 0e+6144 -> -2.40
-dqfma2007 fma -1.20 2 0e+6144 -> -2.40
-dqfma2008 fma -1.20 0 0e+6144 -> 0.00
-dqfma2009 fma -1.20 -2 0e+6144 -> 2.40
-dqfma2010 fma 5.09 7.1 0e+6144 -> 36.139
-dqfma2011 fma 2.5 4 0e+6144 -> 10.0
-dqfma2012 fma 2.50 4 0e+6144 -> 10.00
-dqfma2013 fma 1.23456789 1.0000000000000000000000000000 0e+6144 -> 1.234567890000000000000000000000000 Rounded
-dqfma2015 fma 2.50 4 0e+6144 -> 10.00
-dqfma2016 fma 9.99999999999999999 9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded
-dqfma2017 fma 9.99999999999999999 -9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded
-dqfma2018 fma -9.99999999999999999 9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded
-dqfma2019 fma -9.99999999999999999 -9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded
-
--- zeros, etc.
-dqfma2021 fma 0 0 0e+6144 -> 0
-dqfma2022 fma 0 -0 0e+6144 -> 0
-dqfma2023 fma -0 0 0e+6144 -> 0
-dqfma2024 fma -0 -0 0e+6144 -> 0
-dqfma2025 fma -0.0 -0.0 0e+6144 -> 0.00
-dqfma2026 fma -0.0 -0.0 0e+6144 -> 0.00
-dqfma2027 fma -0.0 -0.0 0e+6144 -> 0.00
-dqfma2028 fma -0.0 -0.0 0e+6144 -> 0.00
-dqfma2030 fma 5.00 1E-3 0e+6144 -> 0.00500
-dqfma2031 fma 00.00 0.000 0e+6144 -> 0.00000
-dqfma2032 fma 00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0
-dqfma2033 fma 0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0
-dqfma2034 fma -5.00 1E-3 0e+6144 -> -0.00500
-dqfma2035 fma -00.00 0.000 0e+6144 -> 0.00000
-dqfma2036 fma -00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0
-dqfma2037 fma -0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0
-dqfma2038 fma 5.00 -1E-3 0e+6144 -> -0.00500
-dqfma2039 fma 00.00 -0.000 0e+6144 -> 0.00000
-dqfma2040 fma 00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0
-dqfma2041 fma 0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0
-dqfma2042 fma -5.00 -1E-3 0e+6144 -> 0.00500
-dqfma2043 fma -00.00 -0.000 0e+6144 -> 0.00000
-dqfma2044 fma -00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0
-dqfma2045 fma -0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0
-
--- examples from decarith
-dqfma2050 fma 1.20 3 0e+6144 -> 3.60
-dqfma2051 fma 7 3 0e+6144 -> 21
-dqfma2052 fma 0.9 0.8 0e+6144 -> 0.72
-dqfma2053 fma 0.9 -0 0e+6144 -> 0.0
-dqfma2054 fma 654321 654321 0e+6144 -> 428135971041
-
-dqfma2060 fma 123.45 1e7 0e+6144 -> 1.2345E+9
-dqfma2061 fma 123.45 1e8 0e+6144 -> 1.2345E+10
-dqfma2062 fma 123.45 1e+9 0e+6144 -> 1.2345E+11
-dqfma2063 fma 123.45 1e10 0e+6144 -> 1.2345E+12
-dqfma2064 fma 123.45 1e11 0e+6144 -> 1.2345E+13
-dqfma2065 fma 123.45 1e12 0e+6144 -> 1.2345E+14
-dqfma2066 fma 123.45 1e13 0e+6144 -> 1.2345E+15
-
-
--- test some intermediate lengths
--- 1234567890123456
-dqfma2080 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9
-dqfma2084 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9
-dqfma2090 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9
-dqfma2094 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9
-
--- test some more edge cases and carries
-dqfma2101 fma 9 9 0e+6144 -> 81
-dqfma2102 fma 9 90 0e+6144 -> 810
-dqfma2103 fma 9 900 0e+6144 -> 8100
-dqfma2104 fma 9 9000 0e+6144 -> 81000
-dqfma2105 fma 9 90000 0e+6144 -> 810000
-dqfma2106 fma 9 900000 0e+6144 -> 8100000
-dqfma2107 fma 9 9000000 0e+6144 -> 81000000
-dqfma2108 fma 9 90000000 0e+6144 -> 810000000
-dqfma2109 fma 9 900000000 0e+6144 -> 8100000000
-dqfma2110 fma 9 9000000000 0e+6144 -> 81000000000
-dqfma2111 fma 9 90000000000 0e+6144 -> 810000000000
-dqfma2112 fma 9 900000000000 0e+6144 -> 8100000000000
-dqfma2113 fma 9 9000000000000 0e+6144 -> 81000000000000
-dqfma2114 fma 9 90000000000000 0e+6144 -> 810000000000000
-dqfma2115 fma 9 900000000000000 0e+6144 -> 8100000000000000
---dqfma2116 fma 9 9000000000000000 0e+6144 -> 81000000000000000
---dqfma2117 fma 9 90000000000000000 0e+6144 -> 810000000000000000
---dqfma2118 fma 9 900000000000000000 0e+6144 -> 8100000000000000000
---dqfma2119 fma 9 9000000000000000000 0e+6144 -> 81000000000000000000
---dqfma2120 fma 9 90000000000000000000 0e+6144 -> 810000000000000000000
---dqfma2121 fma 9 900000000000000000000 0e+6144 -> 8100000000000000000000
---dqfma2122 fma 9 9000000000000000000000 0e+6144 -> 81000000000000000000000
---dqfma2123 fma 9 90000000000000000000000 0e+6144 -> 810000000000000000000000
--- test some more edge cases without carries
-dqfma2131 fma 3 3 0e+6144 -> 9
-dqfma2132 fma 3 30 0e+6144 -> 90
-dqfma2133 fma 3 300 0e+6144 -> 900
-dqfma2134 fma 3 3000 0e+6144 -> 9000
-dqfma2135 fma 3 30000 0e+6144 -> 90000
-dqfma2136 fma 3 300000 0e+6144 -> 900000
-dqfma2137 fma 3 3000000 0e+6144 -> 9000000
-dqfma2138 fma 3 30000000 0e+6144 -> 90000000
-dqfma2139 fma 3 300000000 0e+6144 -> 900000000
-dqfma2140 fma 3 3000000000 0e+6144 -> 9000000000
-dqfma2141 fma 3 30000000000 0e+6144 -> 90000000000
-dqfma2142 fma 3 300000000000 0e+6144 -> 900000000000
-dqfma2143 fma 3 3000000000000 0e+6144 -> 9000000000000
-dqfma2144 fma 3 30000000000000 0e+6144 -> 90000000000000
-dqfma2145 fma 3 300000000000000 0e+6144 -> 900000000000000
-dqfma2146 fma 3 3000000000000000 0e+6144 -> 9000000000000000
-dqfma2147 fma 3 30000000000000000 0e+6144 -> 90000000000000000
-dqfma2148 fma 3 300000000000000000 0e+6144 -> 900000000000000000
-dqfma2149 fma 3 3000000000000000000 0e+6144 -> 9000000000000000000
-dqfma2150 fma 3 30000000000000000000 0e+6144 -> 90000000000000000000
-dqfma2151 fma 3 300000000000000000000 0e+6144 -> 900000000000000000000
-dqfma2152 fma 3 3000000000000000000000 0e+6144 -> 9000000000000000000000
-dqfma2153 fma 3 30000000000000000000000 0e+6144 -> 90000000000000000000000
-
-dqfma2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0e+6144 -> 145433.2908011933696719165119928296 Inexact Rounded
-
--- test some edge cases with exact rounding
-dqfma2301 fma 900000000000000000 9 0e+6144 -> 8100000000000000000
-dqfma2302 fma 900000000000000000 90 0e+6144 -> 81000000000000000000
-dqfma2303 fma 900000000000000000 900 0e+6144 -> 810000000000000000000
-dqfma2304 fma 900000000000000000 9000 0e+6144 -> 8100000000000000000000
-dqfma2305 fma 900000000000000000 90000 0e+6144 -> 81000000000000000000000
-dqfma2306 fma 900000000000000000 900000 0e+6144 -> 810000000000000000000000
-dqfma2307 fma 900000000000000000 9000000 0e+6144 -> 8100000000000000000000000
-dqfma2308 fma 900000000000000000 90000000 0e+6144 -> 81000000000000000000000000
-dqfma2309 fma 900000000000000000 900000000 0e+6144 -> 810000000000000000000000000
-dqfma2310 fma 900000000000000000 9000000000 0e+6144 -> 8100000000000000000000000000
-dqfma2311 fma 900000000000000000 90000000000 0e+6144 -> 81000000000000000000000000000
-dqfma2312 fma 900000000000000000 900000000000 0e+6144 -> 810000000000000000000000000000
-dqfma2313 fma 900000000000000000 9000000000000 0e+6144 -> 8100000000000000000000000000000
-dqfma2314 fma 900000000000000000 90000000000000 0e+6144 -> 81000000000000000000000000000000
-dqfma2315 fma 900000000000000000 900000000000000 0e+6144 -> 810000000000000000000000000000000
-dqfma2316 fma 900000000000000000 9000000000000000 0e+6144 -> 8100000000000000000000000000000000
-dqfma2317 fma 9000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+34 Rounded
-dqfma2318 fma 90000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+35 Rounded
-dqfma2319 fma 900000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+36 Rounded
-dqfma2320 fma 9000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+37 Rounded
-dqfma2321 fma 90000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+38 Rounded
-dqfma2322 fma 900000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+39 Rounded
-dqfma2323 fma 9000000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+40 Rounded
-
--- tryzeros cases
-dqfma2504 fma 0E-4260 1000E-4260 0e+6144 -> 0E-6176 Clamped
-dqfma2505 fma 100E+4260 0E+4260 0e+6144 -> 0E+6111 Clamped
-
--- mixed with zeros
-dqfma2541 fma 0 -1 0e+6144 -> 0
-dqfma2542 fma -0 -1 0e+6144 -> 0
-dqfma2543 fma 0 1 0e+6144 -> 0
-dqfma2544 fma -0 1 0e+6144 -> 0
-dqfma2545 fma -1 0 0e+6144 -> 0
-dqfma2546 fma -1 -0 0e+6144 -> 0
-dqfma2547 fma 1 0 0e+6144 -> 0
-dqfma2548 fma 1 -0 0e+6144 -> 0
-
-dqfma2551 fma 0.0 -1 0e+6144 -> 0.0
-dqfma2552 fma -0.0 -1 0e+6144 -> 0.0
-dqfma2553 fma 0.0 1 0e+6144 -> 0.0
-dqfma2554 fma -0.0 1 0e+6144 -> 0.0
-dqfma2555 fma -1.0 0 0e+6144 -> 0.0
-dqfma2556 fma -1.0 -0 0e+6144 -> 0.0
-dqfma2557 fma 1.0 0 0e+6144 -> 0.0
-dqfma2558 fma 1.0 -0 0e+6144 -> 0.0
-
-dqfma2561 fma 0 -1.0 0e+6144 -> 0.0
-dqfma2562 fma -0 -1.0 0e+6144 -> 0.0
-dqfma2563 fma 0 1.0 0e+6144 -> 0.0
-dqfma2564 fma -0 1.0 0e+6144 -> 0.0
-dqfma2565 fma -1 0.0 0e+6144 -> 0.0
-dqfma2566 fma -1 -0.0 0e+6144 -> 0.0
-dqfma2567 fma 1 0.0 0e+6144 -> 0.0
-dqfma2568 fma 1 -0.0 0e+6144 -> 0.0
-
-dqfma2571 fma 0.0 -1.0 0e+6144 -> 0.00
-dqfma2572 fma -0.0 -1.0 0e+6144 -> 0.00
-dqfma2573 fma 0.0 1.0 0e+6144 -> 0.00
-dqfma2574 fma -0.0 1.0 0e+6144 -> 0.00
-dqfma2575 fma -1.0 0.0 0e+6144 -> 0.00
-dqfma2576 fma -1.0 -0.0 0e+6144 -> 0.00
-dqfma2577 fma 1.0 0.0 0e+6144 -> 0.00
-dqfma2578 fma 1.0 -0.0 0e+6144 -> 0.00
-dqfma2579 fma 1.0 0.0 0e+6144 -> 0.00
-dqfma2530 fma -1.0 -0.0 0e+6144 -> 0.00
-dqfma2531 fma -1.0 0.0 0e+6144 -> 0.00
-dqfma2532 fma 1.0 -0.0 -0e+6144 -> -0.00
-dqfma2533 fma 1.0 0.0 -0e+6144 -> 0.00
-dqfma2534 fma -1.0 -0.0 -0e+6144 -> 0.00
-dqfma2535 fma -1.0 0.0 -0e+6144 -> -0.00
-
-
--- Specials
-dqfma2580 fma Inf -Inf 0e+6144 -> -Infinity
-dqfma2581 fma Inf -1000 0e+6144 -> -Infinity
-dqfma2582 fma Inf -1 0e+6144 -> -Infinity
-dqfma2583 fma Inf -0 0e+6144 -> NaN Invalid_operation
-dqfma2584 fma Inf 0 0e+6144 -> NaN Invalid_operation
-dqfma2585 fma Inf 1 0e+6144 -> Infinity
-dqfma2586 fma Inf 1000 0e+6144 -> Infinity
-dqfma2587 fma Inf Inf 0e+6144 -> Infinity
-dqfma2588 fma -1000 Inf 0e+6144 -> -Infinity
-dqfma2589 fma -Inf Inf 0e+6144 -> -Infinity
-dqfma2590 fma -1 Inf 0e+6144 -> -Infinity
-dqfma2591 fma -0 Inf 0e+6144 -> NaN Invalid_operation
-dqfma2592 fma 0 Inf 0e+6144 -> NaN Invalid_operation
-dqfma2593 fma 1 Inf 0e+6144 -> Infinity
-dqfma2594 fma 1000 Inf 0e+6144 -> Infinity
-dqfma2595 fma Inf Inf 0e+6144 -> Infinity
-
-dqfma2600 fma -Inf -Inf 0e+6144 -> Infinity
-dqfma2601 fma -Inf -1000 0e+6144 -> Infinity
-dqfma2602 fma -Inf -1 0e+6144 -> Infinity
-dqfma2603 fma -Inf -0 0e+6144 -> NaN Invalid_operation
-dqfma2604 fma -Inf 0 0e+6144 -> NaN Invalid_operation
-dqfma2605 fma -Inf 1 0e+6144 -> -Infinity
-dqfma2606 fma -Inf 1000 0e+6144 -> -Infinity
-dqfma2607 fma -Inf Inf 0e+6144 -> -Infinity
-dqfma2608 fma -1000 Inf 0e+6144 -> -Infinity
-dqfma2609 fma -Inf -Inf 0e+6144 -> Infinity
-dqfma2610 fma -1 -Inf 0e+6144 -> Infinity
-dqfma2611 fma -0 -Inf 0e+6144 -> NaN Invalid_operation
-dqfma2612 fma 0 -Inf 0e+6144 -> NaN Invalid_operation
-dqfma2613 fma 1 -Inf 0e+6144 -> -Infinity
-dqfma2614 fma 1000 -Inf 0e+6144 -> -Infinity
-dqfma2615 fma Inf -Inf 0e+6144 -> -Infinity
-
-dqfma2621 fma NaN -Inf 0e+6144 -> NaN
-dqfma2622 fma NaN -1000 0e+6144 -> NaN
-dqfma2623 fma NaN -1 0e+6144 -> NaN
-dqfma2624 fma NaN -0 0e+6144 -> NaN
-dqfma2625 fma NaN 0 0e+6144 -> NaN
-dqfma2626 fma NaN 1 0e+6144 -> NaN
-dqfma2627 fma NaN 1000 0e+6144 -> NaN
-dqfma2628 fma NaN Inf 0e+6144 -> NaN
-dqfma2629 fma NaN NaN 0e+6144 -> NaN
-dqfma2630 fma -Inf NaN 0e+6144 -> NaN
-dqfma2631 fma -1000 NaN 0e+6144 -> NaN
-dqfma2632 fma -1 NaN 0e+6144 -> NaN
-dqfma2633 fma -0 NaN 0e+6144 -> NaN
-dqfma2634 fma 0 NaN 0e+6144 -> NaN
-dqfma2635 fma 1 NaN 0e+6144 -> NaN
-dqfma2636 fma 1000 NaN 0e+6144 -> NaN
-dqfma2637 fma Inf NaN 0e+6144 -> NaN
-
-dqfma2641 fma sNaN -Inf 0e+6144 -> NaN Invalid_operation
-dqfma2642 fma sNaN -1000 0e+6144 -> NaN Invalid_operation
-dqfma2643 fma sNaN -1 0e+6144 -> NaN Invalid_operation
-dqfma2644 fma sNaN -0 0e+6144 -> NaN Invalid_operation
-dqfma2645 fma sNaN 0 0e+6144 -> NaN Invalid_operation
-dqfma2646 fma sNaN 1 0e+6144 -> NaN Invalid_operation
-dqfma2647 fma sNaN 1000 0e+6144 -> NaN Invalid_operation
-dqfma2648 fma sNaN NaN 0e+6144 -> NaN Invalid_operation
-dqfma2649 fma sNaN sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2650 fma NaN sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2651 fma -Inf sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2652 fma -1000 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2653 fma -1 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2654 fma -0 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2655 fma 0 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2656 fma 1 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2657 fma 1000 sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2658 fma Inf sNaN 0e+6144 -> NaN Invalid_operation
-dqfma2659 fma NaN sNaN 0e+6144 -> NaN Invalid_operation
-
--- propagating NaNs
-dqfma2661 fma NaN9 -Inf 0e+6144 -> NaN9
-dqfma2662 fma NaN8 999 0e+6144 -> NaN8
-dqfma2663 fma NaN71 Inf 0e+6144 -> NaN71
-dqfma2664 fma NaN6 NaN5 0e+6144 -> NaN6
-dqfma2665 fma -Inf NaN4 0e+6144 -> NaN4
-dqfma2666 fma -999 NaN33 0e+6144 -> NaN33
-dqfma2667 fma Inf NaN2 0e+6144 -> NaN2
-
-dqfma2671 fma sNaN99 -Inf 0e+6144 -> NaN99 Invalid_operation
-dqfma2672 fma sNaN98 -11 0e+6144 -> NaN98 Invalid_operation
-dqfma2673 fma sNaN97 NaN 0e+6144 -> NaN97 Invalid_operation
-dqfma2674 fma sNaN16 sNaN94 0e+6144 -> NaN16 Invalid_operation
-dqfma2675 fma NaN95 sNaN93 0e+6144 -> NaN93 Invalid_operation
-dqfma2676 fma -Inf sNaN92 0e+6144 -> NaN92 Invalid_operation
-dqfma2677 fma 088 sNaN91 0e+6144 -> NaN91 Invalid_operation
-dqfma2678 fma Inf sNaN90 0e+6144 -> NaN90 Invalid_operation
-dqfma2679 fma NaN sNaN89 0e+6144 -> NaN89 Invalid_operation
-
-dqfma2681 fma -NaN9 -Inf 0e+6144 -> -NaN9
-dqfma2682 fma -NaN8 999 0e+6144 -> -NaN8
-dqfma2683 fma -NaN71 Inf 0e+6144 -> -NaN71
-dqfma2684 fma -NaN6 -NaN5 0e+6144 -> -NaN6
-dqfma2685 fma -Inf -NaN4 0e+6144 -> -NaN4
-dqfma2686 fma -999 -NaN33 0e+6144 -> -NaN33
-dqfma2687 fma Inf -NaN2 0e+6144 -> -NaN2
-
-dqfma2691 fma -sNaN99 -Inf 0e+6144 -> -NaN99 Invalid_operation
-dqfma2692 fma -sNaN98 -11 0e+6144 -> -NaN98 Invalid_operation
-dqfma2693 fma -sNaN97 NaN 0e+6144 -> -NaN97 Invalid_operation
-dqfma2694 fma -sNaN16 -sNaN94 0e+6144 -> -NaN16 Invalid_operation
-dqfma2695 fma -NaN95 -sNaN93 0e+6144 -> -NaN93 Invalid_operation
-dqfma2696 fma -Inf -sNaN92 0e+6144 -> -NaN92 Invalid_operation
-dqfma2697 fma 088 -sNaN91 0e+6144 -> -NaN91 Invalid_operation
-dqfma2698 fma Inf -sNaN90 0e+6144 -> -NaN90 Invalid_operation
-dqfma2699 fma -NaN -sNaN89 0e+6144 -> -NaN89 Invalid_operation
-
-dqfma2701 fma -NaN -Inf 0e+6144 -> -NaN
-dqfma2702 fma -NaN 999 0e+6144 -> -NaN
-dqfma2703 fma -NaN Inf 0e+6144 -> -NaN
-dqfma2704 fma -NaN -NaN 0e+6144 -> -NaN
-dqfma2705 fma -Inf -NaN0 0e+6144 -> -NaN
-dqfma2706 fma -999 -NaN 0e+6144 -> -NaN
-dqfma2707 fma Inf -NaN 0e+6144 -> -NaN
-
-dqfma2711 fma -sNaN -Inf 0e+6144 -> -NaN Invalid_operation
-dqfma2712 fma -sNaN -11 0e+6144 -> -NaN Invalid_operation
-dqfma2713 fma -sNaN00 NaN 0e+6144 -> -NaN Invalid_operation
-dqfma2714 fma -sNaN -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2715 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2716 fma -Inf -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2717 fma 088 -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2718 fma Inf -sNaN 0e+6144 -> -NaN Invalid_operation
-dqfma2719 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
--- signs
-dqfma2751 fma 1e+4277 1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2752 fma 1e+4277 -1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded
-dqfma2753 fma -1e+4277 1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded
-dqfma2754 fma -1e+4277 -1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2755 fma 1e-4277 1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2756 fma 1e-4277 -1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2757 fma -1e-4277 1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2758 fma -1e-4277 -1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dqfma2760 fma 1e-6069 1e-101 0e+6144 -> 1E-6170 Subnormal
-dqfma2761 fma 1e-6069 1e-102 0e+6144 -> 1E-6171 Subnormal
-dqfma2762 fma 1e-6069 1e-103 0e+6144 -> 1E-6172 Subnormal
-dqfma2763 fma 1e-6069 1e-104 0e+6144 -> 1E-6173 Subnormal
-dqfma2764 fma 1e-6069 1e-105 0e+6144 -> 1E-6174 Subnormal
-dqfma2765 fma 1e-6069 1e-106 0e+6144 -> 1E-6175 Subnormal
-dqfma2766 fma 1e-6069 1e-107 0e+6144 -> 1E-6176 Subnormal
-dqfma2767 fma 1e-6069 1e-108 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2768 fma 1e-6069 1e-109 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2769 fma 1e-6069 1e-110 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-dqfma2770 fma 1e+40 1e+6101 0e+6144 -> 1.000000000000000000000000000000E+6141 Clamped
-dqfma2771 fma 1e+40 1e+6102 0e+6144 -> 1.0000000000000000000000000000000E+6142 Clamped
-dqfma2772 fma 1e+40 1e+6103 0e+6144 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqfma2773 fma 1e+40 1e+6104 0e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped
-dqfma2774 fma 1e+40 1e+6105 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2775 fma 1e+40 1e+6106 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2776 fma 1e+40 1e+6107 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2777 fma 1e+40 1e+6108 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2778 fma 1e+40 1e+6109 0e+6144 -> Infinity Overflow Inexact Rounded
-dqfma2779 fma 1e+40 1e+6110 0e+6144 -> Infinity Overflow Inexact Rounded
-
-dqfma2801 fma 1.0000E-6172 1 0e+6144 -> 1.0000E-6172 Subnormal
-dqfma2802 fma 1.000E-6172 1e-1 0e+6144 -> 1.000E-6173 Subnormal
-dqfma2803 fma 1.00E-6172 1e-2 0e+6144 -> 1.00E-6174 Subnormal
-dqfma2804 fma 1.0E-6172 1e-3 0e+6144 -> 1.0E-6175 Subnormal
-dqfma2805 fma 1.0E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal Rounded
-dqfma2806 fma 1.3E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2807 fma 1.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2808 fma 1.7E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2809 fma 2.3E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2810 fma 2.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2811 fma 2.7E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqfma2812 fma 1.49E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2813 fma 1.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2814 fma 1.51E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2815 fma 2.49E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2816 fma 2.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqfma2817 fma 2.51E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded
-
-dqfma2818 fma 1E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal
-dqfma2819 fma 3E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2820 fma 5E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2821 fma 7E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2822 fma 9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2823 fma 9.9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
-
-dqfma2824 fma 1E-6172 -1e-4 0e+6144 -> -1E-6176 Subnormal
-dqfma2825 fma 3E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2826 fma -5E-6172 1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2827 fma 7E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2828 fma -9E-6172 1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2829 fma 9.9E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqfma2830 fma 3.0E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqfma2831 fma 1.0E-5977 1e-200 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqfma2832 fma 1.0E-5977 1e-199 0e+6144 -> 1E-6176 Subnormal Rounded
-dqfma2833 fma 1.0E-5977 1e-198 0e+6144 -> 1.0E-6175 Subnormal
-dqfma2834 fma 2.0E-5977 2e-198 0e+6144 -> 4.0E-6175 Subnormal
-dqfma2835 fma 4.0E-5977 4e-198 0e+6144 -> 1.60E-6174 Subnormal
-dqfma2836 fma 10.0E-5977 10e-198 0e+6144 -> 1.000E-6173 Subnormal
-dqfma2837 fma 30.0E-5977 30e-198 0e+6144 -> 9.000E-6173 Subnormal
-dqfma2838 fma 40.0E-5982 40e-166 0e+6144 -> 1.6000E-6145 Subnormal
-dqfma2839 fma 40.0E-5982 40e-165 0e+6144 -> 1.6000E-6144 Subnormal
-dqfma2840 fma 40.0E-5982 40e-164 0e+6144 -> 1.6000E-6143
-
--- Long operand overflow may be a different path
-dqfma2870 fma 100 9.999E+6143 0e+6144 -> Infinity Inexact Overflow Rounded
-dqfma2871 fma 100 -9.999E+6143 0e+6144 -> -Infinity Inexact Overflow Rounded
-dqfma2872 fma 9.999E+6143 100 0e+6144 -> Infinity Inexact Overflow Rounded
-dqfma2873 fma -9.999E+6143 100 0e+6144 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-dqfma2881 fma 1.2347E-6133 1.2347E-40 0e+6144 -> 1.524E-6173 Inexact Rounded Subnormal Underflow
-dqfma2882 fma 1.234E-6133 1.234E-40 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqfma2883 fma 1.23E-6133 1.23E-40 0e+6144 -> 1.513E-6173 Inexact Rounded Subnormal Underflow
-dqfma2884 fma 1.2E-6133 1.2E-40 0e+6144 -> 1.44E-6173 Subnormal
-dqfma2885 fma 1.2E-6133 1.2E-41 0e+6144 -> 1.44E-6174 Subnormal
-dqfma2886 fma 1.2E-6133 1.2E-42 0e+6144 -> 1.4E-6175 Subnormal Inexact Rounded Underflow
-dqfma2887 fma 1.2E-6133 1.3E-42 0e+6144 -> 1.6E-6175 Subnormal Inexact Rounded Underflow
-dqfma2888 fma 1.3E-6133 1.3E-42 0e+6144 -> 1.7E-6175 Subnormal Inexact Rounded Underflow
-dqfma2889 fma 1.3E-6133 1.3E-43 0e+6144 -> 2E-6176 Subnormal Inexact Rounded Underflow
-dqfma2890 fma 1.3E-6134 1.3E-43 0e+6144 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow
-
-dqfma2891 fma 1.2345E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
-dqfma2892 fma 1.23456E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
-dqfma2893 fma 1.2345E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqfma2894 fma 1.23456E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqfma2895 fma 1.2345E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
-dqfma2896 fma 1.23456E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
--- prove operands are exact
-dqfma2906 fma 9.999999999999999999999999999999999E-6143 1 0e+6144 -> 9.999999999999999999999999999999999E-6143
-dqfma2907 fma 1 0.09999999999999999999999999999999999 0e+6144 -> 0.09999999999999999999999999999999999
--- the next rounds to Nmin
-dqfma2908 fma 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 0e+6144 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded
-
--- hugest
-dqfma2909 fma 9999999999999999999999999999999999 9999999999999999999999999999999999 0e+6144 -> 9.999999999999999999999999999999998E+67 Inexact Rounded
-
--- Examples from SQL proposal (Krishna Kulkarni)
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
-dqfma21001 fma 130E-2 120E-2 0e+6144 -> 1.5600
-dqfma21002 fma 130E-2 12E-1 0e+6144 -> 1.560
-dqfma21003 fma 130E-2 1E0 0e+6144 -> 1.30
-dqfma21004 fma 1E2 1E4 0e+6144 -> 1E+6
-
--- Null tests
-dqfma2990 fma 10 # 0e+6144 -> NaN Invalid_operation
-dqfma2991 fma # 10 0e+6144 -> NaN Invalid_operation
-
-
--- ADDITION TESTS ------------------------------------------------------
-rounding: half_even
-
--- [first group are 'quick confidence check']
-dqadd3001 fma 1 1 1 -> 2
-dqadd3002 fma 1 2 3 -> 5
-dqadd3003 fma 1 '5.75' '3.3' -> 9.05
-dqadd3004 fma 1 '5' '-3' -> 2
-dqadd3005 fma 1 '-5' '-3' -> -8
-dqadd3006 fma 1 '-7' '2.5' -> -4.5
-dqadd3007 fma 1 '0.7' '0.3' -> 1.0
-dqadd3008 fma 1 '1.25' '1.25' -> 2.50
-dqadd3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
-dqadd3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
-
--- 1234567890123456 1234567890123456
-dqadd3011 fma 1 '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqadd3012 fma 1 '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded
-dqadd3013 fma 1 '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
-dqadd3014 fma 1 '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd3015 fma 1 '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd3016 fma 1 '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd3017 fma 1 '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded
-dqadd3018 fma 1 '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded
-dqadd3019 fma 1 '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded
-dqadd3020 fma 1 '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded
-
-dqadd3021 fma 1 0 1 -> 1
-dqadd3022 fma 1 1 1 -> 2
-dqadd3023 fma 1 2 1 -> 3
-dqadd3024 fma 1 3 1 -> 4
-dqadd3025 fma 1 4 1 -> 5
-dqadd3026 fma 1 5 1 -> 6
-dqadd3027 fma 1 6 1 -> 7
-dqadd3028 fma 1 7 1 -> 8
-dqadd3029 fma 1 8 1 -> 9
-dqadd3030 fma 1 9 1 -> 10
-
--- some carrying effects
-dqadd3031 fma 1 '0.9998' '0.0000' -> '0.9998'
-dqadd3032 fma 1 '0.9998' '0.0001' -> '0.9999'
-dqadd3033 fma 1 '0.9998' '0.0002' -> '1.0000'
-dqadd3034 fma 1 '0.9998' '0.0003' -> '1.0001'
-
-dqadd3035 fma 1 '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3036 fma 1 '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3037 fma 1 '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3038 fma 1 '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
-dqadd3039 fma 1 '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded
-
--- symmetry:
-dqadd3040 fma 1 '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3041 fma 1 '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3042 fma 1 '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqadd3044 fma 1 '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
-dqadd3045 fma 1 '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded
-
--- same, without rounding
-dqadd3046 fma 1 '10000e+9' '7' -> '10000000000007'
-dqadd3047 fma 1 '10000e+9' '70' -> '10000000000070'
-dqadd3048 fma 1 '10000e+9' '700' -> '10000000000700'
-dqadd3049 fma 1 '10000e+9' '7000' -> '10000000007000'
-dqadd3050 fma 1 '10000e+9' '70000' -> '10000000070000'
-dqadd3051 fma 1 '10000e+9' '700000' -> '10000000700000'
-dqadd3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-dqadd3053 fma 1 '12' '7.00' -> '19.00'
-dqadd3054 fma 1 '1.3' '-1.07' -> '0.23'
-dqadd3055 fma 1 '1.3' '-1.30' -> '0.00'
-dqadd3056 fma 1 '1.3' '-2.07' -> '-0.77'
-dqadd3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
-
--- leading zero preservation
-dqadd3061 fma 1 1 '0.0001' -> '1.0001'
-dqadd3062 fma 1 1 '0.00001' -> '1.00001'
-dqadd3063 fma 1 1 '0.000001' -> '1.000001'
-dqadd3064 fma 1 1 '0.0000001' -> '1.0000001'
-dqadd3065 fma 1 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-dqadd3070 fma 1 1 0 -> 1
-dqadd3071 fma 1 1 0. -> 1
-dqadd3072 fma 1 1 .0 -> 1.0
-dqadd3073 fma 1 1 0.0 -> 1.0
-dqadd3074 fma 1 1 0.00 -> 1.00
-dqadd3075 fma 1 0 1 -> 1
-dqadd3076 fma 1 0. 1 -> 1
-dqadd3077 fma 1 .0 1 -> 1.0
-dqadd3078 fma 1 0.0 1 -> 1.0
-dqadd3079 fma 1 0.00 1 -> 1.00
-
--- some carries
-dqadd3080 fma 1 999999998 1 -> 999999999
-dqadd3081 fma 1 999999999 1 -> 1000000000
-dqadd3082 fma 1 99999999 1 -> 100000000
-dqadd3083 fma 1 9999999 1 -> 10000000
-dqadd3084 fma 1 999999 1 -> 1000000
-dqadd3085 fma 1 99999 1 -> 100000
-dqadd3086 fma 1 9999 1 -> 10000
-dqadd3087 fma 1 999 1 -> 1000
-dqadd3088 fma 1 99 1 -> 100
-dqadd3089 fma 1 9 1 -> 10
-
-
--- more LHS swaps
-dqadd3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
-dqadd3091 fma 1 '-56267E-6' 0 -> '-0.056267'
-dqadd3092 fma 1 '-56267E-5' 0 -> '-0.56267'
-dqadd3093 fma 1 '-56267E-4' 0 -> '-5.6267'
-dqadd3094 fma 1 '-56267E-3' 0 -> '-56.267'
-dqadd3095 fma 1 '-56267E-2' 0 -> '-562.67'
-dqadd3096 fma 1 '-56267E-1' 0 -> '-5626.7'
-dqadd3097 fma 1 '-56267E-0' 0 -> '-56267'
-dqadd3098 fma 1 '-5E-10' 0 -> '-5E-10'
-dqadd3099 fma 1 '-5E-7' 0 -> '-5E-7'
-dqadd3100 fma 1 '-5E-6' 0 -> '-0.000005'
-dqadd3101 fma 1 '-5E-5' 0 -> '-0.00005'
-dqadd3102 fma 1 '-5E-4' 0 -> '-0.0005'
-dqadd3103 fma 1 '-5E-1' 0 -> '-0.5'
-dqadd3104 fma 1 '-5E0' 0 -> '-5'
-dqadd3105 fma 1 '-5E1' 0 -> '-50'
-dqadd3106 fma 1 '-5E5' 0 -> '-500000'
-dqadd3107 fma 1 '-5E33' 0 -> '-5000000000000000000000000000000000'
-dqadd3108 fma 1 '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
-dqadd3109 fma 1 '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
-dqadd3110 fma 1 '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
-dqadd3111 fma 1 '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- more RHS swaps
-dqadd3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
-dqadd3114 fma 1 0 '-56267E-6' -> '-0.056267'
-dqadd3116 fma 1 0 '-56267E-5' -> '-0.56267'
-dqadd3117 fma 1 0 '-56267E-4' -> '-5.6267'
-dqadd3119 fma 1 0 '-56267E-3' -> '-56.267'
-dqadd3120 fma 1 0 '-56267E-2' -> '-562.67'
-dqadd3121 fma 1 0 '-56267E-1' -> '-5626.7'
-dqadd3122 fma 1 0 '-56267E-0' -> '-56267'
-dqadd3123 fma 1 0 '-5E-10' -> '-5E-10'
-dqadd3124 fma 1 0 '-5E-7' -> '-5E-7'
-dqadd3125 fma 1 0 '-5E-6' -> '-0.000005'
-dqadd3126 fma 1 0 '-5E-5' -> '-0.00005'
-dqadd3127 fma 1 0 '-5E-4' -> '-0.0005'
-dqadd3128 fma 1 0 '-5E-1' -> '-0.5'
-dqadd3129 fma 1 0 '-5E0' -> '-5'
-dqadd3130 fma 1 0 '-5E1' -> '-50'
-dqadd3131 fma 1 0 '-5E5' -> '-500000'
-dqadd3132 fma 1 0 '-5E33' -> '-5000000000000000000000000000000000'
-dqadd3133 fma 1 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded
-dqadd3134 fma 1 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded
-dqadd3135 fma 1 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded
-dqadd3136 fma 1 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- related
-dqadd3137 fma 1 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded
-dqadd3138 fma 1 -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded
-dqadd3139 fma 1 '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded
-dqadd3140 fma 1 '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded
-dqadd3141 fma 1 1E+29 0.0000 -> '100000000000000000000000000000.0000'
-dqadd3142 fma 1 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded
-dqadd3143 fma 1 0.000 1E+30 -> '1000000000000000000000000000000.000'
-dqadd3144 fma 1 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-dqadd3146 fma 1 '00.0' 0 -> '0.0'
-dqadd3147 fma 1 '0.00' 0 -> '0.00'
-dqadd3148 fma 1 0 '0.00' -> '0.00'
-dqadd3149 fma 1 0 '00.0' -> '0.0'
-dqadd3150 fma 1 '00.0' '0.00' -> '0.00'
-dqadd3151 fma 1 '0.00' '00.0' -> '0.00'
-dqadd3152 fma 1 '3' '.3' -> '3.3'
-dqadd3153 fma 1 '3.' '.3' -> '3.3'
-dqadd3154 fma 1 '3.0' '.3' -> '3.3'
-dqadd3155 fma 1 '3.00' '.3' -> '3.30'
-dqadd3156 fma 1 '3' '3' -> '6'
-dqadd3157 fma 1 '3' '+3' -> '6'
-dqadd3158 fma 1 '3' '-3' -> '0'
-dqadd3159 fma 1 '0.3' '-0.3' -> '0.0'
-dqadd3160 fma 1 '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-dqadd3161 fma 1 '1E+12' '-1' -> '999999999999'
-dqadd3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
-dqadd3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
-dqadd3164 fma 1 '-1' '1E+12' -> '999999999999'
-dqadd3165 fma 1 '7E+12' '-1' -> '6999999999999'
-dqadd3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
-dqadd3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
-dqadd3168 fma 1 '-1' '7E+12' -> '6999999999999'
-
-rounding: half_up
-dqadd3170 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd3171 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd3172 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded
-dqadd3173 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded
-dqadd3174 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd3175 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd3176 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd3177 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded
-dqadd3178 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded
-dqadd3179 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd3180 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd3181 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd3182 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded
-dqadd3183 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-dqadd3200 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd3201 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3202 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3203 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3204 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3205 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3206 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3207 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3208 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3209 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3210 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3211 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3212 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3213 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3214 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3215 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3216 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd3217 fma 1 '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3218 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3219 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
-
-rounding: half_even
-dqadd3220 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd3221 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3222 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3223 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3224 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3225 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3226 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3227 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3228 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3229 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3230 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3231 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3232 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3233 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3234 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3235 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3236 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd3237 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3238 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3239 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
--- critical few with even bottom digit...
-dqadd3240 fma 1 '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded
-dqadd3241 fma 1 '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded
-dqadd3242 fma 1 '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
-
-rounding: down
-dqadd3250 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
-dqadd3251 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3252 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3253 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3254 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3255 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3256 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3257 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3258 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3259 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3260 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3261 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3262 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3263 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3264 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3265 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded
-dqadd3266 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
-dqadd3267 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3268 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
-dqadd3269 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-dqadd3301 fma 1 -1 1 -> 0
-dqadd3302 fma 1 0 1 -> 1
-dqadd3303 fma 1 1 1 -> 2
-dqadd3304 fma 1 12 1 -> 13
-dqadd3305 fma 1 98 1 -> 99
-dqadd3306 fma 1 99 1 -> 100
-dqadd3307 fma 1 100 1 -> 101
-dqadd3308 fma 1 101 1 -> 102
-dqadd3309 fma 1 -1 -1 -> -2
-dqadd3310 fma 1 0 -1 -> -1
-dqadd3311 fma 1 1 -1 -> 0
-dqadd3312 fma 1 12 -1 -> 11
-dqadd3313 fma 1 98 -1 -> 97
-dqadd3314 fma 1 99 -1 -> 98
-dqadd3315 fma 1 100 -1 -> 99
-dqadd3316 fma 1 101 -1 -> 100
-
-dqadd3321 fma 1 -0.01 0.01 -> 0.00
-dqadd3322 fma 1 0.00 0.01 -> 0.01
-dqadd3323 fma 1 0.01 0.01 -> 0.02
-dqadd3324 fma 1 0.12 0.01 -> 0.13
-dqadd3325 fma 1 0.98 0.01 -> 0.99
-dqadd3326 fma 1 0.99 0.01 -> 1.00
-dqadd3327 fma 1 1.00 0.01 -> 1.01
-dqadd3328 fma 1 1.01 0.01 -> 1.02
-dqadd3329 fma 1 -0.01 -0.01 -> -0.02
-dqadd3330 fma 1 0.00 -0.01 -> -0.01
-dqadd3331 fma 1 0.01 -0.01 -> 0.00
-dqadd3332 fma 1 0.12 -0.01 -> 0.11
-dqadd3333 fma 1 0.98 -0.01 -> 0.97
-dqadd3334 fma 1 0.99 -0.01 -> 0.98
-dqadd3335 fma 1 1.00 -0.01 -> 0.99
-dqadd3336 fma 1 1.01 -0.01 -> 1.00
-
--- some more cases where adding 0 affects the coefficient
-dqadd3340 fma 1 1E+3 0 -> 1000
-dqadd3341 fma 1 1E+33 0 -> 1000000000000000000000000000000000
-dqadd3342 fma 1 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded
-dqadd3343 fma 1 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded
--- which simply follow from these cases ...
-dqadd3344 fma 1 1E+3 1 -> 1001
-dqadd3345 fma 1 1E+33 1 -> 1000000000000000000000000000000001
-dqadd3346 fma 1 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd3347 fma 1 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
-dqadd3348 fma 1 1E+3 7 -> 1007
-dqadd3349 fma 1 1E+33 7 -> 1000000000000000000000000000000007
-dqadd3350 fma 1 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded
-dqadd3351 fma 1 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
-
--- tryzeros cases
-rounding: half_up
-dqadd3360 fma 1 0E+50 10000E+1 -> 1.0000E+5
-dqadd3361 fma 1 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded
-dqadd3362 fma 1 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded
-dqadd3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact
-dqadd3364 fma 1 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111
--- 1 234567890123456789012345678901234
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-dqadd3370 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd3371 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-rounding: half_up
-dqadd3372 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd3373 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-rounding: half_even
-dqadd3374 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
-dqadd3375 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
-
--- ulp replacement tests
-dqadd3400 fma 1 1 77e-32 -> 1.00000000000000000000000000000077
-dqadd3401 fma 1 1 77e-33 -> 1.000000000000000000000000000000077
-dqadd3402 fma 1 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded
-dqadd3403 fma 1 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded
-dqadd3404 fma 1 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd3405 fma 1 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd3406 fma 1 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd3410 fma 1 10 77e-32 -> 10.00000000000000000000000000000077
-dqadd3411 fma 1 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded
-dqadd3412 fma 1 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded
-dqadd3413 fma 1 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3414 fma 1 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3415 fma 1 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3416 fma 1 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd3420 fma 1 77e-32 1 -> 1.00000000000000000000000000000077
-dqadd3421 fma 1 77e-33 1 -> 1.000000000000000000000000000000077
-dqadd3422 fma 1 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded
-dqadd3423 fma 1 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded
-dqadd3424 fma 1 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd3425 fma 1 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd3426 fma 1 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd3430 fma 1 77e-32 10 -> 10.00000000000000000000000000000077
-dqadd3431 fma 1 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded
-dqadd3432 fma 1 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded
-dqadd3433 fma 1 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3434 fma 1 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3435 fma 1 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd3436 fma 1 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-
--- negative ulps
-dqadd36440 fma 1 1 -77e-32 -> 0.99999999999999999999999999999923
-dqadd36441 fma 1 1 -77e-33 -> 0.999999999999999999999999999999923
-dqadd36442 fma 1 1 -77e-34 -> 0.9999999999999999999999999999999923
-dqadd36443 fma 1 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded
-dqadd36444 fma 1 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded
-dqadd36445 fma 1 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd36446 fma 1 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd36450 fma 1 10 -77e-32 -> 9.99999999999999999999999999999923
-dqadd36451 fma 1 10 -77e-33 -> 9.999999999999999999999999999999923
-dqadd36452 fma 1 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded
-dqadd36453 fma 1 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded
-dqadd36454 fma 1 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd36455 fma 1 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd36456 fma 1 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd36460 fma 1 -77e-32 1 -> 0.99999999999999999999999999999923
-dqadd36461 fma 1 -77e-33 1 -> 0.999999999999999999999999999999923
-dqadd36462 fma 1 -77e-34 1 -> 0.9999999999999999999999999999999923
-dqadd36463 fma 1 -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded
-dqadd36464 fma 1 -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded
-dqadd36465 fma 1 -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-dqadd36466 fma 1 -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd36470 fma 1 -77e-32 10 -> 9.99999999999999999999999999999923
-dqadd36471 fma 1 -77e-33 10 -> 9.999999999999999999999999999999923
-dqadd36472 fma 1 -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded
-dqadd36473 fma 1 -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded
-dqadd36474 fma 1 -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd36475 fma 1 -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-dqadd36476 fma 1 -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded
-
--- negative ulps
-dqadd36480 fma 1 -1 77e-32 -> -0.99999999999999999999999999999923
-dqadd36481 fma 1 -1 77e-33 -> -0.999999999999999999999999999999923
-dqadd36482 fma 1 -1 77e-34 -> -0.9999999999999999999999999999999923
-dqadd36483 fma 1 -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded
-dqadd36484 fma 1 -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded
-dqadd36485 fma 1 -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded
-dqadd36486 fma 1 -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd36490 fma 1 -10 77e-32 -> -9.99999999999999999999999999999923
-dqadd36491 fma 1 -10 77e-33 -> -9.999999999999999999999999999999923
-dqadd36492 fma 1 -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded
-dqadd36493 fma 1 -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded
-dqadd36494 fma 1 -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd36495 fma 1 -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd36496 fma 1 -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded
-
-dqadd36500 fma 1 77e-32 -1 -> -0.99999999999999999999999999999923
-dqadd36501 fma 1 77e-33 -1 -> -0.999999999999999999999999999999923
-dqadd36502 fma 1 77e-34 -1 -> -0.9999999999999999999999999999999923
-dqadd36503 fma 1 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded
-dqadd36504 fma 1 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded
-dqadd36505 fma 1 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
-dqadd36506 fma 1 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
-
-dqadd36510 fma 1 77e-32 -10 -> -9.99999999999999999999999999999923
-dqadd36511 fma 1 77e-33 -10 -> -9.999999999999999999999999999999923
-dqadd36512 fma 1 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded
-dqadd36513 fma 1 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded
-dqadd36514 fma 1 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd36515 fma 1 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-dqadd36516 fma 1 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
-
--- and some more residue effects and different roundings
-rounding: half_up
-dqadd36540 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd36541 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36542 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36543 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36544 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36545 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36546 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36547 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36548 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36549 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36550 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36551 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36552 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36553 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36554 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36555 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36556 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd36557 fma 1 '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36558 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36559 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
-rounding: half_even
-dqadd36560 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd36561 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36562 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36563 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36564 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36565 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36566 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36567 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd36568 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36569 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36570 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36571 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36572 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36573 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36574 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36575 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36576 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd36577 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36578 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd36579 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
--- critical few with even bottom digit...
-dqadd37540 fma 1 '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded
-dqadd37541 fma 1 '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded
-dqadd37542 fma 1 '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
-
-rounding: down
-dqadd37550 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
-dqadd37551 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37552 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37553 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37554 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37555 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37556 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37557 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37558 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37559 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37560 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37561 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37562 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37563 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37564 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37565 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded
-dqadd37566 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
-dqadd37567 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd37568 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
-dqadd37569 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-dqadd37701 fma 1 5.00 1.00E-3 -> 5.00100
-dqadd37702 fma 1 00.00 0.000 -> 0.000
-dqadd37703 fma 1 00.00 0E-3 -> 0.000
-dqadd37704 fma 1 0E-3 00.00 -> 0.000
-
-dqadd37710 fma 1 0E+3 00.00 -> 0.00
-dqadd37711 fma 1 0E+3 00.0 -> 0.0
-dqadd37712 fma 1 0E+3 00. -> 0
-dqadd37713 fma 1 0E+3 00.E+1 -> 0E+1
-dqadd37714 fma 1 0E+3 00.E+2 -> 0E+2
-dqadd37715 fma 1 0E+3 00.E+3 -> 0E+3
-dqadd37716 fma 1 0E+3 00.E+4 -> 0E+3
-dqadd37717 fma 1 0E+3 00.E+5 -> 0E+3
-dqadd37718 fma 1 0E+3 -00.0 -> 0.0
-dqadd37719 fma 1 0E+3 -00. -> 0
-dqadd37731 fma 1 0E+3 -00.E+1 -> 0E+1
-
-dqadd37720 fma 1 00.00 0E+3 -> 0.00
-dqadd37721 fma 1 00.0 0E+3 -> 0.0
-dqadd37722 fma 1 00. 0E+3 -> 0
-dqadd37723 fma 1 00.E+1 0E+3 -> 0E+1
-dqadd37724 fma 1 00.E+2 0E+3 -> 0E+2
-dqadd37725 fma 1 00.E+3 0E+3 -> 0E+3
-dqadd37726 fma 1 00.E+4 0E+3 -> 0E+3
-dqadd37727 fma 1 00.E+5 0E+3 -> 0E+3
-dqadd37728 fma 1 -00.00 0E+3 -> 0.00
-dqadd37729 fma 1 -00.0 0E+3 -> 0.0
-dqadd37730 fma 1 -00. 0E+3 -> 0
-
-dqadd37732 fma 1 0 0 -> 0
-dqadd37733 fma 1 0 -0 -> 0
-dqadd37734 fma 1 -0 0 -> 0
-dqadd37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
-
-dqadd37736 fma 1 1 -1 -> 0
-dqadd37737 fma 1 -1 -1 -> -2
-dqadd37738 fma 1 1 1 -> 2
-dqadd37739 fma 1 -1 1 -> 0
-
-dqadd37741 fma 1 0 -1 -> -1
-dqadd37742 fma 1 -0 -1 -> -1
-dqadd37743 fma 1 0 1 -> 1
-dqadd37744 fma 1 -0 1 -> 1
-dqadd37745 fma 1 -1 0 -> -1
-dqadd37746 fma 1 -1 -0 -> -1
-dqadd37747 fma 1 1 0 -> 1
-dqadd37748 fma 1 1 -0 -> 1
-
-dqadd37751 fma 1 0.0 -1 -> -1.0
-dqadd37752 fma 1 -0.0 -1 -> -1.0
-dqadd37753 fma 1 0.0 1 -> 1.0
-dqadd37754 fma 1 -0.0 1 -> 1.0
-dqadd37755 fma 1 -1.0 0 -> -1.0
-dqadd37756 fma 1 -1.0 -0 -> -1.0
-dqadd37757 fma 1 1.0 0 -> 1.0
-dqadd37758 fma 1 1.0 -0 -> 1.0
-
-dqadd37761 fma 1 0 -1.0 -> -1.0
-dqadd37762 fma 1 -0 -1.0 -> -1.0
-dqadd37763 fma 1 0 1.0 -> 1.0
-dqadd37764 fma 1 -0 1.0 -> 1.0
-dqadd37765 fma 1 -1 0.0 -> -1.0
-dqadd37766 fma 1 -1 -0.0 -> -1.0
-dqadd37767 fma 1 1 0.0 -> 1.0
-dqadd37768 fma 1 1 -0.0 -> 1.0
-
-dqadd37771 fma 1 0.0 -1.0 -> -1.0
-dqadd37772 fma 1 -0.0 -1.0 -> -1.0
-dqadd37773 fma 1 0.0 1.0 -> 1.0
-dqadd37774 fma 1 -0.0 1.0 -> 1.0
-dqadd37775 fma 1 -1.0 0.0 -> -1.0
-dqadd37776 fma 1 -1.0 -0.0 -> -1.0
-dqadd37777 fma 1 1.0 0.0 -> 1.0
-dqadd37778 fma 1 1.0 -0.0 -> 1.0
-
--- Specials
-dqadd37780 fma 1 -Inf -Inf -> -Infinity
-dqadd37781 fma 1 -Inf -1000 -> -Infinity
-dqadd37782 fma 1 -Inf -1 -> -Infinity
-dqadd37783 fma 1 -Inf -0 -> -Infinity
-dqadd37784 fma 1 -Inf 0 -> -Infinity
-dqadd37785 fma 1 -Inf 1 -> -Infinity
-dqadd37786 fma 1 -Inf 1000 -> -Infinity
-dqadd37787 fma 1 -1000 -Inf -> -Infinity
-dqadd37788 fma 1 -Inf -Inf -> -Infinity
-dqadd37789 fma 1 -1 -Inf -> -Infinity
-dqadd37790 fma 1 -0 -Inf -> -Infinity
-dqadd37791 fma 1 0 -Inf -> -Infinity
-dqadd37792 fma 1 1 -Inf -> -Infinity
-dqadd37793 fma 1 1000 -Inf -> -Infinity
-dqadd37794 fma 1 Inf -Inf -> NaN Invalid_operation
-
-dqadd37800 fma 1 Inf -Inf -> NaN Invalid_operation
-dqadd37801 fma 1 Inf -1000 -> Infinity
-dqadd37802 fma 1 Inf -1 -> Infinity
-dqadd37803 fma 1 Inf -0 -> Infinity
-dqadd37804 fma 1 Inf 0 -> Infinity
-dqadd37805 fma 1 Inf 1 -> Infinity
-dqadd37806 fma 1 Inf 1000 -> Infinity
-dqadd37807 fma 1 Inf Inf -> Infinity
-dqadd37808 fma 1 -1000 Inf -> Infinity
-dqadd37809 fma 1 -Inf Inf -> NaN Invalid_operation
-dqadd37810 fma 1 -1 Inf -> Infinity
-dqadd37811 fma 1 -0 Inf -> Infinity
-dqadd37812 fma 1 0 Inf -> Infinity
-dqadd37813 fma 1 1 Inf -> Infinity
-dqadd37814 fma 1 1000 Inf -> Infinity
-dqadd37815 fma 1 Inf Inf -> Infinity
-
-dqadd37821 fma 1 NaN -Inf -> NaN
-dqadd37822 fma 1 NaN -1000 -> NaN
-dqadd37823 fma 1 NaN -1 -> NaN
-dqadd37824 fma 1 NaN -0 -> NaN
-dqadd37825 fma 1 NaN 0 -> NaN
-dqadd37826 fma 1 NaN 1 -> NaN
-dqadd37827 fma 1 NaN 1000 -> NaN
-dqadd37828 fma 1 NaN Inf -> NaN
-dqadd37829 fma 1 NaN NaN -> NaN
-dqadd37830 fma 1 -Inf NaN -> NaN
-dqadd37831 fma 1 -1000 NaN -> NaN
-dqadd37832 fma 1 -1 NaN -> NaN
-dqadd37833 fma 1 -0 NaN -> NaN
-dqadd37834 fma 1 0 NaN -> NaN
-dqadd37835 fma 1 1 NaN -> NaN
-dqadd37836 fma 1 1000 NaN -> NaN
-dqadd37837 fma 1 Inf NaN -> NaN
-
-dqadd37841 fma 1 sNaN -Inf -> NaN Invalid_operation
-dqadd37842 fma 1 sNaN -1000 -> NaN Invalid_operation
-dqadd37843 fma 1 sNaN -1 -> NaN Invalid_operation
-dqadd37844 fma 1 sNaN -0 -> NaN Invalid_operation
-dqadd37845 fma 1 sNaN 0 -> NaN Invalid_operation
-dqadd37846 fma 1 sNaN 1 -> NaN Invalid_operation
-dqadd37847 fma 1 sNaN 1000 -> NaN Invalid_operation
-dqadd37848 fma 1 sNaN NaN -> NaN Invalid_operation
-dqadd37849 fma 1 sNaN sNaN -> NaN Invalid_operation
-dqadd37850 fma 1 NaN sNaN -> NaN Invalid_operation
-dqadd37851 fma 1 -Inf sNaN -> NaN Invalid_operation
-dqadd37852 fma 1 -1000 sNaN -> NaN Invalid_operation
-dqadd37853 fma 1 -1 sNaN -> NaN Invalid_operation
-dqadd37854 fma 1 -0 sNaN -> NaN Invalid_operation
-dqadd37855 fma 1 0 sNaN -> NaN Invalid_operation
-dqadd37856 fma 1 1 sNaN -> NaN Invalid_operation
-dqadd37857 fma 1 1000 sNaN -> NaN Invalid_operation
-dqadd37858 fma 1 Inf sNaN -> NaN Invalid_operation
-dqadd37859 fma 1 NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqadd37861 fma 1 NaN1 -Inf -> NaN1
-dqadd37862 fma 1 +NaN2 -1000 -> NaN2
-dqadd37863 fma 1 NaN3 1000 -> NaN3
-dqadd37864 fma 1 NaN4 Inf -> NaN4
-dqadd37865 fma 1 NaN5 +NaN6 -> NaN5
-dqadd37866 fma 1 -Inf NaN7 -> NaN7
-dqadd37867 fma 1 -1000 NaN8 -> NaN8
-dqadd37868 fma 1 1000 NaN9 -> NaN9
-dqadd37869 fma 1 Inf +NaN10 -> NaN10
-dqadd37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
-dqadd37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
-dqadd37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
-dqadd37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
-dqadd37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqadd37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
-dqadd37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
-dqadd37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
-dqadd37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
-dqadd37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
-dqadd37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqadd37882 fma 1 -NaN26 NaN28 -> -NaN26
-dqadd37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqadd37884 fma 1 1000 -NaN30 -> -NaN30
-dqadd37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Here we explore near the boundary of rounding a subnormal to Nmin
-dqadd37575 fma 1 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal
-dqadd37576 fma 1 -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal
-
--- check overflow edge case
--- 1234567890123456
-dqadd37972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqadd37973 fma 1 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37974 fma 1 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37975 fma 1 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded
-dqadd37976 fma 1 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37977 fma 1 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37978 fma 1 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37979 fma 1 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37980 fma 1 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded
-dqadd37981 fma 1 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37982 fma 1 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37983 fma 1 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37984 fma 1 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
-
-dqadd37985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqadd37986 fma 1 -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37987 fma 1 -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37988 fma 1 -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded
-dqadd37989 fma 1 -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37990 fma 1 -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37991 fma 1 -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37992 fma 1 -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37993 fma 1 -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded
-dqadd37994 fma 1 -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37995 fma 1 -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37996 fma 1 -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-dqadd37997 fma 1 -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-dqadd371100 fma 1 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact
-dqadd371101 fma 1 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact
-dqadd371103 fma 1 +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact
-dqadd371104 fma 1 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact
-dqadd371105 fma 1 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact
-dqadd371106 fma 1 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact
-dqadd371107 fma 1 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact
-dqadd371108 fma 1 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact
-dqadd371109 fma 1 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-dqadd371110 fma 1 -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact
-dqadd371111 fma 1 -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact
-dqadd371113 fma 1 -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact
-dqadd371114 fma 1 -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact
-dqadd371115 fma 1 -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact
-dqadd371116 fma 1 -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact
-dqadd371117 fma 1 -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact
-dqadd371118 fma 1 -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact
-dqadd371119 fma 1 -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-dqadd371300 fma 1 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371310 fma 1 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371311 fma 1 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371312 fma 1 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371313 fma 1 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371314 fma 1 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371315 fma 1 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371316 fma 1 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371317 fma 1 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371318 fma 1 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371319 fma 1 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371320 fma 1 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371321 fma 1 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371322 fma 1 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371323 fma 1 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371324 fma 1 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371325 fma 1 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371326 fma 1 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371327 fma 1 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371328 fma 1 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371329 fma 1 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371330 fma 1 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371331 fma 1 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371332 fma 1 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371333 fma 1 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371334 fma 1 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371335 fma 1 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371336 fma 1 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371337 fma 1 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371338 fma 1 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371339 fma 1 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-
-dqadd371340 fma 1 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded
-dqadd371341 fma 1 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded
-
-dqadd371349 fma 1 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371350 fma 1 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371351 fma 1 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371352 fma 1 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371353 fma 1 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371354 fma 1 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371355 fma 1 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371356 fma 1 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371357 fma 1 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371358 fma 1 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371359 fma 1 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371360 fma 1 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371361 fma 1 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371362 fma 1 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371363 fma 1 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371364 fma 1 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
-dqadd371365 fma 1 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371367 fma 1 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371368 fma 1 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371369 fma 1 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371370 fma 1 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371371 fma 1 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371372 fma 1 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371373 fma 1 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371374 fma 1 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371375 fma 1 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371376 fma 1 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371377 fma 1 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371378 fma 1 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371379 fma 1 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371380 fma 1 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371381 fma 1 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371382 fma 1 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371383 fma 1 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371384 fma 1 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371385 fma 1 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371386 fma 1 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371387 fma 1 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371388 fma 1 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371389 fma 1 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371390 fma 1 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371391 fma 1 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371392 fma 1 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371393 fma 1 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371394 fma 1 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371395 fma 1 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-dqadd371396 fma 1 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-dqadd371420 fma 1 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345
-dqadd371421 fma 1 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345
-dqadd371422 fma 1 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345
-dqadd371423 fma 1 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345
-dqadd371424 fma 1 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345
-dqadd371425 fma 1 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345
-dqadd371426 fma 1 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345
-dqadd371427 fma 1 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7
-dqadd371428 fma 1 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8
-dqadd371429 fma 1 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9
-dqadd371430 fma 1 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10
-dqadd371431 fma 1 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11
-dqadd371432 fma 1 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12
-dqadd371433 fma 1 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13
-dqadd371434 fma 1 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14
-dqadd371435 fma 1 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15
-dqadd371436 fma 1 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16
-dqadd371437 fma 1 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17
-dqadd371438 fma 1 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18
-dqadd371439 fma 1 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19
-dqadd371440 fma 1 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20
-dqadd371441 fma 1 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21
-dqadd371442 fma 1 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22
-dqadd371443 fma 1 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23
-dqadd371444 fma 1 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24
-dqadd371445 fma 1 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25
-dqadd371446 fma 1 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26
-dqadd371447 fma 1 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27
-dqadd371448 fma 1 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28
-dqadd371449 fma 1 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29
-dqadd371450 fma 1 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30
-dqadd371451 fma 1 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31
-dqadd371452 fma 1 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32
-dqadd371453 fma 1 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33
-dqadd371454 fma 1 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34
-dqadd371455 fma 1 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35
-dqadd371456 fma 1 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36
-
--- same, reversed 0
-dqadd371460 fma 1 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345
-dqadd371461 fma 1 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345
-dqadd371462 fma 1 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345
-dqadd371463 fma 1 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345
-dqadd371464 fma 1 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345
-dqadd371465 fma 1 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345
-dqadd371466 fma 1 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345
-dqadd371467 fma 1 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7
-dqadd371468 fma 1 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8
-dqadd371469 fma 1 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9
-dqadd371470 fma 1 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10
-dqadd371471 fma 1 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11
-dqadd371472 fma 1 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12
-dqadd371473 fma 1 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13
-dqadd371474 fma 1 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14
-dqadd371475 fma 1 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15
-dqadd371476 fma 1 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16
-dqadd371477 fma 1 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17
-dqadd371478 fma 1 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18
-dqadd371479 fma 1 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19
-dqadd371480 fma 1 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20
-dqadd371481 fma 1 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21
-dqadd371482 fma 1 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22
-dqadd371483 fma 1 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23
-dqadd371484 fma 1 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24
-dqadd371485 fma 1 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25
-dqadd371486 fma 1 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26
-dqadd371487 fma 1 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27
-dqadd371488 fma 1 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28
-dqadd371489 fma 1 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29
-dqadd371490 fma 1 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30
-dqadd371491 fma 1 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31
-dqadd371492 fma 1 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32
-dqadd371493 fma 1 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33
-dqadd371494 fma 1 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34
-dqadd371495 fma 1 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35
-dqadd371496 fma 1 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36
-
--- same, Es on the 0
-dqadd371500 fma 1 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345
-dqadd371501 fma 1 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345
-dqadd371502 fma 1 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345
-dqadd371503 fma 1 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345
-dqadd371504 fma 1 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345
-dqadd371505 fma 1 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345
-dqadd371506 fma 1 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345
-dqadd371507 fma 1 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345
-dqadd371508 fma 1 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345
-dqadd371509 fma 1 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345
-dqadd371510 fma 1 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345
-dqadd371511 fma 1 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345
-dqadd371512 fma 1 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345
-dqadd371513 fma 1 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345
-dqadd371514 fma 1 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345
-dqadd371515 fma 1 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345
-dqadd371516 fma 1 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345
-dqadd371517 fma 1 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345
-dqadd371518 fma 1 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345
-dqadd371519 fma 1 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345
-dqadd371520 fma 1 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345
-dqadd371521 fma 1 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345
-dqadd371522 fma 1 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345
-dqadd371523 fma 1 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345
-dqadd371524 fma 1 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345
-dqadd371525 fma 1 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345
-dqadd371526 fma 1 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345
-dqadd371527 fma 1 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345
-dqadd371528 fma 1 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345
-dqadd371529 fma 1 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345
-dqadd371530 fma 1 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345
-dqadd371531 fma 1 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345
-dqadd371532 fma 1 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345
-dqadd371533 fma 1 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345
--- next four flag Rounded because the 0 extends the result
-dqadd371534 fma 1 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded
-dqadd371535 fma 1 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded
-dqadd371536 fma 1 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded
-dqadd371537 fma 1 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-dqadd371600 fma 1 0 0E-19 -> 0E-19
-dqadd371601 fma 1 -0 0E-19 -> 0E-19
-dqadd371602 fma 1 0 -0E-19 -> 0E-19
-dqadd371603 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371611 fma 1 -11 11 -> 0
-dqadd371612 fma 1 11 -11 -> 0
--- overflow
-dqadd371613 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371614 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: half_down
--- exact zeros from zeros
-dqadd371620 fma 1 0 0E-19 -> 0E-19
-dqadd371621 fma 1 -0 0E-19 -> 0E-19
-dqadd371622 fma 1 0 -0E-19 -> 0E-19
-dqadd371623 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371631 fma 1 -11 11 -> 0
-dqadd371632 fma 1 11 -11 -> 0
--- overflow
-dqadd371633 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371634 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: half_even
--- exact zeros from zeros
-dqadd371640 fma 1 0 0E-19 -> 0E-19
-dqadd371641 fma 1 -0 0E-19 -> 0E-19
-dqadd371642 fma 1 0 -0E-19 -> 0E-19
-dqadd371643 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371651 fma 1 -11 11 -> 0
-dqadd371652 fma 1 11 -11 -> 0
--- overflow
-dqadd371653 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371654 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: up
--- exact zeros from zeros
-dqadd371660 fma 1 0 0E-19 -> 0E-19
-dqadd371661 fma 1 -0 0E-19 -> 0E-19
-dqadd371662 fma 1 0 -0E-19 -> 0E-19
-dqadd371663 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371671 fma 1 -11 11 -> 0
-dqadd371672 fma 1 11 -11 -> 0
--- overflow
-dqadd371673 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371674 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: down
--- exact zeros from zeros
-dqadd371680 fma 1 0 0E-19 -> 0E-19
-dqadd371681 fma 1 -0 0E-19 -> 0E-19
-dqadd371682 fma 1 0 -0E-19 -> 0E-19
-dqadd371683 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371691 fma 1 -11 11 -> 0
-dqadd371692 fma 1 11 -11 -> 0
--- overflow
-dqadd371693 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqadd371694 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-
-rounding: ceiling
--- exact zeros from zeros
-dqadd371700 fma 1 0 0E-19 -> 0E-19
-dqadd371701 fma 1 -0 0E-19 -> 0E-19
-dqadd371702 fma 1 0 -0E-19 -> 0E-19
-dqadd371703 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371711 fma 1 -11 11 -> 0
-dqadd371712 fma 1 11 -11 -> 0
--- overflow
-dqadd371713 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
-dqadd371714 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-dqadd371720 fma 1 0 0E-19 -> 0E-19
-dqadd371721 fma 1 -0 0E-19 -> -0E-19 -- *
-dqadd371722 fma 1 0 -0E-19 -> -0E-19 -- *
-dqadd371723 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371731 fma 1 -11 11 -> -0 -- *
-dqadd371732 fma 1 11 -11 -> -0 -- *
--- overflow
-dqadd371733 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqadd371734 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
-
-rounding: 05up
--- exact zeros from zeros
-dqadd371740 fma 1 0 0E-19 -> 0E-19
-dqadd371741 fma 1 -0 0E-19 -> 0E-19
-dqadd371742 fma 1 0 -0E-19 -> 0E-19
-dqadd371743 fma 1 -0 -0E-19 -> -0E-19
--- exact zeros from non-zeros
-dqadd371751 fma 1 -11 11 -> 0
-dqadd371752 fma 1 11 -11 -> 0
--- overflow
-dqadd371753 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-dqadd371754 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dqadd371761 fma 1 130E-2 120E-2 -> 2.50
-dqadd371762 fma 1 130E-2 12E-1 -> 2.50
-dqadd371763 fma 1 130E-2 1E0 -> 2.30
-dqadd371764 fma 1 1E2 1E4 -> 1.01E+4
-dqadd371765 fma 1 130E-2 -120E-2 -> 0.10
-dqadd371766 fma 1 130E-2 -12E-1 -> 0.10
-dqadd371767 fma 1 130E-2 -1E0 -> 0.30
-dqadd371768 fma 1 1E2 -1E4 -> -9.9E+3
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-dqadd375001 fma 1 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457
-dqadd375002 fma 1 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded
-dqadd375003 fma 1 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375004 fma 1 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375005 fma 1 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375006 fma 1 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375007 fma 1 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375008 fma 1 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375009 fma 1 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375010 fma 1 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375011 fma 1 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375012 fma 1 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375013 fma 1 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375014 fma 1 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375015 fma 1 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375016 fma 1 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375017 fma 1 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375018 fma 1 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375019 fma 1 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375020 fma 1 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded
-dqadd375021 fma 1 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded
-
--- widening second argument at gap
-dqadd375030 fma 1 12398765432112345678945678 1 -> 12398765432112345678945679
-dqadd375031 fma 1 12398765432112345678945678 0.1 -> 12398765432112345678945678.1
-dqadd375032 fma 1 12398765432112345678945678 0.12 -> 12398765432112345678945678.12
-dqadd375033 fma 1 12398765432112345678945678 0.123 -> 12398765432112345678945678.123
-dqadd375034 fma 1 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234
-dqadd375035 fma 1 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345
-dqadd375036 fma 1 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456
-dqadd375037 fma 1 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567
-dqadd375038 fma 1 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678
-dqadd375039 fma 1 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375040 fma 1 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded
-dqadd375041 fma 1 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded
-dqadd375042 fma 1 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375043 fma 1 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375044 fma 1 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375045 fma 1 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375046 fma 1 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375047 fma 1 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375048 fma 1 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded
-dqadd375049 fma 1 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-dqadd375050 fma 1 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded
-dqadd375051 fma 1 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded
-dqadd375052 fma 1 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded
-dqadd375053 fma 1 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded
-dqadd375054 fma 1 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded
-dqadd375055 fma 1 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded
-dqadd375056 fma 1 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded
-dqadd375057 fma 1 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded
-dqadd375060 fma 1 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded
-dqadd375061 fma 1 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded
-dqadd375062 fma 1 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded
-dqadd375063 fma 1 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded
-dqadd375064 fma 1 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded
-dqadd375065 fma 1 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded
-dqadd375066 fma 1 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded
-dqadd375067 fma 1 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-dqadd375070 fma 1 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001
-dqadd375071 fma 1 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375072 fma 1 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375073 fma 1 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375074 fma 1 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375075 fma 1 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375076 fma 1 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375077 fma 1 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375078 fma 1 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375079 fma 1 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375080 fma 1 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375081 fma 1 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375082 fma 1 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375083 fma 1 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375084 fma 1 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375085 fma 1 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375086 fma 1 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375087 fma 1 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375088 fma 1 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded
-dqadd375089 fma 1 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded
-
--- Destructive subtract (from remainder tests)
-
--- +++ some of these will be off-by-one remainder vs remainderNear
-
-dqfma4000 fma -1234567890123456789012345678901233 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> -0.234567890123456789012345678901233
-dqfma4001 fma -1234567890123456789012345678901222 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> -0.34567890123456789012345678901222
-dqfma4002 fma -1234567890123456789012345678901111 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.4567890123456789012345678901111
-dqfma4003 fma -308641972530864197253086419725314 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> -1.308641972530864197253086419725314
-dqfma4004 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692
-dqfma4005 fma -246913578024691357802469135780252 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> -1.3086421975308642197530864219748
-dqfma4006 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247
-dqfma4007 fma -246913578024691357802469135780247 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> -0.753086421975308642197530864219753
-dqfma4008 fma -246913578024691357802469135780247 5.000000000000000000000000000000001 1234567890123456789012345678901234 -> -1.246913578024691357802469135780247
-dqfma4009 fma -246913578024691357802469135780246 5.00000000000000000000000000000001 1234567890123456789012345678901234 -> 1.53086421975308642197530864219754
-dqfma4010 fma -246913578024691357802469135780242 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.6913578024691357802469135780242
-dqfma4011 fma -1234567890123456789012345678901232 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> 0.765432109876543210987654321098768
-dqfma4012 fma -1234567890123456789012345678901221 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> 0.65432109876543210987654321098779
-dqfma4013 fma -1234567890123456789012345678901110 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> 0.5432109876543210987654321098890
-dqfma4014 fma -308641972530864197253086419725313 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> 2.691358027469135802746913580274687
-dqfma4015 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692
-dqfma4016 fma -246913578024691357802469135780251 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> 3.6913578024691357802469135780251
-dqfma4017 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247
-dqfma4018 fma -246913578024691357802469135780246 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> 4.246913578024691357802469135780246
-dqfma4019 fma -246913578024691357802469135780241 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> 4.3086421975308642197530864219759
-
--- Null tests
-dqadd39990 fma 1 10 # -> NaN Invalid_operation
-dqadd39991 fma 1 # 10 -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- dqFMA.decTest -- decQuad Fused Multiply Add --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- These tests comprese three parts:
+-- 1. Sanity checks and other three-operand tests (especially those
+-- where the fused operation makes a difference)
+-- 2. Multiply tests (third operand is neutral zero [0E+emax])
+-- 3. Addition tests (first operand is 1)
+-- The multiply and addition tests are extensive because FMA may have
+-- its own dedicated multiplication or addition routine(s), and they
+-- also inherently check the left-to-right properties.
+
+-- Sanity checks
+dqfma0001 fma 1 1 1 -> 2
+dqfma0002 fma 1 1 2 -> 3
+dqfma0003 fma 2 2 3 -> 7
+dqfma0004 fma 9 9 9 -> 90
+dqfma0005 fma -1 1 1 -> 0
+dqfma0006 fma -1 1 2 -> 1
+dqfma0007 fma -2 2 3 -> -1
+dqfma0008 fma -9 9 9 -> -72
+dqfma0011 fma 1 -1 1 -> 0
+dqfma0012 fma 1 -1 2 -> 1
+dqfma0013 fma 2 -2 3 -> -1
+dqfma0014 fma 9 -9 9 -> -72
+dqfma0015 fma 1 1 -1 -> 0
+dqfma0016 fma 1 1 -2 -> -1
+dqfma0017 fma 2 2 -3 -> 1
+dqfma0018 fma 9 9 -9 -> 72
+
+-- non-integer exacts
+dqfma0100 fma 25.2 63.6 -438 -> 1164.72
+dqfma0101 fma 0.301 0.380 334 -> 334.114380
+dqfma0102 fma 49.2 -4.8 23.3 -> -212.86
+dqfma0103 fma 4.22 0.079 -94.6 -> -94.26662
+dqfma0104 fma 903 0.797 0.887 -> 720.578
+dqfma0105 fma 6.13 -161 65.9 -> -921.03
+dqfma0106 fma 28.2 727 5.45 -> 20506.85
+dqfma0107 fma 4 605 688 -> 3108
+dqfma0108 fma 93.3 0.19 0.226 -> 17.953
+dqfma0109 fma 0.169 -341 5.61 -> -52.019
+dqfma0110 fma -72.2 30 -51.2 -> -2217.2
+dqfma0111 fma -0.409 13 20.4 -> 15.083
+dqfma0112 fma 317 77.0 19.0 -> 24428.0
+dqfma0113 fma 47 6.58 1.62 -> 310.88
+dqfma0114 fma 1.36 0.984 0.493 -> 1.83124
+dqfma0115 fma 72.7 274 1.56 -> 19921.36
+dqfma0116 fma 335 847 83 -> 283828
+dqfma0117 fma 666 0.247 25.4 -> 189.902
+dqfma0118 fma -3.87 3.06 78.0 -> 66.1578
+dqfma0119 fma 0.742 192 35.6 -> 178.064
+dqfma0120 fma -91.6 5.29 0.153 -> -484.411
+
+-- cases where result is different from separate multiply + add; each
+-- is preceded by the result of unfused multiply and add
+-- [this is about 20% of all similar cases in general]
+-- -> 4.500119002100000209469729375698778E+38
+dqfma0202 fma 68537985861355864457.5694 6565875762972086605.85969 35892634447236753.172812 -> 4.500119002100000209469729375698779E+38 Inexact Rounded
+-- -> 5.996248469584594346858881620185514E+41
+dqfma0208 fma 89261822344727628571.9 6717595845654131383336.89 5061036497288796076266.11 -> 5.996248469584594346858881620185513E+41 Inexact Rounded
+-- -> 1.899242968678256924021594770874070E+34
+dqfma0210 fma 320506237232448685.495971 59257597764017967.984448 3205615239077711589912.85 -> 1.899242968678256924021594770874071E+34 Inexact Rounded
+-- -> 7.078596978842809537929699954860309E+37
+dqfma0215 fma 220247843259112263.17995 321392340287987979002.80 47533279819997167655440 -> 7.078596978842809537929699954860308E+37 Inexact Rounded
+-- -> 1.224955667581427559754106862350743E+37
+dqfma0226 fma 23880729790368880412.1449 512947333827064719.55407 217117438419590824502.963 -> 1.224955667581427559754106862350744E+37 Inexact Rounded
+-- -> -2.530094043253148806272276368579144E+42
+dqfma0229 fma 2539892357016099706.4126 -996142232667504817717435 53682082598315949425.937 -> -2.530094043253148806272276368579143E+42 Inexact Rounded
+-- -> 1.713387085759711954319391412788454E+37
+dqfma0233 fma 4546339491341624464.0804 3768717864169205581 83578980278690395184.620 -> 1.713387085759711954319391412788453E+37 Inexact Rounded
+-- -> 4.062275663405823716411579117771547E+35
+dqfma0235 fma 409242119433816131.42253 992633815166741501.477249 70179636544416756129546 -> 4.062275663405823716411579117771548E+35 Inexact Rounded
+-- -> 6.002604327732568490562249875306823E+47
+dqfma0258 fma 817941336593541742159684 733867339769310729266598 78563844650942419311830.8 -> 6.002604327732568490562249875306822E+47 Inexact Rounded
+-- -> -2.027022514381452197510103395283874E+39
+dqfma0264 fma 387617310169161270.737532 -5229442703414956061216.62 57665666816652967150473.5 -> -2.027022514381452197510103395283873E+39 Inexact Rounded
+-- -> -7.856525039803554001144089842730361E+37
+dqfma0267 fma -847655845720565274701.210 92685316564117739.83984 22780950041376424429.5686 -> -7.856525039803554001144089842730360E+37 Inexact Rounded
+-- -> 1.695515562011520746125607502237559E+38
+dqfma0268 fma 21590290365127685.3675 7853139227576541379426.8 -3275859437236180.761544 -> 1.695515562011520746125607502237558E+38 Inexact Rounded
+-- -> -8.448422935783289219748115038014710E+38
+dqfma0269 fma -974320636272862697.971586 867109103641860247440.756 -9775170775902454762.98 -> -8.448422935783289219748115038014709E+38 Inexact Rounded
+
+-- Cases where multiply would overflow or underflow if separate
+dqfma0300 fma 9e+6144 10 0 -> Infinity Overflow Inexact Rounded
+dqfma0301 fma 1e+6144 10 0 -> Infinity Overflow Inexact Rounded
+dqfma0302 fma 1e+6144 10 -1e+6144 -> 9.000000000000000000000000000000000E+6144 Clamped
+dqfma0303 fma 1e+6144 10 -9e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped
+-- subnormal etc.
+dqfma0305 fma 1e-6176 0.1 0 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma0306 fma 1e-6176 0.1 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqfma0307 fma 1e-6176 0.1 1e-6176 -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+-- Infinite combinations
+dqfma0800 fma Inf Inf Inf -> Infinity
+dqfma0801 fma Inf Inf -Inf -> NaN Invalid_operation
+dqfma0802 fma Inf -Inf Inf -> NaN Invalid_operation
+dqfma0803 fma Inf -Inf -Inf -> -Infinity
+dqfma0804 fma -Inf Inf Inf -> NaN Invalid_operation
+dqfma0805 fma -Inf Inf -Inf -> -Infinity
+dqfma0806 fma -Inf -Inf Inf -> Infinity
+dqfma0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
+
+-- Triple NaN propagation
+dqfma0900 fma NaN2 NaN3 NaN5 -> NaN2
+dqfma0901 fma 0 NaN3 NaN5 -> NaN3
+dqfma0902 fma 0 0 NaN5 -> NaN5
+-- first sNaN wins (consider qNaN from earlier sNaN being
+-- overridden by an sNaN in third operand)
+dqfma0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+dqfma0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
+dqfma0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
+dqfma0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+dqfma0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
+dqfma0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
+
+-- MULTIPLICATION TESTS ------------------------------------------------
+rounding: half_even
+
+-- sanity checks
+dqfma2000 fma 2 2 0e+6144 -> 4
+dqfma2001 fma 2 3 0e+6144 -> 6
+dqfma2002 fma 5 1 0e+6144 -> 5
+dqfma2003 fma 5 2 0e+6144 -> 10
+dqfma2004 fma 1.20 2 0e+6144 -> 2.40
+dqfma2005 fma 1.20 0 0e+6144 -> 0.00
+dqfma2006 fma 1.20 -2 0e+6144 -> -2.40
+dqfma2007 fma -1.20 2 0e+6144 -> -2.40
+dqfma2008 fma -1.20 0 0e+6144 -> 0.00
+dqfma2009 fma -1.20 -2 0e+6144 -> 2.40
+dqfma2010 fma 5.09 7.1 0e+6144 -> 36.139
+dqfma2011 fma 2.5 4 0e+6144 -> 10.0
+dqfma2012 fma 2.50 4 0e+6144 -> 10.00
+dqfma2013 fma 1.23456789 1.0000000000000000000000000000 0e+6144 -> 1.234567890000000000000000000000000 Rounded
+dqfma2015 fma 2.50 4 0e+6144 -> 10.00
+dqfma2016 fma 9.99999999999999999 9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded
+dqfma2017 fma 9.99999999999999999 -9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded
+dqfma2018 fma -9.99999999999999999 9.99999999999999999 0e+6144 -> -99.99999999999999980000000000000000 Inexact Rounded
+dqfma2019 fma -9.99999999999999999 -9.99999999999999999 0e+6144 -> 99.99999999999999980000000000000000 Inexact Rounded
+
+-- zeros, etc.
+dqfma2021 fma 0 0 0e+6144 -> 0
+dqfma2022 fma 0 -0 0e+6144 -> 0
+dqfma2023 fma -0 0 0e+6144 -> 0
+dqfma2024 fma -0 -0 0e+6144 -> 0
+dqfma2025 fma -0.0 -0.0 0e+6144 -> 0.00
+dqfma2026 fma -0.0 -0.0 0e+6144 -> 0.00
+dqfma2027 fma -0.0 -0.0 0e+6144 -> 0.00
+dqfma2028 fma -0.0 -0.0 0e+6144 -> 0.00
+dqfma2030 fma 5.00 1E-3 0e+6144 -> 0.00500
+dqfma2031 fma 00.00 0.000 0e+6144 -> 0.00000
+dqfma2032 fma 00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0
+dqfma2033 fma 0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0
+dqfma2034 fma -5.00 1E-3 0e+6144 -> -0.00500
+dqfma2035 fma -00.00 0.000 0e+6144 -> 0.00000
+dqfma2036 fma -00.00 0E-3 0e+6144 -> 0.00000 -- rhs is 0
+dqfma2037 fma -0E-3 00.00 0e+6144 -> 0.00000 -- lhs is 0
+dqfma2038 fma 5.00 -1E-3 0e+6144 -> -0.00500
+dqfma2039 fma 00.00 -0.000 0e+6144 -> 0.00000
+dqfma2040 fma 00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0
+dqfma2041 fma 0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0
+dqfma2042 fma -5.00 -1E-3 0e+6144 -> 0.00500
+dqfma2043 fma -00.00 -0.000 0e+6144 -> 0.00000
+dqfma2044 fma -00.00 -0E-3 0e+6144 -> 0.00000 -- rhs is 0
+dqfma2045 fma -0E-3 -00.00 0e+6144 -> 0.00000 -- lhs is 0
+
+-- examples from decarith
+dqfma2050 fma 1.20 3 0e+6144 -> 3.60
+dqfma2051 fma 7 3 0e+6144 -> 21
+dqfma2052 fma 0.9 0.8 0e+6144 -> 0.72
+dqfma2053 fma 0.9 -0 0e+6144 -> 0.0
+dqfma2054 fma 654321 654321 0e+6144 -> 428135971041
+
+dqfma2060 fma 123.45 1e7 0e+6144 -> 1.2345E+9
+dqfma2061 fma 123.45 1e8 0e+6144 -> 1.2345E+10
+dqfma2062 fma 123.45 1e+9 0e+6144 -> 1.2345E+11
+dqfma2063 fma 123.45 1e10 0e+6144 -> 1.2345E+12
+dqfma2064 fma 123.45 1e11 0e+6144 -> 1.2345E+13
+dqfma2065 fma 123.45 1e12 0e+6144 -> 1.2345E+14
+dqfma2066 fma 123.45 1e13 0e+6144 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+-- 1234567890123456
+dqfma2080 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9
+dqfma2084 fma 0.1 1230123456456789 0e+6144 -> 123012345645678.9
+dqfma2090 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9
+dqfma2094 fma 1230123456456789 0.1 0e+6144 -> 123012345645678.9
+
+-- test some more edge cases and carries
+dqfma2101 fma 9 9 0e+6144 -> 81
+dqfma2102 fma 9 90 0e+6144 -> 810
+dqfma2103 fma 9 900 0e+6144 -> 8100
+dqfma2104 fma 9 9000 0e+6144 -> 81000
+dqfma2105 fma 9 90000 0e+6144 -> 810000
+dqfma2106 fma 9 900000 0e+6144 -> 8100000
+dqfma2107 fma 9 9000000 0e+6144 -> 81000000
+dqfma2108 fma 9 90000000 0e+6144 -> 810000000
+dqfma2109 fma 9 900000000 0e+6144 -> 8100000000
+dqfma2110 fma 9 9000000000 0e+6144 -> 81000000000
+dqfma2111 fma 9 90000000000 0e+6144 -> 810000000000
+dqfma2112 fma 9 900000000000 0e+6144 -> 8100000000000
+dqfma2113 fma 9 9000000000000 0e+6144 -> 81000000000000
+dqfma2114 fma 9 90000000000000 0e+6144 -> 810000000000000
+dqfma2115 fma 9 900000000000000 0e+6144 -> 8100000000000000
+--dqfma2116 fma 9 9000000000000000 0e+6144 -> 81000000000000000
+--dqfma2117 fma 9 90000000000000000 0e+6144 -> 810000000000000000
+--dqfma2118 fma 9 900000000000000000 0e+6144 -> 8100000000000000000
+--dqfma2119 fma 9 9000000000000000000 0e+6144 -> 81000000000000000000
+--dqfma2120 fma 9 90000000000000000000 0e+6144 -> 810000000000000000000
+--dqfma2121 fma 9 900000000000000000000 0e+6144 -> 8100000000000000000000
+--dqfma2122 fma 9 9000000000000000000000 0e+6144 -> 81000000000000000000000
+--dqfma2123 fma 9 90000000000000000000000 0e+6144 -> 810000000000000000000000
+-- test some more edge cases without carries
+dqfma2131 fma 3 3 0e+6144 -> 9
+dqfma2132 fma 3 30 0e+6144 -> 90
+dqfma2133 fma 3 300 0e+6144 -> 900
+dqfma2134 fma 3 3000 0e+6144 -> 9000
+dqfma2135 fma 3 30000 0e+6144 -> 90000
+dqfma2136 fma 3 300000 0e+6144 -> 900000
+dqfma2137 fma 3 3000000 0e+6144 -> 9000000
+dqfma2138 fma 3 30000000 0e+6144 -> 90000000
+dqfma2139 fma 3 300000000 0e+6144 -> 900000000
+dqfma2140 fma 3 3000000000 0e+6144 -> 9000000000
+dqfma2141 fma 3 30000000000 0e+6144 -> 90000000000
+dqfma2142 fma 3 300000000000 0e+6144 -> 900000000000
+dqfma2143 fma 3 3000000000000 0e+6144 -> 9000000000000
+dqfma2144 fma 3 30000000000000 0e+6144 -> 90000000000000
+dqfma2145 fma 3 300000000000000 0e+6144 -> 900000000000000
+dqfma2146 fma 3 3000000000000000 0e+6144 -> 9000000000000000
+dqfma2147 fma 3 30000000000000000 0e+6144 -> 90000000000000000
+dqfma2148 fma 3 300000000000000000 0e+6144 -> 900000000000000000
+dqfma2149 fma 3 3000000000000000000 0e+6144 -> 9000000000000000000
+dqfma2150 fma 3 30000000000000000000 0e+6144 -> 90000000000000000000
+dqfma2151 fma 3 300000000000000000000 0e+6144 -> 900000000000000000000
+dqfma2152 fma 3 3000000000000000000000 0e+6144 -> 9000000000000000000000
+dqfma2153 fma 3 30000000000000000000000 0e+6144 -> 90000000000000000000000
+
+dqfma2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0e+6144 -> 145433.2908011933696719165119928296 Inexact Rounded
+
+-- test some edge cases with exact rounding
+dqfma2301 fma 900000000000000000 9 0e+6144 -> 8100000000000000000
+dqfma2302 fma 900000000000000000 90 0e+6144 -> 81000000000000000000
+dqfma2303 fma 900000000000000000 900 0e+6144 -> 810000000000000000000
+dqfma2304 fma 900000000000000000 9000 0e+6144 -> 8100000000000000000000
+dqfma2305 fma 900000000000000000 90000 0e+6144 -> 81000000000000000000000
+dqfma2306 fma 900000000000000000 900000 0e+6144 -> 810000000000000000000000
+dqfma2307 fma 900000000000000000 9000000 0e+6144 -> 8100000000000000000000000
+dqfma2308 fma 900000000000000000 90000000 0e+6144 -> 81000000000000000000000000
+dqfma2309 fma 900000000000000000 900000000 0e+6144 -> 810000000000000000000000000
+dqfma2310 fma 900000000000000000 9000000000 0e+6144 -> 8100000000000000000000000000
+dqfma2311 fma 900000000000000000 90000000000 0e+6144 -> 81000000000000000000000000000
+dqfma2312 fma 900000000000000000 900000000000 0e+6144 -> 810000000000000000000000000000
+dqfma2313 fma 900000000000000000 9000000000000 0e+6144 -> 8100000000000000000000000000000
+dqfma2314 fma 900000000000000000 90000000000000 0e+6144 -> 81000000000000000000000000000000
+dqfma2315 fma 900000000000000000 900000000000000 0e+6144 -> 810000000000000000000000000000000
+dqfma2316 fma 900000000000000000 9000000000000000 0e+6144 -> 8100000000000000000000000000000000
+dqfma2317 fma 9000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+34 Rounded
+dqfma2318 fma 90000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+35 Rounded
+dqfma2319 fma 900000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+36 Rounded
+dqfma2320 fma 9000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+37 Rounded
+dqfma2321 fma 90000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+38 Rounded
+dqfma2322 fma 900000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+39 Rounded
+dqfma2323 fma 9000000000000000000000000 9000000000000000 0e+6144 -> 8.100000000000000000000000000000000E+40 Rounded
+
+-- tryzeros cases
+dqfma2504 fma 0E-4260 1000E-4260 0e+6144 -> 0E-6176 Clamped
+dqfma2505 fma 100E+4260 0E+4260 0e+6144 -> 0E+6111 Clamped
+
+-- mixed with zeros
+dqfma2541 fma 0 -1 0e+6144 -> 0
+dqfma2542 fma -0 -1 0e+6144 -> 0
+dqfma2543 fma 0 1 0e+6144 -> 0
+dqfma2544 fma -0 1 0e+6144 -> 0
+dqfma2545 fma -1 0 0e+6144 -> 0
+dqfma2546 fma -1 -0 0e+6144 -> 0
+dqfma2547 fma 1 0 0e+6144 -> 0
+dqfma2548 fma 1 -0 0e+6144 -> 0
+
+dqfma2551 fma 0.0 -1 0e+6144 -> 0.0
+dqfma2552 fma -0.0 -1 0e+6144 -> 0.0
+dqfma2553 fma 0.0 1 0e+6144 -> 0.0
+dqfma2554 fma -0.0 1 0e+6144 -> 0.0
+dqfma2555 fma -1.0 0 0e+6144 -> 0.0
+dqfma2556 fma -1.0 -0 0e+6144 -> 0.0
+dqfma2557 fma 1.0 0 0e+6144 -> 0.0
+dqfma2558 fma 1.0 -0 0e+6144 -> 0.0
+
+dqfma2561 fma 0 -1.0 0e+6144 -> 0.0
+dqfma2562 fma -0 -1.0 0e+6144 -> 0.0
+dqfma2563 fma 0 1.0 0e+6144 -> 0.0
+dqfma2564 fma -0 1.0 0e+6144 -> 0.0
+dqfma2565 fma -1 0.0 0e+6144 -> 0.0
+dqfma2566 fma -1 -0.0 0e+6144 -> 0.0
+dqfma2567 fma 1 0.0 0e+6144 -> 0.0
+dqfma2568 fma 1 -0.0 0e+6144 -> 0.0
+
+dqfma2571 fma 0.0 -1.0 0e+6144 -> 0.00
+dqfma2572 fma -0.0 -1.0 0e+6144 -> 0.00
+dqfma2573 fma 0.0 1.0 0e+6144 -> 0.00
+dqfma2574 fma -0.0 1.0 0e+6144 -> 0.00
+dqfma2575 fma -1.0 0.0 0e+6144 -> 0.00
+dqfma2576 fma -1.0 -0.0 0e+6144 -> 0.00
+dqfma2577 fma 1.0 0.0 0e+6144 -> 0.00
+dqfma2578 fma 1.0 -0.0 0e+6144 -> 0.00
+dqfma2579 fma 1.0 0.0 0e+6144 -> 0.00
+dqfma2530 fma -1.0 -0.0 0e+6144 -> 0.00
+dqfma2531 fma -1.0 0.0 0e+6144 -> 0.00
+dqfma2532 fma 1.0 -0.0 -0e+6144 -> -0.00
+dqfma2533 fma 1.0 0.0 -0e+6144 -> 0.00
+dqfma2534 fma -1.0 -0.0 -0e+6144 -> 0.00
+dqfma2535 fma -1.0 0.0 -0e+6144 -> -0.00
+
+
+-- Specials
+dqfma2580 fma Inf -Inf 0e+6144 -> -Infinity
+dqfma2581 fma Inf -1000 0e+6144 -> -Infinity
+dqfma2582 fma Inf -1 0e+6144 -> -Infinity
+dqfma2583 fma Inf -0 0e+6144 -> NaN Invalid_operation
+dqfma2584 fma Inf 0 0e+6144 -> NaN Invalid_operation
+dqfma2585 fma Inf 1 0e+6144 -> Infinity
+dqfma2586 fma Inf 1000 0e+6144 -> Infinity
+dqfma2587 fma Inf Inf 0e+6144 -> Infinity
+dqfma2588 fma -1000 Inf 0e+6144 -> -Infinity
+dqfma2589 fma -Inf Inf 0e+6144 -> -Infinity
+dqfma2590 fma -1 Inf 0e+6144 -> -Infinity
+dqfma2591 fma -0 Inf 0e+6144 -> NaN Invalid_operation
+dqfma2592 fma 0 Inf 0e+6144 -> NaN Invalid_operation
+dqfma2593 fma 1 Inf 0e+6144 -> Infinity
+dqfma2594 fma 1000 Inf 0e+6144 -> Infinity
+dqfma2595 fma Inf Inf 0e+6144 -> Infinity
+
+dqfma2600 fma -Inf -Inf 0e+6144 -> Infinity
+dqfma2601 fma -Inf -1000 0e+6144 -> Infinity
+dqfma2602 fma -Inf -1 0e+6144 -> Infinity
+dqfma2603 fma -Inf -0 0e+6144 -> NaN Invalid_operation
+dqfma2604 fma -Inf 0 0e+6144 -> NaN Invalid_operation
+dqfma2605 fma -Inf 1 0e+6144 -> -Infinity
+dqfma2606 fma -Inf 1000 0e+6144 -> -Infinity
+dqfma2607 fma -Inf Inf 0e+6144 -> -Infinity
+dqfma2608 fma -1000 Inf 0e+6144 -> -Infinity
+dqfma2609 fma -Inf -Inf 0e+6144 -> Infinity
+dqfma2610 fma -1 -Inf 0e+6144 -> Infinity
+dqfma2611 fma -0 -Inf 0e+6144 -> NaN Invalid_operation
+dqfma2612 fma 0 -Inf 0e+6144 -> NaN Invalid_operation
+dqfma2613 fma 1 -Inf 0e+6144 -> -Infinity
+dqfma2614 fma 1000 -Inf 0e+6144 -> -Infinity
+dqfma2615 fma Inf -Inf 0e+6144 -> -Infinity
+
+dqfma2621 fma NaN -Inf 0e+6144 -> NaN
+dqfma2622 fma NaN -1000 0e+6144 -> NaN
+dqfma2623 fma NaN -1 0e+6144 -> NaN
+dqfma2624 fma NaN -0 0e+6144 -> NaN
+dqfma2625 fma NaN 0 0e+6144 -> NaN
+dqfma2626 fma NaN 1 0e+6144 -> NaN
+dqfma2627 fma NaN 1000 0e+6144 -> NaN
+dqfma2628 fma NaN Inf 0e+6144 -> NaN
+dqfma2629 fma NaN NaN 0e+6144 -> NaN
+dqfma2630 fma -Inf NaN 0e+6144 -> NaN
+dqfma2631 fma -1000 NaN 0e+6144 -> NaN
+dqfma2632 fma -1 NaN 0e+6144 -> NaN
+dqfma2633 fma -0 NaN 0e+6144 -> NaN
+dqfma2634 fma 0 NaN 0e+6144 -> NaN
+dqfma2635 fma 1 NaN 0e+6144 -> NaN
+dqfma2636 fma 1000 NaN 0e+6144 -> NaN
+dqfma2637 fma Inf NaN 0e+6144 -> NaN
+
+dqfma2641 fma sNaN -Inf 0e+6144 -> NaN Invalid_operation
+dqfma2642 fma sNaN -1000 0e+6144 -> NaN Invalid_operation
+dqfma2643 fma sNaN -1 0e+6144 -> NaN Invalid_operation
+dqfma2644 fma sNaN -0 0e+6144 -> NaN Invalid_operation
+dqfma2645 fma sNaN 0 0e+6144 -> NaN Invalid_operation
+dqfma2646 fma sNaN 1 0e+6144 -> NaN Invalid_operation
+dqfma2647 fma sNaN 1000 0e+6144 -> NaN Invalid_operation
+dqfma2648 fma sNaN NaN 0e+6144 -> NaN Invalid_operation
+dqfma2649 fma sNaN sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2650 fma NaN sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2651 fma -Inf sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2652 fma -1000 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2653 fma -1 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2654 fma -0 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2655 fma 0 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2656 fma 1 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2657 fma 1000 sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2658 fma Inf sNaN 0e+6144 -> NaN Invalid_operation
+dqfma2659 fma NaN sNaN 0e+6144 -> NaN Invalid_operation
+
+-- propagating NaNs
+dqfma2661 fma NaN9 -Inf 0e+6144 -> NaN9
+dqfma2662 fma NaN8 999 0e+6144 -> NaN8
+dqfma2663 fma NaN71 Inf 0e+6144 -> NaN71
+dqfma2664 fma NaN6 NaN5 0e+6144 -> NaN6
+dqfma2665 fma -Inf NaN4 0e+6144 -> NaN4
+dqfma2666 fma -999 NaN33 0e+6144 -> NaN33
+dqfma2667 fma Inf NaN2 0e+6144 -> NaN2
+
+dqfma2671 fma sNaN99 -Inf 0e+6144 -> NaN99 Invalid_operation
+dqfma2672 fma sNaN98 -11 0e+6144 -> NaN98 Invalid_operation
+dqfma2673 fma sNaN97 NaN 0e+6144 -> NaN97 Invalid_operation
+dqfma2674 fma sNaN16 sNaN94 0e+6144 -> NaN16 Invalid_operation
+dqfma2675 fma NaN95 sNaN93 0e+6144 -> NaN93 Invalid_operation
+dqfma2676 fma -Inf sNaN92 0e+6144 -> NaN92 Invalid_operation
+dqfma2677 fma 088 sNaN91 0e+6144 -> NaN91 Invalid_operation
+dqfma2678 fma Inf sNaN90 0e+6144 -> NaN90 Invalid_operation
+dqfma2679 fma NaN sNaN89 0e+6144 -> NaN89 Invalid_operation
+
+dqfma2681 fma -NaN9 -Inf 0e+6144 -> -NaN9
+dqfma2682 fma -NaN8 999 0e+6144 -> -NaN8
+dqfma2683 fma -NaN71 Inf 0e+6144 -> -NaN71
+dqfma2684 fma -NaN6 -NaN5 0e+6144 -> -NaN6
+dqfma2685 fma -Inf -NaN4 0e+6144 -> -NaN4
+dqfma2686 fma -999 -NaN33 0e+6144 -> -NaN33
+dqfma2687 fma Inf -NaN2 0e+6144 -> -NaN2
+
+dqfma2691 fma -sNaN99 -Inf 0e+6144 -> -NaN99 Invalid_operation
+dqfma2692 fma -sNaN98 -11 0e+6144 -> -NaN98 Invalid_operation
+dqfma2693 fma -sNaN97 NaN 0e+6144 -> -NaN97 Invalid_operation
+dqfma2694 fma -sNaN16 -sNaN94 0e+6144 -> -NaN16 Invalid_operation
+dqfma2695 fma -NaN95 -sNaN93 0e+6144 -> -NaN93 Invalid_operation
+dqfma2696 fma -Inf -sNaN92 0e+6144 -> -NaN92 Invalid_operation
+dqfma2697 fma 088 -sNaN91 0e+6144 -> -NaN91 Invalid_operation
+dqfma2698 fma Inf -sNaN90 0e+6144 -> -NaN90 Invalid_operation
+dqfma2699 fma -NaN -sNaN89 0e+6144 -> -NaN89 Invalid_operation
+
+dqfma2701 fma -NaN -Inf 0e+6144 -> -NaN
+dqfma2702 fma -NaN 999 0e+6144 -> -NaN
+dqfma2703 fma -NaN Inf 0e+6144 -> -NaN
+dqfma2704 fma -NaN -NaN 0e+6144 -> -NaN
+dqfma2705 fma -Inf -NaN0 0e+6144 -> -NaN
+dqfma2706 fma -999 -NaN 0e+6144 -> -NaN
+dqfma2707 fma Inf -NaN 0e+6144 -> -NaN
+
+dqfma2711 fma -sNaN -Inf 0e+6144 -> -NaN Invalid_operation
+dqfma2712 fma -sNaN -11 0e+6144 -> -NaN Invalid_operation
+dqfma2713 fma -sNaN00 NaN 0e+6144 -> -NaN Invalid_operation
+dqfma2714 fma -sNaN -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2715 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2716 fma -Inf -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2717 fma 088 -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2718 fma Inf -sNaN 0e+6144 -> -NaN Invalid_operation
+dqfma2719 fma -NaN -sNaN 0e+6144 -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+dqfma2751 fma 1e+4277 1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2752 fma 1e+4277 -1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded
+dqfma2753 fma -1e+4277 1e+3311 0e+6144 -> -Infinity Overflow Inexact Rounded
+dqfma2754 fma -1e+4277 -1e+3311 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2755 fma 1e-4277 1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2756 fma 1e-4277 -1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2757 fma -1e-4277 1e-3311 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2758 fma -1e-4277 -1e-3311 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dqfma2760 fma 1e-6069 1e-101 0e+6144 -> 1E-6170 Subnormal
+dqfma2761 fma 1e-6069 1e-102 0e+6144 -> 1E-6171 Subnormal
+dqfma2762 fma 1e-6069 1e-103 0e+6144 -> 1E-6172 Subnormal
+dqfma2763 fma 1e-6069 1e-104 0e+6144 -> 1E-6173 Subnormal
+dqfma2764 fma 1e-6069 1e-105 0e+6144 -> 1E-6174 Subnormal
+dqfma2765 fma 1e-6069 1e-106 0e+6144 -> 1E-6175 Subnormal
+dqfma2766 fma 1e-6069 1e-107 0e+6144 -> 1E-6176 Subnormal
+dqfma2767 fma 1e-6069 1e-108 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2768 fma 1e-6069 1e-109 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2769 fma 1e-6069 1e-110 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+dqfma2770 fma 1e+40 1e+6101 0e+6144 -> 1.000000000000000000000000000000E+6141 Clamped
+dqfma2771 fma 1e+40 1e+6102 0e+6144 -> 1.0000000000000000000000000000000E+6142 Clamped
+dqfma2772 fma 1e+40 1e+6103 0e+6144 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqfma2773 fma 1e+40 1e+6104 0e+6144 -> 1.000000000000000000000000000000000E+6144 Clamped
+dqfma2774 fma 1e+40 1e+6105 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2775 fma 1e+40 1e+6106 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2776 fma 1e+40 1e+6107 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2777 fma 1e+40 1e+6108 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2778 fma 1e+40 1e+6109 0e+6144 -> Infinity Overflow Inexact Rounded
+dqfma2779 fma 1e+40 1e+6110 0e+6144 -> Infinity Overflow Inexact Rounded
+
+dqfma2801 fma 1.0000E-6172 1 0e+6144 -> 1.0000E-6172 Subnormal
+dqfma2802 fma 1.000E-6172 1e-1 0e+6144 -> 1.000E-6173 Subnormal
+dqfma2803 fma 1.00E-6172 1e-2 0e+6144 -> 1.00E-6174 Subnormal
+dqfma2804 fma 1.0E-6172 1e-3 0e+6144 -> 1.0E-6175 Subnormal
+dqfma2805 fma 1.0E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal Rounded
+dqfma2806 fma 1.3E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2807 fma 1.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2808 fma 1.7E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2809 fma 2.3E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2810 fma 2.5E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2811 fma 2.7E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqfma2812 fma 1.49E-6172 1e-4 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2813 fma 1.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2814 fma 1.51E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2815 fma 2.49E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2816 fma 2.50E-6172 1e-4 0e+6144 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqfma2817 fma 2.51E-6172 1e-4 0e+6144 -> 3E-6176 Underflow Subnormal Inexact Rounded
+
+dqfma2818 fma 1E-6172 1e-4 0e+6144 -> 1E-6176 Subnormal
+dqfma2819 fma 3E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2820 fma 5E-6172 1e-5 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2821 fma 7E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2822 fma 9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2823 fma 9.9E-6172 1e-5 0e+6144 -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+dqfma2824 fma 1E-6172 -1e-4 0e+6144 -> -1E-6176 Subnormal
+dqfma2825 fma 3E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2826 fma -5E-6172 1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2827 fma 7E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2828 fma -9E-6172 1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2829 fma 9.9E-6172 -1e-5 0e+6144 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqfma2830 fma 3.0E-6172 -1e-5 0e+6144 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqfma2831 fma 1.0E-5977 1e-200 0e+6144 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqfma2832 fma 1.0E-5977 1e-199 0e+6144 -> 1E-6176 Subnormal Rounded
+dqfma2833 fma 1.0E-5977 1e-198 0e+6144 -> 1.0E-6175 Subnormal
+dqfma2834 fma 2.0E-5977 2e-198 0e+6144 -> 4.0E-6175 Subnormal
+dqfma2835 fma 4.0E-5977 4e-198 0e+6144 -> 1.60E-6174 Subnormal
+dqfma2836 fma 10.0E-5977 10e-198 0e+6144 -> 1.000E-6173 Subnormal
+dqfma2837 fma 30.0E-5977 30e-198 0e+6144 -> 9.000E-6173 Subnormal
+dqfma2838 fma 40.0E-5982 40e-166 0e+6144 -> 1.6000E-6145 Subnormal
+dqfma2839 fma 40.0E-5982 40e-165 0e+6144 -> 1.6000E-6144 Subnormal
+dqfma2840 fma 40.0E-5982 40e-164 0e+6144 -> 1.6000E-6143
+
+-- Long operand overflow may be a different path
+dqfma2870 fma 100 9.999E+6143 0e+6144 -> Infinity Inexact Overflow Rounded
+dqfma2871 fma 100 -9.999E+6143 0e+6144 -> -Infinity Inexact Overflow Rounded
+dqfma2872 fma 9.999E+6143 100 0e+6144 -> Infinity Inexact Overflow Rounded
+dqfma2873 fma -9.999E+6143 100 0e+6144 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+dqfma2881 fma 1.2347E-6133 1.2347E-40 0e+6144 -> 1.524E-6173 Inexact Rounded Subnormal Underflow
+dqfma2882 fma 1.234E-6133 1.234E-40 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqfma2883 fma 1.23E-6133 1.23E-40 0e+6144 -> 1.513E-6173 Inexact Rounded Subnormal Underflow
+dqfma2884 fma 1.2E-6133 1.2E-40 0e+6144 -> 1.44E-6173 Subnormal
+dqfma2885 fma 1.2E-6133 1.2E-41 0e+6144 -> 1.44E-6174 Subnormal
+dqfma2886 fma 1.2E-6133 1.2E-42 0e+6144 -> 1.4E-6175 Subnormal Inexact Rounded Underflow
+dqfma2887 fma 1.2E-6133 1.3E-42 0e+6144 -> 1.6E-6175 Subnormal Inexact Rounded Underflow
+dqfma2888 fma 1.3E-6133 1.3E-42 0e+6144 -> 1.7E-6175 Subnormal Inexact Rounded Underflow
+dqfma2889 fma 1.3E-6133 1.3E-43 0e+6144 -> 2E-6176 Subnormal Inexact Rounded Underflow
+dqfma2890 fma 1.3E-6134 1.3E-43 0e+6144 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow
+
+dqfma2891 fma 1.2345E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
+dqfma2892 fma 1.23456E-39 1.234E-6133 0e+6144 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
+dqfma2893 fma 1.2345E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqfma2894 fma 1.23456E-40 1.234E-6133 0e+6144 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqfma2895 fma 1.2345E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
+dqfma2896 fma 1.23456E-41 1.234E-6133 0e+6144 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+-- prove operands are exact
+dqfma2906 fma 9.999999999999999999999999999999999E-6143 1 0e+6144 -> 9.999999999999999999999999999999999E-6143
+dqfma2907 fma 1 0.09999999999999999999999999999999999 0e+6144 -> 0.09999999999999999999999999999999999
+-- the next rounds to Nmin
+dqfma2908 fma 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 0e+6144 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded
+
+-- hugest
+dqfma2909 fma 9999999999999999999999999999999999 9999999999999999999999999999999999 0e+6144 -> 9.999999999999999999999999999999998E+67 Inexact Rounded
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+dqfma21001 fma 130E-2 120E-2 0e+6144 -> 1.5600
+dqfma21002 fma 130E-2 12E-1 0e+6144 -> 1.560
+dqfma21003 fma 130E-2 1E0 0e+6144 -> 1.30
+dqfma21004 fma 1E2 1E4 0e+6144 -> 1E+6
+
+-- Null tests
+dqfma2990 fma 10 # 0e+6144 -> NaN Invalid_operation
+dqfma2991 fma # 10 0e+6144 -> NaN Invalid_operation
+
+
+-- ADDITION TESTS ------------------------------------------------------
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+dqadd3001 fma 1 1 1 -> 2
+dqadd3002 fma 1 2 3 -> 5
+dqadd3003 fma 1 '5.75' '3.3' -> 9.05
+dqadd3004 fma 1 '5' '-3' -> 2
+dqadd3005 fma 1 '-5' '-3' -> -8
+dqadd3006 fma 1 '-7' '2.5' -> -4.5
+dqadd3007 fma 1 '0.7' '0.3' -> 1.0
+dqadd3008 fma 1 '1.25' '1.25' -> 2.50
+dqadd3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
+dqadd3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
+
+-- 1234567890123456 1234567890123456
+dqadd3011 fma 1 '0.4444444444444444444444444444444446' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqadd3012 fma 1 '0.4444444444444444444444444444444445' '0.5555555555555555555555555555555555' -> '1.000000000000000000000000000000000' Rounded
+dqadd3013 fma 1 '0.4444444444444444444444444444444444' '0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
+dqadd3014 fma 1 '4444444444444444444444444444444444' '0.49' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd3015 fma 1 '4444444444444444444444444444444444' '0.499' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd3016 fma 1 '4444444444444444444444444444444444' '0.4999' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd3017 fma 1 '4444444444444444444444444444444444' '0.5000' -> '4444444444444444444444444444444444' Inexact Rounded
+dqadd3018 fma 1 '4444444444444444444444444444444444' '0.5001' -> '4444444444444444444444444444444445' Inexact Rounded
+dqadd3019 fma 1 '4444444444444444444444444444444444' '0.501' -> '4444444444444444444444444444444445' Inexact Rounded
+dqadd3020 fma 1 '4444444444444444444444444444444444' '0.51' -> '4444444444444444444444444444444445' Inexact Rounded
+
+dqadd3021 fma 1 0 1 -> 1
+dqadd3022 fma 1 1 1 -> 2
+dqadd3023 fma 1 2 1 -> 3
+dqadd3024 fma 1 3 1 -> 4
+dqadd3025 fma 1 4 1 -> 5
+dqadd3026 fma 1 5 1 -> 6
+dqadd3027 fma 1 6 1 -> 7
+dqadd3028 fma 1 7 1 -> 8
+dqadd3029 fma 1 8 1 -> 9
+dqadd3030 fma 1 9 1 -> 10
+
+-- some carrying effects
+dqadd3031 fma 1 '0.9998' '0.0000' -> '0.9998'
+dqadd3032 fma 1 '0.9998' '0.0001' -> '0.9999'
+dqadd3033 fma 1 '0.9998' '0.0002' -> '1.0000'
+dqadd3034 fma 1 '0.9998' '0.0003' -> '1.0001'
+
+dqadd3035 fma 1 '70' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3036 fma 1 '700' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3037 fma 1 '7000' '10000e+34' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3038 fma 1 '70000' '10000e+34' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
+dqadd3039 fma 1 '700000' '10000e+34' -> '1.000000000000000000000000000000007E+38' Rounded
+
+-- symmetry:
+dqadd3040 fma 1 '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3041 fma 1 '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3042 fma 1 '10000e+34' '7000' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqadd3044 fma 1 '10000e+34' '70000' -> '1.000000000000000000000000000000001E+38' Inexact Rounded
+dqadd3045 fma 1 '10000e+34' '700000' -> '1.000000000000000000000000000000007E+38' Rounded
+
+-- same, without rounding
+dqadd3046 fma 1 '10000e+9' '7' -> '10000000000007'
+dqadd3047 fma 1 '10000e+9' '70' -> '10000000000070'
+dqadd3048 fma 1 '10000e+9' '700' -> '10000000000700'
+dqadd3049 fma 1 '10000e+9' '7000' -> '10000000007000'
+dqadd3050 fma 1 '10000e+9' '70000' -> '10000000070000'
+dqadd3051 fma 1 '10000e+9' '700000' -> '10000000700000'
+dqadd3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+dqadd3053 fma 1 '12' '7.00' -> '19.00'
+dqadd3054 fma 1 '1.3' '-1.07' -> '0.23'
+dqadd3055 fma 1 '1.3' '-1.30' -> '0.00'
+dqadd3056 fma 1 '1.3' '-2.07' -> '-0.77'
+dqadd3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
+
+-- leading zero preservation
+dqadd3061 fma 1 1 '0.0001' -> '1.0001'
+dqadd3062 fma 1 1 '0.00001' -> '1.00001'
+dqadd3063 fma 1 1 '0.000001' -> '1.000001'
+dqadd3064 fma 1 1 '0.0000001' -> '1.0000001'
+dqadd3065 fma 1 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+dqadd3070 fma 1 1 0 -> 1
+dqadd3071 fma 1 1 0. -> 1
+dqadd3072 fma 1 1 .0 -> 1.0
+dqadd3073 fma 1 1 0.0 -> 1.0
+dqadd3074 fma 1 1 0.00 -> 1.00
+dqadd3075 fma 1 0 1 -> 1
+dqadd3076 fma 1 0. 1 -> 1
+dqadd3077 fma 1 .0 1 -> 1.0
+dqadd3078 fma 1 0.0 1 -> 1.0
+dqadd3079 fma 1 0.00 1 -> 1.00
+
+-- some carries
+dqadd3080 fma 1 999999998 1 -> 999999999
+dqadd3081 fma 1 999999999 1 -> 1000000000
+dqadd3082 fma 1 99999999 1 -> 100000000
+dqadd3083 fma 1 9999999 1 -> 10000000
+dqadd3084 fma 1 999999 1 -> 1000000
+dqadd3085 fma 1 99999 1 -> 100000
+dqadd3086 fma 1 9999 1 -> 10000
+dqadd3087 fma 1 999 1 -> 1000
+dqadd3088 fma 1 99 1 -> 100
+dqadd3089 fma 1 9 1 -> 10
+
+
+-- more LHS swaps
+dqadd3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
+dqadd3091 fma 1 '-56267E-6' 0 -> '-0.056267'
+dqadd3092 fma 1 '-56267E-5' 0 -> '-0.56267'
+dqadd3093 fma 1 '-56267E-4' 0 -> '-5.6267'
+dqadd3094 fma 1 '-56267E-3' 0 -> '-56.267'
+dqadd3095 fma 1 '-56267E-2' 0 -> '-562.67'
+dqadd3096 fma 1 '-56267E-1' 0 -> '-5626.7'
+dqadd3097 fma 1 '-56267E-0' 0 -> '-56267'
+dqadd3098 fma 1 '-5E-10' 0 -> '-5E-10'
+dqadd3099 fma 1 '-5E-7' 0 -> '-5E-7'
+dqadd3100 fma 1 '-5E-6' 0 -> '-0.000005'
+dqadd3101 fma 1 '-5E-5' 0 -> '-0.00005'
+dqadd3102 fma 1 '-5E-4' 0 -> '-0.0005'
+dqadd3103 fma 1 '-5E-1' 0 -> '-0.5'
+dqadd3104 fma 1 '-5E0' 0 -> '-5'
+dqadd3105 fma 1 '-5E1' 0 -> '-50'
+dqadd3106 fma 1 '-5E5' 0 -> '-500000'
+dqadd3107 fma 1 '-5E33' 0 -> '-5000000000000000000000000000000000'
+dqadd3108 fma 1 '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
+dqadd3109 fma 1 '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
+dqadd3110 fma 1 '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
+dqadd3111 fma 1 '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- more RHS swaps
+dqadd3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
+dqadd3114 fma 1 0 '-56267E-6' -> '-0.056267'
+dqadd3116 fma 1 0 '-56267E-5' -> '-0.56267'
+dqadd3117 fma 1 0 '-56267E-4' -> '-5.6267'
+dqadd3119 fma 1 0 '-56267E-3' -> '-56.267'
+dqadd3120 fma 1 0 '-56267E-2' -> '-562.67'
+dqadd3121 fma 1 0 '-56267E-1' -> '-5626.7'
+dqadd3122 fma 1 0 '-56267E-0' -> '-56267'
+dqadd3123 fma 1 0 '-5E-10' -> '-5E-10'
+dqadd3124 fma 1 0 '-5E-7' -> '-5E-7'
+dqadd3125 fma 1 0 '-5E-6' -> '-0.000005'
+dqadd3126 fma 1 0 '-5E-5' -> '-0.00005'
+dqadd3127 fma 1 0 '-5E-4' -> '-0.0005'
+dqadd3128 fma 1 0 '-5E-1' -> '-0.5'
+dqadd3129 fma 1 0 '-5E0' -> '-5'
+dqadd3130 fma 1 0 '-5E1' -> '-50'
+dqadd3131 fma 1 0 '-5E5' -> '-500000'
+dqadd3132 fma 1 0 '-5E33' -> '-5000000000000000000000000000000000'
+dqadd3133 fma 1 0 '-5E34' -> '-5.000000000000000000000000000000000E+34' Rounded
+dqadd3134 fma 1 0 '-5E35' -> '-5.000000000000000000000000000000000E+35' Rounded
+dqadd3135 fma 1 0 '-5E36' -> '-5.000000000000000000000000000000000E+36' Rounded
+dqadd3136 fma 1 0 '-5E100' -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- related
+dqadd3137 fma 1 1 '0E-39' -> '1.000000000000000000000000000000000' Rounded
+dqadd3138 fma 1 -1 '0E-39' -> '-1.000000000000000000000000000000000' Rounded
+dqadd3139 fma 1 '0E-39' 1 -> '1.000000000000000000000000000000000' Rounded
+dqadd3140 fma 1 '0E-39' -1 -> '-1.000000000000000000000000000000000' Rounded
+dqadd3141 fma 1 1E+29 0.0000 -> '100000000000000000000000000000.0000'
+dqadd3142 fma 1 1E+29 0.00000 -> '100000000000000000000000000000.0000' Rounded
+dqadd3143 fma 1 0.000 1E+30 -> '1000000000000000000000000000000.000'
+dqadd3144 fma 1 0.0000 1E+30 -> '1000000000000000000000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+dqadd3146 fma 1 '00.0' 0 -> '0.0'
+dqadd3147 fma 1 '0.00' 0 -> '0.00'
+dqadd3148 fma 1 0 '0.00' -> '0.00'
+dqadd3149 fma 1 0 '00.0' -> '0.0'
+dqadd3150 fma 1 '00.0' '0.00' -> '0.00'
+dqadd3151 fma 1 '0.00' '00.0' -> '0.00'
+dqadd3152 fma 1 '3' '.3' -> '3.3'
+dqadd3153 fma 1 '3.' '.3' -> '3.3'
+dqadd3154 fma 1 '3.0' '.3' -> '3.3'
+dqadd3155 fma 1 '3.00' '.3' -> '3.30'
+dqadd3156 fma 1 '3' '3' -> '6'
+dqadd3157 fma 1 '3' '+3' -> '6'
+dqadd3158 fma 1 '3' '-3' -> '0'
+dqadd3159 fma 1 '0.3' '-0.3' -> '0.0'
+dqadd3160 fma 1 '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+dqadd3161 fma 1 '1E+12' '-1' -> '999999999999'
+dqadd3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
+dqadd3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
+dqadd3164 fma 1 '-1' '1E+12' -> '999999999999'
+dqadd3165 fma 1 '7E+12' '-1' -> '6999999999999'
+dqadd3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
+dqadd3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
+dqadd3168 fma 1 '-1' '7E+12' -> '6999999999999'
+
+rounding: half_up
+dqadd3170 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555567' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd3171 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555566' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd3172 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555565' -> '5.000000000000000000000000000000001' Inexact Rounded
+dqadd3173 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555564' -> '5.000000000000000000000000000000000' Inexact Rounded
+dqadd3174 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555553' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd3175 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555552' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd3176 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555551' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd3177 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555550' -> '4.999999999999999999999999999999999' Rounded
+dqadd3178 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555545' -> '4.999999999999999999999999999999999' Inexact Rounded
+dqadd3179 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555544' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd3180 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555543' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd3181 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555542' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd3182 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555541' -> '4.999999999999999999999999999999998' Inexact Rounded
+dqadd3183 fma 1 '4.444444444444444444444444444444444' '0.5555555555555555555555555555555540' -> '4.999999999999999999999999999999998' Rounded
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+dqadd3200 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd3201 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3202 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3203 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3204 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3205 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3206 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3207 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3208 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3209 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3210 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3211 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3212 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3213 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3214 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3215 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3216 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd3217 fma 1 '1231234567890123456784560123456789' 1.000000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3218 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3219 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+
+rounding: half_even
+dqadd3220 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd3221 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3222 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3223 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3224 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3225 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3226 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3227 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3228 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3229 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3230 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3231 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3232 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3233 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3234 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3235 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3236 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd3237 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3238 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3239 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+-- critical few with even bottom digit...
+dqadd3240 fma 1 '1231234567890123456784560123456788' 0.499999999 -> '1231234567890123456784560123456788' Inexact Rounded
+dqadd3241 fma 1 '1231234567890123456784560123456788' 0.5 -> '1231234567890123456784560123456788' Inexact Rounded
+dqadd3242 fma 1 '1231234567890123456784560123456788' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
+
+rounding: down
+dqadd3250 fma 1 '1231234567890123456784560123456789' 0 -> '1231234567890123456784560123456789'
+dqadd3251 fma 1 '1231234567890123456784560123456789' 0.000000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3252 fma 1 '1231234567890123456784560123456789' 0.000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3253 fma 1 '1231234567890123456784560123456789' 0.1 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3254 fma 1 '1231234567890123456784560123456789' 0.4 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3255 fma 1 '1231234567890123456784560123456789' 0.49 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3256 fma 1 '1231234567890123456784560123456789' 0.499999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3257 fma 1 '1231234567890123456784560123456789' 0.499999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3258 fma 1 '1231234567890123456784560123456789' 0.5 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3259 fma 1 '1231234567890123456784560123456789' 0.500000001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3260 fma 1 '1231234567890123456784560123456789' 0.500001 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3261 fma 1 '1231234567890123456784560123456789' 0.51 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3262 fma 1 '1231234567890123456784560123456789' 0.6 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3263 fma 1 '1231234567890123456784560123456789' 0.9 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3264 fma 1 '1231234567890123456784560123456789' 0.99999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3265 fma 1 '1231234567890123456784560123456789' 0.999999999 -> '1231234567890123456784560123456789' Inexact Rounded
+dqadd3266 fma 1 '1231234567890123456784560123456789' 1 -> '1231234567890123456784560123456790'
+dqadd3267 fma 1 '1231234567890123456784560123456789' 1.00000001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3268 fma 1 '1231234567890123456784560123456789' 1.00001 -> '1231234567890123456784560123456790' Inexact Rounded
+dqadd3269 fma 1 '1231234567890123456784560123456789' 1.1 -> '1231234567890123456784560123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+dqadd3301 fma 1 -1 1 -> 0
+dqadd3302 fma 1 0 1 -> 1
+dqadd3303 fma 1 1 1 -> 2
+dqadd3304 fma 1 12 1 -> 13
+dqadd3305 fma 1 98 1 -> 99
+dqadd3306 fma 1 99 1 -> 100
+dqadd3307 fma 1 100 1 -> 101
+dqadd3308 fma 1 101 1 -> 102
+dqadd3309 fma 1 -1 -1 -> -2
+dqadd3310 fma 1 0 -1 -> -1
+dqadd3311 fma 1 1 -1 -> 0
+dqadd3312 fma 1 12 -1 -> 11
+dqadd3313 fma 1 98 -1 -> 97
+dqadd3314 fma 1 99 -1 -> 98
+dqadd3315 fma 1 100 -1 -> 99
+dqadd3316 fma 1 101 -1 -> 100
+
+dqadd3321 fma 1 -0.01 0.01 -> 0.00
+dqadd3322 fma 1 0.00 0.01 -> 0.01
+dqadd3323 fma 1 0.01 0.01 -> 0.02
+dqadd3324 fma 1 0.12 0.01 -> 0.13
+dqadd3325 fma 1 0.98 0.01 -> 0.99
+dqadd3326 fma 1 0.99 0.01 -> 1.00
+dqadd3327 fma 1 1.00 0.01 -> 1.01
+dqadd3328 fma 1 1.01 0.01 -> 1.02
+dqadd3329 fma 1 -0.01 -0.01 -> -0.02
+dqadd3330 fma 1 0.00 -0.01 -> -0.01
+dqadd3331 fma 1 0.01 -0.01 -> 0.00
+dqadd3332 fma 1 0.12 -0.01 -> 0.11
+dqadd3333 fma 1 0.98 -0.01 -> 0.97
+dqadd3334 fma 1 0.99 -0.01 -> 0.98
+dqadd3335 fma 1 1.00 -0.01 -> 0.99
+dqadd3336 fma 1 1.01 -0.01 -> 1.00
+
+-- some more cases where adding 0 affects the coefficient
+dqadd3340 fma 1 1E+3 0 -> 1000
+dqadd3341 fma 1 1E+33 0 -> 1000000000000000000000000000000000
+dqadd3342 fma 1 1E+34 0 -> 1.000000000000000000000000000000000E+34 Rounded
+dqadd3343 fma 1 1E+35 0 -> 1.000000000000000000000000000000000E+35 Rounded
+-- which simply follow from these cases ...
+dqadd3344 fma 1 1E+3 1 -> 1001
+dqadd3345 fma 1 1E+33 1 -> 1000000000000000000000000000000001
+dqadd3346 fma 1 1E+34 1 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd3347 fma 1 1E+35 1 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
+dqadd3348 fma 1 1E+3 7 -> 1007
+dqadd3349 fma 1 1E+33 7 -> 1000000000000000000000000000000007
+dqadd3350 fma 1 1E+34 7 -> 1.000000000000000000000000000000001E+34 Inexact Rounded
+dqadd3351 fma 1 1E+35 7 -> 1.000000000000000000000000000000000E+35 Inexact Rounded
+
+-- tryzeros cases
+rounding: half_up
+dqadd3360 fma 1 0E+50 10000E+1 -> 1.0000E+5
+dqadd3361 fma 1 0E-50 10000E+1 -> 100000.0000000000000000000000000000 Rounded
+dqadd3362 fma 1 10000E+1 0E-50 -> 100000.0000000000000000000000000000 Rounded
+dqadd3363 fma 1 10000E+1 10000E-50 -> 100000.0000000000000000000000000000 Rounded Inexact
+dqadd3364 fma 1 9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> 0E+6111
+-- 1 234567890123456789012345678901234
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+dqadd3370 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd3371 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+rounding: half_up
+dqadd3372 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd3373 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+rounding: half_even
+dqadd3374 fma 1 999999999999999999999999999999999 815 -> 1000000000000000000000000000000814
+dqadd3375 fma 1 9999999999999999999999999999999999 815 -> 1.000000000000000000000000000000081E+34 Rounded Inexact
+
+-- ulp replacement tests
+dqadd3400 fma 1 1 77e-32 -> 1.00000000000000000000000000000077
+dqadd3401 fma 1 1 77e-33 -> 1.000000000000000000000000000000077
+dqadd3402 fma 1 1 77e-34 -> 1.000000000000000000000000000000008 Inexact Rounded
+dqadd3403 fma 1 1 77e-35 -> 1.000000000000000000000000000000001 Inexact Rounded
+dqadd3404 fma 1 1 77e-36 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd3405 fma 1 1 77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd3406 fma 1 1 77e-299 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd3410 fma 1 10 77e-32 -> 10.00000000000000000000000000000077
+dqadd3411 fma 1 10 77e-33 -> 10.00000000000000000000000000000008 Inexact Rounded
+dqadd3412 fma 1 10 77e-34 -> 10.00000000000000000000000000000001 Inexact Rounded
+dqadd3413 fma 1 10 77e-35 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3414 fma 1 10 77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3415 fma 1 10 77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3416 fma 1 10 77e-299 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd3420 fma 1 77e-32 1 -> 1.00000000000000000000000000000077
+dqadd3421 fma 1 77e-33 1 -> 1.000000000000000000000000000000077
+dqadd3422 fma 1 77e-34 1 -> 1.000000000000000000000000000000008 Inexact Rounded
+dqadd3423 fma 1 77e-35 1 -> 1.000000000000000000000000000000001 Inexact Rounded
+dqadd3424 fma 1 77e-36 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd3425 fma 1 77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd3426 fma 1 77e-299 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd3430 fma 1 77e-32 10 -> 10.00000000000000000000000000000077
+dqadd3431 fma 1 77e-33 10 -> 10.00000000000000000000000000000008 Inexact Rounded
+dqadd3432 fma 1 77e-34 10 -> 10.00000000000000000000000000000001 Inexact Rounded
+dqadd3433 fma 1 77e-35 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3434 fma 1 77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3435 fma 1 77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd3436 fma 1 77e-299 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+-- negative ulps
+dqadd36440 fma 1 1 -77e-32 -> 0.99999999999999999999999999999923
+dqadd36441 fma 1 1 -77e-33 -> 0.999999999999999999999999999999923
+dqadd36442 fma 1 1 -77e-34 -> 0.9999999999999999999999999999999923
+dqadd36443 fma 1 1 -77e-35 -> 0.9999999999999999999999999999999992 Inexact Rounded
+dqadd36444 fma 1 1 -77e-36 -> 0.9999999999999999999999999999999999 Inexact Rounded
+dqadd36445 fma 1 1 -77e-37 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd36446 fma 1 1 -77e-99 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd36450 fma 1 10 -77e-32 -> 9.99999999999999999999999999999923
+dqadd36451 fma 1 10 -77e-33 -> 9.999999999999999999999999999999923
+dqadd36452 fma 1 10 -77e-34 -> 9.999999999999999999999999999999992 Inexact Rounded
+dqadd36453 fma 1 10 -77e-35 -> 9.999999999999999999999999999999999 Inexact Rounded
+dqadd36454 fma 1 10 -77e-36 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd36455 fma 1 10 -77e-37 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd36456 fma 1 10 -77e-99 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd36460 fma 1 -77e-32 1 -> 0.99999999999999999999999999999923
+dqadd36461 fma 1 -77e-33 1 -> 0.999999999999999999999999999999923
+dqadd36462 fma 1 -77e-34 1 -> 0.9999999999999999999999999999999923
+dqadd36463 fma 1 -77e-35 1 -> 0.9999999999999999999999999999999992 Inexact Rounded
+dqadd36464 fma 1 -77e-36 1 -> 0.9999999999999999999999999999999999 Inexact Rounded
+dqadd36465 fma 1 -77e-37 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+dqadd36466 fma 1 -77e-99 1 -> 1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd36470 fma 1 -77e-32 10 -> 9.99999999999999999999999999999923
+dqadd36471 fma 1 -77e-33 10 -> 9.999999999999999999999999999999923
+dqadd36472 fma 1 -77e-34 10 -> 9.999999999999999999999999999999992 Inexact Rounded
+dqadd36473 fma 1 -77e-35 10 -> 9.999999999999999999999999999999999 Inexact Rounded
+dqadd36474 fma 1 -77e-36 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd36475 fma 1 -77e-37 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+dqadd36476 fma 1 -77e-99 10 -> 10.00000000000000000000000000000000 Inexact Rounded
+
+-- negative ulps
+dqadd36480 fma 1 -1 77e-32 -> -0.99999999999999999999999999999923
+dqadd36481 fma 1 -1 77e-33 -> -0.999999999999999999999999999999923
+dqadd36482 fma 1 -1 77e-34 -> -0.9999999999999999999999999999999923
+dqadd36483 fma 1 -1 77e-35 -> -0.9999999999999999999999999999999992 Inexact Rounded
+dqadd36484 fma 1 -1 77e-36 -> -0.9999999999999999999999999999999999 Inexact Rounded
+dqadd36485 fma 1 -1 77e-37 -> -1.000000000000000000000000000000000 Inexact Rounded
+dqadd36486 fma 1 -1 77e-99 -> -1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd36490 fma 1 -10 77e-32 -> -9.99999999999999999999999999999923
+dqadd36491 fma 1 -10 77e-33 -> -9.999999999999999999999999999999923
+dqadd36492 fma 1 -10 77e-34 -> -9.999999999999999999999999999999992 Inexact Rounded
+dqadd36493 fma 1 -10 77e-35 -> -9.999999999999999999999999999999999 Inexact Rounded
+dqadd36494 fma 1 -10 77e-36 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd36495 fma 1 -10 77e-37 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd36496 fma 1 -10 77e-99 -> -10.00000000000000000000000000000000 Inexact Rounded
+
+dqadd36500 fma 1 77e-32 -1 -> -0.99999999999999999999999999999923
+dqadd36501 fma 1 77e-33 -1 -> -0.999999999999999999999999999999923
+dqadd36502 fma 1 77e-34 -1 -> -0.9999999999999999999999999999999923
+dqadd36503 fma 1 77e-35 -1 -> -0.9999999999999999999999999999999992 Inexact Rounded
+dqadd36504 fma 1 77e-36 -1 -> -0.9999999999999999999999999999999999 Inexact Rounded
+dqadd36505 fma 1 77e-37 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
+dqadd36506 fma 1 77e-99 -1 -> -1.000000000000000000000000000000000 Inexact Rounded
+
+dqadd36510 fma 1 77e-32 -10 -> -9.99999999999999999999999999999923
+dqadd36511 fma 1 77e-33 -10 -> -9.999999999999999999999999999999923
+dqadd36512 fma 1 77e-34 -10 -> -9.999999999999999999999999999999992 Inexact Rounded
+dqadd36513 fma 1 77e-35 -10 -> -9.999999999999999999999999999999999 Inexact Rounded
+dqadd36514 fma 1 77e-36 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd36515 fma 1 77e-37 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+dqadd36516 fma 1 77e-99 -10 -> -10.00000000000000000000000000000000 Inexact Rounded
+
+-- and some more residue effects and different roundings
+rounding: half_up
+dqadd36540 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd36541 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36542 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36543 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36544 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36545 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36546 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36547 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36548 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36549 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36550 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36551 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36552 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36553 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36554 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36555 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36556 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd36557 fma 1 '9876543219876543216543210123456789' 1.000000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36558 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36559 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+rounding: half_even
+dqadd36560 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd36561 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36562 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36563 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36564 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36565 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36566 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36567 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd36568 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36569 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36570 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36571 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36572 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36573 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36574 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36575 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36576 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd36577 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36578 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd36579 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+-- critical few with even bottom digit...
+dqadd37540 fma 1 '9876543219876543216543210123456788' 0.499999999 -> '9876543219876543216543210123456788' Inexact Rounded
+dqadd37541 fma 1 '9876543219876543216543210123456788' 0.5 -> '9876543219876543216543210123456788' Inexact Rounded
+dqadd37542 fma 1 '9876543219876543216543210123456788' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
+
+rounding: down
+dqadd37550 fma 1 '9876543219876543216543210123456789' 0 -> '9876543219876543216543210123456789'
+dqadd37551 fma 1 '9876543219876543216543210123456789' 0.000000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37552 fma 1 '9876543219876543216543210123456789' 0.000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37553 fma 1 '9876543219876543216543210123456789' 0.1 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37554 fma 1 '9876543219876543216543210123456789' 0.4 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37555 fma 1 '9876543219876543216543210123456789' 0.49 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37556 fma 1 '9876543219876543216543210123456789' 0.499999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37557 fma 1 '9876543219876543216543210123456789' 0.499999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37558 fma 1 '9876543219876543216543210123456789' 0.5 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37559 fma 1 '9876543219876543216543210123456789' 0.500000001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37560 fma 1 '9876543219876543216543210123456789' 0.500001 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37561 fma 1 '9876543219876543216543210123456789' 0.51 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37562 fma 1 '9876543219876543216543210123456789' 0.6 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37563 fma 1 '9876543219876543216543210123456789' 0.9 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37564 fma 1 '9876543219876543216543210123456789' 0.99999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37565 fma 1 '9876543219876543216543210123456789' 0.999999999 -> '9876543219876543216543210123456789' Inexact Rounded
+dqadd37566 fma 1 '9876543219876543216543210123456789' 1 -> '9876543219876543216543210123456790'
+dqadd37567 fma 1 '9876543219876543216543210123456789' 1.00000001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd37568 fma 1 '9876543219876543216543210123456789' 1.00001 -> '9876543219876543216543210123456790' Inexact Rounded
+dqadd37569 fma 1 '9876543219876543216543210123456789' 1.1 -> '9876543219876543216543210123456790' Inexact Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+dqadd37701 fma 1 5.00 1.00E-3 -> 5.00100
+dqadd37702 fma 1 00.00 0.000 -> 0.000
+dqadd37703 fma 1 00.00 0E-3 -> 0.000
+dqadd37704 fma 1 0E-3 00.00 -> 0.000
+
+dqadd37710 fma 1 0E+3 00.00 -> 0.00
+dqadd37711 fma 1 0E+3 00.0 -> 0.0
+dqadd37712 fma 1 0E+3 00. -> 0
+dqadd37713 fma 1 0E+3 00.E+1 -> 0E+1
+dqadd37714 fma 1 0E+3 00.E+2 -> 0E+2
+dqadd37715 fma 1 0E+3 00.E+3 -> 0E+3
+dqadd37716 fma 1 0E+3 00.E+4 -> 0E+3
+dqadd37717 fma 1 0E+3 00.E+5 -> 0E+3
+dqadd37718 fma 1 0E+3 -00.0 -> 0.0
+dqadd37719 fma 1 0E+3 -00. -> 0
+dqadd37731 fma 1 0E+3 -00.E+1 -> 0E+1
+
+dqadd37720 fma 1 00.00 0E+3 -> 0.00
+dqadd37721 fma 1 00.0 0E+3 -> 0.0
+dqadd37722 fma 1 00. 0E+3 -> 0
+dqadd37723 fma 1 00.E+1 0E+3 -> 0E+1
+dqadd37724 fma 1 00.E+2 0E+3 -> 0E+2
+dqadd37725 fma 1 00.E+3 0E+3 -> 0E+3
+dqadd37726 fma 1 00.E+4 0E+3 -> 0E+3
+dqadd37727 fma 1 00.E+5 0E+3 -> 0E+3
+dqadd37728 fma 1 -00.00 0E+3 -> 0.00
+dqadd37729 fma 1 -00.0 0E+3 -> 0.0
+dqadd37730 fma 1 -00. 0E+3 -> 0
+
+dqadd37732 fma 1 0 0 -> 0
+dqadd37733 fma 1 0 -0 -> 0
+dqadd37734 fma 1 -0 0 -> 0
+dqadd37735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
+
+dqadd37736 fma 1 1 -1 -> 0
+dqadd37737 fma 1 -1 -1 -> -2
+dqadd37738 fma 1 1 1 -> 2
+dqadd37739 fma 1 -1 1 -> 0
+
+dqadd37741 fma 1 0 -1 -> -1
+dqadd37742 fma 1 -0 -1 -> -1
+dqadd37743 fma 1 0 1 -> 1
+dqadd37744 fma 1 -0 1 -> 1
+dqadd37745 fma 1 -1 0 -> -1
+dqadd37746 fma 1 -1 -0 -> -1
+dqadd37747 fma 1 1 0 -> 1
+dqadd37748 fma 1 1 -0 -> 1
+
+dqadd37751 fma 1 0.0 -1 -> -1.0
+dqadd37752 fma 1 -0.0 -1 -> -1.0
+dqadd37753 fma 1 0.0 1 -> 1.0
+dqadd37754 fma 1 -0.0 1 -> 1.0
+dqadd37755 fma 1 -1.0 0 -> -1.0
+dqadd37756 fma 1 -1.0 -0 -> -1.0
+dqadd37757 fma 1 1.0 0 -> 1.0
+dqadd37758 fma 1 1.0 -0 -> 1.0
+
+dqadd37761 fma 1 0 -1.0 -> -1.0
+dqadd37762 fma 1 -0 -1.0 -> -1.0
+dqadd37763 fma 1 0 1.0 -> 1.0
+dqadd37764 fma 1 -0 1.0 -> 1.0
+dqadd37765 fma 1 -1 0.0 -> -1.0
+dqadd37766 fma 1 -1 -0.0 -> -1.0
+dqadd37767 fma 1 1 0.0 -> 1.0
+dqadd37768 fma 1 1 -0.0 -> 1.0
+
+dqadd37771 fma 1 0.0 -1.0 -> -1.0
+dqadd37772 fma 1 -0.0 -1.0 -> -1.0
+dqadd37773 fma 1 0.0 1.0 -> 1.0
+dqadd37774 fma 1 -0.0 1.0 -> 1.0
+dqadd37775 fma 1 -1.0 0.0 -> -1.0
+dqadd37776 fma 1 -1.0 -0.0 -> -1.0
+dqadd37777 fma 1 1.0 0.0 -> 1.0
+dqadd37778 fma 1 1.0 -0.0 -> 1.0
+
+-- Specials
+dqadd37780 fma 1 -Inf -Inf -> -Infinity
+dqadd37781 fma 1 -Inf -1000 -> -Infinity
+dqadd37782 fma 1 -Inf -1 -> -Infinity
+dqadd37783 fma 1 -Inf -0 -> -Infinity
+dqadd37784 fma 1 -Inf 0 -> -Infinity
+dqadd37785 fma 1 -Inf 1 -> -Infinity
+dqadd37786 fma 1 -Inf 1000 -> -Infinity
+dqadd37787 fma 1 -1000 -Inf -> -Infinity
+dqadd37788 fma 1 -Inf -Inf -> -Infinity
+dqadd37789 fma 1 -1 -Inf -> -Infinity
+dqadd37790 fma 1 -0 -Inf -> -Infinity
+dqadd37791 fma 1 0 -Inf -> -Infinity
+dqadd37792 fma 1 1 -Inf -> -Infinity
+dqadd37793 fma 1 1000 -Inf -> -Infinity
+dqadd37794 fma 1 Inf -Inf -> NaN Invalid_operation
+
+dqadd37800 fma 1 Inf -Inf -> NaN Invalid_operation
+dqadd37801 fma 1 Inf -1000 -> Infinity
+dqadd37802 fma 1 Inf -1 -> Infinity
+dqadd37803 fma 1 Inf -0 -> Infinity
+dqadd37804 fma 1 Inf 0 -> Infinity
+dqadd37805 fma 1 Inf 1 -> Infinity
+dqadd37806 fma 1 Inf 1000 -> Infinity
+dqadd37807 fma 1 Inf Inf -> Infinity
+dqadd37808 fma 1 -1000 Inf -> Infinity
+dqadd37809 fma 1 -Inf Inf -> NaN Invalid_operation
+dqadd37810 fma 1 -1 Inf -> Infinity
+dqadd37811 fma 1 -0 Inf -> Infinity
+dqadd37812 fma 1 0 Inf -> Infinity
+dqadd37813 fma 1 1 Inf -> Infinity
+dqadd37814 fma 1 1000 Inf -> Infinity
+dqadd37815 fma 1 Inf Inf -> Infinity
+
+dqadd37821 fma 1 NaN -Inf -> NaN
+dqadd37822 fma 1 NaN -1000 -> NaN
+dqadd37823 fma 1 NaN -1 -> NaN
+dqadd37824 fma 1 NaN -0 -> NaN
+dqadd37825 fma 1 NaN 0 -> NaN
+dqadd37826 fma 1 NaN 1 -> NaN
+dqadd37827 fma 1 NaN 1000 -> NaN
+dqadd37828 fma 1 NaN Inf -> NaN
+dqadd37829 fma 1 NaN NaN -> NaN
+dqadd37830 fma 1 -Inf NaN -> NaN
+dqadd37831 fma 1 -1000 NaN -> NaN
+dqadd37832 fma 1 -1 NaN -> NaN
+dqadd37833 fma 1 -0 NaN -> NaN
+dqadd37834 fma 1 0 NaN -> NaN
+dqadd37835 fma 1 1 NaN -> NaN
+dqadd37836 fma 1 1000 NaN -> NaN
+dqadd37837 fma 1 Inf NaN -> NaN
+
+dqadd37841 fma 1 sNaN -Inf -> NaN Invalid_operation
+dqadd37842 fma 1 sNaN -1000 -> NaN Invalid_operation
+dqadd37843 fma 1 sNaN -1 -> NaN Invalid_operation
+dqadd37844 fma 1 sNaN -0 -> NaN Invalid_operation
+dqadd37845 fma 1 sNaN 0 -> NaN Invalid_operation
+dqadd37846 fma 1 sNaN 1 -> NaN Invalid_operation
+dqadd37847 fma 1 sNaN 1000 -> NaN Invalid_operation
+dqadd37848 fma 1 sNaN NaN -> NaN Invalid_operation
+dqadd37849 fma 1 sNaN sNaN -> NaN Invalid_operation
+dqadd37850 fma 1 NaN sNaN -> NaN Invalid_operation
+dqadd37851 fma 1 -Inf sNaN -> NaN Invalid_operation
+dqadd37852 fma 1 -1000 sNaN -> NaN Invalid_operation
+dqadd37853 fma 1 -1 sNaN -> NaN Invalid_operation
+dqadd37854 fma 1 -0 sNaN -> NaN Invalid_operation
+dqadd37855 fma 1 0 sNaN -> NaN Invalid_operation
+dqadd37856 fma 1 1 sNaN -> NaN Invalid_operation
+dqadd37857 fma 1 1000 sNaN -> NaN Invalid_operation
+dqadd37858 fma 1 Inf sNaN -> NaN Invalid_operation
+dqadd37859 fma 1 NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqadd37861 fma 1 NaN1 -Inf -> NaN1
+dqadd37862 fma 1 +NaN2 -1000 -> NaN2
+dqadd37863 fma 1 NaN3 1000 -> NaN3
+dqadd37864 fma 1 NaN4 Inf -> NaN4
+dqadd37865 fma 1 NaN5 +NaN6 -> NaN5
+dqadd37866 fma 1 -Inf NaN7 -> NaN7
+dqadd37867 fma 1 -1000 NaN8 -> NaN8
+dqadd37868 fma 1 1000 NaN9 -> NaN9
+dqadd37869 fma 1 Inf +NaN10 -> NaN10
+dqadd37871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
+dqadd37872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
+dqadd37873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
+dqadd37874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
+dqadd37875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqadd37876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
+dqadd37877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
+dqadd37878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
+dqadd37879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
+dqadd37880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
+dqadd37881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqadd37882 fma 1 -NaN26 NaN28 -> -NaN26
+dqadd37883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqadd37884 fma 1 1000 -NaN30 -> -NaN30
+dqadd37885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Here we explore near the boundary of rounding a subnormal to Nmin
+dqadd37575 fma 1 1E-6143 -1E-6176 -> 9.99999999999999999999999999999999E-6144 Subnormal
+dqadd37576 fma 1 -1E-6143 +1E-6176 -> -9.99999999999999999999999999999999E-6144 Subnormal
+
+-- check overflow edge case
+-- 1234567890123456
+dqadd37972 apply 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqadd37973 fma 1 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37974 fma 1 9999999999999999999999999999999999E+6111 1 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37975 fma 1 9999999999999999999999999999999999E+6111 1E+6111 -> Infinity Overflow Inexact Rounded
+dqadd37976 fma 1 9999999999999999999999999999999999E+6111 9E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37977 fma 1 9999999999999999999999999999999999E+6111 8E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37978 fma 1 9999999999999999999999999999999999E+6111 7E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37979 fma 1 9999999999999999999999999999999999E+6111 6E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37980 fma 1 9999999999999999999999999999999999E+6111 5E+6110 -> Infinity Overflow Inexact Rounded
+dqadd37981 fma 1 9999999999999999999999999999999999E+6111 4E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37982 fma 1 9999999999999999999999999999999999E+6111 3E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37983 fma 1 9999999999999999999999999999999999E+6111 2E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37984 fma 1 9999999999999999999999999999999999E+6111 1E+6110 -> 9.999999999999999999999999999999999E+6144 Inexact Rounded
+
+dqadd37985 apply -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqadd37986 fma 1 -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37987 fma 1 -9999999999999999999999999999999999E+6111 -1 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37988 fma 1 -9999999999999999999999999999999999E+6111 -1E+6111 -> -Infinity Overflow Inexact Rounded
+dqadd37989 fma 1 -9999999999999999999999999999999999E+6111 -9E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37990 fma 1 -9999999999999999999999999999999999E+6111 -8E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37991 fma 1 -9999999999999999999999999999999999E+6111 -7E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37992 fma 1 -9999999999999999999999999999999999E+6111 -6E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37993 fma 1 -9999999999999999999999999999999999E+6111 -5E+6110 -> -Infinity Overflow Inexact Rounded
+dqadd37994 fma 1 -9999999999999999999999999999999999E+6111 -4E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37995 fma 1 -9999999999999999999999999999999999E+6111 -3E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37996 fma 1 -9999999999999999999999999999999999E+6111 -2E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+dqadd37997 fma 1 -9999999999999999999999999999999999E+6111 -1E+6110 -> -9.999999999999999999999999999999999E+6144 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+dqadd371100 fma 1 1e+2 -1e-6143 -> 99.99999999999999999999999999999999 Rounded Inexact
+dqadd371101 fma 1 1e+1 -1e-6143 -> 9.999999999999999999999999999999999 Rounded Inexact
+dqadd371103 fma 1 +1 -1e-6143 -> 0.9999999999999999999999999999999999 Rounded Inexact
+dqadd371104 fma 1 1e-1 -1e-6143 -> 0.09999999999999999999999999999999999 Rounded Inexact
+dqadd371105 fma 1 1e-2 -1e-6143 -> 0.009999999999999999999999999999999999 Rounded Inexact
+dqadd371106 fma 1 1e-3 -1e-6143 -> 0.0009999999999999999999999999999999999 Rounded Inexact
+dqadd371107 fma 1 1e-4 -1e-6143 -> 0.00009999999999999999999999999999999999 Rounded Inexact
+dqadd371108 fma 1 1e-5 -1e-6143 -> 0.000009999999999999999999999999999999999 Rounded Inexact
+dqadd371109 fma 1 1e-6 -1e-6143 -> 9.999999999999999999999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+dqadd371110 fma 1 -1e+2 +1e-6143 -> -99.99999999999999999999999999999999 Rounded Inexact
+dqadd371111 fma 1 -1e+1 +1e-6143 -> -9.999999999999999999999999999999999 Rounded Inexact
+dqadd371113 fma 1 -1 +1e-6143 -> -0.9999999999999999999999999999999999 Rounded Inexact
+dqadd371114 fma 1 -1e-1 +1e-6143 -> -0.09999999999999999999999999999999999 Rounded Inexact
+dqadd371115 fma 1 -1e-2 +1e-6143 -> -0.009999999999999999999999999999999999 Rounded Inexact
+dqadd371116 fma 1 -1e-3 +1e-6143 -> -0.0009999999999999999999999999999999999 Rounded Inexact
+dqadd371117 fma 1 -1e-4 +1e-6143 -> -0.00009999999999999999999999999999999999 Rounded Inexact
+dqadd371118 fma 1 -1e-5 +1e-6143 -> -0.000009999999999999999999999999999999999 Rounded Inexact
+dqadd371119 fma 1 -1e-6 +1e-6143 -> -9.999999999999999999999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+dqadd371300 fma 1 1E34 -0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371310 fma 1 1E34 -0.51 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371311 fma 1 1E34 -0.501 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371312 fma 1 1E34 -0.5001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371313 fma 1 1E34 -0.50001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371314 fma 1 1E34 -0.500001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371315 fma 1 1E34 -0.5000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371316 fma 1 1E34 -0.50000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371317 fma 1 1E34 -0.500000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371318 fma 1 1E34 -0.5000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371319 fma 1 1E34 -0.50000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371320 fma 1 1E34 -0.500000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371321 fma 1 1E34 -0.5000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371322 fma 1 1E34 -0.50000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371323 fma 1 1E34 -0.500000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371324 fma 1 1E34 -0.5000000000000001 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371325 fma 1 1E34 -0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371326 fma 1 1E34 -0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371327 fma 1 1E34 -0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371328 fma 1 1E34 -0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371329 fma 1 1E34 -0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371330 fma 1 1E34 -0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371331 fma 1 1E34 -0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371332 fma 1 1E34 -0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371333 fma 1 1E34 -0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371334 fma 1 1E34 -0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371335 fma 1 1E34 -0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371336 fma 1 1E34 -0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371337 fma 1 1E34 -0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371338 fma 1 1E34 -0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371339 fma 1 1E34 -0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+
+dqadd371340 fma 1 1E34 -5000000.000010001 -> 9999999999999999999999999995000000 Inexact Rounded
+dqadd371341 fma 1 1E34 -5000000.000000001 -> 9999999999999999999999999995000000 Inexact Rounded
+
+dqadd371349 fma 1 9999999999999999999999999999999999 0.4 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371350 fma 1 9999999999999999999999999999999999 0.49 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371351 fma 1 9999999999999999999999999999999999 0.499 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371352 fma 1 9999999999999999999999999999999999 0.4999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371353 fma 1 9999999999999999999999999999999999 0.49999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371354 fma 1 9999999999999999999999999999999999 0.499999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371355 fma 1 9999999999999999999999999999999999 0.4999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371356 fma 1 9999999999999999999999999999999999 0.49999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371357 fma 1 9999999999999999999999999999999999 0.499999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371358 fma 1 9999999999999999999999999999999999 0.4999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371359 fma 1 9999999999999999999999999999999999 0.49999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371360 fma 1 9999999999999999999999999999999999 0.499999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371361 fma 1 9999999999999999999999999999999999 0.4999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371362 fma 1 9999999999999999999999999999999999 0.49999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371363 fma 1 9999999999999999999999999999999999 0.499999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371364 fma 1 9999999999999999999999999999999999 0.4999999999999999 -> 9999999999999999999999999999999999 Inexact Rounded
+dqadd371365 fma 1 9999999999999999999999999999999999 0.5000000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371367 fma 1 9999999999999999999999999999999999 0.500000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371368 fma 1 9999999999999999999999999999999999 0.50000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371369 fma 1 9999999999999999999999999999999999 0.5000000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371370 fma 1 9999999999999999999999999999999999 0.500000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371371 fma 1 9999999999999999999999999999999999 0.50000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371372 fma 1 9999999999999999999999999999999999 0.5000000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371373 fma 1 9999999999999999999999999999999999 0.500000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371374 fma 1 9999999999999999999999999999999999 0.50000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371375 fma 1 9999999999999999999999999999999999 0.5000000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371376 fma 1 9999999999999999999999999999999999 0.500000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371377 fma 1 9999999999999999999999999999999999 0.50000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371378 fma 1 9999999999999999999999999999999999 0.5000 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371379 fma 1 9999999999999999999999999999999999 0.500 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371380 fma 1 9999999999999999999999999999999999 0.50 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371381 fma 1 9999999999999999999999999999999999 0.5 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371382 fma 1 9999999999999999999999999999999999 0.5000000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371383 fma 1 9999999999999999999999999999999999 0.500000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371384 fma 1 9999999999999999999999999999999999 0.50000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371385 fma 1 9999999999999999999999999999999999 0.5000000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371386 fma 1 9999999999999999999999999999999999 0.500000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371387 fma 1 9999999999999999999999999999999999 0.50000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371388 fma 1 9999999999999999999999999999999999 0.5000000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371389 fma 1 9999999999999999999999999999999999 0.500000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371390 fma 1 9999999999999999999999999999999999 0.50000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371391 fma 1 9999999999999999999999999999999999 0.5000001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371392 fma 1 9999999999999999999999999999999999 0.500001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371393 fma 1 9999999999999999999999999999999999 0.50001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371394 fma 1 9999999999999999999999999999999999 0.5001 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371395 fma 1 9999999999999999999999999999999999 0.501 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+dqadd371396 fma 1 9999999999999999999999999999999999 0.51 -> 1.000000000000000000000000000000000E+34 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+dqadd371420 fma 1 0 1.123456789987654321123456789012345 -> 1.123456789987654321123456789012345
+dqadd371421 fma 1 0 1.123456789987654321123456789012345E-1 -> 0.1123456789987654321123456789012345
+dqadd371422 fma 1 0 1.123456789987654321123456789012345E-2 -> 0.01123456789987654321123456789012345
+dqadd371423 fma 1 0 1.123456789987654321123456789012345E-3 -> 0.001123456789987654321123456789012345
+dqadd371424 fma 1 0 1.123456789987654321123456789012345E-4 -> 0.0001123456789987654321123456789012345
+dqadd371425 fma 1 0 1.123456789987654321123456789012345E-5 -> 0.00001123456789987654321123456789012345
+dqadd371426 fma 1 0 1.123456789987654321123456789012345E-6 -> 0.000001123456789987654321123456789012345
+dqadd371427 fma 1 0 1.123456789987654321123456789012345E-7 -> 1.123456789987654321123456789012345E-7
+dqadd371428 fma 1 0 1.123456789987654321123456789012345E-8 -> 1.123456789987654321123456789012345E-8
+dqadd371429 fma 1 0 1.123456789987654321123456789012345E-9 -> 1.123456789987654321123456789012345E-9
+dqadd371430 fma 1 0 1.123456789987654321123456789012345E-10 -> 1.123456789987654321123456789012345E-10
+dqadd371431 fma 1 0 1.123456789987654321123456789012345E-11 -> 1.123456789987654321123456789012345E-11
+dqadd371432 fma 1 0 1.123456789987654321123456789012345E-12 -> 1.123456789987654321123456789012345E-12
+dqadd371433 fma 1 0 1.123456789987654321123456789012345E-13 -> 1.123456789987654321123456789012345E-13
+dqadd371434 fma 1 0 1.123456789987654321123456789012345E-14 -> 1.123456789987654321123456789012345E-14
+dqadd371435 fma 1 0 1.123456789987654321123456789012345E-15 -> 1.123456789987654321123456789012345E-15
+dqadd371436 fma 1 0 1.123456789987654321123456789012345E-16 -> 1.123456789987654321123456789012345E-16
+dqadd371437 fma 1 0 1.123456789987654321123456789012345E-17 -> 1.123456789987654321123456789012345E-17
+dqadd371438 fma 1 0 1.123456789987654321123456789012345E-18 -> 1.123456789987654321123456789012345E-18
+dqadd371439 fma 1 0 1.123456789987654321123456789012345E-19 -> 1.123456789987654321123456789012345E-19
+dqadd371440 fma 1 0 1.123456789987654321123456789012345E-20 -> 1.123456789987654321123456789012345E-20
+dqadd371441 fma 1 0 1.123456789987654321123456789012345E-21 -> 1.123456789987654321123456789012345E-21
+dqadd371442 fma 1 0 1.123456789987654321123456789012345E-22 -> 1.123456789987654321123456789012345E-22
+dqadd371443 fma 1 0 1.123456789987654321123456789012345E-23 -> 1.123456789987654321123456789012345E-23
+dqadd371444 fma 1 0 1.123456789987654321123456789012345E-24 -> 1.123456789987654321123456789012345E-24
+dqadd371445 fma 1 0 1.123456789987654321123456789012345E-25 -> 1.123456789987654321123456789012345E-25
+dqadd371446 fma 1 0 1.123456789987654321123456789012345E-26 -> 1.123456789987654321123456789012345E-26
+dqadd371447 fma 1 0 1.123456789987654321123456789012345E-27 -> 1.123456789987654321123456789012345E-27
+dqadd371448 fma 1 0 1.123456789987654321123456789012345E-28 -> 1.123456789987654321123456789012345E-28
+dqadd371449 fma 1 0 1.123456789987654321123456789012345E-29 -> 1.123456789987654321123456789012345E-29
+dqadd371450 fma 1 0 1.123456789987654321123456789012345E-30 -> 1.123456789987654321123456789012345E-30
+dqadd371451 fma 1 0 1.123456789987654321123456789012345E-31 -> 1.123456789987654321123456789012345E-31
+dqadd371452 fma 1 0 1.123456789987654321123456789012345E-32 -> 1.123456789987654321123456789012345E-32
+dqadd371453 fma 1 0 1.123456789987654321123456789012345E-33 -> 1.123456789987654321123456789012345E-33
+dqadd371454 fma 1 0 1.123456789987654321123456789012345E-34 -> 1.123456789987654321123456789012345E-34
+dqadd371455 fma 1 0 1.123456789987654321123456789012345E-35 -> 1.123456789987654321123456789012345E-35
+dqadd371456 fma 1 0 1.123456789987654321123456789012345E-36 -> 1.123456789987654321123456789012345E-36
+
+-- same, reversed 0
+dqadd371460 fma 1 1.123456789987654321123456789012345 0 -> 1.123456789987654321123456789012345
+dqadd371461 fma 1 1.123456789987654321123456789012345E-1 0 -> 0.1123456789987654321123456789012345
+dqadd371462 fma 1 1.123456789987654321123456789012345E-2 0 -> 0.01123456789987654321123456789012345
+dqadd371463 fma 1 1.123456789987654321123456789012345E-3 0 -> 0.001123456789987654321123456789012345
+dqadd371464 fma 1 1.123456789987654321123456789012345E-4 0 -> 0.0001123456789987654321123456789012345
+dqadd371465 fma 1 1.123456789987654321123456789012345E-5 0 -> 0.00001123456789987654321123456789012345
+dqadd371466 fma 1 1.123456789987654321123456789012345E-6 0 -> 0.000001123456789987654321123456789012345
+dqadd371467 fma 1 1.123456789987654321123456789012345E-7 0 -> 1.123456789987654321123456789012345E-7
+dqadd371468 fma 1 1.123456789987654321123456789012345E-8 0 -> 1.123456789987654321123456789012345E-8
+dqadd371469 fma 1 1.123456789987654321123456789012345E-9 0 -> 1.123456789987654321123456789012345E-9
+dqadd371470 fma 1 1.123456789987654321123456789012345E-10 0 -> 1.123456789987654321123456789012345E-10
+dqadd371471 fma 1 1.123456789987654321123456789012345E-11 0 -> 1.123456789987654321123456789012345E-11
+dqadd371472 fma 1 1.123456789987654321123456789012345E-12 0 -> 1.123456789987654321123456789012345E-12
+dqadd371473 fma 1 1.123456789987654321123456789012345E-13 0 -> 1.123456789987654321123456789012345E-13
+dqadd371474 fma 1 1.123456789987654321123456789012345E-14 0 -> 1.123456789987654321123456789012345E-14
+dqadd371475 fma 1 1.123456789987654321123456789012345E-15 0 -> 1.123456789987654321123456789012345E-15
+dqadd371476 fma 1 1.123456789987654321123456789012345E-16 0 -> 1.123456789987654321123456789012345E-16
+dqadd371477 fma 1 1.123456789987654321123456789012345E-17 0 -> 1.123456789987654321123456789012345E-17
+dqadd371478 fma 1 1.123456789987654321123456789012345E-18 0 -> 1.123456789987654321123456789012345E-18
+dqadd371479 fma 1 1.123456789987654321123456789012345E-19 0 -> 1.123456789987654321123456789012345E-19
+dqadd371480 fma 1 1.123456789987654321123456789012345E-20 0 -> 1.123456789987654321123456789012345E-20
+dqadd371481 fma 1 1.123456789987654321123456789012345E-21 0 -> 1.123456789987654321123456789012345E-21
+dqadd371482 fma 1 1.123456789987654321123456789012345E-22 0 -> 1.123456789987654321123456789012345E-22
+dqadd371483 fma 1 1.123456789987654321123456789012345E-23 0 -> 1.123456789987654321123456789012345E-23
+dqadd371484 fma 1 1.123456789987654321123456789012345E-24 0 -> 1.123456789987654321123456789012345E-24
+dqadd371485 fma 1 1.123456789987654321123456789012345E-25 0 -> 1.123456789987654321123456789012345E-25
+dqadd371486 fma 1 1.123456789987654321123456789012345E-26 0 -> 1.123456789987654321123456789012345E-26
+dqadd371487 fma 1 1.123456789987654321123456789012345E-27 0 -> 1.123456789987654321123456789012345E-27
+dqadd371488 fma 1 1.123456789987654321123456789012345E-28 0 -> 1.123456789987654321123456789012345E-28
+dqadd371489 fma 1 1.123456789987654321123456789012345E-29 0 -> 1.123456789987654321123456789012345E-29
+dqadd371490 fma 1 1.123456789987654321123456789012345E-30 0 -> 1.123456789987654321123456789012345E-30
+dqadd371491 fma 1 1.123456789987654321123456789012345E-31 0 -> 1.123456789987654321123456789012345E-31
+dqadd371492 fma 1 1.123456789987654321123456789012345E-32 0 -> 1.123456789987654321123456789012345E-32
+dqadd371493 fma 1 1.123456789987654321123456789012345E-33 0 -> 1.123456789987654321123456789012345E-33
+dqadd371494 fma 1 1.123456789987654321123456789012345E-34 0 -> 1.123456789987654321123456789012345E-34
+dqadd371495 fma 1 1.123456789987654321123456789012345E-35 0 -> 1.123456789987654321123456789012345E-35
+dqadd371496 fma 1 1.123456789987654321123456789012345E-36 0 -> 1.123456789987654321123456789012345E-36
+
+-- same, Es on the 0
+dqadd371500 fma 1 1.123456789987654321123456789012345 0E-0 -> 1.123456789987654321123456789012345
+dqadd371501 fma 1 1.123456789987654321123456789012345 0E-1 -> 1.123456789987654321123456789012345
+dqadd371502 fma 1 1.123456789987654321123456789012345 0E-2 -> 1.123456789987654321123456789012345
+dqadd371503 fma 1 1.123456789987654321123456789012345 0E-3 -> 1.123456789987654321123456789012345
+dqadd371504 fma 1 1.123456789987654321123456789012345 0E-4 -> 1.123456789987654321123456789012345
+dqadd371505 fma 1 1.123456789987654321123456789012345 0E-5 -> 1.123456789987654321123456789012345
+dqadd371506 fma 1 1.123456789987654321123456789012345 0E-6 -> 1.123456789987654321123456789012345
+dqadd371507 fma 1 1.123456789987654321123456789012345 0E-7 -> 1.123456789987654321123456789012345
+dqadd371508 fma 1 1.123456789987654321123456789012345 0E-8 -> 1.123456789987654321123456789012345
+dqadd371509 fma 1 1.123456789987654321123456789012345 0E-9 -> 1.123456789987654321123456789012345
+dqadd371510 fma 1 1.123456789987654321123456789012345 0E-10 -> 1.123456789987654321123456789012345
+dqadd371511 fma 1 1.123456789987654321123456789012345 0E-11 -> 1.123456789987654321123456789012345
+dqadd371512 fma 1 1.123456789987654321123456789012345 0E-12 -> 1.123456789987654321123456789012345
+dqadd371513 fma 1 1.123456789987654321123456789012345 0E-13 -> 1.123456789987654321123456789012345
+dqadd371514 fma 1 1.123456789987654321123456789012345 0E-14 -> 1.123456789987654321123456789012345
+dqadd371515 fma 1 1.123456789987654321123456789012345 0E-15 -> 1.123456789987654321123456789012345
+dqadd371516 fma 1 1.123456789987654321123456789012345 0E-16 -> 1.123456789987654321123456789012345
+dqadd371517 fma 1 1.123456789987654321123456789012345 0E-17 -> 1.123456789987654321123456789012345
+dqadd371518 fma 1 1.123456789987654321123456789012345 0E-18 -> 1.123456789987654321123456789012345
+dqadd371519 fma 1 1.123456789987654321123456789012345 0E-19 -> 1.123456789987654321123456789012345
+dqadd371520 fma 1 1.123456789987654321123456789012345 0E-20 -> 1.123456789987654321123456789012345
+dqadd371521 fma 1 1.123456789987654321123456789012345 0E-21 -> 1.123456789987654321123456789012345
+dqadd371522 fma 1 1.123456789987654321123456789012345 0E-22 -> 1.123456789987654321123456789012345
+dqadd371523 fma 1 1.123456789987654321123456789012345 0E-23 -> 1.123456789987654321123456789012345
+dqadd371524 fma 1 1.123456789987654321123456789012345 0E-24 -> 1.123456789987654321123456789012345
+dqadd371525 fma 1 1.123456789987654321123456789012345 0E-25 -> 1.123456789987654321123456789012345
+dqadd371526 fma 1 1.123456789987654321123456789012345 0E-26 -> 1.123456789987654321123456789012345
+dqadd371527 fma 1 1.123456789987654321123456789012345 0E-27 -> 1.123456789987654321123456789012345
+dqadd371528 fma 1 1.123456789987654321123456789012345 0E-28 -> 1.123456789987654321123456789012345
+dqadd371529 fma 1 1.123456789987654321123456789012345 0E-29 -> 1.123456789987654321123456789012345
+dqadd371530 fma 1 1.123456789987654321123456789012345 0E-30 -> 1.123456789987654321123456789012345
+dqadd371531 fma 1 1.123456789987654321123456789012345 0E-31 -> 1.123456789987654321123456789012345
+dqadd371532 fma 1 1.123456789987654321123456789012345 0E-32 -> 1.123456789987654321123456789012345
+dqadd371533 fma 1 1.123456789987654321123456789012345 0E-33 -> 1.123456789987654321123456789012345
+-- next four flag Rounded because the 0 extends the result
+dqadd371534 fma 1 1.123456789987654321123456789012345 0E-34 -> 1.123456789987654321123456789012345 Rounded
+dqadd371535 fma 1 1.123456789987654321123456789012345 0E-35 -> 1.123456789987654321123456789012345 Rounded
+dqadd371536 fma 1 1.123456789987654321123456789012345 0E-36 -> 1.123456789987654321123456789012345 Rounded
+dqadd371537 fma 1 1.123456789987654321123456789012345 0E-37 -> 1.123456789987654321123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+dqadd371600 fma 1 0 0E-19 -> 0E-19
+dqadd371601 fma 1 -0 0E-19 -> 0E-19
+dqadd371602 fma 1 0 -0E-19 -> 0E-19
+dqadd371603 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371611 fma 1 -11 11 -> 0
+dqadd371612 fma 1 11 -11 -> 0
+-- overflow
+dqadd371613 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371614 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: half_down
+-- exact zeros from zeros
+dqadd371620 fma 1 0 0E-19 -> 0E-19
+dqadd371621 fma 1 -0 0E-19 -> 0E-19
+dqadd371622 fma 1 0 -0E-19 -> 0E-19
+dqadd371623 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371631 fma 1 -11 11 -> 0
+dqadd371632 fma 1 11 -11 -> 0
+-- overflow
+dqadd371633 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371634 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: half_even
+-- exact zeros from zeros
+dqadd371640 fma 1 0 0E-19 -> 0E-19
+dqadd371641 fma 1 -0 0E-19 -> 0E-19
+dqadd371642 fma 1 0 -0E-19 -> 0E-19
+dqadd371643 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371651 fma 1 -11 11 -> 0
+dqadd371652 fma 1 11 -11 -> 0
+-- overflow
+dqadd371653 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371654 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: up
+-- exact zeros from zeros
+dqadd371660 fma 1 0 0E-19 -> 0E-19
+dqadd371661 fma 1 -0 0E-19 -> 0E-19
+dqadd371662 fma 1 0 -0E-19 -> 0E-19
+dqadd371663 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371671 fma 1 -11 11 -> 0
+dqadd371672 fma 1 11 -11 -> 0
+-- overflow
+dqadd371673 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371674 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: down
+-- exact zeros from zeros
+dqadd371680 fma 1 0 0E-19 -> 0E-19
+dqadd371681 fma 1 -0 0E-19 -> 0E-19
+dqadd371682 fma 1 0 -0E-19 -> 0E-19
+dqadd371683 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371691 fma 1 -11 11 -> 0
+dqadd371692 fma 1 11 -11 -> 0
+-- overflow
+dqadd371693 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqadd371694 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+
+rounding: ceiling
+-- exact zeros from zeros
+dqadd371700 fma 1 0 0E-19 -> 0E-19
+dqadd371701 fma 1 -0 0E-19 -> 0E-19
+dqadd371702 fma 1 0 -0E-19 -> 0E-19
+dqadd371703 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371711 fma 1 -11 11 -> 0
+dqadd371712 fma 1 11 -11 -> 0
+-- overflow
+dqadd371713 fma 9E6144 10 1 -> Infinity Overflow Inexact Rounded
+dqadd371714 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+dqadd371720 fma 1 0 0E-19 -> 0E-19
+dqadd371721 fma 1 -0 0E-19 -> -0E-19 -- *
+dqadd371722 fma 1 0 -0E-19 -> -0E-19 -- *
+dqadd371723 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371731 fma 1 -11 11 -> -0 -- *
+dqadd371732 fma 1 11 -11 -> -0 -- *
+-- overflow
+dqadd371733 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqadd371734 fma -9E6144 10 1 -> -Infinity Overflow Inexact Rounded
+
+rounding: 05up
+-- exact zeros from zeros
+dqadd371740 fma 1 0 0E-19 -> 0E-19
+dqadd371741 fma 1 -0 0E-19 -> 0E-19
+dqadd371742 fma 1 0 -0E-19 -> 0E-19
+dqadd371743 fma 1 -0 -0E-19 -> -0E-19
+-- exact zeros from non-zeros
+dqadd371751 fma 1 -11 11 -> 0
+dqadd371752 fma 1 11 -11 -> 0
+-- overflow
+dqadd371753 fma 9E6144 10 1 -> 9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+dqadd371754 fma -9E6144 10 1 -> -9.999999999999999999999999999999999E+6144 Overflow Inexact Rounded
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dqadd371761 fma 1 130E-2 120E-2 -> 2.50
+dqadd371762 fma 1 130E-2 12E-1 -> 2.50
+dqadd371763 fma 1 130E-2 1E0 -> 2.30
+dqadd371764 fma 1 1E2 1E4 -> 1.01E+4
+dqadd371765 fma 1 130E-2 -120E-2 -> 0.10
+dqadd371766 fma 1 130E-2 -12E-1 -> 0.10
+dqadd371767 fma 1 130E-2 -1E0 -> 0.30
+dqadd371768 fma 1 1E2 -1E4 -> -9.9E+3
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+dqadd375001 fma 1 1239876543211234567894567890123456 1 -> 1239876543211234567894567890123457
+dqadd375002 fma 1 1239876543211234567894567890123456 0.6 -> 1239876543211234567894567890123457 Inexact Rounded
+dqadd375003 fma 1 1239876543211234567894567890123456 0.06 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375004 fma 1 1239876543211234567894567890123456 6E-3 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375005 fma 1 1239876543211234567894567890123456 6E-4 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375006 fma 1 1239876543211234567894567890123456 6E-5 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375007 fma 1 1239876543211234567894567890123456 6E-6 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375008 fma 1 1239876543211234567894567890123456 6E-7 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375009 fma 1 1239876543211234567894567890123456 6E-8 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375010 fma 1 1239876543211234567894567890123456 6E-9 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375011 fma 1 1239876543211234567894567890123456 6E-10 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375012 fma 1 1239876543211234567894567890123456 6E-11 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375013 fma 1 1239876543211234567894567890123456 6E-12 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375014 fma 1 1239876543211234567894567890123456 6E-13 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375015 fma 1 1239876543211234567894567890123456 6E-14 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375016 fma 1 1239876543211234567894567890123456 6E-15 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375017 fma 1 1239876543211234567894567890123456 6E-16 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375018 fma 1 1239876543211234567894567890123456 6E-17 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375019 fma 1 1239876543211234567894567890123456 6E-18 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375020 fma 1 1239876543211234567894567890123456 6E-19 -> 1239876543211234567894567890123456 Inexact Rounded
+dqadd375021 fma 1 1239876543211234567894567890123456 6E-20 -> 1239876543211234567894567890123456 Inexact Rounded
+
+-- widening second argument at gap
+dqadd375030 fma 1 12398765432112345678945678 1 -> 12398765432112345678945679
+dqadd375031 fma 1 12398765432112345678945678 0.1 -> 12398765432112345678945678.1
+dqadd375032 fma 1 12398765432112345678945678 0.12 -> 12398765432112345678945678.12
+dqadd375033 fma 1 12398765432112345678945678 0.123 -> 12398765432112345678945678.123
+dqadd375034 fma 1 12398765432112345678945678 0.1234 -> 12398765432112345678945678.1234
+dqadd375035 fma 1 12398765432112345678945678 0.12345 -> 12398765432112345678945678.12345
+dqadd375036 fma 1 12398765432112345678945678 0.123456 -> 12398765432112345678945678.123456
+dqadd375037 fma 1 12398765432112345678945678 0.1234567 -> 12398765432112345678945678.1234567
+dqadd375038 fma 1 12398765432112345678945678 0.12345678 -> 12398765432112345678945678.12345678
+dqadd375039 fma 1 12398765432112345678945678 0.123456789 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375040 fma 1 12398765432112345678945678 0.123456785 -> 12398765432112345678945678.12345678 Inexact Rounded
+dqadd375041 fma 1 12398765432112345678945678 0.1234567850 -> 12398765432112345678945678.12345678 Inexact Rounded
+dqadd375042 fma 1 12398765432112345678945678 0.1234567851 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375043 fma 1 12398765432112345678945678 0.12345678501 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375044 fma 1 12398765432112345678945678 0.123456785001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375045 fma 1 12398765432112345678945678 0.1234567850001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375046 fma 1 12398765432112345678945678 0.12345678500001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375047 fma 1 12398765432112345678945678 0.123456785000001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375048 fma 1 12398765432112345678945678 0.1234567850000001 -> 12398765432112345678945678.12345679 Inexact Rounded
+dqadd375049 fma 1 12398765432112345678945678 0.1234567850000000 -> 12398765432112345678945678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+dqadd375050 fma 1 12398765432112345678945678 0.0234567750000000 -> 12398765432112345678945678.02345678 Inexact Rounded
+dqadd375051 fma 1 12398765432112345678945678 0.0034567750000000 -> 12398765432112345678945678.00345678 Inexact Rounded
+dqadd375052 fma 1 12398765432112345678945678 0.0004567750000000 -> 12398765432112345678945678.00045678 Inexact Rounded
+dqadd375053 fma 1 12398765432112345678945678 0.0000567750000000 -> 12398765432112345678945678.00005678 Inexact Rounded
+dqadd375054 fma 1 12398765432112345678945678 0.0000067750000000 -> 12398765432112345678945678.00000678 Inexact Rounded
+dqadd375055 fma 1 12398765432112345678945678 0.0000007750000000 -> 12398765432112345678945678.00000078 Inexact Rounded
+dqadd375056 fma 1 12398765432112345678945678 0.0000000750000000 -> 12398765432112345678945678.00000008 Inexact Rounded
+dqadd375057 fma 1 12398765432112345678945678 0.0000000050000000 -> 12398765432112345678945678.00000000 Inexact Rounded
+dqadd375060 fma 1 12398765432112345678945678 0.0234567750000001 -> 12398765432112345678945678.02345678 Inexact Rounded
+dqadd375061 fma 1 12398765432112345678945678 0.0034567750000001 -> 12398765432112345678945678.00345678 Inexact Rounded
+dqadd375062 fma 1 12398765432112345678945678 0.0004567750000001 -> 12398765432112345678945678.00045678 Inexact Rounded
+dqadd375063 fma 1 12398765432112345678945678 0.0000567750000001 -> 12398765432112345678945678.00005678 Inexact Rounded
+dqadd375064 fma 1 12398765432112345678945678 0.0000067750000001 -> 12398765432112345678945678.00000678 Inexact Rounded
+dqadd375065 fma 1 12398765432112345678945678 0.0000007750000001 -> 12398765432112345678945678.00000078 Inexact Rounded
+dqadd375066 fma 1 12398765432112345678945678 0.0000000750000001 -> 12398765432112345678945678.00000008 Inexact Rounded
+dqadd375067 fma 1 12398765432112345678945678 0.0000000050000001 -> 12398765432112345678945678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+dqadd375070 fma 1 12398765432112345678945678 1E-8 -> 12398765432112345678945678.00000001
+dqadd375071 fma 1 12398765432112345678945678 1E-9 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375072 fma 1 12398765432112345678945678 1E-10 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375073 fma 1 12398765432112345678945678 1E-11 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375074 fma 1 12398765432112345678945678 1E-12 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375075 fma 1 12398765432112345678945678 1E-13 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375076 fma 1 12398765432112345678945678 1E-14 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375077 fma 1 12398765432112345678945678 1E-15 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375078 fma 1 12398765432112345678945678 1E-16 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375079 fma 1 12398765432112345678945678 1E-17 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375080 fma 1 12398765432112345678945678 1E-18 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375081 fma 1 12398765432112345678945678 1E-19 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375082 fma 1 12398765432112345678945678 1E-20 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375083 fma 1 12398765432112345678945678 1E-25 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375084 fma 1 12398765432112345678945678 1E-30 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375085 fma 1 12398765432112345678945678 1E-31 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375086 fma 1 12398765432112345678945678 1E-32 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375087 fma 1 12398765432112345678945678 1E-33 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375088 fma 1 12398765432112345678945678 1E-34 -> 12398765432112345678945678.00000001 Inexact Rounded
+dqadd375089 fma 1 12398765432112345678945678 1E-35 -> 12398765432112345678945678.00000001 Inexact Rounded
+
+-- Destructive subtract (from remainder tests)
+
+-- +++ some of these will be off-by-one remainder vs remainderNear
+
+dqfma4000 fma -1234567890123456789012345678901233 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> -0.234567890123456789012345678901233
+dqfma4001 fma -1234567890123456789012345678901222 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> -0.34567890123456789012345678901222
+dqfma4002 fma -1234567890123456789012345678901111 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.4567890123456789012345678901111
+dqfma4003 fma -308641972530864197253086419725314 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> -1.308641972530864197253086419725314
+dqfma4004 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692
+dqfma4005 fma -246913578024691357802469135780252 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> -1.3086421975308642197530864219748
+dqfma4006 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247
+dqfma4007 fma -246913578024691357802469135780247 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> -0.753086421975308642197530864219753
+dqfma4008 fma -246913578024691357802469135780247 5.000000000000000000000000000000001 1234567890123456789012345678901234 -> -1.246913578024691357802469135780247
+dqfma4009 fma -246913578024691357802469135780246 5.00000000000000000000000000000001 1234567890123456789012345678901234 -> 1.53086421975308642197530864219754
+dqfma4010 fma -246913578024691357802469135780242 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> -0.6913578024691357802469135780242
+dqfma4011 fma -1234567890123456789012345678901232 1.000000000000000000000000000000001 1234567890123456789012345678901234 -> 0.765432109876543210987654321098768
+dqfma4012 fma -1234567890123456789012345678901221 1.00000000000000000000000000000001 1234567890123456789012345678901234 -> 0.65432109876543210987654321098779
+dqfma4013 fma -1234567890123456789012345678901110 1.0000000000000000000000000000001 1234567890123456789012345678901234 -> 0.5432109876543210987654321098890
+dqfma4014 fma -308641972530864197253086419725313 4.000000000000000000000000000000001 1234567890123456789012345678901255 -> 2.691358027469135802746913580274687
+dqfma4015 fma -308641972530864197253086419725308 4.000000000000000000000000000000001 1234567890123456789012345678901234 -> 1.691358027469135802746913580274692
+dqfma4016 fma -246913578024691357802469135780251 4.9999999999999999999999999999999 1234567890123456789012345678901234 -> 3.6913578024691357802469135780251
+dqfma4017 fma -246913578024691357802469135780247 4.99999999999999999999999999999999 1234567890123456789012345678901234 -> 1.46913578024691357802469135780247
+dqfma4018 fma -246913578024691357802469135780246 4.999999999999999999999999999999999 1234567890123456789012345678901234 -> 4.246913578024691357802469135780246
+dqfma4019 fma -246913578024691357802469135780241 5.0000000000000000000000000000001 1234567890123456789012345678901234 -> 4.3086421975308642197530864219759
+
+-- Null tests
+dqadd39990 fma 1 10 # -> NaN Invalid_operation
+dqadd39991 fma 1 # 10 -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/dqInvert.decTest b/Lib/test/decimaltestdata/dqInvert.decTest
index 3a1e29e21d..522cfc80f0 100644
--- a/Lib/test/decimaltestdata/dqInvert.decTest
+++ b/Lib/test/decimaltestdata/dqInvert.decTest
@@ -1,245 +1,245 @@
-------------------------------------------------------------------------
--- dqInvert.decTest -- digitwise logical INVERT for decQuads --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check (truth table)
-dqinv001 invert 0 -> 1111111111111111111111111111111111
-dqinv002 invert 1 -> 1111111111111111111111111111111110
-dqinv003 invert 10 -> 1111111111111111111111111111111101
-dqinv004 invert 111111111 -> 1111111111111111111111111000000000
-dqinv005 invert 000000000 -> 1111111111111111111111111111111111
--- and at msd and msd-1
-dqinv007 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111
-dqinv008 invert 1000000000000000000000000000000000 -> 111111111111111111111111111111111
-dqinv009 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111
-dqinv010 invert 0100000000000000000000000000000000 -> 1011111111111111111111111111111111
-dqinv011 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
-dqinv012 invert 1111111111111111111111111111111111 -> 0
-dqinv013 invert 0011111111111111111111111111111111 -> 1100000000000000000000000000000000
-dqinv014 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
-
--- Various lengths
-dqinv600 invert 0111111111111111111011111111111111 -> 1000000000000000000100000000000000
-dqinv601 invert 0011111111111111110101111111111111 -> 1100000000000000001010000000000000
-dqinv602 invert 0101111111111111101110111111111111 -> 1010000000000000010001000000000000
-dqinv603 invert 0110111111111111011111011111111111 -> 1001000000000000100000100000000000
-dqinv604 invert 0111011111111110111111101111111111 -> 1000100000000001000000010000000000
-dqinv605 invert 0111101111111101111111110111111111 -> 1000010000000010000000001000000000
-dqinv606 invert 0111110111111011111111111011111111 -> 1000001000000100000000000100000000
-dqinv607 invert 0111111011110111111111111101111111 -> 1000000100001000000000000010000000
-dqinv608 invert 0111111101101111111111111110111111 -> 1000000010010000000000000001000000
-dqinv609 invert 0111111110011111111111111111011111 -> 1000000001100000000000000000100000
-dqinv610 invert 0111111110011111111111111111101111 -> 1000000001100000000000000000010000
-dqinv611 invert 0111111101101111111111111111110111 -> 1000000010010000000000000000001000
-dqinv612 invert 0111111011110111111111111111111011 -> 1000000100001000000000000000000100
-dqinv613 invert 0111110111111011111111111111111101 -> 1000001000000100000000000000000010
-dqinv614 invert 0111101111111101111111111111111110 -> 1000010000000010000000000000000001
-dqinv615 invert 0111011111111110111111111111111111 -> 1000100000000001000000000000000000
-dqinv616 invert 0110111111111111011111111111111110 -> 1001000000000000100000000000000001
-dqinv617 invert 0101111111111111101111111111111101 -> 1010000000000000010000000000000010
-dqinv618 invert 0011111111111111110111111111111011 -> 1100000000000000001000000000000100
-dqinv619 invert 0101111111111111111011111111110111 -> 1010000000000000000100000000001000
-dqinv620 invert 0110111111111111111101111111101111 -> 1001000000000000000010000000010000
-dqinv621 invert 0111011111111111111110111111011111 -> 1000100000000000000001000000100000
-dqinv622 invert 0111101111111111111111011110111111 -> 1000010000000000000000100001000000
-dqinv623 invert 0111110111111111111111101101111111 -> 1000001000000000000000010010000000
-dqinv624 invert 0111111011111111111111110011111111 -> 1000000100000000000000001100000000
-dqinv625 invert 0111111101111111111111110011111111 -> 1000000010000000000000001100000000
-dqinv626 invert 0111111110111111111111101101111111 -> 1000000001000000000000010010000000
-dqinv627 invert 0111111111011111111111011110111111 -> 1000000000100000000000100001000000
-dqinv628 invert 0111111111101111111110111111011111 -> 1000000000010000000001000000100000
-dqinv629 invert 0111111111110111111101111111101111 -> 1000000000001000000010000000010000
-dqinv630 invert 0111111111111011111011111111110111 -> 1000000000000100000100000000001000
-dqinv631 invert 0111111111111101110111111111111011 -> 1000000000000010001000000000000100
-dqinv632 invert 0111111111111110101111111111111101 -> 1000000000000001010000000000000010
-dqinv633 invert 0111111111111111011111111111111110 -> 1000000000000000100000000000000001
-
-dqinv021 invert 111111111 -> 1111111111111111111111111000000000
-dqinv022 invert 111111111111 -> 1111111111111111111111000000000000
-dqinv023 invert 11111111 -> 1111111111111111111111111100000000
-dqinv025 invert 1111111 -> 1111111111111111111111111110000000
-dqinv026 invert 111111 -> 1111111111111111111111111111000000
-dqinv027 invert 11111 -> 1111111111111111111111111111100000
-dqinv028 invert 1111 -> 1111111111111111111111111111110000
-dqinv029 invert 111 -> 1111111111111111111111111111111000
-dqinv031 invert 11 -> 1111111111111111111111111111111100
-dqinv032 invert 1 -> 1111111111111111111111111111111110
-dqinv033 invert 111111111111 -> 1111111111111111111111000000000000
-dqinv034 invert 11111111111 -> 1111111111111111111111100000000000
-dqinv035 invert 1111111111 -> 1111111111111111111111110000000000
-dqinv036 invert 111111111 -> 1111111111111111111111111000000000
-
-dqinv040 invert 011111111 -> 1111111111111111111111111100000000
-dqinv041 invert 101111111 -> 1111111111111111111111111010000000
-dqinv042 invert 110111111 -> 1111111111111111111111111001000000
-dqinv043 invert 111011111 -> 1111111111111111111111111000100000
-dqinv044 invert 111101111 -> 1111111111111111111111111000010000
-dqinv045 invert 111110111 -> 1111111111111111111111111000001000
-dqinv046 invert 111111011 -> 1111111111111111111111111000000100
-dqinv047 invert 111111101 -> 1111111111111111111111111000000010
-dqinv048 invert 111111110 -> 1111111111111111111111111000000001
-dqinv049 invert 011111011 -> 1111111111111111111111111100000100
-dqinv050 invert 101111101 -> 1111111111111111111111111010000010
-dqinv051 invert 110111110 -> 1111111111111111111111111001000001
-dqinv052 invert 111011101 -> 1111111111111111111111111000100010
-dqinv053 invert 111101011 -> 1111111111111111111111111000010100
-dqinv054 invert 111110111 -> 1111111111111111111111111000001000
-dqinv055 invert 111101011 -> 1111111111111111111111111000010100
-dqinv056 invert 111011101 -> 1111111111111111111111111000100010
-dqinv057 invert 110111110 -> 1111111111111111111111111001000001
-dqinv058 invert 101111101 -> 1111111111111111111111111010000010
-dqinv059 invert 011111011 -> 1111111111111111111111111100000100
-
-dqinv080 invert 1000000011111111 -> 1111111111111111110111111100000000
-dqinv081 invert 0100000101111111 -> 1111111111111111111011111010000000
-dqinv082 invert 0010000110111111 -> 1111111111111111111101111001000000
-dqinv083 invert 0001000111011111 -> 1111111111111111111110111000100000
-dqinv084 invert 0000100111101111 -> 1111111111111111111111011000010000
-dqinv085 invert 0000010111110111 -> 1111111111111111111111101000001000
-dqinv086 invert 0000001111111011 -> 1111111111111111111111110000000100
-dqinv087 invert 0000010111111101 -> 1111111111111111111111101000000010
-dqinv088 invert 0000100111111110 -> 1111111111111111111111011000000001
-dqinv089 invert 0001000011111011 -> 1111111111111111111110111100000100
-dqinv090 invert 0010000101111101 -> 1111111111111111111101111010000010
-dqinv091 invert 0100000110111110 -> 1111111111111111111011111001000001
-dqinv092 invert 1000000111011101 -> 1111111111111111110111111000100010
-dqinv093 invert 0100000111101011 -> 1111111111111111111011111000010100
-dqinv094 invert 0010000111110111 -> 1111111111111111111101111000001000
-dqinv095 invert 0001000111101011 -> 1111111111111111111110111000010100
-dqinv096 invert 0000100111011101 -> 1111111111111111111111011000100010
-dqinv097 invert 0000010110111110 -> 1111111111111111111111101001000001
-dqinv098 invert 0000001101111101 -> 1111111111111111111111110010000010
-dqinv099 invert 0000010011111011 -> 1111111111111111111111101100000100
-
--- and more thorough MSD/LSD tests [8 and 9 mght be encoded differently...]
-dqinv151 invert 1111111111111111111111111111111110 -> 1
-dqinv152 invert 1111111111111111110000000000000000 -> 1111111111111111
-dqinv153 invert 1000000000000000001111111111111111 -> 111111111111111110000000000000000
-dqinv154 invert 1111111111111111111000000000000000 -> 111111111111111
-dqinv155 invert 0100000000000000000111111111111111 -> 1011111111111111111000000000000000
-dqinv156 invert 1011111111111111110100000000000000 -> 100000000000000001011111111111111
-dqinv157 invert 1101111111111111110111111111111111 -> 10000000000000001000000000000000
-dqinv158 invert 1110111111111111110011111111111111 -> 1000000000000001100000000000000
-
--- non-0/1 should not be accepted, nor should signs
-dqinv220 invert 111111112 -> NaN Invalid_operation
-dqinv221 invert 333333333 -> NaN Invalid_operation
-dqinv222 invert 555555555 -> NaN Invalid_operation
-dqinv223 invert 777777777 -> NaN Invalid_operation
-dqinv224 invert 999999999 -> NaN Invalid_operation
-dqinv225 invert 222222222 -> NaN Invalid_operation
-dqinv226 invert 444444444 -> NaN Invalid_operation
-dqinv227 invert 666666666 -> NaN Invalid_operation
-dqinv228 invert 888888888 -> NaN Invalid_operation
-dqinv229 invert 999999999 -> NaN Invalid_operation
-dqinv230 invert 999999999 -> NaN Invalid_operation
-dqinv231 invert 999999999 -> NaN Invalid_operation
-dqinv232 invert 999999999 -> NaN Invalid_operation
--- a few randoms
-dqinv240 invert 567468689 -> NaN Invalid_operation
-dqinv241 invert 567367689 -> NaN Invalid_operation
-dqinv242 invert -631917772 -> NaN Invalid_operation
-dqinv243 invert -756253257 -> NaN Invalid_operation
-dqinv244 invert 835590149 -> NaN Invalid_operation
--- test MSD
-dqinv250 invert 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv251 invert 3000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv252 invert 4000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv253 invert 5000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv254 invert 6000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv255 invert 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv256 invert 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqinv257 invert 9000000111000111000111000000000000 -> NaN Invalid_operation
--- test MSD-1
-dqinv270 invert 0200000111000111000111001000000000 -> NaN Invalid_operation
-dqinv271 invert 0300000111000111000111000100000000 -> NaN Invalid_operation
-dqinv272 invert 0400000111000111000111000010000000 -> NaN Invalid_operation
-dqinv273 invert 0500000111000111000111000001000000 -> NaN Invalid_operation
-dqinv274 invert 1600000111000111000111000000100000 -> NaN Invalid_operation
-dqinv275 invert 1700000111000111000111000000010000 -> NaN Invalid_operation
-dqinv276 invert 1800000111000111000111000000001000 -> NaN Invalid_operation
-dqinv277 invert 1900000111000111000111000000000100 -> NaN Invalid_operation
--- test LSD
-dqinv280 invert 0010000111000111000111000000000002 -> NaN Invalid_operation
-dqinv281 invert 0001000111000111000111000000000003 -> NaN Invalid_operation
-dqinv282 invert 0000000111000111000111100000000004 -> NaN Invalid_operation
-dqinv283 invert 0000000111000111000111010000000005 -> NaN Invalid_operation
-dqinv284 invert 1000000111000111000111001000000006 -> NaN Invalid_operation
-dqinv285 invert 1000000111000111000111000100000007 -> NaN Invalid_operation
-dqinv286 invert 1000000111000111000111000010000008 -> NaN Invalid_operation
-dqinv287 invert 1000000111000111000111000001000009 -> NaN Invalid_operation
--- test Middie
-dqinv288 invert 0010000111000111000111000020000000 -> NaN Invalid_operation
-dqinv289 invert 0001000111000111000111000030000001 -> NaN Invalid_operation
-dqinv290 invert 0000000111000111000111100040000010 -> NaN Invalid_operation
-dqinv291 invert 0000000111000111000111010050000100 -> NaN Invalid_operation
-dqinv292 invert 1000000111000111000111001060001000 -> NaN Invalid_operation
-dqinv293 invert 1000000111000111000111000170010000 -> NaN Invalid_operation
-dqinv294 invert 1000000111000111000111000080100000 -> NaN Invalid_operation
-dqinv295 invert 1000000111000111000111000091000000 -> NaN Invalid_operation
--- signs
-dqinv296 invert -1000000111000111000111000001000000 -> NaN Invalid_operation
-dqinv299 invert 1000000111000111000111000001000000 -> 111111000111000111000111110111111
-
--- Nmax, Nmin, Ntiny-like
-dqinv341 invert 9.99999999E+2998 -> NaN Invalid_operation
-dqinv342 invert 1E-2998 -> NaN Invalid_operation
-dqinv343 invert 1.00000000E-2998 -> NaN Invalid_operation
-dqinv344 invert 1E-2078 -> NaN Invalid_operation
-dqinv345 invert -1E-2078 -> NaN Invalid_operation
-dqinv346 invert -1.00000000E-2998 -> NaN Invalid_operation
-dqinv347 invert -1E-2998 -> NaN Invalid_operation
-dqinv348 invert -9.99999999E+2998 -> NaN Invalid_operation
-
--- A few other non-integers
-dqinv361 invert 1.0 -> NaN Invalid_operation
-dqinv362 invert 1E+1 -> NaN Invalid_operation
-dqinv363 invert 0.0 -> NaN Invalid_operation
-dqinv364 invert 0E+1 -> NaN Invalid_operation
-dqinv365 invert 9.9 -> NaN Invalid_operation
-dqinv366 invert 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-dqinv788 invert -Inf -> NaN Invalid_operation
-dqinv794 invert Inf -> NaN Invalid_operation
-dqinv821 invert NaN -> NaN Invalid_operation
-dqinv841 invert sNaN -> NaN Invalid_operation
--- propagating NaNs
-dqinv861 invert NaN1 -> NaN Invalid_operation
-dqinv862 invert +NaN2 -> NaN Invalid_operation
-dqinv863 invert NaN3 -> NaN Invalid_operation
-dqinv864 invert NaN4 -> NaN Invalid_operation
-dqinv865 invert NaN5 -> NaN Invalid_operation
-dqinv871 invert sNaN11 -> NaN Invalid_operation
-dqinv872 invert sNaN12 -> NaN Invalid_operation
-dqinv873 invert sNaN13 -> NaN Invalid_operation
-dqinv874 invert sNaN14 -> NaN Invalid_operation
-dqinv875 invert sNaN15 -> NaN Invalid_operation
-dqinv876 invert NaN16 -> NaN Invalid_operation
-dqinv881 invert +NaN25 -> NaN Invalid_operation
-dqinv882 invert -NaN26 -> NaN Invalid_operation
-dqinv883 invert -sNaN27 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqInvert.decTest -- digitwise logical INVERT for decQuads --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check (truth table)
+dqinv001 invert 0 -> 1111111111111111111111111111111111
+dqinv002 invert 1 -> 1111111111111111111111111111111110
+dqinv003 invert 10 -> 1111111111111111111111111111111101
+dqinv004 invert 111111111 -> 1111111111111111111111111000000000
+dqinv005 invert 000000000 -> 1111111111111111111111111111111111
+-- and at msd and msd-1
+dqinv007 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111
+dqinv008 invert 1000000000000000000000000000000000 -> 111111111111111111111111111111111
+dqinv009 invert 0000000000000000000000000000000000 -> 1111111111111111111111111111111111
+dqinv010 invert 0100000000000000000000000000000000 -> 1011111111111111111111111111111111
+dqinv011 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
+dqinv012 invert 1111111111111111111111111111111111 -> 0
+dqinv013 invert 0011111111111111111111111111111111 -> 1100000000000000000000000000000000
+dqinv014 invert 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
+
+-- Various lengths
+dqinv600 invert 0111111111111111111011111111111111 -> 1000000000000000000100000000000000
+dqinv601 invert 0011111111111111110101111111111111 -> 1100000000000000001010000000000000
+dqinv602 invert 0101111111111111101110111111111111 -> 1010000000000000010001000000000000
+dqinv603 invert 0110111111111111011111011111111111 -> 1001000000000000100000100000000000
+dqinv604 invert 0111011111111110111111101111111111 -> 1000100000000001000000010000000000
+dqinv605 invert 0111101111111101111111110111111111 -> 1000010000000010000000001000000000
+dqinv606 invert 0111110111111011111111111011111111 -> 1000001000000100000000000100000000
+dqinv607 invert 0111111011110111111111111101111111 -> 1000000100001000000000000010000000
+dqinv608 invert 0111111101101111111111111110111111 -> 1000000010010000000000000001000000
+dqinv609 invert 0111111110011111111111111111011111 -> 1000000001100000000000000000100000
+dqinv610 invert 0111111110011111111111111111101111 -> 1000000001100000000000000000010000
+dqinv611 invert 0111111101101111111111111111110111 -> 1000000010010000000000000000001000
+dqinv612 invert 0111111011110111111111111111111011 -> 1000000100001000000000000000000100
+dqinv613 invert 0111110111111011111111111111111101 -> 1000001000000100000000000000000010
+dqinv614 invert 0111101111111101111111111111111110 -> 1000010000000010000000000000000001
+dqinv615 invert 0111011111111110111111111111111111 -> 1000100000000001000000000000000000
+dqinv616 invert 0110111111111111011111111111111110 -> 1001000000000000100000000000000001
+dqinv617 invert 0101111111111111101111111111111101 -> 1010000000000000010000000000000010
+dqinv618 invert 0011111111111111110111111111111011 -> 1100000000000000001000000000000100
+dqinv619 invert 0101111111111111111011111111110111 -> 1010000000000000000100000000001000
+dqinv620 invert 0110111111111111111101111111101111 -> 1001000000000000000010000000010000
+dqinv621 invert 0111011111111111111110111111011111 -> 1000100000000000000001000000100000
+dqinv622 invert 0111101111111111111111011110111111 -> 1000010000000000000000100001000000
+dqinv623 invert 0111110111111111111111101101111111 -> 1000001000000000000000010010000000
+dqinv624 invert 0111111011111111111111110011111111 -> 1000000100000000000000001100000000
+dqinv625 invert 0111111101111111111111110011111111 -> 1000000010000000000000001100000000
+dqinv626 invert 0111111110111111111111101101111111 -> 1000000001000000000000010010000000
+dqinv627 invert 0111111111011111111111011110111111 -> 1000000000100000000000100001000000
+dqinv628 invert 0111111111101111111110111111011111 -> 1000000000010000000001000000100000
+dqinv629 invert 0111111111110111111101111111101111 -> 1000000000001000000010000000010000
+dqinv630 invert 0111111111111011111011111111110111 -> 1000000000000100000100000000001000
+dqinv631 invert 0111111111111101110111111111111011 -> 1000000000000010001000000000000100
+dqinv632 invert 0111111111111110101111111111111101 -> 1000000000000001010000000000000010
+dqinv633 invert 0111111111111111011111111111111110 -> 1000000000000000100000000000000001
+
+dqinv021 invert 111111111 -> 1111111111111111111111111000000000
+dqinv022 invert 111111111111 -> 1111111111111111111111000000000000
+dqinv023 invert 11111111 -> 1111111111111111111111111100000000
+dqinv025 invert 1111111 -> 1111111111111111111111111110000000
+dqinv026 invert 111111 -> 1111111111111111111111111111000000
+dqinv027 invert 11111 -> 1111111111111111111111111111100000
+dqinv028 invert 1111 -> 1111111111111111111111111111110000
+dqinv029 invert 111 -> 1111111111111111111111111111111000
+dqinv031 invert 11 -> 1111111111111111111111111111111100
+dqinv032 invert 1 -> 1111111111111111111111111111111110
+dqinv033 invert 111111111111 -> 1111111111111111111111000000000000
+dqinv034 invert 11111111111 -> 1111111111111111111111100000000000
+dqinv035 invert 1111111111 -> 1111111111111111111111110000000000
+dqinv036 invert 111111111 -> 1111111111111111111111111000000000
+
+dqinv040 invert 011111111 -> 1111111111111111111111111100000000
+dqinv041 invert 101111111 -> 1111111111111111111111111010000000
+dqinv042 invert 110111111 -> 1111111111111111111111111001000000
+dqinv043 invert 111011111 -> 1111111111111111111111111000100000
+dqinv044 invert 111101111 -> 1111111111111111111111111000010000
+dqinv045 invert 111110111 -> 1111111111111111111111111000001000
+dqinv046 invert 111111011 -> 1111111111111111111111111000000100
+dqinv047 invert 111111101 -> 1111111111111111111111111000000010
+dqinv048 invert 111111110 -> 1111111111111111111111111000000001
+dqinv049 invert 011111011 -> 1111111111111111111111111100000100
+dqinv050 invert 101111101 -> 1111111111111111111111111010000010
+dqinv051 invert 110111110 -> 1111111111111111111111111001000001
+dqinv052 invert 111011101 -> 1111111111111111111111111000100010
+dqinv053 invert 111101011 -> 1111111111111111111111111000010100
+dqinv054 invert 111110111 -> 1111111111111111111111111000001000
+dqinv055 invert 111101011 -> 1111111111111111111111111000010100
+dqinv056 invert 111011101 -> 1111111111111111111111111000100010
+dqinv057 invert 110111110 -> 1111111111111111111111111001000001
+dqinv058 invert 101111101 -> 1111111111111111111111111010000010
+dqinv059 invert 011111011 -> 1111111111111111111111111100000100
+
+dqinv080 invert 1000000011111111 -> 1111111111111111110111111100000000
+dqinv081 invert 0100000101111111 -> 1111111111111111111011111010000000
+dqinv082 invert 0010000110111111 -> 1111111111111111111101111001000000
+dqinv083 invert 0001000111011111 -> 1111111111111111111110111000100000
+dqinv084 invert 0000100111101111 -> 1111111111111111111111011000010000
+dqinv085 invert 0000010111110111 -> 1111111111111111111111101000001000
+dqinv086 invert 0000001111111011 -> 1111111111111111111111110000000100
+dqinv087 invert 0000010111111101 -> 1111111111111111111111101000000010
+dqinv088 invert 0000100111111110 -> 1111111111111111111111011000000001
+dqinv089 invert 0001000011111011 -> 1111111111111111111110111100000100
+dqinv090 invert 0010000101111101 -> 1111111111111111111101111010000010
+dqinv091 invert 0100000110111110 -> 1111111111111111111011111001000001
+dqinv092 invert 1000000111011101 -> 1111111111111111110111111000100010
+dqinv093 invert 0100000111101011 -> 1111111111111111111011111000010100
+dqinv094 invert 0010000111110111 -> 1111111111111111111101111000001000
+dqinv095 invert 0001000111101011 -> 1111111111111111111110111000010100
+dqinv096 invert 0000100111011101 -> 1111111111111111111111011000100010
+dqinv097 invert 0000010110111110 -> 1111111111111111111111101001000001
+dqinv098 invert 0000001101111101 -> 1111111111111111111111110010000010
+dqinv099 invert 0000010011111011 -> 1111111111111111111111101100000100
+
+-- and more thorough MSD/LSD tests [8 and 9 mght be encoded differently...]
+dqinv151 invert 1111111111111111111111111111111110 -> 1
+dqinv152 invert 1111111111111111110000000000000000 -> 1111111111111111
+dqinv153 invert 1000000000000000001111111111111111 -> 111111111111111110000000000000000
+dqinv154 invert 1111111111111111111000000000000000 -> 111111111111111
+dqinv155 invert 0100000000000000000111111111111111 -> 1011111111111111111000000000000000
+dqinv156 invert 1011111111111111110100000000000000 -> 100000000000000001011111111111111
+dqinv157 invert 1101111111111111110111111111111111 -> 10000000000000001000000000000000
+dqinv158 invert 1110111111111111110011111111111111 -> 1000000000000001100000000000000
+
+-- non-0/1 should not be accepted, nor should signs
+dqinv220 invert 111111112 -> NaN Invalid_operation
+dqinv221 invert 333333333 -> NaN Invalid_operation
+dqinv222 invert 555555555 -> NaN Invalid_operation
+dqinv223 invert 777777777 -> NaN Invalid_operation
+dqinv224 invert 999999999 -> NaN Invalid_operation
+dqinv225 invert 222222222 -> NaN Invalid_operation
+dqinv226 invert 444444444 -> NaN Invalid_operation
+dqinv227 invert 666666666 -> NaN Invalid_operation
+dqinv228 invert 888888888 -> NaN Invalid_operation
+dqinv229 invert 999999999 -> NaN Invalid_operation
+dqinv230 invert 999999999 -> NaN Invalid_operation
+dqinv231 invert 999999999 -> NaN Invalid_operation
+dqinv232 invert 999999999 -> NaN Invalid_operation
+-- a few randoms
+dqinv240 invert 567468689 -> NaN Invalid_operation
+dqinv241 invert 567367689 -> NaN Invalid_operation
+dqinv242 invert -631917772 -> NaN Invalid_operation
+dqinv243 invert -756253257 -> NaN Invalid_operation
+dqinv244 invert 835590149 -> NaN Invalid_operation
+-- test MSD
+dqinv250 invert 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv251 invert 3000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv252 invert 4000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv253 invert 5000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv254 invert 6000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv255 invert 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv256 invert 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqinv257 invert 9000000111000111000111000000000000 -> NaN Invalid_operation
+-- test MSD-1
+dqinv270 invert 0200000111000111000111001000000000 -> NaN Invalid_operation
+dqinv271 invert 0300000111000111000111000100000000 -> NaN Invalid_operation
+dqinv272 invert 0400000111000111000111000010000000 -> NaN Invalid_operation
+dqinv273 invert 0500000111000111000111000001000000 -> NaN Invalid_operation
+dqinv274 invert 1600000111000111000111000000100000 -> NaN Invalid_operation
+dqinv275 invert 1700000111000111000111000000010000 -> NaN Invalid_operation
+dqinv276 invert 1800000111000111000111000000001000 -> NaN Invalid_operation
+dqinv277 invert 1900000111000111000111000000000100 -> NaN Invalid_operation
+-- test LSD
+dqinv280 invert 0010000111000111000111000000000002 -> NaN Invalid_operation
+dqinv281 invert 0001000111000111000111000000000003 -> NaN Invalid_operation
+dqinv282 invert 0000000111000111000111100000000004 -> NaN Invalid_operation
+dqinv283 invert 0000000111000111000111010000000005 -> NaN Invalid_operation
+dqinv284 invert 1000000111000111000111001000000006 -> NaN Invalid_operation
+dqinv285 invert 1000000111000111000111000100000007 -> NaN Invalid_operation
+dqinv286 invert 1000000111000111000111000010000008 -> NaN Invalid_operation
+dqinv287 invert 1000000111000111000111000001000009 -> NaN Invalid_operation
+-- test Middie
+dqinv288 invert 0010000111000111000111000020000000 -> NaN Invalid_operation
+dqinv289 invert 0001000111000111000111000030000001 -> NaN Invalid_operation
+dqinv290 invert 0000000111000111000111100040000010 -> NaN Invalid_operation
+dqinv291 invert 0000000111000111000111010050000100 -> NaN Invalid_operation
+dqinv292 invert 1000000111000111000111001060001000 -> NaN Invalid_operation
+dqinv293 invert 1000000111000111000111000170010000 -> NaN Invalid_operation
+dqinv294 invert 1000000111000111000111000080100000 -> NaN Invalid_operation
+dqinv295 invert 1000000111000111000111000091000000 -> NaN Invalid_operation
+-- signs
+dqinv296 invert -1000000111000111000111000001000000 -> NaN Invalid_operation
+dqinv299 invert 1000000111000111000111000001000000 -> 111111000111000111000111110111111
+
+-- Nmax, Nmin, Ntiny-like
+dqinv341 invert 9.99999999E+2998 -> NaN Invalid_operation
+dqinv342 invert 1E-2998 -> NaN Invalid_operation
+dqinv343 invert 1.00000000E-2998 -> NaN Invalid_operation
+dqinv344 invert 1E-2078 -> NaN Invalid_operation
+dqinv345 invert -1E-2078 -> NaN Invalid_operation
+dqinv346 invert -1.00000000E-2998 -> NaN Invalid_operation
+dqinv347 invert -1E-2998 -> NaN Invalid_operation
+dqinv348 invert -9.99999999E+2998 -> NaN Invalid_operation
+
+-- A few other non-integers
+dqinv361 invert 1.0 -> NaN Invalid_operation
+dqinv362 invert 1E+1 -> NaN Invalid_operation
+dqinv363 invert 0.0 -> NaN Invalid_operation
+dqinv364 invert 0E+1 -> NaN Invalid_operation
+dqinv365 invert 9.9 -> NaN Invalid_operation
+dqinv366 invert 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+dqinv788 invert -Inf -> NaN Invalid_operation
+dqinv794 invert Inf -> NaN Invalid_operation
+dqinv821 invert NaN -> NaN Invalid_operation
+dqinv841 invert sNaN -> NaN Invalid_operation
+-- propagating NaNs
+dqinv861 invert NaN1 -> NaN Invalid_operation
+dqinv862 invert +NaN2 -> NaN Invalid_operation
+dqinv863 invert NaN3 -> NaN Invalid_operation
+dqinv864 invert NaN4 -> NaN Invalid_operation
+dqinv865 invert NaN5 -> NaN Invalid_operation
+dqinv871 invert sNaN11 -> NaN Invalid_operation
+dqinv872 invert sNaN12 -> NaN Invalid_operation
+dqinv873 invert sNaN13 -> NaN Invalid_operation
+dqinv874 invert sNaN14 -> NaN Invalid_operation
+dqinv875 invert sNaN15 -> NaN Invalid_operation
+dqinv876 invert NaN16 -> NaN Invalid_operation
+dqinv881 invert +NaN25 -> NaN Invalid_operation
+dqinv882 invert -NaN26 -> NaN Invalid_operation
+dqinv883 invert -sNaN27 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqLogB.decTest b/Lib/test/decimaltestdata/dqLogB.decTest
index a18313dc01..449f3dcb8d 100644
--- a/Lib/test/decimaltestdata/dqLogB.decTest
+++ b/Lib/test/decimaltestdata/dqLogB.decTest
@@ -1,160 +1,160 @@
-------------------------------------------------------------------------
--- dqLogB.decTest -- integral 754r adjusted exponent, for decQuads --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- basics
-dqlogb000 logb 0 -> -Infinity Division_by_zero
-dqlogb001 logb 1E-6176 -> -6176
-dqlogb002 logb 1E-6143 -> -6143
-dqlogb003 logb 0.001 -> -3
-dqlogb004 logb 0.03 -> -2
-dqlogb005 logb 1 -> 0
-dqlogb006 logb 2 -> 0
-dqlogb007 logb 2.5 -> 0
-dqlogb008 logb 2.50 -> 0
-dqlogb009 logb 2.500 -> 0
-dqlogb010 logb 10 -> 1
-dqlogb011 logb 70 -> 1
-dqlogb012 logb 100 -> 2
-dqlogb013 logb 250 -> 2
-dqlogb014 logb 9E+6144 -> 6144
-dqlogb015 logb +Infinity -> Infinity
-
--- negatives appear to be treated as positives
-dqlogb021 logb -0 -> -Infinity Division_by_zero
-dqlogb022 logb -1E-6176 -> -6176
-dqlogb023 logb -9E-6143 -> -6143
-dqlogb024 logb -0.001 -> -3
-dqlogb025 logb -1 -> 0
-dqlogb026 logb -2 -> 0
-dqlogb027 logb -10 -> 1
-dqlogb028 logb -70 -> 1
-dqlogb029 logb -100 -> 2
-dqlogb030 logb -9E+6144 -> 6144
-dqlogb031 logb -Infinity -> Infinity
-
--- zeros
-dqlogb111 logb 0 -> -Infinity Division_by_zero
-dqlogb112 logb -0 -> -Infinity Division_by_zero
-dqlogb113 logb 0E+4 -> -Infinity Division_by_zero
-dqlogb114 logb -0E+4 -> -Infinity Division_by_zero
-dqlogb115 logb 0.0000 -> -Infinity Division_by_zero
-dqlogb116 logb -0.0000 -> -Infinity Division_by_zero
-dqlogb117 logb 0E-141 -> -Infinity Division_by_zero
-dqlogb118 logb -0E-141 -> -Infinity Division_by_zero
-
--- full coefficients, alternating bits
-dqlogb121 logb 268268268 -> 8
-dqlogb122 logb -268268268 -> 8
-dqlogb123 logb 134134134 -> 8
-dqlogb124 logb -134134134 -> 8
-
--- Nmax, Nmin, Ntiny
-dqlogb131 logb 9.999999999999999999999999999999999E+6144 -> 6144
-dqlogb132 logb 1E-6143 -> -6143
-dqlogb133 logb 1.000000000000000000000000000000000E-6143 -> -6143
-dqlogb134 logb 1E-6176 -> -6176
-
-dqlogb135 logb -1E-6176 -> -6176
-dqlogb136 logb -1.000000000000000000000000000000000E-6143 -> -6143
-dqlogb137 logb -1E-6143 -> -6143
-dqlogb1614 logb -9.999999999999999999999999999999999E+6144 -> 6144
-
--- ones
-dqlogb0061 logb 1 -> 0
-dqlogb0062 logb 1.0 -> 0
-dqlogb0063 logb 1.000000000000000 -> 0
-
--- notable cases -- exact powers of 10
-dqlogb1100 logb 1 -> 0
-dqlogb1101 logb 10 -> 1
-dqlogb1102 logb 100 -> 2
-dqlogb1103 logb 1000 -> 3
-dqlogb1104 logb 10000 -> 4
-dqlogb1105 logb 100000 -> 5
-dqlogb1106 logb 1000000 -> 6
-dqlogb1107 logb 10000000 -> 7
-dqlogb1108 logb 100000000 -> 8
-dqlogb1109 logb 1000000000 -> 9
-dqlogb1110 logb 10000000000 -> 10
-dqlogb1111 logb 100000000000 -> 11
-dqlogb1112 logb 1000000000000 -> 12
-dqlogb1113 logb 0.00000000001 -> -11
-dqlogb1114 logb 0.0000000001 -> -10
-dqlogb1115 logb 0.000000001 -> -9
-dqlogb1116 logb 0.00000001 -> -8
-dqlogb1117 logb 0.0000001 -> -7
-dqlogb1118 logb 0.000001 -> -6
-dqlogb1119 logb 0.00001 -> -5
-dqlogb1120 logb 0.0001 -> -4
-dqlogb1121 logb 0.001 -> -3
-dqlogb1122 logb 0.01 -> -2
-dqlogb1123 logb 0.1 -> -1
-dqlogb1124 logb 1E-99 -> -99
-dqlogb1125 logb 1E-100 -> -100
-dqlogb1127 logb 1E-299 -> -299
-dqlogb1126 logb 1E-6143 -> -6143
-
--- suggestions from Ilan Nehama
-dqlogb1400 logb 10E-3 -> -2
-dqlogb1401 logb 10E-2 -> -1
-dqlogb1402 logb 100E-2 -> 0
-dqlogb1403 logb 1000E-2 -> 1
-dqlogb1404 logb 10000E-2 -> 2
-dqlogb1405 logb 10E-1 -> 0
-dqlogb1406 logb 100E-1 -> 1
-dqlogb1407 logb 1000E-1 -> 2
-dqlogb1408 logb 10000E-1 -> 3
-dqlogb1409 logb 10E0 -> 1
-dqlogb1410 logb 100E0 -> 2
-dqlogb1411 logb 1000E0 -> 3
-dqlogb1412 logb 10000E0 -> 4
-dqlogb1413 logb 10E1 -> 2
-dqlogb1414 logb 100E1 -> 3
-dqlogb1415 logb 1000E1 -> 4
-dqlogb1416 logb 10000E1 -> 5
-dqlogb1417 logb 10E2 -> 3
-dqlogb1418 logb 100E2 -> 4
-dqlogb1419 logb 1000E2 -> 5
-dqlogb1420 logb 10000E2 -> 6
-
--- special values
-dqlogb820 logb Infinity -> Infinity
-dqlogb821 logb 0 -> -Infinity Division_by_zero
-dqlogb822 logb NaN -> NaN
-dqlogb823 logb sNaN -> NaN Invalid_operation
--- propagating NaNs
-dqlogb824 logb sNaN123 -> NaN123 Invalid_operation
-dqlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
-dqlogb826 logb NaN456 -> NaN456
-dqlogb827 logb -NaN654 -> -NaN654
-dqlogb828 logb NaN1 -> NaN1
-
--- Null test
-dqlogb900 logb # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- dqLogB.decTest -- integral 754r adjusted exponent, for decQuads --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- basics
+dqlogb000 logb 0 -> -Infinity Division_by_zero
+dqlogb001 logb 1E-6176 -> -6176
+dqlogb002 logb 1E-6143 -> -6143
+dqlogb003 logb 0.001 -> -3
+dqlogb004 logb 0.03 -> -2
+dqlogb005 logb 1 -> 0
+dqlogb006 logb 2 -> 0
+dqlogb007 logb 2.5 -> 0
+dqlogb008 logb 2.50 -> 0
+dqlogb009 logb 2.500 -> 0
+dqlogb010 logb 10 -> 1
+dqlogb011 logb 70 -> 1
+dqlogb012 logb 100 -> 2
+dqlogb013 logb 250 -> 2
+dqlogb014 logb 9E+6144 -> 6144
+dqlogb015 logb +Infinity -> Infinity
+
+-- negatives appear to be treated as positives
+dqlogb021 logb -0 -> -Infinity Division_by_zero
+dqlogb022 logb -1E-6176 -> -6176
+dqlogb023 logb -9E-6143 -> -6143
+dqlogb024 logb -0.001 -> -3
+dqlogb025 logb -1 -> 0
+dqlogb026 logb -2 -> 0
+dqlogb027 logb -10 -> 1
+dqlogb028 logb -70 -> 1
+dqlogb029 logb -100 -> 2
+dqlogb030 logb -9E+6144 -> 6144
+dqlogb031 logb -Infinity -> Infinity
+
+-- zeros
+dqlogb111 logb 0 -> -Infinity Division_by_zero
+dqlogb112 logb -0 -> -Infinity Division_by_zero
+dqlogb113 logb 0E+4 -> -Infinity Division_by_zero
+dqlogb114 logb -0E+4 -> -Infinity Division_by_zero
+dqlogb115 logb 0.0000 -> -Infinity Division_by_zero
+dqlogb116 logb -0.0000 -> -Infinity Division_by_zero
+dqlogb117 logb 0E-141 -> -Infinity Division_by_zero
+dqlogb118 logb -0E-141 -> -Infinity Division_by_zero
+
+-- full coefficients, alternating bits
+dqlogb121 logb 268268268 -> 8
+dqlogb122 logb -268268268 -> 8
+dqlogb123 logb 134134134 -> 8
+dqlogb124 logb -134134134 -> 8
+
+-- Nmax, Nmin, Ntiny
+dqlogb131 logb 9.999999999999999999999999999999999E+6144 -> 6144
+dqlogb132 logb 1E-6143 -> -6143
+dqlogb133 logb 1.000000000000000000000000000000000E-6143 -> -6143
+dqlogb134 logb 1E-6176 -> -6176
+
+dqlogb135 logb -1E-6176 -> -6176
+dqlogb136 logb -1.000000000000000000000000000000000E-6143 -> -6143
+dqlogb137 logb -1E-6143 -> -6143
+dqlogb1614 logb -9.999999999999999999999999999999999E+6144 -> 6144
+
+-- ones
+dqlogb0061 logb 1 -> 0
+dqlogb0062 logb 1.0 -> 0
+dqlogb0063 logb 1.000000000000000 -> 0
+
+-- notable cases -- exact powers of 10
+dqlogb1100 logb 1 -> 0
+dqlogb1101 logb 10 -> 1
+dqlogb1102 logb 100 -> 2
+dqlogb1103 logb 1000 -> 3
+dqlogb1104 logb 10000 -> 4
+dqlogb1105 logb 100000 -> 5
+dqlogb1106 logb 1000000 -> 6
+dqlogb1107 logb 10000000 -> 7
+dqlogb1108 logb 100000000 -> 8
+dqlogb1109 logb 1000000000 -> 9
+dqlogb1110 logb 10000000000 -> 10
+dqlogb1111 logb 100000000000 -> 11
+dqlogb1112 logb 1000000000000 -> 12
+dqlogb1113 logb 0.00000000001 -> -11
+dqlogb1114 logb 0.0000000001 -> -10
+dqlogb1115 logb 0.000000001 -> -9
+dqlogb1116 logb 0.00000001 -> -8
+dqlogb1117 logb 0.0000001 -> -7
+dqlogb1118 logb 0.000001 -> -6
+dqlogb1119 logb 0.00001 -> -5
+dqlogb1120 logb 0.0001 -> -4
+dqlogb1121 logb 0.001 -> -3
+dqlogb1122 logb 0.01 -> -2
+dqlogb1123 logb 0.1 -> -1
+dqlogb1124 logb 1E-99 -> -99
+dqlogb1125 logb 1E-100 -> -100
+dqlogb1127 logb 1E-299 -> -299
+dqlogb1126 logb 1E-6143 -> -6143
+
+-- suggestions from Ilan Nehama
+dqlogb1400 logb 10E-3 -> -2
+dqlogb1401 logb 10E-2 -> -1
+dqlogb1402 logb 100E-2 -> 0
+dqlogb1403 logb 1000E-2 -> 1
+dqlogb1404 logb 10000E-2 -> 2
+dqlogb1405 logb 10E-1 -> 0
+dqlogb1406 logb 100E-1 -> 1
+dqlogb1407 logb 1000E-1 -> 2
+dqlogb1408 logb 10000E-1 -> 3
+dqlogb1409 logb 10E0 -> 1
+dqlogb1410 logb 100E0 -> 2
+dqlogb1411 logb 1000E0 -> 3
+dqlogb1412 logb 10000E0 -> 4
+dqlogb1413 logb 10E1 -> 2
+dqlogb1414 logb 100E1 -> 3
+dqlogb1415 logb 1000E1 -> 4
+dqlogb1416 logb 10000E1 -> 5
+dqlogb1417 logb 10E2 -> 3
+dqlogb1418 logb 100E2 -> 4
+dqlogb1419 logb 1000E2 -> 5
+dqlogb1420 logb 10000E2 -> 6
+
+-- special values
+dqlogb820 logb Infinity -> Infinity
+dqlogb821 logb 0 -> -Infinity Division_by_zero
+dqlogb822 logb NaN -> NaN
+dqlogb823 logb sNaN -> NaN Invalid_operation
+-- propagating NaNs
+dqlogb824 logb sNaN123 -> NaN123 Invalid_operation
+dqlogb825 logb -sNaN321 -> -NaN321 Invalid_operation
+dqlogb826 logb NaN456 -> NaN456
+dqlogb827 logb -NaN654 -> -NaN654
+dqlogb828 logb NaN1 -> NaN1
+
+-- Null test
+dqlogb900 logb # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/dqMax.decTest b/Lib/test/decimaltestdata/dqMax.decTest
index dc6a1ab8f8..162d4bda3d 100644
--- a/Lib/test/decimaltestdata/dqMax.decTest
+++ b/Lib/test/decimaltestdata/dqMax.decTest
@@ -1,322 +1,322 @@
-------------------------------------------------------------------------
--- dqMax.decTest -- decQuad maxnum --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmax001 max -2 -2 -> -2
-dqmax002 max -2 -1 -> -1
-dqmax003 max -2 0 -> 0
-dqmax004 max -2 1 -> 1
-dqmax005 max -2 2 -> 2
-dqmax006 max -1 -2 -> -1
-dqmax007 max -1 -1 -> -1
-dqmax008 max -1 0 -> 0
-dqmax009 max -1 1 -> 1
-dqmax010 max -1 2 -> 2
-dqmax011 max 0 -2 -> 0
-dqmax012 max 0 -1 -> 0
-dqmax013 max 0 0 -> 0
-dqmax014 max 0 1 -> 1
-dqmax015 max 0 2 -> 2
-dqmax016 max 1 -2 -> 1
-dqmax017 max 1 -1 -> 1
-dqmax018 max 1 0 -> 1
-dqmax019 max 1 1 -> 1
-dqmax020 max 1 2 -> 2
-dqmax021 max 2 -2 -> 2
-dqmax022 max 2 -1 -> 2
-dqmax023 max 2 0 -> 2
-dqmax025 max 2 1 -> 2
-dqmax026 max 2 2 -> 2
-
--- extended zeros
-dqmax030 max 0 0 -> 0
-dqmax031 max 0 -0 -> 0
-dqmax032 max 0 -0.0 -> 0
-dqmax033 max 0 0.0 -> 0
-dqmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-dqmax035 max -0 -0 -> -0
-dqmax036 max -0 -0.0 -> -0.0
-dqmax037 max -0 0.0 -> 0.0
-dqmax038 max 0.0 0 -> 0
-dqmax039 max 0.0 -0 -> 0.0
-dqmax040 max 0.0 -0.0 -> 0.0
-dqmax041 max 0.0 0.0 -> 0.0
-dqmax042 max -0.0 0 -> 0
-dqmax043 max -0.0 -0 -> -0.0
-dqmax044 max -0.0 -0.0 -> -0.0
-dqmax045 max -0.0 0.0 -> 0.0
-
-dqmax050 max -0E1 0E1 -> 0E+1
-dqmax051 max -0E2 0E2 -> 0E+2
-dqmax052 max -0E2 0E1 -> 0E+1
-dqmax053 max -0E1 0E2 -> 0E+2
-dqmax054 max 0E1 -0E1 -> 0E+1
-dqmax055 max 0E2 -0E2 -> 0E+2
-dqmax056 max 0E2 -0E1 -> 0E+2
-dqmax057 max 0E1 -0E2 -> 0E+1
-
-dqmax058 max 0E1 0E1 -> 0E+1
-dqmax059 max 0E2 0E2 -> 0E+2
-dqmax060 max 0E2 0E1 -> 0E+2
-dqmax061 max 0E1 0E2 -> 0E+2
-dqmax062 max -0E1 -0E1 -> -0E+1
-dqmax063 max -0E2 -0E2 -> -0E+2
-dqmax064 max -0E2 -0E1 -> -0E+1
-dqmax065 max -0E1 -0E2 -> -0E+1
-
--- Specials
-dqmax090 max Inf -Inf -> Infinity
-dqmax091 max Inf -1000 -> Infinity
-dqmax092 max Inf -1 -> Infinity
-dqmax093 max Inf -0 -> Infinity
-dqmax094 max Inf 0 -> Infinity
-dqmax095 max Inf 1 -> Infinity
-dqmax096 max Inf 1000 -> Infinity
-dqmax097 max Inf Inf -> Infinity
-dqmax098 max -1000 Inf -> Infinity
-dqmax099 max -Inf Inf -> Infinity
-dqmax100 max -1 Inf -> Infinity
-dqmax101 max -0 Inf -> Infinity
-dqmax102 max 0 Inf -> Infinity
-dqmax103 max 1 Inf -> Infinity
-dqmax104 max 1000 Inf -> Infinity
-dqmax105 max Inf Inf -> Infinity
-
-dqmax120 max -Inf -Inf -> -Infinity
-dqmax121 max -Inf -1000 -> -1000
-dqmax122 max -Inf -1 -> -1
-dqmax123 max -Inf -0 -> -0
-dqmax124 max -Inf 0 -> 0
-dqmax125 max -Inf 1 -> 1
-dqmax126 max -Inf 1000 -> 1000
-dqmax127 max -Inf Inf -> Infinity
-dqmax128 max -Inf -Inf -> -Infinity
-dqmax129 max -1000 -Inf -> -1000
-dqmax130 max -1 -Inf -> -1
-dqmax131 max -0 -Inf -> -0
-dqmax132 max 0 -Inf -> 0
-dqmax133 max 1 -Inf -> 1
-dqmax134 max 1000 -Inf -> 1000
-dqmax135 max Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-dqmax141 max NaN -Inf -> -Infinity
-dqmax142 max NaN -1000 -> -1000
-dqmax143 max NaN -1 -> -1
-dqmax144 max NaN -0 -> -0
-dqmax145 max NaN 0 -> 0
-dqmax146 max NaN 1 -> 1
-dqmax147 max NaN 1000 -> 1000
-dqmax148 max NaN Inf -> Infinity
-dqmax149 max NaN NaN -> NaN
-dqmax150 max -Inf NaN -> -Infinity
-dqmax151 max -1000 NaN -> -1000
-dqmax152 max -1 NaN -> -1
-dqmax153 max -0 NaN -> -0
-dqmax154 max 0 NaN -> 0
-dqmax155 max 1 NaN -> 1
-dqmax156 max 1000 NaN -> 1000
-dqmax157 max Inf NaN -> Infinity
-
-dqmax161 max sNaN -Inf -> NaN Invalid_operation
-dqmax162 max sNaN -1000 -> NaN Invalid_operation
-dqmax163 max sNaN -1 -> NaN Invalid_operation
-dqmax164 max sNaN -0 -> NaN Invalid_operation
-dqmax165 max sNaN 0 -> NaN Invalid_operation
-dqmax166 max sNaN 1 -> NaN Invalid_operation
-dqmax167 max sNaN 1000 -> NaN Invalid_operation
-dqmax168 max sNaN NaN -> NaN Invalid_operation
-dqmax169 max sNaN sNaN -> NaN Invalid_operation
-dqmax170 max NaN sNaN -> NaN Invalid_operation
-dqmax171 max -Inf sNaN -> NaN Invalid_operation
-dqmax172 max -1000 sNaN -> NaN Invalid_operation
-dqmax173 max -1 sNaN -> NaN Invalid_operation
-dqmax174 max -0 sNaN -> NaN Invalid_operation
-dqmax175 max 0 sNaN -> NaN Invalid_operation
-dqmax176 max 1 sNaN -> NaN Invalid_operation
-dqmax177 max 1000 sNaN -> NaN Invalid_operation
-dqmax178 max Inf sNaN -> NaN Invalid_operation
-dqmax179 max NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmax181 max NaN9 -Inf -> -Infinity
-dqmax182 max NaN8 9 -> 9
-dqmax183 max -NaN7 Inf -> Infinity
-
-dqmax184 max -NaN1 NaN11 -> -NaN1
-dqmax185 max NaN2 NaN12 -> NaN2
-dqmax186 max -NaN13 -NaN7 -> -NaN13
-dqmax187 max NaN14 -NaN5 -> NaN14
-
-dqmax188 max -Inf NaN4 -> -Infinity
-dqmax189 max -9 -NaN3 -> -9
-dqmax190 max Inf NaN2 -> Infinity
-
-dqmax191 max sNaN99 -Inf -> NaN99 Invalid_operation
-dqmax192 max sNaN98 -1 -> NaN98 Invalid_operation
-dqmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation
-dqmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
-dqmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmax196 max -Inf sNaN92 -> NaN92 Invalid_operation
-dqmax197 max 0 sNaN91 -> NaN91 Invalid_operation
-dqmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmax199 max NaN sNaN89 -> NaN89 Invalid_operation
-
--- old rounding checks
-dqmax221 max 12345678000 1 -> 12345678000
-dqmax222 max 1 12345678000 -> 12345678000
-dqmax223 max 1234567800 1 -> 1234567800
-dqmax224 max 1 1234567800 -> 1234567800
-dqmax225 max 1234567890 1 -> 1234567890
-dqmax226 max 1 1234567890 -> 1234567890
-dqmax227 max 1234567891 1 -> 1234567891
-dqmax228 max 1 1234567891 -> 1234567891
-dqmax229 max 12345678901 1 -> 12345678901
-dqmax230 max 1 12345678901 -> 12345678901
-dqmax231 max 1234567896 1 -> 1234567896
-dqmax232 max 1 1234567896 -> 1234567896
-dqmax233 max -1234567891 1 -> 1
-dqmax234 max 1 -1234567891 -> 1
-dqmax235 max -12345678901 1 -> 1
-dqmax236 max 1 -12345678901 -> 1
-dqmax237 max -1234567896 1 -> 1
-dqmax238 max 1 -1234567896 -> 1
-
--- from examples
-dqmax280 max '3' '2' -> '3'
-dqmax281 max '-10' '3' -> '3'
-dqmax282 max '1.0' '1' -> '1'
-dqmax283 max '1' '1.0' -> '1'
-dqmax284 max '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-dqmax401 max Inf 1.1 -> Infinity
-dqmax402 max 1.1 1 -> 1.1
-dqmax403 max 1 1.0 -> 1
-dqmax404 max 1.0 0.1 -> 1.0
-dqmax405 max 0.1 0.10 -> 0.1
-dqmax406 max 0.10 0.100 -> 0.10
-dqmax407 max 0.10 0 -> 0.10
-dqmax408 max 0 0.0 -> 0
-dqmax409 max 0.0 -0 -> 0.0
-dqmax410 max 0.0 -0.0 -> 0.0
-dqmax411 max 0.00 -0.0 -> 0.00
-dqmax412 max 0.0 -0.00 -> 0.0
-dqmax413 max 0 -0.0 -> 0
-dqmax414 max 0 -0 -> 0
-dqmax415 max -0.0 -0 -> -0.0
-dqmax416 max -0 -0.100 -> -0
-dqmax417 max -0.100 -0.10 -> -0.100
-dqmax418 max -0.10 -0.1 -> -0.10
-dqmax419 max -0.1 -1.0 -> -0.1
-dqmax420 max -1.0 -1 -> -1.0
-dqmax421 max -1 -1.1 -> -1
-dqmax423 max -1.1 -Inf -> -1.1
--- same with operands reversed
-dqmax431 max 1.1 Inf -> Infinity
-dqmax432 max 1 1.1 -> 1.1
-dqmax433 max 1.0 1 -> 1
-dqmax434 max 0.1 1.0 -> 1.0
-dqmax435 max 0.10 0.1 -> 0.1
-dqmax436 max 0.100 0.10 -> 0.10
-dqmax437 max 0 0.10 -> 0.10
-dqmax438 max 0.0 0 -> 0
-dqmax439 max -0 0.0 -> 0.0
-dqmax440 max -0.0 0.0 -> 0.0
-dqmax441 max -0.0 0.00 -> 0.00
-dqmax442 max -0.00 0.0 -> 0.0
-dqmax443 max -0.0 0 -> 0
-dqmax444 max -0 0 -> 0
-dqmax445 max -0 -0.0 -> -0.0
-dqmax446 max -0.100 -0 -> -0
-dqmax447 max -0.10 -0.100 -> -0.100
-dqmax448 max -0.1 -0.10 -> -0.10
-dqmax449 max -1.0 -0.1 -> -0.1
-dqmax450 max -1 -1.0 -> -1.0
-dqmax451 max -1.1 -1 -> -1
-dqmax453 max -Inf -1.1 -> -1.1
--- largies
-dqmax460 max 1000 1E+3 -> 1E+3
-dqmax461 max 1E+3 1000 -> 1E+3
-dqmax462 max 1000 -1E+3 -> 1000
-dqmax463 max 1E+3 -1000 -> 1E+3
-dqmax464 max -1000 1E+3 -> 1E+3
-dqmax465 max -1E+3 1000 -> 1000
-dqmax466 max -1000 -1E+3 -> -1000
-dqmax467 max -1E+3 -1000 -> -1000
-
--- misalignment traps for little-endian
-dqmax471 max 1.0 0.1 -> 1.0
-dqmax472 max 0.1 1.0 -> 1.0
-dqmax473 max 10.0 0.1 -> 10.0
-dqmax474 max 0.1 10.0 -> 10.0
-dqmax475 max 100 1.0 -> 100
-dqmax476 max 1.0 100 -> 100
-dqmax477 max 1000 10.0 -> 1000
-dqmax478 max 10.0 1000 -> 1000
-dqmax479 max 10000 100.0 -> 10000
-dqmax480 max 100.0 10000 -> 10000
-dqmax481 max 100000 1000.0 -> 100000
-dqmax482 max 1000.0 100000 -> 100000
-dqmax483 max 1000000 10000.0 -> 1000000
-dqmax484 max 10000.0 1000000 -> 1000000
-
--- subnormals
-dqmax510 max 1.00E-6143 0 -> 1.00E-6143
-dqmax511 max 0.1E-6143 0 -> 1E-6144 Subnormal
-dqmax512 max 0.10E-6143 0 -> 1.0E-6144 Subnormal
-dqmax513 max 0.100E-6143 0 -> 1.00E-6144 Subnormal
-dqmax514 max 0.01E-6143 0 -> 1E-6145 Subnormal
-dqmax515 max 0.999E-6143 0 -> 9.99E-6144 Subnormal
-dqmax516 max 0.099E-6143 0 -> 9.9E-6145 Subnormal
-dqmax517 max 0.009E-6143 0 -> 9E-6146 Subnormal
-dqmax518 max 0.001E-6143 0 -> 1E-6146 Subnormal
-dqmax519 max 0.0009E-6143 0 -> 9E-6147 Subnormal
-dqmax520 max 0.0001E-6143 0 -> 1E-6147 Subnormal
-
-dqmax530 max -1.00E-6143 0 -> 0
-dqmax531 max -0.1E-6143 0 -> 0
-dqmax532 max -0.10E-6143 0 -> 0
-dqmax533 max -0.100E-6143 0 -> 0
-dqmax534 max -0.01E-6143 0 -> 0
-dqmax535 max -0.999E-6143 0 -> 0
-dqmax536 max -0.099E-6143 0 -> 0
-dqmax537 max -0.009E-6143 0 -> 0
-dqmax538 max -0.001E-6143 0 -> 0
-dqmax539 max -0.0009E-6143 0 -> 0
-dqmax540 max -0.0001E-6143 0 -> 0
-
--- Null tests
-dqmax900 max 10 # -> NaN Invalid_operation
-dqmax901 max # 10 -> NaN Invalid_operation
-
-
-
+------------------------------------------------------------------------
+-- dqMax.decTest -- decQuad maxnum --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmax001 max -2 -2 -> -2
+dqmax002 max -2 -1 -> -1
+dqmax003 max -2 0 -> 0
+dqmax004 max -2 1 -> 1
+dqmax005 max -2 2 -> 2
+dqmax006 max -1 -2 -> -1
+dqmax007 max -1 -1 -> -1
+dqmax008 max -1 0 -> 0
+dqmax009 max -1 1 -> 1
+dqmax010 max -1 2 -> 2
+dqmax011 max 0 -2 -> 0
+dqmax012 max 0 -1 -> 0
+dqmax013 max 0 0 -> 0
+dqmax014 max 0 1 -> 1
+dqmax015 max 0 2 -> 2
+dqmax016 max 1 -2 -> 1
+dqmax017 max 1 -1 -> 1
+dqmax018 max 1 0 -> 1
+dqmax019 max 1 1 -> 1
+dqmax020 max 1 2 -> 2
+dqmax021 max 2 -2 -> 2
+dqmax022 max 2 -1 -> 2
+dqmax023 max 2 0 -> 2
+dqmax025 max 2 1 -> 2
+dqmax026 max 2 2 -> 2
+
+-- extended zeros
+dqmax030 max 0 0 -> 0
+dqmax031 max 0 -0 -> 0
+dqmax032 max 0 -0.0 -> 0
+dqmax033 max 0 0.0 -> 0
+dqmax034 max -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+dqmax035 max -0 -0 -> -0
+dqmax036 max -0 -0.0 -> -0.0
+dqmax037 max -0 0.0 -> 0.0
+dqmax038 max 0.0 0 -> 0
+dqmax039 max 0.0 -0 -> 0.0
+dqmax040 max 0.0 -0.0 -> 0.0
+dqmax041 max 0.0 0.0 -> 0.0
+dqmax042 max -0.0 0 -> 0
+dqmax043 max -0.0 -0 -> -0.0
+dqmax044 max -0.0 -0.0 -> -0.0
+dqmax045 max -0.0 0.0 -> 0.0
+
+dqmax050 max -0E1 0E1 -> 0E+1
+dqmax051 max -0E2 0E2 -> 0E+2
+dqmax052 max -0E2 0E1 -> 0E+1
+dqmax053 max -0E1 0E2 -> 0E+2
+dqmax054 max 0E1 -0E1 -> 0E+1
+dqmax055 max 0E2 -0E2 -> 0E+2
+dqmax056 max 0E2 -0E1 -> 0E+2
+dqmax057 max 0E1 -0E2 -> 0E+1
+
+dqmax058 max 0E1 0E1 -> 0E+1
+dqmax059 max 0E2 0E2 -> 0E+2
+dqmax060 max 0E2 0E1 -> 0E+2
+dqmax061 max 0E1 0E2 -> 0E+2
+dqmax062 max -0E1 -0E1 -> -0E+1
+dqmax063 max -0E2 -0E2 -> -0E+2
+dqmax064 max -0E2 -0E1 -> -0E+1
+dqmax065 max -0E1 -0E2 -> -0E+1
+
+-- Specials
+dqmax090 max Inf -Inf -> Infinity
+dqmax091 max Inf -1000 -> Infinity
+dqmax092 max Inf -1 -> Infinity
+dqmax093 max Inf -0 -> Infinity
+dqmax094 max Inf 0 -> Infinity
+dqmax095 max Inf 1 -> Infinity
+dqmax096 max Inf 1000 -> Infinity
+dqmax097 max Inf Inf -> Infinity
+dqmax098 max -1000 Inf -> Infinity
+dqmax099 max -Inf Inf -> Infinity
+dqmax100 max -1 Inf -> Infinity
+dqmax101 max -0 Inf -> Infinity
+dqmax102 max 0 Inf -> Infinity
+dqmax103 max 1 Inf -> Infinity
+dqmax104 max 1000 Inf -> Infinity
+dqmax105 max Inf Inf -> Infinity
+
+dqmax120 max -Inf -Inf -> -Infinity
+dqmax121 max -Inf -1000 -> -1000
+dqmax122 max -Inf -1 -> -1
+dqmax123 max -Inf -0 -> -0
+dqmax124 max -Inf 0 -> 0
+dqmax125 max -Inf 1 -> 1
+dqmax126 max -Inf 1000 -> 1000
+dqmax127 max -Inf Inf -> Infinity
+dqmax128 max -Inf -Inf -> -Infinity
+dqmax129 max -1000 -Inf -> -1000
+dqmax130 max -1 -Inf -> -1
+dqmax131 max -0 -Inf -> -0
+dqmax132 max 0 -Inf -> 0
+dqmax133 max 1 -Inf -> 1
+dqmax134 max 1000 -Inf -> 1000
+dqmax135 max Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+dqmax141 max NaN -Inf -> -Infinity
+dqmax142 max NaN -1000 -> -1000
+dqmax143 max NaN -1 -> -1
+dqmax144 max NaN -0 -> -0
+dqmax145 max NaN 0 -> 0
+dqmax146 max NaN 1 -> 1
+dqmax147 max NaN 1000 -> 1000
+dqmax148 max NaN Inf -> Infinity
+dqmax149 max NaN NaN -> NaN
+dqmax150 max -Inf NaN -> -Infinity
+dqmax151 max -1000 NaN -> -1000
+dqmax152 max -1 NaN -> -1
+dqmax153 max -0 NaN -> -0
+dqmax154 max 0 NaN -> 0
+dqmax155 max 1 NaN -> 1
+dqmax156 max 1000 NaN -> 1000
+dqmax157 max Inf NaN -> Infinity
+
+dqmax161 max sNaN -Inf -> NaN Invalid_operation
+dqmax162 max sNaN -1000 -> NaN Invalid_operation
+dqmax163 max sNaN -1 -> NaN Invalid_operation
+dqmax164 max sNaN -0 -> NaN Invalid_operation
+dqmax165 max sNaN 0 -> NaN Invalid_operation
+dqmax166 max sNaN 1 -> NaN Invalid_operation
+dqmax167 max sNaN 1000 -> NaN Invalid_operation
+dqmax168 max sNaN NaN -> NaN Invalid_operation
+dqmax169 max sNaN sNaN -> NaN Invalid_operation
+dqmax170 max NaN sNaN -> NaN Invalid_operation
+dqmax171 max -Inf sNaN -> NaN Invalid_operation
+dqmax172 max -1000 sNaN -> NaN Invalid_operation
+dqmax173 max -1 sNaN -> NaN Invalid_operation
+dqmax174 max -0 sNaN -> NaN Invalid_operation
+dqmax175 max 0 sNaN -> NaN Invalid_operation
+dqmax176 max 1 sNaN -> NaN Invalid_operation
+dqmax177 max 1000 sNaN -> NaN Invalid_operation
+dqmax178 max Inf sNaN -> NaN Invalid_operation
+dqmax179 max NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmax181 max NaN9 -Inf -> -Infinity
+dqmax182 max NaN8 9 -> 9
+dqmax183 max -NaN7 Inf -> Infinity
+
+dqmax184 max -NaN1 NaN11 -> -NaN1
+dqmax185 max NaN2 NaN12 -> NaN2
+dqmax186 max -NaN13 -NaN7 -> -NaN13
+dqmax187 max NaN14 -NaN5 -> NaN14
+
+dqmax188 max -Inf NaN4 -> -Infinity
+dqmax189 max -9 -NaN3 -> -9
+dqmax190 max Inf NaN2 -> Infinity
+
+dqmax191 max sNaN99 -Inf -> NaN99 Invalid_operation
+dqmax192 max sNaN98 -1 -> NaN98 Invalid_operation
+dqmax193 max -sNaN97 NaN -> -NaN97 Invalid_operation
+dqmax194 max sNaN96 sNaN94 -> NaN96 Invalid_operation
+dqmax195 max NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmax196 max -Inf sNaN92 -> NaN92 Invalid_operation
+dqmax197 max 0 sNaN91 -> NaN91 Invalid_operation
+dqmax198 max Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmax199 max NaN sNaN89 -> NaN89 Invalid_operation
+
+-- old rounding checks
+dqmax221 max 12345678000 1 -> 12345678000
+dqmax222 max 1 12345678000 -> 12345678000
+dqmax223 max 1234567800 1 -> 1234567800
+dqmax224 max 1 1234567800 -> 1234567800
+dqmax225 max 1234567890 1 -> 1234567890
+dqmax226 max 1 1234567890 -> 1234567890
+dqmax227 max 1234567891 1 -> 1234567891
+dqmax228 max 1 1234567891 -> 1234567891
+dqmax229 max 12345678901 1 -> 12345678901
+dqmax230 max 1 12345678901 -> 12345678901
+dqmax231 max 1234567896 1 -> 1234567896
+dqmax232 max 1 1234567896 -> 1234567896
+dqmax233 max -1234567891 1 -> 1
+dqmax234 max 1 -1234567891 -> 1
+dqmax235 max -12345678901 1 -> 1
+dqmax236 max 1 -12345678901 -> 1
+dqmax237 max -1234567896 1 -> 1
+dqmax238 max 1 -1234567896 -> 1
+
+-- from examples
+dqmax280 max '3' '2' -> '3'
+dqmax281 max '-10' '3' -> '3'
+dqmax282 max '1.0' '1' -> '1'
+dqmax283 max '1' '1.0' -> '1'
+dqmax284 max '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+dqmax401 max Inf 1.1 -> Infinity
+dqmax402 max 1.1 1 -> 1.1
+dqmax403 max 1 1.0 -> 1
+dqmax404 max 1.0 0.1 -> 1.0
+dqmax405 max 0.1 0.10 -> 0.1
+dqmax406 max 0.10 0.100 -> 0.10
+dqmax407 max 0.10 0 -> 0.10
+dqmax408 max 0 0.0 -> 0
+dqmax409 max 0.0 -0 -> 0.0
+dqmax410 max 0.0 -0.0 -> 0.0
+dqmax411 max 0.00 -0.0 -> 0.00
+dqmax412 max 0.0 -0.00 -> 0.0
+dqmax413 max 0 -0.0 -> 0
+dqmax414 max 0 -0 -> 0
+dqmax415 max -0.0 -0 -> -0.0
+dqmax416 max -0 -0.100 -> -0
+dqmax417 max -0.100 -0.10 -> -0.100
+dqmax418 max -0.10 -0.1 -> -0.10
+dqmax419 max -0.1 -1.0 -> -0.1
+dqmax420 max -1.0 -1 -> -1.0
+dqmax421 max -1 -1.1 -> -1
+dqmax423 max -1.1 -Inf -> -1.1
+-- same with operands reversed
+dqmax431 max 1.1 Inf -> Infinity
+dqmax432 max 1 1.1 -> 1.1
+dqmax433 max 1.0 1 -> 1
+dqmax434 max 0.1 1.0 -> 1.0
+dqmax435 max 0.10 0.1 -> 0.1
+dqmax436 max 0.100 0.10 -> 0.10
+dqmax437 max 0 0.10 -> 0.10
+dqmax438 max 0.0 0 -> 0
+dqmax439 max -0 0.0 -> 0.0
+dqmax440 max -0.0 0.0 -> 0.0
+dqmax441 max -0.0 0.00 -> 0.00
+dqmax442 max -0.00 0.0 -> 0.0
+dqmax443 max -0.0 0 -> 0
+dqmax444 max -0 0 -> 0
+dqmax445 max -0 -0.0 -> -0.0
+dqmax446 max -0.100 -0 -> -0
+dqmax447 max -0.10 -0.100 -> -0.100
+dqmax448 max -0.1 -0.10 -> -0.10
+dqmax449 max -1.0 -0.1 -> -0.1
+dqmax450 max -1 -1.0 -> -1.0
+dqmax451 max -1.1 -1 -> -1
+dqmax453 max -Inf -1.1 -> -1.1
+-- largies
+dqmax460 max 1000 1E+3 -> 1E+3
+dqmax461 max 1E+3 1000 -> 1E+3
+dqmax462 max 1000 -1E+3 -> 1000
+dqmax463 max 1E+3 -1000 -> 1E+3
+dqmax464 max -1000 1E+3 -> 1E+3
+dqmax465 max -1E+3 1000 -> 1000
+dqmax466 max -1000 -1E+3 -> -1000
+dqmax467 max -1E+3 -1000 -> -1000
+
+-- misalignment traps for little-endian
+dqmax471 max 1.0 0.1 -> 1.0
+dqmax472 max 0.1 1.0 -> 1.0
+dqmax473 max 10.0 0.1 -> 10.0
+dqmax474 max 0.1 10.0 -> 10.0
+dqmax475 max 100 1.0 -> 100
+dqmax476 max 1.0 100 -> 100
+dqmax477 max 1000 10.0 -> 1000
+dqmax478 max 10.0 1000 -> 1000
+dqmax479 max 10000 100.0 -> 10000
+dqmax480 max 100.0 10000 -> 10000
+dqmax481 max 100000 1000.0 -> 100000
+dqmax482 max 1000.0 100000 -> 100000
+dqmax483 max 1000000 10000.0 -> 1000000
+dqmax484 max 10000.0 1000000 -> 1000000
+
+-- subnormals
+dqmax510 max 1.00E-6143 0 -> 1.00E-6143
+dqmax511 max 0.1E-6143 0 -> 1E-6144 Subnormal
+dqmax512 max 0.10E-6143 0 -> 1.0E-6144 Subnormal
+dqmax513 max 0.100E-6143 0 -> 1.00E-6144 Subnormal
+dqmax514 max 0.01E-6143 0 -> 1E-6145 Subnormal
+dqmax515 max 0.999E-6143 0 -> 9.99E-6144 Subnormal
+dqmax516 max 0.099E-6143 0 -> 9.9E-6145 Subnormal
+dqmax517 max 0.009E-6143 0 -> 9E-6146 Subnormal
+dqmax518 max 0.001E-6143 0 -> 1E-6146 Subnormal
+dqmax519 max 0.0009E-6143 0 -> 9E-6147 Subnormal
+dqmax520 max 0.0001E-6143 0 -> 1E-6147 Subnormal
+
+dqmax530 max -1.00E-6143 0 -> 0
+dqmax531 max -0.1E-6143 0 -> 0
+dqmax532 max -0.10E-6143 0 -> 0
+dqmax533 max -0.100E-6143 0 -> 0
+dqmax534 max -0.01E-6143 0 -> 0
+dqmax535 max -0.999E-6143 0 -> 0
+dqmax536 max -0.099E-6143 0 -> 0
+dqmax537 max -0.009E-6143 0 -> 0
+dqmax538 max -0.001E-6143 0 -> 0
+dqmax539 max -0.0009E-6143 0 -> 0
+dqmax540 max -0.0001E-6143 0 -> 0
+
+-- Null tests
+dqmax900 max 10 # -> NaN Invalid_operation
+dqmax901 max # 10 -> NaN Invalid_operation
+
+
+
diff --git a/Lib/test/decimaltestdata/dqMaxMag.decTest b/Lib/test/decimaltestdata/dqMaxMag.decTest
index 6f5be24609..6621e80d92 100644
--- a/Lib/test/decimaltestdata/dqMaxMag.decTest
+++ b/Lib/test/decimaltestdata/dqMaxMag.decTest
@@ -1,304 +1,304 @@
-------------------------------------------------------------------------
--- dqMaxMag.decTest -- decQuad maxnummag --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmxg001 maxmag -2 -2 -> -2
-dqmxg002 maxmag -2 -1 -> -2
-dqmxg003 maxmag -2 0 -> -2
-dqmxg004 maxmag -2 1 -> -2
-dqmxg005 maxmag -2 2 -> 2
-dqmxg006 maxmag -1 -2 -> -2
-dqmxg007 maxmag -1 -1 -> -1
-dqmxg008 maxmag -1 0 -> -1
-dqmxg009 maxmag -1 1 -> 1
-dqmxg010 maxmag -1 2 -> 2
-dqmxg011 maxmag 0 -2 -> -2
-dqmxg012 maxmag 0 -1 -> -1
-dqmxg013 maxmag 0 0 -> 0
-dqmxg014 maxmag 0 1 -> 1
-dqmxg015 maxmag 0 2 -> 2
-dqmxg016 maxmag 1 -2 -> -2
-dqmxg017 maxmag 1 -1 -> 1
-dqmxg018 maxmag 1 0 -> 1
-dqmxg019 maxmag 1 1 -> 1
-dqmxg020 maxmag 1 2 -> 2
-dqmxg021 maxmag 2 -2 -> 2
-dqmxg022 maxmag 2 -1 -> 2
-dqmxg023 maxmag 2 0 -> 2
-dqmxg025 maxmag 2 1 -> 2
-dqmxg026 maxmag 2 2 -> 2
-
--- extended zeros
-dqmxg030 maxmag 0 0 -> 0
-dqmxg031 maxmag 0 -0 -> 0
-dqmxg032 maxmag 0 -0.0 -> 0
-dqmxg033 maxmag 0 0.0 -> 0
-dqmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-dqmxg035 maxmag -0 -0 -> -0
-dqmxg036 maxmag -0 -0.0 -> -0.0
-dqmxg037 maxmag -0 0.0 -> 0.0
-dqmxg038 maxmag 0.0 0 -> 0
-dqmxg039 maxmag 0.0 -0 -> 0.0
-dqmxg040 maxmag 0.0 -0.0 -> 0.0
-dqmxg041 maxmag 0.0 0.0 -> 0.0
-dqmxg042 maxmag -0.0 0 -> 0
-dqmxg043 maxmag -0.0 -0 -> -0.0
-dqmxg044 maxmag -0.0 -0.0 -> -0.0
-dqmxg045 maxmag -0.0 0.0 -> 0.0
-
-dqmxg050 maxmag -0E1 0E1 -> 0E+1
-dqmxg051 maxmag -0E2 0E2 -> 0E+2
-dqmxg052 maxmag -0E2 0E1 -> 0E+1
-dqmxg053 maxmag -0E1 0E2 -> 0E+2
-dqmxg054 maxmag 0E1 -0E1 -> 0E+1
-dqmxg055 maxmag 0E2 -0E2 -> 0E+2
-dqmxg056 maxmag 0E2 -0E1 -> 0E+2
-dqmxg057 maxmag 0E1 -0E2 -> 0E+1
-
-dqmxg058 maxmag 0E1 0E1 -> 0E+1
-dqmxg059 maxmag 0E2 0E2 -> 0E+2
-dqmxg060 maxmag 0E2 0E1 -> 0E+2
-dqmxg061 maxmag 0E1 0E2 -> 0E+2
-dqmxg062 maxmag -0E1 -0E1 -> -0E+1
-dqmxg063 maxmag -0E2 -0E2 -> -0E+2
-dqmxg064 maxmag -0E2 -0E1 -> -0E+1
-dqmxg065 maxmag -0E1 -0E2 -> -0E+1
-
--- Specials
-dqmxg090 maxmag Inf -Inf -> Infinity
-dqmxg091 maxmag Inf -1000 -> Infinity
-dqmxg092 maxmag Inf -1 -> Infinity
-dqmxg093 maxmag Inf -0 -> Infinity
-dqmxg094 maxmag Inf 0 -> Infinity
-dqmxg095 maxmag Inf 1 -> Infinity
-dqmxg096 maxmag Inf 1000 -> Infinity
-dqmxg097 maxmag Inf Inf -> Infinity
-dqmxg098 maxmag -1000 Inf -> Infinity
-dqmxg099 maxmag -Inf Inf -> Infinity
-dqmxg100 maxmag -1 Inf -> Infinity
-dqmxg101 maxmag -0 Inf -> Infinity
-dqmxg102 maxmag 0 Inf -> Infinity
-dqmxg103 maxmag 1 Inf -> Infinity
-dqmxg104 maxmag 1000 Inf -> Infinity
-dqmxg105 maxmag Inf Inf -> Infinity
-
-dqmxg120 maxmag -Inf -Inf -> -Infinity
-dqmxg121 maxmag -Inf -1000 -> -Infinity
-dqmxg122 maxmag -Inf -1 -> -Infinity
-dqmxg123 maxmag -Inf -0 -> -Infinity
-dqmxg124 maxmag -Inf 0 -> -Infinity
-dqmxg125 maxmag -Inf 1 -> -Infinity
-dqmxg126 maxmag -Inf 1000 -> -Infinity
-dqmxg127 maxmag -Inf Inf -> Infinity
-dqmxg128 maxmag -Inf -Inf -> -Infinity
-dqmxg129 maxmag -1000 -Inf -> -Infinity
-dqmxg130 maxmag -1 -Inf -> -Infinity
-dqmxg131 maxmag -0 -Inf -> -Infinity
-dqmxg132 maxmag 0 -Inf -> -Infinity
-dqmxg133 maxmag 1 -Inf -> -Infinity
-dqmxg134 maxmag 1000 -Inf -> -Infinity
-dqmxg135 maxmag Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-dqmxg141 maxmag NaN -Inf -> -Infinity
-dqmxg142 maxmag NaN -1000 -> -1000
-dqmxg143 maxmag NaN -1 -> -1
-dqmxg144 maxmag NaN -0 -> -0
-dqmxg145 maxmag NaN 0 -> 0
-dqmxg146 maxmag NaN 1 -> 1
-dqmxg147 maxmag NaN 1000 -> 1000
-dqmxg148 maxmag NaN Inf -> Infinity
-dqmxg149 maxmag NaN NaN -> NaN
-dqmxg150 maxmag -Inf NaN -> -Infinity
-dqmxg151 maxmag -1000 NaN -> -1000
-dqmxg152 maxmag -1 NaN -> -1
-dqmxg153 maxmag -0 NaN -> -0
-dqmxg154 maxmag 0 NaN -> 0
-dqmxg155 maxmag 1 NaN -> 1
-dqmxg156 maxmag 1000 NaN -> 1000
-dqmxg157 maxmag Inf NaN -> Infinity
-
-dqmxg161 maxmag sNaN -Inf -> NaN Invalid_operation
-dqmxg162 maxmag sNaN -1000 -> NaN Invalid_operation
-dqmxg163 maxmag sNaN -1 -> NaN Invalid_operation
-dqmxg164 maxmag sNaN -0 -> NaN Invalid_operation
-dqmxg165 maxmag sNaN 0 -> NaN Invalid_operation
-dqmxg166 maxmag sNaN 1 -> NaN Invalid_operation
-dqmxg167 maxmag sNaN 1000 -> NaN Invalid_operation
-dqmxg168 maxmag sNaN NaN -> NaN Invalid_operation
-dqmxg169 maxmag sNaN sNaN -> NaN Invalid_operation
-dqmxg170 maxmag NaN sNaN -> NaN Invalid_operation
-dqmxg171 maxmag -Inf sNaN -> NaN Invalid_operation
-dqmxg172 maxmag -1000 sNaN -> NaN Invalid_operation
-dqmxg173 maxmag -1 sNaN -> NaN Invalid_operation
-dqmxg174 maxmag -0 sNaN -> NaN Invalid_operation
-dqmxg175 maxmag 0 sNaN -> NaN Invalid_operation
-dqmxg176 maxmag 1 sNaN -> NaN Invalid_operation
-dqmxg177 maxmag 1000 sNaN -> NaN Invalid_operation
-dqmxg178 maxmag Inf sNaN -> NaN Invalid_operation
-dqmxg179 maxmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmxg181 maxmag NaN9 -Inf -> -Infinity
-dqmxg182 maxmag NaN8 9 -> 9
-dqmxg183 maxmag -NaN7 Inf -> Infinity
-
-dqmxg184 maxmag -NaN1 NaN11 -> -NaN1
-dqmxg185 maxmag NaN2 NaN12 -> NaN2
-dqmxg186 maxmag -NaN13 -NaN7 -> -NaN13
-dqmxg187 maxmag NaN14 -NaN5 -> NaN14
-
-dqmxg188 maxmag -Inf NaN4 -> -Infinity
-dqmxg189 maxmag -9 -NaN3 -> -9
-dqmxg190 maxmag Inf NaN2 -> Infinity
-
-dqmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
-dqmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
-dqmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
-dqmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
-dqmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
-dqmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
-dqmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
-
--- old rounding checks
-dqmxg221 maxmag 12345678000 1 -> 12345678000
-dqmxg222 maxmag 1 12345678000 -> 12345678000
-dqmxg223 maxmag 1234567800 1 -> 1234567800
-dqmxg224 maxmag 1 1234567800 -> 1234567800
-dqmxg225 maxmag 1234567890 1 -> 1234567890
-dqmxg226 maxmag 1 1234567890 -> 1234567890
-dqmxg227 maxmag 1234567891 1 -> 1234567891
-dqmxg228 maxmag 1 1234567891 -> 1234567891
-dqmxg229 maxmag 12345678901 1 -> 12345678901
-dqmxg230 maxmag 1 12345678901 -> 12345678901
-dqmxg231 maxmag 1234567896 1 -> 1234567896
-dqmxg232 maxmag 1 1234567896 -> 1234567896
-dqmxg233 maxmag -1234567891 1 -> -1234567891
-dqmxg234 maxmag 1 -1234567891 -> -1234567891
-dqmxg235 maxmag -12345678901 1 -> -12345678901
-dqmxg236 maxmag 1 -12345678901 -> -12345678901
-dqmxg237 maxmag -1234567896 1 -> -1234567896
-dqmxg238 maxmag 1 -1234567896 -> -1234567896
-
--- from examples
-dqmxg280 maxmag '3' '2' -> '3'
-dqmxg281 maxmag '-10' '3' -> '-10'
-dqmxg282 maxmag '1.0' '1' -> '1'
-dqmxg283 maxmag '1' '1.0' -> '1'
-dqmxg284 maxmag '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-dqmxg401 maxmag Inf 1.1 -> Infinity
-dqmxg402 maxmag 1.1 1 -> 1.1
-dqmxg403 maxmag 1 1.0 -> 1
-dqmxg404 maxmag 1.0 0.1 -> 1.0
-dqmxg405 maxmag 0.1 0.10 -> 0.1
-dqmxg406 maxmag 0.10 0.100 -> 0.10
-dqmxg407 maxmag 0.10 0 -> 0.10
-dqmxg408 maxmag 0 0.0 -> 0
-dqmxg409 maxmag 0.0 -0 -> 0.0
-dqmxg410 maxmag 0.0 -0.0 -> 0.0
-dqmxg411 maxmag 0.00 -0.0 -> 0.00
-dqmxg412 maxmag 0.0 -0.00 -> 0.0
-dqmxg413 maxmag 0 -0.0 -> 0
-dqmxg414 maxmag 0 -0 -> 0
-dqmxg415 maxmag -0.0 -0 -> -0.0
-dqmxg416 maxmag -0 -0.100 -> -0.100
-dqmxg417 maxmag -0.100 -0.10 -> -0.100
-dqmxg418 maxmag -0.10 -0.1 -> -0.10
-dqmxg419 maxmag -0.1 -1.0 -> -1.0
-dqmxg420 maxmag -1.0 -1 -> -1.0
-dqmxg421 maxmag -1 -1.1 -> -1.1
-dqmxg423 maxmag -1.1 -Inf -> -Infinity
--- same with operands reversed
-dqmxg431 maxmag 1.1 Inf -> Infinity
-dqmxg432 maxmag 1 1.1 -> 1.1
-dqmxg433 maxmag 1.0 1 -> 1
-dqmxg434 maxmag 0.1 1.0 -> 1.0
-dqmxg435 maxmag 0.10 0.1 -> 0.1
-dqmxg436 maxmag 0.100 0.10 -> 0.10
-dqmxg437 maxmag 0 0.10 -> 0.10
-dqmxg438 maxmag 0.0 0 -> 0
-dqmxg439 maxmag -0 0.0 -> 0.0
-dqmxg440 maxmag -0.0 0.0 -> 0.0
-dqmxg441 maxmag -0.0 0.00 -> 0.00
-dqmxg442 maxmag -0.00 0.0 -> 0.0
-dqmxg443 maxmag -0.0 0 -> 0
-dqmxg444 maxmag -0 0 -> 0
-dqmxg445 maxmag -0 -0.0 -> -0.0
-dqmxg446 maxmag -0.100 -0 -> -0.100
-dqmxg447 maxmag -0.10 -0.100 -> -0.100
-dqmxg448 maxmag -0.1 -0.10 -> -0.10
-dqmxg449 maxmag -1.0 -0.1 -> -1.0
-dqmxg450 maxmag -1 -1.0 -> -1.0
-dqmxg451 maxmag -1.1 -1 -> -1.1
-dqmxg453 maxmag -Inf -1.1 -> -Infinity
--- largies
-dqmxg460 maxmag 1000 1E+3 -> 1E+3
-dqmxg461 maxmag 1E+3 1000 -> 1E+3
-dqmxg462 maxmag 1000 -1E+3 -> 1000
-dqmxg463 maxmag 1E+3 -1000 -> 1E+3
-dqmxg464 maxmag -1000 1E+3 -> 1E+3
-dqmxg465 maxmag -1E+3 1000 -> 1000
-dqmxg466 maxmag -1000 -1E+3 -> -1000
-dqmxg467 maxmag -1E+3 -1000 -> -1000
-
--- subnormals
-dqmxg510 maxmag 1.00E-6143 0 -> 1.00E-6143
-dqmxg511 maxmag 0.1E-6143 0 -> 1E-6144 Subnormal
-dqmxg512 maxmag 0.10E-6143 0 -> 1.0E-6144 Subnormal
-dqmxg513 maxmag 0.100E-6143 0 -> 1.00E-6144 Subnormal
-dqmxg514 maxmag 0.01E-6143 0 -> 1E-6145 Subnormal
-dqmxg515 maxmag 0.999E-6143 0 -> 9.99E-6144 Subnormal
-dqmxg516 maxmag 0.099E-6143 0 -> 9.9E-6145 Subnormal
-dqmxg517 maxmag 0.009E-6143 0 -> 9E-6146 Subnormal
-dqmxg518 maxmag 0.001E-6143 0 -> 1E-6146 Subnormal
-dqmxg519 maxmag 0.0009E-6143 0 -> 9E-6147 Subnormal
-dqmxg520 maxmag 0.0001E-6143 0 -> 1E-6147 Subnormal
-
-dqmxg530 maxmag -1.00E-6143 0 -> -1.00E-6143
-dqmxg531 maxmag -0.1E-6143 0 -> -1E-6144 Subnormal
-dqmxg532 maxmag -0.10E-6143 0 -> -1.0E-6144 Subnormal
-dqmxg533 maxmag -0.100E-6143 0 -> -1.00E-6144 Subnormal
-dqmxg534 maxmag -0.01E-6143 0 -> -1E-6145 Subnormal
-dqmxg535 maxmag -0.999E-6143 0 -> -9.99E-6144 Subnormal
-dqmxg536 maxmag -0.099E-6143 0 -> -9.9E-6145 Subnormal
-dqmxg537 maxmag -0.009E-6143 0 -> -9E-6146 Subnormal
-dqmxg538 maxmag -0.001E-6143 0 -> -1E-6146 Subnormal
-dqmxg539 maxmag -0.0009E-6143 0 -> -9E-6147 Subnormal
-dqmxg540 maxmag -0.0001E-6143 0 -> -1E-6147 Subnormal
-
--- Null tests
-dqmxg900 maxmag 10 # -> NaN Invalid_operation
-dqmxg901 maxmag # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqMaxMag.decTest -- decQuad maxnummag --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmxg001 maxmag -2 -2 -> -2
+dqmxg002 maxmag -2 -1 -> -2
+dqmxg003 maxmag -2 0 -> -2
+dqmxg004 maxmag -2 1 -> -2
+dqmxg005 maxmag -2 2 -> 2
+dqmxg006 maxmag -1 -2 -> -2
+dqmxg007 maxmag -1 -1 -> -1
+dqmxg008 maxmag -1 0 -> -1
+dqmxg009 maxmag -1 1 -> 1
+dqmxg010 maxmag -1 2 -> 2
+dqmxg011 maxmag 0 -2 -> -2
+dqmxg012 maxmag 0 -1 -> -1
+dqmxg013 maxmag 0 0 -> 0
+dqmxg014 maxmag 0 1 -> 1
+dqmxg015 maxmag 0 2 -> 2
+dqmxg016 maxmag 1 -2 -> -2
+dqmxg017 maxmag 1 -1 -> 1
+dqmxg018 maxmag 1 0 -> 1
+dqmxg019 maxmag 1 1 -> 1
+dqmxg020 maxmag 1 2 -> 2
+dqmxg021 maxmag 2 -2 -> 2
+dqmxg022 maxmag 2 -1 -> 2
+dqmxg023 maxmag 2 0 -> 2
+dqmxg025 maxmag 2 1 -> 2
+dqmxg026 maxmag 2 2 -> 2
+
+-- extended zeros
+dqmxg030 maxmag 0 0 -> 0
+dqmxg031 maxmag 0 -0 -> 0
+dqmxg032 maxmag 0 -0.0 -> 0
+dqmxg033 maxmag 0 0.0 -> 0
+dqmxg034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+dqmxg035 maxmag -0 -0 -> -0
+dqmxg036 maxmag -0 -0.0 -> -0.0
+dqmxg037 maxmag -0 0.0 -> 0.0
+dqmxg038 maxmag 0.0 0 -> 0
+dqmxg039 maxmag 0.0 -0 -> 0.0
+dqmxg040 maxmag 0.0 -0.0 -> 0.0
+dqmxg041 maxmag 0.0 0.0 -> 0.0
+dqmxg042 maxmag -0.0 0 -> 0
+dqmxg043 maxmag -0.0 -0 -> -0.0
+dqmxg044 maxmag -0.0 -0.0 -> -0.0
+dqmxg045 maxmag -0.0 0.0 -> 0.0
+
+dqmxg050 maxmag -0E1 0E1 -> 0E+1
+dqmxg051 maxmag -0E2 0E2 -> 0E+2
+dqmxg052 maxmag -0E2 0E1 -> 0E+1
+dqmxg053 maxmag -0E1 0E2 -> 0E+2
+dqmxg054 maxmag 0E1 -0E1 -> 0E+1
+dqmxg055 maxmag 0E2 -0E2 -> 0E+2
+dqmxg056 maxmag 0E2 -0E1 -> 0E+2
+dqmxg057 maxmag 0E1 -0E2 -> 0E+1
+
+dqmxg058 maxmag 0E1 0E1 -> 0E+1
+dqmxg059 maxmag 0E2 0E2 -> 0E+2
+dqmxg060 maxmag 0E2 0E1 -> 0E+2
+dqmxg061 maxmag 0E1 0E2 -> 0E+2
+dqmxg062 maxmag -0E1 -0E1 -> -0E+1
+dqmxg063 maxmag -0E2 -0E2 -> -0E+2
+dqmxg064 maxmag -0E2 -0E1 -> -0E+1
+dqmxg065 maxmag -0E1 -0E2 -> -0E+1
+
+-- Specials
+dqmxg090 maxmag Inf -Inf -> Infinity
+dqmxg091 maxmag Inf -1000 -> Infinity
+dqmxg092 maxmag Inf -1 -> Infinity
+dqmxg093 maxmag Inf -0 -> Infinity
+dqmxg094 maxmag Inf 0 -> Infinity
+dqmxg095 maxmag Inf 1 -> Infinity
+dqmxg096 maxmag Inf 1000 -> Infinity
+dqmxg097 maxmag Inf Inf -> Infinity
+dqmxg098 maxmag -1000 Inf -> Infinity
+dqmxg099 maxmag -Inf Inf -> Infinity
+dqmxg100 maxmag -1 Inf -> Infinity
+dqmxg101 maxmag -0 Inf -> Infinity
+dqmxg102 maxmag 0 Inf -> Infinity
+dqmxg103 maxmag 1 Inf -> Infinity
+dqmxg104 maxmag 1000 Inf -> Infinity
+dqmxg105 maxmag Inf Inf -> Infinity
+
+dqmxg120 maxmag -Inf -Inf -> -Infinity
+dqmxg121 maxmag -Inf -1000 -> -Infinity
+dqmxg122 maxmag -Inf -1 -> -Infinity
+dqmxg123 maxmag -Inf -0 -> -Infinity
+dqmxg124 maxmag -Inf 0 -> -Infinity
+dqmxg125 maxmag -Inf 1 -> -Infinity
+dqmxg126 maxmag -Inf 1000 -> -Infinity
+dqmxg127 maxmag -Inf Inf -> Infinity
+dqmxg128 maxmag -Inf -Inf -> -Infinity
+dqmxg129 maxmag -1000 -Inf -> -Infinity
+dqmxg130 maxmag -1 -Inf -> -Infinity
+dqmxg131 maxmag -0 -Inf -> -Infinity
+dqmxg132 maxmag 0 -Inf -> -Infinity
+dqmxg133 maxmag 1 -Inf -> -Infinity
+dqmxg134 maxmag 1000 -Inf -> -Infinity
+dqmxg135 maxmag Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+dqmxg141 maxmag NaN -Inf -> -Infinity
+dqmxg142 maxmag NaN -1000 -> -1000
+dqmxg143 maxmag NaN -1 -> -1
+dqmxg144 maxmag NaN -0 -> -0
+dqmxg145 maxmag NaN 0 -> 0
+dqmxg146 maxmag NaN 1 -> 1
+dqmxg147 maxmag NaN 1000 -> 1000
+dqmxg148 maxmag NaN Inf -> Infinity
+dqmxg149 maxmag NaN NaN -> NaN
+dqmxg150 maxmag -Inf NaN -> -Infinity
+dqmxg151 maxmag -1000 NaN -> -1000
+dqmxg152 maxmag -1 NaN -> -1
+dqmxg153 maxmag -0 NaN -> -0
+dqmxg154 maxmag 0 NaN -> 0
+dqmxg155 maxmag 1 NaN -> 1
+dqmxg156 maxmag 1000 NaN -> 1000
+dqmxg157 maxmag Inf NaN -> Infinity
+
+dqmxg161 maxmag sNaN -Inf -> NaN Invalid_operation
+dqmxg162 maxmag sNaN -1000 -> NaN Invalid_operation
+dqmxg163 maxmag sNaN -1 -> NaN Invalid_operation
+dqmxg164 maxmag sNaN -0 -> NaN Invalid_operation
+dqmxg165 maxmag sNaN 0 -> NaN Invalid_operation
+dqmxg166 maxmag sNaN 1 -> NaN Invalid_operation
+dqmxg167 maxmag sNaN 1000 -> NaN Invalid_operation
+dqmxg168 maxmag sNaN NaN -> NaN Invalid_operation
+dqmxg169 maxmag sNaN sNaN -> NaN Invalid_operation
+dqmxg170 maxmag NaN sNaN -> NaN Invalid_operation
+dqmxg171 maxmag -Inf sNaN -> NaN Invalid_operation
+dqmxg172 maxmag -1000 sNaN -> NaN Invalid_operation
+dqmxg173 maxmag -1 sNaN -> NaN Invalid_operation
+dqmxg174 maxmag -0 sNaN -> NaN Invalid_operation
+dqmxg175 maxmag 0 sNaN -> NaN Invalid_operation
+dqmxg176 maxmag 1 sNaN -> NaN Invalid_operation
+dqmxg177 maxmag 1000 sNaN -> NaN Invalid_operation
+dqmxg178 maxmag Inf sNaN -> NaN Invalid_operation
+dqmxg179 maxmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmxg181 maxmag NaN9 -Inf -> -Infinity
+dqmxg182 maxmag NaN8 9 -> 9
+dqmxg183 maxmag -NaN7 Inf -> Infinity
+
+dqmxg184 maxmag -NaN1 NaN11 -> -NaN1
+dqmxg185 maxmag NaN2 NaN12 -> NaN2
+dqmxg186 maxmag -NaN13 -NaN7 -> -NaN13
+dqmxg187 maxmag NaN14 -NaN5 -> NaN14
+
+dqmxg188 maxmag -Inf NaN4 -> -Infinity
+dqmxg189 maxmag -9 -NaN3 -> -9
+dqmxg190 maxmag Inf NaN2 -> Infinity
+
+dqmxg191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
+dqmxg192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
+dqmxg193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
+dqmxg194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
+dqmxg195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmxg196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
+dqmxg197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
+dqmxg198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmxg199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
+
+-- old rounding checks
+dqmxg221 maxmag 12345678000 1 -> 12345678000
+dqmxg222 maxmag 1 12345678000 -> 12345678000
+dqmxg223 maxmag 1234567800 1 -> 1234567800
+dqmxg224 maxmag 1 1234567800 -> 1234567800
+dqmxg225 maxmag 1234567890 1 -> 1234567890
+dqmxg226 maxmag 1 1234567890 -> 1234567890
+dqmxg227 maxmag 1234567891 1 -> 1234567891
+dqmxg228 maxmag 1 1234567891 -> 1234567891
+dqmxg229 maxmag 12345678901 1 -> 12345678901
+dqmxg230 maxmag 1 12345678901 -> 12345678901
+dqmxg231 maxmag 1234567896 1 -> 1234567896
+dqmxg232 maxmag 1 1234567896 -> 1234567896
+dqmxg233 maxmag -1234567891 1 -> -1234567891
+dqmxg234 maxmag 1 -1234567891 -> -1234567891
+dqmxg235 maxmag -12345678901 1 -> -12345678901
+dqmxg236 maxmag 1 -12345678901 -> -12345678901
+dqmxg237 maxmag -1234567896 1 -> -1234567896
+dqmxg238 maxmag 1 -1234567896 -> -1234567896
+
+-- from examples
+dqmxg280 maxmag '3' '2' -> '3'
+dqmxg281 maxmag '-10' '3' -> '-10'
+dqmxg282 maxmag '1.0' '1' -> '1'
+dqmxg283 maxmag '1' '1.0' -> '1'
+dqmxg284 maxmag '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+dqmxg401 maxmag Inf 1.1 -> Infinity
+dqmxg402 maxmag 1.1 1 -> 1.1
+dqmxg403 maxmag 1 1.0 -> 1
+dqmxg404 maxmag 1.0 0.1 -> 1.0
+dqmxg405 maxmag 0.1 0.10 -> 0.1
+dqmxg406 maxmag 0.10 0.100 -> 0.10
+dqmxg407 maxmag 0.10 0 -> 0.10
+dqmxg408 maxmag 0 0.0 -> 0
+dqmxg409 maxmag 0.0 -0 -> 0.0
+dqmxg410 maxmag 0.0 -0.0 -> 0.0
+dqmxg411 maxmag 0.00 -0.0 -> 0.00
+dqmxg412 maxmag 0.0 -0.00 -> 0.0
+dqmxg413 maxmag 0 -0.0 -> 0
+dqmxg414 maxmag 0 -0 -> 0
+dqmxg415 maxmag -0.0 -0 -> -0.0
+dqmxg416 maxmag -0 -0.100 -> -0.100
+dqmxg417 maxmag -0.100 -0.10 -> -0.100
+dqmxg418 maxmag -0.10 -0.1 -> -0.10
+dqmxg419 maxmag -0.1 -1.0 -> -1.0
+dqmxg420 maxmag -1.0 -1 -> -1.0
+dqmxg421 maxmag -1 -1.1 -> -1.1
+dqmxg423 maxmag -1.1 -Inf -> -Infinity
+-- same with operands reversed
+dqmxg431 maxmag 1.1 Inf -> Infinity
+dqmxg432 maxmag 1 1.1 -> 1.1
+dqmxg433 maxmag 1.0 1 -> 1
+dqmxg434 maxmag 0.1 1.0 -> 1.0
+dqmxg435 maxmag 0.10 0.1 -> 0.1
+dqmxg436 maxmag 0.100 0.10 -> 0.10
+dqmxg437 maxmag 0 0.10 -> 0.10
+dqmxg438 maxmag 0.0 0 -> 0
+dqmxg439 maxmag -0 0.0 -> 0.0
+dqmxg440 maxmag -0.0 0.0 -> 0.0
+dqmxg441 maxmag -0.0 0.00 -> 0.00
+dqmxg442 maxmag -0.00 0.0 -> 0.0
+dqmxg443 maxmag -0.0 0 -> 0
+dqmxg444 maxmag -0 0 -> 0
+dqmxg445 maxmag -0 -0.0 -> -0.0
+dqmxg446 maxmag -0.100 -0 -> -0.100
+dqmxg447 maxmag -0.10 -0.100 -> -0.100
+dqmxg448 maxmag -0.1 -0.10 -> -0.10
+dqmxg449 maxmag -1.0 -0.1 -> -1.0
+dqmxg450 maxmag -1 -1.0 -> -1.0
+dqmxg451 maxmag -1.1 -1 -> -1.1
+dqmxg453 maxmag -Inf -1.1 -> -Infinity
+-- largies
+dqmxg460 maxmag 1000 1E+3 -> 1E+3
+dqmxg461 maxmag 1E+3 1000 -> 1E+3
+dqmxg462 maxmag 1000 -1E+3 -> 1000
+dqmxg463 maxmag 1E+3 -1000 -> 1E+3
+dqmxg464 maxmag -1000 1E+3 -> 1E+3
+dqmxg465 maxmag -1E+3 1000 -> 1000
+dqmxg466 maxmag -1000 -1E+3 -> -1000
+dqmxg467 maxmag -1E+3 -1000 -> -1000
+
+-- subnormals
+dqmxg510 maxmag 1.00E-6143 0 -> 1.00E-6143
+dqmxg511 maxmag 0.1E-6143 0 -> 1E-6144 Subnormal
+dqmxg512 maxmag 0.10E-6143 0 -> 1.0E-6144 Subnormal
+dqmxg513 maxmag 0.100E-6143 0 -> 1.00E-6144 Subnormal
+dqmxg514 maxmag 0.01E-6143 0 -> 1E-6145 Subnormal
+dqmxg515 maxmag 0.999E-6143 0 -> 9.99E-6144 Subnormal
+dqmxg516 maxmag 0.099E-6143 0 -> 9.9E-6145 Subnormal
+dqmxg517 maxmag 0.009E-6143 0 -> 9E-6146 Subnormal
+dqmxg518 maxmag 0.001E-6143 0 -> 1E-6146 Subnormal
+dqmxg519 maxmag 0.0009E-6143 0 -> 9E-6147 Subnormal
+dqmxg520 maxmag 0.0001E-6143 0 -> 1E-6147 Subnormal
+
+dqmxg530 maxmag -1.00E-6143 0 -> -1.00E-6143
+dqmxg531 maxmag -0.1E-6143 0 -> -1E-6144 Subnormal
+dqmxg532 maxmag -0.10E-6143 0 -> -1.0E-6144 Subnormal
+dqmxg533 maxmag -0.100E-6143 0 -> -1.00E-6144 Subnormal
+dqmxg534 maxmag -0.01E-6143 0 -> -1E-6145 Subnormal
+dqmxg535 maxmag -0.999E-6143 0 -> -9.99E-6144 Subnormal
+dqmxg536 maxmag -0.099E-6143 0 -> -9.9E-6145 Subnormal
+dqmxg537 maxmag -0.009E-6143 0 -> -9E-6146 Subnormal
+dqmxg538 maxmag -0.001E-6143 0 -> -1E-6146 Subnormal
+dqmxg539 maxmag -0.0009E-6143 0 -> -9E-6147 Subnormal
+dqmxg540 maxmag -0.0001E-6143 0 -> -1E-6147 Subnormal
+
+-- Null tests
+dqmxg900 maxmag 10 # -> NaN Invalid_operation
+dqmxg901 maxmag # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqMin.decTest b/Lib/test/decimaltestdata/dqMin.decTest
index 53020398c5..c87f4c54ed 100644
--- a/Lib/test/decimaltestdata/dqMin.decTest
+++ b/Lib/test/decimaltestdata/dqMin.decTest
@@ -1,309 +1,309 @@
-------------------------------------------------------------------------
--- dqMin.decTest -- decQuad minnum --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmin001 min -2 -2 -> -2
-dqmin002 min -2 -1 -> -2
-dqmin003 min -2 0 -> -2
-dqmin004 min -2 1 -> -2
-dqmin005 min -2 2 -> -2
-dqmin006 min -1 -2 -> -2
-dqmin007 min -1 -1 -> -1
-dqmin008 min -1 0 -> -1
-dqmin009 min -1 1 -> -1
-dqmin010 min -1 2 -> -1
-dqmin011 min 0 -2 -> -2
-dqmin012 min 0 -1 -> -1
-dqmin013 min 0 0 -> 0
-dqmin014 min 0 1 -> 0
-dqmin015 min 0 2 -> 0
-dqmin016 min 1 -2 -> -2
-dqmin017 min 1 -1 -> -1
-dqmin018 min 1 0 -> 0
-dqmin019 min 1 1 -> 1
-dqmin020 min 1 2 -> 1
-dqmin021 min 2 -2 -> -2
-dqmin022 min 2 -1 -> -1
-dqmin023 min 2 0 -> 0
-dqmin025 min 2 1 -> 1
-dqmin026 min 2 2 -> 2
-
--- extended zeros
-dqmin030 min 0 0 -> 0
-dqmin031 min 0 -0 -> -0
-dqmin032 min 0 -0.0 -> -0.0
-dqmin033 min 0 0.0 -> 0.0
-dqmin034 min -0 0 -> -0
-dqmin035 min -0 -0 -> -0
-dqmin036 min -0 -0.0 -> -0
-dqmin037 min -0 0.0 -> -0
-dqmin038 min 0.0 0 -> 0.0
-dqmin039 min 0.0 -0 -> -0
-dqmin040 min 0.0 -0.0 -> -0.0
-dqmin041 min 0.0 0.0 -> 0.0
-dqmin042 min -0.0 0 -> -0.0
-dqmin043 min -0.0 -0 -> -0
-dqmin044 min -0.0 -0.0 -> -0.0
-dqmin045 min -0.0 0.0 -> -0.0
-
-dqmin046 min 0E1 -0E1 -> -0E+1
-dqmin047 min -0E1 0E2 -> -0E+1
-dqmin048 min 0E2 0E1 -> 0E+1
-dqmin049 min 0E1 0E2 -> 0E+1
-dqmin050 min -0E3 -0E2 -> -0E+3
-dqmin051 min -0E2 -0E3 -> -0E+3
-
--- Specials
-dqmin090 min Inf -Inf -> -Infinity
-dqmin091 min Inf -1000 -> -1000
-dqmin092 min Inf -1 -> -1
-dqmin093 min Inf -0 -> -0
-dqmin094 min Inf 0 -> 0
-dqmin095 min Inf 1 -> 1
-dqmin096 min Inf 1000 -> 1000
-dqmin097 min Inf Inf -> Infinity
-dqmin098 min -1000 Inf -> -1000
-dqmin099 min -Inf Inf -> -Infinity
-dqmin100 min -1 Inf -> -1
-dqmin101 min -0 Inf -> -0
-dqmin102 min 0 Inf -> 0
-dqmin103 min 1 Inf -> 1
-dqmin104 min 1000 Inf -> 1000
-dqmin105 min Inf Inf -> Infinity
-
-dqmin120 min -Inf -Inf -> -Infinity
-dqmin121 min -Inf -1000 -> -Infinity
-dqmin122 min -Inf -1 -> -Infinity
-dqmin123 min -Inf -0 -> -Infinity
-dqmin124 min -Inf 0 -> -Infinity
-dqmin125 min -Inf 1 -> -Infinity
-dqmin126 min -Inf 1000 -> -Infinity
-dqmin127 min -Inf Inf -> -Infinity
-dqmin128 min -Inf -Inf -> -Infinity
-dqmin129 min -1000 -Inf -> -Infinity
-dqmin130 min -1 -Inf -> -Infinity
-dqmin131 min -0 -Inf -> -Infinity
-dqmin132 min 0 -Inf -> -Infinity
-dqmin133 min 1 -Inf -> -Infinity
-dqmin134 min 1000 -Inf -> -Infinity
-dqmin135 min Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-dqmin141 min NaN -Inf -> -Infinity
-dqmin142 min NaN -1000 -> -1000
-dqmin143 min NaN -1 -> -1
-dqmin144 min NaN -0 -> -0
-dqmin145 min NaN 0 -> 0
-dqmin146 min NaN 1 -> 1
-dqmin147 min NaN 1000 -> 1000
-dqmin148 min NaN Inf -> Infinity
-dqmin149 min NaN NaN -> NaN
-dqmin150 min -Inf NaN -> -Infinity
-dqmin151 min -1000 NaN -> -1000
-dqmin152 min -1 -NaN -> -1
-dqmin153 min -0 NaN -> -0
-dqmin154 min 0 -NaN -> 0
-dqmin155 min 1 NaN -> 1
-dqmin156 min 1000 NaN -> 1000
-dqmin157 min Inf NaN -> Infinity
-
-dqmin161 min sNaN -Inf -> NaN Invalid_operation
-dqmin162 min sNaN -1000 -> NaN Invalid_operation
-dqmin163 min sNaN -1 -> NaN Invalid_operation
-dqmin164 min sNaN -0 -> NaN Invalid_operation
-dqmin165 min -sNaN 0 -> -NaN Invalid_operation
-dqmin166 min -sNaN 1 -> -NaN Invalid_operation
-dqmin167 min sNaN 1000 -> NaN Invalid_operation
-dqmin168 min sNaN NaN -> NaN Invalid_operation
-dqmin169 min sNaN sNaN -> NaN Invalid_operation
-dqmin170 min NaN sNaN -> NaN Invalid_operation
-dqmin171 min -Inf sNaN -> NaN Invalid_operation
-dqmin172 min -1000 sNaN -> NaN Invalid_operation
-dqmin173 min -1 sNaN -> NaN Invalid_operation
-dqmin174 min -0 sNaN -> NaN Invalid_operation
-dqmin175 min 0 sNaN -> NaN Invalid_operation
-dqmin176 min 1 sNaN -> NaN Invalid_operation
-dqmin177 min 1000 sNaN -> NaN Invalid_operation
-dqmin178 min Inf sNaN -> NaN Invalid_operation
-dqmin179 min NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmin181 min NaN9 -Inf -> -Infinity
-dqmin182 min -NaN8 9990 -> 9990
-dqmin183 min NaN71 Inf -> Infinity
-
-dqmin184 min NaN1 NaN54 -> NaN1
-dqmin185 min NaN22 -NaN53 -> NaN22
-dqmin186 min -NaN3 NaN6 -> -NaN3
-dqmin187 min -NaN44 NaN7 -> -NaN44
-
-dqmin188 min -Inf NaN41 -> -Infinity
-dqmin189 min -9999 -NaN33 -> -9999
-dqmin190 min Inf NaN2 -> Infinity
-
-dqmin191 min sNaN99 -Inf -> NaN99 Invalid_operation
-dqmin192 min sNaN98 -11 -> NaN98 Invalid_operation
-dqmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation
-dqmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
-dqmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmin196 min -Inf sNaN92 -> NaN92 Invalid_operation
-dqmin197 min 088 sNaN91 -> NaN91 Invalid_operation
-dqmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmin199 min NaN sNaN86 -> NaN86 Invalid_operation
-
--- old rounding checks
-dqmin221 min -12345678000 1 -> -12345678000
-dqmin222 min 1 -12345678000 -> -12345678000
-dqmin223 min -1234567800 1 -> -1234567800
-dqmin224 min 1 -1234567800 -> -1234567800
-dqmin225 min -1234567890 1 -> -1234567890
-dqmin226 min 1 -1234567890 -> -1234567890
-dqmin227 min -1234567891 1 -> -1234567891
-dqmin228 min 1 -1234567891 -> -1234567891
-dqmin229 min -12345678901 1 -> -12345678901
-dqmin230 min 1 -12345678901 -> -12345678901
-dqmin231 min -1234567896 1 -> -1234567896
-dqmin232 min 1 -1234567896 -> -1234567896
-dqmin233 min 1234567891 1 -> 1
-dqmin234 min 1 1234567891 -> 1
-dqmin235 min 12345678901 1 -> 1
-dqmin236 min 1 12345678901 -> 1
-dqmin237 min 1234567896 1 -> 1
-dqmin238 min 1 1234567896 -> 1
-
--- from examples
-dqmin280 min '3' '2' -> '2'
-dqmin281 min '-10' '3' -> '-10'
-dqmin282 min '1.0' '1' -> '1.0'
-dqmin283 min '1' '1.0' -> '1.0'
-dqmin284 min '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-dqmin401 min Inf 1.1 -> 1.1
-dqmin402 min 1.1 1 -> 1
-dqmin403 min 1 1.0 -> 1.0
-dqmin404 min 1.0 0.1 -> 0.1
-dqmin405 min 0.1 0.10 -> 0.10
-dqmin406 min 0.10 0.100 -> 0.100
-dqmin407 min 0.10 0 -> 0
-dqmin408 min 0 0.0 -> 0.0
-dqmin409 min 0.0 -0 -> -0
-dqmin410 min 0.0 -0.0 -> -0.0
-dqmin411 min 0.00 -0.0 -> -0.0
-dqmin412 min 0.0 -0.00 -> -0.00
-dqmin413 min 0 -0.0 -> -0.0
-dqmin414 min 0 -0 -> -0
-dqmin415 min -0.0 -0 -> -0
-dqmin416 min -0 -0.100 -> -0.100
-dqmin417 min -0.100 -0.10 -> -0.10
-dqmin418 min -0.10 -0.1 -> -0.1
-dqmin419 min -0.1 -1.0 -> -1.0
-dqmin420 min -1.0 -1 -> -1
-dqmin421 min -1 -1.1 -> -1.1
-dqmin423 min -1.1 -Inf -> -Infinity
--- same with operands reversed
-dqmin431 min 1.1 Inf -> 1.1
-dqmin432 min 1 1.1 -> 1
-dqmin433 min 1.0 1 -> 1.0
-dqmin434 min 0.1 1.0 -> 0.1
-dqmin435 min 0.10 0.1 -> 0.10
-dqmin436 min 0.100 0.10 -> 0.100
-dqmin437 min 0 0.10 -> 0
-dqmin438 min 0.0 0 -> 0.0
-dqmin439 min -0 0.0 -> -0
-dqmin440 min -0.0 0.0 -> -0.0
-dqmin441 min -0.0 0.00 -> -0.0
-dqmin442 min -0.00 0.0 -> -0.00
-dqmin443 min -0.0 0 -> -0.0
-dqmin444 min -0 0 -> -0
-dqmin445 min -0 -0.0 -> -0
-dqmin446 min -0.100 -0 -> -0.100
-dqmin447 min -0.10 -0.100 -> -0.10
-dqmin448 min -0.1 -0.10 -> -0.1
-dqmin449 min -1.0 -0.1 -> -1.0
-dqmin450 min -1 -1.0 -> -1
-dqmin451 min -1.1 -1 -> -1.1
-dqmin453 min -Inf -1.1 -> -Infinity
--- largies
-dqmin460 min 1000 1E+3 -> 1000
-dqmin461 min 1E+3 1000 -> 1000
-dqmin462 min 1000 -1E+3 -> -1E+3
-dqmin463 min 1E+3 -384 -> -384
-dqmin464 min -384 1E+3 -> -384
-dqmin465 min -1E+3 1000 -> -1E+3
-dqmin466 min -384 -1E+3 -> -1E+3
-dqmin467 min -1E+3 -384 -> -1E+3
-
--- misalignment traps for little-endian
-dqmin471 min 1.0 0.1 -> 0.1
-dqmin472 min 0.1 1.0 -> 0.1
-dqmin473 min 10.0 0.1 -> 0.1
-dqmin474 min 0.1 10.0 -> 0.1
-dqmin475 min 100 1.0 -> 1.0
-dqmin476 min 1.0 100 -> 1.0
-dqmin477 min 1000 10.0 -> 10.0
-dqmin478 min 10.0 1000 -> 10.0
-dqmin479 min 10000 100.0 -> 100.0
-dqmin480 min 100.0 10000 -> 100.0
-dqmin481 min 100000 1000.0 -> 1000.0
-dqmin482 min 1000.0 100000 -> 1000.0
-dqmin483 min 1000000 10000.0 -> 10000.0
-dqmin484 min 10000.0 1000000 -> 10000.0
-
--- subnormals
-dqmin510 min 1.00E-6143 0 -> 0
-dqmin511 min 0.1E-6143 0 -> 0
-dqmin512 min 0.10E-6143 0 -> 0
-dqmin513 min 0.100E-6143 0 -> 0
-dqmin514 min 0.01E-6143 0 -> 0
-dqmin515 min 0.999E-6143 0 -> 0
-dqmin516 min 0.099E-6143 0 -> 0
-dqmin517 min 0.009E-6143 0 -> 0
-dqmin518 min 0.001E-6143 0 -> 0
-dqmin519 min 0.0009E-6143 0 -> 0
-dqmin520 min 0.0001E-6143 0 -> 0
-
-dqmin530 min -1.00E-6143 0 -> -1.00E-6143
-dqmin531 min -0.1E-6143 0 -> -1E-6144 Subnormal
-dqmin532 min -0.10E-6143 0 -> -1.0E-6144 Subnormal
-dqmin533 min -0.100E-6143 0 -> -1.00E-6144 Subnormal
-dqmin534 min -0.01E-6143 0 -> -1E-6145 Subnormal
-dqmin535 min -0.999E-6143 0 -> -9.99E-6144 Subnormal
-dqmin536 min -0.099E-6143 0 -> -9.9E-6145 Subnormal
-dqmin537 min -0.009E-6143 0 -> -9E-6146 Subnormal
-dqmin538 min -0.001E-6143 0 -> -1E-6146 Subnormal
-dqmin539 min -0.0009E-6143 0 -> -9E-6147 Subnormal
-dqmin540 min -0.0001E-6143 0 -> -1E-6147 Subnormal
-
-
--- Null tests
-dqmin900 min 10 # -> NaN Invalid_operation
-dqmin901 min # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqMin.decTest -- decQuad minnum --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmin001 min -2 -2 -> -2
+dqmin002 min -2 -1 -> -2
+dqmin003 min -2 0 -> -2
+dqmin004 min -2 1 -> -2
+dqmin005 min -2 2 -> -2
+dqmin006 min -1 -2 -> -2
+dqmin007 min -1 -1 -> -1
+dqmin008 min -1 0 -> -1
+dqmin009 min -1 1 -> -1
+dqmin010 min -1 2 -> -1
+dqmin011 min 0 -2 -> -2
+dqmin012 min 0 -1 -> -1
+dqmin013 min 0 0 -> 0
+dqmin014 min 0 1 -> 0
+dqmin015 min 0 2 -> 0
+dqmin016 min 1 -2 -> -2
+dqmin017 min 1 -1 -> -1
+dqmin018 min 1 0 -> 0
+dqmin019 min 1 1 -> 1
+dqmin020 min 1 2 -> 1
+dqmin021 min 2 -2 -> -2
+dqmin022 min 2 -1 -> -1
+dqmin023 min 2 0 -> 0
+dqmin025 min 2 1 -> 1
+dqmin026 min 2 2 -> 2
+
+-- extended zeros
+dqmin030 min 0 0 -> 0
+dqmin031 min 0 -0 -> -0
+dqmin032 min 0 -0.0 -> -0.0
+dqmin033 min 0 0.0 -> 0.0
+dqmin034 min -0 0 -> -0
+dqmin035 min -0 -0 -> -0
+dqmin036 min -0 -0.0 -> -0
+dqmin037 min -0 0.0 -> -0
+dqmin038 min 0.0 0 -> 0.0
+dqmin039 min 0.0 -0 -> -0
+dqmin040 min 0.0 -0.0 -> -0.0
+dqmin041 min 0.0 0.0 -> 0.0
+dqmin042 min -0.0 0 -> -0.0
+dqmin043 min -0.0 -0 -> -0
+dqmin044 min -0.0 -0.0 -> -0.0
+dqmin045 min -0.0 0.0 -> -0.0
+
+dqmin046 min 0E1 -0E1 -> -0E+1
+dqmin047 min -0E1 0E2 -> -0E+1
+dqmin048 min 0E2 0E1 -> 0E+1
+dqmin049 min 0E1 0E2 -> 0E+1
+dqmin050 min -0E3 -0E2 -> -0E+3
+dqmin051 min -0E2 -0E3 -> -0E+3
+
+-- Specials
+dqmin090 min Inf -Inf -> -Infinity
+dqmin091 min Inf -1000 -> -1000
+dqmin092 min Inf -1 -> -1
+dqmin093 min Inf -0 -> -0
+dqmin094 min Inf 0 -> 0
+dqmin095 min Inf 1 -> 1
+dqmin096 min Inf 1000 -> 1000
+dqmin097 min Inf Inf -> Infinity
+dqmin098 min -1000 Inf -> -1000
+dqmin099 min -Inf Inf -> -Infinity
+dqmin100 min -1 Inf -> -1
+dqmin101 min -0 Inf -> -0
+dqmin102 min 0 Inf -> 0
+dqmin103 min 1 Inf -> 1
+dqmin104 min 1000 Inf -> 1000
+dqmin105 min Inf Inf -> Infinity
+
+dqmin120 min -Inf -Inf -> -Infinity
+dqmin121 min -Inf -1000 -> -Infinity
+dqmin122 min -Inf -1 -> -Infinity
+dqmin123 min -Inf -0 -> -Infinity
+dqmin124 min -Inf 0 -> -Infinity
+dqmin125 min -Inf 1 -> -Infinity
+dqmin126 min -Inf 1000 -> -Infinity
+dqmin127 min -Inf Inf -> -Infinity
+dqmin128 min -Inf -Inf -> -Infinity
+dqmin129 min -1000 -Inf -> -Infinity
+dqmin130 min -1 -Inf -> -Infinity
+dqmin131 min -0 -Inf -> -Infinity
+dqmin132 min 0 -Inf -> -Infinity
+dqmin133 min 1 -Inf -> -Infinity
+dqmin134 min 1000 -Inf -> -Infinity
+dqmin135 min Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+dqmin141 min NaN -Inf -> -Infinity
+dqmin142 min NaN -1000 -> -1000
+dqmin143 min NaN -1 -> -1
+dqmin144 min NaN -0 -> -0
+dqmin145 min NaN 0 -> 0
+dqmin146 min NaN 1 -> 1
+dqmin147 min NaN 1000 -> 1000
+dqmin148 min NaN Inf -> Infinity
+dqmin149 min NaN NaN -> NaN
+dqmin150 min -Inf NaN -> -Infinity
+dqmin151 min -1000 NaN -> -1000
+dqmin152 min -1 -NaN -> -1
+dqmin153 min -0 NaN -> -0
+dqmin154 min 0 -NaN -> 0
+dqmin155 min 1 NaN -> 1
+dqmin156 min 1000 NaN -> 1000
+dqmin157 min Inf NaN -> Infinity
+
+dqmin161 min sNaN -Inf -> NaN Invalid_operation
+dqmin162 min sNaN -1000 -> NaN Invalid_operation
+dqmin163 min sNaN -1 -> NaN Invalid_operation
+dqmin164 min sNaN -0 -> NaN Invalid_operation
+dqmin165 min -sNaN 0 -> -NaN Invalid_operation
+dqmin166 min -sNaN 1 -> -NaN Invalid_operation
+dqmin167 min sNaN 1000 -> NaN Invalid_operation
+dqmin168 min sNaN NaN -> NaN Invalid_operation
+dqmin169 min sNaN sNaN -> NaN Invalid_operation
+dqmin170 min NaN sNaN -> NaN Invalid_operation
+dqmin171 min -Inf sNaN -> NaN Invalid_operation
+dqmin172 min -1000 sNaN -> NaN Invalid_operation
+dqmin173 min -1 sNaN -> NaN Invalid_operation
+dqmin174 min -0 sNaN -> NaN Invalid_operation
+dqmin175 min 0 sNaN -> NaN Invalid_operation
+dqmin176 min 1 sNaN -> NaN Invalid_operation
+dqmin177 min 1000 sNaN -> NaN Invalid_operation
+dqmin178 min Inf sNaN -> NaN Invalid_operation
+dqmin179 min NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmin181 min NaN9 -Inf -> -Infinity
+dqmin182 min -NaN8 9990 -> 9990
+dqmin183 min NaN71 Inf -> Infinity
+
+dqmin184 min NaN1 NaN54 -> NaN1
+dqmin185 min NaN22 -NaN53 -> NaN22
+dqmin186 min -NaN3 NaN6 -> -NaN3
+dqmin187 min -NaN44 NaN7 -> -NaN44
+
+dqmin188 min -Inf NaN41 -> -Infinity
+dqmin189 min -9999 -NaN33 -> -9999
+dqmin190 min Inf NaN2 -> Infinity
+
+dqmin191 min sNaN99 -Inf -> NaN99 Invalid_operation
+dqmin192 min sNaN98 -11 -> NaN98 Invalid_operation
+dqmin193 min -sNaN97 NaN8 -> -NaN97 Invalid_operation
+dqmin194 min sNaN69 sNaN94 -> NaN69 Invalid_operation
+dqmin195 min NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmin196 min -Inf sNaN92 -> NaN92 Invalid_operation
+dqmin197 min 088 sNaN91 -> NaN91 Invalid_operation
+dqmin198 min Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmin199 min NaN sNaN86 -> NaN86 Invalid_operation
+
+-- old rounding checks
+dqmin221 min -12345678000 1 -> -12345678000
+dqmin222 min 1 -12345678000 -> -12345678000
+dqmin223 min -1234567800 1 -> -1234567800
+dqmin224 min 1 -1234567800 -> -1234567800
+dqmin225 min -1234567890 1 -> -1234567890
+dqmin226 min 1 -1234567890 -> -1234567890
+dqmin227 min -1234567891 1 -> -1234567891
+dqmin228 min 1 -1234567891 -> -1234567891
+dqmin229 min -12345678901 1 -> -12345678901
+dqmin230 min 1 -12345678901 -> -12345678901
+dqmin231 min -1234567896 1 -> -1234567896
+dqmin232 min 1 -1234567896 -> -1234567896
+dqmin233 min 1234567891 1 -> 1
+dqmin234 min 1 1234567891 -> 1
+dqmin235 min 12345678901 1 -> 1
+dqmin236 min 1 12345678901 -> 1
+dqmin237 min 1234567896 1 -> 1
+dqmin238 min 1 1234567896 -> 1
+
+-- from examples
+dqmin280 min '3' '2' -> '2'
+dqmin281 min '-10' '3' -> '-10'
+dqmin282 min '1.0' '1' -> '1.0'
+dqmin283 min '1' '1.0' -> '1.0'
+dqmin284 min '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+dqmin401 min Inf 1.1 -> 1.1
+dqmin402 min 1.1 1 -> 1
+dqmin403 min 1 1.0 -> 1.0
+dqmin404 min 1.0 0.1 -> 0.1
+dqmin405 min 0.1 0.10 -> 0.10
+dqmin406 min 0.10 0.100 -> 0.100
+dqmin407 min 0.10 0 -> 0
+dqmin408 min 0 0.0 -> 0.0
+dqmin409 min 0.0 -0 -> -0
+dqmin410 min 0.0 -0.0 -> -0.0
+dqmin411 min 0.00 -0.0 -> -0.0
+dqmin412 min 0.0 -0.00 -> -0.00
+dqmin413 min 0 -0.0 -> -0.0
+dqmin414 min 0 -0 -> -0
+dqmin415 min -0.0 -0 -> -0
+dqmin416 min -0 -0.100 -> -0.100
+dqmin417 min -0.100 -0.10 -> -0.10
+dqmin418 min -0.10 -0.1 -> -0.1
+dqmin419 min -0.1 -1.0 -> -1.0
+dqmin420 min -1.0 -1 -> -1
+dqmin421 min -1 -1.1 -> -1.1
+dqmin423 min -1.1 -Inf -> -Infinity
+-- same with operands reversed
+dqmin431 min 1.1 Inf -> 1.1
+dqmin432 min 1 1.1 -> 1
+dqmin433 min 1.0 1 -> 1.0
+dqmin434 min 0.1 1.0 -> 0.1
+dqmin435 min 0.10 0.1 -> 0.10
+dqmin436 min 0.100 0.10 -> 0.100
+dqmin437 min 0 0.10 -> 0
+dqmin438 min 0.0 0 -> 0.0
+dqmin439 min -0 0.0 -> -0
+dqmin440 min -0.0 0.0 -> -0.0
+dqmin441 min -0.0 0.00 -> -0.0
+dqmin442 min -0.00 0.0 -> -0.00
+dqmin443 min -0.0 0 -> -0.0
+dqmin444 min -0 0 -> -0
+dqmin445 min -0 -0.0 -> -0
+dqmin446 min -0.100 -0 -> -0.100
+dqmin447 min -0.10 -0.100 -> -0.10
+dqmin448 min -0.1 -0.10 -> -0.1
+dqmin449 min -1.0 -0.1 -> -1.0
+dqmin450 min -1 -1.0 -> -1
+dqmin451 min -1.1 -1 -> -1.1
+dqmin453 min -Inf -1.1 -> -Infinity
+-- largies
+dqmin460 min 1000 1E+3 -> 1000
+dqmin461 min 1E+3 1000 -> 1000
+dqmin462 min 1000 -1E+3 -> -1E+3
+dqmin463 min 1E+3 -384 -> -384
+dqmin464 min -384 1E+3 -> -384
+dqmin465 min -1E+3 1000 -> -1E+3
+dqmin466 min -384 -1E+3 -> -1E+3
+dqmin467 min -1E+3 -384 -> -1E+3
+
+-- misalignment traps for little-endian
+dqmin471 min 1.0 0.1 -> 0.1
+dqmin472 min 0.1 1.0 -> 0.1
+dqmin473 min 10.0 0.1 -> 0.1
+dqmin474 min 0.1 10.0 -> 0.1
+dqmin475 min 100 1.0 -> 1.0
+dqmin476 min 1.0 100 -> 1.0
+dqmin477 min 1000 10.0 -> 10.0
+dqmin478 min 10.0 1000 -> 10.0
+dqmin479 min 10000 100.0 -> 100.0
+dqmin480 min 100.0 10000 -> 100.0
+dqmin481 min 100000 1000.0 -> 1000.0
+dqmin482 min 1000.0 100000 -> 1000.0
+dqmin483 min 1000000 10000.0 -> 10000.0
+dqmin484 min 10000.0 1000000 -> 10000.0
+
+-- subnormals
+dqmin510 min 1.00E-6143 0 -> 0
+dqmin511 min 0.1E-6143 0 -> 0
+dqmin512 min 0.10E-6143 0 -> 0
+dqmin513 min 0.100E-6143 0 -> 0
+dqmin514 min 0.01E-6143 0 -> 0
+dqmin515 min 0.999E-6143 0 -> 0
+dqmin516 min 0.099E-6143 0 -> 0
+dqmin517 min 0.009E-6143 0 -> 0
+dqmin518 min 0.001E-6143 0 -> 0
+dqmin519 min 0.0009E-6143 0 -> 0
+dqmin520 min 0.0001E-6143 0 -> 0
+
+dqmin530 min -1.00E-6143 0 -> -1.00E-6143
+dqmin531 min -0.1E-6143 0 -> -1E-6144 Subnormal
+dqmin532 min -0.10E-6143 0 -> -1.0E-6144 Subnormal
+dqmin533 min -0.100E-6143 0 -> -1.00E-6144 Subnormal
+dqmin534 min -0.01E-6143 0 -> -1E-6145 Subnormal
+dqmin535 min -0.999E-6143 0 -> -9.99E-6144 Subnormal
+dqmin536 min -0.099E-6143 0 -> -9.9E-6145 Subnormal
+dqmin537 min -0.009E-6143 0 -> -9E-6146 Subnormal
+dqmin538 min -0.001E-6143 0 -> -1E-6146 Subnormal
+dqmin539 min -0.0009E-6143 0 -> -9E-6147 Subnormal
+dqmin540 min -0.0001E-6143 0 -> -1E-6147 Subnormal
+
+
+-- Null tests
+dqmin900 min 10 # -> NaN Invalid_operation
+dqmin901 min # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqMinMag.decTest b/Lib/test/decimaltestdata/dqMinMag.decTest
index 71b886fb58..edc2e476ac 100644
--- a/Lib/test/decimaltestdata/dqMinMag.decTest
+++ b/Lib/test/decimaltestdata/dqMinMag.decTest
@@ -1,293 +1,293 @@
-------------------------------------------------------------------------
--- dqMinMag.decTest -- decQuad minnummag --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmng001 minmag -2 -2 -> -2
-dqmng002 minmag -2 -1 -> -1
-dqmng003 minmag -2 0 -> 0
-dqmng004 minmag -2 1 -> 1
-dqmng005 minmag -2 2 -> -2
-dqmng006 minmag -1 -2 -> -1
-dqmng007 minmag -1 -1 -> -1
-dqmng008 minmag -1 0 -> 0
-dqmng009 minmag -1 1 -> -1
-dqmng010 minmag -1 2 -> -1
-dqmng011 minmag 0 -2 -> 0
-dqmng012 minmag 0 -1 -> 0
-dqmng013 minmag 0 0 -> 0
-dqmng014 minmag 0 1 -> 0
-dqmng015 minmag 0 2 -> 0
-dqmng016 minmag 1 -2 -> 1
-dqmng017 minmag 1 -1 -> -1
-dqmng018 minmag 1 0 -> 0
-dqmng019 minmag 1 1 -> 1
-dqmng020 minmag 1 2 -> 1
-dqmng021 minmag 2 -2 -> -2
-dqmng022 minmag 2 -1 -> -1
-dqmng023 minmag 2 0 -> 0
-dqmng025 minmag 2 1 -> 1
-dqmng026 minmag 2 2 -> 2
-
--- extended zeros
-dqmng030 minmag 0 0 -> 0
-dqmng031 minmag 0 -0 -> -0
-dqmng032 minmag 0 -0.0 -> -0.0
-dqmng033 minmag 0 0.0 -> 0.0
-dqmng034 minmag -0 0 -> -0
-dqmng035 minmag -0 -0 -> -0
-dqmng036 minmag -0 -0.0 -> -0
-dqmng037 minmag -0 0.0 -> -0
-dqmng038 minmag 0.0 0 -> 0.0
-dqmng039 minmag 0.0 -0 -> -0
-dqmng040 minmag 0.0 -0.0 -> -0.0
-dqmng041 minmag 0.0 0.0 -> 0.0
-dqmng042 minmag -0.0 0 -> -0.0
-dqmng043 minmag -0.0 -0 -> -0
-dqmng044 minmag -0.0 -0.0 -> -0.0
-dqmng045 minmag -0.0 0.0 -> -0.0
-
-dqmng046 minmag 0E1 -0E1 -> -0E+1
-dqmng047 minmag -0E1 0E2 -> -0E+1
-dqmng048 minmag 0E2 0E1 -> 0E+1
-dqmng049 minmag 0E1 0E2 -> 0E+1
-dqmng050 minmag -0E3 -0E2 -> -0E+3
-dqmng051 minmag -0E2 -0E3 -> -0E+3
-
--- Specials
-dqmng090 minmag Inf -Inf -> -Infinity
-dqmng091 minmag Inf -1000 -> -1000
-dqmng092 minmag Inf -1 -> -1
-dqmng093 minmag Inf -0 -> -0
-dqmng094 minmag Inf 0 -> 0
-dqmng095 minmag Inf 1 -> 1
-dqmng096 minmag Inf 1000 -> 1000
-dqmng097 minmag Inf Inf -> Infinity
-dqmng098 minmag -1000 Inf -> -1000
-dqmng099 minmag -Inf Inf -> -Infinity
-dqmng100 minmag -1 Inf -> -1
-dqmng101 minmag -0 Inf -> -0
-dqmng102 minmag 0 Inf -> 0
-dqmng103 minmag 1 Inf -> 1
-dqmng104 minmag 1000 Inf -> 1000
-dqmng105 minmag Inf Inf -> Infinity
-
-dqmng120 minmag -Inf -Inf -> -Infinity
-dqmng121 minmag -Inf -1000 -> -1000
-dqmng122 minmag -Inf -1 -> -1
-dqmng123 minmag -Inf -0 -> -0
-dqmng124 minmag -Inf 0 -> 0
-dqmng125 minmag -Inf 1 -> 1
-dqmng126 minmag -Inf 1000 -> 1000
-dqmng127 minmag -Inf Inf -> -Infinity
-dqmng128 minmag -Inf -Inf -> -Infinity
-dqmng129 minmag -1000 -Inf -> -1000
-dqmng130 minmag -1 -Inf -> -1
-dqmng131 minmag -0 -Inf -> -0
-dqmng132 minmag 0 -Inf -> 0
-dqmng133 minmag 1 -Inf -> 1
-dqmng134 minmag 1000 -Inf -> 1000
-dqmng135 minmag Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-dqmng141 minmag NaN -Inf -> -Infinity
-dqmng142 minmag NaN -1000 -> -1000
-dqmng143 minmag NaN -1 -> -1
-dqmng144 minmag NaN -0 -> -0
-dqmng145 minmag NaN 0 -> 0
-dqmng146 minmag NaN 1 -> 1
-dqmng147 minmag NaN 1000 -> 1000
-dqmng148 minmag NaN Inf -> Infinity
-dqmng149 minmag NaN NaN -> NaN
-dqmng150 minmag -Inf NaN -> -Infinity
-dqmng151 minmag -1000 NaN -> -1000
-dqmng152 minmag -1 -NaN -> -1
-dqmng153 minmag -0 NaN -> -0
-dqmng154 minmag 0 -NaN -> 0
-dqmng155 minmag 1 NaN -> 1
-dqmng156 minmag 1000 NaN -> 1000
-dqmng157 minmag Inf NaN -> Infinity
-
-dqmng161 minmag sNaN -Inf -> NaN Invalid_operation
-dqmng162 minmag sNaN -1000 -> NaN Invalid_operation
-dqmng163 minmag sNaN -1 -> NaN Invalid_operation
-dqmng164 minmag sNaN -0 -> NaN Invalid_operation
-dqmng165 minmag -sNaN 0 -> -NaN Invalid_operation
-dqmng166 minmag -sNaN 1 -> -NaN Invalid_operation
-dqmng167 minmag sNaN 1000 -> NaN Invalid_operation
-dqmng168 minmag sNaN NaN -> NaN Invalid_operation
-dqmng169 minmag sNaN sNaN -> NaN Invalid_operation
-dqmng170 minmag NaN sNaN -> NaN Invalid_operation
-dqmng171 minmag -Inf sNaN -> NaN Invalid_operation
-dqmng172 minmag -1000 sNaN -> NaN Invalid_operation
-dqmng173 minmag -1 sNaN -> NaN Invalid_operation
-dqmng174 minmag -0 sNaN -> NaN Invalid_operation
-dqmng175 minmag 0 sNaN -> NaN Invalid_operation
-dqmng176 minmag 1 sNaN -> NaN Invalid_operation
-dqmng177 minmag 1000 sNaN -> NaN Invalid_operation
-dqmng178 minmag Inf sNaN -> NaN Invalid_operation
-dqmng179 minmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmng181 minmag NaN9 -Inf -> -Infinity
-dqmng182 minmag -NaN8 9990 -> 9990
-dqmng183 minmag NaN71 Inf -> Infinity
-
-dqmng184 minmag NaN1 NaN54 -> NaN1
-dqmng185 minmag NaN22 -NaN53 -> NaN22
-dqmng186 minmag -NaN3 NaN6 -> -NaN3
-dqmng187 minmag -NaN44 NaN7 -> -NaN44
-
-dqmng188 minmag -Inf NaN41 -> -Infinity
-dqmng189 minmag -9999 -NaN33 -> -9999
-dqmng190 minmag Inf NaN2 -> Infinity
-
-dqmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
-dqmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation
-dqmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
-dqmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
-dqmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
-dqmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation
-dqmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation
-
--- old rounding checks
-dqmng221 minmag -12345678000 1 -> 1
-dqmng222 minmag 1 -12345678000 -> 1
-dqmng223 minmag -1234567800 1 -> 1
-dqmng224 minmag 1 -1234567800 -> 1
-dqmng225 minmag -1234567890 1 -> 1
-dqmng226 minmag 1 -1234567890 -> 1
-dqmng227 minmag -1234567891 1 -> 1
-dqmng228 minmag 1 -1234567891 -> 1
-dqmng229 minmag -12345678901 1 -> 1
-dqmng230 minmag 1 -12345678901 -> 1
-dqmng231 minmag -1234567896 1 -> 1
-dqmng232 minmag 1 -1234567896 -> 1
-dqmng233 minmag 1234567891 1 -> 1
-dqmng234 minmag 1 1234567891 -> 1
-dqmng235 minmag 12345678901 1 -> 1
-dqmng236 minmag 1 12345678901 -> 1
-dqmng237 minmag 1234567896 1 -> 1
-dqmng238 minmag 1 1234567896 -> 1
-
--- from examples
-dqmng280 minmag '3' '2' -> '2'
-dqmng281 minmag '-10' '3' -> '3'
-dqmng282 minmag '1.0' '1' -> '1.0'
-dqmng283 minmag '1' '1.0' -> '1.0'
-dqmng284 minmag '7' 'NaN' -> '7'
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-dqmng401 minmag Inf 1.1 -> 1.1
-dqmng402 minmag 1.1 1 -> 1
-dqmng403 minmag 1 1.0 -> 1.0
-dqmng404 minmag 1.0 0.1 -> 0.1
-dqmng405 minmag 0.1 0.10 -> 0.10
-dqmng406 minmag 0.10 0.100 -> 0.100
-dqmng407 minmag 0.10 0 -> 0
-dqmng408 minmag 0 0.0 -> 0.0
-dqmng409 minmag 0.0 -0 -> -0
-dqmng410 minmag 0.0 -0.0 -> -0.0
-dqmng411 minmag 0.00 -0.0 -> -0.0
-dqmng412 minmag 0.0 -0.00 -> -0.00
-dqmng413 minmag 0 -0.0 -> -0.0
-dqmng414 minmag 0 -0 -> -0
-dqmng415 minmag -0.0 -0 -> -0
-dqmng416 minmag -0 -0.100 -> -0
-dqmng417 minmag -0.100 -0.10 -> -0.10
-dqmng418 minmag -0.10 -0.1 -> -0.1
-dqmng419 minmag -0.1 -1.0 -> -0.1
-dqmng420 minmag -1.0 -1 -> -1
-dqmng421 minmag -1 -1.1 -> -1
-dqmng423 minmag -1.1 -Inf -> -1.1
--- same with operands reversed
-dqmng431 minmag 1.1 Inf -> 1.1
-dqmng432 minmag 1 1.1 -> 1
-dqmng433 minmag 1.0 1 -> 1.0
-dqmng434 minmag 0.1 1.0 -> 0.1
-dqmng435 minmag 0.10 0.1 -> 0.10
-dqmng436 minmag 0.100 0.10 -> 0.100
-dqmng437 minmag 0 0.10 -> 0
-dqmng438 minmag 0.0 0 -> 0.0
-dqmng439 minmag -0 0.0 -> -0
-dqmng440 minmag -0.0 0.0 -> -0.0
-dqmng441 minmag -0.0 0.00 -> -0.0
-dqmng442 minmag -0.00 0.0 -> -0.00
-dqmng443 minmag -0.0 0 -> -0.0
-dqmng444 minmag -0 0 -> -0
-dqmng445 minmag -0 -0.0 -> -0
-dqmng446 minmag -0.100 -0 -> -0
-dqmng447 minmag -0.10 -0.100 -> -0.10
-dqmng448 minmag -0.1 -0.10 -> -0.1
-dqmng449 minmag -1.0 -0.1 -> -0.1
-dqmng450 minmag -1 -1.0 -> -1
-dqmng451 minmag -1.1 -1 -> -1
-dqmng453 minmag -Inf -1.1 -> -1.1
--- largies
-dqmng460 minmag 1000 1E+3 -> 1000
-dqmng461 minmag 1E+3 1000 -> 1000
-dqmng462 minmag 1000 -1E+3 -> -1E+3
-dqmng463 minmag 1E+3 -384 -> -384
-dqmng464 minmag -384 1E+3 -> -384
-dqmng465 minmag -1E+3 1000 -> -1E+3
-dqmng466 minmag -384 -1E+3 -> -384
-dqmng467 minmag -1E+3 -384 -> -384
-
--- subnormals
-dqmng510 minmag 1.00E-6143 0 -> 0
-dqmng511 minmag 0.1E-6143 0 -> 0
-dqmng512 minmag 0.10E-6143 0 -> 0
-dqmng513 minmag 0.100E-6143 0 -> 0
-dqmng514 minmag 0.01E-6143 0 -> 0
-dqmng515 minmag 0.999E-6143 0 -> 0
-dqmng516 minmag 0.099E-6143 0 -> 0
-dqmng517 minmag 0.009E-6143 0 -> 0
-dqmng518 minmag 0.001E-6143 0 -> 0
-dqmng519 minmag 0.0009E-6143 0 -> 0
-dqmng520 minmag 0.0001E-6143 0 -> 0
-
-dqmng530 minmag -1.00E-6143 0 -> 0
-dqmng531 minmag -0.1E-6143 0 -> 0
-dqmng532 minmag -0.10E-6143 0 -> 0
-dqmng533 minmag -0.100E-6143 0 -> 0
-dqmng534 minmag -0.01E-6143 0 -> 0
-dqmng535 minmag -0.999E-6143 0 -> 0
-dqmng536 minmag -0.099E-6143 0 -> 0
-dqmng537 minmag -0.009E-6143 0 -> 0
-dqmng538 minmag -0.001E-6143 0 -> 0
-dqmng539 minmag -0.0009E-6143 0 -> 0
-dqmng540 minmag -0.0001E-6143 0 -> 0
-
-
--- Null tests
-dqmng900 minmag 10 # -> NaN Invalid_operation
-dqmng901 minmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqMinMag.decTest -- decQuad minnummag --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmng001 minmag -2 -2 -> -2
+dqmng002 minmag -2 -1 -> -1
+dqmng003 minmag -2 0 -> 0
+dqmng004 minmag -2 1 -> 1
+dqmng005 minmag -2 2 -> -2
+dqmng006 minmag -1 -2 -> -1
+dqmng007 minmag -1 -1 -> -1
+dqmng008 minmag -1 0 -> 0
+dqmng009 minmag -1 1 -> -1
+dqmng010 minmag -1 2 -> -1
+dqmng011 minmag 0 -2 -> 0
+dqmng012 minmag 0 -1 -> 0
+dqmng013 minmag 0 0 -> 0
+dqmng014 minmag 0 1 -> 0
+dqmng015 minmag 0 2 -> 0
+dqmng016 minmag 1 -2 -> 1
+dqmng017 minmag 1 -1 -> -1
+dqmng018 minmag 1 0 -> 0
+dqmng019 minmag 1 1 -> 1
+dqmng020 minmag 1 2 -> 1
+dqmng021 minmag 2 -2 -> -2
+dqmng022 minmag 2 -1 -> -1
+dqmng023 minmag 2 0 -> 0
+dqmng025 minmag 2 1 -> 1
+dqmng026 minmag 2 2 -> 2
+
+-- extended zeros
+dqmng030 minmag 0 0 -> 0
+dqmng031 minmag 0 -0 -> -0
+dqmng032 minmag 0 -0.0 -> -0.0
+dqmng033 minmag 0 0.0 -> 0.0
+dqmng034 minmag -0 0 -> -0
+dqmng035 minmag -0 -0 -> -0
+dqmng036 minmag -0 -0.0 -> -0
+dqmng037 minmag -0 0.0 -> -0
+dqmng038 minmag 0.0 0 -> 0.0
+dqmng039 minmag 0.0 -0 -> -0
+dqmng040 minmag 0.0 -0.0 -> -0.0
+dqmng041 minmag 0.0 0.0 -> 0.0
+dqmng042 minmag -0.0 0 -> -0.0
+dqmng043 minmag -0.0 -0 -> -0
+dqmng044 minmag -0.0 -0.0 -> -0.0
+dqmng045 minmag -0.0 0.0 -> -0.0
+
+dqmng046 minmag 0E1 -0E1 -> -0E+1
+dqmng047 minmag -0E1 0E2 -> -0E+1
+dqmng048 minmag 0E2 0E1 -> 0E+1
+dqmng049 minmag 0E1 0E2 -> 0E+1
+dqmng050 minmag -0E3 -0E2 -> -0E+3
+dqmng051 minmag -0E2 -0E3 -> -0E+3
+
+-- Specials
+dqmng090 minmag Inf -Inf -> -Infinity
+dqmng091 minmag Inf -1000 -> -1000
+dqmng092 minmag Inf -1 -> -1
+dqmng093 minmag Inf -0 -> -0
+dqmng094 minmag Inf 0 -> 0
+dqmng095 minmag Inf 1 -> 1
+dqmng096 minmag Inf 1000 -> 1000
+dqmng097 minmag Inf Inf -> Infinity
+dqmng098 minmag -1000 Inf -> -1000
+dqmng099 minmag -Inf Inf -> -Infinity
+dqmng100 minmag -1 Inf -> -1
+dqmng101 minmag -0 Inf -> -0
+dqmng102 minmag 0 Inf -> 0
+dqmng103 minmag 1 Inf -> 1
+dqmng104 minmag 1000 Inf -> 1000
+dqmng105 minmag Inf Inf -> Infinity
+
+dqmng120 minmag -Inf -Inf -> -Infinity
+dqmng121 minmag -Inf -1000 -> -1000
+dqmng122 minmag -Inf -1 -> -1
+dqmng123 minmag -Inf -0 -> -0
+dqmng124 minmag -Inf 0 -> 0
+dqmng125 minmag -Inf 1 -> 1
+dqmng126 minmag -Inf 1000 -> 1000
+dqmng127 minmag -Inf Inf -> -Infinity
+dqmng128 minmag -Inf -Inf -> -Infinity
+dqmng129 minmag -1000 -Inf -> -1000
+dqmng130 minmag -1 -Inf -> -1
+dqmng131 minmag -0 -Inf -> -0
+dqmng132 minmag 0 -Inf -> 0
+dqmng133 minmag 1 -Inf -> 1
+dqmng134 minmag 1000 -Inf -> 1000
+dqmng135 minmag Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+dqmng141 minmag NaN -Inf -> -Infinity
+dqmng142 minmag NaN -1000 -> -1000
+dqmng143 minmag NaN -1 -> -1
+dqmng144 minmag NaN -0 -> -0
+dqmng145 minmag NaN 0 -> 0
+dqmng146 minmag NaN 1 -> 1
+dqmng147 minmag NaN 1000 -> 1000
+dqmng148 minmag NaN Inf -> Infinity
+dqmng149 minmag NaN NaN -> NaN
+dqmng150 minmag -Inf NaN -> -Infinity
+dqmng151 minmag -1000 NaN -> -1000
+dqmng152 minmag -1 -NaN -> -1
+dqmng153 minmag -0 NaN -> -0
+dqmng154 minmag 0 -NaN -> 0
+dqmng155 minmag 1 NaN -> 1
+dqmng156 minmag 1000 NaN -> 1000
+dqmng157 minmag Inf NaN -> Infinity
+
+dqmng161 minmag sNaN -Inf -> NaN Invalid_operation
+dqmng162 minmag sNaN -1000 -> NaN Invalid_operation
+dqmng163 minmag sNaN -1 -> NaN Invalid_operation
+dqmng164 minmag sNaN -0 -> NaN Invalid_operation
+dqmng165 minmag -sNaN 0 -> -NaN Invalid_operation
+dqmng166 minmag -sNaN 1 -> -NaN Invalid_operation
+dqmng167 minmag sNaN 1000 -> NaN Invalid_operation
+dqmng168 minmag sNaN NaN -> NaN Invalid_operation
+dqmng169 minmag sNaN sNaN -> NaN Invalid_operation
+dqmng170 minmag NaN sNaN -> NaN Invalid_operation
+dqmng171 minmag -Inf sNaN -> NaN Invalid_operation
+dqmng172 minmag -1000 sNaN -> NaN Invalid_operation
+dqmng173 minmag -1 sNaN -> NaN Invalid_operation
+dqmng174 minmag -0 sNaN -> NaN Invalid_operation
+dqmng175 minmag 0 sNaN -> NaN Invalid_operation
+dqmng176 minmag 1 sNaN -> NaN Invalid_operation
+dqmng177 minmag 1000 sNaN -> NaN Invalid_operation
+dqmng178 minmag Inf sNaN -> NaN Invalid_operation
+dqmng179 minmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmng181 minmag NaN9 -Inf -> -Infinity
+dqmng182 minmag -NaN8 9990 -> 9990
+dqmng183 minmag NaN71 Inf -> Infinity
+
+dqmng184 minmag NaN1 NaN54 -> NaN1
+dqmng185 minmag NaN22 -NaN53 -> NaN22
+dqmng186 minmag -NaN3 NaN6 -> -NaN3
+dqmng187 minmag -NaN44 NaN7 -> -NaN44
+
+dqmng188 minmag -Inf NaN41 -> -Infinity
+dqmng189 minmag -9999 -NaN33 -> -9999
+dqmng190 minmag Inf NaN2 -> Infinity
+
+dqmng191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
+dqmng192 minmag sNaN98 -11 -> NaN98 Invalid_operation
+dqmng193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
+dqmng194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
+dqmng195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmng196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
+dqmng197 minmag 088 sNaN91 -> NaN91 Invalid_operation
+dqmng198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmng199 minmag NaN sNaN86 -> NaN86 Invalid_operation
+
+-- old rounding checks
+dqmng221 minmag -12345678000 1 -> 1
+dqmng222 minmag 1 -12345678000 -> 1
+dqmng223 minmag -1234567800 1 -> 1
+dqmng224 minmag 1 -1234567800 -> 1
+dqmng225 minmag -1234567890 1 -> 1
+dqmng226 minmag 1 -1234567890 -> 1
+dqmng227 minmag -1234567891 1 -> 1
+dqmng228 minmag 1 -1234567891 -> 1
+dqmng229 minmag -12345678901 1 -> 1
+dqmng230 minmag 1 -12345678901 -> 1
+dqmng231 minmag -1234567896 1 -> 1
+dqmng232 minmag 1 -1234567896 -> 1
+dqmng233 minmag 1234567891 1 -> 1
+dqmng234 minmag 1 1234567891 -> 1
+dqmng235 minmag 12345678901 1 -> 1
+dqmng236 minmag 1 12345678901 -> 1
+dqmng237 minmag 1234567896 1 -> 1
+dqmng238 minmag 1 1234567896 -> 1
+
+-- from examples
+dqmng280 minmag '3' '2' -> '2'
+dqmng281 minmag '-10' '3' -> '3'
+dqmng282 minmag '1.0' '1' -> '1.0'
+dqmng283 minmag '1' '1.0' -> '1.0'
+dqmng284 minmag '7' 'NaN' -> '7'
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+dqmng401 minmag Inf 1.1 -> 1.1
+dqmng402 minmag 1.1 1 -> 1
+dqmng403 minmag 1 1.0 -> 1.0
+dqmng404 minmag 1.0 0.1 -> 0.1
+dqmng405 minmag 0.1 0.10 -> 0.10
+dqmng406 minmag 0.10 0.100 -> 0.100
+dqmng407 minmag 0.10 0 -> 0
+dqmng408 minmag 0 0.0 -> 0.0
+dqmng409 minmag 0.0 -0 -> -0
+dqmng410 minmag 0.0 -0.0 -> -0.0
+dqmng411 minmag 0.00 -0.0 -> -0.0
+dqmng412 minmag 0.0 -0.00 -> -0.00
+dqmng413 minmag 0 -0.0 -> -0.0
+dqmng414 minmag 0 -0 -> -0
+dqmng415 minmag -0.0 -0 -> -0
+dqmng416 minmag -0 -0.100 -> -0
+dqmng417 minmag -0.100 -0.10 -> -0.10
+dqmng418 minmag -0.10 -0.1 -> -0.1
+dqmng419 minmag -0.1 -1.0 -> -0.1
+dqmng420 minmag -1.0 -1 -> -1
+dqmng421 minmag -1 -1.1 -> -1
+dqmng423 minmag -1.1 -Inf -> -1.1
+-- same with operands reversed
+dqmng431 minmag 1.1 Inf -> 1.1
+dqmng432 minmag 1 1.1 -> 1
+dqmng433 minmag 1.0 1 -> 1.0
+dqmng434 minmag 0.1 1.0 -> 0.1
+dqmng435 minmag 0.10 0.1 -> 0.10
+dqmng436 minmag 0.100 0.10 -> 0.100
+dqmng437 minmag 0 0.10 -> 0
+dqmng438 minmag 0.0 0 -> 0.0
+dqmng439 minmag -0 0.0 -> -0
+dqmng440 minmag -0.0 0.0 -> -0.0
+dqmng441 minmag -0.0 0.00 -> -0.0
+dqmng442 minmag -0.00 0.0 -> -0.00
+dqmng443 minmag -0.0 0 -> -0.0
+dqmng444 minmag -0 0 -> -0
+dqmng445 minmag -0 -0.0 -> -0
+dqmng446 minmag -0.100 -0 -> -0
+dqmng447 minmag -0.10 -0.100 -> -0.10
+dqmng448 minmag -0.1 -0.10 -> -0.1
+dqmng449 minmag -1.0 -0.1 -> -0.1
+dqmng450 minmag -1 -1.0 -> -1
+dqmng451 minmag -1.1 -1 -> -1
+dqmng453 minmag -Inf -1.1 -> -1.1
+-- largies
+dqmng460 minmag 1000 1E+3 -> 1000
+dqmng461 minmag 1E+3 1000 -> 1000
+dqmng462 minmag 1000 -1E+3 -> -1E+3
+dqmng463 minmag 1E+3 -384 -> -384
+dqmng464 minmag -384 1E+3 -> -384
+dqmng465 minmag -1E+3 1000 -> -1E+3
+dqmng466 minmag -384 -1E+3 -> -384
+dqmng467 minmag -1E+3 -384 -> -384
+
+-- subnormals
+dqmng510 minmag 1.00E-6143 0 -> 0
+dqmng511 minmag 0.1E-6143 0 -> 0
+dqmng512 minmag 0.10E-6143 0 -> 0
+dqmng513 minmag 0.100E-6143 0 -> 0
+dqmng514 minmag 0.01E-6143 0 -> 0
+dqmng515 minmag 0.999E-6143 0 -> 0
+dqmng516 minmag 0.099E-6143 0 -> 0
+dqmng517 minmag 0.009E-6143 0 -> 0
+dqmng518 minmag 0.001E-6143 0 -> 0
+dqmng519 minmag 0.0009E-6143 0 -> 0
+dqmng520 minmag 0.0001E-6143 0 -> 0
+
+dqmng530 minmag -1.00E-6143 0 -> 0
+dqmng531 minmag -0.1E-6143 0 -> 0
+dqmng532 minmag -0.10E-6143 0 -> 0
+dqmng533 minmag -0.100E-6143 0 -> 0
+dqmng534 minmag -0.01E-6143 0 -> 0
+dqmng535 minmag -0.999E-6143 0 -> 0
+dqmng536 minmag -0.099E-6143 0 -> 0
+dqmng537 minmag -0.009E-6143 0 -> 0
+dqmng538 minmag -0.001E-6143 0 -> 0
+dqmng539 minmag -0.0009E-6143 0 -> 0
+dqmng540 minmag -0.0001E-6143 0 -> 0
+
+
+-- Null tests
+dqmng900 minmag 10 # -> NaN Invalid_operation
+dqmng901 minmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqMinus.decTest b/Lib/test/decimaltestdata/dqMinus.decTest
index 7a007791bf..02e462e0be 100644
--- a/Lib/test/decimaltestdata/dqMinus.decTest
+++ b/Lib/test/decimaltestdata/dqMinus.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqMinus.decTest -- decQuad 0-x --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqmns001 minus +7.50 -> -7.50
-
--- Infinities
-dqmns011 minus Infinity -> -Infinity
-dqmns012 minus -Infinity -> Infinity
-
--- NaNs, 0 payload
-dqmns021 minus NaN -> NaN
-dqmns022 minus -NaN -> -NaN
-dqmns023 minus sNaN -> NaN Invalid_operation
-dqmns024 minus -sNaN -> -NaN Invalid_operation
-
--- NaNs, non-0 payload
-dqmns031 minus NaN13 -> NaN13
-dqmns032 minus -NaN13 -> -NaN13
-dqmns033 minus sNaN13 -> NaN13 Invalid_operation
-dqmns034 minus -sNaN13 -> -NaN13 Invalid_operation
-dqmns035 minus NaN70 -> NaN70
-dqmns036 minus -NaN70 -> -NaN70
-dqmns037 minus sNaN101 -> NaN101 Invalid_operation
-dqmns038 minus -sNaN101 -> -NaN101 Invalid_operation
-
--- finites
-dqmns101 minus 7 -> -7
-dqmns102 minus -7 -> 7
-dqmns103 minus 75 -> -75
-dqmns104 minus -75 -> 75
-dqmns105 minus 7.50 -> -7.50
-dqmns106 minus -7.50 -> 7.50
-dqmns107 minus 7.500 -> -7.500
-dqmns108 minus -7.500 -> 7.500
-
--- zeros
-dqmns111 minus 0 -> 0
-dqmns112 minus -0 -> 0
-dqmns113 minus 0E+4 -> 0E+4
-dqmns114 minus -0E+4 -> 0E+4
-dqmns115 minus 0.0000 -> 0.0000
-dqmns116 minus -0.0000 -> 0.0000
-dqmns117 minus 0E-141 -> 0E-141
-dqmns118 minus -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqmns121 minus 2682682682682682682682682682682682 -> -2682682682682682682682682682682682
-dqmns122 minus -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqmns123 minus 1341341341341341341341341341341341 -> -1341341341341341341341341341341341
-dqmns124 minus -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqmns131 minus 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqmns132 minus 1E-6143 -> -1E-6143
-dqmns133 minus 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqmns134 minus 1E-6176 -> -1E-6176 Subnormal
-
-dqmns135 minus -1E-6176 -> 1E-6176 Subnormal
-dqmns136 minus -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqmns137 minus -1E-6143 -> 1E-6143
-dqmns138 minus -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqMinus.decTest -- decQuad 0-x --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqmns001 minus +7.50 -> -7.50
+
+-- Infinities
+dqmns011 minus Infinity -> -Infinity
+dqmns012 minus -Infinity -> Infinity
+
+-- NaNs, 0 payload
+dqmns021 minus NaN -> NaN
+dqmns022 minus -NaN -> -NaN
+dqmns023 minus sNaN -> NaN Invalid_operation
+dqmns024 minus -sNaN -> -NaN Invalid_operation
+
+-- NaNs, non-0 payload
+dqmns031 minus NaN13 -> NaN13
+dqmns032 minus -NaN13 -> -NaN13
+dqmns033 minus sNaN13 -> NaN13 Invalid_operation
+dqmns034 minus -sNaN13 -> -NaN13 Invalid_operation
+dqmns035 minus NaN70 -> NaN70
+dqmns036 minus -NaN70 -> -NaN70
+dqmns037 minus sNaN101 -> NaN101 Invalid_operation
+dqmns038 minus -sNaN101 -> -NaN101 Invalid_operation
+
+-- finites
+dqmns101 minus 7 -> -7
+dqmns102 minus -7 -> 7
+dqmns103 minus 75 -> -75
+dqmns104 minus -75 -> 75
+dqmns105 minus 7.50 -> -7.50
+dqmns106 minus -7.50 -> 7.50
+dqmns107 minus 7.500 -> -7.500
+dqmns108 minus -7.500 -> 7.500
+
+-- zeros
+dqmns111 minus 0 -> 0
+dqmns112 minus -0 -> 0
+dqmns113 minus 0E+4 -> 0E+4
+dqmns114 minus -0E+4 -> 0E+4
+dqmns115 minus 0.0000 -> 0.0000
+dqmns116 minus -0.0000 -> 0.0000
+dqmns117 minus 0E-141 -> 0E-141
+dqmns118 minus -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqmns121 minus 2682682682682682682682682682682682 -> -2682682682682682682682682682682682
+dqmns122 minus -2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqmns123 minus 1341341341341341341341341341341341 -> -1341341341341341341341341341341341
+dqmns124 minus -1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqmns131 minus 9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqmns132 minus 1E-6143 -> -1E-6143
+dqmns133 minus 1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqmns134 minus 1E-6176 -> -1E-6176 Subnormal
+
+dqmns135 minus -1E-6176 -> 1E-6176 Subnormal
+dqmns136 minus -1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqmns137 minus -1E-6143 -> 1E-6143
+dqmns138 minus -9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqMultiply.decTest b/Lib/test/decimaltestdata/dqMultiply.decTest
index 676c1f5ea4..8387a858d3 100644
--- a/Lib/test/decimaltestdata/dqMultiply.decTest
+++ b/Lib/test/decimaltestdata/dqMultiply.decTest
@@ -1,589 +1,589 @@
-------------------------------------------------------------------------
--- dqMultiply.decTest -- decQuad multiplication --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decQuads only; all arguments are
--- representable in a decQuad
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqmul000 multiply 2 2 -> 4
-dqmul001 multiply 2 3 -> 6
-dqmul002 multiply 5 1 -> 5
-dqmul003 multiply 5 2 -> 10
-dqmul004 multiply 1.20 2 -> 2.40
-dqmul005 multiply 1.20 0 -> 0.00
-dqmul006 multiply 1.20 -2 -> -2.40
-dqmul007 multiply -1.20 2 -> -2.40
-dqmul008 multiply -1.20 0 -> -0.00
-dqmul009 multiply -1.20 -2 -> 2.40
-dqmul010 multiply 5.09 7.1 -> 36.139
-dqmul011 multiply 2.5 4 -> 10.0
-dqmul012 multiply 2.50 4 -> 10.00
-dqmul013 multiply 1.23456789 1.0000000000000000000000000000 -> 1.234567890000000000000000000000000 Rounded
-dqmul015 multiply 2.50 4 -> 10.00
-dqmul016 multiply 9.99999999999999999 9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
-dqmul017 multiply 9.99999999999999999 -9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
-dqmul018 multiply -9.99999999999999999 9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
-dqmul019 multiply -9.99999999999999999 -9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
-
--- zeros, etc.
-dqmul021 multiply 0 0 -> 0
-dqmul022 multiply 0 -0 -> -0
-dqmul023 multiply -0 0 -> -0
-dqmul024 multiply -0 -0 -> 0
-dqmul025 multiply -0.0 -0.0 -> 0.00
-dqmul026 multiply -0.0 -0.0 -> 0.00
-dqmul027 multiply -0.0 -0.0 -> 0.00
-dqmul028 multiply -0.0 -0.0 -> 0.00
-dqmul030 multiply 5.00 1E-3 -> 0.00500
-dqmul031 multiply 00.00 0.000 -> 0.00000
-dqmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
-dqmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
-dqmul034 multiply -5.00 1E-3 -> -0.00500
-dqmul035 multiply -00.00 0.000 -> -0.00000
-dqmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
-dqmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
-dqmul038 multiply 5.00 -1E-3 -> -0.00500
-dqmul039 multiply 00.00 -0.000 -> -0.00000
-dqmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
-dqmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
-dqmul042 multiply -5.00 -1E-3 -> 0.00500
-dqmul043 multiply -00.00 -0.000 -> 0.00000
-dqmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
-dqmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
-
--- examples from decarith
-dqmul050 multiply 1.20 3 -> 3.60
-dqmul051 multiply 7 3 -> 21
-dqmul052 multiply 0.9 0.8 -> 0.72
-dqmul053 multiply 0.9 -0 -> -0.0
-dqmul054 multiply 654321 654321 -> 428135971041
-
-dqmul060 multiply 123.45 1e7 -> 1.2345E+9
-dqmul061 multiply 123.45 1e8 -> 1.2345E+10
-dqmul062 multiply 123.45 1e+9 -> 1.2345E+11
-dqmul063 multiply 123.45 1e10 -> 1.2345E+12
-dqmul064 multiply 123.45 1e11 -> 1.2345E+13
-dqmul065 multiply 123.45 1e12 -> 1.2345E+14
-dqmul066 multiply 123.45 1e13 -> 1.2345E+15
-
-
--- test some intermediate lengths
--- 1234567890123456
-dqmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
-dqmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
-dqmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
-dqmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
-
--- test some more edge cases and carries
-dqmul101 multiply 9 9 -> 81
-dqmul102 multiply 9 90 -> 810
-dqmul103 multiply 9 900 -> 8100
-dqmul104 multiply 9 9000 -> 81000
-dqmul105 multiply 9 90000 -> 810000
-dqmul106 multiply 9 900000 -> 8100000
-dqmul107 multiply 9 9000000 -> 81000000
-dqmul108 multiply 9 90000000 -> 810000000
-dqmul109 multiply 9 900000000 -> 8100000000
-dqmul110 multiply 9 9000000000 -> 81000000000
-dqmul111 multiply 9 90000000000 -> 810000000000
-dqmul112 multiply 9 900000000000 -> 8100000000000
-dqmul113 multiply 9 9000000000000 -> 81000000000000
-dqmul114 multiply 9 90000000000000 -> 810000000000000
-dqmul115 multiply 9 900000000000000 -> 8100000000000000
---dqmul116 multiply 9 9000000000000000 -> 81000000000000000
---dqmul117 multiply 9 90000000000000000 -> 810000000000000000
---dqmul118 multiply 9 900000000000000000 -> 8100000000000000000
---dqmul119 multiply 9 9000000000000000000 -> 81000000000000000000
---dqmul120 multiply 9 90000000000000000000 -> 810000000000000000000
---dqmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
---dqmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
---dqmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
--- test some more edge cases without carries
-dqmul131 multiply 3 3 -> 9
-dqmul132 multiply 3 30 -> 90
-dqmul133 multiply 3 300 -> 900
-dqmul134 multiply 3 3000 -> 9000
-dqmul135 multiply 3 30000 -> 90000
-dqmul136 multiply 3 300000 -> 900000
-dqmul137 multiply 3 3000000 -> 9000000
-dqmul138 multiply 3 30000000 -> 90000000
-dqmul139 multiply 3 300000000 -> 900000000
-dqmul140 multiply 3 3000000000 -> 9000000000
-dqmul141 multiply 3 30000000000 -> 90000000000
-dqmul142 multiply 3 300000000000 -> 900000000000
-dqmul143 multiply 3 3000000000000 -> 9000000000000
-dqmul144 multiply 3 30000000000000 -> 90000000000000
-dqmul145 multiply 3 300000000000000 -> 900000000000000
-dqmul146 multiply 3 3000000000000000 -> 9000000000000000
-dqmul147 multiply 3 30000000000000000 -> 90000000000000000
-dqmul148 multiply 3 300000000000000000 -> 900000000000000000
-dqmul149 multiply 3 3000000000000000000 -> 9000000000000000000
-dqmul150 multiply 3 30000000000000000000 -> 90000000000000000000
-dqmul151 multiply 3 300000000000000000000 -> 900000000000000000000
-dqmul152 multiply 3 3000000000000000000000 -> 9000000000000000000000
-dqmul153 multiply 3 30000000000000000000000 -> 90000000000000000000000
-
-dqmul263 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165119928296 Inexact Rounded
-
--- test some edge cases with exact rounding
-dqmul301 multiply 900000000000000000 9 -> 8100000000000000000
-dqmul302 multiply 900000000000000000 90 -> 81000000000000000000
-dqmul303 multiply 900000000000000000 900 -> 810000000000000000000
-dqmul304 multiply 900000000000000000 9000 -> 8100000000000000000000
-dqmul305 multiply 900000000000000000 90000 -> 81000000000000000000000
-dqmul306 multiply 900000000000000000 900000 -> 810000000000000000000000
-dqmul307 multiply 900000000000000000 9000000 -> 8100000000000000000000000
-dqmul308 multiply 900000000000000000 90000000 -> 81000000000000000000000000
-dqmul309 multiply 900000000000000000 900000000 -> 810000000000000000000000000
-dqmul310 multiply 900000000000000000 9000000000 -> 8100000000000000000000000000
-dqmul311 multiply 900000000000000000 90000000000 -> 81000000000000000000000000000
-dqmul312 multiply 900000000000000000 900000000000 -> 810000000000000000000000000000
-dqmul313 multiply 900000000000000000 9000000000000 -> 8100000000000000000000000000000
-dqmul314 multiply 900000000000000000 90000000000000 -> 81000000000000000000000000000000
-dqmul315 multiply 900000000000000000 900000000000000 -> 810000000000000000000000000000000
-dqmul316 multiply 900000000000000000 9000000000000000 -> 8100000000000000000000000000000000
-dqmul317 multiply 9000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+34 Rounded
-dqmul318 multiply 90000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+35 Rounded
-dqmul319 multiply 900000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+36 Rounded
-dqmul320 multiply 9000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+37 Rounded
-dqmul321 multiply 90000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+38 Rounded
-dqmul322 multiply 900000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+39 Rounded
-dqmul323 multiply 9000000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+40 Rounded
-
--- tryzeros cases
-dqmul504 multiply 0E-4260 1000E-4260 -> 0E-6176 Clamped
-dqmul505 multiply 100E+4260 0E+4260 -> 0E+6111 Clamped
-
--- mixed with zeros
-dqmul541 multiply 0 -1 -> -0
-dqmul542 multiply -0 -1 -> 0
-dqmul543 multiply 0 1 -> 0
-dqmul544 multiply -0 1 -> -0
-dqmul545 multiply -1 0 -> -0
-dqmul546 multiply -1 -0 -> 0
-dqmul547 multiply 1 0 -> 0
-dqmul548 multiply 1 -0 -> -0
-
-dqmul551 multiply 0.0 -1 -> -0.0
-dqmul552 multiply -0.0 -1 -> 0.0
-dqmul553 multiply 0.0 1 -> 0.0
-dqmul554 multiply -0.0 1 -> -0.0
-dqmul555 multiply -1.0 0 -> -0.0
-dqmul556 multiply -1.0 -0 -> 0.0
-dqmul557 multiply 1.0 0 -> 0.0
-dqmul558 multiply 1.0 -0 -> -0.0
-
-dqmul561 multiply 0 -1.0 -> -0.0
-dqmul562 multiply -0 -1.0 -> 0.0
-dqmul563 multiply 0 1.0 -> 0.0
-dqmul564 multiply -0 1.0 -> -0.0
-dqmul565 multiply -1 0.0 -> -0.0
-dqmul566 multiply -1 -0.0 -> 0.0
-dqmul567 multiply 1 0.0 -> 0.0
-dqmul568 multiply 1 -0.0 -> -0.0
-
-dqmul571 multiply 0.0 -1.0 -> -0.00
-dqmul572 multiply -0.0 -1.0 -> 0.00
-dqmul573 multiply 0.0 1.0 -> 0.00
-dqmul574 multiply -0.0 1.0 -> -0.00
-dqmul575 multiply -1.0 0.0 -> -0.00
-dqmul576 multiply -1.0 -0.0 -> 0.00
-dqmul577 multiply 1.0 0.0 -> 0.00
-dqmul578 multiply 1.0 -0.0 -> -0.00
-
-
--- Specials
-dqmul580 multiply Inf -Inf -> -Infinity
-dqmul581 multiply Inf -1000 -> -Infinity
-dqmul582 multiply Inf -1 -> -Infinity
-dqmul583 multiply Inf -0 -> NaN Invalid_operation
-dqmul584 multiply Inf 0 -> NaN Invalid_operation
-dqmul585 multiply Inf 1 -> Infinity
-dqmul586 multiply Inf 1000 -> Infinity
-dqmul587 multiply Inf Inf -> Infinity
-dqmul588 multiply -1000 Inf -> -Infinity
-dqmul589 multiply -Inf Inf -> -Infinity
-dqmul590 multiply -1 Inf -> -Infinity
-dqmul591 multiply -0 Inf -> NaN Invalid_operation
-dqmul592 multiply 0 Inf -> NaN Invalid_operation
-dqmul593 multiply 1 Inf -> Infinity
-dqmul594 multiply 1000 Inf -> Infinity
-dqmul595 multiply Inf Inf -> Infinity
-
-dqmul600 multiply -Inf -Inf -> Infinity
-dqmul601 multiply -Inf -1000 -> Infinity
-dqmul602 multiply -Inf -1 -> Infinity
-dqmul603 multiply -Inf -0 -> NaN Invalid_operation
-dqmul604 multiply -Inf 0 -> NaN Invalid_operation
-dqmul605 multiply -Inf 1 -> -Infinity
-dqmul606 multiply -Inf 1000 -> -Infinity
-dqmul607 multiply -Inf Inf -> -Infinity
-dqmul608 multiply -1000 Inf -> -Infinity
-dqmul609 multiply -Inf -Inf -> Infinity
-dqmul610 multiply -1 -Inf -> Infinity
-dqmul611 multiply -0 -Inf -> NaN Invalid_operation
-dqmul612 multiply 0 -Inf -> NaN Invalid_operation
-dqmul613 multiply 1 -Inf -> -Infinity
-dqmul614 multiply 1000 -Inf -> -Infinity
-dqmul615 multiply Inf -Inf -> -Infinity
-
-dqmul621 multiply NaN -Inf -> NaN
-dqmul622 multiply NaN -1000 -> NaN
-dqmul623 multiply NaN -1 -> NaN
-dqmul624 multiply NaN -0 -> NaN
-dqmul625 multiply NaN 0 -> NaN
-dqmul626 multiply NaN 1 -> NaN
-dqmul627 multiply NaN 1000 -> NaN
-dqmul628 multiply NaN Inf -> NaN
-dqmul629 multiply NaN NaN -> NaN
-dqmul630 multiply -Inf NaN -> NaN
-dqmul631 multiply -1000 NaN -> NaN
-dqmul632 multiply -1 NaN -> NaN
-dqmul633 multiply -0 NaN -> NaN
-dqmul634 multiply 0 NaN -> NaN
-dqmul635 multiply 1 NaN -> NaN
-dqmul636 multiply 1000 NaN -> NaN
-dqmul637 multiply Inf NaN -> NaN
-
-dqmul641 multiply sNaN -Inf -> NaN Invalid_operation
-dqmul642 multiply sNaN -1000 -> NaN Invalid_operation
-dqmul643 multiply sNaN -1 -> NaN Invalid_operation
-dqmul644 multiply sNaN -0 -> NaN Invalid_operation
-dqmul645 multiply sNaN 0 -> NaN Invalid_operation
-dqmul646 multiply sNaN 1 -> NaN Invalid_operation
-dqmul647 multiply sNaN 1000 -> NaN Invalid_operation
-dqmul648 multiply sNaN NaN -> NaN Invalid_operation
-dqmul649 multiply sNaN sNaN -> NaN Invalid_operation
-dqmul650 multiply NaN sNaN -> NaN Invalid_operation
-dqmul651 multiply -Inf sNaN -> NaN Invalid_operation
-dqmul652 multiply -1000 sNaN -> NaN Invalid_operation
-dqmul653 multiply -1 sNaN -> NaN Invalid_operation
-dqmul654 multiply -0 sNaN -> NaN Invalid_operation
-dqmul655 multiply 0 sNaN -> NaN Invalid_operation
-dqmul656 multiply 1 sNaN -> NaN Invalid_operation
-dqmul657 multiply 1000 sNaN -> NaN Invalid_operation
-dqmul658 multiply Inf sNaN -> NaN Invalid_operation
-dqmul659 multiply NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqmul661 multiply NaN9 -Inf -> NaN9
-dqmul662 multiply NaN8 999 -> NaN8
-dqmul663 multiply NaN71 Inf -> NaN71
-dqmul664 multiply NaN6 NaN5 -> NaN6
-dqmul665 multiply -Inf NaN4 -> NaN4
-dqmul666 multiply -999 NaN33 -> NaN33
-dqmul667 multiply Inf NaN2 -> NaN2
-
-dqmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
-dqmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
-dqmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
-dqmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
-dqmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
-dqmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
-dqmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
-dqmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
-dqmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
-
-dqmul681 multiply -NaN9 -Inf -> -NaN9
-dqmul682 multiply -NaN8 999 -> -NaN8
-dqmul683 multiply -NaN71 Inf -> -NaN71
-dqmul684 multiply -NaN6 -NaN5 -> -NaN6
-dqmul685 multiply -Inf -NaN4 -> -NaN4
-dqmul686 multiply -999 -NaN33 -> -NaN33
-dqmul687 multiply Inf -NaN2 -> -NaN2
-
-dqmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
-dqmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
-dqmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
-dqmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-dqmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
-dqmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
-dqmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
-dqmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
-
-dqmul701 multiply -NaN -Inf -> -NaN
-dqmul702 multiply -NaN 999 -> -NaN
-dqmul703 multiply -NaN Inf -> -NaN
-dqmul704 multiply -NaN -NaN -> -NaN
-dqmul705 multiply -Inf -NaN0 -> -NaN
-dqmul706 multiply -999 -NaN -> -NaN
-dqmul707 multiply Inf -NaN -> -NaN
-
-dqmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
-dqmul712 multiply -sNaN -11 -> -NaN Invalid_operation
-dqmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
-dqmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
-dqmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
-dqmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
-dqmul717 multiply 088 -sNaN -> -NaN Invalid_operation
-dqmul718 multiply Inf -sNaN -> -NaN Invalid_operation
-dqmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
--- signs
-dqmul751 multiply 1e+4277 1e+3311 -> Infinity Overflow Inexact Rounded
-dqmul752 multiply 1e+4277 -1e+3311 -> -Infinity Overflow Inexact Rounded
-dqmul753 multiply -1e+4277 1e+3311 -> -Infinity Overflow Inexact Rounded
-dqmul754 multiply -1e+4277 -1e+3311 -> Infinity Overflow Inexact Rounded
-dqmul755 multiply 1e-4277 1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul756 multiply 1e-4277 -1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul757 multiply -1e-4277 1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul758 multiply -1e-4277 -1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-dqmul760 multiply 1e-6069 1e-101 -> 1E-6170 Subnormal
-dqmul761 multiply 1e-6069 1e-102 -> 1E-6171 Subnormal
-dqmul762 multiply 1e-6069 1e-103 -> 1E-6172 Subnormal
-dqmul763 multiply 1e-6069 1e-104 -> 1E-6173 Subnormal
-dqmul764 multiply 1e-6069 1e-105 -> 1E-6174 Subnormal
-dqmul765 multiply 1e-6069 1e-106 -> 1E-6175 Subnormal
-dqmul766 multiply 1e-6069 1e-107 -> 1E-6176 Subnormal
-dqmul767 multiply 1e-6069 1e-108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul768 multiply 1e-6069 1e-109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul769 multiply 1e-6069 1e-110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-dqmul770 multiply 1e+40 1e+6101 -> 1.000000000000000000000000000000E+6141 Clamped
-dqmul771 multiply 1e+40 1e+6102 -> 1.0000000000000000000000000000000E+6142 Clamped
-dqmul772 multiply 1e+40 1e+6103 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqmul773 multiply 1e+40 1e+6104 -> 1.000000000000000000000000000000000E+6144 Clamped
-dqmul774 multiply 1e+40 1e+6105 -> Infinity Overflow Inexact Rounded
-dqmul775 multiply 1e+40 1e+6106 -> Infinity Overflow Inexact Rounded
-dqmul776 multiply 1e+40 1e+6107 -> Infinity Overflow Inexact Rounded
-dqmul777 multiply 1e+40 1e+6108 -> Infinity Overflow Inexact Rounded
-dqmul778 multiply 1e+40 1e+6109 -> Infinity Overflow Inexact Rounded
-dqmul779 multiply 1e+40 1e+6110 -> Infinity Overflow Inexact Rounded
-
-dqmul801 multiply 1.0000E-6172 1 -> 1.0000E-6172 Subnormal
-dqmul802 multiply 1.000E-6172 1e-1 -> 1.000E-6173 Subnormal
-dqmul803 multiply 1.00E-6172 1e-2 -> 1.00E-6174 Subnormal
-dqmul804 multiply 1.0E-6172 1e-3 -> 1.0E-6175 Subnormal
-dqmul805 multiply 1.0E-6172 1e-4 -> 1E-6176 Subnormal Rounded
-dqmul806 multiply 1.3E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqmul807 multiply 1.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul808 multiply 1.7E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul809 multiply 2.3E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul810 multiply 2.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul811 multiply 2.7E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqmul812 multiply 1.49E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqmul813 multiply 1.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul814 multiply 1.51E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul815 multiply 2.49E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul816 multiply 2.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqmul817 multiply 2.51E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
-
-dqmul818 multiply 1E-6172 1e-4 -> 1E-6176 Subnormal
-dqmul819 multiply 3E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul820 multiply 5E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul821 multiply 7E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqmul822 multiply 9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqmul823 multiply 9.9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
-
-dqmul824 multiply 1E-6172 -1e-4 -> -1E-6176 Subnormal
-dqmul825 multiply 3E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul826 multiply -5E-6172 1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul827 multiply 7E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqmul828 multiply -9E-6172 1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqmul829 multiply 9.9E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqmul830 multiply 3.0E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqmul831 multiply 1.0E-5977 1e-200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqmul832 multiply 1.0E-5977 1e-199 -> 1E-6176 Subnormal Rounded
-dqmul833 multiply 1.0E-5977 1e-198 -> 1.0E-6175 Subnormal
-dqmul834 multiply 2.0E-5977 2e-198 -> 4.0E-6175 Subnormal
-dqmul835 multiply 4.0E-5977 4e-198 -> 1.60E-6174 Subnormal
-dqmul836 multiply 10.0E-5977 10e-198 -> 1.000E-6173 Subnormal
-dqmul837 multiply 30.0E-5977 30e-198 -> 9.000E-6173 Subnormal
-dqmul838 multiply 40.0E-5982 40e-166 -> 1.6000E-6145 Subnormal
-dqmul839 multiply 40.0E-5982 40e-165 -> 1.6000E-6144 Subnormal
-dqmul840 multiply 40.0E-5982 40e-164 -> 1.6000E-6143
-
--- Long operand overflow may be a different path
-dqmul870 multiply 100 9.999E+6143 -> Infinity Inexact Overflow Rounded
-dqmul871 multiply 100 -9.999E+6143 -> -Infinity Inexact Overflow Rounded
-dqmul872 multiply 9.999E+6143 100 -> Infinity Inexact Overflow Rounded
-dqmul873 multiply -9.999E+6143 100 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-dqmul881 multiply 1.2347E-6133 1.2347E-40 -> 1.524E-6173 Inexact Rounded Subnormal Underflow
-dqmul882 multiply 1.234E-6133 1.234E-40 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqmul883 multiply 1.23E-6133 1.23E-40 -> 1.513E-6173 Inexact Rounded Subnormal Underflow
-dqmul884 multiply 1.2E-6133 1.2E-40 -> 1.44E-6173 Subnormal
-dqmul885 multiply 1.2E-6133 1.2E-41 -> 1.44E-6174 Subnormal
-dqmul886 multiply 1.2E-6133 1.2E-42 -> 1.4E-6175 Subnormal Inexact Rounded Underflow
-dqmul887 multiply 1.2E-6133 1.3E-42 -> 1.6E-6175 Subnormal Inexact Rounded Underflow
-dqmul888 multiply 1.3E-6133 1.3E-42 -> 1.7E-6175 Subnormal Inexact Rounded Underflow
-dqmul889 multiply 1.3E-6133 1.3E-43 -> 2E-6176 Subnormal Inexact Rounded Underflow
-dqmul890 multiply 1.3E-6134 1.3E-43 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow
-
-dqmul891 multiply 1.2345E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
-dqmul892 multiply 1.23456E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
-dqmul893 multiply 1.2345E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqmul894 multiply 1.23456E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
-dqmul895 multiply 1.2345E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
-dqmul896 multiply 1.23456E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
--- prove operands are exact
-dqmul906 multiply 9.999999999999999999999999999999999E-6143 1 -> 9.999999999999999999999999999999999E-6143
-dqmul907 multiply 1 0.09999999999999999999999999999999999 -> 0.09999999999999999999999999999999999
--- the next rounds to Nmin
-dqmul908 multiply 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded
-
--- hugest
-dqmul909 multiply 9999999999999999999999999999999999 9999999999999999999999999999999999 -> 9.999999999999999999999999999999998E+67 Inexact Rounded
--- VG case
-dqmul910 multiply 8.81125000000001349436E-1548 8.000000000000000000E-1550 -> 7.049000000000010795488000000000000E-3097 Rounded
-
--- Examples from SQL proposal (Krishna Kulkarni)
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
-dqmul911 multiply 130E-2 120E-2 -> 1.5600
-dqmul912 multiply 130E-2 12E-1 -> 1.560
-dqmul913 multiply 130E-2 1E0 -> 1.30
-dqmul914 multiply 1E2 1E4 -> 1E+6
-
--- power-of-ten edge cases
-dqmul1001 multiply 1 10 -> 10
-dqmul1002 multiply 1 100 -> 100
-dqmul1003 multiply 1 1000 -> 1000
-dqmul1004 multiply 1 10000 -> 10000
-dqmul1005 multiply 1 100000 -> 100000
-dqmul1006 multiply 1 1000000 -> 1000000
-dqmul1007 multiply 1 10000000 -> 10000000
-dqmul1008 multiply 1 100000000 -> 100000000
-dqmul1009 multiply 1 1000000000 -> 1000000000
-dqmul1010 multiply 1 10000000000 -> 10000000000
-dqmul1011 multiply 1 100000000000 -> 100000000000
-dqmul1012 multiply 1 1000000000000 -> 1000000000000
-dqmul1013 multiply 1 10000000000000 -> 10000000000000
-dqmul1014 multiply 1 100000000000000 -> 100000000000000
-dqmul1015 multiply 1 1000000000000000 -> 1000000000000000
-
-dqmul1016 multiply 1 1000000000000000000 -> 1000000000000000000
-dqmul1017 multiply 1 100000000000000000000000000 -> 100000000000000000000000000
-dqmul1018 multiply 1 1000000000000000000000000000 -> 1000000000000000000000000000
-dqmul1019 multiply 1 10000000000000000000000000000 -> 10000000000000000000000000000
-dqmul1020 multiply 1 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1021 multiply 10 1 -> 10
-dqmul1022 multiply 10 10 -> 100
-dqmul1023 multiply 10 100 -> 1000
-dqmul1024 multiply 10 1000 -> 10000
-dqmul1025 multiply 10 10000 -> 100000
-dqmul1026 multiply 10 100000 -> 1000000
-dqmul1027 multiply 10 1000000 -> 10000000
-dqmul1028 multiply 10 10000000 -> 100000000
-dqmul1029 multiply 10 100000000 -> 1000000000
-dqmul1030 multiply 10 1000000000 -> 10000000000
-dqmul1031 multiply 10 10000000000 -> 100000000000
-dqmul1032 multiply 10 100000000000 -> 1000000000000
-dqmul1033 multiply 10 1000000000000 -> 10000000000000
-dqmul1034 multiply 10 10000000000000 -> 100000000000000
-dqmul1035 multiply 10 100000000000000 -> 1000000000000000
-
-dqmul1036 multiply 10 100000000000000000 -> 1000000000000000000
-dqmul1037 multiply 10 10000000000000000000000000 -> 100000000000000000000000000
-dqmul1038 multiply 10 100000000000000000000000000 -> 1000000000000000000000000000
-dqmul1039 multiply 10 1000000000000000000000000000 -> 10000000000000000000000000000
-dqmul1040 multiply 10 100000000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1041 multiply 100 0.1 -> 10.0
-dqmul1042 multiply 100 1 -> 100
-dqmul1043 multiply 100 10 -> 1000
-dqmul1044 multiply 100 100 -> 10000
-dqmul1045 multiply 100 1000 -> 100000
-dqmul1046 multiply 100 10000 -> 1000000
-dqmul1047 multiply 100 100000 -> 10000000
-dqmul1048 multiply 100 1000000 -> 100000000
-dqmul1049 multiply 100 10000000 -> 1000000000
-dqmul1050 multiply 100 100000000 -> 10000000000
-dqmul1051 multiply 100 1000000000 -> 100000000000
-dqmul1052 multiply 100 10000000000 -> 1000000000000
-dqmul1053 multiply 100 100000000000 -> 10000000000000
-dqmul1054 multiply 100 1000000000000 -> 100000000000000
-dqmul1055 multiply 100 10000000000000 -> 1000000000000000
-
-dqmul1056 multiply 100 10000000000000000 -> 1000000000000000000
-dqmul1057 multiply 100 1000000000000000000000000 -> 100000000000000000000000000
-dqmul1058 multiply 100 10000000000000000000000000 -> 1000000000000000000000000000
-dqmul1059 multiply 100 100000000000000000000000000 -> 10000000000000000000000000000
-dqmul1060 multiply 100 10000000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1061 multiply 1000 0.01 -> 10.00
-dqmul1062 multiply 1000 0.1 -> 100.0
-dqmul1063 multiply 1000 1 -> 1000
-dqmul1064 multiply 1000 10 -> 10000
-dqmul1065 multiply 1000 100 -> 100000
-dqmul1066 multiply 1000 1000 -> 1000000
-dqmul1067 multiply 1000 10000 -> 10000000
-dqmul1068 multiply 1000 100000 -> 100000000
-dqmul1069 multiply 1000 1000000 -> 1000000000
-dqmul1070 multiply 1000 10000000 -> 10000000000
-dqmul1071 multiply 1000 100000000 -> 100000000000
-dqmul1072 multiply 1000 1000000000 -> 1000000000000
-dqmul1073 multiply 1000 10000000000 -> 10000000000000
-dqmul1074 multiply 1000 100000000000 -> 100000000000000
-dqmul1075 multiply 1000 1000000000000 -> 1000000000000000
-
-dqmul1076 multiply 1000 1000000000000000 -> 1000000000000000000
-dqmul1077 multiply 1000 100000000000000000000000 -> 100000000000000000000000000
-dqmul1078 multiply 1000 1000000000000000000000000 -> 1000000000000000000000000000
-dqmul1079 multiply 1000 10000000000000000000000000 -> 10000000000000000000000000000
-dqmul1080 multiply 1000 1000000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1081 multiply 10000 0.001 -> 10.000
-dqmul1082 multiply 10000 0.01 -> 100.00
-dqmul1083 multiply 10000 0.1 -> 1000.0
-dqmul1084 multiply 10000 1 -> 10000
-dqmul1085 multiply 10000 10 -> 100000
-dqmul1086 multiply 10000 100 -> 1000000
-dqmul1087 multiply 10000 1000 -> 10000000
-dqmul1088 multiply 10000 10000 -> 100000000
-dqmul1089 multiply 10000 100000 -> 1000000000
-dqmul1090 multiply 10000 1000000 -> 10000000000
-dqmul1091 multiply 10000 10000000 -> 100000000000
-dqmul1092 multiply 10000 100000000 -> 1000000000000
-dqmul1093 multiply 10000 1000000000 -> 10000000000000
-dqmul1094 multiply 10000 10000000000 -> 100000000000000
-dqmul1095 multiply 10000 100000000000 -> 1000000000000000
-
-dqmul1096 multiply 10000 100000000000000 -> 1000000000000000000
-dqmul1097 multiply 10000 10000000000000000000000 -> 100000000000000000000000000
-dqmul1098 multiply 10000 100000000000000000000000 -> 1000000000000000000000000000
-dqmul1099 multiply 10000 1000000000000000000000000 -> 10000000000000000000000000000
-dqmul1100 multiply 10000 100000000000000000000000000000 -> 1000000000000000000000000000000000
-
-dqmul1107 multiply 10000 99999999999 -> 999999999990000
-dqmul1108 multiply 10000 99999999999 -> 999999999990000
-
--- Null tests
-dqmul9990 multiply 10 # -> NaN Invalid_operation
-dqmul9991 multiply # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqMultiply.decTest -- decQuad multiplication --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decQuads only; all arguments are
+-- representable in a decQuad
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqmul000 multiply 2 2 -> 4
+dqmul001 multiply 2 3 -> 6
+dqmul002 multiply 5 1 -> 5
+dqmul003 multiply 5 2 -> 10
+dqmul004 multiply 1.20 2 -> 2.40
+dqmul005 multiply 1.20 0 -> 0.00
+dqmul006 multiply 1.20 -2 -> -2.40
+dqmul007 multiply -1.20 2 -> -2.40
+dqmul008 multiply -1.20 0 -> -0.00
+dqmul009 multiply -1.20 -2 -> 2.40
+dqmul010 multiply 5.09 7.1 -> 36.139
+dqmul011 multiply 2.5 4 -> 10.0
+dqmul012 multiply 2.50 4 -> 10.00
+dqmul013 multiply 1.23456789 1.0000000000000000000000000000 -> 1.234567890000000000000000000000000 Rounded
+dqmul015 multiply 2.50 4 -> 10.00
+dqmul016 multiply 9.99999999999999999 9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
+dqmul017 multiply 9.99999999999999999 -9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
+dqmul018 multiply -9.99999999999999999 9.99999999999999999 -> -99.99999999999999980000000000000000 Inexact Rounded
+dqmul019 multiply -9.99999999999999999 -9.99999999999999999 -> 99.99999999999999980000000000000000 Inexact Rounded
+
+-- zeros, etc.
+dqmul021 multiply 0 0 -> 0
+dqmul022 multiply 0 -0 -> -0
+dqmul023 multiply -0 0 -> -0
+dqmul024 multiply -0 -0 -> 0
+dqmul025 multiply -0.0 -0.0 -> 0.00
+dqmul026 multiply -0.0 -0.0 -> 0.00
+dqmul027 multiply -0.0 -0.0 -> 0.00
+dqmul028 multiply -0.0 -0.0 -> 0.00
+dqmul030 multiply 5.00 1E-3 -> 0.00500
+dqmul031 multiply 00.00 0.000 -> 0.00000
+dqmul032 multiply 00.00 0E-3 -> 0.00000 -- rhs is 0
+dqmul033 multiply 0E-3 00.00 -> 0.00000 -- lhs is 0
+dqmul034 multiply -5.00 1E-3 -> -0.00500
+dqmul035 multiply -00.00 0.000 -> -0.00000
+dqmul036 multiply -00.00 0E-3 -> -0.00000 -- rhs is 0
+dqmul037 multiply -0E-3 00.00 -> -0.00000 -- lhs is 0
+dqmul038 multiply 5.00 -1E-3 -> -0.00500
+dqmul039 multiply 00.00 -0.000 -> -0.00000
+dqmul040 multiply 00.00 -0E-3 -> -0.00000 -- rhs is 0
+dqmul041 multiply 0E-3 -00.00 -> -0.00000 -- lhs is 0
+dqmul042 multiply -5.00 -1E-3 -> 0.00500
+dqmul043 multiply -00.00 -0.000 -> 0.00000
+dqmul044 multiply -00.00 -0E-3 -> 0.00000 -- rhs is 0
+dqmul045 multiply -0E-3 -00.00 -> 0.00000 -- lhs is 0
+
+-- examples from decarith
+dqmul050 multiply 1.20 3 -> 3.60
+dqmul051 multiply 7 3 -> 21
+dqmul052 multiply 0.9 0.8 -> 0.72
+dqmul053 multiply 0.9 -0 -> -0.0
+dqmul054 multiply 654321 654321 -> 428135971041
+
+dqmul060 multiply 123.45 1e7 -> 1.2345E+9
+dqmul061 multiply 123.45 1e8 -> 1.2345E+10
+dqmul062 multiply 123.45 1e+9 -> 1.2345E+11
+dqmul063 multiply 123.45 1e10 -> 1.2345E+12
+dqmul064 multiply 123.45 1e11 -> 1.2345E+13
+dqmul065 multiply 123.45 1e12 -> 1.2345E+14
+dqmul066 multiply 123.45 1e13 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+-- 1234567890123456
+dqmul080 multiply 0.1 1230123456456789 -> 123012345645678.9
+dqmul084 multiply 0.1 1230123456456789 -> 123012345645678.9
+dqmul090 multiply 1230123456456789 0.1 -> 123012345645678.9
+dqmul094 multiply 1230123456456789 0.1 -> 123012345645678.9
+
+-- test some more edge cases and carries
+dqmul101 multiply 9 9 -> 81
+dqmul102 multiply 9 90 -> 810
+dqmul103 multiply 9 900 -> 8100
+dqmul104 multiply 9 9000 -> 81000
+dqmul105 multiply 9 90000 -> 810000
+dqmul106 multiply 9 900000 -> 8100000
+dqmul107 multiply 9 9000000 -> 81000000
+dqmul108 multiply 9 90000000 -> 810000000
+dqmul109 multiply 9 900000000 -> 8100000000
+dqmul110 multiply 9 9000000000 -> 81000000000
+dqmul111 multiply 9 90000000000 -> 810000000000
+dqmul112 multiply 9 900000000000 -> 8100000000000
+dqmul113 multiply 9 9000000000000 -> 81000000000000
+dqmul114 multiply 9 90000000000000 -> 810000000000000
+dqmul115 multiply 9 900000000000000 -> 8100000000000000
+--dqmul116 multiply 9 9000000000000000 -> 81000000000000000
+--dqmul117 multiply 9 90000000000000000 -> 810000000000000000
+--dqmul118 multiply 9 900000000000000000 -> 8100000000000000000
+--dqmul119 multiply 9 9000000000000000000 -> 81000000000000000000
+--dqmul120 multiply 9 90000000000000000000 -> 810000000000000000000
+--dqmul121 multiply 9 900000000000000000000 -> 8100000000000000000000
+--dqmul122 multiply 9 9000000000000000000000 -> 81000000000000000000000
+--dqmul123 multiply 9 90000000000000000000000 -> 810000000000000000000000
+-- test some more edge cases without carries
+dqmul131 multiply 3 3 -> 9
+dqmul132 multiply 3 30 -> 90
+dqmul133 multiply 3 300 -> 900
+dqmul134 multiply 3 3000 -> 9000
+dqmul135 multiply 3 30000 -> 90000
+dqmul136 multiply 3 300000 -> 900000
+dqmul137 multiply 3 3000000 -> 9000000
+dqmul138 multiply 3 30000000 -> 90000000
+dqmul139 multiply 3 300000000 -> 900000000
+dqmul140 multiply 3 3000000000 -> 9000000000
+dqmul141 multiply 3 30000000000 -> 90000000000
+dqmul142 multiply 3 300000000000 -> 900000000000
+dqmul143 multiply 3 3000000000000 -> 9000000000000
+dqmul144 multiply 3 30000000000000 -> 90000000000000
+dqmul145 multiply 3 300000000000000 -> 900000000000000
+dqmul146 multiply 3 3000000000000000 -> 9000000000000000
+dqmul147 multiply 3 30000000000000000 -> 90000000000000000
+dqmul148 multiply 3 300000000000000000 -> 900000000000000000
+dqmul149 multiply 3 3000000000000000000 -> 9000000000000000000
+dqmul150 multiply 3 30000000000000000000 -> 90000000000000000000
+dqmul151 multiply 3 300000000000000000000 -> 900000000000000000000
+dqmul152 multiply 3 3000000000000000000000 -> 9000000000000000000000
+dqmul153 multiply 3 30000000000000000000000 -> 90000000000000000000000
+
+dqmul263 multiply 30269.587755640502150977251770554 4.8046009735990873395936309640543 -> 145433.2908011933696719165119928296 Inexact Rounded
+
+-- test some edge cases with exact rounding
+dqmul301 multiply 900000000000000000 9 -> 8100000000000000000
+dqmul302 multiply 900000000000000000 90 -> 81000000000000000000
+dqmul303 multiply 900000000000000000 900 -> 810000000000000000000
+dqmul304 multiply 900000000000000000 9000 -> 8100000000000000000000
+dqmul305 multiply 900000000000000000 90000 -> 81000000000000000000000
+dqmul306 multiply 900000000000000000 900000 -> 810000000000000000000000
+dqmul307 multiply 900000000000000000 9000000 -> 8100000000000000000000000
+dqmul308 multiply 900000000000000000 90000000 -> 81000000000000000000000000
+dqmul309 multiply 900000000000000000 900000000 -> 810000000000000000000000000
+dqmul310 multiply 900000000000000000 9000000000 -> 8100000000000000000000000000
+dqmul311 multiply 900000000000000000 90000000000 -> 81000000000000000000000000000
+dqmul312 multiply 900000000000000000 900000000000 -> 810000000000000000000000000000
+dqmul313 multiply 900000000000000000 9000000000000 -> 8100000000000000000000000000000
+dqmul314 multiply 900000000000000000 90000000000000 -> 81000000000000000000000000000000
+dqmul315 multiply 900000000000000000 900000000000000 -> 810000000000000000000000000000000
+dqmul316 multiply 900000000000000000 9000000000000000 -> 8100000000000000000000000000000000
+dqmul317 multiply 9000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+34 Rounded
+dqmul318 multiply 90000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+35 Rounded
+dqmul319 multiply 900000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+36 Rounded
+dqmul320 multiply 9000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+37 Rounded
+dqmul321 multiply 90000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+38 Rounded
+dqmul322 multiply 900000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+39 Rounded
+dqmul323 multiply 9000000000000000000000000 9000000000000000 -> 8.100000000000000000000000000000000E+40 Rounded
+
+-- tryzeros cases
+dqmul504 multiply 0E-4260 1000E-4260 -> 0E-6176 Clamped
+dqmul505 multiply 100E+4260 0E+4260 -> 0E+6111 Clamped
+
+-- mixed with zeros
+dqmul541 multiply 0 -1 -> -0
+dqmul542 multiply -0 -1 -> 0
+dqmul543 multiply 0 1 -> 0
+dqmul544 multiply -0 1 -> -0
+dqmul545 multiply -1 0 -> -0
+dqmul546 multiply -1 -0 -> 0
+dqmul547 multiply 1 0 -> 0
+dqmul548 multiply 1 -0 -> -0
+
+dqmul551 multiply 0.0 -1 -> -0.0
+dqmul552 multiply -0.0 -1 -> 0.0
+dqmul553 multiply 0.0 1 -> 0.0
+dqmul554 multiply -0.0 1 -> -0.0
+dqmul555 multiply -1.0 0 -> -0.0
+dqmul556 multiply -1.0 -0 -> 0.0
+dqmul557 multiply 1.0 0 -> 0.0
+dqmul558 multiply 1.0 -0 -> -0.0
+
+dqmul561 multiply 0 -1.0 -> -0.0
+dqmul562 multiply -0 -1.0 -> 0.0
+dqmul563 multiply 0 1.0 -> 0.0
+dqmul564 multiply -0 1.0 -> -0.0
+dqmul565 multiply -1 0.0 -> -0.0
+dqmul566 multiply -1 -0.0 -> 0.0
+dqmul567 multiply 1 0.0 -> 0.0
+dqmul568 multiply 1 -0.0 -> -0.0
+
+dqmul571 multiply 0.0 -1.0 -> -0.00
+dqmul572 multiply -0.0 -1.0 -> 0.00
+dqmul573 multiply 0.0 1.0 -> 0.00
+dqmul574 multiply -0.0 1.0 -> -0.00
+dqmul575 multiply -1.0 0.0 -> -0.00
+dqmul576 multiply -1.0 -0.0 -> 0.00
+dqmul577 multiply 1.0 0.0 -> 0.00
+dqmul578 multiply 1.0 -0.0 -> -0.00
+
+
+-- Specials
+dqmul580 multiply Inf -Inf -> -Infinity
+dqmul581 multiply Inf -1000 -> -Infinity
+dqmul582 multiply Inf -1 -> -Infinity
+dqmul583 multiply Inf -0 -> NaN Invalid_operation
+dqmul584 multiply Inf 0 -> NaN Invalid_operation
+dqmul585 multiply Inf 1 -> Infinity
+dqmul586 multiply Inf 1000 -> Infinity
+dqmul587 multiply Inf Inf -> Infinity
+dqmul588 multiply -1000 Inf -> -Infinity
+dqmul589 multiply -Inf Inf -> -Infinity
+dqmul590 multiply -1 Inf -> -Infinity
+dqmul591 multiply -0 Inf -> NaN Invalid_operation
+dqmul592 multiply 0 Inf -> NaN Invalid_operation
+dqmul593 multiply 1 Inf -> Infinity
+dqmul594 multiply 1000 Inf -> Infinity
+dqmul595 multiply Inf Inf -> Infinity
+
+dqmul600 multiply -Inf -Inf -> Infinity
+dqmul601 multiply -Inf -1000 -> Infinity
+dqmul602 multiply -Inf -1 -> Infinity
+dqmul603 multiply -Inf -0 -> NaN Invalid_operation
+dqmul604 multiply -Inf 0 -> NaN Invalid_operation
+dqmul605 multiply -Inf 1 -> -Infinity
+dqmul606 multiply -Inf 1000 -> -Infinity
+dqmul607 multiply -Inf Inf -> -Infinity
+dqmul608 multiply -1000 Inf -> -Infinity
+dqmul609 multiply -Inf -Inf -> Infinity
+dqmul610 multiply -1 -Inf -> Infinity
+dqmul611 multiply -0 -Inf -> NaN Invalid_operation
+dqmul612 multiply 0 -Inf -> NaN Invalid_operation
+dqmul613 multiply 1 -Inf -> -Infinity
+dqmul614 multiply 1000 -Inf -> -Infinity
+dqmul615 multiply Inf -Inf -> -Infinity
+
+dqmul621 multiply NaN -Inf -> NaN
+dqmul622 multiply NaN -1000 -> NaN
+dqmul623 multiply NaN -1 -> NaN
+dqmul624 multiply NaN -0 -> NaN
+dqmul625 multiply NaN 0 -> NaN
+dqmul626 multiply NaN 1 -> NaN
+dqmul627 multiply NaN 1000 -> NaN
+dqmul628 multiply NaN Inf -> NaN
+dqmul629 multiply NaN NaN -> NaN
+dqmul630 multiply -Inf NaN -> NaN
+dqmul631 multiply -1000 NaN -> NaN
+dqmul632 multiply -1 NaN -> NaN
+dqmul633 multiply -0 NaN -> NaN
+dqmul634 multiply 0 NaN -> NaN
+dqmul635 multiply 1 NaN -> NaN
+dqmul636 multiply 1000 NaN -> NaN
+dqmul637 multiply Inf NaN -> NaN
+
+dqmul641 multiply sNaN -Inf -> NaN Invalid_operation
+dqmul642 multiply sNaN -1000 -> NaN Invalid_operation
+dqmul643 multiply sNaN -1 -> NaN Invalid_operation
+dqmul644 multiply sNaN -0 -> NaN Invalid_operation
+dqmul645 multiply sNaN 0 -> NaN Invalid_operation
+dqmul646 multiply sNaN 1 -> NaN Invalid_operation
+dqmul647 multiply sNaN 1000 -> NaN Invalid_operation
+dqmul648 multiply sNaN NaN -> NaN Invalid_operation
+dqmul649 multiply sNaN sNaN -> NaN Invalid_operation
+dqmul650 multiply NaN sNaN -> NaN Invalid_operation
+dqmul651 multiply -Inf sNaN -> NaN Invalid_operation
+dqmul652 multiply -1000 sNaN -> NaN Invalid_operation
+dqmul653 multiply -1 sNaN -> NaN Invalid_operation
+dqmul654 multiply -0 sNaN -> NaN Invalid_operation
+dqmul655 multiply 0 sNaN -> NaN Invalid_operation
+dqmul656 multiply 1 sNaN -> NaN Invalid_operation
+dqmul657 multiply 1000 sNaN -> NaN Invalid_operation
+dqmul658 multiply Inf sNaN -> NaN Invalid_operation
+dqmul659 multiply NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqmul661 multiply NaN9 -Inf -> NaN9
+dqmul662 multiply NaN8 999 -> NaN8
+dqmul663 multiply NaN71 Inf -> NaN71
+dqmul664 multiply NaN6 NaN5 -> NaN6
+dqmul665 multiply -Inf NaN4 -> NaN4
+dqmul666 multiply -999 NaN33 -> NaN33
+dqmul667 multiply Inf NaN2 -> NaN2
+
+dqmul671 multiply sNaN99 -Inf -> NaN99 Invalid_operation
+dqmul672 multiply sNaN98 -11 -> NaN98 Invalid_operation
+dqmul673 multiply sNaN97 NaN -> NaN97 Invalid_operation
+dqmul674 multiply sNaN16 sNaN94 -> NaN16 Invalid_operation
+dqmul675 multiply NaN95 sNaN93 -> NaN93 Invalid_operation
+dqmul676 multiply -Inf sNaN92 -> NaN92 Invalid_operation
+dqmul677 multiply 088 sNaN91 -> NaN91 Invalid_operation
+dqmul678 multiply Inf sNaN90 -> NaN90 Invalid_operation
+dqmul679 multiply NaN sNaN89 -> NaN89 Invalid_operation
+
+dqmul681 multiply -NaN9 -Inf -> -NaN9
+dqmul682 multiply -NaN8 999 -> -NaN8
+dqmul683 multiply -NaN71 Inf -> -NaN71
+dqmul684 multiply -NaN6 -NaN5 -> -NaN6
+dqmul685 multiply -Inf -NaN4 -> -NaN4
+dqmul686 multiply -999 -NaN33 -> -NaN33
+dqmul687 multiply Inf -NaN2 -> -NaN2
+
+dqmul691 multiply -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqmul692 multiply -sNaN98 -11 -> -NaN98 Invalid_operation
+dqmul693 multiply -sNaN97 NaN -> -NaN97 Invalid_operation
+dqmul694 multiply -sNaN16 -sNaN94 -> -NaN16 Invalid_operation
+dqmul695 multiply -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+dqmul696 multiply -Inf -sNaN92 -> -NaN92 Invalid_operation
+dqmul697 multiply 088 -sNaN91 -> -NaN91 Invalid_operation
+dqmul698 multiply Inf -sNaN90 -> -NaN90 Invalid_operation
+dqmul699 multiply -NaN -sNaN89 -> -NaN89 Invalid_operation
+
+dqmul701 multiply -NaN -Inf -> -NaN
+dqmul702 multiply -NaN 999 -> -NaN
+dqmul703 multiply -NaN Inf -> -NaN
+dqmul704 multiply -NaN -NaN -> -NaN
+dqmul705 multiply -Inf -NaN0 -> -NaN
+dqmul706 multiply -999 -NaN -> -NaN
+dqmul707 multiply Inf -NaN -> -NaN
+
+dqmul711 multiply -sNaN -Inf -> -NaN Invalid_operation
+dqmul712 multiply -sNaN -11 -> -NaN Invalid_operation
+dqmul713 multiply -sNaN00 NaN -> -NaN Invalid_operation
+dqmul714 multiply -sNaN -sNaN -> -NaN Invalid_operation
+dqmul715 multiply -NaN -sNaN -> -NaN Invalid_operation
+dqmul716 multiply -Inf -sNaN -> -NaN Invalid_operation
+dqmul717 multiply 088 -sNaN -> -NaN Invalid_operation
+dqmul718 multiply Inf -sNaN -> -NaN Invalid_operation
+dqmul719 multiply -NaN -sNaN -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+-- signs
+dqmul751 multiply 1e+4277 1e+3311 -> Infinity Overflow Inexact Rounded
+dqmul752 multiply 1e+4277 -1e+3311 -> -Infinity Overflow Inexact Rounded
+dqmul753 multiply -1e+4277 1e+3311 -> -Infinity Overflow Inexact Rounded
+dqmul754 multiply -1e+4277 -1e+3311 -> Infinity Overflow Inexact Rounded
+dqmul755 multiply 1e-4277 1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul756 multiply 1e-4277 -1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul757 multiply -1e-4277 1e-3311 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul758 multiply -1e-4277 -1e-3311 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+dqmul760 multiply 1e-6069 1e-101 -> 1E-6170 Subnormal
+dqmul761 multiply 1e-6069 1e-102 -> 1E-6171 Subnormal
+dqmul762 multiply 1e-6069 1e-103 -> 1E-6172 Subnormal
+dqmul763 multiply 1e-6069 1e-104 -> 1E-6173 Subnormal
+dqmul764 multiply 1e-6069 1e-105 -> 1E-6174 Subnormal
+dqmul765 multiply 1e-6069 1e-106 -> 1E-6175 Subnormal
+dqmul766 multiply 1e-6069 1e-107 -> 1E-6176 Subnormal
+dqmul767 multiply 1e-6069 1e-108 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul768 multiply 1e-6069 1e-109 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul769 multiply 1e-6069 1e-110 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+dqmul770 multiply 1e+40 1e+6101 -> 1.000000000000000000000000000000E+6141 Clamped
+dqmul771 multiply 1e+40 1e+6102 -> 1.0000000000000000000000000000000E+6142 Clamped
+dqmul772 multiply 1e+40 1e+6103 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqmul773 multiply 1e+40 1e+6104 -> 1.000000000000000000000000000000000E+6144 Clamped
+dqmul774 multiply 1e+40 1e+6105 -> Infinity Overflow Inexact Rounded
+dqmul775 multiply 1e+40 1e+6106 -> Infinity Overflow Inexact Rounded
+dqmul776 multiply 1e+40 1e+6107 -> Infinity Overflow Inexact Rounded
+dqmul777 multiply 1e+40 1e+6108 -> Infinity Overflow Inexact Rounded
+dqmul778 multiply 1e+40 1e+6109 -> Infinity Overflow Inexact Rounded
+dqmul779 multiply 1e+40 1e+6110 -> Infinity Overflow Inexact Rounded
+
+dqmul801 multiply 1.0000E-6172 1 -> 1.0000E-6172 Subnormal
+dqmul802 multiply 1.000E-6172 1e-1 -> 1.000E-6173 Subnormal
+dqmul803 multiply 1.00E-6172 1e-2 -> 1.00E-6174 Subnormal
+dqmul804 multiply 1.0E-6172 1e-3 -> 1.0E-6175 Subnormal
+dqmul805 multiply 1.0E-6172 1e-4 -> 1E-6176 Subnormal Rounded
+dqmul806 multiply 1.3E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqmul807 multiply 1.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul808 multiply 1.7E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul809 multiply 2.3E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul810 multiply 2.5E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul811 multiply 2.7E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqmul812 multiply 1.49E-6172 1e-4 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqmul813 multiply 1.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul814 multiply 1.51E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul815 multiply 2.49E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul816 multiply 2.50E-6172 1e-4 -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqmul817 multiply 2.51E-6172 1e-4 -> 3E-6176 Underflow Subnormal Inexact Rounded
+
+dqmul818 multiply 1E-6172 1e-4 -> 1E-6176 Subnormal
+dqmul819 multiply 3E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul820 multiply 5E-6172 1e-5 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul821 multiply 7E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqmul822 multiply 9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqmul823 multiply 9.9E-6172 1e-5 -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+dqmul824 multiply 1E-6172 -1e-4 -> -1E-6176 Subnormal
+dqmul825 multiply 3E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul826 multiply -5E-6172 1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul827 multiply 7E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqmul828 multiply -9E-6172 1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqmul829 multiply 9.9E-6172 -1e-5 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqmul830 multiply 3.0E-6172 -1e-5 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqmul831 multiply 1.0E-5977 1e-200 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqmul832 multiply 1.0E-5977 1e-199 -> 1E-6176 Subnormal Rounded
+dqmul833 multiply 1.0E-5977 1e-198 -> 1.0E-6175 Subnormal
+dqmul834 multiply 2.0E-5977 2e-198 -> 4.0E-6175 Subnormal
+dqmul835 multiply 4.0E-5977 4e-198 -> 1.60E-6174 Subnormal
+dqmul836 multiply 10.0E-5977 10e-198 -> 1.000E-6173 Subnormal
+dqmul837 multiply 30.0E-5977 30e-198 -> 9.000E-6173 Subnormal
+dqmul838 multiply 40.0E-5982 40e-166 -> 1.6000E-6145 Subnormal
+dqmul839 multiply 40.0E-5982 40e-165 -> 1.6000E-6144 Subnormal
+dqmul840 multiply 40.0E-5982 40e-164 -> 1.6000E-6143
+
+-- Long operand overflow may be a different path
+dqmul870 multiply 100 9.999E+6143 -> Infinity Inexact Overflow Rounded
+dqmul871 multiply 100 -9.999E+6143 -> -Infinity Inexact Overflow Rounded
+dqmul872 multiply 9.999E+6143 100 -> Infinity Inexact Overflow Rounded
+dqmul873 multiply -9.999E+6143 100 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+dqmul881 multiply 1.2347E-6133 1.2347E-40 -> 1.524E-6173 Inexact Rounded Subnormal Underflow
+dqmul882 multiply 1.234E-6133 1.234E-40 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqmul883 multiply 1.23E-6133 1.23E-40 -> 1.513E-6173 Inexact Rounded Subnormal Underflow
+dqmul884 multiply 1.2E-6133 1.2E-40 -> 1.44E-6173 Subnormal
+dqmul885 multiply 1.2E-6133 1.2E-41 -> 1.44E-6174 Subnormal
+dqmul886 multiply 1.2E-6133 1.2E-42 -> 1.4E-6175 Subnormal Inexact Rounded Underflow
+dqmul887 multiply 1.2E-6133 1.3E-42 -> 1.6E-6175 Subnormal Inexact Rounded Underflow
+dqmul888 multiply 1.3E-6133 1.3E-42 -> 1.7E-6175 Subnormal Inexact Rounded Underflow
+dqmul889 multiply 1.3E-6133 1.3E-43 -> 2E-6176 Subnormal Inexact Rounded Underflow
+dqmul890 multiply 1.3E-6134 1.3E-43 -> 0E-6176 Clamped Subnormal Inexact Rounded Underflow
+
+dqmul891 multiply 1.2345E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
+dqmul892 multiply 1.23456E-39 1.234E-6133 -> 1.5234E-6172 Inexact Rounded Subnormal Underflow
+dqmul893 multiply 1.2345E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqmul894 multiply 1.23456E-40 1.234E-6133 -> 1.523E-6173 Inexact Rounded Subnormal Underflow
+dqmul895 multiply 1.2345E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
+dqmul896 multiply 1.23456E-41 1.234E-6133 -> 1.52E-6174 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+-- prove operands are exact
+dqmul906 multiply 9.999999999999999999999999999999999E-6143 1 -> 9.999999999999999999999999999999999E-6143
+dqmul907 multiply 1 0.09999999999999999999999999999999999 -> 0.09999999999999999999999999999999999
+-- the next rounds to Nmin
+dqmul908 multiply 9.999999999999999999999999999999999E-6143 0.09999999999999999999999999999999999 -> 1.000000000000000000000000000000000E-6143 Underflow Inexact Subnormal Rounded
+
+-- hugest
+dqmul909 multiply 9999999999999999999999999999999999 9999999999999999999999999999999999 -> 9.999999999999999999999999999999998E+67 Inexact Rounded
+-- VG case
+dqmul910 multiply 8.81125000000001349436E-1548 8.000000000000000000E-1550 -> 7.049000000000010795488000000000000E-3097 Rounded
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+dqmul911 multiply 130E-2 120E-2 -> 1.5600
+dqmul912 multiply 130E-2 12E-1 -> 1.560
+dqmul913 multiply 130E-2 1E0 -> 1.30
+dqmul914 multiply 1E2 1E4 -> 1E+6
+
+-- power-of-ten edge cases
+dqmul1001 multiply 1 10 -> 10
+dqmul1002 multiply 1 100 -> 100
+dqmul1003 multiply 1 1000 -> 1000
+dqmul1004 multiply 1 10000 -> 10000
+dqmul1005 multiply 1 100000 -> 100000
+dqmul1006 multiply 1 1000000 -> 1000000
+dqmul1007 multiply 1 10000000 -> 10000000
+dqmul1008 multiply 1 100000000 -> 100000000
+dqmul1009 multiply 1 1000000000 -> 1000000000
+dqmul1010 multiply 1 10000000000 -> 10000000000
+dqmul1011 multiply 1 100000000000 -> 100000000000
+dqmul1012 multiply 1 1000000000000 -> 1000000000000
+dqmul1013 multiply 1 10000000000000 -> 10000000000000
+dqmul1014 multiply 1 100000000000000 -> 100000000000000
+dqmul1015 multiply 1 1000000000000000 -> 1000000000000000
+
+dqmul1016 multiply 1 1000000000000000000 -> 1000000000000000000
+dqmul1017 multiply 1 100000000000000000000000000 -> 100000000000000000000000000
+dqmul1018 multiply 1 1000000000000000000000000000 -> 1000000000000000000000000000
+dqmul1019 multiply 1 10000000000000000000000000000 -> 10000000000000000000000000000
+dqmul1020 multiply 1 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1021 multiply 10 1 -> 10
+dqmul1022 multiply 10 10 -> 100
+dqmul1023 multiply 10 100 -> 1000
+dqmul1024 multiply 10 1000 -> 10000
+dqmul1025 multiply 10 10000 -> 100000
+dqmul1026 multiply 10 100000 -> 1000000
+dqmul1027 multiply 10 1000000 -> 10000000
+dqmul1028 multiply 10 10000000 -> 100000000
+dqmul1029 multiply 10 100000000 -> 1000000000
+dqmul1030 multiply 10 1000000000 -> 10000000000
+dqmul1031 multiply 10 10000000000 -> 100000000000
+dqmul1032 multiply 10 100000000000 -> 1000000000000
+dqmul1033 multiply 10 1000000000000 -> 10000000000000
+dqmul1034 multiply 10 10000000000000 -> 100000000000000
+dqmul1035 multiply 10 100000000000000 -> 1000000000000000
+
+dqmul1036 multiply 10 100000000000000000 -> 1000000000000000000
+dqmul1037 multiply 10 10000000000000000000000000 -> 100000000000000000000000000
+dqmul1038 multiply 10 100000000000000000000000000 -> 1000000000000000000000000000
+dqmul1039 multiply 10 1000000000000000000000000000 -> 10000000000000000000000000000
+dqmul1040 multiply 10 100000000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1041 multiply 100 0.1 -> 10.0
+dqmul1042 multiply 100 1 -> 100
+dqmul1043 multiply 100 10 -> 1000
+dqmul1044 multiply 100 100 -> 10000
+dqmul1045 multiply 100 1000 -> 100000
+dqmul1046 multiply 100 10000 -> 1000000
+dqmul1047 multiply 100 100000 -> 10000000
+dqmul1048 multiply 100 1000000 -> 100000000
+dqmul1049 multiply 100 10000000 -> 1000000000
+dqmul1050 multiply 100 100000000 -> 10000000000
+dqmul1051 multiply 100 1000000000 -> 100000000000
+dqmul1052 multiply 100 10000000000 -> 1000000000000
+dqmul1053 multiply 100 100000000000 -> 10000000000000
+dqmul1054 multiply 100 1000000000000 -> 100000000000000
+dqmul1055 multiply 100 10000000000000 -> 1000000000000000
+
+dqmul1056 multiply 100 10000000000000000 -> 1000000000000000000
+dqmul1057 multiply 100 1000000000000000000000000 -> 100000000000000000000000000
+dqmul1058 multiply 100 10000000000000000000000000 -> 1000000000000000000000000000
+dqmul1059 multiply 100 100000000000000000000000000 -> 10000000000000000000000000000
+dqmul1060 multiply 100 10000000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1061 multiply 1000 0.01 -> 10.00
+dqmul1062 multiply 1000 0.1 -> 100.0
+dqmul1063 multiply 1000 1 -> 1000
+dqmul1064 multiply 1000 10 -> 10000
+dqmul1065 multiply 1000 100 -> 100000
+dqmul1066 multiply 1000 1000 -> 1000000
+dqmul1067 multiply 1000 10000 -> 10000000
+dqmul1068 multiply 1000 100000 -> 100000000
+dqmul1069 multiply 1000 1000000 -> 1000000000
+dqmul1070 multiply 1000 10000000 -> 10000000000
+dqmul1071 multiply 1000 100000000 -> 100000000000
+dqmul1072 multiply 1000 1000000000 -> 1000000000000
+dqmul1073 multiply 1000 10000000000 -> 10000000000000
+dqmul1074 multiply 1000 100000000000 -> 100000000000000
+dqmul1075 multiply 1000 1000000000000 -> 1000000000000000
+
+dqmul1076 multiply 1000 1000000000000000 -> 1000000000000000000
+dqmul1077 multiply 1000 100000000000000000000000 -> 100000000000000000000000000
+dqmul1078 multiply 1000 1000000000000000000000000 -> 1000000000000000000000000000
+dqmul1079 multiply 1000 10000000000000000000000000 -> 10000000000000000000000000000
+dqmul1080 multiply 1000 1000000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1081 multiply 10000 0.001 -> 10.000
+dqmul1082 multiply 10000 0.01 -> 100.00
+dqmul1083 multiply 10000 0.1 -> 1000.0
+dqmul1084 multiply 10000 1 -> 10000
+dqmul1085 multiply 10000 10 -> 100000
+dqmul1086 multiply 10000 100 -> 1000000
+dqmul1087 multiply 10000 1000 -> 10000000
+dqmul1088 multiply 10000 10000 -> 100000000
+dqmul1089 multiply 10000 100000 -> 1000000000
+dqmul1090 multiply 10000 1000000 -> 10000000000
+dqmul1091 multiply 10000 10000000 -> 100000000000
+dqmul1092 multiply 10000 100000000 -> 1000000000000
+dqmul1093 multiply 10000 1000000000 -> 10000000000000
+dqmul1094 multiply 10000 10000000000 -> 100000000000000
+dqmul1095 multiply 10000 100000000000 -> 1000000000000000
+
+dqmul1096 multiply 10000 100000000000000 -> 1000000000000000000
+dqmul1097 multiply 10000 10000000000000000000000 -> 100000000000000000000000000
+dqmul1098 multiply 10000 100000000000000000000000 -> 1000000000000000000000000000
+dqmul1099 multiply 10000 1000000000000000000000000 -> 10000000000000000000000000000
+dqmul1100 multiply 10000 100000000000000000000000000000 -> 1000000000000000000000000000000000
+
+dqmul1107 multiply 10000 99999999999 -> 999999999990000
+dqmul1108 multiply 10000 99999999999 -> 999999999990000
+
+-- Null tests
+dqmul9990 multiply 10 # -> NaN Invalid_operation
+dqmul9991 multiply # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqNextMinus.decTest b/Lib/test/decimaltestdata/dqNextMinus.decTest
index 34f39581c3..8177b58c6d 100644
--- a/Lib/test/decimaltestdata/dqNextMinus.decTest
+++ b/Lib/test/decimaltestdata/dqNextMinus.decTest
@@ -1,126 +1,126 @@
-------------------------------------------------------------------------
--- dqNextMinus.decTest -- decQuad next that is less [754r nextdown] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqnextm001 nextminus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999994
-dqnextm002 nextminus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999995
-dqnextm003 nextminus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999996
-dqnextm004 nextminus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999997
-dqnextm005 nextminus 0.9999999999999999999999999999999999 -> 0.9999999999999999999999999999999998
-dqnextm006 nextminus 1.000000000000000000000000000000000 -> 0.9999999999999999999999999999999999
-dqnextm007 nextminus 1.0 -> 0.9999999999999999999999999999999999
-dqnextm008 nextminus 1 -> 0.9999999999999999999999999999999999
-dqnextm009 nextminus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000000
-dqnextm010 nextminus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000001
-dqnextm011 nextminus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000002
-dqnextm012 nextminus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000003
-dqnextm013 nextminus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000004
-dqnextm014 nextminus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000005
-dqnextm015 nextminus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000006
-dqnextm016 nextminus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000007
-dqnextm017 nextminus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000008
-dqnextm018 nextminus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000009
-dqnextm019 nextminus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000010
-dqnextm020 nextminus 1.000000000000000000000000000000012 -> 1.000000000000000000000000000000011
-
-dqnextm021 nextminus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999996
-dqnextm022 nextminus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999997
-dqnextm023 nextminus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999998
-dqnextm024 nextminus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999999
-dqnextm025 nextminus -0.9999999999999999999999999999999999 -> -1.000000000000000000000000000000000
-dqnextm026 nextminus -1.000000000000000000000000000000000 -> -1.000000000000000000000000000000001
-dqnextm027 nextminus -1.0 -> -1.000000000000000000000000000000001
-dqnextm028 nextminus -1 -> -1.000000000000000000000000000000001
-dqnextm029 nextminus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000002
-dqnextm030 nextminus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000003
-dqnextm031 nextminus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000004
-dqnextm032 nextminus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000005
-dqnextm033 nextminus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000006
-dqnextm034 nextminus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000007
-dqnextm035 nextminus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000008
-dqnextm036 nextminus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000009
-dqnextm037 nextminus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000010
-dqnextm038 nextminus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000011
-dqnextm039 nextminus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000012
-
--- ultra-tiny inputs
-dqnextm062 nextminus 1E-6176 -> 0E-6176
-dqnextm065 nextminus -1E-6176 -> -2E-6176
-
--- Zeros
-dqnextm100 nextminus -0 -> -1E-6176
-dqnextm101 nextminus 0 -> -1E-6176
-dqnextm102 nextminus 0.00 -> -1E-6176
-dqnextm103 nextminus -0.00 -> -1E-6176
-dqnextm104 nextminus 0E-300 -> -1E-6176
-dqnextm105 nextminus 0E+300 -> -1E-6176
-dqnextm106 nextminus 0E+30000 -> -1E-6176
-dqnextm107 nextminus -0E+30000 -> -1E-6176
-
--- specials
-dqnextm150 nextminus Inf -> 9.999999999999999999999999999999999E+6144
-dqnextm151 nextminus -Inf -> -Infinity
-dqnextm152 nextminus NaN -> NaN
-dqnextm153 nextminus sNaN -> NaN Invalid_operation
-dqnextm154 nextminus NaN77 -> NaN77
-dqnextm155 nextminus sNaN88 -> NaN88 Invalid_operation
-dqnextm156 nextminus -NaN -> -NaN
-dqnextm157 nextminus -sNaN -> -NaN Invalid_operation
-dqnextm158 nextminus -NaN77 -> -NaN77
-dqnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-dqnextm170 nextminus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999998E+6144
-dqnextm171 nextminus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999997E+6144
-dqnextm172 nextminus 1E-6143 -> 9.99999999999999999999999999999999E-6144
-dqnextm173 nextminus 1.000000000000000000000000000000000E-6143 -> 9.99999999999999999999999999999999E-6144
-dqnextm174 nextminus 9E-6176 -> 8E-6176
-dqnextm175 nextminus 9.9E-6175 -> 9.8E-6175
-dqnextm176 nextminus 9.99999999999999999999999999999E-6147 -> 9.99999999999999999999999999998E-6147
-dqnextm177 nextminus 9.99999999999999999999999999999999E-6144 -> 9.99999999999999999999999999999998E-6144
-dqnextm178 nextminus 9.99999999999999999999999999999998E-6144 -> 9.99999999999999999999999999999997E-6144
-dqnextm179 nextminus 9.99999999999999999999999999999997E-6144 -> 9.99999999999999999999999999999996E-6144
-dqnextm180 nextminus 0E-6176 -> -1E-6176
-dqnextm181 nextminus 1E-6176 -> 0E-6176
-dqnextm182 nextminus 2E-6176 -> 1E-6176
-
-dqnextm183 nextminus -0E-6176 -> -1E-6176
-dqnextm184 nextminus -1E-6176 -> -2E-6176
-dqnextm185 nextminus -2E-6176 -> -3E-6176
-dqnextm186 nextminus -10E-6176 -> -1.1E-6175
-dqnextm187 nextminus -100E-6176 -> -1.01E-6174
-dqnextm188 nextminus -100000E-6176 -> -1.00001E-6171
-dqnextm189 nextminus -1.00000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143
-dqnextm190 nextminus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143
-dqnextm191 nextminus -1E-6143 -> -1.000000000000000000000000000000001E-6143
-dqnextm192 nextminus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999999E+6144
-dqnextm193 nextminus -9.999999999999999999999999999999999E+6144 -> -Infinity
-
--- Null tests
-dqnextm900 nextminus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqNextMinus.decTest -- decQuad next that is less [754r nextdown] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqnextm001 nextminus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999994
+dqnextm002 nextminus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999995
+dqnextm003 nextminus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999996
+dqnextm004 nextminus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999997
+dqnextm005 nextminus 0.9999999999999999999999999999999999 -> 0.9999999999999999999999999999999998
+dqnextm006 nextminus 1.000000000000000000000000000000000 -> 0.9999999999999999999999999999999999
+dqnextm007 nextminus 1.0 -> 0.9999999999999999999999999999999999
+dqnextm008 nextminus 1 -> 0.9999999999999999999999999999999999
+dqnextm009 nextminus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000000
+dqnextm010 nextminus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000001
+dqnextm011 nextminus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000002
+dqnextm012 nextminus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000003
+dqnextm013 nextminus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000004
+dqnextm014 nextminus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000005
+dqnextm015 nextminus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000006
+dqnextm016 nextminus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000007
+dqnextm017 nextminus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000008
+dqnextm018 nextminus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000009
+dqnextm019 nextminus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000010
+dqnextm020 nextminus 1.000000000000000000000000000000012 -> 1.000000000000000000000000000000011
+
+dqnextm021 nextminus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999996
+dqnextm022 nextminus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999997
+dqnextm023 nextminus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999998
+dqnextm024 nextminus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999999
+dqnextm025 nextminus -0.9999999999999999999999999999999999 -> -1.000000000000000000000000000000000
+dqnextm026 nextminus -1.000000000000000000000000000000000 -> -1.000000000000000000000000000000001
+dqnextm027 nextminus -1.0 -> -1.000000000000000000000000000000001
+dqnextm028 nextminus -1 -> -1.000000000000000000000000000000001
+dqnextm029 nextminus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000002
+dqnextm030 nextminus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000003
+dqnextm031 nextminus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000004
+dqnextm032 nextminus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000005
+dqnextm033 nextminus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000006
+dqnextm034 nextminus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000007
+dqnextm035 nextminus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000008
+dqnextm036 nextminus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000009
+dqnextm037 nextminus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000010
+dqnextm038 nextminus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000011
+dqnextm039 nextminus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000012
+
+-- ultra-tiny inputs
+dqnextm062 nextminus 1E-6176 -> 0E-6176
+dqnextm065 nextminus -1E-6176 -> -2E-6176
+
+-- Zeros
+dqnextm100 nextminus -0 -> -1E-6176
+dqnextm101 nextminus 0 -> -1E-6176
+dqnextm102 nextminus 0.00 -> -1E-6176
+dqnextm103 nextminus -0.00 -> -1E-6176
+dqnextm104 nextminus 0E-300 -> -1E-6176
+dqnextm105 nextminus 0E+300 -> -1E-6176
+dqnextm106 nextminus 0E+30000 -> -1E-6176
+dqnextm107 nextminus -0E+30000 -> -1E-6176
+
+-- specials
+dqnextm150 nextminus Inf -> 9.999999999999999999999999999999999E+6144
+dqnextm151 nextminus -Inf -> -Infinity
+dqnextm152 nextminus NaN -> NaN
+dqnextm153 nextminus sNaN -> NaN Invalid_operation
+dqnextm154 nextminus NaN77 -> NaN77
+dqnextm155 nextminus sNaN88 -> NaN88 Invalid_operation
+dqnextm156 nextminus -NaN -> -NaN
+dqnextm157 nextminus -sNaN -> -NaN Invalid_operation
+dqnextm158 nextminus -NaN77 -> -NaN77
+dqnextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+dqnextm170 nextminus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999998E+6144
+dqnextm171 nextminus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999997E+6144
+dqnextm172 nextminus 1E-6143 -> 9.99999999999999999999999999999999E-6144
+dqnextm173 nextminus 1.000000000000000000000000000000000E-6143 -> 9.99999999999999999999999999999999E-6144
+dqnextm174 nextminus 9E-6176 -> 8E-6176
+dqnextm175 nextminus 9.9E-6175 -> 9.8E-6175
+dqnextm176 nextminus 9.99999999999999999999999999999E-6147 -> 9.99999999999999999999999999998E-6147
+dqnextm177 nextminus 9.99999999999999999999999999999999E-6144 -> 9.99999999999999999999999999999998E-6144
+dqnextm178 nextminus 9.99999999999999999999999999999998E-6144 -> 9.99999999999999999999999999999997E-6144
+dqnextm179 nextminus 9.99999999999999999999999999999997E-6144 -> 9.99999999999999999999999999999996E-6144
+dqnextm180 nextminus 0E-6176 -> -1E-6176
+dqnextm181 nextminus 1E-6176 -> 0E-6176
+dqnextm182 nextminus 2E-6176 -> 1E-6176
+
+dqnextm183 nextminus -0E-6176 -> -1E-6176
+dqnextm184 nextminus -1E-6176 -> -2E-6176
+dqnextm185 nextminus -2E-6176 -> -3E-6176
+dqnextm186 nextminus -10E-6176 -> -1.1E-6175
+dqnextm187 nextminus -100E-6176 -> -1.01E-6174
+dqnextm188 nextminus -100000E-6176 -> -1.00001E-6171
+dqnextm189 nextminus -1.00000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143
+dqnextm190 nextminus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000001E-6143
+dqnextm191 nextminus -1E-6143 -> -1.000000000000000000000000000000001E-6143
+dqnextm192 nextminus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999999E+6144
+dqnextm193 nextminus -9.999999999999999999999999999999999E+6144 -> -Infinity
+
+-- Null tests
+dqnextm900 nextminus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqNextPlus.decTest b/Lib/test/decimaltestdata/dqNextPlus.decTest
index ac3f04e69b..8c8e9cd2e7 100644
--- a/Lib/test/decimaltestdata/dqNextPlus.decTest
+++ b/Lib/test/decimaltestdata/dqNextPlus.decTest
@@ -1,124 +1,124 @@
-------------------------------------------------------------------------
--- dqNextPlus.decTest -- decQuad next that is greater [754r nextup] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqnextp001 nextplus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999996
-dqnextp002 nextplus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999997
-dqnextp003 nextplus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999998
-dqnextp004 nextplus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999999
-dqnextp005 nextplus 0.9999999999999999999999999999999999 -> 1.000000000000000000000000000000000
-dqnextp006 nextplus 1.000000000000000000000000000000000 -> 1.000000000000000000000000000000001
-dqnextp007 nextplus 1.0 -> 1.000000000000000000000000000000001
-dqnextp008 nextplus 1 -> 1.000000000000000000000000000000001
-dqnextp009 nextplus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000002
-dqnextp010 nextplus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000003
-dqnextp011 nextplus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000004
-dqnextp012 nextplus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000005
-dqnextp013 nextplus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000006
-dqnextp014 nextplus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000007
-dqnextp015 nextplus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000008
-dqnextp016 nextplus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000009
-dqnextp017 nextplus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000010
-dqnextp018 nextplus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000011
-dqnextp019 nextplus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000012
-
-dqnextp021 nextplus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999994
-dqnextp022 nextplus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999995
-dqnextp023 nextplus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999996
-dqnextp024 nextplus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999997
-dqnextp025 nextplus -0.9999999999999999999999999999999999 -> -0.9999999999999999999999999999999998
-dqnextp026 nextplus -1.000000000000000000000000000000000 -> -0.9999999999999999999999999999999999
-dqnextp027 nextplus -1.0 -> -0.9999999999999999999999999999999999
-dqnextp028 nextplus -1 -> -0.9999999999999999999999999999999999
-dqnextp029 nextplus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000000
-dqnextp030 nextplus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000001
-dqnextp031 nextplus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000002
-dqnextp032 nextplus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000003
-dqnextp033 nextplus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000004
-dqnextp034 nextplus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000005
-dqnextp035 nextplus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000006
-dqnextp036 nextplus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000007
-dqnextp037 nextplus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000008
-dqnextp038 nextplus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000009
-dqnextp039 nextplus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000010
-dqnextp040 nextplus -1.000000000000000000000000000000012 -> -1.000000000000000000000000000000011
-
--- Zeros
-dqnextp100 nextplus 0 -> 1E-6176
-dqnextp101 nextplus 0.00 -> 1E-6176
-dqnextp102 nextplus 0E-300 -> 1E-6176
-dqnextp103 nextplus 0E+300 -> 1E-6176
-dqnextp104 nextplus 0E+30000 -> 1E-6176
-dqnextp105 nextplus -0 -> 1E-6176
-dqnextp106 nextplus -0.00 -> 1E-6176
-dqnextp107 nextplus -0E-300 -> 1E-6176
-dqnextp108 nextplus -0E+300 -> 1E-6176
-dqnextp109 nextplus -0E+30000 -> 1E-6176
-
--- specials
-dqnextp150 nextplus Inf -> Infinity
-dqnextp151 nextplus -Inf -> -9.999999999999999999999999999999999E+6144
-dqnextp152 nextplus NaN -> NaN
-dqnextp153 nextplus sNaN -> NaN Invalid_operation
-dqnextp154 nextplus NaN77 -> NaN77
-dqnextp155 nextplus sNaN88 -> NaN88 Invalid_operation
-dqnextp156 nextplus -NaN -> -NaN
-dqnextp157 nextplus -sNaN -> -NaN Invalid_operation
-dqnextp158 nextplus -NaN77 -> -NaN77
-dqnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-dqnextp170 nextplus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999998E+6144
-dqnextp171 nextplus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999997E+6144
-dqnextp172 nextplus -1E-6143 -> -9.99999999999999999999999999999999E-6144
-dqnextp173 nextplus -1.000000000000000E-6143 -> -9.99999999999999999999999999999999E-6144
-dqnextp174 nextplus -9E-6176 -> -8E-6176
-dqnextp175 nextplus -9.9E-6175 -> -9.8E-6175
-dqnextp176 nextplus -9.99999999999999999999999999999E-6147 -> -9.99999999999999999999999999998E-6147
-dqnextp177 nextplus -9.99999999999999999999999999999999E-6144 -> -9.99999999999999999999999999999998E-6144
-dqnextp178 nextplus -9.99999999999999999999999999999998E-6144 -> -9.99999999999999999999999999999997E-6144
-dqnextp179 nextplus -9.99999999999999999999999999999997E-6144 -> -9.99999999999999999999999999999996E-6144
-dqnextp180 nextplus -0E-6176 -> 1E-6176
-dqnextp181 nextplus -1E-6176 -> -0E-6176
-dqnextp182 nextplus -2E-6176 -> -1E-6176
-
-dqnextp183 nextplus 0E-6176 -> 1E-6176
-dqnextp184 nextplus 1E-6176 -> 2E-6176
-dqnextp185 nextplus 2E-6176 -> 3E-6176
-dqnextp186 nextplus 10E-6176 -> 1.1E-6175
-dqnextp187 nextplus 100E-6176 -> 1.01E-6174
-dqnextp188 nextplus 100000E-6176 -> 1.00001E-6171
-dqnextp189 nextplus 1.00000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143
-dqnextp190 nextplus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143
-dqnextp191 nextplus 1E-6143 -> 1.000000000000000000000000000000001E-6143
-dqnextp192 nextplus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999999E+6144
-dqnextp193 nextplus 9.999999999999999999999999999999999E+6144 -> Infinity
-
--- Null tests
-dqnextp900 nextplus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqNextPlus.decTest -- decQuad next that is greater [754r nextup] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqnextp001 nextplus 0.9999999999999999999999999999999995 -> 0.9999999999999999999999999999999996
+dqnextp002 nextplus 0.9999999999999999999999999999999996 -> 0.9999999999999999999999999999999997
+dqnextp003 nextplus 0.9999999999999999999999999999999997 -> 0.9999999999999999999999999999999998
+dqnextp004 nextplus 0.9999999999999999999999999999999998 -> 0.9999999999999999999999999999999999
+dqnextp005 nextplus 0.9999999999999999999999999999999999 -> 1.000000000000000000000000000000000
+dqnextp006 nextplus 1.000000000000000000000000000000000 -> 1.000000000000000000000000000000001
+dqnextp007 nextplus 1.0 -> 1.000000000000000000000000000000001
+dqnextp008 nextplus 1 -> 1.000000000000000000000000000000001
+dqnextp009 nextplus 1.000000000000000000000000000000001 -> 1.000000000000000000000000000000002
+dqnextp010 nextplus 1.000000000000000000000000000000002 -> 1.000000000000000000000000000000003
+dqnextp011 nextplus 1.000000000000000000000000000000003 -> 1.000000000000000000000000000000004
+dqnextp012 nextplus 1.000000000000000000000000000000004 -> 1.000000000000000000000000000000005
+dqnextp013 nextplus 1.000000000000000000000000000000005 -> 1.000000000000000000000000000000006
+dqnextp014 nextplus 1.000000000000000000000000000000006 -> 1.000000000000000000000000000000007
+dqnextp015 nextplus 1.000000000000000000000000000000007 -> 1.000000000000000000000000000000008
+dqnextp016 nextplus 1.000000000000000000000000000000008 -> 1.000000000000000000000000000000009
+dqnextp017 nextplus 1.000000000000000000000000000000009 -> 1.000000000000000000000000000000010
+dqnextp018 nextplus 1.000000000000000000000000000000010 -> 1.000000000000000000000000000000011
+dqnextp019 nextplus 1.000000000000000000000000000000011 -> 1.000000000000000000000000000000012
+
+dqnextp021 nextplus -0.9999999999999999999999999999999995 -> -0.9999999999999999999999999999999994
+dqnextp022 nextplus -0.9999999999999999999999999999999996 -> -0.9999999999999999999999999999999995
+dqnextp023 nextplus -0.9999999999999999999999999999999997 -> -0.9999999999999999999999999999999996
+dqnextp024 nextplus -0.9999999999999999999999999999999998 -> -0.9999999999999999999999999999999997
+dqnextp025 nextplus -0.9999999999999999999999999999999999 -> -0.9999999999999999999999999999999998
+dqnextp026 nextplus -1.000000000000000000000000000000000 -> -0.9999999999999999999999999999999999
+dqnextp027 nextplus -1.0 -> -0.9999999999999999999999999999999999
+dqnextp028 nextplus -1 -> -0.9999999999999999999999999999999999
+dqnextp029 nextplus -1.000000000000000000000000000000001 -> -1.000000000000000000000000000000000
+dqnextp030 nextplus -1.000000000000000000000000000000002 -> -1.000000000000000000000000000000001
+dqnextp031 nextplus -1.000000000000000000000000000000003 -> -1.000000000000000000000000000000002
+dqnextp032 nextplus -1.000000000000000000000000000000004 -> -1.000000000000000000000000000000003
+dqnextp033 nextplus -1.000000000000000000000000000000005 -> -1.000000000000000000000000000000004
+dqnextp034 nextplus -1.000000000000000000000000000000006 -> -1.000000000000000000000000000000005
+dqnextp035 nextplus -1.000000000000000000000000000000007 -> -1.000000000000000000000000000000006
+dqnextp036 nextplus -1.000000000000000000000000000000008 -> -1.000000000000000000000000000000007
+dqnextp037 nextplus -1.000000000000000000000000000000009 -> -1.000000000000000000000000000000008
+dqnextp038 nextplus -1.000000000000000000000000000000010 -> -1.000000000000000000000000000000009
+dqnextp039 nextplus -1.000000000000000000000000000000011 -> -1.000000000000000000000000000000010
+dqnextp040 nextplus -1.000000000000000000000000000000012 -> -1.000000000000000000000000000000011
+
+-- Zeros
+dqnextp100 nextplus 0 -> 1E-6176
+dqnextp101 nextplus 0.00 -> 1E-6176
+dqnextp102 nextplus 0E-300 -> 1E-6176
+dqnextp103 nextplus 0E+300 -> 1E-6176
+dqnextp104 nextplus 0E+30000 -> 1E-6176
+dqnextp105 nextplus -0 -> 1E-6176
+dqnextp106 nextplus -0.00 -> 1E-6176
+dqnextp107 nextplus -0E-300 -> 1E-6176
+dqnextp108 nextplus -0E+300 -> 1E-6176
+dqnextp109 nextplus -0E+30000 -> 1E-6176
+
+-- specials
+dqnextp150 nextplus Inf -> Infinity
+dqnextp151 nextplus -Inf -> -9.999999999999999999999999999999999E+6144
+dqnextp152 nextplus NaN -> NaN
+dqnextp153 nextplus sNaN -> NaN Invalid_operation
+dqnextp154 nextplus NaN77 -> NaN77
+dqnextp155 nextplus sNaN88 -> NaN88 Invalid_operation
+dqnextp156 nextplus -NaN -> -NaN
+dqnextp157 nextplus -sNaN -> -NaN Invalid_operation
+dqnextp158 nextplus -NaN77 -> -NaN77
+dqnextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+dqnextp170 nextplus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999998E+6144
+dqnextp171 nextplus -9.999999999999999999999999999999998E+6144 -> -9.999999999999999999999999999999997E+6144
+dqnextp172 nextplus -1E-6143 -> -9.99999999999999999999999999999999E-6144
+dqnextp173 nextplus -1.000000000000000E-6143 -> -9.99999999999999999999999999999999E-6144
+dqnextp174 nextplus -9E-6176 -> -8E-6176
+dqnextp175 nextplus -9.9E-6175 -> -9.8E-6175
+dqnextp176 nextplus -9.99999999999999999999999999999E-6147 -> -9.99999999999999999999999999998E-6147
+dqnextp177 nextplus -9.99999999999999999999999999999999E-6144 -> -9.99999999999999999999999999999998E-6144
+dqnextp178 nextplus -9.99999999999999999999999999999998E-6144 -> -9.99999999999999999999999999999997E-6144
+dqnextp179 nextplus -9.99999999999999999999999999999997E-6144 -> -9.99999999999999999999999999999996E-6144
+dqnextp180 nextplus -0E-6176 -> 1E-6176
+dqnextp181 nextplus -1E-6176 -> -0E-6176
+dqnextp182 nextplus -2E-6176 -> -1E-6176
+
+dqnextp183 nextplus 0E-6176 -> 1E-6176
+dqnextp184 nextplus 1E-6176 -> 2E-6176
+dqnextp185 nextplus 2E-6176 -> 3E-6176
+dqnextp186 nextplus 10E-6176 -> 1.1E-6175
+dqnextp187 nextplus 100E-6176 -> 1.01E-6174
+dqnextp188 nextplus 100000E-6176 -> 1.00001E-6171
+dqnextp189 nextplus 1.00000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143
+dqnextp190 nextplus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000001E-6143
+dqnextp191 nextplus 1E-6143 -> 1.000000000000000000000000000000001E-6143
+dqnextp192 nextplus 9.999999999999999999999999999999998E+6144 -> 9.999999999999999999999999999999999E+6144
+dqnextp193 nextplus 9.999999999999999999999999999999999E+6144 -> Infinity
+
+-- Null tests
+dqnextp900 nextplus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqNextToward.decTest b/Lib/test/decimaltestdata/dqNextToward.decTest
index e6d1e0befb..107e7f5c50 100644
--- a/Lib/test/decimaltestdata/dqNextToward.decTest
+++ b/Lib/test/decimaltestdata/dqNextToward.decTest
@@ -1,375 +1,375 @@
-------------------------------------------------------------------------
--- dqNextToward.decTest -- decQuad next toward rhs [754r nextafter] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-
--- Sanity check with a scattering of numerics
-dqnextt001 nexttoward 10 10 -> 10
-dqnextt002 nexttoward -10 -10 -> -10
-dqnextt003 nexttoward 1 10 -> 1.000000000000000000000000000000001
-dqnextt004 nexttoward 1 -10 -> 0.9999999999999999999999999999999999
-dqnextt005 nexttoward -1 10 -> -0.9999999999999999999999999999999999
-dqnextt006 nexttoward -1 -10 -> -1.000000000000000000000000000000001
-dqnextt007 nexttoward 0 10 -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt008 nexttoward 0 -10 -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt009 nexttoward 9.999999999999999999999999999999999E+6144 +Infinity -> Infinity Overflow Inexact Rounded
-dqnextt010 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded
-dqnextt011 nexttoward 9.999999999999999999999999999999999 10 -> 10.00000000000000000000000000000000
-dqnextt012 nexttoward 10 9.999999999999999999999999999999999 -> 9.999999999999999999999999999999999
-dqnextt013 nexttoward -9.999999999999999999999999999999999 -10 -> -10.00000000000000000000000000000000
-dqnextt014 nexttoward -10 -9.999999999999999999999999999999999 -> -9.999999999999999999999999999999999
-dqnextt015 nexttoward 9.999999999999999999999999999999998 10 -> 9.999999999999999999999999999999999
-dqnextt016 nexttoward 10 9.999999999999999999999999999999998 -> 9.999999999999999999999999999999999
-dqnextt017 nexttoward -9.999999999999999999999999999999998 -10 -> -9.999999999999999999999999999999999
-dqnextt018 nexttoward -10 -9.999999999999999999999999999999998 -> -9.999999999999999999999999999999999
-
-------- lhs=rhs
--- finites
-dqnextt101 nexttoward 7 7 -> 7
-dqnextt102 nexttoward -7 -7 -> -7
-dqnextt103 nexttoward 75 75 -> 75
-dqnextt104 nexttoward -75 -75 -> -75
-dqnextt105 nexttoward 7.50 7.5 -> 7.50
-dqnextt106 nexttoward -7.50 -7.50 -> -7.50
-dqnextt107 nexttoward 7.500 7.5000 -> 7.500
-dqnextt108 nexttoward -7.500 -7.5 -> -7.500
-
--- zeros
-dqnextt111 nexttoward 0 0 -> 0
-dqnextt112 nexttoward -0 -0 -> -0
-dqnextt113 nexttoward 0E+4 0 -> 0E+4
-dqnextt114 nexttoward -0E+4 -0 -> -0E+4
-dqnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11
-dqnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11
-dqnextt117 nexttoward 0E-141 0 -> 0E-141
-dqnextt118 nexttoward -0E-141 -000 -> -0E-141
-
--- full coefficients, alternating bits
-dqnextt121 nexttoward 268268268 268268268 -> 268268268
-dqnextt122 nexttoward -268268268 -268268268 -> -268268268
-dqnextt123 nexttoward 134134134 134134134 -> 134134134
-dqnextt124 nexttoward -134134134 -134134134 -> -134134134
-
--- Nmax, Nmin, Ntiny
-dqnextt131 nexttoward 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqnextt132 nexttoward 1E-6143 1E-6143 -> 1E-6143
-dqnextt133 nexttoward 1.000000000000000000000000000000000E-6143 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqnextt134 nexttoward 1E-6176 1E-6176 -> 1E-6176
-
-dqnextt135 nexttoward -1E-6176 -1E-6176 -> -1E-6176
-dqnextt136 nexttoward -1.000000000000000000000000000000000E-6143 -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqnextt137 nexttoward -1E-6143 -1E-6143 -> -1E-6143
-dqnextt138 nexttoward -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-
-------- lhs<rhs
-dqnextt201 nexttoward 0.9999999999999999999999999999999995 Infinity -> 0.9999999999999999999999999999999996
-dqnextt202 nexttoward 0.9999999999999999999999999999999996 Infinity -> 0.9999999999999999999999999999999997
-dqnextt203 nexttoward 0.9999999999999999999999999999999997 Infinity -> 0.9999999999999999999999999999999998
-dqnextt204 nexttoward 0.9999999999999999999999999999999998 Infinity -> 0.9999999999999999999999999999999999
-dqnextt205 nexttoward 0.9999999999999999999999999999999999 Infinity -> 1.000000000000000000000000000000000
-dqnextt206 nexttoward 1.000000000000000000000000000000000 Infinity -> 1.000000000000000000000000000000001
-dqnextt207 nexttoward 1.0 Infinity -> 1.000000000000000000000000000000001
-dqnextt208 nexttoward 1 Infinity -> 1.000000000000000000000000000000001
-dqnextt209 nexttoward 1.000000000000000000000000000000001 Infinity -> 1.000000000000000000000000000000002
-dqnextt210 nexttoward 1.000000000000000000000000000000002 Infinity -> 1.000000000000000000000000000000003
-dqnextt211 nexttoward 1.000000000000000000000000000000003 Infinity -> 1.000000000000000000000000000000004
-dqnextt212 nexttoward 1.000000000000000000000000000000004 Infinity -> 1.000000000000000000000000000000005
-dqnextt213 nexttoward 1.000000000000000000000000000000005 Infinity -> 1.000000000000000000000000000000006
-dqnextt214 nexttoward 1.000000000000000000000000000000006 Infinity -> 1.000000000000000000000000000000007
-dqnextt215 nexttoward 1.000000000000000000000000000000007 Infinity -> 1.000000000000000000000000000000008
-dqnextt216 nexttoward 1.000000000000000000000000000000008 Infinity -> 1.000000000000000000000000000000009
-dqnextt217 nexttoward 1.000000000000000000000000000000009 Infinity -> 1.000000000000000000000000000000010
-dqnextt218 nexttoward 1.000000000000000000000000000000010 Infinity -> 1.000000000000000000000000000000011
-dqnextt219 nexttoward 1.000000000000000000000000000000011 Infinity -> 1.000000000000000000000000000000012
-
-dqnextt221 nexttoward -0.9999999999999999999999999999999995 Infinity -> -0.9999999999999999999999999999999994
-dqnextt222 nexttoward -0.9999999999999999999999999999999996 Infinity -> -0.9999999999999999999999999999999995
-dqnextt223 nexttoward -0.9999999999999999999999999999999997 Infinity -> -0.9999999999999999999999999999999996
-dqnextt224 nexttoward -0.9999999999999999999999999999999998 Infinity -> -0.9999999999999999999999999999999997
-dqnextt225 nexttoward -0.9999999999999999999999999999999999 Infinity -> -0.9999999999999999999999999999999998
-dqnextt226 nexttoward -1.000000000000000000000000000000000 Infinity -> -0.9999999999999999999999999999999999
-dqnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999999999999999999999
-dqnextt228 nexttoward -1 Infinity -> -0.9999999999999999999999999999999999
-dqnextt229 nexttoward -1.000000000000000000000000000000001 Infinity -> -1.000000000000000000000000000000000
-dqnextt230 nexttoward -1.000000000000000000000000000000002 Infinity -> -1.000000000000000000000000000000001
-dqnextt231 nexttoward -1.000000000000000000000000000000003 Infinity -> -1.000000000000000000000000000000002
-dqnextt232 nexttoward -1.000000000000000000000000000000004 Infinity -> -1.000000000000000000000000000000003
-dqnextt233 nexttoward -1.000000000000000000000000000000005 Infinity -> -1.000000000000000000000000000000004
-dqnextt234 nexttoward -1.000000000000000000000000000000006 Infinity -> -1.000000000000000000000000000000005
-dqnextt235 nexttoward -1.000000000000000000000000000000007 Infinity -> -1.000000000000000000000000000000006
-dqnextt236 nexttoward -1.000000000000000000000000000000008 Infinity -> -1.000000000000000000000000000000007
-dqnextt237 nexttoward -1.000000000000000000000000000000009 Infinity -> -1.000000000000000000000000000000008
-dqnextt238 nexttoward -1.000000000000000000000000000000010 Infinity -> -1.000000000000000000000000000000009
-dqnextt239 nexttoward -1.000000000000000000000000000000011 Infinity -> -1.000000000000000000000000000000010
-dqnextt240 nexttoward -1.000000000000000000000000000000012 Infinity -> -1.000000000000000000000000000000011
-
--- Zeros
-dqnextt300 nexttoward 0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt301 nexttoward 0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt302 nexttoward 0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt303 nexttoward 0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt304 nexttoward 0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt305 nexttoward -0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt306 nexttoward -0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt307 nexttoward -0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt308 nexttoward -0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt309 nexttoward -0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-
--- specials
-dqnextt350 nexttoward Inf Infinity -> Infinity
-dqnextt351 nexttoward -Inf Infinity -> -9.999999999999999999999999999999999E+6144
-dqnextt352 nexttoward NaN Infinity -> NaN
-dqnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
-dqnextt354 nexttoward NaN77 Infinity -> NaN77
-dqnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
-dqnextt356 nexttoward -NaN Infinity -> -NaN
-dqnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
-dqnextt358 nexttoward -NaN77 Infinity -> -NaN77
-dqnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-dqnextt370 nexttoward -9.999999999999999999999999999999999E+6144 Infinity -> -9.999999999999999999999999999999998E+6144
-dqnextt371 nexttoward -9.999999999999999999999999999999998E+6144 Infinity -> -9.999999999999999999999999999999997E+6144
-dqnextt372 nexttoward -1E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
-dqnextt373 nexttoward -1.000000000000000E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
-dqnextt374 nexttoward -9E-6176 Infinity -> -8E-6176 Underflow Subnormal Inexact Rounded
-dqnextt375 nexttoward -9.9E-6175 Infinity -> -9.8E-6175 Underflow Subnormal Inexact Rounded
-dqnextt376 nexttoward -9.99999999999999999999999999999E-6147 Infinity -> -9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded
-dqnextt377 nexttoward -9.99999999999999999999999999999999E-6144 Infinity -> -9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded
-dqnextt378 nexttoward -9.99999999999999999999999999999998E-6144 Infinity -> -9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded
-dqnextt379 nexttoward -9.99999999999999999999999999999997E-6144 Infinity -> -9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded
-dqnextt380 nexttoward -0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt381 nexttoward -1E-6176 Infinity -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqnextt382 nexttoward -2E-6176 Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-
-dqnextt383 nexttoward 0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt384 nexttoward 1E-6176 Infinity -> 2E-6176 Underflow Subnormal Inexact Rounded
-dqnextt385 nexttoward 2E-6176 Infinity -> 3E-6176 Underflow Subnormal Inexact Rounded
-dqnextt386 nexttoward 10E-6176 Infinity -> 1.1E-6175 Underflow Subnormal Inexact Rounded
-dqnextt387 nexttoward 100E-6176 Infinity -> 1.01E-6174 Underflow Subnormal Inexact Rounded
-dqnextt388 nexttoward 100000E-6176 Infinity -> 1.00001E-6171 Underflow Subnormal Inexact Rounded
-dqnextt389 nexttoward 1.00000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
-dqnextt390 nexttoward 1.000000000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
-dqnextt391 nexttoward 1E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
-dqnextt392 nexttoward 9.999999999999999999999999999999997E+6144 Infinity -> 9.999999999999999999999999999999998E+6144
-dqnextt393 nexttoward 9.999999999999999999999999999999998E+6144 Infinity -> 9.999999999999999999999999999999999E+6144
-dqnextt394 nexttoward 9.999999999999999999999999999999999E+6144 Infinity -> Infinity Overflow Inexact Rounded
-
-------- lhs>rhs
-dqnextt401 nexttoward 0.9999999999999999999999999999999995 -Infinity -> 0.9999999999999999999999999999999994
-dqnextt402 nexttoward 0.9999999999999999999999999999999996 -Infinity -> 0.9999999999999999999999999999999995
-dqnextt403 nexttoward 0.9999999999999999999999999999999997 -Infinity -> 0.9999999999999999999999999999999996
-dqnextt404 nexttoward 0.9999999999999999999999999999999998 -Infinity -> 0.9999999999999999999999999999999997
-dqnextt405 nexttoward 0.9999999999999999999999999999999999 -Infinity -> 0.9999999999999999999999999999999998
-dqnextt406 nexttoward 1.000000000000000000000000000000000 -Infinity -> 0.9999999999999999999999999999999999
-dqnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999999999999999999999
-dqnextt408 nexttoward 1 -Infinity -> 0.9999999999999999999999999999999999
-dqnextt409 nexttoward 1.000000000000000000000000000000001 -Infinity -> 1.000000000000000000000000000000000
-dqnextt410 nexttoward 1.000000000000000000000000000000002 -Infinity -> 1.000000000000000000000000000000001
-dqnextt411 nexttoward 1.000000000000000000000000000000003 -Infinity -> 1.000000000000000000000000000000002
-dqnextt412 nexttoward 1.000000000000000000000000000000004 -Infinity -> 1.000000000000000000000000000000003
-dqnextt413 nexttoward 1.000000000000000000000000000000005 -Infinity -> 1.000000000000000000000000000000004
-dqnextt414 nexttoward 1.000000000000000000000000000000006 -Infinity -> 1.000000000000000000000000000000005
-dqnextt415 nexttoward 1.000000000000000000000000000000007 -Infinity -> 1.000000000000000000000000000000006
-dqnextt416 nexttoward 1.000000000000000000000000000000008 -Infinity -> 1.000000000000000000000000000000007
-dqnextt417 nexttoward 1.000000000000000000000000000000009 -Infinity -> 1.000000000000000000000000000000008
-dqnextt418 nexttoward 1.000000000000000000000000000000010 -Infinity -> 1.000000000000000000000000000000009
-dqnextt419 nexttoward 1.000000000000000000000000000000011 -Infinity -> 1.000000000000000000000000000000010
-dqnextt420 nexttoward 1.000000000000000000000000000000012 -Infinity -> 1.000000000000000000000000000000011
-
-dqnextt421 nexttoward -0.9999999999999999999999999999999995 -Infinity -> -0.9999999999999999999999999999999996
-dqnextt422 nexttoward -0.9999999999999999999999999999999996 -Infinity -> -0.9999999999999999999999999999999997
-dqnextt423 nexttoward -0.9999999999999999999999999999999997 -Infinity -> -0.9999999999999999999999999999999998
-dqnextt424 nexttoward -0.9999999999999999999999999999999998 -Infinity -> -0.9999999999999999999999999999999999
-dqnextt425 nexttoward -0.9999999999999999999999999999999999 -Infinity -> -1.000000000000000000000000000000000
-dqnextt426 nexttoward -1.000000000000000000000000000000000 -Infinity -> -1.000000000000000000000000000000001
-dqnextt427 nexttoward -1.0 -Infinity -> -1.000000000000000000000000000000001
-dqnextt428 nexttoward -1 -Infinity -> -1.000000000000000000000000000000001
-dqnextt429 nexttoward -1.000000000000000000000000000000001 -Infinity -> -1.000000000000000000000000000000002
-dqnextt430 nexttoward -1.000000000000000000000000000000002 -Infinity -> -1.000000000000000000000000000000003
-dqnextt431 nexttoward -1.000000000000000000000000000000003 -Infinity -> -1.000000000000000000000000000000004
-dqnextt432 nexttoward -1.000000000000000000000000000000004 -Infinity -> -1.000000000000000000000000000000005
-dqnextt433 nexttoward -1.000000000000000000000000000000005 -Infinity -> -1.000000000000000000000000000000006
-dqnextt434 nexttoward -1.000000000000000000000000000000006 -Infinity -> -1.000000000000000000000000000000007
-dqnextt435 nexttoward -1.000000000000000000000000000000007 -Infinity -> -1.000000000000000000000000000000008
-dqnextt436 nexttoward -1.000000000000000000000000000000008 -Infinity -> -1.000000000000000000000000000000009
-dqnextt437 nexttoward -1.000000000000000000000000000000009 -Infinity -> -1.000000000000000000000000000000010
-dqnextt438 nexttoward -1.000000000000000000000000000000010 -Infinity -> -1.000000000000000000000000000000011
-dqnextt439 nexttoward -1.000000000000000000000000000000011 -Infinity -> -1.000000000000000000000000000000012
-
--- Zeros
-dqnextt500 nexttoward -0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt501 nexttoward 0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt502 nexttoward 0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt503 nexttoward -0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt504 nexttoward 0E-300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt505 nexttoward 0E+300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt506 nexttoward 0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt507 nexttoward -0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-
--- specials
-dqnextt550 nexttoward Inf -Infinity -> 9.999999999999999999999999999999999E+6144
-dqnextt551 nexttoward -Inf -Infinity -> -Infinity
-dqnextt552 nexttoward NaN -Infinity -> NaN
-dqnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
-dqnextt554 nexttoward NaN77 -Infinity -> NaN77
-dqnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
-dqnextt556 nexttoward -NaN -Infinity -> -NaN
-dqnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
-dqnextt558 nexttoward -NaN77 -Infinity -> -NaN77
-dqnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-dqnextt670 nexttoward 9.999999999999999999999999999999999E+6144 -Infinity -> 9.999999999999999999999999999999998E+6144
-dqnextt671 nexttoward 9.999999999999999999999999999999998E+6144 -Infinity -> 9.999999999999999999999999999999997E+6144
-dqnextt672 nexttoward 1E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
-dqnextt673 nexttoward 1.000000000000000000000000000000000E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
-dqnextt674 nexttoward 9E-6176 -Infinity -> 8E-6176 Underflow Subnormal Inexact Rounded
-dqnextt675 nexttoward 9.9E-6175 -Infinity -> 9.8E-6175 Underflow Subnormal Inexact Rounded
-dqnextt676 nexttoward 9.99999999999999999999999999999E-6147 -Infinity -> 9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded
-dqnextt677 nexttoward 9.99999999999999999999999999999999E-6144 -Infinity -> 9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded
-dqnextt678 nexttoward 9.99999999999999999999999999999998E-6144 -Infinity -> 9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded
-dqnextt679 nexttoward 9.99999999999999999999999999999997E-6144 -Infinity -> 9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded
-dqnextt680 nexttoward 0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt681 nexttoward 1E-6176 -Infinity -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqnextt682 nexttoward 2E-6176 -Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
-
-dqnextt683 nexttoward -0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt684 nexttoward -1E-6176 -Infinity -> -2E-6176 Underflow Subnormal Inexact Rounded
-dqnextt685 nexttoward -2E-6176 -Infinity -> -3E-6176 Underflow Subnormal Inexact Rounded
-dqnextt686 nexttoward -10E-6176 -Infinity -> -1.1E-6175 Underflow Subnormal Inexact Rounded
-dqnextt687 nexttoward -100E-6176 -Infinity -> -1.01E-6174 Underflow Subnormal Inexact Rounded
-dqnextt688 nexttoward -100000E-6176 -Infinity -> -1.00001E-6171 Underflow Subnormal Inexact Rounded
-dqnextt689 nexttoward -1.00000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
-dqnextt690 nexttoward -1.000000000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
-dqnextt691 nexttoward -1E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
-dqnextt692 nexttoward -9.999999999999999999999999999999998E+6144 -Infinity -> -9.999999999999999999999999999999999E+6144
-dqnextt693 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded
-
-------- Specials
-dqnextt780 nexttoward -Inf -Inf -> -Infinity
-dqnextt781 nexttoward -Inf -1000 -> -9.999999999999999999999999999999999E+6144
-dqnextt782 nexttoward -Inf -1 -> -9.999999999999999999999999999999999E+6144
-dqnextt783 nexttoward -Inf -0 -> -9.999999999999999999999999999999999E+6144
-dqnextt784 nexttoward -Inf 0 -> -9.999999999999999999999999999999999E+6144
-dqnextt785 nexttoward -Inf 1 -> -9.999999999999999999999999999999999E+6144
-dqnextt786 nexttoward -Inf 1000 -> -9.999999999999999999999999999999999E+6144
-dqnextt787 nexttoward -1000 -Inf -> -1000.000000000000000000000000000001
-dqnextt788 nexttoward -Inf -Inf -> -Infinity
-dqnextt789 nexttoward -1 -Inf -> -1.000000000000000000000000000000001
-dqnextt790 nexttoward -0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt791 nexttoward 0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt792 nexttoward 1 -Inf -> 0.9999999999999999999999999999999999
-dqnextt793 nexttoward 1000 -Inf -> 999.9999999999999999999999999999999
-dqnextt794 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144
-
-dqnextt800 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144
-dqnextt801 nexttoward Inf -1000 -> 9.999999999999999999999999999999999E+6144
-dqnextt802 nexttoward Inf -1 -> 9.999999999999999999999999999999999E+6144
-dqnextt803 nexttoward Inf -0 -> 9.999999999999999999999999999999999E+6144
-dqnextt804 nexttoward Inf 0 -> 9.999999999999999999999999999999999E+6144
-dqnextt805 nexttoward Inf 1 -> 9.999999999999999999999999999999999E+6144
-dqnextt806 nexttoward Inf 1000 -> 9.999999999999999999999999999999999E+6144
-dqnextt807 nexttoward Inf Inf -> Infinity
-dqnextt808 nexttoward -1000 Inf -> -999.9999999999999999999999999999999
-dqnextt809 nexttoward -Inf Inf -> -9.999999999999999999999999999999999E+6144
-dqnextt810 nexttoward -1 Inf -> -0.9999999999999999999999999999999999
-dqnextt811 nexttoward -0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt812 nexttoward 0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded
-dqnextt813 nexttoward 1 Inf -> 1.000000000000000000000000000000001
-dqnextt814 nexttoward 1000 Inf -> 1000.000000000000000000000000000001
-dqnextt815 nexttoward Inf Inf -> Infinity
-
-dqnextt821 nexttoward NaN -Inf -> NaN
-dqnextt822 nexttoward NaN -1000 -> NaN
-dqnextt823 nexttoward NaN -1 -> NaN
-dqnextt824 nexttoward NaN -0 -> NaN
-dqnextt825 nexttoward NaN 0 -> NaN
-dqnextt826 nexttoward NaN 1 -> NaN
-dqnextt827 nexttoward NaN 1000 -> NaN
-dqnextt828 nexttoward NaN Inf -> NaN
-dqnextt829 nexttoward NaN NaN -> NaN
-dqnextt830 nexttoward -Inf NaN -> NaN
-dqnextt831 nexttoward -1000 NaN -> NaN
-dqnextt832 nexttoward -1 NaN -> NaN
-dqnextt833 nexttoward -0 NaN -> NaN
-dqnextt834 nexttoward 0 NaN -> NaN
-dqnextt835 nexttoward 1 NaN -> NaN
-dqnextt836 nexttoward 1000 NaN -> NaN
-dqnextt837 nexttoward Inf NaN -> NaN
-
-dqnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
-dqnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
-dqnextt843 nexttoward sNaN -1 -> NaN Invalid_operation
-dqnextt844 nexttoward sNaN -0 -> NaN Invalid_operation
-dqnextt845 nexttoward sNaN 0 -> NaN Invalid_operation
-dqnextt846 nexttoward sNaN 1 -> NaN Invalid_operation
-dqnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
-dqnextt848 nexttoward sNaN NaN -> NaN Invalid_operation
-dqnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
-dqnextt850 nexttoward NaN sNaN -> NaN Invalid_operation
-dqnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
-dqnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
-dqnextt853 nexttoward -1 sNaN -> NaN Invalid_operation
-dqnextt854 nexttoward -0 sNaN -> NaN Invalid_operation
-dqnextt855 nexttoward 0 sNaN -> NaN Invalid_operation
-dqnextt856 nexttoward 1 sNaN -> NaN Invalid_operation
-dqnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
-dqnextt858 nexttoward Inf sNaN -> NaN Invalid_operation
-dqnextt859 nexttoward NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqnextt861 nexttoward NaN1 -Inf -> NaN1
-dqnextt862 nexttoward +NaN2 -1000 -> NaN2
-dqnextt863 nexttoward NaN3 1000 -> NaN3
-dqnextt864 nexttoward NaN4 Inf -> NaN4
-dqnextt865 nexttoward NaN5 +NaN6 -> NaN5
-dqnextt866 nexttoward -Inf NaN7 -> NaN7
-dqnextt867 nexttoward -1000 NaN8 -> NaN8
-dqnextt868 nexttoward 1000 NaN9 -> NaN9
-dqnextt869 nexttoward Inf +NaN10 -> NaN10
-dqnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
-dqnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
-dqnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
-dqnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
-dqnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
-dqnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
-dqnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
-dqnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
-dqnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
-dqnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqnextt882 nexttoward -NaN26 NaN28 -> -NaN26
-dqnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqnextt884 nexttoward 1000 -NaN30 -> -NaN30
-dqnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Null tests
-dqnextt900 nexttoward 1 # -> NaN Invalid_operation
-dqnextt901 nexttoward # 1 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqNextToward.decTest -- decQuad next toward rhs [754r nextafter] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+
+-- Sanity check with a scattering of numerics
+dqnextt001 nexttoward 10 10 -> 10
+dqnextt002 nexttoward -10 -10 -> -10
+dqnextt003 nexttoward 1 10 -> 1.000000000000000000000000000000001
+dqnextt004 nexttoward 1 -10 -> 0.9999999999999999999999999999999999
+dqnextt005 nexttoward -1 10 -> -0.9999999999999999999999999999999999
+dqnextt006 nexttoward -1 -10 -> -1.000000000000000000000000000000001
+dqnextt007 nexttoward 0 10 -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt008 nexttoward 0 -10 -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt009 nexttoward 9.999999999999999999999999999999999E+6144 +Infinity -> Infinity Overflow Inexact Rounded
+dqnextt010 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded
+dqnextt011 nexttoward 9.999999999999999999999999999999999 10 -> 10.00000000000000000000000000000000
+dqnextt012 nexttoward 10 9.999999999999999999999999999999999 -> 9.999999999999999999999999999999999
+dqnextt013 nexttoward -9.999999999999999999999999999999999 -10 -> -10.00000000000000000000000000000000
+dqnextt014 nexttoward -10 -9.999999999999999999999999999999999 -> -9.999999999999999999999999999999999
+dqnextt015 nexttoward 9.999999999999999999999999999999998 10 -> 9.999999999999999999999999999999999
+dqnextt016 nexttoward 10 9.999999999999999999999999999999998 -> 9.999999999999999999999999999999999
+dqnextt017 nexttoward -9.999999999999999999999999999999998 -10 -> -9.999999999999999999999999999999999
+dqnextt018 nexttoward -10 -9.999999999999999999999999999999998 -> -9.999999999999999999999999999999999
+
+------- lhs=rhs
+-- finites
+dqnextt101 nexttoward 7 7 -> 7
+dqnextt102 nexttoward -7 -7 -> -7
+dqnextt103 nexttoward 75 75 -> 75
+dqnextt104 nexttoward -75 -75 -> -75
+dqnextt105 nexttoward 7.50 7.5 -> 7.50
+dqnextt106 nexttoward -7.50 -7.50 -> -7.50
+dqnextt107 nexttoward 7.500 7.5000 -> 7.500
+dqnextt108 nexttoward -7.500 -7.5 -> -7.500
+
+-- zeros
+dqnextt111 nexttoward 0 0 -> 0
+dqnextt112 nexttoward -0 -0 -> -0
+dqnextt113 nexttoward 0E+4 0 -> 0E+4
+dqnextt114 nexttoward -0E+4 -0 -> -0E+4
+dqnextt115 nexttoward 0.00000000000 0.000000000000 -> 0E-11
+dqnextt116 nexttoward -0.00000000000 -0.00 -> -0E-11
+dqnextt117 nexttoward 0E-141 0 -> 0E-141
+dqnextt118 nexttoward -0E-141 -000 -> -0E-141
+
+-- full coefficients, alternating bits
+dqnextt121 nexttoward 268268268 268268268 -> 268268268
+dqnextt122 nexttoward -268268268 -268268268 -> -268268268
+dqnextt123 nexttoward 134134134 134134134 -> 134134134
+dqnextt124 nexttoward -134134134 -134134134 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+dqnextt131 nexttoward 9.999999999999999999999999999999999E+6144 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqnextt132 nexttoward 1E-6143 1E-6143 -> 1E-6143
+dqnextt133 nexttoward 1.000000000000000000000000000000000E-6143 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqnextt134 nexttoward 1E-6176 1E-6176 -> 1E-6176
+
+dqnextt135 nexttoward -1E-6176 -1E-6176 -> -1E-6176
+dqnextt136 nexttoward -1.000000000000000000000000000000000E-6143 -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqnextt137 nexttoward -1E-6143 -1E-6143 -> -1E-6143
+dqnextt138 nexttoward -9.999999999999999999999999999999999E+6144 -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+
+------- lhs<rhs
+dqnextt201 nexttoward 0.9999999999999999999999999999999995 Infinity -> 0.9999999999999999999999999999999996
+dqnextt202 nexttoward 0.9999999999999999999999999999999996 Infinity -> 0.9999999999999999999999999999999997
+dqnextt203 nexttoward 0.9999999999999999999999999999999997 Infinity -> 0.9999999999999999999999999999999998
+dqnextt204 nexttoward 0.9999999999999999999999999999999998 Infinity -> 0.9999999999999999999999999999999999
+dqnextt205 nexttoward 0.9999999999999999999999999999999999 Infinity -> 1.000000000000000000000000000000000
+dqnextt206 nexttoward 1.000000000000000000000000000000000 Infinity -> 1.000000000000000000000000000000001
+dqnextt207 nexttoward 1.0 Infinity -> 1.000000000000000000000000000000001
+dqnextt208 nexttoward 1 Infinity -> 1.000000000000000000000000000000001
+dqnextt209 nexttoward 1.000000000000000000000000000000001 Infinity -> 1.000000000000000000000000000000002
+dqnextt210 nexttoward 1.000000000000000000000000000000002 Infinity -> 1.000000000000000000000000000000003
+dqnextt211 nexttoward 1.000000000000000000000000000000003 Infinity -> 1.000000000000000000000000000000004
+dqnextt212 nexttoward 1.000000000000000000000000000000004 Infinity -> 1.000000000000000000000000000000005
+dqnextt213 nexttoward 1.000000000000000000000000000000005 Infinity -> 1.000000000000000000000000000000006
+dqnextt214 nexttoward 1.000000000000000000000000000000006 Infinity -> 1.000000000000000000000000000000007
+dqnextt215 nexttoward 1.000000000000000000000000000000007 Infinity -> 1.000000000000000000000000000000008
+dqnextt216 nexttoward 1.000000000000000000000000000000008 Infinity -> 1.000000000000000000000000000000009
+dqnextt217 nexttoward 1.000000000000000000000000000000009 Infinity -> 1.000000000000000000000000000000010
+dqnextt218 nexttoward 1.000000000000000000000000000000010 Infinity -> 1.000000000000000000000000000000011
+dqnextt219 nexttoward 1.000000000000000000000000000000011 Infinity -> 1.000000000000000000000000000000012
+
+dqnextt221 nexttoward -0.9999999999999999999999999999999995 Infinity -> -0.9999999999999999999999999999999994
+dqnextt222 nexttoward -0.9999999999999999999999999999999996 Infinity -> -0.9999999999999999999999999999999995
+dqnextt223 nexttoward -0.9999999999999999999999999999999997 Infinity -> -0.9999999999999999999999999999999996
+dqnextt224 nexttoward -0.9999999999999999999999999999999998 Infinity -> -0.9999999999999999999999999999999997
+dqnextt225 nexttoward -0.9999999999999999999999999999999999 Infinity -> -0.9999999999999999999999999999999998
+dqnextt226 nexttoward -1.000000000000000000000000000000000 Infinity -> -0.9999999999999999999999999999999999
+dqnextt227 nexttoward -1.0 Infinity -> -0.9999999999999999999999999999999999
+dqnextt228 nexttoward -1 Infinity -> -0.9999999999999999999999999999999999
+dqnextt229 nexttoward -1.000000000000000000000000000000001 Infinity -> -1.000000000000000000000000000000000
+dqnextt230 nexttoward -1.000000000000000000000000000000002 Infinity -> -1.000000000000000000000000000000001
+dqnextt231 nexttoward -1.000000000000000000000000000000003 Infinity -> -1.000000000000000000000000000000002
+dqnextt232 nexttoward -1.000000000000000000000000000000004 Infinity -> -1.000000000000000000000000000000003
+dqnextt233 nexttoward -1.000000000000000000000000000000005 Infinity -> -1.000000000000000000000000000000004
+dqnextt234 nexttoward -1.000000000000000000000000000000006 Infinity -> -1.000000000000000000000000000000005
+dqnextt235 nexttoward -1.000000000000000000000000000000007 Infinity -> -1.000000000000000000000000000000006
+dqnextt236 nexttoward -1.000000000000000000000000000000008 Infinity -> -1.000000000000000000000000000000007
+dqnextt237 nexttoward -1.000000000000000000000000000000009 Infinity -> -1.000000000000000000000000000000008
+dqnextt238 nexttoward -1.000000000000000000000000000000010 Infinity -> -1.000000000000000000000000000000009
+dqnextt239 nexttoward -1.000000000000000000000000000000011 Infinity -> -1.000000000000000000000000000000010
+dqnextt240 nexttoward -1.000000000000000000000000000000012 Infinity -> -1.000000000000000000000000000000011
+
+-- Zeros
+dqnextt300 nexttoward 0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt301 nexttoward 0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt302 nexttoward 0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt303 nexttoward 0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt304 nexttoward 0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt305 nexttoward -0 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt306 nexttoward -0.00 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt307 nexttoward -0E-300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt308 nexttoward -0E+300 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt309 nexttoward -0E+30000 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+-- specials
+dqnextt350 nexttoward Inf Infinity -> Infinity
+dqnextt351 nexttoward -Inf Infinity -> -9.999999999999999999999999999999999E+6144
+dqnextt352 nexttoward NaN Infinity -> NaN
+dqnextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
+dqnextt354 nexttoward NaN77 Infinity -> NaN77
+dqnextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
+dqnextt356 nexttoward -NaN Infinity -> -NaN
+dqnextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
+dqnextt358 nexttoward -NaN77 Infinity -> -NaN77
+dqnextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+dqnextt370 nexttoward -9.999999999999999999999999999999999E+6144 Infinity -> -9.999999999999999999999999999999998E+6144
+dqnextt371 nexttoward -9.999999999999999999999999999999998E+6144 Infinity -> -9.999999999999999999999999999999997E+6144
+dqnextt372 nexttoward -1E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
+dqnextt373 nexttoward -1.000000000000000E-6143 Infinity -> -9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
+dqnextt374 nexttoward -9E-6176 Infinity -> -8E-6176 Underflow Subnormal Inexact Rounded
+dqnextt375 nexttoward -9.9E-6175 Infinity -> -9.8E-6175 Underflow Subnormal Inexact Rounded
+dqnextt376 nexttoward -9.99999999999999999999999999999E-6147 Infinity -> -9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded
+dqnextt377 nexttoward -9.99999999999999999999999999999999E-6144 Infinity -> -9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded
+dqnextt378 nexttoward -9.99999999999999999999999999999998E-6144 Infinity -> -9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded
+dqnextt379 nexttoward -9.99999999999999999999999999999997E-6144 Infinity -> -9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded
+dqnextt380 nexttoward -0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt381 nexttoward -1E-6176 Infinity -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqnextt382 nexttoward -2E-6176 Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+
+dqnextt383 nexttoward 0E-6176 Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt384 nexttoward 1E-6176 Infinity -> 2E-6176 Underflow Subnormal Inexact Rounded
+dqnextt385 nexttoward 2E-6176 Infinity -> 3E-6176 Underflow Subnormal Inexact Rounded
+dqnextt386 nexttoward 10E-6176 Infinity -> 1.1E-6175 Underflow Subnormal Inexact Rounded
+dqnextt387 nexttoward 100E-6176 Infinity -> 1.01E-6174 Underflow Subnormal Inexact Rounded
+dqnextt388 nexttoward 100000E-6176 Infinity -> 1.00001E-6171 Underflow Subnormal Inexact Rounded
+dqnextt389 nexttoward 1.00000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
+dqnextt390 nexttoward 1.000000000000000000000000000000000E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
+dqnextt391 nexttoward 1E-6143 Infinity -> 1.000000000000000000000000000000001E-6143
+dqnextt392 nexttoward 9.999999999999999999999999999999997E+6144 Infinity -> 9.999999999999999999999999999999998E+6144
+dqnextt393 nexttoward 9.999999999999999999999999999999998E+6144 Infinity -> 9.999999999999999999999999999999999E+6144
+dqnextt394 nexttoward 9.999999999999999999999999999999999E+6144 Infinity -> Infinity Overflow Inexact Rounded
+
+------- lhs>rhs
+dqnextt401 nexttoward 0.9999999999999999999999999999999995 -Infinity -> 0.9999999999999999999999999999999994
+dqnextt402 nexttoward 0.9999999999999999999999999999999996 -Infinity -> 0.9999999999999999999999999999999995
+dqnextt403 nexttoward 0.9999999999999999999999999999999997 -Infinity -> 0.9999999999999999999999999999999996
+dqnextt404 nexttoward 0.9999999999999999999999999999999998 -Infinity -> 0.9999999999999999999999999999999997
+dqnextt405 nexttoward 0.9999999999999999999999999999999999 -Infinity -> 0.9999999999999999999999999999999998
+dqnextt406 nexttoward 1.000000000000000000000000000000000 -Infinity -> 0.9999999999999999999999999999999999
+dqnextt407 nexttoward 1.0 -Infinity -> 0.9999999999999999999999999999999999
+dqnextt408 nexttoward 1 -Infinity -> 0.9999999999999999999999999999999999
+dqnextt409 nexttoward 1.000000000000000000000000000000001 -Infinity -> 1.000000000000000000000000000000000
+dqnextt410 nexttoward 1.000000000000000000000000000000002 -Infinity -> 1.000000000000000000000000000000001
+dqnextt411 nexttoward 1.000000000000000000000000000000003 -Infinity -> 1.000000000000000000000000000000002
+dqnextt412 nexttoward 1.000000000000000000000000000000004 -Infinity -> 1.000000000000000000000000000000003
+dqnextt413 nexttoward 1.000000000000000000000000000000005 -Infinity -> 1.000000000000000000000000000000004
+dqnextt414 nexttoward 1.000000000000000000000000000000006 -Infinity -> 1.000000000000000000000000000000005
+dqnextt415 nexttoward 1.000000000000000000000000000000007 -Infinity -> 1.000000000000000000000000000000006
+dqnextt416 nexttoward 1.000000000000000000000000000000008 -Infinity -> 1.000000000000000000000000000000007
+dqnextt417 nexttoward 1.000000000000000000000000000000009 -Infinity -> 1.000000000000000000000000000000008
+dqnextt418 nexttoward 1.000000000000000000000000000000010 -Infinity -> 1.000000000000000000000000000000009
+dqnextt419 nexttoward 1.000000000000000000000000000000011 -Infinity -> 1.000000000000000000000000000000010
+dqnextt420 nexttoward 1.000000000000000000000000000000012 -Infinity -> 1.000000000000000000000000000000011
+
+dqnextt421 nexttoward -0.9999999999999999999999999999999995 -Infinity -> -0.9999999999999999999999999999999996
+dqnextt422 nexttoward -0.9999999999999999999999999999999996 -Infinity -> -0.9999999999999999999999999999999997
+dqnextt423 nexttoward -0.9999999999999999999999999999999997 -Infinity -> -0.9999999999999999999999999999999998
+dqnextt424 nexttoward -0.9999999999999999999999999999999998 -Infinity -> -0.9999999999999999999999999999999999
+dqnextt425 nexttoward -0.9999999999999999999999999999999999 -Infinity -> -1.000000000000000000000000000000000
+dqnextt426 nexttoward -1.000000000000000000000000000000000 -Infinity -> -1.000000000000000000000000000000001
+dqnextt427 nexttoward -1.0 -Infinity -> -1.000000000000000000000000000000001
+dqnextt428 nexttoward -1 -Infinity -> -1.000000000000000000000000000000001
+dqnextt429 nexttoward -1.000000000000000000000000000000001 -Infinity -> -1.000000000000000000000000000000002
+dqnextt430 nexttoward -1.000000000000000000000000000000002 -Infinity -> -1.000000000000000000000000000000003
+dqnextt431 nexttoward -1.000000000000000000000000000000003 -Infinity -> -1.000000000000000000000000000000004
+dqnextt432 nexttoward -1.000000000000000000000000000000004 -Infinity -> -1.000000000000000000000000000000005
+dqnextt433 nexttoward -1.000000000000000000000000000000005 -Infinity -> -1.000000000000000000000000000000006
+dqnextt434 nexttoward -1.000000000000000000000000000000006 -Infinity -> -1.000000000000000000000000000000007
+dqnextt435 nexttoward -1.000000000000000000000000000000007 -Infinity -> -1.000000000000000000000000000000008
+dqnextt436 nexttoward -1.000000000000000000000000000000008 -Infinity -> -1.000000000000000000000000000000009
+dqnextt437 nexttoward -1.000000000000000000000000000000009 -Infinity -> -1.000000000000000000000000000000010
+dqnextt438 nexttoward -1.000000000000000000000000000000010 -Infinity -> -1.000000000000000000000000000000011
+dqnextt439 nexttoward -1.000000000000000000000000000000011 -Infinity -> -1.000000000000000000000000000000012
+
+-- Zeros
+dqnextt500 nexttoward -0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt501 nexttoward 0 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt502 nexttoward 0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt503 nexttoward -0.00 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt504 nexttoward 0E-300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt505 nexttoward 0E+300 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt506 nexttoward 0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt507 nexttoward -0E+30000 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+
+-- specials
+dqnextt550 nexttoward Inf -Infinity -> 9.999999999999999999999999999999999E+6144
+dqnextt551 nexttoward -Inf -Infinity -> -Infinity
+dqnextt552 nexttoward NaN -Infinity -> NaN
+dqnextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
+dqnextt554 nexttoward NaN77 -Infinity -> NaN77
+dqnextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
+dqnextt556 nexttoward -NaN -Infinity -> -NaN
+dqnextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
+dqnextt558 nexttoward -NaN77 -Infinity -> -NaN77
+dqnextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+dqnextt670 nexttoward 9.999999999999999999999999999999999E+6144 -Infinity -> 9.999999999999999999999999999999998E+6144
+dqnextt671 nexttoward 9.999999999999999999999999999999998E+6144 -Infinity -> 9.999999999999999999999999999999997E+6144
+dqnextt672 nexttoward 1E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
+dqnextt673 nexttoward 1.000000000000000000000000000000000E-6143 -Infinity -> 9.99999999999999999999999999999999E-6144 Underflow Subnormal Inexact Rounded
+dqnextt674 nexttoward 9E-6176 -Infinity -> 8E-6176 Underflow Subnormal Inexact Rounded
+dqnextt675 nexttoward 9.9E-6175 -Infinity -> 9.8E-6175 Underflow Subnormal Inexact Rounded
+dqnextt676 nexttoward 9.99999999999999999999999999999E-6147 -Infinity -> 9.99999999999999999999999999998E-6147 Underflow Subnormal Inexact Rounded
+dqnextt677 nexttoward 9.99999999999999999999999999999999E-6144 -Infinity -> 9.99999999999999999999999999999998E-6144 Underflow Subnormal Inexact Rounded
+dqnextt678 nexttoward 9.99999999999999999999999999999998E-6144 -Infinity -> 9.99999999999999999999999999999997E-6144 Underflow Subnormal Inexact Rounded
+dqnextt679 nexttoward 9.99999999999999999999999999999997E-6144 -Infinity -> 9.99999999999999999999999999999996E-6144 Underflow Subnormal Inexact Rounded
+dqnextt680 nexttoward 0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt681 nexttoward 1E-6176 -Infinity -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqnextt682 nexttoward 2E-6176 -Infinity -> 1E-6176 Underflow Subnormal Inexact Rounded
+
+dqnextt683 nexttoward -0E-6176 -Infinity -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt684 nexttoward -1E-6176 -Infinity -> -2E-6176 Underflow Subnormal Inexact Rounded
+dqnextt685 nexttoward -2E-6176 -Infinity -> -3E-6176 Underflow Subnormal Inexact Rounded
+dqnextt686 nexttoward -10E-6176 -Infinity -> -1.1E-6175 Underflow Subnormal Inexact Rounded
+dqnextt687 nexttoward -100E-6176 -Infinity -> -1.01E-6174 Underflow Subnormal Inexact Rounded
+dqnextt688 nexttoward -100000E-6176 -Infinity -> -1.00001E-6171 Underflow Subnormal Inexact Rounded
+dqnextt689 nexttoward -1.00000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
+dqnextt690 nexttoward -1.000000000000000000000000000000000E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
+dqnextt691 nexttoward -1E-6143 -Infinity -> -1.000000000000000000000000000000001E-6143
+dqnextt692 nexttoward -9.999999999999999999999999999999998E+6144 -Infinity -> -9.999999999999999999999999999999999E+6144
+dqnextt693 nexttoward -9.999999999999999999999999999999999E+6144 -Infinity -> -Infinity Overflow Inexact Rounded
+
+------- Specials
+dqnextt780 nexttoward -Inf -Inf -> -Infinity
+dqnextt781 nexttoward -Inf -1000 -> -9.999999999999999999999999999999999E+6144
+dqnextt782 nexttoward -Inf -1 -> -9.999999999999999999999999999999999E+6144
+dqnextt783 nexttoward -Inf -0 -> -9.999999999999999999999999999999999E+6144
+dqnextt784 nexttoward -Inf 0 -> -9.999999999999999999999999999999999E+6144
+dqnextt785 nexttoward -Inf 1 -> -9.999999999999999999999999999999999E+6144
+dqnextt786 nexttoward -Inf 1000 -> -9.999999999999999999999999999999999E+6144
+dqnextt787 nexttoward -1000 -Inf -> -1000.000000000000000000000000000001
+dqnextt788 nexttoward -Inf -Inf -> -Infinity
+dqnextt789 nexttoward -1 -Inf -> -1.000000000000000000000000000000001
+dqnextt790 nexttoward -0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt791 nexttoward 0 -Inf -> -1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt792 nexttoward 1 -Inf -> 0.9999999999999999999999999999999999
+dqnextt793 nexttoward 1000 -Inf -> 999.9999999999999999999999999999999
+dqnextt794 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144
+
+dqnextt800 nexttoward Inf -Inf -> 9.999999999999999999999999999999999E+6144
+dqnextt801 nexttoward Inf -1000 -> 9.999999999999999999999999999999999E+6144
+dqnextt802 nexttoward Inf -1 -> 9.999999999999999999999999999999999E+6144
+dqnextt803 nexttoward Inf -0 -> 9.999999999999999999999999999999999E+6144
+dqnextt804 nexttoward Inf 0 -> 9.999999999999999999999999999999999E+6144
+dqnextt805 nexttoward Inf 1 -> 9.999999999999999999999999999999999E+6144
+dqnextt806 nexttoward Inf 1000 -> 9.999999999999999999999999999999999E+6144
+dqnextt807 nexttoward Inf Inf -> Infinity
+dqnextt808 nexttoward -1000 Inf -> -999.9999999999999999999999999999999
+dqnextt809 nexttoward -Inf Inf -> -9.999999999999999999999999999999999E+6144
+dqnextt810 nexttoward -1 Inf -> -0.9999999999999999999999999999999999
+dqnextt811 nexttoward -0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt812 nexttoward 0 Inf -> 1E-6176 Underflow Subnormal Inexact Rounded
+dqnextt813 nexttoward 1 Inf -> 1.000000000000000000000000000000001
+dqnextt814 nexttoward 1000 Inf -> 1000.000000000000000000000000000001
+dqnextt815 nexttoward Inf Inf -> Infinity
+
+dqnextt821 nexttoward NaN -Inf -> NaN
+dqnextt822 nexttoward NaN -1000 -> NaN
+dqnextt823 nexttoward NaN -1 -> NaN
+dqnextt824 nexttoward NaN -0 -> NaN
+dqnextt825 nexttoward NaN 0 -> NaN
+dqnextt826 nexttoward NaN 1 -> NaN
+dqnextt827 nexttoward NaN 1000 -> NaN
+dqnextt828 nexttoward NaN Inf -> NaN
+dqnextt829 nexttoward NaN NaN -> NaN
+dqnextt830 nexttoward -Inf NaN -> NaN
+dqnextt831 nexttoward -1000 NaN -> NaN
+dqnextt832 nexttoward -1 NaN -> NaN
+dqnextt833 nexttoward -0 NaN -> NaN
+dqnextt834 nexttoward 0 NaN -> NaN
+dqnextt835 nexttoward 1 NaN -> NaN
+dqnextt836 nexttoward 1000 NaN -> NaN
+dqnextt837 nexttoward Inf NaN -> NaN
+
+dqnextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
+dqnextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
+dqnextt843 nexttoward sNaN -1 -> NaN Invalid_operation
+dqnextt844 nexttoward sNaN -0 -> NaN Invalid_operation
+dqnextt845 nexttoward sNaN 0 -> NaN Invalid_operation
+dqnextt846 nexttoward sNaN 1 -> NaN Invalid_operation
+dqnextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
+dqnextt848 nexttoward sNaN NaN -> NaN Invalid_operation
+dqnextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
+dqnextt850 nexttoward NaN sNaN -> NaN Invalid_operation
+dqnextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
+dqnextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
+dqnextt853 nexttoward -1 sNaN -> NaN Invalid_operation
+dqnextt854 nexttoward -0 sNaN -> NaN Invalid_operation
+dqnextt855 nexttoward 0 sNaN -> NaN Invalid_operation
+dqnextt856 nexttoward 1 sNaN -> NaN Invalid_operation
+dqnextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
+dqnextt858 nexttoward Inf sNaN -> NaN Invalid_operation
+dqnextt859 nexttoward NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqnextt861 nexttoward NaN1 -Inf -> NaN1
+dqnextt862 nexttoward +NaN2 -1000 -> NaN2
+dqnextt863 nexttoward NaN3 1000 -> NaN3
+dqnextt864 nexttoward NaN4 Inf -> NaN4
+dqnextt865 nexttoward NaN5 +NaN6 -> NaN5
+dqnextt866 nexttoward -Inf NaN7 -> NaN7
+dqnextt867 nexttoward -1000 NaN8 -> NaN8
+dqnextt868 nexttoward 1000 NaN9 -> NaN9
+dqnextt869 nexttoward Inf +NaN10 -> NaN10
+dqnextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
+dqnextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
+dqnextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
+dqnextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
+dqnextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqnextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
+dqnextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
+dqnextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
+dqnextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
+dqnextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
+dqnextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqnextt882 nexttoward -NaN26 NaN28 -> -NaN26
+dqnextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqnextt884 nexttoward 1000 -NaN30 -> -NaN30
+dqnextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Null tests
+dqnextt900 nexttoward 1 # -> NaN Invalid_operation
+dqnextt901 nexttoward # 1 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqOr.decTest b/Lib/test/decimaltestdata/dqOr.decTest
index daa3c86094..1fd34b2b35 100644
--- a/Lib/test/decimaltestdata/dqOr.decTest
+++ b/Lib/test/decimaltestdata/dqOr.decTest
@@ -1,401 +1,401 @@
-------------------------------------------------------------------------
--- dqOr.decTest -- digitwise logical OR for decQuads --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check (truth table)
-dqor001 or 0 0 -> 0
-dqor002 or 0 1 -> 1
-dqor003 or 1 0 -> 1
-dqor004 or 1 1 -> 1
-dqor005 or 1100 1010 -> 1110
--- and at msd and msd-1
-dqor006 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqor007 or 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqor008 or 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqor009 or 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqor010 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqor011 or 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
-dqor012 or 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000
-dqor013 or 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
-
--- Various lengths
-dqor601 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111
-dqor602 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111
-dqor603 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111
-dqor604 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111
-dqor605 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111
-dqor606 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111
-dqor607 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111
-dqor608 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111
-dqor609 or 1111111101111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111111111111
-dqor610 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111
-dqor611 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111
-dqor612 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111
-dqor613 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111
-dqor614 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111
-dqor615 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111
-dqor616 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111
-dqor617 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111
-dqor618 or 1111111111111111101111111111111111 1111111111111111011111111111111111 -> 1111111111111111111111111111111111
-dqor619 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111
-dqor620 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111
-dqor621 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111
-dqor622 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111
-dqor623 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111
-dqor624 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111
-dqor625 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111
-dqor626 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111
-dqor627 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111
-dqor628 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor629 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor630 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor631 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor632 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor633 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor634 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111
-
-dqor641 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor642 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor643 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor644 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor645 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor646 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor647 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111
-dqor648 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111
-dqor649 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111
-dqor650 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111
-dqor651 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111
-dqor652 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111
-dqor653 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111
-dqor654 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111
-dqor655 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111
-dqor656 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111
-dqor657 or 1010101010101010101010101010101010 1010101010101010001010101010101010 -> 1010101010101010101010101010101010
-dqor658 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111
-dqor659 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111
-dqor660 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111
-dqor661 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111
-dqor662 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111
-dqor663 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111
-dqor664 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111
-dqor665 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111
-dqor666 or 0101010101010101010101010101010101 0101010101010101010101010001010101 -> 101010101010101010101010101010101
-dqor667 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111
-dqor668 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111
-dqor669 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111
-dqor670 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111
-dqor671 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111
-dqor672 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111
-dqor673 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111
-dqor674 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111
-dqor675 or 0111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
-dqor676 or 1111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
-
-dqor681 or 0111111111111111111111111111111111 0111111111011111111111111111111110 -> 111111111111111111111111111111111
-dqor682 or 1011111111111111111111111111111111 1011111110101111111111111111111101 -> 1011111111111111111111111111111111
-dqor683 or 1101111111111111111111111111111111 1101111101110111111111111111111011 -> 1101111111111111111111111111111111
-dqor684 or 1110111111111111111111111111111111 1110111011111011111111111111110111 -> 1110111111111111111111111111111111
-dqor685 or 1111011111111111111111111111111111 1111010111111101111111111111101111 -> 1111011111111111111111111111111111
-dqor686 or 1111101111111111111111111111111111 1111101111111110111111111111011111 -> 1111101111111111111111111111111111
-dqor687 or 1111110111111111111111111111111111 1111010111111111011111111110111111 -> 1111110111111111111111111111111111
-dqor688 or 1111111011111111111111111111111111 1110111011111111101111111101111111 -> 1111111011111111111111111111111111
-dqor689 or 1111111101111111111111111111111111 1101111101111111110111111011111111 -> 1111111101111111111111111111111111
-dqor690 or 1111111110111111111111111111111111 1011111110111111111011110111111110 -> 1111111110111111111111111111111111
-dqor691 or 1111111111011111111111111111111111 0111111111011111111101101111111101 -> 1111111111011111111111111111111111
-dqor692 or 1111111111101111111111111111111111 1111111111101111111110011111111011 -> 1111111111101111111111111111111111
-dqor693 or 1111111111110111111111111111111111 1111111111110111111110011111110111 -> 1111111111110111111111111111111111
-dqor694 or 1111111111111011111111111111111111 1111111111111011111101101111101111 -> 1111111111111011111111111111111111
-dqor695 or 1111111111111101111111111111111111 1111111111111101111011110111011111 -> 1111111111111101111111111111111111
-dqor696 or 1111111111111110111111111111111111 1111111111111110110111111010111111 -> 1111111111111110111111111111111111
-dqor697 or 1111111111111111011111111111111111 1111111111111111001111111101111111 -> 1111111111111111011111111111111111
-dqor698 or 1111111111111111101111111111111111 1111111111111111001111111010111111 -> 1111111111111111101111111111111111
-dqor699 or 1111111111111111110111111111111111 1111111111111110110111110111011111 -> 1111111111111111110111111111111111
-dqor700 or 1111111111111111111011111111111111 1111111111111101111011101111101111 -> 1111111111111111111011111111111111
-dqor701 or 1111111111111111111101111111111111 1111111111111011111101011111110111 -> 1111111111111111111101111111111111
-dqor702 or 1111111111111111111110111111111111 1111111111110111111110111111111011 -> 1111111111111111111110111111111111
-dqor703 or 1111111111111111111111011111111111 1111111111101111111101011111111101 -> 1111111111111111111111011111111111
-dqor704 or 1111111111111111111111101111111111 1111111111011111111011101111111110 -> 1111111111111111111111101111111111
-dqor705 or 1111111111111111111111110111111111 0111111110111111110111110111111111 -> 1111111111111111111111110111111111
-dqor706 or 1111111111111111111111111011111111 1011111101111111101111111011111111 -> 1111111111111111111111111011111111
-dqor707 or 1111111111111111111111111101111111 1101111011111111011111111101111111 -> 1111111111111111111111111101111111
-dqor708 or 1111111111111111111111111110111111 1110110111111110111111111110111111 -> 1111111111111111111111111110111111
-dqor709 or 1111111111111111111111111111011111 1111001111111101111111111111011111 -> 1111111111111111111111111111011111
-dqor710 or 1111111111111111111111111111101111 1111001111111011111111111111101111 -> 1111111111111111111111111111101111
-dqor711 or 1111111111111111111111111111110111 1110110111110111111111111111110111 -> 1111111111111111111111111111110111
-dqor712 or 1111111111111111111111111111111011 1101111011101111111111111111111011 -> 1111111111111111111111111111111011
-dqor713 or 1111111111111111111111111111111101 1011111101011111111111111111111101 -> 1111111111111111111111111111111101
-dqor714 or 1111111111111111111111111111111110 0111111110111111111111111111111110 -> 1111111111111111111111111111111110
-
-
-
--- 1234567890123456 1234567890123456 1234567890123456
-dqor020 or 1111111111111111 1111111111111111 -> 1111111111111111
-dqor021 or 111111111111111 111111111111111 -> 111111111111111
-dqor022 or 11111111111111 11111111111111 -> 11111111111111
-dqor023 or 1111111111111 1111111111111 -> 1111111111111
-dqor024 or 111111111111 111111111111 -> 111111111111
-dqor025 or 11111111111 11111111111 -> 11111111111
-dqor026 or 1111111111 1111111111 -> 1111111111
-dqor027 or 111111111 111111111 -> 111111111
-dqor028 or 11111111 11111111 -> 11111111
-dqor029 or 1111111 1111111 -> 1111111
-dqor030 or 111111 111111 -> 111111
-dqor031 or 11111 11111 -> 11111
-dqor032 or 1111 1111 -> 1111
-dqor033 or 111 111 -> 111
-dqor034 or 11 11 -> 11
-dqor035 or 1 1 -> 1
-dqor036 or 0 0 -> 0
-
-dqor042 or 111111110000000 1111111110000000 -> 1111111110000000
-dqor043 or 11111110000000 1000000100000000 -> 1011111110000000
-dqor044 or 1111110000000 1000001000000000 -> 1001111110000000
-dqor045 or 111110000000 1000010000000000 -> 1000111110000000
-dqor046 or 11110000000 1000100000000000 -> 1000111110000000
-dqor047 or 1110000000 1001000000000000 -> 1001001110000000
-dqor048 or 110000000 1010000000000000 -> 1010000110000000
-dqor049 or 10000000 1100000000000000 -> 1100000010000000
-
-dqor090 or 011111111 111101111 -> 111111111
-dqor091 or 101111111 111101111 -> 111111111
-dqor092 or 110111111 111101111 -> 111111111
-dqor093 or 111011111 111101111 -> 111111111
-dqor094 or 111101111 111101111 -> 111101111
-dqor095 or 111110111 111101111 -> 111111111
-dqor096 or 111111011 111101111 -> 111111111
-dqor097 or 111111101 111101111 -> 111111111
-dqor098 or 111111110 111101111 -> 111111111
-
-dqor100 or 111101111 011111111 -> 111111111
-dqor101 or 111101111 101111111 -> 111111111
-dqor102 or 111101111 110111111 -> 111111111
-dqor103 or 111101111 111011111 -> 111111111
-dqor104 or 111101111 111101111 -> 111101111
-dqor105 or 111101111 111110111 -> 111111111
-dqor106 or 111101111 111111011 -> 111111111
-dqor107 or 111101111 111111101 -> 111111111
-dqor108 or 111101111 111111110 -> 111111111
-
--- non-0/1 should not be accepted, nor should signs
-dqor220 or 111111112 111111111 -> NaN Invalid_operation
-dqor221 or 333333333 333333333 -> NaN Invalid_operation
-dqor222 or 555555555 555555555 -> NaN Invalid_operation
-dqor223 or 777777777 777777777 -> NaN Invalid_operation
-dqor224 or 999999999 999999999 -> NaN Invalid_operation
-dqor225 or 222222222 999999999 -> NaN Invalid_operation
-dqor226 or 444444444 999999999 -> NaN Invalid_operation
-dqor227 or 666666666 999999999 -> NaN Invalid_operation
-dqor228 or 888888888 999999999 -> NaN Invalid_operation
-dqor229 or 999999999 222222222 -> NaN Invalid_operation
-dqor230 or 999999999 444444444 -> NaN Invalid_operation
-dqor231 or 999999999 666666666 -> NaN Invalid_operation
-dqor232 or 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-dqor240 or 567468689 -934981942 -> NaN Invalid_operation
-dqor241 or 567367689 934981942 -> NaN Invalid_operation
-dqor242 or -631917772 -706014634 -> NaN Invalid_operation
-dqor243 or -756253257 138579234 -> NaN Invalid_operation
-dqor244 or 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-dqor250 or 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqor251 or 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqor252 or 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqor253 or 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqor254 or 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqor255 or 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqor256 or 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqor257 or 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqor258 or 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqor259 or 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqor260 or 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqor261 or 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
-dqor262 or 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqor263 or 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqor264 or 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqor265 or 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
--- test MSD-1
-dqor270 or 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
-dqor271 or 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
-dqor272 or 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
-dqor273 or 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
-dqor274 or 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
-dqor275 or 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
-dqor276 or 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
-dqor277 or 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
--- test LSD
-dqor280 or 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
-dqor281 or 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
-dqor282 or 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
-dqor283 or 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
-dqor284 or 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
-dqor285 or 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
-dqor286 or 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
-dqor287 or 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
--- test Middie
-dqor288 or 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
-dqor289 or 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
-dqor290 or 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
-dqor291 or 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
-dqor292 or 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
-dqor293 or 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
-dqor294 or 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
-dqor295 or 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
--- signs
-dqor296 or -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
-dqor297 or -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
-dqor298 or 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
-dqor299 or 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001111001111001111000011000100
-
--- Nmax, Nmin, Ntiny-like
-dqor331 or 2 9.99999999E+1999 -> NaN Invalid_operation
-dqor332 or 3 1E-1999 -> NaN Invalid_operation
-dqor333 or 4 1.00000000E-1999 -> NaN Invalid_operation
-dqor334 or 5 1E-1009 -> NaN Invalid_operation
-dqor335 or 6 -1E-1009 -> NaN Invalid_operation
-dqor336 or 7 -1.00000000E-1999 -> NaN Invalid_operation
-dqor337 or 8 -1E-1999 -> NaN Invalid_operation
-dqor338 or 9 -9.99999999E+1999 -> NaN Invalid_operation
-dqor341 or 9.99999999E+2999 -18 -> NaN Invalid_operation
-dqor342 or 1E-2999 01 -> NaN Invalid_operation
-dqor343 or 1.00000000E-2999 -18 -> NaN Invalid_operation
-dqor344 or 1E-1009 18 -> NaN Invalid_operation
-dqor345 or -1E-1009 -10 -> NaN Invalid_operation
-dqor346 or -1.00000000E-2999 18 -> NaN Invalid_operation
-dqor347 or -1E-2999 10 -> NaN Invalid_operation
-dqor348 or -9.99999999E+2999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-dqor361 or 1.0 1 -> NaN Invalid_operation
-dqor362 or 1E+1 1 -> NaN Invalid_operation
-dqor363 or 0.0 1 -> NaN Invalid_operation
-dqor364 or 0E+1 1 -> NaN Invalid_operation
-dqor365 or 9.9 1 -> NaN Invalid_operation
-dqor366 or 9E+1 1 -> NaN Invalid_operation
-dqor371 or 0 1.0 -> NaN Invalid_operation
-dqor372 or 0 1E+1 -> NaN Invalid_operation
-dqor373 or 0 0.0 -> NaN Invalid_operation
-dqor374 or 0 0E+1 -> NaN Invalid_operation
-dqor375 or 0 9.9 -> NaN Invalid_operation
-dqor376 or 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-dqor780 or -Inf -Inf -> NaN Invalid_operation
-dqor781 or -Inf -1000 -> NaN Invalid_operation
-dqor782 or -Inf -1 -> NaN Invalid_operation
-dqor783 or -Inf -0 -> NaN Invalid_operation
-dqor784 or -Inf 0 -> NaN Invalid_operation
-dqor785 or -Inf 1 -> NaN Invalid_operation
-dqor786 or -Inf 1000 -> NaN Invalid_operation
-dqor787 or -1000 -Inf -> NaN Invalid_operation
-dqor788 or -Inf -Inf -> NaN Invalid_operation
-dqor789 or -1 -Inf -> NaN Invalid_operation
-dqor790 or -0 -Inf -> NaN Invalid_operation
-dqor791 or 0 -Inf -> NaN Invalid_operation
-dqor792 or 1 -Inf -> NaN Invalid_operation
-dqor793 or 1000 -Inf -> NaN Invalid_operation
-dqor794 or Inf -Inf -> NaN Invalid_operation
-
-dqor800 or Inf -Inf -> NaN Invalid_operation
-dqor801 or Inf -1000 -> NaN Invalid_operation
-dqor802 or Inf -1 -> NaN Invalid_operation
-dqor803 or Inf -0 -> NaN Invalid_operation
-dqor804 or Inf 0 -> NaN Invalid_operation
-dqor805 or Inf 1 -> NaN Invalid_operation
-dqor806 or Inf 1000 -> NaN Invalid_operation
-dqor807 or Inf Inf -> NaN Invalid_operation
-dqor808 or -1000 Inf -> NaN Invalid_operation
-dqor809 or -Inf Inf -> NaN Invalid_operation
-dqor810 or -1 Inf -> NaN Invalid_operation
-dqor811 or -0 Inf -> NaN Invalid_operation
-dqor812 or 0 Inf -> NaN Invalid_operation
-dqor813 or 1 Inf -> NaN Invalid_operation
-dqor814 or 1000 Inf -> NaN Invalid_operation
-dqor815 or Inf Inf -> NaN Invalid_operation
-
-dqor821 or NaN -Inf -> NaN Invalid_operation
-dqor822 or NaN -1000 -> NaN Invalid_operation
-dqor823 or NaN -1 -> NaN Invalid_operation
-dqor824 or NaN -0 -> NaN Invalid_operation
-dqor825 or NaN 0 -> NaN Invalid_operation
-dqor826 or NaN 1 -> NaN Invalid_operation
-dqor827 or NaN 1000 -> NaN Invalid_operation
-dqor828 or NaN Inf -> NaN Invalid_operation
-dqor829 or NaN NaN -> NaN Invalid_operation
-dqor830 or -Inf NaN -> NaN Invalid_operation
-dqor831 or -1000 NaN -> NaN Invalid_operation
-dqor832 or -1 NaN -> NaN Invalid_operation
-dqor833 or -0 NaN -> NaN Invalid_operation
-dqor834 or 0 NaN -> NaN Invalid_operation
-dqor835 or 1 NaN -> NaN Invalid_operation
-dqor836 or 1000 NaN -> NaN Invalid_operation
-dqor837 or Inf NaN -> NaN Invalid_operation
-
-dqor841 or sNaN -Inf -> NaN Invalid_operation
-dqor842 or sNaN -1000 -> NaN Invalid_operation
-dqor843 or sNaN -1 -> NaN Invalid_operation
-dqor844 or sNaN -0 -> NaN Invalid_operation
-dqor845 or sNaN 0 -> NaN Invalid_operation
-dqor846 or sNaN 1 -> NaN Invalid_operation
-dqor847 or sNaN 1000 -> NaN Invalid_operation
-dqor848 or sNaN NaN -> NaN Invalid_operation
-dqor849 or sNaN sNaN -> NaN Invalid_operation
-dqor850 or NaN sNaN -> NaN Invalid_operation
-dqor851 or -Inf sNaN -> NaN Invalid_operation
-dqor852 or -1000 sNaN -> NaN Invalid_operation
-dqor853 or -1 sNaN -> NaN Invalid_operation
-dqor854 or -0 sNaN -> NaN Invalid_operation
-dqor855 or 0 sNaN -> NaN Invalid_operation
-dqor856 or 1 sNaN -> NaN Invalid_operation
-dqor857 or 1000 sNaN -> NaN Invalid_operation
-dqor858 or Inf sNaN -> NaN Invalid_operation
-dqor859 or NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqor861 or NaN1 -Inf -> NaN Invalid_operation
-dqor862 or +NaN2 -1000 -> NaN Invalid_operation
-dqor863 or NaN3 1000 -> NaN Invalid_operation
-dqor864 or NaN4 Inf -> NaN Invalid_operation
-dqor865 or NaN5 +NaN6 -> NaN Invalid_operation
-dqor866 or -Inf NaN7 -> NaN Invalid_operation
-dqor867 or -1000 NaN8 -> NaN Invalid_operation
-dqor868 or 1000 NaN9 -> NaN Invalid_operation
-dqor869 or Inf +NaN10 -> NaN Invalid_operation
-dqor871 or sNaN11 -Inf -> NaN Invalid_operation
-dqor872 or sNaN12 -1000 -> NaN Invalid_operation
-dqor873 or sNaN13 1000 -> NaN Invalid_operation
-dqor874 or sNaN14 NaN17 -> NaN Invalid_operation
-dqor875 or sNaN15 sNaN18 -> NaN Invalid_operation
-dqor876 or NaN16 sNaN19 -> NaN Invalid_operation
-dqor877 or -Inf +sNaN20 -> NaN Invalid_operation
-dqor878 or -1000 sNaN21 -> NaN Invalid_operation
-dqor879 or 1000 sNaN22 -> NaN Invalid_operation
-dqor880 or Inf sNaN23 -> NaN Invalid_operation
-dqor881 or +NaN25 +sNaN24 -> NaN Invalid_operation
-dqor882 or -NaN26 NaN28 -> NaN Invalid_operation
-dqor883 or -sNaN27 sNaN29 -> NaN Invalid_operation
-dqor884 or 1000 -NaN30 -> NaN Invalid_operation
-dqor885 or 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqOr.decTest -- digitwise logical OR for decQuads --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check (truth table)
+dqor001 or 0 0 -> 0
+dqor002 or 0 1 -> 1
+dqor003 or 1 0 -> 1
+dqor004 or 1 1 -> 1
+dqor005 or 1100 1010 -> 1110
+-- and at msd and msd-1
+dqor006 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqor007 or 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqor008 or 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqor009 or 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqor010 or 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqor011 or 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
+dqor012 or 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000
+dqor013 or 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
+
+-- Various lengths
+dqor601 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111
+dqor602 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111
+dqor603 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111
+dqor604 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111
+dqor605 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111
+dqor606 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111
+dqor607 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111
+dqor608 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111
+dqor609 or 1111111101111111111111111111111111 1111111111111111111111111011111111 -> 1111111111111111111111111111111111
+dqor610 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111
+dqor611 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111
+dqor612 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111
+dqor613 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111
+dqor614 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111
+dqor615 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111
+dqor616 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111
+dqor617 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111
+dqor618 or 1111111111111111101111111111111111 1111111111111111011111111111111111 -> 1111111111111111111111111111111111
+dqor619 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111
+dqor620 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111
+dqor621 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111
+dqor622 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111
+dqor623 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111
+dqor624 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111
+dqor625 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111
+dqor626 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111
+dqor627 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111
+dqor628 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor629 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor630 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor631 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor632 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor633 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor634 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111
+
+dqor641 or 1111111111111111111111111111111110 0111111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor642 or 1111111111111111111111111111111101 1011111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor643 or 1111111111111111111111111111111011 1101111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor644 or 1111111111111111111111111111110111 1110111111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor645 or 1111111111111111111111111111101111 1111011111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor646 or 1111111111111111111111111111011111 1111101111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor647 or 1111111111111111111111111110111111 1111110111111111111111111111111111 -> 1111111111111111111111111111111111
+dqor648 or 1111111111111111111111111101111111 1111111011111111111111111111111111 -> 1111111111111111111111111111111111
+dqor649 or 1111111111111111111111111011111111 1111111101111111111111111111111111 -> 1111111111111111111111111111111111
+dqor650 or 1111111111111111111111110111111111 1111111110111111111111111111111111 -> 1111111111111111111111111111111111
+dqor651 or 1111111111111111111111101111111111 1111111111011111111111111111111111 -> 1111111111111111111111111111111111
+dqor652 or 1111111111111111111111011111111111 1111111111101111111111111111111111 -> 1111111111111111111111111111111111
+dqor653 or 1111111111111111111110111111111111 1111111111110111111111111111111111 -> 1111111111111111111111111111111111
+dqor654 or 1111111111111111111101111111111111 1111111111111011111111111111111111 -> 1111111111111111111111111111111111
+dqor655 or 1111111111111111111011111111111111 1111111111111101111111111111111111 -> 1111111111111111111111111111111111
+dqor656 or 1111111111111111110111111111111111 1111111111111110111111111111111111 -> 1111111111111111111111111111111111
+dqor657 or 1010101010101010101010101010101010 1010101010101010001010101010101010 -> 1010101010101010101010101010101010
+dqor658 or 1111111111111111011111111111111111 1111111111111111101111111111111111 -> 1111111111111111111111111111111111
+dqor659 or 1111111111111110111111111111111111 1111111111111111110111111111111111 -> 1111111111111111111111111111111111
+dqor660 or 1111111111111101111111111111111111 1111111111111111111011111111111111 -> 1111111111111111111111111111111111
+dqor661 or 1111111111111011111111111111111111 1111111111111111111101111111111111 -> 1111111111111111111111111111111111
+dqor662 or 1111111111110111111111111111111111 1111111111111111111110111111111111 -> 1111111111111111111111111111111111
+dqor663 or 1111111111101111111111111111111111 1111111111111111111111011111111111 -> 1111111111111111111111111111111111
+dqor664 or 1111111111011111111111111111111111 1111111111111111111111101111111111 -> 1111111111111111111111111111111111
+dqor665 or 1111111110111111111111111111111111 1111111111111111111111110111111111 -> 1111111111111111111111111111111111
+dqor666 or 0101010101010101010101010101010101 0101010101010101010101010001010101 -> 101010101010101010101010101010101
+dqor667 or 1111111011111111111111111111111111 1111111111111111111111111101111111 -> 1111111111111111111111111111111111
+dqor668 or 1111110111111111111111111111111111 1111111111111111111111111110111111 -> 1111111111111111111111111111111111
+dqor669 or 1111101111111111111111111111111111 1111111111111111111111111111011111 -> 1111111111111111111111111111111111
+dqor670 or 1111011111111111111111111111111111 1111111111111111111111111111101111 -> 1111111111111111111111111111111111
+dqor671 or 1110111111111111111111111111111111 1111111111111111111111111111110111 -> 1111111111111111111111111111111111
+dqor672 or 1101111111111111111111111111111111 1111111111111111111111111111111011 -> 1111111111111111111111111111111111
+dqor673 or 1011111111111111111111111111111111 1111111111111111111111111111111101 -> 1111111111111111111111111111111111
+dqor674 or 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1111111111111111111111111111111111
+dqor675 or 0111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
+dqor676 or 1111111111111111111111111111111110 1111111111111111111111111111111110 -> 1111111111111111111111111111111110
+
+dqor681 or 0111111111111111111111111111111111 0111111111011111111111111111111110 -> 111111111111111111111111111111111
+dqor682 or 1011111111111111111111111111111111 1011111110101111111111111111111101 -> 1011111111111111111111111111111111
+dqor683 or 1101111111111111111111111111111111 1101111101110111111111111111111011 -> 1101111111111111111111111111111111
+dqor684 or 1110111111111111111111111111111111 1110111011111011111111111111110111 -> 1110111111111111111111111111111111
+dqor685 or 1111011111111111111111111111111111 1111010111111101111111111111101111 -> 1111011111111111111111111111111111
+dqor686 or 1111101111111111111111111111111111 1111101111111110111111111111011111 -> 1111101111111111111111111111111111
+dqor687 or 1111110111111111111111111111111111 1111010111111111011111111110111111 -> 1111110111111111111111111111111111
+dqor688 or 1111111011111111111111111111111111 1110111011111111101111111101111111 -> 1111111011111111111111111111111111
+dqor689 or 1111111101111111111111111111111111 1101111101111111110111111011111111 -> 1111111101111111111111111111111111
+dqor690 or 1111111110111111111111111111111111 1011111110111111111011110111111110 -> 1111111110111111111111111111111111
+dqor691 or 1111111111011111111111111111111111 0111111111011111111101101111111101 -> 1111111111011111111111111111111111
+dqor692 or 1111111111101111111111111111111111 1111111111101111111110011111111011 -> 1111111111101111111111111111111111
+dqor693 or 1111111111110111111111111111111111 1111111111110111111110011111110111 -> 1111111111110111111111111111111111
+dqor694 or 1111111111111011111111111111111111 1111111111111011111101101111101111 -> 1111111111111011111111111111111111
+dqor695 or 1111111111111101111111111111111111 1111111111111101111011110111011111 -> 1111111111111101111111111111111111
+dqor696 or 1111111111111110111111111111111111 1111111111111110110111111010111111 -> 1111111111111110111111111111111111
+dqor697 or 1111111111111111011111111111111111 1111111111111111001111111101111111 -> 1111111111111111011111111111111111
+dqor698 or 1111111111111111101111111111111111 1111111111111111001111111010111111 -> 1111111111111111101111111111111111
+dqor699 or 1111111111111111110111111111111111 1111111111111110110111110111011111 -> 1111111111111111110111111111111111
+dqor700 or 1111111111111111111011111111111111 1111111111111101111011101111101111 -> 1111111111111111111011111111111111
+dqor701 or 1111111111111111111101111111111111 1111111111111011111101011111110111 -> 1111111111111111111101111111111111
+dqor702 or 1111111111111111111110111111111111 1111111111110111111110111111111011 -> 1111111111111111111110111111111111
+dqor703 or 1111111111111111111111011111111111 1111111111101111111101011111111101 -> 1111111111111111111111011111111111
+dqor704 or 1111111111111111111111101111111111 1111111111011111111011101111111110 -> 1111111111111111111111101111111111
+dqor705 or 1111111111111111111111110111111111 0111111110111111110111110111111111 -> 1111111111111111111111110111111111
+dqor706 or 1111111111111111111111111011111111 1011111101111111101111111011111111 -> 1111111111111111111111111011111111
+dqor707 or 1111111111111111111111111101111111 1101111011111111011111111101111111 -> 1111111111111111111111111101111111
+dqor708 or 1111111111111111111111111110111111 1110110111111110111111111110111111 -> 1111111111111111111111111110111111
+dqor709 or 1111111111111111111111111111011111 1111001111111101111111111111011111 -> 1111111111111111111111111111011111
+dqor710 or 1111111111111111111111111111101111 1111001111111011111111111111101111 -> 1111111111111111111111111111101111
+dqor711 or 1111111111111111111111111111110111 1110110111110111111111111111110111 -> 1111111111111111111111111111110111
+dqor712 or 1111111111111111111111111111111011 1101111011101111111111111111111011 -> 1111111111111111111111111111111011
+dqor713 or 1111111111111111111111111111111101 1011111101011111111111111111111101 -> 1111111111111111111111111111111101
+dqor714 or 1111111111111111111111111111111110 0111111110111111111111111111111110 -> 1111111111111111111111111111111110
+
+
+
+-- 1234567890123456 1234567890123456 1234567890123456
+dqor020 or 1111111111111111 1111111111111111 -> 1111111111111111
+dqor021 or 111111111111111 111111111111111 -> 111111111111111
+dqor022 or 11111111111111 11111111111111 -> 11111111111111
+dqor023 or 1111111111111 1111111111111 -> 1111111111111
+dqor024 or 111111111111 111111111111 -> 111111111111
+dqor025 or 11111111111 11111111111 -> 11111111111
+dqor026 or 1111111111 1111111111 -> 1111111111
+dqor027 or 111111111 111111111 -> 111111111
+dqor028 or 11111111 11111111 -> 11111111
+dqor029 or 1111111 1111111 -> 1111111
+dqor030 or 111111 111111 -> 111111
+dqor031 or 11111 11111 -> 11111
+dqor032 or 1111 1111 -> 1111
+dqor033 or 111 111 -> 111
+dqor034 or 11 11 -> 11
+dqor035 or 1 1 -> 1
+dqor036 or 0 0 -> 0
+
+dqor042 or 111111110000000 1111111110000000 -> 1111111110000000
+dqor043 or 11111110000000 1000000100000000 -> 1011111110000000
+dqor044 or 1111110000000 1000001000000000 -> 1001111110000000
+dqor045 or 111110000000 1000010000000000 -> 1000111110000000
+dqor046 or 11110000000 1000100000000000 -> 1000111110000000
+dqor047 or 1110000000 1001000000000000 -> 1001001110000000
+dqor048 or 110000000 1010000000000000 -> 1010000110000000
+dqor049 or 10000000 1100000000000000 -> 1100000010000000
+
+dqor090 or 011111111 111101111 -> 111111111
+dqor091 or 101111111 111101111 -> 111111111
+dqor092 or 110111111 111101111 -> 111111111
+dqor093 or 111011111 111101111 -> 111111111
+dqor094 or 111101111 111101111 -> 111101111
+dqor095 or 111110111 111101111 -> 111111111
+dqor096 or 111111011 111101111 -> 111111111
+dqor097 or 111111101 111101111 -> 111111111
+dqor098 or 111111110 111101111 -> 111111111
+
+dqor100 or 111101111 011111111 -> 111111111
+dqor101 or 111101111 101111111 -> 111111111
+dqor102 or 111101111 110111111 -> 111111111
+dqor103 or 111101111 111011111 -> 111111111
+dqor104 or 111101111 111101111 -> 111101111
+dqor105 or 111101111 111110111 -> 111111111
+dqor106 or 111101111 111111011 -> 111111111
+dqor107 or 111101111 111111101 -> 111111111
+dqor108 or 111101111 111111110 -> 111111111
+
+-- non-0/1 should not be accepted, nor should signs
+dqor220 or 111111112 111111111 -> NaN Invalid_operation
+dqor221 or 333333333 333333333 -> NaN Invalid_operation
+dqor222 or 555555555 555555555 -> NaN Invalid_operation
+dqor223 or 777777777 777777777 -> NaN Invalid_operation
+dqor224 or 999999999 999999999 -> NaN Invalid_operation
+dqor225 or 222222222 999999999 -> NaN Invalid_operation
+dqor226 or 444444444 999999999 -> NaN Invalid_operation
+dqor227 or 666666666 999999999 -> NaN Invalid_operation
+dqor228 or 888888888 999999999 -> NaN Invalid_operation
+dqor229 or 999999999 222222222 -> NaN Invalid_operation
+dqor230 or 999999999 444444444 -> NaN Invalid_operation
+dqor231 or 999999999 666666666 -> NaN Invalid_operation
+dqor232 or 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+dqor240 or 567468689 -934981942 -> NaN Invalid_operation
+dqor241 or 567367689 934981942 -> NaN Invalid_operation
+dqor242 or -631917772 -706014634 -> NaN Invalid_operation
+dqor243 or -756253257 138579234 -> NaN Invalid_operation
+dqor244 or 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+dqor250 or 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqor251 or 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqor252 or 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqor253 or 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqor254 or 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqor255 or 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqor256 or 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqor257 or 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqor258 or 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqor259 or 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqor260 or 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqor261 or 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+dqor262 or 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqor263 or 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqor264 or 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqor265 or 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+-- test MSD-1
+dqor270 or 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
+dqor271 or 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
+dqor272 or 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
+dqor273 or 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
+dqor274 or 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
+dqor275 or 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
+dqor276 or 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
+dqor277 or 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
+-- test LSD
+dqor280 or 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
+dqor281 or 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
+dqor282 or 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
+dqor283 or 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
+dqor284 or 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
+dqor285 or 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
+dqor286 or 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
+dqor287 or 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
+-- test Middie
+dqor288 or 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
+dqor289 or 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
+dqor290 or 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
+dqor291 or 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
+dqor292 or 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
+dqor293 or 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
+dqor294 or 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
+dqor295 or 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
+-- signs
+dqor296 or -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
+dqor297 or -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
+dqor298 or 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
+dqor299 or 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001111001111001111000011000100
+
+-- Nmax, Nmin, Ntiny-like
+dqor331 or 2 9.99999999E+1999 -> NaN Invalid_operation
+dqor332 or 3 1E-1999 -> NaN Invalid_operation
+dqor333 or 4 1.00000000E-1999 -> NaN Invalid_operation
+dqor334 or 5 1E-1009 -> NaN Invalid_operation
+dqor335 or 6 -1E-1009 -> NaN Invalid_operation
+dqor336 or 7 -1.00000000E-1999 -> NaN Invalid_operation
+dqor337 or 8 -1E-1999 -> NaN Invalid_operation
+dqor338 or 9 -9.99999999E+1999 -> NaN Invalid_operation
+dqor341 or 9.99999999E+2999 -18 -> NaN Invalid_operation
+dqor342 or 1E-2999 01 -> NaN Invalid_operation
+dqor343 or 1.00000000E-2999 -18 -> NaN Invalid_operation
+dqor344 or 1E-1009 18 -> NaN Invalid_operation
+dqor345 or -1E-1009 -10 -> NaN Invalid_operation
+dqor346 or -1.00000000E-2999 18 -> NaN Invalid_operation
+dqor347 or -1E-2999 10 -> NaN Invalid_operation
+dqor348 or -9.99999999E+2999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+dqor361 or 1.0 1 -> NaN Invalid_operation
+dqor362 or 1E+1 1 -> NaN Invalid_operation
+dqor363 or 0.0 1 -> NaN Invalid_operation
+dqor364 or 0E+1 1 -> NaN Invalid_operation
+dqor365 or 9.9 1 -> NaN Invalid_operation
+dqor366 or 9E+1 1 -> NaN Invalid_operation
+dqor371 or 0 1.0 -> NaN Invalid_operation
+dqor372 or 0 1E+1 -> NaN Invalid_operation
+dqor373 or 0 0.0 -> NaN Invalid_operation
+dqor374 or 0 0E+1 -> NaN Invalid_operation
+dqor375 or 0 9.9 -> NaN Invalid_operation
+dqor376 or 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+dqor780 or -Inf -Inf -> NaN Invalid_operation
+dqor781 or -Inf -1000 -> NaN Invalid_operation
+dqor782 or -Inf -1 -> NaN Invalid_operation
+dqor783 or -Inf -0 -> NaN Invalid_operation
+dqor784 or -Inf 0 -> NaN Invalid_operation
+dqor785 or -Inf 1 -> NaN Invalid_operation
+dqor786 or -Inf 1000 -> NaN Invalid_operation
+dqor787 or -1000 -Inf -> NaN Invalid_operation
+dqor788 or -Inf -Inf -> NaN Invalid_operation
+dqor789 or -1 -Inf -> NaN Invalid_operation
+dqor790 or -0 -Inf -> NaN Invalid_operation
+dqor791 or 0 -Inf -> NaN Invalid_operation
+dqor792 or 1 -Inf -> NaN Invalid_operation
+dqor793 or 1000 -Inf -> NaN Invalid_operation
+dqor794 or Inf -Inf -> NaN Invalid_operation
+
+dqor800 or Inf -Inf -> NaN Invalid_operation
+dqor801 or Inf -1000 -> NaN Invalid_operation
+dqor802 or Inf -1 -> NaN Invalid_operation
+dqor803 or Inf -0 -> NaN Invalid_operation
+dqor804 or Inf 0 -> NaN Invalid_operation
+dqor805 or Inf 1 -> NaN Invalid_operation
+dqor806 or Inf 1000 -> NaN Invalid_operation
+dqor807 or Inf Inf -> NaN Invalid_operation
+dqor808 or -1000 Inf -> NaN Invalid_operation
+dqor809 or -Inf Inf -> NaN Invalid_operation
+dqor810 or -1 Inf -> NaN Invalid_operation
+dqor811 or -0 Inf -> NaN Invalid_operation
+dqor812 or 0 Inf -> NaN Invalid_operation
+dqor813 or 1 Inf -> NaN Invalid_operation
+dqor814 or 1000 Inf -> NaN Invalid_operation
+dqor815 or Inf Inf -> NaN Invalid_operation
+
+dqor821 or NaN -Inf -> NaN Invalid_operation
+dqor822 or NaN -1000 -> NaN Invalid_operation
+dqor823 or NaN -1 -> NaN Invalid_operation
+dqor824 or NaN -0 -> NaN Invalid_operation
+dqor825 or NaN 0 -> NaN Invalid_operation
+dqor826 or NaN 1 -> NaN Invalid_operation
+dqor827 or NaN 1000 -> NaN Invalid_operation
+dqor828 or NaN Inf -> NaN Invalid_operation
+dqor829 or NaN NaN -> NaN Invalid_operation
+dqor830 or -Inf NaN -> NaN Invalid_operation
+dqor831 or -1000 NaN -> NaN Invalid_operation
+dqor832 or -1 NaN -> NaN Invalid_operation
+dqor833 or -0 NaN -> NaN Invalid_operation
+dqor834 or 0 NaN -> NaN Invalid_operation
+dqor835 or 1 NaN -> NaN Invalid_operation
+dqor836 or 1000 NaN -> NaN Invalid_operation
+dqor837 or Inf NaN -> NaN Invalid_operation
+
+dqor841 or sNaN -Inf -> NaN Invalid_operation
+dqor842 or sNaN -1000 -> NaN Invalid_operation
+dqor843 or sNaN -1 -> NaN Invalid_operation
+dqor844 or sNaN -0 -> NaN Invalid_operation
+dqor845 or sNaN 0 -> NaN Invalid_operation
+dqor846 or sNaN 1 -> NaN Invalid_operation
+dqor847 or sNaN 1000 -> NaN Invalid_operation
+dqor848 or sNaN NaN -> NaN Invalid_operation
+dqor849 or sNaN sNaN -> NaN Invalid_operation
+dqor850 or NaN sNaN -> NaN Invalid_operation
+dqor851 or -Inf sNaN -> NaN Invalid_operation
+dqor852 or -1000 sNaN -> NaN Invalid_operation
+dqor853 or -1 sNaN -> NaN Invalid_operation
+dqor854 or -0 sNaN -> NaN Invalid_operation
+dqor855 or 0 sNaN -> NaN Invalid_operation
+dqor856 or 1 sNaN -> NaN Invalid_operation
+dqor857 or 1000 sNaN -> NaN Invalid_operation
+dqor858 or Inf sNaN -> NaN Invalid_operation
+dqor859 or NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqor861 or NaN1 -Inf -> NaN Invalid_operation
+dqor862 or +NaN2 -1000 -> NaN Invalid_operation
+dqor863 or NaN3 1000 -> NaN Invalid_operation
+dqor864 or NaN4 Inf -> NaN Invalid_operation
+dqor865 or NaN5 +NaN6 -> NaN Invalid_operation
+dqor866 or -Inf NaN7 -> NaN Invalid_operation
+dqor867 or -1000 NaN8 -> NaN Invalid_operation
+dqor868 or 1000 NaN9 -> NaN Invalid_operation
+dqor869 or Inf +NaN10 -> NaN Invalid_operation
+dqor871 or sNaN11 -Inf -> NaN Invalid_operation
+dqor872 or sNaN12 -1000 -> NaN Invalid_operation
+dqor873 or sNaN13 1000 -> NaN Invalid_operation
+dqor874 or sNaN14 NaN17 -> NaN Invalid_operation
+dqor875 or sNaN15 sNaN18 -> NaN Invalid_operation
+dqor876 or NaN16 sNaN19 -> NaN Invalid_operation
+dqor877 or -Inf +sNaN20 -> NaN Invalid_operation
+dqor878 or -1000 sNaN21 -> NaN Invalid_operation
+dqor879 or 1000 sNaN22 -> NaN Invalid_operation
+dqor880 or Inf sNaN23 -> NaN Invalid_operation
+dqor881 or +NaN25 +sNaN24 -> NaN Invalid_operation
+dqor882 or -NaN26 NaN28 -> NaN Invalid_operation
+dqor883 or -sNaN27 sNaN29 -> NaN Invalid_operation
+dqor884 or 1000 -NaN30 -> NaN Invalid_operation
+dqor885 or 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqPlus.decTest b/Lib/test/decimaltestdata/dqPlus.decTest
index df1a15ca7f..8aecaab796 100644
--- a/Lib/test/decimaltestdata/dqPlus.decTest
+++ b/Lib/test/decimaltestdata/dqPlus.decTest
@@ -1,88 +1,88 @@
-------------------------------------------------------------------------
--- dqPlus.decTest -- decQuad 0+x --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqpls001 plus +7.50 -> 7.50
-
--- Infinities
-dqpls011 plus Infinity -> Infinity
-dqpls012 plus -Infinity -> -Infinity
-
--- NaNs, 0 payload
-ddqls021 plus NaN -> NaN
-ddqls022 plus -NaN -> -NaN
-ddqls023 plus sNaN -> NaN Invalid_operation
-ddqls024 plus -sNaN -> -NaN Invalid_operation
-
--- NaNs, non-0 payload
-ddqls031 plus NaN13 -> NaN13
-ddqls032 plus -NaN13 -> -NaN13
-ddqls033 plus sNaN13 -> NaN13 Invalid_operation
-ddqls034 plus -sNaN13 -> -NaN13 Invalid_operation
-ddqls035 plus NaN70 -> NaN70
-ddqls036 plus -NaN70 -> -NaN70
-ddqls037 plus sNaN101 -> NaN101 Invalid_operation
-ddqls038 plus -sNaN101 -> -NaN101 Invalid_operation
-
--- finites
-dqpls101 plus 7 -> 7
-dqpls102 plus -7 -> -7
-dqpls103 plus 75 -> 75
-dqpls104 plus -75 -> -75
-dqpls105 plus 7.50 -> 7.50
-dqpls106 plus -7.50 -> -7.50
-dqpls107 plus 7.500 -> 7.500
-dqpls108 plus -7.500 -> -7.500
-
--- zeros
-dqpls111 plus 0 -> 0
-dqpls112 plus -0 -> 0
-dqpls113 plus 0E+4 -> 0E+4
-dqpls114 plus -0E+4 -> 0E+4
-dqpls115 plus 0.0000 -> 0.0000
-dqpls116 plus -0.0000 -> 0.0000
-dqpls117 plus 0E-141 -> 0E-141
-dqpls118 plus -0E-141 -> 0E-141
-
--- full coefficients, alternating bits
-dqpls121 plus 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
-dqpls122 plus -2682682682682682682682682682682682 -> -2682682682682682682682682682682682
-dqpls123 plus 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
-dqpls124 plus -1341341341341341341341341341341341 -> -1341341341341341341341341341341341
-
--- Nmax, Nmin, Ntiny
-dqpls131 plus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqpls132 plus 1E-6143 -> 1E-6143
-dqpls133 plus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
-dqpls134 plus 1E-6176 -> 1E-6176 Subnormal
-
-dqpls135 plus -1E-6176 -> -1E-6176 Subnormal
-dqpls136 plus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
-dqpls137 plus -1E-6143 -> -1E-6143
-dqpls138 plus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+------------------------------------------------------------------------
+-- dqPlus.decTest -- decQuad 0+x --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqpls001 plus +7.50 -> 7.50
+
+-- Infinities
+dqpls011 plus Infinity -> Infinity
+dqpls012 plus -Infinity -> -Infinity
+
+-- NaNs, 0 payload
+ddqls021 plus NaN -> NaN
+ddqls022 plus -NaN -> -NaN
+ddqls023 plus sNaN -> NaN Invalid_operation
+ddqls024 plus -sNaN -> -NaN Invalid_operation
+
+-- NaNs, non-0 payload
+ddqls031 plus NaN13 -> NaN13
+ddqls032 plus -NaN13 -> -NaN13
+ddqls033 plus sNaN13 -> NaN13 Invalid_operation
+ddqls034 plus -sNaN13 -> -NaN13 Invalid_operation
+ddqls035 plus NaN70 -> NaN70
+ddqls036 plus -NaN70 -> -NaN70
+ddqls037 plus sNaN101 -> NaN101 Invalid_operation
+ddqls038 plus -sNaN101 -> -NaN101 Invalid_operation
+
+-- finites
+dqpls101 plus 7 -> 7
+dqpls102 plus -7 -> -7
+dqpls103 plus 75 -> 75
+dqpls104 plus -75 -> -75
+dqpls105 plus 7.50 -> 7.50
+dqpls106 plus -7.50 -> -7.50
+dqpls107 plus 7.500 -> 7.500
+dqpls108 plus -7.500 -> -7.500
+
+-- zeros
+dqpls111 plus 0 -> 0
+dqpls112 plus -0 -> 0
+dqpls113 plus 0E+4 -> 0E+4
+dqpls114 plus -0E+4 -> 0E+4
+dqpls115 plus 0.0000 -> 0.0000
+dqpls116 plus -0.0000 -> 0.0000
+dqpls117 plus 0E-141 -> 0E-141
+dqpls118 plus -0E-141 -> 0E-141
+
+-- full coefficients, alternating bits
+dqpls121 plus 2682682682682682682682682682682682 -> 2682682682682682682682682682682682
+dqpls122 plus -2682682682682682682682682682682682 -> -2682682682682682682682682682682682
+dqpls123 plus 1341341341341341341341341341341341 -> 1341341341341341341341341341341341
+dqpls124 plus -1341341341341341341341341341341341 -> -1341341341341341341341341341341341
+
+-- Nmax, Nmin, Ntiny
+dqpls131 plus 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqpls132 plus 1E-6143 -> 1E-6143
+dqpls133 plus 1.000000000000000000000000000000000E-6143 -> 1.000000000000000000000000000000000E-6143
+dqpls134 plus 1E-6176 -> 1E-6176 Subnormal
+
+dqpls135 plus -1E-6176 -> -1E-6176 Subnormal
+dqpls136 plus -1.000000000000000000000000000000000E-6143 -> -1.000000000000000000000000000000000E-6143
+dqpls137 plus -1E-6143 -> -1E-6143
+dqpls138 plus -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
diff --git a/Lib/test/decimaltestdata/dqQuantize.decTest b/Lib/test/decimaltestdata/dqQuantize.decTest
index 4ed39b45c4..51471c2626 100644
--- a/Lib/test/decimaltestdata/dqQuantize.decTest
+++ b/Lib/test/decimaltestdata/dqQuantize.decTest
@@ -1,836 +1,836 @@
-------------------------------------------------------------------------
--- dqQuantize.decTest -- decQuad quantize operation --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Most of the tests here assume a "regular pattern", where the
--- sign and coefficient are +1.
--- 2004.03.15 Underflow for quantize is suppressed
--- 2005.06.08 More extensive tests for 'does not fit'
--- [Forked from quantize.decTest 2006.11.25]
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks
-dqqua001 quantize 0 1e0 -> 0
-dqqua002 quantize 1 1e0 -> 1
-dqqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
-dqqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
-dqqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
-dqqua007 quantize 0.1 1e-1 -> 0.1
-dqqua008 quantize 0.1 1e-2 -> 0.10
-dqqua009 quantize 0.1 1e-3 -> 0.100
-dqqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
-dqqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
-dqqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
-dqqua013 quantize 0.9 1e-1 -> 0.9
-dqqua014 quantize 0.9 1e-2 -> 0.90
-dqqua015 quantize 0.9 1e-3 -> 0.900
--- negatives
-dqqua021 quantize -0 1e0 -> -0
-dqqua022 quantize -1 1e0 -> -1
-dqqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
-dqqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
-dqqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
-dqqua027 quantize -0.1 1e-1 -> -0.1
-dqqua028 quantize -0.1 1e-2 -> -0.10
-dqqua029 quantize -0.1 1e-3 -> -0.100
-dqqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
-dqqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
-dqqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
-dqqua033 quantize -0.9 1e-1 -> -0.9
-dqqua034 quantize -0.9 1e-2 -> -0.90
-dqqua035 quantize -0.9 1e-3 -> -0.900
-dqqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
-dqqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
-dqqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
-dqqua039 quantize -0.5 1e-1 -> -0.5
-dqqua040 quantize -0.5 1e-2 -> -0.50
-dqqua041 quantize -0.5 1e-3 -> -0.500
-dqqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
-dqqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
-dqqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
-dqqua045 quantize -0.9 1e-1 -> -0.9
-dqqua046 quantize -0.9 1e-2 -> -0.90
-dqqua047 quantize -0.9 1e-3 -> -0.900
-
--- examples from Specification
-dqqua060 quantize 2.17 0.001 -> 2.170
-dqqua061 quantize 2.17 0.01 -> 2.17
-dqqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
-dqqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
-dqqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
-dqqua065 quantize -Inf Inf -> -Infinity
-dqqua066 quantize 2 Inf -> NaN Invalid_operation
-dqqua067 quantize -0.1 1 -> -0 Inexact Rounded
-dqqua068 quantize -0 1e+5 -> -0E+5
-dqqua069 quantize +123451234567899876543216789012345.6 1e-2 -> NaN Invalid_operation
-dqqua070 quantize -987651234567899876543214335236450.6 1e-2 -> NaN Invalid_operation
-dqqua071 quantize 217 1e-1 -> 217.0
-dqqua072 quantize 217 1e+0 -> 217
-dqqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
-dqqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
-
--- general tests ..
-dqqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
-dqqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
-dqqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
-dqqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
-dqqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
-dqqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
-dqqua095 quantize 1.2345 1e-6 -> 1.234500
-dqqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
-dqqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
-dqqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
-dqqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
-dqqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
-
-dqqua101 quantize -1 1e0 -> -1
-dqqua102 quantize -1 1e-1 -> -1.0
-dqqua103 quantize -1 1e-2 -> -1.00
-dqqua104 quantize 0 1e0 -> 0
-dqqua105 quantize 0 1e-1 -> 0.0
-dqqua106 quantize 0 1e-2 -> 0.00
-dqqua107 quantize 0.00 1e0 -> 0
-dqqua108 quantize 0 1e+1 -> 0E+1
-dqqua109 quantize 0 1e+2 -> 0E+2
-dqqua110 quantize +1 1e0 -> 1
-dqqua111 quantize +1 1e-1 -> 1.0
-dqqua112 quantize +1 1e-2 -> 1.00
-
-dqqua120 quantize 1.04 1e-3 -> 1.040
-dqqua121 quantize 1.04 1e-2 -> 1.04
-dqqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
-dqqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
-dqqua124 quantize 1.05 1e-3 -> 1.050
-dqqua125 quantize 1.05 1e-2 -> 1.05
-dqqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
-dqqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
-dqqua132 quantize 1.06 1e-3 -> 1.060
-dqqua133 quantize 1.06 1e-2 -> 1.06
-dqqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
-dqqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
-
-dqqua140 quantize -10 1e-2 -> -10.00
-dqqua141 quantize +1 1e-2 -> 1.00
-dqqua142 quantize +10 1e-2 -> 10.00
-dqqua143 quantize 1E+37 1e-2 -> NaN Invalid_operation
-dqqua144 quantize 1E-37 1e-2 -> 0.00 Inexact Rounded
-dqqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
-dqqua146 quantize 1E-2 1e-2 -> 0.01
-dqqua147 quantize 1E-1 1e-2 -> 0.10
-dqqua148 quantize 0E-37 1e-2 -> 0.00
-
-dqqua150 quantize 1.0600 1e-5 -> 1.06000
-dqqua151 quantize 1.0600 1e-4 -> 1.0600
-dqqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
-dqqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
-dqqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
-dqqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
-
--- a couple where rounding was different in base tests
-rounding: half_up
-dqqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
-dqqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
-dqqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
-rounding: half_even
-
--- base tests with non-1 coefficients
-dqqua161 quantize 0 -9e0 -> 0
-dqqua162 quantize 1 -7e0 -> 1
-dqqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
-dqqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
-dqqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
-dqqua167 quantize 0.1 3e-1 -> 0.1
-dqqua168 quantize 0.1 44e-2 -> 0.10
-dqqua169 quantize 0.1 555e-3 -> 0.100
-dqqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
-dqqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
-dqqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
-dqqua173 quantize 0.9 -9e-1 -> 0.9
-dqqua174 quantize 0.9 0e-2 -> 0.90
-dqqua175 quantize 0.9 1.1e-3 -> 0.9000
--- negatives
-dqqua181 quantize -0 1.1e0 -> -0.0
-dqqua182 quantize -1 -1e0 -> -1
-dqqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
-dqqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
-dqqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
-dqqua187 quantize -0.1 -91e-1 -> -0.1
-dqqua188 quantize -0.1 -.1e-2 -> -0.100
-dqqua189 quantize -0.1 -1e-3 -> -0.100
-dqqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
-dqqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
-dqqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
-dqqua193 quantize -0.9 100e-1 -> -0.9
-dqqua194 quantize -0.9 999e-2 -> -0.90
-
--- +ve exponents ..
-dqqua201 quantize -1 1e+0 -> -1
-dqqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
-dqqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
-dqqua204 quantize 0 1e+0 -> 0
-dqqua205 quantize 0 1e+1 -> 0E+1
-dqqua206 quantize 0 1e+2 -> 0E+2
-dqqua207 quantize +1 1e+0 -> 1
-dqqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
-dqqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
-
-dqqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
-dqqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
-dqqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
-dqqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
-dqqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
-dqqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
-dqqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
-dqqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
-dqqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
-dqqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
-dqqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
-dqqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
-dqqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
-dqqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
-dqqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
-dqqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
-
-dqqua240 quantize -10 1e+1 -> -1E+1 Rounded
-dqqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
-dqqua242 quantize +10 1e+1 -> 1E+1 Rounded
-dqqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
-dqqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
-dqqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
-dqqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
-dqqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
-dqqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
-dqqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
-dqqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
-dqqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
--- next one tries to add 9 zeros
-dqqua252 quantize 1E+37 1e+1 -> NaN Invalid_operation
-dqqua253 quantize 1E-37 1e+1 -> 0E+1 Inexact Rounded
-dqqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
-dqqua255 quantize 0E-37 1e+1 -> 0E+1
-dqqua256 quantize -0E-37 1e+1 -> -0E+1
-dqqua257 quantize -0E-1 1e+1 -> -0E+1
-dqqua258 quantize -0 1e+1 -> -0E+1
-dqqua259 quantize -0E+1 1e+1 -> -0E+1
-
-dqqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
-dqqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
-dqqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
-dqqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
-dqqua264 quantize 1E+2 1e+2 -> 1E+2
-dqqua265 quantize 1E+3 1e+2 -> 1.0E+3
-dqqua266 quantize 1E+4 1e+2 -> 1.00E+4
-dqqua267 quantize 1E+5 1e+2 -> 1.000E+5
-dqqua268 quantize 1E+6 1e+2 -> 1.0000E+6
-dqqua269 quantize 1E+7 1e+2 -> 1.00000E+7
-dqqua270 quantize 1E+8 1e+2 -> 1.000000E+8
-dqqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
-dqqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
-dqqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
-dqqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
-dqqua275 quantize 0E-10 1e+2 -> 0E+2
-
-dqqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
-dqqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
-dqqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
-dqqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
-dqqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
-dqqua285 quantize 1E+3 1e+3 -> 1E+3
-dqqua286 quantize 1E+4 1e+3 -> 1.0E+4
-dqqua287 quantize 1E+5 1e+3 -> 1.00E+5
-dqqua288 quantize 1E+6 1e+3 -> 1.000E+6
-dqqua289 quantize 1E+7 1e+3 -> 1.0000E+7
-dqqua290 quantize 1E+8 1e+3 -> 1.00000E+8
-dqqua291 quantize 1E+9 1e+3 -> 1.000000E+9
-dqqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
-dqqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
-dqqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
-dqqua295 quantize 0E-10 1e+3 -> 0E+3
-
--- round up from below [sign wrong in JIT compiler once]
-dqqua300 quantize 0.0078 1e-5 -> 0.00780
-dqqua301 quantize 0.0078 1e-4 -> 0.0078
-dqqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
-dqqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
-dqqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
-dqqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
-dqqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
-dqqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
-
-dqqua310 quantize -0.0078 1e-5 -> -0.00780
-dqqua311 quantize -0.0078 1e-4 -> -0.0078
-dqqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
-dqqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
-dqqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
-dqqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
-dqqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
-dqqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
-
-dqqua320 quantize 0.078 1e-5 -> 0.07800
-dqqua321 quantize 0.078 1e-4 -> 0.0780
-dqqua322 quantize 0.078 1e-3 -> 0.078
-dqqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
-dqqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
-dqqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
-dqqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
-dqqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
-
-dqqua330 quantize -0.078 1e-5 -> -0.07800
-dqqua331 quantize -0.078 1e-4 -> -0.0780
-dqqua332 quantize -0.078 1e-3 -> -0.078
-dqqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
-dqqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
-dqqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
-dqqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
-dqqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
-
-dqqua340 quantize 0.78 1e-5 -> 0.78000
-dqqua341 quantize 0.78 1e-4 -> 0.7800
-dqqua342 quantize 0.78 1e-3 -> 0.780
-dqqua343 quantize 0.78 1e-2 -> 0.78
-dqqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
-dqqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
-dqqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
-dqqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
-
-dqqua350 quantize -0.78 1e-5 -> -0.78000
-dqqua351 quantize -0.78 1e-4 -> -0.7800
-dqqua352 quantize -0.78 1e-3 -> -0.780
-dqqua353 quantize -0.78 1e-2 -> -0.78
-dqqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
-dqqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
-dqqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
-dqqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
-
-dqqua360 quantize 7.8 1e-5 -> 7.80000
-dqqua361 quantize 7.8 1e-4 -> 7.8000
-dqqua362 quantize 7.8 1e-3 -> 7.800
-dqqua363 quantize 7.8 1e-2 -> 7.80
-dqqua364 quantize 7.8 1e-1 -> 7.8
-dqqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
-dqqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
-dqqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
-dqqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
-
-dqqua370 quantize -7.8 1e-5 -> -7.80000
-dqqua371 quantize -7.8 1e-4 -> -7.8000
-dqqua372 quantize -7.8 1e-3 -> -7.800
-dqqua373 quantize -7.8 1e-2 -> -7.80
-dqqua374 quantize -7.8 1e-1 -> -7.8
-dqqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
-dqqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
-dqqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
-dqqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
-
--- some individuals
-dqqua380 quantize 1122334455667788991234567352364.506 1e-2 -> 1122334455667788991234567352364.51 Inexact Rounded
-dqqua381 quantize 11223344556677889912345673523645.06 1e-2 -> 11223344556677889912345673523645.06
-dqqua382 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
-dqqua383 quantize 1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
-dqqua384 quantize -1122334455667788991234567352364.506 1e-2 -> -1122334455667788991234567352364.51 Inexact Rounded
-dqqua385 quantize -11223344556677889912345673523645.06 1e-2 -> -11223344556677889912345673523645.06
-dqqua386 quantize -112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
-dqqua387 quantize -1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
-
-rounding: down
-dqqua389 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
-rounding: half_up
-
--- and a few more from e-mail discussions
-dqqua391 quantize 11223344556677889912345678912.34567 1e-3 -> 11223344556677889912345678912.346 Inexact Rounded
-dqqua392 quantize 112233445566778899123456789123.4567 1e-3 -> 112233445566778899123456789123.457 Inexact Rounded
-dqqua393 quantize 1122334455667788991234567891234567. 1e-3 -> NaN Invalid_operation
-
--- some 9999 round-up cases
-dqqua400 quantize 9.999 1e-5 -> 9.99900
-dqqua401 quantize 9.999 1e-4 -> 9.9990
-dqqua402 quantize 9.999 1e-3 -> 9.999
-dqqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
-dqqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
-dqqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
-dqqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
-dqqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
-
-dqqua410 quantize 0.999 1e-5 -> 0.99900
-dqqua411 quantize 0.999 1e-4 -> 0.9990
-dqqua412 quantize 0.999 1e-3 -> 0.999
-dqqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
-dqqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
-dqqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
-dqqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
-
-dqqua420 quantize 0.0999 1e-5 -> 0.09990
-dqqua421 quantize 0.0999 1e-4 -> 0.0999
-dqqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
-dqqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
-dqqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
-dqqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
-dqqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
-
-dqqua430 quantize 0.00999 1e-5 -> 0.00999
-dqqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
-dqqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
-dqqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
-dqqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
-dqqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
-dqqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
-
-dqqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
-dqqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
-dqqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
-dqqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
-dqqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
-dqqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
-dqqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
-
-dqqua1001 quantize 0.000 0.001 -> 0.000
-dqqua1002 quantize 0.001 0.001 -> 0.001
-dqqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
-dqqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
-dqqua1005 quantize 0.501 0.001 -> 0.501
-dqqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
-dqqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
-dqqua1008 quantize 0.999 0.001 -> 0.999
-
-dqqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
-dqqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
-dqqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
-dqqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
-dqqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
-dqqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
--- a potential double-round
-dqqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
-dqqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
-
-dqqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
-dqqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
-dqqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
-dqqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
-dqqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
-dqqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
-dqqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
-dqqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
-
--- Zeros
-dqqua500 quantize 0 1e1 -> 0E+1
-dqqua501 quantize 0 1e0 -> 0
-dqqua502 quantize 0 1e-1 -> 0.0
-dqqua503 quantize 0.0 1e-1 -> 0.0
-dqqua504 quantize 0.0 1e0 -> 0
-dqqua505 quantize 0.0 1e+1 -> 0E+1
-dqqua506 quantize 0E+1 1e-1 -> 0.0
-dqqua507 quantize 0E+1 1e0 -> 0
-dqqua508 quantize 0E+1 1e+1 -> 0E+1
-dqqua509 quantize -0 1e1 -> -0E+1
-dqqua510 quantize -0 1e0 -> -0
-dqqua511 quantize -0 1e-1 -> -0.0
-dqqua512 quantize -0.0 1e-1 -> -0.0
-dqqua513 quantize -0.0 1e0 -> -0
-dqqua514 quantize -0.0 1e+1 -> -0E+1
-dqqua515 quantize -0E+1 1e-1 -> -0.0
-dqqua516 quantize -0E+1 1e0 -> -0
-dqqua517 quantize -0E+1 1e+1 -> -0E+1
--- #519 here once a problem
-dqqua518 quantize 0 0E-3 -> 0.000
-dqqua519 quantize 0 0E-33 -> 0E-33
-dqqua520 quantize 0.00000000000000000000000000000000 0E-33 -> 0E-33
-dqqua521 quantize 0.000000000000000000000000000000000 0E-33 -> 0E-33
-
--- Some non-zeros with lots of padding on the right
-dqqua523 quantize 1 0E-33 -> 1.000000000000000000000000000000000
-dqqua524 quantize 12 0E-32 -> 12.00000000000000000000000000000000
-dqqua525 quantize 123 0E-31 -> 123.0000000000000000000000000000000
-dqqua526 quantize 123 0E-32 -> NaN Invalid_operation
-dqqua527 quantize 123.4 0E-31 -> 123.4000000000000000000000000000000
-dqqua528 quantize 123.4 0E-32 -> NaN Invalid_operation
-
--- Suspicious RHS values
-dqqua530 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
-dqqua531 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
-dqqua532 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
-dqqua533 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
--- next four are "won't fit" overflows
-dqqua536 quantize 1.234 1e-299 -> NaN Invalid_operation
-dqqua537 quantize 123.456 1e-299 -> NaN Invalid_operation
-dqqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
-dqqua539 quantize 123.456 1e-299 -> NaN Invalid_operation
-
-dqqua542 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
-dqqua543 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
-dqqua544 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
-dqqua547 quantize 0 1e-299 -> 0E-299
--- next two are "won't fit" overflows
-dqqua548 quantize 1.234 1e-299 -> NaN Invalid_operation
-dqqua549 quantize 1.234 1e-300 -> NaN Invalid_operation
--- [more below]
-
--- Specials
-dqqua580 quantize Inf -Inf -> Infinity
-dqqua581 quantize Inf 1e-299 -> NaN Invalid_operation
-dqqua582 quantize Inf 1e-1 -> NaN Invalid_operation
-dqqua583 quantize Inf 1e0 -> NaN Invalid_operation
-dqqua584 quantize Inf 1e1 -> NaN Invalid_operation
-dqqua585 quantize Inf 1e299 -> NaN Invalid_operation
-dqqua586 quantize Inf Inf -> Infinity
-dqqua587 quantize -1000 Inf -> NaN Invalid_operation
-dqqua588 quantize -Inf Inf -> -Infinity
-dqqua589 quantize -1 Inf -> NaN Invalid_operation
-dqqua590 quantize 0 Inf -> NaN Invalid_operation
-dqqua591 quantize 1 Inf -> NaN Invalid_operation
-dqqua592 quantize 1000 Inf -> NaN Invalid_operation
-dqqua593 quantize Inf Inf -> Infinity
-dqqua594 quantize Inf 1e-0 -> NaN Invalid_operation
-dqqua595 quantize -0 Inf -> NaN Invalid_operation
-
-dqqua600 quantize -Inf -Inf -> -Infinity
-dqqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
-dqqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
-dqqua603 quantize -Inf 1e0 -> NaN Invalid_operation
-dqqua604 quantize -Inf 1e1 -> NaN Invalid_operation
-dqqua605 quantize -Inf 1e299 -> NaN Invalid_operation
-dqqua606 quantize -Inf Inf -> -Infinity
-dqqua607 quantize -1000 Inf -> NaN Invalid_operation
-dqqua608 quantize -Inf -Inf -> -Infinity
-dqqua609 quantize -1 -Inf -> NaN Invalid_operation
-dqqua610 quantize 0 -Inf -> NaN Invalid_operation
-dqqua611 quantize 1 -Inf -> NaN Invalid_operation
-dqqua612 quantize 1000 -Inf -> NaN Invalid_operation
-dqqua613 quantize Inf -Inf -> Infinity
-dqqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
-dqqua615 quantize -0 -Inf -> NaN Invalid_operation
-
-dqqua621 quantize NaN -Inf -> NaN
-dqqua622 quantize NaN 1e-299 -> NaN
-dqqua623 quantize NaN 1e-1 -> NaN
-dqqua624 quantize NaN 1e0 -> NaN
-dqqua625 quantize NaN 1e1 -> NaN
-dqqua626 quantize NaN 1e299 -> NaN
-dqqua627 quantize NaN Inf -> NaN
-dqqua628 quantize NaN NaN -> NaN
-dqqua629 quantize -Inf NaN -> NaN
-dqqua630 quantize -1000 NaN -> NaN
-dqqua631 quantize -1 NaN -> NaN
-dqqua632 quantize 0 NaN -> NaN
-dqqua633 quantize 1 NaN -> NaN
-dqqua634 quantize 1000 NaN -> NaN
-dqqua635 quantize Inf NaN -> NaN
-dqqua636 quantize NaN 1e-0 -> NaN
-dqqua637 quantize -0 NaN -> NaN
-
-dqqua641 quantize sNaN -Inf -> NaN Invalid_operation
-dqqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
-dqqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
-dqqua644 quantize sNaN 1e0 -> NaN Invalid_operation
-dqqua645 quantize sNaN 1e1 -> NaN Invalid_operation
-dqqua646 quantize sNaN 1e299 -> NaN Invalid_operation
-dqqua647 quantize sNaN NaN -> NaN Invalid_operation
-dqqua648 quantize sNaN sNaN -> NaN Invalid_operation
-dqqua649 quantize NaN sNaN -> NaN Invalid_operation
-dqqua650 quantize -Inf sNaN -> NaN Invalid_operation
-dqqua651 quantize -1000 sNaN -> NaN Invalid_operation
-dqqua652 quantize -1 sNaN -> NaN Invalid_operation
-dqqua653 quantize 0 sNaN -> NaN Invalid_operation
-dqqua654 quantize 1 sNaN -> NaN Invalid_operation
-dqqua655 quantize 1000 sNaN -> NaN Invalid_operation
-dqqua656 quantize Inf sNaN -> NaN Invalid_operation
-dqqua657 quantize NaN sNaN -> NaN Invalid_operation
-dqqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
-dqqua659 quantize -0 sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqqua661 quantize NaN9 -Inf -> NaN9
-dqqua662 quantize NaN8 919 -> NaN8
-dqqua663 quantize NaN71 Inf -> NaN71
-dqqua664 quantize NaN6 NaN5 -> NaN6
-dqqua665 quantize -Inf NaN4 -> NaN4
-dqqua666 quantize -919 NaN31 -> NaN31
-dqqua667 quantize Inf NaN2 -> NaN2
-
-dqqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
-dqqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
-dqqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
-dqqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
-dqqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
-dqqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
-dqqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
-dqqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
-dqqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
-
-dqqua681 quantize -NaN9 -Inf -> -NaN9
-dqqua682 quantize -NaN8 919 -> -NaN8
-dqqua683 quantize -NaN71 Inf -> -NaN71
-dqqua684 quantize -NaN6 -NaN5 -> -NaN6
-dqqua685 quantize -Inf -NaN4 -> -NaN4
-dqqua686 quantize -919 -NaN31 -> -NaN31
-dqqua687 quantize Inf -NaN2 -> -NaN2
-
-dqqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
-dqqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
-dqqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
-dqqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
-dqqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
-dqqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
-dqqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
-dqqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
-dqqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
-
--- subnormals and underflow
-dqqua710 quantize 1.00E-6143 1e-6143 -> 1E-6143 Rounded
-dqqua711 quantize 0.1E-6143 2e-6144 -> 1E-6144 Subnormal
-dqqua712 quantize 0.10E-6143 3e-6144 -> 1E-6144 Subnormal Rounded
-dqqua713 quantize 0.100E-6143 4e-6144 -> 1E-6144 Subnormal Rounded
-dqqua714 quantize 0.01E-6143 5e-6145 -> 1E-6145 Subnormal
--- next is rounded to Emin
-dqqua715 quantize 0.999E-6143 1e-6143 -> 1E-6143 Inexact Rounded
-dqqua716 quantize 0.099E-6143 10e-6144 -> 1E-6144 Inexact Rounded Subnormal
-
-dqqua717 quantize 0.009E-6143 1e-6145 -> 1E-6145 Inexact Rounded Subnormal
-dqqua718 quantize 0.001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
-dqqua719 quantize 0.0009E-6143 1e-6145 -> 0E-6145 Inexact Rounded
-dqqua720 quantize 0.0001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
-
-dqqua730 quantize -1.00E-6143 1e-6143 -> -1E-6143 Rounded
-dqqua731 quantize -0.1E-6143 1e-6143 -> -0E-6143 Rounded Inexact
-dqqua732 quantize -0.10E-6143 1e-6143 -> -0E-6143 Rounded Inexact
-dqqua733 quantize -0.100E-6143 1e-6143 -> -0E-6143 Rounded Inexact
-dqqua734 quantize -0.01E-6143 1e-6143 -> -0E-6143 Inexact Rounded
--- next is rounded to Emin
-dqqua735 quantize -0.999E-6143 90e-6143 -> -1E-6143 Inexact Rounded
-dqqua736 quantize -0.099E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
-dqqua737 quantize -0.009E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
-dqqua738 quantize -0.001E-6143 -0e-6143 -> -0E-6143 Inexact Rounded
-dqqua739 quantize -0.0001E-6143 0e-6143 -> -0E-6143 Inexact Rounded
-
-dqqua740 quantize -1.00E-6143 1e-6144 -> -1.0E-6143 Rounded
-dqqua741 quantize -0.1E-6143 1e-6144 -> -1E-6144 Subnormal
-dqqua742 quantize -0.10E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
-dqqua743 quantize -0.100E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
-dqqua744 quantize -0.01E-6143 1e-6144 -> -0E-6144 Inexact Rounded
--- next is rounded to Emin
-dqqua745 quantize -0.999E-6143 1e-6144 -> -1.0E-6143 Inexact Rounded
-dqqua746 quantize -0.099E-6143 1e-6144 -> -1E-6144 Inexact Rounded Subnormal
-dqqua747 quantize -0.009E-6143 1e-6144 -> -0E-6144 Inexact Rounded
-dqqua748 quantize -0.001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
-dqqua749 quantize -0.0001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
-
-dqqua750 quantize -1.00E-6143 1e-6145 -> -1.00E-6143
-dqqua751 quantize -0.1E-6143 1e-6145 -> -1.0E-6144 Subnormal
-dqqua752 quantize -0.10E-6143 1e-6145 -> -1.0E-6144 Subnormal
-dqqua753 quantize -0.100E-6143 1e-6145 -> -1.0E-6144 Subnormal Rounded
-dqqua754 quantize -0.01E-6143 1e-6145 -> -1E-6145 Subnormal
--- next is rounded to Emin
-dqqua755 quantize -0.999E-6143 1e-6145 -> -1.00E-6143 Inexact Rounded
-dqqua756 quantize -0.099E-6143 1e-6145 -> -1.0E-6144 Inexact Rounded Subnormal
-dqqua757 quantize -0.009E-6143 1e-6145 -> -1E-6145 Inexact Rounded Subnormal
-dqqua758 quantize -0.001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
-dqqua759 quantize -0.0001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
-
-dqqua760 quantize -1.00E-6143 1e-6146 -> -1.000E-6143
-dqqua761 quantize -0.1E-6143 1e-6146 -> -1.00E-6144 Subnormal
-dqqua762 quantize -0.10E-6143 1e-6146 -> -1.00E-6144 Subnormal
-dqqua763 quantize -0.100E-6143 1e-6146 -> -1.00E-6144 Subnormal
-dqqua764 quantize -0.01E-6143 1e-6146 -> -1.0E-6145 Subnormal
-dqqua765 quantize -0.999E-6143 1e-6146 -> -9.99E-6144 Subnormal
-dqqua766 quantize -0.099E-6143 1e-6146 -> -9.9E-6145 Subnormal
-dqqua767 quantize -0.009E-6143 1e-6146 -> -9E-6146 Subnormal
-dqqua768 quantize -0.001E-6143 1e-6146 -> -1E-6146 Subnormal
-dqqua769 quantize -0.0001E-6143 1e-6146 -> -0E-6146 Inexact Rounded
-
--- More from Fung Lee
--- the next four would appear to be in error, but they are misleading (the
--- operands will be clamped to a lower exponent) and so are omitted
--- dqqua1021 quantize 8.666666666666000E+6144 1.000000000000000E+6144 -> 8.666666666666000000000000000000000E+6144 Clamped
--- dqqua1022 quantize -8.666666666666000E+6144 1.000000000000000E+6144 -> -8.666666666666000000000000000000000E+6144 Clamped
--- dqqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
--- dqqua1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
-
--- Int and uInt32 edge values for testing conversions
-dqqua1040 quantize -2147483646 0 -> -2147483646
-dqqua1041 quantize -2147483647 0 -> -2147483647
-dqqua1042 quantize -2147483648 0 -> -2147483648
-dqqua1043 quantize -2147483649 0 -> -2147483649
-dqqua1044 quantize 2147483646 0 -> 2147483646
-dqqua1045 quantize 2147483647 0 -> 2147483647
-dqqua1046 quantize 2147483648 0 -> 2147483648
-dqqua1047 quantize 2147483649 0 -> 2147483649
-dqqua1048 quantize 4294967294 0 -> 4294967294
-dqqua1049 quantize 4294967295 0 -> 4294967295
-dqqua1050 quantize 4294967296 0 -> 4294967296
-dqqua1051 quantize 4294967297 0 -> 4294967297
-
--- Rounding swathe
-rounding: half_even
-dqqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-dqqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: half_up
-dqqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-dqqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-dqqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: half_down
-dqqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-dqqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-
-rounding: up
-dqqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
-dqqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
-dqqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-dqqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-dqqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-dqqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
-
-rounding: down
-dqqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-dqqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
-dqqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-dqqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
-dqqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
-dqqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
-dqqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
-
-rounding: ceiling
-dqqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
-dqqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
-dqqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
-dqqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
-dqqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
-dqqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
-dqqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
-dqqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
-dqqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
-dqqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
-
-rounding: floor
-dqqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
-dqqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
-dqqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
-dqqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
-dqqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
-dqqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-dqqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
-dqqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
-dqqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
-dqqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
-
-rounding: 05up
-dqqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
-dqqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
-dqqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
-dqqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
-dqqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
-dqqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
-dqqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
-dqqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
-dqqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
-
-dqqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
-dqqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
-dqqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
-dqqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
-dqqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
-dqqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
-dqqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
-dqqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
-dqqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
-
-dqqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
-dqqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
-dqqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
-dqqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
-dqqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
-dqqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
-dqqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
-dqqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
-dqqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
-
-dqqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
-dqqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
-dqqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
-dqqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
-dqqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
-dqqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
-dqqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
-dqqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
-dqqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
-
-dqqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
-dqqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
-dqqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
-dqqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
-dqqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
-dqqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
-dqqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
-dqqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
-dqqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
-
-dqqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
-dqqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
-dqqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
-dqqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
-dqqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
-dqqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
-dqqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
-dqqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
-dqqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
-
--- Null tests
-dqqua998 quantize 10 # -> NaN Invalid_operation
-dqqua999 quantize # 1e10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqQuantize.decTest -- decQuad quantize operation --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Most of the tests here assume a "regular pattern", where the
+-- sign and coefficient are +1.
+-- 2004.03.15 Underflow for quantize is suppressed
+-- 2005.06.08 More extensive tests for 'does not fit'
+-- [Forked from quantize.decTest 2006.11.25]
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks
+dqqua001 quantize 0 1e0 -> 0
+dqqua002 quantize 1 1e0 -> 1
+dqqua003 quantize 0.1 1e+2 -> 0E+2 Inexact Rounded
+dqqua005 quantize 0.1 1e+1 -> 0E+1 Inexact Rounded
+dqqua006 quantize 0.1 1e0 -> 0 Inexact Rounded
+dqqua007 quantize 0.1 1e-1 -> 0.1
+dqqua008 quantize 0.1 1e-2 -> 0.10
+dqqua009 quantize 0.1 1e-3 -> 0.100
+dqqua010 quantize 0.9 1e+2 -> 0E+2 Inexact Rounded
+dqqua011 quantize 0.9 1e+1 -> 0E+1 Inexact Rounded
+dqqua012 quantize 0.9 1e+0 -> 1 Inexact Rounded
+dqqua013 quantize 0.9 1e-1 -> 0.9
+dqqua014 quantize 0.9 1e-2 -> 0.90
+dqqua015 quantize 0.9 1e-3 -> 0.900
+-- negatives
+dqqua021 quantize -0 1e0 -> -0
+dqqua022 quantize -1 1e0 -> -1
+dqqua023 quantize -0.1 1e+2 -> -0E+2 Inexact Rounded
+dqqua025 quantize -0.1 1e+1 -> -0E+1 Inexact Rounded
+dqqua026 quantize -0.1 1e0 -> -0 Inexact Rounded
+dqqua027 quantize -0.1 1e-1 -> -0.1
+dqqua028 quantize -0.1 1e-2 -> -0.10
+dqqua029 quantize -0.1 1e-3 -> -0.100
+dqqua030 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
+dqqua031 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
+dqqua032 quantize -0.9 1e+0 -> -1 Inexact Rounded
+dqqua033 quantize -0.9 1e-1 -> -0.9
+dqqua034 quantize -0.9 1e-2 -> -0.90
+dqqua035 quantize -0.9 1e-3 -> -0.900
+dqqua036 quantize -0.5 1e+2 -> -0E+2 Inexact Rounded
+dqqua037 quantize -0.5 1e+1 -> -0E+1 Inexact Rounded
+dqqua038 quantize -0.5 1e+0 -> -0 Inexact Rounded
+dqqua039 quantize -0.5 1e-1 -> -0.5
+dqqua040 quantize -0.5 1e-2 -> -0.50
+dqqua041 quantize -0.5 1e-3 -> -0.500
+dqqua042 quantize -0.9 1e+2 -> -0E+2 Inexact Rounded
+dqqua043 quantize -0.9 1e+1 -> -0E+1 Inexact Rounded
+dqqua044 quantize -0.9 1e+0 -> -1 Inexact Rounded
+dqqua045 quantize -0.9 1e-1 -> -0.9
+dqqua046 quantize -0.9 1e-2 -> -0.90
+dqqua047 quantize -0.9 1e-3 -> -0.900
+
+-- examples from Specification
+dqqua060 quantize 2.17 0.001 -> 2.170
+dqqua061 quantize 2.17 0.01 -> 2.17
+dqqua062 quantize 2.17 0.1 -> 2.2 Inexact Rounded
+dqqua063 quantize 2.17 1e+0 -> 2 Inexact Rounded
+dqqua064 quantize 2.17 1e+1 -> 0E+1 Inexact Rounded
+dqqua065 quantize -Inf Inf -> -Infinity
+dqqua066 quantize 2 Inf -> NaN Invalid_operation
+dqqua067 quantize -0.1 1 -> -0 Inexact Rounded
+dqqua068 quantize -0 1e+5 -> -0E+5
+dqqua069 quantize +123451234567899876543216789012345.6 1e-2 -> NaN Invalid_operation
+dqqua070 quantize -987651234567899876543214335236450.6 1e-2 -> NaN Invalid_operation
+dqqua071 quantize 217 1e-1 -> 217.0
+dqqua072 quantize 217 1e+0 -> 217
+dqqua073 quantize 217 1e+1 -> 2.2E+2 Inexact Rounded
+dqqua074 quantize 217 1e+2 -> 2E+2 Inexact Rounded
+
+-- general tests ..
+dqqua089 quantize 12 1e+4 -> 0E+4 Inexact Rounded
+dqqua090 quantize 12 1e+3 -> 0E+3 Inexact Rounded
+dqqua091 quantize 12 1e+2 -> 0E+2 Inexact Rounded
+dqqua092 quantize 12 1e+1 -> 1E+1 Inexact Rounded
+dqqua093 quantize 1.2345 1e-2 -> 1.23 Inexact Rounded
+dqqua094 quantize 1.2355 1e-2 -> 1.24 Inexact Rounded
+dqqua095 quantize 1.2345 1e-6 -> 1.234500
+dqqua096 quantize 9.9999 1e-2 -> 10.00 Inexact Rounded
+dqqua097 quantize 0.0001 1e-2 -> 0.00 Inexact Rounded
+dqqua098 quantize 0.001 1e-2 -> 0.00 Inexact Rounded
+dqqua099 quantize 0.009 1e-2 -> 0.01 Inexact Rounded
+dqqua100 quantize 92 1e+2 -> 1E+2 Inexact Rounded
+
+dqqua101 quantize -1 1e0 -> -1
+dqqua102 quantize -1 1e-1 -> -1.0
+dqqua103 quantize -1 1e-2 -> -1.00
+dqqua104 quantize 0 1e0 -> 0
+dqqua105 quantize 0 1e-1 -> 0.0
+dqqua106 quantize 0 1e-2 -> 0.00
+dqqua107 quantize 0.00 1e0 -> 0
+dqqua108 quantize 0 1e+1 -> 0E+1
+dqqua109 quantize 0 1e+2 -> 0E+2
+dqqua110 quantize +1 1e0 -> 1
+dqqua111 quantize +1 1e-1 -> 1.0
+dqqua112 quantize +1 1e-2 -> 1.00
+
+dqqua120 quantize 1.04 1e-3 -> 1.040
+dqqua121 quantize 1.04 1e-2 -> 1.04
+dqqua122 quantize 1.04 1e-1 -> 1.0 Inexact Rounded
+dqqua123 quantize 1.04 1e0 -> 1 Inexact Rounded
+dqqua124 quantize 1.05 1e-3 -> 1.050
+dqqua125 quantize 1.05 1e-2 -> 1.05
+dqqua126 quantize 1.05 1e-1 -> 1.0 Inexact Rounded
+dqqua131 quantize 1.05 1e0 -> 1 Inexact Rounded
+dqqua132 quantize 1.06 1e-3 -> 1.060
+dqqua133 quantize 1.06 1e-2 -> 1.06
+dqqua134 quantize 1.06 1e-1 -> 1.1 Inexact Rounded
+dqqua135 quantize 1.06 1e0 -> 1 Inexact Rounded
+
+dqqua140 quantize -10 1e-2 -> -10.00
+dqqua141 quantize +1 1e-2 -> 1.00
+dqqua142 quantize +10 1e-2 -> 10.00
+dqqua143 quantize 1E+37 1e-2 -> NaN Invalid_operation
+dqqua144 quantize 1E-37 1e-2 -> 0.00 Inexact Rounded
+dqqua145 quantize 1E-3 1e-2 -> 0.00 Inexact Rounded
+dqqua146 quantize 1E-2 1e-2 -> 0.01
+dqqua147 quantize 1E-1 1e-2 -> 0.10
+dqqua148 quantize 0E-37 1e-2 -> 0.00
+
+dqqua150 quantize 1.0600 1e-5 -> 1.06000
+dqqua151 quantize 1.0600 1e-4 -> 1.0600
+dqqua152 quantize 1.0600 1e-3 -> 1.060 Rounded
+dqqua153 quantize 1.0600 1e-2 -> 1.06 Rounded
+dqqua154 quantize 1.0600 1e-1 -> 1.1 Inexact Rounded
+dqqua155 quantize 1.0600 1e0 -> 1 Inexact Rounded
+
+-- a couple where rounding was different in base tests
+rounding: half_up
+dqqua157 quantize -0.5 1e+0 -> -1 Inexact Rounded
+dqqua158 quantize 1.05 1e-1 -> 1.1 Inexact Rounded
+dqqua159 quantize 1.06 1e0 -> 1 Inexact Rounded
+rounding: half_even
+
+-- base tests with non-1 coefficients
+dqqua161 quantize 0 -9e0 -> 0
+dqqua162 quantize 1 -7e0 -> 1
+dqqua163 quantize 0.1 -1e+2 -> 0E+2 Inexact Rounded
+dqqua165 quantize 0.1 0e+1 -> 0E+1 Inexact Rounded
+dqqua166 quantize 0.1 2e0 -> 0 Inexact Rounded
+dqqua167 quantize 0.1 3e-1 -> 0.1
+dqqua168 quantize 0.1 44e-2 -> 0.10
+dqqua169 quantize 0.1 555e-3 -> 0.100
+dqqua170 quantize 0.9 6666e+2 -> 0E+2 Inexact Rounded
+dqqua171 quantize 0.9 -777e+1 -> 0E+1 Inexact Rounded
+dqqua172 quantize 0.9 -88e+0 -> 1 Inexact Rounded
+dqqua173 quantize 0.9 -9e-1 -> 0.9
+dqqua174 quantize 0.9 0e-2 -> 0.90
+dqqua175 quantize 0.9 1.1e-3 -> 0.9000
+-- negatives
+dqqua181 quantize -0 1.1e0 -> -0.0
+dqqua182 quantize -1 -1e0 -> -1
+dqqua183 quantize -0.1 11e+2 -> -0E+2 Inexact Rounded
+dqqua185 quantize -0.1 111e+1 -> -0E+1 Inexact Rounded
+dqqua186 quantize -0.1 71e0 -> -0 Inexact Rounded
+dqqua187 quantize -0.1 -91e-1 -> -0.1
+dqqua188 quantize -0.1 -.1e-2 -> -0.100
+dqqua189 quantize -0.1 -1e-3 -> -0.100
+dqqua190 quantize -0.9 0e+2 -> -0E+2 Inexact Rounded
+dqqua191 quantize -0.9 -0e+1 -> -0E+1 Inexact Rounded
+dqqua192 quantize -0.9 -10e+0 -> -1 Inexact Rounded
+dqqua193 quantize -0.9 100e-1 -> -0.9
+dqqua194 quantize -0.9 999e-2 -> -0.90
+
+-- +ve exponents ..
+dqqua201 quantize -1 1e+0 -> -1
+dqqua202 quantize -1 1e+1 -> -0E+1 Inexact Rounded
+dqqua203 quantize -1 1e+2 -> -0E+2 Inexact Rounded
+dqqua204 quantize 0 1e+0 -> 0
+dqqua205 quantize 0 1e+1 -> 0E+1
+dqqua206 quantize 0 1e+2 -> 0E+2
+dqqua207 quantize +1 1e+0 -> 1
+dqqua208 quantize +1 1e+1 -> 0E+1 Inexact Rounded
+dqqua209 quantize +1 1e+2 -> 0E+2 Inexact Rounded
+
+dqqua220 quantize 1.04 1e+3 -> 0E+3 Inexact Rounded
+dqqua221 quantize 1.04 1e+2 -> 0E+2 Inexact Rounded
+dqqua222 quantize 1.04 1e+1 -> 0E+1 Inexact Rounded
+dqqua223 quantize 1.04 1e+0 -> 1 Inexact Rounded
+dqqua224 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
+dqqua225 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
+dqqua226 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
+dqqua227 quantize 1.05 1e+0 -> 1 Inexact Rounded
+dqqua228 quantize 1.05 1e+3 -> 0E+3 Inexact Rounded
+dqqua229 quantize 1.05 1e+2 -> 0E+2 Inexact Rounded
+dqqua230 quantize 1.05 1e+1 -> 0E+1 Inexact Rounded
+dqqua231 quantize 1.05 1e+0 -> 1 Inexact Rounded
+dqqua232 quantize 1.06 1e+3 -> 0E+3 Inexact Rounded
+dqqua233 quantize 1.06 1e+2 -> 0E+2 Inexact Rounded
+dqqua234 quantize 1.06 1e+1 -> 0E+1 Inexact Rounded
+dqqua235 quantize 1.06 1e+0 -> 1 Inexact Rounded
+
+dqqua240 quantize -10 1e+1 -> -1E+1 Rounded
+dqqua241 quantize +1 1e+1 -> 0E+1 Inexact Rounded
+dqqua242 quantize +10 1e+1 -> 1E+1 Rounded
+dqqua243 quantize 1E+1 1e+1 -> 1E+1 -- underneath this is E+1
+dqqua244 quantize 1E+2 1e+1 -> 1.0E+2 -- underneath this is E+1
+dqqua245 quantize 1E+3 1e+1 -> 1.00E+3 -- underneath this is E+1
+dqqua246 quantize 1E+4 1e+1 -> 1.000E+4 -- underneath this is E+1
+dqqua247 quantize 1E+5 1e+1 -> 1.0000E+5 -- underneath this is E+1
+dqqua248 quantize 1E+6 1e+1 -> 1.00000E+6 -- underneath this is E+1
+dqqua249 quantize 1E+7 1e+1 -> 1.000000E+7 -- underneath this is E+1
+dqqua250 quantize 1E+8 1e+1 -> 1.0000000E+8 -- underneath this is E+1
+dqqua251 quantize 1E+9 1e+1 -> 1.00000000E+9 -- underneath this is E+1
+-- next one tries to add 9 zeros
+dqqua252 quantize 1E+37 1e+1 -> NaN Invalid_operation
+dqqua253 quantize 1E-37 1e+1 -> 0E+1 Inexact Rounded
+dqqua254 quantize 1E-2 1e+1 -> 0E+1 Inexact Rounded
+dqqua255 quantize 0E-37 1e+1 -> 0E+1
+dqqua256 quantize -0E-37 1e+1 -> -0E+1
+dqqua257 quantize -0E-1 1e+1 -> -0E+1
+dqqua258 quantize -0 1e+1 -> -0E+1
+dqqua259 quantize -0E+1 1e+1 -> -0E+1
+
+dqqua260 quantize -10 1e+2 -> -0E+2 Inexact Rounded
+dqqua261 quantize +1 1e+2 -> 0E+2 Inexact Rounded
+dqqua262 quantize +10 1e+2 -> 0E+2 Inexact Rounded
+dqqua263 quantize 1E+1 1e+2 -> 0E+2 Inexact Rounded
+dqqua264 quantize 1E+2 1e+2 -> 1E+2
+dqqua265 quantize 1E+3 1e+2 -> 1.0E+3
+dqqua266 quantize 1E+4 1e+2 -> 1.00E+4
+dqqua267 quantize 1E+5 1e+2 -> 1.000E+5
+dqqua268 quantize 1E+6 1e+2 -> 1.0000E+6
+dqqua269 quantize 1E+7 1e+2 -> 1.00000E+7
+dqqua270 quantize 1E+8 1e+2 -> 1.000000E+8
+dqqua271 quantize 1E+9 1e+2 -> 1.0000000E+9
+dqqua272 quantize 1E+10 1e+2 -> 1.00000000E+10
+dqqua273 quantize 1E-10 1e+2 -> 0E+2 Inexact Rounded
+dqqua274 quantize 1E-2 1e+2 -> 0E+2 Inexact Rounded
+dqqua275 quantize 0E-10 1e+2 -> 0E+2
+
+dqqua280 quantize -10 1e+3 -> -0E+3 Inexact Rounded
+dqqua281 quantize +1 1e+3 -> 0E+3 Inexact Rounded
+dqqua282 quantize +10 1e+3 -> 0E+3 Inexact Rounded
+dqqua283 quantize 1E+1 1e+3 -> 0E+3 Inexact Rounded
+dqqua284 quantize 1E+2 1e+3 -> 0E+3 Inexact Rounded
+dqqua285 quantize 1E+3 1e+3 -> 1E+3
+dqqua286 quantize 1E+4 1e+3 -> 1.0E+4
+dqqua287 quantize 1E+5 1e+3 -> 1.00E+5
+dqqua288 quantize 1E+6 1e+3 -> 1.000E+6
+dqqua289 quantize 1E+7 1e+3 -> 1.0000E+7
+dqqua290 quantize 1E+8 1e+3 -> 1.00000E+8
+dqqua291 quantize 1E+9 1e+3 -> 1.000000E+9
+dqqua292 quantize 1E+10 1e+3 -> 1.0000000E+10
+dqqua293 quantize 1E-10 1e+3 -> 0E+3 Inexact Rounded
+dqqua294 quantize 1E-2 1e+3 -> 0E+3 Inexact Rounded
+dqqua295 quantize 0E-10 1e+3 -> 0E+3
+
+-- round up from below [sign wrong in JIT compiler once]
+dqqua300 quantize 0.0078 1e-5 -> 0.00780
+dqqua301 quantize 0.0078 1e-4 -> 0.0078
+dqqua302 quantize 0.0078 1e-3 -> 0.008 Inexact Rounded
+dqqua303 quantize 0.0078 1e-2 -> 0.01 Inexact Rounded
+dqqua304 quantize 0.0078 1e-1 -> 0.0 Inexact Rounded
+dqqua305 quantize 0.0078 1e0 -> 0 Inexact Rounded
+dqqua306 quantize 0.0078 1e+1 -> 0E+1 Inexact Rounded
+dqqua307 quantize 0.0078 1e+2 -> 0E+2 Inexact Rounded
+
+dqqua310 quantize -0.0078 1e-5 -> -0.00780
+dqqua311 quantize -0.0078 1e-4 -> -0.0078
+dqqua312 quantize -0.0078 1e-3 -> -0.008 Inexact Rounded
+dqqua313 quantize -0.0078 1e-2 -> -0.01 Inexact Rounded
+dqqua314 quantize -0.0078 1e-1 -> -0.0 Inexact Rounded
+dqqua315 quantize -0.0078 1e0 -> -0 Inexact Rounded
+dqqua316 quantize -0.0078 1e+1 -> -0E+1 Inexact Rounded
+dqqua317 quantize -0.0078 1e+2 -> -0E+2 Inexact Rounded
+
+dqqua320 quantize 0.078 1e-5 -> 0.07800
+dqqua321 quantize 0.078 1e-4 -> 0.0780
+dqqua322 quantize 0.078 1e-3 -> 0.078
+dqqua323 quantize 0.078 1e-2 -> 0.08 Inexact Rounded
+dqqua324 quantize 0.078 1e-1 -> 0.1 Inexact Rounded
+dqqua325 quantize 0.078 1e0 -> 0 Inexact Rounded
+dqqua326 quantize 0.078 1e+1 -> 0E+1 Inexact Rounded
+dqqua327 quantize 0.078 1e+2 -> 0E+2 Inexact Rounded
+
+dqqua330 quantize -0.078 1e-5 -> -0.07800
+dqqua331 quantize -0.078 1e-4 -> -0.0780
+dqqua332 quantize -0.078 1e-3 -> -0.078
+dqqua333 quantize -0.078 1e-2 -> -0.08 Inexact Rounded
+dqqua334 quantize -0.078 1e-1 -> -0.1 Inexact Rounded
+dqqua335 quantize -0.078 1e0 -> -0 Inexact Rounded
+dqqua336 quantize -0.078 1e+1 -> -0E+1 Inexact Rounded
+dqqua337 quantize -0.078 1e+2 -> -0E+2 Inexact Rounded
+
+dqqua340 quantize 0.78 1e-5 -> 0.78000
+dqqua341 quantize 0.78 1e-4 -> 0.7800
+dqqua342 quantize 0.78 1e-3 -> 0.780
+dqqua343 quantize 0.78 1e-2 -> 0.78
+dqqua344 quantize 0.78 1e-1 -> 0.8 Inexact Rounded
+dqqua345 quantize 0.78 1e0 -> 1 Inexact Rounded
+dqqua346 quantize 0.78 1e+1 -> 0E+1 Inexact Rounded
+dqqua347 quantize 0.78 1e+2 -> 0E+2 Inexact Rounded
+
+dqqua350 quantize -0.78 1e-5 -> -0.78000
+dqqua351 quantize -0.78 1e-4 -> -0.7800
+dqqua352 quantize -0.78 1e-3 -> -0.780
+dqqua353 quantize -0.78 1e-2 -> -0.78
+dqqua354 quantize -0.78 1e-1 -> -0.8 Inexact Rounded
+dqqua355 quantize -0.78 1e0 -> -1 Inexact Rounded
+dqqua356 quantize -0.78 1e+1 -> -0E+1 Inexact Rounded
+dqqua357 quantize -0.78 1e+2 -> -0E+2 Inexact Rounded
+
+dqqua360 quantize 7.8 1e-5 -> 7.80000
+dqqua361 quantize 7.8 1e-4 -> 7.8000
+dqqua362 quantize 7.8 1e-3 -> 7.800
+dqqua363 quantize 7.8 1e-2 -> 7.80
+dqqua364 quantize 7.8 1e-1 -> 7.8
+dqqua365 quantize 7.8 1e0 -> 8 Inexact Rounded
+dqqua366 quantize 7.8 1e+1 -> 1E+1 Inexact Rounded
+dqqua367 quantize 7.8 1e+2 -> 0E+2 Inexact Rounded
+dqqua368 quantize 7.8 1e+3 -> 0E+3 Inexact Rounded
+
+dqqua370 quantize -7.8 1e-5 -> -7.80000
+dqqua371 quantize -7.8 1e-4 -> -7.8000
+dqqua372 quantize -7.8 1e-3 -> -7.800
+dqqua373 quantize -7.8 1e-2 -> -7.80
+dqqua374 quantize -7.8 1e-1 -> -7.8
+dqqua375 quantize -7.8 1e0 -> -8 Inexact Rounded
+dqqua376 quantize -7.8 1e+1 -> -1E+1 Inexact Rounded
+dqqua377 quantize -7.8 1e+2 -> -0E+2 Inexact Rounded
+dqqua378 quantize -7.8 1e+3 -> -0E+3 Inexact Rounded
+
+-- some individuals
+dqqua380 quantize 1122334455667788991234567352364.506 1e-2 -> 1122334455667788991234567352364.51 Inexact Rounded
+dqqua381 quantize 11223344556677889912345673523645.06 1e-2 -> 11223344556677889912345673523645.06
+dqqua382 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
+dqqua383 quantize 1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
+dqqua384 quantize -1122334455667788991234567352364.506 1e-2 -> -1122334455667788991234567352364.51 Inexact Rounded
+dqqua385 quantize -11223344556677889912345673523645.06 1e-2 -> -11223344556677889912345673523645.06
+dqqua386 quantize -112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
+dqqua387 quantize -1122334455667788991234567352364506 1e-2 -> NaN Invalid_operation
+
+rounding: down
+dqqua389 quantize 112233445566778899123456735236450.6 1e-2 -> NaN Invalid_operation
+rounding: half_up
+
+-- and a few more from e-mail discussions
+dqqua391 quantize 11223344556677889912345678912.34567 1e-3 -> 11223344556677889912345678912.346 Inexact Rounded
+dqqua392 quantize 112233445566778899123456789123.4567 1e-3 -> 112233445566778899123456789123.457 Inexact Rounded
+dqqua393 quantize 1122334455667788991234567891234567. 1e-3 -> NaN Invalid_operation
+
+-- some 9999 round-up cases
+dqqua400 quantize 9.999 1e-5 -> 9.99900
+dqqua401 quantize 9.999 1e-4 -> 9.9990
+dqqua402 quantize 9.999 1e-3 -> 9.999
+dqqua403 quantize 9.999 1e-2 -> 10.00 Inexact Rounded
+dqqua404 quantize 9.999 1e-1 -> 10.0 Inexact Rounded
+dqqua405 quantize 9.999 1e0 -> 10 Inexact Rounded
+dqqua406 quantize 9.999 1e1 -> 1E+1 Inexact Rounded
+dqqua407 quantize 9.999 1e2 -> 0E+2 Inexact Rounded
+
+dqqua410 quantize 0.999 1e-5 -> 0.99900
+dqqua411 quantize 0.999 1e-4 -> 0.9990
+dqqua412 quantize 0.999 1e-3 -> 0.999
+dqqua413 quantize 0.999 1e-2 -> 1.00 Inexact Rounded
+dqqua414 quantize 0.999 1e-1 -> 1.0 Inexact Rounded
+dqqua415 quantize 0.999 1e0 -> 1 Inexact Rounded
+dqqua416 quantize 0.999 1e1 -> 0E+1 Inexact Rounded
+
+dqqua420 quantize 0.0999 1e-5 -> 0.09990
+dqqua421 quantize 0.0999 1e-4 -> 0.0999
+dqqua422 quantize 0.0999 1e-3 -> 0.100 Inexact Rounded
+dqqua423 quantize 0.0999 1e-2 -> 0.10 Inexact Rounded
+dqqua424 quantize 0.0999 1e-1 -> 0.1 Inexact Rounded
+dqqua425 quantize 0.0999 1e0 -> 0 Inexact Rounded
+dqqua426 quantize 0.0999 1e1 -> 0E+1 Inexact Rounded
+
+dqqua430 quantize 0.00999 1e-5 -> 0.00999
+dqqua431 quantize 0.00999 1e-4 -> 0.0100 Inexact Rounded
+dqqua432 quantize 0.00999 1e-3 -> 0.010 Inexact Rounded
+dqqua433 quantize 0.00999 1e-2 -> 0.01 Inexact Rounded
+dqqua434 quantize 0.00999 1e-1 -> 0.0 Inexact Rounded
+dqqua435 quantize 0.00999 1e0 -> 0 Inexact Rounded
+dqqua436 quantize 0.00999 1e1 -> 0E+1 Inexact Rounded
+
+dqqua440 quantize 0.000999 1e-5 -> 0.00100 Inexact Rounded
+dqqua441 quantize 0.000999 1e-4 -> 0.0010 Inexact Rounded
+dqqua442 quantize 0.000999 1e-3 -> 0.001 Inexact Rounded
+dqqua443 quantize 0.000999 1e-2 -> 0.00 Inexact Rounded
+dqqua444 quantize 0.000999 1e-1 -> 0.0 Inexact Rounded
+dqqua445 quantize 0.000999 1e0 -> 0 Inexact Rounded
+dqqua446 quantize 0.000999 1e1 -> 0E+1 Inexact Rounded
+
+dqqua1001 quantize 0.000 0.001 -> 0.000
+dqqua1002 quantize 0.001 0.001 -> 0.001
+dqqua1003 quantize 0.0012 0.001 -> 0.001 Inexact Rounded
+dqqua1004 quantize 0.0018 0.001 -> 0.002 Inexact Rounded
+dqqua1005 quantize 0.501 0.001 -> 0.501
+dqqua1006 quantize 0.5012 0.001 -> 0.501 Inexact Rounded
+dqqua1007 quantize 0.5018 0.001 -> 0.502 Inexact Rounded
+dqqua1008 quantize 0.999 0.001 -> 0.999
+
+dqqua481 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
+dqqua482 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
+dqqua483 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
+dqqua484 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
+dqqua485 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
+dqqua486 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
+-- a potential double-round
+dqqua487 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
+dqqua488 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
+
+dqqua491 quantize 12345678000 1e+3 -> 1.2345678E+10 Rounded
+dqqua492 quantize 1234567800 1e+1 -> 1.23456780E+9 Rounded
+dqqua493 quantize 1234567890 1e+1 -> 1.23456789E+9 Rounded
+dqqua494 quantize 1234567891 1e+1 -> 1.23456789E+9 Inexact Rounded
+dqqua495 quantize 12345678901 1e+2 -> 1.23456789E+10 Inexact Rounded
+dqqua496 quantize 1234567896 1e+1 -> 1.23456790E+9 Inexact Rounded
+dqqua497 quantize 1234.987643 1e-4 -> 1234.9876 Inexact Rounded
+dqqua498 quantize 1234.987647 1e-4 -> 1234.9876 Inexact Rounded
+
+-- Zeros
+dqqua500 quantize 0 1e1 -> 0E+1
+dqqua501 quantize 0 1e0 -> 0
+dqqua502 quantize 0 1e-1 -> 0.0
+dqqua503 quantize 0.0 1e-1 -> 0.0
+dqqua504 quantize 0.0 1e0 -> 0
+dqqua505 quantize 0.0 1e+1 -> 0E+1
+dqqua506 quantize 0E+1 1e-1 -> 0.0
+dqqua507 quantize 0E+1 1e0 -> 0
+dqqua508 quantize 0E+1 1e+1 -> 0E+1
+dqqua509 quantize -0 1e1 -> -0E+1
+dqqua510 quantize -0 1e0 -> -0
+dqqua511 quantize -0 1e-1 -> -0.0
+dqqua512 quantize -0.0 1e-1 -> -0.0
+dqqua513 quantize -0.0 1e0 -> -0
+dqqua514 quantize -0.0 1e+1 -> -0E+1
+dqqua515 quantize -0E+1 1e-1 -> -0.0
+dqqua516 quantize -0E+1 1e0 -> -0
+dqqua517 quantize -0E+1 1e+1 -> -0E+1
+-- #519 here once a problem
+dqqua518 quantize 0 0E-3 -> 0.000
+dqqua519 quantize 0 0E-33 -> 0E-33
+dqqua520 quantize 0.00000000000000000000000000000000 0E-33 -> 0E-33
+dqqua521 quantize 0.000000000000000000000000000000000 0E-33 -> 0E-33
+
+-- Some non-zeros with lots of padding on the right
+dqqua523 quantize 1 0E-33 -> 1.000000000000000000000000000000000
+dqqua524 quantize 12 0E-32 -> 12.00000000000000000000000000000000
+dqqua525 quantize 123 0E-31 -> 123.0000000000000000000000000000000
+dqqua526 quantize 123 0E-32 -> NaN Invalid_operation
+dqqua527 quantize 123.4 0E-31 -> 123.4000000000000000000000000000000
+dqqua528 quantize 123.4 0E-32 -> NaN Invalid_operation
+
+-- Suspicious RHS values
+dqqua530 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
+dqqua531 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
+dqqua532 quantize 1.234 1e359 -> 0E+359 Inexact Rounded
+dqqua533 quantize 123.456 1e359 -> 0E+359 Inexact Rounded
+-- next four are "won't fit" overflows
+dqqua536 quantize 1.234 1e-299 -> NaN Invalid_operation
+dqqua537 quantize 123.456 1e-299 -> NaN Invalid_operation
+dqqua538 quantize 1.234 1e-299 -> NaN Invalid_operation
+dqqua539 quantize 123.456 1e-299 -> NaN Invalid_operation
+
+dqqua542 quantize 1.234E+299 1e299 -> 1E+299 Inexact Rounded
+dqqua543 quantize 1.234E+298 1e299 -> 0E+299 Inexact Rounded
+dqqua544 quantize 1.234 1e299 -> 0E+299 Inexact Rounded
+dqqua547 quantize 0 1e-299 -> 0E-299
+-- next two are "won't fit" overflows
+dqqua548 quantize 1.234 1e-299 -> NaN Invalid_operation
+dqqua549 quantize 1.234 1e-300 -> NaN Invalid_operation
+-- [more below]
+
+-- Specials
+dqqua580 quantize Inf -Inf -> Infinity
+dqqua581 quantize Inf 1e-299 -> NaN Invalid_operation
+dqqua582 quantize Inf 1e-1 -> NaN Invalid_operation
+dqqua583 quantize Inf 1e0 -> NaN Invalid_operation
+dqqua584 quantize Inf 1e1 -> NaN Invalid_operation
+dqqua585 quantize Inf 1e299 -> NaN Invalid_operation
+dqqua586 quantize Inf Inf -> Infinity
+dqqua587 quantize -1000 Inf -> NaN Invalid_operation
+dqqua588 quantize -Inf Inf -> -Infinity
+dqqua589 quantize -1 Inf -> NaN Invalid_operation
+dqqua590 quantize 0 Inf -> NaN Invalid_operation
+dqqua591 quantize 1 Inf -> NaN Invalid_operation
+dqqua592 quantize 1000 Inf -> NaN Invalid_operation
+dqqua593 quantize Inf Inf -> Infinity
+dqqua594 quantize Inf 1e-0 -> NaN Invalid_operation
+dqqua595 quantize -0 Inf -> NaN Invalid_operation
+
+dqqua600 quantize -Inf -Inf -> -Infinity
+dqqua601 quantize -Inf 1e-299 -> NaN Invalid_operation
+dqqua602 quantize -Inf 1e-1 -> NaN Invalid_operation
+dqqua603 quantize -Inf 1e0 -> NaN Invalid_operation
+dqqua604 quantize -Inf 1e1 -> NaN Invalid_operation
+dqqua605 quantize -Inf 1e299 -> NaN Invalid_operation
+dqqua606 quantize -Inf Inf -> -Infinity
+dqqua607 quantize -1000 Inf -> NaN Invalid_operation
+dqqua608 quantize -Inf -Inf -> -Infinity
+dqqua609 quantize -1 -Inf -> NaN Invalid_operation
+dqqua610 quantize 0 -Inf -> NaN Invalid_operation
+dqqua611 quantize 1 -Inf -> NaN Invalid_operation
+dqqua612 quantize 1000 -Inf -> NaN Invalid_operation
+dqqua613 quantize Inf -Inf -> Infinity
+dqqua614 quantize -Inf 1e-0 -> NaN Invalid_operation
+dqqua615 quantize -0 -Inf -> NaN Invalid_operation
+
+dqqua621 quantize NaN -Inf -> NaN
+dqqua622 quantize NaN 1e-299 -> NaN
+dqqua623 quantize NaN 1e-1 -> NaN
+dqqua624 quantize NaN 1e0 -> NaN
+dqqua625 quantize NaN 1e1 -> NaN
+dqqua626 quantize NaN 1e299 -> NaN
+dqqua627 quantize NaN Inf -> NaN
+dqqua628 quantize NaN NaN -> NaN
+dqqua629 quantize -Inf NaN -> NaN
+dqqua630 quantize -1000 NaN -> NaN
+dqqua631 quantize -1 NaN -> NaN
+dqqua632 quantize 0 NaN -> NaN
+dqqua633 quantize 1 NaN -> NaN
+dqqua634 quantize 1000 NaN -> NaN
+dqqua635 quantize Inf NaN -> NaN
+dqqua636 quantize NaN 1e-0 -> NaN
+dqqua637 quantize -0 NaN -> NaN
+
+dqqua641 quantize sNaN -Inf -> NaN Invalid_operation
+dqqua642 quantize sNaN 1e-299 -> NaN Invalid_operation
+dqqua643 quantize sNaN 1e-1 -> NaN Invalid_operation
+dqqua644 quantize sNaN 1e0 -> NaN Invalid_operation
+dqqua645 quantize sNaN 1e1 -> NaN Invalid_operation
+dqqua646 quantize sNaN 1e299 -> NaN Invalid_operation
+dqqua647 quantize sNaN NaN -> NaN Invalid_operation
+dqqua648 quantize sNaN sNaN -> NaN Invalid_operation
+dqqua649 quantize NaN sNaN -> NaN Invalid_operation
+dqqua650 quantize -Inf sNaN -> NaN Invalid_operation
+dqqua651 quantize -1000 sNaN -> NaN Invalid_operation
+dqqua652 quantize -1 sNaN -> NaN Invalid_operation
+dqqua653 quantize 0 sNaN -> NaN Invalid_operation
+dqqua654 quantize 1 sNaN -> NaN Invalid_operation
+dqqua655 quantize 1000 sNaN -> NaN Invalid_operation
+dqqua656 quantize Inf sNaN -> NaN Invalid_operation
+dqqua657 quantize NaN sNaN -> NaN Invalid_operation
+dqqua658 quantize sNaN 1e-0 -> NaN Invalid_operation
+dqqua659 quantize -0 sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqqua661 quantize NaN9 -Inf -> NaN9
+dqqua662 quantize NaN8 919 -> NaN8
+dqqua663 quantize NaN71 Inf -> NaN71
+dqqua664 quantize NaN6 NaN5 -> NaN6
+dqqua665 quantize -Inf NaN4 -> NaN4
+dqqua666 quantize -919 NaN31 -> NaN31
+dqqua667 quantize Inf NaN2 -> NaN2
+
+dqqua671 quantize sNaN99 -Inf -> NaN99 Invalid_operation
+dqqua672 quantize sNaN98 -11 -> NaN98 Invalid_operation
+dqqua673 quantize sNaN97 NaN -> NaN97 Invalid_operation
+dqqua674 quantize sNaN16 sNaN94 -> NaN16 Invalid_operation
+dqqua675 quantize NaN95 sNaN93 -> NaN93 Invalid_operation
+dqqua676 quantize -Inf sNaN92 -> NaN92 Invalid_operation
+dqqua677 quantize 088 sNaN91 -> NaN91 Invalid_operation
+dqqua678 quantize Inf sNaN90 -> NaN90 Invalid_operation
+dqqua679 quantize NaN sNaN88 -> NaN88 Invalid_operation
+
+dqqua681 quantize -NaN9 -Inf -> -NaN9
+dqqua682 quantize -NaN8 919 -> -NaN8
+dqqua683 quantize -NaN71 Inf -> -NaN71
+dqqua684 quantize -NaN6 -NaN5 -> -NaN6
+dqqua685 quantize -Inf -NaN4 -> -NaN4
+dqqua686 quantize -919 -NaN31 -> -NaN31
+dqqua687 quantize Inf -NaN2 -> -NaN2
+
+dqqua691 quantize -sNaN99 -Inf -> -NaN99 Invalid_operation
+dqqua692 quantize -sNaN98 -11 -> -NaN98 Invalid_operation
+dqqua693 quantize -sNaN97 NaN -> -NaN97 Invalid_operation
+dqqua694 quantize -sNaN16 sNaN94 -> -NaN16 Invalid_operation
+dqqua695 quantize -NaN95 -sNaN93 -> -NaN93 Invalid_operation
+dqqua696 quantize -Inf -sNaN92 -> -NaN92 Invalid_operation
+dqqua697 quantize 088 -sNaN91 -> -NaN91 Invalid_operation
+dqqua698 quantize Inf -sNaN90 -> -NaN90 Invalid_operation
+dqqua699 quantize NaN -sNaN88 -> -NaN88 Invalid_operation
+
+-- subnormals and underflow
+dqqua710 quantize 1.00E-6143 1e-6143 -> 1E-6143 Rounded
+dqqua711 quantize 0.1E-6143 2e-6144 -> 1E-6144 Subnormal
+dqqua712 quantize 0.10E-6143 3e-6144 -> 1E-6144 Subnormal Rounded
+dqqua713 quantize 0.100E-6143 4e-6144 -> 1E-6144 Subnormal Rounded
+dqqua714 quantize 0.01E-6143 5e-6145 -> 1E-6145 Subnormal
+-- next is rounded to Emin
+dqqua715 quantize 0.999E-6143 1e-6143 -> 1E-6143 Inexact Rounded
+dqqua716 quantize 0.099E-6143 10e-6144 -> 1E-6144 Inexact Rounded Subnormal
+
+dqqua717 quantize 0.009E-6143 1e-6145 -> 1E-6145 Inexact Rounded Subnormal
+dqqua718 quantize 0.001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
+dqqua719 quantize 0.0009E-6143 1e-6145 -> 0E-6145 Inexact Rounded
+dqqua720 quantize 0.0001E-6143 1e-6145 -> 0E-6145 Inexact Rounded
+
+dqqua730 quantize -1.00E-6143 1e-6143 -> -1E-6143 Rounded
+dqqua731 quantize -0.1E-6143 1e-6143 -> -0E-6143 Rounded Inexact
+dqqua732 quantize -0.10E-6143 1e-6143 -> -0E-6143 Rounded Inexact
+dqqua733 quantize -0.100E-6143 1e-6143 -> -0E-6143 Rounded Inexact
+dqqua734 quantize -0.01E-6143 1e-6143 -> -0E-6143 Inexact Rounded
+-- next is rounded to Emin
+dqqua735 quantize -0.999E-6143 90e-6143 -> -1E-6143 Inexact Rounded
+dqqua736 quantize -0.099E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
+dqqua737 quantize -0.009E-6143 -1e-6143 -> -0E-6143 Inexact Rounded
+dqqua738 quantize -0.001E-6143 -0e-6143 -> -0E-6143 Inexact Rounded
+dqqua739 quantize -0.0001E-6143 0e-6143 -> -0E-6143 Inexact Rounded
+
+dqqua740 quantize -1.00E-6143 1e-6144 -> -1.0E-6143 Rounded
+dqqua741 quantize -0.1E-6143 1e-6144 -> -1E-6144 Subnormal
+dqqua742 quantize -0.10E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
+dqqua743 quantize -0.100E-6143 1e-6144 -> -1E-6144 Subnormal Rounded
+dqqua744 quantize -0.01E-6143 1e-6144 -> -0E-6144 Inexact Rounded
+-- next is rounded to Emin
+dqqua745 quantize -0.999E-6143 1e-6144 -> -1.0E-6143 Inexact Rounded
+dqqua746 quantize -0.099E-6143 1e-6144 -> -1E-6144 Inexact Rounded Subnormal
+dqqua747 quantize -0.009E-6143 1e-6144 -> -0E-6144 Inexact Rounded
+dqqua748 quantize -0.001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
+dqqua749 quantize -0.0001E-6143 1e-6144 -> -0E-6144 Inexact Rounded
+
+dqqua750 quantize -1.00E-6143 1e-6145 -> -1.00E-6143
+dqqua751 quantize -0.1E-6143 1e-6145 -> -1.0E-6144 Subnormal
+dqqua752 quantize -0.10E-6143 1e-6145 -> -1.0E-6144 Subnormal
+dqqua753 quantize -0.100E-6143 1e-6145 -> -1.0E-6144 Subnormal Rounded
+dqqua754 quantize -0.01E-6143 1e-6145 -> -1E-6145 Subnormal
+-- next is rounded to Emin
+dqqua755 quantize -0.999E-6143 1e-6145 -> -1.00E-6143 Inexact Rounded
+dqqua756 quantize -0.099E-6143 1e-6145 -> -1.0E-6144 Inexact Rounded Subnormal
+dqqua757 quantize -0.009E-6143 1e-6145 -> -1E-6145 Inexact Rounded Subnormal
+dqqua758 quantize -0.001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
+dqqua759 quantize -0.0001E-6143 1e-6145 -> -0E-6145 Inexact Rounded
+
+dqqua760 quantize -1.00E-6143 1e-6146 -> -1.000E-6143
+dqqua761 quantize -0.1E-6143 1e-6146 -> -1.00E-6144 Subnormal
+dqqua762 quantize -0.10E-6143 1e-6146 -> -1.00E-6144 Subnormal
+dqqua763 quantize -0.100E-6143 1e-6146 -> -1.00E-6144 Subnormal
+dqqua764 quantize -0.01E-6143 1e-6146 -> -1.0E-6145 Subnormal
+dqqua765 quantize -0.999E-6143 1e-6146 -> -9.99E-6144 Subnormal
+dqqua766 quantize -0.099E-6143 1e-6146 -> -9.9E-6145 Subnormal
+dqqua767 quantize -0.009E-6143 1e-6146 -> -9E-6146 Subnormal
+dqqua768 quantize -0.001E-6143 1e-6146 -> -1E-6146 Subnormal
+dqqua769 quantize -0.0001E-6143 1e-6146 -> -0E-6146 Inexact Rounded
+
+-- More from Fung Lee
+-- the next four would appear to be in error, but they are misleading (the
+-- operands will be clamped to a lower exponent) and so are omitted
+-- dqqua1021 quantize 8.666666666666000E+6144 1.000000000000000E+6144 -> 8.666666666666000000000000000000000E+6144 Clamped
+-- dqqua1022 quantize -8.666666666666000E+6144 1.000000000000000E+6144 -> -8.666666666666000000000000000000000E+6144 Clamped
+-- dqqua1027 quantize 8.666666666666000E+323 1E+31 -> NaN Invalid_operation
+-- dqqua1030 quantize 8.66666666E+3 1E+3 -> 9E+3 Inexact Rounded
+
+-- Int and uInt32 edge values for testing conversions
+dqqua1040 quantize -2147483646 0 -> -2147483646
+dqqua1041 quantize -2147483647 0 -> -2147483647
+dqqua1042 quantize -2147483648 0 -> -2147483648
+dqqua1043 quantize -2147483649 0 -> -2147483649
+dqqua1044 quantize 2147483646 0 -> 2147483646
+dqqua1045 quantize 2147483647 0 -> 2147483647
+dqqua1046 quantize 2147483648 0 -> 2147483648
+dqqua1047 quantize 2147483649 0 -> 2147483649
+dqqua1048 quantize 4294967294 0 -> 4294967294
+dqqua1049 quantize 4294967295 0 -> 4294967295
+dqqua1050 quantize 4294967296 0 -> 4294967296
+dqqua1051 quantize 4294967297 0 -> 4294967297
+
+-- Rounding swathe
+rounding: half_even
+dqqua1100 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1101 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1102 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1103 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+dqqua1104 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1105 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua1106 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1107 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1108 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1109 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: half_up
+dqqua1200 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1201 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1202 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1203 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+dqqua1204 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1205 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+dqqua1206 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1207 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1208 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1209 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: half_down
+dqqua1300 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1301 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1302 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1303 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+dqqua1304 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1305 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua1306 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1307 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1308 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1309 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+
+rounding: up
+dqqua1400 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1401 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
+dqqua1402 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
+dqqua1403 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+dqqua1404 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1405 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+dqqua1406 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1407 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1408 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1409 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+dqqua1411 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
+
+rounding: down
+dqqua1500 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1501 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1502 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1503 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+dqqua1504 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
+dqqua1505 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua1506 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+dqqua1507 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
+dqqua1508 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
+dqqua1509 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
+dqqua1511 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
+
+rounding: ceiling
+dqqua1600 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1601 quantize 1.2301 1.00 -> 1.24 Inexact Rounded
+dqqua1602 quantize 1.2310 1.00 -> 1.24 Inexact Rounded
+dqqua1603 quantize 1.2350 1.00 -> 1.24 Inexact Rounded
+dqqua1604 quantize 1.2351 1.00 -> 1.24 Inexact Rounded
+dqqua1605 quantize 1.2450 1.00 -> 1.25 Inexact Rounded
+dqqua1606 quantize 1.2451 1.00 -> 1.25 Inexact Rounded
+dqqua1607 quantize 1.2360 1.00 -> 1.24 Inexact Rounded
+dqqua1608 quantize 1.2370 1.00 -> 1.24 Inexact Rounded
+dqqua1609 quantize 1.2399 1.00 -> 1.24 Inexact Rounded
+dqqua1611 quantize -1.2399 1.00 -> -1.23 Inexact Rounded
+
+rounding: floor
+dqqua1700 quantize 1.2300 1.00 -> 1.23 Rounded
+dqqua1701 quantize 1.2301 1.00 -> 1.23 Inexact Rounded
+dqqua1702 quantize 1.2310 1.00 -> 1.23 Inexact Rounded
+dqqua1703 quantize 1.2350 1.00 -> 1.23 Inexact Rounded
+dqqua1704 quantize 1.2351 1.00 -> 1.23 Inexact Rounded
+dqqua1705 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua1706 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+dqqua1707 quantize 1.2360 1.00 -> 1.23 Inexact Rounded
+dqqua1708 quantize 1.2370 1.00 -> 1.23 Inexact Rounded
+dqqua1709 quantize 1.2399 1.00 -> 1.23 Inexact Rounded
+dqqua1711 quantize -1.2399 1.00 -> -1.24 Inexact Rounded
+
+rounding: 05up
+dqqua1800 quantize 1.2000 1.00 -> 1.20 Rounded
+dqqua1801 quantize 1.2001 1.00 -> 1.21 Inexact Rounded
+dqqua1802 quantize 1.2010 1.00 -> 1.21 Inexact Rounded
+dqqua1803 quantize 1.2050 1.00 -> 1.21 Inexact Rounded
+dqqua1804 quantize 1.2051 1.00 -> 1.21 Inexact Rounded
+dqqua1807 quantize 1.2060 1.00 -> 1.21 Inexact Rounded
+dqqua1808 quantize 1.2070 1.00 -> 1.21 Inexact Rounded
+dqqua1809 quantize 1.2099 1.00 -> 1.21 Inexact Rounded
+dqqua1811 quantize -1.2099 1.00 -> -1.21 Inexact Rounded
+
+dqqua1900 quantize 1.2100 1.00 -> 1.21 Rounded
+dqqua1901 quantize 1.2101 1.00 -> 1.21 Inexact Rounded
+dqqua1902 quantize 1.2110 1.00 -> 1.21 Inexact Rounded
+dqqua1903 quantize 1.2150 1.00 -> 1.21 Inexact Rounded
+dqqua1904 quantize 1.2151 1.00 -> 1.21 Inexact Rounded
+dqqua1907 quantize 1.2160 1.00 -> 1.21 Inexact Rounded
+dqqua1908 quantize 1.2170 1.00 -> 1.21 Inexact Rounded
+dqqua1909 quantize 1.2199 1.00 -> 1.21 Inexact Rounded
+dqqua1911 quantize -1.2199 1.00 -> -1.21 Inexact Rounded
+
+dqqua2000 quantize 1.2400 1.00 -> 1.24 Rounded
+dqqua2001 quantize 1.2401 1.00 -> 1.24 Inexact Rounded
+dqqua2002 quantize 1.2410 1.00 -> 1.24 Inexact Rounded
+dqqua2003 quantize 1.2450 1.00 -> 1.24 Inexact Rounded
+dqqua2004 quantize 1.2451 1.00 -> 1.24 Inexact Rounded
+dqqua2007 quantize 1.2460 1.00 -> 1.24 Inexact Rounded
+dqqua2008 quantize 1.2470 1.00 -> 1.24 Inexact Rounded
+dqqua2009 quantize 1.2499 1.00 -> 1.24 Inexact Rounded
+dqqua2011 quantize -1.2499 1.00 -> -1.24 Inexact Rounded
+
+dqqua2100 quantize 1.2500 1.00 -> 1.25 Rounded
+dqqua2101 quantize 1.2501 1.00 -> 1.26 Inexact Rounded
+dqqua2102 quantize 1.2510 1.00 -> 1.26 Inexact Rounded
+dqqua2103 quantize 1.2550 1.00 -> 1.26 Inexact Rounded
+dqqua2104 quantize 1.2551 1.00 -> 1.26 Inexact Rounded
+dqqua2107 quantize 1.2560 1.00 -> 1.26 Inexact Rounded
+dqqua2108 quantize 1.2570 1.00 -> 1.26 Inexact Rounded
+dqqua2109 quantize 1.2599 1.00 -> 1.26 Inexact Rounded
+dqqua2111 quantize -1.2599 1.00 -> -1.26 Inexact Rounded
+
+dqqua2200 quantize 1.2600 1.00 -> 1.26 Rounded
+dqqua2201 quantize 1.2601 1.00 -> 1.26 Inexact Rounded
+dqqua2202 quantize 1.2610 1.00 -> 1.26 Inexact Rounded
+dqqua2203 quantize 1.2650 1.00 -> 1.26 Inexact Rounded
+dqqua2204 quantize 1.2651 1.00 -> 1.26 Inexact Rounded
+dqqua2207 quantize 1.2660 1.00 -> 1.26 Inexact Rounded
+dqqua2208 quantize 1.2670 1.00 -> 1.26 Inexact Rounded
+dqqua2209 quantize 1.2699 1.00 -> 1.26 Inexact Rounded
+dqqua2211 quantize -1.2699 1.00 -> -1.26 Inexact Rounded
+
+dqqua2300 quantize 1.2900 1.00 -> 1.29 Rounded
+dqqua2301 quantize 1.2901 1.00 -> 1.29 Inexact Rounded
+dqqua2302 quantize 1.2910 1.00 -> 1.29 Inexact Rounded
+dqqua2303 quantize 1.2950 1.00 -> 1.29 Inexact Rounded
+dqqua2304 quantize 1.2951 1.00 -> 1.29 Inexact Rounded
+dqqua2307 quantize 1.2960 1.00 -> 1.29 Inexact Rounded
+dqqua2308 quantize 1.2970 1.00 -> 1.29 Inexact Rounded
+dqqua2309 quantize 1.2999 1.00 -> 1.29 Inexact Rounded
+dqqua2311 quantize -1.2999 1.00 -> -1.29 Inexact Rounded
+
+-- Null tests
+dqqua998 quantize 10 # -> NaN Invalid_operation
+dqqua999 quantize # 1e10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqReduce.decTest b/Lib/test/decimaltestdata/dqReduce.decTest
index 236574f4c7..5635e6b70f 100644
--- a/Lib/test/decimaltestdata/dqReduce.decTest
+++ b/Lib/test/decimaltestdata/dqReduce.decTest
@@ -1,183 +1,183 @@
-------------------------------------------------------------------------
--- dqReduce.decTest -- remove trailing zeros from a decQuad --
--- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqred001 reduce '1' -> '1'
-dqred002 reduce '-1' -> '-1'
-dqred003 reduce '1.00' -> '1'
-dqred004 reduce '-1.00' -> '-1'
-dqred005 reduce '0' -> '0'
-dqred006 reduce '0.00' -> '0'
-dqred007 reduce '00.0' -> '0'
-dqred008 reduce '00.00' -> '0'
-dqred009 reduce '00' -> '0'
-dqred010 reduce '0E+1' -> '0'
-dqred011 reduce '0E+5' -> '0'
-
-dqred012 reduce '-2' -> '-2'
-dqred013 reduce '2' -> '2'
-dqred014 reduce '-2.00' -> '-2'
-dqred015 reduce '2.00' -> '2'
-dqred016 reduce '-0' -> '-0'
-dqred017 reduce '-0.00' -> '-0'
-dqred018 reduce '-00.0' -> '-0'
-dqred019 reduce '-00.00' -> '-0'
-dqred020 reduce '-00' -> '-0'
-dqred021 reduce '-0E+5' -> '-0'
-dqred022 reduce '-0E+1' -> '-0'
-
-dqred030 reduce '+0.1' -> '0.1'
-dqred031 reduce '-0.1' -> '-0.1'
-dqred032 reduce '+0.01' -> '0.01'
-dqred033 reduce '-0.01' -> '-0.01'
-dqred034 reduce '+0.001' -> '0.001'
-dqred035 reduce '-0.001' -> '-0.001'
-dqred036 reduce '+0.000001' -> '0.000001'
-dqred037 reduce '-0.000001' -> '-0.000001'
-dqred038 reduce '+0.000000000001' -> '1E-12'
-dqred039 reduce '-0.000000000001' -> '-1E-12'
-
-dqred041 reduce 1.1 -> 1.1
-dqred042 reduce 1.10 -> 1.1
-dqred043 reduce 1.100 -> 1.1
-dqred044 reduce 1.110 -> 1.11
-dqred045 reduce -1.1 -> -1.1
-dqred046 reduce -1.10 -> -1.1
-dqred047 reduce -1.100 -> -1.1
-dqred048 reduce -1.110 -> -1.11
-dqred049 reduce 9.9 -> 9.9
-dqred050 reduce 9.90 -> 9.9
-dqred051 reduce 9.900 -> 9.9
-dqred052 reduce 9.990 -> 9.99
-dqred053 reduce -9.9 -> -9.9
-dqred054 reduce -9.90 -> -9.9
-dqred055 reduce -9.900 -> -9.9
-dqred056 reduce -9.990 -> -9.99
-
--- some trailing fractional zeros with zeros in units
-dqred060 reduce 10.0 -> 1E+1
-dqred061 reduce 10.00 -> 1E+1
-dqred062 reduce 100.0 -> 1E+2
-dqred063 reduce 100.00 -> 1E+2
-dqred064 reduce 1.1000E+3 -> 1.1E+3
-dqred065 reduce 1.10000E+3 -> 1.1E+3
-dqred066 reduce -10.0 -> -1E+1
-dqred067 reduce -10.00 -> -1E+1
-dqred068 reduce -100.0 -> -1E+2
-dqred069 reduce -100.00 -> -1E+2
-dqred070 reduce -1.1000E+3 -> -1.1E+3
-dqred071 reduce -1.10000E+3 -> -1.1E+3
-
--- some insignificant trailing zeros with positive exponent
-dqred080 reduce 10E+1 -> 1E+2
-dqred081 reduce 100E+1 -> 1E+3
-dqred082 reduce 1.0E+2 -> 1E+2
-dqred083 reduce 1.0E+3 -> 1E+3
-dqred084 reduce 1.1E+3 -> 1.1E+3
-dqred085 reduce 1.00E+3 -> 1E+3
-dqred086 reduce 1.10E+3 -> 1.1E+3
-dqred087 reduce -10E+1 -> -1E+2
-dqred088 reduce -100E+1 -> -1E+3
-dqred089 reduce -1.0E+2 -> -1E+2
-dqred090 reduce -1.0E+3 -> -1E+3
-dqred091 reduce -1.1E+3 -> -1.1E+3
-dqred092 reduce -1.00E+3 -> -1E+3
-dqred093 reduce -1.10E+3 -> -1.1E+3
-
--- some significant trailing zeros, were we to be trimming
-dqred100 reduce 11 -> 11
-dqred101 reduce 10 -> 1E+1
-dqred102 reduce 10. -> 1E+1
-dqred103 reduce 1.1E+1 -> 11
-dqred104 reduce 1.0E+1 -> 1E+1
-dqred105 reduce 1.10E+2 -> 1.1E+2
-dqred106 reduce 1.00E+2 -> 1E+2
-dqred107 reduce 1.100E+3 -> 1.1E+3
-dqred108 reduce 1.000E+3 -> 1E+3
-dqred109 reduce 1.000000E+6 -> 1E+6
-dqred110 reduce -11 -> -11
-dqred111 reduce -10 -> -1E+1
-dqred112 reduce -10. -> -1E+1
-dqred113 reduce -1.1E+1 -> -11
-dqred114 reduce -1.0E+1 -> -1E+1
-dqred115 reduce -1.10E+2 -> -1.1E+2
-dqred116 reduce -1.00E+2 -> -1E+2
-dqred117 reduce -1.100E+3 -> -1.1E+3
-dqred118 reduce -1.000E+3 -> -1E+3
-dqred119 reduce -1.00000E+5 -> -1E+5
-dqred120 reduce -1.000000E+6 -> -1E+6
-dqred121 reduce -10.00000E+6 -> -1E+7
-dqred122 reduce -100.0000E+6 -> -1E+8
-dqred123 reduce -1000.000E+6 -> -1E+9
-dqred124 reduce -10000.00E+6 -> -1E+10
-dqred125 reduce -100000.0E+6 -> -1E+11
-dqred126 reduce -1000000.E+6 -> -1E+12
-
--- examples from decArith
-dqred140 reduce '2.1' -> '2.1'
-dqred141 reduce '-2.0' -> '-2'
-dqred142 reduce '1.200' -> '1.2'
-dqred143 reduce '-120' -> '-1.2E+2'
-dqred144 reduce '120.00' -> '1.2E+2'
-dqred145 reduce '0.00' -> '0'
-
--- Nmax, Nmin, Ntiny
--- note origami effect on some of these
-dqred151 reduce 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
-dqred152 reduce 9.999999999999999999999999000000000E+6140 -> 9.99999999999999999999999900000E+6140
-dqred153 reduce 9.999999999999999999999999999990000E+6144 -> 9.999999999999999999999999999990000E+6144
-dqred154 reduce 1E-6143 -> 1E-6143
-dqred155 reduce 1.000000000000000000000000000000000E-6143 -> 1E-6143
-dqred156 reduce 2.000E-6173 -> 2E-6173 Subnormal
-dqred157 reduce 1E-6176 -> 1E-6176 Subnormal
-
-dqred161 reduce -1E-6176 -> -1E-6176 Subnormal
-dqred162 reduce -2.000E-6173 -> -2E-6173 Subnormal
-dqred163 reduce -1.000000000000000000000000000000000E-6143 -> -1E-6143
-dqred164 reduce -1E-6143 -> -1E-6143
-dqred165 reduce -9.999999999999999999999999000000000E+6140 -> -9.99999999999999999999999900000E+6140
-dqred166 reduce -9.999999999999999999999999999990000E+6144 -> -9.999999999999999999999999999990000E+6144
-dqred167 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144
-dqred168 reduce -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
-dqred169 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144
-
-
--- specials (reduce does not affect payload)
-dqred820 reduce 'Inf' -> 'Infinity'
-dqred821 reduce '-Inf' -> '-Infinity'
-dqred822 reduce NaN -> NaN
-dqred823 reduce sNaN -> NaN Invalid_operation
-dqred824 reduce NaN101 -> NaN101
-dqred825 reduce sNaN010 -> NaN10 Invalid_operation
-dqred827 reduce -NaN -> -NaN
-dqred828 reduce -sNaN -> -NaN Invalid_operation
-dqred829 reduce -NaN101 -> -NaN101
-dqred830 reduce -sNaN010 -> -NaN10 Invalid_operation
-
--- Null test
-dqred900 reduce # -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqReduce.decTest -- remove trailing zeros from a decQuad --
+-- Copyright (c) IBM Corporation, 2003, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqred001 reduce '1' -> '1'
+dqred002 reduce '-1' -> '-1'
+dqred003 reduce '1.00' -> '1'
+dqred004 reduce '-1.00' -> '-1'
+dqred005 reduce '0' -> '0'
+dqred006 reduce '0.00' -> '0'
+dqred007 reduce '00.0' -> '0'
+dqred008 reduce '00.00' -> '0'
+dqred009 reduce '00' -> '0'
+dqred010 reduce '0E+1' -> '0'
+dqred011 reduce '0E+5' -> '0'
+
+dqred012 reduce '-2' -> '-2'
+dqred013 reduce '2' -> '2'
+dqred014 reduce '-2.00' -> '-2'
+dqred015 reduce '2.00' -> '2'
+dqred016 reduce '-0' -> '-0'
+dqred017 reduce '-0.00' -> '-0'
+dqred018 reduce '-00.0' -> '-0'
+dqred019 reduce '-00.00' -> '-0'
+dqred020 reduce '-00' -> '-0'
+dqred021 reduce '-0E+5' -> '-0'
+dqred022 reduce '-0E+1' -> '-0'
+
+dqred030 reduce '+0.1' -> '0.1'
+dqred031 reduce '-0.1' -> '-0.1'
+dqred032 reduce '+0.01' -> '0.01'
+dqred033 reduce '-0.01' -> '-0.01'
+dqred034 reduce '+0.001' -> '0.001'
+dqred035 reduce '-0.001' -> '-0.001'
+dqred036 reduce '+0.000001' -> '0.000001'
+dqred037 reduce '-0.000001' -> '-0.000001'
+dqred038 reduce '+0.000000000001' -> '1E-12'
+dqred039 reduce '-0.000000000001' -> '-1E-12'
+
+dqred041 reduce 1.1 -> 1.1
+dqred042 reduce 1.10 -> 1.1
+dqred043 reduce 1.100 -> 1.1
+dqred044 reduce 1.110 -> 1.11
+dqred045 reduce -1.1 -> -1.1
+dqred046 reduce -1.10 -> -1.1
+dqred047 reduce -1.100 -> -1.1
+dqred048 reduce -1.110 -> -1.11
+dqred049 reduce 9.9 -> 9.9
+dqred050 reduce 9.90 -> 9.9
+dqred051 reduce 9.900 -> 9.9
+dqred052 reduce 9.990 -> 9.99
+dqred053 reduce -9.9 -> -9.9
+dqred054 reduce -9.90 -> -9.9
+dqred055 reduce -9.900 -> -9.9
+dqred056 reduce -9.990 -> -9.99
+
+-- some trailing fractional zeros with zeros in units
+dqred060 reduce 10.0 -> 1E+1
+dqred061 reduce 10.00 -> 1E+1
+dqred062 reduce 100.0 -> 1E+2
+dqred063 reduce 100.00 -> 1E+2
+dqred064 reduce 1.1000E+3 -> 1.1E+3
+dqred065 reduce 1.10000E+3 -> 1.1E+3
+dqred066 reduce -10.0 -> -1E+1
+dqred067 reduce -10.00 -> -1E+1
+dqred068 reduce -100.0 -> -1E+2
+dqred069 reduce -100.00 -> -1E+2
+dqred070 reduce -1.1000E+3 -> -1.1E+3
+dqred071 reduce -1.10000E+3 -> -1.1E+3
+
+-- some insignificant trailing zeros with positive exponent
+dqred080 reduce 10E+1 -> 1E+2
+dqred081 reduce 100E+1 -> 1E+3
+dqred082 reduce 1.0E+2 -> 1E+2
+dqred083 reduce 1.0E+3 -> 1E+3
+dqred084 reduce 1.1E+3 -> 1.1E+3
+dqred085 reduce 1.00E+3 -> 1E+3
+dqred086 reduce 1.10E+3 -> 1.1E+3
+dqred087 reduce -10E+1 -> -1E+2
+dqred088 reduce -100E+1 -> -1E+3
+dqred089 reduce -1.0E+2 -> -1E+2
+dqred090 reduce -1.0E+3 -> -1E+3
+dqred091 reduce -1.1E+3 -> -1.1E+3
+dqred092 reduce -1.00E+3 -> -1E+3
+dqred093 reduce -1.10E+3 -> -1.1E+3
+
+-- some significant trailing zeros, were we to be trimming
+dqred100 reduce 11 -> 11
+dqred101 reduce 10 -> 1E+1
+dqred102 reduce 10. -> 1E+1
+dqred103 reduce 1.1E+1 -> 11
+dqred104 reduce 1.0E+1 -> 1E+1
+dqred105 reduce 1.10E+2 -> 1.1E+2
+dqred106 reduce 1.00E+2 -> 1E+2
+dqred107 reduce 1.100E+3 -> 1.1E+3
+dqred108 reduce 1.000E+3 -> 1E+3
+dqred109 reduce 1.000000E+6 -> 1E+6
+dqred110 reduce -11 -> -11
+dqred111 reduce -10 -> -1E+1
+dqred112 reduce -10. -> -1E+1
+dqred113 reduce -1.1E+1 -> -11
+dqred114 reduce -1.0E+1 -> -1E+1
+dqred115 reduce -1.10E+2 -> -1.1E+2
+dqred116 reduce -1.00E+2 -> -1E+2
+dqred117 reduce -1.100E+3 -> -1.1E+3
+dqred118 reduce -1.000E+3 -> -1E+3
+dqred119 reduce -1.00000E+5 -> -1E+5
+dqred120 reduce -1.000000E+6 -> -1E+6
+dqred121 reduce -10.00000E+6 -> -1E+7
+dqred122 reduce -100.0000E+6 -> -1E+8
+dqred123 reduce -1000.000E+6 -> -1E+9
+dqred124 reduce -10000.00E+6 -> -1E+10
+dqred125 reduce -100000.0E+6 -> -1E+11
+dqred126 reduce -1000000.E+6 -> -1E+12
+
+-- examples from decArith
+dqred140 reduce '2.1' -> '2.1'
+dqred141 reduce '-2.0' -> '-2'
+dqred142 reduce '1.200' -> '1.2'
+dqred143 reduce '-120' -> '-1.2E+2'
+dqred144 reduce '120.00' -> '1.2E+2'
+dqred145 reduce '0.00' -> '0'
+
+-- Nmax, Nmin, Ntiny
+-- note origami effect on some of these
+dqred151 reduce 9.999999999999999999999999999999999E+6144 -> 9.999999999999999999999999999999999E+6144
+dqred152 reduce 9.999999999999999999999999000000000E+6140 -> 9.99999999999999999999999900000E+6140
+dqred153 reduce 9.999999999999999999999999999990000E+6144 -> 9.999999999999999999999999999990000E+6144
+dqred154 reduce 1E-6143 -> 1E-6143
+dqred155 reduce 1.000000000000000000000000000000000E-6143 -> 1E-6143
+dqred156 reduce 2.000E-6173 -> 2E-6173 Subnormal
+dqred157 reduce 1E-6176 -> 1E-6176 Subnormal
+
+dqred161 reduce -1E-6176 -> -1E-6176 Subnormal
+dqred162 reduce -2.000E-6173 -> -2E-6173 Subnormal
+dqred163 reduce -1.000000000000000000000000000000000E-6143 -> -1E-6143
+dqred164 reduce -1E-6143 -> -1E-6143
+dqred165 reduce -9.999999999999999999999999000000000E+6140 -> -9.99999999999999999999999900000E+6140
+dqred166 reduce -9.999999999999999999999999999990000E+6144 -> -9.999999999999999999999999999990000E+6144
+dqred167 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144
+dqred168 reduce -9.999999999999999999999999999999999E+6144 -> -9.999999999999999999999999999999999E+6144
+dqred169 reduce -9.999999999999999999999999999999990E+6144 -> -9.999999999999999999999999999999990E+6144
+
+
+-- specials (reduce does not affect payload)
+dqred820 reduce 'Inf' -> 'Infinity'
+dqred821 reduce '-Inf' -> '-Infinity'
+dqred822 reduce NaN -> NaN
+dqred823 reduce sNaN -> NaN Invalid_operation
+dqred824 reduce NaN101 -> NaN101
+dqred825 reduce sNaN010 -> NaN10 Invalid_operation
+dqred827 reduce -NaN -> -NaN
+dqred828 reduce -sNaN -> -NaN Invalid_operation
+dqred829 reduce -NaN101 -> -NaN101
+dqred830 reduce -sNaN010 -> -NaN10 Invalid_operation
+
+-- Null test
+dqred900 reduce # -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqRemainder.decTest b/Lib/test/decimaltestdata/dqRemainder.decTest
index bae8eae526..090d3cf559 100644
--- a/Lib/test/decimaltestdata/dqRemainder.decTest
+++ b/Lib/test/decimaltestdata/dqRemainder.decTest
@@ -1,597 +1,597 @@
-------------------------------------------------------------------------
--- dqRemainder.decTest -- decQuad remainder --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks (as base, above)
-dqrem001 remainder 1 1 -> 0
-dqrem002 remainder 2 1 -> 0
-dqrem003 remainder 1 2 -> 1
-dqrem004 remainder 2 2 -> 0
-dqrem005 remainder 0 1 -> 0
-dqrem006 remainder 0 2 -> 0
-dqrem007 remainder 1 3 -> 1
-dqrem008 remainder 2 3 -> 2
-dqrem009 remainder 3 3 -> 0
-
-dqrem010 remainder 2.4 1 -> 0.4
-dqrem011 remainder 2.4 -1 -> 0.4
-dqrem012 remainder -2.4 1 -> -0.4
-dqrem013 remainder -2.4 -1 -> -0.4
-dqrem014 remainder 2.40 1 -> 0.40
-dqrem015 remainder 2.400 1 -> 0.400
-dqrem016 remainder 2.4 2 -> 0.4
-dqrem017 remainder 2.400 2 -> 0.400
-dqrem018 remainder 2. 2 -> 0
-dqrem019 remainder 20 20 -> 0
-
-dqrem020 remainder 187 187 -> 0
-dqrem021 remainder 5 2 -> 1
-dqrem022 remainder 5 2.0 -> 1.0
-dqrem023 remainder 5 2.000 -> 1.000
-dqrem024 remainder 5 0.200 -> 0.000
-dqrem025 remainder 5 0.200 -> 0.000
-
-dqrem030 remainder 1 2 -> 1
-dqrem031 remainder 1 4 -> 1
-dqrem032 remainder 1 8 -> 1
-
-dqrem033 remainder 1 16 -> 1
-dqrem034 remainder 1 32 -> 1
-dqrem035 remainder 1 64 -> 1
-dqrem040 remainder 1 -2 -> 1
-dqrem041 remainder 1 -4 -> 1
-dqrem042 remainder 1 -8 -> 1
-dqrem043 remainder 1 -16 -> 1
-dqrem044 remainder 1 -32 -> 1
-dqrem045 remainder 1 -64 -> 1
-dqrem050 remainder -1 2 -> -1
-dqrem051 remainder -1 4 -> -1
-dqrem052 remainder -1 8 -> -1
-dqrem053 remainder -1 16 -> -1
-dqrem054 remainder -1 32 -> -1
-dqrem055 remainder -1 64 -> -1
-dqrem060 remainder -1 -2 -> -1
-dqrem061 remainder -1 -4 -> -1
-dqrem062 remainder -1 -8 -> -1
-dqrem063 remainder -1 -16 -> -1
-dqrem064 remainder -1 -32 -> -1
-dqrem065 remainder -1 -64 -> -1
-
-dqrem066 remainder 999999999 1 -> 0
-dqrem067 remainder 999999999.4 1 -> 0.4
-dqrem068 remainder 999999999.5 1 -> 0.5
-dqrem069 remainder 999999999.9 1 -> 0.9
-dqrem070 remainder 999999999.999 1 -> 0.999
-dqrem071 remainder 999999.999999 1 -> 0.999999
-dqrem072 remainder 9 1 -> 0
-
-dqrem080 remainder 0. 1 -> 0
-dqrem081 remainder .0 1 -> 0.0
-dqrem082 remainder 0.00 1 -> 0.00
-dqrem083 remainder 0.00E+9 1 -> 0
-dqrem084 remainder 0.00E+3 1 -> 0
-dqrem085 remainder 0.00E+2 1 -> 0
-dqrem086 remainder 0.00E+1 1 -> 0.0
-dqrem087 remainder 0.00E+0 1 -> 0.00
-dqrem088 remainder 0.00E-0 1 -> 0.00
-dqrem089 remainder 0.00E-1 1 -> 0.000
-dqrem090 remainder 0.00E-2 1 -> 0.0000
-dqrem091 remainder 0.00E-3 1 -> 0.00000
-dqrem092 remainder 0.00E-4 1 -> 0.000000
-dqrem093 remainder 0.00E-5 1 -> 0E-7
-dqrem094 remainder 0.00E-6 1 -> 0E-8
-dqrem095 remainder 0.0000E-50 1 -> 0E-54
-
--- Various flavours of remainder by 0
-dqrem101 remainder 0 0 -> NaN Division_undefined
-dqrem102 remainder 0 -0 -> NaN Division_undefined
-dqrem103 remainder -0 0 -> NaN Division_undefined
-dqrem104 remainder -0 -0 -> NaN Division_undefined
-dqrem105 remainder 0.0E5 0 -> NaN Division_undefined
-dqrem106 remainder 0.000 0 -> NaN Division_undefined
--- [Some think this next group should be Division_by_zero exception, but
--- IEEE 854 is explicit that it is Invalid operation .. for
--- remainder-near, anyway]
-dqrem107 remainder 0.0001 0 -> NaN Invalid_operation
-dqrem108 remainder 0.01 0 -> NaN Invalid_operation
-dqrem109 remainder 0.1 0 -> NaN Invalid_operation
-dqrem110 remainder 1 0 -> NaN Invalid_operation
-dqrem111 remainder 1 0.0 -> NaN Invalid_operation
-dqrem112 remainder 10 0.0 -> NaN Invalid_operation
-dqrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
-dqrem114 remainder 1E+380 0 -> NaN Invalid_operation
-dqrem115 remainder 0.0001 -0 -> NaN Invalid_operation
-dqrem116 remainder 0.01 -0 -> NaN Invalid_operation
-dqrem119 remainder 0.1 -0 -> NaN Invalid_operation
-dqrem120 remainder 1 -0 -> NaN Invalid_operation
-dqrem121 remainder 1 -0.0 -> NaN Invalid_operation
-dqrem122 remainder 10 -0.0 -> NaN Invalid_operation
-dqrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
-dqrem124 remainder 1E+384 -0 -> NaN Invalid_operation
--- and zeros on left
-dqrem130 remainder 0 1 -> 0
-dqrem131 remainder 0 -1 -> 0
-dqrem132 remainder 0.0 1 -> 0.0
-dqrem133 remainder 0.0 -1 -> 0.0
-dqrem134 remainder -0 1 -> -0
-dqrem135 remainder -0 -1 -> -0
-dqrem136 remainder -0.0 1 -> -0.0
-dqrem137 remainder -0.0 -1 -> -0.0
-
--- 0.5ers
-dqrem143 remainder 0.5 2 -> 0.5
-dqrem144 remainder 0.5 2.1 -> 0.5
-dqrem145 remainder 0.5 2.01 -> 0.50
-dqrem146 remainder 0.5 2.001 -> 0.500
-dqrem147 remainder 0.50 2 -> 0.50
-dqrem148 remainder 0.50 2.01 -> 0.50
-dqrem149 remainder 0.50 2.001 -> 0.500
-
--- steadies
-dqrem150 remainder 1 1 -> 0
-dqrem151 remainder 1 2 -> 1
-dqrem152 remainder 1 3 -> 1
-dqrem153 remainder 1 4 -> 1
-dqrem154 remainder 1 5 -> 1
-dqrem155 remainder 1 6 -> 1
-dqrem156 remainder 1 7 -> 1
-dqrem157 remainder 1 8 -> 1
-dqrem158 remainder 1 9 -> 1
-dqrem159 remainder 1 10 -> 1
-dqrem160 remainder 1 1 -> 0
-dqrem161 remainder 2 1 -> 0
-dqrem162 remainder 3 1 -> 0
-dqrem163 remainder 4 1 -> 0
-dqrem164 remainder 5 1 -> 0
-dqrem165 remainder 6 1 -> 0
-dqrem166 remainder 7 1 -> 0
-dqrem167 remainder 8 1 -> 0
-dqrem168 remainder 9 1 -> 0
-dqrem169 remainder 10 1 -> 0
-
--- some differences from remainderNear
-dqrem171 remainder 0.4 1.020 -> 0.400
-dqrem172 remainder 0.50 1.020 -> 0.500
-dqrem173 remainder 0.51 1.020 -> 0.510
-dqrem174 remainder 0.52 1.020 -> 0.520
-dqrem175 remainder 0.6 1.020 -> 0.600
-
--- More flavours of remainder by 0
-dqrem201 remainder 0 0 -> NaN Division_undefined
-dqrem202 remainder 0.0E5 0 -> NaN Division_undefined
-dqrem203 remainder 0.000 0 -> NaN Division_undefined
-dqrem204 remainder 0.0001 0 -> NaN Invalid_operation
-dqrem205 remainder 0.01 0 -> NaN Invalid_operation
-dqrem206 remainder 0.1 0 -> NaN Invalid_operation
-dqrem207 remainder 1 0 -> NaN Invalid_operation
-dqrem208 remainder 1 0.0 -> NaN Invalid_operation
-dqrem209 remainder 10 0.0 -> NaN Invalid_operation
-dqrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
-dqrem211 remainder 1E+380 0 -> NaN Invalid_operation
-
--- some differences from remainderNear
-dqrem231 remainder -0.4 1.020 -> -0.400
-dqrem232 remainder -0.50 1.020 -> -0.500
-dqrem233 remainder -0.51 1.020 -> -0.510
-dqrem234 remainder -0.52 1.020 -> -0.520
-dqrem235 remainder -0.6 1.020 -> -0.600
-
--- high Xs
-dqrem240 remainder 1E+2 1.00 -> 0.00
-
--- dqrem3xx are from DiagBigDecimal
-dqrem301 remainder 1 3 -> 1
-dqrem302 remainder 5 5 -> 0
-dqrem303 remainder 13 10 -> 3
-dqrem304 remainder 13 50 -> 13
-dqrem305 remainder 13 100 -> 13
-dqrem306 remainder 13 1000 -> 13
-dqrem307 remainder .13 1 -> 0.13
-dqrem308 remainder 0.133 1 -> 0.133
-dqrem309 remainder 0.1033 1 -> 0.1033
-dqrem310 remainder 1.033 1 -> 0.033
-dqrem311 remainder 10.33 1 -> 0.33
-dqrem312 remainder 10.33 10 -> 0.33
-dqrem313 remainder 103.3 1 -> 0.3
-dqrem314 remainder 133 10 -> 3
-dqrem315 remainder 1033 10 -> 3
-dqrem316 remainder 1033 50 -> 33
-dqrem317 remainder 101.0 3 -> 2.0
-dqrem318 remainder 102.0 3 -> 0.0
-dqrem319 remainder 103.0 3 -> 1.0
-dqrem320 remainder 2.40 1 -> 0.40
-dqrem321 remainder 2.400 1 -> 0.400
-dqrem322 remainder 2.4 1 -> 0.4
-dqrem323 remainder 2.4 2 -> 0.4
-dqrem324 remainder 2.400 2 -> 0.400
-dqrem325 remainder 1 0.3 -> 0.1
-dqrem326 remainder 1 0.30 -> 0.10
-dqrem327 remainder 1 0.300 -> 0.100
-dqrem328 remainder 1 0.3000 -> 0.1000
-dqrem329 remainder 1.0 0.3 -> 0.1
-dqrem330 remainder 1.00 0.3 -> 0.10
-dqrem331 remainder 1.000 0.3 -> 0.100
-dqrem332 remainder 1.0000 0.3 -> 0.1000
-dqrem333 remainder 0.5 2 -> 0.5
-dqrem334 remainder 0.5 2.1 -> 0.5
-dqrem335 remainder 0.5 2.01 -> 0.50
-dqrem336 remainder 0.5 2.001 -> 0.500
-dqrem337 remainder 0.50 2 -> 0.50
-dqrem338 remainder 0.50 2.01 -> 0.50
-dqrem339 remainder 0.50 2.001 -> 0.500
-
-dqrem340 remainder 0.5 0.5000001 -> 0.5000000
-dqrem341 remainder 0.5 0.50000001 -> 0.50000000
-dqrem342 remainder 0.5 0.500000001 -> 0.500000000
-dqrem343 remainder 0.5 0.5000000001 -> 0.5000000000
-dqrem344 remainder 0.5 0.50000000001 -> 0.50000000000
-dqrem345 remainder 0.5 0.4999999 -> 1E-7
-dqrem346 remainder 0.5 0.49999999 -> 1E-8
-dqrem347 remainder 0.5 0.499999999 -> 1E-9
-dqrem348 remainder 0.5 0.4999999999 -> 1E-10
-dqrem349 remainder 0.5 0.49999999999 -> 1E-11
-dqrem350 remainder 0.5 0.499999999999 -> 1E-12
-
-dqrem351 remainder 0.03 7 -> 0.03
-dqrem352 remainder 5 2 -> 1
-dqrem353 remainder 4.1 2 -> 0.1
-dqrem354 remainder 4.01 2 -> 0.01
-dqrem355 remainder 4.001 2 -> 0.001
-dqrem356 remainder 4.0001 2 -> 0.0001
-dqrem357 remainder 4.00001 2 -> 0.00001
-dqrem358 remainder 4.000001 2 -> 0.000001
-dqrem359 remainder 4.0000001 2 -> 1E-7
-
-dqrem360 remainder 1.2 0.7345 -> 0.4655
-dqrem361 remainder 0.8 12 -> 0.8
-dqrem362 remainder 0.8 0.2 -> 0.0
-dqrem363 remainder 0.8 0.3 -> 0.2
-dqrem364 remainder 0.800 12 -> 0.800
-dqrem365 remainder 0.800 1.7 -> 0.800
-dqrem366 remainder 2.400 2 -> 0.400
-
-dqrem371 remainder 2.400 2 -> 0.400
-
-dqrem381 remainder 12345 1 -> 0
-dqrem382 remainder 12345 1.0001 -> 0.7657
-dqrem383 remainder 12345 1.001 -> 0.668
-dqrem384 remainder 12345 1.01 -> 0.78
-dqrem385 remainder 12345 1.1 -> 0.8
-dqrem386 remainder 12355 4 -> 3
-dqrem387 remainder 12345 4 -> 1
-dqrem388 remainder 12355 4.0001 -> 2.6912
-dqrem389 remainder 12345 4.0001 -> 0.6914
-dqrem390 remainder 12345 4.9 -> 1.9
-dqrem391 remainder 12345 4.99 -> 4.73
-dqrem392 remainder 12345 4.999 -> 2.469
-dqrem393 remainder 12345 4.9999 -> 0.2469
-dqrem394 remainder 12345 5 -> 0
-dqrem395 remainder 12345 5.0001 -> 4.7532
-dqrem396 remainder 12345 5.001 -> 2.532
-dqrem397 remainder 12345 5.01 -> 0.36
-dqrem398 remainder 12345 5.1 -> 3.0
-
--- the nasty division-by-1 cases
-dqrem401 remainder 0.5 1 -> 0.5
-dqrem402 remainder 0.55 1 -> 0.55
-dqrem403 remainder 0.555 1 -> 0.555
-dqrem404 remainder 0.5555 1 -> 0.5555
-dqrem405 remainder 0.55555 1 -> 0.55555
-dqrem406 remainder 0.555555 1 -> 0.555555
-dqrem407 remainder 0.5555555 1 -> 0.5555555
-dqrem408 remainder 0.55555555 1 -> 0.55555555
-dqrem409 remainder 0.555555555 1 -> 0.555555555
-
--- folddowns
-dqrem421 remainder 1E+6144 1 -> NaN Division_impossible
-dqrem422 remainder 1E+6144 1E+6143 -> 0E+6111 Clamped
-dqrem423 remainder 1E+6144 2E+6143 -> 0E+6111 Clamped
-dqrem424 remainder 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqrem425 remainder 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
-dqrem426 remainder 1E+6144 5E+6143 -> 0E+6111 Clamped
-dqrem427 remainder 1E+6144 6E+6143 -> 4.00000000000000000000000000000000E+6143 Clamped
-dqrem428 remainder 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped
-dqrem429 remainder 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
-dqrem430 remainder 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
--- tinies
-dqrem431 remainder 1E-6175 1E-6176 -> 0E-6176
-dqrem432 remainder 1E-6175 2E-6176 -> 0E-6176
-dqrem433 remainder 1E-6175 3E-6176 -> 1E-6176 Subnormal
-dqrem434 remainder 1E-6175 4E-6176 -> 2E-6176 Subnormal
-dqrem435 remainder 1E-6175 5E-6176 -> 0E-6176
-dqrem436 remainder 1E-6175 6E-6176 -> 4E-6176 Subnormal
-dqrem437 remainder 1E-6175 7E-6176 -> 3E-6176 Subnormal
-dqrem438 remainder 1E-6175 8E-6176 -> 2E-6176 Subnormal
-dqrem439 remainder 1E-6175 9E-6176 -> 1E-6176 Subnormal
-dqrem440 remainder 1E-6175 10E-6176 -> 0E-6176
-dqrem441 remainder 1E-6175 11E-6176 -> 1.0E-6175 Subnormal
-dqrem442 remainder 100E-6175 11E-6176 -> 1.0E-6175 Subnormal
-dqrem443 remainder 100E-6175 20E-6176 -> 0E-6176
-dqrem444 remainder 100E-6175 21E-6176 -> 1.3E-6175 Subnormal
-dqrem445 remainder 100E-6175 30E-6176 -> 1.0E-6175 Subnormal
-
--- zero signs
-dqrem650 remainder 1 1 -> 0
-dqrem651 remainder -1 1 -> -0
-dqrem652 remainder 1 -1 -> 0
-dqrem653 remainder -1 -1 -> -0
-dqrem654 remainder 0 1 -> 0
-dqrem655 remainder -0 1 -> -0
-dqrem656 remainder 0 -1 -> 0
-dqrem657 remainder -0 -1 -> -0
-dqrem658 remainder 0.00 1 -> 0.00
-dqrem659 remainder -0.00 1 -> -0.00
-
--- Specials
-dqrem680 remainder Inf -Inf -> NaN Invalid_operation
-dqrem681 remainder Inf -1000 -> NaN Invalid_operation
-dqrem682 remainder Inf -1 -> NaN Invalid_operation
-dqrem683 remainder Inf 0 -> NaN Invalid_operation
-dqrem684 remainder Inf -0 -> NaN Invalid_operation
-dqrem685 remainder Inf 1 -> NaN Invalid_operation
-dqrem686 remainder Inf 1000 -> NaN Invalid_operation
-dqrem687 remainder Inf Inf -> NaN Invalid_operation
-dqrem688 remainder -1000 Inf -> -1000
-dqrem689 remainder -Inf Inf -> NaN Invalid_operation
-dqrem691 remainder -1 Inf -> -1
-dqrem692 remainder 0 Inf -> 0
-dqrem693 remainder -0 Inf -> -0
-dqrem694 remainder 1 Inf -> 1
-dqrem695 remainder 1000 Inf -> 1000
-dqrem696 remainder Inf Inf -> NaN Invalid_operation
-
-dqrem700 remainder -Inf -Inf -> NaN Invalid_operation
-dqrem701 remainder -Inf -1000 -> NaN Invalid_operation
-dqrem702 remainder -Inf -1 -> NaN Invalid_operation
-dqrem703 remainder -Inf -0 -> NaN Invalid_operation
-dqrem704 remainder -Inf 0 -> NaN Invalid_operation
-dqrem705 remainder -Inf 1 -> NaN Invalid_operation
-dqrem706 remainder -Inf 1000 -> NaN Invalid_operation
-dqrem707 remainder -Inf Inf -> NaN Invalid_operation
-dqrem708 remainder -Inf -Inf -> NaN Invalid_operation
-dqrem709 remainder -1000 Inf -> -1000
-dqrem710 remainder -1 -Inf -> -1
-dqrem711 remainder -0 -Inf -> -0
-dqrem712 remainder 0 -Inf -> 0
-dqrem713 remainder 1 -Inf -> 1
-dqrem714 remainder 1000 -Inf -> 1000
-dqrem715 remainder Inf -Inf -> NaN Invalid_operation
-
-dqrem721 remainder NaN -Inf -> NaN
-dqrem722 remainder NaN -1000 -> NaN
-dqrem723 remainder NaN -1 -> NaN
-dqrem724 remainder NaN -0 -> NaN
-dqrem725 remainder -NaN 0 -> -NaN
-dqrem726 remainder NaN 1 -> NaN
-dqrem727 remainder NaN 1000 -> NaN
-dqrem728 remainder NaN Inf -> NaN
-dqrem729 remainder NaN -NaN -> NaN
-dqrem730 remainder -Inf NaN -> NaN
-dqrem731 remainder -1000 NaN -> NaN
-dqrem732 remainder -1 NaN -> NaN
-dqrem733 remainder -0 -NaN -> -NaN
-dqrem734 remainder 0 NaN -> NaN
-dqrem735 remainder 1 -NaN -> -NaN
-dqrem736 remainder 1000 NaN -> NaN
-dqrem737 remainder Inf NaN -> NaN
-
-dqrem741 remainder sNaN -Inf -> NaN Invalid_operation
-dqrem742 remainder sNaN -1000 -> NaN Invalid_operation
-dqrem743 remainder -sNaN -1 -> -NaN Invalid_operation
-dqrem744 remainder sNaN -0 -> NaN Invalid_operation
-dqrem745 remainder sNaN 0 -> NaN Invalid_operation
-dqrem746 remainder sNaN 1 -> NaN Invalid_operation
-dqrem747 remainder sNaN 1000 -> NaN Invalid_operation
-dqrem749 remainder sNaN NaN -> NaN Invalid_operation
-dqrem750 remainder sNaN sNaN -> NaN Invalid_operation
-dqrem751 remainder NaN sNaN -> NaN Invalid_operation
-dqrem752 remainder -Inf sNaN -> NaN Invalid_operation
-dqrem753 remainder -1000 sNaN -> NaN Invalid_operation
-dqrem754 remainder -1 sNaN -> NaN Invalid_operation
-dqrem755 remainder -0 sNaN -> NaN Invalid_operation
-dqrem756 remainder 0 sNaN -> NaN Invalid_operation
-dqrem757 remainder 1 sNaN -> NaN Invalid_operation
-dqrem758 remainder 1000 sNaN -> NaN Invalid_operation
-dqrem759 remainder Inf -sNaN -> -NaN Invalid_operation
-
--- propaging NaNs
-dqrem760 remainder NaN1 NaN7 -> NaN1
-dqrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
-dqrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
-dqrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
-dqrem764 remainder 15 NaN11 -> NaN11
-dqrem765 remainder NaN6 NaN12 -> NaN6
-dqrem766 remainder Inf NaN13 -> NaN13
-dqrem767 remainder NaN14 -Inf -> NaN14
-dqrem768 remainder 0 NaN15 -> NaN15
-dqrem769 remainder NaN16 -0 -> NaN16
-
--- edge cases of impossible
-dqrem770 remainder 1234568888888887777777777890123456 10 -> 6
-dqrem771 remainder 1234568888888887777777777890123456 1 -> 0
-dqrem772 remainder 1234568888888887777777777890123456 0.1 -> NaN Division_impossible
-dqrem773 remainder 1234568888888887777777777890123456 0.01 -> NaN Division_impossible
-
--- long operand checks
-dqrem801 remainder 12345678000 100 -> 0
-dqrem802 remainder 1 12345678000 -> 1
-dqrem803 remainder 1234567800 10 -> 0
-dqrem804 remainder 1 1234567800 -> 1
-dqrem805 remainder 1234567890 10 -> 0
-dqrem806 remainder 1 1234567890 -> 1
-dqrem807 remainder 1234567891 10 -> 1
-dqrem808 remainder 1 1234567891 -> 1
-dqrem809 remainder 12345678901 100 -> 1
-dqrem810 remainder 1 12345678901 -> 1
-dqrem811 remainder 1234567896 10 -> 6
-dqrem812 remainder 1 1234567896 -> 1
-
-dqrem821 remainder 12345678000 100 -> 0
-dqrem822 remainder 1 12345678000 -> 1
-dqrem823 remainder 1234567800 10 -> 0
-dqrem824 remainder 1 1234567800 -> 1
-dqrem825 remainder 1234567890 10 -> 0
-dqrem826 remainder 1 1234567890 -> 1
-dqrem827 remainder 1234567891 10 -> 1
-dqrem828 remainder 1 1234567891 -> 1
-dqrem829 remainder 12345678901 100 -> 1
-dqrem830 remainder 1 12345678901 -> 1
-dqrem831 remainder 1234567896 10 -> 6
-dqrem832 remainder 1 1234567896 -> 1
-
--- from divideint
-dqrem840 remainder 100000000.0 1 -> 0.0
-dqrem841 remainder 100000000.4 1 -> 0.4
-dqrem842 remainder 100000000.5 1 -> 0.5
-dqrem843 remainder 100000000.9 1 -> 0.9
-dqrem844 remainder 100000000.999 1 -> 0.999
-dqrem850 remainder 100000003 5 -> 3
-dqrem851 remainder 10000003 5 -> 3
-dqrem852 remainder 1000003 5 -> 3
-dqrem853 remainder 100003 5 -> 3
-dqrem854 remainder 10003 5 -> 3
-dqrem855 remainder 1003 5 -> 3
-dqrem856 remainder 103 5 -> 3
-dqrem857 remainder 13 5 -> 3
-dqrem858 remainder 1 5 -> 1
-
--- Vladimir's cases 1234567890123456
-dqrem860 remainder 123.0e1 1000000000000000 -> 1230
-dqrem861 remainder 1230 1000000000000000 -> 1230
-dqrem862 remainder 12.3e2 1000000000000000 -> 1230
-dqrem863 remainder 1.23e3 1000000000000000 -> 1230
-dqrem864 remainder 123e1 1000000000000000 -> 1230
-dqrem870 remainder 123e1 1000000000000000 -> 1230
-dqrem871 remainder 123e1 100000000000000 -> 1230
-dqrem872 remainder 123e1 10000000000000 -> 1230
-dqrem873 remainder 123e1 1000000000000 -> 1230
-dqrem874 remainder 123e1 100000000000 -> 1230
-dqrem875 remainder 123e1 10000000000 -> 1230
-dqrem876 remainder 123e1 1000000000 -> 1230
-dqrem877 remainder 123e1 100000000 -> 1230
-dqrem878 remainder 1230 100000000 -> 1230
-dqrem879 remainder 123e1 10000000 -> 1230
-dqrem880 remainder 123e1 1000000 -> 1230
-dqrem881 remainder 123e1 100000 -> 1230
-dqrem882 remainder 123e1 10000 -> 1230
-dqrem883 remainder 123e1 1000 -> 230
-dqrem884 remainder 123e1 100 -> 30
-dqrem885 remainder 123e1 10 -> 0
-dqrem886 remainder 123e1 1 -> 0
-
-dqrem890 remainder 123e1 2000000000000000 -> 1230
-dqrem891 remainder 123e1 200000000000000 -> 1230
-dqrem892 remainder 123e1 20000000000000 -> 1230
-dqrem893 remainder 123e1 2000000000000 -> 1230
-dqrem894 remainder 123e1 200000000000 -> 1230
-dqrem895 remainder 123e1 20000000000 -> 1230
-dqrem896 remainder 123e1 2000000000 -> 1230
-dqrem897 remainder 123e1 200000000 -> 1230
-dqrem899 remainder 123e1 20000000 -> 1230
-dqrem900 remainder 123e1 2000000 -> 1230
-dqrem901 remainder 123e1 200000 -> 1230
-dqrem902 remainder 123e1 20000 -> 1230
-dqrem903 remainder 123e1 2000 -> 1230
-dqrem904 remainder 123e1 200 -> 30
-dqrem905 remainder 123e1 20 -> 10
-dqrem906 remainder 123e1 2 -> 0
-
-dqrem910 remainder 123e1 5000000000000000 -> 1230
-dqrem911 remainder 123e1 500000000000000 -> 1230
-dqrem912 remainder 123e1 50000000000000 -> 1230
-dqrem913 remainder 123e1 5000000000000 -> 1230
-dqrem914 remainder 123e1 500000000000 -> 1230
-dqrem915 remainder 123e1 50000000000 -> 1230
-dqrem916 remainder 123e1 5000000000 -> 1230
-dqrem917 remainder 123e1 500000000 -> 1230
-dqrem919 remainder 123e1 50000000 -> 1230
-dqrem920 remainder 123e1 5000000 -> 1230
-dqrem921 remainder 123e1 500000 -> 1230
-dqrem922 remainder 123e1 50000 -> 1230
-dqrem923 remainder 123e1 5000 -> 1230
-dqrem924 remainder 123e1 500 -> 230
-dqrem925 remainder 123e1 50 -> 30
-dqrem926 remainder 123e1 5 -> 0
-
-dqrem930 remainder 123e1 9000000000000000 -> 1230
-dqrem931 remainder 123e1 900000000000000 -> 1230
-dqrem932 remainder 123e1 90000000000000 -> 1230
-dqrem933 remainder 123e1 9000000000000 -> 1230
-dqrem934 remainder 123e1 900000000000 -> 1230
-dqrem935 remainder 123e1 90000000000 -> 1230
-dqrem936 remainder 123e1 9000000000 -> 1230
-dqrem937 remainder 123e1 900000000 -> 1230
-dqrem939 remainder 123e1 90000000 -> 1230
-dqrem940 remainder 123e1 9000000 -> 1230
-dqrem941 remainder 123e1 900000 -> 1230
-dqrem942 remainder 123e1 90000 -> 1230
-dqrem943 remainder 123e1 9000 -> 1230
-dqrem944 remainder 123e1 900 -> 330
-dqrem945 remainder 123e1 90 -> 60
-dqrem946 remainder 123e1 9 -> 6
-
-dqrem950 remainder 123e1 1000000000000000 -> 1230
-dqrem961 remainder 123e1 2999999999999999 -> 1230
-dqrem962 remainder 123e1 3999999999999999 -> 1230
-dqrem963 remainder 123e1 4999999999999999 -> 1230
-dqrem964 remainder 123e1 5999999999999999 -> 1230
-dqrem965 remainder 123e1 6999999999999999 -> 1230
-dqrem966 remainder 123e1 7999999999999999 -> 1230
-dqrem967 remainder 123e1 8999999999999999 -> 1230
-dqrem968 remainder 123e1 9999999999999999 -> 1230
-dqrem969 remainder 123e1 9876543210987654 -> 1230
-
-dqrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
-
--- overflow and underflow tests [from divide]
-dqrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
-dqrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
-dqrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
-dqrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
-dqrem1055 remainder 1e-277 1e+311 -> 1E-277
-dqrem1056 remainder 1e-277 -1e+311 -> 1E-277
-dqrem1057 remainder -1e-277 1e+311 -> -1E-277
-dqrem1058 remainder -1e-277 -1e+311 -> -1E-277
-
--- Gyuris example
-dqrem1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
-
--- destructive subtract
-dqrem1120 remainder 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> 0.765432109876543210987654321098768
-dqrem1121 remainder 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> 0.65432109876543210987654321098779
-dqrem1122 remainder 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> 0.5432109876543210987654321098890
-dqrem1123 remainder 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> 2.691358027469135802746913580274687
-dqrem1124 remainder 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692
-dqrem1125 remainder 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> 3.6913578024691357802469135780251
-dqrem1126 remainder 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247
-dqrem1127 remainder 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> 4.246913578024691357802469135780246
-dqrem1128 remainder 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> 4.3086421975308642197530864219759
-
--- Null tests
-dqrem1000 remainder 10 # -> NaN Invalid_operation
-dqrem1001 remainder # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqRemainder.decTest -- decQuad remainder --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks (as base, above)
+dqrem001 remainder 1 1 -> 0
+dqrem002 remainder 2 1 -> 0
+dqrem003 remainder 1 2 -> 1
+dqrem004 remainder 2 2 -> 0
+dqrem005 remainder 0 1 -> 0
+dqrem006 remainder 0 2 -> 0
+dqrem007 remainder 1 3 -> 1
+dqrem008 remainder 2 3 -> 2
+dqrem009 remainder 3 3 -> 0
+
+dqrem010 remainder 2.4 1 -> 0.4
+dqrem011 remainder 2.4 -1 -> 0.4
+dqrem012 remainder -2.4 1 -> -0.4
+dqrem013 remainder -2.4 -1 -> -0.4
+dqrem014 remainder 2.40 1 -> 0.40
+dqrem015 remainder 2.400 1 -> 0.400
+dqrem016 remainder 2.4 2 -> 0.4
+dqrem017 remainder 2.400 2 -> 0.400
+dqrem018 remainder 2. 2 -> 0
+dqrem019 remainder 20 20 -> 0
+
+dqrem020 remainder 187 187 -> 0
+dqrem021 remainder 5 2 -> 1
+dqrem022 remainder 5 2.0 -> 1.0
+dqrem023 remainder 5 2.000 -> 1.000
+dqrem024 remainder 5 0.200 -> 0.000
+dqrem025 remainder 5 0.200 -> 0.000
+
+dqrem030 remainder 1 2 -> 1
+dqrem031 remainder 1 4 -> 1
+dqrem032 remainder 1 8 -> 1
+
+dqrem033 remainder 1 16 -> 1
+dqrem034 remainder 1 32 -> 1
+dqrem035 remainder 1 64 -> 1
+dqrem040 remainder 1 -2 -> 1
+dqrem041 remainder 1 -4 -> 1
+dqrem042 remainder 1 -8 -> 1
+dqrem043 remainder 1 -16 -> 1
+dqrem044 remainder 1 -32 -> 1
+dqrem045 remainder 1 -64 -> 1
+dqrem050 remainder -1 2 -> -1
+dqrem051 remainder -1 4 -> -1
+dqrem052 remainder -1 8 -> -1
+dqrem053 remainder -1 16 -> -1
+dqrem054 remainder -1 32 -> -1
+dqrem055 remainder -1 64 -> -1
+dqrem060 remainder -1 -2 -> -1
+dqrem061 remainder -1 -4 -> -1
+dqrem062 remainder -1 -8 -> -1
+dqrem063 remainder -1 -16 -> -1
+dqrem064 remainder -1 -32 -> -1
+dqrem065 remainder -1 -64 -> -1
+
+dqrem066 remainder 999999999 1 -> 0
+dqrem067 remainder 999999999.4 1 -> 0.4
+dqrem068 remainder 999999999.5 1 -> 0.5
+dqrem069 remainder 999999999.9 1 -> 0.9
+dqrem070 remainder 999999999.999 1 -> 0.999
+dqrem071 remainder 999999.999999 1 -> 0.999999
+dqrem072 remainder 9 1 -> 0
+
+dqrem080 remainder 0. 1 -> 0
+dqrem081 remainder .0 1 -> 0.0
+dqrem082 remainder 0.00 1 -> 0.00
+dqrem083 remainder 0.00E+9 1 -> 0
+dqrem084 remainder 0.00E+3 1 -> 0
+dqrem085 remainder 0.00E+2 1 -> 0
+dqrem086 remainder 0.00E+1 1 -> 0.0
+dqrem087 remainder 0.00E+0 1 -> 0.00
+dqrem088 remainder 0.00E-0 1 -> 0.00
+dqrem089 remainder 0.00E-1 1 -> 0.000
+dqrem090 remainder 0.00E-2 1 -> 0.0000
+dqrem091 remainder 0.00E-3 1 -> 0.00000
+dqrem092 remainder 0.00E-4 1 -> 0.000000
+dqrem093 remainder 0.00E-5 1 -> 0E-7
+dqrem094 remainder 0.00E-6 1 -> 0E-8
+dqrem095 remainder 0.0000E-50 1 -> 0E-54
+
+-- Various flavours of remainder by 0
+dqrem101 remainder 0 0 -> NaN Division_undefined
+dqrem102 remainder 0 -0 -> NaN Division_undefined
+dqrem103 remainder -0 0 -> NaN Division_undefined
+dqrem104 remainder -0 -0 -> NaN Division_undefined
+dqrem105 remainder 0.0E5 0 -> NaN Division_undefined
+dqrem106 remainder 0.000 0 -> NaN Division_undefined
+-- [Some think this next group should be Division_by_zero exception, but
+-- IEEE 854 is explicit that it is Invalid operation .. for
+-- remainder-near, anyway]
+dqrem107 remainder 0.0001 0 -> NaN Invalid_operation
+dqrem108 remainder 0.01 0 -> NaN Invalid_operation
+dqrem109 remainder 0.1 0 -> NaN Invalid_operation
+dqrem110 remainder 1 0 -> NaN Invalid_operation
+dqrem111 remainder 1 0.0 -> NaN Invalid_operation
+dqrem112 remainder 10 0.0 -> NaN Invalid_operation
+dqrem113 remainder 1E+100 0.0 -> NaN Invalid_operation
+dqrem114 remainder 1E+380 0 -> NaN Invalid_operation
+dqrem115 remainder 0.0001 -0 -> NaN Invalid_operation
+dqrem116 remainder 0.01 -0 -> NaN Invalid_operation
+dqrem119 remainder 0.1 -0 -> NaN Invalid_operation
+dqrem120 remainder 1 -0 -> NaN Invalid_operation
+dqrem121 remainder 1 -0.0 -> NaN Invalid_operation
+dqrem122 remainder 10 -0.0 -> NaN Invalid_operation
+dqrem123 remainder 1E+100 -0.0 -> NaN Invalid_operation
+dqrem124 remainder 1E+384 -0 -> NaN Invalid_operation
+-- and zeros on left
+dqrem130 remainder 0 1 -> 0
+dqrem131 remainder 0 -1 -> 0
+dqrem132 remainder 0.0 1 -> 0.0
+dqrem133 remainder 0.0 -1 -> 0.0
+dqrem134 remainder -0 1 -> -0
+dqrem135 remainder -0 -1 -> -0
+dqrem136 remainder -0.0 1 -> -0.0
+dqrem137 remainder -0.0 -1 -> -0.0
+
+-- 0.5ers
+dqrem143 remainder 0.5 2 -> 0.5
+dqrem144 remainder 0.5 2.1 -> 0.5
+dqrem145 remainder 0.5 2.01 -> 0.50
+dqrem146 remainder 0.5 2.001 -> 0.500
+dqrem147 remainder 0.50 2 -> 0.50
+dqrem148 remainder 0.50 2.01 -> 0.50
+dqrem149 remainder 0.50 2.001 -> 0.500
+
+-- steadies
+dqrem150 remainder 1 1 -> 0
+dqrem151 remainder 1 2 -> 1
+dqrem152 remainder 1 3 -> 1
+dqrem153 remainder 1 4 -> 1
+dqrem154 remainder 1 5 -> 1
+dqrem155 remainder 1 6 -> 1
+dqrem156 remainder 1 7 -> 1
+dqrem157 remainder 1 8 -> 1
+dqrem158 remainder 1 9 -> 1
+dqrem159 remainder 1 10 -> 1
+dqrem160 remainder 1 1 -> 0
+dqrem161 remainder 2 1 -> 0
+dqrem162 remainder 3 1 -> 0
+dqrem163 remainder 4 1 -> 0
+dqrem164 remainder 5 1 -> 0
+dqrem165 remainder 6 1 -> 0
+dqrem166 remainder 7 1 -> 0
+dqrem167 remainder 8 1 -> 0
+dqrem168 remainder 9 1 -> 0
+dqrem169 remainder 10 1 -> 0
+
+-- some differences from remainderNear
+dqrem171 remainder 0.4 1.020 -> 0.400
+dqrem172 remainder 0.50 1.020 -> 0.500
+dqrem173 remainder 0.51 1.020 -> 0.510
+dqrem174 remainder 0.52 1.020 -> 0.520
+dqrem175 remainder 0.6 1.020 -> 0.600
+
+-- More flavours of remainder by 0
+dqrem201 remainder 0 0 -> NaN Division_undefined
+dqrem202 remainder 0.0E5 0 -> NaN Division_undefined
+dqrem203 remainder 0.000 0 -> NaN Division_undefined
+dqrem204 remainder 0.0001 0 -> NaN Invalid_operation
+dqrem205 remainder 0.01 0 -> NaN Invalid_operation
+dqrem206 remainder 0.1 0 -> NaN Invalid_operation
+dqrem207 remainder 1 0 -> NaN Invalid_operation
+dqrem208 remainder 1 0.0 -> NaN Invalid_operation
+dqrem209 remainder 10 0.0 -> NaN Invalid_operation
+dqrem210 remainder 1E+100 0.0 -> NaN Invalid_operation
+dqrem211 remainder 1E+380 0 -> NaN Invalid_operation
+
+-- some differences from remainderNear
+dqrem231 remainder -0.4 1.020 -> -0.400
+dqrem232 remainder -0.50 1.020 -> -0.500
+dqrem233 remainder -0.51 1.020 -> -0.510
+dqrem234 remainder -0.52 1.020 -> -0.520
+dqrem235 remainder -0.6 1.020 -> -0.600
+
+-- high Xs
+dqrem240 remainder 1E+2 1.00 -> 0.00
+
+-- dqrem3xx are from DiagBigDecimal
+dqrem301 remainder 1 3 -> 1
+dqrem302 remainder 5 5 -> 0
+dqrem303 remainder 13 10 -> 3
+dqrem304 remainder 13 50 -> 13
+dqrem305 remainder 13 100 -> 13
+dqrem306 remainder 13 1000 -> 13
+dqrem307 remainder .13 1 -> 0.13
+dqrem308 remainder 0.133 1 -> 0.133
+dqrem309 remainder 0.1033 1 -> 0.1033
+dqrem310 remainder 1.033 1 -> 0.033
+dqrem311 remainder 10.33 1 -> 0.33
+dqrem312 remainder 10.33 10 -> 0.33
+dqrem313 remainder 103.3 1 -> 0.3
+dqrem314 remainder 133 10 -> 3
+dqrem315 remainder 1033 10 -> 3
+dqrem316 remainder 1033 50 -> 33
+dqrem317 remainder 101.0 3 -> 2.0
+dqrem318 remainder 102.0 3 -> 0.0
+dqrem319 remainder 103.0 3 -> 1.0
+dqrem320 remainder 2.40 1 -> 0.40
+dqrem321 remainder 2.400 1 -> 0.400
+dqrem322 remainder 2.4 1 -> 0.4
+dqrem323 remainder 2.4 2 -> 0.4
+dqrem324 remainder 2.400 2 -> 0.400
+dqrem325 remainder 1 0.3 -> 0.1
+dqrem326 remainder 1 0.30 -> 0.10
+dqrem327 remainder 1 0.300 -> 0.100
+dqrem328 remainder 1 0.3000 -> 0.1000
+dqrem329 remainder 1.0 0.3 -> 0.1
+dqrem330 remainder 1.00 0.3 -> 0.10
+dqrem331 remainder 1.000 0.3 -> 0.100
+dqrem332 remainder 1.0000 0.3 -> 0.1000
+dqrem333 remainder 0.5 2 -> 0.5
+dqrem334 remainder 0.5 2.1 -> 0.5
+dqrem335 remainder 0.5 2.01 -> 0.50
+dqrem336 remainder 0.5 2.001 -> 0.500
+dqrem337 remainder 0.50 2 -> 0.50
+dqrem338 remainder 0.50 2.01 -> 0.50
+dqrem339 remainder 0.50 2.001 -> 0.500
+
+dqrem340 remainder 0.5 0.5000001 -> 0.5000000
+dqrem341 remainder 0.5 0.50000001 -> 0.50000000
+dqrem342 remainder 0.5 0.500000001 -> 0.500000000
+dqrem343 remainder 0.5 0.5000000001 -> 0.5000000000
+dqrem344 remainder 0.5 0.50000000001 -> 0.50000000000
+dqrem345 remainder 0.5 0.4999999 -> 1E-7
+dqrem346 remainder 0.5 0.49999999 -> 1E-8
+dqrem347 remainder 0.5 0.499999999 -> 1E-9
+dqrem348 remainder 0.5 0.4999999999 -> 1E-10
+dqrem349 remainder 0.5 0.49999999999 -> 1E-11
+dqrem350 remainder 0.5 0.499999999999 -> 1E-12
+
+dqrem351 remainder 0.03 7 -> 0.03
+dqrem352 remainder 5 2 -> 1
+dqrem353 remainder 4.1 2 -> 0.1
+dqrem354 remainder 4.01 2 -> 0.01
+dqrem355 remainder 4.001 2 -> 0.001
+dqrem356 remainder 4.0001 2 -> 0.0001
+dqrem357 remainder 4.00001 2 -> 0.00001
+dqrem358 remainder 4.000001 2 -> 0.000001
+dqrem359 remainder 4.0000001 2 -> 1E-7
+
+dqrem360 remainder 1.2 0.7345 -> 0.4655
+dqrem361 remainder 0.8 12 -> 0.8
+dqrem362 remainder 0.8 0.2 -> 0.0
+dqrem363 remainder 0.8 0.3 -> 0.2
+dqrem364 remainder 0.800 12 -> 0.800
+dqrem365 remainder 0.800 1.7 -> 0.800
+dqrem366 remainder 2.400 2 -> 0.400
+
+dqrem371 remainder 2.400 2 -> 0.400
+
+dqrem381 remainder 12345 1 -> 0
+dqrem382 remainder 12345 1.0001 -> 0.7657
+dqrem383 remainder 12345 1.001 -> 0.668
+dqrem384 remainder 12345 1.01 -> 0.78
+dqrem385 remainder 12345 1.1 -> 0.8
+dqrem386 remainder 12355 4 -> 3
+dqrem387 remainder 12345 4 -> 1
+dqrem388 remainder 12355 4.0001 -> 2.6912
+dqrem389 remainder 12345 4.0001 -> 0.6914
+dqrem390 remainder 12345 4.9 -> 1.9
+dqrem391 remainder 12345 4.99 -> 4.73
+dqrem392 remainder 12345 4.999 -> 2.469
+dqrem393 remainder 12345 4.9999 -> 0.2469
+dqrem394 remainder 12345 5 -> 0
+dqrem395 remainder 12345 5.0001 -> 4.7532
+dqrem396 remainder 12345 5.001 -> 2.532
+dqrem397 remainder 12345 5.01 -> 0.36
+dqrem398 remainder 12345 5.1 -> 3.0
+
+-- the nasty division-by-1 cases
+dqrem401 remainder 0.5 1 -> 0.5
+dqrem402 remainder 0.55 1 -> 0.55
+dqrem403 remainder 0.555 1 -> 0.555
+dqrem404 remainder 0.5555 1 -> 0.5555
+dqrem405 remainder 0.55555 1 -> 0.55555
+dqrem406 remainder 0.555555 1 -> 0.555555
+dqrem407 remainder 0.5555555 1 -> 0.5555555
+dqrem408 remainder 0.55555555 1 -> 0.55555555
+dqrem409 remainder 0.555555555 1 -> 0.555555555
+
+-- folddowns
+dqrem421 remainder 1E+6144 1 -> NaN Division_impossible
+dqrem422 remainder 1E+6144 1E+6143 -> 0E+6111 Clamped
+dqrem423 remainder 1E+6144 2E+6143 -> 0E+6111 Clamped
+dqrem424 remainder 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqrem425 remainder 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
+dqrem426 remainder 1E+6144 5E+6143 -> 0E+6111 Clamped
+dqrem427 remainder 1E+6144 6E+6143 -> 4.00000000000000000000000000000000E+6143 Clamped
+dqrem428 remainder 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped
+dqrem429 remainder 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
+dqrem430 remainder 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
+-- tinies
+dqrem431 remainder 1E-6175 1E-6176 -> 0E-6176
+dqrem432 remainder 1E-6175 2E-6176 -> 0E-6176
+dqrem433 remainder 1E-6175 3E-6176 -> 1E-6176 Subnormal
+dqrem434 remainder 1E-6175 4E-6176 -> 2E-6176 Subnormal
+dqrem435 remainder 1E-6175 5E-6176 -> 0E-6176
+dqrem436 remainder 1E-6175 6E-6176 -> 4E-6176 Subnormal
+dqrem437 remainder 1E-6175 7E-6176 -> 3E-6176 Subnormal
+dqrem438 remainder 1E-6175 8E-6176 -> 2E-6176 Subnormal
+dqrem439 remainder 1E-6175 9E-6176 -> 1E-6176 Subnormal
+dqrem440 remainder 1E-6175 10E-6176 -> 0E-6176
+dqrem441 remainder 1E-6175 11E-6176 -> 1.0E-6175 Subnormal
+dqrem442 remainder 100E-6175 11E-6176 -> 1.0E-6175 Subnormal
+dqrem443 remainder 100E-6175 20E-6176 -> 0E-6176
+dqrem444 remainder 100E-6175 21E-6176 -> 1.3E-6175 Subnormal
+dqrem445 remainder 100E-6175 30E-6176 -> 1.0E-6175 Subnormal
+
+-- zero signs
+dqrem650 remainder 1 1 -> 0
+dqrem651 remainder -1 1 -> -0
+dqrem652 remainder 1 -1 -> 0
+dqrem653 remainder -1 -1 -> -0
+dqrem654 remainder 0 1 -> 0
+dqrem655 remainder -0 1 -> -0
+dqrem656 remainder 0 -1 -> 0
+dqrem657 remainder -0 -1 -> -0
+dqrem658 remainder 0.00 1 -> 0.00
+dqrem659 remainder -0.00 1 -> -0.00
+
+-- Specials
+dqrem680 remainder Inf -Inf -> NaN Invalid_operation
+dqrem681 remainder Inf -1000 -> NaN Invalid_operation
+dqrem682 remainder Inf -1 -> NaN Invalid_operation
+dqrem683 remainder Inf 0 -> NaN Invalid_operation
+dqrem684 remainder Inf -0 -> NaN Invalid_operation
+dqrem685 remainder Inf 1 -> NaN Invalid_operation
+dqrem686 remainder Inf 1000 -> NaN Invalid_operation
+dqrem687 remainder Inf Inf -> NaN Invalid_operation
+dqrem688 remainder -1000 Inf -> -1000
+dqrem689 remainder -Inf Inf -> NaN Invalid_operation
+dqrem691 remainder -1 Inf -> -1
+dqrem692 remainder 0 Inf -> 0
+dqrem693 remainder -0 Inf -> -0
+dqrem694 remainder 1 Inf -> 1
+dqrem695 remainder 1000 Inf -> 1000
+dqrem696 remainder Inf Inf -> NaN Invalid_operation
+
+dqrem700 remainder -Inf -Inf -> NaN Invalid_operation
+dqrem701 remainder -Inf -1000 -> NaN Invalid_operation
+dqrem702 remainder -Inf -1 -> NaN Invalid_operation
+dqrem703 remainder -Inf -0 -> NaN Invalid_operation
+dqrem704 remainder -Inf 0 -> NaN Invalid_operation
+dqrem705 remainder -Inf 1 -> NaN Invalid_operation
+dqrem706 remainder -Inf 1000 -> NaN Invalid_operation
+dqrem707 remainder -Inf Inf -> NaN Invalid_operation
+dqrem708 remainder -Inf -Inf -> NaN Invalid_operation
+dqrem709 remainder -1000 Inf -> -1000
+dqrem710 remainder -1 -Inf -> -1
+dqrem711 remainder -0 -Inf -> -0
+dqrem712 remainder 0 -Inf -> 0
+dqrem713 remainder 1 -Inf -> 1
+dqrem714 remainder 1000 -Inf -> 1000
+dqrem715 remainder Inf -Inf -> NaN Invalid_operation
+
+dqrem721 remainder NaN -Inf -> NaN
+dqrem722 remainder NaN -1000 -> NaN
+dqrem723 remainder NaN -1 -> NaN
+dqrem724 remainder NaN -0 -> NaN
+dqrem725 remainder -NaN 0 -> -NaN
+dqrem726 remainder NaN 1 -> NaN
+dqrem727 remainder NaN 1000 -> NaN
+dqrem728 remainder NaN Inf -> NaN
+dqrem729 remainder NaN -NaN -> NaN
+dqrem730 remainder -Inf NaN -> NaN
+dqrem731 remainder -1000 NaN -> NaN
+dqrem732 remainder -1 NaN -> NaN
+dqrem733 remainder -0 -NaN -> -NaN
+dqrem734 remainder 0 NaN -> NaN
+dqrem735 remainder 1 -NaN -> -NaN
+dqrem736 remainder 1000 NaN -> NaN
+dqrem737 remainder Inf NaN -> NaN
+
+dqrem741 remainder sNaN -Inf -> NaN Invalid_operation
+dqrem742 remainder sNaN -1000 -> NaN Invalid_operation
+dqrem743 remainder -sNaN -1 -> -NaN Invalid_operation
+dqrem744 remainder sNaN -0 -> NaN Invalid_operation
+dqrem745 remainder sNaN 0 -> NaN Invalid_operation
+dqrem746 remainder sNaN 1 -> NaN Invalid_operation
+dqrem747 remainder sNaN 1000 -> NaN Invalid_operation
+dqrem749 remainder sNaN NaN -> NaN Invalid_operation
+dqrem750 remainder sNaN sNaN -> NaN Invalid_operation
+dqrem751 remainder NaN sNaN -> NaN Invalid_operation
+dqrem752 remainder -Inf sNaN -> NaN Invalid_operation
+dqrem753 remainder -1000 sNaN -> NaN Invalid_operation
+dqrem754 remainder -1 sNaN -> NaN Invalid_operation
+dqrem755 remainder -0 sNaN -> NaN Invalid_operation
+dqrem756 remainder 0 sNaN -> NaN Invalid_operation
+dqrem757 remainder 1 sNaN -> NaN Invalid_operation
+dqrem758 remainder 1000 sNaN -> NaN Invalid_operation
+dqrem759 remainder Inf -sNaN -> -NaN Invalid_operation
+
+-- propaging NaNs
+dqrem760 remainder NaN1 NaN7 -> NaN1
+dqrem761 remainder sNaN2 NaN8 -> NaN2 Invalid_operation
+dqrem762 remainder NaN3 sNaN9 -> NaN9 Invalid_operation
+dqrem763 remainder sNaN4 sNaN10 -> NaN4 Invalid_operation
+dqrem764 remainder 15 NaN11 -> NaN11
+dqrem765 remainder NaN6 NaN12 -> NaN6
+dqrem766 remainder Inf NaN13 -> NaN13
+dqrem767 remainder NaN14 -Inf -> NaN14
+dqrem768 remainder 0 NaN15 -> NaN15
+dqrem769 remainder NaN16 -0 -> NaN16
+
+-- edge cases of impossible
+dqrem770 remainder 1234568888888887777777777890123456 10 -> 6
+dqrem771 remainder 1234568888888887777777777890123456 1 -> 0
+dqrem772 remainder 1234568888888887777777777890123456 0.1 -> NaN Division_impossible
+dqrem773 remainder 1234568888888887777777777890123456 0.01 -> NaN Division_impossible
+
+-- long operand checks
+dqrem801 remainder 12345678000 100 -> 0
+dqrem802 remainder 1 12345678000 -> 1
+dqrem803 remainder 1234567800 10 -> 0
+dqrem804 remainder 1 1234567800 -> 1
+dqrem805 remainder 1234567890 10 -> 0
+dqrem806 remainder 1 1234567890 -> 1
+dqrem807 remainder 1234567891 10 -> 1
+dqrem808 remainder 1 1234567891 -> 1
+dqrem809 remainder 12345678901 100 -> 1
+dqrem810 remainder 1 12345678901 -> 1
+dqrem811 remainder 1234567896 10 -> 6
+dqrem812 remainder 1 1234567896 -> 1
+
+dqrem821 remainder 12345678000 100 -> 0
+dqrem822 remainder 1 12345678000 -> 1
+dqrem823 remainder 1234567800 10 -> 0
+dqrem824 remainder 1 1234567800 -> 1
+dqrem825 remainder 1234567890 10 -> 0
+dqrem826 remainder 1 1234567890 -> 1
+dqrem827 remainder 1234567891 10 -> 1
+dqrem828 remainder 1 1234567891 -> 1
+dqrem829 remainder 12345678901 100 -> 1
+dqrem830 remainder 1 12345678901 -> 1
+dqrem831 remainder 1234567896 10 -> 6
+dqrem832 remainder 1 1234567896 -> 1
+
+-- from divideint
+dqrem840 remainder 100000000.0 1 -> 0.0
+dqrem841 remainder 100000000.4 1 -> 0.4
+dqrem842 remainder 100000000.5 1 -> 0.5
+dqrem843 remainder 100000000.9 1 -> 0.9
+dqrem844 remainder 100000000.999 1 -> 0.999
+dqrem850 remainder 100000003 5 -> 3
+dqrem851 remainder 10000003 5 -> 3
+dqrem852 remainder 1000003 5 -> 3
+dqrem853 remainder 100003 5 -> 3
+dqrem854 remainder 10003 5 -> 3
+dqrem855 remainder 1003 5 -> 3
+dqrem856 remainder 103 5 -> 3
+dqrem857 remainder 13 5 -> 3
+dqrem858 remainder 1 5 -> 1
+
+-- Vladimir's cases 1234567890123456
+dqrem860 remainder 123.0e1 1000000000000000 -> 1230
+dqrem861 remainder 1230 1000000000000000 -> 1230
+dqrem862 remainder 12.3e2 1000000000000000 -> 1230
+dqrem863 remainder 1.23e3 1000000000000000 -> 1230
+dqrem864 remainder 123e1 1000000000000000 -> 1230
+dqrem870 remainder 123e1 1000000000000000 -> 1230
+dqrem871 remainder 123e1 100000000000000 -> 1230
+dqrem872 remainder 123e1 10000000000000 -> 1230
+dqrem873 remainder 123e1 1000000000000 -> 1230
+dqrem874 remainder 123e1 100000000000 -> 1230
+dqrem875 remainder 123e1 10000000000 -> 1230
+dqrem876 remainder 123e1 1000000000 -> 1230
+dqrem877 remainder 123e1 100000000 -> 1230
+dqrem878 remainder 1230 100000000 -> 1230
+dqrem879 remainder 123e1 10000000 -> 1230
+dqrem880 remainder 123e1 1000000 -> 1230
+dqrem881 remainder 123e1 100000 -> 1230
+dqrem882 remainder 123e1 10000 -> 1230
+dqrem883 remainder 123e1 1000 -> 230
+dqrem884 remainder 123e1 100 -> 30
+dqrem885 remainder 123e1 10 -> 0
+dqrem886 remainder 123e1 1 -> 0
+
+dqrem890 remainder 123e1 2000000000000000 -> 1230
+dqrem891 remainder 123e1 200000000000000 -> 1230
+dqrem892 remainder 123e1 20000000000000 -> 1230
+dqrem893 remainder 123e1 2000000000000 -> 1230
+dqrem894 remainder 123e1 200000000000 -> 1230
+dqrem895 remainder 123e1 20000000000 -> 1230
+dqrem896 remainder 123e1 2000000000 -> 1230
+dqrem897 remainder 123e1 200000000 -> 1230
+dqrem899 remainder 123e1 20000000 -> 1230
+dqrem900 remainder 123e1 2000000 -> 1230
+dqrem901 remainder 123e1 200000 -> 1230
+dqrem902 remainder 123e1 20000 -> 1230
+dqrem903 remainder 123e1 2000 -> 1230
+dqrem904 remainder 123e1 200 -> 30
+dqrem905 remainder 123e1 20 -> 10
+dqrem906 remainder 123e1 2 -> 0
+
+dqrem910 remainder 123e1 5000000000000000 -> 1230
+dqrem911 remainder 123e1 500000000000000 -> 1230
+dqrem912 remainder 123e1 50000000000000 -> 1230
+dqrem913 remainder 123e1 5000000000000 -> 1230
+dqrem914 remainder 123e1 500000000000 -> 1230
+dqrem915 remainder 123e1 50000000000 -> 1230
+dqrem916 remainder 123e1 5000000000 -> 1230
+dqrem917 remainder 123e1 500000000 -> 1230
+dqrem919 remainder 123e1 50000000 -> 1230
+dqrem920 remainder 123e1 5000000 -> 1230
+dqrem921 remainder 123e1 500000 -> 1230
+dqrem922 remainder 123e1 50000 -> 1230
+dqrem923 remainder 123e1 5000 -> 1230
+dqrem924 remainder 123e1 500 -> 230
+dqrem925 remainder 123e1 50 -> 30
+dqrem926 remainder 123e1 5 -> 0
+
+dqrem930 remainder 123e1 9000000000000000 -> 1230
+dqrem931 remainder 123e1 900000000000000 -> 1230
+dqrem932 remainder 123e1 90000000000000 -> 1230
+dqrem933 remainder 123e1 9000000000000 -> 1230
+dqrem934 remainder 123e1 900000000000 -> 1230
+dqrem935 remainder 123e1 90000000000 -> 1230
+dqrem936 remainder 123e1 9000000000 -> 1230
+dqrem937 remainder 123e1 900000000 -> 1230
+dqrem939 remainder 123e1 90000000 -> 1230
+dqrem940 remainder 123e1 9000000 -> 1230
+dqrem941 remainder 123e1 900000 -> 1230
+dqrem942 remainder 123e1 90000 -> 1230
+dqrem943 remainder 123e1 9000 -> 1230
+dqrem944 remainder 123e1 900 -> 330
+dqrem945 remainder 123e1 90 -> 60
+dqrem946 remainder 123e1 9 -> 6
+
+dqrem950 remainder 123e1 1000000000000000 -> 1230
+dqrem961 remainder 123e1 2999999999999999 -> 1230
+dqrem962 remainder 123e1 3999999999999999 -> 1230
+dqrem963 remainder 123e1 4999999999999999 -> 1230
+dqrem964 remainder 123e1 5999999999999999 -> 1230
+dqrem965 remainder 123e1 6999999999999999 -> 1230
+dqrem966 remainder 123e1 7999999999999999 -> 1230
+dqrem967 remainder 123e1 8999999999999999 -> 1230
+dqrem968 remainder 123e1 9999999999999999 -> 1230
+dqrem969 remainder 123e1 9876543210987654 -> 1230
+
+dqrem980 remainder 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
+
+-- overflow and underflow tests [from divide]
+dqrem1051 remainder 1e+277 1e-311 -> NaN Division_impossible
+dqrem1052 remainder 1e+277 -1e-311 -> NaN Division_impossible
+dqrem1053 remainder -1e+277 1e-311 -> NaN Division_impossible
+dqrem1054 remainder -1e+277 -1e-311 -> NaN Division_impossible
+dqrem1055 remainder 1e-277 1e+311 -> 1E-277
+dqrem1056 remainder 1e-277 -1e+311 -> 1E-277
+dqrem1057 remainder -1e-277 1e+311 -> -1E-277
+dqrem1058 remainder -1e-277 -1e+311 -> -1E-277
+
+-- Gyuris example
+dqrem1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
+
+-- destructive subtract
+dqrem1120 remainder 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> 0.765432109876543210987654321098768
+dqrem1121 remainder 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> 0.65432109876543210987654321098779
+dqrem1122 remainder 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> 0.5432109876543210987654321098890
+dqrem1123 remainder 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> 2.691358027469135802746913580274687
+dqrem1124 remainder 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692
+dqrem1125 remainder 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> 3.6913578024691357802469135780251
+dqrem1126 remainder 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247
+dqrem1127 remainder 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> 4.246913578024691357802469135780246
+dqrem1128 remainder 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> 4.3086421975308642197530864219759
+
+-- Null tests
+dqrem1000 remainder 10 # -> NaN Invalid_operation
+dqrem1001 remainder # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqRemainderNear.decTest b/Lib/test/decimaltestdata/dqRemainderNear.decTest
index b850626fe4..0dd273fe38 100644
--- a/Lib/test/decimaltestdata/dqRemainderNear.decTest
+++ b/Lib/test/decimaltestdata/dqRemainderNear.decTest
@@ -1,631 +1,631 @@
-------------------------------------------------------------------------
--- dqRemainderNear.decTest -- decQuad remainder-near --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- sanity checks (as base, above)
-dqrmn001 remaindernear 1 1 -> 0
-dqrmn002 remaindernear 2 1 -> 0
-dqrmn003 remaindernear 1 2 -> 1
-dqrmn004 remaindernear 2 2 -> 0
-dqrmn005 remaindernear 0 1 -> 0
-dqrmn006 remaindernear 0 2 -> 0
-dqrmn007 remaindernear 1 3 -> 1
-dqrmn008 remaindernear 2 3 -> -1
-dqrmn009 remaindernear 3 3 -> 0
-
-dqrmn010 remaindernear 2.4 1 -> 0.4
-dqrmn011 remaindernear 2.4 -1 -> 0.4
-dqrmn012 remaindernear -2.4 1 -> -0.4
-dqrmn013 remaindernear -2.4 -1 -> -0.4
-dqrmn014 remaindernear 2.40 1 -> 0.40
-dqrmn015 remaindernear 2.400 1 -> 0.400
-dqrmn016 remaindernear 2.4 2 -> 0.4
-dqrmn017 remaindernear 2.400 2 -> 0.400
-dqrmn018 remaindernear 2. 2 -> 0
-dqrmn019 remaindernear 20 20 -> 0
-
-dqrmn020 remaindernear 187 187 -> 0
-dqrmn021 remaindernear 5 2 -> 1
-dqrmn022 remaindernear 5 2.0 -> 1.0
-dqrmn023 remaindernear 5 2.000 -> 1.000
-dqrmn024 remaindernear 5 0.200 -> 0.000
-dqrmn025 remaindernear 5 0.200 -> 0.000
-
-dqrmn030 remaindernear 1 2 -> 1
-dqrmn031 remaindernear 1 4 -> 1
-dqrmn032 remaindernear 1 8 -> 1
-
-dqrmn033 remaindernear 1 16 -> 1
-dqrmn034 remaindernear 1 32 -> 1
-dqrmn035 remaindernear 1 64 -> 1
-dqrmn040 remaindernear 1 -2 -> 1
-dqrmn041 remaindernear 1 -4 -> 1
-dqrmn042 remaindernear 1 -8 -> 1
-dqrmn043 remaindernear 1 -16 -> 1
-dqrmn044 remaindernear 1 -32 -> 1
-dqrmn045 remaindernear 1 -64 -> 1
-dqrmn050 remaindernear -1 2 -> -1
-dqrmn051 remaindernear -1 4 -> -1
-dqrmn052 remaindernear -1 8 -> -1
-dqrmn053 remaindernear -1 16 -> -1
-dqrmn054 remaindernear -1 32 -> -1
-dqrmn055 remaindernear -1 64 -> -1
-dqrmn060 remaindernear -1 -2 -> -1
-dqrmn061 remaindernear -1 -4 -> -1
-dqrmn062 remaindernear -1 -8 -> -1
-dqrmn063 remaindernear -1 -16 -> -1
-dqrmn064 remaindernear -1 -32 -> -1
-dqrmn065 remaindernear -1 -64 -> -1
-
-dqrmn066 remaindernear 9.9 1 -> -0.1
-dqrmn067 remaindernear 99.7 1 -> -0.3
-dqrmn068 remaindernear 999999999 1 -> 0
-dqrmn069 remaindernear 999999999.4 1 -> 0.4
-dqrmn070 remaindernear 999999999.5 1 -> -0.5
-dqrmn071 remaindernear 999999999.9 1 -> -0.1
-dqrmn072 remaindernear 999999999.999 1 -> -0.001
-dqrmn073 remaindernear 999999.999999 1 -> -0.000001
-dqrmn074 remaindernear 9 1 -> 0
-dqrmn075 remaindernear 9999999999999999 1 -> 0
-dqrmn076 remaindernear 9999999999999999 2 -> -1
-dqrmn077 remaindernear 9999999999999999 3 -> 0
-dqrmn078 remaindernear 9999999999999999 4 -> -1
-
-dqrmn080 remaindernear 0. 1 -> 0
-dqrmn081 remaindernear .0 1 -> 0.0
-dqrmn082 remaindernear 0.00 1 -> 0.00
-dqrmn083 remaindernear 0.00E+9 1 -> 0
-dqrmn084 remaindernear 0.00E+3 1 -> 0
-dqrmn085 remaindernear 0.00E+2 1 -> 0
-dqrmn086 remaindernear 0.00E+1 1 -> 0.0
-dqrmn087 remaindernear 0.00E+0 1 -> 0.00
-dqrmn088 remaindernear 0.00E-0 1 -> 0.00
-dqrmn089 remaindernear 0.00E-1 1 -> 0.000
-dqrmn090 remaindernear 0.00E-2 1 -> 0.0000
-dqrmn091 remaindernear 0.00E-3 1 -> 0.00000
-dqrmn092 remaindernear 0.00E-4 1 -> 0.000000
-dqrmn093 remaindernear 0.00E-5 1 -> 0E-7
-dqrmn094 remaindernear 0.00E-6 1 -> 0E-8
-dqrmn095 remaindernear 0.0000E-50 1 -> 0E-54
-
--- Various flavours of remaindernear by 0
-dqrmn101 remaindernear 0 0 -> NaN Division_undefined
-dqrmn102 remaindernear 0 -0 -> NaN Division_undefined
-dqrmn103 remaindernear -0 0 -> NaN Division_undefined
-dqrmn104 remaindernear -0 -0 -> NaN Division_undefined
-dqrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined
-dqrmn106 remaindernear 0.000 0 -> NaN Division_undefined
--- [Some think this next group should be Division_by_zero exception, but
--- IEEE 854 is explicit that it is Invalid operation .. for
--- remainder-near, anyway]
-dqrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation
-dqrmn108 remaindernear 0.01 0 -> NaN Invalid_operation
-dqrmn109 remaindernear 0.1 0 -> NaN Invalid_operation
-dqrmn110 remaindernear 1 0 -> NaN Invalid_operation
-dqrmn111 remaindernear 1 0.0 -> NaN Invalid_operation
-dqrmn112 remaindernear 10 0.0 -> NaN Invalid_operation
-dqrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation
-dqrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation
-dqrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation
-dqrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation
-dqrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation
-dqrmn120 remaindernear 1 -0 -> NaN Invalid_operation
-dqrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation
-dqrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation
-dqrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation
-dqrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation
--- and zeros on left
-dqrmn130 remaindernear 0 1 -> 0
-dqrmn131 remaindernear 0 -1 -> 0
-dqrmn132 remaindernear 0.0 1 -> 0.0
-dqrmn133 remaindernear 0.0 -1 -> 0.0
-dqrmn134 remaindernear -0 1 -> -0
-dqrmn135 remaindernear -0 -1 -> -0
-dqrmn136 remaindernear -0.0 1 -> -0.0
-dqrmn137 remaindernear -0.0 -1 -> -0.0
-
--- 0.5ers
-dqrmn143 remaindernear 0.5 2 -> 0.5
-dqrmn144 remaindernear 0.5 2.1 -> 0.5
-dqrmn145 remaindernear 0.5 2.01 -> 0.50
-dqrmn146 remaindernear 0.5 2.001 -> 0.500
-dqrmn147 remaindernear 0.50 2 -> 0.50
-dqrmn148 remaindernear 0.50 2.01 -> 0.50
-dqrmn149 remaindernear 0.50 2.001 -> 0.500
-
--- steadies
-dqrmn150 remaindernear 1 1 -> 0
-dqrmn151 remaindernear 1 2 -> 1
-dqrmn152 remaindernear 1 3 -> 1
-dqrmn153 remaindernear 1 4 -> 1
-dqrmn154 remaindernear 1 5 -> 1
-dqrmn155 remaindernear 1 6 -> 1
-dqrmn156 remaindernear 1 7 -> 1
-dqrmn157 remaindernear 1 8 -> 1
-dqrmn158 remaindernear 1 9 -> 1
-dqrmn159 remaindernear 1 10 -> 1
-dqrmn160 remaindernear 1 1 -> 0
-dqrmn161 remaindernear 2 1 -> 0
-dqrmn162 remaindernear 3 1 -> 0
-dqrmn163 remaindernear 4 1 -> 0
-dqrmn164 remaindernear 5 1 -> 0
-dqrmn165 remaindernear 6 1 -> 0
-dqrmn166 remaindernear 7 1 -> 0
-dqrmn167 remaindernear 8 1 -> 0
-dqrmn168 remaindernear 9 1 -> 0
-dqrmn169 remaindernear 10 1 -> 0
-
--- some differences from remainder
-dqrmn171 remaindernear 0.4 1.020 -> 0.400
-dqrmn172 remaindernear 0.50 1.020 -> 0.500
-dqrmn173 remaindernear 0.51 1.020 -> 0.510
-dqrmn174 remaindernear 0.52 1.020 -> -0.500
-dqrmn175 remaindernear 0.6 1.020 -> -0.420
-
--- More flavours of remaindernear by 0
-dqrmn201 remaindernear 0 0 -> NaN Division_undefined
-dqrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined
-dqrmn203 remaindernear 0.000 0 -> NaN Division_undefined
-dqrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation
-dqrmn205 remaindernear 0.01 0 -> NaN Invalid_operation
-dqrmn206 remaindernear 0.1 0 -> NaN Invalid_operation
-dqrmn207 remaindernear 1 0 -> NaN Invalid_operation
-dqrmn208 remaindernear 1 0.0 -> NaN Invalid_operation
-dqrmn209 remaindernear 10 0.0 -> NaN Invalid_operation
-dqrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation
-dqrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation
-
--- tests from the extended specification
-dqrmn221 remaindernear 2.1 3 -> -0.9
-dqrmn222 remaindernear 10 6 -> -2
-dqrmn223 remaindernear 10 3 -> 1
-dqrmn224 remaindernear -10 3 -> -1
-dqrmn225 remaindernear 10.2 1 -> 0.2
-dqrmn226 remaindernear 10 0.3 -> 0.1
-dqrmn227 remaindernear 3.6 1.3 -> -0.3
-
--- some differences from remainder
-dqrmn231 remaindernear -0.4 1.020 -> -0.400
-dqrmn232 remaindernear -0.50 1.020 -> -0.500
-dqrmn233 remaindernear -0.51 1.020 -> -0.510
-dqrmn234 remaindernear -0.52 1.020 -> 0.500
-dqrmn235 remaindernear -0.6 1.020 -> 0.420
-
--- high Xs
-dqrmn240 remaindernear 1E+2 1.00 -> 0.00
-
--- dqrmn3xx are from DiagBigDecimal
-dqrmn301 remaindernear 1 3 -> 1
-dqrmn302 remaindernear 5 5 -> 0
-dqrmn303 remaindernear 13 10 -> 3
-dqrmn304 remaindernear 13 50 -> 13
-dqrmn305 remaindernear 13 100 -> 13
-dqrmn306 remaindernear 13 1000 -> 13
-dqrmn307 remaindernear .13 1 -> 0.13
-dqrmn308 remaindernear 0.133 1 -> 0.133
-dqrmn309 remaindernear 0.1033 1 -> 0.1033
-dqrmn310 remaindernear 1.033 1 -> 0.033
-dqrmn311 remaindernear 10.33 1 -> 0.33
-dqrmn312 remaindernear 10.33 10 -> 0.33
-dqrmn313 remaindernear 103.3 1 -> 0.3
-dqrmn314 remaindernear 133 10 -> 3
-dqrmn315 remaindernear 1033 10 -> 3
-dqrmn316 remaindernear 1033 50 -> -17
-dqrmn317 remaindernear 101.0 3 -> -1.0
-dqrmn318 remaindernear 102.0 3 -> 0.0
-dqrmn319 remaindernear 103.0 3 -> 1.0
-dqrmn320 remaindernear 2.40 1 -> 0.40
-dqrmn321 remaindernear 2.400 1 -> 0.400
-dqrmn322 remaindernear 2.4 1 -> 0.4
-dqrmn323 remaindernear 2.4 2 -> 0.4
-dqrmn324 remaindernear 2.400 2 -> 0.400
-dqrmn325 remaindernear 1 0.3 -> 0.1
-dqrmn326 remaindernear 1 0.30 -> 0.10
-dqrmn327 remaindernear 1 0.300 -> 0.100
-dqrmn328 remaindernear 1 0.3000 -> 0.1000
-dqrmn329 remaindernear 1.0 0.3 -> 0.1
-dqrmn330 remaindernear 1.00 0.3 -> 0.10
-dqrmn331 remaindernear 1.000 0.3 -> 0.100
-dqrmn332 remaindernear 1.0000 0.3 -> 0.1000
-dqrmn333 remaindernear 0.5 2 -> 0.5
-dqrmn334 remaindernear 0.5 2.1 -> 0.5
-dqrmn335 remaindernear 0.5 2.01 -> 0.50
-dqrmn336 remaindernear 0.5 2.001 -> 0.500
-dqrmn337 remaindernear 0.50 2 -> 0.50
-dqrmn338 remaindernear 0.50 2.01 -> 0.50
-dqrmn339 remaindernear 0.50 2.001 -> 0.500
-
-dqrmn340 remaindernear 0.5 0.5000001 -> -1E-7
-dqrmn341 remaindernear 0.5 0.50000001 -> -1E-8
-dqrmn342 remaindernear 0.5 0.500000001 -> -1E-9
-dqrmn343 remaindernear 0.5 0.5000000001 -> -1E-10
-dqrmn344 remaindernear 0.5 0.50000000001 -> -1E-11
-dqrmn345 remaindernear 0.5 0.4999999 -> 1E-7
-dqrmn346 remaindernear 0.5 0.49999999 -> 1E-8
-dqrmn347 remaindernear 0.5 0.499999999 -> 1E-9
-dqrmn348 remaindernear 0.5 0.4999999999 -> 1E-10
-dqrmn349 remaindernear 0.5 0.49999999999 -> 1E-11
-dqrmn350 remaindernear 0.5 0.499999999999 -> 1E-12
-
-dqrmn351 remaindernear 0.03 7 -> 0.03
-dqrmn352 remaindernear 5 2 -> 1
-dqrmn353 remaindernear 4.1 2 -> 0.1
-dqrmn354 remaindernear 4.01 2 -> 0.01
-dqrmn355 remaindernear 4.001 2 -> 0.001
-dqrmn356 remaindernear 4.0001 2 -> 0.0001
-dqrmn357 remaindernear 4.00001 2 -> 0.00001
-dqrmn358 remaindernear 4.000001 2 -> 0.000001
-dqrmn359 remaindernear 4.0000001 2 -> 1E-7
-
-dqrmn360 remaindernear 1.2 0.7345 -> -0.2690
-dqrmn361 remaindernear 0.8 12 -> 0.8
-dqrmn362 remaindernear 0.8 0.2 -> 0.0
-dqrmn363 remaindernear 0.8 0.3 -> -0.1
-dqrmn364 remaindernear 0.800 12 -> 0.800
-dqrmn365 remaindernear 0.800 1.7 -> 0.800
-dqrmn366 remaindernear 2.400 2 -> 0.400
-
--- round to even
-dqrmn371 remaindernear 121 2 -> 1
-dqrmn372 remaindernear 122 2 -> 0
-dqrmn373 remaindernear 123 2 -> -1
-dqrmn374 remaindernear 124 2 -> 0
-dqrmn375 remaindernear 125 2 -> 1
-dqrmn376 remaindernear 126 2 -> 0
-dqrmn377 remaindernear 127 2 -> -1
-
-dqrmn381 remaindernear 12345 1 -> 0
-dqrmn382 remaindernear 12345 1.0001 -> -0.2344
-dqrmn383 remaindernear 12345 1.001 -> -0.333
-dqrmn384 remaindernear 12345 1.01 -> -0.23
-dqrmn385 remaindernear 12345 1.1 -> -0.3
-dqrmn386 remaindernear 12355 4 -> -1
-dqrmn387 remaindernear 12345 4 -> 1
-dqrmn388 remaindernear 12355 4.0001 -> -1.3089
-dqrmn389 remaindernear 12345 4.0001 -> 0.6914
-dqrmn390 remaindernear 12345 4.9 -> 1.9
-dqrmn391 remaindernear 12345 4.99 -> -0.26
-dqrmn392 remaindernear 12345 4.999 -> 2.469
-dqrmn393 remaindernear 12345 4.9999 -> 0.2469
-dqrmn394 remaindernear 12345 5 -> 0
-dqrmn395 remaindernear 12345 5.0001 -> -0.2469
-dqrmn396 remaindernear 12345 5.001 -> -2.469
-dqrmn397 remaindernear 12345 5.01 -> 0.36
-dqrmn398 remaindernear 12345 5.1 -> -2.1
-
--- the nasty division-by-1 cases
-dqrmn401 remaindernear 0.4 1 -> 0.4
-dqrmn402 remaindernear 0.45 1 -> 0.45
-dqrmn403 remaindernear 0.455 1 -> 0.455
-dqrmn404 remaindernear 0.4555 1 -> 0.4555
-dqrmn405 remaindernear 0.45555 1 -> 0.45555
-dqrmn406 remaindernear 0.455555 1 -> 0.455555
-dqrmn407 remaindernear 0.4555555 1 -> 0.4555555
-dqrmn408 remaindernear 0.45555555 1 -> 0.45555555
-dqrmn409 remaindernear 0.455555555 1 -> 0.455555555
--- with spill... [412 exercises sticktab loop]
-dqrmn411 remaindernear 0.5 1 -> 0.5
-dqrmn412 remaindernear 0.55 1 -> -0.45
-dqrmn413 remaindernear 0.555 1 -> -0.445
-dqrmn414 remaindernear 0.5555 1 -> -0.4445
-dqrmn415 remaindernear 0.55555 1 -> -0.44445
-dqrmn416 remaindernear 0.555555 1 -> -0.444445
-dqrmn417 remaindernear 0.5555555 1 -> -0.4444445
-dqrmn418 remaindernear 0.55555555 1 -> -0.44444445
-dqrmn419 remaindernear 0.555555555 1 -> -0.444444445
-
--- folddowns
-dqrmn421 remaindernear 1E+6144 1 -> NaN Division_impossible
-dqrmn422 remaindernear 1E+6144 1E+6143 -> 0E+6111 Clamped
-dqrmn423 remaindernear 1E+6144 2E+6143 -> 0E+6111 Clamped
-dqrmn424 remaindernear 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqrmn425 remaindernear 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
-dqrmn426 remaindernear 1E+6144 5E+6143 -> 0E+6111 Clamped
-dqrmn427 remaindernear 1E+6144 6E+6143 -> -2.00000000000000000000000000000000E+6143 Clamped
-dqrmn428 remaindernear 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped
-dqrmn429 remaindernear 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
-dqrmn430 remaindernear 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
--- tinies
-dqrmn431 remaindernear 1E-6175 1E-6176 -> 0E-6176
-dqrmn432 remaindernear 1E-6175 2E-6176 -> 0E-6176
-dqrmn433 remaindernear 1E-6175 3E-6176 -> 1E-6176 Subnormal
-dqrmn434 remaindernear 1E-6175 4E-6176 -> 2E-6176 Subnormal
-dqrmn435 remaindernear 1E-6175 5E-6176 -> 0E-6176
-dqrmn436 remaindernear 1E-6175 6E-6176 -> -2E-6176 Subnormal
-dqrmn437 remaindernear 1E-6175 7E-6176 -> 3E-6176 Subnormal
-dqrmn438 remaindernear 1E-6175 8E-6176 -> 2E-6176 Subnormal
-dqrmn439 remaindernear 1E-6175 9E-6176 -> 1E-6176 Subnormal
-dqrmn440 remaindernear 1E-6175 10E-6176 -> 0E-6176
-dqrmn441 remaindernear 1E-6175 11E-6176 -> -1E-6176 Subnormal
-dqrmn442 remaindernear 100E-6175 11E-6176 -> -1E-6176 Subnormal
-dqrmn443 remaindernear 100E-6175 20E-6176 -> 0E-6176
-dqrmn444 remaindernear 100E-6175 21E-6176 -> -8E-6176 Subnormal
-dqrmn445 remaindernear 100E-6175 30E-6176 -> 1.0E-6175 Subnormal
-
--- zero signs
-dqrmn650 remaindernear 1 1 -> 0
-dqrmn651 remaindernear -1 1 -> -0
-dqrmn652 remaindernear 1 -1 -> 0
-dqrmn653 remaindernear -1 -1 -> -0
-dqrmn654 remaindernear 0 1 -> 0
-dqrmn655 remaindernear -0 1 -> -0
-dqrmn656 remaindernear 0 -1 -> 0
-dqrmn657 remaindernear -0 -1 -> -0
-dqrmn658 remaindernear 0.00 1 -> 0.00
-dqrmn659 remaindernear -0.00 1 -> -0.00
-
--- Specials
-dqrmn680 remaindernear Inf -Inf -> NaN Invalid_operation
-dqrmn681 remaindernear Inf -1000 -> NaN Invalid_operation
-dqrmn682 remaindernear Inf -1 -> NaN Invalid_operation
-dqrmn683 remaindernear Inf 0 -> NaN Invalid_operation
-dqrmn684 remaindernear Inf -0 -> NaN Invalid_operation
-dqrmn685 remaindernear Inf 1 -> NaN Invalid_operation
-dqrmn686 remaindernear Inf 1000 -> NaN Invalid_operation
-dqrmn687 remaindernear Inf Inf -> NaN Invalid_operation
-dqrmn688 remaindernear -1000 Inf -> -1000
-dqrmn689 remaindernear -Inf Inf -> NaN Invalid_operation
-dqrmn691 remaindernear -1 Inf -> -1
-dqrmn692 remaindernear 0 Inf -> 0
-dqrmn693 remaindernear -0 Inf -> -0
-dqrmn694 remaindernear 1 Inf -> 1
-dqrmn695 remaindernear 1000 Inf -> 1000
-dqrmn696 remaindernear Inf Inf -> NaN Invalid_operation
-
-dqrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation
-dqrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation
-dqrmn702 remaindernear -Inf -1 -> NaN Invalid_operation
-dqrmn703 remaindernear -Inf -0 -> NaN Invalid_operation
-dqrmn704 remaindernear -Inf 0 -> NaN Invalid_operation
-dqrmn705 remaindernear -Inf 1 -> NaN Invalid_operation
-dqrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation
-dqrmn707 remaindernear -Inf Inf -> NaN Invalid_operation
-dqrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation
-dqrmn709 remaindernear -1000 Inf -> -1000
-dqrmn710 remaindernear -1 -Inf -> -1
-dqrmn711 remaindernear -0 -Inf -> -0
-dqrmn712 remaindernear 0 -Inf -> 0
-dqrmn713 remaindernear 1 -Inf -> 1
-dqrmn714 remaindernear 1000 -Inf -> 1000
-dqrmn715 remaindernear Inf -Inf -> NaN Invalid_operation
-
-dqrmn721 remaindernear NaN -Inf -> NaN
-dqrmn722 remaindernear NaN -1000 -> NaN
-dqrmn723 remaindernear NaN -1 -> NaN
-dqrmn724 remaindernear NaN -0 -> NaN
-dqrmn725 remaindernear -NaN 0 -> -NaN
-dqrmn726 remaindernear NaN 1 -> NaN
-dqrmn727 remaindernear NaN 1000 -> NaN
-dqrmn728 remaindernear NaN Inf -> NaN
-dqrmn729 remaindernear NaN -NaN -> NaN
-dqrmn730 remaindernear -Inf NaN -> NaN
-dqrmn731 remaindernear -1000 NaN -> NaN
-dqrmn732 remaindernear -1 NaN -> NaN
-dqrmn733 remaindernear -0 -NaN -> -NaN
-dqrmn734 remaindernear 0 NaN -> NaN
-dqrmn735 remaindernear 1 -NaN -> -NaN
-dqrmn736 remaindernear 1000 NaN -> NaN
-dqrmn737 remaindernear Inf NaN -> NaN
-
-dqrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation
-dqrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation
-dqrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation
-dqrmn744 remaindernear sNaN -0 -> NaN Invalid_operation
-dqrmn745 remaindernear sNaN 0 -> NaN Invalid_operation
-dqrmn746 remaindernear sNaN 1 -> NaN Invalid_operation
-dqrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation
-dqrmn749 remaindernear sNaN NaN -> NaN Invalid_operation
-dqrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation
-dqrmn751 remaindernear NaN sNaN -> NaN Invalid_operation
-dqrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation
-dqrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation
-dqrmn754 remaindernear -1 sNaN -> NaN Invalid_operation
-dqrmn755 remaindernear -0 sNaN -> NaN Invalid_operation
-dqrmn756 remaindernear 0 sNaN -> NaN Invalid_operation
-dqrmn757 remaindernear 1 sNaN -> NaN Invalid_operation
-dqrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation
-dqrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation
-
--- propaging NaNs
-dqrmn760 remaindernear NaN1 NaN7 -> NaN1
-dqrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
-dqrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation
-dqrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
-dqrmn764 remaindernear 15 NaN11 -> NaN11
-dqrmn765 remaindernear NaN6 NaN12 -> NaN6
-dqrmn766 remaindernear Inf NaN13 -> NaN13
-dqrmn767 remaindernear NaN14 -Inf -> NaN14
-dqrmn768 remaindernear 0 NaN15 -> NaN15
-dqrmn769 remaindernear NaN16 -0 -> NaN16
-
--- edge cases of impossible
-dqrmn770 remaindernear 1234500000000000000000067890123456 10 -> -4
-dqrmn771 remaindernear 1234500000000000000000067890123456 1 -> 0
-dqrmn772 remaindernear 1234500000000000000000067890123456 0.1 -> NaN Division_impossible
-dqrmn773 remaindernear 1234500000000000000000067890123456 0.01 -> NaN Division_impossible
-
--- long operand checks
-dqrmn801 remaindernear 12345678000 100 -> 0
-dqrmn802 remaindernear 1 12345678000 -> 1
-dqrmn803 remaindernear 1234567800 10 -> 0
-dqrmn804 remaindernear 1 1234567800 -> 1
-dqrmn805 remaindernear 1234567890 10 -> 0
-dqrmn806 remaindernear 1 1234567890 -> 1
-dqrmn807 remaindernear 1234567891 10 -> 1
-dqrmn808 remaindernear 1 1234567891 -> 1
-dqrmn809 remaindernear 12345678901 100 -> 1
-dqrmn810 remaindernear 1 12345678901 -> 1
-dqrmn811 remaindernear 1234567896 10 -> -4
-dqrmn812 remaindernear 1 1234567896 -> 1
-
-dqrmn821 remaindernear 12345678000 100 -> 0
-dqrmn822 remaindernear 1 12345678000 -> 1
-dqrmn823 remaindernear 1234567800 10 -> 0
-dqrmn824 remaindernear 1 1234567800 -> 1
-dqrmn825 remaindernear 1234567890 10 -> 0
-dqrmn826 remaindernear 1 1234567890 -> 1
-dqrmn827 remaindernear 1234567891 10 -> 1
-dqrmn828 remaindernear 1 1234567891 -> 1
-dqrmn829 remaindernear 12345678901 100 -> 1
-dqrmn830 remaindernear 1 12345678901 -> 1
-dqrmn831 remaindernear 1234567896 10 -> -4
-dqrmn832 remaindernear 1 1234567896 -> 1
-
--- from divideint
-dqrmn840 remaindernear 100000000.0 1 -> 0.0
-dqrmn841 remaindernear 100000000.4 1 -> 0.4
-dqrmn842 remaindernear 100000000.5 1 -> 0.5
-dqrmn843 remaindernear 100000000.9 1 -> -0.1
-dqrmn844 remaindernear 100000000.999 1 -> -0.001
-dqrmn850 remaindernear 100000003 5 -> -2
-dqrmn851 remaindernear 10000003 5 -> -2
-dqrmn852 remaindernear 1000003 5 -> -2
-dqrmn853 remaindernear 100003 5 -> -2
-dqrmn854 remaindernear 10003 5 -> -2
-dqrmn855 remaindernear 1003 5 -> -2
-dqrmn856 remaindernear 103 5 -> -2
-dqrmn857 remaindernear 13 5 -> -2
-dqrmn858 remaindernear 1 5 -> 1
-
--- Vladimir's cases 1234567890123456
-dqrmn860 remaindernear 123.0e1 1000000000000000 -> 1230
-dqrmn861 remaindernear 1230 1000000000000000 -> 1230
-dqrmn862 remaindernear 12.3e2 1000000000000000 -> 1230
-dqrmn863 remaindernear 1.23e3 1000000000000000 -> 1230
-dqrmn864 remaindernear 123e1 1000000000000000 -> 1230
-dqrmn870 remaindernear 123e1 1000000000000000 -> 1230
-dqrmn871 remaindernear 123e1 100000000000000 -> 1230
-dqrmn872 remaindernear 123e1 10000000000000 -> 1230
-dqrmn873 remaindernear 123e1 1000000000000 -> 1230
-dqrmn874 remaindernear 123e1 100000000000 -> 1230
-dqrmn875 remaindernear 123e1 10000000000 -> 1230
-dqrmn876 remaindernear 123e1 1000000000 -> 1230
-dqrmn877 remaindernear 123e1 100000000 -> 1230
-dqrmn878 remaindernear 1230 100000000 -> 1230
-dqrmn879 remaindernear 123e1 10000000 -> 1230
-dqrmn880 remaindernear 123e1 1000000 -> 1230
-dqrmn881 remaindernear 123e1 100000 -> 1230
-dqrmn882 remaindernear 123e1 10000 -> 1230
-dqrmn883 remaindernear 123e1 1000 -> 230
-dqrmn884 remaindernear 123e1 100 -> 30
-dqrmn885 remaindernear 123e1 10 -> 0
-dqrmn886 remaindernear 123e1 1 -> 0
-
-dqrmn890 remaindernear 123e1 2000000000000000 -> 1230
-dqrmn891 remaindernear 123e1 200000000000000 -> 1230
-dqrmn892 remaindernear 123e1 20000000000000 -> 1230
-dqrmn893 remaindernear 123e1 2000000000000 -> 1230
-dqrmn894 remaindernear 123e1 200000000000 -> 1230
-dqrmn895 remaindernear 123e1 20000000000 -> 1230
-dqrmn896 remaindernear 123e1 2000000000 -> 1230
-dqrmn897 remaindernear 123e1 200000000 -> 1230
-dqrmn899 remaindernear 123e1 20000000 -> 1230
-dqrmn900 remaindernear 123e1 2000000 -> 1230
-dqrmn901 remaindernear 123e1 200000 -> 1230
-dqrmn902 remaindernear 123e1 20000 -> 1230
-dqrmn903 remaindernear 123e1 2000 -> -770
-dqrmn904 remaindernear 123e1 200 -> 30
-dqrmn905 remaindernear 123e1 20 -> -10
-dqrmn906 remaindernear 123e1 2 -> 0
-
-dqrmn910 remaindernear 123e1 5000000000000000 -> 1230
-dqrmn911 remaindernear 123e1 500000000000000 -> 1230
-dqrmn912 remaindernear 123e1 50000000000000 -> 1230
-dqrmn913 remaindernear 123e1 5000000000000 -> 1230
-dqrmn914 remaindernear 123e1 500000000000 -> 1230
-dqrmn915 remaindernear 123e1 50000000000 -> 1230
-dqrmn916 remaindernear 123e1 5000000000 -> 1230
-dqrmn917 remaindernear 123e1 500000000 -> 1230
-dqrmn919 remaindernear 123e1 50000000 -> 1230
-dqrmn920 remaindernear 123e1 5000000 -> 1230
-dqrmn921 remaindernear 123e1 500000 -> 1230
-dqrmn922 remaindernear 123e1 50000 -> 1230
-dqrmn923 remaindernear 123e1 5000 -> 1230
-dqrmn924 remaindernear 123e1 500 -> 230
-dqrmn925 remaindernear 123e1 50 -> -20
-dqrmn926 remaindernear 123e1 5 -> 0
-
-dqrmn930 remaindernear 123e1 9000000000000000 -> 1230
-dqrmn931 remaindernear 123e1 900000000000000 -> 1230
-dqrmn932 remaindernear 123e1 90000000000000 -> 1230
-dqrmn933 remaindernear 123e1 9000000000000 -> 1230
-dqrmn934 remaindernear 123e1 900000000000 -> 1230
-dqrmn935 remaindernear 123e1 90000000000 -> 1230
-dqrmn936 remaindernear 123e1 9000000000 -> 1230
-dqrmn937 remaindernear 123e1 900000000 -> 1230
-dqrmn939 remaindernear 123e1 90000000 -> 1230
-dqrmn940 remaindernear 123e1 9000000 -> 1230
-dqrmn941 remaindernear 123e1 900000 -> 1230
-dqrmn942 remaindernear 123e1 90000 -> 1230
-dqrmn943 remaindernear 123e1 9000 -> 1230
-dqrmn944 remaindernear 123e1 900 -> 330
-dqrmn945 remaindernear 123e1 90 -> -30
-dqrmn946 remaindernear 123e1 9 -> -3
-
-dqrmn950 remaindernear 123e1 1000000000000000 -> 1230
-dqrmn961 remaindernear 123e1 2999999999999999 -> 1230
-dqrmn962 remaindernear 123e1 3999999999999999 -> 1230
-dqrmn963 remaindernear 123e1 4999999999999999 -> 1230
-dqrmn964 remaindernear 123e1 5999999999999999 -> 1230
-dqrmn965 remaindernear 123e1 6999999999999999 -> 1230
-dqrmn966 remaindernear 123e1 7999999999999999 -> 1230
-dqrmn967 remaindernear 123e1 8999999999999999 -> 1230
-dqrmn968 remaindernear 123e1 9999999999999999 -> 1230
-dqrmn969 remaindernear 123e1 9876543210987654 -> 1230
-
-dqrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
-
--- overflow and underflow tests [from divide]
-dqrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible
-dqrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible
-dqrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible
-dqrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible
-dqrmn1055 remaindernear 1e-277 1e+311 -> 1E-277
-dqrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277
-dqrmn1057 remaindernear -1e-277 1e+311 -> -1E-277
-dqrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
-
--- Gyuris example
-dqrmn1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
-
--- destructive subtract
-dqrmn1101 remaindernear 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> -0.234567890123456789012345678901233
-dqrmn1102 remaindernear 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> -0.34567890123456789012345678901222
-dqrmn1103 remaindernear 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> -0.4567890123456789012345678901111
-dqrmn1104 remaindernear 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> -1.308641972530864197253086419725314
-dqrmn1105 remaindernear 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692
-dqrmn1106 remaindernear 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> -1.3086421975308642197530864219748
-dqrmn1107 remaindernear 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247
-dqrmn1108 remaindernear 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> -0.753086421975308642197530864219753
-dqrmn1109 remaindernear 1234567890123456789012345678901234 5.000000000000000000000000000000001 -> -1.246913578024691357802469135780247
-dqrmn1110 remaindernear 1234567890123456789012345678901234 5.00000000000000000000000000000001 -> 1.53086421975308642197530864219754
-dqrmn1111 remaindernear 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> -0.6913578024691357802469135780242
-
--- Null tests
-dqrmn1000 remaindernear 10 # -> NaN Invalid_operation
-dqrmn1001 remaindernear # 10 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- dqRemainderNear.decTest -- decQuad remainder-near --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- sanity checks (as base, above)
+dqrmn001 remaindernear 1 1 -> 0
+dqrmn002 remaindernear 2 1 -> 0
+dqrmn003 remaindernear 1 2 -> 1
+dqrmn004 remaindernear 2 2 -> 0
+dqrmn005 remaindernear 0 1 -> 0
+dqrmn006 remaindernear 0 2 -> 0
+dqrmn007 remaindernear 1 3 -> 1
+dqrmn008 remaindernear 2 3 -> -1
+dqrmn009 remaindernear 3 3 -> 0
+
+dqrmn010 remaindernear 2.4 1 -> 0.4
+dqrmn011 remaindernear 2.4 -1 -> 0.4
+dqrmn012 remaindernear -2.4 1 -> -0.4
+dqrmn013 remaindernear -2.4 -1 -> -0.4
+dqrmn014 remaindernear 2.40 1 -> 0.40
+dqrmn015 remaindernear 2.400 1 -> 0.400
+dqrmn016 remaindernear 2.4 2 -> 0.4
+dqrmn017 remaindernear 2.400 2 -> 0.400
+dqrmn018 remaindernear 2. 2 -> 0
+dqrmn019 remaindernear 20 20 -> 0
+
+dqrmn020 remaindernear 187 187 -> 0
+dqrmn021 remaindernear 5 2 -> 1
+dqrmn022 remaindernear 5 2.0 -> 1.0
+dqrmn023 remaindernear 5 2.000 -> 1.000
+dqrmn024 remaindernear 5 0.200 -> 0.000
+dqrmn025 remaindernear 5 0.200 -> 0.000
+
+dqrmn030 remaindernear 1 2 -> 1
+dqrmn031 remaindernear 1 4 -> 1
+dqrmn032 remaindernear 1 8 -> 1
+
+dqrmn033 remaindernear 1 16 -> 1
+dqrmn034 remaindernear 1 32 -> 1
+dqrmn035 remaindernear 1 64 -> 1
+dqrmn040 remaindernear 1 -2 -> 1
+dqrmn041 remaindernear 1 -4 -> 1
+dqrmn042 remaindernear 1 -8 -> 1
+dqrmn043 remaindernear 1 -16 -> 1
+dqrmn044 remaindernear 1 -32 -> 1
+dqrmn045 remaindernear 1 -64 -> 1
+dqrmn050 remaindernear -1 2 -> -1
+dqrmn051 remaindernear -1 4 -> -1
+dqrmn052 remaindernear -1 8 -> -1
+dqrmn053 remaindernear -1 16 -> -1
+dqrmn054 remaindernear -1 32 -> -1
+dqrmn055 remaindernear -1 64 -> -1
+dqrmn060 remaindernear -1 -2 -> -1
+dqrmn061 remaindernear -1 -4 -> -1
+dqrmn062 remaindernear -1 -8 -> -1
+dqrmn063 remaindernear -1 -16 -> -1
+dqrmn064 remaindernear -1 -32 -> -1
+dqrmn065 remaindernear -1 -64 -> -1
+
+dqrmn066 remaindernear 9.9 1 -> -0.1
+dqrmn067 remaindernear 99.7 1 -> -0.3
+dqrmn068 remaindernear 999999999 1 -> 0
+dqrmn069 remaindernear 999999999.4 1 -> 0.4
+dqrmn070 remaindernear 999999999.5 1 -> -0.5
+dqrmn071 remaindernear 999999999.9 1 -> -0.1
+dqrmn072 remaindernear 999999999.999 1 -> -0.001
+dqrmn073 remaindernear 999999.999999 1 -> -0.000001
+dqrmn074 remaindernear 9 1 -> 0
+dqrmn075 remaindernear 9999999999999999 1 -> 0
+dqrmn076 remaindernear 9999999999999999 2 -> -1
+dqrmn077 remaindernear 9999999999999999 3 -> 0
+dqrmn078 remaindernear 9999999999999999 4 -> -1
+
+dqrmn080 remaindernear 0. 1 -> 0
+dqrmn081 remaindernear .0 1 -> 0.0
+dqrmn082 remaindernear 0.00 1 -> 0.00
+dqrmn083 remaindernear 0.00E+9 1 -> 0
+dqrmn084 remaindernear 0.00E+3 1 -> 0
+dqrmn085 remaindernear 0.00E+2 1 -> 0
+dqrmn086 remaindernear 0.00E+1 1 -> 0.0
+dqrmn087 remaindernear 0.00E+0 1 -> 0.00
+dqrmn088 remaindernear 0.00E-0 1 -> 0.00
+dqrmn089 remaindernear 0.00E-1 1 -> 0.000
+dqrmn090 remaindernear 0.00E-2 1 -> 0.0000
+dqrmn091 remaindernear 0.00E-3 1 -> 0.00000
+dqrmn092 remaindernear 0.00E-4 1 -> 0.000000
+dqrmn093 remaindernear 0.00E-5 1 -> 0E-7
+dqrmn094 remaindernear 0.00E-6 1 -> 0E-8
+dqrmn095 remaindernear 0.0000E-50 1 -> 0E-54
+
+-- Various flavours of remaindernear by 0
+dqrmn101 remaindernear 0 0 -> NaN Division_undefined
+dqrmn102 remaindernear 0 -0 -> NaN Division_undefined
+dqrmn103 remaindernear -0 0 -> NaN Division_undefined
+dqrmn104 remaindernear -0 -0 -> NaN Division_undefined
+dqrmn105 remaindernear 0.0E5 0 -> NaN Division_undefined
+dqrmn106 remaindernear 0.000 0 -> NaN Division_undefined
+-- [Some think this next group should be Division_by_zero exception, but
+-- IEEE 854 is explicit that it is Invalid operation .. for
+-- remainder-near, anyway]
+dqrmn107 remaindernear 0.0001 0 -> NaN Invalid_operation
+dqrmn108 remaindernear 0.01 0 -> NaN Invalid_operation
+dqrmn109 remaindernear 0.1 0 -> NaN Invalid_operation
+dqrmn110 remaindernear 1 0 -> NaN Invalid_operation
+dqrmn111 remaindernear 1 0.0 -> NaN Invalid_operation
+dqrmn112 remaindernear 10 0.0 -> NaN Invalid_operation
+dqrmn113 remaindernear 1E+100 0.0 -> NaN Invalid_operation
+dqrmn114 remaindernear 1E+380 0 -> NaN Invalid_operation
+dqrmn115 remaindernear 0.0001 -0 -> NaN Invalid_operation
+dqrmn116 remaindernear 0.01 -0 -> NaN Invalid_operation
+dqrmn119 remaindernear 0.1 -0 -> NaN Invalid_operation
+dqrmn120 remaindernear 1 -0 -> NaN Invalid_operation
+dqrmn121 remaindernear 1 -0.0 -> NaN Invalid_operation
+dqrmn122 remaindernear 10 -0.0 -> NaN Invalid_operation
+dqrmn123 remaindernear 1E+100 -0.0 -> NaN Invalid_operation
+dqrmn124 remaindernear 1E+384 -0 -> NaN Invalid_operation
+-- and zeros on left
+dqrmn130 remaindernear 0 1 -> 0
+dqrmn131 remaindernear 0 -1 -> 0
+dqrmn132 remaindernear 0.0 1 -> 0.0
+dqrmn133 remaindernear 0.0 -1 -> 0.0
+dqrmn134 remaindernear -0 1 -> -0
+dqrmn135 remaindernear -0 -1 -> -0
+dqrmn136 remaindernear -0.0 1 -> -0.0
+dqrmn137 remaindernear -0.0 -1 -> -0.0
+
+-- 0.5ers
+dqrmn143 remaindernear 0.5 2 -> 0.5
+dqrmn144 remaindernear 0.5 2.1 -> 0.5
+dqrmn145 remaindernear 0.5 2.01 -> 0.50
+dqrmn146 remaindernear 0.5 2.001 -> 0.500
+dqrmn147 remaindernear 0.50 2 -> 0.50
+dqrmn148 remaindernear 0.50 2.01 -> 0.50
+dqrmn149 remaindernear 0.50 2.001 -> 0.500
+
+-- steadies
+dqrmn150 remaindernear 1 1 -> 0
+dqrmn151 remaindernear 1 2 -> 1
+dqrmn152 remaindernear 1 3 -> 1
+dqrmn153 remaindernear 1 4 -> 1
+dqrmn154 remaindernear 1 5 -> 1
+dqrmn155 remaindernear 1 6 -> 1
+dqrmn156 remaindernear 1 7 -> 1
+dqrmn157 remaindernear 1 8 -> 1
+dqrmn158 remaindernear 1 9 -> 1
+dqrmn159 remaindernear 1 10 -> 1
+dqrmn160 remaindernear 1 1 -> 0
+dqrmn161 remaindernear 2 1 -> 0
+dqrmn162 remaindernear 3 1 -> 0
+dqrmn163 remaindernear 4 1 -> 0
+dqrmn164 remaindernear 5 1 -> 0
+dqrmn165 remaindernear 6 1 -> 0
+dqrmn166 remaindernear 7 1 -> 0
+dqrmn167 remaindernear 8 1 -> 0
+dqrmn168 remaindernear 9 1 -> 0
+dqrmn169 remaindernear 10 1 -> 0
+
+-- some differences from remainder
+dqrmn171 remaindernear 0.4 1.020 -> 0.400
+dqrmn172 remaindernear 0.50 1.020 -> 0.500
+dqrmn173 remaindernear 0.51 1.020 -> 0.510
+dqrmn174 remaindernear 0.52 1.020 -> -0.500
+dqrmn175 remaindernear 0.6 1.020 -> -0.420
+
+-- More flavours of remaindernear by 0
+dqrmn201 remaindernear 0 0 -> NaN Division_undefined
+dqrmn202 remaindernear 0.0E5 0 -> NaN Division_undefined
+dqrmn203 remaindernear 0.000 0 -> NaN Division_undefined
+dqrmn204 remaindernear 0.0001 0 -> NaN Invalid_operation
+dqrmn205 remaindernear 0.01 0 -> NaN Invalid_operation
+dqrmn206 remaindernear 0.1 0 -> NaN Invalid_operation
+dqrmn207 remaindernear 1 0 -> NaN Invalid_operation
+dqrmn208 remaindernear 1 0.0 -> NaN Invalid_operation
+dqrmn209 remaindernear 10 0.0 -> NaN Invalid_operation
+dqrmn210 remaindernear 1E+100 0.0 -> NaN Invalid_operation
+dqrmn211 remaindernear 1E+380 0 -> NaN Invalid_operation
+
+-- tests from the extended specification
+dqrmn221 remaindernear 2.1 3 -> -0.9
+dqrmn222 remaindernear 10 6 -> -2
+dqrmn223 remaindernear 10 3 -> 1
+dqrmn224 remaindernear -10 3 -> -1
+dqrmn225 remaindernear 10.2 1 -> 0.2
+dqrmn226 remaindernear 10 0.3 -> 0.1
+dqrmn227 remaindernear 3.6 1.3 -> -0.3
+
+-- some differences from remainder
+dqrmn231 remaindernear -0.4 1.020 -> -0.400
+dqrmn232 remaindernear -0.50 1.020 -> -0.500
+dqrmn233 remaindernear -0.51 1.020 -> -0.510
+dqrmn234 remaindernear -0.52 1.020 -> 0.500
+dqrmn235 remaindernear -0.6 1.020 -> 0.420
+
+-- high Xs
+dqrmn240 remaindernear 1E+2 1.00 -> 0.00
+
+-- dqrmn3xx are from DiagBigDecimal
+dqrmn301 remaindernear 1 3 -> 1
+dqrmn302 remaindernear 5 5 -> 0
+dqrmn303 remaindernear 13 10 -> 3
+dqrmn304 remaindernear 13 50 -> 13
+dqrmn305 remaindernear 13 100 -> 13
+dqrmn306 remaindernear 13 1000 -> 13
+dqrmn307 remaindernear .13 1 -> 0.13
+dqrmn308 remaindernear 0.133 1 -> 0.133
+dqrmn309 remaindernear 0.1033 1 -> 0.1033
+dqrmn310 remaindernear 1.033 1 -> 0.033
+dqrmn311 remaindernear 10.33 1 -> 0.33
+dqrmn312 remaindernear 10.33 10 -> 0.33
+dqrmn313 remaindernear 103.3 1 -> 0.3
+dqrmn314 remaindernear 133 10 -> 3
+dqrmn315 remaindernear 1033 10 -> 3
+dqrmn316 remaindernear 1033 50 -> -17
+dqrmn317 remaindernear 101.0 3 -> -1.0
+dqrmn318 remaindernear 102.0 3 -> 0.0
+dqrmn319 remaindernear 103.0 3 -> 1.0
+dqrmn320 remaindernear 2.40 1 -> 0.40
+dqrmn321 remaindernear 2.400 1 -> 0.400
+dqrmn322 remaindernear 2.4 1 -> 0.4
+dqrmn323 remaindernear 2.4 2 -> 0.4
+dqrmn324 remaindernear 2.400 2 -> 0.400
+dqrmn325 remaindernear 1 0.3 -> 0.1
+dqrmn326 remaindernear 1 0.30 -> 0.10
+dqrmn327 remaindernear 1 0.300 -> 0.100
+dqrmn328 remaindernear 1 0.3000 -> 0.1000
+dqrmn329 remaindernear 1.0 0.3 -> 0.1
+dqrmn330 remaindernear 1.00 0.3 -> 0.10
+dqrmn331 remaindernear 1.000 0.3 -> 0.100
+dqrmn332 remaindernear 1.0000 0.3 -> 0.1000
+dqrmn333 remaindernear 0.5 2 -> 0.5
+dqrmn334 remaindernear 0.5 2.1 -> 0.5
+dqrmn335 remaindernear 0.5 2.01 -> 0.50
+dqrmn336 remaindernear 0.5 2.001 -> 0.500
+dqrmn337 remaindernear 0.50 2 -> 0.50
+dqrmn338 remaindernear 0.50 2.01 -> 0.50
+dqrmn339 remaindernear 0.50 2.001 -> 0.500
+
+dqrmn340 remaindernear 0.5 0.5000001 -> -1E-7
+dqrmn341 remaindernear 0.5 0.50000001 -> -1E-8
+dqrmn342 remaindernear 0.5 0.500000001 -> -1E-9
+dqrmn343 remaindernear 0.5 0.5000000001 -> -1E-10
+dqrmn344 remaindernear 0.5 0.50000000001 -> -1E-11
+dqrmn345 remaindernear 0.5 0.4999999 -> 1E-7
+dqrmn346 remaindernear 0.5 0.49999999 -> 1E-8
+dqrmn347 remaindernear 0.5 0.499999999 -> 1E-9
+dqrmn348 remaindernear 0.5 0.4999999999 -> 1E-10
+dqrmn349 remaindernear 0.5 0.49999999999 -> 1E-11
+dqrmn350 remaindernear 0.5 0.499999999999 -> 1E-12
+
+dqrmn351 remaindernear 0.03 7 -> 0.03
+dqrmn352 remaindernear 5 2 -> 1
+dqrmn353 remaindernear 4.1 2 -> 0.1
+dqrmn354 remaindernear 4.01 2 -> 0.01
+dqrmn355 remaindernear 4.001 2 -> 0.001
+dqrmn356 remaindernear 4.0001 2 -> 0.0001
+dqrmn357 remaindernear 4.00001 2 -> 0.00001
+dqrmn358 remaindernear 4.000001 2 -> 0.000001
+dqrmn359 remaindernear 4.0000001 2 -> 1E-7
+
+dqrmn360 remaindernear 1.2 0.7345 -> -0.2690
+dqrmn361 remaindernear 0.8 12 -> 0.8
+dqrmn362 remaindernear 0.8 0.2 -> 0.0
+dqrmn363 remaindernear 0.8 0.3 -> -0.1
+dqrmn364 remaindernear 0.800 12 -> 0.800
+dqrmn365 remaindernear 0.800 1.7 -> 0.800
+dqrmn366 remaindernear 2.400 2 -> 0.400
+
+-- round to even
+dqrmn371 remaindernear 121 2 -> 1
+dqrmn372 remaindernear 122 2 -> 0
+dqrmn373 remaindernear 123 2 -> -1
+dqrmn374 remaindernear 124 2 -> 0
+dqrmn375 remaindernear 125 2 -> 1
+dqrmn376 remaindernear 126 2 -> 0
+dqrmn377 remaindernear 127 2 -> -1
+
+dqrmn381 remaindernear 12345 1 -> 0
+dqrmn382 remaindernear 12345 1.0001 -> -0.2344
+dqrmn383 remaindernear 12345 1.001 -> -0.333
+dqrmn384 remaindernear 12345 1.01 -> -0.23
+dqrmn385 remaindernear 12345 1.1 -> -0.3
+dqrmn386 remaindernear 12355 4 -> -1
+dqrmn387 remaindernear 12345 4 -> 1
+dqrmn388 remaindernear 12355 4.0001 -> -1.3089
+dqrmn389 remaindernear 12345 4.0001 -> 0.6914
+dqrmn390 remaindernear 12345 4.9 -> 1.9
+dqrmn391 remaindernear 12345 4.99 -> -0.26
+dqrmn392 remaindernear 12345 4.999 -> 2.469
+dqrmn393 remaindernear 12345 4.9999 -> 0.2469
+dqrmn394 remaindernear 12345 5 -> 0
+dqrmn395 remaindernear 12345 5.0001 -> -0.2469
+dqrmn396 remaindernear 12345 5.001 -> -2.469
+dqrmn397 remaindernear 12345 5.01 -> 0.36
+dqrmn398 remaindernear 12345 5.1 -> -2.1
+
+-- the nasty division-by-1 cases
+dqrmn401 remaindernear 0.4 1 -> 0.4
+dqrmn402 remaindernear 0.45 1 -> 0.45
+dqrmn403 remaindernear 0.455 1 -> 0.455
+dqrmn404 remaindernear 0.4555 1 -> 0.4555
+dqrmn405 remaindernear 0.45555 1 -> 0.45555
+dqrmn406 remaindernear 0.455555 1 -> 0.455555
+dqrmn407 remaindernear 0.4555555 1 -> 0.4555555
+dqrmn408 remaindernear 0.45555555 1 -> 0.45555555
+dqrmn409 remaindernear 0.455555555 1 -> 0.455555555
+-- with spill... [412 exercises sticktab loop]
+dqrmn411 remaindernear 0.5 1 -> 0.5
+dqrmn412 remaindernear 0.55 1 -> -0.45
+dqrmn413 remaindernear 0.555 1 -> -0.445
+dqrmn414 remaindernear 0.5555 1 -> -0.4445
+dqrmn415 remaindernear 0.55555 1 -> -0.44445
+dqrmn416 remaindernear 0.555555 1 -> -0.444445
+dqrmn417 remaindernear 0.5555555 1 -> -0.4444445
+dqrmn418 remaindernear 0.55555555 1 -> -0.44444445
+dqrmn419 remaindernear 0.555555555 1 -> -0.444444445
+
+-- folddowns
+dqrmn421 remaindernear 1E+6144 1 -> NaN Division_impossible
+dqrmn422 remaindernear 1E+6144 1E+6143 -> 0E+6111 Clamped
+dqrmn423 remaindernear 1E+6144 2E+6143 -> 0E+6111 Clamped
+dqrmn424 remaindernear 1E+6144 3E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqrmn425 remaindernear 1E+6144 4E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
+dqrmn426 remaindernear 1E+6144 5E+6143 -> 0E+6111 Clamped
+dqrmn427 remaindernear 1E+6144 6E+6143 -> -2.00000000000000000000000000000000E+6143 Clamped
+dqrmn428 remaindernear 1E+6144 7E+6143 -> 3.00000000000000000000000000000000E+6143 Clamped
+dqrmn429 remaindernear 1E+6144 8E+6143 -> 2.00000000000000000000000000000000E+6143 Clamped
+dqrmn430 remaindernear 1E+6144 9E+6143 -> 1.00000000000000000000000000000000E+6143 Clamped
+-- tinies
+dqrmn431 remaindernear 1E-6175 1E-6176 -> 0E-6176
+dqrmn432 remaindernear 1E-6175 2E-6176 -> 0E-6176
+dqrmn433 remaindernear 1E-6175 3E-6176 -> 1E-6176 Subnormal
+dqrmn434 remaindernear 1E-6175 4E-6176 -> 2E-6176 Subnormal
+dqrmn435 remaindernear 1E-6175 5E-6176 -> 0E-6176
+dqrmn436 remaindernear 1E-6175 6E-6176 -> -2E-6176 Subnormal
+dqrmn437 remaindernear 1E-6175 7E-6176 -> 3E-6176 Subnormal
+dqrmn438 remaindernear 1E-6175 8E-6176 -> 2E-6176 Subnormal
+dqrmn439 remaindernear 1E-6175 9E-6176 -> 1E-6176 Subnormal
+dqrmn440 remaindernear 1E-6175 10E-6176 -> 0E-6176
+dqrmn441 remaindernear 1E-6175 11E-6176 -> -1E-6176 Subnormal
+dqrmn442 remaindernear 100E-6175 11E-6176 -> -1E-6176 Subnormal
+dqrmn443 remaindernear 100E-6175 20E-6176 -> 0E-6176
+dqrmn444 remaindernear 100E-6175 21E-6176 -> -8E-6176 Subnormal
+dqrmn445 remaindernear 100E-6175 30E-6176 -> 1.0E-6175 Subnormal
+
+-- zero signs
+dqrmn650 remaindernear 1 1 -> 0
+dqrmn651 remaindernear -1 1 -> -0
+dqrmn652 remaindernear 1 -1 -> 0
+dqrmn653 remaindernear -1 -1 -> -0
+dqrmn654 remaindernear 0 1 -> 0
+dqrmn655 remaindernear -0 1 -> -0
+dqrmn656 remaindernear 0 -1 -> 0
+dqrmn657 remaindernear -0 -1 -> -0
+dqrmn658 remaindernear 0.00 1 -> 0.00
+dqrmn659 remaindernear -0.00 1 -> -0.00
+
+-- Specials
+dqrmn680 remaindernear Inf -Inf -> NaN Invalid_operation
+dqrmn681 remaindernear Inf -1000 -> NaN Invalid_operation
+dqrmn682 remaindernear Inf -1 -> NaN Invalid_operation
+dqrmn683 remaindernear Inf 0 -> NaN Invalid_operation
+dqrmn684 remaindernear Inf -0 -> NaN Invalid_operation
+dqrmn685 remaindernear Inf 1 -> NaN Invalid_operation
+dqrmn686 remaindernear Inf 1000 -> NaN Invalid_operation
+dqrmn687 remaindernear Inf Inf -> NaN Invalid_operation
+dqrmn688 remaindernear -1000 Inf -> -1000
+dqrmn689 remaindernear -Inf Inf -> NaN Invalid_operation
+dqrmn691 remaindernear -1 Inf -> -1
+dqrmn692 remaindernear 0 Inf -> 0
+dqrmn693 remaindernear -0 Inf -> -0
+dqrmn694 remaindernear 1 Inf -> 1
+dqrmn695 remaindernear 1000 Inf -> 1000
+dqrmn696 remaindernear Inf Inf -> NaN Invalid_operation
+
+dqrmn700 remaindernear -Inf -Inf -> NaN Invalid_operation
+dqrmn701 remaindernear -Inf -1000 -> NaN Invalid_operation
+dqrmn702 remaindernear -Inf -1 -> NaN Invalid_operation
+dqrmn703 remaindernear -Inf -0 -> NaN Invalid_operation
+dqrmn704 remaindernear -Inf 0 -> NaN Invalid_operation
+dqrmn705 remaindernear -Inf 1 -> NaN Invalid_operation
+dqrmn706 remaindernear -Inf 1000 -> NaN Invalid_operation
+dqrmn707 remaindernear -Inf Inf -> NaN Invalid_operation
+dqrmn708 remaindernear -Inf -Inf -> NaN Invalid_operation
+dqrmn709 remaindernear -1000 Inf -> -1000
+dqrmn710 remaindernear -1 -Inf -> -1
+dqrmn711 remaindernear -0 -Inf -> -0
+dqrmn712 remaindernear 0 -Inf -> 0
+dqrmn713 remaindernear 1 -Inf -> 1
+dqrmn714 remaindernear 1000 -Inf -> 1000
+dqrmn715 remaindernear Inf -Inf -> NaN Invalid_operation
+
+dqrmn721 remaindernear NaN -Inf -> NaN
+dqrmn722 remaindernear NaN -1000 -> NaN
+dqrmn723 remaindernear NaN -1 -> NaN
+dqrmn724 remaindernear NaN -0 -> NaN
+dqrmn725 remaindernear -NaN 0 -> -NaN
+dqrmn726 remaindernear NaN 1 -> NaN
+dqrmn727 remaindernear NaN 1000 -> NaN
+dqrmn728 remaindernear NaN Inf -> NaN
+dqrmn729 remaindernear NaN -NaN -> NaN
+dqrmn730 remaindernear -Inf NaN -> NaN
+dqrmn731 remaindernear -1000 NaN -> NaN
+dqrmn732 remaindernear -1 NaN -> NaN
+dqrmn733 remaindernear -0 -NaN -> -NaN
+dqrmn734 remaindernear 0 NaN -> NaN
+dqrmn735 remaindernear 1 -NaN -> -NaN
+dqrmn736 remaindernear 1000 NaN -> NaN
+dqrmn737 remaindernear Inf NaN -> NaN
+
+dqrmn741 remaindernear sNaN -Inf -> NaN Invalid_operation
+dqrmn742 remaindernear sNaN -1000 -> NaN Invalid_operation
+dqrmn743 remaindernear -sNaN -1 -> -NaN Invalid_operation
+dqrmn744 remaindernear sNaN -0 -> NaN Invalid_operation
+dqrmn745 remaindernear sNaN 0 -> NaN Invalid_operation
+dqrmn746 remaindernear sNaN 1 -> NaN Invalid_operation
+dqrmn747 remaindernear sNaN 1000 -> NaN Invalid_operation
+dqrmn749 remaindernear sNaN NaN -> NaN Invalid_operation
+dqrmn750 remaindernear sNaN sNaN -> NaN Invalid_operation
+dqrmn751 remaindernear NaN sNaN -> NaN Invalid_operation
+dqrmn752 remaindernear -Inf sNaN -> NaN Invalid_operation
+dqrmn753 remaindernear -1000 sNaN -> NaN Invalid_operation
+dqrmn754 remaindernear -1 sNaN -> NaN Invalid_operation
+dqrmn755 remaindernear -0 sNaN -> NaN Invalid_operation
+dqrmn756 remaindernear 0 sNaN -> NaN Invalid_operation
+dqrmn757 remaindernear 1 sNaN -> NaN Invalid_operation
+dqrmn758 remaindernear 1000 sNaN -> NaN Invalid_operation
+dqrmn759 remaindernear Inf -sNaN -> -NaN Invalid_operation
+
+-- propaging NaNs
+dqrmn760 remaindernear NaN1 NaN7 -> NaN1
+dqrmn761 remaindernear sNaN2 NaN8 -> NaN2 Invalid_operation
+dqrmn762 remaindernear NaN3 sNaN9 -> NaN9 Invalid_operation
+dqrmn763 remaindernear sNaN4 sNaN10 -> NaN4 Invalid_operation
+dqrmn764 remaindernear 15 NaN11 -> NaN11
+dqrmn765 remaindernear NaN6 NaN12 -> NaN6
+dqrmn766 remaindernear Inf NaN13 -> NaN13
+dqrmn767 remaindernear NaN14 -Inf -> NaN14
+dqrmn768 remaindernear 0 NaN15 -> NaN15
+dqrmn769 remaindernear NaN16 -0 -> NaN16
+
+-- edge cases of impossible
+dqrmn770 remaindernear 1234500000000000000000067890123456 10 -> -4
+dqrmn771 remaindernear 1234500000000000000000067890123456 1 -> 0
+dqrmn772 remaindernear 1234500000000000000000067890123456 0.1 -> NaN Division_impossible
+dqrmn773 remaindernear 1234500000000000000000067890123456 0.01 -> NaN Division_impossible
+
+-- long operand checks
+dqrmn801 remaindernear 12345678000 100 -> 0
+dqrmn802 remaindernear 1 12345678000 -> 1
+dqrmn803 remaindernear 1234567800 10 -> 0
+dqrmn804 remaindernear 1 1234567800 -> 1
+dqrmn805 remaindernear 1234567890 10 -> 0
+dqrmn806 remaindernear 1 1234567890 -> 1
+dqrmn807 remaindernear 1234567891 10 -> 1
+dqrmn808 remaindernear 1 1234567891 -> 1
+dqrmn809 remaindernear 12345678901 100 -> 1
+dqrmn810 remaindernear 1 12345678901 -> 1
+dqrmn811 remaindernear 1234567896 10 -> -4
+dqrmn812 remaindernear 1 1234567896 -> 1
+
+dqrmn821 remaindernear 12345678000 100 -> 0
+dqrmn822 remaindernear 1 12345678000 -> 1
+dqrmn823 remaindernear 1234567800 10 -> 0
+dqrmn824 remaindernear 1 1234567800 -> 1
+dqrmn825 remaindernear 1234567890 10 -> 0
+dqrmn826 remaindernear 1 1234567890 -> 1
+dqrmn827 remaindernear 1234567891 10 -> 1
+dqrmn828 remaindernear 1 1234567891 -> 1
+dqrmn829 remaindernear 12345678901 100 -> 1
+dqrmn830 remaindernear 1 12345678901 -> 1
+dqrmn831 remaindernear 1234567896 10 -> -4
+dqrmn832 remaindernear 1 1234567896 -> 1
+
+-- from divideint
+dqrmn840 remaindernear 100000000.0 1 -> 0.0
+dqrmn841 remaindernear 100000000.4 1 -> 0.4
+dqrmn842 remaindernear 100000000.5 1 -> 0.5
+dqrmn843 remaindernear 100000000.9 1 -> -0.1
+dqrmn844 remaindernear 100000000.999 1 -> -0.001
+dqrmn850 remaindernear 100000003 5 -> -2
+dqrmn851 remaindernear 10000003 5 -> -2
+dqrmn852 remaindernear 1000003 5 -> -2
+dqrmn853 remaindernear 100003 5 -> -2
+dqrmn854 remaindernear 10003 5 -> -2
+dqrmn855 remaindernear 1003 5 -> -2
+dqrmn856 remaindernear 103 5 -> -2
+dqrmn857 remaindernear 13 5 -> -2
+dqrmn858 remaindernear 1 5 -> 1
+
+-- Vladimir's cases 1234567890123456
+dqrmn860 remaindernear 123.0e1 1000000000000000 -> 1230
+dqrmn861 remaindernear 1230 1000000000000000 -> 1230
+dqrmn862 remaindernear 12.3e2 1000000000000000 -> 1230
+dqrmn863 remaindernear 1.23e3 1000000000000000 -> 1230
+dqrmn864 remaindernear 123e1 1000000000000000 -> 1230
+dqrmn870 remaindernear 123e1 1000000000000000 -> 1230
+dqrmn871 remaindernear 123e1 100000000000000 -> 1230
+dqrmn872 remaindernear 123e1 10000000000000 -> 1230
+dqrmn873 remaindernear 123e1 1000000000000 -> 1230
+dqrmn874 remaindernear 123e1 100000000000 -> 1230
+dqrmn875 remaindernear 123e1 10000000000 -> 1230
+dqrmn876 remaindernear 123e1 1000000000 -> 1230
+dqrmn877 remaindernear 123e1 100000000 -> 1230
+dqrmn878 remaindernear 1230 100000000 -> 1230
+dqrmn879 remaindernear 123e1 10000000 -> 1230
+dqrmn880 remaindernear 123e1 1000000 -> 1230
+dqrmn881 remaindernear 123e1 100000 -> 1230
+dqrmn882 remaindernear 123e1 10000 -> 1230
+dqrmn883 remaindernear 123e1 1000 -> 230
+dqrmn884 remaindernear 123e1 100 -> 30
+dqrmn885 remaindernear 123e1 10 -> 0
+dqrmn886 remaindernear 123e1 1 -> 0
+
+dqrmn890 remaindernear 123e1 2000000000000000 -> 1230
+dqrmn891 remaindernear 123e1 200000000000000 -> 1230
+dqrmn892 remaindernear 123e1 20000000000000 -> 1230
+dqrmn893 remaindernear 123e1 2000000000000 -> 1230
+dqrmn894 remaindernear 123e1 200000000000 -> 1230
+dqrmn895 remaindernear 123e1 20000000000 -> 1230
+dqrmn896 remaindernear 123e1 2000000000 -> 1230
+dqrmn897 remaindernear 123e1 200000000 -> 1230
+dqrmn899 remaindernear 123e1 20000000 -> 1230
+dqrmn900 remaindernear 123e1 2000000 -> 1230
+dqrmn901 remaindernear 123e1 200000 -> 1230
+dqrmn902 remaindernear 123e1 20000 -> 1230
+dqrmn903 remaindernear 123e1 2000 -> -770
+dqrmn904 remaindernear 123e1 200 -> 30
+dqrmn905 remaindernear 123e1 20 -> -10
+dqrmn906 remaindernear 123e1 2 -> 0
+
+dqrmn910 remaindernear 123e1 5000000000000000 -> 1230
+dqrmn911 remaindernear 123e1 500000000000000 -> 1230
+dqrmn912 remaindernear 123e1 50000000000000 -> 1230
+dqrmn913 remaindernear 123e1 5000000000000 -> 1230
+dqrmn914 remaindernear 123e1 500000000000 -> 1230
+dqrmn915 remaindernear 123e1 50000000000 -> 1230
+dqrmn916 remaindernear 123e1 5000000000 -> 1230
+dqrmn917 remaindernear 123e1 500000000 -> 1230
+dqrmn919 remaindernear 123e1 50000000 -> 1230
+dqrmn920 remaindernear 123e1 5000000 -> 1230
+dqrmn921 remaindernear 123e1 500000 -> 1230
+dqrmn922 remaindernear 123e1 50000 -> 1230
+dqrmn923 remaindernear 123e1 5000 -> 1230
+dqrmn924 remaindernear 123e1 500 -> 230
+dqrmn925 remaindernear 123e1 50 -> -20
+dqrmn926 remaindernear 123e1 5 -> 0
+
+dqrmn930 remaindernear 123e1 9000000000000000 -> 1230
+dqrmn931 remaindernear 123e1 900000000000000 -> 1230
+dqrmn932 remaindernear 123e1 90000000000000 -> 1230
+dqrmn933 remaindernear 123e1 9000000000000 -> 1230
+dqrmn934 remaindernear 123e1 900000000000 -> 1230
+dqrmn935 remaindernear 123e1 90000000000 -> 1230
+dqrmn936 remaindernear 123e1 9000000000 -> 1230
+dqrmn937 remaindernear 123e1 900000000 -> 1230
+dqrmn939 remaindernear 123e1 90000000 -> 1230
+dqrmn940 remaindernear 123e1 9000000 -> 1230
+dqrmn941 remaindernear 123e1 900000 -> 1230
+dqrmn942 remaindernear 123e1 90000 -> 1230
+dqrmn943 remaindernear 123e1 9000 -> 1230
+dqrmn944 remaindernear 123e1 900 -> 330
+dqrmn945 remaindernear 123e1 90 -> -30
+dqrmn946 remaindernear 123e1 9 -> -3
+
+dqrmn950 remaindernear 123e1 1000000000000000 -> 1230
+dqrmn961 remaindernear 123e1 2999999999999999 -> 1230
+dqrmn962 remaindernear 123e1 3999999999999999 -> 1230
+dqrmn963 remaindernear 123e1 4999999999999999 -> 1230
+dqrmn964 remaindernear 123e1 5999999999999999 -> 1230
+dqrmn965 remaindernear 123e1 6999999999999999 -> 1230
+dqrmn966 remaindernear 123e1 7999999999999999 -> 1230
+dqrmn967 remaindernear 123e1 8999999999999999 -> 1230
+dqrmn968 remaindernear 123e1 9999999999999999 -> 1230
+dqrmn969 remaindernear 123e1 9876543210987654 -> 1230
+
+dqrmn980 remaindernear 123e1 1000E299 -> 1.23E+3 -- 123E+1 internally
+
+-- overflow and underflow tests [from divide]
+dqrmn1051 remaindernear 1e+277 1e-311 -> NaN Division_impossible
+dqrmn1052 remaindernear 1e+277 -1e-311 -> NaN Division_impossible
+dqrmn1053 remaindernear -1e+277 1e-311 -> NaN Division_impossible
+dqrmn1054 remaindernear -1e+277 -1e-311 -> NaN Division_impossible
+dqrmn1055 remaindernear 1e-277 1e+311 -> 1E-277
+dqrmn1056 remaindernear 1e-277 -1e+311 -> 1E-277
+dqrmn1057 remaindernear -1e-277 1e+311 -> -1E-277
+dqrmn1058 remaindernear -1e-277 -1e+311 -> -1E-277
+
+-- Gyuris example
+dqrmn1070 remainder 8.336804418094040989630006819881709E-6143 8.336804418094040989630006819889000E-6143 -> 8.336804418094040989630006819881709E-6143
+
+-- destructive subtract
+dqrmn1101 remaindernear 1234567890123456789012345678901234 1.000000000000000000000000000000001 -> -0.234567890123456789012345678901233
+dqrmn1102 remaindernear 1234567890123456789012345678901234 1.00000000000000000000000000000001 -> -0.34567890123456789012345678901222
+dqrmn1103 remaindernear 1234567890123456789012345678901234 1.0000000000000000000000000000001 -> -0.4567890123456789012345678901111
+dqrmn1104 remaindernear 1234567890123456789012345678901255 4.000000000000000000000000000000001 -> -1.308641972530864197253086419725314
+dqrmn1105 remaindernear 1234567890123456789012345678901234 4.000000000000000000000000000000001 -> 1.691358027469135802746913580274692
+dqrmn1106 remaindernear 1234567890123456789012345678901234 4.9999999999999999999999999999999 -> -1.3086421975308642197530864219748
+dqrmn1107 remaindernear 1234567890123456789012345678901234 4.99999999999999999999999999999999 -> 1.46913578024691357802469135780247
+dqrmn1108 remaindernear 1234567890123456789012345678901234 4.999999999999999999999999999999999 -> -0.753086421975308642197530864219753
+dqrmn1109 remaindernear 1234567890123456789012345678901234 5.000000000000000000000000000000001 -> -1.246913578024691357802469135780247
+dqrmn1110 remaindernear 1234567890123456789012345678901234 5.00000000000000000000000000000001 -> 1.53086421975308642197530864219754
+dqrmn1111 remaindernear 1234567890123456789012345678901234 5.0000000000000000000000000000001 -> -0.6913578024691357802469135780242
+
+-- Null tests
+dqrmn1000 remaindernear 10 # -> NaN Invalid_operation
+dqrmn1001 remaindernear # 10 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/dqRotate.decTest b/Lib/test/decimaltestdata/dqRotate.decTest
index 858b823e08..edcf9eed23 100644
--- a/Lib/test/decimaltestdata/dqRotate.decTest
+++ b/Lib/test/decimaltestdata/dqRotate.decTest
@@ -1,298 +1,298 @@
-------------------------------------------------------------------------
--- dqRotate.decTest -- rotate decQuad coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqrot001 rotate 0 0 -> 0
-dqrot002 rotate 0 2 -> 0
-dqrot003 rotate 1 2 -> 100
-dqrot004 rotate 1 33 -> 1000000000000000000000000000000000
-dqrot005 rotate 1 34 -> 1
-dqrot006 rotate 1 -1 -> 1000000000000000000000000000000000
-dqrot007 rotate 0 -2 -> 0
-dqrot008 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123
-dqrot009 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341
-dqrot010 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234
-dqrot011 rotate 9934567890123456789012345678901234 -33 -> 9345678901234567890123456789012349
-dqrot012 rotate 9934567890123456789012345678901234 -34 -> 9934567890123456789012345678901234
-
--- rhs must be an integer
-dqrot015 rotate 1 1.5 -> NaN Invalid_operation
-dqrot016 rotate 1 1.0 -> NaN Invalid_operation
-dqrot017 rotate 1 0.1 -> NaN Invalid_operation
-dqrot018 rotate 1 0.0 -> NaN Invalid_operation
-dqrot019 rotate 1 1E+1 -> NaN Invalid_operation
-dqrot020 rotate 1 1E+99 -> NaN Invalid_operation
-dqrot021 rotate 1 Inf -> NaN Invalid_operation
-dqrot022 rotate 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-dqrot025 rotate 1 -1000 -> NaN Invalid_operation
-dqrot026 rotate 1 -35 -> NaN Invalid_operation
-dqrot027 rotate 1 35 -> NaN Invalid_operation
-dqrot028 rotate 1 1000 -> NaN Invalid_operation
-
--- full pattern
-dqrot030 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234
-dqrot031 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341
-dqrot032 rotate 1234567890123456789012345678901234 -32 -> 3456789012345678901234567890123412
-dqrot033 rotate 1234567890123456789012345678901234 -31 -> 4567890123456789012345678901234123
-dqrot034 rotate 1234567890123456789012345678901234 -30 -> 5678901234567890123456789012341234
-dqrot035 rotate 1234567890123456789012345678901234 -29 -> 6789012345678901234567890123412345
-dqrot036 rotate 1234567890123456789012345678901234 -28 -> 7890123456789012345678901234123456
-dqrot037 rotate 1234567890123456789012345678901234 -27 -> 8901234567890123456789012341234567
-dqrot038 rotate 1234567890123456789012345678901234 -26 -> 9012345678901234567890123412345678
-dqrot039 rotate 1234567890123456789012345678901234 -25 -> 123456789012345678901234123456789
-dqrot040 rotate 1234567890123456789012345678901234 -24 -> 1234567890123456789012341234567890
-dqrot041 rotate 1234567890123456789012345678901234 -23 -> 2345678901234567890123412345678901
-dqrot042 rotate 1234567890123456789012345678901234 -22 -> 3456789012345678901234123456789012
-dqrot043 rotate 1234567890123456789012345678901234 -21 -> 4567890123456789012341234567890123
-dqrot044 rotate 1234567890123456789012345678901234 -20 -> 5678901234567890123412345678901234
-dqrot045 rotate 1234567890123456789012345678901234 -19 -> 6789012345678901234123456789012345
-dqrot047 rotate 1234567890123456789012345678901234 -18 -> 7890123456789012341234567890123456
-dqrot048 rotate 1234567890123456789012345678901234 -17 -> 8901234567890123412345678901234567
-dqrot049 rotate 1234567890123456789012345678901234 -16 -> 9012345678901234123456789012345678
-dqrot050 rotate 1234567890123456789012345678901234 -15 -> 123456789012341234567890123456789
-dqrot051 rotate 1234567890123456789012345678901234 -14 -> 1234567890123412345678901234567890
-dqrot052 rotate 1234567890123456789012345678901234 -13 -> 2345678901234123456789012345678901
-dqrot053 rotate 1234567890123456789012345678901234 -12 -> 3456789012341234567890123456789012
-dqrot054 rotate 1234567890123456789012345678901234 -11 -> 4567890123412345678901234567890123
-dqrot055 rotate 1234567890123456789012345678901234 -10 -> 5678901234123456789012345678901234
-dqrot056 rotate 1234567890123456789012345678901234 -9 -> 6789012341234567890123456789012345
-dqrot057 rotate 1234567890123456789012345678901234 -8 -> 7890123412345678901234567890123456
-dqrot058 rotate 1234567890123456789012345678901234 -7 -> 8901234123456789012345678901234567
-dqrot059 rotate 1234567890123456789012345678901234 -6 -> 9012341234567890123456789012345678
-dqrot060 rotate 1234567890123456789012345678901234 -5 -> 123412345678901234567890123456789
-dqrot061 rotate 1234567890123456789012345678901234 -4 -> 1234123456789012345678901234567890
-dqrot062 rotate 1234567890123456789012345678901234 -3 -> 2341234567890123456789012345678901
-dqrot063 rotate 1234567890123456789012345678901234 -2 -> 3412345678901234567890123456789012
-dqrot064 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123
-dqrot065 rotate 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234
-
-dqrot066 rotate 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234
-dqrot067 rotate 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012341
-dqrot068 rotate 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123412
-dqrot069 rotate 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234123
-dqrot070 rotate 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012341234
-dqrot071 rotate 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123412345
-dqrot072 rotate 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234123456
-dqrot073 rotate 1234567890123456789012345678901234 +7 -> 8901234567890123456789012341234567
-dqrot074 rotate 1234567890123456789012345678901234 +8 -> 9012345678901234567890123412345678
-dqrot075 rotate 1234567890123456789012345678901234 +9 -> 123456789012345678901234123456789
-dqrot076 rotate 1234567890123456789012345678901234 +10 -> 1234567890123456789012341234567890
-dqrot077 rotate 1234567890123456789012345678901234 +11 -> 2345678901234567890123412345678901
-dqrot078 rotate 1234567890123456789012345678901234 +12 -> 3456789012345678901234123456789012
-dqrot079 rotate 1234567890123456789012345678901234 +13 -> 4567890123456789012341234567890123
-dqrot080 rotate 1234567890123456789012345678901234 +14 -> 5678901234567890123412345678901234
-dqrot081 rotate 1234567890123456789012345678901234 +15 -> 6789012345678901234123456789012345
-dqrot082 rotate 1234567890123456789012345678901234 +16 -> 7890123456789012341234567890123456
-dqrot083 rotate 1234567890123456789012345678901234 +17 -> 8901234567890123412345678901234567
-dqrot084 rotate 1234567890123456789012345678901234 +18 -> 9012345678901234123456789012345678
-dqrot085 rotate 1234567890123456789012345678901234 +19 -> 123456789012341234567890123456789
-dqrot086 rotate 1234567890123456789012345678901234 +20 -> 1234567890123412345678901234567890
-dqrot087 rotate 1234567890123456789012345678901234 +21 -> 2345678901234123456789012345678901
-dqrot088 rotate 1234567890123456789012345678901234 +22 -> 3456789012341234567890123456789012
-dqrot089 rotate 1234567890123456789012345678901234 +23 -> 4567890123412345678901234567890123
-dqrot090 rotate 1234567890123456789012345678901234 +24 -> 5678901234123456789012345678901234
-dqrot091 rotate 1234567890123456789012345678901234 +25 -> 6789012341234567890123456789012345
-dqrot092 rotate 1234567890123456789012345678901234 +26 -> 7890123412345678901234567890123456
-dqrot093 rotate 1234567890123456789012345678901234 +27 -> 8901234123456789012345678901234567
-dqrot094 rotate 1234567890123456789012345678901234 +28 -> 9012341234567890123456789012345678
-dqrot095 rotate 1234567890123456789012345678901234 +29 -> 123412345678901234567890123456789
-dqrot096 rotate 1234567890123456789012345678901234 +30 -> 1234123456789012345678901234567890
-dqrot097 rotate 1234567890123456789012345678901234 +31 -> 2341234567890123456789012345678901
-dqrot098 rotate 1234567890123456789012345678901234 +32 -> 3412345678901234567890123456789012
-dqrot099 rotate 1234567890123456789012345678901234 +33 -> 4123456789012345678901234567890123
-dqrot100 rotate 1234567890123456789012345678901234 +34 -> 1234567890123456789012345678901234
-
--- zeros
-dqrot270 rotate 0E-10 +29 -> 0E-10
-dqrot271 rotate 0E-10 -29 -> 0E-10
-dqrot272 rotate 0.000 +29 -> 0.000
-dqrot273 rotate 0.000 -29 -> 0.000
-dqrot274 rotate 0E+10 +29 -> 0E+10
-dqrot275 rotate 0E+10 -29 -> 0E+10
-dqrot276 rotate -0E-10 +29 -> -0E-10
-dqrot277 rotate -0E-10 -29 -> -0E-10
-dqrot278 rotate -0.000 +29 -> -0.000
-dqrot279 rotate -0.000 -29 -> -0.000
-dqrot280 rotate -0E+10 +29 -> -0E+10
-dqrot281 rotate -0E+10 -29 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-dqrot141 rotate 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6144
-dqrot142 rotate 9.999999999999999999999999999999999E+6144 -33 -> 9.999999999999999999999999999999999E+6144
-dqrot143 rotate 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144
-dqrot144 rotate 9.999999999999999999999999999999999E+6144 33 -> 9.999999999999999999999999999999999E+6144
-dqrot145 rotate 1E-6143 -1 -> 1.000000000000000000000000000000000E-6110
-dqrot146 rotate 1E-6143 -33 -> 1.0E-6142
-dqrot147 rotate 1E-6143 1 -> 1.0E-6142
-dqrot148 rotate 1E-6143 33 -> 1.000000000000000000000000000000000E-6110
-dqrot151 rotate 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144
-dqrot152 rotate 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176
-dqrot153 rotate 1.000000000000000000000000000000000E-6143 1 -> 1E-6176
-dqrot154 rotate 1.000000000000000000000000000000000E-6143 33 -> 1.00000000000000000000000000000000E-6144
-dqrot155 rotate 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144
-dqrot156 rotate 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176
-dqrot157 rotate 9.000000000000000000000000000000000E-6143 1 -> 9E-6176
-dqrot158 rotate 9.000000000000000000000000000000000E-6143 33 -> 9.00000000000000000000000000000000E-6144
-dqrot160 rotate 1E-6176 -1 -> 1.000000000000000000000000000000000E-6143
-dqrot161 rotate 1E-6176 -33 -> 1.0E-6175
-dqrot162 rotate 1E-6176 1 -> 1.0E-6175
-dqrot163 rotate 1E-6176 33 -> 1.000000000000000000000000000000000E-6143
--- negatives
-dqrot171 rotate -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144
-dqrot172 rotate -9.999999999999999999999999999999999E+6144 -33 -> -9.999999999999999999999999999999999E+6144
-dqrot173 rotate -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999999E+6144
-dqrot174 rotate -9.999999999999999999999999999999999E+6144 33 -> -9.999999999999999999999999999999999E+6144
-dqrot175 rotate -1E-6143 -1 -> -1.000000000000000000000000000000000E-6110
-dqrot176 rotate -1E-6143 -33 -> -1.0E-6142
-dqrot177 rotate -1E-6143 1 -> -1.0E-6142
-dqrot178 rotate -1E-6143 33 -> -1.000000000000000000000000000000000E-6110
-dqrot181 rotate -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144
-dqrot182 rotate -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176
-dqrot183 rotate -1.000000000000000000000000000000000E-6143 1 -> -1E-6176
-dqrot184 rotate -1.000000000000000000000000000000000E-6143 33 -> -1.00000000000000000000000000000000E-6144
-dqrot185 rotate -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144
-dqrot186 rotate -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176
-dqrot187 rotate -9.000000000000000000000000000000000E-6143 1 -> -9E-6176
-dqrot188 rotate -9.000000000000000000000000000000000E-6143 33 -> -9.00000000000000000000000000000000E-6144
-dqrot190 rotate -1E-6176 -1 -> -1.000000000000000000000000000000000E-6143
-dqrot191 rotate -1E-6176 -33 -> -1.0E-6175
-dqrot192 rotate -1E-6176 1 -> -1.0E-6175
-dqrot193 rotate -1E-6176 33 -> -1.000000000000000000000000000000000E-6143
-
--- more negatives (of sanities)
-dqrot201 rotate -0 0 -> -0
-dqrot202 rotate -0 2 -> -0
-dqrot203 rotate -1 2 -> -100
-dqrot204 rotate -1 33 -> -1000000000000000000000000000000000
-dqrot205 rotate -1 34 -> -1
-dqrot206 rotate -1 -1 -> -1000000000000000000000000000000000
-dqrot207 rotate -0 -2 -> -0
-dqrot208 rotate -1234567890123456789012345678901234 -1 -> -4123456789012345678901234567890123
-dqrot209 rotate -1234567890123456789012345678901234 -33 -> -2345678901234567890123456789012341
-dqrot210 rotate -1234567890123456789012345678901234 -34 -> -1234567890123456789012345678901234
-dqrot211 rotate -9934567890123456789012345678901234 -33 -> -9345678901234567890123456789012349
-dqrot212 rotate -9934567890123456789012345678901234 -34 -> -9934567890123456789012345678901234
-
-
--- Specials; NaNs are handled as usual
-dqrot781 rotate -Inf -8 -> -Infinity
-dqrot782 rotate -Inf -1 -> -Infinity
-dqrot783 rotate -Inf -0 -> -Infinity
-dqrot784 rotate -Inf 0 -> -Infinity
-dqrot785 rotate -Inf 1 -> -Infinity
-dqrot786 rotate -Inf 8 -> -Infinity
-dqrot787 rotate -1000 -Inf -> NaN Invalid_operation
-dqrot788 rotate -Inf -Inf -> NaN Invalid_operation
-dqrot789 rotate -1 -Inf -> NaN Invalid_operation
-dqrot790 rotate -0 -Inf -> NaN Invalid_operation
-dqrot791 rotate 0 -Inf -> NaN Invalid_operation
-dqrot792 rotate 1 -Inf -> NaN Invalid_operation
-dqrot793 rotate 1000 -Inf -> NaN Invalid_operation
-dqrot794 rotate Inf -Inf -> NaN Invalid_operation
-
-dqrot800 rotate Inf -Inf -> NaN Invalid_operation
-dqrot801 rotate Inf -8 -> Infinity
-dqrot802 rotate Inf -1 -> Infinity
-dqrot803 rotate Inf -0 -> Infinity
-dqrot804 rotate Inf 0 -> Infinity
-dqrot805 rotate Inf 1 -> Infinity
-dqrot806 rotate Inf 8 -> Infinity
-dqrot807 rotate Inf Inf -> NaN Invalid_operation
-dqrot808 rotate -1000 Inf -> NaN Invalid_operation
-dqrot809 rotate -Inf Inf -> NaN Invalid_operation
-dqrot810 rotate -1 Inf -> NaN Invalid_operation
-dqrot811 rotate -0 Inf -> NaN Invalid_operation
-dqrot812 rotate 0 Inf -> NaN Invalid_operation
-dqrot813 rotate 1 Inf -> NaN Invalid_operation
-dqrot814 rotate 1000 Inf -> NaN Invalid_operation
-dqrot815 rotate Inf Inf -> NaN Invalid_operation
-
-dqrot821 rotate NaN -Inf -> NaN
-dqrot822 rotate NaN -1000 -> NaN
-dqrot823 rotate NaN -1 -> NaN
-dqrot824 rotate NaN -0 -> NaN
-dqrot825 rotate NaN 0 -> NaN
-dqrot826 rotate NaN 1 -> NaN
-dqrot827 rotate NaN 1000 -> NaN
-dqrot828 rotate NaN Inf -> NaN
-dqrot829 rotate NaN NaN -> NaN
-dqrot830 rotate -Inf NaN -> NaN
-dqrot831 rotate -1000 NaN -> NaN
-dqrot832 rotate -1 NaN -> NaN
-dqrot833 rotate -0 NaN -> NaN
-dqrot834 rotate 0 NaN -> NaN
-dqrot835 rotate 1 NaN -> NaN
-dqrot836 rotate 1000 NaN -> NaN
-dqrot837 rotate Inf NaN -> NaN
-
-dqrot841 rotate sNaN -Inf -> NaN Invalid_operation
-dqrot842 rotate sNaN -1000 -> NaN Invalid_operation
-dqrot843 rotate sNaN -1 -> NaN Invalid_operation
-dqrot844 rotate sNaN -0 -> NaN Invalid_operation
-dqrot845 rotate sNaN 0 -> NaN Invalid_operation
-dqrot846 rotate sNaN 1 -> NaN Invalid_operation
-dqrot847 rotate sNaN 1000 -> NaN Invalid_operation
-dqrot848 rotate sNaN NaN -> NaN Invalid_operation
-dqrot849 rotate sNaN sNaN -> NaN Invalid_operation
-dqrot850 rotate NaN sNaN -> NaN Invalid_operation
-dqrot851 rotate -Inf sNaN -> NaN Invalid_operation
-dqrot852 rotate -1000 sNaN -> NaN Invalid_operation
-dqrot853 rotate -1 sNaN -> NaN Invalid_operation
-dqrot854 rotate -0 sNaN -> NaN Invalid_operation
-dqrot855 rotate 0 sNaN -> NaN Invalid_operation
-dqrot856 rotate 1 sNaN -> NaN Invalid_operation
-dqrot857 rotate 1000 sNaN -> NaN Invalid_operation
-dqrot858 rotate Inf sNaN -> NaN Invalid_operation
-dqrot859 rotate NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqrot861 rotate NaN1 -Inf -> NaN1
-dqrot862 rotate +NaN2 -1000 -> NaN2
-dqrot863 rotate NaN3 1000 -> NaN3
-dqrot864 rotate NaN4 Inf -> NaN4
-dqrot865 rotate NaN5 +NaN6 -> NaN5
-dqrot866 rotate -Inf NaN7 -> NaN7
-dqrot867 rotate -1000 NaN8 -> NaN8
-dqrot868 rotate 1000 NaN9 -> NaN9
-dqrot869 rotate Inf +NaN10 -> NaN10
-dqrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
-dqrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
-dqrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation
-dqrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
-dqrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
-dqrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
-dqrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
-dqrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
-dqrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation
-dqrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqrot882 rotate -NaN26 NaN28 -> -NaN26
-dqrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqrot884 rotate 1000 -NaN30 -> -NaN30
-dqrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- dqRotate.decTest -- rotate decQuad coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqrot001 rotate 0 0 -> 0
+dqrot002 rotate 0 2 -> 0
+dqrot003 rotate 1 2 -> 100
+dqrot004 rotate 1 33 -> 1000000000000000000000000000000000
+dqrot005 rotate 1 34 -> 1
+dqrot006 rotate 1 -1 -> 1000000000000000000000000000000000
+dqrot007 rotate 0 -2 -> 0
+dqrot008 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123
+dqrot009 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341
+dqrot010 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234
+dqrot011 rotate 9934567890123456789012345678901234 -33 -> 9345678901234567890123456789012349
+dqrot012 rotate 9934567890123456789012345678901234 -34 -> 9934567890123456789012345678901234
+
+-- rhs must be an integer
+dqrot015 rotate 1 1.5 -> NaN Invalid_operation
+dqrot016 rotate 1 1.0 -> NaN Invalid_operation
+dqrot017 rotate 1 0.1 -> NaN Invalid_operation
+dqrot018 rotate 1 0.0 -> NaN Invalid_operation
+dqrot019 rotate 1 1E+1 -> NaN Invalid_operation
+dqrot020 rotate 1 1E+99 -> NaN Invalid_operation
+dqrot021 rotate 1 Inf -> NaN Invalid_operation
+dqrot022 rotate 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+dqrot025 rotate 1 -1000 -> NaN Invalid_operation
+dqrot026 rotate 1 -35 -> NaN Invalid_operation
+dqrot027 rotate 1 35 -> NaN Invalid_operation
+dqrot028 rotate 1 1000 -> NaN Invalid_operation
+
+-- full pattern
+dqrot030 rotate 1234567890123456789012345678901234 -34 -> 1234567890123456789012345678901234
+dqrot031 rotate 1234567890123456789012345678901234 -33 -> 2345678901234567890123456789012341
+dqrot032 rotate 1234567890123456789012345678901234 -32 -> 3456789012345678901234567890123412
+dqrot033 rotate 1234567890123456789012345678901234 -31 -> 4567890123456789012345678901234123
+dqrot034 rotate 1234567890123456789012345678901234 -30 -> 5678901234567890123456789012341234
+dqrot035 rotate 1234567890123456789012345678901234 -29 -> 6789012345678901234567890123412345
+dqrot036 rotate 1234567890123456789012345678901234 -28 -> 7890123456789012345678901234123456
+dqrot037 rotate 1234567890123456789012345678901234 -27 -> 8901234567890123456789012341234567
+dqrot038 rotate 1234567890123456789012345678901234 -26 -> 9012345678901234567890123412345678
+dqrot039 rotate 1234567890123456789012345678901234 -25 -> 123456789012345678901234123456789
+dqrot040 rotate 1234567890123456789012345678901234 -24 -> 1234567890123456789012341234567890
+dqrot041 rotate 1234567890123456789012345678901234 -23 -> 2345678901234567890123412345678901
+dqrot042 rotate 1234567890123456789012345678901234 -22 -> 3456789012345678901234123456789012
+dqrot043 rotate 1234567890123456789012345678901234 -21 -> 4567890123456789012341234567890123
+dqrot044 rotate 1234567890123456789012345678901234 -20 -> 5678901234567890123412345678901234
+dqrot045 rotate 1234567890123456789012345678901234 -19 -> 6789012345678901234123456789012345
+dqrot047 rotate 1234567890123456789012345678901234 -18 -> 7890123456789012341234567890123456
+dqrot048 rotate 1234567890123456789012345678901234 -17 -> 8901234567890123412345678901234567
+dqrot049 rotate 1234567890123456789012345678901234 -16 -> 9012345678901234123456789012345678
+dqrot050 rotate 1234567890123456789012345678901234 -15 -> 123456789012341234567890123456789
+dqrot051 rotate 1234567890123456789012345678901234 -14 -> 1234567890123412345678901234567890
+dqrot052 rotate 1234567890123456789012345678901234 -13 -> 2345678901234123456789012345678901
+dqrot053 rotate 1234567890123456789012345678901234 -12 -> 3456789012341234567890123456789012
+dqrot054 rotate 1234567890123456789012345678901234 -11 -> 4567890123412345678901234567890123
+dqrot055 rotate 1234567890123456789012345678901234 -10 -> 5678901234123456789012345678901234
+dqrot056 rotate 1234567890123456789012345678901234 -9 -> 6789012341234567890123456789012345
+dqrot057 rotate 1234567890123456789012345678901234 -8 -> 7890123412345678901234567890123456
+dqrot058 rotate 1234567890123456789012345678901234 -7 -> 8901234123456789012345678901234567
+dqrot059 rotate 1234567890123456789012345678901234 -6 -> 9012341234567890123456789012345678
+dqrot060 rotate 1234567890123456789012345678901234 -5 -> 123412345678901234567890123456789
+dqrot061 rotate 1234567890123456789012345678901234 -4 -> 1234123456789012345678901234567890
+dqrot062 rotate 1234567890123456789012345678901234 -3 -> 2341234567890123456789012345678901
+dqrot063 rotate 1234567890123456789012345678901234 -2 -> 3412345678901234567890123456789012
+dqrot064 rotate 1234567890123456789012345678901234 -1 -> 4123456789012345678901234567890123
+dqrot065 rotate 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234
+
+dqrot066 rotate 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234
+dqrot067 rotate 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012341
+dqrot068 rotate 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123412
+dqrot069 rotate 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234123
+dqrot070 rotate 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012341234
+dqrot071 rotate 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123412345
+dqrot072 rotate 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234123456
+dqrot073 rotate 1234567890123456789012345678901234 +7 -> 8901234567890123456789012341234567
+dqrot074 rotate 1234567890123456789012345678901234 +8 -> 9012345678901234567890123412345678
+dqrot075 rotate 1234567890123456789012345678901234 +9 -> 123456789012345678901234123456789
+dqrot076 rotate 1234567890123456789012345678901234 +10 -> 1234567890123456789012341234567890
+dqrot077 rotate 1234567890123456789012345678901234 +11 -> 2345678901234567890123412345678901
+dqrot078 rotate 1234567890123456789012345678901234 +12 -> 3456789012345678901234123456789012
+dqrot079 rotate 1234567890123456789012345678901234 +13 -> 4567890123456789012341234567890123
+dqrot080 rotate 1234567890123456789012345678901234 +14 -> 5678901234567890123412345678901234
+dqrot081 rotate 1234567890123456789012345678901234 +15 -> 6789012345678901234123456789012345
+dqrot082 rotate 1234567890123456789012345678901234 +16 -> 7890123456789012341234567890123456
+dqrot083 rotate 1234567890123456789012345678901234 +17 -> 8901234567890123412345678901234567
+dqrot084 rotate 1234567890123456789012345678901234 +18 -> 9012345678901234123456789012345678
+dqrot085 rotate 1234567890123456789012345678901234 +19 -> 123456789012341234567890123456789
+dqrot086 rotate 1234567890123456789012345678901234 +20 -> 1234567890123412345678901234567890
+dqrot087 rotate 1234567890123456789012345678901234 +21 -> 2345678901234123456789012345678901
+dqrot088 rotate 1234567890123456789012345678901234 +22 -> 3456789012341234567890123456789012
+dqrot089 rotate 1234567890123456789012345678901234 +23 -> 4567890123412345678901234567890123
+dqrot090 rotate 1234567890123456789012345678901234 +24 -> 5678901234123456789012345678901234
+dqrot091 rotate 1234567890123456789012345678901234 +25 -> 6789012341234567890123456789012345
+dqrot092 rotate 1234567890123456789012345678901234 +26 -> 7890123412345678901234567890123456
+dqrot093 rotate 1234567890123456789012345678901234 +27 -> 8901234123456789012345678901234567
+dqrot094 rotate 1234567890123456789012345678901234 +28 -> 9012341234567890123456789012345678
+dqrot095 rotate 1234567890123456789012345678901234 +29 -> 123412345678901234567890123456789
+dqrot096 rotate 1234567890123456789012345678901234 +30 -> 1234123456789012345678901234567890
+dqrot097 rotate 1234567890123456789012345678901234 +31 -> 2341234567890123456789012345678901
+dqrot098 rotate 1234567890123456789012345678901234 +32 -> 3412345678901234567890123456789012
+dqrot099 rotate 1234567890123456789012345678901234 +33 -> 4123456789012345678901234567890123
+dqrot100 rotate 1234567890123456789012345678901234 +34 -> 1234567890123456789012345678901234
+
+-- zeros
+dqrot270 rotate 0E-10 +29 -> 0E-10
+dqrot271 rotate 0E-10 -29 -> 0E-10
+dqrot272 rotate 0.000 +29 -> 0.000
+dqrot273 rotate 0.000 -29 -> 0.000
+dqrot274 rotate 0E+10 +29 -> 0E+10
+dqrot275 rotate 0E+10 -29 -> 0E+10
+dqrot276 rotate -0E-10 +29 -> -0E-10
+dqrot277 rotate -0E-10 -29 -> -0E-10
+dqrot278 rotate -0.000 +29 -> -0.000
+dqrot279 rotate -0.000 -29 -> -0.000
+dqrot280 rotate -0E+10 +29 -> -0E+10
+dqrot281 rotate -0E+10 -29 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+dqrot141 rotate 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6144
+dqrot142 rotate 9.999999999999999999999999999999999E+6144 -33 -> 9.999999999999999999999999999999999E+6144
+dqrot143 rotate 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999999E+6144
+dqrot144 rotate 9.999999999999999999999999999999999E+6144 33 -> 9.999999999999999999999999999999999E+6144
+dqrot145 rotate 1E-6143 -1 -> 1.000000000000000000000000000000000E-6110
+dqrot146 rotate 1E-6143 -33 -> 1.0E-6142
+dqrot147 rotate 1E-6143 1 -> 1.0E-6142
+dqrot148 rotate 1E-6143 33 -> 1.000000000000000000000000000000000E-6110
+dqrot151 rotate 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144
+dqrot152 rotate 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176
+dqrot153 rotate 1.000000000000000000000000000000000E-6143 1 -> 1E-6176
+dqrot154 rotate 1.000000000000000000000000000000000E-6143 33 -> 1.00000000000000000000000000000000E-6144
+dqrot155 rotate 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144
+dqrot156 rotate 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176
+dqrot157 rotate 9.000000000000000000000000000000000E-6143 1 -> 9E-6176
+dqrot158 rotate 9.000000000000000000000000000000000E-6143 33 -> 9.00000000000000000000000000000000E-6144
+dqrot160 rotate 1E-6176 -1 -> 1.000000000000000000000000000000000E-6143
+dqrot161 rotate 1E-6176 -33 -> 1.0E-6175
+dqrot162 rotate 1E-6176 1 -> 1.0E-6175
+dqrot163 rotate 1E-6176 33 -> 1.000000000000000000000000000000000E-6143
+-- negatives
+dqrot171 rotate -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6144
+dqrot172 rotate -9.999999999999999999999999999999999E+6144 -33 -> -9.999999999999999999999999999999999E+6144
+dqrot173 rotate -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999999E+6144
+dqrot174 rotate -9.999999999999999999999999999999999E+6144 33 -> -9.999999999999999999999999999999999E+6144
+dqrot175 rotate -1E-6143 -1 -> -1.000000000000000000000000000000000E-6110
+dqrot176 rotate -1E-6143 -33 -> -1.0E-6142
+dqrot177 rotate -1E-6143 1 -> -1.0E-6142
+dqrot178 rotate -1E-6143 33 -> -1.000000000000000000000000000000000E-6110
+dqrot181 rotate -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144
+dqrot182 rotate -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176
+dqrot183 rotate -1.000000000000000000000000000000000E-6143 1 -> -1E-6176
+dqrot184 rotate -1.000000000000000000000000000000000E-6143 33 -> -1.00000000000000000000000000000000E-6144
+dqrot185 rotate -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144
+dqrot186 rotate -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176
+dqrot187 rotate -9.000000000000000000000000000000000E-6143 1 -> -9E-6176
+dqrot188 rotate -9.000000000000000000000000000000000E-6143 33 -> -9.00000000000000000000000000000000E-6144
+dqrot190 rotate -1E-6176 -1 -> -1.000000000000000000000000000000000E-6143
+dqrot191 rotate -1E-6176 -33 -> -1.0E-6175
+dqrot192 rotate -1E-6176 1 -> -1.0E-6175
+dqrot193 rotate -1E-6176 33 -> -1.000000000000000000000000000000000E-6143
+
+-- more negatives (of sanities)
+dqrot201 rotate -0 0 -> -0
+dqrot202 rotate -0 2 -> -0
+dqrot203 rotate -1 2 -> -100
+dqrot204 rotate -1 33 -> -1000000000000000000000000000000000
+dqrot205 rotate -1 34 -> -1
+dqrot206 rotate -1 -1 -> -1000000000000000000000000000000000
+dqrot207 rotate -0 -2 -> -0
+dqrot208 rotate -1234567890123456789012345678901234 -1 -> -4123456789012345678901234567890123
+dqrot209 rotate -1234567890123456789012345678901234 -33 -> -2345678901234567890123456789012341
+dqrot210 rotate -1234567890123456789012345678901234 -34 -> -1234567890123456789012345678901234
+dqrot211 rotate -9934567890123456789012345678901234 -33 -> -9345678901234567890123456789012349
+dqrot212 rotate -9934567890123456789012345678901234 -34 -> -9934567890123456789012345678901234
+
+
+-- Specials; NaNs are handled as usual
+dqrot781 rotate -Inf -8 -> -Infinity
+dqrot782 rotate -Inf -1 -> -Infinity
+dqrot783 rotate -Inf -0 -> -Infinity
+dqrot784 rotate -Inf 0 -> -Infinity
+dqrot785 rotate -Inf 1 -> -Infinity
+dqrot786 rotate -Inf 8 -> -Infinity
+dqrot787 rotate -1000 -Inf -> NaN Invalid_operation
+dqrot788 rotate -Inf -Inf -> NaN Invalid_operation
+dqrot789 rotate -1 -Inf -> NaN Invalid_operation
+dqrot790 rotate -0 -Inf -> NaN Invalid_operation
+dqrot791 rotate 0 -Inf -> NaN Invalid_operation
+dqrot792 rotate 1 -Inf -> NaN Invalid_operation
+dqrot793 rotate 1000 -Inf -> NaN Invalid_operation
+dqrot794 rotate Inf -Inf -> NaN Invalid_operation
+
+dqrot800 rotate Inf -Inf -> NaN Invalid_operation
+dqrot801 rotate Inf -8 -> Infinity
+dqrot802 rotate Inf -1 -> Infinity
+dqrot803 rotate Inf -0 -> Infinity
+dqrot804 rotate Inf 0 -> Infinity
+dqrot805 rotate Inf 1 -> Infinity
+dqrot806 rotate Inf 8 -> Infinity
+dqrot807 rotate Inf Inf -> NaN Invalid_operation
+dqrot808 rotate -1000 Inf -> NaN Invalid_operation
+dqrot809 rotate -Inf Inf -> NaN Invalid_operation
+dqrot810 rotate -1 Inf -> NaN Invalid_operation
+dqrot811 rotate -0 Inf -> NaN Invalid_operation
+dqrot812 rotate 0 Inf -> NaN Invalid_operation
+dqrot813 rotate 1 Inf -> NaN Invalid_operation
+dqrot814 rotate 1000 Inf -> NaN Invalid_operation
+dqrot815 rotate Inf Inf -> NaN Invalid_operation
+
+dqrot821 rotate NaN -Inf -> NaN
+dqrot822 rotate NaN -1000 -> NaN
+dqrot823 rotate NaN -1 -> NaN
+dqrot824 rotate NaN -0 -> NaN
+dqrot825 rotate NaN 0 -> NaN
+dqrot826 rotate NaN 1 -> NaN
+dqrot827 rotate NaN 1000 -> NaN
+dqrot828 rotate NaN Inf -> NaN
+dqrot829 rotate NaN NaN -> NaN
+dqrot830 rotate -Inf NaN -> NaN
+dqrot831 rotate -1000 NaN -> NaN
+dqrot832 rotate -1 NaN -> NaN
+dqrot833 rotate -0 NaN -> NaN
+dqrot834 rotate 0 NaN -> NaN
+dqrot835 rotate 1 NaN -> NaN
+dqrot836 rotate 1000 NaN -> NaN
+dqrot837 rotate Inf NaN -> NaN
+
+dqrot841 rotate sNaN -Inf -> NaN Invalid_operation
+dqrot842 rotate sNaN -1000 -> NaN Invalid_operation
+dqrot843 rotate sNaN -1 -> NaN Invalid_operation
+dqrot844 rotate sNaN -0 -> NaN Invalid_operation
+dqrot845 rotate sNaN 0 -> NaN Invalid_operation
+dqrot846 rotate sNaN 1 -> NaN Invalid_operation
+dqrot847 rotate sNaN 1000 -> NaN Invalid_operation
+dqrot848 rotate sNaN NaN -> NaN Invalid_operation
+dqrot849 rotate sNaN sNaN -> NaN Invalid_operation
+dqrot850 rotate NaN sNaN -> NaN Invalid_operation
+dqrot851 rotate -Inf sNaN -> NaN Invalid_operation
+dqrot852 rotate -1000 sNaN -> NaN Invalid_operation
+dqrot853 rotate -1 sNaN -> NaN Invalid_operation
+dqrot854 rotate -0 sNaN -> NaN Invalid_operation
+dqrot855 rotate 0 sNaN -> NaN Invalid_operation
+dqrot856 rotate 1 sNaN -> NaN Invalid_operation
+dqrot857 rotate 1000 sNaN -> NaN Invalid_operation
+dqrot858 rotate Inf sNaN -> NaN Invalid_operation
+dqrot859 rotate NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqrot861 rotate NaN1 -Inf -> NaN1
+dqrot862 rotate +NaN2 -1000 -> NaN2
+dqrot863 rotate NaN3 1000 -> NaN3
+dqrot864 rotate NaN4 Inf -> NaN4
+dqrot865 rotate NaN5 +NaN6 -> NaN5
+dqrot866 rotate -Inf NaN7 -> NaN7
+dqrot867 rotate -1000 NaN8 -> NaN8
+dqrot868 rotate 1000 NaN9 -> NaN9
+dqrot869 rotate Inf +NaN10 -> NaN10
+dqrot871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
+dqrot872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
+dqrot873 rotate sNaN13 1000 -> NaN13 Invalid_operation
+dqrot874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
+dqrot875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqrot876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
+dqrot877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
+dqrot878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
+dqrot879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
+dqrot880 rotate Inf sNaN23 -> NaN23 Invalid_operation
+dqrot881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqrot882 rotate -NaN26 NaN28 -> -NaN26
+dqrot883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqrot884 rotate 1000 -NaN30 -> -NaN30
+dqrot885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqSameQuantum.decTest b/Lib/test/decimaltestdata/dqSameQuantum.decTest
index 2f356bbae9..257cda802d 100644
--- a/Lib/test/decimaltestdata/dqSameQuantum.decTest
+++ b/Lib/test/decimaltestdata/dqSameQuantum.decTest
@@ -1,389 +1,389 @@
-------------------------------------------------------------------------
--- dqSameQuantum.decTest -- check decQuad quantums match --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- All operands and results are decQuads.
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqsamq001 samequantum 0 0 -> 1
-dqsamq002 samequantum 0 1 -> 1
-dqsamq003 samequantum 1 0 -> 1
-dqsamq004 samequantum 1 1 -> 1
-
-dqsamq011 samequantum 10 1E+1 -> 0
-dqsamq012 samequantum 10E+1 10E+1 -> 1
-dqsamq013 samequantum 100 10E+1 -> 0
-dqsamq014 samequantum 100 1E+2 -> 0
-dqsamq015 samequantum 0.1 1E-2 -> 0
-dqsamq016 samequantum 0.1 1E-1 -> 1
-dqsamq017 samequantum 0.1 1E-0 -> 0
-dqsamq018 samequantum 999 999 -> 1
-dqsamq019 samequantum 999E-1 99.9 -> 1
-dqsamq020 samequantum 111E-1 22.2 -> 1
-dqsamq021 samequantum 111E-1 1234.2 -> 1
-
--- zeros
-dqsamq030 samequantum 0.0 1.1 -> 1
-dqsamq031 samequantum 0.0 1.11 -> 0
-dqsamq032 samequantum 0.0 0 -> 0
-dqsamq033 samequantum 0.0 0.0 -> 1
-dqsamq034 samequantum 0.0 0.00 -> 0
-dqsamq035 samequantum 0E+1 0E+0 -> 0
-dqsamq036 samequantum 0E+1 0E+1 -> 1
-dqsamq037 samequantum 0E+1 0E+2 -> 0
-dqsamq038 samequantum 0E-17 0E-16 -> 0
-dqsamq039 samequantum 0E-17 0E-17 -> 1
-dqsamq040 samequantum 0E-17 0E-18 -> 0
-dqsamq041 samequantum 0E-17 0.0E-15 -> 0
-dqsamq042 samequantum 0E-17 0.0E-16 -> 1
-dqsamq043 samequantum 0E-17 0.0E-17 -> 0
-dqsamq044 samequantum -0E-17 0.0E-16 -> 1
-dqsamq045 samequantum 0E-17 -0.0E-17 -> 0
-dqsamq046 samequantum 0E-17 -0.0E-16 -> 1
-dqsamq047 samequantum -0E-17 0.0E-17 -> 0
-dqsamq048 samequantum -0E-17 -0.0E-16 -> 1
-dqsamq049 samequantum -0E-17 -0.0E-17 -> 0
-
--- Nmax, Nmin, Ntiny
-dqsamq051 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1
-dqsamq052 samequantum 1E-6143 1E-6143 -> 1
-dqsamq053 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1
-dqsamq054 samequantum 1E-6176 1E-6176 -> 1
-dqsamq055 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1
-dqsamq056 samequantum 1E-6143 1E-6143 -> 1
-dqsamq057 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1
-dqsamq058 samequantum 1E-6176 1E-6176 -> 1
-
-dqsamq061 samequantum -1E-6176 -1E-6176 -> 1
-dqsamq062 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1
-dqsamq063 samequantum -1E-6143 -1E-6143 -> 1
-dqsamq064 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1
-dqsamq065 samequantum -1E-6176 -1E-6176 -> 1
-dqsamq066 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1
-dqsamq067 samequantum -1E-6143 -1E-6143 -> 1
-dqsamq068 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1
-
-dqsamq071 samequantum -4E-6176 -1E-6176 -> 1
-dqsamq072 samequantum -4.00000000000000000000000000000000E-6143 -1.00000000000000000000000000004000E-6143 -> 1
-dqsamq073 samequantum -4E-6143 -1E-6143 -> 1
-dqsamq074 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6144 -> 1
-dqsamq075 samequantum -4E-6176 -1E-6176 -> 1
-dqsamq076 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6143 -> 1
-dqsamq077 samequantum -4E-6143 -1E-6143 -> 1
-dqsamq078 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6144 -> 1
-
-dqsamq081 samequantum -4E-1006 -1E-6176 -> 0
-dqsamq082 samequantum -4.00000000000000000000000000000000E-6143 -1.00004000000000000000000000000000E-6136 -> 0
-dqsamq083 samequantum -4E-6140 -1E-6143 -> 0
-dqsamq084 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6136 -> 0
-dqsamq085 samequantum -4E-1006 -1E-6176 -> 0
-dqsamq086 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6136 -> 0
-dqsamq087 samequantum -4E-6133 -1E-6143 -> 0
-dqsamq088 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6136 -> 0
-
--- specials & combinations
-dqsamq0110 samequantum -Inf -Inf -> 1
-dqsamq0111 samequantum -Inf Inf -> 1
-dqsamq0112 samequantum -Inf NaN -> 0
-dqsamq0113 samequantum -Inf -7E+3 -> 0
-dqsamq0114 samequantum -Inf -7 -> 0
-dqsamq0115 samequantum -Inf -7E-3 -> 0
-dqsamq0116 samequantum -Inf -0E-3 -> 0
-dqsamq0117 samequantum -Inf -0 -> 0
-dqsamq0118 samequantum -Inf -0E+3 -> 0
-dqsamq0119 samequantum -Inf 0E-3 -> 0
-dqsamq0120 samequantum -Inf 0 -> 0
-dqsamq0121 samequantum -Inf 0E+3 -> 0
-dqsamq0122 samequantum -Inf 7E-3 -> 0
-dqsamq0123 samequantum -Inf 7 -> 0
-dqsamq0124 samequantum -Inf 7E+3 -> 0
-dqsamq0125 samequantum -Inf sNaN -> 0
-
-dqsamq0210 samequantum Inf -Inf -> 1
-dqsamq0211 samequantum Inf Inf -> 1
-dqsamq0212 samequantum Inf NaN -> 0
-dqsamq0213 samequantum Inf -7E+3 -> 0
-dqsamq0214 samequantum Inf -7 -> 0
-dqsamq0215 samequantum Inf -7E-3 -> 0
-dqsamq0216 samequantum Inf -0E-3 -> 0
-dqsamq0217 samequantum Inf -0 -> 0
-dqsamq0218 samequantum Inf -0E+3 -> 0
-dqsamq0219 samequantum Inf 0E-3 -> 0
-dqsamq0220 samequantum Inf 0 -> 0
-dqsamq0221 samequantum Inf 0E+3 -> 0
-dqsamq0222 samequantum Inf 7E-3 -> 0
-dqsamq0223 samequantum Inf 7 -> 0
-dqsamq0224 samequantum Inf 7E+3 -> 0
-dqsamq0225 samequantum Inf sNaN -> 0
-
-dqsamq0310 samequantum NaN -Inf -> 0
-dqsamq0311 samequantum NaN Inf -> 0
-dqsamq0312 samequantum NaN NaN -> 1
-dqsamq0313 samequantum NaN -7E+3 -> 0
-dqsamq0314 samequantum NaN -7 -> 0
-dqsamq0315 samequantum NaN -7E-3 -> 0
-dqsamq0316 samequantum NaN -0E-3 -> 0
-dqsamq0317 samequantum NaN -0 -> 0
-dqsamq0318 samequantum NaN -0E+3 -> 0
-dqsamq0319 samequantum NaN 0E-3 -> 0
-dqsamq0320 samequantum NaN 0 -> 0
-dqsamq0321 samequantum NaN 0E+3 -> 0
-dqsamq0322 samequantum NaN 7E-3 -> 0
-dqsamq0323 samequantum NaN 7 -> 0
-dqsamq0324 samequantum NaN 7E+3 -> 0
-dqsamq0325 samequantum NaN sNaN -> 1
-
-dqsamq0410 samequantum -7E+3 -Inf -> 0
-dqsamq0411 samequantum -7E+3 Inf -> 0
-dqsamq0412 samequantum -7E+3 NaN -> 0
-dqsamq0413 samequantum -7E+3 -7E+3 -> 1
-dqsamq0414 samequantum -7E+3 -7 -> 0
-dqsamq0415 samequantum -7E+3 -7E-3 -> 0
-dqsamq0416 samequantum -7E+3 -0E-3 -> 0
-dqsamq0417 samequantum -7E+3 -0 -> 0
-dqsamq0418 samequantum -7E+3 -0E+3 -> 1
-dqsamq0419 samequantum -7E+3 0E-3 -> 0
-dqsamq0420 samequantum -7E+3 0 -> 0
-dqsamq0421 samequantum -7E+3 0E+3 -> 1
-dqsamq0422 samequantum -7E+3 7E-3 -> 0
-dqsamq0423 samequantum -7E+3 7 -> 0
-dqsamq0424 samequantum -7E+3 7E+3 -> 1
-dqsamq0425 samequantum -7E+3 sNaN -> 0
-
-dqsamq0510 samequantum -7 -Inf -> 0
-dqsamq0511 samequantum -7 Inf -> 0
-dqsamq0512 samequantum -7 NaN -> 0
-dqsamq0513 samequantum -7 -7E+3 -> 0
-dqsamq0514 samequantum -7 -7 -> 1
-dqsamq0515 samequantum -7 -7E-3 -> 0
-dqsamq0516 samequantum -7 -0E-3 -> 0
-dqsamq0517 samequantum -7 -0 -> 1
-dqsamq0518 samequantum -7 -0E+3 -> 0
-dqsamq0519 samequantum -7 0E-3 -> 0
-dqsamq0520 samequantum -7 0 -> 1
-dqsamq0521 samequantum -7 0E+3 -> 0
-dqsamq0522 samequantum -7 7E-3 -> 0
-dqsamq0523 samequantum -7 7 -> 1
-dqsamq0524 samequantum -7 7E+3 -> 0
-dqsamq0525 samequantum -7 sNaN -> 0
-
-dqsamq0610 samequantum -7E-3 -Inf -> 0
-dqsamq0611 samequantum -7E-3 Inf -> 0
-dqsamq0612 samequantum -7E-3 NaN -> 0
-dqsamq0613 samequantum -7E-3 -7E+3 -> 0
-dqsamq0614 samequantum -7E-3 -7 -> 0
-dqsamq0615 samequantum -7E-3 -7E-3 -> 1
-dqsamq0616 samequantum -7E-3 -0E-3 -> 1
-dqsamq0617 samequantum -7E-3 -0 -> 0
-dqsamq0618 samequantum -7E-3 -0E+3 -> 0
-dqsamq0619 samequantum -7E-3 0E-3 -> 1
-dqsamq0620 samequantum -7E-3 0 -> 0
-dqsamq0621 samequantum -7E-3 0E+3 -> 0
-dqsamq0622 samequantum -7E-3 7E-3 -> 1
-dqsamq0623 samequantum -7E-3 7 -> 0
-dqsamq0624 samequantum -7E-3 7E+3 -> 0
-dqsamq0625 samequantum -7E-3 sNaN -> 0
-
-dqsamq0710 samequantum -0E-3 -Inf -> 0
-dqsamq0711 samequantum -0E-3 Inf -> 0
-dqsamq0712 samequantum -0E-3 NaN -> 0
-dqsamq0713 samequantum -0E-3 -7E+3 -> 0
-dqsamq0714 samequantum -0E-3 -7 -> 0
-dqsamq0715 samequantum -0E-3 -7E-3 -> 1
-dqsamq0716 samequantum -0E-3 -0E-3 -> 1
-dqsamq0717 samequantum -0E-3 -0 -> 0
-dqsamq0718 samequantum -0E-3 -0E+3 -> 0
-dqsamq0719 samequantum -0E-3 0E-3 -> 1
-dqsamq0720 samequantum -0E-3 0 -> 0
-dqsamq0721 samequantum -0E-3 0E+3 -> 0
-dqsamq0722 samequantum -0E-3 7E-3 -> 1
-dqsamq0723 samequantum -0E-3 7 -> 0
-dqsamq0724 samequantum -0E-3 7E+3 -> 0
-dqsamq0725 samequantum -0E-3 sNaN -> 0
-
-dqsamq0810 samequantum -0 -Inf -> 0
-dqsamq0811 samequantum -0 Inf -> 0
-dqsamq0812 samequantum -0 NaN -> 0
-dqsamq0813 samequantum -0 -7E+3 -> 0
-dqsamq0814 samequantum -0 -7 -> 1
-dqsamq0815 samequantum -0 -7E-3 -> 0
-dqsamq0816 samequantum -0 -0E-3 -> 0
-dqsamq0817 samequantum -0 -0 -> 1
-dqsamq0818 samequantum -0 -0E+3 -> 0
-dqsamq0819 samequantum -0 0E-3 -> 0
-dqsamq0820 samequantum -0 0 -> 1
-dqsamq0821 samequantum -0 0E+3 -> 0
-dqsamq0822 samequantum -0 7E-3 -> 0
-dqsamq0823 samequantum -0 7 -> 1
-dqsamq0824 samequantum -0 7E+3 -> 0
-dqsamq0825 samequantum -0 sNaN -> 0
-
-dqsamq0910 samequantum -0E+3 -Inf -> 0
-dqsamq0911 samequantum -0E+3 Inf -> 0
-dqsamq0912 samequantum -0E+3 NaN -> 0
-dqsamq0913 samequantum -0E+3 -7E+3 -> 1
-dqsamq0914 samequantum -0E+3 -7 -> 0
-dqsamq0915 samequantum -0E+3 -7E-3 -> 0
-dqsamq0916 samequantum -0E+3 -0E-3 -> 0
-dqsamq0917 samequantum -0E+3 -0 -> 0
-dqsamq0918 samequantum -0E+3 -0E+3 -> 1
-dqsamq0919 samequantum -0E+3 0E-3 -> 0
-dqsamq0920 samequantum -0E+3 0 -> 0
-dqsamq0921 samequantum -0E+3 0E+3 -> 1
-dqsamq0922 samequantum -0E+3 7E-3 -> 0
-dqsamq0923 samequantum -0E+3 7 -> 0
-dqsamq0924 samequantum -0E+3 7E+3 -> 1
-dqsamq0925 samequantum -0E+3 sNaN -> 0
-
-dqsamq1110 samequantum 0E-3 -Inf -> 0
-dqsamq1111 samequantum 0E-3 Inf -> 0
-dqsamq1112 samequantum 0E-3 NaN -> 0
-dqsamq1113 samequantum 0E-3 -7E+3 -> 0
-dqsamq1114 samequantum 0E-3 -7 -> 0
-dqsamq1115 samequantum 0E-3 -7E-3 -> 1
-dqsamq1116 samequantum 0E-3 -0E-3 -> 1
-dqsamq1117 samequantum 0E-3 -0 -> 0
-dqsamq1118 samequantum 0E-3 -0E+3 -> 0
-dqsamq1119 samequantum 0E-3 0E-3 -> 1
-dqsamq1120 samequantum 0E-3 0 -> 0
-dqsamq1121 samequantum 0E-3 0E+3 -> 0
-dqsamq1122 samequantum 0E-3 7E-3 -> 1
-dqsamq1123 samequantum 0E-3 7 -> 0
-dqsamq1124 samequantum 0E-3 7E+3 -> 0
-dqsamq1125 samequantum 0E-3 sNaN -> 0
-
-dqsamq1210 samequantum 0 -Inf -> 0
-dqsamq1211 samequantum 0 Inf -> 0
-dqsamq1212 samequantum 0 NaN -> 0
-dqsamq1213 samequantum 0 -7E+3 -> 0
-dqsamq1214 samequantum 0 -7 -> 1
-dqsamq1215 samequantum 0 -7E-3 -> 0
-dqsamq1216 samequantum 0 -0E-3 -> 0
-dqsamq1217 samequantum 0 -0 -> 1
-dqsamq1218 samequantum 0 -0E+3 -> 0
-dqsamq1219 samequantum 0 0E-3 -> 0
-dqsamq1220 samequantum 0 0 -> 1
-dqsamq1221 samequantum 0 0E+3 -> 0
-dqsamq1222 samequantum 0 7E-3 -> 0
-dqsamq1223 samequantum 0 7 -> 1
-dqsamq1224 samequantum 0 7E+3 -> 0
-dqsamq1225 samequantum 0 sNaN -> 0
-
-dqsamq1310 samequantum 0E+3 -Inf -> 0
-dqsamq1311 samequantum 0E+3 Inf -> 0
-dqsamq1312 samequantum 0E+3 NaN -> 0
-dqsamq1313 samequantum 0E+3 -7E+3 -> 1
-dqsamq1314 samequantum 0E+3 -7 -> 0
-dqsamq1315 samequantum 0E+3 -7E-3 -> 0
-dqsamq1316 samequantum 0E+3 -0E-3 -> 0
-dqsamq1317 samequantum 0E+3 -0 -> 0
-dqsamq1318 samequantum 0E+3 -0E+3 -> 1
-dqsamq1319 samequantum 0E+3 0E-3 -> 0
-dqsamq1320 samequantum 0E+3 0 -> 0
-dqsamq1321 samequantum 0E+3 0E+3 -> 1
-dqsamq1322 samequantum 0E+3 7E-3 -> 0
-dqsamq1323 samequantum 0E+3 7 -> 0
-dqsamq1324 samequantum 0E+3 7E+3 -> 1
-dqsamq1325 samequantum 0E+3 sNaN -> 0
-
-dqsamq1410 samequantum 7E-3 -Inf -> 0
-dqsamq1411 samequantum 7E-3 Inf -> 0
-dqsamq1412 samequantum 7E-3 NaN -> 0
-dqsamq1413 samequantum 7E-3 -7E+3 -> 0
-dqsamq1414 samequantum 7E-3 -7 -> 0
-dqsamq1415 samequantum 7E-3 -7E-3 -> 1
-dqsamq1416 samequantum 7E-3 -0E-3 -> 1
-dqsamq1417 samequantum 7E-3 -0 -> 0
-dqsamq1418 samequantum 7E-3 -0E+3 -> 0
-dqsamq1419 samequantum 7E-3 0E-3 -> 1
-dqsamq1420 samequantum 7E-3 0 -> 0
-dqsamq1421 samequantum 7E-3 0E+3 -> 0
-dqsamq1422 samequantum 7E-3 7E-3 -> 1
-dqsamq1423 samequantum 7E-3 7 -> 0
-dqsamq1424 samequantum 7E-3 7E+3 -> 0
-dqsamq1425 samequantum 7E-3 sNaN -> 0
-
-dqsamq1510 samequantum 7 -Inf -> 0
-dqsamq1511 samequantum 7 Inf -> 0
-dqsamq1512 samequantum 7 NaN -> 0
-dqsamq1513 samequantum 7 -7E+3 -> 0
-dqsamq1514 samequantum 7 -7 -> 1
-dqsamq1515 samequantum 7 -7E-3 -> 0
-dqsamq1516 samequantum 7 -0E-3 -> 0
-dqsamq1517 samequantum 7 -0 -> 1
-dqsamq1518 samequantum 7 -0E+3 -> 0
-dqsamq1519 samequantum 7 0E-3 -> 0
-dqsamq1520 samequantum 7 0 -> 1
-dqsamq1521 samequantum 7 0E+3 -> 0
-dqsamq1522 samequantum 7 7E-3 -> 0
-dqsamq1523 samequantum 7 7 -> 1
-dqsamq1524 samequantum 7 7E+3 -> 0
-dqsamq1525 samequantum 7 sNaN -> 0
-
-dqsamq1610 samequantum 7E+3 -Inf -> 0
-dqsamq1611 samequantum 7E+3 Inf -> 0
-dqsamq1612 samequantum 7E+3 NaN -> 0
-dqsamq1613 samequantum 7E+3 -7E+3 -> 1
-dqsamq1614 samequantum 7E+3 -7 -> 0
-dqsamq1615 samequantum 7E+3 -7E-3 -> 0
-dqsamq1616 samequantum 7E+3 -0E-3 -> 0
-dqsamq1617 samequantum 7E+3 -0 -> 0
-dqsamq1618 samequantum 7E+3 -0E+3 -> 1
-dqsamq1619 samequantum 7E+3 0E-3 -> 0
-dqsamq1620 samequantum 7E+3 0 -> 0
-dqsamq1621 samequantum 7E+3 0E+3 -> 1
-dqsamq1622 samequantum 7E+3 7E-3 -> 0
-dqsamq1623 samequantum 7E+3 7 -> 0
-dqsamq1624 samequantum 7E+3 7E+3 -> 1
-dqsamq1625 samequantum 7E+3 sNaN -> 0
-
-dqsamq1710 samequantum sNaN -Inf -> 0
-dqsamq1711 samequantum sNaN Inf -> 0
-dqsamq1712 samequantum sNaN NaN -> 1
-dqsamq1713 samequantum sNaN -7E+3 -> 0
-dqsamq1714 samequantum sNaN -7 -> 0
-dqsamq1715 samequantum sNaN -7E-3 -> 0
-dqsamq1716 samequantum sNaN -0E-3 -> 0
-dqsamq1717 samequantum sNaN -0 -> 0
-dqsamq1718 samequantum sNaN -0E+3 -> 0
-dqsamq1719 samequantum sNaN 0E-3 -> 0
-dqsamq1720 samequantum sNaN 0 -> 0
-dqsamq1721 samequantum sNaN 0E+3 -> 0
-dqsamq1722 samequantum sNaN 7E-3 -> 0
-dqsamq1723 samequantum sNaN 7 -> 0
-dqsamq1724 samequantum sNaN 7E+3 -> 0
-dqsamq1725 samequantum sNaN sNaN -> 1
--- noisy NaNs
-dqsamq1730 samequantum sNaN3 sNaN3 -> 1
-dqsamq1731 samequantum sNaN3 sNaN4 -> 1
-dqsamq1732 samequantum NaN3 NaN3 -> 1
-dqsamq1733 samequantum NaN3 NaN4 -> 1
-dqsamq1734 samequantum sNaN3 3 -> 0
-dqsamq1735 samequantum NaN3 3 -> 0
-dqsamq1736 samequantum 4 sNaN4 -> 0
-dqsamq1737 samequantum 3 NaN3 -> 0
-dqsamq1738 samequantum Inf sNaN4 -> 0
-dqsamq1739 samequantum -Inf NaN3 -> 0
-
+------------------------------------------------------------------------
+-- dqSameQuantum.decTest -- check decQuad quantums match --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- All operands and results are decQuads.
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqsamq001 samequantum 0 0 -> 1
+dqsamq002 samequantum 0 1 -> 1
+dqsamq003 samequantum 1 0 -> 1
+dqsamq004 samequantum 1 1 -> 1
+
+dqsamq011 samequantum 10 1E+1 -> 0
+dqsamq012 samequantum 10E+1 10E+1 -> 1
+dqsamq013 samequantum 100 10E+1 -> 0
+dqsamq014 samequantum 100 1E+2 -> 0
+dqsamq015 samequantum 0.1 1E-2 -> 0
+dqsamq016 samequantum 0.1 1E-1 -> 1
+dqsamq017 samequantum 0.1 1E-0 -> 0
+dqsamq018 samequantum 999 999 -> 1
+dqsamq019 samequantum 999E-1 99.9 -> 1
+dqsamq020 samequantum 111E-1 22.2 -> 1
+dqsamq021 samequantum 111E-1 1234.2 -> 1
+
+-- zeros
+dqsamq030 samequantum 0.0 1.1 -> 1
+dqsamq031 samequantum 0.0 1.11 -> 0
+dqsamq032 samequantum 0.0 0 -> 0
+dqsamq033 samequantum 0.0 0.0 -> 1
+dqsamq034 samequantum 0.0 0.00 -> 0
+dqsamq035 samequantum 0E+1 0E+0 -> 0
+dqsamq036 samequantum 0E+1 0E+1 -> 1
+dqsamq037 samequantum 0E+1 0E+2 -> 0
+dqsamq038 samequantum 0E-17 0E-16 -> 0
+dqsamq039 samequantum 0E-17 0E-17 -> 1
+dqsamq040 samequantum 0E-17 0E-18 -> 0
+dqsamq041 samequantum 0E-17 0.0E-15 -> 0
+dqsamq042 samequantum 0E-17 0.0E-16 -> 1
+dqsamq043 samequantum 0E-17 0.0E-17 -> 0
+dqsamq044 samequantum -0E-17 0.0E-16 -> 1
+dqsamq045 samequantum 0E-17 -0.0E-17 -> 0
+dqsamq046 samequantum 0E-17 -0.0E-16 -> 1
+dqsamq047 samequantum -0E-17 0.0E-17 -> 0
+dqsamq048 samequantum -0E-17 -0.0E-16 -> 1
+dqsamq049 samequantum -0E-17 -0.0E-17 -> 0
+
+-- Nmax, Nmin, Ntiny
+dqsamq051 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1
+dqsamq052 samequantum 1E-6143 1E-6143 -> 1
+dqsamq053 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1
+dqsamq054 samequantum 1E-6176 1E-6176 -> 1
+dqsamq055 samequantum 9.99999999999999999999999999999999E+6144 9.99999999999999999999999999999999E+6144 -> 1
+dqsamq056 samequantum 1E-6143 1E-6143 -> 1
+dqsamq057 samequantum 1.00000000000000000000000000000000E-6143 1.00000000000000000000000000000000E-6143 -> 1
+dqsamq058 samequantum 1E-6176 1E-6176 -> 1
+
+dqsamq061 samequantum -1E-6176 -1E-6176 -> 1
+dqsamq062 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1
+dqsamq063 samequantum -1E-6143 -1E-6143 -> 1
+dqsamq064 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1
+dqsamq065 samequantum -1E-6176 -1E-6176 -> 1
+dqsamq066 samequantum -1.00000000000000000000000000000000E-6143 -1.00000000000000000000000000000000E-6143 -> 1
+dqsamq067 samequantum -1E-6143 -1E-6143 -> 1
+dqsamq068 samequantum -9.99999999999999999999999999999999E+6144 -9.99999999999999999999999999999999E+6144 -> 1
+
+dqsamq071 samequantum -4E-6176 -1E-6176 -> 1
+dqsamq072 samequantum -4.00000000000000000000000000000000E-6143 -1.00000000000000000000000000004000E-6143 -> 1
+dqsamq073 samequantum -4E-6143 -1E-6143 -> 1
+dqsamq074 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6144 -> 1
+dqsamq075 samequantum -4E-6176 -1E-6176 -> 1
+dqsamq076 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6143 -> 1
+dqsamq077 samequantum -4E-6143 -1E-6143 -> 1
+dqsamq078 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6144 -> 1
+
+dqsamq081 samequantum -4E-1006 -1E-6176 -> 0
+dqsamq082 samequantum -4.00000000000000000000000000000000E-6143 -1.00004000000000000000000000000000E-6136 -> 0
+dqsamq083 samequantum -4E-6140 -1E-6143 -> 0
+dqsamq084 samequantum -4.99999999999999999999999999999999E+6144 -9.99949999999999999999999999999999E+6136 -> 0
+dqsamq085 samequantum -4E-1006 -1E-6176 -> 0
+dqsamq086 samequantum -4.00000000000000000000000000000000E-6143 -1.00400000000000000000000000000000E-6136 -> 0
+dqsamq087 samequantum -4E-6133 -1E-6143 -> 0
+dqsamq088 samequantum -4.99999999999999999999999999999999E+6144 -9.94999999999999999999999999999999E+6136 -> 0
+
+-- specials & combinations
+dqsamq0110 samequantum -Inf -Inf -> 1
+dqsamq0111 samequantum -Inf Inf -> 1
+dqsamq0112 samequantum -Inf NaN -> 0
+dqsamq0113 samequantum -Inf -7E+3 -> 0
+dqsamq0114 samequantum -Inf -7 -> 0
+dqsamq0115 samequantum -Inf -7E-3 -> 0
+dqsamq0116 samequantum -Inf -0E-3 -> 0
+dqsamq0117 samequantum -Inf -0 -> 0
+dqsamq0118 samequantum -Inf -0E+3 -> 0
+dqsamq0119 samequantum -Inf 0E-3 -> 0
+dqsamq0120 samequantum -Inf 0 -> 0
+dqsamq0121 samequantum -Inf 0E+3 -> 0
+dqsamq0122 samequantum -Inf 7E-3 -> 0
+dqsamq0123 samequantum -Inf 7 -> 0
+dqsamq0124 samequantum -Inf 7E+3 -> 0
+dqsamq0125 samequantum -Inf sNaN -> 0
+
+dqsamq0210 samequantum Inf -Inf -> 1
+dqsamq0211 samequantum Inf Inf -> 1
+dqsamq0212 samequantum Inf NaN -> 0
+dqsamq0213 samequantum Inf -7E+3 -> 0
+dqsamq0214 samequantum Inf -7 -> 0
+dqsamq0215 samequantum Inf -7E-3 -> 0
+dqsamq0216 samequantum Inf -0E-3 -> 0
+dqsamq0217 samequantum Inf -0 -> 0
+dqsamq0218 samequantum Inf -0E+3 -> 0
+dqsamq0219 samequantum Inf 0E-3 -> 0
+dqsamq0220 samequantum Inf 0 -> 0
+dqsamq0221 samequantum Inf 0E+3 -> 0
+dqsamq0222 samequantum Inf 7E-3 -> 0
+dqsamq0223 samequantum Inf 7 -> 0
+dqsamq0224 samequantum Inf 7E+3 -> 0
+dqsamq0225 samequantum Inf sNaN -> 0
+
+dqsamq0310 samequantum NaN -Inf -> 0
+dqsamq0311 samequantum NaN Inf -> 0
+dqsamq0312 samequantum NaN NaN -> 1
+dqsamq0313 samequantum NaN -7E+3 -> 0
+dqsamq0314 samequantum NaN -7 -> 0
+dqsamq0315 samequantum NaN -7E-3 -> 0
+dqsamq0316 samequantum NaN -0E-3 -> 0
+dqsamq0317 samequantum NaN -0 -> 0
+dqsamq0318 samequantum NaN -0E+3 -> 0
+dqsamq0319 samequantum NaN 0E-3 -> 0
+dqsamq0320 samequantum NaN 0 -> 0
+dqsamq0321 samequantum NaN 0E+3 -> 0
+dqsamq0322 samequantum NaN 7E-3 -> 0
+dqsamq0323 samequantum NaN 7 -> 0
+dqsamq0324 samequantum NaN 7E+3 -> 0
+dqsamq0325 samequantum NaN sNaN -> 1
+
+dqsamq0410 samequantum -7E+3 -Inf -> 0
+dqsamq0411 samequantum -7E+3 Inf -> 0
+dqsamq0412 samequantum -7E+3 NaN -> 0
+dqsamq0413 samequantum -7E+3 -7E+3 -> 1
+dqsamq0414 samequantum -7E+3 -7 -> 0
+dqsamq0415 samequantum -7E+3 -7E-3 -> 0
+dqsamq0416 samequantum -7E+3 -0E-3 -> 0
+dqsamq0417 samequantum -7E+3 -0 -> 0
+dqsamq0418 samequantum -7E+3 -0E+3 -> 1
+dqsamq0419 samequantum -7E+3 0E-3 -> 0
+dqsamq0420 samequantum -7E+3 0 -> 0
+dqsamq0421 samequantum -7E+3 0E+3 -> 1
+dqsamq0422 samequantum -7E+3 7E-3 -> 0
+dqsamq0423 samequantum -7E+3 7 -> 0
+dqsamq0424 samequantum -7E+3 7E+3 -> 1
+dqsamq0425 samequantum -7E+3 sNaN -> 0
+
+dqsamq0510 samequantum -7 -Inf -> 0
+dqsamq0511 samequantum -7 Inf -> 0
+dqsamq0512 samequantum -7 NaN -> 0
+dqsamq0513 samequantum -7 -7E+3 -> 0
+dqsamq0514 samequantum -7 -7 -> 1
+dqsamq0515 samequantum -7 -7E-3 -> 0
+dqsamq0516 samequantum -7 -0E-3 -> 0
+dqsamq0517 samequantum -7 -0 -> 1
+dqsamq0518 samequantum -7 -0E+3 -> 0
+dqsamq0519 samequantum -7 0E-3 -> 0
+dqsamq0520 samequantum -7 0 -> 1
+dqsamq0521 samequantum -7 0E+3 -> 0
+dqsamq0522 samequantum -7 7E-3 -> 0
+dqsamq0523 samequantum -7 7 -> 1
+dqsamq0524 samequantum -7 7E+3 -> 0
+dqsamq0525 samequantum -7 sNaN -> 0
+
+dqsamq0610 samequantum -7E-3 -Inf -> 0
+dqsamq0611 samequantum -7E-3 Inf -> 0
+dqsamq0612 samequantum -7E-3 NaN -> 0
+dqsamq0613 samequantum -7E-3 -7E+3 -> 0
+dqsamq0614 samequantum -7E-3 -7 -> 0
+dqsamq0615 samequantum -7E-3 -7E-3 -> 1
+dqsamq0616 samequantum -7E-3 -0E-3 -> 1
+dqsamq0617 samequantum -7E-3 -0 -> 0
+dqsamq0618 samequantum -7E-3 -0E+3 -> 0
+dqsamq0619 samequantum -7E-3 0E-3 -> 1
+dqsamq0620 samequantum -7E-3 0 -> 0
+dqsamq0621 samequantum -7E-3 0E+3 -> 0
+dqsamq0622 samequantum -7E-3 7E-3 -> 1
+dqsamq0623 samequantum -7E-3 7 -> 0
+dqsamq0624 samequantum -7E-3 7E+3 -> 0
+dqsamq0625 samequantum -7E-3 sNaN -> 0
+
+dqsamq0710 samequantum -0E-3 -Inf -> 0
+dqsamq0711 samequantum -0E-3 Inf -> 0
+dqsamq0712 samequantum -0E-3 NaN -> 0
+dqsamq0713 samequantum -0E-3 -7E+3 -> 0
+dqsamq0714 samequantum -0E-3 -7 -> 0
+dqsamq0715 samequantum -0E-3 -7E-3 -> 1
+dqsamq0716 samequantum -0E-3 -0E-3 -> 1
+dqsamq0717 samequantum -0E-3 -0 -> 0
+dqsamq0718 samequantum -0E-3 -0E+3 -> 0
+dqsamq0719 samequantum -0E-3 0E-3 -> 1
+dqsamq0720 samequantum -0E-3 0 -> 0
+dqsamq0721 samequantum -0E-3 0E+3 -> 0
+dqsamq0722 samequantum -0E-3 7E-3 -> 1
+dqsamq0723 samequantum -0E-3 7 -> 0
+dqsamq0724 samequantum -0E-3 7E+3 -> 0
+dqsamq0725 samequantum -0E-3 sNaN -> 0
+
+dqsamq0810 samequantum -0 -Inf -> 0
+dqsamq0811 samequantum -0 Inf -> 0
+dqsamq0812 samequantum -0 NaN -> 0
+dqsamq0813 samequantum -0 -7E+3 -> 0
+dqsamq0814 samequantum -0 -7 -> 1
+dqsamq0815 samequantum -0 -7E-3 -> 0
+dqsamq0816 samequantum -0 -0E-3 -> 0
+dqsamq0817 samequantum -0 -0 -> 1
+dqsamq0818 samequantum -0 -0E+3 -> 0
+dqsamq0819 samequantum -0 0E-3 -> 0
+dqsamq0820 samequantum -0 0 -> 1
+dqsamq0821 samequantum -0 0E+3 -> 0
+dqsamq0822 samequantum -0 7E-3 -> 0
+dqsamq0823 samequantum -0 7 -> 1
+dqsamq0824 samequantum -0 7E+3 -> 0
+dqsamq0825 samequantum -0 sNaN -> 0
+
+dqsamq0910 samequantum -0E+3 -Inf -> 0
+dqsamq0911 samequantum -0E+3 Inf -> 0
+dqsamq0912 samequantum -0E+3 NaN -> 0
+dqsamq0913 samequantum -0E+3 -7E+3 -> 1
+dqsamq0914 samequantum -0E+3 -7 -> 0
+dqsamq0915 samequantum -0E+3 -7E-3 -> 0
+dqsamq0916 samequantum -0E+3 -0E-3 -> 0
+dqsamq0917 samequantum -0E+3 -0 -> 0
+dqsamq0918 samequantum -0E+3 -0E+3 -> 1
+dqsamq0919 samequantum -0E+3 0E-3 -> 0
+dqsamq0920 samequantum -0E+3 0 -> 0
+dqsamq0921 samequantum -0E+3 0E+3 -> 1
+dqsamq0922 samequantum -0E+3 7E-3 -> 0
+dqsamq0923 samequantum -0E+3 7 -> 0
+dqsamq0924 samequantum -0E+3 7E+3 -> 1
+dqsamq0925 samequantum -0E+3 sNaN -> 0
+
+dqsamq1110 samequantum 0E-3 -Inf -> 0
+dqsamq1111 samequantum 0E-3 Inf -> 0
+dqsamq1112 samequantum 0E-3 NaN -> 0
+dqsamq1113 samequantum 0E-3 -7E+3 -> 0
+dqsamq1114 samequantum 0E-3 -7 -> 0
+dqsamq1115 samequantum 0E-3 -7E-3 -> 1
+dqsamq1116 samequantum 0E-3 -0E-3 -> 1
+dqsamq1117 samequantum 0E-3 -0 -> 0
+dqsamq1118 samequantum 0E-3 -0E+3 -> 0
+dqsamq1119 samequantum 0E-3 0E-3 -> 1
+dqsamq1120 samequantum 0E-3 0 -> 0
+dqsamq1121 samequantum 0E-3 0E+3 -> 0
+dqsamq1122 samequantum 0E-3 7E-3 -> 1
+dqsamq1123 samequantum 0E-3 7 -> 0
+dqsamq1124 samequantum 0E-3 7E+3 -> 0
+dqsamq1125 samequantum 0E-3 sNaN -> 0
+
+dqsamq1210 samequantum 0 -Inf -> 0
+dqsamq1211 samequantum 0 Inf -> 0
+dqsamq1212 samequantum 0 NaN -> 0
+dqsamq1213 samequantum 0 -7E+3 -> 0
+dqsamq1214 samequantum 0 -7 -> 1
+dqsamq1215 samequantum 0 -7E-3 -> 0
+dqsamq1216 samequantum 0 -0E-3 -> 0
+dqsamq1217 samequantum 0 -0 -> 1
+dqsamq1218 samequantum 0 -0E+3 -> 0
+dqsamq1219 samequantum 0 0E-3 -> 0
+dqsamq1220 samequantum 0 0 -> 1
+dqsamq1221 samequantum 0 0E+3 -> 0
+dqsamq1222 samequantum 0 7E-3 -> 0
+dqsamq1223 samequantum 0 7 -> 1
+dqsamq1224 samequantum 0 7E+3 -> 0
+dqsamq1225 samequantum 0 sNaN -> 0
+
+dqsamq1310 samequantum 0E+3 -Inf -> 0
+dqsamq1311 samequantum 0E+3 Inf -> 0
+dqsamq1312 samequantum 0E+3 NaN -> 0
+dqsamq1313 samequantum 0E+3 -7E+3 -> 1
+dqsamq1314 samequantum 0E+3 -7 -> 0
+dqsamq1315 samequantum 0E+3 -7E-3 -> 0
+dqsamq1316 samequantum 0E+3 -0E-3 -> 0
+dqsamq1317 samequantum 0E+3 -0 -> 0
+dqsamq1318 samequantum 0E+3 -0E+3 -> 1
+dqsamq1319 samequantum 0E+3 0E-3 -> 0
+dqsamq1320 samequantum 0E+3 0 -> 0
+dqsamq1321 samequantum 0E+3 0E+3 -> 1
+dqsamq1322 samequantum 0E+3 7E-3 -> 0
+dqsamq1323 samequantum 0E+3 7 -> 0
+dqsamq1324 samequantum 0E+3 7E+3 -> 1
+dqsamq1325 samequantum 0E+3 sNaN -> 0
+
+dqsamq1410 samequantum 7E-3 -Inf -> 0
+dqsamq1411 samequantum 7E-3 Inf -> 0
+dqsamq1412 samequantum 7E-3 NaN -> 0
+dqsamq1413 samequantum 7E-3 -7E+3 -> 0
+dqsamq1414 samequantum 7E-3 -7 -> 0
+dqsamq1415 samequantum 7E-3 -7E-3 -> 1
+dqsamq1416 samequantum 7E-3 -0E-3 -> 1
+dqsamq1417 samequantum 7E-3 -0 -> 0
+dqsamq1418 samequantum 7E-3 -0E+3 -> 0
+dqsamq1419 samequantum 7E-3 0E-3 -> 1
+dqsamq1420 samequantum 7E-3 0 -> 0
+dqsamq1421 samequantum 7E-3 0E+3 -> 0
+dqsamq1422 samequantum 7E-3 7E-3 -> 1
+dqsamq1423 samequantum 7E-3 7 -> 0
+dqsamq1424 samequantum 7E-3 7E+3 -> 0
+dqsamq1425 samequantum 7E-3 sNaN -> 0
+
+dqsamq1510 samequantum 7 -Inf -> 0
+dqsamq1511 samequantum 7 Inf -> 0
+dqsamq1512 samequantum 7 NaN -> 0
+dqsamq1513 samequantum 7 -7E+3 -> 0
+dqsamq1514 samequantum 7 -7 -> 1
+dqsamq1515 samequantum 7 -7E-3 -> 0
+dqsamq1516 samequantum 7 -0E-3 -> 0
+dqsamq1517 samequantum 7 -0 -> 1
+dqsamq1518 samequantum 7 -0E+3 -> 0
+dqsamq1519 samequantum 7 0E-3 -> 0
+dqsamq1520 samequantum 7 0 -> 1
+dqsamq1521 samequantum 7 0E+3 -> 0
+dqsamq1522 samequantum 7 7E-3 -> 0
+dqsamq1523 samequantum 7 7 -> 1
+dqsamq1524 samequantum 7 7E+3 -> 0
+dqsamq1525 samequantum 7 sNaN -> 0
+
+dqsamq1610 samequantum 7E+3 -Inf -> 0
+dqsamq1611 samequantum 7E+3 Inf -> 0
+dqsamq1612 samequantum 7E+3 NaN -> 0
+dqsamq1613 samequantum 7E+3 -7E+3 -> 1
+dqsamq1614 samequantum 7E+3 -7 -> 0
+dqsamq1615 samequantum 7E+3 -7E-3 -> 0
+dqsamq1616 samequantum 7E+3 -0E-3 -> 0
+dqsamq1617 samequantum 7E+3 -0 -> 0
+dqsamq1618 samequantum 7E+3 -0E+3 -> 1
+dqsamq1619 samequantum 7E+3 0E-3 -> 0
+dqsamq1620 samequantum 7E+3 0 -> 0
+dqsamq1621 samequantum 7E+3 0E+3 -> 1
+dqsamq1622 samequantum 7E+3 7E-3 -> 0
+dqsamq1623 samequantum 7E+3 7 -> 0
+dqsamq1624 samequantum 7E+3 7E+3 -> 1
+dqsamq1625 samequantum 7E+3 sNaN -> 0
+
+dqsamq1710 samequantum sNaN -Inf -> 0
+dqsamq1711 samequantum sNaN Inf -> 0
+dqsamq1712 samequantum sNaN NaN -> 1
+dqsamq1713 samequantum sNaN -7E+3 -> 0
+dqsamq1714 samequantum sNaN -7 -> 0
+dqsamq1715 samequantum sNaN -7E-3 -> 0
+dqsamq1716 samequantum sNaN -0E-3 -> 0
+dqsamq1717 samequantum sNaN -0 -> 0
+dqsamq1718 samequantum sNaN -0E+3 -> 0
+dqsamq1719 samequantum sNaN 0E-3 -> 0
+dqsamq1720 samequantum sNaN 0 -> 0
+dqsamq1721 samequantum sNaN 0E+3 -> 0
+dqsamq1722 samequantum sNaN 7E-3 -> 0
+dqsamq1723 samequantum sNaN 7 -> 0
+dqsamq1724 samequantum sNaN 7E+3 -> 0
+dqsamq1725 samequantum sNaN sNaN -> 1
+-- noisy NaNs
+dqsamq1730 samequantum sNaN3 sNaN3 -> 1
+dqsamq1731 samequantum sNaN3 sNaN4 -> 1
+dqsamq1732 samequantum NaN3 NaN3 -> 1
+dqsamq1733 samequantum NaN3 NaN4 -> 1
+dqsamq1734 samequantum sNaN3 3 -> 0
+dqsamq1735 samequantum NaN3 3 -> 0
+dqsamq1736 samequantum 4 sNaN4 -> 0
+dqsamq1737 samequantum 3 NaN3 -> 0
+dqsamq1738 samequantum Inf sNaN4 -> 0
+dqsamq1739 samequantum -Inf NaN3 -> 0
+
diff --git a/Lib/test/decimaltestdata/dqScaleB.decTest b/Lib/test/decimaltestdata/dqScaleB.decTest
index 01e1191963..045dc58d82 100644
--- a/Lib/test/decimaltestdata/dqScaleB.decTest
+++ b/Lib/test/decimaltestdata/dqScaleB.decTest
@@ -1,260 +1,260 @@
-------------------------------------------------------------------------
--- dqScalebB.decTest -- scale a decQuad by powers of 10 --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Max |rhs| is 2*(6144+34) = 12356
-
--- Sanity checks
-dqscb001 scaleb 7.50 10 -> 7.50E+10
-dqscb002 scaleb 7.50 3 -> 7.50E+3
-dqscb003 scaleb 7.50 2 -> 750
-dqscb004 scaleb 7.50 1 -> 75.0
-dqscb005 scaleb 7.50 0 -> 7.50
-dqscb006 scaleb 7.50 -1 -> 0.750
-dqscb007 scaleb 7.50 -2 -> 0.0750
-dqscb008 scaleb 7.50 -10 -> 7.50E-10
-dqscb009 scaleb -7.50 3 -> -7.50E+3
-dqscb010 scaleb -7.50 2 -> -750
-dqscb011 scaleb -7.50 1 -> -75.0
-dqscb012 scaleb -7.50 0 -> -7.50
-dqscb013 scaleb -7.50 -1 -> -0.750
-
--- Infinities
-dqscb014 scaleb Infinity 1 -> Infinity
-dqscb015 scaleb -Infinity 2 -> -Infinity
-dqscb016 scaleb Infinity -1 -> Infinity
-dqscb017 scaleb -Infinity -2 -> -Infinity
-
--- Next two are somewhat undefined in 754r; treat as non-integer
-dqscb018 scaleb 10 Infinity -> NaN Invalid_operation
-dqscb019 scaleb 10 -Infinity -> NaN Invalid_operation
-
--- NaNs are undefined in 754r; assume usual processing
--- NaNs, 0 payload
-dqscb021 scaleb NaN 1 -> NaN
-dqscb022 scaleb -NaN -1 -> -NaN
-dqscb023 scaleb sNaN 1 -> NaN Invalid_operation
-dqscb024 scaleb -sNaN 1 -> -NaN Invalid_operation
-dqscb025 scaleb 4 NaN -> NaN
-dqscb026 scaleb -Inf -NaN -> -NaN
-dqscb027 scaleb 4 sNaN -> NaN Invalid_operation
-dqscb028 scaleb Inf -sNaN -> -NaN Invalid_operation
-
--- non-integer RHS
-dqscb030 scaleb 1.23 1 -> 12.3
-dqscb031 scaleb 1.23 1.00 -> NaN Invalid_operation
-dqscb032 scaleb 1.23 1.1 -> NaN Invalid_operation
-dqscb033 scaleb 1.23 1.01 -> NaN Invalid_operation
-dqscb034 scaleb 1.23 0.01 -> NaN Invalid_operation
-dqscb035 scaleb 1.23 0.11 -> NaN Invalid_operation
-dqscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
-dqscb037 scaleb 1.23 -1 -> 0.123
-dqscb0614 scaleb 1.23 -1.00 -> NaN Invalid_operation
-dqscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation
-dqscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation
-dqscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation
-dqscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation
-dqscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
-dqscb044 scaleb 1.23 0.1 -> NaN Invalid_operation
-dqscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation
-dqscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
-dqscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
-
--- out-of range RHS
-dqscb120 scaleb 1.23 12355 -> Infinity Overflow Inexact Rounded
-dqscb121 scaleb 1.23 12356 -> Infinity Overflow Inexact Rounded
-dqscb122 scaleb 1.23 12357 -> NaN Invalid_operation
-dqscb123 scaleb 1.23 12358 -> NaN Invalid_operation
-dqscb124 scaleb 1.23 -12355 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqscb125 scaleb 1.23 -12356 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqscb126 scaleb 1.23 -12357 -> NaN Invalid_operation
-dqscb127 scaleb 1.23 -12358 -> NaN Invalid_operation
-
--- NaNs, non-0 payload
--- propagating NaNs
-dqscb861 scaleb NaN01 -Inf -> NaN1
-dqscb862 scaleb -NaN02 -1000 -> -NaN2
-dqscb863 scaleb NaN03 1000 -> NaN3
-dqscb864 scaleb NaN04 Inf -> NaN4
-dqscb865 scaleb NaN05 NaN61 -> NaN5
-dqscb866 scaleb -Inf -NaN71 -> -NaN71
-dqscb867 scaleb -1000 NaN81 -> NaN81
-dqscb868 scaleb 1000 NaN91 -> NaN91
-dqscb869 scaleb Inf NaN101 -> NaN101
-dqscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
-dqscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
-dqscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
-dqscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
-dqscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
-dqscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
-dqscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
-dqscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
-dqscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
-dqscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
-dqscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- finites
-dqscb051 scaleb 7 -2 -> 0.07
-dqscb052 scaleb -7 -2 -> -0.07
-dqscb053 scaleb 75 -2 -> 0.75
-dqscb054 scaleb -75 -2 -> -0.75
-dqscb055 scaleb 7.50 -2 -> 0.0750
-dqscb056 scaleb -7.50 -2 -> -0.0750
-dqscb057 scaleb 7.500 -2 -> 0.07500
-dqscb058 scaleb -7.500 -2 -> -0.07500
-dqscb061 scaleb 7 -1 -> 0.7
-dqscb062 scaleb -7 -1 -> -0.7
-dqscb063 scaleb 75 -1 -> 7.5
-dqscb064 scaleb -75 -1 -> -7.5
-dqscb065 scaleb 7.50 -1 -> 0.750
-dqscb066 scaleb -7.50 -1 -> -0.750
-dqscb067 scaleb 7.500 -1 -> 0.7500
-dqscb068 scaleb -7.500 -1 -> -0.7500
-dqscb071 scaleb 7 0 -> 7
-dqscb072 scaleb -7 0 -> -7
-dqscb073 scaleb 75 0 -> 75
-dqscb074 scaleb -75 0 -> -75
-dqscb075 scaleb 7.50 0 -> 7.50
-dqscb076 scaleb -7.50 0 -> -7.50
-dqscb077 scaleb 7.500 0 -> 7.500
-dqscb078 scaleb -7.500 0 -> -7.500
-dqscb081 scaleb 7 1 -> 7E+1
-dqscb082 scaleb -7 1 -> -7E+1
-dqscb083 scaleb 75 1 -> 7.5E+2
-dqscb084 scaleb -75 1 -> -7.5E+2
-dqscb085 scaleb 7.50 1 -> 75.0
-dqscb086 scaleb -7.50 1 -> -75.0
-dqscb087 scaleb 7.500 1 -> 75.00
-dqscb088 scaleb -7.500 1 -> -75.00
-dqscb091 scaleb 7 2 -> 7E+2
-dqscb092 scaleb -7 2 -> -7E+2
-dqscb093 scaleb 75 2 -> 7.5E+3
-dqscb094 scaleb -75 2 -> -7.5E+3
-dqscb095 scaleb 7.50 2 -> 750
-dqscb096 scaleb -7.50 2 -> -750
-dqscb097 scaleb 7.500 2 -> 750.0
-dqscb098 scaleb -7.500 2 -> -750.0
-
--- zeros
-dqscb111 scaleb 0 1 -> 0E+1
-dqscb112 scaleb -0 2 -> -0E+2
-dqscb113 scaleb 0E+4 3 -> 0E+7
-dqscb114 scaleb -0E+4 4 -> -0E+8
-dqscb115 scaleb 0.0000 5 -> 0E+1
-dqscb116 scaleb -0.0000 6 -> -0E+2
-dqscb117 scaleb 0E-141 7 -> 0E-134
-dqscb118 scaleb -0E-141 8 -> -0E-133
-
--- Nmax, Nmin, Ntiny
-dqscb132 scaleb 9.999999999999999999999999999999999E+6144 +6144 -> Infinity Overflow Inexact Rounded
-dqscb133 scaleb 9.999999999999999999999999999999999E+6144 +10 -> Infinity Overflow Inexact Rounded
-dqscb134 scaleb 9.999999999999999999999999999999999E+6144 +1 -> Infinity Overflow Inexact Rounded
-dqscb135 scaleb 9.999999999999999999999999999999999E+6144 0 -> 9.999999999999999999999999999999999E+6144
-dqscb136 scaleb 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6143
-dqscb137 scaleb 1E-6143 +1 -> 1E-6142
-dqscb1614 scaleb 1E-6143 -0 -> 1E-6143
-dqscb139 scaleb 1E-6143 -1 -> 1E-6144 Subnormal
-dqscb140 scaleb 1.000000000000000000000000000000000E-6143 +1 -> 1.000000000000000000000000000000000E-6142
-dqscb141 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143
-dqscb142 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded
-dqscb143 scaleb 1E-6176 +1 -> 1E-6175 Subnormal
-dqscb144 scaleb 1E-6176 -0 -> 1E-6176 Subnormal
-dqscb145 scaleb 1E-6176 -1 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-
-dqscb150 scaleb -1E-6176 +1 -> -1E-6175 Subnormal
-dqscb151 scaleb -1E-6176 -0 -> -1E-6176 Subnormal
-dqscb152 scaleb -1E-6176 -1 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqscb153 scaleb -1.000000000000000000000000000000000E-6143 +1 -> -1.000000000000000000000000000000000E-6142
-dqscb154 scaleb -1.000000000000000000000000000000000E-6143 +0 -> -1.000000000000000000000000000000000E-6143
-dqscb155 scaleb -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144 Subnormal Rounded
-dqscb156 scaleb -1E-6143 +1 -> -1E-6142
-dqscb157 scaleb -1E-6143 -0 -> -1E-6143
-dqscb158 scaleb -1E-6143 -1 -> -1E-6144 Subnormal
-dqscb159 scaleb -9.999999999999999999999999999999999E+6144 +1 -> -Infinity Overflow Inexact Rounded
-dqscb160 scaleb -9.999999999999999999999999999999999E+6144 +0 -> -9.999999999999999999999999999999999E+6144
-dqscb161 scaleb -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6143
-dqscb162 scaleb -9E+6144 +1 -> -Infinity Overflow Inexact Rounded
-dqscb163 scaleb -1E+6144 +1 -> -Infinity Overflow Inexact Rounded
-
--- some Origami
--- (these check that overflow is being done correctly)
-dqscb171 scaleb 1000E+6109 +1 -> 1.000E+6113
-dqscb172 scaleb 1000E+6110 +1 -> 1.000E+6114
-dqscb173 scaleb 1000E+6111 +1 -> 1.0000E+6115 Clamped
-dqscb174 scaleb 1000E+6112 +1 -> 1.00000E+6116 Clamped
-dqscb175 scaleb 1000E+6113 +1 -> 1.000000E+6117 Clamped
-dqscb176 scaleb 1000E+6114 +1 -> 1.0000000E+6118 Clamped
-dqscb177 scaleb 1000E+6131 +1 -> 1.000000000000000000000000E+6135 Clamped
-dqscb178 scaleb 1000E+6132 +1 -> 1.0000000000000000000000000E+6136 Clamped
-dqscb179 scaleb 1000E+6133 +1 -> 1.00000000000000000000000000E+6137 Clamped
-dqscb180 scaleb 1000E+6134 +1 -> 1.000000000000000000000000000E+6138 Clamped
-dqscb181 scaleb 1000E+6135 +1 -> 1.0000000000000000000000000000E+6139 Clamped
-dqscb182 scaleb 1000E+6136 +1 -> 1.00000000000000000000000000000E+6140 Clamped
-dqscb183 scaleb 1000E+6137 +1 -> 1.000000000000000000000000000000E+6141 Clamped
-dqscb184 scaleb 1000E+6138 +1 -> 1.0000000000000000000000000000000E+6142 Clamped
-dqscb185 scaleb 1000E+6139 +1 -> 1.00000000000000000000000000000000E+6143 Clamped
-dqscb186 scaleb 1000E+6140 +1 -> 1.000000000000000000000000000000000E+6144 Clamped
-dqscb187 scaleb 1000E+6141 +1 -> Infinity Overflow Inexact Rounded
-
--- and a few more subnormal truncations
--- (these check that underflow is being done correctly)
-dqscb221 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143
-dqscb222 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded
-dqscb223 scaleb 1.000000000000000000000000000000000E-6143 -2 -> 1.0000000000000000000000000000000E-6145 Subnormal Rounded
-dqscb224 scaleb 1.000000000000000000000000000000000E-6143 -3 -> 1.000000000000000000000000000000E-6146 Subnormal Rounded
-dqscb225 scaleb 1.000000000000000000000000000000000E-6143 -4 -> 1.00000000000000000000000000000E-6147 Subnormal Rounded
-dqscb226 scaleb 1.000000000000000000000000000000000E-6143 -5 -> 1.0000000000000000000000000000E-6148 Subnormal Rounded
-dqscb227 scaleb 1.000000000000000000000000000000000E-6143 -6 -> 1.000000000000000000000000000E-6149 Subnormal Rounded
-dqscb228 scaleb 1.000000000000000000000000000000000E-6143 -7 -> 1.00000000000000000000000000E-6150 Subnormal Rounded
-dqscb229 scaleb 1.000000000000000000000000000000000E-6143 -8 -> 1.0000000000000000000000000E-6151 Subnormal Rounded
-dqscb230 scaleb 1.000000000000000000000000000000000E-6143 -9 -> 1.000000000000000000000000E-6152 Subnormal Rounded
-dqscb231 scaleb 1.000000000000000000000000000000000E-6143 -10 -> 1.00000000000000000000000E-6153 Subnormal Rounded
-dqscb232 scaleb 1.000000000000000000000000000000000E-6143 -11 -> 1.0000000000000000000000E-6154 Subnormal Rounded
-dqscb233 scaleb 1.000000000000000000000000000000000E-6143 -12 -> 1.000000000000000000000E-6155 Subnormal Rounded
-dqscb234 scaleb 1.000000000000000000000000000000000E-6143 -13 -> 1.00000000000000000000E-6156 Subnormal Rounded
-dqscb235 scaleb 1.000000000000000000000000000000000E-6143 -14 -> 1.0000000000000000000E-6157 Subnormal Rounded
-dqscb236 scaleb 1.000000000000000000000000000000000E-6143 -15 -> 1.000000000000000000E-6158 Subnormal Rounded
-dqscb237 scaleb 1.000000000000000000000000000000000E-6143 -16 -> 1.00000000000000000E-6159 Subnormal Rounded
-dqscb238 scaleb 1.000000000000000000000000000000000E-6143 -17 -> 1.0000000000000000E-6160 Subnormal Rounded
-dqscb239 scaleb 1.000000000000000000000000000000000E-6143 -18 -> 1.000000000000000E-6161 Subnormal Rounded
-dqscb202 scaleb 1.000000000000000000000000000000000E-6143 -19 -> 1.00000000000000E-6162 Subnormal Rounded
-dqscb203 scaleb 1.000000000000000000000000000000000E-6143 -20 -> 1.0000000000000E-6163 Subnormal Rounded
-dqscb204 scaleb 1.000000000000000000000000000000000E-6143 -21 -> 1.000000000000E-6164 Subnormal Rounded
-dqscb205 scaleb 1.000000000000000000000000000000000E-6143 -22 -> 1.00000000000E-6165 Subnormal Rounded
-dqscb206 scaleb 1.000000000000000000000000000000000E-6143 -23 -> 1.0000000000E-6166 Subnormal Rounded
-dqscb207 scaleb 1.000000000000000000000000000000000E-6143 -24 -> 1.000000000E-6167 Subnormal Rounded
-dqscb208 scaleb 1.000000000000000000000000000000000E-6143 -25 -> 1.00000000E-6168 Subnormal Rounded
-dqscb209 scaleb 1.000000000000000000000000000000000E-6143 -26 -> 1.0000000E-6169 Subnormal Rounded
-dqscb210 scaleb 1.000000000000000000000000000000000E-6143 -27 -> 1.000000E-6170 Subnormal Rounded
-dqscb211 scaleb 1.000000000000000000000000000000000E-6143 -28 -> 1.00000E-6171 Subnormal Rounded
-dqscb212 scaleb 1.000000000000000000000000000000000E-6143 -29 -> 1.0000E-6172 Subnormal Rounded
-dqscb213 scaleb 1.000000000000000000000000000000000E-6143 -30 -> 1.000E-6173 Subnormal Rounded
-dqscb214 scaleb 1.000000000000000000000000000000000E-6143 -31 -> 1.00E-6174 Subnormal Rounded
-dqscb215 scaleb 1.000000000000000000000000000000000E-6143 -32 -> 1.0E-6175 Subnormal Rounded
-dqscb216 scaleb 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176 Subnormal Rounded
-dqscb217 scaleb 1.000000000000000000000000000000000E-6143 -34 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
-dqscb218 scaleb 1.000000000000000000000000000000000E-6143 -35 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+------------------------------------------------------------------------
+-- dqScalebB.decTest -- scale a decQuad by powers of 10 --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Max |rhs| is 2*(6144+34) = 12356
+
+-- Sanity checks
+dqscb001 scaleb 7.50 10 -> 7.50E+10
+dqscb002 scaleb 7.50 3 -> 7.50E+3
+dqscb003 scaleb 7.50 2 -> 750
+dqscb004 scaleb 7.50 1 -> 75.0
+dqscb005 scaleb 7.50 0 -> 7.50
+dqscb006 scaleb 7.50 -1 -> 0.750
+dqscb007 scaleb 7.50 -2 -> 0.0750
+dqscb008 scaleb 7.50 -10 -> 7.50E-10
+dqscb009 scaleb -7.50 3 -> -7.50E+3
+dqscb010 scaleb -7.50 2 -> -750
+dqscb011 scaleb -7.50 1 -> -75.0
+dqscb012 scaleb -7.50 0 -> -7.50
+dqscb013 scaleb -7.50 -1 -> -0.750
+
+-- Infinities
+dqscb014 scaleb Infinity 1 -> Infinity
+dqscb015 scaleb -Infinity 2 -> -Infinity
+dqscb016 scaleb Infinity -1 -> Infinity
+dqscb017 scaleb -Infinity -2 -> -Infinity
+
+-- Next two are somewhat undefined in 754r; treat as non-integer
+dqscb018 scaleb 10 Infinity -> NaN Invalid_operation
+dqscb019 scaleb 10 -Infinity -> NaN Invalid_operation
+
+-- NaNs are undefined in 754r; assume usual processing
+-- NaNs, 0 payload
+dqscb021 scaleb NaN 1 -> NaN
+dqscb022 scaleb -NaN -1 -> -NaN
+dqscb023 scaleb sNaN 1 -> NaN Invalid_operation
+dqscb024 scaleb -sNaN 1 -> -NaN Invalid_operation
+dqscb025 scaleb 4 NaN -> NaN
+dqscb026 scaleb -Inf -NaN -> -NaN
+dqscb027 scaleb 4 sNaN -> NaN Invalid_operation
+dqscb028 scaleb Inf -sNaN -> -NaN Invalid_operation
+
+-- non-integer RHS
+dqscb030 scaleb 1.23 1 -> 12.3
+dqscb031 scaleb 1.23 1.00 -> NaN Invalid_operation
+dqscb032 scaleb 1.23 1.1 -> NaN Invalid_operation
+dqscb033 scaleb 1.23 1.01 -> NaN Invalid_operation
+dqscb034 scaleb 1.23 0.01 -> NaN Invalid_operation
+dqscb035 scaleb 1.23 0.11 -> NaN Invalid_operation
+dqscb036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
+dqscb037 scaleb 1.23 -1 -> 0.123
+dqscb0614 scaleb 1.23 -1.00 -> NaN Invalid_operation
+dqscb039 scaleb 1.23 -1.1 -> NaN Invalid_operation
+dqscb040 scaleb 1.23 -1.01 -> NaN Invalid_operation
+dqscb041 scaleb 1.23 -0.01 -> NaN Invalid_operation
+dqscb042 scaleb 1.23 -0.11 -> NaN Invalid_operation
+dqscb043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
+dqscb044 scaleb 1.23 0.1 -> NaN Invalid_operation
+dqscb045 scaleb 1.23 1E+1 -> NaN Invalid_operation
+dqscb046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
+dqscb047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
+
+-- out-of range RHS
+dqscb120 scaleb 1.23 12355 -> Infinity Overflow Inexact Rounded
+dqscb121 scaleb 1.23 12356 -> Infinity Overflow Inexact Rounded
+dqscb122 scaleb 1.23 12357 -> NaN Invalid_operation
+dqscb123 scaleb 1.23 12358 -> NaN Invalid_operation
+dqscb124 scaleb 1.23 -12355 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqscb125 scaleb 1.23 -12356 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqscb126 scaleb 1.23 -12357 -> NaN Invalid_operation
+dqscb127 scaleb 1.23 -12358 -> NaN Invalid_operation
+
+-- NaNs, non-0 payload
+-- propagating NaNs
+dqscb861 scaleb NaN01 -Inf -> NaN1
+dqscb862 scaleb -NaN02 -1000 -> -NaN2
+dqscb863 scaleb NaN03 1000 -> NaN3
+dqscb864 scaleb NaN04 Inf -> NaN4
+dqscb865 scaleb NaN05 NaN61 -> NaN5
+dqscb866 scaleb -Inf -NaN71 -> -NaN71
+dqscb867 scaleb -1000 NaN81 -> NaN81
+dqscb868 scaleb 1000 NaN91 -> NaN91
+dqscb869 scaleb Inf NaN101 -> NaN101
+dqscb871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
+dqscb872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
+dqscb873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
+dqscb874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
+dqscb875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
+dqscb876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
+dqscb877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
+dqscb878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
+dqscb879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
+dqscb880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
+dqscb881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- finites
+dqscb051 scaleb 7 -2 -> 0.07
+dqscb052 scaleb -7 -2 -> -0.07
+dqscb053 scaleb 75 -2 -> 0.75
+dqscb054 scaleb -75 -2 -> -0.75
+dqscb055 scaleb 7.50 -2 -> 0.0750
+dqscb056 scaleb -7.50 -2 -> -0.0750
+dqscb057 scaleb 7.500 -2 -> 0.07500
+dqscb058 scaleb -7.500 -2 -> -0.07500
+dqscb061 scaleb 7 -1 -> 0.7
+dqscb062 scaleb -7 -1 -> -0.7
+dqscb063 scaleb 75 -1 -> 7.5
+dqscb064 scaleb -75 -1 -> -7.5
+dqscb065 scaleb 7.50 -1 -> 0.750
+dqscb066 scaleb -7.50 -1 -> -0.750
+dqscb067 scaleb 7.500 -1 -> 0.7500
+dqscb068 scaleb -7.500 -1 -> -0.7500
+dqscb071 scaleb 7 0 -> 7
+dqscb072 scaleb -7 0 -> -7
+dqscb073 scaleb 75 0 -> 75
+dqscb074 scaleb -75 0 -> -75
+dqscb075 scaleb 7.50 0 -> 7.50
+dqscb076 scaleb -7.50 0 -> -7.50
+dqscb077 scaleb 7.500 0 -> 7.500
+dqscb078 scaleb -7.500 0 -> -7.500
+dqscb081 scaleb 7 1 -> 7E+1
+dqscb082 scaleb -7 1 -> -7E+1
+dqscb083 scaleb 75 1 -> 7.5E+2
+dqscb084 scaleb -75 1 -> -7.5E+2
+dqscb085 scaleb 7.50 1 -> 75.0
+dqscb086 scaleb -7.50 1 -> -75.0
+dqscb087 scaleb 7.500 1 -> 75.00
+dqscb088 scaleb -7.500 1 -> -75.00
+dqscb091 scaleb 7 2 -> 7E+2
+dqscb092 scaleb -7 2 -> -7E+2
+dqscb093 scaleb 75 2 -> 7.5E+3
+dqscb094 scaleb -75 2 -> -7.5E+3
+dqscb095 scaleb 7.50 2 -> 750
+dqscb096 scaleb -7.50 2 -> -750
+dqscb097 scaleb 7.500 2 -> 750.0
+dqscb098 scaleb -7.500 2 -> -750.0
+
+-- zeros
+dqscb111 scaleb 0 1 -> 0E+1
+dqscb112 scaleb -0 2 -> -0E+2
+dqscb113 scaleb 0E+4 3 -> 0E+7
+dqscb114 scaleb -0E+4 4 -> -0E+8
+dqscb115 scaleb 0.0000 5 -> 0E+1
+dqscb116 scaleb -0.0000 6 -> -0E+2
+dqscb117 scaleb 0E-141 7 -> 0E-134
+dqscb118 scaleb -0E-141 8 -> -0E-133
+
+-- Nmax, Nmin, Ntiny
+dqscb132 scaleb 9.999999999999999999999999999999999E+6144 +6144 -> Infinity Overflow Inexact Rounded
+dqscb133 scaleb 9.999999999999999999999999999999999E+6144 +10 -> Infinity Overflow Inexact Rounded
+dqscb134 scaleb 9.999999999999999999999999999999999E+6144 +1 -> Infinity Overflow Inexact Rounded
+dqscb135 scaleb 9.999999999999999999999999999999999E+6144 0 -> 9.999999999999999999999999999999999E+6144
+dqscb136 scaleb 9.999999999999999999999999999999999E+6144 -1 -> 9.999999999999999999999999999999999E+6143
+dqscb137 scaleb 1E-6143 +1 -> 1E-6142
+dqscb1614 scaleb 1E-6143 -0 -> 1E-6143
+dqscb139 scaleb 1E-6143 -1 -> 1E-6144 Subnormal
+dqscb140 scaleb 1.000000000000000000000000000000000E-6143 +1 -> 1.000000000000000000000000000000000E-6142
+dqscb141 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143
+dqscb142 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded
+dqscb143 scaleb 1E-6176 +1 -> 1E-6175 Subnormal
+dqscb144 scaleb 1E-6176 -0 -> 1E-6176 Subnormal
+dqscb145 scaleb 1E-6176 -1 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+
+dqscb150 scaleb -1E-6176 +1 -> -1E-6175 Subnormal
+dqscb151 scaleb -1E-6176 -0 -> -1E-6176 Subnormal
+dqscb152 scaleb -1E-6176 -1 -> -0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqscb153 scaleb -1.000000000000000000000000000000000E-6143 +1 -> -1.000000000000000000000000000000000E-6142
+dqscb154 scaleb -1.000000000000000000000000000000000E-6143 +0 -> -1.000000000000000000000000000000000E-6143
+dqscb155 scaleb -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144 Subnormal Rounded
+dqscb156 scaleb -1E-6143 +1 -> -1E-6142
+dqscb157 scaleb -1E-6143 -0 -> -1E-6143
+dqscb158 scaleb -1E-6143 -1 -> -1E-6144 Subnormal
+dqscb159 scaleb -9.999999999999999999999999999999999E+6144 +1 -> -Infinity Overflow Inexact Rounded
+dqscb160 scaleb -9.999999999999999999999999999999999E+6144 +0 -> -9.999999999999999999999999999999999E+6144
+dqscb161 scaleb -9.999999999999999999999999999999999E+6144 -1 -> -9.999999999999999999999999999999999E+6143
+dqscb162 scaleb -9E+6144 +1 -> -Infinity Overflow Inexact Rounded
+dqscb163 scaleb -1E+6144 +1 -> -Infinity Overflow Inexact Rounded
+
+-- some Origami
+-- (these check that overflow is being done correctly)
+dqscb171 scaleb 1000E+6109 +1 -> 1.000E+6113
+dqscb172 scaleb 1000E+6110 +1 -> 1.000E+6114
+dqscb173 scaleb 1000E+6111 +1 -> 1.0000E+6115 Clamped
+dqscb174 scaleb 1000E+6112 +1 -> 1.00000E+6116 Clamped
+dqscb175 scaleb 1000E+6113 +1 -> 1.000000E+6117 Clamped
+dqscb176 scaleb 1000E+6114 +1 -> 1.0000000E+6118 Clamped
+dqscb177 scaleb 1000E+6131 +1 -> 1.000000000000000000000000E+6135 Clamped
+dqscb178 scaleb 1000E+6132 +1 -> 1.0000000000000000000000000E+6136 Clamped
+dqscb179 scaleb 1000E+6133 +1 -> 1.00000000000000000000000000E+6137 Clamped
+dqscb180 scaleb 1000E+6134 +1 -> 1.000000000000000000000000000E+6138 Clamped
+dqscb181 scaleb 1000E+6135 +1 -> 1.0000000000000000000000000000E+6139 Clamped
+dqscb182 scaleb 1000E+6136 +1 -> 1.00000000000000000000000000000E+6140 Clamped
+dqscb183 scaleb 1000E+6137 +1 -> 1.000000000000000000000000000000E+6141 Clamped
+dqscb184 scaleb 1000E+6138 +1 -> 1.0000000000000000000000000000000E+6142 Clamped
+dqscb185 scaleb 1000E+6139 +1 -> 1.00000000000000000000000000000000E+6143 Clamped
+dqscb186 scaleb 1000E+6140 +1 -> 1.000000000000000000000000000000000E+6144 Clamped
+dqscb187 scaleb 1000E+6141 +1 -> Infinity Overflow Inexact Rounded
+
+-- and a few more subnormal truncations
+-- (these check that underflow is being done correctly)
+dqscb221 scaleb 1.000000000000000000000000000000000E-6143 0 -> 1.000000000000000000000000000000000E-6143
+dqscb222 scaleb 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144 Subnormal Rounded
+dqscb223 scaleb 1.000000000000000000000000000000000E-6143 -2 -> 1.0000000000000000000000000000000E-6145 Subnormal Rounded
+dqscb224 scaleb 1.000000000000000000000000000000000E-6143 -3 -> 1.000000000000000000000000000000E-6146 Subnormal Rounded
+dqscb225 scaleb 1.000000000000000000000000000000000E-6143 -4 -> 1.00000000000000000000000000000E-6147 Subnormal Rounded
+dqscb226 scaleb 1.000000000000000000000000000000000E-6143 -5 -> 1.0000000000000000000000000000E-6148 Subnormal Rounded
+dqscb227 scaleb 1.000000000000000000000000000000000E-6143 -6 -> 1.000000000000000000000000000E-6149 Subnormal Rounded
+dqscb228 scaleb 1.000000000000000000000000000000000E-6143 -7 -> 1.00000000000000000000000000E-6150 Subnormal Rounded
+dqscb229 scaleb 1.000000000000000000000000000000000E-6143 -8 -> 1.0000000000000000000000000E-6151 Subnormal Rounded
+dqscb230 scaleb 1.000000000000000000000000000000000E-6143 -9 -> 1.000000000000000000000000E-6152 Subnormal Rounded
+dqscb231 scaleb 1.000000000000000000000000000000000E-6143 -10 -> 1.00000000000000000000000E-6153 Subnormal Rounded
+dqscb232 scaleb 1.000000000000000000000000000000000E-6143 -11 -> 1.0000000000000000000000E-6154 Subnormal Rounded
+dqscb233 scaleb 1.000000000000000000000000000000000E-6143 -12 -> 1.000000000000000000000E-6155 Subnormal Rounded
+dqscb234 scaleb 1.000000000000000000000000000000000E-6143 -13 -> 1.00000000000000000000E-6156 Subnormal Rounded
+dqscb235 scaleb 1.000000000000000000000000000000000E-6143 -14 -> 1.0000000000000000000E-6157 Subnormal Rounded
+dqscb236 scaleb 1.000000000000000000000000000000000E-6143 -15 -> 1.000000000000000000E-6158 Subnormal Rounded
+dqscb237 scaleb 1.000000000000000000000000000000000E-6143 -16 -> 1.00000000000000000E-6159 Subnormal Rounded
+dqscb238 scaleb 1.000000000000000000000000000000000E-6143 -17 -> 1.0000000000000000E-6160 Subnormal Rounded
+dqscb239 scaleb 1.000000000000000000000000000000000E-6143 -18 -> 1.000000000000000E-6161 Subnormal Rounded
+dqscb202 scaleb 1.000000000000000000000000000000000E-6143 -19 -> 1.00000000000000E-6162 Subnormal Rounded
+dqscb203 scaleb 1.000000000000000000000000000000000E-6143 -20 -> 1.0000000000000E-6163 Subnormal Rounded
+dqscb204 scaleb 1.000000000000000000000000000000000E-6143 -21 -> 1.000000000000E-6164 Subnormal Rounded
+dqscb205 scaleb 1.000000000000000000000000000000000E-6143 -22 -> 1.00000000000E-6165 Subnormal Rounded
+dqscb206 scaleb 1.000000000000000000000000000000000E-6143 -23 -> 1.0000000000E-6166 Subnormal Rounded
+dqscb207 scaleb 1.000000000000000000000000000000000E-6143 -24 -> 1.000000000E-6167 Subnormal Rounded
+dqscb208 scaleb 1.000000000000000000000000000000000E-6143 -25 -> 1.00000000E-6168 Subnormal Rounded
+dqscb209 scaleb 1.000000000000000000000000000000000E-6143 -26 -> 1.0000000E-6169 Subnormal Rounded
+dqscb210 scaleb 1.000000000000000000000000000000000E-6143 -27 -> 1.000000E-6170 Subnormal Rounded
+dqscb211 scaleb 1.000000000000000000000000000000000E-6143 -28 -> 1.00000E-6171 Subnormal Rounded
+dqscb212 scaleb 1.000000000000000000000000000000000E-6143 -29 -> 1.0000E-6172 Subnormal Rounded
+dqscb213 scaleb 1.000000000000000000000000000000000E-6143 -30 -> 1.000E-6173 Subnormal Rounded
+dqscb214 scaleb 1.000000000000000000000000000000000E-6143 -31 -> 1.00E-6174 Subnormal Rounded
+dqscb215 scaleb 1.000000000000000000000000000000000E-6143 -32 -> 1.0E-6175 Subnormal Rounded
+dqscb216 scaleb 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176 Subnormal Rounded
+dqscb217 scaleb 1.000000000000000000000000000000000E-6143 -34 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
+dqscb218 scaleb 1.000000000000000000000000000000000E-6143 -35 -> 0E-6176 Underflow Subnormal Inexact Rounded Clamped
diff --git a/Lib/test/decimaltestdata/dqShift.decTest b/Lib/test/decimaltestdata/dqShift.decTest
index 4ee836eb48..6d69213455 100644
--- a/Lib/test/decimaltestdata/dqShift.decTest
+++ b/Lib/test/decimaltestdata/dqShift.decTest
@@ -1,298 +1,298 @@
-------------------------------------------------------------------------
--- dqShift.decTest -- shift decQuad coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check
-dqshi001 shift 0 0 -> 0
-dqshi002 shift 0 2 -> 0
-dqshi003 shift 1 2 -> 100
-dqshi004 shift 1 33 -> 1000000000000000000000000000000000
-dqshi005 shift 1 34 -> 0
-dqshi006 shift 1 -1 -> 0
-dqshi007 shift 0 -2 -> 0
-dqshi008 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123
-dqshi009 shift 1234567890123456789012345678901234 -33 -> 1
-dqshi010 shift 1234567890123456789012345678901234 -34 -> 0
-dqshi011 shift 9934567890123456789012345678901234 -33 -> 9
-dqshi012 shift 9934567890123456789012345678901234 -34 -> 0
-
--- rhs must be an integer
-dqshi015 shift 1 1.5 -> NaN Invalid_operation
-dqshi016 shift 1 1.0 -> NaN Invalid_operation
-dqshi017 shift 1 0.1 -> NaN Invalid_operation
-dqshi018 shift 1 0.0 -> NaN Invalid_operation
-dqshi019 shift 1 1E+1 -> NaN Invalid_operation
-dqshi020 shift 1 1E+99 -> NaN Invalid_operation
-dqshi021 shift 1 Inf -> NaN Invalid_operation
-dqshi022 shift 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-dqshi025 shift 1 -1000 -> NaN Invalid_operation
-dqshi026 shift 1 -35 -> NaN Invalid_operation
-dqshi027 shift 1 35 -> NaN Invalid_operation
-dqshi028 shift 1 1000 -> NaN Invalid_operation
-
--- full shifting pattern
-dqshi030 shift 1234567890123456789012345678901234 -34 -> 0
-dqshi031 shift 1234567890123456789012345678901234 -33 -> 1
-dqshi032 shift 1234567890123456789012345678901234 -32 -> 12
-dqshi033 shift 1234567890123456789012345678901234 -31 -> 123
-dqshi034 shift 1234567890123456789012345678901234 -30 -> 1234
-dqshi035 shift 1234567890123456789012345678901234 -29 -> 12345
-dqshi036 shift 1234567890123456789012345678901234 -28 -> 123456
-dqshi037 shift 1234567890123456789012345678901234 -27 -> 1234567
-dqshi038 shift 1234567890123456789012345678901234 -26 -> 12345678
-dqshi039 shift 1234567890123456789012345678901234 -25 -> 123456789
-dqshi040 shift 1234567890123456789012345678901234 -24 -> 1234567890
-dqshi041 shift 1234567890123456789012345678901234 -23 -> 12345678901
-dqshi042 shift 1234567890123456789012345678901234 -22 -> 123456789012
-dqshi043 shift 1234567890123456789012345678901234 -21 -> 1234567890123
-dqshi044 shift 1234567890123456789012345678901234 -20 -> 12345678901234
-dqshi045 shift 1234567890123456789012345678901234 -19 -> 123456789012345
-dqshi047 shift 1234567890123456789012345678901234 -18 -> 1234567890123456
-dqshi048 shift 1234567890123456789012345678901234 -17 -> 12345678901234567
-dqshi049 shift 1234567890123456789012345678901234 -16 -> 123456789012345678
-dqshi050 shift 1234567890123456789012345678901234 -15 -> 1234567890123456789
-dqshi051 shift 1234567890123456789012345678901234 -14 -> 12345678901234567890
-dqshi052 shift 1234567890123456789012345678901234 -13 -> 123456789012345678901
-dqshi053 shift 1234567890123456789012345678901234 -12 -> 1234567890123456789012
-dqshi054 shift 1234567890123456789012345678901234 -11 -> 12345678901234567890123
-dqshi055 shift 1234567890123456789012345678901234 -10 -> 123456789012345678901234
-dqshi056 shift 1234567890123456789012345678901234 -9 -> 1234567890123456789012345
-dqshi057 shift 1234567890123456789012345678901234 -8 -> 12345678901234567890123456
-dqshi058 shift 1234567890123456789012345678901234 -7 -> 123456789012345678901234567
-dqshi059 shift 1234567890123456789012345678901234 -6 -> 1234567890123456789012345678
-dqshi060 shift 1234567890123456789012345678901234 -5 -> 12345678901234567890123456789
-dqshi061 shift 1234567890123456789012345678901234 -4 -> 123456789012345678901234567890
-dqshi062 shift 1234567890123456789012345678901234 -3 -> 1234567890123456789012345678901
-dqshi063 shift 1234567890123456789012345678901234 -2 -> 12345678901234567890123456789012
-dqshi064 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123
-dqshi065 shift 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234
-
-dqshi066 shift 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234
-dqshi067 shift 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012340
-dqshi068 shift 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123400
-dqshi069 shift 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234000
-dqshi070 shift 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012340000
-dqshi071 shift 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123400000
-dqshi072 shift 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234000000
-dqshi073 shift 1234567890123456789012345678901234 +7 -> 8901234567890123456789012340000000
-dqshi074 shift 1234567890123456789012345678901234 +8 -> 9012345678901234567890123400000000
-dqshi075 shift 1234567890123456789012345678901234 +9 -> 123456789012345678901234000000000
-dqshi076 shift 1234567890123456789012345678901234 +10 -> 1234567890123456789012340000000000
-dqshi077 shift 1234567890123456789012345678901234 +11 -> 2345678901234567890123400000000000
-dqshi078 shift 1234567890123456789012345678901234 +12 -> 3456789012345678901234000000000000
-dqshi079 shift 1234567890123456789012345678901234 +13 -> 4567890123456789012340000000000000
-dqshi080 shift 1234567890123456789012345678901234 +14 -> 5678901234567890123400000000000000
-dqshi081 shift 1234567890123456789012345678901234 +15 -> 6789012345678901234000000000000000
-dqshi082 shift 1234567890123456789012345678901234 +16 -> 7890123456789012340000000000000000
-dqshi083 shift 1234567890123456789012345678901234 +17 -> 8901234567890123400000000000000000
-dqshi084 shift 1234567890123456789012345678901234 +18 -> 9012345678901234000000000000000000
-dqshi085 shift 1234567890123456789012345678901234 +19 -> 123456789012340000000000000000000
-dqshi086 shift 1234567890123456789012345678901234 +20 -> 1234567890123400000000000000000000
-dqshi087 shift 1234567890123456789012345678901234 +21 -> 2345678901234000000000000000000000
-dqshi088 shift 1234567890123456789012345678901234 +22 -> 3456789012340000000000000000000000
-dqshi089 shift 1234567890123456789012345678901234 +23 -> 4567890123400000000000000000000000
-dqshi090 shift 1234567890123456789012345678901234 +24 -> 5678901234000000000000000000000000
-dqshi091 shift 1234567890123456789012345678901234 +25 -> 6789012340000000000000000000000000
-dqshi092 shift 1234567890123456789012345678901234 +26 -> 7890123400000000000000000000000000
-dqshi093 shift 1234567890123456789012345678901234 +27 -> 8901234000000000000000000000000000
-dqshi094 shift 1234567890123456789012345678901234 +28 -> 9012340000000000000000000000000000
-dqshi095 shift 1234567890123456789012345678901234 +29 -> 123400000000000000000000000000000
-dqshi096 shift 1234567890123456789012345678901234 +30 -> 1234000000000000000000000000000000
-dqshi097 shift 1234567890123456789012345678901234 +31 -> 2340000000000000000000000000000000
-dqshi098 shift 1234567890123456789012345678901234 +32 -> 3400000000000000000000000000000000
-dqshi099 shift 1234567890123456789012345678901234 +33 -> 4000000000000000000000000000000000
-dqshi100 shift 1234567890123456789012345678901234 +34 -> 0
-
--- zeros
-dqshi270 shift 0E-10 +29 -> 0E-10
-dqshi271 shift 0E-10 -29 -> 0E-10
-dqshi272 shift 0.000 +29 -> 0.000
-dqshi273 shift 0.000 -29 -> 0.000
-dqshi274 shift 0E+10 +29 -> 0E+10
-dqshi275 shift 0E+10 -29 -> 0E+10
-dqshi276 shift -0E-10 +29 -> -0E-10
-dqshi277 shift -0E-10 -29 -> -0E-10
-dqshi278 shift -0.000 +29 -> -0.000
-dqshi279 shift -0.000 -29 -> -0.000
-dqshi280 shift -0E+10 +29 -> -0E+10
-dqshi281 shift -0E+10 -29 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-dqshi141 shift 9.999999999999999999999999999999999E+6144 -1 -> 9.99999999999999999999999999999999E+6143
-dqshi142 shift 9.999999999999999999999999999999999E+6144 -33 -> 9E+6111
-dqshi143 shift 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999990E+6144
-dqshi144 shift 9.999999999999999999999999999999999E+6144 33 -> 9.000000000000000000000000000000000E+6144
-dqshi145 shift 1E-6143 -1 -> 0E-6143
-dqshi146 shift 1E-6143 -33 -> 0E-6143
-dqshi147 shift 1E-6143 1 -> 1.0E-6142
-dqshi148 shift 1E-6143 33 -> 1.000000000000000000000000000000000E-6110
-dqshi151 shift 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144
-dqshi152 shift 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176
-dqshi153 shift 1.000000000000000000000000000000000E-6143 1 -> 0E-6176
-dqshi154 shift 1.000000000000000000000000000000000E-6143 33 -> 0E-6176
-dqshi155 shift 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144
-dqshi156 shift 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176
-dqshi157 shift 9.000000000000000000000000000000000E-6143 1 -> 0E-6176
-dqshi158 shift 9.000000000000000000000000000000000E-6143 33 -> 0E-6176
-dqshi160 shift 1E-6176 -1 -> 0E-6176
-dqshi161 shift 1E-6176 -33 -> 0E-6176
-dqshi162 shift 1E-6176 1 -> 1.0E-6175
-dqshi163 shift 1E-6176 33 -> 1.000000000000000000000000000000000E-6143
--- negatives
-dqshi171 shift -9.999999999999999999999999999999999E+6144 -1 -> -9.99999999999999999999999999999999E+6143
-dqshi172 shift -9.999999999999999999999999999999999E+6144 -33 -> -9E+6111
-dqshi173 shift -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999990E+6144
-dqshi174 shift -9.999999999999999999999999999999999E+6144 33 -> -9.000000000000000000000000000000000E+6144
-dqshi175 shift -1E-6143 -1 -> -0E-6143
-dqshi176 shift -1E-6143 -33 -> -0E-6143
-dqshi177 shift -1E-6143 1 -> -1.0E-6142
-dqshi178 shift -1E-6143 33 -> -1.000000000000000000000000000000000E-6110
-dqshi181 shift -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144
-dqshi182 shift -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176
-dqshi183 shift -1.000000000000000000000000000000000E-6143 1 -> -0E-6176
-dqshi184 shift -1.000000000000000000000000000000000E-6143 33 -> -0E-6176
-dqshi185 shift -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144
-dqshi186 shift -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176
-dqshi187 shift -9.000000000000000000000000000000000E-6143 1 -> -0E-6176
-dqshi188 shift -9.000000000000000000000000000000000E-6143 33 -> -0E-6176
-dqshi190 shift -1E-6176 -1 -> -0E-6176
-dqshi191 shift -1E-6176 -33 -> -0E-6176
-dqshi192 shift -1E-6176 1 -> -1.0E-6175
-dqshi193 shift -1E-6176 33 -> -1.000000000000000000000000000000000E-6143
-
--- more negatives (of sanities)
-dqshi201 shift -0 0 -> -0
-dqshi202 shift -0 2 -> -0
-dqshi203 shift -1 2 -> -100
-dqshi204 shift -1 33 -> -1000000000000000000000000000000000
-dqshi205 shift -1 34 -> -0
-dqshi206 shift -1 -1 -> -0
-dqshi207 shift -0 -2 -> -0
-dqshi208 shift -1234567890123456789012345678901234 -1 -> -123456789012345678901234567890123
-dqshi209 shift -1234567890123456789012345678901234 -33 -> -1
-dqshi210 shift -1234567890123456789012345678901234 -34 -> -0
-dqshi211 shift -9934567890123456789012345678901234 -33 -> -9
-dqshi212 shift -9934567890123456789012345678901234 -34 -> -0
-
-
--- Specials; NaNs are handled as usual
-dqshi781 shift -Inf -8 -> -Infinity
-dqshi782 shift -Inf -1 -> -Infinity
-dqshi783 shift -Inf -0 -> -Infinity
-dqshi784 shift -Inf 0 -> -Infinity
-dqshi785 shift -Inf 1 -> -Infinity
-dqshi786 shift -Inf 8 -> -Infinity
-dqshi787 shift -1000 -Inf -> NaN Invalid_operation
-dqshi788 shift -Inf -Inf -> NaN Invalid_operation
-dqshi789 shift -1 -Inf -> NaN Invalid_operation
-dqshi790 shift -0 -Inf -> NaN Invalid_operation
-dqshi791 shift 0 -Inf -> NaN Invalid_operation
-dqshi792 shift 1 -Inf -> NaN Invalid_operation
-dqshi793 shift 1000 -Inf -> NaN Invalid_operation
-dqshi794 shift Inf -Inf -> NaN Invalid_operation
-
-dqshi800 shift Inf -Inf -> NaN Invalid_operation
-dqshi801 shift Inf -8 -> Infinity
-dqshi802 shift Inf -1 -> Infinity
-dqshi803 shift Inf -0 -> Infinity
-dqshi804 shift Inf 0 -> Infinity
-dqshi805 shift Inf 1 -> Infinity
-dqshi806 shift Inf 8 -> Infinity
-dqshi807 shift Inf Inf -> NaN Invalid_operation
-dqshi808 shift -1000 Inf -> NaN Invalid_operation
-dqshi809 shift -Inf Inf -> NaN Invalid_operation
-dqshi810 shift -1 Inf -> NaN Invalid_operation
-dqshi811 shift -0 Inf -> NaN Invalid_operation
-dqshi812 shift 0 Inf -> NaN Invalid_operation
-dqshi813 shift 1 Inf -> NaN Invalid_operation
-dqshi814 shift 1000 Inf -> NaN Invalid_operation
-dqshi815 shift Inf Inf -> NaN Invalid_operation
-
-dqshi821 shift NaN -Inf -> NaN
-dqshi822 shift NaN -1000 -> NaN
-dqshi823 shift NaN -1 -> NaN
-dqshi824 shift NaN -0 -> NaN
-dqshi825 shift NaN 0 -> NaN
-dqshi826 shift NaN 1 -> NaN
-dqshi827 shift NaN 1000 -> NaN
-dqshi828 shift NaN Inf -> NaN
-dqshi829 shift NaN NaN -> NaN
-dqshi830 shift -Inf NaN -> NaN
-dqshi831 shift -1000 NaN -> NaN
-dqshi832 shift -1 NaN -> NaN
-dqshi833 shift -0 NaN -> NaN
-dqshi834 shift 0 NaN -> NaN
-dqshi835 shift 1 NaN -> NaN
-dqshi836 shift 1000 NaN -> NaN
-dqshi837 shift Inf NaN -> NaN
-
-dqshi841 shift sNaN -Inf -> NaN Invalid_operation
-dqshi842 shift sNaN -1000 -> NaN Invalid_operation
-dqshi843 shift sNaN -1 -> NaN Invalid_operation
-dqshi844 shift sNaN -0 -> NaN Invalid_operation
-dqshi845 shift sNaN 0 -> NaN Invalid_operation
-dqshi846 shift sNaN 1 -> NaN Invalid_operation
-dqshi847 shift sNaN 1000 -> NaN Invalid_operation
-dqshi848 shift sNaN NaN -> NaN Invalid_operation
-dqshi849 shift sNaN sNaN -> NaN Invalid_operation
-dqshi850 shift NaN sNaN -> NaN Invalid_operation
-dqshi851 shift -Inf sNaN -> NaN Invalid_operation
-dqshi852 shift -1000 sNaN -> NaN Invalid_operation
-dqshi853 shift -1 sNaN -> NaN Invalid_operation
-dqshi854 shift -0 sNaN -> NaN Invalid_operation
-dqshi855 shift 0 sNaN -> NaN Invalid_operation
-dqshi856 shift 1 sNaN -> NaN Invalid_operation
-dqshi857 shift 1000 sNaN -> NaN Invalid_operation
-dqshi858 shift Inf sNaN -> NaN Invalid_operation
-dqshi859 shift NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqshi861 shift NaN1 -Inf -> NaN1
-dqshi862 shift +NaN2 -1000 -> NaN2
-dqshi863 shift NaN3 1000 -> NaN3
-dqshi864 shift NaN4 Inf -> NaN4
-dqshi865 shift NaN5 +NaN6 -> NaN5
-dqshi866 shift -Inf NaN7 -> NaN7
-dqshi867 shift -1000 NaN8 -> NaN8
-dqshi868 shift 1000 NaN9 -> NaN9
-dqshi869 shift Inf +NaN10 -> NaN10
-dqshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation
-dqshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation
-dqshi873 shift sNaN13 1000 -> NaN13 Invalid_operation
-dqshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
-dqshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
-dqshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
-dqshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
-dqshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation
-dqshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation
-dqshi880 shift Inf sNaN23 -> NaN23 Invalid_operation
-dqshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
-dqshi882 shift -NaN26 NaN28 -> -NaN26
-dqshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-dqshi884 shift 1000 -NaN30 -> -NaN30
-dqshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- dqShift.decTest -- shift decQuad coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check
+dqshi001 shift 0 0 -> 0
+dqshi002 shift 0 2 -> 0
+dqshi003 shift 1 2 -> 100
+dqshi004 shift 1 33 -> 1000000000000000000000000000000000
+dqshi005 shift 1 34 -> 0
+dqshi006 shift 1 -1 -> 0
+dqshi007 shift 0 -2 -> 0
+dqshi008 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123
+dqshi009 shift 1234567890123456789012345678901234 -33 -> 1
+dqshi010 shift 1234567890123456789012345678901234 -34 -> 0
+dqshi011 shift 9934567890123456789012345678901234 -33 -> 9
+dqshi012 shift 9934567890123456789012345678901234 -34 -> 0
+
+-- rhs must be an integer
+dqshi015 shift 1 1.5 -> NaN Invalid_operation
+dqshi016 shift 1 1.0 -> NaN Invalid_operation
+dqshi017 shift 1 0.1 -> NaN Invalid_operation
+dqshi018 shift 1 0.0 -> NaN Invalid_operation
+dqshi019 shift 1 1E+1 -> NaN Invalid_operation
+dqshi020 shift 1 1E+99 -> NaN Invalid_operation
+dqshi021 shift 1 Inf -> NaN Invalid_operation
+dqshi022 shift 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+dqshi025 shift 1 -1000 -> NaN Invalid_operation
+dqshi026 shift 1 -35 -> NaN Invalid_operation
+dqshi027 shift 1 35 -> NaN Invalid_operation
+dqshi028 shift 1 1000 -> NaN Invalid_operation
+
+-- full shifting pattern
+dqshi030 shift 1234567890123456789012345678901234 -34 -> 0
+dqshi031 shift 1234567890123456789012345678901234 -33 -> 1
+dqshi032 shift 1234567890123456789012345678901234 -32 -> 12
+dqshi033 shift 1234567890123456789012345678901234 -31 -> 123
+dqshi034 shift 1234567890123456789012345678901234 -30 -> 1234
+dqshi035 shift 1234567890123456789012345678901234 -29 -> 12345
+dqshi036 shift 1234567890123456789012345678901234 -28 -> 123456
+dqshi037 shift 1234567890123456789012345678901234 -27 -> 1234567
+dqshi038 shift 1234567890123456789012345678901234 -26 -> 12345678
+dqshi039 shift 1234567890123456789012345678901234 -25 -> 123456789
+dqshi040 shift 1234567890123456789012345678901234 -24 -> 1234567890
+dqshi041 shift 1234567890123456789012345678901234 -23 -> 12345678901
+dqshi042 shift 1234567890123456789012345678901234 -22 -> 123456789012
+dqshi043 shift 1234567890123456789012345678901234 -21 -> 1234567890123
+dqshi044 shift 1234567890123456789012345678901234 -20 -> 12345678901234
+dqshi045 shift 1234567890123456789012345678901234 -19 -> 123456789012345
+dqshi047 shift 1234567890123456789012345678901234 -18 -> 1234567890123456
+dqshi048 shift 1234567890123456789012345678901234 -17 -> 12345678901234567
+dqshi049 shift 1234567890123456789012345678901234 -16 -> 123456789012345678
+dqshi050 shift 1234567890123456789012345678901234 -15 -> 1234567890123456789
+dqshi051 shift 1234567890123456789012345678901234 -14 -> 12345678901234567890
+dqshi052 shift 1234567890123456789012345678901234 -13 -> 123456789012345678901
+dqshi053 shift 1234567890123456789012345678901234 -12 -> 1234567890123456789012
+dqshi054 shift 1234567890123456789012345678901234 -11 -> 12345678901234567890123
+dqshi055 shift 1234567890123456789012345678901234 -10 -> 123456789012345678901234
+dqshi056 shift 1234567890123456789012345678901234 -9 -> 1234567890123456789012345
+dqshi057 shift 1234567890123456789012345678901234 -8 -> 12345678901234567890123456
+dqshi058 shift 1234567890123456789012345678901234 -7 -> 123456789012345678901234567
+dqshi059 shift 1234567890123456789012345678901234 -6 -> 1234567890123456789012345678
+dqshi060 shift 1234567890123456789012345678901234 -5 -> 12345678901234567890123456789
+dqshi061 shift 1234567890123456789012345678901234 -4 -> 123456789012345678901234567890
+dqshi062 shift 1234567890123456789012345678901234 -3 -> 1234567890123456789012345678901
+dqshi063 shift 1234567890123456789012345678901234 -2 -> 12345678901234567890123456789012
+dqshi064 shift 1234567890123456789012345678901234 -1 -> 123456789012345678901234567890123
+dqshi065 shift 1234567890123456789012345678901234 -0 -> 1234567890123456789012345678901234
+
+dqshi066 shift 1234567890123456789012345678901234 +0 -> 1234567890123456789012345678901234
+dqshi067 shift 1234567890123456789012345678901234 +1 -> 2345678901234567890123456789012340
+dqshi068 shift 1234567890123456789012345678901234 +2 -> 3456789012345678901234567890123400
+dqshi069 shift 1234567890123456789012345678901234 +3 -> 4567890123456789012345678901234000
+dqshi070 shift 1234567890123456789012345678901234 +4 -> 5678901234567890123456789012340000
+dqshi071 shift 1234567890123456789012345678901234 +5 -> 6789012345678901234567890123400000
+dqshi072 shift 1234567890123456789012345678901234 +6 -> 7890123456789012345678901234000000
+dqshi073 shift 1234567890123456789012345678901234 +7 -> 8901234567890123456789012340000000
+dqshi074 shift 1234567890123456789012345678901234 +8 -> 9012345678901234567890123400000000
+dqshi075 shift 1234567890123456789012345678901234 +9 -> 123456789012345678901234000000000
+dqshi076 shift 1234567890123456789012345678901234 +10 -> 1234567890123456789012340000000000
+dqshi077 shift 1234567890123456789012345678901234 +11 -> 2345678901234567890123400000000000
+dqshi078 shift 1234567890123456789012345678901234 +12 -> 3456789012345678901234000000000000
+dqshi079 shift 1234567890123456789012345678901234 +13 -> 4567890123456789012340000000000000
+dqshi080 shift 1234567890123456789012345678901234 +14 -> 5678901234567890123400000000000000
+dqshi081 shift 1234567890123456789012345678901234 +15 -> 6789012345678901234000000000000000
+dqshi082 shift 1234567890123456789012345678901234 +16 -> 7890123456789012340000000000000000
+dqshi083 shift 1234567890123456789012345678901234 +17 -> 8901234567890123400000000000000000
+dqshi084 shift 1234567890123456789012345678901234 +18 -> 9012345678901234000000000000000000
+dqshi085 shift 1234567890123456789012345678901234 +19 -> 123456789012340000000000000000000
+dqshi086 shift 1234567890123456789012345678901234 +20 -> 1234567890123400000000000000000000
+dqshi087 shift 1234567890123456789012345678901234 +21 -> 2345678901234000000000000000000000
+dqshi088 shift 1234567890123456789012345678901234 +22 -> 3456789012340000000000000000000000
+dqshi089 shift 1234567890123456789012345678901234 +23 -> 4567890123400000000000000000000000
+dqshi090 shift 1234567890123456789012345678901234 +24 -> 5678901234000000000000000000000000
+dqshi091 shift 1234567890123456789012345678901234 +25 -> 6789012340000000000000000000000000
+dqshi092 shift 1234567890123456789012345678901234 +26 -> 7890123400000000000000000000000000
+dqshi093 shift 1234567890123456789012345678901234 +27 -> 8901234000000000000000000000000000
+dqshi094 shift 1234567890123456789012345678901234 +28 -> 9012340000000000000000000000000000
+dqshi095 shift 1234567890123456789012345678901234 +29 -> 123400000000000000000000000000000
+dqshi096 shift 1234567890123456789012345678901234 +30 -> 1234000000000000000000000000000000
+dqshi097 shift 1234567890123456789012345678901234 +31 -> 2340000000000000000000000000000000
+dqshi098 shift 1234567890123456789012345678901234 +32 -> 3400000000000000000000000000000000
+dqshi099 shift 1234567890123456789012345678901234 +33 -> 4000000000000000000000000000000000
+dqshi100 shift 1234567890123456789012345678901234 +34 -> 0
+
+-- zeros
+dqshi270 shift 0E-10 +29 -> 0E-10
+dqshi271 shift 0E-10 -29 -> 0E-10
+dqshi272 shift 0.000 +29 -> 0.000
+dqshi273 shift 0.000 -29 -> 0.000
+dqshi274 shift 0E+10 +29 -> 0E+10
+dqshi275 shift 0E+10 -29 -> 0E+10
+dqshi276 shift -0E-10 +29 -> -0E-10
+dqshi277 shift -0E-10 -29 -> -0E-10
+dqshi278 shift -0.000 +29 -> -0.000
+dqshi279 shift -0.000 -29 -> -0.000
+dqshi280 shift -0E+10 +29 -> -0E+10
+dqshi281 shift -0E+10 -29 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+dqshi141 shift 9.999999999999999999999999999999999E+6144 -1 -> 9.99999999999999999999999999999999E+6143
+dqshi142 shift 9.999999999999999999999999999999999E+6144 -33 -> 9E+6111
+dqshi143 shift 9.999999999999999999999999999999999E+6144 1 -> 9.999999999999999999999999999999990E+6144
+dqshi144 shift 9.999999999999999999999999999999999E+6144 33 -> 9.000000000000000000000000000000000E+6144
+dqshi145 shift 1E-6143 -1 -> 0E-6143
+dqshi146 shift 1E-6143 -33 -> 0E-6143
+dqshi147 shift 1E-6143 1 -> 1.0E-6142
+dqshi148 shift 1E-6143 33 -> 1.000000000000000000000000000000000E-6110
+dqshi151 shift 1.000000000000000000000000000000000E-6143 -1 -> 1.00000000000000000000000000000000E-6144
+dqshi152 shift 1.000000000000000000000000000000000E-6143 -33 -> 1E-6176
+dqshi153 shift 1.000000000000000000000000000000000E-6143 1 -> 0E-6176
+dqshi154 shift 1.000000000000000000000000000000000E-6143 33 -> 0E-6176
+dqshi155 shift 9.000000000000000000000000000000000E-6143 -1 -> 9.00000000000000000000000000000000E-6144
+dqshi156 shift 9.000000000000000000000000000000000E-6143 -33 -> 9E-6176
+dqshi157 shift 9.000000000000000000000000000000000E-6143 1 -> 0E-6176
+dqshi158 shift 9.000000000000000000000000000000000E-6143 33 -> 0E-6176
+dqshi160 shift 1E-6176 -1 -> 0E-6176
+dqshi161 shift 1E-6176 -33 -> 0E-6176
+dqshi162 shift 1E-6176 1 -> 1.0E-6175
+dqshi163 shift 1E-6176 33 -> 1.000000000000000000000000000000000E-6143
+-- negatives
+dqshi171 shift -9.999999999999999999999999999999999E+6144 -1 -> -9.99999999999999999999999999999999E+6143
+dqshi172 shift -9.999999999999999999999999999999999E+6144 -33 -> -9E+6111
+dqshi173 shift -9.999999999999999999999999999999999E+6144 1 -> -9.999999999999999999999999999999990E+6144
+dqshi174 shift -9.999999999999999999999999999999999E+6144 33 -> -9.000000000000000000000000000000000E+6144
+dqshi175 shift -1E-6143 -1 -> -0E-6143
+dqshi176 shift -1E-6143 -33 -> -0E-6143
+dqshi177 shift -1E-6143 1 -> -1.0E-6142
+dqshi178 shift -1E-6143 33 -> -1.000000000000000000000000000000000E-6110
+dqshi181 shift -1.000000000000000000000000000000000E-6143 -1 -> -1.00000000000000000000000000000000E-6144
+dqshi182 shift -1.000000000000000000000000000000000E-6143 -33 -> -1E-6176
+dqshi183 shift -1.000000000000000000000000000000000E-6143 1 -> -0E-6176
+dqshi184 shift -1.000000000000000000000000000000000E-6143 33 -> -0E-6176
+dqshi185 shift -9.000000000000000000000000000000000E-6143 -1 -> -9.00000000000000000000000000000000E-6144
+dqshi186 shift -9.000000000000000000000000000000000E-6143 -33 -> -9E-6176
+dqshi187 shift -9.000000000000000000000000000000000E-6143 1 -> -0E-6176
+dqshi188 shift -9.000000000000000000000000000000000E-6143 33 -> -0E-6176
+dqshi190 shift -1E-6176 -1 -> -0E-6176
+dqshi191 shift -1E-6176 -33 -> -0E-6176
+dqshi192 shift -1E-6176 1 -> -1.0E-6175
+dqshi193 shift -1E-6176 33 -> -1.000000000000000000000000000000000E-6143
+
+-- more negatives (of sanities)
+dqshi201 shift -0 0 -> -0
+dqshi202 shift -0 2 -> -0
+dqshi203 shift -1 2 -> -100
+dqshi204 shift -1 33 -> -1000000000000000000000000000000000
+dqshi205 shift -1 34 -> -0
+dqshi206 shift -1 -1 -> -0
+dqshi207 shift -0 -2 -> -0
+dqshi208 shift -1234567890123456789012345678901234 -1 -> -123456789012345678901234567890123
+dqshi209 shift -1234567890123456789012345678901234 -33 -> -1
+dqshi210 shift -1234567890123456789012345678901234 -34 -> -0
+dqshi211 shift -9934567890123456789012345678901234 -33 -> -9
+dqshi212 shift -9934567890123456789012345678901234 -34 -> -0
+
+
+-- Specials; NaNs are handled as usual
+dqshi781 shift -Inf -8 -> -Infinity
+dqshi782 shift -Inf -1 -> -Infinity
+dqshi783 shift -Inf -0 -> -Infinity
+dqshi784 shift -Inf 0 -> -Infinity
+dqshi785 shift -Inf 1 -> -Infinity
+dqshi786 shift -Inf 8 -> -Infinity
+dqshi787 shift -1000 -Inf -> NaN Invalid_operation
+dqshi788 shift -Inf -Inf -> NaN Invalid_operation
+dqshi789 shift -1 -Inf -> NaN Invalid_operation
+dqshi790 shift -0 -Inf -> NaN Invalid_operation
+dqshi791 shift 0 -Inf -> NaN Invalid_operation
+dqshi792 shift 1 -Inf -> NaN Invalid_operation
+dqshi793 shift 1000 -Inf -> NaN Invalid_operation
+dqshi794 shift Inf -Inf -> NaN Invalid_operation
+
+dqshi800 shift Inf -Inf -> NaN Invalid_operation
+dqshi801 shift Inf -8 -> Infinity
+dqshi802 shift Inf -1 -> Infinity
+dqshi803 shift Inf -0 -> Infinity
+dqshi804 shift Inf 0 -> Infinity
+dqshi805 shift Inf 1 -> Infinity
+dqshi806 shift Inf 8 -> Infinity
+dqshi807 shift Inf Inf -> NaN Invalid_operation
+dqshi808 shift -1000 Inf -> NaN Invalid_operation
+dqshi809 shift -Inf Inf -> NaN Invalid_operation
+dqshi810 shift -1 Inf -> NaN Invalid_operation
+dqshi811 shift -0 Inf -> NaN Invalid_operation
+dqshi812 shift 0 Inf -> NaN Invalid_operation
+dqshi813 shift 1 Inf -> NaN Invalid_operation
+dqshi814 shift 1000 Inf -> NaN Invalid_operation
+dqshi815 shift Inf Inf -> NaN Invalid_operation
+
+dqshi821 shift NaN -Inf -> NaN
+dqshi822 shift NaN -1000 -> NaN
+dqshi823 shift NaN -1 -> NaN
+dqshi824 shift NaN -0 -> NaN
+dqshi825 shift NaN 0 -> NaN
+dqshi826 shift NaN 1 -> NaN
+dqshi827 shift NaN 1000 -> NaN
+dqshi828 shift NaN Inf -> NaN
+dqshi829 shift NaN NaN -> NaN
+dqshi830 shift -Inf NaN -> NaN
+dqshi831 shift -1000 NaN -> NaN
+dqshi832 shift -1 NaN -> NaN
+dqshi833 shift -0 NaN -> NaN
+dqshi834 shift 0 NaN -> NaN
+dqshi835 shift 1 NaN -> NaN
+dqshi836 shift 1000 NaN -> NaN
+dqshi837 shift Inf NaN -> NaN
+
+dqshi841 shift sNaN -Inf -> NaN Invalid_operation
+dqshi842 shift sNaN -1000 -> NaN Invalid_operation
+dqshi843 shift sNaN -1 -> NaN Invalid_operation
+dqshi844 shift sNaN -0 -> NaN Invalid_operation
+dqshi845 shift sNaN 0 -> NaN Invalid_operation
+dqshi846 shift sNaN 1 -> NaN Invalid_operation
+dqshi847 shift sNaN 1000 -> NaN Invalid_operation
+dqshi848 shift sNaN NaN -> NaN Invalid_operation
+dqshi849 shift sNaN sNaN -> NaN Invalid_operation
+dqshi850 shift NaN sNaN -> NaN Invalid_operation
+dqshi851 shift -Inf sNaN -> NaN Invalid_operation
+dqshi852 shift -1000 sNaN -> NaN Invalid_operation
+dqshi853 shift -1 sNaN -> NaN Invalid_operation
+dqshi854 shift -0 sNaN -> NaN Invalid_operation
+dqshi855 shift 0 sNaN -> NaN Invalid_operation
+dqshi856 shift 1 sNaN -> NaN Invalid_operation
+dqshi857 shift 1000 sNaN -> NaN Invalid_operation
+dqshi858 shift Inf sNaN -> NaN Invalid_operation
+dqshi859 shift NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqshi861 shift NaN1 -Inf -> NaN1
+dqshi862 shift +NaN2 -1000 -> NaN2
+dqshi863 shift NaN3 1000 -> NaN3
+dqshi864 shift NaN4 Inf -> NaN4
+dqshi865 shift NaN5 +NaN6 -> NaN5
+dqshi866 shift -Inf NaN7 -> NaN7
+dqshi867 shift -1000 NaN8 -> NaN8
+dqshi868 shift 1000 NaN9 -> NaN9
+dqshi869 shift Inf +NaN10 -> NaN10
+dqshi871 shift sNaN11 -Inf -> NaN11 Invalid_operation
+dqshi872 shift sNaN12 -1000 -> NaN12 Invalid_operation
+dqshi873 shift sNaN13 1000 -> NaN13 Invalid_operation
+dqshi874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
+dqshi875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
+dqshi876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
+dqshi877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
+dqshi878 shift -1000 sNaN21 -> NaN21 Invalid_operation
+dqshi879 shift 1000 sNaN22 -> NaN22 Invalid_operation
+dqshi880 shift Inf sNaN23 -> NaN23 Invalid_operation
+dqshi881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
+dqshi882 shift -NaN26 NaN28 -> -NaN26
+dqshi883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+dqshi884 shift 1000 -NaN30 -> -NaN30
+dqshi885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqSubtract.decTest b/Lib/test/decimaltestdata/dqSubtract.decTest
index f3b92270f9..34572f69d5 100644
--- a/Lib/test/decimaltestdata/dqSubtract.decTest
+++ b/Lib/test/decimaltestdata/dqSubtract.decTest
@@ -1,635 +1,635 @@
-------------------------------------------------------------------------
--- dqSubtract.decTest -- decQuad subtraction --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests are for decQuads only; all arguments are
--- representable in a decQuad
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- [first group are 'quick confidence check']
-dqsub001 subtract 0 0 -> '0'
-dqsub002 subtract 1 1 -> '0'
-dqsub003 subtract 1 2 -> '-1'
-dqsub004 subtract 2 1 -> '1'
-dqsub005 subtract 2 2 -> '0'
-dqsub006 subtract 3 2 -> '1'
-dqsub007 subtract 2 3 -> '-1'
-
-dqsub011 subtract -0 0 -> '-0'
-dqsub012 subtract -1 1 -> '-2'
-dqsub013 subtract -1 2 -> '-3'
-dqsub014 subtract -2 1 -> '-3'
-dqsub015 subtract -2 2 -> '-4'
-dqsub016 subtract -3 2 -> '-5'
-dqsub017 subtract -2 3 -> '-5'
-
-dqsub021 subtract 0 -0 -> '0'
-dqsub022 subtract 1 -1 -> '2'
-dqsub023 subtract 1 -2 -> '3'
-dqsub024 subtract 2 -1 -> '3'
-dqsub025 subtract 2 -2 -> '4'
-dqsub026 subtract 3 -2 -> '5'
-dqsub027 subtract 2 -3 -> '5'
-
-dqsub030 subtract 11 1 -> 10
-dqsub031 subtract 10 1 -> 9
-dqsub032 subtract 9 1 -> 8
-dqsub033 subtract 1 1 -> 0
-dqsub034 subtract 0 1 -> -1
-dqsub035 subtract -1 1 -> -2
-dqsub036 subtract -9 1 -> -10
-dqsub037 subtract -10 1 -> -11
-dqsub038 subtract -11 1 -> -12
-
-dqsub040 subtract '5.75' '3.3' -> '2.45'
-dqsub041 subtract '5' '-3' -> '8'
-dqsub042 subtract '-5' '-3' -> '-2'
-dqsub043 subtract '-7' '2.5' -> '-9.5'
-dqsub044 subtract '0.7' '0.3' -> '0.4'
-dqsub045 subtract '1.3' '0.3' -> '1.0'
-dqsub046 subtract '1.25' '1.25' -> '0.00'
-
-dqsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
-dqsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
-
-dqsub060 subtract '70' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
-dqsub061 subtract '700' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
-dqsub062 subtract '7000' '10000e+34' -> '-9.999999999999999999999999999999999E+37' Inexact Rounded
-dqsub063 subtract '70000' '10000e+34' -> '-9.999999999999999999999999999999993E+37' Rounded
-dqsub064 subtract '700000' '10000e+34' -> '-9.999999999999999999999999999999930E+37' Rounded
- -- symmetry:
-dqsub065 subtract '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqsub066 subtract '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
-dqsub067 subtract '10000e+34' '7000' -> '9.999999999999999999999999999999999E+37' Inexact Rounded
-dqsub068 subtract '10000e+34' '70000' -> '9.999999999999999999999999999999993E+37' Rounded
-dqsub069 subtract '10000e+34' '700000' -> '9.999999999999999999999999999999930E+37' Rounded
-
- -- some of the next group are really constructor tests
-dqsub090 subtract '00.0' '0.0' -> '0.0'
-dqsub091 subtract '00.0' '0.00' -> '0.00'
-dqsub092 subtract '0.00' '00.0' -> '0.00'
-dqsub093 subtract '00.0' '0.00' -> '0.00'
-dqsub094 subtract '0.00' '00.0' -> '0.00'
-dqsub095 subtract '3' '.3' -> '2.7'
-dqsub096 subtract '3.' '.3' -> '2.7'
-dqsub097 subtract '3.0' '.3' -> '2.7'
-dqsub098 subtract '3.00' '.3' -> '2.70'
-dqsub099 subtract '3' '3' -> '0'
-dqsub100 subtract '3' '+3' -> '0'
-dqsub101 subtract '3' '-3' -> '6'
-dqsub102 subtract '3' '0.3' -> '2.7'
-dqsub103 subtract '3.' '0.3' -> '2.7'
-dqsub104 subtract '3.0' '0.3' -> '2.7'
-dqsub105 subtract '3.00' '0.3' -> '2.70'
-dqsub106 subtract '3' '3.0' -> '0.0'
-dqsub107 subtract '3' '+3.0' -> '0.0'
-dqsub108 subtract '3' '-3.0' -> '6.0'
-
--- the above all from add; massaged and extended. Now some new ones...
--- [particularly important for comparisons]
--- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
--- with input rounding.
-dqsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
-dqsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
-dqsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
-dqsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
-dqsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
-dqsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
-dqsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
-dqsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
-dqsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
-dqsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
-dqsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
-dqsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
-dqsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
-dqsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
-dqsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
-dqsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
-dqsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
-dqsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
-dqsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
-dqsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
-dqsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
-dqsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
-dqsub142 subtract '1' '0.999999999' -> '1E-9'
-dqsub143 subtract '0.999999999' '1' -> '-1E-9'
-dqsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
-dqsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
-dqsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
-
--- additional scaled arithmetic tests [0.97 problem]
-dqsub160 subtract '0' '.1' -> '-0.1'
-dqsub161 subtract '00' '.97983' -> '-0.97983'
-dqsub162 subtract '0' '.9' -> '-0.9'
-dqsub163 subtract '0' '0.102' -> '-0.102'
-dqsub164 subtract '0' '.4' -> '-0.4'
-dqsub165 subtract '0' '.307' -> '-0.307'
-dqsub166 subtract '0' '.43822' -> '-0.43822'
-dqsub167 subtract '0' '.911' -> '-0.911'
-dqsub168 subtract '.0' '.02' -> '-0.02'
-dqsub169 subtract '00' '.392' -> '-0.392'
-dqsub170 subtract '0' '.26' -> '-0.26'
-dqsub171 subtract '0' '0.51' -> '-0.51'
-dqsub172 subtract '0' '.2234' -> '-0.2234'
-dqsub173 subtract '0' '.2' -> '-0.2'
-dqsub174 subtract '.0' '.0008' -> '-0.0008'
--- 0. on left
-dqsub180 subtract '0.0' '-.1' -> '0.1'
-dqsub181 subtract '0.00' '-.97983' -> '0.97983'
-dqsub182 subtract '0.0' '-.9' -> '0.9'
-dqsub183 subtract '0.0' '-0.102' -> '0.102'
-dqsub184 subtract '0.0' '-.4' -> '0.4'
-dqsub185 subtract '0.0' '-.307' -> '0.307'
-dqsub186 subtract '0.0' '-.43822' -> '0.43822'
-dqsub187 subtract '0.0' '-.911' -> '0.911'
-dqsub188 subtract '0.0' '-.02' -> '0.02'
-dqsub189 subtract '0.00' '-.392' -> '0.392'
-dqsub190 subtract '0.0' '-.26' -> '0.26'
-dqsub191 subtract '0.0' '-0.51' -> '0.51'
-dqsub192 subtract '0.0' '-.2234' -> '0.2234'
-dqsub193 subtract '0.0' '-.2' -> '0.2'
-dqsub194 subtract '0.0' '-.0008' -> '0.0008'
--- negatives of same
-dqsub200 subtract '0' '-.1' -> '0.1'
-dqsub201 subtract '00' '-.97983' -> '0.97983'
-dqsub202 subtract '0' '-.9' -> '0.9'
-dqsub203 subtract '0' '-0.102' -> '0.102'
-dqsub204 subtract '0' '-.4' -> '0.4'
-dqsub205 subtract '0' '-.307' -> '0.307'
-dqsub206 subtract '0' '-.43822' -> '0.43822'
-dqsub207 subtract '0' '-.911' -> '0.911'
-dqsub208 subtract '.0' '-.02' -> '0.02'
-dqsub209 subtract '00' '-.392' -> '0.392'
-dqsub210 subtract '0' '-.26' -> '0.26'
-dqsub211 subtract '0' '-0.51' -> '0.51'
-dqsub212 subtract '0' '-.2234' -> '0.2234'
-dqsub213 subtract '0' '-.2' -> '0.2'
-dqsub214 subtract '.0' '-.0008' -> '0.0008'
-
--- more fixed, LHS swaps [really the same as testcases under add]
-dqsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
-dqsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
-dqsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
-dqsub223 subtract '-56267E-9' 0 -> '-0.000056267'
-dqsub224 subtract '-56267E-8' 0 -> '-0.00056267'
-dqsub225 subtract '-56267E-7' 0 -> '-0.0056267'
-dqsub226 subtract '-56267E-6' 0 -> '-0.056267'
-dqsub227 subtract '-56267E-5' 0 -> '-0.56267'
-dqsub228 subtract '-56267E-2' 0 -> '-562.67'
-dqsub229 subtract '-56267E-1' 0 -> '-5626.7'
-dqsub230 subtract '-56267E-0' 0 -> '-56267'
--- symmetry ...
-dqsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
-dqsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
-dqsub242 subtract 0 '-56267E-10' -> '0.0000056267'
-dqsub243 subtract 0 '-56267E-9' -> '0.000056267'
-dqsub244 subtract 0 '-56267E-8' -> '0.00056267'
-dqsub245 subtract 0 '-56267E-7' -> '0.0056267'
-dqsub246 subtract 0 '-56267E-6' -> '0.056267'
-dqsub247 subtract 0 '-56267E-5' -> '0.56267'
-dqsub248 subtract 0 '-56267E-2' -> '562.67'
-dqsub249 subtract 0 '-56267E-1' -> '5626.7'
-dqsub250 subtract 0 '-56267E-0' -> '56267'
-
--- now some more from the 'new' add
-dqsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
-dqsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
-
--- some carrying effects
-dqsub321 subtract '0.9998' '0.0000' -> '0.9998'
-dqsub322 subtract '0.9998' '0.0001' -> '0.9997'
-dqsub323 subtract '0.9998' '0.0002' -> '0.9996'
-dqsub324 subtract '0.9998' '0.0003' -> '0.9995'
-dqsub325 subtract '0.9998' '-0.0000' -> '0.9998'
-dqsub326 subtract '0.9998' '-0.0001' -> '0.9999'
-dqsub327 subtract '0.9998' '-0.0002' -> '1.0000'
-dqsub328 subtract '0.9998' '-0.0003' -> '1.0001'
-
--- internal boundaries
-dqsub346 subtract '10000e+9' '7' -> '9999999999993'
-dqsub347 subtract '10000e+9' '70' -> '9999999999930'
-dqsub348 subtract '10000e+9' '700' -> '9999999999300'
-dqsub349 subtract '10000e+9' '7000' -> '9999999993000'
-dqsub350 subtract '10000e+9' '70000' -> '9999999930000'
-dqsub351 subtract '10000e+9' '700000' -> '9999999300000'
-dqsub352 subtract '7' '10000e+9' -> '-9999999999993'
-dqsub353 subtract '70' '10000e+9' -> '-9999999999930'
-dqsub354 subtract '700' '10000e+9' -> '-9999999999300'
-dqsub355 subtract '7000' '10000e+9' -> '-9999999993000'
-dqsub356 subtract '70000' '10000e+9' -> '-9999999930000'
-dqsub357 subtract '700000' '10000e+9' -> '-9999999300000'
-
--- zero preservation
-dqsub361 subtract 1 '0.0001' -> '0.9999'
-dqsub362 subtract 1 '0.00001' -> '0.99999'
-dqsub363 subtract 1 '0.000001' -> '0.999999'
-dqsub364 subtract 1 '0.0000000000000000000000000000000001' -> '0.9999999999999999999999999999999999'
-dqsub365 subtract 1 '0.00000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub366 subtract 1 '0.000000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
-
--- some funny zeros [in case of bad signum]
-dqsub370 subtract 1 0 -> 1
-dqsub371 subtract 1 0. -> 1
-dqsub372 subtract 1 .0 -> 1.0
-dqsub373 subtract 1 0.0 -> 1.0
-dqsub374 subtract 0 1 -> -1
-dqsub375 subtract 0. 1 -> -1
-dqsub376 subtract .0 1 -> -1.0
-dqsub377 subtract 0.0 1 -> -1.0
-
--- leading 0 digit before round
-dqsub910 subtract -103519362 -51897955.3 -> -51621406.7
-dqsub911 subtract 159579.444 89827.5229 -> 69751.9211
-
-dqsub920 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234566 -> 299.9999999999999999999999999999999 Inexact Rounded
-dqsub921 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 300.0000000000000000000000000000000 Inexact Rounded
-dqsub922 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 99.99999999999999999999999999999995
-dqsub923 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234564 -> 99.99999999999999999999999999999996
-dqsub924 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234540 -> 100.0000000000000000000000000000002 Rounded
-dqsub925 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234560 -> 90.00000000000000000000000000000000
-dqsub926 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234561 -> 89.99999999999999999999999999999999
-dqsub927 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234566 -> 89.99999999999999999999999999999994
-dqsub928 subtract 101.0000000000000000000000000123456 91.00000000000000000000000001234566 -> 9.99999999999999999999999999999994
-dqsub929 subtract 101.0000000000000000000000000123456 99.00000000000000000000000001234566 -> 1.99999999999999999999999999999994
-
--- more LHS swaps [were fixed]
-dqsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
-dqsub391 subtract '-56267E-6' 0 -> '-0.056267'
-dqsub392 subtract '-56267E-5' 0 -> '-0.56267'
-dqsub393 subtract '-56267E-4' 0 -> '-5.6267'
-dqsub394 subtract '-56267E-3' 0 -> '-56.267'
-dqsub395 subtract '-56267E-2' 0 -> '-562.67'
-dqsub396 subtract '-56267E-1' 0 -> '-5626.7'
-dqsub397 subtract '-56267E-0' 0 -> '-56267'
-dqsub398 subtract '-5E-10' 0 -> '-5E-10'
-dqsub399 subtract '-5E-7' 0 -> '-5E-7'
-dqsub400 subtract '-5E-6' 0 -> '-0.000005'
-dqsub401 subtract '-5E-5' 0 -> '-0.00005'
-dqsub402 subtract '-5E-4' 0 -> '-0.0005'
-dqsub403 subtract '-5E-1' 0 -> '-0.5'
-dqsub404 subtract '-5E0' 0 -> '-5'
-dqsub405 subtract '-5E1' 0 -> '-50'
-dqsub406 subtract '-5E5' 0 -> '-500000'
-dqsub407 subtract '-5E33' 0 -> '-5000000000000000000000000000000000'
-dqsub408 subtract '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
-dqsub409 subtract '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
-dqsub410 subtract '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
-dqsub411 subtract '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
-
--- more RHS swaps [were fixed]
-dqsub420 subtract 0 '-56267E-10' -> '0.0000056267'
-dqsub421 subtract 0 '-56267E-6' -> '0.056267'
-dqsub422 subtract 0 '-56267E-5' -> '0.56267'
-dqsub423 subtract 0 '-56267E-4' -> '5.6267'
-dqsub424 subtract 0 '-56267E-3' -> '56.267'
-dqsub425 subtract 0 '-56267E-2' -> '562.67'
-dqsub426 subtract 0 '-56267E-1' -> '5626.7'
-dqsub427 subtract 0 '-56267E-0' -> '56267'
-dqsub428 subtract 0 '-5E-10' -> '5E-10'
-dqsub429 subtract 0 '-5E-7' -> '5E-7'
-dqsub430 subtract 0 '-5E-6' -> '0.000005'
-dqsub431 subtract 0 '-5E-5' -> '0.00005'
-dqsub432 subtract 0 '-5E-4' -> '0.0005'
-dqsub433 subtract 0 '-5E-1' -> '0.5'
-dqsub434 subtract 0 '-5E0' -> '5'
-dqsub435 subtract 0 '-5E1' -> '50'
-dqsub436 subtract 0 '-5E5' -> '500000'
-dqsub437 subtract 0 '-5E33' -> '5000000000000000000000000000000000'
-dqsub438 subtract 0 '-5E34' -> '5.000000000000000000000000000000000E+34' Rounded
-dqsub439 subtract 0 '-5E35' -> '5.000000000000000000000000000000000E+35' Rounded
-dqsub440 subtract 0 '-5E36' -> '5.000000000000000000000000000000000E+36' Rounded
-dqsub441 subtract 0 '-5E100' -> '5.000000000000000000000000000000000E+100' Rounded
-
-
--- try borderline precision, with carries, etc.
-dqsub461 subtract '1E+16' '1' -> '9999999999999999'
-dqsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
-dqsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
-dqsub464 subtract '-1' '-1E+16' -> '9999999999999999'
-dqsub465 subtract '7E+15' '1' -> '6999999999999999'
-dqsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
-dqsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
-dqsub468 subtract '-1' '-7E+15' -> '6999999999999999'
-
--- 1234567890123456 1234567890123456 1 23456789012345
-dqsub470 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555563' -> '1.000000000000000000000000000000001' Inexact Rounded
-dqsub471 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555562' -> '1.000000000000000000000000000000001' Inexact Rounded
-dqsub472 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555561' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub473 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555560' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub474 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555559' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub475 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555558' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub476 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555557' -> '1.000000000000000000000000000000000' Inexact Rounded
-dqsub477 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555556' -> '1.000000000000000000000000000000000' Rounded
-dqsub478 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
-dqsub479 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555554' -> '0.9999999999999999999999999999999998'
-dqsub480 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555553' -> '0.9999999999999999999999999999999997'
-dqsub481 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555552' -> '0.9999999999999999999999999999999996'
-dqsub482 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555551' -> '0.9999999999999999999999999999999995'
-dqsub483 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555550' -> '0.9999999999999999999999999999999994'
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-dqsub500 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
-dqsub501 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub502 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub503 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub504 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub505 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub506 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub507 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub508 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub509 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub510 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub511 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub512 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub513 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub514 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub515 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub516 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
-dqsub517 subtract '1231234555555555555555555567456789' 1.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub518 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub519 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
-
-rounding: half_even
-dqsub520 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
-dqsub521 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub522 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub523 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub524 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub525 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub526 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub527 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
-dqsub528 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub529 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub530 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub531 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub532 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub533 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub534 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub535 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub536 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
-dqsub537 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub538 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub539 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
--- critical few with even bottom digit...
-dqsub540 subtract '1231234555555555555555555567456788' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub541 subtract '1231234555555555555555555567456788' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub542 subtract '1231234555555555555555555567456788' 0.500000001 -> '1231234555555555555555555567456787' Inexact Rounded
-
-rounding: down
-dqsub550 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
-dqsub551 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub552 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub553 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub554 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub555 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub556 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub557 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub558 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub559 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub560 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub561 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub562 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub563 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub564 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub565 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
-dqsub566 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
-dqsub567 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456787' Inexact Rounded
-dqsub568 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456787' Inexact Rounded
-dqsub569 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456787' Inexact Rounded
-
--- symmetry...
-rounding: half_up
-dqsub600 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
-dqsub601 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub602 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub603 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub604 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub605 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub606 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub607 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub608 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub609 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub610 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub611 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub612 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub613 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub614 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub615 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub616 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
-dqsub617 subtract 1.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub618 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub619 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-
-rounding: half_even
-dqsub620 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
-dqsub621 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub622 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub623 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub624 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub625 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub626 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub627 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
-dqsub628 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub629 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub630 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub631 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub632 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub633 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub634 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub635 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub636 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
-dqsub637 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub638 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub639 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
--- critical few with even bottom digit...
-dqsub640 subtract 0.499999999 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub641 subtract 0.5 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub642 subtract 0.500000001 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456787' Inexact Rounded
-
-rounding: down
-dqsub650 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
-dqsub651 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub652 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub653 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub654 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub655 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub656 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub657 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub658 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub659 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub660 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub661 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub662 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub663 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub664 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub665 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
-dqsub666 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
-dqsub667 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
-dqsub668 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
-dqsub669 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
-
-
--- lots of leading zeros in intermediate result, and showing effects of
--- input rounding would have affected the following
-rounding: half_up
-dqsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
-dqsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
-dqsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
-dqsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
-dqsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
-
-rounding: half_even
-dqsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
-dqsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
-dqsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
-dqsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
-dqsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
-
-dqsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
-dqsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
-dqsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
-dqsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
-dqsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
-
-rounding: down
-dqsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
-dqsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
-dqsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
-dqsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
-dqsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
-
--- Specials
-dqsub780 subtract -Inf Inf -> -Infinity
-dqsub781 subtract -Inf 1000 -> -Infinity
-dqsub782 subtract -Inf 1 -> -Infinity
-dqsub783 subtract -Inf -0 -> -Infinity
-dqsub784 subtract -Inf -1 -> -Infinity
-dqsub785 subtract -Inf -1000 -> -Infinity
-dqsub787 subtract -1000 Inf -> -Infinity
-dqsub788 subtract -Inf Inf -> -Infinity
-dqsub789 subtract -1 Inf -> -Infinity
-dqsub790 subtract 0 Inf -> -Infinity
-dqsub791 subtract 1 Inf -> -Infinity
-dqsub792 subtract 1000 Inf -> -Infinity
-
-dqsub800 subtract Inf Inf -> NaN Invalid_operation
-dqsub801 subtract Inf 1000 -> Infinity
-dqsub802 subtract Inf 1 -> Infinity
-dqsub803 subtract Inf 0 -> Infinity
-dqsub804 subtract Inf -0 -> Infinity
-dqsub805 subtract Inf -1 -> Infinity
-dqsub806 subtract Inf -1000 -> Infinity
-dqsub807 subtract Inf -Inf -> Infinity
-dqsub808 subtract -1000 -Inf -> Infinity
-dqsub809 subtract -Inf -Inf -> NaN Invalid_operation
-dqsub810 subtract -1 -Inf -> Infinity
-dqsub811 subtract -0 -Inf -> Infinity
-dqsub812 subtract 0 -Inf -> Infinity
-dqsub813 subtract 1 -Inf -> Infinity
-dqsub814 subtract 1000 -Inf -> Infinity
-dqsub815 subtract Inf -Inf -> Infinity
-
-dqsub821 subtract NaN Inf -> NaN
-dqsub822 subtract -NaN 1000 -> -NaN
-dqsub823 subtract NaN 1 -> NaN
-dqsub824 subtract NaN 0 -> NaN
-dqsub825 subtract NaN -0 -> NaN
-dqsub826 subtract NaN -1 -> NaN
-dqsub827 subtract NaN -1000 -> NaN
-dqsub828 subtract NaN -Inf -> NaN
-dqsub829 subtract -NaN NaN -> -NaN
-dqsub830 subtract -Inf NaN -> NaN
-dqsub831 subtract -1000 NaN -> NaN
-dqsub832 subtract -1 NaN -> NaN
-dqsub833 subtract -0 NaN -> NaN
-dqsub834 subtract 0 NaN -> NaN
-dqsub835 subtract 1 NaN -> NaN
-dqsub836 subtract 1000 -NaN -> -NaN
-dqsub837 subtract Inf NaN -> NaN
-
-dqsub841 subtract sNaN Inf -> NaN Invalid_operation
-dqsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
-dqsub843 subtract sNaN 1 -> NaN Invalid_operation
-dqsub844 subtract sNaN 0 -> NaN Invalid_operation
-dqsub845 subtract sNaN -0 -> NaN Invalid_operation
-dqsub846 subtract sNaN -1 -> NaN Invalid_operation
-dqsub847 subtract sNaN -1000 -> NaN Invalid_operation
-dqsub848 subtract sNaN NaN -> NaN Invalid_operation
-dqsub849 subtract sNaN sNaN -> NaN Invalid_operation
-dqsub850 subtract NaN sNaN -> NaN Invalid_operation
-dqsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
-dqsub852 subtract -1000 sNaN -> NaN Invalid_operation
-dqsub853 subtract -1 sNaN -> NaN Invalid_operation
-dqsub854 subtract -0 sNaN -> NaN Invalid_operation
-dqsub855 subtract 0 sNaN -> NaN Invalid_operation
-dqsub856 subtract 1 sNaN -> NaN Invalid_operation
-dqsub857 subtract 1000 sNaN -> NaN Invalid_operation
-dqsub858 subtract Inf sNaN -> NaN Invalid_operation
-dqsub859 subtract NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqsub861 subtract NaN01 -Inf -> NaN1
-dqsub862 subtract -NaN02 -1000 -> -NaN2
-dqsub863 subtract NaN03 1000 -> NaN3
-dqsub864 subtract NaN04 Inf -> NaN4
-dqsub865 subtract NaN05 NaN61 -> NaN5
-dqsub866 subtract -Inf -NaN71 -> -NaN71
-dqsub867 subtract -1000 NaN81 -> NaN81
-dqsub868 subtract 1000 NaN91 -> NaN91
-dqsub869 subtract Inf NaN101 -> NaN101
-dqsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
-dqsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
-dqsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
-dqsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
-dqsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
-dqsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
-dqsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
-dqsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
-dqsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
-dqsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
-dqsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- edge case spills
-dqsub901 subtract 2.E-3 1.002 -> -1.000
-dqsub902 subtract 2.0E-3 1.002 -> -1.0000
-dqsub903 subtract 2.00E-3 1.0020 -> -1.00000
-dqsub904 subtract 2.000E-3 1.00200 -> -1.000000
-dqsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
-dqsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
-dqsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
-dqsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
-
--- subnormals and overflows covered under Add
-
--- Examples from SQL proposal (Krishna Kulkarni)
-dqsub1125 subtract 130E-2 120E-2 -> 0.10
-dqsub1126 subtract 130E-2 12E-1 -> 0.10
-dqsub1127 subtract 130E-2 1E0 -> 0.30
-dqsub1128 subtract 1E2 1E4 -> -9.9E+3
-
--- Null tests
-dqsub9990 subtract 10 # -> NaN Invalid_operation
-dqsub9991 subtract # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqSubtract.decTest -- decQuad subtraction --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests are for decQuads only; all arguments are
+-- representable in a decQuad
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- [first group are 'quick confidence check']
+dqsub001 subtract 0 0 -> '0'
+dqsub002 subtract 1 1 -> '0'
+dqsub003 subtract 1 2 -> '-1'
+dqsub004 subtract 2 1 -> '1'
+dqsub005 subtract 2 2 -> '0'
+dqsub006 subtract 3 2 -> '1'
+dqsub007 subtract 2 3 -> '-1'
+
+dqsub011 subtract -0 0 -> '-0'
+dqsub012 subtract -1 1 -> '-2'
+dqsub013 subtract -1 2 -> '-3'
+dqsub014 subtract -2 1 -> '-3'
+dqsub015 subtract -2 2 -> '-4'
+dqsub016 subtract -3 2 -> '-5'
+dqsub017 subtract -2 3 -> '-5'
+
+dqsub021 subtract 0 -0 -> '0'
+dqsub022 subtract 1 -1 -> '2'
+dqsub023 subtract 1 -2 -> '3'
+dqsub024 subtract 2 -1 -> '3'
+dqsub025 subtract 2 -2 -> '4'
+dqsub026 subtract 3 -2 -> '5'
+dqsub027 subtract 2 -3 -> '5'
+
+dqsub030 subtract 11 1 -> 10
+dqsub031 subtract 10 1 -> 9
+dqsub032 subtract 9 1 -> 8
+dqsub033 subtract 1 1 -> 0
+dqsub034 subtract 0 1 -> -1
+dqsub035 subtract -1 1 -> -2
+dqsub036 subtract -9 1 -> -10
+dqsub037 subtract -10 1 -> -11
+dqsub038 subtract -11 1 -> -12
+
+dqsub040 subtract '5.75' '3.3' -> '2.45'
+dqsub041 subtract '5' '-3' -> '8'
+dqsub042 subtract '-5' '-3' -> '-2'
+dqsub043 subtract '-7' '2.5' -> '-9.5'
+dqsub044 subtract '0.7' '0.3' -> '0.4'
+dqsub045 subtract '1.3' '0.3' -> '1.0'
+dqsub046 subtract '1.25' '1.25' -> '0.00'
+
+dqsub050 subtract '1.23456789' '1.00000000' -> '0.23456789'
+dqsub051 subtract '1.23456789' '1.00000089' -> '0.23456700'
+
+dqsub060 subtract '70' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
+dqsub061 subtract '700' '10000e+34' -> '-1.000000000000000000000000000000000E+38' Inexact Rounded
+dqsub062 subtract '7000' '10000e+34' -> '-9.999999999999999999999999999999999E+37' Inexact Rounded
+dqsub063 subtract '70000' '10000e+34' -> '-9.999999999999999999999999999999993E+37' Rounded
+dqsub064 subtract '700000' '10000e+34' -> '-9.999999999999999999999999999999930E+37' Rounded
+ -- symmetry:
+dqsub065 subtract '10000e+34' '70' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqsub066 subtract '10000e+34' '700' -> '1.000000000000000000000000000000000E+38' Inexact Rounded
+dqsub067 subtract '10000e+34' '7000' -> '9.999999999999999999999999999999999E+37' Inexact Rounded
+dqsub068 subtract '10000e+34' '70000' -> '9.999999999999999999999999999999993E+37' Rounded
+dqsub069 subtract '10000e+34' '700000' -> '9.999999999999999999999999999999930E+37' Rounded
+
+ -- some of the next group are really constructor tests
+dqsub090 subtract '00.0' '0.0' -> '0.0'
+dqsub091 subtract '00.0' '0.00' -> '0.00'
+dqsub092 subtract '0.00' '00.0' -> '0.00'
+dqsub093 subtract '00.0' '0.00' -> '0.00'
+dqsub094 subtract '0.00' '00.0' -> '0.00'
+dqsub095 subtract '3' '.3' -> '2.7'
+dqsub096 subtract '3.' '.3' -> '2.7'
+dqsub097 subtract '3.0' '.3' -> '2.7'
+dqsub098 subtract '3.00' '.3' -> '2.70'
+dqsub099 subtract '3' '3' -> '0'
+dqsub100 subtract '3' '+3' -> '0'
+dqsub101 subtract '3' '-3' -> '6'
+dqsub102 subtract '3' '0.3' -> '2.7'
+dqsub103 subtract '3.' '0.3' -> '2.7'
+dqsub104 subtract '3.0' '0.3' -> '2.7'
+dqsub105 subtract '3.00' '0.3' -> '2.70'
+dqsub106 subtract '3' '3.0' -> '0.0'
+dqsub107 subtract '3' '+3.0' -> '0.0'
+dqsub108 subtract '3' '-3.0' -> '6.0'
+
+-- the above all from add; massaged and extended. Now some new ones...
+-- [particularly important for comparisons]
+-- NB: -xE-8 below were non-exponents pre-ANSI X3-274, and -1E-7 or 0E-7
+-- with input rounding.
+dqsub120 subtract '10.23456784' '10.23456789' -> '-5E-8'
+dqsub121 subtract '10.23456785' '10.23456789' -> '-4E-8'
+dqsub122 subtract '10.23456786' '10.23456789' -> '-3E-8'
+dqsub123 subtract '10.23456787' '10.23456789' -> '-2E-8'
+dqsub124 subtract '10.23456788' '10.23456789' -> '-1E-8'
+dqsub125 subtract '10.23456789' '10.23456789' -> '0E-8'
+dqsub126 subtract '10.23456790' '10.23456789' -> '1E-8'
+dqsub127 subtract '10.23456791' '10.23456789' -> '2E-8'
+dqsub128 subtract '10.23456792' '10.23456789' -> '3E-8'
+dqsub129 subtract '10.23456793' '10.23456789' -> '4E-8'
+dqsub130 subtract '10.23456794' '10.23456789' -> '5E-8'
+dqsub131 subtract '10.23456781' '10.23456786' -> '-5E-8'
+dqsub132 subtract '10.23456782' '10.23456786' -> '-4E-8'
+dqsub133 subtract '10.23456783' '10.23456786' -> '-3E-8'
+dqsub134 subtract '10.23456784' '10.23456786' -> '-2E-8'
+dqsub135 subtract '10.23456785' '10.23456786' -> '-1E-8'
+dqsub136 subtract '10.23456786' '10.23456786' -> '0E-8'
+dqsub137 subtract '10.23456787' '10.23456786' -> '1E-8'
+dqsub138 subtract '10.23456788' '10.23456786' -> '2E-8'
+dqsub139 subtract '10.23456789' '10.23456786' -> '3E-8'
+dqsub140 subtract '10.23456790' '10.23456786' -> '4E-8'
+dqsub141 subtract '10.23456791' '10.23456786' -> '5E-8'
+dqsub142 subtract '1' '0.999999999' -> '1E-9'
+dqsub143 subtract '0.999999999' '1' -> '-1E-9'
+dqsub144 subtract '-10.23456780' '-10.23456786' -> '6E-8'
+dqsub145 subtract '-10.23456790' '-10.23456786' -> '-4E-8'
+dqsub146 subtract '-10.23456791' '-10.23456786' -> '-5E-8'
+
+-- additional scaled arithmetic tests [0.97 problem]
+dqsub160 subtract '0' '.1' -> '-0.1'
+dqsub161 subtract '00' '.97983' -> '-0.97983'
+dqsub162 subtract '0' '.9' -> '-0.9'
+dqsub163 subtract '0' '0.102' -> '-0.102'
+dqsub164 subtract '0' '.4' -> '-0.4'
+dqsub165 subtract '0' '.307' -> '-0.307'
+dqsub166 subtract '0' '.43822' -> '-0.43822'
+dqsub167 subtract '0' '.911' -> '-0.911'
+dqsub168 subtract '.0' '.02' -> '-0.02'
+dqsub169 subtract '00' '.392' -> '-0.392'
+dqsub170 subtract '0' '.26' -> '-0.26'
+dqsub171 subtract '0' '0.51' -> '-0.51'
+dqsub172 subtract '0' '.2234' -> '-0.2234'
+dqsub173 subtract '0' '.2' -> '-0.2'
+dqsub174 subtract '.0' '.0008' -> '-0.0008'
+-- 0. on left
+dqsub180 subtract '0.0' '-.1' -> '0.1'
+dqsub181 subtract '0.00' '-.97983' -> '0.97983'
+dqsub182 subtract '0.0' '-.9' -> '0.9'
+dqsub183 subtract '0.0' '-0.102' -> '0.102'
+dqsub184 subtract '0.0' '-.4' -> '0.4'
+dqsub185 subtract '0.0' '-.307' -> '0.307'
+dqsub186 subtract '0.0' '-.43822' -> '0.43822'
+dqsub187 subtract '0.0' '-.911' -> '0.911'
+dqsub188 subtract '0.0' '-.02' -> '0.02'
+dqsub189 subtract '0.00' '-.392' -> '0.392'
+dqsub190 subtract '0.0' '-.26' -> '0.26'
+dqsub191 subtract '0.0' '-0.51' -> '0.51'
+dqsub192 subtract '0.0' '-.2234' -> '0.2234'
+dqsub193 subtract '0.0' '-.2' -> '0.2'
+dqsub194 subtract '0.0' '-.0008' -> '0.0008'
+-- negatives of same
+dqsub200 subtract '0' '-.1' -> '0.1'
+dqsub201 subtract '00' '-.97983' -> '0.97983'
+dqsub202 subtract '0' '-.9' -> '0.9'
+dqsub203 subtract '0' '-0.102' -> '0.102'
+dqsub204 subtract '0' '-.4' -> '0.4'
+dqsub205 subtract '0' '-.307' -> '0.307'
+dqsub206 subtract '0' '-.43822' -> '0.43822'
+dqsub207 subtract '0' '-.911' -> '0.911'
+dqsub208 subtract '.0' '-.02' -> '0.02'
+dqsub209 subtract '00' '-.392' -> '0.392'
+dqsub210 subtract '0' '-.26' -> '0.26'
+dqsub211 subtract '0' '-0.51' -> '0.51'
+dqsub212 subtract '0' '-.2234' -> '0.2234'
+dqsub213 subtract '0' '-.2' -> '0.2'
+dqsub214 subtract '.0' '-.0008' -> '0.0008'
+
+-- more fixed, LHS swaps [really the same as testcases under add]
+dqsub220 subtract '-56267E-12' 0 -> '-5.6267E-8'
+dqsub221 subtract '-56267E-11' 0 -> '-5.6267E-7'
+dqsub222 subtract '-56267E-10' 0 -> '-0.0000056267'
+dqsub223 subtract '-56267E-9' 0 -> '-0.000056267'
+dqsub224 subtract '-56267E-8' 0 -> '-0.00056267'
+dqsub225 subtract '-56267E-7' 0 -> '-0.0056267'
+dqsub226 subtract '-56267E-6' 0 -> '-0.056267'
+dqsub227 subtract '-56267E-5' 0 -> '-0.56267'
+dqsub228 subtract '-56267E-2' 0 -> '-562.67'
+dqsub229 subtract '-56267E-1' 0 -> '-5626.7'
+dqsub230 subtract '-56267E-0' 0 -> '-56267'
+-- symmetry ...
+dqsub240 subtract 0 '-56267E-12' -> '5.6267E-8'
+dqsub241 subtract 0 '-56267E-11' -> '5.6267E-7'
+dqsub242 subtract 0 '-56267E-10' -> '0.0000056267'
+dqsub243 subtract 0 '-56267E-9' -> '0.000056267'
+dqsub244 subtract 0 '-56267E-8' -> '0.00056267'
+dqsub245 subtract 0 '-56267E-7' -> '0.0056267'
+dqsub246 subtract 0 '-56267E-6' -> '0.056267'
+dqsub247 subtract 0 '-56267E-5' -> '0.56267'
+dqsub248 subtract 0 '-56267E-2' -> '562.67'
+dqsub249 subtract 0 '-56267E-1' -> '5626.7'
+dqsub250 subtract 0 '-56267E-0' -> '56267'
+
+-- now some more from the 'new' add
+dqsub301 subtract '1.23456789' '1.00000000' -> '0.23456789'
+dqsub302 subtract '1.23456789' '1.00000011' -> '0.23456778'
+
+-- some carrying effects
+dqsub321 subtract '0.9998' '0.0000' -> '0.9998'
+dqsub322 subtract '0.9998' '0.0001' -> '0.9997'
+dqsub323 subtract '0.9998' '0.0002' -> '0.9996'
+dqsub324 subtract '0.9998' '0.0003' -> '0.9995'
+dqsub325 subtract '0.9998' '-0.0000' -> '0.9998'
+dqsub326 subtract '0.9998' '-0.0001' -> '0.9999'
+dqsub327 subtract '0.9998' '-0.0002' -> '1.0000'
+dqsub328 subtract '0.9998' '-0.0003' -> '1.0001'
+
+-- internal boundaries
+dqsub346 subtract '10000e+9' '7' -> '9999999999993'
+dqsub347 subtract '10000e+9' '70' -> '9999999999930'
+dqsub348 subtract '10000e+9' '700' -> '9999999999300'
+dqsub349 subtract '10000e+9' '7000' -> '9999999993000'
+dqsub350 subtract '10000e+9' '70000' -> '9999999930000'
+dqsub351 subtract '10000e+9' '700000' -> '9999999300000'
+dqsub352 subtract '7' '10000e+9' -> '-9999999999993'
+dqsub353 subtract '70' '10000e+9' -> '-9999999999930'
+dqsub354 subtract '700' '10000e+9' -> '-9999999999300'
+dqsub355 subtract '7000' '10000e+9' -> '-9999999993000'
+dqsub356 subtract '70000' '10000e+9' -> '-9999999930000'
+dqsub357 subtract '700000' '10000e+9' -> '-9999999300000'
+
+-- zero preservation
+dqsub361 subtract 1 '0.0001' -> '0.9999'
+dqsub362 subtract 1 '0.00001' -> '0.99999'
+dqsub363 subtract 1 '0.000001' -> '0.999999'
+dqsub364 subtract 1 '0.0000000000000000000000000000000001' -> '0.9999999999999999999999999999999999'
+dqsub365 subtract 1 '0.00000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub366 subtract 1 '0.000000000000000000000000000000000001' -> '1.000000000000000000000000000000000' Inexact Rounded
+
+-- some funny zeros [in case of bad signum]
+dqsub370 subtract 1 0 -> 1
+dqsub371 subtract 1 0. -> 1
+dqsub372 subtract 1 .0 -> 1.0
+dqsub373 subtract 1 0.0 -> 1.0
+dqsub374 subtract 0 1 -> -1
+dqsub375 subtract 0. 1 -> -1
+dqsub376 subtract .0 1 -> -1.0
+dqsub377 subtract 0.0 1 -> -1.0
+
+-- leading 0 digit before round
+dqsub910 subtract -103519362 -51897955.3 -> -51621406.7
+dqsub911 subtract 159579.444 89827.5229 -> 69751.9211
+
+dqsub920 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234566 -> 299.9999999999999999999999999999999 Inexact Rounded
+dqsub921 subtract 333.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 300.0000000000000000000000000000000 Inexact Rounded
+dqsub922 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234565 -> 99.99999999999999999999999999999995
+dqsub923 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234564 -> 99.99999999999999999999999999999996
+dqsub924 subtract 133.0000000000000000000000000123456 33.00000000000000000000000001234540 -> 100.0000000000000000000000000000002 Rounded
+dqsub925 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234560 -> 90.00000000000000000000000000000000
+dqsub926 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234561 -> 89.99999999999999999999999999999999
+dqsub927 subtract 133.0000000000000000000000000123456 43.00000000000000000000000001234566 -> 89.99999999999999999999999999999994
+dqsub928 subtract 101.0000000000000000000000000123456 91.00000000000000000000000001234566 -> 9.99999999999999999999999999999994
+dqsub929 subtract 101.0000000000000000000000000123456 99.00000000000000000000000001234566 -> 1.99999999999999999999999999999994
+
+-- more LHS swaps [were fixed]
+dqsub390 subtract '-56267E-10' 0 -> '-0.0000056267'
+dqsub391 subtract '-56267E-6' 0 -> '-0.056267'
+dqsub392 subtract '-56267E-5' 0 -> '-0.56267'
+dqsub393 subtract '-56267E-4' 0 -> '-5.6267'
+dqsub394 subtract '-56267E-3' 0 -> '-56.267'
+dqsub395 subtract '-56267E-2' 0 -> '-562.67'
+dqsub396 subtract '-56267E-1' 0 -> '-5626.7'
+dqsub397 subtract '-56267E-0' 0 -> '-56267'
+dqsub398 subtract '-5E-10' 0 -> '-5E-10'
+dqsub399 subtract '-5E-7' 0 -> '-5E-7'
+dqsub400 subtract '-5E-6' 0 -> '-0.000005'
+dqsub401 subtract '-5E-5' 0 -> '-0.00005'
+dqsub402 subtract '-5E-4' 0 -> '-0.0005'
+dqsub403 subtract '-5E-1' 0 -> '-0.5'
+dqsub404 subtract '-5E0' 0 -> '-5'
+dqsub405 subtract '-5E1' 0 -> '-50'
+dqsub406 subtract '-5E5' 0 -> '-500000'
+dqsub407 subtract '-5E33' 0 -> '-5000000000000000000000000000000000'
+dqsub408 subtract '-5E34' 0 -> '-5.000000000000000000000000000000000E+34' Rounded
+dqsub409 subtract '-5E35' 0 -> '-5.000000000000000000000000000000000E+35' Rounded
+dqsub410 subtract '-5E36' 0 -> '-5.000000000000000000000000000000000E+36' Rounded
+dqsub411 subtract '-5E100' 0 -> '-5.000000000000000000000000000000000E+100' Rounded
+
+-- more RHS swaps [were fixed]
+dqsub420 subtract 0 '-56267E-10' -> '0.0000056267'
+dqsub421 subtract 0 '-56267E-6' -> '0.056267'
+dqsub422 subtract 0 '-56267E-5' -> '0.56267'
+dqsub423 subtract 0 '-56267E-4' -> '5.6267'
+dqsub424 subtract 0 '-56267E-3' -> '56.267'
+dqsub425 subtract 0 '-56267E-2' -> '562.67'
+dqsub426 subtract 0 '-56267E-1' -> '5626.7'
+dqsub427 subtract 0 '-56267E-0' -> '56267'
+dqsub428 subtract 0 '-5E-10' -> '5E-10'
+dqsub429 subtract 0 '-5E-7' -> '5E-7'
+dqsub430 subtract 0 '-5E-6' -> '0.000005'
+dqsub431 subtract 0 '-5E-5' -> '0.00005'
+dqsub432 subtract 0 '-5E-4' -> '0.0005'
+dqsub433 subtract 0 '-5E-1' -> '0.5'
+dqsub434 subtract 0 '-5E0' -> '5'
+dqsub435 subtract 0 '-5E1' -> '50'
+dqsub436 subtract 0 '-5E5' -> '500000'
+dqsub437 subtract 0 '-5E33' -> '5000000000000000000000000000000000'
+dqsub438 subtract 0 '-5E34' -> '5.000000000000000000000000000000000E+34' Rounded
+dqsub439 subtract 0 '-5E35' -> '5.000000000000000000000000000000000E+35' Rounded
+dqsub440 subtract 0 '-5E36' -> '5.000000000000000000000000000000000E+36' Rounded
+dqsub441 subtract 0 '-5E100' -> '5.000000000000000000000000000000000E+100' Rounded
+
+
+-- try borderline precision, with carries, etc.
+dqsub461 subtract '1E+16' '1' -> '9999999999999999'
+dqsub462 subtract '1E+12' '-1.111' -> '1000000000001.111'
+dqsub463 subtract '1.111' '-1E+12' -> '1000000000001.111'
+dqsub464 subtract '-1' '-1E+16' -> '9999999999999999'
+dqsub465 subtract '7E+15' '1' -> '6999999999999999'
+dqsub466 subtract '7E+12' '-1.111' -> '7000000000001.111'
+dqsub467 subtract '1.111' '-7E+12' -> '7000000000001.111'
+dqsub468 subtract '-1' '-7E+15' -> '6999999999999999'
+
+-- 1234567890123456 1234567890123456 1 23456789012345
+dqsub470 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555563' -> '1.000000000000000000000000000000001' Inexact Rounded
+dqsub471 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555562' -> '1.000000000000000000000000000000001' Inexact Rounded
+dqsub472 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555561' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub473 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555560' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub474 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555559' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub475 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555558' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub476 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555557' -> '1.000000000000000000000000000000000' Inexact Rounded
+dqsub477 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555556' -> '1.000000000000000000000000000000000' Rounded
+dqsub478 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555555' -> '0.9999999999999999999999999999999999'
+dqsub479 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555554' -> '0.9999999999999999999999999999999998'
+dqsub480 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555553' -> '0.9999999999999999999999999999999997'
+dqsub481 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555552' -> '0.9999999999999999999999999999999996'
+dqsub482 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555551' -> '0.9999999999999999999999999999999995'
+dqsub483 subtract '0.4444444444444444444444444444444444' '-0.5555555555555555555555555555555550' -> '0.9999999999999999999999999999999994'
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+dqsub500 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
+dqsub501 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub502 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub503 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub504 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub505 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub506 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub507 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub508 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub509 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub510 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub511 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub512 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub513 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub514 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub515 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub516 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
+dqsub517 subtract '1231234555555555555555555567456789' 1.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub518 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub519 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
+
+rounding: half_even
+dqsub520 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
+dqsub521 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub522 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub523 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub524 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub525 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub526 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub527 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456789' Inexact Rounded
+dqsub528 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub529 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub530 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub531 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub532 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub533 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub534 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub535 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub536 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
+dqsub537 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub538 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub539 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456788' Inexact Rounded
+-- critical few with even bottom digit...
+dqsub540 subtract '1231234555555555555555555567456788' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub541 subtract '1231234555555555555555555567456788' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub542 subtract '1231234555555555555555555567456788' 0.500000001 -> '1231234555555555555555555567456787' Inexact Rounded
+
+rounding: down
+dqsub550 subtract '1231234555555555555555555567456789' 0 -> '1231234555555555555555555567456789'
+dqsub551 subtract '1231234555555555555555555567456789' 0.000000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub552 subtract '1231234555555555555555555567456789' 0.000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub553 subtract '1231234555555555555555555567456789' 0.1 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub554 subtract '1231234555555555555555555567456789' 0.4 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub555 subtract '1231234555555555555555555567456789' 0.49 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub556 subtract '1231234555555555555555555567456789' 0.499999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub557 subtract '1231234555555555555555555567456789' 0.499999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub558 subtract '1231234555555555555555555567456789' 0.5 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub559 subtract '1231234555555555555555555567456789' 0.500000001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub560 subtract '1231234555555555555555555567456789' 0.500001 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub561 subtract '1231234555555555555555555567456789' 0.51 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub562 subtract '1231234555555555555555555567456789' 0.6 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub563 subtract '1231234555555555555555555567456789' 0.9 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub564 subtract '1231234555555555555555555567456789' 0.99999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub565 subtract '1231234555555555555555555567456789' 0.999999999 -> '1231234555555555555555555567456788' Inexact Rounded
+dqsub566 subtract '1231234555555555555555555567456789' 1 -> '1231234555555555555555555567456788'
+dqsub567 subtract '1231234555555555555555555567456789' 1.00000001 -> '1231234555555555555555555567456787' Inexact Rounded
+dqsub568 subtract '1231234555555555555555555567456789' 1.00001 -> '1231234555555555555555555567456787' Inexact Rounded
+dqsub569 subtract '1231234555555555555555555567456789' 1.1 -> '1231234555555555555555555567456787' Inexact Rounded
+
+-- symmetry...
+rounding: half_up
+dqsub600 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
+dqsub601 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub602 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub603 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub604 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub605 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub606 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub607 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub608 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub609 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub610 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub611 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub612 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub613 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub614 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub615 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub616 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
+dqsub617 subtract 1.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub618 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub619 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+
+rounding: half_even
+dqsub620 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
+dqsub621 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub622 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub623 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub624 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub625 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub626 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub627 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789' Inexact Rounded
+dqsub628 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub629 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub630 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub631 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub632 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub633 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub634 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub635 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub636 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
+dqsub637 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub638 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub639 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+-- critical few with even bottom digit...
+dqsub640 subtract 0.499999999 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub641 subtract 0.5 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub642 subtract 0.500000001 '1231234555555555555555555567456788' -> '-1231234555555555555555555567456787' Inexact Rounded
+
+rounding: down
+dqsub650 subtract 0 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456789'
+dqsub651 subtract 0.000000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub652 subtract 0.000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub653 subtract 0.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub654 subtract 0.4 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub655 subtract 0.49 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub656 subtract 0.499999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub657 subtract 0.499999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub658 subtract 0.5 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub659 subtract 0.500000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub660 subtract 0.500001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub661 subtract 0.51 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub662 subtract 0.6 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub663 subtract 0.9 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub664 subtract 0.99999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub665 subtract 0.999999999 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788' Inexact Rounded
+dqsub666 subtract 1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456788'
+dqsub667 subtract 1.00000001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
+dqsub668 subtract 1.00001 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
+dqsub669 subtract 1.1 '1231234555555555555555555567456789' -> '-1231234555555555555555555567456787' Inexact Rounded
+
+
+-- lots of leading zeros in intermediate result, and showing effects of
+-- input rounding would have affected the following
+rounding: half_up
+dqsub670 subtract '1234567456789' '1234567456788.1' -> 0.9
+dqsub671 subtract '1234567456789' '1234567456788.9' -> 0.1
+dqsub672 subtract '1234567456789' '1234567456789.1' -> -0.1
+dqsub673 subtract '1234567456789' '1234567456789.5' -> -0.5
+dqsub674 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+rounding: half_even
+dqsub680 subtract '1234567456789' '1234567456788.1' -> 0.9
+dqsub681 subtract '1234567456789' '1234567456788.9' -> 0.1
+dqsub682 subtract '1234567456789' '1234567456789.1' -> -0.1
+dqsub683 subtract '1234567456789' '1234567456789.5' -> -0.5
+dqsub684 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+dqsub685 subtract '1234567456788' '1234567456787.1' -> 0.9
+dqsub686 subtract '1234567456788' '1234567456787.9' -> 0.1
+dqsub687 subtract '1234567456788' '1234567456788.1' -> -0.1
+dqsub688 subtract '1234567456788' '1234567456788.5' -> -0.5
+dqsub689 subtract '1234567456788' '1234567456788.9' -> -0.9
+
+rounding: down
+dqsub690 subtract '1234567456789' '1234567456788.1' -> 0.9
+dqsub691 subtract '1234567456789' '1234567456788.9' -> 0.1
+dqsub692 subtract '1234567456789' '1234567456789.1' -> -0.1
+dqsub693 subtract '1234567456789' '1234567456789.5' -> -0.5
+dqsub694 subtract '1234567456789' '1234567456789.9' -> -0.9
+
+-- Specials
+dqsub780 subtract -Inf Inf -> -Infinity
+dqsub781 subtract -Inf 1000 -> -Infinity
+dqsub782 subtract -Inf 1 -> -Infinity
+dqsub783 subtract -Inf -0 -> -Infinity
+dqsub784 subtract -Inf -1 -> -Infinity
+dqsub785 subtract -Inf -1000 -> -Infinity
+dqsub787 subtract -1000 Inf -> -Infinity
+dqsub788 subtract -Inf Inf -> -Infinity
+dqsub789 subtract -1 Inf -> -Infinity
+dqsub790 subtract 0 Inf -> -Infinity
+dqsub791 subtract 1 Inf -> -Infinity
+dqsub792 subtract 1000 Inf -> -Infinity
+
+dqsub800 subtract Inf Inf -> NaN Invalid_operation
+dqsub801 subtract Inf 1000 -> Infinity
+dqsub802 subtract Inf 1 -> Infinity
+dqsub803 subtract Inf 0 -> Infinity
+dqsub804 subtract Inf -0 -> Infinity
+dqsub805 subtract Inf -1 -> Infinity
+dqsub806 subtract Inf -1000 -> Infinity
+dqsub807 subtract Inf -Inf -> Infinity
+dqsub808 subtract -1000 -Inf -> Infinity
+dqsub809 subtract -Inf -Inf -> NaN Invalid_operation
+dqsub810 subtract -1 -Inf -> Infinity
+dqsub811 subtract -0 -Inf -> Infinity
+dqsub812 subtract 0 -Inf -> Infinity
+dqsub813 subtract 1 -Inf -> Infinity
+dqsub814 subtract 1000 -Inf -> Infinity
+dqsub815 subtract Inf -Inf -> Infinity
+
+dqsub821 subtract NaN Inf -> NaN
+dqsub822 subtract -NaN 1000 -> -NaN
+dqsub823 subtract NaN 1 -> NaN
+dqsub824 subtract NaN 0 -> NaN
+dqsub825 subtract NaN -0 -> NaN
+dqsub826 subtract NaN -1 -> NaN
+dqsub827 subtract NaN -1000 -> NaN
+dqsub828 subtract NaN -Inf -> NaN
+dqsub829 subtract -NaN NaN -> -NaN
+dqsub830 subtract -Inf NaN -> NaN
+dqsub831 subtract -1000 NaN -> NaN
+dqsub832 subtract -1 NaN -> NaN
+dqsub833 subtract -0 NaN -> NaN
+dqsub834 subtract 0 NaN -> NaN
+dqsub835 subtract 1 NaN -> NaN
+dqsub836 subtract 1000 -NaN -> -NaN
+dqsub837 subtract Inf NaN -> NaN
+
+dqsub841 subtract sNaN Inf -> NaN Invalid_operation
+dqsub842 subtract -sNaN 1000 -> -NaN Invalid_operation
+dqsub843 subtract sNaN 1 -> NaN Invalid_operation
+dqsub844 subtract sNaN 0 -> NaN Invalid_operation
+dqsub845 subtract sNaN -0 -> NaN Invalid_operation
+dqsub846 subtract sNaN -1 -> NaN Invalid_operation
+dqsub847 subtract sNaN -1000 -> NaN Invalid_operation
+dqsub848 subtract sNaN NaN -> NaN Invalid_operation
+dqsub849 subtract sNaN sNaN -> NaN Invalid_operation
+dqsub850 subtract NaN sNaN -> NaN Invalid_operation
+dqsub851 subtract -Inf -sNaN -> -NaN Invalid_operation
+dqsub852 subtract -1000 sNaN -> NaN Invalid_operation
+dqsub853 subtract -1 sNaN -> NaN Invalid_operation
+dqsub854 subtract -0 sNaN -> NaN Invalid_operation
+dqsub855 subtract 0 sNaN -> NaN Invalid_operation
+dqsub856 subtract 1 sNaN -> NaN Invalid_operation
+dqsub857 subtract 1000 sNaN -> NaN Invalid_operation
+dqsub858 subtract Inf sNaN -> NaN Invalid_operation
+dqsub859 subtract NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqsub861 subtract NaN01 -Inf -> NaN1
+dqsub862 subtract -NaN02 -1000 -> -NaN2
+dqsub863 subtract NaN03 1000 -> NaN3
+dqsub864 subtract NaN04 Inf -> NaN4
+dqsub865 subtract NaN05 NaN61 -> NaN5
+dqsub866 subtract -Inf -NaN71 -> -NaN71
+dqsub867 subtract -1000 NaN81 -> NaN81
+dqsub868 subtract 1000 NaN91 -> NaN91
+dqsub869 subtract Inf NaN101 -> NaN101
+dqsub871 subtract sNaN011 -Inf -> NaN11 Invalid_operation
+dqsub872 subtract sNaN012 -1000 -> NaN12 Invalid_operation
+dqsub873 subtract -sNaN013 1000 -> -NaN13 Invalid_operation
+dqsub874 subtract sNaN014 NaN171 -> NaN14 Invalid_operation
+dqsub875 subtract sNaN015 sNaN181 -> NaN15 Invalid_operation
+dqsub876 subtract NaN016 sNaN191 -> NaN191 Invalid_operation
+dqsub877 subtract -Inf sNaN201 -> NaN201 Invalid_operation
+dqsub878 subtract -1000 sNaN211 -> NaN211 Invalid_operation
+dqsub879 subtract 1000 -sNaN221 -> -NaN221 Invalid_operation
+dqsub880 subtract Inf sNaN231 -> NaN231 Invalid_operation
+dqsub881 subtract NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- edge case spills
+dqsub901 subtract 2.E-3 1.002 -> -1.000
+dqsub902 subtract 2.0E-3 1.002 -> -1.0000
+dqsub903 subtract 2.00E-3 1.0020 -> -1.00000
+dqsub904 subtract 2.000E-3 1.00200 -> -1.000000
+dqsub905 subtract 2.0000E-3 1.002000 -> -1.0000000
+dqsub906 subtract 2.00000E-3 1.0020000 -> -1.00000000
+dqsub907 subtract 2.000000E-3 1.00200000 -> -1.000000000
+dqsub908 subtract 2.0000000E-3 1.002000000 -> -1.0000000000
+
+-- subnormals and overflows covered under Add
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+dqsub1125 subtract 130E-2 120E-2 -> 0.10
+dqsub1126 subtract 130E-2 12E-1 -> 0.10
+dqsub1127 subtract 130E-2 1E0 -> 0.30
+dqsub1128 subtract 1E2 1E4 -> -9.9E+3
+
+-- Null tests
+dqsub9990 subtract 10 # -> NaN Invalid_operation
+dqsub9991 subtract # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dqToIntegral.decTest b/Lib/test/decimaltestdata/dqToIntegral.decTest
index eb12387eab..3055de572d 100644
--- a/Lib/test/decimaltestdata/dqToIntegral.decTest
+++ b/Lib/test/decimaltestdata/dqToIntegral.decTest
@@ -1,257 +1,257 @@
-------------------------------------------------------------------------
--- dqToIntegral.decTest -- round Quad to integral value --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests tests the extended specification 'round-to-integral
--- value-exact' operations (from IEEE 854, later modified in 754r).
--- All non-zero results are defined as being those from either copy or
--- quantize, so those are assumed to have been tested extensively
--- elsewhere; the tests here are for integrity, rounding mode, etc.
--- Also, it is assumed the test harness will use these tests for both
--- ToIntegralExact (which does set Inexact) and the fixed-name
--- functions (which do not set Inexact).
-
--- Note that decNumber implements an earlier definition of toIntegral
--- which never sets Inexact; the decTest operator for that is called
--- 'tointegral' instead of 'tointegralx'.
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
-dqintx001 tointegralx 0 -> 0
-dqintx002 tointegralx 0.0 -> 0
-dqintx003 tointegralx 0.1 -> 0 Inexact Rounded
-dqintx004 tointegralx 0.2 -> 0 Inexact Rounded
-dqintx005 tointegralx 0.3 -> 0 Inexact Rounded
-dqintx006 tointegralx 0.4 -> 0 Inexact Rounded
-dqintx007 tointegralx 0.5 -> 0 Inexact Rounded
-dqintx008 tointegralx 0.6 -> 1 Inexact Rounded
-dqintx009 tointegralx 0.7 -> 1 Inexact Rounded
-dqintx010 tointegralx 0.8 -> 1 Inexact Rounded
-dqintx011 tointegralx 0.9 -> 1 Inexact Rounded
-dqintx012 tointegralx 1 -> 1
-dqintx013 tointegralx 1.0 -> 1 Rounded
-dqintx014 tointegralx 1.1 -> 1 Inexact Rounded
-dqintx015 tointegralx 1.2 -> 1 Inexact Rounded
-dqintx016 tointegralx 1.3 -> 1 Inexact Rounded
-dqintx017 tointegralx 1.4 -> 1 Inexact Rounded
-dqintx018 tointegralx 1.5 -> 2 Inexact Rounded
-dqintx019 tointegralx 1.6 -> 2 Inexact Rounded
-dqintx020 tointegralx 1.7 -> 2 Inexact Rounded
-dqintx021 tointegralx 1.8 -> 2 Inexact Rounded
-dqintx022 tointegralx 1.9 -> 2 Inexact Rounded
--- negatives
-dqintx031 tointegralx -0 -> -0
-dqintx032 tointegralx -0.0 -> -0
-dqintx033 tointegralx -0.1 -> -0 Inexact Rounded
-dqintx034 tointegralx -0.2 -> -0 Inexact Rounded
-dqintx035 tointegralx -0.3 -> -0 Inexact Rounded
-dqintx036 tointegralx -0.4 -> -0 Inexact Rounded
-dqintx037 tointegralx -0.5 -> -0 Inexact Rounded
-dqintx038 tointegralx -0.6 -> -1 Inexact Rounded
-dqintx039 tointegralx -0.7 -> -1 Inexact Rounded
-dqintx040 tointegralx -0.8 -> -1 Inexact Rounded
-dqintx041 tointegralx -0.9 -> -1 Inexact Rounded
-dqintx042 tointegralx -1 -> -1
-dqintx043 tointegralx -1.0 -> -1 Rounded
-dqintx044 tointegralx -1.1 -> -1 Inexact Rounded
-dqintx045 tointegralx -1.2 -> -1 Inexact Rounded
-dqintx046 tointegralx -1.3 -> -1 Inexact Rounded
-dqintx047 tointegralx -1.4 -> -1 Inexact Rounded
-dqintx048 tointegralx -1.5 -> -2 Inexact Rounded
-dqintx049 tointegralx -1.6 -> -2 Inexact Rounded
-dqintx050 tointegralx -1.7 -> -2 Inexact Rounded
-dqintx051 tointegralx -1.8 -> -2 Inexact Rounded
-dqintx052 tointegralx -1.9 -> -2 Inexact Rounded
--- next two would be NaN using quantize(x, 0)
-dqintx053 tointegralx 10E+60 -> 1.0E+61
-dqintx054 tointegralx -10E+60 -> -1.0E+61
-
--- numbers around precision
-dqintx060 tointegralx '56267E-17' -> '0' Inexact Rounded
-dqintx061 tointegralx '56267E-5' -> '1' Inexact Rounded
-dqintx062 tointegralx '56267E-2' -> '563' Inexact Rounded
-dqintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
-dqintx065 tointegralx '56267E-0' -> '56267'
-dqintx066 tointegralx '56267E+0' -> '56267'
-dqintx067 tointegralx '56267E+1' -> '5.6267E+5'
-dqintx068 tointegralx '56267E+9' -> '5.6267E+13'
-dqintx069 tointegralx '56267E+10' -> '5.6267E+14'
-dqintx070 tointegralx '56267E+11' -> '5.6267E+15'
-dqintx071 tointegralx '56267E+12' -> '5.6267E+16'
-dqintx072 tointegralx '56267E+13' -> '5.6267E+17'
-dqintx073 tointegralx '1.23E+96' -> '1.23E+96'
-dqintx074 tointegralx '1.23E+6144' -> #47ffd300000000000000000000000000 Clamped
-
-dqintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
-dqintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
-dqintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
-dqintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
-dqintx085 tointegralx '-56267E-0' -> '-56267'
-dqintx086 tointegralx '-56267E+0' -> '-56267'
-dqintx087 tointegralx '-56267E+1' -> '-5.6267E+5'
-dqintx088 tointegralx '-56267E+9' -> '-5.6267E+13'
-dqintx089 tointegralx '-56267E+10' -> '-5.6267E+14'
-dqintx090 tointegralx '-56267E+11' -> '-5.6267E+15'
-dqintx091 tointegralx '-56267E+12' -> '-5.6267E+16'
-dqintx092 tointegralx '-56267E+13' -> '-5.6267E+17'
-dqintx093 tointegralx '-1.23E+96' -> '-1.23E+96'
-dqintx094 tointegralx '-1.23E+6144' -> #c7ffd300000000000000000000000000 Clamped
-
--- subnormal inputs
-dqintx100 tointegralx 1E-299 -> 0 Inexact Rounded
-dqintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded
-dqintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded
-dqintx103 tointegralx 0E-299 -> 0
-
--- specials and zeros
-dqintx120 tointegralx 'Inf' -> Infinity
-dqintx121 tointegralx '-Inf' -> -Infinity
-dqintx122 tointegralx NaN -> NaN
-dqintx123 tointegralx sNaN -> NaN Invalid_operation
-dqintx124 tointegralx 0 -> 0
-dqintx125 tointegralx -0 -> -0
-dqintx126 tointegralx 0.000 -> 0
-dqintx127 tointegralx 0.00 -> 0
-dqintx128 tointegralx 0.0 -> 0
-dqintx129 tointegralx 0 -> 0
-dqintx130 tointegralx 0E-3 -> 0
-dqintx131 tointegralx 0E-2 -> 0
-dqintx132 tointegralx 0E-1 -> 0
-dqintx133 tointegralx 0E-0 -> 0
-dqintx134 tointegralx 0E+1 -> 0E+1
-dqintx135 tointegralx 0E+2 -> 0E+2
-dqintx136 tointegralx 0E+3 -> 0E+3
-dqintx137 tointegralx 0E+4 -> 0E+4
-dqintx138 tointegralx 0E+5 -> 0E+5
-dqintx139 tointegralx -0.000 -> -0
-dqintx140 tointegralx -0.00 -> -0
-dqintx141 tointegralx -0.0 -> -0
-dqintx142 tointegralx -0 -> -0
-dqintx143 tointegralx -0E-3 -> -0
-dqintx144 tointegralx -0E-2 -> -0
-dqintx145 tointegralx -0E-1 -> -0
-dqintx146 tointegralx -0E-0 -> -0
-dqintx147 tointegralx -0E+1 -> -0E+1
-dqintx148 tointegralx -0E+2 -> -0E+2
-dqintx149 tointegralx -0E+3 -> -0E+3
-dqintx150 tointegralx -0E+4 -> -0E+4
-dqintx151 tointegralx -0E+5 -> -0E+5
--- propagating NaNs
-dqintx152 tointegralx NaN808 -> NaN808
-dqintx153 tointegralx sNaN080 -> NaN80 Invalid_operation
-dqintx154 tointegralx -NaN808 -> -NaN808
-dqintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
-dqintx156 tointegralx -NaN -> -NaN
-dqintx157 tointegralx -sNaN -> -NaN Invalid_operation
-
--- examples
-rounding: half_up
-dqintx200 tointegralx 2.1 -> 2 Inexact Rounded
-dqintx201 tointegralx 100 -> 100
-dqintx202 tointegralx 100.0 -> 100 Rounded
-dqintx203 tointegralx 101.5 -> 102 Inexact Rounded
-dqintx204 tointegralx -101.5 -> -102 Inexact Rounded
-dqintx205 tointegralx 10E+5 -> 1.0E+6
-dqintx206 tointegralx 7.89E+77 -> 7.89E+77
-dqintx207 tointegralx -Inf -> -Infinity
-
-
--- all rounding modes
-rounding: half_even
-dqintx210 tointegralx 55.5 -> 56 Inexact Rounded
-dqintx211 tointegralx 56.5 -> 56 Inexact Rounded
-dqintx212 tointegralx 57.5 -> 58 Inexact Rounded
-dqintx213 tointegralx -55.5 -> -56 Inexact Rounded
-dqintx214 tointegralx -56.5 -> -56 Inexact Rounded
-dqintx215 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_up
-
-dqintx220 tointegralx 55.5 -> 56 Inexact Rounded
-dqintx221 tointegralx 56.5 -> 57 Inexact Rounded
-dqintx222 tointegralx 57.5 -> 58 Inexact Rounded
-dqintx223 tointegralx -55.5 -> -56 Inexact Rounded
-dqintx224 tointegralx -56.5 -> -57 Inexact Rounded
-dqintx225 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_down
-
-dqintx230 tointegralx 55.5 -> 55 Inexact Rounded
-dqintx231 tointegralx 56.5 -> 56 Inexact Rounded
-dqintx232 tointegralx 57.5 -> 57 Inexact Rounded
-dqintx233 tointegralx -55.5 -> -55 Inexact Rounded
-dqintx234 tointegralx -56.5 -> -56 Inexact Rounded
-dqintx235 tointegralx -57.5 -> -57 Inexact Rounded
-
-rounding: up
-
-dqintx240 tointegralx 55.3 -> 56 Inexact Rounded
-dqintx241 tointegralx 56.3 -> 57 Inexact Rounded
-dqintx242 tointegralx 57.3 -> 58 Inexact Rounded
-dqintx243 tointegralx -55.3 -> -56 Inexact Rounded
-dqintx244 tointegralx -56.3 -> -57 Inexact Rounded
-dqintx245 tointegralx -57.3 -> -58 Inexact Rounded
-
-rounding: down
-
-dqintx250 tointegralx 55.7 -> 55 Inexact Rounded
-dqintx251 tointegralx 56.7 -> 56 Inexact Rounded
-dqintx252 tointegralx 57.7 -> 57 Inexact Rounded
-dqintx253 tointegralx -55.7 -> -55 Inexact Rounded
-dqintx254 tointegralx -56.7 -> -56 Inexact Rounded
-dqintx255 tointegralx -57.7 -> -57 Inexact Rounded
-
-rounding: ceiling
-
-dqintx260 tointegralx 55.3 -> 56 Inexact Rounded
-dqintx261 tointegralx 56.3 -> 57 Inexact Rounded
-dqintx262 tointegralx 57.3 -> 58 Inexact Rounded
-dqintx263 tointegralx -55.3 -> -55 Inexact Rounded
-dqintx264 tointegralx -56.3 -> -56 Inexact Rounded
-dqintx265 tointegralx -57.3 -> -57 Inexact Rounded
-
-rounding: floor
-
-dqintx270 tointegralx 55.7 -> 55 Inexact Rounded
-dqintx271 tointegralx 56.7 -> 56 Inexact Rounded
-dqintx272 tointegralx 57.7 -> 57 Inexact Rounded
-dqintx273 tointegralx -55.7 -> -56 Inexact Rounded
-dqintx274 tointegralx -56.7 -> -57 Inexact Rounded
-dqintx275 tointegralx -57.7 -> -58 Inexact Rounded
-
--- Int and uInt32 edge values for testing conversions
-dqintx300 tointegralx -2147483646 -> -2147483646
-dqintx301 tointegralx -2147483647 -> -2147483647
-dqintx302 tointegralx -2147483648 -> -2147483648
-dqintx303 tointegralx -2147483649 -> -2147483649
-dqintx304 tointegralx 2147483646 -> 2147483646
-dqintx305 tointegralx 2147483647 -> 2147483647
-dqintx306 tointegralx 2147483648 -> 2147483648
-dqintx307 tointegralx 2147483649 -> 2147483649
-dqintx308 tointegralx 4294967294 -> 4294967294
-dqintx309 tointegralx 4294967295 -> 4294967295
-dqintx310 tointegralx 4294967296 -> 4294967296
-dqintx311 tointegralx 4294967297 -> 4294967297
-
+------------------------------------------------------------------------
+-- dqToIntegral.decTest -- round Quad to integral value --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests tests the extended specification 'round-to-integral
+-- value-exact' operations (from IEEE 854, later modified in 754r).
+-- All non-zero results are defined as being those from either copy or
+-- quantize, so those are assumed to have been tested extensively
+-- elsewhere; the tests here are for integrity, rounding mode, etc.
+-- Also, it is assumed the test harness will use these tests for both
+-- ToIntegralExact (which does set Inexact) and the fixed-name
+-- functions (which do not set Inexact).
+
+-- Note that decNumber implements an earlier definition of toIntegral
+-- which never sets Inexact; the decTest operator for that is called
+-- 'tointegral' instead of 'tointegralx'.
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+dqintx001 tointegralx 0 -> 0
+dqintx002 tointegralx 0.0 -> 0
+dqintx003 tointegralx 0.1 -> 0 Inexact Rounded
+dqintx004 tointegralx 0.2 -> 0 Inexact Rounded
+dqintx005 tointegralx 0.3 -> 0 Inexact Rounded
+dqintx006 tointegralx 0.4 -> 0 Inexact Rounded
+dqintx007 tointegralx 0.5 -> 0 Inexact Rounded
+dqintx008 tointegralx 0.6 -> 1 Inexact Rounded
+dqintx009 tointegralx 0.7 -> 1 Inexact Rounded
+dqintx010 tointegralx 0.8 -> 1 Inexact Rounded
+dqintx011 tointegralx 0.9 -> 1 Inexact Rounded
+dqintx012 tointegralx 1 -> 1
+dqintx013 tointegralx 1.0 -> 1 Rounded
+dqintx014 tointegralx 1.1 -> 1 Inexact Rounded
+dqintx015 tointegralx 1.2 -> 1 Inexact Rounded
+dqintx016 tointegralx 1.3 -> 1 Inexact Rounded
+dqintx017 tointegralx 1.4 -> 1 Inexact Rounded
+dqintx018 tointegralx 1.5 -> 2 Inexact Rounded
+dqintx019 tointegralx 1.6 -> 2 Inexact Rounded
+dqintx020 tointegralx 1.7 -> 2 Inexact Rounded
+dqintx021 tointegralx 1.8 -> 2 Inexact Rounded
+dqintx022 tointegralx 1.9 -> 2 Inexact Rounded
+-- negatives
+dqintx031 tointegralx -0 -> -0
+dqintx032 tointegralx -0.0 -> -0
+dqintx033 tointegralx -0.1 -> -0 Inexact Rounded
+dqintx034 tointegralx -0.2 -> -0 Inexact Rounded
+dqintx035 tointegralx -0.3 -> -0 Inexact Rounded
+dqintx036 tointegralx -0.4 -> -0 Inexact Rounded
+dqintx037 tointegralx -0.5 -> -0 Inexact Rounded
+dqintx038 tointegralx -0.6 -> -1 Inexact Rounded
+dqintx039 tointegralx -0.7 -> -1 Inexact Rounded
+dqintx040 tointegralx -0.8 -> -1 Inexact Rounded
+dqintx041 tointegralx -0.9 -> -1 Inexact Rounded
+dqintx042 tointegralx -1 -> -1
+dqintx043 tointegralx -1.0 -> -1 Rounded
+dqintx044 tointegralx -1.1 -> -1 Inexact Rounded
+dqintx045 tointegralx -1.2 -> -1 Inexact Rounded
+dqintx046 tointegralx -1.3 -> -1 Inexact Rounded
+dqintx047 tointegralx -1.4 -> -1 Inexact Rounded
+dqintx048 tointegralx -1.5 -> -2 Inexact Rounded
+dqintx049 tointegralx -1.6 -> -2 Inexact Rounded
+dqintx050 tointegralx -1.7 -> -2 Inexact Rounded
+dqintx051 tointegralx -1.8 -> -2 Inexact Rounded
+dqintx052 tointegralx -1.9 -> -2 Inexact Rounded
+-- next two would be NaN using quantize(x, 0)
+dqintx053 tointegralx 10E+60 -> 1.0E+61
+dqintx054 tointegralx -10E+60 -> -1.0E+61
+
+-- numbers around precision
+dqintx060 tointegralx '56267E-17' -> '0' Inexact Rounded
+dqintx061 tointegralx '56267E-5' -> '1' Inexact Rounded
+dqintx062 tointegralx '56267E-2' -> '563' Inexact Rounded
+dqintx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
+dqintx065 tointegralx '56267E-0' -> '56267'
+dqintx066 tointegralx '56267E+0' -> '56267'
+dqintx067 tointegralx '56267E+1' -> '5.6267E+5'
+dqintx068 tointegralx '56267E+9' -> '5.6267E+13'
+dqintx069 tointegralx '56267E+10' -> '5.6267E+14'
+dqintx070 tointegralx '56267E+11' -> '5.6267E+15'
+dqintx071 tointegralx '56267E+12' -> '5.6267E+16'
+dqintx072 tointegralx '56267E+13' -> '5.6267E+17'
+dqintx073 tointegralx '1.23E+96' -> '1.23E+96'
+dqintx074 tointegralx '1.23E+6144' -> #47ffd300000000000000000000000000 Clamped
+
+dqintx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
+dqintx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
+dqintx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
+dqintx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
+dqintx085 tointegralx '-56267E-0' -> '-56267'
+dqintx086 tointegralx '-56267E+0' -> '-56267'
+dqintx087 tointegralx '-56267E+1' -> '-5.6267E+5'
+dqintx088 tointegralx '-56267E+9' -> '-5.6267E+13'
+dqintx089 tointegralx '-56267E+10' -> '-5.6267E+14'
+dqintx090 tointegralx '-56267E+11' -> '-5.6267E+15'
+dqintx091 tointegralx '-56267E+12' -> '-5.6267E+16'
+dqintx092 tointegralx '-56267E+13' -> '-5.6267E+17'
+dqintx093 tointegralx '-1.23E+96' -> '-1.23E+96'
+dqintx094 tointegralx '-1.23E+6144' -> #c7ffd300000000000000000000000000 Clamped
+
+-- subnormal inputs
+dqintx100 tointegralx 1E-299 -> 0 Inexact Rounded
+dqintx101 tointegralx 0.1E-299 -> 0 Inexact Rounded
+dqintx102 tointegralx 0.01E-299 -> 0 Inexact Rounded
+dqintx103 tointegralx 0E-299 -> 0
+
+-- specials and zeros
+dqintx120 tointegralx 'Inf' -> Infinity
+dqintx121 tointegralx '-Inf' -> -Infinity
+dqintx122 tointegralx NaN -> NaN
+dqintx123 tointegralx sNaN -> NaN Invalid_operation
+dqintx124 tointegralx 0 -> 0
+dqintx125 tointegralx -0 -> -0
+dqintx126 tointegralx 0.000 -> 0
+dqintx127 tointegralx 0.00 -> 0
+dqintx128 tointegralx 0.0 -> 0
+dqintx129 tointegralx 0 -> 0
+dqintx130 tointegralx 0E-3 -> 0
+dqintx131 tointegralx 0E-2 -> 0
+dqintx132 tointegralx 0E-1 -> 0
+dqintx133 tointegralx 0E-0 -> 0
+dqintx134 tointegralx 0E+1 -> 0E+1
+dqintx135 tointegralx 0E+2 -> 0E+2
+dqintx136 tointegralx 0E+3 -> 0E+3
+dqintx137 tointegralx 0E+4 -> 0E+4
+dqintx138 tointegralx 0E+5 -> 0E+5
+dqintx139 tointegralx -0.000 -> -0
+dqintx140 tointegralx -0.00 -> -0
+dqintx141 tointegralx -0.0 -> -0
+dqintx142 tointegralx -0 -> -0
+dqintx143 tointegralx -0E-3 -> -0
+dqintx144 tointegralx -0E-2 -> -0
+dqintx145 tointegralx -0E-1 -> -0
+dqintx146 tointegralx -0E-0 -> -0
+dqintx147 tointegralx -0E+1 -> -0E+1
+dqintx148 tointegralx -0E+2 -> -0E+2
+dqintx149 tointegralx -0E+3 -> -0E+3
+dqintx150 tointegralx -0E+4 -> -0E+4
+dqintx151 tointegralx -0E+5 -> -0E+5
+-- propagating NaNs
+dqintx152 tointegralx NaN808 -> NaN808
+dqintx153 tointegralx sNaN080 -> NaN80 Invalid_operation
+dqintx154 tointegralx -NaN808 -> -NaN808
+dqintx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
+dqintx156 tointegralx -NaN -> -NaN
+dqintx157 tointegralx -sNaN -> -NaN Invalid_operation
+
+-- examples
+rounding: half_up
+dqintx200 tointegralx 2.1 -> 2 Inexact Rounded
+dqintx201 tointegralx 100 -> 100
+dqintx202 tointegralx 100.0 -> 100 Rounded
+dqintx203 tointegralx 101.5 -> 102 Inexact Rounded
+dqintx204 tointegralx -101.5 -> -102 Inexact Rounded
+dqintx205 tointegralx 10E+5 -> 1.0E+6
+dqintx206 tointegralx 7.89E+77 -> 7.89E+77
+dqintx207 tointegralx -Inf -> -Infinity
+
+
+-- all rounding modes
+rounding: half_even
+dqintx210 tointegralx 55.5 -> 56 Inexact Rounded
+dqintx211 tointegralx 56.5 -> 56 Inexact Rounded
+dqintx212 tointegralx 57.5 -> 58 Inexact Rounded
+dqintx213 tointegralx -55.5 -> -56 Inexact Rounded
+dqintx214 tointegralx -56.5 -> -56 Inexact Rounded
+dqintx215 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_up
+
+dqintx220 tointegralx 55.5 -> 56 Inexact Rounded
+dqintx221 tointegralx 56.5 -> 57 Inexact Rounded
+dqintx222 tointegralx 57.5 -> 58 Inexact Rounded
+dqintx223 tointegralx -55.5 -> -56 Inexact Rounded
+dqintx224 tointegralx -56.5 -> -57 Inexact Rounded
+dqintx225 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_down
+
+dqintx230 tointegralx 55.5 -> 55 Inexact Rounded
+dqintx231 tointegralx 56.5 -> 56 Inexact Rounded
+dqintx232 tointegralx 57.5 -> 57 Inexact Rounded
+dqintx233 tointegralx -55.5 -> -55 Inexact Rounded
+dqintx234 tointegralx -56.5 -> -56 Inexact Rounded
+dqintx235 tointegralx -57.5 -> -57 Inexact Rounded
+
+rounding: up
+
+dqintx240 tointegralx 55.3 -> 56 Inexact Rounded
+dqintx241 tointegralx 56.3 -> 57 Inexact Rounded
+dqintx242 tointegralx 57.3 -> 58 Inexact Rounded
+dqintx243 tointegralx -55.3 -> -56 Inexact Rounded
+dqintx244 tointegralx -56.3 -> -57 Inexact Rounded
+dqintx245 tointegralx -57.3 -> -58 Inexact Rounded
+
+rounding: down
+
+dqintx250 tointegralx 55.7 -> 55 Inexact Rounded
+dqintx251 tointegralx 56.7 -> 56 Inexact Rounded
+dqintx252 tointegralx 57.7 -> 57 Inexact Rounded
+dqintx253 tointegralx -55.7 -> -55 Inexact Rounded
+dqintx254 tointegralx -56.7 -> -56 Inexact Rounded
+dqintx255 tointegralx -57.7 -> -57 Inexact Rounded
+
+rounding: ceiling
+
+dqintx260 tointegralx 55.3 -> 56 Inexact Rounded
+dqintx261 tointegralx 56.3 -> 57 Inexact Rounded
+dqintx262 tointegralx 57.3 -> 58 Inexact Rounded
+dqintx263 tointegralx -55.3 -> -55 Inexact Rounded
+dqintx264 tointegralx -56.3 -> -56 Inexact Rounded
+dqintx265 tointegralx -57.3 -> -57 Inexact Rounded
+
+rounding: floor
+
+dqintx270 tointegralx 55.7 -> 55 Inexact Rounded
+dqintx271 tointegralx 56.7 -> 56 Inexact Rounded
+dqintx272 tointegralx 57.7 -> 57 Inexact Rounded
+dqintx273 tointegralx -55.7 -> -56 Inexact Rounded
+dqintx274 tointegralx -56.7 -> -57 Inexact Rounded
+dqintx275 tointegralx -57.7 -> -58 Inexact Rounded
+
+-- Int and uInt32 edge values for testing conversions
+dqintx300 tointegralx -2147483646 -> -2147483646
+dqintx301 tointegralx -2147483647 -> -2147483647
+dqintx302 tointegralx -2147483648 -> -2147483648
+dqintx303 tointegralx -2147483649 -> -2147483649
+dqintx304 tointegralx 2147483646 -> 2147483646
+dqintx305 tointegralx 2147483647 -> 2147483647
+dqintx306 tointegralx 2147483648 -> 2147483648
+dqintx307 tointegralx 2147483649 -> 2147483649
+dqintx308 tointegralx 4294967294 -> 4294967294
+dqintx309 tointegralx 4294967295 -> 4294967295
+dqintx310 tointegralx 4294967296 -> 4294967296
+dqintx311 tointegralx 4294967297 -> 4294967297
+
diff --git a/Lib/test/decimaltestdata/dqXor.decTest b/Lib/test/decimaltestdata/dqXor.decTest
index fbb32e441b..2216e9ebf8 100644
--- a/Lib/test/decimaltestdata/dqXor.decTest
+++ b/Lib/test/decimaltestdata/dqXor.decTest
@@ -1,410 +1,410 @@
-------------------------------------------------------------------------
--- dqXor.decTest -- digitwise logical XOR for decQuads --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-clamp: 1
-precision: 34
-maxExponent: 6144
-minExponent: -6143
-rounding: half_even
-
--- Sanity check (truth table)
-dqxor001 xor 0 0 -> 0
-dqxor002 xor 0 1 -> 1
-dqxor003 xor 1 0 -> 1
-dqxor004 xor 1 1 -> 0
-dqxor005 xor 1100 1010 -> 110
--- and at msd and msd-1
-dqxor006 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqxor007 xor 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqxor008 xor 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000
-dqxor009 xor 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 0
-dqxor010 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
-dqxor011 xor 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
-dqxor012 xor 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000
-dqxor013 xor 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 0
-
--- Various lengths
--- 1234567890123456789012345678901234
-dqxor601 xor 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000000
-dqxor602 xor 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000000
-dqxor603 xor 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000000
-dqxor604 xor 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000
-dqxor605 xor 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000
-dqxor606 xor 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000
-dqxor607 xor 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000
-dqxor608 xor 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000
-dqxor609 xor 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000
-dqxor610 xor 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000
-dqxor611 xor 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000
-dqxor612 xor 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000
-dqxor613 xor 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000
-dqxor614 xor 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000
-dqxor615 xor 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000
-dqxor616 xor 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000
-dqxor617 xor 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 100000000000000000
-dqxor618 xor 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 10000000000000000
-dqxor619 xor 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1000000000000000
-dqxor620 xor 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 100000000000000
-dqxor621 xor 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 10000000000000
-dqxor622 xor 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1000000000000
-dqxor623 xor 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 100000000000
-dqxor624 xor 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 10000000000
-dqxor625 xor 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1000000000
-dqxor626 xor 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 100000000
-dqxor627 xor 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 10000000
-dqxor628 xor 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1000000
-dqxor629 xor 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 100000
-dqxor630 xor 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 10000
-dqxor631 xor 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1000
-dqxor632 xor 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 100
-dqxor633 xor 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 10
-dqxor634 xor 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1
-
-dqxor641 xor 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
-dqxor642 xor 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 100000000000000000000000000000000
-dqxor643 xor 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 10000000000000000000000000000000
-dqxor644 xor 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1000000000000000000000000000000
-dqxor645 xor 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 100000000000000000000000000000
-dqxor646 xor 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 10000000000000000000000000000
-dqxor647 xor 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1000000000000000000000000000
-dqxor648 xor 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 100000000000000000000000000
-dqxor649 xor 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 10000000000000000000000000
-dqxor650 xor 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1000000000000000000000000
-dqxor651 xor 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 100000000000000000000000
-dqxor652 xor 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 10000000000000000000000
-dqxor653 xor 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1000000000000000000000
-dqxor654 xor 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 100000000000000000000
-dqxor655 xor 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 10000000000000000000
-dqxor656 xor 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1000000000000000000
-dqxor657 xor 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 100000000000000000
-dqxor658 xor 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 10000000000000000
-dqxor659 xor 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1000000000000000
-dqxor660 xor 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 100000000000000
-dqxor661 xor 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 10000000000000
-dqxor662 xor 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1000000000000
-dqxor663 xor 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 100000000000
-dqxor664 xor 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 10000000000
-dqxor665 xor 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1000000000
-dqxor666 xor 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 100000000
-dqxor667 xor 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 10000000
-dqxor668 xor 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1000000
-dqxor669 xor 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 100000
-dqxor670 xor 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 10000
-dqxor671 xor 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1000
-dqxor672 xor 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 100
-dqxor673 xor 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 10
-dqxor674 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1
-dqxor675 xor 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1000000000000000000000000000000001
-dqxor676 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1
-
-
-dqxor021 xor 1111111110000000 1111111110000000 -> 0
-dqxor022 xor 111111110000000 111111110000000 -> 0
-dqxor023 xor 11111110000000 11111110000000 -> 0
-dqxor024 xor 1111110000000 1111110000000 -> 0
-dqxor025 xor 111110000000 111110000000 -> 0
-dqxor026 xor 11110000000 11110000000 -> 0
-dqxor027 xor 1110000000 1110000000 -> 0
-dqxor028 xor 110000000 110000000 -> 0
-dqxor029 xor 10000000 10000000 -> 0
-dqxor030 xor 1000000 1000000 -> 0
-dqxor031 xor 100000 100000 -> 0
-dqxor032 xor 10000 10000 -> 0
-dqxor033 xor 1000 1000 -> 0
-dqxor034 xor 100 100 -> 0
-dqxor035 xor 10 10 -> 0
-dqxor036 xor 1 1 -> 0
-
-dqxor040 xor 111111111 111111111111 -> 111000000000
-dqxor041 xor 11111111 111111111111 -> 111100000000
-dqxor042 xor 11111111 111111111 -> 100000000
-dqxor043 xor 1111111 100000010 -> 101111101
-dqxor044 xor 111111 100000100 -> 100111011
-dqxor045 xor 11111 100001000 -> 100010111
-dqxor046 xor 1111 100010000 -> 100011111
-dqxor047 xor 111 100100000 -> 100100111
-dqxor048 xor 11 101000000 -> 101000011
-dqxor049 xor 1 110000000 -> 110000001
-
-dqxor050 xor 1111111111 1 -> 1111111110
-dqxor051 xor 111111111 1 -> 111111110
-dqxor052 xor 11111111 1 -> 11111110
-dqxor053 xor 1111111 1 -> 1111110
-dqxor054 xor 111111 1 -> 111110
-dqxor055 xor 11111 1 -> 11110
-dqxor056 xor 1111 1 -> 1110
-dqxor057 xor 111 1 -> 110
-dqxor058 xor 11 1 -> 10
-dqxor059 xor 1 1 -> 0
-
-dqxor060 xor 1111111111 0 -> 1111111111
-dqxor061 xor 111111111 0 -> 111111111
-dqxor062 xor 11111111 0 -> 11111111
-dqxor063 xor 1111111 0 -> 1111111
-dqxor064 xor 111111 0 -> 111111
-dqxor065 xor 11111 0 -> 11111
-dqxor066 xor 1111 0 -> 1111
-dqxor067 xor 111 0 -> 111
-dqxor068 xor 11 0 -> 11
-dqxor069 xor 1 0 -> 1
-
-dqxor070 xor 1 1111111111 -> 1111111110
-dqxor071 xor 1 111111111 -> 111111110
-dqxor072 xor 1 11111111 -> 11111110
-dqxor073 xor 1 1111111 -> 1111110
-dqxor074 xor 1 111111 -> 111110
-dqxor075 xor 1 11111 -> 11110
-dqxor076 xor 1 1111 -> 1110
-dqxor077 xor 1 111 -> 110
-dqxor078 xor 1 11 -> 10
-dqxor079 xor 1 1 -> 0
-
-dqxor080 xor 0 1111111111 -> 1111111111
-dqxor081 xor 0 111111111 -> 111111111
-dqxor082 xor 0 11111111 -> 11111111
-dqxor083 xor 0 1111111 -> 1111111
-dqxor084 xor 0 111111 -> 111111
-dqxor085 xor 0 11111 -> 11111
-dqxor086 xor 0 1111 -> 1111
-dqxor087 xor 0 111 -> 111
-dqxor088 xor 0 11 -> 11
-dqxor089 xor 0 1 -> 1
-
-dqxor090 xor 011111111 111101111 -> 100010000
-dqxor091 xor 101111111 111101111 -> 10010000
-dqxor092 xor 110111111 111101111 -> 1010000
-dqxor093 xor 111011111 111101111 -> 110000
-dqxor094 xor 111101111 111101111 -> 0
-dqxor095 xor 111110111 111101111 -> 11000
-dqxor096 xor 111111011 111101111 -> 10100
-dqxor097 xor 111111101 111101111 -> 10010
-dqxor098 xor 111111110 111101111 -> 10001
-
-dqxor100 xor 111101111 011111111 -> 100010000
-dqxor101 xor 111101111 101111111 -> 10010000
-dqxor102 xor 111101111 110111111 -> 1010000
-dqxor103 xor 111101111 111011111 -> 110000
-dqxor104 xor 111101111 111101111 -> 0
-dqxor105 xor 111101111 111110111 -> 11000
-dqxor106 xor 111101111 111111011 -> 10100
-dqxor107 xor 111101111 111111101 -> 10010
-dqxor108 xor 111101111 111111110 -> 10001
-
--- non-0/1 should not be accepted, nor should signs
-dqxor220 xor 111111112 111111111 -> NaN Invalid_operation
-dqxor221 xor 333333333 333333333 -> NaN Invalid_operation
-dqxor222 xor 555555555 555555555 -> NaN Invalid_operation
-dqxor223 xor 777777777 777777777 -> NaN Invalid_operation
-dqxor224 xor 999999999 999999999 -> NaN Invalid_operation
-dqxor225 xor 222222222 999999999 -> NaN Invalid_operation
-dqxor226 xor 444444444 999999999 -> NaN Invalid_operation
-dqxor227 xor 666666666 999999999 -> NaN Invalid_operation
-dqxor228 xor 888888888 999999999 -> NaN Invalid_operation
-dqxor229 xor 999999999 222222222 -> NaN Invalid_operation
-dqxor230 xor 999999999 444444444 -> NaN Invalid_operation
-dqxor231 xor 999999999 666666666 -> NaN Invalid_operation
-dqxor232 xor 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-dqxor240 xor 567468689 -934981942 -> NaN Invalid_operation
-dqxor241 xor 567367689 934981942 -> NaN Invalid_operation
-dqxor242 xor -631917772 -706014634 -> NaN Invalid_operation
-dqxor243 xor -756253257 138579234 -> NaN Invalid_operation
-dqxor244 xor 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-dqxor250 xor 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor251 xor 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor252 xor 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor253 xor 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor254 xor 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor255 xor 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor256 xor 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor257 xor 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor258 xor 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor259 xor 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor260 xor 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor261 xor 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor262 xor 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor263 xor 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor264 xor 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
-dqxor265 xor 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
--- test MSD-1
-dqxor270 xor 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
-dqxor271 xor 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
-dqxor272 xor 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
-dqxor273 xor 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
-dqxor274 xor 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
-dqxor275 xor 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
-dqxor276 xor 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
-dqxor277 xor 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
--- test LSD
-dqxor280 xor 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
-dqxor281 xor 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
-dqxor282 xor 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
-dqxor283 xor 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
-dqxor284 xor 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
-dqxor285 xor 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
-dqxor286 xor 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
-dqxor287 xor 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
--- test Middie
-dqxor288 xor 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
-dqxor289 xor 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
-dqxor290 xor 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
-dqxor291 xor 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
-dqxor292 xor 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
-dqxor293 xor 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
-dqxor294 xor 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
-dqxor295 xor 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
--- signs
-dqxor296 xor -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
-dqxor297 xor -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
-dqxor298 xor 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
-dqxor299 xor 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001001001001001001000010000100
-
--- Nmax, Nmin, Ntiny-like
-dqxor331 xor 2 9.99999999E+999 -> NaN Invalid_operation
-dqxor332 xor 3 1E-999 -> NaN Invalid_operation
-dqxor333 xor 4 1.00000000E-2821 -> NaN Invalid_operation
-dqxor334 xor 5 1E-900 -> NaN Invalid_operation
-dqxor335 xor 6 -1E-900 -> NaN Invalid_operation
-dqxor336 xor 7 -1.00000000E-999 -> NaN Invalid_operation
-dqxor337 xor 8 -1E-999 -> NaN Invalid_operation
-dqxor338 xor 9 -9.99999999E+999 -> NaN Invalid_operation
-dqxor341 xor 9.99999999E+999 -18 -> NaN Invalid_operation
-dqxor342 xor 1E-999 01 -> NaN Invalid_operation
-dqxor343 xor 1.00000000E-999 -18 -> NaN Invalid_operation
-dqxor344 xor 1E-908 18 -> NaN Invalid_operation
-dqxor345 xor -1E-907 -10 -> NaN Invalid_operation
-dqxor346 xor -1.00000000E-999 18 -> NaN Invalid_operation
-dqxor347 xor -1E-999 10 -> NaN Invalid_operation
-dqxor348 xor -9.99999999E+2991 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-dqxor361 xor 1.0 1 -> NaN Invalid_operation
-dqxor362 xor 1E+1 1 -> NaN Invalid_operation
-dqxor363 xor 0.0 1 -> NaN Invalid_operation
-dqxor364 xor 0E+1 1 -> NaN Invalid_operation
-dqxor365 xor 9.9 1 -> NaN Invalid_operation
-dqxor366 xor 9E+1 1 -> NaN Invalid_operation
-dqxor371 xor 0 1.0 -> NaN Invalid_operation
-dqxor372 xor 0 1E+1 -> NaN Invalid_operation
-dqxor373 xor 0 0.0 -> NaN Invalid_operation
-dqxor374 xor 0 0E+1 -> NaN Invalid_operation
-dqxor375 xor 0 9.9 -> NaN Invalid_operation
-dqxor376 xor 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-dqxor780 xor -Inf -Inf -> NaN Invalid_operation
-dqxor781 xor -Inf -1000 -> NaN Invalid_operation
-dqxor782 xor -Inf -1 -> NaN Invalid_operation
-dqxor783 xor -Inf -0 -> NaN Invalid_operation
-dqxor784 xor -Inf 0 -> NaN Invalid_operation
-dqxor785 xor -Inf 1 -> NaN Invalid_operation
-dqxor786 xor -Inf 1000 -> NaN Invalid_operation
-dqxor787 xor -1000 -Inf -> NaN Invalid_operation
-dqxor788 xor -Inf -Inf -> NaN Invalid_operation
-dqxor789 xor -1 -Inf -> NaN Invalid_operation
-dqxor790 xor -0 -Inf -> NaN Invalid_operation
-dqxor791 xor 0 -Inf -> NaN Invalid_operation
-dqxor792 xor 1 -Inf -> NaN Invalid_operation
-dqxor793 xor 1000 -Inf -> NaN Invalid_operation
-dqxor794 xor Inf -Inf -> NaN Invalid_operation
-
-dqxor800 xor Inf -Inf -> NaN Invalid_operation
-dqxor801 xor Inf -1000 -> NaN Invalid_operation
-dqxor802 xor Inf -1 -> NaN Invalid_operation
-dqxor803 xor Inf -0 -> NaN Invalid_operation
-dqxor804 xor Inf 0 -> NaN Invalid_operation
-dqxor805 xor Inf 1 -> NaN Invalid_operation
-dqxor806 xor Inf 1000 -> NaN Invalid_operation
-dqxor807 xor Inf Inf -> NaN Invalid_operation
-dqxor808 xor -1000 Inf -> NaN Invalid_operation
-dqxor809 xor -Inf Inf -> NaN Invalid_operation
-dqxor810 xor -1 Inf -> NaN Invalid_operation
-dqxor811 xor -0 Inf -> NaN Invalid_operation
-dqxor812 xor 0 Inf -> NaN Invalid_operation
-dqxor813 xor 1 Inf -> NaN Invalid_operation
-dqxor814 xor 1000 Inf -> NaN Invalid_operation
-dqxor815 xor Inf Inf -> NaN Invalid_operation
-
-dqxor821 xor NaN -Inf -> NaN Invalid_operation
-dqxor822 xor NaN -1000 -> NaN Invalid_operation
-dqxor823 xor NaN -1 -> NaN Invalid_operation
-dqxor824 xor NaN -0 -> NaN Invalid_operation
-dqxor825 xor NaN 0 -> NaN Invalid_operation
-dqxor826 xor NaN 1 -> NaN Invalid_operation
-dqxor827 xor NaN 1000 -> NaN Invalid_operation
-dqxor828 xor NaN Inf -> NaN Invalid_operation
-dqxor829 xor NaN NaN -> NaN Invalid_operation
-dqxor830 xor -Inf NaN -> NaN Invalid_operation
-dqxor831 xor -1000 NaN -> NaN Invalid_operation
-dqxor832 xor -1 NaN -> NaN Invalid_operation
-dqxor833 xor -0 NaN -> NaN Invalid_operation
-dqxor834 xor 0 NaN -> NaN Invalid_operation
-dqxor835 xor 1 NaN -> NaN Invalid_operation
-dqxor836 xor 1000 NaN -> NaN Invalid_operation
-dqxor837 xor Inf NaN -> NaN Invalid_operation
-
-dqxor841 xor sNaN -Inf -> NaN Invalid_operation
-dqxor842 xor sNaN -1000 -> NaN Invalid_operation
-dqxor843 xor sNaN -1 -> NaN Invalid_operation
-dqxor844 xor sNaN -0 -> NaN Invalid_operation
-dqxor845 xor sNaN 0 -> NaN Invalid_operation
-dqxor846 xor sNaN 1 -> NaN Invalid_operation
-dqxor847 xor sNaN 1000 -> NaN Invalid_operation
-dqxor848 xor sNaN NaN -> NaN Invalid_operation
-dqxor849 xor sNaN sNaN -> NaN Invalid_operation
-dqxor850 xor NaN sNaN -> NaN Invalid_operation
-dqxor851 xor -Inf sNaN -> NaN Invalid_operation
-dqxor852 xor -1000 sNaN -> NaN Invalid_operation
-dqxor853 xor -1 sNaN -> NaN Invalid_operation
-dqxor854 xor -0 sNaN -> NaN Invalid_operation
-dqxor855 xor 0 sNaN -> NaN Invalid_operation
-dqxor856 xor 1 sNaN -> NaN Invalid_operation
-dqxor857 xor 1000 sNaN -> NaN Invalid_operation
-dqxor858 xor Inf sNaN -> NaN Invalid_operation
-dqxor859 xor NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-dqxor861 xor NaN1 -Inf -> NaN Invalid_operation
-dqxor862 xor +NaN2 -1000 -> NaN Invalid_operation
-dqxor863 xor NaN3 1000 -> NaN Invalid_operation
-dqxor864 xor NaN4 Inf -> NaN Invalid_operation
-dqxor865 xor NaN5 +NaN6 -> NaN Invalid_operation
-dqxor866 xor -Inf NaN7 -> NaN Invalid_operation
-dqxor867 xor -1000 NaN8 -> NaN Invalid_operation
-dqxor868 xor 1000 NaN9 -> NaN Invalid_operation
-dqxor869 xor Inf +NaN10 -> NaN Invalid_operation
-dqxor871 xor sNaN11 -Inf -> NaN Invalid_operation
-dqxor872 xor sNaN12 -1000 -> NaN Invalid_operation
-dqxor873 xor sNaN13 1000 -> NaN Invalid_operation
-dqxor874 xor sNaN14 NaN17 -> NaN Invalid_operation
-dqxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation
-dqxor876 xor NaN16 sNaN19 -> NaN Invalid_operation
-dqxor877 xor -Inf +sNaN20 -> NaN Invalid_operation
-dqxor878 xor -1000 sNaN21 -> NaN Invalid_operation
-dqxor879 xor 1000 sNaN22 -> NaN Invalid_operation
-dqxor880 xor Inf sNaN23 -> NaN Invalid_operation
-dqxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
-dqxor882 xor -NaN26 NaN28 -> NaN Invalid_operation
-dqxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
-dqxor884 xor 1000 -NaN30 -> NaN Invalid_operation
-dqxor885 xor 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- dqXor.decTest -- digitwise logical XOR for decQuads --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+clamp: 1
+precision: 34
+maxExponent: 6144
+minExponent: -6143
+rounding: half_even
+
+-- Sanity check (truth table)
+dqxor001 xor 0 0 -> 0
+dqxor002 xor 0 1 -> 1
+dqxor003 xor 1 0 -> 1
+dqxor004 xor 1 1 -> 0
+dqxor005 xor 1100 1010 -> 110
+-- and at msd and msd-1
+dqxor006 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqxor007 xor 0000000000000000000000000000000000 1000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqxor008 xor 1000000000000000000000000000000000 0000000000000000000000000000000000 -> 1000000000000000000000000000000000
+dqxor009 xor 1000000000000000000000000000000000 1000000000000000000000000000000000 -> 0
+dqxor010 xor 0000000000000000000000000000000000 0000000000000000000000000000000000 -> 0
+dqxor011 xor 0000000000000000000000000000000000 0100000000000000000000000000000000 -> 100000000000000000000000000000000
+dqxor012 xor 0100000000000000000000000000000000 0000000000000000000000000000000000 -> 100000000000000000000000000000000
+dqxor013 xor 0100000000000000000000000000000000 0100000000000000000000000000000000 -> 0
+
+-- Various lengths
+-- 1234567890123456789012345678901234
+dqxor601 xor 0111111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000000
+dqxor602 xor 1011111111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000000
+dqxor603 xor 1101111111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000000
+dqxor604 xor 1110111111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000000
+dqxor605 xor 1111011111111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000000
+dqxor606 xor 1111101111111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000000
+dqxor607 xor 1111110111111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000000
+dqxor608 xor 1111111011111111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000000
+dqxor609 xor 1111111101111111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000000
+dqxor610 xor 1111111110111111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000000
+dqxor611 xor 1111111111011111111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000000
+dqxor612 xor 1111111111101111111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000000
+dqxor613 xor 1111111111110111111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000000
+dqxor614 xor 1111111111111011111111111111111111 1111111111111111111111111111111111 -> 100000000000000000000
+dqxor615 xor 1111111111111101111111111111111111 1111111111111111111111111111111111 -> 10000000000000000000
+dqxor616 xor 1111111111111110111111111111111111 1111111111111111111111111111111111 -> 1000000000000000000
+dqxor617 xor 1111111111111111011111111111111111 1111111111111111111111111111111111 -> 100000000000000000
+dqxor618 xor 1111111111111111101111111111111111 1111111111111111111111111111111111 -> 10000000000000000
+dqxor619 xor 1111111111111111110111111111111111 1111111111111111111111111111111111 -> 1000000000000000
+dqxor620 xor 1111111111111111111011111111111111 1111111111111111111111111111111111 -> 100000000000000
+dqxor621 xor 1111111111111111111101111111111111 1111111111111111111111111111111111 -> 10000000000000
+dqxor622 xor 1111111111111111111110111111111111 1111111111111111111111111111111111 -> 1000000000000
+dqxor623 xor 1111111111111111111111011111111111 1111111111111111111111111111111111 -> 100000000000
+dqxor624 xor 1111111111111111111111101111111111 1111111111111111111111111111111111 -> 10000000000
+dqxor625 xor 1111111111111111111111110111111111 1111111111111111111111111111111111 -> 1000000000
+dqxor626 xor 1111111111111111111111111011111111 1111111111111111111111111111111111 -> 100000000
+dqxor627 xor 1111111111111111111111111101111111 1111111111111111111111111111111111 -> 10000000
+dqxor628 xor 1111111111111111111111111110111111 1111111111111111111111111111111111 -> 1000000
+dqxor629 xor 1111111111111111111111111111011111 1111111111111111111111111111111111 -> 100000
+dqxor630 xor 1111111111111111111111111111101111 1111111111111111111111111111111111 -> 10000
+dqxor631 xor 1111111111111111111111111111110111 1111111111111111111111111111111111 -> 1000
+dqxor632 xor 1111111111111111111111111111111011 1111111111111111111111111111111111 -> 100
+dqxor633 xor 1111111111111111111111111111111101 1111111111111111111111111111111111 -> 10
+dqxor634 xor 1111111111111111111111111111111110 1111111111111111111111111111111111 -> 1
+
+dqxor641 xor 1111111111111111111111111111111111 0111111111111111111111111111111111 -> 1000000000000000000000000000000000
+dqxor642 xor 1111111111111111111111111111111111 1011111111111111111111111111111111 -> 100000000000000000000000000000000
+dqxor643 xor 1111111111111111111111111111111111 1101111111111111111111111111111111 -> 10000000000000000000000000000000
+dqxor644 xor 1111111111111111111111111111111111 1110111111111111111111111111111111 -> 1000000000000000000000000000000
+dqxor645 xor 1111111111111111111111111111111111 1111011111111111111111111111111111 -> 100000000000000000000000000000
+dqxor646 xor 1111111111111111111111111111111111 1111101111111111111111111111111111 -> 10000000000000000000000000000
+dqxor647 xor 1111111111111111111111111111111111 1111110111111111111111111111111111 -> 1000000000000000000000000000
+dqxor648 xor 1111111111111111111111111111111111 1111111011111111111111111111111111 -> 100000000000000000000000000
+dqxor649 xor 1111111111111111111111111111111111 1111111101111111111111111111111111 -> 10000000000000000000000000
+dqxor650 xor 1111111111111111111111111111111111 1111111110111111111111111111111111 -> 1000000000000000000000000
+dqxor651 xor 1111111111111111111111111111111111 1111111111011111111111111111111111 -> 100000000000000000000000
+dqxor652 xor 1111111111111111111111111111111111 1111111111101111111111111111111111 -> 10000000000000000000000
+dqxor653 xor 1111111111111111111111111111111111 1111111111110111111111111111111111 -> 1000000000000000000000
+dqxor654 xor 1111111111111111111111111111111111 1111111111111011111111111111111111 -> 100000000000000000000
+dqxor655 xor 1111111111111111111111111111111111 1111111111111101111111111111111111 -> 10000000000000000000
+dqxor656 xor 1111111111111111111111111111111111 1111111111111110111111111111111111 -> 1000000000000000000
+dqxor657 xor 1111111111111111111111111111111111 1111111111111111011111111111111111 -> 100000000000000000
+dqxor658 xor 1111111111111111111111111111111111 1111111111111111101111111111111111 -> 10000000000000000
+dqxor659 xor 1111111111111111111111111111111111 1111111111111111110111111111111111 -> 1000000000000000
+dqxor660 xor 1111111111111111111111111111111111 1111111111111111111011111111111111 -> 100000000000000
+dqxor661 xor 1111111111111111111111111111111111 1111111111111111111101111111111111 -> 10000000000000
+dqxor662 xor 1111111111111111111111111111111111 1111111111111111111110111111111111 -> 1000000000000
+dqxor663 xor 1111111111111111111111111111111111 1111111111111111111111011111111111 -> 100000000000
+dqxor664 xor 1111111111111111111111111111111111 1111111111111111111111101111111111 -> 10000000000
+dqxor665 xor 1111111111111111111111111111111111 1111111111111111111111110111111111 -> 1000000000
+dqxor666 xor 1111111111111111111111111111111111 1111111111111111111111111011111111 -> 100000000
+dqxor667 xor 1111111111111111111111111111111111 1111111111111111111111111101111111 -> 10000000
+dqxor668 xor 1111111111111111111111111111111111 1111111111111111111111111110111111 -> 1000000
+dqxor669 xor 1111111111111111111111111111111111 1111111111111111111111111111011111 -> 100000
+dqxor670 xor 1111111111111111111111111111111111 1111111111111111111111111111101111 -> 10000
+dqxor671 xor 1111111111111111111111111111111111 1111111111111111111111111111110111 -> 1000
+dqxor672 xor 1111111111111111111111111111111111 1111111111111111111111111111111011 -> 100
+dqxor673 xor 1111111111111111111111111111111111 1111111111111111111111111111111101 -> 10
+dqxor674 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1
+dqxor675 xor 0111111111111111111111111111111111 1111111111111111111111111111111110 -> 1000000000000000000000000000000001
+dqxor676 xor 1111111111111111111111111111111111 1111111111111111111111111111111110 -> 1
+
+
+dqxor021 xor 1111111110000000 1111111110000000 -> 0
+dqxor022 xor 111111110000000 111111110000000 -> 0
+dqxor023 xor 11111110000000 11111110000000 -> 0
+dqxor024 xor 1111110000000 1111110000000 -> 0
+dqxor025 xor 111110000000 111110000000 -> 0
+dqxor026 xor 11110000000 11110000000 -> 0
+dqxor027 xor 1110000000 1110000000 -> 0
+dqxor028 xor 110000000 110000000 -> 0
+dqxor029 xor 10000000 10000000 -> 0
+dqxor030 xor 1000000 1000000 -> 0
+dqxor031 xor 100000 100000 -> 0
+dqxor032 xor 10000 10000 -> 0
+dqxor033 xor 1000 1000 -> 0
+dqxor034 xor 100 100 -> 0
+dqxor035 xor 10 10 -> 0
+dqxor036 xor 1 1 -> 0
+
+dqxor040 xor 111111111 111111111111 -> 111000000000
+dqxor041 xor 11111111 111111111111 -> 111100000000
+dqxor042 xor 11111111 111111111 -> 100000000
+dqxor043 xor 1111111 100000010 -> 101111101
+dqxor044 xor 111111 100000100 -> 100111011
+dqxor045 xor 11111 100001000 -> 100010111
+dqxor046 xor 1111 100010000 -> 100011111
+dqxor047 xor 111 100100000 -> 100100111
+dqxor048 xor 11 101000000 -> 101000011
+dqxor049 xor 1 110000000 -> 110000001
+
+dqxor050 xor 1111111111 1 -> 1111111110
+dqxor051 xor 111111111 1 -> 111111110
+dqxor052 xor 11111111 1 -> 11111110
+dqxor053 xor 1111111 1 -> 1111110
+dqxor054 xor 111111 1 -> 111110
+dqxor055 xor 11111 1 -> 11110
+dqxor056 xor 1111 1 -> 1110
+dqxor057 xor 111 1 -> 110
+dqxor058 xor 11 1 -> 10
+dqxor059 xor 1 1 -> 0
+
+dqxor060 xor 1111111111 0 -> 1111111111
+dqxor061 xor 111111111 0 -> 111111111
+dqxor062 xor 11111111 0 -> 11111111
+dqxor063 xor 1111111 0 -> 1111111
+dqxor064 xor 111111 0 -> 111111
+dqxor065 xor 11111 0 -> 11111
+dqxor066 xor 1111 0 -> 1111
+dqxor067 xor 111 0 -> 111
+dqxor068 xor 11 0 -> 11
+dqxor069 xor 1 0 -> 1
+
+dqxor070 xor 1 1111111111 -> 1111111110
+dqxor071 xor 1 111111111 -> 111111110
+dqxor072 xor 1 11111111 -> 11111110
+dqxor073 xor 1 1111111 -> 1111110
+dqxor074 xor 1 111111 -> 111110
+dqxor075 xor 1 11111 -> 11110
+dqxor076 xor 1 1111 -> 1110
+dqxor077 xor 1 111 -> 110
+dqxor078 xor 1 11 -> 10
+dqxor079 xor 1 1 -> 0
+
+dqxor080 xor 0 1111111111 -> 1111111111
+dqxor081 xor 0 111111111 -> 111111111
+dqxor082 xor 0 11111111 -> 11111111
+dqxor083 xor 0 1111111 -> 1111111
+dqxor084 xor 0 111111 -> 111111
+dqxor085 xor 0 11111 -> 11111
+dqxor086 xor 0 1111 -> 1111
+dqxor087 xor 0 111 -> 111
+dqxor088 xor 0 11 -> 11
+dqxor089 xor 0 1 -> 1
+
+dqxor090 xor 011111111 111101111 -> 100010000
+dqxor091 xor 101111111 111101111 -> 10010000
+dqxor092 xor 110111111 111101111 -> 1010000
+dqxor093 xor 111011111 111101111 -> 110000
+dqxor094 xor 111101111 111101111 -> 0
+dqxor095 xor 111110111 111101111 -> 11000
+dqxor096 xor 111111011 111101111 -> 10100
+dqxor097 xor 111111101 111101111 -> 10010
+dqxor098 xor 111111110 111101111 -> 10001
+
+dqxor100 xor 111101111 011111111 -> 100010000
+dqxor101 xor 111101111 101111111 -> 10010000
+dqxor102 xor 111101111 110111111 -> 1010000
+dqxor103 xor 111101111 111011111 -> 110000
+dqxor104 xor 111101111 111101111 -> 0
+dqxor105 xor 111101111 111110111 -> 11000
+dqxor106 xor 111101111 111111011 -> 10100
+dqxor107 xor 111101111 111111101 -> 10010
+dqxor108 xor 111101111 111111110 -> 10001
+
+-- non-0/1 should not be accepted, nor should signs
+dqxor220 xor 111111112 111111111 -> NaN Invalid_operation
+dqxor221 xor 333333333 333333333 -> NaN Invalid_operation
+dqxor222 xor 555555555 555555555 -> NaN Invalid_operation
+dqxor223 xor 777777777 777777777 -> NaN Invalid_operation
+dqxor224 xor 999999999 999999999 -> NaN Invalid_operation
+dqxor225 xor 222222222 999999999 -> NaN Invalid_operation
+dqxor226 xor 444444444 999999999 -> NaN Invalid_operation
+dqxor227 xor 666666666 999999999 -> NaN Invalid_operation
+dqxor228 xor 888888888 999999999 -> NaN Invalid_operation
+dqxor229 xor 999999999 222222222 -> NaN Invalid_operation
+dqxor230 xor 999999999 444444444 -> NaN Invalid_operation
+dqxor231 xor 999999999 666666666 -> NaN Invalid_operation
+dqxor232 xor 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+dqxor240 xor 567468689 -934981942 -> NaN Invalid_operation
+dqxor241 xor 567367689 934981942 -> NaN Invalid_operation
+dqxor242 xor -631917772 -706014634 -> NaN Invalid_operation
+dqxor243 xor -756253257 138579234 -> NaN Invalid_operation
+dqxor244 xor 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+dqxor250 xor 2000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor251 xor 7000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor252 xor 8000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor253 xor 9000000111000111000111000000000000 1000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor254 xor 2000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor255 xor 7000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor256 xor 8000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor257 xor 9000000111000111000111000000000000 0000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor258 xor 1000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor259 xor 1000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor260 xor 1000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor261 xor 1000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor262 xor 0000000111000111000111000000000000 2000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor263 xor 0000000111000111000111000000000000 7000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor264 xor 0000000111000111000111000000000000 8000000111000111000111000000000000 -> NaN Invalid_operation
+dqxor265 xor 0000000111000111000111000000000000 9000000111000111000111000000000000 -> NaN Invalid_operation
+-- test MSD-1
+dqxor270 xor 0200000111000111000111001000000000 1000000111000111000111100000000010 -> NaN Invalid_operation
+dqxor271 xor 0700000111000111000111000100000000 1000000111000111000111010000000100 -> NaN Invalid_operation
+dqxor272 xor 0800000111000111000111000010000000 1000000111000111000111001000001000 -> NaN Invalid_operation
+dqxor273 xor 0900000111000111000111000001000000 1000000111000111000111000100010000 -> NaN Invalid_operation
+dqxor274 xor 1000000111000111000111000000100000 0200000111000111000111000010100000 -> NaN Invalid_operation
+dqxor275 xor 1000000111000111000111000000010000 0700000111000111000111000001000000 -> NaN Invalid_operation
+dqxor276 xor 1000000111000111000111000000001000 0800000111000111000111000010100000 -> NaN Invalid_operation
+dqxor277 xor 1000000111000111000111000000000100 0900000111000111000111000000010000 -> NaN Invalid_operation
+-- test LSD
+dqxor280 xor 0010000111000111000111000000000002 1000000111000111000111000100000001 -> NaN Invalid_operation
+dqxor281 xor 0001000111000111000111000000000007 1000000111000111000111001000000011 -> NaN Invalid_operation
+dqxor282 xor 0000000111000111000111100000000008 1000000111000111000111010000000001 -> NaN Invalid_operation
+dqxor283 xor 0000000111000111000111010000000009 1000000111000111000111100000000001 -> NaN Invalid_operation
+dqxor284 xor 1000000111000111000111001000000000 0001000111000111000111000000000002 -> NaN Invalid_operation
+dqxor285 xor 1000000111000111000111000100000000 0010000111000111000111000000000007 -> NaN Invalid_operation
+dqxor286 xor 1000000111000111000111000010000000 0100000111000111000111000000000008 -> NaN Invalid_operation
+dqxor287 xor 1000000111000111000111000001000000 1000000111000111000111000000000009 -> NaN Invalid_operation
+-- test Middie
+dqxor288 xor 0010000111000111000111000020000000 1000000111000111000111001000000000 -> NaN Invalid_operation
+dqxor289 xor 0001000111000111000111000070000001 1000000111000111000111000100000000 -> NaN Invalid_operation
+dqxor290 xor 0000000111000111000111100080000010 1000000111000111000111000010000000 -> NaN Invalid_operation
+dqxor291 xor 0000000111000111000111010090000100 1000000111000111000111000001000000 -> NaN Invalid_operation
+dqxor292 xor 1000000111000111000111001000001000 0000000111000111000111000020100000 -> NaN Invalid_operation
+dqxor293 xor 1000000111000111000111000100010000 0000000111000111000111000070010000 -> NaN Invalid_operation
+dqxor294 xor 1000000111000111000111000010100000 0000000111000111000111000080001000 -> NaN Invalid_operation
+dqxor295 xor 1000000111000111000111000001000000 0000000111000111000111000090000100 -> NaN Invalid_operation
+-- signs
+dqxor296 xor -1000000111000111000111000001000000 -0000001110001110001110010000000100 -> NaN Invalid_operation
+dqxor297 xor -1000000111000111000111000001000000 0000001110001110001110000010000100 -> NaN Invalid_operation
+dqxor298 xor 1000000111000111000111000001000000 -0000001110001110001110001000000100 -> NaN Invalid_operation
+dqxor299 xor 1000000111000111000111000001000000 0000001110001110001110000011000100 -> 1000001001001001001001000010000100
+
+-- Nmax, Nmin, Ntiny-like
+dqxor331 xor 2 9.99999999E+999 -> NaN Invalid_operation
+dqxor332 xor 3 1E-999 -> NaN Invalid_operation
+dqxor333 xor 4 1.00000000E-2821 -> NaN Invalid_operation
+dqxor334 xor 5 1E-900 -> NaN Invalid_operation
+dqxor335 xor 6 -1E-900 -> NaN Invalid_operation
+dqxor336 xor 7 -1.00000000E-999 -> NaN Invalid_operation
+dqxor337 xor 8 -1E-999 -> NaN Invalid_operation
+dqxor338 xor 9 -9.99999999E+999 -> NaN Invalid_operation
+dqxor341 xor 9.99999999E+999 -18 -> NaN Invalid_operation
+dqxor342 xor 1E-999 01 -> NaN Invalid_operation
+dqxor343 xor 1.00000000E-999 -18 -> NaN Invalid_operation
+dqxor344 xor 1E-908 18 -> NaN Invalid_operation
+dqxor345 xor -1E-907 -10 -> NaN Invalid_operation
+dqxor346 xor -1.00000000E-999 18 -> NaN Invalid_operation
+dqxor347 xor -1E-999 10 -> NaN Invalid_operation
+dqxor348 xor -9.99999999E+2991 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+dqxor361 xor 1.0 1 -> NaN Invalid_operation
+dqxor362 xor 1E+1 1 -> NaN Invalid_operation
+dqxor363 xor 0.0 1 -> NaN Invalid_operation
+dqxor364 xor 0E+1 1 -> NaN Invalid_operation
+dqxor365 xor 9.9 1 -> NaN Invalid_operation
+dqxor366 xor 9E+1 1 -> NaN Invalid_operation
+dqxor371 xor 0 1.0 -> NaN Invalid_operation
+dqxor372 xor 0 1E+1 -> NaN Invalid_operation
+dqxor373 xor 0 0.0 -> NaN Invalid_operation
+dqxor374 xor 0 0E+1 -> NaN Invalid_operation
+dqxor375 xor 0 9.9 -> NaN Invalid_operation
+dqxor376 xor 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+dqxor780 xor -Inf -Inf -> NaN Invalid_operation
+dqxor781 xor -Inf -1000 -> NaN Invalid_operation
+dqxor782 xor -Inf -1 -> NaN Invalid_operation
+dqxor783 xor -Inf -0 -> NaN Invalid_operation
+dqxor784 xor -Inf 0 -> NaN Invalid_operation
+dqxor785 xor -Inf 1 -> NaN Invalid_operation
+dqxor786 xor -Inf 1000 -> NaN Invalid_operation
+dqxor787 xor -1000 -Inf -> NaN Invalid_operation
+dqxor788 xor -Inf -Inf -> NaN Invalid_operation
+dqxor789 xor -1 -Inf -> NaN Invalid_operation
+dqxor790 xor -0 -Inf -> NaN Invalid_operation
+dqxor791 xor 0 -Inf -> NaN Invalid_operation
+dqxor792 xor 1 -Inf -> NaN Invalid_operation
+dqxor793 xor 1000 -Inf -> NaN Invalid_operation
+dqxor794 xor Inf -Inf -> NaN Invalid_operation
+
+dqxor800 xor Inf -Inf -> NaN Invalid_operation
+dqxor801 xor Inf -1000 -> NaN Invalid_operation
+dqxor802 xor Inf -1 -> NaN Invalid_operation
+dqxor803 xor Inf -0 -> NaN Invalid_operation
+dqxor804 xor Inf 0 -> NaN Invalid_operation
+dqxor805 xor Inf 1 -> NaN Invalid_operation
+dqxor806 xor Inf 1000 -> NaN Invalid_operation
+dqxor807 xor Inf Inf -> NaN Invalid_operation
+dqxor808 xor -1000 Inf -> NaN Invalid_operation
+dqxor809 xor -Inf Inf -> NaN Invalid_operation
+dqxor810 xor -1 Inf -> NaN Invalid_operation
+dqxor811 xor -0 Inf -> NaN Invalid_operation
+dqxor812 xor 0 Inf -> NaN Invalid_operation
+dqxor813 xor 1 Inf -> NaN Invalid_operation
+dqxor814 xor 1000 Inf -> NaN Invalid_operation
+dqxor815 xor Inf Inf -> NaN Invalid_operation
+
+dqxor821 xor NaN -Inf -> NaN Invalid_operation
+dqxor822 xor NaN -1000 -> NaN Invalid_operation
+dqxor823 xor NaN -1 -> NaN Invalid_operation
+dqxor824 xor NaN -0 -> NaN Invalid_operation
+dqxor825 xor NaN 0 -> NaN Invalid_operation
+dqxor826 xor NaN 1 -> NaN Invalid_operation
+dqxor827 xor NaN 1000 -> NaN Invalid_operation
+dqxor828 xor NaN Inf -> NaN Invalid_operation
+dqxor829 xor NaN NaN -> NaN Invalid_operation
+dqxor830 xor -Inf NaN -> NaN Invalid_operation
+dqxor831 xor -1000 NaN -> NaN Invalid_operation
+dqxor832 xor -1 NaN -> NaN Invalid_operation
+dqxor833 xor -0 NaN -> NaN Invalid_operation
+dqxor834 xor 0 NaN -> NaN Invalid_operation
+dqxor835 xor 1 NaN -> NaN Invalid_operation
+dqxor836 xor 1000 NaN -> NaN Invalid_operation
+dqxor837 xor Inf NaN -> NaN Invalid_operation
+
+dqxor841 xor sNaN -Inf -> NaN Invalid_operation
+dqxor842 xor sNaN -1000 -> NaN Invalid_operation
+dqxor843 xor sNaN -1 -> NaN Invalid_operation
+dqxor844 xor sNaN -0 -> NaN Invalid_operation
+dqxor845 xor sNaN 0 -> NaN Invalid_operation
+dqxor846 xor sNaN 1 -> NaN Invalid_operation
+dqxor847 xor sNaN 1000 -> NaN Invalid_operation
+dqxor848 xor sNaN NaN -> NaN Invalid_operation
+dqxor849 xor sNaN sNaN -> NaN Invalid_operation
+dqxor850 xor NaN sNaN -> NaN Invalid_operation
+dqxor851 xor -Inf sNaN -> NaN Invalid_operation
+dqxor852 xor -1000 sNaN -> NaN Invalid_operation
+dqxor853 xor -1 sNaN -> NaN Invalid_operation
+dqxor854 xor -0 sNaN -> NaN Invalid_operation
+dqxor855 xor 0 sNaN -> NaN Invalid_operation
+dqxor856 xor 1 sNaN -> NaN Invalid_operation
+dqxor857 xor 1000 sNaN -> NaN Invalid_operation
+dqxor858 xor Inf sNaN -> NaN Invalid_operation
+dqxor859 xor NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+dqxor861 xor NaN1 -Inf -> NaN Invalid_operation
+dqxor862 xor +NaN2 -1000 -> NaN Invalid_operation
+dqxor863 xor NaN3 1000 -> NaN Invalid_operation
+dqxor864 xor NaN4 Inf -> NaN Invalid_operation
+dqxor865 xor NaN5 +NaN6 -> NaN Invalid_operation
+dqxor866 xor -Inf NaN7 -> NaN Invalid_operation
+dqxor867 xor -1000 NaN8 -> NaN Invalid_operation
+dqxor868 xor 1000 NaN9 -> NaN Invalid_operation
+dqxor869 xor Inf +NaN10 -> NaN Invalid_operation
+dqxor871 xor sNaN11 -Inf -> NaN Invalid_operation
+dqxor872 xor sNaN12 -1000 -> NaN Invalid_operation
+dqxor873 xor sNaN13 1000 -> NaN Invalid_operation
+dqxor874 xor sNaN14 NaN17 -> NaN Invalid_operation
+dqxor875 xor sNaN15 sNaN18 -> NaN Invalid_operation
+dqxor876 xor NaN16 sNaN19 -> NaN Invalid_operation
+dqxor877 xor -Inf +sNaN20 -> NaN Invalid_operation
+dqxor878 xor -1000 sNaN21 -> NaN Invalid_operation
+dqxor879 xor 1000 sNaN22 -> NaN Invalid_operation
+dqxor880 xor Inf sNaN23 -> NaN Invalid_operation
+dqxor881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
+dqxor882 xor -NaN26 NaN28 -> NaN Invalid_operation
+dqxor883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
+dqxor884 xor 1000 -NaN30 -> NaN Invalid_operation
+dqxor885 xor 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/dsBase.decTest b/Lib/test/decimaltestdata/dsBase.decTest
index 8ac45fc552..5e5e5a5d91 100644
--- a/Lib/test/decimaltestdata/dsBase.decTest
+++ b/Lib/test/decimaltestdata/dsBase.decTest
@@ -1,1062 +1,1062 @@
-------------------------------------------------------------------------
--- dsBase.decTest -- base decSingle <--> string conversions --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This file tests base conversions from string to a decimal number
--- and back to a string (in Scientific form)
-
--- Note that unlike other operations the operand is subject to rounding
--- to conform to emax and precision settings (that is, numbers will
--- conform to rules and exponent will be in permitted range). The
--- 'left hand side', therefore, may have numbers that cannot be
--- represented in a decSingle. Some testcases go to the limit of the
--- next-wider format, and hence these testcases may also be used to
--- test narrowing and widening operations.
-
-extended: 1
-clamp: 1
-precision: 7
-maxExponent: 96
-minExponent: -95
-rounding: half_even
-
-dsbas001 toSci 0 -> 0
-dsbas002 toSci 1 -> 1
-dsbas003 toSci 1.0 -> 1.0
-dsbas004 toSci 1.00 -> 1.00
-dsbas005 toSci 10 -> 10
-dsbas006 toSci 1000 -> 1000
-dsbas007 toSci 10.0 -> 10.0
-dsbas008 toSci 10.1 -> 10.1
-dsbas009 toSci 10.4 -> 10.4
-dsbas010 toSci 10.5 -> 10.5
-dsbas011 toSci 10.6 -> 10.6
-dsbas012 toSci 10.9 -> 10.9
-dsbas013 toSci 11.0 -> 11.0
-dsbas014 toSci 1.234 -> 1.234
-dsbas015 toSci 0.123 -> 0.123
-dsbas016 toSci 0.012 -> 0.012
-dsbas017 toSci -0 -> -0
-dsbas018 toSci -0.0 -> -0.0
-dsbas019 toSci -00.00 -> -0.00
-
-dsbas021 toSci -1 -> -1
-dsbas022 toSci -1.0 -> -1.0
-dsbas023 toSci -0.1 -> -0.1
-dsbas024 toSci -9.1 -> -9.1
-dsbas025 toSci -9.11 -> -9.11
-dsbas026 toSci -9.119 -> -9.119
-dsbas027 toSci -9.999 -> -9.999
-
-dsbas030 toSci '1234.567' -> '1234.567'
-dsbas031 toSci '1234.000' -> '1234.000'
-dsbas032 toSci '1234912' -> '1234912'
-dsbas033 toSci '0.00001234567' -> '0.00001234567'
-dsbas034 toSci '0.000001234567' -> '0.000001234567'
-dsbas035 toSci '0.0000001234567' -> '1.234567E-7'
-dsbas036 toSci '0.00000001234567' -> '1.234567E-8'
-
-dsbas037 toSci '0.1234564' -> '0.1234564'
-dsbas038 toSci '0.1234565' -> '0.1234565'
-
--- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
-dsbsn001 toSci -9.999999E+96 -> -9.999999E+96
-dsbsn002 toSci -1E-95 -> -1E-95
-dsbsn003 toSci -1E-101 -> -1E-101 Subnormal
-dsbsn004 toSci -0 -> -0
-dsbsn005 toSci +0 -> 0
-dsbsn006 toSci +1E-101 -> 1E-101 Subnormal
-dsbsn007 toSci +1E-95 -> 1E-95
-dsbsn008 toSci +9.999999E+96 -> 9.999999E+96
-
--- String [many more examples are implicitly tested elsewhere]
--- strings without E cannot generate E in result
-dsbas040 toSci "12" -> '12'
-dsbas041 toSci "-76" -> '-76'
-dsbas042 toSci "12.76" -> '12.76'
-dsbas043 toSci "+12.76" -> '12.76'
-dsbas044 toSci "012.76" -> '12.76'
-dsbas045 toSci "+0.003" -> '0.003'
-dsbas046 toSci "17." -> '17'
-dsbas047 toSci ".5" -> '0.5'
-dsbas048 toSci "044" -> '44'
-dsbas049 toSci "0044" -> '44'
-dsbas050 toSci "0.0005" -> '0.0005'
-dsbas051 toSci "00.00005" -> '0.00005'
-dsbas052 toSci "0.000005" -> '0.000005'
-dsbas053 toSci "0.0000050" -> '0.0000050'
-dsbas054 toSci "0.0000005" -> '5E-7'
-dsbas055 toSci "0.00000005" -> '5E-8'
-dsbas056 toSci "12678.54" -> '12678.54'
-dsbas057 toSci "2678.543" -> '2678.543'
-dsbas058 toSci "345678.5" -> '345678.5'
-dsbas059 toSci "0678.5432" -> '678.5432'
-dsbas060 toSci "678.5432" -> '678.5432'
-dsbas061 toSci "+678.5432" -> '678.5432'
-dsbas062 toSci "+0678.5432" -> '678.5432'
-dsbas063 toSci "+00678.5432" -> '678.5432'
-dsbas064 toSci "-678.5432" -> '-678.5432'
-dsbas065 toSci "-0678.5432" -> '-678.5432'
-dsbas066 toSci "-00678.5432" -> '-678.5432'
--- examples
-dsbas067 toSci "5E-6" -> '0.000005'
-dsbas068 toSci "50E-7" -> '0.0000050'
-dsbas069 toSci "5E-7" -> '5E-7'
-
--- [No exotics as no Unicode]
-
--- rounded with dots in all (including edge) places
-dsbas071 toSci .1234567890123456 -> 0.1234568 Inexact Rounded
-dsbas072 toSci 1.234567890123456 -> 1.234568 Inexact Rounded
-dsbas073 toSci 12.34567890123456 -> 12.34568 Inexact Rounded
-dsbas074 toSci 123.4567890123456 -> 123.4568 Inexact Rounded
-dsbas075 toSci 1234.567890123456 -> 1234.568 Inexact Rounded
-dsbas076 toSci 12345.67890123456 -> 12345.68 Inexact Rounded
-dsbas077 toSci 123456.7890123456 -> 123456.8 Inexact Rounded
-dsbas078 toSci 1234567.890123456 -> 1234568 Inexact Rounded
-dsbas079 toSci 12345678.90123456 -> 1.234568E+7 Inexact Rounded
-dsbas080 toSci 123456789.0123456 -> 1.234568E+8 Inexact Rounded
-dsbas081 toSci 1234567890.123456 -> 1.234568E+9 Inexact Rounded
-dsbas082 toSci 12345678901.23456 -> 1.234568E+10 Inexact Rounded
-dsbas083 toSci 123456789012.3456 -> 1.234568E+11 Inexact Rounded
-dsbas084 toSci 1234567890123.456 -> 1.234568E+12 Inexact Rounded
-dsbas085 toSci 12345678901234.56 -> 1.234568E+13 Inexact Rounded
-dsbas086 toSci 123456789012345.6 -> 1.234568E+14 Inexact Rounded
-dsbas087 toSci 1234567890123456. -> 1.234568E+15 Inexact Rounded
-dsbas088 toSci 1234567890123456 -> 1.234568E+15 Inexact Rounded
-
--- Numbers with E
-dsbas130 toSci "0.000E-1" -> '0.0000'
-dsbas131 toSci "0.000E-2" -> '0.00000'
-dsbas132 toSci "0.000E-3" -> '0.000000'
-dsbas133 toSci "0.000E-4" -> '0E-7'
-dsbas134 toSci "0.00E-2" -> '0.0000'
-dsbas135 toSci "0.00E-3" -> '0.00000'
-dsbas136 toSci "0.00E-4" -> '0.000000'
-dsbas137 toSci "0.00E-5" -> '0E-7'
-dsbas138 toSci "+0E+9" -> '0E+9'
-dsbas139 toSci "-0E+9" -> '-0E+9'
-dsbas140 toSci "1E+9" -> '1E+9'
-dsbas141 toSci "1e+09" -> '1E+9'
-dsbas142 toSci "1E+90" -> '1E+90'
-dsbas143 toSci "+1E+009" -> '1E+9'
-dsbas144 toSci "0E+9" -> '0E+9'
-dsbas145 toSci "1E+9" -> '1E+9'
-dsbas146 toSci "1E+09" -> '1E+9'
-dsbas147 toSci "1e+90" -> '1E+90'
-dsbas148 toSci "1E+009" -> '1E+9'
-dsbas149 toSci "000E+9" -> '0E+9'
-dsbas150 toSci "1E9" -> '1E+9'
-dsbas151 toSci "1e09" -> '1E+9'
-dsbas152 toSci "1E90" -> '1E+90'
-dsbas153 toSci "1E009" -> '1E+9'
-dsbas154 toSci "0E9" -> '0E+9'
-dsbas155 toSci "0.000e+0" -> '0.000'
-dsbas156 toSci "0.000E-1" -> '0.0000'
-dsbas157 toSci "4E+9" -> '4E+9'
-dsbas158 toSci "44E+9" -> '4.4E+10'
-dsbas159 toSci "0.73e-7" -> '7.3E-8'
-dsbas160 toSci "00E+9" -> '0E+9'
-dsbas161 toSci "00E-9" -> '0E-9'
-dsbas162 toSci "10E+9" -> '1.0E+10'
-dsbas163 toSci "10E+09" -> '1.0E+10'
-dsbas164 toSci "10e+90" -> '1.0E+91'
-dsbas165 toSci "10E+009" -> '1.0E+10'
-dsbas166 toSci "100e+9" -> '1.00E+11'
-dsbas167 toSci "100e+09" -> '1.00E+11'
-dsbas168 toSci "100E+90" -> '1.00E+92'
-dsbas169 toSci "100e+009" -> '1.00E+11'
-
-dsbas170 toSci "1.265" -> '1.265'
-dsbas171 toSci "1.265E-20" -> '1.265E-20'
-dsbas172 toSci "1.265E-8" -> '1.265E-8'
-dsbas173 toSci "1.265E-4" -> '0.0001265'
-dsbas174 toSci "1.265E-3" -> '0.001265'
-dsbas175 toSci "1.265E-2" -> '0.01265'
-dsbas176 toSci "1.265E-1" -> '0.1265'
-dsbas177 toSci "1.265E-0" -> '1.265'
-dsbas178 toSci "1.265E+1" -> '12.65'
-dsbas179 toSci "1.265E+2" -> '126.5'
-dsbas180 toSci "1.265E+3" -> '1265'
-dsbas181 toSci "1.265E+4" -> '1.265E+4'
-dsbas182 toSci "1.265E+8" -> '1.265E+8'
-dsbas183 toSci "1.265E+20" -> '1.265E+20'
-
-dsbas190 toSci "12.65" -> '12.65'
-dsbas191 toSci "12.65E-20" -> '1.265E-19'
-dsbas192 toSci "12.65E-8" -> '1.265E-7'
-dsbas193 toSci "12.65E-4" -> '0.001265'
-dsbas194 toSci "12.65E-3" -> '0.01265'
-dsbas195 toSci "12.65E-2" -> '0.1265'
-dsbas196 toSci "12.65E-1" -> '1.265'
-dsbas197 toSci "12.65E-0" -> '12.65'
-dsbas198 toSci "12.65E+1" -> '126.5'
-dsbas199 toSci "12.65E+2" -> '1265'
-dsbas200 toSci "12.65E+3" -> '1.265E+4'
-dsbas201 toSci "12.65E+4" -> '1.265E+5'
-dsbas202 toSci "12.65E+8" -> '1.265E+9'
-dsbas203 toSci "12.65E+20" -> '1.265E+21'
-
-dsbas210 toSci "126.5" -> '126.5'
-dsbas211 toSci "126.5E-20" -> '1.265E-18'
-dsbas212 toSci "126.5E-8" -> '0.000001265'
-dsbas213 toSci "126.5E-4" -> '0.01265'
-dsbas214 toSci "126.5E-3" -> '0.1265'
-dsbas215 toSci "126.5E-2" -> '1.265'
-dsbas216 toSci "126.5E-1" -> '12.65'
-dsbas217 toSci "126.5E-0" -> '126.5'
-dsbas218 toSci "126.5E+1" -> '1265'
-dsbas219 toSci "126.5E+2" -> '1.265E+4'
-dsbas220 toSci "126.5E+3" -> '1.265E+5'
-dsbas221 toSci "126.5E+4" -> '1.265E+6'
-dsbas222 toSci "126.5E+8" -> '1.265E+10'
-dsbas223 toSci "126.5E+20" -> '1.265E+22'
-
-dsbas230 toSci "1265" -> '1265'
-dsbas231 toSci "1265E-20" -> '1.265E-17'
-dsbas232 toSci "1265E-8" -> '0.00001265'
-dsbas233 toSci "1265E-4" -> '0.1265'
-dsbas234 toSci "1265E-3" -> '1.265'
-dsbas235 toSci "1265E-2" -> '12.65'
-dsbas236 toSci "1265E-1" -> '126.5'
-dsbas237 toSci "1265E-0" -> '1265'
-dsbas238 toSci "1265E+1" -> '1.265E+4'
-dsbas239 toSci "1265E+2" -> '1.265E+5'
-dsbas240 toSci "1265E+3" -> '1.265E+6'
-dsbas241 toSci "1265E+4" -> '1.265E+7'
-dsbas242 toSci "1265E+8" -> '1.265E+11'
-dsbas243 toSci "1265E+20" -> '1.265E+23'
-
-dsbas250 toSci "0.1265" -> '0.1265'
-dsbas251 toSci "0.1265E-20" -> '1.265E-21'
-dsbas252 toSci "0.1265E-8" -> '1.265E-9'
-dsbas253 toSci "0.1265E-4" -> '0.00001265'
-dsbas254 toSci "0.1265E-3" -> '0.0001265'
-dsbas255 toSci "0.1265E-2" -> '0.001265'
-dsbas256 toSci "0.1265E-1" -> '0.01265'
-dsbas257 toSci "0.1265E-0" -> '0.1265'
-dsbas258 toSci "0.1265E+1" -> '1.265'
-dsbas259 toSci "0.1265E+2" -> '12.65'
-dsbas260 toSci "0.1265E+3" -> '126.5'
-dsbas261 toSci "0.1265E+4" -> '1265'
-dsbas262 toSci "0.1265E+8" -> '1.265E+7'
-dsbas263 toSci "0.1265E+20" -> '1.265E+19'
-
--- some more negative zeros [systematic tests below]
-dsbas290 toSci "-0.000E-1" -> '-0.0000'
-dsbas291 toSci "-0.000E-2" -> '-0.00000'
-dsbas292 toSci "-0.000E-3" -> '-0.000000'
-dsbas293 toSci "-0.000E-4" -> '-0E-7'
-dsbas294 toSci "-0.00E-2" -> '-0.0000'
-dsbas295 toSci "-0.00E-3" -> '-0.00000'
-dsbas296 toSci "-0.0E-2" -> '-0.000'
-dsbas297 toSci "-0.0E-3" -> '-0.0000'
-dsbas298 toSci "-0E-2" -> '-0.00'
-dsbas299 toSci "-0E-3" -> '-0.000'
-
--- Engineering notation tests
-dsbas301 toSci 10e12 -> 1.0E+13
-dsbas302 toEng 10e12 -> 10E+12
-dsbas303 toSci 10e11 -> 1.0E+12
-dsbas304 toEng 10e11 -> 1.0E+12
-dsbas305 toSci 10e10 -> 1.0E+11
-dsbas306 toEng 10e10 -> 100E+9
-dsbas307 toSci 10e9 -> 1.0E+10
-dsbas308 toEng 10e9 -> 10E+9
-dsbas309 toSci 10e8 -> 1.0E+9
-dsbas310 toEng 10e8 -> 1.0E+9
-dsbas311 toSci 10e7 -> 1.0E+8
-dsbas312 toEng 10e7 -> 100E+6
-dsbas313 toSci 10e6 -> 1.0E+7
-dsbas314 toEng 10e6 -> 10E+6
-dsbas315 toSci 10e5 -> 1.0E+6
-dsbas316 toEng 10e5 -> 1.0E+6
-dsbas317 toSci 10e4 -> 1.0E+5
-dsbas318 toEng 10e4 -> 100E+3
-dsbas319 toSci 10e3 -> 1.0E+4
-dsbas320 toEng 10e3 -> 10E+3
-dsbas321 toSci 10e2 -> 1.0E+3
-dsbas322 toEng 10e2 -> 1.0E+3
-dsbas323 toSci 10e1 -> 1.0E+2
-dsbas324 toEng 10e1 -> 100
-dsbas325 toSci 10e0 -> 10
-dsbas326 toEng 10e0 -> 10
-dsbas327 toSci 10e-1 -> 1.0
-dsbas328 toEng 10e-1 -> 1.0
-dsbas329 toSci 10e-2 -> 0.10
-dsbas330 toEng 10e-2 -> 0.10
-dsbas331 toSci 10e-3 -> 0.010
-dsbas332 toEng 10e-3 -> 0.010
-dsbas333 toSci 10e-4 -> 0.0010
-dsbas334 toEng 10e-4 -> 0.0010
-dsbas335 toSci 10e-5 -> 0.00010
-dsbas336 toEng 10e-5 -> 0.00010
-dsbas337 toSci 10e-6 -> 0.000010
-dsbas338 toEng 10e-6 -> 0.000010
-dsbas339 toSci 10e-7 -> 0.0000010
-dsbas340 toEng 10e-7 -> 0.0000010
-dsbas341 toSci 10e-8 -> 1.0E-7
-dsbas342 toEng 10e-8 -> 100E-9
-dsbas343 toSci 10e-9 -> 1.0E-8
-dsbas344 toEng 10e-9 -> 10E-9
-dsbas345 toSci 10e-10 -> 1.0E-9
-dsbas346 toEng 10e-10 -> 1.0E-9
-dsbas347 toSci 10e-11 -> 1.0E-10
-dsbas348 toEng 10e-11 -> 100E-12
-dsbas349 toSci 10e-12 -> 1.0E-11
-dsbas350 toEng 10e-12 -> 10E-12
-dsbas351 toSci 10e-13 -> 1.0E-12
-dsbas352 toEng 10e-13 -> 1.0E-12
-
-dsbas361 toSci 7E12 -> 7E+12
-dsbas362 toEng 7E12 -> 7E+12
-dsbas363 toSci 7E11 -> 7E+11
-dsbas364 toEng 7E11 -> 700E+9
-dsbas365 toSci 7E10 -> 7E+10
-dsbas366 toEng 7E10 -> 70E+9
-dsbas367 toSci 7E9 -> 7E+9
-dsbas368 toEng 7E9 -> 7E+9
-dsbas369 toSci 7E8 -> 7E+8
-dsbas370 toEng 7E8 -> 700E+6
-dsbas371 toSci 7E7 -> 7E+7
-dsbas372 toEng 7E7 -> 70E+6
-dsbas373 toSci 7E6 -> 7E+6
-dsbas374 toEng 7E6 -> 7E+6
-dsbas375 toSci 7E5 -> 7E+5
-dsbas376 toEng 7E5 -> 700E+3
-dsbas377 toSci 7E4 -> 7E+4
-dsbas378 toEng 7E4 -> 70E+3
-dsbas379 toSci 7E3 -> 7E+3
-dsbas380 toEng 7E3 -> 7E+3
-dsbas381 toSci 7E2 -> 7E+2
-dsbas382 toEng 7E2 -> 700
-dsbas383 toSci 7E1 -> 7E+1
-dsbas384 toEng 7E1 -> 70
-dsbas385 toSci 7E0 -> 7
-dsbas386 toEng 7E0 -> 7
-dsbas387 toSci 7E-1 -> 0.7
-dsbas388 toEng 7E-1 -> 0.7
-dsbas389 toSci 7E-2 -> 0.07
-dsbas390 toEng 7E-2 -> 0.07
-dsbas391 toSci 7E-3 -> 0.007
-dsbas392 toEng 7E-3 -> 0.007
-dsbas393 toSci 7E-4 -> 0.0007
-dsbas394 toEng 7E-4 -> 0.0007
-dsbas395 toSci 7E-5 -> 0.00007
-dsbas396 toEng 7E-5 -> 0.00007
-dsbas397 toSci 7E-6 -> 0.000007
-dsbas398 toEng 7E-6 -> 0.000007
-dsbas399 toSci 7E-7 -> 7E-7
-dsbas400 toEng 7E-7 -> 700E-9
-dsbas401 toSci 7E-8 -> 7E-8
-dsbas402 toEng 7E-8 -> 70E-9
-dsbas403 toSci 7E-9 -> 7E-9
-dsbas404 toEng 7E-9 -> 7E-9
-dsbas405 toSci 7E-10 -> 7E-10
-dsbas406 toEng 7E-10 -> 700E-12
-dsbas407 toSci 7E-11 -> 7E-11
-dsbas408 toEng 7E-11 -> 70E-12
-dsbas409 toSci 7E-12 -> 7E-12
-dsbas410 toEng 7E-12 -> 7E-12
-dsbas411 toSci 7E-13 -> 7E-13
-dsbas412 toEng 7E-13 -> 700E-15
-
--- Exacts remain exact up to precision ..
-dsbas420 toSci 100 -> 100
-dsbas422 toSci 1000 -> 1000
-dsbas424 toSci 999.9 -> 999.9
-dsbas426 toSci 1000.0 -> 1000.0
-dsbas428 toSci 1000.1 -> 1000.1
-dsbas430 toSci 10000 -> 10000
-dsbas432 toSci 1000 -> 1000
-dsbas434 toSci 10000 -> 10000
-dsbas436 toSci 100000 -> 100000
-dsbas438 toSci 1000000 -> 1000000
-dsbas440 toSci 10000000 -> 1.000000E+7 Rounded
-dsbas442 toSci 10000000 -> 1.000000E+7 Rounded
-dsbas444 toSci 10000003 -> 1.000000E+7 Rounded Inexact
-dsbas446 toSci 10000005 -> 1.000000E+7 Rounded Inexact
-dsbas448 toSci 100000050 -> 1.000000E+8 Rounded Inexact
-dsbas450 toSci 10000009 -> 1.000001E+7 Rounded Inexact
-dsbas452 toSci 100000000 -> 1.000000E+8 Rounded
-dsbas454 toSci 100000003 -> 1.000000E+8 Rounded Inexact
-dsbas456 toSci 100000005 -> 1.000000E+8 Rounded Inexact
-dsbas458 toSci 100000009 -> 1.000000E+8 Rounded Inexact
-dsbas460 toSci 1000000000 -> 1.000000E+9 Rounded
-dsbas462 toSci 1000000300 -> 1.000000E+9 Rounded Inexact
-dsbas464 toSci 1000000500 -> 1.000000E+9 Rounded Inexact
-dsbas466 toSci 1000000900 -> 1.000001E+9 Rounded Inexact
-dsbas468 toSci 10000000000 -> 1.000000E+10 Rounded
-dsbas470 toSci 10000003000 -> 1.000000E+10 Rounded Inexact
-dsbas472 toSci 10000005000 -> 1.000000E+10 Rounded Inexact
-dsbas474 toSci 10000009000 -> 1.000001E+10 Rounded Inexact
-
--- check rounding modes heeded
-rounding: ceiling
-dsbsr401 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr402 toSci 1.11234549 -> 1.112346 Rounded Inexact
-dsbsr403 toSci 1.11234550 -> 1.112346 Rounded Inexact
-dsbsr404 toSci 1.11234551 -> 1.112346 Rounded Inexact
-rounding: up
-dsbsr405 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr406 toSci 1.11234549 -> 1.112346 Rounded Inexact
-dsbsr407 toSci 1.11234550 -> 1.112346 Rounded Inexact
-dsbsr408 toSci 1.11234551 -> 1.112346 Rounded Inexact
-rounding: floor
-dsbsr410 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr411 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr412 toSci 1.11234550 -> 1.112345 Rounded Inexact
-dsbsr413 toSci 1.11234551 -> 1.112345 Rounded Inexact
-rounding: half_down
-dsbsr415 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr416 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr417 toSci 1.11234550 -> 1.112345 Rounded Inexact
-dsbsr418 toSci 1.11234650 -> 1.112346 Rounded Inexact
-dsbsr419 toSci 1.11234551 -> 1.112346 Rounded Inexact
-rounding: half_even
-dsbsr421 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr422 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr423 toSci 1.11234550 -> 1.112346 Rounded Inexact
-dsbsr424 toSci 1.11234650 -> 1.112346 Rounded Inexact
-dsbsr425 toSci 1.11234551 -> 1.112346 Rounded Inexact
-rounding: down
-dsbsr426 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr427 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr428 toSci 1.11234550 -> 1.112345 Rounded Inexact
-dsbsr429 toSci 1.11234551 -> 1.112345 Rounded Inexact
-rounding: half_up
-dsbsr431 toSci 1.1123450 -> 1.112345 Rounded
-dsbsr432 toSci 1.11234549 -> 1.112345 Rounded Inexact
-dsbsr433 toSci 1.11234550 -> 1.112346 Rounded Inexact
-dsbsr434 toSci 1.11234650 -> 1.112347 Rounded Inexact
-dsbsr435 toSci 1.11234551 -> 1.112346 Rounded Inexact
--- negatives
-rounding: ceiling
-dsbsr501 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr502 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr503 toSci -1.11234550 -> -1.112345 Rounded Inexact
-dsbsr504 toSci -1.11234551 -> -1.112345 Rounded Inexact
-rounding: up
-dsbsr505 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr506 toSci -1.11234549 -> -1.112346 Rounded Inexact
-dsbsr507 toSci -1.11234550 -> -1.112346 Rounded Inexact
-dsbsr508 toSci -1.11234551 -> -1.112346 Rounded Inexact
-rounding: floor
-dsbsr510 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr511 toSci -1.11234549 -> -1.112346 Rounded Inexact
-dsbsr512 toSci -1.11234550 -> -1.112346 Rounded Inexact
-dsbsr513 toSci -1.11234551 -> -1.112346 Rounded Inexact
-rounding: half_down
-dsbsr515 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr516 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr517 toSci -1.11234550 -> -1.112345 Rounded Inexact
-dsbsr518 toSci -1.11234650 -> -1.112346 Rounded Inexact
-dsbsr519 toSci -1.11234551 -> -1.112346 Rounded Inexact
-rounding: half_even
-dsbsr521 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr522 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr523 toSci -1.11234550 -> -1.112346 Rounded Inexact
-dsbsr524 toSci -1.11234650 -> -1.112346 Rounded Inexact
-dsbsr525 toSci -1.11234551 -> -1.112346 Rounded Inexact
-rounding: down
-dsbsr526 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr527 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr528 toSci -1.11234550 -> -1.112345 Rounded Inexact
-dsbsr529 toSci -1.11234551 -> -1.112345 Rounded Inexact
-rounding: half_up
-dsbsr531 toSci -1.1123450 -> -1.112345 Rounded
-dsbsr532 toSci -1.11234549 -> -1.112345 Rounded Inexact
-dsbsr533 toSci -1.11234550 -> -1.112346 Rounded Inexact
-dsbsr534 toSci -1.11234650 -> -1.112347 Rounded Inexact
-dsbsr535 toSci -1.11234551 -> -1.112346 Rounded Inexact
-
-rounding: half_even
-
--- The 'baddies' tests from DiagBigDecimal, plus some new ones
-dsbas500 toSci '1..2' -> NaN Conversion_syntax
-dsbas501 toSci '.' -> NaN Conversion_syntax
-dsbas502 toSci '..' -> NaN Conversion_syntax
-dsbas503 toSci '++1' -> NaN Conversion_syntax
-dsbas504 toSci '--1' -> NaN Conversion_syntax
-dsbas505 toSci '-+1' -> NaN Conversion_syntax
-dsbas506 toSci '+-1' -> NaN Conversion_syntax
-dsbas507 toSci '12e' -> NaN Conversion_syntax
-dsbas508 toSci '12e++' -> NaN Conversion_syntax
-dsbas509 toSci '12f4' -> NaN Conversion_syntax
-dsbas510 toSci ' +1' -> NaN Conversion_syntax
-dsbas511 toSci '+ 1' -> NaN Conversion_syntax
-dsbas512 toSci '12 ' -> NaN Conversion_syntax
-dsbas513 toSci ' + 1' -> NaN Conversion_syntax
-dsbas514 toSci ' - 1 ' -> NaN Conversion_syntax
-dsbas515 toSci 'x' -> NaN Conversion_syntax
-dsbas516 toSci '-1-' -> NaN Conversion_syntax
-dsbas517 toSci '12-' -> NaN Conversion_syntax
-dsbas518 toSci '3+' -> NaN Conversion_syntax
-dsbas519 toSci '' -> NaN Conversion_syntax
-dsbas520 toSci '1e-' -> NaN Conversion_syntax
-dsbas521 toSci '7e99999a' -> NaN Conversion_syntax
-dsbas522 toSci '7e123567890x' -> NaN Conversion_syntax
-dsbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
-dsbas524 toSci '' -> NaN Conversion_syntax
-dsbas525 toSci 'e100' -> NaN Conversion_syntax
-dsbas526 toSci '\u0e5a' -> NaN Conversion_syntax
-dsbas527 toSci '\u0b65' -> NaN Conversion_syntax
-dsbas528 toSci '123,65' -> NaN Conversion_syntax
-dsbas529 toSci '1.34.5' -> NaN Conversion_syntax
-dsbas530 toSci '.123.5' -> NaN Conversion_syntax
-dsbas531 toSci '01.35.' -> NaN Conversion_syntax
-dsbas532 toSci '01.35-' -> NaN Conversion_syntax
-dsbas533 toSci '0000..' -> NaN Conversion_syntax
-dsbas534 toSci '.0000.' -> NaN Conversion_syntax
-dsbas535 toSci '00..00' -> NaN Conversion_syntax
-dsbas536 toSci '111e*123' -> NaN Conversion_syntax
-dsbas537 toSci '111e123-' -> NaN Conversion_syntax
-dsbas538 toSci '111e+12+' -> NaN Conversion_syntax
-dsbas539 toSci '111e1-3-' -> NaN Conversion_syntax
-dsbas540 toSci '111e1*23' -> NaN Conversion_syntax
-dsbas541 toSci '111e1e+3' -> NaN Conversion_syntax
-dsbas542 toSci '1e1.0' -> NaN Conversion_syntax
-dsbas543 toSci '1e123e' -> NaN Conversion_syntax
-dsbas544 toSci 'ten' -> NaN Conversion_syntax
-dsbas545 toSci 'ONE' -> NaN Conversion_syntax
-dsbas546 toSci '1e.1' -> NaN Conversion_syntax
-dsbas547 toSci '1e1.' -> NaN Conversion_syntax
-dsbas548 toSci '1ee' -> NaN Conversion_syntax
-dsbas549 toSci 'e+1' -> NaN Conversion_syntax
-dsbas550 toSci '1.23.4' -> NaN Conversion_syntax
-dsbas551 toSci '1.2.1' -> NaN Conversion_syntax
-dsbas552 toSci '1E+1.2' -> NaN Conversion_syntax
-dsbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
-dsbas554 toSci '1E++1' -> NaN Conversion_syntax
-dsbas555 toSci '1E--1' -> NaN Conversion_syntax
-dsbas556 toSci '1E+-1' -> NaN Conversion_syntax
-dsbas557 toSci '1E-+1' -> NaN Conversion_syntax
-dsbas558 toSci '1E''1' -> NaN Conversion_syntax
-dsbas559 toSci "1E""1" -> NaN Conversion_syntax
-dsbas560 toSci "1E""""" -> NaN Conversion_syntax
--- Near-specials
-dsbas561 toSci "qNaN" -> NaN Conversion_syntax
-dsbas562 toSci "NaNq" -> NaN Conversion_syntax
-dsbas563 toSci "NaNs" -> NaN Conversion_syntax
-dsbas564 toSci "Infi" -> NaN Conversion_syntax
-dsbas565 toSci "Infin" -> NaN Conversion_syntax
-dsbas566 toSci "Infini" -> NaN Conversion_syntax
-dsbas567 toSci "Infinit" -> NaN Conversion_syntax
-dsbas568 toSci "-Infinit" -> NaN Conversion_syntax
-dsbas569 toSci "0Inf" -> NaN Conversion_syntax
-dsbas570 toSci "9Inf" -> NaN Conversion_syntax
-dsbas571 toSci "-0Inf" -> NaN Conversion_syntax
-dsbas572 toSci "-9Inf" -> NaN Conversion_syntax
-dsbas573 toSci "-sNa" -> NaN Conversion_syntax
-dsbas574 toSci "xNaN" -> NaN Conversion_syntax
-dsbas575 toSci "0sNaN" -> NaN Conversion_syntax
-
--- some baddies with dots and Es and dots and specials
-dsbas576 toSci 'e+1' -> NaN Conversion_syntax
-dsbas577 toSci '.e+1' -> NaN Conversion_syntax
-dsbas578 toSci '+.e+1' -> NaN Conversion_syntax
-dsbas579 toSci '-.e+' -> NaN Conversion_syntax
-dsbas580 toSci '-.e' -> NaN Conversion_syntax
-dsbas581 toSci 'E+1' -> NaN Conversion_syntax
-dsbas582 toSci '.E+1' -> NaN Conversion_syntax
-dsbas583 toSci '+.E+1' -> NaN Conversion_syntax
-dsbas584 toSci '-.E+' -> NaN Conversion_syntax
-dsbas585 toSci '-.E' -> NaN Conversion_syntax
-
-dsbas586 toSci '.NaN' -> NaN Conversion_syntax
-dsbas587 toSci '-.NaN' -> NaN Conversion_syntax
-dsbas588 toSci '+.sNaN' -> NaN Conversion_syntax
-dsbas589 toSci '+.Inf' -> NaN Conversion_syntax
-dsbas590 toSci '.Infinity' -> NaN Conversion_syntax
-
--- Zeros
-dsbas601 toSci 0.000000000 -> 0E-9
-dsbas602 toSci 0.00000000 -> 0E-8
-dsbas603 toSci 0.0000000 -> 0E-7
-dsbas604 toSci 0.000000 -> 0.000000
-dsbas605 toSci 0.00000 -> 0.00000
-dsbas606 toSci 0.0000 -> 0.0000
-dsbas607 toSci 0.000 -> 0.000
-dsbas608 toSci 0.00 -> 0.00
-dsbas609 toSci 0.0 -> 0.0
-dsbas610 toSci .0 -> 0.0
-dsbas611 toSci 0. -> 0
-dsbas612 toSci -.0 -> -0.0
-dsbas613 toSci -0. -> -0
-dsbas614 toSci -0.0 -> -0.0
-dsbas615 toSci -0.00 -> -0.00
-dsbas616 toSci -0.000 -> -0.000
-dsbas617 toSci -0.0000 -> -0.0000
-dsbas618 toSci -0.00000 -> -0.00000
-dsbas619 toSci -0.000000 -> -0.000000
-dsbas620 toSci -0.0000000 -> -0E-7
-dsbas621 toSci -0.00000000 -> -0E-8
-dsbas622 toSci -0.000000000 -> -0E-9
-
-dsbas630 toSci 0.00E+0 -> 0.00
-dsbas631 toSci 0.00E+1 -> 0.0
-dsbas632 toSci 0.00E+2 -> 0
-dsbas633 toSci 0.00E+3 -> 0E+1
-dsbas634 toSci 0.00E+4 -> 0E+2
-dsbas635 toSci 0.00E+5 -> 0E+3
-dsbas636 toSci 0.00E+6 -> 0E+4
-dsbas637 toSci 0.00E+7 -> 0E+5
-dsbas638 toSci 0.00E+8 -> 0E+6
-dsbas639 toSci 0.00E+9 -> 0E+7
-
-dsbas640 toSci 0.0E+0 -> 0.0
-dsbas641 toSci 0.0E+1 -> 0
-dsbas642 toSci 0.0E+2 -> 0E+1
-dsbas643 toSci 0.0E+3 -> 0E+2
-dsbas644 toSci 0.0E+4 -> 0E+3
-dsbas645 toSci 0.0E+5 -> 0E+4
-dsbas646 toSci 0.0E+6 -> 0E+5
-dsbas647 toSci 0.0E+7 -> 0E+6
-dsbas648 toSci 0.0E+8 -> 0E+7
-dsbas649 toSci 0.0E+9 -> 0E+8
-
-dsbas650 toSci 0E+0 -> 0
-dsbas651 toSci 0E+1 -> 0E+1
-dsbas652 toSci 0E+2 -> 0E+2
-dsbas653 toSci 0E+3 -> 0E+3
-dsbas654 toSci 0E+4 -> 0E+4
-dsbas655 toSci 0E+5 -> 0E+5
-dsbas656 toSci 0E+6 -> 0E+6
-dsbas657 toSci 0E+7 -> 0E+7
-dsbas658 toSci 0E+8 -> 0E+8
-dsbas659 toSci 0E+9 -> 0E+9
-
-dsbas660 toSci 0.0E-0 -> 0.0
-dsbas661 toSci 0.0E-1 -> 0.00
-dsbas662 toSci 0.0E-2 -> 0.000
-dsbas663 toSci 0.0E-3 -> 0.0000
-dsbas664 toSci 0.0E-4 -> 0.00000
-dsbas665 toSci 0.0E-5 -> 0.000000
-dsbas666 toSci 0.0E-6 -> 0E-7
-dsbas667 toSci 0.0E-7 -> 0E-8
-dsbas668 toSci 0.0E-8 -> 0E-9
-dsbas669 toSci 0.0E-9 -> 0E-10
-
-dsbas670 toSci 0.00E-0 -> 0.00
-dsbas671 toSci 0.00E-1 -> 0.000
-dsbas672 toSci 0.00E-2 -> 0.0000
-dsbas673 toSci 0.00E-3 -> 0.00000
-dsbas674 toSci 0.00E-4 -> 0.000000
-dsbas675 toSci 0.00E-5 -> 0E-7
-dsbas676 toSci 0.00E-6 -> 0E-8
-dsbas677 toSci 0.00E-7 -> 0E-9
-dsbas678 toSci 0.00E-8 -> 0E-10
-dsbas679 toSci 0.00E-9 -> 0E-11
-
-dsbas680 toSci 000000. -> 0
-dsbas681 toSci 00000. -> 0
-dsbas682 toSci 0000. -> 0
-dsbas683 toSci 000. -> 0
-dsbas684 toSci 00. -> 0
-dsbas685 toSci 0. -> 0
-dsbas686 toSci +00000. -> 0
-dsbas687 toSci -00000. -> -0
-dsbas688 toSci +0. -> 0
-dsbas689 toSci -0. -> -0
-
--- Specials
-dsbas700 toSci "NaN" -> NaN
-dsbas701 toSci "nan" -> NaN
-dsbas702 toSci "nAn" -> NaN
-dsbas703 toSci "NAN" -> NaN
-dsbas704 toSci "+NaN" -> NaN
-dsbas705 toSci "+nan" -> NaN
-dsbas706 toSci "+nAn" -> NaN
-dsbas707 toSci "+NAN" -> NaN
-dsbas708 toSci "-NaN" -> -NaN
-dsbas709 toSci "-nan" -> -NaN
-dsbas710 toSci "-nAn" -> -NaN
-dsbas711 toSci "-NAN" -> -NaN
-dsbas712 toSci 'NaN0' -> NaN
-dsbas713 toSci 'NaN1' -> NaN1
-dsbas714 toSci 'NaN12' -> NaN12
-dsbas715 toSci 'NaN123' -> NaN123
-dsbas716 toSci 'NaN1234' -> NaN1234
-dsbas717 toSci 'NaN01' -> NaN1
-dsbas718 toSci 'NaN012' -> NaN12
-dsbas719 toSci 'NaN0123' -> NaN123
-dsbas720 toSci 'NaN01234' -> NaN1234
-dsbas721 toSci 'NaN001' -> NaN1
-dsbas722 toSci 'NaN0012' -> NaN12
-dsbas723 toSci 'NaN00123' -> NaN123
-dsbas724 toSci 'NaN001234' -> NaN1234
-dsbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax
-dsbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
-dsbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
-dsbas728 toSci 'NaN-12' -> NaN Conversion_syntax
-dsbas729 toSci 'NaN+12' -> NaN Conversion_syntax
-
-dsbas730 toSci "sNaN" -> sNaN
-dsbas731 toSci "snan" -> sNaN
-dsbas732 toSci "SnAn" -> sNaN
-dsbas733 toSci "SNAN" -> sNaN
-dsbas734 toSci "+sNaN" -> sNaN
-dsbas735 toSci "+snan" -> sNaN
-dsbas736 toSci "+SnAn" -> sNaN
-dsbas737 toSci "+SNAN" -> sNaN
-dsbas738 toSci "-sNaN" -> -sNaN
-dsbas739 toSci "-snan" -> -sNaN
-dsbas740 toSci "-SnAn" -> -sNaN
-dsbas741 toSci "-SNAN" -> -sNaN
-dsbas742 toSci 'sNaN0000' -> sNaN
-dsbas743 toSci 'sNaN7' -> sNaN7
-dsbas744 toSci 'sNaN007234' -> sNaN7234
-dsbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax
-dsbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
-dsbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
-
-dsbas748 toSci "Inf" -> Infinity
-dsbas749 toSci "inf" -> Infinity
-dsbas750 toSci "iNf" -> Infinity
-dsbas751 toSci "INF" -> Infinity
-dsbas752 toSci "+Inf" -> Infinity
-dsbas753 toSci "+inf" -> Infinity
-dsbas754 toSci "+iNf" -> Infinity
-dsbas755 toSci "+INF" -> Infinity
-dsbas756 toSci "-Inf" -> -Infinity
-dsbas757 toSci "-inf" -> -Infinity
-dsbas758 toSci "-iNf" -> -Infinity
-dsbas759 toSci "-INF" -> -Infinity
-
-dsbas760 toSci "Infinity" -> Infinity
-dsbas761 toSci "infinity" -> Infinity
-dsbas762 toSci "iNfInItY" -> Infinity
-dsbas763 toSci "INFINITY" -> Infinity
-dsbas764 toSci "+Infinity" -> Infinity
-dsbas765 toSci "+infinity" -> Infinity
-dsbas766 toSci "+iNfInItY" -> Infinity
-dsbas767 toSci "+INFINITY" -> Infinity
-dsbas768 toSci "-Infinity" -> -Infinity
-dsbas769 toSci "-infinity" -> -Infinity
-dsbas770 toSci "-iNfInItY" -> -Infinity
-dsbas771 toSci "-INFINITY" -> -Infinity
-
--- Specials and zeros for toEng
-dsbast772 toEng "NaN" -> NaN
-dsbast773 toEng "-Infinity" -> -Infinity
-dsbast774 toEng "-sNaN" -> -sNaN
-dsbast775 toEng "-NaN" -> -NaN
-dsbast776 toEng "+Infinity" -> Infinity
-dsbast778 toEng "+sNaN" -> sNaN
-dsbast779 toEng "+NaN" -> NaN
-dsbast780 toEng "INFINITY" -> Infinity
-dsbast781 toEng "SNAN" -> sNaN
-dsbast782 toEng "NAN" -> NaN
-dsbast783 toEng "infinity" -> Infinity
-dsbast784 toEng "snan" -> sNaN
-dsbast785 toEng "nan" -> NaN
-dsbast786 toEng "InFINITY" -> Infinity
-dsbast787 toEng "SnAN" -> sNaN
-dsbast788 toEng "nAN" -> NaN
-dsbast789 toEng "iNfinity" -> Infinity
-dsbast790 toEng "sNan" -> sNaN
-dsbast791 toEng "Nan" -> NaN
-dsbast792 toEng "Infinity" -> Infinity
-dsbast793 toEng "sNaN" -> sNaN
-
--- Zero toEng, etc.
-dsbast800 toEng 0e+1 -> "0.00E+3" -- doc example
-
-dsbast801 toEng 0.000000000 -> 0E-9
-dsbast802 toEng 0.00000000 -> 0.00E-6
-dsbast803 toEng 0.0000000 -> 0.0E-6
-dsbast804 toEng 0.000000 -> 0.000000
-dsbast805 toEng 0.00000 -> 0.00000
-dsbast806 toEng 0.0000 -> 0.0000
-dsbast807 toEng 0.000 -> 0.000
-dsbast808 toEng 0.00 -> 0.00
-dsbast809 toEng 0.0 -> 0.0
-dsbast810 toEng .0 -> 0.0
-dsbast811 toEng 0. -> 0
-dsbast812 toEng -.0 -> -0.0
-dsbast813 toEng -0. -> -0
-dsbast814 toEng -0.0 -> -0.0
-dsbast815 toEng -0.00 -> -0.00
-dsbast816 toEng -0.000 -> -0.000
-dsbast817 toEng -0.0000 -> -0.0000
-dsbast818 toEng -0.00000 -> -0.00000
-dsbast819 toEng -0.000000 -> -0.000000
-dsbast820 toEng -0.0000000 -> -0.0E-6
-dsbast821 toEng -0.00000000 -> -0.00E-6
-dsbast822 toEng -0.000000000 -> -0E-9
-
-dsbast830 toEng 0.00E+0 -> 0.00
-dsbast831 toEng 0.00E+1 -> 0.0
-dsbast832 toEng 0.00E+2 -> 0
-dsbast833 toEng 0.00E+3 -> 0.00E+3
-dsbast834 toEng 0.00E+4 -> 0.0E+3
-dsbast835 toEng 0.00E+5 -> 0E+3
-dsbast836 toEng 0.00E+6 -> 0.00E+6
-dsbast837 toEng 0.00E+7 -> 0.0E+6
-dsbast838 toEng 0.00E+8 -> 0E+6
-dsbast839 toEng 0.00E+9 -> 0.00E+9
-
-dsbast840 toEng 0.0E+0 -> 0.0
-dsbast841 toEng 0.0E+1 -> 0
-dsbast842 toEng 0.0E+2 -> 0.00E+3
-dsbast843 toEng 0.0E+3 -> 0.0E+3
-dsbast844 toEng 0.0E+4 -> 0E+3
-dsbast845 toEng 0.0E+5 -> 0.00E+6
-dsbast846 toEng 0.0E+6 -> 0.0E+6
-dsbast847 toEng 0.0E+7 -> 0E+6
-dsbast848 toEng 0.0E+8 -> 0.00E+9
-dsbast849 toEng 0.0E+9 -> 0.0E+9
-
-dsbast850 toEng 0E+0 -> 0
-dsbast851 toEng 0E+1 -> 0.00E+3
-dsbast852 toEng 0E+2 -> 0.0E+3
-dsbast853 toEng 0E+3 -> 0E+3
-dsbast854 toEng 0E+4 -> 0.00E+6
-dsbast855 toEng 0E+5 -> 0.0E+6
-dsbast856 toEng 0E+6 -> 0E+6
-dsbast857 toEng 0E+7 -> 0.00E+9
-dsbast858 toEng 0E+8 -> 0.0E+9
-dsbast859 toEng 0E+9 -> 0E+9
-
-dsbast860 toEng 0.0E-0 -> 0.0
-dsbast861 toEng 0.0E-1 -> 0.00
-dsbast862 toEng 0.0E-2 -> 0.000
-dsbast863 toEng 0.0E-3 -> 0.0000
-dsbast864 toEng 0.0E-4 -> 0.00000
-dsbast865 toEng 0.0E-5 -> 0.000000
-dsbast866 toEng 0.0E-6 -> 0.0E-6
-dsbast867 toEng 0.0E-7 -> 0.00E-6
-dsbast868 toEng 0.0E-8 -> 0E-9
-dsbast869 toEng 0.0E-9 -> 0.0E-9
-
-dsbast870 toEng 0.00E-0 -> 0.00
-dsbast871 toEng 0.00E-1 -> 0.000
-dsbast872 toEng 0.00E-2 -> 0.0000
-dsbast873 toEng 0.00E-3 -> 0.00000
-dsbast874 toEng 0.00E-4 -> 0.000000
-dsbast875 toEng 0.00E-5 -> 0.0E-6
-dsbast876 toEng 0.00E-6 -> 0.00E-6
-dsbast877 toEng 0.00E-7 -> 0E-9
-dsbast878 toEng 0.00E-8 -> 0.0E-9
-dsbast879 toEng 0.00E-9 -> 0.00E-9
-
--- long input strings
-dsbas801 tosci '01234567' -> 1234567
-dsbas802 tosci '001234567' -> 1234567
-dsbas803 tosci '0001234567' -> 1234567
-dsbas804 tosci '00001234567' -> 1234567
-dsbas805 tosci '000001234567' -> 1234567
-dsbas806 tosci '0000001234567' -> 1234567
-dsbas807 tosci '00000001234567' -> 1234567
-dsbas808 tosci '000000001234567' -> 1234567
-dsbas809 tosci '0000000001234567' -> 1234567
-dsbas810 tosci '00000000001234567' -> 1234567
-
-dsbas811 tosci '0.1234567' -> 0.1234567
-dsbas812 tosci '0.01234567' -> 0.01234567
-dsbas813 tosci '0.001234567' -> 0.001234567
-dsbas814 tosci '0.0001234567' -> 0.0001234567
-dsbas815 tosci '0.00001234567' -> 0.00001234567
-dsbas816 tosci '0.000001234567' -> 0.000001234567
-dsbas817 tosci '0.0000001234567' -> 1.234567E-7
-dsbas818 tosci '0.00000001234567' -> 1.234567E-8
-dsbas819 tosci '0.000000001234567' -> 1.234567E-9
-dsbas820 tosci '0.0000000001234567' -> 1.234567E-10
-
-dsbas821 tosci '123456790' -> 1.234568E+8 Inexact Rounded
-dsbas822 tosci '1234567901' -> 1.234568E+9 Inexact Rounded
-dsbas823 tosci '12345679012' -> 1.234568E+10 Inexact Rounded
-dsbas824 tosci '123456790123' -> 1.234568E+11 Inexact Rounded
-dsbas825 tosci '1234567901234' -> 1.234568E+12 Inexact Rounded
-dsbas826 tosci '12345679012345' -> 1.234568E+13 Inexact Rounded
-dsbas827 tosci '123456790123456' -> 1.234568E+14 Inexact Rounded
-dsbas828 tosci '1234567901234567' -> 1.234568E+15 Inexact Rounded
-dsbas829 tosci '1234567890123456' -> 1.234568E+15 Inexact Rounded
-
--- subnormals and overflows
-dsbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
-dsbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
-dsbas908 toSci '0.9e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas909 toSci '0.09e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
-dsbas911 toSci '10e-1000000000' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
-dsbas913 toSci '99e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
-dsbas915 toSci '1111e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas916 toSci '1111e-99999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
--- negatives the same
-dsbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
-dsbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
-dsbas920 toSci '-0.9e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas921 toSci '-0.09e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
-dsbas923 toSci '-10e-1000000000' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
-dsbas925 toSci '-99e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
-dsbas927 toSci '-1111e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas928 toSci '-1111e-99999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
-
--- overflow results at different rounding modes
-rounding: ceiling
-dsbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas931 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded
-rounding: up
-dsbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: down
-dsbas934 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded
-dsbas935 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded
-rounding: floor
-dsbas936 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded
-dsbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_up
-dsbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_even
-dsbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-rounding: half_down
-dsbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
-dsbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
-
-rounding: half_even
-
--- Now check 854/754r some subnormals and underflow to 0
-dsbem400 toSci 1.0000E-86 -> 1.0000E-86
-dsbem401 toSci 0.1E-97 -> 1E-98 Subnormal
-dsbem402 toSci 0.1000E-97 -> 1.000E-98 Subnormal
-dsbem403 toSci 0.0100E-97 -> 1.00E-99 Subnormal
-dsbem404 toSci 0.0010E-97 -> 1.0E-100 Subnormal
-dsbem405 toSci 0.0001E-97 -> 1E-101 Subnormal
-dsbem406 toSci 0.00010E-97 -> 1E-101 Subnormal Rounded
-dsbem407 toSci 0.00013E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
-dsbem408 toSci 0.00015E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem409 toSci 0.00017E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem410 toSci 0.00023E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem411 toSci 0.00025E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem412 toSci 0.00027E-97 -> 3E-101 Underflow Subnormal Inexact Rounded
-dsbem413 toSci 0.000149E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
-dsbem414 toSci 0.000150E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem415 toSci 0.000151E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem416 toSci 0.000249E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem417 toSci 0.000250E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
-dsbem418 toSci 0.000251E-97 -> 3E-101 Underflow Subnormal Inexact Rounded
-dsbem419 toSci 0.00009E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
-dsbem420 toSci 0.00005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem421 toSci 0.00003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem422 toSci 0.000009E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem423 toSci 0.000005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem424 toSci 0.000003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-
-dsbem425 toSci 0.001049E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
-dsbem426 toSci 0.001050E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
-dsbem427 toSci 0.001051E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded
-dsbem428 toSci 0.001149E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded
-dsbem429 toSci 0.001150E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded
-dsbem430 toSci 0.001151E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded
-
-dsbem432 toSci 0.010049E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
-dsbem433 toSci 0.010050E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
-dsbem434 toSci 0.010051E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded
-dsbem435 toSci 0.010149E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded
-dsbem436 toSci 0.010150E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded
-dsbem437 toSci 0.010151E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded
-
-dsbem440 toSci 0.10103E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded
-dsbem441 toSci 0.10105E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded
-dsbem442 toSci 0.10107E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded
-dsbem443 toSci 0.10113E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded
-dsbem444 toSci 0.10115E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded
-dsbem445 toSci 0.10117E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded
-
-dsbem450 toSci 1.10730E-98 -> 1.107E-98 Underflow Subnormal Inexact Rounded
-dsbem451 toSci 1.10750E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
-dsbem452 toSci 1.10770E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
-dsbem453 toSci 1.10830E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
-dsbem454 toSci 1.10850E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
-dsbem455 toSci 1.10870E-98 -> 1.109E-98 Underflow Subnormal Inexact Rounded
-
--- make sure sign OK
-dsbem456 toSci -0.10103E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded
-dsbem457 toSci -0.10105E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded
-dsbem458 toSci -0.10107E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded
-dsbem459 toSci -0.10113E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded
-dsbem460 toSci -0.10115E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded
-dsbem461 toSci -0.10117E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded
-
--- '999s' cases
-dsbem464 toSci 999999E-98 -> 9.99999E-93
-dsbem465 toSci 99999.0E-97 -> 9.99990E-93
-dsbem466 toSci 99999.E-97 -> 9.9999E-93
-dsbem467 toSci 9999.9E-97 -> 9.9999E-94
-dsbem468 toSci 999.99E-97 -> 9.9999E-95
-dsbem469 toSci 99.999E-97 -> 9.9999E-96 Subnormal
-dsbem470 toSci 9.9999E-97 -> 9.9999E-97 Subnormal
-dsbem471 toSci 0.99999E-97 -> 1.0000E-97 Underflow Subnormal Inexact Rounded
-dsbem472 toSci 0.099999E-97 -> 1.000E-98 Underflow Subnormal Inexact Rounded
-dsbem473 toSci 0.0099999E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
-dsbem474 toSci 0.00099999E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
-dsbem475 toSci 0.000099999E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
-dsbem476 toSci 0.0000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem477 toSci 0.00000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbem478 toSci 0.000000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-
--- Exponents with insignificant leading zeros
-dsbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
-dsbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
-dsbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
-dsbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
-dsbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
-dsbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
-dsbas1007 toSci 1e-999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1008 toSci 1e-0999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1009 toSci 1e-00999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1010 toSci 1e-000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1011 toSci 1e-000000000000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-dsbas1012 toSci 1e-000000000001000000007 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
-
--- check for double-rounded subnormals
-dsbas1041 toSci 1.1152444E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
-dsbas1042 toSci 1.1152445E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
-dsbas1043 toSci 1.1152446E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
-
--- clamped zeros [see also clamp.decTest]
-dsbas1075 toSci 0e+10000 -> 0E+90 Clamped
-dsbas1076 toSci 0e-10000 -> 0E-101 Clamped
-dsbas1077 toSci -0e+10000 -> -0E+90 Clamped
-dsbas1078 toSci -0e-10000 -> -0E-101 Clamped
-
--- extreme values from next-wider
-dsbas1101 toSci -9.999999999999999E+384 -> -Infinity Overflow Inexact Rounded
-dsbas1102 toSci -1E-383 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped
-dsbas1103 toSci -1E-398 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped
-dsbas1104 toSci -0 -> -0
-dsbas1105 toSci +0 -> 0
-dsbas1106 toSci +1E-398 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped
-dsbas1107 toSci +1E-383 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped
-dsbas1108 toSci +9.999999999999999E+384 -> Infinity Overflow Inexact Rounded
-
--- narrowing case
-dsbas1110 toSci 2.000000000000000E-99 -> 2.00E-99 Rounded Subnormal
+------------------------------------------------------------------------
+-- dsBase.decTest -- base decSingle <--> string conversions --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This file tests base conversions from string to a decimal number
+-- and back to a string (in Scientific form)
+
+-- Note that unlike other operations the operand is subject to rounding
+-- to conform to emax and precision settings (that is, numbers will
+-- conform to rules and exponent will be in permitted range). The
+-- 'left hand side', therefore, may have numbers that cannot be
+-- represented in a decSingle. Some testcases go to the limit of the
+-- next-wider format, and hence these testcases may also be used to
+-- test narrowing and widening operations.
+
+extended: 1
+clamp: 1
+precision: 7
+maxExponent: 96
+minExponent: -95
+rounding: half_even
+
+dsbas001 toSci 0 -> 0
+dsbas002 toSci 1 -> 1
+dsbas003 toSci 1.0 -> 1.0
+dsbas004 toSci 1.00 -> 1.00
+dsbas005 toSci 10 -> 10
+dsbas006 toSci 1000 -> 1000
+dsbas007 toSci 10.0 -> 10.0
+dsbas008 toSci 10.1 -> 10.1
+dsbas009 toSci 10.4 -> 10.4
+dsbas010 toSci 10.5 -> 10.5
+dsbas011 toSci 10.6 -> 10.6
+dsbas012 toSci 10.9 -> 10.9
+dsbas013 toSci 11.0 -> 11.0
+dsbas014 toSci 1.234 -> 1.234
+dsbas015 toSci 0.123 -> 0.123
+dsbas016 toSci 0.012 -> 0.012
+dsbas017 toSci -0 -> -0
+dsbas018 toSci -0.0 -> -0.0
+dsbas019 toSci -00.00 -> -0.00
+
+dsbas021 toSci -1 -> -1
+dsbas022 toSci -1.0 -> -1.0
+dsbas023 toSci -0.1 -> -0.1
+dsbas024 toSci -9.1 -> -9.1
+dsbas025 toSci -9.11 -> -9.11
+dsbas026 toSci -9.119 -> -9.119
+dsbas027 toSci -9.999 -> -9.999
+
+dsbas030 toSci '1234.567' -> '1234.567'
+dsbas031 toSci '1234.000' -> '1234.000'
+dsbas032 toSci '1234912' -> '1234912'
+dsbas033 toSci '0.00001234567' -> '0.00001234567'
+dsbas034 toSci '0.000001234567' -> '0.000001234567'
+dsbas035 toSci '0.0000001234567' -> '1.234567E-7'
+dsbas036 toSci '0.00000001234567' -> '1.234567E-8'
+
+dsbas037 toSci '0.1234564' -> '0.1234564'
+dsbas038 toSci '0.1234565' -> '0.1234565'
+
+-- test finite bounds (Negs of, then 0, Ntiny, Nmin, other, Nmax)
+dsbsn001 toSci -9.999999E+96 -> -9.999999E+96
+dsbsn002 toSci -1E-95 -> -1E-95
+dsbsn003 toSci -1E-101 -> -1E-101 Subnormal
+dsbsn004 toSci -0 -> -0
+dsbsn005 toSci +0 -> 0
+dsbsn006 toSci +1E-101 -> 1E-101 Subnormal
+dsbsn007 toSci +1E-95 -> 1E-95
+dsbsn008 toSci +9.999999E+96 -> 9.999999E+96
+
+-- String [many more examples are implicitly tested elsewhere]
+-- strings without E cannot generate E in result
+dsbas040 toSci "12" -> '12'
+dsbas041 toSci "-76" -> '-76'
+dsbas042 toSci "12.76" -> '12.76'
+dsbas043 toSci "+12.76" -> '12.76'
+dsbas044 toSci "012.76" -> '12.76'
+dsbas045 toSci "+0.003" -> '0.003'
+dsbas046 toSci "17." -> '17'
+dsbas047 toSci ".5" -> '0.5'
+dsbas048 toSci "044" -> '44'
+dsbas049 toSci "0044" -> '44'
+dsbas050 toSci "0.0005" -> '0.0005'
+dsbas051 toSci "00.00005" -> '0.00005'
+dsbas052 toSci "0.000005" -> '0.000005'
+dsbas053 toSci "0.0000050" -> '0.0000050'
+dsbas054 toSci "0.0000005" -> '5E-7'
+dsbas055 toSci "0.00000005" -> '5E-8'
+dsbas056 toSci "12678.54" -> '12678.54'
+dsbas057 toSci "2678.543" -> '2678.543'
+dsbas058 toSci "345678.5" -> '345678.5'
+dsbas059 toSci "0678.5432" -> '678.5432'
+dsbas060 toSci "678.5432" -> '678.5432'
+dsbas061 toSci "+678.5432" -> '678.5432'
+dsbas062 toSci "+0678.5432" -> '678.5432'
+dsbas063 toSci "+00678.5432" -> '678.5432'
+dsbas064 toSci "-678.5432" -> '-678.5432'
+dsbas065 toSci "-0678.5432" -> '-678.5432'
+dsbas066 toSci "-00678.5432" -> '-678.5432'
+-- examples
+dsbas067 toSci "5E-6" -> '0.000005'
+dsbas068 toSci "50E-7" -> '0.0000050'
+dsbas069 toSci "5E-7" -> '5E-7'
+
+-- [No exotics as no Unicode]
+
+-- rounded with dots in all (including edge) places
+dsbas071 toSci .1234567890123456 -> 0.1234568 Inexact Rounded
+dsbas072 toSci 1.234567890123456 -> 1.234568 Inexact Rounded
+dsbas073 toSci 12.34567890123456 -> 12.34568 Inexact Rounded
+dsbas074 toSci 123.4567890123456 -> 123.4568 Inexact Rounded
+dsbas075 toSci 1234.567890123456 -> 1234.568 Inexact Rounded
+dsbas076 toSci 12345.67890123456 -> 12345.68 Inexact Rounded
+dsbas077 toSci 123456.7890123456 -> 123456.8 Inexact Rounded
+dsbas078 toSci 1234567.890123456 -> 1234568 Inexact Rounded
+dsbas079 toSci 12345678.90123456 -> 1.234568E+7 Inexact Rounded
+dsbas080 toSci 123456789.0123456 -> 1.234568E+8 Inexact Rounded
+dsbas081 toSci 1234567890.123456 -> 1.234568E+9 Inexact Rounded
+dsbas082 toSci 12345678901.23456 -> 1.234568E+10 Inexact Rounded
+dsbas083 toSci 123456789012.3456 -> 1.234568E+11 Inexact Rounded
+dsbas084 toSci 1234567890123.456 -> 1.234568E+12 Inexact Rounded
+dsbas085 toSci 12345678901234.56 -> 1.234568E+13 Inexact Rounded
+dsbas086 toSci 123456789012345.6 -> 1.234568E+14 Inexact Rounded
+dsbas087 toSci 1234567890123456. -> 1.234568E+15 Inexact Rounded
+dsbas088 toSci 1234567890123456 -> 1.234568E+15 Inexact Rounded
+
+-- Numbers with E
+dsbas130 toSci "0.000E-1" -> '0.0000'
+dsbas131 toSci "0.000E-2" -> '0.00000'
+dsbas132 toSci "0.000E-3" -> '0.000000'
+dsbas133 toSci "0.000E-4" -> '0E-7'
+dsbas134 toSci "0.00E-2" -> '0.0000'
+dsbas135 toSci "0.00E-3" -> '0.00000'
+dsbas136 toSci "0.00E-4" -> '0.000000'
+dsbas137 toSci "0.00E-5" -> '0E-7'
+dsbas138 toSci "+0E+9" -> '0E+9'
+dsbas139 toSci "-0E+9" -> '-0E+9'
+dsbas140 toSci "1E+9" -> '1E+9'
+dsbas141 toSci "1e+09" -> '1E+9'
+dsbas142 toSci "1E+90" -> '1E+90'
+dsbas143 toSci "+1E+009" -> '1E+9'
+dsbas144 toSci "0E+9" -> '0E+9'
+dsbas145 toSci "1E+9" -> '1E+9'
+dsbas146 toSci "1E+09" -> '1E+9'
+dsbas147 toSci "1e+90" -> '1E+90'
+dsbas148 toSci "1E+009" -> '1E+9'
+dsbas149 toSci "000E+9" -> '0E+9'
+dsbas150 toSci "1E9" -> '1E+9'
+dsbas151 toSci "1e09" -> '1E+9'
+dsbas152 toSci "1E90" -> '1E+90'
+dsbas153 toSci "1E009" -> '1E+9'
+dsbas154 toSci "0E9" -> '0E+9'
+dsbas155 toSci "0.000e+0" -> '0.000'
+dsbas156 toSci "0.000E-1" -> '0.0000'
+dsbas157 toSci "4E+9" -> '4E+9'
+dsbas158 toSci "44E+9" -> '4.4E+10'
+dsbas159 toSci "0.73e-7" -> '7.3E-8'
+dsbas160 toSci "00E+9" -> '0E+9'
+dsbas161 toSci "00E-9" -> '0E-9'
+dsbas162 toSci "10E+9" -> '1.0E+10'
+dsbas163 toSci "10E+09" -> '1.0E+10'
+dsbas164 toSci "10e+90" -> '1.0E+91'
+dsbas165 toSci "10E+009" -> '1.0E+10'
+dsbas166 toSci "100e+9" -> '1.00E+11'
+dsbas167 toSci "100e+09" -> '1.00E+11'
+dsbas168 toSci "100E+90" -> '1.00E+92'
+dsbas169 toSci "100e+009" -> '1.00E+11'
+
+dsbas170 toSci "1.265" -> '1.265'
+dsbas171 toSci "1.265E-20" -> '1.265E-20'
+dsbas172 toSci "1.265E-8" -> '1.265E-8'
+dsbas173 toSci "1.265E-4" -> '0.0001265'
+dsbas174 toSci "1.265E-3" -> '0.001265'
+dsbas175 toSci "1.265E-2" -> '0.01265'
+dsbas176 toSci "1.265E-1" -> '0.1265'
+dsbas177 toSci "1.265E-0" -> '1.265'
+dsbas178 toSci "1.265E+1" -> '12.65'
+dsbas179 toSci "1.265E+2" -> '126.5'
+dsbas180 toSci "1.265E+3" -> '1265'
+dsbas181 toSci "1.265E+4" -> '1.265E+4'
+dsbas182 toSci "1.265E+8" -> '1.265E+8'
+dsbas183 toSci "1.265E+20" -> '1.265E+20'
+
+dsbas190 toSci "12.65" -> '12.65'
+dsbas191 toSci "12.65E-20" -> '1.265E-19'
+dsbas192 toSci "12.65E-8" -> '1.265E-7'
+dsbas193 toSci "12.65E-4" -> '0.001265'
+dsbas194 toSci "12.65E-3" -> '0.01265'
+dsbas195 toSci "12.65E-2" -> '0.1265'
+dsbas196 toSci "12.65E-1" -> '1.265'
+dsbas197 toSci "12.65E-0" -> '12.65'
+dsbas198 toSci "12.65E+1" -> '126.5'
+dsbas199 toSci "12.65E+2" -> '1265'
+dsbas200 toSci "12.65E+3" -> '1.265E+4'
+dsbas201 toSci "12.65E+4" -> '1.265E+5'
+dsbas202 toSci "12.65E+8" -> '1.265E+9'
+dsbas203 toSci "12.65E+20" -> '1.265E+21'
+
+dsbas210 toSci "126.5" -> '126.5'
+dsbas211 toSci "126.5E-20" -> '1.265E-18'
+dsbas212 toSci "126.5E-8" -> '0.000001265'
+dsbas213 toSci "126.5E-4" -> '0.01265'
+dsbas214 toSci "126.5E-3" -> '0.1265'
+dsbas215 toSci "126.5E-2" -> '1.265'
+dsbas216 toSci "126.5E-1" -> '12.65'
+dsbas217 toSci "126.5E-0" -> '126.5'
+dsbas218 toSci "126.5E+1" -> '1265'
+dsbas219 toSci "126.5E+2" -> '1.265E+4'
+dsbas220 toSci "126.5E+3" -> '1.265E+5'
+dsbas221 toSci "126.5E+4" -> '1.265E+6'
+dsbas222 toSci "126.5E+8" -> '1.265E+10'
+dsbas223 toSci "126.5E+20" -> '1.265E+22'
+
+dsbas230 toSci "1265" -> '1265'
+dsbas231 toSci "1265E-20" -> '1.265E-17'
+dsbas232 toSci "1265E-8" -> '0.00001265'
+dsbas233 toSci "1265E-4" -> '0.1265'
+dsbas234 toSci "1265E-3" -> '1.265'
+dsbas235 toSci "1265E-2" -> '12.65'
+dsbas236 toSci "1265E-1" -> '126.5'
+dsbas237 toSci "1265E-0" -> '1265'
+dsbas238 toSci "1265E+1" -> '1.265E+4'
+dsbas239 toSci "1265E+2" -> '1.265E+5'
+dsbas240 toSci "1265E+3" -> '1.265E+6'
+dsbas241 toSci "1265E+4" -> '1.265E+7'
+dsbas242 toSci "1265E+8" -> '1.265E+11'
+dsbas243 toSci "1265E+20" -> '1.265E+23'
+
+dsbas250 toSci "0.1265" -> '0.1265'
+dsbas251 toSci "0.1265E-20" -> '1.265E-21'
+dsbas252 toSci "0.1265E-8" -> '1.265E-9'
+dsbas253 toSci "0.1265E-4" -> '0.00001265'
+dsbas254 toSci "0.1265E-3" -> '0.0001265'
+dsbas255 toSci "0.1265E-2" -> '0.001265'
+dsbas256 toSci "0.1265E-1" -> '0.01265'
+dsbas257 toSci "0.1265E-0" -> '0.1265'
+dsbas258 toSci "0.1265E+1" -> '1.265'
+dsbas259 toSci "0.1265E+2" -> '12.65'
+dsbas260 toSci "0.1265E+3" -> '126.5'
+dsbas261 toSci "0.1265E+4" -> '1265'
+dsbas262 toSci "0.1265E+8" -> '1.265E+7'
+dsbas263 toSci "0.1265E+20" -> '1.265E+19'
+
+-- some more negative zeros [systematic tests below]
+dsbas290 toSci "-0.000E-1" -> '-0.0000'
+dsbas291 toSci "-0.000E-2" -> '-0.00000'
+dsbas292 toSci "-0.000E-3" -> '-0.000000'
+dsbas293 toSci "-0.000E-4" -> '-0E-7'
+dsbas294 toSci "-0.00E-2" -> '-0.0000'
+dsbas295 toSci "-0.00E-3" -> '-0.00000'
+dsbas296 toSci "-0.0E-2" -> '-0.000'
+dsbas297 toSci "-0.0E-3" -> '-0.0000'
+dsbas298 toSci "-0E-2" -> '-0.00'
+dsbas299 toSci "-0E-3" -> '-0.000'
+
+-- Engineering notation tests
+dsbas301 toSci 10e12 -> 1.0E+13
+dsbas302 toEng 10e12 -> 10E+12
+dsbas303 toSci 10e11 -> 1.0E+12
+dsbas304 toEng 10e11 -> 1.0E+12
+dsbas305 toSci 10e10 -> 1.0E+11
+dsbas306 toEng 10e10 -> 100E+9
+dsbas307 toSci 10e9 -> 1.0E+10
+dsbas308 toEng 10e9 -> 10E+9
+dsbas309 toSci 10e8 -> 1.0E+9
+dsbas310 toEng 10e8 -> 1.0E+9
+dsbas311 toSci 10e7 -> 1.0E+8
+dsbas312 toEng 10e7 -> 100E+6
+dsbas313 toSci 10e6 -> 1.0E+7
+dsbas314 toEng 10e6 -> 10E+6
+dsbas315 toSci 10e5 -> 1.0E+6
+dsbas316 toEng 10e5 -> 1.0E+6
+dsbas317 toSci 10e4 -> 1.0E+5
+dsbas318 toEng 10e4 -> 100E+3
+dsbas319 toSci 10e3 -> 1.0E+4
+dsbas320 toEng 10e3 -> 10E+3
+dsbas321 toSci 10e2 -> 1.0E+3
+dsbas322 toEng 10e2 -> 1.0E+3
+dsbas323 toSci 10e1 -> 1.0E+2
+dsbas324 toEng 10e1 -> 100
+dsbas325 toSci 10e0 -> 10
+dsbas326 toEng 10e0 -> 10
+dsbas327 toSci 10e-1 -> 1.0
+dsbas328 toEng 10e-1 -> 1.0
+dsbas329 toSci 10e-2 -> 0.10
+dsbas330 toEng 10e-2 -> 0.10
+dsbas331 toSci 10e-3 -> 0.010
+dsbas332 toEng 10e-3 -> 0.010
+dsbas333 toSci 10e-4 -> 0.0010
+dsbas334 toEng 10e-4 -> 0.0010
+dsbas335 toSci 10e-5 -> 0.00010
+dsbas336 toEng 10e-5 -> 0.00010
+dsbas337 toSci 10e-6 -> 0.000010
+dsbas338 toEng 10e-6 -> 0.000010
+dsbas339 toSci 10e-7 -> 0.0000010
+dsbas340 toEng 10e-7 -> 0.0000010
+dsbas341 toSci 10e-8 -> 1.0E-7
+dsbas342 toEng 10e-8 -> 100E-9
+dsbas343 toSci 10e-9 -> 1.0E-8
+dsbas344 toEng 10e-9 -> 10E-9
+dsbas345 toSci 10e-10 -> 1.0E-9
+dsbas346 toEng 10e-10 -> 1.0E-9
+dsbas347 toSci 10e-11 -> 1.0E-10
+dsbas348 toEng 10e-11 -> 100E-12
+dsbas349 toSci 10e-12 -> 1.0E-11
+dsbas350 toEng 10e-12 -> 10E-12
+dsbas351 toSci 10e-13 -> 1.0E-12
+dsbas352 toEng 10e-13 -> 1.0E-12
+
+dsbas361 toSci 7E12 -> 7E+12
+dsbas362 toEng 7E12 -> 7E+12
+dsbas363 toSci 7E11 -> 7E+11
+dsbas364 toEng 7E11 -> 700E+9
+dsbas365 toSci 7E10 -> 7E+10
+dsbas366 toEng 7E10 -> 70E+9
+dsbas367 toSci 7E9 -> 7E+9
+dsbas368 toEng 7E9 -> 7E+9
+dsbas369 toSci 7E8 -> 7E+8
+dsbas370 toEng 7E8 -> 700E+6
+dsbas371 toSci 7E7 -> 7E+7
+dsbas372 toEng 7E7 -> 70E+6
+dsbas373 toSci 7E6 -> 7E+6
+dsbas374 toEng 7E6 -> 7E+6
+dsbas375 toSci 7E5 -> 7E+5
+dsbas376 toEng 7E5 -> 700E+3
+dsbas377 toSci 7E4 -> 7E+4
+dsbas378 toEng 7E4 -> 70E+3
+dsbas379 toSci 7E3 -> 7E+3
+dsbas380 toEng 7E3 -> 7E+3
+dsbas381 toSci 7E2 -> 7E+2
+dsbas382 toEng 7E2 -> 700
+dsbas383 toSci 7E1 -> 7E+1
+dsbas384 toEng 7E1 -> 70
+dsbas385 toSci 7E0 -> 7
+dsbas386 toEng 7E0 -> 7
+dsbas387 toSci 7E-1 -> 0.7
+dsbas388 toEng 7E-1 -> 0.7
+dsbas389 toSci 7E-2 -> 0.07
+dsbas390 toEng 7E-2 -> 0.07
+dsbas391 toSci 7E-3 -> 0.007
+dsbas392 toEng 7E-3 -> 0.007
+dsbas393 toSci 7E-4 -> 0.0007
+dsbas394 toEng 7E-4 -> 0.0007
+dsbas395 toSci 7E-5 -> 0.00007
+dsbas396 toEng 7E-5 -> 0.00007
+dsbas397 toSci 7E-6 -> 0.000007
+dsbas398 toEng 7E-6 -> 0.000007
+dsbas399 toSci 7E-7 -> 7E-7
+dsbas400 toEng 7E-7 -> 700E-9
+dsbas401 toSci 7E-8 -> 7E-8
+dsbas402 toEng 7E-8 -> 70E-9
+dsbas403 toSci 7E-9 -> 7E-9
+dsbas404 toEng 7E-9 -> 7E-9
+dsbas405 toSci 7E-10 -> 7E-10
+dsbas406 toEng 7E-10 -> 700E-12
+dsbas407 toSci 7E-11 -> 7E-11
+dsbas408 toEng 7E-11 -> 70E-12
+dsbas409 toSci 7E-12 -> 7E-12
+dsbas410 toEng 7E-12 -> 7E-12
+dsbas411 toSci 7E-13 -> 7E-13
+dsbas412 toEng 7E-13 -> 700E-15
+
+-- Exacts remain exact up to precision ..
+dsbas420 toSci 100 -> 100
+dsbas422 toSci 1000 -> 1000
+dsbas424 toSci 999.9 -> 999.9
+dsbas426 toSci 1000.0 -> 1000.0
+dsbas428 toSci 1000.1 -> 1000.1
+dsbas430 toSci 10000 -> 10000
+dsbas432 toSci 1000 -> 1000
+dsbas434 toSci 10000 -> 10000
+dsbas436 toSci 100000 -> 100000
+dsbas438 toSci 1000000 -> 1000000
+dsbas440 toSci 10000000 -> 1.000000E+7 Rounded
+dsbas442 toSci 10000000 -> 1.000000E+7 Rounded
+dsbas444 toSci 10000003 -> 1.000000E+7 Rounded Inexact
+dsbas446 toSci 10000005 -> 1.000000E+7 Rounded Inexact
+dsbas448 toSci 100000050 -> 1.000000E+8 Rounded Inexact
+dsbas450 toSci 10000009 -> 1.000001E+7 Rounded Inexact
+dsbas452 toSci 100000000 -> 1.000000E+8 Rounded
+dsbas454 toSci 100000003 -> 1.000000E+8 Rounded Inexact
+dsbas456 toSci 100000005 -> 1.000000E+8 Rounded Inexact
+dsbas458 toSci 100000009 -> 1.000000E+8 Rounded Inexact
+dsbas460 toSci 1000000000 -> 1.000000E+9 Rounded
+dsbas462 toSci 1000000300 -> 1.000000E+9 Rounded Inexact
+dsbas464 toSci 1000000500 -> 1.000000E+9 Rounded Inexact
+dsbas466 toSci 1000000900 -> 1.000001E+9 Rounded Inexact
+dsbas468 toSci 10000000000 -> 1.000000E+10 Rounded
+dsbas470 toSci 10000003000 -> 1.000000E+10 Rounded Inexact
+dsbas472 toSci 10000005000 -> 1.000000E+10 Rounded Inexact
+dsbas474 toSci 10000009000 -> 1.000001E+10 Rounded Inexact
+
+-- check rounding modes heeded
+rounding: ceiling
+dsbsr401 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr402 toSci 1.11234549 -> 1.112346 Rounded Inexact
+dsbsr403 toSci 1.11234550 -> 1.112346 Rounded Inexact
+dsbsr404 toSci 1.11234551 -> 1.112346 Rounded Inexact
+rounding: up
+dsbsr405 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr406 toSci 1.11234549 -> 1.112346 Rounded Inexact
+dsbsr407 toSci 1.11234550 -> 1.112346 Rounded Inexact
+dsbsr408 toSci 1.11234551 -> 1.112346 Rounded Inexact
+rounding: floor
+dsbsr410 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr411 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr412 toSci 1.11234550 -> 1.112345 Rounded Inexact
+dsbsr413 toSci 1.11234551 -> 1.112345 Rounded Inexact
+rounding: half_down
+dsbsr415 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr416 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr417 toSci 1.11234550 -> 1.112345 Rounded Inexact
+dsbsr418 toSci 1.11234650 -> 1.112346 Rounded Inexact
+dsbsr419 toSci 1.11234551 -> 1.112346 Rounded Inexact
+rounding: half_even
+dsbsr421 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr422 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr423 toSci 1.11234550 -> 1.112346 Rounded Inexact
+dsbsr424 toSci 1.11234650 -> 1.112346 Rounded Inexact
+dsbsr425 toSci 1.11234551 -> 1.112346 Rounded Inexact
+rounding: down
+dsbsr426 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr427 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr428 toSci 1.11234550 -> 1.112345 Rounded Inexact
+dsbsr429 toSci 1.11234551 -> 1.112345 Rounded Inexact
+rounding: half_up
+dsbsr431 toSci 1.1123450 -> 1.112345 Rounded
+dsbsr432 toSci 1.11234549 -> 1.112345 Rounded Inexact
+dsbsr433 toSci 1.11234550 -> 1.112346 Rounded Inexact
+dsbsr434 toSci 1.11234650 -> 1.112347 Rounded Inexact
+dsbsr435 toSci 1.11234551 -> 1.112346 Rounded Inexact
+-- negatives
+rounding: ceiling
+dsbsr501 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr502 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr503 toSci -1.11234550 -> -1.112345 Rounded Inexact
+dsbsr504 toSci -1.11234551 -> -1.112345 Rounded Inexact
+rounding: up
+dsbsr505 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr506 toSci -1.11234549 -> -1.112346 Rounded Inexact
+dsbsr507 toSci -1.11234550 -> -1.112346 Rounded Inexact
+dsbsr508 toSci -1.11234551 -> -1.112346 Rounded Inexact
+rounding: floor
+dsbsr510 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr511 toSci -1.11234549 -> -1.112346 Rounded Inexact
+dsbsr512 toSci -1.11234550 -> -1.112346 Rounded Inexact
+dsbsr513 toSci -1.11234551 -> -1.112346 Rounded Inexact
+rounding: half_down
+dsbsr515 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr516 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr517 toSci -1.11234550 -> -1.112345 Rounded Inexact
+dsbsr518 toSci -1.11234650 -> -1.112346 Rounded Inexact
+dsbsr519 toSci -1.11234551 -> -1.112346 Rounded Inexact
+rounding: half_even
+dsbsr521 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr522 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr523 toSci -1.11234550 -> -1.112346 Rounded Inexact
+dsbsr524 toSci -1.11234650 -> -1.112346 Rounded Inexact
+dsbsr525 toSci -1.11234551 -> -1.112346 Rounded Inexact
+rounding: down
+dsbsr526 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr527 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr528 toSci -1.11234550 -> -1.112345 Rounded Inexact
+dsbsr529 toSci -1.11234551 -> -1.112345 Rounded Inexact
+rounding: half_up
+dsbsr531 toSci -1.1123450 -> -1.112345 Rounded
+dsbsr532 toSci -1.11234549 -> -1.112345 Rounded Inexact
+dsbsr533 toSci -1.11234550 -> -1.112346 Rounded Inexact
+dsbsr534 toSci -1.11234650 -> -1.112347 Rounded Inexact
+dsbsr535 toSci -1.11234551 -> -1.112346 Rounded Inexact
+
+rounding: half_even
+
+-- The 'baddies' tests from DiagBigDecimal, plus some new ones
+dsbas500 toSci '1..2' -> NaN Conversion_syntax
+dsbas501 toSci '.' -> NaN Conversion_syntax
+dsbas502 toSci '..' -> NaN Conversion_syntax
+dsbas503 toSci '++1' -> NaN Conversion_syntax
+dsbas504 toSci '--1' -> NaN Conversion_syntax
+dsbas505 toSci '-+1' -> NaN Conversion_syntax
+dsbas506 toSci '+-1' -> NaN Conversion_syntax
+dsbas507 toSci '12e' -> NaN Conversion_syntax
+dsbas508 toSci '12e++' -> NaN Conversion_syntax
+dsbas509 toSci '12f4' -> NaN Conversion_syntax
+dsbas510 toSci ' +1' -> NaN Conversion_syntax
+dsbas511 toSci '+ 1' -> NaN Conversion_syntax
+dsbas512 toSci '12 ' -> NaN Conversion_syntax
+dsbas513 toSci ' + 1' -> NaN Conversion_syntax
+dsbas514 toSci ' - 1 ' -> NaN Conversion_syntax
+dsbas515 toSci 'x' -> NaN Conversion_syntax
+dsbas516 toSci '-1-' -> NaN Conversion_syntax
+dsbas517 toSci '12-' -> NaN Conversion_syntax
+dsbas518 toSci '3+' -> NaN Conversion_syntax
+dsbas519 toSci '' -> NaN Conversion_syntax
+dsbas520 toSci '1e-' -> NaN Conversion_syntax
+dsbas521 toSci '7e99999a' -> NaN Conversion_syntax
+dsbas522 toSci '7e123567890x' -> NaN Conversion_syntax
+dsbas523 toSci '7e12356789012x' -> NaN Conversion_syntax
+dsbas524 toSci '' -> NaN Conversion_syntax
+dsbas525 toSci 'e100' -> NaN Conversion_syntax
+dsbas526 toSci '\u0e5a' -> NaN Conversion_syntax
+dsbas527 toSci '\u0b65' -> NaN Conversion_syntax
+dsbas528 toSci '123,65' -> NaN Conversion_syntax
+dsbas529 toSci '1.34.5' -> NaN Conversion_syntax
+dsbas530 toSci '.123.5' -> NaN Conversion_syntax
+dsbas531 toSci '01.35.' -> NaN Conversion_syntax
+dsbas532 toSci '01.35-' -> NaN Conversion_syntax
+dsbas533 toSci '0000..' -> NaN Conversion_syntax
+dsbas534 toSci '.0000.' -> NaN Conversion_syntax
+dsbas535 toSci '00..00' -> NaN Conversion_syntax
+dsbas536 toSci '111e*123' -> NaN Conversion_syntax
+dsbas537 toSci '111e123-' -> NaN Conversion_syntax
+dsbas538 toSci '111e+12+' -> NaN Conversion_syntax
+dsbas539 toSci '111e1-3-' -> NaN Conversion_syntax
+dsbas540 toSci '111e1*23' -> NaN Conversion_syntax
+dsbas541 toSci '111e1e+3' -> NaN Conversion_syntax
+dsbas542 toSci '1e1.0' -> NaN Conversion_syntax
+dsbas543 toSci '1e123e' -> NaN Conversion_syntax
+dsbas544 toSci 'ten' -> NaN Conversion_syntax
+dsbas545 toSci 'ONE' -> NaN Conversion_syntax
+dsbas546 toSci '1e.1' -> NaN Conversion_syntax
+dsbas547 toSci '1e1.' -> NaN Conversion_syntax
+dsbas548 toSci '1ee' -> NaN Conversion_syntax
+dsbas549 toSci 'e+1' -> NaN Conversion_syntax
+dsbas550 toSci '1.23.4' -> NaN Conversion_syntax
+dsbas551 toSci '1.2.1' -> NaN Conversion_syntax
+dsbas552 toSci '1E+1.2' -> NaN Conversion_syntax
+dsbas553 toSci '1E+1.2.3' -> NaN Conversion_syntax
+dsbas554 toSci '1E++1' -> NaN Conversion_syntax
+dsbas555 toSci '1E--1' -> NaN Conversion_syntax
+dsbas556 toSci '1E+-1' -> NaN Conversion_syntax
+dsbas557 toSci '1E-+1' -> NaN Conversion_syntax
+dsbas558 toSci '1E''1' -> NaN Conversion_syntax
+dsbas559 toSci "1E""1" -> NaN Conversion_syntax
+dsbas560 toSci "1E""""" -> NaN Conversion_syntax
+-- Near-specials
+dsbas561 toSci "qNaN" -> NaN Conversion_syntax
+dsbas562 toSci "NaNq" -> NaN Conversion_syntax
+dsbas563 toSci "NaNs" -> NaN Conversion_syntax
+dsbas564 toSci "Infi" -> NaN Conversion_syntax
+dsbas565 toSci "Infin" -> NaN Conversion_syntax
+dsbas566 toSci "Infini" -> NaN Conversion_syntax
+dsbas567 toSci "Infinit" -> NaN Conversion_syntax
+dsbas568 toSci "-Infinit" -> NaN Conversion_syntax
+dsbas569 toSci "0Inf" -> NaN Conversion_syntax
+dsbas570 toSci "9Inf" -> NaN Conversion_syntax
+dsbas571 toSci "-0Inf" -> NaN Conversion_syntax
+dsbas572 toSci "-9Inf" -> NaN Conversion_syntax
+dsbas573 toSci "-sNa" -> NaN Conversion_syntax
+dsbas574 toSci "xNaN" -> NaN Conversion_syntax
+dsbas575 toSci "0sNaN" -> NaN Conversion_syntax
+
+-- some baddies with dots and Es and dots and specials
+dsbas576 toSci 'e+1' -> NaN Conversion_syntax
+dsbas577 toSci '.e+1' -> NaN Conversion_syntax
+dsbas578 toSci '+.e+1' -> NaN Conversion_syntax
+dsbas579 toSci '-.e+' -> NaN Conversion_syntax
+dsbas580 toSci '-.e' -> NaN Conversion_syntax
+dsbas581 toSci 'E+1' -> NaN Conversion_syntax
+dsbas582 toSci '.E+1' -> NaN Conversion_syntax
+dsbas583 toSci '+.E+1' -> NaN Conversion_syntax
+dsbas584 toSci '-.E+' -> NaN Conversion_syntax
+dsbas585 toSci '-.E' -> NaN Conversion_syntax
+
+dsbas586 toSci '.NaN' -> NaN Conversion_syntax
+dsbas587 toSci '-.NaN' -> NaN Conversion_syntax
+dsbas588 toSci '+.sNaN' -> NaN Conversion_syntax
+dsbas589 toSci '+.Inf' -> NaN Conversion_syntax
+dsbas590 toSci '.Infinity' -> NaN Conversion_syntax
+
+-- Zeros
+dsbas601 toSci 0.000000000 -> 0E-9
+dsbas602 toSci 0.00000000 -> 0E-8
+dsbas603 toSci 0.0000000 -> 0E-7
+dsbas604 toSci 0.000000 -> 0.000000
+dsbas605 toSci 0.00000 -> 0.00000
+dsbas606 toSci 0.0000 -> 0.0000
+dsbas607 toSci 0.000 -> 0.000
+dsbas608 toSci 0.00 -> 0.00
+dsbas609 toSci 0.0 -> 0.0
+dsbas610 toSci .0 -> 0.0
+dsbas611 toSci 0. -> 0
+dsbas612 toSci -.0 -> -0.0
+dsbas613 toSci -0. -> -0
+dsbas614 toSci -0.0 -> -0.0
+dsbas615 toSci -0.00 -> -0.00
+dsbas616 toSci -0.000 -> -0.000
+dsbas617 toSci -0.0000 -> -0.0000
+dsbas618 toSci -0.00000 -> -0.00000
+dsbas619 toSci -0.000000 -> -0.000000
+dsbas620 toSci -0.0000000 -> -0E-7
+dsbas621 toSci -0.00000000 -> -0E-8
+dsbas622 toSci -0.000000000 -> -0E-9
+
+dsbas630 toSci 0.00E+0 -> 0.00
+dsbas631 toSci 0.00E+1 -> 0.0
+dsbas632 toSci 0.00E+2 -> 0
+dsbas633 toSci 0.00E+3 -> 0E+1
+dsbas634 toSci 0.00E+4 -> 0E+2
+dsbas635 toSci 0.00E+5 -> 0E+3
+dsbas636 toSci 0.00E+6 -> 0E+4
+dsbas637 toSci 0.00E+7 -> 0E+5
+dsbas638 toSci 0.00E+8 -> 0E+6
+dsbas639 toSci 0.00E+9 -> 0E+7
+
+dsbas640 toSci 0.0E+0 -> 0.0
+dsbas641 toSci 0.0E+1 -> 0
+dsbas642 toSci 0.0E+2 -> 0E+1
+dsbas643 toSci 0.0E+3 -> 0E+2
+dsbas644 toSci 0.0E+4 -> 0E+3
+dsbas645 toSci 0.0E+5 -> 0E+4
+dsbas646 toSci 0.0E+6 -> 0E+5
+dsbas647 toSci 0.0E+7 -> 0E+6
+dsbas648 toSci 0.0E+8 -> 0E+7
+dsbas649 toSci 0.0E+9 -> 0E+8
+
+dsbas650 toSci 0E+0 -> 0
+dsbas651 toSci 0E+1 -> 0E+1
+dsbas652 toSci 0E+2 -> 0E+2
+dsbas653 toSci 0E+3 -> 0E+3
+dsbas654 toSci 0E+4 -> 0E+4
+dsbas655 toSci 0E+5 -> 0E+5
+dsbas656 toSci 0E+6 -> 0E+6
+dsbas657 toSci 0E+7 -> 0E+7
+dsbas658 toSci 0E+8 -> 0E+8
+dsbas659 toSci 0E+9 -> 0E+9
+
+dsbas660 toSci 0.0E-0 -> 0.0
+dsbas661 toSci 0.0E-1 -> 0.00
+dsbas662 toSci 0.0E-2 -> 0.000
+dsbas663 toSci 0.0E-3 -> 0.0000
+dsbas664 toSci 0.0E-4 -> 0.00000
+dsbas665 toSci 0.0E-5 -> 0.000000
+dsbas666 toSci 0.0E-6 -> 0E-7
+dsbas667 toSci 0.0E-7 -> 0E-8
+dsbas668 toSci 0.0E-8 -> 0E-9
+dsbas669 toSci 0.0E-9 -> 0E-10
+
+dsbas670 toSci 0.00E-0 -> 0.00
+dsbas671 toSci 0.00E-1 -> 0.000
+dsbas672 toSci 0.00E-2 -> 0.0000
+dsbas673 toSci 0.00E-3 -> 0.00000
+dsbas674 toSci 0.00E-4 -> 0.000000
+dsbas675 toSci 0.00E-5 -> 0E-7
+dsbas676 toSci 0.00E-6 -> 0E-8
+dsbas677 toSci 0.00E-7 -> 0E-9
+dsbas678 toSci 0.00E-8 -> 0E-10
+dsbas679 toSci 0.00E-9 -> 0E-11
+
+dsbas680 toSci 000000. -> 0
+dsbas681 toSci 00000. -> 0
+dsbas682 toSci 0000. -> 0
+dsbas683 toSci 000. -> 0
+dsbas684 toSci 00. -> 0
+dsbas685 toSci 0. -> 0
+dsbas686 toSci +00000. -> 0
+dsbas687 toSci -00000. -> -0
+dsbas688 toSci +0. -> 0
+dsbas689 toSci -0. -> -0
+
+-- Specials
+dsbas700 toSci "NaN" -> NaN
+dsbas701 toSci "nan" -> NaN
+dsbas702 toSci "nAn" -> NaN
+dsbas703 toSci "NAN" -> NaN
+dsbas704 toSci "+NaN" -> NaN
+dsbas705 toSci "+nan" -> NaN
+dsbas706 toSci "+nAn" -> NaN
+dsbas707 toSci "+NAN" -> NaN
+dsbas708 toSci "-NaN" -> -NaN
+dsbas709 toSci "-nan" -> -NaN
+dsbas710 toSci "-nAn" -> -NaN
+dsbas711 toSci "-NAN" -> -NaN
+dsbas712 toSci 'NaN0' -> NaN
+dsbas713 toSci 'NaN1' -> NaN1
+dsbas714 toSci 'NaN12' -> NaN12
+dsbas715 toSci 'NaN123' -> NaN123
+dsbas716 toSci 'NaN1234' -> NaN1234
+dsbas717 toSci 'NaN01' -> NaN1
+dsbas718 toSci 'NaN012' -> NaN12
+dsbas719 toSci 'NaN0123' -> NaN123
+dsbas720 toSci 'NaN01234' -> NaN1234
+dsbas721 toSci 'NaN001' -> NaN1
+dsbas722 toSci 'NaN0012' -> NaN12
+dsbas723 toSci 'NaN00123' -> NaN123
+dsbas724 toSci 'NaN001234' -> NaN1234
+dsbas725 toSci 'NaN1234567890123456' -> NaN Conversion_syntax
+dsbas726 toSci 'NaN123e+1' -> NaN Conversion_syntax
+dsbas727 toSci 'NaN12.45' -> NaN Conversion_syntax
+dsbas728 toSci 'NaN-12' -> NaN Conversion_syntax
+dsbas729 toSci 'NaN+12' -> NaN Conversion_syntax
+
+dsbas730 toSci "sNaN" -> sNaN
+dsbas731 toSci "snan" -> sNaN
+dsbas732 toSci "SnAn" -> sNaN
+dsbas733 toSci "SNAN" -> sNaN
+dsbas734 toSci "+sNaN" -> sNaN
+dsbas735 toSci "+snan" -> sNaN
+dsbas736 toSci "+SnAn" -> sNaN
+dsbas737 toSci "+SNAN" -> sNaN
+dsbas738 toSci "-sNaN" -> -sNaN
+dsbas739 toSci "-snan" -> -sNaN
+dsbas740 toSci "-SnAn" -> -sNaN
+dsbas741 toSci "-SNAN" -> -sNaN
+dsbas742 toSci 'sNaN0000' -> sNaN
+dsbas743 toSci 'sNaN7' -> sNaN7
+dsbas744 toSci 'sNaN007234' -> sNaN7234
+dsbas745 toSci 'sNaN7234561234567890' -> NaN Conversion_syntax
+dsbas746 toSci 'sNaN72.45' -> NaN Conversion_syntax
+dsbas747 toSci 'sNaN-72' -> NaN Conversion_syntax
+
+dsbas748 toSci "Inf" -> Infinity
+dsbas749 toSci "inf" -> Infinity
+dsbas750 toSci "iNf" -> Infinity
+dsbas751 toSci "INF" -> Infinity
+dsbas752 toSci "+Inf" -> Infinity
+dsbas753 toSci "+inf" -> Infinity
+dsbas754 toSci "+iNf" -> Infinity
+dsbas755 toSci "+INF" -> Infinity
+dsbas756 toSci "-Inf" -> -Infinity
+dsbas757 toSci "-inf" -> -Infinity
+dsbas758 toSci "-iNf" -> -Infinity
+dsbas759 toSci "-INF" -> -Infinity
+
+dsbas760 toSci "Infinity" -> Infinity
+dsbas761 toSci "infinity" -> Infinity
+dsbas762 toSci "iNfInItY" -> Infinity
+dsbas763 toSci "INFINITY" -> Infinity
+dsbas764 toSci "+Infinity" -> Infinity
+dsbas765 toSci "+infinity" -> Infinity
+dsbas766 toSci "+iNfInItY" -> Infinity
+dsbas767 toSci "+INFINITY" -> Infinity
+dsbas768 toSci "-Infinity" -> -Infinity
+dsbas769 toSci "-infinity" -> -Infinity
+dsbas770 toSci "-iNfInItY" -> -Infinity
+dsbas771 toSci "-INFINITY" -> -Infinity
+
+-- Specials and zeros for toEng
+dsbast772 toEng "NaN" -> NaN
+dsbast773 toEng "-Infinity" -> -Infinity
+dsbast774 toEng "-sNaN" -> -sNaN
+dsbast775 toEng "-NaN" -> -NaN
+dsbast776 toEng "+Infinity" -> Infinity
+dsbast778 toEng "+sNaN" -> sNaN
+dsbast779 toEng "+NaN" -> NaN
+dsbast780 toEng "INFINITY" -> Infinity
+dsbast781 toEng "SNAN" -> sNaN
+dsbast782 toEng "NAN" -> NaN
+dsbast783 toEng "infinity" -> Infinity
+dsbast784 toEng "snan" -> sNaN
+dsbast785 toEng "nan" -> NaN
+dsbast786 toEng "InFINITY" -> Infinity
+dsbast787 toEng "SnAN" -> sNaN
+dsbast788 toEng "nAN" -> NaN
+dsbast789 toEng "iNfinity" -> Infinity
+dsbast790 toEng "sNan" -> sNaN
+dsbast791 toEng "Nan" -> NaN
+dsbast792 toEng "Infinity" -> Infinity
+dsbast793 toEng "sNaN" -> sNaN
+
+-- Zero toEng, etc.
+dsbast800 toEng 0e+1 -> "0.00E+3" -- doc example
+
+dsbast801 toEng 0.000000000 -> 0E-9
+dsbast802 toEng 0.00000000 -> 0.00E-6
+dsbast803 toEng 0.0000000 -> 0.0E-6
+dsbast804 toEng 0.000000 -> 0.000000
+dsbast805 toEng 0.00000 -> 0.00000
+dsbast806 toEng 0.0000 -> 0.0000
+dsbast807 toEng 0.000 -> 0.000
+dsbast808 toEng 0.00 -> 0.00
+dsbast809 toEng 0.0 -> 0.0
+dsbast810 toEng .0 -> 0.0
+dsbast811 toEng 0. -> 0
+dsbast812 toEng -.0 -> -0.0
+dsbast813 toEng -0. -> -0
+dsbast814 toEng -0.0 -> -0.0
+dsbast815 toEng -0.00 -> -0.00
+dsbast816 toEng -0.000 -> -0.000
+dsbast817 toEng -0.0000 -> -0.0000
+dsbast818 toEng -0.00000 -> -0.00000
+dsbast819 toEng -0.000000 -> -0.000000
+dsbast820 toEng -0.0000000 -> -0.0E-6
+dsbast821 toEng -0.00000000 -> -0.00E-6
+dsbast822 toEng -0.000000000 -> -0E-9
+
+dsbast830 toEng 0.00E+0 -> 0.00
+dsbast831 toEng 0.00E+1 -> 0.0
+dsbast832 toEng 0.00E+2 -> 0
+dsbast833 toEng 0.00E+3 -> 0.00E+3
+dsbast834 toEng 0.00E+4 -> 0.0E+3
+dsbast835 toEng 0.00E+5 -> 0E+3
+dsbast836 toEng 0.00E+6 -> 0.00E+6
+dsbast837 toEng 0.00E+7 -> 0.0E+6
+dsbast838 toEng 0.00E+8 -> 0E+6
+dsbast839 toEng 0.00E+9 -> 0.00E+9
+
+dsbast840 toEng 0.0E+0 -> 0.0
+dsbast841 toEng 0.0E+1 -> 0
+dsbast842 toEng 0.0E+2 -> 0.00E+3
+dsbast843 toEng 0.0E+3 -> 0.0E+3
+dsbast844 toEng 0.0E+4 -> 0E+3
+dsbast845 toEng 0.0E+5 -> 0.00E+6
+dsbast846 toEng 0.0E+6 -> 0.0E+6
+dsbast847 toEng 0.0E+7 -> 0E+6
+dsbast848 toEng 0.0E+8 -> 0.00E+9
+dsbast849 toEng 0.0E+9 -> 0.0E+9
+
+dsbast850 toEng 0E+0 -> 0
+dsbast851 toEng 0E+1 -> 0.00E+3
+dsbast852 toEng 0E+2 -> 0.0E+3
+dsbast853 toEng 0E+3 -> 0E+3
+dsbast854 toEng 0E+4 -> 0.00E+6
+dsbast855 toEng 0E+5 -> 0.0E+6
+dsbast856 toEng 0E+6 -> 0E+6
+dsbast857 toEng 0E+7 -> 0.00E+9
+dsbast858 toEng 0E+8 -> 0.0E+9
+dsbast859 toEng 0E+9 -> 0E+9
+
+dsbast860 toEng 0.0E-0 -> 0.0
+dsbast861 toEng 0.0E-1 -> 0.00
+dsbast862 toEng 0.0E-2 -> 0.000
+dsbast863 toEng 0.0E-3 -> 0.0000
+dsbast864 toEng 0.0E-4 -> 0.00000
+dsbast865 toEng 0.0E-5 -> 0.000000
+dsbast866 toEng 0.0E-6 -> 0.0E-6
+dsbast867 toEng 0.0E-7 -> 0.00E-6
+dsbast868 toEng 0.0E-8 -> 0E-9
+dsbast869 toEng 0.0E-9 -> 0.0E-9
+
+dsbast870 toEng 0.00E-0 -> 0.00
+dsbast871 toEng 0.00E-1 -> 0.000
+dsbast872 toEng 0.00E-2 -> 0.0000
+dsbast873 toEng 0.00E-3 -> 0.00000
+dsbast874 toEng 0.00E-4 -> 0.000000
+dsbast875 toEng 0.00E-5 -> 0.0E-6
+dsbast876 toEng 0.00E-6 -> 0.00E-6
+dsbast877 toEng 0.00E-7 -> 0E-9
+dsbast878 toEng 0.00E-8 -> 0.0E-9
+dsbast879 toEng 0.00E-9 -> 0.00E-9
+
+-- long input strings
+dsbas801 tosci '01234567' -> 1234567
+dsbas802 tosci '001234567' -> 1234567
+dsbas803 tosci '0001234567' -> 1234567
+dsbas804 tosci '00001234567' -> 1234567
+dsbas805 tosci '000001234567' -> 1234567
+dsbas806 tosci '0000001234567' -> 1234567
+dsbas807 tosci '00000001234567' -> 1234567
+dsbas808 tosci '000000001234567' -> 1234567
+dsbas809 tosci '0000000001234567' -> 1234567
+dsbas810 tosci '00000000001234567' -> 1234567
+
+dsbas811 tosci '0.1234567' -> 0.1234567
+dsbas812 tosci '0.01234567' -> 0.01234567
+dsbas813 tosci '0.001234567' -> 0.001234567
+dsbas814 tosci '0.0001234567' -> 0.0001234567
+dsbas815 tosci '0.00001234567' -> 0.00001234567
+dsbas816 tosci '0.000001234567' -> 0.000001234567
+dsbas817 tosci '0.0000001234567' -> 1.234567E-7
+dsbas818 tosci '0.00000001234567' -> 1.234567E-8
+dsbas819 tosci '0.000000001234567' -> 1.234567E-9
+dsbas820 tosci '0.0000000001234567' -> 1.234567E-10
+
+dsbas821 tosci '123456790' -> 1.234568E+8 Inexact Rounded
+dsbas822 tosci '1234567901' -> 1.234568E+9 Inexact Rounded
+dsbas823 tosci '12345679012' -> 1.234568E+10 Inexact Rounded
+dsbas824 tosci '123456790123' -> 1.234568E+11 Inexact Rounded
+dsbas825 tosci '1234567901234' -> 1.234568E+12 Inexact Rounded
+dsbas826 tosci '12345679012345' -> 1.234568E+13 Inexact Rounded
+dsbas827 tosci '123456790123456' -> 1.234568E+14 Inexact Rounded
+dsbas828 tosci '1234567901234567' -> 1.234568E+15 Inexact Rounded
+dsbas829 tosci '1234567890123456' -> 1.234568E+15 Inexact Rounded
+
+-- subnormals and overflows
+dsbas906 toSci '99e999999999' -> Infinity Overflow Inexact Rounded
+dsbas907 toSci '999e999999999' -> Infinity Overflow Inexact Rounded
+dsbas908 toSci '0.9e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas909 toSci '0.09e-999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas910 toSci '0.1e1000000000' -> Infinity Overflow Inexact Rounded
+dsbas911 toSci '10e-1000000000' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas912 toSci '0.9e9999999999' -> Infinity Overflow Inexact Rounded
+dsbas913 toSci '99e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas914 toSci '111e9999999999' -> Infinity Overflow Inexact Rounded
+dsbas915 toSci '1111e-9999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas916 toSci '1111e-99999999999' -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas917 toSci '7e1000000000' -> Infinity Overflow Inexact Rounded
+-- negatives the same
+dsbas918 toSci '-99e999999999' -> -Infinity Overflow Inexact Rounded
+dsbas919 toSci '-999e999999999' -> -Infinity Overflow Inexact Rounded
+dsbas920 toSci '-0.9e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas921 toSci '-0.09e-999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas922 toSci '-0.1e1000000000' -> -Infinity Overflow Inexact Rounded
+dsbas923 toSci '-10e-1000000000' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas924 toSci '-0.9e9999999999' -> -Infinity Overflow Inexact Rounded
+dsbas925 toSci '-99e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas926 toSci '-111e9999999999' -> -Infinity Overflow Inexact Rounded
+dsbas927 toSci '-1111e-9999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas928 toSci '-1111e-99999999999' -> -0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas929 toSci '-7e1000000000' -> -Infinity Overflow Inexact Rounded
+
+-- overflow results at different rounding modes
+rounding: ceiling
+dsbas930 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas931 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded
+rounding: up
+dsbas932 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas933 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: down
+dsbas934 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded
+dsbas935 toSci '-7e10000' -> -9.999999E+96 Overflow Inexact Rounded
+rounding: floor
+dsbas936 toSci '7e10000' -> 9.999999E+96 Overflow Inexact Rounded
+dsbas937 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_up
+dsbas938 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas939 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_even
+dsbas940 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas941 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+rounding: half_down
+dsbas942 toSci '7e10000' -> Infinity Overflow Inexact Rounded
+dsbas943 toSci '-7e10000' -> -Infinity Overflow Inexact Rounded
+
+rounding: half_even
+
+-- Now check 854/754r some subnormals and underflow to 0
+dsbem400 toSci 1.0000E-86 -> 1.0000E-86
+dsbem401 toSci 0.1E-97 -> 1E-98 Subnormal
+dsbem402 toSci 0.1000E-97 -> 1.000E-98 Subnormal
+dsbem403 toSci 0.0100E-97 -> 1.00E-99 Subnormal
+dsbem404 toSci 0.0010E-97 -> 1.0E-100 Subnormal
+dsbem405 toSci 0.0001E-97 -> 1E-101 Subnormal
+dsbem406 toSci 0.00010E-97 -> 1E-101 Subnormal Rounded
+dsbem407 toSci 0.00013E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
+dsbem408 toSci 0.00015E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem409 toSci 0.00017E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem410 toSci 0.00023E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem411 toSci 0.00025E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem412 toSci 0.00027E-97 -> 3E-101 Underflow Subnormal Inexact Rounded
+dsbem413 toSci 0.000149E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
+dsbem414 toSci 0.000150E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem415 toSci 0.000151E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem416 toSci 0.000249E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem417 toSci 0.000250E-97 -> 2E-101 Underflow Subnormal Inexact Rounded
+dsbem418 toSci 0.000251E-97 -> 3E-101 Underflow Subnormal Inexact Rounded
+dsbem419 toSci 0.00009E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
+dsbem420 toSci 0.00005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem421 toSci 0.00003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem422 toSci 0.000009E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem423 toSci 0.000005E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem424 toSci 0.000003E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+
+dsbem425 toSci 0.001049E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
+dsbem426 toSci 0.001050E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
+dsbem427 toSci 0.001051E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded
+dsbem428 toSci 0.001149E-97 -> 1.1E-100 Underflow Subnormal Inexact Rounded
+dsbem429 toSci 0.001150E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded
+dsbem430 toSci 0.001151E-97 -> 1.2E-100 Underflow Subnormal Inexact Rounded
+
+dsbem432 toSci 0.010049E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
+dsbem433 toSci 0.010050E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
+dsbem434 toSci 0.010051E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded
+dsbem435 toSci 0.010149E-97 -> 1.01E-99 Underflow Subnormal Inexact Rounded
+dsbem436 toSci 0.010150E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded
+dsbem437 toSci 0.010151E-97 -> 1.02E-99 Underflow Subnormal Inexact Rounded
+
+dsbem440 toSci 0.10103E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded
+dsbem441 toSci 0.10105E-97 -> 1.010E-98 Underflow Subnormal Inexact Rounded
+dsbem442 toSci 0.10107E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded
+dsbem443 toSci 0.10113E-97 -> 1.011E-98 Underflow Subnormal Inexact Rounded
+dsbem444 toSci 0.10115E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded
+dsbem445 toSci 0.10117E-97 -> 1.012E-98 Underflow Subnormal Inexact Rounded
+
+dsbem450 toSci 1.10730E-98 -> 1.107E-98 Underflow Subnormal Inexact Rounded
+dsbem451 toSci 1.10750E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
+dsbem452 toSci 1.10770E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
+dsbem453 toSci 1.10830E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
+dsbem454 toSci 1.10850E-98 -> 1.108E-98 Underflow Subnormal Inexact Rounded
+dsbem455 toSci 1.10870E-98 -> 1.109E-98 Underflow Subnormal Inexact Rounded
+
+-- make sure sign OK
+dsbem456 toSci -0.10103E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded
+dsbem457 toSci -0.10105E-97 -> -1.010E-98 Underflow Subnormal Inexact Rounded
+dsbem458 toSci -0.10107E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded
+dsbem459 toSci -0.10113E-97 -> -1.011E-98 Underflow Subnormal Inexact Rounded
+dsbem460 toSci -0.10115E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded
+dsbem461 toSci -0.10117E-97 -> -1.012E-98 Underflow Subnormal Inexact Rounded
+
+-- '999s' cases
+dsbem464 toSci 999999E-98 -> 9.99999E-93
+dsbem465 toSci 99999.0E-97 -> 9.99990E-93
+dsbem466 toSci 99999.E-97 -> 9.9999E-93
+dsbem467 toSci 9999.9E-97 -> 9.9999E-94
+dsbem468 toSci 999.99E-97 -> 9.9999E-95
+dsbem469 toSci 99.999E-97 -> 9.9999E-96 Subnormal
+dsbem470 toSci 9.9999E-97 -> 9.9999E-97 Subnormal
+dsbem471 toSci 0.99999E-97 -> 1.0000E-97 Underflow Subnormal Inexact Rounded
+dsbem472 toSci 0.099999E-97 -> 1.000E-98 Underflow Subnormal Inexact Rounded
+dsbem473 toSci 0.0099999E-97 -> 1.00E-99 Underflow Subnormal Inexact Rounded
+dsbem474 toSci 0.00099999E-97 -> 1.0E-100 Underflow Subnormal Inexact Rounded
+dsbem475 toSci 0.000099999E-97 -> 1E-101 Underflow Subnormal Inexact Rounded
+dsbem476 toSci 0.0000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem477 toSci 0.00000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbem478 toSci 0.000000099999E-97 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+
+-- Exponents with insignificant leading zeros
+dsbas1001 toSci 1e999999999 -> Infinity Overflow Inexact Rounded
+dsbas1002 toSci 1e0999999999 -> Infinity Overflow Inexact Rounded
+dsbas1003 toSci 1e00999999999 -> Infinity Overflow Inexact Rounded
+dsbas1004 toSci 1e000999999999 -> Infinity Overflow Inexact Rounded
+dsbas1005 toSci 1e000000000000999999999 -> Infinity Overflow Inexact Rounded
+dsbas1006 toSci 1e000000000001000000007 -> Infinity Overflow Inexact Rounded
+dsbas1007 toSci 1e-999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1008 toSci 1e-0999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1009 toSci 1e-00999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1010 toSci 1e-000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1011 toSci 1e-000000000000999999999 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+dsbas1012 toSci 1e-000000000001000000007 -> 0E-101 Underflow Subnormal Inexact Rounded Clamped
+
+-- check for double-rounded subnormals
+dsbas1041 toSci 1.1152444E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
+dsbas1042 toSci 1.1152445E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
+dsbas1043 toSci 1.1152446E-96 -> 1.11524E-96 Inexact Rounded Subnormal Underflow
+
+-- clamped zeros [see also clamp.decTest]
+dsbas1075 toSci 0e+10000 -> 0E+90 Clamped
+dsbas1076 toSci 0e-10000 -> 0E-101 Clamped
+dsbas1077 toSci -0e+10000 -> -0E+90 Clamped
+dsbas1078 toSci -0e-10000 -> -0E-101 Clamped
+
+-- extreme values from next-wider
+dsbas1101 toSci -9.999999999999999E+384 -> -Infinity Overflow Inexact Rounded
+dsbas1102 toSci -1E-383 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped
+dsbas1103 toSci -1E-398 -> -0E-101 Inexact Rounded Subnormal Underflow Clamped
+dsbas1104 toSci -0 -> -0
+dsbas1105 toSci +0 -> 0
+dsbas1106 toSci +1E-398 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped
+dsbas1107 toSci +1E-383 -> 0E-101 Inexact Rounded Subnormal Underflow Clamped
+dsbas1108 toSci +9.999999999999999E+384 -> Infinity Overflow Inexact Rounded
+
+-- narrowing case
+dsbas1110 toSci 2.000000000000000E-99 -> 2.00E-99 Rounded Subnormal
diff --git a/Lib/test/decimaltestdata/dsEncode.decTest b/Lib/test/decimaltestdata/dsEncode.decTest
index 7264748759..818578b179 100644
--- a/Lib/test/decimaltestdata/dsEncode.decTest
+++ b/Lib/test/decimaltestdata/dsEncode.decTest
@@ -1,372 +1,372 @@
-------------------------------------------------------------------------
--- dsEncode.decTest -- decimal four-byte format testcases --
--- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
--- [Previously called decimal32.decTest]
-version: 2.59
-
--- This set of tests is for the four-byte concrete representation.
--- Its characteristics are:
---
--- 1 bit sign
--- 5 bits combination field
--- 6 bits exponent continuation
--- 20 bits coefficient continuation
---
--- Total exponent length 8 bits
--- Total coefficient length 24 bits (7 digits)
---
--- Elimit = 191 (maximum encoded exponent)
--- Emax = 96 (largest exponent value)
--- Emin = -95 (smallest exponent value)
--- bias = 101 (subtracted from encoded exponent) = -Etiny
-
--- The testcases here have only exactly representable data on the
--- 'left-hand-side'; rounding from strings is tested in 'base'
--- testcase groups.
-
-extended: 1
-clamp: 1
-precision: 7
-rounding: half_up
-maxExponent: 96
-minExponent: -95
-
--- General testcases
--- (mostly derived from the Strawman 4 document and examples)
-decs001 apply #A23003D0 -> -7.50
-decs002 apply -7.50 -> #A23003D0
--- derivative canonical plain strings
-decs003 apply #A26003D0 -> -7.50E+3
-decs004 apply -7.50E+3 -> #A26003D0
-decs005 apply #A25003D0 -> -750
-decs006 apply -750 -> #A25003D0
-decs007 apply #A24003D0 -> -75.0
-decs008 apply -75.0 -> #A24003D0
-decs009 apply #A22003D0 -> -0.750
-decs010 apply -0.750 -> #A22003D0
-decs011 apply #A21003D0 -> -0.0750
-decs012 apply -0.0750 -> #A21003D0
-decs013 apply #A1f003D0 -> -0.000750
-decs014 apply -0.000750 -> #A1f003D0
-decs015 apply #A1d003D0 -> -0.00000750
-decs016 apply -0.00000750 -> #A1d003D0
-decs017 apply #A1c003D0 -> -7.50E-7
-decs018 apply -7.50E-7 -> #A1c003D0
-
--- Normality
-decs020 apply 1234567 -> #2654d2e7
-decs021 apply -1234567 -> #a654d2e7
-decs022 apply 1111111 -> #26524491
-
--- Nmax and similar
-decs031 apply 9.999999E+96 -> #77f3fcff
-decs032 apply #77f3fcff -> 9.999999E+96
-decs033 apply 1.234567E+96 -> #47f4d2e7
-decs034 apply #47f4d2e7 -> 1.234567E+96
--- fold-downs (more below)
-decs035 apply 1.23E+96 -> #47f4c000 Clamped
-decs036 apply #47f4c000 -> 1.230000E+96
-decs037 apply 1E+96 -> #47f00000 Clamped
-decs038 apply #47f00000 -> 1.000000E+96
-
-decs051 apply 12345 -> #225049c5
-decs052 apply #225049c5 -> 12345
-decs053 apply 1234 -> #22500534
-decs054 apply #22500534 -> 1234
-decs055 apply 123 -> #225000a3
-decs056 apply #225000a3 -> 123
-decs057 apply 12 -> #22500012
-decs058 apply #22500012 -> 12
-decs059 apply 1 -> #22500001
-decs060 apply #22500001 -> 1
-decs061 apply 1.23 -> #223000a3
-decs062 apply #223000a3 -> 1.23
-decs063 apply 123.45 -> #223049c5
-decs064 apply #223049c5 -> 123.45
-
--- Nmin and below
-decs071 apply 1E-95 -> #00600001
-decs072 apply #00600001 -> 1E-95
-decs073 apply 1.000000E-95 -> #04000000
-decs074 apply #04000000 -> 1.000000E-95
-decs075 apply 1.000001E-95 -> #04000001
-decs076 apply #04000001 -> 1.000001E-95
-
-decs077 apply 0.100000E-95 -> #00020000 Subnormal
-decs07x apply 1.00000E-96 -> 1.00000E-96 Subnormal
-decs078 apply #00020000 -> 1.00000E-96 Subnormal
-decs079 apply 0.000010E-95 -> #00000010 Subnormal
-decs080 apply #00000010 -> 1.0E-100 Subnormal
-decs081 apply 0.000001E-95 -> #00000001 Subnormal
-decs082 apply #00000001 -> 1E-101 Subnormal
-decs083 apply 1e-101 -> #00000001 Subnormal
-decs084 apply #00000001 -> 1E-101 Subnormal
-decs08x apply 1e-101 -> 1E-101 Subnormal
-
--- underflows cannot be tested; just check edge case
-decs090 apply 1e-101 -> #00000001 Subnormal
-
--- same again, negatives --
-
--- Nmax and similar
-decs122 apply -9.999999E+96 -> #f7f3fcff
-decs123 apply #f7f3fcff -> -9.999999E+96
-decs124 apply -1.234567E+96 -> #c7f4d2e7
-decs125 apply #c7f4d2e7 -> -1.234567E+96
--- fold-downs (more below)
-decs130 apply -1.23E+96 -> #c7f4c000 Clamped
-decs131 apply #c7f4c000 -> -1.230000E+96
-decs132 apply -1E+96 -> #c7f00000 Clamped
-decs133 apply #c7f00000 -> -1.000000E+96
-
-decs151 apply -12345 -> #a25049c5
-decs152 apply #a25049c5 -> -12345
-decs153 apply -1234 -> #a2500534
-decs154 apply #a2500534 -> -1234
-decs155 apply -123 -> #a25000a3
-decs156 apply #a25000a3 -> -123
-decs157 apply -12 -> #a2500012
-decs158 apply #a2500012 -> -12
-decs159 apply -1 -> #a2500001
-decs160 apply #a2500001 -> -1
-decs161 apply -1.23 -> #a23000a3
-decs162 apply #a23000a3 -> -1.23
-decs163 apply -123.45 -> #a23049c5
-decs164 apply #a23049c5 -> -123.45
-
--- Nmin and below
-decs171 apply -1E-95 -> #80600001
-decs172 apply #80600001 -> -1E-95
-decs173 apply -1.000000E-95 -> #84000000
-decs174 apply #84000000 -> -1.000000E-95
-decs175 apply -1.000001E-95 -> #84000001
-decs176 apply #84000001 -> -1.000001E-95
-
-decs177 apply -0.100000E-95 -> #80020000 Subnormal
-decs178 apply #80020000 -> -1.00000E-96 Subnormal
-decs179 apply -0.000010E-95 -> #80000010 Subnormal
-decs180 apply #80000010 -> -1.0E-100 Subnormal
-decs181 apply -0.000001E-95 -> #80000001 Subnormal
-decs182 apply #80000001 -> -1E-101 Subnormal
-decs183 apply -1e-101 -> #80000001 Subnormal
-decs184 apply #80000001 -> -1E-101 Subnormal
-
--- underflow edge case
-decs190 apply -1e-101 -> #80000001 Subnormal
-
--- zeros
-decs400 apply 0E-400 -> #00000000 Clamped
-decs401 apply 0E-101 -> #00000000
-decs402 apply #00000000 -> 0E-101
-decs403 apply 0.000000E-95 -> #00000000
-decs404 apply #00000000 -> 0E-101
-decs405 apply 0E-2 -> #22300000
-decs406 apply #22300000 -> 0.00
-decs407 apply 0 -> #22500000
-decs408 apply #22500000 -> 0
-decs409 apply 0E+3 -> #22800000
-decs410 apply #22800000 -> 0E+3
-decs411 apply 0E+90 -> #43f00000
-decs412 apply #43f00000 -> 0E+90
--- clamped zeros...
-decs413 apply 0E+91 -> #43f00000 Clamped
-decs414 apply #43f00000 -> 0E+90
-decs415 apply 0E+96 -> #43f00000 Clamped
-decs416 apply #43f00000 -> 0E+90
-decs417 apply 0E+400 -> #43f00000 Clamped
-decs418 apply #43f00000 -> 0E+90
-
--- negative zeros
-decs420 apply -0E-400 -> #80000000 Clamped
-decs421 apply -0E-101 -> #80000000
-decs422 apply #80000000 -> -0E-101
-decs423 apply -0.000000E-95 -> #80000000
-decs424 apply #80000000 -> -0E-101
-decs425 apply -0E-2 -> #a2300000
-decs426 apply #a2300000 -> -0.00
-decs427 apply -0 -> #a2500000
-decs428 apply #a2500000 -> -0
-decs429 apply -0E+3 -> #a2800000
-decs430 apply #a2800000 -> -0E+3
-decs431 apply -0E+90 -> #c3f00000
-decs432 apply #c3f00000 -> -0E+90
--- clamped zeros...
-decs433 apply -0E+91 -> #c3f00000 Clamped
-decs434 apply #c3f00000 -> -0E+90
-decs435 apply -0E+96 -> #c3f00000 Clamped
-decs436 apply #c3f00000 -> -0E+90
-decs437 apply -0E+400 -> #c3f00000 Clamped
-decs438 apply #c3f00000 -> -0E+90
-
--- Specials
-decs500 apply Infinity -> #78000000
-decs501 apply #78787878 -> #78000000
-decs502 apply #78000000 -> Infinity
-decs503 apply #79797979 -> #78000000
-decs504 apply #79000000 -> Infinity
-decs505 apply #7a7a7a7a -> #78000000
-decs506 apply #7a000000 -> Infinity
-decs507 apply #7b7b7b7b -> #78000000
-decs508 apply #7b000000 -> Infinity
-decs509 apply #7c7c7c7c -> #7c0c7c7c
-
-decs510 apply NaN -> #7c000000
-decs511 apply #7c000000 -> NaN
-decs512 apply #7d7d7d7d -> #7c0d7d7d
-decs513 apply #7d000000 -> NaN
-decs514 apply #7e7e7e7e -> #7e0e7c7e
-decs515 apply #7e000000 -> sNaN
-decs516 apply #7f7f7f7f -> #7e0f7c7f
-decs517 apply #7f000000 -> sNaN
-decs518 apply #7fffffff -> sNaN999999
-decs519 apply #7fffffff -> #7e03fcff
-
-decs520 apply -Infinity -> #f8000000
-decs521 apply #f8787878 -> #f8000000
-decs522 apply #f8000000 -> -Infinity
-decs523 apply #f9797979 -> #f8000000
-decs524 apply #f9000000 -> -Infinity
-decs525 apply #fa7a7a7a -> #f8000000
-decs526 apply #fa000000 -> -Infinity
-decs527 apply #fb7b7b7b -> #f8000000
-decs528 apply #fb000000 -> -Infinity
-
-decs529 apply -NaN -> #fc000000
-decs530 apply #fc7c7c7c -> #fc0c7c7c
-decs531 apply #fc000000 -> -NaN
-decs532 apply #fd7d7d7d -> #fc0d7d7d
-decs533 apply #fd000000 -> -NaN
-decs534 apply #fe7e7e7e -> #fe0e7c7e
-decs535 apply #fe000000 -> -sNaN
-decs536 apply #ff7f7f7f -> #fe0f7c7f
-decs537 apply #ff000000 -> -sNaN
-decs538 apply #ffffffff -> -sNaN999999
-decs539 apply #ffffffff -> #fe03fcff
-
--- diagnostic NaNs
-decs540 apply NaN -> #7c000000
-decs541 apply NaN0 -> #7c000000
-decs542 apply NaN1 -> #7c000001
-decs543 apply NaN12 -> #7c000012
-decs544 apply NaN79 -> #7c000079
-decs545 apply NaN12345 -> #7c0049c5
-decs546 apply NaN123456 -> #7c028e56
-decs547 apply NaN799799 -> #7c0f7fdf
-decs548 apply NaN999999 -> #7c03fcff
-
-
--- fold-down full sequence
-decs601 apply 1E+96 -> #47f00000 Clamped
-decs602 apply #47f00000 -> 1.000000E+96
-decs603 apply 1E+95 -> #43f20000 Clamped
-decs604 apply #43f20000 -> 1.00000E+95
-decs605 apply 1E+94 -> #43f04000 Clamped
-decs606 apply #43f04000 -> 1.0000E+94
-decs607 apply 1E+93 -> #43f00400 Clamped
-decs608 apply #43f00400 -> 1.000E+93
-decs609 apply 1E+92 -> #43f00080 Clamped
-decs610 apply #43f00080 -> 1.00E+92
-decs611 apply 1E+91 -> #43f00010 Clamped
-decs612 apply #43f00010 -> 1.0E+91
-decs613 apply 1E+90 -> #43f00001
-decs614 apply #43f00001 -> 1E+90
-
-
--- Selected DPD codes
-decs700 apply #22500000 -> 0
-decs701 apply #22500009 -> 9
-decs702 apply #22500010 -> 10
-decs703 apply #22500019 -> 19
-decs704 apply #22500020 -> 20
-decs705 apply #22500029 -> 29
-decs706 apply #22500030 -> 30
-decs707 apply #22500039 -> 39
-decs708 apply #22500040 -> 40
-decs709 apply #22500049 -> 49
-decs710 apply #22500050 -> 50
-decs711 apply #22500059 -> 59
-decs712 apply #22500060 -> 60
-decs713 apply #22500069 -> 69
-decs714 apply #22500070 -> 70
-decs715 apply #22500071 -> 71
-decs716 apply #22500072 -> 72
-decs717 apply #22500073 -> 73
-decs718 apply #22500074 -> 74
-decs719 apply #22500075 -> 75
-decs720 apply #22500076 -> 76
-decs721 apply #22500077 -> 77
-decs722 apply #22500078 -> 78
-decs723 apply #22500079 -> 79
-
-decs730 apply #2250029e -> 994
-decs731 apply #2250029f -> 995
-decs732 apply #225002a0 -> 520
-decs733 apply #225002a1 -> 521
-
--- DPD: one of each of the huffman groups
-decs740 apply #225003f7 -> 777
-decs741 apply #225003f8 -> 778
-decs742 apply #225003eb -> 787
-decs743 apply #2250037d -> 877
-decs744 apply #2250039f -> 997
-decs745 apply #225003bf -> 979
-decs746 apply #225003df -> 799
-decs747 apply #2250006e -> 888
-
-
--- DPD all-highs cases (includes the 24 redundant codes)
-decs750 apply #2250006e -> 888
-decs751 apply #2250016e -> 888
-decs752 apply #2250026e -> 888
-decs753 apply #2250036e -> 888
-decs754 apply #2250006f -> 889
-decs755 apply #2250016f -> 889
-decs756 apply #2250026f -> 889
-decs757 apply #2250036f -> 889
-
-decs760 apply #2250007e -> 898
-decs761 apply #2250017e -> 898
-decs762 apply #2250027e -> 898
-decs763 apply #2250037e -> 898
-decs764 apply #2250007f -> 899
-decs765 apply #2250017f -> 899
-decs766 apply #2250027f -> 899
-decs767 apply #2250037f -> 899
-
-decs770 apply #225000ee -> 988
-decs771 apply #225001ee -> 988
-decs772 apply #225002ee -> 988
-decs773 apply #225003ee -> 988
-decs774 apply #225000ef -> 989
-decs775 apply #225001ef -> 989
-decs776 apply #225002ef -> 989
-decs777 apply #225003ef -> 989
-
-decs780 apply #225000fe -> 998
-decs781 apply #225001fe -> 998
-decs782 apply #225002fe -> 998
-decs783 apply #225003fe -> 998
-decs784 apply #225000ff -> 999
-decs785 apply #225001ff -> 999
-decs786 apply #225002ff -> 999
-decs787 apply #225003ff -> 999
-
--- narrowing case
-decs790 apply 2.00E-99 -> #00000100 Subnormal
-decs791 apply #00000100 -> 2.00E-99 Subnormal
+------------------------------------------------------------------------
+-- dsEncode.decTest -- decimal four-byte format testcases --
+-- Copyright (c) IBM Corporation, 2000, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+-- [Previously called decimal32.decTest]
+version: 2.59
+
+-- This set of tests is for the four-byte concrete representation.
+-- Its characteristics are:
+--
+-- 1 bit sign
+-- 5 bits combination field
+-- 6 bits exponent continuation
+-- 20 bits coefficient continuation
+--
+-- Total exponent length 8 bits
+-- Total coefficient length 24 bits (7 digits)
+--
+-- Elimit = 191 (maximum encoded exponent)
+-- Emax = 96 (largest exponent value)
+-- Emin = -95 (smallest exponent value)
+-- bias = 101 (subtracted from encoded exponent) = -Etiny
+
+-- The testcases here have only exactly representable data on the
+-- 'left-hand-side'; rounding from strings is tested in 'base'
+-- testcase groups.
+
+extended: 1
+clamp: 1
+precision: 7
+rounding: half_up
+maxExponent: 96
+minExponent: -95
+
+-- General testcases
+-- (mostly derived from the Strawman 4 document and examples)
+decs001 apply #A23003D0 -> -7.50
+decs002 apply -7.50 -> #A23003D0
+-- derivative canonical plain strings
+decs003 apply #A26003D0 -> -7.50E+3
+decs004 apply -7.50E+3 -> #A26003D0
+decs005 apply #A25003D0 -> -750
+decs006 apply -750 -> #A25003D0
+decs007 apply #A24003D0 -> -75.0
+decs008 apply -75.0 -> #A24003D0
+decs009 apply #A22003D0 -> -0.750
+decs010 apply -0.750 -> #A22003D0
+decs011 apply #A21003D0 -> -0.0750
+decs012 apply -0.0750 -> #A21003D0
+decs013 apply #A1f003D0 -> -0.000750
+decs014 apply -0.000750 -> #A1f003D0
+decs015 apply #A1d003D0 -> -0.00000750
+decs016 apply -0.00000750 -> #A1d003D0
+decs017 apply #A1c003D0 -> -7.50E-7
+decs018 apply -7.50E-7 -> #A1c003D0
+
+-- Normality
+decs020 apply 1234567 -> #2654d2e7
+decs021 apply -1234567 -> #a654d2e7
+decs022 apply 1111111 -> #26524491
+
+-- Nmax and similar
+decs031 apply 9.999999E+96 -> #77f3fcff
+decs032 apply #77f3fcff -> 9.999999E+96
+decs033 apply 1.234567E+96 -> #47f4d2e7
+decs034 apply #47f4d2e7 -> 1.234567E+96
+-- fold-downs (more below)
+decs035 apply 1.23E+96 -> #47f4c000 Clamped
+decs036 apply #47f4c000 -> 1.230000E+96
+decs037 apply 1E+96 -> #47f00000 Clamped
+decs038 apply #47f00000 -> 1.000000E+96
+
+decs051 apply 12345 -> #225049c5
+decs052 apply #225049c5 -> 12345
+decs053 apply 1234 -> #22500534
+decs054 apply #22500534 -> 1234
+decs055 apply 123 -> #225000a3
+decs056 apply #225000a3 -> 123
+decs057 apply 12 -> #22500012
+decs058 apply #22500012 -> 12
+decs059 apply 1 -> #22500001
+decs060 apply #22500001 -> 1
+decs061 apply 1.23 -> #223000a3
+decs062 apply #223000a3 -> 1.23
+decs063 apply 123.45 -> #223049c5
+decs064 apply #223049c5 -> 123.45
+
+-- Nmin and below
+decs071 apply 1E-95 -> #00600001
+decs072 apply #00600001 -> 1E-95
+decs073 apply 1.000000E-95 -> #04000000
+decs074 apply #04000000 -> 1.000000E-95
+decs075 apply 1.000001E-95 -> #04000001
+decs076 apply #04000001 -> 1.000001E-95
+
+decs077 apply 0.100000E-95 -> #00020000 Subnormal
+decs07x apply 1.00000E-96 -> 1.00000E-96 Subnormal
+decs078 apply #00020000 -> 1.00000E-96 Subnormal
+decs079 apply 0.000010E-95 -> #00000010 Subnormal
+decs080 apply #00000010 -> 1.0E-100 Subnormal
+decs081 apply 0.000001E-95 -> #00000001 Subnormal
+decs082 apply #00000001 -> 1E-101 Subnormal
+decs083 apply 1e-101 -> #00000001 Subnormal
+decs084 apply #00000001 -> 1E-101 Subnormal
+decs08x apply 1e-101 -> 1E-101 Subnormal
+
+-- underflows cannot be tested; just check edge case
+decs090 apply 1e-101 -> #00000001 Subnormal
+
+-- same again, negatives --
+
+-- Nmax and similar
+decs122 apply -9.999999E+96 -> #f7f3fcff
+decs123 apply #f7f3fcff -> -9.999999E+96
+decs124 apply -1.234567E+96 -> #c7f4d2e7
+decs125 apply #c7f4d2e7 -> -1.234567E+96
+-- fold-downs (more below)
+decs130 apply -1.23E+96 -> #c7f4c000 Clamped
+decs131 apply #c7f4c000 -> -1.230000E+96
+decs132 apply -1E+96 -> #c7f00000 Clamped
+decs133 apply #c7f00000 -> -1.000000E+96
+
+decs151 apply -12345 -> #a25049c5
+decs152 apply #a25049c5 -> -12345
+decs153 apply -1234 -> #a2500534
+decs154 apply #a2500534 -> -1234
+decs155 apply -123 -> #a25000a3
+decs156 apply #a25000a3 -> -123
+decs157 apply -12 -> #a2500012
+decs158 apply #a2500012 -> -12
+decs159 apply -1 -> #a2500001
+decs160 apply #a2500001 -> -1
+decs161 apply -1.23 -> #a23000a3
+decs162 apply #a23000a3 -> -1.23
+decs163 apply -123.45 -> #a23049c5
+decs164 apply #a23049c5 -> -123.45
+
+-- Nmin and below
+decs171 apply -1E-95 -> #80600001
+decs172 apply #80600001 -> -1E-95
+decs173 apply -1.000000E-95 -> #84000000
+decs174 apply #84000000 -> -1.000000E-95
+decs175 apply -1.000001E-95 -> #84000001
+decs176 apply #84000001 -> -1.000001E-95
+
+decs177 apply -0.100000E-95 -> #80020000 Subnormal
+decs178 apply #80020000 -> -1.00000E-96 Subnormal
+decs179 apply -0.000010E-95 -> #80000010 Subnormal
+decs180 apply #80000010 -> -1.0E-100 Subnormal
+decs181 apply -0.000001E-95 -> #80000001 Subnormal
+decs182 apply #80000001 -> -1E-101 Subnormal
+decs183 apply -1e-101 -> #80000001 Subnormal
+decs184 apply #80000001 -> -1E-101 Subnormal
+
+-- underflow edge case
+decs190 apply -1e-101 -> #80000001 Subnormal
+
+-- zeros
+decs400 apply 0E-400 -> #00000000 Clamped
+decs401 apply 0E-101 -> #00000000
+decs402 apply #00000000 -> 0E-101
+decs403 apply 0.000000E-95 -> #00000000
+decs404 apply #00000000 -> 0E-101
+decs405 apply 0E-2 -> #22300000
+decs406 apply #22300000 -> 0.00
+decs407 apply 0 -> #22500000
+decs408 apply #22500000 -> 0
+decs409 apply 0E+3 -> #22800000
+decs410 apply #22800000 -> 0E+3
+decs411 apply 0E+90 -> #43f00000
+decs412 apply #43f00000 -> 0E+90
+-- clamped zeros...
+decs413 apply 0E+91 -> #43f00000 Clamped
+decs414 apply #43f00000 -> 0E+90
+decs415 apply 0E+96 -> #43f00000 Clamped
+decs416 apply #43f00000 -> 0E+90
+decs417 apply 0E+400 -> #43f00000 Clamped
+decs418 apply #43f00000 -> 0E+90
+
+-- negative zeros
+decs420 apply -0E-400 -> #80000000 Clamped
+decs421 apply -0E-101 -> #80000000
+decs422 apply #80000000 -> -0E-101
+decs423 apply -0.000000E-95 -> #80000000
+decs424 apply #80000000 -> -0E-101
+decs425 apply -0E-2 -> #a2300000
+decs426 apply #a2300000 -> -0.00
+decs427 apply -0 -> #a2500000
+decs428 apply #a2500000 -> -0
+decs429 apply -0E+3 -> #a2800000
+decs430 apply #a2800000 -> -0E+3
+decs431 apply -0E+90 -> #c3f00000
+decs432 apply #c3f00000 -> -0E+90
+-- clamped zeros...
+decs433 apply -0E+91 -> #c3f00000 Clamped
+decs434 apply #c3f00000 -> -0E+90
+decs435 apply -0E+96 -> #c3f00000 Clamped
+decs436 apply #c3f00000 -> -0E+90
+decs437 apply -0E+400 -> #c3f00000 Clamped
+decs438 apply #c3f00000 -> -0E+90
+
+-- Specials
+decs500 apply Infinity -> #78000000
+decs501 apply #78787878 -> #78000000
+decs502 apply #78000000 -> Infinity
+decs503 apply #79797979 -> #78000000
+decs504 apply #79000000 -> Infinity
+decs505 apply #7a7a7a7a -> #78000000
+decs506 apply #7a000000 -> Infinity
+decs507 apply #7b7b7b7b -> #78000000
+decs508 apply #7b000000 -> Infinity
+decs509 apply #7c7c7c7c -> #7c0c7c7c
+
+decs510 apply NaN -> #7c000000
+decs511 apply #7c000000 -> NaN
+decs512 apply #7d7d7d7d -> #7c0d7d7d
+decs513 apply #7d000000 -> NaN
+decs514 apply #7e7e7e7e -> #7e0e7c7e
+decs515 apply #7e000000 -> sNaN
+decs516 apply #7f7f7f7f -> #7e0f7c7f
+decs517 apply #7f000000 -> sNaN
+decs518 apply #7fffffff -> sNaN999999
+decs519 apply #7fffffff -> #7e03fcff
+
+decs520 apply -Infinity -> #f8000000
+decs521 apply #f8787878 -> #f8000000
+decs522 apply #f8000000 -> -Infinity
+decs523 apply #f9797979 -> #f8000000
+decs524 apply #f9000000 -> -Infinity
+decs525 apply #fa7a7a7a -> #f8000000
+decs526 apply #fa000000 -> -Infinity
+decs527 apply #fb7b7b7b -> #f8000000
+decs528 apply #fb000000 -> -Infinity
+
+decs529 apply -NaN -> #fc000000
+decs530 apply #fc7c7c7c -> #fc0c7c7c
+decs531 apply #fc000000 -> -NaN
+decs532 apply #fd7d7d7d -> #fc0d7d7d
+decs533 apply #fd000000 -> -NaN
+decs534 apply #fe7e7e7e -> #fe0e7c7e
+decs535 apply #fe000000 -> -sNaN
+decs536 apply #ff7f7f7f -> #fe0f7c7f
+decs537 apply #ff000000 -> -sNaN
+decs538 apply #ffffffff -> -sNaN999999
+decs539 apply #ffffffff -> #fe03fcff
+
+-- diagnostic NaNs
+decs540 apply NaN -> #7c000000
+decs541 apply NaN0 -> #7c000000
+decs542 apply NaN1 -> #7c000001
+decs543 apply NaN12 -> #7c000012
+decs544 apply NaN79 -> #7c000079
+decs545 apply NaN12345 -> #7c0049c5
+decs546 apply NaN123456 -> #7c028e56
+decs547 apply NaN799799 -> #7c0f7fdf
+decs548 apply NaN999999 -> #7c03fcff
+
+
+-- fold-down full sequence
+decs601 apply 1E+96 -> #47f00000 Clamped
+decs602 apply #47f00000 -> 1.000000E+96
+decs603 apply 1E+95 -> #43f20000 Clamped
+decs604 apply #43f20000 -> 1.00000E+95
+decs605 apply 1E+94 -> #43f04000 Clamped
+decs606 apply #43f04000 -> 1.0000E+94
+decs607 apply 1E+93 -> #43f00400 Clamped
+decs608 apply #43f00400 -> 1.000E+93
+decs609 apply 1E+92 -> #43f00080 Clamped
+decs610 apply #43f00080 -> 1.00E+92
+decs611 apply 1E+91 -> #43f00010 Clamped
+decs612 apply #43f00010 -> 1.0E+91
+decs613 apply 1E+90 -> #43f00001
+decs614 apply #43f00001 -> 1E+90
+
+
+-- Selected DPD codes
+decs700 apply #22500000 -> 0
+decs701 apply #22500009 -> 9
+decs702 apply #22500010 -> 10
+decs703 apply #22500019 -> 19
+decs704 apply #22500020 -> 20
+decs705 apply #22500029 -> 29
+decs706 apply #22500030 -> 30
+decs707 apply #22500039 -> 39
+decs708 apply #22500040 -> 40
+decs709 apply #22500049 -> 49
+decs710 apply #22500050 -> 50
+decs711 apply #22500059 -> 59
+decs712 apply #22500060 -> 60
+decs713 apply #22500069 -> 69
+decs714 apply #22500070 -> 70
+decs715 apply #22500071 -> 71
+decs716 apply #22500072 -> 72
+decs717 apply #22500073 -> 73
+decs718 apply #22500074 -> 74
+decs719 apply #22500075 -> 75
+decs720 apply #22500076 -> 76
+decs721 apply #22500077 -> 77
+decs722 apply #22500078 -> 78
+decs723 apply #22500079 -> 79
+
+decs730 apply #2250029e -> 994
+decs731 apply #2250029f -> 995
+decs732 apply #225002a0 -> 520
+decs733 apply #225002a1 -> 521
+
+-- DPD: one of each of the huffman groups
+decs740 apply #225003f7 -> 777
+decs741 apply #225003f8 -> 778
+decs742 apply #225003eb -> 787
+decs743 apply #2250037d -> 877
+decs744 apply #2250039f -> 997
+decs745 apply #225003bf -> 979
+decs746 apply #225003df -> 799
+decs747 apply #2250006e -> 888
+
+
+-- DPD all-highs cases (includes the 24 redundant codes)
+decs750 apply #2250006e -> 888
+decs751 apply #2250016e -> 888
+decs752 apply #2250026e -> 888
+decs753 apply #2250036e -> 888
+decs754 apply #2250006f -> 889
+decs755 apply #2250016f -> 889
+decs756 apply #2250026f -> 889
+decs757 apply #2250036f -> 889
+
+decs760 apply #2250007e -> 898
+decs761 apply #2250017e -> 898
+decs762 apply #2250027e -> 898
+decs763 apply #2250037e -> 898
+decs764 apply #2250007f -> 899
+decs765 apply #2250017f -> 899
+decs766 apply #2250027f -> 899
+decs767 apply #2250037f -> 899
+
+decs770 apply #225000ee -> 988
+decs771 apply #225001ee -> 988
+decs772 apply #225002ee -> 988
+decs773 apply #225003ee -> 988
+decs774 apply #225000ef -> 989
+decs775 apply #225001ef -> 989
+decs776 apply #225002ef -> 989
+decs777 apply #225003ef -> 989
+
+decs780 apply #225000fe -> 998
+decs781 apply #225001fe -> 998
+decs782 apply #225002fe -> 998
+decs783 apply #225003fe -> 998
+decs784 apply #225000ff -> 999
+decs785 apply #225001ff -> 999
+decs786 apply #225002ff -> 999
+decs787 apply #225003ff -> 999
+
+-- narrowing case
+decs790 apply 2.00E-99 -> #00000100 Subnormal
+decs791 apply #00000100 -> 2.00E-99 Subnormal
diff --git a/Lib/test/decimaltestdata/exp.decTest b/Lib/test/decimaltestdata/exp.decTest
index 021b478ac2..eab990d3ef 100644
--- a/Lib/test/decimaltestdata/exp.decTest
+++ b/Lib/test/decimaltestdata/exp.decTest
@@ -1,674 +1,674 @@
-------------------------------------------------------------------------
--- exp.decTest -- decimal natural exponentiation --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- Tests of the exponential funtion. Currently all testcases here
--- show results which are correctly rounded (within <= 0.5 ulp).
-
-extended: 1
-precision: 9
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- basics (examples in specificiation, etc.)
-expx001 exp -Infinity -> 0
-expx002 exp -10 -> 0.0000453999298 Inexact Rounded
-expx003 exp -1 -> 0.367879441 Inexact Rounded
-expx004 exp 0 -> 1
-expx005 exp -0 -> 1
-expx006 exp 1 -> 2.71828183 Inexact Rounded
-expx007 exp 0.693147181 -> 2.00000000 Inexact Rounded
-expx008 exp 10 -> 22026.4658 Inexact Rounded
-expx009 exp +Infinity -> Infinity
-
--- tiny edge cases
-precision: 7
-expx011 exp 0.1 -> 1.105171 Inexact Rounded
-expx012 exp 0.01 -> 1.010050 Inexact Rounded
-expx013 exp 0.001 -> 1.001001 Inexact Rounded
-expx014 exp 0.0001 -> 1.000100 Inexact Rounded
-expx015 exp 0.00001 -> 1.000010 Inexact Rounded
-expx016 exp 0.000001 -> 1.000001 Inexact Rounded
-expx017 exp 0.0000001 -> 1.000000 Inexact Rounded
-expx018 exp 0.0000003 -> 1.000000 Inexact Rounded
-expx019 exp 0.0000004 -> 1.000000 Inexact Rounded
-expx020 exp 0.0000005 -> 1.000001 Inexact Rounded
-expx021 exp 0.0000008 -> 1.000001 Inexact Rounded
-expx022 exp 0.0000009 -> 1.000001 Inexact Rounded
-expx023 exp 0.0000010 -> 1.000001 Inexact Rounded
-expx024 exp 0.0000011 -> 1.000001 Inexact Rounded
-expx025 exp 0.00000009 -> 1.000000 Inexact Rounded
-expx026 exp 0.00000005 -> 1.000000 Inexact Rounded
-expx027 exp 0.00000004 -> 1.000000 Inexact Rounded
-expx028 exp 0.00000001 -> 1.000000 Inexact Rounded
-
--- and some more zeros
-expx030 exp 0.00000000 -> 1
-expx031 exp 0E+100 -> 1
-expx032 exp 0E-100 -> 1
-expx033 exp -0.00000000 -> 1
-expx034 exp -0E+100 -> 1
-expx035 exp -0E-100 -> 1
-
--- basic e=0, e=1, e=2, e=4, e>=8 cases
-precision: 7
-expx041 exp 1 -> 2.718282 Inexact Rounded
-expx042 exp -1 -> 0.3678794 Inexact Rounded
-expx043 exp 10 -> 22026.47 Inexact Rounded
-expx044 exp -10 -> 0.00004539993 Inexact Rounded
-expx045 exp 100 -> 2.688117E+43 Inexact Rounded
-expx046 exp -100 -> 3.720076E-44 Inexact Rounded
-expx047 exp 1000 -> Infinity Overflow Inexact Rounded
-expx048 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx049 exp 100000000 -> Infinity Overflow Inexact Rounded
-expx050 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-
--- miscellanea
--- similar to 'VF bug' test, at 17, but with last digit corrected for decimal
-precision: 16
-expx055 exp -5.42410311287441459172E+2 -> 2.717658486884572E-236 Inexact Rounded
--- result from NetRexx/Java prototype -> 2.7176584868845721117677929628617246054459644711108E-236
--- result from Rexx (series) version -> 2.717658486884572111767792962861724605446E-236
-precision: 17
-expx056 exp -5.42410311287441459172E+2 -> 2.7176584868845721E-236 Inexact Rounded
-precision: 18
-expx057 exp -5.42410311287441459172E+2 -> 2.71765848688457211E-236 Inexact Rounded
-precision: 19
-expx058 exp -5.42410311287441459172E+2 -> 2.717658486884572112E-236 Inexact Rounded
-precision: 20
-expx059 exp -5.42410311287441459172E+2 -> 2.7176584868845721118E-236 Inexact Rounded
-
--- rounding in areas of ..500.., ..499.., ..100.., ..999.. sequences
-precision: 50
-expx101 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
-precision: 31
-expx102 exp -9E-8 -> 0.9999999100000040499998785000027 Inexact Rounded
-precision: 30
-expx103 exp -9E-8 -> 0.999999910000004049999878500003 Inexact Rounded
-precision: 29
-expx104 exp -9E-8 -> 0.99999991000000404999987850000 Inexact Rounded
-precision: 28
-expx105 exp -9E-8 -> 0.9999999100000040499998785000 Inexact Rounded
-precision: 27
-expx106 exp -9E-8 -> 0.999999910000004049999878500 Inexact Rounded
-precision: 26
-expx107 exp -9E-8 -> 0.99999991000000404999987850 Inexact Rounded
-precision: 25
-expx108 exp -9E-8 -> 0.9999999100000040499998785 Inexact Rounded
-precision: 24
-expx109 exp -9E-8 -> 0.999999910000004049999879 Inexact Rounded
-precision: 23
-expx110 exp -9E-8 -> 0.99999991000000404999988 Inexact Rounded
-precision: 22
-expx111 exp -9E-8 -> 0.9999999100000040499999 Inexact Rounded
-precision: 21
-expx112 exp -9E-8 -> 0.999999910000004050000 Inexact Rounded
-precision: 20
-expx113 exp -9E-8 -> 0.99999991000000405000 Inexact Rounded
-precision: 19
-expx114 exp -9E-8 -> 0.9999999100000040500 Inexact Rounded
-precision: 18
-expx115 exp -9E-8 -> 0.999999910000004050 Inexact Rounded
-precision: 17
-expx116 exp -9E-8 -> 0.99999991000000405 Inexact Rounded
-precision: 16
-expx117 exp -9E-8 -> 0.9999999100000040 Inexact Rounded
-precision: 15
-expx118 exp -9E-8 -> 0.999999910000004 Inexact Rounded
-precision: 14
-expx119 exp -9E-8 -> 0.99999991000000 Inexact Rounded
-precision: 13
-expx120 exp -9E-8 -> 0.9999999100000 Inexact Rounded
-precision: 12
-expx121 exp -9E-8 -> 0.999999910000 Inexact Rounded
-precision: 11
-expx122 exp -9E-8 -> 0.99999991000 Inexact Rounded
-precision: 10
-expx123 exp -9E-8 -> 0.9999999100 Inexact Rounded
-precision: 9
-expx124 exp -9E-8 -> 0.999999910 Inexact Rounded
-precision: 8
-expx125 exp -9E-8 -> 0.99999991 Inexact Rounded
-precision: 7
-expx126 exp -9E-8 -> 0.9999999 Inexact Rounded
-precision: 6
-expx127 exp -9E-8 -> 1.00000 Inexact Rounded
-precision: 5
-expx128 exp -9E-8 -> 1.0000 Inexact Rounded
-precision: 4
-expx129 exp -9E-8 -> 1.000 Inexact Rounded
-precision: 3
-expx130 exp -9E-8 -> 1.00 Inexact Rounded
-precision: 2
-expx131 exp -9E-8 -> 1.0 Inexact Rounded
-precision: 1
-expx132 exp -9E-8 -> 1 Inexact Rounded
-
-
--- sanity checks, with iteration counts [normalized so 0<=|x|<1]
-precision: 50
-
-expx210 exp 0 -> 1
--- iterations: 2
-expx211 exp -1E-40 -> 0.99999999999999999999999999999999999999990000000000 Inexact Rounded
--- iterations: 8
-expx212 exp -9E-7 -> 0.99999910000040499987850002733749507925073811240510 Inexact Rounded
--- iterations: 6
-expx213 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
--- iterations: 15
-expx214 exp -0.003 -> 0.99700449550337297601206623409756091074177480489845 Inexact Rounded
--- iterations: 14
-expx215 exp -0.001 -> 0.99900049983337499166805535716765597470235590236008 Inexact Rounded
--- iterations: 26
-expx216 exp -0.1 -> 0.90483741803595957316424905944643662119470536098040 Inexact Rounded
--- iterations: 39
-expx217 exp -0.7 -> 0.49658530379140951470480009339752896170766716571182 Inexact Rounded
--- iterations: 41
-expx218 exp -0.9 -> 0.40656965974059911188345423964562598783370337617038 Inexact Rounded
--- iterations: 43
-expx219 exp -0.99 -> 0.37157669102204569053152411990820138691802885490501 Inexact Rounded
--- iterations: 26
-expx220 exp -1 -> 0.36787944117144232159552377016146086744581113103177 Inexact Rounded
--- iterations: 26
-expx221 exp -1.01 -> 0.36421897957152331975704629563734548959589139192482 Inexact Rounded
--- iterations: 27
-expx222 exp -1.1 -> 0.33287108369807955328884690643131552161247952156921 Inexact Rounded
--- iterations: 28
-expx223 exp -1.5 -> 0.22313016014842982893328047076401252134217162936108 Inexact Rounded
--- iterations: 30
-expx224 exp -2 -> 0.13533528323661269189399949497248440340763154590958 Inexact Rounded
--- iterations: 36
-expx225 exp -5 -> 0.0067379469990854670966360484231484242488495850273551 Inexact Rounded
--- iterations: 26
-expx226 exp -10 -> 0.000045399929762484851535591515560550610237918088866565 Inexact Rounded
--- iterations: 28
-expx227 exp -14 -> 8.3152871910356788406398514256526229460765836498457E-7 Inexact Rounded
--- iterations: 29
-expx228 exp -15 -> 3.0590232050182578837147949770228963937082078081856E-7 Inexact Rounded
--- iterations: 30
-expx233 exp 0 -> 1
--- iterations: 2
-expx234 exp 1E-40 -> 1.0000000000000000000000000000000000000001000000000 Inexact Rounded
--- iterations: 7
-expx235 exp 9E-7 -> 1.0000009000004050001215000273375049207507381125949 Inexact Rounded
--- iterations: 6
-expx236 exp 9E-8 -> 1.0000000900000040500001215000027337500492075007381 Inexact Rounded
--- iterations: 15
-expx237 exp 0.003 -> 1.0030045045033770260129340913489002053318727195619 Inexact Rounded
--- iterations: 13
-expx238 exp 0.001 -> 1.0010005001667083416680557539930583115630762005807 Inexact Rounded
--- iterations: 25
-expx239 exp 0.1 -> 1.1051709180756476248117078264902466682245471947375 Inexact Rounded
--- iterations: 38
-expx240 exp 0.7 -> 2.0137527074704765216245493885830652700175423941459 Inexact Rounded
--- iterations: 41
-expx241 exp 0.9 -> 2.4596031111569496638001265636024706954217723064401 Inexact Rounded
--- iterations: 42
-expx242 exp 0.99 -> 2.6912344723492622890998794040710139721802931841030 Inexact Rounded
--- iterations: 26
-expx243 exp 1 -> 2.7182818284590452353602874713526624977572470937000 Inexact Rounded
--- iterations: 26
-expx244 exp 1.01 -> 2.7456010150169164939897763166603876240737508195960 Inexact Rounded
--- iterations: 26
-expx245 exp 1.1 -> 3.0041660239464331120584079535886723932826810260163 Inexact Rounded
--- iterations: 28
-expx246 exp 1.5 -> 4.4816890703380648226020554601192758190057498683697 Inexact Rounded
--- iterations: 29
-expx247 exp 2 -> 7.3890560989306502272304274605750078131803155705518 Inexact Rounded
--- iterations: 36
-expx248 exp 5 -> 148.41315910257660342111558004055227962348766759388 Inexact Rounded
--- iterations: 26
-expx249 exp 10 -> 22026.465794806716516957900645284244366353512618557 Inexact Rounded
--- iterations: 28
-expx250 exp 14 -> 1202604.2841647767777492367707678594494124865433761 Inexact Rounded
--- iterations: 28
-expx251 exp 15 -> 3269017.3724721106393018550460917213155057385438200 Inexact Rounded
--- iterations: 29
-
--- a biggie [result verified 3 ways]
-precision: 250
-expx260 exp 1 -> 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668 Inexact Rounded
-
--- extreme range boundaries
-precision: 16
-maxExponent: 999999
-minExponent: -999999
--- Ntiny boundary
-expx290 exp -2302618.022332529 -> 0E-1000014 Underflow Subnormal Inexact Rounded Clamped
-expx291 exp -2302618.022332528 -> 1E-1000014 Underflow Subnormal Inexact Rounded
--- Nmax/10 and Nmax boundary
-expx292 exp 2302582.790408952 -> 9.999999993100277E+999998 Inexact Rounded
-expx293 exp 2302582.790408953 -> 1.000000000310028E+999999 Inexact Rounded
-expx294 exp 2302585.092993946 -> 9.999999003159870E+999999 Inexact Rounded
-expx295 exp 2302585.092994036 -> 9.999999903159821E+999999 Inexact Rounded
-expx296 exp 2302585.092994045 -> 9.999999993159820E+999999 Inexact Rounded
-expx297 exp 2302585.092994046 -> Infinity Overflow Inexact Rounded
-
--- 0<-x<<1 effects
-precision: 30
-expx320 exp -4.9999999999999E-8 -> 0.999999950000001250000979166617 Inexact Rounded
-expx321 exp -5.0000000000000E-8 -> 0.999999950000001249999979166667 Inexact Rounded
-expx322 exp -5.0000000000001E-8 -> 0.999999950000001249998979166717 Inexact Rounded
-precision: 20
-expx323 exp -4.9999999999999E-8 -> 0.99999995000000125000 Inexact Rounded
-expx324 exp -5.0000000000000E-8 -> 0.99999995000000125000 Inexact Rounded
-expx325 exp -5.0000000000001E-8 -> 0.99999995000000125000 Inexact Rounded
-precision: 14
-expx326 exp -4.9999999999999E-8 -> 0.99999995000000 Inexact Rounded
-expx327 exp -5.0000000000000E-8 -> 0.99999995000000 Inexact Rounded
-expx328 exp -5.0000000000001E-8 -> 0.99999995000000 Inexact Rounded
--- overprecise and 0<-x<<1
-precision: 8
-expx330 exp -4.9999999999999E-8 -> 0.99999995 Inexact Rounded
-expx331 exp -5.0000000000000E-8 -> 0.99999995 Inexact Rounded
-expx332 exp -5.0000000000001E-8 -> 0.99999995 Inexact Rounded
-precision: 7
-expx333 exp -4.9999999999999E-8 -> 1.000000 Inexact Rounded
-expx334 exp -5.0000000000000E-8 -> 1.000000 Inexact Rounded
-expx335 exp -5.0000000000001E-8 -> 1.000000 Inexact Rounded
-precision: 3
-expx336 exp -4.9999999999999E-8 -> 1.00 Inexact Rounded
-expx337 exp -5.0000000000000E-8 -> 1.00 Inexact Rounded
-expx338 exp -5.0000000000001E-8 -> 1.00 Inexact Rounded
-
--- 0<x<<1 effects
-precision: 30
-expx340 exp 4.9999999999999E-8 -> 1.00000005000000124999902083328 Inexact Rounded
-expx341 exp 5.0000000000000E-8 -> 1.00000005000000125000002083333 Inexact Rounded
-expx342 exp 5.0000000000001E-8 -> 1.00000005000000125000102083338 Inexact Rounded
-precision: 20
-expx343 exp 4.9999999999999E-8 -> 1.0000000500000012500 Inexact Rounded
-expx344 exp 5.0000000000000E-8 -> 1.0000000500000012500 Inexact Rounded
-expx345 exp 5.0000000000001E-8 -> 1.0000000500000012500 Inexact Rounded
-precision: 14
-expx346 exp 4.9999999999999E-8 -> 1.0000000500000 Inexact Rounded
-expx347 exp 5.0000000000000E-8 -> 1.0000000500000 Inexact Rounded
-expx348 exp 5.0000000000001E-8 -> 1.0000000500000 Inexact Rounded
--- overprecise and 0<x<<1
-precision: 8
-expx350 exp 4.9999999999999E-8 -> 1.0000001 Inexact Rounded
-expx351 exp 5.0000000000000E-8 -> 1.0000001 Inexact Rounded
-expx352 exp 5.0000000000001E-8 -> 1.0000001 Inexact Rounded
-precision: 7
-expx353 exp 4.9999999999999E-8 -> 1.000000 Inexact Rounded
-expx354 exp 5.0000000000000E-8 -> 1.000000 Inexact Rounded
-expx355 exp 5.0000000000001E-8 -> 1.000000 Inexact Rounded
-precision: 3
-expx356 exp 4.9999999999999E-8 -> 1.00 Inexact Rounded
-expx357 exp 5.0000000000000E-8 -> 1.00 Inexact Rounded
-expx358 exp 5.0000000000001E-8 -> 1.00 Inexact Rounded
-
--- cases near 1 -- 1 2345678901234567890
-precision: 20
-expx401 exp 0.99999999999996 -> 2.7182818284589365041 Inexact Rounded
-expx402 exp 0.99999999999997 -> 2.7182818284589636869 Inexact Rounded
-expx403 exp 0.99999999999998 -> 2.7182818284589908697 Inexact Rounded
-expx404 exp 0.99999999999999 -> 2.7182818284590180525 Inexact Rounded
-expx405 exp 1.0000000000000 -> 2.7182818284590452354 Inexact Rounded
-expx406 exp 1.0000000000001 -> 2.7182818284593170635 Inexact Rounded
-expx407 exp 1.0000000000002 -> 2.7182818284595888917 Inexact Rounded
-precision: 14
-expx411 exp 0.99999999999996 -> 2.7182818284589 Inexact Rounded
-expx412 exp 0.99999999999997 -> 2.7182818284590 Inexact Rounded
-expx413 exp 0.99999999999998 -> 2.7182818284590 Inexact Rounded
-expx414 exp 0.99999999999999 -> 2.7182818284590 Inexact Rounded
-expx415 exp 1.0000000000000 -> 2.7182818284590 Inexact Rounded
-expx416 exp 1.0000000000001 -> 2.7182818284593 Inexact Rounded
-expx417 exp 1.0000000000002 -> 2.7182818284596 Inexact Rounded
--- overprecise...
-precision: 7
-expx421 exp 0.99999999999996 -> 2.718282 Inexact Rounded
-expx422 exp 0.99999999999997 -> 2.718282 Inexact Rounded
-expx423 exp 0.99999999999998 -> 2.718282 Inexact Rounded
-expx424 exp 0.99999999999999 -> 2.718282 Inexact Rounded
-expx425 exp 1.0000000000001 -> 2.718282 Inexact Rounded
-expx426 exp 1.0000000000002 -> 2.718282 Inexact Rounded
-expx427 exp 1.0000000000003 -> 2.718282 Inexact Rounded
-precision: 2
-expx431 exp 0.99999999999996 -> 2.7 Inexact Rounded
-expx432 exp 0.99999999999997 -> 2.7 Inexact Rounded
-expx433 exp 0.99999999999998 -> 2.7 Inexact Rounded
-expx434 exp 0.99999999999999 -> 2.7 Inexact Rounded
-expx435 exp 1.0000000000001 -> 2.7 Inexact Rounded
-expx436 exp 1.0000000000002 -> 2.7 Inexact Rounded
-expx437 exp 1.0000000000003 -> 2.7 Inexact Rounded
-
--- basics at low precisions
-precision: 3
-expx501 exp -Infinity -> 0
-expx502 exp -10 -> 0.0000454 Inexact Rounded
-expx503 exp -1 -> 0.368 Inexact Rounded
-expx504 exp 0 -> 1
-expx505 exp -0 -> 1
-expx506 exp 1 -> 2.72 Inexact Rounded
-expx507 exp 0.693147181 -> 2.00 Inexact Rounded
-expx508 exp 10 -> 2.20E+4 Inexact Rounded
-expx509 exp +Infinity -> Infinity
-precision: 2
-expx511 exp -Infinity -> 0
-expx512 exp -10 -> 0.000045 Inexact Rounded
-expx513 exp -1 -> 0.37 Inexact Rounded
-expx514 exp 0 -> 1
-expx515 exp -0 -> 1
-expx516 exp 1 -> 2.7 Inexact Rounded
-expx517 exp 0.693147181 -> 2.0 Inexact Rounded
-expx518 exp 10 -> 2.2E+4 Inexact Rounded
-expx519 exp +Infinity -> Infinity
-precision: 1
-expx521 exp -Infinity -> 0
-expx522 exp -10 -> 0.00005 Inexact Rounded
-expx523 exp -1 -> 0.4 Inexact Rounded
-expx524 exp 0 -> 1
-expx525 exp -0 -> 1
-expx526 exp 1 -> 3 Inexact Rounded
-expx527 exp 0.693147181 -> 2 Inexact Rounded
-expx528 exp 10 -> 2E+4 Inexact Rounded
-expx529 exp +Infinity -> Infinity
-
--- overflows, including some overprecise borderlines
-precision: 7
-maxExponent: 384
-minExponent: -383
-expx701 exp 1000000000 -> Infinity Overflow Inexact Rounded
-expx702 exp 100000000 -> Infinity Overflow Inexact Rounded
-expx703 exp 10000000 -> Infinity Overflow Inexact Rounded
-expx704 exp 1000000 -> Infinity Overflow Inexact Rounded
-expx705 exp 100000 -> Infinity Overflow Inexact Rounded
-expx706 exp 10000 -> Infinity Overflow Inexact Rounded
-expx707 exp 1000 -> Infinity Overflow Inexact Rounded
-expx708 exp 886.4952608 -> Infinity Overflow Inexact Rounded
-expx709 exp 886.4952607 -> 9.999999E+384 Inexact Rounded
-expx710 exp 886.49527 -> Infinity Overflow Inexact Rounded
-expx711 exp 886.49526 -> 9.999992E+384 Inexact Rounded
-precision: 16
-expx721 exp 886.4952608027075883 -> Infinity Overflow Inexact Rounded
-expx722 exp 886.4952608027075882 -> 9.999999999999999E+384 Inexact Rounded
-expx723 exp 886.49526080270759 -> Infinity Overflow Inexact Rounded
-expx724 exp 886.49526080270758 -> 9.999999999999917E+384 Inexact Rounded
-expx725 exp 886.4952608027076 -> Infinity Overflow Inexact Rounded
-expx726 exp 886.4952608027075 -> 9.999999999999117E+384 Inexact Rounded
--- and by special request ...
-precision: 15
-expx731 exp 886.495260802708 -> Infinity Overflow Inexact Rounded
-expx732 exp 886.495260802707 -> 9.99999999999412E+384 Inexact Rounded
-expx733 exp 886.495260802706 -> 9.99999999998412E+384 Inexact Rounded
-maxExponent: 999
-minExponent: -999
-expx735 exp 2302.58509299405 -> Infinity Overflow Inexact Rounded
-expx736 exp 2302.58509299404 -> 9.99999999994316E+999 Inexact Rounded
-expx737 exp 2302.58509299403 -> 9.99999999984316E+999 Inexact Rounded
-
--- subnormals and underflows, including underflow-to-zero edge point
-precision: 7
-maxExponent: 384
-minExponent: -383
-expx751 exp -1000000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx752 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx753 exp -10000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx754 exp -1000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx755 exp -100000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx756 exp -10000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx757 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
-expx758 exp -881.89009 -> 1.000001E-383 Inexact Rounded
-expx759 exp -881.8901 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
-expx760 exp -885 -> 4.4605E-385 Inexact Rounded Underflow Subnormal
-expx761 exp -888 -> 2.221E-386 Inexact Rounded Underflow Subnormal
-expx762 exp -890 -> 3.01E-387 Inexact Rounded Underflow Subnormal
-expx763 exp -892.9 -> 1.7E-388 Inexact Rounded Underflow Subnormal
-expx764 exp -893 -> 1.5E-388 Inexact Rounded Underflow Subnormal
-expx765 exp -893.5 -> 9E-389 Inexact Rounded Underflow Subnormal
-expx766 exp -895.7056 -> 1E-389 Inexact Rounded Underflow Subnormal
-expx769 exp -895.8 -> 1E-389 Inexact Rounded Underflow Subnormal
-expx770 exp -895.73 -> 1E-389 Inexact Rounded Underflow Subnormal
-expx771 exp -896.3987 -> 1E-389 Inexact Rounded Underflow Subnormal
-expx772 exp -896.3988 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
-expx773 exp -898.0081 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
-expx774 exp -898.0082 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
-
--- special values
-maxexponent: 999
-minexponent: -999
-expx820 exp Inf -> Infinity
-expx821 exp -Inf -> 0
-expx822 exp NaN -> NaN
-expx823 exp sNaN -> NaN Invalid_operation
--- propagating NaNs
-expx824 exp sNaN123 -> NaN123 Invalid_operation
-expx825 exp -sNaN321 -> -NaN321 Invalid_operation
-expx826 exp NaN456 -> NaN456
-expx827 exp -NaN654 -> -NaN654
-expx828 exp NaN1 -> NaN1
-
--- Invalid operations due to restrictions
--- [next two probably skipped by most test harnesses]
-precision: 100000000
-expx901 exp -Infinity -> NaN Invalid_context
-precision: 99999999
-expx902 exp -Infinity -> NaN Invalid_context
-
-precision: 9
-maxExponent: 1000000
-minExponent: -999999
-expx903 exp -Infinity -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999999
-expx904 exp -Infinity -> 0
-maxExponent: 999999
-minExponent: -1000000
-expx905 exp -Infinity -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999998
-expx906 exp -Infinity -> 0
-
---
-maxExponent: 384
-minExponent: -383
-precision: 16
-rounding: half_even
-
--- Null test
-expx900 exp # -> NaN Invalid_operation
-
-
--- Randoms P=50, within 0-999
-Precision: 50
-maxExponent: 384
-minExponent: -383
-expx1501 exp 656.35397950590285612266095596539934213943872885728 -> 1.1243757610640319783611178528839652672062820040314E+285 Inexact Rounded
-expx1502 exp 0.93620571093652800225038550600780322831236082781471 -> 2.5502865130986176689199711857825771311178046842009 Inexact Rounded
-expx1503 exp 0.00000000000000008340785856601514714183373874105791 -> 1.0000000000000000834078585660151506202691740252512 Inexact Rounded
-expx1504 exp 0.00009174057262887789625745574686545163168788456203 -> 1.0000917447809239005146722341251524081006051473273 Inexact Rounded
-expx1505 exp 33.909116897973797735657751591014926629051117541243 -> 532773181025002.03543618901306726495870476617232229 Inexact Rounded
-expx1506 exp 0.00000740470413004406592124575295278456936809587311 -> 1.0000074047315449333590066395670306135567889210814 Inexact Rounded
-expx1507 exp 0.00000000000124854922222108802453746922483071445492 -> 1.0000000000012485492222218674621176239911424968263 Inexact Rounded
-expx1508 exp 4.1793280674155659794286951159430651258356014391382 -> 65.321946520147199404199787811336860087975118278185 Inexact Rounded
-expx1509 exp 485.43595745460655893746179890255529919221550201686 -> 6.6398403920459617255950476953129377459845366585463E+210 Inexact Rounded
-expx1510 exp 0.00000000003547259806590856032527875157830328156597 -> 1.0000000000354725980665377129320589406715000685515 Inexact Rounded
-expx1511 exp 0.00000000000000759621497339104047930616478635042678 -> 1.0000000000000075962149733910693305471257715463887 Inexact Rounded
-expx1512 exp 9.7959168821760339304571595474480640286072720233796 -> 17960.261146042955179164303653412650751681436352437 Inexact Rounded
-expx1513 exp 0.00000000566642006258290526783901451194943164535581 -> 1.0000000056664200786370634609832438815665249347650 Inexact Rounded
-expx1514 exp 741.29888791134298194088827572374718940925820027354 -> 8.7501694006317332808128946666402622432064923198731E+321 Inexact Rounded
-expx1515 exp 032.75573003552517668808529099897153710887014947935 -> 168125196578678.17725841108617955904425345631092339 Inexact Rounded
-expx1516 exp 42.333700726429333308594265553422902463737399437644 -> 2428245675864172475.4681119493045657797309369672012 Inexact Rounded
-expx1517 exp 0.00000000000000559682616876491888197609158802835798 -> 1.0000000000000055968261687649345442076732739577049 Inexact Rounded
-expx1518 exp 0.00000000000080703688668280193584758300973549486312 -> 1.0000000000008070368866831275901158164321867914342 Inexact Rounded
-expx1519 exp 640.72396012796509482382712891709072570653606838251 -> 1.8318094990683394229304133068983914236995326891045E+278 Inexact Rounded
-expx1520 exp 0.00000000000000509458922167631071416948112219512224 -> 1.0000000000000050945892216763236915891499324358556 Inexact Rounded
-expx1521 exp 6.7670394314315206378625221583973414660727960241395 -> 868.73613012822031367806248697092884415119568271315 Inexact Rounded
-expx1522 exp 04.823217407412963506638267226891024138054783122548 -> 124.36457929588837129731821077586705505565904205366 Inexact Rounded
-expx1523 exp 193.51307878701196403991208482520115359690106143615 -> 1.1006830872854715677390914655452261550768957576034E+84 Inexact Rounded
-expx1524 exp 5.7307749038303650539200345901210497015617393970463 -> 308.20800743106843083522721523715645950574866495196 Inexact Rounded
-expx1525 exp 0.00000000000095217825199797965200541169123743500267 -> 1.0000000000009521782519984329737172007991390381273 Inexact Rounded
-expx1526 exp 0.00027131440949183370966393682617930153495028919140 -> 1.0002713512185751022906058160480606598754913607364 Inexact Rounded
-expx1527 exp 0.00000000064503059114680682343002315662069272707123 -> 1.0000000006450305913548390552323517403613135496633 Inexact Rounded
-expx1528 exp 0.00000000000000095616643506527288866235238548440593 -> 1.0000000000000009561664350652733457894781582009094 Inexact Rounded
-expx1529 exp 0.00000000000000086449942811678650244459550252743433 -> 1.0000000000000008644994281167868761242261096529986 Inexact Rounded
-expx1530 exp 0.06223488355635359965683053157729204988381887621850 -> 1.0642122813392406657789688931838919323826250630831 Inexact Rounded
-expx1531 exp 0.00000400710807804429435502657131912308680674057053 -> 1.0000040071161065125925620890019319832127863559260 Inexact Rounded
-expx1532 exp 85.522796894744576211573232055494551429297878413017 -> 13870073686404228452757799770251085177.853337368935 Inexact Rounded
-expx1533 exp 9.1496720811363678696938036379756663548353399954363 -> 9411.3537122832743386783597629161763057370034495157 Inexact Rounded
-expx1534 exp 8.2215705240788294472944382056330516738577785177942 -> 3720.3406813383076953899654701615084425598377758189 Inexact Rounded
-expx1535 exp 0.00000000015772064569640613142823203726821076239561 -> 1.0000000001577206457088440324683315788358926129830 Inexact Rounded
-expx1536 exp 0.58179346473959531432624153576883440625538017532480 -> 1.7892445018275360163797022372655837188423194863605 Inexact Rounded
-expx1537 exp 33.555726197149525061455517784870570470833498096559 -> 374168069896324.62578073148993526626307095854407952 Inexact Rounded
-expx1538 exp 9.7898079803906215094140010009583375537259810398659 -> 17850.878119912208888217100998019986634620368538426 Inexact Rounded
-expx1539 exp 89.157697327174521542502447953032536541038636966347 -> 525649152320166503771224149330448089550.67293829227 Inexact Rounded
-expx1540 exp 25.022947600123328912029051897171319573322888514885 -> 73676343442.952517824345431437683153304645851960524 Inexact Rounded
-
--- exp(1) at 34
-Precision: 34
-expx1200 exp 1 -> 2.718281828459045235360287471352662 Inexact Rounded
-
--- Randoms P=34, within 0-999
-Precision: 34
-maxExponent: 6144
-minExponent: -6143
-expx1201 exp 309.5948855821510212996700645087188 -> 2.853319692901387521201738015050724E+134 Inexact Rounded
-expx1202 exp 9.936543068706211420422803962680164 -> 20672.15839203171877476511093276022 Inexact Rounded
-expx1203 exp 6.307870323881505684429839491707908 -> 548.8747777054637296137277391754665 Inexact Rounded
-expx1204 exp 0.0003543281389438420535201308282503 -> 1.000354390920573746164733350843155 Inexact Rounded
-expx1205 exp 0.0000037087453363918375598394920229 -> 1.000003708752213796324841920189323 Inexact Rounded
-expx1206 exp 0.0020432312687512438040222444116585 -> 1.002045320088164826013561630975308 Inexact Rounded
-expx1207 exp 6.856313340032177672550343216129586 -> 949.8587981604144147983589660524396 Inexact Rounded
-expx1208 exp 0.0000000000402094928333815643326418 -> 1.000000000040209492834189965989612 Inexact Rounded
-expx1209 exp 0.0049610784722412117632647003545839 -> 1.004973404997901987039589029277833 Inexact Rounded
-expx1210 exp 0.0000891471883724066909746786702686 -> 1.000089151162101085412780088266699 Inexact Rounded
-expx1211 exp 08.59979170376061890684723211112566 -> 5430.528314920905714615339273738097 Inexact Rounded
-expx1212 exp 9.473117039341003854872778112752590 -> 13005.36234331224953460055897913917 Inexact Rounded
-expx1213 exp 0.0999060724692207648429969999310118 -> 1.105067116975190602296052700726802 Inexact Rounded
-expx1214 exp 0.0000000927804533555877884082269247 -> 1.000000092780457659694183954740772 Inexact Rounded
-expx1215 exp 0.0376578583872889916298772818265677 -> 1.038375900489771946477857818447556 Inexact Rounded
-expx1216 exp 261.6896411697539524911536116712307 -> 4.470613562127465095241600174941460E+113 Inexact Rounded
-expx1217 exp 0.0709997423269162980875824213889626 -> 1.073580949235407949417814485533172 Inexact Rounded
-expx1218 exp 0.0000000444605583295169895235658731 -> 1.000000044460559317887627657593900 Inexact Rounded
-expx1219 exp 0.0000021224072854777512281369815185 -> 1.000002122409537785687390631070906 Inexact Rounded
-expx1220 exp 547.5174462574156885473558485475052 -> 6.078629247383807942612114579728672E+237 Inexact Rounded
-expx1221 exp 0.0000009067598041615192002339844670 -> 1.000000906760215268314680115374387 Inexact Rounded
-expx1222 exp 0.0316476500308065365803455533244603 -> 1.032153761880187977658387961769034 Inexact Rounded
-expx1223 exp 84.46160530377645101833996706384473 -> 4.799644995897968383503269871697856E+36 Inexact Rounded
-expx1224 exp 0.0000000000520599740290848018904145 -> 1.000000000052059974030439922338393 Inexact Rounded
-expx1225 exp 0.0000006748530640093620665651726708 -> 1.000000674853291722742292331812997 Inexact Rounded
-expx1226 exp 0.0000000116853119761042020507916169 -> 1.000000011685312044377460306165203 Inexact Rounded
-expx1227 exp 0.0022593818094258636727616886693280 -> 1.002261936135876893707094845543461 Inexact Rounded
-expx1228 exp 0.0029398857673478912249856509667517 -> 1.002944211469495086813087651287012 Inexact Rounded
-expx1229 exp 0.7511480029928802775376270557636963 -> 2.119431734510320169806976569366789 Inexact Rounded
-expx1230 exp 174.9431952176750671150886423048447 -> 9.481222305374955011464619468044051E+75 Inexact Rounded
-expx1231 exp 0.0000810612451694136129199895164424 -> 1.000081064530720924186615149646920 Inexact Rounded
-expx1232 exp 51.06888989702669288180946272499035 -> 15098613888619165073959.89896018749 Inexact Rounded
-expx1233 exp 0.0000000005992887599437093651494510 -> 1.000000000599288760123282874082758 Inexact Rounded
-expx1234 exp 714.8549046761054856311108828903972 -> 2.867744544891081117381595080480784E+310 Inexact Rounded
-expx1235 exp 0.0000000004468247802990643645607110 -> 1.000000000446824780398890556720233 Inexact Rounded
-expx1236 exp 831.5818151589890366323551672043709 -> 1.417077409182624969435938062261655E+361 Inexact Rounded
-expx1237 exp 0.0000000006868323825179605747108044 -> 1.000000000686832382753829935602454 Inexact Rounded
-expx1238 exp 0.0000001306740266408976840228440255 -> 1.000000130674035178748675187648098 Inexact Rounded
-expx1239 exp 0.3182210609022267704811502412335163 -> 1.374680115667798185758927247894859 Inexact Rounded
-expx1240 exp 0.0147741234179104437440264644295501 -> 1.014883800239950682628277534839222 Inexact Rounded
-
--- Randoms P=16, within 0-99
-Precision: 16
-maxExponent: 384
-minExponent: -383
-expx1101 exp 8.473011527013724 -> 4783.900643969246 Inexact Rounded
-expx1102 exp 0.0000055753022764 -> 1.000005575317818 Inexact Rounded
-expx1103 exp 0.0000323474114482 -> 1.000032347934631 Inexact Rounded
-expx1104 exp 64.54374138544166 -> 1.073966476173531E+28 Inexact Rounded
-expx1105 exp 90.47203246416569 -> 1.956610887250643E+39 Inexact Rounded
-expx1106 exp 9.299931532342757 -> 10937.27033325227 Inexact Rounded
-expx1107 exp 8.759678437852203 -> 6372.062234495381 Inexact Rounded
-expx1108 exp 0.0000931755127172 -> 1.000093179853690 Inexact Rounded
-expx1109 exp 0.0000028101158373 -> 1.000002810119786 Inexact Rounded
-expx1110 exp 0.0000008008130919 -> 1.000000800813413 Inexact Rounded
-expx1111 exp 8.339771722299049 -> 4187.133803081878 Inexact Rounded
-expx1112 exp 0.0026140497995474 -> 1.002617469406750 Inexact Rounded
-expx1113 exp 0.7478033356261771 -> 2.112354781975418 Inexact Rounded
-expx1114 exp 51.77663761827966 -> 3.064135801120365E+22 Inexact Rounded
-expx1115 exp 0.1524989783061012 -> 1.164741272084955 Inexact Rounded
-expx1116 exp 0.0066298798669219 -> 1.006651906170791 Inexact Rounded
-expx1117 exp 9.955141865534960 -> 21060.23334287038 Inexact Rounded
-expx1118 exp 92.34503059198483 -> 1.273318993481226E+40 Inexact Rounded
-expx1119 exp 0.0000709388677346 -> 1.000070941383956 Inexact Rounded
-expx1120 exp 79.12883036433204 -> 2.318538899389243E+34 Inexact Rounded
-expx1121 exp 0.0000090881548873 -> 1.000009088196185 Inexact Rounded
-expx1122 exp 0.0424828809603411 -> 1.043398194245720 Inexact Rounded
-expx1123 exp 0.8009035891427416 -> 2.227552811933310 Inexact Rounded
-expx1124 exp 8.825786167283102 -> 6807.540455289995 Inexact Rounded
-expx1125 exp 1.535457249746275 -> 4.643448260146849 Inexact Rounded
-expx1126 exp 69.02254254355800 -> 9.464754500670653E+29 Inexact Rounded
-expx1127 exp 0.0007050554368713 -> 1.000705304046880 Inexact Rounded
-expx1128 exp 0.0000081206549504 -> 1.000008120687923 Inexact Rounded
-expx1129 exp 0.621774854641137 -> 1.862230298554903 Inexact Rounded
-expx1130 exp 3.847629031404354 -> 46.88177613568203 Inexact Rounded
-expx1131 exp 24.81250184697732 -> 59694268456.19966 Inexact Rounded
-expx1132 exp 5.107546500516044 -> 165.2643809755670 Inexact Rounded
-expx1133 exp 79.17810943951986 -> 2.435656372541360E+34 Inexact Rounded
-expx1134 exp 0.0051394695667015 -> 1.005152699295301 Inexact Rounded
-expx1135 exp 57.44504488501725 -> 8.872908566929688E+24 Inexact Rounded
-expx1136 exp 0.0000508388968036 -> 1.000050840189122 Inexact Rounded
-expx1137 exp 69.71309932148997 -> 1.888053740693541E+30 Inexact Rounded
-expx1138 exp 0.0064183412981502 -> 1.006438982988835 Inexact Rounded
-expx1139 exp 9.346991220814677 -> 11464.27802035082 Inexact Rounded
-expx1140 exp 33.09087139999152 -> 235062229168763.5 Inexact Rounded
-
--- Randoms P=7, within 0-9
-Precision: 7
-maxExponent: 96
-minExponent: -95
-expx1001 exp 2.395441 -> 10.97304 Inexact Rounded
-expx1002 exp 0.6406779 -> 1.897767 Inexact Rounded
-expx1003 exp 0.5618218 -> 1.753865 Inexact Rounded
-expx1004 exp 3.055120 -> 21.22373 Inexact Rounded
-expx1005 exp 1.536792 -> 4.649650 Inexact Rounded
-expx1006 exp 0.0801591 -> 1.083459 Inexact Rounded
-expx1007 exp 0.0966875 -> 1.101516 Inexact Rounded
-expx1008 exp 0.0646761 -> 1.066813 Inexact Rounded
-expx1009 exp 0.0095670 -> 1.009613 Inexact Rounded
-expx1010 exp 2.956859 -> 19.23745 Inexact Rounded
-expx1011 exp 7.504679 -> 1816.522 Inexact Rounded
-expx1012 exp 0.0045259 -> 1.004536 Inexact Rounded
-expx1013 exp 3.810071 -> 45.15364 Inexact Rounded
-expx1014 exp 1.502390 -> 4.492413 Inexact Rounded
-expx1015 exp 0.0321523 -> 1.032675 Inexact Rounded
-expx1016 exp 0.0057214 -> 1.005738 Inexact Rounded
-expx1017 exp 9.811445 -> 18241.33 Inexact Rounded
-expx1018 exp 3.245249 -> 25.66810 Inexact Rounded
-expx1019 exp 0.3189742 -> 1.375716 Inexact Rounded
-expx1020 exp 0.8621610 -> 2.368273 Inexact Rounded
-expx1021 exp 0.0122511 -> 1.012326 Inexact Rounded
-expx1022 exp 2.202088 -> 9.043877 Inexact Rounded
-expx1023 exp 8.778203 -> 6491.202 Inexact Rounded
-expx1024 exp 0.1896279 -> 1.208800 Inexact Rounded
-expx1025 exp 0.4510947 -> 1.570030 Inexact Rounded
-expx1026 exp 0.276413 -> 1.318392 Inexact Rounded
-expx1027 exp 4.490067 -> 89.12742 Inexact Rounded
-expx1028 exp 0.0439786 -> 1.044960 Inexact Rounded
-expx1029 exp 0.8168245 -> 2.263301 Inexact Rounded
-expx1030 exp 0.0391658 -> 1.039943 Inexact Rounded
-expx1031 exp 9.261816 -> 10528.24 Inexact Rounded
-expx1032 exp 9.611186 -> 14930.87 Inexact Rounded
-expx1033 exp 9.118125 -> 9119.087 Inexact Rounded
-expx1034 exp 9.469083 -> 12953.00 Inexact Rounded
-expx1035 exp 0.0499983 -> 1.051269 Inexact Rounded
-expx1036 exp 0.0050746 -> 1.005087 Inexact Rounded
-expx1037 exp 0.0014696 -> 1.001471 Inexact Rounded
-expx1038 exp 9.138494 -> 9306.739 Inexact Rounded
-expx1039 exp 0.0065436 -> 1.006565 Inexact Rounded
-expx1040 exp 0.7284803 -> 2.071930 Inexact Rounded
-
+------------------------------------------------------------------------
+-- exp.decTest -- decimal natural exponentiation --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- Tests of the exponential funtion. Currently all testcases here
+-- show results which are correctly rounded (within <= 0.5 ulp).
+
+extended: 1
+precision: 9
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- basics (examples in specificiation, etc.)
+expx001 exp -Infinity -> 0
+expx002 exp -10 -> 0.0000453999298 Inexact Rounded
+expx003 exp -1 -> 0.367879441 Inexact Rounded
+expx004 exp 0 -> 1
+expx005 exp -0 -> 1
+expx006 exp 1 -> 2.71828183 Inexact Rounded
+expx007 exp 0.693147181 -> 2.00000000 Inexact Rounded
+expx008 exp 10 -> 22026.4658 Inexact Rounded
+expx009 exp +Infinity -> Infinity
+
+-- tiny edge cases
+precision: 7
+expx011 exp 0.1 -> 1.105171 Inexact Rounded
+expx012 exp 0.01 -> 1.010050 Inexact Rounded
+expx013 exp 0.001 -> 1.001001 Inexact Rounded
+expx014 exp 0.0001 -> 1.000100 Inexact Rounded
+expx015 exp 0.00001 -> 1.000010 Inexact Rounded
+expx016 exp 0.000001 -> 1.000001 Inexact Rounded
+expx017 exp 0.0000001 -> 1.000000 Inexact Rounded
+expx018 exp 0.0000003 -> 1.000000 Inexact Rounded
+expx019 exp 0.0000004 -> 1.000000 Inexact Rounded
+expx020 exp 0.0000005 -> 1.000001 Inexact Rounded
+expx021 exp 0.0000008 -> 1.000001 Inexact Rounded
+expx022 exp 0.0000009 -> 1.000001 Inexact Rounded
+expx023 exp 0.0000010 -> 1.000001 Inexact Rounded
+expx024 exp 0.0000011 -> 1.000001 Inexact Rounded
+expx025 exp 0.00000009 -> 1.000000 Inexact Rounded
+expx026 exp 0.00000005 -> 1.000000 Inexact Rounded
+expx027 exp 0.00000004 -> 1.000000 Inexact Rounded
+expx028 exp 0.00000001 -> 1.000000 Inexact Rounded
+
+-- and some more zeros
+expx030 exp 0.00000000 -> 1
+expx031 exp 0E+100 -> 1
+expx032 exp 0E-100 -> 1
+expx033 exp -0.00000000 -> 1
+expx034 exp -0E+100 -> 1
+expx035 exp -0E-100 -> 1
+
+-- basic e=0, e=1, e=2, e=4, e>=8 cases
+precision: 7
+expx041 exp 1 -> 2.718282 Inexact Rounded
+expx042 exp -1 -> 0.3678794 Inexact Rounded
+expx043 exp 10 -> 22026.47 Inexact Rounded
+expx044 exp -10 -> 0.00004539993 Inexact Rounded
+expx045 exp 100 -> 2.688117E+43 Inexact Rounded
+expx046 exp -100 -> 3.720076E-44 Inexact Rounded
+expx047 exp 1000 -> Infinity Overflow Inexact Rounded
+expx048 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx049 exp 100000000 -> Infinity Overflow Inexact Rounded
+expx050 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+
+-- miscellanea
+-- similar to 'VF bug' test, at 17, but with last digit corrected for decimal
+precision: 16
+expx055 exp -5.42410311287441459172E+2 -> 2.717658486884572E-236 Inexact Rounded
+-- result from NetRexx/Java prototype -> 2.7176584868845721117677929628617246054459644711108E-236
+-- result from Rexx (series) version -> 2.717658486884572111767792962861724605446E-236
+precision: 17
+expx056 exp -5.42410311287441459172E+2 -> 2.7176584868845721E-236 Inexact Rounded
+precision: 18
+expx057 exp -5.42410311287441459172E+2 -> 2.71765848688457211E-236 Inexact Rounded
+precision: 19
+expx058 exp -5.42410311287441459172E+2 -> 2.717658486884572112E-236 Inexact Rounded
+precision: 20
+expx059 exp -5.42410311287441459172E+2 -> 2.7176584868845721118E-236 Inexact Rounded
+
+-- rounding in areas of ..500.., ..499.., ..100.., ..999.. sequences
+precision: 50
+expx101 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
+precision: 31
+expx102 exp -9E-8 -> 0.9999999100000040499998785000027 Inexact Rounded
+precision: 30
+expx103 exp -9E-8 -> 0.999999910000004049999878500003 Inexact Rounded
+precision: 29
+expx104 exp -9E-8 -> 0.99999991000000404999987850000 Inexact Rounded
+precision: 28
+expx105 exp -9E-8 -> 0.9999999100000040499998785000 Inexact Rounded
+precision: 27
+expx106 exp -9E-8 -> 0.999999910000004049999878500 Inexact Rounded
+precision: 26
+expx107 exp -9E-8 -> 0.99999991000000404999987850 Inexact Rounded
+precision: 25
+expx108 exp -9E-8 -> 0.9999999100000040499998785 Inexact Rounded
+precision: 24
+expx109 exp -9E-8 -> 0.999999910000004049999879 Inexact Rounded
+precision: 23
+expx110 exp -9E-8 -> 0.99999991000000404999988 Inexact Rounded
+precision: 22
+expx111 exp -9E-8 -> 0.9999999100000040499999 Inexact Rounded
+precision: 21
+expx112 exp -9E-8 -> 0.999999910000004050000 Inexact Rounded
+precision: 20
+expx113 exp -9E-8 -> 0.99999991000000405000 Inexact Rounded
+precision: 19
+expx114 exp -9E-8 -> 0.9999999100000040500 Inexact Rounded
+precision: 18
+expx115 exp -9E-8 -> 0.999999910000004050 Inexact Rounded
+precision: 17
+expx116 exp -9E-8 -> 0.99999991000000405 Inexact Rounded
+precision: 16
+expx117 exp -9E-8 -> 0.9999999100000040 Inexact Rounded
+precision: 15
+expx118 exp -9E-8 -> 0.999999910000004 Inexact Rounded
+precision: 14
+expx119 exp -9E-8 -> 0.99999991000000 Inexact Rounded
+precision: 13
+expx120 exp -9E-8 -> 0.9999999100000 Inexact Rounded
+precision: 12
+expx121 exp -9E-8 -> 0.999999910000 Inexact Rounded
+precision: 11
+expx122 exp -9E-8 -> 0.99999991000 Inexact Rounded
+precision: 10
+expx123 exp -9E-8 -> 0.9999999100 Inexact Rounded
+precision: 9
+expx124 exp -9E-8 -> 0.999999910 Inexact Rounded
+precision: 8
+expx125 exp -9E-8 -> 0.99999991 Inexact Rounded
+precision: 7
+expx126 exp -9E-8 -> 0.9999999 Inexact Rounded
+precision: 6
+expx127 exp -9E-8 -> 1.00000 Inexact Rounded
+precision: 5
+expx128 exp -9E-8 -> 1.0000 Inexact Rounded
+precision: 4
+expx129 exp -9E-8 -> 1.000 Inexact Rounded
+precision: 3
+expx130 exp -9E-8 -> 1.00 Inexact Rounded
+precision: 2
+expx131 exp -9E-8 -> 1.0 Inexact Rounded
+precision: 1
+expx132 exp -9E-8 -> 1 Inexact Rounded
+
+
+-- sanity checks, with iteration counts [normalized so 0<=|x|<1]
+precision: 50
+
+expx210 exp 0 -> 1
+-- iterations: 2
+expx211 exp -1E-40 -> 0.99999999999999999999999999999999999999990000000000 Inexact Rounded
+-- iterations: 8
+expx212 exp -9E-7 -> 0.99999910000040499987850002733749507925073811240510 Inexact Rounded
+-- iterations: 6
+expx213 exp -9E-8 -> 0.99999991000000404999987850000273374995079250073811 Inexact Rounded
+-- iterations: 15
+expx214 exp -0.003 -> 0.99700449550337297601206623409756091074177480489845 Inexact Rounded
+-- iterations: 14
+expx215 exp -0.001 -> 0.99900049983337499166805535716765597470235590236008 Inexact Rounded
+-- iterations: 26
+expx216 exp -0.1 -> 0.90483741803595957316424905944643662119470536098040 Inexact Rounded
+-- iterations: 39
+expx217 exp -0.7 -> 0.49658530379140951470480009339752896170766716571182 Inexact Rounded
+-- iterations: 41
+expx218 exp -0.9 -> 0.40656965974059911188345423964562598783370337617038 Inexact Rounded
+-- iterations: 43
+expx219 exp -0.99 -> 0.37157669102204569053152411990820138691802885490501 Inexact Rounded
+-- iterations: 26
+expx220 exp -1 -> 0.36787944117144232159552377016146086744581113103177 Inexact Rounded
+-- iterations: 26
+expx221 exp -1.01 -> 0.36421897957152331975704629563734548959589139192482 Inexact Rounded
+-- iterations: 27
+expx222 exp -1.1 -> 0.33287108369807955328884690643131552161247952156921 Inexact Rounded
+-- iterations: 28
+expx223 exp -1.5 -> 0.22313016014842982893328047076401252134217162936108 Inexact Rounded
+-- iterations: 30
+expx224 exp -2 -> 0.13533528323661269189399949497248440340763154590958 Inexact Rounded
+-- iterations: 36
+expx225 exp -5 -> 0.0067379469990854670966360484231484242488495850273551 Inexact Rounded
+-- iterations: 26
+expx226 exp -10 -> 0.000045399929762484851535591515560550610237918088866565 Inexact Rounded
+-- iterations: 28
+expx227 exp -14 -> 8.3152871910356788406398514256526229460765836498457E-7 Inexact Rounded
+-- iterations: 29
+expx228 exp -15 -> 3.0590232050182578837147949770228963937082078081856E-7 Inexact Rounded
+-- iterations: 30
+expx233 exp 0 -> 1
+-- iterations: 2
+expx234 exp 1E-40 -> 1.0000000000000000000000000000000000000001000000000 Inexact Rounded
+-- iterations: 7
+expx235 exp 9E-7 -> 1.0000009000004050001215000273375049207507381125949 Inexact Rounded
+-- iterations: 6
+expx236 exp 9E-8 -> 1.0000000900000040500001215000027337500492075007381 Inexact Rounded
+-- iterations: 15
+expx237 exp 0.003 -> 1.0030045045033770260129340913489002053318727195619 Inexact Rounded
+-- iterations: 13
+expx238 exp 0.001 -> 1.0010005001667083416680557539930583115630762005807 Inexact Rounded
+-- iterations: 25
+expx239 exp 0.1 -> 1.1051709180756476248117078264902466682245471947375 Inexact Rounded
+-- iterations: 38
+expx240 exp 0.7 -> 2.0137527074704765216245493885830652700175423941459 Inexact Rounded
+-- iterations: 41
+expx241 exp 0.9 -> 2.4596031111569496638001265636024706954217723064401 Inexact Rounded
+-- iterations: 42
+expx242 exp 0.99 -> 2.6912344723492622890998794040710139721802931841030 Inexact Rounded
+-- iterations: 26
+expx243 exp 1 -> 2.7182818284590452353602874713526624977572470937000 Inexact Rounded
+-- iterations: 26
+expx244 exp 1.01 -> 2.7456010150169164939897763166603876240737508195960 Inexact Rounded
+-- iterations: 26
+expx245 exp 1.1 -> 3.0041660239464331120584079535886723932826810260163 Inexact Rounded
+-- iterations: 28
+expx246 exp 1.5 -> 4.4816890703380648226020554601192758190057498683697 Inexact Rounded
+-- iterations: 29
+expx247 exp 2 -> 7.3890560989306502272304274605750078131803155705518 Inexact Rounded
+-- iterations: 36
+expx248 exp 5 -> 148.41315910257660342111558004055227962348766759388 Inexact Rounded
+-- iterations: 26
+expx249 exp 10 -> 22026.465794806716516957900645284244366353512618557 Inexact Rounded
+-- iterations: 28
+expx250 exp 14 -> 1202604.2841647767777492367707678594494124865433761 Inexact Rounded
+-- iterations: 28
+expx251 exp 15 -> 3269017.3724721106393018550460917213155057385438200 Inexact Rounded
+-- iterations: 29
+
+-- a biggie [result verified 3 ways]
+precision: 250
+expx260 exp 1 -> 2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427427466391932003059921817413596629043572900334295260595630738132328627943490763233829880753195251019011573834187930702154089149934884167509244761460668 Inexact Rounded
+
+-- extreme range boundaries
+precision: 16
+maxExponent: 999999
+minExponent: -999999
+-- Ntiny boundary
+expx290 exp -2302618.022332529 -> 0E-1000014 Underflow Subnormal Inexact Rounded Clamped
+expx291 exp -2302618.022332528 -> 1E-1000014 Underflow Subnormal Inexact Rounded
+-- Nmax/10 and Nmax boundary
+expx292 exp 2302582.790408952 -> 9.999999993100277E+999998 Inexact Rounded
+expx293 exp 2302582.790408953 -> 1.000000000310028E+999999 Inexact Rounded
+expx294 exp 2302585.092993946 -> 9.999999003159870E+999999 Inexact Rounded
+expx295 exp 2302585.092994036 -> 9.999999903159821E+999999 Inexact Rounded
+expx296 exp 2302585.092994045 -> 9.999999993159820E+999999 Inexact Rounded
+expx297 exp 2302585.092994046 -> Infinity Overflow Inexact Rounded
+
+-- 0<-x<<1 effects
+precision: 30
+expx320 exp -4.9999999999999E-8 -> 0.999999950000001250000979166617 Inexact Rounded
+expx321 exp -5.0000000000000E-8 -> 0.999999950000001249999979166667 Inexact Rounded
+expx322 exp -5.0000000000001E-8 -> 0.999999950000001249998979166717 Inexact Rounded
+precision: 20
+expx323 exp -4.9999999999999E-8 -> 0.99999995000000125000 Inexact Rounded
+expx324 exp -5.0000000000000E-8 -> 0.99999995000000125000 Inexact Rounded
+expx325 exp -5.0000000000001E-8 -> 0.99999995000000125000 Inexact Rounded
+precision: 14
+expx326 exp -4.9999999999999E-8 -> 0.99999995000000 Inexact Rounded
+expx327 exp -5.0000000000000E-8 -> 0.99999995000000 Inexact Rounded
+expx328 exp -5.0000000000001E-8 -> 0.99999995000000 Inexact Rounded
+-- overprecise and 0<-x<<1
+precision: 8
+expx330 exp -4.9999999999999E-8 -> 0.99999995 Inexact Rounded
+expx331 exp -5.0000000000000E-8 -> 0.99999995 Inexact Rounded
+expx332 exp -5.0000000000001E-8 -> 0.99999995 Inexact Rounded
+precision: 7
+expx333 exp -4.9999999999999E-8 -> 1.000000 Inexact Rounded
+expx334 exp -5.0000000000000E-8 -> 1.000000 Inexact Rounded
+expx335 exp -5.0000000000001E-8 -> 1.000000 Inexact Rounded
+precision: 3
+expx336 exp -4.9999999999999E-8 -> 1.00 Inexact Rounded
+expx337 exp -5.0000000000000E-8 -> 1.00 Inexact Rounded
+expx338 exp -5.0000000000001E-8 -> 1.00 Inexact Rounded
+
+-- 0<x<<1 effects
+precision: 30
+expx340 exp 4.9999999999999E-8 -> 1.00000005000000124999902083328 Inexact Rounded
+expx341 exp 5.0000000000000E-8 -> 1.00000005000000125000002083333 Inexact Rounded
+expx342 exp 5.0000000000001E-8 -> 1.00000005000000125000102083338 Inexact Rounded
+precision: 20
+expx343 exp 4.9999999999999E-8 -> 1.0000000500000012500 Inexact Rounded
+expx344 exp 5.0000000000000E-8 -> 1.0000000500000012500 Inexact Rounded
+expx345 exp 5.0000000000001E-8 -> 1.0000000500000012500 Inexact Rounded
+precision: 14
+expx346 exp 4.9999999999999E-8 -> 1.0000000500000 Inexact Rounded
+expx347 exp 5.0000000000000E-8 -> 1.0000000500000 Inexact Rounded
+expx348 exp 5.0000000000001E-8 -> 1.0000000500000 Inexact Rounded
+-- overprecise and 0<x<<1
+precision: 8
+expx350 exp 4.9999999999999E-8 -> 1.0000001 Inexact Rounded
+expx351 exp 5.0000000000000E-8 -> 1.0000001 Inexact Rounded
+expx352 exp 5.0000000000001E-8 -> 1.0000001 Inexact Rounded
+precision: 7
+expx353 exp 4.9999999999999E-8 -> 1.000000 Inexact Rounded
+expx354 exp 5.0000000000000E-8 -> 1.000000 Inexact Rounded
+expx355 exp 5.0000000000001E-8 -> 1.000000 Inexact Rounded
+precision: 3
+expx356 exp 4.9999999999999E-8 -> 1.00 Inexact Rounded
+expx357 exp 5.0000000000000E-8 -> 1.00 Inexact Rounded
+expx358 exp 5.0000000000001E-8 -> 1.00 Inexact Rounded
+
+-- cases near 1 -- 1 2345678901234567890
+precision: 20
+expx401 exp 0.99999999999996 -> 2.7182818284589365041 Inexact Rounded
+expx402 exp 0.99999999999997 -> 2.7182818284589636869 Inexact Rounded
+expx403 exp 0.99999999999998 -> 2.7182818284589908697 Inexact Rounded
+expx404 exp 0.99999999999999 -> 2.7182818284590180525 Inexact Rounded
+expx405 exp 1.0000000000000 -> 2.7182818284590452354 Inexact Rounded
+expx406 exp 1.0000000000001 -> 2.7182818284593170635 Inexact Rounded
+expx407 exp 1.0000000000002 -> 2.7182818284595888917 Inexact Rounded
+precision: 14
+expx411 exp 0.99999999999996 -> 2.7182818284589 Inexact Rounded
+expx412 exp 0.99999999999997 -> 2.7182818284590 Inexact Rounded
+expx413 exp 0.99999999999998 -> 2.7182818284590 Inexact Rounded
+expx414 exp 0.99999999999999 -> 2.7182818284590 Inexact Rounded
+expx415 exp 1.0000000000000 -> 2.7182818284590 Inexact Rounded
+expx416 exp 1.0000000000001 -> 2.7182818284593 Inexact Rounded
+expx417 exp 1.0000000000002 -> 2.7182818284596 Inexact Rounded
+-- overprecise...
+precision: 7
+expx421 exp 0.99999999999996 -> 2.718282 Inexact Rounded
+expx422 exp 0.99999999999997 -> 2.718282 Inexact Rounded
+expx423 exp 0.99999999999998 -> 2.718282 Inexact Rounded
+expx424 exp 0.99999999999999 -> 2.718282 Inexact Rounded
+expx425 exp 1.0000000000001 -> 2.718282 Inexact Rounded
+expx426 exp 1.0000000000002 -> 2.718282 Inexact Rounded
+expx427 exp 1.0000000000003 -> 2.718282 Inexact Rounded
+precision: 2
+expx431 exp 0.99999999999996 -> 2.7 Inexact Rounded
+expx432 exp 0.99999999999997 -> 2.7 Inexact Rounded
+expx433 exp 0.99999999999998 -> 2.7 Inexact Rounded
+expx434 exp 0.99999999999999 -> 2.7 Inexact Rounded
+expx435 exp 1.0000000000001 -> 2.7 Inexact Rounded
+expx436 exp 1.0000000000002 -> 2.7 Inexact Rounded
+expx437 exp 1.0000000000003 -> 2.7 Inexact Rounded
+
+-- basics at low precisions
+precision: 3
+expx501 exp -Infinity -> 0
+expx502 exp -10 -> 0.0000454 Inexact Rounded
+expx503 exp -1 -> 0.368 Inexact Rounded
+expx504 exp 0 -> 1
+expx505 exp -0 -> 1
+expx506 exp 1 -> 2.72 Inexact Rounded
+expx507 exp 0.693147181 -> 2.00 Inexact Rounded
+expx508 exp 10 -> 2.20E+4 Inexact Rounded
+expx509 exp +Infinity -> Infinity
+precision: 2
+expx511 exp -Infinity -> 0
+expx512 exp -10 -> 0.000045 Inexact Rounded
+expx513 exp -1 -> 0.37 Inexact Rounded
+expx514 exp 0 -> 1
+expx515 exp -0 -> 1
+expx516 exp 1 -> 2.7 Inexact Rounded
+expx517 exp 0.693147181 -> 2.0 Inexact Rounded
+expx518 exp 10 -> 2.2E+4 Inexact Rounded
+expx519 exp +Infinity -> Infinity
+precision: 1
+expx521 exp -Infinity -> 0
+expx522 exp -10 -> 0.00005 Inexact Rounded
+expx523 exp -1 -> 0.4 Inexact Rounded
+expx524 exp 0 -> 1
+expx525 exp -0 -> 1
+expx526 exp 1 -> 3 Inexact Rounded
+expx527 exp 0.693147181 -> 2 Inexact Rounded
+expx528 exp 10 -> 2E+4 Inexact Rounded
+expx529 exp +Infinity -> Infinity
+
+-- overflows, including some overprecise borderlines
+precision: 7
+maxExponent: 384
+minExponent: -383
+expx701 exp 1000000000 -> Infinity Overflow Inexact Rounded
+expx702 exp 100000000 -> Infinity Overflow Inexact Rounded
+expx703 exp 10000000 -> Infinity Overflow Inexact Rounded
+expx704 exp 1000000 -> Infinity Overflow Inexact Rounded
+expx705 exp 100000 -> Infinity Overflow Inexact Rounded
+expx706 exp 10000 -> Infinity Overflow Inexact Rounded
+expx707 exp 1000 -> Infinity Overflow Inexact Rounded
+expx708 exp 886.4952608 -> Infinity Overflow Inexact Rounded
+expx709 exp 886.4952607 -> 9.999999E+384 Inexact Rounded
+expx710 exp 886.49527 -> Infinity Overflow Inexact Rounded
+expx711 exp 886.49526 -> 9.999992E+384 Inexact Rounded
+precision: 16
+expx721 exp 886.4952608027075883 -> Infinity Overflow Inexact Rounded
+expx722 exp 886.4952608027075882 -> 9.999999999999999E+384 Inexact Rounded
+expx723 exp 886.49526080270759 -> Infinity Overflow Inexact Rounded
+expx724 exp 886.49526080270758 -> 9.999999999999917E+384 Inexact Rounded
+expx725 exp 886.4952608027076 -> Infinity Overflow Inexact Rounded
+expx726 exp 886.4952608027075 -> 9.999999999999117E+384 Inexact Rounded
+-- and by special request ...
+precision: 15
+expx731 exp 886.495260802708 -> Infinity Overflow Inexact Rounded
+expx732 exp 886.495260802707 -> 9.99999999999412E+384 Inexact Rounded
+expx733 exp 886.495260802706 -> 9.99999999998412E+384 Inexact Rounded
+maxExponent: 999
+minExponent: -999
+expx735 exp 2302.58509299405 -> Infinity Overflow Inexact Rounded
+expx736 exp 2302.58509299404 -> 9.99999999994316E+999 Inexact Rounded
+expx737 exp 2302.58509299403 -> 9.99999999984316E+999 Inexact Rounded
+
+-- subnormals and underflows, including underflow-to-zero edge point
+precision: 7
+maxExponent: 384
+minExponent: -383
+expx751 exp -1000000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx752 exp -100000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx753 exp -10000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx754 exp -1000000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx755 exp -100000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx756 exp -10000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx757 exp -1000 -> 0E-389 Underflow Inexact Rounded Clamped Subnormal
+expx758 exp -881.89009 -> 1.000001E-383 Inexact Rounded
+expx759 exp -881.8901 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
+expx760 exp -885 -> 4.4605E-385 Inexact Rounded Underflow Subnormal
+expx761 exp -888 -> 2.221E-386 Inexact Rounded Underflow Subnormal
+expx762 exp -890 -> 3.01E-387 Inexact Rounded Underflow Subnormal
+expx763 exp -892.9 -> 1.7E-388 Inexact Rounded Underflow Subnormal
+expx764 exp -893 -> 1.5E-388 Inexact Rounded Underflow Subnormal
+expx765 exp -893.5 -> 9E-389 Inexact Rounded Underflow Subnormal
+expx766 exp -895.7056 -> 1E-389 Inexact Rounded Underflow Subnormal
+expx769 exp -895.8 -> 1E-389 Inexact Rounded Underflow Subnormal
+expx770 exp -895.73 -> 1E-389 Inexact Rounded Underflow Subnormal
+expx771 exp -896.3987 -> 1E-389 Inexact Rounded Underflow Subnormal
+expx772 exp -896.3988 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
+expx773 exp -898.0081 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
+expx774 exp -898.0082 -> 0E-389 Inexact Rounded Underflow Subnormal Clamped
+
+-- special values
+maxexponent: 999
+minexponent: -999
+expx820 exp Inf -> Infinity
+expx821 exp -Inf -> 0
+expx822 exp NaN -> NaN
+expx823 exp sNaN -> NaN Invalid_operation
+-- propagating NaNs
+expx824 exp sNaN123 -> NaN123 Invalid_operation
+expx825 exp -sNaN321 -> -NaN321 Invalid_operation
+expx826 exp NaN456 -> NaN456
+expx827 exp -NaN654 -> -NaN654
+expx828 exp NaN1 -> NaN1
+
+-- Invalid operations due to restrictions
+-- [next two probably skipped by most test harnesses]
+precision: 100000000
+expx901 exp -Infinity -> NaN Invalid_context
+precision: 99999999
+expx902 exp -Infinity -> NaN Invalid_context
+
+precision: 9
+maxExponent: 1000000
+minExponent: -999999
+expx903 exp -Infinity -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999999
+expx904 exp -Infinity -> 0
+maxExponent: 999999
+minExponent: -1000000
+expx905 exp -Infinity -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999998
+expx906 exp -Infinity -> 0
+
+--
+maxExponent: 384
+minExponent: -383
+precision: 16
+rounding: half_even
+
+-- Null test
+expx900 exp # -> NaN Invalid_operation
+
+
+-- Randoms P=50, within 0-999
+Precision: 50
+maxExponent: 384
+minExponent: -383
+expx1501 exp 656.35397950590285612266095596539934213943872885728 -> 1.1243757610640319783611178528839652672062820040314E+285 Inexact Rounded
+expx1502 exp 0.93620571093652800225038550600780322831236082781471 -> 2.5502865130986176689199711857825771311178046842009 Inexact Rounded
+expx1503 exp 0.00000000000000008340785856601514714183373874105791 -> 1.0000000000000000834078585660151506202691740252512 Inexact Rounded
+expx1504 exp 0.00009174057262887789625745574686545163168788456203 -> 1.0000917447809239005146722341251524081006051473273 Inexact Rounded
+expx1505 exp 33.909116897973797735657751591014926629051117541243 -> 532773181025002.03543618901306726495870476617232229 Inexact Rounded
+expx1506 exp 0.00000740470413004406592124575295278456936809587311 -> 1.0000074047315449333590066395670306135567889210814 Inexact Rounded
+expx1507 exp 0.00000000000124854922222108802453746922483071445492 -> 1.0000000000012485492222218674621176239911424968263 Inexact Rounded
+expx1508 exp 4.1793280674155659794286951159430651258356014391382 -> 65.321946520147199404199787811336860087975118278185 Inexact Rounded
+expx1509 exp 485.43595745460655893746179890255529919221550201686 -> 6.6398403920459617255950476953129377459845366585463E+210 Inexact Rounded
+expx1510 exp 0.00000000003547259806590856032527875157830328156597 -> 1.0000000000354725980665377129320589406715000685515 Inexact Rounded
+expx1511 exp 0.00000000000000759621497339104047930616478635042678 -> 1.0000000000000075962149733910693305471257715463887 Inexact Rounded
+expx1512 exp 9.7959168821760339304571595474480640286072720233796 -> 17960.261146042955179164303653412650751681436352437 Inexact Rounded
+expx1513 exp 0.00000000566642006258290526783901451194943164535581 -> 1.0000000056664200786370634609832438815665249347650 Inexact Rounded
+expx1514 exp 741.29888791134298194088827572374718940925820027354 -> 8.7501694006317332808128946666402622432064923198731E+321 Inexact Rounded
+expx1515 exp 032.75573003552517668808529099897153710887014947935 -> 168125196578678.17725841108617955904425345631092339 Inexact Rounded
+expx1516 exp 42.333700726429333308594265553422902463737399437644 -> 2428245675864172475.4681119493045657797309369672012 Inexact Rounded
+expx1517 exp 0.00000000000000559682616876491888197609158802835798 -> 1.0000000000000055968261687649345442076732739577049 Inexact Rounded
+expx1518 exp 0.00000000000080703688668280193584758300973549486312 -> 1.0000000000008070368866831275901158164321867914342 Inexact Rounded
+expx1519 exp 640.72396012796509482382712891709072570653606838251 -> 1.8318094990683394229304133068983914236995326891045E+278 Inexact Rounded
+expx1520 exp 0.00000000000000509458922167631071416948112219512224 -> 1.0000000000000050945892216763236915891499324358556 Inexact Rounded
+expx1521 exp 6.7670394314315206378625221583973414660727960241395 -> 868.73613012822031367806248697092884415119568271315 Inexact Rounded
+expx1522 exp 04.823217407412963506638267226891024138054783122548 -> 124.36457929588837129731821077586705505565904205366 Inexact Rounded
+expx1523 exp 193.51307878701196403991208482520115359690106143615 -> 1.1006830872854715677390914655452261550768957576034E+84 Inexact Rounded
+expx1524 exp 5.7307749038303650539200345901210497015617393970463 -> 308.20800743106843083522721523715645950574866495196 Inexact Rounded
+expx1525 exp 0.00000000000095217825199797965200541169123743500267 -> 1.0000000000009521782519984329737172007991390381273 Inexact Rounded
+expx1526 exp 0.00027131440949183370966393682617930153495028919140 -> 1.0002713512185751022906058160480606598754913607364 Inexact Rounded
+expx1527 exp 0.00000000064503059114680682343002315662069272707123 -> 1.0000000006450305913548390552323517403613135496633 Inexact Rounded
+expx1528 exp 0.00000000000000095616643506527288866235238548440593 -> 1.0000000000000009561664350652733457894781582009094 Inexact Rounded
+expx1529 exp 0.00000000000000086449942811678650244459550252743433 -> 1.0000000000000008644994281167868761242261096529986 Inexact Rounded
+expx1530 exp 0.06223488355635359965683053157729204988381887621850 -> 1.0642122813392406657789688931838919323826250630831 Inexact Rounded
+expx1531 exp 0.00000400710807804429435502657131912308680674057053 -> 1.0000040071161065125925620890019319832127863559260 Inexact Rounded
+expx1532 exp 85.522796894744576211573232055494551429297878413017 -> 13870073686404228452757799770251085177.853337368935 Inexact Rounded
+expx1533 exp 9.1496720811363678696938036379756663548353399954363 -> 9411.3537122832743386783597629161763057370034495157 Inexact Rounded
+expx1534 exp 8.2215705240788294472944382056330516738577785177942 -> 3720.3406813383076953899654701615084425598377758189 Inexact Rounded
+expx1535 exp 0.00000000015772064569640613142823203726821076239561 -> 1.0000000001577206457088440324683315788358926129830 Inexact Rounded
+expx1536 exp 0.58179346473959531432624153576883440625538017532480 -> 1.7892445018275360163797022372655837188423194863605 Inexact Rounded
+expx1537 exp 33.555726197149525061455517784870570470833498096559 -> 374168069896324.62578073148993526626307095854407952 Inexact Rounded
+expx1538 exp 9.7898079803906215094140010009583375537259810398659 -> 17850.878119912208888217100998019986634620368538426 Inexact Rounded
+expx1539 exp 89.157697327174521542502447953032536541038636966347 -> 525649152320166503771224149330448089550.67293829227 Inexact Rounded
+expx1540 exp 25.022947600123328912029051897171319573322888514885 -> 73676343442.952517824345431437683153304645851960524 Inexact Rounded
+
+-- exp(1) at 34
+Precision: 34
+expx1200 exp 1 -> 2.718281828459045235360287471352662 Inexact Rounded
+
+-- Randoms P=34, within 0-999
+Precision: 34
+maxExponent: 6144
+minExponent: -6143
+expx1201 exp 309.5948855821510212996700645087188 -> 2.853319692901387521201738015050724E+134 Inexact Rounded
+expx1202 exp 9.936543068706211420422803962680164 -> 20672.15839203171877476511093276022 Inexact Rounded
+expx1203 exp 6.307870323881505684429839491707908 -> 548.8747777054637296137277391754665 Inexact Rounded
+expx1204 exp 0.0003543281389438420535201308282503 -> 1.000354390920573746164733350843155 Inexact Rounded
+expx1205 exp 0.0000037087453363918375598394920229 -> 1.000003708752213796324841920189323 Inexact Rounded
+expx1206 exp 0.0020432312687512438040222444116585 -> 1.002045320088164826013561630975308 Inexact Rounded
+expx1207 exp 6.856313340032177672550343216129586 -> 949.8587981604144147983589660524396 Inexact Rounded
+expx1208 exp 0.0000000000402094928333815643326418 -> 1.000000000040209492834189965989612 Inexact Rounded
+expx1209 exp 0.0049610784722412117632647003545839 -> 1.004973404997901987039589029277833 Inexact Rounded
+expx1210 exp 0.0000891471883724066909746786702686 -> 1.000089151162101085412780088266699 Inexact Rounded
+expx1211 exp 08.59979170376061890684723211112566 -> 5430.528314920905714615339273738097 Inexact Rounded
+expx1212 exp 9.473117039341003854872778112752590 -> 13005.36234331224953460055897913917 Inexact Rounded
+expx1213 exp 0.0999060724692207648429969999310118 -> 1.105067116975190602296052700726802 Inexact Rounded
+expx1214 exp 0.0000000927804533555877884082269247 -> 1.000000092780457659694183954740772 Inexact Rounded
+expx1215 exp 0.0376578583872889916298772818265677 -> 1.038375900489771946477857818447556 Inexact Rounded
+expx1216 exp 261.6896411697539524911536116712307 -> 4.470613562127465095241600174941460E+113 Inexact Rounded
+expx1217 exp 0.0709997423269162980875824213889626 -> 1.073580949235407949417814485533172 Inexact Rounded
+expx1218 exp 0.0000000444605583295169895235658731 -> 1.000000044460559317887627657593900 Inexact Rounded
+expx1219 exp 0.0000021224072854777512281369815185 -> 1.000002122409537785687390631070906 Inexact Rounded
+expx1220 exp 547.5174462574156885473558485475052 -> 6.078629247383807942612114579728672E+237 Inexact Rounded
+expx1221 exp 0.0000009067598041615192002339844670 -> 1.000000906760215268314680115374387 Inexact Rounded
+expx1222 exp 0.0316476500308065365803455533244603 -> 1.032153761880187977658387961769034 Inexact Rounded
+expx1223 exp 84.46160530377645101833996706384473 -> 4.799644995897968383503269871697856E+36 Inexact Rounded
+expx1224 exp 0.0000000000520599740290848018904145 -> 1.000000000052059974030439922338393 Inexact Rounded
+expx1225 exp 0.0000006748530640093620665651726708 -> 1.000000674853291722742292331812997 Inexact Rounded
+expx1226 exp 0.0000000116853119761042020507916169 -> 1.000000011685312044377460306165203 Inexact Rounded
+expx1227 exp 0.0022593818094258636727616886693280 -> 1.002261936135876893707094845543461 Inexact Rounded
+expx1228 exp 0.0029398857673478912249856509667517 -> 1.002944211469495086813087651287012 Inexact Rounded
+expx1229 exp 0.7511480029928802775376270557636963 -> 2.119431734510320169806976569366789 Inexact Rounded
+expx1230 exp 174.9431952176750671150886423048447 -> 9.481222305374955011464619468044051E+75 Inexact Rounded
+expx1231 exp 0.0000810612451694136129199895164424 -> 1.000081064530720924186615149646920 Inexact Rounded
+expx1232 exp 51.06888989702669288180946272499035 -> 15098613888619165073959.89896018749 Inexact Rounded
+expx1233 exp 0.0000000005992887599437093651494510 -> 1.000000000599288760123282874082758 Inexact Rounded
+expx1234 exp 714.8549046761054856311108828903972 -> 2.867744544891081117381595080480784E+310 Inexact Rounded
+expx1235 exp 0.0000000004468247802990643645607110 -> 1.000000000446824780398890556720233 Inexact Rounded
+expx1236 exp 831.5818151589890366323551672043709 -> 1.417077409182624969435938062261655E+361 Inexact Rounded
+expx1237 exp 0.0000000006868323825179605747108044 -> 1.000000000686832382753829935602454 Inexact Rounded
+expx1238 exp 0.0000001306740266408976840228440255 -> 1.000000130674035178748675187648098 Inexact Rounded
+expx1239 exp 0.3182210609022267704811502412335163 -> 1.374680115667798185758927247894859 Inexact Rounded
+expx1240 exp 0.0147741234179104437440264644295501 -> 1.014883800239950682628277534839222 Inexact Rounded
+
+-- Randoms P=16, within 0-99
+Precision: 16
+maxExponent: 384
+minExponent: -383
+expx1101 exp 8.473011527013724 -> 4783.900643969246 Inexact Rounded
+expx1102 exp 0.0000055753022764 -> 1.000005575317818 Inexact Rounded
+expx1103 exp 0.0000323474114482 -> 1.000032347934631 Inexact Rounded
+expx1104 exp 64.54374138544166 -> 1.073966476173531E+28 Inexact Rounded
+expx1105 exp 90.47203246416569 -> 1.956610887250643E+39 Inexact Rounded
+expx1106 exp 9.299931532342757 -> 10937.27033325227 Inexact Rounded
+expx1107 exp 8.759678437852203 -> 6372.062234495381 Inexact Rounded
+expx1108 exp 0.0000931755127172 -> 1.000093179853690 Inexact Rounded
+expx1109 exp 0.0000028101158373 -> 1.000002810119786 Inexact Rounded
+expx1110 exp 0.0000008008130919 -> 1.000000800813413 Inexact Rounded
+expx1111 exp 8.339771722299049 -> 4187.133803081878 Inexact Rounded
+expx1112 exp 0.0026140497995474 -> 1.002617469406750 Inexact Rounded
+expx1113 exp 0.7478033356261771 -> 2.112354781975418 Inexact Rounded
+expx1114 exp 51.77663761827966 -> 3.064135801120365E+22 Inexact Rounded
+expx1115 exp 0.1524989783061012 -> 1.164741272084955 Inexact Rounded
+expx1116 exp 0.0066298798669219 -> 1.006651906170791 Inexact Rounded
+expx1117 exp 9.955141865534960 -> 21060.23334287038 Inexact Rounded
+expx1118 exp 92.34503059198483 -> 1.273318993481226E+40 Inexact Rounded
+expx1119 exp 0.0000709388677346 -> 1.000070941383956 Inexact Rounded
+expx1120 exp 79.12883036433204 -> 2.318538899389243E+34 Inexact Rounded
+expx1121 exp 0.0000090881548873 -> 1.000009088196185 Inexact Rounded
+expx1122 exp 0.0424828809603411 -> 1.043398194245720 Inexact Rounded
+expx1123 exp 0.8009035891427416 -> 2.227552811933310 Inexact Rounded
+expx1124 exp 8.825786167283102 -> 6807.540455289995 Inexact Rounded
+expx1125 exp 1.535457249746275 -> 4.643448260146849 Inexact Rounded
+expx1126 exp 69.02254254355800 -> 9.464754500670653E+29 Inexact Rounded
+expx1127 exp 0.0007050554368713 -> 1.000705304046880 Inexact Rounded
+expx1128 exp 0.0000081206549504 -> 1.000008120687923 Inexact Rounded
+expx1129 exp 0.621774854641137 -> 1.862230298554903 Inexact Rounded
+expx1130 exp 3.847629031404354 -> 46.88177613568203 Inexact Rounded
+expx1131 exp 24.81250184697732 -> 59694268456.19966 Inexact Rounded
+expx1132 exp 5.107546500516044 -> 165.2643809755670 Inexact Rounded
+expx1133 exp 79.17810943951986 -> 2.435656372541360E+34 Inexact Rounded
+expx1134 exp 0.0051394695667015 -> 1.005152699295301 Inexact Rounded
+expx1135 exp 57.44504488501725 -> 8.872908566929688E+24 Inexact Rounded
+expx1136 exp 0.0000508388968036 -> 1.000050840189122 Inexact Rounded
+expx1137 exp 69.71309932148997 -> 1.888053740693541E+30 Inexact Rounded
+expx1138 exp 0.0064183412981502 -> 1.006438982988835 Inexact Rounded
+expx1139 exp 9.346991220814677 -> 11464.27802035082 Inexact Rounded
+expx1140 exp 33.09087139999152 -> 235062229168763.5 Inexact Rounded
+
+-- Randoms P=7, within 0-9
+Precision: 7
+maxExponent: 96
+minExponent: -95
+expx1001 exp 2.395441 -> 10.97304 Inexact Rounded
+expx1002 exp 0.6406779 -> 1.897767 Inexact Rounded
+expx1003 exp 0.5618218 -> 1.753865 Inexact Rounded
+expx1004 exp 3.055120 -> 21.22373 Inexact Rounded
+expx1005 exp 1.536792 -> 4.649650 Inexact Rounded
+expx1006 exp 0.0801591 -> 1.083459 Inexact Rounded
+expx1007 exp 0.0966875 -> 1.101516 Inexact Rounded
+expx1008 exp 0.0646761 -> 1.066813 Inexact Rounded
+expx1009 exp 0.0095670 -> 1.009613 Inexact Rounded
+expx1010 exp 2.956859 -> 19.23745 Inexact Rounded
+expx1011 exp 7.504679 -> 1816.522 Inexact Rounded
+expx1012 exp 0.0045259 -> 1.004536 Inexact Rounded
+expx1013 exp 3.810071 -> 45.15364 Inexact Rounded
+expx1014 exp 1.502390 -> 4.492413 Inexact Rounded
+expx1015 exp 0.0321523 -> 1.032675 Inexact Rounded
+expx1016 exp 0.0057214 -> 1.005738 Inexact Rounded
+expx1017 exp 9.811445 -> 18241.33 Inexact Rounded
+expx1018 exp 3.245249 -> 25.66810 Inexact Rounded
+expx1019 exp 0.3189742 -> 1.375716 Inexact Rounded
+expx1020 exp 0.8621610 -> 2.368273 Inexact Rounded
+expx1021 exp 0.0122511 -> 1.012326 Inexact Rounded
+expx1022 exp 2.202088 -> 9.043877 Inexact Rounded
+expx1023 exp 8.778203 -> 6491.202 Inexact Rounded
+expx1024 exp 0.1896279 -> 1.208800 Inexact Rounded
+expx1025 exp 0.4510947 -> 1.570030 Inexact Rounded
+expx1026 exp 0.276413 -> 1.318392 Inexact Rounded
+expx1027 exp 4.490067 -> 89.12742 Inexact Rounded
+expx1028 exp 0.0439786 -> 1.044960 Inexact Rounded
+expx1029 exp 0.8168245 -> 2.263301 Inexact Rounded
+expx1030 exp 0.0391658 -> 1.039943 Inexact Rounded
+expx1031 exp 9.261816 -> 10528.24 Inexact Rounded
+expx1032 exp 9.611186 -> 14930.87 Inexact Rounded
+expx1033 exp 9.118125 -> 9119.087 Inexact Rounded
+expx1034 exp 9.469083 -> 12953.00 Inexact Rounded
+expx1035 exp 0.0499983 -> 1.051269 Inexact Rounded
+expx1036 exp 0.0050746 -> 1.005087 Inexact Rounded
+expx1037 exp 0.0014696 -> 1.001471 Inexact Rounded
+expx1038 exp 9.138494 -> 9306.739 Inexact Rounded
+expx1039 exp 0.0065436 -> 1.006565 Inexact Rounded
+expx1040 exp 0.7284803 -> 2.071930 Inexact Rounded
+
diff --git a/Lib/test/decimaltestdata/extra.decTest b/Lib/test/decimaltestdata/extra.decTest
index fce8435599..fe8b77a6dd 100644
--- a/Lib/test/decimaltestdata/extra.decTest
+++ b/Lib/test/decimaltestdata/extra.decTest
@@ -2745,3 +2745,73 @@ pwmx437 power 17 1728 1729 -> 1
pwmx438 power 18 1728 1729 -> 1
pwmx439 power 19 1728 1729 -> 456
pwmx440 power 20 1728 1729 -> 1
+
+-- plus and minus zero in various rounding modes (see issue 11131)
+extended: 1
+precision: 9
+maxexponent: 384
+minexponent: -383
+
+rounding: half_even
+plux1000 plus 0.0 -> 0.0
+plux1001 plus -0.0 -> 0.0
+minx1000 minus 0.0 -> 0.0
+minx1001 minus -0.0 -> 0.0
+absx1000 abs 0.0 -> 0.0
+absx1001 abs -0.0 -> 0.0
+
+rounding: half_up
+plux1010 plus 0.0 -> 0.0
+minx1010 minus 0.0 -> 0.0
+plux1011 plus -0.0 -> 0.0
+minx1011 minus -0.0 -> 0.0
+absx1010 abs 0.0 -> 0.0
+absx1011 abs -0.0 -> 0.0
+
+rounding: ceiling
+plux1020 plus 0.0 -> 0.0
+minx1020 minus 0.0 -> 0.0
+plux1021 plus -0.0 -> 0.0
+minx1021 minus -0.0 -> 0.0
+absx1020 abs 0.0 -> 0.0
+absx1021 abs -0.0 -> 0.0
+
+rounding: floor
+plux1030 plus 0.0 -> 0.0
+minx1030 minus 0.0 -> -0.0
+plux1031 plus -0.0 -> -0.0
+minx1031 minus -0.0 -> 0.0
+absx1030 abs 0.0 -> 0.0
+absx1031 abs -0.0 -> 0.0
+
+rounding: down
+plux1040 plus 0.0 -> 0.0
+minx1040 minus 0.0 -> 0.0
+plux1041 plus -0.0 -> 0.0
+minx1041 minus -0.0 -> 0.0
+absx1040 abs 0.0 -> 0.0
+absx1041 abs -0.0 -> 0.0
+
+rounding: up
+plux1050 plus 0.0 -> 0.0
+minx1050 minus 0.0 -> 0.0
+plux1051 plus -0.0 -> 0.0
+minx1051 minus -0.0 -> 0.0
+absx1050 abs 0.0 -> 0.0
+absx1051 abs -0.0 -> 0.0
+
+rounding: half_down
+plux1060 plus 0.0 -> 0.0
+minx1060 minus 0.0 -> 0.0
+plux1061 plus -0.0 -> 0.0
+minx1061 minus -0.0 -> 0.0
+absx1060 abs 0.0 -> 0.0
+absx1061 abs -0.0 -> 0.0
+
+rounding: 05up
+plux1070 plus 0.0 -> 0.0
+minx1070 minus 0.0 -> 0.0
+plux1071 plus -0.0 -> 0.0
+minx1071 minus -0.0 -> 0.0
+absx1070 abs 0.0 -> 0.0
+absx1071 abs -0.0 -> 0.0
diff --git a/Lib/test/decimaltestdata/fma.decTest b/Lib/test/decimaltestdata/fma.decTest
index b0a81ca179..a8197ef8a4 100644
--- a/Lib/test/decimaltestdata/fma.decTest
+++ b/Lib/test/decimaltestdata/fma.decTest
@@ -1,3426 +1,3426 @@
-------------------------------------------------------------------------
--- fma.decTest -- decimal fused multiply add --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- These tests comprese three parts:
--- 1. Sanity checks and other three-operand tests (especially those
--- where the fused operation makes a difference)
--- 2. Multiply tests (third operand is neutral zero [0E+emax])
--- 3. Addition tests (first operand is 1)
--- The multiply and addition tests are extensive because FMA may have
--- its own dedicated multiplication or addition routine(s), and they
--- also inherently check the left-to-right properties.
-
--- Sanity checks
-fmax0001 fma 1 1 1 -> 2
-fmax0002 fma 1 1 2 -> 3
-fmax0003 fma 2 2 3 -> 7
-fmax0004 fma 9 9 9 -> 90
-fmax0005 fma -1 1 1 -> 0
-fmax0006 fma -1 1 2 -> 1
-fmax0007 fma -2 2 3 -> -1
-fmax0008 fma -9 9 9 -> -72
-fmax0011 fma 1 -1 1 -> 0
-fmax0012 fma 1 -1 2 -> 1
-fmax0013 fma 2 -2 3 -> -1
-fmax0014 fma 9 -9 9 -> -72
-fmax0015 fma 1 1 -1 -> 0
-fmax0016 fma 1 1 -2 -> -1
-fmax0017 fma 2 2 -3 -> 1
-fmax0018 fma 9 9 -9 -> 72
-fmax0019 fma 3 5 7 -> 22
-fmax0029 fma 3 -5 7 -> -8
-
--- non-integer exacts
-fma0100 fma 25.2 63.6 -438 -> 1164.72
-fma0101 fma 0.301 0.380 334 -> 334.114380
-fma0102 fma 49.2 -4.8 23.3 -> -212.86
-fma0103 fma 4.22 0.079 -94.6 -> -94.26662
-fma0104 fma 903 0.797 0.887 -> 720.578
-fma0105 fma 6.13 -161 65.9 -> -921.03
-fma0106 fma 28.2 727 5.45 -> 20506.85
-fma0107 fma 4 605 688 -> 3108
-fma0108 fma 93.3 0.19 0.226 -> 17.953
-fma0109 fma 0.169 -341 5.61 -> -52.019
-fma0110 fma -72.2 30 -51.2 -> -2217.2
-fma0111 fma -0.409 13 20.4 -> 15.083
-fma0112 fma 317 77.0 19.0 -> 24428.0
-fma0113 fma 47 6.58 1.62 -> 310.88
-fma0114 fma 1.36 0.984 0.493 -> 1.83124
-fma0115 fma 72.7 274 1.56 -> 19921.36
-fma0116 fma 335 847 83 -> 283828
-fma0117 fma 666 0.247 25.4 -> 189.902
-fma0118 fma -3.87 3.06 78.0 -> 66.1578
-fma0119 fma 0.742 192 35.6 -> 178.064
-fma0120 fma -91.6 5.29 0.153 -> -484.411
-
--- cases where result is different from separate multiply + add; each
--- is preceded by the result of unfused multiply and add
--- [this is about 20% of all similar cases in general]
--- 888565290 1557.96930 -86087.7578 -> 1.38435735E+12
-fma0201 fma 888565290 1557.96930 -86087.7578 -> 1.38435736E+12 Inexact Rounded
--- -85519342.9 735155419 42010431 -> -6.28700084E+16
-fma0205 fma -85519342.9 735155419 42010431 -> -6.28700083E+16 Inexact Rounded
--- -98025.5 -294603.472 10414348.2 -> 2.88890669E+10
-fma0208 fma -98025.5 -294603.472 10414348.2 -> 2.88890670E+10 Inexact Rounded
--- 5967627.39 83526540.6 498494.810 -> 4.98455271E+14
-fma0211 fma 5967627.39 83526540.6 498494.810 -> 4.98455272E+14 Inexact Rounded
--- 3456.9433 874.39518 197866.615 -> 3220601.18
-fma0216 fma 3456.9433 874.39518 197866.615 -> 3220601.17 Inexact Rounded
--- 62769.8287 2096.98927 48.420317 -> 131627705
-fma0218 fma 62769.8287 2096.98927 48.420317 -> 131627706 Inexact Rounded
--- -68.81500 59961113.9 -8988862 -> -4.13521291E+9
-fma0219 fma -68.81500 59961113.9 -8988862 -> -4.13521292E+9 Inexact Rounded
--- 2126341.02 63491.5152 302427455 -> 1.35307040E+11
-fma0226 fma 2126341.02 63491.5152 302427455 -> 1.35307041E+11 Inexact Rounded
-
-
--- Infinite combinations
-fmax0800 fma Inf Inf Inf -> Infinity
-fmax0801 fma Inf Inf -Inf -> NaN Invalid_operation
-fmax0802 fma Inf -Inf Inf -> NaN Invalid_operation
-fmax0803 fma Inf -Inf -Inf -> -Infinity
-fmax0804 fma -Inf Inf Inf -> NaN Invalid_operation
-fmax0805 fma -Inf Inf -Inf -> -Infinity
-fmax0806 fma -Inf -Inf Inf -> Infinity
-fmax0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
-fmax0808 fma -Inf 0 1 -> NaN Invalid_operation
-fmax0809 fma -Inf 0 NaN -> NaN Invalid_operation
-
--- Triple NaN propagation
-fmax0900 fma NaN2 NaN3 NaN5 -> NaN2
-fmax0901 fma 0 NaN3 NaN5 -> NaN3
-fmax0902 fma 0 0 NaN5 -> NaN5
--- first sNaN wins (consider qNaN from earlier sNaN being
--- overridden by an sNaN in third operand)
-fmax0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-fmax0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
-fmax0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
-fmax0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
-fmax0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
-fmax0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
-
--- MULTIPLICATION TESTS ------------------------------------------------
--- sanity checks (as base, above)
-fmax2000 fma 2 2 0E+999999 -> 4
-fmax2001 fma 2 3 0E+999999 -> 6
-fmax2002 fma 5 1 0E+999999 -> 5
-fmax2003 fma 5 2 0E+999999 -> 10
-fmax2004 fma 1.20 2 0E+999999 -> 2.40
-fmax2005 fma 1.20 0 0E+999999 -> 0.00
-fmax2006 fma 1.20 -2 0E+999999 -> -2.40
-fmax2007 fma -1.20 2 0E+999999 -> -2.40
-fmax2008 fma -1.20 0 0E+999999 -> 0.00
-fmax2009 fma -1.20 -2 0E+999999 -> 2.40
-fmax2010 fma 5.09 7.1 0E+999999 -> 36.139
-fmax2011 fma 2.5 4 0E+999999 -> 10.0
-fmax2012 fma 2.50 4 0E+999999 -> 10.00
-fmax2013 fma 1.23456789 1.00000000 0E+999999 -> 1.23456789 Rounded
-fmax2014 fma 9.999999999 9.999999999 0E+999999 -> 100.000000 Inexact Rounded
-fmax2015 fma 2.50 4 0E+999999 -> 10.00
-precision: 6
-fmax2016 fma 2.50 4 0E+999999 -> 10.00
-fmax2017 fma 9.999999 9.999999 0E+999999 -> 100.000 Inexact Rounded
-fmax2018 fma 9.999999 -9.999999 0E+999999 -> -100.000 Inexact Rounded
-fmax2019 fma -9.999999 9.999999 0E+999999 -> -100.000 Inexact Rounded
-fmax2020 fma -9.999999 -9.999999 0E+999999 -> 100.000 Inexact Rounded
-
--- 1999.12.21: next one is a edge case if intermediate longs are used
-precision: 15
-fmax2059 fma 999999999999 9765625 0E+999999 -> 9.76562499999023E+18 Inexact Rounded
-precision: 30
-fmax2160 fma 999999999999 9765625 0E+999999 -> 9765624999990234375
-precision: 9
------
-
--- zeros, etc.
-fmax2021 fma 0 0 0E+999999 -> 0
-fmax2022 fma 0 -0 0E+999999 -> 0
-fmax2023 fma -0 0 0E+999999 -> 0
-fmax2024 fma -0 -0 0E+999999 -> 0
-fmax2025 fma -0.0 -0.0 0E+999999 -> 0.00
-fmax2026 fma -0.0 -0.0 0E+999999 -> 0.00
-fmax2027 fma -0.0 -0.0 0E+999999 -> 0.00
-fmax2028 fma -0.0 -0.0 0E+999999 -> 0.00
-fmax2030 fma 5.00 1E-3 0E+999999 -> 0.00500
-fmax2031 fma 00.00 0.000 0E+999999 -> 0.00000
-fmax2032 fma 00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0
-fmax2033 fma 0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0
-fmax2034 fma -5.00 1E-3 0E+999999 -> -0.00500
-fmax2035 fma -00.00 0.000 0E+999999 -> 0.00000
-fmax2036 fma -00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0
-fmax2037 fma -0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0
-fmax2038 fma 5.00 -1E-3 0E+999999 -> -0.00500
-fmax2039 fma 00.00 -0.000 0E+999999 -> 0.00000
-fmax2040 fma 00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0
-fmax2041 fma 0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0
-fmax2042 fma -5.00 -1E-3 0E+999999 -> 0.00500
-fmax2043 fma -00.00 -0.000 0E+999999 -> 0.00000
-fmax2044 fma -00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0
-fmax2045 fma -0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0
-
--- examples from decarith multiply
-fmax2050 fma 1.20 3 0E+999999 -> 3.60
-fmax2051 fma 7 3 0E+999999 -> 21
-fmax2052 fma 0.9 0.8 0E+999999 -> 0.72
-fmax2053 fma 0.9 -0 0E+999999 -> 0.0
-fmax2054 fma 654321 654321 0E+999999 -> 4.28135971E+11 Inexact Rounded
-
-fmax2060 fma 123.45 1e7 0E+999999 -> 1.2345E+9
-fmax2061 fma 123.45 1e8 0E+999999 -> 1.2345E+10
-fmax2062 fma 123.45 1e+9 0E+999999 -> 1.2345E+11
-fmax2063 fma 123.45 1e10 0E+999999 -> 1.2345E+12
-fmax2064 fma 123.45 1e11 0E+999999 -> 1.2345E+13
-fmax2065 fma 123.45 1e12 0E+999999 -> 1.2345E+14
-fmax2066 fma 123.45 1e13 0E+999999 -> 1.2345E+15
-
-
--- test some intermediate lengths
-precision: 9
-fmax2080 fma 0.1 123456789 0E+999999 -> 12345678.9
-fmax2081 fma 0.1 1234567891 0E+999999 -> 123456789 Inexact Rounded
-fmax2082 fma 0.1 12345678912 0E+999999 -> 1.23456789E+9 Inexact Rounded
-fmax2083 fma 0.1 12345678912345 0E+999999 -> 1.23456789E+12 Inexact Rounded
-fmax2084 fma 0.1 123456789 0E+999999 -> 12345678.9
-precision: 8
-fmax2085 fma 0.1 12345678912 0E+999999 -> 1.2345679E+9 Inexact Rounded
-fmax2086 fma 0.1 12345678912345 0E+999999 -> 1.2345679E+12 Inexact Rounded
-precision: 7
-fmax2087 fma 0.1 12345678912 0E+999999 -> 1.234568E+9 Inexact Rounded
-fmax2088 fma 0.1 12345678912345 0E+999999 -> 1.234568E+12 Inexact Rounded
-
-precision: 9
-fmax2090 fma 123456789 0.1 0E+999999 -> 12345678.9
-fmax2091 fma 1234567891 0.1 0E+999999 -> 123456789 Inexact Rounded
-fmax2092 fma 12345678912 0.1 0E+999999 -> 1.23456789E+9 Inexact Rounded
-fmax2093 fma 12345678912345 0.1 0E+999999 -> 1.23456789E+12 Inexact Rounded
-fmax2094 fma 123456789 0.1 0E+999999 -> 12345678.9
-precision: 8
-fmax2095 fma 12345678912 0.1 0E+999999 -> 1.2345679E+9 Inexact Rounded
-fmax2096 fma 12345678912345 0.1 0E+999999 -> 1.2345679E+12 Inexact Rounded
-precision: 7
-fmax2097 fma 12345678912 0.1 0E+999999 -> 1.234568E+9 Inexact Rounded
-fmax2098 fma 12345678912345 0.1 0E+999999 -> 1.234568E+12 Inexact Rounded
-
--- test some more edge cases and carries
-maxexponent: 9999
-minexponent: -9999
-precision: 33
-fmax2101 fma 9 9 0E+999999 -> 81
-fmax2102 fma 9 90 0E+999999 -> 810
-fmax2103 fma 9 900 0E+999999 -> 8100
-fmax2104 fma 9 9000 0E+999999 -> 81000
-fmax2105 fma 9 90000 0E+999999 -> 810000
-fmax2106 fma 9 900000 0E+999999 -> 8100000
-fmax2107 fma 9 9000000 0E+999999 -> 81000000
-fmax2108 fma 9 90000000 0E+999999 -> 810000000
-fmax2109 fma 9 900000000 0E+999999 -> 8100000000
-fmax2110 fma 9 9000000000 0E+999999 -> 81000000000
-fmax2111 fma 9 90000000000 0E+999999 -> 810000000000
-fmax2112 fma 9 900000000000 0E+999999 -> 8100000000000
-fmax2113 fma 9 9000000000000 0E+999999 -> 81000000000000
-fmax2114 fma 9 90000000000000 0E+999999 -> 810000000000000
-fmax2115 fma 9 900000000000000 0E+999999 -> 8100000000000000
-fmax2116 fma 9 9000000000000000 0E+999999 -> 81000000000000000
-fmax2117 fma 9 90000000000000000 0E+999999 -> 810000000000000000
-fmax2118 fma 9 900000000000000000 0E+999999 -> 8100000000000000000
-fmax2119 fma 9 9000000000000000000 0E+999999 -> 81000000000000000000
-fmax2120 fma 9 90000000000000000000 0E+999999 -> 810000000000000000000
-fmax2121 fma 9 900000000000000000000 0E+999999 -> 8100000000000000000000
-fmax2122 fma 9 9000000000000000000000 0E+999999 -> 81000000000000000000000
-fmax2123 fma 9 90000000000000000000000 0E+999999 -> 810000000000000000000000
--- test some more edge cases without carries
-fmax2131 fma 3 3 0E+999999 -> 9
-fmax2132 fma 3 30 0E+999999 -> 90
-fmax2133 fma 3 300 0E+999999 -> 900
-fmax2134 fma 3 3000 0E+999999 -> 9000
-fmax2135 fma 3 30000 0E+999999 -> 90000
-fmax2136 fma 3 300000 0E+999999 -> 900000
-fmax2137 fma 3 3000000 0E+999999 -> 9000000
-fmax2138 fma 3 30000000 0E+999999 -> 90000000
-fmax2139 fma 3 300000000 0E+999999 -> 900000000
-fmax2140 fma 3 3000000000 0E+999999 -> 9000000000
-fmax2141 fma 3 30000000000 0E+999999 -> 90000000000
-fmax2142 fma 3 300000000000 0E+999999 -> 900000000000
-fmax2143 fma 3 3000000000000 0E+999999 -> 9000000000000
-fmax2144 fma 3 30000000000000 0E+999999 -> 90000000000000
-fmax2145 fma 3 300000000000000 0E+999999 -> 900000000000000
-fmax2146 fma 3 3000000000000000 0E+999999 -> 9000000000000000
-fmax2147 fma 3 30000000000000000 0E+999999 -> 90000000000000000
-fmax2148 fma 3 300000000000000000 0E+999999 -> 900000000000000000
-fmax2149 fma 3 3000000000000000000 0E+999999 -> 9000000000000000000
-fmax2150 fma 3 30000000000000000000 0E+999999 -> 90000000000000000000
-fmax2151 fma 3 300000000000000000000 0E+999999 -> 900000000000000000000
-fmax2152 fma 3 3000000000000000000000 0E+999999 -> 9000000000000000000000
-fmax2153 fma 3 30000000000000000000000 0E+999999 -> 90000000000000000000000
-
-maxexponent: 999999
-minexponent: -999999
-precision: 9
--- test some cases that are close to exponent overflow/underflow
-fmax2170 fma 1 9e999999 0E+999999 -> 9E+999999
-fmax2171 fma 1 9.9e999999 0E+999999 -> 9.9E+999999
-fmax2172 fma 1 9.99e999999 0E+999999 -> 9.99E+999999
-fmax2173 fma 9e999999 1 0E+999999 -> 9E+999999
-fmax2174 fma 9.9e999999 1 0E+999999 -> 9.9E+999999
-fmax2176 fma 9.99e999999 1 0E+999999 -> 9.99E+999999
-fmax2177 fma 1 9.99999e999999 0E+999999 -> 9.99999E+999999
-fmax2178 fma 9.99999e999999 1 0E+999999 -> 9.99999E+999999
-
-fmax2180 fma 0.1 9e-999998 0E+999999 -> 9E-999999
-fmax2181 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998
-fmax2182 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997
-
-fmax2183 fma 0.1 9e-999998 0E+999999 -> 9E-999999
-fmax2184 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998
-fmax2185 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997
-fmax2186 fma 0.1 999e-999997 0E+999999 -> 9.99E-999996
-fmax2187 fma 0.1 9999e-999997 0E+999999 -> 9.999E-999995
-fmax2188 fma 0.1 99999e-999997 0E+999999 -> 9.9999E-999994
-
-fmax2190 fma 1 9e-999998 0E+999999 -> 9E-999998
-fmax2191 fma 1 99e-999998 0E+999999 -> 9.9E-999997
-fmax2192 fma 1 999e-999998 0E+999999 -> 9.99E-999996
-fmax2193 fma 9e-999998 1 0E+999999 -> 9E-999998
-fmax2194 fma 99e-999998 1 0E+999999 -> 9.9E-999997
-fmax2195 fma 999e-999998 1 0E+999999 -> 9.99E-999996
-
--- long operand triangle
-precision: 33
-fmax2246 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511992830 Inexact Rounded
-precision: 32
-fmax2247 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199283 Inexact Rounded
-precision: 31
-fmax2248 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165119928 Inexact Rounded
-precision: 30
-fmax2249 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511993 Inexact Rounded
-precision: 29
-fmax2250 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199 Inexact Rounded
-precision: 28
-fmax2251 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165120 Inexact Rounded
-precision: 27
-fmax2252 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916512 Inexact Rounded
-precision: 26
-fmax2253 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651 Inexact Rounded
-precision: 25
-fmax2254 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165 Inexact Rounded
-precision: 24
-fmax2255 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671917 Inexact Rounded
-precision: 23
-fmax2256 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967192 Inexact Rounded
-precision: 22
-fmax2257 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719 Inexact Rounded
-precision: 21
-fmax2258 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369672 Inexact Rounded
-precision: 20
-fmax2259 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967 Inexact Rounded
-precision: 19
-fmax2260 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933697 Inexact Rounded
-precision: 18
-fmax2261 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193370 Inexact Rounded
-precision: 17
-fmax2262 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119337 Inexact Rounded
-precision: 16
-fmax2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011934 Inexact Rounded
-precision: 15
-fmax2264 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193 Inexact Rounded
-precision: 14
-fmax2265 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119 Inexact Rounded
-precision: 13
-fmax2266 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908012 Inexact Rounded
-precision: 12
-fmax2267 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801 Inexact Rounded
-precision: 11
-fmax2268 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080 Inexact Rounded
-precision: 10
-fmax2269 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908 Inexact Rounded
-precision: 9
-fmax2270 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.291 Inexact Rounded
-precision: 8
-fmax2271 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29 Inexact Rounded
-precision: 7
-fmax2272 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.3 Inexact Rounded
-precision: 6
-fmax2273 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433 Inexact Rounded
-precision: 5
-fmax2274 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.4543E+5 Inexact Rounded
-precision: 4
-fmax2275 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.454E+5 Inexact Rounded
-precision: 3
-fmax2276 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.45E+5 Inexact Rounded
-precision: 2
-fmax2277 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.5E+5 Inexact Rounded
-precision: 1
-fmax2278 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1E+5 Inexact Rounded
-
--- test some edge cases with exact rounding
-maxexponent: 9999
-minexponent: -9999
-precision: 9
-fmax2301 fma 9 9 0E+999999 -> 81
-fmax2302 fma 9 90 0E+999999 -> 810
-fmax2303 fma 9 900 0E+999999 -> 8100
-fmax2304 fma 9 9000 0E+999999 -> 81000
-fmax2305 fma 9 90000 0E+999999 -> 810000
-fmax2306 fma 9 900000 0E+999999 -> 8100000
-fmax2307 fma 9 9000000 0E+999999 -> 81000000
-fmax2308 fma 9 90000000 0E+999999 -> 810000000
-fmax2309 fma 9 900000000 0E+999999 -> 8.10000000E+9 Rounded
-fmax2310 fma 9 9000000000 0E+999999 -> 8.10000000E+10 Rounded
-fmax2311 fma 9 90000000000 0E+999999 -> 8.10000000E+11 Rounded
-fmax2312 fma 9 900000000000 0E+999999 -> 8.10000000E+12 Rounded
-fmax2313 fma 9 9000000000000 0E+999999 -> 8.10000000E+13 Rounded
-fmax2314 fma 9 90000000000000 0E+999999 -> 8.10000000E+14 Rounded
-fmax2315 fma 9 900000000000000 0E+999999 -> 8.10000000E+15 Rounded
-fmax2316 fma 9 9000000000000000 0E+999999 -> 8.10000000E+16 Rounded
-fmax2317 fma 9 90000000000000000 0E+999999 -> 8.10000000E+17 Rounded
-fmax2318 fma 9 900000000000000000 0E+999999 -> 8.10000000E+18 Rounded
-fmax2319 fma 9 9000000000000000000 0E+999999 -> 8.10000000E+19 Rounded
-fmax2320 fma 9 90000000000000000000 0E+999999 -> 8.10000000E+20 Rounded
-fmax2321 fma 9 900000000000000000000 0E+999999 -> 8.10000000E+21 Rounded
-fmax2322 fma 9 9000000000000000000000 0E+999999 -> 8.10000000E+22 Rounded
-fmax2323 fma 9 90000000000000000000000 0E+999999 -> 8.10000000E+23 Rounded
-
--- fastpath breakers
-precision: 29
-fmax2330 fma 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603 0E+999999 -> 1.6487212707001281468486507878 Inexact Rounded
-precision: 55
-fmax2331 fma 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428 0E+999999 -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded
-
-
--- tryzeros cases
-precision: 7
-rounding: half_up
-maxExponent: 92
-minexponent: -92
-fmax2504 fma 0E-60 1000E-60 0E+999999 -> 0E-98 Clamped
-fmax2505 fma 100E+60 0E+60 0E+999999 -> 0E+92 Clamped
-
--- mixed with zeros
-maxexponent: 999999
-minexponent: -999999
-precision: 9
-fmax2541 fma 0 -1 0E+999999 -> 0
-fmax2542 fma -0 -1 0E+999999 -> 0
-fmax2543 fma 0 1 0E+999999 -> 0
-fmax2544 fma -0 1 0E+999999 -> 0
-fmax2545 fma -1 0 0E+999999 -> 0
-fmax2546 fma -1 -0 0E+999999 -> 0
-fmax2547 fma 1 0 0E+999999 -> 0
-fmax2548 fma 1 -0 0E+999999 -> 0
-
-fmax2551 fma 0.0 -1 0E+999999 -> 0.0
-fmax2552 fma -0.0 -1 0E+999999 -> 0.0
-fmax2553 fma 0.0 1 0E+999999 -> 0.0
-fmax2554 fma -0.0 1 0E+999999 -> 0.0
-fmax2555 fma -1.0 0 0E+999999 -> 0.0
-fmax2556 fma -1.0 -0 0E+999999 -> 0.0
-fmax2557 fma 1.0 0 0E+999999 -> 0.0
-fmax2558 fma 1.0 -0 0E+999999 -> 0.0
-
-fmax2561 fma 0 -1.0 0E+999999 -> 0.0
-fmax2562 fma -0 -1.0 0E+999999 -> 0.0
-fmax2563 fma 0 1.0 0E+999999 -> 0.0
-fmax2564 fma -0 1.0 0E+999999 -> 0.0
-fmax2565 fma -1 0.0 0E+999999 -> 0.0
-fmax2566 fma -1 -0.0 0E+999999 -> 0.0
-fmax2567 fma 1 0.0 0E+999999 -> 0.0
-fmax2568 fma 1 -0.0 0E+999999 -> 0.0
-
-fmax2571 fma 0.0 -1.0 0E+999999 -> 0.00
-fmax2572 fma -0.0 -1.0 0E+999999 -> 0.00
-fmax2573 fma 0.0 1.0 0E+999999 -> 0.00
-fmax2574 fma -0.0 1.0 0E+999999 -> 0.00
-fmax2575 fma -1.0 0.0 0E+999999 -> 0.00
-fmax2576 fma -1.0 -0.0 0E+999999 -> 0.00
-fmax2577 fma 1.0 0.0 0E+999999 -> 0.00
-fmax2578 fma 1.0 -0.0 0E+999999 -> 0.00
-
-
--- Specials
-fmax2580 fma Inf -Inf 0E+999999 -> -Infinity
-fmax2581 fma Inf -1000 0E+999999 -> -Infinity
-fmax2582 fma Inf -1 0E+999999 -> -Infinity
-fmax2583 fma Inf -0 0E+999999 -> NaN Invalid_operation
-fmax2584 fma Inf 0 0E+999999 -> NaN Invalid_operation
-fmax2585 fma Inf 1 0E+999999 -> Infinity
-fmax2586 fma Inf 1000 0E+999999 -> Infinity
-fmax2587 fma Inf Inf 0E+999999 -> Infinity
-fmax2588 fma -1000 Inf 0E+999999 -> -Infinity
-fmax2589 fma -Inf Inf 0E+999999 -> -Infinity
-fmax2590 fma -1 Inf 0E+999999 -> -Infinity
-fmax2591 fma -0 Inf 0E+999999 -> NaN Invalid_operation
-fmax2592 fma 0 Inf 0E+999999 -> NaN Invalid_operation
-fmax2593 fma 1 Inf 0E+999999 -> Infinity
-fmax2594 fma 1000 Inf 0E+999999 -> Infinity
-fmax2595 fma Inf Inf 0E+999999 -> Infinity
-
-fmax2600 fma -Inf -Inf 0E+999999 -> Infinity
-fmax2601 fma -Inf -1000 0E+999999 -> Infinity
-fmax2602 fma -Inf -1 0E+999999 -> Infinity
-fmax2603 fma -Inf -0 0E+999999 -> NaN Invalid_operation
-fmax2604 fma -Inf 0 0E+999999 -> NaN Invalid_operation
-fmax2605 fma -Inf 1 0E+999999 -> -Infinity
-fmax2606 fma -Inf 1000 0E+999999 -> -Infinity
-fmax2607 fma -Inf Inf 0E+999999 -> -Infinity
-fmax2608 fma -1000 Inf 0E+999999 -> -Infinity
-fmax2609 fma -Inf -Inf 0E+999999 -> Infinity
-fmax2610 fma -1 -Inf 0E+999999 -> Infinity
-fmax2611 fma -0 -Inf 0E+999999 -> NaN Invalid_operation
-fmax2612 fma 0 -Inf 0E+999999 -> NaN Invalid_operation
-fmax2613 fma 1 -Inf 0E+999999 -> -Infinity
-fmax2614 fma 1000 -Inf 0E+999999 -> -Infinity
-fmax2615 fma Inf -Inf 0E+999999 -> -Infinity
-
-fmax2621 fma NaN -Inf 0E+999999 -> NaN
-fmax2622 fma NaN -1000 0E+999999 -> NaN
-fmax2623 fma NaN -1 0E+999999 -> NaN
-fmax2624 fma NaN -0 0E+999999 -> NaN
-fmax2625 fma NaN 0 0E+999999 -> NaN
-fmax2626 fma NaN 1 0E+999999 -> NaN
-fmax2627 fma NaN 1000 0E+999999 -> NaN
-fmax2628 fma NaN Inf 0E+999999 -> NaN
-fmax2629 fma NaN NaN 0E+999999 -> NaN
-fmax2630 fma -Inf NaN 0E+999999 -> NaN
-fmax2631 fma -1000 NaN 0E+999999 -> NaN
-fmax2632 fma -1 NaN 0E+999999 -> NaN
-fmax2633 fma -0 NaN 0E+999999 -> NaN
-fmax2634 fma 0 NaN 0E+999999 -> NaN
-fmax2635 fma 1 NaN 0E+999999 -> NaN
-fmax2636 fma 1000 NaN 0E+999999 -> NaN
-fmax2637 fma Inf NaN 0E+999999 -> NaN
-
-fmax2641 fma sNaN -Inf 0E+999999 -> NaN Invalid_operation
-fmax2642 fma sNaN -1000 0E+999999 -> NaN Invalid_operation
-fmax2643 fma sNaN -1 0E+999999 -> NaN Invalid_operation
-fmax2644 fma sNaN -0 0E+999999 -> NaN Invalid_operation
-fmax2645 fma sNaN 0 0E+999999 -> NaN Invalid_operation
-fmax2646 fma sNaN 1 0E+999999 -> NaN Invalid_operation
-fmax2647 fma sNaN 1000 0E+999999 -> NaN Invalid_operation
-fmax2648 fma sNaN NaN 0E+999999 -> NaN Invalid_operation
-fmax2649 fma sNaN sNaN 0E+999999 -> NaN Invalid_operation
-fmax2650 fma NaN sNaN 0E+999999 -> NaN Invalid_operation
-fmax2651 fma -Inf sNaN 0E+999999 -> NaN Invalid_operation
-fmax2652 fma -1000 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2653 fma -1 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2654 fma -0 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2655 fma 0 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2656 fma 1 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2657 fma 1000 sNaN 0E+999999 -> NaN Invalid_operation
-fmax2658 fma Inf sNaN 0E+999999 -> NaN Invalid_operation
-fmax2659 fma NaN sNaN 0E+999999 -> NaN Invalid_operation
-
--- propagating NaNs
-fmax2661 fma NaN9 -Inf 0E+999999 -> NaN9
-fmax2662 fma NaN8 999 0E+999999 -> NaN8
-fmax2663 fma NaN71 Inf 0E+999999 -> NaN71
-fmax2664 fma NaN6 NaN5 0E+999999 -> NaN6
-fmax2665 fma -Inf NaN4 0E+999999 -> NaN4
-fmax2666 fma -999 NaN33 0E+999999 -> NaN33
-fmax2667 fma Inf NaN2 0E+999999 -> NaN2
-
-fmax2671 fma sNaN99 -Inf 0E+999999 -> NaN99 Invalid_operation
-fmax2672 fma sNaN98 -11 0E+999999 -> NaN98 Invalid_operation
-fmax2673 fma sNaN97 NaN 0E+999999 -> NaN97 Invalid_operation
-fmax2674 fma sNaN16 sNaN94 0E+999999 -> NaN16 Invalid_operation
-fmax2675 fma NaN95 sNaN93 0E+999999 -> NaN93 Invalid_operation
-fmax2676 fma -Inf sNaN92 0E+999999 -> NaN92 Invalid_operation
-fmax2677 fma 088 sNaN91 0E+999999 -> NaN91 Invalid_operation
-fmax2678 fma Inf sNaN90 0E+999999 -> NaN90 Invalid_operation
-fmax2679 fma NaN sNaN89 0E+999999 -> NaN89 Invalid_operation
-
-fmax2681 fma -NaN9 -Inf 0E+999999 -> -NaN9
-fmax2682 fma -NaN8 999 0E+999999 -> -NaN8
-fmax2683 fma -NaN71 Inf 0E+999999 -> -NaN71
-fmax2684 fma -NaN6 -NaN5 0E+999999 -> -NaN6
-fmax2685 fma -Inf -NaN4 0E+999999 -> -NaN4
-fmax2686 fma -999 -NaN33 0E+999999 -> -NaN33
-fmax2687 fma Inf -NaN2 0E+999999 -> -NaN2
-
-fmax2691 fma -sNaN99 -Inf 0E+999999 -> -NaN99 Invalid_operation
-fmax2692 fma -sNaN98 -11 0E+999999 -> -NaN98 Invalid_operation
-fmax2693 fma -sNaN97 NaN 0E+999999 -> -NaN97 Invalid_operation
-fmax2694 fma -sNaN16 -sNaN94 0E+999999 -> -NaN16 Invalid_operation
-fmax2695 fma -NaN95 -sNaN93 0E+999999 -> -NaN93 Invalid_operation
-fmax2696 fma -Inf -sNaN92 0E+999999 -> -NaN92 Invalid_operation
-fmax2697 fma 088 -sNaN91 0E+999999 -> -NaN91 Invalid_operation
-fmax2698 fma Inf -sNaN90 0E+999999 -> -NaN90 Invalid_operation
-fmax2699 fma -NaN -sNaN89 0E+999999 -> -NaN89 Invalid_operation
-
-fmax2701 fma -NaN -Inf 0E+999999 -> -NaN
-fmax2702 fma -NaN 999 0E+999999 -> -NaN
-fmax2703 fma -NaN Inf 0E+999999 -> -NaN
-fmax2704 fma -NaN -NaN 0E+999999 -> -NaN
-fmax2705 fma -Inf -NaN0 0E+999999 -> -NaN
-fmax2706 fma -999 -NaN 0E+999999 -> -NaN
-fmax2707 fma Inf -NaN 0E+999999 -> -NaN
-
-fmax2711 fma -sNaN -Inf 0E+999999 -> -NaN Invalid_operation
-fmax2712 fma -sNaN -11 0E+999999 -> -NaN Invalid_operation
-fmax2713 fma -sNaN00 NaN 0E+999999 -> -NaN Invalid_operation
-fmax2714 fma -sNaN -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2715 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2716 fma -Inf -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2717 fma 088 -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2718 fma Inf -sNaN 0E+999999 -> -NaN Invalid_operation
-fmax2719 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation
-
--- overflow and underflow tests .. note subnormal results
-maxexponent: 999999
-minexponent: -999999
-fmax2730 fma +1.23456789012345E-0 9E+999999 0E+999999 -> Infinity Inexact Overflow Rounded
-fmax2731 fma 9E+999999 +1.23456789012345E-0 0E+999999 -> Infinity Inexact Overflow Rounded
-fmax2732 fma +0.100 9E-999999 0E+999999 -> 9.00E-1000000 Subnormal
-fmax2733 fma 9E-999999 +0.100 0E+999999 -> 9.00E-1000000 Subnormal
-fmax2735 fma -1.23456789012345E-0 9E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded
-fmax2736 fma 9E+999999 -1.23456789012345E-0 0E+999999 -> -Infinity Inexact Overflow Rounded
-fmax2737 fma -0.100 9E-999999 0E+999999 -> -9.00E-1000000 Subnormal
-fmax2738 fma 9E-999999 -0.100 0E+999999 -> -9.00E-1000000 Subnormal
-
--- signs
-fmax2751 fma 1e+777777 1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2752 fma 1e+777777 -1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded
-fmax2753 fma -1e+777777 1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded
-fmax2754 fma -1e+777777 -1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2755 fma 1e-777777 1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2756 fma 1e-777777 -1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2757 fma -1e-777777 1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2758 fma -1e-777777 -1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-
--- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
-precision: 9
-fmax2760 fma 1e-600000 1e-400001 0E+999999 -> 1E-1000001 Subnormal
-fmax2761 fma 1e-600000 1e-400002 0E+999999 -> 1E-1000002 Subnormal
-fmax2762 fma 1e-600000 1e-400003 0E+999999 -> 1E-1000003 Subnormal
-fmax2763 fma 1e-600000 1e-400004 0E+999999 -> 1E-1000004 Subnormal
-fmax2764 fma 1e-600000 1e-400005 0E+999999 -> 1E-1000005 Subnormal
-fmax2765 fma 1e-600000 1e-400006 0E+999999 -> 1E-1000006 Subnormal
-fmax2766 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal
-fmax2767 fma 1e-600000 1e-400008 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2768 fma 1e-600000 1e-400009 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
-fmax2769 fma 1e-600000 1e-400010 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
--- [no equivalent of 'subnormal' for overflow]
-fmax2770 fma 1e+600000 1e+400001 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2771 fma 1e+600000 1e+400002 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2772 fma 1e+600000 1e+400003 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2773 fma 1e+600000 1e+400004 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2774 fma 1e+600000 1e+400005 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2775 fma 1e+600000 1e+400006 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2776 fma 1e+600000 1e+400007 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2777 fma 1e+600000 1e+400008 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2778 fma 1e+600000 1e+400009 0E+999999 -> Infinity Overflow Inexact Rounded
-fmax2779 fma 1e+600000 1e+400010 0E+999999 -> Infinity Overflow Inexact Rounded
-
--- 'subnormal' test edge condition at higher precisions
-precision: 99
-fmax2780 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal
-fmax2781 fma 1e-600000 1e-400008 0E+999999 -> 1E-1000008 Subnormal
-fmax2782 fma 1e-600000 1e-400097 0E+999999 -> 1E-1000097 Subnormal
-fmax2783 fma 1e-600000 1e-400098 0E+999999 -> 0E-1000097 Underflow Subnormal Inexact Rounded Clamped
-precision: 999
-fmax2784 fma 1e-600000 1e-400997 0E+999999 -> 1E-1000997 Subnormal
-fmax2785 fma 1e-600000 1e-400998 0E+999999 -> 0E-1000997 Underflow Subnormal Inexact Rounded Clamped
-
--- test subnormals rounding
-precision: 5
-maxExponent: 999
-minexponent: -999
-rounding: half_even
-
-fmax2801 fma 1.0000E-999 1 0E+999999 -> 1.0000E-999
-fmax2802 fma 1.000E-999 1e-1 0E+999999 -> 1.000E-1000 Subnormal
-fmax2803 fma 1.00E-999 1e-2 0E+999999 -> 1.00E-1001 Subnormal
-fmax2804 fma 1.0E-999 1e-3 0E+999999 -> 1.0E-1002 Subnormal
-fmax2805 fma 1.0E-999 1e-4 0E+999999 -> 1E-1003 Subnormal Rounded
-fmax2806 fma 1.3E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-fmax2807 fma 1.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2808 fma 1.7E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2809 fma 2.3E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2810 fma 2.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2811 fma 2.7E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded
-fmax2812 fma 1.49E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-fmax2813 fma 1.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2814 fma 1.51E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2815 fma 2.49E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2816 fma 2.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
-fmax2817 fma 2.51E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded
-
-fmax2818 fma 1E-999 1e-4 0E+999999 -> 1E-1003 Subnormal
-fmax2819 fma 3E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2820 fma 5E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2821 fma 7E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-fmax2822 fma 9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-fmax2823 fma 9.9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
-
-fmax2824 fma 1E-999 -1e-4 0E+999999 -> -1E-1003 Subnormal
-fmax2825 fma 3E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2826 fma -5E-999 1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2827 fma 7E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
-fmax2828 fma -9E-999 1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
-fmax2829 fma 9.9E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
-fmax2830 fma 3.0E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
-
-fmax2831 fma 1.0E-501 1e-501 0E+999999 -> 1.0E-1002 Subnormal
-fmax2832 fma 2.0E-501 2e-501 0E+999999 -> 4.0E-1002 Subnormal
-fmax2833 fma 4.0E-501 4e-501 0E+999999 -> 1.60E-1001 Subnormal
-fmax2834 fma 10.0E-501 10e-501 0E+999999 -> 1.000E-1000 Subnormal
-fmax2835 fma 30.0E-501 30e-501 0E+999999 -> 9.000E-1000 Subnormal
-fmax2836 fma 40.0E-501 40e-501 0E+999999 -> 1.6000E-999
-
--- squares
-fmax2840 fma 1E-502 1e-502 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2841 fma 1E-501 1e-501 0E+999999 -> 1E-1002 Subnormal
-fmax2842 fma 2E-501 2e-501 0E+999999 -> 4E-1002 Subnormal
-fmax2843 fma 4E-501 4e-501 0E+999999 -> 1.6E-1001 Subnormal
-fmax2844 fma 10E-501 10e-501 0E+999999 -> 1.00E-1000 Subnormal
-fmax2845 fma 30E-501 30e-501 0E+999999 -> 9.00E-1000 Subnormal
-fmax2846 fma 40E-501 40e-501 0E+999999 -> 1.600E-999
-
--- cubes
-fmax2850 fma 1E-670 1e-335 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
-fmax2851 fma 1E-668 1e-334 0E+999999 -> 1E-1002 Subnormal
-fmax2852 fma 4E-668 2e-334 0E+999999 -> 8E-1002 Subnormal
-fmax2853 fma 9E-668 3e-334 0E+999999 -> 2.7E-1001 Subnormal
-fmax2854 fma 16E-668 4e-334 0E+999999 -> 6.4E-1001 Subnormal
-fmax2855 fma 25E-668 5e-334 0E+999999 -> 1.25E-1000 Subnormal
-fmax2856 fma 10E-668 100e-334 0E+999999 -> 1.000E-999
-
--- test derived from result of 0.099 ** 999 at 15 digits with unlimited exponent
-precision: 19
-fmax2860 fma 6636851557994578716E-520 6636851557994578716E-520 0E+999999 -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded
-
--- Long operand overflow may be a different path
-precision: 3
-maxExponent: 999999
-minexponent: -999999
-fmax2870 fma 1 9.999E+999999 0E+999999 -> Infinity Inexact Overflow Rounded
-fmax2871 fma 1 -9.999E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded
-fmax2872 fma 9.999E+999999 1 0E+999999 -> Infinity Inexact Overflow Rounded
-fmax2873 fma -9.999E+999999 1 0E+999999 -> -Infinity Inexact Overflow Rounded
-
--- check for double-rounded subnormals
-precision: 5
-maxexponent: 79
-minexponent: -79
-fmax2881 fma 1.2347E-40 1.2347E-40 0E+999999 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax2882 fma 1.234E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
-fmax2883 fma 1.23E-40 1.23E-40 0E+999999 -> 1.513E-80 Inexact Rounded Subnormal Underflow
-fmax2884 fma 1.2E-40 1.2E-40 0E+999999 -> 1.44E-80 Subnormal
-fmax2885 fma 1.2E-40 1.2E-41 0E+999999 -> 1.44E-81 Subnormal
-fmax2886 fma 1.2E-40 1.2E-42 0E+999999 -> 1.4E-82 Subnormal Inexact Rounded Underflow
-fmax2887 fma 1.2E-40 1.3E-42 0E+999999 -> 1.6E-82 Subnormal Inexact Rounded Underflow
-fmax2888 fma 1.3E-40 1.3E-42 0E+999999 -> 1.7E-82 Subnormal Inexact Rounded Underflow
-fmax2889 fma 1.3E-40 1.3E-43 0E+999999 -> 2E-83 Subnormal Inexact Rounded Underflow
-fmax2890 fma 1.3E-41 1.3E-43 0E+999999 -> 0E-83 Clamped Subnormal Inexact Rounded Underflow
-
-fmax2891 fma 1.2345E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded
-fmax2892 fma 1.23456E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded
-fmax2893 fma 1.2345E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
-fmax2894 fma 1.23456E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
-fmax2895 fma 1.2345E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow
-fmax2896 fma 1.23456E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow
-
--- Now explore the case where we get a normal result with Underflow
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
-fmax2900 fma 0.3000000000E-191 0.3000000000E-191 0E+999999 -> 9.00000000000000E-384 Subnormal Rounded
-fmax2901 fma 0.3000000001E-191 0.3000000001E-191 0E+999999 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
-fmax2902 fma 9.999999999999999E-383 0.0999999999999 0E+999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
-fmax2903 fma 9.999999999999999E-383 0.09999999999999 0E+999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
-fmax2904 fma 9.999999999999999E-383 0.099999999999999 0E+999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
-fmax2905 fma 9.999999999999999E-383 0.0999999999999999 0E+999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
--- prove operands are exact
-fmax2906 fma 9.999999999999999E-383 1 0E+999999 -> 9.999999999999999E-383
-fmax2907 fma 1 0.09999999999999999 0E+999999 -> 0.09999999999999999
--- the next rounds to Nmin
-fmax2908 fma 9.999999999999999E-383 0.09999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax2909 fma 9.999999999999999E-383 0.099999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax2910 fma 9.999999999999999E-383 0.0999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax2911 fma 9.999999999999999E-383 0.09999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-
--- Examples from SQL proposal (Krishna Kulkarni)
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
-fmax2921 fma 130E-2 120E-2 0E+999999 -> 1.5600
-fmax2922 fma 130E-2 12E-1 0E+999999 -> 1.560
-fmax2923 fma 130E-2 1E0 0E+999999 -> 1.30
-
--- Null tests
-fmax2990 fma # 10 0E+999999 -> NaN Invalid_operation
-fmax2991 fma 10 # 0E+999999 -> NaN Invalid_operation
-
--- ADDITION TESTS ------------------------------------------------------
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- [first group are 'quick confidence check']
-fmax3001 fma 1 1 1 -> 2
-fmax3002 fma 1 2 3 -> 5
-fmax3003 fma 1 '5.75' '3.3' -> 9.05
-fmax3004 fma 1 '5' '-3' -> 2
-fmax3005 fma 1 '-5' '-3' -> -8
-fmax3006 fma 1 '-7' '2.5' -> -4.5
-fmax3007 fma 1 '0.7' '0.3' -> 1.0
-fmax3008 fma 1 '1.25' '1.25' -> 2.50
-fmax3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
-fmax3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
-
-fmax3011 fma 1 '0.4444444444' '0.5555555555' -> '1.00000000' Inexact Rounded
-fmax3012 fma 1 '0.4444444440' '0.5555555555' -> '1.00000000' Inexact Rounded
-fmax3013 fma 1 '0.4444444444' '0.5555555550' -> '0.999999999' Inexact Rounded
-fmax3014 fma 1 '0.44444444449' '0' -> '0.444444444' Inexact Rounded
-fmax3015 fma 1 '0.444444444499' '0' -> '0.444444444' Inexact Rounded
-fmax3016 fma 1 '0.4444444444999' '0' -> '0.444444444' Inexact Rounded
-fmax3017 fma 1 '0.4444444445000' '0' -> '0.444444445' Inexact Rounded
-fmax3018 fma 1 '0.4444444445001' '0' -> '0.444444445' Inexact Rounded
-fmax3019 fma 1 '0.444444444501' '0' -> '0.444444445' Inexact Rounded
-fmax3020 fma 1 '0.44444444451' '0' -> '0.444444445' Inexact Rounded
-
-fmax3021 fma 1 0 1 -> 1
-fmax3022 fma 1 1 1 -> 2
-fmax3023 fma 1 2 1 -> 3
-fmax3024 fma 1 3 1 -> 4
-fmax3025 fma 1 4 1 -> 5
-fmax3026 fma 1 5 1 -> 6
-fmax3027 fma 1 6 1 -> 7
-fmax3028 fma 1 7 1 -> 8
-fmax3029 fma 1 8 1 -> 9
-fmax3030 fma 1 9 1 -> 10
-
--- some carrying effects
-fmax3031 fma 1 '0.9998' '0.0000' -> '0.9998'
-fmax3032 fma 1 '0.9998' '0.0001' -> '0.9999'
-fmax3033 fma 1 '0.9998' '0.0002' -> '1.0000'
-fmax3034 fma 1 '0.9998' '0.0003' -> '1.0001'
-
-fmax3035 fma 1 '70' '10000e+9' -> '1.00000000E+13' Inexact Rounded
-fmax3036 fma 1 '700' '10000e+9' -> '1.00000000E+13' Inexact Rounded
-fmax3037 fma 1 '7000' '10000e+9' -> '1.00000000E+13' Inexact Rounded
-fmax3038 fma 1 '70000' '10000e+9' -> '1.00000001E+13' Inexact Rounded
-fmax3039 fma 1 '700000' '10000e+9' -> '1.00000007E+13' Rounded
-
--- symmetry:
-fmax3040 fma 1 '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded
-fmax3041 fma 1 '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded
-fmax3042 fma 1 '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded
-fmax3044 fma 1 '10000e+9' '70000' -> '1.00000001E+13' Inexact Rounded
-fmax3045 fma 1 '10000e+9' '700000' -> '1.00000007E+13' Rounded
-
--- same, higher precision
-precision: 15
-fmax3046 fma 1 '10000e+9' '7' -> '10000000000007'
-fmax3047 fma 1 '10000e+9' '70' -> '10000000000070'
-fmax3048 fma 1 '10000e+9' '700' -> '10000000000700'
-fmax3049 fma 1 '10000e+9' '7000' -> '10000000007000'
-fmax3050 fma 1 '10000e+9' '70000' -> '10000000070000'
-fmax3051 fma 1 '10000e+9' '700000' -> '10000000700000'
-fmax3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
-
--- examples from decarith
-fmax3053 fma 1 '12' '7.00' -> '19.00'
-fmax3054 fma 1 '1.3' '-1.07' -> '0.23'
-fmax3055 fma 1 '1.3' '-1.30' -> '0.00'
-fmax3056 fma 1 '1.3' '-2.07' -> '-0.77'
-fmax3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
-
--- zero preservation
-precision: 6
-fmax3060 fma 1 '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded
-fmax3061 fma 1 1 '0.0001' -> '1.0001'
-fmax3062 fma 1 1 '0.00001' -> '1.00001'
-fmax3063 fma 1 1 '0.000001' -> '1.00000' Inexact Rounded
-fmax3064 fma 1 1 '0.0000001' -> '1.00000' Inexact Rounded
-fmax3065 fma 1 1 '0.00000001' -> '1.00000' Inexact Rounded
-
--- some funny zeros [in case of bad signum]
-fmax3070 fma 1 1 0 -> 1
-fmax3071 fma 1 1 0. -> 1
-fmax3072 fma 1 1 .0 -> 1.0
-fmax3073 fma 1 1 0.0 -> 1.0
-fmax3074 fma 1 1 0.00 -> 1.00
-fmax3075 fma 1 0 1 -> 1
-fmax3076 fma 1 0. 1 -> 1
-fmax3077 fma 1 .0 1 -> 1.0
-fmax3078 fma 1 0.0 1 -> 1.0
-fmax3079 fma 1 0.00 1 -> 1.00
-
-precision: 9
-
--- some carries
-fmax3080 fma 1 999999998 1 -> 999999999
-fmax3081 fma 1 999999999 1 -> 1.00000000E+9 Rounded
-fmax3082 fma 1 99999999 1 -> 100000000
-fmax3083 fma 1 9999999 1 -> 10000000
-fmax3084 fma 1 999999 1 -> 1000000
-fmax3085 fma 1 99999 1 -> 100000
-fmax3086 fma 1 9999 1 -> 10000
-fmax3087 fma 1 999 1 -> 1000
-fmax3088 fma 1 99 1 -> 100
-fmax3089 fma 1 9 1 -> 10
-
-
--- more LHS swaps
-fmax3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
-fmax3091 fma 1 '-56267E-6' 0 -> '-0.056267'
-fmax3092 fma 1 '-56267E-5' 0 -> '-0.56267'
-fmax3093 fma 1 '-56267E-4' 0 -> '-5.6267'
-fmax3094 fma 1 '-56267E-3' 0 -> '-56.267'
-fmax3095 fma 1 '-56267E-2' 0 -> '-562.67'
-fmax3096 fma 1 '-56267E-1' 0 -> '-5626.7'
-fmax3097 fma 1 '-56267E-0' 0 -> '-56267'
-fmax3098 fma 1 '-5E-10' 0 -> '-5E-10'
-fmax3099 fma 1 '-5E-7' 0 -> '-5E-7'
-fmax3100 fma 1 '-5E-6' 0 -> '-0.000005'
-fmax3101 fma 1 '-5E-5' 0 -> '-0.00005'
-fmax3102 fma 1 '-5E-4' 0 -> '-0.0005'
-fmax3103 fma 1 '-5E-1' 0 -> '-0.5'
-fmax3104 fma 1 '-5E0' 0 -> '-5'
-fmax3105 fma 1 '-5E1' 0 -> '-50'
-fmax3106 fma 1 '-5E5' 0 -> '-500000'
-fmax3107 fma 1 '-5E8' 0 -> '-500000000'
-fmax3108 fma 1 '-5E9' 0 -> '-5.00000000E+9' Rounded
-fmax3109 fma 1 '-5E10' 0 -> '-5.00000000E+10' Rounded
-fmax3110 fma 1 '-5E11' 0 -> '-5.00000000E+11' Rounded
-fmax3111 fma 1 '-5E100' 0 -> '-5.00000000E+100' Rounded
-
--- more RHS swaps
-fmax3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
-fmax3114 fma 1 0 '-56267E-6' -> '-0.056267'
-fmax3116 fma 1 0 '-56267E-5' -> '-0.56267'
-fmax3117 fma 1 0 '-56267E-4' -> '-5.6267'
-fmax3119 fma 1 0 '-56267E-3' -> '-56.267'
-fmax3120 fma 1 0 '-56267E-2' -> '-562.67'
-fmax3121 fma 1 0 '-56267E-1' -> '-5626.7'
-fmax3122 fma 1 0 '-56267E-0' -> '-56267'
-fmax3123 fma 1 0 '-5E-10' -> '-5E-10'
-fmax3124 fma 1 0 '-5E-7' -> '-5E-7'
-fmax3125 fma 1 0 '-5E-6' -> '-0.000005'
-fmax3126 fma 1 0 '-5E-5' -> '-0.00005'
-fmax3127 fma 1 0 '-5E-4' -> '-0.0005'
-fmax3128 fma 1 0 '-5E-1' -> '-0.5'
-fmax3129 fma 1 0 '-5E0' -> '-5'
-fmax3130 fma 1 0 '-5E1' -> '-50'
-fmax3131 fma 1 0 '-5E5' -> '-500000'
-fmax3132 fma 1 0 '-5E8' -> '-500000000'
-fmax3133 fma 1 0 '-5E9' -> '-5.00000000E+9' Rounded
-fmax3134 fma 1 0 '-5E10' -> '-5.00000000E+10' Rounded
-fmax3135 fma 1 0 '-5E11' -> '-5.00000000E+11' Rounded
-fmax3136 fma 1 0 '-5E100' -> '-5.00000000E+100' Rounded
-
--- related
-fmax3137 fma 1 1 '0E-12' -> '1.00000000' Rounded
-fmax3138 fma 1 -1 '0E-12' -> '-1.00000000' Rounded
-fmax3139 fma 1 '0E-12' 1 -> '1.00000000' Rounded
-fmax3140 fma 1 '0E-12' -1 -> '-1.00000000' Rounded
-fmax3141 fma 1 1E+4 0.0000 -> '10000.0000'
-fmax3142 fma 1 1E+4 0.00000 -> '10000.0000' Rounded
-fmax3143 fma 1 0.000 1E+5 -> '100000.000'
-fmax3144 fma 1 0.0000 1E+5 -> '100000.000' Rounded
-
--- [some of the next group are really constructor tests]
-fmax3146 fma 1 '00.0' 0 -> '0.0'
-fmax3147 fma 1 '0.00' 0 -> '0.00'
-fmax3148 fma 1 0 '0.00' -> '0.00'
-fmax3149 fma 1 0 '00.0' -> '0.0'
-fmax3150 fma 1 '00.0' '0.00' -> '0.00'
-fmax3151 fma 1 '0.00' '00.0' -> '0.00'
-fmax3152 fma 1 '3' '.3' -> '3.3'
-fmax3153 fma 1 '3.' '.3' -> '3.3'
-fmax3154 fma 1 '3.0' '.3' -> '3.3'
-fmax3155 fma 1 '3.00' '.3' -> '3.30'
-fmax3156 fma 1 '3' '3' -> '6'
-fmax3157 fma 1 '3' '+3' -> '6'
-fmax3158 fma 1 '3' '-3' -> '0'
-fmax3159 fma 1 '0.3' '-0.3' -> '0.0'
-fmax3160 fma 1 '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-precision: 15
-fmax3161 fma 1 '1E+12' '-1' -> '999999999999'
-fmax3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
-fmax3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
-fmax3164 fma 1 '-1' '1E+12' -> '999999999999'
-fmax3165 fma 1 '7E+12' '-1' -> '6999999999999'
-fmax3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
-fmax3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
-fmax3168 fma 1 '-1' '7E+12' -> '6999999999999'
-
--- 123456789012345 123456789012345 1 23456789012345
-fmax3170 fma 1 '0.444444444444444' '0.555555555555563' -> '1.00000000000001' Inexact Rounded
-fmax3171 fma 1 '0.444444444444444' '0.555555555555562' -> '1.00000000000001' Inexact Rounded
-fmax3172 fma 1 '0.444444444444444' '0.555555555555561' -> '1.00000000000001' Inexact Rounded
-fmax3173 fma 1 '0.444444444444444' '0.555555555555560' -> '1.00000000000000' Inexact Rounded
-fmax3174 fma 1 '0.444444444444444' '0.555555555555559' -> '1.00000000000000' Inexact Rounded
-fmax3175 fma 1 '0.444444444444444' '0.555555555555558' -> '1.00000000000000' Inexact Rounded
-fmax3176 fma 1 '0.444444444444444' '0.555555555555557' -> '1.00000000000000' Inexact Rounded
-fmax3177 fma 1 '0.444444444444444' '0.555555555555556' -> '1.00000000000000' Rounded
-fmax3178 fma 1 '0.444444444444444' '0.555555555555555' -> '0.999999999999999'
-fmax3179 fma 1 '0.444444444444444' '0.555555555555554' -> '0.999999999999998'
-fmax3180 fma 1 '0.444444444444444' '0.555555555555553' -> '0.999999999999997'
-fmax3181 fma 1 '0.444444444444444' '0.555555555555552' -> '0.999999999999996'
-fmax3182 fma 1 '0.444444444444444' '0.555555555555551' -> '0.999999999999995'
-fmax3183 fma 1 '0.444444444444444' '0.555555555555550' -> '0.999999999999994'
-
--- and some more, including residue effects and different roundings
-precision: 9
-rounding: half_up
-fmax3200 fma 1 '123456789' 0 -> '123456789'
-fmax3201 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
-fmax3202 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
-fmax3203 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
-fmax3204 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
-fmax3205 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
-fmax3206 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
-fmax3207 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
-fmax3208 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded
-fmax3209 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded
-fmax3210 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded
-fmax3211 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded
-fmax3212 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded
-fmax3213 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded
-fmax3214 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded
-fmax3215 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded
-fmax3216 fma 1 '123456789' 1 -> '123456790'
-fmax3217 fma 1 '123456789' 1.000000001 -> '123456790' Inexact Rounded
-fmax3218 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
-fmax3219 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
-
-rounding: half_even
-fmax3220 fma 1 '123456789' 0 -> '123456789'
-fmax3221 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
-fmax3222 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
-fmax3223 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
-fmax3224 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
-fmax3225 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
-fmax3226 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
-fmax3227 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
-fmax3228 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded
-fmax3229 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded
-fmax3230 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded
-fmax3231 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded
-fmax3232 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded
-fmax3233 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded
-fmax3234 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded
-fmax3235 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded
-fmax3236 fma 1 '123456789' 1 -> '123456790'
-fmax3237 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded
-fmax3238 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
-fmax3239 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
--- critical few with even bottom digit...
-fmax3240 fma 1 '123456788' 0.499999999 -> '123456788' Inexact Rounded
-fmax3241 fma 1 '123456788' 0.5 -> '123456788' Inexact Rounded
-fmax3242 fma 1 '123456788' 0.500000001 -> '123456789' Inexact Rounded
-
-rounding: down
-fmax3250 fma 1 '123456789' 0 -> '123456789'
-fmax3251 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
-fmax3252 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
-fmax3253 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
-fmax3254 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
-fmax3255 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
-fmax3256 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
-fmax3257 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
-fmax3258 fma 1 '123456789' 0.5 -> '123456789' Inexact Rounded
-fmax3259 fma 1 '123456789' 0.500000001 -> '123456789' Inexact Rounded
-fmax3260 fma 1 '123456789' 0.500001 -> '123456789' Inexact Rounded
-fmax3261 fma 1 '123456789' 0.51 -> '123456789' Inexact Rounded
-fmax3262 fma 1 '123456789' 0.6 -> '123456789' Inexact Rounded
-fmax3263 fma 1 '123456789' 0.9 -> '123456789' Inexact Rounded
-fmax3264 fma 1 '123456789' 0.99999 -> '123456789' Inexact Rounded
-fmax3265 fma 1 '123456789' 0.999999999 -> '123456789' Inexact Rounded
-fmax3266 fma 1 '123456789' 1 -> '123456790'
-fmax3267 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded
-fmax3268 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
-fmax3269 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
-
--- input preparation tests (operands should not be rounded)
-precision: 3
-rounding: half_up
-
-fmax3270 fma 1 '12345678900000' 9999999999999 -> '2.23E+13' Inexact Rounded
-fmax3271 fma 1 '9999999999999' 12345678900000 -> '2.23E+13' Inexact Rounded
-
-fmax3272 fma 1 '12E+3' '3444' -> '1.54E+4' Inexact Rounded
-fmax3273 fma 1 '12E+3' '3446' -> '1.54E+4' Inexact Rounded
-fmax3274 fma 1 '12E+3' '3449.9' -> '1.54E+4' Inexact Rounded
-fmax3275 fma 1 '12E+3' '3450.0' -> '1.55E+4' Inexact Rounded
-fmax3276 fma 1 '12E+3' '3450.1' -> '1.55E+4' Inexact Rounded
-fmax3277 fma 1 '12E+3' '3454' -> '1.55E+4' Inexact Rounded
-fmax3278 fma 1 '12E+3' '3456' -> '1.55E+4' Inexact Rounded
-
-fmax3281 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3282 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3283 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3284 fma 1 '3450.0' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3285 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3286 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3287 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded
-
-rounding: half_down
-fmax3291 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3292 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3293 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3294 fma 1 '3450.0' '12E+3' -> '1.54E+4' Inexact Rounded
-fmax3295 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3296 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded
-fmax3297 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_up
-fmax3301 fma 1 -1 1 -> 0
-fmax3302 fma 1 0 1 -> 1
-fmax3303 fma 1 1 1 -> 2
-fmax3304 fma 1 12 1 -> 13
-fmax3305 fma 1 98 1 -> 99
-fmax3306 fma 1 99 1 -> 100
-fmax3307 fma 1 100 1 -> 101
-fmax3308 fma 1 101 1 -> 102
-fmax3309 fma 1 -1 -1 -> -2
-fmax3310 fma 1 0 -1 -> -1
-fmax3311 fma 1 1 -1 -> 0
-fmax3312 fma 1 12 -1 -> 11
-fmax3313 fma 1 98 -1 -> 97
-fmax3314 fma 1 99 -1 -> 98
-fmax3315 fma 1 100 -1 -> 99
-fmax3316 fma 1 101 -1 -> 100
-
-fmax3321 fma 1 -0.01 0.01 -> 0.00
-fmax3322 fma 1 0.00 0.01 -> 0.01
-fmax3323 fma 1 0.01 0.01 -> 0.02
-fmax3324 fma 1 0.12 0.01 -> 0.13
-fmax3325 fma 1 0.98 0.01 -> 0.99
-fmax3326 fma 1 0.99 0.01 -> 1.00
-fmax3327 fma 1 1.00 0.01 -> 1.01
-fmax3328 fma 1 1.01 0.01 -> 1.02
-fmax3329 fma 1 -0.01 -0.01 -> -0.02
-fmax3330 fma 1 0.00 -0.01 -> -0.01
-fmax3331 fma 1 0.01 -0.01 -> 0.00
-fmax3332 fma 1 0.12 -0.01 -> 0.11
-fmax3333 fma 1 0.98 -0.01 -> 0.97
-fmax3334 fma 1 0.99 -0.01 -> 0.98
-fmax3335 fma 1 1.00 -0.01 -> 0.99
-fmax3336 fma 1 1.01 -0.01 -> 1.00
-
--- some more cases where fma 1 ing 0 affects the coefficient
-precision: 9
-fmax3340 fma 1 1E+3 0 -> 1000
-fmax3341 fma 1 1E+8 0 -> 100000000
-fmax3342 fma 1 1E+9 0 -> 1.00000000E+9 Rounded
-fmax3343 fma 1 1E+10 0 -> 1.00000000E+10 Rounded
--- which simply follow from these cases ...
-fmax3344 fma 1 1E+3 1 -> 1001
-fmax3345 fma 1 1E+8 1 -> 100000001
-fmax3346 fma 1 1E+9 1 -> 1.00000000E+9 Inexact Rounded
-fmax3347 fma 1 1E+10 1 -> 1.00000000E+10 Inexact Rounded
-fmax3348 fma 1 1E+3 7 -> 1007
-fmax3349 fma 1 1E+8 7 -> 100000007
-fmax3350 fma 1 1E+9 7 -> 1.00000001E+9 Inexact Rounded
-fmax3351 fma 1 1E+10 7 -> 1.00000000E+10 Inexact Rounded
-
--- tryzeros cases
-precision: 7
-rounding: half_up
-maxExponent: 92
-minexponent: -92
-fmax3361 fma 1 0E+50 10000E+1 -> 1.0000E+5
-fmax3362 fma 1 10000E+1 0E-50 -> 100000.0 Rounded
-fmax3363 fma 1 10000E+1 10000E-50 -> 100000.0 Rounded Inexact
-fmax3364 fma 1 9.999999E+92 -9.999999E+92 -> 0E+86
-
--- a curiosity from JSR 13 testing
-rounding: half_down
-precision: 10
-fmax3370 fma 1 99999999 81512 -> 100081511
-precision: 6
-fmax3371 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
-rounding: half_up
-precision: 10
-fmax3372 fma 1 99999999 81512 -> 100081511
-precision: 6
-fmax3373 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
-rounding: half_even
-precision: 10
-fmax3374 fma 1 99999999 81512 -> 100081511
-precision: 6
-fmax3375 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
-
--- ulp replacement tests
-precision: 9
-maxexponent: 999999
-minexponent: -999999
-fmax3400 fma 1 1 77e-7 -> 1.0000077
-fmax3401 fma 1 1 77e-8 -> 1.00000077
-fmax3402 fma 1 1 77e-9 -> 1.00000008 Inexact Rounded
-fmax3403 fma 1 1 77e-10 -> 1.00000001 Inexact Rounded
-fmax3404 fma 1 1 77e-11 -> 1.00000000 Inexact Rounded
-fmax3405 fma 1 1 77e-12 -> 1.00000000 Inexact Rounded
-fmax3406 fma 1 1 77e-999 -> 1.00000000 Inexact Rounded
-fmax3407 fma 1 1 77e-999999 -> 1.00000000 Inexact Rounded
-
-fmax3410 fma 1 10 77e-7 -> 10.0000077
-fmax3411 fma 1 10 77e-8 -> 10.0000008 Inexact Rounded
-fmax3412 fma 1 10 77e-9 -> 10.0000001 Inexact Rounded
-fmax3413 fma 1 10 77e-10 -> 10.0000000 Inexact Rounded
-fmax3414 fma 1 10 77e-11 -> 10.0000000 Inexact Rounded
-fmax3415 fma 1 10 77e-12 -> 10.0000000 Inexact Rounded
-fmax3416 fma 1 10 77e-999 -> 10.0000000 Inexact Rounded
-fmax3417 fma 1 10 77e-999999 -> 10.0000000 Inexact Rounded
-
-fmax3420 fma 1 77e-7 1 -> 1.0000077
-fmax3421 fma 1 77e-8 1 -> 1.00000077
-fmax3422 fma 1 77e-9 1 -> 1.00000008 Inexact Rounded
-fmax3423 fma 1 77e-10 1 -> 1.00000001 Inexact Rounded
-fmax3424 fma 1 77e-11 1 -> 1.00000000 Inexact Rounded
-fmax3425 fma 1 77e-12 1 -> 1.00000000 Inexact Rounded
-fmax3426 fma 1 77e-999 1 -> 1.00000000 Inexact Rounded
-fmax3427 fma 1 77e-999999 1 -> 1.00000000 Inexact Rounded
-
-fmax3430 fma 1 77e-7 10 -> 10.0000077
-fmax3431 fma 1 77e-8 10 -> 10.0000008 Inexact Rounded
-fmax3432 fma 1 77e-9 10 -> 10.0000001 Inexact Rounded
-fmax3433 fma 1 77e-10 10 -> 10.0000000 Inexact Rounded
-fmax3434 fma 1 77e-11 10 -> 10.0000000 Inexact Rounded
-fmax3435 fma 1 77e-12 10 -> 10.0000000 Inexact Rounded
-fmax3436 fma 1 77e-999 10 -> 10.0000000 Inexact Rounded
-fmax3437 fma 1 77e-999999 10 -> 10.0000000 Inexact Rounded
-
--- negative ulps
-fmax3440 fma 1 1 -77e-7 -> 0.9999923
-fmax3441 fma 1 1 -77e-8 -> 0.99999923
-fmax3442 fma 1 1 -77e-9 -> 0.999999923
-fmax3443 fma 1 1 -77e-10 -> 0.999999992 Inexact Rounded
-fmax3444 fma 1 1 -77e-11 -> 0.999999999 Inexact Rounded
-fmax3445 fma 1 1 -77e-12 -> 1.00000000 Inexact Rounded
-fmax3446 fma 1 1 -77e-999 -> 1.00000000 Inexact Rounded
-fmax3447 fma 1 1 -77e-999999 -> 1.00000000 Inexact Rounded
-
-fmax3450 fma 1 10 -77e-7 -> 9.9999923
-fmax3451 fma 1 10 -77e-8 -> 9.99999923
-fmax3452 fma 1 10 -77e-9 -> 9.99999992 Inexact Rounded
-fmax3453 fma 1 10 -77e-10 -> 9.99999999 Inexact Rounded
-fmax3454 fma 1 10 -77e-11 -> 10.0000000 Inexact Rounded
-fmax3455 fma 1 10 -77e-12 -> 10.0000000 Inexact Rounded
-fmax3456 fma 1 10 -77e-999 -> 10.0000000 Inexact Rounded
-fmax3457 fma 1 10 -77e-999999 -> 10.0000000 Inexact Rounded
-
-fmax3460 fma 1 -77e-7 1 -> 0.9999923
-fmax3461 fma 1 -77e-8 1 -> 0.99999923
-fmax3462 fma 1 -77e-9 1 -> 0.999999923
-fmax3463 fma 1 -77e-10 1 -> 0.999999992 Inexact Rounded
-fmax3464 fma 1 -77e-11 1 -> 0.999999999 Inexact Rounded
-fmax3465 fma 1 -77e-12 1 -> 1.00000000 Inexact Rounded
-fmax3466 fma 1 -77e-999 1 -> 1.00000000 Inexact Rounded
-fmax3467 fma 1 -77e-999999 1 -> 1.00000000 Inexact Rounded
-
-fmax3470 fma 1 -77e-7 10 -> 9.9999923
-fmax3471 fma 1 -77e-8 10 -> 9.99999923
-fmax3472 fma 1 -77e-9 10 -> 9.99999992 Inexact Rounded
-fmax3473 fma 1 -77e-10 10 -> 9.99999999 Inexact Rounded
-fmax3474 fma 1 -77e-11 10 -> 10.0000000 Inexact Rounded
-fmax3475 fma 1 -77e-12 10 -> 10.0000000 Inexact Rounded
-fmax3476 fma 1 -77e-999 10 -> 10.0000000 Inexact Rounded
-fmax3477 fma 1 -77e-999999 10 -> 10.0000000 Inexact Rounded
-
--- negative ulps
-fmax3480 fma 1 -1 77e-7 -> -0.9999923
-fmax3481 fma 1 -1 77e-8 -> -0.99999923
-fmax3482 fma 1 -1 77e-9 -> -0.999999923
-fmax3483 fma 1 -1 77e-10 -> -0.999999992 Inexact Rounded
-fmax3484 fma 1 -1 77e-11 -> -0.999999999 Inexact Rounded
-fmax3485 fma 1 -1 77e-12 -> -1.00000000 Inexact Rounded
-fmax3486 fma 1 -1 77e-999 -> -1.00000000 Inexact Rounded
-fmax3487 fma 1 -1 77e-999999 -> -1.00000000 Inexact Rounded
-
-fmax3490 fma 1 -10 77e-7 -> -9.9999923
-fmax3491 fma 1 -10 77e-8 -> -9.99999923
-fmax3492 fma 1 -10 77e-9 -> -9.99999992 Inexact Rounded
-fmax3493 fma 1 -10 77e-10 -> -9.99999999 Inexact Rounded
-fmax3494 fma 1 -10 77e-11 -> -10.0000000 Inexact Rounded
-fmax3495 fma 1 -10 77e-12 -> -10.0000000 Inexact Rounded
-fmax3496 fma 1 -10 77e-999 -> -10.0000000 Inexact Rounded
-fmax3497 fma 1 -10 77e-999999 -> -10.0000000 Inexact Rounded
-
-fmax3500 fma 1 77e-7 -1 -> -0.9999923
-fmax3501 fma 1 77e-8 -1 -> -0.99999923
-fmax3502 fma 1 77e-9 -1 -> -0.999999923
-fmax3503 fma 1 77e-10 -1 -> -0.999999992 Inexact Rounded
-fmax3504 fma 1 77e-11 -1 -> -0.999999999 Inexact Rounded
-fmax3505 fma 1 77e-12 -1 -> -1.00000000 Inexact Rounded
-fmax3506 fma 1 77e-999 -1 -> -1.00000000 Inexact Rounded
-fmax3507 fma 1 77e-999999 -1 -> -1.00000000 Inexact Rounded
-
-fmax3510 fma 1 77e-7 -10 -> -9.9999923
-fmax3511 fma 1 77e-8 -10 -> -9.99999923
-fmax3512 fma 1 77e-9 -10 -> -9.99999992 Inexact Rounded
-fmax3513 fma 1 77e-10 -10 -> -9.99999999 Inexact Rounded
-fmax3514 fma 1 77e-11 -10 -> -10.0000000 Inexact Rounded
-fmax3515 fma 1 77e-12 -10 -> -10.0000000 Inexact Rounded
-fmax3516 fma 1 77e-999 -10 -> -10.0000000 Inexact Rounded
-fmax3517 fma 1 77e-999999 -10 -> -10.0000000 Inexact Rounded
-
-
--- long operands
-maxexponent: 999
-minexponent: -999
-precision: 9
-fmax3521 fma 1 12345678000 0 -> 1.23456780E+10 Rounded
-fmax3522 fma 1 0 12345678000 -> 1.23456780E+10 Rounded
-fmax3523 fma 1 1234567800 0 -> 1.23456780E+9 Rounded
-fmax3524 fma 1 0 1234567800 -> 1.23456780E+9 Rounded
-fmax3525 fma 1 1234567890 0 -> 1.23456789E+9 Rounded
-fmax3526 fma 1 0 1234567890 -> 1.23456789E+9 Rounded
-fmax3527 fma 1 1234567891 0 -> 1.23456789E+9 Inexact Rounded
-fmax3528 fma 1 0 1234567891 -> 1.23456789E+9 Inexact Rounded
-fmax3529 fma 1 12345678901 0 -> 1.23456789E+10 Inexact Rounded
-fmax3530 fma 1 0 12345678901 -> 1.23456789E+10 Inexact Rounded
-fmax3531 fma 1 1234567896 0 -> 1.23456790E+9 Inexact Rounded
-fmax3532 fma 1 0 1234567896 -> 1.23456790E+9 Inexact Rounded
-
-precision: 15
--- still checking
-fmax3541 fma 1 12345678000 0 -> 12345678000
-fmax3542 fma 1 0 12345678000 -> 12345678000
-fmax3543 fma 1 1234567800 0 -> 1234567800
-fmax3544 fma 1 0 1234567800 -> 1234567800
-fmax3545 fma 1 1234567890 0 -> 1234567890
-fmax3546 fma 1 0 1234567890 -> 1234567890
-fmax3547 fma 1 1234567891 0 -> 1234567891
-fmax3548 fma 1 0 1234567891 -> 1234567891
-fmax3549 fma 1 12345678901 0 -> 12345678901
-fmax3550 fma 1 0 12345678901 -> 12345678901
-fmax3551 fma 1 1234567896 0 -> 1234567896
-fmax3552 fma 1 0 1234567896 -> 1234567896
-
--- verify a query
-precision: 16
-maxExponent: +394
-minExponent: -393
-rounding: down
-fmax3561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
-fmax3562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
--- and using decimal64 bounds...
-precision: 16
-maxExponent: +384
-minExponent: -383
-rounding: down
-fmax3563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
-fmax3564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
-
-
--- some more residue effects with extreme rounding
-precision: 9
-rounding: half_up
-fmax3601 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-rounding: half_even
-fmax3602 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-rounding: half_down
-fmax3603 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-rounding: floor
-fmax3604 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-rounding: ceiling
-fmax3605 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded
-rounding: up
-fmax3606 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded
-rounding: down
-fmax3607 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
-
-rounding: half_up
-fmax3611 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: half_even
-fmax3612 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: half_down
-fmax3613 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: floor
-fmax3614 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded
-rounding: ceiling
-fmax3615 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: up
-fmax3616 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
-rounding: down
-fmax3617 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded
-
-rounding: half_up
-fmax3621 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-rounding: half_even
-fmax3622 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-rounding: half_down
-fmax3623 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-rounding: floor
-fmax3624 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-rounding: ceiling
-fmax3625 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded
-rounding: up
-fmax3626 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded
-rounding: down
-fmax3627 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
-
-rounding: half_up
-fmax3631 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: half_even
-fmax3632 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: half_down
-fmax3633 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: floor
-fmax3634 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded
-rounding: ceiling
-fmax3635 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: up
-fmax3636 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
-rounding: down
-fmax3637 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded
-
-rounding: half_up
-fmax3641 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: half_even
-fmax3642 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: half_down
-fmax3643 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: floor
-fmax3644 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded
-rounding: ceiling
-fmax3645 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: up
-fmax3646 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
-rounding: down
-fmax3647 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded
-
-rounding: half_up
-fmax3651 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-rounding: half_even
-fmax3652 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-rounding: half_down
-fmax3653 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-rounding: floor
-fmax3654 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-rounding: ceiling
-fmax3655 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded
-rounding: up
-fmax3656 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded
-rounding: down
-fmax3657 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
-
--- long operand triangle
-rounding: half_up
-precision: 37
-fmax3660 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114834538
-precision: 36
-fmax3661 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483454 Inexact Rounded
-precision: 35
-fmax3662 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148345 Inexact Rounded
-precision: 34
-fmax3663 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114835 Inexact Rounded
-precision: 33
-fmax3664 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483 Inexact Rounded
-precision: 32
-fmax3665 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148 Inexact Rounded
-precision: 31
-fmax3666 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded
-precision: 30
-fmax3667 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711 Inexact Rounded
-precision: 29
-fmax3668 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371 Inexact Rounded
-precision: 28
-fmax3669 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337 Inexact Rounded
-precision: 27
-fmax3670 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892234 Inexact Rounded
-precision: 26
-fmax3671 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223 Inexact Rounded
-precision: 25
-fmax3672 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922 Inexact Rounded
-precision: 24
-fmax3673 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892 Inexact Rounded
-precision: 23
-fmax3674 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389 Inexact Rounded
-precision: 22
-fmax3675 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023639 Inexact Rounded
-precision: 21
-fmax3676 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102364 Inexact Rounded
-precision: 20
-fmax3677 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236 Inexact Rounded
-precision: 19
-fmax3678 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211024 Inexact Rounded
-precision: 18
-fmax3679 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102 Inexact Rounded
-precision: 17
-fmax3680 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110 Inexact Rounded
-precision: 16
-fmax3681 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211 Inexact Rounded
-precision: 15
-fmax3682 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221 Inexact Rounded
-precision: 14
-fmax3683 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422 Inexact Rounded
-precision: 13
-fmax3684 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42 Inexact Rounded
-precision: 12
-fmax3685 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4 Inexact Rounded
-precision: 11
-fmax3686 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166 Inexact Rounded
-precision: 10
-fmax3687 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117417E+10 Inexact Rounded
-precision: 9
-fmax3688 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84711742E+10 Inexact Rounded
-precision: 8
-fmax3689 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471174E+10 Inexact Rounded
-precision: 7
-fmax3690 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117E+10 Inexact Rounded
-precision: 6
-fmax3691 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84712E+10 Inexact Rounded
-precision: 5
-fmax3692 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471E+10 Inexact Rounded
-precision: 4
-fmax3693 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847E+10 Inexact Rounded
-precision: 3
-fmax3694 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.85E+10 Inexact Rounded
-precision: 2
-fmax3695 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8E+10 Inexact Rounded
-precision: 1
-fmax3696 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1E+11 Inexact Rounded
-
--- more zeros, etc.
-rounding: half_up
-precision: 9
-
-fmax3701 fma 1 5.00 1.00E-3 -> 5.00100
-fmax3702 fma 1 00.00 0.000 -> 0.000
-fmax3703 fma 1 00.00 0E-3 -> 0.000
-fmax3704 fma 1 0E-3 00.00 -> 0.000
-
-fmax3710 fma 1 0E+3 00.00 -> 0.00
-fmax3711 fma 1 0E+3 00.0 -> 0.0
-fmax3712 fma 1 0E+3 00. -> 0
-fmax3713 fma 1 0E+3 00.E+1 -> 0E+1
-fmax3714 fma 1 0E+3 00.E+2 -> 0E+2
-fmax3715 fma 1 0E+3 00.E+3 -> 0E+3
-fmax3716 fma 1 0E+3 00.E+4 -> 0E+3
-fmax3717 fma 1 0E+3 00.E+5 -> 0E+3
-fmax3718 fma 1 0E+3 -00.0 -> 0.0
-fmax3719 fma 1 0E+3 -00. -> 0
-fmax3731 fma 1 0E+3 -00.E+1 -> 0E+1
-
-fmax3720 fma 1 00.00 0E+3 -> 0.00
-fmax3721 fma 1 00.0 0E+3 -> 0.0
-fmax3722 fma 1 00. 0E+3 -> 0
-fmax3723 fma 1 00.E+1 0E+3 -> 0E+1
-fmax3724 fma 1 00.E+2 0E+3 -> 0E+2
-fmax3725 fma 1 00.E+3 0E+3 -> 0E+3
-fmax3726 fma 1 00.E+4 0E+3 -> 0E+3
-fmax3727 fma 1 00.E+5 0E+3 -> 0E+3
-fmax3728 fma 1 -00.00 0E+3 -> 0.00
-fmax3729 fma 1 -00.0 0E+3 -> 0.0
-fmax3730 fma 1 -00. 0E+3 -> 0
-
-fmax3732 fma 1 0 0 -> 0
-fmax3733 fma 1 0 -0 -> 0
-fmax3734 fma 1 -0 0 -> 0
-fmax3735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
-
-fmax3736 fma 1 1 -1 -> 0
-fmax3737 fma 1 -1 -1 -> -2
-fmax3738 fma 1 1 1 -> 2
-fmax3739 fma 1 -1 1 -> 0
-
-fmax3741 fma 1 0 -1 -> -1
-fmax3742 fma 1 -0 -1 -> -1
-fmax3743 fma 1 0 1 -> 1
-fmax3744 fma 1 -0 1 -> 1
-fmax3745 fma 1 -1 0 -> -1
-fmax3746 fma 1 -1 -0 -> -1
-fmax3747 fma 1 1 0 -> 1
-fmax3748 fma 1 1 -0 -> 1
-
-fmax3751 fma 1 0.0 -1 -> -1.0
-fmax3752 fma 1 -0.0 -1 -> -1.0
-fmax3753 fma 1 0.0 1 -> 1.0
-fmax3754 fma 1 -0.0 1 -> 1.0
-fmax3755 fma 1 -1.0 0 -> -1.0
-fmax3756 fma 1 -1.0 -0 -> -1.0
-fmax3757 fma 1 1.0 0 -> 1.0
-fmax3758 fma 1 1.0 -0 -> 1.0
-
-fmax3761 fma 1 0 -1.0 -> -1.0
-fmax3762 fma 1 -0 -1.0 -> -1.0
-fmax3763 fma 1 0 1.0 -> 1.0
-fmax3764 fma 1 -0 1.0 -> 1.0
-fmax3765 fma 1 -1 0.0 -> -1.0
-fmax3766 fma 1 -1 -0.0 -> -1.0
-fmax3767 fma 1 1 0.0 -> 1.0
-fmax3768 fma 1 1 -0.0 -> 1.0
-
-fmax3771 fma 1 0.0 -1.0 -> -1.0
-fmax3772 fma 1 -0.0 -1.0 -> -1.0
-fmax3773 fma 1 0.0 1.0 -> 1.0
-fmax3774 fma 1 -0.0 1.0 -> 1.0
-fmax3775 fma 1 -1.0 0.0 -> -1.0
-fmax3776 fma 1 -1.0 -0.0 -> -1.0
-fmax3777 fma 1 1.0 0.0 -> 1.0
-fmax3778 fma 1 1.0 -0.0 -> 1.0
-
--- Specials
-fmax3780 fma 1 -Inf -Inf -> -Infinity
-fmax3781 fma 1 -Inf -1000 -> -Infinity
-fmax3782 fma 1 -Inf -1 -> -Infinity
-fmax3783 fma 1 -Inf -0 -> -Infinity
-fmax3784 fma 1 -Inf 0 -> -Infinity
-fmax3785 fma 1 -Inf 1 -> -Infinity
-fmax3786 fma 1 -Inf 1000 -> -Infinity
-fmax3787 fma 1 -1000 -Inf -> -Infinity
-fmax3788 fma 1 -Inf -Inf -> -Infinity
-fmax3789 fma 1 -1 -Inf -> -Infinity
-fmax3790 fma 1 -0 -Inf -> -Infinity
-fmax3791 fma 1 0 -Inf -> -Infinity
-fmax3792 fma 1 1 -Inf -> -Infinity
-fmax3793 fma 1 1000 -Inf -> -Infinity
-fmax3794 fma 1 Inf -Inf -> NaN Invalid_operation
-
-fmax3800 fma 1 Inf -Inf -> NaN Invalid_operation
-fmax3801 fma 1 Inf -1000 -> Infinity
-fmax3802 fma 1 Inf -1 -> Infinity
-fmax3803 fma 1 Inf -0 -> Infinity
-fmax3804 fma 1 Inf 0 -> Infinity
-fmax3805 fma 1 Inf 1 -> Infinity
-fmax3806 fma 1 Inf 1000 -> Infinity
-fmax3807 fma 1 Inf Inf -> Infinity
-fmax3808 fma 1 -1000 Inf -> Infinity
-fmax3809 fma 1 -Inf Inf -> NaN Invalid_operation
-fmax3810 fma 1 -1 Inf -> Infinity
-fmax3811 fma 1 -0 Inf -> Infinity
-fmax3812 fma 1 0 Inf -> Infinity
-fmax3813 fma 1 1 Inf -> Infinity
-fmax3814 fma 1 1000 Inf -> Infinity
-fmax3815 fma 1 Inf Inf -> Infinity
-
-fmax3821 fma 1 NaN -Inf -> NaN
-fmax3822 fma 1 NaN -1000 -> NaN
-fmax3823 fma 1 NaN -1 -> NaN
-fmax3824 fma 1 NaN -0 -> NaN
-fmax3825 fma 1 NaN 0 -> NaN
-fmax3826 fma 1 NaN 1 -> NaN
-fmax3827 fma 1 NaN 1000 -> NaN
-fmax3828 fma 1 NaN Inf -> NaN
-fmax3829 fma 1 NaN NaN -> NaN
-fmax3830 fma 1 -Inf NaN -> NaN
-fmax3831 fma 1 -1000 NaN -> NaN
-fmax3832 fma 1 -1 NaN -> NaN
-fmax3833 fma 1 -0 NaN -> NaN
-fmax3834 fma 1 0 NaN -> NaN
-fmax3835 fma 1 1 NaN -> NaN
-fmax3836 fma 1 1000 NaN -> NaN
-fmax3837 fma 1 Inf NaN -> NaN
-
-fmax3841 fma 1 sNaN -Inf -> NaN Invalid_operation
-fmax3842 fma 1 sNaN -1000 -> NaN Invalid_operation
-fmax3843 fma 1 sNaN -1 -> NaN Invalid_operation
-fmax3844 fma 1 sNaN -0 -> NaN Invalid_operation
-fmax3845 fma 1 sNaN 0 -> NaN Invalid_operation
-fmax3846 fma 1 sNaN 1 -> NaN Invalid_operation
-fmax3847 fma 1 sNaN 1000 -> NaN Invalid_operation
-fmax3848 fma 1 sNaN NaN -> NaN Invalid_operation
-fmax3849 fma 1 sNaN sNaN -> NaN Invalid_operation
-fmax3850 fma 1 NaN sNaN -> NaN Invalid_operation
-fmax3851 fma 1 -Inf sNaN -> NaN Invalid_operation
-fmax3852 fma 1 -1000 sNaN -> NaN Invalid_operation
-fmax3853 fma 1 -1 sNaN -> NaN Invalid_operation
-fmax3854 fma 1 -0 sNaN -> NaN Invalid_operation
-fmax3855 fma 1 0 sNaN -> NaN Invalid_operation
-fmax3856 fma 1 1 sNaN -> NaN Invalid_operation
-fmax3857 fma 1 1000 sNaN -> NaN Invalid_operation
-fmax3858 fma 1 Inf sNaN -> NaN Invalid_operation
-fmax3859 fma 1 NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-fmax3861 fma 1 NaN1 -Inf -> NaN1
-fmax3862 fma 1 +NaN2 -1000 -> NaN2
-fmax3863 fma 1 NaN3 1000 -> NaN3
-fmax3864 fma 1 NaN4 Inf -> NaN4
-fmax3865 fma 1 NaN5 +NaN6 -> NaN5
-fmax3866 fma 1 -Inf NaN7 -> NaN7
-fmax3867 fma 1 -1000 NaN8 -> NaN8
-fmax3868 fma 1 1000 NaN9 -> NaN9
-fmax3869 fma 1 Inf +NaN10 -> NaN10
-fmax3871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
-fmax3872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
-fmax3873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
-fmax3874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
-fmax3875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
-fmax3876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
-fmax3877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
-fmax3878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
-fmax3879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
-fmax3880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
-fmax3881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
-fmax3882 fma 1 -NaN26 NaN28 -> -NaN26
-fmax3883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-fmax3884 fma 1 1000 -NaN30 -> -NaN30
-fmax3885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- overflow, underflow and subnormal tests
-maxexponent: 999999
-minexponent: -999999
-precision: 9
-fmax3890 fma 1 1E+999999 9E+999999 -> Infinity Overflow Inexact Rounded
-fmax3891 fma 1 9E+999999 1E+999999 -> Infinity Overflow Inexact Rounded
-fmax3892 fma 1 -1.1E-999999 1E-999999 -> -1E-1000000 Subnormal
-fmax3893 fma 1 1E-999999 -1.1e-999999 -> -1E-1000000 Subnormal
-fmax3894 fma 1 -1.0001E-999999 1E-999999 -> -1E-1000003 Subnormal
-fmax3895 fma 1 1E-999999 -1.0001e-999999 -> -1E-1000003 Subnormal
-fmax3896 fma 1 -1E+999999 -9E+999999 -> -Infinity Overflow Inexact Rounded
-fmax3897 fma 1 -9E+999999 -1E+999999 -> -Infinity Overflow Inexact Rounded
-fmax3898 fma 1 +1.1E-999999 -1E-999999 -> 1E-1000000 Subnormal
-fmax3899 fma 1 -1E-999999 +1.1e-999999 -> 1E-1000000 Subnormal
-fmax3900 fma 1 +1.0001E-999999 -1E-999999 -> 1E-1000003 Subnormal
-fmax3901 fma 1 -1E-999999 +1.0001e-999999 -> 1E-1000003 Subnormal
-fmax3902 fma 1 -1E+999999 +9E+999999 -> 8E+999999
-fmax3903 fma 1 -9E+999999 +1E+999999 -> -8E+999999
-
-precision: 3
-fmax3904 fma 1 0 -9.999E+999999 -> -Infinity Inexact Overflow Rounded
-fmax3905 fma 1 -9.999E+999999 0 -> -Infinity Inexact Overflow Rounded
-fmax3906 fma 1 0 9.999E+999999 -> Infinity Inexact Overflow Rounded
-fmax3907 fma 1 9.999E+999999 0 -> Infinity Inexact Overflow Rounded
-
-precision: 3
-maxexponent: 999
-minexponent: -999
-fmax3910 fma 1 1.00E-999 0 -> 1.00E-999
-fmax3911 fma 1 0.1E-999 0 -> 1E-1000 Subnormal
-fmax3912 fma 1 0.10E-999 0 -> 1.0E-1000 Subnormal
-fmax3913 fma 1 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded
-fmax3914 fma 1 0.01E-999 0 -> 1E-1001 Subnormal
--- next is rounded to Nmin
-fmax3915 fma 1 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow
-fmax3916 fma 1 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3917 fma 1 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow
-fmax3918 fma 1 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3919 fma 1 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3920 fma 1 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-
-fmax3930 fma 1 -1.00E-999 0 -> -1.00E-999
-fmax3931 fma 1 -0.1E-999 0 -> -1E-1000 Subnormal
-fmax3932 fma 1 -0.10E-999 0 -> -1.0E-1000 Subnormal
-fmax3933 fma 1 -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded
-fmax3934 fma 1 -0.01E-999 0 -> -1E-1001 Subnormal
--- next is rounded to Nmin
-fmax3935 fma 1 -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow
-fmax3936 fma 1 -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3937 fma 1 -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow
-fmax3938 fma 1 -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3939 fma 1 -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3940 fma 1 -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-
--- some non-zero subnormal fma 1 s
-fmax3950 fma 1 1.00E-999 0.1E-999 -> 1.10E-999
-fmax3951 fma 1 0.1E-999 0.1E-999 -> 2E-1000 Subnormal
-fmax3952 fma 1 0.10E-999 0.1E-999 -> 2.0E-1000 Subnormal
-fmax3953 fma 1 0.100E-999 0.1E-999 -> 2.0E-1000 Subnormal Rounded
-fmax3954 fma 1 0.01E-999 0.1E-999 -> 1.1E-1000 Subnormal
-fmax3955 fma 1 0.999E-999 0.1E-999 -> 1.10E-999 Inexact Rounded
-fmax3956 fma 1 0.099E-999 0.1E-999 -> 2.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3957 fma 1 0.009E-999 0.1E-999 -> 1.1E-1000 Inexact Rounded Subnormal Underflow
-fmax3958 fma 1 0.001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3959 fma 1 0.0009E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3960 fma 1 0.0001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
--- negatives...
-fmax3961 fma 1 1.00E-999 -0.1E-999 -> 9.0E-1000 Subnormal
-fmax3962 fma 1 0.1E-999 -0.1E-999 -> 0E-1000
-fmax3963 fma 1 0.10E-999 -0.1E-999 -> 0E-1001
-fmax3964 fma 1 0.100E-999 -0.1E-999 -> 0E-1001 Clamped
-fmax3965 fma 1 0.01E-999 -0.1E-999 -> -9E-1001 Subnormal
-fmax3966 fma 1 0.999E-999 -0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3967 fma 1 0.099E-999 -0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-fmax3968 fma 1 0.009E-999 -0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow
-fmax3969 fma 1 0.001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3970 fma 1 0.0009E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-fmax3971 fma 1 0.0001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-
--- some 'real' numbers
-maxExponent: 384
-minExponent: -383
-precision: 8
-fmax3566 fma 1 99999061735E-394 0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal
-precision: 7
-fmax3567 fma 1 99999061735E-394 0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
-precision: 6
-fmax3568 fma 1 99999061735E-394 0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal
-
--- now the case where we can get underflow but the result is normal
--- [note this can't happen if the operands are also bounded, as we
--- cannot represent 1E-399, for example]
-precision: 16
-rounding: half_up
-maxExponent: 384
-minExponent: -383
-
-fmax3571 fma 1 1E-383 0 -> 1E-383
-fmax3572 fma 1 1E-384 0 -> 1E-384 Subnormal
-fmax3573 fma 1 1E-383 1E-384 -> 1.1E-383
-fmax3574 subtract 1E-383 1E-384 -> 9E-384 Subnormal
-
--- Here we explore the boundary of rounding a subnormal to Nmin
-fmax3575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
-fmax3576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
-fmax3577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax3578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax3579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax3580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-
--- check for double-rounded subnormals
-precision: 5
-maxexponent: 79
-minexponent: -79
--- Add: lhs and rhs 0
-fmax31001 fma 1 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31002 fma 1 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31003 fma 1 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31004 fma 1 0 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31005 fma 1 0 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31006 fma 1 0 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-
--- Add: lhs >> rhs and vice versa
-fmax31011 fma 1 1.52444E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31012 fma 1 1.52445E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31013 fma 1 1.52446E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31014 fma 1 1E-100 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31015 fma 1 1E-100 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-fmax31016 fma 1 1E-100 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
-
--- Add: lhs + rhs fma 1 ition carried out
-fmax31021 fma 1 1.52443E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31022 fma 1 1.52444E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31023 fma 1 1.52445E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31024 fma 1 1.00001E-80 1.52443E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31025 fma 1 1.00001E-80 1.52444E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-fmax31026 fma 1 1.00001E-80 1.52445E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
-
--- And for round down full and subnormal results
-precision: 16
-maxExponent: +384
-minExponent: -383
-rounding: down
-
-fmax31100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
-fmax31101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
-fmax31103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
-fmax31104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
-fmax31105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
-fmax31106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
-fmax31107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
-fmax31108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
-fmax31109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-fmax31110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
-fmax31111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
-fmax31113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
-fmax31114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
-fmax31115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
-fmax31116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
-fmax31117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
-fmax31118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
-fmax31119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
-
-rounding: down
-precision: 7
-maxExponent: +96
-minExponent: -95
-fmax31130 fma 1 1 -1e-200 -> 0.9999999 Rounded Inexact
--- subnormal boundary
-fmax31131 fma 1 1.000000E-94 -1e-200 -> 9.999999E-95 Rounded Inexact
-fmax31132 fma 1 1.000001E-95 -1e-200 -> 1.000000E-95 Rounded Inexact
-fmax31133 fma 1 1.000000E-95 -1e-200 -> 9.99999E-96 Rounded Inexact Subnormal Underflow
-fmax31134 fma 1 0.999999E-95 -1e-200 -> 9.99998E-96 Rounded Inexact Subnormal Underflow
-fmax31135 fma 1 0.001000E-95 -1e-200 -> 9.99E-99 Rounded Inexact Subnormal Underflow
-fmax31136 fma 1 0.000999E-95 -1e-200 -> 9.98E-99 Rounded Inexact Subnormal Underflow
-fmax31137 fma 1 1.000000E-95 -1e-101 -> 9.99999E-96 Subnormal
-fmax31138 fma 1 10000E-101 -1e-200 -> 9.999E-98 Subnormal Inexact Rounded Underflow
-fmax31139 fma 1 1000E-101 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow
-fmax31140 fma 1 100E-101 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow
-fmax31141 fma 1 10E-101 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow
-fmax31142 fma 1 1E-101 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31143 fma 1 0E-101 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31144 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-
-fmax31151 fma 1 10000E-102 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow
-fmax31152 fma 1 1000E-102 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow
-fmax31153 fma 1 100E-102 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow
-fmax31154 fma 1 10E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31155 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31156 fma 1 0E-102 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31157 fma 1 1E-103 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-
-fmax31160 fma 1 100E-105 -1e-101 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
-fmax31161 fma 1 100E-105 -1e-201 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
-
--- tests based on Gunnar Degnbol's edge case
-precision: 15
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
-fmax31200 fma 1 1E15 -0.5 -> 1.00000000000000E+15 Inexact Rounded
-fmax31201 fma 1 1E15 -0.50 -> 1.00000000000000E+15 Inexact Rounded
-fmax31210 fma 1 1E15 -0.51 -> 999999999999999 Inexact Rounded
-fmax31211 fma 1 1E15 -0.501 -> 999999999999999 Inexact Rounded
-fmax31212 fma 1 1E15 -0.5001 -> 999999999999999 Inexact Rounded
-fmax31213 fma 1 1E15 -0.50001 -> 999999999999999 Inexact Rounded
-fmax31214 fma 1 1E15 -0.500001 -> 999999999999999 Inexact Rounded
-fmax31215 fma 1 1E15 -0.5000001 -> 999999999999999 Inexact Rounded
-fmax31216 fma 1 1E15 -0.50000001 -> 999999999999999 Inexact Rounded
-fmax31217 fma 1 1E15 -0.500000001 -> 999999999999999 Inexact Rounded
-fmax31218 fma 1 1E15 -0.5000000001 -> 999999999999999 Inexact Rounded
-fmax31219 fma 1 1E15 -0.50000000001 -> 999999999999999 Inexact Rounded
-fmax31220 fma 1 1E15 -0.500000000001 -> 999999999999999 Inexact Rounded
-fmax31221 fma 1 1E15 -0.5000000000001 -> 999999999999999 Inexact Rounded
-fmax31222 fma 1 1E15 -0.50000000000001 -> 999999999999999 Inexact Rounded
-fmax31223 fma 1 1E15 -0.500000000000001 -> 999999999999999 Inexact Rounded
-fmax31224 fma 1 1E15 -0.5000000000000001 -> 999999999999999 Inexact Rounded
-fmax31225 fma 1 1E15 -0.5000000000000000 -> 1.00000000000000E+15 Inexact Rounded
-fmax31230 fma 1 1E15 -5000000.000000001 -> 999999995000000 Inexact Rounded
-
-precision: 16
-
-fmax31300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
-fmax31310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
-fmax31311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
-fmax31312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
-fmax31313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
-fmax31314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
-fmax31315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
-fmax31316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
-fmax31317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
-fmax31318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
-fmax31319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
-fmax31320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
-fmax31321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
-fmax31322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
-fmax31323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
-fmax31324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
-fmax31325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
-fmax31339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
-
-fmax31340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
-fmax31341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
-
-fmax31349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
-fmax31350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
-fmax31351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
-fmax31352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
-fmax31353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
-fmax31354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
-fmax31355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
-fmax31356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
-fmax31357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
-fmax31358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
-fmax31359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
-fmax31360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
-fmax31361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
-fmax31362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
-fmax31363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
-fmax31364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
-fmax31365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
-fmax31379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
-fmax31380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
-fmax31381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
-fmax31382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
-fmax31395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
-fmax31396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-precision: 15
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
-fmax31400 fma 1 0 1.23456789012345 -> 1.23456789012345
-fmax31401 fma 1 0 1.23456789012345E-1 -> 0.123456789012345
-fmax31402 fma 1 0 1.23456789012345E-2 -> 0.0123456789012345
-fmax31403 fma 1 0 1.23456789012345E-3 -> 0.00123456789012345
-fmax31404 fma 1 0 1.23456789012345E-4 -> 0.000123456789012345
-fmax31405 fma 1 0 1.23456789012345E-5 -> 0.0000123456789012345
-fmax31406 fma 1 0 1.23456789012345E-6 -> 0.00000123456789012345
-fmax31407 fma 1 0 1.23456789012345E-7 -> 1.23456789012345E-7
-fmax31408 fma 1 0 1.23456789012345E-8 -> 1.23456789012345E-8
-fmax31409 fma 1 0 1.23456789012345E-9 -> 1.23456789012345E-9
-fmax31410 fma 1 0 1.23456789012345E-10 -> 1.23456789012345E-10
-fmax31411 fma 1 0 1.23456789012345E-11 -> 1.23456789012345E-11
-fmax31412 fma 1 0 1.23456789012345E-12 -> 1.23456789012345E-12
-fmax31413 fma 1 0 1.23456789012345E-13 -> 1.23456789012345E-13
-fmax31414 fma 1 0 1.23456789012345E-14 -> 1.23456789012345E-14
-fmax31415 fma 1 0 1.23456789012345E-15 -> 1.23456789012345E-15
-fmax31416 fma 1 0 1.23456789012345E-16 -> 1.23456789012345E-16
-fmax31417 fma 1 0 1.23456789012345E-17 -> 1.23456789012345E-17
-fmax31418 fma 1 0 1.23456789012345E-18 -> 1.23456789012345E-18
-fmax31419 fma 1 0 1.23456789012345E-19 -> 1.23456789012345E-19
-
--- same, precision 16..
-precision: 16
-fmax31420 fma 1 0 1.123456789012345 -> 1.123456789012345
-fmax31421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
-fmax31422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
-fmax31423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
-fmax31424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
-fmax31425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
-fmax31426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
-fmax31427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
-fmax31428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
-fmax31429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
-fmax31430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
-fmax31431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
-fmax31432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
-fmax31433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
-fmax31434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
-fmax31435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
-fmax31436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
-fmax31437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
-fmax31438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
-fmax31439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
-
--- same, reversed 0
-fmax31440 fma 1 1.123456789012345 0 -> 1.123456789012345
-fmax31441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
-fmax31442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
-fmax31443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
-fmax31444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
-fmax31445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
-fmax31446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
-fmax31447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
-fmax31448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
-fmax31449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
-fmax31450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
-fmax31451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
-fmax31452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
-fmax31453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
-fmax31454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
-fmax31455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
-fmax31456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
-fmax31457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
-fmax31458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
-fmax31459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
-
--- same, Es on the 0
-fmax31460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
-fmax31461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
-fmax31462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
-fmax31463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
-fmax31464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
-fmax31465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
-fmax31466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
-fmax31467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
-fmax31468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
-fmax31469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
-fmax31470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
-fmax31471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
-fmax31472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
-fmax31473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
-fmax31474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
-fmax31475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
--- next four flag Rounded because the 0 extends the result
-fmax31476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
-fmax31477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
-fmax31478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
-fmax31479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-precision: 16
-maxExponent: 384
-minexponent: -383
-
-rounding: half_up
--- exact zeros from zeros
-fmax31500 fma 1 0 0E-19 -> 0E-19
-fmax31501 fma 1 -0 0E-19 -> 0E-19
-fmax31502 fma 1 0 -0E-19 -> 0E-19
-fmax31503 fma 1 -0 -0E-19 -> -0E-19
-fmax31504 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: half_down
--- exact zeros from zeros
-fmax31520 fma 1 0 0E-19 -> 0E-19
-fmax31521 fma 1 -0 0E-19 -> 0E-19
-fmax31522 fma 1 0 -0E-19 -> 0E-19
-fmax31523 fma 1 -0 -0E-19 -> -0E-19
-fmax31524 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: half_even
--- exact zeros from zeros
-fmax31540 fma 1 0 0E-19 -> 0E-19
-fmax31541 fma 1 -0 0E-19 -> 0E-19
-fmax31542 fma 1 0 -0E-19 -> 0E-19
-fmax31543 fma 1 -0 -0E-19 -> -0E-19
-fmax31544 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: up
--- exact zeros from zeros
-fmax31560 fma 1 0 0E-19 -> 0E-19
-fmax31561 fma 1 -0 0E-19 -> 0E-19
-fmax31562 fma 1 0 -0E-19 -> 0E-19
-fmax31563 fma 1 -0 -0E-19 -> -0E-19
-fmax31564 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
-fmax31574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
--- some exact zeros from non-zeros
-fmax31575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
-
-rounding: down
--- exact zeros from zeros
-fmax31580 fma 1 0 0E-19 -> 0E-19
-fmax31581 fma 1 -0 0E-19 -> 0E-19
-fmax31582 fma 1 0 -0E-19 -> 0E-19
-fmax31583 fma 1 -0 -0E-19 -> -0E-19
-fmax31584 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: ceiling
--- exact zeros from zeros
-fmax31600 fma 1 0 0E-19 -> 0E-19
-fmax31601 fma 1 -0 0E-19 -> 0E-19
-fmax31602 fma 1 0 -0E-19 -> 0E-19
-fmax31603 fma 1 -0 -0E-19 -> -0E-19
-fmax31604 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax31606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax31607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax31615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax31616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax31617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax31618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-fmax31620 fma 1 0 0E-19 -> 0E-19
-fmax31621 fma 1 -0 0E-19 -> -0E-19 -- *
-fmax31622 fma 1 0 -0E-19 -> -0E-19 -- *
-fmax31623 fma 1 -0 -0E-19 -> -0E-19
-fmax31624 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax31625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- *
-fmax31626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- *
-fmax31627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax31631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
-fmax31634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
--- some exact zeros from non-zeros
-fmax31635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax31636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- *
-fmax31637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- *
-fmax31638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
-
--- BigDecimal problem testcases 2006.01.23
-precision: 16
-maxExponent: 384
-minexponent: -383
-
-rounding: down
-precision: 7
-fmax31651 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 6
-fmax31652 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 5
-fmax31653 fma 1 10001E+2 -2E+1 -> 1.0000E+6 Inexact Rounded
-precision: 4
-fmax31654 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded
-precision: 3
-fmax31655 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded
-precision: 2
-fmax31656 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded
-precision: 1
-fmax31657 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded
-
-rounding: half_even
-precision: 7
-fmax31661 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 6
-fmax31662 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 5
-fmax31663 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded
-precision: 4
-fmax31664 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded
-precision: 3
-fmax31665 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded
-precision: 2
-fmax31666 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded
-precision: 1
-fmax31667 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded
-
-rounding: up
-precision: 7
-fmax31671 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 6
-fmax31672 fma 1 10001E+2 -2E+1 -> 1.00008E+6
-precision: 5
-fmax31673 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded
-precision: 4
-fmax31674 fma 1 10001E+2 -2E+1 -> 1.001E+6 Inexact Rounded
-precision: 3
-fmax31675 fma 1 10001E+2 -2E+1 -> 1.01E+6 Inexact Rounded
-precision: 2
-fmax31676 fma 1 10001E+2 -2E+1 -> 1.1E+6 Inexact Rounded
-precision: 1
-fmax31677 fma 1 10001E+2 -2E+1 -> 2E+6 Inexact Rounded
-
-precision: 34
-rounding: half_up
-maxExponent: 6144
-minExponent: -6143
--- Examples from SQL proposal (Krishna Kulkarni)
-fmax31701 fma 1 130E-2 120E-2 -> 2.50
-fmax31702 fma 1 130E-2 12E-1 -> 2.50
-fmax31703 fma 1 130E-2 1E0 -> 2.30
-fmax31704 fma 1 1E2 1E4 -> 1.01E+4
-fmax31705 subtract 130E-2 120E-2 -> 0.10
-fmax31706 subtract 130E-2 12E-1 -> 0.10
-fmax31707 subtract 130E-2 1E0 -> 0.30
-fmax31708 subtract 1E2 1E4 -> -9.9E+3
-
-------------------------------------------------------------------------
--- Same as above, using decimal64 default parameters --
-------------------------------------------------------------------------
-precision: 16
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- [first group are 'quick confidence check']
-fmax36001 fma 1 1 1 -> 2
-fmax36002 fma 1 2 3 -> 5
-fmax36003 fma 1 '5.75' '3.3' -> 9.05
-fmax36004 fma 1 '5' '-3' -> 2
-fmax36005 fma 1 '-5' '-3' -> -8
-fmax36006 fma 1 '-7' '2.5' -> -4.5
-fmax36007 fma 1 '0.7' '0.3' -> 1.0
-fmax36008 fma 1 '1.25' '1.25' -> 2.50
-fmax36009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
-fmax36010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
-
-fmax36011 fma 1 '0.44444444444444444' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
-fmax36012 fma 1 '0.44444444444444440' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
-fmax36013 fma 1 '0.44444444444444444' '0.55555555555555550' -> '0.9999999999999999' Inexact Rounded
-fmax36014 fma 1 '0.444444444444444449' '0' -> '0.4444444444444444' Inexact Rounded
-fmax36015 fma 1 '0.4444444444444444499' '0' -> '0.4444444444444444' Inexact Rounded
-fmax36016 fma 1 '0.44444444444444444999' '0' -> '0.4444444444444444' Inexact Rounded
-fmax36017 fma 1 '0.44444444444444445000' '0' -> '0.4444444444444444' Inexact Rounded
-fmax36018 fma 1 '0.44444444444444445001' '0' -> '0.4444444444444445' Inexact Rounded
-fmax36019 fma 1 '0.4444444444444444501' '0' -> '0.4444444444444445' Inexact Rounded
-fmax36020 fma 1 '0.444444444444444451' '0' -> '0.4444444444444445' Inexact Rounded
-
-fmax36021 fma 1 0 1 -> 1
-fmax36022 fma 1 1 1 -> 2
-fmax36023 fma 1 2 1 -> 3
-fmax36024 fma 1 3 1 -> 4
-fmax36025 fma 1 4 1 -> 5
-fmax36026 fma 1 5 1 -> 6
-fmax36027 fma 1 6 1 -> 7
-fmax36028 fma 1 7 1 -> 8
-fmax36029 fma 1 8 1 -> 9
-fmax36030 fma 1 9 1 -> 10
-
--- some carrying effects
-fmax36031 fma 1 '0.9998' '0.0000' -> '0.9998'
-fmax36032 fma 1 '0.9998' '0.0001' -> '0.9999'
-fmax36033 fma 1 '0.9998' '0.0002' -> '1.0000'
-fmax36034 fma 1 '0.9998' '0.0003' -> '1.0001'
-
-fmax36035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-fmax36036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-fmax36037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
-fmax36038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
-fmax36039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
-
--- symmetry:
-fmax36040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
-fmax36041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
-fmax36042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
-fmax36044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
-fmax36045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
-
-fmax36046 fma 1 '10000e+9' '7' -> '10000000000007'
-fmax36047 fma 1 '10000e+9' '70' -> '10000000000070'
-fmax36048 fma 1 '10000e+9' '700' -> '10000000000700'
-fmax36049 fma 1 '10000e+9' '7000' -> '10000000007000'
-fmax36050 fma 1 '10000e+9' '70000' -> '10000000070000'
-fmax36051 fma 1 '10000e+9' '700000' -> '10000000700000'
-
--- examples from decarith
-fmax36053 fma 1 '12' '7.00' -> '19.00'
-fmax36054 fma 1 '1.3' '-1.07' -> '0.23'
-fmax36055 fma 1 '1.3' '-1.30' -> '0.00'
-fmax36056 fma 1 '1.3' '-2.07' -> '-0.77'
-fmax36057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
-
--- from above
-fmax36061 fma 1 1 '0.1' -> '1.1'
-fmax36062 fma 1 1 '0.01' -> '1.01'
-fmax36063 fma 1 1 '0.001' -> '1.001'
-fmax36064 fma 1 1 '0.0001' -> '1.0001'
-fmax36065 fma 1 1 '0.00001' -> '1.00001'
-fmax36066 fma 1 1 '0.000001' -> '1.000001'
-fmax36067 fma 1 1 '0.0000001' -> '1.0000001'
-fmax36068 fma 1 1 '0.00000001' -> '1.00000001'
-
--- some funny zeros [in case of bad signum]
-fmax36070 fma 1 1 0 -> 1
-fmax36071 fma 1 1 0. -> 1
-fmax36072 fma 1 1 .0 -> 1.0
-fmax36073 fma 1 1 0.0 -> 1.0
-fmax36074 fma 1 1 0.00 -> 1.00
-fmax36075 fma 1 0 1 -> 1
-fmax36076 fma 1 0. 1 -> 1
-fmax36077 fma 1 .0 1 -> 1.0
-fmax36078 fma 1 0.0 1 -> 1.0
-fmax36079 fma 1 0.00 1 -> 1.00
-
--- some carries
-fmax36080 fma 1 9999999999999998 1 -> 9999999999999999
-fmax36081 fma 1 9999999999999999 1 -> 1.000000000000000E+16 Rounded
-fmax36082 fma 1 999999999999999 1 -> 1000000000000000
-fmax36083 fma 1 9999999999999 1 -> 10000000000000
-fmax36084 fma 1 99999999999 1 -> 100000000000
-fmax36085 fma 1 999999999 1 -> 1000000000
-fmax36086 fma 1 9999999 1 -> 10000000
-fmax36087 fma 1 99999 1 -> 100000
-fmax36088 fma 1 999 1 -> 1000
-fmax36089 fma 1 9 1 -> 10
-
-
--- more LHS swaps
-fmax36090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
-fmax36091 fma 1 '-56267E-6' 0 -> '-0.056267'
-fmax36092 fma 1 '-56267E-5' 0 -> '-0.56267'
-fmax36093 fma 1 '-56267E-4' 0 -> '-5.6267'
-fmax36094 fma 1 '-56267E-3' 0 -> '-56.267'
-fmax36095 fma 1 '-56267E-2' 0 -> '-562.67'
-fmax36096 fma 1 '-56267E-1' 0 -> '-5626.7'
-fmax36097 fma 1 '-56267E-0' 0 -> '-56267'
-fmax36098 fma 1 '-5E-10' 0 -> '-5E-10'
-fmax36099 fma 1 '-5E-7' 0 -> '-5E-7'
-fmax36100 fma 1 '-5E-6' 0 -> '-0.000005'
-fmax36101 fma 1 '-5E-5' 0 -> '-0.00005'
-fmax36102 fma 1 '-5E-4' 0 -> '-0.0005'
-fmax36103 fma 1 '-5E-1' 0 -> '-0.5'
-fmax36104 fma 1 '-5E0' 0 -> '-5'
-fmax36105 fma 1 '-5E1' 0 -> '-50'
-fmax36106 fma 1 '-5E5' 0 -> '-500000'
-fmax36107 fma 1 '-5E15' 0 -> '-5000000000000000'
-fmax36108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded
-fmax36109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded
-fmax36110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded
-fmax36111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded
-
--- more RHS swaps
-fmax36113 fma 1 0 '-56267E-10' -> '-0.0000056267'
-fmax36114 fma 1 0 '-56267E-6' -> '-0.056267'
-fmax36116 fma 1 0 '-56267E-5' -> '-0.56267'
-fmax36117 fma 1 0 '-56267E-4' -> '-5.6267'
-fmax36119 fma 1 0 '-56267E-3' -> '-56.267'
-fmax36120 fma 1 0 '-56267E-2' -> '-562.67'
-fmax36121 fma 1 0 '-56267E-1' -> '-5626.7'
-fmax36122 fma 1 0 '-56267E-0' -> '-56267'
-fmax36123 fma 1 0 '-5E-10' -> '-5E-10'
-fmax36124 fma 1 0 '-5E-7' -> '-5E-7'
-fmax36125 fma 1 0 '-5E-6' -> '-0.000005'
-fmax36126 fma 1 0 '-5E-5' -> '-0.00005'
-fmax36127 fma 1 0 '-5E-4' -> '-0.0005'
-fmax36128 fma 1 0 '-5E-1' -> '-0.5'
-fmax36129 fma 1 0 '-5E0' -> '-5'
-fmax36130 fma 1 0 '-5E1' -> '-50'
-fmax36131 fma 1 0 '-5E5' -> '-500000'
-fmax36132 fma 1 0 '-5E15' -> '-5000000000000000'
-fmax36133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded
-fmax36134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded
-fmax36135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded
-fmax36136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded
-
--- related
-fmax36137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded
-fmax36138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded
-fmax36139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded
-fmax36140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded
-fmax36141 fma 1 1E+11 0.0000 -> '100000000000.0000'
-fmax36142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded
-fmax36143 fma 1 0.000 1E+12 -> '1000000000000.000'
-fmax36144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded
-
--- [some of the next group are really constructor tests]
-fmax36146 fma 1 '00.0' 0 -> '0.0'
-fmax36147 fma 1 '0.00' 0 -> '0.00'
-fmax36148 fma 1 0 '0.00' -> '0.00'
-fmax36149 fma 1 0 '00.0' -> '0.0'
-fmax36150 fma 1 '00.0' '0.00' -> '0.00'
-fmax36151 fma 1 '0.00' '00.0' -> '0.00'
-fmax36152 fma 1 '3' '.3' -> '3.3'
-fmax36153 fma 1 '3.' '.3' -> '3.3'
-fmax36154 fma 1 '3.0' '.3' -> '3.3'
-fmax36155 fma 1 '3.00' '.3' -> '3.30'
-fmax36156 fma 1 '3' '3' -> '6'
-fmax36157 fma 1 '3' '+3' -> '6'
-fmax36158 fma 1 '3' '-3' -> '0'
-fmax36159 fma 1 '0.3' '-0.3' -> '0.0'
-fmax36160 fma 1 '0.03' '-0.03' -> '0.00'
-
--- try borderline precision, with carries, etc.
-fmax36161 fma 1 '1E+13' '-1' -> '9999999999999'
-fmax36162 fma 1 '1E+13' '1.11' -> '10000000000001.11'
-fmax36163 fma 1 '1.11' '1E+13' -> '10000000000001.11'
-fmax36164 fma 1 '-1' '1E+13' -> '9999999999999'
-fmax36165 fma 1 '7E+13' '-1' -> '69999999999999'
-fmax36166 fma 1 '7E+13' '1.11' -> '70000000000001.11'
-fmax36167 fma 1 '1.11' '7E+13' -> '70000000000001.11'
-fmax36168 fma 1 '-1' '7E+13' -> '69999999999999'
-
--- 1234567890123456 1234567890123456 1 234567890123456
-fmax36170 fma 1 '0.4444444444444444' '0.5555555555555563' -> '1.000000000000001' Inexact Rounded
-fmax36171 fma 1 '0.4444444444444444' '0.5555555555555562' -> '1.000000000000001' Inexact Rounded
-fmax36172 fma 1 '0.4444444444444444' '0.5555555555555561' -> '1.000000000000000' Inexact Rounded
-fmax36173 fma 1 '0.4444444444444444' '0.5555555555555560' -> '1.000000000000000' Inexact Rounded
-fmax36174 fma 1 '0.4444444444444444' '0.5555555555555559' -> '1.000000000000000' Inexact Rounded
-fmax36175 fma 1 '0.4444444444444444' '0.5555555555555558' -> '1.000000000000000' Inexact Rounded
-fmax36176 fma 1 '0.4444444444444444' '0.5555555555555557' -> '1.000000000000000' Inexact Rounded
-fmax36177 fma 1 '0.4444444444444444' '0.5555555555555556' -> '1.000000000000000' Rounded
-fmax36178 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
-fmax36179 fma 1 '0.4444444444444444' '0.5555555555555554' -> '0.9999999999999998'
-fmax36180 fma 1 '0.4444444444444444' '0.5555555555555553' -> '0.9999999999999997'
-fmax36181 fma 1 '0.4444444444444444' '0.5555555555555552' -> '0.9999999999999996'
-fmax36182 fma 1 '0.4444444444444444' '0.5555555555555551' -> '0.9999999999999995'
-fmax36183 fma 1 '0.4444444444444444' '0.5555555555555550' -> '0.9999999999999994'
-
--- and some more, including residue effects and different roundings
-rounding: half_up
-fmax36200 fma 1 '6543210123456789' 0 -> '6543210123456789'
-fmax36201 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-fmax36202 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-fmax36203 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-fmax36204 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-fmax36205 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-fmax36206 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36207 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36208 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-fmax36209 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-fmax36210 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-fmax36211 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-fmax36212 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-fmax36213 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-fmax36214 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-fmax36215 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded
-fmax36216 fma 1 '6543210123456789' 1 -> '6543210123456790'
-fmax36217 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
-fmax36218 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-fmax36219 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
-rounding: half_even
-fmax36220 fma 1 '6543210123456789' 0 -> '6543210123456789'
-fmax36221 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-fmax36222 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-fmax36223 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-fmax36224 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-fmax36225 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-fmax36226 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36227 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36228 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
-fmax36229 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
-fmax36230 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
-fmax36231 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
-fmax36232 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
-fmax36233 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
-fmax36234 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
-fmax36235 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded
-fmax36236 fma 1 '6543210123456789' 1 -> '6543210123456790'
-fmax36237 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-fmax36238 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-fmax36239 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
--- critical few with even bottom digit...
-fmax36240 fma 1 '6543210123456788' 0.499999 -> '6543210123456788' Inexact Rounded
-fmax36241 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
-fmax36242 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
-
-rounding: down
-fmax36250 fma 1 '6543210123456789' 0 -> '6543210123456789'
-fmax36251 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
-fmax36252 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
-fmax36253 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
-fmax36254 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
-fmax36255 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
-fmax36256 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36257 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
-fmax36258 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
-fmax36259 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
-fmax36260 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
-fmax36261 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
-fmax36262 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
-fmax36263 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
-fmax36264 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
-fmax36265 fma 1 '6543210123456789' 0.999999 -> '6543210123456789' Inexact Rounded
-fmax36266 fma 1 '6543210123456789' 1 -> '6543210123456790'
-fmax36267 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
-fmax36268 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
-fmax36269 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
-
--- 1 in last place tests
-rounding: half_even
-fmax36301 fma 1 -1 1 -> 0
-fmax36302 fma 1 0 1 -> 1
-fmax36303 fma 1 1 1 -> 2
-fmax36304 fma 1 12 1 -> 13
-fmax36305 fma 1 98 1 -> 99
-fmax36306 fma 1 99 1 -> 100
-fmax36307 fma 1 100 1 -> 101
-fmax36308 fma 1 101 1 -> 102
-fmax36309 fma 1 -1 -1 -> -2
-fmax36310 fma 1 0 -1 -> -1
-fmax36311 fma 1 1 -1 -> 0
-fmax36312 fma 1 12 -1 -> 11
-fmax36313 fma 1 98 -1 -> 97
-fmax36314 fma 1 99 -1 -> 98
-fmax36315 fma 1 100 -1 -> 99
-fmax36316 fma 1 101 -1 -> 100
-
-fmax36321 fma 1 -0.01 0.01 -> 0.00
-fmax36322 fma 1 0.00 0.01 -> 0.01
-fmax36323 fma 1 0.01 0.01 -> 0.02
-fmax36324 fma 1 0.12 0.01 -> 0.13
-fmax36325 fma 1 0.98 0.01 -> 0.99
-fmax36326 fma 1 0.99 0.01 -> 1.00
-fmax36327 fma 1 1.00 0.01 -> 1.01
-fmax36328 fma 1 1.01 0.01 -> 1.02
-fmax36329 fma 1 -0.01 -0.01 -> -0.02
-fmax36330 fma 1 0.00 -0.01 -> -0.01
-fmax36331 fma 1 0.01 -0.01 -> 0.00
-fmax36332 fma 1 0.12 -0.01 -> 0.11
-fmax36333 fma 1 0.98 -0.01 -> 0.97
-fmax36334 fma 1 0.99 -0.01 -> 0.98
-fmax36335 fma 1 1.00 -0.01 -> 0.99
-fmax36336 fma 1 1.01 -0.01 -> 1.00
-
--- some more cases where fma 1 ing 0 affects the coefficient
-fmax36340 fma 1 1E+3 0 -> 1000
-fmax36341 fma 1 1E+15 0 -> 1000000000000000
-fmax36342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded
-fmax36343 fma 1 1E+17 0 -> 1.000000000000000E+17 Rounded
--- which simply follow from these cases ...
-fmax36344 fma 1 1E+3 1 -> 1001
-fmax36345 fma 1 1E+15 1 -> 1000000000000001
-fmax36346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
-fmax36347 fma 1 1E+17 1 -> 1.000000000000000E+17 Inexact Rounded
-fmax36348 fma 1 1E+3 7 -> 1007
-fmax36349 fma 1 1E+15 7 -> 1000000000000007
-fmax36350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
-fmax36351 fma 1 1E+17 7 -> 1.000000000000000E+17 Inexact Rounded
-
--- tryzeros cases
-fmax36361 fma 1 0E+50 10000E+1 -> 1.0000E+5
-fmax36362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded
-fmax36363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
-fmax36364 fma 1 12.34 0e-398 -> 12.34000000000000 Rounded
-
--- ulp replacement tests
-fmax36400 fma 1 1 77e-14 -> 1.00000000000077
-fmax36401 fma 1 1 77e-15 -> 1.000000000000077
-fmax36402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded
-fmax36403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded
-fmax36404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded
-fmax36405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded
-fmax36406 fma 1 1 77e-99 -> 1.000000000000000 Inexact Rounded
-
-fmax36410 fma 1 10 77e-14 -> 10.00000000000077
-fmax36411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded
-fmax36412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded
-fmax36413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded
-fmax36414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded
-fmax36415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded
-fmax36416 fma 1 10 77e-99 -> 10.00000000000000 Inexact Rounded
-
-fmax36420 fma 1 77e-14 1 -> 1.00000000000077
-fmax36421 fma 1 77e-15 1 -> 1.000000000000077
-fmax36422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded
-fmax36423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded
-fmax36424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded
-fmax36425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded
-fmax36426 fma 1 77e-99 1 -> 1.000000000000000 Inexact Rounded
-
-fmax36430 fma 1 77e-14 10 -> 10.00000000000077
-fmax36431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded
-fmax36432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded
-fmax36433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded
-fmax36434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded
-fmax36435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded
-fmax36436 fma 1 77e-99 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-fmax36440 fma 1 1 -77e-14 -> 0.99999999999923
-fmax36441 fma 1 1 -77e-15 -> 0.999999999999923
-fmax36442 fma 1 1 -77e-16 -> 0.9999999999999923
-fmax36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
-fmax36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
-fmax36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded
-fmax36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded
-
-fmax36450 fma 1 10 -77e-14 -> 9.99999999999923
-fmax36451 fma 1 10 -77e-15 -> 9.999999999999923
-fmax36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded
-fmax36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded
-fmax36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded
-fmax36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded
-fmax36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded
-
-fmax36460 fma 1 -77e-14 1 -> 0.99999999999923
-fmax36461 fma 1 -77e-15 1 -> 0.999999999999923
-fmax36462 fma 1 -77e-16 1 -> 0.9999999999999923
-fmax36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded
-fmax36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded
-fmax36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded
-fmax36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded
-
-fmax36470 fma 1 -77e-14 10 -> 9.99999999999923
-fmax36471 fma 1 -77e-15 10 -> 9.999999999999923
-fmax36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded
-fmax36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded
-fmax36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded
-fmax36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded
-fmax36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded
-
--- negative ulps
-fmax36480 fma 1 -1 77e-14 -> -0.99999999999923
-fmax36481 fma 1 -1 77e-15 -> -0.999999999999923
-fmax36482 fma 1 -1 77e-16 -> -0.9999999999999923
-fmax36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded
-fmax36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded
-fmax36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded
-fmax36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded
-
-fmax36490 fma 1 -10 77e-14 -> -9.99999999999923
-fmax36491 fma 1 -10 77e-15 -> -9.999999999999923
-fmax36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded
-fmax36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded
-fmax36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded
-fmax36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded
-fmax36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded
-
-fmax36500 fma 1 77e-14 -1 -> -0.99999999999923
-fmax36501 fma 1 77e-15 -1 -> -0.999999999999923
-fmax36502 fma 1 77e-16 -1 -> -0.9999999999999923
-fmax36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
-fmax36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
-fmax36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded
-fmax36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded
-
-fmax36510 fma 1 77e-14 -10 -> -9.99999999999923
-fmax36511 fma 1 77e-15 -10 -> -9.999999999999923
-fmax36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded
-fmax36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded
-fmax36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded
-fmax36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded
-fmax36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded
-
-
--- long operands
-fmax36521 fma 1 101234562345678000 0 -> 1.012345623456780E+17 Rounded
-fmax36522 fma 1 0 101234562345678000 -> 1.012345623456780E+17 Rounded
-fmax36523 fma 1 10123456234567800 0 -> 1.012345623456780E+16 Rounded
-fmax36524 fma 1 0 10123456234567800 -> 1.012345623456780E+16 Rounded
-fmax36525 fma 1 10123456234567890 0 -> 1.012345623456789E+16 Rounded
-fmax36526 fma 1 0 10123456234567890 -> 1.012345623456789E+16 Rounded
-fmax36527 fma 1 10123456234567891 0 -> 1.012345623456789E+16 Inexact Rounded
-fmax36528 fma 1 0 10123456234567891 -> 1.012345623456789E+16 Inexact Rounded
-fmax36529 fma 1 101234562345678901 0 -> 1.012345623456789E+17 Inexact Rounded
-fmax36530 fma 1 0 101234562345678901 -> 1.012345623456789E+17 Inexact Rounded
-fmax36531 fma 1 10123456234567896 0 -> 1.012345623456790E+16 Inexact Rounded
-fmax36532 fma 1 0 10123456234567896 -> 1.012345623456790E+16 Inexact Rounded
-
--- verify a query
-rounding: down
-fmax36561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
-fmax36562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
--- and using decimal64 bounds...
-rounding: down
-fmax36563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
-fmax36564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
-
--- more zeros, etc.
-rounding: half_even
-
-fmax36701 fma 1 5.00 1.00E-3 -> 5.00100
-fmax36702 fma 1 00.00 0.000 -> 0.000
-fmax36703 fma 1 00.00 0E-3 -> 0.000
-fmax36704 fma 1 0E-3 00.00 -> 0.000
-
-fmax36710 fma 1 0E+3 00.00 -> 0.00
-fmax36711 fma 1 0E+3 00.0 -> 0.0
-fmax36712 fma 1 0E+3 00. -> 0
-fmax36713 fma 1 0E+3 00.E+1 -> 0E+1
-fmax36714 fma 1 0E+3 00.E+2 -> 0E+2
-fmax36715 fma 1 0E+3 00.E+3 -> 0E+3
-fmax36716 fma 1 0E+3 00.E+4 -> 0E+3
-fmax36717 fma 1 0E+3 00.E+5 -> 0E+3
-fmax36718 fma 1 0E+3 -00.0 -> 0.0
-fmax36719 fma 1 0E+3 -00. -> 0
-fmax36731 fma 1 0E+3 -00.E+1 -> 0E+1
-
-fmax36720 fma 1 00.00 0E+3 -> 0.00
-fmax36721 fma 1 00.0 0E+3 -> 0.0
-fmax36722 fma 1 00. 0E+3 -> 0
-fmax36723 fma 1 00.E+1 0E+3 -> 0E+1
-fmax36724 fma 1 00.E+2 0E+3 -> 0E+2
-fmax36725 fma 1 00.E+3 0E+3 -> 0E+3
-fmax36726 fma 1 00.E+4 0E+3 -> 0E+3
-fmax36727 fma 1 00.E+5 0E+3 -> 0E+3
-fmax36728 fma 1 -00.00 0E+3 -> 0.00
-fmax36729 fma 1 -00.0 0E+3 -> 0.0
-fmax36730 fma 1 -00. 0E+3 -> 0
-
-fmax36732 fma 1 0 0 -> 0
-fmax36733 fma 1 0 -0 -> 0
-fmax36734 fma 1 -0 0 -> 0
-fmax36735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
-
-fmax36736 fma 1 1 -1 -> 0
-fmax36737 fma 1 -1 -1 -> -2
-fmax36738 fma 1 1 1 -> 2
-fmax36739 fma 1 -1 1 -> 0
-
-fmax36741 fma 1 0 -1 -> -1
-fmax36742 fma 1 -0 -1 -> -1
-fmax36743 fma 1 0 1 -> 1
-fmax36744 fma 1 -0 1 -> 1
-fmax36745 fma 1 -1 0 -> -1
-fmax36746 fma 1 -1 -0 -> -1
-fmax36747 fma 1 1 0 -> 1
-fmax36748 fma 1 1 -0 -> 1
-
-fmax36751 fma 1 0.0 -1 -> -1.0
-fmax36752 fma 1 -0.0 -1 -> -1.0
-fmax36753 fma 1 0.0 1 -> 1.0
-fmax36754 fma 1 -0.0 1 -> 1.0
-fmax36755 fma 1 -1.0 0 -> -1.0
-fmax36756 fma 1 -1.0 -0 -> -1.0
-fmax36757 fma 1 1.0 0 -> 1.0
-fmax36758 fma 1 1.0 -0 -> 1.0
-
-fmax36761 fma 1 0 -1.0 -> -1.0
-fmax36762 fma 1 -0 -1.0 -> -1.0
-fmax36763 fma 1 0 1.0 -> 1.0
-fmax36764 fma 1 -0 1.0 -> 1.0
-fmax36765 fma 1 -1 0.0 -> -1.0
-fmax36766 fma 1 -1 -0.0 -> -1.0
-fmax36767 fma 1 1 0.0 -> 1.0
-fmax36768 fma 1 1 -0.0 -> 1.0
-
-fmax36771 fma 1 0.0 -1.0 -> -1.0
-fmax36772 fma 1 -0.0 -1.0 -> -1.0
-fmax36773 fma 1 0.0 1.0 -> 1.0
-fmax36774 fma 1 -0.0 1.0 -> 1.0
-fmax36775 fma 1 -1.0 0.0 -> -1.0
-fmax36776 fma 1 -1.0 -0.0 -> -1.0
-fmax36777 fma 1 1.0 0.0 -> 1.0
-fmax36778 fma 1 1.0 -0.0 -> 1.0
-
--- Specials
-fmax36780 fma 1 -Inf -Inf -> -Infinity
-fmax36781 fma 1 -Inf -1000 -> -Infinity
-fmax36782 fma 1 -Inf -1 -> -Infinity
-fmax36783 fma 1 -Inf -0 -> -Infinity
-fmax36784 fma 1 -Inf 0 -> -Infinity
-fmax36785 fma 1 -Inf 1 -> -Infinity
-fmax36786 fma 1 -Inf 1000 -> -Infinity
-fmax36787 fma 1 -1000 -Inf -> -Infinity
-fmax36788 fma 1 -Inf -Inf -> -Infinity
-fmax36789 fma 1 -1 -Inf -> -Infinity
-fmax36790 fma 1 -0 -Inf -> -Infinity
-fmax36791 fma 1 0 -Inf -> -Infinity
-fmax36792 fma 1 1 -Inf -> -Infinity
-fmax36793 fma 1 1000 -Inf -> -Infinity
-fmax36794 fma 1 Inf -Inf -> NaN Invalid_operation
-
-fmax36800 fma 1 Inf -Inf -> NaN Invalid_operation
-fmax36801 fma 1 Inf -1000 -> Infinity
-fmax36802 fma 1 Inf -1 -> Infinity
-fmax36803 fma 1 Inf -0 -> Infinity
-fmax36804 fma 1 Inf 0 -> Infinity
-fmax36805 fma 1 Inf 1 -> Infinity
-fmax36806 fma 1 Inf 1000 -> Infinity
-fmax36807 fma 1 Inf Inf -> Infinity
-fmax36808 fma 1 -1000 Inf -> Infinity
-fmax36809 fma 1 -Inf Inf -> NaN Invalid_operation
-fmax36810 fma 1 -1 Inf -> Infinity
-fmax36811 fma 1 -0 Inf -> Infinity
-fmax36812 fma 1 0 Inf -> Infinity
-fmax36813 fma 1 1 Inf -> Infinity
-fmax36814 fma 1 1000 Inf -> Infinity
-fmax36815 fma 1 Inf Inf -> Infinity
-
-fmax36821 fma 1 NaN -Inf -> NaN
-fmax36822 fma 1 NaN -1000 -> NaN
-fmax36823 fma 1 NaN -1 -> NaN
-fmax36824 fma 1 NaN -0 -> NaN
-fmax36825 fma 1 NaN 0 -> NaN
-fmax36826 fma 1 NaN 1 -> NaN
-fmax36827 fma 1 NaN 1000 -> NaN
-fmax36828 fma 1 NaN Inf -> NaN
-fmax36829 fma 1 NaN NaN -> NaN
-fmax36830 fma 1 -Inf NaN -> NaN
-fmax36831 fma 1 -1000 NaN -> NaN
-fmax36832 fma 1 -1 NaN -> NaN
-fmax36833 fma 1 -0 NaN -> NaN
-fmax36834 fma 1 0 NaN -> NaN
-fmax36835 fma 1 1 NaN -> NaN
-fmax36836 fma 1 1000 NaN -> NaN
-fmax36837 fma 1 Inf NaN -> NaN
-
-fmax36841 fma 1 sNaN -Inf -> NaN Invalid_operation
-fmax36842 fma 1 sNaN -1000 -> NaN Invalid_operation
-fmax36843 fma 1 sNaN -1 -> NaN Invalid_operation
-fmax36844 fma 1 sNaN -0 -> NaN Invalid_operation
-fmax36845 fma 1 sNaN 0 -> NaN Invalid_operation
-fmax36846 fma 1 sNaN 1 -> NaN Invalid_operation
-fmax36847 fma 1 sNaN 1000 -> NaN Invalid_operation
-fmax36848 fma 1 sNaN NaN -> NaN Invalid_operation
-fmax36849 fma 1 sNaN sNaN -> NaN Invalid_operation
-fmax36850 fma 1 NaN sNaN -> NaN Invalid_operation
-fmax36851 fma 1 -Inf sNaN -> NaN Invalid_operation
-fmax36852 fma 1 -1000 sNaN -> NaN Invalid_operation
-fmax36853 fma 1 -1 sNaN -> NaN Invalid_operation
-fmax36854 fma 1 -0 sNaN -> NaN Invalid_operation
-fmax36855 fma 1 0 sNaN -> NaN Invalid_operation
-fmax36856 fma 1 1 sNaN -> NaN Invalid_operation
-fmax36857 fma 1 1000 sNaN -> NaN Invalid_operation
-fmax36858 fma 1 Inf sNaN -> NaN Invalid_operation
-fmax36859 fma 1 NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-fmax36861 fma 1 NaN1 -Inf -> NaN1
-fmax36862 fma 1 +NaN2 -1000 -> NaN2
-fmax36863 fma 1 NaN3 1000 -> NaN3
-fmax36864 fma 1 NaN4 Inf -> NaN4
-fmax36865 fma 1 NaN5 +NaN6 -> NaN5
-fmax36866 fma 1 -Inf NaN7 -> NaN7
-fmax36867 fma 1 -1000 NaN8 -> NaN8
-fmax36868 fma 1 1000 NaN9 -> NaN9
-fmax36869 fma 1 Inf +NaN10 -> NaN10
-fmax36871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
-fmax36872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
-fmax36873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
-fmax36874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
-fmax36875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
-fmax36876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
-fmax36877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
-fmax36878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
-fmax36879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
-fmax36880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
-fmax36881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
-fmax36882 fma 1 -NaN26 NaN28 -> -NaN26
-fmax36883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-fmax36884 fma 1 1000 -NaN30 -> -NaN30
-fmax36885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- now the case where we can get underflow but the result is normal
--- [note this can't happen if the operands are also bounded, as we
--- cannot represent 1E-399, for example]
-
-fmax36571 fma 1 1E-383 0 -> 1E-383
-fmax36572 fma 1 1E-384 0 -> 1E-384 Subnormal
-fmax36573 fma 1 1E-383 1E-384 -> 1.1E-383
-fmax36574 subtract 1E-383 1E-384 -> 9E-384 Subnormal
-
--- Here we explore the boundary of rounding a subnormal to Nmin
-fmax36575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
-fmax36576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
-fmax36577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax36578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax36579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-fmax36580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
-
--- check overflow edge case
--- 1234567890123456
-fmax36972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
-fmax36973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
-fmax36974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
-fmax36975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
-fmax36976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
-fmax36977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
-fmax36978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
-fmax36979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
-fmax36980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
-fmax36981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
-fmax36982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
-fmax36983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
-fmax36984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
-
-fmax36985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
-fmax36986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
-fmax36987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
-fmax36988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
-fmax36989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
-fmax36990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
-fmax36991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
-fmax36992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
-fmax36993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
-fmax36994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
-fmax36995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
-fmax36996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
-fmax36997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
-
--- And for round down full and subnormal results
-rounding: down
-fmax361100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
-fmax361101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
-fmax361103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
-fmax361104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
-fmax361105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
-fmax361106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
-fmax361107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
-fmax361108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
-fmax361109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
-
-rounding: ceiling
-fmax361110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
-fmax361111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
-fmax361113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
-fmax361114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
-fmax361115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
-fmax361116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
-fmax361117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
-fmax361118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
-fmax361119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
-
--- tests based on Gunnar Degnbol's edge case
-rounding: half_even
-
-fmax361300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
-fmax361310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
-fmax361311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
-fmax361312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
-fmax361313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
-fmax361314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
-fmax361315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
-fmax361316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
-fmax361317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
-fmax361318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
-fmax361319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
-fmax361320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
-fmax361321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
-fmax361322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
-fmax361323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
-fmax361324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
-fmax361325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
-fmax361339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
-
-fmax361340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
-fmax361341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
-
-fmax361349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
-fmax361350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
-fmax361351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
-fmax361352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
-fmax361353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
-fmax361354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
-fmax361355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
-fmax361356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
-fmax361357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
-fmax361358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
-fmax361359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
-fmax361360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
-fmax361361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
-fmax361362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
-fmax361363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
-fmax361364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
-fmax361365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
-fmax361379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
-fmax361380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
-fmax361381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
-fmax361382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
-fmax361395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
-fmax361396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
-
--- More GD edge cases, where difference between the unadjusted
--- exponents is larger than the maximum precision and one side is 0
-fmax361420 fma 1 0 1.123456789012345 -> 1.123456789012345
-fmax361421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
-fmax361422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
-fmax361423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
-fmax361424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
-fmax361425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
-fmax361426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
-fmax361427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
-fmax361428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
-fmax361429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
-fmax361430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
-fmax361431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
-fmax361432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
-fmax361433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
-fmax361434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
-fmax361435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
-fmax361436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
-fmax361437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
-fmax361438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
-fmax361439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
-
--- same, reversed 0
-fmax361440 fma 1 1.123456789012345 0 -> 1.123456789012345
-fmax361441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
-fmax361442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
-fmax361443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
-fmax361444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
-fmax361445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
-fmax361446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
-fmax361447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
-fmax361448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
-fmax361449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
-fmax361450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
-fmax361451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
-fmax361452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
-fmax361453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
-fmax361454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
-fmax361455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
-fmax361456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
-fmax361457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
-fmax361458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
-fmax361459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
-
--- same, Es on the 0
-fmax361460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
-fmax361461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
-fmax361462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
-fmax361463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
-fmax361464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
-fmax361465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
-fmax361466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
-fmax361467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
-fmax361468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
-fmax361469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
-fmax361470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
-fmax361471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
-fmax361472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
-fmax361473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
-fmax361474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
-fmax361475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
--- next four flag Rounded because the 0 extends the result
-fmax361476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
-fmax361477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
-fmax361478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
-fmax361479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
-
--- sum of two opposite-sign operands is exactly 0 and floor => -0
-rounding: half_up
--- exact zeros from zeros
-fmax361500 fma 1 0 0E-19 -> 0E-19
-fmax361501 fma 1 -0 0E-19 -> 0E-19
-fmax361502 fma 1 0 -0E-19 -> 0E-19
-fmax361503 fma 1 -0 -0E-19 -> -0E-19
-fmax361504 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: half_down
--- exact zeros from zeros
-fmax361520 fma 1 0 0E-19 -> 0E-19
-fmax361521 fma 1 -0 0E-19 -> 0E-19
-fmax361522 fma 1 0 -0E-19 -> 0E-19
-fmax361523 fma 1 -0 -0E-19 -> -0E-19
-fmax361524 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: half_even
--- exact zeros from zeros
-fmax361540 fma 1 0 0E-19 -> 0E-19
-fmax361541 fma 1 -0 0E-19 -> 0E-19
-fmax361542 fma 1 0 -0E-19 -> 0E-19
-fmax361543 fma 1 -0 -0E-19 -> -0E-19
-fmax361544 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: up
--- exact zeros from zeros
-fmax361560 fma 1 0 0E-19 -> 0E-19
-fmax361561 fma 1 -0 0E-19 -> 0E-19
-fmax361562 fma 1 0 -0E-19 -> 0E-19
-fmax361563 fma 1 -0 -0E-19 -> -0E-19
-fmax361564 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
-fmax361574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
--- some exact zeros from non-zeros
-fmax361575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
-
-rounding: down
--- exact zeros from zeros
-fmax361580 fma 1 0 0E-19 -> 0E-19
-fmax361581 fma 1 -0 0E-19 -> 0E-19
-fmax361582 fma 1 0 -0E-19 -> 0E-19
-fmax361583 fma 1 -0 -0E-19 -> -0E-19
-fmax361584 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
-rounding: ceiling
--- exact zeros from zeros
-fmax361600 fma 1 0 0E-19 -> 0E-19
-fmax361601 fma 1 -0 0E-19 -> 0E-19
-fmax361602 fma 1 0 -0E-19 -> 0E-19
-fmax361603 fma 1 -0 -0E-19 -> -0E-19
-fmax361604 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
-fmax361606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
-fmax361607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
--- some exact zeros from non-zeros
-fmax361615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
-fmax361616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
-fmax361617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
-fmax361618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
-
--- and the extra-special ugly case; unusual minuses marked by -- *
-rounding: floor
--- exact zeros from zeros
-fmax361620 fma 1 0 0E-19 -> 0E-19
-fmax361621 fma 1 -0 0E-19 -> -0E-19 -- *
-fmax361622 fma 1 0 -0E-19 -> -0E-19 -- *
-fmax361623 fma 1 -0 -0E-19 -> -0E-19
-fmax361624 fma 1 0E-400 0E-19 -> 0E-398 Clamped
-fmax361625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- *
-fmax361626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- *
-fmax361627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
--- inexact zeros
-fmax361631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
-fmax361634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
--- some exact zeros from non-zeros
-fmax361635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
-fmax361636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- *
-fmax361637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- *
-fmax361638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
-
--- Examples from SQL proposal (Krishna Kulkarni)
-fmax361701 fma 1 130E-2 120E-2 -> 2.50
-fmax361702 fma 1 130E-2 12E-1 -> 2.50
-fmax361703 fma 1 130E-2 1E0 -> 2.30
-fmax361704 fma 1 1E2 1E4 -> 1.01E+4
-fmax361705 subtract 130E-2 120E-2 -> 0.10
-fmax361706 subtract 130E-2 12E-1 -> 0.10
-fmax361707 subtract 130E-2 1E0 -> 0.30
-fmax361708 subtract 1E2 1E4 -> -9.9E+3
-
--- Gappy coefficients; check residue handling even with full coefficient gap
-rounding: half_even
-
-fmax362001 fma 1 1234567890123456 1 -> 1234567890123457
-fmax362002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
-fmax362003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
-fmax362004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
-fmax362005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
-fmax362006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
-fmax362007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
-fmax362008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
-fmax362009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
-fmax362010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
-fmax362011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
-fmax362012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
-fmax362013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
-fmax362014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
-fmax362015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
-fmax362016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
-fmax362017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
-fmax362018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
-fmax362019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
-fmax362020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
-fmax362021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
-
--- widening second argument at gap
-fmax362030 fma 1 12345678 1 -> 12345679
-fmax362031 fma 1 12345678 0.1 -> 12345678.1
-fmax362032 fma 1 12345678 0.12 -> 12345678.12
-fmax362033 fma 1 12345678 0.123 -> 12345678.123
-fmax362034 fma 1 12345678 0.1234 -> 12345678.1234
-fmax362035 fma 1 12345678 0.12345 -> 12345678.12345
-fmax362036 fma 1 12345678 0.123456 -> 12345678.123456
-fmax362037 fma 1 12345678 0.1234567 -> 12345678.1234567
-fmax362038 fma 1 12345678 0.12345678 -> 12345678.12345678
-fmax362039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
-fmax362040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
-fmax362041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
-fmax362042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
-fmax362043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
-fmax362044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
-fmax362045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
-fmax362046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
-fmax362047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
-fmax362048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
-fmax362049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
--- 90123456
-rounding: half_even
-fmax362050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
-fmax362051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
-fmax362052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
-fmax362053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
-fmax362054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
-fmax362055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
-fmax362056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
-fmax362057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
-fmax362060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
-fmax362061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
-fmax362062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
-fmax362063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
-fmax362064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
-fmax362065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
-fmax362066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
-fmax362067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
--- far-out residues (full coefficient gap is 16+15 digits)
-rounding: up
-fmax362070 fma 1 12345678 1E-8 -> 12345678.00000001
-fmax362071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
-fmax362072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
-fmax362073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
-fmax362074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
-fmax362075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
-fmax362076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
-fmax362077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
-fmax362078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
-fmax362079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
-fmax362080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
-fmax362081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
-fmax362082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
-fmax362083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
-fmax362084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
-fmax362085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
-fmax362086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
-fmax362087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
-fmax362088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
-fmax362089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
-
--- payload decapitate x3
-precision: 5
-fmax363000 fma 1 1 sNaN1234567890 -> NaN67890 Invalid_operation
-fmax363001 fma 1 -sNaN1234512345 1 -> -NaN12345 Invalid_operation
-fmax363002 fma sNaN1234554321 1 1 -> NaN54321 Invalid_operation
-
--- Null tests
-fmax39990 fma 1 10 # -> NaN Invalid_operation
-fmax39991 fma 1 # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- fma.decTest -- decimal fused multiply add --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- These tests comprese three parts:
+-- 1. Sanity checks and other three-operand tests (especially those
+-- where the fused operation makes a difference)
+-- 2. Multiply tests (third operand is neutral zero [0E+emax])
+-- 3. Addition tests (first operand is 1)
+-- The multiply and addition tests are extensive because FMA may have
+-- its own dedicated multiplication or addition routine(s), and they
+-- also inherently check the left-to-right properties.
+
+-- Sanity checks
+fmax0001 fma 1 1 1 -> 2
+fmax0002 fma 1 1 2 -> 3
+fmax0003 fma 2 2 3 -> 7
+fmax0004 fma 9 9 9 -> 90
+fmax0005 fma -1 1 1 -> 0
+fmax0006 fma -1 1 2 -> 1
+fmax0007 fma -2 2 3 -> -1
+fmax0008 fma -9 9 9 -> -72
+fmax0011 fma 1 -1 1 -> 0
+fmax0012 fma 1 -1 2 -> 1
+fmax0013 fma 2 -2 3 -> -1
+fmax0014 fma 9 -9 9 -> -72
+fmax0015 fma 1 1 -1 -> 0
+fmax0016 fma 1 1 -2 -> -1
+fmax0017 fma 2 2 -3 -> 1
+fmax0018 fma 9 9 -9 -> 72
+fmax0019 fma 3 5 7 -> 22
+fmax0029 fma 3 -5 7 -> -8
+
+-- non-integer exacts
+fma0100 fma 25.2 63.6 -438 -> 1164.72
+fma0101 fma 0.301 0.380 334 -> 334.114380
+fma0102 fma 49.2 -4.8 23.3 -> -212.86
+fma0103 fma 4.22 0.079 -94.6 -> -94.26662
+fma0104 fma 903 0.797 0.887 -> 720.578
+fma0105 fma 6.13 -161 65.9 -> -921.03
+fma0106 fma 28.2 727 5.45 -> 20506.85
+fma0107 fma 4 605 688 -> 3108
+fma0108 fma 93.3 0.19 0.226 -> 17.953
+fma0109 fma 0.169 -341 5.61 -> -52.019
+fma0110 fma -72.2 30 -51.2 -> -2217.2
+fma0111 fma -0.409 13 20.4 -> 15.083
+fma0112 fma 317 77.0 19.0 -> 24428.0
+fma0113 fma 47 6.58 1.62 -> 310.88
+fma0114 fma 1.36 0.984 0.493 -> 1.83124
+fma0115 fma 72.7 274 1.56 -> 19921.36
+fma0116 fma 335 847 83 -> 283828
+fma0117 fma 666 0.247 25.4 -> 189.902
+fma0118 fma -3.87 3.06 78.0 -> 66.1578
+fma0119 fma 0.742 192 35.6 -> 178.064
+fma0120 fma -91.6 5.29 0.153 -> -484.411
+
+-- cases where result is different from separate multiply + add; each
+-- is preceded by the result of unfused multiply and add
+-- [this is about 20% of all similar cases in general]
+-- 888565290 1557.96930 -86087.7578 -> 1.38435735E+12
+fma0201 fma 888565290 1557.96930 -86087.7578 -> 1.38435736E+12 Inexact Rounded
+-- -85519342.9 735155419 42010431 -> -6.28700084E+16
+fma0205 fma -85519342.9 735155419 42010431 -> -6.28700083E+16 Inexact Rounded
+-- -98025.5 -294603.472 10414348.2 -> 2.88890669E+10
+fma0208 fma -98025.5 -294603.472 10414348.2 -> 2.88890670E+10 Inexact Rounded
+-- 5967627.39 83526540.6 498494.810 -> 4.98455271E+14
+fma0211 fma 5967627.39 83526540.6 498494.810 -> 4.98455272E+14 Inexact Rounded
+-- 3456.9433 874.39518 197866.615 -> 3220601.18
+fma0216 fma 3456.9433 874.39518 197866.615 -> 3220601.17 Inexact Rounded
+-- 62769.8287 2096.98927 48.420317 -> 131627705
+fma0218 fma 62769.8287 2096.98927 48.420317 -> 131627706 Inexact Rounded
+-- -68.81500 59961113.9 -8988862 -> -4.13521291E+9
+fma0219 fma -68.81500 59961113.9 -8988862 -> -4.13521292E+9 Inexact Rounded
+-- 2126341.02 63491.5152 302427455 -> 1.35307040E+11
+fma0226 fma 2126341.02 63491.5152 302427455 -> 1.35307041E+11 Inexact Rounded
+
+
+-- Infinite combinations
+fmax0800 fma Inf Inf Inf -> Infinity
+fmax0801 fma Inf Inf -Inf -> NaN Invalid_operation
+fmax0802 fma Inf -Inf Inf -> NaN Invalid_operation
+fmax0803 fma Inf -Inf -Inf -> -Infinity
+fmax0804 fma -Inf Inf Inf -> NaN Invalid_operation
+fmax0805 fma -Inf Inf -Inf -> -Infinity
+fmax0806 fma -Inf -Inf Inf -> Infinity
+fmax0807 fma -Inf -Inf -Inf -> NaN Invalid_operation
+fmax0808 fma -Inf 0 1 -> NaN Invalid_operation
+fmax0809 fma -Inf 0 NaN -> NaN Invalid_operation
+
+-- Triple NaN propagation
+fmax0900 fma NaN2 NaN3 NaN5 -> NaN2
+fmax0901 fma 0 NaN3 NaN5 -> NaN3
+fmax0902 fma 0 0 NaN5 -> NaN5
+-- first sNaN wins (consider qNaN from earlier sNaN being
+-- overridden by an sNaN in third operand)
+fmax0903 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+fmax0904 fma 0 sNaN2 sNaN3 -> NaN2 Invalid_operation
+fmax0905 fma 0 0 sNaN3 -> NaN3 Invalid_operation
+fmax0906 fma sNaN1 sNaN2 sNaN3 -> NaN1 Invalid_operation
+fmax0907 fma NaN7 sNaN2 sNaN3 -> NaN2 Invalid_operation
+fmax0908 fma NaN7 NaN5 sNaN3 -> NaN3 Invalid_operation
+
+-- MULTIPLICATION TESTS ------------------------------------------------
+-- sanity checks (as base, above)
+fmax2000 fma 2 2 0E+999999 -> 4
+fmax2001 fma 2 3 0E+999999 -> 6
+fmax2002 fma 5 1 0E+999999 -> 5
+fmax2003 fma 5 2 0E+999999 -> 10
+fmax2004 fma 1.20 2 0E+999999 -> 2.40
+fmax2005 fma 1.20 0 0E+999999 -> 0.00
+fmax2006 fma 1.20 -2 0E+999999 -> -2.40
+fmax2007 fma -1.20 2 0E+999999 -> -2.40
+fmax2008 fma -1.20 0 0E+999999 -> 0.00
+fmax2009 fma -1.20 -2 0E+999999 -> 2.40
+fmax2010 fma 5.09 7.1 0E+999999 -> 36.139
+fmax2011 fma 2.5 4 0E+999999 -> 10.0
+fmax2012 fma 2.50 4 0E+999999 -> 10.00
+fmax2013 fma 1.23456789 1.00000000 0E+999999 -> 1.23456789 Rounded
+fmax2014 fma 9.999999999 9.999999999 0E+999999 -> 100.000000 Inexact Rounded
+fmax2015 fma 2.50 4 0E+999999 -> 10.00
+precision: 6
+fmax2016 fma 2.50 4 0E+999999 -> 10.00
+fmax2017 fma 9.999999 9.999999 0E+999999 -> 100.000 Inexact Rounded
+fmax2018 fma 9.999999 -9.999999 0E+999999 -> -100.000 Inexact Rounded
+fmax2019 fma -9.999999 9.999999 0E+999999 -> -100.000 Inexact Rounded
+fmax2020 fma -9.999999 -9.999999 0E+999999 -> 100.000 Inexact Rounded
+
+-- 1999.12.21: next one is a edge case if intermediate longs are used
+precision: 15
+fmax2059 fma 999999999999 9765625 0E+999999 -> 9.76562499999023E+18 Inexact Rounded
+precision: 30
+fmax2160 fma 999999999999 9765625 0E+999999 -> 9765624999990234375
+precision: 9
+-----
+
+-- zeros, etc.
+fmax2021 fma 0 0 0E+999999 -> 0
+fmax2022 fma 0 -0 0E+999999 -> 0
+fmax2023 fma -0 0 0E+999999 -> 0
+fmax2024 fma -0 -0 0E+999999 -> 0
+fmax2025 fma -0.0 -0.0 0E+999999 -> 0.00
+fmax2026 fma -0.0 -0.0 0E+999999 -> 0.00
+fmax2027 fma -0.0 -0.0 0E+999999 -> 0.00
+fmax2028 fma -0.0 -0.0 0E+999999 -> 0.00
+fmax2030 fma 5.00 1E-3 0E+999999 -> 0.00500
+fmax2031 fma 00.00 0.000 0E+999999 -> 0.00000
+fmax2032 fma 00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0
+fmax2033 fma 0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0
+fmax2034 fma -5.00 1E-3 0E+999999 -> -0.00500
+fmax2035 fma -00.00 0.000 0E+999999 -> 0.00000
+fmax2036 fma -00.00 0E-3 0E+999999 -> 0.00000 -- rhs is 0
+fmax2037 fma -0E-3 00.00 0E+999999 -> 0.00000 -- lhs is 0
+fmax2038 fma 5.00 -1E-3 0E+999999 -> -0.00500
+fmax2039 fma 00.00 -0.000 0E+999999 -> 0.00000
+fmax2040 fma 00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0
+fmax2041 fma 0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0
+fmax2042 fma -5.00 -1E-3 0E+999999 -> 0.00500
+fmax2043 fma -00.00 -0.000 0E+999999 -> 0.00000
+fmax2044 fma -00.00 -0E-3 0E+999999 -> 0.00000 -- rhs is 0
+fmax2045 fma -0E-3 -00.00 0E+999999 -> 0.00000 -- lhs is 0
+
+-- examples from decarith multiply
+fmax2050 fma 1.20 3 0E+999999 -> 3.60
+fmax2051 fma 7 3 0E+999999 -> 21
+fmax2052 fma 0.9 0.8 0E+999999 -> 0.72
+fmax2053 fma 0.9 -0 0E+999999 -> 0.0
+fmax2054 fma 654321 654321 0E+999999 -> 4.28135971E+11 Inexact Rounded
+
+fmax2060 fma 123.45 1e7 0E+999999 -> 1.2345E+9
+fmax2061 fma 123.45 1e8 0E+999999 -> 1.2345E+10
+fmax2062 fma 123.45 1e+9 0E+999999 -> 1.2345E+11
+fmax2063 fma 123.45 1e10 0E+999999 -> 1.2345E+12
+fmax2064 fma 123.45 1e11 0E+999999 -> 1.2345E+13
+fmax2065 fma 123.45 1e12 0E+999999 -> 1.2345E+14
+fmax2066 fma 123.45 1e13 0E+999999 -> 1.2345E+15
+
+
+-- test some intermediate lengths
+precision: 9
+fmax2080 fma 0.1 123456789 0E+999999 -> 12345678.9
+fmax2081 fma 0.1 1234567891 0E+999999 -> 123456789 Inexact Rounded
+fmax2082 fma 0.1 12345678912 0E+999999 -> 1.23456789E+9 Inexact Rounded
+fmax2083 fma 0.1 12345678912345 0E+999999 -> 1.23456789E+12 Inexact Rounded
+fmax2084 fma 0.1 123456789 0E+999999 -> 12345678.9
+precision: 8
+fmax2085 fma 0.1 12345678912 0E+999999 -> 1.2345679E+9 Inexact Rounded
+fmax2086 fma 0.1 12345678912345 0E+999999 -> 1.2345679E+12 Inexact Rounded
+precision: 7
+fmax2087 fma 0.1 12345678912 0E+999999 -> 1.234568E+9 Inexact Rounded
+fmax2088 fma 0.1 12345678912345 0E+999999 -> 1.234568E+12 Inexact Rounded
+
+precision: 9
+fmax2090 fma 123456789 0.1 0E+999999 -> 12345678.9
+fmax2091 fma 1234567891 0.1 0E+999999 -> 123456789 Inexact Rounded
+fmax2092 fma 12345678912 0.1 0E+999999 -> 1.23456789E+9 Inexact Rounded
+fmax2093 fma 12345678912345 0.1 0E+999999 -> 1.23456789E+12 Inexact Rounded
+fmax2094 fma 123456789 0.1 0E+999999 -> 12345678.9
+precision: 8
+fmax2095 fma 12345678912 0.1 0E+999999 -> 1.2345679E+9 Inexact Rounded
+fmax2096 fma 12345678912345 0.1 0E+999999 -> 1.2345679E+12 Inexact Rounded
+precision: 7
+fmax2097 fma 12345678912 0.1 0E+999999 -> 1.234568E+9 Inexact Rounded
+fmax2098 fma 12345678912345 0.1 0E+999999 -> 1.234568E+12 Inexact Rounded
+
+-- test some more edge cases and carries
+maxexponent: 9999
+minexponent: -9999
+precision: 33
+fmax2101 fma 9 9 0E+999999 -> 81
+fmax2102 fma 9 90 0E+999999 -> 810
+fmax2103 fma 9 900 0E+999999 -> 8100
+fmax2104 fma 9 9000 0E+999999 -> 81000
+fmax2105 fma 9 90000 0E+999999 -> 810000
+fmax2106 fma 9 900000 0E+999999 -> 8100000
+fmax2107 fma 9 9000000 0E+999999 -> 81000000
+fmax2108 fma 9 90000000 0E+999999 -> 810000000
+fmax2109 fma 9 900000000 0E+999999 -> 8100000000
+fmax2110 fma 9 9000000000 0E+999999 -> 81000000000
+fmax2111 fma 9 90000000000 0E+999999 -> 810000000000
+fmax2112 fma 9 900000000000 0E+999999 -> 8100000000000
+fmax2113 fma 9 9000000000000 0E+999999 -> 81000000000000
+fmax2114 fma 9 90000000000000 0E+999999 -> 810000000000000
+fmax2115 fma 9 900000000000000 0E+999999 -> 8100000000000000
+fmax2116 fma 9 9000000000000000 0E+999999 -> 81000000000000000
+fmax2117 fma 9 90000000000000000 0E+999999 -> 810000000000000000
+fmax2118 fma 9 900000000000000000 0E+999999 -> 8100000000000000000
+fmax2119 fma 9 9000000000000000000 0E+999999 -> 81000000000000000000
+fmax2120 fma 9 90000000000000000000 0E+999999 -> 810000000000000000000
+fmax2121 fma 9 900000000000000000000 0E+999999 -> 8100000000000000000000
+fmax2122 fma 9 9000000000000000000000 0E+999999 -> 81000000000000000000000
+fmax2123 fma 9 90000000000000000000000 0E+999999 -> 810000000000000000000000
+-- test some more edge cases without carries
+fmax2131 fma 3 3 0E+999999 -> 9
+fmax2132 fma 3 30 0E+999999 -> 90
+fmax2133 fma 3 300 0E+999999 -> 900
+fmax2134 fma 3 3000 0E+999999 -> 9000
+fmax2135 fma 3 30000 0E+999999 -> 90000
+fmax2136 fma 3 300000 0E+999999 -> 900000
+fmax2137 fma 3 3000000 0E+999999 -> 9000000
+fmax2138 fma 3 30000000 0E+999999 -> 90000000
+fmax2139 fma 3 300000000 0E+999999 -> 900000000
+fmax2140 fma 3 3000000000 0E+999999 -> 9000000000
+fmax2141 fma 3 30000000000 0E+999999 -> 90000000000
+fmax2142 fma 3 300000000000 0E+999999 -> 900000000000
+fmax2143 fma 3 3000000000000 0E+999999 -> 9000000000000
+fmax2144 fma 3 30000000000000 0E+999999 -> 90000000000000
+fmax2145 fma 3 300000000000000 0E+999999 -> 900000000000000
+fmax2146 fma 3 3000000000000000 0E+999999 -> 9000000000000000
+fmax2147 fma 3 30000000000000000 0E+999999 -> 90000000000000000
+fmax2148 fma 3 300000000000000000 0E+999999 -> 900000000000000000
+fmax2149 fma 3 3000000000000000000 0E+999999 -> 9000000000000000000
+fmax2150 fma 3 30000000000000000000 0E+999999 -> 90000000000000000000
+fmax2151 fma 3 300000000000000000000 0E+999999 -> 900000000000000000000
+fmax2152 fma 3 3000000000000000000000 0E+999999 -> 9000000000000000000000
+fmax2153 fma 3 30000000000000000000000 0E+999999 -> 90000000000000000000000
+
+maxexponent: 999999
+minexponent: -999999
+precision: 9
+-- test some cases that are close to exponent overflow/underflow
+fmax2170 fma 1 9e999999 0E+999999 -> 9E+999999
+fmax2171 fma 1 9.9e999999 0E+999999 -> 9.9E+999999
+fmax2172 fma 1 9.99e999999 0E+999999 -> 9.99E+999999
+fmax2173 fma 9e999999 1 0E+999999 -> 9E+999999
+fmax2174 fma 9.9e999999 1 0E+999999 -> 9.9E+999999
+fmax2176 fma 9.99e999999 1 0E+999999 -> 9.99E+999999
+fmax2177 fma 1 9.99999e999999 0E+999999 -> 9.99999E+999999
+fmax2178 fma 9.99999e999999 1 0E+999999 -> 9.99999E+999999
+
+fmax2180 fma 0.1 9e-999998 0E+999999 -> 9E-999999
+fmax2181 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998
+fmax2182 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997
+
+fmax2183 fma 0.1 9e-999998 0E+999999 -> 9E-999999
+fmax2184 fma 0.1 99e-999998 0E+999999 -> 9.9E-999998
+fmax2185 fma 0.1 999e-999998 0E+999999 -> 9.99E-999997
+fmax2186 fma 0.1 999e-999997 0E+999999 -> 9.99E-999996
+fmax2187 fma 0.1 9999e-999997 0E+999999 -> 9.999E-999995
+fmax2188 fma 0.1 99999e-999997 0E+999999 -> 9.9999E-999994
+
+fmax2190 fma 1 9e-999998 0E+999999 -> 9E-999998
+fmax2191 fma 1 99e-999998 0E+999999 -> 9.9E-999997
+fmax2192 fma 1 999e-999998 0E+999999 -> 9.99E-999996
+fmax2193 fma 9e-999998 1 0E+999999 -> 9E-999998
+fmax2194 fma 99e-999998 1 0E+999999 -> 9.9E-999997
+fmax2195 fma 999e-999998 1 0E+999999 -> 9.99E-999996
+
+-- long operand triangle
+precision: 33
+fmax2246 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511992830 Inexact Rounded
+precision: 32
+fmax2247 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199283 Inexact Rounded
+precision: 31
+fmax2248 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165119928 Inexact Rounded
+precision: 30
+fmax2249 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916511993 Inexact Rounded
+precision: 29
+fmax2250 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651199 Inexact Rounded
+precision: 28
+fmax2251 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165120 Inexact Rounded
+precision: 27
+fmax2252 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671916512 Inexact Rounded
+precision: 26
+fmax2253 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967191651 Inexact Rounded
+precision: 25
+fmax2254 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719165 Inexact Rounded
+precision: 24
+fmax2255 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369671917 Inexact Rounded
+precision: 23
+fmax2256 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967192 Inexact Rounded
+precision: 22
+fmax2257 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933696719 Inexact Rounded
+precision: 21
+fmax2258 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193369672 Inexact Rounded
+precision: 20
+fmax2259 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119336967 Inexact Rounded
+precision: 19
+fmax2260 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011933697 Inexact Rounded
+precision: 18
+fmax2261 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193370 Inexact Rounded
+precision: 17
+fmax2262 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119337 Inexact Rounded
+precision: 16
+fmax2263 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908011934 Inexact Rounded
+precision: 15
+fmax2264 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801193 Inexact Rounded
+precision: 14
+fmax2265 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080119 Inexact Rounded
+precision: 13
+fmax2266 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908012 Inexact Rounded
+precision: 12
+fmax2267 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.290801 Inexact Rounded
+precision: 11
+fmax2268 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29080 Inexact Rounded
+precision: 10
+fmax2269 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.2908 Inexact Rounded
+precision: 9
+fmax2270 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.291 Inexact Rounded
+precision: 8
+fmax2271 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.29 Inexact Rounded
+precision: 7
+fmax2272 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433.3 Inexact Rounded
+precision: 6
+fmax2273 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 145433 Inexact Rounded
+precision: 5
+fmax2274 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.4543E+5 Inexact Rounded
+precision: 4
+fmax2275 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.454E+5 Inexact Rounded
+precision: 3
+fmax2276 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.45E+5 Inexact Rounded
+precision: 2
+fmax2277 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1.5E+5 Inexact Rounded
+precision: 1
+fmax2278 fma 30269.587755640502150977251770554 4.8046009735990873395936309640543 0E+999999 -> 1E+5 Inexact Rounded
+
+-- test some edge cases with exact rounding
+maxexponent: 9999
+minexponent: -9999
+precision: 9
+fmax2301 fma 9 9 0E+999999 -> 81
+fmax2302 fma 9 90 0E+999999 -> 810
+fmax2303 fma 9 900 0E+999999 -> 8100
+fmax2304 fma 9 9000 0E+999999 -> 81000
+fmax2305 fma 9 90000 0E+999999 -> 810000
+fmax2306 fma 9 900000 0E+999999 -> 8100000
+fmax2307 fma 9 9000000 0E+999999 -> 81000000
+fmax2308 fma 9 90000000 0E+999999 -> 810000000
+fmax2309 fma 9 900000000 0E+999999 -> 8.10000000E+9 Rounded
+fmax2310 fma 9 9000000000 0E+999999 -> 8.10000000E+10 Rounded
+fmax2311 fma 9 90000000000 0E+999999 -> 8.10000000E+11 Rounded
+fmax2312 fma 9 900000000000 0E+999999 -> 8.10000000E+12 Rounded
+fmax2313 fma 9 9000000000000 0E+999999 -> 8.10000000E+13 Rounded
+fmax2314 fma 9 90000000000000 0E+999999 -> 8.10000000E+14 Rounded
+fmax2315 fma 9 900000000000000 0E+999999 -> 8.10000000E+15 Rounded
+fmax2316 fma 9 9000000000000000 0E+999999 -> 8.10000000E+16 Rounded
+fmax2317 fma 9 90000000000000000 0E+999999 -> 8.10000000E+17 Rounded
+fmax2318 fma 9 900000000000000000 0E+999999 -> 8.10000000E+18 Rounded
+fmax2319 fma 9 9000000000000000000 0E+999999 -> 8.10000000E+19 Rounded
+fmax2320 fma 9 90000000000000000000 0E+999999 -> 8.10000000E+20 Rounded
+fmax2321 fma 9 900000000000000000000 0E+999999 -> 8.10000000E+21 Rounded
+fmax2322 fma 9 9000000000000000000000 0E+999999 -> 8.10000000E+22 Rounded
+fmax2323 fma 9 90000000000000000000000 0E+999999 -> 8.10000000E+23 Rounded
+
+-- fastpath breakers
+precision: 29
+fmax2330 fma 1.491824697641270317824852952837224 1.105170918075647624811707826490246514675628614562883537345747603 0E+999999 -> 1.6487212707001281468486507878 Inexact Rounded
+precision: 55
+fmax2331 fma 0.8958341352965282506768545828765117803873717284891040428 0.8958341352965282506768545828765117803873717284891040428 0E+999999 -> 0.8025187979624784829842553829934069955890983696752228299 Inexact Rounded
+
+
+-- tryzeros cases
+precision: 7
+rounding: half_up
+maxExponent: 92
+minexponent: -92
+fmax2504 fma 0E-60 1000E-60 0E+999999 -> 0E-98 Clamped
+fmax2505 fma 100E+60 0E+60 0E+999999 -> 0E+92 Clamped
+
+-- mixed with zeros
+maxexponent: 999999
+minexponent: -999999
+precision: 9
+fmax2541 fma 0 -1 0E+999999 -> 0
+fmax2542 fma -0 -1 0E+999999 -> 0
+fmax2543 fma 0 1 0E+999999 -> 0
+fmax2544 fma -0 1 0E+999999 -> 0
+fmax2545 fma -1 0 0E+999999 -> 0
+fmax2546 fma -1 -0 0E+999999 -> 0
+fmax2547 fma 1 0 0E+999999 -> 0
+fmax2548 fma 1 -0 0E+999999 -> 0
+
+fmax2551 fma 0.0 -1 0E+999999 -> 0.0
+fmax2552 fma -0.0 -1 0E+999999 -> 0.0
+fmax2553 fma 0.0 1 0E+999999 -> 0.0
+fmax2554 fma -0.0 1 0E+999999 -> 0.0
+fmax2555 fma -1.0 0 0E+999999 -> 0.0
+fmax2556 fma -1.0 -0 0E+999999 -> 0.0
+fmax2557 fma 1.0 0 0E+999999 -> 0.0
+fmax2558 fma 1.0 -0 0E+999999 -> 0.0
+
+fmax2561 fma 0 -1.0 0E+999999 -> 0.0
+fmax2562 fma -0 -1.0 0E+999999 -> 0.0
+fmax2563 fma 0 1.0 0E+999999 -> 0.0
+fmax2564 fma -0 1.0 0E+999999 -> 0.0
+fmax2565 fma -1 0.0 0E+999999 -> 0.0
+fmax2566 fma -1 -0.0 0E+999999 -> 0.0
+fmax2567 fma 1 0.0 0E+999999 -> 0.0
+fmax2568 fma 1 -0.0 0E+999999 -> 0.0
+
+fmax2571 fma 0.0 -1.0 0E+999999 -> 0.00
+fmax2572 fma -0.0 -1.0 0E+999999 -> 0.00
+fmax2573 fma 0.0 1.0 0E+999999 -> 0.00
+fmax2574 fma -0.0 1.0 0E+999999 -> 0.00
+fmax2575 fma -1.0 0.0 0E+999999 -> 0.00
+fmax2576 fma -1.0 -0.0 0E+999999 -> 0.00
+fmax2577 fma 1.0 0.0 0E+999999 -> 0.00
+fmax2578 fma 1.0 -0.0 0E+999999 -> 0.00
+
+
+-- Specials
+fmax2580 fma Inf -Inf 0E+999999 -> -Infinity
+fmax2581 fma Inf -1000 0E+999999 -> -Infinity
+fmax2582 fma Inf -1 0E+999999 -> -Infinity
+fmax2583 fma Inf -0 0E+999999 -> NaN Invalid_operation
+fmax2584 fma Inf 0 0E+999999 -> NaN Invalid_operation
+fmax2585 fma Inf 1 0E+999999 -> Infinity
+fmax2586 fma Inf 1000 0E+999999 -> Infinity
+fmax2587 fma Inf Inf 0E+999999 -> Infinity
+fmax2588 fma -1000 Inf 0E+999999 -> -Infinity
+fmax2589 fma -Inf Inf 0E+999999 -> -Infinity
+fmax2590 fma -1 Inf 0E+999999 -> -Infinity
+fmax2591 fma -0 Inf 0E+999999 -> NaN Invalid_operation
+fmax2592 fma 0 Inf 0E+999999 -> NaN Invalid_operation
+fmax2593 fma 1 Inf 0E+999999 -> Infinity
+fmax2594 fma 1000 Inf 0E+999999 -> Infinity
+fmax2595 fma Inf Inf 0E+999999 -> Infinity
+
+fmax2600 fma -Inf -Inf 0E+999999 -> Infinity
+fmax2601 fma -Inf -1000 0E+999999 -> Infinity
+fmax2602 fma -Inf -1 0E+999999 -> Infinity
+fmax2603 fma -Inf -0 0E+999999 -> NaN Invalid_operation
+fmax2604 fma -Inf 0 0E+999999 -> NaN Invalid_operation
+fmax2605 fma -Inf 1 0E+999999 -> -Infinity
+fmax2606 fma -Inf 1000 0E+999999 -> -Infinity
+fmax2607 fma -Inf Inf 0E+999999 -> -Infinity
+fmax2608 fma -1000 Inf 0E+999999 -> -Infinity
+fmax2609 fma -Inf -Inf 0E+999999 -> Infinity
+fmax2610 fma -1 -Inf 0E+999999 -> Infinity
+fmax2611 fma -0 -Inf 0E+999999 -> NaN Invalid_operation
+fmax2612 fma 0 -Inf 0E+999999 -> NaN Invalid_operation
+fmax2613 fma 1 -Inf 0E+999999 -> -Infinity
+fmax2614 fma 1000 -Inf 0E+999999 -> -Infinity
+fmax2615 fma Inf -Inf 0E+999999 -> -Infinity
+
+fmax2621 fma NaN -Inf 0E+999999 -> NaN
+fmax2622 fma NaN -1000 0E+999999 -> NaN
+fmax2623 fma NaN -1 0E+999999 -> NaN
+fmax2624 fma NaN -0 0E+999999 -> NaN
+fmax2625 fma NaN 0 0E+999999 -> NaN
+fmax2626 fma NaN 1 0E+999999 -> NaN
+fmax2627 fma NaN 1000 0E+999999 -> NaN
+fmax2628 fma NaN Inf 0E+999999 -> NaN
+fmax2629 fma NaN NaN 0E+999999 -> NaN
+fmax2630 fma -Inf NaN 0E+999999 -> NaN
+fmax2631 fma -1000 NaN 0E+999999 -> NaN
+fmax2632 fma -1 NaN 0E+999999 -> NaN
+fmax2633 fma -0 NaN 0E+999999 -> NaN
+fmax2634 fma 0 NaN 0E+999999 -> NaN
+fmax2635 fma 1 NaN 0E+999999 -> NaN
+fmax2636 fma 1000 NaN 0E+999999 -> NaN
+fmax2637 fma Inf NaN 0E+999999 -> NaN
+
+fmax2641 fma sNaN -Inf 0E+999999 -> NaN Invalid_operation
+fmax2642 fma sNaN -1000 0E+999999 -> NaN Invalid_operation
+fmax2643 fma sNaN -1 0E+999999 -> NaN Invalid_operation
+fmax2644 fma sNaN -0 0E+999999 -> NaN Invalid_operation
+fmax2645 fma sNaN 0 0E+999999 -> NaN Invalid_operation
+fmax2646 fma sNaN 1 0E+999999 -> NaN Invalid_operation
+fmax2647 fma sNaN 1000 0E+999999 -> NaN Invalid_operation
+fmax2648 fma sNaN NaN 0E+999999 -> NaN Invalid_operation
+fmax2649 fma sNaN sNaN 0E+999999 -> NaN Invalid_operation
+fmax2650 fma NaN sNaN 0E+999999 -> NaN Invalid_operation
+fmax2651 fma -Inf sNaN 0E+999999 -> NaN Invalid_operation
+fmax2652 fma -1000 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2653 fma -1 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2654 fma -0 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2655 fma 0 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2656 fma 1 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2657 fma 1000 sNaN 0E+999999 -> NaN Invalid_operation
+fmax2658 fma Inf sNaN 0E+999999 -> NaN Invalid_operation
+fmax2659 fma NaN sNaN 0E+999999 -> NaN Invalid_operation
+
+-- propagating NaNs
+fmax2661 fma NaN9 -Inf 0E+999999 -> NaN9
+fmax2662 fma NaN8 999 0E+999999 -> NaN8
+fmax2663 fma NaN71 Inf 0E+999999 -> NaN71
+fmax2664 fma NaN6 NaN5 0E+999999 -> NaN6
+fmax2665 fma -Inf NaN4 0E+999999 -> NaN4
+fmax2666 fma -999 NaN33 0E+999999 -> NaN33
+fmax2667 fma Inf NaN2 0E+999999 -> NaN2
+
+fmax2671 fma sNaN99 -Inf 0E+999999 -> NaN99 Invalid_operation
+fmax2672 fma sNaN98 -11 0E+999999 -> NaN98 Invalid_operation
+fmax2673 fma sNaN97 NaN 0E+999999 -> NaN97 Invalid_operation
+fmax2674 fma sNaN16 sNaN94 0E+999999 -> NaN16 Invalid_operation
+fmax2675 fma NaN95 sNaN93 0E+999999 -> NaN93 Invalid_operation
+fmax2676 fma -Inf sNaN92 0E+999999 -> NaN92 Invalid_operation
+fmax2677 fma 088 sNaN91 0E+999999 -> NaN91 Invalid_operation
+fmax2678 fma Inf sNaN90 0E+999999 -> NaN90 Invalid_operation
+fmax2679 fma NaN sNaN89 0E+999999 -> NaN89 Invalid_operation
+
+fmax2681 fma -NaN9 -Inf 0E+999999 -> -NaN9
+fmax2682 fma -NaN8 999 0E+999999 -> -NaN8
+fmax2683 fma -NaN71 Inf 0E+999999 -> -NaN71
+fmax2684 fma -NaN6 -NaN5 0E+999999 -> -NaN6
+fmax2685 fma -Inf -NaN4 0E+999999 -> -NaN4
+fmax2686 fma -999 -NaN33 0E+999999 -> -NaN33
+fmax2687 fma Inf -NaN2 0E+999999 -> -NaN2
+
+fmax2691 fma -sNaN99 -Inf 0E+999999 -> -NaN99 Invalid_operation
+fmax2692 fma -sNaN98 -11 0E+999999 -> -NaN98 Invalid_operation
+fmax2693 fma -sNaN97 NaN 0E+999999 -> -NaN97 Invalid_operation
+fmax2694 fma -sNaN16 -sNaN94 0E+999999 -> -NaN16 Invalid_operation
+fmax2695 fma -NaN95 -sNaN93 0E+999999 -> -NaN93 Invalid_operation
+fmax2696 fma -Inf -sNaN92 0E+999999 -> -NaN92 Invalid_operation
+fmax2697 fma 088 -sNaN91 0E+999999 -> -NaN91 Invalid_operation
+fmax2698 fma Inf -sNaN90 0E+999999 -> -NaN90 Invalid_operation
+fmax2699 fma -NaN -sNaN89 0E+999999 -> -NaN89 Invalid_operation
+
+fmax2701 fma -NaN -Inf 0E+999999 -> -NaN
+fmax2702 fma -NaN 999 0E+999999 -> -NaN
+fmax2703 fma -NaN Inf 0E+999999 -> -NaN
+fmax2704 fma -NaN -NaN 0E+999999 -> -NaN
+fmax2705 fma -Inf -NaN0 0E+999999 -> -NaN
+fmax2706 fma -999 -NaN 0E+999999 -> -NaN
+fmax2707 fma Inf -NaN 0E+999999 -> -NaN
+
+fmax2711 fma -sNaN -Inf 0E+999999 -> -NaN Invalid_operation
+fmax2712 fma -sNaN -11 0E+999999 -> -NaN Invalid_operation
+fmax2713 fma -sNaN00 NaN 0E+999999 -> -NaN Invalid_operation
+fmax2714 fma -sNaN -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2715 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2716 fma -Inf -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2717 fma 088 -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2718 fma Inf -sNaN 0E+999999 -> -NaN Invalid_operation
+fmax2719 fma -NaN -sNaN 0E+999999 -> -NaN Invalid_operation
+
+-- overflow and underflow tests .. note subnormal results
+maxexponent: 999999
+minexponent: -999999
+fmax2730 fma +1.23456789012345E-0 9E+999999 0E+999999 -> Infinity Inexact Overflow Rounded
+fmax2731 fma 9E+999999 +1.23456789012345E-0 0E+999999 -> Infinity Inexact Overflow Rounded
+fmax2732 fma +0.100 9E-999999 0E+999999 -> 9.00E-1000000 Subnormal
+fmax2733 fma 9E-999999 +0.100 0E+999999 -> 9.00E-1000000 Subnormal
+fmax2735 fma -1.23456789012345E-0 9E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded
+fmax2736 fma 9E+999999 -1.23456789012345E-0 0E+999999 -> -Infinity Inexact Overflow Rounded
+fmax2737 fma -0.100 9E-999999 0E+999999 -> -9.00E-1000000 Subnormal
+fmax2738 fma 9E-999999 -0.100 0E+999999 -> -9.00E-1000000 Subnormal
+
+-- signs
+fmax2751 fma 1e+777777 1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2752 fma 1e+777777 -1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded
+fmax2753 fma -1e+777777 1e+411111 0E+999999 -> -Infinity Overflow Inexact Rounded
+fmax2754 fma -1e+777777 -1e+411111 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2755 fma 1e-777777 1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2756 fma 1e-777777 -1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2757 fma -1e-777777 1e-411111 0E+999999 -> -0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2758 fma -1e-777777 -1e-411111 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+
+-- 'subnormal' boundary (all hard underflow or overflow in base arithemtic)
+precision: 9
+fmax2760 fma 1e-600000 1e-400001 0E+999999 -> 1E-1000001 Subnormal
+fmax2761 fma 1e-600000 1e-400002 0E+999999 -> 1E-1000002 Subnormal
+fmax2762 fma 1e-600000 1e-400003 0E+999999 -> 1E-1000003 Subnormal
+fmax2763 fma 1e-600000 1e-400004 0E+999999 -> 1E-1000004 Subnormal
+fmax2764 fma 1e-600000 1e-400005 0E+999999 -> 1E-1000005 Subnormal
+fmax2765 fma 1e-600000 1e-400006 0E+999999 -> 1E-1000006 Subnormal
+fmax2766 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal
+fmax2767 fma 1e-600000 1e-400008 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2768 fma 1e-600000 1e-400009 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+fmax2769 fma 1e-600000 1e-400010 0E+999999 -> 0E-1000007 Underflow Subnormal Inexact Rounded Clamped
+-- [no equivalent of 'subnormal' for overflow]
+fmax2770 fma 1e+600000 1e+400001 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2771 fma 1e+600000 1e+400002 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2772 fma 1e+600000 1e+400003 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2773 fma 1e+600000 1e+400004 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2774 fma 1e+600000 1e+400005 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2775 fma 1e+600000 1e+400006 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2776 fma 1e+600000 1e+400007 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2777 fma 1e+600000 1e+400008 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2778 fma 1e+600000 1e+400009 0E+999999 -> Infinity Overflow Inexact Rounded
+fmax2779 fma 1e+600000 1e+400010 0E+999999 -> Infinity Overflow Inexact Rounded
+
+-- 'subnormal' test edge condition at higher precisions
+precision: 99
+fmax2780 fma 1e-600000 1e-400007 0E+999999 -> 1E-1000007 Subnormal
+fmax2781 fma 1e-600000 1e-400008 0E+999999 -> 1E-1000008 Subnormal
+fmax2782 fma 1e-600000 1e-400097 0E+999999 -> 1E-1000097 Subnormal
+fmax2783 fma 1e-600000 1e-400098 0E+999999 -> 0E-1000097 Underflow Subnormal Inexact Rounded Clamped
+precision: 999
+fmax2784 fma 1e-600000 1e-400997 0E+999999 -> 1E-1000997 Subnormal
+fmax2785 fma 1e-600000 1e-400998 0E+999999 -> 0E-1000997 Underflow Subnormal Inexact Rounded Clamped
+
+-- test subnormals rounding
+precision: 5
+maxExponent: 999
+minexponent: -999
+rounding: half_even
+
+fmax2801 fma 1.0000E-999 1 0E+999999 -> 1.0000E-999
+fmax2802 fma 1.000E-999 1e-1 0E+999999 -> 1.000E-1000 Subnormal
+fmax2803 fma 1.00E-999 1e-2 0E+999999 -> 1.00E-1001 Subnormal
+fmax2804 fma 1.0E-999 1e-3 0E+999999 -> 1.0E-1002 Subnormal
+fmax2805 fma 1.0E-999 1e-4 0E+999999 -> 1E-1003 Subnormal Rounded
+fmax2806 fma 1.3E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+fmax2807 fma 1.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2808 fma 1.7E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2809 fma 2.3E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2810 fma 2.5E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2811 fma 2.7E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded
+fmax2812 fma 1.49E-999 1e-4 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+fmax2813 fma 1.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2814 fma 1.51E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2815 fma 2.49E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2816 fma 2.50E-999 1e-4 0E+999999 -> 2E-1003 Underflow Subnormal Inexact Rounded
+fmax2817 fma 2.51E-999 1e-4 0E+999999 -> 3E-1003 Underflow Subnormal Inexact Rounded
+
+fmax2818 fma 1E-999 1e-4 0E+999999 -> 1E-1003 Subnormal
+fmax2819 fma 3E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2820 fma 5E-999 1e-5 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2821 fma 7E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+fmax2822 fma 9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+fmax2823 fma 9.9E-999 1e-5 0E+999999 -> 1E-1003 Underflow Subnormal Inexact Rounded
+
+fmax2824 fma 1E-999 -1e-4 0E+999999 -> -1E-1003 Subnormal
+fmax2825 fma 3E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2826 fma -5E-999 1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2827 fma 7E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
+fmax2828 fma -9E-999 1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
+fmax2829 fma 9.9E-999 -1e-5 0E+999999 -> -1E-1003 Underflow Subnormal Inexact Rounded
+fmax2830 fma 3.0E-999 -1e-5 0E+999999 -> -0E-1003 Underflow Subnormal Inexact Rounded Clamped
+
+fmax2831 fma 1.0E-501 1e-501 0E+999999 -> 1.0E-1002 Subnormal
+fmax2832 fma 2.0E-501 2e-501 0E+999999 -> 4.0E-1002 Subnormal
+fmax2833 fma 4.0E-501 4e-501 0E+999999 -> 1.60E-1001 Subnormal
+fmax2834 fma 10.0E-501 10e-501 0E+999999 -> 1.000E-1000 Subnormal
+fmax2835 fma 30.0E-501 30e-501 0E+999999 -> 9.000E-1000 Subnormal
+fmax2836 fma 40.0E-501 40e-501 0E+999999 -> 1.6000E-999
+
+-- squares
+fmax2840 fma 1E-502 1e-502 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2841 fma 1E-501 1e-501 0E+999999 -> 1E-1002 Subnormal
+fmax2842 fma 2E-501 2e-501 0E+999999 -> 4E-1002 Subnormal
+fmax2843 fma 4E-501 4e-501 0E+999999 -> 1.6E-1001 Subnormal
+fmax2844 fma 10E-501 10e-501 0E+999999 -> 1.00E-1000 Subnormal
+fmax2845 fma 30E-501 30e-501 0E+999999 -> 9.00E-1000 Subnormal
+fmax2846 fma 40E-501 40e-501 0E+999999 -> 1.600E-999
+
+-- cubes
+fmax2850 fma 1E-670 1e-335 0E+999999 -> 0E-1003 Underflow Subnormal Inexact Rounded Clamped
+fmax2851 fma 1E-668 1e-334 0E+999999 -> 1E-1002 Subnormal
+fmax2852 fma 4E-668 2e-334 0E+999999 -> 8E-1002 Subnormal
+fmax2853 fma 9E-668 3e-334 0E+999999 -> 2.7E-1001 Subnormal
+fmax2854 fma 16E-668 4e-334 0E+999999 -> 6.4E-1001 Subnormal
+fmax2855 fma 25E-668 5e-334 0E+999999 -> 1.25E-1000 Subnormal
+fmax2856 fma 10E-668 100e-334 0E+999999 -> 1.000E-999
+
+-- test derived from result of 0.099 ** 999 at 15 digits with unlimited exponent
+precision: 19
+fmax2860 fma 6636851557994578716E-520 6636851557994578716E-520 0E+999999 -> 4.40477986028551E-1003 Underflow Subnormal Inexact Rounded
+
+-- Long operand overflow may be a different path
+precision: 3
+maxExponent: 999999
+minexponent: -999999
+fmax2870 fma 1 9.999E+999999 0E+999999 -> Infinity Inexact Overflow Rounded
+fmax2871 fma 1 -9.999E+999999 0E+999999 -> -Infinity Inexact Overflow Rounded
+fmax2872 fma 9.999E+999999 1 0E+999999 -> Infinity Inexact Overflow Rounded
+fmax2873 fma -9.999E+999999 1 0E+999999 -> -Infinity Inexact Overflow Rounded
+
+-- check for double-rounded subnormals
+precision: 5
+maxexponent: 79
+minexponent: -79
+fmax2881 fma 1.2347E-40 1.2347E-40 0E+999999 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax2882 fma 1.234E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
+fmax2883 fma 1.23E-40 1.23E-40 0E+999999 -> 1.513E-80 Inexact Rounded Subnormal Underflow
+fmax2884 fma 1.2E-40 1.2E-40 0E+999999 -> 1.44E-80 Subnormal
+fmax2885 fma 1.2E-40 1.2E-41 0E+999999 -> 1.44E-81 Subnormal
+fmax2886 fma 1.2E-40 1.2E-42 0E+999999 -> 1.4E-82 Subnormal Inexact Rounded Underflow
+fmax2887 fma 1.2E-40 1.3E-42 0E+999999 -> 1.6E-82 Subnormal Inexact Rounded Underflow
+fmax2888 fma 1.3E-40 1.3E-42 0E+999999 -> 1.7E-82 Subnormal Inexact Rounded Underflow
+fmax2889 fma 1.3E-40 1.3E-43 0E+999999 -> 2E-83 Subnormal Inexact Rounded Underflow
+fmax2890 fma 1.3E-41 1.3E-43 0E+999999 -> 0E-83 Clamped Subnormal Inexact Rounded Underflow
+
+fmax2891 fma 1.2345E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded
+fmax2892 fma 1.23456E-39 1.234E-40 0E+999999 -> 1.5234E-79 Inexact Rounded
+fmax2893 fma 1.2345E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
+fmax2894 fma 1.23456E-40 1.234E-40 0E+999999 -> 1.523E-80 Inexact Rounded Subnormal Underflow
+fmax2895 fma 1.2345E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow
+fmax2896 fma 1.23456E-41 1.234E-40 0E+999999 -> 1.52E-81 Inexact Rounded Subnormal Underflow
+
+-- Now explore the case where we get a normal result with Underflow
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+fmax2900 fma 0.3000000000E-191 0.3000000000E-191 0E+999999 -> 9.00000000000000E-384 Subnormal Rounded
+fmax2901 fma 0.3000000001E-191 0.3000000001E-191 0E+999999 -> 9.00000000600000E-384 Underflow Inexact Subnormal Rounded
+fmax2902 fma 9.999999999999999E-383 0.0999999999999 0E+999999 -> 9.99999999999000E-384 Underflow Inexact Subnormal Rounded
+fmax2903 fma 9.999999999999999E-383 0.09999999999999 0E+999999 -> 9.99999999999900E-384 Underflow Inexact Subnormal Rounded
+fmax2904 fma 9.999999999999999E-383 0.099999999999999 0E+999999 -> 9.99999999999990E-384 Underflow Inexact Subnormal Rounded
+fmax2905 fma 9.999999999999999E-383 0.0999999999999999 0E+999999 -> 9.99999999999999E-384 Underflow Inexact Subnormal Rounded
+-- prove operands are exact
+fmax2906 fma 9.999999999999999E-383 1 0E+999999 -> 9.999999999999999E-383
+fmax2907 fma 1 0.09999999999999999 0E+999999 -> 0.09999999999999999
+-- the next rounds to Nmin
+fmax2908 fma 9.999999999999999E-383 0.09999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax2909 fma 9.999999999999999E-383 0.099999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax2910 fma 9.999999999999999E-383 0.0999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax2911 fma 9.999999999999999E-383 0.09999999999999999999 0E+999999 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+fmax2921 fma 130E-2 120E-2 0E+999999 -> 1.5600
+fmax2922 fma 130E-2 12E-1 0E+999999 -> 1.560
+fmax2923 fma 130E-2 1E0 0E+999999 -> 1.30
+
+-- Null tests
+fmax2990 fma # 10 0E+999999 -> NaN Invalid_operation
+fmax2991 fma 10 # 0E+999999 -> NaN Invalid_operation
+
+-- ADDITION TESTS ------------------------------------------------------
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- [first group are 'quick confidence check']
+fmax3001 fma 1 1 1 -> 2
+fmax3002 fma 1 2 3 -> 5
+fmax3003 fma 1 '5.75' '3.3' -> 9.05
+fmax3004 fma 1 '5' '-3' -> 2
+fmax3005 fma 1 '-5' '-3' -> -8
+fmax3006 fma 1 '-7' '2.5' -> -4.5
+fmax3007 fma 1 '0.7' '0.3' -> 1.0
+fmax3008 fma 1 '1.25' '1.25' -> 2.50
+fmax3009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
+fmax3010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
+
+fmax3011 fma 1 '0.4444444444' '0.5555555555' -> '1.00000000' Inexact Rounded
+fmax3012 fma 1 '0.4444444440' '0.5555555555' -> '1.00000000' Inexact Rounded
+fmax3013 fma 1 '0.4444444444' '0.5555555550' -> '0.999999999' Inexact Rounded
+fmax3014 fma 1 '0.44444444449' '0' -> '0.444444444' Inexact Rounded
+fmax3015 fma 1 '0.444444444499' '0' -> '0.444444444' Inexact Rounded
+fmax3016 fma 1 '0.4444444444999' '0' -> '0.444444444' Inexact Rounded
+fmax3017 fma 1 '0.4444444445000' '0' -> '0.444444445' Inexact Rounded
+fmax3018 fma 1 '0.4444444445001' '0' -> '0.444444445' Inexact Rounded
+fmax3019 fma 1 '0.444444444501' '0' -> '0.444444445' Inexact Rounded
+fmax3020 fma 1 '0.44444444451' '0' -> '0.444444445' Inexact Rounded
+
+fmax3021 fma 1 0 1 -> 1
+fmax3022 fma 1 1 1 -> 2
+fmax3023 fma 1 2 1 -> 3
+fmax3024 fma 1 3 1 -> 4
+fmax3025 fma 1 4 1 -> 5
+fmax3026 fma 1 5 1 -> 6
+fmax3027 fma 1 6 1 -> 7
+fmax3028 fma 1 7 1 -> 8
+fmax3029 fma 1 8 1 -> 9
+fmax3030 fma 1 9 1 -> 10
+
+-- some carrying effects
+fmax3031 fma 1 '0.9998' '0.0000' -> '0.9998'
+fmax3032 fma 1 '0.9998' '0.0001' -> '0.9999'
+fmax3033 fma 1 '0.9998' '0.0002' -> '1.0000'
+fmax3034 fma 1 '0.9998' '0.0003' -> '1.0001'
+
+fmax3035 fma 1 '70' '10000e+9' -> '1.00000000E+13' Inexact Rounded
+fmax3036 fma 1 '700' '10000e+9' -> '1.00000000E+13' Inexact Rounded
+fmax3037 fma 1 '7000' '10000e+9' -> '1.00000000E+13' Inexact Rounded
+fmax3038 fma 1 '70000' '10000e+9' -> '1.00000001E+13' Inexact Rounded
+fmax3039 fma 1 '700000' '10000e+9' -> '1.00000007E+13' Rounded
+
+-- symmetry:
+fmax3040 fma 1 '10000e+9' '70' -> '1.00000000E+13' Inexact Rounded
+fmax3041 fma 1 '10000e+9' '700' -> '1.00000000E+13' Inexact Rounded
+fmax3042 fma 1 '10000e+9' '7000' -> '1.00000000E+13' Inexact Rounded
+fmax3044 fma 1 '10000e+9' '70000' -> '1.00000001E+13' Inexact Rounded
+fmax3045 fma 1 '10000e+9' '700000' -> '1.00000007E+13' Rounded
+
+-- same, higher precision
+precision: 15
+fmax3046 fma 1 '10000e+9' '7' -> '10000000000007'
+fmax3047 fma 1 '10000e+9' '70' -> '10000000000070'
+fmax3048 fma 1 '10000e+9' '700' -> '10000000000700'
+fmax3049 fma 1 '10000e+9' '7000' -> '10000000007000'
+fmax3050 fma 1 '10000e+9' '70000' -> '10000000070000'
+fmax3051 fma 1 '10000e+9' '700000' -> '10000000700000'
+fmax3052 fma 1 '10000e+9' '7000000' -> '10000007000000'
+
+-- examples from decarith
+fmax3053 fma 1 '12' '7.00' -> '19.00'
+fmax3054 fma 1 '1.3' '-1.07' -> '0.23'
+fmax3055 fma 1 '1.3' '-1.30' -> '0.00'
+fmax3056 fma 1 '1.3' '-2.07' -> '-0.77'
+fmax3057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
+
+-- zero preservation
+precision: 6
+fmax3060 fma 1 '10000e+9' '70000' -> '1.00000E+13' Inexact Rounded
+fmax3061 fma 1 1 '0.0001' -> '1.0001'
+fmax3062 fma 1 1 '0.00001' -> '1.00001'
+fmax3063 fma 1 1 '0.000001' -> '1.00000' Inexact Rounded
+fmax3064 fma 1 1 '0.0000001' -> '1.00000' Inexact Rounded
+fmax3065 fma 1 1 '0.00000001' -> '1.00000' Inexact Rounded
+
+-- some funny zeros [in case of bad signum]
+fmax3070 fma 1 1 0 -> 1
+fmax3071 fma 1 1 0. -> 1
+fmax3072 fma 1 1 .0 -> 1.0
+fmax3073 fma 1 1 0.0 -> 1.0
+fmax3074 fma 1 1 0.00 -> 1.00
+fmax3075 fma 1 0 1 -> 1
+fmax3076 fma 1 0. 1 -> 1
+fmax3077 fma 1 .0 1 -> 1.0
+fmax3078 fma 1 0.0 1 -> 1.0
+fmax3079 fma 1 0.00 1 -> 1.00
+
+precision: 9
+
+-- some carries
+fmax3080 fma 1 999999998 1 -> 999999999
+fmax3081 fma 1 999999999 1 -> 1.00000000E+9 Rounded
+fmax3082 fma 1 99999999 1 -> 100000000
+fmax3083 fma 1 9999999 1 -> 10000000
+fmax3084 fma 1 999999 1 -> 1000000
+fmax3085 fma 1 99999 1 -> 100000
+fmax3086 fma 1 9999 1 -> 10000
+fmax3087 fma 1 999 1 -> 1000
+fmax3088 fma 1 99 1 -> 100
+fmax3089 fma 1 9 1 -> 10
+
+
+-- more LHS swaps
+fmax3090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
+fmax3091 fma 1 '-56267E-6' 0 -> '-0.056267'
+fmax3092 fma 1 '-56267E-5' 0 -> '-0.56267'
+fmax3093 fma 1 '-56267E-4' 0 -> '-5.6267'
+fmax3094 fma 1 '-56267E-3' 0 -> '-56.267'
+fmax3095 fma 1 '-56267E-2' 0 -> '-562.67'
+fmax3096 fma 1 '-56267E-1' 0 -> '-5626.7'
+fmax3097 fma 1 '-56267E-0' 0 -> '-56267'
+fmax3098 fma 1 '-5E-10' 0 -> '-5E-10'
+fmax3099 fma 1 '-5E-7' 0 -> '-5E-7'
+fmax3100 fma 1 '-5E-6' 0 -> '-0.000005'
+fmax3101 fma 1 '-5E-5' 0 -> '-0.00005'
+fmax3102 fma 1 '-5E-4' 0 -> '-0.0005'
+fmax3103 fma 1 '-5E-1' 0 -> '-0.5'
+fmax3104 fma 1 '-5E0' 0 -> '-5'
+fmax3105 fma 1 '-5E1' 0 -> '-50'
+fmax3106 fma 1 '-5E5' 0 -> '-500000'
+fmax3107 fma 1 '-5E8' 0 -> '-500000000'
+fmax3108 fma 1 '-5E9' 0 -> '-5.00000000E+9' Rounded
+fmax3109 fma 1 '-5E10' 0 -> '-5.00000000E+10' Rounded
+fmax3110 fma 1 '-5E11' 0 -> '-5.00000000E+11' Rounded
+fmax3111 fma 1 '-5E100' 0 -> '-5.00000000E+100' Rounded
+
+-- more RHS swaps
+fmax3113 fma 1 0 '-56267E-10' -> '-0.0000056267'
+fmax3114 fma 1 0 '-56267E-6' -> '-0.056267'
+fmax3116 fma 1 0 '-56267E-5' -> '-0.56267'
+fmax3117 fma 1 0 '-56267E-4' -> '-5.6267'
+fmax3119 fma 1 0 '-56267E-3' -> '-56.267'
+fmax3120 fma 1 0 '-56267E-2' -> '-562.67'
+fmax3121 fma 1 0 '-56267E-1' -> '-5626.7'
+fmax3122 fma 1 0 '-56267E-0' -> '-56267'
+fmax3123 fma 1 0 '-5E-10' -> '-5E-10'
+fmax3124 fma 1 0 '-5E-7' -> '-5E-7'
+fmax3125 fma 1 0 '-5E-6' -> '-0.000005'
+fmax3126 fma 1 0 '-5E-5' -> '-0.00005'
+fmax3127 fma 1 0 '-5E-4' -> '-0.0005'
+fmax3128 fma 1 0 '-5E-1' -> '-0.5'
+fmax3129 fma 1 0 '-5E0' -> '-5'
+fmax3130 fma 1 0 '-5E1' -> '-50'
+fmax3131 fma 1 0 '-5E5' -> '-500000'
+fmax3132 fma 1 0 '-5E8' -> '-500000000'
+fmax3133 fma 1 0 '-5E9' -> '-5.00000000E+9' Rounded
+fmax3134 fma 1 0 '-5E10' -> '-5.00000000E+10' Rounded
+fmax3135 fma 1 0 '-5E11' -> '-5.00000000E+11' Rounded
+fmax3136 fma 1 0 '-5E100' -> '-5.00000000E+100' Rounded
+
+-- related
+fmax3137 fma 1 1 '0E-12' -> '1.00000000' Rounded
+fmax3138 fma 1 -1 '0E-12' -> '-1.00000000' Rounded
+fmax3139 fma 1 '0E-12' 1 -> '1.00000000' Rounded
+fmax3140 fma 1 '0E-12' -1 -> '-1.00000000' Rounded
+fmax3141 fma 1 1E+4 0.0000 -> '10000.0000'
+fmax3142 fma 1 1E+4 0.00000 -> '10000.0000' Rounded
+fmax3143 fma 1 0.000 1E+5 -> '100000.000'
+fmax3144 fma 1 0.0000 1E+5 -> '100000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+fmax3146 fma 1 '00.0' 0 -> '0.0'
+fmax3147 fma 1 '0.00' 0 -> '0.00'
+fmax3148 fma 1 0 '0.00' -> '0.00'
+fmax3149 fma 1 0 '00.0' -> '0.0'
+fmax3150 fma 1 '00.0' '0.00' -> '0.00'
+fmax3151 fma 1 '0.00' '00.0' -> '0.00'
+fmax3152 fma 1 '3' '.3' -> '3.3'
+fmax3153 fma 1 '3.' '.3' -> '3.3'
+fmax3154 fma 1 '3.0' '.3' -> '3.3'
+fmax3155 fma 1 '3.00' '.3' -> '3.30'
+fmax3156 fma 1 '3' '3' -> '6'
+fmax3157 fma 1 '3' '+3' -> '6'
+fmax3158 fma 1 '3' '-3' -> '0'
+fmax3159 fma 1 '0.3' '-0.3' -> '0.0'
+fmax3160 fma 1 '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+precision: 15
+fmax3161 fma 1 '1E+12' '-1' -> '999999999999'
+fmax3162 fma 1 '1E+12' '1.11' -> '1000000000001.11'
+fmax3163 fma 1 '1.11' '1E+12' -> '1000000000001.11'
+fmax3164 fma 1 '-1' '1E+12' -> '999999999999'
+fmax3165 fma 1 '7E+12' '-1' -> '6999999999999'
+fmax3166 fma 1 '7E+12' '1.11' -> '7000000000001.11'
+fmax3167 fma 1 '1.11' '7E+12' -> '7000000000001.11'
+fmax3168 fma 1 '-1' '7E+12' -> '6999999999999'
+
+-- 123456789012345 123456789012345 1 23456789012345
+fmax3170 fma 1 '0.444444444444444' '0.555555555555563' -> '1.00000000000001' Inexact Rounded
+fmax3171 fma 1 '0.444444444444444' '0.555555555555562' -> '1.00000000000001' Inexact Rounded
+fmax3172 fma 1 '0.444444444444444' '0.555555555555561' -> '1.00000000000001' Inexact Rounded
+fmax3173 fma 1 '0.444444444444444' '0.555555555555560' -> '1.00000000000000' Inexact Rounded
+fmax3174 fma 1 '0.444444444444444' '0.555555555555559' -> '1.00000000000000' Inexact Rounded
+fmax3175 fma 1 '0.444444444444444' '0.555555555555558' -> '1.00000000000000' Inexact Rounded
+fmax3176 fma 1 '0.444444444444444' '0.555555555555557' -> '1.00000000000000' Inexact Rounded
+fmax3177 fma 1 '0.444444444444444' '0.555555555555556' -> '1.00000000000000' Rounded
+fmax3178 fma 1 '0.444444444444444' '0.555555555555555' -> '0.999999999999999'
+fmax3179 fma 1 '0.444444444444444' '0.555555555555554' -> '0.999999999999998'
+fmax3180 fma 1 '0.444444444444444' '0.555555555555553' -> '0.999999999999997'
+fmax3181 fma 1 '0.444444444444444' '0.555555555555552' -> '0.999999999999996'
+fmax3182 fma 1 '0.444444444444444' '0.555555555555551' -> '0.999999999999995'
+fmax3183 fma 1 '0.444444444444444' '0.555555555555550' -> '0.999999999999994'
+
+-- and some more, including residue effects and different roundings
+precision: 9
+rounding: half_up
+fmax3200 fma 1 '123456789' 0 -> '123456789'
+fmax3201 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
+fmax3202 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
+fmax3203 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
+fmax3204 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
+fmax3205 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
+fmax3206 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
+fmax3207 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
+fmax3208 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded
+fmax3209 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded
+fmax3210 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded
+fmax3211 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded
+fmax3212 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded
+fmax3213 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded
+fmax3214 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded
+fmax3215 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded
+fmax3216 fma 1 '123456789' 1 -> '123456790'
+fmax3217 fma 1 '123456789' 1.000000001 -> '123456790' Inexact Rounded
+fmax3218 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
+fmax3219 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
+
+rounding: half_even
+fmax3220 fma 1 '123456789' 0 -> '123456789'
+fmax3221 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
+fmax3222 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
+fmax3223 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
+fmax3224 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
+fmax3225 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
+fmax3226 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
+fmax3227 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
+fmax3228 fma 1 '123456789' 0.5 -> '123456790' Inexact Rounded
+fmax3229 fma 1 '123456789' 0.500000001 -> '123456790' Inexact Rounded
+fmax3230 fma 1 '123456789' 0.500001 -> '123456790' Inexact Rounded
+fmax3231 fma 1 '123456789' 0.51 -> '123456790' Inexact Rounded
+fmax3232 fma 1 '123456789' 0.6 -> '123456790' Inexact Rounded
+fmax3233 fma 1 '123456789' 0.9 -> '123456790' Inexact Rounded
+fmax3234 fma 1 '123456789' 0.99999 -> '123456790' Inexact Rounded
+fmax3235 fma 1 '123456789' 0.999999999 -> '123456790' Inexact Rounded
+fmax3236 fma 1 '123456789' 1 -> '123456790'
+fmax3237 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded
+fmax3238 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
+fmax3239 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
+-- critical few with even bottom digit...
+fmax3240 fma 1 '123456788' 0.499999999 -> '123456788' Inexact Rounded
+fmax3241 fma 1 '123456788' 0.5 -> '123456788' Inexact Rounded
+fmax3242 fma 1 '123456788' 0.500000001 -> '123456789' Inexact Rounded
+
+rounding: down
+fmax3250 fma 1 '123456789' 0 -> '123456789'
+fmax3251 fma 1 '123456789' 0.000000001 -> '123456789' Inexact Rounded
+fmax3252 fma 1 '123456789' 0.000001 -> '123456789' Inexact Rounded
+fmax3253 fma 1 '123456789' 0.1 -> '123456789' Inexact Rounded
+fmax3254 fma 1 '123456789' 0.4 -> '123456789' Inexact Rounded
+fmax3255 fma 1 '123456789' 0.49 -> '123456789' Inexact Rounded
+fmax3256 fma 1 '123456789' 0.499999 -> '123456789' Inexact Rounded
+fmax3257 fma 1 '123456789' 0.499999999 -> '123456789' Inexact Rounded
+fmax3258 fma 1 '123456789' 0.5 -> '123456789' Inexact Rounded
+fmax3259 fma 1 '123456789' 0.500000001 -> '123456789' Inexact Rounded
+fmax3260 fma 1 '123456789' 0.500001 -> '123456789' Inexact Rounded
+fmax3261 fma 1 '123456789' 0.51 -> '123456789' Inexact Rounded
+fmax3262 fma 1 '123456789' 0.6 -> '123456789' Inexact Rounded
+fmax3263 fma 1 '123456789' 0.9 -> '123456789' Inexact Rounded
+fmax3264 fma 1 '123456789' 0.99999 -> '123456789' Inexact Rounded
+fmax3265 fma 1 '123456789' 0.999999999 -> '123456789' Inexact Rounded
+fmax3266 fma 1 '123456789' 1 -> '123456790'
+fmax3267 fma 1 '123456789' 1.00000001 -> '123456790' Inexact Rounded
+fmax3268 fma 1 '123456789' 1.00001 -> '123456790' Inexact Rounded
+fmax3269 fma 1 '123456789' 1.1 -> '123456790' Inexact Rounded
+
+-- input preparation tests (operands should not be rounded)
+precision: 3
+rounding: half_up
+
+fmax3270 fma 1 '12345678900000' 9999999999999 -> '2.23E+13' Inexact Rounded
+fmax3271 fma 1 '9999999999999' 12345678900000 -> '2.23E+13' Inexact Rounded
+
+fmax3272 fma 1 '12E+3' '3444' -> '1.54E+4' Inexact Rounded
+fmax3273 fma 1 '12E+3' '3446' -> '1.54E+4' Inexact Rounded
+fmax3274 fma 1 '12E+3' '3449.9' -> '1.54E+4' Inexact Rounded
+fmax3275 fma 1 '12E+3' '3450.0' -> '1.55E+4' Inexact Rounded
+fmax3276 fma 1 '12E+3' '3450.1' -> '1.55E+4' Inexact Rounded
+fmax3277 fma 1 '12E+3' '3454' -> '1.55E+4' Inexact Rounded
+fmax3278 fma 1 '12E+3' '3456' -> '1.55E+4' Inexact Rounded
+
+fmax3281 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3282 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3283 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3284 fma 1 '3450.0' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3285 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3286 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3287 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded
+
+rounding: half_down
+fmax3291 fma 1 '3444' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3292 fma 1 '3446' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3293 fma 1 '3449.9' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3294 fma 1 '3450.0' '12E+3' -> '1.54E+4' Inexact Rounded
+fmax3295 fma 1 '3450.1' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3296 fma 1 '3454' '12E+3' -> '1.55E+4' Inexact Rounded
+fmax3297 fma 1 '3456' '12E+3' -> '1.55E+4' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_up
+fmax3301 fma 1 -1 1 -> 0
+fmax3302 fma 1 0 1 -> 1
+fmax3303 fma 1 1 1 -> 2
+fmax3304 fma 1 12 1 -> 13
+fmax3305 fma 1 98 1 -> 99
+fmax3306 fma 1 99 1 -> 100
+fmax3307 fma 1 100 1 -> 101
+fmax3308 fma 1 101 1 -> 102
+fmax3309 fma 1 -1 -1 -> -2
+fmax3310 fma 1 0 -1 -> -1
+fmax3311 fma 1 1 -1 -> 0
+fmax3312 fma 1 12 -1 -> 11
+fmax3313 fma 1 98 -1 -> 97
+fmax3314 fma 1 99 -1 -> 98
+fmax3315 fma 1 100 -1 -> 99
+fmax3316 fma 1 101 -1 -> 100
+
+fmax3321 fma 1 -0.01 0.01 -> 0.00
+fmax3322 fma 1 0.00 0.01 -> 0.01
+fmax3323 fma 1 0.01 0.01 -> 0.02
+fmax3324 fma 1 0.12 0.01 -> 0.13
+fmax3325 fma 1 0.98 0.01 -> 0.99
+fmax3326 fma 1 0.99 0.01 -> 1.00
+fmax3327 fma 1 1.00 0.01 -> 1.01
+fmax3328 fma 1 1.01 0.01 -> 1.02
+fmax3329 fma 1 -0.01 -0.01 -> -0.02
+fmax3330 fma 1 0.00 -0.01 -> -0.01
+fmax3331 fma 1 0.01 -0.01 -> 0.00
+fmax3332 fma 1 0.12 -0.01 -> 0.11
+fmax3333 fma 1 0.98 -0.01 -> 0.97
+fmax3334 fma 1 0.99 -0.01 -> 0.98
+fmax3335 fma 1 1.00 -0.01 -> 0.99
+fmax3336 fma 1 1.01 -0.01 -> 1.00
+
+-- some more cases where fma 1 ing 0 affects the coefficient
+precision: 9
+fmax3340 fma 1 1E+3 0 -> 1000
+fmax3341 fma 1 1E+8 0 -> 100000000
+fmax3342 fma 1 1E+9 0 -> 1.00000000E+9 Rounded
+fmax3343 fma 1 1E+10 0 -> 1.00000000E+10 Rounded
+-- which simply follow from these cases ...
+fmax3344 fma 1 1E+3 1 -> 1001
+fmax3345 fma 1 1E+8 1 -> 100000001
+fmax3346 fma 1 1E+9 1 -> 1.00000000E+9 Inexact Rounded
+fmax3347 fma 1 1E+10 1 -> 1.00000000E+10 Inexact Rounded
+fmax3348 fma 1 1E+3 7 -> 1007
+fmax3349 fma 1 1E+8 7 -> 100000007
+fmax3350 fma 1 1E+9 7 -> 1.00000001E+9 Inexact Rounded
+fmax3351 fma 1 1E+10 7 -> 1.00000000E+10 Inexact Rounded
+
+-- tryzeros cases
+precision: 7
+rounding: half_up
+maxExponent: 92
+minexponent: -92
+fmax3361 fma 1 0E+50 10000E+1 -> 1.0000E+5
+fmax3362 fma 1 10000E+1 0E-50 -> 100000.0 Rounded
+fmax3363 fma 1 10000E+1 10000E-50 -> 100000.0 Rounded Inexact
+fmax3364 fma 1 9.999999E+92 -9.999999E+92 -> 0E+86
+
+-- a curiosity from JSR 13 testing
+rounding: half_down
+precision: 10
+fmax3370 fma 1 99999999 81512 -> 100081511
+precision: 6
+fmax3371 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
+rounding: half_up
+precision: 10
+fmax3372 fma 1 99999999 81512 -> 100081511
+precision: 6
+fmax3373 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
+rounding: half_even
+precision: 10
+fmax3374 fma 1 99999999 81512 -> 100081511
+precision: 6
+fmax3375 fma 1 99999999 81512 -> 1.00082E+8 Rounded Inexact
+
+-- ulp replacement tests
+precision: 9
+maxexponent: 999999
+minexponent: -999999
+fmax3400 fma 1 1 77e-7 -> 1.0000077
+fmax3401 fma 1 1 77e-8 -> 1.00000077
+fmax3402 fma 1 1 77e-9 -> 1.00000008 Inexact Rounded
+fmax3403 fma 1 1 77e-10 -> 1.00000001 Inexact Rounded
+fmax3404 fma 1 1 77e-11 -> 1.00000000 Inexact Rounded
+fmax3405 fma 1 1 77e-12 -> 1.00000000 Inexact Rounded
+fmax3406 fma 1 1 77e-999 -> 1.00000000 Inexact Rounded
+fmax3407 fma 1 1 77e-999999 -> 1.00000000 Inexact Rounded
+
+fmax3410 fma 1 10 77e-7 -> 10.0000077
+fmax3411 fma 1 10 77e-8 -> 10.0000008 Inexact Rounded
+fmax3412 fma 1 10 77e-9 -> 10.0000001 Inexact Rounded
+fmax3413 fma 1 10 77e-10 -> 10.0000000 Inexact Rounded
+fmax3414 fma 1 10 77e-11 -> 10.0000000 Inexact Rounded
+fmax3415 fma 1 10 77e-12 -> 10.0000000 Inexact Rounded
+fmax3416 fma 1 10 77e-999 -> 10.0000000 Inexact Rounded
+fmax3417 fma 1 10 77e-999999 -> 10.0000000 Inexact Rounded
+
+fmax3420 fma 1 77e-7 1 -> 1.0000077
+fmax3421 fma 1 77e-8 1 -> 1.00000077
+fmax3422 fma 1 77e-9 1 -> 1.00000008 Inexact Rounded
+fmax3423 fma 1 77e-10 1 -> 1.00000001 Inexact Rounded
+fmax3424 fma 1 77e-11 1 -> 1.00000000 Inexact Rounded
+fmax3425 fma 1 77e-12 1 -> 1.00000000 Inexact Rounded
+fmax3426 fma 1 77e-999 1 -> 1.00000000 Inexact Rounded
+fmax3427 fma 1 77e-999999 1 -> 1.00000000 Inexact Rounded
+
+fmax3430 fma 1 77e-7 10 -> 10.0000077
+fmax3431 fma 1 77e-8 10 -> 10.0000008 Inexact Rounded
+fmax3432 fma 1 77e-9 10 -> 10.0000001 Inexact Rounded
+fmax3433 fma 1 77e-10 10 -> 10.0000000 Inexact Rounded
+fmax3434 fma 1 77e-11 10 -> 10.0000000 Inexact Rounded
+fmax3435 fma 1 77e-12 10 -> 10.0000000 Inexact Rounded
+fmax3436 fma 1 77e-999 10 -> 10.0000000 Inexact Rounded
+fmax3437 fma 1 77e-999999 10 -> 10.0000000 Inexact Rounded
+
+-- negative ulps
+fmax3440 fma 1 1 -77e-7 -> 0.9999923
+fmax3441 fma 1 1 -77e-8 -> 0.99999923
+fmax3442 fma 1 1 -77e-9 -> 0.999999923
+fmax3443 fma 1 1 -77e-10 -> 0.999999992 Inexact Rounded
+fmax3444 fma 1 1 -77e-11 -> 0.999999999 Inexact Rounded
+fmax3445 fma 1 1 -77e-12 -> 1.00000000 Inexact Rounded
+fmax3446 fma 1 1 -77e-999 -> 1.00000000 Inexact Rounded
+fmax3447 fma 1 1 -77e-999999 -> 1.00000000 Inexact Rounded
+
+fmax3450 fma 1 10 -77e-7 -> 9.9999923
+fmax3451 fma 1 10 -77e-8 -> 9.99999923
+fmax3452 fma 1 10 -77e-9 -> 9.99999992 Inexact Rounded
+fmax3453 fma 1 10 -77e-10 -> 9.99999999 Inexact Rounded
+fmax3454 fma 1 10 -77e-11 -> 10.0000000 Inexact Rounded
+fmax3455 fma 1 10 -77e-12 -> 10.0000000 Inexact Rounded
+fmax3456 fma 1 10 -77e-999 -> 10.0000000 Inexact Rounded
+fmax3457 fma 1 10 -77e-999999 -> 10.0000000 Inexact Rounded
+
+fmax3460 fma 1 -77e-7 1 -> 0.9999923
+fmax3461 fma 1 -77e-8 1 -> 0.99999923
+fmax3462 fma 1 -77e-9 1 -> 0.999999923
+fmax3463 fma 1 -77e-10 1 -> 0.999999992 Inexact Rounded
+fmax3464 fma 1 -77e-11 1 -> 0.999999999 Inexact Rounded
+fmax3465 fma 1 -77e-12 1 -> 1.00000000 Inexact Rounded
+fmax3466 fma 1 -77e-999 1 -> 1.00000000 Inexact Rounded
+fmax3467 fma 1 -77e-999999 1 -> 1.00000000 Inexact Rounded
+
+fmax3470 fma 1 -77e-7 10 -> 9.9999923
+fmax3471 fma 1 -77e-8 10 -> 9.99999923
+fmax3472 fma 1 -77e-9 10 -> 9.99999992 Inexact Rounded
+fmax3473 fma 1 -77e-10 10 -> 9.99999999 Inexact Rounded
+fmax3474 fma 1 -77e-11 10 -> 10.0000000 Inexact Rounded
+fmax3475 fma 1 -77e-12 10 -> 10.0000000 Inexact Rounded
+fmax3476 fma 1 -77e-999 10 -> 10.0000000 Inexact Rounded
+fmax3477 fma 1 -77e-999999 10 -> 10.0000000 Inexact Rounded
+
+-- negative ulps
+fmax3480 fma 1 -1 77e-7 -> -0.9999923
+fmax3481 fma 1 -1 77e-8 -> -0.99999923
+fmax3482 fma 1 -1 77e-9 -> -0.999999923
+fmax3483 fma 1 -1 77e-10 -> -0.999999992 Inexact Rounded
+fmax3484 fma 1 -1 77e-11 -> -0.999999999 Inexact Rounded
+fmax3485 fma 1 -1 77e-12 -> -1.00000000 Inexact Rounded
+fmax3486 fma 1 -1 77e-999 -> -1.00000000 Inexact Rounded
+fmax3487 fma 1 -1 77e-999999 -> -1.00000000 Inexact Rounded
+
+fmax3490 fma 1 -10 77e-7 -> -9.9999923
+fmax3491 fma 1 -10 77e-8 -> -9.99999923
+fmax3492 fma 1 -10 77e-9 -> -9.99999992 Inexact Rounded
+fmax3493 fma 1 -10 77e-10 -> -9.99999999 Inexact Rounded
+fmax3494 fma 1 -10 77e-11 -> -10.0000000 Inexact Rounded
+fmax3495 fma 1 -10 77e-12 -> -10.0000000 Inexact Rounded
+fmax3496 fma 1 -10 77e-999 -> -10.0000000 Inexact Rounded
+fmax3497 fma 1 -10 77e-999999 -> -10.0000000 Inexact Rounded
+
+fmax3500 fma 1 77e-7 -1 -> -0.9999923
+fmax3501 fma 1 77e-8 -1 -> -0.99999923
+fmax3502 fma 1 77e-9 -1 -> -0.999999923
+fmax3503 fma 1 77e-10 -1 -> -0.999999992 Inexact Rounded
+fmax3504 fma 1 77e-11 -1 -> -0.999999999 Inexact Rounded
+fmax3505 fma 1 77e-12 -1 -> -1.00000000 Inexact Rounded
+fmax3506 fma 1 77e-999 -1 -> -1.00000000 Inexact Rounded
+fmax3507 fma 1 77e-999999 -1 -> -1.00000000 Inexact Rounded
+
+fmax3510 fma 1 77e-7 -10 -> -9.9999923
+fmax3511 fma 1 77e-8 -10 -> -9.99999923
+fmax3512 fma 1 77e-9 -10 -> -9.99999992 Inexact Rounded
+fmax3513 fma 1 77e-10 -10 -> -9.99999999 Inexact Rounded
+fmax3514 fma 1 77e-11 -10 -> -10.0000000 Inexact Rounded
+fmax3515 fma 1 77e-12 -10 -> -10.0000000 Inexact Rounded
+fmax3516 fma 1 77e-999 -10 -> -10.0000000 Inexact Rounded
+fmax3517 fma 1 77e-999999 -10 -> -10.0000000 Inexact Rounded
+
+
+-- long operands
+maxexponent: 999
+minexponent: -999
+precision: 9
+fmax3521 fma 1 12345678000 0 -> 1.23456780E+10 Rounded
+fmax3522 fma 1 0 12345678000 -> 1.23456780E+10 Rounded
+fmax3523 fma 1 1234567800 0 -> 1.23456780E+9 Rounded
+fmax3524 fma 1 0 1234567800 -> 1.23456780E+9 Rounded
+fmax3525 fma 1 1234567890 0 -> 1.23456789E+9 Rounded
+fmax3526 fma 1 0 1234567890 -> 1.23456789E+9 Rounded
+fmax3527 fma 1 1234567891 0 -> 1.23456789E+9 Inexact Rounded
+fmax3528 fma 1 0 1234567891 -> 1.23456789E+9 Inexact Rounded
+fmax3529 fma 1 12345678901 0 -> 1.23456789E+10 Inexact Rounded
+fmax3530 fma 1 0 12345678901 -> 1.23456789E+10 Inexact Rounded
+fmax3531 fma 1 1234567896 0 -> 1.23456790E+9 Inexact Rounded
+fmax3532 fma 1 0 1234567896 -> 1.23456790E+9 Inexact Rounded
+
+precision: 15
+-- still checking
+fmax3541 fma 1 12345678000 0 -> 12345678000
+fmax3542 fma 1 0 12345678000 -> 12345678000
+fmax3543 fma 1 1234567800 0 -> 1234567800
+fmax3544 fma 1 0 1234567800 -> 1234567800
+fmax3545 fma 1 1234567890 0 -> 1234567890
+fmax3546 fma 1 0 1234567890 -> 1234567890
+fmax3547 fma 1 1234567891 0 -> 1234567891
+fmax3548 fma 1 0 1234567891 -> 1234567891
+fmax3549 fma 1 12345678901 0 -> 12345678901
+fmax3550 fma 1 0 12345678901 -> 12345678901
+fmax3551 fma 1 1234567896 0 -> 1234567896
+fmax3552 fma 1 0 1234567896 -> 1234567896
+
+-- verify a query
+precision: 16
+maxExponent: +394
+minExponent: -393
+rounding: down
+fmax3561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
+fmax3562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
+-- and using decimal64 bounds...
+precision: 16
+maxExponent: +384
+minExponent: -383
+rounding: down
+fmax3563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
+fmax3564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
+
+
+-- some more residue effects with extreme rounding
+precision: 9
+rounding: half_up
+fmax3601 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+rounding: half_even
+fmax3602 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+rounding: half_down
+fmax3603 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+rounding: floor
+fmax3604 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+rounding: ceiling
+fmax3605 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded
+rounding: up
+fmax3606 fma 1 123456789 0.000001 -> 123456790 Inexact Rounded
+rounding: down
+fmax3607 fma 1 123456789 0.000001 -> 123456789 Inexact Rounded
+
+rounding: half_up
+fmax3611 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: half_even
+fmax3612 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: half_down
+fmax3613 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: floor
+fmax3614 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded
+rounding: ceiling
+fmax3615 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: up
+fmax3616 fma 1 123456789 -0.000001 -> 123456789 Inexact Rounded
+rounding: down
+fmax3617 fma 1 123456789 -0.000001 -> 123456788 Inexact Rounded
+
+rounding: half_up
+fmax3621 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+rounding: half_even
+fmax3622 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+rounding: half_down
+fmax3623 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+rounding: floor
+fmax3624 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+rounding: ceiling
+fmax3625 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded
+rounding: up
+fmax3626 fma 1 123456789 0.499999 -> 123456790 Inexact Rounded
+rounding: down
+fmax3627 fma 1 123456789 0.499999 -> 123456789 Inexact Rounded
+
+rounding: half_up
+fmax3631 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: half_even
+fmax3632 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: half_down
+fmax3633 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: floor
+fmax3634 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded
+rounding: ceiling
+fmax3635 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: up
+fmax3636 fma 1 123456789 -0.499999 -> 123456789 Inexact Rounded
+rounding: down
+fmax3637 fma 1 123456789 -0.499999 -> 123456788 Inexact Rounded
+
+rounding: half_up
+fmax3641 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: half_even
+fmax3642 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: half_down
+fmax3643 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: floor
+fmax3644 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded
+rounding: ceiling
+fmax3645 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: up
+fmax3646 fma 1 123456789 0.500001 -> 123456790 Inexact Rounded
+rounding: down
+fmax3647 fma 1 123456789 0.500001 -> 123456789 Inexact Rounded
+
+rounding: half_up
+fmax3651 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+rounding: half_even
+fmax3652 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+rounding: half_down
+fmax3653 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+rounding: floor
+fmax3654 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+rounding: ceiling
+fmax3655 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded
+rounding: up
+fmax3656 fma 1 123456789 -0.500001 -> 123456789 Inexact Rounded
+rounding: down
+fmax3657 fma 1 123456789 -0.500001 -> 123456788 Inexact Rounded
+
+-- long operand triangle
+rounding: half_up
+precision: 37
+fmax3660 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114834538
+precision: 36
+fmax3661 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483454 Inexact Rounded
+precision: 35
+fmax3662 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148345 Inexact Rounded
+precision: 34
+fmax3663 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337114835 Inexact Rounded
+precision: 33
+fmax3664 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711483 Inexact Rounded
+precision: 32
+fmax3665 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371148 Inexact Rounded
+precision: 31
+fmax3666 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337115 Inexact Rounded
+precision: 30
+fmax3667 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892233711 Inexact Rounded
+precision: 29
+fmax3668 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223371 Inexact Rounded
+precision: 28
+fmax3669 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922337 Inexact Rounded
+precision: 27
+fmax3670 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892234 Inexact Rounded
+precision: 26
+fmax3671 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389223 Inexact Rounded
+precision: 25
+fmax3672 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023638922 Inexact Rounded
+precision: 24
+fmax3673 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102363892 Inexact Rounded
+precision: 23
+fmax3674 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236389 Inexact Rounded
+precision: 22
+fmax3675 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211023639 Inexact Rounded
+precision: 21
+fmax3676 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102364 Inexact Rounded
+precision: 20
+fmax3677 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110236 Inexact Rounded
+precision: 19
+fmax3678 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211024 Inexact Rounded
+precision: 18
+fmax3679 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221102 Inexact Rounded
+precision: 17
+fmax3680 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422110 Inexact Rounded
+precision: 16
+fmax3681 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42211 Inexact Rounded
+precision: 15
+fmax3682 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4221 Inexact Rounded
+precision: 14
+fmax3683 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.422 Inexact Rounded
+precision: 13
+fmax3684 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.42 Inexact Rounded
+precision: 12
+fmax3685 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166.4 Inexact Rounded
+precision: 11
+fmax3686 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 98471174166 Inexact Rounded
+precision: 10
+fmax3687 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117417E+10 Inexact Rounded
+precision: 9
+fmax3688 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84711742E+10 Inexact Rounded
+precision: 8
+fmax3689 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471174E+10 Inexact Rounded
+precision: 7
+fmax3690 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847117E+10 Inexact Rounded
+precision: 6
+fmax3691 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.84712E+10 Inexact Rounded
+precision: 5
+fmax3692 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8471E+10 Inexact Rounded
+precision: 4
+fmax3693 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.847E+10 Inexact Rounded
+precision: 3
+fmax3694 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.85E+10 Inexact Rounded
+precision: 2
+fmax3695 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 9.8E+10 Inexact Rounded
+precision: 1
+fmax3696 fma 1 98471198160.56524417578665886060 -23994.14313393939743548945165462 -> 1E+11 Inexact Rounded
+
+-- more zeros, etc.
+rounding: half_up
+precision: 9
+
+fmax3701 fma 1 5.00 1.00E-3 -> 5.00100
+fmax3702 fma 1 00.00 0.000 -> 0.000
+fmax3703 fma 1 00.00 0E-3 -> 0.000
+fmax3704 fma 1 0E-3 00.00 -> 0.000
+
+fmax3710 fma 1 0E+3 00.00 -> 0.00
+fmax3711 fma 1 0E+3 00.0 -> 0.0
+fmax3712 fma 1 0E+3 00. -> 0
+fmax3713 fma 1 0E+3 00.E+1 -> 0E+1
+fmax3714 fma 1 0E+3 00.E+2 -> 0E+2
+fmax3715 fma 1 0E+3 00.E+3 -> 0E+3
+fmax3716 fma 1 0E+3 00.E+4 -> 0E+3
+fmax3717 fma 1 0E+3 00.E+5 -> 0E+3
+fmax3718 fma 1 0E+3 -00.0 -> 0.0
+fmax3719 fma 1 0E+3 -00. -> 0
+fmax3731 fma 1 0E+3 -00.E+1 -> 0E+1
+
+fmax3720 fma 1 00.00 0E+3 -> 0.00
+fmax3721 fma 1 00.0 0E+3 -> 0.0
+fmax3722 fma 1 00. 0E+3 -> 0
+fmax3723 fma 1 00.E+1 0E+3 -> 0E+1
+fmax3724 fma 1 00.E+2 0E+3 -> 0E+2
+fmax3725 fma 1 00.E+3 0E+3 -> 0E+3
+fmax3726 fma 1 00.E+4 0E+3 -> 0E+3
+fmax3727 fma 1 00.E+5 0E+3 -> 0E+3
+fmax3728 fma 1 -00.00 0E+3 -> 0.00
+fmax3729 fma 1 -00.0 0E+3 -> 0.0
+fmax3730 fma 1 -00. 0E+3 -> 0
+
+fmax3732 fma 1 0 0 -> 0
+fmax3733 fma 1 0 -0 -> 0
+fmax3734 fma 1 -0 0 -> 0
+fmax3735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
+
+fmax3736 fma 1 1 -1 -> 0
+fmax3737 fma 1 -1 -1 -> -2
+fmax3738 fma 1 1 1 -> 2
+fmax3739 fma 1 -1 1 -> 0
+
+fmax3741 fma 1 0 -1 -> -1
+fmax3742 fma 1 -0 -1 -> -1
+fmax3743 fma 1 0 1 -> 1
+fmax3744 fma 1 -0 1 -> 1
+fmax3745 fma 1 -1 0 -> -1
+fmax3746 fma 1 -1 -0 -> -1
+fmax3747 fma 1 1 0 -> 1
+fmax3748 fma 1 1 -0 -> 1
+
+fmax3751 fma 1 0.0 -1 -> -1.0
+fmax3752 fma 1 -0.0 -1 -> -1.0
+fmax3753 fma 1 0.0 1 -> 1.0
+fmax3754 fma 1 -0.0 1 -> 1.0
+fmax3755 fma 1 -1.0 0 -> -1.0
+fmax3756 fma 1 -1.0 -0 -> -1.0
+fmax3757 fma 1 1.0 0 -> 1.0
+fmax3758 fma 1 1.0 -0 -> 1.0
+
+fmax3761 fma 1 0 -1.0 -> -1.0
+fmax3762 fma 1 -0 -1.0 -> -1.0
+fmax3763 fma 1 0 1.0 -> 1.0
+fmax3764 fma 1 -0 1.0 -> 1.0
+fmax3765 fma 1 -1 0.0 -> -1.0
+fmax3766 fma 1 -1 -0.0 -> -1.0
+fmax3767 fma 1 1 0.0 -> 1.0
+fmax3768 fma 1 1 -0.0 -> 1.0
+
+fmax3771 fma 1 0.0 -1.0 -> -1.0
+fmax3772 fma 1 -0.0 -1.0 -> -1.0
+fmax3773 fma 1 0.0 1.0 -> 1.0
+fmax3774 fma 1 -0.0 1.0 -> 1.0
+fmax3775 fma 1 -1.0 0.0 -> -1.0
+fmax3776 fma 1 -1.0 -0.0 -> -1.0
+fmax3777 fma 1 1.0 0.0 -> 1.0
+fmax3778 fma 1 1.0 -0.0 -> 1.0
+
+-- Specials
+fmax3780 fma 1 -Inf -Inf -> -Infinity
+fmax3781 fma 1 -Inf -1000 -> -Infinity
+fmax3782 fma 1 -Inf -1 -> -Infinity
+fmax3783 fma 1 -Inf -0 -> -Infinity
+fmax3784 fma 1 -Inf 0 -> -Infinity
+fmax3785 fma 1 -Inf 1 -> -Infinity
+fmax3786 fma 1 -Inf 1000 -> -Infinity
+fmax3787 fma 1 -1000 -Inf -> -Infinity
+fmax3788 fma 1 -Inf -Inf -> -Infinity
+fmax3789 fma 1 -1 -Inf -> -Infinity
+fmax3790 fma 1 -0 -Inf -> -Infinity
+fmax3791 fma 1 0 -Inf -> -Infinity
+fmax3792 fma 1 1 -Inf -> -Infinity
+fmax3793 fma 1 1000 -Inf -> -Infinity
+fmax3794 fma 1 Inf -Inf -> NaN Invalid_operation
+
+fmax3800 fma 1 Inf -Inf -> NaN Invalid_operation
+fmax3801 fma 1 Inf -1000 -> Infinity
+fmax3802 fma 1 Inf -1 -> Infinity
+fmax3803 fma 1 Inf -0 -> Infinity
+fmax3804 fma 1 Inf 0 -> Infinity
+fmax3805 fma 1 Inf 1 -> Infinity
+fmax3806 fma 1 Inf 1000 -> Infinity
+fmax3807 fma 1 Inf Inf -> Infinity
+fmax3808 fma 1 -1000 Inf -> Infinity
+fmax3809 fma 1 -Inf Inf -> NaN Invalid_operation
+fmax3810 fma 1 -1 Inf -> Infinity
+fmax3811 fma 1 -0 Inf -> Infinity
+fmax3812 fma 1 0 Inf -> Infinity
+fmax3813 fma 1 1 Inf -> Infinity
+fmax3814 fma 1 1000 Inf -> Infinity
+fmax3815 fma 1 Inf Inf -> Infinity
+
+fmax3821 fma 1 NaN -Inf -> NaN
+fmax3822 fma 1 NaN -1000 -> NaN
+fmax3823 fma 1 NaN -1 -> NaN
+fmax3824 fma 1 NaN -0 -> NaN
+fmax3825 fma 1 NaN 0 -> NaN
+fmax3826 fma 1 NaN 1 -> NaN
+fmax3827 fma 1 NaN 1000 -> NaN
+fmax3828 fma 1 NaN Inf -> NaN
+fmax3829 fma 1 NaN NaN -> NaN
+fmax3830 fma 1 -Inf NaN -> NaN
+fmax3831 fma 1 -1000 NaN -> NaN
+fmax3832 fma 1 -1 NaN -> NaN
+fmax3833 fma 1 -0 NaN -> NaN
+fmax3834 fma 1 0 NaN -> NaN
+fmax3835 fma 1 1 NaN -> NaN
+fmax3836 fma 1 1000 NaN -> NaN
+fmax3837 fma 1 Inf NaN -> NaN
+
+fmax3841 fma 1 sNaN -Inf -> NaN Invalid_operation
+fmax3842 fma 1 sNaN -1000 -> NaN Invalid_operation
+fmax3843 fma 1 sNaN -1 -> NaN Invalid_operation
+fmax3844 fma 1 sNaN -0 -> NaN Invalid_operation
+fmax3845 fma 1 sNaN 0 -> NaN Invalid_operation
+fmax3846 fma 1 sNaN 1 -> NaN Invalid_operation
+fmax3847 fma 1 sNaN 1000 -> NaN Invalid_operation
+fmax3848 fma 1 sNaN NaN -> NaN Invalid_operation
+fmax3849 fma 1 sNaN sNaN -> NaN Invalid_operation
+fmax3850 fma 1 NaN sNaN -> NaN Invalid_operation
+fmax3851 fma 1 -Inf sNaN -> NaN Invalid_operation
+fmax3852 fma 1 -1000 sNaN -> NaN Invalid_operation
+fmax3853 fma 1 -1 sNaN -> NaN Invalid_operation
+fmax3854 fma 1 -0 sNaN -> NaN Invalid_operation
+fmax3855 fma 1 0 sNaN -> NaN Invalid_operation
+fmax3856 fma 1 1 sNaN -> NaN Invalid_operation
+fmax3857 fma 1 1000 sNaN -> NaN Invalid_operation
+fmax3858 fma 1 Inf sNaN -> NaN Invalid_operation
+fmax3859 fma 1 NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+fmax3861 fma 1 NaN1 -Inf -> NaN1
+fmax3862 fma 1 +NaN2 -1000 -> NaN2
+fmax3863 fma 1 NaN3 1000 -> NaN3
+fmax3864 fma 1 NaN4 Inf -> NaN4
+fmax3865 fma 1 NaN5 +NaN6 -> NaN5
+fmax3866 fma 1 -Inf NaN7 -> NaN7
+fmax3867 fma 1 -1000 NaN8 -> NaN8
+fmax3868 fma 1 1000 NaN9 -> NaN9
+fmax3869 fma 1 Inf +NaN10 -> NaN10
+fmax3871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
+fmax3872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
+fmax3873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
+fmax3874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
+fmax3875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
+fmax3876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
+fmax3877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
+fmax3878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
+fmax3879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
+fmax3880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
+fmax3881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
+fmax3882 fma 1 -NaN26 NaN28 -> -NaN26
+fmax3883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+fmax3884 fma 1 1000 -NaN30 -> -NaN30
+fmax3885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- overflow, underflow and subnormal tests
+maxexponent: 999999
+minexponent: -999999
+precision: 9
+fmax3890 fma 1 1E+999999 9E+999999 -> Infinity Overflow Inexact Rounded
+fmax3891 fma 1 9E+999999 1E+999999 -> Infinity Overflow Inexact Rounded
+fmax3892 fma 1 -1.1E-999999 1E-999999 -> -1E-1000000 Subnormal
+fmax3893 fma 1 1E-999999 -1.1e-999999 -> -1E-1000000 Subnormal
+fmax3894 fma 1 -1.0001E-999999 1E-999999 -> -1E-1000003 Subnormal
+fmax3895 fma 1 1E-999999 -1.0001e-999999 -> -1E-1000003 Subnormal
+fmax3896 fma 1 -1E+999999 -9E+999999 -> -Infinity Overflow Inexact Rounded
+fmax3897 fma 1 -9E+999999 -1E+999999 -> -Infinity Overflow Inexact Rounded
+fmax3898 fma 1 +1.1E-999999 -1E-999999 -> 1E-1000000 Subnormal
+fmax3899 fma 1 -1E-999999 +1.1e-999999 -> 1E-1000000 Subnormal
+fmax3900 fma 1 +1.0001E-999999 -1E-999999 -> 1E-1000003 Subnormal
+fmax3901 fma 1 -1E-999999 +1.0001e-999999 -> 1E-1000003 Subnormal
+fmax3902 fma 1 -1E+999999 +9E+999999 -> 8E+999999
+fmax3903 fma 1 -9E+999999 +1E+999999 -> -8E+999999
+
+precision: 3
+fmax3904 fma 1 0 -9.999E+999999 -> -Infinity Inexact Overflow Rounded
+fmax3905 fma 1 -9.999E+999999 0 -> -Infinity Inexact Overflow Rounded
+fmax3906 fma 1 0 9.999E+999999 -> Infinity Inexact Overflow Rounded
+fmax3907 fma 1 9.999E+999999 0 -> Infinity Inexact Overflow Rounded
+
+precision: 3
+maxexponent: 999
+minexponent: -999
+fmax3910 fma 1 1.00E-999 0 -> 1.00E-999
+fmax3911 fma 1 0.1E-999 0 -> 1E-1000 Subnormal
+fmax3912 fma 1 0.10E-999 0 -> 1.0E-1000 Subnormal
+fmax3913 fma 1 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded
+fmax3914 fma 1 0.01E-999 0 -> 1E-1001 Subnormal
+-- next is rounded to Nmin
+fmax3915 fma 1 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow
+fmax3916 fma 1 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3917 fma 1 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow
+fmax3918 fma 1 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3919 fma 1 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3920 fma 1 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+
+fmax3930 fma 1 -1.00E-999 0 -> -1.00E-999
+fmax3931 fma 1 -0.1E-999 0 -> -1E-1000 Subnormal
+fmax3932 fma 1 -0.10E-999 0 -> -1.0E-1000 Subnormal
+fmax3933 fma 1 -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded
+fmax3934 fma 1 -0.01E-999 0 -> -1E-1001 Subnormal
+-- next is rounded to Nmin
+fmax3935 fma 1 -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow
+fmax3936 fma 1 -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3937 fma 1 -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow
+fmax3938 fma 1 -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3939 fma 1 -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3940 fma 1 -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+
+-- some non-zero subnormal fma 1 s
+fmax3950 fma 1 1.00E-999 0.1E-999 -> 1.10E-999
+fmax3951 fma 1 0.1E-999 0.1E-999 -> 2E-1000 Subnormal
+fmax3952 fma 1 0.10E-999 0.1E-999 -> 2.0E-1000 Subnormal
+fmax3953 fma 1 0.100E-999 0.1E-999 -> 2.0E-1000 Subnormal Rounded
+fmax3954 fma 1 0.01E-999 0.1E-999 -> 1.1E-1000 Subnormal
+fmax3955 fma 1 0.999E-999 0.1E-999 -> 1.10E-999 Inexact Rounded
+fmax3956 fma 1 0.099E-999 0.1E-999 -> 2.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3957 fma 1 0.009E-999 0.1E-999 -> 1.1E-1000 Inexact Rounded Subnormal Underflow
+fmax3958 fma 1 0.001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3959 fma 1 0.0009E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3960 fma 1 0.0001E-999 0.1E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+-- negatives...
+fmax3961 fma 1 1.00E-999 -0.1E-999 -> 9.0E-1000 Subnormal
+fmax3962 fma 1 0.1E-999 -0.1E-999 -> 0E-1000
+fmax3963 fma 1 0.10E-999 -0.1E-999 -> 0E-1001
+fmax3964 fma 1 0.100E-999 -0.1E-999 -> 0E-1001 Clamped
+fmax3965 fma 1 0.01E-999 -0.1E-999 -> -9E-1001 Subnormal
+fmax3966 fma 1 0.999E-999 -0.1E-999 -> 9.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3967 fma 1 0.099E-999 -0.1E-999 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+fmax3968 fma 1 0.009E-999 -0.1E-999 -> -9E-1001 Inexact Rounded Subnormal Underflow
+fmax3969 fma 1 0.001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3970 fma 1 0.0009E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+fmax3971 fma 1 0.0001E-999 -0.1E-999 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+
+-- some 'real' numbers
+maxExponent: 384
+minExponent: -383
+precision: 8
+fmax3566 fma 1 99999061735E-394 0E-394 -> 9.999906E-384 Inexact Rounded Underflow Subnormal
+precision: 7
+fmax3567 fma 1 99999061735E-394 0E-394 -> 9.99991E-384 Inexact Rounded Underflow Subnormal
+precision: 6
+fmax3568 fma 1 99999061735E-394 0E-394 -> 9.9999E-384 Inexact Rounded Underflow Subnormal
+
+-- now the case where we can get underflow but the result is normal
+-- [note this can't happen if the operands are also bounded, as we
+-- cannot represent 1E-399, for example]
+precision: 16
+rounding: half_up
+maxExponent: 384
+minExponent: -383
+
+fmax3571 fma 1 1E-383 0 -> 1E-383
+fmax3572 fma 1 1E-384 0 -> 1E-384 Subnormal
+fmax3573 fma 1 1E-383 1E-384 -> 1.1E-383
+fmax3574 subtract 1E-383 1E-384 -> 9E-384 Subnormal
+
+-- Here we explore the boundary of rounding a subnormal to Nmin
+fmax3575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
+fmax3576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
+fmax3577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax3578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax3579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax3580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+-- check for double-rounded subnormals
+precision: 5
+maxexponent: 79
+minexponent: -79
+-- Add: lhs and rhs 0
+fmax31001 fma 1 1.52444E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31002 fma 1 1.52445E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31003 fma 1 1.52446E-80 0 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31004 fma 1 0 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31005 fma 1 0 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31006 fma 1 0 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+
+-- Add: lhs >> rhs and vice versa
+fmax31011 fma 1 1.52444E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31012 fma 1 1.52445E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31013 fma 1 1.52446E-80 1E-100 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31014 fma 1 1E-100 1.52444E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31015 fma 1 1E-100 1.52445E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+fmax31016 fma 1 1E-100 1.52446E-80 -> 1.524E-80 Inexact Rounded Subnormal Underflow
+
+-- Add: lhs + rhs fma 1 ition carried out
+fmax31021 fma 1 1.52443E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31022 fma 1 1.52444E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31023 fma 1 1.52445E-80 1.00001E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31024 fma 1 1.00001E-80 1.52443E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31025 fma 1 1.00001E-80 1.52444E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+fmax31026 fma 1 1.00001E-80 1.52445E-80 -> 2.524E-80 Inexact Rounded Subnormal Underflow
+
+-- And for round down full and subnormal results
+precision: 16
+maxExponent: +384
+minExponent: -383
+rounding: down
+
+fmax31100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
+fmax31101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
+fmax31103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
+fmax31104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
+fmax31105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
+fmax31106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
+fmax31107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
+fmax31108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
+fmax31109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+fmax31110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
+fmax31111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
+fmax31113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
+fmax31114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
+fmax31115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
+fmax31116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
+fmax31117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
+fmax31118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
+fmax31119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
+
+rounding: down
+precision: 7
+maxExponent: +96
+minExponent: -95
+fmax31130 fma 1 1 -1e-200 -> 0.9999999 Rounded Inexact
+-- subnormal boundary
+fmax31131 fma 1 1.000000E-94 -1e-200 -> 9.999999E-95 Rounded Inexact
+fmax31132 fma 1 1.000001E-95 -1e-200 -> 1.000000E-95 Rounded Inexact
+fmax31133 fma 1 1.000000E-95 -1e-200 -> 9.99999E-96 Rounded Inexact Subnormal Underflow
+fmax31134 fma 1 0.999999E-95 -1e-200 -> 9.99998E-96 Rounded Inexact Subnormal Underflow
+fmax31135 fma 1 0.001000E-95 -1e-200 -> 9.99E-99 Rounded Inexact Subnormal Underflow
+fmax31136 fma 1 0.000999E-95 -1e-200 -> 9.98E-99 Rounded Inexact Subnormal Underflow
+fmax31137 fma 1 1.000000E-95 -1e-101 -> 9.99999E-96 Subnormal
+fmax31138 fma 1 10000E-101 -1e-200 -> 9.999E-98 Subnormal Inexact Rounded Underflow
+fmax31139 fma 1 1000E-101 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow
+fmax31140 fma 1 100E-101 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow
+fmax31141 fma 1 10E-101 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow
+fmax31142 fma 1 1E-101 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31143 fma 1 0E-101 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31144 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+
+fmax31151 fma 1 10000E-102 -1e-200 -> 9.99E-99 Subnormal Inexact Rounded Underflow
+fmax31152 fma 1 1000E-102 -1e-200 -> 9.9E-100 Subnormal Inexact Rounded Underflow
+fmax31153 fma 1 100E-102 -1e-200 -> 9E-101 Subnormal Inexact Rounded Underflow
+fmax31154 fma 1 10E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31155 fma 1 1E-102 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31156 fma 1 0E-102 -1e-200 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31157 fma 1 1E-103 -1e-200 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+
+fmax31160 fma 1 100E-105 -1e-101 -> -0E-101 Subnormal Inexact Rounded Underflow Clamped
+fmax31161 fma 1 100E-105 -1e-201 -> 0E-101 Subnormal Inexact Rounded Underflow Clamped
+
+-- tests based on Gunnar Degnbol's edge case
+precision: 15
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+fmax31200 fma 1 1E15 -0.5 -> 1.00000000000000E+15 Inexact Rounded
+fmax31201 fma 1 1E15 -0.50 -> 1.00000000000000E+15 Inexact Rounded
+fmax31210 fma 1 1E15 -0.51 -> 999999999999999 Inexact Rounded
+fmax31211 fma 1 1E15 -0.501 -> 999999999999999 Inexact Rounded
+fmax31212 fma 1 1E15 -0.5001 -> 999999999999999 Inexact Rounded
+fmax31213 fma 1 1E15 -0.50001 -> 999999999999999 Inexact Rounded
+fmax31214 fma 1 1E15 -0.500001 -> 999999999999999 Inexact Rounded
+fmax31215 fma 1 1E15 -0.5000001 -> 999999999999999 Inexact Rounded
+fmax31216 fma 1 1E15 -0.50000001 -> 999999999999999 Inexact Rounded
+fmax31217 fma 1 1E15 -0.500000001 -> 999999999999999 Inexact Rounded
+fmax31218 fma 1 1E15 -0.5000000001 -> 999999999999999 Inexact Rounded
+fmax31219 fma 1 1E15 -0.50000000001 -> 999999999999999 Inexact Rounded
+fmax31220 fma 1 1E15 -0.500000000001 -> 999999999999999 Inexact Rounded
+fmax31221 fma 1 1E15 -0.5000000000001 -> 999999999999999 Inexact Rounded
+fmax31222 fma 1 1E15 -0.50000000000001 -> 999999999999999 Inexact Rounded
+fmax31223 fma 1 1E15 -0.500000000000001 -> 999999999999999 Inexact Rounded
+fmax31224 fma 1 1E15 -0.5000000000000001 -> 999999999999999 Inexact Rounded
+fmax31225 fma 1 1E15 -0.5000000000000000 -> 1.00000000000000E+15 Inexact Rounded
+fmax31230 fma 1 1E15 -5000000.000000001 -> 999999995000000 Inexact Rounded
+
+precision: 16
+
+fmax31300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
+fmax31310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
+fmax31311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
+fmax31312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
+fmax31313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
+fmax31314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
+fmax31315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
+fmax31316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
+fmax31317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
+fmax31318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
+fmax31319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
+fmax31320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
+fmax31321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
+fmax31322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
+fmax31323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
+fmax31324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
+fmax31325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
+fmax31339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
+
+fmax31340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
+fmax31341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
+
+fmax31349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
+fmax31350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
+fmax31351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
+fmax31352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
+fmax31353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
+fmax31354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
+fmax31355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
+fmax31356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
+fmax31357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
+fmax31358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
+fmax31359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
+fmax31360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
+fmax31361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
+fmax31362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
+fmax31363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
+fmax31364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
+fmax31365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
+fmax31379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
+fmax31380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
+fmax31381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
+fmax31382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
+fmax31395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
+fmax31396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+precision: 15
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+fmax31400 fma 1 0 1.23456789012345 -> 1.23456789012345
+fmax31401 fma 1 0 1.23456789012345E-1 -> 0.123456789012345
+fmax31402 fma 1 0 1.23456789012345E-2 -> 0.0123456789012345
+fmax31403 fma 1 0 1.23456789012345E-3 -> 0.00123456789012345
+fmax31404 fma 1 0 1.23456789012345E-4 -> 0.000123456789012345
+fmax31405 fma 1 0 1.23456789012345E-5 -> 0.0000123456789012345
+fmax31406 fma 1 0 1.23456789012345E-6 -> 0.00000123456789012345
+fmax31407 fma 1 0 1.23456789012345E-7 -> 1.23456789012345E-7
+fmax31408 fma 1 0 1.23456789012345E-8 -> 1.23456789012345E-8
+fmax31409 fma 1 0 1.23456789012345E-9 -> 1.23456789012345E-9
+fmax31410 fma 1 0 1.23456789012345E-10 -> 1.23456789012345E-10
+fmax31411 fma 1 0 1.23456789012345E-11 -> 1.23456789012345E-11
+fmax31412 fma 1 0 1.23456789012345E-12 -> 1.23456789012345E-12
+fmax31413 fma 1 0 1.23456789012345E-13 -> 1.23456789012345E-13
+fmax31414 fma 1 0 1.23456789012345E-14 -> 1.23456789012345E-14
+fmax31415 fma 1 0 1.23456789012345E-15 -> 1.23456789012345E-15
+fmax31416 fma 1 0 1.23456789012345E-16 -> 1.23456789012345E-16
+fmax31417 fma 1 0 1.23456789012345E-17 -> 1.23456789012345E-17
+fmax31418 fma 1 0 1.23456789012345E-18 -> 1.23456789012345E-18
+fmax31419 fma 1 0 1.23456789012345E-19 -> 1.23456789012345E-19
+
+-- same, precision 16..
+precision: 16
+fmax31420 fma 1 0 1.123456789012345 -> 1.123456789012345
+fmax31421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
+fmax31422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
+fmax31423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
+fmax31424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
+fmax31425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
+fmax31426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
+fmax31427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
+fmax31428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
+fmax31429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
+fmax31430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
+fmax31431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
+fmax31432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
+fmax31433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
+fmax31434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
+fmax31435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
+fmax31436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
+fmax31437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
+fmax31438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
+fmax31439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+fmax31440 fma 1 1.123456789012345 0 -> 1.123456789012345
+fmax31441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
+fmax31442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
+fmax31443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
+fmax31444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
+fmax31445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
+fmax31446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
+fmax31447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
+fmax31448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
+fmax31449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
+fmax31450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
+fmax31451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
+fmax31452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
+fmax31453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
+fmax31454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
+fmax31455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
+fmax31456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
+fmax31457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
+fmax31458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
+fmax31459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+fmax31460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
+fmax31461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
+fmax31462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
+fmax31463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
+fmax31464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
+fmax31465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
+fmax31466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
+fmax31467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
+fmax31468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
+fmax31469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
+fmax31470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
+fmax31471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
+fmax31472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
+fmax31473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
+fmax31474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
+fmax31475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+fmax31476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
+fmax31477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
+fmax31478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
+fmax31479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+precision: 16
+maxExponent: 384
+minexponent: -383
+
+rounding: half_up
+-- exact zeros from zeros
+fmax31500 fma 1 0 0E-19 -> 0E-19
+fmax31501 fma 1 -0 0E-19 -> 0E-19
+fmax31502 fma 1 0 -0E-19 -> 0E-19
+fmax31503 fma 1 -0 -0E-19 -> -0E-19
+fmax31504 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: half_down
+-- exact zeros from zeros
+fmax31520 fma 1 0 0E-19 -> 0E-19
+fmax31521 fma 1 -0 0E-19 -> 0E-19
+fmax31522 fma 1 0 -0E-19 -> 0E-19
+fmax31523 fma 1 -0 -0E-19 -> -0E-19
+fmax31524 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: half_even
+-- exact zeros from zeros
+fmax31540 fma 1 0 0E-19 -> 0E-19
+fmax31541 fma 1 -0 0E-19 -> 0E-19
+fmax31542 fma 1 0 -0E-19 -> 0E-19
+fmax31543 fma 1 -0 -0E-19 -> -0E-19
+fmax31544 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: up
+-- exact zeros from zeros
+fmax31560 fma 1 0 0E-19 -> 0E-19
+fmax31561 fma 1 -0 0E-19 -> 0E-19
+fmax31562 fma 1 0 -0E-19 -> 0E-19
+fmax31563 fma 1 -0 -0E-19 -> -0E-19
+fmax31564 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+fmax31574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+fmax31575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+rounding: down
+-- exact zeros from zeros
+fmax31580 fma 1 0 0E-19 -> 0E-19
+fmax31581 fma 1 -0 0E-19 -> 0E-19
+fmax31582 fma 1 0 -0E-19 -> 0E-19
+fmax31583 fma 1 -0 -0E-19 -> -0E-19
+fmax31584 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: ceiling
+-- exact zeros from zeros
+fmax31600 fma 1 0 0E-19 -> 0E-19
+fmax31601 fma 1 -0 0E-19 -> 0E-19
+fmax31602 fma 1 0 -0E-19 -> 0E-19
+fmax31603 fma 1 -0 -0E-19 -> -0E-19
+fmax31604 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax31606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax31607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax31615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax31616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax31617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax31618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+fmax31620 fma 1 0 0E-19 -> 0E-19
+fmax31621 fma 1 -0 0E-19 -> -0E-19 -- *
+fmax31622 fma 1 0 -0E-19 -> -0E-19 -- *
+fmax31623 fma 1 -0 -0E-19 -> -0E-19
+fmax31624 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax31625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- *
+fmax31626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- *
+fmax31627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax31631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+fmax31634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+fmax31635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax31636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- *
+fmax31637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- *
+fmax31638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+-- BigDecimal problem testcases 2006.01.23
+precision: 16
+maxExponent: 384
+minexponent: -383
+
+rounding: down
+precision: 7
+fmax31651 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 6
+fmax31652 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 5
+fmax31653 fma 1 10001E+2 -2E+1 -> 1.0000E+6 Inexact Rounded
+precision: 4
+fmax31654 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded
+precision: 3
+fmax31655 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded
+precision: 2
+fmax31656 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded
+precision: 1
+fmax31657 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded
+
+rounding: half_even
+precision: 7
+fmax31661 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 6
+fmax31662 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 5
+fmax31663 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded
+precision: 4
+fmax31664 fma 1 10001E+2 -2E+1 -> 1.000E+6 Inexact Rounded
+precision: 3
+fmax31665 fma 1 10001E+2 -2E+1 -> 1.00E+6 Inexact Rounded
+precision: 2
+fmax31666 fma 1 10001E+2 -2E+1 -> 1.0E+6 Inexact Rounded
+precision: 1
+fmax31667 fma 1 10001E+2 -2E+1 -> 1E+6 Inexact Rounded
+
+rounding: up
+precision: 7
+fmax31671 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 6
+fmax31672 fma 1 10001E+2 -2E+1 -> 1.00008E+6
+precision: 5
+fmax31673 fma 1 10001E+2 -2E+1 -> 1.0001E+6 Inexact Rounded
+precision: 4
+fmax31674 fma 1 10001E+2 -2E+1 -> 1.001E+6 Inexact Rounded
+precision: 3
+fmax31675 fma 1 10001E+2 -2E+1 -> 1.01E+6 Inexact Rounded
+precision: 2
+fmax31676 fma 1 10001E+2 -2E+1 -> 1.1E+6 Inexact Rounded
+precision: 1
+fmax31677 fma 1 10001E+2 -2E+1 -> 2E+6 Inexact Rounded
+
+precision: 34
+rounding: half_up
+maxExponent: 6144
+minExponent: -6143
+-- Examples from SQL proposal (Krishna Kulkarni)
+fmax31701 fma 1 130E-2 120E-2 -> 2.50
+fmax31702 fma 1 130E-2 12E-1 -> 2.50
+fmax31703 fma 1 130E-2 1E0 -> 2.30
+fmax31704 fma 1 1E2 1E4 -> 1.01E+4
+fmax31705 subtract 130E-2 120E-2 -> 0.10
+fmax31706 subtract 130E-2 12E-1 -> 0.10
+fmax31707 subtract 130E-2 1E0 -> 0.30
+fmax31708 subtract 1E2 1E4 -> -9.9E+3
+
+------------------------------------------------------------------------
+-- Same as above, using decimal64 default parameters --
+------------------------------------------------------------------------
+precision: 16
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- [first group are 'quick confidence check']
+fmax36001 fma 1 1 1 -> 2
+fmax36002 fma 1 2 3 -> 5
+fmax36003 fma 1 '5.75' '3.3' -> 9.05
+fmax36004 fma 1 '5' '-3' -> 2
+fmax36005 fma 1 '-5' '-3' -> -8
+fmax36006 fma 1 '-7' '2.5' -> -4.5
+fmax36007 fma 1 '0.7' '0.3' -> 1.0
+fmax36008 fma 1 '1.25' '1.25' -> 2.50
+fmax36009 fma 1 '1.23456789' '1.00000000' -> '2.23456789'
+fmax36010 fma 1 '1.23456789' '1.00000011' -> '2.23456800'
+
+fmax36011 fma 1 '0.44444444444444444' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
+fmax36012 fma 1 '0.44444444444444440' '0.55555555555555555' -> '1.000000000000000' Inexact Rounded
+fmax36013 fma 1 '0.44444444444444444' '0.55555555555555550' -> '0.9999999999999999' Inexact Rounded
+fmax36014 fma 1 '0.444444444444444449' '0' -> '0.4444444444444444' Inexact Rounded
+fmax36015 fma 1 '0.4444444444444444499' '0' -> '0.4444444444444444' Inexact Rounded
+fmax36016 fma 1 '0.44444444444444444999' '0' -> '0.4444444444444444' Inexact Rounded
+fmax36017 fma 1 '0.44444444444444445000' '0' -> '0.4444444444444444' Inexact Rounded
+fmax36018 fma 1 '0.44444444444444445001' '0' -> '0.4444444444444445' Inexact Rounded
+fmax36019 fma 1 '0.4444444444444444501' '0' -> '0.4444444444444445' Inexact Rounded
+fmax36020 fma 1 '0.444444444444444451' '0' -> '0.4444444444444445' Inexact Rounded
+
+fmax36021 fma 1 0 1 -> 1
+fmax36022 fma 1 1 1 -> 2
+fmax36023 fma 1 2 1 -> 3
+fmax36024 fma 1 3 1 -> 4
+fmax36025 fma 1 4 1 -> 5
+fmax36026 fma 1 5 1 -> 6
+fmax36027 fma 1 6 1 -> 7
+fmax36028 fma 1 7 1 -> 8
+fmax36029 fma 1 8 1 -> 9
+fmax36030 fma 1 9 1 -> 10
+
+-- some carrying effects
+fmax36031 fma 1 '0.9998' '0.0000' -> '0.9998'
+fmax36032 fma 1 '0.9998' '0.0001' -> '0.9999'
+fmax36033 fma 1 '0.9998' '0.0002' -> '1.0000'
+fmax36034 fma 1 '0.9998' '0.0003' -> '1.0001'
+
+fmax36035 fma 1 '70' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+fmax36036 fma 1 '700' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+fmax36037 fma 1 '7000' '10000e+16' -> '1.000000000000000E+20' Inexact Rounded
+fmax36038 fma 1 '70000' '10000e+16' -> '1.000000000000001E+20' Inexact Rounded
+fmax36039 fma 1 '700000' '10000e+16' -> '1.000000000000007E+20' Rounded
+
+-- symmetry:
+fmax36040 fma 1 '10000e+16' '70' -> '1.000000000000000E+20' Inexact Rounded
+fmax36041 fma 1 '10000e+16' '700' -> '1.000000000000000E+20' Inexact Rounded
+fmax36042 fma 1 '10000e+16' '7000' -> '1.000000000000000E+20' Inexact Rounded
+fmax36044 fma 1 '10000e+16' '70000' -> '1.000000000000001E+20' Inexact Rounded
+fmax36045 fma 1 '10000e+16' '700000' -> '1.000000000000007E+20' Rounded
+
+fmax36046 fma 1 '10000e+9' '7' -> '10000000000007'
+fmax36047 fma 1 '10000e+9' '70' -> '10000000000070'
+fmax36048 fma 1 '10000e+9' '700' -> '10000000000700'
+fmax36049 fma 1 '10000e+9' '7000' -> '10000000007000'
+fmax36050 fma 1 '10000e+9' '70000' -> '10000000070000'
+fmax36051 fma 1 '10000e+9' '700000' -> '10000000700000'
+
+-- examples from decarith
+fmax36053 fma 1 '12' '7.00' -> '19.00'
+fmax36054 fma 1 '1.3' '-1.07' -> '0.23'
+fmax36055 fma 1 '1.3' '-1.30' -> '0.00'
+fmax36056 fma 1 '1.3' '-2.07' -> '-0.77'
+fmax36057 fma 1 '1E+2' '1E+4' -> '1.01E+4'
+
+-- from above
+fmax36061 fma 1 1 '0.1' -> '1.1'
+fmax36062 fma 1 1 '0.01' -> '1.01'
+fmax36063 fma 1 1 '0.001' -> '1.001'
+fmax36064 fma 1 1 '0.0001' -> '1.0001'
+fmax36065 fma 1 1 '0.00001' -> '1.00001'
+fmax36066 fma 1 1 '0.000001' -> '1.000001'
+fmax36067 fma 1 1 '0.0000001' -> '1.0000001'
+fmax36068 fma 1 1 '0.00000001' -> '1.00000001'
+
+-- some funny zeros [in case of bad signum]
+fmax36070 fma 1 1 0 -> 1
+fmax36071 fma 1 1 0. -> 1
+fmax36072 fma 1 1 .0 -> 1.0
+fmax36073 fma 1 1 0.0 -> 1.0
+fmax36074 fma 1 1 0.00 -> 1.00
+fmax36075 fma 1 0 1 -> 1
+fmax36076 fma 1 0. 1 -> 1
+fmax36077 fma 1 .0 1 -> 1.0
+fmax36078 fma 1 0.0 1 -> 1.0
+fmax36079 fma 1 0.00 1 -> 1.00
+
+-- some carries
+fmax36080 fma 1 9999999999999998 1 -> 9999999999999999
+fmax36081 fma 1 9999999999999999 1 -> 1.000000000000000E+16 Rounded
+fmax36082 fma 1 999999999999999 1 -> 1000000000000000
+fmax36083 fma 1 9999999999999 1 -> 10000000000000
+fmax36084 fma 1 99999999999 1 -> 100000000000
+fmax36085 fma 1 999999999 1 -> 1000000000
+fmax36086 fma 1 9999999 1 -> 10000000
+fmax36087 fma 1 99999 1 -> 100000
+fmax36088 fma 1 999 1 -> 1000
+fmax36089 fma 1 9 1 -> 10
+
+
+-- more LHS swaps
+fmax36090 fma 1 '-56267E-10' 0 -> '-0.0000056267'
+fmax36091 fma 1 '-56267E-6' 0 -> '-0.056267'
+fmax36092 fma 1 '-56267E-5' 0 -> '-0.56267'
+fmax36093 fma 1 '-56267E-4' 0 -> '-5.6267'
+fmax36094 fma 1 '-56267E-3' 0 -> '-56.267'
+fmax36095 fma 1 '-56267E-2' 0 -> '-562.67'
+fmax36096 fma 1 '-56267E-1' 0 -> '-5626.7'
+fmax36097 fma 1 '-56267E-0' 0 -> '-56267'
+fmax36098 fma 1 '-5E-10' 0 -> '-5E-10'
+fmax36099 fma 1 '-5E-7' 0 -> '-5E-7'
+fmax36100 fma 1 '-5E-6' 0 -> '-0.000005'
+fmax36101 fma 1 '-5E-5' 0 -> '-0.00005'
+fmax36102 fma 1 '-5E-4' 0 -> '-0.0005'
+fmax36103 fma 1 '-5E-1' 0 -> '-0.5'
+fmax36104 fma 1 '-5E0' 0 -> '-5'
+fmax36105 fma 1 '-5E1' 0 -> '-50'
+fmax36106 fma 1 '-5E5' 0 -> '-500000'
+fmax36107 fma 1 '-5E15' 0 -> '-5000000000000000'
+fmax36108 fma 1 '-5E16' 0 -> '-5.000000000000000E+16' Rounded
+fmax36109 fma 1 '-5E17' 0 -> '-5.000000000000000E+17' Rounded
+fmax36110 fma 1 '-5E18' 0 -> '-5.000000000000000E+18' Rounded
+fmax36111 fma 1 '-5E100' 0 -> '-5.000000000000000E+100' Rounded
+
+-- more RHS swaps
+fmax36113 fma 1 0 '-56267E-10' -> '-0.0000056267'
+fmax36114 fma 1 0 '-56267E-6' -> '-0.056267'
+fmax36116 fma 1 0 '-56267E-5' -> '-0.56267'
+fmax36117 fma 1 0 '-56267E-4' -> '-5.6267'
+fmax36119 fma 1 0 '-56267E-3' -> '-56.267'
+fmax36120 fma 1 0 '-56267E-2' -> '-562.67'
+fmax36121 fma 1 0 '-56267E-1' -> '-5626.7'
+fmax36122 fma 1 0 '-56267E-0' -> '-56267'
+fmax36123 fma 1 0 '-5E-10' -> '-5E-10'
+fmax36124 fma 1 0 '-5E-7' -> '-5E-7'
+fmax36125 fma 1 0 '-5E-6' -> '-0.000005'
+fmax36126 fma 1 0 '-5E-5' -> '-0.00005'
+fmax36127 fma 1 0 '-5E-4' -> '-0.0005'
+fmax36128 fma 1 0 '-5E-1' -> '-0.5'
+fmax36129 fma 1 0 '-5E0' -> '-5'
+fmax36130 fma 1 0 '-5E1' -> '-50'
+fmax36131 fma 1 0 '-5E5' -> '-500000'
+fmax36132 fma 1 0 '-5E15' -> '-5000000000000000'
+fmax36133 fma 1 0 '-5E16' -> '-5.000000000000000E+16' Rounded
+fmax36134 fma 1 0 '-5E17' -> '-5.000000000000000E+17' Rounded
+fmax36135 fma 1 0 '-5E18' -> '-5.000000000000000E+18' Rounded
+fmax36136 fma 1 0 '-5E100' -> '-5.000000000000000E+100' Rounded
+
+-- related
+fmax36137 fma 1 1 '0E-19' -> '1.000000000000000' Rounded
+fmax36138 fma 1 -1 '0E-19' -> '-1.000000000000000' Rounded
+fmax36139 fma 1 '0E-19' 1 -> '1.000000000000000' Rounded
+fmax36140 fma 1 '0E-19' -1 -> '-1.000000000000000' Rounded
+fmax36141 fma 1 1E+11 0.0000 -> '100000000000.0000'
+fmax36142 fma 1 1E+11 0.00000 -> '100000000000.0000' Rounded
+fmax36143 fma 1 0.000 1E+12 -> '1000000000000.000'
+fmax36144 fma 1 0.0000 1E+12 -> '1000000000000.000' Rounded
+
+-- [some of the next group are really constructor tests]
+fmax36146 fma 1 '00.0' 0 -> '0.0'
+fmax36147 fma 1 '0.00' 0 -> '0.00'
+fmax36148 fma 1 0 '0.00' -> '0.00'
+fmax36149 fma 1 0 '00.0' -> '0.0'
+fmax36150 fma 1 '00.0' '0.00' -> '0.00'
+fmax36151 fma 1 '0.00' '00.0' -> '0.00'
+fmax36152 fma 1 '3' '.3' -> '3.3'
+fmax36153 fma 1 '3.' '.3' -> '3.3'
+fmax36154 fma 1 '3.0' '.3' -> '3.3'
+fmax36155 fma 1 '3.00' '.3' -> '3.30'
+fmax36156 fma 1 '3' '3' -> '6'
+fmax36157 fma 1 '3' '+3' -> '6'
+fmax36158 fma 1 '3' '-3' -> '0'
+fmax36159 fma 1 '0.3' '-0.3' -> '0.0'
+fmax36160 fma 1 '0.03' '-0.03' -> '0.00'
+
+-- try borderline precision, with carries, etc.
+fmax36161 fma 1 '1E+13' '-1' -> '9999999999999'
+fmax36162 fma 1 '1E+13' '1.11' -> '10000000000001.11'
+fmax36163 fma 1 '1.11' '1E+13' -> '10000000000001.11'
+fmax36164 fma 1 '-1' '1E+13' -> '9999999999999'
+fmax36165 fma 1 '7E+13' '-1' -> '69999999999999'
+fmax36166 fma 1 '7E+13' '1.11' -> '70000000000001.11'
+fmax36167 fma 1 '1.11' '7E+13' -> '70000000000001.11'
+fmax36168 fma 1 '-1' '7E+13' -> '69999999999999'
+
+-- 1234567890123456 1234567890123456 1 234567890123456
+fmax36170 fma 1 '0.4444444444444444' '0.5555555555555563' -> '1.000000000000001' Inexact Rounded
+fmax36171 fma 1 '0.4444444444444444' '0.5555555555555562' -> '1.000000000000001' Inexact Rounded
+fmax36172 fma 1 '0.4444444444444444' '0.5555555555555561' -> '1.000000000000000' Inexact Rounded
+fmax36173 fma 1 '0.4444444444444444' '0.5555555555555560' -> '1.000000000000000' Inexact Rounded
+fmax36174 fma 1 '0.4444444444444444' '0.5555555555555559' -> '1.000000000000000' Inexact Rounded
+fmax36175 fma 1 '0.4444444444444444' '0.5555555555555558' -> '1.000000000000000' Inexact Rounded
+fmax36176 fma 1 '0.4444444444444444' '0.5555555555555557' -> '1.000000000000000' Inexact Rounded
+fmax36177 fma 1 '0.4444444444444444' '0.5555555555555556' -> '1.000000000000000' Rounded
+fmax36178 fma 1 '0.4444444444444444' '0.5555555555555555' -> '0.9999999999999999'
+fmax36179 fma 1 '0.4444444444444444' '0.5555555555555554' -> '0.9999999999999998'
+fmax36180 fma 1 '0.4444444444444444' '0.5555555555555553' -> '0.9999999999999997'
+fmax36181 fma 1 '0.4444444444444444' '0.5555555555555552' -> '0.9999999999999996'
+fmax36182 fma 1 '0.4444444444444444' '0.5555555555555551' -> '0.9999999999999995'
+fmax36183 fma 1 '0.4444444444444444' '0.5555555555555550' -> '0.9999999999999994'
+
+-- and some more, including residue effects and different roundings
+rounding: half_up
+fmax36200 fma 1 '6543210123456789' 0 -> '6543210123456789'
+fmax36201 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+fmax36202 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+fmax36203 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+fmax36204 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+fmax36205 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+fmax36206 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36207 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36208 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+fmax36209 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+fmax36210 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+fmax36211 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+fmax36212 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+fmax36213 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+fmax36214 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+fmax36215 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded
+fmax36216 fma 1 '6543210123456789' 1 -> '6543210123456790'
+fmax36217 fma 1 '6543210123456789' 1.000000001 -> '6543210123456790' Inexact Rounded
+fmax36218 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+fmax36219 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+rounding: half_even
+fmax36220 fma 1 '6543210123456789' 0 -> '6543210123456789'
+fmax36221 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+fmax36222 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+fmax36223 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+fmax36224 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+fmax36225 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+fmax36226 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36227 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36228 fma 1 '6543210123456789' 0.5 -> '6543210123456790' Inexact Rounded
+fmax36229 fma 1 '6543210123456789' 0.500000001 -> '6543210123456790' Inexact Rounded
+fmax36230 fma 1 '6543210123456789' 0.500001 -> '6543210123456790' Inexact Rounded
+fmax36231 fma 1 '6543210123456789' 0.51 -> '6543210123456790' Inexact Rounded
+fmax36232 fma 1 '6543210123456789' 0.6 -> '6543210123456790' Inexact Rounded
+fmax36233 fma 1 '6543210123456789' 0.9 -> '6543210123456790' Inexact Rounded
+fmax36234 fma 1 '6543210123456789' 0.99999 -> '6543210123456790' Inexact Rounded
+fmax36235 fma 1 '6543210123456789' 0.999999 -> '6543210123456790' Inexact Rounded
+fmax36236 fma 1 '6543210123456789' 1 -> '6543210123456790'
+fmax36237 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+fmax36238 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+fmax36239 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+-- critical few with even bottom digit...
+fmax36240 fma 1 '6543210123456788' 0.499999 -> '6543210123456788' Inexact Rounded
+fmax36241 fma 1 '6543210123456788' 0.5 -> '6543210123456788' Inexact Rounded
+fmax36242 fma 1 '6543210123456788' 0.500000001 -> '6543210123456789' Inexact Rounded
+
+rounding: down
+fmax36250 fma 1 '6543210123456789' 0 -> '6543210123456789'
+fmax36251 fma 1 '6543210123456789' 0.000000001 -> '6543210123456789' Inexact Rounded
+fmax36252 fma 1 '6543210123456789' 0.000001 -> '6543210123456789' Inexact Rounded
+fmax36253 fma 1 '6543210123456789' 0.1 -> '6543210123456789' Inexact Rounded
+fmax36254 fma 1 '6543210123456789' 0.4 -> '6543210123456789' Inexact Rounded
+fmax36255 fma 1 '6543210123456789' 0.49 -> '6543210123456789' Inexact Rounded
+fmax36256 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36257 fma 1 '6543210123456789' 0.499999 -> '6543210123456789' Inexact Rounded
+fmax36258 fma 1 '6543210123456789' 0.5 -> '6543210123456789' Inexact Rounded
+fmax36259 fma 1 '6543210123456789' 0.500000001 -> '6543210123456789' Inexact Rounded
+fmax36260 fma 1 '6543210123456789' 0.500001 -> '6543210123456789' Inexact Rounded
+fmax36261 fma 1 '6543210123456789' 0.51 -> '6543210123456789' Inexact Rounded
+fmax36262 fma 1 '6543210123456789' 0.6 -> '6543210123456789' Inexact Rounded
+fmax36263 fma 1 '6543210123456789' 0.9 -> '6543210123456789' Inexact Rounded
+fmax36264 fma 1 '6543210123456789' 0.99999 -> '6543210123456789' Inexact Rounded
+fmax36265 fma 1 '6543210123456789' 0.999999 -> '6543210123456789' Inexact Rounded
+fmax36266 fma 1 '6543210123456789' 1 -> '6543210123456790'
+fmax36267 fma 1 '6543210123456789' 1.00000001 -> '6543210123456790' Inexact Rounded
+fmax36268 fma 1 '6543210123456789' 1.00001 -> '6543210123456790' Inexact Rounded
+fmax36269 fma 1 '6543210123456789' 1.1 -> '6543210123456790' Inexact Rounded
+
+-- 1 in last place tests
+rounding: half_even
+fmax36301 fma 1 -1 1 -> 0
+fmax36302 fma 1 0 1 -> 1
+fmax36303 fma 1 1 1 -> 2
+fmax36304 fma 1 12 1 -> 13
+fmax36305 fma 1 98 1 -> 99
+fmax36306 fma 1 99 1 -> 100
+fmax36307 fma 1 100 1 -> 101
+fmax36308 fma 1 101 1 -> 102
+fmax36309 fma 1 -1 -1 -> -2
+fmax36310 fma 1 0 -1 -> -1
+fmax36311 fma 1 1 -1 -> 0
+fmax36312 fma 1 12 -1 -> 11
+fmax36313 fma 1 98 -1 -> 97
+fmax36314 fma 1 99 -1 -> 98
+fmax36315 fma 1 100 -1 -> 99
+fmax36316 fma 1 101 -1 -> 100
+
+fmax36321 fma 1 -0.01 0.01 -> 0.00
+fmax36322 fma 1 0.00 0.01 -> 0.01
+fmax36323 fma 1 0.01 0.01 -> 0.02
+fmax36324 fma 1 0.12 0.01 -> 0.13
+fmax36325 fma 1 0.98 0.01 -> 0.99
+fmax36326 fma 1 0.99 0.01 -> 1.00
+fmax36327 fma 1 1.00 0.01 -> 1.01
+fmax36328 fma 1 1.01 0.01 -> 1.02
+fmax36329 fma 1 -0.01 -0.01 -> -0.02
+fmax36330 fma 1 0.00 -0.01 -> -0.01
+fmax36331 fma 1 0.01 -0.01 -> 0.00
+fmax36332 fma 1 0.12 -0.01 -> 0.11
+fmax36333 fma 1 0.98 -0.01 -> 0.97
+fmax36334 fma 1 0.99 -0.01 -> 0.98
+fmax36335 fma 1 1.00 -0.01 -> 0.99
+fmax36336 fma 1 1.01 -0.01 -> 1.00
+
+-- some more cases where fma 1 ing 0 affects the coefficient
+fmax36340 fma 1 1E+3 0 -> 1000
+fmax36341 fma 1 1E+15 0 -> 1000000000000000
+fmax36342 fma 1 1E+16 0 -> 1.000000000000000E+16 Rounded
+fmax36343 fma 1 1E+17 0 -> 1.000000000000000E+17 Rounded
+-- which simply follow from these cases ...
+fmax36344 fma 1 1E+3 1 -> 1001
+fmax36345 fma 1 1E+15 1 -> 1000000000000001
+fmax36346 fma 1 1E+16 1 -> 1.000000000000000E+16 Inexact Rounded
+fmax36347 fma 1 1E+17 1 -> 1.000000000000000E+17 Inexact Rounded
+fmax36348 fma 1 1E+3 7 -> 1007
+fmax36349 fma 1 1E+15 7 -> 1000000000000007
+fmax36350 fma 1 1E+16 7 -> 1.000000000000001E+16 Inexact Rounded
+fmax36351 fma 1 1E+17 7 -> 1.000000000000000E+17 Inexact Rounded
+
+-- tryzeros cases
+fmax36361 fma 1 0E+50 10000E+1 -> 1.0000E+5
+fmax36362 fma 1 10000E+1 0E-50 -> 100000.0000000000 Rounded
+fmax36363 fma 1 10000E+1 10000E-50 -> 100000.0000000000 Rounded Inexact
+fmax36364 fma 1 12.34 0e-398 -> 12.34000000000000 Rounded
+
+-- ulp replacement tests
+fmax36400 fma 1 1 77e-14 -> 1.00000000000077
+fmax36401 fma 1 1 77e-15 -> 1.000000000000077
+fmax36402 fma 1 1 77e-16 -> 1.000000000000008 Inexact Rounded
+fmax36403 fma 1 1 77e-17 -> 1.000000000000001 Inexact Rounded
+fmax36404 fma 1 1 77e-18 -> 1.000000000000000 Inexact Rounded
+fmax36405 fma 1 1 77e-19 -> 1.000000000000000 Inexact Rounded
+fmax36406 fma 1 1 77e-99 -> 1.000000000000000 Inexact Rounded
+
+fmax36410 fma 1 10 77e-14 -> 10.00000000000077
+fmax36411 fma 1 10 77e-15 -> 10.00000000000008 Inexact Rounded
+fmax36412 fma 1 10 77e-16 -> 10.00000000000001 Inexact Rounded
+fmax36413 fma 1 10 77e-17 -> 10.00000000000000 Inexact Rounded
+fmax36414 fma 1 10 77e-18 -> 10.00000000000000 Inexact Rounded
+fmax36415 fma 1 10 77e-19 -> 10.00000000000000 Inexact Rounded
+fmax36416 fma 1 10 77e-99 -> 10.00000000000000 Inexact Rounded
+
+fmax36420 fma 1 77e-14 1 -> 1.00000000000077
+fmax36421 fma 1 77e-15 1 -> 1.000000000000077
+fmax36422 fma 1 77e-16 1 -> 1.000000000000008 Inexact Rounded
+fmax36423 fma 1 77e-17 1 -> 1.000000000000001 Inexact Rounded
+fmax36424 fma 1 77e-18 1 -> 1.000000000000000 Inexact Rounded
+fmax36425 fma 1 77e-19 1 -> 1.000000000000000 Inexact Rounded
+fmax36426 fma 1 77e-99 1 -> 1.000000000000000 Inexact Rounded
+
+fmax36430 fma 1 77e-14 10 -> 10.00000000000077
+fmax36431 fma 1 77e-15 10 -> 10.00000000000008 Inexact Rounded
+fmax36432 fma 1 77e-16 10 -> 10.00000000000001 Inexact Rounded
+fmax36433 fma 1 77e-17 10 -> 10.00000000000000 Inexact Rounded
+fmax36434 fma 1 77e-18 10 -> 10.00000000000000 Inexact Rounded
+fmax36435 fma 1 77e-19 10 -> 10.00000000000000 Inexact Rounded
+fmax36436 fma 1 77e-99 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+fmax36440 fma 1 1 -77e-14 -> 0.99999999999923
+fmax36441 fma 1 1 -77e-15 -> 0.999999999999923
+fmax36442 fma 1 1 -77e-16 -> 0.9999999999999923
+fmax36443 fma 1 1 -77e-17 -> 0.9999999999999992 Inexact Rounded
+fmax36444 fma 1 1 -77e-18 -> 0.9999999999999999 Inexact Rounded
+fmax36445 fma 1 1 -77e-19 -> 1.000000000000000 Inexact Rounded
+fmax36446 fma 1 1 -77e-99 -> 1.000000000000000 Inexact Rounded
+
+fmax36450 fma 1 10 -77e-14 -> 9.99999999999923
+fmax36451 fma 1 10 -77e-15 -> 9.999999999999923
+fmax36452 fma 1 10 -77e-16 -> 9.999999999999992 Inexact Rounded
+fmax36453 fma 1 10 -77e-17 -> 9.999999999999999 Inexact Rounded
+fmax36454 fma 1 10 -77e-18 -> 10.00000000000000 Inexact Rounded
+fmax36455 fma 1 10 -77e-19 -> 10.00000000000000 Inexact Rounded
+fmax36456 fma 1 10 -77e-99 -> 10.00000000000000 Inexact Rounded
+
+fmax36460 fma 1 -77e-14 1 -> 0.99999999999923
+fmax36461 fma 1 -77e-15 1 -> 0.999999999999923
+fmax36462 fma 1 -77e-16 1 -> 0.9999999999999923
+fmax36463 fma 1 -77e-17 1 -> 0.9999999999999992 Inexact Rounded
+fmax36464 fma 1 -77e-18 1 -> 0.9999999999999999 Inexact Rounded
+fmax36465 fma 1 -77e-19 1 -> 1.000000000000000 Inexact Rounded
+fmax36466 fma 1 -77e-99 1 -> 1.000000000000000 Inexact Rounded
+
+fmax36470 fma 1 -77e-14 10 -> 9.99999999999923
+fmax36471 fma 1 -77e-15 10 -> 9.999999999999923
+fmax36472 fma 1 -77e-16 10 -> 9.999999999999992 Inexact Rounded
+fmax36473 fma 1 -77e-17 10 -> 9.999999999999999 Inexact Rounded
+fmax36474 fma 1 -77e-18 10 -> 10.00000000000000 Inexact Rounded
+fmax36475 fma 1 -77e-19 10 -> 10.00000000000000 Inexact Rounded
+fmax36476 fma 1 -77e-99 10 -> 10.00000000000000 Inexact Rounded
+
+-- negative ulps
+fmax36480 fma 1 -1 77e-14 -> -0.99999999999923
+fmax36481 fma 1 -1 77e-15 -> -0.999999999999923
+fmax36482 fma 1 -1 77e-16 -> -0.9999999999999923
+fmax36483 fma 1 -1 77e-17 -> -0.9999999999999992 Inexact Rounded
+fmax36484 fma 1 -1 77e-18 -> -0.9999999999999999 Inexact Rounded
+fmax36485 fma 1 -1 77e-19 -> -1.000000000000000 Inexact Rounded
+fmax36486 fma 1 -1 77e-99 -> -1.000000000000000 Inexact Rounded
+
+fmax36490 fma 1 -10 77e-14 -> -9.99999999999923
+fmax36491 fma 1 -10 77e-15 -> -9.999999999999923
+fmax36492 fma 1 -10 77e-16 -> -9.999999999999992 Inexact Rounded
+fmax36493 fma 1 -10 77e-17 -> -9.999999999999999 Inexact Rounded
+fmax36494 fma 1 -10 77e-18 -> -10.00000000000000 Inexact Rounded
+fmax36495 fma 1 -10 77e-19 -> -10.00000000000000 Inexact Rounded
+fmax36496 fma 1 -10 77e-99 -> -10.00000000000000 Inexact Rounded
+
+fmax36500 fma 1 77e-14 -1 -> -0.99999999999923
+fmax36501 fma 1 77e-15 -1 -> -0.999999999999923
+fmax36502 fma 1 77e-16 -1 -> -0.9999999999999923
+fmax36503 fma 1 77e-17 -1 -> -0.9999999999999992 Inexact Rounded
+fmax36504 fma 1 77e-18 -1 -> -0.9999999999999999 Inexact Rounded
+fmax36505 fma 1 77e-19 -1 -> -1.000000000000000 Inexact Rounded
+fmax36506 fma 1 77e-99 -1 -> -1.000000000000000 Inexact Rounded
+
+fmax36510 fma 1 77e-14 -10 -> -9.99999999999923
+fmax36511 fma 1 77e-15 -10 -> -9.999999999999923
+fmax36512 fma 1 77e-16 -10 -> -9.999999999999992 Inexact Rounded
+fmax36513 fma 1 77e-17 -10 -> -9.999999999999999 Inexact Rounded
+fmax36514 fma 1 77e-18 -10 -> -10.00000000000000 Inexact Rounded
+fmax36515 fma 1 77e-19 -10 -> -10.00000000000000 Inexact Rounded
+fmax36516 fma 1 77e-99 -10 -> -10.00000000000000 Inexact Rounded
+
+
+-- long operands
+fmax36521 fma 1 101234562345678000 0 -> 1.012345623456780E+17 Rounded
+fmax36522 fma 1 0 101234562345678000 -> 1.012345623456780E+17 Rounded
+fmax36523 fma 1 10123456234567800 0 -> 1.012345623456780E+16 Rounded
+fmax36524 fma 1 0 10123456234567800 -> 1.012345623456780E+16 Rounded
+fmax36525 fma 1 10123456234567890 0 -> 1.012345623456789E+16 Rounded
+fmax36526 fma 1 0 10123456234567890 -> 1.012345623456789E+16 Rounded
+fmax36527 fma 1 10123456234567891 0 -> 1.012345623456789E+16 Inexact Rounded
+fmax36528 fma 1 0 10123456234567891 -> 1.012345623456789E+16 Inexact Rounded
+fmax36529 fma 1 101234562345678901 0 -> 1.012345623456789E+17 Inexact Rounded
+fmax36530 fma 1 0 101234562345678901 -> 1.012345623456789E+17 Inexact Rounded
+fmax36531 fma 1 10123456234567896 0 -> 1.012345623456790E+16 Inexact Rounded
+fmax36532 fma 1 0 10123456234567896 -> 1.012345623456790E+16 Inexact Rounded
+
+-- verify a query
+rounding: down
+fmax36561 fma 1 1e-398 9.000000000000000E+384 -> 9.000000000000000E+384 Inexact Rounded
+fmax36562 fma 1 0 9.000000000000000E+384 -> 9.000000000000000E+384 Rounded
+-- and using decimal64 bounds...
+rounding: down
+fmax36563 fma 1 1e-388 9.000000000000000E+374 -> 9.000000000000000E+374 Inexact Rounded
+fmax36564 fma 1 0 9.000000000000000E+374 -> 9.000000000000000E+374 Rounded
+
+-- more zeros, etc.
+rounding: half_even
+
+fmax36701 fma 1 5.00 1.00E-3 -> 5.00100
+fmax36702 fma 1 00.00 0.000 -> 0.000
+fmax36703 fma 1 00.00 0E-3 -> 0.000
+fmax36704 fma 1 0E-3 00.00 -> 0.000
+
+fmax36710 fma 1 0E+3 00.00 -> 0.00
+fmax36711 fma 1 0E+3 00.0 -> 0.0
+fmax36712 fma 1 0E+3 00. -> 0
+fmax36713 fma 1 0E+3 00.E+1 -> 0E+1
+fmax36714 fma 1 0E+3 00.E+2 -> 0E+2
+fmax36715 fma 1 0E+3 00.E+3 -> 0E+3
+fmax36716 fma 1 0E+3 00.E+4 -> 0E+3
+fmax36717 fma 1 0E+3 00.E+5 -> 0E+3
+fmax36718 fma 1 0E+3 -00.0 -> 0.0
+fmax36719 fma 1 0E+3 -00. -> 0
+fmax36731 fma 1 0E+3 -00.E+1 -> 0E+1
+
+fmax36720 fma 1 00.00 0E+3 -> 0.00
+fmax36721 fma 1 00.0 0E+3 -> 0.0
+fmax36722 fma 1 00. 0E+3 -> 0
+fmax36723 fma 1 00.E+1 0E+3 -> 0E+1
+fmax36724 fma 1 00.E+2 0E+3 -> 0E+2
+fmax36725 fma 1 00.E+3 0E+3 -> 0E+3
+fmax36726 fma 1 00.E+4 0E+3 -> 0E+3
+fmax36727 fma 1 00.E+5 0E+3 -> 0E+3
+fmax36728 fma 1 -00.00 0E+3 -> 0.00
+fmax36729 fma 1 -00.0 0E+3 -> 0.0
+fmax36730 fma 1 -00. 0E+3 -> 0
+
+fmax36732 fma 1 0 0 -> 0
+fmax36733 fma 1 0 -0 -> 0
+fmax36734 fma 1 -0 0 -> 0
+fmax36735 fma 1 -0 -0 -> -0 -- IEEE 854 special case
+
+fmax36736 fma 1 1 -1 -> 0
+fmax36737 fma 1 -1 -1 -> -2
+fmax36738 fma 1 1 1 -> 2
+fmax36739 fma 1 -1 1 -> 0
+
+fmax36741 fma 1 0 -1 -> -1
+fmax36742 fma 1 -0 -1 -> -1
+fmax36743 fma 1 0 1 -> 1
+fmax36744 fma 1 -0 1 -> 1
+fmax36745 fma 1 -1 0 -> -1
+fmax36746 fma 1 -1 -0 -> -1
+fmax36747 fma 1 1 0 -> 1
+fmax36748 fma 1 1 -0 -> 1
+
+fmax36751 fma 1 0.0 -1 -> -1.0
+fmax36752 fma 1 -0.0 -1 -> -1.0
+fmax36753 fma 1 0.0 1 -> 1.0
+fmax36754 fma 1 -0.0 1 -> 1.0
+fmax36755 fma 1 -1.0 0 -> -1.0
+fmax36756 fma 1 -1.0 -0 -> -1.0
+fmax36757 fma 1 1.0 0 -> 1.0
+fmax36758 fma 1 1.0 -0 -> 1.0
+
+fmax36761 fma 1 0 -1.0 -> -1.0
+fmax36762 fma 1 -0 -1.0 -> -1.0
+fmax36763 fma 1 0 1.0 -> 1.0
+fmax36764 fma 1 -0 1.0 -> 1.0
+fmax36765 fma 1 -1 0.0 -> -1.0
+fmax36766 fma 1 -1 -0.0 -> -1.0
+fmax36767 fma 1 1 0.0 -> 1.0
+fmax36768 fma 1 1 -0.0 -> 1.0
+
+fmax36771 fma 1 0.0 -1.0 -> -1.0
+fmax36772 fma 1 -0.0 -1.0 -> -1.0
+fmax36773 fma 1 0.0 1.0 -> 1.0
+fmax36774 fma 1 -0.0 1.0 -> 1.0
+fmax36775 fma 1 -1.0 0.0 -> -1.0
+fmax36776 fma 1 -1.0 -0.0 -> -1.0
+fmax36777 fma 1 1.0 0.0 -> 1.0
+fmax36778 fma 1 1.0 -0.0 -> 1.0
+
+-- Specials
+fmax36780 fma 1 -Inf -Inf -> -Infinity
+fmax36781 fma 1 -Inf -1000 -> -Infinity
+fmax36782 fma 1 -Inf -1 -> -Infinity
+fmax36783 fma 1 -Inf -0 -> -Infinity
+fmax36784 fma 1 -Inf 0 -> -Infinity
+fmax36785 fma 1 -Inf 1 -> -Infinity
+fmax36786 fma 1 -Inf 1000 -> -Infinity
+fmax36787 fma 1 -1000 -Inf -> -Infinity
+fmax36788 fma 1 -Inf -Inf -> -Infinity
+fmax36789 fma 1 -1 -Inf -> -Infinity
+fmax36790 fma 1 -0 -Inf -> -Infinity
+fmax36791 fma 1 0 -Inf -> -Infinity
+fmax36792 fma 1 1 -Inf -> -Infinity
+fmax36793 fma 1 1000 -Inf -> -Infinity
+fmax36794 fma 1 Inf -Inf -> NaN Invalid_operation
+
+fmax36800 fma 1 Inf -Inf -> NaN Invalid_operation
+fmax36801 fma 1 Inf -1000 -> Infinity
+fmax36802 fma 1 Inf -1 -> Infinity
+fmax36803 fma 1 Inf -0 -> Infinity
+fmax36804 fma 1 Inf 0 -> Infinity
+fmax36805 fma 1 Inf 1 -> Infinity
+fmax36806 fma 1 Inf 1000 -> Infinity
+fmax36807 fma 1 Inf Inf -> Infinity
+fmax36808 fma 1 -1000 Inf -> Infinity
+fmax36809 fma 1 -Inf Inf -> NaN Invalid_operation
+fmax36810 fma 1 -1 Inf -> Infinity
+fmax36811 fma 1 -0 Inf -> Infinity
+fmax36812 fma 1 0 Inf -> Infinity
+fmax36813 fma 1 1 Inf -> Infinity
+fmax36814 fma 1 1000 Inf -> Infinity
+fmax36815 fma 1 Inf Inf -> Infinity
+
+fmax36821 fma 1 NaN -Inf -> NaN
+fmax36822 fma 1 NaN -1000 -> NaN
+fmax36823 fma 1 NaN -1 -> NaN
+fmax36824 fma 1 NaN -0 -> NaN
+fmax36825 fma 1 NaN 0 -> NaN
+fmax36826 fma 1 NaN 1 -> NaN
+fmax36827 fma 1 NaN 1000 -> NaN
+fmax36828 fma 1 NaN Inf -> NaN
+fmax36829 fma 1 NaN NaN -> NaN
+fmax36830 fma 1 -Inf NaN -> NaN
+fmax36831 fma 1 -1000 NaN -> NaN
+fmax36832 fma 1 -1 NaN -> NaN
+fmax36833 fma 1 -0 NaN -> NaN
+fmax36834 fma 1 0 NaN -> NaN
+fmax36835 fma 1 1 NaN -> NaN
+fmax36836 fma 1 1000 NaN -> NaN
+fmax36837 fma 1 Inf NaN -> NaN
+
+fmax36841 fma 1 sNaN -Inf -> NaN Invalid_operation
+fmax36842 fma 1 sNaN -1000 -> NaN Invalid_operation
+fmax36843 fma 1 sNaN -1 -> NaN Invalid_operation
+fmax36844 fma 1 sNaN -0 -> NaN Invalid_operation
+fmax36845 fma 1 sNaN 0 -> NaN Invalid_operation
+fmax36846 fma 1 sNaN 1 -> NaN Invalid_operation
+fmax36847 fma 1 sNaN 1000 -> NaN Invalid_operation
+fmax36848 fma 1 sNaN NaN -> NaN Invalid_operation
+fmax36849 fma 1 sNaN sNaN -> NaN Invalid_operation
+fmax36850 fma 1 NaN sNaN -> NaN Invalid_operation
+fmax36851 fma 1 -Inf sNaN -> NaN Invalid_operation
+fmax36852 fma 1 -1000 sNaN -> NaN Invalid_operation
+fmax36853 fma 1 -1 sNaN -> NaN Invalid_operation
+fmax36854 fma 1 -0 sNaN -> NaN Invalid_operation
+fmax36855 fma 1 0 sNaN -> NaN Invalid_operation
+fmax36856 fma 1 1 sNaN -> NaN Invalid_operation
+fmax36857 fma 1 1000 sNaN -> NaN Invalid_operation
+fmax36858 fma 1 Inf sNaN -> NaN Invalid_operation
+fmax36859 fma 1 NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+fmax36861 fma 1 NaN1 -Inf -> NaN1
+fmax36862 fma 1 +NaN2 -1000 -> NaN2
+fmax36863 fma 1 NaN3 1000 -> NaN3
+fmax36864 fma 1 NaN4 Inf -> NaN4
+fmax36865 fma 1 NaN5 +NaN6 -> NaN5
+fmax36866 fma 1 -Inf NaN7 -> NaN7
+fmax36867 fma 1 -1000 NaN8 -> NaN8
+fmax36868 fma 1 1000 NaN9 -> NaN9
+fmax36869 fma 1 Inf +NaN10 -> NaN10
+fmax36871 fma 1 sNaN11 -Inf -> NaN11 Invalid_operation
+fmax36872 fma 1 sNaN12 -1000 -> NaN12 Invalid_operation
+fmax36873 fma 1 sNaN13 1000 -> NaN13 Invalid_operation
+fmax36874 fma 1 sNaN14 NaN17 -> NaN14 Invalid_operation
+fmax36875 fma 1 sNaN15 sNaN18 -> NaN15 Invalid_operation
+fmax36876 fma 1 NaN16 sNaN19 -> NaN19 Invalid_operation
+fmax36877 fma 1 -Inf +sNaN20 -> NaN20 Invalid_operation
+fmax36878 fma 1 -1000 sNaN21 -> NaN21 Invalid_operation
+fmax36879 fma 1 1000 sNaN22 -> NaN22 Invalid_operation
+fmax36880 fma 1 Inf sNaN23 -> NaN23 Invalid_operation
+fmax36881 fma 1 +NaN25 +sNaN24 -> NaN24 Invalid_operation
+fmax36882 fma 1 -NaN26 NaN28 -> -NaN26
+fmax36883 fma 1 -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+fmax36884 fma 1 1000 -NaN30 -> -NaN30
+fmax36885 fma 1 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- now the case where we can get underflow but the result is normal
+-- [note this can't happen if the operands are also bounded, as we
+-- cannot represent 1E-399, for example]
+
+fmax36571 fma 1 1E-383 0 -> 1E-383
+fmax36572 fma 1 1E-384 0 -> 1E-384 Subnormal
+fmax36573 fma 1 1E-383 1E-384 -> 1.1E-383
+fmax36574 subtract 1E-383 1E-384 -> 9E-384 Subnormal
+
+-- Here we explore the boundary of rounding a subnormal to Nmin
+fmax36575 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
+fmax36576 subtract 1E-383 1E-398 -> 9.99999999999999E-384 Subnormal
+fmax36577 subtract 1E-383 1E-399 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax36578 subtract 1E-383 1E-400 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax36579 subtract 1E-383 1E-401 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+fmax36580 subtract 1E-383 1E-402 -> 1.000000000000000E-383 Underflow Inexact Subnormal Rounded
+
+-- check overflow edge case
+-- 1234567890123456
+fmax36972 apply 9.999999999999999E+384 -> 9.999999999999999E+384
+fmax36973 fma 1 9.999999999999999E+384 1 -> 9.999999999999999E+384 Inexact Rounded
+fmax36974 fma 1 9999999999999999E+369 1 -> 9.999999999999999E+384 Inexact Rounded
+fmax36975 fma 1 9999999999999999E+369 1E+369 -> Infinity Overflow Inexact Rounded
+fmax36976 fma 1 9999999999999999E+369 9E+368 -> Infinity Overflow Inexact Rounded
+fmax36977 fma 1 9999999999999999E+369 8E+368 -> Infinity Overflow Inexact Rounded
+fmax36978 fma 1 9999999999999999E+369 7E+368 -> Infinity Overflow Inexact Rounded
+fmax36979 fma 1 9999999999999999E+369 6E+368 -> Infinity Overflow Inexact Rounded
+fmax36980 fma 1 9999999999999999E+369 5E+368 -> Infinity Overflow Inexact Rounded
+fmax36981 fma 1 9999999999999999E+369 4E+368 -> 9.999999999999999E+384 Inexact Rounded
+fmax36982 fma 1 9999999999999999E+369 3E+368 -> 9.999999999999999E+384 Inexact Rounded
+fmax36983 fma 1 9999999999999999E+369 2E+368 -> 9.999999999999999E+384 Inexact Rounded
+fmax36984 fma 1 9999999999999999E+369 1E+368 -> 9.999999999999999E+384 Inexact Rounded
+
+fmax36985 apply -9.999999999999999E+384 -> -9.999999999999999E+384
+fmax36986 fma 1 -9.999999999999999E+384 -1 -> -9.999999999999999E+384 Inexact Rounded
+fmax36987 fma 1 -9999999999999999E+369 -1 -> -9.999999999999999E+384 Inexact Rounded
+fmax36988 fma 1 -9999999999999999E+369 -1E+369 -> -Infinity Overflow Inexact Rounded
+fmax36989 fma 1 -9999999999999999E+369 -9E+368 -> -Infinity Overflow Inexact Rounded
+fmax36990 fma 1 -9999999999999999E+369 -8E+368 -> -Infinity Overflow Inexact Rounded
+fmax36991 fma 1 -9999999999999999E+369 -7E+368 -> -Infinity Overflow Inexact Rounded
+fmax36992 fma 1 -9999999999999999E+369 -6E+368 -> -Infinity Overflow Inexact Rounded
+fmax36993 fma 1 -9999999999999999E+369 -5E+368 -> -Infinity Overflow Inexact Rounded
+fmax36994 fma 1 -9999999999999999E+369 -4E+368 -> -9.999999999999999E+384 Inexact Rounded
+fmax36995 fma 1 -9999999999999999E+369 -3E+368 -> -9.999999999999999E+384 Inexact Rounded
+fmax36996 fma 1 -9999999999999999E+369 -2E+368 -> -9.999999999999999E+384 Inexact Rounded
+fmax36997 fma 1 -9999999999999999E+369 -1E+368 -> -9.999999999999999E+384 Inexact Rounded
+
+-- And for round down full and subnormal results
+rounding: down
+fmax361100 fma 1 1e+2 -1e-383 -> 99.99999999999999 Rounded Inexact
+fmax361101 fma 1 1e+1 -1e-383 -> 9.999999999999999 Rounded Inexact
+fmax361103 fma 1 +1 -1e-383 -> 0.9999999999999999 Rounded Inexact
+fmax361104 fma 1 1e-1 -1e-383 -> 0.09999999999999999 Rounded Inexact
+fmax361105 fma 1 1e-2 -1e-383 -> 0.009999999999999999 Rounded Inexact
+fmax361106 fma 1 1e-3 -1e-383 -> 0.0009999999999999999 Rounded Inexact
+fmax361107 fma 1 1e-4 -1e-383 -> 0.00009999999999999999 Rounded Inexact
+fmax361108 fma 1 1e-5 -1e-383 -> 0.000009999999999999999 Rounded Inexact
+fmax361109 fma 1 1e-6 -1e-383 -> 9.999999999999999E-7 Rounded Inexact
+
+rounding: ceiling
+fmax361110 fma 1 -1e+2 +1e-383 -> -99.99999999999999 Rounded Inexact
+fmax361111 fma 1 -1e+1 +1e-383 -> -9.999999999999999 Rounded Inexact
+fmax361113 fma 1 -1 +1e-383 -> -0.9999999999999999 Rounded Inexact
+fmax361114 fma 1 -1e-1 +1e-383 -> -0.09999999999999999 Rounded Inexact
+fmax361115 fma 1 -1e-2 +1e-383 -> -0.009999999999999999 Rounded Inexact
+fmax361116 fma 1 -1e-3 +1e-383 -> -0.0009999999999999999 Rounded Inexact
+fmax361117 fma 1 -1e-4 +1e-383 -> -0.00009999999999999999 Rounded Inexact
+fmax361118 fma 1 -1e-5 +1e-383 -> -0.000009999999999999999 Rounded Inexact
+fmax361119 fma 1 -1e-6 +1e-383 -> -9.999999999999999E-7 Rounded Inexact
+
+-- tests based on Gunnar Degnbol's edge case
+rounding: half_even
+
+fmax361300 fma 1 1E16 -0.5 -> 1.000000000000000E+16 Inexact Rounded
+fmax361310 fma 1 1E16 -0.51 -> 9999999999999999 Inexact Rounded
+fmax361311 fma 1 1E16 -0.501 -> 9999999999999999 Inexact Rounded
+fmax361312 fma 1 1E16 -0.5001 -> 9999999999999999 Inexact Rounded
+fmax361313 fma 1 1E16 -0.50001 -> 9999999999999999 Inexact Rounded
+fmax361314 fma 1 1E16 -0.500001 -> 9999999999999999 Inexact Rounded
+fmax361315 fma 1 1E16 -0.5000001 -> 9999999999999999 Inexact Rounded
+fmax361316 fma 1 1E16 -0.50000001 -> 9999999999999999 Inexact Rounded
+fmax361317 fma 1 1E16 -0.500000001 -> 9999999999999999 Inexact Rounded
+fmax361318 fma 1 1E16 -0.5000000001 -> 9999999999999999 Inexact Rounded
+fmax361319 fma 1 1E16 -0.50000000001 -> 9999999999999999 Inexact Rounded
+fmax361320 fma 1 1E16 -0.500000000001 -> 9999999999999999 Inexact Rounded
+fmax361321 fma 1 1E16 -0.5000000000001 -> 9999999999999999 Inexact Rounded
+fmax361322 fma 1 1E16 -0.50000000000001 -> 9999999999999999 Inexact Rounded
+fmax361323 fma 1 1E16 -0.500000000000001 -> 9999999999999999 Inexact Rounded
+fmax361324 fma 1 1E16 -0.5000000000000001 -> 9999999999999999 Inexact Rounded
+fmax361325 fma 1 1E16 -0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361326 fma 1 1E16 -0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361327 fma 1 1E16 -0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361328 fma 1 1E16 -0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361329 fma 1 1E16 -0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361330 fma 1 1E16 -0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361331 fma 1 1E16 -0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361332 fma 1 1E16 -0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361333 fma 1 1E16 -0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361334 fma 1 1E16 -0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361335 fma 1 1E16 -0.500000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361336 fma 1 1E16 -0.50000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361337 fma 1 1E16 -0.5000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361338 fma 1 1E16 -0.500 -> 1.000000000000000E+16 Inexact Rounded
+fmax361339 fma 1 1E16 -0.50 -> 1.000000000000000E+16 Inexact Rounded
+
+fmax361340 fma 1 1E16 -5000000.000010001 -> 9999999995000000 Inexact Rounded
+fmax361341 fma 1 1E16 -5000000.000000001 -> 9999999995000000 Inexact Rounded
+
+fmax361349 fma 1 9999999999999999 0.4 -> 9999999999999999 Inexact Rounded
+fmax361350 fma 1 9999999999999999 0.49 -> 9999999999999999 Inexact Rounded
+fmax361351 fma 1 9999999999999999 0.499 -> 9999999999999999 Inexact Rounded
+fmax361352 fma 1 9999999999999999 0.4999 -> 9999999999999999 Inexact Rounded
+fmax361353 fma 1 9999999999999999 0.49999 -> 9999999999999999 Inexact Rounded
+fmax361354 fma 1 9999999999999999 0.499999 -> 9999999999999999 Inexact Rounded
+fmax361355 fma 1 9999999999999999 0.4999999 -> 9999999999999999 Inexact Rounded
+fmax361356 fma 1 9999999999999999 0.49999999 -> 9999999999999999 Inexact Rounded
+fmax361357 fma 1 9999999999999999 0.499999999 -> 9999999999999999 Inexact Rounded
+fmax361358 fma 1 9999999999999999 0.4999999999 -> 9999999999999999 Inexact Rounded
+fmax361359 fma 1 9999999999999999 0.49999999999 -> 9999999999999999 Inexact Rounded
+fmax361360 fma 1 9999999999999999 0.499999999999 -> 9999999999999999 Inexact Rounded
+fmax361361 fma 1 9999999999999999 0.4999999999999 -> 9999999999999999 Inexact Rounded
+fmax361362 fma 1 9999999999999999 0.49999999999999 -> 9999999999999999 Inexact Rounded
+fmax361363 fma 1 9999999999999999 0.499999999999999 -> 9999999999999999 Inexact Rounded
+fmax361364 fma 1 9999999999999999 0.4999999999999999 -> 9999999999999999 Inexact Rounded
+fmax361365 fma 1 9999999999999999 0.5000000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361367 fma 1 9999999999999999 0.500000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361368 fma 1 9999999999999999 0.50000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361369 fma 1 9999999999999999 0.5000000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361370 fma 1 9999999999999999 0.500000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361371 fma 1 9999999999999999 0.50000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361372 fma 1 9999999999999999 0.5000000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361373 fma 1 9999999999999999 0.500000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361374 fma 1 9999999999999999 0.50000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361375 fma 1 9999999999999999 0.5000000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361376 fma 1 9999999999999999 0.500000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361377 fma 1 9999999999999999 0.50000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361378 fma 1 9999999999999999 0.5000 -> 1.000000000000000E+16 Inexact Rounded
+fmax361379 fma 1 9999999999999999 0.500 -> 1.000000000000000E+16 Inexact Rounded
+fmax361380 fma 1 9999999999999999 0.50 -> 1.000000000000000E+16 Inexact Rounded
+fmax361381 fma 1 9999999999999999 0.5 -> 1.000000000000000E+16 Inexact Rounded
+fmax361382 fma 1 9999999999999999 0.5000000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361383 fma 1 9999999999999999 0.500000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361384 fma 1 9999999999999999 0.50000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361385 fma 1 9999999999999999 0.5000000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361386 fma 1 9999999999999999 0.500000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361387 fma 1 9999999999999999 0.50000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361388 fma 1 9999999999999999 0.5000000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361389 fma 1 9999999999999999 0.500000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361390 fma 1 9999999999999999 0.50000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361391 fma 1 9999999999999999 0.5000001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361392 fma 1 9999999999999999 0.500001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361393 fma 1 9999999999999999 0.50001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361394 fma 1 9999999999999999 0.5001 -> 1.000000000000000E+16 Inexact Rounded
+fmax361395 fma 1 9999999999999999 0.501 -> 1.000000000000000E+16 Inexact Rounded
+fmax361396 fma 1 9999999999999999 0.51 -> 1.000000000000000E+16 Inexact Rounded
+
+-- More GD edge cases, where difference between the unadjusted
+-- exponents is larger than the maximum precision and one side is 0
+fmax361420 fma 1 0 1.123456789012345 -> 1.123456789012345
+fmax361421 fma 1 0 1.123456789012345E-1 -> 0.1123456789012345
+fmax361422 fma 1 0 1.123456789012345E-2 -> 0.01123456789012345
+fmax361423 fma 1 0 1.123456789012345E-3 -> 0.001123456789012345
+fmax361424 fma 1 0 1.123456789012345E-4 -> 0.0001123456789012345
+fmax361425 fma 1 0 1.123456789012345E-5 -> 0.00001123456789012345
+fmax361426 fma 1 0 1.123456789012345E-6 -> 0.000001123456789012345
+fmax361427 fma 1 0 1.123456789012345E-7 -> 1.123456789012345E-7
+fmax361428 fma 1 0 1.123456789012345E-8 -> 1.123456789012345E-8
+fmax361429 fma 1 0 1.123456789012345E-9 -> 1.123456789012345E-9
+fmax361430 fma 1 0 1.123456789012345E-10 -> 1.123456789012345E-10
+fmax361431 fma 1 0 1.123456789012345E-11 -> 1.123456789012345E-11
+fmax361432 fma 1 0 1.123456789012345E-12 -> 1.123456789012345E-12
+fmax361433 fma 1 0 1.123456789012345E-13 -> 1.123456789012345E-13
+fmax361434 fma 1 0 1.123456789012345E-14 -> 1.123456789012345E-14
+fmax361435 fma 1 0 1.123456789012345E-15 -> 1.123456789012345E-15
+fmax361436 fma 1 0 1.123456789012345E-16 -> 1.123456789012345E-16
+fmax361437 fma 1 0 1.123456789012345E-17 -> 1.123456789012345E-17
+fmax361438 fma 1 0 1.123456789012345E-18 -> 1.123456789012345E-18
+fmax361439 fma 1 0 1.123456789012345E-19 -> 1.123456789012345E-19
+
+-- same, reversed 0
+fmax361440 fma 1 1.123456789012345 0 -> 1.123456789012345
+fmax361441 fma 1 1.123456789012345E-1 0 -> 0.1123456789012345
+fmax361442 fma 1 1.123456789012345E-2 0 -> 0.01123456789012345
+fmax361443 fma 1 1.123456789012345E-3 0 -> 0.001123456789012345
+fmax361444 fma 1 1.123456789012345E-4 0 -> 0.0001123456789012345
+fmax361445 fma 1 1.123456789012345E-5 0 -> 0.00001123456789012345
+fmax361446 fma 1 1.123456789012345E-6 0 -> 0.000001123456789012345
+fmax361447 fma 1 1.123456789012345E-7 0 -> 1.123456789012345E-7
+fmax361448 fma 1 1.123456789012345E-8 0 -> 1.123456789012345E-8
+fmax361449 fma 1 1.123456789012345E-9 0 -> 1.123456789012345E-9
+fmax361450 fma 1 1.123456789012345E-10 0 -> 1.123456789012345E-10
+fmax361451 fma 1 1.123456789012345E-11 0 -> 1.123456789012345E-11
+fmax361452 fma 1 1.123456789012345E-12 0 -> 1.123456789012345E-12
+fmax361453 fma 1 1.123456789012345E-13 0 -> 1.123456789012345E-13
+fmax361454 fma 1 1.123456789012345E-14 0 -> 1.123456789012345E-14
+fmax361455 fma 1 1.123456789012345E-15 0 -> 1.123456789012345E-15
+fmax361456 fma 1 1.123456789012345E-16 0 -> 1.123456789012345E-16
+fmax361457 fma 1 1.123456789012345E-17 0 -> 1.123456789012345E-17
+fmax361458 fma 1 1.123456789012345E-18 0 -> 1.123456789012345E-18
+fmax361459 fma 1 1.123456789012345E-19 0 -> 1.123456789012345E-19
+
+-- same, Es on the 0
+fmax361460 fma 1 1.123456789012345 0E-0 -> 1.123456789012345
+fmax361461 fma 1 1.123456789012345 0E-1 -> 1.123456789012345
+fmax361462 fma 1 1.123456789012345 0E-2 -> 1.123456789012345
+fmax361463 fma 1 1.123456789012345 0E-3 -> 1.123456789012345
+fmax361464 fma 1 1.123456789012345 0E-4 -> 1.123456789012345
+fmax361465 fma 1 1.123456789012345 0E-5 -> 1.123456789012345
+fmax361466 fma 1 1.123456789012345 0E-6 -> 1.123456789012345
+fmax361467 fma 1 1.123456789012345 0E-7 -> 1.123456789012345
+fmax361468 fma 1 1.123456789012345 0E-8 -> 1.123456789012345
+fmax361469 fma 1 1.123456789012345 0E-9 -> 1.123456789012345
+fmax361470 fma 1 1.123456789012345 0E-10 -> 1.123456789012345
+fmax361471 fma 1 1.123456789012345 0E-11 -> 1.123456789012345
+fmax361472 fma 1 1.123456789012345 0E-12 -> 1.123456789012345
+fmax361473 fma 1 1.123456789012345 0E-13 -> 1.123456789012345
+fmax361474 fma 1 1.123456789012345 0E-14 -> 1.123456789012345
+fmax361475 fma 1 1.123456789012345 0E-15 -> 1.123456789012345
+-- next four flag Rounded because the 0 extends the result
+fmax361476 fma 1 1.123456789012345 0E-16 -> 1.123456789012345 Rounded
+fmax361477 fma 1 1.123456789012345 0E-17 -> 1.123456789012345 Rounded
+fmax361478 fma 1 1.123456789012345 0E-18 -> 1.123456789012345 Rounded
+fmax361479 fma 1 1.123456789012345 0E-19 -> 1.123456789012345 Rounded
+
+-- sum of two opposite-sign operands is exactly 0 and floor => -0
+rounding: half_up
+-- exact zeros from zeros
+fmax361500 fma 1 0 0E-19 -> 0E-19
+fmax361501 fma 1 -0 0E-19 -> 0E-19
+fmax361502 fma 1 0 -0E-19 -> 0E-19
+fmax361503 fma 1 -0 -0E-19 -> -0E-19
+fmax361504 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361505 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361506 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361507 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361511 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361512 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361513 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361514 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361515 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361516 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361517 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361518 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: half_down
+-- exact zeros from zeros
+fmax361520 fma 1 0 0E-19 -> 0E-19
+fmax361521 fma 1 -0 0E-19 -> 0E-19
+fmax361522 fma 1 0 -0E-19 -> 0E-19
+fmax361523 fma 1 -0 -0E-19 -> -0E-19
+fmax361524 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361525 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361526 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361527 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361531 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361532 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361533 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361534 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361535 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361536 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361537 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361538 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: half_even
+-- exact zeros from zeros
+fmax361540 fma 1 0 0E-19 -> 0E-19
+fmax361541 fma 1 -0 0E-19 -> 0E-19
+fmax361542 fma 1 0 -0E-19 -> 0E-19
+fmax361543 fma 1 -0 -0E-19 -> -0E-19
+fmax361544 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361545 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361546 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361547 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361551 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361552 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361553 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361554 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361555 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361556 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361557 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361558 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: up
+-- exact zeros from zeros
+fmax361560 fma 1 0 0E-19 -> 0E-19
+fmax361561 fma 1 -0 0E-19 -> 0E-19
+fmax361562 fma 1 0 -0E-19 -> 0E-19
+fmax361563 fma 1 -0 -0E-19 -> -0E-19
+fmax361564 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361565 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361566 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361567 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361571 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361572 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361573 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+fmax361574 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+fmax361575 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361576 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361577 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361578 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+rounding: down
+-- exact zeros from zeros
+fmax361580 fma 1 0 0E-19 -> 0E-19
+fmax361581 fma 1 -0 0E-19 -> 0E-19
+fmax361582 fma 1 0 -0E-19 -> 0E-19
+fmax361583 fma 1 -0 -0E-19 -> -0E-19
+fmax361584 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361585 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361586 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361587 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361591 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361592 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361593 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361594 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361595 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361596 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361597 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361598 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+rounding: ceiling
+-- exact zeros from zeros
+fmax361600 fma 1 0 0E-19 -> 0E-19
+fmax361601 fma 1 -0 0E-19 -> 0E-19
+fmax361602 fma 1 0 -0E-19 -> 0E-19
+fmax361603 fma 1 -0 -0E-19 -> -0E-19
+fmax361604 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361605 fma 1 -0E-400 0E-19 -> 0E-398 Clamped
+fmax361606 fma 1 0E-400 -0E-19 -> 0E-398 Clamped
+fmax361607 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361611 fma 1 1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361612 fma 1 -1E-401 1E-400 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361613 fma 1 1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361614 fma 1 -1E-401 -1E-400 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+-- some exact zeros from non-zeros
+fmax361615 fma 1 1E-401 1E-401 -> 1E-398 Subnormal Inexact Rounded Underflow
+fmax361616 fma 1 -1E-401 1E-401 -> 0E-398 Clamped
+fmax361617 fma 1 1E-401 -1E-401 -> 0E-398 Clamped
+fmax361618 fma 1 -1E-401 -1E-401 -> -0E-398 Subnormal Inexact Rounded Underflow Clamped
+
+-- and the extra-special ugly case; unusual minuses marked by -- *
+rounding: floor
+-- exact zeros from zeros
+fmax361620 fma 1 0 0E-19 -> 0E-19
+fmax361621 fma 1 -0 0E-19 -> -0E-19 -- *
+fmax361622 fma 1 0 -0E-19 -> -0E-19 -- *
+fmax361623 fma 1 -0 -0E-19 -> -0E-19
+fmax361624 fma 1 0E-400 0E-19 -> 0E-398 Clamped
+fmax361625 fma 1 -0E-400 0E-19 -> -0E-398 Clamped -- *
+fmax361626 fma 1 0E-400 -0E-19 -> -0E-398 Clamped -- *
+fmax361627 fma 1 -0E-400 -0E-19 -> -0E-398 Clamped
+-- inexact zeros
+fmax361631 fma 1 1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361632 fma 1 -1E-401 1E-400 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361633 fma 1 1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+fmax361634 fma 1 -1E-401 -1E-400 -> -1E-398 Subnormal Inexact Rounded Underflow
+-- some exact zeros from non-zeros
+fmax361635 fma 1 1E-401 1E-401 -> 0E-398 Subnormal Inexact Rounded Underflow Clamped
+fmax361636 fma 1 -1E-401 1E-401 -> -0E-398 Clamped -- *
+fmax361637 fma 1 1E-401 -1E-401 -> -0E-398 Clamped -- *
+fmax361638 fma 1 -1E-401 -1E-401 -> -1E-398 Subnormal Inexact Rounded Underflow
+
+-- Examples from SQL proposal (Krishna Kulkarni)
+fmax361701 fma 1 130E-2 120E-2 -> 2.50
+fmax361702 fma 1 130E-2 12E-1 -> 2.50
+fmax361703 fma 1 130E-2 1E0 -> 2.30
+fmax361704 fma 1 1E2 1E4 -> 1.01E+4
+fmax361705 subtract 130E-2 120E-2 -> 0.10
+fmax361706 subtract 130E-2 12E-1 -> 0.10
+fmax361707 subtract 130E-2 1E0 -> 0.30
+fmax361708 subtract 1E2 1E4 -> -9.9E+3
+
+-- Gappy coefficients; check residue handling even with full coefficient gap
+rounding: half_even
+
+fmax362001 fma 1 1234567890123456 1 -> 1234567890123457
+fmax362002 fma 1 1234567890123456 0.6 -> 1234567890123457 Inexact Rounded
+fmax362003 fma 1 1234567890123456 0.06 -> 1234567890123456 Inexact Rounded
+fmax362004 fma 1 1234567890123456 6E-3 -> 1234567890123456 Inexact Rounded
+fmax362005 fma 1 1234567890123456 6E-4 -> 1234567890123456 Inexact Rounded
+fmax362006 fma 1 1234567890123456 6E-5 -> 1234567890123456 Inexact Rounded
+fmax362007 fma 1 1234567890123456 6E-6 -> 1234567890123456 Inexact Rounded
+fmax362008 fma 1 1234567890123456 6E-7 -> 1234567890123456 Inexact Rounded
+fmax362009 fma 1 1234567890123456 6E-8 -> 1234567890123456 Inexact Rounded
+fmax362010 fma 1 1234567890123456 6E-9 -> 1234567890123456 Inexact Rounded
+fmax362011 fma 1 1234567890123456 6E-10 -> 1234567890123456 Inexact Rounded
+fmax362012 fma 1 1234567890123456 6E-11 -> 1234567890123456 Inexact Rounded
+fmax362013 fma 1 1234567890123456 6E-12 -> 1234567890123456 Inexact Rounded
+fmax362014 fma 1 1234567890123456 6E-13 -> 1234567890123456 Inexact Rounded
+fmax362015 fma 1 1234567890123456 6E-14 -> 1234567890123456 Inexact Rounded
+fmax362016 fma 1 1234567890123456 6E-15 -> 1234567890123456 Inexact Rounded
+fmax362017 fma 1 1234567890123456 6E-16 -> 1234567890123456 Inexact Rounded
+fmax362018 fma 1 1234567890123456 6E-17 -> 1234567890123456 Inexact Rounded
+fmax362019 fma 1 1234567890123456 6E-18 -> 1234567890123456 Inexact Rounded
+fmax362020 fma 1 1234567890123456 6E-19 -> 1234567890123456 Inexact Rounded
+fmax362021 fma 1 1234567890123456 6E-20 -> 1234567890123456 Inexact Rounded
+
+-- widening second argument at gap
+fmax362030 fma 1 12345678 1 -> 12345679
+fmax362031 fma 1 12345678 0.1 -> 12345678.1
+fmax362032 fma 1 12345678 0.12 -> 12345678.12
+fmax362033 fma 1 12345678 0.123 -> 12345678.123
+fmax362034 fma 1 12345678 0.1234 -> 12345678.1234
+fmax362035 fma 1 12345678 0.12345 -> 12345678.12345
+fmax362036 fma 1 12345678 0.123456 -> 12345678.123456
+fmax362037 fma 1 12345678 0.1234567 -> 12345678.1234567
+fmax362038 fma 1 12345678 0.12345678 -> 12345678.12345678
+fmax362039 fma 1 12345678 0.123456789 -> 12345678.12345679 Inexact Rounded
+fmax362040 fma 1 12345678 0.123456785 -> 12345678.12345678 Inexact Rounded
+fmax362041 fma 1 12345678 0.1234567850 -> 12345678.12345678 Inexact Rounded
+fmax362042 fma 1 12345678 0.1234567851 -> 12345678.12345679 Inexact Rounded
+fmax362043 fma 1 12345678 0.12345678501 -> 12345678.12345679 Inexact Rounded
+fmax362044 fma 1 12345678 0.123456785001 -> 12345678.12345679 Inexact Rounded
+fmax362045 fma 1 12345678 0.1234567850001 -> 12345678.12345679 Inexact Rounded
+fmax362046 fma 1 12345678 0.12345678500001 -> 12345678.12345679 Inexact Rounded
+fmax362047 fma 1 12345678 0.123456785000001 -> 12345678.12345679 Inexact Rounded
+fmax362048 fma 1 12345678 0.1234567850000001 -> 12345678.12345679 Inexact Rounded
+fmax362049 fma 1 12345678 0.1234567850000000 -> 12345678.12345678 Inexact Rounded
+-- 90123456
+rounding: half_even
+fmax362050 fma 1 12345678 0.0234567750000000 -> 12345678.02345678 Inexact Rounded
+fmax362051 fma 1 12345678 0.0034567750000000 -> 12345678.00345678 Inexact Rounded
+fmax362052 fma 1 12345678 0.0004567750000000 -> 12345678.00045678 Inexact Rounded
+fmax362053 fma 1 12345678 0.0000567750000000 -> 12345678.00005678 Inexact Rounded
+fmax362054 fma 1 12345678 0.0000067750000000 -> 12345678.00000678 Inexact Rounded
+fmax362055 fma 1 12345678 0.0000007750000000 -> 12345678.00000078 Inexact Rounded
+fmax362056 fma 1 12345678 0.0000000750000000 -> 12345678.00000008 Inexact Rounded
+fmax362057 fma 1 12345678 0.0000000050000000 -> 12345678.00000000 Inexact Rounded
+fmax362060 fma 1 12345678 0.0234567750000001 -> 12345678.02345678 Inexact Rounded
+fmax362061 fma 1 12345678 0.0034567750000001 -> 12345678.00345678 Inexact Rounded
+fmax362062 fma 1 12345678 0.0004567750000001 -> 12345678.00045678 Inexact Rounded
+fmax362063 fma 1 12345678 0.0000567750000001 -> 12345678.00005678 Inexact Rounded
+fmax362064 fma 1 12345678 0.0000067750000001 -> 12345678.00000678 Inexact Rounded
+fmax362065 fma 1 12345678 0.0000007750000001 -> 12345678.00000078 Inexact Rounded
+fmax362066 fma 1 12345678 0.0000000750000001 -> 12345678.00000008 Inexact Rounded
+fmax362067 fma 1 12345678 0.0000000050000001 -> 12345678.00000001 Inexact Rounded
+-- far-out residues (full coefficient gap is 16+15 digits)
+rounding: up
+fmax362070 fma 1 12345678 1E-8 -> 12345678.00000001
+fmax362071 fma 1 12345678 1E-9 -> 12345678.00000001 Inexact Rounded
+fmax362072 fma 1 12345678 1E-10 -> 12345678.00000001 Inexact Rounded
+fmax362073 fma 1 12345678 1E-11 -> 12345678.00000001 Inexact Rounded
+fmax362074 fma 1 12345678 1E-12 -> 12345678.00000001 Inexact Rounded
+fmax362075 fma 1 12345678 1E-13 -> 12345678.00000001 Inexact Rounded
+fmax362076 fma 1 12345678 1E-14 -> 12345678.00000001 Inexact Rounded
+fmax362077 fma 1 12345678 1E-15 -> 12345678.00000001 Inexact Rounded
+fmax362078 fma 1 12345678 1E-16 -> 12345678.00000001 Inexact Rounded
+fmax362079 fma 1 12345678 1E-17 -> 12345678.00000001 Inexact Rounded
+fmax362080 fma 1 12345678 1E-18 -> 12345678.00000001 Inexact Rounded
+fmax362081 fma 1 12345678 1E-19 -> 12345678.00000001 Inexact Rounded
+fmax362082 fma 1 12345678 1E-20 -> 12345678.00000001 Inexact Rounded
+fmax362083 fma 1 12345678 1E-25 -> 12345678.00000001 Inexact Rounded
+fmax362084 fma 1 12345678 1E-30 -> 12345678.00000001 Inexact Rounded
+fmax362085 fma 1 12345678 1E-31 -> 12345678.00000001 Inexact Rounded
+fmax362086 fma 1 12345678 1E-32 -> 12345678.00000001 Inexact Rounded
+fmax362087 fma 1 12345678 1E-33 -> 12345678.00000001 Inexact Rounded
+fmax362088 fma 1 12345678 1E-34 -> 12345678.00000001 Inexact Rounded
+fmax362089 fma 1 12345678 1E-35 -> 12345678.00000001 Inexact Rounded
+
+-- payload decapitate x3
+precision: 5
+fmax363000 fma 1 1 sNaN1234567890 -> NaN67890 Invalid_operation
+fmax363001 fma 1 -sNaN1234512345 1 -> -NaN12345 Invalid_operation
+fmax363002 fma sNaN1234554321 1 1 -> NaN54321 Invalid_operation
+
+-- Null tests
+fmax39990 fma 1 10 # -> NaN Invalid_operation
+fmax39991 fma 1 # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/invert.decTest b/Lib/test/decimaltestdata/invert.decTest
index 9ef5a9137c..a2f7be5a77 100644
--- a/Lib/test/decimaltestdata/invert.decTest
+++ b/Lib/test/decimaltestdata/invert.decTest
@@ -1,176 +1,176 @@
-------------------------------------------------------------------------
--- invert.decTest -- digitwise logical INVERT --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check (truth table), and examples from decArith
-invx001 invert 0 -> 111111111
-invx002 invert 1 -> 111111110
-invx003 invert 10 -> 111111101
-invx004 invert 111111111 -> 0
-invx005 invert 000000000 -> 111111111
-invx006 invert 101010101 -> '10101010'
--- and at msd and msd-1
-invx007 invert 000000000 -> 111111111
-invx009 invert 100000000 -> 11111111
-invx011 invert 000000000 -> 111111111
-invx013 invert 010000000 -> 101111111
-
--- Various lengths
--- 123456789 123456789
-invx021 invert 111111111 -> 0
-invx022 invert 111111111111 -> 0
-invx023 invert 11111111 -> 100000000
-invx025 invert 1111111 -> 110000000
-invx026 invert 111111 -> 111000000
-invx027 invert 11111 -> 111100000
-invx028 invert 1111 -> 111110000
-invx029 invert 111 -> 111111000
-invx031 invert 11 -> 111111100
-invx032 invert 1 -> 111111110
-invx033 invert 111111111111 -> 0
-invx034 invert 11111111111 -> 0
-invx035 invert 1111111111 -> 0
-invx036 invert 111111111 -> 0
-
-invx080 invert 011111111 -> 100000000
-invx081 invert 101111111 -> 10000000
-invx082 invert 110111111 -> 1000000
-invx083 invert 111011111 -> 100000
-invx084 invert 111101111 -> 10000
-invx085 invert 111110111 -> 1000
-invx086 invert 111111011 -> 100
-invx087 invert 111111101 -> 10
-invx088 invert 111111110 -> 1
-invx089 invert 011111011 -> 100000100
-invx090 invert 101111101 -> 10000010
-invx091 invert 110111110 -> 1000001
-invx092 invert 111011101 -> 100010
-invx093 invert 111101011 -> 10100
-invx094 invert 111110111 -> 1000
-invx095 invert 111101011 -> 10100
-invx096 invert 111011101 -> 100010
-invx097 invert 110111110 -> 1000001
-invx098 invert 101111101 -> 10000010
-invx099 invert 011111011 -> 100000100
-
--- non-0/1 should not be accepted, nor should signs
-invx220 invert 111111112 -> NaN Invalid_operation
-invx221 invert 333333333 -> NaN Invalid_operation
-invx222 invert 555555555 -> NaN Invalid_operation
-invx223 invert 777777777 -> NaN Invalid_operation
-invx224 invert 999999999 -> NaN Invalid_operation
-invx225 invert 222222222 -> NaN Invalid_operation
-invx226 invert 444444444 -> NaN Invalid_operation
-invx227 invert 666666666 -> NaN Invalid_operation
-invx228 invert 888888888 -> NaN Invalid_operation
-invx229 invert 999999999 -> NaN Invalid_operation
-invx230 invert 999999999 -> NaN Invalid_operation
-invx231 invert 999999999 -> NaN Invalid_operation
-invx232 invert 999999999 -> NaN Invalid_operation
--- a few randoms
-invx240 invert 567468689 -> NaN Invalid_operation
-invx241 invert 567367689 -> NaN Invalid_operation
-invx242 invert -631917772 -> NaN Invalid_operation
-invx243 invert -756253257 -> NaN Invalid_operation
-invx244 invert 835590149 -> NaN Invalid_operation
--- test MSD
-invx250 invert 200000000 -> NaN Invalid_operation
-invx251 invert 300000000 -> NaN Invalid_operation
-invx252 invert 400000000 -> NaN Invalid_operation
-invx253 invert 500000000 -> NaN Invalid_operation
-invx254 invert 600000000 -> NaN Invalid_operation
-invx255 invert 700000000 -> NaN Invalid_operation
-invx256 invert 800000000 -> NaN Invalid_operation
-invx257 invert 900000000 -> NaN Invalid_operation
--- test MSD-1
-invx270 invert 021000000 -> NaN Invalid_operation
-invx271 invert 030100000 -> NaN Invalid_operation
-invx272 invert 040010000 -> NaN Invalid_operation
-invx273 invert 050001000 -> NaN Invalid_operation
-invx274 invert 160000100 -> NaN Invalid_operation
-invx275 invert 170000010 -> NaN Invalid_operation
-invx276 invert 180000000 -> NaN Invalid_operation
-invx277 invert 190000000 -> NaN Invalid_operation
--- test LSD
-invx280 invert 000000002 -> NaN Invalid_operation
-invx281 invert 000000003 -> NaN Invalid_operation
-invx282 invert 000000004 -> NaN Invalid_operation
-invx283 invert 000000005 -> NaN Invalid_operation
-invx284 invert 101000006 -> NaN Invalid_operation
-invx285 invert 100100007 -> NaN Invalid_operation
-invx286 invert 100010008 -> NaN Invalid_operation
-invx287 invert 100001009 -> NaN Invalid_operation
--- test Middie
-invx288 invert 000020000 -> NaN Invalid_operation
-invx289 invert 000030001 -> NaN Invalid_operation
-invx290 invert 000040000 -> NaN Invalid_operation
-invx291 invert 000050000 -> NaN Invalid_operation
-invx292 invert 101060000 -> NaN Invalid_operation
-invx293 invert 100170010 -> NaN Invalid_operation
-invx294 invert 100080100 -> NaN Invalid_operation
-invx295 invert 100091000 -> NaN Invalid_operation
--- signs
-invx296 invert -100001000 -> NaN Invalid_operation
-invx299 invert 100001000 -> 11110111
-
--- Nmax, Nmin, Ntiny
-invx341 invert 9.99999999E+999 -> NaN Invalid_operation
-invx342 invert 1E-999 -> NaN Invalid_operation
-invx343 invert 1.00000000E-999 -> NaN Invalid_operation
-invx344 invert 1E-1007 -> NaN Invalid_operation
-invx345 invert -1E-1007 -> NaN Invalid_operation
-invx346 invert -1.00000000E-999 -> NaN Invalid_operation
-invx347 invert -1E-999 -> NaN Invalid_operation
-invx348 invert -9.99999999E+999 -> NaN Invalid_operation
-
--- A few other non-integers
-invx361 invert 1.0 -> NaN Invalid_operation
-invx362 invert 1E+1 -> NaN Invalid_operation
-invx363 invert 0.0 -> NaN Invalid_operation
-invx364 invert 0E+1 -> NaN Invalid_operation
-invx365 invert 9.9 -> NaN Invalid_operation
-invx366 invert 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-invx788 invert -Inf -> NaN Invalid_operation
-invx794 invert Inf -> NaN Invalid_operation
-invx821 invert NaN -> NaN Invalid_operation
-invx841 invert sNaN -> NaN Invalid_operation
--- propagating NaNs
-invx861 invert NaN1 -> NaN Invalid_operation
-invx862 invert +NaN2 -> NaN Invalid_operation
-invx863 invert NaN3 -> NaN Invalid_operation
-invx864 invert NaN4 -> NaN Invalid_operation
-invx865 invert NaN5 -> NaN Invalid_operation
-invx871 invert sNaN11 -> NaN Invalid_operation
-invx872 invert sNaN12 -> NaN Invalid_operation
-invx873 invert sNaN13 -> NaN Invalid_operation
-invx874 invert sNaN14 -> NaN Invalid_operation
-invx875 invert sNaN15 -> NaN Invalid_operation
-invx876 invert NaN16 -> NaN Invalid_operation
-invx881 invert +NaN25 -> NaN Invalid_operation
-invx882 invert -NaN26 -> NaN Invalid_operation
-invx883 invert -sNaN27 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- invert.decTest -- digitwise logical INVERT --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check (truth table), and examples from decArith
+invx001 invert 0 -> 111111111
+invx002 invert 1 -> 111111110
+invx003 invert 10 -> 111111101
+invx004 invert 111111111 -> 0
+invx005 invert 000000000 -> 111111111
+invx006 invert 101010101 -> '10101010'
+-- and at msd and msd-1
+invx007 invert 000000000 -> 111111111
+invx009 invert 100000000 -> 11111111
+invx011 invert 000000000 -> 111111111
+invx013 invert 010000000 -> 101111111
+
+-- Various lengths
+-- 123456789 123456789
+invx021 invert 111111111 -> 0
+invx022 invert 111111111111 -> 0
+invx023 invert 11111111 -> 100000000
+invx025 invert 1111111 -> 110000000
+invx026 invert 111111 -> 111000000
+invx027 invert 11111 -> 111100000
+invx028 invert 1111 -> 111110000
+invx029 invert 111 -> 111111000
+invx031 invert 11 -> 111111100
+invx032 invert 1 -> 111111110
+invx033 invert 111111111111 -> 0
+invx034 invert 11111111111 -> 0
+invx035 invert 1111111111 -> 0
+invx036 invert 111111111 -> 0
+
+invx080 invert 011111111 -> 100000000
+invx081 invert 101111111 -> 10000000
+invx082 invert 110111111 -> 1000000
+invx083 invert 111011111 -> 100000
+invx084 invert 111101111 -> 10000
+invx085 invert 111110111 -> 1000
+invx086 invert 111111011 -> 100
+invx087 invert 111111101 -> 10
+invx088 invert 111111110 -> 1
+invx089 invert 011111011 -> 100000100
+invx090 invert 101111101 -> 10000010
+invx091 invert 110111110 -> 1000001
+invx092 invert 111011101 -> 100010
+invx093 invert 111101011 -> 10100
+invx094 invert 111110111 -> 1000
+invx095 invert 111101011 -> 10100
+invx096 invert 111011101 -> 100010
+invx097 invert 110111110 -> 1000001
+invx098 invert 101111101 -> 10000010
+invx099 invert 011111011 -> 100000100
+
+-- non-0/1 should not be accepted, nor should signs
+invx220 invert 111111112 -> NaN Invalid_operation
+invx221 invert 333333333 -> NaN Invalid_operation
+invx222 invert 555555555 -> NaN Invalid_operation
+invx223 invert 777777777 -> NaN Invalid_operation
+invx224 invert 999999999 -> NaN Invalid_operation
+invx225 invert 222222222 -> NaN Invalid_operation
+invx226 invert 444444444 -> NaN Invalid_operation
+invx227 invert 666666666 -> NaN Invalid_operation
+invx228 invert 888888888 -> NaN Invalid_operation
+invx229 invert 999999999 -> NaN Invalid_operation
+invx230 invert 999999999 -> NaN Invalid_operation
+invx231 invert 999999999 -> NaN Invalid_operation
+invx232 invert 999999999 -> NaN Invalid_operation
+-- a few randoms
+invx240 invert 567468689 -> NaN Invalid_operation
+invx241 invert 567367689 -> NaN Invalid_operation
+invx242 invert -631917772 -> NaN Invalid_operation
+invx243 invert -756253257 -> NaN Invalid_operation
+invx244 invert 835590149 -> NaN Invalid_operation
+-- test MSD
+invx250 invert 200000000 -> NaN Invalid_operation
+invx251 invert 300000000 -> NaN Invalid_operation
+invx252 invert 400000000 -> NaN Invalid_operation
+invx253 invert 500000000 -> NaN Invalid_operation
+invx254 invert 600000000 -> NaN Invalid_operation
+invx255 invert 700000000 -> NaN Invalid_operation
+invx256 invert 800000000 -> NaN Invalid_operation
+invx257 invert 900000000 -> NaN Invalid_operation
+-- test MSD-1
+invx270 invert 021000000 -> NaN Invalid_operation
+invx271 invert 030100000 -> NaN Invalid_operation
+invx272 invert 040010000 -> NaN Invalid_operation
+invx273 invert 050001000 -> NaN Invalid_operation
+invx274 invert 160000100 -> NaN Invalid_operation
+invx275 invert 170000010 -> NaN Invalid_operation
+invx276 invert 180000000 -> NaN Invalid_operation
+invx277 invert 190000000 -> NaN Invalid_operation
+-- test LSD
+invx280 invert 000000002 -> NaN Invalid_operation
+invx281 invert 000000003 -> NaN Invalid_operation
+invx282 invert 000000004 -> NaN Invalid_operation
+invx283 invert 000000005 -> NaN Invalid_operation
+invx284 invert 101000006 -> NaN Invalid_operation
+invx285 invert 100100007 -> NaN Invalid_operation
+invx286 invert 100010008 -> NaN Invalid_operation
+invx287 invert 100001009 -> NaN Invalid_operation
+-- test Middie
+invx288 invert 000020000 -> NaN Invalid_operation
+invx289 invert 000030001 -> NaN Invalid_operation
+invx290 invert 000040000 -> NaN Invalid_operation
+invx291 invert 000050000 -> NaN Invalid_operation
+invx292 invert 101060000 -> NaN Invalid_operation
+invx293 invert 100170010 -> NaN Invalid_operation
+invx294 invert 100080100 -> NaN Invalid_operation
+invx295 invert 100091000 -> NaN Invalid_operation
+-- signs
+invx296 invert -100001000 -> NaN Invalid_operation
+invx299 invert 100001000 -> 11110111
+
+-- Nmax, Nmin, Ntiny
+invx341 invert 9.99999999E+999 -> NaN Invalid_operation
+invx342 invert 1E-999 -> NaN Invalid_operation
+invx343 invert 1.00000000E-999 -> NaN Invalid_operation
+invx344 invert 1E-1007 -> NaN Invalid_operation
+invx345 invert -1E-1007 -> NaN Invalid_operation
+invx346 invert -1.00000000E-999 -> NaN Invalid_operation
+invx347 invert -1E-999 -> NaN Invalid_operation
+invx348 invert -9.99999999E+999 -> NaN Invalid_operation
+
+-- A few other non-integers
+invx361 invert 1.0 -> NaN Invalid_operation
+invx362 invert 1E+1 -> NaN Invalid_operation
+invx363 invert 0.0 -> NaN Invalid_operation
+invx364 invert 0E+1 -> NaN Invalid_operation
+invx365 invert 9.9 -> NaN Invalid_operation
+invx366 invert 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+invx788 invert -Inf -> NaN Invalid_operation
+invx794 invert Inf -> NaN Invalid_operation
+invx821 invert NaN -> NaN Invalid_operation
+invx841 invert sNaN -> NaN Invalid_operation
+-- propagating NaNs
+invx861 invert NaN1 -> NaN Invalid_operation
+invx862 invert +NaN2 -> NaN Invalid_operation
+invx863 invert NaN3 -> NaN Invalid_operation
+invx864 invert NaN4 -> NaN Invalid_operation
+invx865 invert NaN5 -> NaN Invalid_operation
+invx871 invert sNaN11 -> NaN Invalid_operation
+invx872 invert sNaN12 -> NaN Invalid_operation
+invx873 invert sNaN13 -> NaN Invalid_operation
+invx874 invert sNaN14 -> NaN Invalid_operation
+invx875 invert sNaN15 -> NaN Invalid_operation
+invx876 invert NaN16 -> NaN Invalid_operation
+invx881 invert +NaN25 -> NaN Invalid_operation
+invx882 invert -NaN26 -> NaN Invalid_operation
+invx883 invert -sNaN27 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/ln.decTest b/Lib/test/decimaltestdata/ln.decTest
index efcb2a6606..f602af2377 100644
--- a/Lib/test/decimaltestdata/ln.decTest
+++ b/Lib/test/decimaltestdata/ln.decTest
@@ -1,611 +1,611 @@
-------------------------------------------------------------------------
--- ln.decTest -- decimal natural logarithm --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 16
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- basics (examples in specification)
-precision: 9
-lnxs001 ln 0 -> -Infinity
-lnxs002 ln 1.000 -> 0
-lnxs003 ln 2.71828183 -> 1.00000000 Inexact Rounded
-lnxs004 ln 10 -> 2.30258509 Inexact Rounded
-lnxs005 ln +Infinity -> Infinity
-
-
--- basics
-precision: 16
-lnx0001 ln 0 -> -Infinity
-lnx0002 ln 1E-9 -> -20.72326583694641 Inexact Rounded
-lnx0003 ln 0.0007 -> -7.264430222920869 Inexact Rounded
-lnx0004 ln 0.1 -> -2.302585092994046 Inexact Rounded
-lnx0005 ln 0.7 -> -0.3566749439387324 Inexact Rounded
-lnx0006 ln 1 -> 0
-lnx0007 ln 1.000 -> 0
-lnx0008 ln 1.5 -> 0.4054651081081644 Inexact Rounded
-lnx0009 ln 2 -> 0.6931471805599453 Inexact Rounded
-lnx0010 ln 2.718281828459045 -> 0.9999999999999999 Inexact Rounded
-lnx0011 ln 2.718281828459046 -> 1.000000000000000 Inexact Rounded
-lnx0012 ln 2.718281828459047 -> 1.000000000000001 Inexact Rounded
-lnx0013 ln 10 -> 2.302585092994046 Inexact Rounded
-lnx0014 ln 10.5 -> 2.351375257163478 Inexact Rounded
-lnx0015 ln 9999 -> 9.210240366975849 Inexact Rounded
-lnx0016 ln 1E6 -> 13.81551055796427 Inexact Rounded
-lnx0017 ln 1E+9 -> 20.72326583694641 Inexact Rounded
-lnx0018 ln +Infinity -> Infinity
-
--- notable cases
--- negatives
-lnx0021 ln -1E-9 -> NaN Invalid_operation
-lnx0022 ln -0.0007 -> NaN Invalid_operation
-lnx0023 ln -0.1 -> NaN Invalid_operation
-lnx0024 ln -0.7 -> NaN Invalid_operation
-lnx0025 ln -1 -> NaN Invalid_operation
-lnx0026 ln -1.5 -> NaN Invalid_operation
-lnx0027 ln -2 -> NaN Invalid_operation
-lnx0029 ln -10.5 -> NaN Invalid_operation
-lnx0028 ln -9999 -> NaN Invalid_operation
-lnx0030 ln -2.718281828459045 -> NaN Invalid_operation
-lnx0031 ln -2.718281828459046 -> NaN Invalid_operation
-lnx0032 ln -0 -> -Infinity
-lnx0033 ln -0E+17 -> -Infinity
-lnx0034 ln -0E-17 -> -Infinity
--- other zeros
-lnx0041 ln 0 -> -Infinity
-lnx0042 ln 0E+17 -> -Infinity
-lnx0043 ln 0E-17 -> -Infinity
--- infinities
-lnx0045 ln -Infinity -> NaN Invalid_operation
-lnx0046 ln +Infinity -> Infinity
--- ones
-lnx0050 ln 1 -> 0
-lnx0051 ln 1.0 -> 0
-lnx0052 ln 1.000000000000000 -> 0
-lnx0053 ln 1.000000000000000000 -> 0
-
--- lower precision basics
-Precision: 7
-lnx0101 ln 0 -> -Infinity
-lnx0102 ln 1E-9 -> -20.72327 Inexact Rounded
-lnx0103 ln 0.0007 -> -7.264430 Inexact Rounded
-lnx0104 ln 0.1 -> -2.302585 Inexact Rounded
-lnx0105 ln 0.7 -> -0.3566749 Inexact Rounded
-lnx0106 ln 1 -> 0
-lnx0107 ln 1.5 -> 0.4054651 Inexact Rounded
-lnx0108 ln 2 -> 0.6931472 Inexact Rounded
-lnx0109 ln 2.718281828459045 -> 1.000000 Inexact Rounded
-lnx0110 ln 2.718281828459046 -> 1.000000 Inexact Rounded
-lnx0111 ln 2.718281828459047 -> 1.000000 Inexact Rounded
-lnx0112 ln 10 -> 2.302585 Inexact Rounded
-lnx0113 ln 10.5 -> 2.351375 Inexact Rounded
-lnx0114 ln 9999 -> 9.210240 Inexact Rounded
-lnx0115 ln 1E6 -> 13.81551 Inexact Rounded
-lnx0116 ln 1E+9 -> 20.72327 Inexact Rounded
-lnx0117 ln +Infinity -> Infinity
-Precision: 2
-lnx0121 ln 0 -> -Infinity
-lnx0122 ln 1E-9 -> -21 Inexact Rounded
-lnx0123 ln 0.0007 -> -7.3 Inexact Rounded
-lnx0124 ln 0.1 -> -2.3 Inexact Rounded
-lnx0125 ln 0.7 -> -0.36 Inexact Rounded
-lnx0126 ln 1 -> 0
-lnx0127 ln 1.5 -> 0.41 Inexact Rounded
-lnx0128 ln 2 -> 0.69 Inexact Rounded
-lnx0129 ln 2.718281828459045 -> 1.0 Inexact Rounded
-lnx0130 ln 2.718281828459046 -> 1.0 Inexact Rounded
-lnx0131 ln 2.718281828459047 -> 1.0 Inexact Rounded
-lnx0132 ln 10 -> 2.3 Inexact Rounded
-lnx0133 ln 10.5 -> 2.4 Inexact Rounded
-lnx0134 ln 9999 -> 9.2 Inexact Rounded
-lnx0135 ln 1E6 -> 14 Inexact Rounded
-lnx0136 ln 1E+9 -> 21 Inexact Rounded
-lnx0137 ln +Infinity -> Infinity
-Precision: 1
-lnx0141 ln 0 -> -Infinity
-lnx0142 ln 1E-9 -> -2E+1 Inexact Rounded
-lnx0143 ln 0.0007 -> -7 Inexact Rounded
-lnx0144 ln 0.1 -> -2 Inexact Rounded
-lnx0145 ln 0.7 -> -0.4 Inexact Rounded
-lnx0146 ln 1 -> 0
-lnx0147 ln 1.5 -> 0.4 Inexact Rounded
-lnx0148 ln 2 -> 0.7 Inexact Rounded
-lnx0149 ln 2.718281828459045 -> 1 Inexact Rounded
-lnx0150 ln 2.718281828459046 -> 1 Inexact Rounded
-lnx0151 ln 2.718281828459047 -> 1 Inexact Rounded
-lnx0152 ln 10 -> 2 Inexact Rounded
-lnx0153 ln 10.5 -> 2 Inexact Rounded
-lnx0154 ln 9999 -> 9 Inexact Rounded
-lnx0155 ln 1E6 -> 1E+1 Inexact Rounded
-lnx0156 ln 1E+9 -> 2E+1 Inexact Rounded
-lnx0157 ln +Infinity -> Infinity
-
--- group low-precision ln(1)s:
-precision: 1
-lnx0161 ln 1 -> 0
-precision: 2
-lnx0162 ln 1 -> 0
-precision: 3
-lnx0163 ln 1 -> 0
-precision: 4
-lnx0164 ln 1 -> 0
-precision: 5
-lnx0165 ln 1 -> 0
-precision: 6
-lnx0166 ln 1 -> 0
-precision: 7
-lnx0167 ln 1 -> 0
-precision: 8
-lnx0168 ln 1 -> 0
-
--- edge-test ln(2) and ln(10) in case of lookasides
-precision: 45
-lnx201 ln 2 -> 0.693147180559945309417232121458176568075500134 Inexact Rounded
-lnx202 ln 10 -> 2.30258509299404568401799145468436420760110149 Inexact Rounded
-precision: 44
-lnx203 ln 2 -> 0.69314718055994530941723212145817656807550013 Inexact Rounded
-lnx204 ln 10 -> 2.3025850929940456840179914546843642076011015 Inexact Rounded
-precision: 43
-lnx205 ln 2 -> 0.6931471805599453094172321214581765680755001 Inexact Rounded
-lnx206 ln 10 -> 2.302585092994045684017991454684364207601101 Inexact Rounded
-precision: 42
-lnx207 ln 2 -> 0.693147180559945309417232121458176568075500 Inexact Rounded
-lnx208 ln 10 -> 2.30258509299404568401799145468436420760110 Inexact Rounded
-precision: 41
-lnx209 ln 2 -> 0.69314718055994530941723212145817656807550 Inexact Rounded
-lnx210 ln 10 -> 2.3025850929940456840179914546843642076011 Inexact Rounded
-precision: 40
-lnx211 ln 2 -> 0.6931471805599453094172321214581765680755 Inexact Rounded
-lnx212 ln 10 -> 2.302585092994045684017991454684364207601 Inexact Rounded
-precision: 39
-lnx213 ln 2 -> 0.693147180559945309417232121458176568076 Inexact Rounded
-lnx214 ln 10 -> 2.30258509299404568401799145468436420760 Inexact Rounded
-precision: 38
-lnx215 ln 2 -> 0.69314718055994530941723212145817656808 Inexact Rounded
-lnx216 ln 10 -> 2.3025850929940456840179914546843642076 Inexact Rounded
-precision: 37
-lnx217 ln 2 -> 0.6931471805599453094172321214581765681 Inexact Rounded
-lnx218 ln 10 -> 2.302585092994045684017991454684364208 Inexact Rounded
-precision: 36
-lnx219 ln 2 -> 0.693147180559945309417232121458176568 Inexact Rounded
-lnx220 ln 10 -> 2.30258509299404568401799145468436421 Inexact Rounded
-precision: 35
-lnx221 ln 2 -> 0.69314718055994530941723212145817657 Inexact Rounded
-lnx222 ln 10 -> 2.3025850929940456840179914546843642 Inexact Rounded
-precision: 34
-lnx223 ln 2 -> 0.6931471805599453094172321214581766 Inexact Rounded
-lnx224 ln 10 -> 2.302585092994045684017991454684364 Inexact Rounded
-precision: 33
-lnx225 ln 2 -> 0.693147180559945309417232121458177 Inexact Rounded
-lnx226 ln 10 -> 2.30258509299404568401799145468436 Inexact Rounded
-precision: 32
-lnx227 ln 2 -> 0.69314718055994530941723212145818 Inexact Rounded
-lnx228 ln 10 -> 2.3025850929940456840179914546844 Inexact Rounded
-precision: 31
-lnx229 ln 2 -> 0.6931471805599453094172321214582 Inexact Rounded
-lnx230 ln 10 -> 2.302585092994045684017991454684 Inexact Rounded
-precision: 30
-lnx231 ln 2 -> 0.693147180559945309417232121458 Inexact Rounded
-lnx232 ln 10 -> 2.30258509299404568401799145468 Inexact Rounded
-
--- extreme input range values
-maxExponent: 384
-minExponent: -383
-Precision: 16
-
-lnx0901 ln 1e-400 -> -921.0340371976183 Inexact Rounded
-lnx0902 ln 1e+400 -> 921.0340371976183 Inexact Rounded
-lnx0903 ln 1e-999999 -> -2302582.790408953 Inexact Rounded
-lnx0904 ln 1e+999999 -> 2302582.790408953 Inexact Rounded
-lnx0905 ln 1e-1000013 -> -2302615.026600255 Inexact Rounded
-lnx0906 ln 2e-1000013 -> -2302614.333453074 Inexact Rounded
-
-lnx0910 ln 9.999999e+999999 -> 2302585.092993946 Inexact Rounded
-lnx0911 ln 9.9999999e+999999 -> 2302585.092994036 Inexact Rounded
-lnx0912 ln 9.99999999e+999999 -> 2302585.092994045 Inexact Rounded
-lnx0913 ln 9.999999999e+999999 -> 2302585.092994046 Inexact Rounded
-lnx0914 ln 9.999999999999e+999999 -> 2302585.092994046 Inexact Rounded
-lnx0915 ln 9.999999999999999e+999999 -> 2302585.092994046 Inexact Rounded
-lnx0916 ln 9.999999999999999999999999e+999999 -> 2302585.092994046 Inexact Rounded
-
--- randoms
--- P=50, within 0-999
-Precision: 50
-maxExponent: 384
-minExponent: -383
-lnx1501 ln 0.00098800906574486388604608477869812518857023768951 -> -6.9198186844033787995945147836955586009548513043689 Inexact Rounded
-lnx1502 ln 158.15866624664623070184595045304145949900714987827 -> 5.0635987458895647454907806507503825602758392287684 Inexact Rounded
-lnx1503 ln 0.00565661412059571925040285814021799775249288309321 -> -5.1749297776760632102047540300491550931651318975237 Inexact Rounded
-lnx1504 ln 0.00000006914232532620489602008402091666547903180607 -> -16.487098770877825308138976818688771638172333034347 Inexact Rounded
-lnx1505 ln 0.00025380374621297657504661540749355251231770070723 -> -8.2789492423005003205242162741569033124260321954589 Inexact Rounded
-lnx1506 ln 83.033654063877426261108592599182418953442677554806 -> 4.4192459962647137976949249810815698465031609843669 Inexact Rounded
-lnx1507 ln 0.00000000416863228092481651627734668440663678118729 -> -19.295677845122141772791294599714950175284915666430 Inexact Rounded
-lnx1508 ln 0.00000140847873187820570181214271960511080523457669 -> -13.473000349581967189668305314384952251556809480339 Inexact Rounded
-lnx1509 ln 66.176106555181527101630351127583944689752069132522 -> 4.1923194696232505883666171116966137694013431504252 Inexact Rounded
-lnx1510 ln 0.00000000000009899043487403590900111602024562297908 -> -29.943753166877840985821508112917991506656545174163 Inexact Rounded
-lnx1511 ln 0.00000000000324618296721747097510453388683912733569 -> -26.453541281444586819009546418577507163362590139422 Inexact Rounded
-lnx1512 ln 72.646968818463546449499147579023555008392860423385 -> 4.2856116660689646882852128853423566276718230426479 Inexact Rounded
-lnx1513 ln 0.00000000000000066755483124635612574263153825990523 -> -34.942910142802769319262875080398852491588707172483 Inexact Rounded
-lnx1514 ln 61.002910447202398204114909451851111424657671911002 -> 4.1109215752843377323363182051446177066434038096529 Inexact Rounded
-lnx1515 ln 917.06917611331980999227893584010544542312239174774 -> 6.8211829068303114128752453661946446979787826282907 Inexact Rounded
-lnx1516 ln 0.00000000170823794883673083358549749078972003965194 -> -20.187803436976150477297246666771626827057191023004 Inexact Rounded
-lnx1517 ln 0.53731767845358224445809761315159249898566542910649 -> -0.62116577939968409211736413628236285160048357000961 Inexact Rounded
-lnx1518 ln 0.00000000000000008965291392882804161299758708033373 -> -36.950585970980857376081265073276303670820056916206 Inexact Rounded
-lnx1519 ln 0.00000000006990244916026429904498278982530170295668 -> -23.383920429244457578373523508427783144589480420753 Inexact Rounded
-lnx1520 ln 4.0312542977070300070506064666536478373801988540614 -> 1.3940775676592451945795752796421391871302024763305 Inexact Rounded
-lnx1521 ln 271.84991311551875601432518819562391699324632396423 -> 5.6052501239873862517916679747146539808077431873478 Inexact Rounded
-lnx1522 ln 7.4118671629373864667229445746862314443895404818689 -> 2.0030823863706344628239147639318289961917060121141 Inexact Rounded
-lnx1523 ln 0.00000000000002026311452625364905357321664186034258 -> -31.529974180054438792043856877314043794320951134754 Inexact Rounded
-lnx1524 ln 0.00000000000009563398651261756952398250624737809347 -> -29.978248130576972953141284136962670021368834792579 Inexact Rounded
-lnx1525 ln 0.00000000009556772669409858653026558223465197808991 -> -23.071185939748285541228206161472956661196956741186 Inexact Rounded
-lnx1526 ln 6.8441648298027301292342057248737326152250794026761 -> 1.9233964395801946597272589473417948024361005082908 Inexact Rounded
-lnx1527 ln 0.00000000000073059699884439979394945822035704264577 -> -27.944914388353724718836101828677771967128509603158 Inexact Rounded
-lnx1528 ln 0.00000000000000002610078280419082263138064745416787 -> -38.184566367516207885573773320135965798717120735115 Inexact Rounded
-lnx1529 ln 0.00000000000000000150259517166294243088546806083283 -> -41.039337946266676108538170837580051699618334928421 Inexact Rounded
-lnx1530 ln 0.00000000000000087919160541714580707181969708502091 -> -34.667528818827671507514319744047440696187358676848 Inexact Rounded
-lnx1531 ln 0.00000000000395726725120787763271849577708068584598 -> -26.255467416961357741818735787226671938678424748431 Inexact Rounded
-lnx1532 ln 0.00000000002014334901669366218018377213150715938355 -> -24.628146955635359035289123027319969201693737159108 Inexact Rounded
-lnx1533 ln 0.00000008097927101101093117753938766241442896030637 -> -16.329072628469715178637178365710373398203190937454 Inexact Rounded
-lnx1534 ln 0.00000000000017115834162632864392039668116243984176 -> -29.396187292434898225453626794459285157263177528034 Inexact Rounded
-lnx1535 ln 0.39168317593866334087305459933723864294857086105035 -> -0.93730199062757240485836637306785037368746737693029 Inexact Rounded
-lnx1536 ln 79.335036798971515026519630103325369729637514127617 -> 4.3736798570287828823772149735170431010616961976965 Inexact Rounded
-lnx1537 ln 0.00000000000000056004952129926137413602116591493625 -> -35.118506463181870020730685884333000241039028127213 Inexact Rounded
-lnx1538 ln 0.00000006006035907843890918832481099660639553666078 -> -16.627915795747112566532705974853114454405010472043 Inexact Rounded
-lnx1539 ln 0.00000000085242024937414906371333826574632450587590 -> -20.882941460268101080186482230657774997273494107221 Inexact Rounded
-lnx1540 ln 0.00000000000043671099499262350316173246550771951561 -> -28.459504757285639221776305968469058854558726593945 Inexact Rounded
-
--- P=34, within 0-999
-Precision: 34
-lnx1201 ln 0.0086732880815927182997566810334394 -> -4.747507311920844752486938187973721 Inexact Rounded
-lnx1202 ln 0.0007104103693460260609792222569854 -> -7.249667769903503023005549250347695 Inexact Rounded
-lnx1203 ln 786.8398945385105190697541493392742 -> 6.668024790031836340471824147010546 Inexact Rounded
-lnx1204 ln 0.7723073620282687656895190171967399 -> -0.2583726708506850868786816238217326 Inexact Rounded
-lnx1205 ln 0.0061057951517197631287183938412200 -> -5.098516933918797347064454103742635 Inexact Rounded
-lnx1206 ln 0.6181379708184393730103917562498745 -> -0.4810435926903365087463387760350021 Inexact Rounded
-lnx1207 ln 09.13888261229039989110753389096760 -> 2.212538125507975574509563027696021 Inexact Rounded
-lnx1208 ln 802.0105417063143696497292158147174 -> 6.687121752052341737234832203350214 Inexact Rounded
-lnx1209 ln 778.7749710387773713523028497333058 -> 6.657722135126935472086625031413031 Inexact Rounded
-lnx1210 ln 0.0024457295895346502513567679390616 -> -6.013411799940245345321348290398517 Inexact Rounded
-lnx1211 ln 0.0000511296947872828310338864217860 -> -9.881145118237281798081573131711636 Inexact Rounded
-lnx1212 ln 0.0000246803508602554924938685155658 -> -10.60950314264825661825360971430218 Inexact Rounded
-lnx1213 ln 9.027898199253511668242977766616082 -> 2.200319582778899029786017830557293 Inexact Rounded
-lnx1214 ln 0.0991812396542505631850692800904188 -> -2.310806398964672258823043180400384 Inexact Rounded
-lnx1215 ln 0.0000000000070238810143028811223924 -> -25.68170519961636647174714538290075 Inexact Rounded
-lnx1216 ln 2.630101665342826494730394729313167 -> 0.9670225014664367465128243039749559 Inexact Rounded
-lnx1217 ln 0.0056878928594359587691526063254683 -> -5.169415422904037819736637399445096 Inexact Rounded
-lnx1218 ln 567.3436047121057843908106573095590 -> 6.340965124964258486463444360787970 Inexact Rounded
-lnx1219 ln 1.199291248124655996614605745649725 -> 0.1817307557425911805765087755675657 Inexact Rounded
-lnx1220 ln 25.02050448582031098696267479135557 -> 3.219695668137659139544178905459317 Inexact Rounded
-lnx1221 ln 0.0000000000009939597023558756961300 -> -27.63707972996537636504396558259058 Inexact Rounded
-lnx1222 ln 0.0000007988551670159429716506430403 -> -14.04008617542597230988198612376415 Inexact Rounded
-lnx1223 ln 4.681515800176129184873770605589795 -> 1.543621946415383338972124445445748 Inexact Rounded
-lnx1224 ln 15.95126669161103011206658749345781 -> 2.769538242479483539275986395443539 Inexact Rounded
-lnx1225 ln 0.0301626783922211213675457279076066 -> -3.501149933677283341023932281826341 Inexact Rounded
-lnx1226 ln 000.0040544064881821770528475185674 -> -5.507950967557021671647165889608324 Inexact Rounded
-lnx1227 ln 29.01617095935593792095913785100360 -> 3.367853293862745651888450004473297 Inexact Rounded
-lnx1228 ln 78.01836167344736733024804243195323 -> 4.356944205055768575987781375003992 Inexact Rounded
-lnx1229 ln 0.0000000096545319316965321158634893 -> -18.45583840160965814462095477365013 Inexact Rounded
-lnx1230 ln 97.95475237720579752770587185074428 -> 4.584505661612812742208619358214729 Inexact Rounded
-lnx1231 ln 528.0609262050423246402564228432371 -> 6.269211667589138113396583894315956 Inexact Rounded
-lnx1232 ln 0.0000002250064349732969696660452972 -> -15.30713683526963996712167701738724 Inexact Rounded
-lnx1233 ln 47.97063637767998658567199049725754 -> 3.870589081585660692195989854842372 Inexact Rounded
-lnx1234 ln 0.0005394311344541432318853513414361 -> -7.524995428393925934087126702974121 Inexact Rounded
-lnx1235 ln 0.0000000090973385649567471674972633 -> -18.51528393158931783447035004125791 Inexact Rounded
-lnx1236 ln 0.0000000000238776490227576197317977 -> -24.45807828188389561331158879207262 Inexact Rounded
-lnx1237 ln 0.0000236587000231921532145326218758 -> -10.65177964499823314952429277979034 Inexact Rounded
-lnx1238 ln 499.1277448846130709827154556125942 -> 6.212862064761427967461188083514774 Inexact Rounded
-lnx1239 ln 0.0000003960192300284787663712417647 -> -14.74180306619298548093697608293284 Inexact Rounded
-lnx1240 ln 41.08268350829477451667228892495136 -> 3.715586706887278039173584859218960 Inexact Rounded
-
--- P=16, within 0-99
-Precision: 16
-lnx1101 ln 7.964875261033948 -> 2.075041282352241 Inexact Rounded
-lnx1102 ln 13.54527396845394 -> 2.606037701870263 Inexact Rounded
-lnx1103 ln 0.0008026554341331 -> -7.127585034321814 Inexact Rounded
-lnx1104 ln 0.0000030582233261 -> -12.69767642300625 Inexact Rounded
-lnx1105 ln 0.0004477497509672 -> -7.711276073210766 Inexact Rounded
-lnx1106 ln 7.616268622474371 -> 2.030286567675148 Inexact Rounded
-lnx1107 ln 51.58329925806381 -> 3.943197962309569 Inexact Rounded
-lnx1108 ln 0.0018197497951263 -> -6.309056262549345 Inexact Rounded
-lnx1109 ln 2.956282457072984 -> 1.083932552334575 Inexact Rounded
-lnx1110 ln 0.3843325579189906 -> -0.9562470649400558 Inexact Rounded
-lnx1111 ln 0.0074466329265663 -> -4.899993304919237 Inexact Rounded
-lnx1112 ln 0.0003372478532993 -> -7.994692428206378 Inexact Rounded
-lnx1113 ln 0.0084792263167809 -> -4.770136069569271 Inexact Rounded
-lnx1114 ln 5.926756998151102 -> 1.779477182834305 Inexact Rounded
-lnx1115 ln 9.025699152180897 -> 2.200075969604119 Inexact Rounded
-lnx1116 ln 1.910124643533526 -> 0.6471684983238183 Inexact Rounded
-lnx1117 ln 0.8158922711411020 -> -0.2034729533939387 Inexact Rounded
-lnx1118 ln 0.0067080016475322 -> -5.004454189414139 Inexact Rounded
-lnx1119 ln 0.0047583242092716 -> -5.347859729601094 Inexact Rounded
-lnx1120 ln 0.0386647411641339 -> -3.252827175263113 Inexact Rounded
-lnx1121 ln 0.0050226427841761 -> -5.293799032774131 Inexact Rounded
-lnx1122 ln 6.927937541637261 -> 1.935562155866906 Inexact Rounded
-lnx1123 ln 0.0000095745343513 -> -11.55640365579814 Inexact Rounded
-lnx1124 ln 1.602465492956538 -> 0.4715433763243936 Inexact Rounded
-lnx1125 ln 38.98415625087535 -> 3.663155313610213 Inexact Rounded
-lnx1126 ln 5.343182042276734 -> 1.675821363568112 Inexact Rounded
-lnx1127 ln 55.89763703245816 -> 4.023522107934110 Inexact Rounded
-lnx1128 ln 0.7445257810280847 -> -0.2950077988101030 Inexact Rounded
-lnx1129 ln 1.631407314946094 -> 0.4894430257201248 Inexact Rounded
-lnx1130 ln 0.0005462451932602 -> -7.512442611116852 Inexact Rounded
-lnx1131 ln 0.0000864173269362 -> -9.356322359017317 Inexact Rounded
-lnx1132 ln 5.227161719132849 -> 1.653868438439637 Inexact Rounded
-lnx1133 ln 60.57078466941998 -> 4.103812675662452 Inexact Rounded
-lnx1134 ln 0.0992864325333160 -> -2.309746348350318 Inexact Rounded
-lnx1135 ln 09.48564268447325 -> 2.249779359074983 Inexact Rounded
-lnx1136 ln 0.0036106089355634 -> -5.623878840650787 Inexact Rounded
-lnx1137 ln 1.805176865587172 -> 0.5906585734593707 Inexact Rounded
-lnx1138 ln 62.59363259642255 -> 4.136663557220559 Inexact Rounded
-lnx1139 ln 4.373828261137201 -> 1.475638657912000 Inexact Rounded
-lnx1140 ln 0.994483524148738 -> -0.005531747794938690 Inexact Rounded
-
--- P=7, within 0-9
-Precision: 7
-lnx1001 ln 0.0912025 -> -2.394673 Inexact Rounded
-lnx1002 ln 0.9728626 -> -0.02751242 Inexact Rounded
-lnx1003 ln 0.3886032 -> -0.9451965 Inexact Rounded
-lnx1004 ln 8.798639 -> 2.174597 Inexact Rounded
-lnx1005 ln 2.459121 -> 0.8998040 Inexact Rounded
-lnx1006 ln 2.013193 -> 0.6997220 Inexact Rounded
-lnx1007 ln 9.064857 -> 2.204405 Inexact Rounded
-lnx1008 ln 5.796417 -> 1.757240 Inexact Rounded
-lnx1009 ln 0.1143471 -> -2.168517 Inexact Rounded
-lnx1010 ln 0.5341542 -> -0.6270707 Inexact Rounded
-lnx1011 ln 6.693781 -> 1.901179 Inexact Rounded
-lnx1012 ln 0.0081779 -> -4.806320 Inexact Rounded
-lnx1013 ln 8.313616 -> 2.117895 Inexact Rounded
-lnx1014 ln 3.486925 -> 1.249020 Inexact Rounded
-lnx1015 ln 0.1801401 -> -1.714020 Inexact Rounded
-lnx1016 ln 0.5227148 -> -0.6487193 Inexact Rounded
-lnx1017 ln 7.818111 -> 2.056443 Inexact Rounded
-lnx1018 ln 0.0870671 -> -2.441076 Inexact Rounded
-lnx1019 ln 8.153966 -> 2.098504 Inexact Rounded
-lnx1020 ln 2.040975 -> 0.7134276 Inexact Rounded
-lnx1021 ln 1.481642 -> 0.3931509 Inexact Rounded
-lnx1022 ln 0.2610123 -> -1.343188 Inexact Rounded
-lnx1023 ln 0.466723 -> -0.7620193 Inexact Rounded
-lnx1024 ln 0.0518756 -> -2.958907 Inexact Rounded
-lnx1025 ln 2.056410 -> 0.7209617 Inexact Rounded
-lnx1026 ln 0.181522 -> -1.706378 Inexact Rounded
-lnx1027 ln 0.515551 -> -0.6625190 Inexact Rounded
-lnx1028 ln 8.425089 -> 2.131214 Inexact Rounded
-lnx1029 ln 2.077091 -> 0.7309684 Inexact Rounded
-lnx1030 ln 6.212705 -> 1.826596 Inexact Rounded
-lnx1031 ln 5.729343 -> 1.745601 Inexact Rounded
-lnx1032 ln 4.831251 -> 1.575105 Inexact Rounded
-lnx1033 ln 2.029760 -> 0.7079176 Inexact Rounded
-lnx1034 ln 8.615060 -> 2.153512 Inexact Rounded
-lnx1035 ln 0.0611511 -> -2.794407 Inexact Rounded
-lnx1036 ln 5.195269 -> 1.647748 Inexact Rounded
-lnx1037 ln 9.617686 -> 2.263604 Inexact Rounded
-lnx1038 ln 0.0049382 -> -5.310754 Inexact Rounded
-lnx1039 ln 2.786840 -> 1.024908 Inexact Rounded
-lnx1040 ln 0.0091073 -> -4.698679 Inexact Rounded
-
--- from here 3-digit tests are based on reverse exp tests
-precision: 9
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
-lnx001 ln 0 -> -Infinity
-lnx002 ln 0.367879441 -> -1.00000000 Inexact Rounded
-lnx003 ln 1 -> 0
-lnx005 ln 2.71828183 -> 1.00000000 Inexact Rounded
-lnx006 ln 2.00000000 -> 0.693147181 Inexact Rounded
-lnx007 ln +Infinity -> Infinity
-
--- tiny edge cases
-precision: 7
-lnx011 ln 1.105171 -> 0.1000001 Inexact Rounded
-lnx012 ln 1.010050 -> 0.009999835 Inexact Rounded
-lnx013 ln 1.000010 -> 0.000009999950 Inexact Rounded
-lnx014 ln 1.000001 -> 9.999995E-7 Inexact Rounded
-lnx015 ln 1.000000 -> 0
-
--- basic e=0, e=1, e=2, e=4, e>=8 cases
-precision: 7
-lnx041 ln 2.718282 -> 1.000000 Inexact Rounded
-lnx042 ln 0.3678794 -> -1.000000 Inexact Rounded
-lnx043 ln 22026.47 -> 10.00000 Inexact Rounded
-lnx044 ln 0.00004539993 -> -10.00000 Inexact Rounded
-lnx045 ln 2.688117E+43 -> 100.0000 Inexact Rounded
-lnx046 ln 3.720076E-44 -> -100.0000 Inexact Rounded
-lnx047 ln Infinity -> Infinity
-lnx048 ln 0E-389 -> -Infinity
-
--- miscellanea
-precision: 16
-lnx055 ln 2.717658486884572E-236 -> -542.4103112874415 Inexact Rounded
-precision: 17
-lnx056 ln 2.7176584868845721E-236 -> -542.41031128744146 Inexact Rounded
-precision: 18
-lnx057 ln 2.71765848688457211E-236 -> -542.410311287441459 Inexact Rounded
-precision: 19
-lnx058 ln 2.717658486884572112E-236 -> -542.4103112874414592 Inexact Rounded
-precision: 20
-lnx059 ln 2.7176584868845721118E-236 -> -542.41031128744145917 Inexact Rounded
-
--- inputs ending in ..500.., ..499.., ..100.., ..999.. sequences
-precision: 50
-lnx102 ln 0.9999999100000040499998785000027 -> -9.0000000000000000000000033749953829996446124861750E-8 Inexact Rounded
-precision: 30
-lnx103 ln 0.999999910000004049999878500003 -> -8.99999999999999999999997337499E-8 Inexact Rounded
-precision: 29
-lnx104 ln 0.99999991000000404999987850000 -> -9.0000000000000000000002733750E-8 Inexact Rounded
-precision: 28
-lnx105 ln 0.9999999100000040499998785000 -> -9.000000000000000000000273375E-8 Inexact Rounded
-precision: 27
-lnx106 ln 0.999999910000004049999878500 -> -9.00000000000000000000027338E-8 Inexact Rounded
-precision: 26
-lnx107 ln 0.99999991000000404999987850 -> -9.0000000000000000000002734E-8 Inexact Rounded
-precision: 25
-lnx108 ln 0.9999999100000040499998785 -> -9.000000000000000000000273E-8 Inexact Rounded
-precision: 24
-lnx109 ln 0.999999910000004049999879 -> -8.99999999999999995000027E-8 Inexact Rounded
-precision: 23
-lnx110 ln 0.99999991000000404999988 -> -8.9999999999999998500003E-8 Inexact Rounded
-precision: 22
-lnx111 ln 0.9999999100000040499999 -> -8.999999999999997850000E-8 Inexact Rounded
-precision: 21
-lnx112 ln 0.999999910000004050000 -> -8.99999999999998785000E-8 Inexact Rounded
-precision: 20
-lnx113 ln 0.99999991000000405000 -> -8.9999999999999878500E-8 Inexact Rounded
-precision: 19
-lnx114 ln 0.9999999100000040500 -> -8.999999999999987850E-8 Inexact Rounded
-precision: 18
-lnx115 ln 0.999999910000004050 -> -8.99999999999998785E-8 Inexact Rounded
--- next may be a > 0.5ulp case; a more precise answer is:
--- -8.99999999999998784999918E-8
-precision: 17
-lnx116 ln 0.99999991000000405 -> -8.9999999999999878E-8 Inexact Rounded
-precision: 16
-lnx117 ln 0.9999999100000040 -> -9.000000004999988E-8 Inexact Rounded
-precision: 15
-lnx118 ln 0.999999910000004 -> -9.00000000499999E-8 Inexact Rounded
-precision: 14
-lnx119 ln 0.99999991000000 -> -9.0000004050000E-8 Inexact Rounded
-precision: 13
-lnx120 ln 0.9999999100000 -> -9.000000405000E-8 Inexact Rounded
-precision: 12
-lnx121 ln 0.999999910000 -> -9.00000040500E-8 Inexact Rounded
-precision: 11
-lnx122 ln 0.99999991000 -> -9.0000004050E-8 Inexact Rounded
-precision: 10
-lnx123 ln 0.9999999100 -> -9.000000405E-8 Inexact Rounded
-precision: 9
-lnx124 ln 0.999999910 -> -9.00000041E-8 Inexact Rounded
-precision: 8
-lnx125 ln 0.99999991 -> -9.0000004E-8 Inexact Rounded
-precision: 7
-lnx126 ln 0.9999999 -> -1.000000E-7 Inexact Rounded
-precision: 16
-lnx126b ln 0.9999999 -> -1.000000050000003E-7 Inexact Rounded
-precision: 6
-lnx127 ln 0.999999 -> -0.00000100000 Inexact Rounded
-precision: 5
-lnx128 ln 0.99999 -> -0.000010000 Inexact Rounded
-precision: 4
-lnx129 ln 0.9999 -> -0.0001000 Inexact Rounded
-precision: 3
-lnx130 ln 0.999 -> -0.00100 Inexact Rounded
-precision: 2
-lnx131 ln 0.99 -> -0.010 Inexact Rounded
-precision: 1
-lnx132 ln 0.9 -> -0.1 Inexact Rounded
-
-
--- cases near 1 -- 1 2345678901234567890
-precision: 20
-lnx401 ln 2.7182818284589365041 -> 0.99999999999996000000 Inexact Rounded
-lnx402 ln 2.7182818284589636869 -> 0.99999999999997000000 Inexact Rounded
-lnx403 ln 2.7182818284589908697 -> 0.99999999999997999999 Inexact Rounded
-lnx404 ln 2.7182818284590180525 -> 0.99999999999998999998 Inexact Rounded
-lnx405 ln 2.7182818284590452354 -> 1.0000000000000000000 Inexact Rounded
-lnx406 ln 2.7182818284593170635 -> 1.0000000000001000000 Inexact Rounded
-lnx407 ln 2.7182818284595888917 -> 1.0000000000002000000 Inexact Rounded
-precision: 14
-lnx411 ln 2.7182818284589 -> 0.99999999999995 Inexact Rounded
-lnx413 ln 2.7182818284590 -> 0.99999999999998 Inexact Rounded
-lnx416 ln 2.7182818284591 -> 1.0000000000000 Inexact Rounded
-lnx417 ln 2.7182818284592 -> 1.0000000000001 Inexact Rounded
-
--- overflows, including some exp overprecise borderlines
-precision: 7
-maxExponent: 384
-minExponent: -383
-lnx709 ln 9.999999E+384 -> 886.4953 Inexact Rounded
-lnx711 ln 9.999992E+384 -> 886.4953 Inexact Rounded
-precision: 16
-lnx722 ln 9.999999999999999E+384 -> 886.4952608027076 Inexact Rounded
-lnx724 ln 9.999999999999917E+384 -> 886.4952608027076 Inexact Rounded
-lnx726 ln 9.999999999999117E+384 -> 886.4952608027075 Inexact Rounded
--- and more...
-precision: 15
-maxExponent: 999
-minExponent: -999
-lnx731 ln 9.99999999999999E+999 -> 2302.58509299405 Inexact Rounded
--- next may be a > 0.5ulp case; a more precise answer is:
--- 2302.58509299404495001799145442
-lnx732 ln 9.99999999999266E+999 -> 2302.58509299404 Inexact Rounded
-lnx733 ln 9.99999999999265E+999 -> 2302.58509299404 Inexact Rounded
-lnx734 ln 9.99999999999264E+999 -> 2302.58509299404 Inexact Rounded
-
--- subnormals and underflows for exp, including underflow-to-zero edge point
-precision: 7
-maxExponent: 384
-minExponent: -383
-lnx751 ln 0E-389 -> -Infinity
-lnx758 ln 1.000001E-383 -> -881.8901 Inexact Rounded
-lnx759 ln 9.99991E-384 -> -881.8901 Inexact Rounded
-lnx760 ln 4.4605E-385 -> -885.0000 Inexact Rounded
-lnx761 ln 2.221E-386 -> -887.9999 Inexact Rounded
-lnx762 ln 3.01E-387 -> -889.9985 Inexact Rounded
-lnx763 ln 1.7E-388 -> -892.8724 Inexact Rounded
-lnx764 ln 1.5E-388 -> -892.9976 Inexact Rounded
-lnx765 ln 9E-389 -> -893.5084 Inexact Rounded
-lnx766 ln 1E-389 -> -895.7056 Inexact Rounded
-lnx774 ln 0E-389 -> -Infinity
-
--- special values
-lnx820 ln Infinity -> Infinity
-lnx821 ln 0 -> -Infinity
-lnx822 ln NaN -> NaN
-lnx823 ln sNaN -> NaN Invalid_operation
--- propagating NaNs
-lnx824 ln sNaN123 -> NaN123 Invalid_operation
-lnx825 ln -sNaN321 -> -NaN321 Invalid_operation
-lnx826 ln NaN456 -> NaN456
-lnx827 ln -NaN654 -> -NaN654
-lnx828 ln NaN1 -> NaN1
-
--- Invalid operations due to restrictions
--- [next two probably skipped by most test harnesses]
-precision: 100000000
-lnx901 ln 1 -> NaN Invalid_context
-precision: 99999999
-lnx902 ln 0 -> NaN Invalid_context
-
-precision: 9
-maxExponent: 1000000
-minExponent: -999999
-lnx903 ln 1 -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999999
-lnx904 ln 0 -> -Infinity
-maxExponent: 999999
-minExponent: -1000000
-lnx905 ln 1 -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999998
-lnx906 ln 0 -> -Infinity
-
--- payload decapitate
-precision: 5
-lnx910 ln -sNaN1234567890 -> -NaN67890 Invalid_operation
-
--- Null test
-lnx900 ln # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- ln.decTest -- decimal natural logarithm --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 16
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- basics (examples in specification)
+precision: 9
+lnxs001 ln 0 -> -Infinity
+lnxs002 ln 1.000 -> 0
+lnxs003 ln 2.71828183 -> 1.00000000 Inexact Rounded
+lnxs004 ln 10 -> 2.30258509 Inexact Rounded
+lnxs005 ln +Infinity -> Infinity
+
+
+-- basics
+precision: 16
+lnx0001 ln 0 -> -Infinity
+lnx0002 ln 1E-9 -> -20.72326583694641 Inexact Rounded
+lnx0003 ln 0.0007 -> -7.264430222920869 Inexact Rounded
+lnx0004 ln 0.1 -> -2.302585092994046 Inexact Rounded
+lnx0005 ln 0.7 -> -0.3566749439387324 Inexact Rounded
+lnx0006 ln 1 -> 0
+lnx0007 ln 1.000 -> 0
+lnx0008 ln 1.5 -> 0.4054651081081644 Inexact Rounded
+lnx0009 ln 2 -> 0.6931471805599453 Inexact Rounded
+lnx0010 ln 2.718281828459045 -> 0.9999999999999999 Inexact Rounded
+lnx0011 ln 2.718281828459046 -> 1.000000000000000 Inexact Rounded
+lnx0012 ln 2.718281828459047 -> 1.000000000000001 Inexact Rounded
+lnx0013 ln 10 -> 2.302585092994046 Inexact Rounded
+lnx0014 ln 10.5 -> 2.351375257163478 Inexact Rounded
+lnx0015 ln 9999 -> 9.210240366975849 Inexact Rounded
+lnx0016 ln 1E6 -> 13.81551055796427 Inexact Rounded
+lnx0017 ln 1E+9 -> 20.72326583694641 Inexact Rounded
+lnx0018 ln +Infinity -> Infinity
+
+-- notable cases
+-- negatives
+lnx0021 ln -1E-9 -> NaN Invalid_operation
+lnx0022 ln -0.0007 -> NaN Invalid_operation
+lnx0023 ln -0.1 -> NaN Invalid_operation
+lnx0024 ln -0.7 -> NaN Invalid_operation
+lnx0025 ln -1 -> NaN Invalid_operation
+lnx0026 ln -1.5 -> NaN Invalid_operation
+lnx0027 ln -2 -> NaN Invalid_operation
+lnx0029 ln -10.5 -> NaN Invalid_operation
+lnx0028 ln -9999 -> NaN Invalid_operation
+lnx0030 ln -2.718281828459045 -> NaN Invalid_operation
+lnx0031 ln -2.718281828459046 -> NaN Invalid_operation
+lnx0032 ln -0 -> -Infinity
+lnx0033 ln -0E+17 -> -Infinity
+lnx0034 ln -0E-17 -> -Infinity
+-- other zeros
+lnx0041 ln 0 -> -Infinity
+lnx0042 ln 0E+17 -> -Infinity
+lnx0043 ln 0E-17 -> -Infinity
+-- infinities
+lnx0045 ln -Infinity -> NaN Invalid_operation
+lnx0046 ln +Infinity -> Infinity
+-- ones
+lnx0050 ln 1 -> 0
+lnx0051 ln 1.0 -> 0
+lnx0052 ln 1.000000000000000 -> 0
+lnx0053 ln 1.000000000000000000 -> 0
+
+-- lower precision basics
+Precision: 7
+lnx0101 ln 0 -> -Infinity
+lnx0102 ln 1E-9 -> -20.72327 Inexact Rounded
+lnx0103 ln 0.0007 -> -7.264430 Inexact Rounded
+lnx0104 ln 0.1 -> -2.302585 Inexact Rounded
+lnx0105 ln 0.7 -> -0.3566749 Inexact Rounded
+lnx0106 ln 1 -> 0
+lnx0107 ln 1.5 -> 0.4054651 Inexact Rounded
+lnx0108 ln 2 -> 0.6931472 Inexact Rounded
+lnx0109 ln 2.718281828459045 -> 1.000000 Inexact Rounded
+lnx0110 ln 2.718281828459046 -> 1.000000 Inexact Rounded
+lnx0111 ln 2.718281828459047 -> 1.000000 Inexact Rounded
+lnx0112 ln 10 -> 2.302585 Inexact Rounded
+lnx0113 ln 10.5 -> 2.351375 Inexact Rounded
+lnx0114 ln 9999 -> 9.210240 Inexact Rounded
+lnx0115 ln 1E6 -> 13.81551 Inexact Rounded
+lnx0116 ln 1E+9 -> 20.72327 Inexact Rounded
+lnx0117 ln +Infinity -> Infinity
+Precision: 2
+lnx0121 ln 0 -> -Infinity
+lnx0122 ln 1E-9 -> -21 Inexact Rounded
+lnx0123 ln 0.0007 -> -7.3 Inexact Rounded
+lnx0124 ln 0.1 -> -2.3 Inexact Rounded
+lnx0125 ln 0.7 -> -0.36 Inexact Rounded
+lnx0126 ln 1 -> 0
+lnx0127 ln 1.5 -> 0.41 Inexact Rounded
+lnx0128 ln 2 -> 0.69 Inexact Rounded
+lnx0129 ln 2.718281828459045 -> 1.0 Inexact Rounded
+lnx0130 ln 2.718281828459046 -> 1.0 Inexact Rounded
+lnx0131 ln 2.718281828459047 -> 1.0 Inexact Rounded
+lnx0132 ln 10 -> 2.3 Inexact Rounded
+lnx0133 ln 10.5 -> 2.4 Inexact Rounded
+lnx0134 ln 9999 -> 9.2 Inexact Rounded
+lnx0135 ln 1E6 -> 14 Inexact Rounded
+lnx0136 ln 1E+9 -> 21 Inexact Rounded
+lnx0137 ln +Infinity -> Infinity
+Precision: 1
+lnx0141 ln 0 -> -Infinity
+lnx0142 ln 1E-9 -> -2E+1 Inexact Rounded
+lnx0143 ln 0.0007 -> -7 Inexact Rounded
+lnx0144 ln 0.1 -> -2 Inexact Rounded
+lnx0145 ln 0.7 -> -0.4 Inexact Rounded
+lnx0146 ln 1 -> 0
+lnx0147 ln 1.5 -> 0.4 Inexact Rounded
+lnx0148 ln 2 -> 0.7 Inexact Rounded
+lnx0149 ln 2.718281828459045 -> 1 Inexact Rounded
+lnx0150 ln 2.718281828459046 -> 1 Inexact Rounded
+lnx0151 ln 2.718281828459047 -> 1 Inexact Rounded
+lnx0152 ln 10 -> 2 Inexact Rounded
+lnx0153 ln 10.5 -> 2 Inexact Rounded
+lnx0154 ln 9999 -> 9 Inexact Rounded
+lnx0155 ln 1E6 -> 1E+1 Inexact Rounded
+lnx0156 ln 1E+9 -> 2E+1 Inexact Rounded
+lnx0157 ln +Infinity -> Infinity
+
+-- group low-precision ln(1)s:
+precision: 1
+lnx0161 ln 1 -> 0
+precision: 2
+lnx0162 ln 1 -> 0
+precision: 3
+lnx0163 ln 1 -> 0
+precision: 4
+lnx0164 ln 1 -> 0
+precision: 5
+lnx0165 ln 1 -> 0
+precision: 6
+lnx0166 ln 1 -> 0
+precision: 7
+lnx0167 ln 1 -> 0
+precision: 8
+lnx0168 ln 1 -> 0
+
+-- edge-test ln(2) and ln(10) in case of lookasides
+precision: 45
+lnx201 ln 2 -> 0.693147180559945309417232121458176568075500134 Inexact Rounded
+lnx202 ln 10 -> 2.30258509299404568401799145468436420760110149 Inexact Rounded
+precision: 44
+lnx203 ln 2 -> 0.69314718055994530941723212145817656807550013 Inexact Rounded
+lnx204 ln 10 -> 2.3025850929940456840179914546843642076011015 Inexact Rounded
+precision: 43
+lnx205 ln 2 -> 0.6931471805599453094172321214581765680755001 Inexact Rounded
+lnx206 ln 10 -> 2.302585092994045684017991454684364207601101 Inexact Rounded
+precision: 42
+lnx207 ln 2 -> 0.693147180559945309417232121458176568075500 Inexact Rounded
+lnx208 ln 10 -> 2.30258509299404568401799145468436420760110 Inexact Rounded
+precision: 41
+lnx209 ln 2 -> 0.69314718055994530941723212145817656807550 Inexact Rounded
+lnx210 ln 10 -> 2.3025850929940456840179914546843642076011 Inexact Rounded
+precision: 40
+lnx211 ln 2 -> 0.6931471805599453094172321214581765680755 Inexact Rounded
+lnx212 ln 10 -> 2.302585092994045684017991454684364207601 Inexact Rounded
+precision: 39
+lnx213 ln 2 -> 0.693147180559945309417232121458176568076 Inexact Rounded
+lnx214 ln 10 -> 2.30258509299404568401799145468436420760 Inexact Rounded
+precision: 38
+lnx215 ln 2 -> 0.69314718055994530941723212145817656808 Inexact Rounded
+lnx216 ln 10 -> 2.3025850929940456840179914546843642076 Inexact Rounded
+precision: 37
+lnx217 ln 2 -> 0.6931471805599453094172321214581765681 Inexact Rounded
+lnx218 ln 10 -> 2.302585092994045684017991454684364208 Inexact Rounded
+precision: 36
+lnx219 ln 2 -> 0.693147180559945309417232121458176568 Inexact Rounded
+lnx220 ln 10 -> 2.30258509299404568401799145468436421 Inexact Rounded
+precision: 35
+lnx221 ln 2 -> 0.69314718055994530941723212145817657 Inexact Rounded
+lnx222 ln 10 -> 2.3025850929940456840179914546843642 Inexact Rounded
+precision: 34
+lnx223 ln 2 -> 0.6931471805599453094172321214581766 Inexact Rounded
+lnx224 ln 10 -> 2.302585092994045684017991454684364 Inexact Rounded
+precision: 33
+lnx225 ln 2 -> 0.693147180559945309417232121458177 Inexact Rounded
+lnx226 ln 10 -> 2.30258509299404568401799145468436 Inexact Rounded
+precision: 32
+lnx227 ln 2 -> 0.69314718055994530941723212145818 Inexact Rounded
+lnx228 ln 10 -> 2.3025850929940456840179914546844 Inexact Rounded
+precision: 31
+lnx229 ln 2 -> 0.6931471805599453094172321214582 Inexact Rounded
+lnx230 ln 10 -> 2.302585092994045684017991454684 Inexact Rounded
+precision: 30
+lnx231 ln 2 -> 0.693147180559945309417232121458 Inexact Rounded
+lnx232 ln 10 -> 2.30258509299404568401799145468 Inexact Rounded
+
+-- extreme input range values
+maxExponent: 384
+minExponent: -383
+Precision: 16
+
+lnx0901 ln 1e-400 -> -921.0340371976183 Inexact Rounded
+lnx0902 ln 1e+400 -> 921.0340371976183 Inexact Rounded
+lnx0903 ln 1e-999999 -> -2302582.790408953 Inexact Rounded
+lnx0904 ln 1e+999999 -> 2302582.790408953 Inexact Rounded
+lnx0905 ln 1e-1000013 -> -2302615.026600255 Inexact Rounded
+lnx0906 ln 2e-1000013 -> -2302614.333453074 Inexact Rounded
+
+lnx0910 ln 9.999999e+999999 -> 2302585.092993946 Inexact Rounded
+lnx0911 ln 9.9999999e+999999 -> 2302585.092994036 Inexact Rounded
+lnx0912 ln 9.99999999e+999999 -> 2302585.092994045 Inexact Rounded
+lnx0913 ln 9.999999999e+999999 -> 2302585.092994046 Inexact Rounded
+lnx0914 ln 9.999999999999e+999999 -> 2302585.092994046 Inexact Rounded
+lnx0915 ln 9.999999999999999e+999999 -> 2302585.092994046 Inexact Rounded
+lnx0916 ln 9.999999999999999999999999e+999999 -> 2302585.092994046 Inexact Rounded
+
+-- randoms
+-- P=50, within 0-999
+Precision: 50
+maxExponent: 384
+minExponent: -383
+lnx1501 ln 0.00098800906574486388604608477869812518857023768951 -> -6.9198186844033787995945147836955586009548513043689 Inexact Rounded
+lnx1502 ln 158.15866624664623070184595045304145949900714987827 -> 5.0635987458895647454907806507503825602758392287684 Inexact Rounded
+lnx1503 ln 0.00565661412059571925040285814021799775249288309321 -> -5.1749297776760632102047540300491550931651318975237 Inexact Rounded
+lnx1504 ln 0.00000006914232532620489602008402091666547903180607 -> -16.487098770877825308138976818688771638172333034347 Inexact Rounded
+lnx1505 ln 0.00025380374621297657504661540749355251231770070723 -> -8.2789492423005003205242162741569033124260321954589 Inexact Rounded
+lnx1506 ln 83.033654063877426261108592599182418953442677554806 -> 4.4192459962647137976949249810815698465031609843669 Inexact Rounded
+lnx1507 ln 0.00000000416863228092481651627734668440663678118729 -> -19.295677845122141772791294599714950175284915666430 Inexact Rounded
+lnx1508 ln 0.00000140847873187820570181214271960511080523457669 -> -13.473000349581967189668305314384952251556809480339 Inexact Rounded
+lnx1509 ln 66.176106555181527101630351127583944689752069132522 -> 4.1923194696232505883666171116966137694013431504252 Inexact Rounded
+lnx1510 ln 0.00000000000009899043487403590900111602024562297908 -> -29.943753166877840985821508112917991506656545174163 Inexact Rounded
+lnx1511 ln 0.00000000000324618296721747097510453388683912733569 -> -26.453541281444586819009546418577507163362590139422 Inexact Rounded
+lnx1512 ln 72.646968818463546449499147579023555008392860423385 -> 4.2856116660689646882852128853423566276718230426479 Inexact Rounded
+lnx1513 ln 0.00000000000000066755483124635612574263153825990523 -> -34.942910142802769319262875080398852491588707172483 Inexact Rounded
+lnx1514 ln 61.002910447202398204114909451851111424657671911002 -> 4.1109215752843377323363182051446177066434038096529 Inexact Rounded
+lnx1515 ln 917.06917611331980999227893584010544542312239174774 -> 6.8211829068303114128752453661946446979787826282907 Inexact Rounded
+lnx1516 ln 0.00000000170823794883673083358549749078972003965194 -> -20.187803436976150477297246666771626827057191023004 Inexact Rounded
+lnx1517 ln 0.53731767845358224445809761315159249898566542910649 -> -0.62116577939968409211736413628236285160048357000961 Inexact Rounded
+lnx1518 ln 0.00000000000000008965291392882804161299758708033373 -> -36.950585970980857376081265073276303670820056916206 Inexact Rounded
+lnx1519 ln 0.00000000006990244916026429904498278982530170295668 -> -23.383920429244457578373523508427783144589480420753 Inexact Rounded
+lnx1520 ln 4.0312542977070300070506064666536478373801988540614 -> 1.3940775676592451945795752796421391871302024763305 Inexact Rounded
+lnx1521 ln 271.84991311551875601432518819562391699324632396423 -> 5.6052501239873862517916679747146539808077431873478 Inexact Rounded
+lnx1522 ln 7.4118671629373864667229445746862314443895404818689 -> 2.0030823863706344628239147639318289961917060121141 Inexact Rounded
+lnx1523 ln 0.00000000000002026311452625364905357321664186034258 -> -31.529974180054438792043856877314043794320951134754 Inexact Rounded
+lnx1524 ln 0.00000000000009563398651261756952398250624737809347 -> -29.978248130576972953141284136962670021368834792579 Inexact Rounded
+lnx1525 ln 0.00000000009556772669409858653026558223465197808991 -> -23.071185939748285541228206161472956661196956741186 Inexact Rounded
+lnx1526 ln 6.8441648298027301292342057248737326152250794026761 -> 1.9233964395801946597272589473417948024361005082908 Inexact Rounded
+lnx1527 ln 0.00000000000073059699884439979394945822035704264577 -> -27.944914388353724718836101828677771967128509603158 Inexact Rounded
+lnx1528 ln 0.00000000000000002610078280419082263138064745416787 -> -38.184566367516207885573773320135965798717120735115 Inexact Rounded
+lnx1529 ln 0.00000000000000000150259517166294243088546806083283 -> -41.039337946266676108538170837580051699618334928421 Inexact Rounded
+lnx1530 ln 0.00000000000000087919160541714580707181969708502091 -> -34.667528818827671507514319744047440696187358676848 Inexact Rounded
+lnx1531 ln 0.00000000000395726725120787763271849577708068584598 -> -26.255467416961357741818735787226671938678424748431 Inexact Rounded
+lnx1532 ln 0.00000000002014334901669366218018377213150715938355 -> -24.628146955635359035289123027319969201693737159108 Inexact Rounded
+lnx1533 ln 0.00000008097927101101093117753938766241442896030637 -> -16.329072628469715178637178365710373398203190937454 Inexact Rounded
+lnx1534 ln 0.00000000000017115834162632864392039668116243984176 -> -29.396187292434898225453626794459285157263177528034 Inexact Rounded
+lnx1535 ln 0.39168317593866334087305459933723864294857086105035 -> -0.93730199062757240485836637306785037368746737693029 Inexact Rounded
+lnx1536 ln 79.335036798971515026519630103325369729637514127617 -> 4.3736798570287828823772149735170431010616961976965 Inexact Rounded
+lnx1537 ln 0.00000000000000056004952129926137413602116591493625 -> -35.118506463181870020730685884333000241039028127213 Inexact Rounded
+lnx1538 ln 0.00000006006035907843890918832481099660639553666078 -> -16.627915795747112566532705974853114454405010472043 Inexact Rounded
+lnx1539 ln 0.00000000085242024937414906371333826574632450587590 -> -20.882941460268101080186482230657774997273494107221 Inexact Rounded
+lnx1540 ln 0.00000000000043671099499262350316173246550771951561 -> -28.459504757285639221776305968469058854558726593945 Inexact Rounded
+
+-- P=34, within 0-999
+Precision: 34
+lnx1201 ln 0.0086732880815927182997566810334394 -> -4.747507311920844752486938187973721 Inexact Rounded
+lnx1202 ln 0.0007104103693460260609792222569854 -> -7.249667769903503023005549250347695 Inexact Rounded
+lnx1203 ln 786.8398945385105190697541493392742 -> 6.668024790031836340471824147010546 Inexact Rounded
+lnx1204 ln 0.7723073620282687656895190171967399 -> -0.2583726708506850868786816238217326 Inexact Rounded
+lnx1205 ln 0.0061057951517197631287183938412200 -> -5.098516933918797347064454103742635 Inexact Rounded
+lnx1206 ln 0.6181379708184393730103917562498745 -> -0.4810435926903365087463387760350021 Inexact Rounded
+lnx1207 ln 09.13888261229039989110753389096760 -> 2.212538125507975574509563027696021 Inexact Rounded
+lnx1208 ln 802.0105417063143696497292158147174 -> 6.687121752052341737234832203350214 Inexact Rounded
+lnx1209 ln 778.7749710387773713523028497333058 -> 6.657722135126935472086625031413031 Inexact Rounded
+lnx1210 ln 0.0024457295895346502513567679390616 -> -6.013411799940245345321348290398517 Inexact Rounded
+lnx1211 ln 0.0000511296947872828310338864217860 -> -9.881145118237281798081573131711636 Inexact Rounded
+lnx1212 ln 0.0000246803508602554924938685155658 -> -10.60950314264825661825360971430218 Inexact Rounded
+lnx1213 ln 9.027898199253511668242977766616082 -> 2.200319582778899029786017830557293 Inexact Rounded
+lnx1214 ln 0.0991812396542505631850692800904188 -> -2.310806398964672258823043180400384 Inexact Rounded
+lnx1215 ln 0.0000000000070238810143028811223924 -> -25.68170519961636647174714538290075 Inexact Rounded
+lnx1216 ln 2.630101665342826494730394729313167 -> 0.9670225014664367465128243039749559 Inexact Rounded
+lnx1217 ln 0.0056878928594359587691526063254683 -> -5.169415422904037819736637399445096 Inexact Rounded
+lnx1218 ln 567.3436047121057843908106573095590 -> 6.340965124964258486463444360787970 Inexact Rounded
+lnx1219 ln 1.199291248124655996614605745649725 -> 0.1817307557425911805765087755675657 Inexact Rounded
+lnx1220 ln 25.02050448582031098696267479135557 -> 3.219695668137659139544178905459317 Inexact Rounded
+lnx1221 ln 0.0000000000009939597023558756961300 -> -27.63707972996537636504396558259058 Inexact Rounded
+lnx1222 ln 0.0000007988551670159429716506430403 -> -14.04008617542597230988198612376415 Inexact Rounded
+lnx1223 ln 4.681515800176129184873770605589795 -> 1.543621946415383338972124445445748 Inexact Rounded
+lnx1224 ln 15.95126669161103011206658749345781 -> 2.769538242479483539275986395443539 Inexact Rounded
+lnx1225 ln 0.0301626783922211213675457279076066 -> -3.501149933677283341023932281826341 Inexact Rounded
+lnx1226 ln 000.0040544064881821770528475185674 -> -5.507950967557021671647165889608324 Inexact Rounded
+lnx1227 ln 29.01617095935593792095913785100360 -> 3.367853293862745651888450004473297 Inexact Rounded
+lnx1228 ln 78.01836167344736733024804243195323 -> 4.356944205055768575987781375003992 Inexact Rounded
+lnx1229 ln 0.0000000096545319316965321158634893 -> -18.45583840160965814462095477365013 Inexact Rounded
+lnx1230 ln 97.95475237720579752770587185074428 -> 4.584505661612812742208619358214729 Inexact Rounded
+lnx1231 ln 528.0609262050423246402564228432371 -> 6.269211667589138113396583894315956 Inexact Rounded
+lnx1232 ln 0.0000002250064349732969696660452972 -> -15.30713683526963996712167701738724 Inexact Rounded
+lnx1233 ln 47.97063637767998658567199049725754 -> 3.870589081585660692195989854842372 Inexact Rounded
+lnx1234 ln 0.0005394311344541432318853513414361 -> -7.524995428393925934087126702974121 Inexact Rounded
+lnx1235 ln 0.0000000090973385649567471674972633 -> -18.51528393158931783447035004125791 Inexact Rounded
+lnx1236 ln 0.0000000000238776490227576197317977 -> -24.45807828188389561331158879207262 Inexact Rounded
+lnx1237 ln 0.0000236587000231921532145326218758 -> -10.65177964499823314952429277979034 Inexact Rounded
+lnx1238 ln 499.1277448846130709827154556125942 -> 6.212862064761427967461188083514774 Inexact Rounded
+lnx1239 ln 0.0000003960192300284787663712417647 -> -14.74180306619298548093697608293284 Inexact Rounded
+lnx1240 ln 41.08268350829477451667228892495136 -> 3.715586706887278039173584859218960 Inexact Rounded
+
+-- P=16, within 0-99
+Precision: 16
+lnx1101 ln 7.964875261033948 -> 2.075041282352241 Inexact Rounded
+lnx1102 ln 13.54527396845394 -> 2.606037701870263 Inexact Rounded
+lnx1103 ln 0.0008026554341331 -> -7.127585034321814 Inexact Rounded
+lnx1104 ln 0.0000030582233261 -> -12.69767642300625 Inexact Rounded
+lnx1105 ln 0.0004477497509672 -> -7.711276073210766 Inexact Rounded
+lnx1106 ln 7.616268622474371 -> 2.030286567675148 Inexact Rounded
+lnx1107 ln 51.58329925806381 -> 3.943197962309569 Inexact Rounded
+lnx1108 ln 0.0018197497951263 -> -6.309056262549345 Inexact Rounded
+lnx1109 ln 2.956282457072984 -> 1.083932552334575 Inexact Rounded
+lnx1110 ln 0.3843325579189906 -> -0.9562470649400558 Inexact Rounded
+lnx1111 ln 0.0074466329265663 -> -4.899993304919237 Inexact Rounded
+lnx1112 ln 0.0003372478532993 -> -7.994692428206378 Inexact Rounded
+lnx1113 ln 0.0084792263167809 -> -4.770136069569271 Inexact Rounded
+lnx1114 ln 5.926756998151102 -> 1.779477182834305 Inexact Rounded
+lnx1115 ln 9.025699152180897 -> 2.200075969604119 Inexact Rounded
+lnx1116 ln 1.910124643533526 -> 0.6471684983238183 Inexact Rounded
+lnx1117 ln 0.8158922711411020 -> -0.2034729533939387 Inexact Rounded
+lnx1118 ln 0.0067080016475322 -> -5.004454189414139 Inexact Rounded
+lnx1119 ln 0.0047583242092716 -> -5.347859729601094 Inexact Rounded
+lnx1120 ln 0.0386647411641339 -> -3.252827175263113 Inexact Rounded
+lnx1121 ln 0.0050226427841761 -> -5.293799032774131 Inexact Rounded
+lnx1122 ln 6.927937541637261 -> 1.935562155866906 Inexact Rounded
+lnx1123 ln 0.0000095745343513 -> -11.55640365579814 Inexact Rounded
+lnx1124 ln 1.602465492956538 -> 0.4715433763243936 Inexact Rounded
+lnx1125 ln 38.98415625087535 -> 3.663155313610213 Inexact Rounded
+lnx1126 ln 5.343182042276734 -> 1.675821363568112 Inexact Rounded
+lnx1127 ln 55.89763703245816 -> 4.023522107934110 Inexact Rounded
+lnx1128 ln 0.7445257810280847 -> -0.2950077988101030 Inexact Rounded
+lnx1129 ln 1.631407314946094 -> 0.4894430257201248 Inexact Rounded
+lnx1130 ln 0.0005462451932602 -> -7.512442611116852 Inexact Rounded
+lnx1131 ln 0.0000864173269362 -> -9.356322359017317 Inexact Rounded
+lnx1132 ln 5.227161719132849 -> 1.653868438439637 Inexact Rounded
+lnx1133 ln 60.57078466941998 -> 4.103812675662452 Inexact Rounded
+lnx1134 ln 0.0992864325333160 -> -2.309746348350318 Inexact Rounded
+lnx1135 ln 09.48564268447325 -> 2.249779359074983 Inexact Rounded
+lnx1136 ln 0.0036106089355634 -> -5.623878840650787 Inexact Rounded
+lnx1137 ln 1.805176865587172 -> 0.5906585734593707 Inexact Rounded
+lnx1138 ln 62.59363259642255 -> 4.136663557220559 Inexact Rounded
+lnx1139 ln 4.373828261137201 -> 1.475638657912000 Inexact Rounded
+lnx1140 ln 0.994483524148738 -> -0.005531747794938690 Inexact Rounded
+
+-- P=7, within 0-9
+Precision: 7
+lnx1001 ln 0.0912025 -> -2.394673 Inexact Rounded
+lnx1002 ln 0.9728626 -> -0.02751242 Inexact Rounded
+lnx1003 ln 0.3886032 -> -0.9451965 Inexact Rounded
+lnx1004 ln 8.798639 -> 2.174597 Inexact Rounded
+lnx1005 ln 2.459121 -> 0.8998040 Inexact Rounded
+lnx1006 ln 2.013193 -> 0.6997220 Inexact Rounded
+lnx1007 ln 9.064857 -> 2.204405 Inexact Rounded
+lnx1008 ln 5.796417 -> 1.757240 Inexact Rounded
+lnx1009 ln 0.1143471 -> -2.168517 Inexact Rounded
+lnx1010 ln 0.5341542 -> -0.6270707 Inexact Rounded
+lnx1011 ln 6.693781 -> 1.901179 Inexact Rounded
+lnx1012 ln 0.0081779 -> -4.806320 Inexact Rounded
+lnx1013 ln 8.313616 -> 2.117895 Inexact Rounded
+lnx1014 ln 3.486925 -> 1.249020 Inexact Rounded
+lnx1015 ln 0.1801401 -> -1.714020 Inexact Rounded
+lnx1016 ln 0.5227148 -> -0.6487193 Inexact Rounded
+lnx1017 ln 7.818111 -> 2.056443 Inexact Rounded
+lnx1018 ln 0.0870671 -> -2.441076 Inexact Rounded
+lnx1019 ln 8.153966 -> 2.098504 Inexact Rounded
+lnx1020 ln 2.040975 -> 0.7134276 Inexact Rounded
+lnx1021 ln 1.481642 -> 0.3931509 Inexact Rounded
+lnx1022 ln 0.2610123 -> -1.343188 Inexact Rounded
+lnx1023 ln 0.466723 -> -0.7620193 Inexact Rounded
+lnx1024 ln 0.0518756 -> -2.958907 Inexact Rounded
+lnx1025 ln 2.056410 -> 0.7209617 Inexact Rounded
+lnx1026 ln 0.181522 -> -1.706378 Inexact Rounded
+lnx1027 ln 0.515551 -> -0.6625190 Inexact Rounded
+lnx1028 ln 8.425089 -> 2.131214 Inexact Rounded
+lnx1029 ln 2.077091 -> 0.7309684 Inexact Rounded
+lnx1030 ln 6.212705 -> 1.826596 Inexact Rounded
+lnx1031 ln 5.729343 -> 1.745601 Inexact Rounded
+lnx1032 ln 4.831251 -> 1.575105 Inexact Rounded
+lnx1033 ln 2.029760 -> 0.7079176 Inexact Rounded
+lnx1034 ln 8.615060 -> 2.153512 Inexact Rounded
+lnx1035 ln 0.0611511 -> -2.794407 Inexact Rounded
+lnx1036 ln 5.195269 -> 1.647748 Inexact Rounded
+lnx1037 ln 9.617686 -> 2.263604 Inexact Rounded
+lnx1038 ln 0.0049382 -> -5.310754 Inexact Rounded
+lnx1039 ln 2.786840 -> 1.024908 Inexact Rounded
+lnx1040 ln 0.0091073 -> -4.698679 Inexact Rounded
+
+-- from here 3-digit tests are based on reverse exp tests
+precision: 9
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+lnx001 ln 0 -> -Infinity
+lnx002 ln 0.367879441 -> -1.00000000 Inexact Rounded
+lnx003 ln 1 -> 0
+lnx005 ln 2.71828183 -> 1.00000000 Inexact Rounded
+lnx006 ln 2.00000000 -> 0.693147181 Inexact Rounded
+lnx007 ln +Infinity -> Infinity
+
+-- tiny edge cases
+precision: 7
+lnx011 ln 1.105171 -> 0.1000001 Inexact Rounded
+lnx012 ln 1.010050 -> 0.009999835 Inexact Rounded
+lnx013 ln 1.000010 -> 0.000009999950 Inexact Rounded
+lnx014 ln 1.000001 -> 9.999995E-7 Inexact Rounded
+lnx015 ln 1.000000 -> 0
+
+-- basic e=0, e=1, e=2, e=4, e>=8 cases
+precision: 7
+lnx041 ln 2.718282 -> 1.000000 Inexact Rounded
+lnx042 ln 0.3678794 -> -1.000000 Inexact Rounded
+lnx043 ln 22026.47 -> 10.00000 Inexact Rounded
+lnx044 ln 0.00004539993 -> -10.00000 Inexact Rounded
+lnx045 ln 2.688117E+43 -> 100.0000 Inexact Rounded
+lnx046 ln 3.720076E-44 -> -100.0000 Inexact Rounded
+lnx047 ln Infinity -> Infinity
+lnx048 ln 0E-389 -> -Infinity
+
+-- miscellanea
+precision: 16
+lnx055 ln 2.717658486884572E-236 -> -542.4103112874415 Inexact Rounded
+precision: 17
+lnx056 ln 2.7176584868845721E-236 -> -542.41031128744146 Inexact Rounded
+precision: 18
+lnx057 ln 2.71765848688457211E-236 -> -542.410311287441459 Inexact Rounded
+precision: 19
+lnx058 ln 2.717658486884572112E-236 -> -542.4103112874414592 Inexact Rounded
+precision: 20
+lnx059 ln 2.7176584868845721118E-236 -> -542.41031128744145917 Inexact Rounded
+
+-- inputs ending in ..500.., ..499.., ..100.., ..999.. sequences
+precision: 50
+lnx102 ln 0.9999999100000040499998785000027 -> -9.0000000000000000000000033749953829996446124861750E-8 Inexact Rounded
+precision: 30
+lnx103 ln 0.999999910000004049999878500003 -> -8.99999999999999999999997337499E-8 Inexact Rounded
+precision: 29
+lnx104 ln 0.99999991000000404999987850000 -> -9.0000000000000000000002733750E-8 Inexact Rounded
+precision: 28
+lnx105 ln 0.9999999100000040499998785000 -> -9.000000000000000000000273375E-8 Inexact Rounded
+precision: 27
+lnx106 ln 0.999999910000004049999878500 -> -9.00000000000000000000027338E-8 Inexact Rounded
+precision: 26
+lnx107 ln 0.99999991000000404999987850 -> -9.0000000000000000000002734E-8 Inexact Rounded
+precision: 25
+lnx108 ln 0.9999999100000040499998785 -> -9.000000000000000000000273E-8 Inexact Rounded
+precision: 24
+lnx109 ln 0.999999910000004049999879 -> -8.99999999999999995000027E-8 Inexact Rounded
+precision: 23
+lnx110 ln 0.99999991000000404999988 -> -8.9999999999999998500003E-8 Inexact Rounded
+precision: 22
+lnx111 ln 0.9999999100000040499999 -> -8.999999999999997850000E-8 Inexact Rounded
+precision: 21
+lnx112 ln 0.999999910000004050000 -> -8.99999999999998785000E-8 Inexact Rounded
+precision: 20
+lnx113 ln 0.99999991000000405000 -> -8.9999999999999878500E-8 Inexact Rounded
+precision: 19
+lnx114 ln 0.9999999100000040500 -> -8.999999999999987850E-8 Inexact Rounded
+precision: 18
+lnx115 ln 0.999999910000004050 -> -8.99999999999998785E-8 Inexact Rounded
+-- next may be a > 0.5ulp case; a more precise answer is:
+-- -8.99999999999998784999918E-8
+precision: 17
+lnx116 ln 0.99999991000000405 -> -8.9999999999999878E-8 Inexact Rounded
+precision: 16
+lnx117 ln 0.9999999100000040 -> -9.000000004999988E-8 Inexact Rounded
+precision: 15
+lnx118 ln 0.999999910000004 -> -9.00000000499999E-8 Inexact Rounded
+precision: 14
+lnx119 ln 0.99999991000000 -> -9.0000004050000E-8 Inexact Rounded
+precision: 13
+lnx120 ln 0.9999999100000 -> -9.000000405000E-8 Inexact Rounded
+precision: 12
+lnx121 ln 0.999999910000 -> -9.00000040500E-8 Inexact Rounded
+precision: 11
+lnx122 ln 0.99999991000 -> -9.0000004050E-8 Inexact Rounded
+precision: 10
+lnx123 ln 0.9999999100 -> -9.000000405E-8 Inexact Rounded
+precision: 9
+lnx124 ln 0.999999910 -> -9.00000041E-8 Inexact Rounded
+precision: 8
+lnx125 ln 0.99999991 -> -9.0000004E-8 Inexact Rounded
+precision: 7
+lnx126 ln 0.9999999 -> -1.000000E-7 Inexact Rounded
+precision: 16
+lnx126b ln 0.9999999 -> -1.000000050000003E-7 Inexact Rounded
+precision: 6
+lnx127 ln 0.999999 -> -0.00000100000 Inexact Rounded
+precision: 5
+lnx128 ln 0.99999 -> -0.000010000 Inexact Rounded
+precision: 4
+lnx129 ln 0.9999 -> -0.0001000 Inexact Rounded
+precision: 3
+lnx130 ln 0.999 -> -0.00100 Inexact Rounded
+precision: 2
+lnx131 ln 0.99 -> -0.010 Inexact Rounded
+precision: 1
+lnx132 ln 0.9 -> -0.1 Inexact Rounded
+
+
+-- cases near 1 -- 1 2345678901234567890
+precision: 20
+lnx401 ln 2.7182818284589365041 -> 0.99999999999996000000 Inexact Rounded
+lnx402 ln 2.7182818284589636869 -> 0.99999999999997000000 Inexact Rounded
+lnx403 ln 2.7182818284589908697 -> 0.99999999999997999999 Inexact Rounded
+lnx404 ln 2.7182818284590180525 -> 0.99999999999998999998 Inexact Rounded
+lnx405 ln 2.7182818284590452354 -> 1.0000000000000000000 Inexact Rounded
+lnx406 ln 2.7182818284593170635 -> 1.0000000000001000000 Inexact Rounded
+lnx407 ln 2.7182818284595888917 -> 1.0000000000002000000 Inexact Rounded
+precision: 14
+lnx411 ln 2.7182818284589 -> 0.99999999999995 Inexact Rounded
+lnx413 ln 2.7182818284590 -> 0.99999999999998 Inexact Rounded
+lnx416 ln 2.7182818284591 -> 1.0000000000000 Inexact Rounded
+lnx417 ln 2.7182818284592 -> 1.0000000000001 Inexact Rounded
+
+-- overflows, including some exp overprecise borderlines
+precision: 7
+maxExponent: 384
+minExponent: -383
+lnx709 ln 9.999999E+384 -> 886.4953 Inexact Rounded
+lnx711 ln 9.999992E+384 -> 886.4953 Inexact Rounded
+precision: 16
+lnx722 ln 9.999999999999999E+384 -> 886.4952608027076 Inexact Rounded
+lnx724 ln 9.999999999999917E+384 -> 886.4952608027076 Inexact Rounded
+lnx726 ln 9.999999999999117E+384 -> 886.4952608027075 Inexact Rounded
+-- and more...
+precision: 15
+maxExponent: 999
+minExponent: -999
+lnx731 ln 9.99999999999999E+999 -> 2302.58509299405 Inexact Rounded
+-- next may be a > 0.5ulp case; a more precise answer is:
+-- 2302.58509299404495001799145442
+lnx732 ln 9.99999999999266E+999 -> 2302.58509299404 Inexact Rounded
+lnx733 ln 9.99999999999265E+999 -> 2302.58509299404 Inexact Rounded
+lnx734 ln 9.99999999999264E+999 -> 2302.58509299404 Inexact Rounded
+
+-- subnormals and underflows for exp, including underflow-to-zero edge point
+precision: 7
+maxExponent: 384
+minExponent: -383
+lnx751 ln 0E-389 -> -Infinity
+lnx758 ln 1.000001E-383 -> -881.8901 Inexact Rounded
+lnx759 ln 9.99991E-384 -> -881.8901 Inexact Rounded
+lnx760 ln 4.4605E-385 -> -885.0000 Inexact Rounded
+lnx761 ln 2.221E-386 -> -887.9999 Inexact Rounded
+lnx762 ln 3.01E-387 -> -889.9985 Inexact Rounded
+lnx763 ln 1.7E-388 -> -892.8724 Inexact Rounded
+lnx764 ln 1.5E-388 -> -892.9976 Inexact Rounded
+lnx765 ln 9E-389 -> -893.5084 Inexact Rounded
+lnx766 ln 1E-389 -> -895.7056 Inexact Rounded
+lnx774 ln 0E-389 -> -Infinity
+
+-- special values
+lnx820 ln Infinity -> Infinity
+lnx821 ln 0 -> -Infinity
+lnx822 ln NaN -> NaN
+lnx823 ln sNaN -> NaN Invalid_operation
+-- propagating NaNs
+lnx824 ln sNaN123 -> NaN123 Invalid_operation
+lnx825 ln -sNaN321 -> -NaN321 Invalid_operation
+lnx826 ln NaN456 -> NaN456
+lnx827 ln -NaN654 -> -NaN654
+lnx828 ln NaN1 -> NaN1
+
+-- Invalid operations due to restrictions
+-- [next two probably skipped by most test harnesses]
+precision: 100000000
+lnx901 ln 1 -> NaN Invalid_context
+precision: 99999999
+lnx902 ln 0 -> NaN Invalid_context
+
+precision: 9
+maxExponent: 1000000
+minExponent: -999999
+lnx903 ln 1 -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999999
+lnx904 ln 0 -> -Infinity
+maxExponent: 999999
+minExponent: -1000000
+lnx905 ln 1 -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999998
+lnx906 ln 0 -> -Infinity
+
+-- payload decapitate
+precision: 5
+lnx910 ln -sNaN1234567890 -> -NaN67890 Invalid_operation
+
+-- Null test
+lnx900 ln # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/log10.decTest b/Lib/test/decimaltestdata/log10.decTest
index 5169eabde3..6502f0d091 100644
--- a/Lib/test/decimaltestdata/log10.decTest
+++ b/Lib/test/decimaltestdata/log10.decTest
@@ -1,551 +1,551 @@
-------------------------------------------------------------------------
--- log10.decTest -- decimal logarithm in base 10 --
--- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This emphasises the testing of notable cases, as they will often
--- have unusual paths (especially the 10**n results).
-
-extended: 1
-precision: 16
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- examples in specification
-precision: 9
-logxs000 log10 0 -> -Infinity
-logxs001 log10 0.001 -> -3
-logxs002 log10 1 -> 0
-logxs003 log10 2 -> 0.301029996 Inexact Rounded
-logxs004 log10 10 -> 1
-logxs005 log10 70 -> 1.84509804 Inexact Rounded
-logxs006 log10 +Infinity -> Infinity
-
-
--- basics (examples in specification, etc.)
-precision: 16
-logx0000 log10 0 -> -Infinity
-logx0001 log10 7E-1000 -> -999.1549019599857 Inexact Rounded
-logx0002 log10 1.1E-9 -> -8.958607314841775 Inexact Rounded
-logx0003 log10 0.0007 -> -3.154901959985743 Inexact Rounded
-logx0004 log10 0.11 -> -0.9586073148417750 Inexact Rounded
-logx0005 log10 0.7 -> -0.1549019599857432 Inexact Rounded
-logx0006 log10 1 -> 0
-logx0007 log10 1.5 -> 0.1760912590556812 Inexact Rounded
-logx0008 log10 2 -> 0.3010299956639812 Inexact Rounded
-logx0009 log10 2.718281828459045 -> 0.4342944819032518 Inexact Rounded
-logx0010 log10 2.718281828459046 -> 0.4342944819032519 Inexact Rounded
-logx0011 log10 2.718281828459047 -> 0.4342944819032521 Inexact Rounded
-logx0012 log10 7 -> 0.8450980400142568 Inexact Rounded
-logx0013 log10 10 -> 1
-logx0014 log10 10.5 -> 1.021189299069938 Inexact Rounded
-logx0015 log10 11 -> 1.041392685158225 Inexact Rounded
-logx0016 log10 70 -> 1.845098040014257 Inexact Rounded
-logx0017 log10 9999 -> 3.999956568380192 Inexact Rounded
-logx0018 log10 1.21E6 -> 6.082785370316450 Inexact Rounded
-logx0019 log10 1.1E+9 -> 9.041392685158225 Inexact Rounded
-logx0020 log10 7E+1000 -> 1000.845098040014 Inexact Rounded
-logx0021 log10 +Infinity -> Infinity
-
--- notable cases
--- negatives
-logx0031 log10 -1E-9 -> NaN Invalid_operation
-logx0032 log10 -0.0007 -> NaN Invalid_operation
-logx0033 log10 -0.1 -> NaN Invalid_operation
-logx0034 log10 -0.7 -> NaN Invalid_operation
-logx0035 log10 -1 -> NaN Invalid_operation
-logx0036 log10 -1.5 -> NaN Invalid_operation
-logx0037 log10 -2 -> NaN Invalid_operation
-logx0038 log10 -10.5 -> NaN Invalid_operation
-logx0039 log10 -10.5 -> NaN Invalid_operation
-logx0040 log10 -9999 -> NaN Invalid_operation
-logx0041 log10 -10 -> NaN Invalid_operation
-logx0042 log10 -0 -> -Infinity
-logx0043 log10 -0E+17 -> -Infinity
-logx0044 log10 -0E-17 -> -Infinity
--- other zeros
-logx0051 log10 0 -> -Infinity
-logx0052 log10 0E+17 -> -Infinity
-logx0053 log10 0E-17 -> -Infinity
--- infinities
-logx0055 log10 -Infinity -> NaN Invalid_operation
-logx0056 log10 +Infinity -> Infinity
--- ones
-logx0061 log10 1 -> 0
-logx0062 log10 1.0 -> 0
-logx0063 log10 1.000000000000000 -> 0
-logx0064 log10 1.000000000000000000 -> 0
-
--- notable cases -- exact powers of 10
-logx1100 log10 1 -> 0
-logx1101 log10 10 -> 1
-logx1102 log10 100 -> 2
-logx1103 log10 1000 -> 3
-logx1104 log10 10000 -> 4
-logx1105 log10 100000 -> 5
-logx1106 log10 1000000 -> 6
-logx1107 log10 10000000 -> 7
-logx1108 log10 100000000 -> 8
-logx1109 log10 1000000000 -> 9
-logx1110 log10 10000000000 -> 10
-logx1111 log10 100000000000 -> 11
-logx1112 log10 1000000000000 -> 12
-logx1113 log10 0.00000000001 -> -11
-logx1114 log10 0.0000000001 -> -10
-logx1115 log10 0.000000001 -> -9
-logx1116 log10 0.00000001 -> -8
-logx1117 log10 0.0000001 -> -7
-logx1118 log10 0.000001 -> -6
-logx1119 log10 0.00001 -> -5
-logx1120 log10 0.0001 -> -4
-logx1121 log10 0.001 -> -3
-logx1122 log10 0.01 -> -2
-logx1123 log10 0.1 -> -1
-logx1124 log10 1E-99 -> -99
-logx1125 log10 1E-100 -> -100
-logx1126 log10 1E-383 -> -383
-
--- check normally exact cases round properly
-precision: 1
-logx1141 log10 10000000000 -> 1E+1 Rounded
-logx1142 log10 1000000000000 -> 1E+1 Inexact Rounded
-logx1143 log10 1E+100 -> 1E+2 Rounded
-logx1144 log10 1E+123 -> 1E+2 Inexact Rounded
-logx1145 log10 1E+126 -> 1E+2 Inexact Rounded
-logx1146 log10 1E+916 -> 9E+2 Inexact Rounded
-logx1147 log10 1E+999 -> 1E+3 Inexact Rounded
-
-precision: 2
-logx1151 log10 10000000000 -> 10
-logx1152 log10 1000000000000 -> 12
-logx1153 log10 1E+100 -> 1.0E+2 Rounded
-logx1154 log10 1E+123 -> 1.2E+2 Inexact Rounded
-logx1155 log10 1E+126 -> 1.3E+2 Inexact Rounded
-logx1156 log10 1E+916 -> 9.2E+2 Inexact Rounded
-logx1157 log10 1E+999 -> 1.0E+3 Inexact Rounded
--- some half-way point rounds, other cases, and negatives
-logx1158 log10 1E+125 -> 1.2E+2 Inexact Rounded
-logx1159 log10 1E+135 -> 1.4E+2 Inexact Rounded
-logx1160 log10 1E+129 -> 1.3E+2 Inexact Rounded
-logx1161 log10 1E+131 -> 1.3E+2 Inexact Rounded
-logx1162 log10 1E-123 -> -1.2E+2 Inexact Rounded
-logx1163 log10 1E-126 -> -1.3E+2 Inexact Rounded
-logx1164 log10 1E-916 -> -9.2E+2 Inexact Rounded
-logx1165 log10 1E-999 -> -1.0E+3 Inexact Rounded
-logx1166 log10 1E-125 -> -1.2E+2 Inexact Rounded
-logx1167 log10 1E-135 -> -1.4E+2 Inexact Rounded
-logx1168 log10 1E-129 -> -1.3E+2 Inexact Rounded
-logx1169 log10 1E-131 -> -1.3E+2 Inexact Rounded
-
-precision: 3
-logx1171 log10 10000000000 -> 10
-logx1172 log10 1000000000000 -> 12
-logx1173 log10 1E+100 -> 100
-logx1174 log10 1E+123 -> 123
-logx1175 log10 1E+126 -> 126
-logx1176 log10 1E+916 -> 916
-logx1177 log10 1E+999 -> 999
-
--- log10(2) .. tests both ln(2) and ln(10) constants, too
-precision: 50
-logx1201 log10 2 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
-logx1202 log10 2.000 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
-logx1203 log10 0.2E1 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
-precision: 49
-logx1204 log10 2 -> 0.3010299956639811952137388947244930267681898814621 Inexact Rounded
-precision: 48
-logx1205 log10 2 -> 0.301029995663981195213738894724493026768189881462 Inexact Rounded
-precision: 47
-logx1206 log10 2 -> 0.30102999566398119521373889472449302676818988146 Inexact Rounded
-precision: 46
-logx1207 log10 2 -> 0.3010299956639811952137388947244930267681898815 Inexact Rounded
-precision: 45
-logx1208 log10 2 -> 0.301029995663981195213738894724493026768189881 Inexact Rounded
-precision: 44
-logx1209 log10 2 -> 0.30102999566398119521373889472449302676818988 Inexact Rounded
-precision: 43
-logx1210 log10 2 -> 0.3010299956639811952137388947244930267681899 Inexact Rounded
-precision: 42
-logx1211 log10 2 -> 0.301029995663981195213738894724493026768190 Inexact Rounded
-precision: 41
-logx1212 log10 2 -> 0.30102999566398119521373889472449302676819 Inexact Rounded
-precision: 40
-logx1213 log10 2 -> 0.3010299956639811952137388947244930267682 Inexact Rounded
-precision: 39
-logx1214 log10 2 -> 0.301029995663981195213738894724493026768 Inexact Rounded
-precision: 38
-logx1215 log10 2 -> 0.30102999566398119521373889472449302677 Inexact Rounded
-precision: 37
-logx1216 log10 2 -> 0.3010299956639811952137388947244930268 Inexact Rounded
-precision: 36
-logx1217 log10 2 -> 0.301029995663981195213738894724493027 Inexact Rounded
-precision: 35
-logx1218 log10 2 -> 0.30102999566398119521373889472449303 Inexact Rounded
-precision: 34
-logx1219 log10 2 -> 0.3010299956639811952137388947244930 Inexact Rounded
-precision: 33
-logx1220 log10 2 -> 0.301029995663981195213738894724493 Inexact Rounded
-precision: 32
-logx1221 log10 2 -> 0.30102999566398119521373889472449 Inexact Rounded
-precision: 31
-logx1222 log10 2 -> 0.3010299956639811952137388947245 Inexact Rounded
-precision: 30
-logx1223 log10 2 -> 0.301029995663981195213738894724 Inexact Rounded
-precision: 29
-logx1224 log10 2 -> 0.30102999566398119521373889472 Inexact Rounded
-precision: 28
-logx1225 log10 2 -> 0.3010299956639811952137388947 Inexact Rounded
-precision: 27
-logx1226 log10 2 -> 0.301029995663981195213738895 Inexact Rounded
-precision: 26
-logx1227 log10 2 -> 0.30102999566398119521373889 Inexact Rounded
-precision: 25
-logx1228 log10 2 -> 0.3010299956639811952137389 Inexact Rounded
-precision: 24
-logx1229 log10 2 -> 0.301029995663981195213739 Inexact Rounded
-precision: 23
-logx1230 log10 2 -> 0.30102999566398119521374 Inexact Rounded
-precision: 22
-logx1231 log10 2 -> 0.3010299956639811952137 Inexact Rounded
-precision: 21
-logx1232 log10 2 -> 0.301029995663981195214 Inexact Rounded
-precision: 20
-logx1233 log10 2 -> 0.30102999566398119521 Inexact Rounded
-precision: 19
-logx1234 log10 2 -> 0.3010299956639811952 Inexact Rounded
-precision: 18
-logx1235 log10 2 -> 0.301029995663981195 Inexact Rounded
-precision: 17
-logx1236 log10 2 -> 0.30102999566398120 Inexact Rounded
-precision: 16
-logx1237 log10 2 -> 0.3010299956639812 Inexact Rounded
-precision: 15
-logx1238 log10 2 -> 0.301029995663981 Inexact Rounded
-precision: 14
-logx1239 log10 2 -> 0.30102999566398 Inexact Rounded
-precision: 13
-logx1240 log10 2 -> 0.3010299956640 Inexact Rounded
-precision: 12
-logx1241 log10 2 -> 0.301029995664 Inexact Rounded
-precision: 11
-logx1242 log10 2 -> 0.30102999566 Inexact Rounded
-precision: 10
-logx1243 log10 2 -> 0.3010299957 Inexact Rounded
-precision: 9
-logx1244 log10 2 -> 0.301029996 Inexact Rounded
-precision: 8
-logx1245 log10 2 -> 0.30103000 Inexact Rounded
-precision: 7
-logx1246 log10 2 -> 0.3010300 Inexact Rounded
-precision: 6
-logx1247 log10 2 -> 0.301030 Inexact Rounded
-precision: 5
-logx1248 log10 2 -> 0.30103 Inexact Rounded
-precision: 4
-logx1249 log10 2 -> 0.3010 Inexact Rounded
-precision: 3
-logx1250 log10 2 -> 0.301 Inexact Rounded
-precision: 2
-logx1251 log10 2 -> 0.30 Inexact Rounded
-precision: 1
-logx1252 log10 2 -> 0.3 Inexact Rounded
-
-maxExponent: 384
-minExponent: -383
-precision: 16
-rounding: half_even
-
--- More close-to-e, etc., tests
-precision: 34
-logx1301 log10 2.718281828459045235360287471352661 -> 0.4342944819032518276511289189166048 Inexact Rounded
-logx1302 log10 2.718281828459045235360287471352662 -> 0.4342944819032518276511289189166050 Inexact Rounded
-logx1303 log10 2.718281828459045235360287471352663 -> 0.4342944819032518276511289189166052 Inexact Rounded
-logx1304 log10 0.99999999999999999999999999999999 -> -4.342944819032518276511289189166073E-33 Inexact Rounded
-logx1305 log10 0.999999999999999999999999999999999 -> -4.342944819032518276511289189166053E-34 Inexact Rounded
-logx1306 log10 0.9999999999999999999999999999999999 -> -4.342944819032518276511289189166051E-35 Inexact Rounded
-logx1307 log10 1.000000000000000000000000000000000 -> 0
-logx1308 log10 1.0000000000000000000000000000000001 -> 4.342944819032518276511289189166051E-35 Inexact Rounded
-logx1309 log10 1.000000000000000000000000000000001 -> 4.342944819032518276511289189166049E-34 Inexact Rounded
-logx1310 log10 1.00000000000000000000000000000001 -> 4.342944819032518276511289189166029E-33 Inexact Rounded
--- lower p
-precision: 7
-logx1320 log10 0.999999 -> -4.342947E-7 Inexact Rounded
-logx1321 log10 0.9999999 -> -4.342945E-8 Inexact Rounded
-logx1322 log10 0.99999999 -> -4.342945E-9 Inexact Rounded
-logx1323 log10 0.999999999 -> -4.342945E-10 Inexact Rounded
-logx1324 log10 1.00000000 -> 0
-logx1325 log10 1.00000001 -> 4.342945E-9 Inexact Rounded
-logx1326 log10 1.0000001 -> 4.342945E-8 Inexact Rounded
-logx1327 log10 1.000001 -> 4.342943E-7 Inexact Rounded
-
--- near 10^3
-precision: 9
-logx1331 log10 999.9999998 -> 3.00000000 Inexact Rounded
-logx1332 log10 999.9999999 -> 3.00000000 Inexact Rounded
-logx1333 log10 1000.000000 -> 3
-logx1334 log10 1000.000001 -> 3.00000000 Inexact Rounded
-logx1335 log10 1000.000002 -> 3.00000000 Inexact Rounded
-precision: 16
-logx1341 log10 999.9999998 -> 2.999999999913141 Inexact Rounded
-logx1342 log10 999.9999999 -> 2.999999999956571 Inexact Rounded
-logx1343 log10 1000.000000 -> 3
-logx1344 log10 1000.000001 -> 3.000000000434294 Inexact Rounded
-logx1345 log10 1000.000002 -> 3.000000000868589 Inexact Rounded
-
--- suggestions from Ilan Nehama
-logx1400 log10 10E-3 -> -2
-logx1401 log10 10E-2 -> -1
-logx1402 log10 100E-2 -> 0
-logx1403 log10 1000E-2 -> 1
-logx1404 log10 10000E-2 -> 2
-logx1405 log10 10E-1 -> 0
-logx1406 log10 100E-1 -> 1
-logx1407 log10 1000E-1 -> 2
-logx1408 log10 10000E-1 -> 3
-logx1409 log10 10E0 -> 1
-logx1410 log10 100E0 -> 2
-logx1411 log10 1000E0 -> 3
-logx1412 log10 10000E0 -> 4
-logx1413 log10 10E1 -> 2
-logx1414 log10 100E1 -> 3
-logx1415 log10 1000E1 -> 4
-logx1416 log10 10000E1 -> 5
-logx1417 log10 10E2 -> 3
-logx1418 log10 100E2 -> 4
-logx1419 log10 1000E2 -> 5
-logx1420 log10 10000E2 -> 6
-
--- Randoms
--- P=50, within 0-9999
-Precision: 50
-logx2501 log10 0.00035448001667968141775891246991912655961163345904 -> -3.4504082425411775290864053318247274944685586188505 Inexact Rounded
-logx2502 log10 70.636455726424311228255338637935330826995136597644 -> 1.8490288998408492045793070255302335558140975719247 Inexact Rounded
-logx2503 log10 0.00000000000000233550362473821889060812804063040169 -> -14.631619454343834858023578299142866557717904223667 Inexact Rounded
-logx2504 log10 97.783628621523244679901260358286898958832135433764 -> 1.9902661493224219517897657964362571690592734407330 Inexact Rounded
-logx2505 log10 0062.2377135315858392802612812022807838599572017342 -> 1.7940536293085066199287632725026837018486533544141 Inexact Rounded
-logx2506 log10 6.3767634652071053619977602804724129652981747879532 -> 0.80460030789825961615100163576080761326857374098644 Inexact Rounded
-logx2507 log10 63.297088981313278529306533814195068850532666658798 -> 1.8013837373724427092417170149098614410849353839673 Inexact Rounded
-logx2508 log10 0.00000077239693316881797717820110898167721602299187 -> -6.1121594592718550613773886241951966264826760310047 Inexact Rounded
-logx2509 log10 0.00000003953580359780185534830572461922527831395002 -> -7.4030094293833847136252547069905477213541787177561 Inexact Rounded
-logx2510 log10 754.62905817369989169188998111527272688791544577204 -> 2.8777335243761300047758534304371912099958057545416 Inexact Rounded
-logx2511 log10 0.00000048360378410241428936607147056283282849158312 -> -6.3155103095309353457604038397980091650760346334512 Inexact Rounded
-logx2512 log10 0.00007509037583645612577196104591672080542932166089 -> -4.1244157219700166314012344705538088030592896111026 Inexact Rounded
-logx2513 log10 0.00000000000705475944638915053419839063567898092064 -> -11.151517790256466048553810002525868198178167950377 Inexact Rounded
-logx2514 log10 9.6210300460497657917445410947099633479609165120661 -> 0.98322157093260978206633922877716078683518617768411 Inexact Rounded
-logx2515 log10 0.00000000050150361386555527496607245976120864985611 -> -9.2997259330798261040411086835563234390934934629340 Inexact Rounded
-logx2516 log10 098.24754029731994125797723545333677604490074810751 -> 1.9923216862874337077795278629351060819105679670633 Inexact Rounded
-logx2517 log10 7.5091998150046994320441463854301624742491015752980 -> 0.87559366078005924080766469158763499725414024128781 Inexact Rounded
-logx2518 log10 0.00000000000079540571273330075193668596942268542425 -> -12.099411294165176028817305108475326325006250936963 Inexact Rounded
-logx2519 log10 0.00000042395034799555215782907515074134154915491701 -> -6.3726850039125381134069450802108893075604464135297 Inexact Rounded
-logx2520 log10 56.683376304674355481905023145238799909301732694982 -> 1.7534557107853480435703421826077606250636580091754 Inexact Rounded
-logx2521 log10 48.734033811444195070807606721517169810438049581227 -> 1.6878323602741065190942654710049433808208291564049 Inexact Rounded
-logx2522 log10 0.00074830310930046865009851706989430228561880221063 -> -3.1259224502209974082223667712016445572431791920618 Inexact Rounded
-logx2523 log10 36.677348885111593384020836720396262497122708598359 -> 1.5643979364260796086754530282302605477567469395425 Inexact Rounded
-logx2524 log10 0.00000000000000004495678560480432858812419145833744 -> -16.347204748239740510014320630363244015916029619561 Inexact Rounded
-logx2525 log10 9509.5854013650642799374159131940108748594774307104 -> 3.9781615829916326741100166519726824430945406302661 Inexact Rounded
-logx2526 log10 0.07834891268689177014044454793608715276615743819097 -> -1.1059670262197643147805517398621288897669876996348 Inexact Rounded
-logx2527 log10 0.00000029584529880706128444454688454999032801904794 -> -6.5289353275814043710076526920566721570375026917206 Inexact Rounded
-logx2528 log10 3.0713496544497618098794332787772186176981011904294 -> 0.48732926103896828546424341029492468100431414072994 Inexact Rounded
-logx2529 log10 352.66392670788816474407442785460803833927136413943 -> 2.5473610388199562714709836398243933320284077008314 Inexact Rounded
-logx2530 log10 0.00304743125181876267210516527361742185617091801650 -> -2.5160660830163981967774124745311497447050056400207 Inexact Rounded
-logx2531 log10 0.00000076120535894952136499250364604538117729437183 -> -6.1184981629047051532448413863950776496652483019415 Inexact Rounded
-logx2532 log10 769.88795978534353052965286195053735007473187735815 -> 2.8864275277862652709986498581064117950288798222100 Inexact Rounded
-logx2533 log10 0.00000000000000041297494808612226304619570016336188 -> -15.384076292745415917510668454361868659468669804710 Inexact Rounded
-logx2534 log10 860.88864595714426940247940960258558876903741966974 -> 2.9349469800554277915920278090647283233440859155176 Inexact Rounded
-logx2535 log10 5839.0328812994787235900178587371051096898683972444 -> 3.7663409208972392569269125539438874737147906238543 Inexact Rounded
-logx2536 log10 0.00000028532710151284840471670497112821201598377841 -> -6.5446569753514027675878879843238065488490618159490 Inexact Rounded
-logx2537 log10 0.00000000000000009734490059931638483445631835651581 -> -16.011686794011271135978633880864278692254243106931 Inexact Rounded
-logx2538 log10 5.8610949526439529489252302463450302981511714144330 -> 0.76797875722452549281028552067645732490929361952278 Inexact Rounded
-logx2539 log10 6.6282432221115923372151148990137179611977576327206 -> 0.82139843639227213211012044000785757267155736071361 Inexact Rounded
-logx2540 log10 0.00000000001994071862386846626954819923923344413454 -> -10.700259194632339980266559224447212260115021637626 Inexact Rounded
-
--- P=34, within 0-9999
-Precision: 34
-logx2201 log10 1.522513203889714179088327328864183 -> 0.1825610677098896250496651330492109 Inexact Rounded
-logx2202 log10 0.171123774769717316154080888930404 -> -0.7666896483548462582461898092764408 Inexact Rounded
-logx2203 log10 0.0000000997467236251714283104963838 -> -7.001101360652518274271569010312115 Inexact Rounded
-logx2204 log10 0.0008856103624122479769647543468633 -> -3.052757310476070891830490327138190 Inexact Rounded
-logx2205 log10 1.938274868738032930709498221236758 -> 0.2874153648259449520201536171714594 Inexact Rounded
-logx2206 log10 479.5667847823826713082613445010097 -> 2.680849095850361068709165157286435 Inexact Rounded
-logx2207 log10 8856.136599178820202141823157336804 -> 3.947244306584767101480454261950559 Inexact Rounded
-logx2208 log10 0.0000911026318801903982642871344858 -> -4.040469076434979398438617464033826 Inexact Rounded
-logx2209 log10 0.0000000000017271112650427414732630 -> -11.76267968314038748995178212654921 Inexact Rounded
-logx2210 log10 6.962605370078885647639503548229695 -> 0.8427717807200322352686396925992250 Inexact Rounded
-logx2211 log10 0.3354804428992793132855923541692781 -> -0.4743327923012159170967636070844834 Inexact Rounded
-logx2212 log10 2.079864257474859008252165836663504 -> 0.3180349916198059046812506741388856 Inexact Rounded
-logx2213 log10 2805.479529292939499220276986621988 -> 3.448007104139974344565978780624744 Inexact Rounded
-logx2214 log10 66.45731133034187374557028537213949 -> 1.822542767005644041661520936223086 Inexact Rounded
-logx2215 log10 0.0000001206521261762681738274822835 -> -6.918465020390216969561494755767318 Inexact Rounded
-logx2216 log10 0.0000000001884891916264401160472381 -> -9.724713548119065386091933007528633 Inexact Rounded
-logx2217 log10 0.0000015467279551726326581314582759 -> -5.810586065070435383755759514608738 Inexact Rounded
-logx2218 log10 0.0090776316728068586744633914135952 -> -2.042027442843745884503280954390114 Inexact Rounded
-logx2219 log10 0.0000000000024541106528713393740030 -> -11.61010585935635713090119156069479 Inexact Rounded
-logx2220 log10 14.12936879385863410081087750645856 -> 1.150122760895466989841057385742662 Inexact Rounded
-logx2221 log10 0.0000036912481831392922922647231392 -> -5.432826753789892283556211380824203 Inexact Rounded
-logx2222 log10 0.0000000004067477525420424270138734 -> -9.390674838050073122857868012475060 Inexact Rounded
-logx2223 log10 7080.122562705399744969319589806194 -> 3.850040775747103318724330047546916 Inexact Rounded
-logx2224 log10 261.3491411363679209175524790255725 -> 2.417221077227536319655699517530855 Inexact Rounded
-logx2225 log10 003.9945581449915240094728380041494 -> 0.6014687471531988260823066997845691 Inexact Rounded
-logx2226 log10 0.0000000000583549164588495206767840 -> -10.23392254834182677023231713519341 Inexact Rounded
-logx2227 log10 9567.961832607240278342761088487484 -> 3.980819434211107631569386147016368 Inexact Rounded
-logx2228 log10 06.26592979160342972777219828867033 -> 0.7969855243966221408595024012574729 Inexact Rounded
-logx2229 log10 0.0000000000589847046598067273287319 -> -10.22926059078206218717755253582907 Inexact Rounded
-logx2230 log10 567.9388648235589204769442863724997 -> 2.754301589058313576472380262907638 Inexact Rounded
-logx2231 log10 039.7790325480037778918162264883415 -> 1.599654216592019199639285308997886 Inexact Rounded
-logx2232 log10 0.0000000005123951921894162149817207 -> -9.290394953898862694847327137242690 Inexact Rounded
-logx2233 log10 0.0000000000038500999723636904276723 -> -11.41452799337924056186867324854691 Inexact Rounded
-logx2234 log10 0.0006726500658977759825616537935864 -> -3.172210810922768725687671849421792 Inexact Rounded
-logx2235 log10 260.2400250475967528429943779126507 -> 2.415374092073799204236801383070064 Inexact Rounded
-logx2236 log10 0.0000000006101942339385102585042548 -> -9.214531900562046557191261226632509 Inexact Rounded
-logx2237 log10 0.0000000010846867501382746760066557 -> -8.964695664883282406359874242387236 Inexact Rounded
-logx2238 log10 60.24078375568814769010333711509928 -> 1.779890613567084253168373266648922 Inexact Rounded
-logx2239 log10 0.0012058738711757669337600252986093 -> -2.918698115012605915753728220896010 Inexact Rounded
-logx2240 log10 230.9450930197841600611503095185600 -> 2.363508739056822846742942599628966 Inexact Rounded
-
--- P=16, within 0-999
-Precision: 16
-logx2101 log10 0.0072067119605184 -> -2.142262835573038 Inexact Rounded
-logx2102 log10 503.6828482226624 -> 2.702157162195652 Inexact Rounded
-logx2103 log10 64.96074447821815 -> 1.812650993464174 Inexact Rounded
-logx2104 log10 48.75408597467246 -> 1.688011018842600 Inexact Rounded
-logx2105 log10 0.0329009839269587 -> -1.482791113975280 Inexact Rounded
-logx2106 log10 223.5320415060633 -> 2.349339784523410 Inexact Rounded
-logx2107 log10 73.12765002292194 -> 1.864081617476268 Inexact Rounded
-logx2108 log10 487.3749378358509 -> 2.687863192802252 Inexact Rounded
-logx2109 log10 0.0000019671987621 -> -5.706151757557926 Inexact Rounded
-logx2110 log10 0.0570680660609784 -> -1.243606844697873 Inexact Rounded
-logx2111 log10 33.10311638788998 -> 1.519868880976773 Inexact Rounded
-logx2112 log10 0.0687382699187077 -> -1.162801402868185 Inexact Rounded
-logx2113 log10 258.9416193626484 -> 2.413201859654145 Inexact Rounded
-logx2114 log10 0.0005306100136736 -> -3.275224558269725 Inexact Rounded
-logx2115 log10 65.78490393408572 -> 1.818126244825109 Inexact Rounded
-logx2116 log10 504.2328842073510 -> 2.702631165346958 Inexact Rounded
-logx2117 log10 9.417432755815027 -> 0.9739325278524503 Inexact Rounded
-logx2118 log10 006.7054835355498 -> 0.8264301004947640 Inexact Rounded
-logx2119 log10 0.0917012272363915 -> -1.037624852133399 Inexact Rounded
-logx2120 log10 5.959404385244921 -> 0.7752028561953401 Inexact Rounded
-logx2121 log10 0.0001209759148486 -> -3.917301084968903 Inexact Rounded
-logx2122 log10 0.0004706112139838 -> -3.327337728428039 Inexact Rounded
-logx2123 log10 0.0069700457377046 -> -2.156764372035771 Inexact Rounded
-logx2124 log10 0.5155584569852619 -> -0.2877220847805025 Inexact Rounded
-logx2125 log10 88.06005885607414 -> 1.944778971389913 Inexact Rounded
-logx2126 log10 0.0448240038219866 -> -1.348489353509709 Inexact Rounded
-logx2127 log10 3.419622484059565 -> 0.5339781639101145 Inexact Rounded
-logx2128 log10 5.171123353858721 -> 0.7135848977142854 Inexact Rounded
-logx2129 log10 0.0002133188319807 -> -3.670970802945872 Inexact Rounded
-logx2130 log10 46.21086703136966 -> 1.664744117045149 Inexact Rounded
-logx2131 log10 0.0000631053714415 -> -4.199933672639880 Inexact Rounded
-logx2132 log10 78.66019196870698 -> 1.895755001962469 Inexact Rounded
-logx2133 log10 0.0007152278351188 -> -3.145555592082297 Inexact Rounded
-logx2134 log10 45.52509819928536 -> 1.658250891256892 Inexact Rounded
-logx2135 log10 0.0000703227795740 -> -4.152903971697183 Inexact Rounded
-logx2136 log10 26.24438641426669 -> 1.419036423550599 Inexact Rounded
-logx2137 log10 0.0000044654829535 -> -5.350131564166817 Inexact Rounded
-logx2138 log10 0.7360702733062529 -> -0.1330807211893611 Inexact Rounded
-logx2139 log10 8.417059176469655 -> 0.9251603805112778 Inexact Rounded
-logx2140 log10 0.0002926570767968 -> -3.533640969664818 Inexact Rounded
-
--- P=7, within 0-99
-Precision: 7
-logx2001 log10 57.26089 -> 1.757858 Inexact Rounded
-logx2002 log10 0.0575421 -> -1.240014 Inexact Rounded
-logx2003 log10 0.5918465 -> -0.2277909 Inexact Rounded
-logx2004 log10 0.0068776 -> -2.162563 Inexact Rounded
-logx2005 log10 0.0066833 -> -2.175009 Inexact Rounded
-logx2006 log10 9.926963 -> 0.9968164 Inexact Rounded
-logx2007 log10 0.0041852 -> -2.378284 Inexact Rounded
-logx2008 log10 84.15412 -> 1.925075 Inexact Rounded
-logx2009 log10 2.466856 -> 0.3921438 Inexact Rounded
-logx2010 log10 0.0058047 -> -2.236220 Inexact Rounded
-logx2011 log10 9.885154 -> 0.9949834 Inexact Rounded
-logx2012 log10 0.6667654 -> -0.1760269 Inexact Rounded
-logx2013 log10 34.65736 -> 1.539795 Inexact Rounded
-logx2014 log10 0.0026884 -> -2.570506 Inexact Rounded
-logx2015 log10 0.0432767 -> -1.363746 Inexact Rounded
-logx2016 log10 66.01407 -> 1.819637 Inexact Rounded
-logx2017 log10 0.0070572 -> -2.151368 Inexact Rounded
-logx2018 log10 0.0731613 -> -1.135719 Inexact Rounded
-logx2019 log10 9.838983 -> 0.9929502 Inexact Rounded
-logx2020 log10 15.89696 -> 1.201314 Inexact Rounded
-logx2021 log10 8.459247 -> 0.9273317 Inexact Rounded
-logx2022 log10 0.0010873 -> -2.963651 Inexact Rounded
-logx2023 log10 0.6498619 -> -0.1871789 Inexact Rounded
-logx2024 log10 0.0847008 -> -1.072112 Inexact Rounded
-logx2025 log10 0.0075489 -> -2.122116 Inexact Rounded
-logx2026 log10 51.11152 -> 1.708519 Inexact Rounded
-logx2027 log10 0.7233866 -> -0.1406295 Inexact Rounded
-logx2028 log10 2.254721 -> 0.3530928 Inexact Rounded
-logx2029 log10 6.568444 -> 0.8174625 Inexact Rounded
-logx2030 log10 83.72639 -> 1.922862 Inexact Rounded
-logx2031 log10 6.720585 -> 0.8274071 Inexact Rounded
-logx2032 log10 87.90366 -> 1.944007 Inexact Rounded
-logx2033 log10 0.0433324 -> -1.363187 Inexact Rounded
-logx2034 log10 34.63912 -> 1.539567 Inexact Rounded
-logx2035 log10 0.8089059 -> -0.09210200 Inexact Rounded
-logx2036 log10 7.793405 -> 0.8917272 Inexact Rounded
-logx2037 log10 0.0041757 -> -2.379271 Inexact Rounded
-logx2038 log10 7.135417 -> 0.8534194 Inexact Rounded
-logx2039 log10 12.49570 -> 1.096761 Inexact Rounded
-logx2040 log10 6.356276 -> 0.8032027 Inexact Rounded
-
---------
-maxExponent: 384
-minExponent: -383
-precision: 16
-rounding: half_even
-
--- special values
-logx820 log10 Infinity -> Infinity
-logx821 log10 0 -> -Infinity
-logx822 log10 NaN -> NaN
-logx823 log10 sNaN -> NaN Invalid_operation
--- propagating NaNs
-logx824 log10 sNaN123 -> NaN123 Invalid_operation
-logx825 log10 -sNaN321 -> -NaN321 Invalid_operation
-logx826 log10 NaN456 -> NaN456
-logx827 log10 -NaN654 -> -NaN654
-logx828 log10 NaN1 -> NaN1
-
-
--- Invalid operations due to restrictions
--- [next two probably skipped by most test harnesses]
-precision: 100000000
-logx901 log10 1 -> NaN Invalid_context
-precision: 99999999
-logx902 log10 0 -> NaN Invalid_context
-
-precision: 9
-maxExponent: 1000000
-minExponent: -999999
-logx903 log10 1 -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999999
-logx904 log10 0 -> -Infinity
-maxExponent: 999999
-minExponent: -1000000
-logx905 log10 1 -> NaN Invalid_context
-maxExponent: 999999
-minExponent: -999998
-logx906 log10 0 -> -Infinity
-
--- Null test
-logx900 log10 # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- log10.decTest -- decimal logarithm in base 10 --
+-- Copyright (c) IBM Corporation, 2005, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This emphasises the testing of notable cases, as they will often
+-- have unusual paths (especially the 10**n results).
+
+extended: 1
+precision: 16
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- examples in specification
+precision: 9
+logxs000 log10 0 -> -Infinity
+logxs001 log10 0.001 -> -3
+logxs002 log10 1 -> 0
+logxs003 log10 2 -> 0.301029996 Inexact Rounded
+logxs004 log10 10 -> 1
+logxs005 log10 70 -> 1.84509804 Inexact Rounded
+logxs006 log10 +Infinity -> Infinity
+
+
+-- basics (examples in specification, etc.)
+precision: 16
+logx0000 log10 0 -> -Infinity
+logx0001 log10 7E-1000 -> -999.1549019599857 Inexact Rounded
+logx0002 log10 1.1E-9 -> -8.958607314841775 Inexact Rounded
+logx0003 log10 0.0007 -> -3.154901959985743 Inexact Rounded
+logx0004 log10 0.11 -> -0.9586073148417750 Inexact Rounded
+logx0005 log10 0.7 -> -0.1549019599857432 Inexact Rounded
+logx0006 log10 1 -> 0
+logx0007 log10 1.5 -> 0.1760912590556812 Inexact Rounded
+logx0008 log10 2 -> 0.3010299956639812 Inexact Rounded
+logx0009 log10 2.718281828459045 -> 0.4342944819032518 Inexact Rounded
+logx0010 log10 2.718281828459046 -> 0.4342944819032519 Inexact Rounded
+logx0011 log10 2.718281828459047 -> 0.4342944819032521 Inexact Rounded
+logx0012 log10 7 -> 0.8450980400142568 Inexact Rounded
+logx0013 log10 10 -> 1
+logx0014 log10 10.5 -> 1.021189299069938 Inexact Rounded
+logx0015 log10 11 -> 1.041392685158225 Inexact Rounded
+logx0016 log10 70 -> 1.845098040014257 Inexact Rounded
+logx0017 log10 9999 -> 3.999956568380192 Inexact Rounded
+logx0018 log10 1.21E6 -> 6.082785370316450 Inexact Rounded
+logx0019 log10 1.1E+9 -> 9.041392685158225 Inexact Rounded
+logx0020 log10 7E+1000 -> 1000.845098040014 Inexact Rounded
+logx0021 log10 +Infinity -> Infinity
+
+-- notable cases
+-- negatives
+logx0031 log10 -1E-9 -> NaN Invalid_operation
+logx0032 log10 -0.0007 -> NaN Invalid_operation
+logx0033 log10 -0.1 -> NaN Invalid_operation
+logx0034 log10 -0.7 -> NaN Invalid_operation
+logx0035 log10 -1 -> NaN Invalid_operation
+logx0036 log10 -1.5 -> NaN Invalid_operation
+logx0037 log10 -2 -> NaN Invalid_operation
+logx0038 log10 -10.5 -> NaN Invalid_operation
+logx0039 log10 -10.5 -> NaN Invalid_operation
+logx0040 log10 -9999 -> NaN Invalid_operation
+logx0041 log10 -10 -> NaN Invalid_operation
+logx0042 log10 -0 -> -Infinity
+logx0043 log10 -0E+17 -> -Infinity
+logx0044 log10 -0E-17 -> -Infinity
+-- other zeros
+logx0051 log10 0 -> -Infinity
+logx0052 log10 0E+17 -> -Infinity
+logx0053 log10 0E-17 -> -Infinity
+-- infinities
+logx0055 log10 -Infinity -> NaN Invalid_operation
+logx0056 log10 +Infinity -> Infinity
+-- ones
+logx0061 log10 1 -> 0
+logx0062 log10 1.0 -> 0
+logx0063 log10 1.000000000000000 -> 0
+logx0064 log10 1.000000000000000000 -> 0
+
+-- notable cases -- exact powers of 10
+logx1100 log10 1 -> 0
+logx1101 log10 10 -> 1
+logx1102 log10 100 -> 2
+logx1103 log10 1000 -> 3
+logx1104 log10 10000 -> 4
+logx1105 log10 100000 -> 5
+logx1106 log10 1000000 -> 6
+logx1107 log10 10000000 -> 7
+logx1108 log10 100000000 -> 8
+logx1109 log10 1000000000 -> 9
+logx1110 log10 10000000000 -> 10
+logx1111 log10 100000000000 -> 11
+logx1112 log10 1000000000000 -> 12
+logx1113 log10 0.00000000001 -> -11
+logx1114 log10 0.0000000001 -> -10
+logx1115 log10 0.000000001 -> -9
+logx1116 log10 0.00000001 -> -8
+logx1117 log10 0.0000001 -> -7
+logx1118 log10 0.000001 -> -6
+logx1119 log10 0.00001 -> -5
+logx1120 log10 0.0001 -> -4
+logx1121 log10 0.001 -> -3
+logx1122 log10 0.01 -> -2
+logx1123 log10 0.1 -> -1
+logx1124 log10 1E-99 -> -99
+logx1125 log10 1E-100 -> -100
+logx1126 log10 1E-383 -> -383
+
+-- check normally exact cases round properly
+precision: 1
+logx1141 log10 10000000000 -> 1E+1 Rounded
+logx1142 log10 1000000000000 -> 1E+1 Inexact Rounded
+logx1143 log10 1E+100 -> 1E+2 Rounded
+logx1144 log10 1E+123 -> 1E+2 Inexact Rounded
+logx1145 log10 1E+126 -> 1E+2 Inexact Rounded
+logx1146 log10 1E+916 -> 9E+2 Inexact Rounded
+logx1147 log10 1E+999 -> 1E+3 Inexact Rounded
+
+precision: 2
+logx1151 log10 10000000000 -> 10
+logx1152 log10 1000000000000 -> 12
+logx1153 log10 1E+100 -> 1.0E+2 Rounded
+logx1154 log10 1E+123 -> 1.2E+2 Inexact Rounded
+logx1155 log10 1E+126 -> 1.3E+2 Inexact Rounded
+logx1156 log10 1E+916 -> 9.2E+2 Inexact Rounded
+logx1157 log10 1E+999 -> 1.0E+3 Inexact Rounded
+-- some half-way point rounds, other cases, and negatives
+logx1158 log10 1E+125 -> 1.2E+2 Inexact Rounded
+logx1159 log10 1E+135 -> 1.4E+2 Inexact Rounded
+logx1160 log10 1E+129 -> 1.3E+2 Inexact Rounded
+logx1161 log10 1E+131 -> 1.3E+2 Inexact Rounded
+logx1162 log10 1E-123 -> -1.2E+2 Inexact Rounded
+logx1163 log10 1E-126 -> -1.3E+2 Inexact Rounded
+logx1164 log10 1E-916 -> -9.2E+2 Inexact Rounded
+logx1165 log10 1E-999 -> -1.0E+3 Inexact Rounded
+logx1166 log10 1E-125 -> -1.2E+2 Inexact Rounded
+logx1167 log10 1E-135 -> -1.4E+2 Inexact Rounded
+logx1168 log10 1E-129 -> -1.3E+2 Inexact Rounded
+logx1169 log10 1E-131 -> -1.3E+2 Inexact Rounded
+
+precision: 3
+logx1171 log10 10000000000 -> 10
+logx1172 log10 1000000000000 -> 12
+logx1173 log10 1E+100 -> 100
+logx1174 log10 1E+123 -> 123
+logx1175 log10 1E+126 -> 126
+logx1176 log10 1E+916 -> 916
+logx1177 log10 1E+999 -> 999
+
+-- log10(2) .. tests both ln(2) and ln(10) constants, too
+precision: 50
+logx1201 log10 2 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
+logx1202 log10 2.000 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
+logx1203 log10 0.2E1 -> 0.30102999566398119521373889472449302676818988146211 Inexact Rounded
+precision: 49
+logx1204 log10 2 -> 0.3010299956639811952137388947244930267681898814621 Inexact Rounded
+precision: 48
+logx1205 log10 2 -> 0.301029995663981195213738894724493026768189881462 Inexact Rounded
+precision: 47
+logx1206 log10 2 -> 0.30102999566398119521373889472449302676818988146 Inexact Rounded
+precision: 46
+logx1207 log10 2 -> 0.3010299956639811952137388947244930267681898815 Inexact Rounded
+precision: 45
+logx1208 log10 2 -> 0.301029995663981195213738894724493026768189881 Inexact Rounded
+precision: 44
+logx1209 log10 2 -> 0.30102999566398119521373889472449302676818988 Inexact Rounded
+precision: 43
+logx1210 log10 2 -> 0.3010299956639811952137388947244930267681899 Inexact Rounded
+precision: 42
+logx1211 log10 2 -> 0.301029995663981195213738894724493026768190 Inexact Rounded
+precision: 41
+logx1212 log10 2 -> 0.30102999566398119521373889472449302676819 Inexact Rounded
+precision: 40
+logx1213 log10 2 -> 0.3010299956639811952137388947244930267682 Inexact Rounded
+precision: 39
+logx1214 log10 2 -> 0.301029995663981195213738894724493026768 Inexact Rounded
+precision: 38
+logx1215 log10 2 -> 0.30102999566398119521373889472449302677 Inexact Rounded
+precision: 37
+logx1216 log10 2 -> 0.3010299956639811952137388947244930268 Inexact Rounded
+precision: 36
+logx1217 log10 2 -> 0.301029995663981195213738894724493027 Inexact Rounded
+precision: 35
+logx1218 log10 2 -> 0.30102999566398119521373889472449303 Inexact Rounded
+precision: 34
+logx1219 log10 2 -> 0.3010299956639811952137388947244930 Inexact Rounded
+precision: 33
+logx1220 log10 2 -> 0.301029995663981195213738894724493 Inexact Rounded
+precision: 32
+logx1221 log10 2 -> 0.30102999566398119521373889472449 Inexact Rounded
+precision: 31
+logx1222 log10 2 -> 0.3010299956639811952137388947245 Inexact Rounded
+precision: 30
+logx1223 log10 2 -> 0.301029995663981195213738894724 Inexact Rounded
+precision: 29
+logx1224 log10 2 -> 0.30102999566398119521373889472 Inexact Rounded
+precision: 28
+logx1225 log10 2 -> 0.3010299956639811952137388947 Inexact Rounded
+precision: 27
+logx1226 log10 2 -> 0.301029995663981195213738895 Inexact Rounded
+precision: 26
+logx1227 log10 2 -> 0.30102999566398119521373889 Inexact Rounded
+precision: 25
+logx1228 log10 2 -> 0.3010299956639811952137389 Inexact Rounded
+precision: 24
+logx1229 log10 2 -> 0.301029995663981195213739 Inexact Rounded
+precision: 23
+logx1230 log10 2 -> 0.30102999566398119521374 Inexact Rounded
+precision: 22
+logx1231 log10 2 -> 0.3010299956639811952137 Inexact Rounded
+precision: 21
+logx1232 log10 2 -> 0.301029995663981195214 Inexact Rounded
+precision: 20
+logx1233 log10 2 -> 0.30102999566398119521 Inexact Rounded
+precision: 19
+logx1234 log10 2 -> 0.3010299956639811952 Inexact Rounded
+precision: 18
+logx1235 log10 2 -> 0.301029995663981195 Inexact Rounded
+precision: 17
+logx1236 log10 2 -> 0.30102999566398120 Inexact Rounded
+precision: 16
+logx1237 log10 2 -> 0.3010299956639812 Inexact Rounded
+precision: 15
+logx1238 log10 2 -> 0.301029995663981 Inexact Rounded
+precision: 14
+logx1239 log10 2 -> 0.30102999566398 Inexact Rounded
+precision: 13
+logx1240 log10 2 -> 0.3010299956640 Inexact Rounded
+precision: 12
+logx1241 log10 2 -> 0.301029995664 Inexact Rounded
+precision: 11
+logx1242 log10 2 -> 0.30102999566 Inexact Rounded
+precision: 10
+logx1243 log10 2 -> 0.3010299957 Inexact Rounded
+precision: 9
+logx1244 log10 2 -> 0.301029996 Inexact Rounded
+precision: 8
+logx1245 log10 2 -> 0.30103000 Inexact Rounded
+precision: 7
+logx1246 log10 2 -> 0.3010300 Inexact Rounded
+precision: 6
+logx1247 log10 2 -> 0.301030 Inexact Rounded
+precision: 5
+logx1248 log10 2 -> 0.30103 Inexact Rounded
+precision: 4
+logx1249 log10 2 -> 0.3010 Inexact Rounded
+precision: 3
+logx1250 log10 2 -> 0.301 Inexact Rounded
+precision: 2
+logx1251 log10 2 -> 0.30 Inexact Rounded
+precision: 1
+logx1252 log10 2 -> 0.3 Inexact Rounded
+
+maxExponent: 384
+minExponent: -383
+precision: 16
+rounding: half_even
+
+-- More close-to-e, etc., tests
+precision: 34
+logx1301 log10 2.718281828459045235360287471352661 -> 0.4342944819032518276511289189166048 Inexact Rounded
+logx1302 log10 2.718281828459045235360287471352662 -> 0.4342944819032518276511289189166050 Inexact Rounded
+logx1303 log10 2.718281828459045235360287471352663 -> 0.4342944819032518276511289189166052 Inexact Rounded
+logx1304 log10 0.99999999999999999999999999999999 -> -4.342944819032518276511289189166073E-33 Inexact Rounded
+logx1305 log10 0.999999999999999999999999999999999 -> -4.342944819032518276511289189166053E-34 Inexact Rounded
+logx1306 log10 0.9999999999999999999999999999999999 -> -4.342944819032518276511289189166051E-35 Inexact Rounded
+logx1307 log10 1.000000000000000000000000000000000 -> 0
+logx1308 log10 1.0000000000000000000000000000000001 -> 4.342944819032518276511289189166051E-35 Inexact Rounded
+logx1309 log10 1.000000000000000000000000000000001 -> 4.342944819032518276511289189166049E-34 Inexact Rounded
+logx1310 log10 1.00000000000000000000000000000001 -> 4.342944819032518276511289189166029E-33 Inexact Rounded
+-- lower p
+precision: 7
+logx1320 log10 0.999999 -> -4.342947E-7 Inexact Rounded
+logx1321 log10 0.9999999 -> -4.342945E-8 Inexact Rounded
+logx1322 log10 0.99999999 -> -4.342945E-9 Inexact Rounded
+logx1323 log10 0.999999999 -> -4.342945E-10 Inexact Rounded
+logx1324 log10 1.00000000 -> 0
+logx1325 log10 1.00000001 -> 4.342945E-9 Inexact Rounded
+logx1326 log10 1.0000001 -> 4.342945E-8 Inexact Rounded
+logx1327 log10 1.000001 -> 4.342943E-7 Inexact Rounded
+
+-- near 10^3
+precision: 9
+logx1331 log10 999.9999998 -> 3.00000000 Inexact Rounded
+logx1332 log10 999.9999999 -> 3.00000000 Inexact Rounded
+logx1333 log10 1000.000000 -> 3
+logx1334 log10 1000.000001 -> 3.00000000 Inexact Rounded
+logx1335 log10 1000.000002 -> 3.00000000 Inexact Rounded
+precision: 16
+logx1341 log10 999.9999998 -> 2.999999999913141 Inexact Rounded
+logx1342 log10 999.9999999 -> 2.999999999956571 Inexact Rounded
+logx1343 log10 1000.000000 -> 3
+logx1344 log10 1000.000001 -> 3.000000000434294 Inexact Rounded
+logx1345 log10 1000.000002 -> 3.000000000868589 Inexact Rounded
+
+-- suggestions from Ilan Nehama
+logx1400 log10 10E-3 -> -2
+logx1401 log10 10E-2 -> -1
+logx1402 log10 100E-2 -> 0
+logx1403 log10 1000E-2 -> 1
+logx1404 log10 10000E-2 -> 2
+logx1405 log10 10E-1 -> 0
+logx1406 log10 100E-1 -> 1
+logx1407 log10 1000E-1 -> 2
+logx1408 log10 10000E-1 -> 3
+logx1409 log10 10E0 -> 1
+logx1410 log10 100E0 -> 2
+logx1411 log10 1000E0 -> 3
+logx1412 log10 10000E0 -> 4
+logx1413 log10 10E1 -> 2
+logx1414 log10 100E1 -> 3
+logx1415 log10 1000E1 -> 4
+logx1416 log10 10000E1 -> 5
+logx1417 log10 10E2 -> 3
+logx1418 log10 100E2 -> 4
+logx1419 log10 1000E2 -> 5
+logx1420 log10 10000E2 -> 6
+
+-- Randoms
+-- P=50, within 0-9999
+Precision: 50
+logx2501 log10 0.00035448001667968141775891246991912655961163345904 -> -3.4504082425411775290864053318247274944685586188505 Inexact Rounded
+logx2502 log10 70.636455726424311228255338637935330826995136597644 -> 1.8490288998408492045793070255302335558140975719247 Inexact Rounded
+logx2503 log10 0.00000000000000233550362473821889060812804063040169 -> -14.631619454343834858023578299142866557717904223667 Inexact Rounded
+logx2504 log10 97.783628621523244679901260358286898958832135433764 -> 1.9902661493224219517897657964362571690592734407330 Inexact Rounded
+logx2505 log10 0062.2377135315858392802612812022807838599572017342 -> 1.7940536293085066199287632725026837018486533544141 Inexact Rounded
+logx2506 log10 6.3767634652071053619977602804724129652981747879532 -> 0.80460030789825961615100163576080761326857374098644 Inexact Rounded
+logx2507 log10 63.297088981313278529306533814195068850532666658798 -> 1.8013837373724427092417170149098614410849353839673 Inexact Rounded
+logx2508 log10 0.00000077239693316881797717820110898167721602299187 -> -6.1121594592718550613773886241951966264826760310047 Inexact Rounded
+logx2509 log10 0.00000003953580359780185534830572461922527831395002 -> -7.4030094293833847136252547069905477213541787177561 Inexact Rounded
+logx2510 log10 754.62905817369989169188998111527272688791544577204 -> 2.8777335243761300047758534304371912099958057545416 Inexact Rounded
+logx2511 log10 0.00000048360378410241428936607147056283282849158312 -> -6.3155103095309353457604038397980091650760346334512 Inexact Rounded
+logx2512 log10 0.00007509037583645612577196104591672080542932166089 -> -4.1244157219700166314012344705538088030592896111026 Inexact Rounded
+logx2513 log10 0.00000000000705475944638915053419839063567898092064 -> -11.151517790256466048553810002525868198178167950377 Inexact Rounded
+logx2514 log10 9.6210300460497657917445410947099633479609165120661 -> 0.98322157093260978206633922877716078683518617768411 Inexact Rounded
+logx2515 log10 0.00000000050150361386555527496607245976120864985611 -> -9.2997259330798261040411086835563234390934934629340 Inexact Rounded
+logx2516 log10 098.24754029731994125797723545333677604490074810751 -> 1.9923216862874337077795278629351060819105679670633 Inexact Rounded
+logx2517 log10 7.5091998150046994320441463854301624742491015752980 -> 0.87559366078005924080766469158763499725414024128781 Inexact Rounded
+logx2518 log10 0.00000000000079540571273330075193668596942268542425 -> -12.099411294165176028817305108475326325006250936963 Inexact Rounded
+logx2519 log10 0.00000042395034799555215782907515074134154915491701 -> -6.3726850039125381134069450802108893075604464135297 Inexact Rounded
+logx2520 log10 56.683376304674355481905023145238799909301732694982 -> 1.7534557107853480435703421826077606250636580091754 Inexact Rounded
+logx2521 log10 48.734033811444195070807606721517169810438049581227 -> 1.6878323602741065190942654710049433808208291564049 Inexact Rounded
+logx2522 log10 0.00074830310930046865009851706989430228561880221063 -> -3.1259224502209974082223667712016445572431791920618 Inexact Rounded
+logx2523 log10 36.677348885111593384020836720396262497122708598359 -> 1.5643979364260796086754530282302605477567469395425 Inexact Rounded
+logx2524 log10 0.00000000000000004495678560480432858812419145833744 -> -16.347204748239740510014320630363244015916029619561 Inexact Rounded
+logx2525 log10 9509.5854013650642799374159131940108748594774307104 -> 3.9781615829916326741100166519726824430945406302661 Inexact Rounded
+logx2526 log10 0.07834891268689177014044454793608715276615743819097 -> -1.1059670262197643147805517398621288897669876996348 Inexact Rounded
+logx2527 log10 0.00000029584529880706128444454688454999032801904794 -> -6.5289353275814043710076526920566721570375026917206 Inexact Rounded
+logx2528 log10 3.0713496544497618098794332787772186176981011904294 -> 0.48732926103896828546424341029492468100431414072994 Inexact Rounded
+logx2529 log10 352.66392670788816474407442785460803833927136413943 -> 2.5473610388199562714709836398243933320284077008314 Inexact Rounded
+logx2530 log10 0.00304743125181876267210516527361742185617091801650 -> -2.5160660830163981967774124745311497447050056400207 Inexact Rounded
+logx2531 log10 0.00000076120535894952136499250364604538117729437183 -> -6.1184981629047051532448413863950776496652483019415 Inexact Rounded
+logx2532 log10 769.88795978534353052965286195053735007473187735815 -> 2.8864275277862652709986498581064117950288798222100 Inexact Rounded
+logx2533 log10 0.00000000000000041297494808612226304619570016336188 -> -15.384076292745415917510668454361868659468669804710 Inexact Rounded
+logx2534 log10 860.88864595714426940247940960258558876903741966974 -> 2.9349469800554277915920278090647283233440859155176 Inexact Rounded
+logx2535 log10 5839.0328812994787235900178587371051096898683972444 -> 3.7663409208972392569269125539438874737147906238543 Inexact Rounded
+logx2536 log10 0.00000028532710151284840471670497112821201598377841 -> -6.5446569753514027675878879843238065488490618159490 Inexact Rounded
+logx2537 log10 0.00000000000000009734490059931638483445631835651581 -> -16.011686794011271135978633880864278692254243106931 Inexact Rounded
+logx2538 log10 5.8610949526439529489252302463450302981511714144330 -> 0.76797875722452549281028552067645732490929361952278 Inexact Rounded
+logx2539 log10 6.6282432221115923372151148990137179611977576327206 -> 0.82139843639227213211012044000785757267155736071361 Inexact Rounded
+logx2540 log10 0.00000000001994071862386846626954819923923344413454 -> -10.700259194632339980266559224447212260115021637626 Inexact Rounded
+
+-- P=34, within 0-9999
+Precision: 34
+logx2201 log10 1.522513203889714179088327328864183 -> 0.1825610677098896250496651330492109 Inexact Rounded
+logx2202 log10 0.171123774769717316154080888930404 -> -0.7666896483548462582461898092764408 Inexact Rounded
+logx2203 log10 0.0000000997467236251714283104963838 -> -7.001101360652518274271569010312115 Inexact Rounded
+logx2204 log10 0.0008856103624122479769647543468633 -> -3.052757310476070891830490327138190 Inexact Rounded
+logx2205 log10 1.938274868738032930709498221236758 -> 0.2874153648259449520201536171714594 Inexact Rounded
+logx2206 log10 479.5667847823826713082613445010097 -> 2.680849095850361068709165157286435 Inexact Rounded
+logx2207 log10 8856.136599178820202141823157336804 -> 3.947244306584767101480454261950559 Inexact Rounded
+logx2208 log10 0.0000911026318801903982642871344858 -> -4.040469076434979398438617464033826 Inexact Rounded
+logx2209 log10 0.0000000000017271112650427414732630 -> -11.76267968314038748995178212654921 Inexact Rounded
+logx2210 log10 6.962605370078885647639503548229695 -> 0.8427717807200322352686396925992250 Inexact Rounded
+logx2211 log10 0.3354804428992793132855923541692781 -> -0.4743327923012159170967636070844834 Inexact Rounded
+logx2212 log10 2.079864257474859008252165836663504 -> 0.3180349916198059046812506741388856 Inexact Rounded
+logx2213 log10 2805.479529292939499220276986621988 -> 3.448007104139974344565978780624744 Inexact Rounded
+logx2214 log10 66.45731133034187374557028537213949 -> 1.822542767005644041661520936223086 Inexact Rounded
+logx2215 log10 0.0000001206521261762681738274822835 -> -6.918465020390216969561494755767318 Inexact Rounded
+logx2216 log10 0.0000000001884891916264401160472381 -> -9.724713548119065386091933007528633 Inexact Rounded
+logx2217 log10 0.0000015467279551726326581314582759 -> -5.810586065070435383755759514608738 Inexact Rounded
+logx2218 log10 0.0090776316728068586744633914135952 -> -2.042027442843745884503280954390114 Inexact Rounded
+logx2219 log10 0.0000000000024541106528713393740030 -> -11.61010585935635713090119156069479 Inexact Rounded
+logx2220 log10 14.12936879385863410081087750645856 -> 1.150122760895466989841057385742662 Inexact Rounded
+logx2221 log10 0.0000036912481831392922922647231392 -> -5.432826753789892283556211380824203 Inexact Rounded
+logx2222 log10 0.0000000004067477525420424270138734 -> -9.390674838050073122857868012475060 Inexact Rounded
+logx2223 log10 7080.122562705399744969319589806194 -> 3.850040775747103318724330047546916 Inexact Rounded
+logx2224 log10 261.3491411363679209175524790255725 -> 2.417221077227536319655699517530855 Inexact Rounded
+logx2225 log10 003.9945581449915240094728380041494 -> 0.6014687471531988260823066997845691 Inexact Rounded
+logx2226 log10 0.0000000000583549164588495206767840 -> -10.23392254834182677023231713519341 Inexact Rounded
+logx2227 log10 9567.961832607240278342761088487484 -> 3.980819434211107631569386147016368 Inexact Rounded
+logx2228 log10 06.26592979160342972777219828867033 -> 0.7969855243966221408595024012574729 Inexact Rounded
+logx2229 log10 0.0000000000589847046598067273287319 -> -10.22926059078206218717755253582907 Inexact Rounded
+logx2230 log10 567.9388648235589204769442863724997 -> 2.754301589058313576472380262907638 Inexact Rounded
+logx2231 log10 039.7790325480037778918162264883415 -> 1.599654216592019199639285308997886 Inexact Rounded
+logx2232 log10 0.0000000005123951921894162149817207 -> -9.290394953898862694847327137242690 Inexact Rounded
+logx2233 log10 0.0000000000038500999723636904276723 -> -11.41452799337924056186867324854691 Inexact Rounded
+logx2234 log10 0.0006726500658977759825616537935864 -> -3.172210810922768725687671849421792 Inexact Rounded
+logx2235 log10 260.2400250475967528429943779126507 -> 2.415374092073799204236801383070064 Inexact Rounded
+logx2236 log10 0.0000000006101942339385102585042548 -> -9.214531900562046557191261226632509 Inexact Rounded
+logx2237 log10 0.0000000010846867501382746760066557 -> -8.964695664883282406359874242387236 Inexact Rounded
+logx2238 log10 60.24078375568814769010333711509928 -> 1.779890613567084253168373266648922 Inexact Rounded
+logx2239 log10 0.0012058738711757669337600252986093 -> -2.918698115012605915753728220896010 Inexact Rounded
+logx2240 log10 230.9450930197841600611503095185600 -> 2.363508739056822846742942599628966 Inexact Rounded
+
+-- P=16, within 0-999
+Precision: 16
+logx2101 log10 0.0072067119605184 -> -2.142262835573038 Inexact Rounded
+logx2102 log10 503.6828482226624 -> 2.702157162195652 Inexact Rounded
+logx2103 log10 64.96074447821815 -> 1.812650993464174 Inexact Rounded
+logx2104 log10 48.75408597467246 -> 1.688011018842600 Inexact Rounded
+logx2105 log10 0.0329009839269587 -> -1.482791113975280 Inexact Rounded
+logx2106 log10 223.5320415060633 -> 2.349339784523410 Inexact Rounded
+logx2107 log10 73.12765002292194 -> 1.864081617476268 Inexact Rounded
+logx2108 log10 487.3749378358509 -> 2.687863192802252 Inexact Rounded
+logx2109 log10 0.0000019671987621 -> -5.706151757557926 Inexact Rounded
+logx2110 log10 0.0570680660609784 -> -1.243606844697873 Inexact Rounded
+logx2111 log10 33.10311638788998 -> 1.519868880976773 Inexact Rounded
+logx2112 log10 0.0687382699187077 -> -1.162801402868185 Inexact Rounded
+logx2113 log10 258.9416193626484 -> 2.413201859654145 Inexact Rounded
+logx2114 log10 0.0005306100136736 -> -3.275224558269725 Inexact Rounded
+logx2115 log10 65.78490393408572 -> 1.818126244825109 Inexact Rounded
+logx2116 log10 504.2328842073510 -> 2.702631165346958 Inexact Rounded
+logx2117 log10 9.417432755815027 -> 0.9739325278524503 Inexact Rounded
+logx2118 log10 006.7054835355498 -> 0.8264301004947640 Inexact Rounded
+logx2119 log10 0.0917012272363915 -> -1.037624852133399 Inexact Rounded
+logx2120 log10 5.959404385244921 -> 0.7752028561953401 Inexact Rounded
+logx2121 log10 0.0001209759148486 -> -3.917301084968903 Inexact Rounded
+logx2122 log10 0.0004706112139838 -> -3.327337728428039 Inexact Rounded
+logx2123 log10 0.0069700457377046 -> -2.156764372035771 Inexact Rounded
+logx2124 log10 0.5155584569852619 -> -0.2877220847805025 Inexact Rounded
+logx2125 log10 88.06005885607414 -> 1.944778971389913 Inexact Rounded
+logx2126 log10 0.0448240038219866 -> -1.348489353509709 Inexact Rounded
+logx2127 log10 3.419622484059565 -> 0.5339781639101145 Inexact Rounded
+logx2128 log10 5.171123353858721 -> 0.7135848977142854 Inexact Rounded
+logx2129 log10 0.0002133188319807 -> -3.670970802945872 Inexact Rounded
+logx2130 log10 46.21086703136966 -> 1.664744117045149 Inexact Rounded
+logx2131 log10 0.0000631053714415 -> -4.199933672639880 Inexact Rounded
+logx2132 log10 78.66019196870698 -> 1.895755001962469 Inexact Rounded
+logx2133 log10 0.0007152278351188 -> -3.145555592082297 Inexact Rounded
+logx2134 log10 45.52509819928536 -> 1.658250891256892 Inexact Rounded
+logx2135 log10 0.0000703227795740 -> -4.152903971697183 Inexact Rounded
+logx2136 log10 26.24438641426669 -> 1.419036423550599 Inexact Rounded
+logx2137 log10 0.0000044654829535 -> -5.350131564166817 Inexact Rounded
+logx2138 log10 0.7360702733062529 -> -0.1330807211893611 Inexact Rounded
+logx2139 log10 8.417059176469655 -> 0.9251603805112778 Inexact Rounded
+logx2140 log10 0.0002926570767968 -> -3.533640969664818 Inexact Rounded
+
+-- P=7, within 0-99
+Precision: 7
+logx2001 log10 57.26089 -> 1.757858 Inexact Rounded
+logx2002 log10 0.0575421 -> -1.240014 Inexact Rounded
+logx2003 log10 0.5918465 -> -0.2277909 Inexact Rounded
+logx2004 log10 0.0068776 -> -2.162563 Inexact Rounded
+logx2005 log10 0.0066833 -> -2.175009 Inexact Rounded
+logx2006 log10 9.926963 -> 0.9968164 Inexact Rounded
+logx2007 log10 0.0041852 -> -2.378284 Inexact Rounded
+logx2008 log10 84.15412 -> 1.925075 Inexact Rounded
+logx2009 log10 2.466856 -> 0.3921438 Inexact Rounded
+logx2010 log10 0.0058047 -> -2.236220 Inexact Rounded
+logx2011 log10 9.885154 -> 0.9949834 Inexact Rounded
+logx2012 log10 0.6667654 -> -0.1760269 Inexact Rounded
+logx2013 log10 34.65736 -> 1.539795 Inexact Rounded
+logx2014 log10 0.0026884 -> -2.570506 Inexact Rounded
+logx2015 log10 0.0432767 -> -1.363746 Inexact Rounded
+logx2016 log10 66.01407 -> 1.819637 Inexact Rounded
+logx2017 log10 0.0070572 -> -2.151368 Inexact Rounded
+logx2018 log10 0.0731613 -> -1.135719 Inexact Rounded
+logx2019 log10 9.838983 -> 0.9929502 Inexact Rounded
+logx2020 log10 15.89696 -> 1.201314 Inexact Rounded
+logx2021 log10 8.459247 -> 0.9273317 Inexact Rounded
+logx2022 log10 0.0010873 -> -2.963651 Inexact Rounded
+logx2023 log10 0.6498619 -> -0.1871789 Inexact Rounded
+logx2024 log10 0.0847008 -> -1.072112 Inexact Rounded
+logx2025 log10 0.0075489 -> -2.122116 Inexact Rounded
+logx2026 log10 51.11152 -> 1.708519 Inexact Rounded
+logx2027 log10 0.7233866 -> -0.1406295 Inexact Rounded
+logx2028 log10 2.254721 -> 0.3530928 Inexact Rounded
+logx2029 log10 6.568444 -> 0.8174625 Inexact Rounded
+logx2030 log10 83.72639 -> 1.922862 Inexact Rounded
+logx2031 log10 6.720585 -> 0.8274071 Inexact Rounded
+logx2032 log10 87.90366 -> 1.944007 Inexact Rounded
+logx2033 log10 0.0433324 -> -1.363187 Inexact Rounded
+logx2034 log10 34.63912 -> 1.539567 Inexact Rounded
+logx2035 log10 0.8089059 -> -0.09210200 Inexact Rounded
+logx2036 log10 7.793405 -> 0.8917272 Inexact Rounded
+logx2037 log10 0.0041757 -> -2.379271 Inexact Rounded
+logx2038 log10 7.135417 -> 0.8534194 Inexact Rounded
+logx2039 log10 12.49570 -> 1.096761 Inexact Rounded
+logx2040 log10 6.356276 -> 0.8032027 Inexact Rounded
+
+--------
+maxExponent: 384
+minExponent: -383
+precision: 16
+rounding: half_even
+
+-- special values
+logx820 log10 Infinity -> Infinity
+logx821 log10 0 -> -Infinity
+logx822 log10 NaN -> NaN
+logx823 log10 sNaN -> NaN Invalid_operation
+-- propagating NaNs
+logx824 log10 sNaN123 -> NaN123 Invalid_operation
+logx825 log10 -sNaN321 -> -NaN321 Invalid_operation
+logx826 log10 NaN456 -> NaN456
+logx827 log10 -NaN654 -> -NaN654
+logx828 log10 NaN1 -> NaN1
+
+
+-- Invalid operations due to restrictions
+-- [next two probably skipped by most test harnesses]
+precision: 100000000
+logx901 log10 1 -> NaN Invalid_context
+precision: 99999999
+logx902 log10 0 -> NaN Invalid_context
+
+precision: 9
+maxExponent: 1000000
+minExponent: -999999
+logx903 log10 1 -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999999
+logx904 log10 0 -> -Infinity
+maxExponent: 999999
+minExponent: -1000000
+logx905 log10 1 -> NaN Invalid_context
+maxExponent: 999999
+minExponent: -999998
+logx906 log10 0 -> -Infinity
+
+-- Null test
+logx900 log10 # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/logb.decTest b/Lib/test/decimaltestdata/logb.decTest
index ff420d0a84..8b79006257 100644
--- a/Lib/test/decimaltestdata/logb.decTest
+++ b/Lib/test/decimaltestdata/logb.decTest
@@ -1,188 +1,188 @@
-------------------------------------------------------------------------
--- logb.decTest -- return integral adjusted exponent as per 754r --
--- Copyright (c) IBM Corporation, 2005, 2009. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This emphasises the testing of notable cases, as they will often
--- have unusual paths (especially the 10**n results).
-
-extended: 1
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-
--- basics & examples
-precision: 9
-logbx001 logb 0 -> -Infinity Division_by_zero
-logbx002 logb 1E-999 -> -999
-logbx003 logb 9E-999 -> -999
-logbx004 logb 0.001 -> -3
-logbx005 logb 0.03 -> -2
-logbx006 logb 1 -> 0
-logbx007 logb 2 -> 0
-logbx008 logb 2.5 -> 0
-logbx009 logb 2.50 -> 0
-logbx010 logb 10 -> 1
-logbx011 logb 70 -> 1
-logbx012 logb 100 -> 2
-logbx013 logb 250 -> 2
-logbx014 logb +Infinity -> Infinity
-
--- negatives are treated as positives
-logbx021 logb -0 -> -Infinity Division_by_zero
-logbx022 logb -1E-999 -> -999
-logbx023 logb -9E-999 -> -999
-logbx024 logb -0.001 -> -3
-logbx025 logb -1 -> 0
-logbx026 logb -2 -> 0
-logbx027 logb -10 -> 1
-logbx028 logb -70 -> 1
-logbx029 logb -100 -> 2
-logbx030 logb -100000000 -> 8
-logbx031 logb -Infinity -> Infinity
-
--- zeros
-logbx111 logb 0 -> -Infinity Division_by_zero
-logbx112 logb -0 -> -Infinity Division_by_zero
-logbx113 logb 0E+4 -> -Infinity Division_by_zero
-logbx114 logb -0E+4 -> -Infinity Division_by_zero
-logbx115 logb 0.0000 -> -Infinity Division_by_zero
-logbx116 logb -0.0000 -> -Infinity Division_by_zero
-logbx117 logb 0E-141 -> -Infinity Division_by_zero
-logbx118 logb -0E-141 -> -Infinity Division_by_zero
-
--- full coefficients, alternating bits
-logbx121 logb 268268268 -> 8
-logbx122 logb -268268268 -> 8
-logbx123 logb 134134134 -> 8
-logbx124 logb -134134134 -> 8
-
--- Nmax, Nmin, Ntiny
-logbx131 logb 9.99999999E+999 -> 999
-logbx132 logb 1E-999 -> -999
-logbx133 logb 1.00000000E-999 -> -999
-logbx134 logb 1E-1007 -> -1007
-
-logbx135 logb -1E-1007 -> -1007
-logbx136 logb -1.00000000E-999 -> -999
-logbx137 logb -1E-999 -> -999
-logbx138 logb -9.99999999E+999 -> 999
-
--- ones
-logbx0061 logb 1 -> 0
-logbx0062 logb 1.0 -> 0
-logbx0063 logb 1.000000000000000 -> 0
-logbx0064 logb 1.000000000000000000 -> 0
-
--- notable cases -- exact powers of 10
-logbx1100 logb 1 -> 0
-logbx1101 logb 10 -> 1
-logbx1102 logb 100 -> 2
-logbx1103 logb 1000 -> 3
-logbx1104 logb 10000 -> 4
-logbx1105 logb 100000 -> 5
-logbx1106 logb 1000000 -> 6
-logbx1107 logb 10000000 -> 7
-logbx1108 logb 100000000 -> 8
-logbx1109 logb 1000000000 -> 9
-logbx1110 logb 10000000000 -> 10
-logbx1111 logb 100000000000 -> 11
-logbx1112 logb 1000000000000 -> 12
-logbx1113 logb 0.00000000001 -> -11
-logbx1114 logb 0.0000000001 -> -10
-logbx1115 logb 0.000000001 -> -9
-logbx1116 logb 0.00000001 -> -8
-logbx1117 logb 0.0000001 -> -7
-logbx1118 logb 0.000001 -> -6
-logbx1119 logb 0.00001 -> -5
-logbx1120 logb 0.0001 -> -4
-logbx1121 logb 0.001 -> -3
-logbx1122 logb 0.01 -> -2
-logbx1123 logb 0.1 -> -1
-logbx1124 logb 1E-99 -> -99
-logbx1125 logb 1E-100 -> -100
-logbx1126 logb 1E-383 -> -383
-logbx1127 logb 1E-999 -> -999
-
--- suggestions from Ilan Nehama
-logbx1400 logb 10E-3 -> -2
-logbx1401 logb 10E-2 -> -1
-logbx1402 logb 100E-2 -> 0
-logbx1403 logb 1000E-2 -> 1
-logbx1404 logb 10000E-2 -> 2
-logbx1405 logb 10E-1 -> 0
-logbx1406 logb 100E-1 -> 1
-logbx1407 logb 1000E-1 -> 2
-logbx1408 logb 10000E-1 -> 3
-logbx1409 logb 10E0 -> 1
-logbx1410 logb 100E0 -> 2
-logbx1411 logb 1000E0 -> 3
-logbx1412 logb 10000E0 -> 4
-logbx1413 logb 10E1 -> 2
-logbx1414 logb 100E1 -> 3
-logbx1415 logb 1000E1 -> 4
-logbx1416 logb 10000E1 -> 5
-logbx1417 logb 10E2 -> 3
-logbx1418 logb 100E2 -> 4
-logbx1419 logb 1000E2 -> 5
-logbx1420 logb 10000E2 -> 6
-
--- inexacts
-precision: 2
-logbx1500 logb 10000E2 -> 6
-logbx1501 logb 1E+99 -> 99
-logbx1502 logb 1E-99 -> -99
-logbx1503 logb 1E+100 -> 1.0E+2 Rounded
-logbx1504 logb 1E+999 -> 1.0E+3 Inexact Rounded
-logbx1505 logb 1E-100 -> -1.0E+2 Rounded
-logbx1506 logb 1E-999 -> -1.0E+3 Inexact Rounded
-logbx1507 logb 1E-1111 -> -1.1E+3 Inexact Rounded
-logbx1508 logb 1E-3333 -> -3.3E+3 Inexact Rounded
-logbx1509 logb 1E-6666 -> -6.7E+3 Inexact Rounded
-logbx1510 logb 1E+999999999 -> 1.0E+9 Inexact Rounded
-logbx1511 logb 1E-999999999 -> -1.0E+9 Inexact Rounded
-precision: 1
-logbx1517 logb 1E-1111 -> -1E+3 Inexact Rounded
-logbx1518 logb 1E-3333 -> -3E+3 Inexact Rounded
-logbx1519 logb 1E-6666 -> -7E+3 Inexact Rounded
-precision: 8
-logbx1520 logb 1E+999999999 -> 1.0000000E+9 Inexact Rounded
-logbx1521 logb 1E-999999999 -> -1.0000000E+9 Inexact Rounded
-precision: 9
-logbx1523 logb 1E+999999999 -> 999999999
-logbx1524 logb 1E-999999999 -> -999999999
-
--- special values
-precision: 9
-logbx820 logb Infinity -> Infinity
-logbx821 logb -Infinity -> Infinity
-logbx822 logb 0 -> -Infinity Division_by_zero
-logbx823 logb NaN -> NaN
-logbx824 logb sNaN -> NaN Invalid_operation
--- propagating NaNs
-logbx825 logb sNaN123 -> NaN123 Invalid_operation
-logbx826 logb -sNaN321 -> -NaN321 Invalid_operation
-logbx827 logb NaN456 -> NaN456
-logbx828 logb -NaN654 -> -NaN654
-logbx829 logb NaN1 -> NaN1
-
--- Null test
-logbx900 logb # -> NaN Invalid_operation
-
-
+------------------------------------------------------------------------
+-- logb.decTest -- return integral adjusted exponent as per 754r --
+-- Copyright (c) IBM Corporation, 2005, 2009. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This emphasises the testing of notable cases, as they will often
+-- have unusual paths (especially the 10**n results).
+
+extended: 1
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+
+-- basics & examples
+precision: 9
+logbx001 logb 0 -> -Infinity Division_by_zero
+logbx002 logb 1E-999 -> -999
+logbx003 logb 9E-999 -> -999
+logbx004 logb 0.001 -> -3
+logbx005 logb 0.03 -> -2
+logbx006 logb 1 -> 0
+logbx007 logb 2 -> 0
+logbx008 logb 2.5 -> 0
+logbx009 logb 2.50 -> 0
+logbx010 logb 10 -> 1
+logbx011 logb 70 -> 1
+logbx012 logb 100 -> 2
+logbx013 logb 250 -> 2
+logbx014 logb +Infinity -> Infinity
+
+-- negatives are treated as positives
+logbx021 logb -0 -> -Infinity Division_by_zero
+logbx022 logb -1E-999 -> -999
+logbx023 logb -9E-999 -> -999
+logbx024 logb -0.001 -> -3
+logbx025 logb -1 -> 0
+logbx026 logb -2 -> 0
+logbx027 logb -10 -> 1
+logbx028 logb -70 -> 1
+logbx029 logb -100 -> 2
+logbx030 logb -100000000 -> 8
+logbx031 logb -Infinity -> Infinity
+
+-- zeros
+logbx111 logb 0 -> -Infinity Division_by_zero
+logbx112 logb -0 -> -Infinity Division_by_zero
+logbx113 logb 0E+4 -> -Infinity Division_by_zero
+logbx114 logb -0E+4 -> -Infinity Division_by_zero
+logbx115 logb 0.0000 -> -Infinity Division_by_zero
+logbx116 logb -0.0000 -> -Infinity Division_by_zero
+logbx117 logb 0E-141 -> -Infinity Division_by_zero
+logbx118 logb -0E-141 -> -Infinity Division_by_zero
+
+-- full coefficients, alternating bits
+logbx121 logb 268268268 -> 8
+logbx122 logb -268268268 -> 8
+logbx123 logb 134134134 -> 8
+logbx124 logb -134134134 -> 8
+
+-- Nmax, Nmin, Ntiny
+logbx131 logb 9.99999999E+999 -> 999
+logbx132 logb 1E-999 -> -999
+logbx133 logb 1.00000000E-999 -> -999
+logbx134 logb 1E-1007 -> -1007
+
+logbx135 logb -1E-1007 -> -1007
+logbx136 logb -1.00000000E-999 -> -999
+logbx137 logb -1E-999 -> -999
+logbx138 logb -9.99999999E+999 -> 999
+
+-- ones
+logbx0061 logb 1 -> 0
+logbx0062 logb 1.0 -> 0
+logbx0063 logb 1.000000000000000 -> 0
+logbx0064 logb 1.000000000000000000 -> 0
+
+-- notable cases -- exact powers of 10
+logbx1100 logb 1 -> 0
+logbx1101 logb 10 -> 1
+logbx1102 logb 100 -> 2
+logbx1103 logb 1000 -> 3
+logbx1104 logb 10000 -> 4
+logbx1105 logb 100000 -> 5
+logbx1106 logb 1000000 -> 6
+logbx1107 logb 10000000 -> 7
+logbx1108 logb 100000000 -> 8
+logbx1109 logb 1000000000 -> 9
+logbx1110 logb 10000000000 -> 10
+logbx1111 logb 100000000000 -> 11
+logbx1112 logb 1000000000000 -> 12
+logbx1113 logb 0.00000000001 -> -11
+logbx1114 logb 0.0000000001 -> -10
+logbx1115 logb 0.000000001 -> -9
+logbx1116 logb 0.00000001 -> -8
+logbx1117 logb 0.0000001 -> -7
+logbx1118 logb 0.000001 -> -6
+logbx1119 logb 0.00001 -> -5
+logbx1120 logb 0.0001 -> -4
+logbx1121 logb 0.001 -> -3
+logbx1122 logb 0.01 -> -2
+logbx1123 logb 0.1 -> -1
+logbx1124 logb 1E-99 -> -99
+logbx1125 logb 1E-100 -> -100
+logbx1126 logb 1E-383 -> -383
+logbx1127 logb 1E-999 -> -999
+
+-- suggestions from Ilan Nehama
+logbx1400 logb 10E-3 -> -2
+logbx1401 logb 10E-2 -> -1
+logbx1402 logb 100E-2 -> 0
+logbx1403 logb 1000E-2 -> 1
+logbx1404 logb 10000E-2 -> 2
+logbx1405 logb 10E-1 -> 0
+logbx1406 logb 100E-1 -> 1
+logbx1407 logb 1000E-1 -> 2
+logbx1408 logb 10000E-1 -> 3
+logbx1409 logb 10E0 -> 1
+logbx1410 logb 100E0 -> 2
+logbx1411 logb 1000E0 -> 3
+logbx1412 logb 10000E0 -> 4
+logbx1413 logb 10E1 -> 2
+logbx1414 logb 100E1 -> 3
+logbx1415 logb 1000E1 -> 4
+logbx1416 logb 10000E1 -> 5
+logbx1417 logb 10E2 -> 3
+logbx1418 logb 100E2 -> 4
+logbx1419 logb 1000E2 -> 5
+logbx1420 logb 10000E2 -> 6
+
+-- inexacts
+precision: 2
+logbx1500 logb 10000E2 -> 6
+logbx1501 logb 1E+99 -> 99
+logbx1502 logb 1E-99 -> -99
+logbx1503 logb 1E+100 -> 1.0E+2 Rounded
+logbx1504 logb 1E+999 -> 1.0E+3 Inexact Rounded
+logbx1505 logb 1E-100 -> -1.0E+2 Rounded
+logbx1506 logb 1E-999 -> -1.0E+3 Inexact Rounded
+logbx1507 logb 1E-1111 -> -1.1E+3 Inexact Rounded
+logbx1508 logb 1E-3333 -> -3.3E+3 Inexact Rounded
+logbx1509 logb 1E-6666 -> -6.7E+3 Inexact Rounded
+logbx1510 logb 1E+999999999 -> 1.0E+9 Inexact Rounded
+logbx1511 logb 1E-999999999 -> -1.0E+9 Inexact Rounded
+precision: 1
+logbx1517 logb 1E-1111 -> -1E+3 Inexact Rounded
+logbx1518 logb 1E-3333 -> -3E+3 Inexact Rounded
+logbx1519 logb 1E-6666 -> -7E+3 Inexact Rounded
+precision: 8
+logbx1520 logb 1E+999999999 -> 1.0000000E+9 Inexact Rounded
+logbx1521 logb 1E-999999999 -> -1.0000000E+9 Inexact Rounded
+precision: 9
+logbx1523 logb 1E+999999999 -> 999999999
+logbx1524 logb 1E-999999999 -> -999999999
+
+-- special values
+precision: 9
+logbx820 logb Infinity -> Infinity
+logbx821 logb -Infinity -> Infinity
+logbx822 logb 0 -> -Infinity Division_by_zero
+logbx823 logb NaN -> NaN
+logbx824 logb sNaN -> NaN Invalid_operation
+-- propagating NaNs
+logbx825 logb sNaN123 -> NaN123 Invalid_operation
+logbx826 logb -sNaN321 -> -NaN321 Invalid_operation
+logbx827 logb NaN456 -> NaN456
+logbx828 logb -NaN654 -> -NaN654
+logbx829 logb NaN1 -> NaN1
+
+-- Null test
+logbx900 logb # -> NaN Invalid_operation
+
+
diff --git a/Lib/test/decimaltestdata/maxmag.decTest b/Lib/test/decimaltestdata/maxmag.decTest
index 6b44213079..265e912ed4 100644
--- a/Lib/test/decimaltestdata/maxmag.decTest
+++ b/Lib/test/decimaltestdata/maxmag.decTest
@@ -1,404 +1,404 @@
-------------------------------------------------------------------------
--- maxmag.decTest -- decimal maximum by magnitude --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- sanity checks
-mxgx001 maxmag -2 -2 -> -2
-mxgx002 maxmag -2 -1 -> -2
-mxgx003 maxmag -2 0 -> -2
-mxgx004 maxmag -2 1 -> -2
-mxgx005 maxmag -2 2 -> 2
-mxgx006 maxmag -1 -2 -> -2
-mxgx007 maxmag -1 -1 -> -1
-mxgx008 maxmag -1 0 -> -1
-mxgx009 maxmag -1 1 -> 1
-mxgx010 maxmag -1 2 -> 2
-mxgx011 maxmag 0 -2 -> -2
-mxgx012 maxmag 0 -1 -> -1
-mxgx013 maxmag 0 0 -> 0
-mxgx014 maxmag 0 1 -> 1
-mxgx015 maxmag 0 2 -> 2
-mxgx016 maxmag 1 -2 -> -2
-mxgx017 maxmag 1 -1 -> 1
-mxgx018 maxmag 1 0 -> 1
-mxgx019 maxmag 1 1 -> 1
-mxgx020 maxmag 1 2 -> 2
-mxgx021 maxmag 2 -2 -> 2
-mxgx022 maxmag 2 -1 -> 2
-mxgx023 maxmag 2 0 -> 2
-mxgx025 maxmag 2 1 -> 2
-mxgx026 maxmag 2 2 -> 2
-
--- extended zeros
-mxgx030 maxmag 0 0 -> 0
-mxgx031 maxmag 0 -0 -> 0
-mxgx032 maxmag 0 -0.0 -> 0
-mxgx033 maxmag 0 0.0 -> 0
-mxgx034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
-mxgx035 maxmag -0 -0 -> -0
-mxgx036 maxmag -0 -0.0 -> -0.0
-mxgx037 maxmag -0 0.0 -> 0.0
-mxgx038 maxmag 0.0 0 -> 0
-mxgx039 maxmag 0.0 -0 -> 0.0
-mxgx040 maxmag 0.0 -0.0 -> 0.0
-mxgx041 maxmag 0.0 0.0 -> 0.0
-mxgx042 maxmag -0.0 0 -> 0
-mxgx043 maxmag -0.0 -0 -> -0.0
-mxgx044 maxmag -0.0 -0.0 -> -0.0
-mxgx045 maxmag -0.0 0.0 -> 0.0
-
-mxgx050 maxmag -0E1 0E1 -> 0E+1
-mxgx051 maxmag -0E2 0E2 -> 0E+2
-mxgx052 maxmag -0E2 0E1 -> 0E+1
-mxgx053 maxmag -0E1 0E2 -> 0E+2
-mxgx054 maxmag 0E1 -0E1 -> 0E+1
-mxgx055 maxmag 0E2 -0E2 -> 0E+2
-mxgx056 maxmag 0E2 -0E1 -> 0E+2
-mxgx057 maxmag 0E1 -0E2 -> 0E+1
-
-mxgx058 maxmag 0E1 0E1 -> 0E+1
-mxgx059 maxmag 0E2 0E2 -> 0E+2
-mxgx060 maxmag 0E2 0E1 -> 0E+2
-mxgx061 maxmag 0E1 0E2 -> 0E+2
-mxgx062 maxmag -0E1 -0E1 -> -0E+1
-mxgx063 maxmag -0E2 -0E2 -> -0E+2
-mxgx064 maxmag -0E2 -0E1 -> -0E+1
-mxgx065 maxmag -0E1 -0E2 -> -0E+1
-
--- Specials
-precision: 9
-mxgx090 maxmag Inf -Inf -> Infinity
-mxgx091 maxmag Inf -1000 -> Infinity
-mxgx092 maxmag Inf -1 -> Infinity
-mxgx093 maxmag Inf -0 -> Infinity
-mxgx094 maxmag Inf 0 -> Infinity
-mxgx095 maxmag Inf 1 -> Infinity
-mxgx096 maxmag Inf 1000 -> Infinity
-mxgx097 maxmag Inf Inf -> Infinity
-mxgx098 maxmag -1000 Inf -> Infinity
-mxgx099 maxmag -Inf Inf -> Infinity
-mxgx100 maxmag -1 Inf -> Infinity
-mxgx101 maxmag -0 Inf -> Infinity
-mxgx102 maxmag 0 Inf -> Infinity
-mxgx103 maxmag 1 Inf -> Infinity
-mxgx104 maxmag 1000 Inf -> Infinity
-mxgx105 maxmag Inf Inf -> Infinity
-
-mxgx120 maxmag -Inf -Inf -> -Infinity
-mxgx121 maxmag -Inf -1000 -> -Infinity
-mxgx122 maxmag -Inf -1 -> -Infinity
-mxgx123 maxmag -Inf -0 -> -Infinity
-mxgx124 maxmag -Inf 0 -> -Infinity
-mxgx125 maxmag -Inf 1 -> -Infinity
-mxgx126 maxmag -Inf 1000 -> -Infinity
-mxgx127 maxmag -Inf Inf -> Infinity
-mxgx128 maxmag -Inf -Inf -> -Infinity
-mxgx129 maxmag -1000 -Inf -> -Infinity
-mxgx130 maxmag -1 -Inf -> -Infinity
-mxgx131 maxmag -0 -Inf -> -Infinity
-mxgx132 maxmag 0 -Inf -> -Infinity
-mxgx133 maxmag 1 -Inf -> -Infinity
-mxgx134 maxmag 1000 -Inf -> -Infinity
-mxgx135 maxmag Inf -Inf -> Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-mxgx141 maxmag NaN -Inf -> -Infinity
-mxgx142 maxmag NaN -1000 -> -1000
-mxgx143 maxmag NaN -1 -> -1
-mxgx144 maxmag NaN -0 -> -0
-mxgx145 maxmag NaN 0 -> 0
-mxgx146 maxmag NaN 1 -> 1
-mxgx147 maxmag NaN 1000 -> 1000
-mxgx148 maxmag NaN Inf -> Infinity
-mxgx149 maxmag NaN NaN -> NaN
-mxgx150 maxmag -Inf NaN -> -Infinity
-mxgx151 maxmag -1000 NaN -> -1000
-mxgx152 maxmag -1 NaN -> -1
-mxgx153 maxmag -0 NaN -> -0
-mxgx154 maxmag 0 NaN -> 0
-mxgx155 maxmag 1 NaN -> 1
-mxgx156 maxmag 1000 NaN -> 1000
-mxgx157 maxmag Inf NaN -> Infinity
-
-mxgx161 maxmag sNaN -Inf -> NaN Invalid_operation
-mxgx162 maxmag sNaN -1000 -> NaN Invalid_operation
-mxgx163 maxmag sNaN -1 -> NaN Invalid_operation
-mxgx164 maxmag sNaN -0 -> NaN Invalid_operation
-mxgx165 maxmag sNaN 0 -> NaN Invalid_operation
-mxgx166 maxmag sNaN 1 -> NaN Invalid_operation
-mxgx167 maxmag sNaN 1000 -> NaN Invalid_operation
-mxgx168 maxmag sNaN NaN -> NaN Invalid_operation
-mxgx169 maxmag sNaN sNaN -> NaN Invalid_operation
-mxgx170 maxmag NaN sNaN -> NaN Invalid_operation
-mxgx171 maxmag -Inf sNaN -> NaN Invalid_operation
-mxgx172 maxmag -1000 sNaN -> NaN Invalid_operation
-mxgx173 maxmag -1 sNaN -> NaN Invalid_operation
-mxgx174 maxmag -0 sNaN -> NaN Invalid_operation
-mxgx175 maxmag 0 sNaN -> NaN Invalid_operation
-mxgx176 maxmag 1 sNaN -> NaN Invalid_operation
-mxgx177 maxmag 1000 sNaN -> NaN Invalid_operation
-mxgx178 maxmag Inf sNaN -> NaN Invalid_operation
-mxgx179 maxmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-mxgx181 maxmag NaN9 -Inf -> -Infinity
-mxgx182 maxmag NaN8 9 -> 9
-mxgx183 maxmag -NaN7 Inf -> Infinity
-
-mxgx184 maxmag -NaN1 NaN11 -> -NaN1
-mxgx185 maxmag NaN2 NaN12 -> NaN2
-mxgx186 maxmag -NaN13 -NaN7 -> -NaN13
-mxgx187 maxmag NaN14 -NaN5 -> NaN14
-
-mxgx188 maxmag -Inf NaN4 -> -Infinity
-mxgx189 maxmag -9 -NaN3 -> -9
-mxgx190 maxmag Inf NaN2 -> Infinity
-
-mxgx191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
-mxgx192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
-mxgx193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
-mxgx194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
-mxgx195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
-mxgx196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
-mxgx197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
-mxgx198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
-mxgx199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
-
--- rounding checks
-maxexponent: 999
-minexponent: -999
-precision: 9
-mxgx201 maxmag 12345678000 1 -> 1.23456780E+10 Rounded
-mxgx202 maxmag 1 12345678000 -> 1.23456780E+10 Rounded
-mxgx203 maxmag 1234567800 1 -> 1.23456780E+9 Rounded
-mxgx204 maxmag 1 1234567800 -> 1.23456780E+9 Rounded
-mxgx205 maxmag 1234567890 1 -> 1.23456789E+9 Rounded
-mxgx206 maxmag 1 1234567890 -> 1.23456789E+9 Rounded
-mxgx207 maxmag 1234567891 1 -> 1.23456789E+9 Inexact Rounded
-mxgx208 maxmag 1 1234567891 -> 1.23456789E+9 Inexact Rounded
-mxgx209 maxmag 12345678901 1 -> 1.23456789E+10 Inexact Rounded
-mxgx210 maxmag 1 12345678901 -> 1.23456789E+10 Inexact Rounded
-mxgx211 maxmag 1234567896 1 -> 1.23456790E+9 Inexact Rounded
-mxgx212 maxmag 1 1234567896 -> 1.23456790E+9 Inexact Rounded
-mxgx213 maxmag -1234567891 1 -> -1.23456789E+9 Inexact Rounded
-mxgx214 maxmag 1 -1234567891 -> -1.23456789E+9 Inexact Rounded
-mxgx215 maxmag -12345678901 1 -> -1.23456789E+10 Inexact Rounded
-mxgx216 maxmag 1 -12345678901 -> -1.23456789E+10 Inexact Rounded
-mxgx217 maxmag -1234567896 1 -> -1.23456790E+9 Inexact Rounded
-mxgx218 maxmag 1 -1234567896 -> -1.23456790E+9 Inexact Rounded
-
-precision: 15
-mxgx221 maxmag 12345678000 1 -> 12345678000
-mxgx222 maxmag 1 12345678000 -> 12345678000
-mxgx223 maxmag 1234567800 1 -> 1234567800
-mxgx224 maxmag 1 1234567800 -> 1234567800
-mxgx225 maxmag 1234567890 1 -> 1234567890
-mxgx226 maxmag 1 1234567890 -> 1234567890
-mxgx227 maxmag 1234567891 1 -> 1234567891
-mxgx228 maxmag 1 1234567891 -> 1234567891
-mxgx229 maxmag 12345678901 1 -> 12345678901
-mxgx230 maxmag 1 12345678901 -> 12345678901
-mxgx231 maxmag 1234567896 1 -> 1234567896
-mxgx232 maxmag 1 1234567896 -> 1234567896
-mxgx233 maxmag -1234567891 1 -> -1234567891
-mxgx234 maxmag 1 -1234567891 -> -1234567891
-mxgx235 maxmag -12345678901 1 -> -12345678901
-mxgx236 maxmag 1 -12345678901 -> -12345678901
-mxgx237 maxmag -1234567896 1 -> -1234567896
-mxgx238 maxmag 1 -1234567896 -> -1234567896
-
--- from examples
-mxgx280 maxmag '3' '2' -> '3'
-mxgx281 maxmag '-10' '3' -> '-10'
-mxgx282 maxmag '1.0' '1' -> '1'
-mxgx283 maxmag '1' '1.0' -> '1'
-mxgx284 maxmag '7' 'NaN' -> '7'
-
--- overflow and underflow tests ...
-maxExponent: 999999999
-minexponent: -999999999
-mxgx330 maxmag +1.23456789012345E-0 9E+999999999 -> 9E+999999999
-mxgx331 maxmag 9E+999999999 +1.23456789012345E-0 -> 9E+999999999
-mxgx332 maxmag +0.100 9E-999999999 -> 0.100
-mxgx333 maxmag 9E-999999999 +0.100 -> 0.100
-mxgx335 maxmag -1.23456789012345E-0 9E+999999999 -> 9E+999999999
-mxgx336 maxmag 9E+999999999 -1.23456789012345E-0 -> 9E+999999999
-mxgx337 maxmag -0.100 9E-999999999 -> -0.100
-mxgx338 maxmag 9E-999999999 -0.100 -> -0.100
-
-mxgx339 maxmag 1e-599999999 1e-400000001 -> 1E-400000001
-mxgx340 maxmag 1e-599999999 1e-400000000 -> 1E-400000000
-mxgx341 maxmag 1e-600000000 1e-400000000 -> 1E-400000000
-mxgx342 maxmag 9e-999999998 0.01 -> 0.01
-mxgx343 maxmag 9e-999999998 0.1 -> 0.1
-mxgx344 maxmag 0.01 9e-999999998 -> 0.01
-mxgx345 maxmag 1e599999999 1e400000001 -> 1E+599999999
-mxgx346 maxmag 1e599999999 1e400000000 -> 1E+599999999
-mxgx347 maxmag 1e600000000 1e400000000 -> 1E+600000000
-mxgx348 maxmag 9e999999998 100 -> 9E+999999998
-mxgx349 maxmag 9e999999998 10 -> 9E+999999998
-mxgx350 maxmag 100 9e999999998 -> 9E+999999998
--- signs
-mxgx351 maxmag 1e+777777777 1e+411111111 -> 1E+777777777
-mxgx352 maxmag 1e+777777777 -1e+411111111 -> 1E+777777777
-mxgx353 maxmag -1e+777777777 1e+411111111 -> -1E+777777777
-mxgx354 maxmag -1e+777777777 -1e+411111111 -> -1E+777777777
-mxgx355 maxmag 1e-777777777 1e-411111111 -> 1E-411111111
-mxgx356 maxmag 1e-777777777 -1e-411111111 -> -1E-411111111
-mxgx357 maxmag -1e-777777777 1e-411111111 -> 1E-411111111
-mxgx358 maxmag -1e-777777777 -1e-411111111 -> -1E-411111111
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-mxgx401 maxmag Inf 1.1 -> Infinity
-mxgx402 maxmag 1.1 1 -> 1.1
-mxgx403 maxmag 1 1.0 -> 1
-mxgx404 maxmag 1.0 0.1 -> 1.0
-mxgx405 maxmag 0.1 0.10 -> 0.1
-mxgx406 maxmag 0.10 0.100 -> 0.10
-mxgx407 maxmag 0.10 0 -> 0.10
-mxgx408 maxmag 0 0.0 -> 0
-mxgx409 maxmag 0.0 -0 -> 0.0
-mxgx410 maxmag 0.0 -0.0 -> 0.0
-mxgx411 maxmag 0.00 -0.0 -> 0.00
-mxgx412 maxmag 0.0 -0.00 -> 0.0
-mxgx413 maxmag 0 -0.0 -> 0
-mxgx414 maxmag 0 -0 -> 0
-mxgx415 maxmag -0.0 -0 -> -0.0
-mxgx416 maxmag -0 -0.100 -> -0.100
-mxgx417 maxmag -0.100 -0.10 -> -0.100
-mxgx418 maxmag -0.10 -0.1 -> -0.10
-mxgx419 maxmag -0.1 -1.0 -> -1.0
-mxgx420 maxmag -1.0 -1 -> -1.0
-mxgx421 maxmag -1 -1.1 -> -1.1
-mxgx423 maxmag -1.1 -Inf -> -Infinity
--- same with operands reversed
-mxgx431 maxmag 1.1 Inf -> Infinity
-mxgx432 maxmag 1 1.1 -> 1.1
-mxgx433 maxmag 1.0 1 -> 1
-mxgx434 maxmag 0.1 1.0 -> 1.0
-mxgx435 maxmag 0.10 0.1 -> 0.1
-mxgx436 maxmag 0.100 0.10 -> 0.10
-mxgx437 maxmag 0 0.10 -> 0.10
-mxgx438 maxmag 0.0 0 -> 0
-mxgx439 maxmag -0 0.0 -> 0.0
-mxgx440 maxmag -0.0 0.0 -> 0.0
-mxgx441 maxmag -0.0 0.00 -> 0.00
-mxgx442 maxmag -0.00 0.0 -> 0.0
-mxgx443 maxmag -0.0 0 -> 0
-mxgx444 maxmag -0 0 -> 0
-mxgx445 maxmag -0 -0.0 -> -0.0
-mxgx446 maxmag -0.100 -0 -> -0.100
-mxgx447 maxmag -0.10 -0.100 -> -0.100
-mxgx448 maxmag -0.1 -0.10 -> -0.10
-mxgx449 maxmag -1.0 -0.1 -> -1.0
-mxgx450 maxmag -1 -1.0 -> -1.0
-mxgx451 maxmag -1.1 -1 -> -1.1
-mxgx453 maxmag -Inf -1.1 -> -Infinity
--- largies
-mxgx460 maxmag 1000 1E+3 -> 1E+3
-mxgx461 maxmag 1E+3 1000 -> 1E+3
-mxgx462 maxmag 1000 -1E+3 -> 1000
-mxgx463 maxmag 1E+3 -1000 -> 1E+3
-mxgx464 maxmag -1000 1E+3 -> 1E+3
-mxgx465 maxmag -1E+3 1000 -> 1000
-mxgx466 maxmag -1000 -1E+3 -> -1000
-mxgx467 maxmag -1E+3 -1000 -> -1000
-
--- rounding (results treated as though plus)
-maxexponent: 999999999
-minexponent: -999999999
-precision: 3
-
-mxgx470 maxmag 1 .5 -> 1
-mxgx471 maxmag 10 5 -> 10
-mxgx472 maxmag 100 50 -> 100
-mxgx473 maxmag 1000 500 -> 1.00E+3 Rounded
-mxgx474 maxmag 10000 5000 -> 1.00E+4 Rounded
-mxgx475 maxmag 6 .5 -> 6
-mxgx476 maxmag 66 5 -> 66
-mxgx477 maxmag 666 50 -> 666
-mxgx478 maxmag 6666 500 -> 6.67E+3 Rounded Inexact
-mxgx479 maxmag 66666 5000 -> 6.67E+4 Rounded Inexact
-mxgx480 maxmag 33333 5000 -> 3.33E+4 Rounded Inexact
-mxgx481 maxmag .5 1 -> 1
-mxgx482 maxmag .5 10 -> 10
-mxgx483 maxmag .5 100 -> 100
-mxgx484 maxmag .5 1000 -> 1.00E+3 Rounded
-mxgx485 maxmag .5 10000 -> 1.00E+4 Rounded
-mxgx486 maxmag .5 6 -> 6
-mxgx487 maxmag .5 66 -> 66
-mxgx488 maxmag .5 666 -> 666
-mxgx489 maxmag .5 6666 -> 6.67E+3 Rounded Inexact
-mxgx490 maxmag .5 66666 -> 6.67E+4 Rounded Inexact
-mxgx491 maxmag .5 33333 -> 3.33E+4 Rounded Inexact
-
--- overflow tests
-maxexponent: 999999999
-minexponent: -999999999
-precision: 3
-mxgx500 maxmag 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded
-mxgx501 maxmag -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded
-
--- subnormals and underflow
-precision: 3
-maxexponent: 999
-minexponent: -999
-mxgx510 maxmag 1.00E-999 0 -> 1.00E-999
-mxgx511 maxmag 0.1E-999 0 -> 1E-1000 Subnormal
-mxgx512 maxmag 0.10E-999 0 -> 1.0E-1000 Subnormal
-mxgx513 maxmag 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded
-mxgx514 maxmag 0.01E-999 0 -> 1E-1001 Subnormal
--- next is rounded to Nmin
-mxgx515 maxmag 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow
-mxgx516 maxmag 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
-mxgx517 maxmag 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow
-mxgx518 maxmag 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-mxgx519 maxmag 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-mxgx520 maxmag 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
-
-mxgx530 maxmag -1.00E-999 0 -> -1.00E-999
-mxgx531 maxmag -0.1E-999 0 -> -1E-1000 Subnormal
-mxgx532 maxmag -0.10E-999 0 -> -1.0E-1000 Subnormal
-mxgx533 maxmag -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded
-mxgx534 maxmag -0.01E-999 0 -> -1E-1001 Subnormal
--- next is rounded to -Nmin
-mxgx535 maxmag -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow
-mxgx536 maxmag -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
-mxgx537 maxmag -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow
-mxgx538 maxmag -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-mxgx539 maxmag -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-mxgx540 maxmag -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
-
--- Null tests
-mxgx900 maxmag 10 # -> NaN Invalid_operation
-mxgx901 maxmag # 10 -> NaN Invalid_operation
-
-
-
+------------------------------------------------------------------------
+-- maxmag.decTest -- decimal maximum by magnitude --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- sanity checks
+mxgx001 maxmag -2 -2 -> -2
+mxgx002 maxmag -2 -1 -> -2
+mxgx003 maxmag -2 0 -> -2
+mxgx004 maxmag -2 1 -> -2
+mxgx005 maxmag -2 2 -> 2
+mxgx006 maxmag -1 -2 -> -2
+mxgx007 maxmag -1 -1 -> -1
+mxgx008 maxmag -1 0 -> -1
+mxgx009 maxmag -1 1 -> 1
+mxgx010 maxmag -1 2 -> 2
+mxgx011 maxmag 0 -2 -> -2
+mxgx012 maxmag 0 -1 -> -1
+mxgx013 maxmag 0 0 -> 0
+mxgx014 maxmag 0 1 -> 1
+mxgx015 maxmag 0 2 -> 2
+mxgx016 maxmag 1 -2 -> -2
+mxgx017 maxmag 1 -1 -> 1
+mxgx018 maxmag 1 0 -> 1
+mxgx019 maxmag 1 1 -> 1
+mxgx020 maxmag 1 2 -> 2
+mxgx021 maxmag 2 -2 -> 2
+mxgx022 maxmag 2 -1 -> 2
+mxgx023 maxmag 2 0 -> 2
+mxgx025 maxmag 2 1 -> 2
+mxgx026 maxmag 2 2 -> 2
+
+-- extended zeros
+mxgx030 maxmag 0 0 -> 0
+mxgx031 maxmag 0 -0 -> 0
+mxgx032 maxmag 0 -0.0 -> 0
+mxgx033 maxmag 0 0.0 -> 0
+mxgx034 maxmag -0 0 -> 0 -- note: -0 = 0, but 0 chosen
+mxgx035 maxmag -0 -0 -> -0
+mxgx036 maxmag -0 -0.0 -> -0.0
+mxgx037 maxmag -0 0.0 -> 0.0
+mxgx038 maxmag 0.0 0 -> 0
+mxgx039 maxmag 0.0 -0 -> 0.0
+mxgx040 maxmag 0.0 -0.0 -> 0.0
+mxgx041 maxmag 0.0 0.0 -> 0.0
+mxgx042 maxmag -0.0 0 -> 0
+mxgx043 maxmag -0.0 -0 -> -0.0
+mxgx044 maxmag -0.0 -0.0 -> -0.0
+mxgx045 maxmag -0.0 0.0 -> 0.0
+
+mxgx050 maxmag -0E1 0E1 -> 0E+1
+mxgx051 maxmag -0E2 0E2 -> 0E+2
+mxgx052 maxmag -0E2 0E1 -> 0E+1
+mxgx053 maxmag -0E1 0E2 -> 0E+2
+mxgx054 maxmag 0E1 -0E1 -> 0E+1
+mxgx055 maxmag 0E2 -0E2 -> 0E+2
+mxgx056 maxmag 0E2 -0E1 -> 0E+2
+mxgx057 maxmag 0E1 -0E2 -> 0E+1
+
+mxgx058 maxmag 0E1 0E1 -> 0E+1
+mxgx059 maxmag 0E2 0E2 -> 0E+2
+mxgx060 maxmag 0E2 0E1 -> 0E+2
+mxgx061 maxmag 0E1 0E2 -> 0E+2
+mxgx062 maxmag -0E1 -0E1 -> -0E+1
+mxgx063 maxmag -0E2 -0E2 -> -0E+2
+mxgx064 maxmag -0E2 -0E1 -> -0E+1
+mxgx065 maxmag -0E1 -0E2 -> -0E+1
+
+-- Specials
+precision: 9
+mxgx090 maxmag Inf -Inf -> Infinity
+mxgx091 maxmag Inf -1000 -> Infinity
+mxgx092 maxmag Inf -1 -> Infinity
+mxgx093 maxmag Inf -0 -> Infinity
+mxgx094 maxmag Inf 0 -> Infinity
+mxgx095 maxmag Inf 1 -> Infinity
+mxgx096 maxmag Inf 1000 -> Infinity
+mxgx097 maxmag Inf Inf -> Infinity
+mxgx098 maxmag -1000 Inf -> Infinity
+mxgx099 maxmag -Inf Inf -> Infinity
+mxgx100 maxmag -1 Inf -> Infinity
+mxgx101 maxmag -0 Inf -> Infinity
+mxgx102 maxmag 0 Inf -> Infinity
+mxgx103 maxmag 1 Inf -> Infinity
+mxgx104 maxmag 1000 Inf -> Infinity
+mxgx105 maxmag Inf Inf -> Infinity
+
+mxgx120 maxmag -Inf -Inf -> -Infinity
+mxgx121 maxmag -Inf -1000 -> -Infinity
+mxgx122 maxmag -Inf -1 -> -Infinity
+mxgx123 maxmag -Inf -0 -> -Infinity
+mxgx124 maxmag -Inf 0 -> -Infinity
+mxgx125 maxmag -Inf 1 -> -Infinity
+mxgx126 maxmag -Inf 1000 -> -Infinity
+mxgx127 maxmag -Inf Inf -> Infinity
+mxgx128 maxmag -Inf -Inf -> -Infinity
+mxgx129 maxmag -1000 -Inf -> -Infinity
+mxgx130 maxmag -1 -Inf -> -Infinity
+mxgx131 maxmag -0 -Inf -> -Infinity
+mxgx132 maxmag 0 -Inf -> -Infinity
+mxgx133 maxmag 1 -Inf -> -Infinity
+mxgx134 maxmag 1000 -Inf -> -Infinity
+mxgx135 maxmag Inf -Inf -> Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+mxgx141 maxmag NaN -Inf -> -Infinity
+mxgx142 maxmag NaN -1000 -> -1000
+mxgx143 maxmag NaN -1 -> -1
+mxgx144 maxmag NaN -0 -> -0
+mxgx145 maxmag NaN 0 -> 0
+mxgx146 maxmag NaN 1 -> 1
+mxgx147 maxmag NaN 1000 -> 1000
+mxgx148 maxmag NaN Inf -> Infinity
+mxgx149 maxmag NaN NaN -> NaN
+mxgx150 maxmag -Inf NaN -> -Infinity
+mxgx151 maxmag -1000 NaN -> -1000
+mxgx152 maxmag -1 NaN -> -1
+mxgx153 maxmag -0 NaN -> -0
+mxgx154 maxmag 0 NaN -> 0
+mxgx155 maxmag 1 NaN -> 1
+mxgx156 maxmag 1000 NaN -> 1000
+mxgx157 maxmag Inf NaN -> Infinity
+
+mxgx161 maxmag sNaN -Inf -> NaN Invalid_operation
+mxgx162 maxmag sNaN -1000 -> NaN Invalid_operation
+mxgx163 maxmag sNaN -1 -> NaN Invalid_operation
+mxgx164 maxmag sNaN -0 -> NaN Invalid_operation
+mxgx165 maxmag sNaN 0 -> NaN Invalid_operation
+mxgx166 maxmag sNaN 1 -> NaN Invalid_operation
+mxgx167 maxmag sNaN 1000 -> NaN Invalid_operation
+mxgx168 maxmag sNaN NaN -> NaN Invalid_operation
+mxgx169 maxmag sNaN sNaN -> NaN Invalid_operation
+mxgx170 maxmag NaN sNaN -> NaN Invalid_operation
+mxgx171 maxmag -Inf sNaN -> NaN Invalid_operation
+mxgx172 maxmag -1000 sNaN -> NaN Invalid_operation
+mxgx173 maxmag -1 sNaN -> NaN Invalid_operation
+mxgx174 maxmag -0 sNaN -> NaN Invalid_operation
+mxgx175 maxmag 0 sNaN -> NaN Invalid_operation
+mxgx176 maxmag 1 sNaN -> NaN Invalid_operation
+mxgx177 maxmag 1000 sNaN -> NaN Invalid_operation
+mxgx178 maxmag Inf sNaN -> NaN Invalid_operation
+mxgx179 maxmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+mxgx181 maxmag NaN9 -Inf -> -Infinity
+mxgx182 maxmag NaN8 9 -> 9
+mxgx183 maxmag -NaN7 Inf -> Infinity
+
+mxgx184 maxmag -NaN1 NaN11 -> -NaN1
+mxgx185 maxmag NaN2 NaN12 -> NaN2
+mxgx186 maxmag -NaN13 -NaN7 -> -NaN13
+mxgx187 maxmag NaN14 -NaN5 -> NaN14
+
+mxgx188 maxmag -Inf NaN4 -> -Infinity
+mxgx189 maxmag -9 -NaN3 -> -9
+mxgx190 maxmag Inf NaN2 -> Infinity
+
+mxgx191 maxmag sNaN99 -Inf -> NaN99 Invalid_operation
+mxgx192 maxmag sNaN98 -1 -> NaN98 Invalid_operation
+mxgx193 maxmag -sNaN97 NaN -> -NaN97 Invalid_operation
+mxgx194 maxmag sNaN96 sNaN94 -> NaN96 Invalid_operation
+mxgx195 maxmag NaN95 sNaN93 -> NaN93 Invalid_operation
+mxgx196 maxmag -Inf sNaN92 -> NaN92 Invalid_operation
+mxgx197 maxmag 0 sNaN91 -> NaN91 Invalid_operation
+mxgx198 maxmag Inf -sNaN90 -> -NaN90 Invalid_operation
+mxgx199 maxmag NaN sNaN89 -> NaN89 Invalid_operation
+
+-- rounding checks
+maxexponent: 999
+minexponent: -999
+precision: 9
+mxgx201 maxmag 12345678000 1 -> 1.23456780E+10 Rounded
+mxgx202 maxmag 1 12345678000 -> 1.23456780E+10 Rounded
+mxgx203 maxmag 1234567800 1 -> 1.23456780E+9 Rounded
+mxgx204 maxmag 1 1234567800 -> 1.23456780E+9 Rounded
+mxgx205 maxmag 1234567890 1 -> 1.23456789E+9 Rounded
+mxgx206 maxmag 1 1234567890 -> 1.23456789E+9 Rounded
+mxgx207 maxmag 1234567891 1 -> 1.23456789E+9 Inexact Rounded
+mxgx208 maxmag 1 1234567891 -> 1.23456789E+9 Inexact Rounded
+mxgx209 maxmag 12345678901 1 -> 1.23456789E+10 Inexact Rounded
+mxgx210 maxmag 1 12345678901 -> 1.23456789E+10 Inexact Rounded
+mxgx211 maxmag 1234567896 1 -> 1.23456790E+9 Inexact Rounded
+mxgx212 maxmag 1 1234567896 -> 1.23456790E+9 Inexact Rounded
+mxgx213 maxmag -1234567891 1 -> -1.23456789E+9 Inexact Rounded
+mxgx214 maxmag 1 -1234567891 -> -1.23456789E+9 Inexact Rounded
+mxgx215 maxmag -12345678901 1 -> -1.23456789E+10 Inexact Rounded
+mxgx216 maxmag 1 -12345678901 -> -1.23456789E+10 Inexact Rounded
+mxgx217 maxmag -1234567896 1 -> -1.23456790E+9 Inexact Rounded
+mxgx218 maxmag 1 -1234567896 -> -1.23456790E+9 Inexact Rounded
+
+precision: 15
+mxgx221 maxmag 12345678000 1 -> 12345678000
+mxgx222 maxmag 1 12345678000 -> 12345678000
+mxgx223 maxmag 1234567800 1 -> 1234567800
+mxgx224 maxmag 1 1234567800 -> 1234567800
+mxgx225 maxmag 1234567890 1 -> 1234567890
+mxgx226 maxmag 1 1234567890 -> 1234567890
+mxgx227 maxmag 1234567891 1 -> 1234567891
+mxgx228 maxmag 1 1234567891 -> 1234567891
+mxgx229 maxmag 12345678901 1 -> 12345678901
+mxgx230 maxmag 1 12345678901 -> 12345678901
+mxgx231 maxmag 1234567896 1 -> 1234567896
+mxgx232 maxmag 1 1234567896 -> 1234567896
+mxgx233 maxmag -1234567891 1 -> -1234567891
+mxgx234 maxmag 1 -1234567891 -> -1234567891
+mxgx235 maxmag -12345678901 1 -> -12345678901
+mxgx236 maxmag 1 -12345678901 -> -12345678901
+mxgx237 maxmag -1234567896 1 -> -1234567896
+mxgx238 maxmag 1 -1234567896 -> -1234567896
+
+-- from examples
+mxgx280 maxmag '3' '2' -> '3'
+mxgx281 maxmag '-10' '3' -> '-10'
+mxgx282 maxmag '1.0' '1' -> '1'
+mxgx283 maxmag '1' '1.0' -> '1'
+mxgx284 maxmag '7' 'NaN' -> '7'
+
+-- overflow and underflow tests ...
+maxExponent: 999999999
+minexponent: -999999999
+mxgx330 maxmag +1.23456789012345E-0 9E+999999999 -> 9E+999999999
+mxgx331 maxmag 9E+999999999 +1.23456789012345E-0 -> 9E+999999999
+mxgx332 maxmag +0.100 9E-999999999 -> 0.100
+mxgx333 maxmag 9E-999999999 +0.100 -> 0.100
+mxgx335 maxmag -1.23456789012345E-0 9E+999999999 -> 9E+999999999
+mxgx336 maxmag 9E+999999999 -1.23456789012345E-0 -> 9E+999999999
+mxgx337 maxmag -0.100 9E-999999999 -> -0.100
+mxgx338 maxmag 9E-999999999 -0.100 -> -0.100
+
+mxgx339 maxmag 1e-599999999 1e-400000001 -> 1E-400000001
+mxgx340 maxmag 1e-599999999 1e-400000000 -> 1E-400000000
+mxgx341 maxmag 1e-600000000 1e-400000000 -> 1E-400000000
+mxgx342 maxmag 9e-999999998 0.01 -> 0.01
+mxgx343 maxmag 9e-999999998 0.1 -> 0.1
+mxgx344 maxmag 0.01 9e-999999998 -> 0.01
+mxgx345 maxmag 1e599999999 1e400000001 -> 1E+599999999
+mxgx346 maxmag 1e599999999 1e400000000 -> 1E+599999999
+mxgx347 maxmag 1e600000000 1e400000000 -> 1E+600000000
+mxgx348 maxmag 9e999999998 100 -> 9E+999999998
+mxgx349 maxmag 9e999999998 10 -> 9E+999999998
+mxgx350 maxmag 100 9e999999998 -> 9E+999999998
+-- signs
+mxgx351 maxmag 1e+777777777 1e+411111111 -> 1E+777777777
+mxgx352 maxmag 1e+777777777 -1e+411111111 -> 1E+777777777
+mxgx353 maxmag -1e+777777777 1e+411111111 -> -1E+777777777
+mxgx354 maxmag -1e+777777777 -1e+411111111 -> -1E+777777777
+mxgx355 maxmag 1e-777777777 1e-411111111 -> 1E-411111111
+mxgx356 maxmag 1e-777777777 -1e-411111111 -> -1E-411111111
+mxgx357 maxmag -1e-777777777 1e-411111111 -> 1E-411111111
+mxgx358 maxmag -1e-777777777 -1e-411111111 -> -1E-411111111
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+mxgx401 maxmag Inf 1.1 -> Infinity
+mxgx402 maxmag 1.1 1 -> 1.1
+mxgx403 maxmag 1 1.0 -> 1
+mxgx404 maxmag 1.0 0.1 -> 1.0
+mxgx405 maxmag 0.1 0.10 -> 0.1
+mxgx406 maxmag 0.10 0.100 -> 0.10
+mxgx407 maxmag 0.10 0 -> 0.10
+mxgx408 maxmag 0 0.0 -> 0
+mxgx409 maxmag 0.0 -0 -> 0.0
+mxgx410 maxmag 0.0 -0.0 -> 0.0
+mxgx411 maxmag 0.00 -0.0 -> 0.00
+mxgx412 maxmag 0.0 -0.00 -> 0.0
+mxgx413 maxmag 0 -0.0 -> 0
+mxgx414 maxmag 0 -0 -> 0
+mxgx415 maxmag -0.0 -0 -> -0.0
+mxgx416 maxmag -0 -0.100 -> -0.100
+mxgx417 maxmag -0.100 -0.10 -> -0.100
+mxgx418 maxmag -0.10 -0.1 -> -0.10
+mxgx419 maxmag -0.1 -1.0 -> -1.0
+mxgx420 maxmag -1.0 -1 -> -1.0
+mxgx421 maxmag -1 -1.1 -> -1.1
+mxgx423 maxmag -1.1 -Inf -> -Infinity
+-- same with operands reversed
+mxgx431 maxmag 1.1 Inf -> Infinity
+mxgx432 maxmag 1 1.1 -> 1.1
+mxgx433 maxmag 1.0 1 -> 1
+mxgx434 maxmag 0.1 1.0 -> 1.0
+mxgx435 maxmag 0.10 0.1 -> 0.1
+mxgx436 maxmag 0.100 0.10 -> 0.10
+mxgx437 maxmag 0 0.10 -> 0.10
+mxgx438 maxmag 0.0 0 -> 0
+mxgx439 maxmag -0 0.0 -> 0.0
+mxgx440 maxmag -0.0 0.0 -> 0.0
+mxgx441 maxmag -0.0 0.00 -> 0.00
+mxgx442 maxmag -0.00 0.0 -> 0.0
+mxgx443 maxmag -0.0 0 -> 0
+mxgx444 maxmag -0 0 -> 0
+mxgx445 maxmag -0 -0.0 -> -0.0
+mxgx446 maxmag -0.100 -0 -> -0.100
+mxgx447 maxmag -0.10 -0.100 -> -0.100
+mxgx448 maxmag -0.1 -0.10 -> -0.10
+mxgx449 maxmag -1.0 -0.1 -> -1.0
+mxgx450 maxmag -1 -1.0 -> -1.0
+mxgx451 maxmag -1.1 -1 -> -1.1
+mxgx453 maxmag -Inf -1.1 -> -Infinity
+-- largies
+mxgx460 maxmag 1000 1E+3 -> 1E+3
+mxgx461 maxmag 1E+3 1000 -> 1E+3
+mxgx462 maxmag 1000 -1E+3 -> 1000
+mxgx463 maxmag 1E+3 -1000 -> 1E+3
+mxgx464 maxmag -1000 1E+3 -> 1E+3
+mxgx465 maxmag -1E+3 1000 -> 1000
+mxgx466 maxmag -1000 -1E+3 -> -1000
+mxgx467 maxmag -1E+3 -1000 -> -1000
+
+-- rounding (results treated as though plus)
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+
+mxgx470 maxmag 1 .5 -> 1
+mxgx471 maxmag 10 5 -> 10
+mxgx472 maxmag 100 50 -> 100
+mxgx473 maxmag 1000 500 -> 1.00E+3 Rounded
+mxgx474 maxmag 10000 5000 -> 1.00E+4 Rounded
+mxgx475 maxmag 6 .5 -> 6
+mxgx476 maxmag 66 5 -> 66
+mxgx477 maxmag 666 50 -> 666
+mxgx478 maxmag 6666 500 -> 6.67E+3 Rounded Inexact
+mxgx479 maxmag 66666 5000 -> 6.67E+4 Rounded Inexact
+mxgx480 maxmag 33333 5000 -> 3.33E+4 Rounded Inexact
+mxgx481 maxmag .5 1 -> 1
+mxgx482 maxmag .5 10 -> 10
+mxgx483 maxmag .5 100 -> 100
+mxgx484 maxmag .5 1000 -> 1.00E+3 Rounded
+mxgx485 maxmag .5 10000 -> 1.00E+4 Rounded
+mxgx486 maxmag .5 6 -> 6
+mxgx487 maxmag .5 66 -> 66
+mxgx488 maxmag .5 666 -> 666
+mxgx489 maxmag .5 6666 -> 6.67E+3 Rounded Inexact
+mxgx490 maxmag .5 66666 -> 6.67E+4 Rounded Inexact
+mxgx491 maxmag .5 33333 -> 3.33E+4 Rounded Inexact
+
+-- overflow tests
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+mxgx500 maxmag 9.999E+999999999 0 -> Infinity Inexact Overflow Rounded
+mxgx501 maxmag -9.999E+999999999 0 -> -Infinity Inexact Overflow Rounded
+
+-- subnormals and underflow
+precision: 3
+maxexponent: 999
+minexponent: -999
+mxgx510 maxmag 1.00E-999 0 -> 1.00E-999
+mxgx511 maxmag 0.1E-999 0 -> 1E-1000 Subnormal
+mxgx512 maxmag 0.10E-999 0 -> 1.0E-1000 Subnormal
+mxgx513 maxmag 0.100E-999 0 -> 1.0E-1000 Subnormal Rounded
+mxgx514 maxmag 0.01E-999 0 -> 1E-1001 Subnormal
+-- next is rounded to Nmin
+mxgx515 maxmag 0.999E-999 0 -> 1.00E-999 Inexact Rounded Subnormal Underflow
+mxgx516 maxmag 0.099E-999 0 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
+mxgx517 maxmag 0.009E-999 0 -> 1E-1001 Inexact Rounded Subnormal Underflow
+mxgx518 maxmag 0.001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+mxgx519 maxmag 0.0009E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+mxgx520 maxmag 0.0001E-999 0 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
+
+mxgx530 maxmag -1.00E-999 0 -> -1.00E-999
+mxgx531 maxmag -0.1E-999 0 -> -1E-1000 Subnormal
+mxgx532 maxmag -0.10E-999 0 -> -1.0E-1000 Subnormal
+mxgx533 maxmag -0.100E-999 0 -> -1.0E-1000 Subnormal Rounded
+mxgx534 maxmag -0.01E-999 0 -> -1E-1001 Subnormal
+-- next is rounded to -Nmin
+mxgx535 maxmag -0.999E-999 0 -> -1.00E-999 Inexact Rounded Subnormal Underflow
+mxgx536 maxmag -0.099E-999 0 -> -1.0E-1000 Inexact Rounded Subnormal Underflow
+mxgx537 maxmag -0.009E-999 0 -> -1E-1001 Inexact Rounded Subnormal Underflow
+mxgx538 maxmag -0.001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+mxgx539 maxmag -0.0009E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+mxgx540 maxmag -0.0001E-999 0 -> -0E-1001 Inexact Rounded Subnormal Underflow Clamped
+
+-- Null tests
+mxgx900 maxmag 10 # -> NaN Invalid_operation
+mxgx901 maxmag # 10 -> NaN Invalid_operation
+
+
+
diff --git a/Lib/test/decimaltestdata/minmag.decTest b/Lib/test/decimaltestdata/minmag.decTest
index 9e562339eb..f1ac3852e8 100644
--- a/Lib/test/decimaltestdata/minmag.decTest
+++ b/Lib/test/decimaltestdata/minmag.decTest
@@ -1,390 +1,390 @@
-------------------------------------------------------------------------
--- minmag.decTest -- decimal minimum by magnitude --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- we assume that base comparison is tested in compare.decTest, so
--- these mainly cover special cases and rounding
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- sanity checks
-mngx001 minmag -2 -2 -> -2
-mngx002 minmag -2 -1 -> -1
-mngx003 minmag -2 0 -> 0
-mngx004 minmag -2 1 -> 1
-mngx005 minmag -2 2 -> -2
-mngx006 minmag -1 -2 -> -1
-mngx007 minmag -1 -1 -> -1
-mngx008 minmag -1 0 -> 0
-mngx009 minmag -1 1 -> -1
-mngx010 minmag -1 2 -> -1
-mngx011 minmag 0 -2 -> 0
-mngx012 minmag 0 -1 -> 0
-mngx013 minmag 0 0 -> 0
-mngx014 minmag 0 1 -> 0
-mngx015 minmag 0 2 -> 0
-mngx016 minmag 1 -2 -> 1
-mngx017 minmag 1 -1 -> -1
-mngx018 minmag 1 0 -> 0
-mngx019 minmag 1 1 -> 1
-mngx020 minmag 1 2 -> 1
-mngx021 minmag 2 -2 -> -2
-mngx022 minmag 2 -1 -> -1
-mngx023 minmag 2 0 -> 0
-mngx025 minmag 2 1 -> 1
-mngx026 minmag 2 2 -> 2
-
--- extended zeros
-mngx030 minmag 0 0 -> 0
-mngx031 minmag 0 -0 -> -0
-mngx032 minmag 0 -0.0 -> -0.0
-mngx033 minmag 0 0.0 -> 0.0
-mngx034 minmag -0 0 -> -0
-mngx035 minmag -0 -0 -> -0
-mngx036 minmag -0 -0.0 -> -0
-mngx037 minmag -0 0.0 -> -0
-mngx038 minmag 0.0 0 -> 0.0
-mngx039 minmag 0.0 -0 -> -0
-mngx040 minmag 0.0 -0.0 -> -0.0
-mngx041 minmag 0.0 0.0 -> 0.0
-mngx042 minmag -0.0 0 -> -0.0
-mngx043 minmag -0.0 -0 -> -0
-mngx044 minmag -0.0 -0.0 -> -0.0
-mngx045 minmag -0.0 0.0 -> -0.0
-
-mngx046 minmag 0E1 -0E1 -> -0E+1
-mngx047 minmag -0E1 0E2 -> -0E+1
-mngx048 minmag 0E2 0E1 -> 0E+1
-mngx049 minmag 0E1 0E2 -> 0E+1
-mngx050 minmag -0E3 -0E2 -> -0E+3
-mngx051 minmag -0E2 -0E3 -> -0E+3
-
--- Specials
-precision: 9
-mngx090 minmag Inf -Inf -> -Infinity
-mngx091 minmag Inf -1000 -> -1000
-mngx092 minmag Inf -1 -> -1
-mngx093 minmag Inf -0 -> -0
-mngx094 minmag Inf 0 -> 0
-mngx095 minmag Inf 1 -> 1
-mngx096 minmag Inf 1000 -> 1000
-mngx097 minmag Inf Inf -> Infinity
-mngx098 minmag -1000 Inf -> -1000
-mngx099 minmag -Inf Inf -> -Infinity
-mngx100 minmag -1 Inf -> -1
-mngx101 minmag -0 Inf -> -0
-mngx102 minmag 0 Inf -> 0
-mngx103 minmag 1 Inf -> 1
-mngx104 minmag 1000 Inf -> 1000
-mngx105 minmag Inf Inf -> Infinity
-
-mngx120 minmag -Inf -Inf -> -Infinity
-mngx121 minmag -Inf -1000 -> -1000
-mngx122 minmag -Inf -1 -> -1
-mngx123 minmag -Inf -0 -> -0
-mngx124 minmag -Inf 0 -> 0
-mngx125 minmag -Inf 1 -> 1
-mngx126 minmag -Inf 1000 -> 1000
-mngx127 minmag -Inf Inf -> -Infinity
-mngx128 minmag -Inf -Inf -> -Infinity
-mngx129 minmag -1000 -Inf -> -1000
-mngx130 minmag -1 -Inf -> -1
-mngx131 minmag -0 -Inf -> -0
-mngx132 minmag 0 -Inf -> 0
-mngx133 minmag 1 -Inf -> 1
-mngx134 minmag 1000 -Inf -> 1000
-mngx135 minmag Inf -Inf -> -Infinity
-
--- 2004.08.02 754r chooses number over NaN in mixed cases
-mngx141 minmag NaN -Inf -> -Infinity
-mngx142 minmag NaN -1000 -> -1000
-mngx143 minmag NaN -1 -> -1
-mngx144 minmag NaN -0 -> -0
-mngx145 minmag NaN 0 -> 0
-mngx146 minmag NaN 1 -> 1
-mngx147 minmag NaN 1000 -> 1000
-mngx148 minmag NaN Inf -> Infinity
-mngx149 minmag NaN NaN -> NaN
-mngx150 minmag -Inf NaN -> -Infinity
-mngx151 minmag -1000 NaN -> -1000
-mngx152 minmag -1 -NaN -> -1
-mngx153 minmag -0 NaN -> -0
-mngx154 minmag 0 -NaN -> 0
-mngx155 minmag 1 NaN -> 1
-mngx156 minmag 1000 NaN -> 1000
-mngx157 minmag Inf NaN -> Infinity
-
-mngx161 minmag sNaN -Inf -> NaN Invalid_operation
-mngx162 minmag sNaN -1000 -> NaN Invalid_operation
-mngx163 minmag sNaN -1 -> NaN Invalid_operation
-mngx164 minmag sNaN -0 -> NaN Invalid_operation
-mngx165 minmag -sNaN 0 -> -NaN Invalid_operation
-mngx166 minmag -sNaN 1 -> -NaN Invalid_operation
-mngx167 minmag sNaN 1000 -> NaN Invalid_operation
-mngx168 minmag sNaN NaN -> NaN Invalid_operation
-mngx169 minmag sNaN sNaN -> NaN Invalid_operation
-mngx170 minmag NaN sNaN -> NaN Invalid_operation
-mngx171 minmag -Inf sNaN -> NaN Invalid_operation
-mngx172 minmag -1000 sNaN -> NaN Invalid_operation
-mngx173 minmag -1 sNaN -> NaN Invalid_operation
-mngx174 minmag -0 sNaN -> NaN Invalid_operation
-mngx175 minmag 0 sNaN -> NaN Invalid_operation
-mngx176 minmag 1 sNaN -> NaN Invalid_operation
-mngx177 minmag 1000 sNaN -> NaN Invalid_operation
-mngx178 minmag Inf sNaN -> NaN Invalid_operation
-mngx179 minmag NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-mngx181 minmag NaN9 -Inf -> -Infinity
-mngx182 minmag -NaN8 9990 -> 9990
-mngx183 minmag NaN71 Inf -> Infinity
-
-mngx184 minmag NaN1 NaN54 -> NaN1
-mngx185 minmag NaN22 -NaN53 -> NaN22
-mngx186 minmag -NaN3 NaN6 -> -NaN3
-mngx187 minmag -NaN44 NaN7 -> -NaN44
-
-mngx188 minmag -Inf NaN41 -> -Infinity
-mngx189 minmag -9999 -NaN33 -> -9999
-mngx190 minmag Inf NaN2 -> Infinity
-
-mngx191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
-mngx192 minmag sNaN98 -11 -> NaN98 Invalid_operation
-mngx193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
-mngx194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
-mngx195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
-mngx196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
-mngx197 minmag 088 sNaN91 -> NaN91 Invalid_operation
-mngx198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
-mngx199 minmag NaN sNaN86 -> NaN86 Invalid_operation
-
--- rounding checks -- chosen is rounded, or not
-maxExponent: 999
-minexponent: -999
-precision: 9
-mngx201 minmag -12345678000 1 -> 1
-mngx202 minmag 1 -12345678000 -> 1
-mngx203 minmag -1234567800 1 -> 1
-mngx204 minmag 1 -1234567800 -> 1
-mngx205 minmag -1234567890 1 -> 1
-mngx206 minmag 1 -1234567890 -> 1
-mngx207 minmag -1234567891 1 -> 1
-mngx208 minmag 1 -1234567891 -> 1
-mngx209 minmag -12345678901 1 -> 1
-mngx210 minmag 1 -12345678901 -> 1
-mngx211 minmag -1234567896 1 -> 1
-mngx212 minmag 1 -1234567896 -> 1
-mngx213 minmag 1234567891 1 -> 1
-mngx214 minmag 1 1234567891 -> 1
-mngx215 minmag 12345678901 1 -> 1
-mngx216 minmag 1 12345678901 -> 1
-mngx217 minmag 1234567896 1 -> 1
-mngx218 minmag 1 1234567896 -> 1
-
-precision: 15
-mngx221 minmag -12345678000 1 -> 1
-mngx222 minmag 1 -12345678000 -> 1
-mngx223 minmag -1234567800 1 -> 1
-mngx224 minmag 1 -1234567800 -> 1
-mngx225 minmag -1234567890 1 -> 1
-mngx226 minmag 1 -1234567890 -> 1
-mngx227 minmag -1234567891 1 -> 1
-mngx228 minmag 1 -1234567891 -> 1
-mngx229 minmag -12345678901 1 -> 1
-mngx230 minmag 1 -12345678901 -> 1
-mngx231 minmag -1234567896 1 -> 1
-mngx232 minmag 1 -1234567896 -> 1
-mngx233 minmag 1234567891 1 -> 1
-mngx234 minmag 1 1234567891 -> 1
-mngx235 minmag 12345678901 1 -> 1
-mngx236 minmag 1 12345678901 -> 1
-mngx237 minmag 1234567896 1 -> 1
-mngx238 minmag 1 1234567896 -> 1
-
--- from examples
-mngx280 minmag '3' '2' -> '2'
-mngx281 minmag '-10' '3' -> '3'
-mngx282 minmag '1.0' '1' -> '1.0'
-mngx283 minmag '1' '1.0' -> '1.0'
-mngx284 minmag '7' 'NaN' -> '7'
-
--- overflow and underflow tests .. subnormal results [inputs] now allowed
-maxExponent: 999999999
-minexponent: -999999999
-mngx330 minmag -1.23456789012345E-0 -9E+999999999 -> -1.23456789012345
-mngx331 minmag -9E+999999999 -1.23456789012345E-0 -> -1.23456789012345
-mngx332 minmag -0.100 -9E-999999999 -> -9E-999999999
-mngx333 minmag -9E-999999999 -0.100 -> -9E-999999999
-mngx335 minmag +1.23456789012345E-0 -9E+999999999 -> 1.23456789012345
-mngx336 minmag -9E+999999999 1.23456789012345E-0 -> 1.23456789012345
-mngx337 minmag +0.100 -9E-999999999 -> -9E-999999999
-mngx338 minmag -9E-999999999 0.100 -> -9E-999999999
-
-mngx339 minmag -1e-599999999 -1e-400000001 -> -1E-599999999
-mngx340 minmag -1e-599999999 -1e-400000000 -> -1E-599999999
-mngx341 minmag -1e-600000000 -1e-400000000 -> -1E-600000000
-mngx342 minmag -9e-999999998 -0.01 -> -9E-999999998
-mngx343 minmag -9e-999999998 -0.1 -> -9E-999999998
-mngx344 minmag -0.01 -9e-999999998 -> -9E-999999998
-mngx345 minmag -1e599999999 -1e400000001 -> -1E+400000001
-mngx346 minmag -1e599999999 -1e400000000 -> -1E+400000000
-mngx347 minmag -1e600000000 -1e400000000 -> -1E+400000000
-mngx348 minmag -9e999999998 -100 -> -100
-mngx349 minmag -9e999999998 -10 -> -10
-mngx350 minmag -100 -9e999999998 -> -100
--- signs
-mngx351 minmag -1e+777777777 -1e+411111111 -> -1E+411111111
-mngx352 minmag -1e+777777777 +1e+411111111 -> 1E+411111111
-mngx353 minmag +1e+777777777 -1e+411111111 -> -1E+411111111
-mngx354 minmag +1e+777777777 +1e+411111111 -> 1E+411111111
-mngx355 minmag -1e-777777777 -1e-411111111 -> -1E-777777777
-mngx356 minmag -1e-777777777 +1e-411111111 -> -1E-777777777
-mngx357 minmag +1e-777777777 -1e-411111111 -> 1E-777777777
-mngx358 minmag +1e-777777777 +1e-411111111 -> 1E-777777777
-
--- expanded list from min/max 754r purple prose
--- [explicit tests for exponent ordering]
-mngx401 minmag Inf 1.1 -> 1.1
-mngx402 minmag 1.1 1 -> 1
-mngx403 minmag 1 1.0 -> 1.0
-mngx404 minmag 1.0 0.1 -> 0.1
-mngx405 minmag 0.1 0.10 -> 0.10
-mngx406 minmag 0.10 0.100 -> 0.100
-mngx407 minmag 0.10 0 -> 0
-mngx408 minmag 0 0.0 -> 0.0
-mngx409 minmag 0.0 -0 -> -0
-mngx410 minmag 0.0 -0.0 -> -0.0
-mngx411 minmag 0.00 -0.0 -> -0.0
-mngx412 minmag 0.0 -0.00 -> -0.00
-mngx413 minmag 0 -0.0 -> -0.0
-mngx414 minmag 0 -0 -> -0
-mngx415 minmag -0.0 -0 -> -0
-mngx416 minmag -0 -0.100 -> -0
-mngx417 minmag -0.100 -0.10 -> -0.10
-mngx418 minmag -0.10 -0.1 -> -0.1
-mngx419 minmag -0.1 -1.0 -> -0.1
-mngx420 minmag -1.0 -1 -> -1
-mngx421 minmag -1 -1.1 -> -1
-mngx423 minmag -1.1 -Inf -> -1.1
--- same with operands reversed
-mngx431 minmag 1.1 Inf -> 1.1
-mngx432 minmag 1 1.1 -> 1
-mngx433 minmag 1.0 1 -> 1.0
-mngx434 minmag 0.1 1.0 -> 0.1
-mngx435 minmag 0.10 0.1 -> 0.10
-mngx436 minmag 0.100 0.10 -> 0.100
-mngx437 minmag 0 0.10 -> 0
-mngx438 minmag 0.0 0 -> 0.0
-mngx439 minmag -0 0.0 -> -0
-mngx440 minmag -0.0 0.0 -> -0.0
-mngx441 minmag -0.0 0.00 -> -0.0
-mngx442 minmag -0.00 0.0 -> -0.00
-mngx443 minmag -0.0 0 -> -0.0
-mngx444 minmag -0 0 -> -0
-mngx445 minmag -0 -0.0 -> -0
-mngx446 minmag -0.100 -0 -> -0
-mngx447 minmag -0.10 -0.100 -> -0.10
-mngx448 minmag -0.1 -0.10 -> -0.1
-mngx449 minmag -1.0 -0.1 -> -0.1
-mngx450 minmag -1 -1.0 -> -1
-mngx451 minmag -1.1 -1 -> -1
-mngx453 minmag -Inf -1.1 -> -1.1
--- largies
-mngx460 minmag 1000 1E+3 -> 1000
-mngx461 minmag 1E+3 1000 -> 1000
-mngx462 minmag 1000 -1E+3 -> -1E+3
-mngx463 minmag 1E+3 -1000 -> -1000
-mngx464 minmag -1000 1E+3 -> -1000
-mngx465 minmag -1E+3 1000 -> -1E+3
-mngx466 minmag -1000 -1E+3 -> -1E+3
-mngx467 minmag -1E+3 -1000 -> -1E+3
-
--- rounding (results treated as though plus)
-maxexponent: 999999999
-minexponent: -999999999
-precision: 3
-
-mngx470 minmag 1 5 -> 1
-mngx471 minmag 10 50 -> 10
-mngx472 minmag 100 500 -> 100
-mngx473 minmag 1000 5000 -> 1.00E+3 Rounded
-mngx474 minmag 10000 50000 -> 1.00E+4 Rounded
-mngx475 minmag 6 50 -> 6
-mngx476 minmag 66 500 -> 66
-mngx477 minmag 666 5000 -> 666
-mngx478 minmag 6666 50000 -> 6.67E+3 Rounded Inexact
-mngx479 minmag 66666 500000 -> 6.67E+4 Rounded Inexact
-mngx480 minmag 33333 500000 -> 3.33E+4 Rounded Inexact
-mngx481 minmag 75401 1 -> 1
-mngx482 minmag 75402 10 -> 10
-mngx483 minmag 75403 100 -> 100
-mngx484 minmag 75404 1000 -> 1.00E+3 Rounded
-mngx485 minmag 75405 10000 -> 1.00E+4 Rounded
-mngx486 minmag 75406 6 -> 6
-mngx487 minmag 75407 66 -> 66
-mngx488 minmag 75408 666 -> 666
-mngx489 minmag 75409 6666 -> 6.67E+3 Rounded Inexact
-mngx490 minmag 75410 66666 -> 6.67E+4 Rounded Inexact
-mngx491 minmag 75411 33333 -> 3.33E+4 Rounded Inexact
-
-
--- overflow tests
-maxexponent: 999999999
-minexponent: -999999999
-precision: 3
-mngx500 minmag 9.999E+999999999 0 -> 0
-mngx501 minmag -9.999E+999999999 0 -> 0
-
--- subnormals and underflow
-precision: 3
-maxexponent: 999
-minexponent: -999
-mngx510 minmag 1.00E-999 0 -> 0
-mngx511 minmag 0.1E-999 0 -> 0
-mngx512 minmag 0.10E-999 0 -> 0
-mngx513 minmag 0.100E-999 0 -> 0
-mngx514 minmag 0.01E-999 0 -> 0
-mngx515 minmag 0.999E-999 0 -> 0
-mngx516 minmag 0.099E-999 0 -> 0
-mngx517 minmag 0.009E-999 0 -> 0
-mngx518 minmag 0.001E-999 0 -> 0
-mngx519 minmag 0.0009E-999 0 -> 0
-mngx520 minmag 0.0001E-999 0 -> 0
-
-mngx530 minmag -1.00E-999 0 -> 0
-mngx531 minmag -0.1E-999 0 -> 0
-mngx532 minmag -0.10E-999 0 -> 0
-mngx533 minmag -0.100E-999 0 -> 0
-mngx534 minmag -0.01E-999 0 -> 0
-mngx535 minmag -0.999E-999 0 -> 0
-mngx536 minmag -0.099E-999 0 -> 0
-mngx537 minmag -0.009E-999 0 -> 0
-mngx538 minmag -0.001E-999 0 -> 0
-mngx539 minmag -0.0009E-999 0 -> 0
-mngx540 minmag -0.0001E-999 0 -> 0
-
-
--- Null tests
-mng900 minmag 10 # -> NaN Invalid_operation
-mng901 minmag # 10 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- minmag.decTest -- decimal minimum by magnitude --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- we assume that base comparison is tested in compare.decTest, so
+-- these mainly cover special cases and rounding
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- sanity checks
+mngx001 minmag -2 -2 -> -2
+mngx002 minmag -2 -1 -> -1
+mngx003 minmag -2 0 -> 0
+mngx004 minmag -2 1 -> 1
+mngx005 minmag -2 2 -> -2
+mngx006 minmag -1 -2 -> -1
+mngx007 minmag -1 -1 -> -1
+mngx008 minmag -1 0 -> 0
+mngx009 minmag -1 1 -> -1
+mngx010 minmag -1 2 -> -1
+mngx011 minmag 0 -2 -> 0
+mngx012 minmag 0 -1 -> 0
+mngx013 minmag 0 0 -> 0
+mngx014 minmag 0 1 -> 0
+mngx015 minmag 0 2 -> 0
+mngx016 minmag 1 -2 -> 1
+mngx017 minmag 1 -1 -> -1
+mngx018 minmag 1 0 -> 0
+mngx019 minmag 1 1 -> 1
+mngx020 minmag 1 2 -> 1
+mngx021 minmag 2 -2 -> -2
+mngx022 minmag 2 -1 -> -1
+mngx023 minmag 2 0 -> 0
+mngx025 minmag 2 1 -> 1
+mngx026 minmag 2 2 -> 2
+
+-- extended zeros
+mngx030 minmag 0 0 -> 0
+mngx031 minmag 0 -0 -> -0
+mngx032 minmag 0 -0.0 -> -0.0
+mngx033 minmag 0 0.0 -> 0.0
+mngx034 minmag -0 0 -> -0
+mngx035 minmag -0 -0 -> -0
+mngx036 minmag -0 -0.0 -> -0
+mngx037 minmag -0 0.0 -> -0
+mngx038 minmag 0.0 0 -> 0.0
+mngx039 minmag 0.0 -0 -> -0
+mngx040 minmag 0.0 -0.0 -> -0.0
+mngx041 minmag 0.0 0.0 -> 0.0
+mngx042 minmag -0.0 0 -> -0.0
+mngx043 minmag -0.0 -0 -> -0
+mngx044 minmag -0.0 -0.0 -> -0.0
+mngx045 minmag -0.0 0.0 -> -0.0
+
+mngx046 minmag 0E1 -0E1 -> -0E+1
+mngx047 minmag -0E1 0E2 -> -0E+1
+mngx048 minmag 0E2 0E1 -> 0E+1
+mngx049 minmag 0E1 0E2 -> 0E+1
+mngx050 minmag -0E3 -0E2 -> -0E+3
+mngx051 minmag -0E2 -0E3 -> -0E+3
+
+-- Specials
+precision: 9
+mngx090 minmag Inf -Inf -> -Infinity
+mngx091 minmag Inf -1000 -> -1000
+mngx092 minmag Inf -1 -> -1
+mngx093 minmag Inf -0 -> -0
+mngx094 minmag Inf 0 -> 0
+mngx095 minmag Inf 1 -> 1
+mngx096 minmag Inf 1000 -> 1000
+mngx097 minmag Inf Inf -> Infinity
+mngx098 minmag -1000 Inf -> -1000
+mngx099 minmag -Inf Inf -> -Infinity
+mngx100 minmag -1 Inf -> -1
+mngx101 minmag -0 Inf -> -0
+mngx102 minmag 0 Inf -> 0
+mngx103 minmag 1 Inf -> 1
+mngx104 minmag 1000 Inf -> 1000
+mngx105 minmag Inf Inf -> Infinity
+
+mngx120 minmag -Inf -Inf -> -Infinity
+mngx121 minmag -Inf -1000 -> -1000
+mngx122 minmag -Inf -1 -> -1
+mngx123 minmag -Inf -0 -> -0
+mngx124 minmag -Inf 0 -> 0
+mngx125 minmag -Inf 1 -> 1
+mngx126 minmag -Inf 1000 -> 1000
+mngx127 minmag -Inf Inf -> -Infinity
+mngx128 minmag -Inf -Inf -> -Infinity
+mngx129 minmag -1000 -Inf -> -1000
+mngx130 minmag -1 -Inf -> -1
+mngx131 minmag -0 -Inf -> -0
+mngx132 minmag 0 -Inf -> 0
+mngx133 minmag 1 -Inf -> 1
+mngx134 minmag 1000 -Inf -> 1000
+mngx135 minmag Inf -Inf -> -Infinity
+
+-- 2004.08.02 754r chooses number over NaN in mixed cases
+mngx141 minmag NaN -Inf -> -Infinity
+mngx142 minmag NaN -1000 -> -1000
+mngx143 minmag NaN -1 -> -1
+mngx144 minmag NaN -0 -> -0
+mngx145 minmag NaN 0 -> 0
+mngx146 minmag NaN 1 -> 1
+mngx147 minmag NaN 1000 -> 1000
+mngx148 minmag NaN Inf -> Infinity
+mngx149 minmag NaN NaN -> NaN
+mngx150 minmag -Inf NaN -> -Infinity
+mngx151 minmag -1000 NaN -> -1000
+mngx152 minmag -1 -NaN -> -1
+mngx153 minmag -0 NaN -> -0
+mngx154 minmag 0 -NaN -> 0
+mngx155 minmag 1 NaN -> 1
+mngx156 minmag 1000 NaN -> 1000
+mngx157 minmag Inf NaN -> Infinity
+
+mngx161 minmag sNaN -Inf -> NaN Invalid_operation
+mngx162 minmag sNaN -1000 -> NaN Invalid_operation
+mngx163 minmag sNaN -1 -> NaN Invalid_operation
+mngx164 minmag sNaN -0 -> NaN Invalid_operation
+mngx165 minmag -sNaN 0 -> -NaN Invalid_operation
+mngx166 minmag -sNaN 1 -> -NaN Invalid_operation
+mngx167 minmag sNaN 1000 -> NaN Invalid_operation
+mngx168 minmag sNaN NaN -> NaN Invalid_operation
+mngx169 minmag sNaN sNaN -> NaN Invalid_operation
+mngx170 minmag NaN sNaN -> NaN Invalid_operation
+mngx171 minmag -Inf sNaN -> NaN Invalid_operation
+mngx172 minmag -1000 sNaN -> NaN Invalid_operation
+mngx173 minmag -1 sNaN -> NaN Invalid_operation
+mngx174 minmag -0 sNaN -> NaN Invalid_operation
+mngx175 minmag 0 sNaN -> NaN Invalid_operation
+mngx176 minmag 1 sNaN -> NaN Invalid_operation
+mngx177 minmag 1000 sNaN -> NaN Invalid_operation
+mngx178 minmag Inf sNaN -> NaN Invalid_operation
+mngx179 minmag NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+mngx181 minmag NaN9 -Inf -> -Infinity
+mngx182 minmag -NaN8 9990 -> 9990
+mngx183 minmag NaN71 Inf -> Infinity
+
+mngx184 minmag NaN1 NaN54 -> NaN1
+mngx185 minmag NaN22 -NaN53 -> NaN22
+mngx186 minmag -NaN3 NaN6 -> -NaN3
+mngx187 minmag -NaN44 NaN7 -> -NaN44
+
+mngx188 minmag -Inf NaN41 -> -Infinity
+mngx189 minmag -9999 -NaN33 -> -9999
+mngx190 minmag Inf NaN2 -> Infinity
+
+mngx191 minmag sNaN99 -Inf -> NaN99 Invalid_operation
+mngx192 minmag sNaN98 -11 -> NaN98 Invalid_operation
+mngx193 minmag -sNaN97 NaN8 -> -NaN97 Invalid_operation
+mngx194 minmag sNaN69 sNaN94 -> NaN69 Invalid_operation
+mngx195 minmag NaN95 sNaN93 -> NaN93 Invalid_operation
+mngx196 minmag -Inf sNaN92 -> NaN92 Invalid_operation
+mngx197 minmag 088 sNaN91 -> NaN91 Invalid_operation
+mngx198 minmag Inf -sNaN90 -> -NaN90 Invalid_operation
+mngx199 minmag NaN sNaN86 -> NaN86 Invalid_operation
+
+-- rounding checks -- chosen is rounded, or not
+maxExponent: 999
+minexponent: -999
+precision: 9
+mngx201 minmag -12345678000 1 -> 1
+mngx202 minmag 1 -12345678000 -> 1
+mngx203 minmag -1234567800 1 -> 1
+mngx204 minmag 1 -1234567800 -> 1
+mngx205 minmag -1234567890 1 -> 1
+mngx206 minmag 1 -1234567890 -> 1
+mngx207 minmag -1234567891 1 -> 1
+mngx208 minmag 1 -1234567891 -> 1
+mngx209 minmag -12345678901 1 -> 1
+mngx210 minmag 1 -12345678901 -> 1
+mngx211 minmag -1234567896 1 -> 1
+mngx212 minmag 1 -1234567896 -> 1
+mngx213 minmag 1234567891 1 -> 1
+mngx214 minmag 1 1234567891 -> 1
+mngx215 minmag 12345678901 1 -> 1
+mngx216 minmag 1 12345678901 -> 1
+mngx217 minmag 1234567896 1 -> 1
+mngx218 minmag 1 1234567896 -> 1
+
+precision: 15
+mngx221 minmag -12345678000 1 -> 1
+mngx222 minmag 1 -12345678000 -> 1
+mngx223 minmag -1234567800 1 -> 1
+mngx224 minmag 1 -1234567800 -> 1
+mngx225 minmag -1234567890 1 -> 1
+mngx226 minmag 1 -1234567890 -> 1
+mngx227 minmag -1234567891 1 -> 1
+mngx228 minmag 1 -1234567891 -> 1
+mngx229 minmag -12345678901 1 -> 1
+mngx230 minmag 1 -12345678901 -> 1
+mngx231 minmag -1234567896 1 -> 1
+mngx232 minmag 1 -1234567896 -> 1
+mngx233 minmag 1234567891 1 -> 1
+mngx234 minmag 1 1234567891 -> 1
+mngx235 minmag 12345678901 1 -> 1
+mngx236 minmag 1 12345678901 -> 1
+mngx237 minmag 1234567896 1 -> 1
+mngx238 minmag 1 1234567896 -> 1
+
+-- from examples
+mngx280 minmag '3' '2' -> '2'
+mngx281 minmag '-10' '3' -> '3'
+mngx282 minmag '1.0' '1' -> '1.0'
+mngx283 minmag '1' '1.0' -> '1.0'
+mngx284 minmag '7' 'NaN' -> '7'
+
+-- overflow and underflow tests .. subnormal results [inputs] now allowed
+maxExponent: 999999999
+minexponent: -999999999
+mngx330 minmag -1.23456789012345E-0 -9E+999999999 -> -1.23456789012345
+mngx331 minmag -9E+999999999 -1.23456789012345E-0 -> -1.23456789012345
+mngx332 minmag -0.100 -9E-999999999 -> -9E-999999999
+mngx333 minmag -9E-999999999 -0.100 -> -9E-999999999
+mngx335 minmag +1.23456789012345E-0 -9E+999999999 -> 1.23456789012345
+mngx336 minmag -9E+999999999 1.23456789012345E-0 -> 1.23456789012345
+mngx337 minmag +0.100 -9E-999999999 -> -9E-999999999
+mngx338 minmag -9E-999999999 0.100 -> -9E-999999999
+
+mngx339 minmag -1e-599999999 -1e-400000001 -> -1E-599999999
+mngx340 minmag -1e-599999999 -1e-400000000 -> -1E-599999999
+mngx341 minmag -1e-600000000 -1e-400000000 -> -1E-600000000
+mngx342 minmag -9e-999999998 -0.01 -> -9E-999999998
+mngx343 minmag -9e-999999998 -0.1 -> -9E-999999998
+mngx344 minmag -0.01 -9e-999999998 -> -9E-999999998
+mngx345 minmag -1e599999999 -1e400000001 -> -1E+400000001
+mngx346 minmag -1e599999999 -1e400000000 -> -1E+400000000
+mngx347 minmag -1e600000000 -1e400000000 -> -1E+400000000
+mngx348 minmag -9e999999998 -100 -> -100
+mngx349 minmag -9e999999998 -10 -> -10
+mngx350 minmag -100 -9e999999998 -> -100
+-- signs
+mngx351 minmag -1e+777777777 -1e+411111111 -> -1E+411111111
+mngx352 minmag -1e+777777777 +1e+411111111 -> 1E+411111111
+mngx353 minmag +1e+777777777 -1e+411111111 -> -1E+411111111
+mngx354 minmag +1e+777777777 +1e+411111111 -> 1E+411111111
+mngx355 minmag -1e-777777777 -1e-411111111 -> -1E-777777777
+mngx356 minmag -1e-777777777 +1e-411111111 -> -1E-777777777
+mngx357 minmag +1e-777777777 -1e-411111111 -> 1E-777777777
+mngx358 minmag +1e-777777777 +1e-411111111 -> 1E-777777777
+
+-- expanded list from min/max 754r purple prose
+-- [explicit tests for exponent ordering]
+mngx401 minmag Inf 1.1 -> 1.1
+mngx402 minmag 1.1 1 -> 1
+mngx403 minmag 1 1.0 -> 1.0
+mngx404 minmag 1.0 0.1 -> 0.1
+mngx405 minmag 0.1 0.10 -> 0.10
+mngx406 minmag 0.10 0.100 -> 0.100
+mngx407 minmag 0.10 0 -> 0
+mngx408 minmag 0 0.0 -> 0.0
+mngx409 minmag 0.0 -0 -> -0
+mngx410 minmag 0.0 -0.0 -> -0.0
+mngx411 minmag 0.00 -0.0 -> -0.0
+mngx412 minmag 0.0 -0.00 -> -0.00
+mngx413 minmag 0 -0.0 -> -0.0
+mngx414 minmag 0 -0 -> -0
+mngx415 minmag -0.0 -0 -> -0
+mngx416 minmag -0 -0.100 -> -0
+mngx417 minmag -0.100 -0.10 -> -0.10
+mngx418 minmag -0.10 -0.1 -> -0.1
+mngx419 minmag -0.1 -1.0 -> -0.1
+mngx420 minmag -1.0 -1 -> -1
+mngx421 minmag -1 -1.1 -> -1
+mngx423 minmag -1.1 -Inf -> -1.1
+-- same with operands reversed
+mngx431 minmag 1.1 Inf -> 1.1
+mngx432 minmag 1 1.1 -> 1
+mngx433 minmag 1.0 1 -> 1.0
+mngx434 minmag 0.1 1.0 -> 0.1
+mngx435 minmag 0.10 0.1 -> 0.10
+mngx436 minmag 0.100 0.10 -> 0.100
+mngx437 minmag 0 0.10 -> 0
+mngx438 minmag 0.0 0 -> 0.0
+mngx439 minmag -0 0.0 -> -0
+mngx440 minmag -0.0 0.0 -> -0.0
+mngx441 minmag -0.0 0.00 -> -0.0
+mngx442 minmag -0.00 0.0 -> -0.00
+mngx443 minmag -0.0 0 -> -0.0
+mngx444 minmag -0 0 -> -0
+mngx445 minmag -0 -0.0 -> -0
+mngx446 minmag -0.100 -0 -> -0
+mngx447 minmag -0.10 -0.100 -> -0.10
+mngx448 minmag -0.1 -0.10 -> -0.1
+mngx449 minmag -1.0 -0.1 -> -0.1
+mngx450 minmag -1 -1.0 -> -1
+mngx451 minmag -1.1 -1 -> -1
+mngx453 minmag -Inf -1.1 -> -1.1
+-- largies
+mngx460 minmag 1000 1E+3 -> 1000
+mngx461 minmag 1E+3 1000 -> 1000
+mngx462 minmag 1000 -1E+3 -> -1E+3
+mngx463 minmag 1E+3 -1000 -> -1000
+mngx464 minmag -1000 1E+3 -> -1000
+mngx465 minmag -1E+3 1000 -> -1E+3
+mngx466 minmag -1000 -1E+3 -> -1E+3
+mngx467 minmag -1E+3 -1000 -> -1E+3
+
+-- rounding (results treated as though plus)
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+
+mngx470 minmag 1 5 -> 1
+mngx471 minmag 10 50 -> 10
+mngx472 minmag 100 500 -> 100
+mngx473 minmag 1000 5000 -> 1.00E+3 Rounded
+mngx474 minmag 10000 50000 -> 1.00E+4 Rounded
+mngx475 minmag 6 50 -> 6
+mngx476 minmag 66 500 -> 66
+mngx477 minmag 666 5000 -> 666
+mngx478 minmag 6666 50000 -> 6.67E+3 Rounded Inexact
+mngx479 minmag 66666 500000 -> 6.67E+4 Rounded Inexact
+mngx480 minmag 33333 500000 -> 3.33E+4 Rounded Inexact
+mngx481 minmag 75401 1 -> 1
+mngx482 minmag 75402 10 -> 10
+mngx483 minmag 75403 100 -> 100
+mngx484 minmag 75404 1000 -> 1.00E+3 Rounded
+mngx485 minmag 75405 10000 -> 1.00E+4 Rounded
+mngx486 minmag 75406 6 -> 6
+mngx487 minmag 75407 66 -> 66
+mngx488 minmag 75408 666 -> 666
+mngx489 minmag 75409 6666 -> 6.67E+3 Rounded Inexact
+mngx490 minmag 75410 66666 -> 6.67E+4 Rounded Inexact
+mngx491 minmag 75411 33333 -> 3.33E+4 Rounded Inexact
+
+
+-- overflow tests
+maxexponent: 999999999
+minexponent: -999999999
+precision: 3
+mngx500 minmag 9.999E+999999999 0 -> 0
+mngx501 minmag -9.999E+999999999 0 -> 0
+
+-- subnormals and underflow
+precision: 3
+maxexponent: 999
+minexponent: -999
+mngx510 minmag 1.00E-999 0 -> 0
+mngx511 minmag 0.1E-999 0 -> 0
+mngx512 minmag 0.10E-999 0 -> 0
+mngx513 minmag 0.100E-999 0 -> 0
+mngx514 minmag 0.01E-999 0 -> 0
+mngx515 minmag 0.999E-999 0 -> 0
+mngx516 minmag 0.099E-999 0 -> 0
+mngx517 minmag 0.009E-999 0 -> 0
+mngx518 minmag 0.001E-999 0 -> 0
+mngx519 minmag 0.0009E-999 0 -> 0
+mngx520 minmag 0.0001E-999 0 -> 0
+
+mngx530 minmag -1.00E-999 0 -> 0
+mngx531 minmag -0.1E-999 0 -> 0
+mngx532 minmag -0.10E-999 0 -> 0
+mngx533 minmag -0.100E-999 0 -> 0
+mngx534 minmag -0.01E-999 0 -> 0
+mngx535 minmag -0.999E-999 0 -> 0
+mngx536 minmag -0.099E-999 0 -> 0
+mngx537 minmag -0.009E-999 0 -> 0
+mngx538 minmag -0.001E-999 0 -> 0
+mngx539 minmag -0.0009E-999 0 -> 0
+mngx540 minmag -0.0001E-999 0 -> 0
+
+
+-- Null tests
+mng900 minmag 10 # -> NaN Invalid_operation
+mng901 minmag # 10 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/nextminus.decTest b/Lib/test/decimaltestdata/nextminus.decTest
index ba93066b96..531c5252a5 100644
--- a/Lib/test/decimaltestdata/nextminus.decTest
+++ b/Lib/test/decimaltestdata/nextminus.decTest
@@ -1,148 +1,148 @@
-------------------------------------------------------------------------
--- nextminus.decTest -- decimal next that is less [754r nextdown] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
-nextm001 nextminus 0.999999995 -> 0.999999994
-nextm002 nextminus 0.999999996 -> 0.999999995
-nextm003 nextminus 0.999999997 -> 0.999999996
-nextm004 nextminus 0.999999998 -> 0.999999997
-nextm005 nextminus 0.999999999 -> 0.999999998
-nextm006 nextminus 1.00000000 -> 0.999999999
-nextm007 nextminus 1.0 -> 0.999999999
-nextm008 nextminus 1 -> 0.999999999
-nextm009 nextminus 1.00000001 -> 1.00000000
-nextm010 nextminus 1.00000002 -> 1.00000001
-nextm011 nextminus 1.00000003 -> 1.00000002
-nextm012 nextminus 1.00000004 -> 1.00000003
-nextm013 nextminus 1.00000005 -> 1.00000004
-nextm014 nextminus 1.00000006 -> 1.00000005
-nextm015 nextminus 1.00000007 -> 1.00000006
-nextm016 nextminus 1.00000008 -> 1.00000007
-nextm017 nextminus 1.00000009 -> 1.00000008
-nextm018 nextminus 1.00000010 -> 1.00000009
-nextm019 nextminus 1.00000011 -> 1.00000010
-nextm020 nextminus 1.00000012 -> 1.00000011
-
-nextm021 nextminus -0.999999995 -> -0.999999996
-nextm022 nextminus -0.999999996 -> -0.999999997
-nextm023 nextminus -0.999999997 -> -0.999999998
-nextm024 nextminus -0.999999998 -> -0.999999999
-nextm025 nextminus -0.999999999 -> -1.00000000
-nextm026 nextminus -1.00000000 -> -1.00000001
-nextm027 nextminus -1.0 -> -1.00000001
-nextm028 nextminus -1 -> -1.00000001
-nextm029 nextminus -1.00000001 -> -1.00000002
-nextm030 nextminus -1.00000002 -> -1.00000003
-nextm031 nextminus -1.00000003 -> -1.00000004
-nextm032 nextminus -1.00000004 -> -1.00000005
-nextm033 nextminus -1.00000005 -> -1.00000006
-nextm034 nextminus -1.00000006 -> -1.00000007
-nextm035 nextminus -1.00000007 -> -1.00000008
-nextm036 nextminus -1.00000008 -> -1.00000009
-nextm037 nextminus -1.00000009 -> -1.00000010
-nextm038 nextminus -1.00000010 -> -1.00000011
-nextm039 nextminus -1.00000011 -> -1.00000012
-
--- input operand is >precision
-nextm041 nextminus 1.00000010998 -> 1.00000010
-nextm042 nextminus 1.00000010999 -> 1.00000010
-nextm043 nextminus 1.00000011000 -> 1.00000010
-nextm044 nextminus 1.00000011001 -> 1.00000011
-nextm045 nextminus 1.00000011002 -> 1.00000011
-nextm046 nextminus 1.00000011002 -> 1.00000011
-nextm047 nextminus 1.00000011052 -> 1.00000011
-nextm048 nextminus 1.00000011552 -> 1.00000011
-nextm049 nextminus -1.00000010998 -> -1.00000011
-nextm050 nextminus -1.00000010999 -> -1.00000011
-nextm051 nextminus -1.00000011000 -> -1.00000012
-nextm052 nextminus -1.00000011001 -> -1.00000012
-nextm053 nextminus -1.00000011002 -> -1.00000012
-nextm054 nextminus -1.00000011002 -> -1.00000012
-nextm055 nextminus -1.00000011052 -> -1.00000012
-nextm056 nextminus -1.00000011552 -> -1.00000012
--- ultra-tiny inputs
-nextm060 nextminus 1E-99999 -> 0E-391
-nextm061 nextminus 1E-999999999 -> 0E-391
-nextm062 nextminus 1E-391 -> 0E-391
-nextm063 nextminus -1E-99999 -> -1E-391
-nextm064 nextminus -1E-999999999 -> -1E-391
-nextm065 nextminus -1E-391 -> -2E-391
-
--- Zeros
-nextm100 nextminus -0 -> -1E-391
-nextm101 nextminus 0 -> -1E-391
-nextm102 nextminus 0.00 -> -1E-391
-nextm103 nextminus -0.00 -> -1E-391
-nextm104 nextminus 0E-300 -> -1E-391
-nextm105 nextminus 0E+300 -> -1E-391
-nextm106 nextminus 0E+30000 -> -1E-391
-nextm107 nextminus -0E+30000 -> -1E-391
-
-precision: 9
-maxExponent: 999
-minexponent: -999
--- specials
-nextm150 nextminus Inf -> 9.99999999E+999
-nextm151 nextminus -Inf -> -Infinity
-nextm152 nextminus NaN -> NaN
-nextm153 nextminus sNaN -> NaN Invalid_operation
-nextm154 nextminus NaN77 -> NaN77
-nextm155 nextminus sNaN88 -> NaN88 Invalid_operation
-nextm156 nextminus -NaN -> -NaN
-nextm157 nextminus -sNaN -> -NaN Invalid_operation
-nextm158 nextminus -NaN77 -> -NaN77
-nextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-nextm170 nextminus 9.99999999E+999 -> 9.99999998E+999
-nextm171 nextminus 9.99999998E+999 -> 9.99999997E+999
-nextm172 nextminus 1E-999 -> 9.9999999E-1000
-nextm173 nextminus 1.00000000E-999 -> 9.9999999E-1000
-nextm174 nextminus 9E-1007 -> 8E-1007
-nextm175 nextminus 9.9E-1006 -> 9.8E-1006
-nextm176 nextminus 9.9999E-1003 -> 9.9998E-1003
-nextm177 nextminus 9.9999999E-1000 -> 9.9999998E-1000
-nextm178 nextminus 9.9999998E-1000 -> 9.9999997E-1000
-nextm179 nextminus 9.9999997E-1000 -> 9.9999996E-1000
-nextm180 nextminus 0E-1007 -> -1E-1007
-nextm181 nextminus 1E-1007 -> 0E-1007
-nextm182 nextminus 2E-1007 -> 1E-1007
-
-nextm183 nextminus -0E-1007 -> -1E-1007
-nextm184 nextminus -1E-1007 -> -2E-1007
-nextm185 nextminus -2E-1007 -> -3E-1007
-nextm186 nextminus -10E-1007 -> -1.1E-1006
-nextm187 nextminus -100E-1007 -> -1.01E-1005
-nextm188 nextminus -100000E-1007 -> -1.00001E-1002
-nextm189 nextminus -1.0000E-999 -> -1.00000001E-999
-nextm190 nextminus -1.00000000E-999 -> -1.00000001E-999
-nextm191 nextminus -1E-999 -> -1.00000001E-999
-nextm192 nextminus -9.99999998E+999 -> -9.99999999E+999
-nextm193 nextminus -9.99999999E+999 -> -Infinity
-
--- Null tests
-nextm900 nextminus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- nextminus.decTest -- decimal next that is less [754r nextdown] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+nextm001 nextminus 0.999999995 -> 0.999999994
+nextm002 nextminus 0.999999996 -> 0.999999995
+nextm003 nextminus 0.999999997 -> 0.999999996
+nextm004 nextminus 0.999999998 -> 0.999999997
+nextm005 nextminus 0.999999999 -> 0.999999998
+nextm006 nextminus 1.00000000 -> 0.999999999
+nextm007 nextminus 1.0 -> 0.999999999
+nextm008 nextminus 1 -> 0.999999999
+nextm009 nextminus 1.00000001 -> 1.00000000
+nextm010 nextminus 1.00000002 -> 1.00000001
+nextm011 nextminus 1.00000003 -> 1.00000002
+nextm012 nextminus 1.00000004 -> 1.00000003
+nextm013 nextminus 1.00000005 -> 1.00000004
+nextm014 nextminus 1.00000006 -> 1.00000005
+nextm015 nextminus 1.00000007 -> 1.00000006
+nextm016 nextminus 1.00000008 -> 1.00000007
+nextm017 nextminus 1.00000009 -> 1.00000008
+nextm018 nextminus 1.00000010 -> 1.00000009
+nextm019 nextminus 1.00000011 -> 1.00000010
+nextm020 nextminus 1.00000012 -> 1.00000011
+
+nextm021 nextminus -0.999999995 -> -0.999999996
+nextm022 nextminus -0.999999996 -> -0.999999997
+nextm023 nextminus -0.999999997 -> -0.999999998
+nextm024 nextminus -0.999999998 -> -0.999999999
+nextm025 nextminus -0.999999999 -> -1.00000000
+nextm026 nextminus -1.00000000 -> -1.00000001
+nextm027 nextminus -1.0 -> -1.00000001
+nextm028 nextminus -1 -> -1.00000001
+nextm029 nextminus -1.00000001 -> -1.00000002
+nextm030 nextminus -1.00000002 -> -1.00000003
+nextm031 nextminus -1.00000003 -> -1.00000004
+nextm032 nextminus -1.00000004 -> -1.00000005
+nextm033 nextminus -1.00000005 -> -1.00000006
+nextm034 nextminus -1.00000006 -> -1.00000007
+nextm035 nextminus -1.00000007 -> -1.00000008
+nextm036 nextminus -1.00000008 -> -1.00000009
+nextm037 nextminus -1.00000009 -> -1.00000010
+nextm038 nextminus -1.00000010 -> -1.00000011
+nextm039 nextminus -1.00000011 -> -1.00000012
+
+-- input operand is >precision
+nextm041 nextminus 1.00000010998 -> 1.00000010
+nextm042 nextminus 1.00000010999 -> 1.00000010
+nextm043 nextminus 1.00000011000 -> 1.00000010
+nextm044 nextminus 1.00000011001 -> 1.00000011
+nextm045 nextminus 1.00000011002 -> 1.00000011
+nextm046 nextminus 1.00000011002 -> 1.00000011
+nextm047 nextminus 1.00000011052 -> 1.00000011
+nextm048 nextminus 1.00000011552 -> 1.00000011
+nextm049 nextminus -1.00000010998 -> -1.00000011
+nextm050 nextminus -1.00000010999 -> -1.00000011
+nextm051 nextminus -1.00000011000 -> -1.00000012
+nextm052 nextminus -1.00000011001 -> -1.00000012
+nextm053 nextminus -1.00000011002 -> -1.00000012
+nextm054 nextminus -1.00000011002 -> -1.00000012
+nextm055 nextminus -1.00000011052 -> -1.00000012
+nextm056 nextminus -1.00000011552 -> -1.00000012
+-- ultra-tiny inputs
+nextm060 nextminus 1E-99999 -> 0E-391
+nextm061 nextminus 1E-999999999 -> 0E-391
+nextm062 nextminus 1E-391 -> 0E-391
+nextm063 nextminus -1E-99999 -> -1E-391
+nextm064 nextminus -1E-999999999 -> -1E-391
+nextm065 nextminus -1E-391 -> -2E-391
+
+-- Zeros
+nextm100 nextminus -0 -> -1E-391
+nextm101 nextminus 0 -> -1E-391
+nextm102 nextminus 0.00 -> -1E-391
+nextm103 nextminus -0.00 -> -1E-391
+nextm104 nextminus 0E-300 -> -1E-391
+nextm105 nextminus 0E+300 -> -1E-391
+nextm106 nextminus 0E+30000 -> -1E-391
+nextm107 nextminus -0E+30000 -> -1E-391
+
+precision: 9
+maxExponent: 999
+minexponent: -999
+-- specials
+nextm150 nextminus Inf -> 9.99999999E+999
+nextm151 nextminus -Inf -> -Infinity
+nextm152 nextminus NaN -> NaN
+nextm153 nextminus sNaN -> NaN Invalid_operation
+nextm154 nextminus NaN77 -> NaN77
+nextm155 nextminus sNaN88 -> NaN88 Invalid_operation
+nextm156 nextminus -NaN -> -NaN
+nextm157 nextminus -sNaN -> -NaN Invalid_operation
+nextm158 nextminus -NaN77 -> -NaN77
+nextm159 nextminus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+nextm170 nextminus 9.99999999E+999 -> 9.99999998E+999
+nextm171 nextminus 9.99999998E+999 -> 9.99999997E+999
+nextm172 nextminus 1E-999 -> 9.9999999E-1000
+nextm173 nextminus 1.00000000E-999 -> 9.9999999E-1000
+nextm174 nextminus 9E-1007 -> 8E-1007
+nextm175 nextminus 9.9E-1006 -> 9.8E-1006
+nextm176 nextminus 9.9999E-1003 -> 9.9998E-1003
+nextm177 nextminus 9.9999999E-1000 -> 9.9999998E-1000
+nextm178 nextminus 9.9999998E-1000 -> 9.9999997E-1000
+nextm179 nextminus 9.9999997E-1000 -> 9.9999996E-1000
+nextm180 nextminus 0E-1007 -> -1E-1007
+nextm181 nextminus 1E-1007 -> 0E-1007
+nextm182 nextminus 2E-1007 -> 1E-1007
+
+nextm183 nextminus -0E-1007 -> -1E-1007
+nextm184 nextminus -1E-1007 -> -2E-1007
+nextm185 nextminus -2E-1007 -> -3E-1007
+nextm186 nextminus -10E-1007 -> -1.1E-1006
+nextm187 nextminus -100E-1007 -> -1.01E-1005
+nextm188 nextminus -100000E-1007 -> -1.00001E-1002
+nextm189 nextminus -1.0000E-999 -> -1.00000001E-999
+nextm190 nextminus -1.00000000E-999 -> -1.00000001E-999
+nextm191 nextminus -1E-999 -> -1.00000001E-999
+nextm192 nextminus -9.99999998E+999 -> -9.99999999E+999
+nextm193 nextminus -9.99999999E+999 -> -Infinity
+
+-- Null tests
+nextm900 nextminus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/nextplus.decTest b/Lib/test/decimaltestdata/nextplus.decTest
index 44989e50b1..c66e328727 100644
--- a/Lib/test/decimaltestdata/nextplus.decTest
+++ b/Lib/test/decimaltestdata/nextplus.decTest
@@ -1,150 +1,150 @@
-------------------------------------------------------------------------
--- nextplus.decTest -- decimal next that is greater [754r nextup] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
-nextp001 nextplus 0.999999995 -> 0.999999996
-nextp002 nextplus 0.999999996 -> 0.999999997
-nextp003 nextplus 0.999999997 -> 0.999999998
-nextp004 nextplus 0.999999998 -> 0.999999999
-nextp005 nextplus 0.999999999 -> 1.00000000
-nextp006 nextplus 1.00000000 -> 1.00000001
-nextp007 nextplus 1.0 -> 1.00000001
-nextp008 nextplus 1 -> 1.00000001
-nextp009 nextplus 1.00000001 -> 1.00000002
-nextp010 nextplus 1.00000002 -> 1.00000003
-nextp011 nextplus 1.00000003 -> 1.00000004
-nextp012 nextplus 1.00000004 -> 1.00000005
-nextp013 nextplus 1.00000005 -> 1.00000006
-nextp014 nextplus 1.00000006 -> 1.00000007
-nextp015 nextplus 1.00000007 -> 1.00000008
-nextp016 nextplus 1.00000008 -> 1.00000009
-nextp017 nextplus 1.00000009 -> 1.00000010
-nextp018 nextplus 1.00000010 -> 1.00000011
-nextp019 nextplus 1.00000011 -> 1.00000012
-
-nextp021 nextplus -0.999999995 -> -0.999999994
-nextp022 nextplus -0.999999996 -> -0.999999995
-nextp023 nextplus -0.999999997 -> -0.999999996
-nextp024 nextplus -0.999999998 -> -0.999999997
-nextp025 nextplus -0.999999999 -> -0.999999998
-nextp026 nextplus -1.00000000 -> -0.999999999
-nextp027 nextplus -1.0 -> -0.999999999
-nextp028 nextplus -1 -> -0.999999999
-nextp029 nextplus -1.00000001 -> -1.00000000
-nextp030 nextplus -1.00000002 -> -1.00000001
-nextp031 nextplus -1.00000003 -> -1.00000002
-nextp032 nextplus -1.00000004 -> -1.00000003
-nextp033 nextplus -1.00000005 -> -1.00000004
-nextp034 nextplus -1.00000006 -> -1.00000005
-nextp035 nextplus -1.00000007 -> -1.00000006
-nextp036 nextplus -1.00000008 -> -1.00000007
-nextp037 nextplus -1.00000009 -> -1.00000008
-nextp038 nextplus -1.00000010 -> -1.00000009
-nextp039 nextplus -1.00000011 -> -1.00000010
-nextp040 nextplus -1.00000012 -> -1.00000011
-
--- input operand is >precision
-nextp041 nextplus 1.00000010998 -> 1.00000011
-nextp042 nextplus 1.00000010999 -> 1.00000011
-nextp043 nextplus 1.00000011000 -> 1.00000012
-nextp044 nextplus 1.00000011001 -> 1.00000012
-nextp045 nextplus 1.00000011002 -> 1.00000012
-nextp046 nextplus 1.00000011002 -> 1.00000012
-nextp047 nextplus 1.00000011052 -> 1.00000012
-nextp048 nextplus 1.00000011552 -> 1.00000012
-nextp049 nextplus -1.00000010998 -> -1.00000010
-nextp050 nextplus -1.00000010999 -> -1.00000010
-nextp051 nextplus -1.00000011000 -> -1.00000010
-nextp052 nextplus -1.00000011001 -> -1.00000011
-nextp053 nextplus -1.00000011002 -> -1.00000011
-nextp054 nextplus -1.00000011002 -> -1.00000011
-nextp055 nextplus -1.00000011052 -> -1.00000011
-nextp056 nextplus -1.00000011552 -> -1.00000011
--- ultra-tiny inputs
-nextp060 nextplus 1E-99999 -> 1E-391
-nextp061 nextplus 1E-999999999 -> 1E-391
-nextp062 nextplus 1E-391 -> 2E-391
-nextp063 nextplus -1E-99999 -> -0E-391
-nextp064 nextplus -1E-999999999 -> -0E-391
-nextp065 nextplus -1E-391 -> -0E-391
-
--- Zeros
-nextp100 nextplus 0 -> 1E-391
-nextp101 nextplus 0.00 -> 1E-391
-nextp102 nextplus 0E-300 -> 1E-391
-nextp103 nextplus 0E+300 -> 1E-391
-nextp104 nextplus 0E+30000 -> 1E-391
-nextp105 nextplus -0 -> 1E-391
-nextp106 nextplus -0.00 -> 1E-391
-nextp107 nextplus -0E-300 -> 1E-391
-nextp108 nextplus -0E+300 -> 1E-391
-nextp109 nextplus -0E+30000 -> 1E-391
-
-maxExponent: 999
-minexponent: -999
-precision: 9
--- specials
-nextp150 nextplus Inf -> Infinity
-nextp151 nextplus -Inf -> -9.99999999E+999
-nextp152 nextplus NaN -> NaN
-nextp153 nextplus sNaN -> NaN Invalid_operation
-nextp154 nextplus NaN77 -> NaN77
-nextp155 nextplus sNaN88 -> NaN88 Invalid_operation
-nextp156 nextplus -NaN -> -NaN
-nextp157 nextplus -sNaN -> -NaN Invalid_operation
-nextp158 nextplus -NaN77 -> -NaN77
-nextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-nextp170 nextplus 9.99999999E+999 -> Infinity
-nextp171 nextplus 9.99999998E+999 -> 9.99999999E+999
-nextp172 nextplus 1E-999 -> 1.00000001E-999
-nextp173 nextplus 1.00000000E-999 -> 1.00000001E-999
-nextp174 nextplus 9E-1007 -> 1.0E-1006
-nextp175 nextplus 9.9E-1006 -> 1.00E-1005
-nextp176 nextplus 9.9999E-1003 -> 1.00000E-1002
-nextp177 nextplus 9.9999999E-1000 -> 1.00000000E-999
-nextp178 nextplus 9.9999998E-1000 -> 9.9999999E-1000
-nextp179 nextplus 9.9999997E-1000 -> 9.9999998E-1000
-nextp180 nextplus 0E-1007 -> 1E-1007
-nextp181 nextplus 1E-1007 -> 2E-1007
-nextp182 nextplus 2E-1007 -> 3E-1007
-
-nextp183 nextplus -0E-1007 -> 1E-1007
-nextp184 nextplus -1E-1007 -> -0E-1007
-nextp185 nextplus -2E-1007 -> -1E-1007
-nextp186 nextplus -10E-1007 -> -9E-1007
-nextp187 nextplus -100E-1007 -> -9.9E-1006
-nextp188 nextplus -100000E-1007 -> -9.9999E-1003
-nextp189 nextplus -1.0000E-999 -> -9.9999999E-1000
-nextp190 nextplus -1.00000000E-999 -> -9.9999999E-1000
-nextp191 nextplus -1E-999 -> -9.9999999E-1000
-nextp192 nextplus -9.99999998E+999 -> -9.99999997E+999
-nextp193 nextplus -9.99999999E+999 -> -9.99999998E+999
-
--- Null tests
-nextp900 nextplus # -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- nextplus.decTest -- decimal next that is greater [754r nextup] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+nextp001 nextplus 0.999999995 -> 0.999999996
+nextp002 nextplus 0.999999996 -> 0.999999997
+nextp003 nextplus 0.999999997 -> 0.999999998
+nextp004 nextplus 0.999999998 -> 0.999999999
+nextp005 nextplus 0.999999999 -> 1.00000000
+nextp006 nextplus 1.00000000 -> 1.00000001
+nextp007 nextplus 1.0 -> 1.00000001
+nextp008 nextplus 1 -> 1.00000001
+nextp009 nextplus 1.00000001 -> 1.00000002
+nextp010 nextplus 1.00000002 -> 1.00000003
+nextp011 nextplus 1.00000003 -> 1.00000004
+nextp012 nextplus 1.00000004 -> 1.00000005
+nextp013 nextplus 1.00000005 -> 1.00000006
+nextp014 nextplus 1.00000006 -> 1.00000007
+nextp015 nextplus 1.00000007 -> 1.00000008
+nextp016 nextplus 1.00000008 -> 1.00000009
+nextp017 nextplus 1.00000009 -> 1.00000010
+nextp018 nextplus 1.00000010 -> 1.00000011
+nextp019 nextplus 1.00000011 -> 1.00000012
+
+nextp021 nextplus -0.999999995 -> -0.999999994
+nextp022 nextplus -0.999999996 -> -0.999999995
+nextp023 nextplus -0.999999997 -> -0.999999996
+nextp024 nextplus -0.999999998 -> -0.999999997
+nextp025 nextplus -0.999999999 -> -0.999999998
+nextp026 nextplus -1.00000000 -> -0.999999999
+nextp027 nextplus -1.0 -> -0.999999999
+nextp028 nextplus -1 -> -0.999999999
+nextp029 nextplus -1.00000001 -> -1.00000000
+nextp030 nextplus -1.00000002 -> -1.00000001
+nextp031 nextplus -1.00000003 -> -1.00000002
+nextp032 nextplus -1.00000004 -> -1.00000003
+nextp033 nextplus -1.00000005 -> -1.00000004
+nextp034 nextplus -1.00000006 -> -1.00000005
+nextp035 nextplus -1.00000007 -> -1.00000006
+nextp036 nextplus -1.00000008 -> -1.00000007
+nextp037 nextplus -1.00000009 -> -1.00000008
+nextp038 nextplus -1.00000010 -> -1.00000009
+nextp039 nextplus -1.00000011 -> -1.00000010
+nextp040 nextplus -1.00000012 -> -1.00000011
+
+-- input operand is >precision
+nextp041 nextplus 1.00000010998 -> 1.00000011
+nextp042 nextplus 1.00000010999 -> 1.00000011
+nextp043 nextplus 1.00000011000 -> 1.00000012
+nextp044 nextplus 1.00000011001 -> 1.00000012
+nextp045 nextplus 1.00000011002 -> 1.00000012
+nextp046 nextplus 1.00000011002 -> 1.00000012
+nextp047 nextplus 1.00000011052 -> 1.00000012
+nextp048 nextplus 1.00000011552 -> 1.00000012
+nextp049 nextplus -1.00000010998 -> -1.00000010
+nextp050 nextplus -1.00000010999 -> -1.00000010
+nextp051 nextplus -1.00000011000 -> -1.00000010
+nextp052 nextplus -1.00000011001 -> -1.00000011
+nextp053 nextplus -1.00000011002 -> -1.00000011
+nextp054 nextplus -1.00000011002 -> -1.00000011
+nextp055 nextplus -1.00000011052 -> -1.00000011
+nextp056 nextplus -1.00000011552 -> -1.00000011
+-- ultra-tiny inputs
+nextp060 nextplus 1E-99999 -> 1E-391
+nextp061 nextplus 1E-999999999 -> 1E-391
+nextp062 nextplus 1E-391 -> 2E-391
+nextp063 nextplus -1E-99999 -> -0E-391
+nextp064 nextplus -1E-999999999 -> -0E-391
+nextp065 nextplus -1E-391 -> -0E-391
+
+-- Zeros
+nextp100 nextplus 0 -> 1E-391
+nextp101 nextplus 0.00 -> 1E-391
+nextp102 nextplus 0E-300 -> 1E-391
+nextp103 nextplus 0E+300 -> 1E-391
+nextp104 nextplus 0E+30000 -> 1E-391
+nextp105 nextplus -0 -> 1E-391
+nextp106 nextplus -0.00 -> 1E-391
+nextp107 nextplus -0E-300 -> 1E-391
+nextp108 nextplus -0E+300 -> 1E-391
+nextp109 nextplus -0E+30000 -> 1E-391
+
+maxExponent: 999
+minexponent: -999
+precision: 9
+-- specials
+nextp150 nextplus Inf -> Infinity
+nextp151 nextplus -Inf -> -9.99999999E+999
+nextp152 nextplus NaN -> NaN
+nextp153 nextplus sNaN -> NaN Invalid_operation
+nextp154 nextplus NaN77 -> NaN77
+nextp155 nextplus sNaN88 -> NaN88 Invalid_operation
+nextp156 nextplus -NaN -> -NaN
+nextp157 nextplus -sNaN -> -NaN Invalid_operation
+nextp158 nextplus -NaN77 -> -NaN77
+nextp159 nextplus -sNaN88 -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+nextp170 nextplus 9.99999999E+999 -> Infinity
+nextp171 nextplus 9.99999998E+999 -> 9.99999999E+999
+nextp172 nextplus 1E-999 -> 1.00000001E-999
+nextp173 nextplus 1.00000000E-999 -> 1.00000001E-999
+nextp174 nextplus 9E-1007 -> 1.0E-1006
+nextp175 nextplus 9.9E-1006 -> 1.00E-1005
+nextp176 nextplus 9.9999E-1003 -> 1.00000E-1002
+nextp177 nextplus 9.9999999E-1000 -> 1.00000000E-999
+nextp178 nextplus 9.9999998E-1000 -> 9.9999999E-1000
+nextp179 nextplus 9.9999997E-1000 -> 9.9999998E-1000
+nextp180 nextplus 0E-1007 -> 1E-1007
+nextp181 nextplus 1E-1007 -> 2E-1007
+nextp182 nextplus 2E-1007 -> 3E-1007
+
+nextp183 nextplus -0E-1007 -> 1E-1007
+nextp184 nextplus -1E-1007 -> -0E-1007
+nextp185 nextplus -2E-1007 -> -1E-1007
+nextp186 nextplus -10E-1007 -> -9E-1007
+nextp187 nextplus -100E-1007 -> -9.9E-1006
+nextp188 nextplus -100000E-1007 -> -9.9999E-1003
+nextp189 nextplus -1.0000E-999 -> -9.9999999E-1000
+nextp190 nextplus -1.00000000E-999 -> -9.9999999E-1000
+nextp191 nextplus -1E-999 -> -9.9999999E-1000
+nextp192 nextplus -9.99999998E+999 -> -9.99999997E+999
+nextp193 nextplus -9.99999999E+999 -> -9.99999998E+999
+
+-- Null tests
+nextp900 nextplus # -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/nexttoward.decTest b/Lib/test/decimaltestdata/nexttoward.decTest
index da26f651c8..562385a00f 100644
--- a/Lib/test/decimaltestdata/nexttoward.decTest
+++ b/Lib/test/decimaltestdata/nexttoward.decTest
@@ -1,426 +1,426 @@
-------------------------------------------------------------------------
--- nexttoward.decTest -- decimal next toward rhs [754r nextafter] --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 384
-minexponent: -383
-
--- Sanity check with a scattering of numerics
-nextt001 nexttoward 10 10 -> 10
-nextt002 nexttoward -10 -10 -> -10
-nextt003 nexttoward 1 10 -> 1.00000001
-nextt004 nexttoward 1 -10 -> 0.999999999
-nextt005 nexttoward -1 10 -> -0.999999999
-nextt006 nexttoward -1 -10 -> -1.00000001
-nextt007 nexttoward 0 10 -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt008 nexttoward 0 -10 -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt009 nexttoward 9.99999999E+384 +Infinity -> Infinity Overflow Inexact Rounded
-nextt010 nexttoward -9.99999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
-
-------- lhs=rhs
--- finites
-nextt101 nexttoward 7 7 -> 7
-nextt102 nexttoward -7 -7 -> -7
-nextt103 nexttoward 75 75 -> 75
-nextt104 nexttoward -75 -75 -> -75
-nextt105 nexttoward 7.50 7.5 -> 7.50
-nextt106 nexttoward -7.50 -7.50 -> -7.50
-nextt107 nexttoward 7.500 7.5000 -> 7.500
-nextt108 nexttoward -7.500 -7.5 -> -7.500
-
--- zeros
-nextt111 nexttoward 0 0 -> 0
-nextt112 nexttoward -0 -0 -> -0
-nextt113 nexttoward 0E+4 0 -> 0E+4
-nextt114 nexttoward -0E+4 -0 -> -0E+4
-nextt115 nexttoward 0.0000 0.00000 -> 0.0000
-nextt116 nexttoward -0.0000 -0.00 -> -0.0000
-nextt117 nexttoward 0E-141 0 -> 0E-141
-nextt118 nexttoward -0E-141 -000 -> -0E-141
-
--- full coefficients, alternating bits
-nextt121 nexttoward 268268268 268268268 -> 268268268
-nextt122 nexttoward -268268268 -268268268 -> -268268268
-nextt123 nexttoward 134134134 134134134 -> 134134134
-nextt124 nexttoward -134134134 -134134134 -> -134134134
-
--- Nmax, Nmin, Ntiny
-nextt131 nexttoward 9.99999999E+384 9.99999999E+384 -> 9.99999999E+384
-nextt132 nexttoward 1E-383 1E-383 -> 1E-383
-nextt133 nexttoward 1.00000000E-383 1.00000000E-383 -> 1.00000000E-383
-nextt134 nexttoward 1E-391 1E-391 -> 1E-391
-
-nextt135 nexttoward -1E-391 -1E-391 -> -1E-391
-nextt136 nexttoward -1.00000000E-383 -1.00000000E-383 -> -1.00000000E-383
-nextt137 nexttoward -1E-383 -1E-383 -> -1E-383
-nextt138 nexttoward -9.99999999E+384 -9.99999999E+384 -> -9.99999999E+384
-
-------- lhs<rhs
-nextt201 nexttoward 0.999999995 Infinity -> 0.999999996
-nextt202 nexttoward 0.999999996 Infinity -> 0.999999997
-nextt203 nexttoward 0.999999997 Infinity -> 0.999999998
-nextt204 nexttoward 0.999999998 Infinity -> 0.999999999
-nextt205 nexttoward 0.999999999 Infinity -> 1.00000000
-nextt206 nexttoward 1.00000000 Infinity -> 1.00000001
-nextt207 nexttoward 1.0 Infinity -> 1.00000001
-nextt208 nexttoward 1 Infinity -> 1.00000001
-nextt209 nexttoward 1.00000001 Infinity -> 1.00000002
-nextt210 nexttoward 1.00000002 Infinity -> 1.00000003
-nextt211 nexttoward 1.00000003 Infinity -> 1.00000004
-nextt212 nexttoward 1.00000004 Infinity -> 1.00000005
-nextt213 nexttoward 1.00000005 Infinity -> 1.00000006
-nextt214 nexttoward 1.00000006 Infinity -> 1.00000007
-nextt215 nexttoward 1.00000007 Infinity -> 1.00000008
-nextt216 nexttoward 1.00000008 Infinity -> 1.00000009
-nextt217 nexttoward 1.00000009 Infinity -> 1.00000010
-nextt218 nexttoward 1.00000010 Infinity -> 1.00000011
-nextt219 nexttoward 1.00000011 Infinity -> 1.00000012
-
-nextt221 nexttoward -0.999999995 Infinity -> -0.999999994
-nextt222 nexttoward -0.999999996 Infinity -> -0.999999995
-nextt223 nexttoward -0.999999997 Infinity -> -0.999999996
-nextt224 nexttoward -0.999999998 Infinity -> -0.999999997
-nextt225 nexttoward -0.999999999 Infinity -> -0.999999998
-nextt226 nexttoward -1.00000000 Infinity -> -0.999999999
-nextt227 nexttoward -1.0 Infinity -> -0.999999999
-nextt228 nexttoward -1 Infinity -> -0.999999999
-nextt229 nexttoward -1.00000001 Infinity -> -1.00000000
-nextt230 nexttoward -1.00000002 Infinity -> -1.00000001
-nextt231 nexttoward -1.00000003 Infinity -> -1.00000002
-nextt232 nexttoward -1.00000004 Infinity -> -1.00000003
-nextt233 nexttoward -1.00000005 Infinity -> -1.00000004
-nextt234 nexttoward -1.00000006 Infinity -> -1.00000005
-nextt235 nexttoward -1.00000007 Infinity -> -1.00000006
-nextt236 nexttoward -1.00000008 Infinity -> -1.00000007
-nextt237 nexttoward -1.00000009 Infinity -> -1.00000008
-nextt238 nexttoward -1.00000010 Infinity -> -1.00000009
-nextt239 nexttoward -1.00000011 Infinity -> -1.00000010
-nextt240 nexttoward -1.00000012 Infinity -> -1.00000011
-
--- input operand is >precision
-nextt241 nexttoward 1.00000010998 Infinity -> 1.00000011
-nextt242 nexttoward 1.00000010999 Infinity -> 1.00000011
-nextt243 nexttoward 1.00000011000 Infinity -> 1.00000012
-nextt244 nexttoward 1.00000011001 Infinity -> 1.00000012
-nextt245 nexttoward 1.00000011002 Infinity -> 1.00000012
-nextt246 nexttoward 1.00000011002 Infinity -> 1.00000012
-nextt247 nexttoward 1.00000011052 Infinity -> 1.00000012
-nextt248 nexttoward 1.00000011552 Infinity -> 1.00000012
-nextt249 nexttoward -1.00000010998 Infinity -> -1.00000010
-nextt250 nexttoward -1.00000010999 Infinity -> -1.00000010
-nextt251 nexttoward -1.00000011000 Infinity -> -1.00000010
-nextt252 nexttoward -1.00000011001 Infinity -> -1.00000011
-nextt253 nexttoward -1.00000011002 Infinity -> -1.00000011
-nextt254 nexttoward -1.00000011002 Infinity -> -1.00000011
-nextt255 nexttoward -1.00000011052 Infinity -> -1.00000011
-nextt256 nexttoward -1.00000011552 Infinity -> -1.00000011
--- ultra-tiny inputs
-nextt260 nexttoward 1E-99999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt261 nexttoward 1E-999999999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt262 nexttoward 1E-391 Infinity -> 2E-391 Underflow Subnormal Inexact Rounded
-nextt263 nexttoward -1E-99999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt264 nexttoward -1E-999999999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt265 nexttoward -1E-391 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
-
--- Zeros
-nextt300 nexttoward 0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt301 nexttoward 0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt302 nexttoward 0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt303 nexttoward 0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt304 nexttoward 0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt305 nexttoward -0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt306 nexttoward -0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt307 nexttoward -0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt308 nexttoward -0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt309 nexttoward -0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
-
--- specials
-nextt350 nexttoward Inf Infinity -> Infinity
-nextt351 nexttoward -Inf Infinity -> -9.99999999E+384
-nextt352 nexttoward NaN Infinity -> NaN
-nextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
-nextt354 nexttoward NaN77 Infinity -> NaN77
-nextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
-nextt356 nexttoward -NaN Infinity -> -NaN
-nextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
-nextt358 nexttoward -NaN77 Infinity -> -NaN77
-nextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-maxExponent: 999
-minexponent: -999
-nextt370 nexttoward 9.99999999E+999 Infinity -> Infinity Overflow Inexact Rounded
-nextt371 nexttoward 9.99999998E+999 Infinity -> 9.99999999E+999
-nextt372 nexttoward 1E-999 Infinity -> 1.00000001E-999
-nextt373 nexttoward 1.00000000E-999 Infinity -> 1.00000001E-999
-nextt374 nexttoward 0.999999999E-999 Infinity -> 1.00000000E-999
-nextt375 nexttoward 0.99999999E-999 Infinity -> 1.00000000E-999
-nextt376 nexttoward 9E-1007 Infinity -> 1.0E-1006 Underflow Subnormal Inexact Rounded
-nextt377 nexttoward 9.9E-1006 Infinity -> 1.00E-1005 Underflow Subnormal Inexact Rounded
-nextt378 nexttoward 9.9999E-1003 Infinity -> 1.00000E-1002 Underflow Subnormal Inexact Rounded
-nextt379 nexttoward 9.9999998E-1000 Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt380 nexttoward 9.9999997E-1000 Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
-nextt381 nexttoward 0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
-nextt382 nexttoward 1E-1007 Infinity -> 2E-1007 Underflow Subnormal Inexact Rounded
-nextt383 nexttoward 2E-1007 Infinity -> 3E-1007 Underflow Subnormal Inexact Rounded
-
-nextt385 nexttoward -0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
-nextt386 nexttoward -1E-1007 Infinity -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped
-nextt387 nexttoward -2E-1007 Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
-nextt388 nexttoward -10E-1007 Infinity -> -9E-1007 Underflow Subnormal Inexact Rounded
-nextt389 nexttoward -100E-1007 Infinity -> -9.9E-1006 Underflow Subnormal Inexact Rounded
-nextt390 nexttoward -100000E-1007 Infinity -> -9.9999E-1003 Underflow Subnormal Inexact Rounded
-nextt391 nexttoward -1.0000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt392 nexttoward -1.00000000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt393 nexttoward -1E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt394 nexttoward -9.99999998E+999 Infinity -> -9.99999997E+999
-nextt395 nexttoward -9.99999999E+999 Infinity -> -9.99999998E+999
-
-------- lhs>rhs
-maxExponent: 384
-minexponent: -383
-nextt401 nexttoward 0.999999995 -Infinity -> 0.999999994
-nextt402 nexttoward 0.999999996 -Infinity -> 0.999999995
-nextt403 nexttoward 0.999999997 -Infinity -> 0.999999996
-nextt404 nexttoward 0.999999998 -Infinity -> 0.999999997
-nextt405 nexttoward 0.999999999 -Infinity -> 0.999999998
-nextt406 nexttoward 1.00000000 -Infinity -> 0.999999999
-nextt407 nexttoward 1.0 -Infinity -> 0.999999999
-nextt408 nexttoward 1 -Infinity -> 0.999999999
-nextt409 nexttoward 1.00000001 -Infinity -> 1.00000000
-nextt410 nexttoward 1.00000002 -Infinity -> 1.00000001
-nextt411 nexttoward 1.00000003 -Infinity -> 1.00000002
-nextt412 nexttoward 1.00000004 -Infinity -> 1.00000003
-nextt413 nexttoward 1.00000005 -Infinity -> 1.00000004
-nextt414 nexttoward 1.00000006 -Infinity -> 1.00000005
-nextt415 nexttoward 1.00000007 -Infinity -> 1.00000006
-nextt416 nexttoward 1.00000008 -Infinity -> 1.00000007
-nextt417 nexttoward 1.00000009 -Infinity -> 1.00000008
-nextt418 nexttoward 1.00000010 -Infinity -> 1.00000009
-nextt419 nexttoward 1.00000011 -Infinity -> 1.00000010
-nextt420 nexttoward 1.00000012 -Infinity -> 1.00000011
-
-nextt421 nexttoward -0.999999995 -Infinity -> -0.999999996
-nextt422 nexttoward -0.999999996 -Infinity -> -0.999999997
-nextt423 nexttoward -0.999999997 -Infinity -> -0.999999998
-nextt424 nexttoward -0.999999998 -Infinity -> -0.999999999
-nextt425 nexttoward -0.999999999 -Infinity -> -1.00000000
-nextt426 nexttoward -1.00000000 -Infinity -> -1.00000001
-nextt427 nexttoward -1.0 -Infinity -> -1.00000001
-nextt428 nexttoward -1 -Infinity -> -1.00000001
-nextt429 nexttoward -1.00000001 -Infinity -> -1.00000002
-nextt430 nexttoward -1.00000002 -Infinity -> -1.00000003
-nextt431 nexttoward -1.00000003 -Infinity -> -1.00000004
-nextt432 nexttoward -1.00000004 -Infinity -> -1.00000005
-nextt433 nexttoward -1.00000005 -Infinity -> -1.00000006
-nextt434 nexttoward -1.00000006 -Infinity -> -1.00000007
-nextt435 nexttoward -1.00000007 -Infinity -> -1.00000008
-nextt436 nexttoward -1.00000008 -Infinity -> -1.00000009
-nextt437 nexttoward -1.00000009 -Infinity -> -1.00000010
-nextt438 nexttoward -1.00000010 -Infinity -> -1.00000011
-nextt439 nexttoward -1.00000011 -Infinity -> -1.00000012
-
--- input operand is >precision
-nextt441 nexttoward 1.00000010998 -Infinity -> 1.00000010
-nextt442 nexttoward 1.00000010999 -Infinity -> 1.00000010
-nextt443 nexttoward 1.00000011000 -Infinity -> 1.00000010
-nextt444 nexttoward 1.00000011001 -Infinity -> 1.00000011
-nextt445 nexttoward 1.00000011002 -Infinity -> 1.00000011
-nextt446 nexttoward 1.00000011002 -Infinity -> 1.00000011
-nextt447 nexttoward 1.00000011052 -Infinity -> 1.00000011
-nextt448 nexttoward 1.00000011552 -Infinity -> 1.00000011
-nextt449 nexttoward -1.00000010998 -Infinity -> -1.00000011
-nextt450 nexttoward -1.00000010999 -Infinity -> -1.00000011
-nextt451 nexttoward -1.00000011000 -Infinity -> -1.00000012
-nextt452 nexttoward -1.00000011001 -Infinity -> -1.00000012
-nextt453 nexttoward -1.00000011002 -Infinity -> -1.00000012
-nextt454 nexttoward -1.00000011002 -Infinity -> -1.00000012
-nextt455 nexttoward -1.00000011052 -Infinity -> -1.00000012
-nextt456 nexttoward -1.00000011552 -Infinity -> -1.00000012
--- ultra-tiny inputs
-nextt460 nexttoward 1E-99999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt461 nexttoward 1E-999999999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt462 nexttoward 1E-391 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
-nextt463 nexttoward -1E-99999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt464 nexttoward -1E-999999999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt465 nexttoward -1E-391 -Infinity -> -2E-391 Underflow Subnormal Inexact Rounded
-
--- Zeros
-nextt500 nexttoward -0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt501 nexttoward 0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt502 nexttoward 0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt503 nexttoward -0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt504 nexttoward 0E-300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt505 nexttoward 0E+300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt506 nexttoward 0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt507 nexttoward -0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt508 nexttoward 0.00 -0.0000 -> -0.00
-
--- specials
-nextt550 nexttoward Inf -Infinity -> 9.99999999E+384
-nextt551 nexttoward -Inf -Infinity -> -Infinity
-nextt552 nexttoward NaN -Infinity -> NaN
-nextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
-nextt554 nexttoward NaN77 -Infinity -> NaN77
-nextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
-nextt556 nexttoward -NaN -Infinity -> -NaN
-nextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
-nextt558 nexttoward -NaN77 -Infinity -> -NaN77
-nextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
-
--- Nmax, Nmin, Ntiny, subnormals
-maxExponent: 999
-minexponent: -999
-nextt570 nexttoward 9.99999999E+999 -Infinity -> 9.99999998E+999
-nextt571 nexttoward 9.99999998E+999 -Infinity -> 9.99999997E+999
-nextt572 nexttoward 1E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt573 nexttoward 1.00000000E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
-nextt574 nexttoward 9E-1007 -Infinity -> 8E-1007 Underflow Subnormal Inexact Rounded
-nextt575 nexttoward 9.9E-1006 -Infinity -> 9.8E-1006 Underflow Subnormal Inexact Rounded
-nextt576 nexttoward 9.9999E-1003 -Infinity -> 9.9998E-1003 Underflow Subnormal Inexact Rounded
-nextt577 nexttoward 9.9999999E-1000 -Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
-nextt578 nexttoward 9.9999998E-1000 -Infinity -> 9.9999997E-1000 Underflow Subnormal Inexact Rounded
-nextt579 nexttoward 9.9999997E-1000 -Infinity -> 9.9999996E-1000 Underflow Subnormal Inexact Rounded
-nextt580 nexttoward 0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
-nextt581 nexttoward 1E-1007 -Infinity -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
-nextt582 nexttoward 2E-1007 -Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
-
-nextt583 nexttoward -0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
-nextt584 nexttoward -1E-1007 -Infinity -> -2E-1007 Underflow Subnormal Inexact Rounded
-nextt585 nexttoward -2E-1007 -Infinity -> -3E-1007 Underflow Subnormal Inexact Rounded
-nextt586 nexttoward -10E-1007 -Infinity -> -1.1E-1006 Underflow Subnormal Inexact Rounded
-nextt587 nexttoward -100E-1007 -Infinity -> -1.01E-1005 Underflow Subnormal Inexact Rounded
-nextt588 nexttoward -100000E-1007 -Infinity -> -1.00001E-1002 Underflow Subnormal Inexact Rounded
-nextt589 nexttoward -1.0000E-999 -Infinity -> -1.00000001E-999
-nextt590 nexttoward -1.00000000E-999 -Infinity -> -1.00000001E-999
-nextt591 nexttoward -1E-999 -Infinity -> -1.00000001E-999
-nextt592 nexttoward -9.99999998E+999 -Infinity -> -9.99999999E+999
-nextt593 nexttoward -9.99999999E+999 -Infinity -> -Infinity Overflow Inexact Rounded
-
-
-
-
-------- Specials
-maxExponent: 384
-minexponent: -383
-nextt780 nexttoward -Inf -Inf -> -Infinity
-nextt781 nexttoward -Inf -1000 -> -9.99999999E+384
-nextt782 nexttoward -Inf -1 -> -9.99999999E+384
-nextt783 nexttoward -Inf -0 -> -9.99999999E+384
-nextt784 nexttoward -Inf 0 -> -9.99999999E+384
-nextt785 nexttoward -Inf 1 -> -9.99999999E+384
-nextt786 nexttoward -Inf 1000 -> -9.99999999E+384
-nextt787 nexttoward -1000 -Inf -> -1000.00001
-nextt788 nexttoward -Inf -Inf -> -Infinity
-nextt789 nexttoward -1 -Inf -> -1.00000001
-nextt790 nexttoward -0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt791 nexttoward 0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded
-nextt792 nexttoward 1 -Inf -> 0.999999999
-nextt793 nexttoward 1000 -Inf -> 999.999999
-nextt794 nexttoward Inf -Inf -> 9.99999999E+384
-
-nextt800 nexttoward Inf -Inf -> 9.99999999E+384
-nextt801 nexttoward Inf -1000 -> 9.99999999E+384
-nextt802 nexttoward Inf -1 -> 9.99999999E+384
-nextt803 nexttoward Inf -0 -> 9.99999999E+384
-nextt804 nexttoward Inf 0 -> 9.99999999E+384
-nextt805 nexttoward Inf 1 -> 9.99999999E+384
-nextt806 nexttoward Inf 1000 -> 9.99999999E+384
-nextt807 nexttoward Inf Inf -> Infinity
-nextt808 nexttoward -1000 Inf -> -999.999999
-nextt809 nexttoward -Inf Inf -> -9.99999999E+384
-nextt810 nexttoward -1 Inf -> -0.999999999
-nextt811 nexttoward -0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt812 nexttoward 0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded
-nextt813 nexttoward 1 Inf -> 1.00000001
-nextt814 nexttoward 1000 Inf -> 1000.00001
-nextt815 nexttoward Inf Inf -> Infinity
-
-nextt821 nexttoward NaN -Inf -> NaN
-nextt822 nexttoward NaN -1000 -> NaN
-nextt823 nexttoward NaN -1 -> NaN
-nextt824 nexttoward NaN -0 -> NaN
-nextt825 nexttoward NaN 0 -> NaN
-nextt826 nexttoward NaN 1 -> NaN
-nextt827 nexttoward NaN 1000 -> NaN
-nextt828 nexttoward NaN Inf -> NaN
-nextt829 nexttoward NaN NaN -> NaN
-nextt830 nexttoward -Inf NaN -> NaN
-nextt831 nexttoward -1000 NaN -> NaN
-nextt832 nexttoward -1 NaN -> NaN
-nextt833 nexttoward -0 NaN -> NaN
-nextt834 nexttoward 0 NaN -> NaN
-nextt835 nexttoward 1 NaN -> NaN
-nextt836 nexttoward 1000 NaN -> NaN
-nextt837 nexttoward Inf NaN -> NaN
-
-nextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
-nextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
-nextt843 nexttoward sNaN -1 -> NaN Invalid_operation
-nextt844 nexttoward sNaN -0 -> NaN Invalid_operation
-nextt845 nexttoward sNaN 0 -> NaN Invalid_operation
-nextt846 nexttoward sNaN 1 -> NaN Invalid_operation
-nextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
-nextt848 nexttoward sNaN NaN -> NaN Invalid_operation
-nextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
-nextt850 nexttoward NaN sNaN -> NaN Invalid_operation
-nextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
-nextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
-nextt853 nexttoward -1 sNaN -> NaN Invalid_operation
-nextt854 nexttoward -0 sNaN -> NaN Invalid_operation
-nextt855 nexttoward 0 sNaN -> NaN Invalid_operation
-nextt856 nexttoward 1 sNaN -> NaN Invalid_operation
-nextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
-nextt858 nexttoward Inf sNaN -> NaN Invalid_operation
-nextt859 nexttoward NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-nextt861 nexttoward NaN1 -Inf -> NaN1
-nextt862 nexttoward +NaN2 -1000 -> NaN2
-nextt863 nexttoward NaN3 1000 -> NaN3
-nextt864 nexttoward NaN4 Inf -> NaN4
-nextt865 nexttoward NaN5 +NaN6 -> NaN5
-nextt866 nexttoward -Inf NaN7 -> NaN7
-nextt867 nexttoward -1000 NaN8 -> NaN8
-nextt868 nexttoward 1000 NaN9 -> NaN9
-nextt869 nexttoward Inf +NaN10 -> NaN10
-nextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
-nextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
-nextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
-nextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
-nextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
-nextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
-nextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
-nextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
-nextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
-nextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
-nextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
-nextt882 nexttoward -NaN26 NaN28 -> -NaN26
-nextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-nextt884 nexttoward 1000 -NaN30 -> -NaN30
-nextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- Null tests
-nextt900 nexttoward 1 # -> NaN Invalid_operation
-nextt901 nexttoward # 1 -> NaN Invalid_operation
-
+------------------------------------------------------------------------
+-- nexttoward.decTest -- decimal next toward rhs [754r nextafter] --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 384
+minexponent: -383
+
+-- Sanity check with a scattering of numerics
+nextt001 nexttoward 10 10 -> 10
+nextt002 nexttoward -10 -10 -> -10
+nextt003 nexttoward 1 10 -> 1.00000001
+nextt004 nexttoward 1 -10 -> 0.999999999
+nextt005 nexttoward -1 10 -> -0.999999999
+nextt006 nexttoward -1 -10 -> -1.00000001
+nextt007 nexttoward 0 10 -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt008 nexttoward 0 -10 -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt009 nexttoward 9.99999999E+384 +Infinity -> Infinity Overflow Inexact Rounded
+nextt010 nexttoward -9.99999999E+384 -Infinity -> -Infinity Overflow Inexact Rounded
+
+------- lhs=rhs
+-- finites
+nextt101 nexttoward 7 7 -> 7
+nextt102 nexttoward -7 -7 -> -7
+nextt103 nexttoward 75 75 -> 75
+nextt104 nexttoward -75 -75 -> -75
+nextt105 nexttoward 7.50 7.5 -> 7.50
+nextt106 nexttoward -7.50 -7.50 -> -7.50
+nextt107 nexttoward 7.500 7.5000 -> 7.500
+nextt108 nexttoward -7.500 -7.5 -> -7.500
+
+-- zeros
+nextt111 nexttoward 0 0 -> 0
+nextt112 nexttoward -0 -0 -> -0
+nextt113 nexttoward 0E+4 0 -> 0E+4
+nextt114 nexttoward -0E+4 -0 -> -0E+4
+nextt115 nexttoward 0.0000 0.00000 -> 0.0000
+nextt116 nexttoward -0.0000 -0.00 -> -0.0000
+nextt117 nexttoward 0E-141 0 -> 0E-141
+nextt118 nexttoward -0E-141 -000 -> -0E-141
+
+-- full coefficients, alternating bits
+nextt121 nexttoward 268268268 268268268 -> 268268268
+nextt122 nexttoward -268268268 -268268268 -> -268268268
+nextt123 nexttoward 134134134 134134134 -> 134134134
+nextt124 nexttoward -134134134 -134134134 -> -134134134
+
+-- Nmax, Nmin, Ntiny
+nextt131 nexttoward 9.99999999E+384 9.99999999E+384 -> 9.99999999E+384
+nextt132 nexttoward 1E-383 1E-383 -> 1E-383
+nextt133 nexttoward 1.00000000E-383 1.00000000E-383 -> 1.00000000E-383
+nextt134 nexttoward 1E-391 1E-391 -> 1E-391
+
+nextt135 nexttoward -1E-391 -1E-391 -> -1E-391
+nextt136 nexttoward -1.00000000E-383 -1.00000000E-383 -> -1.00000000E-383
+nextt137 nexttoward -1E-383 -1E-383 -> -1E-383
+nextt138 nexttoward -9.99999999E+384 -9.99999999E+384 -> -9.99999999E+384
+
+------- lhs<rhs
+nextt201 nexttoward 0.999999995 Infinity -> 0.999999996
+nextt202 nexttoward 0.999999996 Infinity -> 0.999999997
+nextt203 nexttoward 0.999999997 Infinity -> 0.999999998
+nextt204 nexttoward 0.999999998 Infinity -> 0.999999999
+nextt205 nexttoward 0.999999999 Infinity -> 1.00000000
+nextt206 nexttoward 1.00000000 Infinity -> 1.00000001
+nextt207 nexttoward 1.0 Infinity -> 1.00000001
+nextt208 nexttoward 1 Infinity -> 1.00000001
+nextt209 nexttoward 1.00000001 Infinity -> 1.00000002
+nextt210 nexttoward 1.00000002 Infinity -> 1.00000003
+nextt211 nexttoward 1.00000003 Infinity -> 1.00000004
+nextt212 nexttoward 1.00000004 Infinity -> 1.00000005
+nextt213 nexttoward 1.00000005 Infinity -> 1.00000006
+nextt214 nexttoward 1.00000006 Infinity -> 1.00000007
+nextt215 nexttoward 1.00000007 Infinity -> 1.00000008
+nextt216 nexttoward 1.00000008 Infinity -> 1.00000009
+nextt217 nexttoward 1.00000009 Infinity -> 1.00000010
+nextt218 nexttoward 1.00000010 Infinity -> 1.00000011
+nextt219 nexttoward 1.00000011 Infinity -> 1.00000012
+
+nextt221 nexttoward -0.999999995 Infinity -> -0.999999994
+nextt222 nexttoward -0.999999996 Infinity -> -0.999999995
+nextt223 nexttoward -0.999999997 Infinity -> -0.999999996
+nextt224 nexttoward -0.999999998 Infinity -> -0.999999997
+nextt225 nexttoward -0.999999999 Infinity -> -0.999999998
+nextt226 nexttoward -1.00000000 Infinity -> -0.999999999
+nextt227 nexttoward -1.0 Infinity -> -0.999999999
+nextt228 nexttoward -1 Infinity -> -0.999999999
+nextt229 nexttoward -1.00000001 Infinity -> -1.00000000
+nextt230 nexttoward -1.00000002 Infinity -> -1.00000001
+nextt231 nexttoward -1.00000003 Infinity -> -1.00000002
+nextt232 nexttoward -1.00000004 Infinity -> -1.00000003
+nextt233 nexttoward -1.00000005 Infinity -> -1.00000004
+nextt234 nexttoward -1.00000006 Infinity -> -1.00000005
+nextt235 nexttoward -1.00000007 Infinity -> -1.00000006
+nextt236 nexttoward -1.00000008 Infinity -> -1.00000007
+nextt237 nexttoward -1.00000009 Infinity -> -1.00000008
+nextt238 nexttoward -1.00000010 Infinity -> -1.00000009
+nextt239 nexttoward -1.00000011 Infinity -> -1.00000010
+nextt240 nexttoward -1.00000012 Infinity -> -1.00000011
+
+-- input operand is >precision
+nextt241 nexttoward 1.00000010998 Infinity -> 1.00000011
+nextt242 nexttoward 1.00000010999 Infinity -> 1.00000011
+nextt243 nexttoward 1.00000011000 Infinity -> 1.00000012
+nextt244 nexttoward 1.00000011001 Infinity -> 1.00000012
+nextt245 nexttoward 1.00000011002 Infinity -> 1.00000012
+nextt246 nexttoward 1.00000011002 Infinity -> 1.00000012
+nextt247 nexttoward 1.00000011052 Infinity -> 1.00000012
+nextt248 nexttoward 1.00000011552 Infinity -> 1.00000012
+nextt249 nexttoward -1.00000010998 Infinity -> -1.00000010
+nextt250 nexttoward -1.00000010999 Infinity -> -1.00000010
+nextt251 nexttoward -1.00000011000 Infinity -> -1.00000010
+nextt252 nexttoward -1.00000011001 Infinity -> -1.00000011
+nextt253 nexttoward -1.00000011002 Infinity -> -1.00000011
+nextt254 nexttoward -1.00000011002 Infinity -> -1.00000011
+nextt255 nexttoward -1.00000011052 Infinity -> -1.00000011
+nextt256 nexttoward -1.00000011552 Infinity -> -1.00000011
+-- ultra-tiny inputs
+nextt260 nexttoward 1E-99999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt261 nexttoward 1E-999999999 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt262 nexttoward 1E-391 Infinity -> 2E-391 Underflow Subnormal Inexact Rounded
+nextt263 nexttoward -1E-99999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt264 nexttoward -1E-999999999 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt265 nexttoward -1E-391 Infinity -> -0E-391 Underflow Subnormal Inexact Rounded Clamped
+
+-- Zeros
+nextt300 nexttoward 0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt301 nexttoward 0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt302 nexttoward 0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt303 nexttoward 0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt304 nexttoward 0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt305 nexttoward -0 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt306 nexttoward -0.00 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt307 nexttoward -0E-300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt308 nexttoward -0E+300 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt309 nexttoward -0E+30000 Infinity -> 1E-391 Underflow Subnormal Inexact Rounded
+
+-- specials
+nextt350 nexttoward Inf Infinity -> Infinity
+nextt351 nexttoward -Inf Infinity -> -9.99999999E+384
+nextt352 nexttoward NaN Infinity -> NaN
+nextt353 nexttoward sNaN Infinity -> NaN Invalid_operation
+nextt354 nexttoward NaN77 Infinity -> NaN77
+nextt355 nexttoward sNaN88 Infinity -> NaN88 Invalid_operation
+nextt356 nexttoward -NaN Infinity -> -NaN
+nextt357 nexttoward -sNaN Infinity -> -NaN Invalid_operation
+nextt358 nexttoward -NaN77 Infinity -> -NaN77
+nextt359 nexttoward -sNaN88 Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+maxExponent: 999
+minexponent: -999
+nextt370 nexttoward 9.99999999E+999 Infinity -> Infinity Overflow Inexact Rounded
+nextt371 nexttoward 9.99999998E+999 Infinity -> 9.99999999E+999
+nextt372 nexttoward 1E-999 Infinity -> 1.00000001E-999
+nextt373 nexttoward 1.00000000E-999 Infinity -> 1.00000001E-999
+nextt374 nexttoward 0.999999999E-999 Infinity -> 1.00000000E-999
+nextt375 nexttoward 0.99999999E-999 Infinity -> 1.00000000E-999
+nextt376 nexttoward 9E-1007 Infinity -> 1.0E-1006 Underflow Subnormal Inexact Rounded
+nextt377 nexttoward 9.9E-1006 Infinity -> 1.00E-1005 Underflow Subnormal Inexact Rounded
+nextt378 nexttoward 9.9999E-1003 Infinity -> 1.00000E-1002 Underflow Subnormal Inexact Rounded
+nextt379 nexttoward 9.9999998E-1000 Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt380 nexttoward 9.9999997E-1000 Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
+nextt381 nexttoward 0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
+nextt382 nexttoward 1E-1007 Infinity -> 2E-1007 Underflow Subnormal Inexact Rounded
+nextt383 nexttoward 2E-1007 Infinity -> 3E-1007 Underflow Subnormal Inexact Rounded
+
+nextt385 nexttoward -0E-1007 Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
+nextt386 nexttoward -1E-1007 Infinity -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped
+nextt387 nexttoward -2E-1007 Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
+nextt388 nexttoward -10E-1007 Infinity -> -9E-1007 Underflow Subnormal Inexact Rounded
+nextt389 nexttoward -100E-1007 Infinity -> -9.9E-1006 Underflow Subnormal Inexact Rounded
+nextt390 nexttoward -100000E-1007 Infinity -> -9.9999E-1003 Underflow Subnormal Inexact Rounded
+nextt391 nexttoward -1.0000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt392 nexttoward -1.00000000E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt393 nexttoward -1E-999 Infinity -> -9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt394 nexttoward -9.99999998E+999 Infinity -> -9.99999997E+999
+nextt395 nexttoward -9.99999999E+999 Infinity -> -9.99999998E+999
+
+------- lhs>rhs
+maxExponent: 384
+minexponent: -383
+nextt401 nexttoward 0.999999995 -Infinity -> 0.999999994
+nextt402 nexttoward 0.999999996 -Infinity -> 0.999999995
+nextt403 nexttoward 0.999999997 -Infinity -> 0.999999996
+nextt404 nexttoward 0.999999998 -Infinity -> 0.999999997
+nextt405 nexttoward 0.999999999 -Infinity -> 0.999999998
+nextt406 nexttoward 1.00000000 -Infinity -> 0.999999999
+nextt407 nexttoward 1.0 -Infinity -> 0.999999999
+nextt408 nexttoward 1 -Infinity -> 0.999999999
+nextt409 nexttoward 1.00000001 -Infinity -> 1.00000000
+nextt410 nexttoward 1.00000002 -Infinity -> 1.00000001
+nextt411 nexttoward 1.00000003 -Infinity -> 1.00000002
+nextt412 nexttoward 1.00000004 -Infinity -> 1.00000003
+nextt413 nexttoward 1.00000005 -Infinity -> 1.00000004
+nextt414 nexttoward 1.00000006 -Infinity -> 1.00000005
+nextt415 nexttoward 1.00000007 -Infinity -> 1.00000006
+nextt416 nexttoward 1.00000008 -Infinity -> 1.00000007
+nextt417 nexttoward 1.00000009 -Infinity -> 1.00000008
+nextt418 nexttoward 1.00000010 -Infinity -> 1.00000009
+nextt419 nexttoward 1.00000011 -Infinity -> 1.00000010
+nextt420 nexttoward 1.00000012 -Infinity -> 1.00000011
+
+nextt421 nexttoward -0.999999995 -Infinity -> -0.999999996
+nextt422 nexttoward -0.999999996 -Infinity -> -0.999999997
+nextt423 nexttoward -0.999999997 -Infinity -> -0.999999998
+nextt424 nexttoward -0.999999998 -Infinity -> -0.999999999
+nextt425 nexttoward -0.999999999 -Infinity -> -1.00000000
+nextt426 nexttoward -1.00000000 -Infinity -> -1.00000001
+nextt427 nexttoward -1.0 -Infinity -> -1.00000001
+nextt428 nexttoward -1 -Infinity -> -1.00000001
+nextt429 nexttoward -1.00000001 -Infinity -> -1.00000002
+nextt430 nexttoward -1.00000002 -Infinity -> -1.00000003
+nextt431 nexttoward -1.00000003 -Infinity -> -1.00000004
+nextt432 nexttoward -1.00000004 -Infinity -> -1.00000005
+nextt433 nexttoward -1.00000005 -Infinity -> -1.00000006
+nextt434 nexttoward -1.00000006 -Infinity -> -1.00000007
+nextt435 nexttoward -1.00000007 -Infinity -> -1.00000008
+nextt436 nexttoward -1.00000008 -Infinity -> -1.00000009
+nextt437 nexttoward -1.00000009 -Infinity -> -1.00000010
+nextt438 nexttoward -1.00000010 -Infinity -> -1.00000011
+nextt439 nexttoward -1.00000011 -Infinity -> -1.00000012
+
+-- input operand is >precision
+nextt441 nexttoward 1.00000010998 -Infinity -> 1.00000010
+nextt442 nexttoward 1.00000010999 -Infinity -> 1.00000010
+nextt443 nexttoward 1.00000011000 -Infinity -> 1.00000010
+nextt444 nexttoward 1.00000011001 -Infinity -> 1.00000011
+nextt445 nexttoward 1.00000011002 -Infinity -> 1.00000011
+nextt446 nexttoward 1.00000011002 -Infinity -> 1.00000011
+nextt447 nexttoward 1.00000011052 -Infinity -> 1.00000011
+nextt448 nexttoward 1.00000011552 -Infinity -> 1.00000011
+nextt449 nexttoward -1.00000010998 -Infinity -> -1.00000011
+nextt450 nexttoward -1.00000010999 -Infinity -> -1.00000011
+nextt451 nexttoward -1.00000011000 -Infinity -> -1.00000012
+nextt452 nexttoward -1.00000011001 -Infinity -> -1.00000012
+nextt453 nexttoward -1.00000011002 -Infinity -> -1.00000012
+nextt454 nexttoward -1.00000011002 -Infinity -> -1.00000012
+nextt455 nexttoward -1.00000011052 -Infinity -> -1.00000012
+nextt456 nexttoward -1.00000011552 -Infinity -> -1.00000012
+-- ultra-tiny inputs
+nextt460 nexttoward 1E-99999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt461 nexttoward 1E-999999999 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt462 nexttoward 1E-391 -Infinity -> 0E-391 Underflow Subnormal Inexact Rounded Clamped
+nextt463 nexttoward -1E-99999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt464 nexttoward -1E-999999999 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt465 nexttoward -1E-391 -Infinity -> -2E-391 Underflow Subnormal Inexact Rounded
+
+-- Zeros
+nextt500 nexttoward -0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt501 nexttoward 0 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt502 nexttoward 0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt503 nexttoward -0.00 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt504 nexttoward 0E-300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt505 nexttoward 0E+300 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt506 nexttoward 0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt507 nexttoward -0E+30000 -Infinity -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt508 nexttoward 0.00 -0.0000 -> -0.00
+
+-- specials
+nextt550 nexttoward Inf -Infinity -> 9.99999999E+384
+nextt551 nexttoward -Inf -Infinity -> -Infinity
+nextt552 nexttoward NaN -Infinity -> NaN
+nextt553 nexttoward sNaN -Infinity -> NaN Invalid_operation
+nextt554 nexttoward NaN77 -Infinity -> NaN77
+nextt555 nexttoward sNaN88 -Infinity -> NaN88 Invalid_operation
+nextt556 nexttoward -NaN -Infinity -> -NaN
+nextt557 nexttoward -sNaN -Infinity -> -NaN Invalid_operation
+nextt558 nexttoward -NaN77 -Infinity -> -NaN77
+nextt559 nexttoward -sNaN88 -Infinity -> -NaN88 Invalid_operation
+
+-- Nmax, Nmin, Ntiny, subnormals
+maxExponent: 999
+minexponent: -999
+nextt570 nexttoward 9.99999999E+999 -Infinity -> 9.99999998E+999
+nextt571 nexttoward 9.99999998E+999 -Infinity -> 9.99999997E+999
+nextt572 nexttoward 1E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt573 nexttoward 1.00000000E-999 -Infinity -> 9.9999999E-1000 Underflow Subnormal Inexact Rounded
+nextt574 nexttoward 9E-1007 -Infinity -> 8E-1007 Underflow Subnormal Inexact Rounded
+nextt575 nexttoward 9.9E-1006 -Infinity -> 9.8E-1006 Underflow Subnormal Inexact Rounded
+nextt576 nexttoward 9.9999E-1003 -Infinity -> 9.9998E-1003 Underflow Subnormal Inexact Rounded
+nextt577 nexttoward 9.9999999E-1000 -Infinity -> 9.9999998E-1000 Underflow Subnormal Inexact Rounded
+nextt578 nexttoward 9.9999998E-1000 -Infinity -> 9.9999997E-1000 Underflow Subnormal Inexact Rounded
+nextt579 nexttoward 9.9999997E-1000 -Infinity -> 9.9999996E-1000 Underflow Subnormal Inexact Rounded
+nextt580 nexttoward 0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
+nextt581 nexttoward 1E-1007 -Infinity -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
+nextt582 nexttoward 2E-1007 -Infinity -> 1E-1007 Underflow Subnormal Inexact Rounded
+
+nextt583 nexttoward -0E-1007 -Infinity -> -1E-1007 Underflow Subnormal Inexact Rounded
+nextt584 nexttoward -1E-1007 -Infinity -> -2E-1007 Underflow Subnormal Inexact Rounded
+nextt585 nexttoward -2E-1007 -Infinity -> -3E-1007 Underflow Subnormal Inexact Rounded
+nextt586 nexttoward -10E-1007 -Infinity -> -1.1E-1006 Underflow Subnormal Inexact Rounded
+nextt587 nexttoward -100E-1007 -Infinity -> -1.01E-1005 Underflow Subnormal Inexact Rounded
+nextt588 nexttoward -100000E-1007 -Infinity -> -1.00001E-1002 Underflow Subnormal Inexact Rounded
+nextt589 nexttoward -1.0000E-999 -Infinity -> -1.00000001E-999
+nextt590 nexttoward -1.00000000E-999 -Infinity -> -1.00000001E-999
+nextt591 nexttoward -1E-999 -Infinity -> -1.00000001E-999
+nextt592 nexttoward -9.99999998E+999 -Infinity -> -9.99999999E+999
+nextt593 nexttoward -9.99999999E+999 -Infinity -> -Infinity Overflow Inexact Rounded
+
+
+
+
+------- Specials
+maxExponent: 384
+minexponent: -383
+nextt780 nexttoward -Inf -Inf -> -Infinity
+nextt781 nexttoward -Inf -1000 -> -9.99999999E+384
+nextt782 nexttoward -Inf -1 -> -9.99999999E+384
+nextt783 nexttoward -Inf -0 -> -9.99999999E+384
+nextt784 nexttoward -Inf 0 -> -9.99999999E+384
+nextt785 nexttoward -Inf 1 -> -9.99999999E+384
+nextt786 nexttoward -Inf 1000 -> -9.99999999E+384
+nextt787 nexttoward -1000 -Inf -> -1000.00001
+nextt788 nexttoward -Inf -Inf -> -Infinity
+nextt789 nexttoward -1 -Inf -> -1.00000001
+nextt790 nexttoward -0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt791 nexttoward 0 -Inf -> -1E-391 Underflow Subnormal Inexact Rounded
+nextt792 nexttoward 1 -Inf -> 0.999999999
+nextt793 nexttoward 1000 -Inf -> 999.999999
+nextt794 nexttoward Inf -Inf -> 9.99999999E+384
+
+nextt800 nexttoward Inf -Inf -> 9.99999999E+384
+nextt801 nexttoward Inf -1000 -> 9.99999999E+384
+nextt802 nexttoward Inf -1 -> 9.99999999E+384
+nextt803 nexttoward Inf -0 -> 9.99999999E+384
+nextt804 nexttoward Inf 0 -> 9.99999999E+384
+nextt805 nexttoward Inf 1 -> 9.99999999E+384
+nextt806 nexttoward Inf 1000 -> 9.99999999E+384
+nextt807 nexttoward Inf Inf -> Infinity
+nextt808 nexttoward -1000 Inf -> -999.999999
+nextt809 nexttoward -Inf Inf -> -9.99999999E+384
+nextt810 nexttoward -1 Inf -> -0.999999999
+nextt811 nexttoward -0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt812 nexttoward 0 Inf -> 1E-391 Underflow Subnormal Inexact Rounded
+nextt813 nexttoward 1 Inf -> 1.00000001
+nextt814 nexttoward 1000 Inf -> 1000.00001
+nextt815 nexttoward Inf Inf -> Infinity
+
+nextt821 nexttoward NaN -Inf -> NaN
+nextt822 nexttoward NaN -1000 -> NaN
+nextt823 nexttoward NaN -1 -> NaN
+nextt824 nexttoward NaN -0 -> NaN
+nextt825 nexttoward NaN 0 -> NaN
+nextt826 nexttoward NaN 1 -> NaN
+nextt827 nexttoward NaN 1000 -> NaN
+nextt828 nexttoward NaN Inf -> NaN
+nextt829 nexttoward NaN NaN -> NaN
+nextt830 nexttoward -Inf NaN -> NaN
+nextt831 nexttoward -1000 NaN -> NaN
+nextt832 nexttoward -1 NaN -> NaN
+nextt833 nexttoward -0 NaN -> NaN
+nextt834 nexttoward 0 NaN -> NaN
+nextt835 nexttoward 1 NaN -> NaN
+nextt836 nexttoward 1000 NaN -> NaN
+nextt837 nexttoward Inf NaN -> NaN
+
+nextt841 nexttoward sNaN -Inf -> NaN Invalid_operation
+nextt842 nexttoward sNaN -1000 -> NaN Invalid_operation
+nextt843 nexttoward sNaN -1 -> NaN Invalid_operation
+nextt844 nexttoward sNaN -0 -> NaN Invalid_operation
+nextt845 nexttoward sNaN 0 -> NaN Invalid_operation
+nextt846 nexttoward sNaN 1 -> NaN Invalid_operation
+nextt847 nexttoward sNaN 1000 -> NaN Invalid_operation
+nextt848 nexttoward sNaN NaN -> NaN Invalid_operation
+nextt849 nexttoward sNaN sNaN -> NaN Invalid_operation
+nextt850 nexttoward NaN sNaN -> NaN Invalid_operation
+nextt851 nexttoward -Inf sNaN -> NaN Invalid_operation
+nextt852 nexttoward -1000 sNaN -> NaN Invalid_operation
+nextt853 nexttoward -1 sNaN -> NaN Invalid_operation
+nextt854 nexttoward -0 sNaN -> NaN Invalid_operation
+nextt855 nexttoward 0 sNaN -> NaN Invalid_operation
+nextt856 nexttoward 1 sNaN -> NaN Invalid_operation
+nextt857 nexttoward 1000 sNaN -> NaN Invalid_operation
+nextt858 nexttoward Inf sNaN -> NaN Invalid_operation
+nextt859 nexttoward NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+nextt861 nexttoward NaN1 -Inf -> NaN1
+nextt862 nexttoward +NaN2 -1000 -> NaN2
+nextt863 nexttoward NaN3 1000 -> NaN3
+nextt864 nexttoward NaN4 Inf -> NaN4
+nextt865 nexttoward NaN5 +NaN6 -> NaN5
+nextt866 nexttoward -Inf NaN7 -> NaN7
+nextt867 nexttoward -1000 NaN8 -> NaN8
+nextt868 nexttoward 1000 NaN9 -> NaN9
+nextt869 nexttoward Inf +NaN10 -> NaN10
+nextt871 nexttoward sNaN11 -Inf -> NaN11 Invalid_operation
+nextt872 nexttoward sNaN12 -1000 -> NaN12 Invalid_operation
+nextt873 nexttoward sNaN13 1000 -> NaN13 Invalid_operation
+nextt874 nexttoward sNaN14 NaN17 -> NaN14 Invalid_operation
+nextt875 nexttoward sNaN15 sNaN18 -> NaN15 Invalid_operation
+nextt876 nexttoward NaN16 sNaN19 -> NaN19 Invalid_operation
+nextt877 nexttoward -Inf +sNaN20 -> NaN20 Invalid_operation
+nextt878 nexttoward -1000 sNaN21 -> NaN21 Invalid_operation
+nextt879 nexttoward 1000 sNaN22 -> NaN22 Invalid_operation
+nextt880 nexttoward Inf sNaN23 -> NaN23 Invalid_operation
+nextt881 nexttoward +NaN25 +sNaN24 -> NaN24 Invalid_operation
+nextt882 nexttoward -NaN26 NaN28 -> -NaN26
+nextt883 nexttoward -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+nextt884 nexttoward 1000 -NaN30 -> -NaN30
+nextt885 nexttoward 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- Null tests
+nextt900 nexttoward 1 # -> NaN Invalid_operation
+nextt901 nexttoward # 1 -> NaN Invalid_operation
+
diff --git a/Lib/test/decimaltestdata/or.decTest b/Lib/test/decimaltestdata/or.decTest
index f471d0b6ce..1aebff4e00 100644
--- a/Lib/test/decimaltestdata/or.decTest
+++ b/Lib/test/decimaltestdata/or.decTest
@@ -1,334 +1,334 @@
-------------------------------------------------------------------------
--- or.decTest -- digitwise logical OR --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check (truth table)
-orx001 or 0 0 -> 0
-orx002 or 0 1 -> 1
-orx003 or 1 0 -> 1
-orx004 or 1 1 -> 1
-orx005 or 1100 1010 -> 1110
--- and at msd and msd-1
-orx006 or 000000000 000000000 -> 0
-orx007 or 000000000 100000000 -> 100000000
-orx008 or 100000000 000000000 -> 100000000
-orx009 or 100000000 100000000 -> 100000000
-orx010 or 000000000 000000000 -> 0
-orx011 or 000000000 010000000 -> 10000000
-orx012 or 010000000 000000000 -> 10000000
-orx013 or 010000000 010000000 -> 10000000
-
--- Various lengths
--- 123456789 123456789 123456789
-orx021 or 111111111 111111111 -> 111111111
-orx022 or 111111111111 111111111 -> 111111111
-orx023 or 11111111 11111111 -> 11111111
-orx025 or 1111111 1111111 -> 1111111
-orx026 or 111111 111111 -> 111111
-orx027 or 11111 11111 -> 11111
-orx028 or 1111 1111 -> 1111
-orx029 or 111 111 -> 111
-orx031 or 11 11 -> 11
-orx032 or 1 1 -> 1
-orx033 or 111111111111 1111111111 -> 111111111
-orx034 or 11111111111 11111111111 -> 111111111
-orx035 or 1111111111 111111111111 -> 111111111
-orx036 or 111111111 1111111111111 -> 111111111
-
-orx040 or 111111111 111111111111 -> 111111111
-orx041 or 11111111 111111111111 -> 111111111
-orx042 or 11111111 111111111 -> 111111111
-orx043 or 1111111 100000010 -> 101111111
-orx044 or 111111 100000100 -> 100111111
-orx045 or 11111 100001000 -> 100011111
-orx046 or 1111 100010000 -> 100011111
-orx047 or 111 100100000 -> 100100111
-orx048 or 11 101000000 -> 101000011
-orx049 or 1 110000000 -> 110000001
-
-orx050 or 1111111111 1 -> 111111111
-orx051 or 111111111 1 -> 111111111
-orx052 or 11111111 1 -> 11111111
-orx053 or 1111111 1 -> 1111111
-orx054 or 111111 1 -> 111111
-orx055 or 11111 1 -> 11111
-orx056 or 1111 1 -> 1111
-orx057 or 111 1 -> 111
-orx058 or 11 1 -> 11
-orx059 or 1 1 -> 1
-
-orx060 or 1111111111 0 -> 111111111
-orx061 or 111111111 0 -> 111111111
-orx062 or 11111111 0 -> 11111111
-orx063 or 1111111 0 -> 1111111
-orx064 or 111111 0 -> 111111
-orx065 or 11111 0 -> 11111
-orx066 or 1111 0 -> 1111
-orx067 or 111 0 -> 111
-orx068 or 11 0 -> 11
-orx069 or 1 0 -> 1
-
-orx070 or 1 1111111111 -> 111111111
-orx071 or 1 111111111 -> 111111111
-orx072 or 1 11111111 -> 11111111
-orx073 or 1 1111111 -> 1111111
-orx074 or 1 111111 -> 111111
-orx075 or 1 11111 -> 11111
-orx076 or 1 1111 -> 1111
-orx077 or 1 111 -> 111
-orx078 or 1 11 -> 11
-orx079 or 1 1 -> 1
-
-orx080 or 0 1111111111 -> 111111111
-orx081 or 0 111111111 -> 111111111
-orx082 or 0 11111111 -> 11111111
-orx083 or 0 1111111 -> 1111111
-orx084 or 0 111111 -> 111111
-orx085 or 0 11111 -> 11111
-orx086 or 0 1111 -> 1111
-orx087 or 0 111 -> 111
-orx088 or 0 11 -> 11
-orx089 or 0 1 -> 1
-
-orx090 or 011111111 111101111 -> 111111111
-orx091 or 101111111 111101111 -> 111111111
-orx092 or 110111111 111101111 -> 111111111
-orx093 or 111011111 111101111 -> 111111111
-orx094 or 111101111 111101111 -> 111101111
-orx095 or 111110111 111101111 -> 111111111
-orx096 or 111111011 111101111 -> 111111111
-orx097 or 111111101 111101111 -> 111111111
-orx098 or 111111110 111101111 -> 111111111
-
-orx100 or 111101111 011111111 -> 111111111
-orx101 or 111101111 101111111 -> 111111111
-orx102 or 111101111 110111111 -> 111111111
-orx103 or 111101111 111011111 -> 111111111
-orx104 or 111101111 111101111 -> 111101111
-orx105 or 111101111 111110111 -> 111111111
-orx106 or 111101111 111111011 -> 111111111
-orx107 or 111101111 111111101 -> 111111111
-orx108 or 111101111 111111110 -> 111111111
-
--- non-0/1 should not be accepted, nor should signs
-orx220 or 111111112 111111111 -> NaN Invalid_operation
-orx221 or 333333333 333333333 -> NaN Invalid_operation
-orx222 or 555555555 555555555 -> NaN Invalid_operation
-orx223 or 777777777 777777777 -> NaN Invalid_operation
-orx224 or 999999999 999999999 -> NaN Invalid_operation
-orx225 or 222222222 999999999 -> NaN Invalid_operation
-orx226 or 444444444 999999999 -> NaN Invalid_operation
-orx227 or 666666666 999999999 -> NaN Invalid_operation
-orx228 or 888888888 999999999 -> NaN Invalid_operation
-orx229 or 999999999 222222222 -> NaN Invalid_operation
-orx230 or 999999999 444444444 -> NaN Invalid_operation
-orx231 or 999999999 666666666 -> NaN Invalid_operation
-orx232 or 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-orx240 or 567468689 -934981942 -> NaN Invalid_operation
-orx241 or 567367689 934981942 -> NaN Invalid_operation
-orx242 or -631917772 -706014634 -> NaN Invalid_operation
-orx243 or -756253257 138579234 -> NaN Invalid_operation
-orx244 or 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-orx250 or 200000000 100000000 -> NaN Invalid_operation
-orx251 or 700000000 100000000 -> NaN Invalid_operation
-orx252 or 800000000 100000000 -> NaN Invalid_operation
-orx253 or 900000000 100000000 -> NaN Invalid_operation
-orx254 or 200000000 000000000 -> NaN Invalid_operation
-orx255 or 700000000 000000000 -> NaN Invalid_operation
-orx256 or 800000000 000000000 -> NaN Invalid_operation
-orx257 or 900000000 000000000 -> NaN Invalid_operation
-orx258 or 100000000 200000000 -> NaN Invalid_operation
-orx259 or 100000000 700000000 -> NaN Invalid_operation
-orx260 or 100000000 800000000 -> NaN Invalid_operation
-orx261 or 100000000 900000000 -> NaN Invalid_operation
-orx262 or 000000000 200000000 -> NaN Invalid_operation
-orx263 or 000000000 700000000 -> NaN Invalid_operation
-orx264 or 000000000 800000000 -> NaN Invalid_operation
-orx265 or 000000000 900000000 -> NaN Invalid_operation
--- test MSD-1
-orx270 or 020000000 100000000 -> NaN Invalid_operation
-orx271 or 070100000 100000000 -> NaN Invalid_operation
-orx272 or 080010000 100000001 -> NaN Invalid_operation
-orx273 or 090001000 100000010 -> NaN Invalid_operation
-orx274 or 100000100 020010100 -> NaN Invalid_operation
-orx275 or 100000000 070001000 -> NaN Invalid_operation
-orx276 or 100000010 080010100 -> NaN Invalid_operation
-orx277 or 100000000 090000010 -> NaN Invalid_operation
--- test LSD
-orx280 or 001000002 100000000 -> NaN Invalid_operation
-orx281 or 000000007 100000000 -> NaN Invalid_operation
-orx282 or 000000008 100000000 -> NaN Invalid_operation
-orx283 or 000000009 100000000 -> NaN Invalid_operation
-orx284 or 100000000 000100002 -> NaN Invalid_operation
-orx285 or 100100000 001000007 -> NaN Invalid_operation
-orx286 or 100010000 010000008 -> NaN Invalid_operation
-orx287 or 100001000 100000009 -> NaN Invalid_operation
--- test Middie
-orx288 or 001020000 100000000 -> NaN Invalid_operation
-orx289 or 000070001 100000000 -> NaN Invalid_operation
-orx290 or 000080000 100010000 -> NaN Invalid_operation
-orx291 or 000090000 100001000 -> NaN Invalid_operation
-orx292 or 100000010 000020100 -> NaN Invalid_operation
-orx293 or 100100000 000070010 -> NaN Invalid_operation
-orx294 or 100010100 000080001 -> NaN Invalid_operation
-orx295 or 100001000 000090000 -> NaN Invalid_operation
--- signs
-orx296 or -100001000 -000000000 -> NaN Invalid_operation
-orx297 or -100001000 000010000 -> NaN Invalid_operation
-orx298 or 100001000 -000000000 -> NaN Invalid_operation
-orx299 or 100001000 000011000 -> 100011000
-
--- Nmax, Nmin, Ntiny
-orx331 or 2 9.99999999E+999 -> NaN Invalid_operation
-orx332 or 3 1E-999 -> NaN Invalid_operation
-orx333 or 4 1.00000000E-999 -> NaN Invalid_operation
-orx334 or 5 1E-1007 -> NaN Invalid_operation
-orx335 or 6 -1E-1007 -> NaN Invalid_operation
-orx336 or 7 -1.00000000E-999 -> NaN Invalid_operation
-orx337 or 8 -1E-999 -> NaN Invalid_operation
-orx338 or 9 -9.99999999E+999 -> NaN Invalid_operation
-orx341 or 9.99999999E+999 -18 -> NaN Invalid_operation
-orx342 or 1E-999 01 -> NaN Invalid_operation
-orx343 or 1.00000000E-999 -18 -> NaN Invalid_operation
-orx344 or 1E-1007 18 -> NaN Invalid_operation
-orx345 or -1E-1007 -10 -> NaN Invalid_operation
-orx346 or -1.00000000E-999 18 -> NaN Invalid_operation
-orx347 or -1E-999 10 -> NaN Invalid_operation
-orx348 or -9.99999999E+999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-orx361 or 1.0 1 -> NaN Invalid_operation
-orx362 or 1E+1 1 -> NaN Invalid_operation
-orx363 or 0.0 1 -> NaN Invalid_operation
-orx364 or 0E+1 1 -> NaN Invalid_operation
-orx365 or 9.9 1 -> NaN Invalid_operation
-orx366 or 9E+1 1 -> NaN Invalid_operation
-orx371 or 0 1.0 -> NaN Invalid_operation
-orx372 or 0 1E+1 -> NaN Invalid_operation
-orx373 or 0 0.0 -> NaN Invalid_operation
-orx374 or 0 0E+1 -> NaN Invalid_operation
-orx375 or 0 9.9 -> NaN Invalid_operation
-orx376 or 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-orx780 or -Inf -Inf -> NaN Invalid_operation
-orx781 or -Inf -1000 -> NaN Invalid_operation
-orx782 or -Inf -1 -> NaN Invalid_operation
-orx783 or -Inf -0 -> NaN Invalid_operation
-orx784 or -Inf 0 -> NaN Invalid_operation
-orx785 or -Inf 1 -> NaN Invalid_operation
-orx786 or -Inf 1000 -> NaN Invalid_operation
-orx787 or -1000 -Inf -> NaN Invalid_operation
-orx788 or -Inf -Inf -> NaN Invalid_operation
-orx789 or -1 -Inf -> NaN Invalid_operation
-orx790 or -0 -Inf -> NaN Invalid_operation
-orx791 or 0 -Inf -> NaN Invalid_operation
-orx792 or 1 -Inf -> NaN Invalid_operation
-orx793 or 1000 -Inf -> NaN Invalid_operation
-orx794 or Inf -Inf -> NaN Invalid_operation
-
-orx800 or Inf -Inf -> NaN Invalid_operation
-orx801 or Inf -1000 -> NaN Invalid_operation
-orx802 or Inf -1 -> NaN Invalid_operation
-orx803 or Inf -0 -> NaN Invalid_operation
-orx804 or Inf 0 -> NaN Invalid_operation
-orx805 or Inf 1 -> NaN Invalid_operation
-orx806 or Inf 1000 -> NaN Invalid_operation
-orx807 or Inf Inf -> NaN Invalid_operation
-orx808 or -1000 Inf -> NaN Invalid_operation
-orx809 or -Inf Inf -> NaN Invalid_operation
-orx810 or -1 Inf -> NaN Invalid_operation
-orx811 or -0 Inf -> NaN Invalid_operation
-orx812 or 0 Inf -> NaN Invalid_operation
-orx813 or 1 Inf -> NaN Invalid_operation
-orx814 or 1000 Inf -> NaN Invalid_operation
-orx815 or Inf Inf -> NaN Invalid_operation
-
-orx821 or NaN -Inf -> NaN Invalid_operation
-orx822 or NaN -1000 -> NaN Invalid_operation
-orx823 or NaN -1 -> NaN Invalid_operation
-orx824 or NaN -0 -> NaN Invalid_operation
-orx825 or NaN 0 -> NaN Invalid_operation
-orx826 or NaN 1 -> NaN Invalid_operation
-orx827 or NaN 1000 -> NaN Invalid_operation
-orx828 or NaN Inf -> NaN Invalid_operation
-orx829 or NaN NaN -> NaN Invalid_operation
-orx830 or -Inf NaN -> NaN Invalid_operation
-orx831 or -1000 NaN -> NaN Invalid_operation
-orx832 or -1 NaN -> NaN Invalid_operation
-orx833 or -0 NaN -> NaN Invalid_operation
-orx834 or 0 NaN -> NaN Invalid_operation
-orx835 or 1 NaN -> NaN Invalid_operation
-orx836 or 1000 NaN -> NaN Invalid_operation
-orx837 or Inf NaN -> NaN Invalid_operation
-
-orx841 or sNaN -Inf -> NaN Invalid_operation
-orx842 or sNaN -1000 -> NaN Invalid_operation
-orx843 or sNaN -1 -> NaN Invalid_operation
-orx844 or sNaN -0 -> NaN Invalid_operation
-orx845 or sNaN 0 -> NaN Invalid_operation
-orx846 or sNaN 1 -> NaN Invalid_operation
-orx847 or sNaN 1000 -> NaN Invalid_operation
-orx848 or sNaN NaN -> NaN Invalid_operation
-orx849 or sNaN sNaN -> NaN Invalid_operation
-orx850 or NaN sNaN -> NaN Invalid_operation
-orx851 or -Inf sNaN -> NaN Invalid_operation
-orx852 or -1000 sNaN -> NaN Invalid_operation
-orx853 or -1 sNaN -> NaN Invalid_operation
-orx854 or -0 sNaN -> NaN Invalid_operation
-orx855 or 0 sNaN -> NaN Invalid_operation
-orx856 or 1 sNaN -> NaN Invalid_operation
-orx857 or 1000 sNaN -> NaN Invalid_operation
-orx858 or Inf sNaN -> NaN Invalid_operation
-orx859 or NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-orx861 or NaN1 -Inf -> NaN Invalid_operation
-orx862 or +NaN2 -1000 -> NaN Invalid_operation
-orx863 or NaN3 1000 -> NaN Invalid_operation
-orx864 or NaN4 Inf -> NaN Invalid_operation
-orx865 or NaN5 +NaN6 -> NaN Invalid_operation
-orx866 or -Inf NaN7 -> NaN Invalid_operation
-orx867 or -1000 NaN8 -> NaN Invalid_operation
-orx868 or 1000 NaN9 -> NaN Invalid_operation
-orx869 or Inf +NaN10 -> NaN Invalid_operation
-orx871 or sNaN11 -Inf -> NaN Invalid_operation
-orx872 or sNaN12 -1000 -> NaN Invalid_operation
-orx873 or sNaN13 1000 -> NaN Invalid_operation
-orx874 or sNaN14 NaN17 -> NaN Invalid_operation
-orx875 or sNaN15 sNaN18 -> NaN Invalid_operation
-orx876 or NaN16 sNaN19 -> NaN Invalid_operation
-orx877 or -Inf +sNaN20 -> NaN Invalid_operation
-orx878 or -1000 sNaN21 -> NaN Invalid_operation
-orx879 or 1000 sNaN22 -> NaN Invalid_operation
-orx880 or Inf sNaN23 -> NaN Invalid_operation
-orx881 or +NaN25 +sNaN24 -> NaN Invalid_operation
-orx882 or -NaN26 NaN28 -> NaN Invalid_operation
-orx883 or -sNaN27 sNaN29 -> NaN Invalid_operation
-orx884 or 1000 -NaN30 -> NaN Invalid_operation
-orx885 or 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- or.decTest -- digitwise logical OR --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check (truth table)
+orx001 or 0 0 -> 0
+orx002 or 0 1 -> 1
+orx003 or 1 0 -> 1
+orx004 or 1 1 -> 1
+orx005 or 1100 1010 -> 1110
+-- and at msd and msd-1
+orx006 or 000000000 000000000 -> 0
+orx007 or 000000000 100000000 -> 100000000
+orx008 or 100000000 000000000 -> 100000000
+orx009 or 100000000 100000000 -> 100000000
+orx010 or 000000000 000000000 -> 0
+orx011 or 000000000 010000000 -> 10000000
+orx012 or 010000000 000000000 -> 10000000
+orx013 or 010000000 010000000 -> 10000000
+
+-- Various lengths
+-- 123456789 123456789 123456789
+orx021 or 111111111 111111111 -> 111111111
+orx022 or 111111111111 111111111 -> 111111111
+orx023 or 11111111 11111111 -> 11111111
+orx025 or 1111111 1111111 -> 1111111
+orx026 or 111111 111111 -> 111111
+orx027 or 11111 11111 -> 11111
+orx028 or 1111 1111 -> 1111
+orx029 or 111 111 -> 111
+orx031 or 11 11 -> 11
+orx032 or 1 1 -> 1
+orx033 or 111111111111 1111111111 -> 111111111
+orx034 or 11111111111 11111111111 -> 111111111
+orx035 or 1111111111 111111111111 -> 111111111
+orx036 or 111111111 1111111111111 -> 111111111
+
+orx040 or 111111111 111111111111 -> 111111111
+orx041 or 11111111 111111111111 -> 111111111
+orx042 or 11111111 111111111 -> 111111111
+orx043 or 1111111 100000010 -> 101111111
+orx044 or 111111 100000100 -> 100111111
+orx045 or 11111 100001000 -> 100011111
+orx046 or 1111 100010000 -> 100011111
+orx047 or 111 100100000 -> 100100111
+orx048 or 11 101000000 -> 101000011
+orx049 or 1 110000000 -> 110000001
+
+orx050 or 1111111111 1 -> 111111111
+orx051 or 111111111 1 -> 111111111
+orx052 or 11111111 1 -> 11111111
+orx053 or 1111111 1 -> 1111111
+orx054 or 111111 1 -> 111111
+orx055 or 11111 1 -> 11111
+orx056 or 1111 1 -> 1111
+orx057 or 111 1 -> 111
+orx058 or 11 1 -> 11
+orx059 or 1 1 -> 1
+
+orx060 or 1111111111 0 -> 111111111
+orx061 or 111111111 0 -> 111111111
+orx062 or 11111111 0 -> 11111111
+orx063 or 1111111 0 -> 1111111
+orx064 or 111111 0 -> 111111
+orx065 or 11111 0 -> 11111
+orx066 or 1111 0 -> 1111
+orx067 or 111 0 -> 111
+orx068 or 11 0 -> 11
+orx069 or 1 0 -> 1
+
+orx070 or 1 1111111111 -> 111111111
+orx071 or 1 111111111 -> 111111111
+orx072 or 1 11111111 -> 11111111
+orx073 or 1 1111111 -> 1111111
+orx074 or 1 111111 -> 111111
+orx075 or 1 11111 -> 11111
+orx076 or 1 1111 -> 1111
+orx077 or 1 111 -> 111
+orx078 or 1 11 -> 11
+orx079 or 1 1 -> 1
+
+orx080 or 0 1111111111 -> 111111111
+orx081 or 0 111111111 -> 111111111
+orx082 or 0 11111111 -> 11111111
+orx083 or 0 1111111 -> 1111111
+orx084 or 0 111111 -> 111111
+orx085 or 0 11111 -> 11111
+orx086 or 0 1111 -> 1111
+orx087 or 0 111 -> 111
+orx088 or 0 11 -> 11
+orx089 or 0 1 -> 1
+
+orx090 or 011111111 111101111 -> 111111111
+orx091 or 101111111 111101111 -> 111111111
+orx092 or 110111111 111101111 -> 111111111
+orx093 or 111011111 111101111 -> 111111111
+orx094 or 111101111 111101111 -> 111101111
+orx095 or 111110111 111101111 -> 111111111
+orx096 or 111111011 111101111 -> 111111111
+orx097 or 111111101 111101111 -> 111111111
+orx098 or 111111110 111101111 -> 111111111
+
+orx100 or 111101111 011111111 -> 111111111
+orx101 or 111101111 101111111 -> 111111111
+orx102 or 111101111 110111111 -> 111111111
+orx103 or 111101111 111011111 -> 111111111
+orx104 or 111101111 111101111 -> 111101111
+orx105 or 111101111 111110111 -> 111111111
+orx106 or 111101111 111111011 -> 111111111
+orx107 or 111101111 111111101 -> 111111111
+orx108 or 111101111 111111110 -> 111111111
+
+-- non-0/1 should not be accepted, nor should signs
+orx220 or 111111112 111111111 -> NaN Invalid_operation
+orx221 or 333333333 333333333 -> NaN Invalid_operation
+orx222 or 555555555 555555555 -> NaN Invalid_operation
+orx223 or 777777777 777777777 -> NaN Invalid_operation
+orx224 or 999999999 999999999 -> NaN Invalid_operation
+orx225 or 222222222 999999999 -> NaN Invalid_operation
+orx226 or 444444444 999999999 -> NaN Invalid_operation
+orx227 or 666666666 999999999 -> NaN Invalid_operation
+orx228 or 888888888 999999999 -> NaN Invalid_operation
+orx229 or 999999999 222222222 -> NaN Invalid_operation
+orx230 or 999999999 444444444 -> NaN Invalid_operation
+orx231 or 999999999 666666666 -> NaN Invalid_operation
+orx232 or 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+orx240 or 567468689 -934981942 -> NaN Invalid_operation
+orx241 or 567367689 934981942 -> NaN Invalid_operation
+orx242 or -631917772 -706014634 -> NaN Invalid_operation
+orx243 or -756253257 138579234 -> NaN Invalid_operation
+orx244 or 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+orx250 or 200000000 100000000 -> NaN Invalid_operation
+orx251 or 700000000 100000000 -> NaN Invalid_operation
+orx252 or 800000000 100000000 -> NaN Invalid_operation
+orx253 or 900000000 100000000 -> NaN Invalid_operation
+orx254 or 200000000 000000000 -> NaN Invalid_operation
+orx255 or 700000000 000000000 -> NaN Invalid_operation
+orx256 or 800000000 000000000 -> NaN Invalid_operation
+orx257 or 900000000 000000000 -> NaN Invalid_operation
+orx258 or 100000000 200000000 -> NaN Invalid_operation
+orx259 or 100000000 700000000 -> NaN Invalid_operation
+orx260 or 100000000 800000000 -> NaN Invalid_operation
+orx261 or 100000000 900000000 -> NaN Invalid_operation
+orx262 or 000000000 200000000 -> NaN Invalid_operation
+orx263 or 000000000 700000000 -> NaN Invalid_operation
+orx264 or 000000000 800000000 -> NaN Invalid_operation
+orx265 or 000000000 900000000 -> NaN Invalid_operation
+-- test MSD-1
+orx270 or 020000000 100000000 -> NaN Invalid_operation
+orx271 or 070100000 100000000 -> NaN Invalid_operation
+orx272 or 080010000 100000001 -> NaN Invalid_operation
+orx273 or 090001000 100000010 -> NaN Invalid_operation
+orx274 or 100000100 020010100 -> NaN Invalid_operation
+orx275 or 100000000 070001000 -> NaN Invalid_operation
+orx276 or 100000010 080010100 -> NaN Invalid_operation
+orx277 or 100000000 090000010 -> NaN Invalid_operation
+-- test LSD
+orx280 or 001000002 100000000 -> NaN Invalid_operation
+orx281 or 000000007 100000000 -> NaN Invalid_operation
+orx282 or 000000008 100000000 -> NaN Invalid_operation
+orx283 or 000000009 100000000 -> NaN Invalid_operation
+orx284 or 100000000 000100002 -> NaN Invalid_operation
+orx285 or 100100000 001000007 -> NaN Invalid_operation
+orx286 or 100010000 010000008 -> NaN Invalid_operation
+orx287 or 100001000 100000009 -> NaN Invalid_operation
+-- test Middie
+orx288 or 001020000 100000000 -> NaN Invalid_operation
+orx289 or 000070001 100000000 -> NaN Invalid_operation
+orx290 or 000080000 100010000 -> NaN Invalid_operation
+orx291 or 000090000 100001000 -> NaN Invalid_operation
+orx292 or 100000010 000020100 -> NaN Invalid_operation
+orx293 or 100100000 000070010 -> NaN Invalid_operation
+orx294 or 100010100 000080001 -> NaN Invalid_operation
+orx295 or 100001000 000090000 -> NaN Invalid_operation
+-- signs
+orx296 or -100001000 -000000000 -> NaN Invalid_operation
+orx297 or -100001000 000010000 -> NaN Invalid_operation
+orx298 or 100001000 -000000000 -> NaN Invalid_operation
+orx299 or 100001000 000011000 -> 100011000
+
+-- Nmax, Nmin, Ntiny
+orx331 or 2 9.99999999E+999 -> NaN Invalid_operation
+orx332 or 3 1E-999 -> NaN Invalid_operation
+orx333 or 4 1.00000000E-999 -> NaN Invalid_operation
+orx334 or 5 1E-1007 -> NaN Invalid_operation
+orx335 or 6 -1E-1007 -> NaN Invalid_operation
+orx336 or 7 -1.00000000E-999 -> NaN Invalid_operation
+orx337 or 8 -1E-999 -> NaN Invalid_operation
+orx338 or 9 -9.99999999E+999 -> NaN Invalid_operation
+orx341 or 9.99999999E+999 -18 -> NaN Invalid_operation
+orx342 or 1E-999 01 -> NaN Invalid_operation
+orx343 or 1.00000000E-999 -18 -> NaN Invalid_operation
+orx344 or 1E-1007 18 -> NaN Invalid_operation
+orx345 or -1E-1007 -10 -> NaN Invalid_operation
+orx346 or -1.00000000E-999 18 -> NaN Invalid_operation
+orx347 or -1E-999 10 -> NaN Invalid_operation
+orx348 or -9.99999999E+999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+orx361 or 1.0 1 -> NaN Invalid_operation
+orx362 or 1E+1 1 -> NaN Invalid_operation
+orx363 or 0.0 1 -> NaN Invalid_operation
+orx364 or 0E+1 1 -> NaN Invalid_operation
+orx365 or 9.9 1 -> NaN Invalid_operation
+orx366 or 9E+1 1 -> NaN Invalid_operation
+orx371 or 0 1.0 -> NaN Invalid_operation
+orx372 or 0 1E+1 -> NaN Invalid_operation
+orx373 or 0 0.0 -> NaN Invalid_operation
+orx374 or 0 0E+1 -> NaN Invalid_operation
+orx375 or 0 9.9 -> NaN Invalid_operation
+orx376 or 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+orx780 or -Inf -Inf -> NaN Invalid_operation
+orx781 or -Inf -1000 -> NaN Invalid_operation
+orx782 or -Inf -1 -> NaN Invalid_operation
+orx783 or -Inf -0 -> NaN Invalid_operation
+orx784 or -Inf 0 -> NaN Invalid_operation
+orx785 or -Inf 1 -> NaN Invalid_operation
+orx786 or -Inf 1000 -> NaN Invalid_operation
+orx787 or -1000 -Inf -> NaN Invalid_operation
+orx788 or -Inf -Inf -> NaN Invalid_operation
+orx789 or -1 -Inf -> NaN Invalid_operation
+orx790 or -0 -Inf -> NaN Invalid_operation
+orx791 or 0 -Inf -> NaN Invalid_operation
+orx792 or 1 -Inf -> NaN Invalid_operation
+orx793 or 1000 -Inf -> NaN Invalid_operation
+orx794 or Inf -Inf -> NaN Invalid_operation
+
+orx800 or Inf -Inf -> NaN Invalid_operation
+orx801 or Inf -1000 -> NaN Invalid_operation
+orx802 or Inf -1 -> NaN Invalid_operation
+orx803 or Inf -0 -> NaN Invalid_operation
+orx804 or Inf 0 -> NaN Invalid_operation
+orx805 or Inf 1 -> NaN Invalid_operation
+orx806 or Inf 1000 -> NaN Invalid_operation
+orx807 or Inf Inf -> NaN Invalid_operation
+orx808 or -1000 Inf -> NaN Invalid_operation
+orx809 or -Inf Inf -> NaN Invalid_operation
+orx810 or -1 Inf -> NaN Invalid_operation
+orx811 or -0 Inf -> NaN Invalid_operation
+orx812 or 0 Inf -> NaN Invalid_operation
+orx813 or 1 Inf -> NaN Invalid_operation
+orx814 or 1000 Inf -> NaN Invalid_operation
+orx815 or Inf Inf -> NaN Invalid_operation
+
+orx821 or NaN -Inf -> NaN Invalid_operation
+orx822 or NaN -1000 -> NaN Invalid_operation
+orx823 or NaN -1 -> NaN Invalid_operation
+orx824 or NaN -0 -> NaN Invalid_operation
+orx825 or NaN 0 -> NaN Invalid_operation
+orx826 or NaN 1 -> NaN Invalid_operation
+orx827 or NaN 1000 -> NaN Invalid_operation
+orx828 or NaN Inf -> NaN Invalid_operation
+orx829 or NaN NaN -> NaN Invalid_operation
+orx830 or -Inf NaN -> NaN Invalid_operation
+orx831 or -1000 NaN -> NaN Invalid_operation
+orx832 or -1 NaN -> NaN Invalid_operation
+orx833 or -0 NaN -> NaN Invalid_operation
+orx834 or 0 NaN -> NaN Invalid_operation
+orx835 or 1 NaN -> NaN Invalid_operation
+orx836 or 1000 NaN -> NaN Invalid_operation
+orx837 or Inf NaN -> NaN Invalid_operation
+
+orx841 or sNaN -Inf -> NaN Invalid_operation
+orx842 or sNaN -1000 -> NaN Invalid_operation
+orx843 or sNaN -1 -> NaN Invalid_operation
+orx844 or sNaN -0 -> NaN Invalid_operation
+orx845 or sNaN 0 -> NaN Invalid_operation
+orx846 or sNaN 1 -> NaN Invalid_operation
+orx847 or sNaN 1000 -> NaN Invalid_operation
+orx848 or sNaN NaN -> NaN Invalid_operation
+orx849 or sNaN sNaN -> NaN Invalid_operation
+orx850 or NaN sNaN -> NaN Invalid_operation
+orx851 or -Inf sNaN -> NaN Invalid_operation
+orx852 or -1000 sNaN -> NaN Invalid_operation
+orx853 or -1 sNaN -> NaN Invalid_operation
+orx854 or -0 sNaN -> NaN Invalid_operation
+orx855 or 0 sNaN -> NaN Invalid_operation
+orx856 or 1 sNaN -> NaN Invalid_operation
+orx857 or 1000 sNaN -> NaN Invalid_operation
+orx858 or Inf sNaN -> NaN Invalid_operation
+orx859 or NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+orx861 or NaN1 -Inf -> NaN Invalid_operation
+orx862 or +NaN2 -1000 -> NaN Invalid_operation
+orx863 or NaN3 1000 -> NaN Invalid_operation
+orx864 or NaN4 Inf -> NaN Invalid_operation
+orx865 or NaN5 +NaN6 -> NaN Invalid_operation
+orx866 or -Inf NaN7 -> NaN Invalid_operation
+orx867 or -1000 NaN8 -> NaN Invalid_operation
+orx868 or 1000 NaN9 -> NaN Invalid_operation
+orx869 or Inf +NaN10 -> NaN Invalid_operation
+orx871 or sNaN11 -Inf -> NaN Invalid_operation
+orx872 or sNaN12 -1000 -> NaN Invalid_operation
+orx873 or sNaN13 1000 -> NaN Invalid_operation
+orx874 or sNaN14 NaN17 -> NaN Invalid_operation
+orx875 or sNaN15 sNaN18 -> NaN Invalid_operation
+orx876 or NaN16 sNaN19 -> NaN Invalid_operation
+orx877 or -Inf +sNaN20 -> NaN Invalid_operation
+orx878 or -1000 sNaN21 -> NaN Invalid_operation
+orx879 or 1000 sNaN22 -> NaN Invalid_operation
+orx880 or Inf sNaN23 -> NaN Invalid_operation
+orx881 or +NaN25 +sNaN24 -> NaN Invalid_operation
+orx882 or -NaN26 NaN28 -> NaN Invalid_operation
+orx883 or -sNaN27 sNaN29 -> NaN Invalid_operation
+orx884 or 1000 -NaN30 -> NaN Invalid_operation
+orx885 or 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/powersqrt.decTest b/Lib/test/decimaltestdata/powersqrt.decTest
index 6c021a0cbb..260b941537 100644
--- a/Lib/test/decimaltestdata/powersqrt.decTest
+++ b/Lib/test/decimaltestdata/powersqrt.decTest
@@ -1,2970 +1,2970 @@
-------------------------------------------------------------------------
--- powersqrt.decTest -- decimal square root, using power --
--- Copyright (c) IBM Corporation, 2004, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- These testcases are taken from squareroot.decTest but are
--- evaluated using the power operator. The differences in results
--- (153 out of 2856) fall into the following categories:
---
--- x ** 0.5 (x>0) has no preferred exponent, and is Inexact
--- (and hence full precision); almost all differences are
--- in this category
--- 0.00 ** 0.5 becomes 0 (not 0.0), etc.
--- -0 ** 0.5 becomes 0 (never -0)
--- Some exact subnormals become inexact and hence underflows
-
-extended: 1
-precision: 9
-rounding: half_even
-maxExponent: 384
-minexponent: -383
-
--- basics
-pwsx001 power 1 0.5 -> 1.00000000 Inexact Rounded
-pwsx002 power -1 0.5 -> NaN Invalid_operation
-pwsx003 power 1.00 0.5 -> 1.00000000 Inexact Rounded
-pwsx004 power -1.00 0.5 -> NaN Invalid_operation
-pwsx005 power 0 0.5 -> 0
-pwsx006 power 00.0 0.5 -> 0
-pwsx007 power 0.00 0.5 -> 0
-pwsx008 power 00.00 0.5 -> 0
-pwsx009 power 00.000 0.5 -> 0
-pwsx010 power 00.0000 0.5 -> 0
-pwsx011 power 00 0.5 -> 0
-
-pwsx012 power -2 0.5 -> NaN Invalid_operation
-pwsx013 power 2 0.5 -> 1.41421356 Inexact Rounded
-pwsx014 power -2.00 0.5 -> NaN Invalid_operation
-pwsx015 power 2.00 0.5 -> 1.41421356 Inexact Rounded
-pwsx016 power -0 0.5 -> 0
-pwsx017 power -0.0 0.5 -> 0
-pwsx018 power -00.00 0.5 -> 0
-pwsx019 power -00.000 0.5 -> 0
-pwsx020 power -0.0000 0.5 -> 0
-pwsx021 power -0E+9 0.5 -> 0
-pwsx022 power -0E+10 0.5 -> 0
-pwsx023 power -0E+11 0.5 -> 0
-pwsx024 power -0E+12 0.5 -> 0
-pwsx025 power -00 0.5 -> 0
-pwsx026 power 0E+5 0.5 -> 0
-pwsx027 power 4.0 0.5 -> 2.00000000 Inexact Rounded
-pwsx028 power 4.00 0.5 -> 2.00000000 Inexact Rounded
-
-pwsx030 power +0.1 0.5 -> 0.316227766 Inexact Rounded
-pwsx031 power -0.1 0.5 -> NaN Invalid_operation
-pwsx032 power +0.01 0.5 -> 0.100000000 Inexact Rounded
-pwsx033 power -0.01 0.5 -> NaN Invalid_operation
-pwsx034 power +0.001 0.5 -> 0.0316227766 Inexact Rounded
-pwsx035 power -0.001 0.5 -> NaN Invalid_operation
-pwsx036 power +0.000001 0.5 -> 0.00100000000 Inexact Rounded
-pwsx037 power -0.000001 0.5 -> NaN Invalid_operation
-pwsx038 power +0.000000000001 0.5 -> 0.00000100000000 Inexact Rounded
-pwsx039 power -0.000000000001 0.5 -> NaN Invalid_operation
-
-pwsx041 power 1.1 0.5 -> 1.04880885 Inexact Rounded
-pwsx042 power 1.10 0.5 -> 1.04880885 Inexact Rounded
-pwsx043 power 1.100 0.5 -> 1.04880885 Inexact Rounded
-pwsx044 power 1.110 0.5 -> 1.05356538 Inexact Rounded
-pwsx045 power -1.1 0.5 -> NaN Invalid_operation
-pwsx046 power -1.10 0.5 -> NaN Invalid_operation
-pwsx047 power -1.100 0.5 -> NaN Invalid_operation
-pwsx048 power -1.110 0.5 -> NaN Invalid_operation
-pwsx049 power 9.9 0.5 -> 3.14642654 Inexact Rounded
-pwsx050 power 9.90 0.5 -> 3.14642654 Inexact Rounded
-pwsx051 power 9.900 0.5 -> 3.14642654 Inexact Rounded
-pwsx052 power 9.990 0.5 -> 3.16069613 Inexact Rounded
-pwsx053 power -9.9 0.5 -> NaN Invalid_operation
-pwsx054 power -9.90 0.5 -> NaN Invalid_operation
-pwsx055 power -9.900 0.5 -> NaN Invalid_operation
-pwsx056 power -9.990 0.5 -> NaN Invalid_operation
-
-pwsx060 power 1 0.5 -> 1.00000000 Inexact Rounded
-pwsx061 power 1.0 0.5 -> 1.00000000 Inexact Rounded
-pwsx062 power 1.00 0.5 -> 1.00000000 Inexact Rounded
-pwsx063 power 10.0 0.5 -> 3.16227766 Inexact Rounded
-pwsx064 power 10.0 0.5 -> 3.16227766 Inexact Rounded
-pwsx065 power 10.0 0.5 -> 3.16227766 Inexact Rounded
-pwsx066 power 10.00 0.5 -> 3.16227766 Inexact Rounded
-pwsx067 power 100 0.5 -> 10.0000000 Inexact Rounded
-pwsx068 power 100.0 0.5 -> 10.0000000 Inexact Rounded
-pwsx069 power 100.00 0.5 -> 10.0000000 Inexact Rounded
-pwsx070 power 1.1000E+3 0.5 -> 33.1662479 Inexact Rounded
-pwsx071 power 1.10000E+3 0.5 -> 33.1662479 Inexact Rounded
-pwsx072 power -10.0 0.5 -> NaN Invalid_operation
-pwsx073 power -10.00 0.5 -> NaN Invalid_operation
-pwsx074 power -100.0 0.5 -> NaN Invalid_operation
-pwsx075 power -100.00 0.5 -> NaN Invalid_operation
-pwsx076 power -1.1000E+3 0.5 -> NaN Invalid_operation
-pwsx077 power -1.10000E+3 0.5 -> NaN Invalid_operation
-
--- famous squares
-pwsx080 power 1 0.5 -> 1.00000000 Inexact Rounded
-pwsx081 power 4 0.5 -> 2.00000000 Inexact Rounded
-pwsx082 power 9 0.5 -> 3.00000000 Inexact Rounded
-pwsx083 power 16 0.5 -> 4.00000000 Inexact Rounded
-pwsx084 power 25 0.5 -> 5.00000000 Inexact Rounded
-pwsx085 power 36 0.5 -> 6.00000000 Inexact Rounded
-pwsx086 power 49 0.5 -> 7.00000000 Inexact Rounded
-pwsx087 power 64 0.5 -> 8.00000000 Inexact Rounded
-pwsx088 power 81 0.5 -> 9.00000000 Inexact Rounded
-pwsx089 power 100 0.5 -> 10.0000000 Inexact Rounded
-pwsx090 power 121 0.5 -> 11.0000000 Inexact Rounded
-pwsx091 power 144 0.5 -> 12.0000000 Inexact Rounded
-pwsx092 power 169 0.5 -> 13.0000000 Inexact Rounded
-pwsx093 power 256 0.5 -> 16.0000000 Inexact Rounded
-pwsx094 power 1024 0.5 -> 32.0000000 Inexact Rounded
-pwsx095 power 4096 0.5 -> 64.0000000 Inexact Rounded
-pwsx100 power 0.01 0.5 -> 0.100000000 Inexact Rounded
-pwsx101 power 0.04 0.5 -> 0.200000000 Inexact Rounded
-pwsx102 power 0.09 0.5 -> 0.300000000 Inexact Rounded
-pwsx103 power 0.16 0.5 -> 0.400000000 Inexact Rounded
-pwsx104 power 0.25 0.5 -> 0.500000000 Inexact Rounded
-pwsx105 power 0.36 0.5 -> 0.600000000 Inexact Rounded
-pwsx106 power 0.49 0.5 -> 0.700000000 Inexact Rounded
-pwsx107 power 0.64 0.5 -> 0.800000000 Inexact Rounded
-pwsx108 power 0.81 0.5 -> 0.900000000 Inexact Rounded
-pwsx109 power 1.00 0.5 -> 1.00000000 Inexact Rounded
-pwsx110 power 1.21 0.5 -> 1.10000000 Inexact Rounded
-pwsx111 power 1.44 0.5 -> 1.20000000 Inexact Rounded
-pwsx112 power 1.69 0.5 -> 1.30000000 Inexact Rounded
-pwsx113 power 2.56 0.5 -> 1.60000000 Inexact Rounded
-pwsx114 power 10.24 0.5 -> 3.20000000 Inexact Rounded
-pwsx115 power 40.96 0.5 -> 6.40000000 Inexact Rounded
-
--- Precision 1 squareroot tests [exhaustive, plus exponent adjusts]
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-precision: 1
-pwsx1201 power 0.1 0.5 -> 0.3 Inexact Rounded
-pwsx1202 power 0.01 0.5 -> 0.1 Inexact Rounded
-pwsx1203 power 1.0E-1 0.5 -> 0.3 Inexact Rounded
-pwsx1204 power 1.00E-2 0.5 -> 0.1 Inexact Rounded
-pwsx1205 power 1E-3 0.5 -> 0.03 Inexact Rounded
-pwsx1206 power 1E+1 0.5 -> 3 Inexact Rounded
-pwsx1207 power 1E+2 0.5 -> 1E+1 Inexact Rounded
-pwsx1208 power 1E+3 0.5 -> 3E+1 Inexact Rounded
-pwsx1209 power 0.2 0.5 -> 0.4 Inexact Rounded
-pwsx1210 power 0.02 0.5 -> 0.1 Inexact Rounded
-pwsx1211 power 2.0E-1 0.5 -> 0.4 Inexact Rounded
-pwsx1212 power 2.00E-2 0.5 -> 0.1 Inexact Rounded
-pwsx1213 power 2E-3 0.5 -> 0.04 Inexact Rounded
-pwsx1214 power 2E+1 0.5 -> 4 Inexact Rounded
-pwsx1215 power 2E+2 0.5 -> 1E+1 Inexact Rounded
-pwsx1216 power 2E+3 0.5 -> 4E+1 Inexact Rounded
-pwsx1217 power 0.3 0.5 -> 0.5 Inexact Rounded
-pwsx1218 power 0.03 0.5 -> 0.2 Inexact Rounded
-pwsx1219 power 3.0E-1 0.5 -> 0.5 Inexact Rounded
-pwsx1220 power 3.00E-2 0.5 -> 0.2 Inexact Rounded
-pwsx1221 power 3E-3 0.5 -> 0.05 Inexact Rounded
-pwsx1222 power 3E+1 0.5 -> 5 Inexact Rounded
-pwsx1223 power 3E+2 0.5 -> 2E+1 Inexact Rounded
-pwsx1224 power 3E+3 0.5 -> 5E+1 Inexact Rounded
-pwsx1225 power 0.4 0.5 -> 0.6 Inexact Rounded
-pwsx1226 power 0.04 0.5 -> 0.2 Inexact Rounded
-pwsx1227 power 4.0E-1 0.5 -> 0.6 Inexact Rounded
-pwsx1228 power 4.00E-2 0.5 -> 0.2 Inexact Rounded
-pwsx1229 power 4E-3 0.5 -> 0.06 Inexact Rounded
-pwsx1230 power 4E+1 0.5 -> 6 Inexact Rounded
-pwsx1231 power 4E+2 0.5 -> 2E+1 Inexact Rounded
-pwsx1232 power 4E+3 0.5 -> 6E+1 Inexact Rounded
-pwsx1233 power 0.5 0.5 -> 0.7 Inexact Rounded
-pwsx1234 power 0.05 0.5 -> 0.2 Inexact Rounded
-pwsx1235 power 5.0E-1 0.5 -> 0.7 Inexact Rounded
-pwsx1236 power 5.00E-2 0.5 -> 0.2 Inexact Rounded
-pwsx1237 power 5E-3 0.5 -> 0.07 Inexact Rounded
-pwsx1238 power 5E+1 0.5 -> 7 Inexact Rounded
-pwsx1239 power 5E+2 0.5 -> 2E+1 Inexact Rounded
-pwsx1240 power 5E+3 0.5 -> 7E+1 Inexact Rounded
-pwsx1241 power 0.6 0.5 -> 0.8 Inexact Rounded
-pwsx1242 power 0.06 0.5 -> 0.2 Inexact Rounded
-pwsx1243 power 6.0E-1 0.5 -> 0.8 Inexact Rounded
-pwsx1244 power 6.00E-2 0.5 -> 0.2 Inexact Rounded
-pwsx1245 power 6E-3 0.5 -> 0.08 Inexact Rounded
-pwsx1246 power 6E+1 0.5 -> 8 Inexact Rounded
-pwsx1247 power 6E+2 0.5 -> 2E+1 Inexact Rounded
-pwsx1248 power 6E+3 0.5 -> 8E+1 Inexact Rounded
-pwsx1249 power 0.7 0.5 -> 0.8 Inexact Rounded
-pwsx1250 power 0.07 0.5 -> 0.3 Inexact Rounded
-pwsx1251 power 7.0E-1 0.5 -> 0.8 Inexact Rounded
-pwsx1252 power 7.00E-2 0.5 -> 0.3 Inexact Rounded
-pwsx1253 power 7E-3 0.5 -> 0.08 Inexact Rounded
-pwsx1254 power 7E+1 0.5 -> 8 Inexact Rounded
-pwsx1255 power 7E+2 0.5 -> 3E+1 Inexact Rounded
-pwsx1256 power 7E+3 0.5 -> 8E+1 Inexact Rounded
-pwsx1257 power 0.8 0.5 -> 0.9 Inexact Rounded
-pwsx1258 power 0.08 0.5 -> 0.3 Inexact Rounded
-pwsx1259 power 8.0E-1 0.5 -> 0.9 Inexact Rounded
-pwsx1260 power 8.00E-2 0.5 -> 0.3 Inexact Rounded
-pwsx1261 power 8E-3 0.5 -> 0.09 Inexact Rounded
-pwsx1262 power 8E+1 0.5 -> 9 Inexact Rounded
-pwsx1263 power 8E+2 0.5 -> 3E+1 Inexact Rounded
-pwsx1264 power 8E+3 0.5 -> 9E+1 Inexact Rounded
-pwsx1265 power 0.9 0.5 -> 0.9 Inexact Rounded
-pwsx1266 power 0.09 0.5 -> 0.3 Inexact Rounded
-pwsx1267 power 9.0E-1 0.5 -> 0.9 Inexact Rounded
-pwsx1268 power 9.00E-2 0.5 -> 0.3 Inexact Rounded
-pwsx1269 power 9E-3 0.5 -> 0.09 Inexact Rounded
-pwsx1270 power 9E+1 0.5 -> 9 Inexact Rounded
-pwsx1271 power 9E+2 0.5 -> 3E+1 Inexact Rounded
-pwsx1272 power 9E+3 0.5 -> 9E+1 Inexact Rounded
-
--- Precision 2 squareroot tests [exhaustive, plus exponent adjusts]
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-precision: 2
-pwsx2201 power 0.1 0.5 -> 0.32 Inexact Rounded
-pwsx2202 power 0.01 0.5 -> 0.10 Inexact Rounded
-pwsx2203 power 1.0E-1 0.5 -> 0.32 Inexact Rounded
-pwsx2204 power 1.00E-2 0.5 -> 0.10 Inexact Rounded
-pwsx2205 power 1E-3 0.5 -> 0.032 Inexact Rounded
-pwsx2206 power 1E+1 0.5 -> 3.2 Inexact Rounded
-pwsx2207 power 1E+2 0.5 -> 10 Inexact Rounded
-pwsx2208 power 1E+3 0.5 -> 32 Inexact Rounded
-pwsx2209 power 0.2 0.5 -> 0.45 Inexact Rounded
-pwsx2210 power 0.02 0.5 -> 0.14 Inexact Rounded
-pwsx2211 power 2.0E-1 0.5 -> 0.45 Inexact Rounded
-pwsx2212 power 2.00E-2 0.5 -> 0.14 Inexact Rounded
-pwsx2213 power 2E-3 0.5 -> 0.045 Inexact Rounded
-pwsx2214 power 2E+1 0.5 -> 4.5 Inexact Rounded
-pwsx2215 power 2E+2 0.5 -> 14 Inexact Rounded
-pwsx2216 power 2E+3 0.5 -> 45 Inexact Rounded
-pwsx2217 power 0.3 0.5 -> 0.55 Inexact Rounded
-pwsx2218 power 0.03 0.5 -> 0.17 Inexact Rounded
-pwsx2219 power 3.0E-1 0.5 -> 0.55 Inexact Rounded
-pwsx2220 power 3.00E-2 0.5 -> 0.17 Inexact Rounded
-pwsx2221 power 3E-3 0.5 -> 0.055 Inexact Rounded
-pwsx2222 power 3E+1 0.5 -> 5.5 Inexact Rounded
-pwsx2223 power 3E+2 0.5 -> 17 Inexact Rounded
-pwsx2224 power 3E+3 0.5 -> 55 Inexact Rounded
-pwsx2225 power 0.4 0.5 -> 0.63 Inexact Rounded
-pwsx2226 power 0.04 0.5 -> 0.20 Inexact Rounded
-pwsx2227 power 4.0E-1 0.5 -> 0.63 Inexact Rounded
-pwsx2228 power 4.00E-2 0.5 -> 0.20 Inexact Rounded
-pwsx2229 power 4E-3 0.5 -> 0.063 Inexact Rounded
-pwsx2230 power 4E+1 0.5 -> 6.3 Inexact Rounded
-pwsx2231 power 4E+2 0.5 -> 20 Inexact Rounded
-pwsx2232 power 4E+3 0.5 -> 63 Inexact Rounded
-pwsx2233 power 0.5 0.5 -> 0.71 Inexact Rounded
-pwsx2234 power 0.05 0.5 -> 0.22 Inexact Rounded
-pwsx2235 power 5.0E-1 0.5 -> 0.71 Inexact Rounded
-pwsx2236 power 5.00E-2 0.5 -> 0.22 Inexact Rounded
-pwsx2237 power 5E-3 0.5 -> 0.071 Inexact Rounded
-pwsx2238 power 5E+1 0.5 -> 7.1 Inexact Rounded
-pwsx2239 power 5E+2 0.5 -> 22 Inexact Rounded
-pwsx2240 power 5E+3 0.5 -> 71 Inexact Rounded
-pwsx2241 power 0.6 0.5 -> 0.77 Inexact Rounded
-pwsx2242 power 0.06 0.5 -> 0.24 Inexact Rounded
-pwsx2243 power 6.0E-1 0.5 -> 0.77 Inexact Rounded
-pwsx2244 power 6.00E-2 0.5 -> 0.24 Inexact Rounded
-pwsx2245 power 6E-3 0.5 -> 0.077 Inexact Rounded
-pwsx2246 power 6E+1 0.5 -> 7.7 Inexact Rounded
-pwsx2247 power 6E+2 0.5 -> 24 Inexact Rounded
-pwsx2248 power 6E+3 0.5 -> 77 Inexact Rounded
-pwsx2249 power 0.7 0.5 -> 0.84 Inexact Rounded
-pwsx2250 power 0.07 0.5 -> 0.26 Inexact Rounded
-pwsx2251 power 7.0E-1 0.5 -> 0.84 Inexact Rounded
-pwsx2252 power 7.00E-2 0.5 -> 0.26 Inexact Rounded
-pwsx2253 power 7E-3 0.5 -> 0.084 Inexact Rounded
-pwsx2254 power 7E+1 0.5 -> 8.4 Inexact Rounded
-pwsx2255 power 7E+2 0.5 -> 26 Inexact Rounded
-pwsx2256 power 7E+3 0.5 -> 84 Inexact Rounded
-pwsx2257 power 0.8 0.5 -> 0.89 Inexact Rounded
-pwsx2258 power 0.08 0.5 -> 0.28 Inexact Rounded
-pwsx2259 power 8.0E-1 0.5 -> 0.89 Inexact Rounded
-pwsx2260 power 8.00E-2 0.5 -> 0.28 Inexact Rounded
-pwsx2261 power 8E-3 0.5 -> 0.089 Inexact Rounded
-pwsx2262 power 8E+1 0.5 -> 8.9 Inexact Rounded
-pwsx2263 power 8E+2 0.5 -> 28 Inexact Rounded
-pwsx2264 power 8E+3 0.5 -> 89 Inexact Rounded
-pwsx2265 power 0.9 0.5 -> 0.95 Inexact Rounded
-pwsx2266 power 0.09 0.5 -> 0.30 Inexact Rounded
-pwsx2267 power 9.0E-1 0.5 -> 0.95 Inexact Rounded
-pwsx2268 power 9.00E-2 0.5 -> 0.30 Inexact Rounded
-pwsx2269 power 9E-3 0.5 -> 0.095 Inexact Rounded
-pwsx2270 power 9E+1 0.5 -> 9.5 Inexact Rounded
-pwsx2271 power 9E+2 0.5 -> 30 Inexact Rounded
-pwsx2272 power 9E+3 0.5 -> 95 Inexact Rounded
-pwsx2273 power 0.10 0.5 -> 0.32 Inexact Rounded
-pwsx2274 power 0.010 0.5 -> 0.10 Inexact Rounded
-pwsx2275 power 10.0E-1 0.5 -> 1.0 Inexact Rounded
-pwsx2276 power 10.00E-2 0.5 -> 0.32 Inexact Rounded
-pwsx2277 power 10E-3 0.5 -> 0.10 Inexact Rounded
-pwsx2278 power 10E+1 0.5 -> 10 Inexact Rounded
-pwsx2279 power 10E+2 0.5 -> 32 Inexact Rounded
-pwsx2280 power 10E+3 0.5 -> 1.0E+2 Inexact Rounded
-pwsx2281 power 0.11 0.5 -> 0.33 Inexact Rounded
-pwsx2282 power 0.011 0.5 -> 0.10 Inexact Rounded
-pwsx2283 power 11.0E-1 0.5 -> 1.0 Inexact Rounded
-pwsx2284 power 11.00E-2 0.5 -> 0.33 Inexact Rounded
-pwsx2285 power 11E-3 0.5 -> 0.10 Inexact Rounded
-pwsx2286 power 11E+1 0.5 -> 10 Inexact Rounded
-pwsx2287 power 11E+2 0.5 -> 33 Inexact Rounded
-pwsx2288 power 11E+3 0.5 -> 1.0E+2 Inexact Rounded
-pwsx2289 power 0.12 0.5 -> 0.35 Inexact Rounded
-pwsx2290 power 0.012 0.5 -> 0.11 Inexact Rounded
-pwsx2291 power 12.0E-1 0.5 -> 1.1 Inexact Rounded
-pwsx2292 power 12.00E-2 0.5 -> 0.35 Inexact Rounded
-pwsx2293 power 12E-3 0.5 -> 0.11 Inexact Rounded
-pwsx2294 power 12E+1 0.5 -> 11 Inexact Rounded
-pwsx2295 power 12E+2 0.5 -> 35 Inexact Rounded
-pwsx2296 power 12E+3 0.5 -> 1.1E+2 Inexact Rounded
-pwsx2297 power 0.13 0.5 -> 0.36 Inexact Rounded
-pwsx2298 power 0.013 0.5 -> 0.11 Inexact Rounded
-pwsx2299 power 13.0E-1 0.5 -> 1.1 Inexact Rounded
-pwsx2300 power 13.00E-2 0.5 -> 0.36 Inexact Rounded
-pwsx2301 power 13E-3 0.5 -> 0.11 Inexact Rounded
-pwsx2302 power 13E+1 0.5 -> 11 Inexact Rounded
-pwsx2303 power 13E+2 0.5 -> 36 Inexact Rounded
-pwsx2304 power 13E+3 0.5 -> 1.1E+2 Inexact Rounded
-pwsx2305 power 0.14 0.5 -> 0.37 Inexact Rounded
-pwsx2306 power 0.014 0.5 -> 0.12 Inexact Rounded
-pwsx2307 power 14.0E-1 0.5 -> 1.2 Inexact Rounded
-pwsx2308 power 14.00E-2 0.5 -> 0.37 Inexact Rounded
-pwsx2309 power 14E-3 0.5 -> 0.12 Inexact Rounded
-pwsx2310 power 14E+1 0.5 -> 12 Inexact Rounded
-pwsx2311 power 14E+2 0.5 -> 37 Inexact Rounded
-pwsx2312 power 14E+3 0.5 -> 1.2E+2 Inexact Rounded
-pwsx2313 power 0.15 0.5 -> 0.39 Inexact Rounded
-pwsx2314 power 0.015 0.5 -> 0.12 Inexact Rounded
-pwsx2315 power 15.0E-1 0.5 -> 1.2 Inexact Rounded
-pwsx2316 power 15.00E-2 0.5 -> 0.39 Inexact Rounded
-pwsx2317 power 15E-3 0.5 -> 0.12 Inexact Rounded
-pwsx2318 power 15E+1 0.5 -> 12 Inexact Rounded
-pwsx2319 power 15E+2 0.5 -> 39 Inexact Rounded
-pwsx2320 power 15E+3 0.5 -> 1.2E+2 Inexact Rounded
-pwsx2321 power 0.16 0.5 -> 0.40 Inexact Rounded
-pwsx2322 power 0.016 0.5 -> 0.13 Inexact Rounded
-pwsx2323 power 16.0E-1 0.5 -> 1.3 Inexact Rounded
-pwsx2324 power 16.00E-2 0.5 -> 0.40 Inexact Rounded
-pwsx2325 power 16E-3 0.5 -> 0.13 Inexact Rounded
-pwsx2326 power 16E+1 0.5 -> 13 Inexact Rounded
-pwsx2327 power 16E+2 0.5 -> 40 Inexact Rounded
-pwsx2328 power 16E+3 0.5 -> 1.3E+2 Inexact Rounded
-pwsx2329 power 0.17 0.5 -> 0.41 Inexact Rounded
-pwsx2330 power 0.017 0.5 -> 0.13 Inexact Rounded
-pwsx2331 power 17.0E-1 0.5 -> 1.3 Inexact Rounded
-pwsx2332 power 17.00E-2 0.5 -> 0.41 Inexact Rounded
-pwsx2333 power 17E-3 0.5 -> 0.13 Inexact Rounded
-pwsx2334 power 17E+1 0.5 -> 13 Inexact Rounded
-pwsx2335 power 17E+2 0.5 -> 41 Inexact Rounded
-pwsx2336 power 17E+3 0.5 -> 1.3E+2 Inexact Rounded
-pwsx2337 power 0.18 0.5 -> 0.42 Inexact Rounded
-pwsx2338 power 0.018 0.5 -> 0.13 Inexact Rounded
-pwsx2339 power 18.0E-1 0.5 -> 1.3 Inexact Rounded
-pwsx2340 power 18.00E-2 0.5 -> 0.42 Inexact Rounded
-pwsx2341 power 18E-3 0.5 -> 0.13 Inexact Rounded
-pwsx2342 power 18E+1 0.5 -> 13 Inexact Rounded
-pwsx2343 power 18E+2 0.5 -> 42 Inexact Rounded
-pwsx2344 power 18E+3 0.5 -> 1.3E+2 Inexact Rounded
-pwsx2345 power 0.19 0.5 -> 0.44 Inexact Rounded
-pwsx2346 power 0.019 0.5 -> 0.14 Inexact Rounded
-pwsx2347 power 19.0E-1 0.5 -> 1.4 Inexact Rounded
-pwsx2348 power 19.00E-2 0.5 -> 0.44 Inexact Rounded
-pwsx2349 power 19E-3 0.5 -> 0.14 Inexact Rounded
-pwsx2350 power 19E+1 0.5 -> 14 Inexact Rounded
-pwsx2351 power 19E+2 0.5 -> 44 Inexact Rounded
-pwsx2352 power 19E+3 0.5 -> 1.4E+2 Inexact Rounded
-pwsx2353 power 0.20 0.5 -> 0.45 Inexact Rounded
-pwsx2354 power 0.020 0.5 -> 0.14 Inexact Rounded
-pwsx2355 power 20.0E-1 0.5 -> 1.4 Inexact Rounded
-pwsx2356 power 20.00E-2 0.5 -> 0.45 Inexact Rounded
-pwsx2357 power 20E-3 0.5 -> 0.14 Inexact Rounded
-pwsx2358 power 20E+1 0.5 -> 14 Inexact Rounded
-pwsx2359 power 20E+2 0.5 -> 45 Inexact Rounded
-pwsx2360 power 20E+3 0.5 -> 1.4E+2 Inexact Rounded
-pwsx2361 power 0.21 0.5 -> 0.46 Inexact Rounded
-pwsx2362 power 0.021 0.5 -> 0.14 Inexact Rounded
-pwsx2363 power 21.0E-1 0.5 -> 1.4 Inexact Rounded
-pwsx2364 power 21.00E-2 0.5 -> 0.46 Inexact Rounded
-pwsx2365 power 21E-3 0.5 -> 0.14 Inexact Rounded
-pwsx2366 power 21E+1 0.5 -> 14 Inexact Rounded
-pwsx2367 power 21E+2 0.5 -> 46 Inexact Rounded
-pwsx2368 power 21E+3 0.5 -> 1.4E+2 Inexact Rounded
-pwsx2369 power 0.22 0.5 -> 0.47 Inexact Rounded
-pwsx2370 power 0.022 0.5 -> 0.15 Inexact Rounded
-pwsx2371 power 22.0E-1 0.5 -> 1.5 Inexact Rounded
-pwsx2372 power 22.00E-2 0.5 -> 0.47 Inexact Rounded
-pwsx2373 power 22E-3 0.5 -> 0.15 Inexact Rounded
-pwsx2374 power 22E+1 0.5 -> 15 Inexact Rounded
-pwsx2375 power 22E+2 0.5 -> 47 Inexact Rounded
-pwsx2376 power 22E+3 0.5 -> 1.5E+2 Inexact Rounded
-pwsx2377 power 0.23 0.5 -> 0.48 Inexact Rounded
-pwsx2378 power 0.023 0.5 -> 0.15 Inexact Rounded
-pwsx2379 power 23.0E-1 0.5 -> 1.5 Inexact Rounded
-pwsx2380 power 23.00E-2 0.5 -> 0.48 Inexact Rounded
-pwsx2381 power 23E-3 0.5 -> 0.15 Inexact Rounded
-pwsx2382 power 23E+1 0.5 -> 15 Inexact Rounded
-pwsx2383 power 23E+2 0.5 -> 48 Inexact Rounded
-pwsx2384 power 23E+3 0.5 -> 1.5E+2 Inexact Rounded
-pwsx2385 power 0.24 0.5 -> 0.49 Inexact Rounded
-pwsx2386 power 0.024 0.5 -> 0.15 Inexact Rounded
-pwsx2387 power 24.0E-1 0.5 -> 1.5 Inexact Rounded
-pwsx2388 power 24.00E-2 0.5 -> 0.49 Inexact Rounded
-pwsx2389 power 24E-3 0.5 -> 0.15 Inexact Rounded
-pwsx2390 power 24E+1 0.5 -> 15 Inexact Rounded
-pwsx2391 power 24E+2 0.5 -> 49 Inexact Rounded
-pwsx2392 power 24E+3 0.5 -> 1.5E+2 Inexact Rounded
-pwsx2393 power 0.25 0.5 -> 0.50 Inexact Rounded
-pwsx2394 power 0.025 0.5 -> 0.16 Inexact Rounded
-pwsx2395 power 25.0E-1 0.5 -> 1.6 Inexact Rounded
-pwsx2396 power 25.00E-2 0.5 -> 0.50 Inexact Rounded
-pwsx2397 power 25E-3 0.5 -> 0.16 Inexact Rounded
-pwsx2398 power 25E+1 0.5 -> 16 Inexact Rounded
-pwsx2399 power 25E+2 0.5 -> 50 Inexact Rounded
-pwsx2400 power 25E+3 0.5 -> 1.6E+2 Inexact Rounded
-pwsx2401 power 0.26 0.5 -> 0.51 Inexact Rounded
-pwsx2402 power 0.026 0.5 -> 0.16 Inexact Rounded
-pwsx2403 power 26.0E-1 0.5 -> 1.6 Inexact Rounded
-pwsx2404 power 26.00E-2 0.5 -> 0.51 Inexact Rounded
-pwsx2405 power 26E-3 0.5 -> 0.16 Inexact Rounded
-pwsx2406 power 26E+1 0.5 -> 16 Inexact Rounded
-pwsx2407 power 26E+2 0.5 -> 51 Inexact Rounded
-pwsx2408 power 26E+3 0.5 -> 1.6E+2 Inexact Rounded
-pwsx2409 power 0.27 0.5 -> 0.52 Inexact Rounded
-pwsx2410 power 0.027 0.5 -> 0.16 Inexact Rounded
-pwsx2411 power 27.0E-1 0.5 -> 1.6 Inexact Rounded
-pwsx2412 power 27.00E-2 0.5 -> 0.52 Inexact Rounded
-pwsx2413 power 27E-3 0.5 -> 0.16 Inexact Rounded
-pwsx2414 power 27E+1 0.5 -> 16 Inexact Rounded
-pwsx2415 power 27E+2 0.5 -> 52 Inexact Rounded
-pwsx2416 power 27E+3 0.5 -> 1.6E+2 Inexact Rounded
-pwsx2417 power 0.28 0.5 -> 0.53 Inexact Rounded
-pwsx2418 power 0.028 0.5 -> 0.17 Inexact Rounded
-pwsx2419 power 28.0E-1 0.5 -> 1.7 Inexact Rounded
-pwsx2420 power 28.00E-2 0.5 -> 0.53 Inexact Rounded
-pwsx2421 power 28E-3 0.5 -> 0.17 Inexact Rounded
-pwsx2422 power 28E+1 0.5 -> 17 Inexact Rounded
-pwsx2423 power 28E+2 0.5 -> 53 Inexact Rounded
-pwsx2424 power 28E+3 0.5 -> 1.7E+2 Inexact Rounded
-pwsx2425 power 0.29 0.5 -> 0.54 Inexact Rounded
-pwsx2426 power 0.029 0.5 -> 0.17 Inexact Rounded
-pwsx2427 power 29.0E-1 0.5 -> 1.7 Inexact Rounded
-pwsx2428 power 29.00E-2 0.5 -> 0.54 Inexact Rounded
-pwsx2429 power 29E-3 0.5 -> 0.17 Inexact Rounded
-pwsx2430 power 29E+1 0.5 -> 17 Inexact Rounded
-pwsx2431 power 29E+2 0.5 -> 54 Inexact Rounded
-pwsx2432 power 29E+3 0.5 -> 1.7E+2 Inexact Rounded
-pwsx2433 power 0.30 0.5 -> 0.55 Inexact Rounded
-pwsx2434 power 0.030 0.5 -> 0.17 Inexact Rounded
-pwsx2435 power 30.0E-1 0.5 -> 1.7 Inexact Rounded
-pwsx2436 power 30.00E-2 0.5 -> 0.55 Inexact Rounded
-pwsx2437 power 30E-3 0.5 -> 0.17 Inexact Rounded
-pwsx2438 power 30E+1 0.5 -> 17 Inexact Rounded
-pwsx2439 power 30E+2 0.5 -> 55 Inexact Rounded
-pwsx2440 power 30E+3 0.5 -> 1.7E+2 Inexact Rounded
-pwsx2441 power 0.31 0.5 -> 0.56 Inexact Rounded
-pwsx2442 power 0.031 0.5 -> 0.18 Inexact Rounded
-pwsx2443 power 31.0E-1 0.5 -> 1.8 Inexact Rounded
-pwsx2444 power 31.00E-2 0.5 -> 0.56 Inexact Rounded
-pwsx2445 power 31E-3 0.5 -> 0.18 Inexact Rounded
-pwsx2446 power 31E+1 0.5 -> 18 Inexact Rounded
-pwsx2447 power 31E+2 0.5 -> 56 Inexact Rounded
-pwsx2448 power 31E+3 0.5 -> 1.8E+2 Inexact Rounded
-pwsx2449 power 0.32 0.5 -> 0.57 Inexact Rounded
-pwsx2450 power 0.032 0.5 -> 0.18 Inexact Rounded
-pwsx2451 power 32.0E-1 0.5 -> 1.8 Inexact Rounded
-pwsx2452 power 32.00E-2 0.5 -> 0.57 Inexact Rounded
-pwsx2453 power 32E-3 0.5 -> 0.18 Inexact Rounded
-pwsx2454 power 32E+1 0.5 -> 18 Inexact Rounded
-pwsx2455 power 32E+2 0.5 -> 57 Inexact Rounded
-pwsx2456 power 32E+3 0.5 -> 1.8E+2 Inexact Rounded
-pwsx2457 power 0.33 0.5 -> 0.57 Inexact Rounded
-pwsx2458 power 0.033 0.5 -> 0.18 Inexact Rounded
-pwsx2459 power 33.0E-1 0.5 -> 1.8 Inexact Rounded
-pwsx2460 power 33.00E-2 0.5 -> 0.57 Inexact Rounded
-pwsx2461 power 33E-3 0.5 -> 0.18 Inexact Rounded
-pwsx2462 power 33E+1 0.5 -> 18 Inexact Rounded
-pwsx2463 power 33E+2 0.5 -> 57 Inexact Rounded
-pwsx2464 power 33E+3 0.5 -> 1.8E+2 Inexact Rounded
-pwsx2465 power 0.34 0.5 -> 0.58 Inexact Rounded
-pwsx2466 power 0.034 0.5 -> 0.18 Inexact Rounded
-pwsx2467 power 34.0E-1 0.5 -> 1.8 Inexact Rounded
-pwsx2468 power 34.00E-2 0.5 -> 0.58 Inexact Rounded
-pwsx2469 power 34E-3 0.5 -> 0.18 Inexact Rounded
-pwsx2470 power 34E+1 0.5 -> 18 Inexact Rounded
-pwsx2471 power 34E+2 0.5 -> 58 Inexact Rounded
-pwsx2472 power 34E+3 0.5 -> 1.8E+2 Inexact Rounded
-pwsx2473 power 0.35 0.5 -> 0.59 Inexact Rounded
-pwsx2474 power 0.035 0.5 -> 0.19 Inexact Rounded
-pwsx2475 power 35.0E-1 0.5 -> 1.9 Inexact Rounded
-pwsx2476 power 35.00E-2 0.5 -> 0.59 Inexact Rounded
-pwsx2477 power 35E-3 0.5 -> 0.19 Inexact Rounded
-pwsx2478 power 35E+1 0.5 -> 19 Inexact Rounded
-pwsx2479 power 35E+2 0.5 -> 59 Inexact Rounded
-pwsx2480 power 35E+3 0.5 -> 1.9E+2 Inexact Rounded
-pwsx2481 power 0.36 0.5 -> 0.60 Inexact Rounded
-pwsx2482 power 0.036 0.5 -> 0.19 Inexact Rounded
-pwsx2483 power 36.0E-1 0.5 -> 1.9 Inexact Rounded
-pwsx2484 power 36.00E-2 0.5 -> 0.60 Inexact Rounded
-pwsx2485 power 36E-3 0.5 -> 0.19 Inexact Rounded
-pwsx2486 power 36E+1 0.5 -> 19 Inexact Rounded
-pwsx2487 power 36E+2 0.5 -> 60 Inexact Rounded
-pwsx2488 power 36E+3 0.5 -> 1.9E+2 Inexact Rounded
-pwsx2489 power 0.37 0.5 -> 0.61 Inexact Rounded
-pwsx2490 power 0.037 0.5 -> 0.19 Inexact Rounded
-pwsx2491 power 37.0E-1 0.5 -> 1.9 Inexact Rounded
-pwsx2492 power 37.00E-2 0.5 -> 0.61 Inexact Rounded
-pwsx2493 power 37E-3 0.5 -> 0.19 Inexact Rounded
-pwsx2494 power 37E+1 0.5 -> 19 Inexact Rounded
-pwsx2495 power 37E+2 0.5 -> 61 Inexact Rounded
-pwsx2496 power 37E+3 0.5 -> 1.9E+2 Inexact Rounded
-pwsx2497 power 0.38 0.5 -> 0.62 Inexact Rounded
-pwsx2498 power 0.038 0.5 -> 0.19 Inexact Rounded
-pwsx2499 power 38.0E-1 0.5 -> 1.9 Inexact Rounded
-pwsx2500 power 38.00E-2 0.5 -> 0.62 Inexact Rounded
-pwsx2501 power 38E-3 0.5 -> 0.19 Inexact Rounded
-pwsx2502 power 38E+1 0.5 -> 19 Inexact Rounded
-pwsx2503 power 38E+2 0.5 -> 62 Inexact Rounded
-pwsx2504 power 38E+3 0.5 -> 1.9E+2 Inexact Rounded
-pwsx2505 power 0.39 0.5 -> 0.62 Inexact Rounded
-pwsx2506 power 0.039 0.5 -> 0.20 Inexact Rounded
-pwsx2507 power 39.0E-1 0.5 -> 2.0 Inexact Rounded
-pwsx2508 power 39.00E-2 0.5 -> 0.62 Inexact Rounded
-pwsx2509 power 39E-3 0.5 -> 0.20 Inexact Rounded
-pwsx2510 power 39E+1 0.5 -> 20 Inexact Rounded
-pwsx2511 power 39E+2 0.5 -> 62 Inexact Rounded
-pwsx2512 power 39E+3 0.5 -> 2.0E+2 Inexact Rounded
-pwsx2513 power 0.40 0.5 -> 0.63 Inexact Rounded
-pwsx2514 power 0.040 0.5 -> 0.20 Inexact Rounded
-pwsx2515 power 40.0E-1 0.5 -> 2.0 Inexact Rounded
-pwsx2516 power 40.00E-2 0.5 -> 0.63 Inexact Rounded
-pwsx2517 power 40E-3 0.5 -> 0.20 Inexact Rounded
-pwsx2518 power 40E+1 0.5 -> 20 Inexact Rounded
-pwsx2519 power 40E+2 0.5 -> 63 Inexact Rounded
-pwsx2520 power 40E+3 0.5 -> 2.0E+2 Inexact Rounded
-pwsx2521 power 0.41 0.5 -> 0.64 Inexact Rounded
-pwsx2522 power 0.041 0.5 -> 0.20 Inexact Rounded
-pwsx2523 power 41.0E-1 0.5 -> 2.0 Inexact Rounded
-pwsx2524 power 41.00E-2 0.5 -> 0.64 Inexact Rounded
-pwsx2525 power 41E-3 0.5 -> 0.20 Inexact Rounded
-pwsx2526 power 41E+1 0.5 -> 20 Inexact Rounded
-pwsx2527 power 41E+2 0.5 -> 64 Inexact Rounded
-pwsx2528 power 41E+3 0.5 -> 2.0E+2 Inexact Rounded
-pwsx2529 power 0.42 0.5 -> 0.65 Inexact Rounded
-pwsx2530 power 0.042 0.5 -> 0.20 Inexact Rounded
-pwsx2531 power 42.0E-1 0.5 -> 2.0 Inexact Rounded
-pwsx2532 power 42.00E-2 0.5 -> 0.65 Inexact Rounded
-pwsx2533 power 42E-3 0.5 -> 0.20 Inexact Rounded
-pwsx2534 power 42E+1 0.5 -> 20 Inexact Rounded
-pwsx2535 power 42E+2 0.5 -> 65 Inexact Rounded
-pwsx2536 power 42E+3 0.5 -> 2.0E+2 Inexact Rounded
-pwsx2537 power 0.43 0.5 -> 0.66 Inexact Rounded
-pwsx2538 power 0.043 0.5 -> 0.21 Inexact Rounded
-pwsx2539 power 43.0E-1 0.5 -> 2.1 Inexact Rounded
-pwsx2540 power 43.00E-2 0.5 -> 0.66 Inexact Rounded
-pwsx2541 power 43E-3 0.5 -> 0.21 Inexact Rounded
-pwsx2542 power 43E+1 0.5 -> 21 Inexact Rounded
-pwsx2543 power 43E+2 0.5 -> 66 Inexact Rounded
-pwsx2544 power 43E+3 0.5 -> 2.1E+2 Inexact Rounded
-pwsx2545 power 0.44 0.5 -> 0.66 Inexact Rounded
-pwsx2546 power 0.044 0.5 -> 0.21 Inexact Rounded
-pwsx2547 power 44.0E-1 0.5 -> 2.1 Inexact Rounded
-pwsx2548 power 44.00E-2 0.5 -> 0.66 Inexact Rounded
-pwsx2549 power 44E-3 0.5 -> 0.21 Inexact Rounded
-pwsx2550 power 44E+1 0.5 -> 21 Inexact Rounded
-pwsx2551 power 44E+2 0.5 -> 66 Inexact Rounded
-pwsx2552 power 44E+3 0.5 -> 2.1E+2 Inexact Rounded
-pwsx2553 power 0.45 0.5 -> 0.67 Inexact Rounded
-pwsx2554 power 0.045 0.5 -> 0.21 Inexact Rounded
-pwsx2555 power 45.0E-1 0.5 -> 2.1 Inexact Rounded
-pwsx2556 power 45.00E-2 0.5 -> 0.67 Inexact Rounded
-pwsx2557 power 45E-3 0.5 -> 0.21 Inexact Rounded
-pwsx2558 power 45E+1 0.5 -> 21 Inexact Rounded
-pwsx2559 power 45E+2 0.5 -> 67 Inexact Rounded
-pwsx2560 power 45E+3 0.5 -> 2.1E+2 Inexact Rounded
-pwsx2561 power 0.46 0.5 -> 0.68 Inexact Rounded
-pwsx2562 power 0.046 0.5 -> 0.21 Inexact Rounded
-pwsx2563 power 46.0E-1 0.5 -> 2.1 Inexact Rounded
-pwsx2564 power 46.00E-2 0.5 -> 0.68 Inexact Rounded
-pwsx2565 power 46E-3 0.5 -> 0.21 Inexact Rounded
-pwsx2566 power 46E+1 0.5 -> 21 Inexact Rounded
-pwsx2567 power 46E+2 0.5 -> 68 Inexact Rounded
-pwsx2568 power 46E+3 0.5 -> 2.1E+2 Inexact Rounded
-pwsx2569 power 0.47 0.5 -> 0.69 Inexact Rounded
-pwsx2570 power 0.047 0.5 -> 0.22 Inexact Rounded
-pwsx2571 power 47.0E-1 0.5 -> 2.2 Inexact Rounded
-pwsx2572 power 47.00E-2 0.5 -> 0.69 Inexact Rounded
-pwsx2573 power 47E-3 0.5 -> 0.22 Inexact Rounded
-pwsx2574 power 47E+1 0.5 -> 22 Inexact Rounded
-pwsx2575 power 47E+2 0.5 -> 69 Inexact Rounded
-pwsx2576 power 47E+3 0.5 -> 2.2E+2 Inexact Rounded
-pwsx2577 power 0.48 0.5 -> 0.69 Inexact Rounded
-pwsx2578 power 0.048 0.5 -> 0.22 Inexact Rounded
-pwsx2579 power 48.0E-1 0.5 -> 2.2 Inexact Rounded
-pwsx2580 power 48.00E-2 0.5 -> 0.69 Inexact Rounded
-pwsx2581 power 48E-3 0.5 -> 0.22 Inexact Rounded
-pwsx2582 power 48E+1 0.5 -> 22 Inexact Rounded
-pwsx2583 power 48E+2 0.5 -> 69 Inexact Rounded
-pwsx2584 power 48E+3 0.5 -> 2.2E+2 Inexact Rounded
-pwsx2585 power 0.49 0.5 -> 0.70 Inexact Rounded
-pwsx2586 power 0.049 0.5 -> 0.22 Inexact Rounded
-pwsx2587 power 49.0E-1 0.5 -> 2.2 Inexact Rounded
-pwsx2588 power 49.00E-2 0.5 -> 0.70 Inexact Rounded
-pwsx2589 power 49E-3 0.5 -> 0.22 Inexact Rounded
-pwsx2590 power 49E+1 0.5 -> 22 Inexact Rounded
-pwsx2591 power 49E+2 0.5 -> 70 Inexact Rounded
-pwsx2592 power 49E+3 0.5 -> 2.2E+2 Inexact Rounded
-pwsx2593 power 0.50 0.5 -> 0.71 Inexact Rounded
-pwsx2594 power 0.050 0.5 -> 0.22 Inexact Rounded
-pwsx2595 power 50.0E-1 0.5 -> 2.2 Inexact Rounded
-pwsx2596 power 50.00E-2 0.5 -> 0.71 Inexact Rounded
-pwsx2597 power 50E-3 0.5 -> 0.22 Inexact Rounded
-pwsx2598 power 50E+1 0.5 -> 22 Inexact Rounded
-pwsx2599 power 50E+2 0.5 -> 71 Inexact Rounded
-pwsx2600 power 50E+3 0.5 -> 2.2E+2 Inexact Rounded
-pwsx2601 power 0.51 0.5 -> 0.71 Inexact Rounded
-pwsx2602 power 0.051 0.5 -> 0.23 Inexact Rounded
-pwsx2603 power 51.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2604 power 51.00E-2 0.5 -> 0.71 Inexact Rounded
-pwsx2605 power 51E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2606 power 51E+1 0.5 -> 23 Inexact Rounded
-pwsx2607 power 51E+2 0.5 -> 71 Inexact Rounded
-pwsx2608 power 51E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2609 power 0.52 0.5 -> 0.72 Inexact Rounded
-pwsx2610 power 0.052 0.5 -> 0.23 Inexact Rounded
-pwsx2611 power 52.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2612 power 52.00E-2 0.5 -> 0.72 Inexact Rounded
-pwsx2613 power 52E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2614 power 52E+1 0.5 -> 23 Inexact Rounded
-pwsx2615 power 52E+2 0.5 -> 72 Inexact Rounded
-pwsx2616 power 52E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2617 power 0.53 0.5 -> 0.73 Inexact Rounded
-pwsx2618 power 0.053 0.5 -> 0.23 Inexact Rounded
-pwsx2619 power 53.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2620 power 53.00E-2 0.5 -> 0.73 Inexact Rounded
-pwsx2621 power 53E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2622 power 53E+1 0.5 -> 23 Inexact Rounded
-pwsx2623 power 53E+2 0.5 -> 73 Inexact Rounded
-pwsx2624 power 53E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2625 power 0.54 0.5 -> 0.73 Inexact Rounded
-pwsx2626 power 0.054 0.5 -> 0.23 Inexact Rounded
-pwsx2627 power 54.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2628 power 54.00E-2 0.5 -> 0.73 Inexact Rounded
-pwsx2629 power 54E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2630 power 54E+1 0.5 -> 23 Inexact Rounded
-pwsx2631 power 54E+2 0.5 -> 73 Inexact Rounded
-pwsx2632 power 54E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2633 power 0.55 0.5 -> 0.74 Inexact Rounded
-pwsx2634 power 0.055 0.5 -> 0.23 Inexact Rounded
-pwsx2635 power 55.0E-1 0.5 -> 2.3 Inexact Rounded
-pwsx2636 power 55.00E-2 0.5 -> 0.74 Inexact Rounded
-pwsx2637 power 55E-3 0.5 -> 0.23 Inexact Rounded
-pwsx2638 power 55E+1 0.5 -> 23 Inexact Rounded
-pwsx2639 power 55E+2 0.5 -> 74 Inexact Rounded
-pwsx2640 power 55E+3 0.5 -> 2.3E+2 Inexact Rounded
-pwsx2641 power 0.56 0.5 -> 0.75 Inexact Rounded
-pwsx2642 power 0.056 0.5 -> 0.24 Inexact Rounded
-pwsx2643 power 56.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2644 power 56.00E-2 0.5 -> 0.75 Inexact Rounded
-pwsx2645 power 56E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2646 power 56E+1 0.5 -> 24 Inexact Rounded
-pwsx2647 power 56E+2 0.5 -> 75 Inexact Rounded
-pwsx2648 power 56E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2649 power 0.57 0.5 -> 0.75 Inexact Rounded
-pwsx2650 power 0.057 0.5 -> 0.24 Inexact Rounded
-pwsx2651 power 57.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2652 power 57.00E-2 0.5 -> 0.75 Inexact Rounded
-pwsx2653 power 57E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2654 power 57E+1 0.5 -> 24 Inexact Rounded
-pwsx2655 power 57E+2 0.5 -> 75 Inexact Rounded
-pwsx2656 power 57E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2657 power 0.58 0.5 -> 0.76 Inexact Rounded
-pwsx2658 power 0.058 0.5 -> 0.24 Inexact Rounded
-pwsx2659 power 58.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2660 power 58.00E-2 0.5 -> 0.76 Inexact Rounded
-pwsx2661 power 58E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2662 power 58E+1 0.5 -> 24 Inexact Rounded
-pwsx2663 power 58E+2 0.5 -> 76 Inexact Rounded
-pwsx2664 power 58E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2665 power 0.59 0.5 -> 0.77 Inexact Rounded
-pwsx2666 power 0.059 0.5 -> 0.24 Inexact Rounded
-pwsx2667 power 59.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2668 power 59.00E-2 0.5 -> 0.77 Inexact Rounded
-pwsx2669 power 59E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2670 power 59E+1 0.5 -> 24 Inexact Rounded
-pwsx2671 power 59E+2 0.5 -> 77 Inexact Rounded
-pwsx2672 power 59E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2673 power 0.60 0.5 -> 0.77 Inexact Rounded
-pwsx2674 power 0.060 0.5 -> 0.24 Inexact Rounded
-pwsx2675 power 60.0E-1 0.5 -> 2.4 Inexact Rounded
-pwsx2676 power 60.00E-2 0.5 -> 0.77 Inexact Rounded
-pwsx2677 power 60E-3 0.5 -> 0.24 Inexact Rounded
-pwsx2678 power 60E+1 0.5 -> 24 Inexact Rounded
-pwsx2679 power 60E+2 0.5 -> 77 Inexact Rounded
-pwsx2680 power 60E+3 0.5 -> 2.4E+2 Inexact Rounded
-pwsx2681 power 0.61 0.5 -> 0.78 Inexact Rounded
-pwsx2682 power 0.061 0.5 -> 0.25 Inexact Rounded
-pwsx2683 power 61.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2684 power 61.00E-2 0.5 -> 0.78 Inexact Rounded
-pwsx2685 power 61E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2686 power 61E+1 0.5 -> 25 Inexact Rounded
-pwsx2687 power 61E+2 0.5 -> 78 Inexact Rounded
-pwsx2688 power 61E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2689 power 0.62 0.5 -> 0.79 Inexact Rounded
-pwsx2690 power 0.062 0.5 -> 0.25 Inexact Rounded
-pwsx2691 power 62.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2692 power 62.00E-2 0.5 -> 0.79 Inexact Rounded
-pwsx2693 power 62E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2694 power 62E+1 0.5 -> 25 Inexact Rounded
-pwsx2695 power 62E+2 0.5 -> 79 Inexact Rounded
-pwsx2696 power 62E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2697 power 0.63 0.5 -> 0.79 Inexact Rounded
-pwsx2698 power 0.063 0.5 -> 0.25 Inexact Rounded
-pwsx2699 power 63.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2700 power 63.00E-2 0.5 -> 0.79 Inexact Rounded
-pwsx2701 power 63E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2702 power 63E+1 0.5 -> 25 Inexact Rounded
-pwsx2703 power 63E+2 0.5 -> 79 Inexact Rounded
-pwsx2704 power 63E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2705 power 0.64 0.5 -> 0.80 Inexact Rounded
-pwsx2706 power 0.064 0.5 -> 0.25 Inexact Rounded
-pwsx2707 power 64.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2708 power 64.00E-2 0.5 -> 0.80 Inexact Rounded
-pwsx2709 power 64E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2710 power 64E+1 0.5 -> 25 Inexact Rounded
-pwsx2711 power 64E+2 0.5 -> 80 Inexact Rounded
-pwsx2712 power 64E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2713 power 0.65 0.5 -> 0.81 Inexact Rounded
-pwsx2714 power 0.065 0.5 -> 0.25 Inexact Rounded
-pwsx2715 power 65.0E-1 0.5 -> 2.5 Inexact Rounded
-pwsx2716 power 65.00E-2 0.5 -> 0.81 Inexact Rounded
-pwsx2717 power 65E-3 0.5 -> 0.25 Inexact Rounded
-pwsx2718 power 65E+1 0.5 -> 25 Inexact Rounded
-pwsx2719 power 65E+2 0.5 -> 81 Inexact Rounded
-pwsx2720 power 65E+3 0.5 -> 2.5E+2 Inexact Rounded
-pwsx2721 power 0.66 0.5 -> 0.81 Inexact Rounded
-pwsx2722 power 0.066 0.5 -> 0.26 Inexact Rounded
-pwsx2723 power 66.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2724 power 66.00E-2 0.5 -> 0.81 Inexact Rounded
-pwsx2725 power 66E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2726 power 66E+1 0.5 -> 26 Inexact Rounded
-pwsx2727 power 66E+2 0.5 -> 81 Inexact Rounded
-pwsx2728 power 66E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2729 power 0.67 0.5 -> 0.82 Inexact Rounded
-pwsx2730 power 0.067 0.5 -> 0.26 Inexact Rounded
-pwsx2731 power 67.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2732 power 67.00E-2 0.5 -> 0.82 Inexact Rounded
-pwsx2733 power 67E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2734 power 67E+1 0.5 -> 26 Inexact Rounded
-pwsx2735 power 67E+2 0.5 -> 82 Inexact Rounded
-pwsx2736 power 67E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2737 power 0.68 0.5 -> 0.82 Inexact Rounded
-pwsx2738 power 0.068 0.5 -> 0.26 Inexact Rounded
-pwsx2739 power 68.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2740 power 68.00E-2 0.5 -> 0.82 Inexact Rounded
-pwsx2741 power 68E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2742 power 68E+1 0.5 -> 26 Inexact Rounded
-pwsx2743 power 68E+2 0.5 -> 82 Inexact Rounded
-pwsx2744 power 68E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2745 power 0.69 0.5 -> 0.83 Inexact Rounded
-pwsx2746 power 0.069 0.5 -> 0.26 Inexact Rounded
-pwsx2747 power 69.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2748 power 69.00E-2 0.5 -> 0.83 Inexact Rounded
-pwsx2749 power 69E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2750 power 69E+1 0.5 -> 26 Inexact Rounded
-pwsx2751 power 69E+2 0.5 -> 83 Inexact Rounded
-pwsx2752 power 69E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2753 power 0.70 0.5 -> 0.84 Inexact Rounded
-pwsx2754 power 0.070 0.5 -> 0.26 Inexact Rounded
-pwsx2755 power 70.0E-1 0.5 -> 2.6 Inexact Rounded
-pwsx2756 power 70.00E-2 0.5 -> 0.84 Inexact Rounded
-pwsx2757 power 70E-3 0.5 -> 0.26 Inexact Rounded
-pwsx2758 power 70E+1 0.5 -> 26 Inexact Rounded
-pwsx2759 power 70E+2 0.5 -> 84 Inexact Rounded
-pwsx2760 power 70E+3 0.5 -> 2.6E+2 Inexact Rounded
-pwsx2761 power 0.71 0.5 -> 0.84 Inexact Rounded
-pwsx2762 power 0.071 0.5 -> 0.27 Inexact Rounded
-pwsx2763 power 71.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2764 power 71.00E-2 0.5 -> 0.84 Inexact Rounded
-pwsx2765 power 71E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2766 power 71E+1 0.5 -> 27 Inexact Rounded
-pwsx2767 power 71E+2 0.5 -> 84 Inexact Rounded
-pwsx2768 power 71E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2769 power 0.72 0.5 -> 0.85 Inexact Rounded
-pwsx2770 power 0.072 0.5 -> 0.27 Inexact Rounded
-pwsx2771 power 72.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2772 power 72.00E-2 0.5 -> 0.85 Inexact Rounded
-pwsx2773 power 72E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2774 power 72E+1 0.5 -> 27 Inexact Rounded
-pwsx2775 power 72E+2 0.5 -> 85 Inexact Rounded
-pwsx2776 power 72E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2777 power 0.73 0.5 -> 0.85 Inexact Rounded
-pwsx2778 power 0.073 0.5 -> 0.27 Inexact Rounded
-pwsx2779 power 73.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2780 power 73.00E-2 0.5 -> 0.85 Inexact Rounded
-pwsx2781 power 73E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2782 power 73E+1 0.5 -> 27 Inexact Rounded
-pwsx2783 power 73E+2 0.5 -> 85 Inexact Rounded
-pwsx2784 power 73E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2785 power 0.74 0.5 -> 0.86 Inexact Rounded
-pwsx2786 power 0.074 0.5 -> 0.27 Inexact Rounded
-pwsx2787 power 74.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2788 power 74.00E-2 0.5 -> 0.86 Inexact Rounded
-pwsx2789 power 74E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2790 power 74E+1 0.5 -> 27 Inexact Rounded
-pwsx2791 power 74E+2 0.5 -> 86 Inexact Rounded
-pwsx2792 power 74E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2793 power 0.75 0.5 -> 0.87 Inexact Rounded
-pwsx2794 power 0.075 0.5 -> 0.27 Inexact Rounded
-pwsx2795 power 75.0E-1 0.5 -> 2.7 Inexact Rounded
-pwsx2796 power 75.00E-2 0.5 -> 0.87 Inexact Rounded
-pwsx2797 power 75E-3 0.5 -> 0.27 Inexact Rounded
-pwsx2798 power 75E+1 0.5 -> 27 Inexact Rounded
-pwsx2799 power 75E+2 0.5 -> 87 Inexact Rounded
-pwsx2800 power 75E+3 0.5 -> 2.7E+2 Inexact Rounded
-pwsx2801 power 0.76 0.5 -> 0.87 Inexact Rounded
-pwsx2802 power 0.076 0.5 -> 0.28 Inexact Rounded
-pwsx2803 power 76.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2804 power 76.00E-2 0.5 -> 0.87 Inexact Rounded
-pwsx2805 power 76E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2806 power 76E+1 0.5 -> 28 Inexact Rounded
-pwsx2807 power 76E+2 0.5 -> 87 Inexact Rounded
-pwsx2808 power 76E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2809 power 0.77 0.5 -> 0.88 Inexact Rounded
-pwsx2810 power 0.077 0.5 -> 0.28 Inexact Rounded
-pwsx2811 power 77.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2812 power 77.00E-2 0.5 -> 0.88 Inexact Rounded
-pwsx2813 power 77E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2814 power 77E+1 0.5 -> 28 Inexact Rounded
-pwsx2815 power 77E+2 0.5 -> 88 Inexact Rounded
-pwsx2816 power 77E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2817 power 0.78 0.5 -> 0.88 Inexact Rounded
-pwsx2818 power 0.078 0.5 -> 0.28 Inexact Rounded
-pwsx2819 power 78.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2820 power 78.00E-2 0.5 -> 0.88 Inexact Rounded
-pwsx2821 power 78E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2822 power 78E+1 0.5 -> 28 Inexact Rounded
-pwsx2823 power 78E+2 0.5 -> 88 Inexact Rounded
-pwsx2824 power 78E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2825 power 0.79 0.5 -> 0.89 Inexact Rounded
-pwsx2826 power 0.079 0.5 -> 0.28 Inexact Rounded
-pwsx2827 power 79.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2828 power 79.00E-2 0.5 -> 0.89 Inexact Rounded
-pwsx2829 power 79E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2830 power 79E+1 0.5 -> 28 Inexact Rounded
-pwsx2831 power 79E+2 0.5 -> 89 Inexact Rounded
-pwsx2832 power 79E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2833 power 0.80 0.5 -> 0.89 Inexact Rounded
-pwsx2834 power 0.080 0.5 -> 0.28 Inexact Rounded
-pwsx2835 power 80.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2836 power 80.00E-2 0.5 -> 0.89 Inexact Rounded
-pwsx2837 power 80E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2838 power 80E+1 0.5 -> 28 Inexact Rounded
-pwsx2839 power 80E+2 0.5 -> 89 Inexact Rounded
-pwsx2840 power 80E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2841 power 0.81 0.5 -> 0.90 Inexact Rounded
-pwsx2842 power 0.081 0.5 -> 0.28 Inexact Rounded
-pwsx2843 power 81.0E-1 0.5 -> 2.8 Inexact Rounded
-pwsx2844 power 81.00E-2 0.5 -> 0.90 Inexact Rounded
-pwsx2845 power 81E-3 0.5 -> 0.28 Inexact Rounded
-pwsx2846 power 81E+1 0.5 -> 28 Inexact Rounded
-pwsx2847 power 81E+2 0.5 -> 90 Inexact Rounded
-pwsx2848 power 81E+3 0.5 -> 2.8E+2 Inexact Rounded
-pwsx2849 power 0.82 0.5 -> 0.91 Inexact Rounded
-pwsx2850 power 0.082 0.5 -> 0.29 Inexact Rounded
-pwsx2851 power 82.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2852 power 82.00E-2 0.5 -> 0.91 Inexact Rounded
-pwsx2853 power 82E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2854 power 82E+1 0.5 -> 29 Inexact Rounded
-pwsx2855 power 82E+2 0.5 -> 91 Inexact Rounded
-pwsx2856 power 82E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2857 power 0.83 0.5 -> 0.91 Inexact Rounded
-pwsx2858 power 0.083 0.5 -> 0.29 Inexact Rounded
-pwsx2859 power 83.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2860 power 83.00E-2 0.5 -> 0.91 Inexact Rounded
-pwsx2861 power 83E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2862 power 83E+1 0.5 -> 29 Inexact Rounded
-pwsx2863 power 83E+2 0.5 -> 91 Inexact Rounded
-pwsx2864 power 83E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2865 power 0.84 0.5 -> 0.92 Inexact Rounded
-pwsx2866 power 0.084 0.5 -> 0.29 Inexact Rounded
-pwsx2867 power 84.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2868 power 84.00E-2 0.5 -> 0.92 Inexact Rounded
-pwsx2869 power 84E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2870 power 84E+1 0.5 -> 29 Inexact Rounded
-pwsx2871 power 84E+2 0.5 -> 92 Inexact Rounded
-pwsx2872 power 84E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2873 power 0.85 0.5 -> 0.92 Inexact Rounded
-pwsx2874 power 0.085 0.5 -> 0.29 Inexact Rounded
-pwsx2875 power 85.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2876 power 85.00E-2 0.5 -> 0.92 Inexact Rounded
-pwsx2877 power 85E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2878 power 85E+1 0.5 -> 29 Inexact Rounded
-pwsx2879 power 85E+2 0.5 -> 92 Inexact Rounded
-pwsx2880 power 85E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2881 power 0.86 0.5 -> 0.93 Inexact Rounded
-pwsx2882 power 0.086 0.5 -> 0.29 Inexact Rounded
-pwsx2883 power 86.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2884 power 86.00E-2 0.5 -> 0.93 Inexact Rounded
-pwsx2885 power 86E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2886 power 86E+1 0.5 -> 29 Inexact Rounded
-pwsx2887 power 86E+2 0.5 -> 93 Inexact Rounded
-pwsx2888 power 86E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2889 power 0.87 0.5 -> 0.93 Inexact Rounded
-pwsx2890 power 0.087 0.5 -> 0.29 Inexact Rounded
-pwsx2891 power 87.0E-1 0.5 -> 2.9 Inexact Rounded
-pwsx2892 power 87.00E-2 0.5 -> 0.93 Inexact Rounded
-pwsx2893 power 87E-3 0.5 -> 0.29 Inexact Rounded
-pwsx2894 power 87E+1 0.5 -> 29 Inexact Rounded
-pwsx2895 power 87E+2 0.5 -> 93 Inexact Rounded
-pwsx2896 power 87E+3 0.5 -> 2.9E+2 Inexact Rounded
-pwsx2897 power 0.88 0.5 -> 0.94 Inexact Rounded
-pwsx2898 power 0.088 0.5 -> 0.30 Inexact Rounded
-pwsx2899 power 88.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2900 power 88.00E-2 0.5 -> 0.94 Inexact Rounded
-pwsx2901 power 88E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2902 power 88E+1 0.5 -> 30 Inexact Rounded
-pwsx2903 power 88E+2 0.5 -> 94 Inexact Rounded
-pwsx2904 power 88E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2905 power 0.89 0.5 -> 0.94 Inexact Rounded
-pwsx2906 power 0.089 0.5 -> 0.30 Inexact Rounded
-pwsx2907 power 89.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2908 power 89.00E-2 0.5 -> 0.94 Inexact Rounded
-pwsx2909 power 89E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2910 power 89E+1 0.5 -> 30 Inexact Rounded
-pwsx2911 power 89E+2 0.5 -> 94 Inexact Rounded
-pwsx2912 power 89E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2913 power 0.90 0.5 -> 0.95 Inexact Rounded
-pwsx2914 power 0.090 0.5 -> 0.30 Inexact Rounded
-pwsx2915 power 90.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2916 power 90.00E-2 0.5 -> 0.95 Inexact Rounded
-pwsx2917 power 90E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2918 power 90E+1 0.5 -> 30 Inexact Rounded
-pwsx2919 power 90E+2 0.5 -> 95 Inexact Rounded
-pwsx2920 power 90E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2921 power 0.91 0.5 -> 0.95 Inexact Rounded
-pwsx2922 power 0.091 0.5 -> 0.30 Inexact Rounded
-pwsx2923 power 91.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2924 power 91.00E-2 0.5 -> 0.95 Inexact Rounded
-pwsx2925 power 91E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2926 power 91E+1 0.5 -> 30 Inexact Rounded
-pwsx2927 power 91E+2 0.5 -> 95 Inexact Rounded
-pwsx2928 power 91E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2929 power 0.92 0.5 -> 0.96 Inexact Rounded
-pwsx2930 power 0.092 0.5 -> 0.30 Inexact Rounded
-pwsx2931 power 92.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2932 power 92.00E-2 0.5 -> 0.96 Inexact Rounded
-pwsx2933 power 92E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2934 power 92E+1 0.5 -> 30 Inexact Rounded
-pwsx2935 power 92E+2 0.5 -> 96 Inexact Rounded
-pwsx2936 power 92E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2937 power 0.93 0.5 -> 0.96 Inexact Rounded
-pwsx2938 power 0.093 0.5 -> 0.30 Inexact Rounded
-pwsx2939 power 93.0E-1 0.5 -> 3.0 Inexact Rounded
-pwsx2940 power 93.00E-2 0.5 -> 0.96 Inexact Rounded
-pwsx2941 power 93E-3 0.5 -> 0.30 Inexact Rounded
-pwsx2942 power 93E+1 0.5 -> 30 Inexact Rounded
-pwsx2943 power 93E+2 0.5 -> 96 Inexact Rounded
-pwsx2944 power 93E+3 0.5 -> 3.0E+2 Inexact Rounded
-pwsx2945 power 0.94 0.5 -> 0.97 Inexact Rounded
-pwsx2946 power 0.094 0.5 -> 0.31 Inexact Rounded
-pwsx2947 power 94.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2948 power 94.00E-2 0.5 -> 0.97 Inexact Rounded
-pwsx2949 power 94E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2950 power 94E+1 0.5 -> 31 Inexact Rounded
-pwsx2951 power 94E+2 0.5 -> 97 Inexact Rounded
-pwsx2952 power 94E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2953 power 0.95 0.5 -> 0.97 Inexact Rounded
-pwsx2954 power 0.095 0.5 -> 0.31 Inexact Rounded
-pwsx2955 power 95.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2956 power 95.00E-2 0.5 -> 0.97 Inexact Rounded
-pwsx2957 power 95E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2958 power 95E+1 0.5 -> 31 Inexact Rounded
-pwsx2959 power 95E+2 0.5 -> 97 Inexact Rounded
-pwsx2960 power 95E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2961 power 0.96 0.5 -> 0.98 Inexact Rounded
-pwsx2962 power 0.096 0.5 -> 0.31 Inexact Rounded
-pwsx2963 power 96.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2964 power 96.00E-2 0.5 -> 0.98 Inexact Rounded
-pwsx2965 power 96E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2966 power 96E+1 0.5 -> 31 Inexact Rounded
-pwsx2967 power 96E+2 0.5 -> 98 Inexact Rounded
-pwsx2968 power 96E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2969 power 0.97 0.5 -> 0.98 Inexact Rounded
-pwsx2970 power 0.097 0.5 -> 0.31 Inexact Rounded
-pwsx2971 power 97.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2972 power 97.00E-2 0.5 -> 0.98 Inexact Rounded
-pwsx2973 power 97E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2974 power 97E+1 0.5 -> 31 Inexact Rounded
-pwsx2975 power 97E+2 0.5 -> 98 Inexact Rounded
-pwsx2976 power 97E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2977 power 0.98 0.5 -> 0.99 Inexact Rounded
-pwsx2978 power 0.098 0.5 -> 0.31 Inexact Rounded
-pwsx2979 power 98.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2980 power 98.00E-2 0.5 -> 0.99 Inexact Rounded
-pwsx2981 power 98E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2982 power 98E+1 0.5 -> 31 Inexact Rounded
-pwsx2983 power 98E+2 0.5 -> 99 Inexact Rounded
-pwsx2984 power 98E+3 0.5 -> 3.1E+2 Inexact Rounded
-pwsx2985 power 0.99 0.5 -> 0.99 Inexact Rounded
-pwsx2986 power 0.099 0.5 -> 0.31 Inexact Rounded
-pwsx2987 power 99.0E-1 0.5 -> 3.1 Inexact Rounded
-pwsx2988 power 99.00E-2 0.5 -> 0.99 Inexact Rounded
-pwsx2989 power 99E-3 0.5 -> 0.31 Inexact Rounded
-pwsx2990 power 99E+1 0.5 -> 31 Inexact Rounded
-pwsx2991 power 99E+2 0.5 -> 99 Inexact Rounded
-pwsx2992 power 99E+3 0.5 -> 3.1E+2 Inexact Rounded
-
--- Precision 3 squareroot tests [exhaustive, f and f/10]
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-precision: 3
-pwsx3001 power 0.1 0.5 -> 0.316 Inexact Rounded
-pwsx3002 power 0.01 0.5 -> 0.100 Inexact Rounded
-pwsx3003 power 0.2 0.5 -> 0.447 Inexact Rounded
-pwsx3004 power 0.02 0.5 -> 0.141 Inexact Rounded
-pwsx3005 power 0.3 0.5 -> 0.548 Inexact Rounded
-pwsx3006 power 0.03 0.5 -> 0.173 Inexact Rounded
-pwsx3007 power 0.4 0.5 -> 0.632 Inexact Rounded
-pwsx3008 power 0.04 0.5 -> 0.200 Inexact Rounded
-pwsx3009 power 0.5 0.5 -> 0.707 Inexact Rounded
-pwsx3010 power 0.05 0.5 -> 0.224 Inexact Rounded
-pwsx3011 power 0.6 0.5 -> 0.775 Inexact Rounded
-pwsx3012 power 0.06 0.5 -> 0.245 Inexact Rounded
-pwsx3013 power 0.7 0.5 -> 0.837 Inexact Rounded
-pwsx3014 power 0.07 0.5 -> 0.265 Inexact Rounded
-pwsx3015 power 0.8 0.5 -> 0.894 Inexact Rounded
-pwsx3016 power 0.08 0.5 -> 0.283 Inexact Rounded
-pwsx3017 power 0.9 0.5 -> 0.949 Inexact Rounded
-pwsx3018 power 0.09 0.5 -> 0.300 Inexact Rounded
-pwsx3019 power 0.11 0.5 -> 0.332 Inexact Rounded
-pwsx3020 power 0.011 0.5 -> 0.105 Inexact Rounded
-pwsx3021 power 0.12 0.5 -> 0.346 Inexact Rounded
-pwsx3022 power 0.012 0.5 -> 0.110 Inexact Rounded
-pwsx3023 power 0.13 0.5 -> 0.361 Inexact Rounded
-pwsx3024 power 0.013 0.5 -> 0.114 Inexact Rounded
-pwsx3025 power 0.14 0.5 -> 0.374 Inexact Rounded
-pwsx3026 power 0.014 0.5 -> 0.118 Inexact Rounded
-pwsx3027 power 0.15 0.5 -> 0.387 Inexact Rounded
-pwsx3028 power 0.015 0.5 -> 0.122 Inexact Rounded
-pwsx3029 power 0.16 0.5 -> 0.400 Inexact Rounded
-pwsx3030 power 0.016 0.5 -> 0.126 Inexact Rounded
-pwsx3031 power 0.17 0.5 -> 0.412 Inexact Rounded
-pwsx3032 power 0.017 0.5 -> 0.130 Inexact Rounded
-pwsx3033 power 0.18 0.5 -> 0.424 Inexact Rounded
-pwsx3034 power 0.018 0.5 -> 0.134 Inexact Rounded
-pwsx3035 power 0.19 0.5 -> 0.436 Inexact Rounded
-pwsx3036 power 0.019 0.5 -> 0.138 Inexact Rounded
-pwsx3037 power 0.21 0.5 -> 0.458 Inexact Rounded
-pwsx3038 power 0.021 0.5 -> 0.145 Inexact Rounded
-pwsx3039 power 0.22 0.5 -> 0.469 Inexact Rounded
-pwsx3040 power 0.022 0.5 -> 0.148 Inexact Rounded
-pwsx3041 power 0.23 0.5 -> 0.480 Inexact Rounded
-pwsx3042 power 0.023 0.5 -> 0.152 Inexact Rounded
-pwsx3043 power 0.24 0.5 -> 0.490 Inexact Rounded
-pwsx3044 power 0.024 0.5 -> 0.155 Inexact Rounded
-pwsx3045 power 0.25 0.5 -> 0.500 Inexact Rounded
-pwsx3046 power 0.025 0.5 -> 0.158 Inexact Rounded
-pwsx3047 power 0.26 0.5 -> 0.510 Inexact Rounded
-pwsx3048 power 0.026 0.5 -> 0.161 Inexact Rounded
-pwsx3049 power 0.27 0.5 -> 0.520 Inexact Rounded
-pwsx3050 power 0.027 0.5 -> 0.164 Inexact Rounded
-pwsx3051 power 0.28 0.5 -> 0.529 Inexact Rounded
-pwsx3052 power 0.028 0.5 -> 0.167 Inexact Rounded
-pwsx3053 power 0.29 0.5 -> 0.539 Inexact Rounded
-pwsx3054 power 0.029 0.5 -> 0.170 Inexact Rounded
-pwsx3055 power 0.31 0.5 -> 0.557 Inexact Rounded
-pwsx3056 power 0.031 0.5 -> 0.176 Inexact Rounded
-pwsx3057 power 0.32 0.5 -> 0.566 Inexact Rounded
-pwsx3058 power 0.032 0.5 -> 0.179 Inexact Rounded
-pwsx3059 power 0.33 0.5 -> 0.574 Inexact Rounded
-pwsx3060 power 0.033 0.5 -> 0.182 Inexact Rounded
-pwsx3061 power 0.34 0.5 -> 0.583 Inexact Rounded
-pwsx3062 power 0.034 0.5 -> 0.184 Inexact Rounded
-pwsx3063 power 0.35 0.5 -> 0.592 Inexact Rounded
-pwsx3064 power 0.035 0.5 -> 0.187 Inexact Rounded
-pwsx3065 power 0.36 0.5 -> 0.600 Inexact Rounded
-pwsx3066 power 0.036 0.5 -> 0.190 Inexact Rounded
-pwsx3067 power 0.37 0.5 -> 0.608 Inexact Rounded
-pwsx3068 power 0.037 0.5 -> 0.192 Inexact Rounded
-pwsx3069 power 0.38 0.5 -> 0.616 Inexact Rounded
-pwsx3070 power 0.038 0.5 -> 0.195 Inexact Rounded
-pwsx3071 power 0.39 0.5 -> 0.624 Inexact Rounded
-pwsx3072 power 0.039 0.5 -> 0.197 Inexact Rounded
-pwsx3073 power 0.41 0.5 -> 0.640 Inexact Rounded
-pwsx3074 power 0.041 0.5 -> 0.202 Inexact Rounded
-pwsx3075 power 0.42 0.5 -> 0.648 Inexact Rounded
-pwsx3076 power 0.042 0.5 -> 0.205 Inexact Rounded
-pwsx3077 power 0.43 0.5 -> 0.656 Inexact Rounded
-pwsx3078 power 0.043 0.5 -> 0.207 Inexact Rounded
-pwsx3079 power 0.44 0.5 -> 0.663 Inexact Rounded
-pwsx3080 power 0.044 0.5 -> 0.210 Inexact Rounded
-pwsx3081 power 0.45 0.5 -> 0.671 Inexact Rounded
-pwsx3082 power 0.045 0.5 -> 0.212 Inexact Rounded
-pwsx3083 power 0.46 0.5 -> 0.678 Inexact Rounded
-pwsx3084 power 0.046 0.5 -> 0.214 Inexact Rounded
-pwsx3085 power 0.47 0.5 -> 0.686 Inexact Rounded
-pwsx3086 power 0.047 0.5 -> 0.217 Inexact Rounded
-pwsx3087 power 0.48 0.5 -> 0.693 Inexact Rounded
-pwsx3088 power 0.048 0.5 -> 0.219 Inexact Rounded
-pwsx3089 power 0.49 0.5 -> 0.700 Inexact Rounded
-pwsx3090 power 0.049 0.5 -> 0.221 Inexact Rounded
-pwsx3091 power 0.51 0.5 -> 0.714 Inexact Rounded
-pwsx3092 power 0.051 0.5 -> 0.226 Inexact Rounded
-pwsx3093 power 0.52 0.5 -> 0.721 Inexact Rounded
-pwsx3094 power 0.052 0.5 -> 0.228 Inexact Rounded
-pwsx3095 power 0.53 0.5 -> 0.728 Inexact Rounded
-pwsx3096 power 0.053 0.5 -> 0.230 Inexact Rounded
-pwsx3097 power 0.54 0.5 -> 0.735 Inexact Rounded
-pwsx3098 power 0.054 0.5 -> 0.232 Inexact Rounded
-pwsx3099 power 0.55 0.5 -> 0.742 Inexact Rounded
-pwsx3100 power 0.055 0.5 -> 0.235 Inexact Rounded
-pwsx3101 power 0.56 0.5 -> 0.748 Inexact Rounded
-pwsx3102 power 0.056 0.5 -> 0.237 Inexact Rounded
-pwsx3103 power 0.57 0.5 -> 0.755 Inexact Rounded
-pwsx3104 power 0.057 0.5 -> 0.239 Inexact Rounded
-pwsx3105 power 0.58 0.5 -> 0.762 Inexact Rounded
-pwsx3106 power 0.058 0.5 -> 0.241 Inexact Rounded
-pwsx3107 power 0.59 0.5 -> 0.768 Inexact Rounded
-pwsx3108 power 0.059 0.5 -> 0.243 Inexact Rounded
-pwsx3109 power 0.61 0.5 -> 0.781 Inexact Rounded
-pwsx3110 power 0.061 0.5 -> 0.247 Inexact Rounded
-pwsx3111 power 0.62 0.5 -> 0.787 Inexact Rounded
-pwsx3112 power 0.062 0.5 -> 0.249 Inexact Rounded
-pwsx3113 power 0.63 0.5 -> 0.794 Inexact Rounded
-pwsx3114 power 0.063 0.5 -> 0.251 Inexact Rounded
-pwsx3115 power 0.64 0.5 -> 0.800 Inexact Rounded
-pwsx3116 power 0.064 0.5 -> 0.253 Inexact Rounded
-pwsx3117 power 0.65 0.5 -> 0.806 Inexact Rounded
-pwsx3118 power 0.065 0.5 -> 0.255 Inexact Rounded
-pwsx3119 power 0.66 0.5 -> 0.812 Inexact Rounded
-pwsx3120 power 0.066 0.5 -> 0.257 Inexact Rounded
-pwsx3121 power 0.67 0.5 -> 0.819 Inexact Rounded
-pwsx3122 power 0.067 0.5 -> 0.259 Inexact Rounded
-pwsx3123 power 0.68 0.5 -> 0.825 Inexact Rounded
-pwsx3124 power 0.068 0.5 -> 0.261 Inexact Rounded
-pwsx3125 power 0.69 0.5 -> 0.831 Inexact Rounded
-pwsx3126 power 0.069 0.5 -> 0.263 Inexact Rounded
-pwsx3127 power 0.71 0.5 -> 0.843 Inexact Rounded
-pwsx3128 power 0.071 0.5 -> 0.266 Inexact Rounded
-pwsx3129 power 0.72 0.5 -> 0.849 Inexact Rounded
-pwsx3130 power 0.072 0.5 -> 0.268 Inexact Rounded
-pwsx3131 power 0.73 0.5 -> 0.854 Inexact Rounded
-pwsx3132 power 0.073 0.5 -> 0.270 Inexact Rounded
-pwsx3133 power 0.74 0.5 -> 0.860 Inexact Rounded
-pwsx3134 power 0.074 0.5 -> 0.272 Inexact Rounded
-pwsx3135 power 0.75 0.5 -> 0.866 Inexact Rounded
-pwsx3136 power 0.075 0.5 -> 0.274 Inexact Rounded
-pwsx3137 power 0.76 0.5 -> 0.872 Inexact Rounded
-pwsx3138 power 0.076 0.5 -> 0.276 Inexact Rounded
-pwsx3139 power 0.77 0.5 -> 0.877 Inexact Rounded
-pwsx3140 power 0.077 0.5 -> 0.277 Inexact Rounded
-pwsx3141 power 0.78 0.5 -> 0.883 Inexact Rounded
-pwsx3142 power 0.078 0.5 -> 0.279 Inexact Rounded
-pwsx3143 power 0.79 0.5 -> 0.889 Inexact Rounded
-pwsx3144 power 0.079 0.5 -> 0.281 Inexact Rounded
-pwsx3145 power 0.81 0.5 -> 0.900 Inexact Rounded
-pwsx3146 power 0.081 0.5 -> 0.285 Inexact Rounded
-pwsx3147 power 0.82 0.5 -> 0.906 Inexact Rounded
-pwsx3148 power 0.082 0.5 -> 0.286 Inexact Rounded
-pwsx3149 power 0.83 0.5 -> 0.911 Inexact Rounded
-pwsx3150 power 0.083 0.5 -> 0.288 Inexact Rounded
-pwsx3151 power 0.84 0.5 -> 0.917 Inexact Rounded
-pwsx3152 power 0.084 0.5 -> 0.290 Inexact Rounded
-pwsx3153 power 0.85 0.5 -> 0.922 Inexact Rounded
-pwsx3154 power 0.085 0.5 -> 0.292 Inexact Rounded
-pwsx3155 power 0.86 0.5 -> 0.927 Inexact Rounded
-pwsx3156 power 0.086 0.5 -> 0.293 Inexact Rounded
-pwsx3157 power 0.87 0.5 -> 0.933 Inexact Rounded
-pwsx3158 power 0.087 0.5 -> 0.295 Inexact Rounded
-pwsx3159 power 0.88 0.5 -> 0.938 Inexact Rounded
-pwsx3160 power 0.088 0.5 -> 0.297 Inexact Rounded
-pwsx3161 power 0.89 0.5 -> 0.943 Inexact Rounded
-pwsx3162 power 0.089 0.5 -> 0.298 Inexact Rounded
-pwsx3163 power 0.91 0.5 -> 0.954 Inexact Rounded
-pwsx3164 power 0.091 0.5 -> 0.302 Inexact Rounded
-pwsx3165 power 0.92 0.5 -> 0.959 Inexact Rounded
-pwsx3166 power 0.092 0.5 -> 0.303 Inexact Rounded
-pwsx3167 power 0.93 0.5 -> 0.964 Inexact Rounded
-pwsx3168 power 0.093 0.5 -> 0.305 Inexact Rounded
-pwsx3169 power 0.94 0.5 -> 0.970 Inexact Rounded
-pwsx3170 power 0.094 0.5 -> 0.307 Inexact Rounded
-pwsx3171 power 0.95 0.5 -> 0.975 Inexact Rounded
-pwsx3172 power 0.095 0.5 -> 0.308 Inexact Rounded
-pwsx3173 power 0.96 0.5 -> 0.980 Inexact Rounded
-pwsx3174 power 0.096 0.5 -> 0.310 Inexact Rounded
-pwsx3175 power 0.97 0.5 -> 0.985 Inexact Rounded
-pwsx3176 power 0.097 0.5 -> 0.311 Inexact Rounded
-pwsx3177 power 0.98 0.5 -> 0.990 Inexact Rounded
-pwsx3178 power 0.098 0.5 -> 0.313 Inexact Rounded
-pwsx3179 power 0.99 0.5 -> 0.995 Inexact Rounded
-pwsx3180 power 0.099 0.5 -> 0.315 Inexact Rounded
-pwsx3181 power 0.101 0.5 -> 0.318 Inexact Rounded
-pwsx3182 power 0.0101 0.5 -> 0.100 Inexact Rounded
-pwsx3183 power 0.102 0.5 -> 0.319 Inexact Rounded
-pwsx3184 power 0.0102 0.5 -> 0.101 Inexact Rounded
-pwsx3185 power 0.103 0.5 -> 0.321 Inexact Rounded
-pwsx3186 power 0.0103 0.5 -> 0.101 Inexact Rounded
-pwsx3187 power 0.104 0.5 -> 0.322 Inexact Rounded
-pwsx3188 power 0.0104 0.5 -> 0.102 Inexact Rounded
-pwsx3189 power 0.105 0.5 -> 0.324 Inexact Rounded
-pwsx3190 power 0.0105 0.5 -> 0.102 Inexact Rounded
-pwsx3191 power 0.106 0.5 -> 0.326 Inexact Rounded
-pwsx3192 power 0.0106 0.5 -> 0.103 Inexact Rounded
-pwsx3193 power 0.107 0.5 -> 0.327 Inexact Rounded
-pwsx3194 power 0.0107 0.5 -> 0.103 Inexact Rounded
-pwsx3195 power 0.108 0.5 -> 0.329 Inexact Rounded
-pwsx3196 power 0.0108 0.5 -> 0.104 Inexact Rounded
-pwsx3197 power 0.109 0.5 -> 0.330 Inexact Rounded
-pwsx3198 power 0.0109 0.5 -> 0.104 Inexact Rounded
-pwsx3199 power 0.111 0.5 -> 0.333 Inexact Rounded
-pwsx3200 power 0.0111 0.5 -> 0.105 Inexact Rounded
-pwsx3201 power 0.112 0.5 -> 0.335 Inexact Rounded
-pwsx3202 power 0.0112 0.5 -> 0.106 Inexact Rounded
-pwsx3203 power 0.113 0.5 -> 0.336 Inexact Rounded
-pwsx3204 power 0.0113 0.5 -> 0.106 Inexact Rounded
-pwsx3205 power 0.114 0.5 -> 0.338 Inexact Rounded
-pwsx3206 power 0.0114 0.5 -> 0.107 Inexact Rounded
-pwsx3207 power 0.115 0.5 -> 0.339 Inexact Rounded
-pwsx3208 power 0.0115 0.5 -> 0.107 Inexact Rounded
-pwsx3209 power 0.116 0.5 -> 0.341 Inexact Rounded
-pwsx3210 power 0.0116 0.5 -> 0.108 Inexact Rounded
-pwsx3211 power 0.117 0.5 -> 0.342 Inexact Rounded
-pwsx3212 power 0.0117 0.5 -> 0.108 Inexact Rounded
-pwsx3213 power 0.118 0.5 -> 0.344 Inexact Rounded
-pwsx3214 power 0.0118 0.5 -> 0.109 Inexact Rounded
-pwsx3215 power 0.119 0.5 -> 0.345 Inexact Rounded
-pwsx3216 power 0.0119 0.5 -> 0.109 Inexact Rounded
-pwsx3217 power 0.121 0.5 -> 0.348 Inexact Rounded
-pwsx3218 power 0.0121 0.5 -> 0.110 Inexact Rounded
-pwsx3219 power 0.122 0.5 -> 0.349 Inexact Rounded
-pwsx3220 power 0.0122 0.5 -> 0.110 Inexact Rounded
-pwsx3221 power 0.123 0.5 -> 0.351 Inexact Rounded
-pwsx3222 power 0.0123 0.5 -> 0.111 Inexact Rounded
-pwsx3223 power 0.124 0.5 -> 0.352 Inexact Rounded
-pwsx3224 power 0.0124 0.5 -> 0.111 Inexact Rounded
-pwsx3225 power 0.125 0.5 -> 0.354 Inexact Rounded
-pwsx3226 power 0.0125 0.5 -> 0.112 Inexact Rounded
-pwsx3227 power 0.126 0.5 -> 0.355 Inexact Rounded
-pwsx3228 power 0.0126 0.5 -> 0.112 Inexact Rounded
-pwsx3229 power 0.127 0.5 -> 0.356 Inexact Rounded
-pwsx3230 power 0.0127 0.5 -> 0.113 Inexact Rounded
-pwsx3231 power 0.128 0.5 -> 0.358 Inexact Rounded
-pwsx3232 power 0.0128 0.5 -> 0.113 Inexact Rounded
-pwsx3233 power 0.129 0.5 -> 0.359 Inexact Rounded
-pwsx3234 power 0.0129 0.5 -> 0.114 Inexact Rounded
-pwsx3235 power 0.131 0.5 -> 0.362 Inexact Rounded
-pwsx3236 power 0.0131 0.5 -> 0.114 Inexact Rounded
-pwsx3237 power 0.132 0.5 -> 0.363 Inexact Rounded
-pwsx3238 power 0.0132 0.5 -> 0.115 Inexact Rounded
-pwsx3239 power 0.133 0.5 -> 0.365 Inexact Rounded
-pwsx3240 power 0.0133 0.5 -> 0.115 Inexact Rounded
-pwsx3241 power 0.134 0.5 -> 0.366 Inexact Rounded
-pwsx3242 power 0.0134 0.5 -> 0.116 Inexact Rounded
-pwsx3243 power 0.135 0.5 -> 0.367 Inexact Rounded
-pwsx3244 power 0.0135 0.5 -> 0.116 Inexact Rounded
-pwsx3245 power 0.136 0.5 -> 0.369 Inexact Rounded
-pwsx3246 power 0.0136 0.5 -> 0.117 Inexact Rounded
-pwsx3247 power 0.137 0.5 -> 0.370 Inexact Rounded
-pwsx3248 power 0.0137 0.5 -> 0.117 Inexact Rounded
-pwsx3249 power 0.138 0.5 -> 0.371 Inexact Rounded
-pwsx3250 power 0.0138 0.5 -> 0.117 Inexact Rounded
-pwsx3251 power 0.139 0.5 -> 0.373 Inexact Rounded
-pwsx3252 power 0.0139 0.5 -> 0.118 Inexact Rounded
-pwsx3253 power 0.141 0.5 -> 0.375 Inexact Rounded
-pwsx3254 power 0.0141 0.5 -> 0.119 Inexact Rounded
-pwsx3255 power 0.142 0.5 -> 0.377 Inexact Rounded
-pwsx3256 power 0.0142 0.5 -> 0.119 Inexact Rounded
-pwsx3257 power 0.143 0.5 -> 0.378 Inexact Rounded
-pwsx3258 power 0.0143 0.5 -> 0.120 Inexact Rounded
-pwsx3259 power 0.144 0.5 -> 0.379 Inexact Rounded
-pwsx3260 power 0.0144 0.5 -> 0.120 Inexact Rounded
-pwsx3261 power 0.145 0.5 -> 0.381 Inexact Rounded
-pwsx3262 power 0.0145 0.5 -> 0.120 Inexact Rounded
-pwsx3263 power 0.146 0.5 -> 0.382 Inexact Rounded
-pwsx3264 power 0.0146 0.5 -> 0.121 Inexact Rounded
-pwsx3265 power 0.147 0.5 -> 0.383 Inexact Rounded
-pwsx3266 power 0.0147 0.5 -> 0.121 Inexact Rounded
-pwsx3267 power 0.148 0.5 -> 0.385 Inexact Rounded
-pwsx3268 power 0.0148 0.5 -> 0.122 Inexact Rounded
-pwsx3269 power 0.149 0.5 -> 0.386 Inexact Rounded
-pwsx3270 power 0.0149 0.5 -> 0.122 Inexact Rounded
-pwsx3271 power 0.151 0.5 -> 0.389 Inexact Rounded
-pwsx3272 power 0.0151 0.5 -> 0.123 Inexact Rounded
-pwsx3273 power 0.152 0.5 -> 0.390 Inexact Rounded
-pwsx3274 power 0.0152 0.5 -> 0.123 Inexact Rounded
-pwsx3275 power 0.153 0.5 -> 0.391 Inexact Rounded
-pwsx3276 power 0.0153 0.5 -> 0.124 Inexact Rounded
-pwsx3277 power 0.154 0.5 -> 0.392 Inexact Rounded
-pwsx3278 power 0.0154 0.5 -> 0.124 Inexact Rounded
-pwsx3279 power 0.155 0.5 -> 0.394 Inexact Rounded
-pwsx3280 power 0.0155 0.5 -> 0.124 Inexact Rounded
-pwsx3281 power 0.156 0.5 -> 0.395 Inexact Rounded
-pwsx3282 power 0.0156 0.5 -> 0.125 Inexact Rounded
-pwsx3283 power 0.157 0.5 -> 0.396 Inexact Rounded
-pwsx3284 power 0.0157 0.5 -> 0.125 Inexact Rounded
-pwsx3285 power 0.158 0.5 -> 0.397 Inexact Rounded
-pwsx3286 power 0.0158 0.5 -> 0.126 Inexact Rounded
-pwsx3287 power 0.159 0.5 -> 0.399 Inexact Rounded
-pwsx3288 power 0.0159 0.5 -> 0.126 Inexact Rounded
-pwsx3289 power 0.161 0.5 -> 0.401 Inexact Rounded
-pwsx3290 power 0.0161 0.5 -> 0.127 Inexact Rounded
-pwsx3291 power 0.162 0.5 -> 0.402 Inexact Rounded
-pwsx3292 power 0.0162 0.5 -> 0.127 Inexact Rounded
-pwsx3293 power 0.163 0.5 -> 0.404 Inexact Rounded
-pwsx3294 power 0.0163 0.5 -> 0.128 Inexact Rounded
-pwsx3295 power 0.164 0.5 -> 0.405 Inexact Rounded
-pwsx3296 power 0.0164 0.5 -> 0.128 Inexact Rounded
-pwsx3297 power 0.165 0.5 -> 0.406 Inexact Rounded
-pwsx3298 power 0.0165 0.5 -> 0.128 Inexact Rounded
-pwsx3299 power 0.166 0.5 -> 0.407 Inexact Rounded
-pwsx3300 power 0.0166 0.5 -> 0.129 Inexact Rounded
-pwsx3301 power 0.167 0.5 -> 0.409 Inexact Rounded
-pwsx3302 power 0.0167 0.5 -> 0.129 Inexact Rounded
-pwsx3303 power 0.168 0.5 -> 0.410 Inexact Rounded
-pwsx3304 power 0.0168 0.5 -> 0.130 Inexact Rounded
-pwsx3305 power 0.169 0.5 -> 0.411 Inexact Rounded
-pwsx3306 power 0.0169 0.5 -> 0.130 Inexact Rounded
-pwsx3307 power 0.171 0.5 -> 0.414 Inexact Rounded
-pwsx3308 power 0.0171 0.5 -> 0.131 Inexact Rounded
-pwsx3309 power 0.172 0.5 -> 0.415 Inexact Rounded
-pwsx3310 power 0.0172 0.5 -> 0.131 Inexact Rounded
-pwsx3311 power 0.173 0.5 -> 0.416 Inexact Rounded
-pwsx3312 power 0.0173 0.5 -> 0.132 Inexact Rounded
-pwsx3313 power 0.174 0.5 -> 0.417 Inexact Rounded
-pwsx3314 power 0.0174 0.5 -> 0.132 Inexact Rounded
-pwsx3315 power 0.175 0.5 -> 0.418 Inexact Rounded
-pwsx3316 power 0.0175 0.5 -> 0.132 Inexact Rounded
-pwsx3317 power 0.176 0.5 -> 0.420 Inexact Rounded
-pwsx3318 power 0.0176 0.5 -> 0.133 Inexact Rounded
-pwsx3319 power 0.177 0.5 -> 0.421 Inexact Rounded
-pwsx3320 power 0.0177 0.5 -> 0.133 Inexact Rounded
-pwsx3321 power 0.178 0.5 -> 0.422 Inexact Rounded
-pwsx3322 power 0.0178 0.5 -> 0.133 Inexact Rounded
-pwsx3323 power 0.179 0.5 -> 0.423 Inexact Rounded
-pwsx3324 power 0.0179 0.5 -> 0.134 Inexact Rounded
-pwsx3325 power 0.181 0.5 -> 0.425 Inexact Rounded
-pwsx3326 power 0.0181 0.5 -> 0.135 Inexact Rounded
-pwsx3327 power 0.182 0.5 -> 0.427 Inexact Rounded
-pwsx3328 power 0.0182 0.5 -> 0.135 Inexact Rounded
-pwsx3329 power 0.183 0.5 -> 0.428 Inexact Rounded
-pwsx3330 power 0.0183 0.5 -> 0.135 Inexact Rounded
-pwsx3331 power 0.184 0.5 -> 0.429 Inexact Rounded
-pwsx3332 power 0.0184 0.5 -> 0.136 Inexact Rounded
-pwsx3333 power 0.185 0.5 -> 0.430 Inexact Rounded
-pwsx3334 power 0.0185 0.5 -> 0.136 Inexact Rounded
-pwsx3335 power 0.186 0.5 -> 0.431 Inexact Rounded
-pwsx3336 power 0.0186 0.5 -> 0.136 Inexact Rounded
-pwsx3337 power 0.187 0.5 -> 0.432 Inexact Rounded
-pwsx3338 power 0.0187 0.5 -> 0.137 Inexact Rounded
-pwsx3339 power 0.188 0.5 -> 0.434 Inexact Rounded
-pwsx3340 power 0.0188 0.5 -> 0.137 Inexact Rounded
-pwsx3341 power 0.189 0.5 -> 0.435 Inexact Rounded
-pwsx3342 power 0.0189 0.5 -> 0.137 Inexact Rounded
-pwsx3343 power 0.191 0.5 -> 0.437 Inexact Rounded
-pwsx3344 power 0.0191 0.5 -> 0.138 Inexact Rounded
-pwsx3345 power 0.192 0.5 -> 0.438 Inexact Rounded
-pwsx3346 power 0.0192 0.5 -> 0.139 Inexact Rounded
-pwsx3347 power 0.193 0.5 -> 0.439 Inexact Rounded
-pwsx3348 power 0.0193 0.5 -> 0.139 Inexact Rounded
-pwsx3349 power 0.194 0.5 -> 0.440 Inexact Rounded
-pwsx3350 power 0.0194 0.5 -> 0.139 Inexact Rounded
-pwsx3351 power 0.195 0.5 -> 0.442 Inexact Rounded
-pwsx3352 power 0.0195 0.5 -> 0.140 Inexact Rounded
-pwsx3353 power 0.196 0.5 -> 0.443 Inexact Rounded
-pwsx3354 power 0.0196 0.5 -> 0.140 Inexact Rounded
-pwsx3355 power 0.197 0.5 -> 0.444 Inexact Rounded
-pwsx3356 power 0.0197 0.5 -> 0.140 Inexact Rounded
-pwsx3357 power 0.198 0.5 -> 0.445 Inexact Rounded
-pwsx3358 power 0.0198 0.5 -> 0.141 Inexact Rounded
-pwsx3359 power 0.199 0.5 -> 0.446 Inexact Rounded
-pwsx3360 power 0.0199 0.5 -> 0.141 Inexact Rounded
-pwsx3361 power 0.201 0.5 -> 0.448 Inexact Rounded
-pwsx3362 power 0.0201 0.5 -> 0.142 Inexact Rounded
-pwsx3363 power 0.202 0.5 -> 0.449 Inexact Rounded
-pwsx3364 power 0.0202 0.5 -> 0.142 Inexact Rounded
-pwsx3365 power 0.203 0.5 -> 0.451 Inexact Rounded
-pwsx3366 power 0.0203 0.5 -> 0.142 Inexact Rounded
-pwsx3367 power 0.204 0.5 -> 0.452 Inexact Rounded
-pwsx3368 power 0.0204 0.5 -> 0.143 Inexact Rounded
-pwsx3369 power 0.205 0.5 -> 0.453 Inexact Rounded
-pwsx3370 power 0.0205 0.5 -> 0.143 Inexact Rounded
-pwsx3371 power 0.206 0.5 -> 0.454 Inexact Rounded
-pwsx3372 power 0.0206 0.5 -> 0.144 Inexact Rounded
-pwsx3373 power 0.207 0.5 -> 0.455 Inexact Rounded
-pwsx3374 power 0.0207 0.5 -> 0.144 Inexact Rounded
-pwsx3375 power 0.208 0.5 -> 0.456 Inexact Rounded
-pwsx3376 power 0.0208 0.5 -> 0.144 Inexact Rounded
-pwsx3377 power 0.209 0.5 -> 0.457 Inexact Rounded
-pwsx3378 power 0.0209 0.5 -> 0.145 Inexact Rounded
-pwsx3379 power 0.211 0.5 -> 0.459 Inexact Rounded
-pwsx3380 power 0.0211 0.5 -> 0.145 Inexact Rounded
-pwsx3381 power 0.212 0.5 -> 0.460 Inexact Rounded
-pwsx3382 power 0.0212 0.5 -> 0.146 Inexact Rounded
-pwsx3383 power 0.213 0.5 -> 0.462 Inexact Rounded
-pwsx3384 power 0.0213 0.5 -> 0.146 Inexact Rounded
-pwsx3385 power 0.214 0.5 -> 0.463 Inexact Rounded
-pwsx3386 power 0.0214 0.5 -> 0.146 Inexact Rounded
-pwsx3387 power 0.215 0.5 -> 0.464 Inexact Rounded
-pwsx3388 power 0.0215 0.5 -> 0.147 Inexact Rounded
-pwsx3389 power 0.216 0.5 -> 0.465 Inexact Rounded
-pwsx3390 power 0.0216 0.5 -> 0.147 Inexact Rounded
-pwsx3391 power 0.217 0.5 -> 0.466 Inexact Rounded
-pwsx3392 power 0.0217 0.5 -> 0.147 Inexact Rounded
-pwsx3393 power 0.218 0.5 -> 0.467 Inexact Rounded
-pwsx3394 power 0.0218 0.5 -> 0.148 Inexact Rounded
-pwsx3395 power 0.219 0.5 -> 0.468 Inexact Rounded
-pwsx3396 power 0.0219 0.5 -> 0.148 Inexact Rounded
-pwsx3397 power 0.221 0.5 -> 0.470 Inexact Rounded
-pwsx3398 power 0.0221 0.5 -> 0.149 Inexact Rounded
-pwsx3399 power 0.222 0.5 -> 0.471 Inexact Rounded
-pwsx3400 power 0.0222 0.5 -> 0.149 Inexact Rounded
-pwsx3401 power 0.223 0.5 -> 0.472 Inexact Rounded
-pwsx3402 power 0.0223 0.5 -> 0.149 Inexact Rounded
-pwsx3403 power 0.224 0.5 -> 0.473 Inexact Rounded
-pwsx3404 power 0.0224 0.5 -> 0.150 Inexact Rounded
-pwsx3405 power 0.225 0.5 -> 0.474 Inexact Rounded
-pwsx3406 power 0.0225 0.5 -> 0.150 Inexact Rounded
-pwsx3407 power 0.226 0.5 -> 0.475 Inexact Rounded
-pwsx3408 power 0.0226 0.5 -> 0.150 Inexact Rounded
-pwsx3409 power 0.227 0.5 -> 0.476 Inexact Rounded
-pwsx3410 power 0.0227 0.5 -> 0.151 Inexact Rounded
-pwsx3411 power 0.228 0.5 -> 0.477 Inexact Rounded
-pwsx3412 power 0.0228 0.5 -> 0.151 Inexact Rounded
-pwsx3413 power 0.229 0.5 -> 0.479 Inexact Rounded
-pwsx3414 power 0.0229 0.5 -> 0.151 Inexact Rounded
-pwsx3415 power 0.231 0.5 -> 0.481 Inexact Rounded
-pwsx3416 power 0.0231 0.5 -> 0.152 Inexact Rounded
-pwsx3417 power 0.232 0.5 -> 0.482 Inexact Rounded
-pwsx3418 power 0.0232 0.5 -> 0.152 Inexact Rounded
-pwsx3419 power 0.233 0.5 -> 0.483 Inexact Rounded
-pwsx3420 power 0.0233 0.5 -> 0.153 Inexact Rounded
-pwsx3421 power 0.234 0.5 -> 0.484 Inexact Rounded
-pwsx3422 power 0.0234 0.5 -> 0.153 Inexact Rounded
-pwsx3423 power 0.235 0.5 -> 0.485 Inexact Rounded
-pwsx3424 power 0.0235 0.5 -> 0.153 Inexact Rounded
-pwsx3425 power 0.236 0.5 -> 0.486 Inexact Rounded
-pwsx3426 power 0.0236 0.5 -> 0.154 Inexact Rounded
-pwsx3427 power 0.237 0.5 -> 0.487 Inexact Rounded
-pwsx3428 power 0.0237 0.5 -> 0.154 Inexact Rounded
-pwsx3429 power 0.238 0.5 -> 0.488 Inexact Rounded
-pwsx3430 power 0.0238 0.5 -> 0.154 Inexact Rounded
-pwsx3431 power 0.239 0.5 -> 0.489 Inexact Rounded
-pwsx3432 power 0.0239 0.5 -> 0.155 Inexact Rounded
-pwsx3433 power 0.241 0.5 -> 0.491 Inexact Rounded
-pwsx3434 power 0.0241 0.5 -> 0.155 Inexact Rounded
-pwsx3435 power 0.242 0.5 -> 0.492 Inexact Rounded
-pwsx3436 power 0.0242 0.5 -> 0.156 Inexact Rounded
-pwsx3437 power 0.243 0.5 -> 0.493 Inexact Rounded
-pwsx3438 power 0.0243 0.5 -> 0.156 Inexact Rounded
-pwsx3439 power 0.244 0.5 -> 0.494 Inexact Rounded
-pwsx3440 power 0.0244 0.5 -> 0.156 Inexact Rounded
-pwsx3441 power 0.245 0.5 -> 0.495 Inexact Rounded
-pwsx3442 power 0.0245 0.5 -> 0.157 Inexact Rounded
-pwsx3443 power 0.246 0.5 -> 0.496 Inexact Rounded
-pwsx3444 power 0.0246 0.5 -> 0.157 Inexact Rounded
-pwsx3445 power 0.247 0.5 -> 0.497 Inexact Rounded
-pwsx3446 power 0.0247 0.5 -> 0.157 Inexact Rounded
-pwsx3447 power 0.248 0.5 -> 0.498 Inexact Rounded
-pwsx3448 power 0.0248 0.5 -> 0.157 Inexact Rounded
-pwsx3449 power 0.249 0.5 -> 0.499 Inexact Rounded
-pwsx3450 power 0.0249 0.5 -> 0.158 Inexact Rounded
-pwsx3451 power 0.251 0.5 -> 0.501 Inexact Rounded
-pwsx3452 power 0.0251 0.5 -> 0.158 Inexact Rounded
-pwsx3453 power 0.252 0.5 -> 0.502 Inexact Rounded
-pwsx3454 power 0.0252 0.5 -> 0.159 Inexact Rounded
-pwsx3455 power 0.253 0.5 -> 0.503 Inexact Rounded
-pwsx3456 power 0.0253 0.5 -> 0.159 Inexact Rounded
-pwsx3457 power 0.254 0.5 -> 0.504 Inexact Rounded
-pwsx3458 power 0.0254 0.5 -> 0.159 Inexact Rounded
-pwsx3459 power 0.255 0.5 -> 0.505 Inexact Rounded
-pwsx3460 power 0.0255 0.5 -> 0.160 Inexact Rounded
-pwsx3461 power 0.256 0.5 -> 0.506 Inexact Rounded
-pwsx3462 power 0.0256 0.5 -> 0.160 Inexact Rounded
-pwsx3463 power 0.257 0.5 -> 0.507 Inexact Rounded
-pwsx3464 power 0.0257 0.5 -> 0.160 Inexact Rounded
-pwsx3465 power 0.258 0.5 -> 0.508 Inexact Rounded
-pwsx3466 power 0.0258 0.5 -> 0.161 Inexact Rounded
-pwsx3467 power 0.259 0.5 -> 0.509 Inexact Rounded
-pwsx3468 power 0.0259 0.5 -> 0.161 Inexact Rounded
-pwsx3469 power 0.261 0.5 -> 0.511 Inexact Rounded
-pwsx3470 power 0.0261 0.5 -> 0.162 Inexact Rounded
-pwsx3471 power 0.262 0.5 -> 0.512 Inexact Rounded
-pwsx3472 power 0.0262 0.5 -> 0.162 Inexact Rounded
-pwsx3473 power 0.263 0.5 -> 0.513 Inexact Rounded
-pwsx3474 power 0.0263 0.5 -> 0.162 Inexact Rounded
-pwsx3475 power 0.264 0.5 -> 0.514 Inexact Rounded
-pwsx3476 power 0.0264 0.5 -> 0.162 Inexact Rounded
-pwsx3477 power 0.265 0.5 -> 0.515 Inexact Rounded
-pwsx3478 power 0.0265 0.5 -> 0.163 Inexact Rounded
-pwsx3479 power 0.266 0.5 -> 0.516 Inexact Rounded
-pwsx3480 power 0.0266 0.5 -> 0.163 Inexact Rounded
-pwsx3481 power 0.267 0.5 -> 0.517 Inexact Rounded
-pwsx3482 power 0.0267 0.5 -> 0.163 Inexact Rounded
-pwsx3483 power 0.268 0.5 -> 0.518 Inexact Rounded
-pwsx3484 power 0.0268 0.5 -> 0.164 Inexact Rounded
-pwsx3485 power 0.269 0.5 -> 0.519 Inexact Rounded
-pwsx3486 power 0.0269 0.5 -> 0.164 Inexact Rounded
-pwsx3487 power 0.271 0.5 -> 0.521 Inexact Rounded
-pwsx3488 power 0.0271 0.5 -> 0.165 Inexact Rounded
-pwsx3489 power 0.272 0.5 -> 0.522 Inexact Rounded
-pwsx3490 power 0.0272 0.5 -> 0.165 Inexact Rounded
-pwsx3491 power 0.273 0.5 -> 0.522 Inexact Rounded
-pwsx3492 power 0.0273 0.5 -> 0.165 Inexact Rounded
-pwsx3493 power 0.274 0.5 -> 0.523 Inexact Rounded
-pwsx3494 power 0.0274 0.5 -> 0.166 Inexact Rounded
-pwsx3495 power 0.275 0.5 -> 0.524 Inexact Rounded
-pwsx3496 power 0.0275 0.5 -> 0.166 Inexact Rounded
-pwsx3497 power 0.276 0.5 -> 0.525 Inexact Rounded
-pwsx3498 power 0.0276 0.5 -> 0.166 Inexact Rounded
-pwsx3499 power 0.277 0.5 -> 0.526 Inexact Rounded
-pwsx3500 power 0.0277 0.5 -> 0.166 Inexact Rounded
-pwsx3501 power 0.278 0.5 -> 0.527 Inexact Rounded
-pwsx3502 power 0.0278 0.5 -> 0.167 Inexact Rounded
-pwsx3503 power 0.279 0.5 -> 0.528 Inexact Rounded
-pwsx3504 power 0.0279 0.5 -> 0.167 Inexact Rounded
-pwsx3505 power 0.281 0.5 -> 0.530 Inexact Rounded
-pwsx3506 power 0.0281 0.5 -> 0.168 Inexact Rounded
-pwsx3507 power 0.282 0.5 -> 0.531 Inexact Rounded
-pwsx3508 power 0.0282 0.5 -> 0.168 Inexact Rounded
-pwsx3509 power 0.283 0.5 -> 0.532 Inexact Rounded
-pwsx3510 power 0.0283 0.5 -> 0.168 Inexact Rounded
-pwsx3511 power 0.284 0.5 -> 0.533 Inexact Rounded
-pwsx3512 power 0.0284 0.5 -> 0.169 Inexact Rounded
-pwsx3513 power 0.285 0.5 -> 0.534 Inexact Rounded
-pwsx3514 power 0.0285 0.5 -> 0.169 Inexact Rounded
-pwsx3515 power 0.286 0.5 -> 0.535 Inexact Rounded
-pwsx3516 power 0.0286 0.5 -> 0.169 Inexact Rounded
-pwsx3517 power 0.287 0.5 -> 0.536 Inexact Rounded
-pwsx3518 power 0.0287 0.5 -> 0.169 Inexact Rounded
-pwsx3519 power 0.288 0.5 -> 0.537 Inexact Rounded
-pwsx3520 power 0.0288 0.5 -> 0.170 Inexact Rounded
-pwsx3521 power 0.289 0.5 -> 0.538 Inexact Rounded
-pwsx3522 power 0.0289 0.5 -> 0.170 Inexact Rounded
-pwsx3523 power 0.291 0.5 -> 0.539 Inexact Rounded
-pwsx3524 power 0.0291 0.5 -> 0.171 Inexact Rounded
-pwsx3525 power 0.292 0.5 -> 0.540 Inexact Rounded
-pwsx3526 power 0.0292 0.5 -> 0.171 Inexact Rounded
-pwsx3527 power 0.293 0.5 -> 0.541 Inexact Rounded
-pwsx3528 power 0.0293 0.5 -> 0.171 Inexact Rounded
-pwsx3529 power 0.294 0.5 -> 0.542 Inexact Rounded
-pwsx3530 power 0.0294 0.5 -> 0.171 Inexact Rounded
-pwsx3531 power 0.295 0.5 -> 0.543 Inexact Rounded
-pwsx3532 power 0.0295 0.5 -> 0.172 Inexact Rounded
-pwsx3533 power 0.296 0.5 -> 0.544 Inexact Rounded
-pwsx3534 power 0.0296 0.5 -> 0.172 Inexact Rounded
-pwsx3535 power 0.297 0.5 -> 0.545 Inexact Rounded
-pwsx3536 power 0.0297 0.5 -> 0.172 Inexact Rounded
-pwsx3537 power 0.298 0.5 -> 0.546 Inexact Rounded
-pwsx3538 power 0.0298 0.5 -> 0.173 Inexact Rounded
-pwsx3539 power 0.299 0.5 -> 0.547 Inexact Rounded
-pwsx3540 power 0.0299 0.5 -> 0.173 Inexact Rounded
-pwsx3541 power 0.301 0.5 -> 0.549 Inexact Rounded
-pwsx3542 power 0.0301 0.5 -> 0.173 Inexact Rounded
-pwsx3543 power 0.302 0.5 -> 0.550 Inexact Rounded
-pwsx3544 power 0.0302 0.5 -> 0.174 Inexact Rounded
-pwsx3545 power 0.303 0.5 -> 0.550 Inexact Rounded
-pwsx3546 power 0.0303 0.5 -> 0.174 Inexact Rounded
-pwsx3547 power 0.304 0.5 -> 0.551 Inexact Rounded
-pwsx3548 power 0.0304 0.5 -> 0.174 Inexact Rounded
-pwsx3549 power 0.305 0.5 -> 0.552 Inexact Rounded
-pwsx3550 power 0.0305 0.5 -> 0.175 Inexact Rounded
-pwsx3551 power 0.306 0.5 -> 0.553 Inexact Rounded
-pwsx3552 power 0.0306 0.5 -> 0.175 Inexact Rounded
-pwsx3553 power 0.307 0.5 -> 0.554 Inexact Rounded
-pwsx3554 power 0.0307 0.5 -> 0.175 Inexact Rounded
-pwsx3555 power 0.308 0.5 -> 0.555 Inexact Rounded
-pwsx3556 power 0.0308 0.5 -> 0.175 Inexact Rounded
-pwsx3557 power 0.309 0.5 -> 0.556 Inexact Rounded
-pwsx3558 power 0.0309 0.5 -> 0.176 Inexact Rounded
-pwsx3559 power 0.311 0.5 -> 0.558 Inexact Rounded
-pwsx3560 power 0.0311 0.5 -> 0.176 Inexact Rounded
-pwsx3561 power 0.312 0.5 -> 0.559 Inexact Rounded
-pwsx3562 power 0.0312 0.5 -> 0.177 Inexact Rounded
-pwsx3563 power 0.313 0.5 -> 0.559 Inexact Rounded
-pwsx3564 power 0.0313 0.5 -> 0.177 Inexact Rounded
-pwsx3565 power 0.314 0.5 -> 0.560 Inexact Rounded
-pwsx3566 power 0.0314 0.5 -> 0.177 Inexact Rounded
-pwsx3567 power 0.315 0.5 -> 0.561 Inexact Rounded
-pwsx3568 power 0.0315 0.5 -> 0.177 Inexact Rounded
-pwsx3569 power 0.316 0.5 -> 0.562 Inexact Rounded
-pwsx3570 power 0.0316 0.5 -> 0.178 Inexact Rounded
-pwsx3571 power 0.317 0.5 -> 0.563 Inexact Rounded
-pwsx3572 power 0.0317 0.5 -> 0.178 Inexact Rounded
-pwsx3573 power 0.318 0.5 -> 0.564 Inexact Rounded
-pwsx3574 power 0.0318 0.5 -> 0.178 Inexact Rounded
-pwsx3575 power 0.319 0.5 -> 0.565 Inexact Rounded
-pwsx3576 power 0.0319 0.5 -> 0.179 Inexact Rounded
-pwsx3577 power 0.321 0.5 -> 0.567 Inexact Rounded
-pwsx3578 power 0.0321 0.5 -> 0.179 Inexact Rounded
-pwsx3579 power 0.322 0.5 -> 0.567 Inexact Rounded
-pwsx3580 power 0.0322 0.5 -> 0.179 Inexact Rounded
-pwsx3581 power 0.323 0.5 -> 0.568 Inexact Rounded
-pwsx3582 power 0.0323 0.5 -> 0.180 Inexact Rounded
-pwsx3583 power 0.324 0.5 -> 0.569 Inexact Rounded
-pwsx3584 power 0.0324 0.5 -> 0.180 Inexact Rounded
-pwsx3585 power 0.325 0.5 -> 0.570 Inexact Rounded
-pwsx3586 power 0.0325 0.5 -> 0.180 Inexact Rounded
-pwsx3587 power 0.326 0.5 -> 0.571 Inexact Rounded
-pwsx3588 power 0.0326 0.5 -> 0.181 Inexact Rounded
-pwsx3589 power 0.327 0.5 -> 0.572 Inexact Rounded
-pwsx3590 power 0.0327 0.5 -> 0.181 Inexact Rounded
-pwsx3591 power 0.328 0.5 -> 0.573 Inexact Rounded
-pwsx3592 power 0.0328 0.5 -> 0.181 Inexact Rounded
-pwsx3593 power 0.329 0.5 -> 0.574 Inexact Rounded
-pwsx3594 power 0.0329 0.5 -> 0.181 Inexact Rounded
-pwsx3595 power 0.331 0.5 -> 0.575 Inexact Rounded
-pwsx3596 power 0.0331 0.5 -> 0.182 Inexact Rounded
-pwsx3597 power 0.332 0.5 -> 0.576 Inexact Rounded
-pwsx3598 power 0.0332 0.5 -> 0.182 Inexact Rounded
-pwsx3599 power 0.333 0.5 -> 0.577 Inexact Rounded
-pwsx3600 power 0.0333 0.5 -> 0.182 Inexact Rounded
-pwsx3601 power 0.334 0.5 -> 0.578 Inexact Rounded
-pwsx3602 power 0.0334 0.5 -> 0.183 Inexact Rounded
-pwsx3603 power 0.335 0.5 -> 0.579 Inexact Rounded
-pwsx3604 power 0.0335 0.5 -> 0.183 Inexact Rounded
-pwsx3605 power 0.336 0.5 -> 0.580 Inexact Rounded
-pwsx3606 power 0.0336 0.5 -> 0.183 Inexact Rounded
-pwsx3607 power 0.337 0.5 -> 0.581 Inexact Rounded
-pwsx3608 power 0.0337 0.5 -> 0.184 Inexact Rounded
-pwsx3609 power 0.338 0.5 -> 0.581 Inexact Rounded
-pwsx3610 power 0.0338 0.5 -> 0.184 Inexact Rounded
-pwsx3611 power 0.339 0.5 -> 0.582 Inexact Rounded
-pwsx3612 power 0.0339 0.5 -> 0.184 Inexact Rounded
-pwsx3613 power 0.341 0.5 -> 0.584 Inexact Rounded
-pwsx3614 power 0.0341 0.5 -> 0.185 Inexact Rounded
-pwsx3615 power 0.342 0.5 -> 0.585 Inexact Rounded
-pwsx3616 power 0.0342 0.5 -> 0.185 Inexact Rounded
-pwsx3617 power 0.343 0.5 -> 0.586 Inexact Rounded
-pwsx3618 power 0.0343 0.5 -> 0.185 Inexact Rounded
-pwsx3619 power 0.344 0.5 -> 0.587 Inexact Rounded
-pwsx3620 power 0.0344 0.5 -> 0.185 Inexact Rounded
-pwsx3621 power 0.345 0.5 -> 0.587 Inexact Rounded
-pwsx3622 power 0.0345 0.5 -> 0.186 Inexact Rounded
-pwsx3623 power 0.346 0.5 -> 0.588 Inexact Rounded
-pwsx3624 power 0.0346 0.5 -> 0.186 Inexact Rounded
-pwsx3625 power 0.347 0.5 -> 0.589 Inexact Rounded
-pwsx3626 power 0.0347 0.5 -> 0.186 Inexact Rounded
-pwsx3627 power 0.348 0.5 -> 0.590 Inexact Rounded
-pwsx3628 power 0.0348 0.5 -> 0.187 Inexact Rounded
-pwsx3629 power 0.349 0.5 -> 0.591 Inexact Rounded
-pwsx3630 power 0.0349 0.5 -> 0.187 Inexact Rounded
-pwsx3631 power 0.351 0.5 -> 0.592 Inexact Rounded
-pwsx3632 power 0.0351 0.5 -> 0.187 Inexact Rounded
-pwsx3633 power 0.352 0.5 -> 0.593 Inexact Rounded
-pwsx3634 power 0.0352 0.5 -> 0.188 Inexact Rounded
-pwsx3635 power 0.353 0.5 -> 0.594 Inexact Rounded
-pwsx3636 power 0.0353 0.5 -> 0.188 Inexact Rounded
-pwsx3637 power 0.354 0.5 -> 0.595 Inexact Rounded
-pwsx3638 power 0.0354 0.5 -> 0.188 Inexact Rounded
-pwsx3639 power 0.355 0.5 -> 0.596 Inexact Rounded
-pwsx3640 power 0.0355 0.5 -> 0.188 Inexact Rounded
-pwsx3641 power 0.356 0.5 -> 0.597 Inexact Rounded
-pwsx3642 power 0.0356 0.5 -> 0.189 Inexact Rounded
-pwsx3643 power 0.357 0.5 -> 0.597 Inexact Rounded
-pwsx3644 power 0.0357 0.5 -> 0.189 Inexact Rounded
-pwsx3645 power 0.358 0.5 -> 0.598 Inexact Rounded
-pwsx3646 power 0.0358 0.5 -> 0.189 Inexact Rounded
-pwsx3647 power 0.359 0.5 -> 0.599 Inexact Rounded
-pwsx3648 power 0.0359 0.5 -> 0.189 Inexact Rounded
-pwsx3649 power 0.361 0.5 -> 0.601 Inexact Rounded
-pwsx3650 power 0.0361 0.5 -> 0.190 Inexact Rounded
-pwsx3651 power 0.362 0.5 -> 0.602 Inexact Rounded
-pwsx3652 power 0.0362 0.5 -> 0.190 Inexact Rounded
-pwsx3653 power 0.363 0.5 -> 0.602 Inexact Rounded
-pwsx3654 power 0.0363 0.5 -> 0.191 Inexact Rounded
-pwsx3655 power 0.364 0.5 -> 0.603 Inexact Rounded
-pwsx3656 power 0.0364 0.5 -> 0.191 Inexact Rounded
-pwsx3657 power 0.365 0.5 -> 0.604 Inexact Rounded
-pwsx3658 power 0.0365 0.5 -> 0.191 Inexact Rounded
-pwsx3659 power 0.366 0.5 -> 0.605 Inexact Rounded
-pwsx3660 power 0.0366 0.5 -> 0.191 Inexact Rounded
-pwsx3661 power 0.367 0.5 -> 0.606 Inexact Rounded
-pwsx3662 power 0.0367 0.5 -> 0.192 Inexact Rounded
-pwsx3663 power 0.368 0.5 -> 0.607 Inexact Rounded
-pwsx3664 power 0.0368 0.5 -> 0.192 Inexact Rounded
-pwsx3665 power 0.369 0.5 -> 0.607 Inexact Rounded
-pwsx3666 power 0.0369 0.5 -> 0.192 Inexact Rounded
-pwsx3667 power 0.371 0.5 -> 0.609 Inexact Rounded
-pwsx3668 power 0.0371 0.5 -> 0.193 Inexact Rounded
-pwsx3669 power 0.372 0.5 -> 0.610 Inexact Rounded
-pwsx3670 power 0.0372 0.5 -> 0.193 Inexact Rounded
-pwsx3671 power 0.373 0.5 -> 0.611 Inexact Rounded
-pwsx3672 power 0.0373 0.5 -> 0.193 Inexact Rounded
-pwsx3673 power 0.374 0.5 -> 0.612 Inexact Rounded
-pwsx3674 power 0.0374 0.5 -> 0.193 Inexact Rounded
-pwsx3675 power 0.375 0.5 -> 0.612 Inexact Rounded
-pwsx3676 power 0.0375 0.5 -> 0.194 Inexact Rounded
-pwsx3677 power 0.376 0.5 -> 0.613 Inexact Rounded
-pwsx3678 power 0.0376 0.5 -> 0.194 Inexact Rounded
-pwsx3679 power 0.377 0.5 -> 0.614 Inexact Rounded
-pwsx3680 power 0.0377 0.5 -> 0.194 Inexact Rounded
-pwsx3681 power 0.378 0.5 -> 0.615 Inexact Rounded
-pwsx3682 power 0.0378 0.5 -> 0.194 Inexact Rounded
-pwsx3683 power 0.379 0.5 -> 0.616 Inexact Rounded
-pwsx3684 power 0.0379 0.5 -> 0.195 Inexact Rounded
-pwsx3685 power 0.381 0.5 -> 0.617 Inexact Rounded
-pwsx3686 power 0.0381 0.5 -> 0.195 Inexact Rounded
-pwsx3687 power 0.382 0.5 -> 0.618 Inexact Rounded
-pwsx3688 power 0.0382 0.5 -> 0.195 Inexact Rounded
-pwsx3689 power 0.383 0.5 -> 0.619 Inexact Rounded
-pwsx3690 power 0.0383 0.5 -> 0.196 Inexact Rounded
-pwsx3691 power 0.384 0.5 -> 0.620 Inexact Rounded
-pwsx3692 power 0.0384 0.5 -> 0.196 Inexact Rounded
-pwsx3693 power 0.385 0.5 -> 0.620 Inexact Rounded
-pwsx3694 power 0.0385 0.5 -> 0.196 Inexact Rounded
-pwsx3695 power 0.386 0.5 -> 0.621 Inexact Rounded
-pwsx3696 power 0.0386 0.5 -> 0.196 Inexact Rounded
-pwsx3697 power 0.387 0.5 -> 0.622 Inexact Rounded
-pwsx3698 power 0.0387 0.5 -> 0.197 Inexact Rounded
-pwsx3699 power 0.388 0.5 -> 0.623 Inexact Rounded
-pwsx3700 power 0.0388 0.5 -> 0.197 Inexact Rounded
-pwsx3701 power 0.389 0.5 -> 0.624 Inexact Rounded
-pwsx3702 power 0.0389 0.5 -> 0.197 Inexact Rounded
-pwsx3703 power 0.391 0.5 -> 0.625 Inexact Rounded
-pwsx3704 power 0.0391 0.5 -> 0.198 Inexact Rounded
-pwsx3705 power 0.392 0.5 -> 0.626 Inexact Rounded
-pwsx3706 power 0.0392 0.5 -> 0.198 Inexact Rounded
-pwsx3707 power 0.393 0.5 -> 0.627 Inexact Rounded
-pwsx3708 power 0.0393 0.5 -> 0.198 Inexact Rounded
-pwsx3709 power 0.394 0.5 -> 0.628 Inexact Rounded
-pwsx3710 power 0.0394 0.5 -> 0.198 Inexact Rounded
-pwsx3711 power 0.395 0.5 -> 0.628 Inexact Rounded
-pwsx3712 power 0.0395 0.5 -> 0.199 Inexact Rounded
-pwsx3713 power 0.396 0.5 -> 0.629 Inexact Rounded
-pwsx3714 power 0.0396 0.5 -> 0.199 Inexact Rounded
-pwsx3715 power 0.397 0.5 -> 0.630 Inexact Rounded
-pwsx3716 power 0.0397 0.5 -> 0.199 Inexact Rounded
-pwsx3717 power 0.398 0.5 -> 0.631 Inexact Rounded
-pwsx3718 power 0.0398 0.5 -> 0.199 Inexact Rounded
-pwsx3719 power 0.399 0.5 -> 0.632 Inexact Rounded
-pwsx3720 power 0.0399 0.5 -> 0.200 Inexact Rounded
-pwsx3721 power 0.401 0.5 -> 0.633 Inexact Rounded
-pwsx3722 power 0.0401 0.5 -> 0.200 Inexact Rounded
-pwsx3723 power 0.402 0.5 -> 0.634 Inexact Rounded
-pwsx3724 power 0.0402 0.5 -> 0.200 Inexact Rounded
-pwsx3725 power 0.403 0.5 -> 0.635 Inexact Rounded
-pwsx3726 power 0.0403 0.5 -> 0.201 Inexact Rounded
-pwsx3727 power 0.404 0.5 -> 0.636 Inexact Rounded
-pwsx3728 power 0.0404 0.5 -> 0.201 Inexact Rounded
-pwsx3729 power 0.405 0.5 -> 0.636 Inexact Rounded
-pwsx3730 power 0.0405 0.5 -> 0.201 Inexact Rounded
-pwsx3731 power 0.406 0.5 -> 0.637 Inexact Rounded
-pwsx3732 power 0.0406 0.5 -> 0.201 Inexact Rounded
-pwsx3733 power 0.407 0.5 -> 0.638 Inexact Rounded
-pwsx3734 power 0.0407 0.5 -> 0.202 Inexact Rounded
-pwsx3735 power 0.408 0.5 -> 0.639 Inexact Rounded
-pwsx3736 power 0.0408 0.5 -> 0.202 Inexact Rounded
-pwsx3737 power 0.409 0.5 -> 0.640 Inexact Rounded
-pwsx3738 power 0.0409 0.5 -> 0.202 Inexact Rounded
-pwsx3739 power 0.411 0.5 -> 0.641 Inexact Rounded
-pwsx3740 power 0.0411 0.5 -> 0.203 Inexact Rounded
-pwsx3741 power 0.412 0.5 -> 0.642 Inexact Rounded
-pwsx3742 power 0.0412 0.5 -> 0.203 Inexact Rounded
-pwsx3743 power 0.413 0.5 -> 0.643 Inexact Rounded
-pwsx3744 power 0.0413 0.5 -> 0.203 Inexact Rounded
-pwsx3745 power 0.414 0.5 -> 0.643 Inexact Rounded
-pwsx3746 power 0.0414 0.5 -> 0.203 Inexact Rounded
-pwsx3747 power 0.415 0.5 -> 0.644 Inexact Rounded
-pwsx3748 power 0.0415 0.5 -> 0.204 Inexact Rounded
-pwsx3749 power 0.416 0.5 -> 0.645 Inexact Rounded
-pwsx3750 power 0.0416 0.5 -> 0.204 Inexact Rounded
-pwsx3751 power 0.417 0.5 -> 0.646 Inexact Rounded
-pwsx3752 power 0.0417 0.5 -> 0.204 Inexact Rounded
-pwsx3753 power 0.418 0.5 -> 0.647 Inexact Rounded
-pwsx3754 power 0.0418 0.5 -> 0.204 Inexact Rounded
-pwsx3755 power 0.419 0.5 -> 0.647 Inexact Rounded
-pwsx3756 power 0.0419 0.5 -> 0.205 Inexact Rounded
-pwsx3757 power 0.421 0.5 -> 0.649 Inexact Rounded
-pwsx3758 power 0.0421 0.5 -> 0.205 Inexact Rounded
-pwsx3759 power 0.422 0.5 -> 0.650 Inexact Rounded
-pwsx3760 power 0.0422 0.5 -> 0.205 Inexact Rounded
-pwsx3761 power 0.423 0.5 -> 0.650 Inexact Rounded
-pwsx3762 power 0.0423 0.5 -> 0.206 Inexact Rounded
-pwsx3763 power 0.424 0.5 -> 0.651 Inexact Rounded
-pwsx3764 power 0.0424 0.5 -> 0.206 Inexact Rounded
-pwsx3765 power 0.425 0.5 -> 0.652 Inexact Rounded
-pwsx3766 power 0.0425 0.5 -> 0.206 Inexact Rounded
-pwsx3767 power 0.426 0.5 -> 0.653 Inexact Rounded
-pwsx3768 power 0.0426 0.5 -> 0.206 Inexact Rounded
-pwsx3769 power 0.427 0.5 -> 0.653 Inexact Rounded
-pwsx3770 power 0.0427 0.5 -> 0.207 Inexact Rounded
-pwsx3771 power 0.428 0.5 -> 0.654 Inexact Rounded
-pwsx3772 power 0.0428 0.5 -> 0.207 Inexact Rounded
-pwsx3773 power 0.429 0.5 -> 0.655 Inexact Rounded
-pwsx3774 power 0.0429 0.5 -> 0.207 Inexact Rounded
-pwsx3775 power 0.431 0.5 -> 0.657 Inexact Rounded
-pwsx3776 power 0.0431 0.5 -> 0.208 Inexact Rounded
-pwsx3777 power 0.432 0.5 -> 0.657 Inexact Rounded
-pwsx3778 power 0.0432 0.5 -> 0.208 Inexact Rounded
-pwsx3779 power 0.433 0.5 -> 0.658 Inexact Rounded
-pwsx3780 power 0.0433 0.5 -> 0.208 Inexact Rounded
-pwsx3781 power 0.434 0.5 -> 0.659 Inexact Rounded
-pwsx3782 power 0.0434 0.5 -> 0.208 Inexact Rounded
-pwsx3783 power 0.435 0.5 -> 0.660 Inexact Rounded
-pwsx3784 power 0.0435 0.5 -> 0.209 Inexact Rounded
-pwsx3785 power 0.436 0.5 -> 0.660 Inexact Rounded
-pwsx3786 power 0.0436 0.5 -> 0.209 Inexact Rounded
-pwsx3787 power 0.437 0.5 -> 0.661 Inexact Rounded
-pwsx3788 power 0.0437 0.5 -> 0.209 Inexact Rounded
-pwsx3789 power 0.438 0.5 -> 0.662 Inexact Rounded
-pwsx3790 power 0.0438 0.5 -> 0.209 Inexact Rounded
-pwsx3791 power 0.439 0.5 -> 0.663 Inexact Rounded
-pwsx3792 power 0.0439 0.5 -> 0.210 Inexact Rounded
-pwsx3793 power 0.441 0.5 -> 0.664 Inexact Rounded
-pwsx3794 power 0.0441 0.5 -> 0.210 Inexact Rounded
-pwsx3795 power 0.442 0.5 -> 0.665 Inexact Rounded
-pwsx3796 power 0.0442 0.5 -> 0.210 Inexact Rounded
-pwsx3797 power 0.443 0.5 -> 0.666 Inexact Rounded
-pwsx3798 power 0.0443 0.5 -> 0.210 Inexact Rounded
-pwsx3799 power 0.444 0.5 -> 0.666 Inexact Rounded
-pwsx3800 power 0.0444 0.5 -> 0.211 Inexact Rounded
-pwsx3801 power 0.445 0.5 -> 0.667 Inexact Rounded
-pwsx3802 power 0.0445 0.5 -> 0.211 Inexact Rounded
-pwsx3803 power 0.446 0.5 -> 0.668 Inexact Rounded
-pwsx3804 power 0.0446 0.5 -> 0.211 Inexact Rounded
-pwsx3805 power 0.447 0.5 -> 0.669 Inexact Rounded
-pwsx3806 power 0.0447 0.5 -> 0.211 Inexact Rounded
-pwsx3807 power 0.448 0.5 -> 0.669 Inexact Rounded
-pwsx3808 power 0.0448 0.5 -> 0.212 Inexact Rounded
-pwsx3809 power 0.449 0.5 -> 0.670 Inexact Rounded
-pwsx3810 power 0.0449 0.5 -> 0.212 Inexact Rounded
-pwsx3811 power 0.451 0.5 -> 0.672 Inexact Rounded
-pwsx3812 power 0.0451 0.5 -> 0.212 Inexact Rounded
-pwsx3813 power 0.452 0.5 -> 0.672 Inexact Rounded
-pwsx3814 power 0.0452 0.5 -> 0.213 Inexact Rounded
-pwsx3815 power 0.453 0.5 -> 0.673 Inexact Rounded
-pwsx3816 power 0.0453 0.5 -> 0.213 Inexact Rounded
-pwsx3817 power 0.454 0.5 -> 0.674 Inexact Rounded
-pwsx3818 power 0.0454 0.5 -> 0.213 Inexact Rounded
-pwsx3819 power 0.455 0.5 -> 0.675 Inexact Rounded
-pwsx3820 power 0.0455 0.5 -> 0.213 Inexact Rounded
-pwsx3821 power 0.456 0.5 -> 0.675 Inexact Rounded
-pwsx3822 power 0.0456 0.5 -> 0.214 Inexact Rounded
-pwsx3823 power 0.457 0.5 -> 0.676 Inexact Rounded
-pwsx3824 power 0.0457 0.5 -> 0.214 Inexact Rounded
-pwsx3825 power 0.458 0.5 -> 0.677 Inexact Rounded
-pwsx3826 power 0.0458 0.5 -> 0.214 Inexact Rounded
-pwsx3827 power 0.459 0.5 -> 0.677 Inexact Rounded
-pwsx3828 power 0.0459 0.5 -> 0.214 Inexact Rounded
-pwsx3829 power 0.461 0.5 -> 0.679 Inexact Rounded
-pwsx3830 power 0.0461 0.5 -> 0.215 Inexact Rounded
-pwsx3831 power 0.462 0.5 -> 0.680 Inexact Rounded
-pwsx3832 power 0.0462 0.5 -> 0.215 Inexact Rounded
-pwsx3833 power 0.463 0.5 -> 0.680 Inexact Rounded
-pwsx3834 power 0.0463 0.5 -> 0.215 Inexact Rounded
-pwsx3835 power 0.464 0.5 -> 0.681 Inexact Rounded
-pwsx3836 power 0.0464 0.5 -> 0.215 Inexact Rounded
-pwsx3837 power 0.465 0.5 -> 0.682 Inexact Rounded
-pwsx3838 power 0.0465 0.5 -> 0.216 Inexact Rounded
-pwsx3839 power 0.466 0.5 -> 0.683 Inexact Rounded
-pwsx3840 power 0.0466 0.5 -> 0.216 Inexact Rounded
-pwsx3841 power 0.467 0.5 -> 0.683 Inexact Rounded
-pwsx3842 power 0.0467 0.5 -> 0.216 Inexact Rounded
-pwsx3843 power 0.468 0.5 -> 0.684 Inexact Rounded
-pwsx3844 power 0.0468 0.5 -> 0.216 Inexact Rounded
-pwsx3845 power 0.469 0.5 -> 0.685 Inexact Rounded
-pwsx3846 power 0.0469 0.5 -> 0.217 Inexact Rounded
-pwsx3847 power 0.471 0.5 -> 0.686 Inexact Rounded
-pwsx3848 power 0.0471 0.5 -> 0.217 Inexact Rounded
-pwsx3849 power 0.472 0.5 -> 0.687 Inexact Rounded
-pwsx3850 power 0.0472 0.5 -> 0.217 Inexact Rounded
-pwsx3851 power 0.473 0.5 -> 0.688 Inexact Rounded
-pwsx3852 power 0.0473 0.5 -> 0.217 Inexact Rounded
-pwsx3853 power 0.474 0.5 -> 0.688 Inexact Rounded
-pwsx3854 power 0.0474 0.5 -> 0.218 Inexact Rounded
-pwsx3855 power 0.475 0.5 -> 0.689 Inexact Rounded
-pwsx3856 power 0.0475 0.5 -> 0.218 Inexact Rounded
-pwsx3857 power 0.476 0.5 -> 0.690 Inexact Rounded
-pwsx3858 power 0.0476 0.5 -> 0.218 Inexact Rounded
-pwsx3859 power 0.477 0.5 -> 0.691 Inexact Rounded
-pwsx3860 power 0.0477 0.5 -> 0.218 Inexact Rounded
-pwsx3861 power 0.478 0.5 -> 0.691 Inexact Rounded
-pwsx3862 power 0.0478 0.5 -> 0.219 Inexact Rounded
-pwsx3863 power 0.479 0.5 -> 0.692 Inexact Rounded
-pwsx3864 power 0.0479 0.5 -> 0.219 Inexact Rounded
-pwsx3865 power 0.481 0.5 -> 0.694 Inexact Rounded
-pwsx3866 power 0.0481 0.5 -> 0.219 Inexact Rounded
-pwsx3867 power 0.482 0.5 -> 0.694 Inexact Rounded
-pwsx3868 power 0.0482 0.5 -> 0.220 Inexact Rounded
-pwsx3869 power 0.483 0.5 -> 0.695 Inexact Rounded
-pwsx3870 power 0.0483 0.5 -> 0.220 Inexact Rounded
-pwsx3871 power 0.484 0.5 -> 0.696 Inexact Rounded
-pwsx3872 power 0.0484 0.5 -> 0.220 Inexact Rounded
-pwsx3873 power 0.485 0.5 -> 0.696 Inexact Rounded
-pwsx3874 power 0.0485 0.5 -> 0.220 Inexact Rounded
-pwsx3875 power 0.486 0.5 -> 0.697 Inexact Rounded
-pwsx3876 power 0.0486 0.5 -> 0.220 Inexact Rounded
-pwsx3877 power 0.487 0.5 -> 0.698 Inexact Rounded
-pwsx3878 power 0.0487 0.5 -> 0.221 Inexact Rounded
-pwsx3879 power 0.488 0.5 -> 0.699 Inexact Rounded
-pwsx3880 power 0.0488 0.5 -> 0.221 Inexact Rounded
-pwsx3881 power 0.489 0.5 -> 0.699 Inexact Rounded
-pwsx3882 power 0.0489 0.5 -> 0.221 Inexact Rounded
-pwsx3883 power 0.491 0.5 -> 0.701 Inexact Rounded
-pwsx3884 power 0.0491 0.5 -> 0.222 Inexact Rounded
-pwsx3885 power 0.492 0.5 -> 0.701 Inexact Rounded
-pwsx3886 power 0.0492 0.5 -> 0.222 Inexact Rounded
-pwsx3887 power 0.493 0.5 -> 0.702 Inexact Rounded
-pwsx3888 power 0.0493 0.5 -> 0.222 Inexact Rounded
-pwsx3889 power 0.494 0.5 -> 0.703 Inexact Rounded
-pwsx3890 power 0.0494 0.5 -> 0.222 Inexact Rounded
-pwsx3891 power 0.495 0.5 -> 0.704 Inexact Rounded
-pwsx3892 power 0.0495 0.5 -> 0.222 Inexact Rounded
-pwsx3893 power 0.496 0.5 -> 0.704 Inexact Rounded
-pwsx3894 power 0.0496 0.5 -> 0.223 Inexact Rounded
-pwsx3895 power 0.497 0.5 -> 0.705 Inexact Rounded
-pwsx3896 power 0.0497 0.5 -> 0.223 Inexact Rounded
-pwsx3897 power 0.498 0.5 -> 0.706 Inexact Rounded
-pwsx3898 power 0.0498 0.5 -> 0.223 Inexact Rounded
-pwsx3899 power 0.499 0.5 -> 0.706 Inexact Rounded
-pwsx3900 power 0.0499 0.5 -> 0.223 Inexact Rounded
-pwsx3901 power 0.501 0.5 -> 0.708 Inexact Rounded
-pwsx3902 power 0.0501 0.5 -> 0.224 Inexact Rounded
-pwsx3903 power 0.502 0.5 -> 0.709 Inexact Rounded
-pwsx3904 power 0.0502 0.5 -> 0.224 Inexact Rounded
-pwsx3905 power 0.503 0.5 -> 0.709 Inexact Rounded
-pwsx3906 power 0.0503 0.5 -> 0.224 Inexact Rounded
-pwsx3907 power 0.504 0.5 -> 0.710 Inexact Rounded
-pwsx3908 power 0.0504 0.5 -> 0.224 Inexact Rounded
-pwsx3909 power 0.505 0.5 -> 0.711 Inexact Rounded
-pwsx3910 power 0.0505 0.5 -> 0.225 Inexact Rounded
-pwsx3911 power 0.506 0.5 -> 0.711 Inexact Rounded
-pwsx3912 power 0.0506 0.5 -> 0.225 Inexact Rounded
-pwsx3913 power 0.507 0.5 -> 0.712 Inexact Rounded
-pwsx3914 power 0.0507 0.5 -> 0.225 Inexact Rounded
-pwsx3915 power 0.508 0.5 -> 0.713 Inexact Rounded
-pwsx3916 power 0.0508 0.5 -> 0.225 Inexact Rounded
-pwsx3917 power 0.509 0.5 -> 0.713 Inexact Rounded
-pwsx3918 power 0.0509 0.5 -> 0.226 Inexact Rounded
-pwsx3919 power 0.511 0.5 -> 0.715 Inexact Rounded
-pwsx3920 power 0.0511 0.5 -> 0.226 Inexact Rounded
-pwsx3921 power 0.512 0.5 -> 0.716 Inexact Rounded
-pwsx3922 power 0.0512 0.5 -> 0.226 Inexact Rounded
-pwsx3923 power 0.513 0.5 -> 0.716 Inexact Rounded
-pwsx3924 power 0.0513 0.5 -> 0.226 Inexact Rounded
-pwsx3925 power 0.514 0.5 -> 0.717 Inexact Rounded
-pwsx3926 power 0.0514 0.5 -> 0.227 Inexact Rounded
-pwsx3927 power 0.515 0.5 -> 0.718 Inexact Rounded
-pwsx3928 power 0.0515 0.5 -> 0.227 Inexact Rounded
-pwsx3929 power 0.516 0.5 -> 0.718 Inexact Rounded
-pwsx3930 power 0.0516 0.5 -> 0.227 Inexact Rounded
-pwsx3931 power 0.517 0.5 -> 0.719 Inexact Rounded
-pwsx3932 power 0.0517 0.5 -> 0.227 Inexact Rounded
-pwsx3933 power 0.518 0.5 -> 0.720 Inexact Rounded
-pwsx3934 power 0.0518 0.5 -> 0.228 Inexact Rounded
-pwsx3935 power 0.519 0.5 -> 0.720 Inexact Rounded
-pwsx3936 power 0.0519 0.5 -> 0.228 Inexact Rounded
-pwsx3937 power 0.521 0.5 -> 0.722 Inexact Rounded
-pwsx3938 power 0.0521 0.5 -> 0.228 Inexact Rounded
-pwsx3939 power 0.522 0.5 -> 0.722 Inexact Rounded
-pwsx3940 power 0.0522 0.5 -> 0.228 Inexact Rounded
-pwsx3941 power 0.523 0.5 -> 0.723 Inexact Rounded
-pwsx3942 power 0.0523 0.5 -> 0.229 Inexact Rounded
-pwsx3943 power 0.524 0.5 -> 0.724 Inexact Rounded
-pwsx3944 power 0.0524 0.5 -> 0.229 Inexact Rounded
-pwsx3945 power 0.525 0.5 -> 0.725 Inexact Rounded
-pwsx3946 power 0.0525 0.5 -> 0.229 Inexact Rounded
-pwsx3947 power 0.526 0.5 -> 0.725 Inexact Rounded
-pwsx3948 power 0.0526 0.5 -> 0.229 Inexact Rounded
-pwsx3949 power 0.527 0.5 -> 0.726 Inexact Rounded
-pwsx3950 power 0.0527 0.5 -> 0.230 Inexact Rounded
-pwsx3951 power 0.528 0.5 -> 0.727 Inexact Rounded
-pwsx3952 power 0.0528 0.5 -> 0.230 Inexact Rounded
-pwsx3953 power 0.529 0.5 -> 0.727 Inexact Rounded
-pwsx3954 power 0.0529 0.5 -> 0.230 Inexact Rounded
-pwsx3955 power 0.531 0.5 -> 0.729 Inexact Rounded
-pwsx3956 power 0.0531 0.5 -> 0.230 Inexact Rounded
-pwsx3957 power 0.532 0.5 -> 0.729 Inexact Rounded
-pwsx3958 power 0.0532 0.5 -> 0.231 Inexact Rounded
-pwsx3959 power 0.533 0.5 -> 0.730 Inexact Rounded
-pwsx3960 power 0.0533 0.5 -> 0.231 Inexact Rounded
-pwsx3961 power 0.534 0.5 -> 0.731 Inexact Rounded
-pwsx3962 power 0.0534 0.5 -> 0.231 Inexact Rounded
-pwsx3963 power 0.535 0.5 -> 0.731 Inexact Rounded
-pwsx3964 power 0.0535 0.5 -> 0.231 Inexact Rounded
-pwsx3965 power 0.536 0.5 -> 0.732 Inexact Rounded
-pwsx3966 power 0.0536 0.5 -> 0.232 Inexact Rounded
-pwsx3967 power 0.537 0.5 -> 0.733 Inexact Rounded
-pwsx3968 power 0.0537 0.5 -> 0.232 Inexact Rounded
-pwsx3969 power 0.538 0.5 -> 0.733 Inexact Rounded
-pwsx3970 power 0.0538 0.5 -> 0.232 Inexact Rounded
-pwsx3971 power 0.539 0.5 -> 0.734 Inexact Rounded
-pwsx3972 power 0.0539 0.5 -> 0.232 Inexact Rounded
-pwsx3973 power 0.541 0.5 -> 0.736 Inexact Rounded
-pwsx3974 power 0.0541 0.5 -> 0.233 Inexact Rounded
-pwsx3975 power 0.542 0.5 -> 0.736 Inexact Rounded
-pwsx3976 power 0.0542 0.5 -> 0.233 Inexact Rounded
-pwsx3977 power 0.543 0.5 -> 0.737 Inexact Rounded
-pwsx3978 power 0.0543 0.5 -> 0.233 Inexact Rounded
-pwsx3979 power 0.544 0.5 -> 0.738 Inexact Rounded
-pwsx3980 power 0.0544 0.5 -> 0.233 Inexact Rounded
-pwsx3981 power 0.545 0.5 -> 0.738 Inexact Rounded
-pwsx3982 power 0.0545 0.5 -> 0.233 Inexact Rounded
-pwsx3983 power 0.546 0.5 -> 0.739 Inexact Rounded
-pwsx3984 power 0.0546 0.5 -> 0.234 Inexact Rounded
-pwsx3985 power 0.547 0.5 -> 0.740 Inexact Rounded
-pwsx3986 power 0.0547 0.5 -> 0.234 Inexact Rounded
-pwsx3987 power 0.548 0.5 -> 0.740 Inexact Rounded
-pwsx3988 power 0.0548 0.5 -> 0.234 Inexact Rounded
-pwsx3989 power 0.549 0.5 -> 0.741 Inexact Rounded
-pwsx3990 power 0.0549 0.5 -> 0.234 Inexact Rounded
-pwsx3991 power 0.551 0.5 -> 0.742 Inexact Rounded
-pwsx3992 power 0.0551 0.5 -> 0.235 Inexact Rounded
-pwsx3993 power 0.552 0.5 -> 0.743 Inexact Rounded
-pwsx3994 power 0.0552 0.5 -> 0.235 Inexact Rounded
-pwsx3995 power 0.553 0.5 -> 0.744 Inexact Rounded
-pwsx3996 power 0.0553 0.5 -> 0.235 Inexact Rounded
-pwsx3997 power 0.554 0.5 -> 0.744 Inexact Rounded
-pwsx3998 power 0.0554 0.5 -> 0.235 Inexact Rounded
-pwsx3999 power 0.555 0.5 -> 0.745 Inexact Rounded
-pwsx4000 power 0.0555 0.5 -> 0.236 Inexact Rounded
-pwsx4001 power 0.556 0.5 -> 0.746 Inexact Rounded
-pwsx4002 power 0.0556 0.5 -> 0.236 Inexact Rounded
-pwsx4003 power 0.557 0.5 -> 0.746 Inexact Rounded
-pwsx4004 power 0.0557 0.5 -> 0.236 Inexact Rounded
-pwsx4005 power 0.558 0.5 -> 0.747 Inexact Rounded
-pwsx4006 power 0.0558 0.5 -> 0.236 Inexact Rounded
-pwsx4007 power 0.559 0.5 -> 0.748 Inexact Rounded
-pwsx4008 power 0.0559 0.5 -> 0.236 Inexact Rounded
-pwsx4009 power 0.561 0.5 -> 0.749 Inexact Rounded
-pwsx4010 power 0.0561 0.5 -> 0.237 Inexact Rounded
-pwsx4011 power 0.562 0.5 -> 0.750 Inexact Rounded
-pwsx4012 power 0.0562 0.5 -> 0.237 Inexact Rounded
-pwsx4013 power 0.563 0.5 -> 0.750 Inexact Rounded
-pwsx4014 power 0.0563 0.5 -> 0.237 Inexact Rounded
-pwsx4015 power 0.564 0.5 -> 0.751 Inexact Rounded
-pwsx4016 power 0.0564 0.5 -> 0.237 Inexact Rounded
-pwsx4017 power 0.565 0.5 -> 0.752 Inexact Rounded
-pwsx4018 power 0.0565 0.5 -> 0.238 Inexact Rounded
-pwsx4019 power 0.566 0.5 -> 0.752 Inexact Rounded
-pwsx4020 power 0.0566 0.5 -> 0.238 Inexact Rounded
-pwsx4021 power 0.567 0.5 -> 0.753 Inexact Rounded
-pwsx4022 power 0.0567 0.5 -> 0.238 Inexact Rounded
-pwsx4023 power 0.568 0.5 -> 0.754 Inexact Rounded
-pwsx4024 power 0.0568 0.5 -> 0.238 Inexact Rounded
-pwsx4025 power 0.569 0.5 -> 0.754 Inexact Rounded
-pwsx4026 power 0.0569 0.5 -> 0.239 Inexact Rounded
-pwsx4027 power 0.571 0.5 -> 0.756 Inexact Rounded
-pwsx4028 power 0.0571 0.5 -> 0.239 Inexact Rounded
-pwsx4029 power 0.572 0.5 -> 0.756 Inexact Rounded
-pwsx4030 power 0.0572 0.5 -> 0.239 Inexact Rounded
-pwsx4031 power 0.573 0.5 -> 0.757 Inexact Rounded
-pwsx4032 power 0.0573 0.5 -> 0.239 Inexact Rounded
-pwsx4033 power 0.574 0.5 -> 0.758 Inexact Rounded
-pwsx4034 power 0.0574 0.5 -> 0.240 Inexact Rounded
-pwsx4035 power 0.575 0.5 -> 0.758 Inexact Rounded
-pwsx4036 power 0.0575 0.5 -> 0.240 Inexact Rounded
-pwsx4037 power 0.576 0.5 -> 0.759 Inexact Rounded
-pwsx4038 power 0.0576 0.5 -> 0.240 Inexact Rounded
-pwsx4039 power 0.577 0.5 -> 0.760 Inexact Rounded
-pwsx4040 power 0.0577 0.5 -> 0.240 Inexact Rounded
-pwsx4041 power 0.578 0.5 -> 0.760 Inexact Rounded
-pwsx4042 power 0.0578 0.5 -> 0.240 Inexact Rounded
-pwsx4043 power 0.579 0.5 -> 0.761 Inexact Rounded
-pwsx4044 power 0.0579 0.5 -> 0.241 Inexact Rounded
-pwsx4045 power 0.581 0.5 -> 0.762 Inexact Rounded
-pwsx4046 power 0.0581 0.5 -> 0.241 Inexact Rounded
-pwsx4047 power 0.582 0.5 -> 0.763 Inexact Rounded
-pwsx4048 power 0.0582 0.5 -> 0.241 Inexact Rounded
-pwsx4049 power 0.583 0.5 -> 0.764 Inexact Rounded
-pwsx4050 power 0.0583 0.5 -> 0.241 Inexact Rounded
-pwsx4051 power 0.584 0.5 -> 0.764 Inexact Rounded
-pwsx4052 power 0.0584 0.5 -> 0.242 Inexact Rounded
-pwsx4053 power 0.585 0.5 -> 0.765 Inexact Rounded
-pwsx4054 power 0.0585 0.5 -> 0.242 Inexact Rounded
-pwsx4055 power 0.586 0.5 -> 0.766 Inexact Rounded
-pwsx4056 power 0.0586 0.5 -> 0.242 Inexact Rounded
-pwsx4057 power 0.587 0.5 -> 0.766 Inexact Rounded
-pwsx4058 power 0.0587 0.5 -> 0.242 Inexact Rounded
-pwsx4059 power 0.588 0.5 -> 0.767 Inexact Rounded
-pwsx4060 power 0.0588 0.5 -> 0.242 Inexact Rounded
-pwsx4061 power 0.589 0.5 -> 0.767 Inexact Rounded
-pwsx4062 power 0.0589 0.5 -> 0.243 Inexact Rounded
-pwsx4063 power 0.591 0.5 -> 0.769 Inexact Rounded
-pwsx4064 power 0.0591 0.5 -> 0.243 Inexact Rounded
-pwsx4065 power 0.592 0.5 -> 0.769 Inexact Rounded
-pwsx4066 power 0.0592 0.5 -> 0.243 Inexact Rounded
-pwsx4067 power 0.593 0.5 -> 0.770 Inexact Rounded
-pwsx4068 power 0.0593 0.5 -> 0.244 Inexact Rounded
-pwsx4069 power 0.594 0.5 -> 0.771 Inexact Rounded
-pwsx4070 power 0.0594 0.5 -> 0.244 Inexact Rounded
-pwsx4071 power 0.595 0.5 -> 0.771 Inexact Rounded
-pwsx4072 power 0.0595 0.5 -> 0.244 Inexact Rounded
-pwsx4073 power 0.596 0.5 -> 0.772 Inexact Rounded
-pwsx4074 power 0.0596 0.5 -> 0.244 Inexact Rounded
-pwsx4075 power 0.597 0.5 -> 0.773 Inexact Rounded
-pwsx4076 power 0.0597 0.5 -> 0.244 Inexact Rounded
-pwsx4077 power 0.598 0.5 -> 0.773 Inexact Rounded
-pwsx4078 power 0.0598 0.5 -> 0.245 Inexact Rounded
-pwsx4079 power 0.599 0.5 -> 0.774 Inexact Rounded
-pwsx4080 power 0.0599 0.5 -> 0.245 Inexact Rounded
-pwsx4081 power 0.601 0.5 -> 0.775 Inexact Rounded
-pwsx4082 power 0.0601 0.5 -> 0.245 Inexact Rounded
-pwsx4083 power 0.602 0.5 -> 0.776 Inexact Rounded
-pwsx4084 power 0.0602 0.5 -> 0.245 Inexact Rounded
-pwsx4085 power 0.603 0.5 -> 0.777 Inexact Rounded
-pwsx4086 power 0.0603 0.5 -> 0.246 Inexact Rounded
-pwsx4087 power 0.604 0.5 -> 0.777 Inexact Rounded
-pwsx4088 power 0.0604 0.5 -> 0.246 Inexact Rounded
-pwsx4089 power 0.605 0.5 -> 0.778 Inexact Rounded
-pwsx4090 power 0.0605 0.5 -> 0.246 Inexact Rounded
-pwsx4091 power 0.606 0.5 -> 0.778 Inexact Rounded
-pwsx4092 power 0.0606 0.5 -> 0.246 Inexact Rounded
-pwsx4093 power 0.607 0.5 -> 0.779 Inexact Rounded
-pwsx4094 power 0.0607 0.5 -> 0.246 Inexact Rounded
-pwsx4095 power 0.608 0.5 -> 0.780 Inexact Rounded
-pwsx4096 power 0.0608 0.5 -> 0.247 Inexact Rounded
-pwsx4097 power 0.609 0.5 -> 0.780 Inexact Rounded
-pwsx4098 power 0.0609 0.5 -> 0.247 Inexact Rounded
-pwsx4099 power 0.611 0.5 -> 0.782 Inexact Rounded
-pwsx4100 power 0.0611 0.5 -> 0.247 Inexact Rounded
-pwsx4101 power 0.612 0.5 -> 0.782 Inexact Rounded
-pwsx4102 power 0.0612 0.5 -> 0.247 Inexact Rounded
-pwsx4103 power 0.613 0.5 -> 0.783 Inexact Rounded
-pwsx4104 power 0.0613 0.5 -> 0.248 Inexact Rounded
-pwsx4105 power 0.614 0.5 -> 0.784 Inexact Rounded
-pwsx4106 power 0.0614 0.5 -> 0.248 Inexact Rounded
-pwsx4107 power 0.615 0.5 -> 0.784 Inexact Rounded
-pwsx4108 power 0.0615 0.5 -> 0.248 Inexact Rounded
-pwsx4109 power 0.616 0.5 -> 0.785 Inexact Rounded
-pwsx4110 power 0.0616 0.5 -> 0.248 Inexact Rounded
-pwsx4111 power 0.617 0.5 -> 0.785 Inexact Rounded
-pwsx4112 power 0.0617 0.5 -> 0.248 Inexact Rounded
-pwsx4113 power 0.618 0.5 -> 0.786 Inexact Rounded
-pwsx4114 power 0.0618 0.5 -> 0.249 Inexact Rounded
-pwsx4115 power 0.619 0.5 -> 0.787 Inexact Rounded
-pwsx4116 power 0.0619 0.5 -> 0.249 Inexact Rounded
-pwsx4117 power 0.621 0.5 -> 0.788 Inexact Rounded
-pwsx4118 power 0.0621 0.5 -> 0.249 Inexact Rounded
-pwsx4119 power 0.622 0.5 -> 0.789 Inexact Rounded
-pwsx4120 power 0.0622 0.5 -> 0.249 Inexact Rounded
-pwsx4121 power 0.623 0.5 -> 0.789 Inexact Rounded
-pwsx4122 power 0.0623 0.5 -> 0.250 Inexact Rounded
-pwsx4123 power 0.624 0.5 -> 0.790 Inexact Rounded
-pwsx4124 power 0.0624 0.5 -> 0.250 Inexact Rounded
-pwsx4125 power 0.625 0.5 -> 0.791 Inexact Rounded
-pwsx4126 power 0.0625 0.5 -> 0.250 Inexact Rounded
-pwsx4127 power 0.626 0.5 -> 0.791 Inexact Rounded
-pwsx4128 power 0.0626 0.5 -> 0.250 Inexact Rounded
-pwsx4129 power 0.627 0.5 -> 0.792 Inexact Rounded
-pwsx4130 power 0.0627 0.5 -> 0.250 Inexact Rounded
-pwsx4131 power 0.628 0.5 -> 0.792 Inexact Rounded
-pwsx4132 power 0.0628 0.5 -> 0.251 Inexact Rounded
-pwsx4133 power 0.629 0.5 -> 0.793 Inexact Rounded
-pwsx4134 power 0.0629 0.5 -> 0.251 Inexact Rounded
-pwsx4135 power 0.631 0.5 -> 0.794 Inexact Rounded
-pwsx4136 power 0.0631 0.5 -> 0.251 Inexact Rounded
-pwsx4137 power 0.632 0.5 -> 0.795 Inexact Rounded
-pwsx4138 power 0.0632 0.5 -> 0.251 Inexact Rounded
-pwsx4139 power 0.633 0.5 -> 0.796 Inexact Rounded
-pwsx4140 power 0.0633 0.5 -> 0.252 Inexact Rounded
-pwsx4141 power 0.634 0.5 -> 0.796 Inexact Rounded
-pwsx4142 power 0.0634 0.5 -> 0.252 Inexact Rounded
-pwsx4143 power 0.635 0.5 -> 0.797 Inexact Rounded
-pwsx4144 power 0.0635 0.5 -> 0.252 Inexact Rounded
-pwsx4145 power 0.636 0.5 -> 0.797 Inexact Rounded
-pwsx4146 power 0.0636 0.5 -> 0.252 Inexact Rounded
-pwsx4147 power 0.637 0.5 -> 0.798 Inexact Rounded
-pwsx4148 power 0.0637 0.5 -> 0.252 Inexact Rounded
-pwsx4149 power 0.638 0.5 -> 0.799 Inexact Rounded
-pwsx4150 power 0.0638 0.5 -> 0.253 Inexact Rounded
-pwsx4151 power 0.639 0.5 -> 0.799 Inexact Rounded
-pwsx4152 power 0.0639 0.5 -> 0.253 Inexact Rounded
-pwsx4153 power 0.641 0.5 -> 0.801 Inexact Rounded
-pwsx4154 power 0.0641 0.5 -> 0.253 Inexact Rounded
-pwsx4155 power 0.642 0.5 -> 0.801 Inexact Rounded
-pwsx4156 power 0.0642 0.5 -> 0.253 Inexact Rounded
-pwsx4157 power 0.643 0.5 -> 0.802 Inexact Rounded
-pwsx4158 power 0.0643 0.5 -> 0.254 Inexact Rounded
-pwsx4159 power 0.644 0.5 -> 0.802 Inexact Rounded
-pwsx4160 power 0.0644 0.5 -> 0.254 Inexact Rounded
-pwsx4161 power 0.645 0.5 -> 0.803 Inexact Rounded
-pwsx4162 power 0.0645 0.5 -> 0.254 Inexact Rounded
-pwsx4163 power 0.646 0.5 -> 0.804 Inexact Rounded
-pwsx4164 power 0.0646 0.5 -> 0.254 Inexact Rounded
-pwsx4165 power 0.647 0.5 -> 0.804 Inexact Rounded
-pwsx4166 power 0.0647 0.5 -> 0.254 Inexact Rounded
-pwsx4167 power 0.648 0.5 -> 0.805 Inexact Rounded
-pwsx4168 power 0.0648 0.5 -> 0.255 Inexact Rounded
-pwsx4169 power 0.649 0.5 -> 0.806 Inexact Rounded
-pwsx4170 power 0.0649 0.5 -> 0.255 Inexact Rounded
-pwsx4171 power 0.651 0.5 -> 0.807 Inexact Rounded
-pwsx4172 power 0.0651 0.5 -> 0.255 Inexact Rounded
-pwsx4173 power 0.652 0.5 -> 0.807 Inexact Rounded
-pwsx4174 power 0.0652 0.5 -> 0.255 Inexact Rounded
-pwsx4175 power 0.653 0.5 -> 0.808 Inexact Rounded
-pwsx4176 power 0.0653 0.5 -> 0.256 Inexact Rounded
-pwsx4177 power 0.654 0.5 -> 0.809 Inexact Rounded
-pwsx4178 power 0.0654 0.5 -> 0.256 Inexact Rounded
-pwsx4179 power 0.655 0.5 -> 0.809 Inexact Rounded
-pwsx4180 power 0.0655 0.5 -> 0.256 Inexact Rounded
-pwsx4181 power 0.656 0.5 -> 0.810 Inexact Rounded
-pwsx4182 power 0.0656 0.5 -> 0.256 Inexact Rounded
-pwsx4183 power 0.657 0.5 -> 0.811 Inexact Rounded
-pwsx4184 power 0.0657 0.5 -> 0.256 Inexact Rounded
-pwsx4185 power 0.658 0.5 -> 0.811 Inexact Rounded
-pwsx4186 power 0.0658 0.5 -> 0.257 Inexact Rounded
-pwsx4187 power 0.659 0.5 -> 0.812 Inexact Rounded
-pwsx4188 power 0.0659 0.5 -> 0.257 Inexact Rounded
-pwsx4189 power 0.661 0.5 -> 0.813 Inexact Rounded
-pwsx4190 power 0.0661 0.5 -> 0.257 Inexact Rounded
-pwsx4191 power 0.662 0.5 -> 0.814 Inexact Rounded
-pwsx4192 power 0.0662 0.5 -> 0.257 Inexact Rounded
-pwsx4193 power 0.663 0.5 -> 0.814 Inexact Rounded
-pwsx4194 power 0.0663 0.5 -> 0.257 Inexact Rounded
-pwsx4195 power 0.664 0.5 -> 0.815 Inexact Rounded
-pwsx4196 power 0.0664 0.5 -> 0.258 Inexact Rounded
-pwsx4197 power 0.665 0.5 -> 0.815 Inexact Rounded
-pwsx4198 power 0.0665 0.5 -> 0.258 Inexact Rounded
-pwsx4199 power 0.666 0.5 -> 0.816 Inexact Rounded
-pwsx4200 power 0.0666 0.5 -> 0.258 Inexact Rounded
-pwsx4201 power 0.667 0.5 -> 0.817 Inexact Rounded
-pwsx4202 power 0.0667 0.5 -> 0.258 Inexact Rounded
-pwsx4203 power 0.668 0.5 -> 0.817 Inexact Rounded
-pwsx4204 power 0.0668 0.5 -> 0.258 Inexact Rounded
-pwsx4205 power 0.669 0.5 -> 0.818 Inexact Rounded
-pwsx4206 power 0.0669 0.5 -> 0.259 Inexact Rounded
-pwsx4207 power 0.671 0.5 -> 0.819 Inexact Rounded
-pwsx4208 power 0.0671 0.5 -> 0.259 Inexact Rounded
-pwsx4209 power 0.672 0.5 -> 0.820 Inexact Rounded
-pwsx4210 power 0.0672 0.5 -> 0.259 Inexact Rounded
-pwsx4211 power 0.673 0.5 -> 0.820 Inexact Rounded
-pwsx4212 power 0.0673 0.5 -> 0.259 Inexact Rounded
-pwsx4213 power 0.674 0.5 -> 0.821 Inexact Rounded
-pwsx4214 power 0.0674 0.5 -> 0.260 Inexact Rounded
-pwsx4215 power 0.675 0.5 -> 0.822 Inexact Rounded
-pwsx4216 power 0.0675 0.5 -> 0.260 Inexact Rounded
-pwsx4217 power 0.676 0.5 -> 0.822 Inexact Rounded
-pwsx4218 power 0.0676 0.5 -> 0.260 Inexact Rounded
-pwsx4219 power 0.677 0.5 -> 0.823 Inexact Rounded
-pwsx4220 power 0.0677 0.5 -> 0.260 Inexact Rounded
-pwsx4221 power 0.678 0.5 -> 0.823 Inexact Rounded
-pwsx4222 power 0.0678 0.5 -> 0.260 Inexact Rounded
-pwsx4223 power 0.679 0.5 -> 0.824 Inexact Rounded
-pwsx4224 power 0.0679 0.5 -> 0.261 Inexact Rounded
-pwsx4225 power 0.681 0.5 -> 0.825 Inexact Rounded
-pwsx4226 power 0.0681 0.5 -> 0.261 Inexact Rounded
-pwsx4227 power 0.682 0.5 -> 0.826 Inexact Rounded
-pwsx4228 power 0.0682 0.5 -> 0.261 Inexact Rounded
-pwsx4229 power 0.683 0.5 -> 0.826 Inexact Rounded
-pwsx4230 power 0.0683 0.5 -> 0.261 Inexact Rounded
-pwsx4231 power 0.684 0.5 -> 0.827 Inexact Rounded
-pwsx4232 power 0.0684 0.5 -> 0.262 Inexact Rounded
-pwsx4233 power 0.685 0.5 -> 0.828 Inexact Rounded
-pwsx4234 power 0.0685 0.5 -> 0.262 Inexact Rounded
-pwsx4235 power 0.686 0.5 -> 0.828 Inexact Rounded
-pwsx4236 power 0.0686 0.5 -> 0.262 Inexact Rounded
-pwsx4237 power 0.687 0.5 -> 0.829 Inexact Rounded
-pwsx4238 power 0.0687 0.5 -> 0.262 Inexact Rounded
-pwsx4239 power 0.688 0.5 -> 0.829 Inexact Rounded
-pwsx4240 power 0.0688 0.5 -> 0.262 Inexact Rounded
-pwsx4241 power 0.689 0.5 -> 0.830 Inexact Rounded
-pwsx4242 power 0.0689 0.5 -> 0.262 Inexact Rounded
-pwsx4243 power 0.691 0.5 -> 0.831 Inexact Rounded
-pwsx4244 power 0.0691 0.5 -> 0.263 Inexact Rounded
-pwsx4245 power 0.692 0.5 -> 0.832 Inexact Rounded
-pwsx4246 power 0.0692 0.5 -> 0.263 Inexact Rounded
-pwsx4247 power 0.693 0.5 -> 0.832 Inexact Rounded
-pwsx4248 power 0.0693 0.5 -> 0.263 Inexact Rounded
-pwsx4249 power 0.694 0.5 -> 0.833 Inexact Rounded
-pwsx4250 power 0.0694 0.5 -> 0.263 Inexact Rounded
-pwsx4251 power 0.695 0.5 -> 0.834 Inexact Rounded
-pwsx4252 power 0.0695 0.5 -> 0.264 Inexact Rounded
-pwsx4253 power 0.696 0.5 -> 0.834 Inexact Rounded
-pwsx4254 power 0.0696 0.5 -> 0.264 Inexact Rounded
-pwsx4255 power 0.697 0.5 -> 0.835 Inexact Rounded
-pwsx4256 power 0.0697 0.5 -> 0.264 Inexact Rounded
-pwsx4257 power 0.698 0.5 -> 0.835 Inexact Rounded
-pwsx4258 power 0.0698 0.5 -> 0.264 Inexact Rounded
-pwsx4259 power 0.699 0.5 -> 0.836 Inexact Rounded
-pwsx4260 power 0.0699 0.5 -> 0.264 Inexact Rounded
-pwsx4261 power 0.701 0.5 -> 0.837 Inexact Rounded
-pwsx4262 power 0.0701 0.5 -> 0.265 Inexact Rounded
-pwsx4263 power 0.702 0.5 -> 0.838 Inexact Rounded
-pwsx4264 power 0.0702 0.5 -> 0.265 Inexact Rounded
-pwsx4265 power 0.703 0.5 -> 0.838 Inexact Rounded
-pwsx4266 power 0.0703 0.5 -> 0.265 Inexact Rounded
-pwsx4267 power 0.704 0.5 -> 0.839 Inexact Rounded
-pwsx4268 power 0.0704 0.5 -> 0.265 Inexact Rounded
-pwsx4269 power 0.705 0.5 -> 0.840 Inexact Rounded
-pwsx4270 power 0.0705 0.5 -> 0.266 Inexact Rounded
-pwsx4271 power 0.706 0.5 -> 0.840 Inexact Rounded
-pwsx4272 power 0.0706 0.5 -> 0.266 Inexact Rounded
-pwsx4273 power 0.707 0.5 -> 0.841 Inexact Rounded
-pwsx4274 power 0.0707 0.5 -> 0.266 Inexact Rounded
-pwsx4275 power 0.708 0.5 -> 0.841 Inexact Rounded
-pwsx4276 power 0.0708 0.5 -> 0.266 Inexact Rounded
-pwsx4277 power 0.709 0.5 -> 0.842 Inexact Rounded
-pwsx4278 power 0.0709 0.5 -> 0.266 Inexact Rounded
-pwsx4279 power 0.711 0.5 -> 0.843 Inexact Rounded
-pwsx4280 power 0.0711 0.5 -> 0.267 Inexact Rounded
-pwsx4281 power 0.712 0.5 -> 0.844 Inexact Rounded
-pwsx4282 power 0.0712 0.5 -> 0.267 Inexact Rounded
-pwsx4283 power 0.713 0.5 -> 0.844 Inexact Rounded
-pwsx4284 power 0.0713 0.5 -> 0.267 Inexact Rounded
-pwsx4285 power 0.714 0.5 -> 0.845 Inexact Rounded
-pwsx4286 power 0.0714 0.5 -> 0.267 Inexact Rounded
-pwsx4287 power 0.715 0.5 -> 0.846 Inexact Rounded
-pwsx4288 power 0.0715 0.5 -> 0.267 Inexact Rounded
-pwsx4289 power 0.716 0.5 -> 0.846 Inexact Rounded
-pwsx4290 power 0.0716 0.5 -> 0.268 Inexact Rounded
-pwsx4291 power 0.717 0.5 -> 0.847 Inexact Rounded
-pwsx4292 power 0.0717 0.5 -> 0.268 Inexact Rounded
-pwsx4293 power 0.718 0.5 -> 0.847 Inexact Rounded
-pwsx4294 power 0.0718 0.5 -> 0.268 Inexact Rounded
-pwsx4295 power 0.719 0.5 -> 0.848 Inexact Rounded
-pwsx4296 power 0.0719 0.5 -> 0.268 Inexact Rounded
-pwsx4297 power 0.721 0.5 -> 0.849 Inexact Rounded
-pwsx4298 power 0.0721 0.5 -> 0.269 Inexact Rounded
-pwsx4299 power 0.722 0.5 -> 0.850 Inexact Rounded
-pwsx4300 power 0.0722 0.5 -> 0.269 Inexact Rounded
-pwsx4301 power 0.723 0.5 -> 0.850 Inexact Rounded
-pwsx4302 power 0.0723 0.5 -> 0.269 Inexact Rounded
-pwsx4303 power 0.724 0.5 -> 0.851 Inexact Rounded
-pwsx4304 power 0.0724 0.5 -> 0.269 Inexact Rounded
-pwsx4305 power 0.725 0.5 -> 0.851 Inexact Rounded
-pwsx4306 power 0.0725 0.5 -> 0.269 Inexact Rounded
-pwsx4307 power 0.726 0.5 -> 0.852 Inexact Rounded
-pwsx4308 power 0.0726 0.5 -> 0.269 Inexact Rounded
-pwsx4309 power 0.727 0.5 -> 0.853 Inexact Rounded
-pwsx4310 power 0.0727 0.5 -> 0.270 Inexact Rounded
-pwsx4311 power 0.728 0.5 -> 0.853 Inexact Rounded
-pwsx4312 power 0.0728 0.5 -> 0.270 Inexact Rounded
-pwsx4313 power 0.729 0.5 -> 0.854 Inexact Rounded
-pwsx4314 power 0.0729 0.5 -> 0.270 Inexact Rounded
-pwsx4315 power 0.731 0.5 -> 0.855 Inexact Rounded
-pwsx4316 power 0.0731 0.5 -> 0.270 Inexact Rounded
-pwsx4317 power 0.732 0.5 -> 0.856 Inexact Rounded
-pwsx4318 power 0.0732 0.5 -> 0.271 Inexact Rounded
-pwsx4319 power 0.733 0.5 -> 0.856 Inexact Rounded
-pwsx4320 power 0.0733 0.5 -> 0.271 Inexact Rounded
-pwsx4321 power 0.734 0.5 -> 0.857 Inexact Rounded
-pwsx4322 power 0.0734 0.5 -> 0.271 Inexact Rounded
-pwsx4323 power 0.735 0.5 -> 0.857 Inexact Rounded
-pwsx4324 power 0.0735 0.5 -> 0.271 Inexact Rounded
-pwsx4325 power 0.736 0.5 -> 0.858 Inexact Rounded
-pwsx4326 power 0.0736 0.5 -> 0.271 Inexact Rounded
-pwsx4327 power 0.737 0.5 -> 0.858 Inexact Rounded
-pwsx4328 power 0.0737 0.5 -> 0.271 Inexact Rounded
-pwsx4329 power 0.738 0.5 -> 0.859 Inexact Rounded
-pwsx4330 power 0.0738 0.5 -> 0.272 Inexact Rounded
-pwsx4331 power 0.739 0.5 -> 0.860 Inexact Rounded
-pwsx4332 power 0.0739 0.5 -> 0.272 Inexact Rounded
-pwsx4333 power 0.741 0.5 -> 0.861 Inexact Rounded
-pwsx4334 power 0.0741 0.5 -> 0.272 Inexact Rounded
-pwsx4335 power 0.742 0.5 -> 0.861 Inexact Rounded
-pwsx4336 power 0.0742 0.5 -> 0.272 Inexact Rounded
-pwsx4337 power 0.743 0.5 -> 0.862 Inexact Rounded
-pwsx4338 power 0.0743 0.5 -> 0.273 Inexact Rounded
-pwsx4339 power 0.744 0.5 -> 0.863 Inexact Rounded
-pwsx4340 power 0.0744 0.5 -> 0.273 Inexact Rounded
-pwsx4341 power 0.745 0.5 -> 0.863 Inexact Rounded
-pwsx4342 power 0.0745 0.5 -> 0.273 Inexact Rounded
-pwsx4343 power 0.746 0.5 -> 0.864 Inexact Rounded
-pwsx4344 power 0.0746 0.5 -> 0.273 Inexact Rounded
-pwsx4345 power 0.747 0.5 -> 0.864 Inexact Rounded
-pwsx4346 power 0.0747 0.5 -> 0.273 Inexact Rounded
-pwsx4347 power 0.748 0.5 -> 0.865 Inexact Rounded
-pwsx4348 power 0.0748 0.5 -> 0.273 Inexact Rounded
-pwsx4349 power 0.749 0.5 -> 0.865 Inexact Rounded
-pwsx4350 power 0.0749 0.5 -> 0.274 Inexact Rounded
-pwsx4351 power 0.751 0.5 -> 0.867 Inexact Rounded
-pwsx4352 power 0.0751 0.5 -> 0.274 Inexact Rounded
-pwsx4353 power 0.752 0.5 -> 0.867 Inexact Rounded
-pwsx4354 power 0.0752 0.5 -> 0.274 Inexact Rounded
-pwsx4355 power 0.753 0.5 -> 0.868 Inexact Rounded
-pwsx4356 power 0.0753 0.5 -> 0.274 Inexact Rounded
-pwsx4357 power 0.754 0.5 -> 0.868 Inexact Rounded
-pwsx4358 power 0.0754 0.5 -> 0.275 Inexact Rounded
-pwsx4359 power 0.755 0.5 -> 0.869 Inexact Rounded
-pwsx4360 power 0.0755 0.5 -> 0.275 Inexact Rounded
-pwsx4361 power 0.756 0.5 -> 0.869 Inexact Rounded
-pwsx4362 power 0.0756 0.5 -> 0.275 Inexact Rounded
-pwsx4363 power 0.757 0.5 -> 0.870 Inexact Rounded
-pwsx4364 power 0.0757 0.5 -> 0.275 Inexact Rounded
-pwsx4365 power 0.758 0.5 -> 0.871 Inexact Rounded
-pwsx4366 power 0.0758 0.5 -> 0.275 Inexact Rounded
-pwsx4367 power 0.759 0.5 -> 0.871 Inexact Rounded
-pwsx4368 power 0.0759 0.5 -> 0.275 Inexact Rounded
-pwsx4369 power 0.761 0.5 -> 0.872 Inexact Rounded
-pwsx4370 power 0.0761 0.5 -> 0.276 Inexact Rounded
-pwsx4371 power 0.762 0.5 -> 0.873 Inexact Rounded
-pwsx4372 power 0.0762 0.5 -> 0.276 Inexact Rounded
-pwsx4373 power 0.763 0.5 -> 0.873 Inexact Rounded
-pwsx4374 power 0.0763 0.5 -> 0.276 Inexact Rounded
-pwsx4375 power 0.764 0.5 -> 0.874 Inexact Rounded
-pwsx4376 power 0.0764 0.5 -> 0.276 Inexact Rounded
-pwsx4377 power 0.765 0.5 -> 0.875 Inexact Rounded
-pwsx4378 power 0.0765 0.5 -> 0.277 Inexact Rounded
-pwsx4379 power 0.766 0.5 -> 0.875 Inexact Rounded
-pwsx4380 power 0.0766 0.5 -> 0.277 Inexact Rounded
-pwsx4381 power 0.767 0.5 -> 0.876 Inexact Rounded
-pwsx4382 power 0.0767 0.5 -> 0.277 Inexact Rounded
-pwsx4383 power 0.768 0.5 -> 0.876 Inexact Rounded
-pwsx4384 power 0.0768 0.5 -> 0.277 Inexact Rounded
-pwsx4385 power 0.769 0.5 -> 0.877 Inexact Rounded
-pwsx4386 power 0.0769 0.5 -> 0.277 Inexact Rounded
-pwsx4387 power 0.771 0.5 -> 0.878 Inexact Rounded
-pwsx4388 power 0.0771 0.5 -> 0.278 Inexact Rounded
-pwsx4389 power 0.772 0.5 -> 0.879 Inexact Rounded
-pwsx4390 power 0.0772 0.5 -> 0.278 Inexact Rounded
-pwsx4391 power 0.773 0.5 -> 0.879 Inexact Rounded
-pwsx4392 power 0.0773 0.5 -> 0.278 Inexact Rounded
-pwsx4393 power 0.774 0.5 -> 0.880 Inexact Rounded
-pwsx4394 power 0.0774 0.5 -> 0.278 Inexact Rounded
-pwsx4395 power 0.775 0.5 -> 0.880 Inexact Rounded
-pwsx4396 power 0.0775 0.5 -> 0.278 Inexact Rounded
-pwsx4397 power 0.776 0.5 -> 0.881 Inexact Rounded
-pwsx4398 power 0.0776 0.5 -> 0.279 Inexact Rounded
-pwsx4399 power 0.777 0.5 -> 0.881 Inexact Rounded
-pwsx4400 power 0.0777 0.5 -> 0.279 Inexact Rounded
-pwsx4401 power 0.778 0.5 -> 0.882 Inexact Rounded
-pwsx4402 power 0.0778 0.5 -> 0.279 Inexact Rounded
-pwsx4403 power 0.779 0.5 -> 0.883 Inexact Rounded
-pwsx4404 power 0.0779 0.5 -> 0.279 Inexact Rounded
-pwsx4405 power 0.781 0.5 -> 0.884 Inexact Rounded
-pwsx4406 power 0.0781 0.5 -> 0.279 Inexact Rounded
-pwsx4407 power 0.782 0.5 -> 0.884 Inexact Rounded
-pwsx4408 power 0.0782 0.5 -> 0.280 Inexact Rounded
-pwsx4409 power 0.783 0.5 -> 0.885 Inexact Rounded
-pwsx4410 power 0.0783 0.5 -> 0.280 Inexact Rounded
-pwsx4411 power 0.784 0.5 -> 0.885 Inexact Rounded
-pwsx4412 power 0.0784 0.5 -> 0.280 Inexact Rounded
-pwsx4413 power 0.785 0.5 -> 0.886 Inexact Rounded
-pwsx4414 power 0.0785 0.5 -> 0.280 Inexact Rounded
-pwsx4415 power 0.786 0.5 -> 0.887 Inexact Rounded
-pwsx4416 power 0.0786 0.5 -> 0.280 Inexact Rounded
-pwsx4417 power 0.787 0.5 -> 0.887 Inexact Rounded
-pwsx4418 power 0.0787 0.5 -> 0.281 Inexact Rounded
-pwsx4419 power 0.788 0.5 -> 0.888 Inexact Rounded
-pwsx4420 power 0.0788 0.5 -> 0.281 Inexact Rounded
-pwsx4421 power 0.789 0.5 -> 0.888 Inexact Rounded
-pwsx4422 power 0.0789 0.5 -> 0.281 Inexact Rounded
-pwsx4423 power 0.791 0.5 -> 0.889 Inexact Rounded
-pwsx4424 power 0.0791 0.5 -> 0.281 Inexact Rounded
-pwsx4425 power 0.792 0.5 -> 0.890 Inexact Rounded
-pwsx4426 power 0.0792 0.5 -> 0.281 Inexact Rounded
-pwsx4427 power 0.793 0.5 -> 0.891 Inexact Rounded
-pwsx4428 power 0.0793 0.5 -> 0.282 Inexact Rounded
-pwsx4429 power 0.794 0.5 -> 0.891 Inexact Rounded
-pwsx4430 power 0.0794 0.5 -> 0.282 Inexact Rounded
-pwsx4431 power 0.795 0.5 -> 0.892 Inexact Rounded
-pwsx4432 power 0.0795 0.5 -> 0.282 Inexact Rounded
-pwsx4433 power 0.796 0.5 -> 0.892 Inexact Rounded
-pwsx4434 power 0.0796 0.5 -> 0.282 Inexact Rounded
-pwsx4435 power 0.797 0.5 -> 0.893 Inexact Rounded
-pwsx4436 power 0.0797 0.5 -> 0.282 Inexact Rounded
-pwsx4437 power 0.798 0.5 -> 0.893 Inexact Rounded
-pwsx4438 power 0.0798 0.5 -> 0.282 Inexact Rounded
-pwsx4439 power 0.799 0.5 -> 0.894 Inexact Rounded
-pwsx4440 power 0.0799 0.5 -> 0.283 Inexact Rounded
-pwsx4441 power 0.801 0.5 -> 0.895 Inexact Rounded
-pwsx4442 power 0.0801 0.5 -> 0.283 Inexact Rounded
-pwsx4443 power 0.802 0.5 -> 0.896 Inexact Rounded
-pwsx4444 power 0.0802 0.5 -> 0.283 Inexact Rounded
-pwsx4445 power 0.803 0.5 -> 0.896 Inexact Rounded
-pwsx4446 power 0.0803 0.5 -> 0.283 Inexact Rounded
-pwsx4447 power 0.804 0.5 -> 0.897 Inexact Rounded
-pwsx4448 power 0.0804 0.5 -> 0.284 Inexact Rounded
-pwsx4449 power 0.805 0.5 -> 0.897 Inexact Rounded
-pwsx4450 power 0.0805 0.5 -> 0.284 Inexact Rounded
-pwsx4451 power 0.806 0.5 -> 0.898 Inexact Rounded
-pwsx4452 power 0.0806 0.5 -> 0.284 Inexact Rounded
-pwsx4453 power 0.807 0.5 -> 0.898 Inexact Rounded
-pwsx4454 power 0.0807 0.5 -> 0.284 Inexact Rounded
-pwsx4455 power 0.808 0.5 -> 0.899 Inexact Rounded
-pwsx4456 power 0.0808 0.5 -> 0.284 Inexact Rounded
-pwsx4457 power 0.809 0.5 -> 0.899 Inexact Rounded
-pwsx4458 power 0.0809 0.5 -> 0.284 Inexact Rounded
-pwsx4459 power 0.811 0.5 -> 0.901 Inexact Rounded
-pwsx4460 power 0.0811 0.5 -> 0.285 Inexact Rounded
-pwsx4461 power 0.812 0.5 -> 0.901 Inexact Rounded
-pwsx4462 power 0.0812 0.5 -> 0.285 Inexact Rounded
-pwsx4463 power 0.813 0.5 -> 0.902 Inexact Rounded
-pwsx4464 power 0.0813 0.5 -> 0.285 Inexact Rounded
-pwsx4465 power 0.814 0.5 -> 0.902 Inexact Rounded
-pwsx4466 power 0.0814 0.5 -> 0.285 Inexact Rounded
-pwsx4467 power 0.815 0.5 -> 0.903 Inexact Rounded
-pwsx4468 power 0.0815 0.5 -> 0.285 Inexact Rounded
-pwsx4469 power 0.816 0.5 -> 0.903 Inexact Rounded
-pwsx4470 power 0.0816 0.5 -> 0.286 Inexact Rounded
-pwsx4471 power 0.817 0.5 -> 0.904 Inexact Rounded
-pwsx4472 power 0.0817 0.5 -> 0.286 Inexact Rounded
-pwsx4473 power 0.818 0.5 -> 0.904 Inexact Rounded
-pwsx4474 power 0.0818 0.5 -> 0.286 Inexact Rounded
-pwsx4475 power 0.819 0.5 -> 0.905 Inexact Rounded
-pwsx4476 power 0.0819 0.5 -> 0.286 Inexact Rounded
-pwsx4477 power 0.821 0.5 -> 0.906 Inexact Rounded
-pwsx4478 power 0.0821 0.5 -> 0.287 Inexact Rounded
-pwsx4479 power 0.822 0.5 -> 0.907 Inexact Rounded
-pwsx4480 power 0.0822 0.5 -> 0.287 Inexact Rounded
-pwsx4481 power 0.823 0.5 -> 0.907 Inexact Rounded
-pwsx4482 power 0.0823 0.5 -> 0.287 Inexact Rounded
-pwsx4483 power 0.824 0.5 -> 0.908 Inexact Rounded
-pwsx4484 power 0.0824 0.5 -> 0.287 Inexact Rounded
-pwsx4485 power 0.825 0.5 -> 0.908 Inexact Rounded
-pwsx4486 power 0.0825 0.5 -> 0.287 Inexact Rounded
-pwsx4487 power 0.826 0.5 -> 0.909 Inexact Rounded
-pwsx4488 power 0.0826 0.5 -> 0.287 Inexact Rounded
-pwsx4489 power 0.827 0.5 -> 0.909 Inexact Rounded
-pwsx4490 power 0.0827 0.5 -> 0.288 Inexact Rounded
-pwsx4491 power 0.828 0.5 -> 0.910 Inexact Rounded
-pwsx4492 power 0.0828 0.5 -> 0.288 Inexact Rounded
-pwsx4493 power 0.829 0.5 -> 0.910 Inexact Rounded
-pwsx4494 power 0.0829 0.5 -> 0.288 Inexact Rounded
-pwsx4495 power 0.831 0.5 -> 0.912 Inexact Rounded
-pwsx4496 power 0.0831 0.5 -> 0.288 Inexact Rounded
-pwsx4497 power 0.832 0.5 -> 0.912 Inexact Rounded
-pwsx4498 power 0.0832 0.5 -> 0.288 Inexact Rounded
-pwsx4499 power 0.833 0.5 -> 0.913 Inexact Rounded
-pwsx4500 power 0.0833 0.5 -> 0.289 Inexact Rounded
-pwsx4501 power 0.834 0.5 -> 0.913 Inexact Rounded
-pwsx4502 power 0.0834 0.5 -> 0.289 Inexact Rounded
-pwsx4503 power 0.835 0.5 -> 0.914 Inexact Rounded
-pwsx4504 power 0.0835 0.5 -> 0.289 Inexact Rounded
-pwsx4505 power 0.836 0.5 -> 0.914 Inexact Rounded
-pwsx4506 power 0.0836 0.5 -> 0.289 Inexact Rounded
-pwsx4507 power 0.837 0.5 -> 0.915 Inexact Rounded
-pwsx4508 power 0.0837 0.5 -> 0.289 Inexact Rounded
-pwsx4509 power 0.838 0.5 -> 0.915 Inexact Rounded
-pwsx4510 power 0.0838 0.5 -> 0.289 Inexact Rounded
-pwsx4511 power 0.839 0.5 -> 0.916 Inexact Rounded
-pwsx4512 power 0.0839 0.5 -> 0.290 Inexact Rounded
-pwsx4513 power 0.841 0.5 -> 0.917 Inexact Rounded
-pwsx4514 power 0.0841 0.5 -> 0.290 Inexact Rounded
-pwsx4515 power 0.842 0.5 -> 0.918 Inexact Rounded
-pwsx4516 power 0.0842 0.5 -> 0.290 Inexact Rounded
-pwsx4517 power 0.843 0.5 -> 0.918 Inexact Rounded
-pwsx4518 power 0.0843 0.5 -> 0.290 Inexact Rounded
-pwsx4519 power 0.844 0.5 -> 0.919 Inexact Rounded
-pwsx4520 power 0.0844 0.5 -> 0.291 Inexact Rounded
-pwsx4521 power 0.845 0.5 -> 0.919 Inexact Rounded
-pwsx4522 power 0.0845 0.5 -> 0.291 Inexact Rounded
-pwsx4523 power 0.846 0.5 -> 0.920 Inexact Rounded
-pwsx4524 power 0.0846 0.5 -> 0.291 Inexact Rounded
-pwsx4525 power 0.847 0.5 -> 0.920 Inexact Rounded
-pwsx4526 power 0.0847 0.5 -> 0.291 Inexact Rounded
-pwsx4527 power 0.848 0.5 -> 0.921 Inexact Rounded
-pwsx4528 power 0.0848 0.5 -> 0.291 Inexact Rounded
-pwsx4529 power 0.849 0.5 -> 0.921 Inexact Rounded
-pwsx4530 power 0.0849 0.5 -> 0.291 Inexact Rounded
-pwsx4531 power 0.851 0.5 -> 0.922 Inexact Rounded
-pwsx4532 power 0.0851 0.5 -> 0.292 Inexact Rounded
-pwsx4533 power 0.852 0.5 -> 0.923 Inexact Rounded
-pwsx4534 power 0.0852 0.5 -> 0.292 Inexact Rounded
-pwsx4535 power 0.853 0.5 -> 0.924 Inexact Rounded
-pwsx4536 power 0.0853 0.5 -> 0.292 Inexact Rounded
-pwsx4537 power 0.854 0.5 -> 0.924 Inexact Rounded
-pwsx4538 power 0.0854 0.5 -> 0.292 Inexact Rounded
-pwsx4539 power 0.855 0.5 -> 0.925 Inexact Rounded
-pwsx4540 power 0.0855 0.5 -> 0.292 Inexact Rounded
-pwsx4541 power 0.856 0.5 -> 0.925 Inexact Rounded
-pwsx4542 power 0.0856 0.5 -> 0.293 Inexact Rounded
-pwsx4543 power 0.857 0.5 -> 0.926 Inexact Rounded
-pwsx4544 power 0.0857 0.5 -> 0.293 Inexact Rounded
-pwsx4545 power 0.858 0.5 -> 0.926 Inexact Rounded
-pwsx4546 power 0.0858 0.5 -> 0.293 Inexact Rounded
-pwsx4547 power 0.859 0.5 -> 0.927 Inexact Rounded
-pwsx4548 power 0.0859 0.5 -> 0.293 Inexact Rounded
-pwsx4549 power 0.861 0.5 -> 0.928 Inexact Rounded
-pwsx4550 power 0.0861 0.5 -> 0.293 Inexact Rounded
-pwsx4551 power 0.862 0.5 -> 0.928 Inexact Rounded
-pwsx4552 power 0.0862 0.5 -> 0.294 Inexact Rounded
-pwsx4553 power 0.863 0.5 -> 0.929 Inexact Rounded
-pwsx4554 power 0.0863 0.5 -> 0.294 Inexact Rounded
-pwsx4555 power 0.864 0.5 -> 0.930 Inexact Rounded
-pwsx4556 power 0.0864 0.5 -> 0.294 Inexact Rounded
-pwsx4557 power 0.865 0.5 -> 0.930 Inexact Rounded
-pwsx4558 power 0.0865 0.5 -> 0.294 Inexact Rounded
-pwsx4559 power 0.866 0.5 -> 0.931 Inexact Rounded
-pwsx4560 power 0.0866 0.5 -> 0.294 Inexact Rounded
-pwsx4561 power 0.867 0.5 -> 0.931 Inexact Rounded
-pwsx4562 power 0.0867 0.5 -> 0.294 Inexact Rounded
-pwsx4563 power 0.868 0.5 -> 0.932 Inexact Rounded
-pwsx4564 power 0.0868 0.5 -> 0.295 Inexact Rounded
-pwsx4565 power 0.869 0.5 -> 0.932 Inexact Rounded
-pwsx4566 power 0.0869 0.5 -> 0.295 Inexact Rounded
-pwsx4567 power 0.871 0.5 -> 0.933 Inexact Rounded
-pwsx4568 power 0.0871 0.5 -> 0.295 Inexact Rounded
-pwsx4569 power 0.872 0.5 -> 0.934 Inexact Rounded
-pwsx4570 power 0.0872 0.5 -> 0.295 Inexact Rounded
-pwsx4571 power 0.873 0.5 -> 0.934 Inexact Rounded
-pwsx4572 power 0.0873 0.5 -> 0.295 Inexact Rounded
-pwsx4573 power 0.874 0.5 -> 0.935 Inexact Rounded
-pwsx4574 power 0.0874 0.5 -> 0.296 Inexact Rounded
-pwsx4575 power 0.875 0.5 -> 0.935 Inexact Rounded
-pwsx4576 power 0.0875 0.5 -> 0.296 Inexact Rounded
-pwsx4577 power 0.876 0.5 -> 0.936 Inexact Rounded
-pwsx4578 power 0.0876 0.5 -> 0.296 Inexact Rounded
-pwsx4579 power 0.877 0.5 -> 0.936 Inexact Rounded
-pwsx4580 power 0.0877 0.5 -> 0.296 Inexact Rounded
-pwsx4581 power 0.878 0.5 -> 0.937 Inexact Rounded
-pwsx4582 power 0.0878 0.5 -> 0.296 Inexact Rounded
-pwsx4583 power 0.879 0.5 -> 0.938 Inexact Rounded
-pwsx4584 power 0.0879 0.5 -> 0.296 Inexact Rounded
-pwsx4585 power 0.881 0.5 -> 0.939 Inexact Rounded
-pwsx4586 power 0.0881 0.5 -> 0.297 Inexact Rounded
-pwsx4587 power 0.882 0.5 -> 0.939 Inexact Rounded
-pwsx4588 power 0.0882 0.5 -> 0.297 Inexact Rounded
-pwsx4589 power 0.883 0.5 -> 0.940 Inexact Rounded
-pwsx4590 power 0.0883 0.5 -> 0.297 Inexact Rounded
-pwsx4591 power 0.884 0.5 -> 0.940 Inexact Rounded
-pwsx4592 power 0.0884 0.5 -> 0.297 Inexact Rounded
-pwsx4593 power 0.885 0.5 -> 0.941 Inexact Rounded
-pwsx4594 power 0.0885 0.5 -> 0.297 Inexact Rounded
-pwsx4595 power 0.886 0.5 -> 0.941 Inexact Rounded
-pwsx4596 power 0.0886 0.5 -> 0.298 Inexact Rounded
-pwsx4597 power 0.887 0.5 -> 0.942 Inexact Rounded
-pwsx4598 power 0.0887 0.5 -> 0.298 Inexact Rounded
-pwsx4599 power 0.888 0.5 -> 0.942 Inexact Rounded
-pwsx4600 power 0.0888 0.5 -> 0.298 Inexact Rounded
-pwsx4601 power 0.889 0.5 -> 0.943 Inexact Rounded
-pwsx4602 power 0.0889 0.5 -> 0.298 Inexact Rounded
-pwsx4603 power 0.891 0.5 -> 0.944 Inexact Rounded
-pwsx4604 power 0.0891 0.5 -> 0.298 Inexact Rounded
-pwsx4605 power 0.892 0.5 -> 0.944 Inexact Rounded
-pwsx4606 power 0.0892 0.5 -> 0.299 Inexact Rounded
-pwsx4607 power 0.893 0.5 -> 0.945 Inexact Rounded
-pwsx4608 power 0.0893 0.5 -> 0.299 Inexact Rounded
-pwsx4609 power 0.894 0.5 -> 0.946 Inexact Rounded
-pwsx4610 power 0.0894 0.5 -> 0.299 Inexact Rounded
-pwsx4611 power 0.895 0.5 -> 0.946 Inexact Rounded
-pwsx4612 power 0.0895 0.5 -> 0.299 Inexact Rounded
-pwsx4613 power 0.896 0.5 -> 0.947 Inexact Rounded
-pwsx4614 power 0.0896 0.5 -> 0.299 Inexact Rounded
-pwsx4615 power 0.897 0.5 -> 0.947 Inexact Rounded
-pwsx4616 power 0.0897 0.5 -> 0.299 Inexact Rounded
-pwsx4617 power 0.898 0.5 -> 0.948 Inexact Rounded
-pwsx4618 power 0.0898 0.5 -> 0.300 Inexact Rounded
-pwsx4619 power 0.899 0.5 -> 0.948 Inexact Rounded
-pwsx4620 power 0.0899 0.5 -> 0.300 Inexact Rounded
-pwsx4621 power 0.901 0.5 -> 0.949 Inexact Rounded
-pwsx4622 power 0.0901 0.5 -> 0.300 Inexact Rounded
-pwsx4623 power 0.902 0.5 -> 0.950 Inexact Rounded
-pwsx4624 power 0.0902 0.5 -> 0.300 Inexact Rounded
-pwsx4625 power 0.903 0.5 -> 0.950 Inexact Rounded
-pwsx4626 power 0.0903 0.5 -> 0.300 Inexact Rounded
-pwsx4627 power 0.904 0.5 -> 0.951 Inexact Rounded
-pwsx4628 power 0.0904 0.5 -> 0.301 Inexact Rounded
-pwsx4629 power 0.905 0.5 -> 0.951 Inexact Rounded
-pwsx4630 power 0.0905 0.5 -> 0.301 Inexact Rounded
-pwsx4631 power 0.906 0.5 -> 0.952 Inexact Rounded
-pwsx4632 power 0.0906 0.5 -> 0.301 Inexact Rounded
-pwsx4633 power 0.907 0.5 -> 0.952 Inexact Rounded
-pwsx4634 power 0.0907 0.5 -> 0.301 Inexact Rounded
-pwsx4635 power 0.908 0.5 -> 0.953 Inexact Rounded
-pwsx4636 power 0.0908 0.5 -> 0.301 Inexact Rounded
-pwsx4637 power 0.909 0.5 -> 0.953 Inexact Rounded
-pwsx4638 power 0.0909 0.5 -> 0.301 Inexact Rounded
-pwsx4639 power 0.911 0.5 -> 0.954 Inexact Rounded
-pwsx4640 power 0.0911 0.5 -> 0.302 Inexact Rounded
-pwsx4641 power 0.912 0.5 -> 0.955 Inexact Rounded
-pwsx4642 power 0.0912 0.5 -> 0.302 Inexact Rounded
-pwsx4643 power 0.913 0.5 -> 0.956 Inexact Rounded
-pwsx4644 power 0.0913 0.5 -> 0.302 Inexact Rounded
-pwsx4645 power 0.914 0.5 -> 0.956 Inexact Rounded
-pwsx4646 power 0.0914 0.5 -> 0.302 Inexact Rounded
-pwsx4647 power 0.915 0.5 -> 0.957 Inexact Rounded
-pwsx4648 power 0.0915 0.5 -> 0.302 Inexact Rounded
-pwsx4649 power 0.916 0.5 -> 0.957 Inexact Rounded
-pwsx4650 power 0.0916 0.5 -> 0.303 Inexact Rounded
-pwsx4651 power 0.917 0.5 -> 0.958 Inexact Rounded
-pwsx4652 power 0.0917 0.5 -> 0.303 Inexact Rounded
-pwsx4653 power 0.918 0.5 -> 0.958 Inexact Rounded
-pwsx4654 power 0.0918 0.5 -> 0.303 Inexact Rounded
-pwsx4655 power 0.919 0.5 -> 0.959 Inexact Rounded
-pwsx4656 power 0.0919 0.5 -> 0.303 Inexact Rounded
-pwsx4657 power 0.921 0.5 -> 0.960 Inexact Rounded
-pwsx4658 power 0.0921 0.5 -> 0.303 Inexact Rounded
-pwsx4659 power 0.922 0.5 -> 0.960 Inexact Rounded
-pwsx4660 power 0.0922 0.5 -> 0.304 Inexact Rounded
-pwsx4661 power 0.923 0.5 -> 0.961 Inexact Rounded
-pwsx4662 power 0.0923 0.5 -> 0.304 Inexact Rounded
-pwsx4663 power 0.924 0.5 -> 0.961 Inexact Rounded
-pwsx4664 power 0.0924 0.5 -> 0.304 Inexact Rounded
-pwsx4665 power 0.925 0.5 -> 0.962 Inexact Rounded
-pwsx4666 power 0.0925 0.5 -> 0.304 Inexact Rounded
-pwsx4667 power 0.926 0.5 -> 0.962 Inexact Rounded
-pwsx4668 power 0.0926 0.5 -> 0.304 Inexact Rounded
-pwsx4669 power 0.927 0.5 -> 0.963 Inexact Rounded
-pwsx4670 power 0.0927 0.5 -> 0.304 Inexact Rounded
-pwsx4671 power 0.928 0.5 -> 0.963 Inexact Rounded
-pwsx4672 power 0.0928 0.5 -> 0.305 Inexact Rounded
-pwsx4673 power 0.929 0.5 -> 0.964 Inexact Rounded
-pwsx4674 power 0.0929 0.5 -> 0.305 Inexact Rounded
-pwsx4675 power 0.931 0.5 -> 0.965 Inexact Rounded
-pwsx4676 power 0.0931 0.5 -> 0.305 Inexact Rounded
-pwsx4677 power 0.932 0.5 -> 0.965 Inexact Rounded
-pwsx4678 power 0.0932 0.5 -> 0.305 Inexact Rounded
-pwsx4679 power 0.933 0.5 -> 0.966 Inexact Rounded
-pwsx4680 power 0.0933 0.5 -> 0.305 Inexact Rounded
-pwsx4681 power 0.934 0.5 -> 0.966 Inexact Rounded
-pwsx4682 power 0.0934 0.5 -> 0.306 Inexact Rounded
-pwsx4683 power 0.935 0.5 -> 0.967 Inexact Rounded
-pwsx4684 power 0.0935 0.5 -> 0.306 Inexact Rounded
-pwsx4685 power 0.936 0.5 -> 0.967 Inexact Rounded
-pwsx4686 power 0.0936 0.5 -> 0.306 Inexact Rounded
-pwsx4687 power 0.937 0.5 -> 0.968 Inexact Rounded
-pwsx4688 power 0.0937 0.5 -> 0.306 Inexact Rounded
-pwsx4689 power 0.938 0.5 -> 0.969 Inexact Rounded
-pwsx4690 power 0.0938 0.5 -> 0.306 Inexact Rounded
-pwsx4691 power 0.939 0.5 -> 0.969 Inexact Rounded
-pwsx4692 power 0.0939 0.5 -> 0.306 Inexact Rounded
-pwsx4693 power 0.941 0.5 -> 0.970 Inexact Rounded
-pwsx4694 power 0.0941 0.5 -> 0.307 Inexact Rounded
-pwsx4695 power 0.942 0.5 -> 0.971 Inexact Rounded
-pwsx4696 power 0.0942 0.5 -> 0.307 Inexact Rounded
-pwsx4697 power 0.943 0.5 -> 0.971 Inexact Rounded
-pwsx4698 power 0.0943 0.5 -> 0.307 Inexact Rounded
-pwsx4699 power 0.944 0.5 -> 0.972 Inexact Rounded
-pwsx4700 power 0.0944 0.5 -> 0.307 Inexact Rounded
-pwsx4701 power 0.945 0.5 -> 0.972 Inexact Rounded
-pwsx4702 power 0.0945 0.5 -> 0.307 Inexact Rounded
-pwsx4703 power 0.946 0.5 -> 0.973 Inexact Rounded
-pwsx4704 power 0.0946 0.5 -> 0.308 Inexact Rounded
-pwsx4705 power 0.947 0.5 -> 0.973 Inexact Rounded
-pwsx4706 power 0.0947 0.5 -> 0.308 Inexact Rounded
-pwsx4707 power 0.948 0.5 -> 0.974 Inexact Rounded
-pwsx4708 power 0.0948 0.5 -> 0.308 Inexact Rounded
-pwsx4709 power 0.949 0.5 -> 0.974 Inexact Rounded
-pwsx4710 power 0.0949 0.5 -> 0.308 Inexact Rounded
-pwsx4711 power 0.951 0.5 -> 0.975 Inexact Rounded
-pwsx4712 power 0.0951 0.5 -> 0.308 Inexact Rounded
-pwsx4713 power 0.952 0.5 -> 0.976 Inexact Rounded
-pwsx4714 power 0.0952 0.5 -> 0.309 Inexact Rounded
-pwsx4715 power 0.953 0.5 -> 0.976 Inexact Rounded
-pwsx4716 power 0.0953 0.5 -> 0.309 Inexact Rounded
-pwsx4717 power 0.954 0.5 -> 0.977 Inexact Rounded
-pwsx4718 power 0.0954 0.5 -> 0.309 Inexact Rounded
-pwsx4719 power 0.955 0.5 -> 0.977 Inexact Rounded
-pwsx4720 power 0.0955 0.5 -> 0.309 Inexact Rounded
-pwsx4721 power 0.956 0.5 -> 0.978 Inexact Rounded
-pwsx4722 power 0.0956 0.5 -> 0.309 Inexact Rounded
-pwsx4723 power 0.957 0.5 -> 0.978 Inexact Rounded
-pwsx4724 power 0.0957 0.5 -> 0.309 Inexact Rounded
-pwsx4725 power 0.958 0.5 -> 0.979 Inexact Rounded
-pwsx4726 power 0.0958 0.5 -> 0.310 Inexact Rounded
-pwsx4727 power 0.959 0.5 -> 0.979 Inexact Rounded
-pwsx4728 power 0.0959 0.5 -> 0.310 Inexact Rounded
-pwsx4729 power 0.961 0.5 -> 0.980 Inexact Rounded
-pwsx4730 power 0.0961 0.5 -> 0.310 Inexact Rounded
-pwsx4731 power 0.962 0.5 -> 0.981 Inexact Rounded
-pwsx4732 power 0.0962 0.5 -> 0.310 Inexact Rounded
-pwsx4733 power 0.963 0.5 -> 0.981 Inexact Rounded
-pwsx4734 power 0.0963 0.5 -> 0.310 Inexact Rounded
-pwsx4735 power 0.964 0.5 -> 0.982 Inexact Rounded
-pwsx4736 power 0.0964 0.5 -> 0.310 Inexact Rounded
-pwsx4737 power 0.965 0.5 -> 0.982 Inexact Rounded
-pwsx4738 power 0.0965 0.5 -> 0.311 Inexact Rounded
-pwsx4739 power 0.966 0.5 -> 0.983 Inexact Rounded
-pwsx4740 power 0.0966 0.5 -> 0.311 Inexact Rounded
-pwsx4741 power 0.967 0.5 -> 0.983 Inexact Rounded
-pwsx4742 power 0.0967 0.5 -> 0.311 Inexact Rounded
-pwsx4743 power 0.968 0.5 -> 0.984 Inexact Rounded
-pwsx4744 power 0.0968 0.5 -> 0.311 Inexact Rounded
-pwsx4745 power 0.969 0.5 -> 0.984 Inexact Rounded
-pwsx4746 power 0.0969 0.5 -> 0.311 Inexact Rounded
-pwsx4747 power 0.971 0.5 -> 0.985 Inexact Rounded
-pwsx4748 power 0.0971 0.5 -> 0.312 Inexact Rounded
-pwsx4749 power 0.972 0.5 -> 0.986 Inexact Rounded
-pwsx4750 power 0.0972 0.5 -> 0.312 Inexact Rounded
-pwsx4751 power 0.973 0.5 -> 0.986 Inexact Rounded
-pwsx4752 power 0.0973 0.5 -> 0.312 Inexact Rounded
-pwsx4753 power 0.974 0.5 -> 0.987 Inexact Rounded
-pwsx4754 power 0.0974 0.5 -> 0.312 Inexact Rounded
-pwsx4755 power 0.975 0.5 -> 0.987 Inexact Rounded
-pwsx4756 power 0.0975 0.5 -> 0.312 Inexact Rounded
-pwsx4757 power 0.976 0.5 -> 0.988 Inexact Rounded
-pwsx4758 power 0.0976 0.5 -> 0.312 Inexact Rounded
-pwsx4759 power 0.977 0.5 -> 0.988 Inexact Rounded
-pwsx4760 power 0.0977 0.5 -> 0.313 Inexact Rounded
-pwsx4761 power 0.978 0.5 -> 0.989 Inexact Rounded
-pwsx4762 power 0.0978 0.5 -> 0.313 Inexact Rounded
-pwsx4763 power 0.979 0.5 -> 0.989 Inexact Rounded
-pwsx4764 power 0.0979 0.5 -> 0.313 Inexact Rounded
-pwsx4765 power 0.981 0.5 -> 0.990 Inexact Rounded
-pwsx4766 power 0.0981 0.5 -> 0.313 Inexact Rounded
-pwsx4767 power 0.982 0.5 -> 0.991 Inexact Rounded
-pwsx4768 power 0.0982 0.5 -> 0.313 Inexact Rounded
-pwsx4769 power 0.983 0.5 -> 0.991 Inexact Rounded
-pwsx4770 power 0.0983 0.5 -> 0.314 Inexact Rounded
-pwsx4771 power 0.984 0.5 -> 0.992 Inexact Rounded
-pwsx4772 power 0.0984 0.5 -> 0.314 Inexact Rounded
-pwsx4773 power 0.985 0.5 -> 0.992 Inexact Rounded
-pwsx4774 power 0.0985 0.5 -> 0.314 Inexact Rounded
-pwsx4775 power 0.986 0.5 -> 0.993 Inexact Rounded
-pwsx4776 power 0.0986 0.5 -> 0.314 Inexact Rounded
-pwsx4777 power 0.987 0.5 -> 0.993 Inexact Rounded
-pwsx4778 power 0.0987 0.5 -> 0.314 Inexact Rounded
-pwsx4779 power 0.988 0.5 -> 0.994 Inexact Rounded
-pwsx4780 power 0.0988 0.5 -> 0.314 Inexact Rounded
-pwsx4781 power 0.989 0.5 -> 0.994 Inexact Rounded
-pwsx4782 power 0.0989 0.5 -> 0.314 Inexact Rounded
-pwsx4783 power 0.991 0.5 -> 0.995 Inexact Rounded
-pwsx4784 power 0.0991 0.5 -> 0.315 Inexact Rounded
-pwsx4785 power 0.992 0.5 -> 0.996 Inexact Rounded
-pwsx4786 power 0.0992 0.5 -> 0.315 Inexact Rounded
-pwsx4787 power 0.993 0.5 -> 0.996 Inexact Rounded
-pwsx4788 power 0.0993 0.5 -> 0.315 Inexact Rounded
-pwsx4789 power 0.994 0.5 -> 0.997 Inexact Rounded
-pwsx4790 power 0.0994 0.5 -> 0.315 Inexact Rounded
-pwsx4791 power 0.995 0.5 -> 0.997 Inexact Rounded
-pwsx4792 power 0.0995 0.5 -> 0.315 Inexact Rounded
-pwsx4793 power 0.996 0.5 -> 0.998 Inexact Rounded
-pwsx4794 power 0.0996 0.5 -> 0.316 Inexact Rounded
-pwsx4795 power 0.997 0.5 -> 0.998 Inexact Rounded
-pwsx4796 power 0.0997 0.5 -> 0.316 Inexact Rounded
-pwsx4797 power 0.998 0.5 -> 0.999 Inexact Rounded
-pwsx4798 power 0.0998 0.5 -> 0.316 Inexact Rounded
-pwsx4799 power 0.999 0.5 -> 0.999 Inexact Rounded
-pwsx4800 power 0.0999 0.5 -> 0.316 Inexact Rounded
-
--- A group of precision 4 tests where Hull & Abrham adjustments are
--- needed in some cases (both up and down) [see Hull1985b]
-rounding: half_even
-maxExponent: 999
-minexponent: -999
-precision: 4
-pwsx5001 power 0.0118 0.5 -> 0.1086 Inexact Rounded
-pwsx5002 power 0.119 0.5 -> 0.3450 Inexact Rounded
-pwsx5003 power 0.0119 0.5 -> 0.1091 Inexact Rounded
-pwsx5004 power 0.121 0.5 -> 0.3479 Inexact Rounded
-pwsx5005 power 0.0121 0.5 -> 0.1100 Inexact Rounded
-pwsx5006 power 0.122 0.5 -> 0.3493 Inexact Rounded
-pwsx5007 power 0.0122 0.5 -> 0.1105 Inexact Rounded
-pwsx5008 power 0.123 0.5 -> 0.3507 Inexact Rounded
-pwsx5009 power 0.494 0.5 -> 0.7029 Inexact Rounded
-pwsx5010 power 0.0669 0.5 -> 0.2587 Inexact Rounded
-pwsx5011 power 0.9558 0.5 -> 0.9777 Inexact Rounded
-pwsx5012 power 0.9348 0.5 -> 0.9669 Inexact Rounded
-pwsx5013 power 0.9345 0.5 -> 0.9667 Inexact Rounded
-pwsx5014 power 0.09345 0.5 -> 0.3057 Inexact Rounded
-pwsx5015 power 0.9346 0.5 -> 0.9667 Inexact Rounded
-pwsx5016 power 0.09346 0.5 -> 0.3057 Inexact Rounded
-pwsx5017 power 0.9347 0.5 -> 0.9668 Inexact Rounded
-
--- examples from decArith
-precision: 9
-pwsx700 power 0 0.5 -> '0'
-pwsx701 power -0 0.5 -> '0'
-pwsx702 power 0.39 0.5 -> 0.624499800 Inexact Rounded
-pwsx703 power 100 0.5 -> '10.0000000' Inexact Rounded
-pwsx704 power 1.00 0.5 -> '1.00000000' Inexact Rounded
-pwsx705 power 7 0.5 -> '2.64575131' Inexact Rounded
-pwsx706 power 10 0.5 -> 3.16227766 Inexact Rounded
-
--- some one-offs
-precision: 9
-pwsx711 power 0.1 0.5 -> 0.316227766 Inexact Rounded
-pwsx712 power 0.2 0.5 -> 0.447213595 Inexact Rounded
-pwsx713 power 0.3 0.5 -> 0.547722558 Inexact Rounded
-pwsx714 power 0.4 0.5 -> 0.632455532 Inexact Rounded
-pwsx715 power 0.5 0.5 -> 0.707106781 Inexact Rounded
-pwsx716 power 0.6 0.5 -> 0.774596669 Inexact Rounded
-pwsx717 power 0.7 0.5 -> 0.836660027 Inexact Rounded
-pwsx718 power 0.8 0.5 -> 0.894427191 Inexact Rounded
-pwsx719 power 0.9 0.5 -> 0.948683298 Inexact Rounded
-precision: 10 -- note no normalizatoin here
-pwsx720 power +0.1 0.5 -> 0.3162277660 Inexact Rounded
-precision: 11
-pwsx721 power +0.1 0.5 -> 0.31622776602 Inexact Rounded
-precision: 12
-pwsx722 power +0.1 0.5 -> 0.316227766017 Inexact Rounded
-precision: 9
-pwsx723 power 0.39 0.5 -> 0.624499800 Inexact Rounded
-precision: 15
-pwsx724 power 0.39 0.5 -> 0.624499799839840 Inexact Rounded
-
--- discussion cases
-precision: 7
-pwsx731 power 9 0.5 -> 3.000000 Inexact Rounded
-pwsx732 power 100 0.5 -> 10.00000 Inexact Rounded
-pwsx733 power 123 0.5 -> 11.09054 Inexact Rounded
-pwsx734 power 144 0.5 -> 12.00000 Inexact Rounded
-pwsx735 power 156 0.5 -> 12.49000 Inexact Rounded
-pwsx736 power 10000 0.5 -> 100.0000 Inexact Rounded
-
--- values close to overflow (if there were input rounding)
-maxexponent: 99
-minexponent: -99
-precision: 5
-pwsx760 power 9.9997E+99 0.5 -> 9.9998E+49 Inexact Rounded
-pwsx761 power 9.9998E+99 0.5 -> 9.9999E+49 Inexact Rounded
-pwsx762 power 9.9999E+99 0.5 -> 9.9999E+49 Inexact Rounded
-pwsx763 power 9.99991E+99 0.5 -> 1.0000E+50 Inexact Rounded
-pwsx764 power 9.99994E+99 0.5 -> 1.0000E+50 Inexact Rounded
-pwsx765 power 9.99995E+99 0.5 -> 1.0000E+50 Inexact Rounded
-pwsx766 power 9.99999E+99 0.5 -> 1.0000E+50 Inexact Rounded
-precision: 9
-pwsx770 power 9.9997E+99 0.5 -> 9.99985000E+49 Inexact Rounded
-pwsx771 power 9.9998E+99 0.5 -> 9.99990000E+49 Inexact Rounded
-pwsx772 power 9.9999E+99 0.5 -> 9.99995000E+49 Inexact Rounded
-pwsx773 power 9.99991E+99 0.5 -> 9.99995500E+49 Inexact Rounded
-pwsx774 power 9.99994E+99 0.5 -> 9.99997000E+49 Inexact Rounded
-pwsx775 power 9.99995E+99 0.5 -> 9.99997500E+49 Inexact Rounded
-pwsx776 power 9.99999E+99 0.5 -> 9.99999500E+49 Inexact Rounded
-precision: 20
-pwsx780 power 9.9997E+99 0.5 -> '9.9998499988749831247E+49' Inexact Rounded
-pwsx781 power 9.9998E+99 0.5 -> '9.9998999994999949999E+49' Inexact Rounded
-pwsx782 power 9.9999E+99 0.5 -> '9.9999499998749993750E+49' Inexact Rounded
-pwsx783 power 9.99991E+99 0.5 -> '9.9999549998987495444E+49' Inexact Rounded
-pwsx784 power 9.99994E+99 0.5 -> '9.9999699999549998650E+49' Inexact Rounded
-pwsx785 power 9.99995E+99 0.5 -> '9.9999749999687499219E+49' Inexact Rounded
-pwsx786 power 9.99999E+99 0.5 -> '9.9999949999987499994E+49' Inexact Rounded
-
--- subnormals and underflows [these can only result when eMax is < digits+1]
--- Etiny = -(Emax + (precision-1))
--- start with subnormal operands and normal results
-maxexponent: 9
-minexponent: -9
-precision: 9 -- Etiny=-17
-pwsx800 power 1E-17 0.5 -> 3.16227766E-9 Inexact Rounded
-pwsx801 power 10E-17 0.5 -> 1.00000000E-8 Inexact Rounded
-precision: 10 -- Etiny=-18
-pwsx802 power 10E-18 0.5 -> 3.162277660E-9 Inexact Rounded
-pwsx803 power 1E-18 0.5 -> 1.000000000E-9 Inexact Rounded
-
-precision: 11 -- Etiny=-19
-pwsx804 power 1E-19 0.5 -> 3.162277660E-10 Underflow Subnormal Inexact Rounded
--- The next test should be skipped for decNumber
-pwsx805 power 10E-19 0.5 -> 1.0000000000E-9 Inexact Rounded
-precision: 12 -- Etiny=-20
-pwsx806 power 10E-20 0.5 -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded
-pwsx807 power 1E-20 0.5 -> 1.0000000000E-10 Underflow Subnormal Inexact Rounded
-
-precision: 13 -- Etiny=-21
-pwsx808 power 1E-21 0.5 -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded
-pwsx809 power 10E-21 0.5 -> 1.00000000000E-10 Underflow Subnormal Inexact Rounded
-precision: 14 -- Etiny=-22
-pwsx810 power 1E-21 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
-pwsx811 power 10E-22 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
-pwsx812 power 1E-22 0.5 -> 1.00000000000E-11 Underflow Subnormal Inexact Rounded
-
-
--- special values
-maxexponent: 999
-minexponent: -999
-pwsx820 power Inf 0.5 -> Infinity
-pwsx821 power -Inf 0.5 -> NaN Invalid_operation
-pwsx822 power NaN 0.5 -> NaN
-pwsx823 power sNaN 0.5 -> NaN Invalid_operation
--- propagating NaNs
-pwsx824 power sNaN123 0.5 -> NaN123 Invalid_operation
-pwsx825 power -sNaN321 0.5 -> -NaN321 Invalid_operation
-pwsx826 power NaN456 0.5 -> NaN456
-pwsx827 power -NaN654 0.5 -> -NaN654
-pwsx828 power NaN1 0.5 -> NaN1
-
--- Null test
-pwsx900 power # 0.5 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- powersqrt.decTest -- decimal square root, using power --
+-- Copyright (c) IBM Corporation, 2004, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- These testcases are taken from squareroot.decTest but are
+-- evaluated using the power operator. The differences in results
+-- (153 out of 2856) fall into the following categories:
+--
+-- x ** 0.5 (x>0) has no preferred exponent, and is Inexact
+-- (and hence full precision); almost all differences are
+-- in this category
+-- 0.00 ** 0.5 becomes 0 (not 0.0), etc.
+-- -0 ** 0.5 becomes 0 (never -0)
+-- Some exact subnormals become inexact and hence underflows
+
+extended: 1
+precision: 9
+rounding: half_even
+maxExponent: 384
+minexponent: -383
+
+-- basics
+pwsx001 power 1 0.5 -> 1.00000000 Inexact Rounded
+pwsx002 power -1 0.5 -> NaN Invalid_operation
+pwsx003 power 1.00 0.5 -> 1.00000000 Inexact Rounded
+pwsx004 power -1.00 0.5 -> NaN Invalid_operation
+pwsx005 power 0 0.5 -> 0
+pwsx006 power 00.0 0.5 -> 0
+pwsx007 power 0.00 0.5 -> 0
+pwsx008 power 00.00 0.5 -> 0
+pwsx009 power 00.000 0.5 -> 0
+pwsx010 power 00.0000 0.5 -> 0
+pwsx011 power 00 0.5 -> 0
+
+pwsx012 power -2 0.5 -> NaN Invalid_operation
+pwsx013 power 2 0.5 -> 1.41421356 Inexact Rounded
+pwsx014 power -2.00 0.5 -> NaN Invalid_operation
+pwsx015 power 2.00 0.5 -> 1.41421356 Inexact Rounded
+pwsx016 power -0 0.5 -> 0
+pwsx017 power -0.0 0.5 -> 0
+pwsx018 power -00.00 0.5 -> 0
+pwsx019 power -00.000 0.5 -> 0
+pwsx020 power -0.0000 0.5 -> 0
+pwsx021 power -0E+9 0.5 -> 0
+pwsx022 power -0E+10 0.5 -> 0
+pwsx023 power -0E+11 0.5 -> 0
+pwsx024 power -0E+12 0.5 -> 0
+pwsx025 power -00 0.5 -> 0
+pwsx026 power 0E+5 0.5 -> 0
+pwsx027 power 4.0 0.5 -> 2.00000000 Inexact Rounded
+pwsx028 power 4.00 0.5 -> 2.00000000 Inexact Rounded
+
+pwsx030 power +0.1 0.5 -> 0.316227766 Inexact Rounded
+pwsx031 power -0.1 0.5 -> NaN Invalid_operation
+pwsx032 power +0.01 0.5 -> 0.100000000 Inexact Rounded
+pwsx033 power -0.01 0.5 -> NaN Invalid_operation
+pwsx034 power +0.001 0.5 -> 0.0316227766 Inexact Rounded
+pwsx035 power -0.001 0.5 -> NaN Invalid_operation
+pwsx036 power +0.000001 0.5 -> 0.00100000000 Inexact Rounded
+pwsx037 power -0.000001 0.5 -> NaN Invalid_operation
+pwsx038 power +0.000000000001 0.5 -> 0.00000100000000 Inexact Rounded
+pwsx039 power -0.000000000001 0.5 -> NaN Invalid_operation
+
+pwsx041 power 1.1 0.5 -> 1.04880885 Inexact Rounded
+pwsx042 power 1.10 0.5 -> 1.04880885 Inexact Rounded
+pwsx043 power 1.100 0.5 -> 1.04880885 Inexact Rounded
+pwsx044 power 1.110 0.5 -> 1.05356538 Inexact Rounded
+pwsx045 power -1.1 0.5 -> NaN Invalid_operation
+pwsx046 power -1.10 0.5 -> NaN Invalid_operation
+pwsx047 power -1.100 0.5 -> NaN Invalid_operation
+pwsx048 power -1.110 0.5 -> NaN Invalid_operation
+pwsx049 power 9.9 0.5 -> 3.14642654 Inexact Rounded
+pwsx050 power 9.90 0.5 -> 3.14642654 Inexact Rounded
+pwsx051 power 9.900 0.5 -> 3.14642654 Inexact Rounded
+pwsx052 power 9.990 0.5 -> 3.16069613 Inexact Rounded
+pwsx053 power -9.9 0.5 -> NaN Invalid_operation
+pwsx054 power -9.90 0.5 -> NaN Invalid_operation
+pwsx055 power -9.900 0.5 -> NaN Invalid_operation
+pwsx056 power -9.990 0.5 -> NaN Invalid_operation
+
+pwsx060 power 1 0.5 -> 1.00000000 Inexact Rounded
+pwsx061 power 1.0 0.5 -> 1.00000000 Inexact Rounded
+pwsx062 power 1.00 0.5 -> 1.00000000 Inexact Rounded
+pwsx063 power 10.0 0.5 -> 3.16227766 Inexact Rounded
+pwsx064 power 10.0 0.5 -> 3.16227766 Inexact Rounded
+pwsx065 power 10.0 0.5 -> 3.16227766 Inexact Rounded
+pwsx066 power 10.00 0.5 -> 3.16227766 Inexact Rounded
+pwsx067 power 100 0.5 -> 10.0000000 Inexact Rounded
+pwsx068 power 100.0 0.5 -> 10.0000000 Inexact Rounded
+pwsx069 power 100.00 0.5 -> 10.0000000 Inexact Rounded
+pwsx070 power 1.1000E+3 0.5 -> 33.1662479 Inexact Rounded
+pwsx071 power 1.10000E+3 0.5 -> 33.1662479 Inexact Rounded
+pwsx072 power -10.0 0.5 -> NaN Invalid_operation
+pwsx073 power -10.00 0.5 -> NaN Invalid_operation
+pwsx074 power -100.0 0.5 -> NaN Invalid_operation
+pwsx075 power -100.00 0.5 -> NaN Invalid_operation
+pwsx076 power -1.1000E+3 0.5 -> NaN Invalid_operation
+pwsx077 power -1.10000E+3 0.5 -> NaN Invalid_operation
+
+-- famous squares
+pwsx080 power 1 0.5 -> 1.00000000 Inexact Rounded
+pwsx081 power 4 0.5 -> 2.00000000 Inexact Rounded
+pwsx082 power 9 0.5 -> 3.00000000 Inexact Rounded
+pwsx083 power 16 0.5 -> 4.00000000 Inexact Rounded
+pwsx084 power 25 0.5 -> 5.00000000 Inexact Rounded
+pwsx085 power 36 0.5 -> 6.00000000 Inexact Rounded
+pwsx086 power 49 0.5 -> 7.00000000 Inexact Rounded
+pwsx087 power 64 0.5 -> 8.00000000 Inexact Rounded
+pwsx088 power 81 0.5 -> 9.00000000 Inexact Rounded
+pwsx089 power 100 0.5 -> 10.0000000 Inexact Rounded
+pwsx090 power 121 0.5 -> 11.0000000 Inexact Rounded
+pwsx091 power 144 0.5 -> 12.0000000 Inexact Rounded
+pwsx092 power 169 0.5 -> 13.0000000 Inexact Rounded
+pwsx093 power 256 0.5 -> 16.0000000 Inexact Rounded
+pwsx094 power 1024 0.5 -> 32.0000000 Inexact Rounded
+pwsx095 power 4096 0.5 -> 64.0000000 Inexact Rounded
+pwsx100 power 0.01 0.5 -> 0.100000000 Inexact Rounded
+pwsx101 power 0.04 0.5 -> 0.200000000 Inexact Rounded
+pwsx102 power 0.09 0.5 -> 0.300000000 Inexact Rounded
+pwsx103 power 0.16 0.5 -> 0.400000000 Inexact Rounded
+pwsx104 power 0.25 0.5 -> 0.500000000 Inexact Rounded
+pwsx105 power 0.36 0.5 -> 0.600000000 Inexact Rounded
+pwsx106 power 0.49 0.5 -> 0.700000000 Inexact Rounded
+pwsx107 power 0.64 0.5 -> 0.800000000 Inexact Rounded
+pwsx108 power 0.81 0.5 -> 0.900000000 Inexact Rounded
+pwsx109 power 1.00 0.5 -> 1.00000000 Inexact Rounded
+pwsx110 power 1.21 0.5 -> 1.10000000 Inexact Rounded
+pwsx111 power 1.44 0.5 -> 1.20000000 Inexact Rounded
+pwsx112 power 1.69 0.5 -> 1.30000000 Inexact Rounded
+pwsx113 power 2.56 0.5 -> 1.60000000 Inexact Rounded
+pwsx114 power 10.24 0.5 -> 3.20000000 Inexact Rounded
+pwsx115 power 40.96 0.5 -> 6.40000000 Inexact Rounded
+
+-- Precision 1 squareroot tests [exhaustive, plus exponent adjusts]
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+precision: 1
+pwsx1201 power 0.1 0.5 -> 0.3 Inexact Rounded
+pwsx1202 power 0.01 0.5 -> 0.1 Inexact Rounded
+pwsx1203 power 1.0E-1 0.5 -> 0.3 Inexact Rounded
+pwsx1204 power 1.00E-2 0.5 -> 0.1 Inexact Rounded
+pwsx1205 power 1E-3 0.5 -> 0.03 Inexact Rounded
+pwsx1206 power 1E+1 0.5 -> 3 Inexact Rounded
+pwsx1207 power 1E+2 0.5 -> 1E+1 Inexact Rounded
+pwsx1208 power 1E+3 0.5 -> 3E+1 Inexact Rounded
+pwsx1209 power 0.2 0.5 -> 0.4 Inexact Rounded
+pwsx1210 power 0.02 0.5 -> 0.1 Inexact Rounded
+pwsx1211 power 2.0E-1 0.5 -> 0.4 Inexact Rounded
+pwsx1212 power 2.00E-2 0.5 -> 0.1 Inexact Rounded
+pwsx1213 power 2E-3 0.5 -> 0.04 Inexact Rounded
+pwsx1214 power 2E+1 0.5 -> 4 Inexact Rounded
+pwsx1215 power 2E+2 0.5 -> 1E+1 Inexact Rounded
+pwsx1216 power 2E+3 0.5 -> 4E+1 Inexact Rounded
+pwsx1217 power 0.3 0.5 -> 0.5 Inexact Rounded
+pwsx1218 power 0.03 0.5 -> 0.2 Inexact Rounded
+pwsx1219 power 3.0E-1 0.5 -> 0.5 Inexact Rounded
+pwsx1220 power 3.00E-2 0.5 -> 0.2 Inexact Rounded
+pwsx1221 power 3E-3 0.5 -> 0.05 Inexact Rounded
+pwsx1222 power 3E+1 0.5 -> 5 Inexact Rounded
+pwsx1223 power 3E+2 0.5 -> 2E+1 Inexact Rounded
+pwsx1224 power 3E+3 0.5 -> 5E+1 Inexact Rounded
+pwsx1225 power 0.4 0.5 -> 0.6 Inexact Rounded
+pwsx1226 power 0.04 0.5 -> 0.2 Inexact Rounded
+pwsx1227 power 4.0E-1 0.5 -> 0.6 Inexact Rounded
+pwsx1228 power 4.00E-2 0.5 -> 0.2 Inexact Rounded
+pwsx1229 power 4E-3 0.5 -> 0.06 Inexact Rounded
+pwsx1230 power 4E+1 0.5 -> 6 Inexact Rounded
+pwsx1231 power 4E+2 0.5 -> 2E+1 Inexact Rounded
+pwsx1232 power 4E+3 0.5 -> 6E+1 Inexact Rounded
+pwsx1233 power 0.5 0.5 -> 0.7 Inexact Rounded
+pwsx1234 power 0.05 0.5 -> 0.2 Inexact Rounded
+pwsx1235 power 5.0E-1 0.5 -> 0.7 Inexact Rounded
+pwsx1236 power 5.00E-2 0.5 -> 0.2 Inexact Rounded
+pwsx1237 power 5E-3 0.5 -> 0.07 Inexact Rounded
+pwsx1238 power 5E+1 0.5 -> 7 Inexact Rounded
+pwsx1239 power 5E+2 0.5 -> 2E+1 Inexact Rounded
+pwsx1240 power 5E+3 0.5 -> 7E+1 Inexact Rounded
+pwsx1241 power 0.6 0.5 -> 0.8 Inexact Rounded
+pwsx1242 power 0.06 0.5 -> 0.2 Inexact Rounded
+pwsx1243 power 6.0E-1 0.5 -> 0.8 Inexact Rounded
+pwsx1244 power 6.00E-2 0.5 -> 0.2 Inexact Rounded
+pwsx1245 power 6E-3 0.5 -> 0.08 Inexact Rounded
+pwsx1246 power 6E+1 0.5 -> 8 Inexact Rounded
+pwsx1247 power 6E+2 0.5 -> 2E+1 Inexact Rounded
+pwsx1248 power 6E+3 0.5 -> 8E+1 Inexact Rounded
+pwsx1249 power 0.7 0.5 -> 0.8 Inexact Rounded
+pwsx1250 power 0.07 0.5 -> 0.3 Inexact Rounded
+pwsx1251 power 7.0E-1 0.5 -> 0.8 Inexact Rounded
+pwsx1252 power 7.00E-2 0.5 -> 0.3 Inexact Rounded
+pwsx1253 power 7E-3 0.5 -> 0.08 Inexact Rounded
+pwsx1254 power 7E+1 0.5 -> 8 Inexact Rounded
+pwsx1255 power 7E+2 0.5 -> 3E+1 Inexact Rounded
+pwsx1256 power 7E+3 0.5 -> 8E+1 Inexact Rounded
+pwsx1257 power 0.8 0.5 -> 0.9 Inexact Rounded
+pwsx1258 power 0.08 0.5 -> 0.3 Inexact Rounded
+pwsx1259 power 8.0E-1 0.5 -> 0.9 Inexact Rounded
+pwsx1260 power 8.00E-2 0.5 -> 0.3 Inexact Rounded
+pwsx1261 power 8E-3 0.5 -> 0.09 Inexact Rounded
+pwsx1262 power 8E+1 0.5 -> 9 Inexact Rounded
+pwsx1263 power 8E+2 0.5 -> 3E+1 Inexact Rounded
+pwsx1264 power 8E+3 0.5 -> 9E+1 Inexact Rounded
+pwsx1265 power 0.9 0.5 -> 0.9 Inexact Rounded
+pwsx1266 power 0.09 0.5 -> 0.3 Inexact Rounded
+pwsx1267 power 9.0E-1 0.5 -> 0.9 Inexact Rounded
+pwsx1268 power 9.00E-2 0.5 -> 0.3 Inexact Rounded
+pwsx1269 power 9E-3 0.5 -> 0.09 Inexact Rounded
+pwsx1270 power 9E+1 0.5 -> 9 Inexact Rounded
+pwsx1271 power 9E+2 0.5 -> 3E+1 Inexact Rounded
+pwsx1272 power 9E+3 0.5 -> 9E+1 Inexact Rounded
+
+-- Precision 2 squareroot tests [exhaustive, plus exponent adjusts]
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+precision: 2
+pwsx2201 power 0.1 0.5 -> 0.32 Inexact Rounded
+pwsx2202 power 0.01 0.5 -> 0.10 Inexact Rounded
+pwsx2203 power 1.0E-1 0.5 -> 0.32 Inexact Rounded
+pwsx2204 power 1.00E-2 0.5 -> 0.10 Inexact Rounded
+pwsx2205 power 1E-3 0.5 -> 0.032 Inexact Rounded
+pwsx2206 power 1E+1 0.5 -> 3.2 Inexact Rounded
+pwsx2207 power 1E+2 0.5 -> 10 Inexact Rounded
+pwsx2208 power 1E+3 0.5 -> 32 Inexact Rounded
+pwsx2209 power 0.2 0.5 -> 0.45 Inexact Rounded
+pwsx2210 power 0.02 0.5 -> 0.14 Inexact Rounded
+pwsx2211 power 2.0E-1 0.5 -> 0.45 Inexact Rounded
+pwsx2212 power 2.00E-2 0.5 -> 0.14 Inexact Rounded
+pwsx2213 power 2E-3 0.5 -> 0.045 Inexact Rounded
+pwsx2214 power 2E+1 0.5 -> 4.5 Inexact Rounded
+pwsx2215 power 2E+2 0.5 -> 14 Inexact Rounded
+pwsx2216 power 2E+3 0.5 -> 45 Inexact Rounded
+pwsx2217 power 0.3 0.5 -> 0.55 Inexact Rounded
+pwsx2218 power 0.03 0.5 -> 0.17 Inexact Rounded
+pwsx2219 power 3.0E-1 0.5 -> 0.55 Inexact Rounded
+pwsx2220 power 3.00E-2 0.5 -> 0.17 Inexact Rounded
+pwsx2221 power 3E-3 0.5 -> 0.055 Inexact Rounded
+pwsx2222 power 3E+1 0.5 -> 5.5 Inexact Rounded
+pwsx2223 power 3E+2 0.5 -> 17 Inexact Rounded
+pwsx2224 power 3E+3 0.5 -> 55 Inexact Rounded
+pwsx2225 power 0.4 0.5 -> 0.63 Inexact Rounded
+pwsx2226 power 0.04 0.5 -> 0.20 Inexact Rounded
+pwsx2227 power 4.0E-1 0.5 -> 0.63 Inexact Rounded
+pwsx2228 power 4.00E-2 0.5 -> 0.20 Inexact Rounded
+pwsx2229 power 4E-3 0.5 -> 0.063 Inexact Rounded
+pwsx2230 power 4E+1 0.5 -> 6.3 Inexact Rounded
+pwsx2231 power 4E+2 0.5 -> 20 Inexact Rounded
+pwsx2232 power 4E+3 0.5 -> 63 Inexact Rounded
+pwsx2233 power 0.5 0.5 -> 0.71 Inexact Rounded
+pwsx2234 power 0.05 0.5 -> 0.22 Inexact Rounded
+pwsx2235 power 5.0E-1 0.5 -> 0.71 Inexact Rounded
+pwsx2236 power 5.00E-2 0.5 -> 0.22 Inexact Rounded
+pwsx2237 power 5E-3 0.5 -> 0.071 Inexact Rounded
+pwsx2238 power 5E+1 0.5 -> 7.1 Inexact Rounded
+pwsx2239 power 5E+2 0.5 -> 22 Inexact Rounded
+pwsx2240 power 5E+3 0.5 -> 71 Inexact Rounded
+pwsx2241 power 0.6 0.5 -> 0.77 Inexact Rounded
+pwsx2242 power 0.06 0.5 -> 0.24 Inexact Rounded
+pwsx2243 power 6.0E-1 0.5 -> 0.77 Inexact Rounded
+pwsx2244 power 6.00E-2 0.5 -> 0.24 Inexact Rounded
+pwsx2245 power 6E-3 0.5 -> 0.077 Inexact Rounded
+pwsx2246 power 6E+1 0.5 -> 7.7 Inexact Rounded
+pwsx2247 power 6E+2 0.5 -> 24 Inexact Rounded
+pwsx2248 power 6E+3 0.5 -> 77 Inexact Rounded
+pwsx2249 power 0.7 0.5 -> 0.84 Inexact Rounded
+pwsx2250 power 0.07 0.5 -> 0.26 Inexact Rounded
+pwsx2251 power 7.0E-1 0.5 -> 0.84 Inexact Rounded
+pwsx2252 power 7.00E-2 0.5 -> 0.26 Inexact Rounded
+pwsx2253 power 7E-3 0.5 -> 0.084 Inexact Rounded
+pwsx2254 power 7E+1 0.5 -> 8.4 Inexact Rounded
+pwsx2255 power 7E+2 0.5 -> 26 Inexact Rounded
+pwsx2256 power 7E+3 0.5 -> 84 Inexact Rounded
+pwsx2257 power 0.8 0.5 -> 0.89 Inexact Rounded
+pwsx2258 power 0.08 0.5 -> 0.28 Inexact Rounded
+pwsx2259 power 8.0E-1 0.5 -> 0.89 Inexact Rounded
+pwsx2260 power 8.00E-2 0.5 -> 0.28 Inexact Rounded
+pwsx2261 power 8E-3 0.5 -> 0.089 Inexact Rounded
+pwsx2262 power 8E+1 0.5 -> 8.9 Inexact Rounded
+pwsx2263 power 8E+2 0.5 -> 28 Inexact Rounded
+pwsx2264 power 8E+3 0.5 -> 89 Inexact Rounded
+pwsx2265 power 0.9 0.5 -> 0.95 Inexact Rounded
+pwsx2266 power 0.09 0.5 -> 0.30 Inexact Rounded
+pwsx2267 power 9.0E-1 0.5 -> 0.95 Inexact Rounded
+pwsx2268 power 9.00E-2 0.5 -> 0.30 Inexact Rounded
+pwsx2269 power 9E-3 0.5 -> 0.095 Inexact Rounded
+pwsx2270 power 9E+1 0.5 -> 9.5 Inexact Rounded
+pwsx2271 power 9E+2 0.5 -> 30 Inexact Rounded
+pwsx2272 power 9E+3 0.5 -> 95 Inexact Rounded
+pwsx2273 power 0.10 0.5 -> 0.32 Inexact Rounded
+pwsx2274 power 0.010 0.5 -> 0.10 Inexact Rounded
+pwsx2275 power 10.0E-1 0.5 -> 1.0 Inexact Rounded
+pwsx2276 power 10.00E-2 0.5 -> 0.32 Inexact Rounded
+pwsx2277 power 10E-3 0.5 -> 0.10 Inexact Rounded
+pwsx2278 power 10E+1 0.5 -> 10 Inexact Rounded
+pwsx2279 power 10E+2 0.5 -> 32 Inexact Rounded
+pwsx2280 power 10E+3 0.5 -> 1.0E+2 Inexact Rounded
+pwsx2281 power 0.11 0.5 -> 0.33 Inexact Rounded
+pwsx2282 power 0.011 0.5 -> 0.10 Inexact Rounded
+pwsx2283 power 11.0E-1 0.5 -> 1.0 Inexact Rounded
+pwsx2284 power 11.00E-2 0.5 -> 0.33 Inexact Rounded
+pwsx2285 power 11E-3 0.5 -> 0.10 Inexact Rounded
+pwsx2286 power 11E+1 0.5 -> 10 Inexact Rounded
+pwsx2287 power 11E+2 0.5 -> 33 Inexact Rounded
+pwsx2288 power 11E+3 0.5 -> 1.0E+2 Inexact Rounded
+pwsx2289 power 0.12 0.5 -> 0.35 Inexact Rounded
+pwsx2290 power 0.012 0.5 -> 0.11 Inexact Rounded
+pwsx2291 power 12.0E-1 0.5 -> 1.1 Inexact Rounded
+pwsx2292 power 12.00E-2 0.5 -> 0.35 Inexact Rounded
+pwsx2293 power 12E-3 0.5 -> 0.11 Inexact Rounded
+pwsx2294 power 12E+1 0.5 -> 11 Inexact Rounded
+pwsx2295 power 12E+2 0.5 -> 35 Inexact Rounded
+pwsx2296 power 12E+3 0.5 -> 1.1E+2 Inexact Rounded
+pwsx2297 power 0.13 0.5 -> 0.36 Inexact Rounded
+pwsx2298 power 0.013 0.5 -> 0.11 Inexact Rounded
+pwsx2299 power 13.0E-1 0.5 -> 1.1 Inexact Rounded
+pwsx2300 power 13.00E-2 0.5 -> 0.36 Inexact Rounded
+pwsx2301 power 13E-3 0.5 -> 0.11 Inexact Rounded
+pwsx2302 power 13E+1 0.5 -> 11 Inexact Rounded
+pwsx2303 power 13E+2 0.5 -> 36 Inexact Rounded
+pwsx2304 power 13E+3 0.5 -> 1.1E+2 Inexact Rounded
+pwsx2305 power 0.14 0.5 -> 0.37 Inexact Rounded
+pwsx2306 power 0.014 0.5 -> 0.12 Inexact Rounded
+pwsx2307 power 14.0E-1 0.5 -> 1.2 Inexact Rounded
+pwsx2308 power 14.00E-2 0.5 -> 0.37 Inexact Rounded
+pwsx2309 power 14E-3 0.5 -> 0.12 Inexact Rounded
+pwsx2310 power 14E+1 0.5 -> 12 Inexact Rounded
+pwsx2311 power 14E+2 0.5 -> 37 Inexact Rounded
+pwsx2312 power 14E+3 0.5 -> 1.2E+2 Inexact Rounded
+pwsx2313 power 0.15 0.5 -> 0.39 Inexact Rounded
+pwsx2314 power 0.015 0.5 -> 0.12 Inexact Rounded
+pwsx2315 power 15.0E-1 0.5 -> 1.2 Inexact Rounded
+pwsx2316 power 15.00E-2 0.5 -> 0.39 Inexact Rounded
+pwsx2317 power 15E-3 0.5 -> 0.12 Inexact Rounded
+pwsx2318 power 15E+1 0.5 -> 12 Inexact Rounded
+pwsx2319 power 15E+2 0.5 -> 39 Inexact Rounded
+pwsx2320 power 15E+3 0.5 -> 1.2E+2 Inexact Rounded
+pwsx2321 power 0.16 0.5 -> 0.40 Inexact Rounded
+pwsx2322 power 0.016 0.5 -> 0.13 Inexact Rounded
+pwsx2323 power 16.0E-1 0.5 -> 1.3 Inexact Rounded
+pwsx2324 power 16.00E-2 0.5 -> 0.40 Inexact Rounded
+pwsx2325 power 16E-3 0.5 -> 0.13 Inexact Rounded
+pwsx2326 power 16E+1 0.5 -> 13 Inexact Rounded
+pwsx2327 power 16E+2 0.5 -> 40 Inexact Rounded
+pwsx2328 power 16E+3 0.5 -> 1.3E+2 Inexact Rounded
+pwsx2329 power 0.17 0.5 -> 0.41 Inexact Rounded
+pwsx2330 power 0.017 0.5 -> 0.13 Inexact Rounded
+pwsx2331 power 17.0E-1 0.5 -> 1.3 Inexact Rounded
+pwsx2332 power 17.00E-2 0.5 -> 0.41 Inexact Rounded
+pwsx2333 power 17E-3 0.5 -> 0.13 Inexact Rounded
+pwsx2334 power 17E+1 0.5 -> 13 Inexact Rounded
+pwsx2335 power 17E+2 0.5 -> 41 Inexact Rounded
+pwsx2336 power 17E+3 0.5 -> 1.3E+2 Inexact Rounded
+pwsx2337 power 0.18 0.5 -> 0.42 Inexact Rounded
+pwsx2338 power 0.018 0.5 -> 0.13 Inexact Rounded
+pwsx2339 power 18.0E-1 0.5 -> 1.3 Inexact Rounded
+pwsx2340 power 18.00E-2 0.5 -> 0.42 Inexact Rounded
+pwsx2341 power 18E-3 0.5 -> 0.13 Inexact Rounded
+pwsx2342 power 18E+1 0.5 -> 13 Inexact Rounded
+pwsx2343 power 18E+2 0.5 -> 42 Inexact Rounded
+pwsx2344 power 18E+3 0.5 -> 1.3E+2 Inexact Rounded
+pwsx2345 power 0.19 0.5 -> 0.44 Inexact Rounded
+pwsx2346 power 0.019 0.5 -> 0.14 Inexact Rounded
+pwsx2347 power 19.0E-1 0.5 -> 1.4 Inexact Rounded
+pwsx2348 power 19.00E-2 0.5 -> 0.44 Inexact Rounded
+pwsx2349 power 19E-3 0.5 -> 0.14 Inexact Rounded
+pwsx2350 power 19E+1 0.5 -> 14 Inexact Rounded
+pwsx2351 power 19E+2 0.5 -> 44 Inexact Rounded
+pwsx2352 power 19E+3 0.5 -> 1.4E+2 Inexact Rounded
+pwsx2353 power 0.20 0.5 -> 0.45 Inexact Rounded
+pwsx2354 power 0.020 0.5 -> 0.14 Inexact Rounded
+pwsx2355 power 20.0E-1 0.5 -> 1.4 Inexact Rounded
+pwsx2356 power 20.00E-2 0.5 -> 0.45 Inexact Rounded
+pwsx2357 power 20E-3 0.5 -> 0.14 Inexact Rounded
+pwsx2358 power 20E+1 0.5 -> 14 Inexact Rounded
+pwsx2359 power 20E+2 0.5 -> 45 Inexact Rounded
+pwsx2360 power 20E+3 0.5 -> 1.4E+2 Inexact Rounded
+pwsx2361 power 0.21 0.5 -> 0.46 Inexact Rounded
+pwsx2362 power 0.021 0.5 -> 0.14 Inexact Rounded
+pwsx2363 power 21.0E-1 0.5 -> 1.4 Inexact Rounded
+pwsx2364 power 21.00E-2 0.5 -> 0.46 Inexact Rounded
+pwsx2365 power 21E-3 0.5 -> 0.14 Inexact Rounded
+pwsx2366 power 21E+1 0.5 -> 14 Inexact Rounded
+pwsx2367 power 21E+2 0.5 -> 46 Inexact Rounded
+pwsx2368 power 21E+3 0.5 -> 1.4E+2 Inexact Rounded
+pwsx2369 power 0.22 0.5 -> 0.47 Inexact Rounded
+pwsx2370 power 0.022 0.5 -> 0.15 Inexact Rounded
+pwsx2371 power 22.0E-1 0.5 -> 1.5 Inexact Rounded
+pwsx2372 power 22.00E-2 0.5 -> 0.47 Inexact Rounded
+pwsx2373 power 22E-3 0.5 -> 0.15 Inexact Rounded
+pwsx2374 power 22E+1 0.5 -> 15 Inexact Rounded
+pwsx2375 power 22E+2 0.5 -> 47 Inexact Rounded
+pwsx2376 power 22E+3 0.5 -> 1.5E+2 Inexact Rounded
+pwsx2377 power 0.23 0.5 -> 0.48 Inexact Rounded
+pwsx2378 power 0.023 0.5 -> 0.15 Inexact Rounded
+pwsx2379 power 23.0E-1 0.5 -> 1.5 Inexact Rounded
+pwsx2380 power 23.00E-2 0.5 -> 0.48 Inexact Rounded
+pwsx2381 power 23E-3 0.5 -> 0.15 Inexact Rounded
+pwsx2382 power 23E+1 0.5 -> 15 Inexact Rounded
+pwsx2383 power 23E+2 0.5 -> 48 Inexact Rounded
+pwsx2384 power 23E+3 0.5 -> 1.5E+2 Inexact Rounded
+pwsx2385 power 0.24 0.5 -> 0.49 Inexact Rounded
+pwsx2386 power 0.024 0.5 -> 0.15 Inexact Rounded
+pwsx2387 power 24.0E-1 0.5 -> 1.5 Inexact Rounded
+pwsx2388 power 24.00E-2 0.5 -> 0.49 Inexact Rounded
+pwsx2389 power 24E-3 0.5 -> 0.15 Inexact Rounded
+pwsx2390 power 24E+1 0.5 -> 15 Inexact Rounded
+pwsx2391 power 24E+2 0.5 -> 49 Inexact Rounded
+pwsx2392 power 24E+3 0.5 -> 1.5E+2 Inexact Rounded
+pwsx2393 power 0.25 0.5 -> 0.50 Inexact Rounded
+pwsx2394 power 0.025 0.5 -> 0.16 Inexact Rounded
+pwsx2395 power 25.0E-1 0.5 -> 1.6 Inexact Rounded
+pwsx2396 power 25.00E-2 0.5 -> 0.50 Inexact Rounded
+pwsx2397 power 25E-3 0.5 -> 0.16 Inexact Rounded
+pwsx2398 power 25E+1 0.5 -> 16 Inexact Rounded
+pwsx2399 power 25E+2 0.5 -> 50 Inexact Rounded
+pwsx2400 power 25E+3 0.5 -> 1.6E+2 Inexact Rounded
+pwsx2401 power 0.26 0.5 -> 0.51 Inexact Rounded
+pwsx2402 power 0.026 0.5 -> 0.16 Inexact Rounded
+pwsx2403 power 26.0E-1 0.5 -> 1.6 Inexact Rounded
+pwsx2404 power 26.00E-2 0.5 -> 0.51 Inexact Rounded
+pwsx2405 power 26E-3 0.5 -> 0.16 Inexact Rounded
+pwsx2406 power 26E+1 0.5 -> 16 Inexact Rounded
+pwsx2407 power 26E+2 0.5 -> 51 Inexact Rounded
+pwsx2408 power 26E+3 0.5 -> 1.6E+2 Inexact Rounded
+pwsx2409 power 0.27 0.5 -> 0.52 Inexact Rounded
+pwsx2410 power 0.027 0.5 -> 0.16 Inexact Rounded
+pwsx2411 power 27.0E-1 0.5 -> 1.6 Inexact Rounded
+pwsx2412 power 27.00E-2 0.5 -> 0.52 Inexact Rounded
+pwsx2413 power 27E-3 0.5 -> 0.16 Inexact Rounded
+pwsx2414 power 27E+1 0.5 -> 16 Inexact Rounded
+pwsx2415 power 27E+2 0.5 -> 52 Inexact Rounded
+pwsx2416 power 27E+3 0.5 -> 1.6E+2 Inexact Rounded
+pwsx2417 power 0.28 0.5 -> 0.53 Inexact Rounded
+pwsx2418 power 0.028 0.5 -> 0.17 Inexact Rounded
+pwsx2419 power 28.0E-1 0.5 -> 1.7 Inexact Rounded
+pwsx2420 power 28.00E-2 0.5 -> 0.53 Inexact Rounded
+pwsx2421 power 28E-3 0.5 -> 0.17 Inexact Rounded
+pwsx2422 power 28E+1 0.5 -> 17 Inexact Rounded
+pwsx2423 power 28E+2 0.5 -> 53 Inexact Rounded
+pwsx2424 power 28E+3 0.5 -> 1.7E+2 Inexact Rounded
+pwsx2425 power 0.29 0.5 -> 0.54 Inexact Rounded
+pwsx2426 power 0.029 0.5 -> 0.17 Inexact Rounded
+pwsx2427 power 29.0E-1 0.5 -> 1.7 Inexact Rounded
+pwsx2428 power 29.00E-2 0.5 -> 0.54 Inexact Rounded
+pwsx2429 power 29E-3 0.5 -> 0.17 Inexact Rounded
+pwsx2430 power 29E+1 0.5 -> 17 Inexact Rounded
+pwsx2431 power 29E+2 0.5 -> 54 Inexact Rounded
+pwsx2432 power 29E+3 0.5 -> 1.7E+2 Inexact Rounded
+pwsx2433 power 0.30 0.5 -> 0.55 Inexact Rounded
+pwsx2434 power 0.030 0.5 -> 0.17 Inexact Rounded
+pwsx2435 power 30.0E-1 0.5 -> 1.7 Inexact Rounded
+pwsx2436 power 30.00E-2 0.5 -> 0.55 Inexact Rounded
+pwsx2437 power 30E-3 0.5 -> 0.17 Inexact Rounded
+pwsx2438 power 30E+1 0.5 -> 17 Inexact Rounded
+pwsx2439 power 30E+2 0.5 -> 55 Inexact Rounded
+pwsx2440 power 30E+3 0.5 -> 1.7E+2 Inexact Rounded
+pwsx2441 power 0.31 0.5 -> 0.56 Inexact Rounded
+pwsx2442 power 0.031 0.5 -> 0.18 Inexact Rounded
+pwsx2443 power 31.0E-1 0.5 -> 1.8 Inexact Rounded
+pwsx2444 power 31.00E-2 0.5 -> 0.56 Inexact Rounded
+pwsx2445 power 31E-3 0.5 -> 0.18 Inexact Rounded
+pwsx2446 power 31E+1 0.5 -> 18 Inexact Rounded
+pwsx2447 power 31E+2 0.5 -> 56 Inexact Rounded
+pwsx2448 power 31E+3 0.5 -> 1.8E+2 Inexact Rounded
+pwsx2449 power 0.32 0.5 -> 0.57 Inexact Rounded
+pwsx2450 power 0.032 0.5 -> 0.18 Inexact Rounded
+pwsx2451 power 32.0E-1 0.5 -> 1.8 Inexact Rounded
+pwsx2452 power 32.00E-2 0.5 -> 0.57 Inexact Rounded
+pwsx2453 power 32E-3 0.5 -> 0.18 Inexact Rounded
+pwsx2454 power 32E+1 0.5 -> 18 Inexact Rounded
+pwsx2455 power 32E+2 0.5 -> 57 Inexact Rounded
+pwsx2456 power 32E+3 0.5 -> 1.8E+2 Inexact Rounded
+pwsx2457 power 0.33 0.5 -> 0.57 Inexact Rounded
+pwsx2458 power 0.033 0.5 -> 0.18 Inexact Rounded
+pwsx2459 power 33.0E-1 0.5 -> 1.8 Inexact Rounded
+pwsx2460 power 33.00E-2 0.5 -> 0.57 Inexact Rounded
+pwsx2461 power 33E-3 0.5 -> 0.18 Inexact Rounded
+pwsx2462 power 33E+1 0.5 -> 18 Inexact Rounded
+pwsx2463 power 33E+2 0.5 -> 57 Inexact Rounded
+pwsx2464 power 33E+3 0.5 -> 1.8E+2 Inexact Rounded
+pwsx2465 power 0.34 0.5 -> 0.58 Inexact Rounded
+pwsx2466 power 0.034 0.5 -> 0.18 Inexact Rounded
+pwsx2467 power 34.0E-1 0.5 -> 1.8 Inexact Rounded
+pwsx2468 power 34.00E-2 0.5 -> 0.58 Inexact Rounded
+pwsx2469 power 34E-3 0.5 -> 0.18 Inexact Rounded
+pwsx2470 power 34E+1 0.5 -> 18 Inexact Rounded
+pwsx2471 power 34E+2 0.5 -> 58 Inexact Rounded
+pwsx2472 power 34E+3 0.5 -> 1.8E+2 Inexact Rounded
+pwsx2473 power 0.35 0.5 -> 0.59 Inexact Rounded
+pwsx2474 power 0.035 0.5 -> 0.19 Inexact Rounded
+pwsx2475 power 35.0E-1 0.5 -> 1.9 Inexact Rounded
+pwsx2476 power 35.00E-2 0.5 -> 0.59 Inexact Rounded
+pwsx2477 power 35E-3 0.5 -> 0.19 Inexact Rounded
+pwsx2478 power 35E+1 0.5 -> 19 Inexact Rounded
+pwsx2479 power 35E+2 0.5 -> 59 Inexact Rounded
+pwsx2480 power 35E+3 0.5 -> 1.9E+2 Inexact Rounded
+pwsx2481 power 0.36 0.5 -> 0.60 Inexact Rounded
+pwsx2482 power 0.036 0.5 -> 0.19 Inexact Rounded
+pwsx2483 power 36.0E-1 0.5 -> 1.9 Inexact Rounded
+pwsx2484 power 36.00E-2 0.5 -> 0.60 Inexact Rounded
+pwsx2485 power 36E-3 0.5 -> 0.19 Inexact Rounded
+pwsx2486 power 36E+1 0.5 -> 19 Inexact Rounded
+pwsx2487 power 36E+2 0.5 -> 60 Inexact Rounded
+pwsx2488 power 36E+3 0.5 -> 1.9E+2 Inexact Rounded
+pwsx2489 power 0.37 0.5 -> 0.61 Inexact Rounded
+pwsx2490 power 0.037 0.5 -> 0.19 Inexact Rounded
+pwsx2491 power 37.0E-1 0.5 -> 1.9 Inexact Rounded
+pwsx2492 power 37.00E-2 0.5 -> 0.61 Inexact Rounded
+pwsx2493 power 37E-3 0.5 -> 0.19 Inexact Rounded
+pwsx2494 power 37E+1 0.5 -> 19 Inexact Rounded
+pwsx2495 power 37E+2 0.5 -> 61 Inexact Rounded
+pwsx2496 power 37E+3 0.5 -> 1.9E+2 Inexact Rounded
+pwsx2497 power 0.38 0.5 -> 0.62 Inexact Rounded
+pwsx2498 power 0.038 0.5 -> 0.19 Inexact Rounded
+pwsx2499 power 38.0E-1 0.5 -> 1.9 Inexact Rounded
+pwsx2500 power 38.00E-2 0.5 -> 0.62 Inexact Rounded
+pwsx2501 power 38E-3 0.5 -> 0.19 Inexact Rounded
+pwsx2502 power 38E+1 0.5 -> 19 Inexact Rounded
+pwsx2503 power 38E+2 0.5 -> 62 Inexact Rounded
+pwsx2504 power 38E+3 0.5 -> 1.9E+2 Inexact Rounded
+pwsx2505 power 0.39 0.5 -> 0.62 Inexact Rounded
+pwsx2506 power 0.039 0.5 -> 0.20 Inexact Rounded
+pwsx2507 power 39.0E-1 0.5 -> 2.0 Inexact Rounded
+pwsx2508 power 39.00E-2 0.5 -> 0.62 Inexact Rounded
+pwsx2509 power 39E-3 0.5 -> 0.20 Inexact Rounded
+pwsx2510 power 39E+1 0.5 -> 20 Inexact Rounded
+pwsx2511 power 39E+2 0.5 -> 62 Inexact Rounded
+pwsx2512 power 39E+3 0.5 -> 2.0E+2 Inexact Rounded
+pwsx2513 power 0.40 0.5 -> 0.63 Inexact Rounded
+pwsx2514 power 0.040 0.5 -> 0.20 Inexact Rounded
+pwsx2515 power 40.0E-1 0.5 -> 2.0 Inexact Rounded
+pwsx2516 power 40.00E-2 0.5 -> 0.63 Inexact Rounded
+pwsx2517 power 40E-3 0.5 -> 0.20 Inexact Rounded
+pwsx2518 power 40E+1 0.5 -> 20 Inexact Rounded
+pwsx2519 power 40E+2 0.5 -> 63 Inexact Rounded
+pwsx2520 power 40E+3 0.5 -> 2.0E+2 Inexact Rounded
+pwsx2521 power 0.41 0.5 -> 0.64 Inexact Rounded
+pwsx2522 power 0.041 0.5 -> 0.20 Inexact Rounded
+pwsx2523 power 41.0E-1 0.5 -> 2.0 Inexact Rounded
+pwsx2524 power 41.00E-2 0.5 -> 0.64 Inexact Rounded
+pwsx2525 power 41E-3 0.5 -> 0.20 Inexact Rounded
+pwsx2526 power 41E+1 0.5 -> 20 Inexact Rounded
+pwsx2527 power 41E+2 0.5 -> 64 Inexact Rounded
+pwsx2528 power 41E+3 0.5 -> 2.0E+2 Inexact Rounded
+pwsx2529 power 0.42 0.5 -> 0.65 Inexact Rounded
+pwsx2530 power 0.042 0.5 -> 0.20 Inexact Rounded
+pwsx2531 power 42.0E-1 0.5 -> 2.0 Inexact Rounded
+pwsx2532 power 42.00E-2 0.5 -> 0.65 Inexact Rounded
+pwsx2533 power 42E-3 0.5 -> 0.20 Inexact Rounded
+pwsx2534 power 42E+1 0.5 -> 20 Inexact Rounded
+pwsx2535 power 42E+2 0.5 -> 65 Inexact Rounded
+pwsx2536 power 42E+3 0.5 -> 2.0E+2 Inexact Rounded
+pwsx2537 power 0.43 0.5 -> 0.66 Inexact Rounded
+pwsx2538 power 0.043 0.5 -> 0.21 Inexact Rounded
+pwsx2539 power 43.0E-1 0.5 -> 2.1 Inexact Rounded
+pwsx2540 power 43.00E-2 0.5 -> 0.66 Inexact Rounded
+pwsx2541 power 43E-3 0.5 -> 0.21 Inexact Rounded
+pwsx2542 power 43E+1 0.5 -> 21 Inexact Rounded
+pwsx2543 power 43E+2 0.5 -> 66 Inexact Rounded
+pwsx2544 power 43E+3 0.5 -> 2.1E+2 Inexact Rounded
+pwsx2545 power 0.44 0.5 -> 0.66 Inexact Rounded
+pwsx2546 power 0.044 0.5 -> 0.21 Inexact Rounded
+pwsx2547 power 44.0E-1 0.5 -> 2.1 Inexact Rounded
+pwsx2548 power 44.00E-2 0.5 -> 0.66 Inexact Rounded
+pwsx2549 power 44E-3 0.5 -> 0.21 Inexact Rounded
+pwsx2550 power 44E+1 0.5 -> 21 Inexact Rounded
+pwsx2551 power 44E+2 0.5 -> 66 Inexact Rounded
+pwsx2552 power 44E+3 0.5 -> 2.1E+2 Inexact Rounded
+pwsx2553 power 0.45 0.5 -> 0.67 Inexact Rounded
+pwsx2554 power 0.045 0.5 -> 0.21 Inexact Rounded
+pwsx2555 power 45.0E-1 0.5 -> 2.1 Inexact Rounded
+pwsx2556 power 45.00E-2 0.5 -> 0.67 Inexact Rounded
+pwsx2557 power 45E-3 0.5 -> 0.21 Inexact Rounded
+pwsx2558 power 45E+1 0.5 -> 21 Inexact Rounded
+pwsx2559 power 45E+2 0.5 -> 67 Inexact Rounded
+pwsx2560 power 45E+3 0.5 -> 2.1E+2 Inexact Rounded
+pwsx2561 power 0.46 0.5 -> 0.68 Inexact Rounded
+pwsx2562 power 0.046 0.5 -> 0.21 Inexact Rounded
+pwsx2563 power 46.0E-1 0.5 -> 2.1 Inexact Rounded
+pwsx2564 power 46.00E-2 0.5 -> 0.68 Inexact Rounded
+pwsx2565 power 46E-3 0.5 -> 0.21 Inexact Rounded
+pwsx2566 power 46E+1 0.5 -> 21 Inexact Rounded
+pwsx2567 power 46E+2 0.5 -> 68 Inexact Rounded
+pwsx2568 power 46E+3 0.5 -> 2.1E+2 Inexact Rounded
+pwsx2569 power 0.47 0.5 -> 0.69 Inexact Rounded
+pwsx2570 power 0.047 0.5 -> 0.22 Inexact Rounded
+pwsx2571 power 47.0E-1 0.5 -> 2.2 Inexact Rounded
+pwsx2572 power 47.00E-2 0.5 -> 0.69 Inexact Rounded
+pwsx2573 power 47E-3 0.5 -> 0.22 Inexact Rounded
+pwsx2574 power 47E+1 0.5 -> 22 Inexact Rounded
+pwsx2575 power 47E+2 0.5 -> 69 Inexact Rounded
+pwsx2576 power 47E+3 0.5 -> 2.2E+2 Inexact Rounded
+pwsx2577 power 0.48 0.5 -> 0.69 Inexact Rounded
+pwsx2578 power 0.048 0.5 -> 0.22 Inexact Rounded
+pwsx2579 power 48.0E-1 0.5 -> 2.2 Inexact Rounded
+pwsx2580 power 48.00E-2 0.5 -> 0.69 Inexact Rounded
+pwsx2581 power 48E-3 0.5 -> 0.22 Inexact Rounded
+pwsx2582 power 48E+1 0.5 -> 22 Inexact Rounded
+pwsx2583 power 48E+2 0.5 -> 69 Inexact Rounded
+pwsx2584 power 48E+3 0.5 -> 2.2E+2 Inexact Rounded
+pwsx2585 power 0.49 0.5 -> 0.70 Inexact Rounded
+pwsx2586 power 0.049 0.5 -> 0.22 Inexact Rounded
+pwsx2587 power 49.0E-1 0.5 -> 2.2 Inexact Rounded
+pwsx2588 power 49.00E-2 0.5 -> 0.70 Inexact Rounded
+pwsx2589 power 49E-3 0.5 -> 0.22 Inexact Rounded
+pwsx2590 power 49E+1 0.5 -> 22 Inexact Rounded
+pwsx2591 power 49E+2 0.5 -> 70 Inexact Rounded
+pwsx2592 power 49E+3 0.5 -> 2.2E+2 Inexact Rounded
+pwsx2593 power 0.50 0.5 -> 0.71 Inexact Rounded
+pwsx2594 power 0.050 0.5 -> 0.22 Inexact Rounded
+pwsx2595 power 50.0E-1 0.5 -> 2.2 Inexact Rounded
+pwsx2596 power 50.00E-2 0.5 -> 0.71 Inexact Rounded
+pwsx2597 power 50E-3 0.5 -> 0.22 Inexact Rounded
+pwsx2598 power 50E+1 0.5 -> 22 Inexact Rounded
+pwsx2599 power 50E+2 0.5 -> 71 Inexact Rounded
+pwsx2600 power 50E+3 0.5 -> 2.2E+2 Inexact Rounded
+pwsx2601 power 0.51 0.5 -> 0.71 Inexact Rounded
+pwsx2602 power 0.051 0.5 -> 0.23 Inexact Rounded
+pwsx2603 power 51.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2604 power 51.00E-2 0.5 -> 0.71 Inexact Rounded
+pwsx2605 power 51E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2606 power 51E+1 0.5 -> 23 Inexact Rounded
+pwsx2607 power 51E+2 0.5 -> 71 Inexact Rounded
+pwsx2608 power 51E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2609 power 0.52 0.5 -> 0.72 Inexact Rounded
+pwsx2610 power 0.052 0.5 -> 0.23 Inexact Rounded
+pwsx2611 power 52.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2612 power 52.00E-2 0.5 -> 0.72 Inexact Rounded
+pwsx2613 power 52E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2614 power 52E+1 0.5 -> 23 Inexact Rounded
+pwsx2615 power 52E+2 0.5 -> 72 Inexact Rounded
+pwsx2616 power 52E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2617 power 0.53 0.5 -> 0.73 Inexact Rounded
+pwsx2618 power 0.053 0.5 -> 0.23 Inexact Rounded
+pwsx2619 power 53.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2620 power 53.00E-2 0.5 -> 0.73 Inexact Rounded
+pwsx2621 power 53E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2622 power 53E+1 0.5 -> 23 Inexact Rounded
+pwsx2623 power 53E+2 0.5 -> 73 Inexact Rounded
+pwsx2624 power 53E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2625 power 0.54 0.5 -> 0.73 Inexact Rounded
+pwsx2626 power 0.054 0.5 -> 0.23 Inexact Rounded
+pwsx2627 power 54.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2628 power 54.00E-2 0.5 -> 0.73 Inexact Rounded
+pwsx2629 power 54E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2630 power 54E+1 0.5 -> 23 Inexact Rounded
+pwsx2631 power 54E+2 0.5 -> 73 Inexact Rounded
+pwsx2632 power 54E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2633 power 0.55 0.5 -> 0.74 Inexact Rounded
+pwsx2634 power 0.055 0.5 -> 0.23 Inexact Rounded
+pwsx2635 power 55.0E-1 0.5 -> 2.3 Inexact Rounded
+pwsx2636 power 55.00E-2 0.5 -> 0.74 Inexact Rounded
+pwsx2637 power 55E-3 0.5 -> 0.23 Inexact Rounded
+pwsx2638 power 55E+1 0.5 -> 23 Inexact Rounded
+pwsx2639 power 55E+2 0.5 -> 74 Inexact Rounded
+pwsx2640 power 55E+3 0.5 -> 2.3E+2 Inexact Rounded
+pwsx2641 power 0.56 0.5 -> 0.75 Inexact Rounded
+pwsx2642 power 0.056 0.5 -> 0.24 Inexact Rounded
+pwsx2643 power 56.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2644 power 56.00E-2 0.5 -> 0.75 Inexact Rounded
+pwsx2645 power 56E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2646 power 56E+1 0.5 -> 24 Inexact Rounded
+pwsx2647 power 56E+2 0.5 -> 75 Inexact Rounded
+pwsx2648 power 56E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2649 power 0.57 0.5 -> 0.75 Inexact Rounded
+pwsx2650 power 0.057 0.5 -> 0.24 Inexact Rounded
+pwsx2651 power 57.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2652 power 57.00E-2 0.5 -> 0.75 Inexact Rounded
+pwsx2653 power 57E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2654 power 57E+1 0.5 -> 24 Inexact Rounded
+pwsx2655 power 57E+2 0.5 -> 75 Inexact Rounded
+pwsx2656 power 57E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2657 power 0.58 0.5 -> 0.76 Inexact Rounded
+pwsx2658 power 0.058 0.5 -> 0.24 Inexact Rounded
+pwsx2659 power 58.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2660 power 58.00E-2 0.5 -> 0.76 Inexact Rounded
+pwsx2661 power 58E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2662 power 58E+1 0.5 -> 24 Inexact Rounded
+pwsx2663 power 58E+2 0.5 -> 76 Inexact Rounded
+pwsx2664 power 58E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2665 power 0.59 0.5 -> 0.77 Inexact Rounded
+pwsx2666 power 0.059 0.5 -> 0.24 Inexact Rounded
+pwsx2667 power 59.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2668 power 59.00E-2 0.5 -> 0.77 Inexact Rounded
+pwsx2669 power 59E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2670 power 59E+1 0.5 -> 24 Inexact Rounded
+pwsx2671 power 59E+2 0.5 -> 77 Inexact Rounded
+pwsx2672 power 59E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2673 power 0.60 0.5 -> 0.77 Inexact Rounded
+pwsx2674 power 0.060 0.5 -> 0.24 Inexact Rounded
+pwsx2675 power 60.0E-1 0.5 -> 2.4 Inexact Rounded
+pwsx2676 power 60.00E-2 0.5 -> 0.77 Inexact Rounded
+pwsx2677 power 60E-3 0.5 -> 0.24 Inexact Rounded
+pwsx2678 power 60E+1 0.5 -> 24 Inexact Rounded
+pwsx2679 power 60E+2 0.5 -> 77 Inexact Rounded
+pwsx2680 power 60E+3 0.5 -> 2.4E+2 Inexact Rounded
+pwsx2681 power 0.61 0.5 -> 0.78 Inexact Rounded
+pwsx2682 power 0.061 0.5 -> 0.25 Inexact Rounded
+pwsx2683 power 61.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2684 power 61.00E-2 0.5 -> 0.78 Inexact Rounded
+pwsx2685 power 61E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2686 power 61E+1 0.5 -> 25 Inexact Rounded
+pwsx2687 power 61E+2 0.5 -> 78 Inexact Rounded
+pwsx2688 power 61E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2689 power 0.62 0.5 -> 0.79 Inexact Rounded
+pwsx2690 power 0.062 0.5 -> 0.25 Inexact Rounded
+pwsx2691 power 62.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2692 power 62.00E-2 0.5 -> 0.79 Inexact Rounded
+pwsx2693 power 62E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2694 power 62E+1 0.5 -> 25 Inexact Rounded
+pwsx2695 power 62E+2 0.5 -> 79 Inexact Rounded
+pwsx2696 power 62E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2697 power 0.63 0.5 -> 0.79 Inexact Rounded
+pwsx2698 power 0.063 0.5 -> 0.25 Inexact Rounded
+pwsx2699 power 63.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2700 power 63.00E-2 0.5 -> 0.79 Inexact Rounded
+pwsx2701 power 63E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2702 power 63E+1 0.5 -> 25 Inexact Rounded
+pwsx2703 power 63E+2 0.5 -> 79 Inexact Rounded
+pwsx2704 power 63E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2705 power 0.64 0.5 -> 0.80 Inexact Rounded
+pwsx2706 power 0.064 0.5 -> 0.25 Inexact Rounded
+pwsx2707 power 64.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2708 power 64.00E-2 0.5 -> 0.80 Inexact Rounded
+pwsx2709 power 64E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2710 power 64E+1 0.5 -> 25 Inexact Rounded
+pwsx2711 power 64E+2 0.5 -> 80 Inexact Rounded
+pwsx2712 power 64E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2713 power 0.65 0.5 -> 0.81 Inexact Rounded
+pwsx2714 power 0.065 0.5 -> 0.25 Inexact Rounded
+pwsx2715 power 65.0E-1 0.5 -> 2.5 Inexact Rounded
+pwsx2716 power 65.00E-2 0.5 -> 0.81 Inexact Rounded
+pwsx2717 power 65E-3 0.5 -> 0.25 Inexact Rounded
+pwsx2718 power 65E+1 0.5 -> 25 Inexact Rounded
+pwsx2719 power 65E+2 0.5 -> 81 Inexact Rounded
+pwsx2720 power 65E+3 0.5 -> 2.5E+2 Inexact Rounded
+pwsx2721 power 0.66 0.5 -> 0.81 Inexact Rounded
+pwsx2722 power 0.066 0.5 -> 0.26 Inexact Rounded
+pwsx2723 power 66.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2724 power 66.00E-2 0.5 -> 0.81 Inexact Rounded
+pwsx2725 power 66E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2726 power 66E+1 0.5 -> 26 Inexact Rounded
+pwsx2727 power 66E+2 0.5 -> 81 Inexact Rounded
+pwsx2728 power 66E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2729 power 0.67 0.5 -> 0.82 Inexact Rounded
+pwsx2730 power 0.067 0.5 -> 0.26 Inexact Rounded
+pwsx2731 power 67.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2732 power 67.00E-2 0.5 -> 0.82 Inexact Rounded
+pwsx2733 power 67E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2734 power 67E+1 0.5 -> 26 Inexact Rounded
+pwsx2735 power 67E+2 0.5 -> 82 Inexact Rounded
+pwsx2736 power 67E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2737 power 0.68 0.5 -> 0.82 Inexact Rounded
+pwsx2738 power 0.068 0.5 -> 0.26 Inexact Rounded
+pwsx2739 power 68.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2740 power 68.00E-2 0.5 -> 0.82 Inexact Rounded
+pwsx2741 power 68E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2742 power 68E+1 0.5 -> 26 Inexact Rounded
+pwsx2743 power 68E+2 0.5 -> 82 Inexact Rounded
+pwsx2744 power 68E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2745 power 0.69 0.5 -> 0.83 Inexact Rounded
+pwsx2746 power 0.069 0.5 -> 0.26 Inexact Rounded
+pwsx2747 power 69.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2748 power 69.00E-2 0.5 -> 0.83 Inexact Rounded
+pwsx2749 power 69E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2750 power 69E+1 0.5 -> 26 Inexact Rounded
+pwsx2751 power 69E+2 0.5 -> 83 Inexact Rounded
+pwsx2752 power 69E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2753 power 0.70 0.5 -> 0.84 Inexact Rounded
+pwsx2754 power 0.070 0.5 -> 0.26 Inexact Rounded
+pwsx2755 power 70.0E-1 0.5 -> 2.6 Inexact Rounded
+pwsx2756 power 70.00E-2 0.5 -> 0.84 Inexact Rounded
+pwsx2757 power 70E-3 0.5 -> 0.26 Inexact Rounded
+pwsx2758 power 70E+1 0.5 -> 26 Inexact Rounded
+pwsx2759 power 70E+2 0.5 -> 84 Inexact Rounded
+pwsx2760 power 70E+3 0.5 -> 2.6E+2 Inexact Rounded
+pwsx2761 power 0.71 0.5 -> 0.84 Inexact Rounded
+pwsx2762 power 0.071 0.5 -> 0.27 Inexact Rounded
+pwsx2763 power 71.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2764 power 71.00E-2 0.5 -> 0.84 Inexact Rounded
+pwsx2765 power 71E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2766 power 71E+1 0.5 -> 27 Inexact Rounded
+pwsx2767 power 71E+2 0.5 -> 84 Inexact Rounded
+pwsx2768 power 71E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2769 power 0.72 0.5 -> 0.85 Inexact Rounded
+pwsx2770 power 0.072 0.5 -> 0.27 Inexact Rounded
+pwsx2771 power 72.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2772 power 72.00E-2 0.5 -> 0.85 Inexact Rounded
+pwsx2773 power 72E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2774 power 72E+1 0.5 -> 27 Inexact Rounded
+pwsx2775 power 72E+2 0.5 -> 85 Inexact Rounded
+pwsx2776 power 72E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2777 power 0.73 0.5 -> 0.85 Inexact Rounded
+pwsx2778 power 0.073 0.5 -> 0.27 Inexact Rounded
+pwsx2779 power 73.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2780 power 73.00E-2 0.5 -> 0.85 Inexact Rounded
+pwsx2781 power 73E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2782 power 73E+1 0.5 -> 27 Inexact Rounded
+pwsx2783 power 73E+2 0.5 -> 85 Inexact Rounded
+pwsx2784 power 73E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2785 power 0.74 0.5 -> 0.86 Inexact Rounded
+pwsx2786 power 0.074 0.5 -> 0.27 Inexact Rounded
+pwsx2787 power 74.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2788 power 74.00E-2 0.5 -> 0.86 Inexact Rounded
+pwsx2789 power 74E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2790 power 74E+1 0.5 -> 27 Inexact Rounded
+pwsx2791 power 74E+2 0.5 -> 86 Inexact Rounded
+pwsx2792 power 74E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2793 power 0.75 0.5 -> 0.87 Inexact Rounded
+pwsx2794 power 0.075 0.5 -> 0.27 Inexact Rounded
+pwsx2795 power 75.0E-1 0.5 -> 2.7 Inexact Rounded
+pwsx2796 power 75.00E-2 0.5 -> 0.87 Inexact Rounded
+pwsx2797 power 75E-3 0.5 -> 0.27 Inexact Rounded
+pwsx2798 power 75E+1 0.5 -> 27 Inexact Rounded
+pwsx2799 power 75E+2 0.5 -> 87 Inexact Rounded
+pwsx2800 power 75E+3 0.5 -> 2.7E+2 Inexact Rounded
+pwsx2801 power 0.76 0.5 -> 0.87 Inexact Rounded
+pwsx2802 power 0.076 0.5 -> 0.28 Inexact Rounded
+pwsx2803 power 76.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2804 power 76.00E-2 0.5 -> 0.87 Inexact Rounded
+pwsx2805 power 76E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2806 power 76E+1 0.5 -> 28 Inexact Rounded
+pwsx2807 power 76E+2 0.5 -> 87 Inexact Rounded
+pwsx2808 power 76E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2809 power 0.77 0.5 -> 0.88 Inexact Rounded
+pwsx2810 power 0.077 0.5 -> 0.28 Inexact Rounded
+pwsx2811 power 77.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2812 power 77.00E-2 0.5 -> 0.88 Inexact Rounded
+pwsx2813 power 77E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2814 power 77E+1 0.5 -> 28 Inexact Rounded
+pwsx2815 power 77E+2 0.5 -> 88 Inexact Rounded
+pwsx2816 power 77E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2817 power 0.78 0.5 -> 0.88 Inexact Rounded
+pwsx2818 power 0.078 0.5 -> 0.28 Inexact Rounded
+pwsx2819 power 78.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2820 power 78.00E-2 0.5 -> 0.88 Inexact Rounded
+pwsx2821 power 78E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2822 power 78E+1 0.5 -> 28 Inexact Rounded
+pwsx2823 power 78E+2 0.5 -> 88 Inexact Rounded
+pwsx2824 power 78E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2825 power 0.79 0.5 -> 0.89 Inexact Rounded
+pwsx2826 power 0.079 0.5 -> 0.28 Inexact Rounded
+pwsx2827 power 79.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2828 power 79.00E-2 0.5 -> 0.89 Inexact Rounded
+pwsx2829 power 79E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2830 power 79E+1 0.5 -> 28 Inexact Rounded
+pwsx2831 power 79E+2 0.5 -> 89 Inexact Rounded
+pwsx2832 power 79E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2833 power 0.80 0.5 -> 0.89 Inexact Rounded
+pwsx2834 power 0.080 0.5 -> 0.28 Inexact Rounded
+pwsx2835 power 80.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2836 power 80.00E-2 0.5 -> 0.89 Inexact Rounded
+pwsx2837 power 80E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2838 power 80E+1 0.5 -> 28 Inexact Rounded
+pwsx2839 power 80E+2 0.5 -> 89 Inexact Rounded
+pwsx2840 power 80E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2841 power 0.81 0.5 -> 0.90 Inexact Rounded
+pwsx2842 power 0.081 0.5 -> 0.28 Inexact Rounded
+pwsx2843 power 81.0E-1 0.5 -> 2.8 Inexact Rounded
+pwsx2844 power 81.00E-2 0.5 -> 0.90 Inexact Rounded
+pwsx2845 power 81E-3 0.5 -> 0.28 Inexact Rounded
+pwsx2846 power 81E+1 0.5 -> 28 Inexact Rounded
+pwsx2847 power 81E+2 0.5 -> 90 Inexact Rounded
+pwsx2848 power 81E+3 0.5 -> 2.8E+2 Inexact Rounded
+pwsx2849 power 0.82 0.5 -> 0.91 Inexact Rounded
+pwsx2850 power 0.082 0.5 -> 0.29 Inexact Rounded
+pwsx2851 power 82.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2852 power 82.00E-2 0.5 -> 0.91 Inexact Rounded
+pwsx2853 power 82E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2854 power 82E+1 0.5 -> 29 Inexact Rounded
+pwsx2855 power 82E+2 0.5 -> 91 Inexact Rounded
+pwsx2856 power 82E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2857 power 0.83 0.5 -> 0.91 Inexact Rounded
+pwsx2858 power 0.083 0.5 -> 0.29 Inexact Rounded
+pwsx2859 power 83.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2860 power 83.00E-2 0.5 -> 0.91 Inexact Rounded
+pwsx2861 power 83E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2862 power 83E+1 0.5 -> 29 Inexact Rounded
+pwsx2863 power 83E+2 0.5 -> 91 Inexact Rounded
+pwsx2864 power 83E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2865 power 0.84 0.5 -> 0.92 Inexact Rounded
+pwsx2866 power 0.084 0.5 -> 0.29 Inexact Rounded
+pwsx2867 power 84.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2868 power 84.00E-2 0.5 -> 0.92 Inexact Rounded
+pwsx2869 power 84E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2870 power 84E+1 0.5 -> 29 Inexact Rounded
+pwsx2871 power 84E+2 0.5 -> 92 Inexact Rounded
+pwsx2872 power 84E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2873 power 0.85 0.5 -> 0.92 Inexact Rounded
+pwsx2874 power 0.085 0.5 -> 0.29 Inexact Rounded
+pwsx2875 power 85.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2876 power 85.00E-2 0.5 -> 0.92 Inexact Rounded
+pwsx2877 power 85E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2878 power 85E+1 0.5 -> 29 Inexact Rounded
+pwsx2879 power 85E+2 0.5 -> 92 Inexact Rounded
+pwsx2880 power 85E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2881 power 0.86 0.5 -> 0.93 Inexact Rounded
+pwsx2882 power 0.086 0.5 -> 0.29 Inexact Rounded
+pwsx2883 power 86.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2884 power 86.00E-2 0.5 -> 0.93 Inexact Rounded
+pwsx2885 power 86E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2886 power 86E+1 0.5 -> 29 Inexact Rounded
+pwsx2887 power 86E+2 0.5 -> 93 Inexact Rounded
+pwsx2888 power 86E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2889 power 0.87 0.5 -> 0.93 Inexact Rounded
+pwsx2890 power 0.087 0.5 -> 0.29 Inexact Rounded
+pwsx2891 power 87.0E-1 0.5 -> 2.9 Inexact Rounded
+pwsx2892 power 87.00E-2 0.5 -> 0.93 Inexact Rounded
+pwsx2893 power 87E-3 0.5 -> 0.29 Inexact Rounded
+pwsx2894 power 87E+1 0.5 -> 29 Inexact Rounded
+pwsx2895 power 87E+2 0.5 -> 93 Inexact Rounded
+pwsx2896 power 87E+3 0.5 -> 2.9E+2 Inexact Rounded
+pwsx2897 power 0.88 0.5 -> 0.94 Inexact Rounded
+pwsx2898 power 0.088 0.5 -> 0.30 Inexact Rounded
+pwsx2899 power 88.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2900 power 88.00E-2 0.5 -> 0.94 Inexact Rounded
+pwsx2901 power 88E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2902 power 88E+1 0.5 -> 30 Inexact Rounded
+pwsx2903 power 88E+2 0.5 -> 94 Inexact Rounded
+pwsx2904 power 88E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2905 power 0.89 0.5 -> 0.94 Inexact Rounded
+pwsx2906 power 0.089 0.5 -> 0.30 Inexact Rounded
+pwsx2907 power 89.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2908 power 89.00E-2 0.5 -> 0.94 Inexact Rounded
+pwsx2909 power 89E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2910 power 89E+1 0.5 -> 30 Inexact Rounded
+pwsx2911 power 89E+2 0.5 -> 94 Inexact Rounded
+pwsx2912 power 89E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2913 power 0.90 0.5 -> 0.95 Inexact Rounded
+pwsx2914 power 0.090 0.5 -> 0.30 Inexact Rounded
+pwsx2915 power 90.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2916 power 90.00E-2 0.5 -> 0.95 Inexact Rounded
+pwsx2917 power 90E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2918 power 90E+1 0.5 -> 30 Inexact Rounded
+pwsx2919 power 90E+2 0.5 -> 95 Inexact Rounded
+pwsx2920 power 90E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2921 power 0.91 0.5 -> 0.95 Inexact Rounded
+pwsx2922 power 0.091 0.5 -> 0.30 Inexact Rounded
+pwsx2923 power 91.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2924 power 91.00E-2 0.5 -> 0.95 Inexact Rounded
+pwsx2925 power 91E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2926 power 91E+1 0.5 -> 30 Inexact Rounded
+pwsx2927 power 91E+2 0.5 -> 95 Inexact Rounded
+pwsx2928 power 91E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2929 power 0.92 0.5 -> 0.96 Inexact Rounded
+pwsx2930 power 0.092 0.5 -> 0.30 Inexact Rounded
+pwsx2931 power 92.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2932 power 92.00E-2 0.5 -> 0.96 Inexact Rounded
+pwsx2933 power 92E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2934 power 92E+1 0.5 -> 30 Inexact Rounded
+pwsx2935 power 92E+2 0.5 -> 96 Inexact Rounded
+pwsx2936 power 92E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2937 power 0.93 0.5 -> 0.96 Inexact Rounded
+pwsx2938 power 0.093 0.5 -> 0.30 Inexact Rounded
+pwsx2939 power 93.0E-1 0.5 -> 3.0 Inexact Rounded
+pwsx2940 power 93.00E-2 0.5 -> 0.96 Inexact Rounded
+pwsx2941 power 93E-3 0.5 -> 0.30 Inexact Rounded
+pwsx2942 power 93E+1 0.5 -> 30 Inexact Rounded
+pwsx2943 power 93E+2 0.5 -> 96 Inexact Rounded
+pwsx2944 power 93E+3 0.5 -> 3.0E+2 Inexact Rounded
+pwsx2945 power 0.94 0.5 -> 0.97 Inexact Rounded
+pwsx2946 power 0.094 0.5 -> 0.31 Inexact Rounded
+pwsx2947 power 94.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2948 power 94.00E-2 0.5 -> 0.97 Inexact Rounded
+pwsx2949 power 94E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2950 power 94E+1 0.5 -> 31 Inexact Rounded
+pwsx2951 power 94E+2 0.5 -> 97 Inexact Rounded
+pwsx2952 power 94E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2953 power 0.95 0.5 -> 0.97 Inexact Rounded
+pwsx2954 power 0.095 0.5 -> 0.31 Inexact Rounded
+pwsx2955 power 95.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2956 power 95.00E-2 0.5 -> 0.97 Inexact Rounded
+pwsx2957 power 95E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2958 power 95E+1 0.5 -> 31 Inexact Rounded
+pwsx2959 power 95E+2 0.5 -> 97 Inexact Rounded
+pwsx2960 power 95E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2961 power 0.96 0.5 -> 0.98 Inexact Rounded
+pwsx2962 power 0.096 0.5 -> 0.31 Inexact Rounded
+pwsx2963 power 96.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2964 power 96.00E-2 0.5 -> 0.98 Inexact Rounded
+pwsx2965 power 96E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2966 power 96E+1 0.5 -> 31 Inexact Rounded
+pwsx2967 power 96E+2 0.5 -> 98 Inexact Rounded
+pwsx2968 power 96E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2969 power 0.97 0.5 -> 0.98 Inexact Rounded
+pwsx2970 power 0.097 0.5 -> 0.31 Inexact Rounded
+pwsx2971 power 97.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2972 power 97.00E-2 0.5 -> 0.98 Inexact Rounded
+pwsx2973 power 97E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2974 power 97E+1 0.5 -> 31 Inexact Rounded
+pwsx2975 power 97E+2 0.5 -> 98 Inexact Rounded
+pwsx2976 power 97E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2977 power 0.98 0.5 -> 0.99 Inexact Rounded
+pwsx2978 power 0.098 0.5 -> 0.31 Inexact Rounded
+pwsx2979 power 98.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2980 power 98.00E-2 0.5 -> 0.99 Inexact Rounded
+pwsx2981 power 98E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2982 power 98E+1 0.5 -> 31 Inexact Rounded
+pwsx2983 power 98E+2 0.5 -> 99 Inexact Rounded
+pwsx2984 power 98E+3 0.5 -> 3.1E+2 Inexact Rounded
+pwsx2985 power 0.99 0.5 -> 0.99 Inexact Rounded
+pwsx2986 power 0.099 0.5 -> 0.31 Inexact Rounded
+pwsx2987 power 99.0E-1 0.5 -> 3.1 Inexact Rounded
+pwsx2988 power 99.00E-2 0.5 -> 0.99 Inexact Rounded
+pwsx2989 power 99E-3 0.5 -> 0.31 Inexact Rounded
+pwsx2990 power 99E+1 0.5 -> 31 Inexact Rounded
+pwsx2991 power 99E+2 0.5 -> 99 Inexact Rounded
+pwsx2992 power 99E+3 0.5 -> 3.1E+2 Inexact Rounded
+
+-- Precision 3 squareroot tests [exhaustive, f and f/10]
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+precision: 3
+pwsx3001 power 0.1 0.5 -> 0.316 Inexact Rounded
+pwsx3002 power 0.01 0.5 -> 0.100 Inexact Rounded
+pwsx3003 power 0.2 0.5 -> 0.447 Inexact Rounded
+pwsx3004 power 0.02 0.5 -> 0.141 Inexact Rounded
+pwsx3005 power 0.3 0.5 -> 0.548 Inexact Rounded
+pwsx3006 power 0.03 0.5 -> 0.173 Inexact Rounded
+pwsx3007 power 0.4 0.5 -> 0.632 Inexact Rounded
+pwsx3008 power 0.04 0.5 -> 0.200 Inexact Rounded
+pwsx3009 power 0.5 0.5 -> 0.707 Inexact Rounded
+pwsx3010 power 0.05 0.5 -> 0.224 Inexact Rounded
+pwsx3011 power 0.6 0.5 -> 0.775 Inexact Rounded
+pwsx3012 power 0.06 0.5 -> 0.245 Inexact Rounded
+pwsx3013 power 0.7 0.5 -> 0.837 Inexact Rounded
+pwsx3014 power 0.07 0.5 -> 0.265 Inexact Rounded
+pwsx3015 power 0.8 0.5 -> 0.894 Inexact Rounded
+pwsx3016 power 0.08 0.5 -> 0.283 Inexact Rounded
+pwsx3017 power 0.9 0.5 -> 0.949 Inexact Rounded
+pwsx3018 power 0.09 0.5 -> 0.300 Inexact Rounded
+pwsx3019 power 0.11 0.5 -> 0.332 Inexact Rounded
+pwsx3020 power 0.011 0.5 -> 0.105 Inexact Rounded
+pwsx3021 power 0.12 0.5 -> 0.346 Inexact Rounded
+pwsx3022 power 0.012 0.5 -> 0.110 Inexact Rounded
+pwsx3023 power 0.13 0.5 -> 0.361 Inexact Rounded
+pwsx3024 power 0.013 0.5 -> 0.114 Inexact Rounded
+pwsx3025 power 0.14 0.5 -> 0.374 Inexact Rounded
+pwsx3026 power 0.014 0.5 -> 0.118 Inexact Rounded
+pwsx3027 power 0.15 0.5 -> 0.387 Inexact Rounded
+pwsx3028 power 0.015 0.5 -> 0.122 Inexact Rounded
+pwsx3029 power 0.16 0.5 -> 0.400 Inexact Rounded
+pwsx3030 power 0.016 0.5 -> 0.126 Inexact Rounded
+pwsx3031 power 0.17 0.5 -> 0.412 Inexact Rounded
+pwsx3032 power 0.017 0.5 -> 0.130 Inexact Rounded
+pwsx3033 power 0.18 0.5 -> 0.424 Inexact Rounded
+pwsx3034 power 0.018 0.5 -> 0.134 Inexact Rounded
+pwsx3035 power 0.19 0.5 -> 0.436 Inexact Rounded
+pwsx3036 power 0.019 0.5 -> 0.138 Inexact Rounded
+pwsx3037 power 0.21 0.5 -> 0.458 Inexact Rounded
+pwsx3038 power 0.021 0.5 -> 0.145 Inexact Rounded
+pwsx3039 power 0.22 0.5 -> 0.469 Inexact Rounded
+pwsx3040 power 0.022 0.5 -> 0.148 Inexact Rounded
+pwsx3041 power 0.23 0.5 -> 0.480 Inexact Rounded
+pwsx3042 power 0.023 0.5 -> 0.152 Inexact Rounded
+pwsx3043 power 0.24 0.5 -> 0.490 Inexact Rounded
+pwsx3044 power 0.024 0.5 -> 0.155 Inexact Rounded
+pwsx3045 power 0.25 0.5 -> 0.500 Inexact Rounded
+pwsx3046 power 0.025 0.5 -> 0.158 Inexact Rounded
+pwsx3047 power 0.26 0.5 -> 0.510 Inexact Rounded
+pwsx3048 power 0.026 0.5 -> 0.161 Inexact Rounded
+pwsx3049 power 0.27 0.5 -> 0.520 Inexact Rounded
+pwsx3050 power 0.027 0.5 -> 0.164 Inexact Rounded
+pwsx3051 power 0.28 0.5 -> 0.529 Inexact Rounded
+pwsx3052 power 0.028 0.5 -> 0.167 Inexact Rounded
+pwsx3053 power 0.29 0.5 -> 0.539 Inexact Rounded
+pwsx3054 power 0.029 0.5 -> 0.170 Inexact Rounded
+pwsx3055 power 0.31 0.5 -> 0.557 Inexact Rounded
+pwsx3056 power 0.031 0.5 -> 0.176 Inexact Rounded
+pwsx3057 power 0.32 0.5 -> 0.566 Inexact Rounded
+pwsx3058 power 0.032 0.5 -> 0.179 Inexact Rounded
+pwsx3059 power 0.33 0.5 -> 0.574 Inexact Rounded
+pwsx3060 power 0.033 0.5 -> 0.182 Inexact Rounded
+pwsx3061 power 0.34 0.5 -> 0.583 Inexact Rounded
+pwsx3062 power 0.034 0.5 -> 0.184 Inexact Rounded
+pwsx3063 power 0.35 0.5 -> 0.592 Inexact Rounded
+pwsx3064 power 0.035 0.5 -> 0.187 Inexact Rounded
+pwsx3065 power 0.36 0.5 -> 0.600 Inexact Rounded
+pwsx3066 power 0.036 0.5 -> 0.190 Inexact Rounded
+pwsx3067 power 0.37 0.5 -> 0.608 Inexact Rounded
+pwsx3068 power 0.037 0.5 -> 0.192 Inexact Rounded
+pwsx3069 power 0.38 0.5 -> 0.616 Inexact Rounded
+pwsx3070 power 0.038 0.5 -> 0.195 Inexact Rounded
+pwsx3071 power 0.39 0.5 -> 0.624 Inexact Rounded
+pwsx3072 power 0.039 0.5 -> 0.197 Inexact Rounded
+pwsx3073 power 0.41 0.5 -> 0.640 Inexact Rounded
+pwsx3074 power 0.041 0.5 -> 0.202 Inexact Rounded
+pwsx3075 power 0.42 0.5 -> 0.648 Inexact Rounded
+pwsx3076 power 0.042 0.5 -> 0.205 Inexact Rounded
+pwsx3077 power 0.43 0.5 -> 0.656 Inexact Rounded
+pwsx3078 power 0.043 0.5 -> 0.207 Inexact Rounded
+pwsx3079 power 0.44 0.5 -> 0.663 Inexact Rounded
+pwsx3080 power 0.044 0.5 -> 0.210 Inexact Rounded
+pwsx3081 power 0.45 0.5 -> 0.671 Inexact Rounded
+pwsx3082 power 0.045 0.5 -> 0.212 Inexact Rounded
+pwsx3083 power 0.46 0.5 -> 0.678 Inexact Rounded
+pwsx3084 power 0.046 0.5 -> 0.214 Inexact Rounded
+pwsx3085 power 0.47 0.5 -> 0.686 Inexact Rounded
+pwsx3086 power 0.047 0.5 -> 0.217 Inexact Rounded
+pwsx3087 power 0.48 0.5 -> 0.693 Inexact Rounded
+pwsx3088 power 0.048 0.5 -> 0.219 Inexact Rounded
+pwsx3089 power 0.49 0.5 -> 0.700 Inexact Rounded
+pwsx3090 power 0.049 0.5 -> 0.221 Inexact Rounded
+pwsx3091 power 0.51 0.5 -> 0.714 Inexact Rounded
+pwsx3092 power 0.051 0.5 -> 0.226 Inexact Rounded
+pwsx3093 power 0.52 0.5 -> 0.721 Inexact Rounded
+pwsx3094 power 0.052 0.5 -> 0.228 Inexact Rounded
+pwsx3095 power 0.53 0.5 -> 0.728 Inexact Rounded
+pwsx3096 power 0.053 0.5 -> 0.230 Inexact Rounded
+pwsx3097 power 0.54 0.5 -> 0.735 Inexact Rounded
+pwsx3098 power 0.054 0.5 -> 0.232 Inexact Rounded
+pwsx3099 power 0.55 0.5 -> 0.742 Inexact Rounded
+pwsx3100 power 0.055 0.5 -> 0.235 Inexact Rounded
+pwsx3101 power 0.56 0.5 -> 0.748 Inexact Rounded
+pwsx3102 power 0.056 0.5 -> 0.237 Inexact Rounded
+pwsx3103 power 0.57 0.5 -> 0.755 Inexact Rounded
+pwsx3104 power 0.057 0.5 -> 0.239 Inexact Rounded
+pwsx3105 power 0.58 0.5 -> 0.762 Inexact Rounded
+pwsx3106 power 0.058 0.5 -> 0.241 Inexact Rounded
+pwsx3107 power 0.59 0.5 -> 0.768 Inexact Rounded
+pwsx3108 power 0.059 0.5 -> 0.243 Inexact Rounded
+pwsx3109 power 0.61 0.5 -> 0.781 Inexact Rounded
+pwsx3110 power 0.061 0.5 -> 0.247 Inexact Rounded
+pwsx3111 power 0.62 0.5 -> 0.787 Inexact Rounded
+pwsx3112 power 0.062 0.5 -> 0.249 Inexact Rounded
+pwsx3113 power 0.63 0.5 -> 0.794 Inexact Rounded
+pwsx3114 power 0.063 0.5 -> 0.251 Inexact Rounded
+pwsx3115 power 0.64 0.5 -> 0.800 Inexact Rounded
+pwsx3116 power 0.064 0.5 -> 0.253 Inexact Rounded
+pwsx3117 power 0.65 0.5 -> 0.806 Inexact Rounded
+pwsx3118 power 0.065 0.5 -> 0.255 Inexact Rounded
+pwsx3119 power 0.66 0.5 -> 0.812 Inexact Rounded
+pwsx3120 power 0.066 0.5 -> 0.257 Inexact Rounded
+pwsx3121 power 0.67 0.5 -> 0.819 Inexact Rounded
+pwsx3122 power 0.067 0.5 -> 0.259 Inexact Rounded
+pwsx3123 power 0.68 0.5 -> 0.825 Inexact Rounded
+pwsx3124 power 0.068 0.5 -> 0.261 Inexact Rounded
+pwsx3125 power 0.69 0.5 -> 0.831 Inexact Rounded
+pwsx3126 power 0.069 0.5 -> 0.263 Inexact Rounded
+pwsx3127 power 0.71 0.5 -> 0.843 Inexact Rounded
+pwsx3128 power 0.071 0.5 -> 0.266 Inexact Rounded
+pwsx3129 power 0.72 0.5 -> 0.849 Inexact Rounded
+pwsx3130 power 0.072 0.5 -> 0.268 Inexact Rounded
+pwsx3131 power 0.73 0.5 -> 0.854 Inexact Rounded
+pwsx3132 power 0.073 0.5 -> 0.270 Inexact Rounded
+pwsx3133 power 0.74 0.5 -> 0.860 Inexact Rounded
+pwsx3134 power 0.074 0.5 -> 0.272 Inexact Rounded
+pwsx3135 power 0.75 0.5 -> 0.866 Inexact Rounded
+pwsx3136 power 0.075 0.5 -> 0.274 Inexact Rounded
+pwsx3137 power 0.76 0.5 -> 0.872 Inexact Rounded
+pwsx3138 power 0.076 0.5 -> 0.276 Inexact Rounded
+pwsx3139 power 0.77 0.5 -> 0.877 Inexact Rounded
+pwsx3140 power 0.077 0.5 -> 0.277 Inexact Rounded
+pwsx3141 power 0.78 0.5 -> 0.883 Inexact Rounded
+pwsx3142 power 0.078 0.5 -> 0.279 Inexact Rounded
+pwsx3143 power 0.79 0.5 -> 0.889 Inexact Rounded
+pwsx3144 power 0.079 0.5 -> 0.281 Inexact Rounded
+pwsx3145 power 0.81 0.5 -> 0.900 Inexact Rounded
+pwsx3146 power 0.081 0.5 -> 0.285 Inexact Rounded
+pwsx3147 power 0.82 0.5 -> 0.906 Inexact Rounded
+pwsx3148 power 0.082 0.5 -> 0.286 Inexact Rounded
+pwsx3149 power 0.83 0.5 -> 0.911 Inexact Rounded
+pwsx3150 power 0.083 0.5 -> 0.288 Inexact Rounded
+pwsx3151 power 0.84 0.5 -> 0.917 Inexact Rounded
+pwsx3152 power 0.084 0.5 -> 0.290 Inexact Rounded
+pwsx3153 power 0.85 0.5 -> 0.922 Inexact Rounded
+pwsx3154 power 0.085 0.5 -> 0.292 Inexact Rounded
+pwsx3155 power 0.86 0.5 -> 0.927 Inexact Rounded
+pwsx3156 power 0.086 0.5 -> 0.293 Inexact Rounded
+pwsx3157 power 0.87 0.5 -> 0.933 Inexact Rounded
+pwsx3158 power 0.087 0.5 -> 0.295 Inexact Rounded
+pwsx3159 power 0.88 0.5 -> 0.938 Inexact Rounded
+pwsx3160 power 0.088 0.5 -> 0.297 Inexact Rounded
+pwsx3161 power 0.89 0.5 -> 0.943 Inexact Rounded
+pwsx3162 power 0.089 0.5 -> 0.298 Inexact Rounded
+pwsx3163 power 0.91 0.5 -> 0.954 Inexact Rounded
+pwsx3164 power 0.091 0.5 -> 0.302 Inexact Rounded
+pwsx3165 power 0.92 0.5 -> 0.959 Inexact Rounded
+pwsx3166 power 0.092 0.5 -> 0.303 Inexact Rounded
+pwsx3167 power 0.93 0.5 -> 0.964 Inexact Rounded
+pwsx3168 power 0.093 0.5 -> 0.305 Inexact Rounded
+pwsx3169 power 0.94 0.5 -> 0.970 Inexact Rounded
+pwsx3170 power 0.094 0.5 -> 0.307 Inexact Rounded
+pwsx3171 power 0.95 0.5 -> 0.975 Inexact Rounded
+pwsx3172 power 0.095 0.5 -> 0.308 Inexact Rounded
+pwsx3173 power 0.96 0.5 -> 0.980 Inexact Rounded
+pwsx3174 power 0.096 0.5 -> 0.310 Inexact Rounded
+pwsx3175 power 0.97 0.5 -> 0.985 Inexact Rounded
+pwsx3176 power 0.097 0.5 -> 0.311 Inexact Rounded
+pwsx3177 power 0.98 0.5 -> 0.990 Inexact Rounded
+pwsx3178 power 0.098 0.5 -> 0.313 Inexact Rounded
+pwsx3179 power 0.99 0.5 -> 0.995 Inexact Rounded
+pwsx3180 power 0.099 0.5 -> 0.315 Inexact Rounded
+pwsx3181 power 0.101 0.5 -> 0.318 Inexact Rounded
+pwsx3182 power 0.0101 0.5 -> 0.100 Inexact Rounded
+pwsx3183 power 0.102 0.5 -> 0.319 Inexact Rounded
+pwsx3184 power 0.0102 0.5 -> 0.101 Inexact Rounded
+pwsx3185 power 0.103 0.5 -> 0.321 Inexact Rounded
+pwsx3186 power 0.0103 0.5 -> 0.101 Inexact Rounded
+pwsx3187 power 0.104 0.5 -> 0.322 Inexact Rounded
+pwsx3188 power 0.0104 0.5 -> 0.102 Inexact Rounded
+pwsx3189 power 0.105 0.5 -> 0.324 Inexact Rounded
+pwsx3190 power 0.0105 0.5 -> 0.102 Inexact Rounded
+pwsx3191 power 0.106 0.5 -> 0.326 Inexact Rounded
+pwsx3192 power 0.0106 0.5 -> 0.103 Inexact Rounded
+pwsx3193 power 0.107 0.5 -> 0.327 Inexact Rounded
+pwsx3194 power 0.0107 0.5 -> 0.103 Inexact Rounded
+pwsx3195 power 0.108 0.5 -> 0.329 Inexact Rounded
+pwsx3196 power 0.0108 0.5 -> 0.104 Inexact Rounded
+pwsx3197 power 0.109 0.5 -> 0.330 Inexact Rounded
+pwsx3198 power 0.0109 0.5 -> 0.104 Inexact Rounded
+pwsx3199 power 0.111 0.5 -> 0.333 Inexact Rounded
+pwsx3200 power 0.0111 0.5 -> 0.105 Inexact Rounded
+pwsx3201 power 0.112 0.5 -> 0.335 Inexact Rounded
+pwsx3202 power 0.0112 0.5 -> 0.106 Inexact Rounded
+pwsx3203 power 0.113 0.5 -> 0.336 Inexact Rounded
+pwsx3204 power 0.0113 0.5 -> 0.106 Inexact Rounded
+pwsx3205 power 0.114 0.5 -> 0.338 Inexact Rounded
+pwsx3206 power 0.0114 0.5 -> 0.107 Inexact Rounded
+pwsx3207 power 0.115 0.5 -> 0.339 Inexact Rounded
+pwsx3208 power 0.0115 0.5 -> 0.107 Inexact Rounded
+pwsx3209 power 0.116 0.5 -> 0.341 Inexact Rounded
+pwsx3210 power 0.0116 0.5 -> 0.108 Inexact Rounded
+pwsx3211 power 0.117 0.5 -> 0.342 Inexact Rounded
+pwsx3212 power 0.0117 0.5 -> 0.108 Inexact Rounded
+pwsx3213 power 0.118 0.5 -> 0.344 Inexact Rounded
+pwsx3214 power 0.0118 0.5 -> 0.109 Inexact Rounded
+pwsx3215 power 0.119 0.5 -> 0.345 Inexact Rounded
+pwsx3216 power 0.0119 0.5 -> 0.109 Inexact Rounded
+pwsx3217 power 0.121 0.5 -> 0.348 Inexact Rounded
+pwsx3218 power 0.0121 0.5 -> 0.110 Inexact Rounded
+pwsx3219 power 0.122 0.5 -> 0.349 Inexact Rounded
+pwsx3220 power 0.0122 0.5 -> 0.110 Inexact Rounded
+pwsx3221 power 0.123 0.5 -> 0.351 Inexact Rounded
+pwsx3222 power 0.0123 0.5 -> 0.111 Inexact Rounded
+pwsx3223 power 0.124 0.5 -> 0.352 Inexact Rounded
+pwsx3224 power 0.0124 0.5 -> 0.111 Inexact Rounded
+pwsx3225 power 0.125 0.5 -> 0.354 Inexact Rounded
+pwsx3226 power 0.0125 0.5 -> 0.112 Inexact Rounded
+pwsx3227 power 0.126 0.5 -> 0.355 Inexact Rounded
+pwsx3228 power 0.0126 0.5 -> 0.112 Inexact Rounded
+pwsx3229 power 0.127 0.5 -> 0.356 Inexact Rounded
+pwsx3230 power 0.0127 0.5 -> 0.113 Inexact Rounded
+pwsx3231 power 0.128 0.5 -> 0.358 Inexact Rounded
+pwsx3232 power 0.0128 0.5 -> 0.113 Inexact Rounded
+pwsx3233 power 0.129 0.5 -> 0.359 Inexact Rounded
+pwsx3234 power 0.0129 0.5 -> 0.114 Inexact Rounded
+pwsx3235 power 0.131 0.5 -> 0.362 Inexact Rounded
+pwsx3236 power 0.0131 0.5 -> 0.114 Inexact Rounded
+pwsx3237 power 0.132 0.5 -> 0.363 Inexact Rounded
+pwsx3238 power 0.0132 0.5 -> 0.115 Inexact Rounded
+pwsx3239 power 0.133 0.5 -> 0.365 Inexact Rounded
+pwsx3240 power 0.0133 0.5 -> 0.115 Inexact Rounded
+pwsx3241 power 0.134 0.5 -> 0.366 Inexact Rounded
+pwsx3242 power 0.0134 0.5 -> 0.116 Inexact Rounded
+pwsx3243 power 0.135 0.5 -> 0.367 Inexact Rounded
+pwsx3244 power 0.0135 0.5 -> 0.116 Inexact Rounded
+pwsx3245 power 0.136 0.5 -> 0.369 Inexact Rounded
+pwsx3246 power 0.0136 0.5 -> 0.117 Inexact Rounded
+pwsx3247 power 0.137 0.5 -> 0.370 Inexact Rounded
+pwsx3248 power 0.0137 0.5 -> 0.117 Inexact Rounded
+pwsx3249 power 0.138 0.5 -> 0.371 Inexact Rounded
+pwsx3250 power 0.0138 0.5 -> 0.117 Inexact Rounded
+pwsx3251 power 0.139 0.5 -> 0.373 Inexact Rounded
+pwsx3252 power 0.0139 0.5 -> 0.118 Inexact Rounded
+pwsx3253 power 0.141 0.5 -> 0.375 Inexact Rounded
+pwsx3254 power 0.0141 0.5 -> 0.119 Inexact Rounded
+pwsx3255 power 0.142 0.5 -> 0.377 Inexact Rounded
+pwsx3256 power 0.0142 0.5 -> 0.119 Inexact Rounded
+pwsx3257 power 0.143 0.5 -> 0.378 Inexact Rounded
+pwsx3258 power 0.0143 0.5 -> 0.120 Inexact Rounded
+pwsx3259 power 0.144 0.5 -> 0.379 Inexact Rounded
+pwsx3260 power 0.0144 0.5 -> 0.120 Inexact Rounded
+pwsx3261 power 0.145 0.5 -> 0.381 Inexact Rounded
+pwsx3262 power 0.0145 0.5 -> 0.120 Inexact Rounded
+pwsx3263 power 0.146 0.5 -> 0.382 Inexact Rounded
+pwsx3264 power 0.0146 0.5 -> 0.121 Inexact Rounded
+pwsx3265 power 0.147 0.5 -> 0.383 Inexact Rounded
+pwsx3266 power 0.0147 0.5 -> 0.121 Inexact Rounded
+pwsx3267 power 0.148 0.5 -> 0.385 Inexact Rounded
+pwsx3268 power 0.0148 0.5 -> 0.122 Inexact Rounded
+pwsx3269 power 0.149 0.5 -> 0.386 Inexact Rounded
+pwsx3270 power 0.0149 0.5 -> 0.122 Inexact Rounded
+pwsx3271 power 0.151 0.5 -> 0.389 Inexact Rounded
+pwsx3272 power 0.0151 0.5 -> 0.123 Inexact Rounded
+pwsx3273 power 0.152 0.5 -> 0.390 Inexact Rounded
+pwsx3274 power 0.0152 0.5 -> 0.123 Inexact Rounded
+pwsx3275 power 0.153 0.5 -> 0.391 Inexact Rounded
+pwsx3276 power 0.0153 0.5 -> 0.124 Inexact Rounded
+pwsx3277 power 0.154 0.5 -> 0.392 Inexact Rounded
+pwsx3278 power 0.0154 0.5 -> 0.124 Inexact Rounded
+pwsx3279 power 0.155 0.5 -> 0.394 Inexact Rounded
+pwsx3280 power 0.0155 0.5 -> 0.124 Inexact Rounded
+pwsx3281 power 0.156 0.5 -> 0.395 Inexact Rounded
+pwsx3282 power 0.0156 0.5 -> 0.125 Inexact Rounded
+pwsx3283 power 0.157 0.5 -> 0.396 Inexact Rounded
+pwsx3284 power 0.0157 0.5 -> 0.125 Inexact Rounded
+pwsx3285 power 0.158 0.5 -> 0.397 Inexact Rounded
+pwsx3286 power 0.0158 0.5 -> 0.126 Inexact Rounded
+pwsx3287 power 0.159 0.5 -> 0.399 Inexact Rounded
+pwsx3288 power 0.0159 0.5 -> 0.126 Inexact Rounded
+pwsx3289 power 0.161 0.5 -> 0.401 Inexact Rounded
+pwsx3290 power 0.0161 0.5 -> 0.127 Inexact Rounded
+pwsx3291 power 0.162 0.5 -> 0.402 Inexact Rounded
+pwsx3292 power 0.0162 0.5 -> 0.127 Inexact Rounded
+pwsx3293 power 0.163 0.5 -> 0.404 Inexact Rounded
+pwsx3294 power 0.0163 0.5 -> 0.128 Inexact Rounded
+pwsx3295 power 0.164 0.5 -> 0.405 Inexact Rounded
+pwsx3296 power 0.0164 0.5 -> 0.128 Inexact Rounded
+pwsx3297 power 0.165 0.5 -> 0.406 Inexact Rounded
+pwsx3298 power 0.0165 0.5 -> 0.128 Inexact Rounded
+pwsx3299 power 0.166 0.5 -> 0.407 Inexact Rounded
+pwsx3300 power 0.0166 0.5 -> 0.129 Inexact Rounded
+pwsx3301 power 0.167 0.5 -> 0.409 Inexact Rounded
+pwsx3302 power 0.0167 0.5 -> 0.129 Inexact Rounded
+pwsx3303 power 0.168 0.5 -> 0.410 Inexact Rounded
+pwsx3304 power 0.0168 0.5 -> 0.130 Inexact Rounded
+pwsx3305 power 0.169 0.5 -> 0.411 Inexact Rounded
+pwsx3306 power 0.0169 0.5 -> 0.130 Inexact Rounded
+pwsx3307 power 0.171 0.5 -> 0.414 Inexact Rounded
+pwsx3308 power 0.0171 0.5 -> 0.131 Inexact Rounded
+pwsx3309 power 0.172 0.5 -> 0.415 Inexact Rounded
+pwsx3310 power 0.0172 0.5 -> 0.131 Inexact Rounded
+pwsx3311 power 0.173 0.5 -> 0.416 Inexact Rounded
+pwsx3312 power 0.0173 0.5 -> 0.132 Inexact Rounded
+pwsx3313 power 0.174 0.5 -> 0.417 Inexact Rounded
+pwsx3314 power 0.0174 0.5 -> 0.132 Inexact Rounded
+pwsx3315 power 0.175 0.5 -> 0.418 Inexact Rounded
+pwsx3316 power 0.0175 0.5 -> 0.132 Inexact Rounded
+pwsx3317 power 0.176 0.5 -> 0.420 Inexact Rounded
+pwsx3318 power 0.0176 0.5 -> 0.133 Inexact Rounded
+pwsx3319 power 0.177 0.5 -> 0.421 Inexact Rounded
+pwsx3320 power 0.0177 0.5 -> 0.133 Inexact Rounded
+pwsx3321 power 0.178 0.5 -> 0.422 Inexact Rounded
+pwsx3322 power 0.0178 0.5 -> 0.133 Inexact Rounded
+pwsx3323 power 0.179 0.5 -> 0.423 Inexact Rounded
+pwsx3324 power 0.0179 0.5 -> 0.134 Inexact Rounded
+pwsx3325 power 0.181 0.5 -> 0.425 Inexact Rounded
+pwsx3326 power 0.0181 0.5 -> 0.135 Inexact Rounded
+pwsx3327 power 0.182 0.5 -> 0.427 Inexact Rounded
+pwsx3328 power 0.0182 0.5 -> 0.135 Inexact Rounded
+pwsx3329 power 0.183 0.5 -> 0.428 Inexact Rounded
+pwsx3330 power 0.0183 0.5 -> 0.135 Inexact Rounded
+pwsx3331 power 0.184 0.5 -> 0.429 Inexact Rounded
+pwsx3332 power 0.0184 0.5 -> 0.136 Inexact Rounded
+pwsx3333 power 0.185 0.5 -> 0.430 Inexact Rounded
+pwsx3334 power 0.0185 0.5 -> 0.136 Inexact Rounded
+pwsx3335 power 0.186 0.5 -> 0.431 Inexact Rounded
+pwsx3336 power 0.0186 0.5 -> 0.136 Inexact Rounded
+pwsx3337 power 0.187 0.5 -> 0.432 Inexact Rounded
+pwsx3338 power 0.0187 0.5 -> 0.137 Inexact Rounded
+pwsx3339 power 0.188 0.5 -> 0.434 Inexact Rounded
+pwsx3340 power 0.0188 0.5 -> 0.137 Inexact Rounded
+pwsx3341 power 0.189 0.5 -> 0.435 Inexact Rounded
+pwsx3342 power 0.0189 0.5 -> 0.137 Inexact Rounded
+pwsx3343 power 0.191 0.5 -> 0.437 Inexact Rounded
+pwsx3344 power 0.0191 0.5 -> 0.138 Inexact Rounded
+pwsx3345 power 0.192 0.5 -> 0.438 Inexact Rounded
+pwsx3346 power 0.0192 0.5 -> 0.139 Inexact Rounded
+pwsx3347 power 0.193 0.5 -> 0.439 Inexact Rounded
+pwsx3348 power 0.0193 0.5 -> 0.139 Inexact Rounded
+pwsx3349 power 0.194 0.5 -> 0.440 Inexact Rounded
+pwsx3350 power 0.0194 0.5 -> 0.139 Inexact Rounded
+pwsx3351 power 0.195 0.5 -> 0.442 Inexact Rounded
+pwsx3352 power 0.0195 0.5 -> 0.140 Inexact Rounded
+pwsx3353 power 0.196 0.5 -> 0.443 Inexact Rounded
+pwsx3354 power 0.0196 0.5 -> 0.140 Inexact Rounded
+pwsx3355 power 0.197 0.5 -> 0.444 Inexact Rounded
+pwsx3356 power 0.0197 0.5 -> 0.140 Inexact Rounded
+pwsx3357 power 0.198 0.5 -> 0.445 Inexact Rounded
+pwsx3358 power 0.0198 0.5 -> 0.141 Inexact Rounded
+pwsx3359 power 0.199 0.5 -> 0.446 Inexact Rounded
+pwsx3360 power 0.0199 0.5 -> 0.141 Inexact Rounded
+pwsx3361 power 0.201 0.5 -> 0.448 Inexact Rounded
+pwsx3362 power 0.0201 0.5 -> 0.142 Inexact Rounded
+pwsx3363 power 0.202 0.5 -> 0.449 Inexact Rounded
+pwsx3364 power 0.0202 0.5 -> 0.142 Inexact Rounded
+pwsx3365 power 0.203 0.5 -> 0.451 Inexact Rounded
+pwsx3366 power 0.0203 0.5 -> 0.142 Inexact Rounded
+pwsx3367 power 0.204 0.5 -> 0.452 Inexact Rounded
+pwsx3368 power 0.0204 0.5 -> 0.143 Inexact Rounded
+pwsx3369 power 0.205 0.5 -> 0.453 Inexact Rounded
+pwsx3370 power 0.0205 0.5 -> 0.143 Inexact Rounded
+pwsx3371 power 0.206 0.5 -> 0.454 Inexact Rounded
+pwsx3372 power 0.0206 0.5 -> 0.144 Inexact Rounded
+pwsx3373 power 0.207 0.5 -> 0.455 Inexact Rounded
+pwsx3374 power 0.0207 0.5 -> 0.144 Inexact Rounded
+pwsx3375 power 0.208 0.5 -> 0.456 Inexact Rounded
+pwsx3376 power 0.0208 0.5 -> 0.144 Inexact Rounded
+pwsx3377 power 0.209 0.5 -> 0.457 Inexact Rounded
+pwsx3378 power 0.0209 0.5 -> 0.145 Inexact Rounded
+pwsx3379 power 0.211 0.5 -> 0.459 Inexact Rounded
+pwsx3380 power 0.0211 0.5 -> 0.145 Inexact Rounded
+pwsx3381 power 0.212 0.5 -> 0.460 Inexact Rounded
+pwsx3382 power 0.0212 0.5 -> 0.146 Inexact Rounded
+pwsx3383 power 0.213 0.5 -> 0.462 Inexact Rounded
+pwsx3384 power 0.0213 0.5 -> 0.146 Inexact Rounded
+pwsx3385 power 0.214 0.5 -> 0.463 Inexact Rounded
+pwsx3386 power 0.0214 0.5 -> 0.146 Inexact Rounded
+pwsx3387 power 0.215 0.5 -> 0.464 Inexact Rounded
+pwsx3388 power 0.0215 0.5 -> 0.147 Inexact Rounded
+pwsx3389 power 0.216 0.5 -> 0.465 Inexact Rounded
+pwsx3390 power 0.0216 0.5 -> 0.147 Inexact Rounded
+pwsx3391 power 0.217 0.5 -> 0.466 Inexact Rounded
+pwsx3392 power 0.0217 0.5 -> 0.147 Inexact Rounded
+pwsx3393 power 0.218 0.5 -> 0.467 Inexact Rounded
+pwsx3394 power 0.0218 0.5 -> 0.148 Inexact Rounded
+pwsx3395 power 0.219 0.5 -> 0.468 Inexact Rounded
+pwsx3396 power 0.0219 0.5 -> 0.148 Inexact Rounded
+pwsx3397 power 0.221 0.5 -> 0.470 Inexact Rounded
+pwsx3398 power 0.0221 0.5 -> 0.149 Inexact Rounded
+pwsx3399 power 0.222 0.5 -> 0.471 Inexact Rounded
+pwsx3400 power 0.0222 0.5 -> 0.149 Inexact Rounded
+pwsx3401 power 0.223 0.5 -> 0.472 Inexact Rounded
+pwsx3402 power 0.0223 0.5 -> 0.149 Inexact Rounded
+pwsx3403 power 0.224 0.5 -> 0.473 Inexact Rounded
+pwsx3404 power 0.0224 0.5 -> 0.150 Inexact Rounded
+pwsx3405 power 0.225 0.5 -> 0.474 Inexact Rounded
+pwsx3406 power 0.0225 0.5 -> 0.150 Inexact Rounded
+pwsx3407 power 0.226 0.5 -> 0.475 Inexact Rounded
+pwsx3408 power 0.0226 0.5 -> 0.150 Inexact Rounded
+pwsx3409 power 0.227 0.5 -> 0.476 Inexact Rounded
+pwsx3410 power 0.0227 0.5 -> 0.151 Inexact Rounded
+pwsx3411 power 0.228 0.5 -> 0.477 Inexact Rounded
+pwsx3412 power 0.0228 0.5 -> 0.151 Inexact Rounded
+pwsx3413 power 0.229 0.5 -> 0.479 Inexact Rounded
+pwsx3414 power 0.0229 0.5 -> 0.151 Inexact Rounded
+pwsx3415 power 0.231 0.5 -> 0.481 Inexact Rounded
+pwsx3416 power 0.0231 0.5 -> 0.152 Inexact Rounded
+pwsx3417 power 0.232 0.5 -> 0.482 Inexact Rounded
+pwsx3418 power 0.0232 0.5 -> 0.152 Inexact Rounded
+pwsx3419 power 0.233 0.5 -> 0.483 Inexact Rounded
+pwsx3420 power 0.0233 0.5 -> 0.153 Inexact Rounded
+pwsx3421 power 0.234 0.5 -> 0.484 Inexact Rounded
+pwsx3422 power 0.0234 0.5 -> 0.153 Inexact Rounded
+pwsx3423 power 0.235 0.5 -> 0.485 Inexact Rounded
+pwsx3424 power 0.0235 0.5 -> 0.153 Inexact Rounded
+pwsx3425 power 0.236 0.5 -> 0.486 Inexact Rounded
+pwsx3426 power 0.0236 0.5 -> 0.154 Inexact Rounded
+pwsx3427 power 0.237 0.5 -> 0.487 Inexact Rounded
+pwsx3428 power 0.0237 0.5 -> 0.154 Inexact Rounded
+pwsx3429 power 0.238 0.5 -> 0.488 Inexact Rounded
+pwsx3430 power 0.0238 0.5 -> 0.154 Inexact Rounded
+pwsx3431 power 0.239 0.5 -> 0.489 Inexact Rounded
+pwsx3432 power 0.0239 0.5 -> 0.155 Inexact Rounded
+pwsx3433 power 0.241 0.5 -> 0.491 Inexact Rounded
+pwsx3434 power 0.0241 0.5 -> 0.155 Inexact Rounded
+pwsx3435 power 0.242 0.5 -> 0.492 Inexact Rounded
+pwsx3436 power 0.0242 0.5 -> 0.156 Inexact Rounded
+pwsx3437 power 0.243 0.5 -> 0.493 Inexact Rounded
+pwsx3438 power 0.0243 0.5 -> 0.156 Inexact Rounded
+pwsx3439 power 0.244 0.5 -> 0.494 Inexact Rounded
+pwsx3440 power 0.0244 0.5 -> 0.156 Inexact Rounded
+pwsx3441 power 0.245 0.5 -> 0.495 Inexact Rounded
+pwsx3442 power 0.0245 0.5 -> 0.157 Inexact Rounded
+pwsx3443 power 0.246 0.5 -> 0.496 Inexact Rounded
+pwsx3444 power 0.0246 0.5 -> 0.157 Inexact Rounded
+pwsx3445 power 0.247 0.5 -> 0.497 Inexact Rounded
+pwsx3446 power 0.0247 0.5 -> 0.157 Inexact Rounded
+pwsx3447 power 0.248 0.5 -> 0.498 Inexact Rounded
+pwsx3448 power 0.0248 0.5 -> 0.157 Inexact Rounded
+pwsx3449 power 0.249 0.5 -> 0.499 Inexact Rounded
+pwsx3450 power 0.0249 0.5 -> 0.158 Inexact Rounded
+pwsx3451 power 0.251 0.5 -> 0.501 Inexact Rounded
+pwsx3452 power 0.0251 0.5 -> 0.158 Inexact Rounded
+pwsx3453 power 0.252 0.5 -> 0.502 Inexact Rounded
+pwsx3454 power 0.0252 0.5 -> 0.159 Inexact Rounded
+pwsx3455 power 0.253 0.5 -> 0.503 Inexact Rounded
+pwsx3456 power 0.0253 0.5 -> 0.159 Inexact Rounded
+pwsx3457 power 0.254 0.5 -> 0.504 Inexact Rounded
+pwsx3458 power 0.0254 0.5 -> 0.159 Inexact Rounded
+pwsx3459 power 0.255 0.5 -> 0.505 Inexact Rounded
+pwsx3460 power 0.0255 0.5 -> 0.160 Inexact Rounded
+pwsx3461 power 0.256 0.5 -> 0.506 Inexact Rounded
+pwsx3462 power 0.0256 0.5 -> 0.160 Inexact Rounded
+pwsx3463 power 0.257 0.5 -> 0.507 Inexact Rounded
+pwsx3464 power 0.0257 0.5 -> 0.160 Inexact Rounded
+pwsx3465 power 0.258 0.5 -> 0.508 Inexact Rounded
+pwsx3466 power 0.0258 0.5 -> 0.161 Inexact Rounded
+pwsx3467 power 0.259 0.5 -> 0.509 Inexact Rounded
+pwsx3468 power 0.0259 0.5 -> 0.161 Inexact Rounded
+pwsx3469 power 0.261 0.5 -> 0.511 Inexact Rounded
+pwsx3470 power 0.0261 0.5 -> 0.162 Inexact Rounded
+pwsx3471 power 0.262 0.5 -> 0.512 Inexact Rounded
+pwsx3472 power 0.0262 0.5 -> 0.162 Inexact Rounded
+pwsx3473 power 0.263 0.5 -> 0.513 Inexact Rounded
+pwsx3474 power 0.0263 0.5 -> 0.162 Inexact Rounded
+pwsx3475 power 0.264 0.5 -> 0.514 Inexact Rounded
+pwsx3476 power 0.0264 0.5 -> 0.162 Inexact Rounded
+pwsx3477 power 0.265 0.5 -> 0.515 Inexact Rounded
+pwsx3478 power 0.0265 0.5 -> 0.163 Inexact Rounded
+pwsx3479 power 0.266 0.5 -> 0.516 Inexact Rounded
+pwsx3480 power 0.0266 0.5 -> 0.163 Inexact Rounded
+pwsx3481 power 0.267 0.5 -> 0.517 Inexact Rounded
+pwsx3482 power 0.0267 0.5 -> 0.163 Inexact Rounded
+pwsx3483 power 0.268 0.5 -> 0.518 Inexact Rounded
+pwsx3484 power 0.0268 0.5 -> 0.164 Inexact Rounded
+pwsx3485 power 0.269 0.5 -> 0.519 Inexact Rounded
+pwsx3486 power 0.0269 0.5 -> 0.164 Inexact Rounded
+pwsx3487 power 0.271 0.5 -> 0.521 Inexact Rounded
+pwsx3488 power 0.0271 0.5 -> 0.165 Inexact Rounded
+pwsx3489 power 0.272 0.5 -> 0.522 Inexact Rounded
+pwsx3490 power 0.0272 0.5 -> 0.165 Inexact Rounded
+pwsx3491 power 0.273 0.5 -> 0.522 Inexact Rounded
+pwsx3492 power 0.0273 0.5 -> 0.165 Inexact Rounded
+pwsx3493 power 0.274 0.5 -> 0.523 Inexact Rounded
+pwsx3494 power 0.0274 0.5 -> 0.166 Inexact Rounded
+pwsx3495 power 0.275 0.5 -> 0.524 Inexact Rounded
+pwsx3496 power 0.0275 0.5 -> 0.166 Inexact Rounded
+pwsx3497 power 0.276 0.5 -> 0.525 Inexact Rounded
+pwsx3498 power 0.0276 0.5 -> 0.166 Inexact Rounded
+pwsx3499 power 0.277 0.5 -> 0.526 Inexact Rounded
+pwsx3500 power 0.0277 0.5 -> 0.166 Inexact Rounded
+pwsx3501 power 0.278 0.5 -> 0.527 Inexact Rounded
+pwsx3502 power 0.0278 0.5 -> 0.167 Inexact Rounded
+pwsx3503 power 0.279 0.5 -> 0.528 Inexact Rounded
+pwsx3504 power 0.0279 0.5 -> 0.167 Inexact Rounded
+pwsx3505 power 0.281 0.5 -> 0.530 Inexact Rounded
+pwsx3506 power 0.0281 0.5 -> 0.168 Inexact Rounded
+pwsx3507 power 0.282 0.5 -> 0.531 Inexact Rounded
+pwsx3508 power 0.0282 0.5 -> 0.168 Inexact Rounded
+pwsx3509 power 0.283 0.5 -> 0.532 Inexact Rounded
+pwsx3510 power 0.0283 0.5 -> 0.168 Inexact Rounded
+pwsx3511 power 0.284 0.5 -> 0.533 Inexact Rounded
+pwsx3512 power 0.0284 0.5 -> 0.169 Inexact Rounded
+pwsx3513 power 0.285 0.5 -> 0.534 Inexact Rounded
+pwsx3514 power 0.0285 0.5 -> 0.169 Inexact Rounded
+pwsx3515 power 0.286 0.5 -> 0.535 Inexact Rounded
+pwsx3516 power 0.0286 0.5 -> 0.169 Inexact Rounded
+pwsx3517 power 0.287 0.5 -> 0.536 Inexact Rounded
+pwsx3518 power 0.0287 0.5 -> 0.169 Inexact Rounded
+pwsx3519 power 0.288 0.5 -> 0.537 Inexact Rounded
+pwsx3520 power 0.0288 0.5 -> 0.170 Inexact Rounded
+pwsx3521 power 0.289 0.5 -> 0.538 Inexact Rounded
+pwsx3522 power 0.0289 0.5 -> 0.170 Inexact Rounded
+pwsx3523 power 0.291 0.5 -> 0.539 Inexact Rounded
+pwsx3524 power 0.0291 0.5 -> 0.171 Inexact Rounded
+pwsx3525 power 0.292 0.5 -> 0.540 Inexact Rounded
+pwsx3526 power 0.0292 0.5 -> 0.171 Inexact Rounded
+pwsx3527 power 0.293 0.5 -> 0.541 Inexact Rounded
+pwsx3528 power 0.0293 0.5 -> 0.171 Inexact Rounded
+pwsx3529 power 0.294 0.5 -> 0.542 Inexact Rounded
+pwsx3530 power 0.0294 0.5 -> 0.171 Inexact Rounded
+pwsx3531 power 0.295 0.5 -> 0.543 Inexact Rounded
+pwsx3532 power 0.0295 0.5 -> 0.172 Inexact Rounded
+pwsx3533 power 0.296 0.5 -> 0.544 Inexact Rounded
+pwsx3534 power 0.0296 0.5 -> 0.172 Inexact Rounded
+pwsx3535 power 0.297 0.5 -> 0.545 Inexact Rounded
+pwsx3536 power 0.0297 0.5 -> 0.172 Inexact Rounded
+pwsx3537 power 0.298 0.5 -> 0.546 Inexact Rounded
+pwsx3538 power 0.0298 0.5 -> 0.173 Inexact Rounded
+pwsx3539 power 0.299 0.5 -> 0.547 Inexact Rounded
+pwsx3540 power 0.0299 0.5 -> 0.173 Inexact Rounded
+pwsx3541 power 0.301 0.5 -> 0.549 Inexact Rounded
+pwsx3542 power 0.0301 0.5 -> 0.173 Inexact Rounded
+pwsx3543 power 0.302 0.5 -> 0.550 Inexact Rounded
+pwsx3544 power 0.0302 0.5 -> 0.174 Inexact Rounded
+pwsx3545 power 0.303 0.5 -> 0.550 Inexact Rounded
+pwsx3546 power 0.0303 0.5 -> 0.174 Inexact Rounded
+pwsx3547 power 0.304 0.5 -> 0.551 Inexact Rounded
+pwsx3548 power 0.0304 0.5 -> 0.174 Inexact Rounded
+pwsx3549 power 0.305 0.5 -> 0.552 Inexact Rounded
+pwsx3550 power 0.0305 0.5 -> 0.175 Inexact Rounded
+pwsx3551 power 0.306 0.5 -> 0.553 Inexact Rounded
+pwsx3552 power 0.0306 0.5 -> 0.175 Inexact Rounded
+pwsx3553 power 0.307 0.5 -> 0.554 Inexact Rounded
+pwsx3554 power 0.0307 0.5 -> 0.175 Inexact Rounded
+pwsx3555 power 0.308 0.5 -> 0.555 Inexact Rounded
+pwsx3556 power 0.0308 0.5 -> 0.175 Inexact Rounded
+pwsx3557 power 0.309 0.5 -> 0.556 Inexact Rounded
+pwsx3558 power 0.0309 0.5 -> 0.176 Inexact Rounded
+pwsx3559 power 0.311 0.5 -> 0.558 Inexact Rounded
+pwsx3560 power 0.0311 0.5 -> 0.176 Inexact Rounded
+pwsx3561 power 0.312 0.5 -> 0.559 Inexact Rounded
+pwsx3562 power 0.0312 0.5 -> 0.177 Inexact Rounded
+pwsx3563 power 0.313 0.5 -> 0.559 Inexact Rounded
+pwsx3564 power 0.0313 0.5 -> 0.177 Inexact Rounded
+pwsx3565 power 0.314 0.5 -> 0.560 Inexact Rounded
+pwsx3566 power 0.0314 0.5 -> 0.177 Inexact Rounded
+pwsx3567 power 0.315 0.5 -> 0.561 Inexact Rounded
+pwsx3568 power 0.0315 0.5 -> 0.177 Inexact Rounded
+pwsx3569 power 0.316 0.5 -> 0.562 Inexact Rounded
+pwsx3570 power 0.0316 0.5 -> 0.178 Inexact Rounded
+pwsx3571 power 0.317 0.5 -> 0.563 Inexact Rounded
+pwsx3572 power 0.0317 0.5 -> 0.178 Inexact Rounded
+pwsx3573 power 0.318 0.5 -> 0.564 Inexact Rounded
+pwsx3574 power 0.0318 0.5 -> 0.178 Inexact Rounded
+pwsx3575 power 0.319 0.5 -> 0.565 Inexact Rounded
+pwsx3576 power 0.0319 0.5 -> 0.179 Inexact Rounded
+pwsx3577 power 0.321 0.5 -> 0.567 Inexact Rounded
+pwsx3578 power 0.0321 0.5 -> 0.179 Inexact Rounded
+pwsx3579 power 0.322 0.5 -> 0.567 Inexact Rounded
+pwsx3580 power 0.0322 0.5 -> 0.179 Inexact Rounded
+pwsx3581 power 0.323 0.5 -> 0.568 Inexact Rounded
+pwsx3582 power 0.0323 0.5 -> 0.180 Inexact Rounded
+pwsx3583 power 0.324 0.5 -> 0.569 Inexact Rounded
+pwsx3584 power 0.0324 0.5 -> 0.180 Inexact Rounded
+pwsx3585 power 0.325 0.5 -> 0.570 Inexact Rounded
+pwsx3586 power 0.0325 0.5 -> 0.180 Inexact Rounded
+pwsx3587 power 0.326 0.5 -> 0.571 Inexact Rounded
+pwsx3588 power 0.0326 0.5 -> 0.181 Inexact Rounded
+pwsx3589 power 0.327 0.5 -> 0.572 Inexact Rounded
+pwsx3590 power 0.0327 0.5 -> 0.181 Inexact Rounded
+pwsx3591 power 0.328 0.5 -> 0.573 Inexact Rounded
+pwsx3592 power 0.0328 0.5 -> 0.181 Inexact Rounded
+pwsx3593 power 0.329 0.5 -> 0.574 Inexact Rounded
+pwsx3594 power 0.0329 0.5 -> 0.181 Inexact Rounded
+pwsx3595 power 0.331 0.5 -> 0.575 Inexact Rounded
+pwsx3596 power 0.0331 0.5 -> 0.182 Inexact Rounded
+pwsx3597 power 0.332 0.5 -> 0.576 Inexact Rounded
+pwsx3598 power 0.0332 0.5 -> 0.182 Inexact Rounded
+pwsx3599 power 0.333 0.5 -> 0.577 Inexact Rounded
+pwsx3600 power 0.0333 0.5 -> 0.182 Inexact Rounded
+pwsx3601 power 0.334 0.5 -> 0.578 Inexact Rounded
+pwsx3602 power 0.0334 0.5 -> 0.183 Inexact Rounded
+pwsx3603 power 0.335 0.5 -> 0.579 Inexact Rounded
+pwsx3604 power 0.0335 0.5 -> 0.183 Inexact Rounded
+pwsx3605 power 0.336 0.5 -> 0.580 Inexact Rounded
+pwsx3606 power 0.0336 0.5 -> 0.183 Inexact Rounded
+pwsx3607 power 0.337 0.5 -> 0.581 Inexact Rounded
+pwsx3608 power 0.0337 0.5 -> 0.184 Inexact Rounded
+pwsx3609 power 0.338 0.5 -> 0.581 Inexact Rounded
+pwsx3610 power 0.0338 0.5 -> 0.184 Inexact Rounded
+pwsx3611 power 0.339 0.5 -> 0.582 Inexact Rounded
+pwsx3612 power 0.0339 0.5 -> 0.184 Inexact Rounded
+pwsx3613 power 0.341 0.5 -> 0.584 Inexact Rounded
+pwsx3614 power 0.0341 0.5 -> 0.185 Inexact Rounded
+pwsx3615 power 0.342 0.5 -> 0.585 Inexact Rounded
+pwsx3616 power 0.0342 0.5 -> 0.185 Inexact Rounded
+pwsx3617 power 0.343 0.5 -> 0.586 Inexact Rounded
+pwsx3618 power 0.0343 0.5 -> 0.185 Inexact Rounded
+pwsx3619 power 0.344 0.5 -> 0.587 Inexact Rounded
+pwsx3620 power 0.0344 0.5 -> 0.185 Inexact Rounded
+pwsx3621 power 0.345 0.5 -> 0.587 Inexact Rounded
+pwsx3622 power 0.0345 0.5 -> 0.186 Inexact Rounded
+pwsx3623 power 0.346 0.5 -> 0.588 Inexact Rounded
+pwsx3624 power 0.0346 0.5 -> 0.186 Inexact Rounded
+pwsx3625 power 0.347 0.5 -> 0.589 Inexact Rounded
+pwsx3626 power 0.0347 0.5 -> 0.186 Inexact Rounded
+pwsx3627 power 0.348 0.5 -> 0.590 Inexact Rounded
+pwsx3628 power 0.0348 0.5 -> 0.187 Inexact Rounded
+pwsx3629 power 0.349 0.5 -> 0.591 Inexact Rounded
+pwsx3630 power 0.0349 0.5 -> 0.187 Inexact Rounded
+pwsx3631 power 0.351 0.5 -> 0.592 Inexact Rounded
+pwsx3632 power 0.0351 0.5 -> 0.187 Inexact Rounded
+pwsx3633 power 0.352 0.5 -> 0.593 Inexact Rounded
+pwsx3634 power 0.0352 0.5 -> 0.188 Inexact Rounded
+pwsx3635 power 0.353 0.5 -> 0.594 Inexact Rounded
+pwsx3636 power 0.0353 0.5 -> 0.188 Inexact Rounded
+pwsx3637 power 0.354 0.5 -> 0.595 Inexact Rounded
+pwsx3638 power 0.0354 0.5 -> 0.188 Inexact Rounded
+pwsx3639 power 0.355 0.5 -> 0.596 Inexact Rounded
+pwsx3640 power 0.0355 0.5 -> 0.188 Inexact Rounded
+pwsx3641 power 0.356 0.5 -> 0.597 Inexact Rounded
+pwsx3642 power 0.0356 0.5 -> 0.189 Inexact Rounded
+pwsx3643 power 0.357 0.5 -> 0.597 Inexact Rounded
+pwsx3644 power 0.0357 0.5 -> 0.189 Inexact Rounded
+pwsx3645 power 0.358 0.5 -> 0.598 Inexact Rounded
+pwsx3646 power 0.0358 0.5 -> 0.189 Inexact Rounded
+pwsx3647 power 0.359 0.5 -> 0.599 Inexact Rounded
+pwsx3648 power 0.0359 0.5 -> 0.189 Inexact Rounded
+pwsx3649 power 0.361 0.5 -> 0.601 Inexact Rounded
+pwsx3650 power 0.0361 0.5 -> 0.190 Inexact Rounded
+pwsx3651 power 0.362 0.5 -> 0.602 Inexact Rounded
+pwsx3652 power 0.0362 0.5 -> 0.190 Inexact Rounded
+pwsx3653 power 0.363 0.5 -> 0.602 Inexact Rounded
+pwsx3654 power 0.0363 0.5 -> 0.191 Inexact Rounded
+pwsx3655 power 0.364 0.5 -> 0.603 Inexact Rounded
+pwsx3656 power 0.0364 0.5 -> 0.191 Inexact Rounded
+pwsx3657 power 0.365 0.5 -> 0.604 Inexact Rounded
+pwsx3658 power 0.0365 0.5 -> 0.191 Inexact Rounded
+pwsx3659 power 0.366 0.5 -> 0.605 Inexact Rounded
+pwsx3660 power 0.0366 0.5 -> 0.191 Inexact Rounded
+pwsx3661 power 0.367 0.5 -> 0.606 Inexact Rounded
+pwsx3662 power 0.0367 0.5 -> 0.192 Inexact Rounded
+pwsx3663 power 0.368 0.5 -> 0.607 Inexact Rounded
+pwsx3664 power 0.0368 0.5 -> 0.192 Inexact Rounded
+pwsx3665 power 0.369 0.5 -> 0.607 Inexact Rounded
+pwsx3666 power 0.0369 0.5 -> 0.192 Inexact Rounded
+pwsx3667 power 0.371 0.5 -> 0.609 Inexact Rounded
+pwsx3668 power 0.0371 0.5 -> 0.193 Inexact Rounded
+pwsx3669 power 0.372 0.5 -> 0.610 Inexact Rounded
+pwsx3670 power 0.0372 0.5 -> 0.193 Inexact Rounded
+pwsx3671 power 0.373 0.5 -> 0.611 Inexact Rounded
+pwsx3672 power 0.0373 0.5 -> 0.193 Inexact Rounded
+pwsx3673 power 0.374 0.5 -> 0.612 Inexact Rounded
+pwsx3674 power 0.0374 0.5 -> 0.193 Inexact Rounded
+pwsx3675 power 0.375 0.5 -> 0.612 Inexact Rounded
+pwsx3676 power 0.0375 0.5 -> 0.194 Inexact Rounded
+pwsx3677 power 0.376 0.5 -> 0.613 Inexact Rounded
+pwsx3678 power 0.0376 0.5 -> 0.194 Inexact Rounded
+pwsx3679 power 0.377 0.5 -> 0.614 Inexact Rounded
+pwsx3680 power 0.0377 0.5 -> 0.194 Inexact Rounded
+pwsx3681 power 0.378 0.5 -> 0.615 Inexact Rounded
+pwsx3682 power 0.0378 0.5 -> 0.194 Inexact Rounded
+pwsx3683 power 0.379 0.5 -> 0.616 Inexact Rounded
+pwsx3684 power 0.0379 0.5 -> 0.195 Inexact Rounded
+pwsx3685 power 0.381 0.5 -> 0.617 Inexact Rounded
+pwsx3686 power 0.0381 0.5 -> 0.195 Inexact Rounded
+pwsx3687 power 0.382 0.5 -> 0.618 Inexact Rounded
+pwsx3688 power 0.0382 0.5 -> 0.195 Inexact Rounded
+pwsx3689 power 0.383 0.5 -> 0.619 Inexact Rounded
+pwsx3690 power 0.0383 0.5 -> 0.196 Inexact Rounded
+pwsx3691 power 0.384 0.5 -> 0.620 Inexact Rounded
+pwsx3692 power 0.0384 0.5 -> 0.196 Inexact Rounded
+pwsx3693 power 0.385 0.5 -> 0.620 Inexact Rounded
+pwsx3694 power 0.0385 0.5 -> 0.196 Inexact Rounded
+pwsx3695 power 0.386 0.5 -> 0.621 Inexact Rounded
+pwsx3696 power 0.0386 0.5 -> 0.196 Inexact Rounded
+pwsx3697 power 0.387 0.5 -> 0.622 Inexact Rounded
+pwsx3698 power 0.0387 0.5 -> 0.197 Inexact Rounded
+pwsx3699 power 0.388 0.5 -> 0.623 Inexact Rounded
+pwsx3700 power 0.0388 0.5 -> 0.197 Inexact Rounded
+pwsx3701 power 0.389 0.5 -> 0.624 Inexact Rounded
+pwsx3702 power 0.0389 0.5 -> 0.197 Inexact Rounded
+pwsx3703 power 0.391 0.5 -> 0.625 Inexact Rounded
+pwsx3704 power 0.0391 0.5 -> 0.198 Inexact Rounded
+pwsx3705 power 0.392 0.5 -> 0.626 Inexact Rounded
+pwsx3706 power 0.0392 0.5 -> 0.198 Inexact Rounded
+pwsx3707 power 0.393 0.5 -> 0.627 Inexact Rounded
+pwsx3708 power 0.0393 0.5 -> 0.198 Inexact Rounded
+pwsx3709 power 0.394 0.5 -> 0.628 Inexact Rounded
+pwsx3710 power 0.0394 0.5 -> 0.198 Inexact Rounded
+pwsx3711 power 0.395 0.5 -> 0.628 Inexact Rounded
+pwsx3712 power 0.0395 0.5 -> 0.199 Inexact Rounded
+pwsx3713 power 0.396 0.5 -> 0.629 Inexact Rounded
+pwsx3714 power 0.0396 0.5 -> 0.199 Inexact Rounded
+pwsx3715 power 0.397 0.5 -> 0.630 Inexact Rounded
+pwsx3716 power 0.0397 0.5 -> 0.199 Inexact Rounded
+pwsx3717 power 0.398 0.5 -> 0.631 Inexact Rounded
+pwsx3718 power 0.0398 0.5 -> 0.199 Inexact Rounded
+pwsx3719 power 0.399 0.5 -> 0.632 Inexact Rounded
+pwsx3720 power 0.0399 0.5 -> 0.200 Inexact Rounded
+pwsx3721 power 0.401 0.5 -> 0.633 Inexact Rounded
+pwsx3722 power 0.0401 0.5 -> 0.200 Inexact Rounded
+pwsx3723 power 0.402 0.5 -> 0.634 Inexact Rounded
+pwsx3724 power 0.0402 0.5 -> 0.200 Inexact Rounded
+pwsx3725 power 0.403 0.5 -> 0.635 Inexact Rounded
+pwsx3726 power 0.0403 0.5 -> 0.201 Inexact Rounded
+pwsx3727 power 0.404 0.5 -> 0.636 Inexact Rounded
+pwsx3728 power 0.0404 0.5 -> 0.201 Inexact Rounded
+pwsx3729 power 0.405 0.5 -> 0.636 Inexact Rounded
+pwsx3730 power 0.0405 0.5 -> 0.201 Inexact Rounded
+pwsx3731 power 0.406 0.5 -> 0.637 Inexact Rounded
+pwsx3732 power 0.0406 0.5 -> 0.201 Inexact Rounded
+pwsx3733 power 0.407 0.5 -> 0.638 Inexact Rounded
+pwsx3734 power 0.0407 0.5 -> 0.202 Inexact Rounded
+pwsx3735 power 0.408 0.5 -> 0.639 Inexact Rounded
+pwsx3736 power 0.0408 0.5 -> 0.202 Inexact Rounded
+pwsx3737 power 0.409 0.5 -> 0.640 Inexact Rounded
+pwsx3738 power 0.0409 0.5 -> 0.202 Inexact Rounded
+pwsx3739 power 0.411 0.5 -> 0.641 Inexact Rounded
+pwsx3740 power 0.0411 0.5 -> 0.203 Inexact Rounded
+pwsx3741 power 0.412 0.5 -> 0.642 Inexact Rounded
+pwsx3742 power 0.0412 0.5 -> 0.203 Inexact Rounded
+pwsx3743 power 0.413 0.5 -> 0.643 Inexact Rounded
+pwsx3744 power 0.0413 0.5 -> 0.203 Inexact Rounded
+pwsx3745 power 0.414 0.5 -> 0.643 Inexact Rounded
+pwsx3746 power 0.0414 0.5 -> 0.203 Inexact Rounded
+pwsx3747 power 0.415 0.5 -> 0.644 Inexact Rounded
+pwsx3748 power 0.0415 0.5 -> 0.204 Inexact Rounded
+pwsx3749 power 0.416 0.5 -> 0.645 Inexact Rounded
+pwsx3750 power 0.0416 0.5 -> 0.204 Inexact Rounded
+pwsx3751 power 0.417 0.5 -> 0.646 Inexact Rounded
+pwsx3752 power 0.0417 0.5 -> 0.204 Inexact Rounded
+pwsx3753 power 0.418 0.5 -> 0.647 Inexact Rounded
+pwsx3754 power 0.0418 0.5 -> 0.204 Inexact Rounded
+pwsx3755 power 0.419 0.5 -> 0.647 Inexact Rounded
+pwsx3756 power 0.0419 0.5 -> 0.205 Inexact Rounded
+pwsx3757 power 0.421 0.5 -> 0.649 Inexact Rounded
+pwsx3758 power 0.0421 0.5 -> 0.205 Inexact Rounded
+pwsx3759 power 0.422 0.5 -> 0.650 Inexact Rounded
+pwsx3760 power 0.0422 0.5 -> 0.205 Inexact Rounded
+pwsx3761 power 0.423 0.5 -> 0.650 Inexact Rounded
+pwsx3762 power 0.0423 0.5 -> 0.206 Inexact Rounded
+pwsx3763 power 0.424 0.5 -> 0.651 Inexact Rounded
+pwsx3764 power 0.0424 0.5 -> 0.206 Inexact Rounded
+pwsx3765 power 0.425 0.5 -> 0.652 Inexact Rounded
+pwsx3766 power 0.0425 0.5 -> 0.206 Inexact Rounded
+pwsx3767 power 0.426 0.5 -> 0.653 Inexact Rounded
+pwsx3768 power 0.0426 0.5 -> 0.206 Inexact Rounded
+pwsx3769 power 0.427 0.5 -> 0.653 Inexact Rounded
+pwsx3770 power 0.0427 0.5 -> 0.207 Inexact Rounded
+pwsx3771 power 0.428 0.5 -> 0.654 Inexact Rounded
+pwsx3772 power 0.0428 0.5 -> 0.207 Inexact Rounded
+pwsx3773 power 0.429 0.5 -> 0.655 Inexact Rounded
+pwsx3774 power 0.0429 0.5 -> 0.207 Inexact Rounded
+pwsx3775 power 0.431 0.5 -> 0.657 Inexact Rounded
+pwsx3776 power 0.0431 0.5 -> 0.208 Inexact Rounded
+pwsx3777 power 0.432 0.5 -> 0.657 Inexact Rounded
+pwsx3778 power 0.0432 0.5 -> 0.208 Inexact Rounded
+pwsx3779 power 0.433 0.5 -> 0.658 Inexact Rounded
+pwsx3780 power 0.0433 0.5 -> 0.208 Inexact Rounded
+pwsx3781 power 0.434 0.5 -> 0.659 Inexact Rounded
+pwsx3782 power 0.0434 0.5 -> 0.208 Inexact Rounded
+pwsx3783 power 0.435 0.5 -> 0.660 Inexact Rounded
+pwsx3784 power 0.0435 0.5 -> 0.209 Inexact Rounded
+pwsx3785 power 0.436 0.5 -> 0.660 Inexact Rounded
+pwsx3786 power 0.0436 0.5 -> 0.209 Inexact Rounded
+pwsx3787 power 0.437 0.5 -> 0.661 Inexact Rounded
+pwsx3788 power 0.0437 0.5 -> 0.209 Inexact Rounded
+pwsx3789 power 0.438 0.5 -> 0.662 Inexact Rounded
+pwsx3790 power 0.0438 0.5 -> 0.209 Inexact Rounded
+pwsx3791 power 0.439 0.5 -> 0.663 Inexact Rounded
+pwsx3792 power 0.0439 0.5 -> 0.210 Inexact Rounded
+pwsx3793 power 0.441 0.5 -> 0.664 Inexact Rounded
+pwsx3794 power 0.0441 0.5 -> 0.210 Inexact Rounded
+pwsx3795 power 0.442 0.5 -> 0.665 Inexact Rounded
+pwsx3796 power 0.0442 0.5 -> 0.210 Inexact Rounded
+pwsx3797 power 0.443 0.5 -> 0.666 Inexact Rounded
+pwsx3798 power 0.0443 0.5 -> 0.210 Inexact Rounded
+pwsx3799 power 0.444 0.5 -> 0.666 Inexact Rounded
+pwsx3800 power 0.0444 0.5 -> 0.211 Inexact Rounded
+pwsx3801 power 0.445 0.5 -> 0.667 Inexact Rounded
+pwsx3802 power 0.0445 0.5 -> 0.211 Inexact Rounded
+pwsx3803 power 0.446 0.5 -> 0.668 Inexact Rounded
+pwsx3804 power 0.0446 0.5 -> 0.211 Inexact Rounded
+pwsx3805 power 0.447 0.5 -> 0.669 Inexact Rounded
+pwsx3806 power 0.0447 0.5 -> 0.211 Inexact Rounded
+pwsx3807 power 0.448 0.5 -> 0.669 Inexact Rounded
+pwsx3808 power 0.0448 0.5 -> 0.212 Inexact Rounded
+pwsx3809 power 0.449 0.5 -> 0.670 Inexact Rounded
+pwsx3810 power 0.0449 0.5 -> 0.212 Inexact Rounded
+pwsx3811 power 0.451 0.5 -> 0.672 Inexact Rounded
+pwsx3812 power 0.0451 0.5 -> 0.212 Inexact Rounded
+pwsx3813 power 0.452 0.5 -> 0.672 Inexact Rounded
+pwsx3814 power 0.0452 0.5 -> 0.213 Inexact Rounded
+pwsx3815 power 0.453 0.5 -> 0.673 Inexact Rounded
+pwsx3816 power 0.0453 0.5 -> 0.213 Inexact Rounded
+pwsx3817 power 0.454 0.5 -> 0.674 Inexact Rounded
+pwsx3818 power 0.0454 0.5 -> 0.213 Inexact Rounded
+pwsx3819 power 0.455 0.5 -> 0.675 Inexact Rounded
+pwsx3820 power 0.0455 0.5 -> 0.213 Inexact Rounded
+pwsx3821 power 0.456 0.5 -> 0.675 Inexact Rounded
+pwsx3822 power 0.0456 0.5 -> 0.214 Inexact Rounded
+pwsx3823 power 0.457 0.5 -> 0.676 Inexact Rounded
+pwsx3824 power 0.0457 0.5 -> 0.214 Inexact Rounded
+pwsx3825 power 0.458 0.5 -> 0.677 Inexact Rounded
+pwsx3826 power 0.0458 0.5 -> 0.214 Inexact Rounded
+pwsx3827 power 0.459 0.5 -> 0.677 Inexact Rounded
+pwsx3828 power 0.0459 0.5 -> 0.214 Inexact Rounded
+pwsx3829 power 0.461 0.5 -> 0.679 Inexact Rounded
+pwsx3830 power 0.0461 0.5 -> 0.215 Inexact Rounded
+pwsx3831 power 0.462 0.5 -> 0.680 Inexact Rounded
+pwsx3832 power 0.0462 0.5 -> 0.215 Inexact Rounded
+pwsx3833 power 0.463 0.5 -> 0.680 Inexact Rounded
+pwsx3834 power 0.0463 0.5 -> 0.215 Inexact Rounded
+pwsx3835 power 0.464 0.5 -> 0.681 Inexact Rounded
+pwsx3836 power 0.0464 0.5 -> 0.215 Inexact Rounded
+pwsx3837 power 0.465 0.5 -> 0.682 Inexact Rounded
+pwsx3838 power 0.0465 0.5 -> 0.216 Inexact Rounded
+pwsx3839 power 0.466 0.5 -> 0.683 Inexact Rounded
+pwsx3840 power 0.0466 0.5 -> 0.216 Inexact Rounded
+pwsx3841 power 0.467 0.5 -> 0.683 Inexact Rounded
+pwsx3842 power 0.0467 0.5 -> 0.216 Inexact Rounded
+pwsx3843 power 0.468 0.5 -> 0.684 Inexact Rounded
+pwsx3844 power 0.0468 0.5 -> 0.216 Inexact Rounded
+pwsx3845 power 0.469 0.5 -> 0.685 Inexact Rounded
+pwsx3846 power 0.0469 0.5 -> 0.217 Inexact Rounded
+pwsx3847 power 0.471 0.5 -> 0.686 Inexact Rounded
+pwsx3848 power 0.0471 0.5 -> 0.217 Inexact Rounded
+pwsx3849 power 0.472 0.5 -> 0.687 Inexact Rounded
+pwsx3850 power 0.0472 0.5 -> 0.217 Inexact Rounded
+pwsx3851 power 0.473 0.5 -> 0.688 Inexact Rounded
+pwsx3852 power 0.0473 0.5 -> 0.217 Inexact Rounded
+pwsx3853 power 0.474 0.5 -> 0.688 Inexact Rounded
+pwsx3854 power 0.0474 0.5 -> 0.218 Inexact Rounded
+pwsx3855 power 0.475 0.5 -> 0.689 Inexact Rounded
+pwsx3856 power 0.0475 0.5 -> 0.218 Inexact Rounded
+pwsx3857 power 0.476 0.5 -> 0.690 Inexact Rounded
+pwsx3858 power 0.0476 0.5 -> 0.218 Inexact Rounded
+pwsx3859 power 0.477 0.5 -> 0.691 Inexact Rounded
+pwsx3860 power 0.0477 0.5 -> 0.218 Inexact Rounded
+pwsx3861 power 0.478 0.5 -> 0.691 Inexact Rounded
+pwsx3862 power 0.0478 0.5 -> 0.219 Inexact Rounded
+pwsx3863 power 0.479 0.5 -> 0.692 Inexact Rounded
+pwsx3864 power 0.0479 0.5 -> 0.219 Inexact Rounded
+pwsx3865 power 0.481 0.5 -> 0.694 Inexact Rounded
+pwsx3866 power 0.0481 0.5 -> 0.219 Inexact Rounded
+pwsx3867 power 0.482 0.5 -> 0.694 Inexact Rounded
+pwsx3868 power 0.0482 0.5 -> 0.220 Inexact Rounded
+pwsx3869 power 0.483 0.5 -> 0.695 Inexact Rounded
+pwsx3870 power 0.0483 0.5 -> 0.220 Inexact Rounded
+pwsx3871 power 0.484 0.5 -> 0.696 Inexact Rounded
+pwsx3872 power 0.0484 0.5 -> 0.220 Inexact Rounded
+pwsx3873 power 0.485 0.5 -> 0.696 Inexact Rounded
+pwsx3874 power 0.0485 0.5 -> 0.220 Inexact Rounded
+pwsx3875 power 0.486 0.5 -> 0.697 Inexact Rounded
+pwsx3876 power 0.0486 0.5 -> 0.220 Inexact Rounded
+pwsx3877 power 0.487 0.5 -> 0.698 Inexact Rounded
+pwsx3878 power 0.0487 0.5 -> 0.221 Inexact Rounded
+pwsx3879 power 0.488 0.5 -> 0.699 Inexact Rounded
+pwsx3880 power 0.0488 0.5 -> 0.221 Inexact Rounded
+pwsx3881 power 0.489 0.5 -> 0.699 Inexact Rounded
+pwsx3882 power 0.0489 0.5 -> 0.221 Inexact Rounded
+pwsx3883 power 0.491 0.5 -> 0.701 Inexact Rounded
+pwsx3884 power 0.0491 0.5 -> 0.222 Inexact Rounded
+pwsx3885 power 0.492 0.5 -> 0.701 Inexact Rounded
+pwsx3886 power 0.0492 0.5 -> 0.222 Inexact Rounded
+pwsx3887 power 0.493 0.5 -> 0.702 Inexact Rounded
+pwsx3888 power 0.0493 0.5 -> 0.222 Inexact Rounded
+pwsx3889 power 0.494 0.5 -> 0.703 Inexact Rounded
+pwsx3890 power 0.0494 0.5 -> 0.222 Inexact Rounded
+pwsx3891 power 0.495 0.5 -> 0.704 Inexact Rounded
+pwsx3892 power 0.0495 0.5 -> 0.222 Inexact Rounded
+pwsx3893 power 0.496 0.5 -> 0.704 Inexact Rounded
+pwsx3894 power 0.0496 0.5 -> 0.223 Inexact Rounded
+pwsx3895 power 0.497 0.5 -> 0.705 Inexact Rounded
+pwsx3896 power 0.0497 0.5 -> 0.223 Inexact Rounded
+pwsx3897 power 0.498 0.5 -> 0.706 Inexact Rounded
+pwsx3898 power 0.0498 0.5 -> 0.223 Inexact Rounded
+pwsx3899 power 0.499 0.5 -> 0.706 Inexact Rounded
+pwsx3900 power 0.0499 0.5 -> 0.223 Inexact Rounded
+pwsx3901 power 0.501 0.5 -> 0.708 Inexact Rounded
+pwsx3902 power 0.0501 0.5 -> 0.224 Inexact Rounded
+pwsx3903 power 0.502 0.5 -> 0.709 Inexact Rounded
+pwsx3904 power 0.0502 0.5 -> 0.224 Inexact Rounded
+pwsx3905 power 0.503 0.5 -> 0.709 Inexact Rounded
+pwsx3906 power 0.0503 0.5 -> 0.224 Inexact Rounded
+pwsx3907 power 0.504 0.5 -> 0.710 Inexact Rounded
+pwsx3908 power 0.0504 0.5 -> 0.224 Inexact Rounded
+pwsx3909 power 0.505 0.5 -> 0.711 Inexact Rounded
+pwsx3910 power 0.0505 0.5 -> 0.225 Inexact Rounded
+pwsx3911 power 0.506 0.5 -> 0.711 Inexact Rounded
+pwsx3912 power 0.0506 0.5 -> 0.225 Inexact Rounded
+pwsx3913 power 0.507 0.5 -> 0.712 Inexact Rounded
+pwsx3914 power 0.0507 0.5 -> 0.225 Inexact Rounded
+pwsx3915 power 0.508 0.5 -> 0.713 Inexact Rounded
+pwsx3916 power 0.0508 0.5 -> 0.225 Inexact Rounded
+pwsx3917 power 0.509 0.5 -> 0.713 Inexact Rounded
+pwsx3918 power 0.0509 0.5 -> 0.226 Inexact Rounded
+pwsx3919 power 0.511 0.5 -> 0.715 Inexact Rounded
+pwsx3920 power 0.0511 0.5 -> 0.226 Inexact Rounded
+pwsx3921 power 0.512 0.5 -> 0.716 Inexact Rounded
+pwsx3922 power 0.0512 0.5 -> 0.226 Inexact Rounded
+pwsx3923 power 0.513 0.5 -> 0.716 Inexact Rounded
+pwsx3924 power 0.0513 0.5 -> 0.226 Inexact Rounded
+pwsx3925 power 0.514 0.5 -> 0.717 Inexact Rounded
+pwsx3926 power 0.0514 0.5 -> 0.227 Inexact Rounded
+pwsx3927 power 0.515 0.5 -> 0.718 Inexact Rounded
+pwsx3928 power 0.0515 0.5 -> 0.227 Inexact Rounded
+pwsx3929 power 0.516 0.5 -> 0.718 Inexact Rounded
+pwsx3930 power 0.0516 0.5 -> 0.227 Inexact Rounded
+pwsx3931 power 0.517 0.5 -> 0.719 Inexact Rounded
+pwsx3932 power 0.0517 0.5 -> 0.227 Inexact Rounded
+pwsx3933 power 0.518 0.5 -> 0.720 Inexact Rounded
+pwsx3934 power 0.0518 0.5 -> 0.228 Inexact Rounded
+pwsx3935 power 0.519 0.5 -> 0.720 Inexact Rounded
+pwsx3936 power 0.0519 0.5 -> 0.228 Inexact Rounded
+pwsx3937 power 0.521 0.5 -> 0.722 Inexact Rounded
+pwsx3938 power 0.0521 0.5 -> 0.228 Inexact Rounded
+pwsx3939 power 0.522 0.5 -> 0.722 Inexact Rounded
+pwsx3940 power 0.0522 0.5 -> 0.228 Inexact Rounded
+pwsx3941 power 0.523 0.5 -> 0.723 Inexact Rounded
+pwsx3942 power 0.0523 0.5 -> 0.229 Inexact Rounded
+pwsx3943 power 0.524 0.5 -> 0.724 Inexact Rounded
+pwsx3944 power 0.0524 0.5 -> 0.229 Inexact Rounded
+pwsx3945 power 0.525 0.5 -> 0.725 Inexact Rounded
+pwsx3946 power 0.0525 0.5 -> 0.229 Inexact Rounded
+pwsx3947 power 0.526 0.5 -> 0.725 Inexact Rounded
+pwsx3948 power 0.0526 0.5 -> 0.229 Inexact Rounded
+pwsx3949 power 0.527 0.5 -> 0.726 Inexact Rounded
+pwsx3950 power 0.0527 0.5 -> 0.230 Inexact Rounded
+pwsx3951 power 0.528 0.5 -> 0.727 Inexact Rounded
+pwsx3952 power 0.0528 0.5 -> 0.230 Inexact Rounded
+pwsx3953 power 0.529 0.5 -> 0.727 Inexact Rounded
+pwsx3954 power 0.0529 0.5 -> 0.230 Inexact Rounded
+pwsx3955 power 0.531 0.5 -> 0.729 Inexact Rounded
+pwsx3956 power 0.0531 0.5 -> 0.230 Inexact Rounded
+pwsx3957 power 0.532 0.5 -> 0.729 Inexact Rounded
+pwsx3958 power 0.0532 0.5 -> 0.231 Inexact Rounded
+pwsx3959 power 0.533 0.5 -> 0.730 Inexact Rounded
+pwsx3960 power 0.0533 0.5 -> 0.231 Inexact Rounded
+pwsx3961 power 0.534 0.5 -> 0.731 Inexact Rounded
+pwsx3962 power 0.0534 0.5 -> 0.231 Inexact Rounded
+pwsx3963 power 0.535 0.5 -> 0.731 Inexact Rounded
+pwsx3964 power 0.0535 0.5 -> 0.231 Inexact Rounded
+pwsx3965 power 0.536 0.5 -> 0.732 Inexact Rounded
+pwsx3966 power 0.0536 0.5 -> 0.232 Inexact Rounded
+pwsx3967 power 0.537 0.5 -> 0.733 Inexact Rounded
+pwsx3968 power 0.0537 0.5 -> 0.232 Inexact Rounded
+pwsx3969 power 0.538 0.5 -> 0.733 Inexact Rounded
+pwsx3970 power 0.0538 0.5 -> 0.232 Inexact Rounded
+pwsx3971 power 0.539 0.5 -> 0.734 Inexact Rounded
+pwsx3972 power 0.0539 0.5 -> 0.232 Inexact Rounded
+pwsx3973 power 0.541 0.5 -> 0.736 Inexact Rounded
+pwsx3974 power 0.0541 0.5 -> 0.233 Inexact Rounded
+pwsx3975 power 0.542 0.5 -> 0.736 Inexact Rounded
+pwsx3976 power 0.0542 0.5 -> 0.233 Inexact Rounded
+pwsx3977 power 0.543 0.5 -> 0.737 Inexact Rounded
+pwsx3978 power 0.0543 0.5 -> 0.233 Inexact Rounded
+pwsx3979 power 0.544 0.5 -> 0.738 Inexact Rounded
+pwsx3980 power 0.0544 0.5 -> 0.233 Inexact Rounded
+pwsx3981 power 0.545 0.5 -> 0.738 Inexact Rounded
+pwsx3982 power 0.0545 0.5 -> 0.233 Inexact Rounded
+pwsx3983 power 0.546 0.5 -> 0.739 Inexact Rounded
+pwsx3984 power 0.0546 0.5 -> 0.234 Inexact Rounded
+pwsx3985 power 0.547 0.5 -> 0.740 Inexact Rounded
+pwsx3986 power 0.0547 0.5 -> 0.234 Inexact Rounded
+pwsx3987 power 0.548 0.5 -> 0.740 Inexact Rounded
+pwsx3988 power 0.0548 0.5 -> 0.234 Inexact Rounded
+pwsx3989 power 0.549 0.5 -> 0.741 Inexact Rounded
+pwsx3990 power 0.0549 0.5 -> 0.234 Inexact Rounded
+pwsx3991 power 0.551 0.5 -> 0.742 Inexact Rounded
+pwsx3992 power 0.0551 0.5 -> 0.235 Inexact Rounded
+pwsx3993 power 0.552 0.5 -> 0.743 Inexact Rounded
+pwsx3994 power 0.0552 0.5 -> 0.235 Inexact Rounded
+pwsx3995 power 0.553 0.5 -> 0.744 Inexact Rounded
+pwsx3996 power 0.0553 0.5 -> 0.235 Inexact Rounded
+pwsx3997 power 0.554 0.5 -> 0.744 Inexact Rounded
+pwsx3998 power 0.0554 0.5 -> 0.235 Inexact Rounded
+pwsx3999 power 0.555 0.5 -> 0.745 Inexact Rounded
+pwsx4000 power 0.0555 0.5 -> 0.236 Inexact Rounded
+pwsx4001 power 0.556 0.5 -> 0.746 Inexact Rounded
+pwsx4002 power 0.0556 0.5 -> 0.236 Inexact Rounded
+pwsx4003 power 0.557 0.5 -> 0.746 Inexact Rounded
+pwsx4004 power 0.0557 0.5 -> 0.236 Inexact Rounded
+pwsx4005 power 0.558 0.5 -> 0.747 Inexact Rounded
+pwsx4006 power 0.0558 0.5 -> 0.236 Inexact Rounded
+pwsx4007 power 0.559 0.5 -> 0.748 Inexact Rounded
+pwsx4008 power 0.0559 0.5 -> 0.236 Inexact Rounded
+pwsx4009 power 0.561 0.5 -> 0.749 Inexact Rounded
+pwsx4010 power 0.0561 0.5 -> 0.237 Inexact Rounded
+pwsx4011 power 0.562 0.5 -> 0.750 Inexact Rounded
+pwsx4012 power 0.0562 0.5 -> 0.237 Inexact Rounded
+pwsx4013 power 0.563 0.5 -> 0.750 Inexact Rounded
+pwsx4014 power 0.0563 0.5 -> 0.237 Inexact Rounded
+pwsx4015 power 0.564 0.5 -> 0.751 Inexact Rounded
+pwsx4016 power 0.0564 0.5 -> 0.237 Inexact Rounded
+pwsx4017 power 0.565 0.5 -> 0.752 Inexact Rounded
+pwsx4018 power 0.0565 0.5 -> 0.238 Inexact Rounded
+pwsx4019 power 0.566 0.5 -> 0.752 Inexact Rounded
+pwsx4020 power 0.0566 0.5 -> 0.238 Inexact Rounded
+pwsx4021 power 0.567 0.5 -> 0.753 Inexact Rounded
+pwsx4022 power 0.0567 0.5 -> 0.238 Inexact Rounded
+pwsx4023 power 0.568 0.5 -> 0.754 Inexact Rounded
+pwsx4024 power 0.0568 0.5 -> 0.238 Inexact Rounded
+pwsx4025 power 0.569 0.5 -> 0.754 Inexact Rounded
+pwsx4026 power 0.0569 0.5 -> 0.239 Inexact Rounded
+pwsx4027 power 0.571 0.5 -> 0.756 Inexact Rounded
+pwsx4028 power 0.0571 0.5 -> 0.239 Inexact Rounded
+pwsx4029 power 0.572 0.5 -> 0.756 Inexact Rounded
+pwsx4030 power 0.0572 0.5 -> 0.239 Inexact Rounded
+pwsx4031 power 0.573 0.5 -> 0.757 Inexact Rounded
+pwsx4032 power 0.0573 0.5 -> 0.239 Inexact Rounded
+pwsx4033 power 0.574 0.5 -> 0.758 Inexact Rounded
+pwsx4034 power 0.0574 0.5 -> 0.240 Inexact Rounded
+pwsx4035 power 0.575 0.5 -> 0.758 Inexact Rounded
+pwsx4036 power 0.0575 0.5 -> 0.240 Inexact Rounded
+pwsx4037 power 0.576 0.5 -> 0.759 Inexact Rounded
+pwsx4038 power 0.0576 0.5 -> 0.240 Inexact Rounded
+pwsx4039 power 0.577 0.5 -> 0.760 Inexact Rounded
+pwsx4040 power 0.0577 0.5 -> 0.240 Inexact Rounded
+pwsx4041 power 0.578 0.5 -> 0.760 Inexact Rounded
+pwsx4042 power 0.0578 0.5 -> 0.240 Inexact Rounded
+pwsx4043 power 0.579 0.5 -> 0.761 Inexact Rounded
+pwsx4044 power 0.0579 0.5 -> 0.241 Inexact Rounded
+pwsx4045 power 0.581 0.5 -> 0.762 Inexact Rounded
+pwsx4046 power 0.0581 0.5 -> 0.241 Inexact Rounded
+pwsx4047 power 0.582 0.5 -> 0.763 Inexact Rounded
+pwsx4048 power 0.0582 0.5 -> 0.241 Inexact Rounded
+pwsx4049 power 0.583 0.5 -> 0.764 Inexact Rounded
+pwsx4050 power 0.0583 0.5 -> 0.241 Inexact Rounded
+pwsx4051 power 0.584 0.5 -> 0.764 Inexact Rounded
+pwsx4052 power 0.0584 0.5 -> 0.242 Inexact Rounded
+pwsx4053 power 0.585 0.5 -> 0.765 Inexact Rounded
+pwsx4054 power 0.0585 0.5 -> 0.242 Inexact Rounded
+pwsx4055 power 0.586 0.5 -> 0.766 Inexact Rounded
+pwsx4056 power 0.0586 0.5 -> 0.242 Inexact Rounded
+pwsx4057 power 0.587 0.5 -> 0.766 Inexact Rounded
+pwsx4058 power 0.0587 0.5 -> 0.242 Inexact Rounded
+pwsx4059 power 0.588 0.5 -> 0.767 Inexact Rounded
+pwsx4060 power 0.0588 0.5 -> 0.242 Inexact Rounded
+pwsx4061 power 0.589 0.5 -> 0.767 Inexact Rounded
+pwsx4062 power 0.0589 0.5 -> 0.243 Inexact Rounded
+pwsx4063 power 0.591 0.5 -> 0.769 Inexact Rounded
+pwsx4064 power 0.0591 0.5 -> 0.243 Inexact Rounded
+pwsx4065 power 0.592 0.5 -> 0.769 Inexact Rounded
+pwsx4066 power 0.0592 0.5 -> 0.243 Inexact Rounded
+pwsx4067 power 0.593 0.5 -> 0.770 Inexact Rounded
+pwsx4068 power 0.0593 0.5 -> 0.244 Inexact Rounded
+pwsx4069 power 0.594 0.5 -> 0.771 Inexact Rounded
+pwsx4070 power 0.0594 0.5 -> 0.244 Inexact Rounded
+pwsx4071 power 0.595 0.5 -> 0.771 Inexact Rounded
+pwsx4072 power 0.0595 0.5 -> 0.244 Inexact Rounded
+pwsx4073 power 0.596 0.5 -> 0.772 Inexact Rounded
+pwsx4074 power 0.0596 0.5 -> 0.244 Inexact Rounded
+pwsx4075 power 0.597 0.5 -> 0.773 Inexact Rounded
+pwsx4076 power 0.0597 0.5 -> 0.244 Inexact Rounded
+pwsx4077 power 0.598 0.5 -> 0.773 Inexact Rounded
+pwsx4078 power 0.0598 0.5 -> 0.245 Inexact Rounded
+pwsx4079 power 0.599 0.5 -> 0.774 Inexact Rounded
+pwsx4080 power 0.0599 0.5 -> 0.245 Inexact Rounded
+pwsx4081 power 0.601 0.5 -> 0.775 Inexact Rounded
+pwsx4082 power 0.0601 0.5 -> 0.245 Inexact Rounded
+pwsx4083 power 0.602 0.5 -> 0.776 Inexact Rounded
+pwsx4084 power 0.0602 0.5 -> 0.245 Inexact Rounded
+pwsx4085 power 0.603 0.5 -> 0.777 Inexact Rounded
+pwsx4086 power 0.0603 0.5 -> 0.246 Inexact Rounded
+pwsx4087 power 0.604 0.5 -> 0.777 Inexact Rounded
+pwsx4088 power 0.0604 0.5 -> 0.246 Inexact Rounded
+pwsx4089 power 0.605 0.5 -> 0.778 Inexact Rounded
+pwsx4090 power 0.0605 0.5 -> 0.246 Inexact Rounded
+pwsx4091 power 0.606 0.5 -> 0.778 Inexact Rounded
+pwsx4092 power 0.0606 0.5 -> 0.246 Inexact Rounded
+pwsx4093 power 0.607 0.5 -> 0.779 Inexact Rounded
+pwsx4094 power 0.0607 0.5 -> 0.246 Inexact Rounded
+pwsx4095 power 0.608 0.5 -> 0.780 Inexact Rounded
+pwsx4096 power 0.0608 0.5 -> 0.247 Inexact Rounded
+pwsx4097 power 0.609 0.5 -> 0.780 Inexact Rounded
+pwsx4098 power 0.0609 0.5 -> 0.247 Inexact Rounded
+pwsx4099 power 0.611 0.5 -> 0.782 Inexact Rounded
+pwsx4100 power 0.0611 0.5 -> 0.247 Inexact Rounded
+pwsx4101 power 0.612 0.5 -> 0.782 Inexact Rounded
+pwsx4102 power 0.0612 0.5 -> 0.247 Inexact Rounded
+pwsx4103 power 0.613 0.5 -> 0.783 Inexact Rounded
+pwsx4104 power 0.0613 0.5 -> 0.248 Inexact Rounded
+pwsx4105 power 0.614 0.5 -> 0.784 Inexact Rounded
+pwsx4106 power 0.0614 0.5 -> 0.248 Inexact Rounded
+pwsx4107 power 0.615 0.5 -> 0.784 Inexact Rounded
+pwsx4108 power 0.0615 0.5 -> 0.248 Inexact Rounded
+pwsx4109 power 0.616 0.5 -> 0.785 Inexact Rounded
+pwsx4110 power 0.0616 0.5 -> 0.248 Inexact Rounded
+pwsx4111 power 0.617 0.5 -> 0.785 Inexact Rounded
+pwsx4112 power 0.0617 0.5 -> 0.248 Inexact Rounded
+pwsx4113 power 0.618 0.5 -> 0.786 Inexact Rounded
+pwsx4114 power 0.0618 0.5 -> 0.249 Inexact Rounded
+pwsx4115 power 0.619 0.5 -> 0.787 Inexact Rounded
+pwsx4116 power 0.0619 0.5 -> 0.249 Inexact Rounded
+pwsx4117 power 0.621 0.5 -> 0.788 Inexact Rounded
+pwsx4118 power 0.0621 0.5 -> 0.249 Inexact Rounded
+pwsx4119 power 0.622 0.5 -> 0.789 Inexact Rounded
+pwsx4120 power 0.0622 0.5 -> 0.249 Inexact Rounded
+pwsx4121 power 0.623 0.5 -> 0.789 Inexact Rounded
+pwsx4122 power 0.0623 0.5 -> 0.250 Inexact Rounded
+pwsx4123 power 0.624 0.5 -> 0.790 Inexact Rounded
+pwsx4124 power 0.0624 0.5 -> 0.250 Inexact Rounded
+pwsx4125 power 0.625 0.5 -> 0.791 Inexact Rounded
+pwsx4126 power 0.0625 0.5 -> 0.250 Inexact Rounded
+pwsx4127 power 0.626 0.5 -> 0.791 Inexact Rounded
+pwsx4128 power 0.0626 0.5 -> 0.250 Inexact Rounded
+pwsx4129 power 0.627 0.5 -> 0.792 Inexact Rounded
+pwsx4130 power 0.0627 0.5 -> 0.250 Inexact Rounded
+pwsx4131 power 0.628 0.5 -> 0.792 Inexact Rounded
+pwsx4132 power 0.0628 0.5 -> 0.251 Inexact Rounded
+pwsx4133 power 0.629 0.5 -> 0.793 Inexact Rounded
+pwsx4134 power 0.0629 0.5 -> 0.251 Inexact Rounded
+pwsx4135 power 0.631 0.5 -> 0.794 Inexact Rounded
+pwsx4136 power 0.0631 0.5 -> 0.251 Inexact Rounded
+pwsx4137 power 0.632 0.5 -> 0.795 Inexact Rounded
+pwsx4138 power 0.0632 0.5 -> 0.251 Inexact Rounded
+pwsx4139 power 0.633 0.5 -> 0.796 Inexact Rounded
+pwsx4140 power 0.0633 0.5 -> 0.252 Inexact Rounded
+pwsx4141 power 0.634 0.5 -> 0.796 Inexact Rounded
+pwsx4142 power 0.0634 0.5 -> 0.252 Inexact Rounded
+pwsx4143 power 0.635 0.5 -> 0.797 Inexact Rounded
+pwsx4144 power 0.0635 0.5 -> 0.252 Inexact Rounded
+pwsx4145 power 0.636 0.5 -> 0.797 Inexact Rounded
+pwsx4146 power 0.0636 0.5 -> 0.252 Inexact Rounded
+pwsx4147 power 0.637 0.5 -> 0.798 Inexact Rounded
+pwsx4148 power 0.0637 0.5 -> 0.252 Inexact Rounded
+pwsx4149 power 0.638 0.5 -> 0.799 Inexact Rounded
+pwsx4150 power 0.0638 0.5 -> 0.253 Inexact Rounded
+pwsx4151 power 0.639 0.5 -> 0.799 Inexact Rounded
+pwsx4152 power 0.0639 0.5 -> 0.253 Inexact Rounded
+pwsx4153 power 0.641 0.5 -> 0.801 Inexact Rounded
+pwsx4154 power 0.0641 0.5 -> 0.253 Inexact Rounded
+pwsx4155 power 0.642 0.5 -> 0.801 Inexact Rounded
+pwsx4156 power 0.0642 0.5 -> 0.253 Inexact Rounded
+pwsx4157 power 0.643 0.5 -> 0.802 Inexact Rounded
+pwsx4158 power 0.0643 0.5 -> 0.254 Inexact Rounded
+pwsx4159 power 0.644 0.5 -> 0.802 Inexact Rounded
+pwsx4160 power 0.0644 0.5 -> 0.254 Inexact Rounded
+pwsx4161 power 0.645 0.5 -> 0.803 Inexact Rounded
+pwsx4162 power 0.0645 0.5 -> 0.254 Inexact Rounded
+pwsx4163 power 0.646 0.5 -> 0.804 Inexact Rounded
+pwsx4164 power 0.0646 0.5 -> 0.254 Inexact Rounded
+pwsx4165 power 0.647 0.5 -> 0.804 Inexact Rounded
+pwsx4166 power 0.0647 0.5 -> 0.254 Inexact Rounded
+pwsx4167 power 0.648 0.5 -> 0.805 Inexact Rounded
+pwsx4168 power 0.0648 0.5 -> 0.255 Inexact Rounded
+pwsx4169 power 0.649 0.5 -> 0.806 Inexact Rounded
+pwsx4170 power 0.0649 0.5 -> 0.255 Inexact Rounded
+pwsx4171 power 0.651 0.5 -> 0.807 Inexact Rounded
+pwsx4172 power 0.0651 0.5 -> 0.255 Inexact Rounded
+pwsx4173 power 0.652 0.5 -> 0.807 Inexact Rounded
+pwsx4174 power 0.0652 0.5 -> 0.255 Inexact Rounded
+pwsx4175 power 0.653 0.5 -> 0.808 Inexact Rounded
+pwsx4176 power 0.0653 0.5 -> 0.256 Inexact Rounded
+pwsx4177 power 0.654 0.5 -> 0.809 Inexact Rounded
+pwsx4178 power 0.0654 0.5 -> 0.256 Inexact Rounded
+pwsx4179 power 0.655 0.5 -> 0.809 Inexact Rounded
+pwsx4180 power 0.0655 0.5 -> 0.256 Inexact Rounded
+pwsx4181 power 0.656 0.5 -> 0.810 Inexact Rounded
+pwsx4182 power 0.0656 0.5 -> 0.256 Inexact Rounded
+pwsx4183 power 0.657 0.5 -> 0.811 Inexact Rounded
+pwsx4184 power 0.0657 0.5 -> 0.256 Inexact Rounded
+pwsx4185 power 0.658 0.5 -> 0.811 Inexact Rounded
+pwsx4186 power 0.0658 0.5 -> 0.257 Inexact Rounded
+pwsx4187 power 0.659 0.5 -> 0.812 Inexact Rounded
+pwsx4188 power 0.0659 0.5 -> 0.257 Inexact Rounded
+pwsx4189 power 0.661 0.5 -> 0.813 Inexact Rounded
+pwsx4190 power 0.0661 0.5 -> 0.257 Inexact Rounded
+pwsx4191 power 0.662 0.5 -> 0.814 Inexact Rounded
+pwsx4192 power 0.0662 0.5 -> 0.257 Inexact Rounded
+pwsx4193 power 0.663 0.5 -> 0.814 Inexact Rounded
+pwsx4194 power 0.0663 0.5 -> 0.257 Inexact Rounded
+pwsx4195 power 0.664 0.5 -> 0.815 Inexact Rounded
+pwsx4196 power 0.0664 0.5 -> 0.258 Inexact Rounded
+pwsx4197 power 0.665 0.5 -> 0.815 Inexact Rounded
+pwsx4198 power 0.0665 0.5 -> 0.258 Inexact Rounded
+pwsx4199 power 0.666 0.5 -> 0.816 Inexact Rounded
+pwsx4200 power 0.0666 0.5 -> 0.258 Inexact Rounded
+pwsx4201 power 0.667 0.5 -> 0.817 Inexact Rounded
+pwsx4202 power 0.0667 0.5 -> 0.258 Inexact Rounded
+pwsx4203 power 0.668 0.5 -> 0.817 Inexact Rounded
+pwsx4204 power 0.0668 0.5 -> 0.258 Inexact Rounded
+pwsx4205 power 0.669 0.5 -> 0.818 Inexact Rounded
+pwsx4206 power 0.0669 0.5 -> 0.259 Inexact Rounded
+pwsx4207 power 0.671 0.5 -> 0.819 Inexact Rounded
+pwsx4208 power 0.0671 0.5 -> 0.259 Inexact Rounded
+pwsx4209 power 0.672 0.5 -> 0.820 Inexact Rounded
+pwsx4210 power 0.0672 0.5 -> 0.259 Inexact Rounded
+pwsx4211 power 0.673 0.5 -> 0.820 Inexact Rounded
+pwsx4212 power 0.0673 0.5 -> 0.259 Inexact Rounded
+pwsx4213 power 0.674 0.5 -> 0.821 Inexact Rounded
+pwsx4214 power 0.0674 0.5 -> 0.260 Inexact Rounded
+pwsx4215 power 0.675 0.5 -> 0.822 Inexact Rounded
+pwsx4216 power 0.0675 0.5 -> 0.260 Inexact Rounded
+pwsx4217 power 0.676 0.5 -> 0.822 Inexact Rounded
+pwsx4218 power 0.0676 0.5 -> 0.260 Inexact Rounded
+pwsx4219 power 0.677 0.5 -> 0.823 Inexact Rounded
+pwsx4220 power 0.0677 0.5 -> 0.260 Inexact Rounded
+pwsx4221 power 0.678 0.5 -> 0.823 Inexact Rounded
+pwsx4222 power 0.0678 0.5 -> 0.260 Inexact Rounded
+pwsx4223 power 0.679 0.5 -> 0.824 Inexact Rounded
+pwsx4224 power 0.0679 0.5 -> 0.261 Inexact Rounded
+pwsx4225 power 0.681 0.5 -> 0.825 Inexact Rounded
+pwsx4226 power 0.0681 0.5 -> 0.261 Inexact Rounded
+pwsx4227 power 0.682 0.5 -> 0.826 Inexact Rounded
+pwsx4228 power 0.0682 0.5 -> 0.261 Inexact Rounded
+pwsx4229 power 0.683 0.5 -> 0.826 Inexact Rounded
+pwsx4230 power 0.0683 0.5 -> 0.261 Inexact Rounded
+pwsx4231 power 0.684 0.5 -> 0.827 Inexact Rounded
+pwsx4232 power 0.0684 0.5 -> 0.262 Inexact Rounded
+pwsx4233 power 0.685 0.5 -> 0.828 Inexact Rounded
+pwsx4234 power 0.0685 0.5 -> 0.262 Inexact Rounded
+pwsx4235 power 0.686 0.5 -> 0.828 Inexact Rounded
+pwsx4236 power 0.0686 0.5 -> 0.262 Inexact Rounded
+pwsx4237 power 0.687 0.5 -> 0.829 Inexact Rounded
+pwsx4238 power 0.0687 0.5 -> 0.262 Inexact Rounded
+pwsx4239 power 0.688 0.5 -> 0.829 Inexact Rounded
+pwsx4240 power 0.0688 0.5 -> 0.262 Inexact Rounded
+pwsx4241 power 0.689 0.5 -> 0.830 Inexact Rounded
+pwsx4242 power 0.0689 0.5 -> 0.262 Inexact Rounded
+pwsx4243 power 0.691 0.5 -> 0.831 Inexact Rounded
+pwsx4244 power 0.0691 0.5 -> 0.263 Inexact Rounded
+pwsx4245 power 0.692 0.5 -> 0.832 Inexact Rounded
+pwsx4246 power 0.0692 0.5 -> 0.263 Inexact Rounded
+pwsx4247 power 0.693 0.5 -> 0.832 Inexact Rounded
+pwsx4248 power 0.0693 0.5 -> 0.263 Inexact Rounded
+pwsx4249 power 0.694 0.5 -> 0.833 Inexact Rounded
+pwsx4250 power 0.0694 0.5 -> 0.263 Inexact Rounded
+pwsx4251 power 0.695 0.5 -> 0.834 Inexact Rounded
+pwsx4252 power 0.0695 0.5 -> 0.264 Inexact Rounded
+pwsx4253 power 0.696 0.5 -> 0.834 Inexact Rounded
+pwsx4254 power 0.0696 0.5 -> 0.264 Inexact Rounded
+pwsx4255 power 0.697 0.5 -> 0.835 Inexact Rounded
+pwsx4256 power 0.0697 0.5 -> 0.264 Inexact Rounded
+pwsx4257 power 0.698 0.5 -> 0.835 Inexact Rounded
+pwsx4258 power 0.0698 0.5 -> 0.264 Inexact Rounded
+pwsx4259 power 0.699 0.5 -> 0.836 Inexact Rounded
+pwsx4260 power 0.0699 0.5 -> 0.264 Inexact Rounded
+pwsx4261 power 0.701 0.5 -> 0.837 Inexact Rounded
+pwsx4262 power 0.0701 0.5 -> 0.265 Inexact Rounded
+pwsx4263 power 0.702 0.5 -> 0.838 Inexact Rounded
+pwsx4264 power 0.0702 0.5 -> 0.265 Inexact Rounded
+pwsx4265 power 0.703 0.5 -> 0.838 Inexact Rounded
+pwsx4266 power 0.0703 0.5 -> 0.265 Inexact Rounded
+pwsx4267 power 0.704 0.5 -> 0.839 Inexact Rounded
+pwsx4268 power 0.0704 0.5 -> 0.265 Inexact Rounded
+pwsx4269 power 0.705 0.5 -> 0.840 Inexact Rounded
+pwsx4270 power 0.0705 0.5 -> 0.266 Inexact Rounded
+pwsx4271 power 0.706 0.5 -> 0.840 Inexact Rounded
+pwsx4272 power 0.0706 0.5 -> 0.266 Inexact Rounded
+pwsx4273 power 0.707 0.5 -> 0.841 Inexact Rounded
+pwsx4274 power 0.0707 0.5 -> 0.266 Inexact Rounded
+pwsx4275 power 0.708 0.5 -> 0.841 Inexact Rounded
+pwsx4276 power 0.0708 0.5 -> 0.266 Inexact Rounded
+pwsx4277 power 0.709 0.5 -> 0.842 Inexact Rounded
+pwsx4278 power 0.0709 0.5 -> 0.266 Inexact Rounded
+pwsx4279 power 0.711 0.5 -> 0.843 Inexact Rounded
+pwsx4280 power 0.0711 0.5 -> 0.267 Inexact Rounded
+pwsx4281 power 0.712 0.5 -> 0.844 Inexact Rounded
+pwsx4282 power 0.0712 0.5 -> 0.267 Inexact Rounded
+pwsx4283 power 0.713 0.5 -> 0.844 Inexact Rounded
+pwsx4284 power 0.0713 0.5 -> 0.267 Inexact Rounded
+pwsx4285 power 0.714 0.5 -> 0.845 Inexact Rounded
+pwsx4286 power 0.0714 0.5 -> 0.267 Inexact Rounded
+pwsx4287 power 0.715 0.5 -> 0.846 Inexact Rounded
+pwsx4288 power 0.0715 0.5 -> 0.267 Inexact Rounded
+pwsx4289 power 0.716 0.5 -> 0.846 Inexact Rounded
+pwsx4290 power 0.0716 0.5 -> 0.268 Inexact Rounded
+pwsx4291 power 0.717 0.5 -> 0.847 Inexact Rounded
+pwsx4292 power 0.0717 0.5 -> 0.268 Inexact Rounded
+pwsx4293 power 0.718 0.5 -> 0.847 Inexact Rounded
+pwsx4294 power 0.0718 0.5 -> 0.268 Inexact Rounded
+pwsx4295 power 0.719 0.5 -> 0.848 Inexact Rounded
+pwsx4296 power 0.0719 0.5 -> 0.268 Inexact Rounded
+pwsx4297 power 0.721 0.5 -> 0.849 Inexact Rounded
+pwsx4298 power 0.0721 0.5 -> 0.269 Inexact Rounded
+pwsx4299 power 0.722 0.5 -> 0.850 Inexact Rounded
+pwsx4300 power 0.0722 0.5 -> 0.269 Inexact Rounded
+pwsx4301 power 0.723 0.5 -> 0.850 Inexact Rounded
+pwsx4302 power 0.0723 0.5 -> 0.269 Inexact Rounded
+pwsx4303 power 0.724 0.5 -> 0.851 Inexact Rounded
+pwsx4304 power 0.0724 0.5 -> 0.269 Inexact Rounded
+pwsx4305 power 0.725 0.5 -> 0.851 Inexact Rounded
+pwsx4306 power 0.0725 0.5 -> 0.269 Inexact Rounded
+pwsx4307 power 0.726 0.5 -> 0.852 Inexact Rounded
+pwsx4308 power 0.0726 0.5 -> 0.269 Inexact Rounded
+pwsx4309 power 0.727 0.5 -> 0.853 Inexact Rounded
+pwsx4310 power 0.0727 0.5 -> 0.270 Inexact Rounded
+pwsx4311 power 0.728 0.5 -> 0.853 Inexact Rounded
+pwsx4312 power 0.0728 0.5 -> 0.270 Inexact Rounded
+pwsx4313 power 0.729 0.5 -> 0.854 Inexact Rounded
+pwsx4314 power 0.0729 0.5 -> 0.270 Inexact Rounded
+pwsx4315 power 0.731 0.5 -> 0.855 Inexact Rounded
+pwsx4316 power 0.0731 0.5 -> 0.270 Inexact Rounded
+pwsx4317 power 0.732 0.5 -> 0.856 Inexact Rounded
+pwsx4318 power 0.0732 0.5 -> 0.271 Inexact Rounded
+pwsx4319 power 0.733 0.5 -> 0.856 Inexact Rounded
+pwsx4320 power 0.0733 0.5 -> 0.271 Inexact Rounded
+pwsx4321 power 0.734 0.5 -> 0.857 Inexact Rounded
+pwsx4322 power 0.0734 0.5 -> 0.271 Inexact Rounded
+pwsx4323 power 0.735 0.5 -> 0.857 Inexact Rounded
+pwsx4324 power 0.0735 0.5 -> 0.271 Inexact Rounded
+pwsx4325 power 0.736 0.5 -> 0.858 Inexact Rounded
+pwsx4326 power 0.0736 0.5 -> 0.271 Inexact Rounded
+pwsx4327 power 0.737 0.5 -> 0.858 Inexact Rounded
+pwsx4328 power 0.0737 0.5 -> 0.271 Inexact Rounded
+pwsx4329 power 0.738 0.5 -> 0.859 Inexact Rounded
+pwsx4330 power 0.0738 0.5 -> 0.272 Inexact Rounded
+pwsx4331 power 0.739 0.5 -> 0.860 Inexact Rounded
+pwsx4332 power 0.0739 0.5 -> 0.272 Inexact Rounded
+pwsx4333 power 0.741 0.5 -> 0.861 Inexact Rounded
+pwsx4334 power 0.0741 0.5 -> 0.272 Inexact Rounded
+pwsx4335 power 0.742 0.5 -> 0.861 Inexact Rounded
+pwsx4336 power 0.0742 0.5 -> 0.272 Inexact Rounded
+pwsx4337 power 0.743 0.5 -> 0.862 Inexact Rounded
+pwsx4338 power 0.0743 0.5 -> 0.273 Inexact Rounded
+pwsx4339 power 0.744 0.5 -> 0.863 Inexact Rounded
+pwsx4340 power 0.0744 0.5 -> 0.273 Inexact Rounded
+pwsx4341 power 0.745 0.5 -> 0.863 Inexact Rounded
+pwsx4342 power 0.0745 0.5 -> 0.273 Inexact Rounded
+pwsx4343 power 0.746 0.5 -> 0.864 Inexact Rounded
+pwsx4344 power 0.0746 0.5 -> 0.273 Inexact Rounded
+pwsx4345 power 0.747 0.5 -> 0.864 Inexact Rounded
+pwsx4346 power 0.0747 0.5 -> 0.273 Inexact Rounded
+pwsx4347 power 0.748 0.5 -> 0.865 Inexact Rounded
+pwsx4348 power 0.0748 0.5 -> 0.273 Inexact Rounded
+pwsx4349 power 0.749 0.5 -> 0.865 Inexact Rounded
+pwsx4350 power 0.0749 0.5 -> 0.274 Inexact Rounded
+pwsx4351 power 0.751 0.5 -> 0.867 Inexact Rounded
+pwsx4352 power 0.0751 0.5 -> 0.274 Inexact Rounded
+pwsx4353 power 0.752 0.5 -> 0.867 Inexact Rounded
+pwsx4354 power 0.0752 0.5 -> 0.274 Inexact Rounded
+pwsx4355 power 0.753 0.5 -> 0.868 Inexact Rounded
+pwsx4356 power 0.0753 0.5 -> 0.274 Inexact Rounded
+pwsx4357 power 0.754 0.5 -> 0.868 Inexact Rounded
+pwsx4358 power 0.0754 0.5 -> 0.275 Inexact Rounded
+pwsx4359 power 0.755 0.5 -> 0.869 Inexact Rounded
+pwsx4360 power 0.0755 0.5 -> 0.275 Inexact Rounded
+pwsx4361 power 0.756 0.5 -> 0.869 Inexact Rounded
+pwsx4362 power 0.0756 0.5 -> 0.275 Inexact Rounded
+pwsx4363 power 0.757 0.5 -> 0.870 Inexact Rounded
+pwsx4364 power 0.0757 0.5 -> 0.275 Inexact Rounded
+pwsx4365 power 0.758 0.5 -> 0.871 Inexact Rounded
+pwsx4366 power 0.0758 0.5 -> 0.275 Inexact Rounded
+pwsx4367 power 0.759 0.5 -> 0.871 Inexact Rounded
+pwsx4368 power 0.0759 0.5 -> 0.275 Inexact Rounded
+pwsx4369 power 0.761 0.5 -> 0.872 Inexact Rounded
+pwsx4370 power 0.0761 0.5 -> 0.276 Inexact Rounded
+pwsx4371 power 0.762 0.5 -> 0.873 Inexact Rounded
+pwsx4372 power 0.0762 0.5 -> 0.276 Inexact Rounded
+pwsx4373 power 0.763 0.5 -> 0.873 Inexact Rounded
+pwsx4374 power 0.0763 0.5 -> 0.276 Inexact Rounded
+pwsx4375 power 0.764 0.5 -> 0.874 Inexact Rounded
+pwsx4376 power 0.0764 0.5 -> 0.276 Inexact Rounded
+pwsx4377 power 0.765 0.5 -> 0.875 Inexact Rounded
+pwsx4378 power 0.0765 0.5 -> 0.277 Inexact Rounded
+pwsx4379 power 0.766 0.5 -> 0.875 Inexact Rounded
+pwsx4380 power 0.0766 0.5 -> 0.277 Inexact Rounded
+pwsx4381 power 0.767 0.5 -> 0.876 Inexact Rounded
+pwsx4382 power 0.0767 0.5 -> 0.277 Inexact Rounded
+pwsx4383 power 0.768 0.5 -> 0.876 Inexact Rounded
+pwsx4384 power 0.0768 0.5 -> 0.277 Inexact Rounded
+pwsx4385 power 0.769 0.5 -> 0.877 Inexact Rounded
+pwsx4386 power 0.0769 0.5 -> 0.277 Inexact Rounded
+pwsx4387 power 0.771 0.5 -> 0.878 Inexact Rounded
+pwsx4388 power 0.0771 0.5 -> 0.278 Inexact Rounded
+pwsx4389 power 0.772 0.5 -> 0.879 Inexact Rounded
+pwsx4390 power 0.0772 0.5 -> 0.278 Inexact Rounded
+pwsx4391 power 0.773 0.5 -> 0.879 Inexact Rounded
+pwsx4392 power 0.0773 0.5 -> 0.278 Inexact Rounded
+pwsx4393 power 0.774 0.5 -> 0.880 Inexact Rounded
+pwsx4394 power 0.0774 0.5 -> 0.278 Inexact Rounded
+pwsx4395 power 0.775 0.5 -> 0.880 Inexact Rounded
+pwsx4396 power 0.0775 0.5 -> 0.278 Inexact Rounded
+pwsx4397 power 0.776 0.5 -> 0.881 Inexact Rounded
+pwsx4398 power 0.0776 0.5 -> 0.279 Inexact Rounded
+pwsx4399 power 0.777 0.5 -> 0.881 Inexact Rounded
+pwsx4400 power 0.0777 0.5 -> 0.279 Inexact Rounded
+pwsx4401 power 0.778 0.5 -> 0.882 Inexact Rounded
+pwsx4402 power 0.0778 0.5 -> 0.279 Inexact Rounded
+pwsx4403 power 0.779 0.5 -> 0.883 Inexact Rounded
+pwsx4404 power 0.0779 0.5 -> 0.279 Inexact Rounded
+pwsx4405 power 0.781 0.5 -> 0.884 Inexact Rounded
+pwsx4406 power 0.0781 0.5 -> 0.279 Inexact Rounded
+pwsx4407 power 0.782 0.5 -> 0.884 Inexact Rounded
+pwsx4408 power 0.0782 0.5 -> 0.280 Inexact Rounded
+pwsx4409 power 0.783 0.5 -> 0.885 Inexact Rounded
+pwsx4410 power 0.0783 0.5 -> 0.280 Inexact Rounded
+pwsx4411 power 0.784 0.5 -> 0.885 Inexact Rounded
+pwsx4412 power 0.0784 0.5 -> 0.280 Inexact Rounded
+pwsx4413 power 0.785 0.5 -> 0.886 Inexact Rounded
+pwsx4414 power 0.0785 0.5 -> 0.280 Inexact Rounded
+pwsx4415 power 0.786 0.5 -> 0.887 Inexact Rounded
+pwsx4416 power 0.0786 0.5 -> 0.280 Inexact Rounded
+pwsx4417 power 0.787 0.5 -> 0.887 Inexact Rounded
+pwsx4418 power 0.0787 0.5 -> 0.281 Inexact Rounded
+pwsx4419 power 0.788 0.5 -> 0.888 Inexact Rounded
+pwsx4420 power 0.0788 0.5 -> 0.281 Inexact Rounded
+pwsx4421 power 0.789 0.5 -> 0.888 Inexact Rounded
+pwsx4422 power 0.0789 0.5 -> 0.281 Inexact Rounded
+pwsx4423 power 0.791 0.5 -> 0.889 Inexact Rounded
+pwsx4424 power 0.0791 0.5 -> 0.281 Inexact Rounded
+pwsx4425 power 0.792 0.5 -> 0.890 Inexact Rounded
+pwsx4426 power 0.0792 0.5 -> 0.281 Inexact Rounded
+pwsx4427 power 0.793 0.5 -> 0.891 Inexact Rounded
+pwsx4428 power 0.0793 0.5 -> 0.282 Inexact Rounded
+pwsx4429 power 0.794 0.5 -> 0.891 Inexact Rounded
+pwsx4430 power 0.0794 0.5 -> 0.282 Inexact Rounded
+pwsx4431 power 0.795 0.5 -> 0.892 Inexact Rounded
+pwsx4432 power 0.0795 0.5 -> 0.282 Inexact Rounded
+pwsx4433 power 0.796 0.5 -> 0.892 Inexact Rounded
+pwsx4434 power 0.0796 0.5 -> 0.282 Inexact Rounded
+pwsx4435 power 0.797 0.5 -> 0.893 Inexact Rounded
+pwsx4436 power 0.0797 0.5 -> 0.282 Inexact Rounded
+pwsx4437 power 0.798 0.5 -> 0.893 Inexact Rounded
+pwsx4438 power 0.0798 0.5 -> 0.282 Inexact Rounded
+pwsx4439 power 0.799 0.5 -> 0.894 Inexact Rounded
+pwsx4440 power 0.0799 0.5 -> 0.283 Inexact Rounded
+pwsx4441 power 0.801 0.5 -> 0.895 Inexact Rounded
+pwsx4442 power 0.0801 0.5 -> 0.283 Inexact Rounded
+pwsx4443 power 0.802 0.5 -> 0.896 Inexact Rounded
+pwsx4444 power 0.0802 0.5 -> 0.283 Inexact Rounded
+pwsx4445 power 0.803 0.5 -> 0.896 Inexact Rounded
+pwsx4446 power 0.0803 0.5 -> 0.283 Inexact Rounded
+pwsx4447 power 0.804 0.5 -> 0.897 Inexact Rounded
+pwsx4448 power 0.0804 0.5 -> 0.284 Inexact Rounded
+pwsx4449 power 0.805 0.5 -> 0.897 Inexact Rounded
+pwsx4450 power 0.0805 0.5 -> 0.284 Inexact Rounded
+pwsx4451 power 0.806 0.5 -> 0.898 Inexact Rounded
+pwsx4452 power 0.0806 0.5 -> 0.284 Inexact Rounded
+pwsx4453 power 0.807 0.5 -> 0.898 Inexact Rounded
+pwsx4454 power 0.0807 0.5 -> 0.284 Inexact Rounded
+pwsx4455 power 0.808 0.5 -> 0.899 Inexact Rounded
+pwsx4456 power 0.0808 0.5 -> 0.284 Inexact Rounded
+pwsx4457 power 0.809 0.5 -> 0.899 Inexact Rounded
+pwsx4458 power 0.0809 0.5 -> 0.284 Inexact Rounded
+pwsx4459 power 0.811 0.5 -> 0.901 Inexact Rounded
+pwsx4460 power 0.0811 0.5 -> 0.285 Inexact Rounded
+pwsx4461 power 0.812 0.5 -> 0.901 Inexact Rounded
+pwsx4462 power 0.0812 0.5 -> 0.285 Inexact Rounded
+pwsx4463 power 0.813 0.5 -> 0.902 Inexact Rounded
+pwsx4464 power 0.0813 0.5 -> 0.285 Inexact Rounded
+pwsx4465 power 0.814 0.5 -> 0.902 Inexact Rounded
+pwsx4466 power 0.0814 0.5 -> 0.285 Inexact Rounded
+pwsx4467 power 0.815 0.5 -> 0.903 Inexact Rounded
+pwsx4468 power 0.0815 0.5 -> 0.285 Inexact Rounded
+pwsx4469 power 0.816 0.5 -> 0.903 Inexact Rounded
+pwsx4470 power 0.0816 0.5 -> 0.286 Inexact Rounded
+pwsx4471 power 0.817 0.5 -> 0.904 Inexact Rounded
+pwsx4472 power 0.0817 0.5 -> 0.286 Inexact Rounded
+pwsx4473 power 0.818 0.5 -> 0.904 Inexact Rounded
+pwsx4474 power 0.0818 0.5 -> 0.286 Inexact Rounded
+pwsx4475 power 0.819 0.5 -> 0.905 Inexact Rounded
+pwsx4476 power 0.0819 0.5 -> 0.286 Inexact Rounded
+pwsx4477 power 0.821 0.5 -> 0.906 Inexact Rounded
+pwsx4478 power 0.0821 0.5 -> 0.287 Inexact Rounded
+pwsx4479 power 0.822 0.5 -> 0.907 Inexact Rounded
+pwsx4480 power 0.0822 0.5 -> 0.287 Inexact Rounded
+pwsx4481 power 0.823 0.5 -> 0.907 Inexact Rounded
+pwsx4482 power 0.0823 0.5 -> 0.287 Inexact Rounded
+pwsx4483 power 0.824 0.5 -> 0.908 Inexact Rounded
+pwsx4484 power 0.0824 0.5 -> 0.287 Inexact Rounded
+pwsx4485 power 0.825 0.5 -> 0.908 Inexact Rounded
+pwsx4486 power 0.0825 0.5 -> 0.287 Inexact Rounded
+pwsx4487 power 0.826 0.5 -> 0.909 Inexact Rounded
+pwsx4488 power 0.0826 0.5 -> 0.287 Inexact Rounded
+pwsx4489 power 0.827 0.5 -> 0.909 Inexact Rounded
+pwsx4490 power 0.0827 0.5 -> 0.288 Inexact Rounded
+pwsx4491 power 0.828 0.5 -> 0.910 Inexact Rounded
+pwsx4492 power 0.0828 0.5 -> 0.288 Inexact Rounded
+pwsx4493 power 0.829 0.5 -> 0.910 Inexact Rounded
+pwsx4494 power 0.0829 0.5 -> 0.288 Inexact Rounded
+pwsx4495 power 0.831 0.5 -> 0.912 Inexact Rounded
+pwsx4496 power 0.0831 0.5 -> 0.288 Inexact Rounded
+pwsx4497 power 0.832 0.5 -> 0.912 Inexact Rounded
+pwsx4498 power 0.0832 0.5 -> 0.288 Inexact Rounded
+pwsx4499 power 0.833 0.5 -> 0.913 Inexact Rounded
+pwsx4500 power 0.0833 0.5 -> 0.289 Inexact Rounded
+pwsx4501 power 0.834 0.5 -> 0.913 Inexact Rounded
+pwsx4502 power 0.0834 0.5 -> 0.289 Inexact Rounded
+pwsx4503 power 0.835 0.5 -> 0.914 Inexact Rounded
+pwsx4504 power 0.0835 0.5 -> 0.289 Inexact Rounded
+pwsx4505 power 0.836 0.5 -> 0.914 Inexact Rounded
+pwsx4506 power 0.0836 0.5 -> 0.289 Inexact Rounded
+pwsx4507 power 0.837 0.5 -> 0.915 Inexact Rounded
+pwsx4508 power 0.0837 0.5 -> 0.289 Inexact Rounded
+pwsx4509 power 0.838 0.5 -> 0.915 Inexact Rounded
+pwsx4510 power 0.0838 0.5 -> 0.289 Inexact Rounded
+pwsx4511 power 0.839 0.5 -> 0.916 Inexact Rounded
+pwsx4512 power 0.0839 0.5 -> 0.290 Inexact Rounded
+pwsx4513 power 0.841 0.5 -> 0.917 Inexact Rounded
+pwsx4514 power 0.0841 0.5 -> 0.290 Inexact Rounded
+pwsx4515 power 0.842 0.5 -> 0.918 Inexact Rounded
+pwsx4516 power 0.0842 0.5 -> 0.290 Inexact Rounded
+pwsx4517 power 0.843 0.5 -> 0.918 Inexact Rounded
+pwsx4518 power 0.0843 0.5 -> 0.290 Inexact Rounded
+pwsx4519 power 0.844 0.5 -> 0.919 Inexact Rounded
+pwsx4520 power 0.0844 0.5 -> 0.291 Inexact Rounded
+pwsx4521 power 0.845 0.5 -> 0.919 Inexact Rounded
+pwsx4522 power 0.0845 0.5 -> 0.291 Inexact Rounded
+pwsx4523 power 0.846 0.5 -> 0.920 Inexact Rounded
+pwsx4524 power 0.0846 0.5 -> 0.291 Inexact Rounded
+pwsx4525 power 0.847 0.5 -> 0.920 Inexact Rounded
+pwsx4526 power 0.0847 0.5 -> 0.291 Inexact Rounded
+pwsx4527 power 0.848 0.5 -> 0.921 Inexact Rounded
+pwsx4528 power 0.0848 0.5 -> 0.291 Inexact Rounded
+pwsx4529 power 0.849 0.5 -> 0.921 Inexact Rounded
+pwsx4530 power 0.0849 0.5 -> 0.291 Inexact Rounded
+pwsx4531 power 0.851 0.5 -> 0.922 Inexact Rounded
+pwsx4532 power 0.0851 0.5 -> 0.292 Inexact Rounded
+pwsx4533 power 0.852 0.5 -> 0.923 Inexact Rounded
+pwsx4534 power 0.0852 0.5 -> 0.292 Inexact Rounded
+pwsx4535 power 0.853 0.5 -> 0.924 Inexact Rounded
+pwsx4536 power 0.0853 0.5 -> 0.292 Inexact Rounded
+pwsx4537 power 0.854 0.5 -> 0.924 Inexact Rounded
+pwsx4538 power 0.0854 0.5 -> 0.292 Inexact Rounded
+pwsx4539 power 0.855 0.5 -> 0.925 Inexact Rounded
+pwsx4540 power 0.0855 0.5 -> 0.292 Inexact Rounded
+pwsx4541 power 0.856 0.5 -> 0.925 Inexact Rounded
+pwsx4542 power 0.0856 0.5 -> 0.293 Inexact Rounded
+pwsx4543 power 0.857 0.5 -> 0.926 Inexact Rounded
+pwsx4544 power 0.0857 0.5 -> 0.293 Inexact Rounded
+pwsx4545 power 0.858 0.5 -> 0.926 Inexact Rounded
+pwsx4546 power 0.0858 0.5 -> 0.293 Inexact Rounded
+pwsx4547 power 0.859 0.5 -> 0.927 Inexact Rounded
+pwsx4548 power 0.0859 0.5 -> 0.293 Inexact Rounded
+pwsx4549 power 0.861 0.5 -> 0.928 Inexact Rounded
+pwsx4550 power 0.0861 0.5 -> 0.293 Inexact Rounded
+pwsx4551 power 0.862 0.5 -> 0.928 Inexact Rounded
+pwsx4552 power 0.0862 0.5 -> 0.294 Inexact Rounded
+pwsx4553 power 0.863 0.5 -> 0.929 Inexact Rounded
+pwsx4554 power 0.0863 0.5 -> 0.294 Inexact Rounded
+pwsx4555 power 0.864 0.5 -> 0.930 Inexact Rounded
+pwsx4556 power 0.0864 0.5 -> 0.294 Inexact Rounded
+pwsx4557 power 0.865 0.5 -> 0.930 Inexact Rounded
+pwsx4558 power 0.0865 0.5 -> 0.294 Inexact Rounded
+pwsx4559 power 0.866 0.5 -> 0.931 Inexact Rounded
+pwsx4560 power 0.0866 0.5 -> 0.294 Inexact Rounded
+pwsx4561 power 0.867 0.5 -> 0.931 Inexact Rounded
+pwsx4562 power 0.0867 0.5 -> 0.294 Inexact Rounded
+pwsx4563 power 0.868 0.5 -> 0.932 Inexact Rounded
+pwsx4564 power 0.0868 0.5 -> 0.295 Inexact Rounded
+pwsx4565 power 0.869 0.5 -> 0.932 Inexact Rounded
+pwsx4566 power 0.0869 0.5 -> 0.295 Inexact Rounded
+pwsx4567 power 0.871 0.5 -> 0.933 Inexact Rounded
+pwsx4568 power 0.0871 0.5 -> 0.295 Inexact Rounded
+pwsx4569 power 0.872 0.5 -> 0.934 Inexact Rounded
+pwsx4570 power 0.0872 0.5 -> 0.295 Inexact Rounded
+pwsx4571 power 0.873 0.5 -> 0.934 Inexact Rounded
+pwsx4572 power 0.0873 0.5 -> 0.295 Inexact Rounded
+pwsx4573 power 0.874 0.5 -> 0.935 Inexact Rounded
+pwsx4574 power 0.0874 0.5 -> 0.296 Inexact Rounded
+pwsx4575 power 0.875 0.5 -> 0.935 Inexact Rounded
+pwsx4576 power 0.0875 0.5 -> 0.296 Inexact Rounded
+pwsx4577 power 0.876 0.5 -> 0.936 Inexact Rounded
+pwsx4578 power 0.0876 0.5 -> 0.296 Inexact Rounded
+pwsx4579 power 0.877 0.5 -> 0.936 Inexact Rounded
+pwsx4580 power 0.0877 0.5 -> 0.296 Inexact Rounded
+pwsx4581 power 0.878 0.5 -> 0.937 Inexact Rounded
+pwsx4582 power 0.0878 0.5 -> 0.296 Inexact Rounded
+pwsx4583 power 0.879 0.5 -> 0.938 Inexact Rounded
+pwsx4584 power 0.0879 0.5 -> 0.296 Inexact Rounded
+pwsx4585 power 0.881 0.5 -> 0.939 Inexact Rounded
+pwsx4586 power 0.0881 0.5 -> 0.297 Inexact Rounded
+pwsx4587 power 0.882 0.5 -> 0.939 Inexact Rounded
+pwsx4588 power 0.0882 0.5 -> 0.297 Inexact Rounded
+pwsx4589 power 0.883 0.5 -> 0.940 Inexact Rounded
+pwsx4590 power 0.0883 0.5 -> 0.297 Inexact Rounded
+pwsx4591 power 0.884 0.5 -> 0.940 Inexact Rounded
+pwsx4592 power 0.0884 0.5 -> 0.297 Inexact Rounded
+pwsx4593 power 0.885 0.5 -> 0.941 Inexact Rounded
+pwsx4594 power 0.0885 0.5 -> 0.297 Inexact Rounded
+pwsx4595 power 0.886 0.5 -> 0.941 Inexact Rounded
+pwsx4596 power 0.0886 0.5 -> 0.298 Inexact Rounded
+pwsx4597 power 0.887 0.5 -> 0.942 Inexact Rounded
+pwsx4598 power 0.0887 0.5 -> 0.298 Inexact Rounded
+pwsx4599 power 0.888 0.5 -> 0.942 Inexact Rounded
+pwsx4600 power 0.0888 0.5 -> 0.298 Inexact Rounded
+pwsx4601 power 0.889 0.5 -> 0.943 Inexact Rounded
+pwsx4602 power 0.0889 0.5 -> 0.298 Inexact Rounded
+pwsx4603 power 0.891 0.5 -> 0.944 Inexact Rounded
+pwsx4604 power 0.0891 0.5 -> 0.298 Inexact Rounded
+pwsx4605 power 0.892 0.5 -> 0.944 Inexact Rounded
+pwsx4606 power 0.0892 0.5 -> 0.299 Inexact Rounded
+pwsx4607 power 0.893 0.5 -> 0.945 Inexact Rounded
+pwsx4608 power 0.0893 0.5 -> 0.299 Inexact Rounded
+pwsx4609 power 0.894 0.5 -> 0.946 Inexact Rounded
+pwsx4610 power 0.0894 0.5 -> 0.299 Inexact Rounded
+pwsx4611 power 0.895 0.5 -> 0.946 Inexact Rounded
+pwsx4612 power 0.0895 0.5 -> 0.299 Inexact Rounded
+pwsx4613 power 0.896 0.5 -> 0.947 Inexact Rounded
+pwsx4614 power 0.0896 0.5 -> 0.299 Inexact Rounded
+pwsx4615 power 0.897 0.5 -> 0.947 Inexact Rounded
+pwsx4616 power 0.0897 0.5 -> 0.299 Inexact Rounded
+pwsx4617 power 0.898 0.5 -> 0.948 Inexact Rounded
+pwsx4618 power 0.0898 0.5 -> 0.300 Inexact Rounded
+pwsx4619 power 0.899 0.5 -> 0.948 Inexact Rounded
+pwsx4620 power 0.0899 0.5 -> 0.300 Inexact Rounded
+pwsx4621 power 0.901 0.5 -> 0.949 Inexact Rounded
+pwsx4622 power 0.0901 0.5 -> 0.300 Inexact Rounded
+pwsx4623 power 0.902 0.5 -> 0.950 Inexact Rounded
+pwsx4624 power 0.0902 0.5 -> 0.300 Inexact Rounded
+pwsx4625 power 0.903 0.5 -> 0.950 Inexact Rounded
+pwsx4626 power 0.0903 0.5 -> 0.300 Inexact Rounded
+pwsx4627 power 0.904 0.5 -> 0.951 Inexact Rounded
+pwsx4628 power 0.0904 0.5 -> 0.301 Inexact Rounded
+pwsx4629 power 0.905 0.5 -> 0.951 Inexact Rounded
+pwsx4630 power 0.0905 0.5 -> 0.301 Inexact Rounded
+pwsx4631 power 0.906 0.5 -> 0.952 Inexact Rounded
+pwsx4632 power 0.0906 0.5 -> 0.301 Inexact Rounded
+pwsx4633 power 0.907 0.5 -> 0.952 Inexact Rounded
+pwsx4634 power 0.0907 0.5 -> 0.301 Inexact Rounded
+pwsx4635 power 0.908 0.5 -> 0.953 Inexact Rounded
+pwsx4636 power 0.0908 0.5 -> 0.301 Inexact Rounded
+pwsx4637 power 0.909 0.5 -> 0.953 Inexact Rounded
+pwsx4638 power 0.0909 0.5 -> 0.301 Inexact Rounded
+pwsx4639 power 0.911 0.5 -> 0.954 Inexact Rounded
+pwsx4640 power 0.0911 0.5 -> 0.302 Inexact Rounded
+pwsx4641 power 0.912 0.5 -> 0.955 Inexact Rounded
+pwsx4642 power 0.0912 0.5 -> 0.302 Inexact Rounded
+pwsx4643 power 0.913 0.5 -> 0.956 Inexact Rounded
+pwsx4644 power 0.0913 0.5 -> 0.302 Inexact Rounded
+pwsx4645 power 0.914 0.5 -> 0.956 Inexact Rounded
+pwsx4646 power 0.0914 0.5 -> 0.302 Inexact Rounded
+pwsx4647 power 0.915 0.5 -> 0.957 Inexact Rounded
+pwsx4648 power 0.0915 0.5 -> 0.302 Inexact Rounded
+pwsx4649 power 0.916 0.5 -> 0.957 Inexact Rounded
+pwsx4650 power 0.0916 0.5 -> 0.303 Inexact Rounded
+pwsx4651 power 0.917 0.5 -> 0.958 Inexact Rounded
+pwsx4652 power 0.0917 0.5 -> 0.303 Inexact Rounded
+pwsx4653 power 0.918 0.5 -> 0.958 Inexact Rounded
+pwsx4654 power 0.0918 0.5 -> 0.303 Inexact Rounded
+pwsx4655 power 0.919 0.5 -> 0.959 Inexact Rounded
+pwsx4656 power 0.0919 0.5 -> 0.303 Inexact Rounded
+pwsx4657 power 0.921 0.5 -> 0.960 Inexact Rounded
+pwsx4658 power 0.0921 0.5 -> 0.303 Inexact Rounded
+pwsx4659 power 0.922 0.5 -> 0.960 Inexact Rounded
+pwsx4660 power 0.0922 0.5 -> 0.304 Inexact Rounded
+pwsx4661 power 0.923 0.5 -> 0.961 Inexact Rounded
+pwsx4662 power 0.0923 0.5 -> 0.304 Inexact Rounded
+pwsx4663 power 0.924 0.5 -> 0.961 Inexact Rounded
+pwsx4664 power 0.0924 0.5 -> 0.304 Inexact Rounded
+pwsx4665 power 0.925 0.5 -> 0.962 Inexact Rounded
+pwsx4666 power 0.0925 0.5 -> 0.304 Inexact Rounded
+pwsx4667 power 0.926 0.5 -> 0.962 Inexact Rounded
+pwsx4668 power 0.0926 0.5 -> 0.304 Inexact Rounded
+pwsx4669 power 0.927 0.5 -> 0.963 Inexact Rounded
+pwsx4670 power 0.0927 0.5 -> 0.304 Inexact Rounded
+pwsx4671 power 0.928 0.5 -> 0.963 Inexact Rounded
+pwsx4672 power 0.0928 0.5 -> 0.305 Inexact Rounded
+pwsx4673 power 0.929 0.5 -> 0.964 Inexact Rounded
+pwsx4674 power 0.0929 0.5 -> 0.305 Inexact Rounded
+pwsx4675 power 0.931 0.5 -> 0.965 Inexact Rounded
+pwsx4676 power 0.0931 0.5 -> 0.305 Inexact Rounded
+pwsx4677 power 0.932 0.5 -> 0.965 Inexact Rounded
+pwsx4678 power 0.0932 0.5 -> 0.305 Inexact Rounded
+pwsx4679 power 0.933 0.5 -> 0.966 Inexact Rounded
+pwsx4680 power 0.0933 0.5 -> 0.305 Inexact Rounded
+pwsx4681 power 0.934 0.5 -> 0.966 Inexact Rounded
+pwsx4682 power 0.0934 0.5 -> 0.306 Inexact Rounded
+pwsx4683 power 0.935 0.5 -> 0.967 Inexact Rounded
+pwsx4684 power 0.0935 0.5 -> 0.306 Inexact Rounded
+pwsx4685 power 0.936 0.5 -> 0.967 Inexact Rounded
+pwsx4686 power 0.0936 0.5 -> 0.306 Inexact Rounded
+pwsx4687 power 0.937 0.5 -> 0.968 Inexact Rounded
+pwsx4688 power 0.0937 0.5 -> 0.306 Inexact Rounded
+pwsx4689 power 0.938 0.5 -> 0.969 Inexact Rounded
+pwsx4690 power 0.0938 0.5 -> 0.306 Inexact Rounded
+pwsx4691 power 0.939 0.5 -> 0.969 Inexact Rounded
+pwsx4692 power 0.0939 0.5 -> 0.306 Inexact Rounded
+pwsx4693 power 0.941 0.5 -> 0.970 Inexact Rounded
+pwsx4694 power 0.0941 0.5 -> 0.307 Inexact Rounded
+pwsx4695 power 0.942 0.5 -> 0.971 Inexact Rounded
+pwsx4696 power 0.0942 0.5 -> 0.307 Inexact Rounded
+pwsx4697 power 0.943 0.5 -> 0.971 Inexact Rounded
+pwsx4698 power 0.0943 0.5 -> 0.307 Inexact Rounded
+pwsx4699 power 0.944 0.5 -> 0.972 Inexact Rounded
+pwsx4700 power 0.0944 0.5 -> 0.307 Inexact Rounded
+pwsx4701 power 0.945 0.5 -> 0.972 Inexact Rounded
+pwsx4702 power 0.0945 0.5 -> 0.307 Inexact Rounded
+pwsx4703 power 0.946 0.5 -> 0.973 Inexact Rounded
+pwsx4704 power 0.0946 0.5 -> 0.308 Inexact Rounded
+pwsx4705 power 0.947 0.5 -> 0.973 Inexact Rounded
+pwsx4706 power 0.0947 0.5 -> 0.308 Inexact Rounded
+pwsx4707 power 0.948 0.5 -> 0.974 Inexact Rounded
+pwsx4708 power 0.0948 0.5 -> 0.308 Inexact Rounded
+pwsx4709 power 0.949 0.5 -> 0.974 Inexact Rounded
+pwsx4710 power 0.0949 0.5 -> 0.308 Inexact Rounded
+pwsx4711 power 0.951 0.5 -> 0.975 Inexact Rounded
+pwsx4712 power 0.0951 0.5 -> 0.308 Inexact Rounded
+pwsx4713 power 0.952 0.5 -> 0.976 Inexact Rounded
+pwsx4714 power 0.0952 0.5 -> 0.309 Inexact Rounded
+pwsx4715 power 0.953 0.5 -> 0.976 Inexact Rounded
+pwsx4716 power 0.0953 0.5 -> 0.309 Inexact Rounded
+pwsx4717 power 0.954 0.5 -> 0.977 Inexact Rounded
+pwsx4718 power 0.0954 0.5 -> 0.309 Inexact Rounded
+pwsx4719 power 0.955 0.5 -> 0.977 Inexact Rounded
+pwsx4720 power 0.0955 0.5 -> 0.309 Inexact Rounded
+pwsx4721 power 0.956 0.5 -> 0.978 Inexact Rounded
+pwsx4722 power 0.0956 0.5 -> 0.309 Inexact Rounded
+pwsx4723 power 0.957 0.5 -> 0.978 Inexact Rounded
+pwsx4724 power 0.0957 0.5 -> 0.309 Inexact Rounded
+pwsx4725 power 0.958 0.5 -> 0.979 Inexact Rounded
+pwsx4726 power 0.0958 0.5 -> 0.310 Inexact Rounded
+pwsx4727 power 0.959 0.5 -> 0.979 Inexact Rounded
+pwsx4728 power 0.0959 0.5 -> 0.310 Inexact Rounded
+pwsx4729 power 0.961 0.5 -> 0.980 Inexact Rounded
+pwsx4730 power 0.0961 0.5 -> 0.310 Inexact Rounded
+pwsx4731 power 0.962 0.5 -> 0.981 Inexact Rounded
+pwsx4732 power 0.0962 0.5 -> 0.310 Inexact Rounded
+pwsx4733 power 0.963 0.5 -> 0.981 Inexact Rounded
+pwsx4734 power 0.0963 0.5 -> 0.310 Inexact Rounded
+pwsx4735 power 0.964 0.5 -> 0.982 Inexact Rounded
+pwsx4736 power 0.0964 0.5 -> 0.310 Inexact Rounded
+pwsx4737 power 0.965 0.5 -> 0.982 Inexact Rounded
+pwsx4738 power 0.0965 0.5 -> 0.311 Inexact Rounded
+pwsx4739 power 0.966 0.5 -> 0.983 Inexact Rounded
+pwsx4740 power 0.0966 0.5 -> 0.311 Inexact Rounded
+pwsx4741 power 0.967 0.5 -> 0.983 Inexact Rounded
+pwsx4742 power 0.0967 0.5 -> 0.311 Inexact Rounded
+pwsx4743 power 0.968 0.5 -> 0.984 Inexact Rounded
+pwsx4744 power 0.0968 0.5 -> 0.311 Inexact Rounded
+pwsx4745 power 0.969 0.5 -> 0.984 Inexact Rounded
+pwsx4746 power 0.0969 0.5 -> 0.311 Inexact Rounded
+pwsx4747 power 0.971 0.5 -> 0.985 Inexact Rounded
+pwsx4748 power 0.0971 0.5 -> 0.312 Inexact Rounded
+pwsx4749 power 0.972 0.5 -> 0.986 Inexact Rounded
+pwsx4750 power 0.0972 0.5 -> 0.312 Inexact Rounded
+pwsx4751 power 0.973 0.5 -> 0.986 Inexact Rounded
+pwsx4752 power 0.0973 0.5 -> 0.312 Inexact Rounded
+pwsx4753 power 0.974 0.5 -> 0.987 Inexact Rounded
+pwsx4754 power 0.0974 0.5 -> 0.312 Inexact Rounded
+pwsx4755 power 0.975 0.5 -> 0.987 Inexact Rounded
+pwsx4756 power 0.0975 0.5 -> 0.312 Inexact Rounded
+pwsx4757 power 0.976 0.5 -> 0.988 Inexact Rounded
+pwsx4758 power 0.0976 0.5 -> 0.312 Inexact Rounded
+pwsx4759 power 0.977 0.5 -> 0.988 Inexact Rounded
+pwsx4760 power 0.0977 0.5 -> 0.313 Inexact Rounded
+pwsx4761 power 0.978 0.5 -> 0.989 Inexact Rounded
+pwsx4762 power 0.0978 0.5 -> 0.313 Inexact Rounded
+pwsx4763 power 0.979 0.5 -> 0.989 Inexact Rounded
+pwsx4764 power 0.0979 0.5 -> 0.313 Inexact Rounded
+pwsx4765 power 0.981 0.5 -> 0.990 Inexact Rounded
+pwsx4766 power 0.0981 0.5 -> 0.313 Inexact Rounded
+pwsx4767 power 0.982 0.5 -> 0.991 Inexact Rounded
+pwsx4768 power 0.0982 0.5 -> 0.313 Inexact Rounded
+pwsx4769 power 0.983 0.5 -> 0.991 Inexact Rounded
+pwsx4770 power 0.0983 0.5 -> 0.314 Inexact Rounded
+pwsx4771 power 0.984 0.5 -> 0.992 Inexact Rounded
+pwsx4772 power 0.0984 0.5 -> 0.314 Inexact Rounded
+pwsx4773 power 0.985 0.5 -> 0.992 Inexact Rounded
+pwsx4774 power 0.0985 0.5 -> 0.314 Inexact Rounded
+pwsx4775 power 0.986 0.5 -> 0.993 Inexact Rounded
+pwsx4776 power 0.0986 0.5 -> 0.314 Inexact Rounded
+pwsx4777 power 0.987 0.5 -> 0.993 Inexact Rounded
+pwsx4778 power 0.0987 0.5 -> 0.314 Inexact Rounded
+pwsx4779 power 0.988 0.5 -> 0.994 Inexact Rounded
+pwsx4780 power 0.0988 0.5 -> 0.314 Inexact Rounded
+pwsx4781 power 0.989 0.5 -> 0.994 Inexact Rounded
+pwsx4782 power 0.0989 0.5 -> 0.314 Inexact Rounded
+pwsx4783 power 0.991 0.5 -> 0.995 Inexact Rounded
+pwsx4784 power 0.0991 0.5 -> 0.315 Inexact Rounded
+pwsx4785 power 0.992 0.5 -> 0.996 Inexact Rounded
+pwsx4786 power 0.0992 0.5 -> 0.315 Inexact Rounded
+pwsx4787 power 0.993 0.5 -> 0.996 Inexact Rounded
+pwsx4788 power 0.0993 0.5 -> 0.315 Inexact Rounded
+pwsx4789 power 0.994 0.5 -> 0.997 Inexact Rounded
+pwsx4790 power 0.0994 0.5 -> 0.315 Inexact Rounded
+pwsx4791 power 0.995 0.5 -> 0.997 Inexact Rounded
+pwsx4792 power 0.0995 0.5 -> 0.315 Inexact Rounded
+pwsx4793 power 0.996 0.5 -> 0.998 Inexact Rounded
+pwsx4794 power 0.0996 0.5 -> 0.316 Inexact Rounded
+pwsx4795 power 0.997 0.5 -> 0.998 Inexact Rounded
+pwsx4796 power 0.0997 0.5 -> 0.316 Inexact Rounded
+pwsx4797 power 0.998 0.5 -> 0.999 Inexact Rounded
+pwsx4798 power 0.0998 0.5 -> 0.316 Inexact Rounded
+pwsx4799 power 0.999 0.5 -> 0.999 Inexact Rounded
+pwsx4800 power 0.0999 0.5 -> 0.316 Inexact Rounded
+
+-- A group of precision 4 tests where Hull & Abrham adjustments are
+-- needed in some cases (both up and down) [see Hull1985b]
+rounding: half_even
+maxExponent: 999
+minexponent: -999
+precision: 4
+pwsx5001 power 0.0118 0.5 -> 0.1086 Inexact Rounded
+pwsx5002 power 0.119 0.5 -> 0.3450 Inexact Rounded
+pwsx5003 power 0.0119 0.5 -> 0.1091 Inexact Rounded
+pwsx5004 power 0.121 0.5 -> 0.3479 Inexact Rounded
+pwsx5005 power 0.0121 0.5 -> 0.1100 Inexact Rounded
+pwsx5006 power 0.122 0.5 -> 0.3493 Inexact Rounded
+pwsx5007 power 0.0122 0.5 -> 0.1105 Inexact Rounded
+pwsx5008 power 0.123 0.5 -> 0.3507 Inexact Rounded
+pwsx5009 power 0.494 0.5 -> 0.7029 Inexact Rounded
+pwsx5010 power 0.0669 0.5 -> 0.2587 Inexact Rounded
+pwsx5011 power 0.9558 0.5 -> 0.9777 Inexact Rounded
+pwsx5012 power 0.9348 0.5 -> 0.9669 Inexact Rounded
+pwsx5013 power 0.9345 0.5 -> 0.9667 Inexact Rounded
+pwsx5014 power 0.09345 0.5 -> 0.3057 Inexact Rounded
+pwsx5015 power 0.9346 0.5 -> 0.9667 Inexact Rounded
+pwsx5016 power 0.09346 0.5 -> 0.3057 Inexact Rounded
+pwsx5017 power 0.9347 0.5 -> 0.9668 Inexact Rounded
+
+-- examples from decArith
+precision: 9
+pwsx700 power 0 0.5 -> '0'
+pwsx701 power -0 0.5 -> '0'
+pwsx702 power 0.39 0.5 -> 0.624499800 Inexact Rounded
+pwsx703 power 100 0.5 -> '10.0000000' Inexact Rounded
+pwsx704 power 1.00 0.5 -> '1.00000000' Inexact Rounded
+pwsx705 power 7 0.5 -> '2.64575131' Inexact Rounded
+pwsx706 power 10 0.5 -> 3.16227766 Inexact Rounded
+
+-- some one-offs
+precision: 9
+pwsx711 power 0.1 0.5 -> 0.316227766 Inexact Rounded
+pwsx712 power 0.2 0.5 -> 0.447213595 Inexact Rounded
+pwsx713 power 0.3 0.5 -> 0.547722558 Inexact Rounded
+pwsx714 power 0.4 0.5 -> 0.632455532 Inexact Rounded
+pwsx715 power 0.5 0.5 -> 0.707106781 Inexact Rounded
+pwsx716 power 0.6 0.5 -> 0.774596669 Inexact Rounded
+pwsx717 power 0.7 0.5 -> 0.836660027 Inexact Rounded
+pwsx718 power 0.8 0.5 -> 0.894427191 Inexact Rounded
+pwsx719 power 0.9 0.5 -> 0.948683298 Inexact Rounded
+precision: 10 -- note no normalizatoin here
+pwsx720 power +0.1 0.5 -> 0.3162277660 Inexact Rounded
+precision: 11
+pwsx721 power +0.1 0.5 -> 0.31622776602 Inexact Rounded
+precision: 12
+pwsx722 power +0.1 0.5 -> 0.316227766017 Inexact Rounded
+precision: 9
+pwsx723 power 0.39 0.5 -> 0.624499800 Inexact Rounded
+precision: 15
+pwsx724 power 0.39 0.5 -> 0.624499799839840 Inexact Rounded
+
+-- discussion cases
+precision: 7
+pwsx731 power 9 0.5 -> 3.000000 Inexact Rounded
+pwsx732 power 100 0.5 -> 10.00000 Inexact Rounded
+pwsx733 power 123 0.5 -> 11.09054 Inexact Rounded
+pwsx734 power 144 0.5 -> 12.00000 Inexact Rounded
+pwsx735 power 156 0.5 -> 12.49000 Inexact Rounded
+pwsx736 power 10000 0.5 -> 100.0000 Inexact Rounded
+
+-- values close to overflow (if there were input rounding)
+maxexponent: 99
+minexponent: -99
+precision: 5
+pwsx760 power 9.9997E+99 0.5 -> 9.9998E+49 Inexact Rounded
+pwsx761 power 9.9998E+99 0.5 -> 9.9999E+49 Inexact Rounded
+pwsx762 power 9.9999E+99 0.5 -> 9.9999E+49 Inexact Rounded
+pwsx763 power 9.99991E+99 0.5 -> 1.0000E+50 Inexact Rounded
+pwsx764 power 9.99994E+99 0.5 -> 1.0000E+50 Inexact Rounded
+pwsx765 power 9.99995E+99 0.5 -> 1.0000E+50 Inexact Rounded
+pwsx766 power 9.99999E+99 0.5 -> 1.0000E+50 Inexact Rounded
+precision: 9
+pwsx770 power 9.9997E+99 0.5 -> 9.99985000E+49 Inexact Rounded
+pwsx771 power 9.9998E+99 0.5 -> 9.99990000E+49 Inexact Rounded
+pwsx772 power 9.9999E+99 0.5 -> 9.99995000E+49 Inexact Rounded
+pwsx773 power 9.99991E+99 0.5 -> 9.99995500E+49 Inexact Rounded
+pwsx774 power 9.99994E+99 0.5 -> 9.99997000E+49 Inexact Rounded
+pwsx775 power 9.99995E+99 0.5 -> 9.99997500E+49 Inexact Rounded
+pwsx776 power 9.99999E+99 0.5 -> 9.99999500E+49 Inexact Rounded
+precision: 20
+pwsx780 power 9.9997E+99 0.5 -> '9.9998499988749831247E+49' Inexact Rounded
+pwsx781 power 9.9998E+99 0.5 -> '9.9998999994999949999E+49' Inexact Rounded
+pwsx782 power 9.9999E+99 0.5 -> '9.9999499998749993750E+49' Inexact Rounded
+pwsx783 power 9.99991E+99 0.5 -> '9.9999549998987495444E+49' Inexact Rounded
+pwsx784 power 9.99994E+99 0.5 -> '9.9999699999549998650E+49' Inexact Rounded
+pwsx785 power 9.99995E+99 0.5 -> '9.9999749999687499219E+49' Inexact Rounded
+pwsx786 power 9.99999E+99 0.5 -> '9.9999949999987499994E+49' Inexact Rounded
+
+-- subnormals and underflows [these can only result when eMax is < digits+1]
+-- Etiny = -(Emax + (precision-1))
+-- start with subnormal operands and normal results
+maxexponent: 9
+minexponent: -9
+precision: 9 -- Etiny=-17
+pwsx800 power 1E-17 0.5 -> 3.16227766E-9 Inexact Rounded
+pwsx801 power 10E-17 0.5 -> 1.00000000E-8 Inexact Rounded
+precision: 10 -- Etiny=-18
+pwsx802 power 10E-18 0.5 -> 3.162277660E-9 Inexact Rounded
+pwsx803 power 1E-18 0.5 -> 1.000000000E-9 Inexact Rounded
+
+precision: 11 -- Etiny=-19
+pwsx804 power 1E-19 0.5 -> 3.162277660E-10 Underflow Subnormal Inexact Rounded
+-- The next test should be skipped for decNumber
+pwsx805 power 10E-19 0.5 -> 1.0000000000E-9 Inexact Rounded
+precision: 12 -- Etiny=-20
+pwsx806 power 10E-20 0.5 -> 3.1622776602E-10 Underflow Subnormal Inexact Rounded
+pwsx807 power 1E-20 0.5 -> 1.0000000000E-10 Underflow Subnormal Inexact Rounded
+
+precision: 13 -- Etiny=-21
+pwsx808 power 1E-21 0.5 -> 3.1622776602E-11 Underflow Subnormal Inexact Rounded
+pwsx809 power 10E-21 0.5 -> 1.00000000000E-10 Underflow Subnormal Inexact Rounded
+precision: 14 -- Etiny=-22
+pwsx810 power 1E-21 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
+pwsx811 power 10E-22 0.5 -> 3.16227766017E-11 Underflow Subnormal Inexact Rounded
+pwsx812 power 1E-22 0.5 -> 1.00000000000E-11 Underflow Subnormal Inexact Rounded
+
+
+-- special values
+maxexponent: 999
+minexponent: -999
+pwsx820 power Inf 0.5 -> Infinity
+pwsx821 power -Inf 0.5 -> NaN Invalid_operation
+pwsx822 power NaN 0.5 -> NaN
+pwsx823 power sNaN 0.5 -> NaN Invalid_operation
+-- propagating NaNs
+pwsx824 power sNaN123 0.5 -> NaN123 Invalid_operation
+pwsx825 power -sNaN321 0.5 -> -NaN321 Invalid_operation
+pwsx826 power NaN456 0.5 -> NaN456
+pwsx827 power -NaN654 0.5 -> -NaN654
+pwsx828 power NaN1 0.5 -> NaN1
+
+-- Null test
+pwsx900 power # 0.5 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/rotate.decTest b/Lib/test/decimaltestdata/rotate.decTest
index 12db821317..81ade79c22 100644
--- a/Lib/test/decimaltestdata/rotate.decTest
+++ b/Lib/test/decimaltestdata/rotate.decTest
@@ -1,247 +1,247 @@
-------------------------------------------------------------------------
--- rotate.decTest -- rotate coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-rotx001 rotate 0 0 -> 0
-rotx002 rotate 0 2 -> 0
-rotx003 rotate 1 2 -> 100
-rotx004 rotate 34 8 -> 400000003
-rotx005 rotate 1 9 -> 1
-rotx006 rotate 1 -1 -> 100000000
-rotx007 rotate 123456789 -1 -> 912345678
-rotx008 rotate 123456789 -8 -> 234567891
-rotx009 rotate 123456789 -9 -> 123456789
-rotx010 rotate 0 -2 -> 0
-
--- rhs must be an integer
-rotx011 rotate 1 1.5 -> NaN Invalid_operation
-rotx012 rotate 1 1.0 -> NaN Invalid_operation
-rotx013 rotate 1 0.1 -> NaN Invalid_operation
-rotx014 rotate 1 0.0 -> NaN Invalid_operation
-rotx015 rotate 1 1E+1 -> NaN Invalid_operation
-rotx016 rotate 1 1E+99 -> NaN Invalid_operation
-rotx017 rotate 1 Inf -> NaN Invalid_operation
-rotx018 rotate 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-rotx020 rotate 1 -1000 -> NaN Invalid_operation
-rotx021 rotate 1 -10 -> NaN Invalid_operation
-rotx022 rotate 1 10 -> NaN Invalid_operation
-rotx023 rotate 1 1000 -> NaN Invalid_operation
-
--- full pattern
-rotx030 rotate 123456789 -9 -> 123456789
-rotx031 rotate 123456789 -8 -> 234567891
-rotx032 rotate 123456789 -7 -> 345678912
-rotx033 rotate 123456789 -6 -> 456789123
-rotx034 rotate 123456789 -5 -> 567891234
-rotx035 rotate 123456789 -4 -> 678912345
-rotx036 rotate 123456789 -3 -> 789123456
-rotx037 rotate 123456789 -2 -> 891234567
-rotx038 rotate 123456789 -1 -> 912345678
-rotx039 rotate 123456789 -0 -> 123456789
-rotx040 rotate 123456789 +0 -> 123456789
-rotx041 rotate 123456789 +1 -> 234567891
-rotx042 rotate 123456789 +2 -> 345678912
-rotx043 rotate 123456789 +3 -> 456789123
-rotx044 rotate 123456789 +4 -> 567891234
-rotx045 rotate 123456789 +5 -> 678912345
-rotx046 rotate 123456789 +6 -> 789123456
-rotx047 rotate 123456789 +7 -> 891234567
-rotx048 rotate 123456789 +8 -> 912345678
-rotx049 rotate 123456789 +9 -> 123456789
-
--- zeros
-rotx060 rotate 0E-10 +9 -> 0E-10
-rotx061 rotate 0E-10 -9 -> 0E-10
-rotx062 rotate 0.000 +9 -> 0.000
-rotx063 rotate 0.000 -9 -> 0.000
-rotx064 rotate 0E+10 +9 -> 0E+10
-rotx065 rotate 0E+10 -9 -> 0E+10
-rotx066 rotate -0E-10 +9 -> -0E-10
-rotx067 rotate -0E-10 -9 -> -0E-10
-rotx068 rotate -0.000 +9 -> -0.000
-rotx069 rotate -0.000 -9 -> -0.000
-rotx070 rotate -0E+10 +9 -> -0E+10
-rotx071 rotate -0E+10 -9 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-rotx141 rotate 9.99999999E+999 -1 -> 9.99999999E+999
-rotx142 rotate 9.99999999E+999 -8 -> 9.99999999E+999
-rotx143 rotate 9.99999999E+999 1 -> 9.99999999E+999
-rotx144 rotate 9.99999999E+999 8 -> 9.99999999E+999
-rotx145 rotate 1E-999 -1 -> 1.00000000E-991
-rotx146 rotate 1E-999 -8 -> 1.0E-998
-rotx147 rotate 1E-999 1 -> 1.0E-998
-rotx148 rotate 1E-999 8 -> 1.00000000E-991
-rotx151 rotate 1.00000000E-999 -1 -> 1.0000000E-1000
-rotx152 rotate 1.00000000E-999 -8 -> 1E-1007
-rotx153 rotate 1.00000000E-999 1 -> 1E-1007
-rotx154 rotate 1.00000000E-999 8 -> 1.0000000E-1000
-rotx155 rotate 9.00000000E-999 -1 -> 9.0000000E-1000
-rotx156 rotate 9.00000000E-999 -8 -> 9E-1007
-rotx157 rotate 9.00000000E-999 1 -> 9E-1007
-rotx158 rotate 9.00000000E-999 8 -> 9.0000000E-1000
-rotx160 rotate 1E-1007 -1 -> 1.00000000E-999
-rotx161 rotate 1E-1007 -8 -> 1.0E-1006
-rotx162 rotate 1E-1007 1 -> 1.0E-1006
-rotx163 rotate 1E-1007 8 -> 1.00000000E-999
--- negatives
-rotx171 rotate -9.99999999E+999 -1 -> -9.99999999E+999
-rotx172 rotate -9.99999999E+999 -8 -> -9.99999999E+999
-rotx173 rotate -9.99999999E+999 1 -> -9.99999999E+999
-rotx174 rotate -9.99999999E+999 8 -> -9.99999999E+999
-rotx175 rotate -1E-999 -1 -> -1.00000000E-991
-rotx176 rotate -1E-999 -8 -> -1.0E-998
-rotx177 rotate -1E-999 1 -> -1.0E-998
-rotx178 rotate -1E-999 8 -> -1.00000000E-991
-rotx181 rotate -1.00000000E-999 -1 -> -1.0000000E-1000
-rotx182 rotate -1.00000000E-999 -8 -> -1E-1007
-rotx183 rotate -1.00000000E-999 1 -> -1E-1007
-rotx184 rotate -1.00000000E-999 8 -> -1.0000000E-1000
-rotx185 rotate -9.00000000E-999 -1 -> -9.0000000E-1000
-rotx186 rotate -9.00000000E-999 -8 -> -9E-1007
-rotx187 rotate -9.00000000E-999 1 -> -9E-1007
-rotx188 rotate -9.00000000E-999 8 -> -9.0000000E-1000
-rotx190 rotate -1E-1007 -1 -> -1.00000000E-999
-rotx191 rotate -1E-1007 -8 -> -1.0E-1006
-rotx192 rotate -1E-1007 1 -> -1.0E-1006
-rotx193 rotate -1E-1007 8 -> -1.00000000E-999
-
--- more negatives (of sanities)
-rotx201 rotate -0 0 -> -0
-rotx202 rotate -0 2 -> -0
-rotx203 rotate -1 2 -> -100
-rotx204 rotate -1 8 -> -100000000
-rotx205 rotate -1 9 -> -1
-rotx206 rotate -1 -1 -> -100000000
-rotx207 rotate -123456789 -1 -> -912345678
-rotx208 rotate -123456789 -8 -> -234567891
-rotx209 rotate -123456789 -9 -> -123456789
-rotx210 rotate -0 -2 -> -0
-
--- Specials; NaNs are handled as usual
-rotx781 rotate -Inf -8 -> -Infinity
-rotx782 rotate -Inf -1 -> -Infinity
-rotx783 rotate -Inf -0 -> -Infinity
-rotx784 rotate -Inf 0 -> -Infinity
-rotx785 rotate -Inf 1 -> -Infinity
-rotx786 rotate -Inf 8 -> -Infinity
-rotx787 rotate -1000 -Inf -> NaN Invalid_operation
-rotx788 rotate -Inf -Inf -> NaN Invalid_operation
-rotx789 rotate -1 -Inf -> NaN Invalid_operation
-rotx790 rotate -0 -Inf -> NaN Invalid_operation
-rotx791 rotate 0 -Inf -> NaN Invalid_operation
-rotx792 rotate 1 -Inf -> NaN Invalid_operation
-rotx793 rotate 1000 -Inf -> NaN Invalid_operation
-rotx794 rotate Inf -Inf -> NaN Invalid_operation
-
-rotx800 rotate Inf -Inf -> NaN Invalid_operation
-rotx801 rotate Inf -8 -> Infinity
-rotx802 rotate Inf -1 -> Infinity
-rotx803 rotate Inf -0 -> Infinity
-rotx804 rotate Inf 0 -> Infinity
-rotx805 rotate Inf 1 -> Infinity
-rotx806 rotate Inf 8 -> Infinity
-rotx807 rotate Inf Inf -> NaN Invalid_operation
-rotx808 rotate -1000 Inf -> NaN Invalid_operation
-rotx809 rotate -Inf Inf -> NaN Invalid_operation
-rotx810 rotate -1 Inf -> NaN Invalid_operation
-rotx811 rotate -0 Inf -> NaN Invalid_operation
-rotx812 rotate 0 Inf -> NaN Invalid_operation
-rotx813 rotate 1 Inf -> NaN Invalid_operation
-rotx814 rotate 1000 Inf -> NaN Invalid_operation
-rotx815 rotate Inf Inf -> NaN Invalid_operation
-
-rotx821 rotate NaN -Inf -> NaN
-rotx822 rotate NaN -1000 -> NaN
-rotx823 rotate NaN -1 -> NaN
-rotx824 rotate NaN -0 -> NaN
-rotx825 rotate NaN 0 -> NaN
-rotx826 rotate NaN 1 -> NaN
-rotx827 rotate NaN 1000 -> NaN
-rotx828 rotate NaN Inf -> NaN
-rotx829 rotate NaN NaN -> NaN
-rotx830 rotate -Inf NaN -> NaN
-rotx831 rotate -1000 NaN -> NaN
-rotx832 rotate -1 NaN -> NaN
-rotx833 rotate -0 NaN -> NaN
-rotx834 rotate 0 NaN -> NaN
-rotx835 rotate 1 NaN -> NaN
-rotx836 rotate 1000 NaN -> NaN
-rotx837 rotate Inf NaN -> NaN
-
-
-
-rotx841 rotate sNaN -Inf -> NaN Invalid_operation
-rotx842 rotate sNaN -1000 -> NaN Invalid_operation
-rotx843 rotate sNaN -1 -> NaN Invalid_operation
-rotx844 rotate sNaN -0 -> NaN Invalid_operation
-rotx845 rotate sNaN 0 -> NaN Invalid_operation
-rotx846 rotate sNaN 1 -> NaN Invalid_operation
-rotx847 rotate sNaN 1000 -> NaN Invalid_operation
-rotx848 rotate sNaN NaN -> NaN Invalid_operation
-rotx849 rotate sNaN sNaN -> NaN Invalid_operation
-rotx850 rotate NaN sNaN -> NaN Invalid_operation
-rotx851 rotate -Inf sNaN -> NaN Invalid_operation
-rotx852 rotate -1000 sNaN -> NaN Invalid_operation
-rotx853 rotate -1 sNaN -> NaN Invalid_operation
-rotx854 rotate -0 sNaN -> NaN Invalid_operation
-rotx855 rotate 0 sNaN -> NaN Invalid_operation
-rotx856 rotate 1 sNaN -> NaN Invalid_operation
-rotx857 rotate 1000 sNaN -> NaN Invalid_operation
-rotx858 rotate Inf sNaN -> NaN Invalid_operation
-rotx859 rotate NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-rotx861 rotate NaN1 -Inf -> NaN1
-rotx862 rotate +NaN2 -1000 -> NaN2
-rotx863 rotate NaN3 1000 -> NaN3
-rotx864 rotate NaN4 Inf -> NaN4
-rotx865 rotate NaN5 +NaN6 -> NaN5
-rotx866 rotate -Inf NaN7 -> NaN7
-rotx867 rotate -1000 NaN8 -> NaN8
-rotx868 rotate 1000 NaN9 -> NaN9
-rotx869 rotate Inf +NaN10 -> NaN10
-rotx871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
-rotx872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
-rotx873 rotate sNaN13 1000 -> NaN13 Invalid_operation
-rotx874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
-rotx875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
-rotx876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
-rotx877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
-rotx878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
-rotx879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
-rotx880 rotate Inf sNaN23 -> NaN23 Invalid_operation
-rotx881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
-rotx882 rotate -NaN26 NaN28 -> -NaN26
-rotx883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-rotx884 rotate 1000 -NaN30 -> -NaN30
-rotx885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
-
--- payload decapitate
-precision: 5
-rotx886 rotate 11 -sNaN1234567890 -> -NaN67890 Invalid_operation
+------------------------------------------------------------------------
+-- rotate.decTest -- rotate coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+rotx001 rotate 0 0 -> 0
+rotx002 rotate 0 2 -> 0
+rotx003 rotate 1 2 -> 100
+rotx004 rotate 34 8 -> 400000003
+rotx005 rotate 1 9 -> 1
+rotx006 rotate 1 -1 -> 100000000
+rotx007 rotate 123456789 -1 -> 912345678
+rotx008 rotate 123456789 -8 -> 234567891
+rotx009 rotate 123456789 -9 -> 123456789
+rotx010 rotate 0 -2 -> 0
+
+-- rhs must be an integer
+rotx011 rotate 1 1.5 -> NaN Invalid_operation
+rotx012 rotate 1 1.0 -> NaN Invalid_operation
+rotx013 rotate 1 0.1 -> NaN Invalid_operation
+rotx014 rotate 1 0.0 -> NaN Invalid_operation
+rotx015 rotate 1 1E+1 -> NaN Invalid_operation
+rotx016 rotate 1 1E+99 -> NaN Invalid_operation
+rotx017 rotate 1 Inf -> NaN Invalid_operation
+rotx018 rotate 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+rotx020 rotate 1 -1000 -> NaN Invalid_operation
+rotx021 rotate 1 -10 -> NaN Invalid_operation
+rotx022 rotate 1 10 -> NaN Invalid_operation
+rotx023 rotate 1 1000 -> NaN Invalid_operation
+
+-- full pattern
+rotx030 rotate 123456789 -9 -> 123456789
+rotx031 rotate 123456789 -8 -> 234567891
+rotx032 rotate 123456789 -7 -> 345678912
+rotx033 rotate 123456789 -6 -> 456789123
+rotx034 rotate 123456789 -5 -> 567891234
+rotx035 rotate 123456789 -4 -> 678912345
+rotx036 rotate 123456789 -3 -> 789123456
+rotx037 rotate 123456789 -2 -> 891234567
+rotx038 rotate 123456789 -1 -> 912345678
+rotx039 rotate 123456789 -0 -> 123456789
+rotx040 rotate 123456789 +0 -> 123456789
+rotx041 rotate 123456789 +1 -> 234567891
+rotx042 rotate 123456789 +2 -> 345678912
+rotx043 rotate 123456789 +3 -> 456789123
+rotx044 rotate 123456789 +4 -> 567891234
+rotx045 rotate 123456789 +5 -> 678912345
+rotx046 rotate 123456789 +6 -> 789123456
+rotx047 rotate 123456789 +7 -> 891234567
+rotx048 rotate 123456789 +8 -> 912345678
+rotx049 rotate 123456789 +9 -> 123456789
+
+-- zeros
+rotx060 rotate 0E-10 +9 -> 0E-10
+rotx061 rotate 0E-10 -9 -> 0E-10
+rotx062 rotate 0.000 +9 -> 0.000
+rotx063 rotate 0.000 -9 -> 0.000
+rotx064 rotate 0E+10 +9 -> 0E+10
+rotx065 rotate 0E+10 -9 -> 0E+10
+rotx066 rotate -0E-10 +9 -> -0E-10
+rotx067 rotate -0E-10 -9 -> -0E-10
+rotx068 rotate -0.000 +9 -> -0.000
+rotx069 rotate -0.000 -9 -> -0.000
+rotx070 rotate -0E+10 +9 -> -0E+10
+rotx071 rotate -0E+10 -9 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+rotx141 rotate 9.99999999E+999 -1 -> 9.99999999E+999
+rotx142 rotate 9.99999999E+999 -8 -> 9.99999999E+999
+rotx143 rotate 9.99999999E+999 1 -> 9.99999999E+999
+rotx144 rotate 9.99999999E+999 8 -> 9.99999999E+999
+rotx145 rotate 1E-999 -1 -> 1.00000000E-991
+rotx146 rotate 1E-999 -8 -> 1.0E-998
+rotx147 rotate 1E-999 1 -> 1.0E-998
+rotx148 rotate 1E-999 8 -> 1.00000000E-991
+rotx151 rotate 1.00000000E-999 -1 -> 1.0000000E-1000
+rotx152 rotate 1.00000000E-999 -8 -> 1E-1007
+rotx153 rotate 1.00000000E-999 1 -> 1E-1007
+rotx154 rotate 1.00000000E-999 8 -> 1.0000000E-1000
+rotx155 rotate 9.00000000E-999 -1 -> 9.0000000E-1000
+rotx156 rotate 9.00000000E-999 -8 -> 9E-1007
+rotx157 rotate 9.00000000E-999 1 -> 9E-1007
+rotx158 rotate 9.00000000E-999 8 -> 9.0000000E-1000
+rotx160 rotate 1E-1007 -1 -> 1.00000000E-999
+rotx161 rotate 1E-1007 -8 -> 1.0E-1006
+rotx162 rotate 1E-1007 1 -> 1.0E-1006
+rotx163 rotate 1E-1007 8 -> 1.00000000E-999
+-- negatives
+rotx171 rotate -9.99999999E+999 -1 -> -9.99999999E+999
+rotx172 rotate -9.99999999E+999 -8 -> -9.99999999E+999
+rotx173 rotate -9.99999999E+999 1 -> -9.99999999E+999
+rotx174 rotate -9.99999999E+999 8 -> -9.99999999E+999
+rotx175 rotate -1E-999 -1 -> -1.00000000E-991
+rotx176 rotate -1E-999 -8 -> -1.0E-998
+rotx177 rotate -1E-999 1 -> -1.0E-998
+rotx178 rotate -1E-999 8 -> -1.00000000E-991
+rotx181 rotate -1.00000000E-999 -1 -> -1.0000000E-1000
+rotx182 rotate -1.00000000E-999 -8 -> -1E-1007
+rotx183 rotate -1.00000000E-999 1 -> -1E-1007
+rotx184 rotate -1.00000000E-999 8 -> -1.0000000E-1000
+rotx185 rotate -9.00000000E-999 -1 -> -9.0000000E-1000
+rotx186 rotate -9.00000000E-999 -8 -> -9E-1007
+rotx187 rotate -9.00000000E-999 1 -> -9E-1007
+rotx188 rotate -9.00000000E-999 8 -> -9.0000000E-1000
+rotx190 rotate -1E-1007 -1 -> -1.00000000E-999
+rotx191 rotate -1E-1007 -8 -> -1.0E-1006
+rotx192 rotate -1E-1007 1 -> -1.0E-1006
+rotx193 rotate -1E-1007 8 -> -1.00000000E-999
+
+-- more negatives (of sanities)
+rotx201 rotate -0 0 -> -0
+rotx202 rotate -0 2 -> -0
+rotx203 rotate -1 2 -> -100
+rotx204 rotate -1 8 -> -100000000
+rotx205 rotate -1 9 -> -1
+rotx206 rotate -1 -1 -> -100000000
+rotx207 rotate -123456789 -1 -> -912345678
+rotx208 rotate -123456789 -8 -> -234567891
+rotx209 rotate -123456789 -9 -> -123456789
+rotx210 rotate -0 -2 -> -0
+
+-- Specials; NaNs are handled as usual
+rotx781 rotate -Inf -8 -> -Infinity
+rotx782 rotate -Inf -1 -> -Infinity
+rotx783 rotate -Inf -0 -> -Infinity
+rotx784 rotate -Inf 0 -> -Infinity
+rotx785 rotate -Inf 1 -> -Infinity
+rotx786 rotate -Inf 8 -> -Infinity
+rotx787 rotate -1000 -Inf -> NaN Invalid_operation
+rotx788 rotate -Inf -Inf -> NaN Invalid_operation
+rotx789 rotate -1 -Inf -> NaN Invalid_operation
+rotx790 rotate -0 -Inf -> NaN Invalid_operation
+rotx791 rotate 0 -Inf -> NaN Invalid_operation
+rotx792 rotate 1 -Inf -> NaN Invalid_operation
+rotx793 rotate 1000 -Inf -> NaN Invalid_operation
+rotx794 rotate Inf -Inf -> NaN Invalid_operation
+
+rotx800 rotate Inf -Inf -> NaN Invalid_operation
+rotx801 rotate Inf -8 -> Infinity
+rotx802 rotate Inf -1 -> Infinity
+rotx803 rotate Inf -0 -> Infinity
+rotx804 rotate Inf 0 -> Infinity
+rotx805 rotate Inf 1 -> Infinity
+rotx806 rotate Inf 8 -> Infinity
+rotx807 rotate Inf Inf -> NaN Invalid_operation
+rotx808 rotate -1000 Inf -> NaN Invalid_operation
+rotx809 rotate -Inf Inf -> NaN Invalid_operation
+rotx810 rotate -1 Inf -> NaN Invalid_operation
+rotx811 rotate -0 Inf -> NaN Invalid_operation
+rotx812 rotate 0 Inf -> NaN Invalid_operation
+rotx813 rotate 1 Inf -> NaN Invalid_operation
+rotx814 rotate 1000 Inf -> NaN Invalid_operation
+rotx815 rotate Inf Inf -> NaN Invalid_operation
+
+rotx821 rotate NaN -Inf -> NaN
+rotx822 rotate NaN -1000 -> NaN
+rotx823 rotate NaN -1 -> NaN
+rotx824 rotate NaN -0 -> NaN
+rotx825 rotate NaN 0 -> NaN
+rotx826 rotate NaN 1 -> NaN
+rotx827 rotate NaN 1000 -> NaN
+rotx828 rotate NaN Inf -> NaN
+rotx829 rotate NaN NaN -> NaN
+rotx830 rotate -Inf NaN -> NaN
+rotx831 rotate -1000 NaN -> NaN
+rotx832 rotate -1 NaN -> NaN
+rotx833 rotate -0 NaN -> NaN
+rotx834 rotate 0 NaN -> NaN
+rotx835 rotate 1 NaN -> NaN
+rotx836 rotate 1000 NaN -> NaN
+rotx837 rotate Inf NaN -> NaN
+
+
+
+rotx841 rotate sNaN -Inf -> NaN Invalid_operation
+rotx842 rotate sNaN -1000 -> NaN Invalid_operation
+rotx843 rotate sNaN -1 -> NaN Invalid_operation
+rotx844 rotate sNaN -0 -> NaN Invalid_operation
+rotx845 rotate sNaN 0 -> NaN Invalid_operation
+rotx846 rotate sNaN 1 -> NaN Invalid_operation
+rotx847 rotate sNaN 1000 -> NaN Invalid_operation
+rotx848 rotate sNaN NaN -> NaN Invalid_operation
+rotx849 rotate sNaN sNaN -> NaN Invalid_operation
+rotx850 rotate NaN sNaN -> NaN Invalid_operation
+rotx851 rotate -Inf sNaN -> NaN Invalid_operation
+rotx852 rotate -1000 sNaN -> NaN Invalid_operation
+rotx853 rotate -1 sNaN -> NaN Invalid_operation
+rotx854 rotate -0 sNaN -> NaN Invalid_operation
+rotx855 rotate 0 sNaN -> NaN Invalid_operation
+rotx856 rotate 1 sNaN -> NaN Invalid_operation
+rotx857 rotate 1000 sNaN -> NaN Invalid_operation
+rotx858 rotate Inf sNaN -> NaN Invalid_operation
+rotx859 rotate NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+rotx861 rotate NaN1 -Inf -> NaN1
+rotx862 rotate +NaN2 -1000 -> NaN2
+rotx863 rotate NaN3 1000 -> NaN3
+rotx864 rotate NaN4 Inf -> NaN4
+rotx865 rotate NaN5 +NaN6 -> NaN5
+rotx866 rotate -Inf NaN7 -> NaN7
+rotx867 rotate -1000 NaN8 -> NaN8
+rotx868 rotate 1000 NaN9 -> NaN9
+rotx869 rotate Inf +NaN10 -> NaN10
+rotx871 rotate sNaN11 -Inf -> NaN11 Invalid_operation
+rotx872 rotate sNaN12 -1000 -> NaN12 Invalid_operation
+rotx873 rotate sNaN13 1000 -> NaN13 Invalid_operation
+rotx874 rotate sNaN14 NaN17 -> NaN14 Invalid_operation
+rotx875 rotate sNaN15 sNaN18 -> NaN15 Invalid_operation
+rotx876 rotate NaN16 sNaN19 -> NaN19 Invalid_operation
+rotx877 rotate -Inf +sNaN20 -> NaN20 Invalid_operation
+rotx878 rotate -1000 sNaN21 -> NaN21 Invalid_operation
+rotx879 rotate 1000 sNaN22 -> NaN22 Invalid_operation
+rotx880 rotate Inf sNaN23 -> NaN23 Invalid_operation
+rotx881 rotate +NaN25 +sNaN24 -> NaN24 Invalid_operation
+rotx882 rotate -NaN26 NaN28 -> -NaN26
+rotx883 rotate -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+rotx884 rotate 1000 -NaN30 -> -NaN30
+rotx885 rotate 1000 -sNaN31 -> -NaN31 Invalid_operation
+
+-- payload decapitate
+precision: 5
+rotx886 rotate 11 -sNaN1234567890 -> -NaN67890 Invalid_operation
diff --git a/Lib/test/decimaltestdata/scaleb.decTest b/Lib/test/decimaltestdata/scaleb.decTest
index 372e3dd4c3..04a65d6eae 100644
--- a/Lib/test/decimaltestdata/scaleb.decTest
+++ b/Lib/test/decimaltestdata/scaleb.decTest
@@ -1,209 +1,209 @@
-------------------------------------------------------------------------
--- scaleb.decTest -- scale a number by powers of 10 --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Max |rhs| is 2*(999+9) = 2016
-
--- Sanity checks
-scbx001 scaleb 7.50 10 -> 7.50E+10
-scbx002 scaleb 7.50 3 -> 7.50E+3
-scbx003 scaleb 7.50 2 -> 750
-scbx004 scaleb 7.50 1 -> 75.0
-scbx005 scaleb 7.50 0 -> 7.50
-scbx006 scaleb 7.50 -1 -> 0.750
-scbx007 scaleb 7.50 -2 -> 0.0750
-scbx008 scaleb 7.50 -10 -> 7.50E-10
-scbx009 scaleb -7.50 3 -> -7.50E+3
-scbx010 scaleb -7.50 2 -> -750
-scbx011 scaleb -7.50 1 -> -75.0
-scbx012 scaleb -7.50 0 -> -7.50
-scbx013 scaleb -7.50 -1 -> -0.750
-
--- Infinities
-scbx014 scaleb Infinity 1 -> Infinity
-scbx015 scaleb -Infinity 2 -> -Infinity
-scbx016 scaleb Infinity -1 -> Infinity
-scbx017 scaleb -Infinity -2 -> -Infinity
-
--- Next two are somewhat undefined in 754r; treat as non-integer
-scbx018 scaleb 10 Infinity -> NaN Invalid_operation
-scbx019 scaleb 10 -Infinity -> NaN Invalid_operation
-
--- NaNs are undefined in 754r; assume usual processing
--- NaNs, 0 payload
-scbx021 scaleb NaN 1 -> NaN
-scbx022 scaleb -NaN -1 -> -NaN
-scbx023 scaleb sNaN 1 -> NaN Invalid_operation
-scbx024 scaleb -sNaN 1 -> -NaN Invalid_operation
-scbx025 scaleb 4 NaN -> NaN
-scbx026 scaleb -Inf -NaN -> -NaN
-scbx027 scaleb 4 sNaN -> NaN Invalid_operation
-scbx028 scaleb Inf -sNaN -> -NaN Invalid_operation
-
--- non-integer RHS
-scbx030 scaleb 1.23 1 -> 12.3
-scbx031 scaleb 1.23 1.00 -> NaN Invalid_operation
-scbx032 scaleb 1.23 1.1 -> NaN Invalid_operation
-scbx033 scaleb 1.23 1.01 -> NaN Invalid_operation
-scbx034 scaleb 1.23 0.01 -> NaN Invalid_operation
-scbx035 scaleb 1.23 0.11 -> NaN Invalid_operation
-scbx036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
-scbx037 scaleb 1.23 -1 -> 0.123
-scbx038 scaleb 1.23 -1.00 -> NaN Invalid_operation
-scbx039 scaleb 1.23 -1.1 -> NaN Invalid_operation
-scbx040 scaleb 1.23 -1.01 -> NaN Invalid_operation
-scbx041 scaleb 1.23 -0.01 -> NaN Invalid_operation
-scbx042 scaleb 1.23 -0.11 -> NaN Invalid_operation
-scbx043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
-scbx044 scaleb 1.23 0.1 -> NaN Invalid_operation
-scbx045 scaleb 1.23 1E+1 -> NaN Invalid_operation
-scbx046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
-scbx047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
-
-
-scbx120 scaleb 1.23 2015 -> Infinity Overflow Inexact Rounded
-scbx121 scaleb 1.23 2016 -> Infinity Overflow Inexact Rounded
-scbx122 scaleb 1.23 2017 -> NaN Invalid_operation
-scbx123 scaleb 1.23 2018 -> NaN Invalid_operation
-scbx124 scaleb 1.23 -2015 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
-scbx125 scaleb 1.23 -2016 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
-scbx126 scaleb 1.23 -2017 -> NaN Invalid_operation
-scbx127 scaleb 1.23 -2018 -> NaN Invalid_operation
-
--- NaNs, non-0 payload
--- propagating NaNs
-scbx861 scaleb NaN01 -Inf -> NaN1
-scbx862 scaleb -NaN02 -1000 -> -NaN2
-scbx863 scaleb NaN03 1000 -> NaN3
-scbx864 scaleb NaN04 Inf -> NaN4
-scbx865 scaleb NaN05 NaN61 -> NaN5
-scbx866 scaleb -Inf -NaN71 -> -NaN71
-scbx867 scaleb -1000 NaN81 -> NaN81
-scbx868 scaleb 1000 NaN91 -> NaN91
-scbx869 scaleb Inf NaN101 -> NaN101
-scbx871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
-scbx872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
-scbx873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
-scbx874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
-scbx875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
-scbx876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
-scbx877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
-scbx878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
-scbx879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
-scbx880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
-scbx881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
-
--- finites
-scbx051 scaleb 7 -2 -> 0.07
-scbx052 scaleb -7 -2 -> -0.07
-scbx053 scaleb 75 -2 -> 0.75
-scbx054 scaleb -75 -2 -> -0.75
-scbx055 scaleb 7.50 -2 -> 0.0750
-scbx056 scaleb -7.50 -2 -> -0.0750
-scbx057 scaleb 7.500 -2 -> 0.07500
-scbx058 scaleb -7.500 -2 -> -0.07500
-scbx061 scaleb 7 -1 -> 0.7
-scbx062 scaleb -7 -1 -> -0.7
-scbx063 scaleb 75 -1 -> 7.5
-scbx064 scaleb -75 -1 -> -7.5
-scbx065 scaleb 7.50 -1 -> 0.750
-scbx066 scaleb -7.50 -1 -> -0.750
-scbx067 scaleb 7.500 -1 -> 0.7500
-scbx068 scaleb -7.500 -1 -> -0.7500
-scbx071 scaleb 7 0 -> 7
-scbx072 scaleb -7 0 -> -7
-scbx073 scaleb 75 0 -> 75
-scbx074 scaleb -75 0 -> -75
-scbx075 scaleb 7.50 0 -> 7.50
-scbx076 scaleb -7.50 0 -> -7.50
-scbx077 scaleb 7.500 0 -> 7.500
-scbx078 scaleb -7.500 0 -> -7.500
-scbx081 scaleb 7 1 -> 7E+1
-scbx082 scaleb -7 1 -> -7E+1
-scbx083 scaleb 75 1 -> 7.5E+2
-scbx084 scaleb -75 1 -> -7.5E+2
-scbx085 scaleb 7.50 1 -> 75.0
-scbx086 scaleb -7.50 1 -> -75.0
-scbx087 scaleb 7.500 1 -> 75.00
-scbx088 scaleb -7.500 1 -> -75.00
-scbx091 scaleb 7 2 -> 7E+2
-scbx092 scaleb -7 2 -> -7E+2
-scbx093 scaleb 75 2 -> 7.5E+3
-scbx094 scaleb -75 2 -> -7.5E+3
-scbx095 scaleb 7.50 2 -> 750
-scbx096 scaleb -7.50 2 -> -750
-scbx097 scaleb 7.500 2 -> 750.0
-scbx098 scaleb -7.500 2 -> -750.0
-
--- zeros
-scbx111 scaleb 0 1 -> 0E+1
-scbx112 scaleb -0 2 -> -0E+2
-scbx113 scaleb 0E+4 3 -> 0E+7
-scbx114 scaleb -0E+4 4 -> -0E+8
-scbx115 scaleb 0.0000 5 -> 0E+1
-scbx116 scaleb -0.0000 6 -> -0E+2
-scbx117 scaleb 0E-141 7 -> 0E-134
-scbx118 scaleb -0E-141 8 -> -0E-133
-
--- Nmax, Nmin, Ntiny
-scbx132 scaleb 9.99999999E+999 +999 -> Infinity Overflow Inexact Rounded
-scbx133 scaleb 9.99999999E+999 +10 -> Infinity Overflow Inexact Rounded
-scbx134 scaleb 9.99999999E+999 +1 -> Infinity Overflow Inexact Rounded
-scbx135 scaleb 9.99999999E+999 0 -> 9.99999999E+999
-scbx136 scaleb 9.99999999E+999 -1 -> 9.99999999E+998
-scbx137 scaleb 1E-999 +1 -> 1E-998
-scbx138 scaleb 1E-999 -0 -> 1E-999
-scbx139 scaleb 1E-999 -1 -> 1E-1000 Subnormal
-scbx140 scaleb 1.00000000E-999 +1 -> 1.00000000E-998
-scbx141 scaleb 1.00000000E-999 0 -> 1.00000000E-999
-scbx142 scaleb 1.00000000E-999 -1 -> 1.0000000E-1000 Subnormal Rounded
-scbx143 scaleb 1E-1007 +1 -> 1E-1006 Subnormal
-scbx144 scaleb 1E-1007 -0 -> 1E-1007 Subnormal
-scbx145 scaleb 1E-1007 -1 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
-
-scbx150 scaleb -1E-1007 +1 -> -1E-1006 Subnormal
-scbx151 scaleb -1E-1007 -0 -> -1E-1007 Subnormal
-scbx152 scaleb -1E-1007 -1 -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped
-scbx153 scaleb -1.00000000E-999 +1 -> -1.00000000E-998
-scbx154 scaleb -1.00000000E-999 +0 -> -1.00000000E-999
-scbx155 scaleb -1.00000000E-999 -1 -> -1.0000000E-1000 Subnormal Rounded
-scbx156 scaleb -1E-999 +1 -> -1E-998
-scbx157 scaleb -1E-999 -0 -> -1E-999
-scbx158 scaleb -1E-999 -1 -> -1E-1000 Subnormal
-scbx159 scaleb -9.99999999E+999 +1 -> -Infinity Overflow Inexact Rounded
-scbx160 scaleb -9.99999999E+999 +0 -> -9.99999999E+999
-scbx161 scaleb -9.99999999E+999 -1 -> -9.99999999E+998
-scbx162 scaleb -9E+999 +1 -> -Infinity Overflow Inexact Rounded
-scbx163 scaleb -1E+999 +1 -> -Infinity Overflow Inexact Rounded
-
--- Krah examples
-precision: 34
-maxExponent: 999999999
-minExponent: -999999999
--- integer overflow in 3.61 or earlier
-scbx164 scaleb 1E-999999999 -1200000000 -> NaN Invalid_operation
--- out of range
-scbx165 scaleb -1E-999999999 +1200000000 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- scaleb.decTest -- scale a number by powers of 10 --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Max |rhs| is 2*(999+9) = 2016
+
+-- Sanity checks
+scbx001 scaleb 7.50 10 -> 7.50E+10
+scbx002 scaleb 7.50 3 -> 7.50E+3
+scbx003 scaleb 7.50 2 -> 750
+scbx004 scaleb 7.50 1 -> 75.0
+scbx005 scaleb 7.50 0 -> 7.50
+scbx006 scaleb 7.50 -1 -> 0.750
+scbx007 scaleb 7.50 -2 -> 0.0750
+scbx008 scaleb 7.50 -10 -> 7.50E-10
+scbx009 scaleb -7.50 3 -> -7.50E+3
+scbx010 scaleb -7.50 2 -> -750
+scbx011 scaleb -7.50 1 -> -75.0
+scbx012 scaleb -7.50 0 -> -7.50
+scbx013 scaleb -7.50 -1 -> -0.750
+
+-- Infinities
+scbx014 scaleb Infinity 1 -> Infinity
+scbx015 scaleb -Infinity 2 -> -Infinity
+scbx016 scaleb Infinity -1 -> Infinity
+scbx017 scaleb -Infinity -2 -> -Infinity
+
+-- Next two are somewhat undefined in 754r; treat as non-integer
+scbx018 scaleb 10 Infinity -> NaN Invalid_operation
+scbx019 scaleb 10 -Infinity -> NaN Invalid_operation
+
+-- NaNs are undefined in 754r; assume usual processing
+-- NaNs, 0 payload
+scbx021 scaleb NaN 1 -> NaN
+scbx022 scaleb -NaN -1 -> -NaN
+scbx023 scaleb sNaN 1 -> NaN Invalid_operation
+scbx024 scaleb -sNaN 1 -> -NaN Invalid_operation
+scbx025 scaleb 4 NaN -> NaN
+scbx026 scaleb -Inf -NaN -> -NaN
+scbx027 scaleb 4 sNaN -> NaN Invalid_operation
+scbx028 scaleb Inf -sNaN -> -NaN Invalid_operation
+
+-- non-integer RHS
+scbx030 scaleb 1.23 1 -> 12.3
+scbx031 scaleb 1.23 1.00 -> NaN Invalid_operation
+scbx032 scaleb 1.23 1.1 -> NaN Invalid_operation
+scbx033 scaleb 1.23 1.01 -> NaN Invalid_operation
+scbx034 scaleb 1.23 0.01 -> NaN Invalid_operation
+scbx035 scaleb 1.23 0.11 -> NaN Invalid_operation
+scbx036 scaleb 1.23 0.999999999 -> NaN Invalid_operation
+scbx037 scaleb 1.23 -1 -> 0.123
+scbx038 scaleb 1.23 -1.00 -> NaN Invalid_operation
+scbx039 scaleb 1.23 -1.1 -> NaN Invalid_operation
+scbx040 scaleb 1.23 -1.01 -> NaN Invalid_operation
+scbx041 scaleb 1.23 -0.01 -> NaN Invalid_operation
+scbx042 scaleb 1.23 -0.11 -> NaN Invalid_operation
+scbx043 scaleb 1.23 -0.999999999 -> NaN Invalid_operation
+scbx044 scaleb 1.23 0.1 -> NaN Invalid_operation
+scbx045 scaleb 1.23 1E+1 -> NaN Invalid_operation
+scbx046 scaleb 1.23 1.1234E+6 -> NaN Invalid_operation
+scbx047 scaleb 1.23 1.123E+4 -> NaN Invalid_operation
+
+
+scbx120 scaleb 1.23 2015 -> Infinity Overflow Inexact Rounded
+scbx121 scaleb 1.23 2016 -> Infinity Overflow Inexact Rounded
+scbx122 scaleb 1.23 2017 -> NaN Invalid_operation
+scbx123 scaleb 1.23 2018 -> NaN Invalid_operation
+scbx124 scaleb 1.23 -2015 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
+scbx125 scaleb 1.23 -2016 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
+scbx126 scaleb 1.23 -2017 -> NaN Invalid_operation
+scbx127 scaleb 1.23 -2018 -> NaN Invalid_operation
+
+-- NaNs, non-0 payload
+-- propagating NaNs
+scbx861 scaleb NaN01 -Inf -> NaN1
+scbx862 scaleb -NaN02 -1000 -> -NaN2
+scbx863 scaleb NaN03 1000 -> NaN3
+scbx864 scaleb NaN04 Inf -> NaN4
+scbx865 scaleb NaN05 NaN61 -> NaN5
+scbx866 scaleb -Inf -NaN71 -> -NaN71
+scbx867 scaleb -1000 NaN81 -> NaN81
+scbx868 scaleb 1000 NaN91 -> NaN91
+scbx869 scaleb Inf NaN101 -> NaN101
+scbx871 scaleb sNaN011 -Inf -> NaN11 Invalid_operation
+scbx872 scaleb sNaN012 -1000 -> NaN12 Invalid_operation
+scbx873 scaleb -sNaN013 1000 -> -NaN13 Invalid_operation
+scbx874 scaleb sNaN014 NaN171 -> NaN14 Invalid_operation
+scbx875 scaleb sNaN015 sNaN181 -> NaN15 Invalid_operation
+scbx876 scaleb NaN016 sNaN191 -> NaN191 Invalid_operation
+scbx877 scaleb -Inf sNaN201 -> NaN201 Invalid_operation
+scbx878 scaleb -1000 sNaN211 -> NaN211 Invalid_operation
+scbx879 scaleb 1000 -sNaN221 -> -NaN221 Invalid_operation
+scbx880 scaleb Inf sNaN231 -> NaN231 Invalid_operation
+scbx881 scaleb NaN025 sNaN241 -> NaN241 Invalid_operation
+
+-- finites
+scbx051 scaleb 7 -2 -> 0.07
+scbx052 scaleb -7 -2 -> -0.07
+scbx053 scaleb 75 -2 -> 0.75
+scbx054 scaleb -75 -2 -> -0.75
+scbx055 scaleb 7.50 -2 -> 0.0750
+scbx056 scaleb -7.50 -2 -> -0.0750
+scbx057 scaleb 7.500 -2 -> 0.07500
+scbx058 scaleb -7.500 -2 -> -0.07500
+scbx061 scaleb 7 -1 -> 0.7
+scbx062 scaleb -7 -1 -> -0.7
+scbx063 scaleb 75 -1 -> 7.5
+scbx064 scaleb -75 -1 -> -7.5
+scbx065 scaleb 7.50 -1 -> 0.750
+scbx066 scaleb -7.50 -1 -> -0.750
+scbx067 scaleb 7.500 -1 -> 0.7500
+scbx068 scaleb -7.500 -1 -> -0.7500
+scbx071 scaleb 7 0 -> 7
+scbx072 scaleb -7 0 -> -7
+scbx073 scaleb 75 0 -> 75
+scbx074 scaleb -75 0 -> -75
+scbx075 scaleb 7.50 0 -> 7.50
+scbx076 scaleb -7.50 0 -> -7.50
+scbx077 scaleb 7.500 0 -> 7.500
+scbx078 scaleb -7.500 0 -> -7.500
+scbx081 scaleb 7 1 -> 7E+1
+scbx082 scaleb -7 1 -> -7E+1
+scbx083 scaleb 75 1 -> 7.5E+2
+scbx084 scaleb -75 1 -> -7.5E+2
+scbx085 scaleb 7.50 1 -> 75.0
+scbx086 scaleb -7.50 1 -> -75.0
+scbx087 scaleb 7.500 1 -> 75.00
+scbx088 scaleb -7.500 1 -> -75.00
+scbx091 scaleb 7 2 -> 7E+2
+scbx092 scaleb -7 2 -> -7E+2
+scbx093 scaleb 75 2 -> 7.5E+3
+scbx094 scaleb -75 2 -> -7.5E+3
+scbx095 scaleb 7.50 2 -> 750
+scbx096 scaleb -7.50 2 -> -750
+scbx097 scaleb 7.500 2 -> 750.0
+scbx098 scaleb -7.500 2 -> -750.0
+
+-- zeros
+scbx111 scaleb 0 1 -> 0E+1
+scbx112 scaleb -0 2 -> -0E+2
+scbx113 scaleb 0E+4 3 -> 0E+7
+scbx114 scaleb -0E+4 4 -> -0E+8
+scbx115 scaleb 0.0000 5 -> 0E+1
+scbx116 scaleb -0.0000 6 -> -0E+2
+scbx117 scaleb 0E-141 7 -> 0E-134
+scbx118 scaleb -0E-141 8 -> -0E-133
+
+-- Nmax, Nmin, Ntiny
+scbx132 scaleb 9.99999999E+999 +999 -> Infinity Overflow Inexact Rounded
+scbx133 scaleb 9.99999999E+999 +10 -> Infinity Overflow Inexact Rounded
+scbx134 scaleb 9.99999999E+999 +1 -> Infinity Overflow Inexact Rounded
+scbx135 scaleb 9.99999999E+999 0 -> 9.99999999E+999
+scbx136 scaleb 9.99999999E+999 -1 -> 9.99999999E+998
+scbx137 scaleb 1E-999 +1 -> 1E-998
+scbx138 scaleb 1E-999 -0 -> 1E-999
+scbx139 scaleb 1E-999 -1 -> 1E-1000 Subnormal
+scbx140 scaleb 1.00000000E-999 +1 -> 1.00000000E-998
+scbx141 scaleb 1.00000000E-999 0 -> 1.00000000E-999
+scbx142 scaleb 1.00000000E-999 -1 -> 1.0000000E-1000 Subnormal Rounded
+scbx143 scaleb 1E-1007 +1 -> 1E-1006 Subnormal
+scbx144 scaleb 1E-1007 -0 -> 1E-1007 Subnormal
+scbx145 scaleb 1E-1007 -1 -> 0E-1007 Underflow Subnormal Inexact Rounded Clamped
+
+scbx150 scaleb -1E-1007 +1 -> -1E-1006 Subnormal
+scbx151 scaleb -1E-1007 -0 -> -1E-1007 Subnormal
+scbx152 scaleb -1E-1007 -1 -> -0E-1007 Underflow Subnormal Inexact Rounded Clamped
+scbx153 scaleb -1.00000000E-999 +1 -> -1.00000000E-998
+scbx154 scaleb -1.00000000E-999 +0 -> -1.00000000E-999
+scbx155 scaleb -1.00000000E-999 -1 -> -1.0000000E-1000 Subnormal Rounded
+scbx156 scaleb -1E-999 +1 -> -1E-998
+scbx157 scaleb -1E-999 -0 -> -1E-999
+scbx158 scaleb -1E-999 -1 -> -1E-1000 Subnormal
+scbx159 scaleb -9.99999999E+999 +1 -> -Infinity Overflow Inexact Rounded
+scbx160 scaleb -9.99999999E+999 +0 -> -9.99999999E+999
+scbx161 scaleb -9.99999999E+999 -1 -> -9.99999999E+998
+scbx162 scaleb -9E+999 +1 -> -Infinity Overflow Inexact Rounded
+scbx163 scaleb -1E+999 +1 -> -Infinity Overflow Inexact Rounded
+
+-- Krah examples
+precision: 34
+maxExponent: 999999999
+minExponent: -999999999
+-- integer overflow in 3.61 or earlier
+scbx164 scaleb 1E-999999999 -1200000000 -> NaN Invalid_operation
+-- out of range
+scbx165 scaleb -1E-999999999 +1200000000 -> NaN Invalid_operation
diff --git a/Lib/test/decimaltestdata/shift.decTest b/Lib/test/decimaltestdata/shift.decTest
index 3fac72f722..78838cc10d 100644
--- a/Lib/test/decimaltestdata/shift.decTest
+++ b/Lib/test/decimaltestdata/shift.decTest
@@ -1,250 +1,250 @@
-------------------------------------------------------------------------
--- shift.decTest -- shift coefficient left or right --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check
-shix001 shift 0 0 -> 0
-shix002 shift 0 2 -> 0
-shix003 shift 1 2 -> 100
-shix004 shift 1 8 -> 100000000
-shix005 shift 1 9 -> 0
-shix006 shift 1 -1 -> 0
-shix007 shift 123456789 -1 -> 12345678
-shix008 shift 123456789 -8 -> 1
-shix009 shift 123456789 -9 -> 0
-shix010 shift 0 -2 -> 0
-
--- rhs must be an integer
-shix011 shift 1 1.5 -> NaN Invalid_operation
-shix012 shift 1 1.0 -> NaN Invalid_operation
-shix013 shift 1 0.1 -> NaN Invalid_operation
-shix014 shift 1 0.0 -> NaN Invalid_operation
-shix015 shift 1 1E+1 -> NaN Invalid_operation
-shix016 shift 1 1E+99 -> NaN Invalid_operation
-shix017 shift 1 Inf -> NaN Invalid_operation
-shix018 shift 1 -Inf -> NaN Invalid_operation
--- and |rhs| <= precision
-shix020 shift 1 -1000 -> NaN Invalid_operation
-shix021 shift 1 -10 -> NaN Invalid_operation
-shix022 shift 1 10 -> NaN Invalid_operation
-shix023 shift 1 1000 -> NaN Invalid_operation
-
--- full shifting pattern
-shix030 shift 123456789 -9 -> 0
-shix031 shift 123456789 -8 -> 1
-shix032 shift 123456789 -7 -> 12
-shix033 shift 123456789 -6 -> 123
-shix034 shift 123456789 -5 -> 1234
-shix035 shift 123456789 -4 -> 12345
-shix036 shift 123456789 -3 -> 123456
-shix037 shift 123456789 -2 -> 1234567
-shix038 shift 123456789 -1 -> 12345678
-shix039 shift 123456789 -0 -> 123456789
-shix040 shift 123456789 +0 -> 123456789
-shix041 shift 123456789 +1 -> 234567890
-shix042 shift 123456789 +2 -> 345678900
-shix043 shift 123456789 +3 -> 456789000
-shix044 shift 123456789 +4 -> 567890000
-shix045 shift 123456789 +5 -> 678900000
-shix046 shift 123456789 +6 -> 789000000
-shix047 shift 123456789 +7 -> 890000000
-shix048 shift 123456789 +8 -> 900000000
-shix049 shift 123456789 +9 -> 0
-
--- from examples
-shix051 shift 34 8 -> '400000000'
-shix052 shift 12 9 -> '0'
-shix053 shift 123456789 -2 -> '1234567'
-shix054 shift 123456789 0 -> '123456789'
-shix055 shift 123456789 +2 -> '345678900'
-
--- zeros
-shix060 shift 0E-10 +9 -> 0E-10
-shix061 shift 0E-10 -9 -> 0E-10
-shix062 shift 0.000 +9 -> 0.000
-shix063 shift 0.000 -9 -> 0.000
-shix064 shift 0E+10 +9 -> 0E+10
-shix065 shift 0E+10 -9 -> 0E+10
-shix066 shift -0E-10 +9 -> -0E-10
-shix067 shift -0E-10 -9 -> -0E-10
-shix068 shift -0.000 +9 -> -0.000
-shix069 shift -0.000 -9 -> -0.000
-shix070 shift -0E+10 +9 -> -0E+10
-shix071 shift -0E+10 -9 -> -0E+10
-
--- Nmax, Nmin, Ntiny
-shix141 shift 9.99999999E+999 -1 -> 9.9999999E+998
-shix142 shift 9.99999999E+999 -8 -> 9E+991
-shix143 shift 9.99999999E+999 1 -> 9.99999990E+999
-shix144 shift 9.99999999E+999 8 -> 9.00000000E+999
-shix145 shift 1E-999 -1 -> 0E-999
-shix146 shift 1E-999 -8 -> 0E-999
-shix147 shift 1E-999 1 -> 1.0E-998
-shix148 shift 1E-999 8 -> 1.00000000E-991
-shix151 shift 1.00000000E-999 -1 -> 1.0000000E-1000
-shix152 shift 1.00000000E-999 -8 -> 1E-1007
-shix153 shift 1.00000000E-999 1 -> 0E-1007
-shix154 shift 1.00000000E-999 8 -> 0E-1007
-shix155 shift 9.00000000E-999 -1 -> 9.0000000E-1000
-shix156 shift 9.00000000E-999 -8 -> 9E-1007
-shix157 shift 9.00000000E-999 1 -> 0E-1007
-shix158 shift 9.00000000E-999 8 -> 0E-1007
-shix160 shift 1E-1007 -1 -> 0E-1007
-shix161 shift 1E-1007 -8 -> 0E-1007
-shix162 shift 1E-1007 1 -> 1.0E-1006
-shix163 shift 1E-1007 8 -> 1.00000000E-999
--- negatives
-shix171 shift -9.99999999E+999 -1 -> -9.9999999E+998
-shix172 shift -9.99999999E+999 -8 -> -9E+991
-shix173 shift -9.99999999E+999 1 -> -9.99999990E+999
-shix174 shift -9.99999999E+999 8 -> -9.00000000E+999
-shix175 shift -1E-999 -1 -> -0E-999
-shix176 shift -1E-999 -8 -> -0E-999
-shix177 shift -1E-999 1 -> -1.0E-998
-shix178 shift -1E-999 8 -> -1.00000000E-991
-shix181 shift -1.00000000E-999 -1 -> -1.0000000E-1000
-shix182 shift -1.00000000E-999 -8 -> -1E-1007
-shix183 shift -1.00000000E-999 1 -> -0E-1007
-shix184 shift -1.00000000E-999 8 -> -0E-1007
-shix185 shift -9.00000000E-999 -1 -> -9.0000000E-1000
-shix186 shift -9.00000000E-999 -8 -> -9E-1007
-shix187 shift -9.00000000E-999 1 -> -0E-1007
-shix188 shift -9.00000000E-999 8 -> -0E-1007
-shix190 shift -1E-1007 -1 -> -0E-1007
-shix191 shift -1E-1007 -8 -> -0E-1007
-shix192 shift -1E-1007 1 -> -1.0E-1006
-shix193 shift -1E-1007 8 -> -1.00000000E-999
-
--- more negatives (of sanities)
-shix201 shift -0 0 -> -0
-shix202 shift -0 2 -> -0
-shix203 shift -1 2 -> -100
-shix204 shift -1 8 -> -100000000
-shix205 shift -1 9 -> -0
-shix206 shift -1 -1 -> -0
-shix207 shift -123456789 -1 -> -12345678
-shix208 shift -123456789 -8 -> -1
-shix209 shift -123456789 -9 -> -0
-shix210 shift -0 -2 -> -0
-shix211 shift -0 -0 -> -0
-
-
--- Specials; NaNs are handled as usual
-shix781 shift -Inf -8 -> -Infinity
-shix782 shift -Inf -1 -> -Infinity
-shix783 shift -Inf -0 -> -Infinity
-shix784 shift -Inf 0 -> -Infinity
-shix785 shift -Inf 1 -> -Infinity
-shix786 shift -Inf 8 -> -Infinity
-shix787 shift -1000 -Inf -> NaN Invalid_operation
-shix788 shift -Inf -Inf -> NaN Invalid_operation
-shix789 shift -1 -Inf -> NaN Invalid_operation
-shix790 shift -0 -Inf -> NaN Invalid_operation
-shix791 shift 0 -Inf -> NaN Invalid_operation
-shix792 shift 1 -Inf -> NaN Invalid_operation
-shix793 shift 1000 -Inf -> NaN Invalid_operation
-shix794 shift Inf -Inf -> NaN Invalid_operation
-
-shix800 shift Inf -Inf -> NaN Invalid_operation
-shix801 shift Inf -8 -> Infinity
-shix802 shift Inf -1 -> Infinity
-shix803 shift Inf -0 -> Infinity
-shix804 shift Inf 0 -> Infinity
-shix805 shift Inf 1 -> Infinity
-shix806 shift Inf 8 -> Infinity
-shix807 shift Inf Inf -> NaN Invalid_operation
-shix808 shift -1000 Inf -> NaN Invalid_operation
-shix809 shift -Inf Inf -> NaN Invalid_operation
-shix810 shift -1 Inf -> NaN Invalid_operation
-shix811 shift -0 Inf -> NaN Invalid_operation
-shix812 shift 0 Inf -> NaN Invalid_operation
-shix813 shift 1 Inf -> NaN Invalid_operation
-shix814 shift 1000 Inf -> NaN Invalid_operation
-shix815 shift Inf Inf -> NaN Invalid_operation
-
-shix821 shift NaN -Inf -> NaN
-shix822 shift NaN -1000 -> NaN
-shix823 shift NaN -1 -> NaN
-shix824 shift NaN -0 -> NaN
-shix825 shift NaN 0 -> NaN
-shix826 shift NaN 1 -> NaN
-shix827 shift NaN 1000 -> NaN
-shix828 shift NaN Inf -> NaN
-shix829 shift NaN NaN -> NaN
-shix830 shift -Inf NaN -> NaN
-shix831 shift -1000 NaN -> NaN
-shix832 shift -1 NaN -> NaN
-shix833 shift -0 NaN -> NaN
-shix834 shift 0 NaN -> NaN
-shix835 shift 1 NaN -> NaN
-shix836 shift 1000 NaN -> NaN
-shix837 shift Inf NaN -> NaN
-
-shix841 shift sNaN -Inf -> NaN Invalid_operation
-shix842 shift sNaN -1000 -> NaN Invalid_operation
-shix843 shift sNaN -1 -> NaN Invalid_operation
-shix844 shift sNaN -0 -> NaN Invalid_operation
-shix845 shift sNaN 0 -> NaN Invalid_operation
-shix846 shift sNaN 1 -> NaN Invalid_operation
-shix847 shift sNaN 1000 -> NaN Invalid_operation
-shix848 shift sNaN NaN -> NaN Invalid_operation
-shix849 shift sNaN sNaN -> NaN Invalid_operation
-shix850 shift NaN sNaN -> NaN Invalid_operation
-shix851 shift -Inf sNaN -> NaN Invalid_operation
-shix852 shift -1000 sNaN -> NaN Invalid_operation
-shix853 shift -1 sNaN -> NaN Invalid_operation
-shix854 shift -0 sNaN -> NaN Invalid_operation
-shix855 shift 0 sNaN -> NaN Invalid_operation
-shix856 shift 1 sNaN -> NaN Invalid_operation
-shix857 shift 1000 sNaN -> NaN Invalid_operation
-shix858 shift Inf sNaN -> NaN Invalid_operation
-shix859 shift NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-shix861 shift NaN1 -Inf -> NaN1
-shix862 shift +NaN2 -1000 -> NaN2
-shix863 shift NaN3 1000 -> NaN3
-shix864 shift NaN4 Inf -> NaN4
-shix865 shift NaN5 +NaN6 -> NaN5
-shix866 shift -Inf NaN7 -> NaN7
-shix867 shift -1000 NaN8 -> NaN8
-shix868 shift 1000 NaN9 -> NaN9
-shix869 shift Inf +NaN10 -> NaN10
-shix871 shift sNaN11 -Inf -> NaN11 Invalid_operation
-shix872 shift sNaN12 -1000 -> NaN12 Invalid_operation
-shix873 shift sNaN13 1000 -> NaN13 Invalid_operation
-shix874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
-shix875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
-shix876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
-shix877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
-shix878 shift -1000 sNaN21 -> NaN21 Invalid_operation
-shix879 shift 1000 sNaN22 -> NaN22 Invalid_operation
-shix880 shift Inf sNaN23 -> NaN23 Invalid_operation
-shix881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
-shix882 shift -NaN26 NaN28 -> -NaN26
-shix883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
-shix884 shift 1000 -NaN30 -> -NaN30
-shix885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
+------------------------------------------------------------------------
+-- shift.decTest -- shift coefficient left or right --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check
+shix001 shift 0 0 -> 0
+shix002 shift 0 2 -> 0
+shix003 shift 1 2 -> 100
+shix004 shift 1 8 -> 100000000
+shix005 shift 1 9 -> 0
+shix006 shift 1 -1 -> 0
+shix007 shift 123456789 -1 -> 12345678
+shix008 shift 123456789 -8 -> 1
+shix009 shift 123456789 -9 -> 0
+shix010 shift 0 -2 -> 0
+
+-- rhs must be an integer
+shix011 shift 1 1.5 -> NaN Invalid_operation
+shix012 shift 1 1.0 -> NaN Invalid_operation
+shix013 shift 1 0.1 -> NaN Invalid_operation
+shix014 shift 1 0.0 -> NaN Invalid_operation
+shix015 shift 1 1E+1 -> NaN Invalid_operation
+shix016 shift 1 1E+99 -> NaN Invalid_operation
+shix017 shift 1 Inf -> NaN Invalid_operation
+shix018 shift 1 -Inf -> NaN Invalid_operation
+-- and |rhs| <= precision
+shix020 shift 1 -1000 -> NaN Invalid_operation
+shix021 shift 1 -10 -> NaN Invalid_operation
+shix022 shift 1 10 -> NaN Invalid_operation
+shix023 shift 1 1000 -> NaN Invalid_operation
+
+-- full shifting pattern
+shix030 shift 123456789 -9 -> 0
+shix031 shift 123456789 -8 -> 1
+shix032 shift 123456789 -7 -> 12
+shix033 shift 123456789 -6 -> 123
+shix034 shift 123456789 -5 -> 1234
+shix035 shift 123456789 -4 -> 12345
+shix036 shift 123456789 -3 -> 123456
+shix037 shift 123456789 -2 -> 1234567
+shix038 shift 123456789 -1 -> 12345678
+shix039 shift 123456789 -0 -> 123456789
+shix040 shift 123456789 +0 -> 123456789
+shix041 shift 123456789 +1 -> 234567890
+shix042 shift 123456789 +2 -> 345678900
+shix043 shift 123456789 +3 -> 456789000
+shix044 shift 123456789 +4 -> 567890000
+shix045 shift 123456789 +5 -> 678900000
+shix046 shift 123456789 +6 -> 789000000
+shix047 shift 123456789 +7 -> 890000000
+shix048 shift 123456789 +8 -> 900000000
+shix049 shift 123456789 +9 -> 0
+
+-- from examples
+shix051 shift 34 8 -> '400000000'
+shix052 shift 12 9 -> '0'
+shix053 shift 123456789 -2 -> '1234567'
+shix054 shift 123456789 0 -> '123456789'
+shix055 shift 123456789 +2 -> '345678900'
+
+-- zeros
+shix060 shift 0E-10 +9 -> 0E-10
+shix061 shift 0E-10 -9 -> 0E-10
+shix062 shift 0.000 +9 -> 0.000
+shix063 shift 0.000 -9 -> 0.000
+shix064 shift 0E+10 +9 -> 0E+10
+shix065 shift 0E+10 -9 -> 0E+10
+shix066 shift -0E-10 +9 -> -0E-10
+shix067 shift -0E-10 -9 -> -0E-10
+shix068 shift -0.000 +9 -> -0.000
+shix069 shift -0.000 -9 -> -0.000
+shix070 shift -0E+10 +9 -> -0E+10
+shix071 shift -0E+10 -9 -> -0E+10
+
+-- Nmax, Nmin, Ntiny
+shix141 shift 9.99999999E+999 -1 -> 9.9999999E+998
+shix142 shift 9.99999999E+999 -8 -> 9E+991
+shix143 shift 9.99999999E+999 1 -> 9.99999990E+999
+shix144 shift 9.99999999E+999 8 -> 9.00000000E+999
+shix145 shift 1E-999 -1 -> 0E-999
+shix146 shift 1E-999 -8 -> 0E-999
+shix147 shift 1E-999 1 -> 1.0E-998
+shix148 shift 1E-999 8 -> 1.00000000E-991
+shix151 shift 1.00000000E-999 -1 -> 1.0000000E-1000
+shix152 shift 1.00000000E-999 -8 -> 1E-1007
+shix153 shift 1.00000000E-999 1 -> 0E-1007
+shix154 shift 1.00000000E-999 8 -> 0E-1007
+shix155 shift 9.00000000E-999 -1 -> 9.0000000E-1000
+shix156 shift 9.00000000E-999 -8 -> 9E-1007
+shix157 shift 9.00000000E-999 1 -> 0E-1007
+shix158 shift 9.00000000E-999 8 -> 0E-1007
+shix160 shift 1E-1007 -1 -> 0E-1007
+shix161 shift 1E-1007 -8 -> 0E-1007
+shix162 shift 1E-1007 1 -> 1.0E-1006
+shix163 shift 1E-1007 8 -> 1.00000000E-999
+-- negatives
+shix171 shift -9.99999999E+999 -1 -> -9.9999999E+998
+shix172 shift -9.99999999E+999 -8 -> -9E+991
+shix173 shift -9.99999999E+999 1 -> -9.99999990E+999
+shix174 shift -9.99999999E+999 8 -> -9.00000000E+999
+shix175 shift -1E-999 -1 -> -0E-999
+shix176 shift -1E-999 -8 -> -0E-999
+shix177 shift -1E-999 1 -> -1.0E-998
+shix178 shift -1E-999 8 -> -1.00000000E-991
+shix181 shift -1.00000000E-999 -1 -> -1.0000000E-1000
+shix182 shift -1.00000000E-999 -8 -> -1E-1007
+shix183 shift -1.00000000E-999 1 -> -0E-1007
+shix184 shift -1.00000000E-999 8 -> -0E-1007
+shix185 shift -9.00000000E-999 -1 -> -9.0000000E-1000
+shix186 shift -9.00000000E-999 -8 -> -9E-1007
+shix187 shift -9.00000000E-999 1 -> -0E-1007
+shix188 shift -9.00000000E-999 8 -> -0E-1007
+shix190 shift -1E-1007 -1 -> -0E-1007
+shix191 shift -1E-1007 -8 -> -0E-1007
+shix192 shift -1E-1007 1 -> -1.0E-1006
+shix193 shift -1E-1007 8 -> -1.00000000E-999
+
+-- more negatives (of sanities)
+shix201 shift -0 0 -> -0
+shix202 shift -0 2 -> -0
+shix203 shift -1 2 -> -100
+shix204 shift -1 8 -> -100000000
+shix205 shift -1 9 -> -0
+shix206 shift -1 -1 -> -0
+shix207 shift -123456789 -1 -> -12345678
+shix208 shift -123456789 -8 -> -1
+shix209 shift -123456789 -9 -> -0
+shix210 shift -0 -2 -> -0
+shix211 shift -0 -0 -> -0
+
+
+-- Specials; NaNs are handled as usual
+shix781 shift -Inf -8 -> -Infinity
+shix782 shift -Inf -1 -> -Infinity
+shix783 shift -Inf -0 -> -Infinity
+shix784 shift -Inf 0 -> -Infinity
+shix785 shift -Inf 1 -> -Infinity
+shix786 shift -Inf 8 -> -Infinity
+shix787 shift -1000 -Inf -> NaN Invalid_operation
+shix788 shift -Inf -Inf -> NaN Invalid_operation
+shix789 shift -1 -Inf -> NaN Invalid_operation
+shix790 shift -0 -Inf -> NaN Invalid_operation
+shix791 shift 0 -Inf -> NaN Invalid_operation
+shix792 shift 1 -Inf -> NaN Invalid_operation
+shix793 shift 1000 -Inf -> NaN Invalid_operation
+shix794 shift Inf -Inf -> NaN Invalid_operation
+
+shix800 shift Inf -Inf -> NaN Invalid_operation
+shix801 shift Inf -8 -> Infinity
+shix802 shift Inf -1 -> Infinity
+shix803 shift Inf -0 -> Infinity
+shix804 shift Inf 0 -> Infinity
+shix805 shift Inf 1 -> Infinity
+shix806 shift Inf 8 -> Infinity
+shix807 shift Inf Inf -> NaN Invalid_operation
+shix808 shift -1000 Inf -> NaN Invalid_operation
+shix809 shift -Inf Inf -> NaN Invalid_operation
+shix810 shift -1 Inf -> NaN Invalid_operation
+shix811 shift -0 Inf -> NaN Invalid_operation
+shix812 shift 0 Inf -> NaN Invalid_operation
+shix813 shift 1 Inf -> NaN Invalid_operation
+shix814 shift 1000 Inf -> NaN Invalid_operation
+shix815 shift Inf Inf -> NaN Invalid_operation
+
+shix821 shift NaN -Inf -> NaN
+shix822 shift NaN -1000 -> NaN
+shix823 shift NaN -1 -> NaN
+shix824 shift NaN -0 -> NaN
+shix825 shift NaN 0 -> NaN
+shix826 shift NaN 1 -> NaN
+shix827 shift NaN 1000 -> NaN
+shix828 shift NaN Inf -> NaN
+shix829 shift NaN NaN -> NaN
+shix830 shift -Inf NaN -> NaN
+shix831 shift -1000 NaN -> NaN
+shix832 shift -1 NaN -> NaN
+shix833 shift -0 NaN -> NaN
+shix834 shift 0 NaN -> NaN
+shix835 shift 1 NaN -> NaN
+shix836 shift 1000 NaN -> NaN
+shix837 shift Inf NaN -> NaN
+
+shix841 shift sNaN -Inf -> NaN Invalid_operation
+shix842 shift sNaN -1000 -> NaN Invalid_operation
+shix843 shift sNaN -1 -> NaN Invalid_operation
+shix844 shift sNaN -0 -> NaN Invalid_operation
+shix845 shift sNaN 0 -> NaN Invalid_operation
+shix846 shift sNaN 1 -> NaN Invalid_operation
+shix847 shift sNaN 1000 -> NaN Invalid_operation
+shix848 shift sNaN NaN -> NaN Invalid_operation
+shix849 shift sNaN sNaN -> NaN Invalid_operation
+shix850 shift NaN sNaN -> NaN Invalid_operation
+shix851 shift -Inf sNaN -> NaN Invalid_operation
+shix852 shift -1000 sNaN -> NaN Invalid_operation
+shix853 shift -1 sNaN -> NaN Invalid_operation
+shix854 shift -0 sNaN -> NaN Invalid_operation
+shix855 shift 0 sNaN -> NaN Invalid_operation
+shix856 shift 1 sNaN -> NaN Invalid_operation
+shix857 shift 1000 sNaN -> NaN Invalid_operation
+shix858 shift Inf sNaN -> NaN Invalid_operation
+shix859 shift NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+shix861 shift NaN1 -Inf -> NaN1
+shix862 shift +NaN2 -1000 -> NaN2
+shix863 shift NaN3 1000 -> NaN3
+shix864 shift NaN4 Inf -> NaN4
+shix865 shift NaN5 +NaN6 -> NaN5
+shix866 shift -Inf NaN7 -> NaN7
+shix867 shift -1000 NaN8 -> NaN8
+shix868 shift 1000 NaN9 -> NaN9
+shix869 shift Inf +NaN10 -> NaN10
+shix871 shift sNaN11 -Inf -> NaN11 Invalid_operation
+shix872 shift sNaN12 -1000 -> NaN12 Invalid_operation
+shix873 shift sNaN13 1000 -> NaN13 Invalid_operation
+shix874 shift sNaN14 NaN17 -> NaN14 Invalid_operation
+shix875 shift sNaN15 sNaN18 -> NaN15 Invalid_operation
+shix876 shift NaN16 sNaN19 -> NaN19 Invalid_operation
+shix877 shift -Inf +sNaN20 -> NaN20 Invalid_operation
+shix878 shift -1000 sNaN21 -> NaN21 Invalid_operation
+shix879 shift 1000 sNaN22 -> NaN22 Invalid_operation
+shix880 shift Inf sNaN23 -> NaN23 Invalid_operation
+shix881 shift +NaN25 +sNaN24 -> NaN24 Invalid_operation
+shix882 shift -NaN26 NaN28 -> -NaN26
+shix883 shift -sNaN27 sNaN29 -> -NaN27 Invalid_operation
+shix884 shift 1000 -NaN30 -> -NaN30
+shix885 shift 1000 -sNaN31 -> -NaN31 Invalid_operation
diff --git a/Lib/test/decimaltestdata/tointegralx.decTest b/Lib/test/decimaltestdata/tointegralx.decTest
index 0ce0d0935e..e250e3a06e 100644
--- a/Lib/test/decimaltestdata/tointegralx.decTest
+++ b/Lib/test/decimaltestdata/tointegralx.decTest
@@ -1,255 +1,255 @@
-------------------------------------------------------------------------
--- tointegralx.decTest -- round decimal to integral value, exact --
--- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
--- This set of tests tests the extended specification 'round-to-integral
--- value' operation (from IEEE 854, later modified in 754r).
--- All non-zero results are defined as being those from either copy or
--- quantize, so those are assumed to have been tested.
-
--- This tests toIntegraExact, which may set Inexact
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
-intxx001 tointegralx 0 -> 0
-intxx002 tointegralx 0.0 -> 0
-intxx003 tointegralx 0.1 -> 0 Inexact Rounded
-intxx004 tointegralx 0.2 -> 0 Inexact Rounded
-intxx005 tointegralx 0.3 -> 0 Inexact Rounded
-intxx006 tointegralx 0.4 -> 0 Inexact Rounded
-intxx007 tointegralx 0.5 -> 1 Inexact Rounded
-intxx008 tointegralx 0.6 -> 1 Inexact Rounded
-intxx009 tointegralx 0.7 -> 1 Inexact Rounded
-intxx010 tointegralx 0.8 -> 1 Inexact Rounded
-intxx011 tointegralx 0.9 -> 1 Inexact Rounded
-intxx012 tointegralx 1 -> 1
-intxx013 tointegralx 1.0 -> 1 Rounded
-intxx014 tointegralx 1.1 -> 1 Inexact Rounded
-intxx015 tointegralx 1.2 -> 1 Inexact Rounded
-intxx016 tointegralx 1.3 -> 1 Inexact Rounded
-intxx017 tointegralx 1.4 -> 1 Inexact Rounded
-intxx018 tointegralx 1.5 -> 2 Inexact Rounded
-intxx019 tointegralx 1.6 -> 2 Inexact Rounded
-intxx020 tointegralx 1.7 -> 2 Inexact Rounded
-intxx021 tointegralx 1.8 -> 2 Inexact Rounded
-intxx022 tointegralx 1.9 -> 2 Inexact Rounded
--- negatives
-intxx031 tointegralx -0 -> -0
-intxx032 tointegralx -0.0 -> -0
-intxx033 tointegralx -0.1 -> -0 Inexact Rounded
-intxx034 tointegralx -0.2 -> -0 Inexact Rounded
-intxx035 tointegralx -0.3 -> -0 Inexact Rounded
-intxx036 tointegralx -0.4 -> -0 Inexact Rounded
-intxx037 tointegralx -0.5 -> -1 Inexact Rounded
-intxx038 tointegralx -0.6 -> -1 Inexact Rounded
-intxx039 tointegralx -0.7 -> -1 Inexact Rounded
-intxx040 tointegralx -0.8 -> -1 Inexact Rounded
-intxx041 tointegralx -0.9 -> -1 Inexact Rounded
-intxx042 tointegralx -1 -> -1
-intxx043 tointegralx -1.0 -> -1 Rounded
-intxx044 tointegralx -1.1 -> -1 Inexact Rounded
-intxx045 tointegralx -1.2 -> -1 Inexact Rounded
-intxx046 tointegralx -1.3 -> -1 Inexact Rounded
-intxx047 tointegralx -1.4 -> -1 Inexact Rounded
-intxx048 tointegralx -1.5 -> -2 Inexact Rounded
-intxx049 tointegralx -1.6 -> -2 Inexact Rounded
-intxx050 tointegralx -1.7 -> -2 Inexact Rounded
-intxx051 tointegralx -1.8 -> -2 Inexact Rounded
-intxx052 tointegralx -1.9 -> -2 Inexact Rounded
--- next two would be NaN using quantize(x, 0)
-intxx053 tointegralx 10E+30 -> 1.0E+31
-intxx054 tointegralx -10E+30 -> -1.0E+31
-
--- numbers around precision
-precision: 9
-intxx060 tointegralx '56267E-10' -> '0' Inexact Rounded
-intxx061 tointegralx '56267E-5' -> '1' Inexact Rounded
-intxx062 tointegralx '56267E-2' -> '563' Inexact Rounded
-intxx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
-intxx065 tointegralx '56267E-0' -> '56267'
-intxx066 tointegralx '56267E+0' -> '56267'
-intxx067 tointegralx '56267E+1' -> '5.6267E+5'
-intxx068 tointegralx '56267E+2' -> '5.6267E+6'
-intxx069 tointegralx '56267E+3' -> '5.6267E+7'
-intxx070 tointegralx '56267E+4' -> '5.6267E+8'
-intxx071 tointegralx '56267E+5' -> '5.6267E+9'
-intxx072 tointegralx '56267E+6' -> '5.6267E+10'
-intxx073 tointegralx '1.23E+96' -> '1.23E+96'
-intxx074 tointegralx '1.23E+384' -> '1.23E+384'
-intxx075 tointegralx '1.23E+999' -> '1.23E+999'
-
-intxx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
-intxx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
-intxx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
-intxx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
-intxx085 tointegralx '-56267E-0' -> '-56267'
-intxx086 tointegralx '-56267E+0' -> '-56267'
-intxx087 tointegralx '-56267E+1' -> '-5.6267E+5'
-intxx088 tointegralx '-56267E+2' -> '-5.6267E+6'
-intxx089 tointegralx '-56267E+3' -> '-5.6267E+7'
-intxx090 tointegralx '-56267E+4' -> '-5.6267E+8'
-intxx091 tointegralx '-56267E+5' -> '-5.6267E+9'
-intxx092 tointegralx '-56267E+6' -> '-5.6267E+10'
-intxx093 tointegralx '-1.23E+96' -> '-1.23E+96'
-intxx094 tointegralx '-1.23E+384' -> '-1.23E+384'
-intxx095 tointegralx '-1.23E+999' -> '-1.23E+999'
-
--- subnormal inputs
-intxx100 tointegralx 1E-999 -> 0 Inexact Rounded
-intxx101 tointegralx 0.1E-999 -> 0 Inexact Rounded
-intxx102 tointegralx 0.01E-999 -> 0 Inexact Rounded
-intxx103 tointegralx 0E-999 -> 0
-
--- specials and zeros
-intxx120 tointegralx 'Inf' -> Infinity
-intxx121 tointegralx '-Inf' -> -Infinity
-intxx122 tointegralx NaN -> NaN
-intxx123 tointegralx sNaN -> NaN Invalid_operation
-intxx124 tointegralx 0 -> 0
-intxx125 tointegralx -0 -> -0
-intxx126 tointegralx 0.000 -> 0
-intxx127 tointegralx 0.00 -> 0
-intxx128 tointegralx 0.0 -> 0
-intxx129 tointegralx 0 -> 0
-intxx130 tointegralx 0E-3 -> 0
-intxx131 tointegralx 0E-2 -> 0
-intxx132 tointegralx 0E-1 -> 0
-intxx133 tointegralx 0E-0 -> 0
-intxx134 tointegralx 0E+1 -> 0E+1
-intxx135 tointegralx 0E+2 -> 0E+2
-intxx136 tointegralx 0E+3 -> 0E+3
-intxx137 tointegralx 0E+4 -> 0E+4
-intxx138 tointegralx 0E+5 -> 0E+5
-intxx139 tointegralx -0.000 -> -0
-intxx140 tointegralx -0.00 -> -0
-intxx141 tointegralx -0.0 -> -0
-intxx142 tointegralx -0 -> -0
-intxx143 tointegralx -0E-3 -> -0
-intxx144 tointegralx -0E-2 -> -0
-intxx145 tointegralx -0E-1 -> -0
-intxx146 tointegralx -0E-0 -> -0
-intxx147 tointegralx -0E+1 -> -0E+1
-intxx148 tointegralx -0E+2 -> -0E+2
-intxx149 tointegralx -0E+3 -> -0E+3
-intxx150 tointegralx -0E+4 -> -0E+4
-intxx151 tointegralx -0E+5 -> -0E+5
--- propagating NaNs
-intxx152 tointegralx NaN808 -> NaN808
-intxx153 tointegralx sNaN080 -> NaN80 Invalid_operation
-intxx154 tointegralx -NaN808 -> -NaN808
-intxx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
-intxx156 tointegralx -NaN -> -NaN
-intxx157 tointegralx -sNaN -> -NaN Invalid_operation
-
--- examples
-rounding: half_up
-precision: 9
-intxx200 tointegralx 2.1 -> 2 Inexact Rounded
-intxx201 tointegralx 100 -> 100
-intxx202 tointegralx 100.0 -> 100 Rounded
-intxx203 tointegralx 101.5 -> 102 Inexact Rounded
-intxx204 tointegralx -101.5 -> -102 Inexact Rounded
-intxx205 tointegralx 10E+5 -> 1.0E+6
-intxx206 tointegralx 7.89E+77 -> 7.89E+77
-intxx207 tointegralx -Inf -> -Infinity
-
-
--- all rounding modes
-rounding: half_even
-
-intxx210 tointegralx 55.5 -> 56 Inexact Rounded
-intxx211 tointegralx 56.5 -> 56 Inexact Rounded
-intxx212 tointegralx 57.5 -> 58 Inexact Rounded
-intxx213 tointegralx -55.5 -> -56 Inexact Rounded
-intxx214 tointegralx -56.5 -> -56 Inexact Rounded
-intxx215 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_up
-
-intxx220 tointegralx 55.5 -> 56 Inexact Rounded
-intxx221 tointegralx 56.5 -> 57 Inexact Rounded
-intxx222 tointegralx 57.5 -> 58 Inexact Rounded
-intxx223 tointegralx -55.5 -> -56 Inexact Rounded
-intxx224 tointegralx -56.5 -> -57 Inexact Rounded
-intxx225 tointegralx -57.5 -> -58 Inexact Rounded
-
-rounding: half_down
-
-intxx230 tointegralx 55.5 -> 55 Inexact Rounded
-intxx231 tointegralx 56.5 -> 56 Inexact Rounded
-intxx232 tointegralx 57.5 -> 57 Inexact Rounded
-intxx233 tointegralx -55.5 -> -55 Inexact Rounded
-intxx234 tointegralx -56.5 -> -56 Inexact Rounded
-intxx235 tointegralx -57.5 -> -57 Inexact Rounded
-
-rounding: up
-
-intxx240 tointegralx 55.3 -> 56 Inexact Rounded
-intxx241 tointegralx 56.3 -> 57 Inexact Rounded
-intxx242 tointegralx 57.3 -> 58 Inexact Rounded
-intxx243 tointegralx -55.3 -> -56 Inexact Rounded
-intxx244 tointegralx -56.3 -> -57 Inexact Rounded
-intxx245 tointegralx -57.3 -> -58 Inexact Rounded
-
-rounding: down
-
-intxx250 tointegralx 55.7 -> 55 Inexact Rounded
-intxx251 tointegralx 56.7 -> 56 Inexact Rounded
-intxx252 tointegralx 57.7 -> 57 Inexact Rounded
-intxx253 tointegralx -55.7 -> -55 Inexact Rounded
-intxx254 tointegralx -56.7 -> -56 Inexact Rounded
-intxx255 tointegralx -57.7 -> -57 Inexact Rounded
-
-rounding: ceiling
-
-intxx260 tointegralx 55.3 -> 56 Inexact Rounded
-intxx261 tointegralx 56.3 -> 57 Inexact Rounded
-intxx262 tointegralx 57.3 -> 58 Inexact Rounded
-intxx263 tointegralx -55.3 -> -55 Inexact Rounded
-intxx264 tointegralx -56.3 -> -56 Inexact Rounded
-intxx265 tointegralx -57.3 -> -57 Inexact Rounded
-
-rounding: floor
-
-intxx270 tointegralx 55.7 -> 55 Inexact Rounded
-intxx271 tointegralx 56.7 -> 56 Inexact Rounded
-intxx272 tointegralx 57.7 -> 57 Inexact Rounded
-intxx273 tointegralx -55.7 -> -56 Inexact Rounded
-intxx274 tointegralx -56.7 -> -57 Inexact Rounded
-intxx275 tointegralx -57.7 -> -58 Inexact Rounded
-
--- Int and uInt32 edge values for testing conversions
-precision: 16
-intxx300 tointegralx -2147483646 -> -2147483646
-intxx301 tointegralx -2147483647 -> -2147483647
-intxx302 tointegralx -2147483648 -> -2147483648
-intxx303 tointegralx -2147483649 -> -2147483649
-intxx304 tointegralx 2147483646 -> 2147483646
-intxx305 tointegralx 2147483647 -> 2147483647
-intxx306 tointegralx 2147483648 -> 2147483648
-intxx307 tointegralx 2147483649 -> 2147483649
-intxx308 tointegralx 4294967294 -> 4294967294
-intxx309 tointegralx 4294967295 -> 4294967295
-intxx310 tointegralx 4294967296 -> 4294967296
-intxx311 tointegralx 4294967297 -> 4294967297
+------------------------------------------------------------------------
+-- tointegralx.decTest -- round decimal to integral value, exact --
+-- Copyright (c) IBM Corporation, 2001, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+-- This set of tests tests the extended specification 'round-to-integral
+-- value' operation (from IEEE 854, later modified in 754r).
+-- All non-zero results are defined as being those from either copy or
+-- quantize, so those are assumed to have been tested.
+
+-- This tests toIntegraExact, which may set Inexact
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+intxx001 tointegralx 0 -> 0
+intxx002 tointegralx 0.0 -> 0
+intxx003 tointegralx 0.1 -> 0 Inexact Rounded
+intxx004 tointegralx 0.2 -> 0 Inexact Rounded
+intxx005 tointegralx 0.3 -> 0 Inexact Rounded
+intxx006 tointegralx 0.4 -> 0 Inexact Rounded
+intxx007 tointegralx 0.5 -> 1 Inexact Rounded
+intxx008 tointegralx 0.6 -> 1 Inexact Rounded
+intxx009 tointegralx 0.7 -> 1 Inexact Rounded
+intxx010 tointegralx 0.8 -> 1 Inexact Rounded
+intxx011 tointegralx 0.9 -> 1 Inexact Rounded
+intxx012 tointegralx 1 -> 1
+intxx013 tointegralx 1.0 -> 1 Rounded
+intxx014 tointegralx 1.1 -> 1 Inexact Rounded
+intxx015 tointegralx 1.2 -> 1 Inexact Rounded
+intxx016 tointegralx 1.3 -> 1 Inexact Rounded
+intxx017 tointegralx 1.4 -> 1 Inexact Rounded
+intxx018 tointegralx 1.5 -> 2 Inexact Rounded
+intxx019 tointegralx 1.6 -> 2 Inexact Rounded
+intxx020 tointegralx 1.7 -> 2 Inexact Rounded
+intxx021 tointegralx 1.8 -> 2 Inexact Rounded
+intxx022 tointegralx 1.9 -> 2 Inexact Rounded
+-- negatives
+intxx031 tointegralx -0 -> -0
+intxx032 tointegralx -0.0 -> -0
+intxx033 tointegralx -0.1 -> -0 Inexact Rounded
+intxx034 tointegralx -0.2 -> -0 Inexact Rounded
+intxx035 tointegralx -0.3 -> -0 Inexact Rounded
+intxx036 tointegralx -0.4 -> -0 Inexact Rounded
+intxx037 tointegralx -0.5 -> -1 Inexact Rounded
+intxx038 tointegralx -0.6 -> -1 Inexact Rounded
+intxx039 tointegralx -0.7 -> -1 Inexact Rounded
+intxx040 tointegralx -0.8 -> -1 Inexact Rounded
+intxx041 tointegralx -0.9 -> -1 Inexact Rounded
+intxx042 tointegralx -1 -> -1
+intxx043 tointegralx -1.0 -> -1 Rounded
+intxx044 tointegralx -1.1 -> -1 Inexact Rounded
+intxx045 tointegralx -1.2 -> -1 Inexact Rounded
+intxx046 tointegralx -1.3 -> -1 Inexact Rounded
+intxx047 tointegralx -1.4 -> -1 Inexact Rounded
+intxx048 tointegralx -1.5 -> -2 Inexact Rounded
+intxx049 tointegralx -1.6 -> -2 Inexact Rounded
+intxx050 tointegralx -1.7 -> -2 Inexact Rounded
+intxx051 tointegralx -1.8 -> -2 Inexact Rounded
+intxx052 tointegralx -1.9 -> -2 Inexact Rounded
+-- next two would be NaN using quantize(x, 0)
+intxx053 tointegralx 10E+30 -> 1.0E+31
+intxx054 tointegralx -10E+30 -> -1.0E+31
+
+-- numbers around precision
+precision: 9
+intxx060 tointegralx '56267E-10' -> '0' Inexact Rounded
+intxx061 tointegralx '56267E-5' -> '1' Inexact Rounded
+intxx062 tointegralx '56267E-2' -> '563' Inexact Rounded
+intxx063 tointegralx '56267E-1' -> '5627' Inexact Rounded
+intxx065 tointegralx '56267E-0' -> '56267'
+intxx066 tointegralx '56267E+0' -> '56267'
+intxx067 tointegralx '56267E+1' -> '5.6267E+5'
+intxx068 tointegralx '56267E+2' -> '5.6267E+6'
+intxx069 tointegralx '56267E+3' -> '5.6267E+7'
+intxx070 tointegralx '56267E+4' -> '5.6267E+8'
+intxx071 tointegralx '56267E+5' -> '5.6267E+9'
+intxx072 tointegralx '56267E+6' -> '5.6267E+10'
+intxx073 tointegralx '1.23E+96' -> '1.23E+96'
+intxx074 tointegralx '1.23E+384' -> '1.23E+384'
+intxx075 tointegralx '1.23E+999' -> '1.23E+999'
+
+intxx080 tointegralx '-56267E-10' -> '-0' Inexact Rounded
+intxx081 tointegralx '-56267E-5' -> '-1' Inexact Rounded
+intxx082 tointegralx '-56267E-2' -> '-563' Inexact Rounded
+intxx083 tointegralx '-56267E-1' -> '-5627' Inexact Rounded
+intxx085 tointegralx '-56267E-0' -> '-56267'
+intxx086 tointegralx '-56267E+0' -> '-56267'
+intxx087 tointegralx '-56267E+1' -> '-5.6267E+5'
+intxx088 tointegralx '-56267E+2' -> '-5.6267E+6'
+intxx089 tointegralx '-56267E+3' -> '-5.6267E+7'
+intxx090 tointegralx '-56267E+4' -> '-5.6267E+8'
+intxx091 tointegralx '-56267E+5' -> '-5.6267E+9'
+intxx092 tointegralx '-56267E+6' -> '-5.6267E+10'
+intxx093 tointegralx '-1.23E+96' -> '-1.23E+96'
+intxx094 tointegralx '-1.23E+384' -> '-1.23E+384'
+intxx095 tointegralx '-1.23E+999' -> '-1.23E+999'
+
+-- subnormal inputs
+intxx100 tointegralx 1E-999 -> 0 Inexact Rounded
+intxx101 tointegralx 0.1E-999 -> 0 Inexact Rounded
+intxx102 tointegralx 0.01E-999 -> 0 Inexact Rounded
+intxx103 tointegralx 0E-999 -> 0
+
+-- specials and zeros
+intxx120 tointegralx 'Inf' -> Infinity
+intxx121 tointegralx '-Inf' -> -Infinity
+intxx122 tointegralx NaN -> NaN
+intxx123 tointegralx sNaN -> NaN Invalid_operation
+intxx124 tointegralx 0 -> 0
+intxx125 tointegralx -0 -> -0
+intxx126 tointegralx 0.000 -> 0
+intxx127 tointegralx 0.00 -> 0
+intxx128 tointegralx 0.0 -> 0
+intxx129 tointegralx 0 -> 0
+intxx130 tointegralx 0E-3 -> 0
+intxx131 tointegralx 0E-2 -> 0
+intxx132 tointegralx 0E-1 -> 0
+intxx133 tointegralx 0E-0 -> 0
+intxx134 tointegralx 0E+1 -> 0E+1
+intxx135 tointegralx 0E+2 -> 0E+2
+intxx136 tointegralx 0E+3 -> 0E+3
+intxx137 tointegralx 0E+4 -> 0E+4
+intxx138 tointegralx 0E+5 -> 0E+5
+intxx139 tointegralx -0.000 -> -0
+intxx140 tointegralx -0.00 -> -0
+intxx141 tointegralx -0.0 -> -0
+intxx142 tointegralx -0 -> -0
+intxx143 tointegralx -0E-3 -> -0
+intxx144 tointegralx -0E-2 -> -0
+intxx145 tointegralx -0E-1 -> -0
+intxx146 tointegralx -0E-0 -> -0
+intxx147 tointegralx -0E+1 -> -0E+1
+intxx148 tointegralx -0E+2 -> -0E+2
+intxx149 tointegralx -0E+3 -> -0E+3
+intxx150 tointegralx -0E+4 -> -0E+4
+intxx151 tointegralx -0E+5 -> -0E+5
+-- propagating NaNs
+intxx152 tointegralx NaN808 -> NaN808
+intxx153 tointegralx sNaN080 -> NaN80 Invalid_operation
+intxx154 tointegralx -NaN808 -> -NaN808
+intxx155 tointegralx -sNaN080 -> -NaN80 Invalid_operation
+intxx156 tointegralx -NaN -> -NaN
+intxx157 tointegralx -sNaN -> -NaN Invalid_operation
+
+-- examples
+rounding: half_up
+precision: 9
+intxx200 tointegralx 2.1 -> 2 Inexact Rounded
+intxx201 tointegralx 100 -> 100
+intxx202 tointegralx 100.0 -> 100 Rounded
+intxx203 tointegralx 101.5 -> 102 Inexact Rounded
+intxx204 tointegralx -101.5 -> -102 Inexact Rounded
+intxx205 tointegralx 10E+5 -> 1.0E+6
+intxx206 tointegralx 7.89E+77 -> 7.89E+77
+intxx207 tointegralx -Inf -> -Infinity
+
+
+-- all rounding modes
+rounding: half_even
+
+intxx210 tointegralx 55.5 -> 56 Inexact Rounded
+intxx211 tointegralx 56.5 -> 56 Inexact Rounded
+intxx212 tointegralx 57.5 -> 58 Inexact Rounded
+intxx213 tointegralx -55.5 -> -56 Inexact Rounded
+intxx214 tointegralx -56.5 -> -56 Inexact Rounded
+intxx215 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_up
+
+intxx220 tointegralx 55.5 -> 56 Inexact Rounded
+intxx221 tointegralx 56.5 -> 57 Inexact Rounded
+intxx222 tointegralx 57.5 -> 58 Inexact Rounded
+intxx223 tointegralx -55.5 -> -56 Inexact Rounded
+intxx224 tointegralx -56.5 -> -57 Inexact Rounded
+intxx225 tointegralx -57.5 -> -58 Inexact Rounded
+
+rounding: half_down
+
+intxx230 tointegralx 55.5 -> 55 Inexact Rounded
+intxx231 tointegralx 56.5 -> 56 Inexact Rounded
+intxx232 tointegralx 57.5 -> 57 Inexact Rounded
+intxx233 tointegralx -55.5 -> -55 Inexact Rounded
+intxx234 tointegralx -56.5 -> -56 Inexact Rounded
+intxx235 tointegralx -57.5 -> -57 Inexact Rounded
+
+rounding: up
+
+intxx240 tointegralx 55.3 -> 56 Inexact Rounded
+intxx241 tointegralx 56.3 -> 57 Inexact Rounded
+intxx242 tointegralx 57.3 -> 58 Inexact Rounded
+intxx243 tointegralx -55.3 -> -56 Inexact Rounded
+intxx244 tointegralx -56.3 -> -57 Inexact Rounded
+intxx245 tointegralx -57.3 -> -58 Inexact Rounded
+
+rounding: down
+
+intxx250 tointegralx 55.7 -> 55 Inexact Rounded
+intxx251 tointegralx 56.7 -> 56 Inexact Rounded
+intxx252 tointegralx 57.7 -> 57 Inexact Rounded
+intxx253 tointegralx -55.7 -> -55 Inexact Rounded
+intxx254 tointegralx -56.7 -> -56 Inexact Rounded
+intxx255 tointegralx -57.7 -> -57 Inexact Rounded
+
+rounding: ceiling
+
+intxx260 tointegralx 55.3 -> 56 Inexact Rounded
+intxx261 tointegralx 56.3 -> 57 Inexact Rounded
+intxx262 tointegralx 57.3 -> 58 Inexact Rounded
+intxx263 tointegralx -55.3 -> -55 Inexact Rounded
+intxx264 tointegralx -56.3 -> -56 Inexact Rounded
+intxx265 tointegralx -57.3 -> -57 Inexact Rounded
+
+rounding: floor
+
+intxx270 tointegralx 55.7 -> 55 Inexact Rounded
+intxx271 tointegralx 56.7 -> 56 Inexact Rounded
+intxx272 tointegralx 57.7 -> 57 Inexact Rounded
+intxx273 tointegralx -55.7 -> -56 Inexact Rounded
+intxx274 tointegralx -56.7 -> -57 Inexact Rounded
+intxx275 tointegralx -57.7 -> -58 Inexact Rounded
+
+-- Int and uInt32 edge values for testing conversions
+precision: 16
+intxx300 tointegralx -2147483646 -> -2147483646
+intxx301 tointegralx -2147483647 -> -2147483647
+intxx302 tointegralx -2147483648 -> -2147483648
+intxx303 tointegralx -2147483649 -> -2147483649
+intxx304 tointegralx 2147483646 -> 2147483646
+intxx305 tointegralx 2147483647 -> 2147483647
+intxx306 tointegralx 2147483648 -> 2147483648
+intxx307 tointegralx 2147483649 -> 2147483649
+intxx308 tointegralx 4294967294 -> 4294967294
+intxx309 tointegralx 4294967295 -> 4294967295
+intxx310 tointegralx 4294967296 -> 4294967296
+intxx311 tointegralx 4294967297 -> 4294967297
diff --git a/Lib/test/decimaltestdata/xor.decTest b/Lib/test/decimaltestdata/xor.decTest
index cd71bbcf86..122976e44c 100644
--- a/Lib/test/decimaltestdata/xor.decTest
+++ b/Lib/test/decimaltestdata/xor.decTest
@@ -1,335 +1,335 @@
-------------------------------------------------------------------------
--- xor.decTest -- digitwise logical XOR --
--- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
-------------------------------------------------------------------------
--- Please see the document "General Decimal Arithmetic Testcases" --
--- at http://www2.hursley.ibm.com/decimal for the description of --
--- these testcases. --
--- --
--- These testcases are experimental ('beta' versions), and they --
--- may contain errors. They are offered on an as-is basis. In --
--- particular, achieving the same results as the tests here is not --
--- a guarantee that an implementation complies with any Standard --
--- or specification. The tests are not exhaustive. --
--- --
--- Please send comments, suggestions, and corrections to the author: --
--- Mike Cowlishaw, IBM Fellow --
--- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
--- mfc@uk.ibm.com --
-------------------------------------------------------------------------
-version: 2.59
-
-extended: 1
-precision: 9
-rounding: half_up
-maxExponent: 999
-minExponent: -999
-
--- Sanity check (truth table)
-xorx001 xor 0 0 -> 0
-xorx002 xor 0 1 -> 1
-xorx003 xor 1 0 -> 1
-xorx004 xor 1 1 -> 0
-xorx005 xor 1100 1010 -> 110
-xorx006 xor 1111 10 -> 1101
--- and at msd and msd-1
-xorx010 xor 000000000 000000000 -> 0
-xorx011 xor 000000000 100000000 -> 100000000
-xorx012 xor 100000000 000000000 -> 100000000
-xorx013 xor 100000000 100000000 -> 0
-xorx014 xor 000000000 000000000 -> 0
-xorx015 xor 000000000 010000000 -> 10000000
-xorx016 xor 010000000 000000000 -> 10000000
-xorx017 xor 010000000 010000000 -> 0
-
--- Various lengths
--- 123456789 123456789 123456789
-xorx021 xor 111111111 111111111 -> 0
-xorx022 xor 111111111111 111111111 -> 0
-xorx023 xor 11111111 11111111 -> 0
-xorx025 xor 1111111 1111111 -> 0
-xorx026 xor 111111 111111 -> 0
-xorx027 xor 11111 11111 -> 0
-xorx028 xor 1111 1111 -> 0
-xorx029 xor 111 111 -> 0
-xorx031 xor 11 11 -> 0
-xorx032 xor 1 1 -> 0
-xorx033 xor 111111111111 1111111111 -> 0
-xorx034 xor 11111111111 11111111111 -> 0
-xorx035 xor 1111111111 111111111111 -> 0
-xorx036 xor 111111111 1111111111111 -> 0
-
-xorx040 xor 111111111 111111111111 -> 0
-xorx041 xor 11111111 111111111111 -> 100000000
-xorx042 xor 11111111 111111111 -> 100000000
-xorx043 xor 1111111 100000010 -> 101111101
-xorx044 xor 111111 100000100 -> 100111011
-xorx045 xor 11111 100001000 -> 100010111
-xorx046 xor 1111 100010000 -> 100011111
-xorx047 xor 111 100100000 -> 100100111
-xorx048 xor 11 101000000 -> 101000011
-xorx049 xor 1 110000000 -> 110000001
-
-xorx050 xor 1111111111 1 -> 111111110
-xorx051 xor 111111111 1 -> 111111110
-xorx052 xor 11111111 1 -> 11111110
-xorx053 xor 1111111 1 -> 1111110
-xorx054 xor 111111 1 -> 111110
-xorx055 xor 11111 1 -> 11110
-xorx056 xor 1111 1 -> 1110
-xorx057 xor 111 1 -> 110
-xorx058 xor 11 1 -> 10
-xorx059 xor 1 1 -> 0
-
-xorx060 xor 1111111111 0 -> 111111111
-xorx061 xor 111111111 0 -> 111111111
-xorx062 xor 11111111 0 -> 11111111
-xorx063 xor 1111111 0 -> 1111111
-xorx064 xor 111111 0 -> 111111
-xorx065 xor 11111 0 -> 11111
-xorx066 xor 1111 0 -> 1111
-xorx067 xor 111 0 -> 111
-xorx068 xor 11 0 -> 11
-xorx069 xor 1 0 -> 1
-
-xorx070 xor 1 1111111111 -> 111111110
-xorx071 xor 1 111111111 -> 111111110
-xorx072 xor 1 11111111 -> 11111110
-xorx073 xor 1 1111111 -> 1111110
-xorx074 xor 1 111111 -> 111110
-xorx075 xor 1 11111 -> 11110
-xorx076 xor 1 1111 -> 1110
-xorx077 xor 1 111 -> 110
-xorx078 xor 1 11 -> 10
-xorx079 xor 1 1 -> 0
-
-xorx080 xor 0 1111111111 -> 111111111
-xorx081 xor 0 111111111 -> 111111111
-xorx082 xor 0 11111111 -> 11111111
-xorx083 xor 0 1111111 -> 1111111
-xorx084 xor 0 111111 -> 111111
-xorx085 xor 0 11111 -> 11111
-xorx086 xor 0 1111 -> 1111
-xorx087 xor 0 111 -> 111
-xorx088 xor 0 11 -> 11
-xorx089 xor 0 1 -> 1
-
-xorx090 xor 011111111 111101111 -> 100010000
-xorx091 xor 101111111 111101111 -> 10010000
-xorx092 xor 110111111 111101111 -> 1010000
-xorx093 xor 111011111 111101111 -> 110000
-xorx094 xor 111101111 111101111 -> 0
-xorx095 xor 111110111 111101111 -> 11000
-xorx096 xor 111111011 111101111 -> 10100
-xorx097 xor 111111101 111101111 -> 10010
-xorx098 xor 111111110 111101111 -> 10001
-
-xorx100 xor 111101111 011111111 -> 100010000
-xorx101 xor 111101111 101111111 -> 10010000
-xorx102 xor 111101111 110111111 -> 1010000
-xorx103 xor 111101111 111011111 -> 110000
-xorx104 xor 111101111 111101111 -> 0
-xorx105 xor 111101111 111110111 -> 11000
-xorx106 xor 111101111 111111011 -> 10100
-xorx107 xor 111101111 111111101 -> 10010
-xorx108 xor 111101111 111111110 -> 10001
-
--- non-0/1 should not be accepted, nor should signs
-xorx220 xor 111111112 111111111 -> NaN Invalid_operation
-xorx221 xor 333333333 333333333 -> NaN Invalid_operation
-xorx222 xor 555555555 555555555 -> NaN Invalid_operation
-xorx223 xor 777777777 777777777 -> NaN Invalid_operation
-xorx224 xor 999999999 999999999 -> NaN Invalid_operation
-xorx225 xor 222222222 999999999 -> NaN Invalid_operation
-xorx226 xor 444444444 999999999 -> NaN Invalid_operation
-xorx227 xor 666666666 999999999 -> NaN Invalid_operation
-xorx228 xor 888888888 999999999 -> NaN Invalid_operation
-xorx229 xor 999999999 222222222 -> NaN Invalid_operation
-xorx230 xor 999999999 444444444 -> NaN Invalid_operation
-xorx231 xor 999999999 666666666 -> NaN Invalid_operation
-xorx232 xor 999999999 888888888 -> NaN Invalid_operation
--- a few randoms
-xorx240 xor 567468689 -934981942 -> NaN Invalid_operation
-xorx241 xor 567367689 934981942 -> NaN Invalid_operation
-xorx242 xor -631917772 -706014634 -> NaN Invalid_operation
-xorx243 xor -756253257 138579234 -> NaN Invalid_operation
-xorx244 xor 835590149 567435400 -> NaN Invalid_operation
--- test MSD
-xorx250 xor 200000000 100000000 -> NaN Invalid_operation
-xorx251 xor 700000000 100000000 -> NaN Invalid_operation
-xorx252 xor 800000000 100000000 -> NaN Invalid_operation
-xorx253 xor 900000000 100000000 -> NaN Invalid_operation
-xorx254 xor 200000000 000000000 -> NaN Invalid_operation
-xorx255 xor 700000000 000000000 -> NaN Invalid_operation
-xorx256 xor 800000000 000000000 -> NaN Invalid_operation
-xorx257 xor 900000000 000000000 -> NaN Invalid_operation
-xorx258 xor 100000000 200000000 -> NaN Invalid_operation
-xorx259 xor 100000000 700000000 -> NaN Invalid_operation
-xorx260 xor 100000000 800000000 -> NaN Invalid_operation
-xorx261 xor 100000000 900000000 -> NaN Invalid_operation
-xorx262 xor 000000000 200000000 -> NaN Invalid_operation
-xorx263 xor 000000000 700000000 -> NaN Invalid_operation
-xorx264 xor 000000000 800000000 -> NaN Invalid_operation
-xorx265 xor 000000000 900000000 -> NaN Invalid_operation
--- test MSD-1
-xorx270 xor 020000000 100000000 -> NaN Invalid_operation
-xorx271 xor 070100000 100000000 -> NaN Invalid_operation
-xorx272 xor 080010000 100000001 -> NaN Invalid_operation
-xorx273 xor 090001000 100000010 -> NaN Invalid_operation
-xorx274 xor 100000100 020010100 -> NaN Invalid_operation
-xorx275 xor 100000000 070001000 -> NaN Invalid_operation
-xorx276 xor 100000010 080010100 -> NaN Invalid_operation
-xorx277 xor 100000000 090000010 -> NaN Invalid_operation
--- test LSD
-xorx280 xor 001000002 100000000 -> NaN Invalid_operation
-xorx281 xor 000000007 100000000 -> NaN Invalid_operation
-xorx282 xor 000000008 100000000 -> NaN Invalid_operation
-xorx283 xor 000000009 100000000 -> NaN Invalid_operation
-xorx284 xor 100000000 000100002 -> NaN Invalid_operation
-xorx285 xor 100100000 001000007 -> NaN Invalid_operation
-xorx286 xor 100010000 010000008 -> NaN Invalid_operation
-xorx287 xor 100001000 100000009 -> NaN Invalid_operation
--- test Middie
-xorx288 xor 001020000 100000000 -> NaN Invalid_operation
-xorx289 xor 000070001 100000000 -> NaN Invalid_operation
-xorx290 xor 000080000 100010000 -> NaN Invalid_operation
-xorx291 xor 000090000 100001000 -> NaN Invalid_operation
-xorx292 xor 100000010 000020100 -> NaN Invalid_operation
-xorx293 xor 100100000 000070010 -> NaN Invalid_operation
-xorx294 xor 100010100 000080001 -> NaN Invalid_operation
-xorx295 xor 100001000 000090000 -> NaN Invalid_operation
--- signs
-xorx296 xor -100001000 -000000000 -> NaN Invalid_operation
-xorx297 xor -100001000 000010000 -> NaN Invalid_operation
-xorx298 xor 100001000 -000000000 -> NaN Invalid_operation
-xorx299 xor 100001000 000011000 -> 100010000
-
--- Nmax, Nmin, Ntiny
-xorx331 xor 2 9.99999999E+999 -> NaN Invalid_operation
-xorx332 xor 3 1E-999 -> NaN Invalid_operation
-xorx333 xor 4 1.00000000E-999 -> NaN Invalid_operation
-xorx334 xor 5 1E-1007 -> NaN Invalid_operation
-xorx335 xor 6 -1E-1007 -> NaN Invalid_operation
-xorx336 xor 7 -1.00000000E-999 -> NaN Invalid_operation
-xorx337 xor 8 -1E-999 -> NaN Invalid_operation
-xorx338 xor 9 -9.99999999E+999 -> NaN Invalid_operation
-xorx341 xor 9.99999999E+999 -18 -> NaN Invalid_operation
-xorx342 xor 1E-999 01 -> NaN Invalid_operation
-xorx343 xor 1.00000000E-999 -18 -> NaN Invalid_operation
-xorx344 xor 1E-1007 18 -> NaN Invalid_operation
-xorx345 xor -1E-1007 -10 -> NaN Invalid_operation
-xorx346 xor -1.00000000E-999 18 -> NaN Invalid_operation
-xorx347 xor -1E-999 10 -> NaN Invalid_operation
-xorx348 xor -9.99999999E+999 -18 -> NaN Invalid_operation
-
--- A few other non-integers
-xorx361 xor 1.0 1 -> NaN Invalid_operation
-xorx362 xor 1E+1 1 -> NaN Invalid_operation
-xorx363 xor 0.0 1 -> NaN Invalid_operation
-xorx364 xor 0E+1 1 -> NaN Invalid_operation
-xorx365 xor 9.9 1 -> NaN Invalid_operation
-xorx366 xor 9E+1 1 -> NaN Invalid_operation
-xorx371 xor 0 1.0 -> NaN Invalid_operation
-xorx372 xor 0 1E+1 -> NaN Invalid_operation
-xorx373 xor 0 0.0 -> NaN Invalid_operation
-xorx374 xor 0 0E+1 -> NaN Invalid_operation
-xorx375 xor 0 9.9 -> NaN Invalid_operation
-xorx376 xor 0 9E+1 -> NaN Invalid_operation
-
--- All Specials are in error
-xorx780 xor -Inf -Inf -> NaN Invalid_operation
-xorx781 xor -Inf -1000 -> NaN Invalid_operation
-xorx782 xor -Inf -1 -> NaN Invalid_operation
-xorx783 xor -Inf -0 -> NaN Invalid_operation
-xorx784 xor -Inf 0 -> NaN Invalid_operation
-xorx785 xor -Inf 1 -> NaN Invalid_operation
-xorx786 xor -Inf 1000 -> NaN Invalid_operation
-xorx787 xor -1000 -Inf -> NaN Invalid_operation
-xorx788 xor -Inf -Inf -> NaN Invalid_operation
-xorx789 xor -1 -Inf -> NaN Invalid_operation
-xorx790 xor -0 -Inf -> NaN Invalid_operation
-xorx791 xor 0 -Inf -> NaN Invalid_operation
-xorx792 xor 1 -Inf -> NaN Invalid_operation
-xorx793 xor 1000 -Inf -> NaN Invalid_operation
-xorx794 xor Inf -Inf -> NaN Invalid_operation
-
-xorx800 xor Inf -Inf -> NaN Invalid_operation
-xorx801 xor Inf -1000 -> NaN Invalid_operation
-xorx802 xor Inf -1 -> NaN Invalid_operation
-xorx803 xor Inf -0 -> NaN Invalid_operation
-xorx804 xor Inf 0 -> NaN Invalid_operation
-xorx805 xor Inf 1 -> NaN Invalid_operation
-xorx806 xor Inf 1000 -> NaN Invalid_operation
-xorx807 xor Inf Inf -> NaN Invalid_operation
-xorx808 xor -1000 Inf -> NaN Invalid_operation
-xorx809 xor -Inf Inf -> NaN Invalid_operation
-xorx810 xor -1 Inf -> NaN Invalid_operation
-xorx811 xor -0 Inf -> NaN Invalid_operation
-xorx812 xor 0 Inf -> NaN Invalid_operation
-xorx813 xor 1 Inf -> NaN Invalid_operation
-xorx814 xor 1000 Inf -> NaN Invalid_operation
-xorx815 xor Inf Inf -> NaN Invalid_operation
-
-xorx821 xor NaN -Inf -> NaN Invalid_operation
-xorx822 xor NaN -1000 -> NaN Invalid_operation
-xorx823 xor NaN -1 -> NaN Invalid_operation
-xorx824 xor NaN -0 -> NaN Invalid_operation
-xorx825 xor NaN 0 -> NaN Invalid_operation
-xorx826 xor NaN 1 -> NaN Invalid_operation
-xorx827 xor NaN 1000 -> NaN Invalid_operation
-xorx828 xor NaN Inf -> NaN Invalid_operation
-xorx829 xor NaN NaN -> NaN Invalid_operation
-xorx830 xor -Inf NaN -> NaN Invalid_operation
-xorx831 xor -1000 NaN -> NaN Invalid_operation
-xorx832 xor -1 NaN -> NaN Invalid_operation
-xorx833 xor -0 NaN -> NaN Invalid_operation
-xorx834 xor 0 NaN -> NaN Invalid_operation
-xorx835 xor 1 NaN -> NaN Invalid_operation
-xorx836 xor 1000 NaN -> NaN Invalid_operation
-xorx837 xor Inf NaN -> NaN Invalid_operation
-
-xorx841 xor sNaN -Inf -> NaN Invalid_operation
-xorx842 xor sNaN -1000 -> NaN Invalid_operation
-xorx843 xor sNaN -1 -> NaN Invalid_operation
-xorx844 xor sNaN -0 -> NaN Invalid_operation
-xorx845 xor sNaN 0 -> NaN Invalid_operation
-xorx846 xor sNaN 1 -> NaN Invalid_operation
-xorx847 xor sNaN 1000 -> NaN Invalid_operation
-xorx848 xor sNaN NaN -> NaN Invalid_operation
-xorx849 xor sNaN sNaN -> NaN Invalid_operation
-xorx850 xor NaN sNaN -> NaN Invalid_operation
-xorx851 xor -Inf sNaN -> NaN Invalid_operation
-xorx852 xor -1000 sNaN -> NaN Invalid_operation
-xorx853 xor -1 sNaN -> NaN Invalid_operation
-xorx854 xor -0 sNaN -> NaN Invalid_operation
-xorx855 xor 0 sNaN -> NaN Invalid_operation
-xorx856 xor 1 sNaN -> NaN Invalid_operation
-xorx857 xor 1000 sNaN -> NaN Invalid_operation
-xorx858 xor Inf sNaN -> NaN Invalid_operation
-xorx859 xor NaN sNaN -> NaN Invalid_operation
-
--- propagating NaNs
-xorx861 xor NaN1 -Inf -> NaN Invalid_operation
-xorx862 xor +NaN2 -1000 -> NaN Invalid_operation
-xorx863 xor NaN3 1000 -> NaN Invalid_operation
-xorx864 xor NaN4 Inf -> NaN Invalid_operation
-xorx865 xor NaN5 +NaN6 -> NaN Invalid_operation
-xorx866 xor -Inf NaN7 -> NaN Invalid_operation
-xorx867 xor -1000 NaN8 -> NaN Invalid_operation
-xorx868 xor 1000 NaN9 -> NaN Invalid_operation
-xorx869 xor Inf +NaN10 -> NaN Invalid_operation
-xorx871 xor sNaN11 -Inf -> NaN Invalid_operation
-xorx872 xor sNaN12 -1000 -> NaN Invalid_operation
-xorx873 xor sNaN13 1000 -> NaN Invalid_operation
-xorx874 xor sNaN14 NaN17 -> NaN Invalid_operation
-xorx875 xor sNaN15 sNaN18 -> NaN Invalid_operation
-xorx876 xor NaN16 sNaN19 -> NaN Invalid_operation
-xorx877 xor -Inf +sNaN20 -> NaN Invalid_operation
-xorx878 xor -1000 sNaN21 -> NaN Invalid_operation
-xorx879 xor 1000 sNaN22 -> NaN Invalid_operation
-xorx880 xor Inf sNaN23 -> NaN Invalid_operation
-xorx881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
-xorx882 xor -NaN26 NaN28 -> NaN Invalid_operation
-xorx883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
-xorx884 xor 1000 -NaN30 -> NaN Invalid_operation
-xorx885 xor 1000 -sNaN31 -> NaN Invalid_operation
+------------------------------------------------------------------------
+-- xor.decTest -- digitwise logical XOR --
+-- Copyright (c) IBM Corporation, 1981, 2008. All rights reserved. --
+------------------------------------------------------------------------
+-- Please see the document "General Decimal Arithmetic Testcases" --
+-- at http://www2.hursley.ibm.com/decimal for the description of --
+-- these testcases. --
+-- --
+-- These testcases are experimental ('beta' versions), and they --
+-- may contain errors. They are offered on an as-is basis. In --
+-- particular, achieving the same results as the tests here is not --
+-- a guarantee that an implementation complies with any Standard --
+-- or specification. The tests are not exhaustive. --
+-- --
+-- Please send comments, suggestions, and corrections to the author: --
+-- Mike Cowlishaw, IBM Fellow --
+-- IBM UK, PO Box 31, Birmingham Road, Warwick CV34 5JL, UK --
+-- mfc@uk.ibm.com --
+------------------------------------------------------------------------
+version: 2.59
+
+extended: 1
+precision: 9
+rounding: half_up
+maxExponent: 999
+minExponent: -999
+
+-- Sanity check (truth table)
+xorx001 xor 0 0 -> 0
+xorx002 xor 0 1 -> 1
+xorx003 xor 1 0 -> 1
+xorx004 xor 1 1 -> 0
+xorx005 xor 1100 1010 -> 110
+xorx006 xor 1111 10 -> 1101
+-- and at msd and msd-1
+xorx010 xor 000000000 000000000 -> 0
+xorx011 xor 000000000 100000000 -> 100000000
+xorx012 xor 100000000 000000000 -> 100000000
+xorx013 xor 100000000 100000000 -> 0
+xorx014 xor 000000000 000000000 -> 0
+xorx015 xor 000000000 010000000 -> 10000000
+xorx016 xor 010000000 000000000 -> 10000000
+xorx017 xor 010000000 010000000 -> 0
+
+-- Various lengths
+-- 123456789 123456789 123456789
+xorx021 xor 111111111 111111111 -> 0
+xorx022 xor 111111111111 111111111 -> 0
+xorx023 xor 11111111 11111111 -> 0
+xorx025 xor 1111111 1111111 -> 0
+xorx026 xor 111111 111111 -> 0
+xorx027 xor 11111 11111 -> 0
+xorx028 xor 1111 1111 -> 0
+xorx029 xor 111 111 -> 0
+xorx031 xor 11 11 -> 0
+xorx032 xor 1 1 -> 0
+xorx033 xor 111111111111 1111111111 -> 0
+xorx034 xor 11111111111 11111111111 -> 0
+xorx035 xor 1111111111 111111111111 -> 0
+xorx036 xor 111111111 1111111111111 -> 0
+
+xorx040 xor 111111111 111111111111 -> 0
+xorx041 xor 11111111 111111111111 -> 100000000
+xorx042 xor 11111111 111111111 -> 100000000
+xorx043 xor 1111111 100000010 -> 101111101
+xorx044 xor 111111 100000100 -> 100111011
+xorx045 xor 11111 100001000 -> 100010111
+xorx046 xor 1111 100010000 -> 100011111
+xorx047 xor 111 100100000 -> 100100111
+xorx048 xor 11 101000000 -> 101000011
+xorx049 xor 1 110000000 -> 110000001
+
+xorx050 xor 1111111111 1 -> 111111110
+xorx051 xor 111111111 1 -> 111111110
+xorx052 xor 11111111 1 -> 11111110
+xorx053 xor 1111111 1 -> 1111110
+xorx054 xor 111111 1 -> 111110
+xorx055 xor 11111 1 -> 11110
+xorx056 xor 1111 1 -> 1110
+xorx057 xor 111 1 -> 110
+xorx058 xor 11 1 -> 10
+xorx059 xor 1 1 -> 0
+
+xorx060 xor 1111111111 0 -> 111111111
+xorx061 xor 111111111 0 -> 111111111
+xorx062 xor 11111111 0 -> 11111111
+xorx063 xor 1111111 0 -> 1111111
+xorx064 xor 111111 0 -> 111111
+xorx065 xor 11111 0 -> 11111
+xorx066 xor 1111 0 -> 1111
+xorx067 xor 111 0 -> 111
+xorx068 xor 11 0 -> 11
+xorx069 xor 1 0 -> 1
+
+xorx070 xor 1 1111111111 -> 111111110
+xorx071 xor 1 111111111 -> 111111110
+xorx072 xor 1 11111111 -> 11111110
+xorx073 xor 1 1111111 -> 1111110
+xorx074 xor 1 111111 -> 111110
+xorx075 xor 1 11111 -> 11110
+xorx076 xor 1 1111 -> 1110
+xorx077 xor 1 111 -> 110
+xorx078 xor 1 11 -> 10
+xorx079 xor 1 1 -> 0
+
+xorx080 xor 0 1111111111 -> 111111111
+xorx081 xor 0 111111111 -> 111111111
+xorx082 xor 0 11111111 -> 11111111
+xorx083 xor 0 1111111 -> 1111111
+xorx084 xor 0 111111 -> 111111
+xorx085 xor 0 11111 -> 11111
+xorx086 xor 0 1111 -> 1111
+xorx087 xor 0 111 -> 111
+xorx088 xor 0 11 -> 11
+xorx089 xor 0 1 -> 1
+
+xorx090 xor 011111111 111101111 -> 100010000
+xorx091 xor 101111111 111101111 -> 10010000
+xorx092 xor 110111111 111101111 -> 1010000
+xorx093 xor 111011111 111101111 -> 110000
+xorx094 xor 111101111 111101111 -> 0
+xorx095 xor 111110111 111101111 -> 11000
+xorx096 xor 111111011 111101111 -> 10100
+xorx097 xor 111111101 111101111 -> 10010
+xorx098 xor 111111110 111101111 -> 10001
+
+xorx100 xor 111101111 011111111 -> 100010000
+xorx101 xor 111101111 101111111 -> 10010000
+xorx102 xor 111101111 110111111 -> 1010000
+xorx103 xor 111101111 111011111 -> 110000
+xorx104 xor 111101111 111101111 -> 0
+xorx105 xor 111101111 111110111 -> 11000
+xorx106 xor 111101111 111111011 -> 10100
+xorx107 xor 111101111 111111101 -> 10010
+xorx108 xor 111101111 111111110 -> 10001
+
+-- non-0/1 should not be accepted, nor should signs
+xorx220 xor 111111112 111111111 -> NaN Invalid_operation
+xorx221 xor 333333333 333333333 -> NaN Invalid_operation
+xorx222 xor 555555555 555555555 -> NaN Invalid_operation
+xorx223 xor 777777777 777777777 -> NaN Invalid_operation
+xorx224 xor 999999999 999999999 -> NaN Invalid_operation
+xorx225 xor 222222222 999999999 -> NaN Invalid_operation
+xorx226 xor 444444444 999999999 -> NaN Invalid_operation
+xorx227 xor 666666666 999999999 -> NaN Invalid_operation
+xorx228 xor 888888888 999999999 -> NaN Invalid_operation
+xorx229 xor 999999999 222222222 -> NaN Invalid_operation
+xorx230 xor 999999999 444444444 -> NaN Invalid_operation
+xorx231 xor 999999999 666666666 -> NaN Invalid_operation
+xorx232 xor 999999999 888888888 -> NaN Invalid_operation
+-- a few randoms
+xorx240 xor 567468689 -934981942 -> NaN Invalid_operation
+xorx241 xor 567367689 934981942 -> NaN Invalid_operation
+xorx242 xor -631917772 -706014634 -> NaN Invalid_operation
+xorx243 xor -756253257 138579234 -> NaN Invalid_operation
+xorx244 xor 835590149 567435400 -> NaN Invalid_operation
+-- test MSD
+xorx250 xor 200000000 100000000 -> NaN Invalid_operation
+xorx251 xor 700000000 100000000 -> NaN Invalid_operation
+xorx252 xor 800000000 100000000 -> NaN Invalid_operation
+xorx253 xor 900000000 100000000 -> NaN Invalid_operation
+xorx254 xor 200000000 000000000 -> NaN Invalid_operation
+xorx255 xor 700000000 000000000 -> NaN Invalid_operation
+xorx256 xor 800000000 000000000 -> NaN Invalid_operation
+xorx257 xor 900000000 000000000 -> NaN Invalid_operation
+xorx258 xor 100000000 200000000 -> NaN Invalid_operation
+xorx259 xor 100000000 700000000 -> NaN Invalid_operation
+xorx260 xor 100000000 800000000 -> NaN Invalid_operation
+xorx261 xor 100000000 900000000 -> NaN Invalid_operation
+xorx262 xor 000000000 200000000 -> NaN Invalid_operation
+xorx263 xor 000000000 700000000 -> NaN Invalid_operation
+xorx264 xor 000000000 800000000 -> NaN Invalid_operation
+xorx265 xor 000000000 900000000 -> NaN Invalid_operation
+-- test MSD-1
+xorx270 xor 020000000 100000000 -> NaN Invalid_operation
+xorx271 xor 070100000 100000000 -> NaN Invalid_operation
+xorx272 xor 080010000 100000001 -> NaN Invalid_operation
+xorx273 xor 090001000 100000010 -> NaN Invalid_operation
+xorx274 xor 100000100 020010100 -> NaN Invalid_operation
+xorx275 xor 100000000 070001000 -> NaN Invalid_operation
+xorx276 xor 100000010 080010100 -> NaN Invalid_operation
+xorx277 xor 100000000 090000010 -> NaN Invalid_operation
+-- test LSD
+xorx280 xor 001000002 100000000 -> NaN Invalid_operation
+xorx281 xor 000000007 100000000 -> NaN Invalid_operation
+xorx282 xor 000000008 100000000 -> NaN Invalid_operation
+xorx283 xor 000000009 100000000 -> NaN Invalid_operation
+xorx284 xor 100000000 000100002 -> NaN Invalid_operation
+xorx285 xor 100100000 001000007 -> NaN Invalid_operation
+xorx286 xor 100010000 010000008 -> NaN Invalid_operation
+xorx287 xor 100001000 100000009 -> NaN Invalid_operation
+-- test Middie
+xorx288 xor 001020000 100000000 -> NaN Invalid_operation
+xorx289 xor 000070001 100000000 -> NaN Invalid_operation
+xorx290 xor 000080000 100010000 -> NaN Invalid_operation
+xorx291 xor 000090000 100001000 -> NaN Invalid_operation
+xorx292 xor 100000010 000020100 -> NaN Invalid_operation
+xorx293 xor 100100000 000070010 -> NaN Invalid_operation
+xorx294 xor 100010100 000080001 -> NaN Invalid_operation
+xorx295 xor 100001000 000090000 -> NaN Invalid_operation
+-- signs
+xorx296 xor -100001000 -000000000 -> NaN Invalid_operation
+xorx297 xor -100001000 000010000 -> NaN Invalid_operation
+xorx298 xor 100001000 -000000000 -> NaN Invalid_operation
+xorx299 xor 100001000 000011000 -> 100010000
+
+-- Nmax, Nmin, Ntiny
+xorx331 xor 2 9.99999999E+999 -> NaN Invalid_operation
+xorx332 xor 3 1E-999 -> NaN Invalid_operation
+xorx333 xor 4 1.00000000E-999 -> NaN Invalid_operation
+xorx334 xor 5 1E-1007 -> NaN Invalid_operation
+xorx335 xor 6 -1E-1007 -> NaN Invalid_operation
+xorx336 xor 7 -1.00000000E-999 -> NaN Invalid_operation
+xorx337 xor 8 -1E-999 -> NaN Invalid_operation
+xorx338 xor 9 -9.99999999E+999 -> NaN Invalid_operation
+xorx341 xor 9.99999999E+999 -18 -> NaN Invalid_operation
+xorx342 xor 1E-999 01 -> NaN Invalid_operation
+xorx343 xor 1.00000000E-999 -18 -> NaN Invalid_operation
+xorx344 xor 1E-1007 18 -> NaN Invalid_operation
+xorx345 xor -1E-1007 -10 -> NaN Invalid_operation
+xorx346 xor -1.00000000E-999 18 -> NaN Invalid_operation
+xorx347 xor -1E-999 10 -> NaN Invalid_operation
+xorx348 xor -9.99999999E+999 -18 -> NaN Invalid_operation
+
+-- A few other non-integers
+xorx361 xor 1.0 1 -> NaN Invalid_operation
+xorx362 xor 1E+1 1 -> NaN Invalid_operation
+xorx363 xor 0.0 1 -> NaN Invalid_operation
+xorx364 xor 0E+1 1 -> NaN Invalid_operation
+xorx365 xor 9.9 1 -> NaN Invalid_operation
+xorx366 xor 9E+1 1 -> NaN Invalid_operation
+xorx371 xor 0 1.0 -> NaN Invalid_operation
+xorx372 xor 0 1E+1 -> NaN Invalid_operation
+xorx373 xor 0 0.0 -> NaN Invalid_operation
+xorx374 xor 0 0E+1 -> NaN Invalid_operation
+xorx375 xor 0 9.9 -> NaN Invalid_operation
+xorx376 xor 0 9E+1 -> NaN Invalid_operation
+
+-- All Specials are in error
+xorx780 xor -Inf -Inf -> NaN Invalid_operation
+xorx781 xor -Inf -1000 -> NaN Invalid_operation
+xorx782 xor -Inf -1 -> NaN Invalid_operation
+xorx783 xor -Inf -0 -> NaN Invalid_operation
+xorx784 xor -Inf 0 -> NaN Invalid_operation
+xorx785 xor -Inf 1 -> NaN Invalid_operation
+xorx786 xor -Inf 1000 -> NaN Invalid_operation
+xorx787 xor -1000 -Inf -> NaN Invalid_operation
+xorx788 xor -Inf -Inf -> NaN Invalid_operation
+xorx789 xor -1 -Inf -> NaN Invalid_operation
+xorx790 xor -0 -Inf -> NaN Invalid_operation
+xorx791 xor 0 -Inf -> NaN Invalid_operation
+xorx792 xor 1 -Inf -> NaN Invalid_operation
+xorx793 xor 1000 -Inf -> NaN Invalid_operation
+xorx794 xor Inf -Inf -> NaN Invalid_operation
+
+xorx800 xor Inf -Inf -> NaN Invalid_operation
+xorx801 xor Inf -1000 -> NaN Invalid_operation
+xorx802 xor Inf -1 -> NaN Invalid_operation
+xorx803 xor Inf -0 -> NaN Invalid_operation
+xorx804 xor Inf 0 -> NaN Invalid_operation
+xorx805 xor Inf 1 -> NaN Invalid_operation
+xorx806 xor Inf 1000 -> NaN Invalid_operation
+xorx807 xor Inf Inf -> NaN Invalid_operation
+xorx808 xor -1000 Inf -> NaN Invalid_operation
+xorx809 xor -Inf Inf -> NaN Invalid_operation
+xorx810 xor -1 Inf -> NaN Invalid_operation
+xorx811 xor -0 Inf -> NaN Invalid_operation
+xorx812 xor 0 Inf -> NaN Invalid_operation
+xorx813 xor 1 Inf -> NaN Invalid_operation
+xorx814 xor 1000 Inf -> NaN Invalid_operation
+xorx815 xor Inf Inf -> NaN Invalid_operation
+
+xorx821 xor NaN -Inf -> NaN Invalid_operation
+xorx822 xor NaN -1000 -> NaN Invalid_operation
+xorx823 xor NaN -1 -> NaN Invalid_operation
+xorx824 xor NaN -0 -> NaN Invalid_operation
+xorx825 xor NaN 0 -> NaN Invalid_operation
+xorx826 xor NaN 1 -> NaN Invalid_operation
+xorx827 xor NaN 1000 -> NaN Invalid_operation
+xorx828 xor NaN Inf -> NaN Invalid_operation
+xorx829 xor NaN NaN -> NaN Invalid_operation
+xorx830 xor -Inf NaN -> NaN Invalid_operation
+xorx831 xor -1000 NaN -> NaN Invalid_operation
+xorx832 xor -1 NaN -> NaN Invalid_operation
+xorx833 xor -0 NaN -> NaN Invalid_operation
+xorx834 xor 0 NaN -> NaN Invalid_operation
+xorx835 xor 1 NaN -> NaN Invalid_operation
+xorx836 xor 1000 NaN -> NaN Invalid_operation
+xorx837 xor Inf NaN -> NaN Invalid_operation
+
+xorx841 xor sNaN -Inf -> NaN Invalid_operation
+xorx842 xor sNaN -1000 -> NaN Invalid_operation
+xorx843 xor sNaN -1 -> NaN Invalid_operation
+xorx844 xor sNaN -0 -> NaN Invalid_operation
+xorx845 xor sNaN 0 -> NaN Invalid_operation
+xorx846 xor sNaN 1 -> NaN Invalid_operation
+xorx847 xor sNaN 1000 -> NaN Invalid_operation
+xorx848 xor sNaN NaN -> NaN Invalid_operation
+xorx849 xor sNaN sNaN -> NaN Invalid_operation
+xorx850 xor NaN sNaN -> NaN Invalid_operation
+xorx851 xor -Inf sNaN -> NaN Invalid_operation
+xorx852 xor -1000 sNaN -> NaN Invalid_operation
+xorx853 xor -1 sNaN -> NaN Invalid_operation
+xorx854 xor -0 sNaN -> NaN Invalid_operation
+xorx855 xor 0 sNaN -> NaN Invalid_operation
+xorx856 xor 1 sNaN -> NaN Invalid_operation
+xorx857 xor 1000 sNaN -> NaN Invalid_operation
+xorx858 xor Inf sNaN -> NaN Invalid_operation
+xorx859 xor NaN sNaN -> NaN Invalid_operation
+
+-- propagating NaNs
+xorx861 xor NaN1 -Inf -> NaN Invalid_operation
+xorx862 xor +NaN2 -1000 -> NaN Invalid_operation
+xorx863 xor NaN3 1000 -> NaN Invalid_operation
+xorx864 xor NaN4 Inf -> NaN Invalid_operation
+xorx865 xor NaN5 +NaN6 -> NaN Invalid_operation
+xorx866 xor -Inf NaN7 -> NaN Invalid_operation
+xorx867 xor -1000 NaN8 -> NaN Invalid_operation
+xorx868 xor 1000 NaN9 -> NaN Invalid_operation
+xorx869 xor Inf +NaN10 -> NaN Invalid_operation
+xorx871 xor sNaN11 -Inf -> NaN Invalid_operation
+xorx872 xor sNaN12 -1000 -> NaN Invalid_operation
+xorx873 xor sNaN13 1000 -> NaN Invalid_operation
+xorx874 xor sNaN14 NaN17 -> NaN Invalid_operation
+xorx875 xor sNaN15 sNaN18 -> NaN Invalid_operation
+xorx876 xor NaN16 sNaN19 -> NaN Invalid_operation
+xorx877 xor -Inf +sNaN20 -> NaN Invalid_operation
+xorx878 xor -1000 sNaN21 -> NaN Invalid_operation
+xorx879 xor 1000 sNaN22 -> NaN Invalid_operation
+xorx880 xor Inf sNaN23 -> NaN Invalid_operation
+xorx881 xor +NaN25 +sNaN24 -> NaN Invalid_operation
+xorx882 xor -NaN26 NaN28 -> NaN Invalid_operation
+xorx883 xor -sNaN27 sNaN29 -> NaN Invalid_operation
+xorx884 xor 1000 -NaN30 -> NaN Invalid_operation
+xorx885 xor 1000 -sNaN31 -> NaN Invalid_operation
diff --git a/Lib/test/doctest_aliases.py b/Lib/test/doctest_aliases.py
index e6e5ca9551..1f33f83276 100644
--- a/Lib/test/doctest_aliases.py
+++ b/Lib/test/doctest_aliases.py
@@ -10,4 +10,4 @@ class TwoNames:
'''
return 'f'
- g = f # define an alias for f
+ g = f # define an alias for f
diff --git a/Lib/test/floating_points.txt b/Lib/test/floating_points.txt
index 70d21ea714..539073d19d 100644
--- a/Lib/test/floating_points.txt
+++ b/Lib/test/floating_points.txt
@@ -1019,3 +1019,10 @@
+43723334984997307E-26
+10182419849537963E-24
-93501703572661982E-26
+
+# A value that caused a crash in debug builds for Python >= 2.7, 3.1
+# See http://bugs.python.org/issue7632
+2183167012312112312312.23538020374420446192e-370
+
+# Another value designed to test a corner case of Python's strtod code.
+0.99999999999999999999999999999999999999999e+23
diff --git a/Lib/test/fork_wait.py b/Lib/test/fork_wait.py
index 3c75de39d6..2646cbd581 100644
--- a/Lib/test/fork_wait.py
+++ b/Lib/test/fork_wait.py
@@ -1,6 +1,6 @@
"""This test case provides support for checking forking and wait behavior.
-To test different wait behavior, overrise the wait_impl method.
+To test different wait behavior, override the wait_impl method.
We want fork1() semantics -- only the forking thread survives in the
child after a fork().
@@ -12,7 +12,9 @@ While BeOS doesn't officially support fork and native threading in
the same application, the present example should work just fine. DC
"""
-import os, sys, time, thread, unittest
+import os, sys, time, unittest
+import test.test_support as test_support
+thread = test_support.import_module('thread')
LONGSLEEP = 2
SHORTSLEEP = 0.5
@@ -41,8 +43,8 @@ class ForkWait(unittest.TestCase):
break
time.sleep(2 * SHORTSLEEP)
- self.assertEquals(spid, cpid)
- self.assertEquals(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8))
+ self.assertEqual(spid, cpid)
+ self.assertEqual(status, 0, "cause = %d, exit = %d" % (status&0xff, status>>8))
def test_wait(self):
for i in range(NUM_THREADS):
@@ -52,7 +54,7 @@ class ForkWait(unittest.TestCase):
a = self.alive.keys()
a.sort()
- self.assertEquals(a, range(NUM_THREADS))
+ self.assertEqual(a, range(NUM_THREADS))
prefork_lives = self.alive.copy()
diff --git a/Lib/test/formatfloat_testcases.txt b/Lib/test/formatfloat_testcases.txt
new file mode 100644
index 0000000000..43ef040954
--- /dev/null
+++ b/Lib/test/formatfloat_testcases.txt
@@ -0,0 +1,380 @@
+-- 'f' code formatting, with explicit precision (>= 0). Output always
+-- has the given number of places after the point; zeros are added if
+-- necessary to make this true.
+
+-- zeros
+%.0f 0 -> 0
+%.1f 0 -> 0.0
+%.2f 0 -> 0.00
+%.3f 0 -> 0.000
+%.50f 0 -> 0.00000000000000000000000000000000000000000000000000
+
+-- precision 0; result should never include a .
+%.0f 1.5 -> 2
+%.0f 2.5 -> 2
+%.0f 3.5 -> 4
+%.0f 0.0 -> 0
+%.0f 0.1 -> 0
+%.0f 0.001 -> 0
+%.0f 10.0 -> 10
+%.0f 10.1 -> 10
+%.0f 10.01 -> 10
+%.0f 123.456 -> 123
+%.0f 1234.56 -> 1235
+%.0f 1e49 -> 9999999999999999464902769475481793196872414789632
+%.0f 9.9999999999999987e+49 -> 99999999999999986860582406952576489172979654066176
+%.0f 1e50 -> 100000000000000007629769841091887003294964970946560
+
+-- precision 1
+%.1f 0.0001 -> 0.0
+%.1f 0.001 -> 0.0
+%.1f 0.01 -> 0.0
+%.1f 0.04 -> 0.0
+%.1f 0.06 -> 0.1
+%.1f 0.25 -> 0.2
+%.1f 0.75 -> 0.8
+%.1f 1.4 -> 1.4
+%.1f 1.5 -> 1.5
+%.1f 10.0 -> 10.0
+%.1f 1000.03 -> 1000.0
+%.1f 1234.5678 -> 1234.6
+%.1f 1234.7499 -> 1234.7
+%.1f 1234.75 -> 1234.8
+
+-- precision 2
+%.2f 0.0001 -> 0.00
+%.2f 0.001 -> 0.00
+%.2f 0.004999 -> 0.00
+%.2f 0.005001 -> 0.01
+%.2f 0.01 -> 0.01
+%.2f 0.125 -> 0.12
+%.2f 0.375 -> 0.38
+%.2f 1234500 -> 1234500.00
+%.2f 1234560 -> 1234560.00
+%.2f 1234567 -> 1234567.00
+%.2f 1234567.8 -> 1234567.80
+%.2f 1234567.89 -> 1234567.89
+%.2f 1234567.891 -> 1234567.89
+%.2f 1234567.8912 -> 1234567.89
+
+-- alternate form always includes a decimal point. This only
+-- makes a difference when the precision is 0.
+%#.0f 0 -> 0.
+%#.1f 0 -> 0.0
+%#.0f 1.5 -> 2.
+%#.0f 2.5 -> 2.
+%#.0f 10.1 -> 10.
+%#.0f 1234.56 -> 1235.
+%#.1f 1.4 -> 1.4
+%#.2f 0.375 -> 0.38
+
+-- if precision is omitted it defaults to 6
+%f 0 -> 0.000000
+%f 1230000 -> 1230000.000000
+%f 1234567 -> 1234567.000000
+%f 123.4567 -> 123.456700
+%f 1.23456789 -> 1.234568
+%f 0.00012 -> 0.000120
+%f 0.000123 -> 0.000123
+%f 0.00012345 -> 0.000123
+%f 0.000001 -> 0.000001
+%f 0.0000005001 -> 0.000001
+%f 0.0000004999 -> 0.000000
+
+-- nans and infinities
+%f nan -> nan
+%f inf -> inf
+%f -infinity -> -inf
+%F nan -> NAN
+%F infinity -> INF
+%F -inf -> -INF
+
+-- 'e' code formatting with explicit precision (>= 0). Output should
+-- always have exactly the number of places after the point that were
+-- requested.
+
+-- zeros
+%.0e 0 -> 0e+00
+%.1e 0 -> 0.0e+00
+%.2e 0 -> 0.00e+00
+%.10e 0 -> 0.0000000000e+00
+%.50e 0 -> 0.00000000000000000000000000000000000000000000000000e+00
+
+-- precision 0. no decimal point in the output
+%.0e 0.01 -> 1e-02
+%.0e 0.1 -> 1e-01
+%.0e 1 -> 1e+00
+%.0e 10 -> 1e+01
+%.0e 100 -> 1e+02
+%.0e 0.012 -> 1e-02
+%.0e 0.12 -> 1e-01
+%.0e 1.2 -> 1e+00
+%.0e 12 -> 1e+01
+%.0e 120 -> 1e+02
+%.0e 123.456 -> 1e+02
+%.0e 0.000123456 -> 1e-04
+%.0e 123456000 -> 1e+08
+%.0e 0.5 -> 5e-01
+%.0e 1.4 -> 1e+00
+%.0e 1.5 -> 2e+00
+%.0e 1.6 -> 2e+00
+%.0e 2.4999999 -> 2e+00
+%.0e 2.5 -> 2e+00
+%.0e 2.5000001 -> 3e+00
+%.0e 3.499999999999 -> 3e+00
+%.0e 3.5 -> 4e+00
+%.0e 4.5 -> 4e+00
+%.0e 5.5 -> 6e+00
+%.0e 6.5 -> 6e+00
+%.0e 7.5 -> 8e+00
+%.0e 8.5 -> 8e+00
+%.0e 9.4999 -> 9e+00
+%.0e 9.5 -> 1e+01
+%.0e 10.5 -> 1e+01
+%.0e 14.999 -> 1e+01
+%.0e 15 -> 2e+01
+
+-- precision 1
+%.1e 0.0001 -> 1.0e-04
+%.1e 0.001 -> 1.0e-03
+%.1e 0.01 -> 1.0e-02
+%.1e 0.1 -> 1.0e-01
+%.1e 1 -> 1.0e+00
+%.1e 10 -> 1.0e+01
+%.1e 100 -> 1.0e+02
+%.1e 120 -> 1.2e+02
+%.1e 123 -> 1.2e+02
+%.1e 123.4 -> 1.2e+02
+
+-- precision 2
+%.2e 0.00013 -> 1.30e-04
+%.2e 0.000135 -> 1.35e-04
+%.2e 0.0001357 -> 1.36e-04
+%.2e 0.0001 -> 1.00e-04
+%.2e 0.001 -> 1.00e-03
+%.2e 0.01 -> 1.00e-02
+%.2e 0.1 -> 1.00e-01
+%.2e 1 -> 1.00e+00
+%.2e 10 -> 1.00e+01
+%.2e 100 -> 1.00e+02
+%.2e 1000 -> 1.00e+03
+%.2e 1500 -> 1.50e+03
+%.2e 1590 -> 1.59e+03
+%.2e 1598 -> 1.60e+03
+%.2e 1598.7 -> 1.60e+03
+%.2e 1598.76 -> 1.60e+03
+%.2e 9999 -> 1.00e+04
+
+-- omitted precision defaults to 6
+%e 0 -> 0.000000e+00
+%e 165 -> 1.650000e+02
+%e 1234567 -> 1.234567e+06
+%e 12345678 -> 1.234568e+07
+%e 1.1 -> 1.100000e+00
+
+-- alternate form always contains a decimal point. This only makes
+-- a difference when precision is 0.
+
+%#.0e 0.01 -> 1.e-02
+%#.0e 0.1 -> 1.e-01
+%#.0e 1 -> 1.e+00
+%#.0e 10 -> 1.e+01
+%#.0e 100 -> 1.e+02
+%#.0e 0.012 -> 1.e-02
+%#.0e 0.12 -> 1.e-01
+%#.0e 1.2 -> 1.e+00
+%#.0e 12 -> 1.e+01
+%#.0e 120 -> 1.e+02
+%#.0e 123.456 -> 1.e+02
+%#.0e 0.000123456 -> 1.e-04
+%#.0e 123456000 -> 1.e+08
+%#.0e 0.5 -> 5.e-01
+%#.0e 1.4 -> 1.e+00
+%#.0e 1.5 -> 2.e+00
+%#.0e 1.6 -> 2.e+00
+%#.0e 2.4999999 -> 2.e+00
+%#.0e 2.5 -> 2.e+00
+%#.0e 2.5000001 -> 3.e+00
+%#.0e 3.499999999999 -> 3.e+00
+%#.0e 3.5 -> 4.e+00
+%#.0e 4.5 -> 4.e+00
+%#.0e 5.5 -> 6.e+00
+%#.0e 6.5 -> 6.e+00
+%#.0e 7.5 -> 8.e+00
+%#.0e 8.5 -> 8.e+00
+%#.0e 9.4999 -> 9.e+00
+%#.0e 9.5 -> 1.e+01
+%#.0e 10.5 -> 1.e+01
+%#.0e 14.999 -> 1.e+01
+%#.0e 15 -> 2.e+01
+%#.1e 123.4 -> 1.2e+02
+%#.2e 0.0001357 -> 1.36e-04
+
+-- nans and infinities
+%e nan -> nan
+%e inf -> inf
+%e -infinity -> -inf
+%E nan -> NAN
+%E infinity -> INF
+%E -inf -> -INF
+
+-- 'g' code formatting.
+
+-- zeros
+%.0g 0 -> 0
+%.1g 0 -> 0
+%.2g 0 -> 0
+%.3g 0 -> 0
+%.4g 0 -> 0
+%.10g 0 -> 0
+%.50g 0 -> 0
+%.100g 0 -> 0
+
+-- precision 0 doesn't make a lot of sense for the 'g' code (what does
+-- it mean to have no significant digits?); in practice, it's interpreted
+-- as identical to precision 1
+%.0g 1000 -> 1e+03
+%.0g 100 -> 1e+02
+%.0g 10 -> 1e+01
+%.0g 1 -> 1
+%.0g 0.1 -> 0.1
+%.0g 0.01 -> 0.01
+%.0g 1e-3 -> 0.001
+%.0g 1e-4 -> 0.0001
+%.0g 1e-5 -> 1e-05
+%.0g 1e-6 -> 1e-06
+%.0g 12 -> 1e+01
+%.0g 120 -> 1e+02
+%.0g 1.2 -> 1
+%.0g 0.12 -> 0.1
+%.0g 0.012 -> 0.01
+%.0g 0.0012 -> 0.001
+%.0g 0.00012 -> 0.0001
+%.0g 0.000012 -> 1e-05
+%.0g 0.0000012 -> 1e-06
+
+-- precision 1 identical to precision 0
+%.1g 1000 -> 1e+03
+%.1g 100 -> 1e+02
+%.1g 10 -> 1e+01
+%.1g 1 -> 1
+%.1g 0.1 -> 0.1
+%.1g 0.01 -> 0.01
+%.1g 1e-3 -> 0.001
+%.1g 1e-4 -> 0.0001
+%.1g 1e-5 -> 1e-05
+%.1g 1e-6 -> 1e-06
+%.1g 12 -> 1e+01
+%.1g 120 -> 1e+02
+%.1g 1.2 -> 1
+%.1g 0.12 -> 0.1
+%.1g 0.012 -> 0.01
+%.1g 0.0012 -> 0.001
+%.1g 0.00012 -> 0.0001
+%.1g 0.000012 -> 1e-05
+%.1g 0.0000012 -> 1e-06
+
+-- precision 2
+%.2g 1000 -> 1e+03
+%.2g 100 -> 1e+02
+%.2g 10 -> 10
+%.2g 1 -> 1
+%.2g 0.1 -> 0.1
+%.2g 0.01 -> 0.01
+%.2g 0.001 -> 0.001
+%.2g 1e-4 -> 0.0001
+%.2g 1e-5 -> 1e-05
+%.2g 1e-6 -> 1e-06
+%.2g 1234 -> 1.2e+03
+%.2g 123 -> 1.2e+02
+%.2g 12.3 -> 12
+%.2g 1.23 -> 1.2
+%.2g 0.123 -> 0.12
+%.2g 0.0123 -> 0.012
+%.2g 0.00123 -> 0.0012
+%.2g 0.000123 -> 0.00012
+%.2g 0.0000123 -> 1.2e-05
+
+-- alternate g formatting: always include decimal point and
+-- exactly <precision> significant digits.
+%#.0g 0 -> 0.
+%#.1g 0 -> 0.
+%#.2g 0 -> 0.0
+%#.3g 0 -> 0.00
+%#.4g 0 -> 0.000
+
+%#.0g 0.2 -> 0.2
+%#.1g 0.2 -> 0.2
+%#.2g 0.2 -> 0.20
+%#.3g 0.2 -> 0.200
+%#.4g 0.2 -> 0.2000
+%#.10g 0.2 -> 0.2000000000
+
+%#.0g 2 -> 2.
+%#.1g 2 -> 2.
+%#.2g 2 -> 2.0
+%#.3g 2 -> 2.00
+%#.4g 2 -> 2.000
+
+%#.0g 20 -> 2.e+01
+%#.1g 20 -> 2.e+01
+%#.2g 20 -> 20.
+%#.3g 20 -> 20.0
+%#.4g 20 -> 20.00
+
+%#.0g 234.56 -> 2.e+02
+%#.1g 234.56 -> 2.e+02
+%#.2g 234.56 -> 2.3e+02
+%#.3g 234.56 -> 235.
+%#.4g 234.56 -> 234.6
+%#.5g 234.56 -> 234.56
+%#.6g 234.56 -> 234.560
+
+-- nans and infinities
+%g nan -> nan
+%g inf -> inf
+%g -infinity -> -inf
+%G nan -> NAN
+%G infinity -> INF
+%G -inf -> -INF
+
+-- for repr formatting see the separate test_short_repr test in
+-- test_float.py. Not all platforms use short repr for floats.
+
+-- str formatting. Result always includes decimal point and at
+-- least one digit after the point, or an exponent.
+%s 0 -> 0.0
+%s 1 -> 1.0
+
+%s 0.01 -> 0.01
+%s 0.02 -> 0.02
+%s 0.03 -> 0.03
+%s 0.04 -> 0.04
+%s 0.05 -> 0.05
+
+-- str truncates to 12 significant digits
+%s 1.234123412341 -> 1.23412341234
+%s 1.23412341234 -> 1.23412341234
+%s 1.2341234123 -> 1.2341234123
+
+-- values >= 1e11 get an exponent
+%s 10 -> 10.0
+%s 100 -> 100.0
+%s 1e10 -> 10000000000.0
+%s 9.999e10 -> 99990000000.0
+%s 99999999999 -> 99999999999.0
+%s 99999999999.9 -> 99999999999.9
+%s 99999999999.99 -> 1e+11
+%s 1e11 -> 1e+11
+%s 1e12 -> 1e+12
+
+-- as do values < 1e-4
+%s 1e-3 -> 0.001
+%s 1.001e-4 -> 0.0001001
+%s 1.000000000001e-4 -> 0.0001
+%s 1.00000000001e-4 -> 0.000100000000001
+%s 1.0000000001e-4 -> 0.00010000000001
+%s 1e-4 -> 0.0001
+%s 0.999999999999e-4 -> 9.99999999999e-05
+%s 0.999e-4 -> 9.99e-05
+%s 1e-5 -> 1e-05
diff --git a/Lib/test/gdb_sample.py b/Lib/test/gdb_sample.py
new file mode 100644
index 0000000000..a732b25b4d
--- /dev/null
+++ b/Lib/test/gdb_sample.py
@@ -0,0 +1,12 @@
+# Sample script for use by test_gdb.py
+
+def foo(a, b, c):
+ bar(a, b, c)
+
+def bar(a, b, c):
+ baz(a, b, c)
+
+def baz(*args):
+ print(42)
+
+foo(1, 2, 3)
diff --git a/Lib/test/ieee754.txt b/Lib/test/ieee754.txt
index 5a41c8fe50..89bb0c50a3 100644
--- a/Lib/test/ieee754.txt
+++ b/Lib/test/ieee754.txt
@@ -72,7 +72,7 @@ False
>>> NAN >= 0
False
-All operations involving a NaN return a NaN except for the power of *0* and *1*.
+All operations involving a NaN return a NaN except for nan**0 and 1**nan.
>>> 1 + NAN
nan
>>> 1 * NAN
@@ -81,8 +81,10 @@ nan
nan
>>> 1 ** NAN
1.0
+>>> NAN ** 0
+1.0
>>> 0 ** NAN
-0.0
+nan
>>> (1.0 + FI.epsilon) * NAN
nan
diff --git a/Lib/test/leakers/test_dictself.py b/Lib/test/leakers/test_dictself.py
new file mode 100644
index 0000000000..99bd37d8cc
--- /dev/null
+++ b/Lib/test/leakers/test_dictself.py
@@ -0,0 +1,12 @@
+'''Test case for "self.__dict__ = self" circular reference bug (#1469629)'''
+
+import gc
+
+class LeakyDict(dict):
+ pass
+
+def leak():
+ ld = LeakyDict()
+ ld.__dict__ = ld
+ del ld
+ gc.collect(); gc.collect(); gc.collect()
diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py
index e4254ef499..b8d6d6bda6 100644
--- a/Lib/test/list_tests.py
+++ b/Lib/test/list_tests.py
@@ -330,7 +330,7 @@ class CommonTest(seq_tests.CommonTest):
self.assertRaises(BadExc, d.remove, 'c')
for x, y in zip(d, e):
# verify that original order and values are retained.
- self.assert_(x is y)
+ self.assertIs(x, y)
def test_count(self):
a = self.type2test([0, 1, 2])*3
@@ -419,7 +419,7 @@ class CommonTest(seq_tests.CommonTest):
self.assertRaises(TypeError, u.reverse, 42)
def test_sort(self):
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
("the cmp argument is not supported", DeprecationWarning)):
self._test_sort()
@@ -466,7 +466,7 @@ class CommonTest(seq_tests.CommonTest):
u = self.type2test([0, 1])
u2 = u
u += [2, 3]
- self.assert_(u is u2)
+ self.assertIs(u, u2)
u = self.type2test("spam")
u += "eggs"
diff --git a/Lib/test/lock_tests.py b/Lib/test/lock_tests.py
index 855ad46ba0..966f9bd7ca 100644
--- a/Lib/test/lock_tests.py
+++ b/Lib/test/lock_tests.py
@@ -257,10 +257,8 @@ class EventTests(BaseTestCase):
results1 = []
results2 = []
def f():
- evt.wait()
- results1.append(evt.is_set())
- evt.wait()
- results2.append(evt.is_set())
+ results1.append(evt.wait())
+ results2.append(evt.wait())
b = Bunch(f, N)
b.wait_for_started()
_wait()
@@ -284,11 +282,9 @@ class EventTests(BaseTestCase):
results2 = []
N = 5
def f():
- evt.wait(0.0)
- results1.append(evt.is_set())
+ results1.append(evt.wait(0.0))
t1 = time.time()
- evt.wait(0.2)
- r = evt.is_set()
+ r = evt.wait(0.2)
t2 = time.time()
results2.append((r, t2 - t1))
Bunch(f, N).wait_for_finished()
diff --git a/Lib/test/mapping_tests.py b/Lib/test/mapping_tests.py
index 6c4e6ec4ff..49f6379f82 100644
--- a/Lib/test/mapping_tests.py
+++ b/Lib/test/mapping_tests.py
@@ -51,17 +51,17 @@ class BasicTestMappingProtocol(unittest.TestCase):
for key, value in self.reference.items():
self.assertEqual(d[key], value)
knownkey = self.other.keys()[0]
- self.failUnlessRaises(KeyError, lambda:d[knownkey])
+ self.assertRaises(KeyError, lambda:d[knownkey])
#len
self.assertEqual(len(p), 0)
self.assertEqual(len(d), len(self.reference))
#in
for k in self.reference:
- self.assertTrue(k in d)
+ self.assertIn(k, d)
for k in self.other:
- self.assertTrue(k not in d)
+ self.assertNotIn(k, d)
#has_key
- with test_support._check_py3k_warnings(quiet=True):
+ with test_support.check_py3k_warnings(quiet=True):
for k in self.reference:
self.assertTrue(d.has_key(k))
for k in self.other:
@@ -76,10 +76,10 @@ class BasicTestMappingProtocol(unittest.TestCase):
if not d: self.fail("Full mapping must compare to True")
# keys(), items(), iterkeys() ...
def check_iterandlist(iter, lst, ref):
- self.assert_(hasattr(iter, 'next'))
- self.assert_(hasattr(iter, '__iter__'))
+ self.assertTrue(hasattr(iter, 'next'))
+ self.assertTrue(hasattr(iter, '__iter__'))
x = list(iter)
- self.assert_(set(x)==set(lst)==set(ref))
+ self.assertTrue(set(x)==set(lst)==set(ref))
check_iterandlist(d.iterkeys(), d.keys(), self.reference.keys())
check_iterandlist(iter(d), d.keys(), self.reference.keys())
check_iterandlist(d.itervalues(), d.values(), self.reference.values())
@@ -89,7 +89,7 @@ class BasicTestMappingProtocol(unittest.TestCase):
knownkey, knownvalue = self.other.iteritems().next()
self.assertEqual(d.get(key, knownvalue), value)
self.assertEqual(d.get(knownkey, knownvalue), knownvalue)
- self.failIf(knownkey in d)
+ self.assertNotIn(knownkey, d)
def test_write(self):
# Test for write operations on mapping
@@ -100,7 +100,7 @@ class BasicTestMappingProtocol(unittest.TestCase):
self.assertEqual(p[key], value)
for key in self.reference.keys():
del p[key]
- self.failUnlessRaises(KeyError, lambda:p[key])
+ self.assertRaises(KeyError, lambda:p[key])
p = self._empty_mapping()
#update
p.update(self.reference)
@@ -119,16 +119,16 @@ class BasicTestMappingProtocol(unittest.TestCase):
self.assertEqual(d[knownkey], knownvalue)
#pop
self.assertEqual(d.pop(knownkey), knownvalue)
- self.failIf(knownkey in d)
+ self.assertNotIn(knownkey, d)
self.assertRaises(KeyError, d.pop, knownkey)
default = 909
d[knownkey] = knownvalue
self.assertEqual(d.pop(knownkey, default), knownvalue)
- self.failIf(knownkey in d)
+ self.assertNotIn(knownkey, d)
self.assertEqual(d.pop(knownkey, default), default)
#popitem
key, value = d.popitem()
- self.failIf(key in d)
+ self.assertNotIn(key, d)
self.assertEqual(value, self.reference[key])
p=self._empty_mapping()
self.assertRaises(KeyError, p.popitem)
@@ -137,17 +137,17 @@ class BasicTestMappingProtocol(unittest.TestCase):
self.assertEqual(self._empty_mapping(), self._empty_mapping())
def test_bool(self):
- self.assert_(not self._empty_mapping())
- self.assert_(self.reference)
- self.assert_(bool(self._empty_mapping()) is False)
- self.assert_(bool(self.reference) is True)
+ self.assertTrue(not self._empty_mapping())
+ self.assertTrue(self.reference)
+ self.assertTrue(bool(self._empty_mapping()) is False)
+ self.assertTrue(bool(self.reference) is True)
def test_keys(self):
d = self._empty_mapping()
self.assertEqual(d.keys(), [])
d = self.reference
- self.assert_(self.inmapping.keys()[0] in d.keys())
- self.assert_(self.other.keys()[0] not in d.keys())
+ self.assertIn(self.inmapping.keys()[0], d.keys())
+ self.assertNotIn(self.other.keys()[0], d.keys())
self.assertRaises(TypeError, d.keys, None)
def test_values(self):
@@ -273,10 +273,10 @@ class BasicTestMappingProtocol(unittest.TestCase):
def test_get(self):
d = self._empty_mapping()
- self.assert_(d.get(self.other.keys()[0]) is None)
+ self.assertTrue(d.get(self.other.keys()[0]) is None)
self.assertEqual(d.get(self.other.keys()[0], 3), 3)
d = self.reference
- self.assert_(d.get(self.other.keys()[0]) is None)
+ self.assertTrue(d.get(self.other.keys()[0]) is None)
self.assertEqual(d.get(self.other.keys()[0], 3), 3)
self.assertEqual(d.get(self.inmapping.keys()[0]), self.inmapping.values()[0])
self.assertEqual(d.get(self.inmapping.keys()[0], 3), self.inmapping.values()[0])
@@ -307,15 +307,15 @@ class BasicTestMappingProtocol(unittest.TestCase):
class TestMappingProtocol(BasicTestMappingProtocol):
def test_constructor(self):
BasicTestMappingProtocol.test_constructor(self)
- self.assert_(self._empty_mapping() is not self._empty_mapping())
+ self.assertTrue(self._empty_mapping() is not self._empty_mapping())
self.assertEqual(self.type2test(x=1, y=2), {"x": 1, "y": 2})
def test_bool(self):
BasicTestMappingProtocol.test_bool(self)
- self.assert_(not self._empty_mapping())
- self.assert_(self._full_mapping({"x": "y"}))
- self.assert_(bool(self._empty_mapping()) is False)
- self.assert_(bool(self._full_mapping({"x": "y"})) is True)
+ self.assertTrue(not self._empty_mapping())
+ self.assertTrue(self._full_mapping({"x": "y"}))
+ self.assertTrue(bool(self._empty_mapping()) is False)
+ self.assertTrue(bool(self._full_mapping({"x": "y"})) is True)
def test_keys(self):
BasicTestMappingProtocol.test_keys(self)
@@ -323,9 +323,9 @@ class TestMappingProtocol(BasicTestMappingProtocol):
self.assertEqual(d.keys(), [])
d = self._full_mapping({'a': 1, 'b': 2})
k = d.keys()
- self.assert_('a' in k)
- self.assert_('b' in k)
- self.assert_('c' not in k)
+ self.assertIn('a', k)
+ self.assertIn('b', k)
+ self.assertNotIn('c', k)
def test_values(self):
BasicTestMappingProtocol.test_values(self)
@@ -340,7 +340,7 @@ class TestMappingProtocol(BasicTestMappingProtocol):
def test_has_key(self):
d = self._empty_mapping()
- self.assert_(not d.has_key('a'))
+ self.assertTrue(not d.has_key('a'))
d = self._full_mapping({'a': 1, 'b': 2})
k = d.keys()
k.sort()
@@ -350,12 +350,13 @@ class TestMappingProtocol(BasicTestMappingProtocol):
def test_contains(self):
d = self._empty_mapping()
- self.assert_(not ('a' in d))
- self.assert_('a' not in d)
+ self.assertNotIn('a', d)
+ self.assertTrue(not ('a' in d))
+ self.assertTrue('a' not in d)
d = self._full_mapping({'a': 1, 'b': 2})
- self.assert_('a' in d)
- self.assert_('b' in d)
- self.assert_('c' not in d)
+ self.assertIn('a', d)
+ self.assertIn('b', d)
+ self.assertNotIn('c', d)
self.assertRaises(TypeError, d.__contains__)
@@ -434,7 +435,7 @@ class TestMappingProtocol(BasicTestMappingProtocol):
def test_fromkeys(self):
self.assertEqual(self.type2test.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
d = self._empty_mapping()
- self.assert_(not(d.fromkeys('abc') is d))
+ self.assertTrue(not(d.fromkeys('abc') is d))
self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
self.assertEqual(d.fromkeys([]), {})
@@ -445,17 +446,17 @@ class TestMappingProtocol(BasicTestMappingProtocol):
class dictlike(self.type2test): pass
self.assertEqual(dictlike.fromkeys('a'), {'a':None})
self.assertEqual(dictlike().fromkeys('a'), {'a':None})
- self.assert_(dictlike.fromkeys('a').__class__ is dictlike)
- self.assert_(dictlike().fromkeys('a').__class__ is dictlike)
+ self.assertTrue(dictlike.fromkeys('a').__class__ is dictlike)
+ self.assertTrue(dictlike().fromkeys('a').__class__ is dictlike)
# FIXME: the following won't work with UserDict, because it's an old style class
- # self.assert_(type(dictlike.fromkeys('a')) is dictlike)
+ # self.assertTrue(type(dictlike.fromkeys('a')) is dictlike)
class mydict(self.type2test):
def __new__(cls):
return UserDict.UserDict()
ud = mydict.fromkeys('ab')
self.assertEqual(ud, {'a':None, 'b':None})
# FIXME: the following won't work with UserDict, because it's an old style class
- # self.assert_(isinstance(ud, UserDict.UserDict))
+ # self.assertIsInstance(ud, UserDict.UserDict)
self.assertRaises(TypeError, dict.fromkeys)
class Exc(Exception): pass
@@ -485,16 +486,16 @@ class TestMappingProtocol(BasicTestMappingProtocol):
self.assertEqual(d.copy(), {1:1, 2:2, 3:3})
d = self._empty_mapping()
self.assertEqual(d.copy(), d)
- self.assert_(isinstance(d.copy(), d.__class__))
+ self.assertIsInstance(d.copy(), d.__class__)
self.assertRaises(TypeError, d.copy, None)
def test_get(self):
BasicTestMappingProtocol.test_get(self)
d = self._empty_mapping()
- self.assert_(d.get('c') is None)
+ self.assertTrue(d.get('c') is None)
self.assertEqual(d.get('c', 3), 3)
d = self._full_mapping({'a' : 1, 'b' : 2})
- self.assert_(d.get('c') is None)
+ self.assertTrue(d.get('c') is None)
self.assertEqual(d.get('c', 3), 3)
self.assertEqual(d.get('a'), 1)
self.assertEqual(d.get('a', 3), 1)
@@ -502,9 +503,9 @@ class TestMappingProtocol(BasicTestMappingProtocol):
def test_setdefault(self):
BasicTestMappingProtocol.test_setdefault(self)
d = self._empty_mapping()
- self.assert_(d.setdefault('key0') is None)
+ self.assertTrue(d.setdefault('key0') is None)
d.setdefault('key0', [])
- self.assert_(d.setdefault('key0') is None)
+ self.assertTrue(d.setdefault('key0') is None)
d.setdefault('key', []).append(3)
self.assertEqual(d['key'][0], 3)
d.setdefault('key', []).append(4)
@@ -530,9 +531,9 @@ class TestMappingProtocol(BasicTestMappingProtocol):
self.assertEqual(va, int(ka))
kb, vb = tb = b.popitem()
self.assertEqual(vb, int(kb))
- self.assert_(not(copymode < 0 and ta != tb))
- self.assert_(not a)
- self.assert_(not b)
+ self.assertTrue(not(copymode < 0 and ta != tb))
+ self.assertTrue(not a)
+ self.assertTrue(not b)
def test_pop(self):
BasicTestMappingProtocol.test_pop(self)
@@ -590,7 +591,7 @@ class TestHashMappingProtocol(TestMappingProtocol):
return UserDict.UserDict()
ud = mydict.fromkeys('ab')
self.assertEqual(ud, {'a':None, 'b':None})
- self.assert_(isinstance(ud, UserDict.UserDict))
+ self.assertIsInstance(ud, UserDict.UserDict)
def test_pop(self):
TestMappingProtocol.test_pop(self)
@@ -641,8 +642,8 @@ class TestHashMappingProtocol(TestMappingProtocol):
self.assertRaises(Exc, repr, d)
def test_le(self):
- self.assert_(not (self._empty_mapping() < self._empty_mapping()))
- self.assert_(not (self._full_mapping({1: 2}) < self._full_mapping({1L: 2L})))
+ self.assertTrue(not (self._empty_mapping() < self._empty_mapping()))
+ self.assertTrue(not (self._full_mapping({1: 2}) < self._full_mapping({1L: 2L})))
class Exc(Exception): pass
diff --git a/Lib/test/math_testcases.txt b/Lib/test/math_testcases.txt
new file mode 100644
index 0000000000..be1a49f0d3
--- /dev/null
+++ b/Lib/test/math_testcases.txt
@@ -0,0 +1,447 @@
+-- Testcases for functions in math.
+--
+-- Each line takes the form:
+--
+-- <testid> <function> <input_value> -> <output_value> <flags>
+--
+-- where:
+--
+-- <testid> is a short name identifying the test,
+--
+-- <function> is the function to be tested (exp, cos, asinh, ...),
+--
+-- <input_value> is a string representing a floating-point value
+--
+-- <output_value> is the expected (ideal) output value, again
+-- represented as a string.
+--
+-- <flags> is a list of the floating-point flags required by C99
+--
+-- The possible flags are:
+--
+-- divide-by-zero : raised when a finite input gives a
+-- mathematically infinite result.
+--
+-- overflow : raised when a finite input gives a finite result that
+-- is too large to fit in the usual range of an IEEE 754 double.
+--
+-- invalid : raised for invalid inputs (e.g., sqrt(-1))
+--
+-- ignore-sign : indicates that the sign of the result is
+-- unspecified; e.g., if the result is given as inf,
+-- then both -inf and inf should be accepted as correct.
+--
+-- Flags may appear in any order.
+--
+-- Lines beginning with '--' (like this one) start a comment, and are
+-- ignored. Blank lines, or lines containing only whitespace, are also
+-- ignored.
+
+-- Many of the values below were computed with the help of
+-- version 2.4 of the MPFR library for multiple-precision
+-- floating-point computations with correct rounding. All output
+-- values in this file are (modulo yet-to-be-discovered bugs)
+-- correctly rounded, provided that each input and output decimal
+-- floating-point value below is interpreted as a representation of
+-- the corresponding nearest IEEE 754 double-precision value. See the
+-- MPFR homepage at http://www.mpfr.org for more information about the
+-- MPFR project.
+
+
+-------------------------
+-- erf: error function --
+-------------------------
+
+erf0000 erf 0.0 -> 0.0
+erf0001 erf -0.0 -> -0.0
+erf0002 erf inf -> 1.0
+erf0003 erf -inf -> -1.0
+erf0004 erf nan -> nan
+
+-- tiny values
+erf0010 erf 1e-308 -> 1.1283791670955125e-308
+erf0011 erf 5e-324 -> 4.9406564584124654e-324
+erf0012 erf 1e-10 -> 1.1283791670955126e-10
+
+-- small integers
+erf0020 erf 1 -> 0.84270079294971489
+erf0021 erf 2 -> 0.99532226501895271
+erf0022 erf 3 -> 0.99997790950300136
+erf0023 erf 4 -> 0.99999998458274209
+erf0024 erf 5 -> 0.99999999999846256
+erf0025 erf 6 -> 1.0
+
+erf0030 erf -1 -> -0.84270079294971489
+erf0031 erf -2 -> -0.99532226501895271
+erf0032 erf -3 -> -0.99997790950300136
+erf0033 erf -4 -> -0.99999998458274209
+erf0034 erf -5 -> -0.99999999999846256
+erf0035 erf -6 -> -1.0
+
+-- huge values should all go to +/-1, depending on sign
+erf0040 erf -40 -> -1.0
+erf0041 erf 1e16 -> 1.0
+erf0042 erf -1e150 -> -1.0
+erf0043 erf 1.7e308 -> 1.0
+
+-- Issue 8986: inputs x with exp(-x*x) near the underflow threshold
+-- incorrectly signalled overflow on some platforms.
+erf0100 erf 26.2 -> 1.0
+erf0101 erf 26.4 -> 1.0
+erf0102 erf 26.6 -> 1.0
+erf0103 erf 26.8 -> 1.0
+erf0104 erf 27.0 -> 1.0
+erf0105 erf 27.2 -> 1.0
+erf0106 erf 27.4 -> 1.0
+erf0107 erf 27.6 -> 1.0
+
+erf0110 erf -26.2 -> -1.0
+erf0111 erf -26.4 -> -1.0
+erf0112 erf -26.6 -> -1.0
+erf0113 erf -26.8 -> -1.0
+erf0114 erf -27.0 -> -1.0
+erf0115 erf -27.2 -> -1.0
+erf0116 erf -27.4 -> -1.0
+erf0117 erf -27.6 -> -1.0
+
+----------------------------------------
+-- erfc: complementary error function --
+----------------------------------------
+
+erfc0000 erfc 0.0 -> 1.0
+erfc0001 erfc -0.0 -> 1.0
+erfc0002 erfc inf -> 0.0
+erfc0003 erfc -inf -> 2.0
+erfc0004 erfc nan -> nan
+
+-- tiny values
+erfc0010 erfc 1e-308 -> 1.0
+erfc0011 erfc 5e-324 -> 1.0
+erfc0012 erfc 1e-10 -> 0.99999999988716204
+
+-- small integers
+erfc0020 erfc 1 -> 0.15729920705028513
+erfc0021 erfc 2 -> 0.0046777349810472662
+erfc0022 erfc 3 -> 2.2090496998585441e-05
+erfc0023 erfc 4 -> 1.541725790028002e-08
+erfc0024 erfc 5 -> 1.5374597944280349e-12
+erfc0025 erfc 6 -> 2.1519736712498913e-17
+
+erfc0030 erfc -1 -> 1.8427007929497148
+erfc0031 erfc -2 -> 1.9953222650189528
+erfc0032 erfc -3 -> 1.9999779095030015
+erfc0033 erfc -4 -> 1.9999999845827421
+erfc0034 erfc -5 -> 1.9999999999984626
+erfc0035 erfc -6 -> 2.0
+
+-- as x -> infinity, erfc(x) behaves like exp(-x*x)/x/sqrt(pi)
+erfc0040 erfc 20 -> 5.3958656116079012e-176
+erfc0041 erfc 25 -> 8.3001725711965228e-274
+erfc0042 erfc 27 -> 5.2370464393526292e-319
+erfc0043 erfc 28 -> 0.0
+
+-- huge values
+erfc0050 erfc -40 -> 2.0
+erfc0051 erfc 1e16 -> 0.0
+erfc0052 erfc -1e150 -> 2.0
+erfc0053 erfc 1.7e308 -> 0.0
+
+-- Issue 8986: inputs x with exp(-x*x) near the underflow threshold
+-- incorrectly signalled overflow on some platforms.
+erfc0100 erfc 26.2 -> 1.6432507924389461e-300
+erfc0101 erfc 26.4 -> 4.4017768588035426e-305
+erfc0102 erfc 26.6 -> 1.0885125885442269e-309
+erfc0103 erfc 26.8 -> 2.4849621571966629e-314
+erfc0104 erfc 27.0 -> 5.2370464393526292e-319
+erfc0105 erfc 27.2 -> 9.8813129168249309e-324
+erfc0106 erfc 27.4 -> 0.0
+erfc0107 erfc 27.6 -> 0.0
+
+erfc0110 erfc -26.2 -> 2.0
+erfc0111 erfc -26.4 -> 2.0
+erfc0112 erfc -26.6 -> 2.0
+erfc0113 erfc -26.8 -> 2.0
+erfc0114 erfc -27.0 -> 2.0
+erfc0115 erfc -27.2 -> 2.0
+erfc0116 erfc -27.4 -> 2.0
+erfc0117 erfc -27.6 -> 2.0
+
+---------------------------------------------------------
+-- lgamma: log of absolute value of the gamma function --
+---------------------------------------------------------
+
+-- special values
+lgam0000 lgamma 0.0 -> inf divide-by-zero
+lgam0001 lgamma -0.0 -> inf divide-by-zero
+lgam0002 lgamma inf -> inf
+lgam0003 lgamma -inf -> inf
+lgam0004 lgamma nan -> nan
+
+-- negative integers
+lgam0010 lgamma -1 -> inf divide-by-zero
+lgam0011 lgamma -2 -> inf divide-by-zero
+lgam0012 lgamma -1e16 -> inf divide-by-zero
+lgam0013 lgamma -1e300 -> inf divide-by-zero
+lgam0014 lgamma -1.79e308 -> inf divide-by-zero
+
+-- small positive integers give factorials
+lgam0020 lgamma 1 -> 0.0
+lgam0021 lgamma 2 -> 0.0
+lgam0022 lgamma 3 -> 0.69314718055994529
+lgam0023 lgamma 4 -> 1.791759469228055
+lgam0024 lgamma 5 -> 3.1780538303479458
+lgam0025 lgamma 6 -> 4.7874917427820458
+
+-- half integers
+lgam0030 lgamma 0.5 -> 0.57236494292470008
+lgam0031 lgamma 1.5 -> -0.12078223763524522
+lgam0032 lgamma 2.5 -> 0.28468287047291918
+lgam0033 lgamma 3.5 -> 1.2009736023470743
+lgam0034 lgamma -0.5 -> 1.2655121234846454
+lgam0035 lgamma -1.5 -> 0.86004701537648098
+lgam0036 lgamma -2.5 -> -0.056243716497674054
+lgam0037 lgamma -3.5 -> -1.309006684993042
+
+-- values near 0
+lgam0040 lgamma 0.1 -> 2.252712651734206
+lgam0041 lgamma 0.01 -> 4.5994798780420219
+lgam0042 lgamma 1e-8 -> 18.420680738180209
+lgam0043 lgamma 1e-16 -> 36.841361487904734
+lgam0044 lgamma 1e-30 -> 69.077552789821368
+lgam0045 lgamma 1e-160 -> 368.41361487904732
+lgam0046 lgamma 1e-308 -> 709.19620864216608
+lgam0047 lgamma 5.6e-309 -> 709.77602713741896
+lgam0048 lgamma 5.5e-309 -> 709.79404564292167
+lgam0049 lgamma 1e-309 -> 711.49879373516012
+lgam0050 lgamma 1e-323 -> 743.74692474082133
+lgam0051 lgamma 5e-324 -> 744.44007192138122
+lgam0060 lgamma -0.1 -> 2.3689613327287886
+lgam0061 lgamma -0.01 -> 4.6110249927528013
+lgam0062 lgamma -1e-8 -> 18.420680749724522
+lgam0063 lgamma -1e-16 -> 36.841361487904734
+lgam0064 lgamma -1e-30 -> 69.077552789821368
+lgam0065 lgamma -1e-160 -> 368.41361487904732
+lgam0066 lgamma -1e-308 -> 709.19620864216608
+lgam0067 lgamma -5.6e-309 -> 709.77602713741896
+lgam0068 lgamma -5.5e-309 -> 709.79404564292167
+lgam0069 lgamma -1e-309 -> 711.49879373516012
+lgam0070 lgamma -1e-323 -> 743.74692474082133
+lgam0071 lgamma -5e-324 -> 744.44007192138122
+
+-- values near negative integers
+lgam0080 lgamma -0.99999999999999989 -> 36.736800569677101
+lgam0081 lgamma -1.0000000000000002 -> 36.043653389117154
+lgam0082 lgamma -1.9999999999999998 -> 35.350506208557213
+lgam0083 lgamma -2.0000000000000004 -> 34.657359027997266
+lgam0084 lgamma -100.00000000000001 -> -331.85460524980607
+lgam0085 lgamma -99.999999999999986 -> -331.85460524980596
+
+-- large inputs
+lgam0100 lgamma 170 -> 701.43726380873704
+lgam0101 lgamma 171 -> 706.57306224578736
+lgam0102 lgamma 171.624 -> 709.78077443669895
+lgam0103 lgamma 171.625 -> 709.78591682948365
+lgam0104 lgamma 172 -> 711.71472580228999
+lgam0105 lgamma 2000 -> 13198.923448054265
+lgam0106 lgamma 2.55998332785163e305 -> 1.7976931348623099e+308
+lgam0107 lgamma 2.55998332785164e305 -> inf overflow
+lgam0108 lgamma 1.7e308 -> inf overflow
+
+-- inputs for which gamma(x) is tiny
+lgam0120 lgamma -100.5 -> -364.90096830942736
+lgam0121 lgamma -160.5 -> -656.88005261126432
+lgam0122 lgamma -170.5 -> -707.99843314507882
+lgam0123 lgamma -171.5 -> -713.14301641168481
+lgam0124 lgamma -176.5 -> -738.95247590846486
+lgam0125 lgamma -177.5 -> -744.13144651738037
+lgam0126 lgamma -178.5 -> -749.3160351186001
+
+lgam0130 lgamma -1000.5 -> -5914.4377011168517
+lgam0131 lgamma -30000.5 -> -279278.6629959144
+lgam0132 lgamma -4503599627370495.5 -> -1.5782258434492883e+17
+
+-- results close to 0: positive argument ...
+lgam0150 lgamma 0.99999999999999989 -> 6.4083812134800075e-17
+lgam0151 lgamma 1.0000000000000002 -> -1.2816762426960008e-16
+lgam0152 lgamma 1.9999999999999998 -> -9.3876980655431170e-17
+lgam0153 lgamma 2.0000000000000004 -> 1.8775396131086244e-16
+
+-- ... and negative argument
+lgam0160 lgamma -2.7476826467 -> -5.2477408147689136e-11
+lgam0161 lgamma -2.457024738 -> 3.3464637541912932e-10
+
+
+---------------------------
+-- gamma: Gamma function --
+---------------------------
+
+-- special values
+gam0000 gamma 0.0 -> inf divide-by-zero
+gam0001 gamma -0.0 -> -inf divide-by-zero
+gam0002 gamma inf -> inf
+gam0003 gamma -inf -> nan invalid
+gam0004 gamma nan -> nan
+
+-- negative integers inputs are invalid
+gam0010 gamma -1 -> nan invalid
+gam0011 gamma -2 -> nan invalid
+gam0012 gamma -1e16 -> nan invalid
+gam0013 gamma -1e300 -> nan invalid
+
+-- small positive integers give factorials
+gam0020 gamma 1 -> 1
+gam0021 gamma 2 -> 1
+gam0022 gamma 3 -> 2
+gam0023 gamma 4 -> 6
+gam0024 gamma 5 -> 24
+gam0025 gamma 6 -> 120
+
+-- half integers
+gam0030 gamma 0.5 -> 1.7724538509055161
+gam0031 gamma 1.5 -> 0.88622692545275805
+gam0032 gamma 2.5 -> 1.3293403881791370
+gam0033 gamma 3.5 -> 3.3233509704478426
+gam0034 gamma -0.5 -> -3.5449077018110322
+gam0035 gamma -1.5 -> 2.3632718012073548
+gam0036 gamma -2.5 -> -0.94530872048294190
+gam0037 gamma -3.5 -> 0.27008820585226911
+
+-- values near 0
+gam0040 gamma 0.1 -> 9.5135076986687306
+gam0041 gamma 0.01 -> 99.432585119150602
+gam0042 gamma 1e-8 -> 99999999.422784343
+gam0043 gamma 1e-16 -> 10000000000000000
+gam0044 gamma 1e-30 -> 9.9999999999999988e+29
+gam0045 gamma 1e-160 -> 1.0000000000000000e+160
+gam0046 gamma 1e-308 -> 1.0000000000000000e+308
+gam0047 gamma 5.6e-309 -> 1.7857142857142848e+308
+gam0048 gamma 5.5e-309 -> inf overflow
+gam0049 gamma 1e-309 -> inf overflow
+gam0050 gamma 1e-323 -> inf overflow
+gam0051 gamma 5e-324 -> inf overflow
+gam0060 gamma -0.1 -> -10.686287021193193
+gam0061 gamma -0.01 -> -100.58719796441078
+gam0062 gamma -1e-8 -> -100000000.57721567
+gam0063 gamma -1e-16 -> -10000000000000000
+gam0064 gamma -1e-30 -> -9.9999999999999988e+29
+gam0065 gamma -1e-160 -> -1.0000000000000000e+160
+gam0066 gamma -1e-308 -> -1.0000000000000000e+308
+gam0067 gamma -5.6e-309 -> -1.7857142857142848e+308
+gam0068 gamma -5.5e-309 -> -inf overflow
+gam0069 gamma -1e-309 -> -inf overflow
+gam0070 gamma -1e-323 -> -inf overflow
+gam0071 gamma -5e-324 -> -inf overflow
+
+-- values near negative integers
+gam0080 gamma -0.99999999999999989 -> -9007199254740992.0
+gam0081 gamma -1.0000000000000002 -> 4503599627370495.5
+gam0082 gamma -1.9999999999999998 -> 2251799813685248.5
+gam0083 gamma -2.0000000000000004 -> -1125899906842623.5
+gam0084 gamma -100.00000000000001 -> -7.5400833348831090e-145
+gam0085 gamma -99.999999999999986 -> 7.5400833348840962e-145
+
+-- large inputs
+gam0100 gamma 170 -> 4.2690680090047051e+304
+gam0101 gamma 171 -> 7.2574156153079990e+306
+gam0102 gamma 171.624 -> 1.7942117599248104e+308
+gam0103 gamma 171.625 -> inf overflow
+gam0104 gamma 172 -> inf overflow
+gam0105 gamma 2000 -> inf overflow
+gam0106 gamma 1.7e308 -> inf overflow
+
+-- inputs for which gamma(x) is tiny
+gam0120 gamma -100.5 -> -3.3536908198076787e-159
+gam0121 gamma -160.5 -> -5.2555464470078293e-286
+gam0122 gamma -170.5 -> -3.3127395215386074e-308
+gam0123 gamma -171.5 -> 1.9316265431711902e-310
+gam0124 gamma -176.5 -> -1.1956388629358166e-321
+gam0125 gamma -177.5 -> 4.9406564584124654e-324
+gam0126 gamma -178.5 -> -0.0
+gam0127 gamma -179.5 -> 0.0
+gam0128 gamma -201.0001 -> 0.0
+gam0129 gamma -202.9999 -> -0.0
+gam0130 gamma -1000.5 -> -0.0
+gam0131 gamma -1000000000.3 -> -0.0
+gam0132 gamma -4503599627370495.5 -> 0.0
+
+-- inputs that cause problems for the standard reflection formula,
+-- thanks to loss of accuracy in 1-x
+gam0140 gamma -63.349078729022985 -> 4.1777971677761880e-88
+gam0141 gamma -127.45117632943295 -> 1.1831110896236810e-214
+
+
+-----------------------------------------------------------
+-- expm1: exp(x) - 1, without precision loss for small x --
+-----------------------------------------------------------
+
+-- special values
+expm10000 expm1 0.0 -> 0.0
+expm10001 expm1 -0.0 -> -0.0
+expm10002 expm1 inf -> inf
+expm10003 expm1 -inf -> -1.0
+expm10004 expm1 nan -> nan
+
+-- expm1(x) ~ x for tiny x
+expm10010 expm1 5e-324 -> 5e-324
+expm10011 expm1 1e-320 -> 1e-320
+expm10012 expm1 1e-300 -> 1e-300
+expm10013 expm1 1e-150 -> 1e-150
+expm10014 expm1 1e-20 -> 1e-20
+
+expm10020 expm1 -5e-324 -> -5e-324
+expm10021 expm1 -1e-320 -> -1e-320
+expm10022 expm1 -1e-300 -> -1e-300
+expm10023 expm1 -1e-150 -> -1e-150
+expm10024 expm1 -1e-20 -> -1e-20
+
+-- moderate sized values, where direct evaluation runs into trouble
+expm10100 expm1 1e-10 -> 1.0000000000500000e-10
+expm10101 expm1 -9.9999999999999995e-08 -> -9.9999995000000163e-8
+expm10102 expm1 3.0000000000000001e-05 -> 3.0000450004500034e-5
+expm10103 expm1 -0.0070000000000000001 -> -0.0069755570667648951
+expm10104 expm1 -0.071499208740094633 -> -0.069002985744820250
+expm10105 expm1 -0.063296004180116799 -> -0.061334416373633009
+expm10106 expm1 0.02390954035597756 -> 0.024197665143819942
+expm10107 expm1 0.085637352649044901 -> 0.089411184580357767
+expm10108 expm1 0.5966174947411006 -> 0.81596588596501485
+expm10109 expm1 0.30247206212075139 -> 0.35319987035848677
+expm10110 expm1 0.74574727375889516 -> 1.1080161116737459
+expm10111 expm1 0.97767512926555711 -> 1.6582689207372185
+expm10112 expm1 0.8450154566787712 -> 1.3280137976535897
+expm10113 expm1 -0.13979260323125264 -> -0.13046144381396060
+expm10114 expm1 -0.52899322039643271 -> -0.41080213643695923
+expm10115 expm1 -0.74083261478900631 -> -0.52328317124797097
+expm10116 expm1 -0.93847766984546055 -> -0.60877704724085946
+expm10117 expm1 10.0 -> 22025.465794806718
+expm10118 expm1 27.0 -> 532048240600.79865
+expm10119 expm1 123 -> 2.6195173187490626e+53
+expm10120 expm1 -12.0 -> -0.99999385578764666
+expm10121 expm1 -35.100000000000001 -> -0.99999999999999944
+
+-- extreme negative values
+expm10201 expm1 -37.0 -> -0.99999999999999989
+expm10200 expm1 -38.0 -> -1.0
+expm10210 expm1 -710.0 -> -1.0
+-- the formula expm1(x) = 2 * sinh(x/2) * exp(x/2) doesn't work so
+-- well when exp(x/2) is subnormal or underflows to zero; check we're
+-- not using it!
+expm10211 expm1 -1420.0 -> -1.0
+expm10212 expm1 -1450.0 -> -1.0
+expm10213 expm1 -1500.0 -> -1.0
+expm10214 expm1 -1e50 -> -1.0
+expm10215 expm1 -1.79e308 -> -1.0
+
+-- extreme positive values
+expm10300 expm1 300 -> 1.9424263952412558e+130
+expm10301 expm1 700 -> 1.0142320547350045e+304
+-- the next test (expm10302) is disabled because it causes failure on
+-- OS X 10.4/Intel: apparently all values over 709.78 produce an
+-- overflow on that platform. See issue #7575.
+-- expm10302 expm1 709.78271289328393 -> 1.7976931346824240e+308
+expm10303 expm1 709.78271289348402 -> inf overflow
+expm10304 expm1 1000 -> inf overflow
+expm10305 expm1 1e50 -> inf overflow
+expm10306 expm1 1.79e308 -> inf overflow
+
+-- weaker version of expm10302
+expm10307 expm1 709.5 -> 1.3549863193146328e+308
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 2454af13ed..c9e74b857f 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -2,11 +2,11 @@ import unittest
import pickle
import cPickle
import StringIO
+import cStringIO
import pickletools
import copy_reg
-from test.test_support import TestFailed, have_unicode, TESTFN, \
- run_with_locale
+from test.test_support import TestFailed, have_unicode, TESTFN
# Tests that try a number of pickle protocols should have a
# for proto in protocols:
@@ -14,6 +14,42 @@ from test.test_support import TestFailed, have_unicode, TESTFN, \
assert pickle.HIGHEST_PROTOCOL == cPickle.HIGHEST_PROTOCOL == 2
protocols = range(pickle.HIGHEST_PROTOCOL + 1)
+# Copy of test.test_support.run_with_locale. This is needed to support Python
+# 2.4, which didn't include it. This is all to support test_xpickle, which
+# bounces pickled objects through older Python versions to test backwards
+# compatibility.
+def run_with_locale(catstr, *locales):
+ def decorator(func):
+ def inner(*args, **kwds):
+ try:
+ import locale
+ category = getattr(locale, catstr)
+ orig_locale = locale.setlocale(category)
+ except AttributeError:
+ # if the test author gives us an invalid category string
+ raise
+ except:
+ # cannot retrieve original locale, so do nothing
+ locale = orig_locale = None
+ else:
+ for loc in locales:
+ try:
+ locale.setlocale(category, loc)
+ break
+ except:
+ pass
+
+ # now run the function, resetting the locale on exceptions
+ try:
+ return func(*args, **kwds)
+ finally:
+ if locale and orig_locale:
+ locale.setlocale(category, orig_locale)
+ inner.func_name = func.func_name
+ inner.__doc__ = func.__doc__
+ return inner
+ return decorator
+
# Return True if opcode code appears in the pickle, else False.
def opcode_in_pickle(code, pickle):
@@ -410,12 +446,11 @@ class AbstractPickleTests(unittest.TestCase):
# is a mystery. cPickle also suppresses PUT for objects with a refcount
# of 1.
def dont_test_disassembly(self):
- from cStringIO import StringIO
from pickletools import dis
for proto, expected in (0, DATA0_DIS), (1, DATA1_DIS):
s = self.dumps(self._testdata, proto)
- filelike = StringIO()
+ filelike = cStringIO.StringIO()
dis(s, out=filelike)
got = filelike.getvalue()
self.assertEqual(expected, got)
@@ -427,7 +462,7 @@ class AbstractPickleTests(unittest.TestCase):
s = self.dumps(l, proto)
x = self.loads(s)
self.assertEqual(len(x), 1)
- self.assert_(x is x[0])
+ self.assertTrue(x is x[0])
def test_recursive_tuple(self):
t = ([],)
@@ -437,7 +472,7 @@ class AbstractPickleTests(unittest.TestCase):
x = self.loads(s)
self.assertEqual(len(x), 1)
self.assertEqual(len(x[0]), 1)
- self.assert_(x is x[0][0])
+ self.assertTrue(x is x[0][0])
def test_recursive_dict(self):
d = {}
@@ -446,7 +481,7 @@ class AbstractPickleTests(unittest.TestCase):
s = self.dumps(d, proto)
x = self.loads(s)
self.assertEqual(x.keys(), [1])
- self.assert_(x[1] is x)
+ self.assertTrue(x[1] is x)
def test_recursive_inst(self):
i = C()
@@ -455,7 +490,7 @@ class AbstractPickleTests(unittest.TestCase):
s = self.dumps(i, 2)
x = self.loads(s)
self.assertEqual(dir(x), dir(i))
- self.assert_(x.attr is x)
+ self.assertTrue(x.attr is x)
def test_recursive_multi(self):
l = []
@@ -469,7 +504,7 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(len(x), 1)
self.assertEqual(dir(x[0]), dir(i))
self.assertEqual(x[0].attr.keys(), [1])
- self.assert_(x[0].attr[1] is x)
+ self.assertTrue(x[0].attr[1] is x)
def test_garyp(self):
self.assertRaises(self.error, self.loads, 'garyp')
@@ -610,7 +645,7 @@ class AbstractPickleTests(unittest.TestCase):
try:
self.loads(badpickle)
except ValueError, detail:
- self.failUnless(str(detail).startswith(
+ self.assertTrue(str(detail).startswith(
"unsupported pickle protocol"))
else:
self.fail("expected bad protocol number to raise ValueError")
@@ -682,7 +717,7 @@ class AbstractPickleTests(unittest.TestCase):
for x in None, False, True:
s = self.dumps(x, proto)
y = self.loads(s)
- self.assert_(x is y, (proto, x, s, y))
+ self.assertTrue(x is y, (proto, x, s, y))
expected = expected_opcode[proto, x]
self.assertEqual(opcode_in_pickle(expected, s), True)
@@ -732,8 +767,8 @@ class AbstractPickleTests(unittest.TestCase):
# Dump using protocol 1 for comparison.
s1 = self.dumps(x, 1)
- self.assert_(__name__ in s1)
- self.assert_("MyList" in s1)
+ self.assertIn(__name__, s1)
+ self.assertIn("MyList", s1)
self.assertEqual(opcode_in_pickle(opcode, s1), False)
y = self.loads(s1)
@@ -742,8 +777,8 @@ class AbstractPickleTests(unittest.TestCase):
# Dump using protocol 2 for test.
s2 = self.dumps(x, 2)
- self.assert_(__name__ not in s2)
- self.assert_("MyList" not in s2)
+ self.assertNotIn(__name__, s2)
+ self.assertNotIn("MyList", s2)
self.assertEqual(opcode_in_pickle(opcode, s2), True)
y = self.loads(s2)
@@ -787,7 +822,7 @@ class AbstractPickleTests(unittest.TestCase):
if proto == 0:
self.assertEqual(num_appends, 0)
else:
- self.failUnless(num_appends >= 2)
+ self.assertTrue(num_appends >= 2)
def test_dict_chunking(self):
n = 10 # too small to chunk
@@ -809,7 +844,7 @@ class AbstractPickleTests(unittest.TestCase):
if proto == 0:
self.assertEqual(num_setitems, 0)
else:
- self.failUnless(num_setitems >= 2)
+ self.assertTrue(num_setitems >= 2)
def test_simple_newobj(self):
x = object.__new__(SimpleNewObj) # avoid __init__
@@ -833,7 +868,7 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(x.bar, y.bar)
def test_reduce_overrides_default_reduce_ex(self):
- for proto in 0, 1, 2:
+ for proto in protocols:
x = REX_one()
self.assertEqual(x._reduce_called, 0)
s = self.dumps(x, proto)
@@ -842,7 +877,7 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(y._reduce_called, 0)
def test_reduce_ex_called(self):
- for proto in 0, 1, 2:
+ for proto in protocols:
x = REX_two()
self.assertEqual(x._proto, None)
s = self.dumps(x, proto)
@@ -851,7 +886,7 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(y._proto, None)
def test_reduce_ex_overrides_reduce(self):
- for proto in 0, 1, 2:
+ for proto in protocols:
x = REX_three()
self.assertEqual(x._proto, None)
s = self.dumps(x, proto)
@@ -860,7 +895,7 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(y._proto, None)
def test_reduce_ex_calls_base(self):
- for proto in 0, 1, 2:
+ for proto in protocols:
x = REX_four()
self.assertEqual(x._proto, None)
s = self.dumps(x, proto)
@@ -869,7 +904,7 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(y._proto, proto)
def test_reduce_calls_base(self):
- for proto in 0, 1, 2:
+ for proto in protocols:
x = REX_five()
self.assertEqual(x._reduce_called, 0)
s = self.dumps(x, proto)
@@ -890,7 +925,7 @@ class AbstractPickleTests(unittest.TestCase):
return dict, (), None, None, []
# Protocol 0 is less strict and also accept iterables.
- for proto in 0, 1, 2:
+ for proto in protocols:
try:
self.dumps(C(), proto)
except (AttributeError, pickle.PickleError, cPickle.PickleError):
@@ -900,6 +935,35 @@ class AbstractPickleTests(unittest.TestCase):
except (AttributeError, pickle.PickleError, cPickle.PickleError):
pass
+ def test_many_puts_and_gets(self):
+ # Test that internal data structures correctly deal with lots of
+ # puts/gets.
+ keys = ("aaa" + str(i) for i in xrange(100))
+ large_dict = dict((k, [4, 5, 6]) for k in keys)
+ obj = [dict(large_dict), dict(large_dict), dict(large_dict)]
+
+ for proto in protocols:
+ dumped = self.dumps(obj, proto)
+ loaded = self.loads(dumped)
+ self.assertEqual(loaded, obj,
+ "Failed protocol %d: %r != %r"
+ % (proto, obj, loaded))
+
+ def test_attribute_name_interning(self):
+ # Test that attribute names of pickled objects are interned when
+ # unpickling.
+ for proto in protocols:
+ x = C()
+ x.foo = 42
+ x.bar = "hello"
+ s = self.dumps(x, proto)
+ y = self.loads(s)
+ x_keys = sorted(x.__dict__)
+ y_keys = sorted(y.__dict__)
+ for x_key, y_key in zip(x_keys, y_keys):
+ self.assertIs(x_key, y_key)
+
+
# Test classes for reduce_ex
class REX_one(object):
@@ -1001,13 +1065,20 @@ class AbstractPickleModuleTests(unittest.TestCase):
finally:
os.remove(TESTFN)
+ def test_load_from_and_dump_to_file(self):
+ stream = cStringIO.StringIO()
+ data = [123, {}, 124]
+ self.module.dump(data, stream)
+ stream.seek(0)
+ unpickled = self.module.load(stream)
+ self.assertEqual(unpickled, data)
+
def test_highest_protocol(self):
# Of course this needs to be changed when HIGHEST_PROTOCOL changes.
self.assertEqual(self.module.HIGHEST_PROTOCOL, 2)
def test_callapi(self):
- from cStringIO import StringIO
- f = StringIO()
+ f = cStringIO.StringIO()
# With and without keyword arguments
self.module.dump(123, f, -1)
self.module.dump(123, file=f, protocol=-1)
@@ -1073,3 +1144,116 @@ class AbstractPersistentPicklerTests(unittest.TestCase):
self.assertEqual(self.loads(self.dumps(L, 1)), L)
self.assertEqual(self.id_count, 5)
self.assertEqual(self.load_count, 5)
+
+class AbstractPicklerUnpicklerObjectTests(unittest.TestCase):
+
+ pickler_class = None
+ unpickler_class = None
+
+ def setUp(self):
+ assert self.pickler_class
+ assert self.unpickler_class
+
+ def test_clear_pickler_memo(self):
+ # To test whether clear_memo() has any effect, we pickle an object,
+ # then pickle it again without clearing the memo; the two serialized
+ # forms should be different. If we clear_memo() and then pickle the
+ # object again, the third serialized form should be identical to the
+ # first one we obtained.
+ data = ["abcdefg", "abcdefg", 44]
+ f = cStringIO.StringIO()
+ pickler = self.pickler_class(f)
+
+ pickler.dump(data)
+ first_pickled = f.getvalue()
+
+ # Reset StringIO object.
+ f.seek(0)
+ f.truncate()
+
+ pickler.dump(data)
+ second_pickled = f.getvalue()
+
+ # Reset the Pickler and StringIO objects.
+ pickler.clear_memo()
+ f.seek(0)
+ f.truncate()
+
+ pickler.dump(data)
+ third_pickled = f.getvalue()
+
+ self.assertNotEqual(first_pickled, second_pickled)
+ self.assertEqual(first_pickled, third_pickled)
+
+ def test_priming_pickler_memo(self):
+ # Verify that we can set the Pickler's memo attribute.
+ data = ["abcdefg", "abcdefg", 44]
+ f = cStringIO.StringIO()
+ pickler = self.pickler_class(f)
+
+ pickler.dump(data)
+ first_pickled = f.getvalue()
+
+ f = cStringIO.StringIO()
+ primed = self.pickler_class(f)
+ primed.memo = pickler.memo
+
+ primed.dump(data)
+ primed_pickled = f.getvalue()
+
+ self.assertNotEqual(first_pickled, primed_pickled)
+
+ def test_priming_unpickler_memo(self):
+ # Verify that we can set the Unpickler's memo attribute.
+ data = ["abcdefg", "abcdefg", 44]
+ f = cStringIO.StringIO()
+ pickler = self.pickler_class(f)
+
+ pickler.dump(data)
+ first_pickled = f.getvalue()
+
+ f = cStringIO.StringIO()
+ primed = self.pickler_class(f)
+ primed.memo = pickler.memo
+
+ primed.dump(data)
+ primed_pickled = f.getvalue()
+
+ unpickler = self.unpickler_class(cStringIO.StringIO(first_pickled))
+ unpickled_data1 = unpickler.load()
+
+ self.assertEqual(unpickled_data1, data)
+
+ primed = self.unpickler_class(cStringIO.StringIO(primed_pickled))
+ primed.memo = unpickler.memo
+ unpickled_data2 = primed.load()
+
+ primed.memo.clear()
+
+ self.assertEqual(unpickled_data2, data)
+ self.assertTrue(unpickled_data2 is unpickled_data1)
+
+ def test_reusing_unpickler_objects(self):
+ data1 = ["abcdefg", "abcdefg", 44]
+ f = cStringIO.StringIO()
+ pickler = self.pickler_class(f)
+ pickler.dump(data1)
+ pickled1 = f.getvalue()
+
+ data2 = ["abcdefg", 44, 44]
+ f = cStringIO.StringIO()
+ pickler = self.pickler_class(f)
+ pickler.dump(data2)
+ pickled2 = f.getvalue()
+
+ f = cStringIO.StringIO()
+ f.write(pickled1)
+ f.seek(0)
+ unpickler = self.unpickler_class(f)
+ self.assertEqual(unpickler.load(), data1)
+
+ f.seek(0)
+ f.truncate()
+ f.write(pickled2)
+ f.seek(0)
+ self.assertEqual(unpickler.load(), data2)
diff --git a/Lib/test/pyclbr_input.py b/Lib/test/pyclbr_input.py
index 8efc9de75d..19ccd62dea 100644
--- a/Lib/test/pyclbr_input.py
+++ b/Lib/test/pyclbr_input.py
@@ -19,7 +19,7 @@ class C (B):
# XXX: This causes test_pyclbr.py to fail, but only because the
# introspection-based is_method() code in the test can't
- # distinguish between this and a geniune method function like m().
+ # distinguish between this and a genuine method function like m().
# The pyclbr.py module gets this right as it parses the text.
#
#f = f
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
index 920d545c5d..c5f19ad9b2 100755
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -1,49 +1,80 @@
#! /usr/bin/env python
-"""Regression test.
-
-This will find all modules whose name is "test_*" in the test
-directory, and run them. Various command line options provide
-additional facilities.
-
-Command line options:
-
--v: verbose -- run tests in verbose mode with output to stdout
--w: verbose2 -- re-run failed tests in verbose mode
--q: quiet -- don't print anything except if a test fails
--x: exclude -- arguments are tests to *exclude*
--s: single -- run only a single test (see below)
--S: slow -- print the slowest 10 tests
--r: random -- randomize test execution order
--f: fromfile -- read names of tests to run from a file (see below)
--l: findleaks -- if GC is available detect tests that leak memory
--u: use -- specify which special resource intensive tests to run
--h: help -- print this text and exit
--t: threshold -- call gc.set_threshold(N)
--T: coverage -- turn on code coverage using the trace module
--D: coverdir -- Directory where coverage files are put
--N: nocoverdir -- Put coverage files alongside modules
--L: runleaks -- run the leaks(1) command just before exit
--R: huntrleaks -- search for reference leaks (needs debug build, v. slow)
--M: memlimit -- run very large memory-consuming tests
-
-If non-option arguments are present, they are names for tests to run,
-unless -x is given, in which case they are names for tests not to run.
-If no test names are given, all tests are run.
-
--T turns on code coverage tracing with the trace module.
-
--D specifies the directory where coverage files are put.
-
--N Put coverage files alongside modules.
-
--s means to run only a single test and exit. This is useful when
-doing memory analysis on the Python interpreter (which tend to consume
-too many resources to run the full regression test non-stop). The
-file /tmp/pynexttest is read to find the next test to run. If this
-file is missing, the first test_*.py file in testdir or on the command
-line is used. (actually tempfile.gettempdir() is used instead of
-/tmp).
+"""
+Usage:
+
+python -m test.regrtest [options] [test_name1 [test_name2 ...]]
+python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]]
+
+
+If no arguments or options are provided, finds all files matching
+the pattern "test_*" in the Lib/test subdirectory and runs
+them in alphabetical order (but see -M and -u, below, for exceptions).
+
+For more rigorous testing, it is useful to use the following
+command line:
+
+python -E -tt -Wd -3 -m test.regrtest [options] [test_name1 ...]
+
+
+Options:
+
+-h/--help -- print this text and exit
+
+Verbosity
+
+-v/--verbose -- run tests in verbose mode with output to stdout
+-w/--verbose2 -- re-run failed tests in verbose mode
+-W/--verbose3 -- re-run failed tests in verbose mode immediately
+-q/--quiet -- no output unless one or more tests fail
+-S/--slow -- print the slowest 10 tests
+ --header -- print header with interpreter info
+
+Selecting tests
+
+-r/--random -- randomize test execution order (see below)
+ --randseed -- pass a random seed to reproduce a previous random run
+-f/--fromfile -- read names of tests to run from a file (see below)
+-x/--exclude -- arguments are tests to *exclude*
+-s/--single -- single step through a set of tests (see below)
+-u/--use RES1,RES2,...
+ -- specify which special resource intensive tests to run
+-M/--memlimit LIMIT
+ -- run very large memory-consuming tests
+
+Special runs
+
+-l/--findleaks -- if GC is available detect tests that leak memory
+-L/--runleaks -- run the leaks(1) command just before exit
+-R/--huntrleaks RUNCOUNTS
+ -- search for reference leaks (needs debug build, v. slow)
+-j/--multiprocess PROCESSES
+ -- run PROCESSES processes at once
+-T/--coverage -- turn on code coverage tracing using the trace module
+-D/--coverdir DIRECTORY
+ -- Directory where coverage files are put
+-N/--nocoverdir -- Put coverage files alongside modules
+-t/--threshold THRESHOLD
+ -- call gc.set_threshold(THRESHOLD)
+-F/--forever -- run the specified tests in a loop, until an error happens
+
+
+Additional Option Details:
+
+-r randomizes test execution order. You can use --randseed=int to provide a
+int seed value for the randomizer; this is useful for reproducing troublesome
+test orders.
+
+-s On the first invocation of regrtest using -s, the first test file found
+or the first test file given on the command line is run, and the name of
+the next test is recorded in a file named pynexttest. If run from the
+Python build directory, pynexttest is located in the 'build' subdirectory,
+otherwise it is located in tempfile.gettempdir(). On subsequent runs,
+the test in pynexttest is run, and the next test is written to pynexttest.
+When the last test has been run, pynexttest is deleted. In this way it
+is possible to single step through the test files. This is useful when
+doing memory analysis on the Python interpreter, which process tends to
+consume too many resources to run the full regression test non-stop.
-f reads the names of tests from the file given as f's argument, one
or more test names per line. Whitespace is ignored. Blank lines and
@@ -60,7 +91,7 @@ be of the form stab:run:fname where 'stab' is the number of times the
test is run to let gettotalrefcount settle down, 'run' is the number
of times further it is run and 'fname' is the name of the file the
reports are written to. These parameters all have defaults (5, 4 and
-"reflog.txt" respectively), so the minimal invocation is '-R ::'.
+"reflog.txt" respectively), and the minimal invocation is '-R :'.
-M runs tests that require an exorbitant amount of memory. These tests
typically try to ascertain containers keep working when containing more than
@@ -91,8 +122,6 @@ resources to test. Currently only the following are defined:
curses - Tests that use curses and will modify the terminal's
state and output modes.
- lib2to3 - Run the tests for 2to3 (They take a while.)
-
largefile - It is okay to run some test that may create huge
files. These tests can take a long time and may
consume >2GB of disk space temporarily.
@@ -106,23 +135,26 @@ resources to test. Currently only the following are defined:
decimal - Test the decimal module against a large suite that
verifies compliance with standards.
- compiler - Test the compiler package by compiling all the source
- in the standard library and test suite. This takes
- a long time. Enabling this resource also allows
- test_tokenize to verify round-trip lexing on every
- file in the test library.
+ cpu - Used for certain CPU-heavy tests.
subprocess Run all tests for the subprocess module.
urlfetch - It is okay to download files required on testing.
+ gui - Run tests that require a running GUI.
+
+ xpickle - Test pickle and cPickle against Python 2.4, 2.5 and 2.6 to
+ test backwards compatibility. These tests take a long time
+ to run.
+
To enable all resources except one, use '-uall,-<resource>'. For
example, to run all the tests except for the bsddb tests, give the
option '-uall,-bsddb'.
"""
-import cStringIO
+import StringIO
import getopt
+import json
import os
import random
import re
@@ -130,28 +162,29 @@ import sys
import time
import traceback
import warnings
-# keep a reference to the ascii module to workaround #7140 bug
-# (see issue #7027)
-import encodings.ascii
+import unittest
+import tempfile
import imp
+import platform
+import sysconfig
+
+
+# Some times __path__ and __file__ are not absolute (e.g. while running from
+# Lib/) and, if we change the CWD to run the tests in a temporary dir, some
+# imports might fail. This affects only the modules imported before os.chdir().
+# These modules are searched first in sys.path[0] (so '' -- the CWD) and if
+# they are found in the CWD their __file__ and __path__ will be relative (this
+# happens before the chdir). All the modules imported after the chdir, are
+# not found in the CWD, and since the other paths in sys.path[1:] are absolute
+# (site.py absolutize them), the __file__ and __path__ will be absolute too.
+# Therefore it is necessary to absolutize manually the __file__ and __path__ of
+# the packages to prevent later imports to fail when the CWD is different.
+for module in sys.modules.itervalues():
+ if hasattr(module, '__path__'):
+ module.__path__ = [os.path.abspath(path) for path in module.__path__]
+ if hasattr(module, '__file__'):
+ module.__file__ = os.path.abspath(module.__file__)
-# I see no other way to suppress these warnings;
-# putting them in test_grammar.py has no effect:
-warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning,
- ".*test.test_grammar$")
-if sys.maxint > 0x7fffffff:
- # Also suppress them in <string>, because for 64-bit platforms,
- # that's where test_grammar.py hides them.
- warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning,
- "<string>")
-
-# Ignore ImportWarnings that only occur in the source tree,
-# (because of modules with the same name as source-directories in Modules/)
-for mod in ("ctypes", "gzip", "zipfile", "tarfile", "encodings.zlib_codec",
- "test.test_zipimport", "test.test_zlib", "test.test_zipfile",
- "test.test_codecs", "test.string_tests"):
- warnings.filterwarnings(module=".*%s$" % (mod,),
- action="ignore", category=ImportWarning)
# MacOSX (a.k.a. Darwin) has a default stack size that is too small
# for deeply recursive regular expressions. We see this as crashes in
@@ -169,10 +202,21 @@ if sys.platform == 'darwin':
newsoft = min(hard, max(soft, 1024*2048))
resource.setrlimit(resource.RLIMIT_STACK, (newsoft, hard))
+# Test result constants.
+PASSED = 1
+FAILED = 0
+ENV_CHANGED = -1
+SKIPPED = -2
+RESOURCE_DENIED = -3
+INTERRUPTED = -4
+
from test import test_support
RESOURCE_NAMES = ('audio', 'curses', 'largefile', 'network', 'bsddb',
- 'decimal', 'compiler', 'subprocess', 'urlfetch')
+ 'decimal', 'cpu', 'subprocess', 'urlfetch', 'gui',
+ 'xpickle')
+
+TEMPDIR = os.path.abspath(tempfile.gettempdir())
def usage(code, msg=''):
@@ -184,7 +228,9 @@ def usage(code, msg=''):
def main(tests=None, testdir=None, verbose=0, quiet=False,
exclude=False, single=False, randomize=False, fromfile=None,
findleaks=False, use_resources=None, trace=False, coverdir='coverage',
- runleaks=False, huntrleaks=False, verbose2=False, print_slow=False):
+ runleaks=False, huntrleaks=False, verbose2=False, print_slow=False,
+ random_seed=None, use_mp=None, verbose3=False, forever=False,
+ header=False):
"""Execute a test suite.
This also parses command-line options and modifies its behavior
@@ -202,24 +248,26 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
files beginning with test_ will be used.
The other default arguments (verbose, quiet, exclude,
- single, randomize, findleaks, use_resources, trace, coverdir, and
- print_slow) allow programmers calling main() directly to set the
- values that would normally be set by flags on the command line.
+ single, randomize, findleaks, use_resources, trace, coverdir,
+ print_slow, and random_seed) allow programmers calling main()
+ directly to set the values that would normally be set by flags
+ on the command line.
"""
test_support.record_original_stdout(sys.stdout)
try:
- opts, args = getopt.getopt(sys.argv[1:], 'hvqxsSrf:lu:t:TD:NLR:wM:',
- ['help', 'verbose', 'quiet', 'exclude',
- 'single', 'slow', 'random', 'fromfile',
- 'findleaks', 'use=', 'threshold=', 'trace',
- 'coverdir=', 'nocoverdir', 'runleaks',
- 'huntrleaks=', 'verbose2', 'memlimit=',
- ])
+ opts, args = getopt.getopt(sys.argv[1:], 'hvqxsSrf:lu:t:TD:NLR:FwWM:j:',
+ ['help', 'verbose', 'verbose2', 'verbose3', 'quiet',
+ 'exclude', 'single', 'slow', 'random', 'fromfile', 'findleaks',
+ 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir',
+ 'runleaks', 'huntrleaks=', 'memlimit=', 'randseed=',
+ 'multiprocess=', 'slaveargs=', 'forever', 'header'])
except getopt.error, msg:
usage(2, msg)
# Defaults
+ if random_seed is None:
+ random_seed = random.randrange(10000000)
if use_resources is None:
use_resources = []
for o, a in opts:
@@ -229,6 +277,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
verbose += 1
elif o in ('-w', '--verbose2'):
verbose2 = True
+ elif o in ('-W', '--verbose3'):
+ verbose3 = True
elif o in ('-q', '--quiet'):
quiet = True;
verbose = 0
@@ -240,6 +290,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
print_slow = True
elif o in ('-r', '--randomize'):
randomize = True
+ elif o == '--randseed':
+ random_seed = int(a)
elif o in ('-f', '--fromfile'):
fromfile = a
elif o in ('-l', '--findleaks'):
@@ -257,19 +309,19 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
coverdir = None
elif o in ('-R', '--huntrleaks'):
huntrleaks = a.split(':')
- if len(huntrleaks) != 3:
+ if len(huntrleaks) not in (2, 3):
print a, huntrleaks
- usage(2, '-R takes three colon-separated arguments')
- if len(huntrleaks[0]) == 0:
+ usage(2, '-R takes 2 or 3 colon-separated arguments')
+ if not huntrleaks[0]:
huntrleaks[0] = 5
else:
huntrleaks[0] = int(huntrleaks[0])
- if len(huntrleaks[1]) == 0:
+ if not huntrleaks[1]:
huntrleaks[1] = 4
else:
huntrleaks[1] = int(huntrleaks[1])
- if len(huntrleaks[2]) == 0:
- huntrleaks[2] = "reflog.txt"
+ if len(huntrleaks) == 2 or not huntrleaks[2]:
+ huntrleaks[2:] = ["reflog.txt"]
elif o in ('-M', '--memlimit'):
test_support.set_memlimit(a)
elif o in ('-u', '--use'):
@@ -289,17 +341,38 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
use_resources.remove(r)
elif r not in use_resources:
use_resources.append(r)
+ elif o in ('-F', '--forever'):
+ forever = True
+ elif o in ('-j', '--multiprocess'):
+ use_mp = int(a)
+ elif o == '--header':
+ header = True
+ elif o == '--slaveargs':
+ args, kwargs = json.loads(a)
+ try:
+ result = runtest(*args, **kwargs)
+ except BaseException, e:
+ result = INTERRUPTED, e.__class__.__name__
+ print # Force a newline (just in case)
+ print json.dumps(result)
+ sys.exit(0)
else:
- print >>sys.stderr, ("No handler for option {0}. Please "
+ print >>sys.stderr, ("No handler for option {}. Please "
"report this as a bug at http://bugs.python.org.").format(o)
sys.exit(1)
if single and fromfile:
usage(2, "-s and -f don't go together!")
+ if use_mp and trace:
+ usage(2, "-T and -j don't go together!")
+ if use_mp and findleaks:
+ usage(2, "-l and -j don't go together!")
good = []
bad = []
skipped = []
resource_denieds = []
+ environment_changed = []
+ interrupted = False
if findleaks:
try:
@@ -315,19 +388,18 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
found_garbage = []
if single:
- from tempfile import gettempdir
- filename = os.path.join(gettempdir(), 'pynexttest')
+ filename = os.path.join(TEMPDIR, 'pynexttest')
try:
fp = open(filename, 'r')
- next = fp.read().strip()
- tests = [next]
+ next_test = fp.read().strip()
+ tests = [next_test]
fp.close()
except IOError:
pass
if fromfile:
tests = []
- fp = open(fromfile)
+ fp = open(os.path.join(test_support.SAVEDCWD, fromfile))
for line in fp:
guts = line.split() # assuming no test has whitespace in its name
if guts and not guts[0].startswith('#'):
@@ -335,76 +407,193 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
fp.close()
# Strip .py extensions.
- if args:
- args = map(removepy, args)
- if tests:
- tests = map(removepy, tests)
+ removepy(args)
+ removepy(tests)
stdtests = STDTESTS[:]
- nottests = NOTTESTS[:]
+ nottests = NOTTESTS.copy()
if exclude:
for arg in args:
if arg in stdtests:
stdtests.remove(arg)
- nottests[:0] = args
+ nottests.add(arg)
args = []
- tests = tests or args or findtests(testdir, stdtests, nottests)
+
+ # For a partial run, we do not need to clutter the output.
+ if verbose or header or not (quiet or single or tests or args):
+ # Print basic platform information
+ print "==", platform.python_implementation(), \
+ " ".join(sys.version.split())
+ print "== ", platform.platform(aliased=True), \
+ "%s-endian" % sys.byteorder
+ print "== ", os.getcwd()
+ print "Testing with flags:", sys.flags
+
+ alltests = findtests(testdir, stdtests, nottests)
+ selected = tests or args or alltests
if single:
- tests = tests[:1]
+ selected = selected[:1]
+ try:
+ next_single_test = alltests[alltests.index(selected[0])+1]
+ except IndexError:
+ next_single_test = None
if randomize:
- random.shuffle(tests)
+ random.seed(random_seed)
+ print "Using random seed", random_seed
+ random.shuffle(selected)
if trace:
import trace
tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix],
trace=False, count=True)
+
test_times = []
- test_support.verbose = verbose # Tell tests to be moderately quiet
test_support.use_resources = use_resources
save_modules = sys.modules.keys()
- for test in tests:
- if not quiet:
- print test
- sys.stdout.flush()
- if trace:
- # If we're tracing code coverage, then we don't exit with status
- # if on a false return value from main.
- tracer.runctx('runtest(test, verbose, quiet,'
- ' test_times, testdir)',
- globals=globals(), locals=vars())
- else:
+
+ def accumulate_result(test, result):
+ ok, test_time = result
+ test_times.append((test_time, test))
+ if ok == PASSED:
+ good.append(test)
+ elif ok == FAILED:
+ bad.append(test)
+ elif ok == ENV_CHANGED:
+ bad.append(test)
+ environment_changed.append(test)
+ elif ok == SKIPPED:
+ skipped.append(test)
+ elif ok == RESOURCE_DENIED:
+ skipped.append(test)
+ resource_denieds.append(test)
+
+ if forever:
+ def test_forever(tests=list(selected)):
+ while True:
+ for test in tests:
+ yield test
+ if bad:
+ return
+ tests = test_forever()
+ else:
+ tests = iter(selected)
+
+ if use_mp:
+ try:
+ from threading import Thread
+ except ImportError:
+ print "Multiprocess option requires thread support"
+ sys.exit(2)
+ from Queue import Queue
+ from subprocess import Popen, PIPE
+ debug_output_pat = re.compile(r"\[\d+ refs\]$")
+ output = Queue()
+ def tests_and_args():
+ for test in tests:
+ args_tuple = (
+ (test, verbose, quiet),
+ dict(huntrleaks=huntrleaks, use_resources=use_resources)
+ )
+ yield (test, args_tuple)
+ pending = tests_and_args()
+ opt_args = test_support.args_from_interpreter_flags()
+ base_cmd = [sys.executable] + opt_args + ['-m', 'test.regrtest']
+ def work():
+ # A worker thread.
try:
- ok = runtest(test, verbose, quiet, test_times,
- testdir, huntrleaks)
- except KeyboardInterrupt:
- # print a newline separate from the ^C
- print
- break
- except:
+ while True:
+ try:
+ test, args_tuple = next(pending)
+ except StopIteration:
+ output.put((None, None, None, None))
+ return
+ # -E is needed by some tests, e.g. test_import
+ popen = Popen(base_cmd + ['--slaveargs', json.dumps(args_tuple)],
+ stdout=PIPE, stderr=PIPE,
+ universal_newlines=True,
+ close_fds=(os.name != 'nt'))
+ stdout, stderr = popen.communicate()
+ # Strip last refcount output line if it exists, since it
+ # comes from the shutdown of the interpreter in the subcommand.
+ stderr = debug_output_pat.sub("", stderr)
+ stdout, _, result = stdout.strip().rpartition("\n")
+ if not result:
+ output.put((None, None, None, None))
+ return
+ result = json.loads(result)
+ if not quiet:
+ stdout = test+'\n'+stdout
+ output.put((test, stdout.rstrip(), stderr.rstrip(), result))
+ except BaseException:
+ output.put((None, None, None, None))
raise
- if ok > 0:
- good.append(test)
- elif ok == 0:
- bad.append(test)
+ workers = [Thread(target=work) for i in range(use_mp)]
+ for worker in workers:
+ worker.start()
+ finished = 0
+ try:
+ while finished < use_mp:
+ test, stdout, stderr, result = output.get()
+ if test is None:
+ finished += 1
+ continue
+ if stdout:
+ print stdout
+ if stderr:
+ print >>sys.stderr, stderr
+ if result[0] == INTERRUPTED:
+ assert result[1] == 'KeyboardInterrupt'
+ raise KeyboardInterrupt # What else?
+ accumulate_result(test, result)
+ except KeyboardInterrupt:
+ interrupted = True
+ pending.close()
+ for worker in workers:
+ worker.join()
+ else:
+ for test in tests:
+ if not quiet:
+ print test
+ sys.stdout.flush()
+ if trace:
+ # If we're tracing code coverage, then we don't exit with status
+ # if on a false return value from main.
+ tracer.runctx('runtest(test, verbose, quiet)',
+ globals=globals(), locals=vars())
else:
- skipped.append(test)
- if ok == -2:
- resource_denieds.append(test)
- if findleaks:
- gc.collect()
- if gc.garbage:
- print "Warning: test created", len(gc.garbage),
- print "uncollectable object(s)."
- # move the uncollectable objects somewhere so we don't see
- # them again
- found_garbage.extend(gc.garbage)
- del gc.garbage[:]
- # Unload the newly imported modules (best effort finalization)
- for module in sys.modules.keys():
- if module not in save_modules and module.startswith("test."):
- test_support.unload(module)
-
+ try:
+ result = runtest(test, verbose, quiet, huntrleaks)
+ accumulate_result(test, result)
+ if verbose3 and result[0] == FAILED:
+ print "Re-running test %r in verbose mode" % test
+ runtest(test, True, quiet, huntrleaks)
+ except KeyboardInterrupt:
+ interrupted = True
+ break
+ except:
+ raise
+ if findleaks:
+ gc.collect()
+ if gc.garbage:
+ print "Warning: test created", len(gc.garbage),
+ print "uncollectable object(s)."
+ # move the uncollectable objects somewhere so we don't see
+ # them again
+ found_garbage.extend(gc.garbage)
+ del gc.garbage[:]
+ # Unload the newly imported modules (best effort finalization)
+ for module in sys.modules.keys():
+ if module not in save_modules and module.startswith("test."):
+ test_support.unload(module)
+
+ if interrupted:
+ # print a newline after ^C
+ print
+ print "Test suite interrupted by signal SIGINT."
+ omitted = set(selected) - set(good) - set(bad) - set(skipped)
+ print count(len(omitted), "test"), "omitted:"
+ printlist(omitted)
if good and not quiet:
- if not bad and not skipped and len(good) > 1:
+ if not bad and not skipped and not interrupted and len(good) > 1:
print "All",
print count(len(good), "test"), "OK."
if print_slow:
@@ -413,8 +602,14 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
for time, test in test_times[:10]:
print "%s: %.1fs" % (test, time)
if bad:
- print count(len(bad), "test"), "failed:"
- printlist(bad)
+ bad = set(bad) - set(environment_changed)
+ if bad:
+ print count(len(bad), "test"), "failed:"
+ printlist(bad)
+ if environment_changed:
+ print "{} altered the execution environment:".format(
+ count(len(environment_changed), "test"))
+ printlist(environment_changed)
if skipped and not quiet:
print count(len(skipped), "test"), "skipped:"
printlist(skipped)
@@ -440,8 +635,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
sys.stdout.flush()
try:
test_support.verbose = True
- ok = runtest(test, True, quiet, test_times, testdir,
- huntrleaks)
+ ok = runtest(test, True, quiet, huntrleaks)
except KeyboardInterrupt:
# print a newline separate from the ^C
print
@@ -450,16 +644,9 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
raise
if single:
- alltests = findtests(testdir, stdtests, nottests)
- for i in range(len(alltests)):
- if tests[0] == alltests[i]:
- if i == len(alltests) - 1:
- os.unlink(filename)
- else:
- fp = open(filename, 'w')
- fp.write(alltests[i+1] + '\n')
- fp.close()
- break
+ if next_single_test:
+ with open(filename, 'w') as fp:
+ fp.write(next_single_test + '\n')
else:
os.unlink(filename)
@@ -470,7 +657,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
if runleaks:
os.system("leaks %d" % os.getpid())
- sys.exit(len(bad) > 0)
+ sys.exit(len(bad) > 0 or interrupted)
STDTESTS = [
@@ -483,68 +670,191 @@ STDTESTS = [
'test_unittest',
'test_doctest',
'test_doctest2',
- # On 2.6, when a C module like dl or linuxaudiodev is imported by some
- # test, a DeprecationWarning is raised, but test_py3kwarn can not find
- # it in the __warningregistry__ of the modules in sys.modules.
- # C modules raise the warning only once, and since there's no way to
- # find these warnings, test_py3kwarn is executed first to catch them
- # before the other modules. This shouldn't affect 2.7+
- 'test_py3kwarn',
- ]
-
-NOTTESTS = [
+]
+
+NOTTESTS = {
'test_support',
'test_future1',
'test_future2',
- ]
+}
def findtests(testdir=None, stdtests=STDTESTS, nottests=NOTTESTS):
"""Return a list of all applicable test modules."""
- if not testdir: testdir = findtestdir()
+ testdir = findtestdir(testdir)
names = os.listdir(testdir)
tests = []
+ others = set(stdtests) | nottests
for name in names:
- if name[:5] == "test_" and name[-3:] == os.extsep+"py":
- modname = name[:-3]
- if modname not in stdtests and modname not in nottests:
- tests.append(modname)
- tests.sort()
- return stdtests + tests
-
-def runtest(test, verbose, quiet, test_times,
- testdir=None, huntrleaks=False):
+ modname, ext = os.path.splitext(name)
+ if modname[:5] == "test_" and ext == ".py" and modname not in others:
+ tests.append(modname)
+ return stdtests + sorted(tests)
+
+def runtest(test, verbose, quiet,
+ huntrleaks=False, use_resources=None):
"""Run a single test.
test -- the name of the test
verbose -- if true, print more messages
quiet -- if true, don't print 'skipped' messages (probably redundant)
test_times -- a list of (time, test_name) pairs
- testdir -- test directory
huntrleaks -- run multiple times to test for leaks; requires a debug
build; a triple corresponding to -R's three arguments
- Return:
- -2 test skipped because resource denied
- -1 test skipped for some other reason
- 0 test failed
- 1 test passed
+ Returns one of the test result constants:
+ INTERRUPTED KeyboardInterrupt when run under -j
+ RESOURCE_DENIED test skipped because resource denied
+ SKIPPED test skipped for some other reason
+ ENV_CHANGED test failed because it changed the execution environment
+ FAILED test failed
+ PASSED test passed
"""
+ test_support.verbose = verbose # Tell tests to be moderately quiet
+ if use_resources is not None:
+ test_support.use_resources = use_resources
try:
- return runtest_inner(test, verbose, quiet, test_times,
- testdir, huntrleaks)
+ return runtest_inner(test, verbose, quiet, huntrleaks)
finally:
cleanup_test_droppings(test, verbose)
-def runtest_inner(test, verbose, quiet, test_times,
- testdir=None, huntrleaks=False):
+
+# Unit tests are supposed to leave the execution environment unchanged
+# once they complete. But sometimes tests have bugs, especially when
+# tests fail, and the changes to environment go on to mess up other
+# tests. This can cause issues with buildbot stability, since tests
+# are run in random order and so problems may appear to come and go.
+# There are a few things we can save and restore to mitigate this, and
+# the following context manager handles this task.
+
+class saved_test_environment:
+ """Save bits of the test environment and restore them at block exit.
+
+ with saved_test_environment(testname, verbose, quiet):
+ #stuff
+
+ Unless quiet is True, a warning is printed to stderr if any of
+ the saved items was changed by the test. The attribute 'changed'
+ is initially False, but is set to True if a change is detected.
+
+ If verbose is more than 1, the before and after state of changed
+ items is also printed.
+ """
+
+ changed = False
+
+ def __init__(self, testname, verbose=0, quiet=False):
+ self.testname = testname
+ self.verbose = verbose
+ self.quiet = quiet
+
+ # To add things to save and restore, add a name XXX to the resources list
+ # and add corresponding get_XXX/restore_XXX functions. get_XXX should
+ # return the value to be saved and compared against a second call to the
+ # get function when test execution completes. restore_XXX should accept
+ # the saved value and restore the resource using it. It will be called if
+ # and only if a change in the value is detected.
+ #
+ # Note: XXX will have any '.' replaced with '_' characters when determining
+ # the corresponding method names.
+
+ resources = ('sys.argv', 'cwd', 'sys.stdin', 'sys.stdout', 'sys.stderr',
+ 'os.environ', 'sys.path', 'asyncore.socket_map')
+
+ def get_sys_argv(self):
+ return id(sys.argv), sys.argv, sys.argv[:]
+ def restore_sys_argv(self, saved_argv):
+ sys.argv = saved_argv[1]
+ sys.argv[:] = saved_argv[2]
+
+ def get_cwd(self):
+ return os.getcwd()
+ def restore_cwd(self, saved_cwd):
+ os.chdir(saved_cwd)
+
+ def get_sys_stdout(self):
+ return sys.stdout
+ def restore_sys_stdout(self, saved_stdout):
+ sys.stdout = saved_stdout
+
+ def get_sys_stderr(self):
+ return sys.stderr
+ def restore_sys_stderr(self, saved_stderr):
+ sys.stderr = saved_stderr
+
+ def get_sys_stdin(self):
+ return sys.stdin
+ def restore_sys_stdin(self, saved_stdin):
+ sys.stdin = saved_stdin
+
+ def get_os_environ(self):
+ return id(os.environ), os.environ, dict(os.environ)
+ def restore_os_environ(self, saved_environ):
+ os.environ = saved_environ[1]
+ os.environ.clear()
+ os.environ.update(saved_environ[2])
+
+ def get_sys_path(self):
+ return id(sys.path), sys.path, sys.path[:]
+ def restore_sys_path(self, saved_path):
+ sys.path = saved_path[1]
+ sys.path[:] = saved_path[2]
+
+ def get_asyncore_socket_map(self):
+ asyncore = sys.modules.get('asyncore')
+ # XXX Making a copy keeps objects alive until __exit__ gets called.
+ return asyncore and asyncore.socket_map.copy() or {}
+ def restore_asyncore_socket_map(self, saved_map):
+ asyncore = sys.modules.get('asyncore')
+ if asyncore is not None:
+ asyncore.close_all(ignore_all=True)
+ asyncore.socket_map.update(saved_map)
+
+ def resource_info(self):
+ for name in self.resources:
+ method_suffix = name.replace('.', '_')
+ get_name = 'get_' + method_suffix
+ restore_name = 'restore_' + method_suffix
+ yield name, getattr(self, get_name), getattr(self, restore_name)
+
+ def __enter__(self):
+ self.saved_values = dict((name, get()) for name, get, restore
+ in self.resource_info())
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ saved_values = self.saved_values
+ del self.saved_values
+ for name, get, restore in self.resource_info():
+ current = get()
+ original = saved_values.pop(name)
+ # Check for changes to the resource's value
+ if current != original:
+ self.changed = True
+ restore(original)
+ if not self.quiet:
+ print >>sys.stderr, (
+ "Warning -- {} was modified by {}".format(
+ name, self.testname))
+ if self.verbose > 1:
+ print >>sys.stderr, (
+ " Before: {}\n After: {} ".format(
+ original, current))
+ # XXX (ncoghlan): for most resources (e.g. sys.path) identity
+ # matters at least as much as value. For others (e.g. cwd),
+ # identity is irrelevant. Should we add a mechanism to check
+ # for substitution in the cases where it matters?
+ return False
+
+
+def runtest_inner(test, verbose, quiet, huntrleaks=False):
test_support.unload(test)
- if not testdir:
- testdir = findtestdir()
if verbose:
capture_stdout = None
else:
- capture_stdout = cStringIO.StringIO()
+ capture_stdout = StringIO.StringIO()
+ test_time = 0.0
+ refleak = False # True if the test leaked references.
try:
save_stdout = sys.stdout
try:
@@ -555,61 +865,71 @@ def runtest_inner(test, verbose, quiet, test_times,
else:
# Always import it from the test package
abstest = 'test.' + test
- start_time = time.time()
- the_package = __import__(abstest, globals(), locals(), [])
- the_module = getattr(the_package, test)
- # Old tests run to completion simply as a side-effect of
- # being imported. For tests based on unittest or doctest,
- # explicitly invoke their test_main() function (if it exists).
- indirect_test = getattr(the_module, "test_main", None)
- if indirect_test is not None:
- indirect_test()
- if huntrleaks:
- dash_R(the_module, test, indirect_test, huntrleaks)
- test_time = time.time() - start_time
- test_times.append((test_time, test))
+ with saved_test_environment(test, verbose, quiet) as environment:
+ start_time = time.time()
+ the_package = __import__(abstest, globals(), locals(), [])
+ the_module = getattr(the_package, test)
+ # Old tests run to completion simply as a side-effect of
+ # being imported. For tests based on unittest or doctest,
+ # explicitly invoke their test_main() function (if it exists).
+ indirect_test = getattr(the_module, "test_main", None)
+ if indirect_test is not None:
+ indirect_test()
+ if huntrleaks:
+ refleak = dash_R(the_module, test, indirect_test,
+ huntrleaks)
+ test_time = time.time() - start_time
finally:
sys.stdout = save_stdout
except test_support.ResourceDenied, msg:
if not quiet:
print test, "skipped --", msg
sys.stdout.flush()
- return -2
- except (ImportError, test_support.TestSkipped), msg:
+ return RESOURCE_DENIED, test_time
+ except unittest.SkipTest, msg:
if not quiet:
print test, "skipped --", msg
sys.stdout.flush()
- return -1
+ return SKIPPED, test_time
except KeyboardInterrupt:
raise
except test_support.TestFailed, msg:
- print "test", test, "failed --", msg
- sys.stdout.flush()
- return 0
+ print >>sys.stderr, "test", test, "failed --", msg
+ sys.stderr.flush()
+ return FAILED, test_time
except:
type, value = sys.exc_info()[:2]
- print "test", test, "crashed --", str(type) + ":", value
- sys.stdout.flush()
+ print >>sys.stderr, "test", test, "crashed --", str(type) + ":", value
+ sys.stderr.flush()
if verbose:
- traceback.print_exc(file=sys.stdout)
- sys.stdout.flush()
- return 0
+ traceback.print_exc(file=sys.stderr)
+ sys.stderr.flush()
+ return FAILED, test_time
else:
+ if refleak:
+ return FAILED, test_time
+ if environment.changed:
+ return ENV_CHANGED, test_time
# Except in verbose mode, tests should not print anything
if verbose or huntrleaks:
- return 1
+ return PASSED, test_time
output = capture_stdout.getvalue()
if not output:
- return 1
+ return PASSED, test_time
print "test", test, "produced unexpected output:"
print "*" * 70
print output
print "*" * 70
sys.stdout.flush()
- return 0
+ return FAILED, test_time
def cleanup_test_droppings(testname, verbose):
import shutil
+ import stat
+ import gc
+
+ # First kill any dangling references to open files etc.
+ gc.collect()
# Try to clean up junk commonly left behind. While tests shouldn't leave
# any files or directories behind, when a test fails that can be tedious
@@ -634,14 +954,23 @@ def cleanup_test_droppings(testname, verbose):
if verbose:
print "%r left behind %s %r" % (testname, kind, name)
try:
+ # if we have chmod, fix possible permissions problems
+ # that might prevent cleanup
+ if (hasattr(os, 'chmod')):
+ os.chmod(name, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
nuker(name)
except Exception, msg:
print >> sys.stderr, ("%r left behind %s %r and it couldn't be "
"removed: %s" % (testname, kind, name, msg))
def dash_R(the_module, test, indirect_test, huntrleaks):
+ """Run a test multiple times, looking for reference leaks.
+
+ Returns:
+ False if the test didn't leak references; True if we detected refleaks.
+ """
# This code is hackish and inelegant, but it seems to do the job.
- import copy_reg, _abcoll, io
+ import copy_reg, _abcoll, _pyio
if not hasattr(sys, 'gettotalrefcount'):
raise Exception("Tracking reference leaks requires a debug build "
@@ -651,8 +980,14 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
fs = warnings.filters[:]
ps = copy_reg.dispatch_table.copy()
pic = sys.path_importer_cache.copy()
+ try:
+ import zipimport
+ except ImportError:
+ zdc = None # Run unmodified on platforms without zipimport support
+ else:
+ zdc = zipimport._zip_directory_cache.copy()
abcs = {}
- modules = _abcoll, io
+ modules = _abcoll, _pyio
for abc in [getattr(mod, a) for mod in modules for a in mod.__all__]:
# XXX isinstance(abc, ABCMeta) leads to infinite recursion
if not hasattr(abc, '_abc_registry'):
@@ -669,26 +1004,30 @@ def dash_R(the_module, test, indirect_test, huntrleaks):
deltas = []
nwarmup, ntracked, fname = huntrleaks
+ fname = os.path.join(test_support.SAVEDCWD, fname)
repcount = nwarmup + ntracked
print >> sys.stderr, "beginning", repcount, "repetitions"
print >> sys.stderr, ("1234567890"*(repcount//10 + 1))[:repcount]
- dash_R_cleanup(fs, ps, pic, abcs)
+ dash_R_cleanup(fs, ps, pic, zdc, abcs)
for i in range(repcount):
- rc = sys.gettotalrefcount()
+ rc_before = sys.gettotalrefcount()
run_the_test()
sys.stderr.write('.')
- dash_R_cleanup(fs, ps, pic, abcs)
+ dash_R_cleanup(fs, ps, pic, zdc, abcs)
+ rc_after = sys.gettotalrefcount()
if i >= nwarmup:
- deltas.append(sys.gettotalrefcount() - rc - 2)
+ deltas.append(rc_after - rc_before)
print >> sys.stderr
if any(deltas):
msg = '%s leaked %s references, sum=%s' % (test, deltas, sum(deltas))
print >> sys.stderr, msg
- refrep = open(fname, "a")
- print >> refrep, msg
- refrep.close()
+ with open(fname, "a") as refrep:
+ print >> refrep, msg
+ refrep.flush()
+ return True
+ return False
-def dash_R_cleanup(fs, ps, pic, abcs):
+def dash_R_cleanup(fs, ps, pic, zdc, abcs):
import gc, copy_reg
import _strptime, linecache
dircache = test_support.import_module('dircache', deprecated=True)
@@ -707,6 +1046,13 @@ def dash_R_cleanup(fs, ps, pic, abcs):
copy_reg.dispatch_table.update(ps)
sys.path_importer_cache.clear()
sys.path_importer_cache.update(pic)
+ try:
+ import zipimport
+ except ImportError:
+ pass # Run unmodified on platforms without zipimport support
+ else:
+ zipimport._zip_directory_cache.clear()
+ zipimport._zip_directory_cache.update(zdc)
# clear type cache
sys._clear_type_cache()
@@ -734,18 +1080,16 @@ def dash_R_cleanup(fs, ps, pic, abcs):
# Collect cyclic trash.
gc.collect()
-def findtestdir():
- if __name__ == '__main__':
- file = sys.argv[0]
- else:
- file = __file__
- testdir = os.path.dirname(file) or os.curdir
- return testdir
+def findtestdir(path=None):
+ return path or os.path.dirname(__file__) or os.curdir
-def removepy(name):
- if name.endswith(os.extsep + "py"):
- name = name[:-3]
- return name
+def removepy(names):
+ if not names:
+ return
+ for idx, name in enumerate(names):
+ basename, ext = os.path.splitext(name)
+ if ext == '.py':
+ names[idx] = basename
def count(n, word):
if n == 1:
@@ -774,9 +1118,6 @@ def printlist(x, width=70, indent=4):
# test_pep277
# The _ExpectedSkips constructor adds this to the set of expected
# skips if not os.path.supports_unicode_filenames.
-# test_socket_ssl
-# Controlled by test_socket_ssl.skip_expected. Requires the network
-# resource, and a socket module with ssl support.
# test_timeout
# Controlled by test_timeout.skip_expected. Requires the network
# resource and a socket module.
@@ -827,41 +1168,6 @@ _expectations = {
test_kqueue
test_ossaudiodev
""",
- 'mac':
- """
- test_atexit
- test_bsddb
- test_bsddb185
- test_bsddb3
- test_bz2
- test_commands
- test_crypt
- test_curses
- test_dbm
- test_dl
- test_fcntl
- test_fork1
- test_epoll
- test_grp
- test_ioctl
- test_largefile
- test_locale
- test_kqueue
- test_mmap
- test_openpty
- test_ossaudiodev
- test_poll
- test_popen
- test_popen2
- test_posix
- test_pty
- test_pwd
- test_resource
- test_signal
- test_sundry
- test_tarfile
- test_timing
- """,
'unixware7':
"""
test_bsddb
@@ -953,6 +1259,7 @@ _expectations = {
test_bsddb3
test_curses
test_epoll
+ test_gdb
test_gdbm
test_largefile
test_locale
@@ -1053,9 +1360,11 @@ _expectations = {
test_ossaudiodev
test_pep277
test_pty
- test_socket_ssl
test_socketserver
test_tcl
+ test_tk
+ test_ttk_guionly
+ test_ttk_textonly
test_timeout
test_urllibnet
test_multiprocessing
@@ -1073,11 +1382,15 @@ _expectations = {
test_kqueue
test_ossaudiodev
test_tcl
+ test_tk
+ test_ttk_guionly
+ test_ttk_textonly
test_zipimport
test_zlib
""",
'openbsd3':
"""
+ test_ascii_formatd
test_bsddb
test_bsddb3
test_ctypes
@@ -1089,10 +1402,14 @@ _expectations = {
test_ossaudiodev
test_pep277
test_tcl
+ test_tk
+ test_ttk_guionly
+ test_ttk_textonly
test_multiprocessing
""",
'netbsd3':
"""
+ test_ascii_formatd
test_bsddb
test_bsddb185
test_bsddb3
@@ -1105,6 +1422,9 @@ _expectations = {
test_ossaudiodev
test_pep277
test_tcl
+ test_tk
+ test_ttk_guionly
+ test_ttk_textonly
test_multiprocessing
""",
}
@@ -1129,21 +1449,13 @@ class _ExpectedSkips:
if not os.path.supports_unicode_filenames:
self.expected.add('test_pep277')
- try:
- from test import test_socket_ssl
- except ImportError:
- pass
- else:
- if test_socket_ssl.skip_expected:
- self.expected.add('test_socket_ssl')
-
if test_timeout.skip_expected:
self.expected.add('test_timeout')
if sys.maxint == 9223372036854775807L:
self.expected.add('test_imageop')
- if not sys.platform in ("mac", "darwin"):
+ if sys.platform != "darwin":
MAC_ONLY = ["test_macos", "test_macostools", "test_aepack",
"test_plistlib", "test_scriptpackages",
"test_applesingle"]
@@ -1158,7 +1470,7 @@ class _ExpectedSkips:
# is distributed with Python
WIN_ONLY = ["test_unicode_file", "test_winreg",
"test_winsound", "test_startfile",
- "test_sqlite"]
+ "test_sqlite", "test_msilib"]
for skip in WIN_ONLY:
self.expected.add(skip)
@@ -1191,16 +1503,34 @@ class _ExpectedSkips:
return self.expected
if __name__ == '__main__':
- # Remove regrtest.py's own directory from the module search path. This
- # prevents relative imports from working, and relative imports will screw
- # up the testing framework. E.g. if both test.test_support and
- # test_support are imported, they will not contain the same globals, and
- # much of the testing framework relies on the globals in the
- # test.test_support module.
- mydir = os.path.abspath(os.path.normpath(os.path.dirname(sys.argv[0])))
- i = len(sys.path)
- while i >= 0:
- i -= 1
- if os.path.abspath(os.path.normpath(sys.path[i])) == mydir:
- del sys.path[i]
- main()
+ # findtestdir() gets the dirname out of __file__, so we have to make it
+ # absolute before changing the working directory.
+ # For example __file__ may be relative when running trace or profile.
+ # See issue #9323.
+ __file__ = os.path.abspath(__file__)
+
+ # sanity check
+ assert __file__ == os.path.abspath(sys.argv[0])
+
+ # When tests are run from the Python build directory, it is best practice
+ # to keep the test files in a subfolder. It eases the cleanup of leftover
+ # files using command "make distclean".
+ if sysconfig.is_python_build():
+ TEMPDIR = os.path.join(sysconfig.get_config_var('srcdir'), 'build')
+ TEMPDIR = os.path.abspath(TEMPDIR)
+ if not os.path.exists(TEMPDIR):
+ os.mkdir(TEMPDIR)
+
+ # Define a writable temp dir that will be used as cwd while running
+ # the tests. The name of the dir includes the pid to allow parallel
+ # testing (see the -j option).
+ TESTCWD = 'test_python_{}'.format(os.getpid())
+
+ TESTCWD = os.path.join(TEMPDIR, TESTCWD)
+
+ # Run the tests in a context manager that temporary changes the CWD to a
+ # temporary and writable directory. If it's not possible to create or
+ # change the CWD, the original CWD will be used. The original CWD is
+ # available from test_support.SAVEDCWD.
+ with test_support.temp_cwd(TESTCWD, quiet=True):
+ main()
diff --git a/Lib/test/script_helper.py b/Lib/test/script_helper.py
new file mode 100644
index 0000000000..337854af55
--- /dev/null
+++ b/Lib/test/script_helper.py
@@ -0,0 +1,164 @@
+# Common utility functions used by various script execution tests
+# e.g. test_cmd_line, test_cmd_line_script and test_runpy
+
+import sys
+import os
+import re
+import os.path
+import tempfile
+import subprocess
+import py_compile
+import contextlib
+import shutil
+import zipfile
+
+from test.test_support import strip_python_stderr
+
+# Executing the interpreter in a subprocess
+def _assert_python(expected_success, *args, **env_vars):
+ cmd_line = [sys.executable]
+ if not env_vars:
+ cmd_line.append('-E')
+ cmd_line.extend(args)
+ # Need to preserve the original environment, for in-place testing of
+ # shared library builds.
+ env = os.environ.copy()
+ env.update(env_vars)
+ p = subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ env=env)
+ try:
+ out, err = p.communicate()
+ finally:
+ subprocess._cleanup()
+ p.stdout.close()
+ p.stderr.close()
+ rc = p.returncode
+ err = strip_python_stderr(err)
+ if (rc and expected_success) or (not rc and not expected_success):
+ raise AssertionError(
+ "Process return code is %d, "
+ "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
+ return rc, out, err
+
+def assert_python_ok(*args, **env_vars):
+ """
+ Assert that running the interpreter with `args` and optional environment
+ variables `env_vars` is ok and return a (return code, stdout, stderr) tuple.
+ """
+ return _assert_python(True, *args, **env_vars)
+
+def assert_python_failure(*args, **env_vars):
+ """
+ Assert that running the interpreter with `args` and optional environment
+ variables `env_vars` fails and return a (return code, stdout, stderr) tuple.
+ """
+ return _assert_python(False, *args, **env_vars)
+
+def python_exit_code(*args):
+ cmd_line = [sys.executable, '-E']
+ cmd_line.extend(args)
+ with open(os.devnull, 'w') as devnull:
+ return subprocess.call(cmd_line, stdout=devnull,
+ stderr=subprocess.STDOUT)
+
+def spawn_python(*args, **kwargs):
+ cmd_line = [sys.executable, '-E']
+ cmd_line.extend(args)
+ return subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
+ **kwargs)
+
+def kill_python(p):
+ p.stdin.close()
+ data = p.stdout.read()
+ p.stdout.close()
+ # try to cleanup the child so we don't appear to leak when running
+ # with regrtest -R.
+ p.wait()
+ subprocess._cleanup()
+ return data
+
+def run_python(*args, **kwargs):
+ if __debug__:
+ p = spawn_python(*args, **kwargs)
+ else:
+ p = spawn_python('-O', *args, **kwargs)
+ stdout_data = kill_python(p)
+ return p.wait(), stdout_data
+
+# Script creation utilities
+@contextlib.contextmanager
+def temp_dir():
+ dirname = tempfile.mkdtemp()
+ dirname = os.path.realpath(dirname)
+ try:
+ yield dirname
+ finally:
+ shutil.rmtree(dirname)
+
+def make_script(script_dir, script_basename, source):
+ script_filename = script_basename+os.extsep+'py'
+ script_name = os.path.join(script_dir, script_filename)
+ script_file = open(script_name, 'w')
+ script_file.write(source)
+ script_file.close()
+ return script_name
+
+def compile_script(script_name):
+ py_compile.compile(script_name, doraise=True)
+ if __debug__:
+ compiled_name = script_name + 'c'
+ else:
+ compiled_name = script_name + 'o'
+ return compiled_name
+
+def make_zip_script(zip_dir, zip_basename, script_name, name_in_zip=None):
+ zip_filename = zip_basename+os.extsep+'zip'
+ zip_name = os.path.join(zip_dir, zip_filename)
+ zip_file = zipfile.ZipFile(zip_name, 'w')
+ if name_in_zip is None:
+ name_in_zip = os.path.basename(script_name)
+ zip_file.write(script_name, name_in_zip)
+ zip_file.close()
+ #if test.test_support.verbose:
+ # zip_file = zipfile.ZipFile(zip_name, 'r')
+ # print 'Contents of %r:' % zip_name
+ # zip_file.printdir()
+ # zip_file.close()
+ return zip_name, os.path.join(zip_name, name_in_zip)
+
+def make_pkg(pkg_dir):
+ os.mkdir(pkg_dir)
+ make_script(pkg_dir, '__init__', '')
+
+def make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
+ source, depth=1, compiled=False):
+ unlink = []
+ init_name = make_script(zip_dir, '__init__', '')
+ unlink.append(init_name)
+ init_basename = os.path.basename(init_name)
+ script_name = make_script(zip_dir, script_basename, source)
+ unlink.append(script_name)
+ if compiled:
+ init_name = compile_script(init_name)
+ script_name = compile_script(script_name)
+ unlink.extend((init_name, script_name))
+ pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)]
+ script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name))
+ zip_filename = zip_basename+os.extsep+'zip'
+ zip_name = os.path.join(zip_dir, zip_filename)
+ zip_file = zipfile.ZipFile(zip_name, 'w')
+ for name in pkg_names:
+ init_name_in_zip = os.path.join(name, init_basename)
+ zip_file.write(init_name, init_name_in_zip)
+ zip_file.write(script_name, script_name_in_zip)
+ zip_file.close()
+ for name in unlink:
+ os.unlink(name)
+ #if test.test_support.verbose:
+ # zip_file = zipfile.ZipFile(zip_name, 'r')
+ # print 'Contents of %r:' % zip_name
+ # zip_file.printdir()
+ # zip_file.close()
+ return zip_name, os.path.join(zip_name, script_name_in_zip)
diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py
index 14303aa4ad..f5e4e0ef55 100644
--- a/Lib/test/seq_tests.py
+++ b/Lib/test/seq_tests.py
@@ -131,8 +131,8 @@ class CommonTest(unittest.TestCase):
self.assertRaises(ZeroDivisionError, self.type2test, IterGenExc(s))
def test_truth(self):
- self.assert_(not self.type2test())
- self.assert_(self.type2test([42]))
+ self.assertFalse(self.type2test())
+ self.assertTrue(self.type2test([42]))
def test_getitem(self):
u = self.type2test([0, 1, 2, 3, 4])
@@ -201,9 +201,9 @@ class CommonTest(unittest.TestCase):
def test_contains(self):
u = self.type2test([0, 1, 2])
for i in u:
- self.assert_(i in u)
+ self.assertIn(i, u)
for i in min(u)-1, max(u)+1:
- self.assert_(i not in u)
+ self.assertNotIn(i, u)
self.assertRaises(TypeError, u.__contains__)
@@ -215,8 +215,8 @@ class CommonTest(unittest.TestCase):
def __eq__(self, other):
return True
__hash__ = None # Can't meet hash invariant requirements
- self.assert_(AllEq() not in self.type2test([]))
- self.assert_(AllEq() in self.type2test([1]))
+ self.assertNotIn(AllEq(), self.type2test([]))
+ self.assertIn(AllEq(), self.type2test([1]))
def test_contains_order(self):
# Sequences must test in-order. If a rich comparison has side
@@ -229,7 +229,7 @@ class CommonTest(unittest.TestCase):
raise DoNotTestEq
checkfirst = self.type2test([1, StopCompares()])
- self.assert_(1 in checkfirst)
+ self.assertIn(1, checkfirst)
checklast = self.type2test([StopCompares(), 1])
self.assertRaises(DoNotTestEq, checklast.__contains__, 1)
@@ -270,7 +270,7 @@ class CommonTest(unittest.TestCase):
pass
u3 = subclass([0, 1])
self.assertEqual(u3, u3*1)
- self.assert_(u3 is not u3*1)
+ self.assertIsNot(u3, u3*1)
def test_iadd(self):
u = self.type2test([0, 1])
diff --git a/Lib/test/sha256.pem b/Lib/test/sha256.pem
index 01878e9678..d488e6d09f 100644
--- a/Lib/test/sha256.pem
+++ b/Lib/test/sha256.pem
@@ -1,33 +1,129 @@
+# Certificate chain for https://sha256.tbs-internet.com
+ 0 s:/C=FR/postalCode=14000/ST=Calvados/L=CAEN/street=22 rue de Bretagne/O=TBS INTERNET/OU=0002 440443810/OU=sha-256 production/CN=sha256.tbs-internet.com
+ i:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions: http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA SGC
-----BEGIN CERTIFICATE-----
-MIIFxzCCA6+gAwIBAgIJALnlnf5uzTkIMA0GCSqGSIb3DQEBCwUAMEsxCzAJBgNV
-BAYTAkRFMRcwFQYDVQQKEw5zY2hva29rZWtzLm9yZzEjMCEGCSqGSIb3DQEJARYU
-aGFubm9Ac2Nob2tva2Vrcy5vcmcwHhcNMTAwMTI3MDAyMTI1WhcNMjAwMTI1MDAy
-MTI1WjBLMQswCQYDVQQGEwJERTEXMBUGA1UEChMOc2Nob2tva2Vrcy5vcmcxIzAh
-BgkqhkiG9w0BCQEWFGhhbm5vQHNjaG9rb2tla3Mub3JnMIICIjANBgkqhkiG9w0B
-AQEFAAOCAg8AMIICCgKCAgEApJ4ODPwEooMW35dQPlBqdvcfkEvjhcsA7jmJfFqN
-e/1T34zT44X9+KnMBSG2InacbD7eyFgjfaENFsZ87YkEBDIFZ/SHotLJZORQ8PUj
-YoxPG4mjKN+yL2WthNcYbRyJreTbbDroNMuw6tkTSxeSXyYFQrKMCUfErVbZa/d5
-RvfFVk+Au9dVUFhed/Stn5cv+a0ffvpyA7ygihm1kMFICbvPeI0846tmC2Ph7rM5
-pYQyNBDOVpULODTk5Wu6jiiJJygvJWCZ1FdpsdBs5aKWHWdRhX++quGuflTTjH5d
-qaIka4op9H7XksYphTDXmV+qHnva5jbPogwutDQcVsGBQcJaLmQqhsQK13bf4khE
-iWJvfBLfHn8OOpY25ZwwuigJIwifNCxQeeT1FrLmyuYNhz2phPpzx065kqSUSR+A
-Iw8DPE6e65UqMDKqZnID3dQeiQaFrHEV+Ibo0U/tD0YSBw5p33TMh0Es33IBWMac
-m7x4hIFWdhl8W522u6qOrTswY3s8vB7blNWqMc9n7oWH8ybFf7EgKeDVtEN9AyBE
-0WotXIEZWI+WvDbU1ACJXau9sQhYP/eerg7Zwr3iGUy4IQ5oUJibnjtcE+z8zmDN
-pE6YcMCLJyLjXiQ3iHG9mNXzw7wPnslTbEEEukrfSlHGgW8Dm+VrNyW0JUM1bntx
-vbMCAwEAAaOBrTCBqjAdBgNVHQ4EFgQUCedv7pDTuXtCxm4HTw9hUtrTvsowewYD
-VR0jBHQwcoAUCedv7pDTuXtCxm4HTw9hUtrTvsqhT6RNMEsxCzAJBgNVBAYTAkRF
-MRcwFQYDVQQKEw5zY2hva29rZWtzLm9yZzEjMCEGCSqGSIb3DQEJARYUaGFubm9A
-c2Nob2tva2Vrcy5vcmeCCQC55Z3+bs05CDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3
-DQEBCwUAA4ICAQBHKAxA7WA/MEFjet03K8ouzEOr6Jrk2fZOuRhoDZ+9gr4FtaJB
-P3Hh5D00kuSOvDnwsvCohxeNd1KTMAwVmVoH+NZkHERn3UXniUENlp18koI1ehlr
-CZbXbzzE9Te9BelliSFA63q0cq0yJN1x9GyabU34XkAouCAmOqfSpKNZWZHGBHPF
-bbYnZrHEMcsye6vKeTOcg1GqUHGrQM2WK0QaOwnCQv2RblI9VN+SeRoUJ44qTXdW
-TwIYStsIPesacNcAQTStnHgKqIPx4zCwdx5xo8zONbXJfocqwyFqiAofvb9dN1nW
-g1noVBcXB+oRBZW5CjFw87U88itq39i9+BWl835DWLBW2pVmx1QTLGv0RNgs/xVx
-mWnjH4nNHvrjn6pRmqHZTk/SS0Hkl2qtDsynVxIl8EiMTfWSU3DBTuD2J/RSzuOE
-eKtAbaoXkXE31jCl4FEZLITIZd8UkXacb9rN304tAK92L76JOAV+xOZxFRipmvx4
-+A9qQXgLhtP4VaDajb44V/kCKPSA0Vm3apehke9Wl8dDtagfos1e6MxSu3EVLXRF
-SP2U777V77pdMSd0f/7cerKn5FjrxW1v1FaP1oIGniMk4qQNTgA/jvvhjybsPlVA
-jsfnhWGbh1voJa0RQcMiRMsxpw2P1KNOEu37W2eq/vFghVztZJQUmb5iNw==
+MIIGXTCCBUWgAwIBAgIRAMmag+ygSAdxZsbyzYjhuW0wDQYJKoZIhvcNAQELBQAw
+gcQxCzAJBgNVBAYTAkZSMREwDwYDVQQIEwhDYWx2YWRvczENMAsGA1UEBxMEQ2Fl
+bjEVMBMGA1UEChMMVEJTIElOVEVSTkVUMUgwRgYDVQQLEz9UZXJtcyBhbmQgQ29u
+ZGl0aW9uczogaHR0cDovL3d3dy50YnMtaW50ZXJuZXQuY29tL0NBL3JlcG9zaXRv
+cnkxGDAWBgNVBAsTD1RCUyBJTlRFUk5FVCBDQTEYMBYGA1UEAxMPVEJTIFg1MDkg
+Q0EgU0dDMB4XDTEwMDIxODAwMDAwMFoXDTEyMDIxOTIzNTk1OVowgcsxCzAJBgNV
+BAYTAkZSMQ4wDAYDVQQREwUxNDAwMDERMA8GA1UECBMIQ2FsdmFkb3MxDTALBgNV
+BAcTBENBRU4xGzAZBgNVBAkTEjIyIHJ1ZSBkZSBCcmV0YWduZTEVMBMGA1UEChMM
+VEJTIElOVEVSTkVUMRcwFQYDVQQLEw4wMDAyIDQ0MDQ0MzgxMDEbMBkGA1UECxMS
+c2hhLTI1NiBwcm9kdWN0aW9uMSAwHgYDVQQDExdzaGEyNTYudGJzLWludGVybmV0
+LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbuM8VT7f0nntwu
+N3F7v9KIBlhKNAxqCrziOXU5iqUt8HrQB3DtHbdmII+CpVUlwlmepsx6G+srEZ9a
+MIGAy0nxi5aLb7watkyIdPjJTMvTUBQ/+RPWzt5JtYbbY9BlJ+yci0dctP74f4NU
+ISLtlrEjUbf2gTohLrcE01TfmOF6PDEbB5PKDi38cB3NzKfizWfrOaJW6Q1C1qOJ
+y4/4jkUREX1UFUIxzx7v62VfjXSGlcjGpBX1fvtABQOSLeE0a6gciDZs1REqroFf
+5eXtqYphpTa14Z83ITXMfgg5Nze1VtMnzI9Qx4blYBw4dgQVEuIsYr7FDBOITDzc
+VEVXZx0CAwEAAaOCAj8wggI7MB8GA1UdIwQYMBaAFAdEdoWTKLx/bXjSCuv6TEvf
+2YIfMB0GA1UdDgQWBBSJKI/AYVI9RQNY0QPIqc8ej2QivTAOBgNVHQ8BAf8EBAMC
+BaAwDAYDVR0TAQH/BAIwADA0BgNVHSUELTArBggrBgEFBQcDAQYIKwYBBQUHAwIG
+CisGAQQBgjcKAwMGCWCGSAGG+EIEATBMBgNVHSAERTBDMEEGCysGAQQBgOU3AgQB
+MDIwMAYIKwYBBQUHAgEWJGh0dHBzOi8vd3d3LnRicy1pbnRlcm5ldC5jb20vQ0Ev
+Q1BTNDBtBgNVHR8EZjBkMDKgMKAuhixodHRwOi8vY3JsLnRicy1pbnRlcm5ldC5j
+b20vVEJTWDUwOUNBU0dDLmNybDAuoCygKoYoaHR0cDovL2NybC50YnMteDUwOS5j
+b20vVEJTWDUwOUNBU0dDLmNybDCBpgYIKwYBBQUHAQEEgZkwgZYwOAYIKwYBBQUH
+MAKGLGh0dHA6Ly9jcnQudGJzLWludGVybmV0LmNvbS9UQlNYNTA5Q0FTR0MuY3J0
+MDQGCCsGAQUFBzAChihodHRwOi8vY3J0LnRicy14NTA5LmNvbS9UQlNYNTA5Q0FT
+R0MuY3J0MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC50YnMteDUwOS5jb20wPwYD
+VR0RBDgwNoIXc2hhMjU2LnRicy1pbnRlcm5ldC5jb22CG3d3dy5zaGEyNTYudGJz
+LWludGVybmV0LmNvbTANBgkqhkiG9w0BAQsFAAOCAQEAA5NL0D4QSqhErhlkdPmz
+XtiMvdGL+ZehM4coTRIpasM/Agt36Rc0NzCvnQwKE+wkngg1Gy2qe7Q0E/ziqBtB
+fZYzdVgu1zdiL4kTaf+wFKYAFGsFbyeEmXysy+CMwaNoF2vpSjCU1UD56bEnTX/W
+fxVZYxtBQUpnu2wOsm8cDZuZRv9XrYgAhGj9Tt6F0aVHSDGn59uwShG1+BVF/uju
+SCyPTTjL1oc7YElJUzR/x4mQJYvtQI8gDIDAGEOs7v3R/gKa5EMfbUQUI4C84UbI
+Yz09Jdnws/MkC/Hm1BZEqk89u7Hvfv+oHqEb0XaUo0TDfsxE0M1sMdnLb91QNQBm
+UQ==
+-----END CERTIFICATE-----
+ 1 s:/C=FR/ST=Calvados/L=Caen/O=TBS INTERNET/OU=Terms and Conditions: http://www.tbs-internet.com/CA/repository/OU=TBS INTERNET CA/CN=TBS X509 CA SGC
+ i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
+-----BEGIN CERTIFICATE-----
+MIIFVjCCBD6gAwIBAgIQXpDZ0ETJMV02WTx3GTnhhTANBgkqhkiG9w0BAQUFADBv
+MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFk
+ZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBF
+eHRlcm5hbCBDQSBSb290MB4XDTA1MTIwMTAwMDAwMFoXDTE5MDYyNDE5MDYzMFow
+gcQxCzAJBgNVBAYTAkZSMREwDwYDVQQIEwhDYWx2YWRvczENMAsGA1UEBxMEQ2Fl
+bjEVMBMGA1UEChMMVEJTIElOVEVSTkVUMUgwRgYDVQQLEz9UZXJtcyBhbmQgQ29u
+ZGl0aW9uczogaHR0cDovL3d3dy50YnMtaW50ZXJuZXQuY29tL0NBL3JlcG9zaXRv
+cnkxGDAWBgNVBAsTD1RCUyBJTlRFUk5FVCBDQTEYMBYGA1UEAxMPVEJTIFg1MDkg
+Q0EgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsgOkO3f7wzN6
+rOjg45tR5vjBfzK7qmV9IBxb/QW9EEXxG+E7FNhZqQLtwGBKoSsHTnQqV75wWMk0
+9tinWvftBkSpj5sTi/8cbzJfUvTSVYh3Qxv6AVVjMMH/ruLjE6y+4PoaPs8WoYAQ
+ts5R4Z1g8c/WnTepLst2x0/Wv7GmuoQi+gXvHU6YrBiu7XkeYhzc95QdviWSJRDk
+owhb5K43qhcvjRmBfO/paGlCliDGZp8mHwrI21mwobWpVjTxZRwYO3bd4+TGcI4G
+Ie5wmHwE8F7SK1tgSqbBacKjDa93j7txKkfz/Yd2n7TGqOXiHPsJpG655vrKtnXk
+9vs1zoDeJQIDAQABo4IBljCCAZIwHQYDVR0OBBYEFAdEdoWTKLx/bXjSCuv6TEvf
+2YIfMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMCAGA1UdJQQZ
+MBcGCisGAQQBgjcKAwMGCWCGSAGG+EIEATAYBgNVHSAEETAPMA0GCysGAQQBgOU3
+AgQBMHsGA1UdHwR0MHIwOKA2oDSGMmh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0Fk
+ZFRydXN0RXh0ZXJuYWxDQVJvb3QuY3JsMDagNKAyhjBodHRwOi8vY3JsLmNvbW9k
+by5uZXQvQWRkVHJ1c3RFeHRlcm5hbENBUm9vdC5jcmwwgYAGCCsGAQUFBwEBBHQw
+cjA4BggrBgEFBQcwAoYsaHR0cDovL2NydC5jb21vZG9jYS5jb20vQWRkVHJ1c3RV
+VE5TR0NDQS5jcnQwNgYIKwYBBQUHMAKGKmh0dHA6Ly9jcnQuY29tb2RvLm5ldC9B
+ZGRUcnVzdFVUTlNHQ0NBLmNydDARBglghkgBhvhCAQEEBAMCAgQwDQYJKoZIhvcN
+AQEFBQADggEBAK2zEzs+jcIrVK9oDkdDZNvhuBYTdCfpxfFs+OAujW0bIfJAy232
+euVsnJm6u/+OrqKudD2tad2BbejLLXhMZViaCmK7D9nrXHx4te5EP8rL19SUVqLY
+1pTnv5dhNgEgvA7n5lIzDSYs7yRLsr7HJsYPr6SeYSuZizyX1SNz7ooJ32/F3X98
+RB0Mlc/E0OyOrkQ9/y5IrnpnaSora8CnUrV5XNOg+kyCz9edCyx4D5wXYcwZPVWz
+8aDqquESrezPyjtfi4WRO4s/VD3HLZvOxzMrWAVYCDG9FxaOhF0QGuuG1F7F3GKV
+v6prNyCl016kRl2j1UT+a7gLd8fA25A4C9E=
+-----END CERTIFICATE-----
+ 2 s:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
+ i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC
+-----BEGIN CERTIFICATE-----
+MIIEZjCCA06gAwIBAgIQUSYKkxzif5zDpV954HKugjANBgkqhkiG9w0BAQUFADCB
+kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw
+IFNHQzAeFw0wNTA2MDcwODA5MTBaFw0xOTA2MjQxOTA2MzBaMG8xCzAJBgNVBAYT
+AlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0
+ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB
+IFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC39xoz5vIABC05
+4E5b7R+8bA/Ntfojts7emxEzl6QpTH2Tn71KvJPtAxrjj8/lbVBa1pcplFqAsEl6
+2y6V/bjKvzc4LR4+kUGtcFbH8E8/6DKedMrIkFTpxl8PeJ2aQDwOrGGqXhSPnoeh
+alDc15pOrwWzpnGUnHGzUGAKxxOdOAeGAqjpqGkmGJCrTLBPI6s6T4TY386f4Wlv
+u9dC12tE5Met7m1BX3JacQg3s3llpFmglDf3AC8NwpJy2tA4ctsUqEXEXSp9t7TW
+xO6szRNEt8kr3UMAJfphuWlqWCMRt6czj1Z1WfXNKddGtworZbbTQm8Vsrh7++/p
+XVPVNFonAgMBAAGjgdgwgdUwHwYDVR0jBBgwFoAUUzLRs89/+uDxoF2FTpLSnkUd
+tE8wHQYDVR0OBBYEFK29mHo0tCb3+sQmVO8DveAky1QaMA4GA1UdDwEB/wQEAwIB
+BjAPBgNVHRMBAf8EBTADAQH/MBEGCWCGSAGG+EIBAQQEAwIBAjAgBgNVHSUEGTAX
+BgorBgEEAYI3CgMDBglghkgBhvhCBAEwPQYDVR0fBDYwNDAyoDCgLoYsaHR0cDov
+L2NybC51c2VydHJ1c3QuY29tL1VUTi1EQVRBQ29ycFNHQy5jcmwwDQYJKoZIhvcN
+AQEFBQADggEBAMbuUxdoFLJRIh6QWA2U/b3xcOWGLcM2MY9USEbnLQg3vGwKYOEO
+rVE04BKT6b64q7gmtOmWPSiPrmQH/uAB7MXjkesYoPF1ftsK5p+R26+udd8jkWjd
+FwBaS/9kbHDrARrQkNnHptZt9hPk/7XJ0h4qy7ElQyZ42TCbTg0evmnv3+r+LbPM
++bDdtRTKkdSytaX7ARmjR3mfnYyVhzT4HziS2jamEfpr62vp3EV4FTkG101B5CHI
+3C+H0be/SGB1pWLLJN47YaApIKa+xWycxOkKaSLvkTr6Jq/RW0GnOuL4OAdCq8Fb
++M5tug8EPzI0rNwEKNdwMBQmBsTkm5jVz3g=
+-----END CERTIFICATE-----
+ 3 s:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC
+ i:/C=US/ST=UT/L=Salt Lake City/O=The USERTRUST Network/OU=http://www.usertrust.com/CN=UTN - DATACorp SGC
+-----BEGIN CERTIFICATE-----
+MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB
+kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
+Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
+dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw
+IFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG
+EwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD
+VQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu
+dXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN
+BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6
+E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ
+D0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK
+4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq
+lXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW
+bfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB
+o4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT
+MtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js
+LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr
+BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB
+AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft
+Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj
+j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH
+KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv
+2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3
+mfnGV/TJVTl4uix5yaaIK/QI
-----END CERTIFICATE-----
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index 7e214ebfbf..5931f3d88b 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -62,7 +62,7 @@ class CommonTest(unittest.TestCase):
pass
object = subtype(object)
realresult = getattr(object, methodname)(*args)
- self.assert_(object is not realresult)
+ self.assertTrue(object is not realresult)
# check that object.method(*args) raises exc
def checkraises(self, exc, object, methodname, *args):
@@ -185,6 +185,9 @@ class CommonTest(unittest.TestCase):
self.checkequal(-1, '', 'find', 'xx', 1, 1)
self.checkequal(-1, '', 'find', 'xx', sys.maxint, 0)
+ # issue 7458
+ self.checkequal(-1, 'ab', 'find', 'xxx', sys.maxsize + 1, 0)
+
# For a variety of combinations,
# verify that str.find() matches __contains__
# and that the found substring is really at that location
@@ -205,8 +208,7 @@ class CommonTest(unittest.TestCase):
loc = i.find(j)
r1 = (loc != -1)
r2 = j in i
- if r1 != r2:
- self.assertEqual(r1, r2)
+ self.assertEqual(r1, r2)
if loc != -1:
self.assertEqual(i[loc:loc+len(j)], j)
@@ -230,6 +232,33 @@ class CommonTest(unittest.TestCase):
self.checkraises(TypeError, 'hello', 'rfind')
self.checkraises(TypeError, 'hello', 'rfind', 42)
+ # For a variety of combinations,
+ # verify that str.rfind() matches __contains__
+ # and that the found substring is really at that location
+ charset = ['', 'a', 'b', 'c']
+ digits = 5
+ base = len(charset)
+ teststrings = set()
+ for i in xrange(base ** digits):
+ entry = []
+ for j in xrange(digits):
+ i, m = divmod(i, base)
+ entry.append(charset[m])
+ teststrings.add(''.join(entry))
+ teststrings = list(teststrings)
+ for i in teststrings:
+ i = self.fixtype(i)
+ for j in teststrings:
+ loc = i.rfind(j)
+ r1 = (loc != -1)
+ r2 = j in i
+ self.assertEqual(r1, r2)
+ if loc != -1:
+ self.assertEqual(i[loc:loc+len(j)], self.fixtype(j))
+
+ # issue 7458
+ self.checkequal(-1, 'ab', 'rfind', 'xxx', sys.maxsize + 1, 0)
+
def test_index(self):
self.checkequal(0, 'abcdefghiabc', 'index', '')
self.checkequal(3, 'abcdefghiabc', 'index', 'def')
@@ -686,7 +715,7 @@ class CommonTest(unittest.TestCase):
EQ("bobobXbobob", "bobobobXbobobob", "replace", "bobob", "bob")
EQ("BOBOBOB", "BOBOBOB", "replace", "bob", "bobby")
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
ba = buffer('a')
bb = buffer('b')
EQ("bbc", "abc", "replace", ba, bb)
@@ -1090,15 +1119,8 @@ class MixinStrUnicodeUserStringTest:
format = '%%.%if' % prec
value = 0.01
for x in xrange(60):
- value = value * 3.141592655 / 3.0 * 10.0
- # The formatfloat() code in stringobject.c and
- # unicodeobject.c uses a 120 byte buffer and switches from
- # 'f' formatting to 'g' at precision 50, so we expect
- # OverflowErrors for the ranges x < 50 and prec >= 67.
- if x < 50 and prec >= 67:
- self.checkraises(OverflowError, format, "__mod__", value)
- else:
- self.checkcall(format, "__mod__", value)
+ value = value * 3.14159265359 / 3.0 * 10.0
+ self.checkcall(format, "__mod__", value)
def test_inplace_rewrites(self):
# Check that strings don't copy and modify cached single-character strings
@@ -1155,6 +1177,63 @@ class MixinStrUnicodeUserStringTest:
# mixed use of str and unicode
self.assertEqual('a/b/c'.rpartition(u'/'), ('a/b', '/', 'c'))
+ def test_none_arguments(self):
+ # issue 11828
+ s = 'hello'
+ self.checkequal(2, s, 'find', 'l', None)
+ self.checkequal(3, s, 'find', 'l', -2, None)
+ self.checkequal(2, s, 'find', 'l', None, -2)
+ self.checkequal(0, s, 'find', 'h', None, None)
+
+ self.checkequal(3, s, 'rfind', 'l', None)
+ self.checkequal(3, s, 'rfind', 'l', -2, None)
+ self.checkequal(2, s, 'rfind', 'l', None, -2)
+ self.checkequal(0, s, 'rfind', 'h', None, None)
+
+ self.checkequal(2, s, 'index', 'l', None)
+ self.checkequal(3, s, 'index', 'l', -2, None)
+ self.checkequal(2, s, 'index', 'l', None, -2)
+ self.checkequal(0, s, 'index', 'h', None, None)
+
+ self.checkequal(3, s, 'rindex', 'l', None)
+ self.checkequal(3, s, 'rindex', 'l', -2, None)
+ self.checkequal(2, s, 'rindex', 'l', None, -2)
+ self.checkequal(0, s, 'rindex', 'h', None, None)
+
+ self.checkequal(2, s, 'count', 'l', None)
+ self.checkequal(1, s, 'count', 'l', -2, None)
+ self.checkequal(1, s, 'count', 'l', None, -2)
+ self.checkequal(0, s, 'count', 'x', None, None)
+
+ self.checkequal(True, s, 'endswith', 'o', None)
+ self.checkequal(True, s, 'endswith', 'lo', -2, None)
+ self.checkequal(True, s, 'endswith', 'l', None, -2)
+ self.checkequal(False, s, 'endswith', 'x', None, None)
+
+ self.checkequal(True, s, 'startswith', 'h', None)
+ self.checkequal(True, s, 'startswith', 'l', -2, None)
+ self.checkequal(True, s, 'startswith', 'h', None, -2)
+ self.checkequal(False, s, 'startswith', 'x', None, None)
+
+ def test_find_etc_raise_correct_error_messages(self):
+ # issue 11828
+ s = 'hello'
+ x = 'x'
+ self.assertRaisesRegexp(TypeError, r'\bfind\b', s.find,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'\brfind\b', s.rfind,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'\bindex\b', s.index,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'\brindex\b', s.rindex,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'^count\(', s.count,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'^startswith\(', s.startswith,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'^endswith\(', s.endswith,
+ x, None, None, None)
+
class MixinStrStringUserStringTest:
# Additional tests for 8bit strings, i.e. str, UserString and
# the string module
@@ -1221,34 +1300,34 @@ class MixinStrUnicodeTest:
pass
s1 = subclass("abcd")
s2 = t().join([s1])
- self.assert_(s1 is not s2)
- self.assert_(type(s2) is t)
+ self.assertTrue(s1 is not s2)
+ self.assertTrue(type(s2) is t)
s1 = t("abcd")
s2 = t().join([s1])
- self.assert_(s1 is s2)
+ self.assertTrue(s1 is s2)
# Should also test mixed-type join.
if t is unicode:
s1 = subclass("abcd")
s2 = "".join([s1])
- self.assert_(s1 is not s2)
- self.assert_(type(s2) is t)
+ self.assertTrue(s1 is not s2)
+ self.assertTrue(type(s2) is t)
s1 = t("abcd")
s2 = "".join([s1])
- self.assert_(s1 is s2)
+ self.assertTrue(s1 is s2)
elif t is str:
s1 = subclass("abcd")
s2 = u"".join([s1])
- self.assert_(s1 is not s2)
- self.assert_(type(s2) is unicode) # promotes!
+ self.assertTrue(s1 is not s2)
+ self.assertTrue(type(s2) is unicode) # promotes!
s1 = t("abcd")
s2 = u"".join([s1])
- self.assert_(s1 is not s2)
- self.assert_(type(s2) is unicode) # promotes!
+ self.assertTrue(s1 is not s2)
+ self.assertTrue(type(s2) is unicode) # promotes!
else:
self.fail("unexpected type for MixinStrUnicodeTest %r" % t)
diff --git a/Lib/test/subprocessdata/sigchild_ignore.py b/Lib/test/subprocessdata/sigchild_ignore.py
new file mode 100644
index 0000000000..6072aece28
--- /dev/null
+++ b/Lib/test/subprocessdata/sigchild_ignore.py
@@ -0,0 +1,6 @@
+import signal, subprocess, sys
+# On Linux this causes os.waitpid to fail with OSError as the OS has already
+# reaped our child process. The wait() passing the OSError on to the caller
+# and causing us to exit with an error is what we are testing against.
+signal.signal(signal.SIGCHLD, signal.SIG_IGN)
+subprocess.Popen([sys.executable, '-c', 'print("albatross")']).wait()
diff --git a/Lib/test/test_SimpleHTTPServer.py b/Lib/test/test_SimpleHTTPServer.py
index 9d3ad16be6..66ec853684 100644
--- a/Lib/test/test_SimpleHTTPServer.py
+++ b/Lib/test/test_SimpleHTTPServer.py
@@ -21,17 +21,17 @@ class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
def test_queryArguments (self):
path = self.handler.translate_path ('/filename')
- self.assertEquals (path, self.translated)
+ self.assertEqual (path, self.translated)
path = self.handler.translate_path ('/filename?foo=bar')
- self.assertEquals (path, self.translated)
+ self.assertEqual (path, self.translated)
path = self.handler.translate_path ('/filename?a=b&spam=eggs#zot')
- self.assertEquals (path, self.translated)
+ self.assertEqual (path, self.translated)
def test_startWithDoubleSlash (self):
path = self.handler.translate_path ('//filename')
- self.assertEquals (path, self.translated)
+ self.assertEqual (path, self.translated)
path = self.handler.translate_path ('//filename?foo=bar')
- self.assertEquals (path, self.translated)
+ self.assertEqual (path, self.translated)
def test_main():
diff --git a/Lib/test/test_StringIO.py b/Lib/test/test_StringIO.py
index 47a07150c5..4774c6dbf1 100644
--- a/Lib/test/test_StringIO.py
+++ b/Lib/test/test_StringIO.py
@@ -87,7 +87,7 @@ class TestGenericStringIO(unittest.TestCase):
def test_iterator(self):
eq = self.assertEqual
- unless = self.failUnless
+ unless = self.assertTrue
eq(iter(self._fp), self._fp)
# Does this object support the iteration protocol?
unless(hasattr(self._fp, '__iter__'))
@@ -138,7 +138,7 @@ class TestBuffercStringIO(TestcStringIO):
def test_main():
test_support.run_unittest(TestStringIO, TestcStringIO)
- with test_support._check_py3k_warnings(("buffer.. not supported",
+ with test_support.check_py3k_warnings(("buffer.. not supported",
DeprecationWarning)):
test_support.run_unittest(TestBufferStringIO, TestBuffercStringIO)
diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py
index 2a7bc63fdc..2c5dbefb3a 100644
--- a/Lib/test/test___all__.py
+++ b/Lib/test/test___all__.py
@@ -4,7 +4,12 @@ import unittest
from test import test_support as support
import os
import sys
-import warnings
+
+# Setup bsddb warnings
+try:
+ bsddb = support.import_module('bsddb', deprecated=True)
+except unittest.SkipTest:
+ pass
class NoAll(RuntimeError):
@@ -18,9 +23,8 @@ class AllTest(unittest.TestCase):
def check_all(self, modname):
names = {}
- with warnings.catch_warnings():
- warnings.filterwarnings("ignore", ".* (module|package)",
- DeprecationWarning)
+ with support.check_warnings((".* (module|package)",
+ DeprecationWarning), quiet=True):
try:
exec "import %s" % modname in names
except:
@@ -35,7 +39,7 @@ class AllTest(unittest.TestCase):
exec "from %s import *" % modname in names
except Exception as e:
# Include the module name in the exception string
- self.fail("__all__ failure in {0}: {1}: {2}".format(
+ self.fail("__all__ failure in {}: {}: {}".format(
modname, e.__class__.__name__, e))
if "__builtins__" in names:
del names["__builtins__"]
diff --git a/Lib/test/test___future__.py b/Lib/test/test___future__.py
index 50a2c74ad0..1d8f8e6852 100644
--- a/Lib/test/test___future__.py
+++ b/Lib/test/test___future__.py
@@ -15,7 +15,7 @@ class FutureTest(unittest.TestCase):
for name in dir(__future__):
obj = getattr(__future__, name, None)
if obj is not None and isinstance(obj, __future__._Feature):
- self.assert_(
+ self.assertTrue(
name in given_feature_names,
"%r should have been in all_feature_names" % name
)
@@ -30,7 +30,7 @@ class FutureTest(unittest.TestCase):
optional = value.getOptionalRelease()
mandatory = value.getMandatoryRelease()
- a = self.assert_
+ a = self.assertTrue
e = self.assertEqual
def check(t, name):
a(isinstance(t, tuple), "%s isn't tuple" % name)
@@ -53,9 +53,12 @@ class FutureTest(unittest.TestCase):
a(hasattr(value, "compiler_flag"),
"feature is missing a .compiler_flag attr")
+ # Make sure the compile accepts the flag.
+ compile("", "<test>", "exec", value.compiler_flag)
a(isinstance(getattr(value, "compiler_flag"), int),
".compiler_flag isn't int")
+
def test_main():
test_support.run_unittest(FutureTest)
diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py
index 69fc6253b4..afcb92635d 100644
--- a/Lib/test/test__locale.py
+++ b/Lib/test/test__locale.py
@@ -1,13 +1,18 @@
-from test.test_support import verbose, TestSkipped, run_unittest
-from _locale import (setlocale, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo,
- localeconv, Error)
+from test.test_support import run_unittest
+from _locale import (setlocale, LC_NUMERIC, localeconv, Error)
+try:
+ from _locale import (RADIXCHAR, THOUSEP, nl_langinfo)
+except ImportError:
+ nl_langinfo = None
+
import unittest
+import sys
from platform import uname
if uname()[0] == "Darwin":
maj, min, mic = [int(part) for part in uname()[2].split(".")]
if (maj, min, mic) < (8, 0, 0):
- raise TestSkipped("locale support broken for OS X < 10.4")
+ raise unittest.SkipTest("locale support broken for OS X < 10.4")
candidate_locales = ['es_UY', 'fr_FR', 'fi_FI', 'es_CO', 'pt_PT', 'it_IT',
'et_EE', 'es_PY', 'no_NO', 'nl_NL', 'lv_LV', 'el_GR', 'be_BY', 'fr_BE',
@@ -20,6 +25,13 @@ candidate_locales = ['es_UY', 'fr_FR', 'fi_FI', 'es_CO', 'pt_PT', 'it_IT',
'eu_ES', 'vi_VN', 'af_ZA', 'nb_NO', 'en_DK', 'tg_TJ', 'en_US',
'es_ES.ISO8859-1', 'fr_FR.ISO8859-15', 'ru_RU.KOI8-R', 'ko_KR.eucKR']
+# Workaround for MSVC6(debug) crash bug
+if "MSC v.1200" in sys.version:
+ def accept(loc):
+ a = loc.split(".")
+ return not(len(a) == 2 and len(a[-1]) >= 9)
+ candidate_locales = [loc for loc in candidate_locales if accept(loc)]
+
# List known locale values to test against when available.
# Dict formatted as ``<locale> : (<decimal_point>, <thousands_sep>)``. If a
# value is not known, use '' .
@@ -47,12 +59,13 @@ class _LocaleTests(unittest.TestCase):
known_value = known_numerics.get(used_locale,
('', ''))[data_type == 'thousands_sep']
if known_value and calc_value:
- self.assertEquals(calc_value, known_value,
+ self.assertEqual(calc_value, known_value,
self.lc_numeric_err_msg % (
calc_value, known_value,
calc_type, data_type, set_locale,
used_locale))
+ @unittest.skipUnless(nl_langinfo, "nl_langinfo is not available")
def test_lc_numeric_nl_langinfo(self):
# Test nl_langinfo against known values
for loc in candidate_locales:
@@ -71,10 +84,10 @@ class _LocaleTests(unittest.TestCase):
setlocale(LC_NUMERIC, loc)
except Error:
continue
- for li, lc in ((RADIXCHAR, "decimal_point"),
- (THOUSEP, "thousands_sep")):
+ for lc in ("decimal_point", "thousands_sep"):
self.numeric_tester('localeconv', localeconv()[lc], lc, loc)
+ @unittest.skipUnless(nl_langinfo, "nl_langinfo is not available")
def test_lc_numeric_basic(self):
# Test nl_langinfo against localeconv
for loc in candidate_locales:
@@ -90,7 +103,7 @@ class _LocaleTests(unittest.TestCase):
set_locale = setlocale(LC_NUMERIC)
except Error:
set_locale = "<not able to determine>"
- self.assertEquals(nl_radixchar, li_radixchar,
+ self.assertEqual(nl_radixchar, li_radixchar,
"%s (nl_langinfo) != %s (localeconv) "
"(set to %s, using %s)" % (
nl_radixchar, li_radixchar,
@@ -109,9 +122,9 @@ class _LocaleTests(unittest.TestCase):
if loc == 'eu_ES' and localeconv()['decimal_point'] == "' ":
continue
- self.assertEquals(int(eval('3.14') * 100), 314,
+ self.assertEqual(int(eval('3.14') * 100), 314,
"using eval('3.14') failed for %s" % loc)
- self.assertEquals(int(float('3.14') * 100), 314,
+ self.assertEqual(int(float('3.14') * 100), 314,
"using float('3.14') failed for %s" % loc)
if localeconv()['decimal_point'] != '.':
self.assertRaises(ValueError, float,
diff --git a/Lib/test/test_abc.py b/Lib/test/test_abc.py
index 3e0955fd75..6a8c3a1327 100644
--- a/Lib/test/test_abc.py
+++ b/Lib/test/test_abc.py
@@ -3,7 +3,7 @@
"""Unit tests for abc.py."""
-import unittest
+import unittest, weakref
from test import test_support
import abc
@@ -15,16 +15,16 @@ class TestABC(unittest.TestCase):
def test_abstractmethod_basics(self):
@abc.abstractmethod
def foo(self): pass
- self.assertEqual(foo.__isabstractmethod__, True)
+ self.assertTrue(foo.__isabstractmethod__)
def bar(self): pass
- self.assertEqual(hasattr(bar, "__isabstractmethod__"), False)
+ self.assertFalse(hasattr(bar, "__isabstractmethod__"))
def test_abstractproperty_basics(self):
@abc.abstractproperty
def foo(self): pass
- self.assertEqual(foo.__isabstractmethod__, True)
+ self.assertTrue(foo.__isabstractmethod__)
def bar(self): pass
- self.assertEqual(hasattr(bar, "__isabstractmethod__"), False)
+ self.assertFalse(hasattr(bar, "__isabstractmethod__"))
class C:
__metaclass__ = abc.ABCMeta
@@ -44,23 +44,23 @@ class TestABC(unittest.TestCase):
def bar(self): pass # concrete
self.assertEqual(C.__abstractmethods__, set(["foo"]))
self.assertRaises(TypeError, C) # because foo is abstract
- self.assert_(isabstract(C))
+ self.assertTrue(isabstract(C))
class D(C):
def bar(self): pass # concrete override of concrete
self.assertEqual(D.__abstractmethods__, set(["foo"]))
self.assertRaises(TypeError, D) # because foo is still abstract
- self.assert_(isabstract(D))
+ self.assertTrue(isabstract(D))
class E(D):
def foo(self): pass
self.assertEqual(E.__abstractmethods__, set())
E() # now foo is concrete, too
- self.failIf(isabstract(E))
+ self.assertFalse(isabstract(E))
class F(E):
@abstractthing
def bar(self): pass # abstract override of concrete
self.assertEqual(F.__abstractmethods__, set(["bar"]))
self.assertRaises(TypeError, F) # because bar is abstract now
- self.assert_(isabstract(F))
+ self.assertTrue(isabstract(F))
def test_subclass_oldstyle_class(self):
class A:
@@ -87,22 +87,22 @@ class TestABC(unittest.TestCase):
class B(object):
pass
b = B()
- self.assertEqual(issubclass(B, A), False)
- self.assertEqual(issubclass(B, (A,)), False)
- self.assertEqual(isinstance(b, A), False)
- self.assertEqual(isinstance(b, (A,)), False)
+ self.assertFalse(issubclass(B, A))
+ self.assertFalse(issubclass(B, (A,)))
+ self.assertNotIsInstance(b, A)
+ self.assertNotIsInstance(b, (A,))
A.register(B)
- self.assertEqual(issubclass(B, A), True)
- self.assertEqual(issubclass(B, (A,)), True)
- self.assertEqual(isinstance(b, A), True)
- self.assertEqual(isinstance(b, (A,)), True)
+ self.assertTrue(issubclass(B, A))
+ self.assertTrue(issubclass(B, (A,)))
+ self.assertIsInstance(b, A)
+ self.assertIsInstance(b, (A,))
class C(B):
pass
c = C()
- self.assertEqual(issubclass(C, A), True)
- self.assertEqual(issubclass(C, (A,)), True)
- self.assertEqual(isinstance(c, A), True)
- self.assertEqual(isinstance(c, (A,)), True)
+ self.assertTrue(issubclass(C, A))
+ self.assertTrue(issubclass(C, (A,)))
+ self.assertIsInstance(c, A)
+ self.assertIsInstance(c, (A,))
def test_isinstance_invalidation(self):
class A:
@@ -110,27 +110,27 @@ class TestABC(unittest.TestCase):
class B(object):
pass
b = B()
- self.assertEqual(isinstance(b, A), False)
- self.assertEqual(isinstance(b, (A,)), False)
+ self.assertFalse(isinstance(b, A))
+ self.assertFalse(isinstance(b, (A,)))
A.register(B)
- self.assertEqual(isinstance(b, A), True)
- self.assertEqual(isinstance(b, (A,)), True)
+ self.assertTrue(isinstance(b, A))
+ self.assertTrue(isinstance(b, (A,)))
def test_registration_builtins(self):
class A:
__metaclass__ = abc.ABCMeta
A.register(int)
- self.assertEqual(isinstance(42, A), True)
- self.assertEqual(isinstance(42, (A,)), True)
- self.assertEqual(issubclass(int, A), True)
- self.assertEqual(issubclass(int, (A,)), True)
+ self.assertIsInstance(42, A)
+ self.assertIsInstance(42, (A,))
+ self.assertTrue(issubclass(int, A))
+ self.assertTrue(issubclass(int, (A,)))
class B(A):
pass
B.register(basestring)
- self.assertEqual(isinstance("", A), True)
- self.assertEqual(isinstance("", (A,)), True)
- self.assertEqual(issubclass(str, A), True)
- self.assertEqual(issubclass(str, (A,)), True)
+ self.assertIsInstance("", A)
+ self.assertIsInstance("", (A,))
+ self.assertTrue(issubclass(str, A))
+ self.assertTrue(issubclass(str, (A,)))
def test_registration_edge_cases(self):
class A:
@@ -149,44 +149,50 @@ class TestABC(unittest.TestCase):
self.assertRaises(RuntimeError, C.register, A) # cycles not allowed
C.register(B) # ok
+ def test_register_non_class(self):
+ class A(object):
+ __metaclass__ = abc.ABCMeta
+ self.assertRaisesRegexp(TypeError, "Can only register classes",
+ A.register, 4)
+
def test_registration_transitiveness(self):
class A:
__metaclass__ = abc.ABCMeta
- self.failUnless(issubclass(A, A))
- self.failUnless(issubclass(A, (A,)))
+ self.assertTrue(issubclass(A, A))
+ self.assertTrue(issubclass(A, (A,)))
class B:
__metaclass__ = abc.ABCMeta
- self.failIf(issubclass(A, B))
- self.failIf(issubclass(A, (B,)))
- self.failIf(issubclass(B, A))
- self.failIf(issubclass(B, (A,)))
+ self.assertFalse(issubclass(A, B))
+ self.assertFalse(issubclass(A, (B,)))
+ self.assertFalse(issubclass(B, A))
+ self.assertFalse(issubclass(B, (A,)))
class C:
__metaclass__ = abc.ABCMeta
A.register(B)
class B1(B):
pass
- self.failUnless(issubclass(B1, A))
- self.failUnless(issubclass(B1, (A,)))
+ self.assertTrue(issubclass(B1, A))
+ self.assertTrue(issubclass(B1, (A,)))
class C1(C):
pass
B1.register(C1)
- self.failIf(issubclass(C, B))
- self.failIf(issubclass(C, (B,)))
- self.failIf(issubclass(C, B1))
- self.failIf(issubclass(C, (B1,)))
- self.failUnless(issubclass(C1, A))
- self.failUnless(issubclass(C1, (A,)))
- self.failUnless(issubclass(C1, B))
- self.failUnless(issubclass(C1, (B,)))
- self.failUnless(issubclass(C1, B1))
- self.failUnless(issubclass(C1, (B1,)))
+ self.assertFalse(issubclass(C, B))
+ self.assertFalse(issubclass(C, (B,)))
+ self.assertFalse(issubclass(C, B1))
+ self.assertFalse(issubclass(C, (B1,)))
+ self.assertTrue(issubclass(C1, A))
+ self.assertTrue(issubclass(C1, (A,)))
+ self.assertTrue(issubclass(C1, B))
+ self.assertTrue(issubclass(C1, (B,)))
+ self.assertTrue(issubclass(C1, B1))
+ self.assertTrue(issubclass(C1, (B1,)))
C1.register(int)
class MyInt(int):
pass
- self.failUnless(issubclass(MyInt, A))
- self.failUnless(issubclass(MyInt, (A,)))
- self.failUnless(isinstance(42, A))
- self.failUnless(isinstance(42, (A,)))
+ self.assertTrue(issubclass(MyInt, A))
+ self.assertTrue(issubclass(MyInt, (A,)))
+ self.assertIsInstance(42, A)
+ self.assertIsInstance(42, (A,))
def test_all_new_methods_are_called(self):
class A:
@@ -202,6 +208,22 @@ class TestABC(unittest.TestCase):
C()
self.assertEqual(B.counter, 1)
+ def test_cache_leak(self):
+ # See issue #2521.
+ class A(object):
+ __metaclass__ = abc.ABCMeta
+ @abc.abstractmethod
+ def f(self):
+ pass
+ class C(A):
+ def f(self):
+ A.f(self)
+ r = weakref.ref(C)
+ # Trigger cache.
+ C().f()
+ del C
+ test_support.gc_collect()
+ self.assertEqual(r(), None)
def test_main():
test_support.run_unittest(TestABC)
diff --git a/Lib/test/test_abstract_numbers.py b/Lib/test/test_abstract_numbers.py
index 034fb52a43..925f8cf60c 100644
--- a/Lib/test/test_abstract_numbers.py
+++ b/Lib/test/test_abstract_numbers.py
@@ -1,16 +1,14 @@
"""Unit tests for numbers.py."""
import math
-import operator
import unittest
from numbers import Complex, Real, Rational, Integral
-from numbers import Number
from test import test_support
class TestNumbers(unittest.TestCase):
def test_int(self):
- self.failUnless(issubclass(int, Integral))
- self.failUnless(issubclass(int, Complex))
+ self.assertTrue(issubclass(int, Integral))
+ self.assertTrue(issubclass(int, Complex))
self.assertEqual(7, int(7).real)
self.assertEqual(0, int(7).imag)
@@ -19,8 +17,8 @@ class TestNumbers(unittest.TestCase):
self.assertEqual(1, int(7).denominator)
def test_long(self):
- self.failUnless(issubclass(long, Integral))
- self.failUnless(issubclass(long, Complex))
+ self.assertTrue(issubclass(long, Integral))
+ self.assertTrue(issubclass(long, Complex))
self.assertEqual(7, long(7).real)
self.assertEqual(0, long(7).imag)
@@ -29,16 +27,16 @@ class TestNumbers(unittest.TestCase):
self.assertEqual(1, long(7).denominator)
def test_float(self):
- self.failIf(issubclass(float, Rational))
- self.failUnless(issubclass(float, Real))
+ self.assertFalse(issubclass(float, Rational))
+ self.assertTrue(issubclass(float, Real))
self.assertEqual(7.3, float(7.3).real)
self.assertEqual(0, float(7.3).imag)
self.assertEqual(7.3, float(7.3).conjugate())
def test_complex(self):
- self.failIf(issubclass(complex, Real))
- self.failUnless(issubclass(complex, Complex))
+ self.assertFalse(issubclass(complex, Real))
+ self.assertTrue(issubclass(complex, Complex))
c1, c2 = complex(3, 2), complex(4,1)
# XXX: This is not ideal, but see the comment in math_trunc().
diff --git a/Lib/test/test_aepack.py b/Lib/test/test_aepack.py
index c44f1ef481..f4ea25b5f0 100755..100644
--- a/Lib/test/test_aepack.py
+++ b/Lib/test/test_aepack.py
@@ -1,11 +1,12 @@
# Copyright (C) 2003 Python Software Foundation
import unittest
-import aepack
-import aetypes
import os
from test import test_support
+aetypes = test_support.import_module('aetypes')
+aepack = test_support.import_module('aepack')
+
class TestAepack(unittest.TestCase):
OBJECTS = [
aetypes.Enum('enum'),
diff --git a/Lib/test/test_aifc.py b/Lib/test/test_aifc.py
index d6b7942926..cbf00e9a74 100644
--- a/Lib/test/test_aifc.py
+++ b/Lib/test/test_aifc.py
@@ -1,5 +1,6 @@
-from test.test_support import findfile, run_unittest
+from test.test_support import findfile, run_unittest, TESTFN
import unittest
+import os
import aifc
@@ -7,16 +8,29 @@ import aifc
class AIFCTest(unittest.TestCase):
def setUp(self):
+ self.f = self.fout = None
self.sndfilepath = findfile('Sine-1000Hz-300ms.aif')
+ def tearDown(self):
+ if self.f is not None:
+ self.f.close()
+ if self.fout is not None:
+ try:
+ self.fout.close()
+ except (aifc.Error, AttributeError):
+ pass
+ try:
+ os.remove(TESTFN)
+ except OSError:
+ pass
+
def test_skipunknown(self):
#Issue 2245
#This file contains chunk types aifc doesn't recognize.
- f = aifc.open(self.sndfilepath)
- f.close()
+ self.f = aifc.open(self.sndfilepath)
def test_params(self):
- f = aifc.open(self.sndfilepath)
+ f = self.f = aifc.open(self.sndfilepath)
self.assertEqual(f.getnchannels(), 2)
self.assertEqual(f.getsampwidth(), 2)
self.assertEqual(f.getframerate(), 48000)
@@ -24,10 +38,9 @@ class AIFCTest(unittest.TestCase):
self.assertEqual(f.getcomptype(), 'NONE')
self.assertEqual(f.getcompname(), 'not compressed')
self.assertEqual(f.getparams(), (2, 2, 48000, 14400, 'NONE', 'not compressed'))
- f.close()
def test_read(self):
- f = aifc.open(self.sndfilepath)
+ f = self.f = aifc.open(self.sndfilepath)
self.assertEqual(f.tell(), 0)
self.assertEqual(f.readframes(2), '\x00\x00\x00\x00\x0b\xd4\x0b\xd4')
f.rewind()
@@ -41,9 +54,42 @@ class AIFCTest(unittest.TestCase):
self.assertEqual(f.readframes(2), '\x17t\x17t"\xad"\xad')
f.setpos(pos0)
self.assertEqual(f.readframes(2), '\x00\x00\x00\x00\x0b\xd4\x0b\xd4')
- f.close()
- #XXX Need more tests!
+ def test_write(self):
+ f = self.f = aifc.open(self.sndfilepath)
+ fout = self.fout = aifc.open(TESTFN, 'wb')
+ fout.aifc()
+ fout.setparams(f.getparams())
+ for frame in range(f.getnframes()):
+ fout.writeframes(f.readframes(1))
+ fout.close()
+ fout = self.fout = aifc.open(TESTFN, 'rb')
+ f.rewind()
+ self.assertEqual(f.getparams(), fout.getparams())
+ self.assertEqual(f.readframes(5), fout.readframes(5))
+
+ def test_compress(self):
+ f = self.f = aifc.open(self.sndfilepath)
+ fout = self.fout = aifc.open(TESTFN, 'wb')
+ fout.aifc()
+ fout.setnchannels(f.getnchannels())
+ fout.setsampwidth(f.getsampwidth())
+ fout.setframerate(f.getframerate())
+ fout.setcomptype('ULAW', 'foo')
+ for frame in range(f.getnframes()):
+ fout.writeframes(f.readframes(1))
+ fout.close()
+ self.assertLess(
+ os.stat(TESTFN).st_size,
+ os.stat(self.sndfilepath).st_size*0.75,
+ )
+ fout = self.fout = aifc.open(TESTFN, 'rb')
+ f.rewind()
+ self.assertEqual(f.getparams()[0:3], fout.getparams()[0:3])
+ self.assertEqual(fout.getcomptype(), 'ULAW')
+ self.assertEqual(fout.getcompname(), 'foo')
+ # XXX: this test fails, not sure if it should succeed or not
+ # self.assertEqual(f.readframes(5), fout.readframes(5))
def test_close(self):
class Wrapfile(object):
diff --git a/Lib/test/test_applesingle.py b/Lib/test/test_applesingle.py
index e915028dca..1beffe0f2f 100644
--- a/Lib/test/test_applesingle.py
+++ b/Lib/test/test_applesingle.py
@@ -1,12 +1,12 @@
# Copyright (C) 2003 Python Software Foundation
import unittest
-import macostools
-import Carbon.File
-import MacOS
import os
from test import test_support
import struct
+
+MacOS = test_support.import_module('MacOS')
+# The following should exist if MacOS does.
import applesingle
AS_MAGIC=0x00051600
diff --git a/Lib/test/test_argparse.py b/Lib/test/test_argparse.py
new file mode 100644
index 0000000000..5785eec57f
--- /dev/null
+++ b/Lib/test/test_argparse.py
@@ -0,0 +1,4646 @@
+# Author: Steven J. Bethard <steven.bethard@gmail.com>.
+
+import codecs
+import inspect
+import os
+import shutil
+import stat
+import sys
+import textwrap
+import tempfile
+import unittest
+import argparse
+
+from StringIO import StringIO
+
+class StdIOBuffer(StringIO):
+ pass
+
+from test import test_support
+
+class TestCase(unittest.TestCase):
+
+ def assertEqual(self, obj1, obj2):
+ if obj1 != obj2:
+ print('')
+ print(repr(obj1))
+ print(repr(obj2))
+ print(obj1)
+ print(obj2)
+ super(TestCase, self).assertEqual(obj1, obj2)
+
+ def setUp(self):
+ # The tests assume that line wrapping occurs at 80 columns, but this
+ # behaviour can be overridden by setting the COLUMNS environment
+ # variable. To ensure that this assumption is true, unset COLUMNS.
+ env = test_support.EnvironmentVarGuard()
+ env.unset("COLUMNS")
+ self.addCleanup(env.__exit__)
+
+
+class TempDirMixin(object):
+
+ def setUp(self):
+ self.temp_dir = tempfile.mkdtemp()
+ self.old_dir = os.getcwd()
+ os.chdir(self.temp_dir)
+
+ def tearDown(self):
+ os.chdir(self.old_dir)
+ shutil.rmtree(self.temp_dir, True)
+
+ def create_readonly_file(self, filename):
+ file_path = os.path.join(self.temp_dir, filename)
+ with open(file_path, 'w') as file:
+ file.write(filename)
+ os.chmod(file_path, stat.S_IREAD)
+
+class Sig(object):
+
+ def __init__(self, *args, **kwargs):
+ self.args = args
+ self.kwargs = kwargs
+
+
+class NS(object):
+
+ def __init__(self, **kwargs):
+ self.__dict__.update(kwargs)
+
+ def __repr__(self):
+ sorted_items = sorted(self.__dict__.items())
+ kwarg_str = ', '.join(['%s=%r' % tup for tup in sorted_items])
+ return '%s(%s)' % (type(self).__name__, kwarg_str)
+
+ __hash__ = None
+
+ def __eq__(self, other):
+ return vars(self) == vars(other)
+
+ def __ne__(self, other):
+ return not (self == other)
+
+
+class ArgumentParserError(Exception):
+
+ def __init__(self, message, stdout=None, stderr=None, error_code=None):
+ Exception.__init__(self, message, stdout, stderr)
+ self.message = message
+ self.stdout = stdout
+ self.stderr = stderr
+ self.error_code = error_code
+
+
+def stderr_to_parser_error(parse_args, *args, **kwargs):
+ # if this is being called recursively and stderr or stdout is already being
+ # redirected, simply call the function and let the enclosing function
+ # catch the exception
+ if isinstance(sys.stderr, StdIOBuffer) or isinstance(sys.stdout, StdIOBuffer):
+ return parse_args(*args, **kwargs)
+
+ # if this is not being called recursively, redirect stderr and
+ # use it as the ArgumentParserError message
+ old_stdout = sys.stdout
+ old_stderr = sys.stderr
+ sys.stdout = StdIOBuffer()
+ sys.stderr = StdIOBuffer()
+ try:
+ try:
+ result = parse_args(*args, **kwargs)
+ for key in list(vars(result)):
+ if getattr(result, key) is sys.stdout:
+ setattr(result, key, old_stdout)
+ if getattr(result, key) is sys.stderr:
+ setattr(result, key, old_stderr)
+ return result
+ except SystemExit:
+ code = sys.exc_info()[1].code
+ stdout = sys.stdout.getvalue()
+ stderr = sys.stderr.getvalue()
+ raise ArgumentParserError("SystemExit", stdout, stderr, code)
+ finally:
+ sys.stdout = old_stdout
+ sys.stderr = old_stderr
+
+
+class ErrorRaisingArgumentParser(argparse.ArgumentParser):
+
+ def parse_args(self, *args, **kwargs):
+ parse_args = super(ErrorRaisingArgumentParser, self).parse_args
+ return stderr_to_parser_error(parse_args, *args, **kwargs)
+
+ def exit(self, *args, **kwargs):
+ exit = super(ErrorRaisingArgumentParser, self).exit
+ return stderr_to_parser_error(exit, *args, **kwargs)
+
+ def error(self, *args, **kwargs):
+ error = super(ErrorRaisingArgumentParser, self).error
+ return stderr_to_parser_error(error, *args, **kwargs)
+
+
+class ParserTesterMetaclass(type):
+ """Adds parser tests using the class attributes.
+
+ Classes of this type should specify the following attributes:
+
+ argument_signatures -- a list of Sig objects which specify
+ the signatures of Argument objects to be created
+ failures -- a list of args lists that should cause the parser
+ to fail
+ successes -- a list of (initial_args, options, remaining_args) tuples
+ where initial_args specifies the string args to be parsed,
+ options is a dict that should match the vars() of the options
+ parsed out of initial_args, and remaining_args should be any
+ remaining unparsed arguments
+ """
+
+ def __init__(cls, name, bases, bodydict):
+ if name == 'ParserTestCase':
+ return
+
+ # default parser signature is empty
+ if not hasattr(cls, 'parser_signature'):
+ cls.parser_signature = Sig()
+ if not hasattr(cls, 'parser_class'):
+ cls.parser_class = ErrorRaisingArgumentParser
+
+ # ---------------------------------------
+ # functions for adding optional arguments
+ # ---------------------------------------
+ def no_groups(parser, argument_signatures):
+ """Add all arguments directly to the parser"""
+ for sig in argument_signatures:
+ parser.add_argument(*sig.args, **sig.kwargs)
+
+ def one_group(parser, argument_signatures):
+ """Add all arguments under a single group in the parser"""
+ group = parser.add_argument_group('foo')
+ for sig in argument_signatures:
+ group.add_argument(*sig.args, **sig.kwargs)
+
+ def many_groups(parser, argument_signatures):
+ """Add each argument in its own group to the parser"""
+ for i, sig in enumerate(argument_signatures):
+ group = parser.add_argument_group('foo:%i' % i)
+ group.add_argument(*sig.args, **sig.kwargs)
+
+ # --------------------------
+ # functions for parsing args
+ # --------------------------
+ def listargs(parser, args):
+ """Parse the args by passing in a list"""
+ return parser.parse_args(args)
+
+ def sysargs(parser, args):
+ """Parse the args by defaulting to sys.argv"""
+ old_sys_argv = sys.argv
+ sys.argv = [old_sys_argv[0]] + args
+ try:
+ return parser.parse_args()
+ finally:
+ sys.argv = old_sys_argv
+
+ # class that holds the combination of one optional argument
+ # addition method and one arg parsing method
+ class AddTests(object):
+
+ def __init__(self, tester_cls, add_arguments, parse_args):
+ self._add_arguments = add_arguments
+ self._parse_args = parse_args
+
+ add_arguments_name = self._add_arguments.__name__
+ parse_args_name = self._parse_args.__name__
+ for test_func in [self.test_failures, self.test_successes]:
+ func_name = test_func.__name__
+ names = func_name, add_arguments_name, parse_args_name
+ test_name = '_'.join(names)
+
+ def wrapper(self, test_func=test_func):
+ test_func(self)
+ try:
+ wrapper.__name__ = test_name
+ except TypeError:
+ pass
+ setattr(tester_cls, test_name, wrapper)
+
+ def _get_parser(self, tester):
+ args = tester.parser_signature.args
+ kwargs = tester.parser_signature.kwargs
+ parser = tester.parser_class(*args, **kwargs)
+ self._add_arguments(parser, tester.argument_signatures)
+ return parser
+
+ def test_failures(self, tester):
+ parser = self._get_parser(tester)
+ for args_str in tester.failures:
+ args = args_str.split()
+ raises = tester.assertRaises
+ raises(ArgumentParserError, parser.parse_args, args)
+
+ def test_successes(self, tester):
+ parser = self._get_parser(tester)
+ for args, expected_ns in tester.successes:
+ if isinstance(args, str):
+ args = args.split()
+ result_ns = self._parse_args(parser, args)
+ tester.assertEqual(expected_ns, result_ns)
+
+ # add tests for each combination of an optionals adding method
+ # and an arg parsing method
+ for add_arguments in [no_groups, one_group, many_groups]:
+ for parse_args in [listargs, sysargs]:
+ AddTests(cls, add_arguments, parse_args)
+
+bases = TestCase,
+ParserTestCase = ParserTesterMetaclass('ParserTestCase', bases, {})
+
+# ===============
+# Optionals tests
+# ===============
+
+class TestOptionalsSingleDash(ParserTestCase):
+ """Test an Optional with a single-dash option string"""
+
+ argument_signatures = [Sig('-x')]
+ failures = ['-x', 'a', '--foo', '-x --foo', '-x -y']
+ successes = [
+ ('', NS(x=None)),
+ ('-x a', NS(x='a')),
+ ('-xa', NS(x='a')),
+ ('-x -1', NS(x='-1')),
+ ('-x-1', NS(x='-1')),
+ ]
+
+
+class TestOptionalsSingleDashCombined(ParserTestCase):
+ """Test an Optional with a single-dash option string"""
+
+ argument_signatures = [
+ Sig('-x', action='store_true'),
+ Sig('-yyy', action='store_const', const=42),
+ Sig('-z'),
+ ]
+ failures = ['a', '--foo', '-xa', '-x --foo', '-x -z', '-z -x',
+ '-yx', '-yz a', '-yyyx', '-yyyza', '-xyza']
+ successes = [
+ ('', NS(x=False, yyy=None, z=None)),
+ ('-x', NS(x=True, yyy=None, z=None)),
+ ('-za', NS(x=False, yyy=None, z='a')),
+ ('-z a', NS(x=False, yyy=None, z='a')),
+ ('-xza', NS(x=True, yyy=None, z='a')),
+ ('-xz a', NS(x=True, yyy=None, z='a')),
+ ('-x -za', NS(x=True, yyy=None, z='a')),
+ ('-x -z a', NS(x=True, yyy=None, z='a')),
+ ('-y', NS(x=False, yyy=42, z=None)),
+ ('-yyy', NS(x=False, yyy=42, z=None)),
+ ('-x -yyy -za', NS(x=True, yyy=42, z='a')),
+ ('-x -yyy -z a', NS(x=True, yyy=42, z='a')),
+ ]
+
+
+class TestOptionalsSingleDashLong(ParserTestCase):
+ """Test an Optional with a multi-character single-dash option string"""
+
+ argument_signatures = [Sig('-foo')]
+ failures = ['-foo', 'a', '--foo', '-foo --foo', '-foo -y', '-fooa']
+ successes = [
+ ('', NS(foo=None)),
+ ('-foo a', NS(foo='a')),
+ ('-foo -1', NS(foo='-1')),
+ ('-fo a', NS(foo='a')),
+ ('-f a', NS(foo='a')),
+ ]
+
+
+class TestOptionalsSingleDashSubsetAmbiguous(ParserTestCase):
+ """Test Optionals where option strings are subsets of each other"""
+
+ argument_signatures = [Sig('-f'), Sig('-foobar'), Sig('-foorab')]
+ failures = ['-f', '-foo', '-fo', '-foo b', '-foob', '-fooba', '-foora']
+ successes = [
+ ('', NS(f=None, foobar=None, foorab=None)),
+ ('-f a', NS(f='a', foobar=None, foorab=None)),
+ ('-fa', NS(f='a', foobar=None, foorab=None)),
+ ('-foa', NS(f='oa', foobar=None, foorab=None)),
+ ('-fooa', NS(f='ooa', foobar=None, foorab=None)),
+ ('-foobar a', NS(f=None, foobar='a', foorab=None)),
+ ('-foorab a', NS(f=None, foobar=None, foorab='a')),
+ ]
+
+
+class TestOptionalsSingleDashAmbiguous(ParserTestCase):
+ """Test Optionals that partially match but are not subsets"""
+
+ argument_signatures = [Sig('-foobar'), Sig('-foorab')]
+ failures = ['-f', '-f a', '-fa', '-foa', '-foo', '-fo', '-foo b']
+ successes = [
+ ('', NS(foobar=None, foorab=None)),
+ ('-foob a', NS(foobar='a', foorab=None)),
+ ('-foor a', NS(foobar=None, foorab='a')),
+ ('-fooba a', NS(foobar='a', foorab=None)),
+ ('-foora a', NS(foobar=None, foorab='a')),
+ ('-foobar a', NS(foobar='a', foorab=None)),
+ ('-foorab a', NS(foobar=None, foorab='a')),
+ ]
+
+
+class TestOptionalsNumeric(ParserTestCase):
+ """Test an Optional with a short opt string"""
+
+ argument_signatures = [Sig('-1', dest='one')]
+ failures = ['-1', 'a', '-1 --foo', '-1 -y', '-1 -1', '-1 -2']
+ successes = [
+ ('', NS(one=None)),
+ ('-1 a', NS(one='a')),
+ ('-1a', NS(one='a')),
+ ('-1-2', NS(one='-2')),
+ ]
+
+
+class TestOptionalsDoubleDash(ParserTestCase):
+ """Test an Optional with a double-dash option string"""
+
+ argument_signatures = [Sig('--foo')]
+ failures = ['--foo', '-f', '-f a', 'a', '--foo -x', '--foo --bar']
+ successes = [
+ ('', NS(foo=None)),
+ ('--foo a', NS(foo='a')),
+ ('--foo=a', NS(foo='a')),
+ ('--foo -2.5', NS(foo='-2.5')),
+ ('--foo=-2.5', NS(foo='-2.5')),
+ ]
+
+
+class TestOptionalsDoubleDashPartialMatch(ParserTestCase):
+ """Tests partial matching with a double-dash option string"""
+
+ argument_signatures = [
+ Sig('--badger', action='store_true'),
+ Sig('--bat'),
+ ]
+ failures = ['--bar', '--b', '--ba', '--b=2', '--ba=4', '--badge 5']
+ successes = [
+ ('', NS(badger=False, bat=None)),
+ ('--bat X', NS(badger=False, bat='X')),
+ ('--bad', NS(badger=True, bat=None)),
+ ('--badg', NS(badger=True, bat=None)),
+ ('--badge', NS(badger=True, bat=None)),
+ ('--badger', NS(badger=True, bat=None)),
+ ]
+
+
+class TestOptionalsDoubleDashPrefixMatch(ParserTestCase):
+ """Tests when one double-dash option string is a prefix of another"""
+
+ argument_signatures = [
+ Sig('--badger', action='store_true'),
+ Sig('--ba'),
+ ]
+ failures = ['--bar', '--b', '--ba', '--b=2', '--badge 5']
+ successes = [
+ ('', NS(badger=False, ba=None)),
+ ('--ba X', NS(badger=False, ba='X')),
+ ('--ba=X', NS(badger=False, ba='X')),
+ ('--bad', NS(badger=True, ba=None)),
+ ('--badg', NS(badger=True, ba=None)),
+ ('--badge', NS(badger=True, ba=None)),
+ ('--badger', NS(badger=True, ba=None)),
+ ]
+
+
+class TestOptionalsSingleDoubleDash(ParserTestCase):
+ """Test an Optional with single- and double-dash option strings"""
+
+ argument_signatures = [
+ Sig('-f', action='store_true'),
+ Sig('--bar'),
+ Sig('-baz', action='store_const', const=42),
+ ]
+ failures = ['--bar', '-fbar', '-fbaz', '-bazf', '-b B', 'B']
+ successes = [
+ ('', NS(f=False, bar=None, baz=None)),
+ ('-f', NS(f=True, bar=None, baz=None)),
+ ('--ba B', NS(f=False, bar='B', baz=None)),
+ ('-f --bar B', NS(f=True, bar='B', baz=None)),
+ ('-f -b', NS(f=True, bar=None, baz=42)),
+ ('-ba -f', NS(f=True, bar=None, baz=42)),
+ ]
+
+
+class TestOptionalsAlternatePrefixChars(ParserTestCase):
+ """Test an Optional with option strings with custom prefixes"""
+
+ parser_signature = Sig(prefix_chars='+:/', add_help=False)
+ argument_signatures = [
+ Sig('+f', action='store_true'),
+ Sig('::bar'),
+ Sig('/baz', action='store_const', const=42),
+ ]
+ failures = ['--bar', '-fbar', '-b B', 'B', '-f', '--bar B', '-baz', '-h', '--help', '+h', '::help', '/help']
+ successes = [
+ ('', NS(f=False, bar=None, baz=None)),
+ ('+f', NS(f=True, bar=None, baz=None)),
+ ('::ba B', NS(f=False, bar='B', baz=None)),
+ ('+f ::bar B', NS(f=True, bar='B', baz=None)),
+ ('+f /b', NS(f=True, bar=None, baz=42)),
+ ('/ba +f', NS(f=True, bar=None, baz=42)),
+ ]
+
+
+class TestOptionalsAlternatePrefixCharsAddedHelp(ParserTestCase):
+ """When ``-`` not in prefix_chars, default operators created for help
+ should use the prefix_chars in use rather than - or --
+ http://bugs.python.org/issue9444"""
+
+ parser_signature = Sig(prefix_chars='+:/', add_help=True)
+ argument_signatures = [
+ Sig('+f', action='store_true'),
+ Sig('::bar'),
+ Sig('/baz', action='store_const', const=42),
+ ]
+ failures = ['--bar', '-fbar', '-b B', 'B', '-f', '--bar B', '-baz']
+ successes = [
+ ('', NS(f=False, bar=None, baz=None)),
+ ('+f', NS(f=True, bar=None, baz=None)),
+ ('::ba B', NS(f=False, bar='B', baz=None)),
+ ('+f ::bar B', NS(f=True, bar='B', baz=None)),
+ ('+f /b', NS(f=True, bar=None, baz=42)),
+ ('/ba +f', NS(f=True, bar=None, baz=42))
+ ]
+
+
+class TestOptionalsAlternatePrefixCharsMultipleShortArgs(ParserTestCase):
+ """Verify that Optionals must be called with their defined prefixes"""
+
+ parser_signature = Sig(prefix_chars='+-', add_help=False)
+ argument_signatures = [
+ Sig('-x', action='store_true'),
+ Sig('+y', action='store_true'),
+ Sig('+z', action='store_true'),
+ ]
+ failures = ['-w',
+ '-xyz',
+ '+x',
+ '-y',
+ '+xyz',
+ ]
+ successes = [
+ ('', NS(x=False, y=False, z=False)),
+ ('-x', NS(x=True, y=False, z=False)),
+ ('+y -x', NS(x=True, y=True, z=False)),
+ ('+yz -x', NS(x=True, y=True, z=True)),
+ ]
+
+
+class TestOptionalsShortLong(ParserTestCase):
+ """Test a combination of single- and double-dash option strings"""
+
+ argument_signatures = [
+ Sig('-v', '--verbose', '-n', '--noisy', action='store_true'),
+ ]
+ failures = ['--x --verbose', '-N', 'a', '-v x']
+ successes = [
+ ('', NS(verbose=False)),
+ ('-v', NS(verbose=True)),
+ ('--verbose', NS(verbose=True)),
+ ('-n', NS(verbose=True)),
+ ('--noisy', NS(verbose=True)),
+ ]
+
+
+class TestOptionalsDest(ParserTestCase):
+ """Tests various means of setting destination"""
+
+ argument_signatures = [Sig('--foo-bar'), Sig('--baz', dest='zabbaz')]
+ failures = ['a']
+ successes = [
+ ('--foo-bar f', NS(foo_bar='f', zabbaz=None)),
+ ('--baz g', NS(foo_bar=None, zabbaz='g')),
+ ('--foo-bar h --baz i', NS(foo_bar='h', zabbaz='i')),
+ ('--baz j --foo-bar k', NS(foo_bar='k', zabbaz='j')),
+ ]
+
+
+class TestOptionalsDefault(ParserTestCase):
+ """Tests specifying a default for an Optional"""
+
+ argument_signatures = [Sig('-x'), Sig('-y', default=42)]
+ failures = ['a']
+ successes = [
+ ('', NS(x=None, y=42)),
+ ('-xx', NS(x='x', y=42)),
+ ('-yy', NS(x=None, y='y')),
+ ]
+
+
+class TestOptionalsNargsDefault(ParserTestCase):
+ """Tests not specifying the number of args for an Optional"""
+
+ argument_signatures = [Sig('-x')]
+ failures = ['a', '-x']
+ successes = [
+ ('', NS(x=None)),
+ ('-x a', NS(x='a')),
+ ]
+
+
+class TestOptionalsNargs1(ParserTestCase):
+ """Tests specifying the 1 arg for an Optional"""
+
+ argument_signatures = [Sig('-x', nargs=1)]
+ failures = ['a', '-x']
+ successes = [
+ ('', NS(x=None)),
+ ('-x a', NS(x=['a'])),
+ ]
+
+
+class TestOptionalsNargs3(ParserTestCase):
+ """Tests specifying the 3 args for an Optional"""
+
+ argument_signatures = [Sig('-x', nargs=3)]
+ failures = ['a', '-x', '-x a', '-x a b', 'a -x', 'a -x b']
+ successes = [
+ ('', NS(x=None)),
+ ('-x a b c', NS(x=['a', 'b', 'c'])),
+ ]
+
+
+class TestOptionalsNargsOptional(ParserTestCase):
+ """Tests specifying an Optional arg for an Optional"""
+
+ argument_signatures = [
+ Sig('-w', nargs='?'),
+ Sig('-x', nargs='?', const=42),
+ Sig('-y', nargs='?', default='spam'),
+ Sig('-z', nargs='?', type=int, const='42', default='84'),
+ ]
+ failures = ['2']
+ successes = [
+ ('', NS(w=None, x=None, y='spam', z=84)),
+ ('-w', NS(w=None, x=None, y='spam', z=84)),
+ ('-w 2', NS(w='2', x=None, y='spam', z=84)),
+ ('-x', NS(w=None, x=42, y='spam', z=84)),
+ ('-x 2', NS(w=None, x='2', y='spam', z=84)),
+ ('-y', NS(w=None, x=None, y=None, z=84)),
+ ('-y 2', NS(w=None, x=None, y='2', z=84)),
+ ('-z', NS(w=None, x=None, y='spam', z=42)),
+ ('-z 2', NS(w=None, x=None, y='spam', z=2)),
+ ]
+
+
+class TestOptionalsNargsZeroOrMore(ParserTestCase):
+ """Tests specifying an args for an Optional that accepts zero or more"""
+
+ argument_signatures = [
+ Sig('-x', nargs='*'),
+ Sig('-y', nargs='*', default='spam'),
+ ]
+ failures = ['a']
+ successes = [
+ ('', NS(x=None, y='spam')),
+ ('-x', NS(x=[], y='spam')),
+ ('-x a', NS(x=['a'], y='spam')),
+ ('-x a b', NS(x=['a', 'b'], y='spam')),
+ ('-y', NS(x=None, y=[])),
+ ('-y a', NS(x=None, y=['a'])),
+ ('-y a b', NS(x=None, y=['a', 'b'])),
+ ]
+
+
+class TestOptionalsNargsOneOrMore(ParserTestCase):
+ """Tests specifying an args for an Optional that accepts one or more"""
+
+ argument_signatures = [
+ Sig('-x', nargs='+'),
+ Sig('-y', nargs='+', default='spam'),
+ ]
+ failures = ['a', '-x', '-y', 'a -x', 'a -y b']
+ successes = [
+ ('', NS(x=None, y='spam')),
+ ('-x a', NS(x=['a'], y='spam')),
+ ('-x a b', NS(x=['a', 'b'], y='spam')),
+ ('-y a', NS(x=None, y=['a'])),
+ ('-y a b', NS(x=None, y=['a', 'b'])),
+ ]
+
+
+class TestOptionalsChoices(ParserTestCase):
+ """Tests specifying the choices for an Optional"""
+
+ argument_signatures = [
+ Sig('-f', choices='abc'),
+ Sig('-g', type=int, choices=range(5))]
+ failures = ['a', '-f d', '-fad', '-ga', '-g 6']
+ successes = [
+ ('', NS(f=None, g=None)),
+ ('-f a', NS(f='a', g=None)),
+ ('-f c', NS(f='c', g=None)),
+ ('-g 0', NS(f=None, g=0)),
+ ('-g 03', NS(f=None, g=3)),
+ ('-fb -g4', NS(f='b', g=4)),
+ ]
+
+
+class TestOptionalsRequired(ParserTestCase):
+ """Tests the an optional action that is required"""
+
+ argument_signatures = [
+ Sig('-x', type=int, required=True),
+ ]
+ failures = ['a', '']
+ successes = [
+ ('-x 1', NS(x=1)),
+ ('-x42', NS(x=42)),
+ ]
+
+
+class TestOptionalsActionStore(ParserTestCase):
+ """Tests the store action for an Optional"""
+
+ argument_signatures = [Sig('-x', action='store')]
+ failures = ['a', 'a -x']
+ successes = [
+ ('', NS(x=None)),
+ ('-xfoo', NS(x='foo')),
+ ]
+
+
+class TestOptionalsActionStoreConst(ParserTestCase):
+ """Tests the store_const action for an Optional"""
+
+ argument_signatures = [Sig('-y', action='store_const', const=object)]
+ failures = ['a']
+ successes = [
+ ('', NS(y=None)),
+ ('-y', NS(y=object)),
+ ]
+
+
+class TestOptionalsActionStoreFalse(ParserTestCase):
+ """Tests the store_false action for an Optional"""
+
+ argument_signatures = [Sig('-z', action='store_false')]
+ failures = ['a', '-za', '-z a']
+ successes = [
+ ('', NS(z=True)),
+ ('-z', NS(z=False)),
+ ]
+
+
+class TestOptionalsActionStoreTrue(ParserTestCase):
+ """Tests the store_true action for an Optional"""
+
+ argument_signatures = [Sig('--apple', action='store_true')]
+ failures = ['a', '--apple=b', '--apple b']
+ successes = [
+ ('', NS(apple=False)),
+ ('--apple', NS(apple=True)),
+ ]
+
+
+class TestOptionalsActionAppend(ParserTestCase):
+ """Tests the append action for an Optional"""
+
+ argument_signatures = [Sig('--baz', action='append')]
+ failures = ['a', '--baz', 'a --baz', '--baz a b']
+ successes = [
+ ('', NS(baz=None)),
+ ('--baz a', NS(baz=['a'])),
+ ('--baz a --baz b', NS(baz=['a', 'b'])),
+ ]
+
+
+class TestOptionalsActionAppendWithDefault(ParserTestCase):
+ """Tests the append action for an Optional"""
+
+ argument_signatures = [Sig('--baz', action='append', default=['X'])]
+ failures = ['a', '--baz', 'a --baz', '--baz a b']
+ successes = [
+ ('', NS(baz=['X'])),
+ ('--baz a', NS(baz=['X', 'a'])),
+ ('--baz a --baz b', NS(baz=['X', 'a', 'b'])),
+ ]
+
+
+class TestOptionalsActionAppendConst(ParserTestCase):
+ """Tests the append_const action for an Optional"""
+
+ argument_signatures = [
+ Sig('-b', action='append_const', const=Exception),
+ Sig('-c', action='append', dest='b'),
+ ]
+ failures = ['a', '-c', 'a -c', '-bx', '-b x']
+ successes = [
+ ('', NS(b=None)),
+ ('-b', NS(b=[Exception])),
+ ('-b -cx -b -cyz', NS(b=[Exception, 'x', Exception, 'yz'])),
+ ]
+
+
+class TestOptionalsActionAppendConstWithDefault(ParserTestCase):
+ """Tests the append_const action for an Optional"""
+
+ argument_signatures = [
+ Sig('-b', action='append_const', const=Exception, default=['X']),
+ Sig('-c', action='append', dest='b'),
+ ]
+ failures = ['a', '-c', 'a -c', '-bx', '-b x']
+ successes = [
+ ('', NS(b=['X'])),
+ ('-b', NS(b=['X', Exception])),
+ ('-b -cx -b -cyz', NS(b=['X', Exception, 'x', Exception, 'yz'])),
+ ]
+
+
+class TestOptionalsActionCount(ParserTestCase):
+ """Tests the count action for an Optional"""
+
+ argument_signatures = [Sig('-x', action='count')]
+ failures = ['a', '-x a', '-x b', '-x a -x b']
+ successes = [
+ ('', NS(x=None)),
+ ('-x', NS(x=1)),
+ ]
+
+
+# ================
+# Positional tests
+# ================
+
+class TestPositionalsNargsNone(ParserTestCase):
+ """Test a Positional that doesn't specify nargs"""
+
+ argument_signatures = [Sig('foo')]
+ failures = ['', '-x', 'a b']
+ successes = [
+ ('a', NS(foo='a')),
+ ]
+
+
+class TestPositionalsNargs1(ParserTestCase):
+ """Test a Positional that specifies an nargs of 1"""
+
+ argument_signatures = [Sig('foo', nargs=1)]
+ failures = ['', '-x', 'a b']
+ successes = [
+ ('a', NS(foo=['a'])),
+ ]
+
+
+class TestPositionalsNargs2(ParserTestCase):
+ """Test a Positional that specifies an nargs of 2"""
+
+ argument_signatures = [Sig('foo', nargs=2)]
+ failures = ['', 'a', '-x', 'a b c']
+ successes = [
+ ('a b', NS(foo=['a', 'b'])),
+ ]
+
+
+class TestPositionalsNargsZeroOrMore(ParserTestCase):
+ """Test a Positional that specifies unlimited nargs"""
+
+ argument_signatures = [Sig('foo', nargs='*')]
+ failures = ['-x']
+ successes = [
+ ('', NS(foo=[])),
+ ('a', NS(foo=['a'])),
+ ('a b', NS(foo=['a', 'b'])),
+ ]
+
+
+class TestPositionalsNargsZeroOrMoreDefault(ParserTestCase):
+ """Test a Positional that specifies unlimited nargs and a default"""
+
+ argument_signatures = [Sig('foo', nargs='*', default='bar')]
+ failures = ['-x']
+ successes = [
+ ('', NS(foo='bar')),
+ ('a', NS(foo=['a'])),
+ ('a b', NS(foo=['a', 'b'])),
+ ]
+
+
+class TestPositionalsNargsOneOrMore(ParserTestCase):
+ """Test a Positional that specifies one or more nargs"""
+
+ argument_signatures = [Sig('foo', nargs='+')]
+ failures = ['', '-x']
+ successes = [
+ ('a', NS(foo=['a'])),
+ ('a b', NS(foo=['a', 'b'])),
+ ]
+
+
+class TestPositionalsNargsOptional(ParserTestCase):
+ """Tests an Optional Positional"""
+
+ argument_signatures = [Sig('foo', nargs='?')]
+ failures = ['-x', 'a b']
+ successes = [
+ ('', NS(foo=None)),
+ ('a', NS(foo='a')),
+ ]
+
+
+class TestPositionalsNargsOptionalDefault(ParserTestCase):
+ """Tests an Optional Positional with a default value"""
+
+ argument_signatures = [Sig('foo', nargs='?', default=42)]
+ failures = ['-x', 'a b']
+ successes = [
+ ('', NS(foo=42)),
+ ('a', NS(foo='a')),
+ ]
+
+
+class TestPositionalsNargsOptionalConvertedDefault(ParserTestCase):
+ """Tests an Optional Positional with a default value
+ that needs to be converted to the appropriate type.
+ """
+
+ argument_signatures = [
+ Sig('foo', nargs='?', type=int, default='42'),
+ ]
+ failures = ['-x', 'a b', '1 2']
+ successes = [
+ ('', NS(foo=42)),
+ ('1', NS(foo=1)),
+ ]
+
+
+class TestPositionalsNargsNoneNone(ParserTestCase):
+ """Test two Positionals that don't specify nargs"""
+
+ argument_signatures = [Sig('foo'), Sig('bar')]
+ failures = ['', '-x', 'a', 'a b c']
+ successes = [
+ ('a b', NS(foo='a', bar='b')),
+ ]
+
+
+class TestPositionalsNargsNone1(ParserTestCase):
+ """Test a Positional with no nargs followed by one with 1"""
+
+ argument_signatures = [Sig('foo'), Sig('bar', nargs=1)]
+ failures = ['', '--foo', 'a', 'a b c']
+ successes = [
+ ('a b', NS(foo='a', bar=['b'])),
+ ]
+
+
+class TestPositionalsNargs2None(ParserTestCase):
+ """Test a Positional with 2 nargs followed by one with none"""
+
+ argument_signatures = [Sig('foo', nargs=2), Sig('bar')]
+ failures = ['', '--foo', 'a', 'a b', 'a b c d']
+ successes = [
+ ('a b c', NS(foo=['a', 'b'], bar='c')),
+ ]
+
+
+class TestPositionalsNargsNoneZeroOrMore(ParserTestCase):
+ """Test a Positional with no nargs followed by one with unlimited"""
+
+ argument_signatures = [Sig('foo'), Sig('bar', nargs='*')]
+ failures = ['', '--foo']
+ successes = [
+ ('a', NS(foo='a', bar=[])),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('a b c', NS(foo='a', bar=['b', 'c'])),
+ ]
+
+
+class TestPositionalsNargsNoneOneOrMore(ParserTestCase):
+ """Test a Positional with no nargs followed by one with one or more"""
+
+ argument_signatures = [Sig('foo'), Sig('bar', nargs='+')]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo='a', bar=['b'])),
+ ('a b c', NS(foo='a', bar=['b', 'c'])),
+ ]
+
+
+class TestPositionalsNargsNoneOptional(ParserTestCase):
+ """Test a Positional with no nargs followed by one with an Optional"""
+
+ argument_signatures = [Sig('foo'), Sig('bar', nargs='?')]
+ failures = ['', '--foo', 'a b c']
+ successes = [
+ ('a', NS(foo='a', bar=None)),
+ ('a b', NS(foo='a', bar='b')),
+ ]
+
+
+class TestPositionalsNargsZeroOrMoreNone(ParserTestCase):
+ """Test a Positional with unlimited nargs followed by one with none"""
+
+ argument_signatures = [Sig('foo', nargs='*'), Sig('bar')]
+ failures = ['', '--foo']
+ successes = [
+ ('a', NS(foo=[], bar='a')),
+ ('a b', NS(foo=['a'], bar='b')),
+ ('a b c', NS(foo=['a', 'b'], bar='c')),
+ ]
+
+
+class TestPositionalsNargsOneOrMoreNone(ParserTestCase):
+ """Test a Positional with one or more nargs followed by one with none"""
+
+ argument_signatures = [Sig('foo', nargs='+'), Sig('bar')]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo=['a'], bar='b')),
+ ('a b c', NS(foo=['a', 'b'], bar='c')),
+ ]
+
+
+class TestPositionalsNargsOptionalNone(ParserTestCase):
+ """Test a Positional with an Optional nargs followed by one with none"""
+
+ argument_signatures = [Sig('foo', nargs='?', default=42), Sig('bar')]
+ failures = ['', '--foo', 'a b c']
+ successes = [
+ ('a', NS(foo=42, bar='a')),
+ ('a b', NS(foo='a', bar='b')),
+ ]
+
+
+class TestPositionalsNargs2ZeroOrMore(ParserTestCase):
+ """Test a Positional with 2 nargs followed by one with unlimited"""
+
+ argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='*')]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo=['a', 'b'], bar=[])),
+ ('a b c', NS(foo=['a', 'b'], bar=['c'])),
+ ]
+
+
+class TestPositionalsNargs2OneOrMore(ParserTestCase):
+ """Test a Positional with 2 nargs followed by one with one or more"""
+
+ argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='+')]
+ failures = ['', '--foo', 'a', 'a b']
+ successes = [
+ ('a b c', NS(foo=['a', 'b'], bar=['c'])),
+ ]
+
+
+class TestPositionalsNargs2Optional(ParserTestCase):
+ """Test a Positional with 2 nargs followed by one optional"""
+
+ argument_signatures = [Sig('foo', nargs=2), Sig('bar', nargs='?')]
+ failures = ['', '--foo', 'a', 'a b c d']
+ successes = [
+ ('a b', NS(foo=['a', 'b'], bar=None)),
+ ('a b c', NS(foo=['a', 'b'], bar='c')),
+ ]
+
+
+class TestPositionalsNargsZeroOrMore1(ParserTestCase):
+ """Test a Positional with unlimited nargs followed by one with 1"""
+
+ argument_signatures = [Sig('foo', nargs='*'), Sig('bar', nargs=1)]
+ failures = ['', '--foo', ]
+ successes = [
+ ('a', NS(foo=[], bar=['a'])),
+ ('a b', NS(foo=['a'], bar=['b'])),
+ ('a b c', NS(foo=['a', 'b'], bar=['c'])),
+ ]
+
+
+class TestPositionalsNargsOneOrMore1(ParserTestCase):
+ """Test a Positional with one or more nargs followed by one with 1"""
+
+ argument_signatures = [Sig('foo', nargs='+'), Sig('bar', nargs=1)]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo=['a'], bar=['b'])),
+ ('a b c', NS(foo=['a', 'b'], bar=['c'])),
+ ]
+
+
+class TestPositionalsNargsOptional1(ParserTestCase):
+ """Test a Positional with an Optional nargs followed by one with 1"""
+
+ argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs=1)]
+ failures = ['', '--foo', 'a b c']
+ successes = [
+ ('a', NS(foo=None, bar=['a'])),
+ ('a b', NS(foo='a', bar=['b'])),
+ ]
+
+
+class TestPositionalsNargsNoneZeroOrMore1(ParserTestCase):
+ """Test three Positionals: no nargs, unlimited nargs and 1 nargs"""
+
+ argument_signatures = [
+ Sig('foo'),
+ Sig('bar', nargs='*'),
+ Sig('baz', nargs=1),
+ ]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo='a', bar=[], baz=['b'])),
+ ('a b c', NS(foo='a', bar=['b'], baz=['c'])),
+ ]
+
+
+class TestPositionalsNargsNoneOneOrMore1(ParserTestCase):
+ """Test three Positionals: no nargs, one or more nargs and 1 nargs"""
+
+ argument_signatures = [
+ Sig('foo'),
+ Sig('bar', nargs='+'),
+ Sig('baz', nargs=1),
+ ]
+ failures = ['', '--foo', 'a', 'b']
+ successes = [
+ ('a b c', NS(foo='a', bar=['b'], baz=['c'])),
+ ('a b c d', NS(foo='a', bar=['b', 'c'], baz=['d'])),
+ ]
+
+
+class TestPositionalsNargsNoneOptional1(ParserTestCase):
+ """Test three Positionals: no nargs, optional narg and 1 nargs"""
+
+ argument_signatures = [
+ Sig('foo'),
+ Sig('bar', nargs='?', default=0.625),
+ Sig('baz', nargs=1),
+ ]
+ failures = ['', '--foo', 'a']
+ successes = [
+ ('a b', NS(foo='a', bar=0.625, baz=['b'])),
+ ('a b c', NS(foo='a', bar='b', baz=['c'])),
+ ]
+
+
+class TestPositionalsNargsOptionalOptional(ParserTestCase):
+ """Test two optional nargs"""
+
+ argument_signatures = [
+ Sig('foo', nargs='?'),
+ Sig('bar', nargs='?', default=42),
+ ]
+ failures = ['--foo', 'a b c']
+ successes = [
+ ('', NS(foo=None, bar=42)),
+ ('a', NS(foo='a', bar=42)),
+ ('a b', NS(foo='a', bar='b')),
+ ]
+
+
+class TestPositionalsNargsOptionalZeroOrMore(ParserTestCase):
+ """Test an Optional narg followed by unlimited nargs"""
+
+ argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs='*')]
+ failures = ['--foo']
+ successes = [
+ ('', NS(foo=None, bar=[])),
+ ('a', NS(foo='a', bar=[])),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('a b c', NS(foo='a', bar=['b', 'c'])),
+ ]
+
+
+class TestPositionalsNargsOptionalOneOrMore(ParserTestCase):
+ """Test an Optional narg followed by one or more nargs"""
+
+ argument_signatures = [Sig('foo', nargs='?'), Sig('bar', nargs='+')]
+ failures = ['', '--foo']
+ successes = [
+ ('a', NS(foo=None, bar=['a'])),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('a b c', NS(foo='a', bar=['b', 'c'])),
+ ]
+
+
+class TestPositionalsChoicesString(ParserTestCase):
+ """Test a set of single-character choices"""
+
+ argument_signatures = [Sig('spam', choices=set('abcdefg'))]
+ failures = ['', '--foo', 'h', '42', 'ef']
+ successes = [
+ ('a', NS(spam='a')),
+ ('g', NS(spam='g')),
+ ]
+
+
+class TestPositionalsChoicesInt(ParserTestCase):
+ """Test a set of integer choices"""
+
+ argument_signatures = [Sig('spam', type=int, choices=range(20))]
+ failures = ['', '--foo', 'h', '42', 'ef']
+ successes = [
+ ('4', NS(spam=4)),
+ ('15', NS(spam=15)),
+ ]
+
+
+class TestPositionalsActionAppend(ParserTestCase):
+ """Test the 'append' action"""
+
+ argument_signatures = [
+ Sig('spam', action='append'),
+ Sig('spam', action='append', nargs=2),
+ ]
+ failures = ['', '--foo', 'a', 'a b', 'a b c d']
+ successes = [
+ ('a b c', NS(spam=['a', ['b', 'c']])),
+ ]
+
+# ========================================
+# Combined optionals and positionals tests
+# ========================================
+
+class TestOptionalsNumericAndPositionals(ParserTestCase):
+ """Tests negative number args when numeric options are present"""
+
+ argument_signatures = [
+ Sig('x', nargs='?'),
+ Sig('-4', dest='y', action='store_true'),
+ ]
+ failures = ['-2', '-315']
+ successes = [
+ ('', NS(x=None, y=False)),
+ ('a', NS(x='a', y=False)),
+ ('-4', NS(x=None, y=True)),
+ ('-4 a', NS(x='a', y=True)),
+ ]
+
+
+class TestOptionalsAlmostNumericAndPositionals(ParserTestCase):
+ """Tests negative number args when almost numeric options are present"""
+
+ argument_signatures = [
+ Sig('x', nargs='?'),
+ Sig('-k4', dest='y', action='store_true'),
+ ]
+ failures = ['-k3']
+ successes = [
+ ('', NS(x=None, y=False)),
+ ('-2', NS(x='-2', y=False)),
+ ('a', NS(x='a', y=False)),
+ ('-k4', NS(x=None, y=True)),
+ ('-k4 a', NS(x='a', y=True)),
+ ]
+
+
+class TestEmptyAndSpaceContainingArguments(ParserTestCase):
+
+ argument_signatures = [
+ Sig('x', nargs='?'),
+ Sig('-y', '--yyy', dest='y'),
+ ]
+ failures = ['-y']
+ successes = [
+ ([''], NS(x='', y=None)),
+ (['a badger'], NS(x='a badger', y=None)),
+ (['-a badger'], NS(x='-a badger', y=None)),
+ (['-y', ''], NS(x=None, y='')),
+ (['-y', 'a badger'], NS(x=None, y='a badger')),
+ (['-y', '-a badger'], NS(x=None, y='-a badger')),
+ (['--yyy=a badger'], NS(x=None, y='a badger')),
+ (['--yyy=-a badger'], NS(x=None, y='-a badger')),
+ ]
+
+
+class TestPrefixCharacterOnlyArguments(ParserTestCase):
+
+ parser_signature = Sig(prefix_chars='-+')
+ argument_signatures = [
+ Sig('-', dest='x', nargs='?', const='badger'),
+ Sig('+', dest='y', type=int, default=42),
+ Sig('-+-', dest='z', action='store_true'),
+ ]
+ failures = ['-y', '+ -']
+ successes = [
+ ('', NS(x=None, y=42, z=False)),
+ ('-', NS(x='badger', y=42, z=False)),
+ ('- X', NS(x='X', y=42, z=False)),
+ ('+ -3', NS(x=None, y=-3, z=False)),
+ ('-+-', NS(x=None, y=42, z=True)),
+ ('- ===', NS(x='===', y=42, z=False)),
+ ]
+
+
+class TestNargsZeroOrMore(ParserTestCase):
+ """Tests specifying an args for an Optional that accepts zero or more"""
+
+ argument_signatures = [Sig('-x', nargs='*'), Sig('y', nargs='*')]
+ failures = []
+ successes = [
+ ('', NS(x=None, y=[])),
+ ('-x', NS(x=[], y=[])),
+ ('-x a', NS(x=['a'], y=[])),
+ ('-x a -- b', NS(x=['a'], y=['b'])),
+ ('a', NS(x=None, y=['a'])),
+ ('a -x', NS(x=[], y=['a'])),
+ ('a -x b', NS(x=['b'], y=['a'])),
+ ]
+
+
+class TestNargsRemainder(ParserTestCase):
+ """Tests specifying a positional with nargs=REMAINDER"""
+
+ argument_signatures = [Sig('x'), Sig('y', nargs='...'), Sig('-z')]
+ failures = ['', '-z', '-z Z']
+ successes = [
+ ('X', NS(x='X', y=[], z=None)),
+ ('-z Z X', NS(x='X', y=[], z='Z')),
+ ('X A B -z Z', NS(x='X', y=['A', 'B', '-z', 'Z'], z=None)),
+ ('X Y --foo', NS(x='X', y=['Y', '--foo'], z=None)),
+ ]
+
+
+class TestOptionLike(ParserTestCase):
+ """Tests options that may or may not be arguments"""
+
+ argument_signatures = [
+ Sig('-x', type=float),
+ Sig('-3', type=float, dest='y'),
+ Sig('z', nargs='*'),
+ ]
+ failures = ['-x', '-y2.5', '-xa', '-x -a',
+ '-x -3', '-x -3.5', '-3 -3.5',
+ '-x -2.5', '-x -2.5 a', '-3 -.5',
+ 'a x -1', '-x -1 a', '-3 -1 a']
+ successes = [
+ ('', NS(x=None, y=None, z=[])),
+ ('-x 2.5', NS(x=2.5, y=None, z=[])),
+ ('-x 2.5 a', NS(x=2.5, y=None, z=['a'])),
+ ('-3.5', NS(x=None, y=0.5, z=[])),
+ ('-3-.5', NS(x=None, y=-0.5, z=[])),
+ ('-3 .5', NS(x=None, y=0.5, z=[])),
+ ('a -3.5', NS(x=None, y=0.5, z=['a'])),
+ ('a', NS(x=None, y=None, z=['a'])),
+ ('a -x 1', NS(x=1.0, y=None, z=['a'])),
+ ('-x 1 a', NS(x=1.0, y=None, z=['a'])),
+ ('-3 1 a', NS(x=None, y=1.0, z=['a'])),
+ ]
+
+
+class TestDefaultSuppress(ParserTestCase):
+ """Test actions with suppressed defaults"""
+
+ argument_signatures = [
+ Sig('foo', nargs='?', default=argparse.SUPPRESS),
+ Sig('bar', nargs='*', default=argparse.SUPPRESS),
+ Sig('--baz', action='store_true', default=argparse.SUPPRESS),
+ ]
+ failures = ['-x']
+ successes = [
+ ('', NS()),
+ ('a', NS(foo='a')),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('--baz', NS(baz=True)),
+ ('a --baz', NS(foo='a', baz=True)),
+ ('--baz a b', NS(foo='a', bar=['b'], baz=True)),
+ ]
+
+
+class TestParserDefaultSuppress(ParserTestCase):
+ """Test actions with a parser-level default of SUPPRESS"""
+
+ parser_signature = Sig(argument_default=argparse.SUPPRESS)
+ argument_signatures = [
+ Sig('foo', nargs='?'),
+ Sig('bar', nargs='*'),
+ Sig('--baz', action='store_true'),
+ ]
+ failures = ['-x']
+ successes = [
+ ('', NS()),
+ ('a', NS(foo='a')),
+ ('a b', NS(foo='a', bar=['b'])),
+ ('--baz', NS(baz=True)),
+ ('a --baz', NS(foo='a', baz=True)),
+ ('--baz a b', NS(foo='a', bar=['b'], baz=True)),
+ ]
+
+
+class TestParserDefault42(ParserTestCase):
+ """Test actions with a parser-level default of 42"""
+
+ parser_signature = Sig(argument_default=42, version='1.0')
+ argument_signatures = [
+ Sig('foo', nargs='?'),
+ Sig('bar', nargs='*'),
+ Sig('--baz', action='store_true'),
+ ]
+ failures = ['-x']
+ successes = [
+ ('', NS(foo=42, bar=42, baz=42)),
+ ('a', NS(foo='a', bar=42, baz=42)),
+ ('a b', NS(foo='a', bar=['b'], baz=42)),
+ ('--baz', NS(foo=42, bar=42, baz=True)),
+ ('a --baz', NS(foo='a', bar=42, baz=True)),
+ ('--baz a b', NS(foo='a', bar=['b'], baz=True)),
+ ]
+
+
+class TestArgumentsFromFile(TempDirMixin, ParserTestCase):
+ """Test reading arguments from a file"""
+
+ def setUp(self):
+ super(TestArgumentsFromFile, self).setUp()
+ file_texts = [
+ ('hello', 'hello world!\n'),
+ ('recursive', '-a\n'
+ 'A\n'
+ '@hello'),
+ ('invalid', '@no-such-path\n'),
+ ]
+ for path, text in file_texts:
+ file = open(path, 'w')
+ file.write(text)
+ file.close()
+
+ parser_signature = Sig(fromfile_prefix_chars='@')
+ argument_signatures = [
+ Sig('-a'),
+ Sig('x'),
+ Sig('y', nargs='+'),
+ ]
+ failures = ['', '-b', 'X', '@invalid', '@missing']
+ successes = [
+ ('X Y', NS(a=None, x='X', y=['Y'])),
+ ('X -a A Y Z', NS(a='A', x='X', y=['Y', 'Z'])),
+ ('@hello X', NS(a=None, x='hello world!', y=['X'])),
+ ('X @hello', NS(a=None, x='X', y=['hello world!'])),
+ ('-a B @recursive Y Z', NS(a='A', x='hello world!', y=['Y', 'Z'])),
+ ('X @recursive Z -a B', NS(a='B', x='X', y=['hello world!', 'Z'])),
+ ]
+
+
+class TestArgumentsFromFileConverter(TempDirMixin, ParserTestCase):
+ """Test reading arguments from a file"""
+
+ def setUp(self):
+ super(TestArgumentsFromFileConverter, self).setUp()
+ file_texts = [
+ ('hello', 'hello world!\n'),
+ ]
+ for path, text in file_texts:
+ file = open(path, 'w')
+ file.write(text)
+ file.close()
+
+ class FromFileConverterArgumentParser(ErrorRaisingArgumentParser):
+
+ def convert_arg_line_to_args(self, arg_line):
+ for arg in arg_line.split():
+ if not arg.strip():
+ continue
+ yield arg
+ parser_class = FromFileConverterArgumentParser
+ parser_signature = Sig(fromfile_prefix_chars='@')
+ argument_signatures = [
+ Sig('y', nargs='+'),
+ ]
+ failures = []
+ successes = [
+ ('@hello X', NS(y=['hello', 'world!', 'X'])),
+ ]
+
+
+# =====================
+# Type conversion tests
+# =====================
+
+class TestFileTypeRepr(TestCase):
+
+ def test_r(self):
+ type = argparse.FileType('r')
+ self.assertEqual("FileType('r')", repr(type))
+
+ def test_wb_1(self):
+ type = argparse.FileType('wb', 1)
+ self.assertEqual("FileType('wb', 1)", repr(type))
+
+
+class RFile(object):
+ seen = {}
+
+ def __init__(self, name):
+ self.name = name
+
+ __hash__ = None
+
+ def __eq__(self, other):
+ if other in self.seen:
+ text = self.seen[other]
+ else:
+ text = self.seen[other] = other.read()
+ other.close()
+ if not isinstance(text, str):
+ text = text.decode('ascii')
+ return self.name == other.name == text
+
+
+class TestFileTypeR(TempDirMixin, ParserTestCase):
+ """Test the FileType option/argument type for reading files"""
+
+ def setUp(self):
+ super(TestFileTypeR, self).setUp()
+ for file_name in ['foo', 'bar']:
+ file = open(os.path.join(self.temp_dir, file_name), 'w')
+ file.write(file_name)
+ file.close()
+ self.create_readonly_file('readonly')
+
+ argument_signatures = [
+ Sig('-x', type=argparse.FileType()),
+ Sig('spam', type=argparse.FileType('r')),
+ ]
+ failures = ['-x', '-x bar', 'non-existent-file.txt']
+ successes = [
+ ('foo', NS(x=None, spam=RFile('foo'))),
+ ('-x foo bar', NS(x=RFile('foo'), spam=RFile('bar'))),
+ ('bar -x foo', NS(x=RFile('foo'), spam=RFile('bar'))),
+ ('-x - -', NS(x=sys.stdin, spam=sys.stdin)),
+ ('readonly', NS(x=None, spam=RFile('readonly'))),
+ ]
+
+
+class TestFileTypeRB(TempDirMixin, ParserTestCase):
+ """Test the FileType option/argument type for reading files"""
+
+ def setUp(self):
+ super(TestFileTypeRB, self).setUp()
+ for file_name in ['foo', 'bar']:
+ file = open(os.path.join(self.temp_dir, file_name), 'w')
+ file.write(file_name)
+ file.close()
+
+ argument_signatures = [
+ Sig('-x', type=argparse.FileType('rb')),
+ Sig('spam', type=argparse.FileType('rb')),
+ ]
+ failures = ['-x', '-x bar']
+ successes = [
+ ('foo', NS(x=None, spam=RFile('foo'))),
+ ('-x foo bar', NS(x=RFile('foo'), spam=RFile('bar'))),
+ ('bar -x foo', NS(x=RFile('foo'), spam=RFile('bar'))),
+ ('-x - -', NS(x=sys.stdin, spam=sys.stdin)),
+ ]
+
+
+class WFile(object):
+ seen = set()
+
+ def __init__(self, name):
+ self.name = name
+
+ __hash__ = None
+
+ def __eq__(self, other):
+ if other not in self.seen:
+ text = 'Check that file is writable.'
+ if 'b' in other.mode:
+ text = text.encode('ascii')
+ other.write(text)
+ other.close()
+ self.seen.add(other)
+ return self.name == other.name
+
+
+class TestFileTypeW(TempDirMixin, ParserTestCase):
+ """Test the FileType option/argument type for writing files"""
+
+ def setUp(self):
+ super(TestFileTypeW, self).setUp()
+ self.create_readonly_file('readonly')
+
+ argument_signatures = [
+ Sig('-x', type=argparse.FileType('w')),
+ Sig('spam', type=argparse.FileType('w')),
+ ]
+ failures = ['-x', '-x bar']
+ failures = ['-x', '-x bar', 'readonly']
+ successes = [
+ ('foo', NS(x=None, spam=WFile('foo'))),
+ ('-x foo bar', NS(x=WFile('foo'), spam=WFile('bar'))),
+ ('bar -x foo', NS(x=WFile('foo'), spam=WFile('bar'))),
+ ('-x - -', NS(x=sys.stdout, spam=sys.stdout)),
+ ]
+
+
+class TestFileTypeWB(TempDirMixin, ParserTestCase):
+
+ argument_signatures = [
+ Sig('-x', type=argparse.FileType('wb')),
+ Sig('spam', type=argparse.FileType('wb')),
+ ]
+ failures = ['-x', '-x bar']
+ successes = [
+ ('foo', NS(x=None, spam=WFile('foo'))),
+ ('-x foo bar', NS(x=WFile('foo'), spam=WFile('bar'))),
+ ('bar -x foo', NS(x=WFile('foo'), spam=WFile('bar'))),
+ ('-x - -', NS(x=sys.stdout, spam=sys.stdout)),
+ ]
+
+
+class TestTypeCallable(ParserTestCase):
+ """Test some callables as option/argument types"""
+
+ argument_signatures = [
+ Sig('--eggs', type=complex),
+ Sig('spam', type=float),
+ ]
+ failures = ['a', '42j', '--eggs a', '--eggs 2i']
+ successes = [
+ ('--eggs=42 42', NS(eggs=42, spam=42.0)),
+ ('--eggs 2j -- -1.5', NS(eggs=2j, spam=-1.5)),
+ ('1024.675', NS(eggs=None, spam=1024.675)),
+ ]
+
+
+class TestTypeUserDefined(ParserTestCase):
+ """Test a user-defined option/argument type"""
+
+ class MyType(TestCase):
+
+ def __init__(self, value):
+ self.value = value
+
+ __hash__ = None
+
+ def __eq__(self, other):
+ return (type(self), self.value) == (type(other), other.value)
+
+ argument_signatures = [
+ Sig('-x', type=MyType),
+ Sig('spam', type=MyType),
+ ]
+ failures = []
+ successes = [
+ ('a -x b', NS(x=MyType('b'), spam=MyType('a'))),
+ ('-xf g', NS(x=MyType('f'), spam=MyType('g'))),
+ ]
+
+
+class TestTypeClassicClass(ParserTestCase):
+ """Test a classic class type"""
+
+ class C:
+
+ def __init__(self, value):
+ self.value = value
+
+ __hash__ = None
+
+ def __eq__(self, other):
+ return (type(self), self.value) == (type(other), other.value)
+
+ argument_signatures = [
+ Sig('-x', type=C),
+ Sig('spam', type=C),
+ ]
+ failures = []
+ successes = [
+ ('a -x b', NS(x=C('b'), spam=C('a'))),
+ ('-xf g', NS(x=C('f'), spam=C('g'))),
+ ]
+
+
+class TestTypeRegistration(TestCase):
+ """Test a user-defined type by registering it"""
+
+ def test(self):
+
+ def get_my_type(string):
+ return 'my_type{%s}' % string
+
+ parser = argparse.ArgumentParser()
+ parser.register('type', 'my_type', get_my_type)
+ parser.add_argument('-x', type='my_type')
+ parser.add_argument('y', type='my_type')
+
+ self.assertEqual(parser.parse_args('1'.split()),
+ NS(x=None, y='my_type{1}'))
+ self.assertEqual(parser.parse_args('-x 1 42'.split()),
+ NS(x='my_type{1}', y='my_type{42}'))
+
+
+# ============
+# Action tests
+# ============
+
+class TestActionUserDefined(ParserTestCase):
+ """Test a user-defined option/argument action"""
+
+ class OptionalAction(argparse.Action):
+
+ def __call__(self, parser, namespace, value, option_string=None):
+ try:
+ # check destination and option string
+ assert self.dest == 'spam', 'dest: %s' % self.dest
+ assert option_string == '-s', 'flag: %s' % option_string
+ # when option is before argument, badger=2, and when
+ # option is after argument, badger=<whatever was set>
+ expected_ns = NS(spam=0.25)
+ if value in [0.125, 0.625]:
+ expected_ns.badger = 2
+ elif value in [2.0]:
+ expected_ns.badger = 84
+ else:
+ raise AssertionError('value: %s' % value)
+ assert expected_ns == namespace, ('expected %s, got %s' %
+ (expected_ns, namespace))
+ except AssertionError:
+ e = sys.exc_info()[1]
+ raise ArgumentParserError('opt_action failed: %s' % e)
+ setattr(namespace, 'spam', value)
+
+ class PositionalAction(argparse.Action):
+
+ def __call__(self, parser, namespace, value, option_string=None):
+ try:
+ assert option_string is None, ('option_string: %s' %
+ option_string)
+ # check destination
+ assert self.dest == 'badger', 'dest: %s' % self.dest
+ # when argument is before option, spam=0.25, and when
+ # option is after argument, spam=<whatever was set>
+ expected_ns = NS(badger=2)
+ if value in [42, 84]:
+ expected_ns.spam = 0.25
+ elif value in [1]:
+ expected_ns.spam = 0.625
+ elif value in [2]:
+ expected_ns.spam = 0.125
+ else:
+ raise AssertionError('value: %s' % value)
+ assert expected_ns == namespace, ('expected %s, got %s' %
+ (expected_ns, namespace))
+ except AssertionError:
+ e = sys.exc_info()[1]
+ raise ArgumentParserError('arg_action failed: %s' % e)
+ setattr(namespace, 'badger', value)
+
+ argument_signatures = [
+ Sig('-s', dest='spam', action=OptionalAction,
+ type=float, default=0.25),
+ Sig('badger', action=PositionalAction,
+ type=int, nargs='?', default=2),
+ ]
+ failures = []
+ successes = [
+ ('-s0.125', NS(spam=0.125, badger=2)),
+ ('42', NS(spam=0.25, badger=42)),
+ ('-s 0.625 1', NS(spam=0.625, badger=1)),
+ ('84 -s2', NS(spam=2.0, badger=84)),
+ ]
+
+
+class TestActionRegistration(TestCase):
+ """Test a user-defined action supplied by registering it"""
+
+ class MyAction(argparse.Action):
+
+ def __call__(self, parser, namespace, values, option_string=None):
+ setattr(namespace, self.dest, 'foo[%s]' % values)
+
+ def test(self):
+
+ parser = argparse.ArgumentParser()
+ parser.register('action', 'my_action', self.MyAction)
+ parser.add_argument('badger', action='my_action')
+
+ self.assertEqual(parser.parse_args(['1']), NS(badger='foo[1]'))
+ self.assertEqual(parser.parse_args(['42']), NS(badger='foo[42]'))
+
+
+# ================
+# Subparsers tests
+# ================
+
+class TestAddSubparsers(TestCase):
+ """Test the add_subparsers method"""
+
+ def assertArgumentParserError(self, *args, **kwargs):
+ self.assertRaises(ArgumentParserError, *args, **kwargs)
+
+ def _get_parser(self, subparser_help=False, prefix_chars=None):
+ # create a parser with a subparsers argument
+ if prefix_chars:
+ parser = ErrorRaisingArgumentParser(
+ prog='PROG', description='main description', prefix_chars=prefix_chars)
+ parser.add_argument(
+ prefix_chars[0] * 2 + 'foo', action='store_true', help='foo help')
+ else:
+ parser = ErrorRaisingArgumentParser(
+ prog='PROG', description='main description')
+ parser.add_argument(
+ '--foo', action='store_true', help='foo help')
+ parser.add_argument(
+ 'bar', type=float, help='bar help')
+
+ # check that only one subparsers argument can be added
+ subparsers = parser.add_subparsers(help='command help')
+ self.assertArgumentParserError(parser.add_subparsers)
+
+ # add first sub-parser
+ parser1_kwargs = dict(description='1 description')
+ if subparser_help:
+ parser1_kwargs['help'] = '1 help'
+ parser1 = subparsers.add_parser('1', **parser1_kwargs)
+ parser1.add_argument('-w', type=int, help='w help')
+ parser1.add_argument('x', choices='abc', help='x help')
+
+ # add second sub-parser
+ parser2_kwargs = dict(description='2 description')
+ if subparser_help:
+ parser2_kwargs['help'] = '2 help'
+ parser2 = subparsers.add_parser('2', **parser2_kwargs)
+ parser2.add_argument('-y', choices='123', help='y help')
+ parser2.add_argument('z', type=complex, nargs='*', help='z help')
+
+ # return the main parser
+ return parser
+
+ def setUp(self):
+ super(TestAddSubparsers, self).setUp()
+ self.parser = self._get_parser()
+ self.command_help_parser = self._get_parser(subparser_help=True)
+
+ def test_parse_args_failures(self):
+ # check some failure cases:
+ for args_str in ['', 'a', 'a a', '0.5 a', '0.5 1',
+ '0.5 1 -y', '0.5 2 -w']:
+ args = args_str.split()
+ self.assertArgumentParserError(self.parser.parse_args, args)
+
+ def test_parse_args(self):
+ # check some non-failure cases:
+ self.assertEqual(
+ self.parser.parse_args('0.5 1 b -w 7'.split()),
+ NS(foo=False, bar=0.5, w=7, x='b'),
+ )
+ self.assertEqual(
+ self.parser.parse_args('0.25 --foo 2 -y 2 3j -- -1j'.split()),
+ NS(foo=True, bar=0.25, y='2', z=[3j, -1j]),
+ )
+ self.assertEqual(
+ self.parser.parse_args('--foo 0.125 1 c'.split()),
+ NS(foo=True, bar=0.125, w=None, x='c'),
+ )
+
+ def test_parse_known_args(self):
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 1 b -w 7'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), []),
+ )
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 -p 1 b -w 7'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), ['-p']),
+ )
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 1 b -w 7 -p'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), ['-p']),
+ )
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 1 b -q -rs -w 7'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), ['-q', '-rs']),
+ )
+ self.assertEqual(
+ self.parser.parse_known_args('0.5 -W 1 b -X Y -w 7 Z'.split()),
+ (NS(foo=False, bar=0.5, w=7, x='b'), ['-W', '-X', 'Y', 'Z']),
+ )
+
+ def test_dest(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.add_argument('--foo', action='store_true')
+ subparsers = parser.add_subparsers(dest='bar')
+ parser1 = subparsers.add_parser('1')
+ parser1.add_argument('baz')
+ self.assertEqual(NS(foo=False, bar='1', baz='2'),
+ parser.parse_args('1 2'.split()))
+
+ def test_help(self):
+ self.assertEqual(self.parser.format_usage(),
+ 'usage: PROG [-h] [--foo] bar {1,2} ...\n')
+ self.assertEqual(self.parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [--foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+ {1,2} command help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo foo help
+ '''))
+
+ def test_help_extra_prefix_chars(self):
+ # Make sure - is still used for help if it is a non-first prefix char
+ parser = self._get_parser(prefix_chars='+:-')
+ self.assertEqual(parser.format_usage(),
+ 'usage: PROG [-h] [++foo] bar {1,2} ...\n')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [++foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+ {1,2} command help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ ++foo foo help
+ '''))
+
+
+ def test_help_alternate_prefix_chars(self):
+ parser = self._get_parser(prefix_chars='+:/')
+ self.assertEqual(parser.format_usage(),
+ 'usage: PROG [+h] [++foo] bar {1,2} ...\n')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [+h] [++foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+ {1,2} command help
+
+ optional arguments:
+ +h, ++help show this help message and exit
+ ++foo foo help
+ '''))
+
+ def test_parser_command_help(self):
+ self.assertEqual(self.command_help_parser.format_usage(),
+ 'usage: PROG [-h] [--foo] bar {1,2} ...\n')
+ self.assertEqual(self.command_help_parser.format_help(),
+ textwrap.dedent('''\
+ usage: PROG [-h] [--foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+ {1,2} command help
+ 1 1 help
+ 2 2 help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo foo help
+ '''))
+
+ def test_subparser_title_help(self):
+ parser = ErrorRaisingArgumentParser(prog='PROG',
+ description='main description')
+ parser.add_argument('--foo', action='store_true', help='foo help')
+ parser.add_argument('bar', help='bar help')
+ subparsers = parser.add_subparsers(title='subcommands',
+ description='command help',
+ help='additional text')
+ parser1 = subparsers.add_parser('1')
+ parser2 = subparsers.add_parser('2')
+ self.assertEqual(parser.format_usage(),
+ 'usage: PROG [-h] [--foo] bar {1,2} ...\n')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [--foo] bar {1,2} ...
+
+ main description
+
+ positional arguments:
+ bar bar help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo foo help
+
+ subcommands:
+ command help
+
+ {1,2} additional text
+ '''))
+
+ def _test_subparser_help(self, args_str, expected_help):
+ try:
+ self.parser.parse_args(args_str.split())
+ except ArgumentParserError:
+ err = sys.exc_info()[1]
+ if err.stdout != expected_help:
+ print(repr(expected_help))
+ print(repr(err.stdout))
+ self.assertEqual(err.stdout, expected_help)
+
+ def test_subparser1_help(self):
+ self._test_subparser_help('5.0 1 -h', textwrap.dedent('''\
+ usage: PROG bar 1 [-h] [-w W] {a,b,c}
+
+ 1 description
+
+ positional arguments:
+ {a,b,c} x help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w W w help
+ '''))
+
+ def test_subparser2_help(self):
+ self._test_subparser_help('5.0 2 -h', textwrap.dedent('''\
+ usage: PROG bar 2 [-h] [-y {1,2,3}] [z [z ...]]
+
+ 2 description
+
+ positional arguments:
+ z z help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -y {1,2,3} y help
+ '''))
+
+# ============
+# Groups tests
+# ============
+
+class TestPositionalsGroups(TestCase):
+ """Tests that order of group positionals matches construction order"""
+
+ def test_nongroup_first(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.add_argument('foo')
+ group = parser.add_argument_group('g')
+ group.add_argument('bar')
+ parser.add_argument('baz')
+ expected = NS(foo='1', bar='2', baz='3')
+ result = parser.parse_args('1 2 3'.split())
+ self.assertEqual(expected, result)
+
+ def test_group_first(self):
+ parser = ErrorRaisingArgumentParser()
+ group = parser.add_argument_group('xxx')
+ group.add_argument('foo')
+ parser.add_argument('bar')
+ parser.add_argument('baz')
+ expected = NS(foo='1', bar='2', baz='3')
+ result = parser.parse_args('1 2 3'.split())
+ self.assertEqual(expected, result)
+
+ def test_interleaved_groups(self):
+ parser = ErrorRaisingArgumentParser()
+ group = parser.add_argument_group('xxx')
+ parser.add_argument('foo')
+ group.add_argument('bar')
+ parser.add_argument('baz')
+ group = parser.add_argument_group('yyy')
+ group.add_argument('frell')
+ expected = NS(foo='1', bar='2', baz='3', frell='4')
+ result = parser.parse_args('1 2 3 4'.split())
+ self.assertEqual(expected, result)
+
+# ===================
+# Parent parser tests
+# ===================
+
+class TestParentParsers(TestCase):
+ """Tests that parsers can be created with parent parsers"""
+
+ def assertArgumentParserError(self, *args, **kwargs):
+ self.assertRaises(ArgumentParserError, *args, **kwargs)
+
+ def setUp(self):
+ super(TestParentParsers, self).setUp()
+ self.wxyz_parent = ErrorRaisingArgumentParser(add_help=False)
+ self.wxyz_parent.add_argument('--w')
+ x_group = self.wxyz_parent.add_argument_group('x')
+ x_group.add_argument('-y')
+ self.wxyz_parent.add_argument('z')
+
+ self.abcd_parent = ErrorRaisingArgumentParser(add_help=False)
+ self.abcd_parent.add_argument('a')
+ self.abcd_parent.add_argument('-b')
+ c_group = self.abcd_parent.add_argument_group('c')
+ c_group.add_argument('--d')
+
+ self.w_parent = ErrorRaisingArgumentParser(add_help=False)
+ self.w_parent.add_argument('--w')
+
+ self.z_parent = ErrorRaisingArgumentParser(add_help=False)
+ self.z_parent.add_argument('z')
+
+ # parents with mutually exclusive groups
+ self.ab_mutex_parent = ErrorRaisingArgumentParser(add_help=False)
+ group = self.ab_mutex_parent.add_mutually_exclusive_group()
+ group.add_argument('-a', action='store_true')
+ group.add_argument('-b', action='store_true')
+
+ self.main_program = os.path.basename(sys.argv[0])
+
+ def test_single_parent(self):
+ parser = ErrorRaisingArgumentParser(parents=[self.wxyz_parent])
+ self.assertEqual(parser.parse_args('-y 1 2 --w 3'.split()),
+ NS(w='3', y='1', z='2'))
+
+ def test_single_parent_mutex(self):
+ self._test_mutex_ab(self.ab_mutex_parent.parse_args)
+ parser = ErrorRaisingArgumentParser(parents=[self.ab_mutex_parent])
+ self._test_mutex_ab(parser.parse_args)
+
+ def test_single_granparent_mutex(self):
+ parents = [self.ab_mutex_parent]
+ parser = ErrorRaisingArgumentParser(add_help=False, parents=parents)
+ parser = ErrorRaisingArgumentParser(parents=[parser])
+ self._test_mutex_ab(parser.parse_args)
+
+ def _test_mutex_ab(self, parse_args):
+ self.assertEqual(parse_args([]), NS(a=False, b=False))
+ self.assertEqual(parse_args(['-a']), NS(a=True, b=False))
+ self.assertEqual(parse_args(['-b']), NS(a=False, b=True))
+ self.assertArgumentParserError(parse_args, ['-a', '-b'])
+ self.assertArgumentParserError(parse_args, ['-b', '-a'])
+ self.assertArgumentParserError(parse_args, ['-c'])
+ self.assertArgumentParserError(parse_args, ['-a', '-c'])
+ self.assertArgumentParserError(parse_args, ['-b', '-c'])
+
+ def test_multiple_parents(self):
+ parents = [self.abcd_parent, self.wxyz_parent]
+ parser = ErrorRaisingArgumentParser(parents=parents)
+ self.assertEqual(parser.parse_args('--d 1 --w 2 3 4'.split()),
+ NS(a='3', b=None, d='1', w='2', y=None, z='4'))
+
+ def test_multiple_parents_mutex(self):
+ parents = [self.ab_mutex_parent, self.wxyz_parent]
+ parser = ErrorRaisingArgumentParser(parents=parents)
+ self.assertEqual(parser.parse_args('-a --w 2 3'.split()),
+ NS(a=True, b=False, w='2', y=None, z='3'))
+ self.assertArgumentParserError(
+ parser.parse_args, '-a --w 2 3 -b'.split())
+ self.assertArgumentParserError(
+ parser.parse_args, '-a -b --w 2 3'.split())
+
+ def test_conflicting_parents(self):
+ self.assertRaises(
+ argparse.ArgumentError,
+ argparse.ArgumentParser,
+ parents=[self.w_parent, self.wxyz_parent])
+
+ def test_conflicting_parents_mutex(self):
+ self.assertRaises(
+ argparse.ArgumentError,
+ argparse.ArgumentParser,
+ parents=[self.abcd_parent, self.ab_mutex_parent])
+
+ def test_same_argument_name_parents(self):
+ parents = [self.wxyz_parent, self.z_parent]
+ parser = ErrorRaisingArgumentParser(parents=parents)
+ self.assertEqual(parser.parse_args('1 2'.split()),
+ NS(w=None, y=None, z='2'))
+
+ def test_subparser_parents(self):
+ parser = ErrorRaisingArgumentParser()
+ subparsers = parser.add_subparsers()
+ abcde_parser = subparsers.add_parser('bar', parents=[self.abcd_parent])
+ abcde_parser.add_argument('e')
+ self.assertEqual(parser.parse_args('bar -b 1 --d 2 3 4'.split()),
+ NS(a='3', b='1', d='2', e='4'))
+
+ def test_subparser_parents_mutex(self):
+ parser = ErrorRaisingArgumentParser()
+ subparsers = parser.add_subparsers()
+ parents = [self.ab_mutex_parent]
+ abc_parser = subparsers.add_parser('foo', parents=parents)
+ c_group = abc_parser.add_argument_group('c_group')
+ c_group.add_argument('c')
+ parents = [self.wxyz_parent, self.ab_mutex_parent]
+ wxyzabe_parser = subparsers.add_parser('bar', parents=parents)
+ wxyzabe_parser.add_argument('e')
+ self.assertEqual(parser.parse_args('foo -a 4'.split()),
+ NS(a=True, b=False, c='4'))
+ self.assertEqual(parser.parse_args('bar -b --w 2 3 4'.split()),
+ NS(a=False, b=True, w='2', y=None, z='3', e='4'))
+ self.assertArgumentParserError(
+ parser.parse_args, 'foo -a -b 4'.split())
+ self.assertArgumentParserError(
+ parser.parse_args, 'bar -b -a 4'.split())
+
+ def test_parent_help(self):
+ parents = [self.abcd_parent, self.wxyz_parent]
+ parser = ErrorRaisingArgumentParser(parents=parents)
+ parser_help = parser.format_help()
+ self.assertEqual(parser_help, textwrap.dedent('''\
+ usage: {} [-h] [-b B] [--d D] [--w W] [-y Y] a z
+
+ positional arguments:
+ a
+ z
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -b B
+ --w W
+
+ c:
+ --d D
+
+ x:
+ -y Y
+ '''.format(self.main_program)))
+
+ def test_groups_parents(self):
+ parent = ErrorRaisingArgumentParser(add_help=False)
+ g = parent.add_argument_group(title='g', description='gd')
+ g.add_argument('-w')
+ g.add_argument('-x')
+ m = parent.add_mutually_exclusive_group()
+ m.add_argument('-y')
+ m.add_argument('-z')
+ parser = ErrorRaisingArgumentParser(parents=[parent])
+
+ self.assertRaises(ArgumentParserError, parser.parse_args,
+ ['-y', 'Y', '-z', 'Z'])
+
+ parser_help = parser.format_help()
+ self.assertEqual(parser_help, textwrap.dedent('''\
+ usage: {} [-h] [-w W] [-x X] [-y Y | -z Z]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -y Y
+ -z Z
+
+ g:
+ gd
+
+ -w W
+ -x X
+ '''.format(self.main_program)))
+
+# ==============================
+# Mutually exclusive group tests
+# ==============================
+
+class TestMutuallyExclusiveGroupErrors(TestCase):
+
+ def test_invalid_add_argument_group(self):
+ parser = ErrorRaisingArgumentParser()
+ raises = self.assertRaises
+ raises(TypeError, parser.add_mutually_exclusive_group, title='foo')
+
+ def test_invalid_add_argument(self):
+ parser = ErrorRaisingArgumentParser()
+ group = parser.add_mutually_exclusive_group()
+ add_argument = group.add_argument
+ raises = self.assertRaises
+ raises(ValueError, add_argument, '--foo', required=True)
+ raises(ValueError, add_argument, 'bar')
+ raises(ValueError, add_argument, 'bar', nargs='+')
+ raises(ValueError, add_argument, 'bar', nargs=1)
+ raises(ValueError, add_argument, 'bar', nargs=argparse.PARSER)
+
+ def test_help(self):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group1 = parser.add_mutually_exclusive_group()
+ group1.add_argument('--foo', action='store_true')
+ group1.add_argument('--bar', action='store_false')
+ group2 = parser.add_mutually_exclusive_group()
+ group2.add_argument('--soup', action='store_true')
+ group2.add_argument('--nuts', action='store_false')
+ expected = '''\
+ usage: PROG [-h] [--foo | --bar] [--soup | --nuts]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo
+ --bar
+ --soup
+ --nuts
+ '''
+ self.assertEqual(parser.format_help(), textwrap.dedent(expected))
+
+class MEMixin(object):
+
+ def test_failures_when_not_required(self):
+ parse_args = self.get_parser(required=False).parse_args
+ error = ArgumentParserError
+ for args_string in self.failures:
+ self.assertRaises(error, parse_args, args_string.split())
+
+ def test_failures_when_required(self):
+ parse_args = self.get_parser(required=True).parse_args
+ error = ArgumentParserError
+ for args_string in self.failures + ['']:
+ self.assertRaises(error, parse_args, args_string.split())
+
+ def test_successes_when_not_required(self):
+ parse_args = self.get_parser(required=False).parse_args
+ successes = self.successes + self.successes_when_not_required
+ for args_string, expected_ns in successes:
+ actual_ns = parse_args(args_string.split())
+ self.assertEqual(actual_ns, expected_ns)
+
+ def test_successes_when_required(self):
+ parse_args = self.get_parser(required=True).parse_args
+ for args_string, expected_ns in self.successes:
+ actual_ns = parse_args(args_string.split())
+ self.assertEqual(actual_ns, expected_ns)
+
+ def test_usage_when_not_required(self):
+ format_usage = self.get_parser(required=False).format_usage
+ expected_usage = self.usage_when_not_required
+ self.assertEqual(format_usage(), textwrap.dedent(expected_usage))
+
+ def test_usage_when_required(self):
+ format_usage = self.get_parser(required=True).format_usage
+ expected_usage = self.usage_when_required
+ self.assertEqual(format_usage(), textwrap.dedent(expected_usage))
+
+ def test_help_when_not_required(self):
+ format_help = self.get_parser(required=False).format_help
+ help = self.usage_when_not_required + self.help
+ self.assertEqual(format_help(), textwrap.dedent(help))
+
+ def test_help_when_required(self):
+ format_help = self.get_parser(required=True).format_help
+ help = self.usage_when_required + self.help
+ self.assertEqual(format_help(), textwrap.dedent(help))
+
+
+class TestMutuallyExclusiveSimple(MEMixin, TestCase):
+
+ def get_parser(self, required=None):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('--bar', help='bar help')
+ group.add_argument('--baz', nargs='?', const='Z', help='baz help')
+ return parser
+
+ failures = ['--bar X --baz Y', '--bar X --baz']
+ successes = [
+ ('--bar X', NS(bar='X', baz=None)),
+ ('--bar X --bar Z', NS(bar='Z', baz=None)),
+ ('--baz Y', NS(bar=None, baz='Y')),
+ ('--baz', NS(bar=None, baz='Z')),
+ ]
+ successes_when_not_required = [
+ ('', NS(bar=None, baz=None)),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [--bar BAR | --baz [BAZ]]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] (--bar BAR | --baz [BAZ])
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --bar BAR bar help
+ --baz [BAZ] baz help
+ '''
+
+
+class TestMutuallyExclusiveLong(MEMixin, TestCase):
+
+ def get_parser(self, required=None):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ parser.add_argument('--abcde', help='abcde help')
+ parser.add_argument('--fghij', help='fghij help')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('--klmno', help='klmno help')
+ group.add_argument('--pqrst', help='pqrst help')
+ return parser
+
+ failures = ['--klmno X --pqrst Y']
+ successes = [
+ ('--klmno X', NS(abcde=None, fghij=None, klmno='X', pqrst=None)),
+ ('--abcde Y --klmno X',
+ NS(abcde='Y', fghij=None, klmno='X', pqrst=None)),
+ ('--pqrst X', NS(abcde=None, fghij=None, klmno=None, pqrst='X')),
+ ('--pqrst X --fghij Y',
+ NS(abcde=None, fghij='Y', klmno=None, pqrst='X')),
+ ]
+ successes_when_not_required = [
+ ('', NS(abcde=None, fghij=None, klmno=None, pqrst=None)),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [--abcde ABCDE] [--fghij FGHIJ]
+ [--klmno KLMNO | --pqrst PQRST]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] [--abcde ABCDE] [--fghij FGHIJ]
+ (--klmno KLMNO | --pqrst PQRST)
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --abcde ABCDE abcde help
+ --fghij FGHIJ fghij help
+ --klmno KLMNO klmno help
+ --pqrst PQRST pqrst help
+ '''
+
+
+class TestMutuallyExclusiveFirstSuppressed(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('-x', help=argparse.SUPPRESS)
+ group.add_argument('-y', action='store_false', help='y help')
+ return parser
+
+ failures = ['-x X -y']
+ successes = [
+ ('-x X', NS(x='X', y=True)),
+ ('-x X -x Y', NS(x='Y', y=True)),
+ ('-y', NS(x=None, y=False)),
+ ]
+ successes_when_not_required = [
+ ('', NS(x=None, y=True)),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [-y]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] -y
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -y y help
+ '''
+
+
+class TestMutuallyExclusiveManySuppressed(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group = parser.add_mutually_exclusive_group(required=required)
+ add = group.add_argument
+ add('--spam', action='store_true', help=argparse.SUPPRESS)
+ add('--badger', action='store_false', help=argparse.SUPPRESS)
+ add('--bladder', help=argparse.SUPPRESS)
+ return parser
+
+ failures = [
+ '--spam --badger',
+ '--badger --bladder B',
+ '--bladder B --spam',
+ ]
+ successes = [
+ ('--spam', NS(spam=True, badger=True, bladder=None)),
+ ('--badger', NS(spam=False, badger=False, bladder=None)),
+ ('--bladder B', NS(spam=False, badger=True, bladder='B')),
+ ('--spam --spam', NS(spam=True, badger=True, bladder=None)),
+ ]
+ successes_when_not_required = [
+ ('', NS(spam=False, badger=True, bladder=None)),
+ ]
+
+ usage_when_required = usage_when_not_required = '''\
+ usage: PROG [-h]
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ '''
+
+
+class TestMutuallyExclusiveOptionalAndPositional(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('--foo', action='store_true', help='FOO')
+ group.add_argument('--spam', help='SPAM')
+ group.add_argument('badger', nargs='*', default='X', help='BADGER')
+ return parser
+
+ failures = [
+ '--foo --spam S',
+ '--spam S X',
+ 'X --foo',
+ 'X Y Z --spam S',
+ '--foo X Y',
+ ]
+ successes = [
+ ('--foo', NS(foo=True, spam=None, badger='X')),
+ ('--spam S', NS(foo=False, spam='S', badger='X')),
+ ('X', NS(foo=False, spam=None, badger=['X'])),
+ ('X Y Z', NS(foo=False, spam=None, badger=['X', 'Y', 'Z'])),
+ ]
+ successes_when_not_required = [
+ ('', NS(foo=False, spam=None, badger='X')),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [--foo | --spam SPAM | badger [badger ...]]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] (--foo | --spam SPAM | badger [badger ...])
+ '''
+ help = '''\
+
+ positional arguments:
+ badger BADGER
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO
+ --spam SPAM SPAM
+ '''
+
+
+class TestMutuallyExclusiveOptionalsMixed(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ parser.add_argument('-x', action='store_true', help='x help')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('-a', action='store_true', help='a help')
+ group.add_argument('-b', action='store_true', help='b help')
+ parser.add_argument('-y', action='store_true', help='y help')
+ group.add_argument('-c', action='store_true', help='c help')
+ return parser
+
+ failures = ['-a -b', '-b -c', '-a -c', '-a -b -c']
+ successes = [
+ ('-a', NS(a=True, b=False, c=False, x=False, y=False)),
+ ('-b', NS(a=False, b=True, c=False, x=False, y=False)),
+ ('-c', NS(a=False, b=False, c=True, x=False, y=False)),
+ ('-a -x', NS(a=True, b=False, c=False, x=True, y=False)),
+ ('-y -b', NS(a=False, b=True, c=False, x=False, y=True)),
+ ('-x -y -c', NS(a=False, b=False, c=True, x=True, y=True)),
+ ]
+ successes_when_not_required = [
+ ('', NS(a=False, b=False, c=False, x=False, y=False)),
+ ('-x', NS(a=False, b=False, c=False, x=True, y=False)),
+ ('-y', NS(a=False, b=False, c=False, x=False, y=True)),
+ ]
+
+ usage_when_required = usage_when_not_required = '''\
+ usage: PROG [-h] [-x] [-a] [-b] [-y] [-c]
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x x help
+ -a a help
+ -b b help
+ -y y help
+ -c c help
+ '''
+
+
+class TestMutuallyExclusiveInGroup(MEMixin, TestCase):
+
+ def get_parser(self, required=None):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ titled_group = parser.add_argument_group(
+ title='Titled group', description='Group description')
+ mutex_group = \
+ titled_group.add_mutually_exclusive_group(required=required)
+ mutex_group.add_argument('--bar', help='bar help')
+ mutex_group.add_argument('--baz', help='baz help')
+ return parser
+
+ failures = ['--bar X --baz Y', '--baz X --bar Y']
+ successes = [
+ ('--bar X', NS(bar='X', baz=None)),
+ ('--baz Y', NS(bar=None, baz='Y')),
+ ]
+ successes_when_not_required = [
+ ('', NS(bar=None, baz=None)),
+ ]
+
+ usage_when_not_required = '''\
+ usage: PROG [-h] [--bar BAR | --baz BAZ]
+ '''
+ usage_when_required = '''\
+ usage: PROG [-h] (--bar BAR | --baz BAZ)
+ '''
+ help = '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+
+ Titled group:
+ Group description
+
+ --bar BAR bar help
+ --baz BAZ baz help
+ '''
+
+
+class TestMutuallyExclusiveOptionalsAndPositionalsMixed(MEMixin, TestCase):
+
+ def get_parser(self, required):
+ parser = ErrorRaisingArgumentParser(prog='PROG')
+ parser.add_argument('x', help='x help')
+ parser.add_argument('-y', action='store_true', help='y help')
+ group = parser.add_mutually_exclusive_group(required=required)
+ group.add_argument('a', nargs='?', help='a help')
+ group.add_argument('-b', action='store_true', help='b help')
+ group.add_argument('-c', action='store_true', help='c help')
+ return parser
+
+ failures = ['X A -b', '-b -c', '-c X A']
+ successes = [
+ ('X A', NS(a='A', b=False, c=False, x='X', y=False)),
+ ('X -b', NS(a=None, b=True, c=False, x='X', y=False)),
+ ('X -c', NS(a=None, b=False, c=True, x='X', y=False)),
+ ('X A -y', NS(a='A', b=False, c=False, x='X', y=True)),
+ ('X -y -b', NS(a=None, b=True, c=False, x='X', y=True)),
+ ]
+ successes_when_not_required = [
+ ('X', NS(a=None, b=False, c=False, x='X', y=False)),
+ ('X -y', NS(a=None, b=False, c=False, x='X', y=True)),
+ ]
+
+ usage_when_required = usage_when_not_required = '''\
+ usage: PROG [-h] [-y] [-b] [-c] x [a]
+ '''
+ help = '''\
+
+ positional arguments:
+ x x help
+ a a help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -y y help
+ -b b help
+ -c c help
+ '''
+
+# =================================================
+# Mutually exclusive group in parent parser tests
+# =================================================
+
+class MEPBase(object):
+
+ def get_parser(self, required=None):
+ parent = super(MEPBase, self).get_parser(required=required)
+ parser = ErrorRaisingArgumentParser(
+ prog=parent.prog, add_help=False, parents=[parent])
+ return parser
+
+
+class TestMutuallyExclusiveGroupErrorsParent(
+ MEPBase, TestMutuallyExclusiveGroupErrors):
+ pass
+
+
+class TestMutuallyExclusiveSimpleParent(
+ MEPBase, TestMutuallyExclusiveSimple):
+ pass
+
+
+class TestMutuallyExclusiveLongParent(
+ MEPBase, TestMutuallyExclusiveLong):
+ pass
+
+
+class TestMutuallyExclusiveFirstSuppressedParent(
+ MEPBase, TestMutuallyExclusiveFirstSuppressed):
+ pass
+
+
+class TestMutuallyExclusiveManySuppressedParent(
+ MEPBase, TestMutuallyExclusiveManySuppressed):
+ pass
+
+
+class TestMutuallyExclusiveOptionalAndPositionalParent(
+ MEPBase, TestMutuallyExclusiveOptionalAndPositional):
+ pass
+
+
+class TestMutuallyExclusiveOptionalsMixedParent(
+ MEPBase, TestMutuallyExclusiveOptionalsMixed):
+ pass
+
+
+class TestMutuallyExclusiveOptionalsAndPositionalsMixedParent(
+ MEPBase, TestMutuallyExclusiveOptionalsAndPositionalsMixed):
+ pass
+
+# =================
+# Set default tests
+# =================
+
+class TestSetDefaults(TestCase):
+
+ def test_set_defaults_no_args(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(x='foo')
+ parser.set_defaults(y='bar', z=1)
+ self.assertEqual(NS(x='foo', y='bar', z=1),
+ parser.parse_args([]))
+ self.assertEqual(NS(x='foo', y='bar', z=1),
+ parser.parse_args([], NS()))
+ self.assertEqual(NS(x='baz', y='bar', z=1),
+ parser.parse_args([], NS(x='baz')))
+ self.assertEqual(NS(x='baz', y='bar', z=2),
+ parser.parse_args([], NS(x='baz', z=2)))
+
+ def test_set_defaults_with_args(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(x='foo', y='bar')
+ parser.add_argument('-x', default='xfoox')
+ self.assertEqual(NS(x='xfoox', y='bar'),
+ parser.parse_args([]))
+ self.assertEqual(NS(x='xfoox', y='bar'),
+ parser.parse_args([], NS()))
+ self.assertEqual(NS(x='baz', y='bar'),
+ parser.parse_args([], NS(x='baz')))
+ self.assertEqual(NS(x='1', y='bar'),
+ parser.parse_args('-x 1'.split()))
+ self.assertEqual(NS(x='1', y='bar'),
+ parser.parse_args('-x 1'.split(), NS()))
+ self.assertEqual(NS(x='1', y='bar'),
+ parser.parse_args('-x 1'.split(), NS(x='baz')))
+
+ def test_set_defaults_subparsers(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(x='foo')
+ subparsers = parser.add_subparsers()
+ parser_a = subparsers.add_parser('a')
+ parser_a.set_defaults(y='bar')
+ self.assertEqual(NS(x='foo', y='bar'),
+ parser.parse_args('a'.split()))
+
+ def test_set_defaults_parents(self):
+ parent = ErrorRaisingArgumentParser(add_help=False)
+ parent.set_defaults(x='foo')
+ parser = ErrorRaisingArgumentParser(parents=[parent])
+ self.assertEqual(NS(x='foo'), parser.parse_args([]))
+
+ def test_set_defaults_same_as_add_argument(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(w='W', x='X', y='Y', z='Z')
+ parser.add_argument('-w')
+ parser.add_argument('-x', default='XX')
+ parser.add_argument('y', nargs='?')
+ parser.add_argument('z', nargs='?', default='ZZ')
+
+ # defaults set previously
+ self.assertEqual(NS(w='W', x='XX', y='Y', z='ZZ'),
+ parser.parse_args([]))
+
+ # reset defaults
+ parser.set_defaults(w='WW', x='X', y='YY', z='Z')
+ self.assertEqual(NS(w='WW', x='X', y='YY', z='Z'),
+ parser.parse_args([]))
+
+ def test_set_defaults_same_as_add_argument_group(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.set_defaults(w='W', x='X', y='Y', z='Z')
+ group = parser.add_argument_group('foo')
+ group.add_argument('-w')
+ group.add_argument('-x', default='XX')
+ group.add_argument('y', nargs='?')
+ group.add_argument('z', nargs='?', default='ZZ')
+
+
+ # defaults set previously
+ self.assertEqual(NS(w='W', x='XX', y='Y', z='ZZ'),
+ parser.parse_args([]))
+
+ # reset defaults
+ parser.set_defaults(w='WW', x='X', y='YY', z='Z')
+ self.assertEqual(NS(w='WW', x='X', y='YY', z='Z'),
+ parser.parse_args([]))
+
+# =================
+# Get default tests
+# =================
+
+class TestGetDefault(TestCase):
+
+ def test_get_default(self):
+ parser = ErrorRaisingArgumentParser()
+ self.assertEqual(None, parser.get_default("foo"))
+ self.assertEqual(None, parser.get_default("bar"))
+
+ parser.add_argument("--foo")
+ self.assertEqual(None, parser.get_default("foo"))
+ self.assertEqual(None, parser.get_default("bar"))
+
+ parser.add_argument("--bar", type=int, default=42)
+ self.assertEqual(None, parser.get_default("foo"))
+ self.assertEqual(42, parser.get_default("bar"))
+
+ parser.set_defaults(foo="badger")
+ self.assertEqual("badger", parser.get_default("foo"))
+ self.assertEqual(42, parser.get_default("bar"))
+
+# ==========================
+# Namespace 'contains' tests
+# ==========================
+
+class TestNamespaceContainsSimple(TestCase):
+
+ def test_empty(self):
+ ns = argparse.Namespace()
+ self.assertEqual('' in ns, False)
+ self.assertEqual('' not in ns, True)
+ self.assertEqual('x' in ns, False)
+
+ def test_non_empty(self):
+ ns = argparse.Namespace(x=1, y=2)
+ self.assertEqual('x' in ns, True)
+ self.assertEqual('x' not in ns, False)
+ self.assertEqual('y' in ns, True)
+ self.assertEqual('' in ns, False)
+ self.assertEqual('xx' in ns, False)
+ self.assertEqual('z' in ns, False)
+
+# =====================
+# Help formatting tests
+# =====================
+
+class TestHelpFormattingMetaclass(type):
+
+ def __init__(cls, name, bases, bodydict):
+ if name == 'HelpTestCase':
+ return
+
+ class AddTests(object):
+
+ def __init__(self, test_class, func_suffix, std_name):
+ self.func_suffix = func_suffix
+ self.std_name = std_name
+
+ for test_func in [self.test_format,
+ self.test_print,
+ self.test_print_file]:
+ test_name = '%s_%s' % (test_func.__name__, func_suffix)
+
+ def test_wrapper(self, test_func=test_func):
+ test_func(self)
+ try:
+ test_wrapper.__name__ = test_name
+ except TypeError:
+ pass
+ setattr(test_class, test_name, test_wrapper)
+
+ def _get_parser(self, tester):
+ parser = argparse.ArgumentParser(
+ *tester.parser_signature.args,
+ **tester.parser_signature.kwargs)
+ for argument_sig in getattr(tester, 'argument_signatures', []):
+ parser.add_argument(*argument_sig.args,
+ **argument_sig.kwargs)
+ group_sigs = getattr(tester, 'argument_group_signatures', [])
+ for group_sig, argument_sigs in group_sigs:
+ group = parser.add_argument_group(*group_sig.args,
+ **group_sig.kwargs)
+ for argument_sig in argument_sigs:
+ group.add_argument(*argument_sig.args,
+ **argument_sig.kwargs)
+ subparsers_sigs = getattr(tester, 'subparsers_signatures', [])
+ if subparsers_sigs:
+ subparsers = parser.add_subparsers()
+ for subparser_sig in subparsers_sigs:
+ subparsers.add_parser(*subparser_sig.args,
+ **subparser_sig.kwargs)
+ return parser
+
+ def _test(self, tester, parser_text):
+ expected_text = getattr(tester, self.func_suffix)
+ expected_text = textwrap.dedent(expected_text)
+ if expected_text != parser_text:
+ print(repr(expected_text))
+ print(repr(parser_text))
+ for char1, char2 in zip(expected_text, parser_text):
+ if char1 != char2:
+ print('first diff: %r %r' % (char1, char2))
+ break
+ tester.assertEqual(expected_text, parser_text)
+
+ def test_format(self, tester):
+ parser = self._get_parser(tester)
+ format = getattr(parser, 'format_%s' % self.func_suffix)
+ self._test(tester, format())
+
+ def test_print(self, tester):
+ parser = self._get_parser(tester)
+ print_ = getattr(parser, 'print_%s' % self.func_suffix)
+ old_stream = getattr(sys, self.std_name)
+ setattr(sys, self.std_name, StdIOBuffer())
+ try:
+ print_()
+ parser_text = getattr(sys, self.std_name).getvalue()
+ finally:
+ setattr(sys, self.std_name, old_stream)
+ self._test(tester, parser_text)
+
+ def test_print_file(self, tester):
+ parser = self._get_parser(tester)
+ print_ = getattr(parser, 'print_%s' % self.func_suffix)
+ sfile = StdIOBuffer()
+ print_(sfile)
+ parser_text = sfile.getvalue()
+ self._test(tester, parser_text)
+
+ # add tests for {format,print}_{usage,help,version}
+ for func_suffix, std_name in [('usage', 'stdout'),
+ ('help', 'stdout'),
+ ('version', 'stderr')]:
+ AddTests(cls, func_suffix, std_name)
+
+bases = TestCase,
+HelpTestCase = TestHelpFormattingMetaclass('HelpTestCase', bases, {})
+
+
+class TestHelpBiggerOptionals(HelpTestCase):
+ """Make sure that argument help aligns when options are longer"""
+
+ parser_signature = Sig(prog='PROG', description='DESCRIPTION',
+ epilog='EPILOG', version='0.1')
+ argument_signatures = [
+ Sig('-x', action='store_true', help='X HELP'),
+ Sig('--y', help='Y HELP'),
+ Sig('foo', help='FOO HELP'),
+ Sig('bar', help='BAR HELP'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-v] [-x] [--y Y] foo bar
+ '''
+ help = usage + '''\
+
+ DESCRIPTION
+
+ positional arguments:
+ foo FOO HELP
+ bar BAR HELP
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ -x X HELP
+ --y Y Y HELP
+
+ EPILOG
+ '''
+ version = '''\
+ 0.1
+ '''
+
+
+class TestHelpBiggerOptionalGroups(HelpTestCase):
+ """Make sure that argument help aligns when options are longer"""
+
+ parser_signature = Sig(prog='PROG', description='DESCRIPTION',
+ epilog='EPILOG', version='0.1')
+ argument_signatures = [
+ Sig('-x', action='store_true', help='X HELP'),
+ Sig('--y', help='Y HELP'),
+ Sig('foo', help='FOO HELP'),
+ Sig('bar', help='BAR HELP'),
+ ]
+ argument_group_signatures = [
+ (Sig('GROUP TITLE', description='GROUP DESCRIPTION'), [
+ Sig('baz', help='BAZ HELP'),
+ Sig('-z', nargs='+', help='Z HELP')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [-v] [-x] [--y Y] [-z Z [Z ...]] foo bar baz
+ '''
+ help = usage + '''\
+
+ DESCRIPTION
+
+ positional arguments:
+ foo FOO HELP
+ bar BAR HELP
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ -x X HELP
+ --y Y Y HELP
+
+ GROUP TITLE:
+ GROUP DESCRIPTION
+
+ baz BAZ HELP
+ -z Z [Z ...] Z HELP
+
+ EPILOG
+ '''
+ version = '''\
+ 0.1
+ '''
+
+
+class TestHelpBiggerPositionals(HelpTestCase):
+ """Make sure that help aligns when arguments are longer"""
+
+ parser_signature = Sig(usage='USAGE', description='DESCRIPTION')
+ argument_signatures = [
+ Sig('-x', action='store_true', help='X HELP'),
+ Sig('--y', help='Y HELP'),
+ Sig('ekiekiekifekang', help='EKI HELP'),
+ Sig('bar', help='BAR HELP'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: USAGE
+ '''
+ help = usage + '''\
+
+ DESCRIPTION
+
+ positional arguments:
+ ekiekiekifekang EKI HELP
+ bar BAR HELP
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X HELP
+ --y Y Y HELP
+ '''
+
+ version = ''
+
+
+class TestHelpReformatting(HelpTestCase):
+ """Make sure that text after short names starts on the first line"""
+
+ parser_signature = Sig(
+ prog='PROG',
+ description=' oddly formatted\n'
+ 'description\n'
+ '\n'
+ 'that is so long that it should go onto multiple '
+ 'lines when wrapped')
+ argument_signatures = [
+ Sig('-x', metavar='XX', help='oddly\n'
+ ' formatted -x help'),
+ Sig('y', metavar='yyy', help='normal y help'),
+ ]
+ argument_group_signatures = [
+ (Sig('title', description='\n'
+ ' oddly formatted group\n'
+ '\n'
+ 'description'),
+ [Sig('-a', action='store_true',
+ help=' oddly \n'
+ 'formatted -a help \n'
+ ' again, so long that it should be wrapped over '
+ 'multiple lines')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [-x XX] [-a] yyy
+ '''
+ help = usage + '''\
+
+ oddly formatted description that is so long that it should go onto \
+multiple
+ lines when wrapped
+
+ positional arguments:
+ yyy normal y help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x XX oddly formatted -x help
+
+ title:
+ oddly formatted group description
+
+ -a oddly formatted -a help again, so long that it should \
+be wrapped
+ over multiple lines
+ '''
+ version = ''
+
+
+class TestHelpWrappingShortNames(HelpTestCase):
+ """Make sure that text after short names starts on the first line"""
+
+ parser_signature = Sig(prog='PROG', description= 'D\nD' * 30)
+ argument_signatures = [
+ Sig('-x', metavar='XX', help='XHH HX' * 20),
+ Sig('y', metavar='yyy', help='YH YH' * 20),
+ ]
+ argument_group_signatures = [
+ (Sig('ALPHAS'), [
+ Sig('-a', action='store_true', help='AHHH HHA' * 10)]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [-x XX] [-a] yyy
+ '''
+ help = usage + '''\
+
+ D DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD \
+DD DD DD
+ DD DD DD DD D
+
+ positional arguments:
+ yyy YH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH \
+YHYH YHYH
+ YHYH YHYH YHYH YHYH YHYH YHYH YHYH YH
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x XX XHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH \
+HXXHH HXXHH
+ HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HXXHH HX
+
+ ALPHAS:
+ -a AHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH HHAAHHH \
+HHAAHHH
+ HHAAHHH HHAAHHH HHA
+ '''
+ version = ''
+
+
+class TestHelpWrappingLongNames(HelpTestCase):
+ """Make sure that text after long names starts on the next line"""
+
+ parser_signature = Sig(usage='USAGE', description= 'D D' * 30,
+ version='V V'*30)
+ argument_signatures = [
+ Sig('-x', metavar='X' * 25, help='XH XH' * 20),
+ Sig('y', metavar='y' * 25, help='YH YH' * 20),
+ ]
+ argument_group_signatures = [
+ (Sig('ALPHAS'), [
+ Sig('-a', metavar='A' * 25, help='AH AH' * 20),
+ Sig('z', metavar='z' * 25, help='ZH ZH' * 20)]),
+ ]
+ usage = '''\
+ usage: USAGE
+ '''
+ help = usage + '''\
+
+ D DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD DD \
+DD DD DD
+ DD DD DD DD D
+
+ positional arguments:
+ yyyyyyyyyyyyyyyyyyyyyyyyy
+ YH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH \
+YHYH YHYH
+ YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YHYH YH
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ XH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH \
+XHXH XHXH
+ XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XHXH XH
+
+ ALPHAS:
+ -a AAAAAAAAAAAAAAAAAAAAAAAAA
+ AH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH \
+AHAH AHAH
+ AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AHAH AH
+ zzzzzzzzzzzzzzzzzzzzzzzzz
+ ZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH \
+ZHZH ZHZH
+ ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZHZH ZH
+ '''
+ version = '''\
+ V VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV VV \
+VV VV VV
+ VV VV VV VV V
+ '''
+
+
+class TestHelpUsage(HelpTestCase):
+ """Test basic usage messages"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-w', nargs='+', help='w'),
+ Sig('-x', nargs='*', help='x'),
+ Sig('a', help='a'),
+ Sig('b', help='b', nargs=2),
+ Sig('c', help='c', nargs='?'),
+ ]
+ argument_group_signatures = [
+ (Sig('group'), [
+ Sig('-y', nargs='?', help='y'),
+ Sig('-z', nargs=3, help='z'),
+ Sig('d', help='d', nargs='*'),
+ Sig('e', help='e', nargs='+'),
+ ])
+ ]
+ usage = '''\
+ usage: PROG [-h] [-w W [W ...]] [-x [X [X ...]]] [-y [Y]] [-z Z Z Z]
+ a b b [c] [d [d ...]] e [e ...]
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ a a
+ b b
+ c c
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w W [W ...] w
+ -x [X [X ...]] x
+
+ group:
+ -y [Y] y
+ -z Z Z Z z
+ d d
+ e e
+ '''
+ version = ''
+
+
+class TestHelpOnlyUserGroups(HelpTestCase):
+ """Test basic usage messages"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = []
+ argument_group_signatures = [
+ (Sig('xxxx'), [
+ Sig('-x', help='x'),
+ Sig('a', help='a'),
+ ]),
+ (Sig('yyyy'), [
+ Sig('b', help='b'),
+ Sig('-y', help='y'),
+ ]),
+ ]
+ usage = '''\
+ usage: PROG [-x X] [-y Y] a b
+ '''
+ help = usage + '''\
+
+ xxxx:
+ -x X x
+ a a
+
+ yyyy:
+ b b
+ -y Y y
+ '''
+ version = ''
+
+
+class TestHelpUsageLongProg(HelpTestCase):
+ """Test usage messages where the prog is long"""
+
+ parser_signature = Sig(prog='P' * 60)
+ argument_signatures = [
+ Sig('-w', metavar='W'),
+ Sig('-x', metavar='X'),
+ Sig('a'),
+ Sig('b'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
+ [-h] [-w W] [-x X] a b
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ a
+ b
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w W
+ -x X
+ '''
+ version = ''
+
+
+class TestHelpUsageLongProgOptionsWrap(HelpTestCase):
+ """Test usage messages where the prog is long and the optionals wrap"""
+
+ parser_signature = Sig(prog='P' * 60)
+ argument_signatures = [
+ Sig('-w', metavar='W' * 25),
+ Sig('-x', metavar='X' * 25),
+ Sig('-y', metavar='Y' * 25),
+ Sig('-z', metavar='Z' * 25),
+ Sig('a'),
+ Sig('b'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
+ [-h] [-w WWWWWWWWWWWWWWWWWWWWWWWWW] \
+[-x XXXXXXXXXXXXXXXXXXXXXXXXX]
+ [-y YYYYYYYYYYYYYYYYYYYYYYYYY] [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
+ a b
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ a
+ b
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w WWWWWWWWWWWWWWWWWWWWWWWWW
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ -y YYYYYYYYYYYYYYYYYYYYYYYYY
+ -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
+ '''
+ version = ''
+
+
+class TestHelpUsageLongProgPositionalsWrap(HelpTestCase):
+ """Test usage messages where the prog is long and the positionals wrap"""
+
+ parser_signature = Sig(prog='P' * 60, add_help=False)
+ argument_signatures = [
+ Sig('a' * 25),
+ Sig('b' * 25),
+ Sig('c' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
+ aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ aaaaaaaaaaaaaaaaaaaaaaaaa
+ bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ version = ''
+
+
+class TestHelpUsageOptionalsWrap(HelpTestCase):
+ """Test usage messages where the optionals wrap"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-w', metavar='W' * 25),
+ Sig('-x', metavar='X' * 25),
+ Sig('-y', metavar='Y' * 25),
+ Sig('-z', metavar='Z' * 25),
+ Sig('a'),
+ Sig('b'),
+ Sig('c'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-w WWWWWWWWWWWWWWWWWWWWWWWWW] \
+[-x XXXXXXXXXXXXXXXXXXXXXXXXX]
+ [-y YYYYYYYYYYYYYYYYYYYYYYYYY] \
+[-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
+ a b c
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ a
+ b
+ c
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w WWWWWWWWWWWWWWWWWWWWWWWWW
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ -y YYYYYYYYYYYYYYYYYYYYYYYYY
+ -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
+ '''
+ version = ''
+
+
+class TestHelpUsagePositionalsWrap(HelpTestCase):
+ """Test usage messages where the positionals wrap"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-x'),
+ Sig('-y'),
+ Sig('-z'),
+ Sig('a' * 25),
+ Sig('b' * 25),
+ Sig('c' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-x X] [-y Y] [-z Z]
+ aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ aaaaaaaaaaaaaaaaaaaaaaaaa
+ bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X
+ -y Y
+ -z Z
+ '''
+ version = ''
+
+
+class TestHelpUsageOptionalsPositionalsWrap(HelpTestCase):
+ """Test usage messages where the optionals and positionals wrap"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-x', metavar='X' * 25),
+ Sig('-y', metavar='Y' * 25),
+ Sig('-z', metavar='Z' * 25),
+ Sig('a' * 25),
+ Sig('b' * 25),
+ Sig('c' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-x XXXXXXXXXXXXXXXXXXXXXXXXX] \
+[-y YYYYYYYYYYYYYYYYYYYYYYYYY]
+ [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
+ aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ aaaaaaaaaaaaaaaaaaaaaaaaa
+ bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ -y YYYYYYYYYYYYYYYYYYYYYYYYY
+ -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
+ '''
+ version = ''
+
+
+class TestHelpUsageOptionalsOnlyWrap(HelpTestCase):
+ """Test usage messages where there are only optionals and they wrap"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-x', metavar='X' * 25),
+ Sig('-y', metavar='Y' * 25),
+ Sig('-z', metavar='Z' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-x XXXXXXXXXXXXXXXXXXXXXXXXX] \
+[-y YYYYYYYYYYYYYYYYYYYYYYYYY]
+ [-z ZZZZZZZZZZZZZZZZZZZZZZZZZ]
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x XXXXXXXXXXXXXXXXXXXXXXXXX
+ -y YYYYYYYYYYYYYYYYYYYYYYYYY
+ -z ZZZZZZZZZZZZZZZZZZZZZZZZZ
+ '''
+ version = ''
+
+
+class TestHelpUsagePositionalsOnlyWrap(HelpTestCase):
+ """Test usage messages where there are only positionals and they wrap"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = [
+ Sig('a' * 25),
+ Sig('b' * 25),
+ Sig('c' * 25),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG aaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ aaaaaaaaaaaaaaaaaaaaaaaaa
+ bbbbbbbbbbbbbbbbbbbbbbbbb
+ ccccccccccccccccccccccccc
+ '''
+ version = ''
+
+
+class TestHelpVariableExpansion(HelpTestCase):
+ """Test that variables are expanded properly in help messages"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-x', type=int,
+ help='x %(prog)s %(default)s %(type)s %%'),
+ Sig('-y', action='store_const', default=42, const='XXX',
+ help='y %(prog)s %(default)s %(const)s'),
+ Sig('--foo', choices='abc',
+ help='foo %(prog)s %(default)s %(choices)s'),
+ Sig('--bar', default='baz', choices=[1, 2], metavar='BBB',
+ help='bar %(prog)s %(default)s %(dest)s'),
+ Sig('spam', help='spam %(prog)s %(default)s'),
+ Sig('badger', default=0.5, help='badger %(prog)s %(default)s'),
+ ]
+ argument_group_signatures = [
+ (Sig('group'), [
+ Sig('-a', help='a %(prog)s %(default)s'),
+ Sig('-b', default=-1, help='b %(prog)s %(default)s'),
+ ])
+ ]
+ usage = ('''\
+ usage: PROG [-h] [-x X] [-y] [--foo {a,b,c}] [--bar BBB] [-a A] [-b B]
+ spam badger
+ ''')
+ help = usage + '''\
+
+ positional arguments:
+ spam spam PROG None
+ badger badger PROG 0.5
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X x PROG None int %
+ -y y PROG 42 XXX
+ --foo {a,b,c} foo PROG None a, b, c
+ --bar BBB bar PROG baz bar
+
+ group:
+ -a A a PROG None
+ -b B b PROG -1
+ '''
+ version = ''
+
+
+class TestHelpVariableExpansionUsageSupplied(HelpTestCase):
+ """Test that variables are expanded properly when usage= is present"""
+
+ parser_signature = Sig(prog='PROG', usage='%(prog)s FOO')
+ argument_signatures = []
+ argument_group_signatures = []
+ usage = ('''\
+ usage: PROG FOO
+ ''')
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ '''
+ version = ''
+
+
+class TestHelpVariableExpansionNoArguments(HelpTestCase):
+ """Test that variables are expanded properly with no arguments"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = []
+ argument_group_signatures = []
+ usage = ('''\
+ usage: PROG
+ ''')
+ help = usage
+ version = ''
+
+
+class TestHelpSuppressUsage(HelpTestCase):
+ """Test that items can be suppressed in usage messages"""
+
+ parser_signature = Sig(prog='PROG', usage=argparse.SUPPRESS)
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = []
+ help = '''\
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+ '''
+ usage = ''
+ version = ''
+
+
+class TestHelpSuppressOptional(HelpTestCase):
+ """Test that optional arguments can be suppressed in help messages"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = [
+ Sig('--foo', help=argparse.SUPPRESS),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam spam help
+ '''
+ version = ''
+
+
+class TestHelpSuppressOptionalGroup(HelpTestCase):
+ """Test that optional groups can be suppressed in help messages"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = [
+ (Sig('group'), [Sig('--bar', help=argparse.SUPPRESS)]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+ '''
+ version = ''
+
+
+class TestHelpSuppressPositional(HelpTestCase):
+ """Test that positional arguments can be suppressed in help messages"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help=argparse.SUPPRESS),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [--foo FOO]
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+ '''
+ version = ''
+
+
+class TestHelpRequiredOptional(HelpTestCase):
+ """Test that required options don't look optional"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('--foo', required=True, help='foo help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] --foo FOO
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help
+ '''
+ version = ''
+
+
+class TestHelpAlternatePrefixChars(HelpTestCase):
+ """Test that options display with different prefix characters"""
+
+ parser_signature = Sig(prog='PROG', prefix_chars='^;', add_help=False)
+ argument_signatures = [
+ Sig('^^foo', action='store_true', help='foo help'),
+ Sig(';b', ';;bar', help='bar help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [^^foo] [;b BAR]
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ ^^foo foo help
+ ;b BAR, ;;bar BAR bar help
+ '''
+ version = ''
+
+
+class TestHelpNoHelpOptional(HelpTestCase):
+ """Test that the --help argument can be suppressed help messages"""
+
+ parser_signature = Sig(prog='PROG', add_help=False)
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [--foo FOO] spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ --foo FOO foo help
+ '''
+ version = ''
+
+
+class TestHelpVersionOptional(HelpTestCase):
+ """Test that the --version argument can be suppressed help messages"""
+
+ parser_signature = Sig(prog='PROG', version='1.0')
+ argument_signatures = [
+ Sig('--foo', help='foo help'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-v] [--foo FOO] spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ --foo FOO foo help
+ '''
+ version = '''\
+ 1.0
+ '''
+
+
+class TestHelpNone(HelpTestCase):
+ """Test that no errors occur if no help is specified"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('--foo'),
+ Sig('spam'),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] spam
+ '''
+ help = usage + '''\
+
+ positional arguments:
+ spam
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO
+ '''
+ version = ''
+
+
+class TestHelpTupleMetavar(HelpTestCase):
+ """Test specifying metavar as a tuple"""
+
+ parser_signature = Sig(prog='PROG')
+ argument_signatures = [
+ Sig('-w', help='w', nargs='+', metavar=('W1', 'W2')),
+ Sig('-x', help='x', nargs='*', metavar=('X1', 'X2')),
+ Sig('-y', help='y', nargs=3, metavar=('Y1', 'Y2', 'Y3')),
+ Sig('-z', help='z', nargs='?', metavar=('Z1', )),
+ ]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-w W1 [W2 ...]] [-x [X1 [X2 ...]]] [-y Y1 Y2 Y3] \
+[-z [Z1]]
+ '''
+ help = usage + '''\
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -w W1 [W2 ...] w
+ -x [X1 [X2 ...]] x
+ -y Y1 Y2 Y3 y
+ -z [Z1] z
+ '''
+ version = ''
+
+
+class TestHelpRawText(HelpTestCase):
+ """Test the RawTextHelpFormatter"""
+
+ parser_signature = Sig(
+ prog='PROG', formatter_class=argparse.RawTextHelpFormatter,
+ description='Keep the formatting\n'
+ ' exactly as it is written\n'
+ '\n'
+ 'here\n')
+
+ argument_signatures = [
+ Sig('--foo', help=' foo help should also\n'
+ 'appear as given here'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = [
+ (Sig('title', description=' This text\n'
+ ' should be indented\n'
+ ' exactly like it is here\n'),
+ [Sig('--bar', help='bar help')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] [--bar BAR] spam
+ '''
+ help = usage + '''\
+
+ Keep the formatting
+ exactly as it is written
+
+ here
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help should also
+ appear as given here
+
+ title:
+ This text
+ should be indented
+ exactly like it is here
+
+ --bar BAR bar help
+ '''
+ version = ''
+
+
+class TestHelpRawDescription(HelpTestCase):
+ """Test the RawTextHelpFormatter"""
+
+ parser_signature = Sig(
+ prog='PROG', formatter_class=argparse.RawDescriptionHelpFormatter,
+ description='Keep the formatting\n'
+ ' exactly as it is written\n'
+ '\n'
+ 'here\n')
+
+ argument_signatures = [
+ Sig('--foo', help=' foo help should not\n'
+ ' retain this odd formatting'),
+ Sig('spam', help='spam help'),
+ ]
+ argument_group_signatures = [
+ (Sig('title', description=' This text\n'
+ ' should be indented\n'
+ ' exactly like it is here\n'),
+ [Sig('--bar', help='bar help')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] [--bar BAR] spam
+ '''
+ help = usage + '''\
+
+ Keep the formatting
+ exactly as it is written
+
+ here
+
+ positional arguments:
+ spam spam help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help should not retain this odd formatting
+
+ title:
+ This text
+ should be indented
+ exactly like it is here
+
+ --bar BAR bar help
+ '''
+ version = ''
+
+
+class TestHelpArgumentDefaults(HelpTestCase):
+ """Test the ArgumentDefaultsHelpFormatter"""
+
+ parser_signature = Sig(
+ prog='PROG', formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ description='description')
+
+ argument_signatures = [
+ Sig('--foo', help='foo help - oh and by the way, %(default)s'),
+ Sig('--bar', action='store_true', help='bar help'),
+ Sig('spam', help='spam help'),
+ Sig('badger', nargs='?', default='wooden', help='badger help'),
+ ]
+ argument_group_signatures = [
+ (Sig('title', description='description'),
+ [Sig('--baz', type=int, default=42, help='baz help')]),
+ ]
+ usage = '''\
+ usage: PROG [-h] [--foo FOO] [--bar] [--baz BAZ] spam [badger]
+ '''
+ help = usage + '''\
+
+ description
+
+ positional arguments:
+ spam spam help
+ badger badger help (default: wooden)
+
+ optional arguments:
+ -h, --help show this help message and exit
+ --foo FOO foo help - oh and by the way, None
+ --bar bar help (default: False)
+
+ title:
+ description
+
+ --baz BAZ baz help (default: 42)
+ '''
+ version = ''
+
+class TestHelpVersionAction(HelpTestCase):
+ """Test the default help for the version action"""
+
+ parser_signature = Sig(prog='PROG', description='description')
+ argument_signatures = [Sig('-V', '--version', action='version', version='3.6')]
+ argument_group_signatures = []
+ usage = '''\
+ usage: PROG [-h] [-V]
+ '''
+ help = usage + '''\
+
+ description
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -V, --version show program's version number and exit
+ '''
+ version = ''
+
+class TestHelpSubparsersOrdering(HelpTestCase):
+ """Test ordering of subcommands in help matches the code"""
+ parser_signature = Sig(prog='PROG',
+ description='display some subcommands',
+ version='0.1')
+
+ subparsers_signatures = [Sig(name=name)
+ for name in ('a', 'b', 'c', 'd', 'e')]
+
+ usage = '''\
+ usage: PROG [-h] [-v] {a,b,c,d,e} ...
+ '''
+
+ help = usage + '''\
+
+ display some subcommands
+
+ positional arguments:
+ {a,b,c,d,e}
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ '''
+
+ version = '''\
+ 0.1
+ '''
+
+class TestHelpSubparsersWithHelpOrdering(HelpTestCase):
+ """Test ordering of subcommands in help matches the code"""
+ parser_signature = Sig(prog='PROG',
+ description='display some subcommands',
+ version='0.1')
+
+ subcommand_data = (('a', 'a subcommand help'),
+ ('b', 'b subcommand help'),
+ ('c', 'c subcommand help'),
+ ('d', 'd subcommand help'),
+ ('e', 'e subcommand help'),
+ )
+
+ subparsers_signatures = [Sig(name=name, help=help)
+ for name, help in subcommand_data]
+
+ usage = '''\
+ usage: PROG [-h] [-v] {a,b,c,d,e} ...
+ '''
+
+ help = usage + '''\
+
+ display some subcommands
+
+ positional arguments:
+ {a,b,c,d,e}
+ a a subcommand help
+ b b subcommand help
+ c c subcommand help
+ d d subcommand help
+ e e subcommand help
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -v, --version show program's version number and exit
+ '''
+
+ version = '''\
+ 0.1
+ '''
+
+
+# =====================================
+# Optional/Positional constructor tests
+# =====================================
+
+class TestInvalidArgumentConstructors(TestCase):
+ """Test a bunch of invalid Argument constructors"""
+
+ def assertTypeError(self, *args, **kwargs):
+ parser = argparse.ArgumentParser()
+ self.assertRaises(TypeError, parser.add_argument,
+ *args, **kwargs)
+
+ def assertValueError(self, *args, **kwargs):
+ parser = argparse.ArgumentParser()
+ self.assertRaises(ValueError, parser.add_argument,
+ *args, **kwargs)
+
+ def test_invalid_keyword_arguments(self):
+ self.assertTypeError('-x', bar=None)
+ self.assertTypeError('-y', callback='foo')
+ self.assertTypeError('-y', callback_args=())
+ self.assertTypeError('-y', callback_kwargs={})
+
+ def test_missing_destination(self):
+ self.assertTypeError()
+ for action in ['append', 'store']:
+ self.assertTypeError(action=action)
+
+ def test_invalid_option_strings(self):
+ self.assertValueError('--')
+ self.assertValueError('---')
+
+ def test_invalid_type(self):
+ self.assertValueError('--foo', type='int')
+ self.assertValueError('--foo', type=(int, float))
+
+ def test_invalid_action(self):
+ self.assertValueError('-x', action='foo')
+ self.assertValueError('foo', action='baz')
+ self.assertValueError('--foo', action=('store', 'append'))
+ parser = argparse.ArgumentParser()
+ try:
+ parser.add_argument("--foo", action="store-true")
+ except ValueError:
+ e = sys.exc_info()[1]
+ expected = 'unknown action'
+ msg = 'expected %r, found %r' % (expected, e)
+ self.assertTrue(expected in str(e), msg)
+
+ def test_multiple_dest(self):
+ parser = argparse.ArgumentParser()
+ parser.add_argument(dest='foo')
+ try:
+ parser.add_argument('bar', dest='baz')
+ except ValueError:
+ e = sys.exc_info()[1]
+ expected = 'dest supplied twice for positional argument'
+ msg = 'expected %r, found %r' % (expected, e)
+ self.assertTrue(expected in str(e), msg)
+
+ def test_no_argument_actions(self):
+ for action in ['store_const', 'store_true', 'store_false',
+ 'append_const', 'count']:
+ for attrs in [dict(type=int), dict(nargs='+'),
+ dict(choices='ab')]:
+ self.assertTypeError('-x', action=action, **attrs)
+
+ def test_no_argument_no_const_actions(self):
+ # options with zero arguments
+ for action in ['store_true', 'store_false', 'count']:
+
+ # const is always disallowed
+ self.assertTypeError('-x', const='foo', action=action)
+
+ # nargs is always disallowed
+ self.assertTypeError('-x', nargs='*', action=action)
+
+ def test_more_than_one_argument_actions(self):
+ for action in ['store', 'append']:
+
+ # nargs=0 is disallowed
+ self.assertValueError('-x', nargs=0, action=action)
+ self.assertValueError('spam', nargs=0, action=action)
+
+ # const is disallowed with non-optional arguments
+ for nargs in [1, '*', '+']:
+ self.assertValueError('-x', const='foo',
+ nargs=nargs, action=action)
+ self.assertValueError('spam', const='foo',
+ nargs=nargs, action=action)
+
+ def test_required_const_actions(self):
+ for action in ['store_const', 'append_const']:
+
+ # nargs is always disallowed
+ self.assertTypeError('-x', nargs='+', action=action)
+
+ def test_parsers_action_missing_params(self):
+ self.assertTypeError('command', action='parsers')
+ self.assertTypeError('command', action='parsers', prog='PROG')
+ self.assertTypeError('command', action='parsers',
+ parser_class=argparse.ArgumentParser)
+
+ def test_required_positional(self):
+ self.assertTypeError('foo', required=True)
+
+ def test_user_defined_action(self):
+
+ class Success(Exception):
+ pass
+
+ class Action(object):
+
+ def __init__(self,
+ option_strings,
+ dest,
+ const,
+ default,
+ required=False):
+ if dest == 'spam':
+ if const is Success:
+ if default is Success:
+ raise Success()
+
+ def __call__(self, *args, **kwargs):
+ pass
+
+ parser = argparse.ArgumentParser()
+ self.assertRaises(Success, parser.add_argument, '--spam',
+ action=Action, default=Success, const=Success)
+ self.assertRaises(Success, parser.add_argument, 'spam',
+ action=Action, default=Success, const=Success)
+
+# ================================
+# Actions returned by add_argument
+# ================================
+
+class TestActionsReturned(TestCase):
+
+ def test_dest(self):
+ parser = argparse.ArgumentParser()
+ action = parser.add_argument('--foo')
+ self.assertEqual(action.dest, 'foo')
+ action = parser.add_argument('-b', '--bar')
+ self.assertEqual(action.dest, 'bar')
+ action = parser.add_argument('-x', '-y')
+ self.assertEqual(action.dest, 'x')
+
+ def test_misc(self):
+ parser = argparse.ArgumentParser()
+ action = parser.add_argument('--foo', nargs='?', const=42,
+ default=84, type=int, choices=[1, 2],
+ help='FOO', metavar='BAR', dest='baz')
+ self.assertEqual(action.nargs, '?')
+ self.assertEqual(action.const, 42)
+ self.assertEqual(action.default, 84)
+ self.assertEqual(action.type, int)
+ self.assertEqual(action.choices, [1, 2])
+ self.assertEqual(action.help, 'FOO')
+ self.assertEqual(action.metavar, 'BAR')
+ self.assertEqual(action.dest, 'baz')
+
+
+# ================================
+# Argument conflict handling tests
+# ================================
+
+class TestConflictHandling(TestCase):
+
+ def test_bad_type(self):
+ self.assertRaises(ValueError, argparse.ArgumentParser,
+ conflict_handler='foo')
+
+ def test_conflict_error(self):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-x')
+ self.assertRaises(argparse.ArgumentError,
+ parser.add_argument, '-x')
+ parser.add_argument('--spam')
+ self.assertRaises(argparse.ArgumentError,
+ parser.add_argument, '--spam')
+
+ def test_resolve_error(self):
+ get_parser = argparse.ArgumentParser
+ parser = get_parser(prog='PROG', conflict_handler='resolve')
+
+ parser.add_argument('-x', help='OLD X')
+ parser.add_argument('-x', help='NEW X')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [-x X]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X NEW X
+ '''))
+
+ parser.add_argument('--spam', metavar='OLD_SPAM')
+ parser.add_argument('--spam', metavar='NEW_SPAM')
+ self.assertEqual(parser.format_help(), textwrap.dedent('''\
+ usage: PROG [-h] [-x X] [--spam NEW_SPAM]
+
+ optional arguments:
+ -h, --help show this help message and exit
+ -x X NEW X
+ --spam NEW_SPAM
+ '''))
+
+
+# =============================
+# Help and Version option tests
+# =============================
+
+class TestOptionalsHelpVersionActions(TestCase):
+ """Test the help and version actions"""
+
+ def _get_error(self, func, *args, **kwargs):
+ try:
+ func(*args, **kwargs)
+ except ArgumentParserError:
+ return sys.exc_info()[1]
+ else:
+ self.assertRaises(ArgumentParserError, func, *args, **kwargs)
+
+ def assertPrintHelpExit(self, parser, args_str):
+ self.assertEqual(
+ parser.format_help(),
+ self._get_error(parser.parse_args, args_str.split()).stdout)
+
+ def assertPrintVersionExit(self, parser, args_str):
+ self.assertEqual(
+ parser.format_version(),
+ self._get_error(parser.parse_args, args_str.split()).stderr)
+
+ def assertArgumentParserError(self, parser, *args):
+ self.assertRaises(ArgumentParserError, parser.parse_args, args)
+
+ def test_version(self):
+ parser = ErrorRaisingArgumentParser(version='1.0')
+ self.assertPrintHelpExit(parser, '-h')
+ self.assertPrintHelpExit(parser, '--help')
+ self.assertPrintVersionExit(parser, '-v')
+ self.assertPrintVersionExit(parser, '--version')
+
+ def test_version_format(self):
+ parser = ErrorRaisingArgumentParser(prog='PPP', version='%(prog)s 3.5')
+ msg = self._get_error(parser.parse_args, ['-v']).stderr
+ self.assertEqual('PPP 3.5\n', msg)
+
+ def test_version_no_help(self):
+ parser = ErrorRaisingArgumentParser(add_help=False, version='1.0')
+ self.assertArgumentParserError(parser, '-h')
+ self.assertArgumentParserError(parser, '--help')
+ self.assertPrintVersionExit(parser, '-v')
+ self.assertPrintVersionExit(parser, '--version')
+
+ def test_version_action(self):
+ parser = ErrorRaisingArgumentParser(prog='XXX')
+ parser.add_argument('-V', action='version', version='%(prog)s 3.7')
+ msg = self._get_error(parser.parse_args, ['-V']).stderr
+ self.assertEqual('XXX 3.7\n', msg)
+
+ def test_no_help(self):
+ parser = ErrorRaisingArgumentParser(add_help=False)
+ self.assertArgumentParserError(parser, '-h')
+ self.assertArgumentParserError(parser, '--help')
+ self.assertArgumentParserError(parser, '-v')
+ self.assertArgumentParserError(parser, '--version')
+
+ def test_alternate_help_version(self):
+ parser = ErrorRaisingArgumentParser()
+ parser.add_argument('-x', action='help')
+ parser.add_argument('-y', action='version')
+ self.assertPrintHelpExit(parser, '-x')
+ self.assertPrintVersionExit(parser, '-y')
+ self.assertArgumentParserError(parser, '-v')
+ self.assertArgumentParserError(parser, '--version')
+
+ def test_help_version_extra_arguments(self):
+ parser = ErrorRaisingArgumentParser(version='1.0')
+ parser.add_argument('-x', action='store_true')
+ parser.add_argument('y')
+
+ # try all combinations of valid prefixes and suffixes
+ valid_prefixes = ['', '-x', 'foo', '-x bar', 'baz -x']
+ valid_suffixes = valid_prefixes + ['--bad-option', 'foo bar baz']
+ for prefix in valid_prefixes:
+ for suffix in valid_suffixes:
+ format = '%s %%s %s' % (prefix, suffix)
+ self.assertPrintHelpExit(parser, format % '-h')
+ self.assertPrintHelpExit(parser, format % '--help')
+ self.assertPrintVersionExit(parser, format % '-v')
+ self.assertPrintVersionExit(parser, format % '--version')
+
+
+# ======================
+# str() and repr() tests
+# ======================
+
+class TestStrings(TestCase):
+ """Test str() and repr() on Optionals and Positionals"""
+
+ def assertStringEqual(self, obj, result_string):
+ for func in [str, repr]:
+ self.assertEqual(func(obj), result_string)
+
+ def test_optional(self):
+ option = argparse.Action(
+ option_strings=['--foo', '-a', '-b'],
+ dest='b',
+ type='int',
+ nargs='+',
+ default=42,
+ choices=[1, 2, 3],
+ help='HELP',
+ metavar='METAVAR')
+ string = (
+ "Action(option_strings=['--foo', '-a', '-b'], dest='b', "
+ "nargs='+', const=None, default=42, type='int', "
+ "choices=[1, 2, 3], help='HELP', metavar='METAVAR')")
+ self.assertStringEqual(option, string)
+
+ def test_argument(self):
+ argument = argparse.Action(
+ option_strings=[],
+ dest='x',
+ type=float,
+ nargs='?',
+ default=2.5,
+ choices=[0.5, 1.5, 2.5],
+ help='H HH H',
+ metavar='MV MV MV')
+ string = (
+ "Action(option_strings=[], dest='x', nargs='?', "
+ "const=None, default=2.5, type=%r, choices=[0.5, 1.5, 2.5], "
+ "help='H HH H', metavar='MV MV MV')" % float)
+ self.assertStringEqual(argument, string)
+
+ def test_namespace(self):
+ ns = argparse.Namespace(foo=42, bar='spam')
+ string = "Namespace(bar='spam', foo=42)"
+ self.assertStringEqual(ns, string)
+
+ def test_parser(self):
+ parser = argparse.ArgumentParser(prog='PROG')
+ string = (
+ "ArgumentParser(prog='PROG', usage=None, description=None, "
+ "version=None, formatter_class=%r, conflict_handler='error', "
+ "add_help=True)" % argparse.HelpFormatter)
+ self.assertStringEqual(parser, string)
+
+# ===============
+# Namespace tests
+# ===============
+
+class TestNamespace(TestCase):
+
+ def test_constructor(self):
+ ns = argparse.Namespace()
+ self.assertRaises(AttributeError, getattr, ns, 'x')
+
+ ns = argparse.Namespace(a=42, b='spam')
+ self.assertEqual(ns.a, 42)
+ self.assertEqual(ns.b, 'spam')
+
+ def test_equality(self):
+ ns1 = argparse.Namespace(a=1, b=2)
+ ns2 = argparse.Namespace(b=2, a=1)
+ ns3 = argparse.Namespace(a=1)
+ ns4 = argparse.Namespace(b=2)
+
+ self.assertEqual(ns1, ns2)
+ self.assertNotEqual(ns1, ns3)
+ self.assertNotEqual(ns1, ns4)
+ self.assertNotEqual(ns2, ns3)
+ self.assertNotEqual(ns2, ns4)
+ self.assertTrue(ns1 != ns3)
+ self.assertTrue(ns1 != ns4)
+ self.assertTrue(ns2 != ns3)
+ self.assertTrue(ns2 != ns4)
+
+
+# ===================
+# File encoding tests
+# ===================
+
+class TestEncoding(TestCase):
+
+ def _test_module_encoding(self, path):
+ path, _ = os.path.splitext(path)
+ path += ".py"
+ with codecs.open(path, 'r', 'utf8') as f:
+ f.read()
+
+ def test_argparse_module_encoding(self):
+ self._test_module_encoding(argparse.__file__)
+
+ def test_test_argparse_module_encoding(self):
+ self._test_module_encoding(__file__)
+
+# ===================
+# ArgumentError tests
+# ===================
+
+class TestArgumentError(TestCase):
+
+ def test_argument_error(self):
+ msg = "my error here"
+ error = argparse.ArgumentError(None, msg)
+ self.assertEqual(str(error), msg)
+
+# =======================
+# ArgumentTypeError tests
+# =======================
+
+class TestArgumentTypeError(TestCase):
+
+ def test_argument_type_error(self):
+
+ def spam(string):
+ raise argparse.ArgumentTypeError('spam!')
+
+ parser = ErrorRaisingArgumentParser(prog='PROG', add_help=False)
+ parser.add_argument('x', type=spam)
+ try:
+ parser.parse_args(['XXX'])
+ except ArgumentParserError:
+ expected = 'usage: PROG x\nPROG: error: argument x: spam!\n'
+ msg = sys.exc_info()[1].stderr
+ self.assertEqual(expected, msg)
+ else:
+ self.fail()
+
+# ======================
+# parse_known_args tests
+# ======================
+
+class TestParseKnownArgs(TestCase):
+
+ def test_optionals(self):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--foo')
+ args, extras = parser.parse_known_args('--foo F --bar --baz'.split())
+ self.assertEqual(NS(foo='F'), args)
+ self.assertEqual(['--bar', '--baz'], extras)
+
+ def test_mixed(self):
+ parser = argparse.ArgumentParser()
+ parser.add_argument('-v', nargs='?', const=1, type=int)
+ parser.add_argument('--spam', action='store_false')
+ parser.add_argument('badger')
+
+ argv = ["B", "C", "--foo", "-v", "3", "4"]
+ args, extras = parser.parse_known_args(argv)
+ self.assertEqual(NS(v=3, spam=True, badger="B"), args)
+ self.assertEqual(["C", "--foo", "4"], extras)
+
+# ==========================
+# add_argument metavar tests
+# ==========================
+
+class TestAddArgumentMetavar(TestCase):
+
+ EXPECTED_MESSAGE = "length of metavar tuple does not match nargs"
+
+ def do_test_no_exception(self, nargs, metavar):
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--foo", nargs=nargs, metavar=metavar)
+
+ def do_test_exception(self, nargs, metavar):
+ parser = argparse.ArgumentParser()
+ with self.assertRaises(ValueError) as cm:
+ parser.add_argument("--foo", nargs=nargs, metavar=metavar)
+ self.assertEqual(cm.exception.args[0], self.EXPECTED_MESSAGE)
+
+ # Unit tests for different values of metavar when nargs=None
+
+ def test_nargs_None_metavar_string(self):
+ self.do_test_no_exception(nargs=None, metavar="1")
+
+ def test_nargs_None_metavar_length0(self):
+ self.do_test_exception(nargs=None, metavar=tuple())
+
+ def test_nargs_None_metavar_length1(self):
+ self.do_test_no_exception(nargs=None, metavar=("1"))
+
+ def test_nargs_None_metavar_length2(self):
+ self.do_test_exception(nargs=None, metavar=("1", "2"))
+
+ def test_nargs_None_metavar_length3(self):
+ self.do_test_exception(nargs=None, metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=?
+
+ def test_nargs_optional_metavar_string(self):
+ self.do_test_no_exception(nargs="?", metavar="1")
+
+ def test_nargs_optional_metavar_length0(self):
+ self.do_test_exception(nargs="?", metavar=tuple())
+
+ def test_nargs_optional_metavar_length1(self):
+ self.do_test_no_exception(nargs="?", metavar=("1"))
+
+ def test_nargs_optional_metavar_length2(self):
+ self.do_test_exception(nargs="?", metavar=("1", "2"))
+
+ def test_nargs_optional_metavar_length3(self):
+ self.do_test_exception(nargs="?", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=*
+
+ def test_nargs_zeroormore_metavar_string(self):
+ self.do_test_no_exception(nargs="*", metavar="1")
+
+ def test_nargs_zeroormore_metavar_length0(self):
+ self.do_test_exception(nargs="*", metavar=tuple())
+
+ def test_nargs_zeroormore_metavar_length1(self):
+ self.do_test_no_exception(nargs="*", metavar=("1"))
+
+ def test_nargs_zeroormore_metavar_length2(self):
+ self.do_test_no_exception(nargs="*", metavar=("1", "2"))
+
+ def test_nargs_zeroormore_metavar_length3(self):
+ self.do_test_exception(nargs="*", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=+
+
+ def test_nargs_oneormore_metavar_string(self):
+ self.do_test_no_exception(nargs="+", metavar="1")
+
+ def test_nargs_oneormore_metavar_length0(self):
+ self.do_test_exception(nargs="+", metavar=tuple())
+
+ def test_nargs_oneormore_metavar_length1(self):
+ self.do_test_no_exception(nargs="+", metavar=("1"))
+
+ def test_nargs_oneormore_metavar_length2(self):
+ self.do_test_no_exception(nargs="+", metavar=("1", "2"))
+
+ def test_nargs_oneormore_metavar_length3(self):
+ self.do_test_exception(nargs="+", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=...
+
+ def test_nargs_remainder_metavar_string(self):
+ self.do_test_no_exception(nargs="...", metavar="1")
+
+ def test_nargs_remainder_metavar_length0(self):
+ self.do_test_no_exception(nargs="...", metavar=tuple())
+
+ def test_nargs_remainder_metavar_length1(self):
+ self.do_test_no_exception(nargs="...", metavar=("1"))
+
+ def test_nargs_remainder_metavar_length2(self):
+ self.do_test_no_exception(nargs="...", metavar=("1", "2"))
+
+ def test_nargs_remainder_metavar_length3(self):
+ self.do_test_no_exception(nargs="...", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=A...
+
+ def test_nargs_parser_metavar_string(self):
+ self.do_test_no_exception(nargs="A...", metavar="1")
+
+ def test_nargs_parser_metavar_length0(self):
+ self.do_test_exception(nargs="A...", metavar=tuple())
+
+ def test_nargs_parser_metavar_length1(self):
+ self.do_test_no_exception(nargs="A...", metavar=("1"))
+
+ def test_nargs_parser_metavar_length2(self):
+ self.do_test_exception(nargs="A...", metavar=("1", "2"))
+
+ def test_nargs_parser_metavar_length3(self):
+ self.do_test_exception(nargs="A...", metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=1
+
+ def test_nargs_1_metavar_string(self):
+ self.do_test_no_exception(nargs=1, metavar="1")
+
+ def test_nargs_1_metavar_length0(self):
+ self.do_test_exception(nargs=1, metavar=tuple())
+
+ def test_nargs_1_metavar_length1(self):
+ self.do_test_no_exception(nargs=1, metavar=("1"))
+
+ def test_nargs_1_metavar_length2(self):
+ self.do_test_exception(nargs=1, metavar=("1", "2"))
+
+ def test_nargs_1_metavar_length3(self):
+ self.do_test_exception(nargs=1, metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=2
+
+ def test_nargs_2_metavar_string(self):
+ self.do_test_no_exception(nargs=2, metavar="1")
+
+ def test_nargs_2_metavar_length0(self):
+ self.do_test_exception(nargs=2, metavar=tuple())
+
+ def test_nargs_2_metavar_length1(self):
+ self.do_test_no_exception(nargs=2, metavar=("1"))
+
+ def test_nargs_2_metavar_length2(self):
+ self.do_test_no_exception(nargs=2, metavar=("1", "2"))
+
+ def test_nargs_2_metavar_length3(self):
+ self.do_test_exception(nargs=2, metavar=("1", "2", "3"))
+
+ # Unit tests for different values of metavar when nargs=3
+
+ def test_nargs_3_metavar_string(self):
+ self.do_test_no_exception(nargs=3, metavar="1")
+
+ def test_nargs_3_metavar_length0(self):
+ self.do_test_exception(nargs=3, metavar=tuple())
+
+ def test_nargs_3_metavar_length1(self):
+ self.do_test_no_exception(nargs=3, metavar=("1"))
+
+ def test_nargs_3_metavar_length2(self):
+ self.do_test_exception(nargs=3, metavar=("1", "2"))
+
+ def test_nargs_3_metavar_length3(self):
+ self.do_test_no_exception(nargs=3, metavar=("1", "2", "3"))
+
+# ============================
+# from argparse import * tests
+# ============================
+
+class TestImportStar(TestCase):
+
+ def test(self):
+ for name in argparse.__all__:
+ self.assertTrue(hasattr(argparse, name))
+
+ def test_all_exports_everything_but_modules(self):
+ items = [
+ name
+ for name, value in vars(argparse).items()
+ if not name.startswith("_")
+ if not inspect.ismodule(value)
+ ]
+ self.assertEqual(sorted(items), sorted(argparse.__all__))
+
+def test_main():
+ # silence warnings about version argument - these are expected
+ with test_support.check_warnings(
+ ('The "version" argument to ArgumentParser is deprecated.',
+ DeprecationWarning),
+ ('The (format|print)_version method is deprecated',
+ DeprecationWarning)):
+ test_support.run_unittest(__name__)
+ # Remove global references to avoid looking like we have refleaks.
+ RFile.seen = {}
+ WFile.seen = set()
+
+
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 01c2209a3d..b6c0f1bdd5 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -14,7 +14,7 @@ class ArraySubclass(array.array):
class ArraySubclassWithKwargs(array.array):
def __init__(self, typecode, newarg=None):
- array.array.__init__(typecode)
+ array.array.__init__(self, typecode)
tests = [] # list to accumulate all tests
typecodes = "cubBhHiIlLfd"
@@ -48,7 +48,7 @@ class BaseTest(unittest.TestCase):
def test_constructor(self):
a = array.array(self.typecode)
self.assertEqual(a.typecode, self.typecode)
- self.assert_(a.itemsize>=self.minitemsize)
+ self.assertTrue(a.itemsize>=self.minitemsize)
self.assertRaises(TypeError, array.array, self.typecode, None)
def test_len(self):
@@ -63,10 +63,10 @@ class BaseTest(unittest.TestCase):
a = array.array(self.typecode, self.example)
self.assertRaises(TypeError, a.buffer_info, 42)
bi = a.buffer_info()
- self.assert_(isinstance(bi, tuple))
+ self.assertIsInstance(bi, tuple)
self.assertEqual(len(bi), 2)
- self.assert_(isinstance(bi[0], (int, long)))
- self.assert_(isinstance(bi[1], int))
+ self.assertIsInstance(bi[0], (int, long))
+ self.assertIsInstance(bi[1], int)
self.assertEqual(bi[1], len(a))
def test_byteswap(self):
@@ -199,6 +199,25 @@ class BaseTest(unittest.TestCase):
f.close()
test_support.unlink(test_support.TESTFN)
+ def test_filewrite(self):
+ a = array.array(self.typecode, 2*self.example)
+ f = open(test_support.TESTFN, 'wb')
+ try:
+ f.write(a)
+ f.close()
+ b = array.array(self.typecode)
+ f = open(test_support.TESTFN, 'rb')
+ b.fromfile(f, len(self.example))
+ self.assertEqual(b, array.array(self.typecode, self.example))
+ self.assertNotEqual(a, b)
+ b.fromfile(f, len(self.example))
+ self.assertEqual(a, b)
+ f.close()
+ finally:
+ if not f.closed:
+ f.close()
+ test_support.unlink(test_support.TESTFN)
+
def test_tofromlist(self):
a = array.array(self.typecode, 2*self.example)
b = array.array(self.typecode)
@@ -233,39 +252,39 @@ class BaseTest(unittest.TestCase):
def test_cmp(self):
a = array.array(self.typecode, self.example)
- self.assert_((a == 42) is False)
- self.assert_((a != 42) is True)
+ self.assertTrue((a == 42) is False)
+ self.assertTrue((a != 42) is True)
- self.assert_((a == a) is True)
- self.assert_((a != a) is False)
- self.assert_((a < a) is False)
- self.assert_((a <= a) is True)
- self.assert_((a > a) is False)
- self.assert_((a >= a) is True)
+ self.assertTrue((a == a) is True)
+ self.assertTrue((a != a) is False)
+ self.assertTrue((a < a) is False)
+ self.assertTrue((a <= a) is True)
+ self.assertTrue((a > a) is False)
+ self.assertTrue((a >= a) is True)
al = array.array(self.typecode, self.smallerexample)
ab = array.array(self.typecode, self.biggerexample)
- self.assert_((a == 2*a) is False)
- self.assert_((a != 2*a) is True)
- self.assert_((a < 2*a) is True)
- self.assert_((a <= 2*a) is True)
- self.assert_((a > 2*a) is False)
- self.assert_((a >= 2*a) is False)
-
- self.assert_((a == al) is False)
- self.assert_((a != al) is True)
- self.assert_((a < al) is False)
- self.assert_((a <= al) is False)
- self.assert_((a > al) is True)
- self.assert_((a >= al) is True)
-
- self.assert_((a == ab) is False)
- self.assert_((a != ab) is True)
- self.assert_((a < ab) is True)
- self.assert_((a <= ab) is True)
- self.assert_((a > ab) is False)
- self.assert_((a >= ab) is False)
+ self.assertTrue((a == 2*a) is False)
+ self.assertTrue((a != 2*a) is True)
+ self.assertTrue((a < 2*a) is True)
+ self.assertTrue((a <= 2*a) is True)
+ self.assertTrue((a > 2*a) is False)
+ self.assertTrue((a >= 2*a) is False)
+
+ self.assertTrue((a == al) is False)
+ self.assertTrue((a != al) is True)
+ self.assertTrue((a < al) is False)
+ self.assertTrue((a <= al) is False)
+ self.assertTrue((a > al) is True)
+ self.assertTrue((a >= al) is True)
+
+ self.assertTrue((a == ab) is False)
+ self.assertTrue((a != ab) is True)
+ self.assertTrue((a < ab) is True)
+ self.assertTrue((a <= ab) is True)
+ self.assertTrue((a > ab) is False)
+ self.assertTrue((a >= ab) is False)
def test_add(self):
a = array.array(self.typecode, self.example) \
@@ -284,11 +303,17 @@ class BaseTest(unittest.TestCase):
a = array.array(self.typecode, self.example[::-1])
b = a
a += array.array(self.typecode, 2*self.example)
- self.assert_(a is b)
+ self.assertTrue(a is b)
self.assertEqual(
a,
array.array(self.typecode, self.example[::-1]+2*self.example)
)
+ a = array.array(self.typecode, self.example)
+ a += a
+ self.assertEqual(
+ a,
+ array.array(self.typecode, self.example + self.example)
+ )
b = array.array(self.badtypecode())
self.assertRaises(TypeError, a.__add__, b)
@@ -327,22 +352,22 @@ class BaseTest(unittest.TestCase):
b = a
a *= 5
- self.assert_(a is b)
+ self.assertTrue(a is b)
self.assertEqual(
a,
array.array(self.typecode, 5*self.example)
)
a *= 0
- self.assert_(a is b)
+ self.assertTrue(a is b)
self.assertEqual(a, array.array(self.typecode))
a *= 1000
- self.assert_(a is b)
+ self.assertTrue(a is b)
self.assertEqual(a, array.array(self.typecode))
a *= -1
- self.assert_(a is b)
+ self.assertTrue(a is b)
self.assertEqual(a, array.array(self.typecode))
a = array.array(self.typecode, self.example)
@@ -603,11 +628,11 @@ class BaseTest(unittest.TestCase):
data.reverse()
L[start:stop:step] = data
a[start:stop:step] = array.array(self.typecode, data)
- self.assertEquals(a, array.array(self.typecode, L))
+ self.assertEqual(a, array.array(self.typecode, L))
del L[start:stop:step]
del a[start:stop:step]
- self.assertEquals(a, array.array(self.typecode, L))
+ self.assertEqual(a, array.array(self.typecode, L))
def test_index(self):
example = 2*self.example
@@ -686,6 +711,13 @@ class BaseTest(unittest.TestCase):
array.array(self.typecode, self.example+self.example[::-1])
)
+ a = array.array(self.typecode, self.example)
+ a.extend(a)
+ self.assertEqual(
+ a,
+ array.array(self.typecode, self.example+self.example)
+ )
+
b = array.array(self.badtypecode())
self.assertRaises(TypeError, a.extend, b)
@@ -728,7 +760,7 @@ class BaseTest(unittest.TestCase):
def test_buffer(self):
a = array.array(self.typecode, self.example)
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
b = buffer(a)
self.assertEqual(b[0], a.tostring()[0])
diff --git a/Lib/test/test_ascii_formatd.py b/Lib/test/test_ascii_formatd.py
new file mode 100644
index 0000000000..c4a616dc8a
--- /dev/null
+++ b/Lib/test/test_ascii_formatd.py
@@ -0,0 +1,58 @@
+# PyOS_ascii_formatd is deprecated and not called from anywhere in
+# Python itself. So this module is the only place it gets tested.
+# Test that it works, and test that it's deprecated.
+
+import unittest
+from test.test_support import check_warnings, run_unittest, import_module
+
+# Skip tests if _ctypes module does not exist
+import_module('_ctypes')
+
+from ctypes import pythonapi, create_string_buffer, sizeof, byref, c_double
+PyOS_ascii_formatd = pythonapi.PyOS_ascii_formatd
+
+
+class FormatDeprecationTests(unittest.TestCase):
+
+ def test_format_deprecation(self):
+ buf = create_string_buffer(' ' * 100)
+
+ with check_warnings(('PyOS_ascii_formatd is deprecated',
+ DeprecationWarning)):
+ PyOS_ascii_formatd(byref(buf), sizeof(buf), '%+.10f',
+ c_double(10.0))
+ self.assertEqual(buf.value, '+10.0000000000')
+
+
+class FormatTests(unittest.TestCase):
+ # ensure that, for the restricted set of format codes,
+ # %-formatting returns the same values os PyOS_ascii_formatd
+ def test_format(self):
+ buf = create_string_buffer(' ' * 100)
+
+ tests = [
+ ('%f', 100.0),
+ ('%g', 100.0),
+ ('%#g', 100.0),
+ ('%#.2g', 100.0),
+ ('%#.2g', 123.4567),
+ ('%#.2g', 1.234567e200),
+ ('%e', 1.234567e200),
+ ('%e', 1.234),
+ ('%+e', 1.234),
+ ('%-e', 1.234),
+ ]
+
+ with check_warnings(('PyOS_ascii_formatd is deprecated',
+ DeprecationWarning)):
+ for format, val in tests:
+ PyOS_ascii_formatd(byref(buf), sizeof(buf), format,
+ c_double(val))
+ self.assertEqual(buf.value, format % val)
+
+
+def test_main():
+ run_unittest(FormatDeprecationTests, FormatTests)
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 2122f619d3..c1574ec76b 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -64,6 +64,10 @@ exec_tests = [
"break",
# Continue
"continue",
+ # for statements with naked tuples (see http://bugs.python.org/issue6704)
+ "for a,b in c: pass",
+ "[(a,b) for a,b in c]",
+ "((a,b) for a,b in c)",
]
# These are compiled through "single"
@@ -122,20 +126,20 @@ eval_tests = [
class AST_Tests(unittest.TestCase):
- def _assert_order(self, ast_node, parent_pos):
+ def _assertTrueorder(self, ast_node, parent_pos):
if not isinstance(ast_node, ast.AST) or ast_node._fields is None:
return
if isinstance(ast_node, (ast.expr, ast.stmt, ast.excepthandler)):
node_pos = (ast_node.lineno, ast_node.col_offset)
- self.assert_(node_pos >= parent_pos)
+ self.assertTrue(node_pos >= parent_pos)
parent_pos = (ast_node.lineno, ast_node.col_offset)
for name in ast_node._fields:
value = getattr(ast_node, name)
if isinstance(value, list):
for child in value:
- self._assert_order(child, parent_pos)
+ self._assertTrueorder(child, parent_pos)
elif value is not None:
- self._assert_order(value, parent_pos)
+ self._assertTrueorder(value, parent_pos)
def test_snippets(self):
for input, output, kind in ((exec_tests, exec_results, "exec"),
@@ -143,25 +147,44 @@ class AST_Tests(unittest.TestCase):
(eval_tests, eval_results, "eval")):
for i, o in itertools.izip(input, output):
ast_tree = compile(i, "?", kind, ast.PyCF_ONLY_AST)
- self.assertEquals(to_tuple(ast_tree), o)
- self._assert_order(ast_tree, (0, 0))
+ self.assertEqual(to_tuple(ast_tree), o)
+ self._assertTrueorder(ast_tree, (0, 0))
+
+ def test_slice(self):
+ slc = ast.parse("x[::]").body[0].value.slice
+ self.assertIsNone(slc.upper)
+ self.assertIsNone(slc.lower)
+ self.assertIsInstance(slc.step, ast.Name)
+ self.assertEqual(slc.step.id, "None")
+
+ def test_from_import(self):
+ im = ast.parse("from . import y").body[0]
+ self.assertIsNone(im.module)
+
+ def test_base_classes(self):
+ self.assertTrue(issubclass(ast.For, ast.stmt))
+ self.assertTrue(issubclass(ast.Name, ast.expr))
+ self.assertTrue(issubclass(ast.stmt, ast.AST))
+ self.assertTrue(issubclass(ast.expr, ast.AST))
+ self.assertTrue(issubclass(ast.comprehension, ast.AST))
+ self.assertTrue(issubclass(ast.Gt, ast.AST))
def test_nodeclasses(self):
x = ast.BinOp(1, 2, 3, lineno=0)
- self.assertEquals(x.left, 1)
- self.assertEquals(x.op, 2)
- self.assertEquals(x.right, 3)
- self.assertEquals(x.lineno, 0)
+ self.assertEqual(x.left, 1)
+ self.assertEqual(x.op, 2)
+ self.assertEqual(x.right, 3)
+ self.assertEqual(x.lineno, 0)
# node raises exception when not given enough arguments
self.assertRaises(TypeError, ast.BinOp, 1, 2)
# can set attributes through kwargs too
x = ast.BinOp(left=1, op=2, right=3, lineno=0)
- self.assertEquals(x.left, 1)
- self.assertEquals(x.op, 2)
- self.assertEquals(x.right, 3)
- self.assertEquals(x.lineno, 0)
+ self.assertEqual(x.left, 1)
+ self.assertEqual(x.op, 2)
+ self.assertEqual(x.right, 3)
+ self.assertEqual(x.lineno, 0)
# this used to fail because Sub._fields was None
x = ast.Sub()
@@ -179,7 +202,7 @@ class AST_Tests(unittest.TestCase):
for protocol in protocols:
for ast in (compile(i, "?", "exec", 0x400) for i in exec_tests):
ast2 = mod.loads(mod.dumps(ast, protocol))
- self.assertEquals(to_tuple(ast2), to_tuple(ast))
+ self.assertEqual(to_tuple(ast2), to_tuple(ast))
class ASTHelpers_Test(unittest.TestCase):
@@ -241,6 +264,14 @@ class ASTHelpers_Test(unittest.TestCase):
'op=Add(), right=Num(n=1, lineno=4, col_offset=4), lineno=4, '
'col_offset=0))'
)
+ # issue10869: do not increment lineno of root twice
+ src = ast.parse('1 + 1', mode='eval')
+ self.assertEqual(ast.increment_lineno(src.body, n=3), src.body)
+ self.assertEqual(ast.dump(src, include_attributes=True),
+ 'Expression(body=BinOp(left=Num(n=1, lineno=4, col_offset=0), '
+ 'op=Add(), right=Num(n=1, lineno=4, col_offset=4), lineno=4, '
+ 'col_offset=0))'
+ )
def test_iter_fields(self):
node = ast.parse('foo()', mode='eval')
@@ -271,8 +302,15 @@ class ASTHelpers_Test(unittest.TestCase):
self.assertEqual(ast.literal_eval('(True, False, None)'), (True, False, None))
self.assertRaises(ValueError, ast.literal_eval, 'foo()')
+ def test_literal_eval_issue4907(self):
+ self.assertEqual(ast.literal_eval('2j'), 2j)
+ self.assertEqual(ast.literal_eval('10 + 2j'), 10 + 2j)
+ self.assertEqual(ast.literal_eval('1.5 - 2j'), 1.5 - 2j)
+ self.assertRaises(ValueError, ast.literal_eval, '2 + (3 + 4j)')
+
+
def test_main():
- with test_support._check_py3k_warnings(("backquote not supported",
+ with test_support.check_py3k_warnings(("backquote not supported",
SyntaxWarning)):
test_support.run_unittest(AST_Tests, ASTHelpers_Test)
@@ -285,7 +323,7 @@ def main():
print kind+"_results = ["
for s in statements:
print repr(to_tuple(compile(s, "?", kind, 0x400)))+","
- print "]"
+ print "]"
print "main()"
raise SystemExit
test_main()
@@ -314,6 +352,9 @@ exec_results = [
('Module', [('Pass', (1, 0))]),
('Module', [('Break', (1, 0))]),
('Module', [('Continue', (1, 0))]),
+('Module', [('For', (1, 0), ('Tuple', (1, 4), [('Name', (1, 4), 'a', ('Store',)), ('Name', (1, 6), 'b', ('Store',))], ('Store',)), ('Name', (1, 11), 'c', ('Load',)), [('Pass', (1, 14))], [])]),
+('Module', [('Expr', (1, 0), ('ListComp', (1, 1), ('Tuple', (1, 2), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [])]))]),
+('Module', [('Expr', (1, 0), ('GeneratorExp', (1, 1), ('Tuple', (1, 2), [('Name', (1, 2), 'a', ('Load',)), ('Name', (1, 4), 'b', ('Load',))], ('Load',)), [('comprehension', ('Tuple', (1, 11), [('Name', (1, 11), 'a', ('Store',)), ('Name', (1, 13), 'b', ('Store',))], ('Store',)), ('Name', (1, 18), 'c', ('Load',)), [])]))]),
]
single_results = [
('Interactive', [('Expr', (1, 0), ('BinOp', (1, 0), ('Num', (1, 0), 1), ('Add',), ('Num', (1, 2), 2)))]),
diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py
index 5501c2defc..c81ec0de45 100644
--- a/Lib/test/test_asynchat.py
+++ b/Lib/test/test_asynchat.py
@@ -1,99 +1,110 @@
-# test asynchat -- requires threading
+# test asynchat
-import thread # If this fails, we can't test this module
-import asyncore, asynchat, socket, threading, time
+import asyncore, asynchat, socket, time
import unittest
import sys
from test import test_support
+try:
+ import threading
+except ImportError:
+ threading = None
HOST = test_support.HOST
SERVER_QUIT = 'QUIT\n'
-class echo_server(threading.Thread):
- # parameter to determine the number of bytes passed back to the
- # client each send
- chunk_size = 1
-
- def __init__(self, event):
- threading.Thread.__init__(self)
- self.event = event
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.port = test_support.bind_port(self.sock)
-
- def run(self):
- self.sock.listen(1)
- self.event.set()
- conn, client = self.sock.accept()
- self.buffer = ""
- # collect data until quit message is seen
- while SERVER_QUIT not in self.buffer:
- data = conn.recv(1)
- if not data:
- break
- self.buffer = self.buffer + data
-
- # remove the SERVER_QUIT message
- self.buffer = self.buffer.replace(SERVER_QUIT, '')
-
- # re-send entire set of collected data
- try:
- # this may fail on some tests, such as test_close_when_done, since
- # the client closes the channel when it's done sending
- while self.buffer:
- n = conn.send(self.buffer[:self.chunk_size])
- time.sleep(0.001)
- self.buffer = self.buffer[n:]
- except:
+if threading:
+ class echo_server(threading.Thread):
+ # parameter to determine the number of bytes passed back to the
+ # client each send
+ chunk_size = 1
+
+ def __init__(self, event):
+ threading.Thread.__init__(self)
+ self.event = event
+ self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.port = test_support.bind_port(self.sock)
+ # This will be set if the client wants us to wait before echoing data
+ # back.
+ self.start_resend_event = None
+
+ def run(self):
+ self.sock.listen(1)
+ self.event.set()
+ conn, client = self.sock.accept()
+ self.buffer = ""
+ # collect data until quit message is seen
+ while SERVER_QUIT not in self.buffer:
+ data = conn.recv(1)
+ if not data:
+ break
+ self.buffer = self.buffer + data
+
+ # remove the SERVER_QUIT message
+ self.buffer = self.buffer.replace(SERVER_QUIT, '')
+
+ if self.start_resend_event:
+ self.start_resend_event.wait()
+
+ # re-send entire set of collected data
+ try:
+ # this may fail on some tests, such as test_close_when_done, since
+ # the client closes the channel when it's done sending
+ while self.buffer:
+ n = conn.send(self.buffer[:self.chunk_size])
+ time.sleep(0.001)
+ self.buffer = self.buffer[n:]
+ except:
+ pass
+
+ conn.close()
+ self.sock.close()
+
+ class echo_client(asynchat.async_chat):
+
+ def __init__(self, terminator, server_port):
+ asynchat.async_chat.__init__(self)
+ self.contents = []
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.connect((HOST, server_port))
+ self.set_terminator(terminator)
+ self.buffer = ''
+
+ def handle_connect(self):
pass
- conn.close()
- self.sock.close()
+ if sys.platform == 'darwin':
+ # select.poll returns a select.POLLHUP at the end of the tests
+ # on darwin, so just ignore it
+ def handle_expt(self):
+ pass
-class echo_client(asynchat.async_chat):
+ def collect_incoming_data(self, data):
+ self.buffer += data
- def __init__(self, terminator, server_port):
- asynchat.async_chat.__init__(self)
- self.contents = []
- self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
- self.connect((HOST, server_port))
- self.set_terminator(terminator)
- self.buffer = ''
+ def found_terminator(self):
+ self.contents.append(self.buffer)
+ self.buffer = ""
- def handle_connect(self):
- pass
- if sys.platform == 'darwin':
- # select.poll returns a select.POLLHUP at the end of the tests
- # on darwin, so just ignore it
- def handle_expt(self):
- pass
-
- def collect_incoming_data(self, data):
- self.buffer += data
-
- def found_terminator(self):
- self.contents.append(self.buffer)
- self.buffer = ""
-
-
-def start_echo_server():
- event = threading.Event()
- s = echo_server(event)
- s.start()
- event.wait()
- event.clear()
- time.sleep(0.01) # Give server time to start accepting.
- return s, event
+ def start_echo_server():
+ event = threading.Event()
+ s = echo_server(event)
+ s.start()
+ event.wait()
+ event.clear()
+ time.sleep(0.01) # Give server time to start accepting.
+ return s, event
+@unittest.skipUnless(threading, 'Threading required for this test.')
class TestAsynchat(unittest.TestCase):
usepoll = False
def setUp (self):
- pass
+ self._threads = test_support.threading_setup()
def tearDown (self):
- pass
+ test_support.threading_cleanup(*self._threads)
def line_terminator_check(self, term, server_chunk):
event = threading.Event()
@@ -200,11 +211,18 @@ class TestAsynchat(unittest.TestCase):
def test_close_when_done(self):
s, event = start_echo_server()
+ s.start_resend_event = threading.Event()
c = echo_client('\n', s.port)
c.push("hello world\nI'm not dead yet!\n")
c.push(SERVER_QUIT)
c.close_when_done()
asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01)
+
+ # Only allow the server to start echoing data back to the client after
+ # the client has closed its connection. This prevents a race condition
+ # where the server echoes all of its data before we can check that it
+ # got any down below.
+ s.start_resend_event.set()
s.join()
self.assertEqual(c.contents, [])
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index 56f1939acd..7d1a3cb33f 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -3,15 +3,20 @@ import unittest
import select
import os
import socket
-import threading
import sys
import time
+import warnings
import errno
from test import test_support
from test.test_support import TESTFN, run_unittest, unlink
from StringIO import StringIO
+try:
+ import threading
+except ImportError:
+ threading = None
+
HOST = test_support.HOST
class dummysocket:
@@ -112,65 +117,65 @@ class HelperFunctionTests(unittest.TestCase):
# http://mail.python.org/pipermail/python-list/2001-October/109973.html)
# These constants should be present as long as poll is available
- if hasattr(select, 'poll'):
- def test_readwrite(self):
- # Check that correct methods are called by readwrite()
-
- attributes = ('read', 'expt', 'write', 'closed', 'error_handled')
-
- expected = (
- (select.POLLIN, 'read'),
- (select.POLLPRI, 'expt'),
- (select.POLLOUT, 'write'),
- (select.POLLERR, 'closed'),
- (select.POLLHUP, 'closed'),
- (select.POLLNVAL, 'closed'),
- )
-
- class testobj:
- def __init__(self):
- self.read = False
- self.write = False
- self.closed = False
- self.expt = False
- self.error_handled = False
-
- def handle_read_event(self):
- self.read = True
-
- def handle_write_event(self):
- self.write = True
-
- def handle_close(self):
- self.closed = True
-
- def handle_expt_event(self):
- self.expt = True
-
- def handle_error(self):
- self.error_handled = True
-
- for flag, expectedattr in expected:
- tobj = testobj()
- self.assertEqual(getattr(tobj, expectedattr), False)
- asyncore.readwrite(tobj, flag)
-
- # Only the attribute modified by the routine we expect to be
- # called should be True.
- for attr in attributes:
- self.assertEqual(getattr(tobj, attr), attr==expectedattr)
-
- # check that ExitNow exceptions in the object handler method
- # bubbles all the way up through asyncore readwrite call
- tr1 = exitingdummy()
- self.assertRaises(asyncore.ExitNow, asyncore.readwrite, tr1, flag)
-
- # check that an exception other than ExitNow in the object handler
- # method causes the handle_error method to get called
- tr2 = crashingdummy()
- self.assertEqual(tr2.error_handled, False)
- asyncore.readwrite(tr2, flag)
- self.assertEqual(tr2.error_handled, True)
+ @unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
+ def test_readwrite(self):
+ # Check that correct methods are called by readwrite()
+
+ attributes = ('read', 'expt', 'write', 'closed', 'error_handled')
+
+ expected = (
+ (select.POLLIN, 'read'),
+ (select.POLLPRI, 'expt'),
+ (select.POLLOUT, 'write'),
+ (select.POLLERR, 'closed'),
+ (select.POLLHUP, 'closed'),
+ (select.POLLNVAL, 'closed'),
+ )
+
+ class testobj:
+ def __init__(self):
+ self.read = False
+ self.write = False
+ self.closed = False
+ self.expt = False
+ self.error_handled = False
+
+ def handle_read_event(self):
+ self.read = True
+
+ def handle_write_event(self):
+ self.write = True
+
+ def handle_close(self):
+ self.closed = True
+
+ def handle_expt_event(self):
+ self.expt = True
+
+ def handle_error(self):
+ self.error_handled = True
+
+ for flag, expectedattr in expected:
+ tobj = testobj()
+ self.assertEqual(getattr(tobj, expectedattr), False)
+ asyncore.readwrite(tobj, flag)
+
+ # Only the attribute modified by the routine we expect to be
+ # called should be True.
+ for attr in attributes:
+ self.assertEqual(getattr(tobj, attr), attr==expectedattr)
+
+ # check that ExitNow exceptions in the object handler method
+ # bubbles all the way up through asyncore readwrite call
+ tr1 = exitingdummy()
+ self.assertRaises(asyncore.ExitNow, asyncore.readwrite, tr1, flag)
+
+ # check that an exception other than ExitNow in the object handler
+ # method causes the handle_error method to get called
+ tr2 = crashingdummy()
+ self.assertEqual(tr2.error_handled, False)
+ asyncore.readwrite(tr2, flag)
+ self.assertEqual(tr2.error_handled, True)
def test_closeall(self):
self.closeall_check(False)
@@ -253,7 +258,7 @@ class DispatcherTests(unittest.TestCase):
sys.stderr = stderr
lines = fp.getvalue().splitlines()
- self.assertEquals(lines, ['log: %s' % l1, 'log: %s' % l2])
+ self.assertEqual(lines, ['log: %s' % l1, 'log: %s' % l2])
def test_log_info(self):
d = asyncore.dispatcher()
@@ -275,7 +280,7 @@ class DispatcherTests(unittest.TestCase):
lines = fp.getvalue().splitlines()
expected = ['EGGS: %s' % l1, 'info: %s' % l2, 'SPAM: %s' % l3]
- self.assertEquals(lines, expected)
+ self.assertEqual(lines, expected)
def test_unhandled(self):
d = asyncore.dispatcher()
@@ -300,20 +305,24 @@ class DispatcherTests(unittest.TestCase):
'warning: unhandled write event',
'warning: unhandled connect event',
'warning: unhandled accept event']
- self.assertEquals(lines, expected)
+ self.assertEqual(lines, expected)
def test_issue_8594(self):
+ # XXX - this test is supposed to be removed in next major Python
+ # version
d = asyncore.dispatcher(socket.socket())
# make sure the error message no longer refers to the socket
# object but the dispatcher instance instead
- try:
- d.foo
- except AttributeError, err:
- self.assertTrue('dispatcher instance' in str(err))
- else:
- self.fail("exception not raised")
- # test cheap inheritance with the underlying socket
- self.assertEqual(d.family, socket.AF_INET)
+ self.assertRaisesRegexp(AttributeError, 'dispatcher instance',
+ getattr, d, 'foo')
+ # cheap inheritance with the underlying socket is supposed
+ # to still work but a DeprecationWarning is expected
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always")
+ family = d.family
+ self.assertEqual(family, socket.AF_INET)
+ self.assertEqual(len(w), 1)
+ self.assertTrue(issubclass(w[0].category, DeprecationWarning))
def test_strerror(self):
# refers to bug #8573
@@ -321,7 +330,7 @@ class DispatcherTests(unittest.TestCase):
if hasattr(os, 'strerror'):
self.assertEqual(err, os.strerror(errno.EPERM))
err = asyncore._strerror(-1)
- self.assertTrue("unknown error" in err.lower())
+ self.assertTrue(err != "")
class dispatcherwithsend_noread(asyncore.dispatcher_with_send):
@@ -340,96 +349,373 @@ class DispatcherWithSendTests(unittest.TestCase):
def tearDown(self):
asyncore.close_all()
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ @test_support.reap_threads
def test_send(self):
- self.evt = threading.Event()
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.sock.settimeout(3)
- self.port = test_support.bind_port(self.sock)
+ evt = threading.Event()
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.settimeout(3)
+ port = test_support.bind_port(sock)
cap = StringIO()
- args = (self.evt, cap, self.sock)
- threading.Thread(target=capture_server, args=args).start()
-
- # wait a little longer for the server to initialize (it sometimes
- # refuses connections on slow machines without this wait)
- time.sleep(0.2)
+ args = (evt, cap, sock)
+ t = threading.Thread(target=capture_server, args=args)
+ t.start()
+ try:
+ # wait a little longer for the server to initialize (it sometimes
+ # refuses connections on slow machines without this wait)
+ time.sleep(0.2)
- data = "Suppose there isn't a 16-ton weight?"
- d = dispatcherwithsend_noread()
- d.create_socket(socket.AF_INET, socket.SOCK_STREAM)
- d.connect((HOST, self.port))
+ data = "Suppose there isn't a 16-ton weight?"
+ d = dispatcherwithsend_noread()
+ d.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ d.connect((HOST, port))
- # give time for socket to connect
- time.sleep(0.1)
+ # give time for socket to connect
+ time.sleep(0.1)
- d.send(data)
- d.send(data)
- d.send('\n')
+ d.send(data)
+ d.send(data)
+ d.send('\n')
- n = 1000
- while d.out_buffer and n > 0:
- asyncore.poll()
- n -= 1
+ n = 1000
+ while d.out_buffer and n > 0:
+ asyncore.poll()
+ n -= 1
- self.evt.wait()
+ evt.wait()
- self.assertEqual(cap.getvalue(), data*2)
+ self.assertEqual(cap.getvalue(), data*2)
+ finally:
+ t.join()
class DispatcherWithSendTests_UsePoll(DispatcherWithSendTests):
usepoll = True
-if hasattr(asyncore, 'file_wrapper'):
- class FileWrapperTest(unittest.TestCase):
- def setUp(self):
- self.d = "It's not dead, it's sleeping!"
- file(TESTFN, 'w').write(self.d)
-
- def tearDown(self):
- unlink(TESTFN)
-
- def test_recv(self):
- fd = os.open(TESTFN, os.O_RDONLY)
- w = asyncore.file_wrapper(fd)
- os.close(fd)
-
- self.assertNotEqual(w.fd, fd)
- self.assertNotEqual(w.fileno(), fd)
- self.assertEqual(w.recv(13), "It's not dead")
- self.assertEqual(w.read(6), ", it's")
- w.close()
- self.assertRaises(OSError, w.read, 1)
-
- def test_send(self):
- d1 = "Come again?"
- d2 = "I want to buy some cheese."
- fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND)
- w = asyncore.file_wrapper(fd)
- os.close(fd)
-
- w.write(d1)
- w.send(d2)
- w.close()
- self.assertEqual(file(TESTFN).read(), self.d + d1 + d2)
-
- def test_dispatcher(self):
- fd = os.open(TESTFN, os.O_RDONLY)
- data = []
- class FileDispatcher(asyncore.file_dispatcher):
- def handle_read(self):
- data.append(self.recv(29))
- s = FileDispatcher(fd)
- os.close(fd)
- asyncore.loop(timeout=0.01, use_poll=True, count=2)
- self.assertEqual("".join(data), self.d)
+@unittest.skipUnless(hasattr(asyncore, 'file_wrapper'),
+ 'asyncore.file_wrapper required')
+class FileWrapperTest(unittest.TestCase):
+ def setUp(self):
+ self.d = "It's not dead, it's sleeping!"
+ with file(TESTFN, 'w') as h:
+ h.write(self.d)
+
+ def tearDown(self):
+ unlink(TESTFN)
+
+ def test_recv(self):
+ fd = os.open(TESTFN, os.O_RDONLY)
+ w = asyncore.file_wrapper(fd)
+ os.close(fd)
+
+ self.assertNotEqual(w.fd, fd)
+ self.assertNotEqual(w.fileno(), fd)
+ self.assertEqual(w.recv(13), "It's not dead")
+ self.assertEqual(w.read(6), ", it's")
+ w.close()
+ self.assertRaises(OSError, w.read, 1)
+
+
+ def test_send(self):
+ d1 = "Come again?"
+ d2 = "I want to buy some cheese."
+ fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND)
+ w = asyncore.file_wrapper(fd)
+ os.close(fd)
+
+ w.write(d1)
+ w.send(d2)
+ w.close()
+ self.assertEqual(file(TESTFN).read(), self.d + d1 + d2)
+
+ @unittest.skipUnless(hasattr(asyncore, 'file_dispatcher'),
+ 'asyncore.file_dispatcher required')
+ def test_dispatcher(self):
+ fd = os.open(TESTFN, os.O_RDONLY)
+ data = []
+ class FileDispatcher(asyncore.file_dispatcher):
+ def handle_read(self):
+ data.append(self.recv(29))
+ s = FileDispatcher(fd)
+ os.close(fd)
+ asyncore.loop(timeout=0.01, use_poll=True, count=2)
+ self.assertEqual(b"".join(data), self.d)
+
+
+class BaseTestHandler(asyncore.dispatcher):
+
+ def __init__(self, sock=None):
+ asyncore.dispatcher.__init__(self, sock)
+ self.flag = False
+
+ def handle_accept(self):
+ raise Exception("handle_accept not supposed to be called")
+
+ def handle_connect(self):
+ raise Exception("handle_connect not supposed to be called")
+
+ def handle_expt(self):
+ raise Exception("handle_expt not supposed to be called")
+
+ def handle_close(self):
+ raise Exception("handle_close not supposed to be called")
+
+ def handle_error(self):
+ raise
+
+
+class TCPServer(asyncore.dispatcher):
+ """A server which listens on an address and dispatches the
+ connection to a handler.
+ """
+
+ def __init__(self, handler=BaseTestHandler, host=HOST, port=0):
+ asyncore.dispatcher.__init__(self)
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.set_reuse_addr()
+ self.bind((host, port))
+ self.listen(5)
+ self.handler = handler
+
+ @property
+ def address(self):
+ return self.socket.getsockname()[:2]
+
+ def handle_accept(self):
+ sock, addr = self.accept()
+ self.handler(sock)
+
+ def handle_error(self):
+ raise
+
+
+class BaseClient(BaseTestHandler):
+
+ def __init__(self, address):
+ BaseTestHandler.__init__(self)
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.connect(address)
+
+ def handle_connect(self):
+ pass
+
+
+class BaseTestAPI(unittest.TestCase):
+
+ def tearDown(self):
+ asyncore.close_all()
+
+ def loop_waiting_for_flag(self, instance, timeout=5):
+ timeout = float(timeout) / 100
+ count = 100
+ while asyncore.socket_map and count > 0:
+ asyncore.loop(timeout=0.01, count=1, use_poll=self.use_poll)
+ if instance.flag:
+ return
+ count -= 1
+ time.sleep(timeout)
+ self.fail("flag not set")
+
+ def test_handle_connect(self):
+ # make sure handle_connect is called on connect()
+
+ class TestClient(BaseClient):
+ def handle_connect(self):
+ self.flag = True
+
+ server = TCPServer()
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_handle_accept(self):
+ # make sure handle_accept() is called when a client connects
+
+ class TestListener(BaseTestHandler):
+
+ def __init__(self):
+ BaseTestHandler.__init__(self)
+ self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.bind((HOST, 0))
+ self.listen(5)
+ self.address = self.socket.getsockname()[:2]
+
+ def handle_accept(self):
+ self.flag = True
+
+ server = TestListener()
+ client = BaseClient(server.address)
+ self.loop_waiting_for_flag(server)
+
+ def test_handle_read(self):
+ # make sure handle_read is called on data received
+
+ class TestClient(BaseClient):
+ def handle_read(self):
+ self.flag = True
+
+ class TestHandler(BaseTestHandler):
+ def __init__(self, conn):
+ BaseTestHandler.__init__(self, conn)
+ self.send('x' * 1024)
+
+ server = TCPServer(TestHandler)
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_handle_write(self):
+ # make sure handle_write is called
+
+ class TestClient(BaseClient):
+ def handle_write(self):
+ self.flag = True
+
+ server = TCPServer()
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_handle_close(self):
+ # make sure handle_close is called when the other end closes
+ # the connection
+
+ class TestClient(BaseClient):
+
+ def handle_read(self):
+ # in order to make handle_close be called we are supposed
+ # to make at least one recv() call
+ self.recv(1024)
+
+ def handle_close(self):
+ self.flag = True
+ self.close()
+
+ class TestHandler(BaseTestHandler):
+ def __init__(self, conn):
+ BaseTestHandler.__init__(self, conn)
+ self.close()
+
+ server = TCPServer(TestHandler)
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ @unittest.skipIf(sys.platform.startswith("sunos"),
+ "OOB support is broken on Solaris")
+ def test_handle_expt(self):
+ # Make sure handle_expt is called on OOB data received.
+ # Note: this might fail on some platforms as OOB data is
+ # tenuously supported and rarely used.
+
+ class TestClient(BaseClient):
+ def handle_expt(self):
+ self.flag = True
+
+ class TestHandler(BaseTestHandler):
+ def __init__(self, conn):
+ BaseTestHandler.__init__(self, conn)
+ self.socket.send(chr(244), socket.MSG_OOB)
+
+ server = TCPServer(TestHandler)
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_handle_error(self):
+
+ class TestClient(BaseClient):
+ def handle_write(self):
+ 1.0 / 0
+ def handle_error(self):
+ self.flag = True
+ try:
+ raise
+ except ZeroDivisionError:
+ pass
+ else:
+ raise Exception("exception not raised")
+
+ server = TCPServer()
+ client = TestClient(server.address)
+ self.loop_waiting_for_flag(client)
+
+ def test_connection_attributes(self):
+ server = TCPServer()
+ client = BaseClient(server.address)
+
+ # we start disconnected
+ self.assertFalse(server.connected)
+ self.assertTrue(server.accepting)
+ # this can't be taken for granted across all platforms
+ #self.assertFalse(client.connected)
+ self.assertFalse(client.accepting)
+
+ # execute some loops so that client connects to server
+ asyncore.loop(timeout=0.01, use_poll=self.use_poll, count=100)
+ self.assertFalse(server.connected)
+ self.assertTrue(server.accepting)
+ self.assertTrue(client.connected)
+ self.assertFalse(client.accepting)
+
+ # disconnect the client
+ client.close()
+ self.assertFalse(server.connected)
+ self.assertTrue(server.accepting)
+ self.assertFalse(client.connected)
+ self.assertFalse(client.accepting)
+
+ # stop serving
+ server.close()
+ self.assertFalse(server.connected)
+ self.assertFalse(server.accepting)
+
+ def test_create_socket(self):
+ s = asyncore.dispatcher()
+ s.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.assertEqual(s.socket.family, socket.AF_INET)
+ self.assertEqual(s.socket.type, socket.SOCK_STREAM)
+
+ def test_bind(self):
+ s1 = asyncore.dispatcher()
+ s1.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ s1.bind((HOST, 0))
+ s1.listen(5)
+ port = s1.socket.getsockname()[1]
+
+ s2 = asyncore.dispatcher()
+ s2.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ # EADDRINUSE indicates the socket was correctly bound
+ self.assertRaises(socket.error, s2.bind, (HOST, port))
+
+ def test_set_reuse_addr(self):
+ sock = socket.socket()
+ try:
+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ except socket.error:
+ unittest.skip("SO_REUSEADDR not supported on this platform")
+ else:
+ # if SO_REUSEADDR succeeded for sock we expect asyncore
+ # to do the same
+ s = asyncore.dispatcher(socket.socket())
+ self.assertFalse(s.socket.getsockopt(socket.SOL_SOCKET,
+ socket.SO_REUSEADDR))
+ s.create_socket(socket.AF_INET, socket.SOCK_STREAM)
+ s.set_reuse_addr()
+ self.assertTrue(s.socket.getsockopt(socket.SOL_SOCKET,
+ socket.SO_REUSEADDR))
+ finally:
+ sock.close()
+
+
+class TestAPI_UseSelect(BaseTestAPI):
+ use_poll = False
+
+@unittest.skipUnless(hasattr(select, 'poll'), 'select.poll required')
+class TestAPI_UsePoll(BaseTestAPI):
+ use_poll = True
def test_main():
tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,
- DispatcherWithSendTests_UsePoll]
- if hasattr(asyncore, 'file_wrapper'):
- tests.append(FileWrapperTest)
-
+ DispatcherWithSendTests_UsePoll, TestAPI_UseSelect,
+ TestAPI_UsePoll, FileWrapperTest]
run_unittest(*tests)
if __name__ == "__main__":
diff --git a/Lib/test/test_augassign.py b/Lib/test/test_augassign.py
index 17bdb24f00..059e8b74c9 100644
--- a/Lib/test/test_augassign.py
+++ b/Lib/test/test_augassign.py
@@ -1,6 +1,6 @@
# Augmented assignment test.
-from test.test_support import run_unittest, _check_py3k_warnings
+from test.test_support import run_unittest, check_py3k_warnings
import unittest
@@ -19,10 +19,13 @@ class AugAssignTest(unittest.TestCase):
x /= 2
if 1/2 == 0:
# classic division
- self.assertEquals(x, 3)
+ self.assertEqual(x, 3)
else:
# new-style division (with -Qnew)
- self.assertEquals(x, 3.0)
+ self.assertEqual(x, 3.0)
+
+ def test_with_unpacking(self):
+ self.assertRaises(SyntaxError, compile, "x, b += 3", "<test>", "exec")
def testInList(self):
x = [2]
@@ -37,9 +40,9 @@ class AugAssignTest(unittest.TestCase):
x[0] ^= 1
x[0] /= 2
if 1/2 == 0:
- self.assertEquals(x[0], 3)
+ self.assertEqual(x[0], 3)
else:
- self.assertEquals(x[0], 3.0)
+ self.assertEqual(x[0], 3.0)
def testInDict(self):
x = {0: 2}
@@ -54,24 +57,24 @@ class AugAssignTest(unittest.TestCase):
x[0] ^= 1
x[0] /= 2
if 1/2 == 0:
- self.assertEquals(x[0], 3)
+ self.assertEqual(x[0], 3)
else:
- self.assertEquals(x[0], 3.0)
+ self.assertEqual(x[0], 3.0)
def testSequences(self):
x = [1,2]
x += [3,4]
x *= 2
- self.assertEquals(x, [1, 2, 3, 4, 1, 2, 3, 4])
+ self.assertEqual(x, [1, 2, 3, 4, 1, 2, 3, 4])
x = [1, 2, 3]
y = x
x[1:2] *= 2
y[1:2] += [1]
- self.assertEquals(x, [1, 2, 1, 2, 3])
- self.assert_(x is y)
+ self.assertEqual(x, [1, 2, 1, 2, 3])
+ self.assertTrue(x is y)
def testCustomMethods1(self):
@@ -96,24 +99,24 @@ class AugAssignTest(unittest.TestCase):
y = x
x += 10
- self.assert_(isinstance(x, aug_test))
- self.assert_(y is not x)
- self.assertEquals(x.val, 11)
+ self.assertIsInstance(x, aug_test)
+ self.assertTrue(y is not x)
+ self.assertEqual(x.val, 11)
x = aug_test2(2)
y = x
x += 10
- self.assert_(y is x)
- self.assertEquals(x.val, 12)
+ self.assertTrue(y is x)
+ self.assertEqual(x.val, 12)
x = aug_test3(3)
y = x
x += 10
- self.assert_(isinstance(x, aug_test3))
- self.assert_(y is not x)
- self.assertEquals(x.val, 13)
+ self.assertIsInstance(x, aug_test3)
+ self.assertTrue(y is not x)
+ self.assertEqual(x.val, 13)
def testCustomMethods2(test_self):
@@ -281,7 +284,7 @@ class AugAssignTest(unittest.TestCase):
1 << x
x <<= 1
- test_self.assertEquals(output, '''\
+ test_self.assertEqual(output, '''\
__add__ called
__radd__ called
__iadd__ called
@@ -321,7 +324,7 @@ __ilshift__ called
'''.splitlines())
def test_main():
- with _check_py3k_warnings(("classic int division", DeprecationWarning)):
+ with check_py3k_warnings(("classic int division", DeprecationWarning)):
run_unittest(AugAssignTest)
if __name__ == '__main__':
diff --git a/Lib/test/test_bigaddrspace.py b/Lib/test/test_bigaddrspace.py
index 8c215fe09a..db19a53c70 100644
--- a/Lib/test/test_bigaddrspace.py
+++ b/Lib/test/test_bigaddrspace.py
@@ -28,7 +28,7 @@ class StrTest(unittest.TestCase):
pass
else:
self.fail("should have raised OverflowError")
- self.assertEquals(len(x), MAX_Py_ssize_t)
+ self.assertEqual(len(x), MAX_Py_ssize_t)
### the following test is pending a patch
# (http://mail.python.org/pipermail/python-dev/2006-July/067774.html)
diff --git a/Lib/test/test_bigmem.py b/Lib/test/test_bigmem.py
index cea5ccbe90..c56016713b 100644
--- a/Lib/test/test_bigmem.py
+++ b/Lib/test/test_bigmem.py
@@ -13,7 +13,7 @@ import sys
# doesn't release the old 's' (if it exists) until well after its new
# value has been created. Use 'del s' before the create_largestring call.
#
-# - Do *not* compare large objects using assertEquals or similar. It's a
+# - Do *not* compare large objects using assertEqual or similar. It's a
# lengty operation and the errormessage will be utterly useless due to
# its size. To make sure whether a result has the right contents, better
# to use the strip or count methods, or compare meaningful slices.
@@ -39,20 +39,20 @@ class StrTest(unittest.TestCase):
SUBSTR = ' abc def ghi'
s = '-' * size + SUBSTR
caps = s.capitalize()
- self.assertEquals(caps[-len(SUBSTR):],
+ self.assertEqual(caps[-len(SUBSTR):],
SUBSTR.capitalize())
- self.assertEquals(caps.lstrip('-'), SUBSTR)
+ self.assertEqual(caps.lstrip('-'), SUBSTR)
@bigmemtest(minsize=_2G + 10, memuse=1)
def test_center(self, size):
SUBSTR = ' abc def ghi'
s = SUBSTR.center(size)
- self.assertEquals(len(s), size)
+ self.assertEqual(len(s), size)
lpadsize = rpadsize = (len(s) - len(SUBSTR)) // 2
if len(s) % 2:
lpadsize += 1
- self.assertEquals(s[lpadsize:-rpadsize], SUBSTR)
- self.assertEquals(s.strip(), SUBSTR.strip())
+ self.assertEqual(s[lpadsize:-rpadsize], SUBSTR)
+ self.assertEqual(s.strip(), SUBSTR.strip())
@precisionbigmemtest(size=_2G - 1, memuse=1)
def test_center_unicode(self, size):
@@ -62,36 +62,36 @@ class StrTest(unittest.TestCase):
except OverflowError:
pass # acceptable on 32-bit
else:
- self.assertEquals(len(s), size)
+ self.assertEqual(len(s), size)
lpadsize = rpadsize = (len(s) - len(SUBSTR)) // 2
if len(s) % 2:
lpadsize += 1
- self.assertEquals(s[lpadsize:-rpadsize], SUBSTR)
- self.assertEquals(s.strip(), SUBSTR.strip())
+ self.assertEqual(s[lpadsize:-rpadsize], SUBSTR)
+ self.assertEqual(s.strip(), SUBSTR.strip())
del s
@bigmemtest(minsize=_2G, memuse=2)
def test_count(self, size):
SUBSTR = ' abc def ghi'
s = '.' * size + SUBSTR
- self.assertEquals(s.count('.'), size)
+ self.assertEqual(s.count('.'), size)
s += '.'
- self.assertEquals(s.count('.'), size + 1)
- self.assertEquals(s.count(' '), 3)
- self.assertEquals(s.count('i'), 1)
- self.assertEquals(s.count('j'), 0)
+ self.assertEqual(s.count('.'), size + 1)
+ self.assertEqual(s.count(' '), 3)
+ self.assertEqual(s.count('i'), 1)
+ self.assertEqual(s.count('j'), 0)
@bigmemtest(minsize=_2G + 2, memuse=3)
def test_decode(self, size):
s = '.' * size
- self.assertEquals(len(s.decode('utf-8')), size)
+ self.assertEqual(len(s.decode('utf-8')), size)
def basic_encode_test(self, size, enc, c=u'.', expectedsize=None):
if expectedsize is None:
expectedsize = size
s = c * size
- self.assertEquals(len(s.encode(enc)), expectedsize)
+ self.assertEqual(len(s.encode(enc)), expectedsize)
@bigmemtest(minsize=_2G + 2, memuse=3)
def test_encode(self, size):
@@ -130,60 +130,60 @@ class StrTest(unittest.TestCase):
except MemoryError:
pass # acceptable on 32-bit
else:
- self.failUnless(s == eval(r))
+ self.assertTrue(s == eval(r))
@bigmemtest(minsize=_2G, memuse=2)
def test_endswith(self, size):
SUBSTR = ' abc def ghi'
s = '-' * size + SUBSTR
- self.failUnless(s.endswith(SUBSTR))
- self.failUnless(s.endswith(s))
+ self.assertTrue(s.endswith(SUBSTR))
+ self.assertTrue(s.endswith(s))
s2 = '...' + s
- self.failUnless(s2.endswith(s))
- self.failIf(s.endswith('a' + SUBSTR))
- self.failIf(SUBSTR.endswith(s))
+ self.assertTrue(s2.endswith(s))
+ self.assertFalse(s.endswith('a' + SUBSTR))
+ self.assertFalse(SUBSTR.endswith(s))
@bigmemtest(minsize=_2G + 10, memuse=2)
def test_expandtabs(self, size):
s = '-' * size
tabsize = 8
- self.assertEquals(s.expandtabs(), s)
+ self.assertEqual(s.expandtabs(), s)
del s
slen, remainder = divmod(size, tabsize)
s = ' \t' * slen
s = s.expandtabs(tabsize)
- self.assertEquals(len(s), size - remainder)
- self.assertEquals(len(s.strip(' ')), 0)
+ self.assertEqual(len(s), size - remainder)
+ self.assertEqual(len(s.strip(' ')), 0)
@bigmemtest(minsize=_2G, memuse=2)
def test_find(self, size):
SUBSTR = ' abc def ghi'
sublen = len(SUBSTR)
s = ''.join([SUBSTR, '-' * size, SUBSTR])
- self.assertEquals(s.find(' '), 0)
- self.assertEquals(s.find(SUBSTR), 0)
- self.assertEquals(s.find(' ', sublen), sublen + size)
- self.assertEquals(s.find(SUBSTR, len(SUBSTR)), sublen + size)
- self.assertEquals(s.find('i'), SUBSTR.find('i'))
- self.assertEquals(s.find('i', sublen),
+ self.assertEqual(s.find(' '), 0)
+ self.assertEqual(s.find(SUBSTR), 0)
+ self.assertEqual(s.find(' ', sublen), sublen + size)
+ self.assertEqual(s.find(SUBSTR, len(SUBSTR)), sublen + size)
+ self.assertEqual(s.find('i'), SUBSTR.find('i'))
+ self.assertEqual(s.find('i', sublen),
sublen + size + SUBSTR.find('i'))
- self.assertEquals(s.find('i', size),
+ self.assertEqual(s.find('i', size),
sublen + size + SUBSTR.find('i'))
- self.assertEquals(s.find('j'), -1)
+ self.assertEqual(s.find('j'), -1)
@bigmemtest(minsize=_2G, memuse=2)
def test_index(self, size):
SUBSTR = ' abc def ghi'
sublen = len(SUBSTR)
s = ''.join([SUBSTR, '-' * size, SUBSTR])
- self.assertEquals(s.index(' '), 0)
- self.assertEquals(s.index(SUBSTR), 0)
- self.assertEquals(s.index(' ', sublen), sublen + size)
- self.assertEquals(s.index(SUBSTR, sublen), sublen + size)
- self.assertEquals(s.index('i'), SUBSTR.index('i'))
- self.assertEquals(s.index('i', sublen),
+ self.assertEqual(s.index(' '), 0)
+ self.assertEqual(s.index(SUBSTR), 0)
+ self.assertEqual(s.index(' ', sublen), sublen + size)
+ self.assertEqual(s.index(SUBSTR, sublen), sublen + size)
+ self.assertEqual(s.index('i'), SUBSTR.index('i'))
+ self.assertEqual(s.index('i', sublen),
sublen + size + SUBSTR.index('i'))
- self.assertEquals(s.index('i', size),
+ self.assertEqual(s.index('i', size),
sublen + size + SUBSTR.index('i'))
self.assertRaises(ValueError, s.index, 'j')
@@ -191,163 +191,163 @@ class StrTest(unittest.TestCase):
def test_isalnum(self, size):
SUBSTR = '123456'
s = 'a' * size + SUBSTR
- self.failUnless(s.isalnum())
+ self.assertTrue(s.isalnum())
s += '.'
- self.failIf(s.isalnum())
+ self.assertFalse(s.isalnum())
@bigmemtest(minsize=_2G, memuse=2)
def test_isalpha(self, size):
SUBSTR = 'zzzzzzz'
s = 'a' * size + SUBSTR
- self.failUnless(s.isalpha())
+ self.assertTrue(s.isalpha())
s += '.'
- self.failIf(s.isalpha())
+ self.assertFalse(s.isalpha())
@bigmemtest(minsize=_2G, memuse=2)
def test_isdigit(self, size):
SUBSTR = '123456'
s = '9' * size + SUBSTR
- self.failUnless(s.isdigit())
+ self.assertTrue(s.isdigit())
s += 'z'
- self.failIf(s.isdigit())
+ self.assertFalse(s.isdigit())
@bigmemtest(minsize=_2G, memuse=2)
def test_islower(self, size):
chars = ''.join([ chr(c) for c in range(255) if not chr(c).isupper() ])
repeats = size // len(chars) + 2
s = chars * repeats
- self.failUnless(s.islower())
+ self.assertTrue(s.islower())
s += 'A'
- self.failIf(s.islower())
+ self.assertFalse(s.islower())
@bigmemtest(minsize=_2G, memuse=2)
def test_isspace(self, size):
whitespace = ' \f\n\r\t\v'
repeats = size // len(whitespace) + 2
s = whitespace * repeats
- self.failUnless(s.isspace())
+ self.assertTrue(s.isspace())
s += 'j'
- self.failIf(s.isspace())
+ self.assertFalse(s.isspace())
@bigmemtest(minsize=_2G, memuse=2)
def test_istitle(self, size):
SUBSTR = '123456'
s = ''.join(['A', 'a' * size, SUBSTR])
- self.failUnless(s.istitle())
+ self.assertTrue(s.istitle())
s += 'A'
- self.failUnless(s.istitle())
+ self.assertTrue(s.istitle())
s += 'aA'
- self.failIf(s.istitle())
+ self.assertFalse(s.istitle())
@bigmemtest(minsize=_2G, memuse=2)
def test_isupper(self, size):
chars = ''.join([ chr(c) for c in range(255) if not chr(c).islower() ])
repeats = size // len(chars) + 2
s = chars * repeats
- self.failUnless(s.isupper())
+ self.assertTrue(s.isupper())
s += 'a'
- self.failIf(s.isupper())
+ self.assertFalse(s.isupper())
@bigmemtest(minsize=_2G, memuse=2)
def test_join(self, size):
s = 'A' * size
x = s.join(['aaaaa', 'bbbbb'])
- self.assertEquals(x.count('a'), 5)
- self.assertEquals(x.count('b'), 5)
- self.failUnless(x.startswith('aaaaaA'))
- self.failUnless(x.endswith('Abbbbb'))
+ self.assertEqual(x.count('a'), 5)
+ self.assertEqual(x.count('b'), 5)
+ self.assertTrue(x.startswith('aaaaaA'))
+ self.assertTrue(x.endswith('Abbbbb'))
@bigmemtest(minsize=_2G + 10, memuse=1)
def test_ljust(self, size):
SUBSTR = ' abc def ghi'
s = SUBSTR.ljust(size)
- self.failUnless(s.startswith(SUBSTR + ' '))
- self.assertEquals(len(s), size)
- self.assertEquals(s.strip(), SUBSTR.strip())
+ self.assertTrue(s.startswith(SUBSTR + ' '))
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.strip(), SUBSTR.strip())
@bigmemtest(minsize=_2G + 10, memuse=2)
def test_lower(self, size):
s = 'A' * size
s = s.lower()
- self.assertEquals(len(s), size)
- self.assertEquals(s.count('a'), size)
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.count('a'), size)
@bigmemtest(minsize=_2G + 10, memuse=1)
def test_lstrip(self, size):
SUBSTR = 'abc def ghi'
s = SUBSTR.rjust(size)
- self.assertEquals(len(s), size)
- self.assertEquals(s.lstrip(), SUBSTR.lstrip())
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.lstrip(), SUBSTR.lstrip())
del s
s = SUBSTR.ljust(size)
- self.assertEquals(len(s), size)
+ self.assertEqual(len(s), size)
stripped = s.lstrip()
- self.failUnless(stripped is s)
+ self.assertTrue(stripped is s)
@bigmemtest(minsize=_2G + 10, memuse=2)
def test_replace(self, size):
replacement = 'a'
s = ' ' * size
s = s.replace(' ', replacement)
- self.assertEquals(len(s), size)
- self.assertEquals(s.count(replacement), size)
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.count(replacement), size)
s = s.replace(replacement, ' ', size - 4)
- self.assertEquals(len(s), size)
- self.assertEquals(s.count(replacement), 4)
- self.assertEquals(s[-10:], ' aaaa')
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.count(replacement), 4)
+ self.assertEqual(s[-10:], ' aaaa')
@bigmemtest(minsize=_2G, memuse=2)
def test_rfind(self, size):
SUBSTR = ' abc def ghi'
sublen = len(SUBSTR)
s = ''.join([SUBSTR, '-' * size, SUBSTR])
- self.assertEquals(s.rfind(' '), sublen + size + SUBSTR.rfind(' '))
- self.assertEquals(s.rfind(SUBSTR), sublen + size)
- self.assertEquals(s.rfind(' ', 0, size), SUBSTR.rfind(' '))
- self.assertEquals(s.rfind(SUBSTR, 0, sublen + size), 0)
- self.assertEquals(s.rfind('i'), sublen + size + SUBSTR.rfind('i'))
- self.assertEquals(s.rfind('i', 0, sublen), SUBSTR.rfind('i'))
- self.assertEquals(s.rfind('i', 0, sublen + size),
- SUBSTR.rfind('i'))
- self.assertEquals(s.rfind('j'), -1)
+ self.assertEqual(s.rfind(' '), sublen + size + SUBSTR.rfind(' '))
+ self.assertEqual(s.rfind(SUBSTR), sublen + size)
+ self.assertEqual(s.rfind(' ', 0, size), SUBSTR.rfind(' '))
+ self.assertEqual(s.rfind(SUBSTR, 0, sublen + size), 0)
+ self.assertEqual(s.rfind('i'), sublen + size + SUBSTR.rfind('i'))
+ self.assertEqual(s.rfind('i', 0, sublen), SUBSTR.rfind('i'))
+ self.assertEqual(s.rfind('i', 0, sublen + size),
+ SUBSTR.rfind('i'))
+ self.assertEqual(s.rfind('j'), -1)
@bigmemtest(minsize=_2G, memuse=2)
def test_rindex(self, size):
SUBSTR = ' abc def ghi'
sublen = len(SUBSTR)
s = ''.join([SUBSTR, '-' * size, SUBSTR])
- self.assertEquals(s.rindex(' '),
+ self.assertEqual(s.rindex(' '),
sublen + size + SUBSTR.rindex(' '))
- self.assertEquals(s.rindex(SUBSTR), sublen + size)
- self.assertEquals(s.rindex(' ', 0, sublen + size - 1),
- SUBSTR.rindex(' '))
- self.assertEquals(s.rindex(SUBSTR, 0, sublen + size), 0)
- self.assertEquals(s.rindex('i'),
- sublen + size + SUBSTR.rindex('i'))
- self.assertEquals(s.rindex('i', 0, sublen), SUBSTR.rindex('i'))
- self.assertEquals(s.rindex('i', 0, sublen + size),
- SUBSTR.rindex('i'))
+ self.assertEqual(s.rindex(SUBSTR), sublen + size)
+ self.assertEqual(s.rindex(' ', 0, sublen + size - 1),
+ SUBSTR.rindex(' '))
+ self.assertEqual(s.rindex(SUBSTR, 0, sublen + size), 0)
+ self.assertEqual(s.rindex('i'),
+ sublen + size + SUBSTR.rindex('i'))
+ self.assertEqual(s.rindex('i', 0, sublen), SUBSTR.rindex('i'))
+ self.assertEqual(s.rindex('i', 0, sublen + size),
+ SUBSTR.rindex('i'))
self.assertRaises(ValueError, s.rindex, 'j')
@bigmemtest(minsize=_2G + 10, memuse=1)
def test_rjust(self, size):
SUBSTR = ' abc def ghi'
s = SUBSTR.ljust(size)
- self.failUnless(s.startswith(SUBSTR + ' '))
- self.assertEquals(len(s), size)
- self.assertEquals(s.strip(), SUBSTR.strip())
+ self.assertTrue(s.startswith(SUBSTR + ' '))
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.strip(), SUBSTR.strip())
@bigmemtest(minsize=_2G + 10, memuse=1)
def test_rstrip(self, size):
SUBSTR = ' abc def ghi'
s = SUBSTR.ljust(size)
- self.assertEquals(len(s), size)
- self.assertEquals(s.rstrip(), SUBSTR.rstrip())
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.rstrip(), SUBSTR.rstrip())
del s
s = SUBSTR.rjust(size)
- self.assertEquals(len(s), size)
+ self.assertEqual(len(s), size)
stripped = s.rstrip()
- self.failUnless(stripped is s)
+ self.assertTrue(stripped is s)
# The test takes about size bytes to build a string, and then about
# sqrt(size) substrings of sqrt(size) in size and a list to
@@ -360,12 +360,12 @@ class StrTest(unittest.TestCase):
SUBSTR = 'a' + ' ' * chunksize
s = SUBSTR * chunksize
l = s.split()
- self.assertEquals(len(l), chunksize)
- self.assertEquals(set(l), set(['a']))
+ self.assertEqual(len(l), chunksize)
+ self.assertEqual(set(l), set(['a']))
del l
l = s.split('a')
- self.assertEquals(len(l), chunksize + 1)
- self.assertEquals(set(l), set(['', ' ' * chunksize]))
+ self.assertEqual(len(l), chunksize + 1)
+ self.assertEqual(set(l), set(['', ' ' * chunksize]))
# Allocates a string of twice size (and briefly two) and a list of
# size. Because of internal affairs, the s.split() call produces a
@@ -377,12 +377,12 @@ class StrTest(unittest.TestCase):
def test_split_large(self, size):
s = ' a' * size + ' '
l = s.split()
- self.assertEquals(len(l), size)
- self.assertEquals(set(l), set(['a']))
+ self.assertEqual(len(l), size)
+ self.assertEqual(set(l), set(['a']))
del l
l = s.split('a')
- self.assertEquals(len(l), size + 1)
- self.assertEquals(set(l), set([' ']))
+ self.assertEqual(len(l), size + 1)
+ self.assertEqual(set(l), set([' ']))
@bigmemtest(minsize=_2G, memuse=2.1)
def test_splitlines(self, size):
@@ -392,27 +392,27 @@ class StrTest(unittest.TestCase):
SUBSTR = ' ' * chunksize + '\n' + ' ' * chunksize + '\r\n'
s = SUBSTR * chunksize
l = s.splitlines()
- self.assertEquals(len(l), chunksize * 2)
- self.assertEquals(set(l), set([' ' * chunksize]))
+ self.assertEqual(len(l), chunksize * 2)
+ self.assertEqual(set(l), set([' ' * chunksize]))
@bigmemtest(minsize=_2G, memuse=2)
def test_startswith(self, size):
SUBSTR = ' abc def ghi'
s = '-' * size + SUBSTR
- self.failUnless(s.startswith(s))
- self.failUnless(s.startswith('-' * size))
- self.failIf(s.startswith(SUBSTR))
+ self.assertTrue(s.startswith(s))
+ self.assertTrue(s.startswith('-' * size))
+ self.assertFalse(s.startswith(SUBSTR))
@bigmemtest(minsize=_2G, memuse=1)
def test_strip(self, size):
SUBSTR = ' abc def ghi '
s = SUBSTR.rjust(size)
- self.assertEquals(len(s), size)
- self.assertEquals(s.strip(), SUBSTR.strip())
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.strip(), SUBSTR.strip())
del s
s = SUBSTR.ljust(size)
- self.assertEquals(len(s), size)
- self.assertEquals(s.strip(), SUBSTR.strip())
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.strip(), SUBSTR.strip())
@bigmemtest(minsize=_2G, memuse=2)
def test_swapcase(self, size):
@@ -421,17 +421,17 @@ class StrTest(unittest.TestCase):
repeats = size // sublen + 2
s = SUBSTR * repeats
s = s.swapcase()
- self.assertEquals(len(s), sublen * repeats)
- self.assertEquals(s[:sublen * 3], SUBSTR.swapcase() * 3)
- self.assertEquals(s[-sublen * 3:], SUBSTR.swapcase() * 3)
+ self.assertEqual(len(s), sublen * repeats)
+ self.assertEqual(s[:sublen * 3], SUBSTR.swapcase() * 3)
+ self.assertEqual(s[-sublen * 3:], SUBSTR.swapcase() * 3)
@bigmemtest(minsize=_2G, memuse=2)
def test_title(self, size):
SUBSTR = 'SpaaHAaaAaham'
s = SUBSTR * (size // len(SUBSTR) + 2)
s = s.title()
- self.failUnless(s.startswith((SUBSTR * 3).title()))
- self.failUnless(s.endswith(SUBSTR.lower() * 3))
+ self.assertTrue(s.startswith((SUBSTR * 3).title()))
+ self.assertTrue(s.endswith(SUBSTR.lower() * 3))
@bigmemtest(minsize=_2G, memuse=2)
def test_translate(self, size):
@@ -441,39 +441,39 @@ class StrTest(unittest.TestCase):
repeats = size // sublen + 2
s = SUBSTR * repeats
s = s.translate(trans)
- self.assertEquals(len(s), repeats * sublen)
- self.assertEquals(s[:sublen], SUBSTR.translate(trans))
- self.assertEquals(s[-sublen:], SUBSTR.translate(trans))
- self.assertEquals(s.count('.'), 0)
- self.assertEquals(s.count('!'), repeats * 2)
- self.assertEquals(s.count('z'), repeats * 3)
+ self.assertEqual(len(s), repeats * sublen)
+ self.assertEqual(s[:sublen], SUBSTR.translate(trans))
+ self.assertEqual(s[-sublen:], SUBSTR.translate(trans))
+ self.assertEqual(s.count('.'), 0)
+ self.assertEqual(s.count('!'), repeats * 2)
+ self.assertEqual(s.count('z'), repeats * 3)
@bigmemtest(minsize=_2G + 5, memuse=2)
def test_upper(self, size):
s = 'a' * size
s = s.upper()
- self.assertEquals(len(s), size)
- self.assertEquals(s.count('A'), size)
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.count('A'), size)
@bigmemtest(minsize=_2G + 20, memuse=1)
def test_zfill(self, size):
SUBSTR = '-568324723598234'
s = SUBSTR.zfill(size)
- self.failUnless(s.endswith('0' + SUBSTR[1:]))
- self.failUnless(s.startswith('-0'))
- self.assertEquals(len(s), size)
- self.assertEquals(s.count('0'), size - len(SUBSTR))
+ self.assertTrue(s.endswith('0' + SUBSTR[1:]))
+ self.assertTrue(s.startswith('-0'))
+ self.assertEqual(len(s), size)
+ self.assertEqual(s.count('0'), size - len(SUBSTR))
@bigmemtest(minsize=_2G + 10, memuse=2)
def test_format(self, size):
s = '-' * size
sf = '%s' % (s,)
- self.failUnless(s == sf)
+ self.assertTrue(s == sf)
del sf
sf = '..%s..' % (s,)
- self.assertEquals(len(sf), len(s) + 4)
- self.failUnless(sf.startswith('..-'))
- self.failUnless(sf.endswith('-..'))
+ self.assertEqual(len(sf), len(s) + 4)
+ self.assertTrue(sf.startswith('..-'))
+ self.assertTrue(sf.endswith('-..'))
del s, sf
size //= 2
@@ -481,18 +481,18 @@ class StrTest(unittest.TestCase):
s = ''.join([edge, '%s', edge])
del edge
s = s % '...'
- self.assertEquals(len(s), size * 2 + 3)
- self.assertEquals(s.count('.'), 3)
- self.assertEquals(s.count('-'), size * 2)
+ self.assertEqual(len(s), size * 2 + 3)
+ self.assertEqual(s.count('.'), 3)
+ self.assertEqual(s.count('-'), size * 2)
@bigmemtest(minsize=_2G + 10, memuse=2)
def test_repr_small(self, size):
s = '-' * size
s = repr(s)
- self.assertEquals(len(s), size + 2)
- self.assertEquals(s[0], "'")
- self.assertEquals(s[-1], "'")
- self.assertEquals(s.count('-'), size)
+ self.assertEqual(len(s), size + 2)
+ self.assertEqual(s[0], "'")
+ self.assertEqual(s[-1], "'")
+ self.assertEqual(s.count('-'), size)
del s
# repr() will create a string four times as large as this 'binary
# string', but we don't want to allocate much more than twice
@@ -500,46 +500,46 @@ class StrTest(unittest.TestCase):
size = size // 5 * 2
s = '\x00' * size
s = repr(s)
- self.assertEquals(len(s), size * 4 + 2)
- self.assertEquals(s[0], "'")
- self.assertEquals(s[-1], "'")
- self.assertEquals(s.count('\\'), size)
- self.assertEquals(s.count('0'), size * 2)
+ self.assertEqual(len(s), size * 4 + 2)
+ self.assertEqual(s[0], "'")
+ self.assertEqual(s[-1], "'")
+ self.assertEqual(s.count('\\'), size)
+ self.assertEqual(s.count('0'), size * 2)
@bigmemtest(minsize=_2G + 10, memuse=5)
def test_repr_large(self, size):
s = '\x00' * size
s = repr(s)
- self.assertEquals(len(s), size * 4 + 2)
- self.assertEquals(s[0], "'")
- self.assertEquals(s[-1], "'")
- self.assertEquals(s.count('\\'), size)
- self.assertEquals(s.count('0'), size * 2)
+ self.assertEqual(len(s), size * 4 + 2)
+ self.assertEqual(s[0], "'")
+ self.assertEqual(s[-1], "'")
+ self.assertEqual(s.count('\\'), size)
+ self.assertEqual(s.count('0'), size * 2)
@bigmemtest(minsize=2**32 // 5, memuse=6+2)
def test_unicode_repr(self, size):
s = u"\uAAAA" * size
- self.failUnless(len(repr(s)) > size)
+ self.assertTrue(len(repr(s)) > size)
# This test is meaningful even with size < 2G, as long as the
# doubled string is > 2G (but it tests more if both are > 2G :)
@bigmemtest(minsize=_1G + 2, memuse=3)
def test_concat(self, size):
s = '.' * size
- self.assertEquals(len(s), size)
+ self.assertEqual(len(s), size)
s = s + s
- self.assertEquals(len(s), size * 2)
- self.assertEquals(s.count('.'), size * 2)
+ self.assertEqual(len(s), size * 2)
+ self.assertEqual(s.count('.'), size * 2)
# This test is meaningful even with size < 2G, as long as the
# repeated string is > 2G (but it tests more if both are > 2G :)
@bigmemtest(minsize=_1G + 2, memuse=3)
def test_repeat(self, size):
s = '.' * size
- self.assertEquals(len(s), size)
+ self.assertEqual(len(s), size)
s = s * 2
- self.assertEquals(len(s), size * 2)
- self.assertEquals(s.count('.'), size * 2)
+ self.assertEqual(len(s), size * 2)
+ self.assertEqual(s.count('.'), size * 2)
@bigmemtest(minsize=_2G + 20, memuse=1)
def test_slice_and_getitem(self, size):
@@ -549,26 +549,26 @@ class StrTest(unittest.TestCase):
stepsize = len(s) // 100
stepsize = stepsize - (stepsize % sublen)
for i in range(0, len(s) - stepsize, stepsize):
- self.assertEquals(s[i], SUBSTR[0])
- self.assertEquals(s[i:i + sublen], SUBSTR)
- self.assertEquals(s[i:i + sublen:2], SUBSTR[::2])
+ self.assertEqual(s[i], SUBSTR[0])
+ self.assertEqual(s[i:i + sublen], SUBSTR)
+ self.assertEqual(s[i:i + sublen:2], SUBSTR[::2])
if i > 0:
- self.assertEquals(s[i + sublen - 1:i - 1:-3],
- SUBSTR[sublen::-3])
+ self.assertEqual(s[i + sublen - 1:i - 1:-3],
+ SUBSTR[sublen::-3])
# Make sure we do some slicing and indexing near the end of the
# string, too.
- self.assertEquals(s[len(s) - 1], SUBSTR[-1])
- self.assertEquals(s[-1], SUBSTR[-1])
- self.assertEquals(s[len(s) - 10], SUBSTR[0])
- self.assertEquals(s[-sublen], SUBSTR[0])
- self.assertEquals(s[len(s):], '')
- self.assertEquals(s[len(s) - 1:], SUBSTR[-1])
- self.assertEquals(s[-1:], SUBSTR[-1])
- self.assertEquals(s[len(s) - sublen:], SUBSTR)
- self.assertEquals(s[-sublen:], SUBSTR)
- self.assertEquals(len(s[:]), len(s))
- self.assertEquals(len(s[:len(s) - 5]), len(s) - 5)
- self.assertEquals(len(s[5:-5]), len(s) - 10)
+ self.assertEqual(s[len(s) - 1], SUBSTR[-1])
+ self.assertEqual(s[-1], SUBSTR[-1])
+ self.assertEqual(s[len(s) - 10], SUBSTR[0])
+ self.assertEqual(s[-sublen], SUBSTR[0])
+ self.assertEqual(s[len(s):], '')
+ self.assertEqual(s[len(s) - 1:], SUBSTR[-1])
+ self.assertEqual(s[-1:], SUBSTR[-1])
+ self.assertEqual(s[len(s) - sublen:], SUBSTR)
+ self.assertEqual(s[-sublen:], SUBSTR)
+ self.assertEqual(len(s[:]), len(s))
+ self.assertEqual(len(s[:len(s) - 5]), len(s) - 5)
+ self.assertEqual(len(s[5:-5]), len(s) - 10)
self.assertRaises(IndexError, operator.getitem, s, len(s))
self.assertRaises(IndexError, operator.getitem, s, len(s) + 1)
@@ -580,24 +580,24 @@ class StrTest(unittest.TestCase):
edge = '-' * (size // 2)
s = ''.join([edge, SUBSTR, edge])
del edge
- self.failUnless(SUBSTR in s)
- self.failIf(SUBSTR * 2 in s)
- self.failUnless('-' in s)
- self.failIf('a' in s)
+ self.assertIn(SUBSTR, s)
+ self.assertNotIn(SUBSTR * 2, s)
+ self.assertIn('-', s)
+ self.assertNotIn('a', s)
s += 'a'
- self.failUnless('a' in s)
+ self.assertIn('a', s)
@bigmemtest(minsize=_2G + 10, memuse=2)
def test_compare(self, size):
s1 = '-' * size
s2 = '-' * size
- self.failUnless(s1 == s2)
+ self.assertTrue(s1 == s2)
del s2
s2 = s1 + 'a'
- self.failIf(s1 == s2)
+ self.assertFalse(s1 == s2)
del s2
s2 = '.' * size
- self.failIf(s1 == s2)
+ self.assertFalse(s1 == s2)
@bigmemtest(minsize=_2G + 10, memuse=1)
def test_hash(self, size):
@@ -611,7 +611,7 @@ class StrTest(unittest.TestCase):
h1 = hash(s)
del s
s = '\x00' * (size + 1)
- self.failIf(h1 == hash(s))
+ self.assertFalse(h1 == hash(s))
class TupleTest(unittest.TestCase):
@@ -628,13 +628,13 @@ class TupleTest(unittest.TestCase):
def test_compare(self, size):
t1 = (u'',) * size
t2 = (u'',) * size
- self.failUnless(t1 == t2)
+ self.assertTrue(t1 == t2)
del t2
t2 = (u'',) * (size + 1)
- self.failIf(t1 == t2)
+ self.assertFalse(t1 == t2)
del t2
t2 = (1,) * size
- self.failIf(t1 == t2)
+ self.assertFalse(t1 == t2)
# Test concatenating into a single tuple of more than 2G in length,
# and concatenating a tuple of more than 2G in length separately, so
@@ -643,9 +643,9 @@ class TupleTest(unittest.TestCase):
# skipped, in verbose mode.)
def basic_concat_test(self, size):
t = ((),) * size
- self.assertEquals(len(t), size)
+ self.assertEqual(len(t), size)
t = t + t
- self.assertEquals(len(t), size * 2)
+ self.assertEqual(len(t), size * 2)
@bigmemtest(minsize=_2G // 2 + 2, memuse=24)
def test_concat_small(self, size):
@@ -658,10 +658,10 @@ class TupleTest(unittest.TestCase):
@bigmemtest(minsize=_2G // 5 + 10, memuse=8 * 5)
def test_contains(self, size):
t = (1, 2, 3, 4, 5) * size
- self.assertEquals(len(t), size * 5)
- self.failUnless(5 in t)
- self.failIf((1, 2, 3, 4, 5) in t)
- self.failIf(0 in t)
+ self.assertEqual(len(t), size * 5)
+ self.assertIn(5, t)
+ self.assertNotIn((1, 2, 3, 4, 5), t)
+ self.assertNotIn(0, t)
@bigmemtest(minsize=_2G + 10, memuse=8)
def test_hash(self, size):
@@ -669,32 +669,32 @@ class TupleTest(unittest.TestCase):
h1 = hash(t1)
del t1
t2 = (0,) * (size + 1)
- self.failIf(h1 == hash(t2))
+ self.assertFalse(h1 == hash(t2))
@bigmemtest(minsize=_2G + 10, memuse=8)
def test_index_and_slice(self, size):
t = (None,) * size
- self.assertEquals(len(t), size)
- self.assertEquals(t[-1], None)
- self.assertEquals(t[5], None)
- self.assertEquals(t[size - 1], None)
+ self.assertEqual(len(t), size)
+ self.assertEqual(t[-1], None)
+ self.assertEqual(t[5], None)
+ self.assertEqual(t[size - 1], None)
self.assertRaises(IndexError, operator.getitem, t, size)
- self.assertEquals(t[:5], (None,) * 5)
- self.assertEquals(t[-5:], (None,) * 5)
- self.assertEquals(t[20:25], (None,) * 5)
- self.assertEquals(t[-25:-20], (None,) * 5)
- self.assertEquals(t[size - 5:], (None,) * 5)
- self.assertEquals(t[size - 5:size], (None,) * 5)
- self.assertEquals(t[size - 6:size - 2], (None,) * 4)
- self.assertEquals(t[size:size], ())
- self.assertEquals(t[size:size+5], ())
+ self.assertEqual(t[:5], (None,) * 5)
+ self.assertEqual(t[-5:], (None,) * 5)
+ self.assertEqual(t[20:25], (None,) * 5)
+ self.assertEqual(t[-25:-20], (None,) * 5)
+ self.assertEqual(t[size - 5:], (None,) * 5)
+ self.assertEqual(t[size - 5:size], (None,) * 5)
+ self.assertEqual(t[size - 6:size - 2], (None,) * 4)
+ self.assertEqual(t[size:size], ())
+ self.assertEqual(t[size:size+5], ())
# Like test_concat, split in two.
def basic_test_repeat(self, size):
t = ('',) * size
- self.assertEquals(len(t), size)
+ self.assertEqual(len(t), size)
t = t * 2
- self.assertEquals(len(t), size * 2)
+ self.assertEqual(len(t), size * 2)
@bigmemtest(minsize=_2G // 2 + 2, memuse=24)
def test_repeat_small(self, size):
@@ -717,9 +717,9 @@ class TupleTest(unittest.TestCase):
else:
count = 0
for item in t:
- self.assertEquals(item, count)
+ self.assertEqual(item, count)
count += 1
- self.assertEquals(count, size)
+ self.assertEqual(count, size)
@precisionbigmemtest(size=_1G - 25, memuse=9)
def test_from_almost_2G_generator(self, size):
@@ -727,9 +727,9 @@ class TupleTest(unittest.TestCase):
t = tuple(xrange(size))
count = 0
for item in t:
- self.assertEquals(item, count)
+ self.assertEqual(item, count)
count += 1
- self.assertEquals(count, size)
+ self.assertEqual(count, size)
except MemoryError:
pass # acceptable, expected on 32-bit
@@ -738,10 +738,10 @@ class TupleTest(unittest.TestCase):
t = (0,) * size
s = repr(t)
# The repr of a tuple of 0's is exactly three times the tuple length.
- self.assertEquals(len(s), size * 3)
- self.assertEquals(s[:5], '(0, 0')
- self.assertEquals(s[-5:], '0, 0)')
- self.assertEquals(s.count('0'), size)
+ self.assertEqual(len(s), size * 3)
+ self.assertEqual(s[:5], '(0, 0')
+ self.assertEqual(s[-5:], '0, 0)')
+ self.assertEqual(s.count('0'), size)
@bigmemtest(minsize=_2G // 3 + 2, memuse=8 + 3)
def test_repr_small(self, size):
@@ -762,13 +762,13 @@ class ListTest(unittest.TestCase):
def test_compare(self, size):
l1 = [u''] * size
l2 = [u''] * size
- self.failUnless(l1 == l2)
+ self.assertTrue(l1 == l2)
del l2
l2 = [u''] * (size + 1)
- self.failIf(l1 == l2)
+ self.assertFalse(l1 == l2)
del l2
l2 = [2] * size
- self.failIf(l1 == l2)
+ self.assertFalse(l1 == l2)
# Test concatenating into a single list of more than 2G in length,
# and concatenating a list of more than 2G in length separately, so
@@ -777,9 +777,9 @@ class ListTest(unittest.TestCase):
# skipped, in verbose mode.)
def basic_test_concat(self, size):
l = [[]] * size
- self.assertEquals(len(l), size)
+ self.assertEqual(len(l), size)
l = l + l
- self.assertEquals(len(l), size * 2)
+ self.assertEqual(len(l), size * 2)
@bigmemtest(minsize=_2G // 2 + 2, memuse=24)
def test_concat_small(self, size):
@@ -792,9 +792,9 @@ class ListTest(unittest.TestCase):
def basic_test_inplace_concat(self, size):
l = [sys.stdout] * size
l += l
- self.assertEquals(len(l), size * 2)
- self.failUnless(l[0] is l[-1])
- self.failUnless(l[size - 1] is l[size + 1])
+ self.assertEqual(len(l), size * 2)
+ self.assertTrue(l[0] is l[-1])
+ self.assertTrue(l[size - 1] is l[size + 1])
@bigmemtest(minsize=_2G // 2 + 2, memuse=24)
def test_inplace_concat_small(self, size):
@@ -807,79 +807,79 @@ class ListTest(unittest.TestCase):
@bigmemtest(minsize=_2G // 5 + 10, memuse=8 * 5)
def test_contains(self, size):
l = [1, 2, 3, 4, 5] * size
- self.assertEquals(len(l), size * 5)
- self.failUnless(5 in l)
- self.failIf([1, 2, 3, 4, 5] in l)
- self.failIf(0 in l)
+ self.assertEqual(len(l), size * 5)
+ self.assertIn(5, l)
+ self.assertNotIn([1, 2, 3, 4, 5], l)
+ self.assertNotIn(0, l)
@bigmemtest(minsize=_2G + 10, memuse=8)
def test_hash(self, size):
l = [0] * size
- self.failUnlessRaises(TypeError, hash, l)
+ self.assertRaises(TypeError, hash, l)
@bigmemtest(minsize=_2G + 10, memuse=8)
def test_index_and_slice(self, size):
l = [None] * size
- self.assertEquals(len(l), size)
- self.assertEquals(l[-1], None)
- self.assertEquals(l[5], None)
- self.assertEquals(l[size - 1], None)
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[-1], None)
+ self.assertEqual(l[5], None)
+ self.assertEqual(l[size - 1], None)
self.assertRaises(IndexError, operator.getitem, l, size)
- self.assertEquals(l[:5], [None] * 5)
- self.assertEquals(l[-5:], [None] * 5)
- self.assertEquals(l[20:25], [None] * 5)
- self.assertEquals(l[-25:-20], [None] * 5)
- self.assertEquals(l[size - 5:], [None] * 5)
- self.assertEquals(l[size - 5:size], [None] * 5)
- self.assertEquals(l[size - 6:size - 2], [None] * 4)
- self.assertEquals(l[size:size], [])
- self.assertEquals(l[size:size+5], [])
+ self.assertEqual(l[:5], [None] * 5)
+ self.assertEqual(l[-5:], [None] * 5)
+ self.assertEqual(l[20:25], [None] * 5)
+ self.assertEqual(l[-25:-20], [None] * 5)
+ self.assertEqual(l[size - 5:], [None] * 5)
+ self.assertEqual(l[size - 5:size], [None] * 5)
+ self.assertEqual(l[size - 6:size - 2], [None] * 4)
+ self.assertEqual(l[size:size], [])
+ self.assertEqual(l[size:size+5], [])
l[size - 2] = 5
- self.assertEquals(len(l), size)
- self.assertEquals(l[-3:], [None, 5, None])
- self.assertEquals(l.count(5), 1)
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[-3:], [None, 5, None])
+ self.assertEqual(l.count(5), 1)
self.assertRaises(IndexError, operator.setitem, l, size, 6)
- self.assertEquals(len(l), size)
+ self.assertEqual(len(l), size)
l[size - 7:] = [1, 2, 3, 4, 5]
size -= 2
- self.assertEquals(len(l), size)
- self.assertEquals(l[-7:], [None, None, 1, 2, 3, 4, 5])
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[-7:], [None, None, 1, 2, 3, 4, 5])
l[:7] = [1, 2, 3, 4, 5]
size -= 2
- self.assertEquals(len(l), size)
- self.assertEquals(l[:7], [1, 2, 3, 4, 5, None, None])
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[:7], [1, 2, 3, 4, 5, None, None])
del l[size - 1]
size -= 1
- self.assertEquals(len(l), size)
- self.assertEquals(l[-1], 4)
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[-1], 4)
del l[-2:]
size -= 2
- self.assertEquals(len(l), size)
- self.assertEquals(l[-1], 2)
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[-1], 2)
del l[0]
size -= 1
- self.assertEquals(len(l), size)
- self.assertEquals(l[0], 2)
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[0], 2)
del l[:2]
size -= 2
- self.assertEquals(len(l), size)
- self.assertEquals(l[0], 4)
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[0], 4)
# Like test_concat, split in two.
def basic_test_repeat(self, size):
l = [] * size
- self.failIf(l)
+ self.assertFalse(l)
l = [''] * size
- self.assertEquals(len(l), size)
+ self.assertEqual(len(l), size)
l = l * 2
- self.assertEquals(len(l), size * 2)
+ self.assertEqual(len(l), size * 2)
@bigmemtest(minsize=_2G // 2 + 2, memuse=24)
def test_repeat_small(self, size):
@@ -892,14 +892,14 @@ class ListTest(unittest.TestCase):
def basic_test_inplace_repeat(self, size):
l = ['']
l *= size
- self.assertEquals(len(l), size)
- self.failUnless(l[0] is l[-1])
+ self.assertEqual(len(l), size)
+ self.assertTrue(l[0] is l[-1])
del l
l = [''] * size
l *= 2
- self.assertEquals(len(l), size * 2)
- self.failUnless(l[size - 1] is l[-1])
+ self.assertEqual(len(l), size * 2)
+ self.assertTrue(l[size - 1] is l[-1])
@bigmemtest(minsize=_2G // 2 + 2, memuse=16)
def test_inplace_repeat_small(self, size):
@@ -913,10 +913,10 @@ class ListTest(unittest.TestCase):
l = [0] * size
s = repr(l)
# The repr of a list of 0's is exactly three times the list length.
- self.assertEquals(len(s), size * 3)
- self.assertEquals(s[:5], '[0, 0')
- self.assertEquals(s[-5:], '0, 0]')
- self.assertEquals(s.count('0'), size)
+ self.assertEqual(len(s), size * 3)
+ self.assertEqual(s[:5], '[0, 0')
+ self.assertEqual(s[-5:], '0, 0]')
+ self.assertEqual(s.count('0'), size)
@bigmemtest(minsize=_2G // 3 + 2, memuse=8 + 3)
def test_repr_small(self, size):
@@ -932,22 +932,22 @@ class ListTest(unittest.TestCase):
def test_append(self, size):
l = [object()] * size
l.append(object())
- self.assertEquals(len(l), size+1)
- self.failUnless(l[-3] is l[-2])
- self.failIf(l[-2] is l[-1])
+ self.assertEqual(len(l), size+1)
+ self.assertTrue(l[-3] is l[-2])
+ self.assertFalse(l[-2] is l[-1])
@bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5)
def test_count(self, size):
l = [1, 2, 3, 4, 5] * size
- self.assertEquals(l.count(1), size)
- self.assertEquals(l.count("1"), 0)
+ self.assertEqual(l.count(1), size)
+ self.assertEqual(l.count("1"), 0)
def basic_test_extend(self, size):
l = [file] * size
l.extend(l)
- self.assertEquals(len(l), size * 2)
- self.failUnless(l[0] is l[-1])
- self.failUnless(l[size - 1] is l[size + 1])
+ self.assertEqual(len(l), size * 2)
+ self.assertTrue(l[0] is l[-1])
+ self.assertTrue(l[size - 1] is l[size + 1])
@bigmemtest(minsize=_2G // 2 + 2, memuse=16)
def test_extend_small(self, size):
@@ -961,9 +961,9 @@ class ListTest(unittest.TestCase):
def test_index(self, size):
l = [1L, 2L, 3L, 4L, 5L] * size
size *= 5
- self.assertEquals(l.index(1), 0)
- self.assertEquals(l.index(5, size - 5), size - 1)
- self.assertEquals(l.index(5, size - 5, size), size - 1)
+ self.assertEqual(l.index(1), 0)
+ self.assertEqual(l.index(5, size - 5), size - 1)
+ self.assertEqual(l.index(5, size - 5, size), size - 1)
self.assertRaises(ValueError, l.index, 1, size - 4, size)
self.assertRaises(ValueError, l.index, 6L)
@@ -973,96 +973,96 @@ class ListTest(unittest.TestCase):
l = [1.0] * size
l.insert(size - 1, "A")
size += 1
- self.assertEquals(len(l), size)
- self.assertEquals(l[-3:], [1.0, "A", 1.0])
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[-3:], [1.0, "A", 1.0])
l.insert(size + 1, "B")
size += 1
- self.assertEquals(len(l), size)
- self.assertEquals(l[-3:], ["A", 1.0, "B"])
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[-3:], ["A", 1.0, "B"])
l.insert(1, "C")
size += 1
- self.assertEquals(len(l), size)
- self.assertEquals(l[:3], [1.0, "C", 1.0])
- self.assertEquals(l[size - 3:], ["A", 1.0, "B"])
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[:3], [1.0, "C", 1.0])
+ self.assertEqual(l[size - 3:], ["A", 1.0, "B"])
@bigmemtest(minsize=_2G // 5 + 4, memuse=8 * 5)
def test_pop(self, size):
l = [u"a", u"b", u"c", u"d", u"e"] * size
size *= 5
- self.assertEquals(len(l), size)
+ self.assertEqual(len(l), size)
item = l.pop()
size -= 1
- self.assertEquals(len(l), size)
- self.assertEquals(item, u"e")
- self.assertEquals(l[-2:], [u"c", u"d"])
+ self.assertEqual(len(l), size)
+ self.assertEqual(item, u"e")
+ self.assertEqual(l[-2:], [u"c", u"d"])
item = l.pop(0)
size -= 1
- self.assertEquals(len(l), size)
- self.assertEquals(item, u"a")
- self.assertEquals(l[:2], [u"b", u"c"])
+ self.assertEqual(len(l), size)
+ self.assertEqual(item, u"a")
+ self.assertEqual(l[:2], [u"b", u"c"])
item = l.pop(size - 2)
size -= 1
- self.assertEquals(len(l), size)
- self.assertEquals(item, u"c")
- self.assertEquals(l[-2:], [u"b", u"d"])
+ self.assertEqual(len(l), size)
+ self.assertEqual(item, u"c")
+ self.assertEqual(l[-2:], [u"b", u"d"])
@bigmemtest(minsize=_2G + 10, memuse=8)
def test_remove(self, size):
l = [10] * size
- self.assertEquals(len(l), size)
+ self.assertEqual(len(l), size)
l.remove(10)
size -= 1
- self.assertEquals(len(l), size)
+ self.assertEqual(len(l), size)
# Because of the earlier l.remove(), this append doesn't trigger
# a resize.
l.append(5)
size += 1
- self.assertEquals(len(l), size)
- self.assertEquals(l[-2:], [10, 5])
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[-2:], [10, 5])
l.remove(5)
size -= 1
- self.assertEquals(len(l), size)
- self.assertEquals(l[-2:], [10, 10])
+ self.assertEqual(len(l), size)
+ self.assertEqual(l[-2:], [10, 10])
@bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5)
def test_reverse(self, size):
l = [1, 2, 3, 4, 5] * size
l.reverse()
- self.assertEquals(len(l), size * 5)
- self.assertEquals(l[-5:], [5, 4, 3, 2, 1])
- self.assertEquals(l[:5], [5, 4, 3, 2, 1])
+ self.assertEqual(len(l), size * 5)
+ self.assertEqual(l[-5:], [5, 4, 3, 2, 1])
+ self.assertEqual(l[:5], [5, 4, 3, 2, 1])
@bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5)
def test_sort(self, size):
l = [1, 2, 3, 4, 5] * size
l.sort()
- self.assertEquals(len(l), size * 5)
- self.assertEquals(l.count(1), size)
- self.assertEquals(l[:10], [1] * 10)
- self.assertEquals(l[-10:], [5] * 10)
+ self.assertEqual(len(l), size * 5)
+ self.assertEqual(l.count(1), size)
+ self.assertEqual(l[:10], [1] * 10)
+ self.assertEqual(l[-10:], [5] * 10)
class BufferTest(unittest.TestCase):
@precisionbigmemtest(size=_1G, memuse=4)
def test_repeat(self, size):
try:
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
b = buffer("AAAA")*size
except MemoryError:
pass # acceptable on 32-bit
else:
count = 0
for c in b:
- self.assertEquals(c, 'A')
+ self.assertEqual(c, 'A')
count += 1
- self.assertEquals(count, size*4)
+ self.assertEqual(count, size*4)
def test_main():
test_support.run_unittest(StrTest, TupleTest, ListTest, BufferTest)
diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py
index 7fb07be9ce..f825f1c077 100755..100644
--- a/Lib/test/test_binascii.py
+++ b/Lib/test/test_binascii.py
@@ -3,48 +3,76 @@
from test import test_support
import unittest
import binascii
+import array
+
+# Note: "*_hex" functions are aliases for "(un)hexlify"
+b2a_functions = ['b2a_base64', 'b2a_hex', 'b2a_hqx', 'b2a_qp', 'b2a_uu',
+ 'hexlify', 'rlecode_hqx']
+a2b_functions = ['a2b_base64', 'a2b_hex', 'a2b_hqx', 'a2b_qp', 'a2b_uu',
+ 'unhexlify', 'rledecode_hqx']
+all_functions = a2b_functions + b2a_functions + ['crc32', 'crc_hqx']
+
class BinASCIITest(unittest.TestCase):
+ type2test = str
# Create binary test data
- data = "The quick brown fox jumps over the lazy dog.\r\n"
+ rawdata = "The quick brown fox jumps over the lazy dog.\r\n"
# Be slow so we don't depend on other modules
- data += "".join(map(chr, xrange(256)))
- data += "\r\nHello world.\n"
+ rawdata += "".join(map(chr, xrange(256)))
+ rawdata += "\r\nHello world.\n"
+
+ def setUp(self):
+ self.data = self.type2test(self.rawdata)
def test_exceptions(self):
# Check module exceptions
- self.assert_(issubclass(binascii.Error, Exception))
- self.assert_(issubclass(binascii.Incomplete, Exception))
+ self.assertTrue(issubclass(binascii.Error, Exception))
+ self.assertTrue(issubclass(binascii.Incomplete, Exception))
def test_functions(self):
# Check presence of all functions
- funcs = []
- for suffix in "base64", "hqx", "uu", "hex":
- prefixes = ["a2b_", "b2a_"]
- if suffix == "hqx":
- prefixes.extend(["crc_", "rlecode_", "rledecode_"])
- for prefix in prefixes:
- name = prefix + suffix
- self.assertTrue(hasattr(getattr(binascii, name), '__call__'))
- self.assertRaises(TypeError, getattr(binascii, name))
- for name in ("hexlify", "unhexlify"):
+ for name in all_functions:
self.assertTrue(hasattr(getattr(binascii, name), '__call__'))
self.assertRaises(TypeError, getattr(binascii, name))
+ def test_returned_value(self):
+ # Limit to the minimum of all limits (b2a_uu)
+ MAX_ALL = 45
+ raw = self.rawdata[:MAX_ALL]
+ for fa, fb in zip(a2b_functions, b2a_functions):
+ a2b = getattr(binascii, fa)
+ b2a = getattr(binascii, fb)
+ try:
+ a = b2a(self.type2test(raw))
+ res = a2b(self.type2test(a))
+ except Exception, err:
+ self.fail("{}/{} conversion raises {!r}".format(fb, fa, err))
+ if fb == 'b2a_hqx':
+ # b2a_hqx returns a tuple
+ res, _ = res
+ self.assertEqual(res, raw, "{}/{} conversion: "
+ "{!r} != {!r}".format(fb, fa, res, raw))
+ self.assertIsInstance(res, str)
+ self.assertIsInstance(a, str)
+ self.assertLess(max(ord(c) for c in a), 128)
+ self.assertIsInstance(binascii.crc_hqx(raw, 0), int)
+ self.assertIsInstance(binascii.crc32(raw), int)
+
def test_base64valid(self):
# Test base64 with valid data
MAX_BASE64 = 57
lines = []
- for i in range(0, len(self.data), MAX_BASE64):
- b = self.data[i:i+MAX_BASE64]
+ for i in range(0, len(self.rawdata), MAX_BASE64):
+ b = self.type2test(self.rawdata[i:i+MAX_BASE64])
a = binascii.b2a_base64(b)
lines.append(a)
res = ""
for line in lines:
- b = binascii.a2b_base64(line)
+ a = self.type2test(line)
+ b = binascii.a2b_base64(a)
res = res + b
- self.assertEqual(res, self.data)
+ self.assertEqual(res, self.rawdata)
def test_base64invalid(self):
# Test base64 with random invalid characters sprinkled throughout
@@ -52,7 +80,7 @@ class BinASCIITest(unittest.TestCase):
MAX_BASE64 = 57
lines = []
for i in range(0, len(self.data), MAX_BASE64):
- b = self.data[i:i+MAX_BASE64]
+ b = self.type2test(self.rawdata[i:i+MAX_BASE64])
a = binascii.b2a_base64(b)
lines.append(a)
@@ -75,26 +103,28 @@ class BinASCIITest(unittest.TestCase):
return res + noise + line
res = ""
for line in map(addnoise, lines):
- b = binascii.a2b_base64(line)
+ a = self.type2test(line)
+ b = binascii.a2b_base64(a)
res += b
- self.assertEqual(res, self.data)
+ self.assertEqual(res, self.rawdata)
# Test base64 with just invalid characters, which should return
# empty strings. TBD: shouldn't it raise an exception instead ?
- self.assertEqual(binascii.a2b_base64(fillers), '')
+ self.assertEqual(binascii.a2b_base64(self.type2test(fillers)), '')
def test_uu(self):
MAX_UU = 45
lines = []
for i in range(0, len(self.data), MAX_UU):
- b = self.data[i:i+MAX_UU]
+ b = self.type2test(self.rawdata[i:i+MAX_UU])
a = binascii.b2a_uu(b)
lines.append(a)
res = ""
for line in lines:
- b = binascii.a2b_uu(line)
+ a = self.type2test(line)
+ b = binascii.a2b_uu(a)
res += b
- self.assertEqual(res, self.data)
+ self.assertEqual(res, self.rawdata)
self.assertEqual(binascii.a2b_uu("\x7f"), "\x00"*31)
self.assertEqual(binascii.a2b_uu("\x80"), "\x00"*32)
@@ -108,19 +138,27 @@ class BinASCIITest(unittest.TestCase):
self.assertEqual(binascii.b2a_uu('x'), '!> \n')
def test_crc32(self):
- crc = binascii.crc32("Test the CRC-32 of")
- crc = binascii.crc32(" this string.", crc)
+ crc = binascii.crc32(self.type2test("Test the CRC-32 of"))
+ crc = binascii.crc32(self.type2test(" this string."), crc)
self.assertEqual(crc, 1571220330)
self.assertRaises(TypeError, binascii.crc32)
- # The hqx test is in test_binhex.py
+ def test_hqx(self):
+ # Perform binhex4 style RLE-compression
+ # Then calculate the hexbin4 binary-to-ASCII translation
+ rle = binascii.rlecode_hqx(self.data)
+ a = binascii.b2a_hqx(self.type2test(rle))
+ b, _ = binascii.a2b_hqx(self.type2test(a))
+ res = binascii.rledecode_hqx(b)
+
+ self.assertEqual(res, self.rawdata)
def test_hex(self):
# test hexlification
s = '{s\005\000\000\000worldi\002\000\000\000s\005\000\000\000helloi\001\000\000\0000'
- t = binascii.b2a_hex(s)
- u = binascii.a2b_hex(t)
+ t = binascii.b2a_hex(self.type2test(s))
+ u = binascii.a2b_hex(self.type2test(t))
self.assertEqual(s, u)
self.assertRaises(TypeError, binascii.a2b_hex, t[:-1])
self.assertRaises(TypeError, binascii.a2b_hex, t[:-1] + 'q')
@@ -162,16 +200,37 @@ class BinASCIITest(unittest.TestCase):
def test_empty_string(self):
# A test for SF bug #1022953. Make sure SystemError is not raised.
- for n in ['b2a_qp', 'a2b_hex', 'b2a_base64', 'a2b_uu', 'a2b_qp',
- 'b2a_hex', 'unhexlify', 'hexlify', 'crc32', 'b2a_hqx',
- 'a2b_hqx', 'a2b_base64', 'rlecode_hqx', 'b2a_uu',
- 'rledecode_hqx']:
- f = getattr(binascii, n)
- f('')
- binascii.crc_hqx('', 0)
+ empty = self.type2test('')
+ for func in all_functions:
+ if func == 'crc_hqx':
+ # crc_hqx needs 2 arguments
+ binascii.crc_hqx(empty, 0)
+ continue
+ f = getattr(binascii, func)
+ try:
+ f(empty)
+ except Exception, err:
+ self.fail("{}({!r}) raises {!r}".format(func, empty, err))
+
+
+class ArrayBinASCIITest(BinASCIITest):
+ def type2test(self, s):
+ return array.array('c', s)
+
+
+class BytearrayBinASCIITest(BinASCIITest):
+ type2test = bytearray
+
+
+class MemoryviewBinASCIITest(BinASCIITest):
+ type2test = memoryview
+
def test_main():
- test_support.run_unittest(BinASCIITest)
+ test_support.run_unittest(BinASCIITest,
+ ArrayBinASCIITest,
+ BytearrayBinASCIITest,
+ MemoryviewBinASCIITest)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_binop.py b/Lib/test/test_binop.py
index 541f07f507..b1ef626a9a 100644
--- a/Lib/test/test_binop.py
+++ b/Lib/test/test_binop.py
@@ -223,10 +223,10 @@ class RatTestCase(unittest.TestCase):
self.assertEqual(gcd(-10, -2), -2)
for i in range(1, 20):
for j in range(1, 20):
- self.assert_(gcd(i, j) > 0)
- self.assert_(gcd(-i, j) < 0)
- self.assert_(gcd(i, -j) > 0)
- self.assert_(gcd(-i, -j) < 0)
+ self.assertTrue(gcd(i, j) > 0)
+ self.assertTrue(gcd(-i, j) < 0)
+ self.assertTrue(gcd(i, -j) > 0)
+ self.assertTrue(gcd(-i, -j) < 0)
def test_constructor(self):
a = Rat(10, 15)
diff --git a/Lib/test/test_bisect.py b/Lib/test/test_bisect.py
index 66bae48536..934ba8c7a1 100644
--- a/Lib/test/test_bisect.py
+++ b/Lib/test/test_bisect.py
@@ -130,14 +130,14 @@ class TestBisect(unittest.TestCase):
elem = randrange(-1, n+1)
ip = self.module.bisect_left(data, elem)
if ip < len(data):
- self.failUnless(elem <= data[ip])
+ self.assertTrue(elem <= data[ip])
if ip > 0:
- self.failUnless(data[ip-1] < elem)
+ self.assertTrue(data[ip-1] < elem)
ip = self.module.bisect_right(data, elem)
if ip < len(data):
- self.failUnless(elem < data[ip])
+ self.assertTrue(elem < data[ip])
if ip > 0:
- self.failUnless(data[ip-1] <= elem)
+ self.assertTrue(data[ip-1] <= elem)
def test_optionalSlicing(self):
for func, data, elem, expected in self.precomputedCases:
@@ -146,15 +146,15 @@ class TestBisect(unittest.TestCase):
for hi in xrange(3,8):
hi = min(len(data), hi)
ip = func(data, elem, lo, hi)
- self.failUnless(lo <= ip <= hi)
+ self.assertTrue(lo <= ip <= hi)
if func is self.module.bisect_left and ip < hi:
- self.failUnless(elem <= data[ip])
+ self.assertTrue(elem <= data[ip])
if func is self.module.bisect_left and ip > lo:
- self.failUnless(data[ip-1] < elem)
+ self.assertTrue(data[ip-1] < elem)
if func is self.module.bisect_right and ip < hi:
- self.failUnless(elem < data[ip])
+ self.assertTrue(elem < data[ip])
if func is self.module.bisect_right and ip > lo:
- self.failUnless(data[ip-1] <= elem)
+ self.assertTrue(data[ip-1] <= elem)
self.assertEqual(ip, max(lo, min(hi, expected)))
def test_backcompatibility(self):
diff --git a/Lib/test/test_bool.py b/Lib/test/test_bool.py
index 680a40f78a..9d58a2e726 100644
--- a/Lib/test/test_bool.py
+++ b/Lib/test/test_bool.py
@@ -7,12 +7,6 @@ import os
class BoolTest(unittest.TestCase):
- def assertIs(self, a, b):
- self.assert_(a is b)
-
- def assertIsNot(self, a, b):
- self.assert_(a is not b)
-
def test_subclass(self):
try:
class C(bool):
@@ -51,6 +45,18 @@ class BoolTest(unittest.TestCase):
self.assertEqual(int(True), 1)
self.assertIsNot(int(True), True)
+ def test_float(self):
+ self.assertEqual(float(False), 0.0)
+ self.assertIsNot(float(False), False)
+ self.assertEqual(float(True), 1.0)
+ self.assertIsNot(float(True), True)
+
+ def test_long(self):
+ self.assertEqual(long(False), 0L)
+ self.assertIsNot(long(False), False)
+ self.assertEqual(long(True), 1L)
+ self.assertIsNot(long(True), True)
+
def test_math(self):
self.assertEqual(+False, 0)
self.assertIsNot(+False, False)
@@ -163,12 +169,18 @@ class BoolTest(unittest.TestCase):
self.assertIs(bool(""), False)
self.assertIs(bool(), False)
+ def test_format(self):
+ self.assertEqual("%d" % False, "0")
+ self.assertEqual("%d" % True, "1")
+ self.assertEqual("%x" % False, "0")
+ self.assertEqual("%x" % True, "1")
+
def test_hasattr(self):
self.assertIs(hasattr([], "append"), True)
self.assertIs(hasattr([], "wobble"), False)
def test_callable(self):
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
self.assertIs(callable(len), True)
self.assertIs(callable(1), False)
@@ -187,7 +199,7 @@ class BoolTest(unittest.TestCase):
def test_haskey(self):
self.assertIs(1 in {}, False)
self.assertIs(1 in {1:1}, True)
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
self.assertIs({}.has_key(1), False)
self.assertIs({1:1}.has_key(1), True)
@@ -237,15 +249,15 @@ class BoolTest(unittest.TestCase):
def test_boolean(self):
self.assertEqual(True & 1, 1)
- self.assert_(not isinstance(True & 1, bool))
+ self.assertNotIsInstance(True & 1, bool)
self.assertIs(True & True, True)
self.assertEqual(True | 1, 1)
- self.assert_(not isinstance(True | 1, bool))
+ self.assertNotIsInstance(True | 1, bool)
self.assertIs(True | True, True)
self.assertEqual(True ^ 1, 0)
- self.assert_(not isinstance(True ^ 1, bool))
+ self.assertNotIsInstance(True ^ 1, bool)
self.assertIs(True ^ True, False)
def test_fileclosed(self):
@@ -257,12 +269,19 @@ class BoolTest(unittest.TestCase):
finally:
os.remove(test_support.TESTFN)
+ def test_types(self):
+ # types are always true.
+ for t in [bool, complex, dict, file, float, int, list, long, object,
+ set, str, tuple, type]:
+ self.assertIs(bool(t), True)
+
def test_operator(self):
import operator
self.assertIs(operator.truth(0), False)
self.assertIs(operator.truth(1), True)
- self.assertIs(operator.isCallable(0), False)
- self.assertIs(operator.isCallable(len), True)
+ with test_support.check_py3k_warnings():
+ self.assertIs(operator.isCallable(0), False)
+ self.assertIs(operator.isCallable(len), True)
self.assertIs(operator.isNumberType(None), False)
self.assertIs(operator.isNumberType(0), True)
self.assertIs(operator.not_(1), False)
diff --git a/Lib/test/test_bsddb.py b/Lib/test/test_bsddb.py
index fa88f565b3..d1ee0a14a9 100755
--- a/Lib/test/test_bsddb.py
+++ b/Lib/test/test_bsddb.py
@@ -3,9 +3,6 @@
Adapted to unittest format and expanded scope by Raymond Hettinger
"""
import os, sys
-import copy
-import bsddb
-import dbhash # Just so we know it's imported
import unittest
from test import test_support
@@ -46,8 +43,8 @@ class TestBSDDB(unittest.TestCase):
def test_change(self):
self.f['r'] = 'discovered'
self.assertEqual(self.f['r'], 'discovered')
- self.assert_('r' in self.f.keys())
- self.assert_('discovered' in self.f.values())
+ self.assertIn('r', self.f.keys())
+ self.assertIn('discovered', self.f.values())
def test_close_and_reopen(self):
if self.fname is None:
@@ -179,7 +176,7 @@ class TestBSDDB(unittest.TestCase):
def test_first_while_deleting(self):
# Test for bug 1725856
- self.assert_(len(self.d) >= 2, "test requires >=2 items")
+ self.assertTrue(len(self.d) >= 2, "test requires >=2 items")
for _ in self.d:
key = self.f.first()[0]
del self.f[key]
@@ -187,7 +184,7 @@ class TestBSDDB(unittest.TestCase):
def test_last_while_deleting(self):
# Test for bug 1725856's evil twin
- self.assert_(len(self.d) >= 2, "test requires >=2 items")
+ self.assertTrue(len(self.d) >= 2, "test requires >=2 items")
for _ in self.d:
key = self.f.last()[0]
del self.f[key]
@@ -198,13 +195,13 @@ class TestBSDDB(unittest.TestCase):
def test_contains(self):
for k in self.d:
- self.assert_(k in self.f)
- self.assert_('not here' not in self.f)
+ self.assertIn(k, self.f)
+ self.assertNotIn('not here', self.f)
def test_has_key(self):
for k in self.d:
- self.assert_(self.f.has_key(k))
- self.assert_(not self.f.has_key('not here'))
+ self.assertTrue(self.f.has_key(k))
+ self.assertTrue(not self.f.has_key('not here'))
def test_clear(self):
self.f.clear()
@@ -256,11 +253,11 @@ class TestBSDDB(unittest.TestCase):
if debug: print "K"
# test the legacy cursor interface mixed with writes
- self.assert_(self.f.first()[0] in self.d)
+ self.assertIn(self.f.first()[0], self.d)
k = self.f.next()[0]
- self.assert_(k in self.d)
+ self.assertIn(k, self.d)
self.f[k] = "be gone with ye deadlocks"
- self.assert_(self.f[k], "be gone with ye deadlocks")
+ self.assertTrue(self.f[k], "be gone with ye deadlocks")
def test_for_cursor_memleak(self):
# do the bsddb._DBWithCursor iterator internals leak cursors?
@@ -278,21 +275,21 @@ class TestBSDDB(unittest.TestCase):
self.assertEqual(nc1, nc2)
self.assertEqual(nc1, nc4)
- self.assert_(nc3 == nc1+1)
+ self.assertTrue(nc3 == nc1+1)
def test_popitem(self):
k, v = self.f.popitem()
- self.assert_(k in self.d)
- self.assert_(v in self.d.values())
- self.assert_(k not in self.f)
+ self.assertIn(k, self.d)
+ self.assertIn(v, self.d.values())
+ self.assertNotIn(k, self.f)
self.assertEqual(len(self.d)-1, len(self.f))
def test_pop(self):
k = 'w'
v = self.f.pop(k)
self.assertEqual(v, self.d[k])
- self.assert_(k not in self.f)
- self.assert_(v not in self.f.values())
+ self.assertNotIn(k, self.f)
+ self.assertNotIn(v, self.f.values())
self.assertEqual(len(self.d)-1, len(self.f))
def test_get(self):
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index dc50968ddb..6bdc34d28e 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -23,7 +23,7 @@ class BufferTests(unittest.TestCase):
def test_main():
- with test_support._check_py3k_warnings(("buffer.. not supported",
+ with test_support.check_py3k_warnings(("buffer.. not supported",
DeprecationWarning)):
test_support.run_unittest(BufferTests)
diff --git a/Lib/test/test_bufio.py b/Lib/test/test_bufio.py
index 4f5de10c63..108b1e1869 100644
--- a/Lib/test/test_bufio.py
+++ b/Lib/test/test_bufio.py
@@ -1,12 +1,15 @@
import unittest
-from test import test_support
+from test import test_support as support
-# Simple test to ensure that optimizations in fileobject.c deliver
-# the expected results. For best testing, run this under a debug-build
-# Python too (to exercise asserts in the C code).
+import io # C implementation.
+import _pyio as pyio # Python implementation.
-lengths = range(1, 257) + [512, 1000, 1024, 2048, 4096, 8192, 10000,
- 16384, 32768, 65536, 1000000]
+# Simple test to ensure that optimizations in the IO library deliver the
+# expected results. For best testing, run this under a debug-build Python too
+# (to exercise asserts in the C code).
+
+lengths = list(range(1, 257)) + [512, 1000, 1024, 2048, 4096, 8192, 10000,
+ 16384, 32768, 65536, 1000000]
class BufferSizeTest(unittest.TestCase):
def try_one(self, s):
@@ -14,27 +17,27 @@ class BufferSizeTest(unittest.TestCase):
# .readline()s deliver what we wrote.
# Ensure we can open TESTFN for writing.
- test_support.unlink(test_support.TESTFN)
+ support.unlink(support.TESTFN)
# Since C doesn't guarantee we can write/read arbitrary bytes in text
# files, use binary mode.
- f = open(test_support.TESTFN, "wb")
+ f = self.open(support.TESTFN, "wb")
try:
# write once with \n and once without
f.write(s)
- f.write("\n")
+ f.write(b"\n")
f.write(s)
f.close()
- f = open(test_support.TESTFN, "rb")
+ f = open(support.TESTFN, "rb")
line = f.readline()
- self.assertEqual(line, s + "\n")
+ self.assertEqual(line, s + b"\n")
line = f.readline()
self.assertEqual(line, s)
line = f.readline()
- self.assert_(not line) # Must be at EOF
+ self.assertTrue(not line) # Must be at EOF
f.close()
finally:
- test_support.unlink(test_support.TESTFN)
+ support.unlink(support.TESTFN)
def drive_one(self, pattern):
for length in lengths:
@@ -47,19 +50,30 @@ class BufferSizeTest(unittest.TestCase):
teststring = pattern * q + pattern[:r]
self.assertEqual(len(teststring), length)
self.try_one(teststring)
- self.try_one(teststring + "x")
+ self.try_one(teststring + b"x")
self.try_one(teststring[:-1])
def test_primepat(self):
# A pattern with prime length, to avoid simple relationships with
# stdio buffer sizes.
- self.drive_one("1234567890\00\01\02\03\04\05\06")
+ self.drive_one(b"1234567890\00\01\02\03\04\05\06")
def test_nullpat(self):
- self.drive_one("\0" * 1000)
+ self.drive_one(bytes(1000))
+
+
+class CBufferSizeTest(BufferSizeTest):
+ open = io.open
+
+class PyBufferSizeTest(BufferSizeTest):
+ open = staticmethod(pyio.open)
+
+class BuiltinBufferSizeTest(BufferSizeTest):
+ open = open
+
def test_main():
- test_support.run_unittest(BufferSizeTest)
+ support.run_unittest(CBufferSizeTest, PyBufferSizeTest, BuiltinBufferSizeTest)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 9401f6501f..1d35a6afe5 100644
--- a/Lib/test/test_builtin.py
+++ b/Lib/test/test_builtin.py
@@ -2,12 +2,13 @@
import platform
import unittest
+from test.test_support import fcmp, have_unicode, TESTFN, unlink, \
+ run_unittest, check_py3k_warnings
import warnings
-from test.test_support import (fcmp, have_unicode, TESTFN, unlink,
- run_unittest, _check_py3k_warnings, check_warnings)
from operator import neg
import sys, cStringIO, random, UserDict
+
# count the number of test runs.
# used to skip running test_execfile() multiple times
# and to create unique strings to intern in test_intern()
@@ -89,6 +90,16 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(abs(-1234L), 1234L)
# str
self.assertRaises(TypeError, abs, 'a')
+ # bool
+ self.assertEqual(abs(True), 1)
+ self.assertEqual(abs(False), 0)
+ # other
+ self.assertRaises(TypeError, abs)
+ self.assertRaises(TypeError, abs, None)
+ class AbsClass(object):
+ def __abs__(self):
+ return -5
+ self.assertEqual(abs(AbsClass()), -5)
def test_all(self):
self.assertEqual(all([2, 4, 6]), True)
@@ -120,7 +131,7 @@ class BuiltinTest(unittest.TestCase):
def test_neg(self):
x = -sys.maxint-1
- self.assert_(isinstance(x, int))
+ self.assertTrue(isinstance(x, int))
self.assertEqual(-x, sys.maxint+1)
def test_apply(self):
@@ -150,20 +161,45 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, apply, id, (42,), 42)
def test_callable(self):
- self.assert_(callable(len))
+ self.assertTrue(callable(len))
+ self.assertFalse(callable("a"))
+ self.assertTrue(callable(callable))
+ self.assertTrue(callable(lambda x, y: x + y))
+ self.assertFalse(callable(__builtins__))
def f(): pass
- self.assert_(callable(f))
- class C:
+ self.assertTrue(callable(f))
+
+ class Classic:
def meth(self): pass
- self.assert_(callable(C))
- x = C()
- self.assert_(callable(x.meth))
- self.assert_(not callable(x))
- class D(C):
+ self.assertTrue(callable(Classic))
+ c = Classic()
+ self.assertTrue(callable(c.meth))
+ self.assertFalse(callable(c))
+
+ class NewStyle(object):
+ def meth(self): pass
+ self.assertTrue(callable(NewStyle))
+ n = NewStyle()
+ self.assertTrue(callable(n.meth))
+ self.assertFalse(callable(n))
+
+ # Classic and new-style classes evaluate __call__() differently
+ c.__call__ = None
+ self.assertTrue(callable(c))
+ del c.__call__
+ self.assertFalse(callable(c))
+ n.__call__ = None
+ self.assertFalse(callable(n))
+ del n.__call__
+ self.assertFalse(callable(n))
+
+ class N2(object):
def __call__(self): pass
- y = D()
- self.assert_(callable(y))
- y()
+ n2 = N2()
+ self.assertTrue(callable(n2))
+ class N3(N2): pass
+ n3 = N3()
+ self.assertTrue(callable(n3))
def test_chr(self):
self.assertEqual(chr(32), ' ')
@@ -191,9 +227,9 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, cmp)
def test_coerce(self):
- self.assert_(not fcmp(coerce(1, 1.1), (1.0, 1.1)))
+ self.assertTrue(not fcmp(coerce(1, 1.1), (1.0, 1.1)))
self.assertEqual(coerce(1, 1L), (1L, 1L))
- self.assert_(not fcmp(coerce(1L, 1.1), (1.0, 1.1)))
+ self.assertTrue(not fcmp(coerce(1L, 1.1), (1.0, 1.1)))
self.assertRaises(TypeError, coerce)
class BadNumber:
def __coerce__(self, other):
@@ -232,11 +268,11 @@ class BuiltinTest(unittest.TestCase):
# dir() - local scope
local_var = 1
- self.assert_('local_var' in dir())
+ self.assertIn('local_var', dir())
# dir(module)
import sys
- self.assert_('exit' in dir(sys))
+ self.assertIn('exit', dir(sys))
# dir(module_with_invalid__dict__)
import types
@@ -246,8 +282,8 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, dir, f)
# dir(type)
- self.assert_("strip" in dir(str))
- self.assert_("__mro__" not in dir(str))
+ self.assertIn("strip", dir(str))
+ self.assertNotIn("__mro__", dir(str))
# dir(obj)
class Foo(object):
@@ -256,13 +292,13 @@ class BuiltinTest(unittest.TestCase):
self.y = 8
self.z = 9
f = Foo()
- self.assert_("y" in dir(f))
+ self.assertIn("y", dir(f))
# dir(obj_no__dict__)
class Foo(object):
__slots__ = []
f = Foo()
- self.assert_("__repr__" in dir(f))
+ self.assertIn("__repr__", dir(f))
# dir(obj_no__class__with__dict__)
# (an ugly trick to cause getattr(f, "__class__") to fail)
@@ -271,15 +307,15 @@ class BuiltinTest(unittest.TestCase):
def __init__(self):
self.bar = "wow"
f = Foo()
- self.assert_("__repr__" not in dir(f))
- self.assert_("bar" in dir(f))
+ self.assertNotIn("__repr__", dir(f))
+ self.assertIn("bar", dir(f))
# dir(obj_using __dir__)
class Foo(object):
def __dir__(self):
return ["kan", "ga", "roo"]
f = Foo()
- self.assert_(dir(f) == ["ga", "kan", "roo"])
+ self.assertTrue(dir(f) == ["ga", "kan", "roo"])
# dir(obj__dir__not_list)
class Foo(object):
@@ -307,10 +343,10 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(divmod(-sys.maxint-1, -1),
(sys.maxint+1, 0))
- self.assert_(not fcmp(divmod(3.25, 1.0), (3.0, 0.25)))
- self.assert_(not fcmp(divmod(-3.25, 1.0), (-4.0, 0.75)))
- self.assert_(not fcmp(divmod(3.25, -1.0), (-4.0, -0.75)))
- self.assert_(not fcmp(divmod(-3.25, -1.0), (3.0, -0.25)))
+ self.assertTrue(not fcmp(divmod(3.25, 1.0), (3.0, 0.25)))
+ self.assertTrue(not fcmp(divmod(-3.25, 1.0), (-4.0, 0.75)))
+ self.assertTrue(not fcmp(divmod(3.25, -1.0), (-4.0, -0.75)))
+ self.assertTrue(not fcmp(divmod(-3.25, -1.0), (3.0, -0.25)))
self.assertRaises(TypeError, divmod)
@@ -415,7 +451,7 @@ class BuiltinTest(unittest.TestCase):
f.write('z = z+1\n')
f.write('z = z*2\n')
f.close()
- with _check_py3k_warnings(("execfile.. not supported in 3.x",
+ with check_py3k_warnings(("execfile.. not supported in 3.x",
DeprecationWarning)):
execfile(TESTFN)
@@ -571,11 +607,11 @@ class BuiltinTest(unittest.TestCase):
for func in funcs:
outp = filter(func, cls(inp))
self.assertEqual(outp, exp)
- self.assert_(not isinstance(outp, cls))
+ self.assertTrue(not isinstance(outp, cls))
def test_getattr(self):
import sys
- self.assert_(getattr(sys, 'stdout') is sys.stdout)
+ self.assertTrue(getattr(sys, 'stdout') is sys.stdout)
self.assertRaises(TypeError, getattr, sys, 1)
self.assertRaises(TypeError, getattr, sys, 1, "foo")
self.assertRaises(TypeError, getattr)
@@ -584,7 +620,7 @@ class BuiltinTest(unittest.TestCase):
def test_hasattr(self):
import sys
- self.assert_(hasattr(sys, 'stdout'))
+ self.assertTrue(hasattr(sys, 'stdout'))
self.assertRaises(TypeError, hasattr, sys, 1)
self.assertRaises(TypeError, hasattr)
if have_unicode:
@@ -615,15 +651,15 @@ class BuiltinTest(unittest.TestCase):
class X:
def __hash__(self):
return 2**100
- self.assertEquals(type(hash(X())), int)
+ self.assertEqual(type(hash(X())), int)
class Y(object):
def __hash__(self):
return 2**100
- self.assertEquals(type(hash(Y())), int)
+ self.assertEqual(type(hash(Y())), int)
class Z(long):
def __hash__(self):
return self
- self.assertEquals(hash(Z(42)), hash(42L))
+ self.assertEqual(hash(Z(42)), hash(42L))
def test_hex(self):
self.assertEqual(hex(16), '0x10')
@@ -649,15 +685,15 @@ class BuiltinTest(unittest.TestCase):
# This fails if the test is run twice with a constant string,
# therefore append the run counter
s = "never interned before " + str(numruns)
- self.assert_(intern(s) is s)
+ self.assertTrue(intern(s) is s)
s2 = s.swapcase().swapcase()
- self.assert_(intern(s2) is s)
+ self.assertTrue(intern(s2) is s)
# Subclasses of string can't be interned, because they
# provide too much opportunity for insane things to happen.
# We don't want them in the interned dict and if they aren't
# actually interned, we don't want to create the appearance
- # that they are by allowing intern() to succeeed.
+ # that they are by allowing intern() to succeed.
class S(str):
def __hash__(self):
return 123
@@ -692,11 +728,11 @@ class BuiltinTest(unittest.TestCase):
c = C()
d = D()
e = E()
- self.assert_(isinstance(c, C))
- self.assert_(isinstance(d, C))
- self.assert_(not isinstance(e, C))
- self.assert_(not isinstance(c, D))
- self.assert_(not isinstance('foo', E))
+ self.assertTrue(isinstance(c, C))
+ self.assertTrue(isinstance(d, C))
+ self.assertTrue(not isinstance(e, C))
+ self.assertTrue(not isinstance(c, D))
+ self.assertTrue(not isinstance('foo', E))
self.assertRaises(TypeError, isinstance, E, 'foo')
self.assertRaises(TypeError, isinstance)
@@ -710,9 +746,9 @@ class BuiltinTest(unittest.TestCase):
c = C()
d = D()
e = E()
- self.assert_(issubclass(D, C))
- self.assert_(issubclass(C, C))
- self.assert_(not issubclass(C, D))
+ self.assertTrue(issubclass(D, C))
+ self.assertTrue(issubclass(C, C))
+ self.assertTrue(not issubclass(C, D))
self.assertRaises(TypeError, issubclass, 'foo', E)
self.assertRaises(TypeError, issubclass, E, 'foo')
self.assertRaises(TypeError, issubclass)
@@ -728,6 +764,11 @@ class BuiltinTest(unittest.TestCase):
def __len__(self):
raise ValueError
self.assertRaises(ValueError, len, BadSeq())
+ self.assertRaises(TypeError, len, 2)
+ class ClassicStyle: pass
+ class NewStyle(object): pass
+ self.assertRaises(AttributeError, len, ClassicStyle())
+ self.assertRaises(TypeError, len, NewStyle())
def test_map(self):
self.assertEqual(
@@ -889,7 +930,7 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(next(it), 1)
self.assertRaises(StopIteration, next, it)
self.assertRaises(StopIteration, next, it)
- self.assertEquals(next(it, 42), 42)
+ self.assertEqual(next(it, 42), 42)
class Iter(object):
def __iter__(self):
@@ -898,7 +939,7 @@ class BuiltinTest(unittest.TestCase):
raise StopIteration
it = iter(Iter())
- self.assertEquals(next(it, 42), 42)
+ self.assertEqual(next(it, 42), 42)
self.assertRaises(StopIteration, next, it)
def gen():
@@ -906,9 +947,9 @@ class BuiltinTest(unittest.TestCase):
return
it = gen()
- self.assertEquals(next(it), 1)
+ self.assertEqual(next(it), 1)
self.assertRaises(StopIteration, next, it)
- self.assertEquals(next(it, 42), 42)
+ self.assertEqual(next(it, 42), 42)
def test_oct(self):
self.assertEqual(oct(100), '0144')
@@ -1044,18 +1085,18 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(range(a+4, a, -2), [a+4, a+2])
seq = range(a, b, c)
- self.assert_(a in seq)
- self.assert_(b not in seq)
+ self.assertIn(a, seq)
+ self.assertNotIn(b, seq)
self.assertEqual(len(seq), 2)
seq = range(b, a, -c)
- self.assert_(b in seq)
- self.assert_(a not in seq)
+ self.assertIn(b, seq)
+ self.assertNotIn(a, seq)
self.assertEqual(len(seq), 2)
seq = range(-a, -b, -c)
- self.assert_(-a in seq)
- self.assert_(-b not in seq)
+ self.assertIn(-a, seq)
+ self.assertNotIn(-b, seq)
self.assertEqual(len(seq), 2)
self.assertRaises(TypeError, range)
@@ -1069,14 +1110,9 @@ class BuiltinTest(unittest.TestCase):
__hash__ = None # Invalid cmp makes this unhashable
self.assertRaises(RuntimeError, range, a, a + 1, badzero(1))
- # Reject floats when it would require PyLongs to represent.
- # (smaller floats still accepted, but deprecated)
- with check_warnings() as w:
- warnings.simplefilter("always")
- self.assertRaises(TypeError, range, 1e100, 1e101, 1e101)
- with check_warnings() as w:
- warnings.simplefilter("always")
- self.assertEqual(range(1.0), [0])
+ # Reject floats.
+ self.assertRaises(TypeError, range, 1., 1., 1.)
+ self.assertRaises(TypeError, range, 1e100, 1e101, 1e101)
self.assertRaises(TypeError, range, 0, "spam")
self.assertRaises(TypeError, range, 0, 42, "spam")
@@ -1118,20 +1154,21 @@ class BuiltinTest(unittest.TestCase):
# Exercise various combinations of bad arguments, to check
# refcounting logic
- with check_warnings():
- self.assertRaises(TypeError, range, 1e100)
+ self.assertRaises(TypeError, range, 0.0)
+
+ self.assertRaises(TypeError, range, 0, 0.0)
+ self.assertRaises(TypeError, range, 0.0, 0)
+ self.assertRaises(TypeError, range, 0.0, 0.0)
+
+ self.assertRaises(TypeError, range, 0, 0, 1.0)
+ self.assertRaises(TypeError, range, 0, 0.0, 1)
+ self.assertRaises(TypeError, range, 0, 0.0, 1.0)
+ self.assertRaises(TypeError, range, 0.0, 0, 1)
+ self.assertRaises(TypeError, range, 0.0, 0, 1.0)
+ self.assertRaises(TypeError, range, 0.0, 0.0, 1)
+ self.assertRaises(TypeError, range, 0.0, 0.0, 1.0)
- self.assertRaises(TypeError, range, 0, 1e100)
- self.assertRaises(TypeError, range, 1e100, 0)
- self.assertRaises(TypeError, range, 1e100, 1e100)
- self.assertRaises(TypeError, range, 0, 0, 1e100)
- self.assertRaises(TypeError, range, 0, 1e100, 1)
- self.assertRaises(TypeError, range, 0, 1e100, 1e100)
- self.assertRaises(TypeError, range, 1e100, 0, 1)
- self.assertRaises(TypeError, range, 1e100, 0, 1e100)
- self.assertRaises(TypeError, range, 1e100, 1e100, 1)
- self.assertRaises(TypeError, range, 1e100, 1e100, 1e100)
def test_input_and_raw_input(self):
self.write_testfile()
@@ -1191,9 +1228,10 @@ class BuiltinTest(unittest.TestCase):
unlink(TESTFN)
def test_reduce(self):
- self.assertEqual(reduce(lambda x, y: x+y, ['a', 'b', 'c'], ''), 'abc')
+ add = lambda x, y: x+y
+ self.assertEqual(reduce(add, ['a', 'b', 'c'], ''), 'abc')
self.assertEqual(
- reduce(lambda x, y: x+y, [['a', 'c'], [], ['d', 'w']], []),
+ reduce(add, [['a', 'c'], [], ['d', 'w']], []),
['a','c','d','w']
)
self.assertEqual(reduce(lambda x, y: x*y, range(2,8), 1), 5040)
@@ -1201,15 +1239,23 @@ class BuiltinTest(unittest.TestCase):
reduce(lambda x, y: x*y, range(2,21), 1L),
2432902008176640000L
)
- self.assertEqual(reduce(lambda x, y: x+y, Squares(10)), 285)
- self.assertEqual(reduce(lambda x, y: x+y, Squares(10), 0), 285)
- self.assertEqual(reduce(lambda x, y: x+y, Squares(0), 0), 0)
+ self.assertEqual(reduce(add, Squares(10)), 285)
+ self.assertEqual(reduce(add, Squares(10), 0), 285)
+ self.assertEqual(reduce(add, Squares(0), 0), 0)
self.assertRaises(TypeError, reduce)
+ self.assertRaises(TypeError, reduce, 42)
self.assertRaises(TypeError, reduce, 42, 42)
self.assertRaises(TypeError, reduce, 42, 42, 42)
+ self.assertRaises(TypeError, reduce, None, range(5))
+ self.assertRaises(TypeError, reduce, add, 42)
self.assertEqual(reduce(42, "1"), "1") # func is never called with one item
self.assertEqual(reduce(42, "", "1"), "1") # func is never called with one item
self.assertRaises(TypeError, reduce, 42, (42, 42))
+ self.assertRaises(TypeError, reduce, add, []) # arg 2 must not be empty sequence with no initial value
+ self.assertRaises(TypeError, reduce, add, "")
+ self.assertRaises(TypeError, reduce, add, ())
+ self.assertEqual(reduce(add, [], None), None)
+ self.assertEqual(reduce(add, [], 42), 42)
class BadSeq:
def __getitem__(self, index):
@@ -1312,6 +1358,19 @@ class BuiltinTest(unittest.TestCase):
self.assertRaises(TypeError, round, t)
self.assertRaises(TypeError, round, t, 0)
+ # Some versions of glibc for alpha have a bug that affects
+ # float -> integer rounding (floor, ceil, rint, round) for
+ # values in the range [2**52, 2**53). See:
+ #
+ # http://sources.redhat.com/bugzilla/show_bug.cgi?id=5350
+ #
+ # We skip this test on Linux/alpha if it would fail.
+ linux_alpha = (platform.system().startswith('Linux') and
+ platform.machine().startswith('alpha'))
+ system_round_bug = round(5e15+1) != 5e15+1
+ @unittest.skipIf(linux_alpha and system_round_bug,
+ "test will fail; failure is probably due to a "
+ "buggy system round function")
def test_round_large(self):
# Issue #1869: integral floats should remain unchanged
self.assertEqual(round(5e15-1), 5e15-1)
@@ -1347,6 +1406,10 @@ class BuiltinTest(unittest.TestCase):
raise ValueError
self.assertRaises(ValueError, sum, BadSeq())
+ empty = []
+ sum(([x] for x in range(10)), empty)
+ self.assertEqual(empty, [])
+
def test_type(self):
self.assertEqual(type(''), type('123'))
self.assertNotEqual(type(''), type(()))
@@ -1377,6 +1440,11 @@ class BuiltinTest(unittest.TestCase):
b = 2
return vars()
+ class C_get_vars(object):
+ def getDict(self):
+ return {'a':2}
+ __dict__ = property(fget=getDict)
+
def test_vars(self):
self.assertEqual(set(vars()), set(dir()))
import sys
@@ -1385,6 +1453,7 @@ class BuiltinTest(unittest.TestCase):
self.assertEqual(self.get_vars_f2(), {'a': 1, 'b': 2})
self.assertRaises(TypeError, vars, 42, 42)
self.assertRaises(TypeError, vars, 42)
+ self.assertEqual(vars(self.C_get_vars()), {'a':2})
def test_zip(self):
a = (1, 2, 3)
@@ -1513,13 +1582,48 @@ class BuiltinTest(unittest.TestCase):
# tests for object.__format__ really belong elsewhere, but
# there's no good place to put them
x = object().__format__('')
- self.assert_(x.startswith('<object object at'))
+ self.assertTrue(x.startswith('<object object at'))
# first argument to object.__format__ must be string
self.assertRaises(TypeError, object().__format__, 3)
self.assertRaises(TypeError, object().__format__, object())
self.assertRaises(TypeError, object().__format__, None)
+ # --------------------------------------------------------------------
+ # Issue #7994: object.__format__ with a non-empty format string is
+ # pending deprecated
+ def test_deprecated_format_string(obj, fmt_str, should_raise_warning):
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always", PendingDeprecationWarning)
+ format(obj, fmt_str)
+ if should_raise_warning:
+ self.assertEqual(len(w), 1)
+ self.assertIsInstance(w[0].message, PendingDeprecationWarning)
+ self.assertIn('object.__format__ with a non-empty format '
+ 'string', str(w[0].message))
+ else:
+ self.assertEqual(len(w), 0)
+
+ fmt_strs = ['', 's', u'', u's']
+
+ class A:
+ def __format__(self, fmt_str):
+ return format('', fmt_str)
+
+ for fmt_str in fmt_strs:
+ test_deprecated_format_string(A(), fmt_str, False)
+
+ class B:
+ pass
+
+ class C(object):
+ pass
+
+ for cls in [object, B, C]:
+ for fmt_str in fmt_strs:
+ test_deprecated_format_string(cls(), fmt_str, len(fmt_str) != 0)
+ # --------------------------------------------------------------------
+
# make sure we can take a subclass of str as a format spec
class DerivedFromStr(str): pass
self.assertEqual(format(0, DerivedFromStr('10')), ' 0')
@@ -1578,13 +1682,12 @@ class TestSorted(unittest.TestCase):
self.assertRaises(TypeError, sorted, data, None, lambda x,y: 0)
def _run_unittest(*args):
- with _check_py3k_warnings(
+ with check_py3k_warnings(
(".+ not supported in 3.x", DeprecationWarning),
(".+ is renamed to imp.reload", DeprecationWarning),
("classic int division", DeprecationWarning)):
run_unittest(*args)
-
def test_main(verbose=None):
test_classes = (BuiltinTest, TestSorted)
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index a699d91e38..2ef1c8819f 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -9,14 +9,28 @@ import os
import re
import sys
import copy
+import functools
import pickle
import tempfile
import unittest
-import warnings
import test.test_support
import test.string_tests
import test.buffer_tests
+
+if sys.flags.bytes_warning:
+ def check_bytes_warnings(func):
+ @functools.wraps(func)
+ def wrapper(*args, **kw):
+ with test.test_support.check_warnings(('', BytesWarning)):
+ return func(*args, **kw)
+ return wrapper
+else:
+ # no-op
+ def check_bytes_warnings(func):
+ return func
+
+
class Indexable:
def __init__(self, value=0):
self.value = value
@@ -26,12 +40,6 @@ class Indexable:
class BaseBytesTest(unittest.TestCase):
- def setUp(self):
- self.warning_filters = warnings.filters[:]
-
- def tearDown(self):
- warnings.filters = self.warning_filters
-
def test_basics(self):
b = self.type2test()
self.assertEqual(type(b), self.type2test)
@@ -79,7 +87,7 @@ class BaseBytesTest(unittest.TestCase):
self.assertRaises(TypeError, self.type2test, 0.0)
class C:
pass
- # allowed in 2.6
+ # allowed in 2.x
#self.assertRaises(TypeError, self.type2test, ["0"])
self.assertRaises(TypeError, self.type2test, [0.0])
self.assertRaises(TypeError, self.type2test, [None])
@@ -103,25 +111,25 @@ class BaseBytesTest(unittest.TestCase):
b3 = self.type2test([1, 3])
self.assertEqual(b1, b2)
- self.failUnless(b2 != b3)
- self.failUnless(b1 <= b2)
- self.failUnless(b1 <= b3)
- self.failUnless(b1 < b3)
- self.failUnless(b1 >= b2)
- self.failUnless(b3 >= b2)
- self.failUnless(b3 > b2)
-
- self.failIf(b1 != b2)
- self.failIf(b2 == b3)
- self.failIf(b1 > b2)
- self.failIf(b1 > b3)
- self.failIf(b1 >= b3)
- self.failIf(b1 < b2)
- self.failIf(b3 < b2)
- self.failIf(b3 <= b2)
-
+ self.assertTrue(b2 != b3)
+ self.assertTrue(b1 <= b2)
+ self.assertTrue(b1 <= b3)
+ self.assertTrue(b1 < b3)
+ self.assertTrue(b1 >= b2)
+ self.assertTrue(b3 >= b2)
+ self.assertTrue(b3 > b2)
+
+ self.assertFalse(b1 != b2)
+ self.assertFalse(b2 == b3)
+ self.assertFalse(b1 > b2)
+ self.assertFalse(b1 > b3)
+ self.assertFalse(b1 >= b3)
+ self.assertFalse(b1 < b2)
+ self.assertFalse(b3 < b2)
+ self.assertFalse(b3 <= b2)
+
+ @check_bytes_warnings
def test_compare_to_str(self):
- warnings.simplefilter('ignore', BytesWarning)
# Byte comparisons with unicode should always fail!
# Test this for all expected byte orders and Unicode character sizes
self.assertEqual(self.type2test(b"\0a\0b\0c") == u"abc", False)
@@ -187,6 +195,8 @@ class BaseBytesTest(unittest.TestCase):
b = self.type2test(sample, "latin1")
self.assertRaises(UnicodeDecodeError, b.decode, "utf8")
self.assertEqual(b.decode("utf8", "ignore"), "Hello world\n")
+ self.assertEqual(b.decode(errors="ignore", encoding="utf8"),
+ "Hello world\n")
def test_from_int(self):
b = self.type2test(0)
@@ -221,37 +231,35 @@ class BaseBytesTest(unittest.TestCase):
def test_contains(self):
b = self.type2test(b"abc")
- self.failUnless(ord('a') in b)
- self.failUnless(int(ord('a')) in b)
- self.failIf(200 in b)
- self.failIf(200 in b)
+ self.assertIn(ord('a'), b)
+ self.assertIn(int(ord('a')), b)
+ self.assertNotIn(200, b)
self.assertRaises(ValueError, lambda: 300 in b)
self.assertRaises(ValueError, lambda: -1 in b)
self.assertRaises(TypeError, lambda: None in b)
self.assertRaises(TypeError, lambda: float(ord('a')) in b)
self.assertRaises(TypeError, lambda: u"a" in b)
for f in bytes, bytearray:
- self.failUnless(f(b"") in b)
- self.failUnless(f(b"a") in b)
- self.failUnless(f(b"b") in b)
- self.failUnless(f(b"c") in b)
- self.failUnless(f(b"ab") in b)
- self.failUnless(f(b"bc") in b)
- self.failUnless(f(b"abc") in b)
- self.failIf(f(b"ac") in b)
- self.failIf(f(b"d") in b)
- self.failIf(f(b"dab") in b)
- self.failIf(f(b"abd") in b)
+ self.assertIn(f(b""), b)
+ self.assertIn(f(b"a"), b)
+ self.assertIn(f(b"b"), b)
+ self.assertIn(f(b"c"), b)
+ self.assertIn(f(b"ab"), b)
+ self.assertIn(f(b"bc"), b)
+ self.assertIn(f(b"abc"), b)
+ self.assertNotIn(f(b"ac"), b)
+ self.assertNotIn(f(b"d"), b)
+ self.assertNotIn(f(b"dab"), b)
+ self.assertNotIn(f(b"abd"), b)
def test_fromhex(self):
self.assertRaises(TypeError, self.type2test.fromhex)
self.assertRaises(TypeError, self.type2test.fromhex, 1)
- self.assertEquals(self.type2test.fromhex(u''), self.type2test())
+ self.assertEqual(self.type2test.fromhex(u''), self.type2test())
b = bytearray([0x1a, 0x2b, 0x30])
- self.assertEquals(self.type2test.fromhex(u'1a2B30'), b)
- self.assertEquals(self.type2test.fromhex(u' 1A 2B 30 '), b)
- self.assertEquals(self.type2test.fromhex(u'0000'), b'\0\0')
- self.assertRaises(TypeError, self.type2test.fromhex, b'1B')
+ self.assertEqual(self.type2test.fromhex(u'1a2B30'), b)
+ self.assertEqual(self.type2test.fromhex(u' 1A 2B 30 '), b)
+ self.assertEqual(self.type2test.fromhex(u'0000'), b'\0\0')
self.assertRaises(ValueError, self.type2test.fromhex, u'a')
self.assertRaises(ValueError, self.type2test.fromhex, u'rt')
self.assertRaises(ValueError, self.type2test.fromhex, u'1a b cd')
@@ -269,13 +277,6 @@ class BaseBytesTest(unittest.TestCase):
self.assertEqual(self.type2test(b".").join([b"ab", b"cd"]), b"ab.cd")
# XXX more...
- def test_index(self):
- b = self.type2test(b'parrot')
- self.assertEqual(b.index('p'), 0)
- self.assertEqual(b.index('rr'), 2)
- self.assertEqual(b.index('t'), 5)
- self.assertRaises(ValueError, lambda: b.index('w'))
-
def test_count(self):
b = self.type2test(b'mississippi')
self.assertEqual(b.count(b'i'), 4)
@@ -361,6 +362,10 @@ class BaseBytesTest(unittest.TestCase):
def test_split_string_error(self):
self.assertRaises(TypeError, self.type2test(b'a b').split, u' ')
+ def test_split_unicodewhitespace(self):
+ b = self.type2test(b"\x09\x0A\x0B\x0C\x0D\x1C\x1D\x1E\x1F")
+ self.assertEqual(b.split(), [b'\x1c\x1d\x1e\x1f'])
+
def test_rsplit(self):
b = self.type2test(b'mississippi')
self.assertEqual(b.rsplit(b'i'), [b'm', b'ss', b'ss', b'pp', b''])
@@ -384,18 +389,18 @@ class BaseBytesTest(unittest.TestCase):
def test_rsplit_unicodewhitespace(self):
b = self.type2test(b"\x09\x0A\x0B\x0C\x0D\x1C\x1D\x1E\x1F")
- self.assertEqual(b.split(), [b'\x1c\x1d\x1e\x1f'])
self.assertEqual(b.rsplit(), [b'\x1c\x1d\x1e\x1f'])
def test_partition(self):
b = self.type2test(b'mississippi')
self.assertEqual(b.partition(b'ss'), (b'mi', b'ss', b'issippi'))
- self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi'))
+ self.assertEqual(b.partition(b'w'), (b'mississippi', b'', b''))
def test_rpartition(self):
b = self.type2test(b'mississippi')
self.assertEqual(b.rpartition(b'ss'), (b'missi', b'ss', b'ippi'))
self.assertEqual(b.rpartition(b'i'), (b'mississipp', b'i', b''))
+ self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi'))
def test_pickling(self):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
@@ -436,8 +441,7 @@ class BaseBytesTest(unittest.TestCase):
self.assertEqual(b.lstrip(), b'abc \t\n\r\f\v')
self.assertEqual(b.rstrip(), b' \t\n\r\f\vabc')
- def XXXtest_strip_bytearray(self):
- # XXX memoryview not available
+ def test_strip_bytearray(self):
self.assertEqual(self.type2test(b'abc').strip(memoryview(b'ac')), b'b')
self.assertEqual(self.type2test(b'abc').lstrip(memoryview(b'ac')), b'bc')
self.assertEqual(self.type2test(b'abc').rstrip(memoryview(b'ac')), b'ab')
@@ -452,6 +456,68 @@ class BaseBytesTest(unittest.TestCase):
self.assertEqual([ord(b[i:i+1]) for i in range(len(b))],
[0, 65, 127, 128, 255])
+ def test_none_arguments(self):
+ # issue 11828
+ b = self.type2test(b'hello')
+ l = self.type2test(b'l')
+ h = self.type2test(b'h')
+ x = self.type2test(b'x')
+ o = self.type2test(b'o')
+
+ self.assertEqual(2, b.find(l, None))
+ self.assertEqual(3, b.find(l, -2, None))
+ self.assertEqual(2, b.find(l, None, -2))
+ self.assertEqual(0, b.find(h, None, None))
+
+ self.assertEqual(3, b.rfind(l, None))
+ self.assertEqual(3, b.rfind(l, -2, None))
+ self.assertEqual(2, b.rfind(l, None, -2))
+ self.assertEqual(0, b.rfind(h, None, None))
+
+ self.assertEqual(2, b.index(l, None))
+ self.assertEqual(3, b.index(l, -2, None))
+ self.assertEqual(2, b.index(l, None, -2))
+ self.assertEqual(0, b.index(h, None, None))
+
+ self.assertEqual(3, b.rindex(l, None))
+ self.assertEqual(3, b.rindex(l, -2, None))
+ self.assertEqual(2, b.rindex(l, None, -2))
+ self.assertEqual(0, b.rindex(h, None, None))
+
+ self.assertEqual(2, b.count(l, None))
+ self.assertEqual(1, b.count(l, -2, None))
+ self.assertEqual(1, b.count(l, None, -2))
+ self.assertEqual(0, b.count(x, None, None))
+
+ self.assertEqual(True, b.endswith(o, None))
+ self.assertEqual(True, b.endswith(o, -2, None))
+ self.assertEqual(True, b.endswith(l, None, -2))
+ self.assertEqual(False, b.endswith(x, None, None))
+
+ self.assertEqual(True, b.startswith(h, None))
+ self.assertEqual(True, b.startswith(l, -2, None))
+ self.assertEqual(True, b.startswith(h, None, -2))
+ self.assertEqual(False, b.startswith(x, None, None))
+
+ def test_find_etc_raise_correct_error_messages(self):
+ # issue 11828
+ b = self.type2test(b'hello')
+ x = self.type2test(b'x')
+ self.assertRaisesRegexp(TypeError, r'\bfind\b', b.find,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'\brfind\b', b.rfind,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'\bindex\b', b.index,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'\brindex\b', b.rindex,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'\bcount\b', b.count,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'\bstartswith\b', b.startswith,
+ x, None, None, None)
+ self.assertRaisesRegexp(TypeError, r'\bendswith\b', b.endswith,
+ x, None, None, None)
+
class ByteArrayTest(BaseBytesTest):
type2test = bytearray
@@ -583,11 +649,11 @@ class ByteArrayTest(BaseBytesTest):
data.reverse()
L[start:stop:step] = data
b[start:stop:step] = data
- self.assertEquals(b, bytearray(L))
+ self.assertEqual(b, bytearray(L))
del L[start:stop:step]
del b[start:stop:step]
- self.assertEquals(b, bytearray(L))
+ self.assertEqual(b, bytearray(L))
def test_setslice_trap(self):
# This test verifies that we correctly handle assigning self
@@ -602,7 +668,7 @@ class ByteArrayTest(BaseBytesTest):
b += b"def"
self.assertEqual(b, b"abcdef")
self.assertEqual(b, b1)
- self.failUnless(b is b1)
+ self.assertTrue(b is b1)
b += b"xyz"
self.assertEqual(b, b"abcdefxyz")
try:
@@ -618,7 +684,7 @@ class ByteArrayTest(BaseBytesTest):
b *= 3
self.assertEqual(b, b"abcabcabc")
self.assertEqual(b, b1)
- self.failUnless(b is b1)
+ self.assertTrue(b is b1)
def test_irepeat_1char(self):
b = bytearray(b"x")
@@ -626,17 +692,17 @@ class ByteArrayTest(BaseBytesTest):
b *= 100
self.assertEqual(b, b"x"*100)
self.assertEqual(b, b1)
- self.failUnless(b is b1)
+ self.assertTrue(b is b1)
def test_alloc(self):
b = bytearray()
alloc = b.__alloc__()
- self.assert_(alloc >= 0)
+ self.assertTrue(alloc >= 0)
seq = [alloc]
for i in range(100):
b += b"x"
alloc = b.__alloc__()
- self.assert_(alloc >= len(b))
+ self.assertTrue(alloc >= len(b))
if alloc not in seq:
seq.append(alloc)
@@ -691,7 +757,7 @@ class ByteArrayTest(BaseBytesTest):
self.assertEqual(b.pop(0), ord('w'))
self.assertEqual(b.pop(-2), ord('r'))
self.assertRaises(IndexError, lambda: b.pop(10))
- self.assertRaises(OverflowError, lambda: bytearray().pop())
+ self.assertRaises(IndexError, lambda: bytearray().pop())
# test for issue #6846
self.assertEqual(bytearray(b'\xff').pop(), 0xff)
@@ -718,7 +784,7 @@ class ByteArrayTest(BaseBytesTest):
b.insert(-2, ord('i'))
b.insert(1000, ord('i'))
self.assertEqual(b, b'mississippi')
- # allowed in 2.6
+ # allowed in 2.x
#self.assertRaises(TypeError, lambda: b.insert(0, b'1'))
b = bytearray()
b.insert(0, Indexable(ord('A')))
@@ -738,7 +804,7 @@ class ByteArrayTest(BaseBytesTest):
a, b, c = bytearray(b"x").partition(b"y")
self.assertEqual(b, b"")
self.assertEqual(c, b"")
- self.assert_(b is not c)
+ self.assertTrue(b is not c)
b += b"!"
self.assertEqual(c, b"")
a, b, c = bytearray(b"x").partition(b"y")
@@ -748,15 +814,14 @@ class ByteArrayTest(BaseBytesTest):
b, c, a = bytearray(b"x").rpartition(b"y")
self.assertEqual(b, b"")
self.assertEqual(c, b"")
- self.assert_(b is not c)
+ self.assertTrue(b is not c)
b += b"!"
self.assertEqual(c, b"")
c, b, a = bytearray(b"x").rpartition(b"y")
self.assertEqual(b, b"")
self.assertEqual(c, b"")
- # XXX memoryview not available
- def XXXtest_resize_forbidden(self):
+ def test_resize_forbidden(self):
# #4509: can't resize a bytearray when there are buffer exports, even
# if it wouldn't reallocate the underlying buffer.
# Furthermore, no destructive changes to the buffer may be applied
@@ -768,25 +833,25 @@ class ByteArrayTest(BaseBytesTest):
resize(10)
orig = b[:]
self.assertRaises(BufferError, resize, 11)
- self.assertEquals(b, orig)
+ self.assertEqual(b, orig)
self.assertRaises(BufferError, resize, 9)
- self.assertEquals(b, orig)
+ self.assertEqual(b, orig)
self.assertRaises(BufferError, resize, 0)
- self.assertEquals(b, orig)
+ self.assertEqual(b, orig)
# Other operations implying resize
self.assertRaises(BufferError, b.pop, 0)
- self.assertEquals(b, orig)
+ self.assertEqual(b, orig)
self.assertRaises(BufferError, b.remove, b[1])
- self.assertEquals(b, orig)
+ self.assertEqual(b, orig)
def delitem():
del b[1]
self.assertRaises(BufferError, delitem)
- self.assertEquals(b, orig)
+ self.assertEqual(b, orig)
# deleting a non-contiguous slice
def delslice():
b[1:-1:2] = b""
self.assertRaises(BufferError, delslice)
- self.assertEquals(b, orig)
+ self.assertEqual(b, orig)
def test_empty_bytearray(self):
# Issue #7561: operations on empty bytearrays could crash in many
@@ -800,14 +865,8 @@ class AssortedBytesTest(unittest.TestCase):
# Test various combinations of bytes and bytearray
#
- def setUp(self):
- self.warning_filters = warnings.filters[:]
-
- def tearDown(self):
- warnings.filters = self.warning_filters
-
+ @check_bytes_warnings
def test_repr_str(self):
- warnings.simplefilter('ignore', BytesWarning)
for f in str, repr:
self.assertEqual(f(bytearray()), "bytearray(b'')")
self.assertEqual(f(bytearray([0])), "bytearray(b'\\x00')")
@@ -847,10 +906,10 @@ class AssortedBytesTest(unittest.TestCase):
self.assertEqual(bytes(b"abc") <= b"ab", False)
def test_doc(self):
- self.failUnless(bytearray.__doc__ != None)
- self.failUnless(bytearray.__doc__.startswith("bytearray("), bytearray.__doc__)
- self.failUnless(bytes.__doc__ != None)
- self.failUnless(bytes.__doc__.startswith("bytes("), bytes.__doc__)
+ self.assertIsNotNone(bytearray.__doc__)
+ self.assertTrue(bytearray.__doc__.startswith("bytearray("), bytearray.__doc__)
+ self.assertIsNotNone(bytes.__doc__)
+ self.assertTrue(bytes.__doc__.startswith("bytes("), bytes.__doc__)
def test_from_bytearray(self):
sample = bytes(b"Hello world\n\x80\x81\xfe\xff")
@@ -858,8 +917,8 @@ class AssortedBytesTest(unittest.TestCase):
b = bytearray(buf)
self.assertEqual(b, bytearray(sample))
+ @check_bytes_warnings
def test_to_str(self):
- warnings.simplefilter('ignore', BytesWarning)
self.assertEqual(str(b''), "b''")
self.assertEqual(str(b'x'), "b'x'")
self.assertEqual(str(b'\x80'), "b'\\x80'")
@@ -893,8 +952,10 @@ class AssortedBytesTest(unittest.TestCase):
self.assertEqual(c, b'hee')
c = b.translate(None, b'e')
self.assertEqual(c, b'hllo')
- self.assertRaises(TypeError, b.translate, b'a'*256, None)
- self.assertRaises(TypeError, ba.translate, b'a'*256, None)
+ c = ba.translate(None, b'e')
+ self.assertEqual(c, b'hllo')
+ self.assertRaises(TypeError, b.translate, None, None)
+ self.assertRaises(TypeError, ba.translate, None, None)
def test_split_bytearray(self):
self.assertEqual(b'a b'.split(memoryview(b' ')), [b'a', b'b'])
@@ -932,7 +993,13 @@ class BytearrayPEP3137Test(unittest.TestCase,
self.assertEqual(val, newval)
self.assertTrue(val is not newval,
methname+' returned self on a mutable object')
-
+ for expr in ('val.split()[0]', 'val.rsplit()[0]',
+ 'val.partition(".")[0]', 'val.rpartition(".")[2]',
+ 'val.splitlines()[0]', 'val.replace("", "")'):
+ newval = eval(expr)
+ self.assertEqual(val, newval)
+ self.assertTrue(val is not newval,
+ expr+' returned val on a mutable object')
class FixedStringTest(test.string_tests.BaseTest):
@@ -967,20 +1034,20 @@ class ByteArraySubclass(bytearray):
class ByteArraySubclassTest(unittest.TestCase):
def test_basic(self):
- self.assert_(issubclass(ByteArraySubclass, bytearray))
- self.assert_(isinstance(ByteArraySubclass(), bytearray))
+ self.assertTrue(issubclass(ByteArraySubclass, bytearray))
+ self.assertIsInstance(ByteArraySubclass(), bytearray)
a, b = b"abcd", b"efgh"
_a, _b = ByteArraySubclass(a), ByteArraySubclass(b)
# test comparison operators with subclass instances
- self.assert_(_a == _a)
- self.assert_(_a != _b)
- self.assert_(_a < _b)
- self.assert_(_a <= _b)
- self.assert_(_b >= _a)
- self.assert_(_b > _a)
- self.assert_(_a is not a)
+ self.assertTrue(_a == _a)
+ self.assertTrue(_a != _b)
+ self.assertTrue(_a < _b)
+ self.assertTrue(_a <= _b)
+ self.assertTrue(_b >= _a)
+ self.assertTrue(_b > _a)
+ self.assertTrue(_a is not a)
# test concat of subclass instances
self.assertEqual(a + b, _a + _b)
@@ -988,7 +1055,7 @@ class ByteArraySubclassTest(unittest.TestCase):
self.assertEqual(a + b, _a + b)
# test repeat
- self.assert_(a*5 == _a*5)
+ self.assertTrue(a*5 == _a*5)
def test_join(self):
# Make sure join returns a NEW object for single item sequences
@@ -996,12 +1063,12 @@ class ByteArraySubclassTest(unittest.TestCase):
# Make sure that it is of the appropriate type.
s1 = ByteArraySubclass(b"abcd")
s2 = bytearray().join([s1])
- self.assert_(s1 is not s2)
- self.assert_(type(s2) is bytearray, type(s2))
+ self.assertTrue(s1 is not s2)
+ self.assertTrue(type(s2) is bytearray, type(s2))
# Test reverse, calling join on subclass
s3 = s1.join([b"abcd"])
- self.assert_(type(s3) is bytearray)
+ self.assertTrue(type(s3) is bytearray)
def test_pickle(self):
a = ByteArraySubclass(b"abcd")
diff --git a/Lib/test/test_bz2.py b/Lib/test/test_bz2.py
index ee7e886b1d..d9ccf0abbe 100644
--- a/Lib/test/test_bz2.py
+++ b/Lib/test/test_bz2.py
@@ -1,15 +1,19 @@
-#!/usr/bin/python
+#!/usr/bin/env python
from test import test_support
-from test.test_support import TESTFN
+from test.test_support import TESTFN, import_module
import unittest
from cStringIO import StringIO
import os
import subprocess
import sys
-import threading
-import bz2
+try:
+ import threading
+except ImportError:
+ threading = None
+
+bz2 = import_module('bz2')
from bz2 import BZ2File, BZ2Compressor, BZ2Decompressor
has_cmdline_bunzip2 = sys.platform not in ("win32", "os2emx", "riscos")
@@ -50,68 +54,68 @@ class BZ2FileTest(BaseTest):
os.unlink(self.filename)
def createTempFile(self, crlf=0):
- f = open(self.filename, "wb")
- if crlf:
- data = self.DATA_CRLF
- else:
- data = self.DATA
- f.write(data)
- f.close()
+ with open(self.filename, "wb") as f:
+ if crlf:
+ data = self.DATA_CRLF
+ else:
+ data = self.DATA
+ f.write(data)
def testRead(self):
# "Test BZ2File.read()"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertRaises(TypeError, bz2f.read, None)
- self.assertEqual(bz2f.read(), self.TEXT)
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.read, None)
+ self.assertEqual(bz2f.read(), self.TEXT)
+
+ def testRead0(self):
+ # Test BBZ2File.read(0)"
+ self.createTempFile()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.read, None)
+ self.assertEqual(bz2f.read(0), "")
def testReadChunk10(self):
# "Test BZ2File.read() in chunks of 10 bytes"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- text = ''
- while 1:
- str = bz2f.read(10)
- if not str:
- break
- text += str
- self.assertEqual(text, text)
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ text = ''
+ while 1:
+ str = bz2f.read(10)
+ if not str:
+ break
+ text += str
+ self.assertEqual(text, self.TEXT)
def testRead100(self):
# "Test BZ2File.read(100)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertEqual(bz2f.read(100), self.TEXT[:100])
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertEqual(bz2f.read(100), self.TEXT[:100])
def testReadLine(self):
# "Test BZ2File.readline()"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertRaises(TypeError, bz2f.readline, None)
- sio = StringIO(self.TEXT)
- for line in sio.readlines():
- self.assertEqual(bz2f.readline(), line)
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.readline, None)
+ sio = StringIO(self.TEXT)
+ for line in sio.readlines():
+ self.assertEqual(bz2f.readline(), line)
def testReadLines(self):
# "Test BZ2File.readlines()"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertRaises(TypeError, bz2f.readlines, None)
- sio = StringIO(self.TEXT)
- self.assertEqual(bz2f.readlines(), sio.readlines())
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.readlines, None)
+ sio = StringIO(self.TEXT)
+ self.assertEqual(bz2f.readlines(), sio.readlines())
def testIterator(self):
# "Test iter(BZ2File)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- sio = StringIO(self.TEXT)
- self.assertEqual(list(iter(bz2f)), sio.readlines())
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ sio = StringIO(self.TEXT)
+ self.assertEqual(list(iter(bz2f)), sio.readlines())
def testClosedIteratorDeadlock(self):
# "Test that iteration on a closed bz2file releases the lock."
@@ -150,104 +154,91 @@ class BZ2FileTest(BaseTest):
def testWrite(self):
# "Test BZ2File.write()"
- bz2f = BZ2File(self.filename, "w")
- self.assertRaises(TypeError, bz2f.write)
- bz2f.write(self.TEXT)
- bz2f.close()
- f = open(self.filename, 'rb')
- self.assertEqual(self.decompress(f.read()), self.TEXT)
- f.close()
+ with BZ2File(self.filename, "w") as bz2f:
+ self.assertRaises(TypeError, bz2f.write)
+ bz2f.write(self.TEXT)
+ with open(self.filename, 'rb') as f:
+ self.assertEqual(self.decompress(f.read()), self.TEXT)
def testWriteChunks10(self):
# "Test BZ2File.write() with chunks of 10 bytes"
- bz2f = BZ2File(self.filename, "w")
- n = 0
- while 1:
- str = self.TEXT[n*10:(n+1)*10]
- if not str:
- break
- bz2f.write(str)
- n += 1
- bz2f.close()
- f = open(self.filename, 'rb')
- self.assertEqual(self.decompress(f.read()), self.TEXT)
- f.close()
+ with BZ2File(self.filename, "w") as bz2f:
+ n = 0
+ while 1:
+ str = self.TEXT[n*10:(n+1)*10]
+ if not str:
+ break
+ bz2f.write(str)
+ n += 1
+ with open(self.filename, 'rb') as f:
+ self.assertEqual(self.decompress(f.read()), self.TEXT)
def testWriteLines(self):
# "Test BZ2File.writelines()"
- bz2f = BZ2File(self.filename, "w")
- self.assertRaises(TypeError, bz2f.writelines)
- sio = StringIO(self.TEXT)
- bz2f.writelines(sio.readlines())
- bz2f.close()
+ with BZ2File(self.filename, "w") as bz2f:
+ self.assertRaises(TypeError, bz2f.writelines)
+ sio = StringIO(self.TEXT)
+ bz2f.writelines(sio.readlines())
# patch #1535500
self.assertRaises(ValueError, bz2f.writelines, ["a"])
- f = open(self.filename, 'rb')
- self.assertEqual(self.decompress(f.read()), self.TEXT)
- f.close()
+ with open(self.filename, 'rb') as f:
+ self.assertEqual(self.decompress(f.read()), self.TEXT)
def testWriteMethodsOnReadOnlyFile(self):
- bz2f = BZ2File(self.filename, "w")
- bz2f.write("abc")
- bz2f.close()
+ with BZ2File(self.filename, "w") as bz2f:
+ bz2f.write("abc")
- bz2f = BZ2File(self.filename, "r")
- self.assertRaises(IOError, bz2f.write, "a")
- self.assertRaises(IOError, bz2f.writelines, ["a"])
+ with BZ2File(self.filename, "r") as bz2f:
+ self.assertRaises(IOError, bz2f.write, "a")
+ self.assertRaises(IOError, bz2f.writelines, ["a"])
def testSeekForward(self):
# "Test BZ2File.seek(150, 0)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- self.assertRaises(TypeError, bz2f.seek)
- bz2f.seek(150)
- self.assertEqual(bz2f.read(), self.TEXT[150:])
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ self.assertRaises(TypeError, bz2f.seek)
+ bz2f.seek(150)
+ self.assertEqual(bz2f.read(), self.TEXT[150:])
def testSeekBackwards(self):
# "Test BZ2File.seek(-150, 1)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.read(500)
- bz2f.seek(-150, 1)
- self.assertEqual(bz2f.read(), self.TEXT[500-150:])
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.read(500)
+ bz2f.seek(-150, 1)
+ self.assertEqual(bz2f.read(), self.TEXT[500-150:])
def testSeekBackwardsFromEnd(self):
# "Test BZ2File.seek(-150, 2)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.seek(-150, 2)
- self.assertEqual(bz2f.read(), self.TEXT[len(self.TEXT)-150:])
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.seek(-150, 2)
+ self.assertEqual(bz2f.read(), self.TEXT[len(self.TEXT)-150:])
def testSeekPostEnd(self):
# "Test BZ2File.seek(150000)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.seek(150000)
- self.assertEqual(bz2f.tell(), len(self.TEXT))
- self.assertEqual(bz2f.read(), "")
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.seek(150000)
+ self.assertEqual(bz2f.tell(), len(self.TEXT))
+ self.assertEqual(bz2f.read(), "")
def testSeekPostEndTwice(self):
# "Test BZ2File.seek(150000) twice"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.seek(150000)
- bz2f.seek(150000)
- self.assertEqual(bz2f.tell(), len(self.TEXT))
- self.assertEqual(bz2f.read(), "")
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.seek(150000)
+ bz2f.seek(150000)
+ self.assertEqual(bz2f.tell(), len(self.TEXT))
+ self.assertEqual(bz2f.read(), "")
def testSeekPreStart(self):
# "Test BZ2File.seek(-150, 0)"
self.createTempFile()
- bz2f = BZ2File(self.filename)
- bz2f.seek(-150)
- self.assertEqual(bz2f.tell(), 0)
- self.assertEqual(bz2f.read(), self.TEXT)
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ bz2f.seek(-150)
+ self.assertEqual(bz2f.tell(), 0)
+ self.assertEqual(bz2f.read(), self.TEXT)
def testOpenDel(self):
# "Test opening and deleting a file many times"
@@ -273,24 +264,43 @@ class BZ2FileTest(BaseTest):
def testBug1191043(self):
# readlines() for files containing no newline
data = 'BZh91AY&SY\xd9b\x89]\x00\x00\x00\x03\x80\x04\x00\x02\x00\x0c\x00 \x00!\x9ah3M\x13<]\xc9\x14\xe1BCe\x8a%t'
- f = open(self.filename, "wb")
- f.write(data)
- f.close()
- bz2f = BZ2File(self.filename)
- lines = bz2f.readlines()
- bz2f.close()
+ with open(self.filename, "wb") as f:
+ f.write(data)
+ with BZ2File(self.filename) as bz2f:
+ lines = bz2f.readlines()
self.assertEqual(lines, ['Test'])
- bz2f = BZ2File(self.filename)
- xlines = list(bz2f.xreadlines())
- bz2f.close()
+ with BZ2File(self.filename) as bz2f:
+ xlines = list(bz2f.readlines())
self.assertEqual(xlines, ['Test'])
+ def testContextProtocol(self):
+ # BZ2File supports the context management protocol
+ f = None
+ with BZ2File(self.filename, "wb") as f:
+ f.write(b"xxx")
+ f = BZ2File(self.filename, "rb")
+ f.close()
+ try:
+ with f:
+ pass
+ except ValueError:
+ pass
+ else:
+ self.fail("__enter__ on a closed file didn't raise an exception")
+ try:
+ with BZ2File(self.filename, "wb") as f:
+ 1 // 0
+ except ZeroDivisionError:
+ pass
+ else:
+ self.fail("1 // 0 didn't raise an exception")
+
+ @unittest.skipUnless(threading, 'Threading required for this test.')
def testThreading(self):
# Using a BZ2File from several threads doesn't deadlock (issue #7205).
data = "1" * 2**20
nthreads = 10
- f = bz2.BZ2File(self.filename, 'wb')
- try:
+ with bz2.BZ2File(self.filename, 'wb') as f:
def comp():
for i in range(5):
f.write(data)
@@ -299,27 +309,19 @@ class BZ2FileTest(BaseTest):
t.start()
for t in threads:
t.join()
- finally:
- f.close()
def testMixedIterationReads(self):
# Issue #8397: mixed iteration and reads should be forbidden.
- f = bz2.BZ2File(self.filename, 'wb')
- try:
+ with bz2.BZ2File(self.filename, 'wb') as f:
# The internal buffer size is hard-wired to 8192 bytes, we must
# write out more than that for the test to stop half through
# the buffer.
f.write(self.TEXT * 100)
- finally:
- f.close()
- f = bz2.BZ2File(self.filename, 'rb')
- try:
+ with bz2.BZ2File(self.filename, 'rb') as f:
next(f)
self.assertRaises(ValueError, f.read)
self.assertRaises(ValueError, f.readline)
self.assertRaises(ValueError, f.readlines)
- finally:
- f.close()
class BZ2CompressorTest(BaseTest):
def testCompress(self):
diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index fad517c3f5..2a56268810 100644
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -2,6 +2,7 @@ import calendar
import unittest
from test import test_support
+import locale
result_2004_text = """
@@ -248,6 +249,19 @@ class CalendarTestCase(unittest.TestCase):
# verify it "acts like a sequence" in two forms of iteration
self.assertEqual(value[::-1], list(reversed(value)))
+ def test_localecalendars(self):
+ # ensure that Locale{Text,HTML}Calendar resets the locale properly
+ # (it is still not thread-safe though)
+ old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
+ try:
+ calendar.LocaleTextCalendar(locale='').formatmonthname(2010, 10, 10)
+ except locale.Error:
+ # cannot set the system default locale -- skip rest of test
+ return
+ calendar.LocaleHTMLCalendar(locale='').formatmonthname(2010, 10)
+ new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10)
+ self.assertEquals(old_october, new_october)
+
class MonthCalendarTestCase(unittest.TestCase):
def setUp(self):
@@ -380,12 +394,62 @@ class SundayTestCase(MonthCalendarTestCase):
self.check_weeks(1995, 12, (2, 7, 7, 7, 7, 1))
+class MonthRangeTestCase(unittest.TestCase):
+ def test_january(self):
+ # Tests valid lower boundary case.
+ self.assertEqual(calendar.monthrange(2004,1), (3,31))
+
+ def test_february_leap(self):
+ # Tests February during leap year.
+ self.assertEqual(calendar.monthrange(2004,2), (6,29))
+
+ def test_february_nonleap(self):
+ # Tests February in non-leap year.
+ self.assertEqual(calendar.monthrange(2010,2), (0,28))
+
+ def test_december(self):
+ # Tests valid upper boundary case.
+ self.assertEqual(calendar.monthrange(2004,12), (2,31))
+
+ def test_zeroth_month(self):
+ # Tests low invalid boundary case.
+ with self.assertRaises(calendar.IllegalMonthError):
+ calendar.monthrange(2004, 0)
+
+ def test_thirteenth_month(self):
+ # Tests high invalid boundary case.
+ with self.assertRaises(calendar.IllegalMonthError):
+ calendar.monthrange(2004, 13)
+
+class LeapdaysTestCase(unittest.TestCase):
+ def test_no_range(self):
+ # test when no range i.e. two identical years as args
+ self.assertEqual(calendar.leapdays(2010,2010), 0)
+
+ def test_no_leapdays(self):
+ # test when no leap years in range
+ self.assertEqual(calendar.leapdays(2010,2011), 0)
+
+ def test_no_leapdays_upper_boundary(self):
+ # test no leap years in range, when upper boundary is a leap year
+ self.assertEqual(calendar.leapdays(2010,2012), 0)
+
+ def test_one_leapday_lower_boundary(self):
+ # test when one leap year in range, lower boundary is leap year
+ self.assertEqual(calendar.leapdays(2012,2013), 1)
+
+ def test_several_leapyears_in_range(self):
+ self.assertEqual(calendar.leapdays(1997,2020), 5)
+
+
def test_main():
test_support.run_unittest(
OutputTestCase,
CalendarTestCase,
MondayTestCase,
- SundayTestCase
+ SundayTestCase,
+ MonthRangeTestCase,
+ LeapdaysTestCase,
)
diff --git a/Lib/test/test_call.py b/Lib/test/test_call.py
index fd3ec3cad7..d06c2c94c5 100644
--- a/Lib/test/test_call.py
+++ b/Lib/test/test_call.py
@@ -12,7 +12,7 @@ class CFunctionCalls(unittest.TestCase):
self.assertRaises(TypeError, {}.has_key)
def test_varargs1(self):
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
{}.has_key(0)
def test_varargs2(self):
@@ -25,12 +25,12 @@ class CFunctionCalls(unittest.TestCase):
pass
def test_varargs1_ext(self):
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
{}.has_key(*(0,))
def test_varargs2_ext(self):
try:
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
{}.has_key(*(1, 2))
except TypeError:
pass
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index eea41c1f7c..7dec2de655 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -1,10 +1,101 @@
# Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
+from __future__ import with_statement
import sys
+import time
+import random
+import unittest
from test import test_support
+try:
+ import threading
+except ImportError:
+ threading = None
import _testcapi
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class TestPendingCalls(unittest.TestCase):
+
+ def pendingcalls_submit(self, l, n):
+ def callback():
+ #this function can be interrupted by thread switching so let's
+ #use an atomic operation
+ l.append(None)
+
+ for i in range(n):
+ time.sleep(random.random()*0.02) #0.01 secs on average
+ #try submitting callback until successful.
+ #rely on regular interrupt to flush queue if we are
+ #unsuccessful.
+ while True:
+ if _testcapi._pending_threadfunc(callback):
+ break;
+
+ def pendingcalls_wait(self, l, n, context = None):
+ #now, stick around until l[0] has grown to 10
+ count = 0;
+ while len(l) != n:
+ #this busy loop is where we expect to be interrupted to
+ #run our callbacks. Note that callbacks are only run on the
+ #main thread
+ if False and test_support.verbose:
+ print "(%i)"%(len(l),),
+ for i in xrange(1000):
+ a = i*i
+ if context and not context.event.is_set():
+ continue
+ count += 1
+ self.assertTrue(count < 10000,
+ "timeout waiting for %i callbacks, got %i"%(n, len(l)))
+ if False and test_support.verbose:
+ print "(%i)"%(len(l),)
+
+ def test_pendingcalls_threaded(self):
+ #do every callback on a separate thread
+ n = 32 #total callbacks
+ threads = []
+ class foo(object):pass
+ context = foo()
+ context.l = []
+ context.n = 2 #submits per thread
+ context.nThreads = n // context.n
+ context.nFinished = 0
+ context.lock = threading.Lock()
+ context.event = threading.Event()
+
+ for i in range(context.nThreads):
+ t = threading.Thread(target=self.pendingcalls_thread, args = (context,))
+ t.start()
+ threads.append(t)
+
+ self.pendingcalls_wait(context.l, n, context)
+
+ for t in threads:
+ t.join()
+
+ def pendingcalls_thread(self, context):
+ try:
+ self.pendingcalls_submit(context.l, context.n)
+ finally:
+ with context.lock:
+ context.nFinished += 1
+ nFinished = context.nFinished
+ if False and test_support.verbose:
+ print "finished threads: ", nFinished
+ if nFinished == context.nThreads:
+ context.event.set()
+
+ def test_pendingcalls_non_threaded(self):
+ #again, just using the main thread, likely they will all be dispatched at
+ #once. It is ok to ask for too many, because we loop until we find a slot.
+ #the loop can be interrupted to dispatch.
+ #there are only 32 dispatch slots, so we go for twice that!
+ l = []
+ n = 64
+ self.pendingcalls_submit(l, n)
+ self.pendingcalls_wait(l, n)
+
+
def test_main():
for name in dir(_testcapi):
@@ -35,20 +126,15 @@ def test_main():
raise test_support.TestFailed, \
"Couldn't find main thread correctly in the list"
- try:
- _testcapi._test_thread_state
- have_thread_state = True
- except AttributeError:
- have_thread_state = False
-
- if have_thread_state:
+ if threading:
import thread
import time
TestThreadState()
- import threading
t=threading.Thread(target=TestThreadState)
t.start()
t.join()
+ test_support.run_unittest(TestPendingCalls)
+
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_cd.py b/Lib/test/test_cd.py
index daad223828..edaa82bf45 100755
--- a/Lib/test/test_cd.py
+++ b/Lib/test/test_cd.py
@@ -2,8 +2,9 @@
"""Whimpy test script for the cd module
Roger E. Masse
"""
-import cd
-from test.test_support import verbose
+from test.test_support import verbose, import_module
+
+cd = import_module('cd')
cdattrs = ['BLOCKSIZE', 'CDROM', 'DATASIZE', 'ERROR', 'NODISC', 'PAUSED', 'PLAYING', 'READY',
'STILL', '__doc__', '__name__', 'atime', 'audio', 'catalog', 'control', 'createparser', 'error',
diff --git a/Lib/test/test_cfgparser.py b/Lib/test/test_cfgparser.py
index 78657de85d..d44a415f12 100644
--- a/Lib/test/test_cfgparser.py
+++ b/Lib/test/test_cfgparser.py
@@ -1,10 +1,12 @@
import ConfigParser
import StringIO
+import os
import unittest
import UserDict
from test import test_support
+
class SortedDict(UserDict.UserDict):
def items(self):
result = self.data.items()
@@ -26,12 +28,16 @@ class SortedDict(UserDict.UserDict):
__iter__ = iterkeys
def itervalues(self): return iter(self.values())
+
class TestCaseBase(unittest.TestCase):
+ allow_no_value = False
+
def newconfig(self, defaults=None):
if defaults is None:
- self.cf = self.config_class()
+ self.cf = self.config_class(allow_no_value=self.allow_no_value)
else:
- self.cf = self.config_class(defaults)
+ self.cf = self.config_class(defaults,
+ allow_no_value=self.allow_no_value)
return self.cf
def fromstring(self, string, defaults=None):
@@ -41,7 +47,7 @@ class TestCaseBase(unittest.TestCase):
return cf
def test_basic(self):
- cf = self.fromstring(
+ config_string = (
"[Foo Bar]\n"
"foo=bar\n"
"[Spacey Bar]\n"
@@ -61,17 +67,28 @@ class TestCaseBase(unittest.TestCase):
"key with spaces : value\n"
"another with spaces = splat!\n"
)
+ if self.allow_no_value:
+ config_string += (
+ "[NoValue]\n"
+ "option-without-value\n"
+ )
+
+ cf = self.fromstring(config_string)
L = cf.sections()
L.sort()
+ E = [r'Commented Bar',
+ r'Foo Bar',
+ r'Internationalized Stuff',
+ r'Long Line',
+ r'Section\with$weird%characters[' '\t',
+ r'Spaces',
+ r'Spacey Bar',
+ ]
+ if self.allow_no_value:
+ E.append(r'NoValue')
+ E.sort()
eq = self.assertEqual
- eq(L, [r'Commented Bar',
- r'Foo Bar',
- r'Internationalized Stuff',
- r'Long Line',
- r'Section\with$weird%characters[' '\t',
- r'Spaces',
- r'Spacey Bar',
- ])
+ eq(L, E)
# The use of spaces in the section names serves as a
# regression test for SourceForge bug #583248:
@@ -81,17 +98,19 @@ class TestCaseBase(unittest.TestCase):
eq(cf.get('Commented Bar', 'foo'), 'bar')
eq(cf.get('Spaces', 'key with spaces'), 'value')
eq(cf.get('Spaces', 'another with spaces'), 'splat!')
+ if self.allow_no_value:
+ eq(cf.get('NoValue', 'option-without-value'), None)
- self.failIf('__name__' in cf.options("Foo Bar"),
- '__name__ "option" should not be exposed by the API!')
+ self.assertNotIn('__name__', cf.options("Foo Bar"),
+ '__name__ "option" should not be exposed by the API!')
# Make sure the right things happen for remove_option();
# added to include check for SourceForge bug #123324:
- self.failUnless(cf.remove_option('Foo Bar', 'foo'),
+ self.assertTrue(cf.remove_option('Foo Bar', 'foo'),
"remove_option() failed to report existence of option")
- self.failIf(cf.has_option('Foo Bar', 'foo'),
+ self.assertFalse(cf.has_option('Foo Bar', 'foo'),
"remove_option() failed to remove option")
- self.failIf(cf.remove_option('Foo Bar', 'foo'),
+ self.assertFalse(cf.remove_option('Foo Bar', 'foo'),
"remove_option() failed to report non-existence of option"
" that was removed")
@@ -113,10 +132,10 @@ class TestCaseBase(unittest.TestCase):
eq(cf.options("a"), ["b"])
eq(cf.get("a", "b"), "value",
"could not locate option, expecting case-insensitive option names")
- self.failUnless(cf.has_option("a", "b"))
+ self.assertTrue(cf.has_option("a", "b"))
cf.set("A", "A-B", "A-B value")
for opt in ("a-b", "A-b", "a-B", "A-B"):
- self.failUnless(
+ self.assertTrue(
cf.has_option("A", opt),
"has_option() returned false for option which should exist")
eq(cf.options("A"), ["a-b"])
@@ -133,7 +152,7 @@ class TestCaseBase(unittest.TestCase):
# SF bug #561822:
cf = self.fromstring("[section]\nnekey=nevalue\n",
defaults={"key":"value"})
- self.failUnless(cf.has_option("section", "Key"))
+ self.assertTrue(cf.has_option("section", "Key"))
def test_default_case_sensitivity(self):
@@ -153,8 +172,6 @@ class TestCaseBase(unittest.TestCase):
self.parse_error(ConfigParser.ParsingError,
"[Foo]\n extra-spaces= splat\n")
self.parse_error(ConfigParser.ParsingError,
- "[Foo]\noption-without-value\n")
- self.parse_error(ConfigParser.ParsingError,
"[Foo]\n:value-without-option-name\n")
self.parse_error(ConfigParser.ParsingError,
"[Foo]\n=value-without-option-name\n")
@@ -169,8 +186,9 @@ class TestCaseBase(unittest.TestCase):
cf = self.newconfig()
self.assertEqual(cf.sections(), [],
"new ConfigParser should have no defined sections")
- self.failIf(cf.has_section("Foo"),
- "new ConfigParser should have no acknowledged sections")
+ self.assertFalse(cf.has_section("Foo"),
+ "new ConfigParser should have no acknowledged "
+ "sections")
self.assertRaises(ConfigParser.NoSectionError,
cf.options, "Foo")
self.assertRaises(ConfigParser.NoSectionError,
@@ -208,8 +226,8 @@ class TestCaseBase(unittest.TestCase):
"E5=FALSE AND MORE"
)
for x in range(1, 5):
- self.failUnless(cf.getboolean('BOOLTEST', 't%d' % x))
- self.failIf(cf.getboolean('BOOLTEST', 'f%d' % x))
+ self.assertTrue(cf.getboolean('BOOLTEST', 't%d' % x))
+ self.assertFalse(cf.getboolean('BOOLTEST', 'f%d' % x))
self.assertRaises(ValueError,
cf.getboolean, 'BOOLTEST', 'e%d' % x)
@@ -220,18 +238,24 @@ class TestCaseBase(unittest.TestCase):
cf.add_section, "Foo")
def test_write(self):
- cf = self.fromstring(
+ config_string = (
"[Long Line]\n"
"foo: this line is much, much longer than my editor\n"
" likes it.\n"
"[DEFAULT]\n"
"foo: another very\n"
- " long line"
+ " long line\n"
)
+ if self.allow_no_value:
+ config_string += (
+ "[Valueless]\n"
+ "option-without-value\n"
+ )
+
+ cf = self.fromstring(config_string)
output = StringIO.StringIO()
cf.write(output)
- self.assertEqual(
- output.getvalue(),
+ expect_string = (
"[DEFAULT]\n"
"foo = another very\n"
"\tlong line\n"
@@ -241,6 +265,13 @@ class TestCaseBase(unittest.TestCase):
"\tlikes it.\n"
"\n"
)
+ if self.allow_no_value:
+ expect_string += (
+ "[Valueless]\n"
+ "option-without-value\n"
+ "\n"
+ )
+ self.assertEqual(output.getvalue(), expect_string)
def test_set_string_types(self):
cf = self.fromstring("[sect]\n"
@@ -326,8 +357,14 @@ class TestCaseBase(unittest.TestCase):
class ConfigParserTestCase(TestCaseBase):
config_class = ConfigParser.ConfigParser
+ allow_no_value = True
def test_interpolation(self):
+ rawval = {
+ ConfigParser.ConfigParser: ("something %(with11)s "
+ "lots of interpolation (11 steps)"),
+ ConfigParser.SafeConfigParser: "%(with1)s",
+ }
cf = self.get_interpolation_config()
eq = self.assertEqual
eq(cf.get("Foo", "getname"), "Foo")
@@ -339,7 +376,7 @@ class ConfigParserTestCase(TestCaseBase):
self.get_error(ConfigParser.InterpolationDepthError, "Foo", "bar11")
def test_interpolation_missing_value(self):
- cf = self.get_interpolation_config()
+ self.get_interpolation_config()
e = self.get_error(ConfigParser.InterpolationError,
"Interpolation Error", "name")
self.assertEqual(e.reference, "reference")
@@ -361,6 +398,7 @@ class ConfigParserTestCase(TestCaseBase):
cf.set('non-string', 'dict', {'pi': 3.14159, '%(': 1,
'%(list)': '%(list)'})
cf.set('non-string', 'string_with_interpolation', '%(list)s')
+ cf.set('non-string', 'no-value')
self.assertEqual(cf.get('non-string', 'int', raw=True), 1)
self.assertRaises(TypeError, cf.get, 'non-string', 'int')
self.assertEqual(cf.get('non-string', 'list', raw=True),
@@ -373,7 +411,35 @@ class ConfigParserTestCase(TestCaseBase):
raw=True), '%(list)s')
self.assertRaises(ValueError, cf.get, 'non-string',
'string_with_interpolation', raw=False)
+ self.assertEqual(cf.get('non-string', 'no-value'), None)
+class MultilineValuesTestCase(TestCaseBase):
+ config_class = ConfigParser.ConfigParser
+ wonderful_spam = ("I'm having spam spam spam spam "
+ "spam spam spam beaked beans spam "
+ "spam spam and spam!").replace(' ', '\t\n')
+
+ def setUp(self):
+ cf = self.newconfig()
+ for i in range(100):
+ s = 'section{}'.format(i)
+ cf.add_section(s)
+ for j in range(10):
+ cf.set(s, 'lovely_spam{}'.format(j), self.wonderful_spam)
+ with open(test_support.TESTFN, 'w') as f:
+ cf.write(f)
+
+ def tearDown(self):
+ os.unlink(test_support.TESTFN)
+
+ def test_dominating_multiline_values(self):
+ # we're reading from file because this is where the code changed
+ # during performance updates in Python 3.2
+ cf_from_file = self.newconfig()
+ with open(test_support.TESTFN) as f:
+ cf_from_file.readfp(f)
+ self.assertEqual(cf_from_file.get('section8', 'lovely_spam4'),
+ self.wonderful_spam.replace('\t\n', '\n'))
class RawConfigParserTestCase(TestCaseBase):
config_class = ConfigParser.RawConfigParser
@@ -459,6 +525,38 @@ class SafeConfigParserTestCase(ConfigParserTestCase):
cf = self.newconfig()
self.assertRaises(ValueError, cf.add_section, "DEFAULT")
+
+class SafeConfigParserTestCaseNoValue(SafeConfigParserTestCase):
+ allow_no_value = True
+
+
+class Issue7005TestCase(unittest.TestCase):
+ """Test output when None is set() as a value and allow_no_value == False.
+
+ http://bugs.python.org/issue7005
+
+ """
+
+ expected_output = "[section]\noption = None\n\n"
+
+ def prepare(self, config_class):
+ # This is the default, but that's the point.
+ cp = config_class(allow_no_value=False)
+ cp.add_section("section")
+ cp.set("section", "option", None)
+ sio = StringIO.StringIO()
+ cp.write(sio)
+ return sio.getvalue()
+
+ def test_none_as_value_stringified(self):
+ output = self.prepare(ConfigParser.ConfigParser)
+ self.assertEqual(output, self.expected_output)
+
+ def test_none_as_value_stringified_raw(self):
+ output = self.prepare(ConfigParser.RawConfigParser)
+ self.assertEqual(output, self.expected_output)
+
+
class SortedTestCase(RawConfigParserTestCase):
def newconfig(self, defaults=None):
self.cf = self.config_class(defaults=defaults, dict_type=SortedDict)
@@ -474,22 +572,27 @@ class SortedTestCase(RawConfigParserTestCase):
"k=v\n")
output = StringIO.StringIO()
self.cf.write(output)
- self.assertEquals(output.getvalue(),
- "[a]\n"
- "k = v\n\n"
- "[b]\n"
- "o1 = 4\n"
- "o2 = 3\n"
- "o3 = 2\n"
- "o4 = 1\n\n")
+ self.assertEqual(output.getvalue(),
+ "[a]\n"
+ "k = v\n\n"
+ "[b]\n"
+ "o1 = 4\n"
+ "o2 = 3\n"
+ "o3 = 2\n"
+ "o4 = 1\n\n")
+
def test_main():
test_support.run_unittest(
ConfigParserTestCase,
+ MultilineValuesTestCase,
RawConfigParserTestCase,
SafeConfigParserTestCase,
- SortedTestCase
- )
+ SafeConfigParserTestCaseNoValue,
+ SortedTestCase,
+ Issue7005TestCase,
+ )
+
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py
index b723d74323..e282a51503 100644
--- a/Lib/test/test_cgi.py
+++ b/Lib/test/test_cgi.py
@@ -1,10 +1,9 @@
-from test.test_support import run_unittest, check_warnings, _check_py3k_warnings
+from test.test_support import run_unittest, check_warnings
import cgi
import os
import sys
import tempfile
import unittest
-from StringIO import StringIO
class HackedSysModule:
# The regression test will have real values in sys.argv, which
@@ -115,7 +114,7 @@ def gen_result(data, environ):
result = {}
for k, v in dict(form).items():
- result[k] = type(v) is list and form.getlist(k) or v.value
+ result[k] = isinstance(v, list) and form.getlist(k) or v.value
return result
@@ -133,23 +132,23 @@ class CgiTests(unittest.TestCase):
fcd = cgi.FormContentDict(env)
sd = cgi.SvFormContentDict(env)
fs = cgi.FieldStorage(environ=env)
- if type(expect) == type({}):
+ if isinstance(expect, dict):
# test dict interface
self.assertEqual(len(expect), len(fcd))
- self.assertEqual(sorted(expect.keys()), sorted(fcd.keys()))
- self.assertEqual(sorted(expect.values()), sorted(fcd.values()))
- self.assertEqual(sorted(expect.items()), sorted(fcd.items()))
+ self.assertItemsEqual(expect.keys(), fcd.keys())
+ self.assertItemsEqual(expect.values(), fcd.values())
+ self.assertItemsEqual(expect.items(), fcd.items())
self.assertEqual(fcd.get("nonexistent field", "default"), "default")
self.assertEqual(len(sd), len(fs))
- self.assertEqual(sorted(sd.keys()), sorted(fs.keys()))
+ self.assertItemsEqual(sd.keys(), fs.keys())
self.assertEqual(fs.getvalue("nonexistent field", "default"), "default")
# test individual fields
for key in expect.keys():
expect_val = expect[key]
- self.assert_(fcd.has_key(key))
- self.assertEqual(sorted(fcd[key]), sorted(expect[key]))
+ self.assertTrue(fcd.has_key(key))
+ self.assertItemsEqual(fcd[key], expect[key])
self.assertEqual(fcd.get(key, "default"), fcd[key])
- self.assert_(fs.has_key(key))
+ self.assertTrue(fs.has_key(key))
if len(expect_val) > 1:
single_value = 0
else:
@@ -157,18 +156,18 @@ class CgiTests(unittest.TestCase):
try:
val = sd[key]
except IndexError:
- self.failIf(single_value)
+ self.assertFalse(single_value)
self.assertEqual(fs.getvalue(key), expect_val)
else:
- self.assert_(single_value)
+ self.assertTrue(single_value)
self.assertEqual(val, expect_val[0])
self.assertEqual(fs.getvalue(key), expect_val[0])
- self.assertEqual(sorted(sd.getlist(key)), sorted(expect_val))
+ self.assertItemsEqual(sd.getlist(key), expect_val)
if single_value:
- self.assertEqual(sorted(sd.values()),
- first_elts(sorted(expect.values())))
- self.assertEqual(sorted(sd.items()),
- first_second_elts(sorted(expect.items())))
+ self.assertItemsEqual(sd.values(),
+ first_elts(expect.values()))
+ self.assertItemsEqual(sd.items(),
+ first_second_elts(expect.items()))
def test_weird_formcontentdict(self):
# Test the weird FormContentDict classes
@@ -179,8 +178,7 @@ class CgiTests(unittest.TestCase):
self.assertEqual(d[k], v)
for k, v in d.items():
self.assertEqual(expect[k], v)
- with _check_py3k_warnings():
- self.assertEqual(sorted(expect.values()), sorted(d.values()))
+ self.assertItemsEqual(expect.values(), d.values())
def test_log(self):
cgi.log("Testing")
@@ -227,7 +225,7 @@ class CgiTests(unittest.TestCase):
# if we're not chunking properly, readline is only called twice
# (by read_binary); if we are chunking properly, it will be called 5 times
# as long as the chunksize is 1 << 16.
- self.assert_(f.numcalls > 2)
+ self.assertTrue(f.numcalls > 2)
def test_fieldstorage_multipart(self):
#Test basic FieldStorage multipart parsing
@@ -253,7 +251,7 @@ Content-Disposition: form-data; name="submit"
-----------------------------721837373350705526688164684--
"""
fs = cgi.FieldStorage(fp=StringIO(postdata), environ=env)
- self.assertEquals(len(fs.list), 4)
+ self.assertEqual(len(fs.list), 4)
expect = [{'name':'id', 'filename':None, 'value':'1234'},
{'name':'title', 'filename':None, 'value':''},
{'name':'file', 'filename':'test.txt','value':'Testing 123.\n'},
@@ -261,7 +259,7 @@ Content-Disposition: form-data; name="submit"
for x in range(len(fs.list)):
for k, exp in expect[x].items():
got = getattr(fs.list[x], k)
- self.assertEquals(got, exp)
+ self.assertEqual(got, exp)
_qs_result = {
'key1': 'value1',
@@ -341,14 +339,16 @@ this is the content of the fake file
self.assertEqual(result, v)
def test_deprecated_parse_qs(self):
- with check_warnings():
- # this func is moved to urlparse, this is just a sanity check
+ # this func is moved to urlparse, this is just a sanity check
+ with check_warnings(('cgi.parse_qs is deprecated, use urlparse.'
+ 'parse_qs instead', PendingDeprecationWarning)):
self.assertEqual({'a': ['A1'], 'B': ['B3'], 'b': ['B2']},
cgi.parse_qs('a=A1&b=B2&B=B3'))
def test_deprecated_parse_qsl(self):
- with check_warnings():
- # this func is moved to urlparse, this is just a sanity check
+ # this func is moved to urlparse, this is just a sanity check
+ with check_warnings(('cgi.parse_qsl is deprecated, use urlparse.'
+ 'parse_qsl instead', PendingDeprecationWarning)):
self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')],
cgi.parse_qsl('a=A1&b=B2&B=B3'))
diff --git a/Lib/test/test_charmapcodec.py b/Lib/test/test_charmapcodec.py
index 2866984005..d984059af9 100644
--- a/Lib/test/test_charmapcodec.py
+++ b/Lib/test/test_charmapcodec.py
@@ -27,24 +27,24 @@ codecname = 'testcodec'
class CharmapCodecTest(unittest.TestCase):
def test_constructorx(self):
- self.assertEquals(unicode('abc', codecname), u'abc')
- self.assertEquals(unicode('xdef', codecname), u'abcdef')
- self.assertEquals(unicode('defx', codecname), u'defabc')
- self.assertEquals(unicode('dxf', codecname), u'dabcf')
- self.assertEquals(unicode('dxfx', codecname), u'dabcfabc')
+ self.assertEqual(unicode('abc', codecname), u'abc')
+ self.assertEqual(unicode('xdef', codecname), u'abcdef')
+ self.assertEqual(unicode('defx', codecname), u'defabc')
+ self.assertEqual(unicode('dxf', codecname), u'dabcf')
+ self.assertEqual(unicode('dxfx', codecname), u'dabcfabc')
def test_encodex(self):
- self.assertEquals(u'abc'.encode(codecname), 'abc')
- self.assertEquals(u'xdef'.encode(codecname), 'abcdef')
- self.assertEquals(u'defx'.encode(codecname), 'defabc')
- self.assertEquals(u'dxf'.encode(codecname), 'dabcf')
- self.assertEquals(u'dxfx'.encode(codecname), 'dabcfabc')
+ self.assertEqual(u'abc'.encode(codecname), 'abc')
+ self.assertEqual(u'xdef'.encode(codecname), 'abcdef')
+ self.assertEqual(u'defx'.encode(codecname), 'defabc')
+ self.assertEqual(u'dxf'.encode(codecname), 'dabcf')
+ self.assertEqual(u'dxfx'.encode(codecname), 'dabcfabc')
def test_constructory(self):
- self.assertEquals(unicode('ydef', codecname), u'def')
- self.assertEquals(unicode('defy', codecname), u'def')
- self.assertEquals(unicode('dyf', codecname), u'df')
- self.assertEquals(unicode('dyfy', codecname), u'df')
+ self.assertEqual(unicode('ydef', codecname), u'def')
+ self.assertEqual(unicode('defy', codecname), u'def')
+ self.assertEqual(unicode('dyf', codecname), u'df')
+ self.assertEqual(unicode('dyfy', codecname), u'df')
def test_maptoundefined(self):
self.assertRaises(UnicodeError, unicode, 'abc\001', codecname)
diff --git a/Lib/test/test_cl.py b/Lib/test/test_cl.py
index a2728b7df1..50102e9267 100755
--- a/Lib/test/test_cl.py
+++ b/Lib/test/test_cl.py
@@ -2,8 +2,9 @@
"""Whimpy test script for the cl module
Roger E. Masse
"""
-import cl
-from test.test_support import verbose
+from test.test_support import verbose, import_module
+
+cl = import_module('cl')
clattrs = ['ADDED_ALGORITHM_ERROR', 'ALAW', 'ALGORITHM_ID',
'ALGORITHM_VERSION', 'AUDIO', 'AWARE_ERROR', 'AWARE_MPEG_AUDIO',
diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py
index c2d3c54353..0f25101827 100644
--- a/Lib/test/test_class.py
+++ b/Lib/test/test_class.py
@@ -475,7 +475,7 @@ class ClassTests(unittest.TestCase):
del testme
import gc
gc.collect()
- self.assertEquals(["crab people, crab people"], x)
+ self.assertEqual(["crab people, crab people"], x)
def testBadTypeReturned(self):
# return values of some method are type-checked
@@ -507,14 +507,14 @@ class ClassTests(unittest.TestCase):
callLst[:] = []
as_int = int(mixIntAndLong)
- self.assertEquals(type(as_int), long)
- self.assertEquals(as_int, 42L)
+ self.assertEqual(type(as_int), long)
+ self.assertEqual(as_int, 42L)
self.assertCallStack([('__int__', (mixIntAndLong,))])
callLst[:] = []
as_long = long(mixIntAndLong)
- self.assertEquals(type(as_long), int)
- self.assertEquals(as_long, 64)
+ self.assertEqual(type(as_long), long)
+ self.assertEqual(as_long, 64)
self.assertCallStack([('__long__', (mixIntAndLong,))])
def testHashStuff(self):
@@ -599,24 +599,24 @@ class ClassTests(unittest.TestCase):
a1 = A(1)
a2 = A(2)
- self.assertEquals(a1.f, a1.f)
- self.assertNotEquals(a1.f, a2.f)
- self.assertNotEquals(a1.f, a1.g)
- self.assertEquals(a1.f, A(1).f)
- self.assertEquals(hash(a1.f), hash(a1.f))
- self.assertEquals(hash(a1.f), hash(A(1).f))
-
- self.assertNotEquals(A.f, a1.f)
- self.assertNotEquals(A.f, A.g)
- self.assertEquals(B.f, A.f)
- self.assertEquals(hash(B.f), hash(A.f))
+ self.assertEqual(a1.f, a1.f)
+ self.assertNotEqual(a1.f, a2.f)
+ self.assertNotEqual(a1.f, a1.g)
+ self.assertEqual(a1.f, A(1).f)
+ self.assertEqual(hash(a1.f), hash(a1.f))
+ self.assertEqual(hash(a1.f), hash(A(1).f))
+
+ self.assertNotEqual(A.f, a1.f)
+ self.assertNotEqual(A.f, A.g)
+ self.assertEqual(B.f, A.f)
+ self.assertEqual(hash(B.f), hash(A.f))
# the following triggers a SystemError in 2.4
a = A(hash(A.f.im_func)^(-1))
hash(a.f)
def test_main():
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
(".+__(get|set|del)slice__ has been removed", DeprecationWarning),
("classic int division", DeprecationWarning),
("<> not supported", DeprecationWarning)):
diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py
index cda1695f94..8b5c4bf34f 100755..100644
--- a/Lib/test/test_cmath.py
+++ b/Lib/test/test_cmath.py
@@ -1,7 +1,6 @@
from test.test_support import run_unittest
from test.test_math import parse_testfile, test_file
import unittest
-import os, sys
import cmath, math
from cmath import phase, polar, rect, pi
@@ -46,37 +45,6 @@ complex_nans = [complex(x, y) for x, y in [
(INF, NAN)
]]
-def almostEqualF(a, b, rel_err=2e-15, abs_err = 5e-323):
- """Determine whether floating-point values a and b are equal to within
- a (small) rounding error. The default values for rel_err and
- abs_err are chosen to be suitable for platforms where a float is
- represented by an IEEE 754 double. They allow an error of between
- 9 and 19 ulps."""
-
- # special values testing
- if math.isnan(a):
- return math.isnan(b)
- if math.isinf(a):
- return a == b
-
- # if both a and b are zero, check whether they have the same sign
- # (in theory there are examples where it would be legitimate for a
- # and b to have opposite signs; in practice these hardly ever
- # occur).
- if not a and not b:
- return math.copysign(1., a) == math.copysign(1., b)
-
- # if a-b overflows, or b is infinite, return False. Again, in
- # theory there are examples where a is within a few ulps of the
- # max representable float, and then b could legitimately be
- # infinite. In practice these examples are rare.
- try:
- absolute_error = abs(b-a)
- except OverflowError:
- return False
- else:
- return absolute_error <= max(abs_err, rel_err * abs(a))
-
class CMathTests(unittest.TestCase):
# list of all functions in cmath
test_functions = [getattr(cmath, fname) for fname in [
@@ -93,47 +61,63 @@ class CMathTests(unittest.TestCase):
def tearDown(self):
self.test_values.close()
- def rAssertAlmostEqual(self, a, b, rel_err = 2e-15, abs_err = 5e-323):
- """Check that two floating-point numbers are almost equal."""
+ def rAssertAlmostEqual(self, a, b, rel_err = 2e-15, abs_err = 5e-323,
+ msg=None):
+ """Fail if the two floating-point numbers are not almost equal.
+
+ Determine whether floating-point values a and b are equal to within
+ a (small) rounding error. The default values for rel_err and
+ abs_err are chosen to be suitable for platforms where a float is
+ represented by an IEEE 754 double. They allow an error of between
+ 9 and 19 ulps.
+ """
# special values testing
if math.isnan(a):
if math.isnan(b):
return
- self.fail("%s should be nan" % repr(b))
+ self.fail(msg or '{!r} should be nan'.format(b))
if math.isinf(a):
if a == b:
return
- self.fail("finite result where infinity excpected: "
- "expected %s, got %s" % (repr(a), repr(b)))
+ self.fail(msg or 'finite result where infinity expected: '
+ 'expected {!r}, got {!r}'.format(a, b))
+ # if both a and b are zero, check whether they have the same sign
+ # (in theory there are examples where it would be legitimate for a
+ # and b to have opposite signs; in practice these hardly ever
+ # occur).
if not a and not b:
- if math.atan2(a, -1.) != math.atan2(b, -1.):
- self.fail("zero has wrong sign: expected %s, got %s" %
- (repr(a), repr(b)))
-
- # test passes if either the absolute error or the relative
- # error is sufficiently small. The defaults amount to an
- # error of between 9 ulps and 19 ulps on an IEEE-754 compliant
- # machine.
-
+ if math.copysign(1., a) != math.copysign(1., b):
+ self.fail(msg or 'zero has wrong sign: expected {!r}, '
+ 'got {!r}'.format(a, b))
+
+ # if a-b overflows, or b is infinite, return False. Again, in
+ # theory there are examples where a is within a few ulps of the
+ # max representable float, and then b could legitimately be
+ # infinite. In practice these examples are rare.
try:
absolute_error = abs(b-a)
except OverflowError:
pass
else:
+ # test passes if either the absolute error or the relative
+ # error is sufficiently small. The defaults amount to an
+ # error of between 9 ulps and 19 ulps on an IEEE-754 compliant
+ # machine.
if absolute_error <= max(abs_err, rel_err * abs(a)):
return
- self.fail("%s and %s are not sufficiently close" % (repr(a), repr(b)))
+ self.fail(msg or
+ '{!r} and {!r} are not sufficiently close'.format(a, b))
def test_constants(self):
e_expected = 2.71828182845904523536
pi_expected = 3.14159265358979323846
self.assertAlmostEqual(cmath.pi, pi_expected, places=9,
- msg="cmath.pi is %s; should be %s" % (cmath.pi, pi_expected))
+ msg="cmath.pi is {}; should be {}".format(cmath.pi, pi_expected))
self.assertAlmostEqual(cmath.e, e_expected, places=9,
- msg="cmath.e is %s; should be %s" % (cmath.e, e_expected))
+ msg="cmath.e is {}; should be {}".format(cmath.e, e_expected))
def test_user_object(self):
# Test automatic calling of __complex__ and __float__ by cmath
@@ -325,8 +309,8 @@ class CMathTests(unittest.TestCase):
except ValueError:
continue
else:
- test_str = "%s: %s(complex(%r, %r))" % (id, fn, ar, ai)
- self.fail('ValueError not raised in test %s' % test_str)
+ self.fail('ValueError not raised in test '
+ '{}: {}(complex({!r}, {!r}))'.format(id, fn, ar, ai))
if 'overflow' in flags:
try:
@@ -334,8 +318,8 @@ class CMathTests(unittest.TestCase):
except OverflowError:
continue
else:
- test_str = "%s: %s(complex(%r, %r))" % (id, fn, ar, ai)
- self.fail('OverflowError not raised in test %s' % test_str)
+ self.fail('OverflowError not raised in test '
+ '{}: {}(complex({!r}, {!r}))'.format(id, fn, ar, ai))
actual = function(arg)
@@ -353,17 +337,19 @@ class CMathTests(unittest.TestCase):
else:
real_abs_err = 5e-323
- if not (almostEqualF(expected.real, actual.real,
- abs_err = real_abs_err) and
- almostEqualF(expected.imag, actual.imag)):
- error_message = (
- "%s: %s(complex(%r, %r))\n" % (id, fn, ar, ai) +
- "Expected: complex(%r, %r)\n" %
- (expected.real, expected.imag) +
- "Received: complex(%r, %r)\n" %
- (actual.real, actual.imag) +
- "Received value insufficiently close to expected value.")
- self.fail(error_message)
+ error_message = (
+ '{}: {}(complex({!r}, {!r}))\n'
+ 'Expected: complex({!r}, {!r})\n'
+ 'Received: complex({!r}, {!r})\n'
+ 'Received value insufficiently close to expected value.'
+ ).format(id, fn, ar, ai,
+ expected.real, expected.imag,
+ actual.real, actual.imag)
+ self.rAssertAlmostEqual(expected.real, actual.real,
+ abs_err=real_abs_err,
+ msg=error_message)
+ self.rAssertAlmostEqual(expected.imag, actual.imag,
+ msg=error_message)
def assertCISEqual(self, a, b):
eps = 1E-7
@@ -416,7 +402,7 @@ class CMathTests(unittest.TestCase):
# real or imaginary part NaN
for z in complex_nans:
- self.assert_(math.isnan(phase(z)))
+ self.assertTrue(math.isnan(phase(z)))
def test_abs(self):
# zeros
@@ -429,18 +415,18 @@ class CMathTests(unittest.TestCase):
# real or imaginary part NaN
self.assertEqual(abs(complex(NAN, -INF)), INF)
- self.assert_(math.isnan(abs(complex(NAN, -2.3))))
- self.assert_(math.isnan(abs(complex(NAN, -0.0))))
- self.assert_(math.isnan(abs(complex(NAN, 0.0))))
- self.assert_(math.isnan(abs(complex(NAN, 2.3))))
+ self.assertTrue(math.isnan(abs(complex(NAN, -2.3))))
+ self.assertTrue(math.isnan(abs(complex(NAN, -0.0))))
+ self.assertTrue(math.isnan(abs(complex(NAN, 0.0))))
+ self.assertTrue(math.isnan(abs(complex(NAN, 2.3))))
self.assertEqual(abs(complex(NAN, INF)), INF)
self.assertEqual(abs(complex(-INF, NAN)), INF)
- self.assert_(math.isnan(abs(complex(-2.3, NAN))))
- self.assert_(math.isnan(abs(complex(-0.0, NAN))))
- self.assert_(math.isnan(abs(complex(0.0, NAN))))
- self.assert_(math.isnan(abs(complex(2.3, NAN))))
+ self.assertTrue(math.isnan(abs(complex(-2.3, NAN))))
+ self.assertTrue(math.isnan(abs(complex(-0.0, NAN))))
+ self.assertTrue(math.isnan(abs(complex(0.0, NAN))))
+ self.assertTrue(math.isnan(abs(complex(2.3, NAN))))
self.assertEqual(abs(complex(INF, NAN)), INF)
- self.assert_(math.isnan(abs(complex(NAN, NAN))))
+ self.assertTrue(math.isnan(abs(complex(NAN, NAN))))
# result overflows
if float.__getformat__("double").startswith("IEEE"):
@@ -459,26 +445,26 @@ class CMathTests(unittest.TestCase):
self.assertCEqual(rect(1, -pi/2), (0, -1.))
def test_isnan(self):
- self.failIf(cmath.isnan(1))
- self.failIf(cmath.isnan(1j))
- self.failIf(cmath.isnan(INF))
- self.assert_(cmath.isnan(NAN))
- self.assert_(cmath.isnan(complex(NAN, 0)))
- self.assert_(cmath.isnan(complex(0, NAN)))
- self.assert_(cmath.isnan(complex(NAN, NAN)))
- self.assert_(cmath.isnan(complex(NAN, INF)))
- self.assert_(cmath.isnan(complex(INF, NAN)))
+ self.assertFalse(cmath.isnan(1))
+ self.assertFalse(cmath.isnan(1j))
+ self.assertFalse(cmath.isnan(INF))
+ self.assertTrue(cmath.isnan(NAN))
+ self.assertTrue(cmath.isnan(complex(NAN, 0)))
+ self.assertTrue(cmath.isnan(complex(0, NAN)))
+ self.assertTrue(cmath.isnan(complex(NAN, NAN)))
+ self.assertTrue(cmath.isnan(complex(NAN, INF)))
+ self.assertTrue(cmath.isnan(complex(INF, NAN)))
def test_isinf(self):
- self.failIf(cmath.isinf(1))
- self.failIf(cmath.isinf(1j))
- self.failIf(cmath.isinf(NAN))
- self.assert_(cmath.isinf(INF))
- self.assert_(cmath.isinf(complex(INF, 0)))
- self.assert_(cmath.isinf(complex(0, INF)))
- self.assert_(cmath.isinf(complex(INF, INF)))
- self.assert_(cmath.isinf(complex(NAN, INF)))
- self.assert_(cmath.isinf(complex(INF, NAN)))
+ self.assertFalse(cmath.isinf(1))
+ self.assertFalse(cmath.isinf(1j))
+ self.assertFalse(cmath.isinf(NAN))
+ self.assertTrue(cmath.isinf(INF))
+ self.assertTrue(cmath.isinf(complex(INF, 0)))
+ self.assertTrue(cmath.isinf(complex(0, INF)))
+ self.assertTrue(cmath.isinf(complex(INF, INF)))
+ self.assertTrue(cmath.isinf(complex(NAN, INF)))
+ self.assertTrue(cmath.isinf(complex(INF, NAN)))
def test_main():
diff --git a/Lib/test/test_cmd.py b/Lib/test/test_cmd.py
index b48b0f11f3..c46fec8a5f 100644
--- a/Lib/test/test_cmd.py
+++ b/Lib/test/test_cmd.py
@@ -7,6 +7,7 @@ Original by Michael Schneider
import cmd
import sys
+from test import test_support
import re
import unittest
import StringIO
@@ -60,15 +61,17 @@ class samplecmdclass(cmd.Cmd):
>>> mycmd.completenames("12")
[]
>>> mycmd.completenames("help")
- ['help', 'help']
+ ['help']
Test for the function complete_help():
>>> mycmd.complete_help("a")
['add']
>>> mycmd.complete_help("he")
- ['help', 'help']
+ ['help']
>>> mycmd.complete_help("12")
[]
+ >>> sorted(mycmd.complete_help(""))
+ ['add', 'exit', 'help', 'shell']
Test for the function do_help():
>>> mycmd.do_help("testet")
@@ -185,19 +188,19 @@ class TestAlternateInput(unittest.TestCase):
cmd = self.simplecmd(stdin=input, stdout=output)
cmd.use_rawinput = False
cmd.cmdloop()
- self.assertEqual(output.getvalue(),
+ self.assertMultiLineEqual(output.getvalue(),
("(Cmd) test\n"
"(Cmd) test2\n"
"(Cmd) "))
def test_main(verbose=None):
- from test import test_support, test_cmd
+ from test import test_cmd
test_support.run_doctest(test_cmd, verbose)
test_support.run_unittest(TestAlternateInput)
def test_coverage(coverdir):
- import trace
+ trace = test_support.import_module('trace')
tracer=trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,],
trace=0, count=1)
tracer.run('reload(cmd);test_main()')
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index efef74f09c..be3b70e881 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -4,33 +4,16 @@
import test.test_support, unittest
import sys
-import subprocess
-
-def _spawn_python(*args):
- cmd_line = [sys.executable, '-E']
- cmd_line.extend(args)
- return subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-
-def _kill_python(p):
- p.stdin.close()
- data = p.stdout.read()
- p.stdout.close()
- # try to cleanup the child so we don't appear to leak when running
- # with regrtest -R. This should be a no-op on Windows.
- subprocess._cleanup()
- return data
+from test.script_helper import spawn_python, kill_python, python_exit_code
+
class CmdLineTest(unittest.TestCase):
def start_python(self, *args):
- p = _spawn_python(*args)
- return _kill_python(p)
+ p = spawn_python(*args)
+ return kill_python(p)
def exit_code(self, *args):
- cmd_line = [sys.executable, '-E']
- cmd_line.extend(args)
- return subprocess.call(cmd_line, stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ return python_exit_code(*args)
def test_directories(self):
self.assertNotEqual(self.exit_code('.'), 0)
@@ -39,7 +22,7 @@ class CmdLineTest(unittest.TestCase):
def verify_valid_flag(self, cmd_line):
data = self.start_python(cmd_line)
self.assertTrue(data == '' or data.endswith('\n'))
- self.assertTrue('Traceback' not in data)
+ self.assertNotIn('Traceback', data)
def test_optimize(self):
self.verify_valid_flag('-O')
@@ -55,7 +38,7 @@ class CmdLineTest(unittest.TestCase):
self.verify_valid_flag('-S')
def test_usage(self):
- self.assertTrue('usage' in self.start_python('-h'))
+ self.assertIn('usage', self.start_python('-h'))
def test_version(self):
version = 'Python %d.%d' % sys.version_info[:2]
@@ -83,12 +66,12 @@ class CmdLineTest(unittest.TestCase):
# -m and -i need to play well together
# Runs the timeit module and checks the __main__
# namespace has been populated appropriately
- p = _spawn_python('-i', '-m', 'timeit', '-n', '1')
+ p = spawn_python('-i', '-m', 'timeit', '-n', '1')
p.stdin.write('Timer\n')
p.stdin.write('exit()\n')
- data = _kill_python(p)
+ data = kill_python(p)
self.assertTrue(data.startswith('1 loop'))
- self.assertTrue('__main__.Timer' in data)
+ self.assertIn('__main__.Timer', data)
def test_run_code(self):
# Test expected operation of the '-c' switch
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index 995d4a8f79..099471fc63 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -3,36 +3,13 @@
import unittest
import os
import os.path
-import sys
import test.test_support
-import tempfile
-import subprocess
-import py_compile
-import contextlib
-import shutil
-import zipfile
+from test.script_helper import (run_python,
+ temp_dir, make_script, compile_script,
+ make_pkg, make_zip_script, make_zip_pkg)
verbose = test.test_support.verbose
-# XXX ncoghlan: Should we consider moving these to test_support?
-from test_cmd_line import _spawn_python, _kill_python
-
-def _run_python(*args):
- if __debug__:
- p = _spawn_python(*args)
- else:
- p = _spawn_python('-O', *args)
- stdout_data = _kill_python(p)
- return p.wait(), stdout_data
-
-@contextlib.contextmanager
-def temp_dir():
- dirname = tempfile.mkdtemp()
- dirname = os.path.realpath(dirname)
- try:
- yield dirname
- finally:
- shutil.rmtree(dirname)
test_source = """\
# Script may be run with optimisation enabled, so don't rely on assert
@@ -60,63 +37,12 @@ print 'sys.argv[0]==%r' % sys.argv[0]
"""
def _make_test_script(script_dir, script_basename, source=test_source):
- script_filename = script_basename+os.extsep+'py'
- script_name = os.path.join(script_dir, script_filename)
- script_file = open(script_name, 'w')
- script_file.write(source)
- script_file.close()
- return script_name
-
-def _compile_test_script(script_name):
- py_compile.compile(script_name, doraise=True)
- if __debug__:
- compiled_name = script_name + 'c'
- else:
- compiled_name = script_name + 'o'
- return compiled_name
-
-def _make_test_zip(zip_dir, zip_basename, script_name, name_in_zip=None):
- zip_filename = zip_basename+os.extsep+'zip'
- zip_name = os.path.join(zip_dir, zip_filename)
- zip_file = zipfile.ZipFile(zip_name, 'w')
- if name_in_zip is None:
- name_in_zip = os.path.basename(script_name)
- zip_file.write(script_name, name_in_zip)
- zip_file.close()
- #if verbose:
- # zip_file = zipfile.ZipFile(zip_name, 'r')
- # print 'Contents of %r:' % zip_name
- # zip_file.printdir()
- # zip_file.close()
- return zip_name, os.path.join(zip_name, name_in_zip)
-
-def _make_test_pkg(pkg_dir):
- os.mkdir(pkg_dir)
- _make_test_script(pkg_dir, '__init__', '')
+ return make_script(script_dir, script_basename, source)
def _make_test_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
source=test_source, depth=1):
- init_name = _make_test_script(zip_dir, '__init__', '')
- init_basename = os.path.basename(init_name)
- script_name = _make_test_script(zip_dir, script_basename, source)
- pkg_names = [os.sep.join([pkg_name]*i) for i in range(1, depth+1)]
- script_name_in_zip = os.path.join(pkg_names[-1], os.path.basename(script_name))
- zip_filename = zip_basename+os.extsep+'zip'
- zip_name = os.path.join(zip_dir, zip_filename)
- zip_file = zipfile.ZipFile(zip_name, 'w')
- for name in pkg_names:
- init_name_in_zip = os.path.join(name, init_basename)
- zip_file.write(init_name, init_name_in_zip)
- zip_file.write(script_name, script_name_in_zip)
- zip_file.close()
- os.unlink(init_name)
- os.unlink(script_name)
- #if verbose:
- # zip_file = zipfile.ZipFile(zip_name, 'r')
- # print 'Contents of %r:' % zip_name
- # zip_file.printdir()
- # zip_file.close()
- return zip_name, os.path.join(zip_name, script_name_in_zip)
+ return make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename,
+ source, depth)
# There's no easy way to pass the script directory in to get
# -m to work (avoiding that is the whole point of making
@@ -134,14 +60,14 @@ def _make_launch_script(script_dir, script_basename, module_name, path=None):
else:
path = repr(path)
source = launch_source % (path, module_name)
- return _make_test_script(script_dir, script_basename, source)
+ return make_script(script_dir, script_basename, source)
class CmdLineTest(unittest.TestCase):
def _check_script(self, script_name, expected_file,
expected_argv0, expected_package,
*cmd_line_switches):
run_args = cmd_line_switches + (script_name,)
- exit_code, data = _run_python(*run_args)
+ exit_code, data = run_python(*run_args)
if verbose:
print 'Output from test script %r:' % script_name
print data
@@ -154,9 +80,19 @@ class CmdLineTest(unittest.TestCase):
print printed_file
print printed_package
print printed_argv0
- self.assert_(printed_file in data)
- self.assert_(printed_package in data)
- self.assert_(printed_argv0 in data)
+ self.assertIn(printed_file, data)
+ self.assertIn(printed_package, data)
+ self.assertIn(printed_argv0, data)
+
+ def _check_import_error(self, script_name, expected_msg,
+ *cmd_line_switches):
+ run_args = cmd_line_switches + (script_name,)
+ exit_code, data = run_python(*run_args)
+ if verbose:
+ print 'Output from test script %r:' % script_name
+ print data
+ print 'Expected output: %r' % expected_msg
+ self.assertIn(expected_msg, data)
def test_basic_script(self):
with temp_dir() as script_dir:
@@ -166,7 +102,7 @@ class CmdLineTest(unittest.TestCase):
def test_script_compiled(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, 'script')
- compiled_name = _compile_test_script(script_name)
+ compiled_name = compile_script(script_name)
os.remove(script_name)
self._check_script(compiled_name, compiled_name, compiled_name, None)
@@ -178,27 +114,39 @@ class CmdLineTest(unittest.TestCase):
def test_directory_compiled(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, '__main__')
- compiled_name = _compile_test_script(script_name)
+ compiled_name = compile_script(script_name)
os.remove(script_name)
self._check_script(script_dir, compiled_name, script_dir, '')
+ def test_directory_error(self):
+ with temp_dir() as script_dir:
+ msg = "can't find '__main__' module in %r" % script_dir
+ self._check_import_error(script_dir, msg)
+
def test_zipfile(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, '__main__')
- zip_name, run_name = _make_test_zip(script_dir, 'test_zip', script_name)
+ zip_name, run_name = make_zip_script(script_dir, 'test_zip', script_name)
self._check_script(zip_name, run_name, zip_name, '')
def test_zipfile_compiled(self):
with temp_dir() as script_dir:
script_name = _make_test_script(script_dir, '__main__')
- compiled_name = _compile_test_script(script_name)
- zip_name, run_name = _make_test_zip(script_dir, 'test_zip', compiled_name)
+ compiled_name = compile_script(script_name)
+ zip_name, run_name = make_zip_script(script_dir, 'test_zip', compiled_name)
self._check_script(zip_name, run_name, zip_name, '')
+ def test_zipfile_error(self):
+ with temp_dir() as script_dir:
+ script_name = _make_test_script(script_dir, 'not_main')
+ zip_name, run_name = make_zip_script(script_dir, 'test_zip', script_name)
+ msg = "can't find '__main__' module in %r" % zip_name
+ self._check_import_error(zip_name, msg)
+
def test_module_in_package(self):
with temp_dir() as script_dir:
pkg_dir = os.path.join(script_dir, 'test_pkg')
- _make_test_pkg(pkg_dir)
+ make_pkg(pkg_dir)
script_name = _make_test_script(pkg_dir, 'script')
launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.script')
self._check_script(launch_name, script_name, script_name, 'test_pkg')
@@ -215,6 +163,47 @@ class CmdLineTest(unittest.TestCase):
launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.test_pkg.script', zip_name)
self._check_script(launch_name, run_name, run_name, 'test_pkg.test_pkg')
+ def test_package(self):
+ with temp_dir() as script_dir:
+ pkg_dir = os.path.join(script_dir, 'test_pkg')
+ make_pkg(pkg_dir)
+ script_name = _make_test_script(pkg_dir, '__main__')
+ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
+ self._check_script(launch_name, script_name,
+ script_name, 'test_pkg')
+
+ def test_package_compiled(self):
+ with temp_dir() as script_dir:
+ pkg_dir = os.path.join(script_dir, 'test_pkg')
+ make_pkg(pkg_dir)
+ script_name = _make_test_script(pkg_dir, '__main__')
+ compiled_name = compile_script(script_name)
+ os.remove(script_name)
+ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
+ self._check_script(launch_name, compiled_name,
+ compiled_name, 'test_pkg')
+
+ def test_package_error(self):
+ with temp_dir() as script_dir:
+ pkg_dir = os.path.join(script_dir, 'test_pkg')
+ make_pkg(pkg_dir)
+ msg = ("'test_pkg' is a package and cannot "
+ "be directly executed")
+ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
+ self._check_import_error(launch_name, msg)
+
+ def test_package_recursion(self):
+ with temp_dir() as script_dir:
+ pkg_dir = os.path.join(script_dir, 'test_pkg')
+ make_pkg(pkg_dir)
+ main_dir = os.path.join(pkg_dir, '__main__')
+ make_pkg(main_dir)
+ msg = ("Cannot use package as __main__ module; "
+ "'test_pkg' is a package and cannot "
+ "be directly executed")
+ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg')
+ self._check_import_error(launch_name, msg)
+
def test_main():
test.test_support.run_unittest(CmdLineTest)
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index b69223d190..97adf590bc 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -80,6 +80,11 @@ consts: ("'doc string'", 'None')
"""
+import unittest
+import weakref
+import _testcapi
+
+
def consts(t):
"""Yield a doctest-safe sequence of object reprs."""
for elt in t:
@@ -96,11 +101,47 @@ def dump(co):
print "%s: %s" % (attr, getattr(co, "co_" + attr))
print "consts:", tuple(consts(co.co_consts))
+
+class CodeTest(unittest.TestCase):
+
+ def test_newempty(self):
+ co = _testcapi.code_newempty("filename", "funcname", 15)
+ self.assertEqual(co.co_filename, "filename")
+ self.assertEqual(co.co_name, "funcname")
+ self.assertEqual(co.co_firstlineno, 15)
+
+
+class CodeWeakRefTest(unittest.TestCase):
+
+ def test_basic(self):
+ # Create a code object in a clean environment so that we know we have
+ # the only reference to it left.
+ namespace = {}
+ exec "def f(): pass" in globals(), namespace
+ f = namespace["f"]
+ del namespace
+
+ self.called = False
+ def callback(code):
+ self.called = True
+
+ # f is now the last reference to the function, and through it, the code
+ # object. While we hold it, check that we can create a weakref and
+ # deref it. Then delete it, and check that the callback gets called and
+ # the reference dies.
+ coderef = weakref.ref(f.__code__, callback)
+ self.assertTrue(bool(coderef()))
+ del f
+ self.assertFalse(bool(coderef()))
+ self.assertTrue(self.called)
+
+
def test_main(verbose=None):
- from test.test_support import run_doctest
+ from test.test_support import run_doctest, run_unittest
from test import test_code
run_doctest(test_code, verbose)
+ run_unittest(CodeTest, CodeWeakRefTest)
-if __name__ == '__main__':
+if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_codeccallbacks.py b/Lib/test/test_codeccallbacks.py
index 69c8f94ad3..4825f43ff0 100644
--- a/Lib/test/test_codeccallbacks.py
+++ b/Lib/test/test_codeccallbacks.py
@@ -186,7 +186,7 @@ class CodecCallbackTest(unittest.TestCase):
charmap = dict([ (ord(c), 2*c.upper()) for c in "abcdefgh"])
sin = u"abc"
sout = "AABBCC"
- self.assertEquals(codecs.charmap_encode(sin, "strict", charmap)[0], sout)
+ self.assertEqual(codecs.charmap_encode(sin, "strict", charmap)[0], sout)
sin = u"abcA"
self.assertRaises(UnicodeError, codecs.charmap_encode, sin, "strict", charmap)
@@ -194,7 +194,7 @@ class CodecCallbackTest(unittest.TestCase):
charmap[ord("?")] = "XYZ"
sin = u"abcDEF"
sout = "AABBCCXYZXYZXYZ"
- self.assertEquals(codecs.charmap_encode(sin, "replace", charmap)[0], sout)
+ self.assertEqual(codecs.charmap_encode(sin, "replace", charmap)[0], sout)
charmap[ord("?")] = u"XYZ"
self.assertRaises(TypeError, codecs.charmap_encode, sin, "replace", charmap)
@@ -327,7 +327,7 @@ class CodecCallbackTest(unittest.TestCase):
# check with the correct number and type of arguments
exc = exctype(*args)
- self.assertEquals(str(exc), msg)
+ self.assertEqual(str(exc), msg)
def test_unicodeencodeerror(self):
self.check_exceptionobjectargs(
@@ -437,15 +437,15 @@ class CodecCallbackTest(unittest.TestCase):
UnicodeError("ouch")
)
# If the correct exception is passed in, "ignore" returns an empty replacement
- self.assertEquals(
+ self.assertEqual(
codecs.ignore_errors(UnicodeEncodeError("ascii", u"\u3042", 0, 1, "ouch")),
(u"", 1)
)
- self.assertEquals(
+ self.assertEqual(
codecs.ignore_errors(UnicodeDecodeError("ascii", "\xff", 0, 1, "ouch")),
(u"", 1)
)
- self.assertEquals(
+ self.assertEqual(
codecs.ignore_errors(UnicodeTranslateError(u"\u3042", 0, 1, "ouch")),
(u"", 1)
)
@@ -474,15 +474,15 @@ class CodecCallbackTest(unittest.TestCase):
BadObjectUnicodeDecodeError()
)
# With the correct exception, "replace" returns an "?" or u"\ufffd" replacement
- self.assertEquals(
+ self.assertEqual(
codecs.replace_errors(UnicodeEncodeError("ascii", u"\u3042", 0, 1, "ouch")),
(u"?", 1)
)
- self.assertEquals(
+ self.assertEqual(
codecs.replace_errors(UnicodeDecodeError("ascii", "\xff", 0, 1, "ouch")),
(u"\ufffd", 1)
)
- self.assertEquals(
+ self.assertEqual(
codecs.replace_errors(UnicodeTranslateError(u"\u3042", 0, 1, "ouch")),
(u"\ufffd", 1)
)
@@ -514,7 +514,7 @@ class CodecCallbackTest(unittest.TestCase):
# Use the correct exception
cs = (0, 1, 9, 10, 99, 100, 999, 1000, 9999, 10000, 0x3042)
s = "".join(unichr(c) for c in cs)
- self.assertEquals(
+ self.assertEqual(
codecs.xmlcharrefreplace_errors(
UnicodeEncodeError("ascii", s, 0, len(s), "ouch")
),
@@ -546,32 +546,32 @@ class CodecCallbackTest(unittest.TestCase):
UnicodeTranslateError(u"\u3042", 0, 1, "ouch")
)
# Use the correct exception
- self.assertEquals(
+ self.assertEqual(
codecs.backslashreplace_errors(UnicodeEncodeError("ascii", u"\u3042", 0, 1, "ouch")),
(u"\\u3042", 1)
)
- self.assertEquals(
+ self.assertEqual(
codecs.backslashreplace_errors(UnicodeEncodeError("ascii", u"\x00", 0, 1, "ouch")),
(u"\\x00", 1)
)
- self.assertEquals(
+ self.assertEqual(
codecs.backslashreplace_errors(UnicodeEncodeError("ascii", u"\xff", 0, 1, "ouch")),
(u"\\xff", 1)
)
- self.assertEquals(
+ self.assertEqual(
codecs.backslashreplace_errors(UnicodeEncodeError("ascii", u"\u0100", 0, 1, "ouch")),
(u"\\u0100", 1)
)
- self.assertEquals(
+ self.assertEqual(
codecs.backslashreplace_errors(UnicodeEncodeError("ascii", u"\uffff", 0, 1, "ouch")),
(u"\\uffff", 1)
)
if sys.maxunicode>0xffff:
- self.assertEquals(
+ self.assertEqual(
codecs.backslashreplace_errors(UnicodeEncodeError("ascii", u"\U00010000", 0, 1, "ouch")),
(u"\\U00010000", 1)
)
- self.assertEquals(
+ self.assertEqual(
codecs.backslashreplace_errors(UnicodeEncodeError("ascii", u"\U0010ffff", 0, 1, "ouch")),
(u"\\U0010ffff", 1)
)
@@ -581,7 +581,7 @@ class CodecCallbackTest(unittest.TestCase):
encs = ("ascii", "latin-1", "iso-8859-1", "iso-8859-15")
for res in results:
- codecs.register_error("test.badhandler", lambda: res)
+ codecs.register_error("test.badhandler", lambda x: res)
for enc in encs:
self.assertRaises(
TypeError,
@@ -603,14 +603,14 @@ class CodecCallbackTest(unittest.TestCase):
)
def test_lookup(self):
- self.assertEquals(codecs.strict_errors, codecs.lookup_error("strict"))
- self.assertEquals(codecs.ignore_errors, codecs.lookup_error("ignore"))
- self.assertEquals(codecs.strict_errors, codecs.lookup_error("strict"))
- self.assertEquals(
+ self.assertEqual(codecs.strict_errors, codecs.lookup_error("strict"))
+ self.assertEqual(codecs.ignore_errors, codecs.lookup_error("ignore"))
+ self.assertEqual(codecs.strict_errors, codecs.lookup_error("strict"))
+ self.assertEqual(
codecs.xmlcharrefreplace_errors,
codecs.lookup_error("xmlcharrefreplace")
)
- self.assertEquals(
+ self.assertEqual(
codecs.backslashreplace_errors,
codecs.lookup_error("backslashreplace")
)
@@ -686,11 +686,11 @@ class CodecCallbackTest(unittest.TestCase):
# Valid negative position
handler.pos = -1
- self.assertEquals("\xff0".decode("ascii", "test.posreturn"), u"<?>0")
+ self.assertEqual("\xff0".decode("ascii", "test.posreturn"), u"<?>0")
# Valid negative position
handler.pos = -2
- self.assertEquals("\xff0".decode("ascii", "test.posreturn"), u"<?><?>")
+ self.assertEqual("\xff0".decode("ascii", "test.posreturn"), u"<?><?>")
# Negative position out of bounds
handler.pos = -3
@@ -698,11 +698,11 @@ class CodecCallbackTest(unittest.TestCase):
# Valid positive position
handler.pos = 1
- self.assertEquals("\xff0".decode("ascii", "test.posreturn"), u"<?>0")
+ self.assertEqual("\xff0".decode("ascii", "test.posreturn"), u"<?>0")
# Largest valid positive position (one beyond end of input)
handler.pos = 2
- self.assertEquals("\xff0".decode("ascii", "test.posreturn"), u"<?>")
+ self.assertEqual("\xff0".decode("ascii", "test.posreturn"), u"<?>")
# Invalid positive position
handler.pos = 3
@@ -710,7 +710,7 @@ class CodecCallbackTest(unittest.TestCase):
# Restart at the "0"
handler.pos = 6
- self.assertEquals("\\uyyyy0".decode("raw-unicode-escape", "test.posreturn"), u"<?>0")
+ self.assertEqual("\\uyyyy0".decode("raw-unicode-escape", "test.posreturn"), u"<?>0")
class D(dict):
def __getitem__(self, key):
@@ -740,11 +740,11 @@ class CodecCallbackTest(unittest.TestCase):
# Valid negative position
handler.pos = -1
- self.assertEquals(u"\xff0".encode("ascii", "test.posreturn"), "<?>0")
+ self.assertEqual(u"\xff0".encode("ascii", "test.posreturn"), "<?>0")
# Valid negative position
handler.pos = -2
- self.assertEquals(u"\xff0".encode("ascii", "test.posreturn"), "<?><?>")
+ self.assertEqual(u"\xff0".encode("ascii", "test.posreturn"), "<?><?>")
# Negative position out of bounds
handler.pos = -3
@@ -752,11 +752,11 @@ class CodecCallbackTest(unittest.TestCase):
# Valid positive position
handler.pos = 1
- self.assertEquals(u"\xff0".encode("ascii", "test.posreturn"), "<?>0")
+ self.assertEqual(u"\xff0".encode("ascii", "test.posreturn"), "<?>0")
# Largest valid positive position (one beyond end of input
handler.pos = 2
- self.assertEquals(u"\xff0".encode("ascii", "test.posreturn"), "<?>")
+ self.assertEqual(u"\xff0".encode("ascii", "test.posreturn"), "<?>")
# Invalid positive position
handler.pos = 3
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index 4d03ae735d..f7f27cc7d9 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -263,11 +263,11 @@ class UTF32Test(ReadTest):
f.write(u"spam")
d = s.getvalue()
# check whether there is exactly one BOM in it
- self.assert_(d == self.spamle or d == self.spambe)
+ self.assertTrue(d == self.spamle or d == self.spambe)
# try to read it back
s = StringIO.StringIO(d)
f = reader(s)
- self.assertEquals(f.read(), u"spamspam")
+ self.assertEqual(f.read(), u"spamspam")
def test_badbom(self):
s = StringIO.StringIO(4*"\xff")
@@ -421,11 +421,11 @@ class UTF16Test(ReadTest):
f.write(u"spam")
d = s.getvalue()
# check whether there is exactly one BOM in it
- self.assert_(d == self.spamle or d == self.spambe)
+ self.assertTrue(d == self.spamle or d == self.spambe)
# try to read it back
s = StringIO.StringIO(d)
f = reader(s)
- self.assertEquals(f.read(), u"spamspam")
+ self.assertEqual(f.read(), u"spamspam")
def test_badbom(self):
s = StringIO.StringIO("\xff\xff")
@@ -469,13 +469,11 @@ class UTF16Test(ReadTest):
s1 = u'Hello\r\nworld\r\n'
s = s1.encode(self.encoding)
- try:
- with open(test_support.TESTFN, 'wb') as fp:
- fp.write(s)
- with codecs.open(test_support.TESTFN, 'U', encoding=self.encoding) as reader:
- self.assertEqual(reader.read(), s1)
- finally:
- test_support.unlink(test_support.TESTFN)
+ self.addCleanup(test_support.unlink, test_support.TESTFN)
+ with open(test_support.TESTFN, 'wb') as fp:
+ fp.write(s)
+ with codecs.open(test_support.TESTFN, 'U', encoding=self.encoding) as reader:
+ self.assertEqual(reader.read(), s1)
class UTF16LETest(ReadTest):
encoding = "utf-16-le"
@@ -673,7 +671,7 @@ class UTF8SigTest(ReadTest):
class EscapeDecodeTest(unittest.TestCase):
def test_empty(self):
- self.assertEquals(codecs.escape_decode(""), ("", 0))
+ self.assertEqual(codecs.escape_decode(""), ("", 0))
class RecodingTest(unittest.TestCase):
def test_recoding(self):
@@ -800,11 +798,11 @@ class PunycodeTest(unittest.TestCase):
# code produces only lower case. Converting just puny to
# lower is also insufficient, since some of the input characters
# are upper case.
- self.assertEquals(uni.encode("punycode").lower(), puny.lower())
+ self.assertEqual(uni.encode("punycode").lower(), puny.lower())
def test_decode(self):
for uni, puny in punycode_testcases:
- self.assertEquals(uni, puny.decode("punycode"))
+ self.assertEqual(uni, puny.decode("punycode"))
class UnicodeInternalTest(unittest.TestCase):
def test_bug1251300(self):
@@ -826,7 +824,7 @@ class UnicodeInternalTest(unittest.TestCase):
for internal, uni in ok:
if sys.byteorder == "little":
internal = "".join(reversed(internal))
- self.assertEquals(uni, internal.decode("unicode_internal"))
+ self.assertEqual(uni, internal.decode("unicode_internal"))
for internal in not_ok:
if sys.byteorder == "little":
internal = "".join(reversed(internal))
@@ -838,10 +836,10 @@ class UnicodeInternalTest(unittest.TestCase):
try:
"\x00\x00\x00\x00\x00\x11\x11\x00".decode("unicode_internal")
except UnicodeDecodeError, ex:
- self.assertEquals("unicode_internal", ex.encoding)
- self.assertEquals("\x00\x00\x00\x00\x00\x11\x11\x00", ex.object)
- self.assertEquals(4, ex.start)
- self.assertEquals(8, ex.end)
+ self.assertEqual("unicode_internal", ex.encoding)
+ self.assertEqual("\x00\x00\x00\x00\x00\x11\x11\x00", ex.object)
+ self.assertEqual(4, ex.start)
+ self.assertEqual(8, ex.end)
else:
self.fail()
@@ -852,10 +850,16 @@ class UnicodeInternalTest(unittest.TestCase):
ab = u"ab".encode("unicode_internal")
ignored = decoder("%s\x22\x22\x22\x22%s" % (ab[:4], ab[4:]),
"UnicodeInternalTest")
- self.assertEquals((u"ab", 12), ignored)
+ self.assertEqual((u"ab", 12), ignored)
+
+ def test_encode_length(self):
+ # Issue 3739
+ encoder = codecs.getencoder("unicode_internal")
+ self.assertEqual(encoder(u"a")[1], 1)
+ self.assertEqual(encoder(u"\xe9\u0142")[1], 2)
encoder = codecs.getencoder("string-escape")
- self.assertEquals(encoder(r'\x00')[1], 4)
+ self.assertEqual(encoder(r'\x00')[1], 4)
# From http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html
nameprep_tests = [
@@ -1026,102 +1030,102 @@ class NameprepTest(unittest.TestCase):
else:
prepped = unicode(prepped, "utf-8")
try:
- self.assertEquals(nameprep(orig), prepped)
+ self.assertEqual(nameprep(orig), prepped)
except Exception,e:
raise test_support.TestFailed("Test 3.%d: %s" % (pos+1, str(e)))
class IDNACodecTest(unittest.TestCase):
def test_builtin_decode(self):
- self.assertEquals(unicode("python.org", "idna"), u"python.org")
- self.assertEquals(unicode("python.org.", "idna"), u"python.org.")
- self.assertEquals(unicode("xn--pythn-mua.org", "idna"), u"pyth\xf6n.org")
- self.assertEquals(unicode("xn--pythn-mua.org.", "idna"), u"pyth\xf6n.org.")
+ self.assertEqual(unicode("python.org", "idna"), u"python.org")
+ self.assertEqual(unicode("python.org.", "idna"), u"python.org.")
+ self.assertEqual(unicode("xn--pythn-mua.org", "idna"), u"pyth\xf6n.org")
+ self.assertEqual(unicode("xn--pythn-mua.org.", "idna"), u"pyth\xf6n.org.")
def test_builtin_encode(self):
- self.assertEquals(u"python.org".encode("idna"), "python.org")
- self.assertEquals("python.org.".encode("idna"), "python.org.")
- self.assertEquals(u"pyth\xf6n.org".encode("idna"), "xn--pythn-mua.org")
- self.assertEquals(u"pyth\xf6n.org.".encode("idna"), "xn--pythn-mua.org.")
+ self.assertEqual(u"python.org".encode("idna"), "python.org")
+ self.assertEqual("python.org.".encode("idna"), "python.org.")
+ self.assertEqual(u"pyth\xf6n.org".encode("idna"), "xn--pythn-mua.org")
+ self.assertEqual(u"pyth\xf6n.org.".encode("idna"), "xn--pythn-mua.org.")
def test_stream(self):
import StringIO
r = codecs.getreader("idna")(StringIO.StringIO("abc"))
r.read(3)
- self.assertEquals(r.read(), u"")
+ self.assertEqual(r.read(), u"")
def test_incremental_decode(self):
- self.assertEquals(
+ self.assertEqual(
"".join(codecs.iterdecode("python.org", "idna")),
u"python.org"
)
- self.assertEquals(
+ self.assertEqual(
"".join(codecs.iterdecode("python.org.", "idna")),
u"python.org."
)
- self.assertEquals(
+ self.assertEqual(
"".join(codecs.iterdecode("xn--pythn-mua.org.", "idna")),
u"pyth\xf6n.org."
)
- self.assertEquals(
+ self.assertEqual(
"".join(codecs.iterdecode("xn--pythn-mua.org.", "idna")),
u"pyth\xf6n.org."
)
decoder = codecs.getincrementaldecoder("idna")()
- self.assertEquals(decoder.decode("xn--xam", ), u"")
- self.assertEquals(decoder.decode("ple-9ta.o", ), u"\xe4xample.")
- self.assertEquals(decoder.decode(u"rg"), u"")
- self.assertEquals(decoder.decode(u"", True), u"org")
+ self.assertEqual(decoder.decode("xn--xam", ), u"")
+ self.assertEqual(decoder.decode("ple-9ta.o", ), u"\xe4xample.")
+ self.assertEqual(decoder.decode(u"rg"), u"")
+ self.assertEqual(decoder.decode(u"", True), u"org")
decoder.reset()
- self.assertEquals(decoder.decode("xn--xam", ), u"")
- self.assertEquals(decoder.decode("ple-9ta.o", ), u"\xe4xample.")
- self.assertEquals(decoder.decode("rg."), u"org.")
- self.assertEquals(decoder.decode("", True), u"")
+ self.assertEqual(decoder.decode("xn--xam", ), u"")
+ self.assertEqual(decoder.decode("ple-9ta.o", ), u"\xe4xample.")
+ self.assertEqual(decoder.decode("rg."), u"org.")
+ self.assertEqual(decoder.decode("", True), u"")
def test_incremental_encode(self):
- self.assertEquals(
+ self.assertEqual(
"".join(codecs.iterencode(u"python.org", "idna")),
"python.org"
)
- self.assertEquals(
+ self.assertEqual(
"".join(codecs.iterencode(u"python.org.", "idna")),
"python.org."
)
- self.assertEquals(
+ self.assertEqual(
"".join(codecs.iterencode(u"pyth\xf6n.org.", "idna")),
"xn--pythn-mua.org."
)
- self.assertEquals(
+ self.assertEqual(
"".join(codecs.iterencode(u"pyth\xf6n.org.", "idna")),
"xn--pythn-mua.org."
)
encoder = codecs.getincrementalencoder("idna")()
- self.assertEquals(encoder.encode(u"\xe4x"), "")
- self.assertEquals(encoder.encode(u"ample.org"), "xn--xample-9ta.")
- self.assertEquals(encoder.encode(u"", True), "org")
+ self.assertEqual(encoder.encode(u"\xe4x"), "")
+ self.assertEqual(encoder.encode(u"ample.org"), "xn--xample-9ta.")
+ self.assertEqual(encoder.encode(u"", True), "org")
encoder.reset()
- self.assertEquals(encoder.encode(u"\xe4x"), "")
- self.assertEquals(encoder.encode(u"ample.org."), "xn--xample-9ta.org.")
- self.assertEquals(encoder.encode(u"", True), "")
+ self.assertEqual(encoder.encode(u"\xe4x"), "")
+ self.assertEqual(encoder.encode(u"ample.org."), "xn--xample-9ta.org.")
+ self.assertEqual(encoder.encode(u"", True), "")
class CodecsModuleTest(unittest.TestCase):
def test_decode(self):
- self.assertEquals(codecs.decode('\xe4\xf6\xfc', 'latin-1'),
+ self.assertEqual(codecs.decode('\xe4\xf6\xfc', 'latin-1'),
u'\xe4\xf6\xfc')
self.assertRaises(TypeError, codecs.decode)
- self.assertEquals(codecs.decode('abc'), u'abc')
+ self.assertEqual(codecs.decode('abc'), u'abc')
self.assertRaises(UnicodeDecodeError, codecs.decode, '\xff', 'ascii')
def test_encode(self):
- self.assertEquals(codecs.encode(u'\xe4\xf6\xfc', 'latin-1'),
+ self.assertEqual(codecs.encode(u'\xe4\xf6\xfc', 'latin-1'),
'\xe4\xf6\xfc')
self.assertRaises(TypeError, codecs.encode)
self.assertRaises(LookupError, codecs.encode, "foo", "__spam__")
- self.assertEquals(codecs.encode(u'abc'), 'abc')
+ self.assertEqual(codecs.encode(u'abc'), 'abc')
self.assertRaises(UnicodeEncodeError, codecs.encode, u'\xffff', 'ascii')
def test_register(self):
@@ -1157,19 +1161,19 @@ class StreamReaderTest(unittest.TestCase):
def test_readlines(self):
f = self.reader(self.stream)
- self.assertEquals(f.readlines(), [u'\ud55c\n', u'\uae00'])
+ self.assertEqual(f.readlines(), [u'\ud55c\n', u'\uae00'])
class EncodedFileTest(unittest.TestCase):
def test_basic(self):
f = StringIO.StringIO('\xed\x95\x9c\n\xea\xb8\x80')
ef = codecs.EncodedFile(f, 'utf-16-le', 'utf-8')
- self.assertEquals(ef.read(), '\\\xd5\n\x00\x00\xae')
+ self.assertEqual(ef.read(), '\\\xd5\n\x00\x00\xae')
f = StringIO.StringIO()
ef = codecs.EncodedFile(f, 'utf-8', 'latin1')
ef.write('\xc3\xbc')
- self.assertEquals(f.getvalue(), '\xfc')
+ self.assertEqual(f.getvalue(), '\xfc')
class Str2StrTest(unittest.TestCase):
@@ -1178,14 +1182,14 @@ class Str2StrTest(unittest.TestCase):
reader = codecs.getreader("base64_codec")(StringIO.StringIO(sin))
sout = reader.read()
self.assertEqual(sout, "\x80")
- self.assert_(isinstance(sout, str))
+ self.assertIsInstance(sout, str)
def test_readline(self):
sin = "\x80".encode("base64_codec")
reader = codecs.getreader("base64_codec")(StringIO.StringIO(sin))
sout = reader.readline()
self.assertEqual(sout, "\x80")
- self.assert_(isinstance(sout, str))
+ self.assertIsInstance(sout, str)
all_unicode_encodings = [
"ascii",
@@ -1209,6 +1213,7 @@ all_unicode_encodings = [
"cp424",
"cp437",
"cp500",
+ "cp720",
"cp737",
"cp775",
"cp850",
@@ -1216,6 +1221,7 @@ all_unicode_encodings = [
"cp855",
"cp856",
"cp857",
+ "cp858",
"cp860",
"cp861",
"cp862",
@@ -1347,8 +1353,7 @@ class BasicUnicodeTest(unittest.TestCase):
name = "latin_1"
self.assertEqual(encoding.replace("_", "-"), name.replace("_", "-"))
(bytes, size) = codecs.getencoder(encoding)(s)
- if encoding != "unicode_internal":
- self.assertEqual(size, len(s), "%r != %r (encoding=%r)" % (size, len(s), encoding))
+ self.assertEqual(size, len(s), "%r != %r (encoding=%r)" % (size, len(s), encoding))
(chars, size) = codecs.getdecoder(encoding)(bytes)
self.assertEqual(chars, s, "%r != %r (encoding=%r)" % (chars, s, encoding))
@@ -1471,33 +1476,33 @@ class BasicStrTest(unittest.TestCase):
class CharmapTest(unittest.TestCase):
def test_decode_with_string_map(self):
- self.assertEquals(
+ self.assertEqual(
codecs.charmap_decode("\x00\x01\x02", "strict", u"abc"),
(u"abc", 3)
)
- self.assertEquals(
+ self.assertEqual(
codecs.charmap_decode("\x00\x01\x02", "replace", u"ab"),
(u"ab\ufffd", 3)
)
- self.assertEquals(
+ self.assertEqual(
codecs.charmap_decode("\x00\x01\x02", "replace", u"ab\ufffe"),
(u"ab\ufffd", 3)
)
- self.assertEquals(
+ self.assertEqual(
codecs.charmap_decode("\x00\x01\x02", "ignore", u"ab"),
(u"ab", 3)
)
- self.assertEquals(
+ self.assertEqual(
codecs.charmap_decode("\x00\x01\x02", "ignore", u"ab\ufffe"),
(u"ab", 3)
)
allbytes = "".join(chr(i) for i in xrange(256))
- self.assertEquals(
+ self.assertEqual(
codecs.charmap_decode(allbytes, "ignore", u""),
(u"", len(allbytes))
)
@@ -1506,14 +1511,14 @@ class WithStmtTest(unittest.TestCase):
def test_encodedfile(self):
f = StringIO.StringIO("\xc3\xbc")
with codecs.EncodedFile(f, "latin-1", "utf-8") as ef:
- self.assertEquals(ef.read(), "\xfc")
+ self.assertEqual(ef.read(), "\xfc")
def test_streamreaderwriter(self):
f = StringIO.StringIO("\xc3\xbc")
info = codecs.lookup("utf-8")
with codecs.StreamReaderWriter(f, info.streamreader,
info.streamwriter, 'strict') as srw:
- self.assertEquals(srw.read(), u"\xfc")
+ self.assertEqual(srw.read(), u"\xfc")
class BomTest(unittest.TestCase):
@@ -1525,33 +1530,34 @@ class BomTest(unittest.TestCase):
"utf-32",
"utf-32-le",
"utf-32-be")
+ self.addCleanup(test_support.unlink, test_support.TESTFN)
for encoding in tests:
# Check if the BOM is written only once
with codecs.open(test_support.TESTFN, 'w+', encoding=encoding) as f:
f.write(data)
f.write(data)
f.seek(0)
- self.assertEquals(f.read(), data * 2)
+ self.assertEqual(f.read(), data * 2)
f.seek(0)
- self.assertEquals(f.read(), data * 2)
+ self.assertEqual(f.read(), data * 2)
# Check that the BOM is written after a seek(0)
with codecs.open(test_support.TESTFN, 'w+', encoding=encoding) as f:
f.write(data[0])
- self.assertNotEquals(f.tell(), 0)
+ self.assertNotEqual(f.tell(), 0)
f.seek(0)
f.write(data)
f.seek(0)
- self.assertEquals(f.read(), data)
+ self.assertEqual(f.read(), data)
# (StreamWriter) Check that the BOM is written after a seek(0)
with codecs.open(test_support.TESTFN, 'w+', encoding=encoding) as f:
f.writer.write(data[0])
- self.assertNotEquals(f.writer.tell(), 0)
+ self.assertNotEqual(f.writer.tell(), 0)
f.writer.seek(0)
f.writer.write(data)
f.seek(0)
- self.assertEquals(f.read(), data)
+ self.assertEqual(f.read(), data)
# Check that the BOM is not written after a seek() at a position
# different than the start
@@ -1560,7 +1566,7 @@ class BomTest(unittest.TestCase):
f.seek(f.tell())
f.write(data)
f.seek(0)
- self.assertEquals(f.read(), data * 2)
+ self.assertEqual(f.read(), data * 2)
# (StreamWriter) Check that the BOM is not written after a seek()
# at a position different than the start
@@ -1569,7 +1575,7 @@ class BomTest(unittest.TestCase):
f.writer.seek(f.writer.tell())
f.writer.write(data)
f.seek(0)
- self.assertEquals(f.read(), data * 2)
+ self.assertEqual(f.read(), data * 2)
def test_main():
diff --git a/Lib/test/test_codeop.py b/Lib/test/test_codeop.py
index fff969cb6b..99fe6f933e 100644
--- a/Lib/test/test_codeop.py
+++ b/Lib/test/test_codeop.py
@@ -23,7 +23,7 @@ class CodeopTests(unittest.TestCase):
'''succeed iff str is a valid piece of code'''
if is_jython:
code = compile_command(str, "<input>", symbol)
- self.assert_(code)
+ self.assertTrue(code)
if symbol == "single":
d,r = {},{}
saved_stdout = sys.stdout
@@ -37,14 +37,14 @@ class CodeopTests(unittest.TestCase):
ctx = {'a': 2}
d = { 'value': eval(code,ctx) }
r = { 'value': eval(str,ctx) }
- self.assertEquals(unify_callables(r),unify_callables(d))
+ self.assertEqual(unify_callables(r),unify_callables(d))
else:
expected = compile(str, "<input>", symbol, PyCF_DONT_IMPLY_DEDENT)
- self.assertEquals( compile_command(str, "<input>", symbol), expected)
+ self.assertEqual(compile_command(str, "<input>", symbol), expected)
def assertIncomplete(self, str, symbol='single'):
'''succeed iff str is the start of a valid piece of code'''
- self.assertEquals( compile_command(str, symbol=symbol), None)
+ self.assertEqual(compile_command(str, symbol=symbol), None)
def assertInvalid(self, str, symbol='single', is_syntax=1):
'''succeed iff str is the start of an invalid piece of code'''
@@ -52,21 +52,21 @@ class CodeopTests(unittest.TestCase):
compile_command(str,symbol=symbol)
self.fail("No exception thrown for invalid code")
except SyntaxError:
- self.assert_(is_syntax)
+ self.assertTrue(is_syntax)
except OverflowError:
- self.assert_(not is_syntax)
+ self.assertTrue(not is_syntax)
def test_valid(self):
av = self.assertValid
# special case
if not is_jython:
- self.assertEquals(compile_command(""),
- compile("pass", "<input>", 'single',
- PyCF_DONT_IMPLY_DEDENT))
- self.assertEquals(compile_command("\n"),
- compile("pass", "<input>", 'single',
- PyCF_DONT_IMPLY_DEDENT))
+ self.assertEqual(compile_command(""),
+ compile("pass", "<input>", 'single',
+ PyCF_DONT_IMPLY_DEDENT))
+ self.assertEqual(compile_command("\n"),
+ compile("pass", "<input>", 'single',
+ PyCF_DONT_IMPLY_DEDENT))
else:
av("")
av("\n")
@@ -290,14 +290,10 @@ class CodeopTests(unittest.TestCase):
ai("[i for i in range(10)] = (1, 2, 3)")
def test_filename(self):
- self.assertEquals(compile_command("a = 1\n", "abc").co_filename,
- compile("a = 1\n", "abc", 'single').co_filename)
- self.assertNotEquals(compile_command("a = 1\n", "abc").co_filename,
- compile("a = 1\n", "def", 'single').co_filename)
-
- def test_no_universal_newlines(self):
- code = compile_command("'\rfoo\r'", symbol='eval')
- self.assertEqual(eval(code), '\rfoo\r')
+ self.assertEqual(compile_command("a = 1\n", "abc").co_filename,
+ compile("a = 1\n", "abc", 'single').co_filename)
+ self.assertNotEqual(compile_command("a = 1\n", "abc").co_filename,
+ compile("a = 1\n", "def", 'single').co_filename)
def test_main():
diff --git a/Lib/test/test_coding.py b/Lib/test/test_coding.py
index e83015e543..7f5ddb1934 100644
--- a/Lib/test/test_coding.py
+++ b/Lib/test/test_coding.py
@@ -16,11 +16,20 @@ class CodingTest(unittest.TestCase):
path = os.path.dirname(__file__)
filename = os.path.join(path, module_name + '.py')
- fp = open(filename)
- text = fp.read()
- fp.close()
+ with open(filename) as fp:
+ text = fp.read()
self.assertRaises(SyntaxError, compile, text, filename, 'exec')
+ def test_error_from_string(self):
+ # See http://bugs.python.org/issue6289
+ input = u"# coding: ascii\n\N{SNOWMAN}".encode('utf-8')
+ with self.assertRaises(SyntaxError) as c:
+ compile(input, "<string>", "exec")
+ expected = "'ascii' codec can't decode byte 0xe2 in position 16: " \
+ "ordinal not in range(128)"
+ self.assertTrue(c.exception.args[0].startswith(expected))
+
+
def test_main():
test.test_support.run_unittest(CodingTest)
diff --git a/Lib/test/test_coercion.py b/Lib/test/test_coercion.py
index d842ee9e1e..2b55c419ab 100644
--- a/Lib/test/test_coercion.py
+++ b/Lib/test/test_coercion.py
@@ -266,9 +266,9 @@ class CoercionTest(unittest.TestCase):
self.assertRaises(TypeError, eval,
'a %s b' % op, {'a': a, 'b': b})
else:
- self.assertEquals(format_result(res),
- format_result(eval('a %s b' % op)),
- '%s %s %s == %s failed' % (a, op, b, res))
+ self.assertEqual(format_result(res),
+ format_result(eval('a %s b' % op)),
+ '%s %s %s == %s failed' % (a, op, b, res))
try:
z = copy.copy(a)
except copy.Error:
@@ -282,7 +282,7 @@ class CoercionTest(unittest.TestCase):
self.fail("TypeError not raised")
else:
exec('z %s= b' % op)
- self.assertEquals(ires, z)
+ self.assertEqual(ires, z)
def test_prefix_binops(self):
for ia, a in enumerate(candidates):
@@ -293,9 +293,9 @@ class CoercionTest(unittest.TestCase):
self.assertRaises(TypeError, eval,
'%s(a, b)' % op, {'a': a, 'b': b})
else:
- self.assertEquals(format_result(res),
- format_result(eval('%s(a, b)' % op)),
- '%s(%s, %s) == %s failed' % (op, a, b, res))
+ self.assertEqual(format_result(res),
+ format_result(eval('%s(a, b)' % op)),
+ '%s(%s, %s) == %s failed' % (op, a, b, res))
def test_cmptypes(self):
# Built-in tp_compare slots expect their arguments to have the
@@ -303,21 +303,21 @@ class CoercionTest(unittest.TestCase):
# SF #980352
evil_coercer = CoerceTo(42)
# Make sure these don't crash any more
- self.assertNotEquals(cmp(u'fish', evil_coercer), 0)
- self.assertNotEquals(cmp(slice(1), evil_coercer), 0)
+ self.assertNotEqual(cmp(u'fish', evil_coercer), 0)
+ self.assertNotEqual(cmp(slice(1), evil_coercer), 0)
# ...but that this still works
class WackyComparer(object):
def __cmp__(slf, other):
- self.assert_(other == 42, 'expected evil_coercer, got %r' % other)
+ self.assertTrue(other == 42, 'expected evil_coercer, got %r' % other)
return 0
__hash__ = None # Invalid cmp makes this unhashable
- self.assertEquals(cmp(WackyComparer(), evil_coercer), 0)
+ self.assertEqual(cmp(WackyComparer(), evil_coercer), 0)
# ...and classic classes too, since that code path is a little different
class ClassicWackyComparer:
def __cmp__(slf, other):
- self.assert_(other == 42, 'expected evil_coercer, got %r' % other)
+ self.assertTrue(other == 42, 'expected evil_coercer, got %r' % other)
return 0
- self.assertEquals(cmp(ClassicWackyComparer(), evil_coercer), 0)
+ self.assertEqual(cmp(ClassicWackyComparer(), evil_coercer), 0)
def test_infinite_rec_classic_classes(self):
# if __coerce__() returns its arguments reversed it causes an infinite
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index f48ae5a4c2..8bdeb3d8f1 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -1,9 +1,14 @@
+
import unittest, doctest, operator
+import inspect
from test import test_support
-from collections import namedtuple
+from collections import namedtuple, Counter, OrderedDict
+from test import mapping_tests
import pickle, cPickle, copy
+from random import randrange, shuffle
import keyword
import re
+import sys
from collections import Hashable, Iterable, Iterator
from collections import Sized, Container, Callable
from collections import Set, MutableSet
@@ -17,7 +22,6 @@ class TestNamedTuple(unittest.TestCase):
def test_factory(self):
Point = namedtuple('Point', 'x y')
self.assertEqual(Point.__name__, 'Point')
- self.assertEqual(Point.__doc__, 'Point(x, y)')
self.assertEqual(Point.__slots__, ())
self.assertEqual(Point.__module__, __name__)
self.assertEqual(Point.__getitem__, tuple.__getitem__)
@@ -37,13 +41,30 @@ class TestNamedTuple(unittest.TestCase):
namedtuple('_', 'a b c') # Test leading underscores in a typename
nt = namedtuple('nt', u'the quick brown fox') # check unicode input
- self.assert_("u'" not in repr(nt._fields))
+ self.assertNotIn("u'", repr(nt._fields))
nt = namedtuple('nt', (u'the', u'quick')) # check unicode input
- self.assert_("u'" not in repr(nt._fields))
+ self.assertNotIn("u'", repr(nt._fields))
self.assertRaises(TypeError, Point._make, [11]) # catch too few args
self.assertRaises(TypeError, Point._make, [11, 22, 33]) # catch too many args
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_factory_doc_attr(self):
+ Point = namedtuple('Point', 'x y')
+ self.assertEqual(Point.__doc__, 'Point(x, y)')
+
+ def test_name_fixer(self):
+ for spec, renamed in [
+ [('efg', 'g%hi'), ('efg', '_1')], # field with non-alpha char
+ [('abc', 'class'), ('abc', '_1')], # field has keyword
+ [('8efg', '9ghi'), ('_0', '_1')], # field starts with digit
+ [('abc', '_efg'), ('abc', '_1')], # field with leading underscore
+ [('abc', 'efg', 'efg', 'ghi'), ('abc', 'efg', '_2', 'ghi')], # duplicate field
+ [('abc', '', 'x'), ('abc', '_1', 'x')], # fieldname is a space
+ ]:
+ self.assertEqual(namedtuple('NT', spec, rename=True)._fields, renamed)
+
def test_instance(self):
Point = namedtuple('Point', 'x y')
p = Point(11, 22)
@@ -57,8 +78,8 @@ class TestNamedTuple(unittest.TestCase):
self.assertRaises(TypeError, eval, 'Point(XXX=1, y=2)', locals()) # wrong keyword argument
self.assertRaises(TypeError, eval, 'Point(x=1)', locals()) # missing keyword argument
self.assertEqual(repr(p), 'Point(x=11, y=22)')
- self.assert_('__dict__' not in dir(p)) # verify instance has no dict
- self.assert_('__weakref__' not in dir(p))
+ self.assertNotIn('__dict__', dir(p)) # verify instance has no dict
+ self.assertNotIn('__weakref__', dir(p))
self.assertEqual(p, Point._make([11, 22])) # test _make classmethod
self.assertEqual(p._fields, ('x', 'y')) # test _fields attribute
self.assertEqual(p._replace(x=1), (1, 22)) # test _replace method
@@ -85,7 +106,7 @@ class TestNamedTuple(unittest.TestCase):
Point = namedtuple('Point', 'x y')
p = Point(11, 22)
- self.assert_(isinstance(p, tuple))
+ self.assertIsInstance(p, tuple)
self.assertEqual(p, (11, 22)) # matches a real tuple
self.assertEqual(tuple(p), (11, 22)) # coercable to a real tuple
self.assertEqual(list(p), [11, 22]) # coercable to a list
@@ -215,21 +236,21 @@ class ABCTestCase(unittest.TestCase):
# new-style class
C = type('C', (object,), {name: stub})
- self.assertTrue(isinstance(C(), abc))
+ self.assertIsInstance(C(), abc)
self.assertTrue(issubclass(C, abc))
# old-style class
class C: pass
setattr(C, name, stub)
- self.assertTrue(isinstance(C(), abc))
+ self.assertIsInstance(C(), abc)
self.assertTrue(issubclass(C, abc))
# new-style class
C = type('C', (object,), {'__hash__': None})
- self.assertFalse(isinstance(C(), abc))
+ self.assertNotIsInstance(C(), abc)
self.assertFalse(issubclass(C, abc))
# old-style class
class C: pass
- self.assertFalse(isinstance(C(), abc))
+ self.assertNotIsInstance(C(), abc)
self.assertFalse(issubclass(C, abc))
def validate_comparison(self, instance):
@@ -269,8 +290,8 @@ class TestOneTrickPonyABCs(ABCTestCase):
# Check some non-hashables
non_samples = [list(), set(), dict()]
for x in non_samples:
- self.failIf(isinstance(x, Hashable), repr(x))
- self.failIf(issubclass(type(x), Hashable), repr(type(x)))
+ self.assertNotIsInstance(x, Hashable)
+ self.assertFalse(issubclass(type(x), Hashable), repr(type(x)))
# Check some hashables
samples = [None,
int(), float(), complex(),
@@ -279,8 +300,8 @@ class TestOneTrickPonyABCs(ABCTestCase):
int, list, object, type,
]
for x in samples:
- self.failUnless(isinstance(x, Hashable), repr(x))
- self.failUnless(issubclass(type(x), Hashable), repr(type(x)))
+ self.assertIsInstance(x, Hashable)
+ self.assertTrue(issubclass(type(x), Hashable), repr(type(x)))
self.assertRaises(TypeError, Hashable)
# Check direct subclassing
class H(Hashable):
@@ -288,7 +309,7 @@ class TestOneTrickPonyABCs(ABCTestCase):
return super(H, self).__hash__()
__eq__ = Hashable.__eq__ # Silence Py3k warning
self.assertEqual(hash(H()), 0)
- self.failIf(issubclass(int, H))
+ self.assertFalse(issubclass(int, H))
self.validate_abstract_methods(Hashable, '__hash__')
self.validate_isinstance(Hashable, '__hash__')
@@ -296,8 +317,8 @@ class TestOneTrickPonyABCs(ABCTestCase):
# Check some non-iterables
non_samples = [None, 42, 3.14, 1j]
for x in non_samples:
- self.failIf(isinstance(x, Iterable), repr(x))
- self.failIf(issubclass(type(x), Iterable), repr(type(x)))
+ self.assertNotIsInstance(x, Iterable)
+ self.assertFalse(issubclass(type(x), Iterable), repr(type(x)))
# Check some iterables
samples = [str(),
tuple(), list(), set(), frozenset(), dict(),
@@ -306,14 +327,14 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in samples:
- self.failUnless(isinstance(x, Iterable), repr(x))
- self.failUnless(issubclass(type(x), Iterable), repr(type(x)))
+ self.assertIsInstance(x, Iterable)
+ self.assertTrue(issubclass(type(x), Iterable), repr(type(x)))
# Check direct subclassing
class I(Iterable):
def __iter__(self):
return super(I, self).__iter__()
self.assertEqual(list(I()), [])
- self.failIf(issubclass(str, I))
+ self.assertFalse(issubclass(str, I))
self.validate_abstract_methods(Iterable, '__iter__')
self.validate_isinstance(Iterable, '__iter__')
@@ -321,8 +342,8 @@ class TestOneTrickPonyABCs(ABCTestCase):
non_samples = [None, 42, 3.14, 1j, "".encode('ascii'), "", (), [],
{}, set()]
for x in non_samples:
- self.failIf(isinstance(x, Iterator), repr(x))
- self.failIf(issubclass(type(x), Iterator), repr(type(x)))
+ self.assertNotIsInstance(x, Iterator)
+ self.assertFalse(issubclass(type(x), Iterator), repr(type(x)))
samples = [iter(str()),
iter(tuple()), iter(list()), iter(dict()),
iter(set()), iter(frozenset()),
@@ -332,10 +353,21 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in samples:
- self.failUnless(isinstance(x, Iterator), repr(x))
- self.failUnless(issubclass(type(x), Iterator), repr(type(x)))
- self.validate_abstract_methods(Iterator, 'next')
- self.validate_isinstance(Iterator, 'next')
+ self.assertIsInstance(x, Iterator)
+ self.assertTrue(issubclass(type(x), Iterator), repr(type(x)))
+ self.validate_abstract_methods(Iterator, 'next', '__iter__')
+
+ # Issue 10565
+ class NextOnly:
+ def __next__(self):
+ yield 1
+ raise StopIteration
+ self.assertNotIsInstance(NextOnly(), Iterator)
+ class NextOnlyNew(object):
+ def __next__(self):
+ yield 1
+ raise StopIteration
+ self.assertNotIsInstance(NextOnlyNew(), Iterator)
def test_Sized(self):
non_samples = [None, 42, 3.14, 1j,
@@ -343,15 +375,15 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in non_samples:
- self.failIf(isinstance(x, Sized), repr(x))
- self.failIf(issubclass(type(x), Sized), repr(type(x)))
+ self.assertNotIsInstance(x, Sized)
+ self.assertFalse(issubclass(type(x), Sized), repr(type(x)))
samples = [str(),
tuple(), list(), set(), frozenset(), dict(),
dict().keys(), dict().items(), dict().values(),
]
for x in samples:
- self.failUnless(isinstance(x, Sized), repr(x))
- self.failUnless(issubclass(type(x), Sized), repr(type(x)))
+ self.assertIsInstance(x, Sized)
+ self.assertTrue(issubclass(type(x), Sized), repr(type(x)))
self.validate_abstract_methods(Sized, '__len__')
self.validate_isinstance(Sized, '__len__')
@@ -361,15 +393,15 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in non_samples:
- self.failIf(isinstance(x, Container), repr(x))
- self.failIf(issubclass(type(x), Container), repr(type(x)))
+ self.assertNotIsInstance(x, Container)
+ self.assertFalse(issubclass(type(x), Container), repr(type(x)))
samples = [str(),
tuple(), list(), set(), frozenset(), dict(),
dict().keys(), dict().items(),
]
for x in samples:
- self.failUnless(isinstance(x, Container), repr(x))
- self.failUnless(issubclass(type(x), Container), repr(type(x)))
+ self.assertIsInstance(x, Container)
+ self.assertTrue(issubclass(type(x), Container), repr(type(x)))
self.validate_abstract_methods(Container, '__contains__')
self.validate_isinstance(Container, '__contains__')
@@ -380,16 +412,16 @@ class TestOneTrickPonyABCs(ABCTestCase):
(x for x in []),
]
for x in non_samples:
- self.failIf(isinstance(x, Callable), repr(x))
- self.failIf(issubclass(type(x), Callable), repr(type(x)))
+ self.assertNotIsInstance(x, Callable)
+ self.assertFalse(issubclass(type(x), Callable), repr(type(x)))
samples = [lambda: None,
type, int, object,
len,
list.append, [].append,
]
for x in samples:
- self.failUnless(isinstance(x, Callable), repr(x))
- self.failUnless(issubclass(type(x), Callable), repr(type(x)))
+ self.assertIsInstance(x, Callable)
+ self.assertTrue(issubclass(type(x), Callable), repr(type(x)))
self.validate_abstract_methods(Callable, '__call__')
self.validate_isinstance(Callable, '__call__')
@@ -397,17 +429,17 @@ class TestOneTrickPonyABCs(ABCTestCase):
for B in Hashable, Iterable, Iterator, Sized, Container, Callable:
class C(B):
pass
- self.failUnless(issubclass(C, B))
- self.failIf(issubclass(int, C))
+ self.assertTrue(issubclass(C, B))
+ self.assertFalse(issubclass(int, C))
def test_registration(self):
for B in Hashable, Iterable, Iterator, Sized, Container, Callable:
class C:
__metaclass__ = type
__hash__ = None # Make sure it isn't hashable by default
- self.failIf(issubclass(C, B), B.__name__)
+ self.assertFalse(issubclass(C, B), B.__name__)
B.register(C)
- self.failUnless(issubclass(C, B))
+ self.assertTrue(issubclass(C, B))
class WithSet(MutableSet):
@@ -437,8 +469,8 @@ class TestCollectionABCs(ABCTestCase):
def test_Set(self):
for sample in [set, frozenset]:
- self.failUnless(isinstance(sample(), Set))
- self.failUnless(issubclass(sample, Set))
+ self.assertIsInstance(sample(), Set)
+ self.assertTrue(issubclass(sample, Set))
self.validate_abstract_methods(Set, '__contains__', '__iter__', '__len__')
class MySet(Set):
def __contains__(self, x):
@@ -462,13 +494,13 @@ class TestCollectionABCs(ABCTestCase):
def __hash__(self):
return self._hash()
a, b = OneTwoThreeSet(), OneTwoThreeSet()
- self.failUnless(hash(a) == hash(b))
+ self.assertTrue(hash(a) == hash(b))
def test_MutableSet(self):
- self.failUnless(isinstance(set(), MutableSet))
- self.failUnless(issubclass(set, MutableSet))
- self.failIf(isinstance(frozenset(), MutableSet))
- self.failIf(issubclass(frozenset, MutableSet))
+ self.assertIsInstance(set(), MutableSet)
+ self.assertTrue(issubclass(set, MutableSet))
+ self.assertNotIsInstance(frozenset(), MutableSet)
+ self.assertFalse(issubclass(frozenset, MutableSet))
self.validate_abstract_methods(MutableSet, '__contains__', '__iter__', '__len__',
'add', 'discard')
@@ -505,10 +537,25 @@ class TestCollectionABCs(ABCTestCase):
s = MySet([5,43,2,1])
self.assertEqual(s.pop(), 1)
+ def test_issue8750(self):
+ empty = WithSet()
+ full = WithSet(range(10))
+ s = WithSet(full)
+ s -= s
+ self.assertEqual(s, empty)
+ s = WithSet(full)
+ s ^= s
+ self.assertEqual(s, empty)
+ s = WithSet(full)
+ s &= s
+ self.assertEqual(s, full)
+ s |= s
+ self.assertEqual(s, full)
+
def test_Mapping(self):
for sample in [dict]:
- self.failUnless(isinstance(sample(), Mapping))
- self.failUnless(issubclass(sample, Mapping))
+ self.assertIsInstance(sample(), Mapping)
+ self.assertTrue(issubclass(sample, Mapping))
self.validate_abstract_methods(Mapping, '__contains__', '__iter__', '__len__',
'__getitem__')
class MyMapping(collections.Mapping):
@@ -522,38 +569,472 @@ class TestCollectionABCs(ABCTestCase):
def test_MutableMapping(self):
for sample in [dict]:
- self.failUnless(isinstance(sample(), MutableMapping))
- self.failUnless(issubclass(sample, MutableMapping))
+ self.assertIsInstance(sample(), MutableMapping)
+ self.assertTrue(issubclass(sample, MutableMapping))
self.validate_abstract_methods(MutableMapping, '__contains__', '__iter__', '__len__',
'__getitem__', '__setitem__', '__delitem__')
def test_Sequence(self):
for sample in [tuple, list, str]:
- self.failUnless(isinstance(sample(), Sequence))
- self.failUnless(issubclass(sample, Sequence))
- self.failUnless(issubclass(basestring, Sequence))
- self.failUnless(isinstance(range(10), Sequence))
- self.failUnless(issubclass(xrange, Sequence))
- self.failUnless(issubclass(str, Sequence))
+ self.assertIsInstance(sample(), Sequence)
+ self.assertTrue(issubclass(sample, Sequence))
+ self.assertTrue(issubclass(basestring, Sequence))
+ self.assertIsInstance(range(10), Sequence)
+ self.assertTrue(issubclass(xrange, Sequence))
+ self.assertTrue(issubclass(str, Sequence))
self.validate_abstract_methods(Sequence, '__contains__', '__iter__', '__len__',
'__getitem__')
def test_MutableSequence(self):
for sample in [tuple, str]:
- self.failIf(isinstance(sample(), MutableSequence))
- self.failIf(issubclass(sample, MutableSequence))
+ self.assertNotIsInstance(sample(), MutableSequence)
+ self.assertFalse(issubclass(sample, MutableSequence))
for sample in [list]:
- self.failUnless(isinstance(sample(), MutableSequence))
- self.failUnless(issubclass(sample, MutableSequence))
- self.failIf(issubclass(basestring, MutableSequence))
+ self.assertIsInstance(sample(), MutableSequence)
+ self.assertTrue(issubclass(sample, MutableSequence))
+ self.assertFalse(issubclass(basestring, MutableSequence))
self.validate_abstract_methods(MutableSequence, '__contains__', '__iter__',
'__len__', '__getitem__', '__setitem__', '__delitem__', 'insert')
+class TestCounter(unittest.TestCase):
+
+ def test_basics(self):
+ c = Counter('abcaba')
+ self.assertEqual(c, Counter({'a':3 , 'b': 2, 'c': 1}))
+ self.assertEqual(c, Counter(a=3, b=2, c=1))
+ self.assertIsInstance(c, dict)
+ self.assertIsInstance(c, Mapping)
+ self.assertTrue(issubclass(Counter, dict))
+ self.assertTrue(issubclass(Counter, Mapping))
+ self.assertEqual(len(c), 3)
+ self.assertEqual(sum(c.values()), 6)
+ self.assertEqual(sorted(c.values()), [1, 2, 3])
+ self.assertEqual(sorted(c.keys()), ['a', 'b', 'c'])
+ self.assertEqual(sorted(c), ['a', 'b', 'c'])
+ self.assertEqual(sorted(c.items()),
+ [('a', 3), ('b', 2), ('c', 1)])
+ self.assertEqual(c['b'], 2)
+ self.assertEqual(c['z'], 0)
+ with test_support.check_py3k_warnings():
+ self.assertEqual(c.has_key('c'), True)
+ self.assertEqual(c.has_key('z'), False)
+ self.assertEqual(c.__contains__('c'), True)
+ self.assertEqual(c.__contains__('z'), False)
+ self.assertEqual(c.get('b', 10), 2)
+ self.assertEqual(c.get('z', 10), 10)
+ self.assertEqual(c, dict(a=3, b=2, c=1))
+ self.assertEqual(repr(c), "Counter({'a': 3, 'b': 2, 'c': 1})")
+ self.assertEqual(c.most_common(), [('a', 3), ('b', 2), ('c', 1)])
+ for i in range(5):
+ self.assertEqual(c.most_common(i),
+ [('a', 3), ('b', 2), ('c', 1)][:i])
+ self.assertEqual(''.join(sorted(c.elements())), 'aaabbc')
+ c['a'] += 1 # increment an existing value
+ c['b'] -= 2 # sub existing value to zero
+ del c['c'] # remove an entry
+ del c['c'] # make sure that del doesn't raise KeyError
+ c['d'] -= 2 # sub from a missing value
+ c['e'] = -5 # directly assign a missing value
+ c['f'] += 4 # add to a missing value
+ self.assertEqual(c, dict(a=4, b=0, d=-2, e=-5, f=4))
+ self.assertEqual(''.join(sorted(c.elements())), 'aaaaffff')
+ self.assertEqual(c.pop('f'), 4)
+ self.assertNotIn('f', c)
+ for i in range(3):
+ elem, cnt = c.popitem()
+ self.assertNotIn(elem, c)
+ c.clear()
+ self.assertEqual(c, {})
+ self.assertEqual(repr(c), 'Counter()')
+ self.assertRaises(NotImplementedError, Counter.fromkeys, 'abc')
+ self.assertRaises(TypeError, hash, c)
+ c.update(dict(a=5, b=3))
+ c.update(c=1)
+ c.update(Counter('a' * 50 + 'b' * 30))
+ c.update() # test case with no args
+ c.__init__('a' * 500 + 'b' * 300)
+ c.__init__('cdc')
+ c.__init__()
+ self.assertEqual(c, dict(a=555, b=333, c=3, d=1))
+ self.assertEqual(c.setdefault('d', 5), 1)
+ self.assertEqual(c['d'], 1)
+ self.assertEqual(c.setdefault('e', 5), 5)
+ self.assertEqual(c['e'], 5)
+
+ def test_copying(self):
+ # Check that counters are copyable, deepcopyable, picklable, and
+ #have a repr/eval round-trip
+ words = Counter('which witch had which witches wrist watch'.split())
+ update_test = Counter()
+ update_test.update(words)
+ for i, dup in enumerate([
+ words.copy(),
+ copy.copy(words),
+ copy.deepcopy(words),
+ pickle.loads(pickle.dumps(words, 0)),
+ pickle.loads(pickle.dumps(words, 1)),
+ pickle.loads(pickle.dumps(words, 2)),
+ pickle.loads(pickle.dumps(words, -1)),
+ cPickle.loads(cPickle.dumps(words, 0)),
+ cPickle.loads(cPickle.dumps(words, 1)),
+ cPickle.loads(cPickle.dumps(words, 2)),
+ cPickle.loads(cPickle.dumps(words, -1)),
+ eval(repr(words)),
+ update_test,
+ Counter(words),
+ ]):
+ msg = (i, dup, words)
+ self.assertTrue(dup is not words)
+ self.assertEqual(dup, words)
+ self.assertEqual(len(dup), len(words))
+ self.assertEqual(type(dup), type(words))
+
+ def test_copy_subclass(self):
+ class MyCounter(Counter):
+ pass
+ c = MyCounter('slartibartfast')
+ d = c.copy()
+ self.assertEqual(d, c)
+ self.assertEqual(len(d), len(c))
+ self.assertEqual(type(d), type(c))
+
+ def test_conversions(self):
+ # Convert to: set, list, dict
+ s = 'she sells sea shells by the sea shore'
+ self.assertEqual(sorted(Counter(s).elements()), sorted(s))
+ self.assertEqual(sorted(Counter(s)), sorted(set(s)))
+ self.assertEqual(dict(Counter(s)), dict(Counter(s).items()))
+ self.assertEqual(set(Counter(s)), set(s))
+
+ def test_invariant_for_the_in_operator(self):
+ c = Counter(a=10, b=-2, c=0)
+ for elem in c:
+ self.assertTrue(elem in c)
+ self.assertIn(elem, c)
+
+ def test_multiset_operations(self):
+ # Verify that adding a zero counter will strip zeros and negatives
+ c = Counter(a=10, b=-2, c=0) + Counter()
+ self.assertEqual(dict(c), dict(a=10))
+
+ elements = 'abcd'
+ for i in range(1000):
+ # test random pairs of multisets
+ p = Counter(dict((elem, randrange(-2,4)) for elem in elements))
+ p.update(e=1, f=-1, g=0)
+ q = Counter(dict((elem, randrange(-2,4)) for elem in elements))
+ q.update(h=1, i=-1, j=0)
+ for counterop, numberop in [
+ (Counter.__add__, lambda x, y: max(0, x+y)),
+ (Counter.__sub__, lambda x, y: max(0, x-y)),
+ (Counter.__or__, lambda x, y: max(0,x,y)),
+ (Counter.__and__, lambda x, y: max(0, min(x,y))),
+ ]:
+ result = counterop(p, q)
+ for x in elements:
+ self.assertEqual(numberop(p[x], q[x]), result[x],
+ (counterop, x, p, q))
+ # verify that results exclude non-positive counts
+ self.assertTrue(x>0 for x in result.values())
+
+ elements = 'abcdef'
+ for i in range(100):
+ # verify that random multisets with no repeats are exactly like sets
+ p = Counter(dict((elem, randrange(0, 2)) for elem in elements))
+ q = Counter(dict((elem, randrange(0, 2)) for elem in elements))
+ for counterop, setop in [
+ (Counter.__sub__, set.__sub__),
+ (Counter.__or__, set.__or__),
+ (Counter.__and__, set.__and__),
+ ]:
+ counter_result = counterop(p, q)
+ set_result = setop(set(p.elements()), set(q.elements()))
+ self.assertEqual(counter_result, dict.fromkeys(set_result, 1))
+
+ def test_subtract(self):
+ c = Counter(a=-5, b=0, c=5, d=10, e=15,g=40)
+ c.subtract(a=1, b=2, c=-3, d=10, e=20, f=30, h=-50)
+ self.assertEqual(c, Counter(a=-6, b=-2, c=8, d=0, e=-5, f=-30, g=40, h=50))
+ c = Counter(a=-5, b=0, c=5, d=10, e=15,g=40)
+ c.subtract(Counter(a=1, b=2, c=-3, d=10, e=20, f=30, h=-50))
+ self.assertEqual(c, Counter(a=-6, b=-2, c=8, d=0, e=-5, f=-30, g=40, h=50))
+ c = Counter('aaabbcd')
+ c.subtract('aaaabbcce')
+ self.assertEqual(c, Counter(a=-1, b=0, c=-1, d=1, e=-1))
+
+class TestOrderedDict(unittest.TestCase):
+
+ def test_init(self):
+ with self.assertRaises(TypeError):
+ OrderedDict([('a', 1), ('b', 2)], None) # too many args
+ pairs = [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5)]
+ self.assertEqual(sorted(OrderedDict(dict(pairs)).items()), pairs) # dict input
+ self.assertEqual(sorted(OrderedDict(**dict(pairs)).items()), pairs) # kwds input
+ self.assertEqual(list(OrderedDict(pairs).items()), pairs) # pairs input
+ self.assertEqual(list(OrderedDict([('a', 1), ('b', 2), ('c', 9), ('d', 4)],
+ c=3, e=5).items()), pairs) # mixed input
+
+ # make sure no positional args conflict with possible kwdargs
+ self.assertEqual(inspect.getargspec(OrderedDict.__dict__['__init__']).args,
+ ['self'])
+
+ # Make sure that direct calls to __init__ do not clear previous contents
+ d = OrderedDict([('a', 1), ('b', 2), ('c', 3), ('d', 44), ('e', 55)])
+ d.__init__([('e', 5), ('f', 6)], g=7, d=4)
+ self.assertEqual(list(d.items()),
+ [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 7)])
+
+ def test_update(self):
+ with self.assertRaises(TypeError):
+ OrderedDict().update([('a', 1), ('b', 2)], None) # too many args
+ pairs = [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5)]
+ od = OrderedDict()
+ od.update(dict(pairs))
+ self.assertEqual(sorted(od.items()), pairs) # dict input
+ od = OrderedDict()
+ od.update(**dict(pairs))
+ self.assertEqual(sorted(od.items()), pairs) # kwds input
+ od = OrderedDict()
+ od.update(pairs)
+ self.assertEqual(list(od.items()), pairs) # pairs input
+ od = OrderedDict()
+ od.update([('a', 1), ('b', 2), ('c', 9), ('d', 4)], c=3, e=5)
+ self.assertEqual(list(od.items()), pairs) # mixed input
+
+ # Issue 9137: Named argument called 'other' or 'self'
+ # shouldn't be treated specially.
+ od = OrderedDict()
+ od.update(self=23)
+ self.assertEqual(list(od.items()), [('self', 23)])
+ od = OrderedDict()
+ od.update(other={})
+ self.assertEqual(list(od.items()), [('other', {})])
+ od = OrderedDict()
+ od.update(red=5, blue=6, other=7, self=8)
+ self.assertEqual(sorted(list(od.items())),
+ [('blue', 6), ('other', 7), ('red', 5), ('self', 8)])
+
+ # Make sure that direct calls to update do not clear previous contents
+ # add that updates items are not moved to the end
+ d = OrderedDict([('a', 1), ('b', 2), ('c', 3), ('d', 44), ('e', 55)])
+ d.update([('e', 5), ('f', 6)], g=7, d=4)
+ self.assertEqual(list(d.items()),
+ [('a', 1), ('b', 2), ('c', 3), ('d', 4), ('e', 5), ('f', 6), ('g', 7)])
+
+ def test_abc(self):
+ self.assertIsInstance(OrderedDict(), MutableMapping)
+ self.assertTrue(issubclass(OrderedDict, MutableMapping))
+
+ def test_clear(self):
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ shuffle(pairs)
+ od = OrderedDict(pairs)
+ self.assertEqual(len(od), len(pairs))
+ od.clear()
+ self.assertEqual(len(od), 0)
+
+ def test_delitem(self):
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ od = OrderedDict(pairs)
+ del od['a']
+ self.assertNotIn('a', od)
+ with self.assertRaises(KeyError):
+ del od['a']
+ self.assertEqual(list(od.items()), pairs[:2] + pairs[3:])
+
+ def test_setitem(self):
+ od = OrderedDict([('d', 1), ('b', 2), ('c', 3), ('a', 4), ('e', 5)])
+ od['c'] = 10 # existing element
+ od['f'] = 20 # new element
+ self.assertEqual(list(od.items()),
+ [('d', 1), ('b', 2), ('c', 10), ('a', 4), ('e', 5), ('f', 20)])
+
+ def test_iterators(self):
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ shuffle(pairs)
+ od = OrderedDict(pairs)
+ self.assertEqual(list(od), [t[0] for t in pairs])
+ self.assertEqual(od.keys()[:], [t[0] for t in pairs])
+ self.assertEqual(od.values()[:], [t[1] for t in pairs])
+ self.assertEqual(od.items()[:], pairs)
+ self.assertEqual(list(od.iterkeys()), [t[0] for t in pairs])
+ self.assertEqual(list(od.itervalues()), [t[1] for t in pairs])
+ self.assertEqual(list(od.iteritems()), pairs)
+ self.assertEqual(list(reversed(od)),
+ [t[0] for t in reversed(pairs)])
+
+ def test_popitem(self):
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ shuffle(pairs)
+ od = OrderedDict(pairs)
+ while pairs:
+ self.assertEqual(od.popitem(), pairs.pop())
+ with self.assertRaises(KeyError):
+ od.popitem()
+ self.assertEqual(len(od), 0)
+
+ def test_pop(self):
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ shuffle(pairs)
+ od = OrderedDict(pairs)
+ shuffle(pairs)
+ while pairs:
+ k, v = pairs.pop()
+ self.assertEqual(od.pop(k), v)
+ with self.assertRaises(KeyError):
+ od.pop('xyz')
+ self.assertEqual(len(od), 0)
+ self.assertEqual(od.pop(k, 12345), 12345)
+
+ # make sure pop still works when __missing__ is defined
+ class Missing(OrderedDict):
+ def __missing__(self, key):
+ return 0
+ m = Missing(a=1)
+ self.assertEqual(m.pop('b', 5), 5)
+ self.assertEqual(m.pop('a', 6), 1)
+ self.assertEqual(m.pop('a', 6), 6)
+ with self.assertRaises(KeyError):
+ m.pop('a')
+
+ def test_equality(self):
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ shuffle(pairs)
+ od1 = OrderedDict(pairs)
+ od2 = OrderedDict(pairs)
+ self.assertEqual(od1, od2) # same order implies equality
+ pairs = pairs[2:] + pairs[:2]
+ od2 = OrderedDict(pairs)
+ self.assertNotEqual(od1, od2) # different order implies inequality
+ # comparison to regular dict is not order sensitive
+ self.assertEqual(od1, dict(od2))
+ self.assertEqual(dict(od2), od1)
+ # different length implied inequality
+ self.assertNotEqual(od1, OrderedDict(pairs[:-1]))
+
+ def test_copying(self):
+ # Check that ordered dicts are copyable, deepcopyable, picklable,
+ # and have a repr/eval round-trip
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ od = OrderedDict(pairs)
+ update_test = OrderedDict()
+ update_test.update(od)
+ for i, dup in enumerate([
+ od.copy(),
+ copy.copy(od),
+ copy.deepcopy(od),
+ pickle.loads(pickle.dumps(od, 0)),
+ pickle.loads(pickle.dumps(od, 1)),
+ pickle.loads(pickle.dumps(od, 2)),
+ pickle.loads(pickle.dumps(od, -1)),
+ eval(repr(od)),
+ update_test,
+ OrderedDict(od),
+ ]):
+ self.assertTrue(dup is not od)
+ self.assertEqual(dup, od)
+ self.assertEqual(list(dup.items()), list(od.items()))
+ self.assertEqual(len(dup), len(od))
+ self.assertEqual(type(dup), type(od))
+
+ def test_yaml_linkage(self):
+ # Verify that __reduce__ is setup in a way that supports PyYAML's dump() feature.
+ # In yaml, lists are native but tuples are not.
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ od = OrderedDict(pairs)
+ # yaml.dump(od) -->
+ # '!!python/object/apply:__main__.OrderedDict\n- - [a, 1]\n - [b, 2]\n'
+ self.assertTrue(all(type(pair)==list for pair in od.__reduce__()[1]))
+
+ def test_reduce_not_too_fat(self):
+ # do not save instance dictionary if not needed
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ od = OrderedDict(pairs)
+ self.assertEqual(len(od.__reduce__()), 2)
+ od.x = 10
+ self.assertEqual(len(od.__reduce__()), 3)
+
+ def test_repr(self):
+ od = OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])
+ self.assertEqual(repr(od),
+ "OrderedDict([('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)])")
+ self.assertEqual(eval(repr(od)), od)
+ self.assertEqual(repr(OrderedDict()), "OrderedDict()")
+
+ def test_repr_recursive(self):
+ # See issue #9826
+ od = OrderedDict.fromkeys('abc')
+ od['x'] = od
+ self.assertEqual(repr(od),
+ "OrderedDict([('a', None), ('b', None), ('c', None), ('x', ...)])")
+
+ def test_setdefault(self):
+ pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
+ shuffle(pairs)
+ od = OrderedDict(pairs)
+ pair_order = list(od.items())
+ self.assertEqual(od.setdefault('a', 10), 3)
+ # make sure order didn't change
+ self.assertEqual(list(od.items()), pair_order)
+ self.assertEqual(od.setdefault('x', 10), 10)
+ # make sure 'x' is added to the end
+ self.assertEqual(list(od.items())[-1], ('x', 10))
+
+ # make sure setdefault still works when __missing__ is defined
+ class Missing(OrderedDict):
+ def __missing__(self, key):
+ return 0
+ self.assertEqual(Missing().setdefault(5, 9), 9)
+
+ def test_reinsert(self):
+ # Given insert a, insert b, delete a, re-insert a,
+ # verify that a is now later than b.
+ od = OrderedDict()
+ od['a'] = 1
+ od['b'] = 2
+ del od['a']
+ od['a'] = 1
+ self.assertEqual(list(od.items()), [('b', 2), ('a', 1)])
+
+ def test_views(self):
+ s = 'the quick brown fox jumped over a lazy dog yesterday before dawn'.split()
+ od = OrderedDict.fromkeys(s)
+ self.assertEqual(list(od.viewkeys()), s)
+ self.assertEqual(list(od.viewvalues()), [None for k in s])
+ self.assertEqual(list(od.viewitems()), [(k, None) for k in s])
+
+ def test_override_update(self):
+ # Verify that subclasses can override update() without breaking __init__()
+ class MyOD(OrderedDict):
+ def update(self, *args, **kwds):
+ raise Exception()
+ items = [('a', 1), ('c', 3), ('b', 2)]
+ self.assertEqual(list(MyOD(items).items()), items)
+
+class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol):
+ type2test = OrderedDict
+
+ def test_popitem(self):
+ d = self._empty_mapping()
+ self.assertRaises(KeyError, d.popitem)
+
+class MyOrderedDict(OrderedDict):
+ pass
+
+class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol):
+ type2test = MyOrderedDict
+
+ def test_popitem(self):
+ d = self._empty_mapping()
+ self.assertRaises(KeyError, d.popitem)
+
import collections
def test_main(verbose=None):
NamedTupleDocs = doctest.DocTestSuite(module=collections)
- test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs, TestCollectionABCs]
+ test_classes = [TestNamedTuple, NamedTupleDocs, TestOneTrickPonyABCs,
+ TestCollectionABCs, TestCounter,
+ TestOrderedDict, GeneralMappingTests, SubclassMappingTests]
test_support.run_unittest(*test_classes)
test_support.run_doctest(collections, verbose)
diff --git a/Lib/test/test_commands.py b/Lib/test/test_commands.py
index a539c243fe..066b182860 100644
--- a/Lib/test/test_commands.py
+++ b/Lib/test/test_commands.py
@@ -5,13 +5,11 @@
import unittest
import os, tempfile, re
-from test.test_support import (run_unittest, reap_children, import_module,
- check_warnings)
+from test.test_support import run_unittest, reap_children, import_module, \
+ check_warnings
-from test.test_support import TestSkipped, run_unittest, reap_children, import_module
# Silence Py3k warning
-import_module('commands', deprecated=True)
-from commands import *
+commands = import_module('commands', deprecated=True)
# The module says:
# "NB This only works (and is only relevant) for UNIX."
@@ -20,14 +18,14 @@ from commands import *
# I'll take the comment as given, and skip this suite.
if os.name != 'posix':
- raise TestSkipped('Not posix; skipping test_commands')
+ raise unittest.SkipTest('Not posix; skipping test_commands')
class CommandTests(unittest.TestCase):
def test_getoutput(self):
- self.assertEquals(getoutput('echo xyzzy'), 'xyzzy')
- self.assertEquals(getstatusoutput('echo xyzzy'), (0, 'xyzzy'))
+ self.assertEqual(commands.getoutput('echo xyzzy'), 'xyzzy')
+ self.assertEqual(commands.getstatusoutput('echo xyzzy'), (0, 'xyzzy'))
# we use mkdtemp in the next line to create an empty directory
# under our exclusive control; from that, we can invent a pathname
@@ -37,8 +35,8 @@ class CommandTests(unittest.TestCase):
dir = tempfile.mkdtemp()
name = os.path.join(dir, "foo")
- status, output = getstatusoutput('cat ' + name)
- self.assertNotEquals(status, 0)
+ status, output = commands.getstatusoutput('cat ' + name)
+ self.assertNotEqual(status, 0)
finally:
if dir is not None:
os.rmdir(dir)
@@ -51,14 +49,20 @@ class CommandTests(unittest.TestCase):
# drwxr-xr-x 15 Joe User My Group 4096 Aug 12 12:50 /
# Note that the first case above has a space in the group name
# while the second one has a space in both names.
+ # Special attributes supported:
+ # + = has ACLs
+ # @ = has Mac OS X extended attributes
+ # . = has a SELinux security context
pat = r'''d......... # It is a directory.
- \+? # It may have ACLs.
+ [.+@]? # It may have special attributes.
\s+\d+ # It has some number of links.
[^/]* # Skip user, group, size, and date.
/\. # and end with the name of the file.
'''
- with check_warnings(quiet=True):
- self.assertTrue(re.match(pat, getstatus("/."), re.VERBOSE))
+
+ with check_warnings((".*commands.getstatus.. is deprecated",
+ DeprecationWarning)):
+ self.assertTrue(re.match(pat, commands.getstatus("/."), re.VERBOSE))
def test_main():
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py
index b3111dd60c..22d1708231 100644
--- a/Lib/test/test_compile.py
+++ b/Lib/test/test_compile.py
@@ -6,6 +6,19 @@ import textwrap
class TestSpecifics(unittest.TestCase):
+ def test_no_ending_newline(self):
+ compile("hi", "<test>", "exec")
+ compile("hi\r", "<test>", "exec")
+
+ def test_empty(self):
+ compile("", "<test>", "exec")
+
+ def test_other_newlines(self):
+ compile("\r\n", "<test>", "exec")
+ compile("\r", "<test>", "exec")
+ compile("hi\r\nstuff\r\ndef f():\n pass\r", "<test>", "exec")
+ compile("this_is\rreally_old_mac\rdef f():\n pass", "<test>", "exec")
+
def test_debug_assignment(self):
# catch assignments to __debug__
self.assertRaises(SyntaxError, compile, '__debug__ = 1', '?', 'single')
@@ -130,7 +143,7 @@ def f(x):
def test_complex_args(self):
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
("tuple parameter unpacking has been removed", SyntaxWarning)):
exec textwrap.dedent('''
def comp_args((a, b)):
@@ -239,10 +252,10 @@ if 1:
self.assertEqual(eval("-" + all_one_bits), -18446744073709551615L)
else:
self.fail("How many bits *does* this machine have???")
- # Verify treatment of contant folding on -(sys.maxint+1)
+ # Verify treatment of constant folding on -(sys.maxint+1)
# i.e. -2147483648 on 32 bit platforms. Should return int, not long.
- self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int))
- self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), long))
+ self.assertIsInstance(eval("%s" % (-sys.maxint - 1)), int)
+ self.assertIsInstance(eval("%s" % (-sys.maxint - 2)), long)
if sys.maxint == 9223372036854775807:
def test_32_63_bit_values(self):
@@ -257,7 +270,7 @@ if 1:
for variable in self.test_32_63_bit_values.func_code.co_consts:
if variable is not None:
- self.assertTrue(isinstance(variable, int))
+ self.assertIsInstance(variable, int)
def test_sequence_unpacking_error(self):
# Verify sequence packing/unpacking with "or". SF bug #757818
@@ -275,11 +288,19 @@ if 1:
'(a, None) = 0, 0',
'for None in range(10): pass',
'def f(None): pass',
+ 'import None',
+ 'import x as None',
+ 'from x import None',
+ 'from x import y as None'
]
for stmt in stmts:
stmt += "\n"
self.assertRaises(SyntaxError, compile, stmt, 'tmp', 'single')
self.assertRaises(SyntaxError, compile, stmt, 'tmp', 'exec')
+ # This is ok.
+ compile("from None import x", "tmp", "exec")
+ compile("from x import None as y", "tmp", "exec")
+ compile("import None as x", "tmp", "exec")
def test_import(self):
succeed = [
@@ -337,6 +358,10 @@ if 1:
f1, f2 = f()
self.assertNotEqual(id(f1.func_code), id(f2.func_code))
+ def test_lambda_doc(self):
+ l = lambda: "foo"
+ self.assertIsNone(l.__doc__)
+
def test_unicode_encoding(self):
code = u"# -*- coding: utf-8 -*-\npass\n"
self.assertRaises(SyntaxError, compile, code, "tmp", "exec")
@@ -362,56 +387,56 @@ if 1:
d[1] += 1
self.assertEqual(d[1], 2)
del d[1]
- self.assertEqual(1 in d, False)
+ self.assertNotIn(1, d)
# Tuple of indices
d[1, 1] = 1
self.assertEqual(d[1, 1], 1)
d[1, 1] += 1
self.assertEqual(d[1, 1], 2)
del d[1, 1]
- self.assertEqual((1, 1) in d, False)
+ self.assertNotIn((1, 1), d)
# Simple slice
d[1:2] = 1
self.assertEqual(d[1:2], 1)
d[1:2] += 1
self.assertEqual(d[1:2], 2)
del d[1:2]
- self.assertEqual(slice(1, 2) in d, False)
+ self.assertNotIn(slice(1, 2), d)
# Tuple of simple slices
d[1:2, 1:2] = 1
self.assertEqual(d[1:2, 1:2], 1)
d[1:2, 1:2] += 1
self.assertEqual(d[1:2, 1:2], 2)
del d[1:2, 1:2]
- self.assertEqual((slice(1, 2), slice(1, 2)) in d, False)
+ self.assertNotIn((slice(1, 2), slice(1, 2)), d)
# Extended slice
d[1:2:3] = 1
self.assertEqual(d[1:2:3], 1)
d[1:2:3] += 1
self.assertEqual(d[1:2:3], 2)
del d[1:2:3]
- self.assertEqual(slice(1, 2, 3) in d, False)
+ self.assertNotIn(slice(1, 2, 3), d)
# Tuple of extended slices
d[1:2:3, 1:2:3] = 1
self.assertEqual(d[1:2:3, 1:2:3], 1)
d[1:2:3, 1:2:3] += 1
self.assertEqual(d[1:2:3, 1:2:3], 2)
del d[1:2:3, 1:2:3]
- self.assertEqual((slice(1, 2, 3), slice(1, 2, 3)) in d, False)
+ self.assertNotIn((slice(1, 2, 3), slice(1, 2, 3)), d)
# Ellipsis
d[...] = 1
self.assertEqual(d[...], 1)
d[...] += 1
self.assertEqual(d[...], 2)
del d[...]
- self.assertEqual(Ellipsis in d, False)
+ self.assertNotIn(Ellipsis, d)
# Tuple of Ellipses
d[..., ...] = 1
self.assertEqual(d[..., ...], 1)
d[..., ...] += 1
self.assertEqual(d[..., ...], 2)
del d[..., ...]
- self.assertEqual((Ellipsis, Ellipsis) in d, False)
+ self.assertNotIn((Ellipsis, Ellipsis), d)
def test_mangling(self):
class A:
@@ -421,10 +446,10 @@ if 1:
import __mangled_mod
import __package__.module
- self.assert_("_A__mangled" in A.f.func_code.co_varnames)
- self.assert_("__not_mangled__" in A.f.func_code.co_varnames)
- self.assert_("_A__mangled_mod" in A.f.func_code.co_varnames)
- self.assert_("__package__" in A.f.func_code.co_varnames)
+ self.assertIn("_A__mangled", A.f.func_code.co_varnames)
+ self.assertIn("__not_mangled__", A.f.func_code.co_varnames)
+ self.assertIn("_A__mangled_mod", A.f.func_code.co_varnames)
+ self.assertIn("__package__", A.f.func_code.co_varnames)
def test_compile_ast(self):
fname = __file__
@@ -447,7 +472,7 @@ if 1:
for fname, code in sample_code:
co1 = compile(code, '%s1' % fname, 'exec')
ast = compile(code, '%s2' % fname, 'exec', _ast.PyCF_ONLY_AST)
- self.assert_(type(ast) == _ast.Module)
+ self.assertTrue(type(ast) == _ast.Module)
co2 = compile(ast, '%s3' % fname, 'exec')
self.assertEqual(co1, co2)
# the code object's filename comes from the second compilation step
diff --git a/Lib/test/test_compileall.py b/Lib/test/test_compileall.py
new file mode 100644
index 0000000000..bff69893ce
--- /dev/null
+++ b/Lib/test/test_compileall.py
@@ -0,0 +1,80 @@
+import compileall
+import imp
+import os
+import py_compile
+import shutil
+import struct
+import tempfile
+from test import test_support
+import unittest
+
+
+class CompileallTests(unittest.TestCase):
+
+ def setUp(self):
+ self.directory = tempfile.mkdtemp()
+ self.source_path = os.path.join(self.directory, '_test.py')
+ self.bc_path = self.source_path + ('c' if __debug__ else 'o')
+ with open(self.source_path, 'w') as file:
+ file.write('x = 123\n')
+ self.source_path2 = os.path.join(self.directory, '_test2.py')
+ self.bc_path2 = self.source_path2 + ('c' if __debug__ else 'o')
+ shutil.copyfile(self.source_path, self.source_path2)
+
+ def tearDown(self):
+ shutil.rmtree(self.directory)
+
+ def data(self):
+ with open(self.bc_path, 'rb') as file:
+ data = file.read(8)
+ mtime = int(os.stat(self.source_path).st_mtime)
+ compare = struct.pack('<4sl', imp.get_magic(), mtime)
+ return data, compare
+
+ def recreation_check(self, metadata):
+ """Check that compileall recreates bytecode when the new metadata is
+ used."""
+ if not hasattr(os, 'stat'):
+ return
+ py_compile.compile(self.source_path)
+ self.assertEqual(*self.data())
+ with open(self.bc_path, 'rb') as file:
+ bc = file.read()[len(metadata):]
+ with open(self.bc_path, 'wb') as file:
+ file.write(metadata)
+ file.write(bc)
+ self.assertNotEqual(*self.data())
+ compileall.compile_dir(self.directory, force=False, quiet=True)
+ self.assertTrue(*self.data())
+
+ def test_mtime(self):
+ # Test a change in mtime leads to a new .pyc.
+ self.recreation_check(struct.pack('<4sl', imp.get_magic(), 1))
+
+ def test_magic_number(self):
+ # Test a change in mtime leads to a new .pyc.
+ self.recreation_check(b'\0\0\0\0')
+
+ def test_compile_files(self):
+ # Test compiling a single file, and complete directory
+ for fn in (self.bc_path, self.bc_path2):
+ try:
+ os.unlink(fn)
+ except:
+ pass
+ compileall.compile_file(self.source_path, force=False, quiet=True)
+ self.assertTrue(os.path.isfile(self.bc_path) \
+ and not os.path.isfile(self.bc_path2))
+ os.unlink(self.bc_path)
+ compileall.compile_dir(self.directory, force=False, quiet=True)
+ self.assertTrue(os.path.isfile(self.bc_path) \
+ and os.path.isfile(self.bc_path2))
+ os.unlink(self.bc_path)
+ os.unlink(self.bc_path2)
+
+def test_main():
+ test_support.run_unittest(CompileallTests)
+
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_compiler.py b/Lib/test/test_compiler.py
index e5b8365ef9..332e0bbf69 100644
--- a/Lib/test/test_compiler.py
+++ b/Lib/test/test_compiler.py
@@ -23,7 +23,9 @@ class CompilerTest(unittest.TestCase):
# to generate some kind of code for it.
next_time = time.time() + _PRINT_WORKING_MSG_INTERVAL
- libdir = os.path.dirname(unittest.__file__)
+ # warning: if 'os' or 'test_support' are moved in some other dir,
+ # they should be changed here.
+ libdir = os.path.dirname(os.__file__)
testdir = os.path.dirname(test.test_support.__file__)
for dir in [libdir, testdir]:
@@ -79,19 +81,19 @@ class CompilerTest(unittest.TestCase):
"<string>", "exec")
dct = {}
exec c in dct
- self.assertEquals(dct.get('e'), 1)
- self.assertEquals(dct.get('f'), 1)
+ self.assertEqual(dct.get('e'), 1)
+ self.assertEqual(dct.get('f'), 1)
def testDefaultArgs(self):
self.assertRaises(SyntaxError, compiler.parse, "def foo(a=1, b): pass")
def testDocstrings(self):
c = compiler.compile('"doc"', '<string>', 'exec')
- self.assert_('__doc__' in c.co_names)
+ self.assertIn('__doc__', c.co_names)
c = compiler.compile('def f():\n "doc"', '<string>', 'exec')
g = {}
exec c in g
- self.assertEquals(g['f'].__doc__, "doc")
+ self.assertEqual(g['f'].__doc__, "doc")
def testLineNo(self):
# Test that all nodes except Module have a correct lineno attribute.
@@ -110,16 +112,16 @@ class CompilerTest(unittest.TestCase):
def _check_lineno(self, node):
if not node.__class__ in NOLINENO:
- self.assert_(isinstance(node.lineno, int),
+ self.assertIsInstance(node.lineno, int,
"lineno=%s on %s" % (node.lineno, node.__class__))
- self.assert_(node.lineno > 0,
+ self.assertTrue(node.lineno > 0,
"lineno=%s on %s" % (node.lineno, node.__class__))
for child in node.getChildNodes():
self.check_lineno(child)
def testFlatten(self):
- self.assertEquals(flatten([1, [2]]), [1, 2])
- self.assertEquals(flatten((1, (2,))), [1, 2])
+ self.assertEqual(flatten([1, [2]]), [1, 2])
+ self.assertEqual(flatten((1, (2,))), [1, 2])
def testNestedScope(self):
c = compiler.compile('def g():\n'
@@ -131,14 +133,44 @@ class CompilerTest(unittest.TestCase):
'exec')
dct = {}
exec c in dct
- self.assertEquals(dct.get('result'), 3)
+ self.assertEqual(dct.get('result'), 3)
def testGenExp(self):
c = compiler.compile('list((i,j) for i in range(3) if i < 3'
' for j in range(4) if j > 2)',
'<string>',
'eval')
- self.assertEquals(eval(c), [(0, 3), (1, 3), (2, 3)])
+ self.assertEqual(eval(c), [(0, 3), (1, 3), (2, 3)])
+
+ def testSetLiteral(self):
+ c = compiler.compile('{1, 2, 3}', '<string>', 'eval')
+ self.assertEqual(eval(c), {1,2,3})
+ c = compiler.compile('{1, 2, 3,}', '<string>', 'eval')
+ self.assertEqual(eval(c), {1,2,3})
+
+ def testDictLiteral(self):
+ c = compiler.compile('{1:2, 2:3, 3:4}', '<string>', 'eval')
+ self.assertEqual(eval(c), {1:2, 2:3, 3:4})
+ c = compiler.compile('{1:2, 2:3, 3:4,}', '<string>', 'eval')
+ self.assertEqual(eval(c), {1:2, 2:3, 3:4})
+
+ def testSetComp(self):
+ c = compiler.compile('{x for x in range(1, 4)}', '<string>', 'eval')
+ self.assertEqual(eval(c), {1, 2, 3})
+ c = compiler.compile('{x * y for x in range(3) if x != 0'
+ ' for y in range(4) if y != 0}',
+ '<string>',
+ 'eval')
+ self.assertEqual(eval(c), {1, 2, 3, 4, 6})
+
+ def testDictComp(self):
+ c = compiler.compile('{x:x+1 for x in range(1, 4)}', '<string>', 'eval')
+ self.assertEqual(eval(c), {1:2, 2:3, 3:4})
+ c = compiler.compile('{(x, y) : y for x in range(2) if x != 0'
+ ' for y in range(3) if y != 0}',
+ '<string>',
+ 'eval')
+ self.assertEqual(eval(c), {(1, 2): 2, (1, 1): 1})
def testWith(self):
# SF bug 1638243
@@ -151,7 +183,7 @@ class CompilerTest(unittest.TestCase):
'exec' )
dct = {'TrivialContext': TrivialContext}
exec c in dct
- self.assertEquals(dct.get('result'), 1)
+ self.assertEqual(dct.get('result'), 1)
def testWithAss(self):
c = compiler.compile('from __future__ import with_statement\n'
@@ -163,8 +195,36 @@ class CompilerTest(unittest.TestCase):
'exec' )
dct = {'TrivialContext': TrivialContext}
exec c in dct
- self.assertEquals(dct.get('result'), 1)
+ self.assertEqual(dct.get('result'), 1)
+
+ def testWithMult(self):
+ events = []
+ class Ctx:
+ def __init__(self, n):
+ self.n = n
+ def __enter__(self):
+ events.append(self.n)
+ def __exit__(self, *args):
+ pass
+ c = compiler.compile('from __future__ import with_statement\n'
+ 'def f():\n'
+ ' with Ctx(1) as tc, Ctx(2) as tc2:\n'
+ ' return 1\n'
+ 'result = f()',
+ '<string>',
+ 'exec' )
+ dct = {'Ctx': Ctx}
+ exec c in dct
+ self.assertEqual(dct.get('result'), 1)
+ self.assertEqual(events, [1, 2])
+ def testGlobal(self):
+ code = compiler.compile('global x\nx=1', '<string>', 'exec')
+ d1 = {'__builtins__': {}}
+ d2 = {}
+ exec code in d1, d2
+ # x should be in the globals dict
+ self.assertEqual(d1.get('x'), 1)
def testPrintFunction(self):
c = compiler.compile('from __future__ import print_function\n'
@@ -174,14 +234,14 @@ class CompilerTest(unittest.TestCase):
'exec' )
dct = {'output': StringIO()}
exec c in dct
- self.assertEquals(dct['output'].getvalue(), 'a**b++')
+ self.assertEqual(dct['output'].getvalue(), 'a**b++')
def _testErrEnc(self, src, text, offset):
try:
compile(src, "", "exec")
except SyntaxError, e:
- self.assertEquals(e.offset, offset)
- self.assertEquals(e.text, text)
+ self.assertEqual(e.offset, offset)
+ self.assertEqual(e.text, text)
def testSourceCodeEncodingsError(self):
# Test SyntaxError with encoding definition
@@ -220,6 +280,9 @@ l[0]
l[3:4]
d = {'a': 2}
d = {}
+d = {x: y for x, y in zip(range(5), range(5,10))}
+s = {x for x in range(10)}
+s = {1}
t = ()
t = (1, 2)
l = []
@@ -247,7 +310,7 @@ from math import *
def test_main():
global TEST_ALL
- TEST_ALL = test.test_support.is_resource_enabled("compiler")
+ TEST_ALL = test.test_support.is_resource_enabled("cpu")
test.test_support.run_unittest(CompilerTest)
if __name__ == "__main__":
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index 6342501d30..59e86773ad 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -2,7 +2,7 @@ import unittest
from test import test_support
from random import random
-from math import atan2
+from math import atan2, isnan, copysign
INF = float("inf")
NAN = float("nan")
@@ -35,16 +35,36 @@ class ComplexTest(unittest.TestCase):
if x == 0:
return abs(y) < eps
# check that relative difference < eps
- self.assert_(abs((x-y)/y) < eps)
+ self.assertTrue(abs((x-y)/y) < eps)
+
+ def assertFloatsAreIdentical(self, x, y):
+ """assert that floats x and y are identical, in the sense that:
+ (1) both x and y are nans, or
+ (2) both x and y are infinities, with the same sign, or
+ (3) both x and y are zeros, with the same sign, or
+ (4) x and y are both finite and nonzero, and x == y
+
+ """
+ msg = 'floats {!r} and {!r} are not identical'
+
+ if isnan(x) or isnan(y):
+ if isnan(x) and isnan(y):
+ return
+ elif x == y:
+ if x != 0.0:
+ return
+ # both zero; check that signs match
+ elif copysign(1.0, x) == copysign(1.0, y):
+ return
+ else:
+ msg += ': zeros have different signs'
+ self.fail(msg.format(x, y))
def assertClose(self, x, y, eps=1e-9):
"""Return true iff complexes x and y "are close\""""
self.assertCloseAbs(x.real, y.real, eps)
self.assertCloseAbs(x.imag, y.imag, eps)
- def assertIs(self, a, b):
- self.assert_(a is b)
-
def check_div(self, x, y):
"""Compute complex z=x*y, and check that z/x==y and z/y==x."""
z = x * y
@@ -95,8 +115,21 @@ class ComplexTest(unittest.TestCase):
def test_coerce(self):
self.assertRaises(OverflowError, complex.__coerce__, 1+1j, 1L<<10000)
+ def test_no_implicit_coerce(self):
+ # Python 2.7 removed implicit coercion from the complex type
+ class A(object):
+ def __coerce__(self, other):
+ raise RuntimeError
+ __hash__ = None
+ def __cmp__(self, other):
+ return -1
+
+ a = A()
+ self.assertRaises(TypeError, lambda: a + 2.0j)
+ self.assertTrue(a < 2.0j)
+
def test_richcompare(self):
- self.assertRaises(OverflowError, complex.__eq__, 1+1j, 1L<<10000)
+ self.assertEqual(complex.__eq__(1+1j, 1L<<10000), False)
self.assertEqual(complex.__lt__(1+1j, None), NotImplemented)
self.assertIs(complex.__eq__(1+1j, 1+1j), True)
self.assertIs(complex.__eq__(1+1j, 2+2j), False)
@@ -107,6 +140,23 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(TypeError, complex.__gt__, 1+1j, 2+2j)
self.assertRaises(TypeError, complex.__ge__, 1+1j, 2+2j)
+ def test_richcompare_boundaries(self):
+ def check(n, deltas, is_equal, imag = 0.0):
+ for delta in deltas:
+ i = n + delta
+ z = complex(i, imag)
+ self.assertIs(complex.__eq__(z, i), is_equal(delta))
+ self.assertIs(complex.__ne__(z, i), not is_equal(delta))
+ # For IEEE-754 doubles the following should hold:
+ # x in [2 ** (52 + i), 2 ** (53 + i + 1)] -> x mod 2 ** i == 0
+ # where the interval is representable, of course.
+ for i in range(1, 10):
+ pow = 52 + i
+ mult = 2 ** i
+ check(2 ** pow, range(1, 101), lambda delta: delta % mult == 0)
+ check(2 ** pow, range(1, 101), lambda delta: False, float(i))
+ check(2 ** 53, range(-100, 0), lambda delta: True)
+
def test_mod(self):
self.assertRaises(ZeroDivisionError, (1+1j).__mod__, 0+0j)
@@ -162,8 +212,8 @@ class ComplexTest(unittest.TestCase):
def test_boolcontext(self):
for i in xrange(100):
- self.assert_(complex(random() + 1e-6, random() + 1e-6))
- self.assert_(not complex(0.0, 0.0))
+ self.assertTrue(complex(random() + 1e-6, random() + 1e-6))
+ self.assertTrue(not complex(0.0, 0.0))
def test_conjugate(self):
self.assertClose(complex(5.3, 9.8).conjugate(), 5.3-9.8j)
@@ -213,9 +263,17 @@ class ComplexTest(unittest.TestCase):
self.assertAlmostEqual(complex("+1"), +1)
self.assertAlmostEqual(complex("(1+2j)"), 1+2j)
self.assertAlmostEqual(complex("(1.3+2.2j)"), 1.3+2.2j)
- self.assertAlmostEqual(complex("1E-500"), 1e-500+0j)
- self.assertAlmostEqual(complex("1e-500J"), 1e-500j)
- self.assertAlmostEqual(complex("+1e-315-1e-400j"), 1e-315-1e-400j)
+ self.assertAlmostEqual(complex("3.14+1J"), 3.14+1j)
+ self.assertAlmostEqual(complex(" ( +3.14-6J )"), 3.14-6j)
+ self.assertAlmostEqual(complex(" ( +3.14-J )"), 3.14-1j)
+ self.assertAlmostEqual(complex(" ( +3.14+j )"), 3.14+1j)
+ self.assertAlmostEqual(complex("J"), 1j)
+ self.assertAlmostEqual(complex("( j )"), 1j)
+ self.assertAlmostEqual(complex("+J"), 1j)
+ self.assertAlmostEqual(complex("( -j)"), -1j)
+ self.assertAlmostEqual(complex('1e-500'), 0.0 + 0.0j)
+ self.assertAlmostEqual(complex('-1e-500j'), 0.0 - 0.0j)
+ self.assertAlmostEqual(complex('-1e-500+1e-500j'), -0.0 + 0.0j)
class complex2(complex): pass
self.assertAlmostEqual(complex(complex2(1+1j)), 1+1j)
@@ -237,13 +295,12 @@ class ComplexTest(unittest.TestCase):
self.assertEqual(split_zeros(complex(-0., 1.).real), split_zeros(-0.))
c = 3.14 + 1j
- self.assert_(complex(c) is c)
+ self.assertTrue(complex(c) is c)
del c
self.assertRaises(TypeError, complex, "1", "1")
self.assertRaises(TypeError, complex, 1, "1")
- self.assertEqual(complex(" 3.14+J "), 3.14+1j)
if test_support.have_unicode:
self.assertEqual(complex(unicode(" 3.14+J ")), 3.14+1j)
@@ -269,8 +326,19 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(ValueError, complex, "1+(2j)")
self.assertRaises(ValueError, complex, "(1+2j)123")
if test_support.have_unicode:
- self.assertRaises(ValueError, complex, unicode("1"*500))
self.assertRaises(ValueError, complex, unicode("x"))
+ self.assertRaises(ValueError, complex, "1j+2")
+ self.assertRaises(ValueError, complex, "1e1ej")
+ self.assertRaises(ValueError, complex, "1e++1ej")
+ self.assertRaises(ValueError, complex, ")1+2j(")
+ # the following three are accepted by Python 2.6
+ self.assertRaises(ValueError, complex, "1..1j")
+ self.assertRaises(ValueError, complex, "1.11.1j")
+ self.assertRaises(ValueError, complex, "1e1.1j")
+
+ if test_support.have_unicode:
+ # check that complex accepts long unicode strings
+ self.assertEqual(type(complex(unicode("1"*500))), complex)
class EvilExc(Exception):
pass
@@ -313,6 +381,61 @@ class ComplexTest(unittest.TestCase):
self.assertAlmostEqual(complex(complex1(1j)), 2j)
self.assertRaises(TypeError, complex, complex2(1j))
+ def test_subclass(self):
+ class xcomplex(complex):
+ def __add__(self,other):
+ return xcomplex(complex(self) + other)
+ __radd__ = __add__
+
+ def __sub__(self,other):
+ return xcomplex(complex(self) + other)
+ __rsub__ = __sub__
+
+ def __mul__(self,other):
+ return xcomplex(complex(self) * other)
+ __rmul__ = __mul__
+
+ def __div__(self,other):
+ return xcomplex(complex(self) / other)
+
+ def __rdiv__(self,other):
+ return xcomplex(other / complex(self))
+
+ __truediv__ = __div__
+ __rtruediv__ = __rdiv__
+
+ def __floordiv__(self,other):
+ return xcomplex(complex(self) // other)
+
+ def __rfloordiv__(self,other):
+ return xcomplex(other // complex(self))
+
+ def __pow__(self,other):
+ return xcomplex(complex(self) ** other)
+
+ def __rpow__(self,other):
+ return xcomplex(other ** complex(self) )
+
+ def __mod__(self,other):
+ return xcomplex(complex(self) % other)
+
+ def __rmod__(self,other):
+ return xcomplex(other % complex(self))
+
+ infix_binops = ('+', '-', '*', '**', '%', '//', '/')
+ xcomplex_values = (xcomplex(1), xcomplex(123.0),
+ xcomplex(-10+2j), xcomplex(3+187j),
+ xcomplex(3-78j))
+ test_values = (1, 123.0, 10-19j, xcomplex(1+2j),
+ xcomplex(1+87j), xcomplex(10+90j))
+
+ for op in infix_binops:
+ for x in xcomplex_values:
+ for y in test_values:
+ a = 'x %s y' % op
+ b = 'y %s x' % op
+ self.assertTrue(type(eval(a)) is type(eval(b)) is xcomplex)
+
def test_hash(self):
for x in xrange(-30, 30):
self.assertEqual(hash(x), hash(complex(x, 0)))
@@ -335,17 +458,17 @@ class ComplexTest(unittest.TestCase):
self.assertEqual(-6j,complex(repr(-6j)))
self.assertEqual(6j,complex(repr(6j)))
- self.assertEqual(repr(complex(1., INF)), "(1+inf*j)")
- self.assertEqual(repr(complex(1., -INF)), "(1-inf*j)")
+ self.assertEqual(repr(complex(1., INF)), "(1+infj)")
+ self.assertEqual(repr(complex(1., -INF)), "(1-infj)")
self.assertEqual(repr(complex(INF, 1)), "(inf+1j)")
- self.assertEqual(repr(complex(-INF, INF)), "(-inf+inf*j)")
+ self.assertEqual(repr(complex(-INF, INF)), "(-inf+infj)")
self.assertEqual(repr(complex(NAN, 1)), "(nan+1j)")
- self.assertEqual(repr(complex(1, NAN)), "(1+nan*j)")
- self.assertEqual(repr(complex(NAN, NAN)), "(nan+nan*j)")
+ self.assertEqual(repr(complex(1, NAN)), "(1+nanj)")
+ self.assertEqual(repr(complex(NAN, NAN)), "(nan+nanj)")
- self.assertEqual(repr(complex(0, INF)), "inf*j")
- self.assertEqual(repr(complex(0, -INF)), "-inf*j")
- self.assertEqual(repr(complex(0, NAN)), "nan*j")
+ self.assertEqual(repr(complex(0, INF)), "infj")
+ self.assertEqual(repr(complex(0, -INF)), "-infj")
+ self.assertEqual(repr(complex(0, NAN)), "nanj")
def test_neg(self):
self.assertEqual(-(1+6j), -1-6j)
@@ -378,8 +501,146 @@ class ComplexTest(unittest.TestCase):
def test_plus_minus_0j(self):
# test that -0j and 0j literals are not identified
z1, z2 = 0j, -0j
- self.assertEquals(atan2(z1.imag, -1.), atan2(0., -1.))
- self.assertEquals(atan2(z2.imag, -1.), atan2(-0., -1.))
+ self.assertEqual(atan2(z1.imag, -1.), atan2(0., -1.))
+ self.assertEqual(atan2(z2.imag, -1.), atan2(-0., -1.))
+
+ @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+ def test_overflow(self):
+ self.assertEqual(complex("1e500"), complex(INF, 0.0))
+ self.assertEqual(complex("-1e500j"), complex(0.0, -INF))
+ self.assertEqual(complex("-1e500+1.8e308j"), complex(-INF, INF))
+
+ @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+ def test_repr_roundtrip(self):
+ vals = [0.0, 1e-500, 1e-315, 1e-200, 0.0123, 3.1415, 1e50, INF, NAN]
+ vals += [-v for v in vals]
+
+ # complex(repr(z)) should recover z exactly, even for complex
+ # numbers involving an infinity, nan, or negative zero
+ for x in vals:
+ for y in vals:
+ z = complex(x, y)
+ roundtrip = complex(repr(z))
+ self.assertFloatsAreIdentical(z.real, roundtrip.real)
+ self.assertFloatsAreIdentical(z.imag, roundtrip.imag)
+
+ # if we predefine some constants, then eval(repr(z)) should
+ # also work, except that it might change the sign of zeros
+ inf, nan = float('inf'), float('nan')
+ infj, nanj = complex(0.0, inf), complex(0.0, nan)
+ for x in vals:
+ for y in vals:
+ z = complex(x, y)
+ roundtrip = eval(repr(z))
+ # adding 0.0 has no effect beside changing -0.0 to 0.0
+ self.assertFloatsAreIdentical(0.0 + z.real,
+ 0.0 + roundtrip.real)
+ self.assertFloatsAreIdentical(0.0 + z.imag,
+ 0.0 + roundtrip.imag)
+
+ def test_format(self):
+ # empty format string is same as str()
+ self.assertEqual(format(1+3j, ''), str(1+3j))
+ self.assertEqual(format(1.5+3.5j, ''), str(1.5+3.5j))
+ self.assertEqual(format(3j, ''), str(3j))
+ self.assertEqual(format(3.2j, ''), str(3.2j))
+ self.assertEqual(format(3+0j, ''), str(3+0j))
+ self.assertEqual(format(3.2+0j, ''), str(3.2+0j))
+
+ # empty presentation type should still be analogous to str,
+ # even when format string is nonempty (issue #5920).
+ self.assertEqual(format(3.2+0j, '-'), str(3.2+0j))
+ self.assertEqual(format(3.2+0j, '<'), str(3.2+0j))
+ z = 4/7. - 100j/7.
+ self.assertEqual(format(z, ''), str(z))
+ self.assertEqual(format(z, '-'), str(z))
+ self.assertEqual(format(z, '<'), str(z))
+ self.assertEqual(format(z, '10'), str(z))
+ z = complex(0.0, 3.0)
+ self.assertEqual(format(z, ''), str(z))
+ self.assertEqual(format(z, '-'), str(z))
+ self.assertEqual(format(z, '<'), str(z))
+ self.assertEqual(format(z, '2'), str(z))
+ z = complex(-0.0, 2.0)
+ self.assertEqual(format(z, ''), str(z))
+ self.assertEqual(format(z, '-'), str(z))
+ self.assertEqual(format(z, '<'), str(z))
+ self.assertEqual(format(z, '3'), str(z))
+
+ self.assertEqual(format(1+3j, 'g'), '1+3j')
+ self.assertEqual(format(3j, 'g'), '0+3j')
+ self.assertEqual(format(1.5+3.5j, 'g'), '1.5+3.5j')
+
+ self.assertEqual(format(1.5+3.5j, '+g'), '+1.5+3.5j')
+ self.assertEqual(format(1.5-3.5j, '+g'), '+1.5-3.5j')
+ self.assertEqual(format(1.5-3.5j, '-g'), '1.5-3.5j')
+ self.assertEqual(format(1.5+3.5j, ' g'), ' 1.5+3.5j')
+ self.assertEqual(format(1.5-3.5j, ' g'), ' 1.5-3.5j')
+ self.assertEqual(format(-1.5+3.5j, ' g'), '-1.5+3.5j')
+ self.assertEqual(format(-1.5-3.5j, ' g'), '-1.5-3.5j')
+
+ self.assertEqual(format(-1.5-3.5e-20j, 'g'), '-1.5-3.5e-20j')
+ self.assertEqual(format(-1.5-3.5j, 'f'), '-1.500000-3.500000j')
+ self.assertEqual(format(-1.5-3.5j, 'F'), '-1.500000-3.500000j')
+ self.assertEqual(format(-1.5-3.5j, 'e'), '-1.500000e+00-3.500000e+00j')
+ self.assertEqual(format(-1.5-3.5j, '.2e'), '-1.50e+00-3.50e+00j')
+ self.assertEqual(format(-1.5-3.5j, '.2E'), '-1.50E+00-3.50E+00j')
+ self.assertEqual(format(-1.5e10-3.5e5j, '.2G'), '-1.5E+10-3.5E+05j')
+
+ self.assertEqual(format(1.5+3j, '<20g'), '1.5+3j ')
+ self.assertEqual(format(1.5+3j, '*<20g'), '1.5+3j**************')
+ self.assertEqual(format(1.5+3j, '>20g'), ' 1.5+3j')
+ self.assertEqual(format(1.5+3j, '^20g'), ' 1.5+3j ')
+ self.assertEqual(format(1.5+3j, '<20'), '(1.5+3j) ')
+ self.assertEqual(format(1.5+3j, '>20'), ' (1.5+3j)')
+ self.assertEqual(format(1.5+3j, '^20'), ' (1.5+3j) ')
+ self.assertEqual(format(1.123-3.123j, '^20.2'), ' (1.1-3.1j) ')
+
+ self.assertEqual(format(1.5+3j, '20.2f'), ' 1.50+3.00j')
+ self.assertEqual(format(1.5+3j, '>20.2f'), ' 1.50+3.00j')
+ self.assertEqual(format(1.5+3j, '<20.2f'), '1.50+3.00j ')
+ self.assertEqual(format(1.5e20+3j, '<20.2f'), '150000000000000000000.00+3.00j')
+ self.assertEqual(format(1.5e20+3j, '>40.2f'), ' 150000000000000000000.00+3.00j')
+ self.assertEqual(format(1.5e20+3j, '^40,.2f'), ' 150,000,000,000,000,000,000.00+3.00j ')
+ self.assertEqual(format(1.5e21+3j, '^40,.2f'), ' 1,500,000,000,000,000,000,000.00+3.00j ')
+ self.assertEqual(format(1.5e21+3000j, ',.2f'), '1,500,000,000,000,000,000,000.00+3,000.00j')
+
+ # alternate is invalid
+ self.assertRaises(ValueError, (1.5+0.5j).__format__, '#f')
+
+ # zero padding is invalid
+ self.assertRaises(ValueError, (1.5+0.5j).__format__, '010f')
+
+ # '=' alignment is invalid
+ self.assertRaises(ValueError, (1.5+3j).__format__, '=20')
+
+ # integer presentation types are an error
+ for t in 'bcdoxX':
+ self.assertRaises(ValueError, (1.5+0.5j).__format__, t)
+
+ # make sure everything works in ''.format()
+ self.assertEqual('*{0:.3f}*'.format(3.14159+2.71828j), '*3.142+2.718j*')
+
+ # issue 3382: 'f' and 'F' with inf's and nan's
+ self.assertEqual('{0:f}'.format(INF+0j), 'inf+0.000000j')
+ self.assertEqual('{0:F}'.format(INF+0j), 'INF+0.000000j')
+ self.assertEqual('{0:f}'.format(-INF+0j), '-inf+0.000000j')
+ self.assertEqual('{0:F}'.format(-INF+0j), '-INF+0.000000j')
+ self.assertEqual('{0:f}'.format(complex(INF, INF)), 'inf+infj')
+ self.assertEqual('{0:F}'.format(complex(INF, INF)), 'INF+INFj')
+ self.assertEqual('{0:f}'.format(complex(INF, -INF)), 'inf-infj')
+ self.assertEqual('{0:F}'.format(complex(INF, -INF)), 'INF-INFj')
+ self.assertEqual('{0:f}'.format(complex(-INF, INF)), '-inf+infj')
+ self.assertEqual('{0:F}'.format(complex(-INF, INF)), '-INF+INFj')
+ self.assertEqual('{0:f}'.format(complex(-INF, -INF)), '-inf-infj')
+ self.assertEqual('{0:F}'.format(complex(-INF, -INF)), '-INF-INFj')
+
+ self.assertEqual('{0:f}'.format(complex(NAN, 0)), 'nan+0.000000j')
+ self.assertEqual('{0:F}'.format(complex(NAN, 0)), 'NAN+0.000000j')
+ self.assertEqual('{0:f}'.format(complex(NAN, NAN)), 'nan+nanj')
+ self.assertEqual('{0:F}'.format(complex(NAN, NAN)), 'NAN+NANj')
def test_main():
with test_support.check_warnings(("complex divmod.., // and % are "
diff --git a/Lib/test/test_complex_args.py b/Lib/test/test_complex_args.py
index f49159ba9f..036cbea402 100644
--- a/Lib/test/test_complex_args.py
+++ b/Lib/test/test_complex_args.py
@@ -109,7 +109,7 @@ class ComplexArgsTestCase(unittest.TestCase):
def test_main():
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
("tuple parameter unpacking has been removed", SyntaxWarning),
("parenthesized argument names are invalid", SyntaxWarning)):
test_support.run_unittest(ComplexArgsTestCase)
diff --git a/Lib/test/test_contains.py b/Lib/test/test_contains.py
index 0d540995bc..7138081dc8 100644
--- a/Lib/test/test_contains.py
+++ b/Lib/test/test_contains.py
@@ -20,57 +20,57 @@ class TestContains(unittest.TestCase):
a = base_set(1)
b = set(1)
c = seq(1)
- self.assert_(1 in b)
- self.assert_(0 not in b)
- self.assert_(1 in c)
- self.assert_(0 not in c)
+ self.assertIn(1, b)
+ self.assertNotIn(0, b)
+ self.assertIn(1, c)
+ self.assertNotIn(0, c)
self.assertRaises(TypeError, lambda: 1 in a)
self.assertRaises(TypeError, lambda: 1 not in a)
# test char in string
- self.assert_('c' in 'abc')
- self.assert_('d' not in 'abc')
+ self.assertIn('c', 'abc')
+ self.assertNotIn('d', 'abc')
- self.assert_('' in '')
- self.assert_('' in 'abc')
+ self.assertIn('', '')
+ self.assertIn('', 'abc')
self.assertRaises(TypeError, lambda: None in 'abc')
if have_unicode:
def test_char_in_unicode(self):
- self.assert_('c' in unicode('abc'))
- self.assert_('d' not in unicode('abc'))
+ self.assertIn('c', unicode('abc'))
+ self.assertNotIn('d', unicode('abc'))
- self.assert_('' in unicode(''))
- self.assert_(unicode('') in '')
- self.assert_(unicode('') in unicode(''))
- self.assert_('' in unicode('abc'))
- self.assert_(unicode('') in 'abc')
- self.assert_(unicode('') in unicode('abc'))
+ self.assertIn('', unicode(''))
+ self.assertIn(unicode(''), '')
+ self.assertIn(unicode(''), unicode(''))
+ self.assertIn('', unicode('abc'))
+ self.assertIn(unicode(''), 'abc')
+ self.assertIn(unicode(''), unicode('abc'))
self.assertRaises(TypeError, lambda: None in unicode('abc'))
# test Unicode char in Unicode
- self.assert_(unicode('c') in unicode('abc'))
- self.assert_(unicode('d') not in unicode('abc'))
+ self.assertIn(unicode('c'), unicode('abc'))
+ self.assertNotIn(unicode('d'), unicode('abc'))
# test Unicode char in string
- self.assert_(unicode('c') in 'abc')
- self.assert_(unicode('d') not in 'abc')
+ self.assertIn(unicode('c'), 'abc')
+ self.assertNotIn(unicode('d'), 'abc')
def test_builtin_sequence_types(self):
# a collection of tests on builtin sequence types
a = range(10)
for i in a:
- self.assert_(i in a)
- self.assert_(16 not in a)
- self.assert_(a not in a)
+ self.assertIn(i, a)
+ self.assertNotIn(16, a)
+ self.assertNotIn(a, a)
a = tuple(a)
for i in a:
- self.assert_(i in a)
- self.assert_(16 not in a)
- self.assert_(a not in a)
+ self.assertIn(i, a)
+ self.assertNotIn(16, a)
+ self.assertNotIn(a, a)
class Deviant1:
"""Behaves strangely when compared
@@ -86,7 +86,7 @@ class TestContains(unittest.TestCase):
self.aList.remove(14)
return 1
- self.assert_(Deviant1() not in Deviant1.aList)
+ self.assertNotIn(Deviant1(), Deviant1.aList)
class Deviant2:
"""Behaves strangely when compared
@@ -99,7 +99,7 @@ class TestContains(unittest.TestCase):
raise RuntimeError, "gotcha"
try:
- self.assert_(Deviant2() not in a)
+ self.assertNotIn(Deviant2(), a)
except TypeError:
pass
diff --git a/Lib/test/test_contextlib.py b/Lib/test/test_contextlib.py
index c8a4591633..f28c95eadb 100644
--- a/Lib/test/test_contextlib.py
+++ b/Lib/test/test_contextlib.py
@@ -1,13 +1,15 @@
"""Unit tests for contextlib.py, and other context managers."""
import sys
-import os
-import decimal
import tempfile
import unittest
-import threading
from contextlib import * # Tests __all__
from test import test_support
+try:
+ import threading
+except ImportError:
+ threading = None
+
class ContextManagerTestCase(unittest.TestCase):
@@ -33,16 +35,12 @@ class ContextManagerTestCase(unittest.TestCase):
yield 42
finally:
state.append(999)
- try:
+ with self.assertRaises(ZeroDivisionError):
with woohoo() as x:
self.assertEqual(state, [1])
self.assertEqual(x, 42)
state.append(x)
raise ZeroDivisionError()
- except ZeroDivisionError:
- pass
- else:
- self.fail("Expected ZeroDivisionError")
self.assertEqual(state, [1, 42, 999])
def test_contextmanager_no_reraise(self):
@@ -52,7 +50,7 @@ class ContextManagerTestCase(unittest.TestCase):
ctx = whee()
ctx.__enter__()
# Calling __exit__ should not result in an exception
- self.failIf(ctx.__exit__(TypeError, TypeError("foo"), None))
+ self.assertFalse(ctx.__exit__(TypeError, TypeError("foo"), None))
def test_contextmanager_trap_yield_after_throw(self):
@contextmanager
@@ -84,7 +82,7 @@ class ContextManagerTestCase(unittest.TestCase):
raise ZeroDivisionError(999)
self.assertEqual(state, [1, 42, 999])
- def test_contextmanager_attribs(self):
+ def _create_contextmanager_attribs(self):
def attribs(**kw):
def decorate(func):
for k,v in kw.items():
@@ -95,8 +93,17 @@ class ContextManagerTestCase(unittest.TestCase):
@attribs(foo='bar')
def baz(spam):
"""Whee!"""
+ return baz
+
+ def test_contextmanager_attribs(self):
+ baz = self._create_contextmanager_attribs()
self.assertEqual(baz.__name__,'baz')
self.assertEqual(baz.foo, 'bar')
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_contextmanager_doc_attrib(self):
+ baz = self._create_contextmanager_attribs()
self.assertEqual(baz.__doc__, "Whee!")
class NestedTestCase(unittest.TestCase):
@@ -134,18 +141,14 @@ class NestedTestCase(unittest.TestCase):
yield 5
finally:
state.append(6)
- try:
+ with self.assertRaises(ZeroDivisionError):
with nested(a(), b()) as (x, y):
state.append(x)
state.append(y)
1 // 0
- except ZeroDivisionError:
- self.assertEqual(state, [1, 4, 2, 5, 6, 3])
- else:
- self.fail("Didn't raise ZeroDivisionError")
+ self.assertEqual(state, [1, 4, 2, 5, 6, 3])
def test_nested_right_exception(self):
- state = []
@contextmanager
def a():
yield 1
@@ -157,15 +160,10 @@ class NestedTestCase(unittest.TestCase):
raise Exception()
except:
pass
- try:
+ with self.assertRaises(ZeroDivisionError):
with nested(a(), b()) as (x, y):
1 // 0
- except ZeroDivisionError:
- self.assertEqual((x, y), (1, 2))
- except Exception:
- self.fail("Reraised wrong exception")
- else:
- self.fail("Didn't raise ZeroDivisionError")
+ self.assertEqual((x, y), (1, 2))
def test_nested_b_swallows(self):
@contextmanager
@@ -243,14 +241,11 @@ class ClosingTestCase(unittest.TestCase):
state.append(1)
x = C()
self.assertEqual(state, [])
- try:
+ with self.assertRaises(ZeroDivisionError):
with closing(x) as y:
self.assertEqual(x, y)
1 // 0
- except ZeroDivisionError:
- self.assertEqual(state, [1])
- else:
- self.fail("Didn't raise ZeroDivisionError")
+ self.assertEqual(state, [1])
class FileContextTestCase(unittest.TestCase):
@@ -259,40 +254,32 @@ class FileContextTestCase(unittest.TestCase):
try:
f = None
with open(tfn, "w") as f:
- self.failIf(f.closed)
+ self.assertFalse(f.closed)
f.write("Booh\n")
- self.failUnless(f.closed)
+ self.assertTrue(f.closed)
f = None
- try:
+ with self.assertRaises(ZeroDivisionError):
with open(tfn, "r") as f:
- self.failIf(f.closed)
+ self.assertFalse(f.closed)
self.assertEqual(f.read(), "Booh\n")
1 // 0
- except ZeroDivisionError:
- self.failUnless(f.closed)
- else:
- self.fail("Didn't raise ZeroDivisionError")
+ self.assertTrue(f.closed)
finally:
- try:
- os.remove(tfn)
- except os.error:
- pass
+ test_support.unlink(tfn)
+@unittest.skipUnless(threading, 'Threading required for this test.')
class LockContextTestCase(unittest.TestCase):
def boilerPlate(self, lock, locked):
- self.failIf(locked())
+ self.assertFalse(locked())
with lock:
- self.failUnless(locked())
- self.failIf(locked())
- try:
+ self.assertTrue(locked())
+ self.assertFalse(locked())
+ with self.assertRaises(ZeroDivisionError):
with lock:
- self.failUnless(locked())
+ self.assertTrue(locked())
1 // 0
- except ZeroDivisionError:
- self.failIf(locked())
- else:
- self.fail("Didn't raise ZeroDivisionError")
+ self.assertFalse(locked())
def testWithLock(self):
lock = threading.Lock()
@@ -330,8 +317,10 @@ class LockContextTestCase(unittest.TestCase):
# This is needed to make the test actually run under regrtest.py!
def test_main():
- test_support.run_unittest(__name__)
-
+ with test_support.check_warnings(("With-statements now directly support "
+ "multiple context managers",
+ DeprecationWarning)):
+ test_support.run_unittest(__name__)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_cookie.py b/Lib/test/test_cookie.py
index 839e3e076c..d09398dca1 100644
--- a/Lib/test/test_cookie.py
+++ b/Lib/test/test_cookie.py
@@ -47,17 +47,17 @@ class CookieTests(unittest.TestCase):
self.assertEqual(C.output(['path']),
'Set-Cookie: Customer="WILE_E_COYOTE"; Path=/acme')
- self.assertEqual(C.js_output(), """
+ self.assertEqual(C.js_output(), r"""
<script type="text/javascript">
<!-- begin hiding
- document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme; Version=1";
+ document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme; Version=1";
// end hiding -->
</script>
""")
- self.assertEqual(C.js_output(['path']), """
+ self.assertEqual(C.js_output(['path']), r"""
<script type="text/javascript">
<!-- begin hiding
- document.cookie = "Customer="WILE_E_COYOTE"; Path=/acme";
+ document.cookie = "Customer=\"WILE_E_COYOTE\"; Path=/acme";
// end hiding -->
</script>
""")
@@ -72,6 +72,14 @@ class CookieTests(unittest.TestCase):
self.assertEqual(C['Customer']['expires'],
'Wed, 01-Jan-98 00:00:00 GMT')
+ def test_extended_encode(self):
+ # Issue 9824: some browsers don't follow the standard; we now
+ # encode , and ; to keep them from tripping up.
+ C = Cookie.SimpleCookie()
+ C['val'] = "some,funky;stuff"
+ self.assertEqual(C.output(['val']),
+ 'Set-Cookie: val="some\\054funky\\073stuff"')
+
def test_quoted_meta(self):
# Try cookie with quoted meta-data
C = Cookie.SimpleCookie()
diff --git a/Lib/test/test_cookielib.py b/Lib/test/test_cookielib.py
index 1292b26793..dd0ad325d9 100644
--- a/Lib/test/test_cookielib.py
+++ b/Lib/test/test_cookielib.py
@@ -18,15 +18,15 @@ class DateTimeTests(TestCase):
base = 1019227000
day = 24*3600
- self.assertEquals(time2isoz(base), "2002-04-19 14:36:40Z")
- self.assertEquals(time2isoz(base+day), "2002-04-20 14:36:40Z")
- self.assertEquals(time2isoz(base+2*day), "2002-04-21 14:36:40Z")
- self.assertEquals(time2isoz(base+3*day), "2002-04-22 14:36:40Z")
+ self.assertEqual(time2isoz(base), "2002-04-19 14:36:40Z")
+ self.assertEqual(time2isoz(base+day), "2002-04-20 14:36:40Z")
+ self.assertEqual(time2isoz(base+2*day), "2002-04-21 14:36:40Z")
+ self.assertEqual(time2isoz(base+3*day), "2002-04-22 14:36:40Z")
az = time2isoz()
bz = time2isoz(500000)
for text in (az, bz):
- self.assert_(re.search(r"^\d{4}-\d\d-\d\d \d\d:\d\d:\d\dZ$", text),
+ self.assertTrue(re.search(r"^\d{4}-\d\d-\d\d \d\d:\d\d:\d\dZ$", text),
"bad time2isoz format: %s %s" % (az, bz))
def test_http2time(self):
@@ -35,13 +35,13 @@ class DateTimeTests(TestCase):
def parse_date(text):
return time.gmtime(http2time(text))[:6]
- self.assertEquals(parse_date("01 Jan 2001"), (2001, 1, 1, 0, 0, 0.0))
+ self.assertEqual(parse_date("01 Jan 2001"), (2001, 1, 1, 0, 0, 0.0))
# this test will break around year 2070
- self.assertEquals(parse_date("03-Feb-20"), (2020, 2, 3, 0, 0, 0.0))
+ self.assertEqual(parse_date("03-Feb-20"), (2020, 2, 3, 0, 0, 0.0))
# this test will break around year 2048
- self.assertEquals(parse_date("03-Feb-98"), (1998, 2, 3, 0, 0, 0.0))
+ self.assertEqual(parse_date("03-Feb-98"), (1998, 2, 3, 0, 0, 0.0))
def test_http2time_formats(self):
from cookielib import http2time, time2isoz
@@ -71,15 +71,15 @@ class DateTimeTests(TestCase):
test_t = 760233600 # assume broken POSIX counting of seconds
result = time2isoz(test_t)
expected = "1994-02-03 00:00:00Z"
- self.assertEquals(result, expected,
- "%s => '%s' (%s)" % (test_t, result, expected))
+ self.assertEqual(result, expected,
+ "%s => '%s' (%s)" % (test_t, result, expected))
for s in tests:
t = http2time(s)
t2 = http2time(s.lower())
t3 = http2time(s.upper())
- self.assert_(t == t2 == t3 == test_t,
+ self.assertTrue(t == t2 == t3 == test_t,
"'%s' => %s, %s, %s (%s)" % (s, t, t2, t3, test_t))
def test_http2time_garbage(self):
@@ -97,7 +97,7 @@ class DateTimeTests(TestCase):
'01-01-1980 00:61:00',
'01-01-1980 00:00:62',
]:
- self.assert_(http2time(test) is None,
+ self.assertTrue(http2time(test) is None,
"http2time(%s) is not None\n"
"http2time(test) %s" % (test, http2time(test))
)
@@ -114,7 +114,7 @@ class HeaderTests(TestCase):
'foo=bar; expires=01 Jan 2040 22:23:32 GMT',
'foo=bar; expires="01 Jan 2040 22:23:32 GMT"',
]:
- self.assertEquals(parse_ns_headers([hdr]), expected)
+ self.assertEqual(parse_ns_headers([hdr]), expected)
def test_parse_ns_headers_version(self):
from cookielib import parse_ns_headers
@@ -125,7 +125,7 @@ class HeaderTests(TestCase):
'foo=bar; version="1"',
'foo=bar; Version="1"',
]:
- self.assertEquals(parse_ns_headers([hdr]), expected)
+ self.assertEqual(parse_ns_headers([hdr]), expected)
def test_parse_ns_headers_special_names(self):
# names such as 'expires' are not special in first name=value pair
@@ -135,15 +135,15 @@ class HeaderTests(TestCase):
# Cookie with name 'expires'
hdr = 'expires=01 Jan 2040 22:23:32 GMT'
expected = [[("expires", "01 Jan 2040 22:23:32 GMT"), ("version", "0")]]
- self.assertEquals(parse_ns_headers([hdr]), expected)
+ self.assertEqual(parse_ns_headers([hdr]), expected)
def test_join_header_words(self):
from cookielib import join_header_words
joined = join_header_words([[("foo", None), ("bar", "baz")]])
- self.assertEquals(joined, "foo; bar=baz")
+ self.assertEqual(joined, "foo; bar=baz")
- self.assertEquals(join_header_words([[]]), "")
+ self.assertEqual(join_header_words([[]]), "")
def test_split_header_words(self):
from cookielib import split_header_words
@@ -175,7 +175,7 @@ class HeaderTests(TestCase):
f = StringIO.StringIO()
traceback.print_exc(None, f)
result = "(error -- traceback follows)\n\n%s" % f.getvalue()
- self.assertEquals(result, expect, """
+ self.assertEqual(result, expect, """
When parsing: '%s'
Expected: '%s'
Got: '%s'
@@ -209,7 +209,7 @@ Got: '%s'
for arg, expect in tests:
input = split_header_words([arg])
res = join_header_words(input)
- self.assertEquals(res, expect, """
+ self.assertEqual(res, expect, """
When parsing: '%s'
Expected: '%s'
Got: '%s'
@@ -366,8 +366,8 @@ class CookieTests(TestCase):
]:
request = urllib2.Request(url)
r = pol.domain_return_ok(domain, request)
- if ok: self.assert_(r)
- else: self.assert_(not r)
+ if ok: self.assertTrue(r)
+ else: self.assertTrue(not r)
def test_missing_value(self):
from cookielib import MozillaCookieJar, lwp_cookie_str
@@ -379,12 +379,12 @@ class CookieTests(TestCase):
interact_netscape(c, "http://www.acme.com/", 'eggs')
interact_netscape(c, "http://www.acme.com/", '"spam"; path=/foo/')
cookie = c._cookies["www.acme.com"]["/"]["eggs"]
- self.assert_(cookie.value is None)
- self.assertEquals(cookie.name, "eggs")
+ self.assertTrue(cookie.value is None)
+ self.assertEqual(cookie.name, "eggs")
cookie = c._cookies["www.acme.com"]['/foo/']['"spam"']
- self.assert_(cookie.value is None)
- self.assertEquals(cookie.name, '"spam"')
- self.assertEquals(lwp_cookie_str(cookie), (
+ self.assertTrue(cookie.value is None)
+ self.assertEqual(cookie.name, '"spam"')
+ self.assertEqual(lwp_cookie_str(cookie), (
r'"spam"; path="/foo/"; domain="www.acme.com"; '
'path_spec; discard; version=0'))
old_str = repr(c)
@@ -395,13 +395,13 @@ class CookieTests(TestCase):
finally:
os.unlink(c.filename)
# cookies unchanged apart from lost info re. whether path was specified
- self.assertEquals(
+ self.assertEqual(
repr(c),
re.sub("path_specified=%s" % True, "path_specified=%s" % False,
old_str)
)
- self.assertEquals(interact_netscape(c, "http://www.acme.com/foo/"),
- '"spam"; eggs')
+ self.assertEqual(interact_netscape(c, "http://www.acme.com/foo/"),
+ '"spam"; eggs')
def test_rfc2109_handling(self):
# RFC 2109 cookies are handled as RFC 2965 or Netscape cookies,
@@ -426,7 +426,7 @@ class CookieTests(TestCase):
try:
cookie = c._cookies["www.example.com"]["/"]["ni"]
except KeyError:
- self.assert_(version is None) # didn't expect a stored cookie
+ self.assertTrue(version is None) # didn't expect a stored cookie
else:
self.assertEqual(cookie.version, version)
# 2965 cookies are unaffected
@@ -449,29 +449,29 @@ class CookieTests(TestCase):
'expires="Foo Bar 25 33:22:11 3022"')
cookie = c._cookies[".acme.com"]["/"]["spam"]
- self.assertEquals(cookie.domain, ".acme.com")
- self.assert_(cookie.domain_specified)
- self.assertEquals(cookie.port, DEFAULT_HTTP_PORT)
- self.assert_(not cookie.port_specified)
+ self.assertEqual(cookie.domain, ".acme.com")
+ self.assertTrue(cookie.domain_specified)
+ self.assertEqual(cookie.port, DEFAULT_HTTP_PORT)
+ self.assertTrue(not cookie.port_specified)
# case is preserved
- self.assert_(cookie.has_nonstandard_attr("blArgh") and
+ self.assertTrue(cookie.has_nonstandard_attr("blArgh") and
not cookie.has_nonstandard_attr("blargh"))
cookie = c._cookies["www.acme.com"]["/"]["ni"]
- self.assertEquals(cookie.domain, "www.acme.com")
- self.assert_(not cookie.domain_specified)
- self.assertEquals(cookie.port, "80,8080")
- self.assert_(cookie.port_specified)
+ self.assertEqual(cookie.domain, "www.acme.com")
+ self.assertTrue(not cookie.domain_specified)
+ self.assertEqual(cookie.port, "80,8080")
+ self.assertTrue(cookie.port_specified)
cookie = c._cookies["www.acme.com"]["/"]["nini"]
- self.assert_(cookie.port is None)
- self.assert_(not cookie.port_specified)
+ self.assertTrue(cookie.port is None)
+ self.assertTrue(not cookie.port_specified)
# invalid expires should not cause cookie to be dropped
foo = c._cookies["www.acme.com"]["/"]["foo"]
spam = c._cookies["www.acme.com"]["/"]["foo"]
- self.assert_(foo.expires is None)
- self.assert_(spam.expires is None)
+ self.assertTrue(foo.expires is None)
+ self.assertTrue(spam.expires is None)
def test_ns_parser_special_names(self):
# names such as 'expires' are not special in first name=value pair
@@ -483,8 +483,8 @@ class CookieTests(TestCase):
interact_netscape(c, "http://www.acme.com/", 'version=eggs; spam=eggs')
cookies = c._cookies["www.acme.com"]["/"]
- self.assert_('expires' in cookies)
- self.assert_('version' in cookies)
+ self.assertTrue('expires' in cookies)
+ self.assertTrue('version' in cookies)
def test_expires(self):
from cookielib import time2netscape, CookieJar
@@ -494,14 +494,14 @@ class CookieTests(TestCase):
future = time2netscape(time.time()+3600)
interact_netscape(c, "http://www.acme.com/", 'spam="bar"; expires=%s' %
future)
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
now = time2netscape(time.time()-1)
# ... and if in past or present, discard it
interact_netscape(c, "http://www.acme.com/", 'foo="eggs"; expires=%s' %
now)
h = interact_netscape(c, "http://www.acme.com/")
- self.assertEquals(len(c), 1)
- self.assert_('spam="bar"' in h and "foo" not in h)
+ self.assertEqual(len(c), 1)
+ self.assertTrue('spam="bar"' in h and "foo" not in h)
# max-age takes precedence over expires, and zero max-age is request to
# delete both new cookie and any old matching cookie
@@ -509,20 +509,20 @@ class CookieTests(TestCase):
future)
interact_netscape(c, "http://www.acme.com/", 'bar="bar"; expires=%s' %
future)
- self.assertEquals(len(c), 3)
+ self.assertEqual(len(c), 3)
interact_netscape(c, "http://www.acme.com/", 'eggs="bar"; '
'expires=%s; max-age=0' % future)
interact_netscape(c, "http://www.acme.com/", 'bar="bar"; '
'max-age=0; expires=%s' % future)
h = interact_netscape(c, "http://www.acme.com/")
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
# test expiry at end of session for cookies with no expires attribute
interact_netscape(c, "http://www.rhubarb.net/", 'whum="fizz"')
- self.assertEquals(len(c), 2)
+ self.assertEqual(len(c), 2)
c.clear_session_cookies()
- self.assertEquals(len(c), 1)
- self.assert_('spam="bar"' in h)
+ self.assertEqual(len(c), 1)
+ self.assertIn('spam="bar"', h)
# XXX RFC 2965 expiry rules (some apply to V0 too)
@@ -534,39 +534,39 @@ class CookieTests(TestCase):
c = CookieJar(pol)
interact_2965(c, "http://www.acme.com/", 'spam="bar"; Version="1"')
- self.assert_("/" in c._cookies["www.acme.com"])
+ self.assertIn("/", c._cookies["www.acme.com"])
c = CookieJar(pol)
interact_2965(c, "http://www.acme.com/blah", 'eggs="bar"; Version="1"')
- self.assert_("/" in c._cookies["www.acme.com"])
+ self.assertIn("/", c._cookies["www.acme.com"])
c = CookieJar(pol)
interact_2965(c, "http://www.acme.com/blah/rhubarb",
'eggs="bar"; Version="1"')
- self.assert_("/blah/" in c._cookies["www.acme.com"])
+ self.assertIn("/blah/", c._cookies["www.acme.com"])
c = CookieJar(pol)
interact_2965(c, "http://www.acme.com/blah/rhubarb/",
'eggs="bar"; Version="1"')
- self.assert_("/blah/rhubarb/" in c._cookies["www.acme.com"])
+ self.assertIn("/blah/rhubarb/", c._cookies["www.acme.com"])
# Netscape
c = CookieJar()
interact_netscape(c, "http://www.acme.com/", 'spam="bar"')
- self.assert_("/" in c._cookies["www.acme.com"])
+ self.assertIn("/", c._cookies["www.acme.com"])
c = CookieJar()
interact_netscape(c, "http://www.acme.com/blah", 'eggs="bar"')
- self.assert_("/" in c._cookies["www.acme.com"])
+ self.assertIn("/", c._cookies["www.acme.com"])
c = CookieJar()
interact_netscape(c, "http://www.acme.com/blah/rhubarb", 'eggs="bar"')
- self.assert_("/blah" in c._cookies["www.acme.com"])
+ self.assertIn("/blah", c._cookies["www.acme.com"])
c = CookieJar()
interact_netscape(c, "http://www.acme.com/blah/rhubarb/", 'eggs="bar"')
- self.assert_("/blah/rhubarb" in c._cookies["www.acme.com"])
+ self.assertIn("/blah/rhubarb", c._cookies["www.acme.com"])
def test_default_path_with_query(self):
cj = cookielib.CookieJar()
@@ -574,9 +574,9 @@ class CookieTests(TestCase):
value = 'eggs="bar"'
interact_netscape(cj, uri, value)
# default path does not include query, so is "/", not "/?spam"
- self.assert_("/" in cj._cookies["example.com"])
+ self.assertIn("/", cj._cookies["example.com"])
# cookie is sent back to the same URI
- self.assertEquals(interact_netscape(cj, uri), value)
+ self.assertEqual(interact_netscape(cj, uri), value)
def test_escape_path(self):
from cookielib import escape_path
@@ -600,7 +600,7 @@ class CookieTests(TestCase):
(u"/foo/bar\uabcd", "/foo/bar%EA%AF%8D"), # UTF-8 encoded
]
for arg, result in cases:
- self.assertEquals(escape_path(arg), result)
+ self.assertEqual(escape_path(arg), result)
def test_request_path(self):
from urllib2 import Request
@@ -608,25 +608,25 @@ class CookieTests(TestCase):
# with parameters
req = Request("http://www.example.com/rheum/rhaponticum;"
"foo=bar;sing=song?apples=pears&spam=eggs#ni")
- self.assertEquals(request_path(req),
- "/rheum/rhaponticum;foo=bar;sing=song")
+ self.assertEqual(request_path(req),
+ "/rheum/rhaponticum;foo=bar;sing=song")
# without parameters
req = Request("http://www.example.com/rheum/rhaponticum?"
"apples=pears&spam=eggs#ni")
- self.assertEquals(request_path(req), "/rheum/rhaponticum")
+ self.assertEqual(request_path(req), "/rheum/rhaponticum")
# missing final slash
req = Request("http://www.example.com")
- self.assertEquals(request_path(req), "/")
+ self.assertEqual(request_path(req), "/")
def test_request_port(self):
from urllib2 import Request
from cookielib import request_port, DEFAULT_HTTP_PORT
req = Request("http://www.acme.com:1234/",
headers={"Host": "www.acme.com:4321"})
- self.assertEquals(request_port(req), "1234")
+ self.assertEqual(request_port(req), "1234")
req = Request("http://www.acme.com/",
headers={"Host": "www.acme.com:4321"})
- self.assertEquals(request_port(req), DEFAULT_HTTP_PORT)
+ self.assertEqual(request_port(req), DEFAULT_HTTP_PORT)
def test_request_host(self):
from urllib2 import Request
@@ -636,79 +636,79 @@ class CookieTests(TestCase):
headers={"Host": "www.acme.com:80"})
# libwww-perl wants this response, but that seems wrong (RFC 2616,
# section 5.2, point 1., and RFC 2965 section 1, paragraph 3)
- #self.assertEquals(request_host(req), "www.acme.com")
- self.assertEquals(request_host(req), "1.1.1.1")
+ #self.assertEqual(request_host(req), "www.acme.com")
+ self.assertEqual(request_host(req), "1.1.1.1")
req = Request("http://www.acme.com/",
headers={"Host": "irrelevant.com"})
- self.assertEquals(request_host(req), "www.acme.com")
+ self.assertEqual(request_host(req), "www.acme.com")
# not actually sure this one is valid Request object, so maybe should
# remove test for no host in url in request_host function?
req = Request("/resource.html",
headers={"Host": "www.acme.com"})
- self.assertEquals(request_host(req), "www.acme.com")
+ self.assertEqual(request_host(req), "www.acme.com")
# port shouldn't be in request-host
req = Request("http://www.acme.com:2345/resource.html",
headers={"Host": "www.acme.com:5432"})
- self.assertEquals(request_host(req), "www.acme.com")
+ self.assertEqual(request_host(req), "www.acme.com")
def test_is_HDN(self):
from cookielib import is_HDN
- self.assert_(is_HDN("foo.bar.com"))
- self.assert_(is_HDN("1foo2.3bar4.5com"))
- self.assert_(not is_HDN("192.168.1.1"))
- self.assert_(not is_HDN(""))
- self.assert_(not is_HDN("."))
- self.assert_(not is_HDN(".foo.bar.com"))
- self.assert_(not is_HDN("..foo"))
- self.assert_(not is_HDN("foo."))
+ self.assertTrue(is_HDN("foo.bar.com"))
+ self.assertTrue(is_HDN("1foo2.3bar4.5com"))
+ self.assertTrue(not is_HDN("192.168.1.1"))
+ self.assertTrue(not is_HDN(""))
+ self.assertTrue(not is_HDN("."))
+ self.assertTrue(not is_HDN(".foo.bar.com"))
+ self.assertTrue(not is_HDN("..foo"))
+ self.assertTrue(not is_HDN("foo."))
def test_reach(self):
from cookielib import reach
- self.assertEquals(reach("www.acme.com"), ".acme.com")
- self.assertEquals(reach("acme.com"), "acme.com")
- self.assertEquals(reach("acme.local"), ".local")
- self.assertEquals(reach(".local"), ".local")
- self.assertEquals(reach(".com"), ".com")
- self.assertEquals(reach("."), ".")
- self.assertEquals(reach(""), "")
- self.assertEquals(reach("192.168.0.1"), "192.168.0.1")
+ self.assertEqual(reach("www.acme.com"), ".acme.com")
+ self.assertEqual(reach("acme.com"), "acme.com")
+ self.assertEqual(reach("acme.local"), ".local")
+ self.assertEqual(reach(".local"), ".local")
+ self.assertEqual(reach(".com"), ".com")
+ self.assertEqual(reach("."), ".")
+ self.assertEqual(reach(""), "")
+ self.assertEqual(reach("192.168.0.1"), "192.168.0.1")
def test_domain_match(self):
from cookielib import domain_match, user_domain_match
- self.assert_(domain_match("192.168.1.1", "192.168.1.1"))
- self.assert_(not domain_match("192.168.1.1", ".168.1.1"))
- self.assert_(domain_match("x.y.com", "x.Y.com"))
- self.assert_(domain_match("x.y.com", ".Y.com"))
- self.assert_(not domain_match("x.y.com", "Y.com"))
- self.assert_(domain_match("a.b.c.com", ".c.com"))
- self.assert_(not domain_match(".c.com", "a.b.c.com"))
- self.assert_(domain_match("example.local", ".local"))
- self.assert_(not domain_match("blah.blah", ""))
- self.assert_(not domain_match("", ".rhubarb.rhubarb"))
- self.assert_(domain_match("", ""))
-
- self.assert_(user_domain_match("acme.com", "acme.com"))
- self.assert_(not user_domain_match("acme.com", ".acme.com"))
- self.assert_(user_domain_match("rhubarb.acme.com", ".acme.com"))
- self.assert_(user_domain_match("www.rhubarb.acme.com", ".acme.com"))
- self.assert_(user_domain_match("x.y.com", "x.Y.com"))
- self.assert_(user_domain_match("x.y.com", ".Y.com"))
- self.assert_(not user_domain_match("x.y.com", "Y.com"))
- self.assert_(user_domain_match("y.com", "Y.com"))
- self.assert_(not user_domain_match(".y.com", "Y.com"))
- self.assert_(user_domain_match(".y.com", ".Y.com"))
- self.assert_(user_domain_match("x.y.com", ".com"))
- self.assert_(not user_domain_match("x.y.com", "com"))
- self.assert_(not user_domain_match("x.y.com", "m"))
- self.assert_(not user_domain_match("x.y.com", ".m"))
- self.assert_(not user_domain_match("x.y.com", ""))
- self.assert_(not user_domain_match("x.y.com", "."))
- self.assert_(user_domain_match("192.168.1.1", "192.168.1.1"))
+ self.assertTrue(domain_match("192.168.1.1", "192.168.1.1"))
+ self.assertTrue(not domain_match("192.168.1.1", ".168.1.1"))
+ self.assertTrue(domain_match("x.y.com", "x.Y.com"))
+ self.assertTrue(domain_match("x.y.com", ".Y.com"))
+ self.assertTrue(not domain_match("x.y.com", "Y.com"))
+ self.assertTrue(domain_match("a.b.c.com", ".c.com"))
+ self.assertTrue(not domain_match(".c.com", "a.b.c.com"))
+ self.assertTrue(domain_match("example.local", ".local"))
+ self.assertTrue(not domain_match("blah.blah", ""))
+ self.assertTrue(not domain_match("", ".rhubarb.rhubarb"))
+ self.assertTrue(domain_match("", ""))
+
+ self.assertTrue(user_domain_match("acme.com", "acme.com"))
+ self.assertTrue(not user_domain_match("acme.com", ".acme.com"))
+ self.assertTrue(user_domain_match("rhubarb.acme.com", ".acme.com"))
+ self.assertTrue(user_domain_match("www.rhubarb.acme.com", ".acme.com"))
+ self.assertTrue(user_domain_match("x.y.com", "x.Y.com"))
+ self.assertTrue(user_domain_match("x.y.com", ".Y.com"))
+ self.assertTrue(not user_domain_match("x.y.com", "Y.com"))
+ self.assertTrue(user_domain_match("y.com", "Y.com"))
+ self.assertTrue(not user_domain_match(".y.com", "Y.com"))
+ self.assertTrue(user_domain_match(".y.com", ".Y.com"))
+ self.assertTrue(user_domain_match("x.y.com", ".com"))
+ self.assertTrue(not user_domain_match("x.y.com", "com"))
+ self.assertTrue(not user_domain_match("x.y.com", "m"))
+ self.assertTrue(not user_domain_match("x.y.com", ".m"))
+ self.assertTrue(not user_domain_match("x.y.com", ""))
+ self.assertTrue(not user_domain_match("x.y.com", "."))
+ self.assertTrue(user_domain_match("192.168.1.1", "192.168.1.1"))
# not both HDNs, so must string-compare equal to match
- self.assert_(not user_domain_match("192.168.1.1", ".168.1.1"))
- self.assert_(not user_domain_match("192.168.1.1", "."))
+ self.assertTrue(not user_domain_match("192.168.1.1", ".168.1.1"))
+ self.assertTrue(not user_domain_match("192.168.1.1", "."))
# empty string is a special case
- self.assert_(not user_domain_match("192.168.1.1", ""))
+ self.assertTrue(not user_domain_match("192.168.1.1", ""))
def test_wrong_domain(self):
# Cookies whose effective request-host name does not domain-match the
@@ -719,7 +719,7 @@ class CookieTests(TestCase):
c = CookieJar()
interact_2965(c, "http://www.nasty.com/",
'foo=bar; domain=friendly.org; Version="1"')
- self.assertEquals(len(c), 0)
+ self.assertEqual(len(c), 0)
def test_strict_domain(self):
# Cookies whose domain is a country-code tld like .co.uk should
@@ -731,11 +731,11 @@ class CookieTests(TestCase):
interact_netscape(cj, "http://example.co.uk/", 'no=problemo')
interact_netscape(cj, "http://example.co.uk/",
'okey=dokey; Domain=.example.co.uk')
- self.assertEquals(len(cj), 2)
+ self.assertEqual(len(cj), 2)
for pseudo_tld in [".co.uk", ".org.za", ".tx.us", ".name.us"]:
interact_netscape(cj, "http://example.%s/" % pseudo_tld,
'spam=eggs; Domain=.co.uk')
- self.assertEquals(len(cj), 2)
+ self.assertEqual(len(cj), 2)
def test_two_component_domain_ns(self):
# Netscape: .www.bar.com, www.bar.com, .bar.com, bar.com, no domain
@@ -747,17 +747,17 @@ class CookieTests(TestCase):
# two-component V0 domain is OK
interact_netscape(c, "http://foo.net/", 'ns=bar')
- self.assertEquals(len(c), 1)
- self.assertEquals(c._cookies["foo.net"]["/"]["ns"].value, "bar")
- self.assertEquals(interact_netscape(c, "http://foo.net/"), "ns=bar")
+ self.assertEqual(len(c), 1)
+ self.assertEqual(c._cookies["foo.net"]["/"]["ns"].value, "bar")
+ self.assertEqual(interact_netscape(c, "http://foo.net/"), "ns=bar")
# *will* be returned to any other domain (unlike RFC 2965)...
- self.assertEquals(interact_netscape(c, "http://www.foo.net/"),
- "ns=bar")
+ self.assertEqual(interact_netscape(c, "http://www.foo.net/"),
+ "ns=bar")
# ...unless requested otherwise
pol = DefaultCookiePolicy(
strict_ns_domain=DefaultCookiePolicy.DomainStrictNonDomain)
c.set_policy(pol)
- self.assertEquals(interact_netscape(c, "http://www.foo.net/"), "")
+ self.assertEqual(interact_netscape(c, "http://www.foo.net/"), "")
# unlike RFC 2965, even explicit two-component domain is OK,
# because .foo.net matches foo.net
@@ -766,17 +766,17 @@ class CookieTests(TestCase):
# even if starts with a dot -- in NS rules, .foo.net matches foo.net!
interact_netscape(c, "http://foo.net/foo/bar/",
'spam2=eggs; domain=.foo.net')
- self.assertEquals(len(c), 3)
- self.assertEquals(c._cookies[".foo.net"]["/foo"]["spam1"].value,
- "eggs")
- self.assertEquals(c._cookies[".foo.net"]["/foo/bar"]["spam2"].value,
- "eggs")
- self.assertEquals(interact_netscape(c, "http://foo.net/foo/bar/"),
- "spam2=eggs; spam1=eggs; ns=bar")
+ self.assertEqual(len(c), 3)
+ self.assertEqual(c._cookies[".foo.net"]["/foo"]["spam1"].value,
+ "eggs")
+ self.assertEqual(c._cookies[".foo.net"]["/foo/bar"]["spam2"].value,
+ "eggs")
+ self.assertEqual(interact_netscape(c, "http://foo.net/foo/bar/"),
+ "spam2=eggs; spam1=eggs; ns=bar")
# top-level domain is too general
interact_netscape(c, "http://foo.net/", 'nini="ni"; domain=.net')
- self.assertEquals(len(c), 3)
+ self.assertEqual(len(c), 3)
## # Netscape protocol doesn't allow non-special top level domains (such
## # as co.uk) in the domain attribute unless there are at least three
@@ -784,8 +784,8 @@ class CookieTests(TestCase):
# Oh yes it does! Real implementations don't check this, and real
# cookies (of course) rely on that behaviour.
interact_netscape(c, "http://foo.co.uk", 'nasty=trick; domain=.co.uk')
-## self.assertEquals(len(c), 2)
- self.assertEquals(len(c), 4)
+## self.assertEqual(len(c), 2)
+ self.assertEqual(len(c), 4)
def test_two_component_domain_rfc2965(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -795,43 +795,43 @@ class CookieTests(TestCase):
# two-component V1 domain is OK
interact_2965(c, "http://foo.net/", 'foo=bar; Version="1"')
- self.assertEquals(len(c), 1)
- self.assertEquals(c._cookies["foo.net"]["/"]["foo"].value, "bar")
- self.assertEquals(interact_2965(c, "http://foo.net/"),
- "$Version=1; foo=bar")
+ self.assertEqual(len(c), 1)
+ self.assertEqual(c._cookies["foo.net"]["/"]["foo"].value, "bar")
+ self.assertEqual(interact_2965(c, "http://foo.net/"),
+ "$Version=1; foo=bar")
# won't be returned to any other domain (because domain was implied)
- self.assertEquals(interact_2965(c, "http://www.foo.net/"), "")
+ self.assertEqual(interact_2965(c, "http://www.foo.net/"), "")
# unless domain is given explicitly, because then it must be
# rewritten to start with a dot: foo.net --> .foo.net, which does
# not domain-match foo.net
interact_2965(c, "http://foo.net/foo",
'spam=eggs; domain=foo.net; path=/foo; Version="1"')
- self.assertEquals(len(c), 1)
- self.assertEquals(interact_2965(c, "http://foo.net/foo"),
- "$Version=1; foo=bar")
+ self.assertEqual(len(c), 1)
+ self.assertEqual(interact_2965(c, "http://foo.net/foo"),
+ "$Version=1; foo=bar")
# explicit foo.net from three-component domain www.foo.net *does* get
# set, because .foo.net domain-matches .foo.net
interact_2965(c, "http://www.foo.net/foo/",
'spam=eggs; domain=foo.net; Version="1"')
- self.assertEquals(c._cookies[".foo.net"]["/foo/"]["spam"].value,
- "eggs")
- self.assertEquals(len(c), 2)
- self.assertEquals(interact_2965(c, "http://foo.net/foo/"),
- "$Version=1; foo=bar")
- self.assertEquals(interact_2965(c, "http://www.foo.net/foo/"),
- '$Version=1; spam=eggs; $Domain="foo.net"')
+ self.assertEqual(c._cookies[".foo.net"]["/foo/"]["spam"].value,
+ "eggs")
+ self.assertEqual(len(c), 2)
+ self.assertEqual(interact_2965(c, "http://foo.net/foo/"),
+ "$Version=1; foo=bar")
+ self.assertEqual(interact_2965(c, "http://www.foo.net/foo/"),
+ '$Version=1; spam=eggs; $Domain="foo.net"')
# top-level domain is too general
interact_2965(c, "http://foo.net/",
'ni="ni"; domain=".net"; Version="1"')
- self.assertEquals(len(c), 2)
+ self.assertEqual(len(c), 2)
# RFC 2965 doesn't require blocking this
interact_2965(c, "http://foo.co.uk/",
'nasty=trick; domain=.co.uk; Version="1"')
- self.assertEquals(len(c), 3)
+ self.assertEqual(len(c), 3)
def test_domain_allow(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -845,27 +845,27 @@ class CookieTests(TestCase):
headers = ["Set-Cookie: CUSTOMER=WILE_E_COYOTE; path=/"]
res = FakeResponse(headers, "http://acme.com/")
c.extract_cookies(res, req)
- self.assertEquals(len(c), 0)
+ self.assertEqual(len(c), 0)
req = Request("http://www.acme.com/")
res = FakeResponse(headers, "http://www.acme.com/")
c.extract_cookies(res, req)
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
req = Request("http://www.coyote.com/")
res = FakeResponse(headers, "http://www.coyote.com/")
c.extract_cookies(res, req)
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
# set a cookie with non-allowed domain...
req = Request("http://www.coyote.com/")
res = FakeResponse(headers, "http://www.coyote.com/")
cookies = c.make_cookies(res, req)
c.set_cookie(cookies[0])
- self.assertEquals(len(c), 2)
+ self.assertEqual(len(c), 2)
# ... and check is doesn't get returned
c.add_cookie_header(req)
- self.assert_(not req.has_header("Cookie"))
+ self.assertTrue(not req.has_header("Cookie"))
def test_domain_block(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -879,36 +879,36 @@ class CookieTests(TestCase):
req = Request("http://www.acme.com/")
res = FakeResponse(headers, "http://www.acme.com/")
c.extract_cookies(res, req)
- self.assertEquals(len(c), 0)
+ self.assertEqual(len(c), 0)
p = pol.set_blocked_domains(["acme.com"])
c.extract_cookies(res, req)
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
c.clear()
req = Request("http://www.roadrunner.net/")
res = FakeResponse(headers, "http://www.roadrunner.net/")
c.extract_cookies(res, req)
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
req = Request("http://www.roadrunner.net/")
c.add_cookie_header(req)
- self.assert_((req.has_header("Cookie") and
+ self.assertTrue((req.has_header("Cookie") and
req.has_header("Cookie2")))
c.clear()
pol.set_blocked_domains([".acme.com"])
c.extract_cookies(res, req)
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
# set a cookie with blocked domain...
req = Request("http://www.acme.com/")
res = FakeResponse(headers, "http://www.acme.com/")
cookies = c.make_cookies(res, req)
c.set_cookie(cookies[0])
- self.assertEquals(len(c), 2)
+ self.assertEqual(len(c), 2)
# ... and check is doesn't get returned
c.add_cookie_header(req)
- self.assert_(not req.has_header("Cookie"))
+ self.assertTrue(not req.has_header("Cookie"))
def test_secure(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -928,10 +928,10 @@ class CookieTests(TestCase):
url = "http://www.acme.com/"
int(c, url, "foo1=bar%s%s" % (vs, whitespace))
int(c, url, "foo2=bar%s; secure%s" % (vs, whitespace))
- self.assert_(
+ self.assertTrue(
not c._cookies["www.acme.com"]["/"]["foo1"].secure,
"non-secure cookie registered secure")
- self.assert_(
+ self.assertTrue(
c._cookies["www.acme.com"]["/"]["foo2"].secure,
"secure cookie registered non-secure")
@@ -940,7 +940,7 @@ class CookieTests(TestCase):
c = CookieJar(policy=DefaultCookiePolicy(rfc2965=True))
interact_2965(c, "http://www.acme.com/", r'foo=\b"a"r; Version=1')
h = interact_2965(c, "http://www.acme.com/")
- self.assertEquals(h, r'$Version=1; foo=\\b\"a\"r')
+ self.assertEqual(h, r'$Version=1; foo=\\b\"a\"r')
def test_missing_final_slash(self):
# Missing slash from request URL's abs_path should be assumed present.
@@ -950,9 +950,9 @@ class CookieTests(TestCase):
c = CookieJar(DefaultCookiePolicy(rfc2965=True))
interact_2965(c, url, "foo=bar; Version=1")
req = Request(url)
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
c.add_cookie_header(req)
- self.assert_(req.has_header("Cookie"))
+ self.assertTrue(req.has_header("Cookie"))
def test_domain_mirror(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -963,21 +963,21 @@ class CookieTests(TestCase):
url = "http://foo.bar.com/"
interact_2965(c, url, "spam=eggs; Version=1")
h = interact_2965(c, url)
- self.assert_("Domain" not in h,
- "absent domain returned with domain present")
+ self.assertNotIn("Domain", h,
+ "absent domain returned with domain present")
c = CookieJar(pol)
url = "http://foo.bar.com/"
interact_2965(c, url, 'spam=eggs; Version=1; Domain=.bar.com')
h = interact_2965(c, url)
- self.assert_('$Domain=".bar.com"' in h, "domain not returned")
+ self.assertIn('$Domain=".bar.com"', h, "domain not returned")
c = CookieJar(pol)
url = "http://foo.bar.com/"
# note missing initial dot in Domain
interact_2965(c, url, 'spam=eggs; Version=1; Domain=bar.com')
h = interact_2965(c, url)
- self.assert_('$Domain="bar.com"' in h, "domain not returned")
+ self.assertIn('$Domain="bar.com"', h, "domain not returned")
def test_path_mirror(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -988,14 +988,13 @@ class CookieTests(TestCase):
url = "http://foo.bar.com/"
interact_2965(c, url, "spam=eggs; Version=1")
h = interact_2965(c, url)
- self.assert_("Path" not in h,
- "absent path returned with path present")
+ self.assertNotIn("Path", h, "absent path returned with path present")
c = CookieJar(pol)
url = "http://foo.bar.com/"
interact_2965(c, url, 'spam=eggs; Version=1; Path=/')
h = interact_2965(c, url)
- self.assert_('$Path="/"' in h, "path not returned")
+ self.assertIn('$Path="/"', h, "path not returned")
def test_port_mirror(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -1006,30 +1005,29 @@ class CookieTests(TestCase):
url = "http://foo.bar.com/"
interact_2965(c, url, "spam=eggs; Version=1")
h = interact_2965(c, url)
- self.assert_("Port" not in h,
- "absent port returned with port present")
+ self.assertNotIn("Port", h, "absent port returned with port present")
c = CookieJar(pol)
url = "http://foo.bar.com/"
interact_2965(c, url, "spam=eggs; Version=1; Port")
h = interact_2965(c, url)
- self.assert_(re.search("\$Port([^=]|$)", h),
+ self.assertTrue(re.search("\$Port([^=]|$)", h),
"port with no value not returned with no value")
c = CookieJar(pol)
url = "http://foo.bar.com/"
interact_2965(c, url, 'spam=eggs; Version=1; Port="80"')
h = interact_2965(c, url)
- self.assert_('$Port="80"' in h,
- "port with single value not returned with single value")
+ self.assertIn('$Port="80"', h,
+ "port with single value not returned with single value")
c = CookieJar(pol)
url = "http://foo.bar.com/"
interact_2965(c, url, 'spam=eggs; Version=1; Port="80,8080"')
h = interact_2965(c, url)
- self.assert_('$Port="80,8080"' in h,
- "port with multiple values not returned with multiple "
- "values")
+ self.assertIn('$Port="80,8080"', h,
+ "port with multiple values not returned with multiple "
+ "values")
def test_no_return_comment(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -1040,7 +1038,7 @@ class CookieTests(TestCase):
'Comment="does anybody read these?"; '
'CommentURL="http://foo.bar.net/comment.html"')
h = interact_2965(c, url)
- self.assert_(
+ self.assertTrue(
"Comment" not in h,
"Comment or CommentURL cookie-attributes returned to server")
@@ -1071,34 +1069,34 @@ class CookieTests(TestCase):
for i in range(4):
i = 0
for c in cs:
- self.assert_(isinstance(c, Cookie))
- self.assertEquals(c.version, versions[i])
- self.assertEquals(c.name, names[i])
- self.assertEquals(c.domain, domains[i])
- self.assertEquals(c.path, paths[i])
+ self.assertIsInstance(c, Cookie)
+ self.assertEqual(c.version, versions[i])
+ self.assertEqual(c.name, names[i])
+ self.assertEqual(c.domain, domains[i])
+ self.assertEqual(c.path, paths[i])
i = i + 1
def test_parse_ns_headers(self):
from cookielib import parse_ns_headers
# missing domain value (invalid cookie)
- self.assertEquals(
+ self.assertEqual(
parse_ns_headers(["foo=bar; path=/; domain"]),
[[("foo", "bar"),
("path", "/"), ("domain", None), ("version", "0")]]
)
# invalid expires value
- self.assertEquals(
+ self.assertEqual(
parse_ns_headers(["foo=bar; expires=Foo Bar 12 33:22:11 2000"]),
[[("foo", "bar"), ("expires", None), ("version", "0")]]
)
# missing cookie value (valid cookie)
- self.assertEquals(
+ self.assertEqual(
parse_ns_headers(["foo"]),
[[("foo", None), ("version", "0")]]
)
# shouldn't add version if header is empty
- self.assertEquals(parse_ns_headers([""]), [])
+ self.assertEqual(parse_ns_headers([""]), [])
def test_bad_cookie_header(self):
@@ -1124,13 +1122,13 @@ class CookieTests(TestCase):
]:
c = cookiejar_from_cookie_headers(headers)
# these bad cookies shouldn't be set
- self.assertEquals(len(c), 0)
+ self.assertEqual(len(c), 0)
# cookie with invalid expires is treated as session cookie
headers = ["Set-Cookie: c=foo; expires=Foo Bar 12 33:22:11 2000"]
c = cookiejar_from_cookie_headers(headers)
cookie = c._cookies["www.example.com"]["/"]["c"]
- self.assert_(cookie.expires is None)
+ self.assertTrue(cookie.expires is None)
class LWPCookieTests(TestCase):
@@ -1207,8 +1205,8 @@ class LWPCookieTests(TestCase):
c.add_cookie_header(req)
h = req.get_header("Cookie")
- self.assert_("PART_NUMBER=ROCKET_LAUNCHER_0001" in h and
- "CUSTOMER=WILE_E_COYOTE" in h)
+ self.assertIn("PART_NUMBER=ROCKET_LAUNCHER_0001", h)
+ self.assertIn("CUSTOMER=WILE_E_COYOTE", h)
headers.append('Set-Cookie: SHIPPING=FEDEX; path=/foo')
res = FakeResponse(headers, "http://www.acme.com")
@@ -1218,17 +1216,17 @@ class LWPCookieTests(TestCase):
c.add_cookie_header(req)
h = req.get_header("Cookie")
- self.assert_("PART_NUMBER=ROCKET_LAUNCHER_0001" in h and
- "CUSTOMER=WILE_E_COYOTE" in h and
- "SHIPPING=FEDEX" not in h)
+ self.assertIn("PART_NUMBER=ROCKET_LAUNCHER_0001", h)
+ self.assertIn("CUSTOMER=WILE_E_COYOTE", h)
+ self.assertNotIn("SHIPPING=FEDEX", h)
req = Request("http://www.acme.com/foo/")
c.add_cookie_header(req)
h = req.get_header("Cookie")
- self.assert_(("PART_NUMBER=ROCKET_LAUNCHER_0001" in h and
- "CUSTOMER=WILE_E_COYOTE" in h and
- h.startswith("SHIPPING=FEDEX;")))
+ self.assertIn("PART_NUMBER=ROCKET_LAUNCHER_0001", h)
+ self.assertIn("CUSTOMER=WILE_E_COYOTE", h)
+ self.assertTrue(h.startswith("SHIPPING=FEDEX;"))
def test_netscape_example_2(self):
from cookielib import CookieJar
@@ -1269,7 +1267,7 @@ class LWPCookieTests(TestCase):
req = Request("http://www.acme.com/")
c.add_cookie_header(req)
- self.assertEquals(req.get_header("Cookie"),
+ self.assertEqual(req.get_header("Cookie"),
"PART_NUMBER=ROCKET_LAUNCHER_0001")
headers.append(
@@ -1280,7 +1278,7 @@ class LWPCookieTests(TestCase):
req = Request("http://www.acme.com/ammo")
c.add_cookie_header(req)
- self.assert_(re.search(r"PART_NUMBER=RIDING_ROCKET_0023;\s*"
+ self.assertTrue(re.search(r"PART_NUMBER=RIDING_ROCKET_0023;\s*"
"PART_NUMBER=ROCKET_LAUNCHER_0001",
req.get_header("Cookie")))
@@ -1316,7 +1314,7 @@ class LWPCookieTests(TestCase):
cookie = interact_2965(
c, 'http://www.acme.com/acme/login',
'Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"')
- self.assert_(not cookie)
+ self.assertTrue(not cookie)
#
# 3. User Agent -> Server
@@ -1338,7 +1336,7 @@ class LWPCookieTests(TestCase):
cookie = interact_2965(c, 'http://www.acme.com/acme/pickitem',
'Part_Number="Rocket_Launcher_0001"; '
'Version="1"; Path="/acme"');
- self.assert_(re.search(
+ self.assertTrue(re.search(
r'^\$Version="?1"?; Customer="?WILE_E_COYOTE"?; \$Path="/acme"$',
cookie))
@@ -1363,10 +1361,10 @@ class LWPCookieTests(TestCase):
cookie = interact_2965(c, "http://www.acme.com/acme/shipping",
'Shipping="FedEx"; Version="1"; Path="/acme"')
- self.assert_(re.search(r'^\$Version="?1"?;', cookie))
- self.assert_(re.search(r'Part_Number="?Rocket_Launcher_0001"?;'
+ self.assertTrue(re.search(r'^\$Version="?1"?;', cookie))
+ self.assertTrue(re.search(r'Part_Number="?Rocket_Launcher_0001"?;'
'\s*\$Path="\/acme"', cookie))
- self.assert_(re.search(r'Customer="?WILE_E_COYOTE"?;\s*\$Path="\/acme"',
+ self.assertTrue(re.search(r'Customer="?WILE_E_COYOTE"?;\s*\$Path="\/acme"',
cookie))
#
@@ -1388,7 +1386,7 @@ class LWPCookieTests(TestCase):
# Transaction is complete.
cookie = interact_2965(c, "http://www.acme.com/acme/process")
- self.assert_(
+ self.assertTrue(
re.search(r'Shipping="?FedEx"?;\s*\$Path="\/acme"', cookie) and
"WILE_E_COYOTE" in cookie)
@@ -1439,7 +1437,7 @@ class LWPCookieTests(TestCase):
# than once.
cookie = interact_2965(c, "http://www.acme.com/acme/ammo/...")
- self.assert_(
+ self.assertTrue(
re.search(r"Riding_Rocket_0023.*Rocket_Launcher_0001", cookie))
# A subsequent request by the user agent to the (same) server for a URL of
@@ -1452,8 +1450,8 @@ class LWPCookieTests(TestCase):
# the server.
cookie = interact_2965(c, "http://www.acme.com/acme/parts/")
- self.assert_("Rocket_Launcher_0001" in cookie and
- "Riding_Rocket_0023" not in cookie)
+ self.assertIn("Rocket_Launcher_0001", cookie)
+ self.assertNotIn("Riding_Rocket_0023", cookie)
def test_rejection(self):
# Test rejection of Set-Cookie2 responses based on domain, path, port.
@@ -1468,45 +1466,45 @@ class LWPCookieTests(TestCase):
# illegal domain (no embedded dots)
cookie = interact_2965(c, "http://www.acme.com",
'foo=bar; domain=".com"; version=1')
- self.assert_(not c)
+ self.assertTrue(not c)
# legal domain
cookie = interact_2965(c, "http://www.acme.com",
'ping=pong; domain="acme.com"; version=1')
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
# illegal domain (host prefix "www.a" contains a dot)
cookie = interact_2965(c, "http://www.a.acme.com",
'whiz=bang; domain="acme.com"; version=1')
- self.assertEquals(len(c), 1)
+ self.assertEqual(len(c), 1)
# legal domain
cookie = interact_2965(c, "http://www.a.acme.com",
'wow=flutter; domain=".a.acme.com"; version=1')
- self.assertEquals(len(c), 2)
+ self.assertEqual(len(c), 2)
# can't partially match an IP-address
cookie = interact_2965(c, "http://125.125.125.125",
'zzzz=ping; domain="125.125.125"; version=1')
- self.assertEquals(len(c), 2)
+ self.assertEqual(len(c), 2)
# illegal path (must be prefix of request path)
cookie = interact_2965(c, "http://www.sol.no",
'blah=rhubarb; domain=".sol.no"; path="/foo"; '
'version=1')
- self.assertEquals(len(c), 2)
+ self.assertEqual(len(c), 2)
# legal path
cookie = interact_2965(c, "http://www.sol.no/foo/bar",
'bing=bong; domain=".sol.no"; path="/foo"; '
'version=1')
- self.assertEquals(len(c), 3)
+ self.assertEqual(len(c), 3)
# illegal port (request-port not in list)
cookie = interact_2965(c, "http://www.sol.no",
'whiz=ffft; domain=".sol.no"; port="90,100"; '
'version=1')
- self.assertEquals(len(c), 3)
+ self.assertEqual(len(c), 3)
# legal port
cookie = interact_2965(
@@ -1514,13 +1512,13 @@ class LWPCookieTests(TestCase):
r'bang=wallop; version=1; domain=".sol.no"; '
r'port="90,100, 80,8080"; '
r'max-age=100; Comment = "Just kidding! (\"|\\\\) "')
- self.assertEquals(len(c), 4)
+ self.assertEqual(len(c), 4)
# port attribute without any value (current port)
cookie = interact_2965(c, "http://www.sol.no",
'foo9=bar; version=1; domain=".sol.no"; port; '
'max-age=100;')
- self.assertEquals(len(c), 5)
+ self.assertEqual(len(c), 5)
# encoded path
# LWP has this test, but unescaping allowed path characters seems
@@ -1531,7 +1529,7 @@ class LWPCookieTests(TestCase):
# character:
cookie = interact_2965(c, "http://www.sol.no/<oo/",
r'foo8=bar; version=1; path="/%3coo"')
- self.assertEquals(len(c), 6)
+ self.assertEqual(len(c), 6)
# save and restore
filename = test_support.TESTFN
@@ -1546,7 +1544,7 @@ class LWPCookieTests(TestCase):
try: os.unlink(filename)
except OSError: pass
- self.assertEquals(old, repr(c))
+ self.assertEqual(old, repr(c))
def test_url_encoding(self):
# Try some URL encodings of the PATHs.
@@ -1561,11 +1559,11 @@ class LWPCookieTests(TestCase):
c, "http://www.acme.com/foo%2f%25/<<%0anewå/æøå",
'bar=baz; path="/foo/"; version=1');
version_re = re.compile(r'^\$version=\"?1\"?', re.I)
- self.assert_("foo=bar" in cookie and version_re.search(cookie))
+ self.assertTrue("foo=bar" in cookie and version_re.search(cookie))
cookie = interact_2965(
c, "http://www.acme.com/foo/%25/<<%0anewå/æøå")
- self.assert_(not cookie)
+ self.assertTrue(not cookie)
# unicode URL doesn't raise exception
cookie = interact_2965(c, u"http://www.acme.com/\xfc")
@@ -1606,12 +1604,12 @@ class LWPCookieTests(TestCase):
return new_c
new_c = save_and_restore(c, True)
- self.assertEquals(len(new_c), 6) # none discarded
- self.assert_("name='foo1', value='bar'" in repr(new_c))
+ self.assertEqual(len(new_c), 6) # none discarded
+ self.assertIn("name='foo1', value='bar'", repr(new_c))
new_c = save_and_restore(c, False)
- self.assertEquals(len(new_c), 4) # 2 of them discarded on save
- self.assert_("name='foo1', value='bar'" in repr(new_c))
+ self.assertEqual(len(new_c), 4) # 2 of them discarded on save
+ self.assertIn("name='foo1', value='bar'", repr(new_c))
def test_netscape_misc(self):
# Some additional Netscape cookies tests.
@@ -1636,7 +1634,7 @@ class LWPCookieTests(TestCase):
req = Request("http://foo.bar.acme.com/foo")
c.add_cookie_header(req)
- self.assert_(
+ self.assertTrue(
"PART_NUMBER=3,4" in req.get_header("Cookie") and
"Customer=WILE_E_COYOTE" in req.get_header("Cookie"))
@@ -1649,11 +1647,12 @@ class LWPCookieTests(TestCase):
"foo1=bar; PORT; Discard; Version=1;")
cookie = interact_2965(c, "http://example/",
'foo2=bar; domain=".local"; Version=1')
- self.assert_("foo1=bar" in cookie)
+ self.assertIn("foo1=bar", cookie)
interact_2965(c, "http://example/", 'foo3=bar; Version=1')
cookie = interact_2965(c, "http://example/")
- self.assert_("foo2=bar" in cookie and len(c) == 3)
+ self.assertIn("foo2=bar", cookie)
+ self.assertEqual(len(c), 3)
def test_intranet_domains_ns(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -1662,12 +1661,12 @@ class LWPCookieTests(TestCase):
interact_netscape(c, "http://example/", "foo1=bar")
cookie = interact_netscape(c, "http://example/",
'foo2=bar; domain=.local')
- self.assertEquals(len(c), 2)
- self.assert_("foo1=bar" in cookie)
+ self.assertEqual(len(c), 2)
+ self.assertIn("foo1=bar", cookie)
cookie = interact_netscape(c, "http://example/")
- self.assert_("foo2=bar" in cookie)
- self.assertEquals(len(c), 2)
+ self.assertIn("foo2=bar", cookie)
+ self.assertEqual(len(c), 2)
def test_empty_path(self):
from cookielib import CookieJar, DefaultCookiePolicy
@@ -1691,17 +1690,17 @@ class LWPCookieTests(TestCase):
req = Request("http://www.ants.com/")
c.add_cookie_header(req)
- self.assertEquals(req.get_header("Cookie"),
- "JSESSIONID=ABCDERANDOM123")
- self.assertEquals(req.get_header("Cookie2"), '$Version="1"')
+ self.assertEqual(req.get_header("Cookie"),
+ "JSESSIONID=ABCDERANDOM123")
+ self.assertEqual(req.get_header("Cookie2"), '$Version="1"')
# missing path in the request URI
req = Request("http://www.ants.com:8080")
c.add_cookie_header(req)
- self.assertEquals(req.get_header("Cookie"),
- "JSESSIONID=ABCDERANDOM123")
- self.assertEquals(req.get_header("Cookie2"), '$Version="1"')
+ self.assertEqual(req.get_header("Cookie"),
+ "JSESSIONID=ABCDERANDOM123")
+ self.assertEqual(req.get_header("Cookie2"), '$Version="1"')
def test_session_cookies(self):
from cookielib import CookieJar
@@ -1741,7 +1740,7 @@ class LWPCookieTests(TestCase):
key = "%s_after" % cookie.value
counter[key] = counter[key] + 1
- self.assert_(not (
+ self.assertTrue(not (
# a permanent cookie got lost accidentally
counter["perm_after"] != counter["perm_before"] or
# a session cookie hasn't been cleared
@@ -1751,7 +1750,6 @@ class LWPCookieTests(TestCase):
def test_main(verbose=None):
- from test import test_sets
test_support.run_unittest(
DateTimeTests,
HeaderTests,
diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py
index be334ccf05..6b64f10112 100644
--- a/Lib/test/test_copy.py
+++ b/Lib/test/test_copy.py
@@ -2,6 +2,7 @@
import copy
import copy_reg
+import weakref
import unittest
from test import test_support
@@ -11,8 +12,8 @@ class TestCopy(unittest.TestCase):
# Attempt full line coverage of copy.py from top to bottom
def test_exceptions(self):
- self.assert_(copy.Error is copy.error)
- self.assert_(issubclass(copy.Error, Exception))
+ self.assertTrue(copy.Error is copy.error)
+ self.assertTrue(issubclass(copy.Error, Exception))
# The copy() method
@@ -53,7 +54,7 @@ class TestCopy(unittest.TestCase):
raise test_support.TestFailed, "shouldn't call this"
x = C()
y = copy.copy(x)
- self.assert_(y is x)
+ self.assertTrue(y is x)
def test_copy_reduce(self):
class C(object):
@@ -61,7 +62,7 @@ class TestCopy(unittest.TestCase):
return ""
x = C()
y = copy.copy(x)
- self.assert_(y is x)
+ self.assertTrue(y is x)
def test_copy_cant(self):
class C(object):
@@ -85,7 +86,7 @@ class TestCopy(unittest.TestCase):
"hello", u"hello\u1234", f.func_code,
NewStyle, xrange(10), Classic, max]
for x in tests:
- self.assert_(copy.copy(x) is x, repr(x))
+ self.assertTrue(copy.copy(x) is x, repr(x))
def test_copy_list(self):
x = [1, 2, 3]
@@ -179,9 +180,9 @@ class TestCopy(unittest.TestCase):
x = [x, x]
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(y is not x)
- self.assert_(y[0] is not x[0])
- self.assert_(y[0] is y[1])
+ self.assertTrue(y is not x)
+ self.assertTrue(y[0] is not x[0])
+ self.assertTrue(y[0] is y[1])
def test_deepcopy_issubclass(self):
# XXX Note: there's no way to test the TypeError coming out of
@@ -226,7 +227,7 @@ class TestCopy(unittest.TestCase):
raise test_support.TestFailed, "shouldn't call this"
x = C()
y = copy.deepcopy(x)
- self.assert_(y is x)
+ self.assertTrue(y is x)
def test_deepcopy_reduce(self):
class C(object):
@@ -234,7 +235,7 @@ class TestCopy(unittest.TestCase):
return ""
x = C()
y = copy.deepcopy(x)
- self.assert_(y is x)
+ self.assertTrue(y is x)
def test_deepcopy_cant(self):
class C(object):
@@ -258,61 +259,61 @@ class TestCopy(unittest.TestCase):
"hello", u"hello\u1234", f.func_code,
NewStyle, xrange(10), Classic, max]
for x in tests:
- self.assert_(copy.deepcopy(x) is x, repr(x))
+ self.assertTrue(copy.deepcopy(x) is x, repr(x))
def test_deepcopy_list(self):
x = [[1, 2], 3]
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(x is not y)
- self.assert_(x[0] is not y[0])
+ self.assertTrue(x is not y)
+ self.assertTrue(x[0] is not y[0])
def test_deepcopy_reflexive_list(self):
x = []
x.append(x)
y = copy.deepcopy(x)
self.assertRaises(RuntimeError, cmp, y, x)
- self.assert_(y is not x)
- self.assert_(y[0] is y)
+ self.assertTrue(y is not x)
+ self.assertTrue(y[0] is y)
self.assertEqual(len(y), 1)
def test_deepcopy_tuple(self):
x = ([1, 2], 3)
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(x is not y)
- self.assert_(x[0] is not y[0])
+ self.assertTrue(x is not y)
+ self.assertTrue(x[0] is not y[0])
def test_deepcopy_reflexive_tuple(self):
x = ([],)
x[0].append(x)
y = copy.deepcopy(x)
self.assertRaises(RuntimeError, cmp, y, x)
- self.assert_(y is not x)
- self.assert_(y[0] is not x[0])
- self.assert_(y[0][0] is y)
+ self.assertTrue(y is not x)
+ self.assertTrue(y[0] is not x[0])
+ self.assertTrue(y[0][0] is y)
def test_deepcopy_dict(self):
x = {"foo": [1, 2], "bar": 3}
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(x is not y)
- self.assert_(x["foo"] is not y["foo"])
+ self.assertTrue(x is not y)
+ self.assertTrue(x["foo"] is not y["foo"])
def test_deepcopy_reflexive_dict(self):
x = {}
x['foo'] = x
y = copy.deepcopy(x)
self.assertRaises(RuntimeError, cmp, y, x)
- self.assert_(y is not x)
- self.assert_(y['foo'] is y)
+ self.assertTrue(y is not x)
+ self.assertTrue(y['foo'] is y)
self.assertEqual(len(y), 1)
def test_deepcopy_keepalive(self):
memo = {}
x = 42
y = copy.deepcopy(x, memo)
- self.assert_(memo[id(x)] is x)
+ self.assertTrue(memo[id(x)] is x)
def test_deepcopy_inst_vanilla(self):
class C:
@@ -323,7 +324,7 @@ class TestCopy(unittest.TestCase):
x = C([42])
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(y.foo is not x.foo)
+ self.assertTrue(y.foo is not x.foo)
def test_deepcopy_inst_deepcopy(self):
class C:
@@ -336,8 +337,8 @@ class TestCopy(unittest.TestCase):
x = C([42])
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(y is not x)
- self.assert_(y.foo is not x.foo)
+ self.assertTrue(y is not x)
+ self.assertTrue(y.foo is not x.foo)
def test_deepcopy_inst_getinitargs(self):
class C:
@@ -350,8 +351,8 @@ class TestCopy(unittest.TestCase):
x = C([42])
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(y is not x)
- self.assert_(y.foo is not x.foo)
+ self.assertTrue(y is not x)
+ self.assertTrue(y.foo is not x.foo)
def test_deepcopy_inst_getstate(self):
class C:
@@ -364,8 +365,8 @@ class TestCopy(unittest.TestCase):
x = C([42])
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(y is not x)
- self.assert_(y.foo is not x.foo)
+ self.assertTrue(y is not x)
+ self.assertTrue(y.foo is not x.foo)
def test_deepcopy_inst_setstate(self):
class C:
@@ -378,8 +379,8 @@ class TestCopy(unittest.TestCase):
x = C([42])
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(y is not x)
- self.assert_(y.foo is not x.foo)
+ self.assertTrue(y is not x)
+ self.assertTrue(y.foo is not x.foo)
def test_deepcopy_inst_getstate_setstate(self):
class C:
@@ -394,8 +395,8 @@ class TestCopy(unittest.TestCase):
x = C([42])
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(y is not x)
- self.assert_(y.foo is not x.foo)
+ self.assertTrue(y is not x)
+ self.assertTrue(y.foo is not x.foo)
def test_deepcopy_reflexive_inst(self):
class C:
@@ -403,8 +404,8 @@ class TestCopy(unittest.TestCase):
x = C()
x.foo = x
y = copy.deepcopy(x)
- self.assert_(y is not x)
- self.assert_(y.foo is y)
+ self.assertTrue(y is not x)
+ self.assertTrue(y.foo is y)
# _reconstruct()
@@ -414,9 +415,9 @@ class TestCopy(unittest.TestCase):
return ""
x = C()
y = copy.copy(x)
- self.assert_(y is x)
+ self.assertTrue(y is x)
y = copy.deepcopy(x)
- self.assert_(y is x)
+ self.assertTrue(y is x)
def test_reconstruct_nostate(self):
class C(object):
@@ -425,9 +426,9 @@ class TestCopy(unittest.TestCase):
x = C()
x.foo = 42
y = copy.copy(x)
- self.assert_(y.__class__ is x.__class__)
+ self.assertTrue(y.__class__ is x.__class__)
y = copy.deepcopy(x)
- self.assert_(y.__class__ is x.__class__)
+ self.assertTrue(y.__class__ is x.__class__)
def test_reconstruct_state(self):
class C(object):
@@ -442,7 +443,7 @@ class TestCopy(unittest.TestCase):
self.assertEqual(y, x)
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(y.foo is not x.foo)
+ self.assertTrue(y.foo is not x.foo)
def test_reconstruct_state_setstate(self):
class C(object):
@@ -459,7 +460,7 @@ class TestCopy(unittest.TestCase):
self.assertEqual(y, x)
y = copy.deepcopy(x)
self.assertEqual(y, x)
- self.assert_(y.foo is not x.foo)
+ self.assertTrue(y.foo is not x.foo)
def test_reconstruct_reflexive(self):
class C(object):
@@ -467,8 +468,8 @@ class TestCopy(unittest.TestCase):
x = C()
x.foo = x
y = copy.deepcopy(x)
- self.assert_(y is not x)
- self.assert_(y.foo is y)
+ self.assertTrue(y is not x)
+ self.assertTrue(y.foo is y)
# Additions for Python 2.3 and pickle protocol 2
@@ -483,12 +484,12 @@ class TestCopy(unittest.TestCase):
x = C([[1, 2], 3])
y = copy.copy(x)
self.assertEqual(x, y)
- self.assert_(x is not y)
- self.assert_(x[0] is y[0])
+ self.assertTrue(x is not y)
+ self.assertTrue(x[0] is y[0])
y = copy.deepcopy(x)
self.assertEqual(x, y)
- self.assert_(x is not y)
- self.assert_(x[0] is not y[0])
+ self.assertTrue(x is not y)
+ self.assertTrue(x[0] is not y[0])
def test_reduce_5tuple(self):
class C(dict):
@@ -501,12 +502,12 @@ class TestCopy(unittest.TestCase):
x = C([("foo", [1, 2]), ("bar", 3)])
y = copy.copy(x)
self.assertEqual(x, y)
- self.assert_(x is not y)
- self.assert_(x["foo"] is y["foo"])
+ self.assertTrue(x is not y)
+ self.assertTrue(x["foo"] is y["foo"])
y = copy.deepcopy(x)
self.assertEqual(x, y)
- self.assert_(x is not y)
- self.assert_(x["foo"] is not y["foo"])
+ self.assertTrue(x is not y)
+ self.assertTrue(x["foo"] is not y["foo"])
def test_copy_slots(self):
class C(object):
@@ -514,7 +515,7 @@ class TestCopy(unittest.TestCase):
x = C()
x.foo = [42]
y = copy.copy(x)
- self.assert_(x.foo is y.foo)
+ self.assertTrue(x.foo is y.foo)
def test_deepcopy_slots(self):
class C(object):
@@ -523,7 +524,27 @@ class TestCopy(unittest.TestCase):
x.foo = [42]
y = copy.deepcopy(x)
self.assertEqual(x.foo, y.foo)
- self.assert_(x.foo is not y.foo)
+ self.assertTrue(x.foo is not y.foo)
+
+ def test_deepcopy_dict_subclass(self):
+ class C(dict):
+ def __init__(self, d=None):
+ if not d:
+ d = {}
+ self._keys = list(d.keys())
+ dict.__init__(self, d)
+ def __setitem__(self, key, item):
+ dict.__setitem__(self, key, item)
+ if key not in self._keys:
+ self._keys.append(key)
+ x = C(d={'foo':0})
+ y = copy.deepcopy(x)
+ self.assertEqual(x, y)
+ self.assertEqual(x._keys, y._keys)
+ self.assertTrue(x is not y)
+ x['bar'] = 1
+ self.assertNotEqual(x, y)
+ self.assertNotEqual(x._keys, y._keys)
def test_copy_list_subclass(self):
class C(list):
@@ -533,8 +554,8 @@ class TestCopy(unittest.TestCase):
y = copy.copy(x)
self.assertEqual(list(x), list(y))
self.assertEqual(x.foo, y.foo)
- self.assert_(x[0] is y[0])
- self.assert_(x.foo is y.foo)
+ self.assertTrue(x[0] is y[0])
+ self.assertTrue(x.foo is y.foo)
def test_deepcopy_list_subclass(self):
class C(list):
@@ -544,8 +565,8 @@ class TestCopy(unittest.TestCase):
y = copy.deepcopy(x)
self.assertEqual(list(x), list(y))
self.assertEqual(x.foo, y.foo)
- self.assert_(x[0] is not y[0])
- self.assert_(x.foo is not y.foo)
+ self.assertTrue(x[0] is not y[0])
+ self.assertTrue(x.foo is not y.foo)
def test_copy_tuple_subclass(self):
class C(tuple):
@@ -562,8 +583,8 @@ class TestCopy(unittest.TestCase):
self.assertEqual(tuple(x), ([1, 2], 3))
y = copy.deepcopy(x)
self.assertEqual(tuple(y), ([1, 2], 3))
- self.assert_(x is not y)
- self.assert_(x[0] is not y[0])
+ self.assertTrue(x is not y)
+ self.assertTrue(x[0] is not y[0])
def test_getstate_exc(self):
class EvilState(object):
@@ -585,6 +606,103 @@ class TestCopy(unittest.TestCase):
bar = lambda: None
self.assertEqual(copy.deepcopy(bar), bar)
+ def _check_weakref(self, _copy):
+ class C(object):
+ pass
+ obj = C()
+ x = weakref.ref(obj)
+ y = _copy(x)
+ self.assertTrue(y is x)
+ del obj
+ y = _copy(x)
+ self.assertTrue(y is x)
+
+ def test_copy_weakref(self):
+ self._check_weakref(copy.copy)
+
+ def test_deepcopy_weakref(self):
+ self._check_weakref(copy.deepcopy)
+
+ def _check_copy_weakdict(self, _dicttype):
+ class C(object):
+ pass
+ a, b, c, d = [C() for i in xrange(4)]
+ u = _dicttype()
+ u[a] = b
+ u[c] = d
+ v = copy.copy(u)
+ self.assertFalse(v is u)
+ self.assertEqual(v, u)
+ self.assertEqual(v[a], b)
+ self.assertEqual(v[c], d)
+ self.assertEqual(len(v), 2)
+ del c, d
+ self.assertEqual(len(v), 1)
+ x, y = C(), C()
+ # The underlying containers are decoupled
+ v[x] = y
+ self.assertNotIn(x, u)
+
+ def test_copy_weakkeydict(self):
+ self._check_copy_weakdict(weakref.WeakKeyDictionary)
+
+ def test_copy_weakvaluedict(self):
+ self._check_copy_weakdict(weakref.WeakValueDictionary)
+
+ def test_deepcopy_weakkeydict(self):
+ class C(object):
+ def __init__(self, i):
+ self.i = i
+ a, b, c, d = [C(i) for i in xrange(4)]
+ u = weakref.WeakKeyDictionary()
+ u[a] = b
+ u[c] = d
+ # Keys aren't copied, values are
+ v = copy.deepcopy(u)
+ self.assertNotEqual(v, u)
+ self.assertEqual(len(v), 2)
+ self.assertFalse(v[a] is b)
+ self.assertFalse(v[c] is d)
+ self.assertEqual(v[a].i, b.i)
+ self.assertEqual(v[c].i, d.i)
+ del c
+ self.assertEqual(len(v), 1)
+
+ def test_deepcopy_weakvaluedict(self):
+ class C(object):
+ def __init__(self, i):
+ self.i = i
+ a, b, c, d = [C(i) for i in xrange(4)]
+ u = weakref.WeakValueDictionary()
+ u[a] = b
+ u[c] = d
+ # Keys are copied, values aren't
+ v = copy.deepcopy(u)
+ self.assertNotEqual(v, u)
+ self.assertEqual(len(v), 2)
+ (x, y), (z, t) = sorted(v.items(), key=lambda pair: pair[0].i)
+ self.assertFalse(x is a)
+ self.assertEqual(x.i, a.i)
+ self.assertTrue(y is b)
+ self.assertFalse(z is c)
+ self.assertEqual(z.i, c.i)
+ self.assertTrue(t is d)
+ del x, y, z, t
+ del d
+ self.assertEqual(len(v), 1)
+
+ def test_deepcopy_bound_method(self):
+ class Foo(object):
+ def m(self):
+ pass
+ f = Foo()
+ f.b = f.m
+ g = copy.deepcopy(f)
+ self.assertEqual(g.m, g.b)
+ self.assertTrue(g.b.im_self is g)
+ g.b()
+
+
def global_foo(x, y): return x+y
def test_main():
diff --git a/Lib/test/test_copy_reg.py b/Lib/test/test_copy_reg.py
index c3d3964b38..8cdb8b7d2a 100644
--- a/Lib/test/test_copy_reg.py
+++ b/Lib/test/test_copy_reg.py
@@ -40,7 +40,7 @@ class CopyRegTestCase(unittest.TestCase):
def test_bool(self):
import copy
- self.assertEquals(True, copy.copy(True))
+ self.assertEqual(True, copy.copy(True))
def test_extension_registry(self):
mod, func, code = 'junk1 ', ' junk2', 0xabcd
@@ -51,10 +51,10 @@ class CopyRegTestCase(unittest.TestCase):
mod, func, code)
copy_reg.add_extension(mod, func, code)
# Should be in the registry.
- self.assert_(copy_reg._extension_registry[mod, func] == code)
- self.assert_(copy_reg._inverted_registry[code] == (mod, func))
+ self.assertTrue(copy_reg._extension_registry[mod, func] == code)
+ self.assertTrue(copy_reg._inverted_registry[code] == (mod, func))
# Shouldn't be in the cache.
- self.assert_(code not in copy_reg._extension_cache)
+ self.assertNotIn(code, copy_reg._extension_cache)
# Redundant registration should be OK.
copy_reg.add_extension(mod, func, code) # shouldn't blow up
# Conflicting code.
@@ -81,7 +81,7 @@ class CopyRegTestCase(unittest.TestCase):
e.restore()
# Shouldn't be there anymore.
- self.assert_((mod, func) not in copy_reg._extension_registry)
+ self.assertNotIn((mod, func), copy_reg._extension_registry)
# The code *may* be in copy_reg._extension_registry, though, if
# we happened to pick on a registered code. So don't check for
# that.
@@ -101,16 +101,16 @@ class CopyRegTestCase(unittest.TestCase):
mod, func, code)
def test_slotnames(self):
- self.assertEquals(copy_reg._slotnames(WithoutSlots), [])
- self.assertEquals(copy_reg._slotnames(WithWeakref), [])
+ self.assertEqual(copy_reg._slotnames(WithoutSlots), [])
+ self.assertEqual(copy_reg._slotnames(WithWeakref), [])
expected = ['_WithPrivate__spam']
- self.assertEquals(copy_reg._slotnames(WithPrivate), expected)
- self.assertEquals(copy_reg._slotnames(WithSingleString), ['spam'])
+ self.assertEqual(copy_reg._slotnames(WithPrivate), expected)
+ self.assertEqual(copy_reg._slotnames(WithSingleString), ['spam'])
expected = ['eggs', 'spam']
expected.sort()
result = copy_reg._slotnames(WithInherited)
result.sort()
- self.assertEquals(result, expected)
+ self.assertEqual(result, expected)
def test_main():
diff --git a/Lib/test/test_cpickle.py b/Lib/test/test_cpickle.py
index c63ca3e0f6..c240669873 100644
--- a/Lib/test/test_cpickle.py
+++ b/Lib/test/test_cpickle.py
@@ -1,6 +1,7 @@
import cPickle, unittest
from cStringIO import StringIO
from test.pickletester import AbstractPickleTests, AbstractPickleModuleTests
+from test.pickletester import AbstractPicklerUnpicklerObjectTests
from test import test_support
class cPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
@@ -95,6 +96,12 @@ class cPickleFastPicklerTests(AbstractPickleTests):
b = self.loads(self.dumps(a))
self.assertEqual(a, b)
+class cPicklePicklerUnpicklerObjectTests(AbstractPicklerUnpicklerObjectTests):
+
+ pickler_class = cPickle.Pickler
+ unpickler_class = cPickle.Unpickler
+
+
class Node(object):
pass
@@ -125,6 +132,7 @@ def test_main():
cPickleListPicklerTests,
cPickleFastPicklerTests,
cPickleDeepRecursive,
+ cPicklePicklerUnpicklerObjectTests,
)
if __name__ == "__main__":
diff --git a/Lib/test/test_cprofile.py b/Lib/test/test_cprofile.py
index 831895c389..af3fe62a9a 100755..100644
--- a/Lib/test/test_cprofile.py
+++ b/Lib/test/test_cprofile.py
@@ -39,7 +39,7 @@ def main():
# Don't remove this comment. Everything below it is auto-generated.
#--cut--------------------------------------------------------------------------
CProfileTest.expected_output['print_stats'] = """\
- 126 function calls (106 primitive calls) in 1.000 CPU seconds
+ 126 function calls (106 primitive calls) in 1.000 seconds
Ordered by: standard name
diff --git a/Lib/test/test_crypt.py b/Lib/test/test_crypt.py
index f6f3a8171e..4db200d403 100755..100644
--- a/Lib/test/test_crypt.py
+++ b/Lib/test/test_crypt.py
@@ -1,6 +1,7 @@
from test import test_support
import unittest
-import crypt
+
+crypt = test_support.import_module('crypt')
class CryptTestCase(unittest.TestCase):
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index 7cce77400e..7b16e2db64 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -9,6 +9,7 @@ from StringIO import StringIO
import tempfile
import csv
import gc
+import io
from test import test_support
class Test_Csv(unittest.TestCase):
@@ -325,22 +326,17 @@ class TestDialectRegistry(unittest.TestCase):
expected_dialects = csv.list_dialects() + [name]
expected_dialects.sort()
csv.register_dialect(name, myexceltsv)
- try:
- self.failUnless(csv.get_dialect(name).delimiter, '\t')
- got_dialects = csv.list_dialects()
- got_dialects.sort()
- self.assertEqual(expected_dialects, got_dialects)
- finally:
- csv.unregister_dialect(name)
+ self.addCleanup(csv.unregister_dialect, name)
+ self.assertEqual(csv.get_dialect(name).delimiter, '\t')
+ got_dialects = sorted(csv.list_dialects())
+ self.assertEqual(expected_dialects, got_dialects)
def test_register_kwargs(self):
name = 'fedcba'
csv.register_dialect(name, delimiter=';')
- try:
- self.failUnless(csv.get_dialect(name).delimiter, '\t')
- self.failUnless(list(csv.reader('X;Y;Z', name)), ['X', 'Y', 'Z'])
- finally:
- csv.unregister_dialect(name)
+ self.addCleanup(csv.unregister_dialect, name)
+ self.assertEqual(csv.get_dialect(name).delimiter, ';')
+ self.assertEqual([['X', 'Y', 'Z']], list(csv.reader(['X;Y;Z'], name)))
def test_incomplete_dialect(self):
class myexceltsv(csv.Dialect):
@@ -595,11 +591,15 @@ class TestDictFields(unittest.TestCase):
### "short" means there are fewer elements in the row than fieldnames
def test_write_simple_dict(self):
fd, name = tempfile.mkstemp()
- fileobj = os.fdopen(fd, "w+b")
+ fileobj = io.open(fd, 'w+b')
try:
writer = csv.DictWriter(fileobj, fieldnames = ["f1", "f2", "f3"])
+ writer.writeheader()
+ fileobj.seek(0)
+ self.assertEqual(fileobj.readline(), "f1,f2,f3\r\n")
writer.writerow({"f1": 10, "f3": "abc"})
fileobj.seek(0)
+ fileobj.readline() # header
self.assertEqual(fileobj.read(), "10,,abc\r\n")
finally:
fileobj.close()
@@ -891,7 +891,7 @@ Stonecutters Seafood and Chop House, Lemont, IL, 12/19/02, Week Back
'Harry''s':'Arlington Heights':'IL':'2/1/03':'Kimi Hayes'
'Shark City':'Glendale Heights':'IL':'12/28/02':'Prezence'
'Tommy''s Place':'Blue Island':'IL':'12/28/02':'Blue Sunday/White Crow'
-'Stonecutters Seafood and Chop House':'Lemont':'IL':'12/19/02':'Week Back'
+'Stonecutters ''Seafood'' and Chop House':'Lemont':'IL':'12/19/02':'Week Back'
"""
header = '''\
"venue","city","state","date","performers"
@@ -935,7 +935,7 @@ Stonecutters Seafood and Chop House, Lemont, IL, 12/19/02, Week Back
# given that all three lines in sample3 are equal,
# I think that any character could have been 'guessed' as the
# delimiter, depending on dictionary order
- self.assert_(dialect.delimiter in self.sample3)
+ self.assertIn(dialect.delimiter, self.sample3)
dialect = sniffer.sniff(self.sample3, delimiters="?,")
self.assertEqual(dialect.delimiter, "?")
dialect = sniffer.sniff(self.sample3, delimiters="/,")
@@ -950,6 +950,13 @@ Stonecutters Seafood and Chop House, Lemont, IL, 12/19/02, Week Back
self.assertEqual(dialect.delimiter, "|")
self.assertEqual(dialect.quotechar, "'")
+ def test_doublequote(self):
+ sniffer = csv.Sniffer()
+ dialect = sniffer.sniff(self.header)
+ self.assertFalse(dialect.doublequote)
+ dialect = sniffer.sniff(self.sample2)
+ self.assertTrue(dialect.doublequote)
+
if not hasattr(sys, "gettotalrefcount"):
if test_support.verbose: print "*** skipping leakage tests ***"
else:
diff --git a/Lib/test/test_ctypes.py b/Lib/test/test_ctypes.py
index 0bd2ed6642..17f287449a 100644
--- a/Lib/test/test_ctypes.py
+++ b/Lib/test/test_ctypes.py
@@ -1,17 +1,15 @@
import unittest
-from test.test_support import run_unittest, import_module, _check_py3k_warnings
+from test.test_support import run_unittest, import_module
#Skip tests if _ctypes module does not exist
import_module('_ctypes')
def test_main():
- with _check_py3k_warnings(("buffer.. not supported", DeprecationWarning),
- ("classic (int|long) division", DeprecationWarning),):
- import ctypes.test
- skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0)
- suites = [unittest.makeSuite(t) for t in testcases]
- run_unittest(unittest.TestSuite(suites))
+ import ctypes.test
+ skipped, testcases = ctypes.test.get_tests(ctypes.test, "test_*.py", verbosity=0)
+ suites = [unittest.makeSuite(t) for t in testcases]
+ run_unittest(unittest.TestSuite(suites))
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_curses.py b/Lib/test/test_curses.py
index 54c310e1ee..fa0d469e47 100644
--- a/Lib/test/test_curses.py
+++ b/Lib/test/test_curses.py
@@ -9,24 +9,26 @@
# Only called, not tested: getmouse(), ungetmouse()
#
-import curses, sys, tempfile, os
-import curses.panel
+import sys, tempfile, os
# Optionally test curses module. This currently requires that the
# 'curses' resource be given on the regrtest command line using the -u
# option. If not available, nothing after this line will be executed.
-from test.test_support import requires, TestSkipped
+import unittest
+from test.test_support import requires, import_module
requires('curses')
+curses = import_module('curses')
+curses.panel = import_module('curses.panel')
# XXX: if newterm was supported we could use it instead of initscr and not exit
term = os.environ.get('TERM')
if not term or term == 'unknown':
- raise TestSkipped, "$TERM=%r, calling initscr() may cause exit" % term
+ raise unittest.SkipTest, "$TERM=%r, calling initscr() may cause exit" % term
if sys.platform == "cygwin":
- raise TestSkipped("cygwin's curses mostly just hangs")
+ raise unittest.SkipTest("cygwin's curses mostly just hangs")
def window_funcs(stdscr):
"Test the methods of windows"
@@ -276,7 +278,7 @@ if __name__ == '__main__':
unit_tests()
else:
if not sys.__stdout__.isatty():
- raise TestSkipped("sys.__stdout__ is not a tty")
+ raise unittest.SkipTest("sys.__stdout__ is not a tty")
# testing setupterm() inside initscr/endwin
# causes terminal breakage
curses.setupterm(fd=sys.__stdout__.fileno())
diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py
index 735582feb0..d246d60797 100644
--- a/Lib/test/test_datetime.py
+++ b/Lib/test/test_datetime.py
@@ -2,7 +2,7 @@
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
"""
-
+from __future__ import division
import sys
import pickle
import cPickle
@@ -79,9 +79,9 @@ class TestTZInfo(unittest.TestCase):
def __init__(self, offset, name):
self.__offset = offset
self.__name = name
- self.failUnless(issubclass(NotEnough, tzinfo))
+ self.assertTrue(issubclass(NotEnough, tzinfo))
ne = NotEnough(3, "NotByALongShot")
- self.failUnless(isinstance(ne, tzinfo))
+ self.assertIsInstance(ne, tzinfo)
dt = datetime.now()
self.assertRaises(NotImplementedError, ne.tzname, dt)
@@ -90,7 +90,7 @@ class TestTZInfo(unittest.TestCase):
def test_normal(self):
fo = FixedOffset(3, "Three")
- self.failUnless(isinstance(fo, tzinfo))
+ self.assertIsInstance(fo, tzinfo)
for dt in datetime.now(), None:
self.assertEqual(fo.utcoffset(dt), timedelta(minutes=3))
self.assertEqual(fo.tzname(dt), "Three")
@@ -101,25 +101,25 @@ class TestTZInfo(unittest.TestCase):
# carry no data), but they need to be picklable anyway else
# concrete subclasses can't be pickled.
orig = tzinfo.__new__(tzinfo)
- self.failUnless(type(orig) is tzinfo)
+ self.assertTrue(type(orig) is tzinfo)
for pickler, unpickler, proto in pickle_choices:
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
- self.failUnless(type(derived) is tzinfo)
+ self.assertTrue(type(derived) is tzinfo)
def test_pickling_subclass(self):
# Make sure we can pickle/unpickle an instance of a subclass.
offset = timedelta(minutes=-300)
orig = PicklableFixedOffset(offset, 'cookie')
- self.failUnless(isinstance(orig, tzinfo))
- self.failUnless(type(orig) is PicklableFixedOffset)
+ self.assertIsInstance(orig, tzinfo)
+ self.assertTrue(type(orig) is PicklableFixedOffset)
self.assertEqual(orig.utcoffset(None), offset)
self.assertEqual(orig.tzname(None), 'cookie')
for pickler, unpickler, proto in pickle_choices:
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
- self.failUnless(isinstance(derived, tzinfo))
- self.failUnless(type(derived) is PicklableFixedOffset)
+ self.assertIsInstance(derived, tzinfo)
+ self.assertTrue(type(derived) is PicklableFixedOffset)
self.assertEqual(derived.utcoffset(None), offset)
self.assertEqual(derived.tzname(None), 'cookie')
@@ -136,16 +136,13 @@ class HarmlessMixedComparison:
def test_harmless_mixed_comparison(self):
me = self.theclass(1, 1, 1)
- self.failIf(me == ())
- self.failUnless(me != ())
- self.failIf(() == me)
- self.failUnless(() != me)
-
- self.failUnless(me in [1, 20L, [], me])
- self.failIf(me not in [1, 20L, [], me])
+ self.assertFalse(me == ())
+ self.assertTrue(me != ())
+ self.assertFalse(() == me)
+ self.assertTrue(() != me)
- self.failUnless([] in [me, 1, 20L, []])
- self.failIf([] not in [me, 1, 20L, []])
+ self.assertIn(me, [1, 20L, [], me])
+ self.assertIn([], [me, 1, 20L, []])
def test_harmful_mixed_comparison(self):
me = self.theclass(1, 1, 1)
@@ -234,6 +231,13 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
eq(a//10, td(0, 7*24*360))
eq(a//3600000, td(0, 0, 7*24*1000))
+ # Issue #11576
+ eq(td(999999999, 86399, 999999) - td(999999999, 86399, 999998),
+ td(0, 0, 1))
+ eq(td(999999999, 1, 1) - td(999999999, 1, 0),
+ td(0, 0, 1))
+
+
def test_disallowed_computations(self):
a = timedelta(42)
@@ -266,6 +270,20 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
self.assertEqual(td.seconds, seconds)
self.assertEqual(td.microseconds, us)
+ def test_total_seconds(self):
+ td = timedelta(days=365)
+ self.assertEqual(td.total_seconds(), 31536000.0)
+ for total_seconds in [123456.789012, -123456.789012, 0.123456, 0, 1e6]:
+ td = timedelta(seconds=total_seconds)
+ self.assertEqual(td.total_seconds(), total_seconds)
+ # Issue8644: Test that td.total_seconds() has the same
+ # accuracy as td / timedelta(seconds=1).
+ for ms in [-1, -2, -123]:
+ td = timedelta(microseconds=ms)
+ self.assertEqual(td.total_seconds(),
+ ((24*3600*td.days + td.seconds)*10**6
+ + td.microseconds)/10**6)
+
def test_carries(self):
t1 = timedelta(days=100,
weeks=-7,
@@ -307,29 +325,29 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
def test_compare(self):
t1 = timedelta(2, 3, 4)
t2 = timedelta(2, 3, 4)
- self.failUnless(t1 == t2)
- self.failUnless(t1 <= t2)
- self.failUnless(t1 >= t2)
- self.failUnless(not t1 != t2)
- self.failUnless(not t1 < t2)
- self.failUnless(not t1 > t2)
+ self.assertTrue(t1 == t2)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t1 >= t2)
+ self.assertTrue(not t1 != t2)
+ self.assertTrue(not t1 < t2)
+ self.assertTrue(not t1 > t2)
self.assertEqual(cmp(t1, t2), 0)
self.assertEqual(cmp(t2, t1), 0)
for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
t2 = timedelta(*args) # this is larger than t1
- self.failUnless(t1 < t2)
- self.failUnless(t2 > t1)
- self.failUnless(t1 <= t2)
- self.failUnless(t2 >= t1)
- self.failUnless(t1 != t2)
- self.failUnless(t2 != t1)
- self.failUnless(not t1 == t2)
- self.failUnless(not t2 == t1)
- self.failUnless(not t1 > t2)
- self.failUnless(not t2 < t1)
- self.failUnless(not t1 >= t2)
- self.failUnless(not t2 <= t1)
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t2 > t1)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t2 >= t1)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 != t1)
+ self.assertTrue(not t1 == t2)
+ self.assertTrue(not t2 == t1)
+ self.assertTrue(not t1 > t2)
+ self.assertTrue(not t2 < t1)
+ self.assertTrue(not t1 >= t2)
+ self.assertTrue(not t2 <= t1)
self.assertEqual(cmp(t1, t2), -1)
self.assertEqual(cmp(t2, t1), 1)
@@ -377,7 +395,7 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
# Verify td -> string -> td identity.
s = repr(td)
- self.failUnless(s.startswith('datetime.'))
+ self.assertTrue(s.startswith('datetime.'))
s = s[9:]
td2 = eval(s)
self.assertEqual(td, td2)
@@ -387,10 +405,10 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
self.assertEqual(td, td2)
def test_resolution_info(self):
- self.assert_(isinstance(timedelta.min, timedelta))
- self.assert_(isinstance(timedelta.max, timedelta))
- self.assert_(isinstance(timedelta.resolution, timedelta))
- self.assert_(timedelta.max > timedelta.min)
+ self.assertIsInstance(timedelta.min, timedelta)
+ self.assertIsInstance(timedelta.max, timedelta)
+ self.assertIsInstance(timedelta.resolution, timedelta)
+ self.assertTrue(timedelta.max > timedelta.min)
self.assertEqual(timedelta.min, timedelta(-999999999))
self.assertEqual(timedelta.max, timedelta(999999999, 24*3600-1, 1e6-1))
self.assertEqual(timedelta.resolution, timedelta(0, 0, 1))
@@ -437,11 +455,11 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
(-1, 24*3600-1, 999999))
def test_bool(self):
- self.failUnless(timedelta(1))
- self.failUnless(timedelta(0, 1))
- self.failUnless(timedelta(0, 0, 1))
- self.failUnless(timedelta(microseconds=1))
- self.failUnless(not timedelta(0))
+ self.assertTrue(timedelta(1))
+ self.assertTrue(timedelta(0, 1))
+ self.assertTrue(timedelta(0, 0, 1))
+ self.assertTrue(timedelta(microseconds=1))
+ self.assertTrue(not timedelta(0))
def test_subclass_timedelta(self):
@@ -457,17 +475,17 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase):
return round(sum)
t1 = T(days=1)
- self.assert_(type(t1) is T)
+ self.assertTrue(type(t1) is T)
self.assertEqual(t1.as_hours(), 24)
t2 = T(days=-1, seconds=-3600)
- self.assert_(type(t2) is T)
+ self.assertTrue(type(t2) is T)
self.assertEqual(t2.as_hours(), -25)
t3 = t1 + t2
- self.assert_(type(t3) is timedelta)
+ self.assertTrue(type(t3) is timedelta)
t4 = T.from_td(t3)
- self.assert_(type(t4) is T)
+ self.assertTrue(type(t4) is T)
self.assertEqual(t3.days, t4.days)
self.assertEqual(t3.seconds, t4.seconds)
self.assertEqual(t3.microseconds, t4.microseconds)
@@ -530,7 +548,7 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
self.theclass.today()):
# Verify dt -> string -> date identity.
s = repr(dt)
- self.failUnless(s.startswith('datetime.'))
+ self.assertTrue(s.startswith('datetime.'))
s = s[9:]
dt2 = eval(s)
self.assertEqual(dt, dt2)
@@ -765,7 +783,7 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
# It worked or it didn't. If it didn't, assume it's reason #2, and
# let the test pass if they're within half a second of each other.
- self.failUnless(today == todayagain or
+ self.assertTrue(today == todayagain or
abs(todayagain - today) < timedelta(seconds=0.5))
def test_weekday(self):
@@ -902,10 +920,10 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
self.assertEqual(b.__format__(fmt), 'B')
def test_resolution_info(self):
- self.assert_(isinstance(self.theclass.min, self.theclass))
- self.assert_(isinstance(self.theclass.max, self.theclass))
- self.assert_(isinstance(self.theclass.resolution, timedelta))
- self.assert_(self.theclass.max > self.theclass.min)
+ self.assertIsInstance(self.theclass.min, self.theclass)
+ self.assertIsInstance(self.theclass.max, self.theclass)
+ self.assertIsInstance(self.theclass.resolution, timedelta)
+ self.assertTrue(self.theclass.max > self.theclass.min)
def test_extreme_timedelta(self):
big = self.theclass.max - self.theclass.min
@@ -953,29 +971,29 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
def test_compare(self):
t1 = self.theclass(2, 3, 4)
t2 = self.theclass(2, 3, 4)
- self.failUnless(t1 == t2)
- self.failUnless(t1 <= t2)
- self.failUnless(t1 >= t2)
- self.failUnless(not t1 != t2)
- self.failUnless(not t1 < t2)
- self.failUnless(not t1 > t2)
+ self.assertTrue(t1 == t2)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t1 >= t2)
+ self.assertTrue(not t1 != t2)
+ self.assertTrue(not t1 < t2)
+ self.assertTrue(not t1 > t2)
self.assertEqual(cmp(t1, t2), 0)
self.assertEqual(cmp(t2, t1), 0)
for args in (3, 3, 3), (2, 4, 4), (2, 3, 5):
t2 = self.theclass(*args) # this is larger than t1
- self.failUnless(t1 < t2)
- self.failUnless(t2 > t1)
- self.failUnless(t1 <= t2)
- self.failUnless(t2 >= t1)
- self.failUnless(t1 != t2)
- self.failUnless(t2 != t1)
- self.failUnless(not t1 == t2)
- self.failUnless(not t2 == t1)
- self.failUnless(not t1 > t2)
- self.failUnless(not t2 < t1)
- self.failUnless(not t1 >= t2)
- self.failUnless(not t2 <= t1)
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t2 > t1)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t2 >= t1)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 != t1)
+ self.assertTrue(not t1 == t2)
+ self.assertTrue(not t2 == t1)
+ self.assertTrue(not t1 > t2)
+ self.assertTrue(not t2 < t1)
+ self.assertTrue(not t1 >= t2)
+ self.assertTrue(not t2 <= t1)
self.assertEqual(cmp(t1, t2), -1)
self.assertEqual(cmp(t2, t1), 1)
@@ -1029,13 +1047,13 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
their = Comparable()
self.assertEqual(cmp(our, their), 0)
self.assertEqual(cmp(their, our), 0)
- self.failUnless(our == their)
- self.failUnless(their == our)
+ self.assertTrue(our == their)
+ self.assertTrue(their == our)
def test_bool(self):
# All dates are considered true.
- self.failUnless(self.theclass.min)
- self.failUnless(self.theclass.max)
+ self.assertTrue(self.theclass.min)
+ self.assertTrue(self.theclass.max)
def test_strftime_out_of_range(self):
# For nasty technical reasons, we can't handle years before 1900.
@@ -1158,7 +1176,7 @@ class TestDateTime(TestDate):
self.theclass.now()):
# Verify dt -> string -> datetime identity.
s = repr(dt)
- self.failUnless(s.startswith('datetime.'))
+ self.assertTrue(s.startswith('datetime.'))
s = s[9:]
dt2 = eval(s)
self.assertEqual(dt, dt2)
@@ -1232,7 +1250,7 @@ class TestDateTime(TestDate):
dt2 = self.theclass(2002, 3, 1, 10, 0, 0)
dt3 = self.theclass(2002, 3, 1, 9, 0, 0)
self.assertEqual(dt1, dt3)
- self.assert_(dt2 > dt3)
+ self.assertTrue(dt2 > dt3)
# Make sure comparison doesn't forget microseconds, and isn't done
# via comparing a float timestamp (an IEEE double doesn't have enough
@@ -1243,7 +1261,7 @@ class TestDateTime(TestDate):
us = timedelta(microseconds=1)
dt2 = dt1 + us
self.assertEqual(dt2 - dt1, us)
- self.assert_(dt1 < dt2)
+ self.assertTrue(dt1 < dt2)
def test_strftime_with_bad_tzname_replace(self):
# verify ok if tzinfo.tzname().replace() returns a non-string
@@ -1423,12 +1441,12 @@ class TestDateTime(TestDate):
args = [2000, 11, 29, 20, 58, 16, 999998]
t1 = self.theclass(*args)
t2 = self.theclass(*args)
- self.failUnless(t1 == t2)
- self.failUnless(t1 <= t2)
- self.failUnless(t1 >= t2)
- self.failUnless(not t1 != t2)
- self.failUnless(not t1 < t2)
- self.failUnless(not t1 > t2)
+ self.assertTrue(t1 == t2)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t1 >= t2)
+ self.assertTrue(not t1 != t2)
+ self.assertTrue(not t1 < t2)
+ self.assertTrue(not t1 > t2)
self.assertEqual(cmp(t1, t2), 0)
self.assertEqual(cmp(t2, t1), 0)
@@ -1436,18 +1454,18 @@ class TestDateTime(TestDate):
newargs = args[:]
newargs[i] = args[i] + 1
t2 = self.theclass(*newargs) # this is larger than t1
- self.failUnless(t1 < t2)
- self.failUnless(t2 > t1)
- self.failUnless(t1 <= t2)
- self.failUnless(t2 >= t1)
- self.failUnless(t1 != t2)
- self.failUnless(t2 != t1)
- self.failUnless(not t1 == t2)
- self.failUnless(not t2 == t1)
- self.failUnless(not t1 > t2)
- self.failUnless(not t2 < t1)
- self.failUnless(not t1 >= t2)
- self.failUnless(not t2 <= t1)
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t2 > t1)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t2 >= t1)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 != t1)
+ self.assertTrue(not t1 == t2)
+ self.assertTrue(not t2 == t1)
+ self.assertTrue(not t1 > t2)
+ self.assertTrue(not t2 < t1)
+ self.assertTrue(not t1 >= t2)
+ self.assertTrue(not t2 <= t1)
self.assertEqual(cmp(t1, t2), -1)
self.assertEqual(cmp(t2, t1), 1)
@@ -1480,8 +1498,8 @@ class TestDateTime(TestDate):
def test_microsecond_rounding(self):
# Test whether fromtimestamp "rounds up" floats that are less
# than one microsecond smaller than an integer.
- self.assertEquals(self.theclass.fromtimestamp(0.9999999),
- self.theclass.fromtimestamp(1))
+ self.assertEqual(self.theclass.fromtimestamp(0.9999999),
+ self.theclass.fromtimestamp(1))
def test_insane_fromtimestamp(self):
# It's possible that some platform maps time_t to double,
@@ -1500,21 +1518,16 @@ class TestDateTime(TestDate):
for insane in -1e200, 1e200:
self.assertRaises(ValueError, self.theclass.utcfromtimestamp,
insane)
-
+ @unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
def test_negative_float_fromtimestamp(self):
- # Windows doesn't accept negative timestamps
- if sys.platform == "win32":
- return
# The result is tz-dependent; at least test that this doesn't
# fail (like it did before bug 1646728 was fixed).
self.theclass.fromtimestamp(-1.05)
+ @unittest.skipIf(sys.platform == "win32", "Windows doesn't accept negative timestamps")
def test_negative_float_utcfromtimestamp(self):
- # Windows doesn't accept negative timestamps
- if sys.platform == "win32":
- return
d = self.theclass.utcfromtimestamp(-1.05)
- self.assertEquals(d, self.theclass(1969, 12, 31, 23, 59, 58, 950000))
+ self.assertEqual(d, self.theclass(1969, 12, 31, 23, 59, 58, 950000))
def test_utcnow(self):
import time
@@ -1528,7 +1541,7 @@ class TestDateTime(TestDate):
if abs(from_timestamp - from_now) <= tolerance:
break
# Else try again a few times.
- self.failUnless(abs(from_timestamp - from_now) <= tolerance)
+ self.assertTrue(abs(from_timestamp - from_now) <= tolerance)
def test_strptime(self):
import _strptime
@@ -1697,7 +1710,7 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase):
# Verify t -> string -> time identity.
s = repr(t)
- self.failUnless(s.startswith('datetime.'))
+ self.assertTrue(s.startswith('datetime.'))
s = s[9:]
t2 = eval(s)
self.assertEqual(t, t2)
@@ -1711,12 +1724,12 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase):
args = [1, 2, 3, 4]
t1 = self.theclass(*args)
t2 = self.theclass(*args)
- self.failUnless(t1 == t2)
- self.failUnless(t1 <= t2)
- self.failUnless(t1 >= t2)
- self.failUnless(not t1 != t2)
- self.failUnless(not t1 < t2)
- self.failUnless(not t1 > t2)
+ self.assertTrue(t1 == t2)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t1 >= t2)
+ self.assertTrue(not t1 != t2)
+ self.assertTrue(not t1 < t2)
+ self.assertTrue(not t1 > t2)
self.assertEqual(cmp(t1, t2), 0)
self.assertEqual(cmp(t2, t1), 0)
@@ -1724,18 +1737,18 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase):
newargs = args[:]
newargs[i] = args[i] + 1
t2 = self.theclass(*newargs) # this is larger than t1
- self.failUnless(t1 < t2)
- self.failUnless(t2 > t1)
- self.failUnless(t1 <= t2)
- self.failUnless(t2 >= t1)
- self.failUnless(t1 != t2)
- self.failUnless(t2 != t1)
- self.failUnless(not t1 == t2)
- self.failUnless(not t2 == t1)
- self.failUnless(not t1 > t2)
- self.failUnless(not t2 < t1)
- self.failUnless(not t1 >= t2)
- self.failUnless(not t2 <= t1)
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t2 > t1)
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(t2 >= t1)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 != t1)
+ self.assertTrue(not t1 == t2)
+ self.assertTrue(not t2 == t1)
+ self.assertTrue(not t1 > t2)
+ self.assertTrue(not t2 < t1)
+ self.assertTrue(not t1 >= t2)
+ self.assertTrue(not t2 <= t1)
self.assertEqual(cmp(t1, t2), -1)
self.assertEqual(cmp(t2, t1), 1)
@@ -1888,10 +1901,10 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase):
"%s(23, 15)" % name)
def test_resolution_info(self):
- self.assert_(isinstance(self.theclass.min, self.theclass))
- self.assert_(isinstance(self.theclass.max, self.theclass))
- self.assert_(isinstance(self.theclass.resolution, timedelta))
- self.assert_(self.theclass.max > self.theclass.min)
+ self.assertIsInstance(self.theclass.min, self.theclass)
+ self.assertIsInstance(self.theclass.max, self.theclass)
+ self.assertIsInstance(self.theclass.resolution, timedelta)
+ self.assertTrue(self.theclass.max > self.theclass.min)
def test_pickling(self):
args = 20, 59, 16, 64**2
@@ -1911,12 +1924,12 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase):
def test_bool(self):
cls = self.theclass
- self.failUnless(cls(1))
- self.failUnless(cls(0, 1))
- self.failUnless(cls(0, 0, 1))
- self.failUnless(cls(0, 0, 0, 1))
- self.failUnless(not cls(0))
- self.failUnless(not cls())
+ self.assertTrue(cls(1))
+ self.assertTrue(cls(0, 1))
+ self.assertTrue(cls(0, 0, 1))
+ self.assertTrue(cls(0, 0, 0, 1))
+ self.assertTrue(not cls(0))
+ self.assertTrue(not cls())
def test_replace(self):
cls = self.theclass
@@ -2013,7 +2026,7 @@ class TZInfoBase:
def utcoffset(self, dt): pass
b = BetterTry()
t = cls(1, 1, 1, tzinfo=b)
- self.failUnless(t.tzinfo is b)
+ self.assertTrue(t.tzinfo is b)
def test_utc_offset_out_of_bounds(self):
class Edgy(tzinfo):
@@ -2052,9 +2065,9 @@ class TZInfoBase:
for t in (cls(1, 1, 1),
cls(1, 1, 1, tzinfo=None),
cls(1, 1, 1, tzinfo=C1())):
- self.failUnless(t.utcoffset() is None)
- self.failUnless(t.dst() is None)
- self.failUnless(t.tzname() is None)
+ self.assertTrue(t.utcoffset() is None)
+ self.assertTrue(t.dst() is None)
+ self.assertTrue(t.tzname() is None)
class C3(tzinfo):
def utcoffset(self, dt): return timedelta(minutes=-1439)
@@ -2148,7 +2161,7 @@ class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
self.assertEqual(t.minute, 0)
self.assertEqual(t.second, 0)
self.assertEqual(t.microsecond, 0)
- self.failUnless(t.tzinfo is None)
+ self.assertTrue(t.tzinfo is None)
def test_zones(self):
est = FixedOffset(-300, "EST", 1)
@@ -2163,25 +2176,25 @@ class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
self.assertEqual(t1.tzinfo, est)
self.assertEqual(t2.tzinfo, utc)
self.assertEqual(t3.tzinfo, met)
- self.failUnless(t4.tzinfo is None)
+ self.assertTrue(t4.tzinfo is None)
self.assertEqual(t5.tzinfo, utc)
self.assertEqual(t1.utcoffset(), timedelta(minutes=-300))
self.assertEqual(t2.utcoffset(), timedelta(minutes=0))
self.assertEqual(t3.utcoffset(), timedelta(minutes=60))
- self.failUnless(t4.utcoffset() is None)
+ self.assertTrue(t4.utcoffset() is None)
self.assertRaises(TypeError, t1.utcoffset, "no args")
self.assertEqual(t1.tzname(), "EST")
self.assertEqual(t2.tzname(), "UTC")
self.assertEqual(t3.tzname(), "MET")
- self.failUnless(t4.tzname() is None)
+ self.assertTrue(t4.tzname() is None)
self.assertRaises(TypeError, t1.tzname, "no args")
self.assertEqual(t1.dst(), timedelta(minutes=1))
self.assertEqual(t2.dst(), timedelta(minutes=-2))
self.assertEqual(t3.dst(), timedelta(minutes=3))
- self.failUnless(t4.dst() is None)
+ self.assertTrue(t4.dst() is None)
self.assertRaises(TypeError, t1.dst, "no args")
self.assertEqual(hash(t1), hash(t2))
@@ -2257,7 +2270,7 @@ class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
self.assertEqual(orig, derived)
- self.failUnless(isinstance(derived.tzinfo, PicklableFixedOffset))
+ self.assertIsInstance(derived.tzinfo, PicklableFixedOffset)
self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
self.assertEqual(derived.tzname(), 'cookie')
@@ -2266,20 +2279,20 @@ class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
cls = self.theclass
t = cls(0, tzinfo=FixedOffset(-300, ""))
- self.failUnless(t)
+ self.assertTrue(t)
t = cls(5, tzinfo=FixedOffset(-300, ""))
- self.failUnless(t)
+ self.assertTrue(t)
t = cls(5, tzinfo=FixedOffset(300, ""))
- self.failUnless(not t)
+ self.assertTrue(not t)
t = cls(23, 59, tzinfo=FixedOffset(23*60 + 59, ""))
- self.failUnless(not t)
+ self.assertTrue(not t)
# Mostly ensuring this doesn't overflow internally.
t = cls(0, tzinfo=FixedOffset(23*60 + 59, ""))
- self.failUnless(t)
+ self.assertTrue(t)
# But this should yield a value error -- the utcoffset is bogus.
t = cls(0, tzinfo=FixedOffset(24*60, ""))
@@ -2313,13 +2326,13 @@ class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
# Ensure we can get rid of a tzinfo.
self.assertEqual(base.tzname(), "+100")
base2 = base.replace(tzinfo=None)
- self.failUnless(base2.tzinfo is None)
- self.failUnless(base2.tzname() is None)
+ self.assertTrue(base2.tzinfo is None)
+ self.assertTrue(base2.tzname() is None)
# Ensure we can add one.
base3 = base2.replace(tzinfo=z100)
self.assertEqual(base, base3)
- self.failUnless(base.tzinfo is base3.tzinfo)
+ self.assertTrue(base.tzinfo is base3.tzinfo)
# Out of bounds.
base = cls(1)
@@ -2356,7 +2369,7 @@ class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase):
# But if they're not identical, it isn't ignored.
t2 = t2.replace(tzinfo=Varies())
- self.failUnless(t1 < t2) # t1's offset counter still going up
+ self.assertTrue(t1 < t2) # t1's offset counter still going up
def test_subclass_timetz(self):
@@ -2412,12 +2425,12 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
tzinfo=FixedOffset(-1439, ""))
# Make sure those compare correctly, and w/o overflow.
- self.failUnless(t1 < t2)
- self.failUnless(t1 != t2)
- self.failUnless(t2 > t1)
+ self.assertTrue(t1 < t2)
+ self.assertTrue(t1 != t2)
+ self.assertTrue(t2 > t1)
- self.failUnless(t1 == t1)
- self.failUnless(t2 == t2)
+ self.assertTrue(t1 == t1)
+ self.assertTrue(t2 == t2)
# Equal afer adjustment.
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""))
@@ -2426,21 +2439,21 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
# Change t1 not to subtract a minute, and t1 should be larger.
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(0, ""))
- self.failUnless(t1 > t2)
+ self.assertTrue(t1 > t2)
# Change t1 to subtract 2 minutes, and t1 should be smaller.
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(2, ""))
- self.failUnless(t1 < t2)
+ self.assertTrue(t1 < t2)
# Back to the original t1, but make seconds resolve it.
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
second=1)
- self.failUnless(t1 > t2)
+ self.assertTrue(t1 > t2)
# Likewise, but make microseconds resolve it.
t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""),
microsecond=1)
- self.failUnless(t1 > t2)
+ self.assertTrue(t1 > t2)
# Make t2 naive and it should fail.
t2 = self.theclass.min
@@ -2484,8 +2497,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
green = pickler.dumps(orig, proto)
derived = unpickler.loads(green)
self.assertEqual(orig, derived)
- self.failUnless(isinstance(derived.tzinfo,
- PicklableFixedOffset))
+ self.assertIsInstance(derived.tzinfo, PicklableFixedOffset)
self.assertEqual(derived.utcoffset(), timedelta(minutes=-300))
self.assertEqual(derived.tzname(), 'cookie')
@@ -2555,7 +2567,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
tz55 = FixedOffset(-330, "west 5:30")
timeaware = now.time().replace(tzinfo=tz55)
nowaware = self.theclass.combine(now.date(), timeaware)
- self.failUnless(nowaware.tzinfo is tz55)
+ self.assertTrue(nowaware.tzinfo is tz55)
self.assertEqual(nowaware.timetz(), timeaware)
# Can't mix aware and non-aware.
@@ -2574,15 +2586,15 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
# Adding a delta should preserve tzinfo.
delta = timedelta(weeks=1, minutes=12, microseconds=5678)
nowawareplus = nowaware + delta
- self.failUnless(nowaware.tzinfo is tz55)
+ self.assertTrue(nowaware.tzinfo is tz55)
nowawareplus2 = delta + nowaware
- self.failUnless(nowawareplus2.tzinfo is tz55)
+ self.assertTrue(nowawareplus2.tzinfo is tz55)
self.assertEqual(nowawareplus, nowawareplus2)
# that - delta should be what we started with, and that - what we
# started with should be delta.
diff = nowawareplus - delta
- self.failUnless(diff.tzinfo is tz55)
+ self.assertTrue(diff.tzinfo is tz55)
self.assertEqual(nowaware, diff)
self.assertRaises(TypeError, lambda: delta - nowawareplus)
self.assertEqual(nowawareplus - nowaware, delta)
@@ -2591,7 +2603,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
tzr = FixedOffset(random.randrange(-1439, 1440), "randomtimezone")
# Attach it to nowawareplus.
nowawareplus = nowawareplus.replace(tzinfo=tzr)
- self.failUnless(nowawareplus.tzinfo is tzr)
+ self.assertTrue(nowawareplus.tzinfo is tzr)
# Make sure the difference takes the timezone adjustments into account.
got = nowaware - nowawareplus
# Expected: (nowaware base - nowaware offset) -
@@ -2618,7 +2630,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
off42 = FixedOffset(42, "42")
another = meth(off42)
again = meth(tz=off42)
- self.failUnless(another.tzinfo is again.tzinfo)
+ self.assertTrue(another.tzinfo is again.tzinfo)
self.assertEqual(another.utcoffset(), timedelta(minutes=42))
# Bad argument with and w/o naming the keyword.
self.assertRaises(TypeError, meth, 16)
@@ -2635,7 +2647,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
utc = FixedOffset(0, "utc", 0)
for dummy in range(3):
now = datetime.now(weirdtz)
- self.failUnless(now.tzinfo is weirdtz)
+ self.assertTrue(now.tzinfo is weirdtz)
utcnow = datetime.utcnow().replace(tzinfo=utc)
now2 = utcnow.astimezone(weirdtz)
if abs(now - now2) < timedelta(seconds=30):
@@ -2656,7 +2668,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
off42 = FixedOffset(42, "42")
another = meth(ts, off42)
again = meth(ts, tz=off42)
- self.failUnless(another.tzinfo is again.tzinfo)
+ self.assertTrue(another.tzinfo is again.tzinfo)
self.assertEqual(another.utcoffset(), timedelta(minutes=42))
# Bad argument with and w/o naming the keyword.
self.assertRaises(TypeError, meth, ts, 16)
@@ -2850,13 +2862,13 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
# Ensure we can get rid of a tzinfo.
self.assertEqual(base.tzname(), "+100")
base2 = base.replace(tzinfo=None)
- self.failUnless(base2.tzinfo is None)
- self.failUnless(base2.tzname() is None)
+ self.assertTrue(base2.tzinfo is None)
+ self.assertTrue(base2.tzname() is None)
# Ensure we can add one.
base3 = base2.replace(tzinfo=z100)
self.assertEqual(base, base3)
- self.failUnless(base.tzinfo is base3.tzinfo)
+ self.assertTrue(base.tzinfo is base3.tzinfo)
# Out of bounds.
base = cls(2000, 2, 29)
@@ -2869,20 +2881,20 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
fm5h = FixedOffset(-timedelta(hours=5), "m300")
dt = self.theclass.now(tz=f44m)
- self.failUnless(dt.tzinfo is f44m)
+ self.assertTrue(dt.tzinfo is f44m)
# Replacing with degenerate tzinfo raises an exception.
self.assertRaises(ValueError, dt.astimezone, fnone)
# Ditto with None tz.
self.assertRaises(TypeError, dt.astimezone, None)
# Replacing with same tzinfo makes no change.
x = dt.astimezone(dt.tzinfo)
- self.failUnless(x.tzinfo is f44m)
+ self.assertTrue(x.tzinfo is f44m)
self.assertEqual(x.date(), dt.date())
self.assertEqual(x.time(), dt.time())
# Replacing with different tzinfo does adjust.
got = dt.astimezone(fm5h)
- self.failUnless(got.tzinfo is fm5h)
+ self.assertTrue(got.tzinfo is fm5h)
self.assertEqual(got.utcoffset(), timedelta(hours=-5))
expected = dt - dt.utcoffset() # in effect, convert to UTC
expected += fm5h.utcoffset(dt) # and from there to local time
@@ -2890,7 +2902,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
self.assertEqual(got.date(), expected.date())
self.assertEqual(got.time(), expected.time())
self.assertEqual(got.timetz(), expected.timetz())
- self.failUnless(got.tzinfo is expected.tzinfo)
+ self.assertTrue(got.tzinfo is expected.tzinfo)
self.assertEqual(got, expected)
def test_aware_subtract(self):
@@ -2965,7 +2977,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase):
# But if they're not identical, it isn't ignored.
t2 = t2.replace(tzinfo=Varies())
- self.failUnless(t1 < t2) # t1's offset counter still going up
+ self.assertTrue(t1 < t2) # t1's offset counter still going up
def test_subclass_datetimetz(self):
@@ -3103,7 +3115,7 @@ class TestTimezoneConversions(unittest.TestCase):
self.assertEqual(dt, there_and_back)
# Because we have a redundant spelling when DST begins, there is
- # (unforunately) an hour when DST ends that can't be spelled at all in
+ # (unfortunately) an hour when DST ends that can't be spelled at all in
# local time. When DST ends, the clock jumps from 1:59 back to 1:00
# again. The hour 1:MM DST has no spelling then: 1:MM is taken to be
# standard time. 1:MM DST == 0:MM EST, but 0:MM is taken to be
@@ -3316,10 +3328,10 @@ class Oddballs(unittest.TestCase):
# type comparison, despite that datetime is a subclass of date.
as_date = date.today()
as_datetime = datetime.combine(as_date, time())
- self.assert_(as_date != as_datetime)
- self.assert_(as_datetime != as_date)
- self.assert_(not as_date == as_datetime)
- self.assert_(not as_datetime == as_date)
+ self.assertTrue(as_date != as_datetime)
+ self.assertTrue(as_datetime != as_date)
+ self.assertTrue(not as_date == as_datetime)
+ self.assertTrue(not as_datetime == as_date)
self.assertRaises(TypeError, lambda: as_date < as_datetime)
self.assertRaises(TypeError, lambda: as_datetime < as_date)
self.assertRaises(TypeError, lambda: as_date <= as_datetime)
@@ -3331,9 +3343,9 @@ class Oddballs(unittest.TestCase):
# Neverthelss, comparison should work with the base-class (date)
# projection if use of a date method is forced.
- self.assert_(as_date.__eq__(as_datetime))
+ self.assertTrue(as_date.__eq__(as_datetime))
different_day = (as_date.day + 1) % 20 + 1
- self.assert_(not as_date.__eq__(as_datetime.replace(day=
+ self.assertTrue(not as_date.__eq__(as_datetime.replace(day=
different_day)))
# And date should compare with other subclasses of date. If a
diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py
index 0541f866ce..41b0b5cc47 100755..100644
--- a/Lib/test/test_dbm.py
+++ b/Lib/test/test_dbm.py
@@ -1,6 +1,6 @@
from test import test_support
import unittest
-import dbm
+dbm = test_support.import_module('dbm')
class DbmTestCase(unittest.TestCase):
@@ -21,9 +21,9 @@ class DbmTestCase(unittest.TestCase):
self.d[k] = v
self.assertEqual(sorted(self.d.keys()), sorted(k for (k, v) in a))
for k, v in a:
- self.assert_(k in self.d)
+ self.assertIn(k, self.d)
self.assertEqual(self.d[k], v)
- self.assert_('xxx' not in self.d)
+ self.assertNotIn('xxx', self.d)
self.assertRaises(KeyError, lambda: self.d['xxx'])
self.d.close()
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 41767c3b48..a011b2f76d 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -24,15 +24,15 @@ you're working through IDLE, you can import this test module and call test_main(
with the corresponding argument.
"""
-import glob
import math
import os, sys
+import operator
import pickle, copy
import unittest
from decimal import *
import numbers
-from test.test_support import (TestSkipped, run_unittest, run_doctest,
- is_resource_enabled, _check_py3k_warnings)
+from test.test_support import (run_unittest, run_doctest,
+ is_resource_enabled, check_py3k_warnings)
import random
try:
import threading
@@ -60,6 +60,11 @@ def init():
)
setcontext(DefaultTestContext)
+# decorator for skipping tests on non-IEEE 754 platforms
+requires_IEEE_754 = unittest.skipUnless(
+ float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+
TESTDATADIR = 'decimaltestdata'
if __name__ == '__main__':
file = sys.argv[0]
@@ -217,16 +222,17 @@ class DecimalTest(unittest.TestCase):
def eval_file(self, file):
global skip_expected
if skip_expected:
- raise TestSkipped
+ raise unittest.SkipTest
return
- for line in open(file):
- line = line.replace('\r\n', '').replace('\n', '')
- #print line
- try:
- t = self.eval_line(line)
- except DecimalException, exception:
- #Exception raised where there shoudn't have been one.
- self.fail('Exception "'+exception.__class__.__name__ + '" raised on line '+line)
+ with open(file) as f:
+ for line in f:
+ line = line.replace('\r\n', '').replace('\n', '')
+ #print line
+ try:
+ t = self.eval_line(line)
+ except DecimalException as exception:
+ #Exception raised where there shouldn't have been one.
+ self.fail('Exception "'+exception.__class__.__name__ + '" raised on line '+line)
return
@@ -381,13 +387,9 @@ class DecimalTest(unittest.TestCase):
myexceptions = self.getexceptions()
self.context.clear_flags()
- with _check_py3k_warnings(quiet=True):
- myexceptions.sort()
- theirexceptions.sort()
-
self.assertEqual(result, ans,
'Incorrect answer for ' + s + ' -- got ' + result)
- self.assertEqual(myexceptions, theirexceptions,
+ self.assertItemsEqual(myexceptions, theirexceptions,
'Incorrect flags set in ' + s + ' -- got ' + str(myexceptions))
return
@@ -500,6 +502,12 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
self.assertRaises(ValueError, Decimal, (1, (4, 10, 4, 9, 1), 2) )
self.assertRaises(ValueError, Decimal, (1, (4, 3, 4, 'a', 1), 2) )
+ def test_explicit_from_bool(self):
+ self.assertIs(bool(Decimal(0)), False)
+ self.assertIs(bool(Decimal(1)), True)
+ self.assertEqual(Decimal(False), Decimal(0))
+ self.assertEqual(Decimal(True), Decimal(1))
+
def test_explicit_from_Decimal(self):
#positive
@@ -526,6 +534,27 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
self.assertEqual(str(e), '0')
self.assertNotEqual(id(d), id(e))
+ @requires_IEEE_754
+ def test_explicit_from_float(self):
+ r = Decimal(0.1)
+ self.assertEqual(type(r), Decimal)
+ self.assertEqual(str(r),
+ '0.1000000000000000055511151231257827021181583404541015625')
+ self.assertTrue(Decimal(float('nan')).is_qnan())
+ self.assertTrue(Decimal(float('inf')).is_infinite())
+ self.assertTrue(Decimal(float('-inf')).is_infinite())
+ self.assertEqual(str(Decimal(float('nan'))),
+ str(Decimal('NaN')))
+ self.assertEqual(str(Decimal(float('inf'))),
+ str(Decimal('Infinity')))
+ self.assertEqual(str(Decimal(float('-inf'))),
+ str(Decimal('-Infinity')))
+ self.assertEqual(str(Decimal(float('-0.0'))),
+ str(Decimal('-0')))
+ for i in range(200):
+ x = random.expovariate(0.01) * (random.random() * 2.0 - 1.0)
+ self.assertEqual(x, float(Decimal(x))) # roundtrip
+
def test_explicit_context_create_decimal(self):
nc = copy.copy(getcontext())
@@ -542,7 +571,7 @@ class DecimalExplicitConstructionTest(unittest.TestCase):
# from int
d = nc.create_decimal(456)
- self.failUnless(isinstance(d, Decimal))
+ self.assertIsInstance(d, Decimal)
self.assertEqual(nc.create_decimal(45678),
nc.create_decimal('457E+2'))
@@ -638,7 +667,7 @@ class DecimalImplicitConstructionTest(unittest.TestCase):
('//', '__floordiv__', '__rfloordiv__'),
('**', '__pow__', '__rpow__')
]
- with _check_py3k_warnings():
+ with check_py3k_warnings():
if 1 / 2 == 0:
# testing with classic division, so add __div__
oplist.append(('/', '__div__', '__rdiv__'))
@@ -654,6 +683,7 @@ class DecimalImplicitConstructionTest(unittest.TestCase):
self.assertEqual(eval('Decimal(10)' + sym + 'E()'),
'10' + rop + 'str')
+
class DecimalFormatTest(unittest.TestCase):
'''Unit tests for the format function.'''
def test_formatting(self):
@@ -743,11 +773,56 @@ class DecimalFormatTest(unittest.TestCase):
('', '1.00', '1.00'),
- # check alignment
+ # test alignment and padding
+ ('6', '123', ' 123'),
('<6', '123', '123 '),
('>6', '123', ' 123'),
('^6', '123', ' 123 '),
('=+6', '123', '+ 123'),
+ ('#<10', 'NaN', 'NaN#######'),
+ ('#<10', '-4.3', '-4.3######'),
+ ('#<+10', '0.0130', '+0.0130###'),
+ ('#< 10', '0.0130', ' 0.0130###'),
+ ('@>10', '-Inf', '@-Infinity'),
+ ('#>5', '-Inf', '-Infinity'),
+ ('?^5', '123', '?123?'),
+ ('%^6', '123', '%123%%'),
+ (' ^6', '-45.6', '-45.6 '),
+ ('/=10', '-45.6', '-/////45.6'),
+ ('/=+10', '45.6', '+/////45.6'),
+ ('/= 10', '45.6', ' /////45.6'),
+
+ # thousands separator
+ (',', '1234567', '1,234,567'),
+ (',', '123456', '123,456'),
+ (',', '12345', '12,345'),
+ (',', '1234', '1,234'),
+ (',', '123', '123'),
+ (',', '12', '12'),
+ (',', '1', '1'),
+ (',', '0', '0'),
+ (',', '-1234567', '-1,234,567'),
+ (',', '-123456', '-123,456'),
+ ('7,', '123456', '123,456'),
+ ('8,', '123456', ' 123,456'),
+ ('08,', '123456', '0,123,456'), # special case: extra 0 needed
+ ('+08,', '123456', '+123,456'), # but not if there's a sign
+ (' 08,', '123456', ' 123,456'),
+ ('08,', '-123456', '-123,456'),
+ ('+09,', '123456', '+0,123,456'),
+ # ... with fractional part...
+ ('07,', '1234.56', '1,234.56'),
+ ('08,', '1234.56', '1,234.56'),
+ ('09,', '1234.56', '01,234.56'),
+ ('010,', '1234.56', '001,234.56'),
+ ('011,', '1234.56', '0,001,234.56'),
+ ('012,', '1234.56', '0,001,234.56'),
+ ('08,.1f', '1234.5', '01,234.5'),
+ # no thousands separators in fraction part
+ (',', '1.23456789', '1.23456789'),
+ (',%', '123.456789', '12,345.6789%'),
+ (',e', '123456', '1.23456e+5'),
+ (',E', '123456', '1.23456E+5'),
# issue 6850
('a=-7.0', '0.12345', 'aaaa0.1'),
@@ -755,6 +830,79 @@ class DecimalFormatTest(unittest.TestCase):
for fmt, d, result in test_values:
self.assertEqual(format(Decimal(d), fmt), result)
+ def test_n_format(self):
+ try:
+ from locale import CHAR_MAX
+ except ImportError:
+ return
+
+ # Set up some localeconv-like dictionaries
+ en_US = {
+ 'decimal_point' : '.',
+ 'grouping' : [3, 3, 0],
+ 'thousands_sep': ','
+ }
+
+ fr_FR = {
+ 'decimal_point' : ',',
+ 'grouping' : [CHAR_MAX],
+ 'thousands_sep' : ''
+ }
+
+ ru_RU = {
+ 'decimal_point' : ',',
+ 'grouping' : [3, 3, 0],
+ 'thousands_sep' : ' '
+ }
+
+ crazy = {
+ 'decimal_point' : '&',
+ 'grouping' : [1, 4, 2, CHAR_MAX],
+ 'thousands_sep' : '-'
+ }
+
+
+ def get_fmt(x, locale, fmt='n'):
+ return Decimal.__format__(Decimal(x), fmt, _localeconv=locale)
+
+ self.assertEqual(get_fmt(Decimal('12.7'), en_US), '12.7')
+ self.assertEqual(get_fmt(Decimal('12.7'), fr_FR), '12,7')
+ self.assertEqual(get_fmt(Decimal('12.7'), ru_RU), '12,7')
+ self.assertEqual(get_fmt(Decimal('12.7'), crazy), '1-2&7')
+
+ self.assertEqual(get_fmt(123456789, en_US), '123,456,789')
+ self.assertEqual(get_fmt(123456789, fr_FR), '123456789')
+ self.assertEqual(get_fmt(123456789, ru_RU), '123 456 789')
+ self.assertEqual(get_fmt(1234567890123, crazy), '123456-78-9012-3')
+
+ self.assertEqual(get_fmt(123456789, en_US, '.6n'), '1.23457e+8')
+ self.assertEqual(get_fmt(123456789, fr_FR, '.6n'), '1,23457e+8')
+ self.assertEqual(get_fmt(123456789, ru_RU, '.6n'), '1,23457e+8')
+ self.assertEqual(get_fmt(123456789, crazy, '.6n'), '1&23457e+8')
+
+ # zero padding
+ self.assertEqual(get_fmt(1234, fr_FR, '03n'), '1234')
+ self.assertEqual(get_fmt(1234, fr_FR, '04n'), '1234')
+ self.assertEqual(get_fmt(1234, fr_FR, '05n'), '01234')
+ self.assertEqual(get_fmt(1234, fr_FR, '06n'), '001234')
+
+ self.assertEqual(get_fmt(12345, en_US, '05n'), '12,345')
+ self.assertEqual(get_fmt(12345, en_US, '06n'), '12,345')
+ self.assertEqual(get_fmt(12345, en_US, '07n'), '012,345')
+ self.assertEqual(get_fmt(12345, en_US, '08n'), '0,012,345')
+ self.assertEqual(get_fmt(12345, en_US, '09n'), '0,012,345')
+ self.assertEqual(get_fmt(12345, en_US, '010n'), '00,012,345')
+
+ self.assertEqual(get_fmt(123456, crazy, '06n'), '1-2345-6')
+ self.assertEqual(get_fmt(123456, crazy, '07n'), '1-2345-6')
+ self.assertEqual(get_fmt(123456, crazy, '08n'), '1-2345-6')
+ self.assertEqual(get_fmt(123456, crazy, '09n'), '01-2345-6')
+ self.assertEqual(get_fmt(123456, crazy, '010n'), '0-01-2345-6')
+ self.assertEqual(get_fmt(123456, crazy, '011n'), '0-01-2345-6')
+ self.assertEqual(get_fmt(123456, crazy, '012n'), '00-01-2345-6')
+ self.assertEqual(get_fmt(123456, crazy, '013n'), '000-01-2345-6')
+
+
class DecimalArithmeticOperatorsTest(unittest.TestCase):
'''Unit tests for all arithmetic operators, binary and unary.'''
@@ -979,18 +1127,62 @@ class DecimalArithmeticOperatorsTest(unittest.TestCase):
self.assertEqual(abs(Decimal(45)), abs(Decimal(-45))) # abs
def test_nan_comparisons(self):
+ # comparisons involving signaling nans signal InvalidOperation
+
+ # order comparisons (<, <=, >, >=) involving only quiet nans
+ # also signal InvalidOperation
+
+ # equality comparisons (==, !=) involving only quiet nans
+ # don't signal, but return False or True respectively.
+
n = Decimal('NaN')
s = Decimal('sNaN')
i = Decimal('Inf')
f = Decimal('2')
- for x, y in [(n, n), (n, i), (i, n), (n, f), (f, n),
- (s, n), (n, s), (s, i), (i, s), (s, f), (f, s), (s, s)]:
- self.assert_(x != y)
- self.assert_(not (x == y))
- self.assert_(not (x < y))
- self.assert_(not (x <= y))
- self.assert_(not (x > y))
- self.assert_(not (x >= y))
+
+ qnan_pairs = (n, n), (n, i), (i, n), (n, f), (f, n)
+ snan_pairs = (s, n), (n, s), (s, i), (i, s), (s, f), (f, s), (s, s)
+ order_ops = operator.lt, operator.le, operator.gt, operator.ge
+ equality_ops = operator.eq, operator.ne
+
+ # results when InvalidOperation is not trapped
+ for x, y in qnan_pairs + snan_pairs:
+ for op in order_ops + equality_ops:
+ got = op(x, y)
+ expected = True if op is operator.ne else False
+ self.assertIs(expected, got,
+ "expected {0!r} for operator.{1}({2!r}, {3!r}); "
+ "got {4!r}".format(
+ expected, op.__name__, x, y, got))
+
+ # repeat the above, but this time trap the InvalidOperation
+ with localcontext() as ctx:
+ ctx.traps[InvalidOperation] = 1
+
+ for x, y in qnan_pairs:
+ for op in equality_ops:
+ got = op(x, y)
+ expected = True if op is operator.ne else False
+ self.assertIs(expected, got,
+ "expected {0!r} for "
+ "operator.{1}({2!r}, {3!r}); "
+ "got {4!r}".format(
+ expected, op.__name__, x, y, got))
+
+ for x, y in snan_pairs:
+ for op in equality_ops:
+ self.assertRaises(InvalidOperation, operator.eq, x, y)
+ self.assertRaises(InvalidOperation, operator.ne, x, y)
+
+ for x, y in qnan_pairs + snan_pairs:
+ for op in order_ops:
+ self.assertRaises(InvalidOperation, op, x, y)
+
+ def test_copy_sign(self):
+ d = Decimal(1).copy_sign(Decimal(-2))
+
+ self.assertEqual(Decimal(1).copy_sign(-2), d)
+ self.assertRaises(TypeError, Decimal(1).copy_sign, '-2')
# The following are two functions used to test threading in the next class
@@ -1063,22 +1255,22 @@ class DecimalUsabilityTest(unittest.TestCase):
dc = Decimal('45')
#two Decimals
- self.failUnless(dc > da)
- self.failUnless(dc >= da)
- self.failUnless(da < dc)
- self.failUnless(da <= dc)
- self.failUnless(da == db)
- self.failUnless(da != dc)
- self.failUnless(da <= db)
- self.failUnless(da >= db)
+ self.assertGreater(dc, da)
+ self.assertGreaterEqual(dc, da)
+ self.assertLess(da, dc)
+ self.assertLessEqual(da, dc)
+ self.assertEqual(da, db)
+ self.assertNotEqual(da, dc)
+ self.assertLessEqual(da, db)
+ self.assertGreaterEqual(da, db)
self.assertEqual(cmp(dc,da), 1)
self.assertEqual(cmp(da,dc), -1)
self.assertEqual(cmp(da,db), 0)
#a Decimal and an int
- self.failUnless(dc > 23)
- self.failUnless(23 < dc)
- self.failUnless(dc == 45)
+ self.assertGreater(dc, 23)
+ self.assertLess(23, dc)
+ self.assertEqual(dc, 45)
self.assertEqual(cmp(dc,23), 1)
self.assertEqual(cmp(23,dc), -1)
self.assertEqual(cmp(dc,45), 0)
@@ -1097,10 +1289,27 @@ class DecimalUsabilityTest(unittest.TestCase):
self.assertEqual(a, b)
# with None
- with _check_py3k_warnings():
+ with check_py3k_warnings():
self.assertFalse(Decimal(1) < None)
self.assertTrue(Decimal(1) > None)
+ def test_decimal_float_comparison(self):
+ da = Decimal('0.25')
+ db = Decimal('3.0')
+ self.assertLess(da, 3.0)
+ self.assertLessEqual(da, 3.0)
+ self.assertGreater(db, 0.25)
+ self.assertGreaterEqual(db, 0.25)
+ self.assertNotEqual(da, 1.5)
+ self.assertEqual(da, 0.25)
+ self.assertGreater(3.0, da)
+ self.assertGreaterEqual(3.0, da)
+ self.assertLess(0.25, db)
+ self.assertLessEqual(0.25, db)
+ self.assertNotEqual(0.25, db)
+ self.assertEqual(3.0, db)
+ self.assertNotEqual(0.1, Decimal('0.1'))
+
def test_copy_and_deepcopy_methods(self):
d = Decimal('43.24')
c = copy.copy(d)
@@ -1111,6 +1320,10 @@ class DecimalUsabilityTest(unittest.TestCase):
def test_hash_method(self):
#just that it's hashable
hash(Decimal(23))
+ hash(Decimal('Infinity'))
+ hash(Decimal('-Infinity'))
+ hash(Decimal('nan123'))
+ hash(Decimal('-NaN'))
test_values = [Decimal(sign*(2**m + n))
for m in [0, 14, 15, 16, 17, 30, 31,
@@ -1145,9 +1358,18 @@ class DecimalUsabilityTest(unittest.TestCase):
#the same hash that to an int
self.assertEqual(hash(Decimal(23)), hash(23))
- self.assertRaises(TypeError, hash, Decimal('NaN'))
- self.assert_(hash(Decimal('Inf')))
- self.assert_(hash(Decimal('-Inf')))
+ self.assertRaises(TypeError, hash, Decimal('sNaN'))
+ self.assertTrue(hash(Decimal('Inf')))
+ self.assertTrue(hash(Decimal('-Inf')))
+
+ # check that the hashes of a Decimal float match when they
+ # represent exactly the same values
+ test_strings = ['inf', '-Inf', '0.0', '-.0e1',
+ '34.0', '2.5', '112390.625', '-0.515625']
+ for s in test_strings:
+ f = float(s)
+ d = Decimal(s)
+ self.assertEqual(hash(f), hash(d))
# check that the value of the hash doesn't depend on the
# current context (issue #1757)
@@ -1174,22 +1396,22 @@ class DecimalUsabilityTest(unittest.TestCase):
l2 = 28
#between Decimals
- self.failUnless(min(d1,d2) is d1)
- self.failUnless(min(d2,d1) is d1)
- self.failUnless(max(d1,d2) is d2)
- self.failUnless(max(d2,d1) is d2)
+ self.assertIs(min(d1,d2), d1)
+ self.assertIs(min(d2,d1), d1)
+ self.assertIs(max(d1,d2), d2)
+ self.assertIs(max(d2,d1), d2)
#between Decimal and long
- self.failUnless(min(d1,l2) is d1)
- self.failUnless(min(l2,d1) is d1)
- self.failUnless(max(l1,d2) is d2)
- self.failUnless(max(d2,l1) is d2)
+ self.assertIs(min(d1,l2), d1)
+ self.assertIs(min(l2,d1), d1)
+ self.assertIs(max(l1,d2), d2)
+ self.assertIs(max(d2,l1), d2)
def test_as_nonzero(self):
#as false
- self.failIf(Decimal(0))
+ self.assertFalse(Decimal(0))
#as true
- self.failUnless(Decimal('0.372'))
+ self.assertTrue(Decimal('0.372'))
def test_tostring_methods(self):
#Test str and repr methods.
@@ -1369,10 +1591,10 @@ class DecimalUsabilityTest(unittest.TestCase):
d1 = MyDecimal(1)
d2 = MyDecimal(2)
d = d1 + d2
- self.assertTrue(type(d) is Decimal)
+ self.assertIs(type(d), Decimal)
d = d1.max(d2)
- self.assertTrue(type(d) is Decimal)
+ self.assertIs(type(d), Decimal)
def test_implicit_context(self):
# Check results when context given implicitly. (Issue 2478)
@@ -1431,10 +1653,10 @@ class DecimalUsabilityTest(unittest.TestCase):
class DecimalPythonAPItests(unittest.TestCase):
def test_abc(self):
- self.assert_(issubclass(Decimal, numbers.Number))
- self.assert_(not issubclass(Decimal, numbers.Real))
- self.assert_(isinstance(Decimal(0), numbers.Number))
- self.assert_(not isinstance(Decimal(0), numbers.Real))
+ self.assertTrue(issubclass(Decimal, numbers.Number))
+ self.assertFalse(issubclass(Decimal, numbers.Real))
+ self.assertIsInstance(Decimal(0), numbers.Number)
+ self.assertNotIsInstance(Decimal(0), numbers.Real)
def test_pickle(self):
d = Decimal('-3.141590000')
@@ -1472,6 +1694,55 @@ class DecimalPythonAPItests(unittest.TestCase):
r = d.to_integral(ROUND_DOWN)
self.assertEqual(Decimal(math.trunc(d)), r)
+ def test_from_float(self):
+
+ class MyDecimal(Decimal):
+ pass
+
+ r = MyDecimal.from_float(0.1)
+ self.assertEqual(type(r), MyDecimal)
+ self.assertEqual(str(r),
+ '0.1000000000000000055511151231257827021181583404541015625')
+ bigint = 12345678901234567890123456789
+ self.assertEqual(MyDecimal.from_float(bigint), MyDecimal(bigint))
+ self.assertTrue(MyDecimal.from_float(float('nan')).is_qnan())
+ self.assertTrue(MyDecimal.from_float(float('inf')).is_infinite())
+ self.assertTrue(MyDecimal.from_float(float('-inf')).is_infinite())
+ self.assertEqual(str(MyDecimal.from_float(float('nan'))),
+ str(Decimal('NaN')))
+ self.assertEqual(str(MyDecimal.from_float(float('inf'))),
+ str(Decimal('Infinity')))
+ self.assertEqual(str(MyDecimal.from_float(float('-inf'))),
+ str(Decimal('-Infinity')))
+ self.assertRaises(TypeError, MyDecimal.from_float, 'abc')
+ for i in range(200):
+ x = random.expovariate(0.01) * (random.random() * 2.0 - 1.0)
+ self.assertEqual(x, float(MyDecimal.from_float(x))) # roundtrip
+
+ def test_create_decimal_from_float(self):
+ context = Context(prec=5, rounding=ROUND_DOWN)
+ self.assertEqual(
+ context.create_decimal_from_float(math.pi),
+ Decimal('3.1415')
+ )
+ context = Context(prec=5, rounding=ROUND_UP)
+ self.assertEqual(
+ context.create_decimal_from_float(math.pi),
+ Decimal('3.1416')
+ )
+ context = Context(prec=5, traps=[Inexact])
+ self.assertRaises(
+ Inexact,
+ context.create_decimal_from_float,
+ math.pi
+ )
+ self.assertEqual(repr(context.create_decimal_from_float(-0.0)),
+ "Decimal('-0')")
+ self.assertEqual(repr(context.create_decimal_from_float(1.0)),
+ "Decimal('1')")
+ self.assertEqual(repr(context.create_decimal_from_float(10)),
+ "Decimal('10')")
+
class ContextAPItests(unittest.TestCase):
def test_pickle(self):
@@ -1483,8 +1754,8 @@ class ContextAPItests(unittest.TestCase):
self.assertEqual(v1, v2)
def test_equality_with_other_types(self):
- self.assert_(Decimal(10) in ['a', 1.0, Decimal(10), (1,2), {}])
- self.assert_(Decimal(10) not in ['a', 1.0, (1,2), {}])
+ self.assertIn(Decimal(10), ['a', 1.0, Decimal(10), (1,2), {}])
+ self.assertNotIn(Decimal(10), ['a', 1.0, (1,2), {}])
def test_copy(self):
# All copies should be deep
@@ -1494,6 +1765,438 @@ class ContextAPItests(unittest.TestCase):
self.assertNotEqual(id(c.flags), id(d.flags))
self.assertNotEqual(id(c.traps), id(d.traps))
+ def test_abs(self):
+ c = Context()
+ d = c.abs(Decimal(-1))
+ self.assertEqual(c.abs(-1), d)
+ self.assertRaises(TypeError, c.abs, '-1')
+
+ def test_add(self):
+ c = Context()
+ d = c.add(Decimal(1), Decimal(1))
+ self.assertEqual(c.add(1, 1), d)
+ self.assertEqual(c.add(Decimal(1), 1), d)
+ self.assertEqual(c.add(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.add, '1', 1)
+ self.assertRaises(TypeError, c.add, 1, '1')
+
+ def test_compare(self):
+ c = Context()
+ d = c.compare(Decimal(1), Decimal(1))
+ self.assertEqual(c.compare(1, 1), d)
+ self.assertEqual(c.compare(Decimal(1), 1), d)
+ self.assertEqual(c.compare(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.compare, '1', 1)
+ self.assertRaises(TypeError, c.compare, 1, '1')
+
+ def test_compare_signal(self):
+ c = Context()
+ d = c.compare_signal(Decimal(1), Decimal(1))
+ self.assertEqual(c.compare_signal(1, 1), d)
+ self.assertEqual(c.compare_signal(Decimal(1), 1), d)
+ self.assertEqual(c.compare_signal(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.compare_signal, '1', 1)
+ self.assertRaises(TypeError, c.compare_signal, 1, '1')
+
+ def test_compare_total(self):
+ c = Context()
+ d = c.compare_total(Decimal(1), Decimal(1))
+ self.assertEqual(c.compare_total(1, 1), d)
+ self.assertEqual(c.compare_total(Decimal(1), 1), d)
+ self.assertEqual(c.compare_total(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.compare_total, '1', 1)
+ self.assertRaises(TypeError, c.compare_total, 1, '1')
+
+ def test_compare_total_mag(self):
+ c = Context()
+ d = c.compare_total_mag(Decimal(1), Decimal(1))
+ self.assertEqual(c.compare_total_mag(1, 1), d)
+ self.assertEqual(c.compare_total_mag(Decimal(1), 1), d)
+ self.assertEqual(c.compare_total_mag(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.compare_total_mag, '1', 1)
+ self.assertRaises(TypeError, c.compare_total_mag, 1, '1')
+
+ def test_copy_abs(self):
+ c = Context()
+ d = c.copy_abs(Decimal(-1))
+ self.assertEqual(c.copy_abs(-1), d)
+ self.assertRaises(TypeError, c.copy_abs, '-1')
+
+ def test_copy_decimal(self):
+ c = Context()
+ d = c.copy_decimal(Decimal(-1))
+ self.assertEqual(c.copy_decimal(-1), d)
+ self.assertRaises(TypeError, c.copy_decimal, '-1')
+
+ def test_copy_negate(self):
+ c = Context()
+ d = c.copy_negate(Decimal(-1))
+ self.assertEqual(c.copy_negate(-1), d)
+ self.assertRaises(TypeError, c.copy_negate, '-1')
+
+ def test_copy_sign(self):
+ c = Context()
+ d = c.copy_sign(Decimal(1), Decimal(-2))
+ self.assertEqual(c.copy_sign(1, -2), d)
+ self.assertEqual(c.copy_sign(Decimal(1), -2), d)
+ self.assertEqual(c.copy_sign(1, Decimal(-2)), d)
+ self.assertRaises(TypeError, c.copy_sign, '1', -2)
+ self.assertRaises(TypeError, c.copy_sign, 1, '-2')
+
+ def test_divide(self):
+ c = Context()
+ d = c.divide(Decimal(1), Decimal(2))
+ self.assertEqual(c.divide(1, 2), d)
+ self.assertEqual(c.divide(Decimal(1), 2), d)
+ self.assertEqual(c.divide(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.divide, '1', 2)
+ self.assertRaises(TypeError, c.divide, 1, '2')
+
+ def test_divide_int(self):
+ c = Context()
+ d = c.divide_int(Decimal(1), Decimal(2))
+ self.assertEqual(c.divide_int(1, 2), d)
+ self.assertEqual(c.divide_int(Decimal(1), 2), d)
+ self.assertEqual(c.divide_int(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.divide_int, '1', 2)
+ self.assertRaises(TypeError, c.divide_int, 1, '2')
+
+ def test_divmod(self):
+ c = Context()
+ d = c.divmod(Decimal(1), Decimal(2))
+ self.assertEqual(c.divmod(1, 2), d)
+ self.assertEqual(c.divmod(Decimal(1), 2), d)
+ self.assertEqual(c.divmod(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.divmod, '1', 2)
+ self.assertRaises(TypeError, c.divmod, 1, '2')
+
+ def test_exp(self):
+ c = Context()
+ d = c.exp(Decimal(10))
+ self.assertEqual(c.exp(10), d)
+ self.assertRaises(TypeError, c.exp, '10')
+
+ def test_fma(self):
+ c = Context()
+ d = c.fma(Decimal(2), Decimal(3), Decimal(4))
+ self.assertEqual(c.fma(2, 3, 4), d)
+ self.assertEqual(c.fma(Decimal(2), 3, 4), d)
+ self.assertEqual(c.fma(2, Decimal(3), 4), d)
+ self.assertEqual(c.fma(2, 3, Decimal(4)), d)
+ self.assertEqual(c.fma(Decimal(2), Decimal(3), 4), d)
+ self.assertRaises(TypeError, c.fma, '2', 3, 4)
+ self.assertRaises(TypeError, c.fma, 2, '3', 4)
+ self.assertRaises(TypeError, c.fma, 2, 3, '4')
+
+ def test_is_finite(self):
+ c = Context()
+ d = c.is_finite(Decimal(10))
+ self.assertEqual(c.is_finite(10), d)
+ self.assertRaises(TypeError, c.is_finite, '10')
+
+ def test_is_infinite(self):
+ c = Context()
+ d = c.is_infinite(Decimal(10))
+ self.assertEqual(c.is_infinite(10), d)
+ self.assertRaises(TypeError, c.is_infinite, '10')
+
+ def test_is_nan(self):
+ c = Context()
+ d = c.is_nan(Decimal(10))
+ self.assertEqual(c.is_nan(10), d)
+ self.assertRaises(TypeError, c.is_nan, '10')
+
+ def test_is_normal(self):
+ c = Context()
+ d = c.is_normal(Decimal(10))
+ self.assertEqual(c.is_normal(10), d)
+ self.assertRaises(TypeError, c.is_normal, '10')
+
+ def test_is_qnan(self):
+ c = Context()
+ d = c.is_qnan(Decimal(10))
+ self.assertEqual(c.is_qnan(10), d)
+ self.assertRaises(TypeError, c.is_qnan, '10')
+
+ def test_is_signed(self):
+ c = Context()
+ d = c.is_signed(Decimal(10))
+ self.assertEqual(c.is_signed(10), d)
+ self.assertRaises(TypeError, c.is_signed, '10')
+
+ def test_is_snan(self):
+ c = Context()
+ d = c.is_snan(Decimal(10))
+ self.assertEqual(c.is_snan(10), d)
+ self.assertRaises(TypeError, c.is_snan, '10')
+
+ def test_is_subnormal(self):
+ c = Context()
+ d = c.is_subnormal(Decimal(10))
+ self.assertEqual(c.is_subnormal(10), d)
+ self.assertRaises(TypeError, c.is_subnormal, '10')
+
+ def test_is_zero(self):
+ c = Context()
+ d = c.is_zero(Decimal(10))
+ self.assertEqual(c.is_zero(10), d)
+ self.assertRaises(TypeError, c.is_zero, '10')
+
+ def test_ln(self):
+ c = Context()
+ d = c.ln(Decimal(10))
+ self.assertEqual(c.ln(10), d)
+ self.assertRaises(TypeError, c.ln, '10')
+
+ def test_log10(self):
+ c = Context()
+ d = c.log10(Decimal(10))
+ self.assertEqual(c.log10(10), d)
+ self.assertRaises(TypeError, c.log10, '10')
+
+ def test_logb(self):
+ c = Context()
+ d = c.logb(Decimal(10))
+ self.assertEqual(c.logb(10), d)
+ self.assertRaises(TypeError, c.logb, '10')
+
+ def test_logical_and(self):
+ c = Context()
+ d = c.logical_and(Decimal(1), Decimal(1))
+ self.assertEqual(c.logical_and(1, 1), d)
+ self.assertEqual(c.logical_and(Decimal(1), 1), d)
+ self.assertEqual(c.logical_and(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.logical_and, '1', 1)
+ self.assertRaises(TypeError, c.logical_and, 1, '1')
+
+ def test_logical_invert(self):
+ c = Context()
+ d = c.logical_invert(Decimal(1000))
+ self.assertEqual(c.logical_invert(1000), d)
+ self.assertRaises(TypeError, c.logical_invert, '1000')
+
+ def test_logical_or(self):
+ c = Context()
+ d = c.logical_or(Decimal(1), Decimal(1))
+ self.assertEqual(c.logical_or(1, 1), d)
+ self.assertEqual(c.logical_or(Decimal(1), 1), d)
+ self.assertEqual(c.logical_or(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.logical_or, '1', 1)
+ self.assertRaises(TypeError, c.logical_or, 1, '1')
+
+ def test_logical_xor(self):
+ c = Context()
+ d = c.logical_xor(Decimal(1), Decimal(1))
+ self.assertEqual(c.logical_xor(1, 1), d)
+ self.assertEqual(c.logical_xor(Decimal(1), 1), d)
+ self.assertEqual(c.logical_xor(1, Decimal(1)), d)
+ self.assertRaises(TypeError, c.logical_xor, '1', 1)
+ self.assertRaises(TypeError, c.logical_xor, 1, '1')
+
+ def test_max(self):
+ c = Context()
+ d = c.max(Decimal(1), Decimal(2))
+ self.assertEqual(c.max(1, 2), d)
+ self.assertEqual(c.max(Decimal(1), 2), d)
+ self.assertEqual(c.max(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.max, '1', 2)
+ self.assertRaises(TypeError, c.max, 1, '2')
+
+ def test_max_mag(self):
+ c = Context()
+ d = c.max_mag(Decimal(1), Decimal(2))
+ self.assertEqual(c.max_mag(1, 2), d)
+ self.assertEqual(c.max_mag(Decimal(1), 2), d)
+ self.assertEqual(c.max_mag(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.max_mag, '1', 2)
+ self.assertRaises(TypeError, c.max_mag, 1, '2')
+
+ def test_min(self):
+ c = Context()
+ d = c.min(Decimal(1), Decimal(2))
+ self.assertEqual(c.min(1, 2), d)
+ self.assertEqual(c.min(Decimal(1), 2), d)
+ self.assertEqual(c.min(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.min, '1', 2)
+ self.assertRaises(TypeError, c.min, 1, '2')
+
+ def test_min_mag(self):
+ c = Context()
+ d = c.min_mag(Decimal(1), Decimal(2))
+ self.assertEqual(c.min_mag(1, 2), d)
+ self.assertEqual(c.min_mag(Decimal(1), 2), d)
+ self.assertEqual(c.min_mag(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.min_mag, '1', 2)
+ self.assertRaises(TypeError, c.min_mag, 1, '2')
+
+ def test_minus(self):
+ c = Context()
+ d = c.minus(Decimal(10))
+ self.assertEqual(c.minus(10), d)
+ self.assertRaises(TypeError, c.minus, '10')
+
+ def test_multiply(self):
+ c = Context()
+ d = c.multiply(Decimal(1), Decimal(2))
+ self.assertEqual(c.multiply(1, 2), d)
+ self.assertEqual(c.multiply(Decimal(1), 2), d)
+ self.assertEqual(c.multiply(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.multiply, '1', 2)
+ self.assertRaises(TypeError, c.multiply, 1, '2')
+
+ def test_next_minus(self):
+ c = Context()
+ d = c.next_minus(Decimal(10))
+ self.assertEqual(c.next_minus(10), d)
+ self.assertRaises(TypeError, c.next_minus, '10')
+
+ def test_next_plus(self):
+ c = Context()
+ d = c.next_plus(Decimal(10))
+ self.assertEqual(c.next_plus(10), d)
+ self.assertRaises(TypeError, c.next_plus, '10')
+
+ def test_next_toward(self):
+ c = Context()
+ d = c.next_toward(Decimal(1), Decimal(2))
+ self.assertEqual(c.next_toward(1, 2), d)
+ self.assertEqual(c.next_toward(Decimal(1), 2), d)
+ self.assertEqual(c.next_toward(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.next_toward, '1', 2)
+ self.assertRaises(TypeError, c.next_toward, 1, '2')
+
+ def test_normalize(self):
+ c = Context()
+ d = c.normalize(Decimal(10))
+ self.assertEqual(c.normalize(10), d)
+ self.assertRaises(TypeError, c.normalize, '10')
+
+ def test_number_class(self):
+ c = Context()
+ self.assertEqual(c.number_class(123), c.number_class(Decimal(123)))
+ self.assertEqual(c.number_class(0), c.number_class(Decimal(0)))
+ self.assertEqual(c.number_class(-45), c.number_class(Decimal(-45)))
+
+ def test_power(self):
+ c = Context()
+ d = c.power(Decimal(1), Decimal(4), Decimal(2))
+ self.assertEqual(c.power(1, 4, 2), d)
+ self.assertEqual(c.power(Decimal(1), 4, 2), d)
+ self.assertEqual(c.power(1, Decimal(4), 2), d)
+ self.assertEqual(c.power(1, 4, Decimal(2)), d)
+ self.assertEqual(c.power(Decimal(1), Decimal(4), 2), d)
+ self.assertRaises(TypeError, c.power, '1', 4, 2)
+ self.assertRaises(TypeError, c.power, 1, '4', 2)
+ self.assertRaises(TypeError, c.power, 1, 4, '2')
+
+ def test_plus(self):
+ c = Context()
+ d = c.plus(Decimal(10))
+ self.assertEqual(c.plus(10), d)
+ self.assertRaises(TypeError, c.plus, '10')
+
+ def test_quantize(self):
+ c = Context()
+ d = c.quantize(Decimal(1), Decimal(2))
+ self.assertEqual(c.quantize(1, 2), d)
+ self.assertEqual(c.quantize(Decimal(1), 2), d)
+ self.assertEqual(c.quantize(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.quantize, '1', 2)
+ self.assertRaises(TypeError, c.quantize, 1, '2')
+
+ def test_remainder(self):
+ c = Context()
+ d = c.remainder(Decimal(1), Decimal(2))
+ self.assertEqual(c.remainder(1, 2), d)
+ self.assertEqual(c.remainder(Decimal(1), 2), d)
+ self.assertEqual(c.remainder(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.remainder, '1', 2)
+ self.assertRaises(TypeError, c.remainder, 1, '2')
+
+ def test_remainder_near(self):
+ c = Context()
+ d = c.remainder_near(Decimal(1), Decimal(2))
+ self.assertEqual(c.remainder_near(1, 2), d)
+ self.assertEqual(c.remainder_near(Decimal(1), 2), d)
+ self.assertEqual(c.remainder_near(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.remainder_near, '1', 2)
+ self.assertRaises(TypeError, c.remainder_near, 1, '2')
+
+ def test_rotate(self):
+ c = Context()
+ d = c.rotate(Decimal(1), Decimal(2))
+ self.assertEqual(c.rotate(1, 2), d)
+ self.assertEqual(c.rotate(Decimal(1), 2), d)
+ self.assertEqual(c.rotate(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.rotate, '1', 2)
+ self.assertRaises(TypeError, c.rotate, 1, '2')
+
+ def test_sqrt(self):
+ c = Context()
+ d = c.sqrt(Decimal(10))
+ self.assertEqual(c.sqrt(10), d)
+ self.assertRaises(TypeError, c.sqrt, '10')
+
+ def test_same_quantum(self):
+ c = Context()
+ d = c.same_quantum(Decimal(1), Decimal(2))
+ self.assertEqual(c.same_quantum(1, 2), d)
+ self.assertEqual(c.same_quantum(Decimal(1), 2), d)
+ self.assertEqual(c.same_quantum(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.same_quantum, '1', 2)
+ self.assertRaises(TypeError, c.same_quantum, 1, '2')
+
+ def test_scaleb(self):
+ c = Context()
+ d = c.scaleb(Decimal(1), Decimal(2))
+ self.assertEqual(c.scaleb(1, 2), d)
+ self.assertEqual(c.scaleb(Decimal(1), 2), d)
+ self.assertEqual(c.scaleb(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.scaleb, '1', 2)
+ self.assertRaises(TypeError, c.scaleb, 1, '2')
+
+ def test_shift(self):
+ c = Context()
+ d = c.shift(Decimal(1), Decimal(2))
+ self.assertEqual(c.shift(1, 2), d)
+ self.assertEqual(c.shift(Decimal(1), 2), d)
+ self.assertEqual(c.shift(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.shift, '1', 2)
+ self.assertRaises(TypeError, c.shift, 1, '2')
+
+ def test_subtract(self):
+ c = Context()
+ d = c.subtract(Decimal(1), Decimal(2))
+ self.assertEqual(c.subtract(1, 2), d)
+ self.assertEqual(c.subtract(Decimal(1), 2), d)
+ self.assertEqual(c.subtract(1, Decimal(2)), d)
+ self.assertRaises(TypeError, c.subtract, '1', 2)
+ self.assertRaises(TypeError, c.subtract, 1, '2')
+
+ def test_to_eng_string(self):
+ c = Context()
+ d = c.to_eng_string(Decimal(10))
+ self.assertEqual(c.to_eng_string(10), d)
+ self.assertRaises(TypeError, c.to_eng_string, '10')
+
+ def test_to_sci_string(self):
+ c = Context()
+ d = c.to_sci_string(Decimal(10))
+ self.assertEqual(c.to_sci_string(10), d)
+ self.assertRaises(TypeError, c.to_sci_string, '10')
+
+ def test_to_integral_exact(self):
+ c = Context()
+ d = c.to_integral_exact(Decimal(10))
+ self.assertEqual(c.to_integral_exact(10), d)
+ self.assertRaises(TypeError, c.to_integral_exact, '10')
+
+ def test_to_integral_value(self):
+ c = Context()
+ d = c.to_integral_value(Decimal(10))
+ self.assertEqual(c.to_integral_value(10), d)
+ self.assertRaises(TypeError, c.to_integral_value, '10')
+
class WithStatementTest(unittest.TestCase):
# Can't do these as docstrings until Python 2.6
# as doctest can't handle __future__ statements
@@ -1504,9 +2207,9 @@ class WithStatementTest(unittest.TestCase):
with localcontext() as enter_ctx:
set_ctx = getcontext()
final_ctx = getcontext()
- self.assert_(orig_ctx is final_ctx, 'did not restore context correctly')
- self.assert_(orig_ctx is not set_ctx, 'did not copy the context')
- self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context')
+ self.assertIs(orig_ctx, final_ctx, 'did not restore context correctly')
+ self.assertIsNot(orig_ctx, set_ctx, 'did not copy the context')
+ self.assertIs(set_ctx, enter_ctx, '__enter__ returned wrong context')
def test_localcontextarg(self):
# Use a copy of the supplied context in the block
@@ -1515,10 +2218,10 @@ class WithStatementTest(unittest.TestCase):
with localcontext(new_ctx) as enter_ctx:
set_ctx = getcontext()
final_ctx = getcontext()
- self.assert_(orig_ctx is final_ctx, 'did not restore context correctly')
- self.assert_(set_ctx.prec == new_ctx.prec, 'did not set correct context')
- self.assert_(new_ctx is not set_ctx, 'did not copy the context')
- self.assert_(set_ctx is enter_ctx, '__enter__ returned wrong context')
+ self.assertIs(orig_ctx, final_ctx, 'did not restore context correctly')
+ self.assertEqual(set_ctx.prec, new_ctx.prec, 'did not set correct context')
+ self.assertIsNot(new_ctx, set_ctx, 'did not copy the context')
+ self.assertIs(set_ctx, enter_ctx, '__enter__ returned wrong context')
class ContextFlags(unittest.TestCase):
def test_flags_irrelevant(self):
@@ -1559,20 +2262,16 @@ class ContextFlags(unittest.TestCase):
for flag in extra_flags:
if flag not in expected_flags:
expected_flags.append(flag)
- with _check_py3k_warnings(quiet=True):
- expected_flags.sort()
# flags we actually got
new_flags = [k for k,v in context.flags.items() if v]
- with _check_py3k_warnings(quiet=True):
- new_flags.sort()
self.assertEqual(ans, new_ans,
"operation produces different answers depending on flags set: " +
"expected %s, got %s." % (ans, new_ans))
- self.assertEqual(new_flags, expected_flags,
- "operation raises different flags depending on flags set: " +
- "expected %s, got %s" % (expected_flags, new_flags))
+ self.assertItemsEqual(new_flags, expected_flags,
+ "operation raises different flags depending on flags set: " +
+ "expected %s, got %s" % (expected_flags, new_flags))
def test_main(arith=False, verbose=None, todo_tests=None, debug=None):
""" Execute the tests.
diff --git a/Lib/test/test_defaultdict.py b/Lib/test/test_defaultdict.py
index 7ad239239a..a524ad7909 100644
--- a/Lib/test/test_defaultdict.py
+++ b/Lib/test/test_defaultdict.py
@@ -24,21 +24,21 @@ class TestDefaultDict(unittest.TestCase):
d1[13]
d1[14]
self.assertEqual(d1, {12: [42, 24], 13: [], 14: []})
- self.assert_(d1[12] is not d1[13] is not d1[14])
+ self.assertTrue(d1[12] is not d1[13] is not d1[14])
d2 = defaultdict(list, foo=1, bar=2)
self.assertEqual(d2.default_factory, list)
self.assertEqual(d2, {"foo": 1, "bar": 2})
self.assertEqual(d2["foo"], 1)
self.assertEqual(d2["bar"], 2)
self.assertEqual(d2[42], [])
- self.assert_("foo" in d2)
- self.assert_("foo" in d2.keys())
- self.assert_("bar" in d2)
- self.assert_("bar" in d2.keys())
- self.assert_(42 in d2)
- self.assert_(42 in d2.keys())
- self.assert_(12 not in d2)
- self.assert_(12 not in d2.keys())
+ self.assertIn("foo", d2)
+ self.assertIn("foo", d2.keys())
+ self.assertIn("bar", d2)
+ self.assertIn("bar", d2.keys())
+ self.assertIn(42, d2)
+ self.assertIn(42, d2.keys())
+ self.assertNotIn(12, d2)
+ self.assertNotIn(12, d2.keys())
d2.default_factory = None
self.assertEqual(d2.default_factory, None)
try:
@@ -68,7 +68,7 @@ class TestDefaultDict(unittest.TestCase):
self.assertEqual(repr(d2), "defaultdict(<type 'int'>, {12: 42})")
def foo(): return 43
d3 = defaultdict(foo)
- self.assert_(d3.default_factory is foo)
+ self.assertTrue(d3.default_factory is foo)
d3[13]
self.assertEqual(repr(d3), "defaultdict(%s, {13: 43})" % repr(foo))
@@ -133,7 +133,7 @@ class TestDefaultDict(unittest.TestCase):
d2 = copy.deepcopy(d1)
self.assertEqual(d2.default_factory, foobar)
self.assertEqual(d2, d1)
- self.assert_(d1[1] is not d2[1])
+ self.assertTrue(d1[1] is not d2[1])
d1.default_factory = list
d2 = copy.deepcopy(d1)
self.assertEqual(d2.default_factory, list)
@@ -156,7 +156,7 @@ class TestDefaultDict(unittest.TestCase):
def _factory(self):
return []
d = sub()
- self.assert_(repr(d).startswith(
+ self.assertTrue(repr(d).startswith(
"defaultdict(<bound method sub._factory of defaultdict(..."))
# NOTE: printing a subclass of a builtin type does not call its
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py
index 55888d03e9..a0d30f1828 100644
--- a/Lib/test/test_deque.py
+++ b/Lib/test/test_deque.py
@@ -6,7 +6,6 @@ import weakref
import copy
import cPickle as pickle
import random
-import os
BIG = 100000
@@ -50,7 +49,9 @@ class TestBasic(unittest.TestCase):
def test_maxlen(self):
self.assertRaises(ValueError, deque, 'abc', -1)
self.assertRaises(ValueError, deque, 'abc', -2)
- d = deque(range(10), maxlen=3)
+ it = iter(range(10))
+ d = deque(it, maxlen=3)
+ self.assertEqual(list(it), [])
self.assertEqual(repr(d), 'deque([7, 8, 9], maxlen=3)')
self.assertEqual(list(d), range(7, 10))
self.assertEqual(d, deque(range(10), 3))
@@ -87,6 +88,64 @@ class TestBasic(unittest.TestCase):
fo.close()
test_support.unlink(test_support.TESTFN)
+ def test_maxlen_zero(self):
+ it = iter(range(100))
+ deque(it, maxlen=0)
+ self.assertEqual(list(it), [])
+
+ it = iter(range(100))
+ d = deque(maxlen=0)
+ d.extend(it)
+ self.assertEqual(list(it), [])
+
+ it = iter(range(100))
+ d = deque(maxlen=0)
+ d.extendleft(it)
+ self.assertEqual(list(it), [])
+
+ def test_maxlen_attribute(self):
+ self.assertEqual(deque().maxlen, None)
+ self.assertEqual(deque('abc').maxlen, None)
+ self.assertEqual(deque('abc', maxlen=4).maxlen, 4)
+ self.assertEqual(deque('abc', maxlen=2).maxlen, 2)
+ self.assertEqual(deque('abc', maxlen=0).maxlen, 0)
+ with self.assertRaises(AttributeError):
+ d = deque('abc')
+ d.maxlen = 10
+
+ def test_count(self):
+ for s in ('', 'abracadabra', 'simsalabim'*500+'abc'):
+ s = list(s)
+ d = deque(s)
+ for letter in 'abcdefghijklmnopqrstuvwxyz':
+ self.assertEqual(s.count(letter), d.count(letter), (s, d, letter))
+ self.assertRaises(TypeError, d.count) # too few args
+ self.assertRaises(TypeError, d.count, 1, 2) # too many args
+ class BadCompare:
+ def __eq__(self, other):
+ raise ArithmeticError
+ d = deque([1, 2, BadCompare(), 3])
+ self.assertRaises(ArithmeticError, d.count, 2)
+ d = deque([1, 2, 3])
+ self.assertRaises(ArithmeticError, d.count, BadCompare())
+ class MutatingCompare:
+ def __eq__(self, other):
+ self.d.pop()
+ return True
+ m = MutatingCompare()
+ d = deque([1, 2, 3, m, 4, 5])
+ m.d = d
+ self.assertRaises(RuntimeError, d.count, 3)
+
+ # test issue11004
+ # block advance failed after rotation aligned elements on right side of block
+ d = deque([None]*16)
+ for i in range(len(d)):
+ d.rotate(-1)
+ d.rotate(1)
+ self.assertEqual(d.count(1), 0)
+ self.assertEqual(d.count(None), 16)
+
def test_comparisons(self):
d = deque('xabc'); d.popleft()
for e in [d, deque('abc'), deque('ab'), deque(), list(d)]:
@@ -172,11 +231,23 @@ class TestBasic(unittest.TestCase):
self.assertEqual(len(d), n-i)
j = random.randrange(-len(d), len(d))
val = d[j]
- self.assert_(val in d)
+ self.assertIn(val, d)
del d[j]
- self.assert_(val not in d)
+ self.assertNotIn(val, d)
self.assertEqual(len(d), 0)
+ def test_reverse(self):
+ n = 500 # O(n**2) test, don't make this too big
+ data = [random.random() for i in range(n)]
+ for i in range(n):
+ d = deque(data[:i])
+ r = d.reverse()
+ self.assertEqual(list(d), list(reversed(data[:i])))
+ self.assertIs(r, None)
+ d.reverse()
+ self.assertEqual(list(d), data[:i])
+ self.assertRaises(TypeError, d.reverse, 1) # Arity is zero
+
def test_rotate(self):
s = tuple('abcde')
n = len(s)
@@ -275,7 +346,7 @@ class TestBasic(unittest.TestCase):
self.assertRaises(RuntimeError, d.remove, 'c')
for x, y in zip(d, e):
# verify that original order and values are retained.
- self.assert_(x is y)
+ self.assertTrue(x is y)
# Handle evil mutator
for match in (True, False):
@@ -289,7 +360,7 @@ class TestBasic(unittest.TestCase):
e = eval(repr(d))
self.assertEqual(list(d), list(e))
d.append(d)
- self.assert_('...' in repr(d))
+ self.assertIn('...', repr(d))
def test_print(self):
d = deque(xrange(200))
@@ -444,7 +515,7 @@ class TestBasic(unittest.TestCase):
obj.x = iter(container)
del obj, container
gc.collect()
- self.assert_(ref() is None, "Cycle was not collected")
+ self.assertTrue(ref() is None, "Cycle was not collected")
class TestVariousIteratorArgs(unittest.TestCase):
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 55c5266268..1fe0de582a 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -67,8 +67,9 @@ class OperatorsTest(unittest.TestCase):
# Find method in parent class
while meth not in t.__dict__:
t = t.__bases__[0]
-
- self.assertEqual(m, t.__dict__[meth])
+ # in some implementations (e.g. PyPy), 'm' can be a regular unbound
+ # method object; the getattr() below obtains its underlying function.
+ self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth])
self.assertEqual(m(a), res)
bm = getattr(a, meth)
self.assertEqual(bm(), res)
@@ -87,7 +88,9 @@ class OperatorsTest(unittest.TestCase):
m = getattr(t, meth)
while meth not in t.__dict__:
t = t.__bases__[0]
- self.assertEqual(m, t.__dict__[meth])
+ # in some implementations (e.g. PyPy), 'm' can be a regular unbound
+ # method object; the getattr() below obtains its underlying function.
+ self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth])
self.assertEqual(m(a, b), res)
bm = getattr(a, meth)
self.assertEqual(bm(b), res)
@@ -99,7 +102,9 @@ class OperatorsTest(unittest.TestCase):
m = getattr(t, meth)
while meth not in t.__dict__:
t = t.__bases__[0]
- self.assertEqual(m, t.__dict__[meth])
+ # in some implementations (e.g. PyPy), 'm' can be a regular unbound
+ # method object; the getattr() below obtains its underlying function.
+ self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth])
self.assertEqual(m(a, b, c), res)
bm = getattr(a, meth)
self.assertEqual(bm(b, c), res)
@@ -112,7 +117,9 @@ class OperatorsTest(unittest.TestCase):
m = getattr(t, meth)
while meth not in t.__dict__:
t = t.__bases__[0]
- self.assertEqual(m, t.__dict__[meth])
+ # in some implementations (e.g. PyPy), 'm' can be a regular unbound
+ # method object; the getattr() below obtains its underlying function.
+ self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth])
d['a'] = deepcopy(a)
m(d['a'], b)
self.assertEqual(d['a'], res)
@@ -129,7 +136,9 @@ class OperatorsTest(unittest.TestCase):
m = getattr(t, meth)
while meth not in t.__dict__:
t = t.__bases__[0]
- self.assertEqual(m, t.__dict__[meth])
+ # in some implementations (e.g. PyPy), 'm' can be a regular unbound
+ # method object; the getattr() below obtains its underlying function.
+ self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth])
d['a'] = deepcopy(a)
m(d['a'], b, c)
self.assertEqual(d['a'], res)
@@ -146,7 +155,9 @@ class OperatorsTest(unittest.TestCase):
while meth not in t.__dict__:
t = t.__bases__[0]
m = getattr(t, meth)
- self.assertEqual(m, t.__dict__[meth])
+ # in some implementations (e.g. PyPy), 'm' can be a regular unbound
+ # method object; the getattr() below obtains its underlying function.
+ self.assertEqual(getattr(m, 'im_func', m), t.__dict__[meth])
dictionary['a'] = deepcopy(a)
m(dictionary['a'], b, c, d)
self.assertEqual(dictionary['a'], res)
@@ -174,7 +185,10 @@ class OperatorsTest(unittest.TestCase):
def test_dicts(self):
# Testing dict operations...
- self.binop_test({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__")
+ if hasattr(dict, '__cmp__'): # PyPy has only rich comparison on dicts
+ self.binop_test({1:2}, {2:1}, -1, "cmp(a,b)", "__cmp__")
+ else:
+ self.binop_test({1:2}, {2:1}, True, "a < b", "__lt__")
self.binop_test({1:2,3:4}, 1, 1, "b in a", "__contains__")
self.binop_test({1:2,3:4}, 2, 0, "b in a", "__contains__")
self.binop_test({1:2,3:4}, 1, 2, "a[b]", "__getitem__")
@@ -237,7 +251,6 @@ class OperatorsTest(unittest.TestCase):
pass
else:
self.fail("NotImplemented should have caused TypeError")
- import sys
try:
C(sys.maxint+1)
except OverflowError:
@@ -285,6 +298,7 @@ class OperatorsTest(unittest.TestCase):
self.assertEqual(repr(a), "234.5")
self.assertEqual(a.prec, 12)
+ @test_support.impl_detail("the module 'xxsubtype' is internal")
def test_spam_lists(self):
# Testing spamlist operations...
import copy, xxsubtype as spam
@@ -328,6 +342,7 @@ class OperatorsTest(unittest.TestCase):
a.setstate(42)
self.assertEqual(a.getstate(), 42)
+ @test_support.impl_detail("the module 'xxsubtype' is internal")
def test_spam_dicts(self):
# Testing spamdict operations...
import copy, xxsubtype as spam
@@ -383,12 +398,12 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def test_python_dicts(self):
# Testing Python subclass of dict...
- self.assert_(issubclass(dict, dict))
- self.assert_(isinstance({}, dict))
+ self.assertTrue(issubclass(dict, dict))
+ self.assertIsInstance({}, dict)
d = dict()
self.assertEqual(d, {})
- self.assert_(d.__class__ is dict)
- self.assert_(isinstance(d, dict))
+ self.assertTrue(d.__class__ is dict)
+ self.assertIsInstance(d, dict)
class C(dict):
state = -1
def __init__(self_local, *a, **kw):
@@ -401,13 +416,13 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def __getitem__(self, key):
return self.get(key, 0)
def __setitem__(self_local, key, value):
- self.assert_(isinstance(key, type(0)))
+ self.assertIsInstance(key, type(0))
dict.__setitem__(self_local, key, value)
def setstate(self, state):
self.state = state
def getstate(self):
return self.state
- self.assert_(issubclass(C, dict))
+ self.assertTrue(issubclass(C, dict))
a1 = C(12)
self.assertEqual(a1.state, 12)
a2 = C(foo=1, bar=2)
@@ -501,7 +516,7 @@ class ClassPropertiesAndMethods(unittest.TestCase):
return 42
self.assertEqual(C.name, 'C')
self.assertEqual(C.bases, ())
- self.assert_('spam' in C.dict)
+ self.assertIn('spam', C.dict)
c = C()
self.assertEqual(c.spam(), 42)
@@ -568,7 +583,7 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def _set_x(self, x):
self.__x = -x
a = A()
- self.assert_(not hasattr(a, "x"))
+ self.assertTrue(not hasattr(a, "x"))
a.x = 12
self.assertEqual(a.x, 12)
self.assertEqual(a._A__x, -12)
@@ -628,7 +643,6 @@ class ClassPropertiesAndMethods(unittest.TestCase):
def test_module_subclasses(self):
# Testing Python subclass of module...
log = []
- import types, sys
MT = type(sys)
class MM(MT):
def __init__(self, name):
@@ -862,7 +876,7 @@ class ClassPropertiesAndMethods(unittest.TestCase):
# see "A Monotonic Superclass Linearization for Dylan",
# by Kim Barrett et al. (OOPSLA 1996)
def test_consistency_with_epg(self):
- # Testing consistentcy with EPG...
+ # Testing consistency with EPG...
class Pane(object): pass
class ScrollingMixin(object): pass
class EditingMixin(object): pass
@@ -883,8 +897,11 @@ order (MRO) for bases """
try:
callable(*args)
except exc, msg:
- if not str(msg).startswith(expected):
- self.fail("Message %r, expected %r" % (str(msg), expected))
+ # the exact msg is generally considered an impl detail
+ if test_support.check_impl_detail():
+ if not str(msg).startswith(expected):
+ self.fail("Message %r, expected %r" %
+ (str(msg), expected))
else:
self.fail("Expected %s" % exc)
@@ -1077,6 +1094,7 @@ order (MRO) for bases """
x.c = Counted()
self.assertEqual(Counted.counter, 3)
del x
+ test_support.gc_collect()
self.assertEqual(Counted.counter, 0)
class D(C):
pass
@@ -1085,6 +1103,7 @@ order (MRO) for bases """
x.z = Counted()
self.assertEqual(Counted.counter, 2)
del x
+ test_support.gc_collect()
self.assertEqual(Counted.counter, 0)
class E(D):
__slots__ = ['e']
@@ -1094,32 +1113,33 @@ order (MRO) for bases """
x.e = Counted()
self.assertEqual(Counted.counter, 3)
del x
+ test_support.gc_collect()
self.assertEqual(Counted.counter, 0)
# Test cyclical leaks [SF bug 519621]
class F(object):
__slots__ = ['a', 'b']
- log = []
s = F()
s.a = [Counted(), s]
self.assertEqual(Counted.counter, 1)
s = None
- import gc
- gc.collect()
+ test_support.gc_collect()
self.assertEqual(Counted.counter, 0)
# Test lookup leaks [SF bug 572567]
- import sys,gc
- class G(object):
- def __cmp__(self, other):
- return 0
- __hash__ = None # Silence Py3k warning
- g = G()
- orig_objects = len(gc.get_objects())
- for i in xrange(10):
- g==g
- new_objects = len(gc.get_objects())
- self.assertEqual(orig_objects, new_objects)
+ import gc
+ if hasattr(gc, 'get_objects'):
+ class G(object):
+ def __cmp__(self, other):
+ return 0
+ __hash__ = None # Silence Py3k warning
+ g = G()
+ orig_objects = len(gc.get_objects())
+ for i in xrange(10):
+ g==g
+ new_objects = len(gc.get_objects())
+ self.assertEqual(orig_objects, new_objects)
+
class H(object):
__slots__ = ['a', 'b']
def __init__(self):
@@ -1135,19 +1155,15 @@ order (MRO) for bases """
class X(object):
__slots__ = "a"
- try:
+ with self.assertRaises(AttributeError):
del X().a
- except AttributeError:
- pass
- else:
- self.fail("didn't raise AttributeError")
def test_slots_special(self):
# Testing __dict__ and __weakref__ in __slots__...
class D(object):
__slots__ = ["__dict__"]
a = D()
- self.assert_(hasattr(a, "__dict__"))
+ self.assertTrue(hasattr(a, "__dict__"))
self.assertFalse(hasattr(a, "__weakref__"))
a.foo = 42
self.assertEqual(a.__dict__, {"foo": 42})
@@ -1155,7 +1171,7 @@ order (MRO) for bases """
class W(object):
__slots__ = ["__weakref__"]
a = W()
- self.assert_(hasattr(a, "__weakref__"))
+ self.assertTrue(hasattr(a, "__weakref__"))
self.assertFalse(hasattr(a, "__dict__"))
try:
a.foo = 42
@@ -1167,16 +1183,16 @@ order (MRO) for bases """
class C1(W, D):
__slots__ = []
a = C1()
- self.assert_(hasattr(a, "__dict__"))
- self.assert_(hasattr(a, "__weakref__"))
+ self.assertTrue(hasattr(a, "__dict__"))
+ self.assertTrue(hasattr(a, "__weakref__"))
a.foo = 42
self.assertEqual(a.__dict__, {"foo": 42})
class C2(D, W):
__slots__ = []
a = C2()
- self.assert_(hasattr(a, "__dict__"))
- self.assert_(hasattr(a, "__weakref__"))
+ self.assertTrue(hasattr(a, "__dict__"))
+ self.assertTrue(hasattr(a, "__weakref__"))
a.foo = 42
self.assertEqual(a.__dict__, {"foo": 42})
@@ -1193,7 +1209,7 @@ order (MRO) for bases """
MyABC.register(Unrelated)
u = Unrelated()
- self.assert_(isinstance(u, MyABC))
+ self.assertIsInstance(u, MyABC)
# This used to crash
self.assertRaises(TypeError, MyABC.a.__set__, u, 3)
@@ -1376,13 +1392,9 @@ order (MRO) for bases """
self.assertEqual(super(D,D).goo(), (D,))
self.assertEqual(super(D,d).goo(), (D,))
- # Verify that argument is checked for callability (SF bug 753451)
- try:
- classmethod(1).__get__(1)
- except TypeError:
- pass
- else:
- self.fail("classmethod should check for callability")
+ # Verify that a non-callable will raise
+ meth = classmethod(1).__get__(1)
+ self.assertRaises(TypeError, meth)
# Verify that classmethod() doesn't allow keyword args
try:
@@ -1392,6 +1404,7 @@ order (MRO) for bases """
else:
self.fail("classmethod shouldn't accept keyword args")
+ @test_support.impl_detail("the module 'xxsubtype' is internal")
def test_classmethods_in_c(self):
# Testing C-based class methods...
import xxsubtype as spam
@@ -1423,6 +1436,7 @@ order (MRO) for bases """
self.assertEqual(d.foo(1), (d, 1))
self.assertEqual(D.foo(d, 1), (d, 1))
+ @test_support.impl_detail("the module 'xxsubtype' is internal")
def test_staticmethods_in_c(self):
# Testing C-based static methods...
import xxsubtype as spam
@@ -1456,7 +1470,7 @@ order (MRO) for bases """
class E: # *not* subclassing from C
foo = C.foo
self.assertEqual(E().foo, C.foo) # i.e., unbound
- self.assert_(repr(C.foo.__get__(C())).startswith("<bound method "))
+ self.assertTrue(repr(C.foo.__get__(C())).startswith("<bound method "))
def test_compattr(self):
# Testing computed attributes...
@@ -1539,6 +1553,14 @@ order (MRO) for bases """
class __metaclass__(type):
def mro(self):
return [self, dict, object]
+ # In CPython, the class creation above already raises
+ # TypeError, as a protection against the fact that
+ # instances of X would segfault it. In other Python
+ # implementations it would be ok to let the class X
+ # be created, but instead get a clean TypeError on the
+ # __setitem__ below.
+ x = object.__new__(X)
+ x[5] = 6
except TypeError:
pass
else:
@@ -1639,7 +1661,112 @@ order (MRO) for bases """
class E(object):
foo = C.foo
self.assertEqual(E().foo, C.foo) # i.e., unbound
- self.assert_(repr(C.foo.__get__(C(1))).startswith("<bound method "))
+ self.assertTrue(repr(C.foo.__get__(C(1))).startswith("<bound method "))
+
+ def test_special_method_lookup(self):
+ # The lookup of special methods bypasses __getattr__ and
+ # __getattribute__, but they still can be descriptors.
+
+ def run_context(manager):
+ with manager:
+ pass
+ def iden(self):
+ return self
+ def hello(self):
+ return "hello"
+ def empty_seq(self):
+ return []
+ def zero(self):
+ return 0
+ def complex_num(self):
+ return 1j
+ def stop(self):
+ raise StopIteration
+ def return_true(self, thing=None):
+ return True
+ def do_isinstance(obj):
+ return isinstance(int, obj)
+ def do_issubclass(obj):
+ return issubclass(int, obj)
+ def swallow(*args):
+ pass
+ def do_dict_missing(checker):
+ class DictSub(checker.__class__, dict):
+ pass
+ self.assertEqual(DictSub()["hi"], 4)
+ def some_number(self_, key):
+ self.assertEqual(key, "hi")
+ return 4
+ def format_impl(self, spec):
+ return "hello"
+
+ # It would be nice to have every special method tested here, but I'm
+ # only listing the ones I can remember outside of typeobject.c, since it
+ # does it right.
+ specials = [
+ ("__unicode__", unicode, hello, set(), {}),
+ ("__reversed__", reversed, empty_seq, set(), {}),
+ ("__length_hint__", list, zero, set(),
+ {"__iter__" : iden, "next" : stop}),
+ ("__sizeof__", sys.getsizeof, zero, set(), {}),
+ ("__instancecheck__", do_isinstance, return_true, set(), {}),
+ ("__missing__", do_dict_missing, some_number,
+ set(("__class__",)), {}),
+ ("__subclasscheck__", do_issubclass, return_true,
+ set(("__bases__",)), {}),
+ ("__enter__", run_context, iden, set(), {"__exit__" : swallow}),
+ ("__exit__", run_context, swallow, set(), {"__enter__" : iden}),
+ ("__complex__", complex, complex_num, set(), {}),
+ ("__format__", format, format_impl, set(), {}),
+ ]
+
+ class Checker(object):
+ def __getattr__(self, attr, test=self):
+ test.fail("__getattr__ called with {0}".format(attr))
+ def __getattribute__(self, attr, test=self):
+ if attr not in ok:
+ test.fail("__getattribute__ called with {0}".format(attr))
+ return object.__getattribute__(self, attr)
+ class SpecialDescr(object):
+ def __init__(self, impl):
+ self.impl = impl
+ def __get__(self, obj, owner):
+ record.append(1)
+ return self.impl.__get__(obj, owner)
+ class MyException(Exception):
+ pass
+ class ErrDescr(object):
+ def __get__(self, obj, owner):
+ raise MyException
+
+ for name, runner, meth_impl, ok, env in specials:
+ class X(Checker):
+ pass
+ for attr, obj in env.iteritems():
+ setattr(X, attr, obj)
+ setattr(X, name, meth_impl)
+ runner(X())
+
+ record = []
+ class X(Checker):
+ pass
+ for attr, obj in env.iteritems():
+ setattr(X, attr, obj)
+ setattr(X, name, SpecialDescr(meth_impl))
+ runner(X())
+ self.assertEqual(record, [1], name)
+
+ class X(Checker):
+ pass
+ for attr, obj in env.iteritems():
+ setattr(X, attr, obj)
+ setattr(X, name, ErrDescr())
+ try:
+ runner(X())
+ except MyException:
+ pass
+ else:
+ self.fail("{0!r} didn't raise".format(name))
def test_specials(self):
# Testing special operators...
@@ -1652,23 +1779,23 @@ order (MRO) for bases """
raise IndexError
c1 = C()
c2 = C()
- self.assert_(not not c1) # What?
+ self.assertTrue(not not c1) # What?
self.assertNotEqual(id(c1), id(c2))
hash(c1)
hash(c2)
self.assertEqual(cmp(c1, c2), cmp(id(c1), id(c2)))
self.assertEqual(c1, c1)
- self.assert_(c1 != c2)
- self.assert_(not c1 != c1)
- self.assert_(not c1 == c2)
+ self.assertTrue(c1 != c2)
+ self.assertTrue(not c1 != c1)
+ self.assertTrue(not c1 == c2)
# Note that the module name appears in str/repr, and that varies
# depending on whether this test is run standalone or from a framework.
- self.assert_(str(c1).find('C object at ') >= 0)
+ self.assertTrue(str(c1).find('C object at ') >= 0)
self.assertEqual(str(c1), repr(c1))
- self.assert_(-1 not in c1)
+ self.assertNotIn(-1, c1)
for i in range(10):
- self.assert_(i in c1)
- self.assertFalse(10 in c1)
+ self.assertIn(i, c1)
+ self.assertNotIn(10, c1)
# Test the default behavior for dynamic classes
class D(object):
def __getitem__(self, i):
@@ -1676,23 +1803,23 @@ order (MRO) for bases """
raise IndexError
d1 = D()
d2 = D()
- self.assert_(not not d1)
+ self.assertTrue(not not d1)
self.assertNotEqual(id(d1), id(d2))
hash(d1)
hash(d2)
self.assertEqual(cmp(d1, d2), cmp(id(d1), id(d2)))
self.assertEqual(d1, d1)
self.assertNotEqual(d1, d2)
- self.assert_(not d1 != d1)
- self.assert_(not d1 == d2)
+ self.assertTrue(not d1 != d1)
+ self.assertTrue(not d1 == d2)
# Note that the module name appears in str/repr, and that varies
# depending on whether this test is run standalone or from a framework.
- self.assert_(str(d1).find('D object at ') >= 0)
+ self.assertTrue(str(d1).find('D object at ') >= 0)
self.assertEqual(str(d1), repr(d1))
- self.assert_(-1 not in d1)
+ self.assertNotIn(-1, d1)
for i in range(10):
- self.assert_(i in d1)
- self.assertFalse(10 in d1)
+ self.assertIn(i, d1)
+ self.assertNotIn(10, d1)
# Test overridden behavior for static classes
class Proxy(object):
def __init__(self, x):
@@ -1717,11 +1844,11 @@ order (MRO) for bases """
p1 = Proxy(1)
p_1 = Proxy(-1)
self.assertFalse(p0)
- self.assert_(not not p1)
+ self.assertTrue(not not p1)
self.assertEqual(hash(p0), hash(0))
self.assertEqual(p0, p0)
self.assertNotEqual(p0, p1)
- self.assert_(not p0 != p0)
+ self.assertTrue(not p0 != p0)
self.assertEqual(not p0, p1)
self.assertEqual(cmp(p0, p1), -1)
self.assertEqual(cmp(p0, p0), 0)
@@ -1729,10 +1856,10 @@ order (MRO) for bases """
self.assertEqual(str(p0), "Proxy:0")
self.assertEqual(repr(p0), "Proxy(0)")
p10 = Proxy(range(10))
- self.assertFalse(-1 in p10)
+ self.assertNotIn(-1, p10)
for i in range(10):
- self.assert_(i in p10)
- self.assertFalse(10 in p10)
+ self.assertIn(i, p10)
+ self.assertNotIn(10, p10)
# Test overridden behavior for dynamic classes
class DProxy(object):
def __init__(self, x):
@@ -1757,7 +1884,7 @@ order (MRO) for bases """
p1 = DProxy(1)
p_1 = DProxy(-1)
self.assertFalse(p0)
- self.assert_(not not p1)
+ self.assertTrue(not not p1)
self.assertEqual(hash(p0), hash(0))
self.assertEqual(p0, p0)
self.assertNotEqual(p0, p1)
@@ -1769,15 +1896,17 @@ order (MRO) for bases """
self.assertEqual(str(p0), "DProxy:0")
self.assertEqual(repr(p0), "DProxy(0)")
p10 = DProxy(range(10))
- self.assertFalse(-1 in p10)
+ self.assertNotIn(-1, p10)
for i in range(10):
- self.assert_(i in p10)
- self.assertFalse(10 in p10)
+ self.assertIn(i, p10)
+ self.assertNotIn(10, p10)
# Safety test for __cmp__
def unsafecmp(a, b):
- if not hasattr(a.__class__, "__cmp__"):
- return
+ if not hasattr(a, '__cmp__'):
+ return # some types don't have a __cmp__ any more (so the
+ # test doesn't make sense any more), or maybe they
+ # never had a __cmp__ at all, e.g. in PyPy
try:
a.__class__.__cmp__(a, b)
except TypeError:
@@ -1793,7 +1922,8 @@ order (MRO) for bases """
unsafecmp(1, 1L)
unsafecmp(1L, 1)
- def test_recursions(self):
+ @test_support.impl_detail("custom logic for printing to real file objects")
+ def test_recursions_1(self):
# Testing recursion checks ...
class Letter(str):
def __new__(cls, letter):
@@ -1805,7 +1935,6 @@ order (MRO) for bases """
return 'EPS'
return self
# sys.stdout needs to be the original to trigger the recursion bug
- import sys
test_stdout = sys.stdout
sys.stdout = test_support.get_original_stdout()
try:
@@ -1818,6 +1947,7 @@ order (MRO) for bases """
finally:
sys.stdout = test_stdout
+ def test_recursions_2(self):
# Bug #1202533.
class A(object):
pass
@@ -1838,6 +1968,7 @@ order (MRO) for bases """
r = weakref.ref(c)
self.assertEqual(r(), c)
del c
+ test_support.gc_collect()
self.assertEqual(r(), None)
del r
class NoWeak(object):
@@ -1846,7 +1977,7 @@ order (MRO) for bases """
try:
weakref.ref(no)
except TypeError, msg:
- self.assert_(str(msg).find("weak reference") >= 0)
+ self.assertTrue(str(msg).find("weak reference") >= 0)
else:
self.fail("weakref.ref(no) should be illegal")
class Weak(object):
@@ -1855,6 +1986,7 @@ order (MRO) for bases """
r = weakref.ref(yes)
self.assertEqual(r(), yes)
del yes
+ test_support.gc_collect()
self.assertEqual(r(), None)
del r
@@ -1882,18 +2014,18 @@ order (MRO) for bases """
self.assertFalse(hasattr(a, "x"))
raw = C.__dict__['x']
- self.assert_(isinstance(raw, property))
+ self.assertIsInstance(raw, property)
attrs = dir(raw)
- self.assert_("__doc__" in attrs)
- self.assert_("fget" in attrs)
- self.assert_("fset" in attrs)
- self.assert_("fdel" in attrs)
+ self.assertIn("__doc__", attrs)
+ self.assertIn("fget", attrs)
+ self.assertIn("fset", attrs)
+ self.assertIn("fdel", attrs)
self.assertEqual(raw.__doc__, "I'm the x property.")
- self.assert_(raw.fget is C.__dict__['getx'])
- self.assert_(raw.fset is C.__dict__['setx'])
- self.assert_(raw.fdel is C.__dict__['delx'])
+ self.assertTrue(raw.fget is C.__dict__['getx'])
+ self.assertTrue(raw.fset is C.__dict__['setx'])
+ self.assertTrue(raw.fdel is C.__dict__['delx'])
for attr in "__doc__", "fget", "fset", "fdel":
try:
@@ -1918,6 +2050,9 @@ order (MRO) for bases """
else:
self.fail("expected ZeroDivisionError from bad property")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_properties_doc_attrib(self):
class E(object):
def getter(self):
"getter method"
@@ -1930,6 +2065,7 @@ order (MRO) for bases """
prop2 = property(fset=setter)
self.assertEqual(prop2.__doc__, None)
+ def test_testcapi_no_segfault(self):
# this segfaulted in 2.5b2
try:
import _testcapi
@@ -1955,7 +2091,7 @@ order (MRO) for bases """
self.assertEqual(C.foo.__doc__, "hello")
self.assertFalse(hasattr(c, "foo"))
c.foo = -42
- self.assert_(hasattr(c, '_foo'))
+ self.assertTrue(hasattr(c, '_foo'))
self.assertEqual(c._foo, 42)
self.assertEqual(c.foo, 42)
del c.foo
@@ -2106,7 +2242,7 @@ order (MRO) for bases """
cstuff = ['Cdata', 'Cmethod', '__doc__', '__module__']
self.assertEqual(dir(C), cstuff)
- self.assert_('im_self' in dir(C.Cmethod))
+ self.assertIn('im_self', dir(C.Cmethod))
c = C() # c.__doc__ is an odd thing to see here; ditto c.__module__.
self.assertEqual(dir(c), cstuff)
@@ -2114,7 +2250,7 @@ order (MRO) for bases """
c.cdata = 2
c.cmethod = lambda self: 0
self.assertEqual(dir(c), cstuff + ['cdata', 'cmethod'])
- self.assert_('im_self' in dir(c.Cmethod))
+ self.assertIn('im_self', dir(c.Cmethod))
class A(C):
Adata = 1
@@ -2122,10 +2258,10 @@ order (MRO) for bases """
astuff = ['Adata', 'Amethod'] + cstuff
self.assertEqual(dir(A), astuff)
- self.assert_('im_self' in dir(A.Amethod))
+ self.assertIn('im_self', dir(A.Amethod))
a = A()
self.assertEqual(dir(a), astuff)
- self.assert_('im_self' in dir(a.Amethod))
+ self.assertIn('im_self', dir(a.Amethod))
a.adata = 42
a.amethod = lambda self: 3
self.assertEqual(dir(a), astuff + ['adata', 'amethod'])
@@ -2144,12 +2280,12 @@ order (MRO) for bases """
c = C()
self.assertEqual(interesting(dir(c)), cstuff)
- self.assert_('im_self' in dir(C.Cmethod))
+ self.assertIn('im_self', dir(C.Cmethod))
c.cdata = 2
c.cmethod = lambda self: 0
self.assertEqual(interesting(dir(c)), cstuff + ['cdata', 'cmethod'])
- self.assert_('im_self' in dir(c.Cmethod))
+ self.assertIn('im_self', dir(c.Cmethod))
class A(C):
Adata = 1
@@ -2157,16 +2293,15 @@ order (MRO) for bases """
astuff = ['Adata', 'Amethod'] + cstuff
self.assertEqual(interesting(dir(A)), astuff)
- self.assert_('im_self' in dir(A.Amethod))
+ self.assertIn('im_self', dir(A.Amethod))
a = A()
self.assertEqual(interesting(dir(a)), astuff)
a.adata = 42
a.amethod = lambda self: 3
self.assertEqual(interesting(dir(a)), astuff + ['adata', 'amethod'])
- self.assert_('im_self' in dir(a.Amethod))
+ self.assertIn('im_self', dir(a.Amethod))
# Try a module subclass.
- import sys
class M(type(sys)):
pass
minstance = M("m")
@@ -2191,7 +2326,10 @@ order (MRO) for bases """
# Two essentially featureless objects, just inheriting stuff from
# object.
- self.assertEqual(dir(None), dir(Ellipsis))
+ self.assertEqual(dir(NotImplemented), dir(Ellipsis))
+ if test_support.check_impl_detail():
+ # None differs in PyPy: it has a __nonzero__
+ self.assertEqual(dir(None), dir(Ellipsis))
# Nasty test case for proxied objects
class Wrapper(object):
@@ -2344,13 +2482,13 @@ order (MRO) for bases """
a = hexint(12345)
self.assertEqual(a, 12345)
self.assertEqual(int(a), 12345)
- self.assert_(int(a).__class__ is int)
+ self.assertTrue(int(a).__class__ is int)
self.assertEqual(hash(a), hash(12345))
- self.assert_((+a).__class__ is int)
- self.assert_((a >> 0).__class__ is int)
- self.assert_((a << 0).__class__ is int)
- self.assert_((hexint(0) << 12).__class__ is int)
- self.assert_((hexint(0) >> 12).__class__ is int)
+ self.assertTrue((+a).__class__ is int)
+ self.assertTrue((a >> 0).__class__ is int)
+ self.assertTrue((a << 0).__class__ is int)
+ self.assertTrue((hexint(0) << 12).__class__ is int)
+ self.assertTrue((hexint(0) >> 12).__class__ is int)
class octlong(long):
__slots__ = []
@@ -2370,36 +2508,36 @@ order (MRO) for bases """
self.assertEqual(a, 12345L)
self.assertEqual(long(a), 12345L)
self.assertEqual(hash(a), hash(12345L))
- self.assert_(long(a).__class__ is long)
- self.assert_((+a).__class__ is long)
- self.assert_((-a).__class__ is long)
- self.assert_((-octlong(0)).__class__ is long)
- self.assert_((a >> 0).__class__ is long)
- self.assert_((a << 0).__class__ is long)
- self.assert_((a - 0).__class__ is long)
- self.assert_((a * 1).__class__ is long)
- self.assert_((a ** 1).__class__ is long)
- self.assert_((a // 1).__class__ is long)
- self.assert_((1 * a).__class__ is long)
- self.assert_((a | 0).__class__ is long)
- self.assert_((a ^ 0).__class__ is long)
- self.assert_((a & -1L).__class__ is long)
- self.assert_((octlong(0) << 12).__class__ is long)
- self.assert_((octlong(0) >> 12).__class__ is long)
- self.assert_(abs(octlong(0)).__class__ is long)
+ self.assertTrue(long(a).__class__ is long)
+ self.assertTrue((+a).__class__ is long)
+ self.assertTrue((-a).__class__ is long)
+ self.assertTrue((-octlong(0)).__class__ is long)
+ self.assertTrue((a >> 0).__class__ is long)
+ self.assertTrue((a << 0).__class__ is long)
+ self.assertTrue((a - 0).__class__ is long)
+ self.assertTrue((a * 1).__class__ is long)
+ self.assertTrue((a ** 1).__class__ is long)
+ self.assertTrue((a // 1).__class__ is long)
+ self.assertTrue((1 * a).__class__ is long)
+ self.assertTrue((a | 0).__class__ is long)
+ self.assertTrue((a ^ 0).__class__ is long)
+ self.assertTrue((a & -1L).__class__ is long)
+ self.assertTrue((octlong(0) << 12).__class__ is long)
+ self.assertTrue((octlong(0) >> 12).__class__ is long)
+ self.assertTrue(abs(octlong(0)).__class__ is long)
# Because octlong overrides __add__, we can't check the absence of +0
# optimizations using octlong.
class longclone(long):
pass
a = longclone(1)
- self.assert_((a + 0).__class__ is long)
- self.assert_((0 + a).__class__ is long)
+ self.assertTrue((a + 0).__class__ is long)
+ self.assertTrue((0 + a).__class__ is long)
# Check that negative clones don't segfault
a = longclone(-1)
self.assertEqual(a.__dict__, {})
- self.assertEqual(long(a), -1) # self.assert_ PyNumber_Long() copies the sign bit
+ self.assertEqual(long(a), -1) # self.assertTrue PyNumber_Long() copies the sign bit
class precfloat(float):
__slots__ = ['prec']
@@ -2411,9 +2549,9 @@ order (MRO) for bases """
a = precfloat(12345)
self.assertEqual(a, 12345.0)
self.assertEqual(float(a), 12345.0)
- self.assert_(float(a).__class__ is float)
+ self.assertTrue(float(a).__class__ is float)
self.assertEqual(hash(a), hash(12345.0))
- self.assert_((+a).__class__ is float)
+ self.assertTrue((+a).__class__ is float)
class madcomplex(complex):
def __repr__(self):
@@ -2461,20 +2599,20 @@ order (MRO) for bases """
self.assertEqual(v, t)
a = madtuple((1,2,3,4,5))
self.assertEqual(tuple(a), (1,2,3,4,5))
- self.assert_(tuple(a).__class__ is tuple)
+ self.assertTrue(tuple(a).__class__ is tuple)
self.assertEqual(hash(a), hash((1,2,3,4,5)))
- self.assert_(a[:].__class__ is tuple)
- self.assert_((a * 1).__class__ is tuple)
- self.assert_((a * 0).__class__ is tuple)
- self.assert_((a + ()).__class__ is tuple)
+ self.assertTrue(a[:].__class__ is tuple)
+ self.assertTrue((a * 1).__class__ is tuple)
+ self.assertTrue((a * 0).__class__ is tuple)
+ self.assertTrue((a + ()).__class__ is tuple)
a = madtuple(())
self.assertEqual(tuple(a), ())
- self.assert_(tuple(a).__class__ is tuple)
- self.assert_((a + a).__class__ is tuple)
- self.assert_((a * 0).__class__ is tuple)
- self.assert_((a * 1).__class__ is tuple)
- self.assert_((a * 2).__class__ is tuple)
- self.assert_(a[:].__class__ is tuple)
+ self.assertTrue(tuple(a).__class__ is tuple)
+ self.assertTrue((a + a).__class__ is tuple)
+ self.assertTrue((a * 0).__class__ is tuple)
+ self.assertTrue((a * 1).__class__ is tuple)
+ self.assertTrue((a * 2).__class__ is tuple)
+ self.assertTrue(a[:].__class__ is tuple)
class madstring(str):
_rev = None
@@ -2496,51 +2634,51 @@ order (MRO) for bases """
self.assertEqual(u, s)
s = madstring("12345")
self.assertEqual(str(s), "12345")
- self.assert_(str(s).__class__ is str)
+ self.assertTrue(str(s).__class__ is str)
base = "\x00" * 5
s = madstring(base)
self.assertEqual(s, base)
self.assertEqual(str(s), base)
- self.assert_(str(s).__class__ is str)
+ self.assertTrue(str(s).__class__ is str)
self.assertEqual(hash(s), hash(base))
self.assertEqual({s: 1}[base], 1)
self.assertEqual({base: 1}[s], 1)
- self.assert_((s + "").__class__ is str)
+ self.assertTrue((s + "").__class__ is str)
self.assertEqual(s + "", base)
- self.assert_(("" + s).__class__ is str)
+ self.assertTrue(("" + s).__class__ is str)
self.assertEqual("" + s, base)
- self.assert_((s * 0).__class__ is str)
+ self.assertTrue((s * 0).__class__ is str)
self.assertEqual(s * 0, "")
- self.assert_((s * 1).__class__ is str)
+ self.assertTrue((s * 1).__class__ is str)
self.assertEqual(s * 1, base)
- self.assert_((s * 2).__class__ is str)
+ self.assertTrue((s * 2).__class__ is str)
self.assertEqual(s * 2, base + base)
- self.assert_(s[:].__class__ is str)
+ self.assertTrue(s[:].__class__ is str)
self.assertEqual(s[:], base)
- self.assert_(s[0:0].__class__ is str)
+ self.assertTrue(s[0:0].__class__ is str)
self.assertEqual(s[0:0], "")
- self.assert_(s.strip().__class__ is str)
+ self.assertTrue(s.strip().__class__ is str)
self.assertEqual(s.strip(), base)
- self.assert_(s.lstrip().__class__ is str)
+ self.assertTrue(s.lstrip().__class__ is str)
self.assertEqual(s.lstrip(), base)
- self.assert_(s.rstrip().__class__ is str)
+ self.assertTrue(s.rstrip().__class__ is str)
self.assertEqual(s.rstrip(), base)
identitytab = ''.join([chr(i) for i in range(256)])
- self.assert_(s.translate(identitytab).__class__ is str)
+ self.assertTrue(s.translate(identitytab).__class__ is str)
self.assertEqual(s.translate(identitytab), base)
- self.assert_(s.translate(identitytab, "x").__class__ is str)
+ self.assertTrue(s.translate(identitytab, "x").__class__ is str)
self.assertEqual(s.translate(identitytab, "x"), base)
self.assertEqual(s.translate(identitytab, "\x00"), "")
- self.assert_(s.replace("x", "x").__class__ is str)
+ self.assertTrue(s.replace("x", "x").__class__ is str)
self.assertEqual(s.replace("x", "x"), base)
- self.assert_(s.ljust(len(s)).__class__ is str)
+ self.assertTrue(s.ljust(len(s)).__class__ is str)
self.assertEqual(s.ljust(len(s)), base)
- self.assert_(s.rjust(len(s)).__class__ is str)
+ self.assertTrue(s.rjust(len(s)).__class__ is str)
self.assertEqual(s.rjust(len(s)), base)
- self.assert_(s.center(len(s)).__class__ is str)
+ self.assertTrue(s.center(len(s)).__class__ is str)
self.assertEqual(s.center(len(s)), base)
- self.assert_(s.lower().__class__ is str)
+ self.assertTrue(s.lower().__class__ is str)
self.assertEqual(s.lower(), base)
class madunicode(unicode):
@@ -2559,47 +2697,47 @@ order (MRO) for bases """
base = u"12345"
u = madunicode(base)
self.assertEqual(unicode(u), base)
- self.assert_(unicode(u).__class__ is unicode)
+ self.assertTrue(unicode(u).__class__ is unicode)
self.assertEqual(hash(u), hash(base))
self.assertEqual({u: 1}[base], 1)
self.assertEqual({base: 1}[u], 1)
- self.assert_(u.strip().__class__ is unicode)
+ self.assertTrue(u.strip().__class__ is unicode)
self.assertEqual(u.strip(), base)
- self.assert_(u.lstrip().__class__ is unicode)
+ self.assertTrue(u.lstrip().__class__ is unicode)
self.assertEqual(u.lstrip(), base)
- self.assert_(u.rstrip().__class__ is unicode)
+ self.assertTrue(u.rstrip().__class__ is unicode)
self.assertEqual(u.rstrip(), base)
- self.assert_(u.replace(u"x", u"x").__class__ is unicode)
+ self.assertTrue(u.replace(u"x", u"x").__class__ is unicode)
self.assertEqual(u.replace(u"x", u"x"), base)
- self.assert_(u.replace(u"xy", u"xy").__class__ is unicode)
+ self.assertTrue(u.replace(u"xy", u"xy").__class__ is unicode)
self.assertEqual(u.replace(u"xy", u"xy"), base)
- self.assert_(u.center(len(u)).__class__ is unicode)
+ self.assertTrue(u.center(len(u)).__class__ is unicode)
self.assertEqual(u.center(len(u)), base)
- self.assert_(u.ljust(len(u)).__class__ is unicode)
+ self.assertTrue(u.ljust(len(u)).__class__ is unicode)
self.assertEqual(u.ljust(len(u)), base)
- self.assert_(u.rjust(len(u)).__class__ is unicode)
+ self.assertTrue(u.rjust(len(u)).__class__ is unicode)
self.assertEqual(u.rjust(len(u)), base)
- self.assert_(u.lower().__class__ is unicode)
+ self.assertTrue(u.lower().__class__ is unicode)
self.assertEqual(u.lower(), base)
- self.assert_(u.upper().__class__ is unicode)
+ self.assertTrue(u.upper().__class__ is unicode)
self.assertEqual(u.upper(), base)
- self.assert_(u.capitalize().__class__ is unicode)
+ self.assertTrue(u.capitalize().__class__ is unicode)
self.assertEqual(u.capitalize(), base)
- self.assert_(u.title().__class__ is unicode)
+ self.assertTrue(u.title().__class__ is unicode)
self.assertEqual(u.title(), base)
- self.assert_((u + u"").__class__ is unicode)
+ self.assertTrue((u + u"").__class__ is unicode)
self.assertEqual(u + u"", base)
- self.assert_((u"" + u).__class__ is unicode)
+ self.assertTrue((u"" + u).__class__ is unicode)
self.assertEqual(u"" + u, base)
- self.assert_((u * 0).__class__ is unicode)
+ self.assertTrue((u * 0).__class__ is unicode)
self.assertEqual(u * 0, u"")
- self.assert_((u * 1).__class__ is unicode)
+ self.assertTrue((u * 1).__class__ is unicode)
self.assertEqual(u * 1, base)
- self.assert_((u * 2).__class__ is unicode)
+ self.assertTrue((u * 2).__class__ is unicode)
self.assertEqual(u * 2, base + base)
- self.assert_(u[:].__class__ is unicode)
+ self.assertTrue(u[:].__class__ is unicode)
self.assertEqual(u[:], base)
- self.assert_(u[0:0].__class__ is unicode)
+ self.assertTrue(u[0:0].__class__ is unicode)
self.assertEqual(u[0:0], u"")
class sublist(list):
@@ -2718,7 +2856,7 @@ order (MRO) for bases """
self.assertEqual(d[cistr('one')], 1)
self.assertEqual(d[cistr('tWo')], 2)
self.assertEqual(d[cistr('THrEE')], 3)
- self.assert_(cistr('ONe') in d)
+ self.assertIn(cistr('ONe'), d)
self.assertEqual(d.get(cistr('thrEE')), 3)
def test_classic_comparisons(self):
@@ -2745,12 +2883,12 @@ order (MRO) for bases """
c = {1: c1, 2: c2, 3: c3}
for x in 1, 2, 3:
for y in 1, 2, 3:
- self.assert_(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y))
+ self.assertTrue(cmp(c[x], c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y))
for op in "<", "<=", "==", "!=", ">", ">=":
- self.assert_(eval("c[x] %s c[y]" % op) == eval("x %s y" % op),
+ self.assertTrue(eval("c[x] %s c[y]" % op) == eval("x %s y" % op),
"x=%d, y=%d" % (x, y))
- self.assert_(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y))
- self.assert_(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y))
+ self.assertTrue(cmp(c[x], y) == cmp(x, y), "x=%d, y=%d" % (x, y))
+ self.assertTrue(cmp(x, c[y]) == cmp(x, y), "x=%d, y=%d" % (x, y))
def test_rich_comparisons(self):
# Testing rich comparisons...
@@ -2823,11 +2961,11 @@ order (MRO) for bases """
for x in 1, 2, 3:
for y in 1, 2, 3:
for op in "<", "<=", "==", "!=", ">", ">=":
- self.assert_(eval("c[x] %s c[y]" % op) == eval("x %s y" % op),
+ self.assertTrue(eval("c[x] %s c[y]" % op) == eval("x %s y" % op),
"x=%d, y=%d" % (x, y))
- self.assert_(eval("c[x] %s y" % op) == eval("x %s y" % op),
+ self.assertTrue(eval("c[x] %s y" % op) == eval("x %s y" % op),
"x=%d, y=%d" % (x, y))
- self.assert_(eval("x %s c[y]" % op) == eval("x %s y" % op),
+ self.assertTrue(eval("x %s c[y]" % op) == eval("x %s y" % op),
"x=%d, y=%d" % (x, y))
def test_coercions(self):
@@ -2893,9 +3031,9 @@ order (MRO) for bases """
for cls2 in C, D, E, F:
x = cls()
x.__class__ = cls2
- self.assert_(x.__class__ is cls2)
+ self.assertTrue(x.__class__ is cls2)
x.__class__ = cls
- self.assert_(x.__class__ is cls)
+ self.assertTrue(x.__class__ is cls)
def cant(x, C):
try:
x.__class__ = C
@@ -2905,7 +3043,7 @@ order (MRO) for bases """
self.fail("shouldn't allow %r.__class__ = %r" % (x, C))
try:
delattr(x, "__class__")
- except TypeError:
+ except (TypeError, AttributeError):
pass
else:
self.fail("shouldn't allow del %r.__class__" % x)
@@ -2957,11 +3095,11 @@ order (MRO) for bases """
x = cls()
x.a = 1
x.__class__ = cls2
- self.assert_(x.__class__ is cls2,
+ self.assertTrue(x.__class__ is cls2,
"assigning %r as __class__ for %r silently failed" % (cls2, x))
self.assertEqual(x.a, 1)
x.__class__ = cls
- self.assert_(x.__class__ is cls,
+ self.assertTrue(x.__class__ is cls,
"assigning %r as __class__ for %r silently failed" % (cls, x))
self.assertEqual(x.a, 1)
for cls in G, J, K, L, M, N, P, R, list, Int:
@@ -3049,6 +3187,16 @@ order (MRO) for bases """
mod.__dict__["spam"] = "eggs"
# Exception's __dict__ can be replaced, but not deleted
+ # (at least not any more than regular exception's __dict__ can
+ # be deleted; on CPython it is not the case, whereas on PyPy they
+ # can, just like any other new-style instance's __dict__.)
+ def can_delete_dict(e):
+ try:
+ del e.__dict__
+ except (TypeError, AttributeError):
+ return False
+ else:
+ return True
class Exception1(Exception, Base):
pass
class Exception2(Base, Exception):
@@ -3057,12 +3205,7 @@ order (MRO) for bases """
e = ExceptionType()
e.__dict__ = {"a": 1}
self.assertEqual(e.a, 1)
- try:
- del e.__dict__
- except (TypeError, AttributeError):
- pass
- else:
- self.fail("%r's __dict__ can be deleted" % e)
+ self.assertEqual(can_delete_dict(e), can_delete_dict(ValueError()))
def test_pickles(self):
# Testing pickling and copying new-style classes and objects...
@@ -3126,7 +3269,7 @@ order (MRO) for bases """
for cls in C, C1, C2:
s = p.dumps(cls, bin)
cls2 = p.loads(s)
- self.assert_(cls2 is cls)
+ self.assertTrue(cls2 is cls)
a = C1(1, 2); a.append(42); a.append(24)
b = C2("hello", "world", 42)
@@ -3156,7 +3299,7 @@ order (MRO) for bases """
import copy
for cls in C, C1, C2:
cls2 = copy.deepcopy(cls)
- self.assert_(cls2 is cls)
+ self.assertTrue(cls2 is cls)
a = C1(1, 2); a.append(42); a.append(24)
b = C2("hello", "world", 42)
@@ -3355,13 +3498,12 @@ order (MRO) for bases """
self.fail("d.foo should be undefined now")
# Test a nasty bug in recurse_down_subclasses()
- import gc
class A(object):
pass
class B(A):
pass
del B
- gc.collect()
+ test_support.gc_collect()
A.__setitem__ = lambda *a: None # crash
def test_buffer_inheritance(self):
@@ -3453,6 +3595,7 @@ order (MRO) for bases """
c = C()
self.assertEqual(log, [])
del c
+ test_support.gc_collect()
self.assertEqual(log, [1])
class D(object): pass
@@ -3548,7 +3691,7 @@ order (MRO) for bases """
self.assertEqual(hasattr(m, "__name__"), 0)
self.assertEqual(hasattr(m, "__file__"), 0)
self.assertEqual(hasattr(m, "foo"), 0)
- self.assertEqual(m.__dict__, None)
+ self.assertFalse(m.__dict__) # None or {} are both reasonable answers
m.foo = 1
self.assertEqual(m.__dict__, {"foo": 1})
@@ -3683,17 +3826,23 @@ order (MRO) for bases """
c = C()
c.attr = 42
- # The most interesting thing here is whether this blows up, due to flawed
- # GC tracking logic in typeobject.c's call_finalizer() (a 2.2.1 bug).
+ # The most interesting thing here is whether this blows up, due to
+ # flawed GC tracking logic in typeobject.c's call_finalizer() (a 2.2.1
+ # bug).
del c
# If that didn't blow up, it's also interesting to see whether clearing
- # the last container slot works: that will attempt to delete c again,
- # which will cause c to get appended back to the container again "during"
- # the del.
- del C.container[-1]
+ # the last container slot works: that will attempt to delete c again,
+ # which will cause c to get appended back to the container again
+ # "during" the del. (On non-CPython implementations, however, __del__
+ # is typically not called again.)
+ test_support.gc_collect()
self.assertEqual(len(C.container), 1)
- self.assertEqual(C.container[-1].attr, 42)
+ del C.container[-1]
+ if test_support.check_impl_detail():
+ test_support.gc_collect()
+ self.assertEqual(len(C.container), 1)
+ self.assertEqual(C.container[-1].attr, 42)
# Make c mortal again, so that the test framework with -l doesn't report
# it as a leak.
@@ -3719,9 +3868,10 @@ order (MRO) for bases """
pass
class C(A,B) :
__slots__=()
- self.assertEqual(C.__basicsize__, B.__basicsize__)
- self.assert_(hasattr(C, '__dict__'))
- self.assert_(hasattr(C, '__weakref__'))
+ if test_support.check_impl_detail():
+ self.assertEqual(C.__basicsize__, B.__basicsize__)
+ self.assertTrue(hasattr(C, '__dict__'))
+ self.assertTrue(hasattr(C, '__weakref__'))
C().x = 2
def test_rmul(self):
@@ -3775,34 +3925,9 @@ order (MRO) for bases """
self.assertEqual(e.a, 2)
self.assertEqual(C2.__subclasses__(), [D])
- # stuff that shouldn't:
- class L(list):
- pass
-
- try:
- L.__bases__ = (dict,)
- except TypeError:
- pass
- else:
- self.fail("shouldn't turn list subclass into dict subclass")
-
- try:
- list.__bases__ = (dict,)
- except TypeError:
- pass
- else:
- self.fail("shouldn't be able to assign to list.__bases__")
-
- try:
- D.__bases__ = (C2, list)
- except TypeError:
- pass
- else:
- assert 0, "best_base calculation found wanting"
-
try:
del D.__bases__
- except TypeError:
+ except (TypeError, AttributeError):
pass
else:
self.fail("shouldn't be able to delete .__bases__")
@@ -3870,6 +3995,36 @@ order (MRO) for bases """
if tp is not object:
self.assertEqual(len(tp.__bases__), 1, tp)
+ class L(list):
+ pass
+
+ class C(object):
+ pass
+
+ class D(C):
+ pass
+
+ try:
+ L.__bases__ = (dict,)
+ except TypeError:
+ pass
+ else:
+ self.fail("shouldn't turn list subclass into dict subclass")
+
+ try:
+ list.__bases__ = (dict,)
+ except TypeError:
+ pass
+ else:
+ self.fail("shouldn't be able to assign to list.__bases__")
+
+ try:
+ D.__bases__ = (C, list)
+ except TypeError:
+ pass
+ else:
+ assert 0, "best_base calculation found wanting"
+
def test_mutable_bases_with_failing_mro(self):
# Testing mutable bases with failing mro...
@@ -4014,6 +4169,7 @@ order (MRO) for bases """
self.assertEqual(E() // C(), "C.__floordiv__")
self.assertEqual(C() // E(), "C.__floordiv__") # This one would fail
+ @test_support.impl_detail("testing an internal kind of method object")
def test_meth_class_get(self):
# Testing __get__ method of METH_CLASS C methods...
# Full coverage of descrobject.c::classmethod_get()
@@ -4072,29 +4228,29 @@ order (MRO) for bases """
pass
a = C()
pa = Proxy(a)
- self.assert_(isinstance(a, C)) # Baseline
- self.assert_(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
# Test with a classic subclass
class D(C):
pass
a = D()
pa = Proxy(a)
- self.assert_(isinstance(a, C)) # Baseline
- self.assert_(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
# Test with a new-style class
class C(object):
pass
a = C()
pa = Proxy(a)
- self.assert_(isinstance(a, C)) # Baseline
- self.assert_(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
# Test with a new-style subclass
class D(C):
pass
a = D()
pa = Proxy(a)
- self.assert_(isinstance(a, C)) # Baseline
- self.assert_(isinstance(pa, C)) # Test
+ self.assertIsInstance(a, C) # Baseline
+ self.assertIsInstance(pa, C) # Test
def test_proxy_super(self):
# Testing super() for a proxy object...
@@ -4126,7 +4282,7 @@ order (MRO) for bases """
except TypeError:
pass
else:
- self.fail("Carlo Verre __setattr__ suceeded!")
+ self.fail("Carlo Verre __setattr__ succeeded!")
try:
object.__delattr__(str, "lower")
except TypeError:
@@ -4162,7 +4318,7 @@ order (MRO) for bases """
def test_file_fault(self):
# Testing sys.stdout is changed in getattr...
- import sys
+ test_stdout = sys.stdout
class StdoutGuard:
def __getattr__(self, attr):
sys.stdout = sys.__stdout__
@@ -4172,6 +4328,8 @@ order (MRO) for bases """
print "Oops!"
except RuntimeError:
pass
+ finally:
+ sys.stdout = test_stdout
def test_vicious_descriptor_nonsense(self):
# Testing vicious_descriptor_nonsense...
@@ -4199,7 +4357,7 @@ order (MRO) for bases """
self.assertEqual(c.attr, 1)
# this makes a crash more likely:
- import gc; gc.collect()
+ test_support.gc_collect()
self.assertEqual(hasattr(c, 'attr'), False)
def test_init(self):
@@ -4221,11 +4379,17 @@ order (MRO) for bases """
l = []
self.assertEqual(l.__add__, l.__add__)
self.assertEqual(l.__add__, [].__add__)
- self.assert_(l.__add__ != [5].__add__)
- self.assert_(l.__add__ != l.__mul__)
- self.assert_(l.__add__.__name__ == '__add__')
- self.assert_(l.__add__.__self__ is l)
- self.assert_(l.__add__.__objclass__ is list)
+ self.assertTrue(l.__add__ != [5].__add__)
+ self.assertTrue(l.__add__ != l.__mul__)
+ self.assertTrue(l.__add__.__name__ == '__add__')
+ if hasattr(l.__add__, '__self__'):
+ # CPython
+ self.assertTrue(l.__add__.__self__ is l)
+ self.assertTrue(l.__add__.__objclass__ is list)
+ else:
+ # Python implementations where [].__add__ is a normal bound method
+ self.assertTrue(l.__add__.im_self is l)
+ self.assertTrue(l.__add__.im_class is list)
self.assertEqual(l.__add__.__doc__, list.__add__.__doc__)
try:
hash(l.__add__)
@@ -4242,8 +4406,6 @@ order (MRO) for bases """
def test_not_implemented(self):
# Testing NotImplemented...
# all binary methods should be able to return a NotImplemented
- import sys
- import types
import operator
def specialmethod(self, other):
@@ -4322,6 +4484,35 @@ order (MRO) for bases """
c[1:2] = 3
self.assertEqual(c.value, 3)
+ def test_set_and_no_get(self):
+ # See
+ # http://mail.python.org/pipermail/python-dev/2010-January/095637.html
+ class Descr(object):
+
+ def __init__(self, name):
+ self.name = name
+
+ def __set__(self, obj, value):
+ obj.__dict__[self.name] = value
+ descr = Descr("a")
+
+ class X(object):
+ a = descr
+
+ x = X()
+ self.assertIs(x.a, descr)
+ x.a = 42
+ self.assertEqual(x.a, 42)
+
+ # Also check type_getattro for correctness.
+ class Meta(type):
+ pass
+ class X(object):
+ __metaclass__ = Meta
+ X.a = 42
+ Meta.a = Descr("a")
+ self.assertEqual(X.a, 42)
+
def test_getattr_hooks(self):
# issue 4230
@@ -4343,11 +4534,11 @@ order (MRO) for bases """
__getattr__ = descr
self.assertRaises(AttributeError, getattr, A(), "attr")
- self.assertEquals(descr.counter, 1)
+ self.assertEqual(descr.counter, 1)
self.assertRaises(AttributeError, getattr, B(), "attr")
- self.assertEquals(descr.counter, 2)
+ self.assertEqual(descr.counter, 2)
self.assertRaises(AttributeError, getattr, C(), "attr")
- self.assertEquals(descr.counter, 4)
+ self.assertEqual(descr.counter, 4)
import gc
class EvilGetattribute(object):
@@ -4362,6 +4553,33 @@ order (MRO) for bases """
self.assertRaises(AttributeError, getattr, EvilGetattribute(), "attr")
+ def test_abstractmethods(self):
+ # type pretends not to have __abstractmethods__.
+ self.assertRaises(AttributeError, getattr, type, "__abstractmethods__")
+ class meta(type):
+ pass
+ self.assertRaises(AttributeError, getattr, meta, "__abstractmethods__")
+ class X(object):
+ pass
+ with self.assertRaises(AttributeError):
+ del X.__abstractmethods__
+
+ def test_proxy_call(self):
+ class FakeStr(object):
+ __class__ = str
+
+ fake_str = FakeStr()
+ # isinstance() reads __class__ on new style classes
+ self.assertTrue(isinstance(fake_str, str))
+
+ # call a method descriptor
+ with self.assertRaises(TypeError):
+ str.split(fake_str)
+
+ # call a slot wrapper descriptor
+ with self.assertRaises(TypeError):
+ str.__add__(fake_str, "abc")
+
class DictProxyTests(unittest.TestCase):
def setUp(self):
@@ -4374,7 +4592,7 @@ class DictProxyTests(unittest.TestCase):
# Testing dict-proxy iterkeys...
keys = [ key for key in self.C.__dict__.iterkeys() ]
keys.sort()
- self.assertEquals(keys, ['__dict__', '__doc__', '__module__',
+ self.assertEqual(keys, ['__dict__', '__doc__', '__module__',
'__weakref__', 'meth'])
def test_iter_values(self):
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index 3434764c34..29167d0e38 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -9,32 +9,32 @@ class DictTest(unittest.TestCase):
def test_constructor(self):
# calling built-in types without argument must return empty
self.assertEqual(dict(), {})
- self.assert_(dict() is not {})
+ self.assertIsNot(dict(), {})
def test_literal_constructor(self):
- # check literal constructor for different sized dicts (to exercise the BUILD_MAP oparg
+ # check literal constructor for different sized dicts
+ # (to exercise the BUILD_MAP oparg).
for n in (0, 1, 6, 256, 400):
- items = [(''.join([random.choice(string.letters)
- for j in range(8)]),
- i)
+ items = [(''.join(random.sample(string.letters, 8)), i)
for i in range(n)]
random.shuffle(items)
- dictliteral = '{' + ', '.join('%r: %d' % item for item in items) + '}'
+ formatted_items = ('{!r}: {:d}'.format(k, v) for k, v in items)
+ dictliteral = '{' + ', '.join(formatted_items) + '}'
self.assertEqual(eval(dictliteral), dict(items))
def test_bool(self):
- self.assert_(not {})
- self.assert_({1: 2})
- self.assert_(bool({}) is False)
- self.assert_(bool({1: 2}) is True)
+ self.assertIs(not {}, True)
+ self.assertTrue({1: 2})
+ self.assertIs(bool({}), False)
+ self.assertIs(bool({1: 2}), True)
def test_keys(self):
d = {}
self.assertEqual(d.keys(), [])
d = {'a': 1, 'b': 2}
k = d.keys()
- self.assert_(d.has_key('a'))
- self.assert_(d.has_key('b'))
+ self.assertTrue(d.has_key('a'))
+ self.assertTrue(d.has_key('b'))
self.assertRaises(TypeError, d.keys, None)
@@ -57,7 +57,7 @@ class DictTest(unittest.TestCase):
def test_has_key(self):
d = {}
- self.assert_(not d.has_key('a'))
+ self.assertFalse(d.has_key('a'))
d = {'a': 1, 'b': 2}
k = d.keys()
k.sort()
@@ -67,12 +67,13 @@ class DictTest(unittest.TestCase):
def test_contains(self):
d = {}
- self.assert_(not ('a' in d))
- self.assert_('a' not in d)
+ self.assertNotIn('a', d)
+ self.assertFalse('a' in d)
+ self.assertTrue('a' not in d)
d = {'a': 1, 'b': 2}
- self.assert_('a' in d)
- self.assert_('b' in d)
- self.assert_('c' not in d)
+ self.assertIn('a', d)
+ self.assertIn('b', d)
+ self.assertNotIn('c', d)
self.assertRaises(TypeError, d.__contains__)
@@ -206,7 +207,7 @@ class DictTest(unittest.TestCase):
def test_fromkeys(self):
self.assertEqual(dict.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
d = {}
- self.assert_(not(d.fromkeys('abc') is d))
+ self.assertIsNot(d.fromkeys('abc'), d)
self.assertEqual(d.fromkeys('abc'), {'a':None, 'b':None, 'c':None})
self.assertEqual(d.fromkeys((4,5),0), {4:0, 5:0})
self.assertEqual(d.fromkeys([]), {})
@@ -217,14 +218,14 @@ class DictTest(unittest.TestCase):
class dictlike(dict): pass
self.assertEqual(dictlike.fromkeys('a'), {'a':None})
self.assertEqual(dictlike().fromkeys('a'), {'a':None})
- self.assert_(type(dictlike.fromkeys('a')) is dictlike)
- self.assert_(type(dictlike().fromkeys('a')) is dictlike)
+ self.assertIsInstance(dictlike.fromkeys('a'), dictlike)
+ self.assertIsInstance(dictlike().fromkeys('a'), dictlike)
class mydict(dict):
def __new__(cls):
return UserDict.UserDict()
ud = mydict.fromkeys('ab')
self.assertEqual(ud, {'a':None, 'b':None})
- self.assert_(isinstance(ud, UserDict.UserDict))
+ self.assertIsInstance(ud, UserDict.UserDict)
self.assertRaises(TypeError, dict.fromkeys)
class Exc(Exception): pass
@@ -261,10 +262,10 @@ class DictTest(unittest.TestCase):
def test_get(self):
d = {}
- self.assert_(d.get('c') is None)
+ self.assertIs(d.get('c'), None)
self.assertEqual(d.get('c', 3), 3)
- d = {'a' : 1, 'b' : 2}
- self.assert_(d.get('c') is None)
+ d = {'a': 1, 'b': 2}
+ self.assertIs(d.get('c'), None)
self.assertEqual(d.get('c', 3), 3)
self.assertEqual(d.get('a'), 1)
self.assertEqual(d.get('a', 3), 1)
@@ -274,9 +275,9 @@ class DictTest(unittest.TestCase):
def test_setdefault(self):
# dict.setdefault()
d = {}
- self.assert_(d.setdefault('key0') is None)
+ self.assertIs(d.setdefault('key0'), None)
d.setdefault('key0', [])
- self.assert_(d.setdefault('key0') is None)
+ self.assertIs(d.setdefault('key0'), None)
d.setdefault('key', []).append(3)
self.assertEqual(d['key'][0], 3)
d.setdefault('key', []).append(4)
@@ -318,9 +319,9 @@ class DictTest(unittest.TestCase):
self.assertEqual(va, int(ka))
kb, vb = tb = b.popitem()
self.assertEqual(vb, int(kb))
- self.assert_(not(copymode < 0 and ta != tb))
- self.assert_(not a)
- self.assert_(not b)
+ self.assertFalse(copymode < 0 and ta != tb)
+ self.assertFalse(a)
+ self.assertFalse(b)
d = {}
self.assertRaises(KeyError, d.popitem)
@@ -337,8 +338,8 @@ class DictTest(unittest.TestCase):
self.assertRaises(KeyError, d.pop, k)
- # verify longs/ints get same value when key > 32 bits (for 64-bit archs)
- # see SF bug #689659
+ # verify longs/ints get same value when key > 32 bits
+ # (for 64-bit archs). See SF bug #689659.
x = 4503599627370496L
y = 4503599627370496
h = {x: 'anything', y: 'something else'}
@@ -366,15 +367,12 @@ class DictTest(unittest.TestCase):
self.assertRaises(Exc, d.pop, x)
def test_mutatingiteration(self):
+ # changing dict size during iteration
d = {}
d[1] = 1
- try:
+ with self.assertRaises(RuntimeError):
for i in d:
d[i+1] = 1
- except RuntimeError:
- pass
- else:
- self.fail("changing dict size during iteration doesn't raise Error")
def test_repr(self):
d = {}
@@ -395,8 +393,8 @@ class DictTest(unittest.TestCase):
self.assertRaises(Exc, repr, d)
def test_le(self):
- self.assert_(not ({} < {}))
- self.assert_(not ({1: 2} < {1L: 2L}))
+ self.assertFalse({} < {})
+ self.assertFalse({1: 2} < {1L: 2L})
class Exc(Exception): pass
@@ -408,17 +406,14 @@ class DictTest(unittest.TestCase):
d1 = {BadCmp(): 1}
d2 = {1: 1}
- try:
+
+ with self.assertRaises(Exc):
d1 < d2
- except Exc:
- pass
- else:
- self.fail("< didn't raise Exc")
def test_missing(self):
# Make sure dict doesn't have a __missing__ method
- self.assertEqual(hasattr(dict, "__missing__"), False)
- self.assertEqual(hasattr({}, "__missing__"), False)
+ self.assertFalse(hasattr(dict, "__missing__"))
+ self.assertFalse(hasattr({}, "__missing__"))
# Test several cases:
# (D) subclass defines __missing__ method returning a value
# (E) subclass defines __missing__ method raising RuntimeError
@@ -430,49 +425,40 @@ class DictTest(unittest.TestCase):
d = D({1: 2, 3: 4})
self.assertEqual(d[1], 2)
self.assertEqual(d[3], 4)
- self.assert_(2 not in d)
- self.assert_(2 not in d.keys())
+ self.assertNotIn(2, d)
+ self.assertNotIn(2, d.keys())
self.assertEqual(d[2], 42)
+
class E(dict):
def __missing__(self, key):
raise RuntimeError(key)
e = E()
- try:
+ with self.assertRaises(RuntimeError) as c:
e[42]
- except RuntimeError, err:
- self.assertEqual(err.args, (42,))
- else:
- self.fail("e[42] didn't raise RuntimeError")
+ self.assertEqual(c.exception.args, (42,))
+
class F(dict):
def __init__(self):
# An instance variable __missing__ should have no effect
self.__missing__ = lambda key: None
f = F()
- try:
+ with self.assertRaises(KeyError) as c:
f[42]
- except KeyError, err:
- self.assertEqual(err.args, (42,))
- else:
- self.fail("f[42] didn't raise KeyError")
+ self.assertEqual(c.exception.args, (42,))
+
class G(dict):
pass
g = G()
- try:
+ with self.assertRaises(KeyError) as c:
g[42]
- except KeyError, err:
- self.assertEqual(err.args, (42,))
- else:
- self.fail("g[42] didn't raise KeyError")
+ self.assertEqual(c.exception.args, (42,))
def test_tuple_keyerror(self):
# SF #1576657
d = {}
- try:
+ with self.assertRaises(KeyError) as c:
d[(1,)]
- except KeyError, e:
- self.assertEqual(e.args, ((1,),))
- else:
- self.fail("missing KeyError")
+ self.assertEqual(c.exception.args, ((1,),))
def test_bad_key(self):
# Dictionary lookups should fail if __cmp__() raises an exception.
@@ -500,12 +486,8 @@ class DictTest(unittest.TestCase):
'd.setdefault(x2, 42)',
'd.pop(x2)',
'd.update({x2: 2})']:
- try:
+ with self.assertRaises(CustomException):
exec stmt in locals()
- except CustomException:
- pass
- else:
- self.fail("Statement didn't raise exception")
def test_resize1(self):
# Dict resizing bug, found by Jack Jansen in 2.2 CVS development.
@@ -548,11 +530,9 @@ class DictTest(unittest.TestCase):
def test_empty_presized_dict_in_freelist(self):
# Bug #3537: if an empty but presized dict with a size larger
# than 7 was in the freelist, it triggered an assertion failure
- try:
- d = {'a': 1//0, 'b': None, 'c': None, 'd': None, 'e': None,
+ with self.assertRaises(ZeroDivisionError):
+ d = {'a': 1 // 0, 'b': None, 'c': None, 'd': None, 'e': None,
'f': None, 'g': None, 'h': None}
- except ZeroDivisionError:
- pass
d = {}
def test_container_iterator(self):
@@ -567,7 +547,108 @@ class DictTest(unittest.TestCase):
obj.x = i(container)
del obj, container
gc.collect()
- self.assert_(ref() is None, "Cycle was not collected")
+ self.assertIs(ref(), None, "Cycle was not collected")
+
+ def _not_tracked(self, t):
+ # Nested containers can take several collections to untrack
+ gc.collect()
+ gc.collect()
+ self.assertFalse(gc.is_tracked(t), t)
+
+ def _tracked(self, t):
+ self.assertTrue(gc.is_tracked(t), t)
+ gc.collect()
+ gc.collect()
+ self.assertTrue(gc.is_tracked(t), t)
+
+ @test_support.cpython_only
+ def test_track_literals(self):
+ # Test GC-optimization of dict literals
+ x, y, z, w = 1.5, "a", (1, None), []
+
+ self._not_tracked({})
+ self._not_tracked({x:(), y:x, z:1})
+ self._not_tracked({1: "a", "b": 2})
+ self._not_tracked({1: 2, (None, True, False, ()): int})
+ self._not_tracked({1: object()})
+
+ # Dicts with mutable elements are always tracked, even if those
+ # elements are not tracked right now.
+ self._tracked({1: []})
+ self._tracked({1: ([],)})
+ self._tracked({1: {}})
+ self._tracked({1: set()})
+
+ @test_support.cpython_only
+ def test_track_dynamic(self):
+ # Test GC-optimization of dynamically-created dicts
+ class MyObject(object):
+ pass
+ x, y, z, w, o = 1.5, "a", (1, object()), [], MyObject()
+
+ d = dict()
+ self._not_tracked(d)
+ d[1] = "a"
+ self._not_tracked(d)
+ d[y] = 2
+ self._not_tracked(d)
+ d[z] = 3
+ self._not_tracked(d)
+ self._not_tracked(d.copy())
+ d[4] = w
+ self._tracked(d)
+ self._tracked(d.copy())
+ d[4] = None
+ self._not_tracked(d)
+ self._not_tracked(d.copy())
+
+ # dd isn't tracked right now, but it may mutate and therefore d
+ # which contains it must be tracked.
+ d = dict()
+ dd = dict()
+ d[1] = dd
+ self._not_tracked(dd)
+ self._tracked(d)
+ dd[1] = d
+ self._tracked(dd)
+
+ d = dict.fromkeys([x, y, z])
+ self._not_tracked(d)
+ dd = dict()
+ dd.update(d)
+ self._not_tracked(dd)
+ d = dict.fromkeys([x, y, z, o])
+ self._tracked(d)
+ dd = dict()
+ dd.update(d)
+ self._tracked(dd)
+
+ d = dict(x=x, y=y, z=z)
+ self._not_tracked(d)
+ d = dict(x=x, y=y, z=z, w=w)
+ self._tracked(d)
+ d = dict()
+ d.update(x=x, y=y, z=z)
+ self._not_tracked(d)
+ d.update(w=w)
+ self._tracked(d)
+
+ d = dict([(x, y), (z, 1)])
+ self._not_tracked(d)
+ d = dict([(x, y), (z, w)])
+ self._tracked(d)
+ d = dict()
+ d.update([(x, y), (z, 1)])
+ self._not_tracked(d)
+ d.update([(x, y), (z, w)])
+ self._tracked(d)
+
+ @test_support.cpython_only
+ def test_track_subtypes(self):
+ # Dict subtypes are always tracked
+ class MyDict(dict):
+ pass
+ self._tracked(MyDict())
from test import mapping_tests
@@ -582,7 +663,7 @@ class SubclassMappingTests(mapping_tests.BasicTestMappingProtocol):
type2test = Dict
def test_main():
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
('dict(.has_key..| inequality comparisons) not supported in 3.x',
DeprecationWarning)):
test_support.run_unittest(
diff --git a/Lib/test/test_dictcomps.py b/Lib/test/test_dictcomps.py
new file mode 100644
index 0000000000..9af9e48b2c
--- /dev/null
+++ b/Lib/test/test_dictcomps.py
@@ -0,0 +1,54 @@
+
+doctests = """
+
+ >>> k = "old value"
+ >>> { k: None for k in range(10) }
+ {0: None, 1: None, 2: None, 3: None, 4: None, 5: None, 6: None, 7: None, 8: None, 9: None}
+ >>> k
+ 'old value'
+
+ >>> { k: k+10 for k in range(10) }
+ {0: 10, 1: 11, 2: 12, 3: 13, 4: 14, 5: 15, 6: 16, 7: 17, 8: 18, 9: 19}
+
+ >>> g = "Global variable"
+ >>> { k: g for k in range(10) }
+ {0: 'Global variable', 1: 'Global variable', 2: 'Global variable', 3: 'Global variable', 4: 'Global variable', 5: 'Global variable', 6: 'Global variable', 7: 'Global variable', 8: 'Global variable', 9: 'Global variable'}
+
+ >>> { k: v for k in range(10) for v in range(10) if k == v }
+ {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
+
+ >>> { k: v for v in range(10) for k in range(v*9, v*10) }
+ {9: 1, 18: 2, 19: 2, 27: 3, 28: 3, 29: 3, 36: 4, 37: 4, 38: 4, 39: 4, 45: 5, 46: 5, 47: 5, 48: 5, 49: 5, 54: 6, 55: 6, 56: 6, 57: 6, 58: 6, 59: 6, 63: 7, 64: 7, 65: 7, 66: 7, 67: 7, 68: 7, 69: 7, 72: 8, 73: 8, 74: 8, 75: 8, 76: 8, 77: 8, 78: 8, 79: 8, 81: 9, 82: 9, 83: 9, 84: 9, 85: 9, 86: 9, 87: 9, 88: 9, 89: 9}
+
+ >>> { x: y for y, x in ((1, 2), (3, 4)) } = 5 # doctest: +IGNORE_EXCEPTION_DETAIL
+ Traceback (most recent call last):
+ ...
+ SyntaxError: ...
+
+ >>> { x: y for y, x in ((1, 2), (3, 4)) } += 5 # doctest: +IGNORE_EXCEPTION_DETAIL
+ Traceback (most recent call last):
+ ...
+ SyntaxError: ...
+
+"""
+
+__test__ = {'doctests' : doctests}
+
+def test_main(verbose=None):
+ import sys
+ from test import test_support
+ from test import test_dictcomps
+ test_support.run_doctest(test_dictcomps, verbose)
+
+ # verify reference counting
+ if verbose and hasattr(sys, "gettotalrefcount"):
+ import gc
+ counts = [None] * 5
+ for i in range(len(counts)):
+ test_support.run_doctest(test_dictcomps, verbose)
+ gc.collect()
+ counts[i] = sys.gettotalrefcount()
+ print(counts)
+
+if __name__ == "__main__":
+ test_main(verbose=True)
diff --git a/Lib/test/test_dictviews.py b/Lib/test/test_dictviews.py
new file mode 100644
index 0000000000..f90367660c
--- /dev/null
+++ b/Lib/test/test_dictviews.py
@@ -0,0 +1,154 @@
+import unittest
+from test import test_support
+
+class DictSetTest(unittest.TestCase):
+
+ def test_constructors_not_callable(self):
+ kt = type({}.viewkeys())
+ self.assertRaises(TypeError, kt, {})
+ self.assertRaises(TypeError, kt)
+ it = type({}.viewitems())
+ self.assertRaises(TypeError, it, {})
+ self.assertRaises(TypeError, it)
+ vt = type({}.viewvalues())
+ self.assertRaises(TypeError, vt, {})
+ self.assertRaises(TypeError, vt)
+
+ def test_dict_keys(self):
+ d = {1: 10, "a": "ABC"}
+ keys = d.viewkeys()
+ self.assertEqual(len(keys), 2)
+ self.assertEqual(set(keys), set([1, "a"]))
+ self.assertEqual(keys, set([1, "a"]))
+ self.assertNotEqual(keys, set([1, "a", "b"]))
+ self.assertNotEqual(keys, set([1, "b"]))
+ self.assertNotEqual(keys, set([1]))
+ self.assertNotEqual(keys, 42)
+ self.assertIn(1, keys)
+ self.assertIn("a", keys)
+ self.assertNotIn(10, keys)
+ self.assertNotIn("Z", keys)
+ self.assertEqual(d.viewkeys(), d.viewkeys())
+ e = {1: 11, "a": "def"}
+ self.assertEqual(d.viewkeys(), e.viewkeys())
+ del e["a"]
+ self.assertNotEqual(d.viewkeys(), e.viewkeys())
+
+ def test_dict_items(self):
+ d = {1: 10, "a": "ABC"}
+ items = d.viewitems()
+ self.assertEqual(len(items), 2)
+ self.assertEqual(set(items), set([(1, 10), ("a", "ABC")]))
+ self.assertEqual(items, set([(1, 10), ("a", "ABC")]))
+ self.assertNotEqual(items, set([(1, 10), ("a", "ABC"), "junk"]))
+ self.assertNotEqual(items, set([(1, 10), ("a", "def")]))
+ self.assertNotEqual(items, set([(1, 10)]))
+ self.assertNotEqual(items, 42)
+ self.assertIn((1, 10), items)
+ self.assertIn(("a", "ABC"), items)
+ self.assertNotIn((1, 11), items)
+ self.assertNotIn(1, items)
+ self.assertNotIn((), items)
+ self.assertNotIn((1,), items)
+ self.assertNotIn((1, 2, 3), items)
+ self.assertEqual(d.viewitems(), d.viewitems())
+ e = d.copy()
+ self.assertEqual(d.viewitems(), e.viewitems())
+ e["a"] = "def"
+ self.assertNotEqual(d.viewitems(), e.viewitems())
+
+ def test_dict_mixed_keys_items(self):
+ d = {(1, 1): 11, (2, 2): 22}
+ e = {1: 1, 2: 2}
+ self.assertEqual(d.viewkeys(), e.viewitems())
+ self.assertNotEqual(d.viewitems(), e.viewkeys())
+
+ def test_dict_values(self):
+ d = {1: 10, "a": "ABC"}
+ values = d.viewvalues()
+ self.assertEqual(set(values), set([10, "ABC"]))
+ self.assertEqual(len(values), 2)
+
+ def test_dict_repr(self):
+ d = {1: 10, "a": "ABC"}
+ self.assertIsInstance(repr(d), str)
+ r = repr(d.viewitems())
+ self.assertIsInstance(r, str)
+ self.assertTrue(r == "dict_items([('a', 'ABC'), (1, 10)])" or
+ r == "dict_items([(1, 10), ('a', 'ABC')])")
+ r = repr(d.viewkeys())
+ self.assertIsInstance(r, str)
+ self.assertTrue(r == "dict_keys(['a', 1])" or
+ r == "dict_keys([1, 'a'])")
+ r = repr(d.viewvalues())
+ self.assertIsInstance(r, str)
+ self.assertTrue(r == "dict_values(['ABC', 10])" or
+ r == "dict_values([10, 'ABC'])")
+
+ def test_keys_set_operations(self):
+ d1 = {'a': 1, 'b': 2}
+ d2 = {'b': 3, 'c': 2}
+ d3 = {'d': 4, 'e': 5}
+ self.assertEqual(d1.viewkeys() & d1.viewkeys(), {'a', 'b'})
+ self.assertEqual(d1.viewkeys() & d2.viewkeys(), {'b'})
+ self.assertEqual(d1.viewkeys() & d3.viewkeys(), set())
+ self.assertEqual(d1.viewkeys() & set(d1.viewkeys()), {'a', 'b'})
+ self.assertEqual(d1.viewkeys() & set(d2.viewkeys()), {'b'})
+ self.assertEqual(d1.viewkeys() & set(d3.viewkeys()), set())
+
+ self.assertEqual(d1.viewkeys() | d1.viewkeys(), {'a', 'b'})
+ self.assertEqual(d1.viewkeys() | d2.viewkeys(), {'a', 'b', 'c'})
+ self.assertEqual(d1.viewkeys() | d3.viewkeys(), {'a', 'b', 'd', 'e'})
+ self.assertEqual(d1.viewkeys() | set(d1.viewkeys()), {'a', 'b'})
+ self.assertEqual(d1.viewkeys() | set(d2.viewkeys()), {'a', 'b', 'c'})
+ self.assertEqual(d1.viewkeys() | set(d3.viewkeys()),
+ {'a', 'b', 'd', 'e'})
+
+ self.assertEqual(d1.viewkeys() ^ d1.viewkeys(), set())
+ self.assertEqual(d1.viewkeys() ^ d2.viewkeys(), {'a', 'c'})
+ self.assertEqual(d1.viewkeys() ^ d3.viewkeys(), {'a', 'b', 'd', 'e'})
+ self.assertEqual(d1.viewkeys() ^ set(d1.viewkeys()), set())
+ self.assertEqual(d1.viewkeys() ^ set(d2.viewkeys()), {'a', 'c'})
+ self.assertEqual(d1.viewkeys() ^ set(d3.viewkeys()),
+ {'a', 'b', 'd', 'e'})
+
+ def test_items_set_operations(self):
+ d1 = {'a': 1, 'b': 2}
+ d2 = {'a': 2, 'b': 2}
+ d3 = {'d': 4, 'e': 5}
+ self.assertEqual(
+ d1.viewitems() & d1.viewitems(), {('a', 1), ('b', 2)})
+ self.assertEqual(d1.viewitems() & d2.viewitems(), {('b', 2)})
+ self.assertEqual(d1.viewitems() & d3.viewitems(), set())
+ self.assertEqual(d1.viewitems() & set(d1.viewitems()),
+ {('a', 1), ('b', 2)})
+ self.assertEqual(d1.viewitems() & set(d2.viewitems()), {('b', 2)})
+ self.assertEqual(d1.viewitems() & set(d3.viewitems()), set())
+
+ self.assertEqual(d1.viewitems() | d1.viewitems(),
+ {('a', 1), ('b', 2)})
+ self.assertEqual(d1.viewitems() | d2.viewitems(),
+ {('a', 1), ('a', 2), ('b', 2)})
+ self.assertEqual(d1.viewitems() | d3.viewitems(),
+ {('a', 1), ('b', 2), ('d', 4), ('e', 5)})
+ self.assertEqual(d1.viewitems() | set(d1.viewitems()),
+ {('a', 1), ('b', 2)})
+ self.assertEqual(d1.viewitems() | set(d2.viewitems()),
+ {('a', 1), ('a', 2), ('b', 2)})
+ self.assertEqual(d1.viewitems() | set(d3.viewitems()),
+ {('a', 1), ('b', 2), ('d', 4), ('e', 5)})
+
+ self.assertEqual(d1.viewitems() ^ d1.viewitems(), set())
+ self.assertEqual(d1.viewitems() ^ d2.viewitems(),
+ {('a', 1), ('a', 2)})
+ self.assertEqual(d1.viewitems() ^ d3.viewitems(),
+ {('a', 1), ('b', 2), ('d', 4), ('e', 5)})
+
+
+
+
+def test_main():
+ test_support.run_unittest(DictSetTest)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_difflib.py b/Lib/test/test_difflib.py
index ad5a6b3a0f..310bf99782 100644
--- a/Lib/test/test_difflib.py
+++ b/Lib/test/test_difflib.py
@@ -4,8 +4,47 @@ import unittest
import doctest
import sys
-class TestSFbugs(unittest.TestCase):
+class TestWithAscii(unittest.TestCase):
+ def test_one_insert(self):
+ sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100)
+ self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
+ self.assertEqual(list(sm.get_opcodes()),
+ [ ('insert', 0, 0, 0, 1),
+ ('equal', 0, 100, 1, 101)])
+ sm = difflib.SequenceMatcher(None, 'b' * 100, 'b' * 50 + 'a' + 'b' * 50)
+ self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
+ self.assertEqual(list(sm.get_opcodes()),
+ [ ('equal', 0, 50, 0, 50),
+ ('insert', 50, 50, 50, 51),
+ ('equal', 50, 100, 51, 101)])
+
+ def test_one_delete(self):
+ sm = difflib.SequenceMatcher(None, 'a' * 40 + 'c' + 'b' * 40, 'a' * 40 + 'b' * 40)
+ self.assertAlmostEqual(sm.ratio(), 0.994, places=3)
+ self.assertEqual(list(sm.get_opcodes()),
+ [ ('equal', 0, 40, 0, 40),
+ ('delete', 40, 41, 40, 40),
+ ('equal', 41, 81, 40, 80)])
+
+
+class TestAutojunk(unittest.TestCase):
+ """Tests for the autojunk parameter added in 2.7"""
+ def test_one_insert_homogenous_sequence(self):
+ # By default autojunk=True and the heuristic kicks in for a sequence
+ # of length 200+
+ seq1 = 'b' * 200
+ seq2 = 'a' + 'b' * 200
+
+ sm = difflib.SequenceMatcher(None, seq1, seq2)
+ self.assertAlmostEqual(sm.ratio(), 0, places=3)
+
+ # Now turn the heuristic off
+ sm = difflib.SequenceMatcher(None, seq1, seq2, autojunk=False)
+ self.assertAlmostEqual(sm.ratio(), 0.9975, places=3)
+
+
+class TestSFbugs(unittest.TestCase):
def test_ratio_for_null_seqn(self):
# Check clearing of SF bug 763023
s = difflib.SequenceMatcher(None, [], [])
@@ -143,14 +182,13 @@ class TestSFpatches(unittest.TestCase):
k.make_table(f3.splitlines(True),t3.splitlines(True)),
])
actual = full.replace('</body>','\n%s\n</body>' % tables)
- # temporarily uncomment next three lines to baseline this test
- #f = open('test_difflib_expect.html','w')
- #f.write(actual)
- #f.close()
- expect = open(findfile('test_difflib_expect.html')).read()
+ # temporarily uncomment next two lines to baseline this test
+ #with open('test_difflib_expect.html','w') as fp:
+ # fp.write(actual)
- self.assertEqual(actual,expect)
+ with open(findfile('test_difflib_expect.html')) as fp:
+ self.assertEqual(actual, fp.read())
def test_recursion_limit(self):
# Check if the problem described in patch #1413711 exists.
@@ -160,10 +198,75 @@ class TestSFpatches(unittest.TestCase):
difflib.SequenceMatcher(None, old, new).get_opcodes()
+class TestOutputFormat(unittest.TestCase):
+ def test_tab_delimiter(self):
+ args = ['one', 'two', 'Original', 'Current',
+ '2005-01-26 23:30:50', '2010-04-02 10:20:52']
+ ud = difflib.unified_diff(*args, lineterm='')
+ self.assertEqual(list(ud)[0:2], [
+ "--- Original\t2005-01-26 23:30:50",
+ "+++ Current\t2010-04-02 10:20:52"])
+ cd = difflib.context_diff(*args, lineterm='')
+ self.assertEqual(list(cd)[0:2], [
+ "*** Original\t2005-01-26 23:30:50",
+ "--- Current\t2010-04-02 10:20:52"])
+
+ def test_no_trailing_tab_on_empty_filedate(self):
+ args = ['one', 'two', 'Original', 'Current']
+ ud = difflib.unified_diff(*args, lineterm='')
+ self.assertEqual(list(ud)[0:2], ["--- Original", "+++ Current"])
+
+ cd = difflib.context_diff(*args, lineterm='')
+ self.assertEqual(list(cd)[0:2], ["*** Original", "--- Current"])
+
+ def test_range_format_unified(self):
+ # Per the diff spec at http://www.unix.org/single_unix_specification/
+ spec = '''\
+ Each <range> field shall be of the form:
+ %1d", <beginning line number> if the range contains exactly one line,
+ and:
+ "%1d,%1d", <beginning line number>, <number of lines> otherwise.
+ If a range is empty, its beginning line number shall be the number of
+ the line just before the range, or 0 if the empty range starts the file.
+ '''
+ fmt = difflib._format_range_unified
+ self.assertEqual(fmt(3,3), '3,0')
+ self.assertEqual(fmt(3,4), '4')
+ self.assertEqual(fmt(3,5), '4,2')
+ self.assertEqual(fmt(3,6), '4,3')
+ self.assertEqual(fmt(0,0), '0,0')
+
+ def test_range_format_context(self):
+ # Per the diff spec at http://www.unix.org/single_unix_specification/
+ spec = '''\
+ The range of lines in file1 shall be written in the following format
+ if the range contains two or more lines:
+ "*** %d,%d ****\n", <beginning line number>, <ending line number>
+ and the following format otherwise:
+ "*** %d ****\n", <ending line number>
+ The ending line number of an empty range shall be the number of the preceding line,
+ or 0 if the range is at the start of the file.
+
+ Next, the range of lines in file2 shall be written in the following format
+ if the range contains two or more lines:
+ "--- %d,%d ----\n", <beginning line number>, <ending line number>
+ and the following format otherwise:
+ "--- %d ----\n", <ending line number>
+ '''
+ fmt = difflib._format_range_context
+ self.assertEqual(fmt(3,3), '3')
+ self.assertEqual(fmt(3,4), '4')
+ self.assertEqual(fmt(3,5), '4,5')
+ self.assertEqual(fmt(3,6), '4,6')
+ self.assertEqual(fmt(0,0), '0')
+
+
def test_main():
difflib.HtmlDiff._default_prefix = 0
Doctests = doctest.DocTestSuite(difflib)
- run_unittest(TestSFpatches, TestSFbugs, Doctests)
+ run_unittest(
+ TestWithAscii, TestAutojunk, TestSFpatches, TestSFbugs,
+ TestOutputFormat, Doctests)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_dircache.py b/Lib/test/test_dircache.py
index 276c52a5c4..c6ad31c56c 100644
--- a/Lib/test/test_dircache.py
+++ b/Lib/test/test_dircache.py
@@ -4,7 +4,7 @@
"""
import unittest
-from test.test_support import run_unittest, TESTFN, import_module
+from test.test_support import run_unittest, import_module
dircache = import_module('dircache', deprecated=True)
import os, time, sys, tempfile
@@ -35,10 +35,10 @@ class DircacheTests(unittest.TestCase):
def test_listdir(self):
## SUCCESSFUL CASES
entries = dircache.listdir(self.tempdir)
- self.assertEquals(entries, [])
+ self.assertEqual(entries, [])
# Check that cache is actually caching, not just passing through.
- self.assert_(dircache.listdir(self.tempdir) is entries)
+ self.assertTrue(dircache.listdir(self.tempdir) is entries)
# Directories aren't "files" on Windows, and directory mtime has
# nothing to do with when files under a directory get created.
@@ -52,8 +52,8 @@ class DircacheTests(unittest.TestCase):
time.sleep(1)
self.writeTemp("test1")
entries = dircache.listdir(self.tempdir)
- self.assertEquals(entries, ['test1'])
- self.assert_(dircache.listdir(self.tempdir) is entries)
+ self.assertEqual(entries, ['test1'])
+ self.assertTrue(dircache.listdir(self.tempdir) is entries)
## UNSUCCESSFUL CASES
self.assertRaises(OSError, dircache.listdir, self.tempdir+"_nonexistent")
@@ -63,7 +63,7 @@ class DircacheTests(unittest.TestCase):
self.mkdirTemp("A")
lst = ['A', 'test2', 'test_nonexistent']
dircache.annotate(self.tempdir, lst)
- self.assertEquals(lst, ['A/', 'test2', 'test_nonexistent'])
+ self.assertEqual(lst, ['A/', 'test2', 'test_nonexistent'])
def test_main():
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index fd508a94a2..3849dc2882 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -54,29 +54,23 @@ def bug1333982(x=[]):
dis_bug1333982 = """\
%-4d 0 LOAD_CONST 1 (0)
- 3 JUMP_IF_TRUE 41 (to 47)
- 6 POP_TOP
- 7 LOAD_GLOBAL 0 (AssertionError)
- 10 BUILD_LIST 0
- 13 DUP_TOP
- 14 STORE_FAST 1 (_[1])
- 17 LOAD_FAST 0 (x)
- 20 GET_ITER
- >> 21 FOR_ITER 13 (to 37)
- 24 STORE_FAST 2 (s)
- 27 LOAD_FAST 1 (_[1])
- 30 LOAD_FAST 2 (s)
- 33 LIST_APPEND
- 34 JUMP_ABSOLUTE 21
- >> 37 DELETE_FAST 1 (_[1])
-
- %-4d 40 LOAD_CONST 2 (1)
- 43 BINARY_ADD
- 44 RAISE_VARARGS 2
- >> 47 POP_TOP
-
- %-4d 48 LOAD_CONST 0 (None)
- 51 RETURN_VALUE
+ 3 POP_JUMP_IF_TRUE 38
+ 6 LOAD_GLOBAL 0 (AssertionError)
+ 9 BUILD_LIST 0
+ 12 LOAD_FAST 0 (x)
+ 15 GET_ITER
+ >> 16 FOR_ITER 12 (to 31)
+ 19 STORE_FAST 1 (s)
+ 22 LOAD_FAST 1 (s)
+ 25 LIST_APPEND 2
+ 28 JUMP_ABSOLUTE 16
+
+ %-4d >> 31 LOAD_CONST 2 (1)
+ 34 BINARY_ADD
+ 35 RAISE_VARARGS 2
+
+ %-4d >> 38 LOAD_CONST 0 (None)
+ 41 RETURN_VALUE
"""%(bug1333982.func_code.co_firstlineno + 1,
bug1333982.func_code.co_firstlineno + 2,
bug1333982.func_code.co_firstlineno + 3)
@@ -109,8 +103,8 @@ class DisTests(unittest.TestCase):
def test_opmap(self):
self.assertEqual(dis.opmap["STOP_CODE"], 0)
- self.assertEqual(dis.opmap["LOAD_CONST"] in dis.hasconst, True)
- self.assertEqual(dis.opmap["STORE_NAME"] in dis.hasname, True)
+ self.assertIn(dis.opmap["LOAD_CONST"], dis.hasconst)
+ self.assertIn(dis.opmap["STORE_NAME"], dis.hasname)
def test_opname(self):
self.assertEqual(dis.opname[dis.opmap["LOAD_FAST"]], "LOAD_FAST")
diff --git a/Lib/test/test_dl.py b/Lib/test/test_dl.py
index c04bc1b530..6069a77bf1 100755
--- a/Lib/test/test_dl.py
+++ b/Lib/test/test_dl.py
@@ -2,7 +2,8 @@
"""Test dlmodule.c
Roger E. Masse revised strategy by Barry Warsaw
"""
-from test.test_support import verbose,TestSkipped, import_module
+import unittest
+from test.test_support import verbose, import_module
dl = import_module('dl', deprecated=True)
sharedlibs = [
@@ -31,7 +32,7 @@ def test_main():
print 'worked!'
break
else:
- raise TestSkipped, 'Could not open any shared libraries'
+ raise unittest.SkipTest, 'Could not open any shared libraries'
if __name__ == '__main__':
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index a7477f2c43..df33e7003b 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -499,6 +499,8 @@ If a single object is listed twice (under different names), then tests
will only be generated for it once:
>>> from test import doctest_aliases
+ >>> assert doctest_aliases.TwoNames.f
+ >>> assert doctest_aliases.TwoNames.g
>>> tests = excl_empty_finder.find(doctest_aliases)
>>> print len(tests)
2
@@ -863,6 +865,77 @@ detail:
>>> doctest.DocTestRunner(verbose=False).run(test)
TestResults(failed=0, attempted=1)
+IGNORE_EXCEPTION_DETAIL also ignores difference in exception formatting
+between Python versions. For example, in Python 3.x, the module path of
+the exception is in the output, but this will fail under Python 2:
+
+ >>> def f(x):
+ ... r'''
+ ... >>> from httplib import HTTPException
+ ... >>> raise HTTPException('message')
+ ... Traceback (most recent call last):
+ ... httplib.HTTPException: message
+ ... '''
+ >>> test = doctest.DocTestFinder().find(f)[0]
+ >>> doctest.DocTestRunner(verbose=False).run(test)
+ ... # doctest: +ELLIPSIS
+ **********************************************************************
+ File ..., line 4, in f
+ Failed example:
+ raise HTTPException('message')
+ Expected:
+ Traceback (most recent call last):
+ httplib.HTTPException: message
+ Got:
+ Traceback (most recent call last):
+ ...
+ HTTPException: message
+ TestResults(failed=1, attempted=2)
+
+But in Python 2 the module path is not included, an therefore a test must look
+like the following test to succeed in Python 2. But that test will fail under
+Python 3.
+
+ >>> def f(x):
+ ... r'''
+ ... >>> from httplib import HTTPException
+ ... >>> raise HTTPException('message')
+ ... Traceback (most recent call last):
+ ... HTTPException: message
+ ... '''
+ >>> test = doctest.DocTestFinder().find(f)[0]
+ >>> doctest.DocTestRunner(verbose=False).run(test)
+ TestResults(failed=0, attempted=2)
+
+However, with IGNORE_EXCEPTION_DETAIL, the module name of the exception
+(if any) will be ignored:
+
+ >>> def f(x):
+ ... r'''
+ ... >>> from httplib import HTTPException
+ ... >>> raise HTTPException('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+ ... Traceback (most recent call last):
+ ... HTTPException: message
+ ... '''
+ >>> test = doctest.DocTestFinder().find(f)[0]
+ >>> doctest.DocTestRunner(verbose=False).run(test)
+ TestResults(failed=0, attempted=2)
+
+The module path will be completely ignored, so two different module paths will
+still pass if IGNORE_EXCEPTION_DETAIL is given. This is intentional, so it can
+be used when exceptions have changed module.
+
+ >>> def f(x):
+ ... r'''
+ ... >>> from httplib import HTTPException
+ ... >>> raise HTTPException('message') #doctest: +IGNORE_EXCEPTION_DETAIL
+ ... Traceback (most recent call last):
+ ... foo.bar.HTTPException: message
+ ... '''
+ >>> test = doctest.DocTestFinder().find(f)[0]
+ >>> doctest.DocTestRunner(verbose=False).run(test)
+ TestResults(failed=0, attempted=2)
+
But IGNORE_EXCEPTION_DETAIL does not allow a mismatch in the exception type:
>>> def f(x):
@@ -1219,7 +1292,7 @@ marking, as well as interline differences.
? + ++ ^
TestResults(failed=1, attempted=1)
-The REPORT_ONLY_FIRST_FAILURE supresses result output after the first
+The REPORT_ONLY_FIRST_FAILURE suppresses result output after the first
failing example:
>>> def f(x):
@@ -1249,7 +1322,7 @@ failing example:
2
TestResults(failed=3, attempted=5)
-However, output from `report_start` is not supressed:
+However, output from `report_start` is not suppressed:
>>> doctest.DocTestRunner(verbose=True, optionflags=flags).run(test)
... # doctest: +ELLIPSIS
@@ -1648,10 +1721,13 @@ def test_pdb_set_trace():
>>> doc = '''
... >>> x = 42
+ ... >>> raise Exception('clé')
+ ... Traceback (most recent call last):
+ ... Exception: clé
... >>> import pdb; pdb.set_trace()
... '''
>>> parser = doctest.DocTestParser()
- >>> test = parser.get_doctest(doc, {}, "foo", "foo.py", 0)
+ >>> test = parser.get_doctest(doc, {}, "foo-bär@baz", "foo-bär@baz.py", 0)
>>> runner = doctest.DocTestRunner(verbose=False)
To demonstrate this, we'll create a fake standard input that
@@ -1667,12 +1743,12 @@ def test_pdb_set_trace():
>>> try: runner.run(test)
... finally: sys.stdin = real_stdin
--Return--
- > <doctest foo[1]>(1)<module>()->None
+ > <doctest foo-bär@baz[2]>(1)<module>()->None
-> import pdb; pdb.set_trace()
(Pdb) print x
42
(Pdb) continue
- TestResults(failed=0, attempted=2)
+ TestResults(failed=0, attempted=3)
You can also put pdb.set_trace in a function called from a test:
@@ -1684,7 +1760,7 @@ def test_pdb_set_trace():
... >>> x=1
... >>> calls_set_trace()
... '''
- >>> test = parser.get_doctest(doc, globals(), "foo", "foo.py", 0)
+ >>> test = parser.get_doctest(doc, globals(), "foo-bär@baz", "foo-bär@baz.py", 0)
>>> real_stdin = sys.stdin
>>> sys.stdin = _FakeInput([
... 'print y', # print data defined in the function
@@ -1703,7 +1779,7 @@ def test_pdb_set_trace():
(Pdb) print y
2
(Pdb) up
- > <doctest foo[1]>(1)<module>()
+ > <doctest foo-bär@baz[1]>(1)<module>()
-> calls_set_trace()
(Pdb) print x
1
@@ -1721,7 +1797,7 @@ def test_pdb_set_trace():
... ... import pdb; pdb.set_trace()
... >>> f(3)
... '''
- >>> test = parser.get_doctest(doc, globals(), "foo", "foo.py", 0)
+ >>> test = parser.get_doctest(doc, globals(), "foo-bär@baz", "foo-bär@baz.py", 0)
>>> real_stdin = sys.stdin
>>> sys.stdin = _FakeInput([
... 'list', # list source from example 2
@@ -1735,7 +1811,7 @@ def test_pdb_set_trace():
... finally: sys.stdin = real_stdin
... # doctest: +NORMALIZE_WHITESPACE
--Return--
- > <doctest foo[1]>(3)g()->None
+ > <doctest foo-bär@baz[1]>(3)g()->None
-> import pdb; pdb.set_trace()
(Pdb) list
1 def g(x):
@@ -1744,7 +1820,7 @@ def test_pdb_set_trace():
[EOF]
(Pdb) next
--Return--
- > <doctest foo[0]>(2)f()->None
+ > <doctest foo-bär@baz[0]>(2)f()->None
-> g(x*2)
(Pdb) list
1 def f(x):
@@ -1752,14 +1828,14 @@ def test_pdb_set_trace():
[EOF]
(Pdb) next
--Return--
- > <doctest foo[2]>(1)<module>()->None
+ > <doctest foo-bär@baz[2]>(1)<module>()->None
-> f(3)
(Pdb) list
1 -> f(3)
[EOF]
(Pdb) continue
**********************************************************************
- File "foo.py", line 7, in foo
+ File "foo-bär@baz.py", line 7, in foo-bär@baz
Failed example:
f(3)
Expected nothing
@@ -1793,7 +1869,7 @@ def test_pdb_set_trace_nested():
... '''
>>> parser = doctest.DocTestParser()
>>> runner = doctest.DocTestRunner(verbose=False)
- >>> test = parser.get_doctest(doc, globals(), "foo", "foo.py", 0)
+ >>> test = parser.get_doctest(doc, globals(), "foo-bär@baz", "foo-bär@baz.py", 0)
>>> real_stdin = sys.stdin
>>> sys.stdin = _FakeInput([
... 'print y', # print data defined in the function
@@ -1845,7 +1921,7 @@ def test_pdb_set_trace_nested():
(Pdb) print y
1
(Pdb) up
- > <doctest foo[1]>(1)<module>()
+ > <doctest foo-bär@baz[1]>(1)<module>()
-> calls_set_trace()
(Pdb) print foo
*** NameError: name 'foo' is not defined
@@ -1863,19 +1939,19 @@ def test_DocTestSuite():
>>> import test.sample_doctest
>>> suite = doctest.DocTestSuite(test.sample_doctest)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=4>
+ <unittest.result.TestResult run=9 errors=0 failures=4>
We can also supply the module by name:
>>> suite = doctest.DocTestSuite('test.sample_doctest')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=4>
+ <unittest.result.TestResult run=9 errors=0 failures=4>
We can use the current module:
>>> suite = test.sample_doctest.test_suite()
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=4>
+ <unittest.result.TestResult run=9 errors=0 failures=4>
We can supply global variables. If we pass globs, they will be
used instead of the module globals. Here we'll pass an empty
@@ -1883,7 +1959,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest', globs={})
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=5>
+ <unittest.result.TestResult run=9 errors=0 failures=5>
Alternatively, we can provide extra globals. Here we'll make an
error go away by providing an extra global variable:
@@ -1891,7 +1967,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest',
... extraglobs={'y': 1})
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=3>
+ <unittest.result.TestResult run=9 errors=0 failures=3>
You can pass option flags. Here we'll cause an extra error
by disabling the blank-line feature:
@@ -1899,7 +1975,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest',
... optionflags=doctest.DONT_ACCEPT_BLANKLINE)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=5>
+ <unittest.result.TestResult run=9 errors=0 failures=5>
You can supply setUp and tearDown functions:
@@ -1916,7 +1992,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest',
... setUp=setUp, tearDown=tearDown)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=3>
+ <unittest.result.TestResult run=9 errors=0 failures=3>
But the tearDown restores sanity:
@@ -1934,7 +2010,7 @@ def test_DocTestSuite():
>>> suite = doctest.DocTestSuite('test.sample_doctest', setUp=setUp)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=9 errors=0 failures=3>
+ <unittest.result.TestResult run=9 errors=0 failures=3>
Here, we didn't need to use a tearDown function because we
modified the test globals, which are a copy of the
@@ -1953,7 +2029,7 @@ def test_DocFileSuite():
... 'test_doctest2.txt',
... 'test_doctest4.txt')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=3>
+ <unittest.result.TestResult run=3 errors=0 failures=3>
The test files are looked for in the directory containing the
calling module. A package keyword argument can be provided to
@@ -1965,7 +2041,7 @@ def test_DocFileSuite():
... 'test_doctest4.txt',
... package='test')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=3>
+ <unittest.result.TestResult run=3 errors=0 failures=3>
Support for using a package's __loader__.get_data() is also
provided.
@@ -1984,14 +2060,14 @@ def test_DocFileSuite():
... finally:
... if added_loader:
... del test.__loader__
- <unittest.TestResult run=3 errors=0 failures=3>
+ <unittest.result.TestResult run=3 errors=0 failures=3>
'/' should be used as a path separator. It will be converted
to a native separator at run time:
>>> suite = doctest.DocFileSuite('../test/test_doctest.txt')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=1 errors=0 failures=1>
+ <unittest.result.TestResult run=1 errors=0 failures=1>
If DocFileSuite is used from an interactive session, then files
are resolved relative to the directory of sys.argv[0]:
@@ -2016,7 +2092,7 @@ def test_DocFileSuite():
>>> suite = doctest.DocFileSuite(test_file, module_relative=False)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=1 errors=0 failures=1>
+ <unittest.result.TestResult run=1 errors=0 failures=1>
It is an error to specify `package` when `module_relative=False`:
@@ -2032,7 +2108,7 @@ def test_DocFileSuite():
... 'test_doctest4.txt',
... globs={'favorite_color': 'blue'})
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=2>
+ <unittest.result.TestResult run=3 errors=0 failures=2>
In this case, we supplied a missing favorite color. You can
provide doctest options:
@@ -2043,7 +2119,7 @@ def test_DocFileSuite():
... optionflags=doctest.DONT_ACCEPT_BLANKLINE,
... globs={'favorite_color': 'blue'})
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=3>
+ <unittest.result.TestResult run=3 errors=0 failures=3>
And, you can provide setUp and tearDown functions:
@@ -2062,7 +2138,7 @@ def test_DocFileSuite():
... 'test_doctest4.txt',
... setUp=setUp, tearDown=tearDown)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=2>
+ <unittest.result.TestResult run=3 errors=0 failures=2>
But the tearDown restores sanity:
@@ -2081,7 +2157,7 @@ def test_DocFileSuite():
>>> suite = doctest.DocFileSuite('test_doctest.txt', setUp=setUp)
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=1 errors=0 failures=0>
+ <unittest.result.TestResult run=1 errors=0 failures=0>
Here, we didn't need to use a tearDown function because we
modified the test globals. The test globals are
@@ -2093,7 +2169,7 @@ def test_DocFileSuite():
>>> suite = doctest.DocFileSuite('test_doctest3.txt')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=1 errors=0 failures=0>
+ <unittest.result.TestResult run=1 errors=0 failures=0>
If the tests contain non-ASCII characters, we have to specify which
encoding the file is encoded with. We do so by using the `encoding`
@@ -2104,7 +2180,7 @@ def test_DocFileSuite():
... 'test_doctest4.txt',
... encoding='utf-8')
>>> suite.run(unittest.TestResult())
- <unittest.TestResult run=3 errors=0 failures=2>
+ <unittest.result.TestResult run=3 errors=0 failures=2>
"""
@@ -2258,7 +2334,7 @@ optional `module_relative` parameter:
TestResults(failed=0, attempted=2)
>>> doctest.master = None # Reset master.
-Verbosity can be increased with the optional `verbose` paremter:
+Verbosity can be increased with the optional `verbose` parameter:
>>> doctest.testfile('test_doctest.txt', globs=globs, verbose=True)
Trying:
@@ -2295,7 +2371,7 @@ parameter:
TestResults(failed=1, attempted=2)
>>> doctest.master = None # Reset master.
-The summary report may be supressed with the optional `report`
+The summary report may be suppressed with the optional `report`
parameter:
>>> doctest.testfile('test_doctest.txt', report=False)
@@ -2511,6 +2587,7 @@ def test_main():
test_support.run_doctest(doctest, verbosity=True)
from test import test_doctest
+
# Ignore all warnings about the use of class Tester in this module.
deprecations = [("class Tester is deprecated", DeprecationWarning)]
if sys.py3kwarning:
@@ -2520,8 +2597,9 @@ def test_main():
# Check the doctest cases defined here:
test_support.run_doctest(test_doctest, verbosity=True)
-import trace, sys
+import sys
def test_coverage(coverdir):
+ trace = test_support.import_module('trace')
tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,],
trace=0, count=1)
tracer.run('reload(doctest); test_main()')
diff --git a/Lib/test/test_doctest2.py b/Lib/test/test_doctest2.py
index 865a32e6f2..8c043baf5d 100644
--- a/Lib/test/test_doctest2.py
+++ b/Lib/test/test_doctest2.py
@@ -12,7 +12,11 @@ the example. It should be ignored:
"""
+import sys
+import unittest
from test import test_support
+if sys.flags.optimize >= 2:
+ raise unittest.SkipTest("Cannot test docstrings with -O2")
class C(object):
u"""Class C.
diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py
index 13a3a9f83a..716333e67f 100644
--- a/Lib/test/test_docxmlrpc.py
+++ b/Lib/test/test_docxmlrpc.py
@@ -1,14 +1,28 @@
from DocXMLRPCServer import DocXMLRPCServer
import httplib
+import sys
from test import test_support
-import threading
+threading = test_support.import_module('threading')
import time
import socket
import unittest
-import xmlrpclib
PORT = None
+def make_request_and_skipIf(condition, reason):
+ # If we skip the test, we have to make a request because the
+ # the server created in setUp blocks expecting one to come in.
+ if not condition:
+ return lambda func: func
+ def decorator(func):
+ def make_request_and_skip(self):
+ self.client.request("GET", "/")
+ self.client.getresponse()
+ raise unittest.SkipTest(reason)
+ return make_request_and_skip
+ return decorator
+
+
def server(evt, numrequests):
serv = DocXMLRPCServer(("localhost", 0), logRequests=False)
@@ -20,8 +34,8 @@ def server(evt, numrequests):
serv.set_server_title("DocXMLRPCServer Test Documentation")
serv.set_server_name("DocXMLRPCServer Test Docs")
serv.set_server_documentation(
-"""This is an XML-RPC server's documentation, but the server can be used by
-POSTing to /RPC2. Try self.add, too.""")
+ "This is an XML-RPC server's documentation, but the server "
+ "can be used by POSTing to /RPC2. Try self.add, too.")
# Create and register classes and functions
class TestClass(object):
@@ -55,6 +69,7 @@ POSTing to /RPC2. Try self.add, too.""")
class DocXMLRPCHTTPGETServer(unittest.TestCase):
def setUp(self):
+ self._threads = test_support.threading_setup()
# Enable server feedback
DocXMLRPCServer._send_traceback_header = True
@@ -76,6 +91,7 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
# Disable server feedback
DocXMLRPCServer._send_traceback_header = False
+ test_support.threading_cleanup(*self._threads)
def test_valid_get_response(self):
self.client.request("GET", "/")
@@ -106,36 +122,68 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
self.client.request("GET", "/")
response = self.client.getresponse()
- self.assert_(
-"""<dl><dt><a name="-&lt;lambda&gt;"><strong>&lt;lambda&gt;</strong></a>(x, y)</dt></dl>"""
- in response.read())
+ self.assertIn('<dl><dt><a name="-&lt;lambda&gt;"><strong>'
+ '&lt;lambda&gt;</strong></a>(x, y)</dt></dl>',
+ response.read())
+ @make_request_and_skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_autolinking(self):
- """Test that the server correctly automatically wraps references to PEPS
- and RFCs with links, and that it linkifies text starting with http or
- ftp protocol prefixes.
+ """Test that the server correctly automatically wraps references to
+ PEPS and RFCs with links, and that it linkifies text starting with
+ http or ftp protocol prefixes.
The documentation for the "add" method contains the test material.
"""
self.client.request("GET", "/")
response = self.client.getresponse()
- self.assert_( # This is ugly ... how can it be made better?
-"""<dl><dt><a name="-add"><strong>add</strong></a>(x, y)</dt><dd><tt>Add&nbsp;two&nbsp;instances&nbsp;together.&nbsp;This&nbsp;follows&nbsp;<a href="http://www.python.org/dev/peps/pep-0008/">PEP008</a>,&nbsp;but&nbsp;has&nbsp;nothing<br>\nto&nbsp;do&nbsp;with&nbsp;<a href="http://www.rfc-editor.org/rfc/rfc1952.txt">RFC1952</a>.&nbsp;Case&nbsp;should&nbsp;matter:&nbsp;pEp008&nbsp;and&nbsp;rFC1952.&nbsp;&nbsp;Things<br>\nthat&nbsp;start&nbsp;with&nbsp;http&nbsp;and&nbsp;ftp&nbsp;should&nbsp;be&nbsp;auto-linked,&nbsp;too:<br>\n<a href="http://google.com">http://google.com</a>.</tt></dd></dl>"""
- in response.read())
-
+ self.assertIn(
+ ('<dl><dt><a name="-add"><strong>add</strong></a>(x, y)</dt><dd>'
+ '<tt>Add&nbsp;two&nbsp;instances&nbsp;together.&nbsp;This&nbsp;'
+ 'follows&nbsp;<a href="http://www.python.org/dev/peps/pep-0008/">'
+ 'PEP008</a>,&nbsp;but&nbsp;has&nbsp;nothing<br>\nto&nbsp;do&nbsp;'
+ 'with&nbsp;<a href="http://www.rfc-editor.org/rfc/rfc1952.txt">'
+ 'RFC1952</a>.&nbsp;Case&nbsp;should&nbsp;matter:&nbsp;pEp008&nbsp;'
+ 'and&nbsp;rFC1952.&nbsp;&nbsp;Things<br>\nthat&nbsp;start&nbsp;'
+ 'with&nbsp;http&nbsp;and&nbsp;ftp&nbsp;should&nbsp;be&nbsp;'
+ 'auto-linked,&nbsp;too:<br>\n<a href="http://google.com">'
+ 'http://google.com</a>.</tt></dd></dl>'), response.read())
+
+ @make_request_and_skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_system_methods(self):
"""Test the precense of three consecutive system.* methods.
- This also tests their use of parameter type recognition and the systems
- related to that process.
+ This also tests their use of parameter type recognition and the
+ systems related to that process.
"""
self.client.request("GET", "/")
response = self.client.getresponse()
- self.assert_(
-"""<dl><dt><a name="-system.listMethods"><strong>system.listMethods</strong></a>()</dt><dd><tt><a href="#-system.listMethods">system.listMethods</a>()&nbsp;=&gt;&nbsp;[\'add\',&nbsp;\'subtract\',&nbsp;\'multiple\']<br>\n&nbsp;<br>\nReturns&nbsp;a&nbsp;list&nbsp;of&nbsp;the&nbsp;methods&nbsp;supported&nbsp;by&nbsp;the&nbsp;server.</tt></dd></dl>\n <dl><dt><a name="-system.methodHelp"><strong>system.methodHelp</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodHelp">system.methodHelp</a>(\'add\')&nbsp;=&gt;&nbsp;"Adds&nbsp;two&nbsp;integers&nbsp;together"<br>\n&nbsp;<br>\nReturns&nbsp;a&nbsp;string&nbsp;containing&nbsp;documentation&nbsp;for&nbsp;the&nbsp;specified&nbsp;method.</tt></dd></dl>\n <dl><dt><a name="-system.methodSignature"><strong>system.methodSignature</strong></a>(method_name)</dt><dd><tt><a href="#-system.methodSignature">system.methodSignature</a>(\'add\')&nbsp;=&gt;&nbsp;[double,&nbsp;int,&nbsp;int]<br>\n&nbsp;<br>\nReturns&nbsp;a&nbsp;list&nbsp;describing&nbsp;the&nbsp;signature&nbsp;of&nbsp;the&nbsp;method.&nbsp;In&nbsp;the<br>\nabove&nbsp;example,&nbsp;the&nbsp;add&nbsp;method&nbsp;takes&nbsp;two&nbsp;integers&nbsp;as&nbsp;arguments<br>\nand&nbsp;returns&nbsp;a&nbsp;double&nbsp;result.<br>\n&nbsp;<br>\nThis&nbsp;server&nbsp;does&nbsp;NOT&nbsp;support&nbsp;system.methodSignature.</tt></dd></dl>"""
- in response.read())
+ self.assertIn(
+ ('<dl><dt><a name="-system.listMethods"><strong>system.listMethods'
+ '</strong></a>()</dt><dd><tt><a href="#-system.listMethods">system'
+ '.listMethods</a>()&nbsp;=&gt;&nbsp;[\'add\',&nbsp;\'subtract\','
+ '&nbsp;\'multiple\']<br>\n&nbsp;<br>\nReturns&nbsp;a&nbsp;list'
+ '&nbsp;of&nbsp;the&nbsp;methods&nbsp;supported&nbsp;by&nbsp;the'
+ '&nbsp;server.</tt></dd></dl>\n <dl><dt><a name="-system.methodHelp">'
+ '<strong>system.methodHelp</strong></a>(method_name)</dt><dd><tt>'
+ '<a href="#-system.methodHelp">system.methodHelp</a>(\'add\')&nbsp;'
+ '=&gt;&nbsp;"Adds&nbsp;two&nbsp;integers&nbsp;together"<br>\n&nbsp;'
+ '<br>\nReturns&nbsp;a&nbsp;string&nbsp;containing&nbsp;documentation'
+ '&nbsp;for&nbsp;the&nbsp;specified&nbsp;method.</tt></dd></dl>\n '
+ '<dl><dt><a name="-system.methodSignature"><strong>system.'
+ 'methodSignature</strong></a>(method_name)</dt><dd><tt><a href="#-'
+ 'system.methodSignature">system.methodSignature</a>(\'add\')&nbsp;'
+ '=&gt;&nbsp;[double,&nbsp;int,&nbsp;int]<br>\n&nbsp;<br>\nReturns'
+ '&nbsp;a&nbsp;list&nbsp;describing&nbsp;the&nbsp;signature&nbsp;of'
+ '&nbsp;the&nbsp;method.&nbsp;In&nbsp;the<br>\nabove&nbsp;example,'
+ '&nbsp;the&nbsp;add&nbsp;method&nbsp;takes&nbsp;two&nbsp;integers'
+ '&nbsp;as&nbsp;arguments<br>\nand&nbsp;returns&nbsp;a&nbsp;double'
+ '&nbsp;result.<br>\n&nbsp;<br>\nThis&nbsp;server&nbsp;does&nbsp;'
+ 'NOT&nbsp;support&nbsp;system.methodSignature.</tt></dd></dl>'),
+ response.read())
def test_autolink_dotted_methods(self):
"""Test that selfdot values are made strong automatically in the
@@ -143,8 +191,8 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase):
self.client.request("GET", "/")
response = self.client.getresponse()
- self.assert_("""Try&nbsp;self.<strong>add</strong>,&nbsp;too.""" in
- response.read())
+ self.assertIn("""Try&nbsp;self.<strong>add</strong>,&nbsp;too.""",
+ response.read())
def test_main():
test_support.run_unittest(DocXMLRPCHTTPGETServer)
diff --git a/Lib/test/test_dummy_thread.py b/Lib/test/test_dummy_thread.py
index 58faeb4289..d9bdd3c3c0 100644
--- a/Lib/test/test_dummy_thread.py
+++ b/Lib/test/test_dummy_thread.py
@@ -24,43 +24,43 @@ class LockTests(unittest.TestCase):
def test_initlock(self):
#Make sure locks start locked
- self.failUnless(not self.lock.locked(),
+ self.assertTrue(not self.lock.locked(),
"Lock object is not initialized unlocked.")
def test_release(self):
# Test self.lock.release()
self.lock.acquire()
self.lock.release()
- self.failUnless(not self.lock.locked(),
+ self.assertTrue(not self.lock.locked(),
"Lock object did not release properly.")
def test_improper_release(self):
#Make sure release of an unlocked thread raises _thread.error
- self.failUnlessRaises(_thread.error, self.lock.release)
+ self.assertRaises(_thread.error, self.lock.release)
def test_cond_acquire_success(self):
#Make sure the conditional acquiring of the lock works.
- self.failUnless(self.lock.acquire(0),
+ self.assertTrue(self.lock.acquire(0),
"Conditional acquiring of the lock failed.")
def test_cond_acquire_fail(self):
#Test acquiring locked lock returns False
self.lock.acquire(0)
- self.failUnless(not self.lock.acquire(0),
+ self.assertTrue(not self.lock.acquire(0),
"Conditional acquiring of a locked lock incorrectly "
"succeeded.")
def test_uncond_acquire_success(self):
#Make sure unconditional acquiring of a lock works.
self.lock.acquire()
- self.failUnless(self.lock.locked(),
+ self.assertTrue(self.lock.locked(),
"Uncondional locking failed.")
def test_uncond_acquire_return_val(self):
#Make sure that an unconditional locking returns True.
- self.failUnless(self.lock.acquire(1) is True,
+ self.assertTrue(self.lock.acquire(1) is True,
"Unconditional locking did not return True.")
- self.failUnless(self.lock.acquire() is True)
+ self.assertTrue(self.lock.acquire() is True)
def test_uncond_acquire_blocking(self):
#Make sure that unconditional acquiring of a locked lock blocks.
@@ -80,7 +80,7 @@ class LockTests(unittest.TestCase):
end_time = int(time.time())
if test_support.verbose:
print "done"
- self.failUnless((end_time - start_time) >= DELAY,
+ self.assertTrue((end_time - start_time) >= DELAY,
"Blocking by unconditional acquiring failed.")
class MiscTests(unittest.TestCase):
@@ -88,33 +88,33 @@ class MiscTests(unittest.TestCase):
def test_exit(self):
#Make sure _thread.exit() raises SystemExit
- self.failUnlessRaises(SystemExit, _thread.exit)
+ self.assertRaises(SystemExit, _thread.exit)
def test_ident(self):
#Test sanity of _thread.get_ident()
- self.failUnless(isinstance(_thread.get_ident(), int),
- "_thread.get_ident() returned a non-integer")
- self.failUnless(_thread.get_ident() != 0,
+ self.assertIsInstance(_thread.get_ident(), int,
+ "_thread.get_ident() returned a non-integer")
+ self.assertTrue(_thread.get_ident() != 0,
"_thread.get_ident() returned 0")
def test_LockType(self):
#Make sure _thread.LockType is the same type as _thread.allocate_locke()
- self.failUnless(isinstance(_thread.allocate_lock(), _thread.LockType),
- "_thread.LockType is not an instance of what is "
- "returned by _thread.allocate_lock()")
+ self.assertIsInstance(_thread.allocate_lock(), _thread.LockType,
+ "_thread.LockType is not an instance of what "
+ "is returned by _thread.allocate_lock()")
def test_interrupt_main(self):
#Calling start_new_thread with a function that executes interrupt_main
# should raise KeyboardInterrupt upon completion.
def call_interrupt():
_thread.interrupt_main()
- self.failUnlessRaises(KeyboardInterrupt, _thread.start_new_thread,
+ self.assertRaises(KeyboardInterrupt, _thread.start_new_thread,
call_interrupt, tuple())
def test_interrupt_in_main(self):
# Make sure that if interrupt_main is called in main threat that
# KeyboardInterrupt is raised instantly.
- self.failUnlessRaises(KeyboardInterrupt, _thread.interrupt_main)
+ self.assertRaises(KeyboardInterrupt, _thread.interrupt_main)
class ThreadTests(unittest.TestCase):
"""Test thread creation."""
@@ -128,16 +128,16 @@ class ThreadTests(unittest.TestCase):
testing_queue = Queue.Queue(1)
_thread.start_new_thread(arg_tester, (testing_queue, True, True))
result = testing_queue.get()
- self.failUnless(result[0] and result[1],
+ self.assertTrue(result[0] and result[1],
"Argument passing for thread creation using tuple failed")
_thread.start_new_thread(arg_tester, tuple(), {'queue':testing_queue,
'arg1':True, 'arg2':True})
result = testing_queue.get()
- self.failUnless(result[0] and result[1],
+ self.assertTrue(result[0] and result[1],
"Argument passing for thread creation using kwargs failed")
_thread.start_new_thread(arg_tester, (testing_queue, True), {'arg2':True})
result = testing_queue.get()
- self.failUnless(result[0] and result[1],
+ self.assertTrue(result[0] and result[1],
"Argument passing for thread creation using both tuple"
" and kwargs failed")
@@ -164,7 +164,7 @@ class ThreadTests(unittest.TestCase):
time.sleep(DELAY)
if test_support.verbose:
print 'done'
- self.failUnless(testing_queue.qsize() == thread_count,
+ self.assertTrue(testing_queue.qsize() == thread_count,
"Not all %s threads executed properly after %s sec." %
(thread_count, DELAY))
diff --git a/Lib/test/test_enumerate.py b/Lib/test/test_enumerate.py
index 3522b4f3fa..6b9ff79aa1 100644
--- a/Lib/test/test_enumerate.py
+++ b/Lib/test/test_enumerate.py
@@ -103,6 +103,7 @@ class EnumerateTestCase(unittest.TestCase):
self.assertRaises(TypeError, self.enum, 'abc', 'a') # wrong type
self.assertRaises(TypeError, self.enum, 'abc', 2, 3) # too many arguments
+ @test_support.cpython_only
def test_tuple_reuse(self):
# Tests an implementation detail where tuple is reused
# whenever nothing else holds a reference to it
@@ -141,10 +142,17 @@ class TestReversed(unittest.TestCase):
# don't allow keyword arguments
self.assertRaises(TypeError, reversed, [], a=1)
+ def test_classic_class(self):
+ class A:
+ def __reversed__(self):
+ return [2, 1]
+ self.assertEqual(list(reversed(A())), [2, 1])
+
def test_xrange_optimization(self):
x = xrange(1)
self.assertEqual(type(reversed(x)), type(iter(x)))
+ @test_support.cpython_only
def test_len(self):
# This is an implementation detail, not an interface requirement
from test.test_iterlen import len
@@ -198,6 +206,18 @@ class TestReversed(unittest.TestCase):
self.fail("non-callable __reversed__ didn't raise!")
self.assertEqual(rc, sys.getrefcount(r))
+ def test_objmethods(self):
+ # Objects must have __len__() and __getitem__() implemented.
+ class NoLen(object):
+ def __getitem__(self): return 1
+ nl = NoLen()
+ self.assertRaises(TypeError, reversed, nl)
+
+ class NoGetItem(object):
+ def __len__(self): return 2
+ ngi = NoGetItem()
+ self.assertRaises(TypeError, reversed, ngi)
+
class EnumerateStartTestCase(EnumerateTestCase):
diff --git a/Lib/test/test_epoll.py b/Lib/test/test_epoll.py
index aab2c6bbe1..216e2c7134 100644
--- a/Lib/test/test_epoll.py
+++ b/Lib/test/test_epoll.py
@@ -21,23 +21,21 @@
"""
Tests for epoll wrapper.
"""
-import os
import socket
import errno
import time
import select
-import tempfile
import unittest
from test import test_support
if not hasattr(select, "epoll"):
- raise test_support.TestSkipped("test works only on Linux 2.6")
+ raise unittest.SkipTest("test works only on Linux 2.6")
try:
select.epoll()
except IOError, e:
if e.errno == errno.ENOSYS:
- raise test_support.TestSkipped("kernel doesn't support epoll()")
+ raise unittest.SkipTest("kernel doesn't support epoll()")
class TestEPoll(unittest.TestCase):
@@ -58,7 +56,7 @@ class TestEPoll(unittest.TestCase):
try:
client.connect(('127.0.0.1', self.serverSocket.getsockname()[1]))
except socket.error, e:
- self.assertEquals(e.args[0], errno.EINPROGRESS)
+ self.assertEqual(e.args[0], errno.EINPROGRESS)
else:
raise AssertionError("Connect should have raised EINPROGRESS")
server, addr = self.serverSocket.accept()
@@ -71,10 +69,10 @@ class TestEPoll(unittest.TestCase):
ep = select.epoll(16)
except OSError, e:
raise AssertionError(str(e))
- self.assert_(ep.fileno() > 0, ep.fileno())
- self.assert_(not ep.closed)
+ self.assertTrue(ep.fileno() > 0, ep.fileno())
+ self.assertTrue(not ep.closed)
ep.close()
- self.assert_(ep.closed)
+ self.assertTrue(ep.closed)
self.assertRaises(ValueError, ep.fileno)
def test_badcreate(self):
@@ -141,7 +139,7 @@ class TestEPoll(unittest.TestCase):
try:
ep2.poll(1, 4)
except IOError, e:
- self.failUnlessEqual(e.args[0], errno.EBADF, e)
+ self.assertEqual(e.args[0], errno.EBADF, e)
else:
self.fail("epoll on closed fd didn't raise EBADF")
@@ -157,20 +155,20 @@ class TestEPoll(unittest.TestCase):
now = time.time()
events = ep.poll(1, 4)
then = time.time()
- self.failIf(then - now > 0.1, then - now)
+ self.assertFalse(then - now > 0.1, then - now)
events.sort()
expected = [(client.fileno(), select.EPOLLOUT),
(server.fileno(), select.EPOLLOUT)]
expected.sort()
- self.assertEquals(events, expected)
- self.failIf(then - now > 0.01, then - now)
+ self.assertEqual(events, expected)
+ self.assertFalse(then - now > 0.01, then - now)
now = time.time()
events = ep.poll(timeout=2.1, maxevents=4)
then = time.time()
- self.failIf(events)
+ self.assertFalse(events)
client.send("Hello!")
server.send("world!!!")
@@ -178,24 +176,24 @@ class TestEPoll(unittest.TestCase):
now = time.time()
events = ep.poll(1, 4)
then = time.time()
- self.failIf(then - now > 0.01)
+ self.assertFalse(then - now > 0.01)
events.sort()
expected = [(client.fileno(), select.EPOLLIN | select.EPOLLOUT),
(server.fileno(), select.EPOLLIN | select.EPOLLOUT)]
expected.sort()
- self.assertEquals(events, expected)
+ self.assertEqual(events, expected)
ep.unregister(client.fileno())
ep.modify(server.fileno(), select.EPOLLOUT)
now = time.time()
events = ep.poll(1, 4)
then = time.time()
- self.failIf(then - now > 0.01)
+ self.assertFalse(then - now > 0.01)
expected = [(server.fileno(), select.EPOLLOUT)]
- self.assertEquals(events, expected)
+ self.assertEqual(events, expected)
def test_errors(self):
self.assertRaises(ValueError, select.epoll, -2)
@@ -211,7 +209,7 @@ class TestEPoll(unittest.TestCase):
now = time.time()
events = ep.poll(1, 4)
then = time.time()
- self.failIf(then - now > 0.01)
+ self.assertFalse(then - now > 0.01)
server.close()
ep.unregister(fd)
diff --git a/Lib/test/test_errno.py b/Lib/test/test_errno.py
index 95239078c5..bb8918f32f 100755
--- a/Lib/test/test_errno.py
+++ b/Lib/test/test_errno.py
@@ -14,13 +14,13 @@ class ErrnoAttributeTests(unittest.TestCase):
def test_for_improper_attributes(self):
# No unexpected attributes should be on the module.
for error_code in std_c_errors:
- self.assert_(hasattr(errno, error_code),
+ self.assertTrue(hasattr(errno, error_code),
"errno is missing %s" % error_code)
def test_using_errorcode(self):
# Every key value in errno.errorcode should be on the module.
for value in errno.errorcode.itervalues():
- self.assert_(hasattr(errno, value), 'no %s attr in errno' % value)
+ self.assertTrue(hasattr(errno, value), 'no %s attr in errno' % value)
class ErrorcodeTests(unittest.TestCase):
@@ -28,8 +28,8 @@ class ErrorcodeTests(unittest.TestCase):
def test_attributes_in_errorcode(self):
for attribute in errno.__dict__.iterkeys():
if attribute.isupper():
- self.assert_(getattr(errno, attribute) in errno.errorcode,
- 'no %s attr in errno.errorcode' % attribute)
+ self.assertIn(getattr(errno, attribute), errno.errorcode,
+ 'no %s attr in errno.errorcode' % attribute)
def test_main():
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index dcdd885deb..a19c82d066 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -6,7 +6,7 @@ import unittest
import pickle, cPickle
from test.test_support import (TESTFN, unlink, run_unittest, captured_output,
- check_warnings)
+ check_warnings, cpython_only)
from test.test_pep352 import ignore_deprecation_warnings
# XXX This is not really enough, each *operation* should be tested!
@@ -32,8 +32,8 @@ class ExceptionTests(unittest.TestCase):
raise exc("spam")
except exc, err:
buf2 = str(err)
- self.assertEquals(buf1, buf2)
- self.assertEquals(exc.__name__, excname)
+ self.assertEqual(buf1, buf2)
+ self.assertEqual(exc.__name__, excname)
def testRaising(self):
self.raise_catch(AttributeError, "AttributeError")
@@ -147,6 +147,7 @@ class ExceptionTests(unittest.TestCase):
ckmsg(s, "'continue' not properly in loop")
ckmsg("continue\n", "'continue' not properly in loop")
+ @cpython_only
def testSettingException(self):
# test that setting an exception at the C level works even if the
# exception object can't be constructed.
@@ -162,8 +163,8 @@ class ExceptionTests(unittest.TestCase):
except TypeError, err:
exc, err, tb = sys.exc_info()
co = tb.tb_frame.f_code
- self.assertEquals(co.co_name, "test_capi1")
- self.assert_(co.co_filename.endswith('test_exceptions'+os.extsep+'py'))
+ self.assertEqual(co.co_name, "test_capi1")
+ self.assertTrue(co.co_filename.endswith('test_exceptions'+os.extsep+'py'))
else:
self.fail("Expected exception")
@@ -174,10 +175,10 @@ class ExceptionTests(unittest.TestCase):
except RuntimeError, err:
exc, err, tb = sys.exc_info()
co = tb.tb_frame.f_code
- self.assertEquals(co.co_name, "__init__")
- self.assert_(co.co_filename.endswith('test_exceptions'+os.extsep+'py'))
+ self.assertEqual(co.co_name, "__init__")
+ self.assertTrue(co.co_filename.endswith('test_exceptions'+os.extsep+'py'))
co2 = tb.tb_frame.f_back.f_code
- self.assertEquals(co2.co_name, "test_capi2")
+ self.assertEqual(co2.co_name, "test_capi2")
else:
self.fail("Expected exception")
@@ -191,12 +192,12 @@ class ExceptionTests(unittest.TestCase):
except NameError:
pass
else:
- self.failUnlessEqual(str(WindowsError(1001)),
+ self.assertEqual(str(WindowsError(1001)),
"1001")
- self.failUnlessEqual(str(WindowsError(1001, "message")),
+ self.assertEqual(str(WindowsError(1001, "message")),
"[Error 1001] message")
- self.failUnlessEqual(WindowsError(1001, "message").errno, 22)
- self.failUnlessEqual(WindowsError(1001, "message").winerror, 1001)
+ self.assertEqual(WindowsError(1001, "message").errno, 22)
+ self.assertEqual(WindowsError(1001, "message").winerror, 1001)
@ignore_deprecation_warnings
def testAttributes(self):
@@ -283,14 +284,14 @@ class ExceptionTests(unittest.TestCase):
if type(e) is not exc:
raise
# Verify module name
- self.assertEquals(type(e).__module__, 'exceptions')
+ self.assertEqual(type(e).__module__, 'exceptions')
# Verify no ref leaks in Exc_str()
s = str(e)
for checkArgName in expected:
- self.assertEquals(repr(getattr(e, checkArgName)),
- repr(expected[checkArgName]),
- 'exception "%s", attribute "%s"' %
- (repr(e), checkArgName))
+ self.assertEqual(repr(getattr(e, checkArgName)),
+ repr(expected[checkArgName]),
+ 'exception "%s", attribute "%s"' %
+ (repr(e), checkArgName))
# test for pickling support
for p in pickle, cPickle:
@@ -299,9 +300,9 @@ class ExceptionTests(unittest.TestCase):
for checkArgName in expected:
got = repr(getattr(new, checkArgName))
want = repr(expected[checkArgName])
- self.assertEquals(got, want,
- 'pickled "%r", attribute "%s"' %
- (e, checkArgName))
+ self.assertEqual(got, want,
+ 'pickled "%r", attribute "%s"' %
+ (e, checkArgName))
def testDeprecatedMessageAttribute(self):
@@ -323,7 +324,8 @@ class ExceptionTests(unittest.TestCase):
self.assertEqual(len(w.warnings), 0)
# Deleting the message is supported, too.
del exc.message
- self.assertRaises(AttributeError, getattr, exc, "message")
+ with self.assertRaises(AttributeError):
+ exc.message
@ignore_deprecation_warnings
def testPickleMessageAttribute(self):
@@ -343,7 +345,7 @@ class ExceptionTests(unittest.TestCase):
# going through the 'args' attribute.
args = (1, 2, 3)
exc = BaseException(*args)
- self.failUnlessEqual(exc[:], args)
+ self.assertEqual(exc[:], args)
self.assertEqual(exc.args[:], args)
def testKeywordArgs(self):
@@ -357,7 +359,7 @@ class ExceptionTests(unittest.TestCase):
self.fancy_arg = fancy_arg
x = DerivedException(fancy_arg=42)
- self.assertEquals(x.fancy_arg, 42)
+ self.assertEqual(x.fancy_arg, 42)
def testInfiniteRecursion(self):
def f():
@@ -386,11 +388,11 @@ class ExceptionTests(unittest.TestCase):
def testUnicodeStrUsage(self):
# Make sure both instances and classes have a str and unicode
# representation.
- self.failUnless(str(Exception))
- self.failUnless(unicode(Exception))
- self.failUnless(str(Exception('a')))
- self.failUnless(unicode(Exception(u'a')))
- self.failUnless(unicode(Exception(u'\xe1')))
+ self.assertTrue(str(Exception))
+ self.assertTrue(unicode(Exception))
+ self.assertTrue(str(Exception('a')))
+ self.assertTrue(unicode(Exception(u'a')))
+ self.assertTrue(unicode(Exception(u'\xe1')))
def testUnicodeChangeAttributes(self):
# See issue 7309. This was a crasher.
@@ -459,8 +461,8 @@ class ExceptionTests(unittest.TestCase):
except RuntimeError:
return sys.exc_info()
e, v, tb = g()
- self.assert_(e is RuntimeError, e)
- self.assert_("maximum recursion depth exceeded" in str(v), v)
+ self.assertTrue(e is RuntimeError, e)
+ self.assertIn("maximum recursion depth exceeded", str(v))
@@ -570,6 +572,46 @@ class TestSameStrAndUnicodeMsg(unittest.TestCase):
self.assertRaises(UnicodeEncodeError, str, e)
self.assertEqual(unicode(e), u'f\xf6\xf6')
+ @cpython_only
+ def test_exception_with_doc(self):
+ import _testcapi
+ doc2 = "This is a test docstring."
+ doc4 = "This is another test docstring."
+
+ self.assertRaises(SystemError, _testcapi.make_exception_with_doc,
+ "error1")
+
+ # test basic usage of PyErr_NewException
+ error1 = _testcapi.make_exception_with_doc("_testcapi.error1")
+ self.assertIs(type(error1), type)
+ self.assertTrue(issubclass(error1, Exception))
+ self.assertIsNone(error1.__doc__)
+
+ # test with given docstring
+ error2 = _testcapi.make_exception_with_doc("_testcapi.error2", doc2)
+ self.assertEqual(error2.__doc__, doc2)
+
+ # test with explicit base (without docstring)
+ error3 = _testcapi.make_exception_with_doc("_testcapi.error3",
+ base=error2)
+ self.assertTrue(issubclass(error3, error2))
+
+ # test with explicit base tuple
+ class C(object):
+ pass
+ error4 = _testcapi.make_exception_with_doc("_testcapi.error4", doc4,
+ (error3, C))
+ self.assertTrue(issubclass(error4, error3))
+ self.assertTrue(issubclass(error4, C))
+ self.assertEqual(error4.__doc__, doc4)
+
+ # test with explicit dictionary
+ error5 = _testcapi.make_exception_with_doc("_testcapi.error5", "",
+ error4, {'a': 1})
+ self.assertTrue(issubclass(error5, error4))
+ self.assertEqual(error5.a, 1)
+ self.assertEqual(error5.__doc__, "")
+
def test_main():
run_unittest(ExceptionTests, TestSameStrAndUnicodeMsg)
diff --git a/Lib/test/test_extcall.py b/Lib/test/test_extcall.py
index f4ab204279..80e09a0ec2 100644
--- a/Lib/test/test_extcall.py
+++ b/Lib/test/test_extcall.py
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
+
"""Doctest for method/function calls.
We're going the use these types for extra testing
@@ -235,7 +236,7 @@ first argument (got int instance instead)
TypeError: unbound method method() must be called with Foo instance as \
first argument (got int instance instead)
-A PyCFunction that takes only positional parameters shoud allow an
+A PyCFunction that takes only positional parameters should allow an
empty keyword dictionary to pass without a complaint, but raise a
TypeError if te dictionary is not empty
@@ -251,13 +252,50 @@ TypeError if te dictionary is not empty
...
TypeError: id() takes no keyword arguments
+A corner case of keyword dictionary items being deleted during
+the function call setup. See <http://bugs.python.org/issue2016>.
+
+ >>> class Name(str):
+ ... def __eq__(self, other):
+ ... try:
+ ... del x[self]
+ ... except KeyError:
+ ... pass
+ ... return str.__eq__(self, other)
+ ... def __hash__(self):
+ ... return str.__hash__(self)
+
+ >>> x = {Name("a"):1, Name("b"):2}
+ >>> def f(a, b):
+ ... print a,b
+ >>> f(**x)
+ 1 2
+
+A obscure message:
+
+ >>> def f(a, b):
+ ... pass
+ >>> f(b=1)
+ Traceback (most recent call last):
+ ...
+ TypeError: f() takes exactly 2 arguments (1 given)
+
+The number of arguments passed in includes keywords:
+
+ >>> def f(a):
+ ... pass
+ >>> f(6, a=4, *(1, 2, 3))
+ Traceback (most recent call last):
+ ...
+ TypeError: f() takes exactly 1 argument (5 given)
"""
import unittest
+import sys
from test import test_support
-class UnicodeKeywordArgsTest(unittest.TestCase):
+class ExtCallTest(unittest.TestCase):
def test_unicode_keywords(self):
def f(a):
@@ -274,9 +312,8 @@ class UnicodeKeywordArgsTest(unittest.TestCase):
def test_main():
- from test import test_extcall # self import
- test_support.run_doctest(test_extcall, True)
- test_support.run_unittest(UnicodeKeywordArgsTest)
+ test_support.run_doctest(sys.modules[__name__], True)
+ test_support.run_unittest(ExtCallTest)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 350e233026..c8ea7b7ea5 100755..100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -3,12 +3,16 @@
OS/2+EMX doesn't support the file locking operations.
"""
-import fcntl
import os
import struct
import sys
import unittest
-from test.test_support import verbose, TESTFN, unlink, run_unittest
+from test.test_support import (verbose, TESTFN, unlink, run_unittest,
+ import_module)
+
+# Skip test if no fnctl module.
+fcntl = import_module('fcntl')
+
# TODO - Write tests for flock() and lockf().
@@ -89,8 +93,7 @@ class TestFcntl(unittest.TestCase):
# This flag is larger than 2**31 in 64-bit builds
flags = fcntl.DN_MULTISHOT
except AttributeError:
- # F_NOTIFY or DN_MULTISHOT unavailable, skipping
- return
+ self.skipTest("F_NOTIFY or DN_MULTISHOT unavailable")
fd = os.open(os.path.dirname(os.path.abspath(TESTFN)), os.O_RDONLY)
try:
fcntl.fcntl(fd, cmd, flags)
diff --git a/Lib/test/test_file.py b/Lib/test/test_file.py
index 744454832f..dffa4b56eb 100644
--- a/Lib/test/test_file.py
+++ b/Lib/test/test_file.py
@@ -1,21 +1,25 @@
+# NOTE: this file tests the new `io` library backported from Python 3.x.
+# Similar tests for the builtin file object can be found in test_file2k.py.
+
+from __future__ import print_function
+
import sys
import os
import unittest
-import itertools
-import time
-import threading
from array import array
from weakref import proxy
-from test import test_support
-from test.test_support import TESTFN, findfile, run_unittest
+import io
+import _pyio as pyio
+
+from test.test_support import TESTFN, run_unittest
from UserList import UserList
class AutoFileTests(unittest.TestCase):
# file tests for which a test file is automatically set up
def setUp(self):
- self.f = open(TESTFN, 'wb')
+ self.f = self.open(TESTFN, 'wb')
def tearDown(self):
if self.f:
@@ -25,8 +29,8 @@ class AutoFileTests(unittest.TestCase):
def testWeakRefs(self):
# verify weak references
p = proxy(self.f)
- p.write('teststring')
- self.assertEquals(self.f.tell(), p.tell())
+ p.write(b'teststring')
+ self.assertEqual(self.f.tell(), p.tell())
self.f.close()
self.f = None
self.assertRaises(ReferenceError, getattr, p, 'tell')
@@ -34,38 +38,35 @@ class AutoFileTests(unittest.TestCase):
def testAttributes(self):
# verify expected attributes exist
f = self.f
-
f.name # merely shouldn't blow up
f.mode # ditto
f.closed # ditto
- with test_support._check_py3k_warnings(
- ('file.softspace not supported in 3.x', DeprecationWarning)):
- softspace = f.softspace
- # verify softspace is writable
- f.softspace = softspace # merely shouldn't blow up
-
- # verify the others aren't
- for attr in 'name', 'mode', 'closed':
- self.assertRaises((AttributeError, TypeError), setattr, f, attr, 'oops')
-
def testReadinto(self):
# verify readinto
- self.f.write('12')
+ self.f.write(b'12')
self.f.close()
- a = array('c', 'x'*10)
- self.f = open(TESTFN, 'rb')
+ a = array('b', b'x'*10)
+ self.f = self.open(TESTFN, 'rb')
n = self.f.readinto(a)
- self.assertEquals('12', a.tostring()[:n])
+ self.assertEqual(b'12', a.tostring()[:n])
+
+ def testReadinto_text(self):
+ # verify readinto refuses text files
+ a = array('b', b'x'*10)
+ self.f.close()
+ self.f = self.open(TESTFN, 'r')
+ if hasattr(self.f, "readinto"):
+ self.assertRaises(TypeError, self.f.readinto, a)
def testWritelinesUserList(self):
# verify writelines with instance sequence
- l = UserList(['1', '2'])
+ l = UserList([b'1', b'2'])
self.f.writelines(l)
self.f.close()
- self.f = open(TESTFN, 'rb')
+ self.f = self.open(TESTFN, 'rb')
buf = self.f.read()
- self.assertEquals(buf, '12')
+ self.assertEqual(buf, b'12')
def testWritelinesIntegers(self):
# verify writelines with integers
@@ -84,149 +85,96 @@ class AutoFileTests(unittest.TestCase):
self.assertRaises(TypeError, self.f.writelines,
[NonString(), NonString()])
- def testRepr(self):
- # verify repr works
- self.assert_(repr(self.f).startswith("<open file '" + TESTFN))
-
def testErrors(self):
- self.f.close()
- self.f = open(TESTFN, 'rb')
f = self.f
- self.assertEquals(f.name, TESTFN)
- self.assert_(not f.isatty())
- self.assert_(not f.closed)
+ self.assertEqual(f.name, TESTFN)
+ self.assertTrue(not f.isatty())
+ self.assertTrue(not f.closed)
- self.assertRaises(TypeError, f.readinto, "")
+ if hasattr(f, "readinto"):
+ self.assertRaises((IOError, TypeError), f.readinto, "")
f.close()
- self.assert_(f.closed)
+ self.assertTrue(f.closed)
def testMethods(self):
- methods = ['fileno', 'flush', 'isatty', 'next', 'read', 'readinto',
- 'readline', 'readlines', 'seek', 'tell', 'truncate',
- 'write', 'xreadlines', '__iter__']
- if sys.platform.startswith('atheos'):
- methods.remove('truncate')
+ methods = [('fileno', ()),
+ ('flush', ()),
+ ('isatty', ()),
+ ('next', ()),
+ ('read', ()),
+ ('write', (b"",)),
+ ('readline', ()),
+ ('readlines', ()),
+ ('seek', (0,)),
+ ('tell', ()),
+ ('write', (b"",)),
+ ('writelines', ([],)),
+ ('__iter__', ()),
+ ]
+ if not sys.platform.startswith('atheos'):
+ methods.append(('truncate', ()))
# __exit__ should close the file
self.f.__exit__(None, None, None)
- self.assert_(self.f.closed)
+ self.assertTrue(self.f.closed)
- for methodname in methods:
+ for methodname, args in methods:
method = getattr(self.f, methodname)
# should raise on closed file
- with test_support._check_py3k_warnings(quiet=True):
- self.assertRaises(ValueError, method)
- self.assertRaises(ValueError, self.f.writelines, [])
+ self.assertRaises(ValueError, method, *args)
# file is closed, __exit__ shouldn't do anything
- self.assertEquals(self.f.__exit__(None, None, None), None)
+ self.assertEqual(self.f.__exit__(None, None, None), None)
# it must also return None if an exception was given
try:
1 // 0
except:
- self.assertEquals(self.f.__exit__(*sys.exc_info()), None)
+ self.assertEqual(self.f.__exit__(*sys.exc_info()), None)
def testReadWhenWriting(self):
self.assertRaises(IOError, self.f.read)
- def testIssue5677(self):
- # Remark: Do not perform more than one test per open file,
- # since that does NOT catch the readline error on Windows.
- data = 'xxx'
- for mode in ['w', 'wb', 'a', 'ab']:
- for attr in ['read', 'readline', 'readlines']:
- self.f = open(TESTFN, mode)
- self.f.write(data)
- self.assertRaises(IOError, getattr(self.f, attr))
- self.f.close()
-
- self.f = open(TESTFN, mode)
- self.f.write(data)
- self.assertRaises(IOError, lambda: [line for line in self.f])
- self.f.close()
-
- self.f = open(TESTFN, mode)
- self.f.write(data)
- self.assertRaises(IOError, self.f.readinto, bytearray(len(data)))
- self.f.close()
-
- for mode in ['r', 'rb', 'U', 'Ub', 'Ur', 'rU', 'rbU', 'rUb']:
- self.f = open(TESTFN, mode)
- self.assertRaises(IOError, self.f.write, data)
- self.f.close()
+class CAutoFileTests(AutoFileTests):
+ open = io.open
- self.f = open(TESTFN, mode)
- self.assertRaises(IOError, self.f.writelines, [data, data])
- self.f.close()
+class PyAutoFileTests(AutoFileTests):
+ open = staticmethod(pyio.open)
- self.f = open(TESTFN, mode)
- self.assertRaises(IOError, self.f.truncate)
- self.f.close()
class OtherFileTests(unittest.TestCase):
- def testOpenDir(self):
- this_dir = os.path.dirname(__file__)
- for mode in (None, "w"):
- try:
- if mode:
- f = open(this_dir, mode)
- else:
- f = open(this_dir)
- except IOError as e:
- self.assertEqual(e.filename, this_dir)
- else:
- self.fail("opening a directory didn't raise an IOError")
-
def testModeStrings(self):
# check invalid mode strings
for mode in ("", "aU", "wU+"):
try:
- f = open(TESTFN, mode)
+ f = self.open(TESTFN, mode)
except ValueError:
pass
else:
f.close()
self.fail('%r is an invalid file mode' % mode)
- # Some invalid modes fail on Windows, but pass on Unix
- # Issue3965: avoid a crash on Windows when filename is unicode
- for name in (TESTFN, unicode(TESTFN), unicode(TESTFN + '\t')):
- try:
- f = open(name, "rr")
- except IOError:
- pass
- else:
- f.close()
-
def testStdin(self):
# This causes the interpreter to exit on OSF1 v5.1.
if sys.platform != 'osf1V5':
- self.assertRaises(IOError, sys.stdin.seek, -1)
+ self.assertRaises((IOError, ValueError), sys.stdin.seek, -1)
else:
- print >>sys.__stdout__, (
+ print((
' Skipping sys.stdin.seek(-1), it may crash the interpreter.'
- ' Test manually.')
- self.assertRaises(IOError, sys.stdin.truncate)
-
- def testUnicodeOpen(self):
- # verify repr works for unicode too
- f = open(unicode(TESTFN), "w")
- self.assert_(repr(f).startswith("<open file u'" + TESTFN))
- f.close()
- os.unlink(TESTFN)
+ ' Test manually.'), file=sys.__stdout__)
+ self.assertRaises((IOError, ValueError), sys.stdin.truncate)
def testBadModeArgument(self):
# verify that we get a sensible error message for bad mode argument
bad_mode = "qwerty"
try:
- f = open(TESTFN, bad_mode)
- except ValueError, msg:
+ f = self.open(TESTFN, bad_mode)
+ except ValueError as msg:
if msg.args[0] != 0:
s = str(msg)
if TESTFN in s or bad_mode not in s:
self.fail("bad error message for invalid mode: %s" % s)
- # if msg[0] == 0, we're probably on Windows where there may be
+ # if msg.args[0] == 0, we're probably on Windows where there may be
# no obvious way to discover why open() failed.
else:
f.close()
@@ -237,31 +185,32 @@ class OtherFileTests(unittest.TestCase):
# misbehaviour especially with repeated close() calls
for s in (-1, 0, 1, 512):
try:
- f = open(TESTFN, 'w', s)
- f.write(str(s))
+ f = self.open(TESTFN, 'wb', s)
+ f.write(str(s).encode("ascii"))
f.close()
f.close()
- f = open(TESTFN, 'r', s)
- d = int(f.read())
+ f = self.open(TESTFN, 'rb', s)
+ d = int(f.read().decode("ascii"))
f.close()
f.close()
- except IOError, msg:
+ except IOError as msg:
self.fail('error setting buffer size %d: %s' % (s, str(msg)))
- self.assertEquals(d, s)
+ self.assertEqual(d, s)
def testTruncateOnWindows(self):
+ # SF bug <http://www.python.org/sf/801631>
+ # "file.truncate fault on windows"
+
os.unlink(TESTFN)
+ f = self.open(TESTFN, 'wb')
- def bug801631():
- # SF bug <http://www.python.org/sf/801631>
- # "file.truncate fault on windows"
- f = open(TESTFN, 'wb')
- f.write('12345678901') # 11 bytes
+ try:
+ f.write(b'12345678901') # 11 bytes
f.close()
- f = open(TESTFN,'rb+')
+ f = self.open(TESTFN,'rb+')
data = f.read(5)
- if data != '12345':
+ if data != b'12345':
self.fail("Read on file opened for update failed %r" % data)
if f.tell() != 5:
self.fail("File pos after read wrong %d" % f.tell())
@@ -274,56 +223,42 @@ class OtherFileTests(unittest.TestCase):
size = os.path.getsize(TESTFN)
if size != 5:
self.fail("File size after ftruncate wrong %d" % size)
-
- try:
- bug801631()
finally:
+ f.close()
os.unlink(TESTFN)
def testIteration(self):
# Test the complex interaction when mixing file-iteration and the
- # various read* methods. Ostensibly, the mixture could just be tested
- # to work when it should work according to the Python language,
- # instead of fail when it should fail according to the current CPython
- # implementation. People don't always program Python the way they
- # should, though, and the implemenation might change in subtle ways,
- # so we explicitly test for errors, too; the test will just have to
- # be updated when the implementation changes.
+ # various read* methods.
dataoffset = 16384
- filler = "ham\n"
+ filler = b"ham\n"
assert not dataoffset % len(filler), \
"dataoffset must be multiple of len(filler)"
nchunks = dataoffset // len(filler)
testlines = [
- "spam, spam and eggs\n",
- "eggs, spam, ham and spam\n",
- "saussages, spam, spam and eggs\n",
- "spam, ham, spam and eggs\n",
- "spam, spam, spam, spam, spam, ham, spam\n",
- "wonderful spaaaaaam.\n"
+ b"spam, spam and eggs\n",
+ b"eggs, spam, ham and spam\n",
+ b"saussages, spam, spam and eggs\n",
+ b"spam, ham, spam and eggs\n",
+ b"spam, spam, spam, spam, spam, ham, spam\n",
+ b"wonderful spaaaaaam.\n"
]
methods = [("readline", ()), ("read", ()), ("readlines", ()),
- ("readinto", (array("c", " "*100),))]
+ ("readinto", (array("b", b" "*100),))]
try:
# Prepare the testfile
- bag = open(TESTFN, "w")
+ bag = self.open(TESTFN, "wb")
bag.write(filler * nchunks)
bag.writelines(testlines)
bag.close()
# Test for appropriate errors mixing read* and iteration
for methodname, args in methods:
- f = open(TESTFN)
- if f.next() != filler:
+ f = self.open(TESTFN, 'rb')
+ if next(f) != filler:
self.fail, "Broken testfile"
meth = getattr(f, methodname)
- try:
- meth(*args)
- except ValueError:
- pass
- else:
- self.fail("%s%r after next() didn't raise ValueError" %
- (methodname, args))
+ meth(*args) # This simply shouldn't fail
f.close()
# Test to see if harmless (by accident) mixing of read* and
@@ -333,9 +268,9 @@ class OtherFileTests(unittest.TestCase):
# ("h", "a", "m", "\n"), so 4096 lines of that should get us
# exactly on the buffer boundary for any power-of-2 buffersize
# between 4 and 16384 (inclusive).
- f = open(TESTFN)
+ f = self.open(TESTFN, 'rb')
for i in range(nchunks):
- f.next()
+ next(f)
testline = testlines.pop(0)
try:
line = f.readline()
@@ -346,7 +281,7 @@ class OtherFileTests(unittest.TestCase):
self.fail("readline() after next() with empty buffer "
"failed. Got %r, expected %r" % (line, testline))
testline = testlines.pop(0)
- buf = array("c", "\x00" * len(testline))
+ buf = array("b", b"\x00" * len(testline))
try:
f.readinto(buf)
except ValueError:
@@ -375,7 +310,7 @@ class OtherFileTests(unittest.TestCase):
self.fail("readlines() after next() with empty buffer "
"failed. Got %r, expected %r" % (line, testline))
# Reading after iteration hit EOF shouldn't hurt either
- f = open(TESTFN)
+ f = self.open(TESTFN, 'rb')
try:
for line in f:
pass
@@ -391,232 +326,19 @@ class OtherFileTests(unittest.TestCase):
finally:
os.unlink(TESTFN)
-class FileSubclassTests(unittest.TestCase):
+class COtherFileTests(OtherFileTests):
+ open = io.open
- def testExit(self):
- # test that exiting with context calls subclass' close
- class C(file):
- def __init__(self, *args):
- self.subclass_closed = False
- file.__init__(self, *args)
- def close(self):
- self.subclass_closed = True
- file.close(self)
-
- with C(TESTFN, 'w') as f:
- pass
- self.failUnless(f.subclass_closed)
-
-
-class FileThreadingTests(unittest.TestCase):
- # These tests check the ability to call various methods of file objects
- # (including close()) concurrently without crashing the Python interpreter.
- # See #815646, #595601
-
- def setUp(self):
- self.f = None
- self.filename = TESTFN
- with open(self.filename, "w") as f:
- f.write("\n".join("0123456789"))
- self._count_lock = threading.Lock()
- self.close_count = 0
- self.close_success_count = 0
- self.use_buffering = False
-
- def tearDown(self):
- if self.f:
- try:
- self.f.close()
- except (EnvironmentError, ValueError):
- pass
- try:
- os.remove(self.filename)
- except EnvironmentError:
- pass
-
- def _create_file(self):
- if self.use_buffering:
- self.f = open(self.filename, "w+", buffering=1024*16)
- else:
- self.f = open(self.filename, "w+")
-
- def _close_file(self):
- with self._count_lock:
- self.close_count += 1
- self.f.close()
- with self._count_lock:
- self.close_success_count += 1
-
- def _close_and_reopen_file(self):
- self._close_file()
- # if close raises an exception thats fine, self.f remains valid so
- # we don't need to reopen.
- self._create_file()
-
- def _run_workers(self, func, nb_workers, duration=0.2):
- with self._count_lock:
- self.close_count = 0
- self.close_success_count = 0
- self.do_continue = True
- threads = []
- try:
- for i in range(nb_workers):
- t = threading.Thread(target=func)
- t.start()
- threads.append(t)
- for _ in xrange(100):
- time.sleep(duration/100)
- with self._count_lock:
- if self.close_count-self.close_success_count > nb_workers+1:
- if test_support.verbose:
- print 'Q',
- break
- time.sleep(duration)
- finally:
- self.do_continue = False
- for t in threads:
- t.join()
-
- def _test_close_open_io(self, io_func, nb_workers=5):
- def worker():
- self._create_file()
- funcs = itertools.cycle((
- lambda: io_func(),
- lambda: self._close_and_reopen_file(),
- ))
- for f in funcs:
- if not self.do_continue:
- break
- try:
- f()
- except (IOError, ValueError):
- pass
- self._run_workers(worker, nb_workers)
- if test_support.verbose:
- # Useful verbose statistics when tuning this test to take
- # less time to run but still ensuring that its still useful.
- #
- # the percent of close calls that raised an error
- percent = 100. - 100.*self.close_success_count/self.close_count
- print self.close_count, ('%.4f ' % percent),
-
- def test_close_open(self):
- def io_func():
- pass
- self._test_close_open_io(io_func)
-
- def test_close_open_flush(self):
- def io_func():
- self.f.flush()
- self._test_close_open_io(io_func)
-
- def test_close_open_iter(self):
- def io_func():
- list(iter(self.f))
- self._test_close_open_io(io_func)
-
- def test_close_open_isatty(self):
- def io_func():
- self.f.isatty()
- self._test_close_open_io(io_func)
-
- def test_close_open_print(self):
- def io_func():
- print >> self.f, ''
- self._test_close_open_io(io_func)
-
- def test_close_open_print_buffered(self):
- self.use_buffering = True
- def io_func():
- print >> self.f, ''
- self._test_close_open_io(io_func)
-
- def test_close_open_read(self):
- def io_func():
- self.f.read(0)
- self._test_close_open_io(io_func)
-
- def test_close_open_readinto(self):
- def io_func():
- a = array('c', 'xxxxx')
- self.f.readinto(a)
- self._test_close_open_io(io_func)
-
- def test_close_open_readline(self):
- def io_func():
- self.f.readline()
- self._test_close_open_io(io_func)
-
- def test_close_open_readlines(self):
- def io_func():
- self.f.readlines()
- self._test_close_open_io(io_func)
-
- def test_close_open_seek(self):
- def io_func():
- self.f.seek(0, 0)
- self._test_close_open_io(io_func)
-
- def test_close_open_tell(self):
- def io_func():
- self.f.tell()
- self._test_close_open_io(io_func)
-
- def test_close_open_truncate(self):
- def io_func():
- self.f.truncate()
- self._test_close_open_io(io_func)
-
- def test_close_open_write(self):
- def io_func():
- self.f.write('')
- self._test_close_open_io(io_func)
-
- def test_close_open_writelines(self):
- def io_func():
- self.f.writelines('')
- self._test_close_open_io(io_func)
-
-
-class StdoutTests(unittest.TestCase):
-
- def test_move_stdout_on_write(self):
- # Issue 3242: sys.stdout can be replaced (and freed) during a
- # print statement; prevent a segfault in this case
- save_stdout = sys.stdout
-
- class File:
- def write(self, data):
- if '\n' in data:
- sys.stdout = save_stdout
-
- try:
- sys.stdout = File()
- print "some text"
- finally:
- sys.stdout = save_stdout
-
- def test_del_stdout_before_print(self):
- # Issue 4597: 'print' with no argument wasn't reporting when
- # sys.stdout was deleted.
- save_stdout = sys.stdout
- del sys.stdout
- try:
- print
- except RuntimeError as e:
- self.assertEquals(str(e), "lost sys.stdout")
- else:
- self.fail("Expected RuntimeError")
- finally:
- sys.stdout = save_stdout
+class PyOtherFileTests(OtherFileTests):
+ open = staticmethod(pyio.open)
def test_main():
# Historically, these tests have been sloppy about removing TESTFN.
# So get rid of it no matter what.
try:
- run_unittest(AutoFileTests, OtherFileTests, FileSubclassTests,
- FileThreadingTests, StdoutTests)
+ run_unittest(CAutoFileTests, PyAutoFileTests,
+ COtherFileTests, PyOtherFileTests)
finally:
if os.path.exists(TESTFN):
os.unlink(TESTFN)
diff --git a/Lib/test/test_file2k.py b/Lib/test/test_file2k.py
new file mode 100644
index 0000000000..399f119b81
--- /dev/null
+++ b/Lib/test/test_file2k.py
@@ -0,0 +1,680 @@
+import sys
+import os
+import unittest
+import itertools
+import time
+from array import array
+from weakref import proxy
+try:
+ import threading
+except ImportError:
+ threading = None
+
+from test import test_support
+from test.test_support import TESTFN, run_unittest
+from UserList import UserList
+
+class AutoFileTests(unittest.TestCase):
+ # file tests for which a test file is automatically set up
+
+ def setUp(self):
+ self.f = open(TESTFN, 'wb')
+
+ def tearDown(self):
+ if self.f:
+ self.f.close()
+ os.remove(TESTFN)
+
+ def testWeakRefs(self):
+ # verify weak references
+ p = proxy(self.f)
+ p.write('teststring')
+ self.assertEqual(self.f.tell(), p.tell())
+ self.f.close()
+ self.f = None
+ self.assertRaises(ReferenceError, getattr, p, 'tell')
+
+ def testAttributes(self):
+ # verify expected attributes exist
+ f = self.f
+ with test_support.check_py3k_warnings():
+ softspace = f.softspace
+ f.name # merely shouldn't blow up
+ f.mode # ditto
+ f.closed # ditto
+
+ with test_support.check_py3k_warnings():
+ # verify softspace is writable
+ f.softspace = softspace # merely shouldn't blow up
+
+ # verify the others aren't
+ for attr in 'name', 'mode', 'closed':
+ self.assertRaises((AttributeError, TypeError), setattr, f, attr, 'oops')
+
+ def testReadinto(self):
+ # verify readinto
+ self.f.write('12')
+ self.f.close()
+ a = array('c', 'x'*10)
+ self.f = open(TESTFN, 'rb')
+ n = self.f.readinto(a)
+ self.assertEqual('12', a.tostring()[:n])
+
+ def testWritelinesUserList(self):
+ # verify writelines with instance sequence
+ l = UserList(['1', '2'])
+ self.f.writelines(l)
+ self.f.close()
+ self.f = open(TESTFN, 'rb')
+ buf = self.f.read()
+ self.assertEqual(buf, '12')
+
+ def testWritelinesIntegers(self):
+ # verify writelines with integers
+ self.assertRaises(TypeError, self.f.writelines, [1, 2, 3])
+
+ def testWritelinesIntegersUserList(self):
+ # verify writelines with integers in UserList
+ l = UserList([1,2,3])
+ self.assertRaises(TypeError, self.f.writelines, l)
+
+ def testWritelinesNonString(self):
+ # verify writelines with non-string object
+ class NonString:
+ pass
+
+ self.assertRaises(TypeError, self.f.writelines,
+ [NonString(), NonString()])
+
+ def testRepr(self):
+ # verify repr works
+ self.assertTrue(repr(self.f).startswith("<open file '" + TESTFN))
+
+ def testErrors(self):
+ self.f.close()
+ self.f = open(TESTFN, 'rb')
+ f = self.f
+ self.assertEqual(f.name, TESTFN)
+ self.assertTrue(not f.isatty())
+ self.assertTrue(not f.closed)
+
+ self.assertRaises(TypeError, f.readinto, "")
+ f.close()
+ self.assertTrue(f.closed)
+
+ def testMethods(self):
+ methods = ['fileno', 'flush', 'isatty', 'next', 'read', 'readinto',
+ 'readline', 'readlines', 'seek', 'tell', 'truncate',
+ 'write', '__iter__']
+ deprecated_methods = ['xreadlines']
+ if sys.platform.startswith('atheos'):
+ methods.remove('truncate')
+
+ # __exit__ should close the file
+ self.f.__exit__(None, None, None)
+ self.assertTrue(self.f.closed)
+
+ for methodname in methods:
+ method = getattr(self.f, methodname)
+ # should raise on closed file
+ self.assertRaises(ValueError, method)
+ with test_support.check_py3k_warnings():
+ for methodname in deprecated_methods:
+ method = getattr(self.f, methodname)
+ self.assertRaises(ValueError, method)
+ self.assertRaises(ValueError, self.f.writelines, [])
+
+ # file is closed, __exit__ shouldn't do anything
+ self.assertEqual(self.f.__exit__(None, None, None), None)
+ # it must also return None if an exception was given
+ try:
+ 1 // 0
+ except:
+ self.assertEqual(self.f.__exit__(*sys.exc_info()), None)
+
+ def testReadWhenWriting(self):
+ self.assertRaises(IOError, self.f.read)
+
+ def testNastyWritelinesGenerator(self):
+ def nasty():
+ for i in range(5):
+ if i == 3:
+ self.f.close()
+ yield str(i)
+ self.assertRaises(ValueError, self.f.writelines, nasty())
+
+ def testIssue5677(self):
+ # Remark: Do not perform more than one test per open file,
+ # since that does NOT catch the readline error on Windows.
+ data = 'xxx'
+ for mode in ['w', 'wb', 'a', 'ab']:
+ for attr in ['read', 'readline', 'readlines']:
+ self.f = open(TESTFN, mode)
+ self.f.write(data)
+ self.assertRaises(IOError, getattr(self.f, attr))
+ self.f.close()
+
+ self.f = open(TESTFN, mode)
+ self.f.write(data)
+ self.assertRaises(IOError, lambda: [line for line in self.f])
+ self.f.close()
+
+ self.f = open(TESTFN, mode)
+ self.f.write(data)
+ self.assertRaises(IOError, self.f.readinto, bytearray(len(data)))
+ self.f.close()
+
+ for mode in ['r', 'rb', 'U', 'Ub', 'Ur', 'rU', 'rbU', 'rUb']:
+ self.f = open(TESTFN, mode)
+ self.assertRaises(IOError, self.f.write, data)
+ self.f.close()
+
+ self.f = open(TESTFN, mode)
+ self.assertRaises(IOError, self.f.writelines, [data, data])
+ self.f.close()
+
+ self.f = open(TESTFN, mode)
+ self.assertRaises(IOError, self.f.truncate)
+ self.f.close()
+
+class OtherFileTests(unittest.TestCase):
+
+ def testOpenDir(self):
+ this_dir = os.path.dirname(__file__) or os.curdir
+ for mode in (None, "w"):
+ try:
+ if mode:
+ f = open(this_dir, mode)
+ else:
+ f = open(this_dir)
+ except IOError as e:
+ self.assertEqual(e.filename, this_dir)
+ else:
+ self.fail("opening a directory didn't raise an IOError")
+
+ def testModeStrings(self):
+ # check invalid mode strings
+ for mode in ("", "aU", "wU+"):
+ try:
+ f = open(TESTFN, mode)
+ except ValueError:
+ pass
+ else:
+ f.close()
+ self.fail('%r is an invalid file mode' % mode)
+
+ # Some invalid modes fail on Windows, but pass on Unix
+ # Issue3965: avoid a crash on Windows when filename is unicode
+ for name in (TESTFN, unicode(TESTFN), unicode(TESTFN + '\t')):
+ try:
+ f = open(name, "rr")
+ except (IOError, ValueError):
+ pass
+ else:
+ f.close()
+
+ def testStdin(self):
+ # This causes the interpreter to exit on OSF1 v5.1.
+ if sys.platform != 'osf1V5':
+ self.assertRaises(IOError, sys.stdin.seek, -1)
+ else:
+ print >>sys.__stdout__, (
+ ' Skipping sys.stdin.seek(-1), it may crash the interpreter.'
+ ' Test manually.')
+ self.assertRaises(IOError, sys.stdin.truncate)
+
+ def testUnicodeOpen(self):
+ # verify repr works for unicode too
+ f = open(unicode(TESTFN), "w")
+ self.assertTrue(repr(f).startswith("<open file u'" + TESTFN))
+ f.close()
+ os.unlink(TESTFN)
+
+ def testBadModeArgument(self):
+ # verify that we get a sensible error message for bad mode argument
+ bad_mode = "qwerty"
+ try:
+ f = open(TESTFN, bad_mode)
+ except ValueError, msg:
+ if msg.args[0] != 0:
+ s = str(msg)
+ if TESTFN in s or bad_mode not in s:
+ self.fail("bad error message for invalid mode: %s" % s)
+ # if msg.args[0] == 0, we're probably on Windows where there may
+ # be no obvious way to discover why open() failed.
+ else:
+ f.close()
+ self.fail("no error for invalid mode: %s" % bad_mode)
+
+ def testSetBufferSize(self):
+ # make sure that explicitly setting the buffer size doesn't cause
+ # misbehaviour especially with repeated close() calls
+ for s in (-1, 0, 1, 512):
+ try:
+ f = open(TESTFN, 'w', s)
+ f.write(str(s))
+ f.close()
+ f.close()
+ f = open(TESTFN, 'r', s)
+ d = int(f.read())
+ f.close()
+ f.close()
+ except IOError, msg:
+ self.fail('error setting buffer size %d: %s' % (s, str(msg)))
+ self.assertEqual(d, s)
+
+ def testTruncateOnWindows(self):
+ os.unlink(TESTFN)
+
+ def bug801631():
+ # SF bug <http://www.python.org/sf/801631>
+ # "file.truncate fault on windows"
+ f = open(TESTFN, 'wb')
+ f.write('12345678901') # 11 bytes
+ f.close()
+
+ f = open(TESTFN,'rb+')
+ data = f.read(5)
+ if data != '12345':
+ self.fail("Read on file opened for update failed %r" % data)
+ if f.tell() != 5:
+ self.fail("File pos after read wrong %d" % f.tell())
+
+ f.truncate()
+ if f.tell() != 5:
+ self.fail("File pos after ftruncate wrong %d" % f.tell())
+
+ f.close()
+ size = os.path.getsize(TESTFN)
+ if size != 5:
+ self.fail("File size after ftruncate wrong %d" % size)
+
+ try:
+ bug801631()
+ finally:
+ os.unlink(TESTFN)
+
+ def testIteration(self):
+ # Test the complex interaction when mixing file-iteration and the
+ # various read* methods. Ostensibly, the mixture could just be tested
+ # to work when it should work according to the Python language,
+ # instead of fail when it should fail according to the current CPython
+ # implementation. People don't always program Python the way they
+ # should, though, and the implemenation might change in subtle ways,
+ # so we explicitly test for errors, too; the test will just have to
+ # be updated when the implementation changes.
+ dataoffset = 16384
+ filler = "ham\n"
+ assert not dataoffset % len(filler), \
+ "dataoffset must be multiple of len(filler)"
+ nchunks = dataoffset // len(filler)
+ testlines = [
+ "spam, spam and eggs\n",
+ "eggs, spam, ham and spam\n",
+ "saussages, spam, spam and eggs\n",
+ "spam, ham, spam and eggs\n",
+ "spam, spam, spam, spam, spam, ham, spam\n",
+ "wonderful spaaaaaam.\n"
+ ]
+ methods = [("readline", ()), ("read", ()), ("readlines", ()),
+ ("readinto", (array("c", " "*100),))]
+
+ try:
+ # Prepare the testfile
+ bag = open(TESTFN, "w")
+ bag.write(filler * nchunks)
+ bag.writelines(testlines)
+ bag.close()
+ # Test for appropriate errors mixing read* and iteration
+ for methodname, args in methods:
+ f = open(TESTFN)
+ if f.next() != filler:
+ self.fail, "Broken testfile"
+ meth = getattr(f, methodname)
+ try:
+ meth(*args)
+ except ValueError:
+ pass
+ else:
+ self.fail("%s%r after next() didn't raise ValueError" %
+ (methodname, args))
+ f.close()
+
+ # Test to see if harmless (by accident) mixing of read* and
+ # iteration still works. This depends on the size of the internal
+ # iteration buffer (currently 8192,) but we can test it in a
+ # flexible manner. Each line in the bag o' ham is 4 bytes
+ # ("h", "a", "m", "\n"), so 4096 lines of that should get us
+ # exactly on the buffer boundary for any power-of-2 buffersize
+ # between 4 and 16384 (inclusive).
+ f = open(TESTFN)
+ for i in range(nchunks):
+ f.next()
+ testline = testlines.pop(0)
+ try:
+ line = f.readline()
+ except ValueError:
+ self.fail("readline() after next() with supposedly empty "
+ "iteration-buffer failed anyway")
+ if line != testline:
+ self.fail("readline() after next() with empty buffer "
+ "failed. Got %r, expected %r" % (line, testline))
+ testline = testlines.pop(0)
+ buf = array("c", "\x00" * len(testline))
+ try:
+ f.readinto(buf)
+ except ValueError:
+ self.fail("readinto() after next() with supposedly empty "
+ "iteration-buffer failed anyway")
+ line = buf.tostring()
+ if line != testline:
+ self.fail("readinto() after next() with empty buffer "
+ "failed. Got %r, expected %r" % (line, testline))
+
+ testline = testlines.pop(0)
+ try:
+ line = f.read(len(testline))
+ except ValueError:
+ self.fail("read() after next() with supposedly empty "
+ "iteration-buffer failed anyway")
+ if line != testline:
+ self.fail("read() after next() with empty buffer "
+ "failed. Got %r, expected %r" % (line, testline))
+ try:
+ lines = f.readlines()
+ except ValueError:
+ self.fail("readlines() after next() with supposedly empty "
+ "iteration-buffer failed anyway")
+ if lines != testlines:
+ self.fail("readlines() after next() with empty buffer "
+ "failed. Got %r, expected %r" % (line, testline))
+ # Reading after iteration hit EOF shouldn't hurt either
+ f = open(TESTFN)
+ try:
+ for line in f:
+ pass
+ try:
+ f.readline()
+ f.readinto(buf)
+ f.read()
+ f.readlines()
+ except ValueError:
+ self.fail("read* failed after next() consumed file")
+ finally:
+ f.close()
+ finally:
+ os.unlink(TESTFN)
+
+class FileSubclassTests(unittest.TestCase):
+
+ def testExit(self):
+ # test that exiting with context calls subclass' close
+ class C(file):
+ def __init__(self, *args):
+ self.subclass_closed = False
+ file.__init__(self, *args)
+ def close(self):
+ self.subclass_closed = True
+ file.close(self)
+
+ with C(TESTFN, 'w') as f:
+ pass
+ self.assertTrue(f.subclass_closed)
+
+
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class FileThreadingTests(unittest.TestCase):
+ # These tests check the ability to call various methods of file objects
+ # (including close()) concurrently without crashing the Python interpreter.
+ # See #815646, #595601
+
+ def setUp(self):
+ self._threads = test_support.threading_setup()
+ self.f = None
+ self.filename = TESTFN
+ with open(self.filename, "w") as f:
+ f.write("\n".join("0123456789"))
+ self._count_lock = threading.Lock()
+ self.close_count = 0
+ self.close_success_count = 0
+ self.use_buffering = False
+
+ def tearDown(self):
+ if self.f:
+ try:
+ self.f.close()
+ except (EnvironmentError, ValueError):
+ pass
+ try:
+ os.remove(self.filename)
+ except EnvironmentError:
+ pass
+ test_support.threading_cleanup(*self._threads)
+
+ def _create_file(self):
+ if self.use_buffering:
+ self.f = open(self.filename, "w+", buffering=1024*16)
+ else:
+ self.f = open(self.filename, "w+")
+
+ def _close_file(self):
+ with self._count_lock:
+ self.close_count += 1
+ self.f.close()
+ with self._count_lock:
+ self.close_success_count += 1
+
+ def _close_and_reopen_file(self):
+ self._close_file()
+ # if close raises an exception thats fine, self.f remains valid so
+ # we don't need to reopen.
+ self._create_file()
+
+ def _run_workers(self, func, nb_workers, duration=0.2):
+ with self._count_lock:
+ self.close_count = 0
+ self.close_success_count = 0
+ self.do_continue = True
+ threads = []
+ try:
+ for i in range(nb_workers):
+ t = threading.Thread(target=func)
+ t.start()
+ threads.append(t)
+ for _ in xrange(100):
+ time.sleep(duration/100)
+ with self._count_lock:
+ if self.close_count-self.close_success_count > nb_workers+1:
+ if test_support.verbose:
+ print 'Q',
+ break
+ time.sleep(duration)
+ finally:
+ self.do_continue = False
+ for t in threads:
+ t.join()
+
+ def _test_close_open_io(self, io_func, nb_workers=5):
+ def worker():
+ self._create_file()
+ funcs = itertools.cycle((
+ lambda: io_func(),
+ lambda: self._close_and_reopen_file(),
+ ))
+ for f in funcs:
+ if not self.do_continue:
+ break
+ try:
+ f()
+ except (IOError, ValueError):
+ pass
+ self._run_workers(worker, nb_workers)
+ if test_support.verbose:
+ # Useful verbose statistics when tuning this test to take
+ # less time to run but still ensuring that its still useful.
+ #
+ # the percent of close calls that raised an error
+ percent = 100. - 100.*self.close_success_count/self.close_count
+ print self.close_count, ('%.4f ' % percent),
+
+ def test_close_open(self):
+ def io_func():
+ pass
+ self._test_close_open_io(io_func)
+
+ def test_close_open_flush(self):
+ def io_func():
+ self.f.flush()
+ self._test_close_open_io(io_func)
+
+ def test_close_open_iter(self):
+ def io_func():
+ list(iter(self.f))
+ self._test_close_open_io(io_func)
+
+ def test_close_open_isatty(self):
+ def io_func():
+ self.f.isatty()
+ self._test_close_open_io(io_func)
+
+ def test_close_open_print(self):
+ def io_func():
+ print >> self.f, ''
+ self._test_close_open_io(io_func)
+
+ def test_close_open_print_buffered(self):
+ self.use_buffering = True
+ def io_func():
+ print >> self.f, ''
+ self._test_close_open_io(io_func)
+
+ def test_close_open_read(self):
+ def io_func():
+ self.f.read(0)
+ self._test_close_open_io(io_func)
+
+ def test_close_open_readinto(self):
+ def io_func():
+ a = array('c', 'xxxxx')
+ self.f.readinto(a)
+ self._test_close_open_io(io_func)
+
+ def test_close_open_readline(self):
+ def io_func():
+ self.f.readline()
+ self._test_close_open_io(io_func)
+
+ def test_close_open_readlines(self):
+ def io_func():
+ self.f.readlines()
+ self._test_close_open_io(io_func)
+
+ def test_close_open_seek(self):
+ def io_func():
+ self.f.seek(0, 0)
+ self._test_close_open_io(io_func)
+
+ def test_close_open_tell(self):
+ def io_func():
+ self.f.tell()
+ self._test_close_open_io(io_func)
+
+ def test_close_open_truncate(self):
+ def io_func():
+ self.f.truncate()
+ self._test_close_open_io(io_func)
+
+ def test_close_open_write(self):
+ def io_func():
+ self.f.write('')
+ self._test_close_open_io(io_func)
+
+ def test_close_open_writelines(self):
+ def io_func():
+ self.f.writelines('')
+ self._test_close_open_io(io_func)
+
+
+class StdoutTests(unittest.TestCase):
+
+ def test_move_stdout_on_write(self):
+ # Issue 3242: sys.stdout can be replaced (and freed) during a
+ # print statement; prevent a segfault in this case
+ save_stdout = sys.stdout
+
+ class File:
+ def write(self, data):
+ if '\n' in data:
+ sys.stdout = save_stdout
+
+ try:
+ sys.stdout = File()
+ print "some text"
+ finally:
+ sys.stdout = save_stdout
+
+ def test_del_stdout_before_print(self):
+ # Issue 4597: 'print' with no argument wasn't reporting when
+ # sys.stdout was deleted.
+ save_stdout = sys.stdout
+ del sys.stdout
+ try:
+ print
+ except RuntimeError as e:
+ self.assertEqual(str(e), "lost sys.stdout")
+ else:
+ self.fail("Expected RuntimeError")
+ finally:
+ sys.stdout = save_stdout
+
+ def test_unicode(self):
+ import subprocess
+
+ def get_message(encoding, *code):
+ code = '\n'.join(code)
+ env = os.environ.copy()
+ env['PYTHONIOENCODING'] = encoding
+ process = subprocess.Popen([sys.executable, "-c", code],
+ stdout=subprocess.PIPE, env=env)
+ stdout, stderr = process.communicate()
+ self.assertEqual(process.returncode, 0)
+ return stdout
+
+ def check_message(text, encoding, expected):
+ stdout = get_message(encoding,
+ "import sys",
+ "sys.stdout.write(%r)" % text,
+ "sys.stdout.flush()")
+ self.assertEqual(stdout, expected)
+
+ # test the encoding
+ check_message(u'15\u20ac', "iso-8859-15", "15\xa4")
+ check_message(u'15\u20ac', "utf-8", '15\xe2\x82\xac')
+ check_message(u'15\u20ac', "utf-16-le", '1\x005\x00\xac\x20')
+
+ # test the error handler
+ check_message(u'15\u20ac', "iso-8859-1:ignore", "15")
+ check_message(u'15\u20ac', "iso-8859-1:replace", "15?")
+ check_message(u'15\u20ac', "iso-8859-1:backslashreplace", "15\\u20ac")
+
+ # test the buffer API
+ for objtype in ('buffer', 'bytearray'):
+ stdout = get_message('ascii',
+ 'import sys',
+ r'sys.stdout.write(%s("\xe9"))' % objtype,
+ 'sys.stdout.flush()')
+ self.assertEqual(stdout, "\xe9")
+
+
+def test_main():
+ # Historically, these tests have been sloppy about removing TESTFN.
+ # So get rid of it no matter what.
+ try:
+ run_unittest(AutoFileTests, OtherFileTests, FileSubclassTests,
+ FileThreadingTests, StdoutTests)
+ finally:
+ if os.path.exists(TESTFN):
+ os.unlink(TESTFN)
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_filecmp.py b/Lib/test/test_filecmp.py
index 503562b615..4739ede4ea 100644
--- a/Lib/test/test_filecmp.py
+++ b/Lib/test/test_filecmp.py
@@ -1,5 +1,5 @@
-import os, filecmp, shutil, tempfile, shutil
+import os, filecmp, shutil, tempfile
import unittest
from test import test_support
@@ -25,19 +25,19 @@ class FileCompareTestCase(unittest.TestCase):
os.unlink(self.name_diff)
def test_matching(self):
- self.failUnless(filecmp.cmp(self.name, self.name_same),
+ self.assertTrue(filecmp.cmp(self.name, self.name_same),
"Comparing file to itself fails")
- self.failUnless(filecmp.cmp(self.name, self.name_same, shallow=False),
+ self.assertTrue(filecmp.cmp(self.name, self.name_same, shallow=False),
"Comparing file to itself fails")
- self.failUnless(filecmp.cmp(self.name, self.name, shallow=False),
+ self.assertTrue(filecmp.cmp(self.name, self.name, shallow=False),
"Comparing file to identical file fails")
- self.failUnless(filecmp.cmp(self.name, self.name),
+ self.assertTrue(filecmp.cmp(self.name, self.name),
"Comparing file to identical file fails")
def test_different(self):
- self.failIf(filecmp.cmp(self.name, self.name_diff),
+ self.assertFalse(filecmp.cmp(self.name, self.name_diff),
"Mismatched files compare as equal")
- self.failIf(filecmp.cmp(self.name, self.dir),
+ self.assertFalse(filecmp.cmp(self.name, self.dir),
"File and directory compare as equal")
class DirCompareTestCase(unittest.TestCase):
@@ -69,19 +69,19 @@ class DirCompareTestCase(unittest.TestCase):
shutil.rmtree(self.dir_diff)
def test_cmpfiles(self):
- self.failUnless(filecmp.cmpfiles(self.dir, self.dir, ['file']) ==
+ self.assertTrue(filecmp.cmpfiles(self.dir, self.dir, ['file']) ==
(['file'], [], []),
"Comparing directory to itself fails")
- self.failUnless(filecmp.cmpfiles(self.dir, self.dir_same, ['file']) ==
+ self.assertTrue(filecmp.cmpfiles(self.dir, self.dir_same, ['file']) ==
(['file'], [], []),
"Comparing directory to same fails")
# Try it with shallow=False
- self.failUnless(filecmp.cmpfiles(self.dir, self.dir, ['file'],
+ self.assertTrue(filecmp.cmpfiles(self.dir, self.dir, ['file'],
shallow=False) ==
(['file'], [], []),
"Comparing directory to itself fails")
- self.failUnless(filecmp.cmpfiles(self.dir, self.dir_same, ['file'],
+ self.assertTrue(filecmp.cmpfiles(self.dir, self.dir_same, ['file'],
shallow=False),
"Comparing directory to same fails")
@@ -90,7 +90,7 @@ class DirCompareTestCase(unittest.TestCase):
output.write('Different contents.\n')
output.close()
- self.failIf(filecmp.cmpfiles(self.dir, self.dir_same,
+ self.assertFalse(filecmp.cmpfiles(self.dir, self.dir_same,
['file', 'file2']) ==
(['file'], ['file2'], []),
"Comparing mismatched directories fails")
@@ -103,28 +103,28 @@ class DirCompareTestCase(unittest.TestCase):
self.assertEqual([d.left_list, d.right_list],[['file'], ['FiLe']])
else:
self.assertEqual([d.left_list, d.right_list],[['file'], ['file']])
- self.failUnless(d.common == ['file'])
- self.failUnless(d.left_only == d.right_only == [])
- self.failUnless(d.same_files == ['file'])
- self.failUnless(d.diff_files == [])
+ self.assertTrue(d.common == ['file'])
+ self.assertTrue(d.left_only == d.right_only == [])
+ self.assertTrue(d.same_files == ['file'])
+ self.assertTrue(d.diff_files == [])
# Check attributes for comparison of two different directories
d = filecmp.dircmp(self.dir, self.dir_diff)
- self.failUnless(d.left_list == ['file'])
- self.failUnless(d.right_list == ['file', 'file2'])
- self.failUnless(d.common == ['file'])
- self.failUnless(d.left_only == [])
- self.failUnless(d.right_only == ['file2'])
- self.failUnless(d.same_files == ['file'])
- self.failUnless(d.diff_files == [])
+ self.assertTrue(d.left_list == ['file'])
+ self.assertTrue(d.right_list == ['file', 'file2'])
+ self.assertTrue(d.common == ['file'])
+ self.assertTrue(d.left_only == [])
+ self.assertTrue(d.right_only == ['file2'])
+ self.assertTrue(d.same_files == ['file'])
+ self.assertTrue(d.diff_files == [])
# Add different file2
output = open(os.path.join(self.dir, 'file2'), 'w')
output.write('Different contents.\n')
output.close()
d = filecmp.dircmp(self.dir, self.dir_diff)
- self.failUnless(d.same_files == ['file'])
- self.failUnless(d.diff_files == ['file2'])
+ self.assertTrue(d.same_files == ['file'])
+ self.assertTrue(d.diff_files == ['file2'])
def test_main():
diff --git a/Lib/test/test_fileinput.py b/Lib/test/test_fileinput.py
index 9fb3ea7f7a..84aed1ab0c 100644
--- a/Lib/test/test_fileinput.py
+++ b/Lib/test/test_fileinput.py
@@ -65,8 +65,8 @@ class BufferSizesTests(unittest.TestCase):
self.assertEqual(fi.filename(), t2)
self.assertEqual(fi.lineno(), 21)
self.assertEqual(fi.filelineno(), 6)
- self.failIf(fi.isfirstline())
- self.failIf(fi.isstdin())
+ self.assertFalse(fi.isfirstline())
+ self.assertFalse(fi.isstdin())
if verbose:
print '%s. Nextfile (bs=%s)' % (start+2, bs)
@@ -134,7 +134,7 @@ class FileInputTests(unittest.TestCase):
self.assertEqual(fi.filename(), t3)
line = fi.readline()
- self.failIf(line)
+ self.assertFalse(line)
self.assertEqual(fi.lineno(), 1)
self.assertEqual(fi.filelineno(), 0)
self.assertEqual(fi.filename(), t4)
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
index 7eeef7ba8a..9688ffc08a 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -1,23 +1,26 @@
# Adapted from test_file.py by Daniel Stutzbach
-#from __future__ import unicode_literals
+
+from __future__ import unicode_literals
import sys
import os
+import errno
import unittest
from array import array
from weakref import proxy
+from functools import wraps
-from test.test_support import (TESTFN, findfile, check_warnings, run_unittest,
- make_bad_fd)
-from UserList import UserList
+from test.test_support import TESTFN, check_warnings, run_unittest, make_bad_fd
+from test.test_support import py3k_bytes as bytes
+from test.script_helper import run_python
-import _fileio
+from _io import FileIO as _FileIO
class AutoFileTests(unittest.TestCase):
# file tests for which a test file is automatically set up
def setUp(self):
- self.f = _fileio._FileIO(TESTFN, 'w')
+ self.f = _FileIO(TESTFN, 'w')
def tearDown(self):
if self.f:
@@ -28,31 +31,31 @@ class AutoFileTests(unittest.TestCase):
# verify weak references
p = proxy(self.f)
p.write(bytes(range(10)))
- self.assertEquals(self.f.tell(), p.tell())
+ self.assertEqual(self.f.tell(), p.tell())
self.f.close()
self.f = None
self.assertRaises(ReferenceError, getattr, p, 'tell')
def testSeekTell(self):
- self.f.write(bytes(bytearray(range(20))))
- self.assertEquals(self.f.tell(), 20)
+ self.f.write(bytes(range(20)))
+ self.assertEqual(self.f.tell(), 20)
self.f.seek(0)
- self.assertEquals(self.f.tell(), 0)
+ self.assertEqual(self.f.tell(), 0)
self.f.seek(10)
- self.assertEquals(self.f.tell(), 10)
+ self.assertEqual(self.f.tell(), 10)
self.f.seek(5, 1)
- self.assertEquals(self.f.tell(), 15)
+ self.assertEqual(self.f.tell(), 15)
self.f.seek(-5, 1)
- self.assertEquals(self.f.tell(), 10)
+ self.assertEqual(self.f.tell(), 10)
self.f.seek(-5, 2)
- self.assertEquals(self.f.tell(), 15)
+ self.assertEqual(self.f.tell(), 15)
def testAttributes(self):
# verify expected attributes exist
f = self.f
- self.assertEquals(f.mode, "wb")
- self.assertEquals(f.closed, False)
+ self.assertEqual(f.mode, "wb")
+ self.assertEqual(f.closed, False)
# verify the attributes are readonly
for attr in 'mode', 'closed':
@@ -61,31 +64,44 @@ class AutoFileTests(unittest.TestCase):
def testReadinto(self):
# verify readinto
- self.f.write(bytes(bytearray([1, 2])))
+ self.f.write(b"\x01\x02")
self.f.close()
- a = array('b', b'x'*10)
- self.f = _fileio._FileIO(TESTFN, 'r')
+ a = array(b'b', b'x'*10)
+ self.f = _FileIO(TESTFN, 'r')
n = self.f.readinto(a)
- self.assertEquals(array('b', [1, 2]), a[:n])
+ self.assertEqual(array(b'b', [1, 2]), a[:n])
+
+ def test_none_args(self):
+ self.f.write(b"hi\nbye\nabc")
+ self.f.close()
+ self.f = _FileIO(TESTFN, 'r')
+ self.assertEqual(self.f.read(None), b"hi\nbye\nabc")
+ self.f.seek(0)
+ self.assertEqual(self.f.readline(None), b"hi\n")
+ self.assertEqual(self.f.readlines(None), [b"bye\n", b"abc"])
def testRepr(self):
- self.assertEquals(repr(self.f),
- "_fileio._FileIO(%d, %s)" % (self.f.fileno(),
- repr(self.f.mode)))
+ self.assertEqual(repr(self.f), "<_io.FileIO name=%r mode='%s'>"
+ % (self.f.name, self.f.mode))
+ del self.f.name
+ self.assertEqual(repr(self.f), "<_io.FileIO fd=%r mode='%s'>"
+ % (self.f.fileno(), self.f.mode))
+ self.f.close()
+ self.assertEqual(repr(self.f), "<_io.FileIO [closed]>")
def testErrors(self):
f = self.f
- self.assert_(not f.isatty())
- self.assert_(not f.closed)
- #self.assertEquals(f.name, TESTFN)
+ self.assertTrue(not f.isatty())
+ self.assertTrue(not f.closed)
+ #self.assertEqual(f.name, TESTFN)
self.assertRaises(ValueError, f.read, 10) # Open for reading
f.close()
- self.assert_(f.closed)
- f = _fileio._FileIO(TESTFN, 'r')
+ self.assertTrue(f.closed)
+ f = _FileIO(TESTFN, 'r')
self.assertRaises(TypeError, f.readinto, "")
- self.assert_(not f.closed)
+ self.assertTrue(not f.closed)
f.close()
- self.assert_(f.closed)
+ self.assertTrue(f.closed)
def testMethods(self):
methods = ['fileno', 'isatty', 'read', 'readinto',
@@ -95,7 +111,7 @@ class AutoFileTests(unittest.TestCase):
methods.remove('truncate')
self.f.close()
- self.assert_(self.f.closed)
+ self.assertTrue(self.f.closed)
for methodname in methods:
method = getattr(self.f, methodname)
@@ -107,55 +123,154 @@ class AutoFileTests(unittest.TestCase):
# Windows always returns "[Errno 13]: Permission denied
# Unix calls dircheck() and returns "[Errno 21]: Is a directory"
try:
- _fileio._FileIO('.', 'r')
+ _FileIO('.', 'r')
except IOError as e:
self.assertNotEqual(e.errno, 0)
self.assertEqual(e.filename, ".")
else:
self.fail("Should have raised IOError")
+ #A set of functions testing that we get expected behaviour if someone has
+ #manually closed the internal file descriptor. First, a decorator:
+ def ClosedFD(func):
+ @wraps(func)
+ def wrapper(self):
+ #forcibly close the fd before invoking the problem function
+ f = self.f
+ os.close(f.fileno())
+ try:
+ func(self, f)
+ finally:
+ try:
+ self.f.close()
+ except IOError:
+ pass
+ return wrapper
+
+ def ClosedFDRaises(func):
+ @wraps(func)
+ def wrapper(self):
+ #forcibly close the fd before invoking the problem function
+ f = self.f
+ os.close(f.fileno())
+ try:
+ func(self, f)
+ except IOError as e:
+ self.assertEqual(e.errno, errno.EBADF)
+ else:
+ self.fail("Should have raised IOError")
+ finally:
+ try:
+ self.f.close()
+ except IOError:
+ pass
+ return wrapper
+
+ @ClosedFDRaises
+ def testErrnoOnClose(self, f):
+ f.close()
+
+ @ClosedFDRaises
+ def testErrnoOnClosedWrite(self, f):
+ f.write('a')
+
+ @ClosedFDRaises
+ def testErrnoOnClosedSeek(self, f):
+ f.seek(0)
+
+ @ClosedFDRaises
+ def testErrnoOnClosedTell(self, f):
+ f.tell()
+
+ @ClosedFDRaises
+ def testErrnoOnClosedTruncate(self, f):
+ f.truncate(0)
+
+ @ClosedFD
+ def testErrnoOnClosedSeekable(self, f):
+ f.seekable()
+
+ @ClosedFD
+ def testErrnoOnClosedReadable(self, f):
+ f.readable()
+
+ @ClosedFD
+ def testErrnoOnClosedWritable(self, f):
+ f.writable()
+
+ @ClosedFD
+ def testErrnoOnClosedFileno(self, f):
+ f.fileno()
+
+ @ClosedFD
+ def testErrnoOnClosedIsatty(self, f):
+ self.assertEqual(f.isatty(), False)
+
+ def ReopenForRead(self):
+ try:
+ self.f.close()
+ except IOError:
+ pass
+ self.f = _FileIO(TESTFN, 'r')
+ os.close(self.f.fileno())
+ return self.f
+
+ @ClosedFDRaises
+ def testErrnoOnClosedRead(self, f):
+ f = self.ReopenForRead()
+ f.read(1)
+
+ @ClosedFDRaises
+ def testErrnoOnClosedReadall(self, f):
+ f = self.ReopenForRead()
+ f.readall()
+
+ @ClosedFDRaises
+ def testErrnoOnClosedReadinto(self, f):
+ f = self.ReopenForRead()
+ a = array(b'b', b'x'*10)
+ f.readinto(a)
class OtherFileTests(unittest.TestCase):
def testAbles(self):
try:
- f = _fileio._FileIO(TESTFN, "w")
- self.assertEquals(f.readable(), False)
- self.assertEquals(f.writable(), True)
- self.assertEquals(f.seekable(), True)
+ f = _FileIO(TESTFN, "w")
+ self.assertEqual(f.readable(), False)
+ self.assertEqual(f.writable(), True)
+ self.assertEqual(f.seekable(), True)
f.close()
- f = _fileio._FileIO(TESTFN, "r")
- self.assertEquals(f.readable(), True)
- self.assertEquals(f.writable(), False)
- self.assertEquals(f.seekable(), True)
+ f = _FileIO(TESTFN, "r")
+ self.assertEqual(f.readable(), True)
+ self.assertEqual(f.writable(), False)
+ self.assertEqual(f.seekable(), True)
f.close()
- f = _fileio._FileIO(TESTFN, "a+")
- self.assertEquals(f.readable(), True)
- self.assertEquals(f.writable(), True)
- self.assertEquals(f.seekable(), True)
- self.assertEquals(f.isatty(), False)
+ f = _FileIO(TESTFN, "a+")
+ self.assertEqual(f.readable(), True)
+ self.assertEqual(f.writable(), True)
+ self.assertEqual(f.seekable(), True)
+ self.assertEqual(f.isatty(), False)
f.close()
if sys.platform != "win32":
try:
- f = _fileio._FileIO("/dev/tty", "a")
+ f = _FileIO("/dev/tty", "a")
except EnvironmentError:
# When run in a cron job there just aren't any
# ttys, so skip the test. This also handles other
# OS'es that don't support /dev/tty.
pass
else:
- f = _fileio._FileIO("/dev/tty", "a")
- self.assertEquals(f.readable(), False)
- self.assertEquals(f.writable(), True)
+ self.assertEqual(f.readable(), False)
+ self.assertEqual(f.writable(), True)
if sys.platform != "darwin" and \
'bsd' not in sys.platform and \
not sys.platform.startswith('sunos'):
# Somehow /dev/tty appears seekable on some BSDs
- self.assertEquals(f.seekable(), False)
- self.assertEquals(f.isatty(), True)
+ self.assertEqual(f.seekable(), False)
+ self.assertEqual(f.isatty(), True)
f.close()
finally:
os.unlink(TESTFN)
@@ -164,7 +279,7 @@ class OtherFileTests(unittest.TestCase):
# check invalid mode strings
for mode in ("", "aU", "wU+", "rw", "rt"):
try:
- f = _fileio._FileIO(TESTFN, mode)
+ f = _FileIO(TESTFN, mode)
except ValueError:
pass
else:
@@ -173,19 +288,38 @@ class OtherFileTests(unittest.TestCase):
def testUnicodeOpen(self):
# verify repr works for unicode too
- f = _fileio._FileIO(str(TESTFN), "w")
+ f = _FileIO(str(TESTFN), "w")
f.close()
os.unlink(TESTFN)
+ def testBytesOpen(self):
+ # Opening a bytes filename
+ try:
+ fn = TESTFN.encode("ascii")
+ except UnicodeEncodeError:
+ # Skip test
+ return
+ f = _FileIO(fn, "w")
+ try:
+ f.write(b"abc")
+ f.close()
+ with open(TESTFN, "rb") as f:
+ self.assertEqual(f.read(), b"abc")
+ finally:
+ os.unlink(TESTFN)
+
def testInvalidFd(self):
- self.assertRaises(ValueError, _fileio._FileIO, -10)
- self.assertRaises(OSError, _fileio._FileIO, make_bad_fd())
+ self.assertRaises(ValueError, _FileIO, -10)
+ self.assertRaises(OSError, _FileIO, make_bad_fd())
+ if sys.platform == 'win32':
+ import msvcrt
+ self.assertRaises(IOError, msvcrt.get_osfhandle, make_bad_fd())
def testBadModeArgument(self):
# verify that we get a sensible error message for bad mode argument
bad_mode = "qwerty"
try:
- f = _fileio._FileIO(TESTFN, bad_mode)
+ f = _FileIO(TESTFN, bad_mode)
except ValueError as msg:
if msg.args[0] != 0:
s = str(msg)
@@ -198,7 +332,7 @@ class OtherFileTests(unittest.TestCase):
self.fail("no error for invalid mode: %s" % bad_mode)
def testTruncate(self):
- f = _fileio._FileIO(TESTFN, 'w')
+ f = _FileIO(TESTFN, 'w')
f.write(bytes(bytearray(range(10))))
self.assertEqual(f.tell(), 10)
f.truncate(5)
@@ -207,18 +341,19 @@ class OtherFileTests(unittest.TestCase):
f.truncate(15)
self.assertEqual(f.tell(), 5)
self.assertEqual(f.seek(0, os.SEEK_END), 15)
+ f.close()
def testTruncateOnWindows(self):
def bug801631():
# SF bug <http://www.python.org/sf/801631>
# "file.truncate fault on windows"
- f = _fileio._FileIO(TESTFN, 'w')
- f.write(bytes(bytearray(range(11))))
+ f = _FileIO(TESTFN, 'w')
+ f.write(bytes(range(11)))
f.close()
- f = _fileio._FileIO(TESTFN,'r+')
+ f = _FileIO(TESTFN,'r+')
data = f.read(5)
- if data != bytes(bytearray(range(5))):
+ if data != bytes(range(5)):
self.fail("Read on file opened for update failed %r" % data)
if f.tell() != 5:
self.fail("File pos after read wrong %d" % f.tell())
@@ -256,16 +391,35 @@ class OtherFileTests(unittest.TestCase):
pass
def testInvalidInit(self):
- self.assertRaises(TypeError, _fileio._FileIO, "1", 0, 0)
+ self.assertRaises(TypeError, _FileIO, "1", 0, 0)
def testWarnings(self):
with check_warnings(quiet=True) as w:
self.assertEqual(w.warnings, [])
- self.assertRaises(TypeError, _fileio._FileIO, [])
+ self.assertRaises(TypeError, _FileIO, [])
self.assertEqual(w.warnings, [])
- self.assertRaises(ValueError, _fileio._FileIO, "/some/invalid/name", "rt")
+ self.assertRaises(ValueError, _FileIO, "/some/invalid/name", "rt")
self.assertEqual(w.warnings, [])
+ def test_surrogates(self):
+ # Issue #8438: try to open a filename containing surrogates.
+ # It should either fail because the file doesn't exist or the filename
+ # can't be represented using the filesystem encoding, but not because
+ # of a LookupError for the error handler "surrogateescape".
+ filename = u'\udc80.txt'
+ try:
+ with _FileIO(filename):
+ pass
+ except (UnicodeEncodeError, IOError):
+ pass
+ # Spawn a separate Python process with a different "file system
+ # default encoding", to exercise this further.
+ env = dict(os.environ)
+ env[b'LC_CTYPE'] = b'C'
+ _, out = run_python('-c', 'import _io; _io.FileIO(%r)' % filename, env=env)
+ if ('UnicodeEncodeError' not in out and
+ 'IOError: [Errno 2] No such file or directory' not in out):
+ self.fail('Bad output: %r' % out)
def test_main():
# Historically, these tests have been sloppy about removing TESTFN.
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index 23c0c540bf..eb119ce6f0 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -5,11 +5,27 @@ from test import test_support
import math
from math import isinf, isnan, copysign, ldexp
import operator
-import random, fractions
+import random
+import fractions
+import sys
INF = float("inf")
NAN = float("nan")
+have_getformat = hasattr(float, "__getformat__")
+requires_getformat = unittest.skipUnless(have_getformat,
+ "requires __getformat__")
+requires_setformat = unittest.skipUnless(hasattr(float, "__setformat__"),
+ "requires __setformat__")
+# decorator for skipping tests on non-IEEE 754 platforms
+requires_IEEE_754 = unittest.skipUnless(have_getformat and
+ float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+
+#locate file with float format test values
+test_dir = os.path.dirname(__file__) or os.curdir
+format_testfile = os.path.join(test_dir, 'formatfloat_testcases.txt')
+
class GeneralFloatCases(unittest.TestCase):
def test_float(self):
@@ -24,17 +40,65 @@ class GeneralFloatCases(unittest.TestCase):
self.assertRaises(ValueError, float, "+-3.14")
self.assertRaises(ValueError, float, "-+3.14")
self.assertRaises(ValueError, float, "--3.14")
+ # check that we don't accept alternate exponent markers
+ self.assertRaises(ValueError, float, "-1.7d29")
+ self.assertRaises(ValueError, float, "3D-14")
if test_support.have_unicode:
self.assertEqual(float(unicode(" 3.14 ")), 3.14)
self.assertEqual(float(unicode(" \u0663.\u0661\u0664 ",'raw-unicode-escape')), 3.14)
- # Implementation limitation in PyFloat_FromString()
- self.assertRaises(ValueError, float, unicode("1"*10000))
+
+ # extra long strings should no longer be a problem
+ # (in 2.6, long unicode inputs to float raised ValueError)
+ float('.' + '1'*1000)
+ float(unicode('.' + '1'*1000))
+
+ def check_conversion_to_int(self, x):
+ """Check that int(x) has the correct value and type, for a float x."""
+ n = int(x)
+ if x >= 0.0:
+ # x >= 0 and n = int(x) ==> n <= x < n + 1
+ self.assertLessEqual(n, x)
+ self.assertLess(x, n + 1)
+ else:
+ # x < 0 and n = int(x) ==> n >= x > n - 1
+ self.assertGreaterEqual(n, x)
+ self.assertGreater(x, n - 1)
+
+ # Result should be an int if within range, else a long.
+ if -sys.maxint-1 <= n <= sys.maxint:
+ self.assertEqual(type(n), int)
+ else:
+ self.assertEqual(type(n), long)
+
+ # Double check.
+ self.assertEqual(type(int(n)), type(n))
+
+ def test_conversion_to_int(self):
+ # Check that floats within the range of an int convert to type
+ # int, not long. (issue #11144.)
+ boundary = float(sys.maxint + 1)
+ epsilon = 2**-sys.float_info.mant_dig * boundary
+
+ # These 2 floats are either side of the positive int/long boundary on
+ # both 32-bit and 64-bit systems.
+ self.check_conversion_to_int(boundary - epsilon)
+ self.check_conversion_to_int(boundary)
+
+ # These floats are either side of the negative long/int boundary on
+ # 64-bit systems...
+ self.check_conversion_to_int(-boundary - 2*epsilon)
+ self.check_conversion_to_int(-boundary)
+
+ # ... and these ones are either side of the negative long/int
+ # boundary on 32-bit systems.
+ self.check_conversion_to_int(-boundary - 1.0)
+ self.check_conversion_to_int(-boundary - 1.0 + 2*epsilon)
@test_support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
def test_float_with_comma(self):
# set locale to something that doesn't use '.' for the decimal point
# float must not accept the locale specific decimal point but
- # it still has to accept the normal python syntac
+ # it still has to accept the normal python syntax
import locale
if not locale.localeconv()['decimal_point'] == ',':
return
@@ -133,6 +197,234 @@ class GeneralFloatCases(unittest.TestCase):
self.assertRaises(OverflowError, float('-inf').as_integer_ratio)
self.assertRaises(ValueError, float('nan').as_integer_ratio)
+ def assertEqualAndEqualSign(self, a, b):
+ # fail unless a == b and a and b have the same sign bit;
+ # the only difference from assertEqual is that this test
+ # distinguishes -0.0 and 0.0.
+ self.assertEqual((a, copysign(1.0, a)), (b, copysign(1.0, b)))
+
+ @requires_IEEE_754
+ def test_float_mod(self):
+ # Check behaviour of % operator for IEEE 754 special cases.
+ # In particular, check signs of zeros.
+ mod = operator.mod
+
+ self.assertEqualAndEqualSign(mod(-1.0, 1.0), 0.0)
+ self.assertEqualAndEqualSign(mod(-1e-100, 1.0), 1.0)
+ self.assertEqualAndEqualSign(mod(-0.0, 1.0), 0.0)
+ self.assertEqualAndEqualSign(mod(0.0, 1.0), 0.0)
+ self.assertEqualAndEqualSign(mod(1e-100, 1.0), 1e-100)
+ self.assertEqualAndEqualSign(mod(1.0, 1.0), 0.0)
+
+ self.assertEqualAndEqualSign(mod(-1.0, -1.0), -0.0)
+ self.assertEqualAndEqualSign(mod(-1e-100, -1.0), -1e-100)
+ self.assertEqualAndEqualSign(mod(-0.0, -1.0), -0.0)
+ self.assertEqualAndEqualSign(mod(0.0, -1.0), -0.0)
+ self.assertEqualAndEqualSign(mod(1e-100, -1.0), -1.0)
+ self.assertEqualAndEqualSign(mod(1.0, -1.0), -0.0)
+
+ @requires_IEEE_754
+ def test_float_pow(self):
+ # test builtin pow and ** operator for IEEE 754 special cases.
+ # Special cases taken from section F.9.4.4 of the C99 specification
+
+ for pow_op in pow, operator.pow:
+ # x**NAN is NAN for any x except 1
+ self.assertTrue(isnan(pow_op(-INF, NAN)))
+ self.assertTrue(isnan(pow_op(-2.0, NAN)))
+ self.assertTrue(isnan(pow_op(-1.0, NAN)))
+ self.assertTrue(isnan(pow_op(-0.5, NAN)))
+ self.assertTrue(isnan(pow_op(-0.0, NAN)))
+ self.assertTrue(isnan(pow_op(0.0, NAN)))
+ self.assertTrue(isnan(pow_op(0.5, NAN)))
+ self.assertTrue(isnan(pow_op(2.0, NAN)))
+ self.assertTrue(isnan(pow_op(INF, NAN)))
+ self.assertTrue(isnan(pow_op(NAN, NAN)))
+
+ # NAN**y is NAN for any y except +-0
+ self.assertTrue(isnan(pow_op(NAN, -INF)))
+ self.assertTrue(isnan(pow_op(NAN, -2.0)))
+ self.assertTrue(isnan(pow_op(NAN, -1.0)))
+ self.assertTrue(isnan(pow_op(NAN, -0.5)))
+ self.assertTrue(isnan(pow_op(NAN, 0.5)))
+ self.assertTrue(isnan(pow_op(NAN, 1.0)))
+ self.assertTrue(isnan(pow_op(NAN, 2.0)))
+ self.assertTrue(isnan(pow_op(NAN, INF)))
+
+ # (+-0)**y raises ZeroDivisionError for y a negative odd integer
+ self.assertRaises(ZeroDivisionError, pow_op, -0.0, -1.0)
+ self.assertRaises(ZeroDivisionError, pow_op, 0.0, -1.0)
+
+ # (+-0)**y raises ZeroDivisionError for y finite and negative
+ # but not an odd integer
+ self.assertRaises(ZeroDivisionError, pow_op, -0.0, -2.0)
+ self.assertRaises(ZeroDivisionError, pow_op, -0.0, -0.5)
+ self.assertRaises(ZeroDivisionError, pow_op, 0.0, -2.0)
+ self.assertRaises(ZeroDivisionError, pow_op, 0.0, -0.5)
+
+ # (+-0)**y is +-0 for y a positive odd integer
+ self.assertEqualAndEqualSign(pow_op(-0.0, 1.0), -0.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, 1.0), 0.0)
+
+ # (+-0)**y is 0 for y finite and positive but not an odd integer
+ self.assertEqualAndEqualSign(pow_op(-0.0, 0.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-0.0, 2.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, 0.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, 2.0), 0.0)
+
+ # (-1)**+-inf is 1
+ self.assertEqualAndEqualSign(pow_op(-1.0, -INF), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, INF), 1.0)
+
+ # 1**y is 1 for any y, even if y is an infinity or nan
+ self.assertEqualAndEqualSign(pow_op(1.0, -INF), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -2.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -1.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -0.5), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 0.5), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 1.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 2.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, INF), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, NAN), 1.0)
+
+ # x**+-0 is 1 for any x, even if x is a zero, infinity, or nan
+ self.assertEqualAndEqualSign(pow_op(-INF, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-0.5, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-0.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(INF, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(NAN, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-INF, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-0.5, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-0.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(INF, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(NAN, -0.0), 1.0)
+
+ # x**y raises ValueError for finite negative x and non-integral y
+ self.assertRaises(ValueError, pow_op, -2.0, -0.5)
+ self.assertRaises(ValueError, pow_op, -2.0, 0.5)
+ self.assertRaises(ValueError, pow_op, -1.0, -0.5)
+ self.assertRaises(ValueError, pow_op, -1.0, 0.5)
+ self.assertRaises(ValueError, pow_op, -0.5, -0.5)
+ self.assertRaises(ValueError, pow_op, -0.5, 0.5)
+
+ # x**-INF is INF for abs(x) < 1
+ self.assertEqualAndEqualSign(pow_op(-0.5, -INF), INF)
+ self.assertEqualAndEqualSign(pow_op(-0.0, -INF), INF)
+ self.assertEqualAndEqualSign(pow_op(0.0, -INF), INF)
+ self.assertEqualAndEqualSign(pow_op(0.5, -INF), INF)
+
+ # x**-INF is 0 for abs(x) > 1
+ self.assertEqualAndEqualSign(pow_op(-INF, -INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(INF, -INF), 0.0)
+
+ # x**INF is 0 for abs(x) < 1
+ self.assertEqualAndEqualSign(pow_op(-0.5, INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-0.0, INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.0, INF), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, INF), 0.0)
+
+ # x**INF is INF for abs(x) > 1
+ self.assertEqualAndEqualSign(pow_op(-INF, INF), INF)
+ self.assertEqualAndEqualSign(pow_op(-2.0, INF), INF)
+ self.assertEqualAndEqualSign(pow_op(2.0, INF), INF)
+ self.assertEqualAndEqualSign(pow_op(INF, INF), INF)
+
+ # (-INF)**y is -0.0 for y a negative odd integer
+ self.assertEqualAndEqualSign(pow_op(-INF, -1.0), -0.0)
+
+ # (-INF)**y is 0.0 for y negative but not an odd integer
+ self.assertEqualAndEqualSign(pow_op(-INF, -0.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-INF, -2.0), 0.0)
+
+ # (-INF)**y is -INF for y a positive odd integer
+ self.assertEqualAndEqualSign(pow_op(-INF, 1.0), -INF)
+
+ # (-INF)**y is INF for y positive but not an odd integer
+ self.assertEqualAndEqualSign(pow_op(-INF, 0.5), INF)
+ self.assertEqualAndEqualSign(pow_op(-INF, 2.0), INF)
+
+ # INF**y is INF for y positive
+ self.assertEqualAndEqualSign(pow_op(INF, 0.5), INF)
+ self.assertEqualAndEqualSign(pow_op(INF, 1.0), INF)
+ self.assertEqualAndEqualSign(pow_op(INF, 2.0), INF)
+
+ # INF**y is 0.0 for y negative
+ self.assertEqualAndEqualSign(pow_op(INF, -2.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(INF, -1.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(INF, -0.5), 0.0)
+
+ # basic checks not covered by the special cases above
+ self.assertEqualAndEqualSign(pow_op(-2.0, -2.0), 0.25)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -1.0), -0.5)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, 1.0), -2.0)
+ self.assertEqualAndEqualSign(pow_op(-2.0, 2.0), 4.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -2.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -1.0), -1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 1.0), -1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 2.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -2.0), 0.25)
+ self.assertEqualAndEqualSign(pow_op(2.0, -1.0), 0.5)
+ self.assertEqualAndEqualSign(pow_op(2.0, -0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, 0.0), 1.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, 1.0), 2.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, 2.0), 4.0)
+
+ # 1 ** large and -1 ** large; some libms apparently
+ # have problems with these
+ self.assertEqualAndEqualSign(pow_op(1.0, -1e100), 1.0)
+ self.assertEqualAndEqualSign(pow_op(1.0, 1e100), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, -1e100), 1.0)
+ self.assertEqualAndEqualSign(pow_op(-1.0, 1e100), 1.0)
+
+ # check sign for results that underflow to 0
+ self.assertEqualAndEqualSign(pow_op(-2.0, -2000.0), 0.0)
+ self.assertRaises(ValueError, pow_op, -2.0, -2000.5)
+ self.assertEqualAndEqualSign(pow_op(-2.0, -2001.0), -0.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -2000.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -2000.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(2.0, -2001.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(-0.5, 2000.0), 0.0)
+ self.assertRaises(ValueError, pow_op, -0.5, 2000.5)
+ self.assertEqualAndEqualSign(pow_op(-0.5, 2001.0), -0.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, 2000.0), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, 2000.5), 0.0)
+ self.assertEqualAndEqualSign(pow_op(0.5, 2001.0), 0.0)
+
+ # check we don't raise an exception for subnormal results,
+ # and validate signs. Tests currently disabled, since
+ # they fail on systems where a subnormal result from pow
+ # is flushed to zero (e.g. Debian/ia64.)
+ #self.assertTrue(0.0 < pow_op(0.5, 1048) < 1e-315)
+ #self.assertTrue(0.0 < pow_op(-0.5, 1048) < 1e-315)
+ #self.assertTrue(0.0 < pow_op(0.5, 1047) < 1e-315)
+ #self.assertTrue(0.0 > pow_op(-0.5, 1047) > -1e-315)
+ #self.assertTrue(0.0 < pow_op(2.0, -1048) < 1e-315)
+ #self.assertTrue(0.0 < pow_op(-2.0, -1048) < 1e-315)
+ #self.assertTrue(0.0 < pow_op(2.0, -1047) < 1e-315)
+ #self.assertTrue(0.0 > pow_op(-2.0, -1047) > -1e-315)
+
+
+@requires_setformat
class FormatFunctionsTestCase(unittest.TestCase):
def setUp(self):
@@ -144,10 +436,10 @@ class FormatFunctionsTestCase(unittest.TestCase):
float.__setformat__('float', self.save_formats['float'])
def test_getformat(self):
- self.assert_(float.__getformat__('double') in
- ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
- self.assert_(float.__getformat__('float') in
- ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
+ self.assertIn(float.__getformat__('double'),
+ ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
+ self.assertIn(float.__getformat__('float'),
+ ['unknown', 'IEEE, big-endian', 'IEEE, little-endian'])
self.assertRaises(ValueError, float.__getformat__, 'chicken')
self.assertRaises(TypeError, float.__getformat__, 1)
@@ -183,6 +475,7 @@ LE_FLOAT_NAN = ''.join(reversed(BE_FLOAT_NAN))
# on non-IEEE platforms, attempting to unpack a bit pattern
# representing an infinity or a NaN should raise an exception.
+@requires_setformat
class UnknownFormatTestCase(unittest.TestCase):
def setUp(self):
self.save_formats = {'double':float.__getformat__('double'),
@@ -215,43 +508,119 @@ class UnknownFormatTestCase(unittest.TestCase):
# let's also try to guarantee that -0.0 and 0.0 don't get confused.
class IEEEFormatTestCase(unittest.TestCase):
- if float.__getformat__("double").startswith("IEEE"):
- def test_double_specials_do_unpack(self):
- for fmt, data in [('>d', BE_DOUBLE_INF),
- ('>d', BE_DOUBLE_NAN),
- ('<d', LE_DOUBLE_INF),
- ('<d', LE_DOUBLE_NAN)]:
- struct.unpack(fmt, data)
-
- if float.__getformat__("float").startswith("IEEE"):
- def test_float_specials_do_unpack(self):
- for fmt, data in [('>f', BE_FLOAT_INF),
- ('>f', BE_FLOAT_NAN),
- ('<f', LE_FLOAT_INF),
- ('<f', LE_FLOAT_NAN)]:
- struct.unpack(fmt, data)
-
- if float.__getformat__("double").startswith("IEEE"):
- def test_negative_zero(self):
- import math
- def pos_pos():
- return 0.0, math.atan2(0.0, -1)
- def pos_neg():
- return 0.0, math.atan2(-0.0, -1)
- def neg_pos():
- return -0.0, math.atan2(0.0, -1)
- def neg_neg():
- return -0.0, math.atan2(-0.0, -1)
- self.assertEquals(pos_pos(), neg_pos())
- self.assertEquals(pos_neg(), neg_neg())
-
- if float.__getformat__("double").startswith("IEEE"):
- def test_underflow_sign(self):
- import math
- # check that -1e-1000 gives -0.0, not 0.0
- self.assertEquals(math.atan2(-1e-1000, -1), math.atan2(-0.0, -1))
- self.assertEquals(math.atan2(float('-1e-1000'), -1),
- math.atan2(-0.0, -1))
+
+ @requires_IEEE_754
+ def test_double_specials_do_unpack(self):
+ for fmt, data in [('>d', BE_DOUBLE_INF),
+ ('>d', BE_DOUBLE_NAN),
+ ('<d', LE_DOUBLE_INF),
+ ('<d', LE_DOUBLE_NAN)]:
+ struct.unpack(fmt, data)
+
+ @requires_IEEE_754
+ def test_float_specials_do_unpack(self):
+ for fmt, data in [('>f', BE_FLOAT_INF),
+ ('>f', BE_FLOAT_NAN),
+ ('<f', LE_FLOAT_INF),
+ ('<f', LE_FLOAT_NAN)]:
+ struct.unpack(fmt, data)
+
+ @requires_IEEE_754
+ def test_negative_zero(self):
+ def pos_pos():
+ return 0.0, math.atan2(0.0, -1)
+ def pos_neg():
+ return 0.0, math.atan2(-0.0, -1)
+ def neg_pos():
+ return -0.0, math.atan2(0.0, -1)
+ def neg_neg():
+ return -0.0, math.atan2(-0.0, -1)
+ self.assertEqual(pos_pos(), neg_pos())
+ self.assertEqual(pos_neg(), neg_neg())
+
+ @requires_IEEE_754
+ def test_underflow_sign(self):
+ # check that -1e-1000 gives -0.0, not 0.0
+ self.assertEqual(math.atan2(-1e-1000, -1), math.atan2(-0.0, -1))
+ self.assertEqual(math.atan2(float('-1e-1000'), -1),
+ math.atan2(-0.0, -1))
+
+ def test_format(self):
+ # these should be rewritten to use both format(x, spec) and
+ # x.__format__(spec)
+
+ self.assertEqual(format(0.0, 'f'), '0.000000')
+
+ # the default is 'g', except for empty format spec
+ self.assertEqual(format(0.0, ''), '0.0')
+ self.assertEqual(format(0.01, ''), '0.01')
+ self.assertEqual(format(0.01, 'g'), '0.01')
+
+ # empty presentation type should format in the same way as str
+ # (issue 5920)
+ x = 100/7.
+ self.assertEqual(format(x, ''), str(x))
+ self.assertEqual(format(x, '-'), str(x))
+ self.assertEqual(format(x, '>'), str(x))
+ self.assertEqual(format(x, '2'), str(x))
+
+ self.assertEqual(format(1.0, 'f'), '1.000000')
+
+ self.assertEqual(format(-1.0, 'f'), '-1.000000')
+
+ self.assertEqual(format( 1.0, ' f'), ' 1.000000')
+ self.assertEqual(format(-1.0, ' f'), '-1.000000')
+ self.assertEqual(format( 1.0, '+f'), '+1.000000')
+ self.assertEqual(format(-1.0, '+f'), '-1.000000')
+
+ # % formatting
+ self.assertEqual(format(-1.0, '%'), '-100.000000%')
+
+ # conversion to string should fail
+ self.assertRaises(ValueError, format, 3.0, "s")
+
+ # other format specifiers shouldn't work on floats,
+ # in particular int specifiers
+ for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] +
+ [chr(x) for x in range(ord('A'), ord('Z')+1)]):
+ if not format_spec in 'eEfFgGn%':
+ self.assertRaises(ValueError, format, 0.0, format_spec)
+ self.assertRaises(ValueError, format, 1.0, format_spec)
+ self.assertRaises(ValueError, format, -1.0, format_spec)
+ self.assertRaises(ValueError, format, 1e100, format_spec)
+ self.assertRaises(ValueError, format, -1e100, format_spec)
+ self.assertRaises(ValueError, format, 1e-100, format_spec)
+ self.assertRaises(ValueError, format, -1e-100, format_spec)
+
+ # issue 3382: 'f' and 'F' with inf's and nan's
+ self.assertEqual('{0:f}'.format(INF), 'inf')
+ self.assertEqual('{0:F}'.format(INF), 'INF')
+ self.assertEqual('{0:f}'.format(-INF), '-inf')
+ self.assertEqual('{0:F}'.format(-INF), '-INF')
+ self.assertEqual('{0:f}'.format(NAN), 'nan')
+ self.assertEqual('{0:F}'.format(NAN), 'NAN')
+
+ @requires_IEEE_754
+ def test_format_testfile(self):
+ with open(format_testfile) as testfile:
+ for line in open(format_testfile):
+ if line.startswith('--'):
+ continue
+ line = line.strip()
+ if not line:
+ continue
+
+ lhs, rhs = map(str.strip, line.split('->'))
+ fmt, arg = lhs.split()
+ arg = float(arg)
+ self.assertEqual(fmt % arg, rhs)
+ if not math.isnan(arg) and copysign(1.0, arg) > 0.0:
+ self.assertEqual(fmt % -arg, '-' + rhs)
+
+ def test_issue5864(self):
+ self.assertEqual(format(123.456, '.4'), '123.5')
+ self.assertEqual(format(1234.56, '.4'), '1.235e+03')
+ self.assertEqual(format(12345.6, '.4'), '1.235e+04')
class ReprTestCase(unittest.TestCase):
def test_repr(self):
@@ -265,16 +634,240 @@ class ReprTestCase(unittest.TestCase):
self.assertEqual(v, eval(repr(v)))
floats_file.close()
+ @unittest.skipUnless(getattr(sys, 'float_repr_style', '') == 'short',
+ "applies only when using short float repr style")
+ def test_short_repr(self):
+ # test short float repr introduced in Python 3.1. One aspect
+ # of this repr is that we get some degree of str -> float ->
+ # str roundtripping. In particular, for any numeric string
+ # containing 15 or fewer significant digits, those exact same
+ # digits (modulo trailing zeros) should appear in the output.
+ # No more repr(0.03) -> "0.029999999999999999"!
+
+ test_strings = [
+ # output always includes *either* a decimal point and at
+ # least one digit after that point, or an exponent.
+ '0.0',
+ '1.0',
+ '0.01',
+ '0.02',
+ '0.03',
+ '0.04',
+ '0.05',
+ '1.23456789',
+ '10.0',
+ '100.0',
+ # values >= 1e16 get an exponent...
+ '1000000000000000.0',
+ '9999999999999990.0',
+ '1e+16',
+ '1e+17',
+ # ... and so do values < 1e-4
+ '0.001',
+ '0.001001',
+ '0.00010000000000001',
+ '0.0001',
+ '9.999999999999e-05',
+ '1e-05',
+ # values designed to provoke failure if the FPU rounding
+ # precision isn't set correctly
+ '8.72293771110361e+25',
+ '7.47005307342313e+26',
+ '2.86438000439698e+28',
+ '8.89142905246179e+28',
+ '3.08578087079232e+35',
+ ]
+
+ for s in test_strings:
+ negs = '-'+s
+ self.assertEqual(s, repr(float(s)))
+ self.assertEqual(negs, repr(float(negs)))
+
+
+@requires_IEEE_754
+class RoundTestCase(unittest.TestCase):
+ def test_second_argument_type(self):
+ # any type with an __index__ method should be permitted as
+ # a second argument
+ self.assertAlmostEqual(round(12.34, True), 12.3)
+
+ class MyIndex(object):
+ def __index__(self): return 4
+ self.assertAlmostEqual(round(-0.123456, MyIndex()), -0.1235)
+ # but floats should be illegal
+ self.assertRaises(TypeError, round, 3.14159, 2.0)
+
+ def test_inf_nan(self):
+ # rounding an infinity or nan returns the same number;
+ # (in py3k, rounding an infinity or nan raises an error,
+ # since the result can't be represented as a long).
+ self.assertEqual(round(INF), INF)
+ self.assertEqual(round(-INF), -INF)
+ self.assertTrue(math.isnan(round(NAN)))
+ for n in range(-5, 5):
+ self.assertEqual(round(INF, n), INF)
+ self.assertEqual(round(-INF, n), -INF)
+ self.assertTrue(math.isnan(round(NAN, n)))
+
+ self.assertRaises(TypeError, round, INF, 0.0)
+ self.assertRaises(TypeError, round, -INF, 1.0)
+ self.assertRaises(TypeError, round, NAN, "ceci n'est pas un integer")
+ self.assertRaises(TypeError, round, -0.0, 1j)
+
+ def test_large_n(self):
+ for n in [324, 325, 400, 2**31-1, 2**31, 2**32, 2**100]:
+ self.assertEqual(round(123.456, n), 123.456)
+ self.assertEqual(round(-123.456, n), -123.456)
+ self.assertEqual(round(1e300, n), 1e300)
+ self.assertEqual(round(1e-320, n), 1e-320)
+ self.assertEqual(round(1e150, 300), 1e150)
+ self.assertEqual(round(1e300, 307), 1e300)
+ self.assertEqual(round(-3.1415, 308), -3.1415)
+ self.assertEqual(round(1e150, 309), 1e150)
+ self.assertEqual(round(1.4e-315, 315), 1e-315)
+
+ def test_small_n(self):
+ for n in [-308, -309, -400, 1-2**31, -2**31, -2**31-1, -2**100]:
+ self.assertEqual(round(123.456, n), 0.0)
+ self.assertEqual(round(-123.456, n), -0.0)
+ self.assertEqual(round(1e300, n), 0.0)
+ self.assertEqual(round(1e-320, n), 0.0)
+
+ def test_overflow(self):
+ self.assertRaises(OverflowError, round, 1.6e308, -308)
+ self.assertRaises(OverflowError, round, -1.7e308, -308)
+
+ @unittest.skipUnless(getattr(sys, 'float_repr_style', '') == 'short',
+ "test applies only when using short float repr style")
+ def test_previous_round_bugs(self):
+ # particular cases that have occurred in bug reports
+ self.assertEqual(round(562949953421312.5, 1),
+ 562949953421312.5)
+ self.assertEqual(round(56294995342131.5, 3),
+ 56294995342131.5)
+
+ @unittest.skipUnless(getattr(sys, 'float_repr_style', '') == 'short',
+ "test applies only when using short float repr style")
+ def test_halfway_cases(self):
+ # Halfway cases need special attention, since the current
+ # implementation has to deal with them specially. Note that
+ # 2.x rounds halfway values up (i.e., away from zero) while
+ # 3.x does round-half-to-even.
+ self.assertAlmostEqual(round(0.125, 2), 0.13)
+ self.assertAlmostEqual(round(0.375, 2), 0.38)
+ self.assertAlmostEqual(round(0.625, 2), 0.63)
+ self.assertAlmostEqual(round(0.875, 2), 0.88)
+ self.assertAlmostEqual(round(-0.125, 2), -0.13)
+ self.assertAlmostEqual(round(-0.375, 2), -0.38)
+ self.assertAlmostEqual(round(-0.625, 2), -0.63)
+ self.assertAlmostEqual(round(-0.875, 2), -0.88)
+
+ self.assertAlmostEqual(round(0.25, 1), 0.3)
+ self.assertAlmostEqual(round(0.75, 1), 0.8)
+ self.assertAlmostEqual(round(-0.25, 1), -0.3)
+ self.assertAlmostEqual(round(-0.75, 1), -0.8)
+
+ self.assertEqual(round(-6.5, 0), -7.0)
+ self.assertEqual(round(-5.5, 0), -6.0)
+ self.assertEqual(round(-1.5, 0), -2.0)
+ self.assertEqual(round(-0.5, 0), -1.0)
+ self.assertEqual(round(0.5, 0), 1.0)
+ self.assertEqual(round(1.5, 0), 2.0)
+ self.assertEqual(round(2.5, 0), 3.0)
+ self.assertEqual(round(3.5, 0), 4.0)
+ self.assertEqual(round(4.5, 0), 5.0)
+ self.assertEqual(round(5.5, 0), 6.0)
+ self.assertEqual(round(6.5, 0), 7.0)
+
+ # same but without an explicit second argument; in 3.x these
+ # will give integers
+ self.assertEqual(round(-6.5), -7.0)
+ self.assertEqual(round(-5.5), -6.0)
+ self.assertEqual(round(-1.5), -2.0)
+ self.assertEqual(round(-0.5), -1.0)
+ self.assertEqual(round(0.5), 1.0)
+ self.assertEqual(round(1.5), 2.0)
+ self.assertEqual(round(2.5), 3.0)
+ self.assertEqual(round(3.5), 4.0)
+ self.assertEqual(round(4.5), 5.0)
+ self.assertEqual(round(5.5), 6.0)
+ self.assertEqual(round(6.5), 7.0)
+
+ self.assertEqual(round(-25.0, -1), -30.0)
+ self.assertEqual(round(-15.0, -1), -20.0)
+ self.assertEqual(round(-5.0, -1), -10.0)
+ self.assertEqual(round(5.0, -1), 10.0)
+ self.assertEqual(round(15.0, -1), 20.0)
+ self.assertEqual(round(25.0, -1), 30.0)
+ self.assertEqual(round(35.0, -1), 40.0)
+ self.assertEqual(round(45.0, -1), 50.0)
+ self.assertEqual(round(55.0, -1), 60.0)
+ self.assertEqual(round(65.0, -1), 70.0)
+ self.assertEqual(round(75.0, -1), 80.0)
+ self.assertEqual(round(85.0, -1), 90.0)
+ self.assertEqual(round(95.0, -1), 100.0)
+ self.assertEqual(round(12325.0, -1), 12330.0)
+
+ self.assertEqual(round(350.0, -2), 400.0)
+ self.assertEqual(round(450.0, -2), 500.0)
+
+ self.assertAlmostEqual(round(0.5e21, -21), 1e21)
+ self.assertAlmostEqual(round(1.5e21, -21), 2e21)
+ self.assertAlmostEqual(round(2.5e21, -21), 3e21)
+ self.assertAlmostEqual(round(5.5e21, -21), 6e21)
+ self.assertAlmostEqual(round(8.5e21, -21), 9e21)
+
+ self.assertAlmostEqual(round(-1.5e22, -22), -2e22)
+ self.assertAlmostEqual(round(-0.5e22, -22), -1e22)
+ self.assertAlmostEqual(round(0.5e22, -22), 1e22)
+ self.assertAlmostEqual(round(1.5e22, -22), 2e22)
+
+
+ @requires_IEEE_754
+ def test_format_specials(self):
+ # Test formatting of nans and infs.
+
+ def test(fmt, value, expected):
+ # Test with both % and format().
+ self.assertEqual(fmt % value, expected, fmt)
+ if not '#' in fmt:
+ # Until issue 7094 is implemented, format() for floats doesn't
+ # support '#' formatting
+ fmt = fmt[1:] # strip off the %
+ self.assertEqual(format(value, fmt), expected, fmt)
+
+ for fmt in ['%e', '%f', '%g', '%.0e', '%.6f', '%.20g',
+ '%#e', '%#f', '%#g', '%#.20e', '%#.15f', '%#.3g']:
+ pfmt = '%+' + fmt[1:]
+ sfmt = '% ' + fmt[1:]
+ test(fmt, INF, 'inf')
+ test(fmt, -INF, '-inf')
+ test(fmt, NAN, 'nan')
+ test(fmt, -NAN, 'nan')
+ # When asking for a sign, it's always provided. nans are
+ # always positive.
+ test(pfmt, INF, '+inf')
+ test(pfmt, -INF, '-inf')
+ test(pfmt, NAN, '+nan')
+ test(pfmt, -NAN, '+nan')
+ # When using ' ' for a sign code, only infs can be negative.
+ # Others have a space.
+ test(sfmt, INF, ' inf')
+ test(sfmt, -INF, '-inf')
+ test(sfmt, NAN, ' nan')
+ test(sfmt, -NAN, ' nan')
+
+
# Beginning with Python 2.6 float has cross platform compatible
# ways to create and represent inf and nan
class InfNanTest(unittest.TestCase):
def test_inf_from_str(self):
- self.assert_(isinf(float("inf")))
- self.assert_(isinf(float("+inf")))
- self.assert_(isinf(float("-inf")))
- self.assert_(isinf(float("infinity")))
- self.assert_(isinf(float("+infinity")))
- self.assert_(isinf(float("-infinity")))
+ self.assertTrue(isinf(float("inf")))
+ self.assertTrue(isinf(float("+inf")))
+ self.assertTrue(isinf(float("-inf")))
+ self.assertTrue(isinf(float("infinity")))
+ self.assertTrue(isinf(float("+infinity")))
+ self.assertTrue(isinf(float("-infinity")))
self.assertEqual(repr(float("inf")), "inf")
self.assertEqual(repr(float("+inf")), "inf")
@@ -316,9 +909,9 @@ class InfNanTest(unittest.TestCase):
self.assertEqual(str(-1e300 * 1e300), "-inf")
def test_nan_from_str(self):
- self.assert_(isnan(float("nan")))
- self.assert_(isnan(float("+nan")))
- self.assert_(isnan(float("-nan")))
+ self.assertTrue(isnan(float("nan")))
+ self.assertTrue(isnan(float("+nan")))
+ self.assertTrue(isnan(float("-nan")))
self.assertEqual(repr(float("nan")), "nan")
self.assertEqual(repr(float("+nan")), "nan")
@@ -347,14 +940,23 @@ class InfNanTest(unittest.TestCase):
self.assertEqual(str(-1e300 * 1e300 * 0), "nan")
def notest_float_nan(self):
- self.assert_(NAN.is_nan())
- self.failIf(INF.is_nan())
- self.failIf((0.).is_nan())
+ self.assertTrue(NAN.is_nan())
+ self.assertFalse(INF.is_nan())
+ self.assertFalse((0.).is_nan())
def notest_float_inf(self):
- self.assert_(INF.is_inf())
- self.failIf(NAN.is_inf())
- self.failIf((0.).is_inf())
+ self.assertTrue(INF.is_inf())
+ self.assertFalse(NAN.is_inf())
+ self.assertFalse((0.).is_inf())
+
+ def test_hash_inf(self):
+ # the actual values here should be regarded as an
+ # implementation detail, but they need to be
+ # identical to those used in the Decimal module.
+ self.assertEqual(hash(float('inf')), 314159)
+ self.assertEqual(hash(float('-inf')), -271828)
+ self.assertEqual(hash(float('nan')), 0)
+
fromHex = float.fromhex
toHex = float.hex
@@ -785,6 +1387,7 @@ def test_main():
UnknownFormatTestCase,
IEEEFormatTestCase,
ReprTestCase,
+ RoundTestCase,
InfNanTest,
HexFloatTestCase,
)
diff --git a/Lib/test/test_fnmatch.py b/Lib/test/test_fnmatch.py
index bd67e05f37..37ec50d71a 100644
--- a/Lib/test/test_fnmatch.py
+++ b/Lib/test/test_fnmatch.py
@@ -15,12 +15,12 @@ class FnmatchTestCase(unittest.TestCase):
def check_match(self, filename, pattern, should_match=1, fn=fnmatch):
if should_match:
self.assertTrue(fn(filename, pattern),
- "expected %r to match pattern %r"
- % (filename, pattern))
+ "expected %r to match pattern %r"
+ % (filename, pattern))
else:
self.assertTrue(not fn(filename, pattern),
- "expected %r not to match pattern %r"
- % (filename, pattern))
+ "expected %r not to match pattern %r"
+ % (filename, pattern))
def test_fnmatch(self):
check = self.check_match
@@ -62,7 +62,7 @@ class FnmatchTestCase(unittest.TestCase):
for i in range(_MAXCACHE + 1):
fnmatch('foo', '?' * i)
- self.assertTrue(len(_cache) <= _MAXCACHE)
+ self.assertLessEqual(len(_cache), _MAXCACHE)
def test_main():
test_support.run_unittest(FnmatchTestCase)
diff --git a/Lib/test/test_fork1.py b/Lib/test/test_fork1.py
index 31b4dd8d25..3930667d5c 100644
--- a/Lib/test/test_fork1.py
+++ b/Lib/test/test_fork1.py
@@ -1,21 +1,19 @@
"""This test checks for correct fork() behavior.
"""
-import errno
import imp
import os
import signal
import sys
import time
-import threading
from test.fork_wait import ForkWait
-from test.test_support import TestSkipped, run_unittest, reap_children
+from test.test_support import run_unittest, reap_children, get_attribute, import_module
+threading = import_module('threading')
+
+#Skip test if fork does not exist.
+get_attribute(os, 'fork')
-try:
- os.fork
-except AttributeError:
- raise TestSkipped, "os.fork not defined -- skipping test_fork1"
class ForkTest(ForkWait):
def wait_impl(self, cpid):
diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index cd46bc21c7..f39426b82b 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -10,11 +10,7 @@ maxsize = test_support.MAX_Py_ssize_t
# they crash python)
# test on unicode strings as well
-overflowok = 1
-overflowrequired = 0
-
-
-def testformat(formatstr, args, output=None, limit=None):
+def testformat(formatstr, args, output=None, limit=None, overflowok=False):
if verbose:
if output:
print "%s %% %s =? %s ..." %\
@@ -29,16 +25,11 @@ def testformat(formatstr, args, output=None, limit=None):
if verbose:
print 'overflow (this is fine)'
else:
- if overflowrequired:
- if verbose:
- print 'no'
- print "overflow expected on %s %% %s" % \
- (repr(formatstr), repr(args))
- elif output and limit is None and result != output:
+ if output and limit is None and result != output:
if verbose:
print 'no'
- print "%s %% %s == %s != %s" % \
- (repr(formatstr), repr(args), repr(result), repr(output))
+ raise AssertionError("%r %% %r == %r != %r" %
+ (formatstr, args, result, output))
# when 'limit' is specified, it determines how many characters
# must match exactly; lengths must always match.
# ex: limit=5, '12345678' matches '12345___'
@@ -55,19 +46,27 @@ def testformat(formatstr, args, output=None, limit=None):
print 'yes'
-def testboth(formatstr, *args):
- testformat(formatstr, *args)
+def testboth(formatstr, *args, **kwargs):
+ testformat(formatstr, *args, **kwargs)
if have_unicode:
- testformat(unicode(formatstr), *args)
+ testformat(unicode(formatstr), *args, **kwargs)
class FormatTest(unittest.TestCase):
def test_format(self):
testboth("%.1d", (1,), "1")
- testboth("%.*d", (sys.maxint,1)) # expect overflow
- testboth("%.100d", (1,), '0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001')
- testboth("%#.117x", (1,), '0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001')
- testboth("%#.118x", (1,), '0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001')
+ testboth("%.*d", (sys.maxint,1), overflowok=True) # expect overflow
+ testboth("%.100d", (1,), '00000000000000000000000000000000000000'
+ '000000000000000000000000000000000000000000000000000000'
+ '00000001', overflowok=True)
+ testboth("%#.117x", (1,), '0x00000000000000000000000000000000000'
+ '000000000000000000000000000000000000000000000000000000'
+ '0000000000000000000000000001',
+ overflowok=True)
+ testboth("%#.118x", (1,), '0x00000000000000000000000000000000000'
+ '000000000000000000000000000000000000000000000000000000'
+ '00000000000000000000000000001',
+ overflowok=True)
testboth("%f", (1.0,), "1.000000")
# these are trying to test the limits of the internal magic-number-length
@@ -81,15 +80,14 @@ class FormatTest(unittest.TestCase):
testboth('%12.*f', (123456, 1.0))
# check for internal overflow validation on length of precision
- overflowrequired = 1
+ # these tests should no longer cause overflow in Python
+ # 2.7/3.1 and later.
testboth("%#.*g", (110, -1.e+100/3.))
testboth("%#.*G", (110, -1.e+100/3.))
testboth("%#.*f", (110, -1.e+100/3.))
testboth("%#.*F", (110, -1.e+100/3.))
- overflowrequired = 0
# Formatting of long integers. Overflow is not ok
- overflowok = 0
testboth("%x", 10L, "a")
testboth("%x", 100000000000L, "174876e800")
testboth("%o", 10L, "12")
@@ -232,6 +230,10 @@ class FormatTest(unittest.TestCase):
testboth("%o", -042L, "-42")
testboth("%o", float(042), "42")
+ # alternate float formatting
+ testformat('%g', 1.1, '1.1')
+ testformat('%#g', 1.1, '1.10000')
+
# Test exception for unknown format characters
if verbose:
print 'Testing exceptions'
diff --git a/Lib/test/test_fpformat.py b/Lib/test/test_fpformat.py
index a951cd0458..e6de3b0c11 100644
--- a/Lib/test/test_fpformat.py
+++ b/Lib/test/test_fpformat.py
@@ -26,7 +26,7 @@ class FpformatTest(unittest.TestCase):
n = repr(n)
expected = "%.*f" % (digits, float(n))
- self.assertEquals(result, expected)
+ self.assertEqual(result, expected)
def checkSci(self, n, digits):
result = sci(n, digits)
@@ -39,11 +39,11 @@ class FpformatTest(unittest.TestCase):
exp = exp[0] + "0" + exp[1:]
expected = "%se%s" % (num, exp)
- self.assertEquals(result, expected)
+ self.assertEqual(result, expected)
def test_basic_cases(self):
- self.assertEquals(fix(100.0/3, 3), '33.333')
- self.assertEquals(sci(100.0/3, 3), '3.333e+001')
+ self.assertEqual(fix(100.0/3, 3), '33.333')
+ self.assertEqual(sci(100.0/3, 3), '3.333e+001')
def test_reasonable_values(self):
for d in range(7):
@@ -54,12 +54,12 @@ class FpformatTest(unittest.TestCase):
def test_failing_values(self):
# Now for 'unreasonable n and d'
- self.assertEquals(fix(1.0, 1000), '1.'+('0'*1000))
- self.assertEquals(sci("1"+('0'*1000), 0), '1e+1000')
+ self.assertEqual(fix(1.0, 1000), '1.'+('0'*1000))
+ self.assertEqual(sci("1"+('0'*1000), 0), '1e+1000')
# This behavior is inconsistent. sci raises an exception; fix doesn't.
yacht = "Throatwobbler Mangrove"
- self.assertEquals(fix(yacht, 10), yacht)
+ self.assertEqual(fix(yacht, 10), yacht)
try:
sci(yacht, 10)
except NotANumber:
diff --git a/Lib/test/test_fractions.py b/Lib/test/test_fractions.py
index 0509f92ccb..a798477125 100644
--- a/Lib/test/test_fractions.py
+++ b/Lib/test/test_fractions.py
@@ -3,6 +3,7 @@
from decimal import Decimal
from test.test_support import run_unittest
import math
+import numbers
import operator
import fractions
import unittest
@@ -11,20 +12,95 @@ from cPickle import dumps, loads
F = fractions.Fraction
gcd = fractions.gcd
+# decorator for skipping tests on non-IEEE 754 platforms
+requires_IEEE_754 = unittest.skipUnless(
+ float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+
+class DummyFloat(object):
+ """Dummy float class for testing comparisons with Fractions"""
+
+ def __init__(self, value):
+ if not isinstance(value, float):
+ raise TypeError("DummyFloat can only be initialized from float")
+ self.value = value
+
+ def _richcmp(self, other, op):
+ if isinstance(other, numbers.Rational):
+ return op(F.from_float(self.value), other)
+ elif isinstance(other, DummyFloat):
+ return op(self.value, other.value)
+ else:
+ return NotImplemented
+
+ def __eq__(self, other): return self._richcmp(other, operator.eq)
+ def __le__(self, other): return self._richcmp(other, operator.le)
+ def __lt__(self, other): return self._richcmp(other, operator.lt)
+ def __ge__(self, other): return self._richcmp(other, operator.ge)
+ def __gt__(self, other): return self._richcmp(other, operator.gt)
+
+ # shouldn't be calling __float__ at all when doing comparisons
+ def __float__(self):
+ assert False, "__float__ should not be invoked for comparisons"
+
+ # same goes for subtraction
+ def __sub__(self, other):
+ assert False, "__sub__ should not be invoked for comparisons"
+ __rsub__ = __sub__
+
+ # Silence Py3k warning
+ __hash__ = None
+
+
+class DummyRational(object):
+ """Test comparison of Fraction with a naive rational implementation."""
+
+ def __init__(self, num, den):
+ g = gcd(num, den)
+ self.num = num // g
+ self.den = den // g
+
+ def __eq__(self, other):
+ if isinstance(other, fractions.Fraction):
+ return (self.num == other._numerator and
+ self.den == other._denominator)
+ else:
+ return NotImplemented
+
+ def __lt__(self, other):
+ return(self.num * other._denominator < self.den * other._numerator)
+
+ def __gt__(self, other):
+ return(self.num * other._denominator > self.den * other._numerator)
+
+ def __le__(self, other):
+ return(self.num * other._denominator <= self.den * other._numerator)
+
+ def __ge__(self, other):
+ return(self.num * other._denominator >= self.den * other._numerator)
+
+ # this class is for testing comparisons; conversion to float
+ # should never be used for a comparison, since it loses accuracy
+ def __float__(self):
+ assert False, "__float__ should not be invoked"
+
+ # Silence Py3k warning
+ __hash__ = None
+
class GcdTest(unittest.TestCase):
def testMisc(self):
- self.assertEquals(0, gcd(0, 0))
- self.assertEquals(1, gcd(1, 0))
- self.assertEquals(-1, gcd(-1, 0))
- self.assertEquals(1, gcd(0, 1))
- self.assertEquals(-1, gcd(0, -1))
- self.assertEquals(1, gcd(7, 1))
- self.assertEquals(-1, gcd(7, -1))
- self.assertEquals(1, gcd(-23, 15))
- self.assertEquals(12, gcd(120, 84))
- self.assertEquals(-12, gcd(84, -120))
+ self.assertEqual(0, gcd(0, 0))
+ self.assertEqual(1, gcd(1, 0))
+ self.assertEqual(-1, gcd(-1, 0))
+ self.assertEqual(1, gcd(0, 1))
+ self.assertEqual(-1, gcd(0, -1))
+ self.assertEqual(1, gcd(7, 1))
+ self.assertEqual(-1, gcd(7, -1))
+ self.assertEqual(1, gcd(-23, 15))
+ self.assertEqual(12, gcd(120, 84))
+ self.assertEqual(-12, gcd(84, -120))
def _components(r):
@@ -35,8 +111,8 @@ class FractionTest(unittest.TestCase):
def assertTypedEquals(self, expected, actual):
"""Asserts that both the types and values are the same."""
- self.assertEquals(type(expected), type(actual))
- self.assertEquals(expected, actual)
+ self.assertEqual(type(expected), type(actual))
+ self.assertEqual(expected, actual)
def assertRaisesMessage(self, exc_type, message,
callable, *args, **kwargs):
@@ -44,42 +120,73 @@ class FractionTest(unittest.TestCase):
try:
callable(*args, **kwargs)
except exc_type, e:
- self.assertEquals(message, str(e))
+ self.assertEqual(message, str(e))
else:
self.fail("%s not raised" % exc_type.__name__)
def testInit(self):
- self.assertEquals((0, 1), _components(F()))
- self.assertEquals((7, 1), _components(F(7)))
- self.assertEquals((7, 3), _components(F(F(7, 3))))
+ self.assertEqual((0, 1), _components(F()))
+ self.assertEqual((7, 1), _components(F(7)))
+ self.assertEqual((7, 3), _components(F(F(7, 3))))
+
+ self.assertEqual((-1, 1), _components(F(-1, 1)))
+ self.assertEqual((-1, 1), _components(F(1, -1)))
+ self.assertEqual((1, 1), _components(F(-2, -2)))
+ self.assertEqual((1, 2), _components(F(5, 10)))
+ self.assertEqual((7, 15), _components(F(7, 15)))
+ self.assertEqual((10**23, 1), _components(F(10**23)))
- self.assertEquals((-1, 1), _components(F(-1, 1)))
- self.assertEquals((-1, 1), _components(F(1, -1)))
- self.assertEquals((1, 1), _components(F(-2, -2)))
- self.assertEquals((1, 2), _components(F(5, 10)))
- self.assertEquals((7, 15), _components(F(7, 15)))
- self.assertEquals((10**23, 1), _components(F(10**23)))
+ self.assertEqual((3, 77), _components(F(F(3, 7), 11)))
+ self.assertEqual((-9, 5), _components(F(2, F(-10, 9))))
+ self.assertEqual((2486, 2485), _components(F(F(22, 7), F(355, 113))))
self.assertRaisesMessage(ZeroDivisionError, "Fraction(12, 0)",
F, 12, 0)
- self.assertRaises(TypeError, F, 1.5)
self.assertRaises(TypeError, F, 1.5 + 3j)
- self.assertRaises(TypeError, F, F(1, 2), 3)
self.assertRaises(TypeError, F, "3/2", 3)
+ self.assertRaises(TypeError, F, 3, 0j)
+ self.assertRaises(TypeError, F, 3, 1j)
+
+ @requires_IEEE_754
+ def testInitFromFloat(self):
+ self.assertEqual((5, 2), _components(F(2.5)))
+ self.assertEqual((0, 1), _components(F(-0.0)))
+ self.assertEqual((3602879701896397, 36028797018963968),
+ _components(F(0.1)))
+ self.assertRaises(TypeError, F, float('nan'))
+ self.assertRaises(TypeError, F, float('inf'))
+ self.assertRaises(TypeError, F, float('-inf'))
+
+ def testInitFromDecimal(self):
+ self.assertEqual((11, 10),
+ _components(F(Decimal('1.1'))))
+ self.assertEqual((7, 200),
+ _components(F(Decimal('3.5e-2'))))
+ self.assertEqual((0, 1),
+ _components(F(Decimal('.000e20'))))
+ self.assertRaises(TypeError, F, Decimal('nan'))
+ self.assertRaises(TypeError, F, Decimal('snan'))
+ self.assertRaises(TypeError, F, Decimal('inf'))
+ self.assertRaises(TypeError, F, Decimal('-inf'))
def testFromString(self):
- self.assertEquals((5, 1), _components(F("5")))
- self.assertEquals((3, 2), _components(F("3/2")))
- self.assertEquals((3, 2), _components(F(" \n +3/2")))
- self.assertEquals((-3, 2), _components(F("-3/2 ")))
- self.assertEquals((13, 2), _components(F(" 013/02 \n ")))
- self.assertEquals((13, 2), _components(F(u" 013/02 \n ")))
-
- self.assertEquals((16, 5), _components(F(" 3.2 ")))
- self.assertEquals((-16, 5), _components(F(u" -3.2 ")))
- self.assertEquals((-3, 1), _components(F(u" -3. ")))
- self.assertEquals((3, 5), _components(F(u" .6 ")))
+ self.assertEqual((5, 1), _components(F("5")))
+ self.assertEqual((3, 2), _components(F("3/2")))
+ self.assertEqual((3, 2), _components(F(" \n +3/2")))
+ self.assertEqual((-3, 2), _components(F("-3/2 ")))
+ self.assertEqual((13, 2), _components(F(" 013/02 \n ")))
+ self.assertEqual((13, 2), _components(F(u" 013/02 \n ")))
+
+ self.assertEqual((16, 5), _components(F(" 3.2 ")))
+ self.assertEqual((-16, 5), _components(F(u" -3.2 ")))
+ self.assertEqual((-3, 1), _components(F(u" -3. ")))
+ self.assertEqual((3, 5), _components(F(u" .6 ")))
+ self.assertEqual((1, 3125), _components(F("32.e-5")))
+ self.assertEqual((1000000, 1), _components(F("1E+06")))
+ self.assertEqual((-12300, 1), _components(F("-1.23e4")))
+ self.assertEqual((0, 1), _components(F(" .0e+0\t")))
+ self.assertEqual((0, 1), _components(F("-0.000e0")))
self.assertRaisesMessage(
@@ -89,6 +196,9 @@ class FractionTest(unittest.TestCase):
ValueError, "Invalid literal for Fraction: '3/'",
F, "3/")
self.assertRaisesMessage(
+ ValueError, "Invalid literal for Fraction: '/2'",
+ F, "/2")
+ self.assertRaisesMessage(
ValueError, "Invalid literal for Fraction: '3 /2'",
F, "3 /2")
self.assertRaisesMessage(
@@ -104,10 +214,6 @@ class FractionTest(unittest.TestCase):
ValueError, "Invalid literal for Fraction: '3a2'",
F, "3a2")
self.assertRaisesMessage(
- # Only parse ordinary decimals, not scientific form.
- ValueError, "Invalid literal for Fraction: '3.2e4'",
- F, "3.2e4")
- self.assertRaisesMessage(
# Don't accept combinations of decimals and fractions.
ValueError, "Invalid literal for Fraction: '3/7.2'",
F, "3/7.2")
@@ -123,33 +229,33 @@ class FractionTest(unittest.TestCase):
def testImmutable(self):
r = F(7, 3)
r.__init__(2, 15)
- self.assertEquals((7, 3), _components(r))
+ self.assertEqual((7, 3), _components(r))
self.assertRaises(AttributeError, setattr, r, 'numerator', 12)
self.assertRaises(AttributeError, setattr, r, 'denominator', 6)
- self.assertEquals((7, 3), _components(r))
+ self.assertEqual((7, 3), _components(r))
# But if you _really_ need to:
r._numerator = 4
r._denominator = 2
- self.assertEquals((4, 2), _components(r))
+ self.assertEqual((4, 2), _components(r))
# Which breaks some important operations:
- self.assertNotEquals(F(4, 2), r)
+ self.assertNotEqual(F(4, 2), r)
def testFromFloat(self):
self.assertRaises(TypeError, F.from_float, 3+4j)
- self.assertEquals((10, 1), _components(F.from_float(10)))
+ self.assertEqual((10, 1), _components(F.from_float(10)))
bigint = 1234567890123456789
- self.assertEquals((bigint, 1), _components(F.from_float(bigint)))
- self.assertEquals((0, 1), _components(F.from_float(-0.0)))
- self.assertEquals((10, 1), _components(F.from_float(10.0)))
- self.assertEquals((-5, 2), _components(F.from_float(-2.5)))
- self.assertEquals((99999999999999991611392, 1),
- _components(F.from_float(1e23)))
- self.assertEquals(float(10**23), float(F.from_float(1e23)))
- self.assertEquals((3602879701896397, 1125899906842624),
- _components(F.from_float(3.2)))
- self.assertEquals(3.2, float(F.from_float(3.2)))
+ self.assertEqual((bigint, 1), _components(F.from_float(bigint)))
+ self.assertEqual((0, 1), _components(F.from_float(-0.0)))
+ self.assertEqual((10, 1), _components(F.from_float(10.0)))
+ self.assertEqual((-5, 2), _components(F.from_float(-2.5)))
+ self.assertEqual((99999999999999991611392, 1),
+ _components(F.from_float(1e23)))
+ self.assertEqual(float(10**23), float(F.from_float(1e23)))
+ self.assertEqual((3602879701896397, 1125899906842624),
+ _components(F.from_float(3.2)))
+ self.assertEqual(3.2, float(F.from_float(3.2)))
inf = 1e1000
nan = inf - inf
@@ -165,13 +271,13 @@ class FractionTest(unittest.TestCase):
def testFromDecimal(self):
self.assertRaises(TypeError, F.from_decimal, 3+4j)
- self.assertEquals(F(10, 1), F.from_decimal(10))
- self.assertEquals(F(0), F.from_decimal(Decimal("-0")))
- self.assertEquals(F(5, 10), F.from_decimal(Decimal("0.5")))
- self.assertEquals(F(5, 1000), F.from_decimal(Decimal("5e-3")))
- self.assertEquals(F(5000), F.from_decimal(Decimal("5e3")))
- self.assertEquals(1 - F(1, 10**30),
- F.from_decimal(Decimal("0." + "9" * 30)))
+ self.assertEqual(F(10, 1), F.from_decimal(10))
+ self.assertEqual(F(0), F.from_decimal(Decimal("-0")))
+ self.assertEqual(F(5, 10), F.from_decimal(Decimal("0.5")))
+ self.assertEqual(F(5, 1000), F.from_decimal(Decimal("5e-3")))
+ self.assertEqual(F(5000), F.from_decimal(Decimal("5e3")))
+ self.assertEqual(1 - F(1, 10**30),
+ F.from_decimal(Decimal("0." + "9" * 30)))
self.assertRaisesMessage(
TypeError, "Cannot convert Infinity to Fraction.",
@@ -200,29 +306,29 @@ class FractionTest(unittest.TestCase):
self.assertTypedEquals(-1, math.trunc(F(-11, 10)))
self.assertTypedEquals(-1, int(F(-11, 10)))
- self.assertEquals(False, bool(F(0, 1)))
- self.assertEquals(True, bool(F(3, 2)))
+ self.assertEqual(False, bool(F(0, 1)))
+ self.assertEqual(True, bool(F(3, 2)))
self.assertTypedEquals(0.1, float(F(1, 10)))
# Check that __float__ isn't implemented by converting the
# numerator and denominator to float before dividing.
self.assertRaises(OverflowError, float, long('2'*400+'7'))
- self.assertAlmostEquals(2.0/3,
+ self.assertAlmostEqual(2.0/3,
float(F(long('2'*400+'7'), long('3'*400+'1'))))
self.assertTypedEquals(0.1+0j, complex(F(1,10)))
def testArithmetic(self):
- self.assertEquals(F(1, 2), F(1, 10) + F(2, 5))
- self.assertEquals(F(-3, 10), F(1, 10) - F(2, 5))
- self.assertEquals(F(1, 25), F(1, 10) * F(2, 5))
- self.assertEquals(F(1, 4), F(1, 10) / F(2, 5))
+ self.assertEqual(F(1, 2), F(1, 10) + F(2, 5))
+ self.assertEqual(F(-3, 10), F(1, 10) - F(2, 5))
+ self.assertEqual(F(1, 25), F(1, 10) * F(2, 5))
+ self.assertEqual(F(1, 4), F(1, 10) / F(2, 5))
self.assertTypedEquals(2, F(9, 10) // F(2, 5))
self.assertTypedEquals(10**23, F(10**23, 1) // F(1))
- self.assertEquals(F(2, 3), F(-7, 3) % F(3, 2))
- self.assertEquals(F(8, 27), F(2, 3) ** F(3))
- self.assertEquals(F(27, 8), F(2, 3) ** F(-3))
+ self.assertEqual(F(2, 3), F(-7, 3) % F(3, 2))
+ self.assertEqual(F(8, 27), F(2, 3) ** F(3))
+ self.assertEqual(F(27, 8), F(2, 3) ** F(-3))
self.assertTypedEquals(2.0, F(4) ** F(1, 2))
# Will return 1j in 3.0:
self.assertRaises(ValueError, pow, F(-1), F(1, 2))
@@ -288,7 +394,7 @@ class FractionTest(unittest.TestCase):
TypeError,
"unsupported operand type(s) for +: 'Fraction' and 'Decimal'",
operator.add, F(3,11), Decimal('3.1415926'))
- self.assertNotEquals(F(5, 2), Decimal('2.5'))
+ self.assertNotEqual(F(5, 2), Decimal('2.5'))
def testComparisons(self):
self.assertTrue(F(1, 2) < F(2, 3))
@@ -301,6 +407,50 @@ class FractionTest(unittest.TestCase):
self.assertFalse(F(1, 2) != F(1, 2))
self.assertTrue(F(1, 2) != F(1, 3))
+ def testComparisonsDummyRational(self):
+ self.assertTrue(F(1, 2) == DummyRational(1, 2))
+ self.assertTrue(DummyRational(1, 2) == F(1, 2))
+ self.assertFalse(F(1, 2) == DummyRational(3, 4))
+ self.assertFalse(DummyRational(3, 4) == F(1, 2))
+
+ self.assertTrue(F(1, 2) < DummyRational(3, 4))
+ self.assertFalse(F(1, 2) < DummyRational(1, 2))
+ self.assertFalse(F(1, 2) < DummyRational(1, 7))
+ self.assertFalse(F(1, 2) > DummyRational(3, 4))
+ self.assertFalse(F(1, 2) > DummyRational(1, 2))
+ self.assertTrue(F(1, 2) > DummyRational(1, 7))
+ self.assertTrue(F(1, 2) <= DummyRational(3, 4))
+ self.assertTrue(F(1, 2) <= DummyRational(1, 2))
+ self.assertFalse(F(1, 2) <= DummyRational(1, 7))
+ self.assertFalse(F(1, 2) >= DummyRational(3, 4))
+ self.assertTrue(F(1, 2) >= DummyRational(1, 2))
+ self.assertTrue(F(1, 2) >= DummyRational(1, 7))
+
+ self.assertTrue(DummyRational(1, 2) < F(3, 4))
+ self.assertFalse(DummyRational(1, 2) < F(1, 2))
+ self.assertFalse(DummyRational(1, 2) < F(1, 7))
+ self.assertFalse(DummyRational(1, 2) > F(3, 4))
+ self.assertFalse(DummyRational(1, 2) > F(1, 2))
+ self.assertTrue(DummyRational(1, 2) > F(1, 7))
+ self.assertTrue(DummyRational(1, 2) <= F(3, 4))
+ self.assertTrue(DummyRational(1, 2) <= F(1, 2))
+ self.assertFalse(DummyRational(1, 2) <= F(1, 7))
+ self.assertFalse(DummyRational(1, 2) >= F(3, 4))
+ self.assertTrue(DummyRational(1, 2) >= F(1, 2))
+ self.assertTrue(DummyRational(1, 2) >= F(1, 7))
+
+ def testComparisonsDummyFloat(self):
+ x = DummyFloat(1./3.)
+ y = F(1, 3)
+ self.assertTrue(x != y)
+ self.assertTrue(x < y or x > y)
+ self.assertFalse(x == y)
+ self.assertFalse(x <= y and x >= y)
+ self.assertTrue(y != x)
+ self.assertTrue(y < x or y > x)
+ self.assertFalse(y == x)
+ self.assertFalse(y <= x and y >= x)
+
def testMixedLess(self):
self.assertTrue(2 < F(5, 2))
self.assertFalse(2 < F(4, 2))
@@ -312,6 +462,13 @@ class FractionTest(unittest.TestCase):
self.assertTrue(0.4 < F(1, 2))
self.assertFalse(0.5 < F(1, 2))
+ self.assertFalse(float('inf') < F(1, 2))
+ self.assertTrue(float('-inf') < F(0, 10))
+ self.assertFalse(float('nan') < F(-3, 7))
+ self.assertTrue(F(1, 2) < float('inf'))
+ self.assertFalse(F(17, 12) < float('-inf'))
+ self.assertFalse(F(144, -89) < float('nan'))
+
def testMixedLessEqual(self):
self.assertTrue(0.5 <= F(1, 2))
self.assertFalse(0.6 <= F(1, 2))
@@ -322,6 +479,13 @@ class FractionTest(unittest.TestCase):
self.assertTrue(F(4, 2) <= 2)
self.assertFalse(F(5, 2) <= 2)
+ self.assertFalse(float('inf') <= F(1, 2))
+ self.assertTrue(float('-inf') <= F(0, 10))
+ self.assertFalse(float('nan') <= F(-3, 7))
+ self.assertTrue(F(1, 2) <= float('inf'))
+ self.assertFalse(F(17, 12) <= float('-inf'))
+ self.assertFalse(F(144, -89) <= float('nan'))
+
def testBigFloatComparisons(self):
# Because 10**23 can't be represented exactly as a float:
self.assertFalse(F(10**23) == float(10**23))
@@ -334,8 +498,21 @@ class FractionTest(unittest.TestCase):
def testBigComplexComparisons(self):
self.assertFalse(F(10**23) == complex(10**23))
- self.assertTrue(F(10**23) > complex(10**23))
- self.assertFalse(F(10**23) <= complex(10**23))
+ self.assertRaises(TypeError, operator.gt, F(10**23), complex(10**23))
+ self.assertRaises(TypeError, operator.le, F(10**23), complex(10**23))
+
+ x = F(3, 8)
+ z = complex(0.375, 0.0)
+ w = complex(0.375, 0.2)
+ self.assertTrue(x == z)
+ self.assertFalse(x != z)
+ self.assertFalse(x == w)
+ self.assertTrue(x != w)
+ for op in operator.lt, operator.le, operator.gt, operator.ge:
+ self.assertRaises(TypeError, op, x, z)
+ self.assertRaises(TypeError, op, z, x)
+ self.assertRaises(TypeError, op, x, w)
+ self.assertRaises(TypeError, op, w, x)
def testMixedEqual(self):
self.assertTrue(0.5 == F(1, 2))
@@ -346,20 +523,24 @@ class FractionTest(unittest.TestCase):
self.assertFalse(2 == F(3, 2))
self.assertTrue(F(4, 2) == 2)
self.assertFalse(F(5, 2) == 2)
+ self.assertFalse(F(5, 2) == float('nan'))
+ self.assertFalse(float('nan') == F(3, 7))
+ self.assertFalse(F(5, 2) == float('inf'))
+ self.assertFalse(float('-inf') == F(2, 5))
def testStringification(self):
- self.assertEquals("Fraction(7, 3)", repr(F(7, 3)))
- self.assertEquals("Fraction(6283185307, 2000000000)",
- repr(F('3.1415926535')))
- self.assertEquals("Fraction(-1, 100000000000000000000)",
- repr(F(1, -10**20)))
- self.assertEquals("7/3", str(F(7, 3)))
- self.assertEquals("7", str(F(7, 1)))
+ self.assertEqual("Fraction(7, 3)", repr(F(7, 3)))
+ self.assertEqual("Fraction(6283185307, 2000000000)",
+ repr(F('3.1415926535')))
+ self.assertEqual("Fraction(-1, 100000000000000000000)",
+ repr(F(1, -10**20)))
+ self.assertEqual("7/3", str(F(7, 3)))
+ self.assertEqual("7", str(F(7, 1)))
def testHash(self):
- self.assertEquals(hash(2.5), hash(F(5, 2)))
- self.assertEquals(hash(10**50), hash(F(10**50)))
- self.assertNotEquals(hash(float(10**23)), hash(F(10**23)))
+ self.assertEqual(hash(2.5), hash(F(5, 2)))
+ self.assertEqual(hash(10**50), hash(F(10**50)))
+ self.assertNotEqual(hash(float(10**23)), hash(F(10**23)))
def testApproximatePi(self):
# Algorithm borrowed from
@@ -372,7 +553,7 @@ class FractionTest(unittest.TestCase):
d, da = d+da, da+32
t = (t * n) / d
s += t
- self.assertAlmostEquals(math.pi, s)
+ self.assertAlmostEqual(math.pi, s)
def testApproximateCos1(self):
# Algorithm borrowed from
@@ -386,7 +567,7 @@ class FractionTest(unittest.TestCase):
num *= x * x
sign *= -1
s += num / fact * sign
- self.assertAlmostEquals(math.cos(1), s)
+ self.assertAlmostEqual(math.cos(1), s)
def test_copy_deepcopy_pickle(self):
r = F(13, 7)
diff --git a/Lib/test/test_frozen.py b/Lib/test/test_frozen.py
index 1654be0eaa..771f599974 100644
--- a/Lib/test/test_frozen.py
+++ b/Lib/test/test_frozen.py
@@ -2,7 +2,7 @@
from test.test_support import captured_stdout, run_unittest
import unittest
-import sys, os
+import sys
class FrozenTests(unittest.TestCase):
def test_frozen(self):
@@ -23,16 +23,15 @@ class FrozenTests(unittest.TestCase):
except ImportError, x:
self.fail("import __phello__.spam failed:" + str(x))
- if sys.platform != "mac": # On the Mac this import does succeed.
- try:
- import __phello__.foo
- except ImportError:
- pass
- else:
- self.fail("import __phello__.foo should have failed")
-
- self.assertEquals(stdout.getvalue(),
- 'Hello world...\nHello world...\nHello world...\n')
+ try:
+ import __phello__.foo
+ except ImportError:
+ pass
+ else:
+ self.fail("import __phello__.foo should have failed")
+
+ self.assertEqual(stdout.getvalue(),
+ 'Hello world...\nHello world...\nHello world...\n')
del sys.modules['__hello__']
del sys.modules['__phello__']
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 1c2ceeb872..91995825ab 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -1,17 +1,24 @@
"""Test script for ftplib module."""
-# Modified by Giampaolo Rodola' to test FTP class and IPv6 environment
+# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
+# environment
import ftplib
-import threading
import asyncore
import asynchat
import socket
import StringIO
+import errno
+import os
+try:
+ import ssl
+except ImportError:
+ ssl = None
from unittest import TestCase
from test import test_support
from test.test_support import HOST
+threading = test_support.import_module('threading')
# the dummy data returned by server over the data channel when
@@ -22,6 +29,7 @@ NLST_DATA = 'foo\r\nbar\r\n'
class DummyDTPHandler(asynchat.async_chat):
+ dtp_conn_closed = False
def __init__(self, conn, baseclass):
asynchat.async_chat.__init__(self, conn)
@@ -32,12 +40,22 @@ class DummyDTPHandler(asynchat.async_chat):
self.baseclass.last_received_data += self.recv(1024)
def handle_close(self):
- self.baseclass.push('226 transfer complete')
- self.close()
+ # XXX: this method can be called many times in a row for a single
+ # connection, including in clear-text (non-TLS) mode.
+ # (behaviour witnessed with test_data_connection)
+ if not self.dtp_conn_closed:
+ self.baseclass.push('226 transfer complete')
+ self.close()
+ self.dtp_conn_closed = True
+
+ def handle_error(self):
+ raise
class DummyFTPHandler(asynchat.async_chat):
+ dtp_handler = DummyDTPHandler
+
def __init__(self, conn):
asynchat.async_chat.__init__(self, conn)
self.set_terminator("\r\n")
@@ -46,6 +64,7 @@ class DummyFTPHandler(asynchat.async_chat):
self.last_received_cmd = None
self.last_received_data = ''
self.next_response = ''
+ self.rest = None
self.push('220 welcome')
def collect_incoming_data(self, data):
@@ -80,38 +99,38 @@ class DummyFTPHandler(asynchat.async_chat):
addr = map(int, arg.split(','))
ip = '%d.%d.%d.%d' %tuple(addr[:4])
port = (addr[4] * 256) + addr[5]
- s = socket.create_connection((ip, port), timeout=2)
- self.dtp = DummyDTPHandler(s, baseclass=self)
+ s = socket.create_connection((ip, port), timeout=10)
+ self.dtp = self.dtp_handler(s, baseclass=self)
self.push('200 active data connection established')
def cmd_pasv(self, arg):
sock = socket.socket()
sock.bind((self.socket.getsockname()[0], 0))
sock.listen(5)
- sock.settimeout(2)
+ sock.settimeout(10)
ip, port = sock.getsockname()[:2]
ip = ip.replace('.', ',')
p1, p2 = divmod(port, 256)
self.push('227 entering passive mode (%s,%d,%d)' %(ip, p1, p2))
conn, addr = sock.accept()
- self.dtp = DummyDTPHandler(conn, baseclass=self)
+ self.dtp = self.dtp_handler(conn, baseclass=self)
def cmd_eprt(self, arg):
af, ip, port = arg.split(arg[0])[1:-1]
port = int(port)
- s = socket.create_connection((ip, port), timeout=2)
- self.dtp = DummyDTPHandler(s, baseclass=self)
+ s = socket.create_connection((ip, port), timeout=10)
+ self.dtp = self.dtp_handler(s, baseclass=self)
self.push('200 active data connection established')
def cmd_epsv(self, arg):
sock = socket.socket(socket.AF_INET6)
sock.bind((self.socket.getsockname()[0], 0))
sock.listen(5)
- sock.settimeout(2)
+ sock.settimeout(10)
port = sock.getsockname()[1]
self.push('229 entering extended passive mode (|||%d|)' %port)
conn, addr = sock.accept()
- self.dtp = DummyDTPHandler(conn, baseclass=self)
+ self.dtp = self.dtp_handler(conn, baseclass=self)
def cmd_echo(self, arg):
# sends back the received string (used by the test suite)
@@ -160,10 +179,19 @@ class DummyFTPHandler(asynchat.async_chat):
def cmd_stor(self, arg):
self.push('125 stor ok')
+ def cmd_rest(self, arg):
+ self.rest = arg
+ self.push('350 rest ok')
+
def cmd_retr(self, arg):
self.push('125 retr ok')
- self.dtp.push(RETR_DATA)
+ if self.rest is not None:
+ offset = int(self.rest)
+ else:
+ offset = 0
+ self.dtp.push(RETR_DATA[offset:])
self.dtp.close_when_done()
+ self.rest = None
def cmd_list(self, arg):
self.push('125 list ok')
@@ -226,12 +254,156 @@ class DummyFTPServer(asyncore.dispatcher, threading.Thread):
raise
+if ssl is not None:
+
+ CERTFILE = os.path.join(os.path.dirname(__file__), "keycert.pem")
+
+ class SSLConnection(object, asyncore.dispatcher):
+ """An asyncore.dispatcher subclass supporting TLS/SSL."""
+
+ _ssl_accepting = False
+ _ssl_closing = False
+
+ def secure_connection(self):
+ self.socket = ssl.wrap_socket(self.socket, suppress_ragged_eofs=False,
+ certfile=CERTFILE, server_side=True,
+ do_handshake_on_connect=False,
+ ssl_version=ssl.PROTOCOL_SSLv23)
+ self._ssl_accepting = True
+
+ def _do_ssl_handshake(self):
+ try:
+ self.socket.do_handshake()
+ except ssl.SSLError, err:
+ if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return
+ elif err.args[0] == ssl.SSL_ERROR_EOF:
+ return self.handle_close()
+ raise
+ except socket.error, err:
+ if err.args[0] == errno.ECONNABORTED:
+ return self.handle_close()
+ else:
+ self._ssl_accepting = False
+
+ def _do_ssl_shutdown(self):
+ self._ssl_closing = True
+ try:
+ self.socket = self.socket.unwrap()
+ except ssl.SSLError, err:
+ if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return
+ except socket.error, err:
+ # Any "socket error" corresponds to a SSL_ERROR_SYSCALL return
+ # from OpenSSL's SSL_shutdown(), corresponding to a
+ # closed socket condition. See also:
+ # http://www.mail-archive.com/openssl-users@openssl.org/msg60710.html
+ pass
+ self._ssl_closing = False
+ super(SSLConnection, self).close()
+
+ def handle_read_event(self):
+ if self._ssl_accepting:
+ self._do_ssl_handshake()
+ elif self._ssl_closing:
+ self._do_ssl_shutdown()
+ else:
+ super(SSLConnection, self).handle_read_event()
+
+ def handle_write_event(self):
+ if self._ssl_accepting:
+ self._do_ssl_handshake()
+ elif self._ssl_closing:
+ self._do_ssl_shutdown()
+ else:
+ super(SSLConnection, self).handle_write_event()
+
+ def send(self, data):
+ try:
+ return super(SSLConnection, self).send(data)
+ except ssl.SSLError, err:
+ if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN,
+ ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return 0
+ raise
+
+ def recv(self, buffer_size):
+ try:
+ return super(SSLConnection, self).recv(buffer_size)
+ except ssl.SSLError, err:
+ if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return ''
+ if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN):
+ self.handle_close()
+ return ''
+ raise
+
+ def handle_error(self):
+ raise
+
+ def close(self):
+ if (isinstance(self.socket, ssl.SSLSocket) and
+ self.socket._sslobj is not None):
+ self._do_ssl_shutdown()
+
+
+ class DummyTLS_DTPHandler(SSLConnection, DummyDTPHandler):
+ """A DummyDTPHandler subclass supporting TLS/SSL."""
+
+ def __init__(self, conn, baseclass):
+ DummyDTPHandler.__init__(self, conn, baseclass)
+ if self.baseclass.secure_data_channel:
+ self.secure_connection()
+
+
+ class DummyTLS_FTPHandler(SSLConnection, DummyFTPHandler):
+ """A DummyFTPHandler subclass supporting TLS/SSL."""
+
+ dtp_handler = DummyTLS_DTPHandler
+
+ def __init__(self, conn):
+ DummyFTPHandler.__init__(self, conn)
+ self.secure_data_channel = False
+
+ def cmd_auth(self, line):
+ """Set up secure control channel."""
+ self.push('234 AUTH TLS successful')
+ self.secure_connection()
+
+ def cmd_pbsz(self, line):
+ """Negotiate size of buffer for secure data transfer.
+ For TLS/SSL the only valid value for the parameter is '0'.
+ Any other value is accepted but ignored.
+ """
+ self.push('200 PBSZ=0 successful.')
+
+ def cmd_prot(self, line):
+ """Setup un/secure data channel."""
+ arg = line.upper()
+ if arg == 'C':
+ self.push('200 Protection set to Clear')
+ self.secure_data_channel = False
+ elif arg == 'P':
+ self.push('200 Protection set to Private')
+ self.secure_data_channel = True
+ else:
+ self.push("502 Unrecognized PROT type (use C or P).")
+
+
+ class DummyTLS_FTPServer(DummyFTPServer):
+ handler = DummyTLS_FTPHandler
+
+
class TestFTPClass(TestCase):
def setUp(self):
self.server = DummyFTPServer((HOST, 0))
self.server.start()
- self.client = ftplib.FTP(timeout=2)
+ self.client = ftplib.FTP(timeout=10)
self.client.connect(self.server.host, self.server.port)
def tearDown(self):
@@ -316,6 +488,15 @@ class TestFTPClass(TestCase):
self.client.retrbinary('retr', received.append)
self.assertEqual(''.join(received), RETR_DATA)
+ def test_retrbinary_rest(self):
+ for rest in (0, 10, 20):
+ received = []
+ self.client.retrbinary('retr', received.append, rest=rest)
+ self.assertEqual(''.join(received), RETR_DATA[rest:],
+ msg='rest test case %d %d %d' % (rest,
+ len(''.join(received)),
+ len(RETR_DATA[rest:])))
+
def test_retrlines(self):
received = []
self.client.retrlines('retr', received.append)
@@ -331,6 +512,13 @@ class TestFTPClass(TestCase):
self.client.storbinary('stor', f, callback=lambda x: flag.append(None))
self.assertTrue(flag)
+ def test_storbinary_rest(self):
+ f = StringIO.StringIO(RETR_DATA)
+ for r in (30, '30'):
+ f.seek(0)
+ self.client.storbinary('stor', f, rest=r)
+ self.assertEqual(self.server.handler.rest, str(r))
+
def test_storlines(self):
f = StringIO.StringIO(RETR_DATA.replace('\r\n', '\n'))
self.client.storlines('stor', f)
@@ -357,7 +545,7 @@ class TestFTPClass(TestCase):
def test_makepasv(self):
host, port = self.client.makepasv()
- conn = socket.create_connection((host, port), 2)
+ conn = socket.create_connection((host, port), 10)
conn.close()
# IPv4 is in use, just make sure send_epsv has not been used
self.assertEqual(self.server.handler.last_received_cmd, 'pasv')
@@ -384,7 +572,7 @@ class TestIPv6Environment(TestCase):
def test_makepasv(self):
host, port = self.client.makepasv()
- conn = socket.create_connection((host, port), 2)
+ conn = socket.create_connection((host, port), 10)
conn.close()
self.assertEqual(self.server.handler.last_received_cmd, 'epsv')
@@ -399,6 +587,81 @@ class TestIPv6Environment(TestCase):
retr()
+class TestTLS_FTPClassMixin(TestFTPClass):
+ """Repeat TestFTPClass tests starting the TLS layer for both control
+ and data connections first.
+ """
+
+ def setUp(self):
+ self.server = DummyTLS_FTPServer((HOST, 0))
+ self.server.start()
+ self.client = ftplib.FTP_TLS(timeout=10)
+ self.client.connect(self.server.host, self.server.port)
+ # enable TLS
+ self.client.auth()
+ self.client.prot_p()
+
+
+class TestTLS_FTPClass(TestCase):
+ """Specific TLS_FTP class tests."""
+
+ def setUp(self):
+ self.server = DummyTLS_FTPServer((HOST, 0))
+ self.server.start()
+ self.client = ftplib.FTP_TLS(timeout=10)
+ self.client.connect(self.server.host, self.server.port)
+
+ def tearDown(self):
+ self.client.close()
+ self.server.stop()
+
+ def test_control_connection(self):
+ self.assertNotIsInstance(self.client.sock, ssl.SSLSocket)
+ self.client.auth()
+ self.assertIsInstance(self.client.sock, ssl.SSLSocket)
+
+ def test_data_connection(self):
+ # clear text
+ sock = self.client.transfercmd('list')
+ self.assertNotIsInstance(sock, ssl.SSLSocket)
+ sock.close()
+ self.assertEqual(self.client.voidresp(), "226 transfer complete")
+
+ # secured, after PROT P
+ self.client.prot_p()
+ sock = self.client.transfercmd('list')
+ self.assertIsInstance(sock, ssl.SSLSocket)
+ sock.close()
+ self.assertEqual(self.client.voidresp(), "226 transfer complete")
+
+ # PROT C is issued, the connection must be in cleartext again
+ self.client.prot_c()
+ sock = self.client.transfercmd('list')
+ self.assertNotIsInstance(sock, ssl.SSLSocket)
+ sock.close()
+ self.assertEqual(self.client.voidresp(), "226 transfer complete")
+
+ def test_login(self):
+ # login() is supposed to implicitly secure the control connection
+ self.assertNotIsInstance(self.client.sock, ssl.SSLSocket)
+ self.client.login()
+ self.assertIsInstance(self.client.sock, ssl.SSLSocket)
+ # make sure that AUTH TLS doesn't get issued again
+ self.client.login()
+
+ def test_auth_issued_twice(self):
+ self.client.auth()
+ self.assertRaises(ValueError, self.client.auth)
+
+ def test_auth_ssl(self):
+ try:
+ self.client.ssl_version = ssl.PROTOCOL_SSLv3
+ self.client.auth()
+ self.assertRaises(ValueError, self.client.auth)
+ finally:
+ self.client.ssl_version = ssl.PROTOCOL_TLSv1
+
+
class TestTimeouts(TestCase):
def setUp(self):
@@ -439,7 +702,7 @@ class TestTimeouts(TestCase):
def testTimeoutDefault(self):
# default -- use global socket timeout
- self.assert_(socket.getdefaulttimeout() is None)
+ self.assertTrue(socket.getdefaulttimeout() is None)
socket.setdefaulttimeout(30)
try:
ftp = ftplib.FTP("localhost")
@@ -451,7 +714,7 @@ class TestTimeouts(TestCase):
def testTimeoutNone(self):
# no timeout -- do not use global socket timeout
- self.assert_(socket.getdefaulttimeout() is None)
+ self.assertTrue(socket.getdefaulttimeout() is None)
socket.setdefaulttimeout(30)
try:
ftp = ftplib.FTP("localhost", timeout=None)
@@ -500,6 +763,10 @@ def test_main():
pass
else:
tests.append(TestIPv6Environment)
+
+ if ssl is not None:
+ tests.extend([TestTLS_FTPClassMixin, TestTLS_FTPClass])
+
thread_info = test_support.threading_setup()
try:
test_support.run_unittest(*tests)
diff --git a/Lib/test/test_funcattrs.py b/Lib/test/test_funcattrs.py
index f374c8d628..b639ca2042 100644
--- a/Lib/test/test_funcattrs.py
+++ b/Lib/test/test_funcattrs.py
@@ -13,15 +13,20 @@ class FuncAttrsTest(unittest.TestCase):
self.fi = F()
self.b = b
- def cannot_set_attr(self,obj, name, value, exceptions):
- # This method is not called as a test (name doesn't start with 'test'),
- # but may be used by other tests.
- try: setattr(obj, name, value)
- except exceptions: pass
- else: self.fail("shouldn't be able to set %s to %r" % (name, value))
- try: delattr(obj, name)
- except exceptions: pass
- else: self.fail("shouldn't be able to del %s" % name)
+ def cannot_set_attr(self, obj, name, value, exceptions):
+ # Helper method for other tests.
+ try:
+ setattr(obj, name, value)
+ except exceptions:
+ pass
+ else:
+ self.fail("shouldn't be able to set %s to %r" % (name, value))
+ try:
+ delattr(obj, name)
+ except exceptions:
+ pass
+ else:
+ self.fail("shouldn't be able to del %s" % name)
class FunctionPropertiesTest(FuncAttrsTest):
@@ -31,16 +36,16 @@ class FunctionPropertiesTest(FuncAttrsTest):
def test_dir_includes_correct_attrs(self):
self.b.known_attr = 7
- self.assert_('known_attr' in dir(self.b),
- "set attributes not in dir listing of method")
+ self.assertIn('known_attr', dir(self.b),
+ "set attributes not in dir listing of method")
# Test on underlying function object of method
self.f.a.im_func.known_attr = 7
- self.assert_('known_attr' in dir(self.f.a),
- "set attribute on unbound method implementation in class not in "
- "dir")
- self.assert_('known_attr' in dir(self.fi.a),
- "set attribute on unbound method implementations, should show up"
- " in next dir")
+ self.assertIn('known_attr', dir(self.f.a),
+ "set attribute on unbound method implementation in "
+ "class not in dir")
+ self.assertIn('known_attr', dir(self.fi.a),
+ "set attribute on unbound method implementations, "
+ "should show up in next dir")
def test_duplicate_function_equality(self):
# Body of `duplicate' is the exact same as self.b
@@ -56,9 +61,29 @@ class FunctionPropertiesTest(FuncAttrsTest):
self.assertEqual(test(), 3) # self.b always returns 3, arbitrarily
def test_func_globals(self):
- self.assertEqual(self.b.func_globals, globals())
+ self.assertIs(self.b.func_globals, globals())
self.cannot_set_attr(self.b, 'func_globals', 2, TypeError)
+ def test_func_closure(self):
+ a = 12
+ def f(): print a
+ c = f.func_closure
+ self.assertIsInstance(c, tuple)
+ self.assertEqual(len(c), 1)
+ # don't have a type object handy
+ self.assertEqual(c[0].__class__.__name__, "cell")
+ self.cannot_set_attr(f, "func_closure", c, TypeError)
+
+ def test_empty_cell(self):
+ def f(): print a
+ try:
+ f.func_closure[0].cell_contents
+ except ValueError:
+ pass
+ else:
+ self.fail("shouldn't be able to read an empty cell")
+ a = 12
+
def test_func_name(self):
self.assertEqual(self.b.__name__, 'b')
self.assertEqual(self.b.func_name, 'b')
@@ -96,16 +121,20 @@ class FunctionPropertiesTest(FuncAttrsTest):
self.assertEqual(c.func_code, d.func_code)
self.assertEqual(c(), 7)
# self.assertEqual(d(), 7)
- try: b.func_code = c.func_code
- except ValueError: pass
- else: self.fail(
- "func_code with different numbers of free vars should not be "
- "possible")
- try: e.func_code = d.func_code
- except ValueError: pass
- else: self.fail(
- "func_code with different numbers of free vars should not be "
- "possible")
+ try:
+ b.func_code = c.func_code
+ except ValueError:
+ pass
+ else:
+ self.fail("func_code with different numbers of free vars should "
+ "not be possible")
+ try:
+ e.func_code = d.func_code
+ except ValueError:
+ pass
+ else:
+ self.fail("func_code with different numbers of free vars should "
+ "not be possible")
def test_blank_func_defaults(self):
self.assertEqual(self.b.func_defaults, None)
@@ -126,13 +155,16 @@ class FunctionPropertiesTest(FuncAttrsTest):
self.assertEqual(first_func(3, 5), 8)
del second_func.func_defaults
self.assertEqual(second_func.func_defaults, None)
- try: second_func()
- except TypeError: pass
- else: self.fail(
- "func_defaults does not update; deleting it does not remove "
- "requirement")
+ try:
+ second_func()
+ except TypeError:
+ pass
+ else:
+ self.fail("func_defaults does not update; deleting it does not "
+ "remove requirement")
-class ImplicitReferencesTest(FuncAttrsTest):
+
+class InstancemethodAttrTest(FuncAttrsTest):
def test_im_class(self):
self.assertEqual(self.f.a.im_class, self.f)
self.assertEqual(self.fi.a.im_class, self.f)
@@ -159,9 +191,12 @@ class ImplicitReferencesTest(FuncAttrsTest):
self.assertEqual(self.fi.id(), id(self.fi))
self.assertNotEqual(self.fi.id(), id(self.f))
# Test usage
- try: self.f.id.unknown_attr
- except AttributeError: pass
- else: self.fail("using unknown attributes should raise AttributeError")
+ try:
+ self.f.id.unknown_attr
+ except AttributeError:
+ pass
+ else:
+ self.fail("using unknown attributes should raise AttributeError")
# Test assignment and deletion
self.cannot_set_attr(self.f.id, 'unknown_attr', 2, AttributeError)
self.cannot_set_attr(self.fi.id, 'unknown_attr', 2, AttributeError)
@@ -171,35 +206,50 @@ class ImplicitReferencesTest(FuncAttrsTest):
self.assertEqual(self.f.a.known_attr, 7)
self.assertEqual(self.fi.a.known_attr, 7)
+
class ArbitraryFunctionAttrTest(FuncAttrsTest):
def test_set_attr(self):
+ # setting attributes only works on function objects
self.b.known_attr = 7
self.assertEqual(self.b.known_attr, 7)
for func in [self.f.a, self.fi.a]:
- try: func.known_attr = 7
- except AttributeError: pass
- else: self.fail("setting attributes on methods should raise error")
+ try:
+ func.known_attr = 7
+ except AttributeError:
+ pass
+ else:
+ self.fail("setting attributes on methods should raise error")
def test_delete_unknown_attr(self):
- try: del self.b.unknown_attr
- except AttributeError: pass
- else: self.fail("deleting unknown attribute should raise TypeError")
+ try:
+ del self.b.unknown_attr
+ except AttributeError:
+ pass
+ else:
+ self.fail("deleting unknown attribute should raise TypeError")
def test_setting_attrs_duplicates(self):
- try: self.f.a.klass = self.f
- except AttributeError: pass
- else: self.fail("setting arbitrary attribute in unbound function "
- " should raise AttributeError")
+ try:
+ self.f.a.klass = self.f
+ except AttributeError:
+ pass
+ else:
+ self.fail("setting arbitrary attribute in unbound function "
+ " should raise AttributeError")
self.f.a.im_func.klass = self.f
for method in [self.f.a, self.fi.a, self.fi.a.im_func]:
self.assertEqual(method.klass, self.f)
def test_unset_attr(self):
for func in [self.b, self.f.a, self.fi.a]:
- try: func.non_existent_attr
- except AttributeError: pass
- else: self.fail("using unknown attributes should raise "
- "AttributeError")
+ try:
+ func.non_existent_attr
+ except AttributeError:
+ pass
+ else:
+ self.fail("using unknown attributes should raise "
+ "AttributeError")
+
class FunctionDictsTest(FuncAttrsTest):
def test_setting_dict_to_invalid(self):
@@ -216,13 +266,13 @@ class FunctionDictsTest(FuncAttrsTest):
# Setting dict is only possible on the underlying function objects
self.f.a.im_func.__dict__ = d
# Test assignment
- self.assertEqual(d, self.b.__dict__)
- self.assertEqual(d, self.b.func_dict)
+ self.assertIs(d, self.b.__dict__)
+ self.assertIs(d, self.b.func_dict)
# ... and on all the different ways of referencing the method's func
- self.assertEqual(d, self.f.a.im_func.__dict__)
- self.assertEqual(d, self.f.a.__dict__)
- self.assertEqual(d, self.fi.a.im_func.__dict__)
- self.assertEqual(d, self.fi.a.__dict__)
+ self.assertIs(d, self.f.a.im_func.__dict__)
+ self.assertIs(d, self.f.a.__dict__)
+ self.assertIs(d, self.fi.a.im_func.__dict__)
+ self.assertIs(d, self.fi.a.__dict__)
# Test value
self.assertEqual(self.b.known_attr, 7)
self.assertEqual(self.b.__dict__['known_attr'], 7)
@@ -234,12 +284,18 @@ class FunctionDictsTest(FuncAttrsTest):
self.assertEqual(self.fi.a.known_attr, 7)
def test_delete_func_dict(self):
- try: del self.b.__dict__
- except TypeError: pass
- else: self.fail("deleting function dictionary should raise TypeError")
- try: del self.b.func_dict
- except TypeError: pass
- else: self.fail("deleting function dictionary should raise TypeError")
+ try:
+ del self.b.__dict__
+ except TypeError:
+ pass
+ else:
+ self.fail("deleting function dictionary should raise TypeError")
+ try:
+ del self.b.func_dict
+ except TypeError:
+ pass
+ else:
+ self.fail("deleting function dictionary should raise TypeError")
def test_unassigned_dict(self):
self.assertEqual(self.b.__dict__, {})
@@ -250,6 +306,7 @@ class FunctionDictsTest(FuncAttrsTest):
d[self.b] = value
self.assertEqual(d[self.b], value)
+
class FunctionDocstringTest(FuncAttrsTest):
def test_set_docstring_attr(self):
self.assertEqual(self.b.__doc__, None)
@@ -273,10 +330,24 @@ class FunctionDocstringTest(FuncAttrsTest):
self.assertEqual(self.b.__doc__, None)
self.assertEqual(self.b.func_doc, None)
+
+class StaticMethodAttrsTest(unittest.TestCase):
+ def test_func_attribute(self):
+ def f():
+ pass
+
+ c = classmethod(f)
+ self.assertTrue(c.__func__ is f)
+
+ s = staticmethod(f)
+ self.assertTrue(s.__func__ is f)
+
+
def test_main():
- test_support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest,
+ test_support.run_unittest(FunctionPropertiesTest, InstancemethodAttrTest,
ArbitraryFunctionAttrTest, FunctionDictsTest,
- FunctionDocstringTest)
+ FunctionDocstringTest,
+ StaticMethodAttrsTest)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 31f8f7037d..a713314f16 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -1,7 +1,9 @@
import functools
+import sys
import unittest
from test import test_support
from weakref import proxy
+import pickle
@staticmethod
def PythonPartial(func, *args, **keywords):
@@ -19,6 +21,10 @@ def capture(*args, **kw):
"""capture all positional and keyword arguments"""
return args, kw
+def signature(part):
+ """ return the signature of a partial object """
+ return (part.func, part.args, part.keywords, part.__dict__)
+
class TestPartial(unittest.TestCase):
thetype = functools.partial
@@ -99,7 +105,7 @@ class TestPartial(unittest.TestCase):
p = self.thetype(capture, *args)
expected = args + ('x',)
got, empty = p('x')
- self.failUnless(expected == got and empty == {})
+ self.assertTrue(expected == got and empty == {})
def test_keyword(self):
# make sure keyword arguments are captured correctly
@@ -107,15 +113,15 @@ class TestPartial(unittest.TestCase):
p = self.thetype(capture, a=a)
expected = {'a':a,'x':None}
empty, got = p(x=None)
- self.failUnless(expected == got and empty == ())
+ self.assertTrue(expected == got and empty == ())
def test_no_side_effects(self):
# make sure there are no side effects that affect subsequent calls
p = self.thetype(capture, 0, a=1)
args1, kw1 = p(1, b=2)
- self.failUnless(args1 == (0,1) and kw1 == {'a':1,'b':2})
+ self.assertTrue(args1 == (0,1) and kw1 == {'a':1,'b':2})
args2, kw2 = p()
- self.failUnless(args2 == (0,) and kw2 == {'a':1})
+ self.assertTrue(args2 == (0,) and kw2 == {'a':1})
def test_error_propagation(self):
def f(x, y):
@@ -139,6 +145,12 @@ class TestPartial(unittest.TestCase):
join = self.thetype(''.join)
self.assertEqual(join(data), '0123456789')
+ def test_pickle(self):
+ f = self.thetype(signature, 'asdf', bar=True)
+ f.add_something_to__dict__ = True
+ f_copy = pickle.loads(pickle.dumps(f))
+ self.assertEqual(signature(f), signature(f_copy))
+
class PartialSubclass(functools.partial):
pass
@@ -146,11 +158,13 @@ class TestPartialSubclass(TestPartial):
thetype = PartialSubclass
-
class TestPythonPartial(TestPartial):
thetype = PythonPartial
+ # the python version isn't picklable
+ def test_pickle(self): pass
+
class TestUpdateWrapper(unittest.TestCase):
def check_wrapper(self, wrapper, wrapped,
@@ -158,15 +172,15 @@ class TestUpdateWrapper(unittest.TestCase):
updated=functools.WRAPPER_UPDATES):
# Check attributes were assigned
for name in assigned:
- self.failUnless(getattr(wrapper, name) is getattr(wrapped, name))
+ self.assertTrue(getattr(wrapper, name) is getattr(wrapped, name))
# Check attributes were updated
for name in updated:
wrapper_attr = getattr(wrapper, name)
wrapped_attr = getattr(wrapped, name)
for key in wrapped_attr:
- self.failUnless(wrapped_attr[key] is wrapper_attr[key])
+ self.assertTrue(wrapped_attr[key] is wrapper_attr[key])
- def test_default_update(self):
+ def _default_update(self):
def f():
"""This is a test"""
pass
@@ -174,11 +188,20 @@ class TestUpdateWrapper(unittest.TestCase):
def wrapper():
pass
functools.update_wrapper(wrapper, f)
+ return wrapper, f
+
+ def test_default_update(self):
+ wrapper, f = self._default_update()
self.check_wrapper(wrapper, f)
self.assertEqual(wrapper.__name__, 'f')
- self.assertEqual(wrapper.__doc__, 'This is a test')
self.assertEqual(wrapper.attr, 'This is also a test')
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_default_update_doc(self):
+ wrapper, f = self._default_update()
+ self.assertEqual(wrapper.__doc__, 'This is a test')
+
def test_no_update(self):
def f():
"""This is a test"""
@@ -190,7 +213,7 @@ class TestUpdateWrapper(unittest.TestCase):
self.check_wrapper(wrapper, f, (), ())
self.assertEqual(wrapper.__name__, 'wrapper')
self.assertEqual(wrapper.__doc__, None)
- self.failIf(hasattr(wrapper, 'attr'))
+ self.assertFalse(hasattr(wrapper, 'attr'))
def test_selective_update(self):
def f():
@@ -215,11 +238,11 @@ class TestUpdateWrapper(unittest.TestCase):
pass
functools.update_wrapper(wrapper, max)
self.assertEqual(wrapper.__name__, 'max')
- self.assert_(wrapper.__doc__.startswith('max('))
+ self.assertTrue(wrapper.__doc__.startswith('max('))
class TestWraps(TestUpdateWrapper):
- def test_default_update(self):
+ def _default_update(self):
def f():
"""This is a test"""
pass
@@ -228,10 +251,19 @@ class TestWraps(TestUpdateWrapper):
def wrapper():
pass
self.check_wrapper(wrapper, f)
+ return wrapper
+
+ def test_default_update(self):
+ wrapper = self._default_update()
self.assertEqual(wrapper.__name__, 'f')
- self.assertEqual(wrapper.__doc__, 'This is a test')
self.assertEqual(wrapper.attr, 'This is also a test')
+ @unittest.skipIf(not sys.flags.optimize <= 1,
+ "Docstrings are omitted with -O2 and above")
+ def test_default_update_doc(self):
+ wrapper = self._default_update()
+ self.assertEqual(wrapper.__doc__, 'This is a test')
+
def test_no_update(self):
def f():
"""This is a test"""
@@ -243,7 +275,7 @@ class TestWraps(TestUpdateWrapper):
self.check_wrapper(wrapper, f, (), ())
self.assertEqual(wrapper.__name__, 'wrapper')
self.assertEqual(wrapper.__doc__, None)
- self.failIf(hasattr(wrapper, 'attr'))
+ self.assertFalse(hasattr(wrapper, 'attr'))
def test_selective_update(self):
def f():
@@ -306,16 +338,127 @@ class TestReduce(unittest.TestCase):
self.assertEqual(reduce(42, "", "1"), "1") # func is never called with one item
self.assertRaises(TypeError, reduce, 42, (42, 42))
-
-
+class TestCmpToKey(unittest.TestCase):
+ def test_cmp_to_key(self):
+ def mycmp(x, y):
+ return y - x
+ self.assertEqual(sorted(range(5), key=functools.cmp_to_key(mycmp)),
+ [4, 3, 2, 1, 0])
+
+ def test_hash(self):
+ def mycmp(x, y):
+ return y - x
+ key = functools.cmp_to_key(mycmp)
+ k = key(10)
+ self.assertRaises(TypeError, hash(k))
+
+class TestTotalOrdering(unittest.TestCase):
+
+ def test_total_ordering_lt(self):
+ @functools.total_ordering
+ class A:
+ def __init__(self, value):
+ self.value = value
+ def __lt__(self, other):
+ return self.value < other.value
+ def __eq__(self, other):
+ return self.value == other.value
+ self.assertTrue(A(1) < A(2))
+ self.assertTrue(A(2) > A(1))
+ self.assertTrue(A(1) <= A(2))
+ self.assertTrue(A(2) >= A(1))
+ self.assertTrue(A(2) <= A(2))
+ self.assertTrue(A(2) >= A(2))
+
+ def test_total_ordering_le(self):
+ @functools.total_ordering
+ class A:
+ def __init__(self, value):
+ self.value = value
+ def __le__(self, other):
+ return self.value <= other.value
+ def __eq__(self, other):
+ return self.value == other.value
+ self.assertTrue(A(1) < A(2))
+ self.assertTrue(A(2) > A(1))
+ self.assertTrue(A(1) <= A(2))
+ self.assertTrue(A(2) >= A(1))
+ self.assertTrue(A(2) <= A(2))
+ self.assertTrue(A(2) >= A(2))
+
+ def test_total_ordering_gt(self):
+ @functools.total_ordering
+ class A:
+ def __init__(self, value):
+ self.value = value
+ def __gt__(self, other):
+ return self.value > other.value
+ def __eq__(self, other):
+ return self.value == other.value
+ self.assertTrue(A(1) < A(2))
+ self.assertTrue(A(2) > A(1))
+ self.assertTrue(A(1) <= A(2))
+ self.assertTrue(A(2) >= A(1))
+ self.assertTrue(A(2) <= A(2))
+ self.assertTrue(A(2) >= A(2))
+
+ def test_total_ordering_ge(self):
+ @functools.total_ordering
+ class A:
+ def __init__(self, value):
+ self.value = value
+ def __ge__(self, other):
+ return self.value >= other.value
+ def __eq__(self, other):
+ return self.value == other.value
+ self.assertTrue(A(1) < A(2))
+ self.assertTrue(A(2) > A(1))
+ self.assertTrue(A(1) <= A(2))
+ self.assertTrue(A(2) >= A(1))
+ self.assertTrue(A(2) <= A(2))
+ self.assertTrue(A(2) >= A(2))
+
+ def test_total_ordering_no_overwrite(self):
+ # new methods should not overwrite existing
+ @functools.total_ordering
+ class A(str):
+ pass
+ self.assertTrue(A("a") < A("b"))
+ self.assertTrue(A("b") > A("a"))
+ self.assertTrue(A("a") <= A("b"))
+ self.assertTrue(A("b") >= A("a"))
+ self.assertTrue(A("b") <= A("b"))
+ self.assertTrue(A("b") >= A("b"))
+
+ def test_no_operations_defined(self):
+ with self.assertRaises(ValueError):
+ @functools.total_ordering
+ class A:
+ pass
+
+ def test_bug_10042(self):
+ @functools.total_ordering
+ class TestTO:
+ def __init__(self, value):
+ self.value = value
+ def __eq__(self, other):
+ if isinstance(other, TestTO):
+ return self.value == other.value
+ return False
+ def __lt__(self, other):
+ if isinstance(other, TestTO):
+ return self.value < other.value
+ raise TypeError
+ with self.assertRaises(TypeError):
+ TestTO(8) <= ()
def test_main(verbose=None):
- import sys
test_classes = (
TestPartial,
TestPartialSubclass,
TestPythonPartial,
TestUpdateWrapper,
+ TestTotalOrdering,
TestWraps,
TestReduce,
)
diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py
index 81d0a3ed2a..84f9c47d00 100644
--- a/Lib/test/test_future.py
+++ b/Lib/test/test_future.py
@@ -109,7 +109,7 @@ class FutureTest(unittest.TestCase):
def test_unicode_literals_exec(self):
scope = {}
exec "from __future__ import unicode_literals; x = ''" in scope
- self.assertTrue(isinstance(scope["x"], unicode))
+ self.assertIsInstance(scope["x"], unicode)
def test_main():
diff --git a/Lib/test/test_future4.py b/Lib/test/test_future4.py
index 2580c55fe7..53f8adde22 100644
--- a/Lib/test/test_future4.py
+++ b/Lib/test/test_future4.py
@@ -5,7 +5,7 @@ from test import test_support
class TestFuture(unittest.TestCase):
def assertType(self, obj, typ):
- self.assert_(type(obj) is typ,
+ self.assertTrue(type(obj) is typ,
"type(%r) is %r, not %r" % (obj, type(obj), typ))
def test_unicode_strings(self):
diff --git a/Lib/test/test_future5.py b/Lib/test/test_future5.py
index 1e1a930313..4984070c47 100644
--- a/Lib/test/test_future5.py
+++ b/Lib/test/test_future5.py
@@ -9,7 +9,7 @@ from . import test_support
class TestMultipleFeatures(unittest.TestCase):
def test_unicode_literals(self):
- self.assertTrue(isinstance("", unicode))
+ self.assertIsInstance("", unicode)
def test_print_function(self):
with test_support.captured_output("stderr") as s:
diff --git a/Lib/test/test_future_builtins.py b/Lib/test/test_future_builtins.py
index 0e16caf5d0..96c3788586 100644
--- a/Lib/test/test_future_builtins.py
+++ b/Lib/test/test_future_builtins.py
@@ -2,7 +2,6 @@ import test.test_support, unittest
# we're testing the behavior of these future builtins:
from future_builtins import hex, oct, map, zip, filter
-from test import test_support
class BuiltinTest(unittest.TestCase):
def test_hex(self):
diff --git a/Lib/test/test_gc.py b/Lib/test/test_gc.py
index 6e2ea4198f..5a35dec8c1 100644
--- a/Lib/test/test_gc.py
+++ b/Lib/test/test_gc.py
@@ -244,7 +244,7 @@ class GCTests(unittest.TestCase):
# - the call to assertEqual somehow avoids building its args tuple
def test_get_count(self):
# Avoid future allocation of method object
- assertEqual = self.assertEqual
+ assertEqual = self._baseAssertEqual
gc.collect()
assertEqual(gc.get_count(), (0, 0, 0))
a = dict()
@@ -415,6 +415,37 @@ class GCTests(unittest.TestCase):
self.assertEqual(gc.get_referents(1, 'a', 4j), [])
+ def test_is_tracked(self):
+ # Atomic built-in types are not tracked, user-defined objects and
+ # mutable containers are.
+ # NOTE: types with special optimizations (e.g. tuple) have tests
+ # in their own test files instead.
+ self.assertFalse(gc.is_tracked(None))
+ self.assertFalse(gc.is_tracked(1))
+ self.assertFalse(gc.is_tracked(1.0))
+ self.assertFalse(gc.is_tracked(1.0 + 5.0j))
+ self.assertFalse(gc.is_tracked(True))
+ self.assertFalse(gc.is_tracked(False))
+ self.assertFalse(gc.is_tracked("a"))
+ self.assertFalse(gc.is_tracked(u"a"))
+ self.assertFalse(gc.is_tracked(bytearray("a")))
+ self.assertFalse(gc.is_tracked(type))
+ self.assertFalse(gc.is_tracked(int))
+ self.assertFalse(gc.is_tracked(object))
+ self.assertFalse(gc.is_tracked(object()))
+
+ class OldStyle:
+ pass
+ class NewStyle(object):
+ pass
+ self.assertTrue(gc.is_tracked(gc))
+ self.assertTrue(gc.is_tracked(OldStyle))
+ self.assertTrue(gc.is_tracked(OldStyle()))
+ self.assertTrue(gc.is_tracked(NewStyle))
+ self.assertTrue(gc.is_tracked(NewStyle()))
+ self.assertTrue(gc.is_tracked([]))
+ self.assertTrue(gc.is_tracked(set()))
+
def test_bug1055820b(self):
# Corresponds to temp2b.py in the bug report.
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
new file mode 100644
index 0000000000..6d4fda1ba3
--- /dev/null
+++ b/Lib/test/test_gdb.py
@@ -0,0 +1,702 @@
+# Verify that gdb can pretty-print the various PyObject* types
+#
+# The code for testing gdb was adapted from similar work in Unladen Swallow's
+# Lib/test/test_jit_gdb.py
+
+import os
+import re
+import subprocess
+import sys
+import unittest
+import sysconfig
+
+from test.test_support import run_unittest, findfile
+
+try:
+ gdb_version, _ = subprocess.Popen(["gdb", "--version"],
+ stdout=subprocess.PIPE).communicate()
+except OSError:
+ # This is what "no gdb" looks like. There may, however, be other
+ # errors that manifest this way too.
+ raise unittest.SkipTest("Couldn't find gdb on the path")
+gdb_version_number = re.search(r"^GNU gdb [^\d]*(\d+)\.", gdb_version)
+if int(gdb_version_number.group(1)) < 7:
+ raise unittest.SkipTest("gdb versions before 7.0 didn't support python embedding"
+ " Saw:\n" + gdb_version)
+
+# Verify that "gdb" was built with the embedded python support enabled:
+cmd = "--eval-command=python import sys; print sys.version_info"
+p = subprocess.Popen(["gdb", "--batch", cmd],
+ stdout=subprocess.PIPE)
+gdbpy_version, _ = p.communicate()
+if gdbpy_version == '':
+ raise unittest.SkipTest("gdb not built with embedded python support")
+
+def gdb_has_frame_select():
+ # Does this build of gdb have gdb.Frame.select ?
+ cmd = "--eval-command=python print(dir(gdb.Frame))"
+ p = subprocess.Popen(["gdb", "--batch", cmd],
+ stdout=subprocess.PIPE)
+ stdout, _ = p.communicate()
+ m = re.match(r'.*\[(.*)\].*', stdout)
+ if not m:
+ raise unittest.SkipTest("Unable to parse output from gdb.Frame.select test")
+ gdb_frame_dir = m.group(1).split(', ')
+ return "'select'" in gdb_frame_dir
+
+HAS_PYUP_PYDOWN = gdb_has_frame_select()
+
+class DebuggerTests(unittest.TestCase):
+
+ """Test that the debugger can debug Python."""
+
+ def run_gdb(self, *args):
+ """Runs gdb with the command line given by *args.
+
+ Returns its stdout, stderr
+ """
+ out, err = subprocess.Popen(
+ args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
+ ).communicate()
+ return out, err
+
+ def get_stack_trace(self, source=None, script=None,
+ breakpoint='PyObject_Print',
+ cmds_after_breakpoint=None,
+ import_site=False):
+ '''
+ Run 'python -c SOURCE' under gdb with a breakpoint.
+
+ Support injecting commands after the breakpoint is reached
+
+ Returns the stdout from gdb
+
+ cmds_after_breakpoint: if provided, a list of strings: gdb commands
+ '''
+ # We use "set breakpoint pending yes" to avoid blocking with a:
+ # Function "foo" not defined.
+ # Make breakpoint pending on future shared library load? (y or [n])
+ # error, which typically happens python is dynamically linked (the
+ # breakpoints of interest are to be found in the shared library)
+ # When this happens, we still get:
+ # Function "PyObject_Print" not defined.
+ # emitted to stderr each time, alas.
+
+ # Initially I had "--eval-command=continue" here, but removed it to
+ # avoid repeated print breakpoints when traversing hierarchical data
+ # structures
+
+ # Generate a list of commands in gdb's language:
+ commands = ['set breakpoint pending yes',
+ 'break %s' % breakpoint,
+ 'run']
+ if cmds_after_breakpoint:
+ commands += cmds_after_breakpoint
+ else:
+ commands += ['backtrace']
+
+ # print commands
+
+ # Use "commands" to generate the arguments with which to invoke "gdb":
+ args = ["gdb", "--batch"]
+ args += ['--eval-command=%s' % cmd for cmd in commands]
+ args += ["--args",
+ sys.executable]
+
+ if not import_site:
+ # -S suppresses the default 'import site'
+ args += ["-S"]
+
+ if source:
+ args += ["-c", source]
+ elif script:
+ args += [script]
+
+ # print args
+ # print ' '.join(args)
+
+ # Use "args" to invoke gdb, capturing stdout, stderr:
+ out, err = self.run_gdb(*args)
+
+ # Ignore some noise on stderr due to the pending breakpoint:
+ err = err.replace('Function "%s" not defined.\n' % breakpoint, '')
+ # Ignore some other noise on stderr (http://bugs.python.org/issue8600)
+ err = err.replace("warning: Unable to find libthread_db matching"
+ " inferior's thread library, thread debugging will"
+ " not be available.\n",
+ '')
+ err = err.replace("warning: Cannot initialize thread debugging"
+ " library: Debugger service failed\n",
+ '')
+
+ # Ensure no unexpected error messages:
+ self.assertEqual(err, '')
+
+ return out
+
+ def get_gdb_repr(self, source,
+ cmds_after_breakpoint=None,
+ import_site=False):
+ # Given an input python source representation of data,
+ # run "python -c'print DATA'" under gdb with a breakpoint on
+ # PyObject_Print and scrape out gdb's representation of the "op"
+ # parameter, and verify that the gdb displays the same string
+ #
+ # For a nested structure, the first time we hit the breakpoint will
+ # give us the top-level structure
+ gdb_output = self.get_stack_trace(source, breakpoint='PyObject_Print',
+ cmds_after_breakpoint=cmds_after_breakpoint,
+ import_site=import_site)
+ # gdb can insert additional '\n' and space characters in various places
+ # in its output, depending on the width of the terminal it's connected
+ # to (using its "wrap_here" function)
+ m = re.match('.*#0\s+PyObject_Print\s+\(\s*op\=\s*(.*?),\s+fp=.*\).*',
+ gdb_output, re.DOTALL)
+ if not m:
+ self.fail('Unexpected gdb output: %r\n%s' % (gdb_output, gdb_output))
+ return m.group(1), gdb_output
+
+ def assertEndsWith(self, actual, exp_end):
+ '''Ensure that the given "actual" string ends with "exp_end"'''
+ self.assertTrue(actual.endswith(exp_end),
+ msg='%r did not end with %r' % (actual, exp_end))
+
+ def assertMultilineMatches(self, actual, pattern):
+ m = re.match(pattern, actual, re.DOTALL)
+ self.assertTrue(m, msg='%r did not match %r' % (actual, pattern))
+
+ def get_sample_script(self):
+ return findfile('gdb_sample.py')
+
+class PrettyPrintTests(DebuggerTests):
+ def test_getting_backtrace(self):
+ gdb_output = self.get_stack_trace('print 42')
+ self.assertTrue('PyObject_Print' in gdb_output)
+
+ def assertGdbRepr(self, val, cmds_after_breakpoint=None):
+ # Ensure that gdb's rendering of the value in a debugged process
+ # matches repr(value) in this process:
+ gdb_repr, gdb_output = self.get_gdb_repr('print ' + repr(val),
+ cmds_after_breakpoint)
+ self.assertEqual(gdb_repr, repr(val), gdb_output)
+
+ def test_int(self):
+ 'Verify the pretty-printing of various "int" values'
+ self.assertGdbRepr(42)
+ self.assertGdbRepr(0)
+ self.assertGdbRepr(-7)
+ self.assertGdbRepr(sys.maxint)
+ self.assertGdbRepr(-sys.maxint)
+
+ def test_long(self):
+ 'Verify the pretty-printing of various "long" values'
+ self.assertGdbRepr(0L)
+ self.assertGdbRepr(1000000000000L)
+ self.assertGdbRepr(-1L)
+ self.assertGdbRepr(-1000000000000000L)
+
+ def test_singletons(self):
+ 'Verify the pretty-printing of True, False and None'
+ self.assertGdbRepr(True)
+ self.assertGdbRepr(False)
+ self.assertGdbRepr(None)
+
+ def test_dicts(self):
+ 'Verify the pretty-printing of dictionaries'
+ self.assertGdbRepr({})
+ self.assertGdbRepr({'foo': 'bar'})
+ self.assertGdbRepr({'foo': 'bar', 'douglas':42})
+
+ def test_lists(self):
+ 'Verify the pretty-printing of lists'
+ self.assertGdbRepr([])
+ self.assertGdbRepr(range(5))
+
+ def test_strings(self):
+ 'Verify the pretty-printing of strings'
+ self.assertGdbRepr('')
+ self.assertGdbRepr('And now for something hopefully the same')
+ self.assertGdbRepr('string with embedded NUL here \0 and then some more text')
+ self.assertGdbRepr('this is byte 255:\xff and byte 128:\x80')
+
+ def test_tuples(self):
+ 'Verify the pretty-printing of tuples'
+ self.assertGdbRepr(tuple())
+ self.assertGdbRepr((1,))
+ self.assertGdbRepr(('foo', 'bar', 'baz'))
+
+ def test_unicode(self):
+ 'Verify the pretty-printing of unicode values'
+ # Test the empty unicode string:
+ self.assertGdbRepr(u'')
+
+ self.assertGdbRepr(u'hello world')
+
+ # Test printing a single character:
+ # U+2620 SKULL AND CROSSBONES
+ self.assertGdbRepr(u'\u2620')
+
+ # Test printing a Japanese unicode string
+ # (I believe this reads "mojibake", using 3 characters from the CJK
+ # Unified Ideographs area, followed by U+3051 HIRAGANA LETTER KE)
+ self.assertGdbRepr(u'\u6587\u5b57\u5316\u3051')
+
+ # Test a character outside the BMP:
+ # U+1D121 MUSICAL SYMBOL C CLEF
+ # This is:
+ # UTF-8: 0xF0 0x9D 0x84 0xA1
+ # UTF-16: 0xD834 0xDD21
+ # This will only work on wide-unicode builds:
+ self.assertGdbRepr(u"\U0001D121")
+
+ def test_sets(self):
+ 'Verify the pretty-printing of sets'
+ self.assertGdbRepr(set())
+ self.assertGdbRepr(set(['a', 'b']))
+ self.assertGdbRepr(set([4, 5, 6]))
+
+ # Ensure that we handled sets containing the "dummy" key value,
+ # which happens on deletion:
+ gdb_repr, gdb_output = self.get_gdb_repr('''s = set(['a','b'])
+s.pop()
+print s''')
+ self.assertEqual(gdb_repr, "set(['b'])")
+
+ def test_frozensets(self):
+ 'Verify the pretty-printing of frozensets'
+ self.assertGdbRepr(frozenset())
+ self.assertGdbRepr(frozenset(['a', 'b']))
+ self.assertGdbRepr(frozenset([4, 5, 6]))
+
+ def test_exceptions(self):
+ # Test a RuntimeError
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+try:
+ raise RuntimeError("I am an error")
+except RuntimeError, e:
+ print e
+''')
+ self.assertEqual(gdb_repr,
+ "exceptions.RuntimeError('I am an error',)")
+
+
+ # Test division by zero:
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+try:
+ a = 1 / 0
+except ZeroDivisionError, e:
+ print e
+''')
+ self.assertEqual(gdb_repr,
+ "exceptions.ZeroDivisionError('integer division or modulo by zero',)")
+
+ def test_classic_class(self):
+ 'Verify the pretty-printing of classic class instances'
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+class Foo:
+ pass
+foo = Foo()
+foo.an_int = 42
+print foo''')
+ m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
+ self.assertTrue(m,
+ msg='Unexpected classic-class rendering %r' % gdb_repr)
+
+ def test_modern_class(self):
+ 'Verify the pretty-printing of new-style class instances'
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+class Foo(object):
+ pass
+foo = Foo()
+foo.an_int = 42
+print foo''')
+ m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
+ self.assertTrue(m,
+ msg='Unexpected new-style class rendering %r' % gdb_repr)
+
+ def test_subclassing_list(self):
+ 'Verify the pretty-printing of an instance of a list subclass'
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+class Foo(list):
+ pass
+foo = Foo()
+foo += [1, 2, 3]
+foo.an_int = 42
+print foo''')
+ m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
+ self.assertTrue(m,
+ msg='Unexpected new-style class rendering %r' % gdb_repr)
+
+ def test_subclassing_tuple(self):
+ 'Verify the pretty-printing of an instance of a tuple subclass'
+ # This should exercise the negative tp_dictoffset code in the
+ # new-style class support
+ gdb_repr, gdb_output = self.get_gdb_repr('''
+class Foo(tuple):
+ pass
+foo = Foo((1, 2, 3))
+foo.an_int = 42
+print foo''')
+ m = re.match(r'<Foo\(an_int=42\) at remote 0x[0-9a-f]+>', gdb_repr)
+ self.assertTrue(m,
+ msg='Unexpected new-style class rendering %r' % gdb_repr)
+
+ def assertSane(self, source, corruption, expvalue=None, exptype=None):
+ '''Run Python under gdb, corrupting variables in the inferior process
+ immediately before taking a backtrace.
+
+ Verify that the variable's representation is the expected failsafe
+ representation'''
+ if corruption:
+ cmds_after_breakpoint=[corruption, 'backtrace']
+ else:
+ cmds_after_breakpoint=['backtrace']
+
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr(source,
+ cmds_after_breakpoint=cmds_after_breakpoint)
+
+ if expvalue:
+ if gdb_repr == repr(expvalue):
+ # gdb managed to print the value in spite of the corruption;
+ # this is good (see http://bugs.python.org/issue8330)
+ return
+
+ if exptype:
+ pattern = '<' + exptype + ' at remote 0x[0-9a-f]+>'
+ else:
+ # Match anything for the type name; 0xDEADBEEF could point to
+ # something arbitrary (see http://bugs.python.org/issue8330)
+ pattern = '<.* at remote 0x[0-9a-f]+>'
+
+ m = re.match(pattern, gdb_repr)
+ if not m:
+ self.fail('Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ def test_NULL_ptr(self):
+ 'Ensure that a NULL PyObject* is handled gracefully'
+ gdb_repr, gdb_output = (
+ self.get_gdb_repr('print 42',
+ cmds_after_breakpoint=['set variable op=0',
+ 'backtrace'])
+ )
+
+ self.assertEqual(gdb_repr, '0x0')
+
+ def test_NULL_ob_type(self):
+ 'Ensure that a PyObject* with NULL ob_type is handled gracefully'
+ self.assertSane('print 42',
+ 'set op->ob_type=0')
+
+ def test_corrupt_ob_type(self):
+ 'Ensure that a PyObject* with a corrupt ob_type is handled gracefully'
+ self.assertSane('print 42',
+ 'set op->ob_type=0xDEADBEEF',
+ expvalue=42)
+
+ def test_corrupt_tp_flags(self):
+ 'Ensure that a PyObject* with a type with corrupt tp_flags is handled'
+ self.assertSane('print 42',
+ 'set op->ob_type->tp_flags=0x0',
+ expvalue=42)
+
+ def test_corrupt_tp_name(self):
+ 'Ensure that a PyObject* with a type with corrupt tp_name is handled'
+ self.assertSane('print 42',
+ 'set op->ob_type->tp_name=0xDEADBEEF',
+ expvalue=42)
+
+ def test_NULL_instance_dict(self):
+ 'Ensure that a PyInstanceObject with with a NULL in_dict is handled'
+ self.assertSane('''
+class Foo:
+ pass
+foo = Foo()
+foo.an_int = 42
+print foo''',
+ 'set ((PyInstanceObject*)op)->in_dict = 0',
+ exptype='Foo')
+
+ def test_builtins_help(self):
+ 'Ensure that the new-style class _Helper in site.py can be handled'
+ # (this was the issue causing tracebacks in
+ # http://bugs.python.org/issue8032#msg100537 )
+
+ gdb_repr, gdb_output = self.get_gdb_repr('print __builtins__.help', import_site=True)
+ m = re.match(r'<_Helper at remote 0x[0-9a-f]+>', gdb_repr)
+ self.assertTrue(m,
+ msg='Unexpected rendering %r' % gdb_repr)
+
+ def test_selfreferential_list(self):
+ '''Ensure that a reference loop involving a list doesn't lead proxyval
+ into an infinite loop:'''
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr("a = [3, 4, 5] ; a.append(a) ; print a")
+
+ self.assertEqual(gdb_repr, '[3, 4, 5, [...]]')
+
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr("a = [3, 4, 5] ; b = [a] ; a.append(b) ; print a")
+
+ self.assertEqual(gdb_repr, '[3, 4, 5, [[...]]]')
+
+ def test_selfreferential_dict(self):
+ '''Ensure that a reference loop involving a dict doesn't lead proxyval
+ into an infinite loop:'''
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr("a = {} ; b = {'bar':a} ; a['foo'] = b ; print a")
+
+ self.assertEqual(gdb_repr, "{'foo': {'bar': {...}}}")
+
+ def test_selfreferential_old_style_instance(self):
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr('''
+class Foo:
+ pass
+foo = Foo()
+foo.an_attr = foo
+print foo''')
+ self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>',
+ gdb_repr),
+ 'Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ def test_selfreferential_new_style_instance(self):
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr('''
+class Foo(object):
+ pass
+foo = Foo()
+foo.an_attr = foo
+print foo''')
+ self.assertTrue(re.match('<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>',
+ gdb_repr),
+ 'Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ gdb_repr, gdb_output = \
+ self.get_gdb_repr('''
+class Foo(object):
+ pass
+a = Foo()
+b = Foo()
+a.an_attr = b
+b.an_attr = a
+print a''')
+ self.assertTrue(re.match('<Foo\(an_attr=<Foo\(an_attr=<\.\.\.>\) at remote 0x[0-9a-f]+>\) at remote 0x[0-9a-f]+>',
+ gdb_repr),
+ 'Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ def test_truncation(self):
+ 'Verify that very long output is truncated'
+ gdb_repr, gdb_output = self.get_gdb_repr('print range(1000)')
+ self.assertEqual(gdb_repr,
+ "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, "
+ "14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, "
+ "27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, "
+ "40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, "
+ "53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, "
+ "66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, "
+ "79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, "
+ "92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, "
+ "104, 105, 106, 107, 108, 109, 110, 111, 112, 113, "
+ "114, 115, 116, 117, 118, 119, 120, 121, 122, 123, "
+ "124, 125, 126, 127, 128, 129, 130, 131, 132, 133, "
+ "134, 135, 136, 137, 138, 139, 140, 141, 142, 143, "
+ "144, 145, 146, 147, 148, 149, 150, 151, 152, 153, "
+ "154, 155, 156, 157, 158, 159, 160, 161, 162, 163, "
+ "164, 165, 166, 167, 168, 169, 170, 171, 172, 173, "
+ "174, 175, 176, 177, 178, 179, 180, 181, 182, 183, "
+ "184, 185, 186, 187, 188, 189, 190, 191, 192, 193, "
+ "194, 195, 196, 197, 198, 199, 200, 201, 202, 203, "
+ "204, 205, 206, 207, 208, 209, 210, 211, 212, 213, "
+ "214, 215, 216, 217, 218, 219, 220, 221, 222, 223, "
+ "224, 225, 226...(truncated)")
+ self.assertEqual(len(gdb_repr),
+ 1024 + len('...(truncated)'))
+
+ def test_builtin_function(self):
+ gdb_repr, gdb_output = self.get_gdb_repr('print len')
+ self.assertEqual(gdb_repr, '<built-in function len>')
+
+ def test_builtin_method(self):
+ gdb_repr, gdb_output = self.get_gdb_repr('import sys; print sys.stdout.readlines')
+ self.assertTrue(re.match('<built-in method readlines of file object at remote 0x[0-9a-f]+>',
+ gdb_repr),
+ 'Unexpected gdb representation: %r\n%s' % \
+ (gdb_repr, gdb_output))
+
+ def test_frames(self):
+ gdb_output = self.get_stack_trace('''
+def foo(a, b, c):
+ pass
+
+foo(3, 4, 5)
+print foo.__code__''',
+ breakpoint='PyObject_Print',
+ cmds_after_breakpoint=['print (PyFrameObject*)(((PyCodeObject*)op)->co_zombieframe)']
+ )
+ self.assertTrue(re.match(r'.*\s+\$1 =\s+Frame 0x[0-9a-f]+, for file <string>, line 3, in foo \(\)\s+.*',
+ gdb_output,
+ re.DOTALL),
+ 'Unexpected gdb representation: %r\n%s' % (gdb_output, gdb_output))
+
+class PyListTests(DebuggerTests):
+ def assertListing(self, expected, actual):
+ self.assertEndsWith(actual, expected)
+
+ def test_basic_command(self):
+ 'Verify that the "py-list" command works'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-list'])
+
+ self.assertListing(' 5 \n'
+ ' 6 def bar(a, b, c):\n'
+ ' 7 baz(a, b, c)\n'
+ ' 8 \n'
+ ' 9 def baz(*args):\n'
+ ' >10 print(42)\n'
+ ' 11 \n'
+ ' 12 foo(1, 2, 3)\n',
+ bt)
+
+ def test_one_abs_arg(self):
+ 'Verify the "py-list" command with one absolute argument'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-list 9'])
+
+ self.assertListing(' 9 def baz(*args):\n'
+ ' >10 print(42)\n'
+ ' 11 \n'
+ ' 12 foo(1, 2, 3)\n',
+ bt)
+
+ def test_two_abs_args(self):
+ 'Verify the "py-list" command with two absolute arguments'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-list 1,3'])
+
+ self.assertListing(' 1 # Sample script for use by test_gdb.py\n'
+ ' 2 \n'
+ ' 3 def foo(a, b, c):\n',
+ bt)
+
+class StackNavigationTests(DebuggerTests):
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_pyup_command(self):
+ 'Verify that the "py-up" command works'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up'])
+ self.assertMultilineMatches(bt,
+ r'''^.*
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
+ baz\(a, b, c\)
+$''')
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_down_at_bottom(self):
+ 'Verify handling of "py-down" at the bottom of the stack'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-down'])
+ self.assertEndsWith(bt,
+ 'Unable to find a newer python frame\n')
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_up_at_top(self):
+ 'Verify handling of "py-up" at the top of the stack'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up'] * 4)
+ self.assertEndsWith(bt,
+ 'Unable to find an older python frame\n')
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_up_then_down(self):
+ 'Verify "py-up" followed by "py-down"'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up', 'py-down'])
+ self.assertMultilineMatches(bt,
+ r'''^.*
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
+ baz\(a, b, c\)
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 10, in baz \(args=\(1, 2, 3\)\)
+ print\(42\)
+$''')
+
+class PyBtTests(DebuggerTests):
+ def test_basic_command(self):
+ 'Verify that the "py-bt" command works'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-bt'])
+ self.assertMultilineMatches(bt,
+ r'''^.*
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 7, in bar \(a=1, b=2, c=3\)
+ baz\(a, b, c\)
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 4, in foo \(a=1, b=2, c=3\)
+ bar\(a, b, c\)
+#[0-9]+ Frame 0x[0-9a-f]+, for file .*gdb_sample.py, line 12, in <module> \(\)
+foo\(1, 2, 3\)
+''')
+
+class PyPrintTests(DebuggerTests):
+ def test_basic_command(self):
+ 'Verify that the "py-print" command works'
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-print args'])
+ self.assertMultilineMatches(bt,
+ r".*\nlocal 'args' = \(1, 2, 3\)\n.*")
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_print_after_up(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up', 'py-print c', 'py-print b', 'py-print a'])
+ self.assertMultilineMatches(bt,
+ r".*\nlocal 'c' = 3\nlocal 'b' = 2\nlocal 'a' = 1\n.*")
+
+ def test_printing_global(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-print __name__'])
+ self.assertMultilineMatches(bt,
+ r".*\nglobal '__name__' = '__main__'\n.*")
+
+ def test_printing_builtin(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-print len'])
+ self.assertMultilineMatches(bt,
+ r".*\nbuiltin 'len' = <built-in function len>\n.*")
+
+class PyLocalsTests(DebuggerTests):
+ def test_basic_command(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-locals'])
+ self.assertMultilineMatches(bt,
+ r".*\nargs = \(1, 2, 3\)\n.*")
+
+ @unittest.skipUnless(HAS_PYUP_PYDOWN, "test requires py-up/py-down commands")
+ def test_locals_after_up(self):
+ bt = self.get_stack_trace(script=self.get_sample_script(),
+ cmds_after_breakpoint=['py-up', 'py-locals'])
+ self.assertMultilineMatches(bt,
+ r".*\na = 1\nb = 2\nc = 3\n.*")
+
+def test_main():
+ cflags = sysconfig.get_config_vars()['PY_CFLAGS']
+ final_opt = ""
+ for opt in cflags.split():
+ if opt.startswith('-O'):
+ final_opt = opt
+ if final_opt and final_opt != '-O0':
+ raise unittest.SkipTest("Python was built with compiler optimizations, "
+ "tests can't reliably succeed")
+
+ run_unittest(PrettyPrintTests,
+ PyListTests,
+ StackNavigationTests,
+ PyBtTests,
+ PyPrintTests,
+ PyLocalsTests
+ )
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_gdbm.py b/Lib/test/test_gdbm.py
index 76689f0695..f4bbc3887a 100755..100644
--- a/Lib/test/test_gdbm.py
+++ b/Lib/test/test_gdbm.py
@@ -1,7 +1,7 @@
-import gdbm
import unittest
import os
-from test.test_support import verbose, TESTFN, run_unittest, unlink
+from test.test_support import TESTFN, run_unittest, unlink, import_module
+gdbm = import_module('gdbm')
filename = TESTFN
@@ -23,10 +23,10 @@ class TestGdbm(unittest.TestCase):
self.g['12345678910'] = '019237410982340912840198242'
key_set = set(self.g.keys())
self.assertEqual(key_set, frozenset(['a', '12345678910']))
- self.assert_(self.g.has_key('a'))
+ self.assertTrue(self.g.has_key('a'))
key = self.g.firstkey()
while key:
- self.assert_(key in key_set)
+ self.assertIn(key, key_set)
key_set.remove(key)
key = self.g.nextkey(key)
self.assertRaises(KeyError, lambda: self.g['xxx'])
@@ -64,7 +64,7 @@ class TestGdbm(unittest.TestCase):
self.g['x'] = 'x' * 10000
size1 = os.path.getsize(filename)
- self.assert_(size0 < size1)
+ self.assertTrue(size0 < size1)
del self.g['x']
# 'size' is supposed to be the same even after deleting an entry.
@@ -72,7 +72,7 @@ class TestGdbm(unittest.TestCase):
self.g.reorganize()
size2 = os.path.getsize(filename)
- self.assert_(size1 > size2 >= size0)
+ self.assertTrue(size1 > size2 >= size0)
def test_main():
diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py
index 3702abc91a..19bfe074c4 100644
--- a/Lib/test/test_generators.py
+++ b/Lib/test/test_generators.py
@@ -928,6 +928,16 @@ Test the __name__ attribute and the repr()
'f'
>>> repr(g) # doctest: +ELLIPSIS
'<generator object f at ...>'
+
+Lambdas shouldn't have their usual return behavior.
+
+>>> x = lambda: (yield 1)
+>>> list(x())
+[1]
+
+>>> x = lambda: ((yield 1), (yield 2))
+>>> list(x())
+[1, 2]
"""
# conjoin is a simple backtracking generator, named in honor of Icon's
@@ -950,11 +960,11 @@ Test the __name__ attribute and the repr()
# iterators have side-effects, so that which values *can* be generated at
# each slot depend on the values iterated at previous slots.
-def conjoin(gs):
+def simple_conjoin(gs):
values = [None] * len(gs)
- def gen(i, values=values):
+ def gen(i):
if i >= len(gs):
yield values
else:
@@ -979,7 +989,7 @@ def conjoin(gs):
# Do one loop nest at time recursively, until the # of loop nests
# remaining is divisible by 3.
- def gen(i, values=values):
+ def gen(i):
if i >= n:
yield values
@@ -997,7 +1007,7 @@ def conjoin(gs):
# remain. Don't call directly: this is an internal optimization for
# gen's use.
- def _gen3(i, values=values):
+ def _gen3(i):
assert i < n and (n-i) % 3 == 0
ip1, ip2, ip3 = i+1, i+2, i+3
g, g1, g2 = gs[i : ip3]
@@ -1554,7 +1564,8 @@ Check some syntax errors for yield expressions:
>>> f=lambda: (yield 1),(yield 2)
Traceback (most recent call last):
...
-SyntaxError: 'yield' outside function (<doctest test.test_generators.__test__.coroutine[21]>, line 1)
+ File "<doctest test.test_generators.__test__.coroutine[21]>", line 1
+SyntaxError: 'yield' outside function
>>> def f(): return lambda x=(yield): 1
Traceback (most recent call last):
@@ -1564,17 +1575,20 @@ SyntaxError: 'return' with argument inside generator (<doctest test.test_generat
>>> def f(): x = yield = y
Traceback (most recent call last):
...
-SyntaxError: assignment to yield expression not possible (<doctest test.test_generators.__test__.coroutine[23]>, line 1)
+ File "<doctest test.test_generators.__test__.coroutine[23]>", line 1
+SyntaxError: assignment to yield expression not possible
>>> def f(): (yield bar) = y
Traceback (most recent call last):
...
-SyntaxError: can't assign to yield expression (<doctest test.test_generators.__test__.coroutine[24]>, line 1)
+ File "<doctest test.test_generators.__test__.coroutine[24]>", line 1
+SyntaxError: can't assign to yield expression
>>> def f(): (yield bar) += y
Traceback (most recent call last):
...
-SyntaxError: augmented assignment to yield expression not possible (<doctest test.test_generators.__test__.coroutine[25]>, line 1)
+ File "<doctest test.test_generators.__test__.coroutine[25]>", line 1
+SyntaxError: can't assign to yield expression
Now check some throw() conditions:
@@ -1686,6 +1700,17 @@ And finalization:
>>> del g
exiting
+>>> class context(object):
+... def __enter__(self): pass
+... def __exit__(self, *args): print 'exiting'
+>>> def f():
+... with context():
+... yield
+>>> g = f()
+>>> g.next()
+>>> del g
+exiting
+
GeneratorExit is not caught by except Exception:
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py
index 53c4607ee2..3975b56ab8 100644
--- a/Lib/test/test_genericpath.py
+++ b/Lib/test/test_genericpath.py
@@ -1,41 +1,87 @@
+"""
+Tests common to genericpath, macpath, ntpath and posixpath
+"""
+
import unittest
from test import test_support
import os
import genericpath
+import sys
+
+
+def safe_rmdir(dirname):
+ try:
+ os.rmdir(dirname)
+ except OSError:
+ pass
+
-class AllCommonTest(unittest.TestCase):
+class GenericTest(unittest.TestCase):
+ # The path module to be tested
+ pathmodule = genericpath
+ common_attributes = ['commonprefix', 'getsize', 'getatime', 'getctime',
+ 'getmtime', 'exists', 'isdir', 'isfile']
+ attributes = []
- def assertIs(self, a, b):
- self.assert_(a is b)
+ def test_no_argument(self):
+ for attr in self.common_attributes + self.attributes:
+ with self.assertRaises(TypeError):
+ getattr(self.pathmodule, attr)()
+ raise self.fail("{}.{}() did not raise a TypeError"
+ .format(self.pathmodule.__name__, attr))
def test_commonprefix(self):
+ commonprefix = self.pathmodule.commonprefix
self.assertEqual(
- genericpath.commonprefix([]),
+ commonprefix([]),
""
)
self.assertEqual(
- genericpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"]),
+ commonprefix(["/home/swenson/spam", "/home/swen/spam"]),
"/home/swen"
)
self.assertEqual(
- genericpath.commonprefix(["/home/swen/spam", "/home/swen/eggs"]),
+ commonprefix(["/home/swen/spam", "/home/swen/eggs"]),
"/home/swen/"
)
self.assertEqual(
- genericpath.commonprefix(["/home/swen/spam", "/home/swen/spam"]),
+ commonprefix(["/home/swen/spam", "/home/swen/spam"]),
"/home/swen/spam"
)
+ self.assertEqual(
+ commonprefix(["home:swenson:spam", "home:swen:spam"]),
+ "home:swen"
+ )
+ self.assertEqual(
+ commonprefix([":home:swen:spam", ":home:swen:eggs"]),
+ ":home:swen:"
+ )
+ self.assertEqual(
+ commonprefix([":home:swen:spam", ":home:swen:spam"]),
+ ":home:swen:spam"
+ )
+
+ testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd',
+ 'aXc', 'abd', 'ab', 'aX', 'abcX']
+ for s1 in testlist:
+ for s2 in testlist:
+ p = commonprefix([s1, s2])
+ self.assertTrue(s1.startswith(p))
+ self.assertTrue(s2.startswith(p))
+ if s1 != s2:
+ n = len(p)
+ self.assertNotEqual(s1[n:n+1], s2[n:n+1])
def test_getsize(self):
f = open(test_support.TESTFN, "wb")
try:
f.write("foo")
f.close()
- self.assertEqual(genericpath.getsize(test_support.TESTFN), 3)
+ self.assertEqual(self.pathmodule.getsize(test_support.TESTFN), 3)
finally:
if not f.closed:
f.close()
- os.remove(test_support.TESTFN)
+ test_support.unlink(test_support.TESTFN)
def test_time(self):
f = open(test_support.TESTFN, "wb")
@@ -50,135 +96,161 @@ class AllCommonTest(unittest.TestCase):
f.close()
self.assertEqual(d, "foobar")
- self.assert_(
- genericpath.getctime(test_support.TESTFN) <=
- genericpath.getmtime(test_support.TESTFN)
+ self.assertLessEqual(
+ self.pathmodule.getctime(test_support.TESTFN),
+ self.pathmodule.getmtime(test_support.TESTFN)
)
finally:
if not f.closed:
f.close()
- os.remove(test_support.TESTFN)
+ test_support.unlink(test_support.TESTFN)
def test_exists(self):
- self.assertIs(genericpath.exists(test_support.TESTFN), False)
+ self.assertIs(self.pathmodule.exists(test_support.TESTFN), False)
f = open(test_support.TESTFN, "wb")
try:
f.write("foo")
f.close()
- self.assertIs(genericpath.exists(test_support.TESTFN), True)
+ self.assertIs(self.pathmodule.exists(test_support.TESTFN), True)
+ if not self.pathmodule == genericpath:
+ self.assertIs(self.pathmodule.lexists(test_support.TESTFN),
+ True)
finally:
if not f.close():
f.close()
- try:
- os.remove(test_support.TESTFN)
- except os.error:
- pass
-
- self.assertRaises(TypeError, genericpath.exists)
+ test_support.unlink(test_support.TESTFN)
def test_isdir(self):
- self.assertIs(genericpath.isdir(test_support.TESTFN), False)
+ self.assertIs(self.pathmodule.isdir(test_support.TESTFN), False)
f = open(test_support.TESTFN, "wb")
try:
f.write("foo")
f.close()
- self.assertIs(genericpath.isdir(test_support.TESTFN), False)
+ self.assertIs(self.pathmodule.isdir(test_support.TESTFN), False)
os.remove(test_support.TESTFN)
os.mkdir(test_support.TESTFN)
- self.assertIs(genericpath.isdir(test_support.TESTFN), True)
+ self.assertIs(self.pathmodule.isdir(test_support.TESTFN), True)
os.rmdir(test_support.TESTFN)
finally:
if not f.close():
f.close()
- try:
- os.remove(test_support.TESTFN)
- except os.error:
- pass
- try:
- os.rmdir(test_support.TESTFN)
- except os.error:
- pass
-
- self.assertRaises(TypeError, genericpath.isdir)
+ test_support.unlink(test_support.TESTFN)
+ safe_rmdir(test_support.TESTFN)
def test_isfile(self):
- self.assertIs(genericpath.isfile(test_support.TESTFN), False)
+ self.assertIs(self.pathmodule.isfile(test_support.TESTFN), False)
f = open(test_support.TESTFN, "wb")
try:
f.write("foo")
f.close()
- self.assertIs(genericpath.isfile(test_support.TESTFN), True)
+ self.assertIs(self.pathmodule.isfile(test_support.TESTFN), True)
os.remove(test_support.TESTFN)
os.mkdir(test_support.TESTFN)
- self.assertIs(genericpath.isfile(test_support.TESTFN), False)
+ self.assertIs(self.pathmodule.isfile(test_support.TESTFN), False)
os.rmdir(test_support.TESTFN)
finally:
if not f.close():
f.close()
- try:
- os.remove(test_support.TESTFN)
- except os.error:
- pass
- try:
- os.rmdir(test_support.TESTFN)
- except os.error:
- pass
-
- self.assertRaises(TypeError, genericpath.isdir)
-
- def test_samefile(self):
- f = open(test_support.TESTFN + "1", "wb")
- try:
- f.write("foo")
- f.close()
- self.assertIs(
- genericpath.samefile(
- test_support.TESTFN + "1",
- test_support.TESTFN + "1"
- ),
- True
- )
- # If we don't have links, assume that os.stat doesn't return resonable
- # inode information and thus, that samefile() doesn't work
- if hasattr(os, "symlink"):
- os.symlink(
- test_support.TESTFN + "1",
- test_support.TESTFN + "2"
- )
- self.assertIs(
- genericpath.samefile(
- test_support.TESTFN + "1",
- test_support.TESTFN + "2"
- ),
- True
- )
- os.remove(test_support.TESTFN + "2")
- f = open(test_support.TESTFN + "2", "wb")
- f.write("bar")
- f.close()
- self.assertIs(
- genericpath.samefile(
- test_support.TESTFN + "1",
- test_support.TESTFN + "2"
- ),
- False
- )
- finally:
- if not f.close():
- f.close()
- try:
- os.remove(test_support.TESTFN + "1")
- except os.error:
- pass
- try:
- os.remove(test_support.TESTFN + "2")
- except os.error:
- pass
-
- self.assertRaises(TypeError, genericpath.samefile)
+ test_support.unlink(test_support.TESTFN)
+ safe_rmdir(test_support.TESTFN)
+
+
+# Following TestCase is not supposed to be run from test_genericpath.
+# It is inherited by other test modules (macpath, ntpath, posixpath).
+
+class CommonTest(GenericTest):
+ # The path module to be tested
+ pathmodule = None
+ common_attributes = GenericTest.common_attributes + [
+ # Properties
+ 'curdir', 'pardir', 'extsep', 'sep',
+ 'pathsep', 'defpath', 'altsep', 'devnull',
+ # Methods
+ 'normcase', 'splitdrive', 'expandvars', 'normpath', 'abspath',
+ 'join', 'split', 'splitext', 'isabs', 'basename', 'dirname',
+ 'lexists', 'islink', 'ismount', 'expanduser', 'normpath', 'realpath',
+ ]
+
+ def test_normcase(self):
+ # Check that normcase() is idempotent
+ p = "FoO/./BaR"
+ p = self.pathmodule.normcase(p)
+ self.assertEqual(p, self.pathmodule.normcase(p))
+
+ def test_splitdrive(self):
+ # splitdrive for non-NT paths
+ splitdrive = self.pathmodule.splitdrive
+ self.assertEqual(splitdrive("/foo/bar"), ("", "/foo/bar"))
+ self.assertEqual(splitdrive("foo:bar"), ("", "foo:bar"))
+ self.assertEqual(splitdrive(":foo:bar"), ("", ":foo:bar"))
+
+ def test_expandvars(self):
+ if self.pathmodule.__name__ == 'macpath':
+ self.skipTest('macpath.expandvars is a stub')
+ expandvars = self.pathmodule.expandvars
+ with test_support.EnvironmentVarGuard() as env:
+ env.clear()
+ env["foo"] = "bar"
+ env["{foo"] = "baz1"
+ env["{foo}"] = "baz2"
+ self.assertEqual(expandvars("foo"), "foo")
+ self.assertEqual(expandvars("$foo bar"), "bar bar")
+ self.assertEqual(expandvars("${foo}bar"), "barbar")
+ self.assertEqual(expandvars("$[foo]bar"), "$[foo]bar")
+ self.assertEqual(expandvars("$bar bar"), "$bar bar")
+ self.assertEqual(expandvars("$?bar"), "$?bar")
+ self.assertEqual(expandvars("${foo}bar"), "barbar")
+ self.assertEqual(expandvars("$foo}bar"), "bar}bar")
+ self.assertEqual(expandvars("${foo"), "${foo")
+ self.assertEqual(expandvars("${{foo}}"), "baz1}")
+ self.assertEqual(expandvars("$foo$foo"), "barbar")
+ self.assertEqual(expandvars("$bar$bar"), "$bar$bar")
+
+ def test_abspath(self):
+ self.assertIn("foo", self.pathmodule.abspath("foo"))
+
+ # Abspath returns bytes when the arg is bytes
+ for path in ('', 'foo', 'f\xf2\xf2', '/foo', 'C:\\'):
+ self.assertIsInstance(self.pathmodule.abspath(path), str)
+
+ def test_realpath(self):
+ self.assertIn("foo", self.pathmodule.realpath("foo"))
+
+ def test_normpath_issue5827(self):
+ # Make sure normpath preserves unicode
+ for path in (u'', u'.', u'/', u'\\', u'///foo/.//bar//'):
+ self.assertIsInstance(self.pathmodule.normpath(path), unicode)
+
+ def test_abspath_issue3426(self):
+ # Check that abspath returns unicode when the arg is unicode
+ # with both ASCII and non-ASCII cwds.
+ abspath = self.pathmodule.abspath
+ for path in (u'', u'fuu', u'f\xf9\xf9', u'/fuu', u'U:\\'):
+ self.assertIsInstance(abspath(path), unicode)
+
+ unicwd = u'\xe7w\xf0'
+ try:
+ fsencoding = test_support.TESTFN_ENCODING or "ascii"
+ unicwd.encode(fsencoding)
+ except (AttributeError, UnicodeEncodeError):
+ # FS encoding is probably ASCII
+ pass
+ else:
+ with test_support.temp_cwd(unicwd):
+ for path in (u'', u'fuu', u'f\xf9\xf9', u'/fuu', u'U:\\'):
+ self.assertIsInstance(abspath(path), unicode)
+
+ @unittest.skipIf(sys.platform == 'darwin',
+ "Mac OS X denies the creation of a directory with an invalid utf8 name")
+ def test_nonascii_abspath(self):
+ # Test non-ASCII, non-UTF8 bytes in the path.
+ with test_support.temp_cwd('\xe7w\xf0'):
+ self.test_abspath()
+
def test_main():
- test_support.run_unittest(AllCommonTest)
+ test_support.run_unittest(GenericTest)
+
if __name__=="__main__":
test_main()
diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py
index a86f12f03e..3d896a530f 100644
--- a/Lib/test/test_genexps.py
+++ b/Lib/test/test_genexps.py
@@ -137,12 +137,14 @@ Verify that syntax error's are raised for genexps used as lvalues
>>> (y for y in (1,2)) = 10
Traceback (most recent call last):
...
- SyntaxError: can't assign to generator expression (<doctest test.test_genexps.__test__.doctests[40]>, line 1)
+ File "<doctest test.test_genexps.__test__.doctests[40]>", line 1
+ SyntaxError: can't assign to generator expression
>>> (y for y in (1,2)) += 10
Traceback (most recent call last):
...
- SyntaxError: augmented assignment to generator expression not possible (<doctest test.test_genexps.__test__.doctests[41]>, line 1)
+ File "<doctest test.test_genexps.__test__.doctests[41]>", line 1
+ SyntaxError: can't assign to generator expression
########### Tests borrowed from or inspired by test_generators.py ############
diff --git a/Lib/test/test_getargs.py b/Lib/test/test_getargs.py
index e2c36dd803..4ac5aa2f7a 100644
--- a/Lib/test/test_getargs.py
+++ b/Lib/test/test_getargs.py
@@ -21,9 +21,6 @@ class GetArgsTest(unittest.TestCase):
# this test will fail because it does not test the right part of the
# PyArg_ParseTuple() implementation.
def test_with_marshal(self):
- if not test_support.have_unicode:
- return
-
arg = unicode(r'\222', 'unicode-escape')
self.assertRaises(UnicodeError, marshal.loads, arg)
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py
index 9b90a692b6..d06296b029 100644
--- a/Lib/test/test_getargs2.py
+++ b/Lib/test/test_getargs2.py
@@ -1,16 +1,7 @@
import unittest
from test import test_support
from _testcapi import getargs_keywords
-
import warnings
-warnings.filterwarnings("ignore",
- category=DeprecationWarning,
- message=".*integer argument expected, got float",
- module=__name__)
-warnings.filterwarnings("ignore",
- category=DeprecationWarning,
- message=".*integer argument expected, got float",
- module="unittest")
"""
> How about the following counterproposal. This also changes some of
@@ -48,7 +39,8 @@ LARGE = 0x7FFFFFFF
VERY_LARGE = 0xFF0000121212121212121242L
from _testcapi import UCHAR_MAX, USHRT_MAX, UINT_MAX, ULONG_MAX, INT_MAX, \
- INT_MIN, LONG_MIN, LONG_MAX, PY_SSIZE_T_MIN, PY_SSIZE_T_MAX
+ INT_MIN, LONG_MIN, LONG_MAX, PY_SSIZE_T_MIN, PY_SSIZE_T_MAX, \
+ SHRT_MIN, SHRT_MAX
# fake, they are not defined in Python's header files
LLONG_MAX = 2**63-1
@@ -67,69 +59,69 @@ class Unsigned_TestCase(unittest.TestCase):
def test_b(self):
from _testcapi import getargs_b
# b returns 'unsigned char', and does range checking (0 ... UCHAR_MAX)
- self.failUnlessEqual(3, getargs_b(3.14))
- self.failUnlessEqual(99, getargs_b(Long()))
- self.failUnlessEqual(99, getargs_b(Int()))
+ self.assertRaises(TypeError, getargs_b, 3.14)
+ self.assertEqual(99, getargs_b(Long()))
+ self.assertEqual(99, getargs_b(Int()))
self.assertRaises(OverflowError, getargs_b, -1)
- self.failUnlessEqual(0, getargs_b(0))
- self.failUnlessEqual(UCHAR_MAX, getargs_b(UCHAR_MAX))
+ self.assertEqual(0, getargs_b(0))
+ self.assertEqual(UCHAR_MAX, getargs_b(UCHAR_MAX))
self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1)
- self.failUnlessEqual(42, getargs_b(42))
- self.failUnlessEqual(42, getargs_b(42L))
+ self.assertEqual(42, getargs_b(42))
+ self.assertEqual(42, getargs_b(42L))
self.assertRaises(OverflowError, getargs_b, VERY_LARGE)
def test_B(self):
from _testcapi import getargs_B
# B returns 'unsigned char', no range checking
- self.failUnlessEqual(3, getargs_B(3.14))
- self.failUnlessEqual(99, getargs_B(Long()))
- self.failUnlessEqual(99, getargs_B(Int()))
+ self.assertRaises(TypeError, getargs_B, 3.14)
+ self.assertEqual(99, getargs_B(Long()))
+ self.assertEqual(99, getargs_B(Int()))
- self.failUnlessEqual(UCHAR_MAX, getargs_B(-1))
- self.failUnlessEqual(UCHAR_MAX, getargs_B(-1L))
- self.failUnlessEqual(0, getargs_B(0))
- self.failUnlessEqual(UCHAR_MAX, getargs_B(UCHAR_MAX))
- self.failUnlessEqual(0, getargs_B(UCHAR_MAX+1))
+ self.assertEqual(UCHAR_MAX, getargs_B(-1))
+ self.assertEqual(UCHAR_MAX, getargs_B(-1L))
+ self.assertEqual(0, getargs_B(0))
+ self.assertEqual(UCHAR_MAX, getargs_B(UCHAR_MAX))
+ self.assertEqual(0, getargs_B(UCHAR_MAX+1))
- self.failUnlessEqual(42, getargs_B(42))
- self.failUnlessEqual(42, getargs_B(42L))
- self.failUnlessEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE))
+ self.assertEqual(42, getargs_B(42))
+ self.assertEqual(42, getargs_B(42L))
+ self.assertEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE))
def test_H(self):
from _testcapi import getargs_H
# H returns 'unsigned short', no range checking
- self.failUnlessEqual(3, getargs_H(3.14))
- self.failUnlessEqual(99, getargs_H(Long()))
- self.failUnlessEqual(99, getargs_H(Int()))
+ self.assertRaises(TypeError, getargs_H, 3.14)
+ self.assertEqual(99, getargs_H(Long()))
+ self.assertEqual(99, getargs_H(Int()))
- self.failUnlessEqual(USHRT_MAX, getargs_H(-1))
- self.failUnlessEqual(0, getargs_H(0))
- self.failUnlessEqual(USHRT_MAX, getargs_H(USHRT_MAX))
- self.failUnlessEqual(0, getargs_H(USHRT_MAX+1))
+ self.assertEqual(USHRT_MAX, getargs_H(-1))
+ self.assertEqual(0, getargs_H(0))
+ self.assertEqual(USHRT_MAX, getargs_H(USHRT_MAX))
+ self.assertEqual(0, getargs_H(USHRT_MAX+1))
- self.failUnlessEqual(42, getargs_H(42))
- self.failUnlessEqual(42, getargs_H(42L))
+ self.assertEqual(42, getargs_H(42))
+ self.assertEqual(42, getargs_H(42L))
- self.failUnlessEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE))
+ self.assertEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE))
def test_I(self):
from _testcapi import getargs_I
# I returns 'unsigned int', no range checking
- self.failUnlessEqual(3, getargs_I(3.14))
- self.failUnlessEqual(99, getargs_I(Long()))
- self.failUnlessEqual(99, getargs_I(Int()))
+ self.assertRaises(TypeError, getargs_I, 3.14)
+ self.assertEqual(99, getargs_I(Long()))
+ self.assertEqual(99, getargs_I(Int()))
- self.failUnlessEqual(UINT_MAX, getargs_I(-1))
- self.failUnlessEqual(0, getargs_I(0))
- self.failUnlessEqual(UINT_MAX, getargs_I(UINT_MAX))
- self.failUnlessEqual(0, getargs_I(UINT_MAX+1))
+ self.assertEqual(UINT_MAX, getargs_I(-1))
+ self.assertEqual(0, getargs_I(0))
+ self.assertEqual(UINT_MAX, getargs_I(UINT_MAX))
+ self.assertEqual(0, getargs_I(UINT_MAX+1))
- self.failUnlessEqual(42, getargs_I(42))
- self.failUnlessEqual(42, getargs_I(42L))
+ self.assertEqual(42, getargs_I(42))
+ self.assertEqual(42, getargs_I(42L))
- self.failUnlessEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE))
+ self.assertEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE))
def test_k(self):
from _testcapi import getargs_k
@@ -139,83 +131,114 @@ class Unsigned_TestCase(unittest.TestCase):
self.assertRaises(TypeError, getargs_k, Long())
self.assertRaises(TypeError, getargs_k, Int())
- self.failUnlessEqual(ULONG_MAX, getargs_k(-1))
- self.failUnlessEqual(0, getargs_k(0))
- self.failUnlessEqual(ULONG_MAX, getargs_k(ULONG_MAX))
- self.failUnlessEqual(0, getargs_k(ULONG_MAX+1))
+ self.assertEqual(ULONG_MAX, getargs_k(-1))
+ self.assertEqual(0, getargs_k(0))
+ self.assertEqual(ULONG_MAX, getargs_k(ULONG_MAX))
+ self.assertEqual(0, getargs_k(ULONG_MAX+1))
- self.failUnlessEqual(42, getargs_k(42))
- self.failUnlessEqual(42, getargs_k(42L))
+ self.assertEqual(42, getargs_k(42))
+ self.assertEqual(42, getargs_k(42L))
- self.failUnlessEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE))
+ self.assertEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE))
class Signed_TestCase(unittest.TestCase):
+ def test_h(self):
+ from _testcapi import getargs_h
+ # h returns 'short', and does range checking (SHRT_MIN ... SHRT_MAX)
+ self.assertRaises(TypeError, getargs_h, 3.14)
+ self.assertEqual(99, getargs_h(Long()))
+ self.assertEqual(99, getargs_h(Int()))
+
+ self.assertRaises(OverflowError, getargs_h, SHRT_MIN-1)
+ self.assertEqual(SHRT_MIN, getargs_h(SHRT_MIN))
+ self.assertEqual(SHRT_MAX, getargs_h(SHRT_MAX))
+ self.assertRaises(OverflowError, getargs_h, SHRT_MAX+1)
+
+ self.assertEqual(42, getargs_h(42))
+ self.assertEqual(42, getargs_h(42L))
+ self.assertRaises(OverflowError, getargs_h, VERY_LARGE)
+
def test_i(self):
from _testcapi import getargs_i
# i returns 'int', and does range checking (INT_MIN ... INT_MAX)
- self.failUnlessEqual(3, getargs_i(3.14))
- self.failUnlessEqual(99, getargs_i(Long()))
- self.failUnlessEqual(99, getargs_i(Int()))
+ self.assertRaises(TypeError, getargs_i, 3.14)
+ self.assertEqual(99, getargs_i(Long()))
+ self.assertEqual(99, getargs_i(Int()))
self.assertRaises(OverflowError, getargs_i, INT_MIN-1)
- self.failUnlessEqual(INT_MIN, getargs_i(INT_MIN))
- self.failUnlessEqual(INT_MAX, getargs_i(INT_MAX))
+ self.assertEqual(INT_MIN, getargs_i(INT_MIN))
+ self.assertEqual(INT_MAX, getargs_i(INT_MAX))
self.assertRaises(OverflowError, getargs_i, INT_MAX+1)
- self.failUnlessEqual(42, getargs_i(42))
- self.failUnlessEqual(42, getargs_i(42L))
+ self.assertEqual(42, getargs_i(42))
+ self.assertEqual(42, getargs_i(42L))
self.assertRaises(OverflowError, getargs_i, VERY_LARGE)
def test_l(self):
from _testcapi import getargs_l
# l returns 'long', and does range checking (LONG_MIN ... LONG_MAX)
- self.failUnlessEqual(3, getargs_l(3.14))
- self.failUnlessEqual(99, getargs_l(Long()))
- self.failUnlessEqual(99, getargs_l(Int()))
+ self.assertRaises(TypeError, getargs_l, 3.14)
+ self.assertEqual(99, getargs_l(Long()))
+ self.assertEqual(99, getargs_l(Int()))
self.assertRaises(OverflowError, getargs_l, LONG_MIN-1)
- self.failUnlessEqual(LONG_MIN, getargs_l(LONG_MIN))
- self.failUnlessEqual(LONG_MAX, getargs_l(LONG_MAX))
+ self.assertEqual(LONG_MIN, getargs_l(LONG_MIN))
+ self.assertEqual(LONG_MAX, getargs_l(LONG_MAX))
self.assertRaises(OverflowError, getargs_l, LONG_MAX+1)
- self.failUnlessEqual(42, getargs_l(42))
- self.failUnlessEqual(42, getargs_l(42L))
+ self.assertEqual(42, getargs_l(42))
+ self.assertEqual(42, getargs_l(42L))
self.assertRaises(OverflowError, getargs_l, VERY_LARGE)
def test_n(self):
from _testcapi import getargs_n
# n returns 'Py_ssize_t', and does range checking
# (PY_SSIZE_T_MIN ... PY_SSIZE_T_MAX)
- self.failUnlessEqual(3, getargs_n(3.14))
- self.failUnlessEqual(99, getargs_n(Long()))
- self.failUnlessEqual(99, getargs_n(Int()))
+ self.assertRaises(TypeError, getargs_n, 3.14)
+ self.assertEqual(99, getargs_n(Long()))
+ self.assertEqual(99, getargs_n(Int()))
self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MIN-1)
- self.failUnlessEqual(PY_SSIZE_T_MIN, getargs_n(PY_SSIZE_T_MIN))
- self.failUnlessEqual(PY_SSIZE_T_MAX, getargs_n(PY_SSIZE_T_MAX))
+ self.assertEqual(PY_SSIZE_T_MIN, getargs_n(PY_SSIZE_T_MIN))
+ self.assertEqual(PY_SSIZE_T_MAX, getargs_n(PY_SSIZE_T_MAX))
self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MAX+1)
- self.failUnlessEqual(42, getargs_n(42))
- self.failUnlessEqual(42, getargs_n(42L))
+ self.assertEqual(42, getargs_n(42))
+ self.assertEqual(42, getargs_n(42L))
self.assertRaises(OverflowError, getargs_n, VERY_LARGE)
class LongLong_TestCase(unittest.TestCase):
def test_L(self):
from _testcapi import getargs_L
- # L returns 'long long', and does range checking (LLONG_MIN ... LLONG_MAX)
- self.failUnlessRaises(TypeError, getargs_L, "Hello")
- self.failUnlessEqual(3, getargs_L(3.14))
- self.failUnlessEqual(99, getargs_L(Long()))
- self.failUnlessEqual(99, getargs_L(Int()))
+ # L returns 'long long', and does range checking (LLONG_MIN
+ # ... LLONG_MAX)
+ with warnings.catch_warnings():
+ warnings.filterwarnings(
+ "ignore",
+ category=DeprecationWarning,
+ message=".*integer argument expected, got float",
+ module=__name__)
+ self.assertEqual(3, getargs_L(3.14))
+ with warnings.catch_warnings():
+ warnings.filterwarnings(
+ "error",
+ category=DeprecationWarning,
+ message=".*integer argument expected, got float",
+ module="unittest")
+ self.assertRaises(DeprecationWarning, getargs_L, 3.14)
+
+ self.assertRaises(TypeError, getargs_L, "Hello")
+ self.assertEqual(99, getargs_L(Long()))
+ self.assertEqual(99, getargs_L(Int()))
self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1)
- self.failUnlessEqual(LLONG_MIN, getargs_L(LLONG_MIN))
- self.failUnlessEqual(LLONG_MAX, getargs_L(LLONG_MAX))
+ self.assertEqual(LLONG_MIN, getargs_L(LLONG_MIN))
+ self.assertEqual(LLONG_MAX, getargs_L(LLONG_MAX))
self.assertRaises(OverflowError, getargs_L, LLONG_MAX+1)
- self.failUnlessEqual(42, getargs_L(42))
- self.failUnlessEqual(42, getargs_L(42L))
+ self.assertEqual(42, getargs_L(42))
+ self.assertEqual(42, getargs_L(42L))
self.assertRaises(OverflowError, getargs_L, VERY_LARGE)
def test_K(self):
@@ -224,14 +247,14 @@ class LongLong_TestCase(unittest.TestCase):
self.assertRaises(TypeError, getargs_K, 3.14)
self.assertRaises(TypeError, getargs_K, Long())
self.assertRaises(TypeError, getargs_K, Int())
- self.failUnlessEqual(ULLONG_MAX, getargs_K(ULLONG_MAX))
- self.failUnlessEqual(0, getargs_K(0))
- self.failUnlessEqual(0, getargs_K(ULLONG_MAX+1))
+ self.assertEqual(ULLONG_MAX, getargs_K(ULLONG_MAX))
+ self.assertEqual(0, getargs_K(0))
+ self.assertEqual(0, getargs_K(ULLONG_MAX+1))
- self.failUnlessEqual(42, getargs_K(42))
- self.failUnlessEqual(42, getargs_K(42L))
+ self.assertEqual(42, getargs_K(42))
+ self.assertEqual(42, getargs_K(42L))
- self.failUnlessEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE))
+ self.assertEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE))
class Tuple_TestCase(unittest.TestCase):
@@ -239,7 +262,7 @@ class Tuple_TestCase(unittest.TestCase):
from _testcapi import getargs_tuple
ret = getargs_tuple(1, (2, 3))
- self.assertEquals(ret, (1,2,3))
+ self.assertEqual(ret, (1,2,3))
# make sure invalid tuple arguments are handled correctly
class seq:
@@ -252,25 +275,25 @@ class Tuple_TestCase(unittest.TestCase):
class Keywords_TestCase(unittest.TestCase):
def test_positional_args(self):
# using all positional args
- self.assertEquals(
+ self.assertEqual(
getargs_keywords((1,2), 3, (4,(5,6)), (7,8,9), 10),
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
)
def test_mixed_args(self):
# positional and keyword args
- self.assertEquals(
+ self.assertEqual(
getargs_keywords((1,2), 3, (4,(5,6)), arg4=(7,8,9), arg5=10),
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
)
def test_keyword_args(self):
# all keywords
- self.assertEquals(
+ self.assertEqual(
getargs_keywords(arg1=(1,2), arg2=3, arg3=(4,(5,6)), arg4=(7,8,9), arg5=10),
(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
)
def test_optional_args(self):
# missing optional keyword args, skipping tuples
- self.assertEquals(
+ self.assertEqual(
getargs_keywords(arg1=(1,2), arg2=3, arg5=10),
(1, 2, 3, -1, -1, -1, -1, -1, -1, 10)
)
@@ -279,14 +302,14 @@ class Keywords_TestCase(unittest.TestCase):
try:
getargs_keywords(arg1=(1,2))
except TypeError, err:
- self.assertEquals(str(err), "Required argument 'arg2' (pos 2) not found")
+ self.assertEqual(str(err), "Required argument 'arg2' (pos 2) not found")
else:
self.fail('TypeError should have been raised')
def test_too_many_args(self):
try:
getargs_keywords((1,2),3,(4,(5,6)),(7,8,9),10,111)
except TypeError, err:
- self.assertEquals(str(err), "function takes at most 5 arguments (6 given)")
+ self.assertEqual(str(err), "function takes at most 5 arguments (6 given)")
else:
self.fail('TypeError should have been raised')
def test_invalid_keyword(self):
@@ -294,7 +317,7 @@ class Keywords_TestCase(unittest.TestCase):
try:
getargs_keywords((1,2),3,arg5=10,arg666=666)
except TypeError, err:
- self.assertEquals(str(err), "'arg666' is an invalid keyword argument for this function")
+ self.assertEqual(str(err), "'arg666' is an invalid keyword argument for this function")
else:
self.fail('TypeError should have been raised')
diff --git a/Lib/test/test_getopt.py b/Lib/test/test_getopt.py
index 4967388c47..f924287bd3 100644
--- a/Lib/test/test_getopt.py
+++ b/Lib/test/test_getopt.py
@@ -1,45 +1,42 @@
# test_getopt.py
# David Goodger <dgoodger@bigfoot.com> 2000-08-19
-from test.test_support import verbose, run_doctest, run_unittest
+from test.test_support import verbose, run_doctest, run_unittest, EnvironmentVarGuard
import unittest
import getopt
-import os
sentinel = object()
class GetoptTests(unittest.TestCase):
def setUp(self):
- self.old_posixly_correct = os.environ.get("POSIXLY_CORRECT", sentinel)
- if self.old_posixly_correct is not sentinel:
- del os.environ["POSIXLY_CORRECT"]
+ self.env = EnvironmentVarGuard()
+ if "POSIXLY_CORRECT" in self.env:
+ del self.env["POSIXLY_CORRECT"]
def tearDown(self):
- if self.old_posixly_correct is sentinel:
- os.environ.pop("POSIXLY_CORRECT", None)
- else:
- os.environ["POSIXLY_CORRECT"] = self.old_posixly_correct
+ self.env.__exit__()
+ del self.env
def assertError(self, *args, **kwargs):
self.assertRaises(getopt.GetoptError, *args, **kwargs)
def test_short_has_arg(self):
- self.failUnless(getopt.short_has_arg('a', 'a:'))
- self.failIf(getopt.short_has_arg('a', 'a'))
+ self.assertTrue(getopt.short_has_arg('a', 'a:'))
+ self.assertFalse(getopt.short_has_arg('a', 'a'))
self.assertError(getopt.short_has_arg, 'a', 'b')
def test_long_has_args(self):
has_arg, option = getopt.long_has_args('abc', ['abc='])
- self.failUnless(has_arg)
+ self.assertTrue(has_arg)
self.assertEqual(option, 'abc')
has_arg, option = getopt.long_has_args('abc', ['abc'])
- self.failIf(has_arg)
+ self.assertFalse(has_arg)
self.assertEqual(option, 'abc')
has_arg, option = getopt.long_has_args('abc', ['abcd'])
- self.failIf(has_arg)
+ self.assertFalse(has_arg)
self.assertEqual(option, 'abcd')
self.assertError(getopt.long_has_args, 'abc', ['def'])
@@ -124,13 +121,18 @@ class GetoptTests(unittest.TestCase):
self.assertEqual(opts, [('-a', ''), ('-b', '1'),
('--alpha', ''), ('--beta', '2')])
+ # recognize "-" as an argument
+ opts, args = getopt.gnu_getopt(['-a', '-', '-b', '-'], 'ab:', [])
+ self.assertEqual(args, ['-'])
+ self.assertEqual(opts, [('-a', ''), ('-b', '-')])
+
# Posix style via +
opts, args = getopt.gnu_getopt(cmdline, '+ab:', ['alpha', 'beta='])
self.assertEqual(opts, [('-a', '')])
self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2'])
# Posix style via POSIXLY_CORRECT
- os.environ["POSIXLY_CORRECT"] = "1"
+ self.env["POSIXLY_CORRECT"] = "1"
opts, args = getopt.gnu_getopt(cmdline, 'ab:', ['alpha', 'beta='])
self.assertEqual(opts, [('-a', '')])
self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2'])
@@ -173,9 +175,9 @@ class GetoptTests(unittest.TestCase):
def test_issue4629(self):
longopts, shortopts = getopt.getopt(['--help='], '', ['help='])
- self.assertEquals(longopts, [('--help', '')])
+ self.assertEqual(longopts, [('--help', '')])
longopts, shortopts = getopt.getopt(['--help=x'], '', ['help='])
- self.assertEquals(longopts, [('--help', 'x')])
+ self.assertEqual(longopts, [('--help', 'x')])
self.assertRaises(getopt.GetoptError, getopt.getopt, ['--help='], '', ['help'])
def test_main():
diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py
index ab6bc9afa2..f0369543e0 100644
--- a/Lib/test/test_gettext.py
+++ b/Lib/test/test_gettext.py
@@ -58,29 +58,26 @@ LOCALEDIR = os.path.join('xx', 'LC_MESSAGES')
MOFILE = os.path.join(LOCALEDIR, 'gettext.mo')
UMOFILE = os.path.join(LOCALEDIR, 'ugettext.mo')
MMOFILE = os.path.join(LOCALEDIR, 'metadata.mo')
-try:
- LANG = os.environ['LANGUAGE']
-except:
- LANG = 'en'
class GettextBaseTest(unittest.TestCase):
def setUp(self):
if not os.path.isdir(LOCALEDIR):
os.makedirs(LOCALEDIR)
- fp = open(MOFILE, 'wb')
- fp.write(base64.decodestring(GNU_MO_DATA))
- fp.close()
- fp = open(UMOFILE, 'wb')
- fp.write(base64.decodestring(UMO_DATA))
- fp.close()
- fp = open(MMOFILE, 'wb')
- fp.write(base64.decodestring(MMO_DATA))
- fp.close()
- os.environ['LANGUAGE'] = 'xx'
+ with open(MOFILE, 'wb') as fp:
+ fp.write(base64.decodestring(GNU_MO_DATA))
+ with open(UMOFILE, 'wb') as fp:
+ fp.write(base64.decodestring(UMO_DATA))
+ with open(MMOFILE, 'wb') as fp:
+ fp.write(base64.decodestring(MMO_DATA))
+
+ self.env = test_support.EnvironmentVarGuard()
+ self.env['LANGUAGE'] = 'xx'
+ gettext._translations.clear()
def tearDown(self):
- os.environ['LANGUAGE'] = LANG
+ self.env.__exit__()
+ del self.env
shutil.rmtree(os.path.split(LOCALEDIR)[0])
@@ -136,9 +133,8 @@ trggrkg zrffntr pngnybt yvoenel.''')
def test_the_alternative_interface(self):
eq = self.assertEqual
# test the alternative interface
- fp = open(self.mofile, 'rb')
- t = gettext.GNUTranslations(fp)
- fp.close()
+ with open(self.mofile, 'rb') as fp:
+ t = gettext.GNUTranslations(fp)
# Install the translation object
t.install()
eq(_('nudge nudge'), 'wink wink')
@@ -228,9 +224,8 @@ class PluralFormsTestCase(GettextBaseTest):
def test_plural_forms2(self):
eq = self.assertEqual
- fp = open(self.mofile, 'rb')
- t = gettext.GNUTranslations(fp)
- fp.close()
+ with open(self.mofile, 'rb') as fp:
+ t = gettext.GNUTranslations(fp)
x = t.ngettext('There is %s file', 'There are %s files', 1)
eq(x, 'Hay %s fichero')
x = t.ngettext('There is %s file', 'There are %s files', 2)
@@ -300,15 +295,12 @@ class PluralFormsTestCase(GettextBaseTest):
class UnicodeTranslationsTest(GettextBaseTest):
def setUp(self):
GettextBaseTest.setUp(self)
- fp = open(UMOFILE, 'rb')
- try:
+ with open(UMOFILE, 'rb') as fp:
self.t = gettext.GNUTranslations(fp)
- finally:
- fp.close()
self._ = self.t.ugettext
def test_unicode_msgid(self):
- unless = self.failUnless
+ unless = self.assertTrue
unless(isinstance(self._(''), unicode))
unless(isinstance(self._(u''), unicode))
@@ -320,15 +312,12 @@ class UnicodeTranslationsTest(GettextBaseTest):
class WeirdMetadataTest(GettextBaseTest):
def setUp(self):
GettextBaseTest.setUp(self)
- fp = open(MMOFILE, 'rb')
- try:
+ with open(MMOFILE, 'rb') as fp:
try:
self.t = gettext.GNUTranslations(fp)
except:
self.tearDown()
raise
- finally:
- fp.close()
def test_weird_metadata(self):
info = self.t.info()
@@ -336,6 +325,37 @@ class WeirdMetadataTest(GettextBaseTest):
'John Doe <jdoe@example.com>\nJane Foobar <jfoobar@example.com>')
+class DummyGNUTranslations(gettext.GNUTranslations):
+ def foo(self):
+ return 'foo'
+
+
+class GettextCacheTestCase(GettextBaseTest):
+ def test_cache(self):
+ self.localedir = os.curdir
+ self.mofile = MOFILE
+
+ self.assertEqual(len(gettext._translations), 0)
+
+ t = gettext.translation('gettext', self.localedir)
+
+ self.assertEqual(len(gettext._translations), 1)
+
+ t = gettext.translation('gettext', self.localedir,
+ class_=DummyGNUTranslations)
+
+ self.assertEqual(len(gettext._translations), 2)
+ self.assertEqual(t.__class__, DummyGNUTranslations)
+
+ # Calling it again doesn't add to the cache
+
+ t = gettext.translation('gettext', self.localedir,
+ class_=DummyGNUTranslations)
+
+ self.assertEqual(len(gettext._translations), 2)
+ self.assertEqual(t.__class__, DummyGNUTranslations)
+
+
def test_main():
test_support.run_unittest(__name__)
diff --git a/Lib/test/test_gl.py b/Lib/test/test_gl.py
index 20fd776fd1..c9264ee6bc 100755
--- a/Lib/test/test_gl.py
+++ b/Lib/test/test_gl.py
@@ -3,8 +3,11 @@
taken mostly from the documentation.
Roger E. Masse
"""
-from test.test_support import verbose, TestSkipped
-import gl, GL, time
+import unittest
+from test.test_support import verbose, import_module
+import time
+gl = import_module('gl')
+GL = import_module('GL')
glattrs = ['RGBcolor', 'RGBcursor', 'RGBmode', 'RGBrange', 'RGBwritemask',
'__doc__', '__name__', 'addtopup', 'altgetmatrix', 'arc', 'arcf',
@@ -87,7 +90,7 @@ def test_main():
try:
display = os.environ['DISPLAY']
except:
- raise TestSkipped, "No $DISPLAY -- skipping gl test"
+ raise unittest.SkipTest, "No $DISPLAY -- skipping gl test"
# touch all the attributes of gl without doing anything
if verbose:
diff --git a/Lib/test/test_glob.py b/Lib/test/test_glob.py
index f1993aba31..692322d2bd 100644
--- a/Lib/test/test_glob.py
+++ b/Lib/test/test_glob.py
@@ -59,8 +59,8 @@ class GlobTests(unittest.TestCase):
if set(type(x) for x in tmp) == uniset:
u1 = glob.glob(u'*')
u2 = glob.glob(u'./*')
- self.assertEquals(set(type(r) for r in u1), uniset)
- self.assertEquals(set(type(r) for r in u2), uniset)
+ self.assertEqual(set(type(r) for r in u1), uniset)
+ self.assertEqual(set(type(r) for r in u2), uniset)
def test_glob_one_directory(self):
eq = self.assertSequencesEqual_noorder
@@ -96,7 +96,7 @@ class GlobTests(unittest.TestCase):
res = glob.glob(self.tempdir + '*' + os.sep)
self.assertEqual(len(res), 1)
# either of these results are reasonable
- self.assertTrue(res[0] in [self.tempdir, self.tempdir + os.sep])
+ self.assertIn(res[0], [self.tempdir, self.tempdir + os.sep])
def test_glob_broken_symlinks(self):
if hasattr(os, 'symlink'):
diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py
index 58dda40510..137ac233fc 100644
--- a/Lib/test/test_grammar.py
+++ b/Lib/test/test_grammar.py
@@ -1,53 +1,47 @@
# Python test set -- part 1, grammar.
# This just tests whether the parser accepts them all.
-# NOTE: When you run this test as a script from the command line, you
-# get warnings about certain hex/oct constants. Since those are
-# issued by the parser, you can't suppress them by adding a
-# filterwarnings() call to this module. Therefore, to shut up the
-# regression test, the filterwarnings() call has been added to
-# regrtest.py.
-
-from test.test_support import (run_unittest, check_syntax_error,
- _check_py3k_warnings)
+from test.test_support import run_unittest, check_syntax_error, \
+ check_py3k_warnings
import unittest
import sys
# testing import *
from sys import *
+
class TokenTests(unittest.TestCase):
def testBackslash(self):
# Backslash means line continuation:
x = 1 \
+ 1
- self.assertEquals(x, 2, 'backslash for line continuation')
+ self.assertEqual(x, 2, 'backslash for line continuation')
# Backslash does not means continuation in comments :\
x = 0
- self.assertEquals(x, 0, 'backslash ending comment')
+ self.assertEqual(x, 0, 'backslash ending comment')
def testPlainIntegers(self):
- self.assertEquals(0xff, 255)
- self.assertEquals(0377, 255)
- self.assertEquals(2147483647, 017777777777)
+ self.assertEqual(0xff, 255)
+ self.assertEqual(0377, 255)
+ self.assertEqual(2147483647, 017777777777)
# "0x" is not a valid literal
self.assertRaises(SyntaxError, eval, "0x")
from sys import maxint
if maxint == 2147483647:
- self.assertEquals(-2147483647-1, -020000000000)
+ self.assertEqual(-2147483647-1, -020000000000)
# XXX -2147483648
- self.assert_(037777777777 > 0)
- self.assert_(0xffffffff > 0)
+ self.assertTrue(037777777777 > 0)
+ self.assertTrue(0xffffffff > 0)
for s in '2147483648', '040000000000', '0x100000000':
try:
x = eval(s)
except OverflowError:
self.fail("OverflowError on huge integer literal %r" % s)
elif maxint == 9223372036854775807:
- self.assertEquals(-9223372036854775807-1, -01000000000000000000000)
- self.assert_(01777777777777777777777 > 0)
- self.assert_(0xffffffffffffffff > 0)
+ self.assertEqual(-9223372036854775807-1, -01000000000000000000000)
+ self.assertTrue(01777777777777777777777 > 0)
+ self.assertTrue(0xffffffffffffffff > 0)
for s in '9223372036854775808', '02000000000000000000000', \
'0x10000000000000000':
try:
@@ -82,15 +76,15 @@ class TokenTests(unittest.TestCase):
x = 3.1e4
def testStringLiterals(self):
- x = ''; y = ""; self.assert_(len(x) == 0 and x == y)
- x = '\''; y = "'"; self.assert_(len(x) == 1 and x == y and ord(x) == 39)
- x = '"'; y = "\""; self.assert_(len(x) == 1 and x == y and ord(x) == 34)
+ x = ''; y = ""; self.assertTrue(len(x) == 0 and x == y)
+ x = '\''; y = "'"; self.assertTrue(len(x) == 1 and x == y and ord(x) == 39)
+ x = '"'; y = "\""; self.assertTrue(len(x) == 1 and x == y and ord(x) == 34)
x = "doesn't \"shrink\" does it"
y = 'doesn\'t "shrink" does it'
- self.assert_(len(x) == 24 and x == y)
+ self.assertTrue(len(x) == 24 and x == y)
x = "does \"shrink\" doesn't it"
y = 'does "shrink" doesn\'t it'
- self.assert_(len(x) == 24 and x == y)
+ self.assertTrue(len(x) == 24 and x == y)
x = """
The "quick"
brown fox
@@ -98,28 +92,28 @@ jumps over
the 'lazy' dog.
"""
y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
- self.assertEquals(x, y)
+ self.assertEqual(x, y)
y = '''
The "quick"
brown fox
jumps over
the 'lazy' dog.
'''
- self.assertEquals(x, y)
+ self.assertEqual(x, y)
y = "\n\
The \"quick\"\n\
brown fox\n\
jumps over\n\
the 'lazy' dog.\n\
"
- self.assertEquals(x, y)
+ self.assertEqual(x, y)
y = '\n\
The \"quick\"\n\
brown fox\n\
jumps over\n\
the \'lazy\' dog.\n\
'
- self.assertEquals(x, y)
+ self.assertEqual(x, y)
class GrammarTests(unittest.TestCase):
@@ -156,18 +150,18 @@ class GrammarTests(unittest.TestCase):
# Silence Py3k warning
exec('def f4(two, (compound, (argument, list))): pass')
exec('def f5((compound, first), two): pass')
- self.assertEquals(f2.func_code.co_varnames, ('one_argument',))
- self.assertEquals(f3.func_code.co_varnames, ('two', 'arguments'))
+ self.assertEqual(f2.func_code.co_varnames, ('one_argument',))
+ self.assertEqual(f3.func_code.co_varnames, ('two', 'arguments'))
if sys.platform.startswith('java'):
- self.assertEquals(f4.func_code.co_varnames,
+ self.assertEqual(f4.func_code.co_varnames,
('two', '(compound, (argument, list))', 'compound', 'argument',
'list',))
- self.assertEquals(f5.func_code.co_varnames,
+ self.assertEqual(f5.func_code.co_varnames,
('(compound, first)', 'two', 'compound', 'first'))
else:
- self.assertEquals(f4.func_code.co_varnames,
+ self.assertEqual(f4.func_code.co_varnames,
('two', '.1', 'compound', 'argument', 'list'))
- self.assertEquals(f5.func_code.co_varnames,
+ self.assertEqual(f5.func_code.co_varnames,
('.0', 'two', 'compound', 'first'))
def a1(one_arg,): pass
def a2(two, args,): pass
@@ -204,10 +198,10 @@ class GrammarTests(unittest.TestCase):
# ceval unpacks the formal arguments into the first argcount names;
# thus, the names nested inside tuples must appear after these names.
if sys.platform.startswith('java'):
- self.assertEquals(v3.func_code.co_varnames, ('a', '(b, c)', 'rest', 'b', 'c'))
+ self.assertEqual(v3.func_code.co_varnames, ('a', '(b, c)', 'rest', 'b', 'c'))
else:
- self.assertEquals(v3.func_code.co_varnames, ('a', '.1', 'rest', 'b', 'c'))
- self.assertEquals(v3(1, (2, 3), 4), (1, 2, 3, (4,)))
+ self.assertEqual(v3.func_code.co_varnames, ('a', '.1', 'rest', 'b', 'c'))
+ self.assertEqual(v3(1, (2, 3), 4), (1, 2, 3, (4,)))
def d01(a=1): pass
d01()
d01(1)
@@ -289,7 +283,7 @@ class GrammarTests(unittest.TestCase):
# keyword arguments after *arglist
def f(*args, **kwargs):
return args, kwargs
- self.assertEquals(f(1, x=2, *[3, 4], y=5), ((1, 3, 4),
+ self.assertEqual(f(1, x=2, *[3, 4], y=5), ((1, 3, 4),
{'x':2, 'y':5}))
self.assertRaises(SyntaxError, eval, "f(1, *(2,3), 4)")
self.assertRaises(SyntaxError, eval, "f(1, x=2, *(3,4), x=5)")
@@ -301,15 +295,15 @@ class GrammarTests(unittest.TestCase):
def testLambdef(self):
### lambdef: 'lambda' [varargslist] ':' test
l1 = lambda : 0
- self.assertEquals(l1(), 0)
+ self.assertEqual(l1(), 0)
l2 = lambda : a[d] # XXX just testing the expression
l3 = lambda : [2 < x for x in [-1, 3, 0L]]
- self.assertEquals(l3(), [0, 1, 0])
+ self.assertEqual(l3(), [0, 1, 0])
l4 = lambda x = lambda y = lambda z=1 : z : y() : x()
- self.assertEquals(l4(), 1)
+ self.assertEqual(l4(), 1)
l5 = lambda x, y, z=2: x + y + z
- self.assertEquals(l5(1, 2), 5)
- self.assertEquals(l5(1, 2, 3), 6)
+ self.assertEqual(l5(1, 2), 5)
+ self.assertEqual(l5(1, 2, 3), 6)
check_syntax_error(self, "lambda x: x = 2")
check_syntax_error(self, "lambda (None,): None")
@@ -320,7 +314,7 @@ class GrammarTests(unittest.TestCase):
### simple_stmt: small_stmt (';' small_stmt)* [';']
x = 1; pass; del x
def foo():
- # verify statments that end with semi-colons
+ # verify statements that end with semi-colons
x = 1; pass; del x;
foo()
@@ -545,8 +539,6 @@ hello world
g = {}
l = {}
- import warnings
- warnings.filterwarnings("ignore", "global statement", module="<string>")
exec 'global a; a = 1; b = 2' in g, l
if '__builtins__' in g: del g['__builtins__']
if '__builtins__' in l: del l['__builtins__']
@@ -554,7 +546,7 @@ hello world
self.fail('exec ... in g (%s), l (%s)' %(g,l))
def testAssert(self):
- # assert_stmt: 'assert' test [',' test]
+ # assertTruestmt: 'assert' test [',' test]
assert 1
assert 1, 1
assert lambda x:x
@@ -562,7 +554,7 @@ hello world
try:
assert 0, "msg"
except AssertionError, e:
- self.assertEquals(e.args[0], "msg")
+ self.assertEqual(e.args[0], "msg")
else:
if __debug__:
self.fail("AssertionError not raised by assert 0")
@@ -596,7 +588,7 @@ hello world
x = 1
else:
x = 2
- self.assertEquals(x, 2)
+ self.assertEqual(x, 2)
def testFor(self):
# 'for' exprlist 'in' exprlist ':' suite ['else' ':' suite]
@@ -751,11 +743,11 @@ hello world
d[1,2,3] = 4
L = list(d)
L.sort()
- self.assertEquals(str(L), '[1, (1,), (1, 2), (1, 2, 3)]')
+ self.assertEqual(str(L), '[1, (1,), (1, 2), (1, 2, 3)]')
def testAtoms(self):
### atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING
- ### dictmaker: test ':' test (',' test ':' test)* [',']
+ ### dictorsetmaker: (test ':' test (',' test ':' test)* [',']) | (test (',' test)* [','])
x = (1)
x = (1 or 2 or 3)
@@ -775,6 +767,11 @@ hello world
x = {'one': 1, 'two': 2,}
x = {'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6}
+ x = {'one'}
+ x = {'one', 1,}
+ x = {'one', 'two', 'three'}
+ x = {2, 3, 4,}
+
# Silence Py3k warning
x = eval('`x`')
x = eval('`1 or 2 or 3`')
@@ -810,6 +807,13 @@ hello world
pass
self.assertEqual(G.decorated, True)
+ def testDictcomps(self):
+ # dictorsetmaker: ( (test ':' test (comp_for |
+ # (',' test ':' test)* [','])) |
+ # (test (comp_for | (',' test)* [','])) )
+ nums = [1, 2, 3]
+ self.assertEqual({i:i+1 for i in nums}, {1: 2, 2: 3, 3: 4})
+
def testListcomps(self):
# list comprehension tests
nums = [1, 2, 3, 4, 5]
@@ -927,6 +931,26 @@ hello world
self.assertEqual([x for x, in [(4,), (5,), (6,)]], [4, 5, 6])
self.assertEqual(list(x for x, in [(7,), (8,), (9,)]), [7, 8, 9])
+ def test_with_statement(self):
+ class manager(object):
+ def __enter__(self):
+ return (1, 2)
+ def __exit__(self, *args):
+ pass
+
+ with manager():
+ pass
+ with manager() as x:
+ pass
+ with manager() as (x, y):
+ pass
+ with manager(), manager():
+ pass
+ with manager() as x, manager() as y:
+ pass
+ with manager() as x, manager():
+ pass
+
def testIfElseExpr(self):
# Test ifelse expressions in various cases
def _checkeval(msg, ret):
@@ -953,9 +977,17 @@ hello world
self.assertEqual((6 / 2 if 1 else 3), 3)
self.assertEqual((6 < 4 if 0 else 2), 2)
+ def test_paren_evaluation(self):
+ self.assertEqual(16 // (4 // 2), 8)
+ self.assertEqual((16 // 4) // 2, 2)
+ self.assertEqual(16 // 4 // 2, 2)
+ self.assertTrue(False is (2 is 3))
+ self.assertFalse((False is 2) is 3)
+ self.assertFalse(False is 2 is 3)
+
def test_main():
- with _check_py3k_warnings(
+ with check_py3k_warnings(
("backquote not supported", SyntaxWarning),
("tuple parameter unpacking has been removed", SyntaxWarning),
("parenthesized argument names are invalid", SyntaxWarning),
diff --git a/Lib/test/test_grp.py b/Lib/test/test_grp.py
index 564c7f0067..e9e1758263 100755..100644
--- a/Lib/test/test_grp.py
+++ b/Lib/test/test_grp.py
@@ -1,9 +1,10 @@
"""Test script for the grp module."""
-import grp
import unittest
from test import test_support
+grp = test_support.import_module('grp')
+
class GroupDatabaseTestCase(unittest.TestCase):
def check_value(self, value):
@@ -11,13 +12,13 @@ class GroupDatabaseTestCase(unittest.TestCase):
# attributes promised by the docs
self.assertEqual(len(value), 4)
self.assertEqual(value[0], value.gr_name)
- self.assert_(isinstance(value.gr_name, basestring))
+ self.assertIsInstance(value.gr_name, basestring)
self.assertEqual(value[1], value.gr_passwd)
- self.assert_(isinstance(value.gr_passwd, basestring))
+ self.assertIsInstance(value.gr_passwd, basestring)
self.assertEqual(value[2], value.gr_gid)
- self.assert_(isinstance(value.gr_gid, int))
+ self.assertIsInstance(value.gr_gid, int)
self.assertEqual(value[3], value.gr_mem)
- self.assert_(isinstance(value.gr_mem, list))
+ self.assertIsInstance(value.gr_mem, list)
def test_values(self):
entries = grp.getgrall()
@@ -32,12 +33,16 @@ class GroupDatabaseTestCase(unittest.TestCase):
e2 = grp.getgrgid(e.gr_gid)
self.check_value(e2)
self.assertEqual(e2.gr_gid, e.gr_gid)
- e2 = grp.getgrnam(e.gr_name)
+ name = e.gr_name
+ if name.startswith('+') or name.startswith('-'):
+ # NIS-related entry
+ continue
+ e2 = grp.getgrnam(name)
self.check_value(e2)
# There are instances where getgrall() returns group names in
# lowercase while getgrgid() returns proper casing.
# Discovered on Ubuntu 5.04 (custom).
- self.assertEqual(e2.gr_name.lower(), e.gr_name.lower())
+ self.assertEqual(e2.gr_name.lower(), name.lower())
def test_errors(self):
self.assertRaises(TypeError, grp.getgrgid)
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
index 105882abbc..573879e522 100644
--- a/Lib/test/test_gzip.py
+++ b/Lib/test/test_gzip.py
@@ -5,8 +5,9 @@
import unittest
from test import test_support
import os
-import gzip
-
+import io
+import struct
+gzip = test_support.import_module('gzip')
data1 = """ int length=DEFAULTALLOC, err = Z_OK;
PyObject *RetVal;
@@ -32,14 +33,15 @@ class TestGzip(unittest.TestCase):
def test_write(self):
- f = gzip.GzipFile(self.filename, 'wb') ; f.write(data1 * 50)
-
- # Try flush and fileno.
- f.flush()
- f.fileno()
- if hasattr(os, 'fsync'):
- os.fsync(f.fileno())
- f.close()
+ with gzip.GzipFile(self.filename, 'wb') as f:
+ f.write(data1 * 50)
+
+ # Try flush and fileno.
+ f.flush()
+ f.fileno()
+ if hasattr(os, 'fsync'):
+ os.fsync(f.fileno())
+ f.close()
# Test multiple close() calls.
f.close()
@@ -47,118 +49,230 @@ class TestGzip(unittest.TestCase):
def test_read(self):
self.test_write()
# Try reading.
- f = gzip.GzipFile(self.filename, 'r') ; d = f.read() ; f.close()
+ with gzip.GzipFile(self.filename, 'r') as f:
+ d = f.read()
self.assertEqual(d, data1*50)
+ def test_io_on_closed_object(self):
+ # Test that I/O operations on closed GzipFile objects raise a
+ # ValueError, just like the corresponding functions on file objects.
+
+ # Write to a file, open it for reading, then close it.
+ self.test_write()
+ f = gzip.GzipFile(self.filename, 'r')
+ f.close()
+ with self.assertRaises(ValueError):
+ f.read(1)
+ with self.assertRaises(ValueError):
+ f.seek(0)
+ with self.assertRaises(ValueError):
+ f.tell()
+ # Open the file for writing, then close it.
+ f = gzip.GzipFile(self.filename, 'w')
+ f.close()
+ with self.assertRaises(ValueError):
+ f.write('')
+ with self.assertRaises(ValueError):
+ f.flush()
+
def test_append(self):
self.test_write()
# Append to the previous file
- f = gzip.GzipFile(self.filename, 'ab') ; f.write(data2 * 15) ; f.close()
+ with gzip.GzipFile(self.filename, 'ab') as f:
+ f.write(data2 * 15)
- f = gzip.GzipFile(self.filename, 'rb') ; d = f.read() ; f.close()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ d = f.read()
self.assertEqual(d, (data1*50) + (data2*15))
def test_many_append(self):
# Bug #1074261 was triggered when reading a file that contained
# many, many members. Create such a file and verify that reading it
# works.
- f = gzip.open(self.filename, 'wb', 9)
- f.write('a')
- f.close()
- for i in range(0,200):
- f = gzip.open(self.filename, "ab", 9) # append
+ with gzip.open(self.filename, 'wb', 9) as f:
f.write('a')
- f.close()
+ for i in range(0, 200):
+ with gzip.open(self.filename, "ab", 9) as f: # append
+ f.write('a')
# Try reading the file
- zgfile = gzip.open(self.filename, "rb")
- contents = ""
- while 1:
- ztxt = zgfile.read(8192)
- contents += ztxt
- if not ztxt: break
- zgfile.close()
- self.assertEquals(contents, 'a'*201)
+ with gzip.open(self.filename, "rb") as zgfile:
+ contents = ""
+ while 1:
+ ztxt = zgfile.read(8192)
+ contents += ztxt
+ if not ztxt: break
+ self.assertEqual(contents, 'a'*201)
+
+ def test_buffered_reader(self):
+ # Issue #7471: a GzipFile can be wrapped in a BufferedReader for
+ # performance.
+ self.test_write()
+
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ with io.BufferedReader(f) as r:
+ lines = [line for line in r]
+ self.assertEqual(lines, 50 * data1.splitlines(True))
def test_readline(self):
self.test_write()
# Try .readline() with varying line lengths
- f = gzip.GzipFile(self.filename, 'rb')
- line_length = 0
- while 1:
- L = f.readline(line_length)
- if L == "" and line_length != 0: break
- self.assert_(len(L) <= line_length)
- line_length = (line_length + 1) % 50
- f.close()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ line_length = 0
+ while 1:
+ L = f.readline(line_length)
+ if not L and line_length != 0: break
+ self.assertTrue(len(L) <= line_length)
+ line_length = (line_length + 1) % 50
def test_readlines(self):
self.test_write()
# Try .readlines()
- f = gzip.GzipFile(self.filename, 'rb')
- L = f.readlines()
- f.close()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ L = f.readlines()
- f = gzip.GzipFile(self.filename, 'rb')
- while 1:
- L = f.readlines(150)
- if L == []: break
- f.close()
+ with gzip.GzipFile(self.filename, 'rb') as f:
+ while 1:
+ L = f.readlines(150)
+ if L == []: break
def test_seek_read(self):
self.test_write()
# Try seek, read test
- f = gzip.GzipFile(self.filename)
- while 1:
- oldpos = f.tell()
- line1 = f.readline()
- if not line1: break
- newpos = f.tell()
- f.seek(oldpos) # negative seek
- if len(line1)>10:
- amount = 10
- else:
- amount = len(line1)
- line2 = f.read(amount)
- self.assertEqual(line1[:amount], line2)
- f.seek(newpos) # positive seek
- f.close()
+ with gzip.GzipFile(self.filename) as f:
+ while 1:
+ oldpos = f.tell()
+ line1 = f.readline()
+ if not line1: break
+ newpos = f.tell()
+ f.seek(oldpos) # negative seek
+ if len(line1)>10:
+ amount = 10
+ else:
+ amount = len(line1)
+ line2 = f.read(amount)
+ self.assertEqual(line1[:amount], line2)
+ f.seek(newpos) # positive seek
def test_seek_whence(self):
self.test_write()
# Try seek(whence=1), read test
- f = gzip.GzipFile(self.filename)
- f.read(10)
- f.seek(10, whence=1)
- y = f.read(10)
- f.close()
- self.assertEquals(y, data1[20:30])
+ with gzip.GzipFile(self.filename) as f:
+ f.read(10)
+ f.seek(10, whence=1)
+ y = f.read(10)
+ self.assertEqual(y, data1[20:30])
def test_seek_write(self):
# Try seek, write test
- f = gzip.GzipFile(self.filename, 'w')
- for pos in range(0, 256, 16):
- f.seek(pos)
- f.write('GZ\n')
- f.close()
+ with gzip.GzipFile(self.filename, 'w') as f:
+ for pos in range(0, 256, 16):
+ f.seek(pos)
+ f.write('GZ\n')
def test_mode(self):
self.test_write()
- f = gzip.GzipFile(self.filename, 'r')
- self.assertEqual(f.myfileobj.mode, 'rb')
- f.close()
+ with gzip.GzipFile(self.filename, 'r') as f:
+ self.assertEqual(f.myfileobj.mode, 'rb')
def test_1647484(self):
for mode in ('wb', 'rb'):
- f = gzip.GzipFile(self.filename, mode)
- self.assert_(hasattr(f, "name"))
- self.assertEqual(f.name, self.filename)
- f.close()
+ with gzip.GzipFile(self.filename, mode) as f:
+ self.assertTrue(hasattr(f, "name"))
+ self.assertEqual(f.name, self.filename)
+
+ def test_mtime(self):
+ mtime = 123456789
+ with gzip.GzipFile(self.filename, 'w', mtime = mtime) as fWrite:
+ fWrite.write(data1)
+ with gzip.GzipFile(self.filename) as fRead:
+ dataRead = fRead.read()
+ self.assertEqual(dataRead, data1)
+ self.assertTrue(hasattr(fRead, 'mtime'))
+ self.assertEqual(fRead.mtime, mtime)
+
+ def test_metadata(self):
+ mtime = 123456789
+
+ with gzip.GzipFile(self.filename, 'w', mtime = mtime) as fWrite:
+ fWrite.write(data1)
+
+ with open(self.filename, 'rb') as fRead:
+ # see RFC 1952: http://www.faqs.org/rfcs/rfc1952.html
+
+ idBytes = fRead.read(2)
+ self.assertEqual(idBytes, '\x1f\x8b') # gzip ID
+
+ cmByte = fRead.read(1)
+ self.assertEqual(cmByte, '\x08') # deflate
+
+ flagsByte = fRead.read(1)
+ self.assertEqual(flagsByte, '\x08') # only the FNAME flag is set
+
+ mtimeBytes = fRead.read(4)
+ self.assertEqual(mtimeBytes, struct.pack('<i', mtime)) # little-endian
+
+ xflByte = fRead.read(1)
+ self.assertEqual(xflByte, '\x02') # maximum compression
+
+ osByte = fRead.read(1)
+ self.assertEqual(osByte, '\xff') # OS "unknown" (OS-independent)
+
+ # Since the FNAME flag is set, the zero-terminated filename follows.
+ # RFC 1952 specifies that this is the name of the input file, if any.
+ # However, the gzip module defaults to storing the name of the output
+ # file in this field.
+ expected = self.filename.encode('Latin-1') + '\x00'
+ nameBytes = fRead.read(len(expected))
+ self.assertEqual(nameBytes, expected)
+
+ # Since no other flags were set, the header ends here.
+ # Rather than process the compressed data, let's seek to the trailer.
+ fRead.seek(os.stat(self.filename).st_size - 8)
+
+ crc32Bytes = fRead.read(4) # CRC32 of uncompressed data [data1]
+ self.assertEqual(crc32Bytes, '\xaf\xd7d\x83')
+
+ isizeBytes = fRead.read(4)
+ self.assertEqual(isizeBytes, struct.pack('<i', len(data1)))
+
+ def test_with_open(self):
+ # GzipFile supports the context management protocol
+ with gzip.GzipFile(self.filename, "wb") as f:
+ f.write(b"xxx")
+ f = gzip.GzipFile(self.filename, "rb")
+ f.close()
+ try:
+ with f:
+ pass
+ except ValueError:
+ pass
+ else:
+ self.fail("__enter__ on a closed file didn't raise an exception")
+ try:
+ with gzip.GzipFile(self.filename, "wb") as f:
+ 1 // 0
+ except ZeroDivisionError:
+ pass
+ else:
+ self.fail("1 // 0 didn't raise an exception")
+
+ def test_zero_padded_file(self):
+ with gzip.GzipFile(self.filename, "wb") as f:
+ f.write(data1 * 50)
+
+ # Pad the file with zeroes
+ with open(self.filename, "ab") as f:
+ f.write("\x00" * 50)
+
+ with gzip.GzipFile(self.filename, "rb") as f:
+ d = f.read()
+ self.assertEqual(d, data1 * 50, "Incorrect data in file")
def test_main(verbose=None):
test_support.run_unittest(TestGzip)
diff --git a/Lib/test/test_hash.py b/Lib/test/test_hash.py
index 7ce40b95b7..d2571d0acd 100644
--- a/Lib/test/test_hash.py
+++ b/Lib/test/test_hash.py
@@ -35,6 +35,7 @@ class HashEqualityTestCase(unittest.TestCase):
self.same_hash(int(-2**63), long(-2**63), float(-2**63))
self.same_hash(int(1-2**63), long(1-2**63))
self.same_hash(int(2**63-1), long(2**63-1))
+ self.same_hash(long(2**63), float(2**63))
def test_coerced_floats(self):
self.same_hash(long(1.23e300), float(1.23e300))
@@ -104,11 +105,11 @@ class HashInheritanceTestCase(unittest.TestCase):
objects = (self.default_expected +
self.fixed_expected)
for obj in objects:
- self.assert_(isinstance(obj, Hashable), repr(obj))
+ self.assertIsInstance(obj, Hashable)
def test_not_hashable(self):
for obj in self.error_expected:
- self.assertFalse(isinstance(obj, Hashable), repr(obj))
+ self.assertNotIsInstance(obj, Hashable)
# Issue #4701: Check that some builtin types are correctly hashable
diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py
index 52c50f534b..855ecbfb4e 100644
--- a/Lib/test/test_hashlib.py
+++ b/Lib/test/test_hashlib.py
@@ -6,11 +6,23 @@
# Licensed to PSF under a Contributor Agreement.
#
+import array
import hashlib
+import itertools
+import sys
+try:
+ import threading
+except ImportError:
+ threading = None
import unittest
+import warnings
from test import test_support
from test.test_support import _4G, precisionbigmemtest
+# Were we compiled --with-pydebug or with #define Py_DEBUG?
+COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
+
+
def hexstr(s):
import string
h = string.hexdigits
@@ -26,24 +38,111 @@ class HashLibTestCase(unittest.TestCase):
'sha224', 'SHA224', 'sha256', 'SHA256',
'sha384', 'SHA384', 'sha512', 'SHA512' )
+ _warn_on_extension_import = COMPILED_WITH_PYDEBUG
+
+ def _conditional_import_module(self, module_name):
+ """Import a module and return a reference to it or None on failure."""
+ try:
+ exec('import '+module_name)
+ except ImportError, error:
+ if self._warn_on_extension_import:
+ warnings.warn('Did a C extension fail to compile? %s' % error)
+ return locals().get(module_name)
+
+ def __init__(self, *args, **kwargs):
+ algorithms = set()
+ for algorithm in self.supported_hash_names:
+ algorithms.add(algorithm.lower())
+ self.constructors_to_test = {}
+ for algorithm in algorithms:
+ self.constructors_to_test[algorithm] = set()
+
+ # For each algorithm, test the direct constructor and the use
+ # of hashlib.new given the algorithm name.
+ for algorithm, constructors in self.constructors_to_test.items():
+ constructors.add(getattr(hashlib, algorithm))
+ def _test_algorithm_via_hashlib_new(data=None, _alg=algorithm):
+ if data is None:
+ return hashlib.new(_alg)
+ return hashlib.new(_alg, data)
+ constructors.add(_test_algorithm_via_hashlib_new)
+
+ _hashlib = self._conditional_import_module('_hashlib')
+ if _hashlib:
+ # These two algorithms should always be present when this module
+ # is compiled. If not, something was compiled wrong.
+ assert hasattr(_hashlib, 'openssl_md5')
+ assert hasattr(_hashlib, 'openssl_sha1')
+ for algorithm, constructors in self.constructors_to_test.items():
+ constructor = getattr(_hashlib, 'openssl_'+algorithm, None)
+ if constructor:
+ constructors.add(constructor)
+
+ _md5 = self._conditional_import_module('_md5')
+ if _md5:
+ self.constructors_to_test['md5'].add(_md5.new)
+ _sha = self._conditional_import_module('_sha')
+ if _sha:
+ self.constructors_to_test['sha1'].add(_sha.new)
+ _sha256 = self._conditional_import_module('_sha256')
+ if _sha256:
+ self.constructors_to_test['sha224'].add(_sha256.sha224)
+ self.constructors_to_test['sha256'].add(_sha256.sha256)
+ _sha512 = self._conditional_import_module('_sha512')
+ if _sha512:
+ self.constructors_to_test['sha384'].add(_sha512.sha384)
+ self.constructors_to_test['sha512'].add(_sha512.sha512)
+
+ super(HashLibTestCase, self).__init__(*args, **kwargs)
+
+ def test_hash_array(self):
+ a = array.array("b", range(10))
+ constructors = self.constructors_to_test.itervalues()
+ for cons in itertools.chain.from_iterable(constructors):
+ c = cons(a)
+ c.hexdigest()
+
+ def test_algorithms_attribute(self):
+ self.assertEqual(hashlib.algorithms,
+ tuple([_algo for _algo in self.supported_hash_names if
+ _algo.islower()]))
+
def test_unknown_hash(self):
try:
hashlib.new('spam spam spam spam spam')
except ValueError:
pass
else:
- self.assert_(0 == "hashlib didn't reject bogus hash name")
+ self.assertTrue(0 == "hashlib didn't reject bogus hash name")
+
+ def test_get_builtin_constructor(self):
+ get_builtin_constructor = hashlib.__dict__[
+ '__get_builtin_constructor']
+ self.assertRaises(ValueError, get_builtin_constructor, 'test')
+ try:
+ import _md5
+ except ImportError:
+ pass
+ # This forces an ImportError for "import _md5" statements
+ sys.modules['_md5'] = None
+ try:
+ self.assertRaises(ValueError, get_builtin_constructor, 'md5')
+ finally:
+ if '_md5' in locals():
+ sys.modules['_md5'] = _md5
+ else:
+ del sys.modules['_md5']
def test_hexdigest(self):
for name in self.supported_hash_names:
h = hashlib.new(name)
- self.assert_(hexstr(h.digest()) == h.hexdigest())
-
+ self.assertTrue(hexstr(h.digest()) == h.hexdigest())
def test_large_update(self):
aas = 'a' * 128
bees = 'b' * 127
cees = 'c' * 126
+ abcs = aas + bees + cees
for name in self.supported_hash_names:
m1 = hashlib.new(name)
@@ -52,17 +151,39 @@ class HashLibTestCase(unittest.TestCase):
m1.update(cees)
m2 = hashlib.new(name)
- m2.update(aas + bees + cees)
- self.assertEqual(m1.digest(), m2.digest())
+ m2.update(abcs)
+ self.assertEqual(m1.digest(), m2.digest(), name+' update problem.')
- def check(self, name, data, digest):
- # test the direct constructors
- computed = getattr(hashlib, name)(data).hexdigest()
- self.assert_(computed == digest)
- # test the general new() interface
- computed = hashlib.new(name, data).hexdigest()
- self.assert_(computed == digest)
+ m3 = hashlib.new(name, abcs)
+ self.assertEqual(m1.digest(), m3.digest(), name+' new problem.')
+ def check(self, name, data, digest):
+ constructors = self.constructors_to_test[name]
+ # 2 is for hashlib.name(...) and hashlib.new(name, ...)
+ self.assertGreaterEqual(len(constructors), 2)
+ for hash_object_constructor in constructors:
+ computed = hash_object_constructor(data).hexdigest()
+ self.assertEqual(
+ computed, digest,
+ "Hash algorithm %s constructed using %s returned hexdigest"
+ " %r for %d byte input data that should have hashed to %r."
+ % (name, hash_object_constructor,
+ computed, len(data), digest))
+
+ def check_unicode(self, algorithm_name):
+ # Unicode objects are not allowed as input.
+ expected = hashlib.new(algorithm_name, str(u'spam')).hexdigest()
+ self.check(algorithm_name, u'spam', expected)
+
+ def test_unicode(self):
+ # In python 2.x unicode is auto-encoded to the system default encoding
+ # when passed to hashlib functions.
+ self.check_unicode('md5')
+ self.check_unicode('sha1')
+ self.check_unicode('sha224')
+ self.check_unicode('sha256')
+ self.check_unicode('sha384')
+ self.check_unicode('sha512')
def test_case_md5_0(self):
self.check('md5', '', 'd41d8cd98f00b204e9800998ecf8427e')
@@ -196,10 +317,45 @@ class HashLibTestCase(unittest.TestCase):
"e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"+
"de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b")
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ @test_support.reap_threads
+ def test_threaded_hashing(self):
+ # Updating the same hash object from several threads at once
+ # using data chunk sizes containing the same byte sequences.
+ #
+ # If the internal locks are working to prevent multiple
+ # updates on the same object from running at once, the resulting
+ # hash will be the same as doing it single threaded upfront.
+ hasher = hashlib.sha1()
+ num_threads = 5
+ smallest_data = 'swineflu'
+ data = smallest_data*200000
+ expected_hash = hashlib.sha1(data*num_threads).hexdigest()
+
+ def hash_in_chunks(chunk_size, event):
+ index = 0
+ while index < len(data):
+ hasher.update(data[index:index+chunk_size])
+ index += chunk_size
+ event.set()
+
+ events = []
+ for threadnum in xrange(num_threads):
+ chunk_size = len(data) // (10**threadnum)
+ assert chunk_size > 0
+ assert chunk_size % len(smallest_data) == 0
+ event = threading.Event()
+ events.append(event)
+ threading.Thread(target=hash_in_chunks,
+ args=(chunk_size, event)).start()
+
+ for event in events:
+ event.wait()
+
+ self.assertEqual(expected_hash, hasher.hexdigest())
def test_main():
test_support.run_unittest(HashLibTestCase)
-
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_heapq.py b/Lib/test/test_heapq.py
index efd1080328..5932a40c28 100644
--- a/Lib/test/test_heapq.py
+++ b/Lib/test/test_heapq.py
@@ -1,31 +1,31 @@
"""Unittests for heapq."""
-import random
-import unittest
-from test import test_support
import sys
+import random
-# We do a bit of trickery here to be able to test both the C implementation
-# and the Python implementation of the module.
+from test import test_support
+from unittest import TestCase, skipUnless
-# Make it impossible to import the C implementation anymore.
-sys.modules['_heapq'] = 0
-# We must also handle the case that heapq was imported before.
-if 'heapq' in sys.modules:
- del sys.modules['heapq']
+py_heapq = test_support.import_fresh_module('heapq', blocked=['_heapq'])
+c_heapq = test_support.import_fresh_module('heapq', fresh=['_heapq'])
-# Now we can import the module and get the pure Python implementation.
-import heapq as py_heapq
+# _heapq.nlargest/nsmallest are saved in heapq._nlargest/_smallest when
+# _heapq is imported, so check them there
+func_names = ['heapify', 'heappop', 'heappush', 'heappushpop',
+ 'heapreplace', '_nlargest', '_nsmallest']
-# Restore everything to normal.
-del sys.modules['_heapq']
-del sys.modules['heapq']
+class TestModules(TestCase):
+ def test_py_functions(self):
+ for fname in func_names:
+ self.assertEqual(getattr(py_heapq, fname).__module__, 'heapq')
-# This is now the module with the C implementation.
-import heapq as c_heapq
+ @skipUnless(c_heapq, 'requires _heapq')
+ def test_c_functions(self):
+ for fname in func_names:
+ self.assertEqual(getattr(c_heapq, fname).__module__, '_heapq')
-class TestHeap(unittest.TestCase):
+class TestHeap(TestCase):
module = None
def test_push_pop(self):
@@ -61,7 +61,7 @@ class TestHeap(unittest.TestCase):
for pos, item in enumerate(heap):
if pos: # pos 0 has no parent
parentpos = (pos-1) >> 1
- self.assert_(heap[parentpos] <= item)
+ self.assertTrue(heap[parentpos] <= item)
def test_heapify(self):
for size in range(30):
@@ -190,14 +190,8 @@ class TestHeap(unittest.TestCase):
self.assertEqual(self.module.nlargest(n, data, key=f),
sorted(data, key=f, reverse=True)[:n])
-class TestHeapPython(TestHeap):
- module = py_heapq
-
-class TestHeapC(TestHeap):
- module = c_heapq
-
def test_comparison_operator(self):
- # Issue 3501: Make sure heapq works with both __lt__ and __le__
+ # Issue 3051: Make sure heapq works with both __lt__ and __le__
def hsort(data, comp):
data = map(comp, data)
self.module.heapify(data)
@@ -218,6 +212,15 @@ class TestHeapC(TestHeap):
self.assertEqual(hsort(data, LE), target)
+class TestHeapPython(TestHeap):
+ module = py_heapq
+
+
+@skipUnless(c_heapq, 'requires _heapq')
+class TestHeapC(TestHeap):
+ module = c_heapq
+
+
#==============================================================================
class LenOnly:
@@ -312,34 +315,25 @@ def L(seqn):
'Test multiple tiers of iterators'
return chain(imap(lambda x:x, R(Ig(G(seqn)))))
-class TestErrorHandling(unittest.TestCase):
- # only for C implementation
- module = c_heapq
+class TestErrorHandling(TestCase):
+ module = None
def test_non_sequence(self):
for f in (self.module.heapify, self.module.heappop):
- self.assertRaises(TypeError, f, 10)
+ self.assertRaises((TypeError, AttributeError), f, 10)
for f in (self.module.heappush, self.module.heapreplace,
self.module.nlargest, self.module.nsmallest):
- self.assertRaises(TypeError, f, 10, 10)
+ self.assertRaises((TypeError, AttributeError), f, 10, 10)
def test_len_only(self):
for f in (self.module.heapify, self.module.heappop):
- self.assertRaises(TypeError, f, LenOnly())
+ self.assertRaises((TypeError, AttributeError), f, LenOnly())
for f in (self.module.heappush, self.module.heapreplace):
- self.assertRaises(TypeError, f, LenOnly(), 10)
+ self.assertRaises((TypeError, AttributeError), f, LenOnly(), 10)
for f in (self.module.nlargest, self.module.nsmallest):
self.assertRaises(TypeError, f, 2, LenOnly())
def test_get_only(self):
- for f in (self.module.heapify, self.module.heappop):
- self.assertRaises(TypeError, f, GetOnly())
- for f in (self.module.heappush, self.module.heapreplace):
- self.assertRaises(TypeError, f, GetOnly(), 10)
- for f in (self.module.nlargest, self.module.nsmallest):
- self.assertRaises(TypeError, f, 2, GetOnly())
-
- def test_get_only(self):
seq = [CmpErr(), CmpErr(), CmpErr()]
for f in (self.module.heapify, self.module.heappop):
self.assertRaises(ZeroDivisionError, f, seq)
@@ -352,13 +346,13 @@ class TestErrorHandling(unittest.TestCase):
for f in (self.module.heapify, self.module.heappop,
self.module.heappush, self.module.heapreplace,
self.module.nlargest, self.module.nsmallest):
- self.assertRaises(TypeError, f, 10)
+ self.assertRaises((TypeError, AttributeError), f, 10)
def test_iterable_args(self):
for f in (self.module.nlargest, self.module.nsmallest):
for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
for g in (G, I, Ig, L, R):
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
("comparing unequal types not supported",
DeprecationWarning), quiet=True):
self.assertEqual(f(2, g(s)), f(2,s))
@@ -368,13 +362,21 @@ class TestErrorHandling(unittest.TestCase):
self.assertRaises(ZeroDivisionError, f, 2, E(s))
+class TestErrorHandlingPython(TestErrorHandling):
+ module = py_heapq
+
+
+@skipUnless(c_heapq, 'requires _heapq')
+class TestErrorHandlingC(TestErrorHandling):
+ module = c_heapq
+
+
#==============================================================================
def test_main(verbose=None):
- from types import BuiltinFunctionType
-
- test_classes = [TestHeapPython, TestHeapC, TestErrorHandling]
+ test_classes = [TestModules, TestHeapPython, TestHeapC,
+ TestErrorHandlingPython, TestErrorHandlingC]
test_support.run_unittest(*test_classes)
# verify reference counting
diff --git a/Lib/test/test_hmac.py b/Lib/test/test_hmac.py
index d97583fb43..cd148e9d0a 100644
--- a/Lib/test/test_hmac.py
+++ b/Lib/test/test_hmac.py
@@ -213,19 +213,13 @@ class TestVectorsTestCase(unittest.TestCase):
with warnings.catch_warnings():
warnings.simplefilter('error', RuntimeWarning)
- try:
+ with self.assertRaises(RuntimeWarning):
hmac.HMAC('a', 'b', digestmod=MockCrazyHash)
- except RuntimeWarning:
- pass
- else:
self.fail('Expected warning about missing block_size')
MockCrazyHash.block_size = 1
- try:
+ with self.assertRaises(RuntimeWarning):
hmac.HMAC('a', 'b', digestmod=MockCrazyHash)
- except RuntimeWarning:
- pass
- else:
self.fail('Expected warning about small block_size')
@@ -260,7 +254,7 @@ class SanityTestCase(unittest.TestCase):
# Testing if HMAC defaults to MD5 algorithm.
# NOTE: this whitebox test depends on the hmac class internals
h = hmac.HMAC("key")
- self.failUnless(h.digest_cons == hashlib.md5)
+ self.assertTrue(h.digest_cons == hashlib.md5)
def test_exercise_all_methods(self):
# Exercising all methods once.
@@ -280,11 +274,11 @@ class CopyTestCase(unittest.TestCase):
# Testing if attributes are of same type.
h1 = hmac.HMAC("key")
h2 = h1.copy()
- self.failUnless(h1.digest_cons == h2.digest_cons,
+ self.assertTrue(h1.digest_cons == h2.digest_cons,
"digest constructors don't match.")
- self.failUnless(type(h1.inner) == type(h2.inner),
+ self.assertTrue(type(h1.inner) == type(h2.inner),
"Types of inner don't match.")
- self.failUnless(type(h1.outer) == type(h2.outer),
+ self.assertTrue(type(h1.outer) == type(h2.outer),
"Types of outer don't match.")
def test_realcopy(self):
@@ -292,10 +286,10 @@ class CopyTestCase(unittest.TestCase):
h1 = hmac.HMAC("key")
h2 = h1.copy()
# Using id() in case somebody has overridden __cmp__.
- self.failUnless(id(h1) != id(h2), "No real copy of the HMAC instance.")
- self.failUnless(id(h1.inner) != id(h2.inner),
+ self.assertTrue(id(h1) != id(h2), "No real copy of the HMAC instance.")
+ self.assertTrue(id(h1.inner) != id(h2.inner),
"No real copy of the attribute 'inner'.")
- self.failUnless(id(h1.outer) != id(h2.outer),
+ self.assertTrue(id(h1.outer) != id(h2.outer),
"No real copy of the attribute 'outer'.")
def test_equality(self):
@@ -303,9 +297,9 @@ class CopyTestCase(unittest.TestCase):
h1 = hmac.HMAC("key")
h1.update("some random text")
h2 = h1.copy()
- self.failUnless(h1.digest() == h2.digest(),
+ self.assertTrue(h1.digest() == h2.digest(),
"Digest of copy doesn't match original digest.")
- self.failUnless(h1.hexdigest() == h2.hexdigest(),
+ self.assertTrue(h1.hexdigest() == h2.hexdigest(),
"Hexdigest of copy doesn't match original hexdigest.")
def test_main():
diff --git a/Lib/test/test_hotshot.py b/Lib/test/test_hotshot.py
index 8a89b37370..7da9746d78 100644
--- a/Lib/test/test_hotshot.py
+++ b/Lib/test/test_hotshot.py
@@ -65,11 +65,11 @@ class HotShotTestCase(unittest.TestCase):
def run_test(self, callable, events, profiler=None):
if profiler is None:
profiler = self.new_profiler()
- self.failUnless(not profiler._prof.closed)
+ self.assertTrue(not profiler._prof.closed)
profiler.runcall(callable)
- self.failUnless(not profiler._prof.closed)
+ self.assertTrue(not profiler._prof.closed)
profiler.close()
- self.failUnless(profiler._prof.closed)
+ self.assertTrue(profiler._prof.closed)
self.check_events(events)
def test_addinfo(self):
@@ -81,7 +81,7 @@ class HotShotTestCase(unittest.TestCase):
log = self.get_logreader()
info = log._info
list(log)
- self.failUnless(info["test-key"] == ["test-value"])
+ self.assertTrue(info["test-key"] == ["test-value"])
def test_line_numbers(self):
def f():
diff --git a/Lib/test/test_htmllib.py b/Lib/test/test_htmllib.py
index e1f43348b2..03813b0a7c 100644
--- a/Lib/test/test_htmllib.py
+++ b/Lib/test/test_htmllib.py
@@ -38,11 +38,11 @@ class HTMLParserTestCase(unittest.TestCase):
<a name='frob'> </a>
""")
parser.close()
- self.assertEquals(parser.get_anchor_info(),
- [('http://foo.org/', 'splat', ''),
- ('http://www.python.org/', '', ''),
- ('', 'frob', ''),
- ])
+ self.assertEqual(parser.get_anchor_info(),
+ [('http://foo.org/', 'splat', ''),
+ ('http://www.python.org/', '', ''),
+ ('', 'frob', ''),
+ ])
def test_decl_collection(self):
# See SF patch #545300
@@ -56,10 +56,10 @@ class HTMLParserTestCase(unittest.TestCase):
</html>
""")
parser.close()
- self.assertEquals(parser.get_decl_info(),
- ["if !supportEmptyParas",
- "endif"
- ])
+ self.assertEqual(parser.get_decl_info(),
+ ["if !supportEmptyParas",
+ "endif"
+ ])
def test_main():
test_support.run_unittest(HTMLParserTestCase)
diff --git a/Lib/test/test_htmlparser.py b/Lib/test/test_htmlparser.py
index c45cf00ece..0620d0bdc2 100755..100644
--- a/Lib/test/test_htmlparser.py
+++ b/Lib/test/test_htmlparser.py
@@ -208,6 +208,23 @@ DOCTYPE html [
("starttag", "a", [("href", "mailto:xyz@example.com")]),
])
+ def test_attr_nonascii(self):
+ # see issue 7311
+ self._run_check(u"<img src=/foo/bar.png alt=\u4e2d\u6587>", [
+ ("starttag", "img", [("src", "/foo/bar.png"),
+ ("alt", u"\u4e2d\u6587")]),
+ ])
+ self._run_check(u"<a title='\u30c6\u30b9\u30c8' "
+ u"href='\u30c6\u30b9\u30c8.html'>", [
+ ("starttag", "a", [("title", u"\u30c6\u30b9\u30c8"),
+ ("href", u"\u30c6\u30b9\u30c8.html")]),
+ ])
+ self._run_check(u'<a title="\u30c6\u30b9\u30c8" '
+ u'href="\u30c6\u30b9\u30c8.html">', [
+ ("starttag", "a", [("title", u"\u30c6\u30b9\u30c8"),
+ ("href", u"\u30c6\u30b9\u30c8.html")]),
+ ])
+
def test_attr_entity_replacement(self):
self._run_check("""<a b='&amp;&gt;&lt;&quot;&apos;'>""", [
("starttag", "a", [("b", "&><\"'")]),
@@ -320,6 +337,11 @@ DOCTYPE html [
("endtag", "p"),
])
+ def test_unescape_function(self):
+ parser = HTMLParser.HTMLParser()
+ self.assertEqual(parser.unescape('&#bad;'),'&#bad;')
+ self.assertEqual(parser.unescape('&#0038;'),'&')
+
def test_main():
test_support.run_unittest(HTMLParserTestCase)
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 730e8852a1..2708728e80 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -1,9 +1,12 @@
+import httplib
import array
import httplib
import StringIO
import socket
+import errno
-from unittest import TestCase
+import unittest
+TestCase = unittest.TestCase
from test import test_support
@@ -23,6 +26,21 @@ class FakeSocket:
raise httplib.UnimplementedFileMode()
return self.fileclass(self.text)
+class EPipeSocket(FakeSocket):
+
+ def __init__(self, text, pipe_trigger):
+ # When sendall() is called with pipe_trigger, raise EPIPE.
+ FakeSocket.__init__(self, text)
+ self.pipe_trigger = pipe_trigger
+
+ def sendall(self, data):
+ if self.pipe_trigger in data:
+ raise socket.error(errno.EPIPE, "gotcha")
+ self.data += data
+
+ def close(self):
+ pass
+
class NoEOFStringIO(StringIO.StringIO):
"""Like StringIO, but raises AssertionError on EOF.
@@ -47,8 +65,6 @@ class HeaderTests(TestCase):
# Some headers are added automatically, but should not be added by
# .request() if they are explicitly set.
- import httplib
-
class HeaderCountingBuffer(list):
def __init__(self):
self.count = {}
@@ -74,6 +90,33 @@ class HeaderTests(TestCase):
conn.request('POST', '/', body, headers)
self.assertEqual(conn._buffer.count[header.lower()], 1)
+ def test_putheader(self):
+ conn = httplib.HTTPConnection('example.com')
+ conn.sock = FakeSocket(None)
+ conn.putrequest('GET','/')
+ conn.putheader('Content-length',42)
+ self.assertTrue('Content-length: 42' in conn._buffer)
+
+ def test_ipv6host_header(self):
+ # Default host header on IPv6 transaction should wrapped by [] if
+ # its actual IPv6 address
+ expected = 'GET /foo HTTP/1.1\r\nHost: [2001::]:81\r\n' \
+ 'Accept-Encoding: identity\r\n\r\n'
+ conn = httplib.HTTPConnection('[2001::]:81')
+ sock = FakeSocket('')
+ conn.sock = sock
+ conn.request('GET', '/foo')
+ self.assertTrue(sock.data.startswith(expected))
+
+ expected = 'GET /foo HTTP/1.1\r\nHost: [2001:102A::]\r\n' \
+ 'Accept-Encoding: identity\r\n\r\n'
+ conn = httplib.HTTPConnection('[2001:102A::]')
+ sock = FakeSocket('')
+ conn.sock = sock
+ conn.request('GET', '/foo')
+ self.assertTrue(sock.data.startswith(expected))
+
+
class BasicTest(TestCase):
def test_status_lines(self):
# Test HTTP status lines
@@ -90,6 +133,10 @@ class BasicTest(TestCase):
resp = httplib.HTTPResponse(sock)
self.assertRaises(httplib.BadStatusLine, resp.begin)
+ def test_bad_status_repr(self):
+ exc = httplib.BadStatusLine('')
+ self.assertEqual(repr(exc), '''BadStatusLine("\'\'",)''')
+
def test_partial_reads(self):
# if we have a lenght, the system knows when to close itself
# same behaviour than when we read the whole thing with read()
@@ -169,13 +216,13 @@ class BasicTest(TestCase):
sock = FakeSocket(None)
conn.sock = sock
conn.send(expected)
- self.assertEquals(expected, sock.data)
+ self.assertEqual(expected, sock.data)
sock.data = ''
conn.send(array.array('c', expected))
- self.assertEquals(expected, sock.data)
+ self.assertEqual(expected, sock.data)
sock.data = ''
conn.send(StringIO.StringIO(expected))
- self.assertEquals(expected, sock.data)
+ self.assertEqual(expected, sock.data)
def test_chunked(self):
chunked_start = (
@@ -189,7 +236,7 @@ class BasicTest(TestCase):
sock = FakeSocket(chunked_start + '0\r\n')
resp = httplib.HTTPResponse(sock, method="GET")
resp.begin()
- self.assertEquals(resp.read(), 'hello world')
+ self.assertEqual(resp.read(), 'hello world')
resp.close()
for x in ('', 'foo\r\n'):
@@ -199,7 +246,7 @@ class BasicTest(TestCase):
try:
resp.read()
except httplib.IncompleteRead, i:
- self.assertEquals(i.partial, 'hello world')
+ self.assertEqual(i.partial, 'hello world')
self.assertEqual(repr(i),'IncompleteRead(11 bytes read)')
self.assertEqual(str(i),'IncompleteRead(11 bytes read)')
else:
@@ -219,9 +266,9 @@ class BasicTest(TestCase):
sock = FakeSocket(chunked_start + '0\r\n')
resp = httplib.HTTPResponse(sock, method="HEAD")
resp.begin()
- self.assertEquals(resp.read(), '')
- self.assertEquals(resp.status, 200)
- self.assertEquals(resp.reason, 'OK')
+ self.assertEqual(resp.read(), '')
+ self.assertEqual(resp.status, 200)
+ self.assertEqual(resp.reason, 'OK')
self.assertTrue(resp.isclosed())
def test_negative_content_length(self):
@@ -229,7 +276,7 @@ class BasicTest(TestCase):
'Content-Length: -1\r\n\r\nHello\r\n')
resp = httplib.HTTPResponse(sock, method="GET")
resp.begin()
- self.assertEquals(resp.read(), 'Hello\r\n')
+ self.assertEqual(resp.read(), 'Hello\r\n')
resp.close()
def test_incomplete_read(self):
@@ -239,7 +286,7 @@ class BasicTest(TestCase):
try:
resp.read()
except httplib.IncompleteRead as i:
- self.assertEquals(i.partial, 'Hello\r\n')
+ self.assertEqual(i.partial, 'Hello\r\n')
self.assertEqual(repr(i),
"IncompleteRead(7 bytes read, 3 more expected)")
self.assertEqual(str(i),
@@ -249,10 +296,93 @@ class BasicTest(TestCase):
finally:
resp.close()
+ def test_epipe(self):
+ sock = EPipeSocket(
+ "HTTP/1.0 401 Authorization Required\r\n"
+ "Content-type: text/html\r\n"
+ "WWW-Authenticate: Basic realm=\"example\"\r\n",
+ b"Content-Length")
+ conn = httplib.HTTPConnection("example.com")
+ conn.sock = sock
+ self.assertRaises(socket.error,
+ lambda: conn.request("PUT", "/url", "body"))
+ resp = conn.getresponse()
+ self.assertEqual(401, resp.status)
+ self.assertEqual("Basic realm=\"example\"",
+ resp.getheader("www-authenticate"))
+
+ def test_filenoattr(self):
+ # Just test the fileno attribute in the HTTPResponse Object.
+ body = "HTTP/1.1 200 Ok\r\n\r\nText"
+ sock = FakeSocket(body)
+ resp = httplib.HTTPResponse(sock)
+ self.assertTrue(hasattr(resp,'fileno'),
+ 'HTTPResponse should expose a fileno attribute')
+
+ # Test lines overflowing the max line size (_MAXLINE in http.client)
+
+ def test_overflowing_status_line(self):
+ self.skipTest("disabled for HTTP 0.9 support")
+ body = "HTTP/1.1 200 Ok" + "k" * 65536 + "\r\n"
+ resp = httplib.HTTPResponse(FakeSocket(body))
+ self.assertRaises((httplib.LineTooLong, httplib.BadStatusLine), resp.begin)
+
+ def test_overflowing_header_line(self):
+ body = (
+ 'HTTP/1.1 200 OK\r\n'
+ 'X-Foo: bar' + 'r' * 65536 + '\r\n\r\n'
+ )
+ resp = httplib.HTTPResponse(FakeSocket(body))
+ self.assertRaises(httplib.LineTooLong, resp.begin)
+
+ def test_overflowing_chunked_line(self):
+ body = (
+ 'HTTP/1.1 200 OK\r\n'
+ 'Transfer-Encoding: chunked\r\n\r\n'
+ + '0' * 65536 + 'a\r\n'
+ 'hello world\r\n'
+ '0\r\n'
+ )
+ resp = httplib.HTTPResponse(FakeSocket(body))
+ resp.begin()
+ self.assertRaises(httplib.LineTooLong, resp.read)
+
class OfflineTest(TestCase):
def test_responses(self):
- self.assertEquals(httplib.responses[httplib.NOT_FOUND], "Not Found")
+ self.assertEqual(httplib.responses[httplib.NOT_FOUND], "Not Found")
+
+
+class SourceAddressTest(TestCase):
+ def setUp(self):
+ self.serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.port = test_support.bind_port(self.serv)
+ self.source_port = test_support.find_unused_port()
+ self.serv.listen(5)
+ self.conn = None
+
+ def tearDown(self):
+ if self.conn:
+ self.conn.close()
+ self.conn = None
+ self.serv.close()
+ self.serv = None
+
+ def testHTTPConnectionSourceAddress(self):
+ self.conn = httplib.HTTPConnection(HOST, self.port,
+ source_address=('', self.source_port))
+ self.conn.connect()
+ self.assertEqual(self.conn.sock.getsockname()[1], self.source_port)
+
+ @unittest.skipIf(not hasattr(httplib, 'HTTPSConnection'),
+ 'httplib.HTTPSConnection not defined')
+ def testHTTPSConnectionSourceAddress(self):
+ self.conn = httplib.HTTPSConnection(HOST, self.port,
+ source_address=('', self.source_port))
+ # We don't test anything here other the constructor not barfing as
+ # this code doesn't deal with setting up an active running SSL server
+ # for an ssl_wrapped connect() to actually return from.
+
class TimeoutTest(TestCase):
PORT = None
@@ -271,7 +401,7 @@ class TimeoutTest(TestCase):
HTTPConnection and into the socket.
'''
# default -- use global socket timeout
- self.assert_(socket.getdefaulttimeout() is None)
+ self.assertTrue(socket.getdefaulttimeout() is None)
socket.setdefaulttimeout(30)
try:
httpConn = httplib.HTTPConnection(HOST, TimeoutTest.PORT)
@@ -282,7 +412,7 @@ class TimeoutTest(TestCase):
httpConn.close()
# no timeout -- do not use global socket default
- self.assert_(socket.getdefaulttimeout() is None)
+ self.assertTrue(socket.getdefaulttimeout() is None)
socket.setdefaulttimeout(30)
try:
httpConn = httplib.HTTPConnection(HOST, TimeoutTest.PORT,
@@ -311,7 +441,7 @@ class HTTPSTimeoutTest(TestCase):
def test_main(verbose=None):
test_support.run_unittest(HeaderTests, OfflineTest, BasicTest, TimeoutTest,
- HTTPSTimeoutTest)
+ HTTPSTimeoutTest, SourceAddressTest)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index 5c48671053..3de0923efe 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -7,18 +7,23 @@ Josip Dzolonga, and Michael Otteneder for the 2007/08 GHOP contest.
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
from CGIHTTPServer import CGIHTTPRequestHandler
+import CGIHTTPServer
import os
import sys
+import re
import base64
import shutil
import urllib
import httplib
import tempfile
-import threading
import unittest
+
+from StringIO import StringIO
+
from test import test_support
+threading = test_support.import_module('threading')
class NoLogRequestHandler:
@@ -26,6 +31,21 @@ class NoLogRequestHandler:
# don't write log messages to stderr
pass
+class SocketlessRequestHandler(SimpleHTTPRequestHandler):
+ def __init__(self):
+ self.get_called = False
+ self.protocol_version = "HTTP/1.1"
+
+ def do_GET(self):
+ self.get_called = True
+ self.send_response(200)
+ self.send_header('Content-Type', 'text/html')
+ self.end_headers()
+ self.wfile.write(b'<html><body>Data</body></html>\r\n')
+
+ def log_message(self, format, *args):
+ pass
+
class TestServerThread(threading.Thread):
def __init__(self, test_object, request_handler):
@@ -49,6 +69,8 @@ class TestServerThread(threading.Thread):
class BaseTestCase(unittest.TestCase):
def setUp(self):
+ self._threads = test_support.threading_setup()
+ os.environ = test_support.EnvironmentVarGuard()
self.server_started = threading.Event()
self.thread = TestServerThread(self, self.request_handler)
self.thread.start()
@@ -56,12 +78,78 @@ class BaseTestCase(unittest.TestCase):
def tearDown(self):
self.thread.stop()
+ os.environ.__exit__()
+ test_support.threading_cleanup(*self._threads)
def request(self, uri, method='GET', body=None, headers={}):
self.connection = httplib.HTTPConnection('localhost', self.PORT)
self.connection.request(method, uri, body, headers)
return self.connection.getresponse()
+class BaseHTTPRequestHandlerTestCase(unittest.TestCase):
+ """Test the functionality of the BaseHTTPServer focussing on
+ BaseHTTPRequestHandler.
+ """
+
+ HTTPResponseMatch = re.compile('HTTP/1.[0-9]+ 200 OK')
+
+ def setUp (self):
+ self.handler = SocketlessRequestHandler()
+
+ def send_typical_request(self, message):
+ input = StringIO(message)
+ output = StringIO()
+ self.handler.rfile = input
+ self.handler.wfile = output
+ self.handler.handle_one_request()
+ output.seek(0)
+ return output.readlines()
+
+ def verify_get_called(self):
+ self.assertTrue(self.handler.get_called)
+
+ def verify_expected_headers(self, headers):
+ for fieldName in 'Server: ', 'Date: ', 'Content-Type: ':
+ self.assertEqual(sum(h.startswith(fieldName) for h in headers), 1)
+
+ def verify_http_server_response(self, response):
+ match = self.HTTPResponseMatch.search(response)
+ self.assertTrue(match is not None)
+
+ def test_http_1_1(self):
+ result = self.send_typical_request('GET / HTTP/1.1\r\n\r\n')
+ self.verify_http_server_response(result[0])
+ self.verify_expected_headers(result[1:-1])
+ self.verify_get_called()
+ self.assertEqual(result[-1], '<html><body>Data</body></html>\r\n')
+
+ def test_http_1_0(self):
+ result = self.send_typical_request('GET / HTTP/1.0\r\n\r\n')
+ self.verify_http_server_response(result[0])
+ self.verify_expected_headers(result[1:-1])
+ self.verify_get_called()
+ self.assertEqual(result[-1], '<html><body>Data</body></html>\r\n')
+
+ def test_http_0_9(self):
+ result = self.send_typical_request('GET / HTTP/0.9\r\n\r\n')
+ self.assertEqual(len(result), 1)
+ self.assertEqual(result[0], '<html><body>Data</body></html>\r\n')
+ self.verify_get_called()
+
+ def test_with_continue_1_0(self):
+ result = self.send_typical_request('GET / HTTP/1.0\r\nExpect: 100-continue\r\n\r\n')
+ self.verify_http_server_response(result[0])
+ self.verify_expected_headers(result[1:-1])
+ self.verify_get_called()
+ self.assertEqual(result[-1], '<html><body>Data</body></html>\r\n')
+
+ def test_request_length(self):
+ # Issue #10714: huge request lines are discarded, to avoid Denial
+ # of Service attacks.
+ result = self.send_typical_request(b'GET ' + b'x' * 65537)
+ self.assertEqual(result[0], b'HTTP/1.1 414 Request-URI Too Long\r\n')
+ self.assertFalse(self.handler.get_called)
+
class BaseHTTPServerTestCase(BaseTestCase):
class request_handler(NoLogRequestHandler, BaseHTTPRequestHandler):
@@ -97,42 +185,42 @@ class BaseHTTPServerTestCase(BaseTestCase):
def test_command(self):
self.con.request('GET', '/')
res = self.con.getresponse()
- self.assertEquals(res.status, 501)
+ self.assertEqual(res.status, 501)
def test_request_line_trimming(self):
self.con._http_vsn_str = 'HTTP/1.1\n'
self.con.putrequest('GET', '/')
self.con.endheaders()
res = self.con.getresponse()
- self.assertEquals(res.status, 501)
+ self.assertEqual(res.status, 501)
def test_version_bogus(self):
self.con._http_vsn_str = 'FUBAR'
self.con.putrequest('GET', '/')
self.con.endheaders()
res = self.con.getresponse()
- self.assertEquals(res.status, 400)
+ self.assertEqual(res.status, 400)
def test_version_digits(self):
self.con._http_vsn_str = 'HTTP/9.9.9'
self.con.putrequest('GET', '/')
self.con.endheaders()
res = self.con.getresponse()
- self.assertEquals(res.status, 400)
+ self.assertEqual(res.status, 400)
def test_version_none_get(self):
self.con._http_vsn_str = ''
self.con.putrequest('GET', '/')
self.con.endheaders()
res = self.con.getresponse()
- self.assertEquals(res.status, 501)
+ self.assertEqual(res.status, 501)
def test_version_none(self):
self.con._http_vsn_str = ''
self.con.putrequest('PUT', '/')
self.con.endheaders()
res = self.con.getresponse()
- self.assertEquals(res.status, 400)
+ self.assertEqual(res.status, 400)
def test_version_invalid(self):
self.con._http_vsn = 99
@@ -140,21 +228,21 @@ class BaseHTTPServerTestCase(BaseTestCase):
self.con.putrequest('GET', '/')
self.con.endheaders()
res = self.con.getresponse()
- self.assertEquals(res.status, 505)
+ self.assertEqual(res.status, 505)
def test_send_blank(self):
self.con._http_vsn_str = ''
self.con.putrequest('', '')
self.con.endheaders()
res = self.con.getresponse()
- self.assertEquals(res.status, 400)
+ self.assertEqual(res.status, 400)
def test_header_close(self):
self.con.putrequest('GET', '/')
self.con.putheader('Connection', 'close')
self.con.endheaders()
res = self.con.getresponse()
- self.assertEquals(res.status, 501)
+ self.assertEqual(res.status, 501)
def test_head_keep_alive(self):
self.con._http_vsn_str = 'HTTP/1.1'
@@ -162,28 +250,29 @@ class BaseHTTPServerTestCase(BaseTestCase):
self.con.putheader('Connection', 'keep-alive')
self.con.endheaders()
res = self.con.getresponse()
- self.assertEquals(res.status, 501)
+ self.assertEqual(res.status, 501)
def test_handler(self):
self.con.request('TEST', '/')
res = self.con.getresponse()
- self.assertEquals(res.status, 204)
+ self.assertEqual(res.status, 204)
def test_return_header_keep_alive(self):
self.con.request('KEEP', '/')
res = self.con.getresponse()
- self.assertEquals(res.getheader('Connection'), 'keep-alive')
+ self.assertEqual(res.getheader('Connection'), 'keep-alive')
self.con.request('TEST', '/')
+ self.addCleanup(self.con.close)
def test_internal_key_error(self):
self.con.request('KEYERROR', '/')
res = self.con.getresponse()
- self.assertEquals(res.status, 999)
+ self.assertEqual(res.status, 999)
def test_return_custom_status(self):
self.con.request('CUSTOM', '/')
res = self.con.getresponse()
- self.assertEquals(res.status, 999)
+ self.assertEqual(res.status, 999)
class SimpleHTTPServerTestCase(BaseTestCase):
@@ -214,9 +303,9 @@ class SimpleHTTPServerTestCase(BaseTestCase):
def check_status_and_reason(self, response, status, data=None):
body = response.read()
- self.assert_(response)
- self.assertEquals(response.status, status)
- self.assert_(response.reason != None)
+ self.assertTrue(response)
+ self.assertEqual(response.status, status)
+ self.assertIsNotNone(response.reason)
if data:
self.assertEqual(data, body)
@@ -277,8 +366,8 @@ print "Content-type: text/html"
print
form = cgi.FieldStorage()
-print "%%s, %%s, %%s" %% (form.getfirst("spam"), form.getfirst("eggs"),\
- form.getfirst("bacon"))
+print "%%s, %%s, %%s" %% (form.getfirst("spam"), form.getfirst("eggs"),
+ form.getfirst("bacon"))
"""
class CGIHTTPServerTestCase(BaseTestCase):
@@ -324,43 +413,116 @@ class CGIHTTPServerTestCase(BaseTestCase):
finally:
BaseTestCase.tearDown(self)
+ def test_url_collapse_path_split(self):
+ test_vectors = {
+ '': ('/', ''),
+ '..': IndexError,
+ '/.//..': IndexError,
+ '/': ('/', ''),
+ '//': ('/', ''),
+ '/\\': ('/', '\\'),
+ '/.//': ('/', ''),
+ 'cgi-bin/file1.py': ('/cgi-bin', 'file1.py'),
+ '/cgi-bin/file1.py': ('/cgi-bin', 'file1.py'),
+ 'a': ('/', 'a'),
+ '/a': ('/', 'a'),
+ '//a': ('/', 'a'),
+ './a': ('/', 'a'),
+ './C:/': ('/C:', ''),
+ '/a/b': ('/a', 'b'),
+ '/a/b/': ('/a/b', ''),
+ '/a/b/c/..': ('/a/b', ''),
+ '/a/b/c/../d': ('/a/b', 'd'),
+ '/a/b/c/../d/e/../f': ('/a/b/d', 'f'),
+ '/a/b/c/../d/e/../../f': ('/a/b', 'f'),
+ '/a/b/c/../d/e/.././././..//f': ('/a/b', 'f'),
+ '../a/b/c/../d/e/.././././..//f': IndexError,
+ '/a/b/c/../d/e/../../../f': ('/a', 'f'),
+ '/a/b/c/../d/e/../../../../f': ('/', 'f'),
+ '/a/b/c/../d/e/../../../../../f': IndexError,
+ '/a/b/c/../d/e/../../../../f/..': ('/', ''),
+ }
+ for path, expected in test_vectors.iteritems():
+ if isinstance(expected, type) and issubclass(expected, Exception):
+ self.assertRaises(expected,
+ CGIHTTPServer._url_collapse_path_split, path)
+ else:
+ actual = CGIHTTPServer._url_collapse_path_split(path)
+ self.assertEqual(expected, actual,
+ msg='path = %r\nGot: %r\nWanted: %r' %
+ (path, actual, expected))
+
def test_headers_and_content(self):
res = self.request('/cgi-bin/file1.py')
- self.assertEquals(('Hello World\n', 'text/html', 200), \
- (res.read(), res.getheader('Content-type'), res.status))
+ self.assertEqual(('Hello World\n', 'text/html', 200),
+ (res.read(), res.getheader('Content-type'), res.status))
def test_post(self):
params = urllib.urlencode({'spam' : 1, 'eggs' : 'python', 'bacon' : 123456})
headers = {'Content-type' : 'application/x-www-form-urlencoded'}
res = self.request('/cgi-bin/file2.py', 'POST', params, headers)
- self.assertEquals(res.read(), '1, python, 123456\n')
+ self.assertEqual(res.read(), '1, python, 123456\n')
def test_invaliduri(self):
res = self.request('/cgi-bin/invalid')
res.read()
- self.assertEquals(res.status, 404)
+ self.assertEqual(res.status, 404)
def test_authorization(self):
- headers = {'Authorization' : 'Basic %s' % \
- base64.b64encode('username:pass')}
+ headers = {'Authorization' : 'Basic %s' %
+ base64.b64encode('username:pass')}
res = self.request('/cgi-bin/file1.py', 'GET', headers=headers)
- self.assertEquals(('Hello World\n', 'text/html', 200), \
+ self.assertEqual(('Hello World\n', 'text/html', 200),
+ (res.read(), res.getheader('Content-type'), res.status))
+
+ def test_no_leading_slash(self):
+ # http://bugs.python.org/issue2254
+ res = self.request('cgi-bin/file1.py')
+ self.assertEqual(('Hello World\n', 'text/html', 200),
(res.read(), res.getheader('Content-type'), res.status))
+ def test_os_environ_is_not_altered(self):
+ signature = "Test CGI Server"
+ os.environ['SERVER_SOFTWARE'] = signature
+ res = self.request('/cgi-bin/file1.py')
+ self.assertEqual((b'Hello World\n', 'text/html', 200),
+ (res.read(), res.getheader('Content-type'), res.status))
+ self.assertEqual(os.environ['SERVER_SOFTWARE'], signature)
+
+
+class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
+ """ Test url parsing """
+ def setUp(self):
+ self.translated = os.getcwd()
+ self.translated = os.path.join(self.translated, 'filename')
+ self.handler = SocketlessRequestHandler()
+
+ def test_query_arguments(self):
+ path = self.handler.translate_path('/filename')
+ self.assertEqual(path, self.translated)
+ path = self.handler.translate_path('/filename?foo=bar')
+ self.assertEqual(path, self.translated)
+ path = self.handler.translate_path('/filename?a=b&spam=eggs#zot')
+ self.assertEqual(path, self.translated)
+
+ def test_start_with_double_slash(self):
+ path = self.handler.translate_path('//filename')
+ self.assertEqual(path, self.translated)
+ path = self.handler.translate_path('//filename?foo=bar')
+ self.assertEqual(path, self.translated)
+
def test_main(verbose=None):
- cwd = os.getcwd()
- env = os.environ.copy()
try:
- test_support.run_unittest(BaseHTTPServerTestCase,
+ cwd = os.getcwd()
+ test_support.run_unittest(BaseHTTPRequestHandlerTestCase,
+ SimpleHTTPRequestHandlerTestCase,
+ BaseHTTPServerTestCase,
SimpleHTTPServerTestCase,
CGIHTTPServerTestCase
- )
+ )
finally:
- test_support.reap_children()
- os.environ.clear()
- os.environ.update(env)
os.chdir(cwd)
if __name__ == '__main__':
diff --git a/Lib/test/test_imageop.py b/Lib/test/test_imageop.py
index 9063b22090..56320fb897 100755
--- a/Lib/test/test_imageop.py
+++ b/Lib/test/test_imageop.py
@@ -180,6 +180,7 @@ def getimage(name):
"""return a tuple consisting of
image (in 'imgfile' format) width and height
"""
+ import imgfile
try:
sizes = imgfile.getsizes(name)
except imgfile.error:
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index f288ef0f97..15b0ea0728 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -7,13 +7,10 @@ threading = support.import_module('threading')
from contextlib import contextmanager
import imaplib
import os.path
-import select
-import socket
import SocketServer
-import sys
import time
-from test_support import verbose
+from test_support import reap_threads, verbose, transient_internet
import unittest
try:
@@ -57,19 +54,10 @@ else:
IMAP4_SSL = None
-class TimeoutStreamRequestHandler(SocketServer.StreamRequestHandler):
-
- timeout = 1
-
- def setup(self):
- self.connection = self.request
- if self.timeout is not None:
- self.connection.settimeout(self.timeout)
- self.rfile = self.connection.makefile('rb', self.rbufsize)
- self.wfile = self.connection.makefile('wb', self.wbufsize)
+class SimpleIMAPHandler(SocketServer.StreamRequestHandler):
-class SimpleIMAPHandler(TimeoutStreamRequestHandler):
+ timeout = 1
def _send(self, message):
if verbose: print "SENT:", message.strip()
@@ -111,6 +99,7 @@ class SimpleIMAPHandler(TimeoutStreamRequestHandler):
self._send('* CAPABILITY IMAP4rev1\r\n')
self._send('%s OK CAPABILITY completed\r\n' % (tag,))
+
class BaseThreadedNetworkedTests(unittest.TestCase):
def make_server(self, addr, hdlr):
@@ -123,7 +112,7 @@ class BaseThreadedNetworkedTests(unittest.TestCase):
if verbose: print "creating server"
server = MyServer(addr, hdlr)
- self.assertEquals(server.server_address, server.socket.getsockname())
+ self.assertEqual(server.server_address, server.socket.getsockname())
if verbose:
print "server created"
@@ -157,37 +146,77 @@ class BaseThreadedNetworkedTests(unittest.TestCase):
finally:
self.reap_server(server, thread)
+ @reap_threads
def test_connect(self):
with self.reaped_server(SimpleIMAPHandler) as server:
client = self.imap_class(*server.server_address)
client.shutdown()
+ @reap_threads
def test_issue5949(self):
- class EOFHandler(TimeoutStreamRequestHandler):
+ class EOFHandler(SocketServer.StreamRequestHandler):
def handle(self):
# EOF without sending a complete welcome message.
self.wfile.write('* OK')
- # explicitly shutdown. socket.close() merely releases
- # the socket and waits for GC to perform the actual close.
- self.request.shutdown(socket.SHUT_WR)
with self.reaped_server(EOFHandler) as server:
self.assertRaises(imaplib.IMAP4.abort,
self.imap_class, *server.server_address)
+
class ThreadedNetworkedTests(BaseThreadedNetworkedTests):
server_class = SocketServer.TCPServer
imap_class = imaplib.IMAP4
+@unittest.skipUnless(ssl, "SSL not available")
class ThreadedNetworkedTestsSSL(BaseThreadedNetworkedTests):
server_class = SecureTCPServer
imap_class = IMAP4_SSL
+class RemoteIMAPTest(unittest.TestCase):
+ host = 'cyrus.andrew.cmu.edu'
+ port = 143
+ username = 'anonymous'
+ password = 'pass'
+ imap_class = imaplib.IMAP4
+
+ def setUp(self):
+ with transient_internet(self.host):
+ self.server = self.imap_class(self.host, self.port)
+
+ def tearDown(self):
+ if self.server is not None:
+ self.server.logout()
+
+ def test_logincapa(self):
+ self.assertTrue('LOGINDISABLED' in self.server.capabilities)
+
+ def test_anonlogin(self):
+ self.assertTrue('AUTH=ANONYMOUS' in self.server.capabilities)
+ rs = self.server.login(self.username, self.password)
+ self.assertEqual(rs[0], 'OK')
+
+ def test_logout(self):
+ rs = self.server.logout()
+ self.server = None
+ self.assertEqual(rs[0], 'BYE')
+
+
+@unittest.skipUnless(ssl, "SSL not available")
+class RemoteIMAP_SSLTest(RemoteIMAPTest):
+ port = 993
+ imap_class = IMAP4_SSL
+
+ def test_logincapa(self):
+ self.assertFalse('LOGINDISABLED' in self.server.capabilities)
+ self.assertTrue('AUTH=PLAIN' in self.server.capabilities)
+
+
def test_main():
tests = [TestImaplib]
@@ -198,14 +227,13 @@ def test_main():
"keycert.pem")
if not os.path.exists(CERTFILE):
raise support.TestFailed("Can't read certificate files!")
- tests.append(ThreadedNetworkedTestsSSL)
- tests.append(ThreadedNetworkedTests)
-
- threadinfo = support.threading_setup()
+ tests.extend([
+ ThreadedNetworkedTests, ThreadedNetworkedTestsSSL,
+ RemoteIMAPTest, RemoteIMAP_SSLTest,
+ ])
support.run_unittest(*tests)
- support.threading_cleanup(*threadinfo)
if __name__ == "__main__":
support.use_resources = ['network']
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index c9682ab59c..77e44bec92 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -8,7 +8,7 @@ class LockTests(unittest.TestCase):
"""Very basic test of import lock functions."""
def verify_lock_state(self, expected):
- self.failUnlessEqual(imp.lock_held(), expected,
+ self.assertEqual(imp.lock_held(), expected,
"expected imp.lock_held() to be %r" % expected)
def testLock(self):
LOOPS = 50
@@ -43,16 +43,26 @@ class ReloadTests(unittest.TestCase):
reload()."""
def test_source(self):
- import os
- imp.reload(os)
+ # XXX (ncoghlan): It would be nice to use test_support.CleanImport
+ # here, but that breaks because the os module registers some
+ # handlers in copy_reg on import. Since CleanImport doesn't
+ # revert that registration, the module is left in a broken
+ # state after reversion. Reinitialising the module contents
+ # and just reverting os.environ to its previous state is an OK
+ # workaround
+ with test_support.EnvironmentVarGuard():
+ import os
+ imp.reload(os)
def test_extension(self):
- import time
- imp.reload(time)
+ with test_support.CleanImport('time'):
+ import time
+ imp.reload(time)
def test_builtin(self):
- import marshal
- imp.reload(marshal)
+ with test_support.CleanImport('marshal'):
+ import marshal
+ imp.reload(marshal)
def test_main():
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 60346ab9fc..5751901584 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -1,16 +1,15 @@
-import unittest
+import imp
+import marshal
import os
-import stat
+import py_compile
import random
-import shutil
+import stat
import sys
-import py_compile
-import warnings
-import marshal
-import imp
-from test.test_support import (unlink, TESTFN, unload, run_unittest,
- check_warnings, TestFailed)
-
+import unittest
+from test.test_support import (unlink, TESTFN, unload, run_unittest, rmtree,
+ is_jython, check_warnings, EnvironmentVarGuard)
+import textwrap
+from test import script_helper
def remove_files(name):
for f in (name + os.extsep + "py",
@@ -18,15 +17,18 @@ def remove_files(name):
name + os.extsep + "pyo",
name + os.extsep + "pyw",
name + "$py.class"):
- if os.path.exists(f):
- os.remove(f)
+ unlink(f)
+
+class ImportTests(unittest.TestCase):
-class ImportTest(unittest.TestCase):
+ def tearDown(self):
+ unload(TESTFN)
+ setUp = tearDown
- def testCaseSensitivity(self):
- # Brief digression to test that import is case-sensitive: if we got this
- # far, we know for sure that "random" exists.
+ def test_case_sensitivity(self):
+ # Brief digression to test that import is case-sensitive: if we got
+ # this far, we know for sure that "random" exists.
try:
import RAnDoM
except ImportError:
@@ -34,163 +36,162 @@ class ImportTest(unittest.TestCase):
else:
self.fail("import of RAnDoM should have failed (case mismatch)")
- def testDoubleConst(self):
- # Another brief digression to test the accuracy of manifest float constants.
+ def test_double_const(self):
+ # Another brief digression to test the accuracy of manifest float
+ # constants.
from test import double_const # don't blink -- that *was* the test
- def testImport(self):
+ def test_import(self):
def test_with_extension(ext):
- # ext normally ".py"; perhaps ".pyw"
+ # The extension is normally ".py", perhaps ".pyw".
source = TESTFN + ext
pyo = TESTFN + os.extsep + "pyo"
- if sys.platform.startswith('java'):
+ if is_jython:
pyc = TESTFN + "$py.class"
else:
pyc = TESTFN + os.extsep + "pyc"
- f = open(source, "w")
- print >> f, "# This tests Python's ability to import a", ext, "file."
- a = random.randrange(1000)
- b = random.randrange(1000)
- print >> f, "a =", a
- print >> f, "b =", b
- f.close()
+ with open(source, "w") as f:
+ print >> f, ("# This tests Python's ability to import a", ext,
+ "file.")
+ a = random.randrange(1000)
+ b = random.randrange(1000)
+ print >> f, "a =", a
+ print >> f, "b =", b
try:
mod = __import__(TESTFN)
except ImportError, err:
self.fail("import from %s failed: %s" % (ext, err))
else:
- self.assertEquals(mod.a, a,
+ self.assertEqual(mod.a, a,
"module loaded (%s) but contents invalid" % mod)
- self.assertEquals(mod.b, b,
+ self.assertEqual(mod.b, b,
"module loaded (%s) but contents invalid" % mod)
finally:
- os.unlink(source)
+ unlink(source)
try:
imp.reload(mod)
except ImportError, err:
self.fail("import from .pyc/.pyo failed: %s" % err)
finally:
- try:
- os.unlink(pyc)
- except OSError:
- pass
- try:
- os.unlink(pyo)
- except OSError:
- pass
- del sys.modules[TESTFN]
+ unlink(pyc)
+ unlink(pyo)
+ unload(TESTFN)
sys.path.insert(0, os.curdir)
try:
test_with_extension(os.extsep + "py")
if sys.platform.startswith("win"):
- for ext in ".PY", ".Py", ".pY", ".pyw", ".PYW", ".pYw":
+ for ext in [".PY", ".Py", ".pY", ".pyw", ".PYW", ".pYw"]:
test_with_extension(ext)
finally:
del sys.path[0]
- if os.name == 'posix':
- def test_execute_bit_not_copied(self):
- # Issue 6070: under posix .pyc files got their execute bit set if
- # the .py file had the execute bit set, but they aren't executable.
- oldmask = os.umask(022)
- sys.path.insert(0, os.curdir)
- try:
- fname = TESTFN + os.extsep + "py"
- f = open(fname, 'w').close()
- os.chmod(fname, (stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH |
- stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH))
- __import__(TESTFN)
- fn = fname + 'c'
+ @unittest.skipUnless(os.name == 'posix', "test meaningful only on posix systems")
+ def test_execute_bit_not_copied(self):
+ # Issue 6070: under posix .pyc files got their execute bit set if
+ # the .py file had the execute bit set, but they aren't executable.
+ oldmask = os.umask(022)
+ sys.path.insert(0, os.curdir)
+ try:
+ fname = TESTFN + os.extsep + "py"
+ f = open(fname, 'w').close()
+ os.chmod(fname, (stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH |
+ stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH))
+ __import__(TESTFN)
+ fn = fname + 'c'
+ if not os.path.exists(fn):
+ fn = fname + 'o'
if not os.path.exists(fn):
- fn = fname + 'o'
- if not os.path.exists(fn): raise TestFailed("__import__ did "
- "not result in creation of either a .pyc or .pyo file")
- s = os.stat(fn)
- self.assertEquals(stat.S_IMODE(s.st_mode),
- stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
- finally:
- os.umask(oldmask)
- remove_files(TESTFN)
- if TESTFN in sys.modules: del sys.modules[TESTFN]
- del sys.path[0]
+ self.fail("__import__ did not result in creation of "
+ "either a .pyc or .pyo file")
+ s = os.stat(fn)
+ self.assertEqual(stat.S_IMODE(s.st_mode),
+ stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
+ finally:
+ os.umask(oldmask)
+ remove_files(TESTFN)
+ unload(TESTFN)
+ del sys.path[0]
- def testImpModule(self):
+ def test_imp_module(self):
# Verify that the imp module can correctly load and find .py files
- import imp
- x = imp.find_module("os")
- os = imp.load_module("os", *x)
+
+ # XXX (ncoghlan): It would be nice to use test_support.CleanImport
+ # here, but that breaks because the os module registers some
+ # handlers in copy_reg on import. Since CleanImport doesn't
+ # revert that registration, the module is left in a broken
+ # state after reversion. Reinitialising the module contents
+ # and just reverting os.environ to its previous state is an OK
+ # workaround
+ orig_path = os.path
+ orig_getenv = os.getenv
+ with EnvironmentVarGuard():
+ x = imp.find_module("os")
+ new_os = imp.load_module("os", *x)
+ self.assertIs(os, new_os)
+ self.assertIs(orig_path, new_os.path)
+ self.assertIsNot(orig_getenv, new_os.getenv)
def test_module_with_large_stack(self, module='longlist'):
- # create module w/list of 65000 elements to test bug #561858
+ # Regression test for http://bugs.python.org/issue561858.
filename = module + os.extsep + 'py'
- # create a file with a list of 65000 elements
- f = open(filename, 'w+')
- f.write('d = [\n')
- for i in range(65000):
- f.write('"",\n')
- f.write(']')
- f.close()
-
- # compile & remove .py file, we only need .pyc (or .pyo)
- f = open(filename, 'r')
- py_compile.compile(filename)
- f.close()
- os.unlink(filename)
-
- # need to be able to load from current dir
+ # Create a file with a list of 65000 elements.
+ with open(filename, 'w+') as f:
+ f.write('d = [\n')
+ for i in range(65000):
+ f.write('"",\n')
+ f.write(']')
+
+ # Compile & remove .py file, we only need .pyc (or .pyo).
+ with open(filename, 'r') as f:
+ py_compile.compile(filename)
+ unlink(filename)
+
+ # Need to be able to load from current dir.
sys.path.append('')
- # this used to crash
+ # This used to crash.
exec 'import ' + module
- # cleanup
+ # Cleanup.
del sys.path[-1]
- for ext in 'pyc', 'pyo':
- fname = module + os.extsep + ext
- if os.path.exists(fname):
- os.unlink(fname)
+ unlink(filename + 'c')
+ unlink(filename + 'o')
def test_failing_import_sticks(self):
source = TESTFN + os.extsep + "py"
- f = open(source, "w")
- print >> f, "a = 1 // 0"
- f.close()
+ with open(source, "w") as f:
+ print >> f, "a = 1 // 0"
# New in 2.4, we shouldn't be able to import that no matter how often
# we try.
sys.path.insert(0, os.curdir)
try:
- for i in 1, 2, 3:
- try:
- mod = __import__(TESTFN)
- except ZeroDivisionError:
- if TESTFN in sys.modules:
- self.fail("damaged module in sys.modules on %i. try" % i)
- else:
- self.fail("was able to import a damaged module on %i. try" % i)
+ for i in [1, 2, 3]:
+ self.assertRaises(ZeroDivisionError, __import__, TESTFN)
+ self.assertNotIn(TESTFN, sys.modules,
+ "damaged module in sys.modules on %i try" % i)
finally:
- sys.path.pop(0)
+ del sys.path[0]
remove_files(TESTFN)
def test_failing_reload(self):
# A failing reload should leave the module object in sys.modules.
source = TESTFN + os.extsep + "py"
- f = open(source, "w")
- print >> f, "a = 1"
- print >> f, "b = 2"
- f.close()
+ with open(source, "w") as f:
+ print >> f, "a = 1"
+ print >> f, "b = 2"
sys.path.insert(0, os.curdir)
try:
mod = __import__(TESTFN)
- self.assert_(TESTFN in sys.modules, "expected module in sys.modules")
- self.assertEquals(mod.a, 1, "module has wrong attribute values")
- self.assertEquals(mod.b, 2, "module has wrong attribute values")
+ self.assertIn(TESTFN, sys.modules)
+ self.assertEqual(mod.a, 1, "module has wrong attribute values")
+ self.assertEqual(mod.b, 2, "module has wrong attribute values")
# On WinXP, just replacing the .py file wasn't enough to
# convince reload() to reparse it. Maybe the timestamp didn't
@@ -199,68 +200,73 @@ class ImportTest(unittest.TestCase):
remove_files(TESTFN)
# Now damage the module.
- f = open(source, "w")
- print >> f, "a = 10"
- print >> f, "b = 20//0"
- f.close()
+ with open(source, "w") as f:
+ print >> f, "a = 10"
+ print >> f, "b = 20//0"
self.assertRaises(ZeroDivisionError, imp.reload, mod)
# But we still expect the module to be in sys.modules.
mod = sys.modules.get(TESTFN)
- self.failIf(mod is None, "expected module to still be in sys.modules")
+ self.assertIsNot(mod, None, "expected module to be in sys.modules")
# We should have replaced a w/ 10, but the old b value should
# stick.
- self.assertEquals(mod.a, 10, "module has wrong attribute values")
- self.assertEquals(mod.b, 2, "module has wrong attribute values")
+ self.assertEqual(mod.a, 10, "module has wrong attribute values")
+ self.assertEqual(mod.b, 2, "module has wrong attribute values")
finally:
- sys.path.pop(0)
+ del sys.path[0]
remove_files(TESTFN)
- if TESTFN in sys.modules:
- del sys.modules[TESTFN]
+ unload(TESTFN)
def test_infinite_reload(self):
- # Bug #742342 reports that Python segfaults (infinite recursion in C)
- # when faced with self-recursive reload()ing.
+ # http://bugs.python.org/issue742342 reports that Python segfaults
+ # (infinite recursion in C) when faced with self-recursive reload()ing.
sys.path.insert(0, os.path.dirname(__file__))
try:
import infinite_reload
finally:
- sys.path.pop(0)
+ del sys.path[0]
def test_import_name_binding(self):
- # import x.y.z binds x in the current namespace
+ # import x.y.z binds x in the current namespace.
import test as x
import test.test_support
- self.assert_(x is test, x.__name__)
- self.assert_(hasattr(test.test_support, "__file__"))
+ self.assertIs(x, test, x.__name__)
+ self.assertTrue(hasattr(test.test_support, "__file__"))
- # import x.y.z as w binds z as w
+ # import x.y.z as w binds z as w.
import test.test_support as y
- self.assert_(y is test.test_support, y.__name__)
+ self.assertIs(y, test.test_support, y.__name__)
def test_import_initless_directory_warning(self):
- with warnings.catch_warnings():
+ with check_warnings(('', ImportWarning)):
# Just a random non-package directory we always expect to be
# somewhere in sys.path...
- warnings.simplefilter('error', ImportWarning)
- self.assertRaises(ImportWarning, __import__, "site-packages")
+ self.assertRaises(ImportError, __import__, "site-packages")
- def test_importbyfilename(self):
+ def test_import_by_filename(self):
path = os.path.abspath(TESTFN)
- try:
+ with self.assertRaises(ImportError) as c:
__import__(path)
- except ImportError, err:
- self.assertEqual("Import by filename is not supported.",
- err.args[0])
- else:
- self.fail("import by path didn't raise an exception")
-
-
-class TestPycRewriting(unittest.TestCase):
+ self.assertEqual("Import by filename is not supported.",
+ c.exception.args[0])
+
+ def test_import_in_del_does_not_crash(self):
+ # Issue 4236
+ testfn = script_helper.make_script('', TESTFN, textwrap.dedent("""\
+ import sys
+ class C:
+ def __del__(self):
+ import imp
+ sys.argv.insert(0, C())
+ """))
+ script_helper.assert_python_ok(testfn)
+
+
+class PycRewritingTests(unittest.TestCase):
# Test that the `co_filename` attribute on code objects always points
# to the right file, even when various things happen (e.g. both the .py
# and the .pyc file are renamed).
@@ -292,12 +298,10 @@ func_filename = func.func_code.co_filename
if self.orig_module is not None:
sys.modules[self.module_name] = self.orig_module
else:
- del sys.modules[self.module_name]
- for file_name in self.file_name, self.compiled_name:
- if os.path.exists(file_name):
- os.remove(file_name)
- if os.path.exists(self.dir_name):
- shutil.rmtree(self.dir_name)
+ unload(self.module_name)
+ unlink(self.file_name)
+ unlink(self.compiled_name)
+ rmtree(self.dir_name)
def import_module(self):
ns = globals()
@@ -351,6 +355,7 @@ func_filename = func.func_code.co_filename
mod = self.import_module()
self.assertEqual(mod.constant.co_filename, foreign_code.co_filename)
+
class PathsTests(unittest.TestCase):
path = TESTFN
@@ -359,58 +364,78 @@ class PathsTests(unittest.TestCase):
self.syspath = sys.path[:]
def tearDown(self):
- shutil.rmtree(self.path)
- sys.path = self.syspath
+ rmtree(self.path)
+ sys.path[:] = self.syspath
- # http://bugs.python.org/issue1293
+ # Regression test for http://bugs.python.org/issue1293.
def test_trailing_slash(self):
- f = open(os.path.join(self.path, 'test_trailing_slash.py'), 'w')
- f.write("testdata = 'test_trailing_slash'")
- f.close()
+ with open(os.path.join(self.path, 'test_trailing_slash.py'), 'w') as f:
+ f.write("testdata = 'test_trailing_slash'")
sys.path.append(self.path+'/')
mod = __import__("test_trailing_slash")
self.assertEqual(mod.testdata, 'test_trailing_slash')
unload("test_trailing_slash")
-class RelativeImport(unittest.TestCase):
+ # Regression test for http://bugs.python.org/issue3677.
+ def _test_UNC_path(self):
+ with open(os.path.join(self.path, 'test_trailing_slash.py'), 'w') as f:
+ f.write("testdata = 'test_trailing_slash'")
+ # Create the UNC path, like \\myhost\c$\foo\bar.
+ path = os.path.abspath(self.path)
+ import socket
+ hn = socket.gethostname()
+ drive = path[0]
+ unc = "\\\\%s\\%s$"%(hn, drive)
+ unc += path[2:]
+ sys.path.append(path)
+ mod = __import__("test_trailing_slash")
+ self.assertEqual(mod.testdata, 'test_trailing_slash')
+ unload("test_trailing_slash")
+
+ if sys.platform == "win32":
+ test_UNC_path = _test_UNC_path
+
+
+class RelativeImportTests(unittest.TestCase):
+
def tearDown(self):
- try:
- del sys.modules["test.relimport"]
- except:
- pass
+ unload("test.relimport")
+ setUp = tearDown
def test_relimport_star(self):
# This will import * from .test_import.
from . import relimport
- self.assertTrue(hasattr(relimport, "RelativeImport"))
+ self.assertTrue(hasattr(relimport, "RelativeImportTests"))
def test_issue3221(self):
+ # Regression test for http://bugs.python.org/issue3221.
def check_absolute():
exec "from os import path" in ns
def check_relative():
exec "from . import relimport" in ns
+
# Check both OK with __package__ and __name__ correct
ns = dict(__package__='test', __name__='test.notarealmodule')
check_absolute()
check_relative()
+
# Check both OK with only __name__ wrong
ns = dict(__package__='test', __name__='notarealpkg.notarealmodule')
check_absolute()
check_relative()
+
# Check relative fails with only __package__ wrong
ns = dict(__package__='foo', __name__='test.notarealmodule')
- with check_warnings() as w:
+ with check_warnings(('.+foo', RuntimeWarning)):
check_absolute()
- self.assert_('foo' in str(w.message))
- self.assertEqual(w.category, RuntimeWarning)
self.assertRaises(SystemError, check_relative)
+
# Check relative fails with __package__ and __name__ wrong
ns = dict(__package__='foo', __name__='notarealpkg.notarealmodule')
- with check_warnings() as w:
+ with check_warnings(('.+foo', RuntimeWarning)):
check_absolute()
- self.assert_('foo' in str(w.message))
- self.assertEqual(w.category, RuntimeWarning)
self.assertRaises(SystemError, check_relative)
+
# Check both fail with package set to a non-string
ns = dict(__package__=object())
self.assertRaises(ValueError, check_absolute)
@@ -420,19 +445,16 @@ class RelativeImport(unittest.TestCase):
# If explicit relative import syntax is used, then do not try
# to perform an absolute import in the face of failure.
# Issue #7902.
- try:
+ with self.assertRaises(ImportError):
from .os import sep
- except ImportError:
- pass
- else:
self.fail("explicit relative import triggered an "
"implicit absolute import")
def test_main(verbose=None):
- run_unittest(ImportTest, TestPycRewriting, PathsTests, RelativeImport)
+ run_unittest(ImportTests, PycRewritingTests, PathsTests, RelativeImportTests)
if __name__ == '__main__':
- # test needs to be a package, so we can do relative import
+ # Test needs to be a package, so we can do relative imports.
from test.test_import import test_main
test_main()
diff --git a/Lib/test/test_importhooks.py b/Lib/test/test_importhooks.py
index c4f739950a..cfab1f2854 100644
--- a/Lib/test/test_importhooks.py
+++ b/Lib/test/test_importhooks.py
@@ -177,11 +177,11 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
TestImporter.modules['reloadmodule'] = (False, test_co)
import reloadmodule
- self.failIf(hasattr(reloadmodule,'reloaded'))
+ self.assertFalse(hasattr(reloadmodule,'reloaded'))
TestImporter.modules['reloadmodule'] = (False, reload_co)
imp.reload(reloadmodule)
- self.failUnless(hasattr(reloadmodule,'reloaded'))
+ self.assertTrue(hasattr(reloadmodule,'reloaded'))
import hooktestpackage.oldabs
self.assertEqual(hooktestpackage.oldabs.get_name(),
@@ -227,15 +227,9 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
def testBlocker(self):
mname = "exceptions" # an arbitrary harmless builtin module
- if mname in sys.modules:
- del sys.modules[mname]
+ test_support.unload(mname)
sys.meta_path.append(ImportBlocker(mname))
- try:
- __import__(mname)
- except ImportError:
- pass
- else:
- self.fail("'%s' was not supposed to be importable" % mname)
+ self.assertRaises(ImportError, __import__, mname)
def testImpWrapper(self):
i = ImpWrapper()
@@ -247,7 +241,8 @@ class ImportHooksTestCase(ImportHooksBaseTestCase):
for n in sys.modules.keys():
if n.startswith(parent):
del sys.modules[n]
- with test_support._check_py3k_warnings():
+ with test_support.check_warnings(("The compiler package is deprecated "
+ "and removed", DeprecationWarning)):
for mname in mnames:
m = __import__(mname, globals(), locals(), ["__dummy__"])
m.__loader__ # to make sure we actually handled the import
diff --git a/Lib/test/test_importlib.py b/Lib/test/test_importlib.py
new file mode 100644
index 0000000000..51d8da601a
--- /dev/null
+++ b/Lib/test/test_importlib.py
@@ -0,0 +1,176 @@
+import contextlib
+import imp
+import importlib
+import sys
+import unittest
+
+
+@contextlib.contextmanager
+def uncache(*names):
+ """Uncache a module from sys.modules.
+
+ A basic sanity check is performed to prevent uncaching modules that either
+ cannot/shouldn't be uncached.
+
+ """
+ for name in names:
+ if name in ('sys', 'marshal', 'imp'):
+ raise ValueError(
+ "cannot uncache {0} as it will break _importlib".format(name))
+ try:
+ del sys.modules[name]
+ except KeyError:
+ pass
+ try:
+ yield
+ finally:
+ for name in names:
+ try:
+ del sys.modules[name]
+ except KeyError:
+ pass
+
+
+@contextlib.contextmanager
+def import_state(**kwargs):
+ """Context manager to manage the various importers and stored state in the
+ sys module.
+
+ The 'modules' attribute is not supported as the interpreter state stores a
+ pointer to the dict that the interpreter uses internally;
+ reassigning to sys.modules does not have the desired effect.
+
+ """
+ originals = {}
+ try:
+ for attr, default in (('meta_path', []), ('path', []),
+ ('path_hooks', []),
+ ('path_importer_cache', {})):
+ originals[attr] = getattr(sys, attr)
+ if attr in kwargs:
+ new_value = kwargs[attr]
+ del kwargs[attr]
+ else:
+ new_value = default
+ setattr(sys, attr, new_value)
+ if len(kwargs):
+ raise ValueError(
+ 'unrecognized arguments: {0}'.format(kwargs.keys()))
+ yield
+ finally:
+ for attr, value in originals.items():
+ setattr(sys, attr, value)
+
+
+class mock_modules(object):
+
+ """A mock importer/loader."""
+
+ def __init__(self, *names):
+ self.modules = {}
+ for name in names:
+ if not name.endswith('.__init__'):
+ import_name = name
+ else:
+ import_name = name[:-len('.__init__')]
+ if '.' not in name:
+ package = None
+ elif import_name == name:
+ package = name.rsplit('.', 1)[0]
+ else:
+ package = import_name
+ module = imp.new_module(import_name)
+ module.__loader__ = self
+ module.__file__ = '<mock __file__>'
+ module.__package__ = package
+ module.attr = name
+ if import_name != name:
+ module.__path__ = ['<mock __path__>']
+ self.modules[import_name] = module
+
+ def __getitem__(self, name):
+ return self.modules[name]
+
+ def find_module(self, fullname, path=None):
+ if fullname not in self.modules:
+ return None
+ else:
+ return self
+
+ def load_module(self, fullname):
+ if fullname not in self.modules:
+ raise ImportError
+ else:
+ sys.modules[fullname] = self.modules[fullname]
+ return self.modules[fullname]
+
+ def __enter__(self):
+ self._uncache = uncache(*self.modules.keys())
+ self._uncache.__enter__()
+ return self
+
+ def __exit__(self, *exc_info):
+ self._uncache.__exit__(None, None, None)
+
+
+
+class ImportModuleTests(unittest.TestCase):
+
+ """Test importlib.import_module."""
+
+ def test_module_import(self):
+ # Test importing a top-level module.
+ with mock_modules('top_level') as mock:
+ with import_state(meta_path=[mock]):
+ module = importlib.import_module('top_level')
+ self.assertEqual(module.__name__, 'top_level')
+
+ def test_absolute_package_import(self):
+ # Test importing a module from a package with an absolute name.
+ pkg_name = 'pkg'
+ pkg_long_name = '{0}.__init__'.format(pkg_name)
+ name = '{0}.mod'.format(pkg_name)
+ with mock_modules(pkg_long_name, name) as mock:
+ with import_state(meta_path=[mock]):
+ module = importlib.import_module(name)
+ self.assertEqual(module.__name__, name)
+
+ def test_shallow_relative_package_import(self):
+ modules = ['a.__init__', 'a.b.__init__', 'a.b.c.__init__', 'a.b.c.d']
+ with mock_modules(*modules) as mock:
+ with import_state(meta_path=[mock]):
+ module = importlib.import_module('.d', 'a.b.c')
+ self.assertEqual(module.__name__, 'a.b.c.d')
+
+ def test_deep_relative_package_import(self):
+ # Test importing a module from a package through a relatve import.
+ modules = ['a.__init__', 'a.b.__init__', 'a.c']
+ with mock_modules(*modules) as mock:
+ with import_state(meta_path=[mock]):
+ module = importlib.import_module('..c', 'a.b')
+ self.assertEqual(module.__name__, 'a.c')
+
+ def test_absolute_import_with_package(self):
+ # Test importing a module from a package with an absolute name with
+ # the 'package' argument given.
+ pkg_name = 'pkg'
+ pkg_long_name = '{0}.__init__'.format(pkg_name)
+ name = '{0}.mod'.format(pkg_name)
+ with mock_modules(pkg_long_name, name) as mock:
+ with import_state(meta_path=[mock]):
+ module = importlib.import_module(name, pkg_name)
+ self.assertEqual(module.__name__, name)
+
+ def test_relative_import_wo_package(self):
+ # Relative imports cannot happen without the 'package' argument being
+ # set.
+ self.assertRaises(TypeError, importlib.import_module, '.support')
+
+
+def test_main():
+ from test.test_support import run_unittest
+ run_unittest(ImportModuleTests)
+
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_index.py b/Lib/test/test_index.py
index c985569e0d..a92b4428a3 100644
--- a/Lib/test/test_index.py
+++ b/Lib/test/test_index.py
@@ -49,6 +49,8 @@ class BaseTestCase(unittest.TestCase):
self.assertEqual(-7L.__index__(), -7)
self.assertEqual(self.o.__index__(), 4)
self.assertEqual(self.n.__index__(), 5)
+ self.assertEqual(True.__index__(), 1)
+ self.assertEqual(False.__index__(), 0)
def test_subclasses(self):
r = range(10)
@@ -60,10 +62,10 @@ class BaseTestCase(unittest.TestCase):
def test_error(self):
self.o.ind = 'dumb'
self.n.ind = 'bad'
- self.failUnlessRaises(TypeError, operator.index, self.o)
- self.failUnlessRaises(TypeError, operator.index, self.n)
- self.failUnlessRaises(TypeError, slice(self.o).indices, 0)
- self.failUnlessRaises(TypeError, slice(self.n).indices, 0)
+ self.assertRaises(TypeError, operator.index, self.o)
+ self.assertRaises(TypeError, operator.index, self.n)
+ self.assertRaises(TypeError, slice(self.o).indices, 0)
+ self.assertRaises(TypeError, slice(self.n).indices, 0)
class SeqTestCase(unittest.TestCase):
@@ -89,6 +91,24 @@ class SeqTestCase(unittest.TestCase):
self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])
+ def test_slice_bug7532(self):
+ seqlen = len(self.seq)
+ self.o.ind = int(seqlen * 1.5)
+ self.n.ind = seqlen + 2
+ self.assertEqual(self.seq[self.o:], self.seq[0:0])
+ self.assertEqual(self.seq[:self.o], self.seq)
+ self.assertEqual(self.seq[self.n:], self.seq[0:0])
+ self.assertEqual(self.seq[:self.n], self.seq)
+ if isinstance(self.seq, ClassicSeq):
+ return
+ # These tests fail for ClassicSeq (see bug #7532)
+ self.o2.ind = -seqlen - 2
+ self.n2.ind = -int(seqlen * 1.5)
+ self.assertEqual(self.seq[self.o2:], self.seq)
+ self.assertEqual(self.seq[:self.o2], self.seq[0:0])
+ self.assertEqual(self.seq[self.n2:], self.seq)
+ self.assertEqual(self.seq[:self.n2], self.seq[0:0])
+
def test_repeat(self):
self.o.ind = 3
self.n.ind = 2
@@ -115,11 +135,11 @@ class SeqTestCase(unittest.TestCase):
self.o.ind = 'dumb'
self.n.ind = 'bad'
indexobj = lambda x, obj: obj.seq[x]
- self.failUnlessRaises(TypeError, indexobj, self.o, self)
- self.failUnlessRaises(TypeError, indexobj, self.n, self)
+ self.assertRaises(TypeError, indexobj, self.o, self)
+ self.assertRaises(TypeError, indexobj, self.n, self)
sliceobj = lambda x, obj: obj.seq[x:]
- self.failUnlessRaises(TypeError, sliceobj, self.o, self)
- self.failUnlessRaises(TypeError, sliceobj, self.n, self)
+ self.assertRaises(TypeError, sliceobj, self.o, self)
+ self.assertRaises(TypeError, sliceobj, self.n, self)
class ListTestCase(SeqTestCase):
@@ -152,19 +172,68 @@ class ListTestCase(SeqTestCase):
lst = [5, 6, 7, 8, 9, 11]
l2 = lst.__imul__(self.n)
- self.assert_(l2 is lst)
+ self.assertIs(l2, lst)
self.assertEqual(lst, [5, 6, 7, 8, 9, 11] * 3)
+class _BaseSeq:
+
+ def __init__(self, iterable):
+ self._list = list(iterable)
+
+ def __repr__(self):
+ return repr(self._list)
+
+ def __eq__(self, other):
+ return self._list == other
+
+ def __len__(self):
+ return len(self._list)
+
+ def __mul__(self, n):
+ return self.__class__(self._list*n)
+ __rmul__ = __mul__
+
+ def __getitem__(self, index):
+ return self._list[index]
+
+
+class _GetSliceMixin:
+
+ def __getslice__(self, i, j):
+ return self._list.__getslice__(i, j)
+
+
+class ClassicSeq(_BaseSeq): pass
+class NewSeq(_BaseSeq, object): pass
+class ClassicSeqDeprecated(_GetSliceMixin, ClassicSeq): pass
+class NewSeqDeprecated(_GetSliceMixin, NewSeq): pass
+
+
class TupleTestCase(SeqTestCase):
seq = (0,10,20,30,40,50)
class StringTestCase(SeqTestCase):
seq = "this is a test"
+class ByteArrayTestCase(SeqTestCase):
+ seq = bytearray("this is a test")
+
class UnicodeTestCase(SeqTestCase):
seq = u"this is a test"
+class ClassicSeqTestCase(SeqTestCase):
+ seq = ClassicSeq((0,10,20,30,40,50))
+
+class NewSeqTestCase(SeqTestCase):
+ seq = NewSeq((0,10,20,30,40,50))
+
+class ClassicSeqDeprecatedTestCase(SeqTestCase):
+ seq = ClassicSeqDeprecated((0,10,20,30,40,50))
+
+class NewSeqDeprecatedTestCase(SeqTestCase):
+ seq = NewSeqDeprecated((0,10,20,30,40,50))
+
class XRangeTestCase(unittest.TestCase):
@@ -187,7 +256,21 @@ class OverflowTestCase(unittest.TestCase):
def _getitem_helper(self, base):
class GetItem(base):
def __len__(self):
- return maxint #cannot return long here
+ return maxint # cannot return long here
+ def __getitem__(self, key):
+ return key
+ x = GetItem()
+ self.assertEqual(x[self.pos], self.pos)
+ self.assertEqual(x[self.neg], self.neg)
+ self.assertEqual(x[self.neg:self.pos].indices(maxsize),
+ (0, maxsize, 1))
+ self.assertEqual(x[self.neg:self.pos:1].indices(maxsize),
+ (0, maxsize, 1))
+
+ def _getslice_helper_deprecated(self, base):
+ class GetItem(base):
+ def __len__(self):
+ return maxint # cannot return long here
def __getitem__(self, key):
return key
def __getslice__(self, i, j):
@@ -195,20 +278,25 @@ class OverflowTestCase(unittest.TestCase):
x = GetItem()
self.assertEqual(x[self.pos], self.pos)
self.assertEqual(x[self.neg], self.neg)
- with test_support._check_py3k_warnings():
- self.assertEqual(x[self.neg:self.pos], (maxint+minsize, maxsize))
- self.assertEqual(x[self.neg:self.pos:1].indices(maxsize), (0, maxsize, 1))
+ self.assertEqual(x[self.neg:self.pos], (maxint+minsize, maxsize))
+ self.assertEqual(x[self.neg:self.pos:1].indices(maxsize),
+ (0, maxsize, 1))
def test_getitem(self):
self._getitem_helper(object)
+ with test_support.check_py3k_warnings():
+ self._getslice_helper_deprecated(object)
def test_getitem_classic(self):
class Empty: pass
- self._getitem_helper(Empty)
+ # XXX This test fails (see bug #7532)
+ #self._getitem_helper(Empty)
+ with test_support.check_py3k_warnings():
+ self._getslice_helper_deprecated(Empty)
def test_sequence_repeat(self):
- self.failUnlessRaises(OverflowError, lambda: "a" * self.pos)
- self.failUnlessRaises(OverflowError, lambda: "a" * self.neg)
+ self.assertRaises(OverflowError, lambda: "a" * self.pos)
+ self.assertRaises(OverflowError, lambda: "a" * self.neg)
def test_main():
@@ -216,11 +304,20 @@ def test_main():
BaseTestCase,
ListTestCase,
TupleTestCase,
+ ByteArrayTestCase,
StringTestCase,
UnicodeTestCase,
+ ClassicSeqTestCase,
+ NewSeqTestCase,
XRangeTestCase,
OverflowTestCase,
)
+ with test_support.check_py3k_warnings():
+ test_support.run_unittest(
+ ClassicSeqDeprecatedTestCase,
+ NewSeqDeprecatedTestCase,
+ )
+
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index dc9765f824..d93ffec58b 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -1,17 +1,24 @@
+import re
import sys
import types
import unittest
import inspect
+import linecache
import datetime
+from UserList import UserList
+from UserDict import UserDict
-from test.test_support import run_unittest, _check_py3k_warnings
+from test.test_support import run_unittest, check_py3k_warnings
-with _check_py3k_warnings(
+with check_py3k_warnings(
("tuple parameter unpacking has been removed", SyntaxWarning),
quiet=True):
from test import inspect_fodder as mod
from test import inspect_fodder2 as mod2
+# C module for test_findsource_binary
+import unicodedata
+
# Functions tested in this suite:
# ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
# isbuiltin, isroutine, isgenerator, isgeneratorfunction, getmembers,
@@ -43,13 +50,13 @@ class IsTestBase(unittest.TestCase):
def istest(self, predicate, exp):
obj = eval(exp)
- self.failUnless(predicate(obj), '%s(%s)' % (predicate.__name__, exp))
+ self.assertTrue(predicate(obj), '%s(%s)' % (predicate.__name__, exp))
for other in self.predicates - set([predicate]):
if predicate == inspect.isgeneratorfunction and\
other == inspect.isfunction:
continue
- self.failIf(other(obj), 'not %s(%s)' % (other.__name__, exp))
+ self.assertFalse(other(obj), 'not %s(%s)' % (other.__name__, exp))
def generator_function_example(self):
for i in xrange(2):
@@ -68,7 +75,6 @@ class TestPredicates(IsTestBase):
def test_excluding_predicates(self):
self.istest(inspect.isbuiltin, 'sys.exit')
self.istest(inspect.isbuiltin, '[].append')
- self.istest(inspect.isclass, 'mod.StupidGit')
self.istest(inspect.iscode, 'mod.spam.func_code')
self.istest(inspect.isframe, 'tb.tb_frame')
self.istest(inspect.isfunction, 'mod.spam')
@@ -84,15 +90,61 @@ class TestPredicates(IsTestBase):
self.istest(inspect.isgetsetdescriptor,
'type(tb.tb_frame).f_locals')
else:
- self.failIf(inspect.isgetsetdescriptor(type(tb.tb_frame).f_locals))
+ self.assertFalse(inspect.isgetsetdescriptor(type(tb.tb_frame).f_locals))
if hasattr(types, 'MemberDescriptorType'):
self.istest(inspect.ismemberdescriptor, 'datetime.timedelta.days')
else:
- self.failIf(inspect.ismemberdescriptor(datetime.timedelta.days))
+ self.assertFalse(inspect.ismemberdescriptor(datetime.timedelta.days))
def test_isroutine(self):
- self.assert_(inspect.isroutine(mod.spam))
- self.assert_(inspect.isroutine([].count))
+ self.assertTrue(inspect.isroutine(mod.spam))
+ self.assertTrue(inspect.isroutine([].count))
+
+ def test_isclass(self):
+ self.istest(inspect.isclass, 'mod.StupidGit')
+ self.assertTrue(inspect.isclass(list))
+
+ class newstyle(object): pass
+ self.assertTrue(inspect.isclass(newstyle))
+
+ class CustomGetattr(object):
+ def __getattr__(self, attr):
+ return None
+ self.assertFalse(inspect.isclass(CustomGetattr()))
+
+ def test_get_slot_members(self):
+ class C(object):
+ __slots__ = ("a", "b")
+
+ x = C()
+ x.a = 42
+ members = dict(inspect.getmembers(x))
+ self.assertIn('a', members)
+ self.assertNotIn('b', members)
+
+ def test_isabstract(self):
+ from abc import ABCMeta, abstractmethod
+
+ class AbstractClassExample(object):
+ __metaclass__ = ABCMeta
+
+ @abstractmethod
+ def foo(self):
+ pass
+
+ class ClassExample(AbstractClassExample):
+ def foo(self):
+ pass
+
+ a = ClassExample()
+
+ # Test general behaviour.
+ self.assertTrue(inspect.isabstract(AbstractClassExample))
+ self.assertFalse(inspect.isabstract(ClassExample))
+ self.assertFalse(inspect.isabstract(a))
+ self.assertFalse(inspect.isabstract(int))
+ self.assertFalse(inspect.isabstract(5))
+
class TestInterpreterStack(IsTestBase):
def __init__(self, *args, **kwargs):
@@ -105,7 +157,7 @@ class TestInterpreterStack(IsTestBase):
self.istest(inspect.isframe, 'mod.fr')
def test_stack(self):
- self.assert_(len(mod.st) >= 5)
+ self.assertTrue(len(mod.st) >= 5)
self.assertEqual(mod.st[0][1:],
(modfile, 16, 'eggs', [' st = inspect.stack()\n'], 0))
self.assertEqual(mod.st[1][1:],
@@ -148,7 +200,8 @@ class GetSourceBase(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
- self.source = file(inspect.getsourcefile(self.fodderFile)).read()
+ with open(inspect.getsourcefile(self.fodderFile)) as fp:
+ self.source = fp.read()
def sourcerange(self, top, bottom):
lines = self.source.split("\n")
@@ -184,6 +237,8 @@ class TestRetrievingSourceCode(GetSourceBase):
self.assertEqual(functions, [('eggs', mod.eggs),
('spam', mod.spam)])
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_getdoc(self):
self.assertEqual(inspect.getdoc(mod), 'A module docstring.')
self.assertEqual(inspect.getdoc(mod.StupidGit),
@@ -220,6 +275,11 @@ class TestRetrievingSourceCode(GetSourceBase):
def test_getsourcefile(self):
self.assertEqual(inspect.getsourcefile(mod.spam), modfile)
self.assertEqual(inspect.getsourcefile(git.abuse), modfile)
+ fn = "_non_existing_filename_used_for_sourcefile_test.py"
+ co = compile("None", fn, "exec")
+ self.assertEqual(inspect.getsourcefile(co), None)
+ linecache.cache[co.co_filename] = (1, None, "None", co.co_filename)
+ self.assertEqual(inspect.getsourcefile(co), fn)
def test_getfile(self):
self.assertEqual(inspect.getfile(mod.StupidGit), mod.__file__)
@@ -310,6 +370,23 @@ class TestBuggyCases(GetSourceBase):
def test_method_in_dynamic_class(self):
self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97)
+ @unittest.skipIf(
+ not hasattr(unicodedata, '__file__') or
+ unicodedata.__file__[-4:] in (".pyc", ".pyo"),
+ "unicodedata is not an external binary module")
+ def test_findsource_binary(self):
+ self.assertRaises(IOError, inspect.getsource, unicodedata)
+ self.assertRaises(IOError, inspect.findsource, unicodedata)
+
+ def test_findsource_code_in_linecache(self):
+ lines = ["x=1"]
+ co = compile(lines[0], "_dynamically_created_file", "exec")
+ self.assertRaises(IOError, inspect.findsource, co)
+ self.assertRaises(IOError, inspect.getsource, co)
+ linecache.cache[co.co_filename] = (1, None, lines, co.co_filename)
+ self.assertEqual(inspect.findsource(co), (lines,0))
+ self.assertEqual(inspect.getsource(co), lines[0])
+
# Helper for testing classify_class_attrs.
def attrs_wo_objs(cls):
return [t[:3] for t in inspect.classify_class_attrs(cls)]
@@ -364,7 +441,7 @@ class TestClassesAndFunctions(unittest.TestCase):
self.assertArgSpecEquals(A.m, ['self'])
def test_getargspec_sublistofone(self):
- with _check_py3k_warnings(
+ with check_py3k_warnings(
("tuple parameter unpacking has been removed", SyntaxWarning),
("parenthesized argument names are invalid", SyntaxWarning)):
exec 'def sublistOfOne((foo,)): return 1'
@@ -373,8 +450,18 @@ class TestClassesAndFunctions(unittest.TestCase):
exec 'def fakeSublistOfOne((foo)): return 1'
self.assertArgSpecEquals(fakeSublistOfOne, ['foo'])
- def test_classify_oldstyle(self):
- class A:
+
+ def _classify_test(self, newstyle):
+ """Helper for testing that classify_class_attrs finds a bunch of
+ different kinds of attributes on a given class.
+ """
+ if newstyle:
+ base = object
+ else:
+ class base:
+ pass
+
+ class A(base):
def s(): pass
s = staticmethod(s)
@@ -391,23 +478,23 @@ class TestClassesAndFunctions(unittest.TestCase):
datablob = '1'
attrs = attrs_wo_objs(A)
- self.assert_(('s', 'static method', A) in attrs, 'missing static method')
- self.assert_(('c', 'class method', A) in attrs, 'missing class method')
- self.assert_(('p', 'property', A) in attrs, 'missing property')
- self.assert_(('m', 'method', A) in attrs, 'missing plain method')
- self.assert_(('m1', 'method', A) in attrs, 'missing plain method')
- self.assert_(('datablob', 'data', A) in attrs, 'missing data')
+ self.assertIn(('s', 'static method', A), attrs, 'missing static method')
+ self.assertIn(('c', 'class method', A), attrs, 'missing class method')
+ self.assertIn(('p', 'property', A), attrs, 'missing property')
+ self.assertIn(('m', 'method', A), attrs, 'missing plain method')
+ self.assertIn(('m1', 'method', A), attrs, 'missing plain method')
+ self.assertIn(('datablob', 'data', A), attrs, 'missing data')
class B(A):
def m(self): pass
attrs = attrs_wo_objs(B)
- self.assert_(('s', 'static method', A) in attrs, 'missing static method')
- self.assert_(('c', 'class method', A) in attrs, 'missing class method')
- self.assert_(('p', 'property', A) in attrs, 'missing property')
- self.assert_(('m', 'method', B) in attrs, 'missing plain method')
- self.assert_(('m1', 'method', A) in attrs, 'missing plain method')
- self.assert_(('datablob', 'data', A) in attrs, 'missing data')
+ self.assertIn(('s', 'static method', A), attrs, 'missing static method')
+ self.assertIn(('c', 'class method', A), attrs, 'missing class method')
+ self.assertIn(('p', 'property', A), attrs, 'missing property')
+ self.assertIn(('m', 'method', B), attrs, 'missing plain method')
+ self.assertIn(('m1', 'method', A), attrs, 'missing plain method')
+ self.assertIn(('datablob', 'data', A), attrs, 'missing data')
class C(A):
@@ -415,93 +502,251 @@ class TestClassesAndFunctions(unittest.TestCase):
def c(self): pass
attrs = attrs_wo_objs(C)
- self.assert_(('s', 'static method', A) in attrs, 'missing static method')
- self.assert_(('c', 'method', C) in attrs, 'missing plain method')
- self.assert_(('p', 'property', A) in attrs, 'missing property')
- self.assert_(('m', 'method', C) in attrs, 'missing plain method')
- self.assert_(('m1', 'method', A) in attrs, 'missing plain method')
- self.assert_(('datablob', 'data', A) in attrs, 'missing data')
+ self.assertIn(('s', 'static method', A), attrs, 'missing static method')
+ self.assertIn(('c', 'method', C), attrs, 'missing plain method')
+ self.assertIn(('p', 'property', A), attrs, 'missing property')
+ self.assertIn(('m', 'method', C), attrs, 'missing plain method')
+ self.assertIn(('m1', 'method', A), attrs, 'missing plain method')
+ self.assertIn(('datablob', 'data', A), attrs, 'missing data')
class D(B, C):
def m1(self): pass
attrs = attrs_wo_objs(D)
- self.assert_(('s', 'static method', A) in attrs, 'missing static method')
- self.assert_(('c', 'class method', A) in attrs, 'missing class method')
- self.assert_(('p', 'property', A) in attrs, 'missing property')
- self.assert_(('m', 'method', B) in attrs, 'missing plain method')
- self.assert_(('m1', 'method', D) in attrs, 'missing plain method')
- self.assert_(('datablob', 'data', A) in attrs, 'missing data')
-
- # Repeat all that, but w/ new-style classes.
- def test_classify_newstyle(self):
- class A(object):
-
- def s(): pass
- s = staticmethod(s)
-
- def c(cls): pass
- c = classmethod(c)
-
- def getp(self): pass
- p = property(getp)
-
- def m(self): pass
-
- def m1(self): pass
-
- datablob = '1'
-
- attrs = attrs_wo_objs(A)
- self.assert_(('s', 'static method', A) in attrs, 'missing static method')
- self.assert_(('c', 'class method', A) in attrs, 'missing class method')
- self.assert_(('p', 'property', A) in attrs, 'missing property')
- self.assert_(('m', 'method', A) in attrs, 'missing plain method')
- self.assert_(('m1', 'method', A) in attrs, 'missing plain method')
- self.assert_(('datablob', 'data', A) in attrs, 'missing data')
+ self.assertIn(('s', 'static method', A), attrs, 'missing static method')
+ if newstyle:
+ self.assertIn(('c', 'method', C), attrs, 'missing plain method')
+ else:
+ self.assertIn(('c', 'class method', A), attrs, 'missing class method')
+ self.assertIn(('p', 'property', A), attrs, 'missing property')
+ self.assertIn(('m', 'method', B), attrs, 'missing plain method')
+ self.assertIn(('m1', 'method', D), attrs, 'missing plain method')
+ self.assertIn(('datablob', 'data', A), attrs, 'missing data')
- class B(A):
- def m(self): pass
+ def test_classify_oldstyle(self):
+ """classify_class_attrs finds static methods, class methods,
+ properties, normal methods, and data attributes on an old-style
+ class.
+ """
+ self._classify_test(False)
- attrs = attrs_wo_objs(B)
- self.assert_(('s', 'static method', A) in attrs, 'missing static method')
- self.assert_(('c', 'class method', A) in attrs, 'missing class method')
- self.assert_(('p', 'property', A) in attrs, 'missing property')
- self.assert_(('m', 'method', B) in attrs, 'missing plain method')
- self.assert_(('m1', 'method', A) in attrs, 'missing plain method')
- self.assert_(('datablob', 'data', A) in attrs, 'missing data')
+ def test_classify_newstyle(self):
+ """Just like test_classify_oldstyle, but for a new-style class.
+ """
+ self._classify_test(True)
- class C(A):
- def m(self): pass
- def c(self): pass
- attrs = attrs_wo_objs(C)
- self.assert_(('s', 'static method', A) in attrs, 'missing static method')
- self.assert_(('c', 'method', C) in attrs, 'missing plain method')
- self.assert_(('p', 'property', A) in attrs, 'missing property')
- self.assert_(('m', 'method', C) in attrs, 'missing plain method')
- self.assert_(('m1', 'method', A) in attrs, 'missing plain method')
- self.assert_(('datablob', 'data', A) in attrs, 'missing data')
+class TestGetcallargsFunctions(unittest.TestCase):
- class D(B, C):
+ # tuple parameters are named '.1', '.2', etc.
+ is_tuplename = re.compile(r'^\.\d+$').match
- def m1(self): pass
+ def assertEqualCallArgs(self, func, call_params_string, locs=None):
+ locs = dict(locs or {}, func=func)
+ r1 = eval('func(%s)' % call_params_string, None, locs)
+ r2 = eval('inspect.getcallargs(func, %s)' % call_params_string, None,
+ locs)
+ self.assertEqual(r1, r2)
- attrs = attrs_wo_objs(D)
- self.assert_(('s', 'static method', A) in attrs, 'missing static method')
- self.assert_(('c', 'method', C) in attrs, 'missing plain method')
- self.assert_(('p', 'property', A) in attrs, 'missing property')
- self.assert_(('m', 'method', B) in attrs, 'missing plain method')
- self.assert_(('m1', 'method', D) in attrs, 'missing plain method')
- self.assert_(('datablob', 'data', A) in attrs, 'missing data')
+ def assertEqualException(self, func, call_param_string, locs=None):
+ locs = dict(locs or {}, func=func)
+ try:
+ eval('func(%s)' % call_param_string, None, locs)
+ except Exception, ex1:
+ pass
+ else:
+ self.fail('Exception not raised')
+ try:
+ eval('inspect.getcallargs(func, %s)' % call_param_string, None,
+ locs)
+ except Exception, ex2:
+ pass
+ else:
+ self.fail('Exception not raised')
+ self.assertIs(type(ex1), type(ex2))
+ self.assertEqual(str(ex1), str(ex2))
+
+ def makeCallable(self, signature):
+ """Create a function that returns its locals(), excluding the
+ autogenerated '.1', '.2', etc. tuple param names (if any)."""
+ with check_py3k_warnings(
+ ("tuple parameter unpacking has been removed", SyntaxWarning),
+ quiet=True):
+ code = ("lambda %s: dict(i for i in locals().items() "
+ "if not is_tuplename(i[0]))")
+ return eval(code % signature, {'is_tuplename' : self.is_tuplename})
+
+ def test_plain(self):
+ f = self.makeCallable('a, b=1')
+ self.assertEqualCallArgs(f, '2')
+ self.assertEqualCallArgs(f, '2, 3')
+ self.assertEqualCallArgs(f, 'a=2')
+ self.assertEqualCallArgs(f, 'b=3, a=2')
+ self.assertEqualCallArgs(f, '2, b=3')
+ # expand *iterable / **mapping
+ self.assertEqualCallArgs(f, '*(2,)')
+ self.assertEqualCallArgs(f, '*[2]')
+ self.assertEqualCallArgs(f, '*(2, 3)')
+ self.assertEqualCallArgs(f, '*[2, 3]')
+ self.assertEqualCallArgs(f, '**{"a":2}')
+ self.assertEqualCallArgs(f, 'b=3, **{"a":2}')
+ self.assertEqualCallArgs(f, '2, **{"b":3}')
+ self.assertEqualCallArgs(f, '**{"b":3, "a":2}')
+ # expand UserList / UserDict
+ self.assertEqualCallArgs(f, '*UserList([2])')
+ self.assertEqualCallArgs(f, '*UserList([2, 3])')
+ self.assertEqualCallArgs(f, '**UserDict(a=2)')
+ self.assertEqualCallArgs(f, '2, **UserDict(b=3)')
+ self.assertEqualCallArgs(f, 'b=2, **UserDict(a=3)')
+ # unicode keyword args
+ self.assertEqualCallArgs(f, '**{u"a":2}')
+ self.assertEqualCallArgs(f, 'b=3, **{u"a":2}')
+ self.assertEqualCallArgs(f, '2, **{u"b":3}')
+ self.assertEqualCallArgs(f, '**{u"b":3, u"a":2}')
+
+ def test_varargs(self):
+ f = self.makeCallable('a, b=1, *c')
+ self.assertEqualCallArgs(f, '2')
+ self.assertEqualCallArgs(f, '2, 3')
+ self.assertEqualCallArgs(f, '2, 3, 4')
+ self.assertEqualCallArgs(f, '*(2,3,4)')
+ self.assertEqualCallArgs(f, '2, *[3,4]')
+ self.assertEqualCallArgs(f, '2, 3, *UserList([4])')
+
+ def test_varkw(self):
+ f = self.makeCallable('a, b=1, **c')
+ self.assertEqualCallArgs(f, 'a=2')
+ self.assertEqualCallArgs(f, '2, b=3, c=4')
+ self.assertEqualCallArgs(f, 'b=3, a=2, c=4')
+ self.assertEqualCallArgs(f, 'c=4, **{"a":2, "b":3}')
+ self.assertEqualCallArgs(f, '2, c=4, **{"b":3}')
+ self.assertEqualCallArgs(f, 'b=2, **{"a":3, "c":4}')
+ self.assertEqualCallArgs(f, '**UserDict(a=2, b=3, c=4)')
+ self.assertEqualCallArgs(f, '2, c=4, **UserDict(b=3)')
+ self.assertEqualCallArgs(f, 'b=2, **UserDict(a=3, c=4)')
+ # unicode keyword args
+ self.assertEqualCallArgs(f, 'c=4, **{u"a":2, u"b":3}')
+ self.assertEqualCallArgs(f, '2, c=4, **{u"b":3}')
+ self.assertEqualCallArgs(f, 'b=2, **{u"a":3, u"c":4}')
+
+ def test_varkw_only(self):
+ # issue11256:
+ f = self.makeCallable('**c')
+ self.assertEqualCallArgs(f, '')
+ self.assertEqualCallArgs(f, 'a=1')
+ self.assertEqualCallArgs(f, 'a=1, b=2')
+ self.assertEqualCallArgs(f, 'c=3, **{"a": 1, "b": 2}')
+ self.assertEqualCallArgs(f, '**UserDict(a=1, b=2)')
+ self.assertEqualCallArgs(f, 'c=3, **UserDict(a=1, b=2)')
+
+ def test_tupleargs(self):
+ f = self.makeCallable('(b,c), (d,(e,f))=(0,[1,2])')
+ self.assertEqualCallArgs(f, '(2,3)')
+ self.assertEqualCallArgs(f, '[2,3]')
+ self.assertEqualCallArgs(f, 'UserList([2,3])')
+ self.assertEqualCallArgs(f, '(2,3), (4,(5,6))')
+ self.assertEqualCallArgs(f, '(2,3), (4,[5,6])')
+ self.assertEqualCallArgs(f, '(2,3), [4,UserList([5,6])]')
+
+ def test_multiple_features(self):
+ f = self.makeCallable('a, b=2, (c,(d,e))=(3,[4,5]), *f, **g')
+ self.assertEqualCallArgs(f, '2, 3, (4,[5,6]), 7')
+ self.assertEqualCallArgs(f, '2, 3, *[(4,[5,6]), 7], x=8')
+ self.assertEqualCallArgs(f, '2, 3, x=8, *[(4,[5,6]), 7]')
+ self.assertEqualCallArgs(f, '2, x=8, *[3, (4,[5,6]), 7], y=9')
+ self.assertEqualCallArgs(f, 'x=8, *[2, 3, (4,[5,6])], y=9')
+ self.assertEqualCallArgs(f, 'x=8, *UserList([2, 3, (4,[5,6])]), '
+ '**{"y":9, "z":10}')
+ self.assertEqualCallArgs(f, '2, x=8, *UserList([3, (4,[5,6])]), '
+ '**UserDict(y=9, z=10)')
+
+ def test_errors(self):
+ f0 = self.makeCallable('')
+ f1 = self.makeCallable('a, b')
+ f2 = self.makeCallable('a, b=1')
+ # f0 takes no arguments
+ self.assertEqualException(f0, '1')
+ self.assertEqualException(f0, 'x=1')
+ self.assertEqualException(f0, '1,x=1')
+ # f1 takes exactly 2 arguments
+ self.assertEqualException(f1, '')
+ self.assertEqualException(f1, '1')
+ self.assertEqualException(f1, 'a=2')
+ self.assertEqualException(f1, 'b=3')
+ # f2 takes at least 1 argument
+ self.assertEqualException(f2, '')
+ self.assertEqualException(f2, 'b=3')
+ for f in f1, f2:
+ # f1/f2 takes exactly/at most 2 arguments
+ self.assertEqualException(f, '2, 3, 4')
+ self.assertEqualException(f, '1, 2, 3, a=1')
+ self.assertEqualException(f, '2, 3, 4, c=5')
+ self.assertEqualException(f, '2, 3, 4, a=1, c=5')
+ # f got an unexpected keyword argument
+ self.assertEqualException(f, 'c=2')
+ self.assertEqualException(f, '2, c=3')
+ self.assertEqualException(f, '2, 3, c=4')
+ self.assertEqualException(f, '2, c=4, b=3')
+ self.assertEqualException(f, '**{u"\u03c0\u03b9": 4}')
+ # f got multiple values for keyword argument
+ self.assertEqualException(f, '1, a=2')
+ self.assertEqualException(f, '1, **{"a":2}')
+ self.assertEqualException(f, '1, 2, b=3')
+ # XXX: Python inconsistency
+ # - for functions and bound methods: unexpected keyword 'c'
+ # - for unbound methods: multiple values for keyword 'a'
+ #self.assertEqualException(f, '1, c=3, a=2')
+ f = self.makeCallable('(a,b)=(0,1)')
+ self.assertEqualException(f, '1')
+ self.assertEqualException(f, '[1]')
+ self.assertEqualException(f, '(1,2,3)')
+ # issue11256:
+ f3 = self.makeCallable('**c')
+ self.assertEqualException(f3, '1, 2')
+ self.assertEqualException(f3, '1, 2, a=1, b=2')
+
+class TestGetcallargsMethods(TestGetcallargsFunctions):
+
+ def setUp(self):
+ class Foo(object):
+ pass
+ self.cls = Foo
+ self.inst = Foo()
+
+ def makeCallable(self, signature):
+ assert 'self' not in signature
+ mk = super(TestGetcallargsMethods, self).makeCallable
+ self.cls.method = mk('self, ' + signature)
+ return self.inst.method
+
+class TestGetcallargsUnboundMethods(TestGetcallargsMethods):
+
+ def makeCallable(self, signature):
+ super(TestGetcallargsUnboundMethods, self).makeCallable(signature)
+ return self.cls.method
+
+ def assertEqualCallArgs(self, func, call_params_string, locs=None):
+ return super(TestGetcallargsUnboundMethods, self).assertEqualCallArgs(
+ *self._getAssertEqualParams(func, call_params_string, locs))
+
+ def assertEqualException(self, func, call_params_string, locs=None):
+ return super(TestGetcallargsUnboundMethods, self).assertEqualException(
+ *self._getAssertEqualParams(func, call_params_string, locs))
+
+ def _getAssertEqualParams(self, func, call_params_string, locs=None):
+ assert 'inst' not in call_params_string
+ locs = dict(locs or {}, inst=self.inst)
+ return (func, 'inst,' + call_params_string, locs)
def test_main():
- run_unittest(TestDecorators, TestRetrievingSourceCode, TestOneliners,
- TestBuggyCases,
- TestInterpreterStack, TestClassesAndFunctions, TestPredicates)
+ run_unittest(
+ TestDecorators, TestRetrievingSourceCode, TestOneliners, TestBuggyCases,
+ TestInterpreterStack, TestClassesAndFunctions, TestPredicates,
+ TestGetcallargsFunctions, TestGetcallargsMethods,
+ TestGetcallargsUnboundMethods)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_int.py b/Lib/test/test_int.py
index 51fd195918..fa46212d9b 100644
--- a/Lib/test/test_int.py
+++ b/Lib/test/test_int.py
@@ -2,6 +2,7 @@ import sys
import unittest
from test.test_support import run_unittest, have_unicode
+import math
L = [
('0', 0),
@@ -75,15 +76,15 @@ class IntTestCases(unittest.TestCase):
s = repr(-1-sys.maxint)
x = int(s)
self.assertEqual(x+1, -sys.maxint)
- self.assert_(isinstance(x, int))
+ self.assertIsInstance(x, int)
# should return long
self.assertEqual(int(s[1:]), sys.maxint+1)
# should return long
x = int(1e100)
- self.assert_(isinstance(x, long))
+ self.assertIsInstance(x, long)
x = int(-1e100)
- self.assert_(isinstance(x, long))
+ self.assertIsInstance(x, long)
# SF bug 434186: 0x80000000/2 != 0x80000000>>1.
@@ -101,11 +102,11 @@ class IntTestCases(unittest.TestCase):
self.assertRaises(ValueError, int, '123\x00 245', 20)
x = int('1' * 600)
- self.assert_(isinstance(x, long))
+ self.assertIsInstance(x, long)
if have_unicode:
x = int(unichr(0x661) * 600)
- self.assert_(isinstance(x, long))
+ self.assertIsInstance(x, long)
self.assertRaises(TypeError, int, 1, 12)
@@ -246,6 +247,74 @@ class IntTestCases(unittest.TestCase):
self.assertEqual(int('2br45qc', 35), 4294967297L)
self.assertEqual(int('1z141z5', 36), 4294967297L)
+ def test_bit_length(self):
+ tiny = 1e-10
+ for x in xrange(-65000, 65000):
+ k = x.bit_length()
+ # Check equivalence with Python version
+ self.assertEqual(k, len(bin(x).lstrip('-0b')))
+ # Behaviour as specified in the docs
+ if x != 0:
+ self.assertTrue(2**(k-1) <= abs(x) < 2**k)
+ else:
+ self.assertEqual(k, 0)
+ # Alternative definition: x.bit_length() == 1 + floor(log_2(x))
+ if x != 0:
+ # When x is an exact power of 2, numeric errors can
+ # cause floor(log(x)/log(2)) to be one too small; for
+ # small x this can be fixed by adding a small quantity
+ # to the quotient before taking the floor.
+ self.assertEqual(k, 1 + math.floor(
+ math.log(abs(x))/math.log(2) + tiny))
+
+ self.assertEqual((0).bit_length(), 0)
+ self.assertEqual((1).bit_length(), 1)
+ self.assertEqual((-1).bit_length(), 1)
+ self.assertEqual((2).bit_length(), 2)
+ self.assertEqual((-2).bit_length(), 2)
+ for i in [2, 3, 15, 16, 17, 31, 32, 33, 63, 64]:
+ a = 2**i
+ self.assertEqual((a-1).bit_length(), i)
+ self.assertEqual((1-a).bit_length(), i)
+ self.assertEqual((a).bit_length(), i+1)
+ self.assertEqual((-a).bit_length(), i+1)
+ self.assertEqual((a+1).bit_length(), i+1)
+ self.assertEqual((-a-1).bit_length(), i+1)
+
+ @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+ def test_float_conversion(self):
+ # values exactly representable as floats
+ exact_values = [-2, -1, 0, 1, 2, 2**52, 2**53-1, 2**53, 2**53+2,
+ 2**53+4, 2**54-4, 2**54-2, 2**63, -2**63, 2**64,
+ -2**64, 10**20, 10**21, 10**22]
+ for value in exact_values:
+ self.assertEqual(int(float(int(value))), value)
+
+ # test round-half-to-even
+ self.assertEqual(int(float(2**53+1)), 2**53)
+ self.assertEqual(int(float(2**53+2)), 2**53+2)
+ self.assertEqual(int(float(2**53+3)), 2**53+4)
+ self.assertEqual(int(float(2**53+5)), 2**53+4)
+ self.assertEqual(int(float(2**53+6)), 2**53+6)
+ self.assertEqual(int(float(2**53+7)), 2**53+8)
+
+ self.assertEqual(int(float(-2**53-1)), -2**53)
+ self.assertEqual(int(float(-2**53-2)), -2**53-2)
+ self.assertEqual(int(float(-2**53-3)), -2**53-4)
+ self.assertEqual(int(float(-2**53-5)), -2**53-4)
+ self.assertEqual(int(float(-2**53-6)), -2**53-6)
+ self.assertEqual(int(float(-2**53-7)), -2**53-8)
+
+ self.assertEqual(int(float(2**54-2)), 2**54-2)
+ self.assertEqual(int(float(2**54-1)), 2**54)
+ self.assertEqual(int(float(2**54+2)), 2**54)
+ self.assertEqual(int(float(2**54+3)), 2**54+4)
+ self.assertEqual(int(float(2**54+5)), 2**54+4)
+ self.assertEqual(int(float(2**54+6)), 2**54+8)
+ self.assertEqual(int(float(2**54+10)), 2**54+8)
+ self.assertEqual(int(float(2**54+11)), 2**54+12)
+
def test_intconversion(self):
# Test __int__()
class ClassicMissingMethods:
@@ -323,7 +392,7 @@ class IntTestCases(unittest.TestCase):
try:
int(TruncReturnsNonIntegral())
except TypeError as e:
- self.assertEquals(str(e),
+ self.assertEqual(str(e),
"__trunc__ returned non-Integral"
" (type NonIntegral)")
else:
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index e7579922fa..8af8a64622 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -1,4 +1,24 @@
-"""Unit tests for io.py."""
+"""Unit tests for the io module."""
+
+# Tests of io are scattered over the test suite:
+# * test_bufio - tests file buffering
+# * test_memoryio - tests BytesIO and StringIO
+# * test_fileio - tests FileIO
+# * test_file - tests the file interface
+# * test_io - tests everything else in the io module
+# * test_univnewlines - tests universal newline support
+# * test_largefile - tests operations on a file greater than 2**32 bytes
+# (only enabled with -ulargefile)
+
+################################################################################
+# ATTENTION TEST WRITERS!!!
+################################################################################
+# When writing tests for io, it's important to test both the C and Python
+# implementations. This is usually done by writing a base test that refers to
+# the type it is testing as a attribute. Then it provides custom subclasses to
+# test both implementations. This file has lots of examples.
+################################################################################
+
from __future__ import print_function
from __future__ import unicode_literals
@@ -6,30 +26,45 @@ import os
import sys
import time
import array
-import threading
import random
import unittest
+import weakref
+import abc
+import signal
+import errno
from itertools import cycle, count
-from test import test_support
+from collections import deque
+from test import test_support as support
import codecs
-import io # The module under test
+import io # C implementation of io
+import _pyio as pyio # Python implementation of io
+try:
+ import threading
+except ImportError:
+ threading = None
+
+__metaclass__ = type
+bytes = support.py3k_bytes
+
+def _default_chunk_size():
+ """Get the default TextIOWrapper chunk size"""
+ with io.open(__file__, "r", encoding="latin1") as f:
+ return f._CHUNK_SIZE
-class MockRawIO(io.RawIOBase):
+class MockRawIOWithoutRead:
+ """A RawIO implementation without read(), so as to exercise the default
+ RawIO.read() which calls readinto()."""
def __init__(self, read_stack=()):
self._read_stack = list(read_stack)
self._write_stack = []
-
- def read(self, n=None):
- try:
- return self._read_stack.pop(0)
- except:
- return b""
+ self._reads = 0
+ self._extraneous_reads = 0
def write(self, b):
- self._write_stack.append(b[:])
+ self._write_stack.append(bytes(b))
return len(b)
def writable(self):
@@ -45,49 +80,176 @@ class MockRawIO(io.RawIOBase):
return True
def seek(self, pos, whence):
- pass
+ return 0 # wrong but we gotta return something
def tell(self):
- return 42
+ return 0 # same comment as above
+
+ def readinto(self, buf):
+ self._reads += 1
+ max_len = len(buf)
+ try:
+ data = self._read_stack[0]
+ except IndexError:
+ self._extraneous_reads += 1
+ return 0
+ if data is None:
+ del self._read_stack[0]
+ return None
+ n = len(data)
+ if len(data) <= max_len:
+ del self._read_stack[0]
+ buf[:n] = data
+ return n
+ else:
+ buf[:] = data[:max_len]
+ self._read_stack[0] = data[max_len:]
+ return max_len
+
+ def truncate(self, pos=None):
+ return pos
+
+class CMockRawIOWithoutRead(MockRawIOWithoutRead, io.RawIOBase):
+ pass
+
+class PyMockRawIOWithoutRead(MockRawIOWithoutRead, pyio.RawIOBase):
+ pass
+
+
+class MockRawIO(MockRawIOWithoutRead):
+
+ def read(self, n=None):
+ self._reads += 1
+ try:
+ return self._read_stack.pop(0)
+ except:
+ self._extraneous_reads += 1
+ return b""
+
+class CMockRawIO(MockRawIO, io.RawIOBase):
+ pass
+
+class PyMockRawIO(MockRawIO, pyio.RawIOBase):
+ pass
+
+class MisbehavedRawIO(MockRawIO):
+ def write(self, b):
+ return MockRawIO.write(self, b) * 2
+
+ def read(self, n=None):
+ return MockRawIO.read(self, n) * 2
-class MockFileIO(io.BytesIO):
+ def seek(self, pos, whence):
+ return -123
+
+ def tell(self):
+ return -456
+
+ def readinto(self, buf):
+ MockRawIO.readinto(self, buf)
+ return len(buf) * 5
+
+class CMisbehavedRawIO(MisbehavedRawIO, io.RawIOBase):
+ pass
+
+class PyMisbehavedRawIO(MisbehavedRawIO, pyio.RawIOBase):
+ pass
+
+
+class CloseFailureIO(MockRawIO):
+ closed = 0
+
+ def close(self):
+ if not self.closed:
+ self.closed = 1
+ raise IOError
+
+class CCloseFailureIO(CloseFailureIO, io.RawIOBase):
+ pass
+
+class PyCloseFailureIO(CloseFailureIO, pyio.RawIOBase):
+ pass
+
+
+class MockFileIO:
def __init__(self, data):
self.read_history = []
- io.BytesIO.__init__(self, data)
+ super(MockFileIO, self).__init__(data)
def read(self, n=None):
- res = io.BytesIO.read(self, n)
+ res = super(MockFileIO, self).read(n)
self.read_history.append(None if res is None else len(res))
return res
+ def readinto(self, b):
+ res = super(MockFileIO, self).readinto(b)
+ self.read_history.append(res)
+ return res
+
+class CMockFileIO(MockFileIO, io.BytesIO):
+ pass
+
+class PyMockFileIO(MockFileIO, pyio.BytesIO):
+ pass
+
-class MockNonBlockWriterIO(io.RawIOBase):
+class MockNonBlockWriterIO:
- def __init__(self, blocking_script):
- self._blocking_script = list(blocking_script)
+ def __init__(self):
self._write_stack = []
+ self._blocker_char = None
- def write(self, b):
- self._write_stack.append(b[:])
- n = self._blocking_script.pop(0)
- if (n < 0):
- raise io.BlockingIOError(0, "test blocking", -n)
- else:
- return n
+ def pop_written(self):
+ s = b"".join(self._write_stack)
+ self._write_stack[:] = []
+ return s
+
+ def block_on(self, char):
+ """Block when a given char is encountered."""
+ self._blocker_char = char
+
+ def readable(self):
+ return True
+
+ def seekable(self):
+ return True
def writable(self):
return True
+ def write(self, b):
+ b = bytes(b)
+ n = -1
+ if self._blocker_char:
+ try:
+ n = b.index(self._blocker_char)
+ except ValueError:
+ pass
+ else:
+ self._blocker_char = None
+ self._write_stack.append(b[:n])
+ raise self.BlockingIOError(0, "test blocking", n)
+ self._write_stack.append(b)
+ return len(b)
+
+class CMockNonBlockWriterIO(MockNonBlockWriterIO, io.RawIOBase):
+ BlockingIOError = io.BlockingIOError
+
+class PyMockNonBlockWriterIO(MockNonBlockWriterIO, pyio.RawIOBase):
+ BlockingIOError = pyio.BlockingIOError
+
class IOTest(unittest.TestCase):
+ def setUp(self):
+ support.unlink(support.TESTFN)
+
def tearDown(self):
- test_support.unlink(test_support.TESTFN)
+ support.unlink(support.TESTFN)
def write_ops(self, f):
-
self.assertEqual(f.write(b"blah."), 5)
f.truncate(0)
self.assertEqual(f.tell(), 5)
@@ -107,10 +269,6 @@ class IOTest(unittest.TestCase):
self.assertEqual(f.truncate(12), 12)
self.assertEqual(f.tell(), 13)
- self.assertEqual(f.write(b"hij"), 3)
- self.assertEqual(f.seek(0,1), 16)
- self.assertEqual(f.tell(), 16)
- self.assertEqual(f.truncate(12), 12)
self.assertRaises(TypeError, f.seek, 0.0)
def read_ops(self, f, buffered=False):
@@ -133,10 +291,6 @@ class IOTest(unittest.TestCase):
self.assertEqual(f.seek(-6, 1), 5)
self.assertEqual(f.read(5), b" worl")
self.assertEqual(f.tell(), 10)
- f.seek(0)
- f.read(2)
- f.seek(0, 1)
- self.assertEqual(f.tell(), 2)
self.assertRaises(TypeError, f.seek, 0.0)
if buffered:
f.seek(0)
@@ -164,67 +318,71 @@ class IOTest(unittest.TestCase):
self.assertEqual(f.seek(-1, 2), self.LARGE)
self.assertEqual(f.read(2), b"x")
+ def test_invalid_operations(self):
+ # Try writing on a file opened in read mode and vice-versa.
+ for mode in ("w", "wb"):
+ with self.open(support.TESTFN, mode) as fp:
+ self.assertRaises(IOError, fp.read)
+ self.assertRaises(IOError, fp.readline)
+ with self.open(support.TESTFN, "rb") as fp:
+ self.assertRaises(IOError, fp.write, b"blah")
+ self.assertRaises(IOError, fp.writelines, [b"blah\n"])
+ with self.open(support.TESTFN, "r") as fp:
+ self.assertRaises(IOError, fp.write, "blah")
+ self.assertRaises(IOError, fp.writelines, ["blah\n"])
+
def test_raw_file_io(self):
- f = io.open(test_support.TESTFN, "wb", buffering=0)
- self.assertEqual(f.readable(), False)
- self.assertEqual(f.writable(), True)
- self.assertEqual(f.seekable(), True)
- self.write_ops(f)
- f.close()
- f = io.open(test_support.TESTFN, "rb", buffering=0)
- self.assertEqual(f.readable(), True)
- self.assertEqual(f.writable(), False)
- self.assertEqual(f.seekable(), True)
- self.read_ops(f)
- f.close()
+ with self.open(support.TESTFN, "wb", buffering=0) as f:
+ self.assertEqual(f.readable(), False)
+ self.assertEqual(f.writable(), True)
+ self.assertEqual(f.seekable(), True)
+ self.write_ops(f)
+ with self.open(support.TESTFN, "rb", buffering=0) as f:
+ self.assertEqual(f.readable(), True)
+ self.assertEqual(f.writable(), False)
+ self.assertEqual(f.seekable(), True)
+ self.read_ops(f)
def test_buffered_file_io(self):
- f = io.open(test_support.TESTFN, "wb")
- self.assertEqual(f.readable(), False)
- self.assertEqual(f.writable(), True)
- self.assertEqual(f.seekable(), True)
- self.write_ops(f)
- f.close()
- f = io.open(test_support.TESTFN, "rb")
- self.assertEqual(f.readable(), True)
- self.assertEqual(f.writable(), False)
- self.assertEqual(f.seekable(), True)
- self.read_ops(f, True)
- f = io.open(test_support.TESTFN, "r+b")
- self.assertEqual(f.readable(), True)
- self.assertEqual(f.writable(), True)
- self.assertEqual(f.seekable(), True)
- self.write_ops(f)
- f.seek(0)
- self.read_ops(f, True)
- f.close()
+ with self.open(support.TESTFN, "wb") as f:
+ self.assertEqual(f.readable(), False)
+ self.assertEqual(f.writable(), True)
+ self.assertEqual(f.seekable(), True)
+ self.write_ops(f)
+ with self.open(support.TESTFN, "rb") as f:
+ self.assertEqual(f.readable(), True)
+ self.assertEqual(f.writable(), False)
+ self.assertEqual(f.seekable(), True)
+ self.read_ops(f, True)
def test_readline(self):
- f = io.open(test_support.TESTFN, "wb")
- f.write(b"abc\ndef\nxyzzy\nfoo")
- f.close()
- f = io.open(test_support.TESTFN, "rb")
- self.assertEqual(f.readline(), b"abc\n")
- self.assertEqual(f.readline(10), b"def\n")
- self.assertEqual(f.readline(2), b"xy")
- self.assertEqual(f.readline(4), b"zzy\n")
- self.assertEqual(f.readline(), b"foo")
- f.close()
+ with self.open(support.TESTFN, "wb") as f:
+ f.write(b"abc\ndef\nxyzzy\nfoo\x00bar\nanother line")
+ with self.open(support.TESTFN, "rb") as f:
+ self.assertEqual(f.readline(), b"abc\n")
+ self.assertEqual(f.readline(10), b"def\n")
+ self.assertEqual(f.readline(2), b"xy")
+ self.assertEqual(f.readline(4), b"zzy\n")
+ self.assertEqual(f.readline(), b"foo\x00bar\n")
+ self.assertEqual(f.readline(None), b"another line")
+ self.assertRaises(TypeError, f.readline, 5.3)
+ with self.open(support.TESTFN, "r") as f:
+ self.assertRaises(TypeError, f.readline, 5.3)
def test_raw_bytes_io(self):
- f = io.BytesIO()
+ f = self.BytesIO()
self.write_ops(f)
data = f.getvalue()
self.assertEqual(data, b"hello world\n")
- f = io.BytesIO(data)
+ f = self.BytesIO(data)
self.read_ops(f, True)
def test_large_file_ops(self):
# On Windows and Mac OSX this test comsumes large resources; It takes
# a long time to build the >2GB file and takes >2GB of disk space
# therefore the resource must be enabled to run this test.
- if sys.platform[:3] in ('win', 'os2') or sys.platform == 'darwin':
- if not test_support.is_resource_enabled("largefile"):
+ if sys.platform[:3] == 'win' or sys.platform == 'darwin':
+ if not support.is_resource_enabled("largefile"):
print("\nTesting large file ops skipped on %s." % sys.platform,
file=sys.stderr)
print("It requires %d bytes and a long time." % self.LARGE,
@@ -232,22 +390,20 @@ class IOTest(unittest.TestCase):
print("Use 'regrtest.py -u largefile test_io' to run it.",
file=sys.stderr)
return
- f = io.open(test_support.TESTFN, "w+b", 0)
- self.large_file_ops(f)
- f.close()
- f = io.open(test_support.TESTFN, "w+b")
- self.large_file_ops(f)
- f.close()
+ with self.open(support.TESTFN, "w+b", 0) as f:
+ self.large_file_ops(f)
+ with self.open(support.TESTFN, "w+b") as f:
+ self.large_file_ops(f)
def test_with_open(self):
for bufsize in (0, 1, 100):
f = None
- with open(test_support.TESTFN, "wb", bufsize) as f:
+ with self.open(support.TESTFN, "wb", bufsize) as f:
f.write(b"xxx")
self.assertEqual(f.closed, True)
f = None
try:
- with open(test_support.TESTFN, "wb", bufsize) as f:
+ with self.open(support.TESTFN, "wb", bufsize) as f:
1 // 0
except ZeroDivisionError:
self.assertEqual(f.closed, True)
@@ -256,60 +412,105 @@ class IOTest(unittest.TestCase):
# issue 5008
def test_append_mode_tell(self):
- with io.open(test_support.TESTFN, "wb") as f:
+ with self.open(support.TESTFN, "wb") as f:
f.write(b"xxx")
- with io.open(test_support.TESTFN, "ab", buffering=0) as f:
+ with self.open(support.TESTFN, "ab", buffering=0) as f:
self.assertEqual(f.tell(), 3)
- with io.open(test_support.TESTFN, "ab") as f:
+ with self.open(support.TESTFN, "ab") as f:
self.assertEqual(f.tell(), 3)
- with io.open(test_support.TESTFN, "a") as f:
- self.assert_(f.tell() > 0)
+ with self.open(support.TESTFN, "a") as f:
+ self.assertTrue(f.tell() > 0)
def test_destructor(self):
record = []
- class MyFileIO(io.FileIO):
+ class MyFileIO(self.FileIO):
def __del__(self):
record.append(1)
- io.FileIO.__del__(self)
+ try:
+ f = super(MyFileIO, self).__del__
+ except AttributeError:
+ pass
+ else:
+ f()
def close(self):
record.append(2)
- io.FileIO.close(self)
+ super(MyFileIO, self).close()
def flush(self):
record.append(3)
- io.FileIO.flush(self)
- f = MyFileIO(test_support.TESTFN, "w")
- f.write("xxx")
+ super(MyFileIO, self).flush()
+ f = MyFileIO(support.TESTFN, "wb")
+ f.write(b"xxx")
del f
+ support.gc_collect()
self.assertEqual(record, [1, 2, 3])
+ with self.open(support.TESTFN, "rb") as f:
+ self.assertEqual(f.read(), b"xxx")
+
+ def _check_base_destructor(self, base):
+ record = []
+ class MyIO(base):
+ def __init__(self):
+ # This exercises the availability of attributes on object
+ # destruction.
+ # (in the C version, close() is called by the tp_dealloc
+ # function, not by __del__)
+ self.on_del = 1
+ self.on_close = 2
+ self.on_flush = 3
+ def __del__(self):
+ record.append(self.on_del)
+ try:
+ f = super(MyIO, self).__del__
+ except AttributeError:
+ pass
+ else:
+ f()
+ def close(self):
+ record.append(self.on_close)
+ super(MyIO, self).close()
+ def flush(self):
+ record.append(self.on_flush)
+ super(MyIO, self).flush()
+ f = MyIO()
+ del f
+ support.gc_collect()
+ self.assertEqual(record, [1, 2, 3])
+
+ def test_IOBase_destructor(self):
+ self._check_base_destructor(self.IOBase)
+
+ def test_RawIOBase_destructor(self):
+ self._check_base_destructor(self.RawIOBase)
+
+ def test_BufferedIOBase_destructor(self):
+ self._check_base_destructor(self.BufferedIOBase)
+
+ def test_TextIOBase_destructor(self):
+ self._check_base_destructor(self.TextIOBase)
def test_close_flushes(self):
- f = io.open(test_support.TESTFN, "wb")
- f.write(b"xxx")
- f.close()
- f = io.open(test_support.TESTFN, "rb")
- self.assertEqual(f.read(), b"xxx")
- f.close()
+ with self.open(support.TESTFN, "wb") as f:
+ f.write(b"xxx")
+ with self.open(support.TESTFN, "rb") as f:
+ self.assertEqual(f.read(), b"xxx")
- def XXXtest_array_writes(self):
- # XXX memory view not available yet
- a = array.array('i', range(10))
- n = len(memoryview(a))
- f = io.open(test_support.TESTFN, "wb", 0)
- self.assertEqual(f.write(a), n)
- f.close()
- f = io.open(test_support.TESTFN, "wb")
- self.assertEqual(f.write(a), n)
- f.close()
+ def test_array_writes(self):
+ a = array.array(b'i', range(10))
+ n = len(a.tostring())
+ with self.open(support.TESTFN, "wb", 0) as f:
+ self.assertEqual(f.write(a), n)
+ with self.open(support.TESTFN, "wb") as f:
+ self.assertEqual(f.write(a), n)
def test_closefd(self):
- self.assertRaises(ValueError, io.open, test_support.TESTFN, 'w',
+ self.assertRaises(ValueError, self.open, support.TESTFN, 'w',
closefd=False)
- def testReadClosed(self):
- with io.open(test_support.TESTFN, "w") as f:
+ def test_read_closed(self):
+ with self.open(support.TESTFN, "w") as f:
f.write("egg\n")
- with io.open(test_support.TESTFN, "r") as f:
- file = io.open(f.fileno(), "r", closefd=False)
+ with self.open(support.TESTFN, "r") as f:
+ file = self.open(f.fileno(), "r", closefd=False)
self.assertEqual(file.read(), "egg\n")
file.seek(0)
file.close()
@@ -317,100 +518,263 @@ class IOTest(unittest.TestCase):
def test_no_closefd_with_filename(self):
# can't use closefd in combination with a file name
- self.assertRaises(ValueError,
- io.open, test_support.TESTFN, "r", closefd=False)
+ self.assertRaises(ValueError, self.open, support.TESTFN, "r", closefd=False)
def test_closefd_attr(self):
- with io.open(test_support.TESTFN, "wb") as f:
+ with self.open(support.TESTFN, "wb") as f:
f.write(b"egg\n")
- with io.open(test_support.TESTFN, "r") as f:
+ with self.open(support.TESTFN, "r") as f:
self.assertEqual(f.buffer.raw.closefd, True)
- file = io.open(f.fileno(), "r", closefd=False)
+ file = self.open(f.fileno(), "r", closefd=False)
self.assertEqual(file.buffer.raw.closefd, False)
+ def test_garbage_collection(self):
+ # FileIO objects are collected, and collecting them flushes
+ # all data to disk.
+ f = self.FileIO(support.TESTFN, "wb")
+ f.write(b"abcxxx")
+ f.f = f
+ wr = weakref.ref(f)
+ del f
+ support.gc_collect()
+ self.assertTrue(wr() is None, wr)
+ with self.open(support.TESTFN, "rb") as f:
+ self.assertEqual(f.read(), b"abcxxx")
+
+ def test_unbounded_file(self):
+ # Issue #1174606: reading from an unbounded stream such as /dev/zero.
+ zero = "/dev/zero"
+ if not os.path.exists(zero):
+ self.skipTest("{0} does not exist".format(zero))
+ if sys.maxsize > 0x7FFFFFFF:
+ self.skipTest("test can only run in a 32-bit address space")
+ if support.real_max_memuse < support._2G:
+ self.skipTest("test requires at least 2GB of memory")
+ with self.open(zero, "rb", buffering=0) as f:
+ self.assertRaises(OverflowError, f.read)
+ with self.open(zero, "rb") as f:
+ self.assertRaises(OverflowError, f.read)
+ with self.open(zero, "r") as f:
+ self.assertRaises(OverflowError, f.read)
+
def test_flush_error_on_close(self):
- f = io.open(test_support.TESTFN, "wb", buffering=0)
+ f = self.open(support.TESTFN, "wb", buffering=0)
def bad_flush():
raise IOError()
f.flush = bad_flush
self.assertRaises(IOError, f.close) # exception not swallowed
def test_multi_close(self):
- f = io.open(test_support.TESTFN, "wb", buffering=0)
+ f = self.open(support.TESTFN, "wb", buffering=0)
f.close()
f.close()
f.close()
self.assertRaises(ValueError, f.flush)
+ def test_RawIOBase_read(self):
+ # Exercise the default RawIOBase.read() implementation (which calls
+ # readinto() internally).
+ rawio = self.MockRawIOWithoutRead((b"abc", b"d", None, b"efg", None))
+ self.assertEqual(rawio.read(2), b"ab")
+ self.assertEqual(rawio.read(2), b"c")
+ self.assertEqual(rawio.read(2), b"d")
+ self.assertEqual(rawio.read(2), None)
+ self.assertEqual(rawio.read(2), b"ef")
+ self.assertEqual(rawio.read(2), b"g")
+ self.assertEqual(rawio.read(2), None)
+ self.assertEqual(rawio.read(2), b"")
-class MemorySeekTestMixin:
-
- def testInit(self):
- buf = self.buftype("1234567890")
- bytesIo = self.ioclass(buf)
-
- def testRead(self):
- buf = self.buftype("1234567890")
- bytesIo = self.ioclass(buf)
-
- self.assertEquals(buf[:1], bytesIo.read(1))
- self.assertEquals(buf[1:5], bytesIo.read(4))
- self.assertEquals(buf[5:], bytesIo.read(900))
- self.assertEquals(self.EOF, bytesIo.read())
-
- def testReadNoArgs(self):
- buf = self.buftype("1234567890")
- bytesIo = self.ioclass(buf)
-
- self.assertEquals(buf, bytesIo.read())
- self.assertEquals(self.EOF, bytesIo.read())
-
- def testSeek(self):
- buf = self.buftype("1234567890")
- bytesIo = self.ioclass(buf)
+class CIOTest(IOTest):
+ pass
- bytesIo.read(5)
- bytesIo.seek(0)
- self.assertEquals(buf, bytesIo.read())
+class PyIOTest(IOTest):
+ test_array_writes = unittest.skip(
+ "len(array.array) returns number of elements rather than bytelength"
+ )(IOTest.test_array_writes)
- bytesIo.seek(3)
- self.assertEquals(buf[3:], bytesIo.read())
- self.assertRaises(TypeError, bytesIo.seek, 0.0)
- def testTell(self):
- buf = self.buftype("1234567890")
- bytesIo = self.ioclass(buf)
+class CommonBufferedTests:
+ # Tests common to BufferedReader, BufferedWriter and BufferedRandom
- self.assertEquals(0, bytesIo.tell())
- bytesIo.seek(5)
- self.assertEquals(5, bytesIo.tell())
- bytesIo.seek(10000)
- self.assertEquals(10000, bytesIo.tell())
+ def test_detach(self):
+ raw = self.MockRawIO()
+ buf = self.tp(raw)
+ self.assertIs(buf.detach(), raw)
+ self.assertRaises(ValueError, buf.detach)
+ def test_fileno(self):
+ rawio = self.MockRawIO()
+ bufio = self.tp(rawio)
-class BytesIOTest(MemorySeekTestMixin, unittest.TestCase):
- @staticmethod
- def buftype(s):
- return s.encode("utf-8")
- ioclass = io.BytesIO
- EOF = b""
+ self.assertEqual(42, bufio.fileno())
+ def test_no_fileno(self):
+ # XXX will we always have fileno() function? If so, kill
+ # this test. Else, write it.
+ pass
-class StringIOTest(MemorySeekTestMixin, unittest.TestCase):
- buftype = str
- ioclass = io.StringIO
- EOF = ""
-
+ def test_invalid_args(self):
+ rawio = self.MockRawIO()
+ bufio = self.tp(rawio)
+ # Invalid whence
+ self.assertRaises(ValueError, bufio.seek, 0, -1)
+ self.assertRaises(ValueError, bufio.seek, 0, 3)
-class BufferedReaderTest(unittest.TestCase):
+ def test_override_destructor(self):
+ tp = self.tp
+ record = []
+ class MyBufferedIO(tp):
+ def __del__(self):
+ record.append(1)
+ try:
+ f = super(MyBufferedIO, self).__del__
+ except AttributeError:
+ pass
+ else:
+ f()
+ def close(self):
+ record.append(2)
+ super(MyBufferedIO, self).close()
+ def flush(self):
+ record.append(3)
+ super(MyBufferedIO, self).flush()
+ rawio = self.MockRawIO()
+ bufio = MyBufferedIO(rawio)
+ writable = bufio.writable()
+ del bufio
+ support.gc_collect()
+ if writable:
+ self.assertEqual(record, [1, 2, 3])
+ else:
+ self.assertEqual(record, [1, 2])
+
+ def test_context_manager(self):
+ # Test usability as a context manager
+ rawio = self.MockRawIO()
+ bufio = self.tp(rawio)
+ def _with():
+ with bufio:
+ pass
+ _with()
+ # bufio should now be closed, and using it a second time should raise
+ # a ValueError.
+ self.assertRaises(ValueError, _with)
+
+ def test_error_through_destructor(self):
+ # Test that the exception state is not modified by a destructor,
+ # even if close() fails.
+ rawio = self.CloseFailureIO()
+ def f():
+ self.tp(rawio).xyzzy
+ with support.captured_output("stderr") as s:
+ self.assertRaises(AttributeError, f)
+ s = s.getvalue().strip()
+ if s:
+ # The destructor *may* have printed an unraisable error, check it
+ self.assertEqual(len(s.splitlines()), 1)
+ self.assertTrue(s.startswith("Exception IOError: "), s)
+ self.assertTrue(s.endswith(" ignored"), s)
+
+ def test_repr(self):
+ raw = self.MockRawIO()
+ b = self.tp(raw)
+ clsname = "%s.%s" % (self.tp.__module__, self.tp.__name__)
+ self.assertEqual(repr(b), "<%s>" % clsname)
+ raw.name = "dummy"
+ self.assertEqual(repr(b), "<%s name=u'dummy'>" % clsname)
+ raw.name = b"dummy"
+ self.assertEqual(repr(b), "<%s name='dummy'>" % clsname)
- def testRead(self):
- rawio = MockRawIO((b"abc", b"d", b"efg"))
- bufio = io.BufferedReader(rawio)
+ def test_flush_error_on_close(self):
+ raw = self.MockRawIO()
+ def bad_flush():
+ raise IOError()
+ raw.flush = bad_flush
+ b = self.tp(raw)
+ self.assertRaises(IOError, b.close) # exception not swallowed
- self.assertEquals(b"abcdef", bufio.read(6))
+ def test_multi_close(self):
+ raw = self.MockRawIO()
+ b = self.tp(raw)
+ b.close()
+ b.close()
+ b.close()
+ self.assertRaises(ValueError, b.flush)
- def testBuffering(self):
+ def test_readonly_attributes(self):
+ raw = self.MockRawIO()
+ buf = self.tp(raw)
+ x = self.MockRawIO()
+ with self.assertRaises((AttributeError, TypeError)):
+ buf.raw = x
+
+
+class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
+ read_mode = "rb"
+
+ def test_constructor(self):
+ rawio = self.MockRawIO([b"abc"])
+ bufio = self.tp(rawio)
+ bufio.__init__(rawio)
+ bufio.__init__(rawio, buffer_size=1024)
+ bufio.__init__(rawio, buffer_size=16)
+ self.assertEqual(b"abc", bufio.read())
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
+ rawio = self.MockRawIO([b"abc"])
+ bufio.__init__(rawio)
+ self.assertEqual(b"abc", bufio.read())
+
+ def test_read(self):
+ for arg in (None, 7):
+ rawio = self.MockRawIO((b"abc", b"d", b"efg"))
+ bufio = self.tp(rawio)
+ self.assertEqual(b"abcdefg", bufio.read(arg))
+ # Invalid args
+ self.assertRaises(ValueError, bufio.read, -2)
+
+ def test_read1(self):
+ rawio = self.MockRawIO((b"abc", b"d", b"efg"))
+ bufio = self.tp(rawio)
+ self.assertEqual(b"a", bufio.read(1))
+ self.assertEqual(b"b", bufio.read1(1))
+ self.assertEqual(rawio._reads, 1)
+ self.assertEqual(b"c", bufio.read1(100))
+ self.assertEqual(rawio._reads, 1)
+ self.assertEqual(b"d", bufio.read1(100))
+ self.assertEqual(rawio._reads, 2)
+ self.assertEqual(b"efg", bufio.read1(100))
+ self.assertEqual(rawio._reads, 3)
+ self.assertEqual(b"", bufio.read1(100))
+ self.assertEqual(rawio._reads, 4)
+ # Invalid args
+ self.assertRaises(ValueError, bufio.read1, -1)
+
+ def test_readinto(self):
+ rawio = self.MockRawIO((b"abc", b"d", b"efg"))
+ bufio = self.tp(rawio)
+ b = bytearray(2)
+ self.assertEqual(bufio.readinto(b), 2)
+ self.assertEqual(b, b"ab")
+ self.assertEqual(bufio.readinto(b), 2)
+ self.assertEqual(b, b"cd")
+ self.assertEqual(bufio.readinto(b), 2)
+ self.assertEqual(b, b"ef")
+ self.assertEqual(bufio.readinto(b), 1)
+ self.assertEqual(b, b"gf")
+ self.assertEqual(bufio.readinto(b), 0)
+ self.assertEqual(b, b"gf")
+
+ def test_readlines(self):
+ def bufio():
+ rawio = self.MockRawIO((b"abc\n", b"d\n", b"ef"))
+ return self.tp(rawio)
+ self.assertEqual(bufio().readlines(), [b"abc\n", b"d\n", b"ef"])
+ self.assertEqual(bufio().readlines(5), [b"abc\n", b"d\n"])
+ self.assertEqual(bufio().readlines(None), [b"abc\n", b"d\n", b"ef"])
+
+ def test_buffering(self):
data = b"abcdefghi"
dlen = len(data)
@@ -421,61 +785,54 @@ class BufferedReaderTest(unittest.TestCase):
]
for bufsize, buf_read_sizes, raw_read_sizes in tests:
- rawio = MockFileIO(data)
- bufio = io.BufferedReader(rawio, buffer_size=bufsize)
+ rawio = self.MockFileIO(data)
+ bufio = self.tp(rawio, buffer_size=bufsize)
pos = 0
for nbytes in buf_read_sizes:
- self.assertEquals(bufio.read(nbytes), data[pos:pos+nbytes])
+ self.assertEqual(bufio.read(nbytes), data[pos:pos+nbytes])
pos += nbytes
- self.assertEquals(rawio.read_history, raw_read_sizes)
+ # this is mildly implementation-dependent
+ self.assertEqual(rawio.read_history, raw_read_sizes)
- def testReadNonBlocking(self):
+ def test_read_non_blocking(self):
# Inject some None's in there to simulate EWOULDBLOCK
- rawio = MockRawIO((b"abc", b"d", None, b"efg", None, None))
- bufio = io.BufferedReader(rawio)
-
- self.assertEquals(b"abcd", bufio.read(6))
- self.assertEquals(b"e", bufio.read(1))
- self.assertEquals(b"fg", bufio.read())
- self.assert_(None is bufio.read())
- self.assertEquals(b"", bufio.read())
-
- def testReadToEof(self):
- rawio = MockRawIO((b"abc", b"d", b"efg"))
- bufio = io.BufferedReader(rawio)
+ rawio = self.MockRawIO((b"abc", b"d", None, b"efg", None, None, None))
+ bufio = self.tp(rawio)
- self.assertEquals(b"abcdefg", bufio.read(9000))
+ self.assertEqual(b"abcd", bufio.read(6))
+ self.assertEqual(b"e", bufio.read(1))
+ self.assertEqual(b"fg", bufio.read())
+ self.assertEqual(b"", bufio.peek(1))
+ self.assertTrue(None is bufio.read())
+ self.assertEqual(b"", bufio.read())
- def testReadNoArgs(self):
- rawio = MockRawIO((b"abc", b"d", b"efg"))
- bufio = io.BufferedReader(rawio)
+ def test_read_past_eof(self):
+ rawio = self.MockRawIO((b"abc", b"d", b"efg"))
+ bufio = self.tp(rawio)
- self.assertEquals(b"abcdefg", bufio.read())
+ self.assertEqual(b"abcdefg", bufio.read(9000))
- def testFileno(self):
- rawio = MockRawIO((b"abc", b"d", b"efg"))
- bufio = io.BufferedReader(rawio)
+ def test_read_all(self):
+ rawio = self.MockRawIO((b"abc", b"d", b"efg"))
+ bufio = self.tp(rawio)
- self.assertEquals(42, bufio.fileno())
-
- def testFilenoNoFileno(self):
- # XXX will we always have fileno() function? If so, kill
- # this test. Else, write it.
- pass
+ self.assertEqual(b"abcdefg", bufio.read())
- def testThreads(self):
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ @support.requires_resource('cpu')
+ def test_threads(self):
try:
# Write out many bytes with exactly the same number of 0's,
# 1's... 255's. This will help us check that concurrent reading
# doesn't duplicate or forget contents.
N = 1000
- l = range(256) * N
+ l = list(range(256)) * N
random.shuffle(l)
s = bytes(bytearray(l))
- with io.open(test_support.TESTFN, "wb") as f:
+ with self.open(support.TESTFN, "wb") as f:
f.write(s)
- with io.open(test_support.TESTFN, "rb", buffering=0) as raw:
- bufio = io.BufferedReader(raw, 8)
+ with self.open(support.TESTFN, self.read_mode, buffering=0) as raw:
+ bufio = self.tp(raw, 8)
errors = []
results = []
def f():
@@ -503,82 +860,265 @@ class BufferedReaderTest(unittest.TestCase):
c = bytes(bytearray([i]))
self.assertEqual(s.count(c), N)
finally:
- test_support.unlink(test_support.TESTFN)
-
-
+ support.unlink(support.TESTFN)
+
+ def test_misbehaved_io(self):
+ rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg"))
+ bufio = self.tp(rawio)
+ self.assertRaises(IOError, bufio.seek, 0)
+ self.assertRaises(IOError, bufio.tell)
+
+ def test_no_extraneous_read(self):
+ # Issue #9550; when the raw IO object has satisfied the read request,
+ # we should not issue any additional reads, otherwise it may block
+ # (e.g. socket).
+ bufsize = 16
+ for n in (2, bufsize - 1, bufsize, bufsize + 1, bufsize * 2):
+ rawio = self.MockRawIO([b"x" * n])
+ bufio = self.tp(rawio, bufsize)
+ self.assertEqual(bufio.read(n), b"x" * n)
+ # Simple case: one raw read is enough to satisfy the request.
+ self.assertEqual(rawio._extraneous_reads, 0,
+ "failed for {}: {} != 0".format(n, rawio._extraneous_reads))
+ # A more complex case where two raw reads are needed to satisfy
+ # the request.
+ rawio = self.MockRawIO([b"x" * (n - 1), b"x"])
+ bufio = self.tp(rawio, bufsize)
+ self.assertEqual(bufio.read(n), b"x" * n)
+ self.assertEqual(rawio._extraneous_reads, 0,
+ "failed for {}: {} != 0".format(n, rawio._extraneous_reads))
+
+
+class CBufferedReaderTest(BufferedReaderTest):
+ tp = io.BufferedReader
+
+ def test_constructor(self):
+ BufferedReaderTest.test_constructor(self)
+ # The allocation can succeed on 32-bit builds, e.g. with more
+ # than 2GB RAM and a 64-bit kernel.
+ if sys.maxsize > 0x7FFFFFFF:
+ rawio = self.MockRawIO()
+ bufio = self.tp(rawio)
+ self.assertRaises((OverflowError, MemoryError, ValueError),
+ bufio.__init__, rawio, sys.maxsize)
+
+ def test_initialization(self):
+ rawio = self.MockRawIO([b"abc"])
+ bufio = self.tp(rawio)
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
+ self.assertRaises(ValueError, bufio.read)
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
+ self.assertRaises(ValueError, bufio.read)
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
+ self.assertRaises(ValueError, bufio.read)
+
+ def test_misbehaved_io_read(self):
+ rawio = self.MisbehavedRawIO((b"abc", b"d", b"efg"))
+ bufio = self.tp(rawio)
+ # _pyio.BufferedReader seems to implement reading different, so that
+ # checking this is not so easy.
+ self.assertRaises(IOError, bufio.read, 10)
+
+ def test_garbage_collection(self):
+ # C BufferedReader objects are collected.
+ # The Python version has __del__, so it ends into gc.garbage instead
+ rawio = self.FileIO(support.TESTFN, "w+b")
+ f = self.tp(rawio)
+ f.f = f
+ wr = weakref.ref(f)
+ del f
+ support.gc_collect()
+ self.assertTrue(wr() is None, wr)
-class BufferedWriterTest(unittest.TestCase):
+class PyBufferedReaderTest(BufferedReaderTest):
+ tp = pyio.BufferedReader
- def testWrite(self):
- # Write to the buffered IO but don't overflow the buffer.
- writer = MockRawIO()
- bufio = io.BufferedWriter(writer, 8)
- bufio.write(b"abc")
+class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
+ write_mode = "wb"
- self.assertFalse(writer._write_stack)
+ def test_constructor(self):
+ rawio = self.MockRawIO()
+ bufio = self.tp(rawio)
+ bufio.__init__(rawio)
+ bufio.__init__(rawio, buffer_size=1024)
+ bufio.__init__(rawio, buffer_size=16)
+ self.assertEqual(3, bufio.write(b"abc"))
+ bufio.flush()
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
+ bufio.__init__(rawio)
+ self.assertEqual(3, bufio.write(b"ghi"))
+ bufio.flush()
+ self.assertEqual(b"".join(rawio._write_stack), b"abcghi")
- def testWriteOverflow(self):
- writer = MockRawIO()
- bufio = io.BufferedWriter(writer, 8)
+ def test_detach_flush(self):
+ raw = self.MockRawIO()
+ buf = self.tp(raw)
+ buf.write(b"howdy!")
+ self.assertFalse(raw._write_stack)
+ buf.detach()
+ self.assertEqual(raw._write_stack, [b"howdy!"])
+ def test_write(self):
+ # Write to the buffered IO but don't overflow the buffer.
+ writer = self.MockRawIO()
+ bufio = self.tp(writer, 8)
bufio.write(b"abc")
- bufio.write(b"defghijkl")
-
- self.assertEquals(b"abcdefghijkl", writer._write_stack[0])
-
- def testWriteNonBlocking(self):
- raw = MockNonBlockWriterIO((9, 2, 10, -6, 10, 8, 12))
- bufio = io.BufferedWriter(raw, 8, 16)
-
- bufio.write(b"asdf")
- bufio.write(b"asdfa")
- self.assertEquals(b"asdfasdfa", raw._write_stack[0])
-
- bufio.write(b"asdfasdfasdf")
- self.assertEquals(b"asdfasdfasdf", raw._write_stack[1])
- bufio.write(b"asdfasdfasdf")
- self.assertEquals(b"dfasdfasdf", raw._write_stack[2])
- self.assertEquals(b"asdfasdfasdf", raw._write_stack[3])
-
- bufio.write(b"asdfasdfasdf")
-
- # XXX I don't like this test. It relies too heavily on how the
- # algorithm actually works, which we might change. Refactor
- # later.
-
- def testFileno(self):
- rawio = MockRawIO((b"abc", b"d", b"efg"))
- bufio = io.BufferedWriter(rawio)
-
- self.assertEquals(42, bufio.fileno())
+ self.assertFalse(writer._write_stack)
- def testFlush(self):
- writer = MockRawIO()
- bufio = io.BufferedWriter(writer, 8)
+ def test_write_overflow(self):
+ writer = self.MockRawIO()
+ bufio = self.tp(writer, 8)
+ contents = b"abcdefghijklmnop"
+ for n in range(0, len(contents), 3):
+ bufio.write(contents[n:n+3])
+ flushed = b"".join(writer._write_stack)
+ # At least (total - 8) bytes were implicitly flushed, perhaps more
+ # depending on the implementation.
+ self.assertTrue(flushed.startswith(contents[:-8]), flushed)
+
+ def check_writes(self, intermediate_func):
+ # Lots of writes, test the flushed output is as expected.
+ contents = bytes(range(256)) * 1000
+ n = 0
+ writer = self.MockRawIO()
+ bufio = self.tp(writer, 13)
+ # Generator of write sizes: repeat each N 15 times then proceed to N+1
+ def gen_sizes():
+ for size in count(1):
+ for i in range(15):
+ yield size
+ sizes = gen_sizes()
+ while n < len(contents):
+ size = min(next(sizes), len(contents) - n)
+ self.assertEqual(bufio.write(contents[n:n+size]), size)
+ intermediate_func(bufio)
+ n += size
+ bufio.flush()
+ self.assertEqual(contents,
+ b"".join(writer._write_stack))
+
+ def test_writes(self):
+ self.check_writes(lambda bufio: None)
+
+ def test_writes_and_flushes(self):
+ self.check_writes(lambda bufio: bufio.flush())
+
+ def test_writes_and_seeks(self):
+ def _seekabs(bufio):
+ pos = bufio.tell()
+ bufio.seek(pos + 1, 0)
+ bufio.seek(pos - 1, 0)
+ bufio.seek(pos, 0)
+ self.check_writes(_seekabs)
+ def _seekrel(bufio):
+ pos = bufio.seek(0, 1)
+ bufio.seek(+1, 1)
+ bufio.seek(-1, 1)
+ bufio.seek(pos, 0)
+ self.check_writes(_seekrel)
+
+ def test_writes_and_truncates(self):
+ self.check_writes(lambda bufio: bufio.truncate(bufio.tell()))
+
+ def test_write_non_blocking(self):
+ raw = self.MockNonBlockWriterIO()
+ bufio = self.tp(raw, 8)
+
+ self.assertEqual(bufio.write(b"abcd"), 4)
+ self.assertEqual(bufio.write(b"efghi"), 5)
+ # 1 byte will be written, the rest will be buffered
+ raw.block_on(b"k")
+ self.assertEqual(bufio.write(b"jklmn"), 5)
+
+ # 8 bytes will be written, 8 will be buffered and the rest will be lost
+ raw.block_on(b"0")
+ try:
+ bufio.write(b"opqrwxyz0123456789")
+ except self.BlockingIOError as e:
+ written = e.characters_written
+ else:
+ self.fail("BlockingIOError should have been raised")
+ self.assertEqual(written, 16)
+ self.assertEqual(raw.pop_written(),
+ b"abcdefghijklmnopqrwxyz")
+
+ self.assertEqual(bufio.write(b"ABCDEFGHI"), 9)
+ s = raw.pop_written()
+ # Previously buffered bytes were flushed
+ self.assertTrue(s.startswith(b"01234567A"), s)
+
+ def test_write_and_rewind(self):
+ raw = io.BytesIO()
+ bufio = self.tp(raw, 4)
+ self.assertEqual(bufio.write(b"abcdef"), 6)
+ self.assertEqual(bufio.tell(), 6)
+ bufio.seek(0, 0)
+ self.assertEqual(bufio.write(b"XY"), 2)
+ bufio.seek(6, 0)
+ self.assertEqual(raw.getvalue(), b"XYcdef")
+ self.assertEqual(bufio.write(b"123456"), 6)
+ bufio.flush()
+ self.assertEqual(raw.getvalue(), b"XYcdef123456")
+ def test_flush(self):
+ writer = self.MockRawIO()
+ bufio = self.tp(writer, 8)
bufio.write(b"abc")
bufio.flush()
+ self.assertEqual(b"abc", writer._write_stack[0])
- self.assertEquals(b"abc", writer._write_stack[0])
-
- def testThreads(self):
- # BufferedWriter should not raise exceptions or crash
- # when called from multiple threads.
+ def test_destructor(self):
+ writer = self.MockRawIO()
+ bufio = self.tp(writer, 8)
+ bufio.write(b"abc")
+ del bufio
+ support.gc_collect()
+ self.assertEqual(b"abc", writer._write_stack[0])
+
+ def test_truncate(self):
+ # Truncate implicitly flushes the buffer.
+ with self.open(support.TESTFN, self.write_mode, buffering=0) as raw:
+ bufio = self.tp(raw, 8)
+ bufio.write(b"abcdef")
+ self.assertEqual(bufio.truncate(3), 3)
+ self.assertEqual(bufio.tell(), 6)
+ with self.open(support.TESTFN, "rb", buffering=0) as f:
+ self.assertEqual(f.read(), b"abc")
+
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ @support.requires_resource('cpu')
+ def test_threads(self):
try:
+ # Write out many bytes from many threads and test they were
+ # all flushed.
+ N = 1000
+ contents = bytes(range(256)) * N
+ sizes = cycle([1, 19])
+ n = 0
+ queue = deque()
+ while n < len(contents):
+ size = next(sizes)
+ queue.append(contents[n:n+size])
+ n += size
+ del contents
# We use a real file object because it allows us to
# exercise situations where the GIL is released before
# writing the buffer to the raw streams. This is in addition
# to concurrency issues due to switching threads in the middle
# of Python code.
- with io.open(test_support.TESTFN, "wb", buffering=0) as raw:
- bufio = io.BufferedWriter(raw, 8)
+ with self.open(support.TESTFN, self.write_mode, buffering=0) as raw:
+ bufio = self.tp(raw, 8)
errors = []
def f():
try:
- # Write enough bytes to flush the buffer
- s = b"a" * 19
- for i in range(50):
+ while True:
+ try:
+ s = queue.popleft()
+ except IndexError:
+ return
bufio.write(s)
except Exception as e:
errors.append(e)
@@ -591,70 +1131,396 @@ class BufferedWriterTest(unittest.TestCase):
t.join()
self.assertFalse(errors,
"the following exceptions were caught: %r" % errors)
+ bufio.close()
+ with self.open(support.TESTFN, "rb") as f:
+ s = f.read()
+ for i in range(256):
+ self.assertEqual(s.count(bytes([i])), N)
finally:
- test_support.unlink(test_support.TESTFN)
-
- def test_flush_error_on_close(self):
- raw = MockRawIO()
- def bad_flush():
- raise IOError()
- raw.flush = bad_flush
- b = io.BufferedWriter(raw)
- self.assertRaises(IOError, b.close) # exception not swallowed
+ support.unlink(support.TESTFN)
+
+ def test_misbehaved_io(self):
+ rawio = self.MisbehavedRawIO()
+ bufio = self.tp(rawio, 5)
+ self.assertRaises(IOError, bufio.seek, 0)
+ self.assertRaises(IOError, bufio.tell)
+ self.assertRaises(IOError, bufio.write, b"abcdef")
+
+ def test_max_buffer_size_deprecation(self):
+ with support.check_warnings(("max_buffer_size is deprecated",
+ DeprecationWarning)):
+ self.tp(self.MockRawIO(), 8, 12)
+
+
+class CBufferedWriterTest(BufferedWriterTest):
+ tp = io.BufferedWriter
+
+ def test_constructor(self):
+ BufferedWriterTest.test_constructor(self)
+ # The allocation can succeed on 32-bit builds, e.g. with more
+ # than 2GB RAM and a 64-bit kernel.
+ if sys.maxsize > 0x7FFFFFFF:
+ rawio = self.MockRawIO()
+ bufio = self.tp(rawio)
+ self.assertRaises((OverflowError, MemoryError, ValueError),
+ bufio.__init__, rawio, sys.maxsize)
+
+ def test_initialization(self):
+ rawio = self.MockRawIO()
+ bufio = self.tp(rawio)
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=0)
+ self.assertRaises(ValueError, bufio.write, b"def")
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-16)
+ self.assertRaises(ValueError, bufio.write, b"def")
+ self.assertRaises(ValueError, bufio.__init__, rawio, buffer_size=-1)
+ self.assertRaises(ValueError, bufio.write, b"def")
+
+ def test_garbage_collection(self):
+ # C BufferedWriter objects are collected, and collecting them flushes
+ # all data to disk.
+ # The Python version has __del__, so it ends into gc.garbage instead
+ rawio = self.FileIO(support.TESTFN, "w+b")
+ f = self.tp(rawio)
+ f.write(b"123xxx")
+ f.x = f
+ wr = weakref.ref(f)
+ del f
+ support.gc_collect()
+ self.assertTrue(wr() is None, wr)
+ with self.open(support.TESTFN, "rb") as f:
+ self.assertEqual(f.read(), b"123xxx")
- def test_multi_close(self):
- raw = MockRawIO()
- b = io.BufferedWriter(raw)
- b.close()
- b.close()
- b.close()
- self.assertRaises(ValueError, b.flush)
+class PyBufferedWriterTest(BufferedWriterTest):
+ tp = pyio.BufferedWriter
class BufferedRWPairTest(unittest.TestCase):
- def testRWPair(self):
- r = MockRawIO(())
- w = MockRawIO()
- pair = io.BufferedRWPair(r, w)
+ def test_constructor(self):
+ pair = self.tp(self.MockRawIO(), self.MockRawIO())
self.assertFalse(pair.closed)
- # XXX More Tests
+ def test_detach(self):
+ pair = self.tp(self.MockRawIO(), self.MockRawIO())
+ self.assertRaises(self.UnsupportedOperation, pair.detach)
+ def test_constructor_max_buffer_size_deprecation(self):
+ with support.check_warnings(("max_buffer_size is deprecated",
+ DeprecationWarning)):
+ self.tp(self.MockRawIO(), self.MockRawIO(), 8, 12)
-class BufferedRandomTest(unittest.TestCase):
+ def test_constructor_with_not_readable(self):
+ class NotReadable(MockRawIO):
+ def readable(self):
+ return False
- def testReadAndWrite(self):
- raw = MockRawIO((b"asdf", b"ghjk"))
- rw = io.BufferedRandom(raw, 8, 12)
+ self.assertRaises(IOError, self.tp, NotReadable(), self.MockRawIO())
+
+ def test_constructor_with_not_writeable(self):
+ class NotWriteable(MockRawIO):
+ def writable(self):
+ return False
+
+ self.assertRaises(IOError, self.tp, self.MockRawIO(), NotWriteable())
+
+ def test_read(self):
+ pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
+
+ self.assertEqual(pair.read(3), b"abc")
+ self.assertEqual(pair.read(1), b"d")
+ self.assertEqual(pair.read(), b"ef")
+ pair = self.tp(self.BytesIO(b"abc"), self.MockRawIO())
+ self.assertEqual(pair.read(None), b"abc")
+
+ def test_readlines(self):
+ pair = lambda: self.tp(self.BytesIO(b"abc\ndef\nh"), self.MockRawIO())
+ self.assertEqual(pair().readlines(), [b"abc\n", b"def\n", b"h"])
+ self.assertEqual(pair().readlines(), [b"abc\n", b"def\n", b"h"])
+ self.assertEqual(pair().readlines(5), [b"abc\n", b"def\n"])
+
+ def test_read1(self):
+ # .read1() is delegated to the underlying reader object, so this test
+ # can be shallow.
+ pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
+
+ self.assertEqual(pair.read1(3), b"abc")
+
+ def test_readinto(self):
+ pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
+
+ data = bytearray(5)
+ self.assertEqual(pair.readinto(data), 5)
+ self.assertEqual(data, b"abcde")
+
+ def test_write(self):
+ w = self.MockRawIO()
+ pair = self.tp(self.MockRawIO(), w)
+
+ pair.write(b"abc")
+ pair.flush()
+ pair.write(b"def")
+ pair.flush()
+ self.assertEqual(w._write_stack, [b"abc", b"def"])
+
+ def test_peek(self):
+ pair = self.tp(self.BytesIO(b"abcdef"), self.MockRawIO())
+
+ self.assertTrue(pair.peek(3).startswith(b"abc"))
+ self.assertEqual(pair.read(3), b"abc")
+
+ def test_readable(self):
+ pair = self.tp(self.MockRawIO(), self.MockRawIO())
+ self.assertTrue(pair.readable())
+
+ def test_writeable(self):
+ pair = self.tp(self.MockRawIO(), self.MockRawIO())
+ self.assertTrue(pair.writable())
+
+ def test_seekable(self):
+ # BufferedRWPairs are never seekable, even if their readers and writers
+ # are.
+ pair = self.tp(self.MockRawIO(), self.MockRawIO())
+ self.assertFalse(pair.seekable())
+
+ # .flush() is delegated to the underlying writer object and has been
+ # tested in the test_write method.
+
+ def test_close_and_closed(self):
+ pair = self.tp(self.MockRawIO(), self.MockRawIO())
+ self.assertFalse(pair.closed)
+ pair.close()
+ self.assertTrue(pair.closed)
+
+ def test_isatty(self):
+ class SelectableIsAtty(MockRawIO):
+ def __init__(self, isatty):
+ MockRawIO.__init__(self)
+ self._isatty = isatty
+
+ def isatty(self):
+ return self._isatty
+
+ pair = self.tp(SelectableIsAtty(False), SelectableIsAtty(False))
+ self.assertFalse(pair.isatty())
+
+ pair = self.tp(SelectableIsAtty(True), SelectableIsAtty(False))
+ self.assertTrue(pair.isatty())
+
+ pair = self.tp(SelectableIsAtty(False), SelectableIsAtty(True))
+ self.assertTrue(pair.isatty())
+
+ pair = self.tp(SelectableIsAtty(True), SelectableIsAtty(True))
+ self.assertTrue(pair.isatty())
+
+class CBufferedRWPairTest(BufferedRWPairTest):
+ tp = io.BufferedRWPair
+
+class PyBufferedRWPairTest(BufferedRWPairTest):
+ tp = pyio.BufferedRWPair
+
+
+class BufferedRandomTest(BufferedReaderTest, BufferedWriterTest):
+ read_mode = "rb+"
+ write_mode = "wb+"
+
+ def test_constructor(self):
+ BufferedReaderTest.test_constructor(self)
+ BufferedWriterTest.test_constructor(self)
+
+ def test_read_and_write(self):
+ raw = self.MockRawIO((b"asdf", b"ghjk"))
+ rw = self.tp(raw, 8)
self.assertEqual(b"as", rw.read(2))
rw.write(b"ddd")
rw.write(b"eee")
self.assertFalse(raw._write_stack) # Buffer writes
- self.assertEqual(b"ghjk", rw.read()) # This read forces write flush
- self.assertEquals(b"dddeee", raw._write_stack[0])
+ self.assertEqual(b"ghjk", rw.read())
+ self.assertEqual(b"dddeee", raw._write_stack[0])
- def testSeekAndTell(self):
- raw = io.BytesIO(b"asdfghjkl")
- rw = io.BufferedRandom(raw)
+ def test_seek_and_tell(self):
+ raw = self.BytesIO(b"asdfghjkl")
+ rw = self.tp(raw)
- self.assertEquals(b"as", rw.read(2))
- self.assertEquals(2, rw.tell())
+ self.assertEqual(b"as", rw.read(2))
+ self.assertEqual(2, rw.tell())
rw.seek(0, 0)
- self.assertEquals(b"asdf", rw.read(4))
+ self.assertEqual(b"asdf", rw.read(4))
rw.write(b"asdf")
rw.seek(0, 0)
- self.assertEquals(b"asdfasdfl", rw.read())
- self.assertEquals(9, rw.tell())
+ self.assertEqual(b"asdfasdfl", rw.read())
+ self.assertEqual(9, rw.tell())
rw.seek(-4, 2)
- self.assertEquals(5, rw.tell())
+ self.assertEqual(5, rw.tell())
rw.seek(2, 1)
- self.assertEquals(7, rw.tell())
- self.assertEquals(b"fl", rw.read(11))
+ self.assertEqual(7, rw.tell())
+ self.assertEqual(b"fl", rw.read(11))
self.assertRaises(TypeError, rw.seek, 0.0)
+ def check_flush_and_read(self, read_func):
+ raw = self.BytesIO(b"abcdefghi")
+ bufio = self.tp(raw)
+
+ self.assertEqual(b"ab", read_func(bufio, 2))
+ bufio.write(b"12")
+ self.assertEqual(b"ef", read_func(bufio, 2))
+ self.assertEqual(6, bufio.tell())
+ bufio.flush()
+ self.assertEqual(6, bufio.tell())
+ self.assertEqual(b"ghi", read_func(bufio))
+ raw.seek(0, 0)
+ raw.write(b"XYZ")
+ # flush() resets the read buffer
+ bufio.flush()
+ bufio.seek(0, 0)
+ self.assertEqual(b"XYZ", read_func(bufio, 3))
+
+ def test_flush_and_read(self):
+ self.check_flush_and_read(lambda bufio, *args: bufio.read(*args))
+
+ def test_flush_and_readinto(self):
+ def _readinto(bufio, n=-1):
+ b = bytearray(n if n >= 0 else 9999)
+ n = bufio.readinto(b)
+ return bytes(b[:n])
+ self.check_flush_and_read(_readinto)
+
+ def test_flush_and_peek(self):
+ def _peek(bufio, n=-1):
+ # This relies on the fact that the buffer can contain the whole
+ # raw stream, otherwise peek() can return less.
+ b = bufio.peek(n)
+ if n != -1:
+ b = b[:n]
+ bufio.seek(len(b), 1)
+ return b
+ self.check_flush_and_read(_peek)
+
+ def test_flush_and_write(self):
+ raw = self.BytesIO(b"abcdefghi")
+ bufio = self.tp(raw)
+
+ bufio.write(b"123")
+ bufio.flush()
+ bufio.write(b"45")
+ bufio.flush()
+ bufio.seek(0, 0)
+ self.assertEqual(b"12345fghi", raw.getvalue())
+ self.assertEqual(b"12345fghi", bufio.read())
+
+ def test_threads(self):
+ BufferedReaderTest.test_threads(self)
+ BufferedWriterTest.test_threads(self)
+
+ def test_writes_and_peek(self):
+ def _peek(bufio):
+ bufio.peek(1)
+ self.check_writes(_peek)
+ def _peek(bufio):
+ pos = bufio.tell()
+ bufio.seek(-1, 1)
+ bufio.peek(1)
+ bufio.seek(pos, 0)
+ self.check_writes(_peek)
+
+ def test_writes_and_reads(self):
+ def _read(bufio):
+ bufio.seek(-1, 1)
+ bufio.read(1)
+ self.check_writes(_read)
+
+ def test_writes_and_read1s(self):
+ def _read1(bufio):
+ bufio.seek(-1, 1)
+ bufio.read1(1)
+ self.check_writes(_read1)
+
+ def test_writes_and_readintos(self):
+ def _read(bufio):
+ bufio.seek(-1, 1)
+ bufio.readinto(bytearray(1))
+ self.check_writes(_read)
+
+ def test_write_after_readahead(self):
+ # Issue #6629: writing after the buffer was filled by readahead should
+ # first rewind the raw stream.
+ for overwrite_size in [1, 5]:
+ raw = self.BytesIO(b"A" * 10)
+ bufio = self.tp(raw, 4)
+ # Trigger readahead
+ self.assertEqual(bufio.read(1), b"A")
+ self.assertEqual(bufio.tell(), 1)
+ # Overwriting should rewind the raw stream if it needs so
+ bufio.write(b"B" * overwrite_size)
+ self.assertEqual(bufio.tell(), overwrite_size + 1)
+ # If the write size was smaller than the buffer size, flush() and
+ # check that rewind happens.
+ bufio.flush()
+ self.assertEqual(bufio.tell(), overwrite_size + 1)
+ s = raw.getvalue()
+ self.assertEqual(s,
+ b"A" + b"B" * overwrite_size + b"A" * (9 - overwrite_size))
+
+ def test_write_rewind_write(self):
+ # Various combinations of reading / writing / seeking backwards / writing again
+ def mutate(bufio, pos1, pos2):
+ assert pos2 >= pos1
+ # Fill the buffer
+ bufio.seek(pos1)
+ bufio.read(pos2 - pos1)
+ bufio.write(b'\x02')
+ # This writes earlier than the previous write, but still inside
+ # the buffer.
+ bufio.seek(pos1)
+ bufio.write(b'\x01')
+
+ b = b"\x80\x81\x82\x83\x84"
+ for i in range(0, len(b)):
+ for j in range(i, len(b)):
+ raw = self.BytesIO(b)
+ bufio = self.tp(raw, 100)
+ mutate(bufio, i, j)
+ bufio.flush()
+ expected = bytearray(b)
+ expected[j] = 2
+ expected[i] = 1
+ self.assertEqual(raw.getvalue(), expected,
+ "failed result for i=%d, j=%d" % (i, j))
+
+ def test_truncate_after_read_or_write(self):
+ raw = self.BytesIO(b"A" * 10)
+ bufio = self.tp(raw, 100)
+ self.assertEqual(bufio.read(2), b"AA") # the read buffer gets filled
+ self.assertEqual(bufio.truncate(), 2)
+ self.assertEqual(bufio.write(b"BB"), 2) # the write buffer increases
+ self.assertEqual(bufio.truncate(), 4)
+
+ def test_misbehaved_io(self):
+ BufferedReaderTest.test_misbehaved_io(self)
+ BufferedWriterTest.test_misbehaved_io(self)
+
+class CBufferedRandomTest(CBufferedReaderTest, CBufferedWriterTest, BufferedRandomTest):
+ tp = io.BufferedRandom
+
+ def test_constructor(self):
+ BufferedRandomTest.test_constructor(self)
+ # The allocation can succeed on 32-bit builds, e.g. with more
+ # than 2GB RAM and a 64-bit kernel.
+ if sys.maxsize > 0x7FFFFFFF:
+ rawio = self.MockRawIO()
+ bufio = self.tp(rawio)
+ self.assertRaises((OverflowError, MemoryError, ValueError),
+ bufio.__init__, rawio, sys.maxsize)
+
+ def test_garbage_collection(self):
+ CBufferedReaderTest.test_garbage_collection(self)
+ CBufferedWriterTest.test_garbage_collection(self)
+
+class PyBufferedRandomTest(BufferedRandomTest):
+ tp = pyio.BufferedRandom
+
+
# To fully exercise seek/tell, the StatefulIncrementalDecoder has these
# properties:
# - A single output character can correspond to many bytes of input.
@@ -788,145 +1654,131 @@ class StatefulIncrementalDecoderTest(unittest.TestCase):
'm--------------.')
]
- def testDecoder(self):
+ def test_decoder(self):
# Try a few one-shot test cases.
for input, eof, output in self.test_cases:
d = StatefulIncrementalDecoder()
- self.assertEquals(d.decode(input, eof), output)
+ self.assertEqual(d.decode(input, eof), output)
# Also test an unfinished decode, followed by forcing EOF.
d = StatefulIncrementalDecoder()
- self.assertEquals(d.decode(b'oiabcd'), '')
- self.assertEquals(d.decode(b'', 1), 'abcd.')
-
- def test_append_bom(self):
- # The BOM is not written again when appending to a non-empty file
- filename = test_support.TESTFN
- for charset in ('utf-8-sig', 'utf-16', 'utf-32'):
- with io.open(filename, 'w', encoding=charset) as f:
- f.write('aaa')
- pos = f.tell()
- with io.open(filename, 'rb') as f:
- self.assertEquals(f.read(), 'aaa'.encode(charset))
-
- with io.open(filename, 'a', encoding=charset) as f:
- f.write('xxx')
- with io.open(filename, 'rb') as f:
- self.assertEquals(f.read(), 'aaaxxx'.encode(charset))
-
- def test_seek_bom(self):
- # Same test, but when seeking manually
- filename = test_support.TESTFN
- for charset in ('utf-8-sig', 'utf-16', 'utf-32'):
- with io.open(filename, 'w', encoding=charset) as f:
- f.write('aaa')
- pos = f.tell()
- with io.open(filename, 'r+', encoding=charset) as f:
- f.seek(pos)
- f.write('zzz')
- f.seek(0)
- f.write('bbb')
- with io.open(filename, 'rb') as f:
- self.assertEquals(f.read(), 'bbbzzz'.encode(charset))
-
+ self.assertEqual(d.decode(b'oiabcd'), '')
+ self.assertEqual(d.decode(b'', 1), 'abcd.')
class TextIOWrapperTest(unittest.TestCase):
def setUp(self):
self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n"
self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ascii")
+ support.unlink(support.TESTFN)
def tearDown(self):
- test_support.unlink(test_support.TESTFN)
-
- def testLineBuffering(self):
- r = io.BytesIO()
- b = io.BufferedWriter(r, 1000)
- t = io.TextIOWrapper(b, newline="\n", line_buffering=True)
- t.write(u"X")
- self.assertEquals(r.getvalue(), b"") # No flush happened
- t.write(u"Y\nZ")
- self.assertEquals(r.getvalue(), b"XY\nZ") # All got flushed
- t.write(u"A\rB")
- self.assertEquals(r.getvalue(), b"XY\nZA\rB")
-
- def testEncodingErrorsReading(self):
+ support.unlink(support.TESTFN)
+
+ def test_constructor(self):
+ r = self.BytesIO(b"\xc3\xa9\n\n")
+ b = self.BufferedReader(r, 1000)
+ t = self.TextIOWrapper(b)
+ t.__init__(b, encoding="latin1", newline="\r\n")
+ self.assertEqual(t.encoding, "latin1")
+ self.assertEqual(t.line_buffering, False)
+ t.__init__(b, encoding="utf8", line_buffering=True)
+ self.assertEqual(t.encoding, "utf8")
+ self.assertEqual(t.line_buffering, True)
+ self.assertEqual("\xe9\n", t.readline())
+ self.assertRaises(TypeError, t.__init__, b, newline=42)
+ self.assertRaises(ValueError, t.__init__, b, newline='xyzzy')
+
+ def test_detach(self):
+ r = self.BytesIO()
+ b = self.BufferedWriter(r)
+ t = self.TextIOWrapper(b)
+ self.assertIs(t.detach(), b)
+
+ t = self.TextIOWrapper(b, encoding="ascii")
+ t.write("howdy")
+ self.assertFalse(r.getvalue())
+ t.detach()
+ self.assertEqual(r.getvalue(), b"howdy")
+ self.assertRaises(ValueError, t.detach)
+
+ def test_repr(self):
+ raw = self.BytesIO("hello".encode("utf-8"))
+ b = self.BufferedReader(raw)
+ t = self.TextIOWrapper(b, encoding="utf-8")
+ modname = self.TextIOWrapper.__module__
+ self.assertEqual(repr(t),
+ "<%s.TextIOWrapper encoding='utf-8'>" % modname)
+ raw.name = "dummy"
+ self.assertEqual(repr(t),
+ "<%s.TextIOWrapper name=u'dummy' encoding='utf-8'>" % modname)
+ raw.name = b"dummy"
+ self.assertEqual(repr(t),
+ "<%s.TextIOWrapper name='dummy' encoding='utf-8'>" % modname)
+
+ def test_line_buffering(self):
+ r = self.BytesIO()
+ b = self.BufferedWriter(r, 1000)
+ t = self.TextIOWrapper(b, newline="\n", line_buffering=True)
+ t.write("X")
+ self.assertEqual(r.getvalue(), b"") # No flush happened
+ t.write("Y\nZ")
+ self.assertEqual(r.getvalue(), b"XY\nZ") # All got flushed
+ t.write("A\rB")
+ self.assertEqual(r.getvalue(), b"XY\nZA\rB")
+
+ def test_encoding(self):
+ # Check the encoding attribute is always set, and valid
+ b = self.BytesIO()
+ t = self.TextIOWrapper(b, encoding="utf8")
+ self.assertEqual(t.encoding, "utf8")
+ t = self.TextIOWrapper(b)
+ self.assertTrue(t.encoding is not None)
+ codecs.lookup(t.encoding)
+
+ def test_encoding_errors_reading(self):
# (1) default
- b = io.BytesIO(b"abc\n\xff\n")
- t = io.TextIOWrapper(b, encoding="ascii")
+ b = self.BytesIO(b"abc\n\xff\n")
+ t = self.TextIOWrapper(b, encoding="ascii")
self.assertRaises(UnicodeError, t.read)
# (2) explicit strict
- b = io.BytesIO(b"abc\n\xff\n")
- t = io.TextIOWrapper(b, encoding="ascii", errors="strict")
+ b = self.BytesIO(b"abc\n\xff\n")
+ t = self.TextIOWrapper(b, encoding="ascii", errors="strict")
self.assertRaises(UnicodeError, t.read)
# (3) ignore
- b = io.BytesIO(b"abc\n\xff\n")
- t = io.TextIOWrapper(b, encoding="ascii", errors="ignore")
- self.assertEquals(t.read(), "abc\n\n")
+ b = self.BytesIO(b"abc\n\xff\n")
+ t = self.TextIOWrapper(b, encoding="ascii", errors="ignore")
+ self.assertEqual(t.read(), "abc\n\n")
# (4) replace
- b = io.BytesIO(b"abc\n\xff\n")
- t = io.TextIOWrapper(b, encoding="ascii", errors="replace")
- self.assertEquals(t.read(), u"abc\n\ufffd\n")
+ b = self.BytesIO(b"abc\n\xff\n")
+ t = self.TextIOWrapper(b, encoding="ascii", errors="replace")
+ self.assertEqual(t.read(), "abc\n\ufffd\n")
- def testEncodingErrorsWriting(self):
+ def test_encoding_errors_writing(self):
# (1) default
- b = io.BytesIO()
- t = io.TextIOWrapper(b, encoding="ascii")
- self.assertRaises(UnicodeError, t.write, u"\xff")
+ b = self.BytesIO()
+ t = self.TextIOWrapper(b, encoding="ascii")
+ self.assertRaises(UnicodeError, t.write, "\xff")
# (2) explicit strict
- b = io.BytesIO()
- t = io.TextIOWrapper(b, encoding="ascii", errors="strict")
- self.assertRaises(UnicodeError, t.write, u"\xff")
+ b = self.BytesIO()
+ t = self.TextIOWrapper(b, encoding="ascii", errors="strict")
+ self.assertRaises(UnicodeError, t.write, "\xff")
# (3) ignore
- b = io.BytesIO()
- t = io.TextIOWrapper(b, encoding="ascii", errors="ignore",
+ b = self.BytesIO()
+ t = self.TextIOWrapper(b, encoding="ascii", errors="ignore",
newline="\n")
- t.write(u"abc\xffdef\n")
+ t.write("abc\xffdef\n")
t.flush()
- self.assertEquals(b.getvalue(), b"abcdef\n")
+ self.assertEqual(b.getvalue(), b"abcdef\n")
# (4) replace
- b = io.BytesIO()
- t = io.TextIOWrapper(b, encoding="ascii", errors="replace",
+ b = self.BytesIO()
+ t = self.TextIOWrapper(b, encoding="ascii", errors="replace",
newline="\n")
- t.write(u"abc\xffdef\n")
+ t.write("abc\xffdef\n")
t.flush()
- self.assertEquals(b.getvalue(), b"abc?def\n")
-
- def testNewlinesInput(self):
- testdata = b"AAA\nBBB\nCCC\rDDD\rEEE\r\nFFF\r\nGGG"
- normalized = testdata.replace(b"\r\n", b"\n").replace(b"\r", b"\n")
- for newline, expected in [
- (None, normalized.decode("ascii").splitlines(True)),
- ("", testdata.decode("ascii").splitlines(True)),
- ("\n", ["AAA\n", "BBB\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]),
- ("\r\n", ["AAA\nBBB\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]),
- ("\r", ["AAA\nBBB\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]),
- ]:
- buf = io.BytesIO(testdata)
- txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline)
- self.assertEquals(txt.readlines(), expected)
- txt.seek(0)
- self.assertEquals(txt.read(), "".join(expected))
-
- def testNewlinesOutput(self):
- testdict = {
- "": b"AAA\nBBB\nCCC\nX\rY\r\nZ",
- "\n": b"AAA\nBBB\nCCC\nX\rY\r\nZ",
- "\r": b"AAA\rBBB\rCCC\rX\rY\r\rZ",
- "\r\n": b"AAA\r\nBBB\r\nCCC\r\nX\rY\r\r\nZ",
- }
- tests = [(None, testdict[os.linesep])] + sorted(testdict.items())
- for newline, expected in tests:
- buf = io.BytesIO()
- txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline)
- txt.write("AAA\nB")
- txt.write("BB\nCCC\n")
- txt.write("X\rY\r\nZ")
- txt.flush()
- self.assertEquals(buf.closed, False)
- self.assertEquals(buf.getvalue(), expected)
+ self.assertEqual(b.getvalue(), b"abc?def\n")
- def testNewlines(self):
+ def test_newlines(self):
input_lines = [ "unix\n", "windows\r\n", "os9\r", "last\n", "nonl" ]
tests = [
@@ -950,8 +1802,8 @@ class TextIOWrapperTest(unittest.TestCase):
for do_reads in (False, True):
for bufsize in range(1, 10):
for newline, exp_lines in tests:
- bufio = io.BufferedReader(io.BytesIO(data), bufsize)
- textio = io.TextIOWrapper(bufio, newline=newline,
+ bufio = self.BufferedReader(self.BytesIO(data), bufsize)
+ textio = self.TextIOWrapper(bufio, newline=newline,
encoding=encoding)
if do_reads:
got_lines = []
@@ -959,84 +1811,128 @@ class TextIOWrapperTest(unittest.TestCase):
c2 = textio.read(2)
if c2 == '':
break
- self.assertEquals(len(c2), 2)
+ self.assertEqual(len(c2), 2)
got_lines.append(c2 + textio.readline())
else:
got_lines = list(textio)
for got_line, exp_line in zip(got_lines, exp_lines):
- self.assertEquals(got_line, exp_line)
- self.assertEquals(len(got_lines), len(exp_lines))
+ self.assertEqual(got_line, exp_line)
+ self.assertEqual(len(got_lines), len(exp_lines))
- def testNewlinesInput(self):
- testdata = b"AAA\nBBB\nCCC\rDDD\rEEE\r\nFFF\r\nGGG"
+ def test_newlines_input(self):
+ testdata = b"AAA\nBB\x00B\nCCC\rDDD\rEEE\r\nFFF\r\nGGG"
normalized = testdata.replace(b"\r\n", b"\n").replace(b"\r", b"\n")
for newline, expected in [
(None, normalized.decode("ascii").splitlines(True)),
("", testdata.decode("ascii").splitlines(True)),
- ("\n", ["AAA\n", "BBB\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]),
- ("\r\n", ["AAA\nBBB\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]),
- ("\r", ["AAA\nBBB\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]),
+ ("\n", ["AAA\n", "BB\x00B\n", "CCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]),
+ ("\r\n", ["AAA\nBB\x00B\nCCC\rDDD\rEEE\r\n", "FFF\r\n", "GGG"]),
+ ("\r", ["AAA\nBB\x00B\nCCC\r", "DDD\r", "EEE\r", "\nFFF\r", "\nGGG"]),
]:
- buf = io.BytesIO(testdata)
- txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline)
- self.assertEquals(txt.readlines(), expected)
+ buf = self.BytesIO(testdata)
+ txt = self.TextIOWrapper(buf, encoding="ascii", newline=newline)
+ self.assertEqual(txt.readlines(), expected)
txt.seek(0)
- self.assertEquals(txt.read(), "".join(expected))
-
- def testNewlinesOutput(self):
- data = u"AAA\nBBB\rCCC\n"
- data_lf = b"AAA\nBBB\rCCC\n"
- data_cr = b"AAA\rBBB\rCCC\r"
- data_crlf = b"AAA\r\nBBB\rCCC\r\n"
- save_linesep = os.linesep
- try:
- for os.linesep, newline, expected in [
- ("\n", None, data_lf),
- ("\r\n", None, data_crlf),
- ("\n", "", data_lf),
- ("\r\n", "", data_lf),
- ("\n", "\n", data_lf),
- ("\r\n", "\n", data_lf),
- ("\n", "\r", data_cr),
- ("\r\n", "\r", data_cr),
- ("\n", "\r\n", data_crlf),
- ("\r\n", "\r\n", data_crlf),
- ]:
- buf = io.BytesIO()
- txt = io.TextIOWrapper(buf, encoding="ascii", newline=newline)
- txt.write(data)
- txt.close()
- self.assertEquals(buf.closed, True)
- self.assertRaises(ValueError, buf.getvalue)
- finally:
- os.linesep = save_linesep
+ self.assertEqual(txt.read(), "".join(expected))
+
+ def test_newlines_output(self):
+ testdict = {
+ "": b"AAA\nBBB\nCCC\nX\rY\r\nZ",
+ "\n": b"AAA\nBBB\nCCC\nX\rY\r\nZ",
+ "\r": b"AAA\rBBB\rCCC\rX\rY\r\rZ",
+ "\r\n": b"AAA\r\nBBB\r\nCCC\r\nX\rY\r\r\nZ",
+ }
+ tests = [(None, testdict[os.linesep])] + sorted(testdict.items())
+ for newline, expected in tests:
+ buf = self.BytesIO()
+ txt = self.TextIOWrapper(buf, encoding="ascii", newline=newline)
+ txt.write("AAA\nB")
+ txt.write("BB\nCCC\n")
+ txt.write("X\rY\r\nZ")
+ txt.flush()
+ self.assertEqual(buf.closed, False)
+ self.assertEqual(buf.getvalue(), expected)
+
+ def test_destructor(self):
+ l = []
+ base = self.BytesIO
+ class MyBytesIO(base):
+ def close(self):
+ l.append(self.getvalue())
+ base.close(self)
+ b = MyBytesIO()
+ t = self.TextIOWrapper(b, encoding="ascii")
+ t.write("abc")
+ del t
+ support.gc_collect()
+ self.assertEqual([b"abc"], l)
+
+ def test_override_destructor(self):
+ record = []
+ class MyTextIO(self.TextIOWrapper):
+ def __del__(self):
+ record.append(1)
+ try:
+ f = super(MyTextIO, self).__del__
+ except AttributeError:
+ pass
+ else:
+ f()
+ def close(self):
+ record.append(2)
+ super(MyTextIO, self).close()
+ def flush(self):
+ record.append(3)
+ super(MyTextIO, self).flush()
+ b = self.BytesIO()
+ t = MyTextIO(b, encoding="ascii")
+ del t
+ support.gc_collect()
+ self.assertEqual(record, [1, 2, 3])
+
+ def test_error_through_destructor(self):
+ # Test that the exception state is not modified by a destructor,
+ # even if close() fails.
+ rawio = self.CloseFailureIO()
+ def f():
+ self.TextIOWrapper(rawio).xyzzy
+ with support.captured_output("stderr") as s:
+ self.assertRaises(AttributeError, f)
+ s = s.getvalue().strip()
+ if s:
+ # The destructor *may* have printed an unraisable error, check it
+ self.assertEqual(len(s.splitlines()), 1)
+ self.assertTrue(s.startswith("Exception IOError: "), s)
+ self.assertTrue(s.endswith(" ignored"), s)
# Systematic tests of the text I/O API
- def testBasicIO(self):
+ def test_basic_io(self):
for chunksize in (1, 2, 3, 4, 5, 15, 16, 17, 31, 32, 33, 63, 64, 65):
for enc in "ascii", "latin1", "utf8" :# , "utf-16-be", "utf-16-le":
- f = io.open(test_support.TESTFN, "w+", encoding=enc)
+ f = self.open(support.TESTFN, "w+", encoding=enc)
f._CHUNK_SIZE = chunksize
- self.assertEquals(f.write(u"abc"), 3)
+ self.assertEqual(f.write("abc"), 3)
f.close()
- f = io.open(test_support.TESTFN, "r+", encoding=enc)
+ f = self.open(support.TESTFN, "r+", encoding=enc)
f._CHUNK_SIZE = chunksize
- self.assertEquals(f.tell(), 0)
- self.assertEquals(f.read(), u"abc")
+ self.assertEqual(f.tell(), 0)
+ self.assertEqual(f.read(), "abc")
cookie = f.tell()
- self.assertEquals(f.seek(0), 0)
- self.assertEquals(f.read(2), u"ab")
- self.assertEquals(f.read(1), u"c")
- self.assertEquals(f.read(1), u"")
- self.assertEquals(f.read(), u"")
- self.assertEquals(f.tell(), cookie)
- self.assertEquals(f.seek(0), 0)
- self.assertEquals(f.seek(0, 2), cookie)
- self.assertEquals(f.write(u"def"), 3)
- self.assertEquals(f.seek(cookie), cookie)
- self.assertEquals(f.read(), u"def")
+ self.assertEqual(f.seek(0), 0)
+ self.assertEqual(f.read(None), "abc")
+ f.seek(0)
+ self.assertEqual(f.read(2), "ab")
+ self.assertEqual(f.read(1), "c")
+ self.assertEqual(f.read(1), "")
+ self.assertEqual(f.read(), "")
+ self.assertEqual(f.tell(), cookie)
+ self.assertEqual(f.seek(0), 0)
+ self.assertEqual(f.seek(0, 2), cookie)
+ self.assertEqual(f.write("def"), 3)
+ self.assertEqual(f.seek(cookie), cookie)
+ self.assertEqual(f.read(), "def")
if enc.startswith("utf"):
self.multi_line_test(f, enc)
f.close()
@@ -1044,13 +1940,13 @@ class TextIOWrapperTest(unittest.TestCase):
def multi_line_test(self, f, enc):
f.seek(0)
f.truncate()
- sample = u"s\xff\u0fff\uffff"
+ sample = "s\xff\u0fff\uffff"
wlines = []
for size in (0, 1, 2, 3, 4, 5, 30, 31, 32, 33, 62, 63, 64, 65, 1000):
chars = []
for i in range(size):
chars.append(sample[i % len(sample)])
- line = u"".join(chars) + u"\n"
+ line = "".join(chars) + "\n"
wlines.append((f.tell(), line))
f.write(line)
f.seek(0)
@@ -1061,79 +1957,82 @@ class TextIOWrapperTest(unittest.TestCase):
if not line:
break
rlines.append((pos, line))
- self.assertEquals(rlines, wlines)
+ self.assertEqual(rlines, wlines)
- def testTelling(self):
- f = io.open(test_support.TESTFN, "w+", encoding="utf8")
+ def test_telling(self):
+ f = self.open(support.TESTFN, "w+", encoding="utf8")
p0 = f.tell()
- f.write(u"\xff\n")
+ f.write("\xff\n")
p1 = f.tell()
- f.write(u"\xff\n")
+ f.write("\xff\n")
p2 = f.tell()
f.seek(0)
- self.assertEquals(f.tell(), p0)
- self.assertEquals(f.readline(), u"\xff\n")
- self.assertEquals(f.tell(), p1)
- self.assertEquals(f.readline(), u"\xff\n")
- self.assertEquals(f.tell(), p2)
+ self.assertEqual(f.tell(), p0)
+ self.assertEqual(f.readline(), "\xff\n")
+ self.assertEqual(f.tell(), p1)
+ self.assertEqual(f.readline(), "\xff\n")
+ self.assertEqual(f.tell(), p2)
f.seek(0)
for line in f:
- self.assertEquals(line, u"\xff\n")
+ self.assertEqual(line, "\xff\n")
self.assertRaises(IOError, f.tell)
- self.assertEquals(f.tell(), p2)
+ self.assertEqual(f.tell(), p2)
f.close()
- def testSeeking(self):
- chunk_size = io.TextIOWrapper._CHUNK_SIZE
+ def test_seeking(self):
+ chunk_size = _default_chunk_size()
prefix_size = chunk_size - 2
u_prefix = "a" * prefix_size
prefix = bytes(u_prefix.encode("utf-8"))
- self.assertEquals(len(u_prefix), len(prefix))
+ self.assertEqual(len(u_prefix), len(prefix))
u_suffix = "\u8888\n"
suffix = bytes(u_suffix.encode("utf-8"))
line = prefix + suffix
- f = io.open(test_support.TESTFN, "wb")
+ f = self.open(support.TESTFN, "wb")
f.write(line*2)
f.close()
- f = io.open(test_support.TESTFN, "r", encoding="utf-8")
+ f = self.open(support.TESTFN, "r", encoding="utf-8")
s = f.read(prefix_size)
- self.assertEquals(s, unicode(prefix, "ascii"))
- self.assertEquals(f.tell(), prefix_size)
- self.assertEquals(f.readline(), u_suffix)
+ self.assertEqual(s, prefix.decode("ascii"))
+ self.assertEqual(f.tell(), prefix_size)
+ self.assertEqual(f.readline(), u_suffix)
- def testSeekingToo(self):
+ def test_seeking_too(self):
# Regression test for a specific bug
data = b'\xe0\xbf\xbf\n'
- f = io.open(test_support.TESTFN, "wb")
+ f = self.open(support.TESTFN, "wb")
f.write(data)
f.close()
- f = io.open(test_support.TESTFN, "r", encoding="utf-8")
+ f = self.open(support.TESTFN, "r", encoding="utf-8")
f._CHUNK_SIZE # Just test that it exists
f._CHUNK_SIZE = 2
f.readline()
f.tell()
- def testSeekAndTell(self):
- """Test seek/tell using the StatefulIncrementalDecoder."""
+ def test_seek_and_tell(self):
+ #Test seek/tell using the StatefulIncrementalDecoder.
+ # Make test faster by doing smaller seeks
+ CHUNK_SIZE = 128
- def testSeekAndTellWithData(data, min_pos=0):
+ def test_seek_and_tell_with_data(data, min_pos=0):
"""Tell/seek to various points within a data stream and ensure
that the decoded data returned by read() is consistent."""
- f = io.open(test_support.TESTFN, 'wb')
+ f = self.open(support.TESTFN, 'wb')
f.write(data)
f.close()
- f = io.open(test_support.TESTFN, encoding='test_decoder')
+ f = self.open(support.TESTFN, encoding='test_decoder')
+ f._CHUNK_SIZE = CHUNK_SIZE
decoded = f.read()
f.close()
for i in range(min_pos, len(decoded) + 1): # seek positions
for j in [1, 5, len(decoded) - i]: # read lengths
- f = io.open(test_support.TESTFN, encoding='test_decoder')
- self.assertEquals(f.read(i), decoded[:i])
+ f = self.open(support.TESTFN, encoding='test_decoder')
+ self.assertEqual(f.read(i), decoded[:i])
cookie = f.tell()
- self.assertEquals(f.read(j), decoded[i:i + j])
+ self.assertEqual(f.read(j), decoded[i:i + j])
f.seek(cookie)
- self.assertEquals(f.read(), decoded[i:])
+ self.assertEqual(f.read(), decoded[i:])
f.close()
# Enable the test decoder.
@@ -1143,23 +2042,22 @@ class TextIOWrapperTest(unittest.TestCase):
try:
# Try each test case.
for input, _, _ in StatefulIncrementalDecoderTest.test_cases:
- testSeekAndTellWithData(input)
+ test_seek_and_tell_with_data(input)
# Position each test case so that it crosses a chunk boundary.
- CHUNK_SIZE = io.TextIOWrapper._CHUNK_SIZE
for input, _, _ in StatefulIncrementalDecoderTest.test_cases:
offset = CHUNK_SIZE - len(input)//2
prefix = b'.'*offset
# Don't bother seeking into the prefix (takes too long).
min_pos = offset*2
- testSeekAndTellWithData(prefix + input, min_pos)
+ test_seek_and_tell_with_data(prefix + input, min_pos)
# Ensure our test decoder won't interfere with subsequent tests.
finally:
StatefulIncrementalDecoder.codecEnabled = 0
- def testEncodedWrites(self):
- data = u"1234567890"
+ def test_encoded_writes(self):
+ data = "1234567890"
tests = ("utf-16",
"utf-16-le",
"utf-16-be",
@@ -1167,76 +2065,56 @@ class TextIOWrapperTest(unittest.TestCase):
"utf-32-le",
"utf-32-be")
for encoding in tests:
- buf = io.BytesIO()
- f = io.TextIOWrapper(buf, encoding=encoding)
+ buf = self.BytesIO()
+ f = self.TextIOWrapper(buf, encoding=encoding)
# Check if the BOM is written only once (see issue1753).
f.write(data)
f.write(data)
f.seek(0)
- self.assertEquals(f.read(), data * 2)
- self.assertEquals(buf.getvalue(), (data * 2).encode(encoding))
-
- def timingTest(self):
- timer = time.time
- enc = "utf8"
- line = "\0\x0f\xff\u0fff\uffff\U000fffff\U0010ffff"*3 + "\n"
- nlines = 10000
- nchars = len(line)
- nbytes = len(line.encode(enc))
- for chunk_size in (32, 64, 128, 256):
- f = io.open(test_support.TESTFN, "w+", encoding=enc)
- f._CHUNK_SIZE = chunk_size
- t0 = timer()
- for i in range(nlines):
- f.write(line)
- f.flush()
- t1 = timer()
+ self.assertEqual(f.read(), data * 2)
f.seek(0)
- for line in f:
- pass
- t2 = timer()
- f.seek(0)
- while f.readline():
- pass
- t3 = timer()
- f.seek(0)
- while f.readline():
- f.tell()
- t4 = timer()
- f.close()
- if test_support.verbose:
- print("\nTiming test: %d lines of %d characters (%d bytes)" %
- (nlines, nchars, nbytes))
- print("File chunk size: %6s" % f._CHUNK_SIZE)
- print("Writing: %6.3f seconds" % (t1-t0))
- print("Reading using iteration: %6.3f seconds" % (t2-t1))
- print("Reading using readline(): %6.3f seconds" % (t3-t2))
- print("Using readline()+tell(): %6.3f seconds" % (t4-t3))
-
- def testReadOneByOne(self):
- txt = io.TextIOWrapper(io.BytesIO(b"AA\r\nBB"))
+ self.assertEqual(f.read(), data * 2)
+ self.assertEqual(buf.getvalue(), (data * 2).encode(encoding))
+
+ def test_unreadable(self):
+ class UnReadable(self.BytesIO):
+ def readable(self):
+ return False
+ txt = self.TextIOWrapper(UnReadable())
+ self.assertRaises(IOError, txt.read)
+
+ def test_read_one_by_one(self):
+ txt = self.TextIOWrapper(self.BytesIO(b"AA\r\nBB"))
reads = ""
while True:
c = txt.read(1)
if not c:
break
reads += c
- self.assertEquals(reads, "AA\nBB")
+ self.assertEqual(reads, "AA\nBB")
+
+ def test_readlines(self):
+ txt = self.TextIOWrapper(self.BytesIO(b"AA\nBB\nCC"))
+ self.assertEqual(txt.readlines(), ["AA\n", "BB\n", "CC"])
+ txt.seek(0)
+ self.assertEqual(txt.readlines(None), ["AA\n", "BB\n", "CC"])
+ txt.seek(0)
+ self.assertEqual(txt.readlines(5), ["AA\n", "BB\n"])
# read in amounts equal to TextIOWrapper._CHUNK_SIZE which is 128.
- def testReadByChunk(self):
+ def test_read_by_chunk(self):
# make sure "\r\n" straddles 128 char boundary.
- txt = io.TextIOWrapper(io.BytesIO(b"A" * 127 + b"\r\nB"))
+ txt = self.TextIOWrapper(self.BytesIO(b"A" * 127 + b"\r\nB"))
reads = ""
while True:
c = txt.read(128)
if not c:
break
reads += c
- self.assertEquals(reads, "A"*127+"\nB")
+ self.assertEqual(reads, "A"*127+"\nB")
def test_issue1395_1(self):
- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii")
+ txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
# read one char at a time
reads = ""
@@ -1245,10 +2123,10 @@ class TextIOWrapperTest(unittest.TestCase):
if not c:
break
reads += c
- self.assertEquals(reads, self.normalized)
+ self.assertEqual(reads, self.normalized)
def test_issue1395_2(self):
- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii")
+ txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
txt._CHUNK_SIZE = 4
reads = ""
@@ -1257,10 +2135,10 @@ class TextIOWrapperTest(unittest.TestCase):
if not c:
break
reads += c
- self.assertEquals(reads, self.normalized)
+ self.assertEqual(reads, self.normalized)
def test_issue1395_3(self):
- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii")
+ txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
txt._CHUNK_SIZE = 4
reads = txt.read(4)
@@ -1268,40 +2146,151 @@ class TextIOWrapperTest(unittest.TestCase):
reads += txt.readline()
reads += txt.readline()
reads += txt.readline()
- self.assertEquals(reads, self.normalized)
+ self.assertEqual(reads, self.normalized)
def test_issue1395_4(self):
- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii")
+ txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
txt._CHUNK_SIZE = 4
reads = txt.read(4)
reads += txt.read()
- self.assertEquals(reads, self.normalized)
+ self.assertEqual(reads, self.normalized)
def test_issue1395_5(self):
- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii")
+ txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
txt._CHUNK_SIZE = 4
reads = txt.read(4)
pos = txt.tell()
txt.seek(0)
txt.seek(pos)
- self.assertEquals(txt.read(4), "BBB\n")
+ self.assertEqual(txt.read(4), "BBB\n")
def test_issue2282(self):
- buffer = io.BytesIO(self.testdata)
- txt = io.TextIOWrapper(buffer, encoding="ascii")
+ buffer = self.BytesIO(self.testdata)
+ txt = self.TextIOWrapper(buffer, encoding="ascii")
self.assertEqual(buffer.seekable(), txt.seekable())
- def check_newline_decoder_utf8(self, decoder):
+ def test_append_bom(self):
+ # The BOM is not written again when appending to a non-empty file
+ filename = support.TESTFN
+ for charset in ('utf-8-sig', 'utf-16', 'utf-32'):
+ with self.open(filename, 'w', encoding=charset) as f:
+ f.write('aaa')
+ pos = f.tell()
+ with self.open(filename, 'rb') as f:
+ self.assertEqual(f.read(), 'aaa'.encode(charset))
+
+ with self.open(filename, 'a', encoding=charset) as f:
+ f.write('xxx')
+ with self.open(filename, 'rb') as f:
+ self.assertEqual(f.read(), 'aaaxxx'.encode(charset))
+
+ def test_seek_bom(self):
+ # Same test, but when seeking manually
+ filename = support.TESTFN
+ for charset in ('utf-8-sig', 'utf-16', 'utf-32'):
+ with self.open(filename, 'w', encoding=charset) as f:
+ f.write('aaa')
+ pos = f.tell()
+ with self.open(filename, 'r+', encoding=charset) as f:
+ f.seek(pos)
+ f.write('zzz')
+ f.seek(0)
+ f.write('bbb')
+ with self.open(filename, 'rb') as f:
+ self.assertEqual(f.read(), 'bbbzzz'.encode(charset))
+
+ def test_errors_property(self):
+ with self.open(support.TESTFN, "w") as f:
+ self.assertEqual(f.errors, "strict")
+ with self.open(support.TESTFN, "w", errors="replace") as f:
+ self.assertEqual(f.errors, "replace")
+
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ def test_threads_write(self):
+ # Issue6750: concurrent writes could duplicate data
+ event = threading.Event()
+ with self.open(support.TESTFN, "w", buffering=1) as f:
+ def run(n):
+ text = "Thread%03d\n" % n
+ event.wait()
+ f.write(text)
+ threads = [threading.Thread(target=lambda n=x: run(n))
+ for x in range(20)]
+ for t in threads:
+ t.start()
+ time.sleep(0.02)
+ event.set()
+ for t in threads:
+ t.join()
+ with self.open(support.TESTFN) as f:
+ content = f.read()
+ for n in range(20):
+ self.assertEqual(content.count("Thread%03d\n" % n), 1)
+
+ def test_flush_error_on_close(self):
+ txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
+ def bad_flush():
+ raise IOError()
+ txt.flush = bad_flush
+ self.assertRaises(IOError, txt.close) # exception not swallowed
+
+ def test_multi_close(self):
+ txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
+ txt.close()
+ txt.close()
+ txt.close()
+ self.assertRaises(ValueError, txt.flush)
+
+ def test_readonly_attributes(self):
+ txt = self.TextIOWrapper(self.BytesIO(self.testdata), encoding="ascii")
+ buf = self.BytesIO(self.testdata)
+ with self.assertRaises((AttributeError, TypeError)):
+ txt.buffer = buf
+
+class CTextIOWrapperTest(TextIOWrapperTest):
+
+ def test_initialization(self):
+ r = self.BytesIO(b"\xc3\xa9\n\n")
+ b = self.BufferedReader(r, 1000)
+ t = self.TextIOWrapper(b)
+ self.assertRaises(TypeError, t.__init__, b, newline=42)
+ self.assertRaises(ValueError, t.read)
+ self.assertRaises(ValueError, t.__init__, b, newline='xyzzy')
+ self.assertRaises(ValueError, t.read)
+
+ def test_garbage_collection(self):
+ # C TextIOWrapper objects are collected, and collecting them flushes
+ # all data to disk.
+ # The Python version has __del__, so it ends in gc.garbage instead.
+ rawio = io.FileIO(support.TESTFN, "wb")
+ b = self.BufferedWriter(rawio)
+ t = self.TextIOWrapper(b, encoding="ascii")
+ t.write("456def")
+ t.x = t
+ wr = weakref.ref(t)
+ del t
+ support.gc_collect()
+ self.assertTrue(wr() is None, wr)
+ with self.open(support.TESTFN, "rb") as f:
+ self.assertEqual(f.read(), b"456def")
+
+class PyTextIOWrapperTest(TextIOWrapperTest):
+ pass
+
+
+class IncrementalNewlineDecoderTest(unittest.TestCase):
+
+ def check_newline_decoding_utf8(self, decoder):
# UTF-8 specific tests for a newline decoder
def _check_decode(b, s, **kwargs):
# We exercise getstate() / setstate() as well as decode()
state = decoder.getstate()
- self.assertEquals(decoder.decode(b, **kwargs), s)
+ self.assertEqual(decoder.decode(b, **kwargs), s)
decoder.setstate(state)
- self.assertEquals(decoder.decode(b, **kwargs), s)
+ self.assertEqual(decoder.decode(b, **kwargs), s)
_check_decode(b'\xe8\xa2\x88', "\u8888")
@@ -1336,54 +2325,73 @@ class TextIOWrapperTest(unittest.TestCase):
_check_decode(b'\xe8\xa2\x88\r', "\u8888")
_check_decode(b'\n', "\n")
- def check_newline_decoder(self, decoder, encoding):
+ def check_newline_decoding(self, decoder, encoding):
result = []
- encoder = codecs.getincrementalencoder(encoding)()
- def _decode_bytewise(s):
- for b in encoder.encode(s):
- result.append(decoder.decode(b))
- self.assertEquals(decoder.newlines, None)
+ if encoding is not None:
+ encoder = codecs.getincrementalencoder(encoding)()
+ def _decode_bytewise(s):
+ # Decode one byte at a time
+ for b in encoder.encode(s):
+ result.append(decoder.decode(b))
+ else:
+ encoder = None
+ def _decode_bytewise(s):
+ # Decode one char at a time
+ for c in s:
+ result.append(decoder.decode(c))
+ self.assertEqual(decoder.newlines, None)
_decode_bytewise("abc\n\r")
- self.assertEquals(decoder.newlines, '\n')
+ self.assertEqual(decoder.newlines, '\n')
_decode_bytewise("\nabc")
- self.assertEquals(decoder.newlines, ('\n', '\r\n'))
+ self.assertEqual(decoder.newlines, ('\n', '\r\n'))
_decode_bytewise("abc\r")
- self.assertEquals(decoder.newlines, ('\n', '\r\n'))
+ self.assertEqual(decoder.newlines, ('\n', '\r\n'))
_decode_bytewise("abc")
- self.assertEquals(decoder.newlines, ('\r', '\n', '\r\n'))
+ self.assertEqual(decoder.newlines, ('\r', '\n', '\r\n'))
_decode_bytewise("abc\r")
- self.assertEquals("".join(result), "abc\n\nabcabc\nabcabc")
+ self.assertEqual("".join(result), "abc\n\nabcabc\nabcabc")
decoder.reset()
- self.assertEquals(decoder.decode("abc".encode(encoding)), "abc")
- self.assertEquals(decoder.newlines, None)
+ input = "abc"
+ if encoder is not None:
+ encoder.reset()
+ input = encoder.encode(input)
+ self.assertEqual(decoder.decode(input), "abc")
+ self.assertEqual(decoder.newlines, None)
def test_newline_decoder(self):
encodings = (
- 'utf-8', 'latin-1',
+ # None meaning the IncrementalNewlineDecoder takes unicode input
+ # rather than bytes input
+ None, 'utf-8', 'latin-1',
'utf-16', 'utf-16-le', 'utf-16-be',
'utf-32', 'utf-32-le', 'utf-32-be',
)
for enc in encodings:
- decoder = codecs.getincrementaldecoder(enc)()
- decoder = io.IncrementalNewlineDecoder(decoder, translate=True)
- self.check_newline_decoder(decoder, enc)
+ decoder = enc and codecs.getincrementaldecoder(enc)()
+ decoder = self.IncrementalNewlineDecoder(decoder, translate=True)
+ self.check_newline_decoding(decoder, enc)
decoder = codecs.getincrementaldecoder("utf-8")()
- decoder = io.IncrementalNewlineDecoder(decoder, translate=True)
- self.check_newline_decoder_utf8(decoder)
+ decoder = self.IncrementalNewlineDecoder(decoder, translate=True)
+ self.check_newline_decoding_utf8(decoder)
- def test_flush_error_on_close(self):
- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii")
- def bad_flush():
- raise IOError()
- txt.flush = bad_flush
- self.assertRaises(IOError, txt.close) # exception not swallowed
+ def test_newline_bytes(self):
+ # Issue 5433: Excessive optimization in IncrementalNewlineDecoder
+ def _check(dec):
+ self.assertEqual(dec.newlines, None)
+ self.assertEqual(dec.decode("\u0D00"), "\u0D00")
+ self.assertEqual(dec.newlines, None)
+ self.assertEqual(dec.decode("\u0A00"), "\u0A00")
+ self.assertEqual(dec.newlines, None)
+ dec = self.IncrementalNewlineDecoder(None, translate=False)
+ _check(dec)
+ dec = self.IncrementalNewlineDecoder(None, translate=True)
+ _check(dec)
- def test_multi_close(self):
- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ascii")
- txt.close()
- txt.close()
- txt.close()
- self.assertRaises(ValueError, txt.flush)
+class CIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest):
+ pass
+
+class PyIncrementalNewlineDecoderTest(IncrementalNewlineDecoderTest):
+ pass
# XXX Tests for open()
@@ -1391,54 +2399,379 @@ class TextIOWrapperTest(unittest.TestCase):
class MiscIOTest(unittest.TestCase):
def tearDown(self):
- test_support.unlink(test_support.TESTFN)
+ support.unlink(support.TESTFN)
- def testImport__all__(self):
- for name in io.__all__:
- obj = getattr(io, name, None)
- self.assert_(obj is not None, name)
+ def test___all__(self):
+ for name in self.io.__all__:
+ obj = getattr(self.io, name, None)
+ self.assertTrue(obj is not None, name)
if name == "open":
continue
- elif "error" in name.lower():
- self.assert_(issubclass(obj, Exception), name)
- else:
- self.assert_(issubclass(obj, io.IOBase))
-
+ elif "error" in name.lower() or name == "UnsupportedOperation":
+ self.assertTrue(issubclass(obj, Exception), name)
+ elif not name.startswith("SEEK_"):
+ self.assertTrue(issubclass(obj, self.IOBase))
def test_attributes(self):
- f = io.open(test_support.TESTFN, "wb", buffering=0)
- self.assertEquals(f.mode, "wb")
+ f = self.open(support.TESTFN, "wb", buffering=0)
+ self.assertEqual(f.mode, "wb")
f.close()
- f = io.open(test_support.TESTFN, "U")
- self.assertEquals(f.name, test_support.TESTFN)
- self.assertEquals(f.buffer.name, test_support.TESTFN)
- self.assertEquals(f.buffer.raw.name, test_support.TESTFN)
- self.assertEquals(f.mode, "U")
- self.assertEquals(f.buffer.mode, "rb")
- self.assertEquals(f.buffer.raw.mode, "rb")
+ f = self.open(support.TESTFN, "U")
+ self.assertEqual(f.name, support.TESTFN)
+ self.assertEqual(f.buffer.name, support.TESTFN)
+ self.assertEqual(f.buffer.raw.name, support.TESTFN)
+ self.assertEqual(f.mode, "U")
+ self.assertEqual(f.buffer.mode, "rb")
+ self.assertEqual(f.buffer.raw.mode, "rb")
f.close()
- f = io.open(test_support.TESTFN, "w+")
- self.assertEquals(f.mode, "w+")
- self.assertEquals(f.buffer.mode, "rb+") # Does it really matter?
- self.assertEquals(f.buffer.raw.mode, "rb+")
+ f = self.open(support.TESTFN, "w+")
+ self.assertEqual(f.mode, "w+")
+ self.assertEqual(f.buffer.mode, "rb+") # Does it really matter?
+ self.assertEqual(f.buffer.raw.mode, "rb+")
- g = io.open(f.fileno(), "wb", closefd=False)
- self.assertEquals(g.mode, "wb")
- self.assertEquals(g.raw.mode, "wb")
- self.assertEquals(g.name, f.fileno())
- self.assertEquals(g.raw.name, f.fileno())
+ g = self.open(f.fileno(), "wb", closefd=False)
+ self.assertEqual(g.mode, "wb")
+ self.assertEqual(g.raw.mode, "wb")
+ self.assertEqual(g.name, f.fileno())
+ self.assertEqual(g.raw.name, f.fileno())
f.close()
g.close()
+ def test_io_after_close(self):
+ for kwargs in [
+ {"mode": "w"},
+ {"mode": "wb"},
+ {"mode": "w", "buffering": 1},
+ {"mode": "w", "buffering": 2},
+ {"mode": "wb", "buffering": 0},
+ {"mode": "r"},
+ {"mode": "rb"},
+ {"mode": "r", "buffering": 1},
+ {"mode": "r", "buffering": 2},
+ {"mode": "rb", "buffering": 0},
+ {"mode": "w+"},
+ {"mode": "w+b"},
+ {"mode": "w+", "buffering": 1},
+ {"mode": "w+", "buffering": 2},
+ {"mode": "w+b", "buffering": 0},
+ ]:
+ f = self.open(support.TESTFN, **kwargs)
+ f.close()
+ self.assertRaises(ValueError, f.flush)
+ self.assertRaises(ValueError, f.fileno)
+ self.assertRaises(ValueError, f.isatty)
+ self.assertRaises(ValueError, f.__iter__)
+ if hasattr(f, "peek"):
+ self.assertRaises(ValueError, f.peek, 1)
+ self.assertRaises(ValueError, f.read)
+ if hasattr(f, "read1"):
+ self.assertRaises(ValueError, f.read1, 1024)
+ if hasattr(f, "readinto"):
+ self.assertRaises(ValueError, f.readinto, bytearray(1024))
+ self.assertRaises(ValueError, f.readline)
+ self.assertRaises(ValueError, f.readlines)
+ self.assertRaises(ValueError, f.seek, 0)
+ self.assertRaises(ValueError, f.tell)
+ self.assertRaises(ValueError, f.truncate)
+ self.assertRaises(ValueError, f.write,
+ b"" if "b" in kwargs['mode'] else "")
+ self.assertRaises(ValueError, f.writelines, [])
+ self.assertRaises(ValueError, next, f)
+
+ def test_blockingioerror(self):
+ # Various BlockingIOError issues
+ self.assertRaises(TypeError, self.BlockingIOError)
+ self.assertRaises(TypeError, self.BlockingIOError, 1)
+ self.assertRaises(TypeError, self.BlockingIOError, 1, 2, 3, 4)
+ self.assertRaises(TypeError, self.BlockingIOError, 1, "", None)
+ b = self.BlockingIOError(1, "")
+ self.assertEqual(b.characters_written, 0)
+ class C(unicode):
+ pass
+ c = C("")
+ b = self.BlockingIOError(1, c)
+ c.b = b
+ b.c = c
+ wr = weakref.ref(c)
+ del c, b
+ support.gc_collect()
+ self.assertTrue(wr() is None, wr)
+
+ def test_abcs(self):
+ # Test the visible base classes are ABCs.
+ self.assertIsInstance(self.IOBase, abc.ABCMeta)
+ self.assertIsInstance(self.RawIOBase, abc.ABCMeta)
+ self.assertIsInstance(self.BufferedIOBase, abc.ABCMeta)
+ self.assertIsInstance(self.TextIOBase, abc.ABCMeta)
+
+ def _check_abc_inheritance(self, abcmodule):
+ with self.open(support.TESTFN, "wb", buffering=0) as f:
+ self.assertIsInstance(f, abcmodule.IOBase)
+ self.assertIsInstance(f, abcmodule.RawIOBase)
+ self.assertNotIsInstance(f, abcmodule.BufferedIOBase)
+ self.assertNotIsInstance(f, abcmodule.TextIOBase)
+ with self.open(support.TESTFN, "wb") as f:
+ self.assertIsInstance(f, abcmodule.IOBase)
+ self.assertNotIsInstance(f, abcmodule.RawIOBase)
+ self.assertIsInstance(f, abcmodule.BufferedIOBase)
+ self.assertNotIsInstance(f, abcmodule.TextIOBase)
+ with self.open(support.TESTFN, "w") as f:
+ self.assertIsInstance(f, abcmodule.IOBase)
+ self.assertNotIsInstance(f, abcmodule.RawIOBase)
+ self.assertNotIsInstance(f, abcmodule.BufferedIOBase)
+ self.assertIsInstance(f, abcmodule.TextIOBase)
+
+ def test_abc_inheritance(self):
+ # Test implementations inherit from their respective ABCs
+ self._check_abc_inheritance(self)
+
+ def test_abc_inheritance_official(self):
+ # Test implementations inherit from the official ABCs of the
+ # baseline "io" module.
+ self._check_abc_inheritance(io)
+
+class CMiscIOTest(MiscIOTest):
+ io = io
+
+class PyMiscIOTest(MiscIOTest):
+ io = pyio
+
+
+@unittest.skipIf(os.name == 'nt', 'POSIX signals required for this test.')
+class SignalsTest(unittest.TestCase):
+
+ def setUp(self):
+ self.oldalrm = signal.signal(signal.SIGALRM, self.alarm_interrupt)
+
+ def tearDown(self):
+ signal.signal(signal.SIGALRM, self.oldalrm)
+
+ def alarm_interrupt(self, sig, frame):
+ 1 // 0
+
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ def check_interrupted_write(self, item, bytes, **fdopen_kwargs):
+ """Check that a partial write, when it gets interrupted, properly
+ invokes the signal handler, and bubbles up the exception raised
+ in the latter."""
+ read_results = []
+ def _read():
+ s = os.read(r, 1)
+ read_results.append(s)
+ t = threading.Thread(target=_read)
+ t.daemon = True
+ r, w = os.pipe()
+ try:
+ wio = self.io.open(w, **fdopen_kwargs)
+ t.start()
+ signal.alarm(1)
+ # Fill the pipe enough that the write will be blocking.
+ # It will be interrupted by the timer armed above. Since the
+ # other thread has read one byte, the low-level write will
+ # return with a successful (partial) result rather than an EINTR.
+ # The buffered IO layer must check for pending signal
+ # handlers, which in this case will invoke alarm_interrupt().
+ self.assertRaises(ZeroDivisionError,
+ wio.write, item * (1024 * 1024))
+ t.join()
+ # We got one byte, get another one and check that it isn't a
+ # repeat of the first one.
+ read_results.append(os.read(r, 1))
+ self.assertEqual(read_results, [bytes[0:1], bytes[1:2]])
+ finally:
+ os.close(w)
+ os.close(r)
+ # This is deliberate. If we didn't close the file descriptor
+ # before closing wio, wio would try to flush its internal
+ # buffer, and block again.
+ try:
+ wio.close()
+ except IOError as e:
+ if e.errno != errno.EBADF:
+ raise
+
+ def test_interrupted_write_unbuffered(self):
+ self.check_interrupted_write(b"xy", b"xy", mode="wb", buffering=0)
+
+ def test_interrupted_write_buffered(self):
+ self.check_interrupted_write(b"xy", b"xy", mode="wb")
+
+ def test_interrupted_write_text(self):
+ self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii")
+
+ def check_reentrant_write(self, data, **fdopen_kwargs):
+ def on_alarm(*args):
+ # Will be called reentrantly from the same thread
+ wio.write(data)
+ 1/0
+ signal.signal(signal.SIGALRM, on_alarm)
+ r, w = os.pipe()
+ wio = self.io.open(w, **fdopen_kwargs)
+ try:
+ signal.alarm(1)
+ # Either the reentrant call to wio.write() fails with RuntimeError,
+ # or the signal handler raises ZeroDivisionError.
+ with self.assertRaises((ZeroDivisionError, RuntimeError)) as cm:
+ while 1:
+ for i in range(100):
+ wio.write(data)
+ wio.flush()
+ # Make sure the buffer doesn't fill up and block further writes
+ os.read(r, len(data) * 100)
+ exc = cm.exception
+ if isinstance(exc, RuntimeError):
+ self.assertTrue(str(exc).startswith("reentrant call"), str(exc))
+ finally:
+ wio.close()
+ os.close(r)
+
+ def test_reentrant_write_buffered(self):
+ self.check_reentrant_write(b"xy", mode="wb")
+
+ def test_reentrant_write_text(self):
+ self.check_reentrant_write("xy", mode="w", encoding="ascii")
+
+ def check_interrupted_read_retry(self, decode, **fdopen_kwargs):
+ """Check that a buffered read, when it gets interrupted (either
+ returning a partial result or EINTR), properly invokes the signal
+ handler and retries if the latter returned successfully."""
+ r, w = os.pipe()
+ fdopen_kwargs["closefd"] = False
+ def alarm_handler(sig, frame):
+ os.write(w, b"bar")
+ signal.signal(signal.SIGALRM, alarm_handler)
+ try:
+ rio = self.io.open(r, **fdopen_kwargs)
+ os.write(w, b"foo")
+ signal.alarm(1)
+ # Expected behaviour:
+ # - first raw read() returns partial b"foo"
+ # - second raw read() returns EINTR
+ # - third raw read() returns b"bar"
+ self.assertEqual(decode(rio.read(6)), "foobar")
+ finally:
+ rio.close()
+ os.close(w)
+ os.close(r)
+
+ def test_interrupterd_read_retry_buffered(self):
+ self.check_interrupted_read_retry(lambda x: x.decode('latin1'),
+ mode="rb")
+
+ def test_interrupterd_read_retry_text(self):
+ self.check_interrupted_read_retry(lambda x: x,
+ mode="r")
+
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ def check_interrupted_write_retry(self, item, **fdopen_kwargs):
+ """Check that a buffered write, when it gets interrupted (either
+ returning a partial result or EINTR), properly invokes the signal
+ handler and retries if the latter returned successfully."""
+ select = support.import_module("select")
+ # A quantity that exceeds the buffer size of an anonymous pipe's
+ # write end.
+ N = 1024 * 1024
+ r, w = os.pipe()
+ fdopen_kwargs["closefd"] = False
+ # We need a separate thread to read from the pipe and allow the
+ # write() to finish. This thread is started after the SIGALRM is
+ # received (forcing a first EINTR in write()).
+ read_results = []
+ write_finished = False
+ def _read():
+ while not write_finished:
+ while r in select.select([r], [], [], 1.0)[0]:
+ s = os.read(r, 1024)
+ read_results.append(s)
+ t = threading.Thread(target=_read)
+ t.daemon = True
+ def alarm1(sig, frame):
+ signal.signal(signal.SIGALRM, alarm2)
+ signal.alarm(1)
+ def alarm2(sig, frame):
+ t.start()
+ signal.signal(signal.SIGALRM, alarm1)
+ try:
+ wio = self.io.open(w, **fdopen_kwargs)
+ signal.alarm(1)
+ # Expected behaviour:
+ # - first raw write() is partial (because of the limited pipe buffer
+ # and the first alarm)
+ # - second raw write() returns EINTR (because of the second alarm)
+ # - subsequent write()s are successful (either partial or complete)
+ self.assertEqual(N, wio.write(item * N))
+ wio.flush()
+ write_finished = True
+ t.join()
+ self.assertEqual(N, sum(len(x) for x in read_results))
+ finally:
+ write_finished = True
+ os.close(w)
+ os.close(r)
+ # This is deliberate. If we didn't close the file descriptor
+ # before closing wio, wio would try to flush its internal
+ # buffer, and could block (in case of failure).
+ try:
+ wio.close()
+ except IOError as e:
+ if e.errno != errno.EBADF:
+ raise
+
+ def test_interrupterd_write_retry_buffered(self):
+ self.check_interrupted_write_retry(b"x", mode="wb")
+
+ def test_interrupterd_write_retry_text(self):
+ self.check_interrupted_write_retry("x", mode="w", encoding="latin1")
+
+
+class CSignalsTest(SignalsTest):
+ io = io
+
+class PySignalsTest(SignalsTest):
+ io = pyio
+
+ # Handling reentrancy issues would slow down _pyio even more, so the
+ # tests are disabled.
+ test_reentrant_write_buffered = None
+ test_reentrant_write_text = None
+
def test_main():
- test_support.run_unittest(IOTest, BytesIOTest, StringIOTest,
- BufferedReaderTest, BufferedWriterTest,
- BufferedRWPairTest, BufferedRandomTest,
- StatefulIncrementalDecoderTest,
- TextIOWrapperTest, MiscIOTest)
+ tests = (CIOTest, PyIOTest,
+ CBufferedReaderTest, PyBufferedReaderTest,
+ CBufferedWriterTest, PyBufferedWriterTest,
+ CBufferedRWPairTest, PyBufferedRWPairTest,
+ CBufferedRandomTest, PyBufferedRandomTest,
+ StatefulIncrementalDecoderTest,
+ CIncrementalNewlineDecoderTest, PyIncrementalNewlineDecoderTest,
+ CTextIOWrapperTest, PyTextIOWrapperTest,
+ CMiscIOTest, PyMiscIOTest,
+ CSignalsTest, PySignalsTest,
+ )
+
+ # Put the namespaces of the IO module we are testing and some useful mock
+ # classes in the __dict__ of each test.
+ mocks = (MockRawIO, MisbehavedRawIO, MockFileIO, CloseFailureIO,
+ MockNonBlockWriterIO, MockRawIOWithoutRead)
+ all_members = io.__all__ + ["IncrementalNewlineDecoder"]
+ c_io_ns = dict((name, getattr(io, name)) for name in all_members)
+ py_io_ns = dict((name, getattr(pyio, name)) for name in all_members)
+ globs = globals()
+ c_io_ns.update((x.__name__, globs["C" + x.__name__]) for x in mocks)
+ py_io_ns.update((x.__name__, globs["Py" + x.__name__]) for x in mocks)
+ # Avoid turning open into a bound method.
+ py_io_ns["open"] = pyio.OpenWrapper
+ for test in tests:
+ if test.__name__.startswith("C"):
+ for name, obj in c_io_ns.items():
+ setattr(test, name, obj)
+ elif test.__name__.startswith("Py"):
+ for name, obj in py_io_ns.items():
+ setattr(test, name, obj)
+
+ support.run_unittest(*tests)
if __name__ == "__main__":
- unittest.main()
+ test_main()
diff --git a/Lib/test/test_ioctl.py b/Lib/test/test_ioctl.py
index d46b10d5d9..ae965d8242 100644
--- a/Lib/test/test_ioctl.py
+++ b/Lib/test/test_ioctl.py
@@ -1,18 +1,24 @@
+import array
import unittest
-from test.test_support import TestSkipped, run_unittest
+from test.test_support import run_unittest, import_module, get_attribute
import os, struct
-try:
- import fcntl, termios
-except ImportError:
- raise TestSkipped("No fcntl or termios module")
-if not hasattr(termios,'TIOCGPGRP'):
- raise TestSkipped("termios module doesn't have TIOCGPGRP")
+fcntl = import_module('fcntl')
+termios = import_module('termios')
+get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature
try:
tty = open("/dev/tty", "r")
- tty.close()
except IOError:
- raise TestSkipped("Unable to open /dev/tty")
+ raise unittest.SkipTest("Unable to open /dev/tty")
+else:
+ # Skip if another process is in foreground
+ r = fcntl.ioctl(tty, termios.TIOCGPGRP, " ")
+ tty.close()
+ rpgrp = struct.unpack("i", r)[0]
+ if rpgrp not in (os.getpgrp(), os.getsid(0)):
+ raise unittest.SkipTest("Neither the process group nor the session "
+ "are attached to /dev/tty")
+ del tty, r, rpgrp
try:
import pty
@@ -27,21 +33,41 @@ class IoctlTests(unittest.TestCase):
tty = open("/dev/tty", "r")
r = fcntl.ioctl(tty, termios.TIOCGPGRP, " ")
rpgrp = struct.unpack("i", r)[0]
- self.assert_(rpgrp in ids, "%s not in %s" % (rpgrp, ids))
+ self.assertIn(rpgrp, ids)
- def test_ioctl_mutate(self):
- import array
- buf = array.array('i', [0])
+ def _check_ioctl_mutate_len(self, nbytes=None):
+ buf = array.array('i')
+ intsize = buf.itemsize
ids = (os.getpgrp(), os.getsid(0))
- tty = open("/dev/tty", "r")
- r = fcntl.ioctl(tty, termios.TIOCGPGRP, buf, 1)
+ # A fill value unlikely to be in `ids`
+ fill = -12345
+ if nbytes is not None:
+ # Extend the buffer so that it is exactly `nbytes` bytes long
+ buf.extend([fill] * (nbytes // intsize))
+ self.assertEqual(len(buf) * intsize, nbytes) # sanity check
+ else:
+ buf.append(fill)
+ with open("/dev/tty", "r") as tty:
+ r = fcntl.ioctl(tty, termios.TIOCGPGRP, buf, 1)
rpgrp = buf[0]
- self.assertEquals(r, 0)
- self.assert_(rpgrp in ids, "%s not in %s" % (rpgrp, ids))
+ self.assertEqual(r, 0)
+ self.assertIn(rpgrp, ids)
+
+ def test_ioctl_mutate(self):
+ self._check_ioctl_mutate_len()
+
+ def test_ioctl_mutate_1024(self):
+ # Issue #9758: a mutable buffer of exactly 1024 bytes wouldn't be
+ # copied back after the system call.
+ self._check_ioctl_mutate_len(1024)
+
+ def test_ioctl_mutate_2048(self):
+ # Test with a larger buffer, just for the record.
+ self._check_ioctl_mutate_len(2048)
def test_ioctl_signed_unsigned_code_param(self):
if not pty:
- raise TestSkipped('pty module required')
+ raise unittest.SkipTest('pty module required')
mfd, sfd = pty.openpty()
try:
if termios.TIOCSWINSZ < 0:
diff --git a/Lib/test/test_iter.py b/Lib/test/test_iter.py
index 6132041fcd..64984cc6e6 100644
--- a/Lib/test/test_iter.py
+++ b/Lib/test/test_iter.py
@@ -2,7 +2,7 @@
import unittest
from test.test_support import run_unittest, TESTFN, unlink, have_unicode, \
- _check_py3k_warnings
+ check_py3k_warnings, cpython_only
# Test result of triple loop (too big to inline)
TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2),
@@ -76,7 +76,7 @@ class TestCase(unittest.TestCase):
seq = range(10)
it = iter(seq)
it2 = iter(it)
- self.assert_(it is it2)
+ self.assertTrue(it is it2)
# Test that for loops over iterators work
def test_iter_for_loop(self):
@@ -121,6 +121,13 @@ class TestCase(unittest.TestCase):
def test_seq_class_iter(self):
self.check_iterator(iter(SequenceClass(10)), range(10))
+ # Test a new_style class with __iter__ but no next() method
+ def test_new_style_iter_class(self):
+ class IterClass(object):
+ def __iter__(self):
+ return self
+ self.assertRaises(TypeError, iter, IterClass())
+
# Test two-argument iter() with callable instance
def test_iter_callable(self):
class C:
@@ -401,7 +408,7 @@ class TestCase(unittest.TestCase):
for i in range(5)]
# Deprecated map(None, ...)
- with _check_py3k_warnings():
+ with check_py3k_warnings():
self.assertEqual(map(None, SequenceClass(5)), range(5))
self.assertEqual(map(None, d), d.keys())
self.assertEqual(map(None, d,
@@ -504,7 +511,7 @@ class TestCase(unittest.TestCase):
# Test reduces()'s use of iterators.
def test_deprecated_builtin_reduce(self):
- with _check_py3k_warnings():
+ with check_py3k_warnings():
self._test_builtin_reduce()
def _test_builtin_reduce(self):
@@ -567,23 +574,23 @@ class TestCase(unittest.TestCase):
def test_in_and_not_in(self):
for sc5 in IteratingSequenceClass(5), SequenceClass(5):
for i in range(5):
- self.assert_(i in sc5)
+ self.assertIn(i, sc5)
for i in "abc", -1, 5, 42.42, (3, 4), [], {1: 1}, 3-12j, sc5:
- self.assert_(i not in sc5)
+ self.assertNotIn(i, sc5)
self.assertRaises(TypeError, lambda: 3 in 12)
self.assertRaises(TypeError, lambda: 3 not in map)
d = {"one": 1, "two": 2, "three": 3, 1j: 2j}
for k in d:
- self.assert_(k in d)
- self.assert_(k not in d.itervalues())
+ self.assertIn(k, d)
+ self.assertNotIn(k, d.itervalues())
for v in d.values():
- self.assert_(v in d.itervalues())
- self.assert_(v not in d)
+ self.assertIn(v, d.itervalues())
+ self.assertNotIn(v, d)
for k, v in d.iteritems():
- self.assert_((k, v) in d.iteritems())
- self.assert_((v, k) not in d.iteritems())
+ self.assertIn((k, v), d.iteritems())
+ self.assertNotIn((v, k), d.iteritems())
f = open(TESTFN, "w")
try:
@@ -594,9 +601,9 @@ class TestCase(unittest.TestCase):
try:
for chunk in "abc":
f.seek(0, 0)
- self.assert_(chunk not in f)
+ self.assertNotIn(chunk, f)
f.seek(0, 0)
- self.assert_((chunk + "\n") in f)
+ self.assertIn((chunk + "\n"), f)
finally:
f.close()
try:
@@ -786,8 +793,9 @@ class TestCase(unittest.TestCase):
(a, b), (c,) = IteratingSequenceClass(2), {42: 24}
self.assertEqual((a, b, c), (0, 1, 42))
- # Test reference count behavior
+ @cpython_only
+ def test_ref_counting_behavior(self):
class C(object):
count = 0
def __new__(cls):
@@ -885,6 +893,21 @@ class TestCase(unittest.TestCase):
self.assertEqual(list(b), zip(range(5), range(5)))
self.assertEqual(list(b), [])
+ def test_3720(self):
+ # Avoid a crash, when an iterator deletes its next() method.
+ class BadIterator(object):
+ def __iter__(self):
+ return self
+ def next(self):
+ del BadIterator.next
+ return 1
+
+ try:
+ for i in BadIterator() :
+ pass
+ except TypeError:
+ pass
+
def test_main():
run_unittest(TestCase)
diff --git a/Lib/test/test_iterlen.py b/Lib/test/test_iterlen.py
index ab5466ecf9..88f43c7ffb 100644
--- a/Lib/test/test_iterlen.py
+++ b/Lib/test/test_iterlen.py
@@ -20,11 +20,11 @@ This is the case for tuples, xrange objects, and itertools.repeat().
Some containers become temporarily immutable during iteration. This includes
dicts, sets, and collections.deque. Their implementation is equally simple
-though they need to permantently set their length to zero whenever there is
+though they need to permanently set their length to zero whenever there is
an attempt to iterate after a length mutation.
The situation slightly more involved whenever an object allows length mutation
-during iteration. Lists and sequence iterators are dynanamically updatable.
+during iteration. Lists and sequence iterators are dynamically updatable.
So, if a list is extended during iteration, the iterator will continue through
the new items. If it shrinks to a point before the most recent iteration,
then no further items are available and the length is reported at zero.
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index de71fda5de..97feb7b789 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -2,6 +2,8 @@ import unittest
from test import test_support
from itertools import *
from weakref import proxy
+from decimal import Decimal
+from fractions import Fraction
import sys
import operator
import random
@@ -109,6 +111,14 @@ class TestBasicOps(unittest.TestCase):
if sorted(indices) == list(indices):
yield tuple(pool[i] for i in indices)
+ def combinations3(iterable, r):
+ 'Pure python version from cwr()'
+ pool = tuple(iterable)
+ n = len(pool)
+ for indices in combinations_with_replacement(range(n), r):
+ if len(set(indices)) == r:
+ yield tuple(pool[i] for i in indices)
+
for n in range(7):
values = [5*x-12 for x in range(n)]
for r in range(n+2):
@@ -120,16 +130,87 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(len(c), r) # r-length combinations
self.assertEqual(len(set(c)), r) # no duplicate elements
self.assertEqual(list(c), sorted(c)) # keep original ordering
- self.assert_(all(e in values for e in c)) # elements taken from input iterable
+ self.assertTrue(all(e in values for e in c)) # elements taken from input iterable
self.assertEqual(list(c),
[e for e in values if e in c]) # comb is a subsequence of the input iterable
self.assertEqual(result, list(combinations1(values, r))) # matches first pure python version
self.assertEqual(result, list(combinations2(values, r))) # matches second pure python version
+ self.assertEqual(result, list(combinations3(values, r))) # matches second pure python version
# Test implementation detail: tuple re-use
self.assertEqual(len(set(map(id, combinations('abcde', 3)))), 1)
self.assertNotEqual(len(set(map(id, list(combinations('abcde', 3))))), 1)
+ def test_combinations_with_replacement(self):
+ cwr = combinations_with_replacement
+ self.assertRaises(TypeError, cwr, 'abc') # missing r argument
+ self.assertRaises(TypeError, cwr, 'abc', 2, 1) # too many arguments
+ self.assertRaises(TypeError, cwr, None) # pool is not iterable
+ self.assertRaises(ValueError, cwr, 'abc', -2) # r is negative
+ self.assertEqual(list(cwr('ABC', 2)),
+ [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')])
+
+ def cwr1(iterable, r):
+ 'Pure python version shown in the docs'
+ # number items returned: (n+r-1)! / r! / (n-1)! when n>0
+ pool = tuple(iterable)
+ n = len(pool)
+ if not n and r:
+ return
+ indices = [0] * r
+ yield tuple(pool[i] for i in indices)
+ while 1:
+ for i in reversed(range(r)):
+ if indices[i] != n - 1:
+ break
+ else:
+ return
+ indices[i:] = [indices[i] + 1] * (r - i)
+ yield tuple(pool[i] for i in indices)
+
+ def cwr2(iterable, r):
+ 'Pure python version shown in the docs'
+ pool = tuple(iterable)
+ n = len(pool)
+ for indices in product(range(n), repeat=r):
+ if sorted(indices) == list(indices):
+ yield tuple(pool[i] for i in indices)
+
+ def numcombs(n, r):
+ if not n:
+ return 0 if r else 1
+ return fact(n+r-1) // fact(r) // fact(n-1)
+
+ for n in range(7):
+ values = [5*x-12 for x in range(n)]
+ for r in range(n+2):
+ result = list(cwr(values, r))
+
+ self.assertEqual(len(result), numcombs(n, r)) # right number of combs
+ self.assertEqual(len(result), len(set(result))) # no repeats
+ self.assertEqual(result, sorted(result)) # lexicographic order
+
+ regular_combs = list(combinations(values, r)) # compare to combs without replacement
+ if n == 0 or r <= 1:
+ self.assertEqual(result, regular_combs) # cases that should be identical
+ else:
+ self.assertTrue(set(result) >= set(regular_combs)) # rest should be supersets of regular combs
+
+ for c in result:
+ self.assertEqual(len(c), r) # r-length combinations
+ noruns = [k for k,v in groupby(c)] # combo without consecutive repeats
+ self.assertEqual(len(noruns), len(set(noruns))) # no repeats other than consecutive
+ self.assertEqual(list(c), sorted(c)) # keep original ordering
+ self.assertTrue(all(e in values for e in c)) # elements taken from input iterable
+ self.assertEqual(noruns,
+ [e for e in values if e in c]) # comb is a subsequence of the input iterable
+ self.assertEqual(result, list(cwr1(values, r))) # matches first pure python version
+ self.assertEqual(result, list(cwr2(values, r))) # matches second pure python version
+
+ # Test implementation detail: tuple re-use
+ self.assertEqual(len(set(map(id, cwr('abcde', 3)))), 1)
+ self.assertNotEqual(len(set(map(id, list(cwr('abcde', 3))))), 1)
+
def test_permutations(self):
self.assertRaises(TypeError, permutations) # too few arguments
self.assertRaises(TypeError, permutations, 'abc', 2, 1) # too many arguments
@@ -183,7 +264,7 @@ class TestBasicOps(unittest.TestCase):
for p in result:
self.assertEqual(len(p), r) # r-length permutations
self.assertEqual(len(set(p)), r) # no duplicate elements
- self.assert_(all(e in values for e in p)) # elements taken from input iterable
+ self.assertTrue(all(e in values for e in p)) # elements taken from input iterable
self.assertEqual(result, list(permutations1(values, r))) # matches first pure python version
self.assertEqual(result, list(permutations2(values, r))) # matches second pure python version
if r == n:
@@ -194,13 +275,62 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(len(set(map(id, permutations('abcde', 3)))), 1)
self.assertNotEqual(len(set(map(id, list(permutations('abcde', 3))))), 1)
+ def test_combinatorics(self):
+ # Test relationships between product(), permutations(),
+ # combinations() and combinations_with_replacement().
+
+ for n in range(6):
+ s = 'ABCDEFG'[:n]
+ for r in range(8):
+ prod = list(product(s, repeat=r))
+ cwr = list(combinations_with_replacement(s, r))
+ perm = list(permutations(s, r))
+ comb = list(combinations(s, r))
+
+ # Check size
+ self.assertEqual(len(prod), n**r)
+ self.assertEqual(len(cwr), (fact(n+r-1) // fact(r) // fact(n-1)) if n else (not r))
+ self.assertEqual(len(perm), 0 if r>n else fact(n) // fact(n-r))
+ self.assertEqual(len(comb), 0 if r>n else fact(n) // fact(r) // fact(n-r))
+
+ # Check lexicographic order without repeated tuples
+ self.assertEqual(prod, sorted(set(prod)))
+ self.assertEqual(cwr, sorted(set(cwr)))
+ self.assertEqual(perm, sorted(set(perm)))
+ self.assertEqual(comb, sorted(set(comb)))
+
+ # Check interrelationships
+ self.assertEqual(cwr, [t for t in prod if sorted(t)==list(t)]) # cwr: prods which are sorted
+ self.assertEqual(perm, [t for t in prod if len(set(t))==r]) # perm: prods with no dups
+ self.assertEqual(comb, [t for t in perm if sorted(t)==list(t)]) # comb: perms that are sorted
+ self.assertEqual(comb, [t for t in cwr if len(set(t))==r]) # comb: cwrs without dups
+ self.assertEqual(comb, filter(set(cwr).__contains__, perm)) # comb: perm that is a cwr
+ self.assertEqual(comb, filter(set(perm).__contains__, cwr)) # comb: cwr that is a perm
+ self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm
+
+ def test_compress(self):
+ self.assertEqual(list(compress(data='ABCDEF', selectors=[1,0,1,0,1,1])), list('ACEF'))
+ self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF'))
+ self.assertEqual(list(compress('ABCDEF', [0,0,0,0,0,0])), list(''))
+ self.assertEqual(list(compress('ABCDEF', [1,1,1,1,1,1])), list('ABCDEF'))
+ self.assertEqual(list(compress('ABCDEF', [1,0,1])), list('AC'))
+ self.assertEqual(list(compress('ABC', [0,1,1,1,1,1])), list('BC'))
+ n = 10000
+ data = chain.from_iterable(repeat(range(6), n))
+ selectors = chain.from_iterable(repeat((0, 1)))
+ self.assertEqual(list(compress(data, selectors)), [1,3,5] * n)
+ self.assertRaises(TypeError, compress, None, range(6)) # 1st arg not iterable
+ self.assertRaises(TypeError, compress, range(6), None) # 2nd arg not iterable
+ self.assertRaises(TypeError, compress, range(6)) # too few args
+ self.assertRaises(TypeError, compress, range(6), None) # too many args
+
def test_count(self):
self.assertEqual(zip('abc',count()), [('a', 0), ('b', 1), ('c', 2)])
self.assertEqual(zip('abc',count(3)), [('a', 3), ('b', 4), ('c', 5)])
self.assertEqual(take(2, zip('abc',count(3))), [('a', 3), ('b', 4)])
self.assertEqual(take(2, zip('abc',count(-1))), [('a', -1), ('b', 0)])
self.assertEqual(take(2, zip('abc',count(-3))), [('a', -3), ('b', -2)])
- self.assertRaises(TypeError, count, 2, 3)
+ self.assertRaises(TypeError, count, 2, 3, 4)
self.assertRaises(TypeError, count, 'a')
self.assertEqual(list(islice(count(maxsize-5), 10)), range(maxsize-5, maxsize+5))
self.assertEqual(list(islice(count(-maxsize-5), 10)), range(-maxsize-5, -maxsize+5))
@@ -211,6 +341,7 @@ class TestBasicOps(unittest.TestCase):
c = count(-9)
self.assertEqual(repr(c), 'count(-9)')
c.next()
+ self.assertEqual(repr(count(10.25)), 'count(10.25)')
self.assertEqual(c.next(), -8)
for i in (-sys.maxint-5, -sys.maxint+5 ,-10, -1, 0, 10, sys.maxint-5, sys.maxint+5):
# Test repr (ignoring the L in longs)
@@ -225,6 +356,48 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(next(copy.deepcopy(c)), value)
self.assertEqual(next(pickle.loads(pickle.dumps(c))), value)
+ def test_count_with_stride(self):
+ self.assertEqual(zip('abc',count(2,3)), [('a', 2), ('b', 5), ('c', 8)])
+ self.assertEqual(zip('abc',count(start=2,step=3)),
+ [('a', 2), ('b', 5), ('c', 8)])
+ self.assertEqual(zip('abc',count(step=-1)),
+ [('a', 0), ('b', -1), ('c', -2)])
+ self.assertEqual(zip('abc',count(2,0)), [('a', 2), ('b', 2), ('c', 2)])
+ self.assertEqual(zip('abc',count(2,1)), [('a', 2), ('b', 3), ('c', 4)])
+ self.assertEqual(take(20, count(maxsize-15, 3)), take(20, range(maxsize-15, maxsize+100, 3)))
+ self.assertEqual(take(20, count(-maxsize-15, 3)), take(20, range(-maxsize-15,-maxsize+100, 3)))
+ self.assertEqual(take(3, count(2, 3.25-4j)), [2, 5.25-4j, 8.5-8j])
+ self.assertEqual(take(3, count(Decimal('1.1'), Decimal('.1'))),
+ [Decimal('1.1'), Decimal('1.2'), Decimal('1.3')])
+ self.assertEqual(take(3, count(Fraction(2,3), Fraction(1,7))),
+ [Fraction(2,3), Fraction(17,21), Fraction(20,21)])
+ self.assertEqual(repr(take(3, count(10, 2.5))), repr([10, 12.5, 15.0]))
+ c = count(3, 5)
+ self.assertEqual(repr(c), 'count(3, 5)')
+ c.next()
+ self.assertEqual(repr(c), 'count(8, 5)')
+ c = count(-9, 0)
+ self.assertEqual(repr(c), 'count(-9, 0)')
+ c.next()
+ self.assertEqual(repr(c), 'count(-9, 0)')
+ c = count(-9, -3)
+ self.assertEqual(repr(c), 'count(-9, -3)')
+ c.next()
+ self.assertEqual(repr(c), 'count(-12, -3)')
+ self.assertEqual(repr(c), 'count(-12, -3)')
+ self.assertEqual(repr(count(10.5, 1.25)), 'count(10.5, 1.25)')
+ self.assertEqual(repr(count(10.5, 1)), 'count(10.5)') # suppress step=1 when it's an int
+ self.assertEqual(repr(count(10.5, 1.00)), 'count(10.5, 1.0)') # do show float values lilke 1.0
+ for i in (-sys.maxint-5, -sys.maxint+5 ,-10, -1, 0, 10, sys.maxint-5, sys.maxint+5):
+ for j in (-sys.maxint-5, -sys.maxint+5 ,-10, -1, 0, 1, 10, sys.maxint-5, sys.maxint+5):
+ # Test repr (ignoring the L in longs)
+ r1 = repr(count(i, j)).replace('L', '')
+ if j == 1:
+ r2 = ('count(%r)' % i).replace('L', '')
+ else:
+ r2 = ('count(%r, %r)' % (i, j)).replace('L', '')
+ self.assertEqual(r1, r2)
+
def test_cycle(self):
self.assertEqual(take(10, cycle('abc')), list('abcabcabca'))
self.assertEqual(list(cycle('')), [])
@@ -515,6 +688,7 @@ class TestBasicOps(unittest.TestCase):
self.assertNotEqual(len(set(map(id, list(product('abc', 'def'))))), 1)
def test_repeat(self):
+ self.assertEqual(list(repeat(object='a', times=3)), ['a', 'a', 'a'])
self.assertEqual(zip(xrange(3),repeat('a')),
[(0, 'a'), (1, 'a'), (2, 'a')])
self.assertEqual(list(repeat('a', 3)), ['a', 'a', 'a'])
@@ -604,6 +778,11 @@ class TestBasicOps(unittest.TestCase):
self.assertRaises(ValueError, islice, xrange(10), 1, 'a', 1)
self.assertEqual(len(list(islice(count(), 1, 10, maxsize))), 1)
+ # Issue #10323: Less islice in a predictable state
+ c = count()
+ self.assertEqual(list(islice(c, 1, 3, 50)), [1])
+ self.assertEqual(next(c), 3)
+
def test_takewhile(self):
data = [1, 3, 5, 20, 2, 4, 6, 8]
underten = lambda x: x<10
@@ -701,7 +880,7 @@ class TestBasicOps(unittest.TestCase):
# tee pass-through to copyable iterator
a, b = tee('abc')
c, d = tee(a)
- self.assert_(a is c)
+ self.assertTrue(a is c)
# test tee_new
t1, t2 = tee('abc')
@@ -709,7 +888,7 @@ class TestBasicOps(unittest.TestCase):
self.assertRaises(TypeError, tnew)
self.assertRaises(TypeError, tnew, 10)
t3 = tnew(t1)
- self.assert_(list(t1) == list(t2) == list(t3) == list('abc'))
+ self.assertTrue(list(t1) == list(t2) == list(t3) == list('abc'))
# test that tee objects are weak referencable
a, b = tee(xrange(10))
@@ -755,6 +934,13 @@ class TestExamples(unittest.TestCase):
self.assertEqual(list(combinations(range(4), 3)),
[(0,1,2), (0,1,3), (0,2,3), (1,2,3)])
+ def test_combinations_with_replacement(self):
+ self.assertEqual(list(combinations_with_replacement('ABC', 2)),
+ [('A','A'), ('A','B'), ('A','C'), ('B','B'), ('B','C'), ('C','C')])
+
+ def test_compress(self):
+ self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF'))
+
def test_count(self):
self.assertEqual(list(islice(count(10), 5)), [10, 11, 12, 13, 14])
@@ -835,6 +1021,19 @@ class TestGC(unittest.TestCase):
a = []
self.makecycle(combinations([1,2,a,3], 3), a)
+ def test_combinations_with_replacement(self):
+ a = []
+ self.makecycle(combinations_with_replacement([1,2,a,3], 3), a)
+
+ def test_compress(self):
+ a = []
+ self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a)
+
+ def test_count(self):
+ a = []
+ Int = type('Int', (int,), dict(x=a))
+ self.makecycle(count(Int(0), Int(1)), a)
+
def test_cycle(self):
a = []
self.makecycle(cycle([a]*2), a)
@@ -988,6 +1187,15 @@ class TestVariousIteratorArgs(unittest.TestCase):
self.assertRaises(TypeError, list, chain(N(s)))
self.assertRaises(ZeroDivisionError, list, chain(E(s)))
+ def test_compress(self):
+ for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
+ n = len(s)
+ for g in (G, I, Ig, S, L, R):
+ self.assertEqual(list(compress(g(s), repeat(1))), list(g(s)))
+ self.assertRaises(TypeError, compress, X(s), repeat(1))
+ self.assertRaises(TypeError, list, compress(N(s), repeat(1)))
+ self.assertRaises(ZeroDivisionError, list, compress(E(s), repeat(1)))
+
def test_product(self):
for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
self.assertRaises(TypeError, product, X(s))
@@ -1179,7 +1387,7 @@ class SubclassWithKwargsTest(unittest.TestCase):
def test_keywords_in_subclass(self):
# count is not subclassable...
for cls in (repeat, izip, ifilter, ifilterfalse, chain, imap,
- starmap, islice, takewhile, dropwhile, cycle):
+ starmap, islice, takewhile, dropwhile, cycle, compress):
class Subclass(cls):
def __init__(self, newarg=None, *args):
cls.__init__(self, *args)
@@ -1187,7 +1395,7 @@ class SubclassWithKwargsTest(unittest.TestCase):
Subclass(newarg=1)
except TypeError, err:
# we expect type errors because of wrong argument count
- self.failIf("does not take keyword arguments" in err.args[0])
+ self.assertNotIn("does not take keyword arguments", err.args[0])
libreftest = """ Doctest for examples in the library reference: libitertools.tex
@@ -1267,7 +1475,7 @@ Samuele
... return chain(iterable, repeat(None))
>>> def ncycles(iterable, n):
-... "Returns the seqeuence elements n times"
+... "Returns the sequence elements n times"
... return chain(*repeat(iterable, n))
>>> def dotproduct(vec1, vec2):
@@ -1314,27 +1522,6 @@ Samuele
... s = list(iterable)
... return chain.from_iterable(combinations(s, r) for r in range(len(s)+1))
->>> def compress(data, selectors):
-... "compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F"
-... return (d for d, s in izip(data, selectors) if s)
-
->>> def combinations_with_replacement(iterable, r):
-... "combinations_with_replacement('ABC', 3) --> AA AB AC BB BC CC"
-... pool = tuple(iterable)
-... n = len(pool)
-... if not n and r:
-... return
-... indices = [0] * r
-... yield tuple(pool[i] for i in indices)
-... while 1:
-... for i in reversed(range(r)):
-... if indices[i] != n - 1:
-... break
-... else:
-... return
-... indices[i:] = [indices[i] + 1] * (r - i)
-... yield tuple(pool[i] for i in indices)
-
>>> def unique_everseen(iterable, key=None):
... "List unique elements, preserving order. Remember all elements ever seen."
... # unique_everseen('AAAABBBCCDAABBB') --> A B C D
@@ -1418,30 +1605,10 @@ True
>>> list(powerset([1,2,3]))
[(), (1,), (2,), (3,), (1, 2), (1, 3), (2, 3), (1, 2, 3)]
->>> list(compress('abcdef', [1,0,1,0,1,1]))
-['a', 'c', 'e', 'f']
-
->>> list(combinations_with_replacement('abc', 2))
-[('a', 'a'), ('a', 'b'), ('a', 'c'), ('b', 'b'), ('b', 'c'), ('c', 'c')]
-
->>> list(combinations_with_replacement('01', 3))
-[('0', '0', '0'), ('0', '0', '1'), ('0', '1', '1'), ('1', '1', '1')]
-
->>> def combinations_with_replacement2(iterable, r):
-... 'Alternate version that filters from product()'
-... pool = tuple(iterable)
-... n = len(pool)
-... for indices in product(range(n), repeat=r):
-... if sorted(indices) == list(indices):
-... yield tuple(pool[i] for i in indices)
-
->>> list(combinations_with_replacement('abc', 2)) == list(combinations_with_replacement2('abc', 2))
-True
-
->>> list(combinations_with_replacement('01', 3)) == list(combinations_with_replacement2('01', 3))
+>>> all(len(list(powerset(range(n)))) == 2**n for n in range(18))
True
->>> list(combinations_with_replacement('2310', 6)) == list(combinations_with_replacement2('2310', 6))
+>>> list(powerset('abcde')) == sorted(sorted(set(powerset('abcde'))), key=len)
True
>>> list(unique_everseen('AAAABBBCCDAABBB'))
diff --git a/Lib/test/test_kqueue.py b/Lib/test/test_kqueue.py
index b887dc0d5e..e5eecfa574 100644
--- a/Lib/test/test_kqueue.py
+++ b/Lib/test/test_kqueue.py
@@ -10,15 +10,15 @@ import unittest
from test import test_support
if not hasattr(select, "kqueue"):
- raise test_support.TestSkipped("test works only on BSD")
+ raise unittest.SkipTest("test works only on BSD")
class TestKQueue(unittest.TestCase):
def test_create_queue(self):
kq = select.kqueue()
- self.assert_(kq.fileno() > 0, kq.fileno())
- self.assert_(not kq.closed)
+ self.assertTrue(kq.fileno() > 0, kq.fileno())
+ self.assertTrue(not kq.closed)
kq.close()
- self.assert_(kq.closed)
+ self.assertTrue(kq.closed)
self.assertRaises(ValueError, kq.fileno)
def test_create_event(self):
@@ -34,8 +34,8 @@ class TestKQueue(unittest.TestCase):
self.assertEqual(ev, ev)
self.assertNotEqual(ev, other)
self.assertEqual(cmp(ev, other), -1)
- self.assert_(ev < other)
- self.assert_(other >= ev)
+ self.assertTrue(ev < other)
+ self.assertTrue(other >= ev)
self.assertRaises(TypeError, cmp, ev, None)
self.assertRaises(TypeError, cmp, ev, 1)
self.assertRaises(TypeError, cmp, ev, "ev")
@@ -70,6 +70,17 @@ class TestKQueue(unittest.TestCase):
self.assertEqual(ev, ev)
self.assertNotEqual(ev, other)
+ bignum = sys.maxsize * 2 + 1
+ ev = select.kevent(bignum, 1, 2, 3, sys.maxsize, bignum)
+ self.assertEqual(ev.ident, bignum)
+ self.assertEqual(ev.filter, 1)
+ self.assertEqual(ev.flags, 2)
+ self.assertEqual(ev.fflags, 3)
+ self.assertEqual(ev.data, sys.maxsize)
+ self.assertEqual(ev.udata, bignum)
+ self.assertEqual(ev, ev)
+ self.assertNotEqual(ev, other)
+
def test_queue_event(self):
serverSocket = socket.socket()
serverSocket.bind(('127.0.0.1', 0))
@@ -79,7 +90,7 @@ class TestKQueue(unittest.TestCase):
try:
client.connect(('127.0.0.1', serverSocket.getsockname()[1]))
except socket.error, e:
- self.assertEquals(e.args[0], errno.EINPROGRESS)
+ self.assertEqual(e.args[0], errno.EINPROGRESS)
else:
#raise AssertionError("Connect should have raised EINPROGRESS")
pass # FreeBSD doesn't raise an exception here
@@ -113,7 +124,7 @@ class TestKQueue(unittest.TestCase):
events = kq.control(None, 4, 1)
events = [(e.ident, e.filter, e.flags) for e in events]
events.sort()
- self.assertEquals(events, [
+ self.assertEqual(events, [
(client.fileno(), select.KQ_FILTER_WRITE, flags),
(server.fileno(), select.KQ_FILTER_WRITE, flags)])
@@ -132,7 +143,7 @@ class TestKQueue(unittest.TestCase):
events = [(e.ident, e.filter, e.flags) for e in events]
events.sort()
- self.assertEquals(events, [
+ self.assertEqual(events, [
(client.fileno(), select.KQ_FILTER_WRITE, flags),
(client.fileno(), select.KQ_FILTER_READ, flags),
(server.fileno(), select.KQ_FILTER_WRITE, flags),
@@ -155,7 +166,7 @@ class TestKQueue(unittest.TestCase):
events = kq.control([], 4, 0.99)
events = [(e.ident, e.filter, e.flags) for e in events]
events.sort()
- self.assertEquals(events, [
+ self.assertEqual(events, [
(server.fileno(), select.KQ_FILTER_WRITE, flags)])
client.close()
@@ -172,7 +183,7 @@ class TestKQueue(unittest.TestCase):
r = kq.control([event1, event2], 1, 1)
self.assertTrue(r)
self.assertFalse(r[0].flags & select.KQ_EV_ERROR)
- self.assertEquals(b.recv(r[0].data), b'foo')
+ self.assertEqual(b.recv(r[0].data), b'foo')
a.close()
b.close()
diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py
index 1da0e7d1dc..16da8d8f17 100644
--- a/Lib/test/test_largefile.py
+++ b/Lib/test/test_largefile.py
@@ -1,12 +1,16 @@
"""Test largefile support on system where this makes sense.
"""
+from __future__ import print_function
+
import os
import stat
import sys
import unittest
from test.test_support import run_unittest, TESTFN, verbose, requires, \
- TestSkipped, unlink
+ unlink
+import io # C implementation of io
+import _pyio as pyio # Python implementation of io
try:
import signal
@@ -18,10 +22,10 @@ except (ImportError, AttributeError):
pass
# create >2GB file (2GB = 2147483648 bytes)
-size = 2500000000L
+size = 2500000000
-class TestCase(unittest.TestCase):
+class LargeFileTest(unittest.TestCase):
"""Test that each file function works as expected for a large
(i.e. > 2GB, do we have to check > 4GB) files.
@@ -33,28 +37,28 @@ class TestCase(unittest.TestCase):
def test_seek(self):
if verbose:
- print 'create large file via seek (may be sparse file) ...'
- with open(TESTFN, 'wb') as f:
- f.write('z')
+ print('create large file via seek (may be sparse file) ...')
+ with self.open(TESTFN, 'wb') as f:
+ f.write(b'z')
f.seek(0)
f.seek(size)
- f.write('a')
+ f.write(b'a')
f.flush()
if verbose:
- print 'check file size with os.fstat'
+ print('check file size with os.fstat')
self.assertEqual(os.fstat(f.fileno())[stat.ST_SIZE], size+1)
def test_osstat(self):
if verbose:
- print 'check file size with os.stat'
+ print('check file size with os.stat')
self.assertEqual(os.stat(TESTFN)[stat.ST_SIZE], size+1)
def test_seek_read(self):
if verbose:
- print 'play around with seek() and read() with the built largefile'
- with open(TESTFN, 'rb') as f:
+ print('play around with seek() and read() with the built largefile')
+ with self.open(TESTFN, 'rb') as f:
self.assertEqual(f.tell(), 0)
- self.assertEqual(f.read(1), 'z')
+ self.assertEqual(f.read(1), b'z')
self.assertEqual(f.tell(), 1)
f.seek(0)
self.assertEqual(f.tell(), 0)
@@ -77,15 +81,15 @@ class TestCase(unittest.TestCase):
f.seek(size)
self.assertEqual(f.tell(), size)
# the 'a' that was written at the end of file above
- self.assertEqual(f.read(1), 'a')
+ self.assertEqual(f.read(1), b'a')
f.seek(-size-1, 1)
- self.assertEqual(f.read(1), 'z')
+ self.assertEqual(f.read(1), b'z')
self.assertEqual(f.tell(), 1)
def test_lseek(self):
if verbose:
- print 'play around with os.lseek() with the built largefile'
- with open(TESTFN, 'rb') as f:
+ print('play around with os.lseek() with the built largefile')
+ with self.open(TESTFN, 'rb') as f:
self.assertEqual(os.lseek(f.fileno(), 0, 0), 0)
self.assertEqual(os.lseek(f.fileno(), 42, 0), 42)
self.assertEqual(os.lseek(f.fileno(), 42, 1), 84)
@@ -95,16 +99,16 @@ class TestCase(unittest.TestCase):
self.assertEqual(os.lseek(f.fileno(), -size-1, 2), 0)
self.assertEqual(os.lseek(f.fileno(), size, 0), size)
# the 'a' that was written at the end of file above
- self.assertEqual(f.read(1), 'a')
+ self.assertEqual(f.read(1), b'a')
def test_truncate(self):
if verbose:
- print 'try truncate'
- with open(TESTFN, 'r+b') as f:
+ print('try truncate')
+ with self.open(TESTFN, 'r+b') as f:
# this is already decided before start running the test suite
# but we do it anyway for extra protection
if not hasattr(f, 'truncate'):
- raise TestSkipped, "open().truncate() not available on this system"
+ raise unittest.SkipTest("open().truncate() not available on this system")
f.seek(0, 2)
# else we've lost track of the true size
self.assertEqual(f.tell(), size+1)
@@ -120,17 +124,29 @@ class TestCase(unittest.TestCase):
newsize -= 1
f.seek(42)
f.truncate(newsize)
- self.assertEqual(f.tell(), 42) # else pointer moved
+ if self.new_io:
+ self.assertEqual(f.tell(), 42)
f.seek(0, 2)
- self.assertEqual(f.tell(), newsize) # else wasn't truncated
-
+ self.assertEqual(f.tell(), newsize)
# XXX truncate(larger than true size) is ill-defined
# across platform; cut it waaaaay back
f.seek(0)
f.truncate(1)
- self.assertEqual(f.tell(), 0) # else pointer moved
+ if self.new_io:
+ self.assertEqual(f.tell(), 0) # else pointer moved
+ f.seek(0)
self.assertEqual(len(f.read()), 1) # else wasn't truncated
+ def test_seekable(self):
+ # Issue #5016; seekable() can return False when the current position
+ # is negative when truncated to an int.
+ if not self.new_io:
+ self.skipTest("builtin file doesn't have seekable()")
+ for pos in (2**31-1, 2**31, 2**31+1):
+ with self.open(TESTFN, 'rb') as f:
+ f.seek(pos)
+ self.assertTrue(f.seekable())
+
def test_main():
# On Windows and Mac OSX this test comsumes large resources; It
@@ -144,34 +160,41 @@ def test_main():
# Only run if the current filesystem supports large files.
# (Skip this test on Windows, since we now always support
# large files.)
- f = open(TESTFN, 'wb')
+ f = open(TESTFN, 'wb', buffering=0)
try:
# 2**31 == 2147483648
- f.seek(2147483649L)
+ f.seek(2147483649)
# Seeking is not enough of a test: you must write and
# flush, too!
- f.write("x")
+ f.write(b'x')
f.flush()
except (IOError, OverflowError):
f.close()
unlink(TESTFN)
- raise TestSkipped, "filesystem does not have largefile support"
+ raise unittest.SkipTest("filesystem does not have largefile support")
else:
f.close()
suite = unittest.TestSuite()
- suite.addTest(TestCase('test_seek'))
- suite.addTest(TestCase('test_osstat'))
- suite.addTest(TestCase('test_seek_read'))
- suite.addTest(TestCase('test_lseek'))
- with open(TESTFN, 'w') as f:
- if hasattr(f, 'truncate'):
- suite.addTest(TestCase('test_truncate'))
- unlink(TESTFN)
+ for _open, prefix in [(io.open, 'C'), (pyio.open, 'Py'),
+ (open, 'Builtin')]:
+ class TestCase(LargeFileTest):
+ pass
+ TestCase.open = staticmethod(_open)
+ TestCase.new_io = _open is not open
+ TestCase.__name__ = prefix + LargeFileTest.__name__
+ suite.addTest(TestCase('test_seek'))
+ suite.addTest(TestCase('test_osstat'))
+ suite.addTest(TestCase('test_seek_read'))
+ suite.addTest(TestCase('test_lseek'))
+ with _open(TESTFN, 'wb') as f:
+ if hasattr(f, 'truncate'):
+ suite.addTest(TestCase('test_truncate'))
+ suite.addTest(TestCase('test_seekable'))
+ unlink(TESTFN)
try:
run_unittest(suite)
finally:
unlink(TESTFN)
-
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py
index e332062994..109a26cb67 100644
--- a/Lib/test/test_lib2to3.py
+++ b/Lib/test/test_lib2to3.py
@@ -1,13 +1,15 @@
# Skipping test_parser and test_all_fixers
# because of running
-from lib2to3.tests import test_fixers, test_pytree, test_util, test_refactor
+from lib2to3.tests import (test_fixers, test_pytree, test_util, test_refactor,
+ test_parser, test_main as test_main_)
import unittest
from test.test_support import run_unittest
def suite():
tests = unittest.TestSuite()
loader = unittest.TestLoader()
- for m in (test_fixers,test_pytree,test_util, test_refactor):
+ for m in (test_fixers, test_pytree,test_util, test_refactor, test_parser,
+ test_main_):
tests.addTests(loader.loadTestsFromModule(m))
return tests
diff --git a/Lib/test/test_linecache.py b/Lib/test/test_linecache.py
index 945d7689cf..b5f80a4f43 100644
--- a/Lib/test/test_linecache.py
+++ b/Lib/test/test_linecache.py
@@ -9,10 +9,10 @@ from test import test_support as support
FILENAME = linecache.__file__
INVALID_NAME = '!@$)(!@#_1'
EMPTY = ''
-TESTS = 'cjkencodings_test inspect_fodder inspect_fodder2 mapping_tests'
+TESTS = 'inspect_fodder inspect_fodder2 mapping_tests'
TESTS = TESTS.split()
TEST_PATH = os.path.dirname(support.__file__)
-MODULES = "linecache unittest".split()
+MODULES = "linecache abc".split()
MODULE_PATH = os.path.dirname(FILENAME)
SOURCE_1 = '''
@@ -42,40 +42,38 @@ class LineCacheTests(unittest.TestCase):
getline = linecache.getline
# Bad values for line number should return an empty string
- self.assertEquals(getline(FILENAME, 2**15), EMPTY)
- self.assertEquals(getline(FILENAME, -1), EMPTY)
+ self.assertEqual(getline(FILENAME, 2**15), EMPTY)
+ self.assertEqual(getline(FILENAME, -1), EMPTY)
# Float values currently raise TypeError, should it?
self.assertRaises(TypeError, getline, FILENAME, 1.1)
# Bad filenames should return an empty string
- self.assertEquals(getline(EMPTY, 1), EMPTY)
- self.assertEquals(getline(INVALID_NAME, 1), EMPTY)
+ self.assertEqual(getline(EMPTY, 1), EMPTY)
+ self.assertEqual(getline(INVALID_NAME, 1), EMPTY)
# Check whether lines correspond to those from file iteration
for entry in TESTS:
filename = os.path.join(TEST_PATH, entry) + '.py'
for index, line in enumerate(open(filename)):
- self.assertEquals(line, getline(filename, index + 1))
+ self.assertEqual(line, getline(filename, index + 1))
# Check module loading
for entry in MODULES:
filename = os.path.join(MODULE_PATH, entry) + '.py'
for index, line in enumerate(open(filename)):
- self.assertEquals(line, getline(filename, index + 1))
+ self.assertEqual(line, getline(filename, index + 1))
# Check that bogus data isn't returned (issue #1309567)
empty = linecache.getlines('a/b/c/__init__.py')
- self.assertEquals(empty, [])
+ self.assertEqual(empty, [])
def test_no_ending_newline(self):
- try:
- with open(support.TESTFN, "w") as fp:
- fp.write(SOURCE_3)
- lines = linecache.getlines(support.TESTFN)
- self.assertEqual(lines, ["\n", "def f():\n", " return 3\n"])
- finally:
- support.unlink(support.TESTFN)
+ self.addCleanup(support.unlink, support.TESTFN)
+ with open(support.TESTFN, "w") as fp:
+ fp.write(SOURCE_3)
+ lines = linecache.getlines(support.TESTFN)
+ self.assertEqual(lines, ["\n", "def f():\n", " return 3\n"])
def test_clearcache(self):
cached = []
@@ -86,51 +84,45 @@ class LineCacheTests(unittest.TestCase):
# Are all files cached?
cached_empty = [fn for fn in cached if fn not in linecache.cache]
- self.assertEquals(cached_empty, [])
+ self.assertEqual(cached_empty, [])
# Can we clear the cache?
linecache.clearcache()
cached_empty = [fn for fn in cached if fn in linecache.cache]
- self.assertEquals(cached_empty, [])
+ self.assertEqual(cached_empty, [])
def test_checkcache(self):
getline = linecache.getline
- try:
- # Create a source file and cache its contents
- source_name = support.TESTFN + '.py'
- with open(source_name, 'w') as source:
- source.write(SOURCE_1)
- source.close()
- getline(source_name, 1)
-
- # Keep a copy of the old contents
- source_list = []
- source = open(source_name)
- for index, line in enumerate(source):
- self.assertEquals(line, getline(source_name, index + 1))
- source_list.append(line)
- source.close()
-
- source = open(source_name, 'w')
- source.write(SOURCE_2)
- source.close()
-
- # Try to update a bogus cache entry
- linecache.checkcache('dummy')
-
- # Check that the cache matches the old contents
- for index, line in enumerate(source_list):
- self.assertEquals(line, getline(source_name, index + 1))
-
- # Update the cache and check whether it matches the new source file
- linecache.checkcache(source_name)
- source = open(source_name)
- for index, line in enumerate(source):
- self.assertEquals(line, getline(source_name, index + 1))
- source_list.append(line)
-
- finally:
- support.unlink(source_name)
+ # Create a source file and cache its contents
+ source_name = support.TESTFN + '.py'
+ self.addCleanup(support.unlink, source_name)
+ with open(source_name, 'w') as source:
+ source.write(SOURCE_1)
+ getline(source_name, 1)
+
+ # Keep a copy of the old contents
+ source_list = []
+ with open(source_name) as source:
+ for index, line in enumerate(source):
+ self.assertEqual(line, getline(source_name, index + 1))
+ source_list.append(line)
+
+ with open(source_name, 'w') as source:
+ source.write(SOURCE_2)
+
+ # Try to update a bogus cache entry
+ linecache.checkcache('dummy')
+
+ # Check that the cache matches the old contents
+ for index, line in enumerate(source_list):
+ self.assertEqual(line, getline(source_name, index + 1))
+
+ # Update the cache and check whether it matches the new source file
+ linecache.checkcache(source_name)
+ with open(source_name) as source:
+ for index, line in enumerate(source):
+ self.assertEqual(line, getline(source_name, index + 1))
+ source_list.append(line)
def test_main():
support.run_unittest(LineCacheTests)
diff --git a/Lib/test/test_linuxaudiodev.py b/Lib/test/test_linuxaudiodev.py
index e406be6943..fef46b4550 100644
--- a/Lib/test/test_linuxaudiodev.py
+++ b/Lib/test/test_linuxaudiodev.py
@@ -1,7 +1,7 @@
from test import test_support
test_support.requires('audio')
-from test.test_support import findfile, TestSkipped, run_unittest
+from test.test_support import findfile, run_unittest
import errno
import sys
@@ -61,36 +61,36 @@ class LinuxAudioDevTests(unittest.TestCase):
try:
self.dev.setparameters(-1, size, nchannels, fmt)
except ValueError, err:
- self.assertEquals(err.args[0], "expected rate >= 0, not -1")
+ self.assertEqual(err.args[0], "expected rate >= 0, not -1")
try:
self.dev.setparameters(rate, -2, nchannels, fmt)
except ValueError, err:
- self.assertEquals(err.args[0], "expected sample size >= 0, not -2")
+ self.assertEqual(err.args[0], "expected sample size >= 0, not -2")
try:
self.dev.setparameters(rate, size, 3, fmt)
except ValueError, err:
- self.assertEquals(err.args[0], "nchannels must be 1 or 2, not 3")
+ self.assertEqual(err.args[0], "nchannels must be 1 or 2, not 3")
try:
self.dev.setparameters(rate, size, nchannels, 177)
except ValueError, err:
- self.assertEquals(err.args[0], "unknown audio encoding: 177")
+ self.assertEqual(err.args[0], "unknown audio encoding: 177")
try:
self.dev.setparameters(rate, size, nchannels, linuxaudiodev.AFMT_U16_LE)
except ValueError, err:
- self.assertEquals(err.args[0], "for linear unsigned 16-bit little-endian "
- "audio, expected sample size 16, not 8")
+ self.assertEqual(err.args[0], "for linear unsigned 16-bit little-endian "
+ "audio, expected sample size 16, not 8")
try:
self.dev.setparameters(rate, 16, nchannels, fmt)
except ValueError, err:
- self.assertEquals(err.args[0], "for linear unsigned 8-bit audio, expected "
- "sample size 8, not 16")
+ self.assertEqual(err.args[0], "for linear unsigned 8-bit audio, expected "
+ "sample size 8, not 16")
def test_main():
try:
dsp = linuxaudiodev.open('w')
except linuxaudiodev.error, msg:
if msg.args[0] in (errno.EACCES, errno.ENOENT, errno.ENODEV, errno.EBUSY):
- raise TestSkipped(msg)
+ raise unittest.SkipTest(msg)
raise
dsp.close()
run_unittest(LinuxAudioDevTests)
diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py
index 167293a168..6e080dc342 100644
--- a/Lib/test/test_list.py
+++ b/Lib/test/test_list.py
@@ -9,7 +9,7 @@ class ListTest(list_tests.CommonTest):
l0_3 = [0, 1, 2, 3]
l0_3_bis = list(l0_3)
self.assertEqual(l0_3, l0_3_bis)
- self.assert_(l0_3 is not l0_3_bis)
+ self.assertTrue(l0_3 is not l0_3_bis)
self.assertEqual(list(()), [])
self.assertEqual(list((0, 1, 2, 3)), [0, 1, 2, 3])
self.assertEqual(list(''), [])
@@ -39,11 +39,11 @@ class ListTest(list_tests.CommonTest):
def test_truth(self):
super(ListTest, self).test_truth()
- self.assert_(not [])
- self.assert_([42])
+ self.assertTrue(not [])
+ self.assertTrue([42])
def test_identity(self):
- self.assert_([] is not [])
+ self.assertTrue([] is not [])
def test_len(self):
super(ListTest, self).test_len()
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
index 3f611be1df..8bb99cb540 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -1,4 +1,4 @@
-from test.test_support import run_unittest, verbose, TestSkipped
+from test.test_support import run_unittest, verbose
import unittest
import locale
import sys
@@ -16,7 +16,7 @@ def get_enUS_locale():
# The locale test work fine on OSX 10.6, I (ronaldoussoren)
# haven't had time yet to verify if tests work on OSX 10.5
# (10.4 is known to be bad)
- raise TestSkipped("Locale support on MacOSX is minimal")
+ raise unittest.SkipTest("Locale support on MacOSX is minimal")
if sys.platform.startswith("win"):
tlocs = ("En", "English")
else:
@@ -29,7 +29,7 @@ def get_enUS_locale():
continue
break
else:
- raise TestSkipped(
+ raise unittest.SkipTest(
"Test locale not supported (tried %s)" % (', '.join(tlocs)))
enUS_locale = tloc
locale.setlocale(locale.LC_NUMERIC, oldlocale)
@@ -227,6 +227,38 @@ class EnUSNumberFormatting(BaseFormattingTest):
(self.sep, self.sep))
+class TestFormatPatternArg(unittest.TestCase):
+ # Test handling of pattern argument of format
+
+ def test_onlyOnePattern(self):
+ # Issue 2522: accept exactly one % pattern, and no extra chars.
+ self.assertRaises(ValueError, locale.format, "%f\n", 'foo')
+ self.assertRaises(ValueError, locale.format, "%f\r", 'foo')
+ self.assertRaises(ValueError, locale.format, "%f\r\n", 'foo')
+ self.assertRaises(ValueError, locale.format, " %f", 'foo')
+ self.assertRaises(ValueError, locale.format, "%fg", 'foo')
+ self.assertRaises(ValueError, locale.format, "%^g", 'foo')
+ self.assertRaises(ValueError, locale.format, "%f%%", 'foo')
+
+
+class TestLocaleFormatString(unittest.TestCase):
+ """General tests on locale.format_string"""
+
+ def test_percent_escape(self):
+ self.assertEqual(locale.format_string('%f%%', 1.0), '%f%%' % 1.0)
+ self.assertEqual(locale.format_string('%d %f%%d', (1, 1.0)),
+ '%d %f%%d' % (1, 1.0))
+ self.assertEqual(locale.format_string('%(foo)s %%d', {'foo': 'bar'}),
+ ('%(foo)s %%d' % {'foo': 'bar'}))
+
+ def test_mapping(self):
+ self.assertEqual(locale.format_string('%(foo)s bing.', {'foo': 'bar'}),
+ ('%(foo)s bing.' % {'foo': 'bar'}))
+ self.assertEqual(locale.format_string('%(foo)s', {'foo': 'bar'}),
+ ('%(foo)s' % {'foo': 'bar'}))
+
+
+
class TestNumberFormatting(BaseLocalizedTest, EnUSNumberFormatting):
# Test number formatting with a real English locale.
@@ -353,18 +385,31 @@ class TestMiscellaneous(unittest.TestCase):
# test crasher from bug #3303
self.assertRaises(TypeError, locale.strcoll, u"a", None)
+ def test_setlocale_category(self):
+ locale.setlocale(locale.LC_ALL)
+ locale.setlocale(locale.LC_TIME)
+ locale.setlocale(locale.LC_CTYPE)
+ locale.setlocale(locale.LC_COLLATE)
+ locale.setlocale(locale.LC_MONETARY)
+ locale.setlocale(locale.LC_NUMERIC)
+
+ # crasher from bug #7419
+ self.assertRaises(locale.Error, locale.setlocale, 12345)
+
def test_main():
tests = [
TestMiscellaneous,
+ TestFormatPatternArg,
+ TestLocaleFormatString,
TestEnUSNumberFormatting,
TestCNumberFormatting,
TestFrFRNumberFormatting,
]
- # TestSkipped can't be raised inside unittests, handle it manually instead
+ # SkipTest can't be raised inside unittests, handle it manually instead
try:
get_enUS_locale()
- except TestSkipped as e:
+ except unittest.SkipTest as e:
if verbose:
print "Some tests will be disabled: %s" % e
else:
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 27eeb27469..0760a6a07b 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -26,27 +26,27 @@ import logging.handlers
import logging.config
import codecs
-import copy
import cPickle
import cStringIO
import gc
+import json
import os
import re
import select
import socket
from SocketServer import ThreadingTCPServer, StreamRequestHandler
-import string
import struct
import sys
import tempfile
from test.test_support import captured_stdout, run_with_locale, run_unittest
import textwrap
-import threading
-import time
-import types
import unittest
+import warnings
import weakref
-
+try:
+ import threading
+except ImportError:
+ threading = None
class BaseTest(unittest.TestCase):
@@ -71,7 +71,7 @@ class BaseTest(unittest.TestCase):
# Set two unused loggers: one non-ASCII and one Unicode.
# This is to test correct operation when sorting existing
- # loggers in the configuration code. See issues 8201, 9310.
+ # loggers in the configuration code. See issue 8201.
logging.getLogger("\xab\xd7\xbb")
logging.getLogger(u"\u013f\u00d6\u0047")
@@ -90,6 +90,10 @@ class BaseTest(unittest.TestCase):
level."""
self.stream.close()
self.root_logger.removeHandler(self.root_hdlr)
+ while self.root_logger.handlers:
+ h = self.root_logger.handlers[0]
+ self.root_logger.removeHandler(h)
+ h.close()
self.root_logger.setLevel(self.original_logging_level)
logging._acquireLock()
try:
@@ -116,13 +120,13 @@ class BaseTest(unittest.TestCase):
except AttributeError:
# StringIO.StringIO lacks a reset() method.
actual_lines = stream.getvalue().splitlines()
- self.assertEquals(len(actual_lines), len(expected_values))
+ self.assertEqual(len(actual_lines), len(expected_values))
for actual, expected in zip(actual_lines, expected_values):
match = pat.search(actual)
if not match:
self.fail("Log line does not match expected pattern:\n" +
actual)
- self.assertEquals(tuple(match.groups()), expected)
+ self.assertEqual(tuple(match.groups()), expected)
s = stream.read()
if s:
self.fail("Remaining output at end of log stream:\n" + s)
@@ -558,6 +562,38 @@ class ConfigFileTest(BaseTest):
datefmt=
"""
+ # config1a moves the handler to the root.
+ config1a = """
+ [loggers]
+ keys=root,parser
+
+ [handlers]
+ keys=hand1
+
+ [formatters]
+ keys=form1
+
+ [logger_root]
+ level=WARNING
+ handlers=hand1
+
+ [logger_parser]
+ level=DEBUG
+ handlers=
+ propagate=1
+ qualname=compiler.parser
+
+ [handler_hand1]
+ class=StreamHandler
+ level=NOTSET
+ formatter=form1
+ args=(sys.stdout,)
+
+ [formatter_form1]
+ format=%(levelname)s ++ %(message)s
+ datefmt=
+ """
+
# config2 has a subtle configuration error that should be reported
config2 = config1.replace("sys.stdout", "sys.stbout")
@@ -636,15 +672,47 @@ class ConfigFileTest(BaseTest):
datefmt=
"""
+ # config7 adds a compiler logger.
+ config7 = """
+ [loggers]
+ keys=root,parser,compiler
+
+ [handlers]
+ keys=hand1
+
+ [formatters]
+ keys=form1
+
+ [logger_root]
+ level=WARNING
+ handlers=hand1
+
+ [logger_compiler]
+ level=DEBUG
+ handlers=
+ propagate=1
+ qualname=compiler
+
+ [logger_parser]
+ level=DEBUG
+ handlers=
+ propagate=1
+ qualname=compiler.parser
+
+ [handler_hand1]
+ class=StreamHandler
+ level=NOTSET
+ formatter=form1
+ args=(sys.stdout,)
+
+ [formatter_form1]
+ format=%(levelname)s ++ %(message)s
+ datefmt=
+ """
+
def apply_config(self, conf):
- try:
- fn = tempfile.mktemp(".ini")
- f = open(fn, "w")
- f.write(textwrap.dedent(conf))
- f.close()
- logging.config.fileConfig(fn)
- finally:
- os.remove(fn)
+ file = cStringIO.StringIO(textwrap.dedent(conf))
+ logging.config.fileConfig(file)
def test_config0_ok(self):
# A simple config file which overrides the default settings.
@@ -694,7 +762,7 @@ class ConfigFileTest(BaseTest):
except RuntimeError:
logging.exception("just testing")
sys.stdout.seek(0)
- self.assertEquals(output.getvalue(),
+ self.assertEqual(output.getvalue(),
"ERROR:root:just testing\nGot a [RuntimeError]\n")
# Original logger output is empty
self.assert_log_lines([])
@@ -705,6 +773,49 @@ class ConfigFileTest(BaseTest):
def test_config6_ok(self):
self.test_config1_ok(config=self.config6)
+ def test_config7_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config1a)
+ logger = logging.getLogger("compiler.parser")
+ # See issue #11424. compiler-hyphenated sorts
+ # between compiler and compiler.xyz and this
+ # was preventing compiler.xyz from being included
+ # in the child loggers of compiler because of an
+ # overzealous loop termination condition.
+ hyphenated = logging.getLogger('compiler-hyphenated')
+ # All will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ hyphenated.critical(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ('CRITICAL', '3'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+ with captured_stdout() as output:
+ self.apply_config(self.config7)
+ logger = logging.getLogger("compiler.parser")
+ self.assertFalse(logger.disabled)
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ logger = logging.getLogger("compiler.lexer")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ # Will not appear
+ hyphenated.critical(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '4'),
+ ('ERROR', '5'),
+ ('INFO', '6'),
+ ('ERROR', '7'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
class LogRecordStreamHandler(StreamRequestHandler):
"""Handler for a streaming logging request. It saves the log message in the
@@ -768,6 +879,7 @@ class LogRecordSocketReceiver(ThreadingTCPServer):
self.server_close()
+@unittest.skipUnless(threading, 'Threading required for this test.')
class SocketHandlerTest(BaseTest):
"""Test for SocketHandler objects."""
@@ -812,7 +924,7 @@ class SocketHandlerTest(BaseTest):
logger = logging.getLogger("tcp")
logger.error("spam")
logger.debug("eggs")
- self.assertEquals(self.get_output(), "spam\neggs\n")
+ self.assertEqual(self.get_output(), "spam\neggs\n")
class MemoryTest(BaseTest):
@@ -831,7 +943,7 @@ class MemoryTest(BaseTest):
key = id(obj), repr(obj)
self._survivors[key] = weakref.ref(obj)
- def _assert_survival(self):
+ def _assertTruesurvival(self):
"""Assert that all objects watched for survival have survived."""
# Trigger cycle breaking.
gc.collect()
@@ -857,7 +969,7 @@ class MemoryTest(BaseTest):
])
del foo
# foo has survived.
- self._assert_survival()
+ self._assertTruesurvival()
# foo has retained its settings.
bar = logging.getLogger("foo")
bar.debug(self.next_message())
@@ -886,7 +998,7 @@ class EncodingTest(BaseTest):
# check we wrote exactly those bytes, ignoring trailing \n etc
f = open(fn)
try:
- self.failUnlessEqual(f.read().rstrip(), data)
+ self.assertEqual(f.read().rstrip(), data)
finally:
f.close()
finally:
@@ -915,15 +1027,860 @@ class EncodingTest(BaseTest):
self.assertEqual(s, '\xe4\xee \xf1\xe2\xe8\xe4\xe0\xed\xe8\xff\n')
+class WarningsTest(BaseTest):
+
+ def test_warnings(self):
+ with warnings.catch_warnings():
+ logging.captureWarnings(True)
+ try:
+ warnings.filterwarnings("always", category=UserWarning)
+ file = cStringIO.StringIO()
+ h = logging.StreamHandler(file)
+ logger = logging.getLogger("py.warnings")
+ logger.addHandler(h)
+ warnings.warn("I'm warning you...")
+ logger.removeHandler(h)
+ s = file.getvalue()
+ h.close()
+ self.assertTrue(s.find("UserWarning: I'm warning you...\n") > 0)
+
+ #See if an explicit file uses the original implementation
+ file = cStringIO.StringIO()
+ warnings.showwarning("Explicit", UserWarning, "dummy.py", 42,
+ file, "Dummy line")
+ s = file.getvalue()
+ file.close()
+ self.assertEqual(s,
+ "dummy.py:42: UserWarning: Explicit\n Dummy line\n")
+ finally:
+ logging.captureWarnings(False)
+
+
+def formatFunc(format, datefmt=None):
+ return logging.Formatter(format, datefmt)
+
+def handlerFunc():
+ return logging.StreamHandler()
+
+class CustomHandler(logging.StreamHandler):
+ pass
+
+class ConfigDictTest(BaseTest):
+
+ """Reading logging config from a dictionary."""
+
+ expected_log_pat = r"^([\w]+) \+\+ ([\w]+)$"
+
+ # config0 is a standard configuration.
+ config0 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ 'handlers' : ['hand1'],
+ },
+ }
+
+ # config1 adds a little to the standard configuration.
+ config1 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ # config2 has a subtle configuration error that should be reported
+ config2 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdbout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ #As config1 but with a misspelt level on a handler
+ config2a = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NTOSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+
+ #As config1 but with a misspelt level on a logger
+ config2b = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WRANING',
+ },
+ }
+
+ # config3 has a less subtle configuration error
+ config3 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'misspelled_name',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ # config4 specifies a custom formatter class to be loaded
+ config4 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ '()' : __name__ + '.ExceptionFormatter',
+ 'format' : '%(levelname)s:%(name)s:%(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'root' : {
+ 'level' : 'NOTSET',
+ 'handlers' : ['hand1'],
+ },
+ }
+
+ # As config4 but using an actual callable rather than a string
+ config4a = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ '()' : ExceptionFormatter,
+ 'format' : '%(levelname)s:%(name)s:%(message)s',
+ },
+ 'form2' : {
+ '()' : __name__ + '.formatFunc',
+ 'format' : '%(levelname)s:%(name)s:%(message)s',
+ },
+ 'form3' : {
+ '()' : formatFunc,
+ 'format' : '%(levelname)s:%(name)s:%(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ 'hand2' : {
+ '()' : handlerFunc,
+ },
+ },
+ 'root' : {
+ 'level' : 'NOTSET',
+ 'handlers' : ['hand1'],
+ },
+ }
+
+ # config5 specifies a custom handler class to be loaded
+ config5 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : __name__ + '.CustomHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ # config6 specifies a custom handler class to be loaded
+ # but has bad arguments
+ config6 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : __name__ + '.CustomHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ '9' : 'invalid parameter name',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ #config 7 does not define compiler.parser but defines compiler.lexer
+ #so compiler.parser should be disabled after applying it
+ config7 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.lexer' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ config8 = {
+ 'version': 1,
+ 'disable_existing_loggers' : False,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ 'compiler.lexer' : {
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ config9 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'WARNING',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'WARNING',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'NOTSET',
+ },
+ }
+
+ config9a = {
+ 'version': 1,
+ 'incremental' : True,
+ 'handlers' : {
+ 'hand1' : {
+ 'level' : 'WARNING',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'INFO',
+ },
+ },
+ }
+
+ config9b = {
+ 'version': 1,
+ 'incremental' : True,
+ 'handlers' : {
+ 'hand1' : {
+ 'level' : 'INFO',
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'INFO',
+ },
+ },
+ }
+
+ #As config1 but with a filter added
+ config10 = {
+ 'version': 1,
+ 'formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'filters' : {
+ 'filt1' : {
+ 'name' : 'compiler.parser',
+ },
+ },
+ 'handlers' : {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ 'filters' : ['filt1'],
+ },
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'filters' : ['filt1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ 'handlers' : ['hand1'],
+ },
+ }
+
+ #As config1 but using cfg:// references
+ config11 = {
+ 'version': 1,
+ 'true_formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handler_configs': {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'formatters' : 'cfg://true_formatters',
+ 'handlers' : {
+ 'hand1' : 'cfg://handler_configs[hand1]',
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ #As config11 but missing the version key
+ config12 = {
+ 'true_formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handler_configs': {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'formatters' : 'cfg://true_formatters',
+ 'handlers' : {
+ 'hand1' : 'cfg://handler_configs[hand1]',
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ #As config11 but using an unsupported version
+ config13 = {
+ 'version': 2,
+ 'true_formatters': {
+ 'form1' : {
+ 'format' : '%(levelname)s ++ %(message)s',
+ },
+ },
+ 'handler_configs': {
+ 'hand1' : {
+ 'class' : 'logging.StreamHandler',
+ 'formatter' : 'form1',
+ 'level' : 'NOTSET',
+ 'stream' : 'ext://sys.stdout',
+ },
+ },
+ 'formatters' : 'cfg://true_formatters',
+ 'handlers' : {
+ 'hand1' : 'cfg://handler_configs[hand1]',
+ },
+ 'loggers' : {
+ 'compiler.parser' : {
+ 'level' : 'DEBUG',
+ 'handlers' : ['hand1'],
+ },
+ },
+ 'root' : {
+ 'level' : 'WARNING',
+ },
+ }
+
+ def apply_config(self, conf):
+ logging.config.dictConfig(conf)
+
+ def test_config0_ok(self):
+ # A simple config which overrides the default settings.
+ with captured_stdout() as output:
+ self.apply_config(self.config0)
+ logger = logging.getLogger()
+ # Won't output anything
+ logger.info(self.next_message())
+ # Outputs a message
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+ def test_config1_ok(self, config=config1):
+ # A config defining a sub-parser as well.
+ with captured_stdout() as output:
+ self.apply_config(config)
+ logger = logging.getLogger("compiler.parser")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+ def test_config2_failure(self):
+ # A simple config which overrides the default settings.
+ self.assertRaises(StandardError, self.apply_config, self.config2)
+
+ def test_config2a_failure(self):
+ # A simple config which overrides the default settings.
+ self.assertRaises(StandardError, self.apply_config, self.config2a)
+
+ def test_config2b_failure(self):
+ # A simple config which overrides the default settings.
+ self.assertRaises(StandardError, self.apply_config, self.config2b)
+
+ def test_config3_failure(self):
+ # A simple config which overrides the default settings.
+ self.assertRaises(StandardError, self.apply_config, self.config3)
+
+ def test_config4_ok(self):
+ # A config specifying a custom formatter class.
+ with captured_stdout() as output:
+ self.apply_config(self.config4)
+ #logger = logging.getLogger()
+ try:
+ raise RuntimeError()
+ except RuntimeError:
+ logging.exception("just testing")
+ sys.stdout.seek(0)
+ self.assertEqual(output.getvalue(),
+ "ERROR:root:just testing\nGot a [RuntimeError]\n")
+ # Original logger output is empty
+ self.assert_log_lines([])
+
+ def test_config4a_ok(self):
+ # A config specifying a custom formatter class.
+ with captured_stdout() as output:
+ self.apply_config(self.config4a)
+ #logger = logging.getLogger()
+ try:
+ raise RuntimeError()
+ except RuntimeError:
+ logging.exception("just testing")
+ sys.stdout.seek(0)
+ self.assertEqual(output.getvalue(),
+ "ERROR:root:just testing\nGot a [RuntimeError]\n")
+ # Original logger output is empty
+ self.assert_log_lines([])
+
+ def test_config5_ok(self):
+ self.test_config1_ok(config=self.config5)
+
+ def test_config6_failure(self):
+ self.assertRaises(StandardError, self.apply_config, self.config6)
+
+ def test_config7_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config1)
+ logger = logging.getLogger("compiler.parser")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+ with captured_stdout() as output:
+ self.apply_config(self.config7)
+ logger = logging.getLogger("compiler.parser")
+ self.assertTrue(logger.disabled)
+ logger = logging.getLogger("compiler.lexer")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '3'),
+ ('ERROR', '4'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+ #Same as test_config_7_ok but don't disable old loggers.
+ def test_config_8_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config1)
+ logger = logging.getLogger("compiler.parser")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+ with captured_stdout() as output:
+ self.apply_config(self.config8)
+ logger = logging.getLogger("compiler.parser")
+ self.assertFalse(logger.disabled)
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ logger = logging.getLogger("compiler.lexer")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '3'),
+ ('ERROR', '4'),
+ ('INFO', '5'),
+ ('ERROR', '6'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+ def test_config_9_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config9)
+ logger = logging.getLogger("compiler.parser")
+ #Nothing will be output since both handler and logger are set to WARNING
+ logger.info(self.next_message())
+ self.assert_log_lines([], stream=output)
+ self.apply_config(self.config9a)
+ #Nothing will be output since both handler is still set to WARNING
+ logger.info(self.next_message())
+ self.assert_log_lines([], stream=output)
+ self.apply_config(self.config9b)
+ #Message should now be output
+ logger.info(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '3'),
+ ], stream=output)
+
+ def test_config_10_ok(self):
+ with captured_stdout() as output:
+ self.apply_config(self.config10)
+ logger = logging.getLogger("compiler.parser")
+ logger.warning(self.next_message())
+ logger = logging.getLogger('compiler')
+ #Not output, because filtered
+ logger.warning(self.next_message())
+ logger = logging.getLogger('compiler.lexer')
+ #Not output, because filtered
+ logger.warning(self.next_message())
+ logger = logging.getLogger("compiler.parser.codegen")
+ #Output, as not filtered
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('WARNING', '1'),
+ ('ERROR', '4'),
+ ], stream=output)
+
+ def test_config11_ok(self):
+ self.test_config1_ok(self.config11)
+
+ def test_config12_failure(self):
+ self.assertRaises(StandardError, self.apply_config, self.config12)
+
+ def test_config13_failure(self):
+ self.assertRaises(StandardError, self.apply_config, self.config13)
+
+ @unittest.skipUnless(threading, 'listen() needs threading to work')
+ def setup_via_listener(self, text):
+ # Ask for a randomly assigned port (by using port 0)
+ t = logging.config.listen(0)
+ t.start()
+ t.ready.wait()
+ # Now get the port allocated
+ port = t.port
+ t.ready.clear()
+ try:
+ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ sock.settimeout(2.0)
+ sock.connect(('localhost', port))
+
+ slen = struct.pack('>L', len(text))
+ s = slen + text
+ sentsofar = 0
+ left = len(s)
+ while left > 0:
+ sent = sock.send(s[sentsofar:])
+ sentsofar += sent
+ left -= sent
+ sock.close()
+ finally:
+ t.ready.wait(2.0)
+ logging.config.stopListening()
+ t.join(2.0)
+
+ def test_listen_config_10_ok(self):
+ with captured_stdout() as output:
+ self.setup_via_listener(json.dumps(self.config10))
+ logger = logging.getLogger("compiler.parser")
+ logger.warning(self.next_message())
+ logger = logging.getLogger('compiler')
+ #Not output, because filtered
+ logger.warning(self.next_message())
+ logger = logging.getLogger('compiler.lexer')
+ #Not output, because filtered
+ logger.warning(self.next_message())
+ logger = logging.getLogger("compiler.parser.codegen")
+ #Output, as not filtered
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('WARNING', '1'),
+ ('ERROR', '4'),
+ ], stream=output)
+
+ def test_listen_config_1_ok(self):
+ with captured_stdout() as output:
+ self.setup_via_listener(textwrap.dedent(ConfigFileTest.config1))
+ logger = logging.getLogger("compiler.parser")
+ # Both will output a message
+ logger.info(self.next_message())
+ logger.error(self.next_message())
+ self.assert_log_lines([
+ ('INFO', '1'),
+ ('ERROR', '2'),
+ ], stream=output)
+ # Original logger output is empty.
+ self.assert_log_lines([])
+
+
+class ManagerTest(BaseTest):
+ def test_manager_loggerclass(self):
+ logged = []
+
+ class MyLogger(logging.Logger):
+ def _log(self, level, msg, args, exc_info=None, extra=None):
+ logged.append(msg)
+
+ man = logging.Manager(None)
+ self.assertRaises(TypeError, man.setLoggerClass, int)
+ man.setLoggerClass(MyLogger)
+ logger = man.getLogger('test')
+ logger.warning('should appear in logged')
+ logging.warning('should not appear in logged')
+
+ self.assertEqual(logged, ['should appear in logged'])
+
+
+class ChildLoggerTest(BaseTest):
+ def test_child_loggers(self):
+ r = logging.getLogger()
+ l1 = logging.getLogger('abc')
+ l2 = logging.getLogger('def.ghi')
+ c1 = r.getChild('xyz')
+ c2 = r.getChild('uvw.xyz')
+ self.assertTrue(c1 is logging.getLogger('xyz'))
+ self.assertTrue(c2 is logging.getLogger('uvw.xyz'))
+ c1 = l1.getChild('def')
+ c2 = c1.getChild('ghi')
+ c3 = l1.getChild('def.ghi')
+ self.assertTrue(c1 is logging.getLogger('abc.def'))
+ self.assertTrue(c2 is logging.getLogger('abc.def.ghi'))
+ self.assertTrue(c2 is c3)
+
+
# Set the locale to the platform-dependent default. I have no idea
# why the test does this, but in any case we save the current locale
# first and restore it at the end.
@run_with_locale('LC_ALL', '')
def test_main():
run_unittest(BuiltinLevelsTest, BasicFilterTest,
- CustomLevelsAndFiltersTest, MemoryHandlerTest,
- ConfigFileTest, SocketHandlerTest, MemoryTest,
- EncodingTest)
+ CustomLevelsAndFiltersTest, MemoryHandlerTest,
+ ConfigFileTest, SocketHandlerTest, MemoryTest,
+ EncodingTest, WarningsTest, ConfigDictTest, ManagerTest,
+ ChildLoggerTest)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index a6ed1cb111..58cfc3a2a3 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -3,6 +3,7 @@ from test import test_support
import sys
import random
+import math
# Used for lazy formatting of failure messages
class Frm(object):
@@ -14,7 +15,7 @@ class Frm(object):
return self.format % self.args
# SHIFT should match the value in longintrepr.h for best testing.
-SHIFT = 15
+SHIFT = sys.long_info.bits_per_digit
BASE = 2 ** SHIFT
MASK = BASE - 1
KARATSUBA_CUTOFF = 70 # from longobject.c
@@ -87,7 +88,7 @@ class LongTest(unittest.TestCase):
# The sign of the number is also random.
def getran(self, ndigits):
- self.assert_(ndigits > 0)
+ self.assertTrue(ndigits > 0)
nbits_hi = ndigits * SHIFT
nbits_lo = nbits_hi - SHIFT + 1
answer = 0L
@@ -96,13 +97,13 @@ class LongTest(unittest.TestCase):
while nbits < nbits_lo:
bits = (r >> 1) + 1
bits = min(bits, nbits_hi - nbits)
- self.assert_(1 <= bits <= SHIFT)
+ self.assertTrue(1 <= bits <= SHIFT)
nbits = nbits + bits
answer = answer << bits
if r & 1:
answer = answer | ((1 << bits) - 1)
r = int(random.random() * (SHIFT * 2))
- self.assert_(nbits_lo <= nbits <= nbits_hi)
+ self.assertTrue(nbits_lo <= nbits <= nbits_hi)
if random.random() < 0.5:
answer = -answer
return answer
@@ -128,9 +129,9 @@ class LongTest(unittest.TestCase):
eq(r, r2, Frm("divmod returns different mod than %% for %r and %r", x, y))
eq(x, q*y + r, Frm("x != q*y + r after divmod on x=%r, y=%r", x, y))
if y > 0:
- self.assert_(0 <= r < y, Frm("bad mod from divmod on %r and %r", x, y))
+ self.assertTrue(0 <= r < y, Frm("bad mod from divmod on %r and %r", x, y))
else:
- self.assert_(y < r <= 0, Frm("bad mod from divmod on %r and %r", x, y))
+ self.assertTrue(y < r <= 0, Frm("bad mod from divmod on %r and %r", x, y))
def test_division(self):
digits = range(1, MAXDIGITS+1) + range(KARATSUBA_CUTOFF,
@@ -142,6 +143,35 @@ class LongTest(unittest.TestCase):
y = self.getran(leny) or 1L
self.check_division(x, y)
+ # specific numbers chosen to exercise corner cases of the
+ # current long division implementation
+
+ # 30-bit cases involving a quotient digit estimate of BASE+1
+ self.check_division(1231948412290879395966702881L,
+ 1147341367131428698L)
+ self.check_division(815427756481275430342312021515587883L,
+ 707270836069027745L)
+ self.check_division(627976073697012820849443363563599041L,
+ 643588798496057020L)
+ self.check_division(1115141373653752303710932756325578065L,
+ 1038556335171453937726882627L)
+ # 30-bit cases that require the post-subtraction correction step
+ self.check_division(922498905405436751940989320930368494L,
+ 949985870686786135626943396L)
+ self.check_division(768235853328091167204009652174031844L,
+ 1091555541180371554426545266L)
+
+ # 15-bit cases involving a quotient digit estimate of BASE+1
+ self.check_division(20172188947443L, 615611397L)
+ self.check_division(1020908530270155025L, 950795710L)
+ self.check_division(128589565723112408L, 736393718L)
+ self.check_division(609919780285761575L, 18613274546784L)
+ # 15-bit cases that require the post-subtraction correction step
+ self.check_division(710031681576388032L, 26769404391308L)
+ self.check_division(1933622614268221L, 30212853348836L)
+
+
+
def test_karatsuba(self):
digits = range(1, 5) + range(KARATSUBA_CUTOFF, KARATSUBA_CUTOFF + 10)
digits.extend([KARATSUBA_CUTOFF * 10, KARATSUBA_CUTOFF * 100])
@@ -290,6 +320,9 @@ class LongTest(unittest.TestCase):
self.assertEqual(long(3.5), 3L)
self.assertEqual(long(-3.5), -3L)
self.assertEqual(long("-3"), -3L)
+ self.assertEqual(long("0b10", 2), 2L)
+ self.assertEqual(long("0o10", 8), 8L)
+ self.assertEqual(long("0x10", 16), 16L)
if test_support.have_unicode:
self.assertEqual(long(unicode("-3")), -3L)
# Different base:
@@ -497,9 +530,9 @@ class LongTest(unittest.TestCase):
try:
long(TruncReturnsNonIntegral())
except TypeError as e:
- self.assertEquals(str(e),
- "__trunc__ returned non-Integral"
- " (type NonIntegral)")
+ self.assertEqual(str(e),
+ "__trunc__ returned non-Integral"
+ " (type NonIntegral)")
else:
self.fail("Failed to raise TypeError with %s" %
((base, trunc_result_base),))
@@ -538,7 +571,7 @@ class LongTest(unittest.TestCase):
y = int(x)
except OverflowError:
self.fail("int(long(sys.maxint) + 1) mustn't overflow")
- self.assert_(isinstance(y, long),
+ self.assertIsInstance(y, long,
"int(long(sys.maxint) + 1) should have returned long")
x = hugeneg_aslong - 1
@@ -546,14 +579,14 @@ class LongTest(unittest.TestCase):
y = int(x)
except OverflowError:
self.fail("int(long(-sys.maxint-1) - 1) mustn't overflow")
- self.assert_(isinstance(y, long),
+ self.assertIsInstance(y, long,
"int(long(-sys.maxint-1) - 1) should have returned long")
class long2(long):
pass
x = long2(1L<<100)
y = int(x)
- self.assert_(type(y) is long,
+ self.assertTrue(type(y) is long,
"overflowing int conversion must return long not long subtype")
# long -> Py_ssize_t conversion
@@ -561,18 +594,32 @@ class LongTest(unittest.TestCase):
def __getslice__(self, i, j):
return i, j
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
self.assertEqual(X()[-5L:7L], (-5, 7))
# use the clamping effect to test the smallest and largest longs
# that fit a Py_ssize_t
slicemin, slicemax = X()[-2L**100:2L**100]
self.assertEqual(X()[slicemin:slicemax], (slicemin, slicemax))
+ def test_issue9869(self):
+ # Issue 9869: Interpreter crash when initializing an instance
+ # of a long subclass from an object whose __long__ method returns
+ # a plain int.
+ class BadLong(object):
+ def __long__(self):
+ return 1000000
+
+ class MyLong(long):
+ pass
+
+ x = MyLong(BadLong())
+ self.assertIsInstance(x, long)
+ self.assertEqual(x, 1000000)
+
+
# ----------------------------------- tests of auto int->long conversion
def test_auto_overflow(self):
- import math, sys
-
special = [0, 1, 2, 3, sys.maxint-1, sys.maxint, sys.maxint+1]
sqrt = int(math.sqrt(sys.maxint))
special.extend([sqrt-1, sqrt, sqrt+1])
@@ -606,7 +653,7 @@ class LongTest(unittest.TestCase):
checkit(x, '*', y)
if y:
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
expected = longx / longy
got = x / y
checkit(x, '/', y)
@@ -633,9 +680,66 @@ class LongTest(unittest.TestCase):
else:
self.assertRaises(TypeError, pow,longx, longy, long(z))
- def test_float_overflow(self):
- import math
+ @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+ def test_float_conversion(self):
+ import sys
+ DBL_MAX = sys.float_info.max
+ DBL_MAX_EXP = sys.float_info.max_exp
+ DBL_MANT_DIG = sys.float_info.mant_dig
+
+ exact_values = [0L, 1L, 2L,
+ long(2**53-3),
+ long(2**53-2),
+ long(2**53-1),
+ long(2**53),
+ long(2**53+2),
+ long(2**54-4),
+ long(2**54-2),
+ long(2**54),
+ long(2**54+4)]
+ for x in exact_values:
+ self.assertEqual(long(float(x)), x)
+ self.assertEqual(long(float(-x)), -x)
+
+ # test round-half-even
+ for x, y in [(1, 0), (2, 2), (3, 4), (4, 4), (5, 4), (6, 6), (7, 8)]:
+ for p in xrange(15):
+ self.assertEqual(long(float(2L**p*(2**53+x))), 2L**p*(2**53+y))
+
+ for x, y in [(0, 0), (1, 0), (2, 0), (3, 4), (4, 4), (5, 4), (6, 8),
+ (7, 8), (8, 8), (9, 8), (10, 8), (11, 12), (12, 12),
+ (13, 12), (14, 16), (15, 16)]:
+ for p in xrange(15):
+ self.assertEqual(long(float(2L**p*(2**54+x))), 2L**p*(2**54+y))
+
+ # behaviour near extremes of floating-point range
+ long_dbl_max = long(DBL_MAX)
+ top_power = 2**DBL_MAX_EXP
+ halfway = (long_dbl_max + top_power)//2
+ self.assertEqual(float(long_dbl_max), DBL_MAX)
+ self.assertEqual(float(long_dbl_max+1), DBL_MAX)
+ self.assertEqual(float(halfway-1), DBL_MAX)
+ self.assertRaises(OverflowError, float, halfway)
+ self.assertEqual(float(1-halfway), -DBL_MAX)
+ self.assertRaises(OverflowError, float, -halfway)
+ self.assertRaises(OverflowError, float, top_power-1)
+ self.assertRaises(OverflowError, float, top_power)
+ self.assertRaises(OverflowError, float, top_power+1)
+ self.assertRaises(OverflowError, float, 2*top_power-1)
+ self.assertRaises(OverflowError, float, 2*top_power)
+ self.assertRaises(OverflowError, float, top_power*top_power)
+
+ for p in xrange(100):
+ x = long(2**p * (2**53 + 1) + 1)
+ y = long(2**p * (2**53+ 2))
+ self.assertEqual(long(float(x)), y)
+
+ x = long(2**p * (2**53 + 1))
+ y = long(2**p * 2**53)
+ self.assertEqual(long(float(x)), y)
+ def test_float_overflow(self):
for x in -2.0, -1.0, 0.0, 1.0, 2.0:
self.assertEqual(float(long(x)), x)
@@ -665,8 +769,6 @@ class LongTest(unittest.TestCase):
"float(shuge) should not equal int(shuge)")
def test_logs(self):
- import math
-
LOG10E = math.log10(math.e)
for exp in range(10) + [100, 1000, 10000]:
@@ -686,7 +788,6 @@ class LongTest(unittest.TestCase):
def test_mixed_compares(self):
eq = self.assertEqual
- import math
# We're mostly concerned with that mixing floats and longs does the
# right stuff, even when longs are too large to fit in a float.
@@ -770,6 +871,42 @@ class LongTest(unittest.TestCase):
self.assertRaises(OverflowError, long, float('-inf'))
self.assertRaises(ValueError, long, float('nan'))
+ def test_bit_length(self):
+ tiny = 1e-10
+ for x in xrange(-65000, 65000):
+ x = long(x)
+ k = x.bit_length()
+ # Check equivalence with Python version
+ self.assertEqual(k, len(bin(x).lstrip('-0b')))
+ # Behaviour as specified in the docs
+ if x != 0:
+ self.assertTrue(2**(k-1) <= abs(x) < 2**k)
+ else:
+ self.assertEqual(k, 0)
+ # Alternative definition: x.bit_length() == 1 + floor(log_2(x))
+ if x != 0:
+ # When x is an exact power of 2, numeric errors can
+ # cause floor(log(x)/log(2)) to be one too small; for
+ # small x this can be fixed by adding a small quantity
+ # to the quotient before taking the floor.
+ self.assertEqual(k, 1 + math.floor(
+ math.log(abs(x))/math.log(2) + tiny))
+
+ self.assertEqual((0L).bit_length(), 0)
+ self.assertEqual((1L).bit_length(), 1)
+ self.assertEqual((-1L).bit_length(), 1)
+ self.assertEqual((2L).bit_length(), 2)
+ self.assertEqual((-2L).bit_length(), 2)
+ for i in [2, 3, 15, 16, 17, 31, 32, 33, 63, 64, 234]:
+ a = 2L**i
+ self.assertEqual((a-1).bit_length(), i)
+ self.assertEqual((1-a).bit_length(), i)
+ self.assertEqual((a).bit_length(), i+1)
+ self.assertEqual((-a).bit_length(), i+1)
+ self.assertEqual((a+1).bit_length(), i+1)
+ self.assertEqual((-a-1).bit_length(), i+1)
+
+
def test_main():
test_support.run_unittest(LongTest)
diff --git a/Lib/test/test_long_future.py b/Lib/test/test_long_future.py
index 25bd7a7305..76c3bfbdbc 100644
--- a/Lib/test/test_long_future.py
+++ b/Lib/test/test_long_future.py
@@ -3,8 +3,52 @@ from __future__ import division
# test_long.py instead. In the meantime, it's too obscure to try to
# trick just part of test_long into using future division.
+import sys
+import random
+import math
import unittest
-from test.test_support import run_unittest, _check_py3k_warnings
+from test.test_support import run_unittest
+
+# decorator for skipping tests on non-IEEE 754 platforms
+requires_IEEE_754 = unittest.skipUnless(
+ float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+
+DBL_MAX = sys.float_info.max
+DBL_MAX_EXP = sys.float_info.max_exp
+DBL_MIN_EXP = sys.float_info.min_exp
+DBL_MANT_DIG = sys.float_info.mant_dig
+DBL_MIN_OVERFLOW = 2**DBL_MAX_EXP - 2**(DBL_MAX_EXP - DBL_MANT_DIG - 1)
+
+# pure Python version of correctly-rounded true division
+def truediv(a, b):
+ """Correctly-rounded true division for integers."""
+ negative = a^b < 0
+ a, b = abs(a), abs(b)
+
+ # exceptions: division by zero, overflow
+ if not b:
+ raise ZeroDivisionError("division by zero")
+ if a >= DBL_MIN_OVERFLOW * b:
+ raise OverflowError("int/int too large to represent as a float")
+
+ # find integer d satisfying 2**(d - 1) <= a/b < 2**d
+ d = a.bit_length() - b.bit_length()
+ if d >= 0 and a >= 2**d * b or d < 0 and a * 2**-d >= b:
+ d += 1
+
+ # compute 2**-exp * a / b for suitable exp
+ exp = max(d, DBL_MIN_EXP) - DBL_MANT_DIG
+ a, b = a << max(-exp, 0), b << max(exp, 0)
+ q, r = divmod(a, b)
+
+ # round-half-to-even: fractional part is r/b, which is > 0.5 iff
+ # 2*r > b, and == 0.5 iff 2*r == b.
+ if 2*r > b or 2*r == b and q % 2 == 1:
+ q += 1
+
+ result = math.ldexp(float(q), exp)
+ return -result if negative else result
class TrueDivisionTests(unittest.TestCase):
def test(self):
@@ -30,23 +74,144 @@ class TrueDivisionTests(unittest.TestCase):
for overflow in ["float(huge)", "float(mhuge)",
"huge / 1", "huge / 2L", "huge / -1", "huge / -2L",
"mhuge / 100", "mhuge / 100L"]:
- # XXX(cwinter) this test doesn't pass when converted to
- # use assertRaises.
- try:
+ # If the "eval" does not happen in this module,
+ # true division is not enabled
+ with self.assertRaises(OverflowError):
eval(overflow, namespace)
- self.fail("expected OverflowError from %r" % overflow)
- except OverflowError:
- pass
for underflow in ["1 / huge", "2L / huge", "-1 / huge", "-2L / huge",
"100 / mhuge", "100L / mhuge"]:
result = eval(underflow, namespace)
- self.assertEqual(result, 0.0,
- "expected underflow to 0 from %r" % underflow)
+ self.assertEqual(result, 0.0, 'expected underflow to 0 '
+ 'from {!r}'.format(underflow))
+
+ for zero in ["huge / 0", "huge / 0L", "mhuge / 0", "mhuge / 0L"]:
+ with self.assertRaises(ZeroDivisionError):
+ eval(zero, namespace)
+
+ def check_truediv(self, a, b, skip_small=True):
+ """Verify that the result of a/b is correctly rounded, by
+ comparing it with a pure Python implementation of correctly
+ rounded division. b should be nonzero."""
+
+ a, b = long(a), long(b)
+
+ # skip check for small a and b: in this case, the current
+ # implementation converts the arguments to float directly and
+ # then applies a float division. This can give doubly-rounded
+ # results on x87-using machines (particularly 32-bit Linux).
+ if skip_small and max(abs(a), abs(b)) < 2**DBL_MANT_DIG:
+ return
+
+ try:
+ # use repr so that we can distinguish between -0.0 and 0.0
+ expected = repr(truediv(a, b))
+ except OverflowError:
+ expected = 'overflow'
+ except ZeroDivisionError:
+ expected = 'zerodivision'
+
+ try:
+ got = repr(a / b)
+ except OverflowError:
+ got = 'overflow'
+ except ZeroDivisionError:
+ got = 'zerodivision'
+
+ self.assertEqual(expected, got, "Incorrectly rounded division {}/{}: "
+ "expected {}, got {}".format(a, b, expected, got))
+
+ @requires_IEEE_754
+ def test_correctly_rounded_true_division(self):
+ # more stringent tests than those above, checking that the
+ # result of true division of ints is always correctly rounded.
+ # This test should probably be considered CPython-specific.
+
+ # Exercise all the code paths not involving Gb-sized ints.
+ # ... divisions involving zero
+ self.check_truediv(123, 0)
+ self.check_truediv(-456, 0)
+ self.check_truediv(0, 3)
+ self.check_truediv(0, -3)
+ self.check_truediv(0, 0)
+ # ... overflow or underflow by large margin
+ self.check_truediv(671 * 12345 * 2**DBL_MAX_EXP, 12345)
+ self.check_truediv(12345, 345678 * 2**(DBL_MANT_DIG - DBL_MIN_EXP))
+ # ... a much larger or smaller than b
+ self.check_truediv(12345*2**100, 98765)
+ self.check_truediv(12345*2**30, 98765*7**81)
+ # ... a / b near a boundary: one of 1, 2**DBL_MANT_DIG, 2**DBL_MIN_EXP,
+ # 2**DBL_MAX_EXP, 2**(DBL_MIN_EXP-DBL_MANT_DIG)
+ bases = (0, DBL_MANT_DIG, DBL_MIN_EXP,
+ DBL_MAX_EXP, DBL_MIN_EXP - DBL_MANT_DIG)
+ for base in bases:
+ for exp in range(base - 15, base + 15):
+ self.check_truediv(75312*2**max(exp, 0), 69187*2**max(-exp, 0))
+ self.check_truediv(69187*2**max(exp, 0), 75312*2**max(-exp, 0))
+
+ # overflow corner case
+ for m in [1, 2, 7, 17, 12345, 7**100,
+ -1, -2, -5, -23, -67891, -41**50]:
+ for n in range(-10, 10):
+ self.check_truediv(m*DBL_MIN_OVERFLOW + n, m)
+ self.check_truediv(m*DBL_MIN_OVERFLOW + n, -m)
+
+ # check detection of inexactness in shifting stage
+ for n in range(250):
+ # (2**DBL_MANT_DIG+1)/(2**DBL_MANT_DIG) lies halfway
+ # between two representable floats, and would usually be
+ # rounded down under round-half-to-even. The tiniest of
+ # additions to the numerator should cause it to be rounded
+ # up instead.
+ self.check_truediv((2**DBL_MANT_DIG + 1)*12345*2**200 + 2**n,
+ 2**DBL_MANT_DIG*12345)
+
+ # 1/2731 is one of the smallest division cases that's subject
+ # to double rounding on IEEE 754 machines working internally with
+ # 64-bit precision. On such machines, the next check would fail,
+ # were it not explicitly skipped in check_truediv.
+ self.check_truediv(1, 2731)
+
+ # a particularly bad case for the old algorithm: gives an
+ # error of close to 3.5 ulps.
+ self.check_truediv(295147931372582273023, 295147932265116303360)
+ for i in range(1000):
+ self.check_truediv(10**(i+1), 10**i)
+ self.check_truediv(10**i, 10**(i+1))
+
+ # test round-half-to-even behaviour, normal result
+ for m in [1, 2, 4, 7, 8, 16, 17, 32, 12345, 7**100,
+ -1, -2, -5, -23, -67891, -41**50]:
+ for n in range(-10, 10):
+ self.check_truediv(2**DBL_MANT_DIG*m + n, m)
+
+ # test round-half-to-even, subnormal result
+ for n in range(-20, 20):
+ self.check_truediv(n, 2**1076)
+
+ # largeish random divisions: a/b where |a| <= |b| <=
+ # 2*|a|; |ans| is between 0.5 and 1.0, so error should
+ # always be bounded by 2**-54 with equality possible only
+ # if the least significant bit of q=ans*2**53 is zero.
+ for M in [10**10, 10**100, 10**1000]:
+ for i in range(1000):
+ a = random.randrange(1, M)
+ b = random.randrange(a, 2*a+1)
+ self.check_truediv(a, b)
+ self.check_truediv(-a, b)
+ self.check_truediv(a, -b)
+ self.check_truediv(-a, -b)
- with _check_py3k_warnings(('classic long division', DeprecationWarning)):
- for zero in ["huge / 0", "huge / 0L", "mhuge / 0", "mhuge / 0L"]:
- self.assertRaises(ZeroDivisionError, eval, zero, namespace)
+ # and some (genuinely) random tests
+ for _ in range(10000):
+ a_bits = random.randrange(1000)
+ b_bits = random.randrange(1, 1000)
+ x = random.randrange(2**a_bits)
+ y = random.randrange(1, 2**b_bits)
+ self.check_truediv(x, y)
+ self.check_truediv(x, -y)
+ self.check_truediv(-x, y)
+ self.check_truediv(-x, -y)
def test_main():
diff --git a/Lib/test/test_macos.py b/Lib/test/test_macos.py
index e65b174824..5af51053ce 100644
--- a/Lib/test/test_macos.py
+++ b/Lib/test/test_macos.py
@@ -1,13 +1,68 @@
import unittest
-import MacOS
-import Carbon.File
from test import test_support
import os
+import subprocess
+
+MacOS = test_support.import_module('MacOS')
TESTFN2 = test_support.TESTFN + '2'
class TestMacOS(unittest.TestCase):
+ def testGetCreatorAndType(self):
+ if not os.path.exists('/Developer/Tools/SetFile'):
+ return
+
+ try:
+ fp = open(test_support.TESTFN, 'w')
+ fp.write('\n')
+ fp.close()
+
+ subprocess.call(
+ ['/Developer/Tools/SetFile', '-t', 'ABCD', '-c', 'EFGH',
+ test_support.TESTFN])
+
+ cr, tp = MacOS.GetCreatorAndType(test_support.TESTFN)
+ self.assertEqual(tp, 'ABCD')
+ self.assertEqual(cr, 'EFGH')
+
+ finally:
+ os.unlink(test_support.TESTFN)
+
+ def testSetCreatorAndType(self):
+ if not os.path.exists('/Developer/Tools/GetFileInfo'):
+ return
+
+ try:
+ fp = open(test_support.TESTFN, 'w')
+ fp.write('\n')
+ fp.close()
+
+ MacOS.SetCreatorAndType(test_support.TESTFN,
+ 'ABCD', 'EFGH')
+
+ cr, tp = MacOS.GetCreatorAndType(test_support.TESTFN)
+ self.assertEqual(cr, 'ABCD')
+ self.assertEqual(tp, 'EFGH')
+
+ data = subprocess.Popen(["/Developer/Tools/GetFileInfo", test_support.TESTFN],
+ stdout=subprocess.PIPE).communicate()[0]
+
+ tp = None
+ cr = None
+ for ln in data.splitlines():
+ if ln.startswith('type:'):
+ tp = ln.split()[-1][1:-1]
+ if ln.startswith('creator:'):
+ cr = ln.split()[-1][1:-1]
+
+ self.assertEqual(cr, 'ABCD')
+ self.assertEqual(tp, 'EFGH')
+
+ finally:
+ os.unlink(test_support.TESTFN)
+
+
def testOpenRF(self):
try:
fp = open(test_support.TESTFN, 'w')
@@ -22,14 +77,14 @@ class TestMacOS(unittest.TestCase):
fp = open(test_support.TESTFN, 'r')
data = fp.read()
fp.close()
- self.assertEquals(data, 'hello world\n')
+ self.assertEqual(data, 'hello world\n')
rfp = MacOS.openrf(test_support.TESTFN, '*rb')
data = rfp.read(100)
data2 = rfp.read(100)
rfp.close()
- self.assertEquals(data, 'goodbye world\n')
- self.assertEquals(data2, '')
+ self.assertEqual(data, 'goodbye world\n')
+ self.assertEqual(data2, '')
finally:
diff --git a/Lib/test/test_macostools.py b/Lib/test/test_macostools.py
index aa6591911f..4f15982979 100644
--- a/Lib/test/test_macostools.py
+++ b/Lib/test/test_macostools.py
@@ -1,13 +1,15 @@
# Copyright (C) 2003 Python Software Foundation
import unittest
-import macostools
-import Carbon.File
-import MacOS
import os
import sys
from test import test_support
+MacOS = test_support.import_module('MacOS')
+#The following modules should exist if MacOS exists.
+import Carbon.File
+import macostools
+
TESTFN2 = test_support.TESTFN + '2'
class TestMacostools(unittest.TestCase):
@@ -78,7 +80,7 @@ class TestMacostools(unittest.TestCase):
def test_main():
# Skip on wide unicode
if len(u'\0'.encode('unicode-internal')) == 4:
- raise test_support.TestSkipped("test_macostools is broken in USC4")
+ raise unittest.SkipTest("test_macostools is broken in USC4")
test_support.run_unittest(TestMacostools)
diff --git a/Lib/test/test_macpath.py b/Lib/test/test_macpath.py
index 24d8bb2e72..2c86c532c7 100644
--- a/Lib/test/test_macpath.py
+++ b/Lib/test/test_macpath.py
@@ -1,86 +1,56 @@
-import os
-import sys
import macpath
-from test import test_support
+from test import test_support, test_genericpath
import unittest
class MacPathTestCase(unittest.TestCase):
def test_abspath(self):
- self.assert_(macpath.abspath("xx:yy") == "xx:yy")
-
- # Issue 3426: check that abspath retuns unicode when the arg is unicode
- # and str when it's str, with both ASCII and non-ASCII cwds
- saved_cwd = os.getcwd()
- cwds = ['cwd']
- try:
- cwds.append(u'\xe7w\xf0'.encode(sys.getfilesystemencoding()
- or 'ascii'))
- except UnicodeEncodeError:
- pass # the cwd can't be encoded -- test with ascii cwd only
- for cwd in cwds:
- try:
- os.mkdir(cwd)
- os.chdir(cwd)
- for path in ('', 'foo', 'f\xf2\xf2', '/foo', 'C:\\'):
- self.assertTrue(isinstance(macpath.abspath(path), str))
- for upath in (u'', u'fuu', u'f\xf9\xf9', u'/fuu', u'U:\\'):
- self.assertTrue(isinstance(macpath.abspath(upath), unicode))
- finally:
- os.chdir(saved_cwd)
- os.rmdir(cwd)
-
+ self.assertEqual(macpath.abspath("xx:yy"), "xx:yy")
def test_isabs(self):
isabs = macpath.isabs
- self.assert_(isabs("xx:yy"))
- self.assert_(isabs("xx:yy:"))
- self.assert_(isabs("xx:"))
- self.failIf(isabs("foo"))
- self.failIf(isabs(":foo"))
- self.failIf(isabs(":foo:bar"))
- self.failIf(isabs(":foo:bar:"))
-
-
- def test_commonprefix(self):
- commonprefix = macpath.commonprefix
- self.assert_(commonprefix(["home:swenson:spam", "home:swen:spam"])
- == "home:swen")
- self.assert_(commonprefix([":home:swen:spam", ":home:swen:eggs"])
- == ":home:swen:")
- self.assert_(commonprefix([":home:swen:spam", ":home:swen:spam"])
- == ":home:swen:spam")
+ self.assertTrue(isabs("xx:yy"))
+ self.assertTrue(isabs("xx:yy:"))
+ self.assertTrue(isabs("xx:"))
+ self.assertFalse(isabs("foo"))
+ self.assertFalse(isabs(":foo"))
+ self.assertFalse(isabs(":foo:bar"))
+ self.assertFalse(isabs(":foo:bar:"))
def test_split(self):
split = macpath.split
- self.assertEquals(split("foo:bar"),
+ self.assertEqual(split("foo:bar"),
('foo:', 'bar'))
- self.assertEquals(split("conky:mountpoint:foo:bar"),
+ self.assertEqual(split("conky:mountpoint:foo:bar"),
('conky:mountpoint:foo', 'bar'))
- self.assertEquals(split(":"), ('', ''))
- self.assertEquals(split(":conky:mountpoint:"),
+ self.assertEqual(split(":"), ('', ''))
+ self.assertEqual(split(":conky:mountpoint:"),
(':conky:mountpoint', ''))
- def test_splitdrive(self):
- splitdrive = macpath.splitdrive
- self.assertEquals(splitdrive("foo:bar"), ('', 'foo:bar'))
- self.assertEquals(splitdrive(":foo:bar"), ('', ':foo:bar'))
-
def test_splitext(self):
splitext = macpath.splitext
- self.assertEquals(splitext(":foo.ext"), (':foo', '.ext'))
- self.assertEquals(splitext("foo:foo.ext"), ('foo:foo', '.ext'))
- self.assertEquals(splitext(".ext"), ('.ext', ''))
- self.assertEquals(splitext("foo.ext:foo"), ('foo.ext:foo', ''))
- self.assertEquals(splitext(":foo.ext:"), (':foo.ext:', ''))
- self.assertEquals(splitext(""), ('', ''))
- self.assertEquals(splitext("foo.bar.ext"), ('foo.bar', '.ext'))
+ self.assertEqual(splitext(":foo.ext"), (':foo', '.ext'))
+ self.assertEqual(splitext("foo:foo.ext"), ('foo:foo', '.ext'))
+ self.assertEqual(splitext(".ext"), ('.ext', ''))
+ self.assertEqual(splitext("foo.ext:foo"), ('foo.ext:foo', ''))
+ self.assertEqual(splitext(":foo.ext:"), (':foo.ext:', ''))
+ self.assertEqual(splitext(""), ('', ''))
+ self.assertEqual(splitext("foo.bar.ext"), ('foo.bar', '.ext'))
+
+ def test_normpath(self):
+ # Issue 5827: Make sure normpath preserves unicode
+ for path in (u'', u'.', u'/', u'\\', u':', u'///foo/.//bar//'):
+ self.assertIsInstance(macpath.normpath(path), unicode,
+ 'normpath() returned str instead of unicode')
+
+class MacCommonTest(test_genericpath.CommonTest):
+ pathmodule = macpath
def test_main():
- test_support.run_unittest(MacPathTestCase)
+ test_support.run_unittest(MacPathTestCase, MacCommonTest)
if __name__ == "__main__":
diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
index 44e3ca824c..3c7a3e6e6c 100644
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -23,17 +23,17 @@ class TestBase(unittest.TestCase):
def _check_sample(self, msg):
# Inspect a mailbox.Message representation of the sample message
- self.assert_(isinstance(msg, email.message.Message))
- self.assert_(isinstance(msg, mailbox.Message))
+ self.assertIsInstance(msg, email.message.Message)
+ self.assertIsInstance(msg, mailbox.Message)
for key, value in _sample_headers.iteritems():
- self.assert_(value in msg.get_all(key))
- self.assert_(msg.is_multipart())
- self.assert_(len(msg.get_payload()) == len(_sample_payloads))
+ self.assertIn(value, msg.get_all(key))
+ self.assertTrue(msg.is_multipart())
+ self.assertEqual(len(msg.get_payload()), len(_sample_payloads))
for i, payload in enumerate(_sample_payloads):
part = msg.get_payload(i)
- self.assert_(isinstance(part, email.message.Message))
- self.assert_(not isinstance(part, mailbox.Message))
- self.assert_(part.get_payload() == payload)
+ self.assertIsInstance(part, email.message.Message)
+ self.assertNotIsInstance(part, mailbox.Message)
+ self.assertEqual(part.get_payload(), payload)
def _delete_recursively(self, target):
# Delete a file or delete a directory recursively
@@ -66,16 +66,16 @@ class TestMailbox(TestBase):
# Add copies of a sample message
keys = []
keys.append(self._box.add(self._template % 0))
- self.assert_(len(self._box) == 1)
+ self.assertEqual(len(self._box), 1)
keys.append(self._box.add(mailbox.Message(_sample_message)))
- self.assert_(len(self._box) == 2)
+ self.assertEqual(len(self._box), 2)
keys.append(self._box.add(email.message_from_string(_sample_message)))
- self.assert_(len(self._box) == 3)
+ self.assertEqual(len(self._box), 3)
keys.append(self._box.add(StringIO.StringIO(_sample_message)))
- self.assert_(len(self._box) == 4)
+ self.assertEqual(len(self._box), 4)
keys.append(self._box.add(_sample_message))
- self.assert_(len(self._box) == 5)
- self.assert_(self._box.get_string(keys[0]) == self._template % 0)
+ self.assertEqual(len(self._box), 5)
+ self.assertEqual(self._box.get_string(keys[0]), self._template % 0)
for i in (1, 2, 3, 4):
self._check_sample(self._box[keys[i]])
@@ -91,23 +91,23 @@ class TestMailbox(TestBase):
# (Used by test_remove() and test_delitem().)
key0 = self._box.add(self._template % 0)
key1 = self._box.add(self._template % 1)
- self.assert_(len(self._box) == 2)
+ self.assertEqual(len(self._box), 2)
method(key0)
l = len(self._box)
- self.assert_(l == 1, "actual l: %s" % l)
+ self.assertEqual(l, 1)
self.assertRaises(KeyError, lambda: self._box[key0])
self.assertRaises(KeyError, lambda: method(key0))
- self.assert_(self._box.get_string(key1) == self._template % 1)
+ self.assertEqual(self._box.get_string(key1), self._template % 1)
key2 = self._box.add(self._template % 2)
- self.assert_(len(self._box) == 2)
+ self.assertEqual(len(self._box), 2)
method(key2)
l = len(self._box)
- self.assert_(l == 1, "actual l: %s" % l)
+ self.assertEqual(l, 1)
self.assertRaises(KeyError, lambda: self._box[key2])
self.assertRaises(KeyError, lambda: method(key2))
- self.assert_(self._box.get_string(key1) == self._template % 1)
+ self.assertEqual(self._box.get_string(key1), self._template % 1)
method(key1)
- self.assert_(len(self._box) == 0)
+ self.assertEqual(len(self._box), 0)
self.assertRaises(KeyError, lambda: self._box[key1])
self.assertRaises(KeyError, lambda: method(key1))
@@ -115,35 +115,35 @@ class TestMailbox(TestBase):
# Discard messages
key0 = self._box.add(self._template % 0)
key1 = self._box.add(self._template % 1)
- self.assert_(len(self._box) == 2)
+ self.assertEqual(len(self._box), 2)
self._box.discard(key0)
- self.assert_(len(self._box) == 1)
+ self.assertEqual(len(self._box), 1)
self.assertRaises(KeyError, lambda: self._box[key0])
self._box.discard(key0)
- self.assert_(len(self._box) == 1)
+ self.assertEqual(len(self._box), 1)
self.assertRaises(KeyError, lambda: self._box[key0])
def test_get(self):
# Retrieve messages using get()
key0 = self._box.add(self._template % 0)
msg = self._box.get(key0)
- self.assert_(msg['from'] == 'foo')
- self.assert_(msg.get_payload() == '0')
- self.assert_(self._box.get('foo') is None)
- self.assert_(self._box.get('foo', False) is False)
+ self.assertEqual(msg['from'], 'foo')
+ self.assertEqual(msg.get_payload(), '0')
+ self.assertIs(self._box.get('foo'), None)
+ self.assertFalse(self._box.get('foo', False))
self._box.close()
self._box = self._factory(self._path, factory=rfc822.Message)
key1 = self._box.add(self._template % 1)
msg = self._box.get(key1)
- self.assert_(msg['from'] == 'foo')
- self.assert_(msg.fp.read() == '1')
+ self.assertEqual(msg['from'], 'foo')
+ self.assertEqual(msg.fp.read(), '1')
def test_getitem(self):
# Retrieve message using __getitem__()
key0 = self._box.add(self._template % 0)
msg = self._box[key0]
- self.assert_(msg['from'] == 'foo')
- self.assert_(msg.get_payload() == '0')
+ self.assertEqual(msg['from'], 'foo')
+ self.assertEqual(msg.get_payload(), '0')
self.assertRaises(KeyError, lambda: self._box['foo'])
self._box.discard(key0)
self.assertRaises(KeyError, lambda: self._box[key0])
@@ -153,26 +153,26 @@ class TestMailbox(TestBase):
key0 = self._box.add(self._template % 0)
key1 = self._box.add(_sample_message)
msg0 = self._box.get_message(key0)
- self.assert_(isinstance(msg0, mailbox.Message))
- self.assert_(msg0['from'] == 'foo')
- self.assert_(msg0.get_payload() == '0')
+ self.assertIsInstance(msg0, mailbox.Message)
+ self.assertEqual(msg0['from'], 'foo')
+ self.assertEqual(msg0.get_payload(), '0')
self._check_sample(self._box.get_message(key1))
def test_get_string(self):
# Get string representations of messages
key0 = self._box.add(self._template % 0)
key1 = self._box.add(_sample_message)
- self.assert_(self._box.get_string(key0) == self._template % 0)
- self.assert_(self._box.get_string(key1) == _sample_message)
+ self.assertEqual(self._box.get_string(key0), self._template % 0)
+ self.assertEqual(self._box.get_string(key1), _sample_message)
def test_get_file(self):
# Get file representations of messages
key0 = self._box.add(self._template % 0)
key1 = self._box.add(_sample_message)
- self.assert_(self._box.get_file(key0).read().replace(os.linesep, '\n')
- == self._template % 0)
- self.assert_(self._box.get_file(key1).read().replace(os.linesep, '\n')
- == _sample_message)
+ self.assertEqual(self._box.get_file(key0).read().replace(os.linesep, '\n'),
+ self._template % 0)
+ self.assertEqual(self._box.get_file(key1).read().replace(os.linesep, '\n'),
+ _sample_message)
def test_iterkeys(self):
# Get keys using iterkeys()
@@ -222,15 +222,16 @@ class TestMailbox(TestBase):
returned_keys.append(key)
returned_values.append(value)
if do_keys:
- self.assert_(len(keys) == len(returned_keys))
- self.assert_(set(keys) == set(returned_keys))
+ self.assertEqual(len(keys), len(returned_keys))
+ self.assertEqual(set(keys), set(returned_keys))
if do_values:
count = 0
for value in returned_values:
- self.assert_(value['from'] == 'foo')
- self.assert_(int(value.get_payload()) < repetitions)
+ self.assertEqual(value['from'], 'foo')
+ self.assertTrue(int(value.get_payload()) < repetitions,
+ (value.get_payload(), repetitions))
count += 1
- self.assert_(len(values) == count)
+ self.assertEqual(len(values), count)
def test_has_key(self):
# Check existence of keys using has_key()
@@ -242,61 +243,61 @@ class TestMailbox(TestBase):
def _test_has_key_or_contains(self, method):
# (Used by test_has_key() and test_contains().)
- self.assert_(not method('foo'))
+ self.assertFalse(method('foo'))
key0 = self._box.add(self._template % 0)
- self.assert_(method(key0))
- self.assert_(not method('foo'))
+ self.assertTrue(method(key0))
+ self.assertFalse(method('foo'))
key1 = self._box.add(self._template % 1)
- self.assert_(method(key1))
- self.assert_(method(key0))
- self.assert_(not method('foo'))
+ self.assertTrue(method(key1))
+ self.assertTrue(method(key0))
+ self.assertFalse(method('foo'))
self._box.remove(key0)
- self.assert_(not method(key0))
- self.assert_(method(key1))
- self.assert_(not method('foo'))
+ self.assertFalse(method(key0))
+ self.assertTrue(method(key1))
+ self.assertFalse(method('foo'))
self._box.remove(key1)
- self.assert_(not method(key1))
- self.assert_(not method(key0))
- self.assert_(not method('foo'))
+ self.assertFalse(method(key1))
+ self.assertFalse(method(key0))
+ self.assertFalse(method('foo'))
def test_len(self, repetitions=10):
# Get message count
keys = []
for i in xrange(repetitions):
- self.assert_(len(self._box) == i)
+ self.assertEqual(len(self._box), i)
keys.append(self._box.add(self._template % i))
- self.assert_(len(self._box) == i + 1)
+ self.assertEqual(len(self._box), i + 1)
for i in xrange(repetitions):
- self.assert_(len(self._box) == repetitions - i)
+ self.assertEqual(len(self._box), repetitions - i)
self._box.remove(keys[i])
- self.assert_(len(self._box) == repetitions - i - 1)
+ self.assertEqual(len(self._box), repetitions - i - 1)
def test_set_item(self):
# Modify messages using __setitem__()
key0 = self._box.add(self._template % 'original 0')
- self.assert_(self._box.get_string(key0) == \
- self._template % 'original 0')
+ self.assertEqual(self._box.get_string(key0),
+ self._template % 'original 0')
key1 = self._box.add(self._template % 'original 1')
- self.assert_(self._box.get_string(key1) == \
- self._template % 'original 1')
+ self.assertEqual(self._box.get_string(key1),
+ self._template % 'original 1')
self._box[key0] = self._template % 'changed 0'
- self.assert_(self._box.get_string(key0) == \
- self._template % 'changed 0')
+ self.assertEqual(self._box.get_string(key0),
+ self._template % 'changed 0')
self._box[key1] = self._template % 'changed 1'
- self.assert_(self._box.get_string(key1) == \
- self._template % 'changed 1')
+ self.assertEqual(self._box.get_string(key1),
+ self._template % 'changed 1')
self._box[key0] = _sample_message
self._check_sample(self._box[key0])
self._box[key1] = self._box[key0]
self._check_sample(self._box[key1])
self._box[key0] = self._template % 'original 0'
- self.assert_(self._box.get_string(key0) ==
- self._template % 'original 0')
+ self.assertEqual(self._box.get_string(key0),
+ self._template % 'original 0')
self._check_sample(self._box[key1])
self.assertRaises(KeyError,
lambda: self._box.__setitem__('foo', 'bar'))
self.assertRaises(KeyError, lambda: self._box['foo'])
- self.assert_(len(self._box) == 2)
+ self.assertEqual(len(self._box), 2)
def test_clear(self, iterations=10):
# Remove all messages using clear()
@@ -304,29 +305,29 @@ class TestMailbox(TestBase):
for i in xrange(iterations):
self._box.add(self._template % i)
for i, key in enumerate(keys):
- self.assert_(self._box.get_string(key) == self._template % i)
+ self.assertEqual(self._box.get_string(key), self._template % i)
self._box.clear()
- self.assert_(len(self._box) == 0)
+ self.assertEqual(len(self._box), 0)
for i, key in enumerate(keys):
self.assertRaises(KeyError, lambda: self._box.get_string(key))
def test_pop(self):
# Get and remove a message using pop()
key0 = self._box.add(self._template % 0)
- self.assert_(key0 in self._box)
+ self.assertIn(key0, self._box)
key1 = self._box.add(self._template % 1)
- self.assert_(key1 in self._box)
- self.assert_(self._box.pop(key0).get_payload() == '0')
- self.assert_(key0 not in self._box)
- self.assert_(key1 in self._box)
+ self.assertIn(key1, self._box)
+ self.assertEqual(self._box.pop(key0).get_payload(), '0')
+ self.assertNotIn(key0, self._box)
+ self.assertIn(key1, self._box)
key2 = self._box.add(self._template % 2)
- self.assert_(key2 in self._box)
- self.assert_(self._box.pop(key2).get_payload() == '2')
- self.assert_(key2 not in self._box)
- self.assert_(key1 in self._box)
- self.assert_(self._box.pop(key1).get_payload() == '1')
- self.assert_(key1 not in self._box)
- self.assert_(len(self._box) == 0)
+ self.assertIn(key2, self._box)
+ self.assertEqual(self._box.pop(key2).get_payload(), '2')
+ self.assertNotIn(key2, self._box)
+ self.assertIn(key1, self._box)
+ self.assertEqual(self._box.pop(key1).get_payload(), '1')
+ self.assertNotIn(key1, self._box)
+ self.assertEqual(len(self._box), 0)
def test_popitem(self, iterations=10):
# Get and remove an arbitrary (key, message) using popitem()
@@ -336,11 +337,11 @@ class TestMailbox(TestBase):
seen = []
for i in xrange(10):
key, msg = self._box.popitem()
- self.assert_(key in keys)
- self.assert_(key not in seen)
+ self.assertIn(key, keys)
+ self.assertNotIn(key, seen)
seen.append(key)
- self.assert_(int(msg.get_payload()) == keys.index(key))
- self.assert_(len(self._box) == 0)
+ self.assertEqual(int(msg.get_payload()), keys.index(key))
+ self.assertEqual(len(self._box), 0)
for key in keys:
self.assertRaises(KeyError, lambda: self._box[key])
@@ -351,32 +352,32 @@ class TestMailbox(TestBase):
key2 = self._box.add(self._template % 'original 2')
self._box.update({key0: self._template % 'changed 0',
key2: _sample_message})
- self.assert_(len(self._box) == 3)
- self.assert_(self._box.get_string(key0) ==
- self._template % 'changed 0')
- self.assert_(self._box.get_string(key1) ==
- self._template % 'original 1')
+ self.assertEqual(len(self._box), 3)
+ self.assertEqual(self._box.get_string(key0),
+ self._template % 'changed 0')
+ self.assertEqual(self._box.get_string(key1),
+ self._template % 'original 1')
self._check_sample(self._box[key2])
self._box.update([(key2, self._template % 'changed 2'),
(key1, self._template % 'changed 1'),
(key0, self._template % 'original 0')])
- self.assert_(len(self._box) == 3)
- self.assert_(self._box.get_string(key0) ==
- self._template % 'original 0')
- self.assert_(self._box.get_string(key1) ==
- self._template % 'changed 1')
- self.assert_(self._box.get_string(key2) ==
- self._template % 'changed 2')
+ self.assertEqual(len(self._box), 3)
+ self.assertEqual(self._box.get_string(key0),
+ self._template % 'original 0')
+ self.assertEqual(self._box.get_string(key1),
+ self._template % 'changed 1')
+ self.assertEqual(self._box.get_string(key2),
+ self._template % 'changed 2')
self.assertRaises(KeyError,
lambda: self._box.update({'foo': 'bar',
key0: self._template % "changed 0"}))
- self.assert_(len(self._box) == 3)
- self.assert_(self._box.get_string(key0) ==
- self._template % "changed 0")
- self.assert_(self._box.get_string(key1) ==
- self._template % "changed 1")
- self.assert_(self._box.get_string(key2) ==
- self._template % "changed 2")
+ self.assertEqual(len(self._box), 3)
+ self.assertEqual(self._box.get_string(key0),
+ self._template % "changed 0")
+ self.assertEqual(self._box.get_string(key1),
+ self._template % "changed 1")
+ self.assertEqual(self._box.get_string(key2),
+ self._template % "changed 2")
def test_flush(self):
# Write changes to disk
@@ -384,11 +385,11 @@ class TestMailbox(TestBase):
def test_lock_unlock(self):
# Lock and unlock the mailbox
- self.assert_(not os.path.exists(self._get_lock_path()))
+ self.assertFalse(os.path.exists(self._get_lock_path()))
self._box.lock()
- self.assert_(os.path.exists(self._get_lock_path()))
+ self.assertTrue(os.path.exists(self._get_lock_path()))
self._box.unlock()
- self.assert_(not os.path.exists(self._get_lock_path()))
+ self.assertFalse(os.path.exists(self._get_lock_path()))
def test_close(self):
# Close mailbox and flush changes to disk
@@ -404,9 +405,9 @@ class TestMailbox(TestBase):
self._box.close()
self._box = self._factory(self._path)
keys = self._box.keys()
- self.assert_(len(keys) == 3)
+ self.assertEqual(len(keys), 3)
for key in keys:
- self.assert_(self._box.get_string(key) in contents)
+ self.assertIn(self._box.get_string(key), contents)
def test_dump_message(self):
# Write message representations to disk
@@ -414,8 +415,8 @@ class TestMailbox(TestBase):
_sample_message, StringIO.StringIO(_sample_message)):
output = StringIO.StringIO()
self._box._dump_message(input, output)
- self.assert_(output.getvalue() ==
- _sample_message.replace('\n', os.linesep))
+ self.assertEqual(output.getvalue(),
+ _sample_message.replace('\n', os.linesep))
output = StringIO.StringIO()
self.assertRaises(TypeError,
lambda: self._box._dump_message(None, output))
@@ -475,7 +476,7 @@ class TestMaildir(TestMailbox):
msg.set_subdir('cur')
msg.set_info('foo')
key = self._box.add(msg)
- self.assert_(os.path.exists(os.path.join(self._path, 'cur', '%s%sfoo' %
+ self.assertTrue(os.path.exists(os.path.join(self._path, 'cur', '%s%sfoo' %
(key, self._box.colon))))
def test_get_MM(self):
@@ -485,9 +486,9 @@ class TestMaildir(TestMailbox):
msg.set_flags('RF')
key = self._box.add(msg)
msg_returned = self._box.get_message(key)
- self.assert_(isinstance(msg_returned, mailbox.MaildirMessage))
- self.assert_(msg_returned.get_subdir() == 'cur')
- self.assert_(msg_returned.get_flags() == 'FR')
+ self.assertIsInstance(msg_returned, mailbox.MaildirMessage)
+ self.assertEqual(msg_returned.get_subdir(), 'cur')
+ self.assertEqual(msg_returned.get_flags(), 'FR')
def test_set_MM(self):
# Set with a MaildirMessage instance
@@ -495,22 +496,22 @@ class TestMaildir(TestMailbox):
msg0.set_flags('TP')
key = self._box.add(msg0)
msg_returned = self._box.get_message(key)
- self.assert_(msg_returned.get_subdir() == 'new')
- self.assert_(msg_returned.get_flags() == 'PT')
+ self.assertEqual(msg_returned.get_subdir(), 'new')
+ self.assertEqual(msg_returned.get_flags(), 'PT')
msg1 = mailbox.MaildirMessage(self._template % 1)
self._box[key] = msg1
msg_returned = self._box.get_message(key)
- self.assert_(msg_returned.get_subdir() == 'new')
- self.assert_(msg_returned.get_flags() == '')
- self.assert_(msg_returned.get_payload() == '1')
+ self.assertEqual(msg_returned.get_subdir(), 'new')
+ self.assertEqual(msg_returned.get_flags(), '')
+ self.assertEqual(msg_returned.get_payload(), '1')
msg2 = mailbox.MaildirMessage(self._template % 2)
msg2.set_info('2,S')
self._box[key] = msg2
self._box[key] = self._template % 3
msg_returned = self._box.get_message(key)
- self.assert_(msg_returned.get_subdir() == 'new')
- self.assert_(msg_returned.get_flags() == 'S')
- self.assert_(msg_returned.get_payload() == '3')
+ self.assertEqual(msg_returned.get_subdir(), 'new')
+ self.assertEqual(msg_returned.get_flags(), 'S')
+ self.assertEqual(msg_returned.get_payload(), '3')
def test_consistent_factory(self):
# Add a message.
@@ -525,7 +526,7 @@ class TestMaildir(TestMailbox):
box = mailbox.Maildir(self._path, factory=FakeMessage)
box.colon = self._box.colon
msg2 = box.get_message(key)
- self.assert_(isinstance(msg2, FakeMessage))
+ self.assertIsInstance(msg2, FakeMessage)
def test_initialize_new(self):
# Initialize a non-existent mailbox
@@ -553,65 +554,63 @@ class TestMaildir(TestMailbox):
for subdir in '', 'tmp', 'new', 'cur':
path = os.path.join(self._path, subdir)
mode = os.stat(path)[stat.ST_MODE]
- self.assert_(stat.S_ISDIR(mode), "Not a directory: '%s'" % path)
+ self.assertTrue(stat.S_ISDIR(mode), "Not a directory: '%s'" % path)
def test_list_folders(self):
# List folders
self._box.add_folder('one')
self._box.add_folder('two')
self._box.add_folder('three')
- self.assert_(len(self._box.list_folders()) == 3)
- self.assert_(set(self._box.list_folders()) ==
- set(('one', 'two', 'three')))
+ self.assertEqual(len(self._box.list_folders()), 3)
+ self.assertEqual(set(self._box.list_folders()),
+ set(('one', 'two', 'three')))
def test_get_folder(self):
# Open folders
self._box.add_folder('foo.bar')
folder0 = self._box.get_folder('foo.bar')
folder0.add(self._template % 'bar')
- self.assert_(os.path.isdir(os.path.join(self._path, '.foo.bar')))
+ self.assertTrue(os.path.isdir(os.path.join(self._path, '.foo.bar')))
folder1 = self._box.get_folder('foo.bar')
- self.assert_(folder1.get_string(folder1.keys()[0]) == \
- self._template % 'bar')
+ self.assertEqual(folder1.get_string(folder1.keys()[0]),
+ self._template % 'bar')
def test_add_and_remove_folders(self):
# Delete folders
self._box.add_folder('one')
self._box.add_folder('two')
- self.assert_(len(self._box.list_folders()) == 2)
- self.assert_(set(self._box.list_folders()) == set(('one', 'two')))
+ self.assertEqual(len(self._box.list_folders()), 2)
+ self.assertEqual(set(self._box.list_folders()), set(('one', 'two')))
self._box.remove_folder('one')
- self.assert_(len(self._box.list_folders()) == 1)
- self.assert_(set(self._box.list_folders()) == set(('two',)))
+ self.assertEqual(len(self._box.list_folders()), 1)
+ self.assertEqual(set(self._box.list_folders()), set(('two',)))
self._box.add_folder('three')
- self.assert_(len(self._box.list_folders()) == 2)
- self.assert_(set(self._box.list_folders()) == set(('two', 'three')))
+ self.assertEqual(len(self._box.list_folders()), 2)
+ self.assertEqual(set(self._box.list_folders()), set(('two', 'three')))
self._box.remove_folder('three')
- self.assert_(len(self._box.list_folders()) == 1)
- self.assert_(set(self._box.list_folders()) == set(('two',)))
+ self.assertEqual(len(self._box.list_folders()), 1)
+ self.assertEqual(set(self._box.list_folders()), set(('two',)))
self._box.remove_folder('two')
- self.assert_(len(self._box.list_folders()) == 0)
- self.assert_(self._box.list_folders() == [])
+ self.assertEqual(len(self._box.list_folders()), 0)
+ self.assertEqual(self._box.list_folders(), [])
def test_clean(self):
# Remove old files from 'tmp'
foo_path = os.path.join(self._path, 'tmp', 'foo')
bar_path = os.path.join(self._path, 'tmp', 'bar')
- f = open(foo_path, 'w')
- f.write("@")
- f.close()
- f = open(bar_path, 'w')
- f.write("@")
- f.close()
+ with open(foo_path, 'w') as f:
+ f.write("@")
+ with open(bar_path, 'w') as f:
+ f.write("@")
self._box.clean()
- self.assert_(os.path.exists(foo_path))
- self.assert_(os.path.exists(bar_path))
+ self.assertTrue(os.path.exists(foo_path))
+ self.assertTrue(os.path.exists(bar_path))
foo_stat = os.stat(foo_path)
os.utime(foo_path, (time.time() - 129600 - 2,
foo_stat.st_mtime))
self._box.clean()
- self.assert_(not os.path.exists(foo_path))
- self.assert_(os.path.exists(bar_path))
+ self.assertFalse(os.path.exists(foo_path))
+ self.assertTrue(os.path.exists(bar_path))
def test_create_tmp(self, repetitions=10):
# Create files in tmp directory
@@ -631,61 +630,64 @@ class TestMaildir(TestMailbox):
"tmp")),
"File in wrong location: '%s'" % head)
match = pattern.match(tail)
- self.assert_(match is not None, "Invalid file name: '%s'" % tail)
+ self.assertTrue(match is not None, "Invalid file name: '%s'" % tail)
groups = match.groups()
if previous_groups is not None:
- self.assert_(int(groups[0] >= previous_groups[0]),
+ self.assertTrue(int(groups[0] >= previous_groups[0]),
"Non-monotonic seconds: '%s' before '%s'" %
(previous_groups[0], groups[0]))
- self.assert_(int(groups[1] >= previous_groups[1]) or
+ self.assertTrue(int(groups[1] >= previous_groups[1]) or
groups[0] != groups[1],
"Non-monotonic milliseconds: '%s' before '%s'" %
(previous_groups[1], groups[1]))
- self.assert_(int(groups[2]) == pid,
+ self.assertTrue(int(groups[2]) == pid,
"Process ID mismatch: '%s' should be '%s'" %
(groups[2], pid))
- self.assert_(int(groups[3]) == int(previous_groups[3]) + 1,
+ self.assertTrue(int(groups[3]) == int(previous_groups[3]) + 1,
"Non-sequential counter: '%s' before '%s'" %
(previous_groups[3], groups[3]))
- self.assert_(groups[4] == hostname,
+ self.assertTrue(groups[4] == hostname,
"Host name mismatch: '%s' should be '%s'" %
(groups[4], hostname))
previous_groups = groups
tmp_file.write(_sample_message)
tmp_file.seek(0)
- self.assert_(tmp_file.read() == _sample_message)
+ self.assertTrue(tmp_file.read() == _sample_message)
tmp_file.close()
file_count = len(os.listdir(os.path.join(self._path, "tmp")))
- self.assert_(file_count == repetitions,
+ self.assertTrue(file_count == repetitions,
"Wrong file count: '%s' should be '%s'" %
(file_count, repetitions))
def test_refresh(self):
# Update the table of contents
- self.assert_(self._box._toc == {})
+ self.assertEqual(self._box._toc, {})
key0 = self._box.add(self._template % 0)
key1 = self._box.add(self._template % 1)
- self.assert_(self._box._toc == {})
+ self.assertEqual(self._box._toc, {})
self._box._refresh()
- self.assert_(self._box._toc == {key0: os.path.join('new', key0),
- key1: os.path.join('new', key1)})
+ self.assertEqual(self._box._toc, {key0: os.path.join('new', key0),
+ key1: os.path.join('new', key1)})
key2 = self._box.add(self._template % 2)
- self.assert_(self._box._toc == {key0: os.path.join('new', key0),
- key1: os.path.join('new', key1)})
+ self.assertEqual(self._box._toc, {key0: os.path.join('new', key0),
+ key1: os.path.join('new', key1)})
self._box._refresh()
- self.assert_(self._box._toc == {key0: os.path.join('new', key0),
- key1: os.path.join('new', key1),
- key2: os.path.join('new', key2)})
+ self.assertEqual(self._box._toc, {key0: os.path.join('new', key0),
+ key1: os.path.join('new', key1),
+ key2: os.path.join('new', key2)})
def test_lookup(self):
# Look up message subpaths in the TOC
self.assertRaises(KeyError, lambda: self._box._lookup('foo'))
key0 = self._box.add(self._template % 0)
- self.assert_(self._box._lookup(key0) == os.path.join('new', key0))
+ self.assertEqual(self._box._lookup(key0), os.path.join('new', key0))
os.remove(os.path.join(self._path, 'new', key0))
- self.assert_(self._box._toc == {key0: os.path.join('new', key0)})
+ self.assertEqual(self._box._toc, {key0: os.path.join('new', key0)})
+ # Be sure that the TOC is read back from disk (see issue #6896
+ # about bad mtime behaviour on some systems).
+ self._box.flush()
self.assertRaises(KeyError, lambda: self._box._lookup(key0))
- self.assert_(self._box._toc == {})
+ self.assertEqual(self._box._toc, {})
def test_lock_unlock(self):
# Lock and unlock the mailbox. For Maildir, this does nothing.
@@ -699,10 +701,10 @@ class TestMaildir(TestMailbox):
return None
box = self._factory(self._path, factory=dummy_factory)
folder = box.add_folder('folder1')
- self.assert_(folder._factory is dummy_factory)
+ self.assertIs(folder._factory, dummy_factory)
folder1_alias = box.get_folder('folder1')
- self.assert_(folder1_alias._factory is dummy_factory)
+ self.assertIs(folder1_alias._factory, dummy_factory)
def test_directory_in_folder (self):
# Test that mailboxes still work if there's a stray extra directory
@@ -729,7 +731,7 @@ class TestMaildir(TestMailbox):
os.umask(orig_umask)
path = os.path.join(self._path, self._box._lookup(key))
mode = os.stat(path).st_mode
- self.assert_(mode & 0111 == 0)
+ self.assertEqual(mode & 0111, 0)
def test_folder_file_perms(self):
# From bug #3228, we want to verify that the file created inside a Maildir
@@ -748,6 +750,38 @@ class TestMaildir(TestMailbox):
perms = st.st_mode
self.assertFalse((perms & 0111)) # Execute bits should all be off.
+ def test_reread(self):
+
+ # Put the last modified times more than two seconds into the past
+ # (because mtime may have only a two second granularity).
+ for subdir in ('cur', 'new'):
+ os.utime(os.path.join(self._box._path, subdir),
+ (time.time()-5,)*2)
+
+ # Because mtime has a two second granularity in worst case (FAT), a
+ # refresh is done unconditionally if called for within
+ # two-second-plus-a-bit of the last one, just in case the mbox has
+ # changed; so now we have to wait for that interval to expire.
+ time.sleep(2.01 + self._box._skewfactor)
+
+ # Re-reading causes the ._toc attribute to be assigned a new dictionary
+ # object, so we'll check that the ._toc attribute isn't a different
+ # object.
+ orig_toc = self._box._toc
+ def refreshed():
+ return self._box._toc is not orig_toc
+
+ self._box._refresh()
+ self.assertFalse(refreshed())
+
+ # Now, write something into cur and remove it. This changes
+ # the mtime and should cause a re-read.
+ filename = os.path.join(self._path, 'cur', 'stray-file')
+ f = open(filename, 'w')
+ f.close()
+ os.unlink(filename)
+ self._box._refresh()
+ self.assertTrue(refreshed())
class _TestMboxMMDF(TestMailbox):
@@ -760,8 +794,8 @@ class _TestMboxMMDF(TestMailbox):
def test_add_from_string(self):
# Add a string starting with 'From ' to the mailbox
key = self._box.add('From foo@bar blah\nFrom: foo\n\n0')
- self.assert_(self._box[key].get_from() == 'foo@bar blah')
- self.assert_(self._box[key].get_payload() == '0')
+ self.assertEqual(self._box[key].get_from(), 'foo@bar blah')
+ self.assertEqual(self._box[key].get_payload(), '0')
def test_add_mbox_or_mmdf_message(self):
# Add an mboxMessage or MMDFMessage
@@ -777,11 +811,11 @@ class _TestMboxMMDF(TestMailbox):
self._box.close()
mtime = os.path.getmtime(self._path)
self._box = self._factory(self._path)
- self.assert_(len(self._box) == 3)
+ self.assertEqual(len(self._box), 3)
for key in self._box.iterkeys():
- self.assert_(self._box.get_string(key) in values)
+ self.assertIn(self._box.get_string(key), values)
self._box.close()
- self.assert_(mtime == os.path.getmtime(self._path))
+ self.assertEqual(mtime, os.path.getmtime(self._path))
def test_add_and_close(self):
# Verifying that closing a mailbox doesn't change added items
@@ -793,7 +827,8 @@ class _TestMboxMMDF(TestMailbox):
self._box._file.seek(0)
contents = self._box._file.read()
self._box.close()
- self.assert_(contents == open(self._path, 'rb').read())
+ with open(self._path, 'rb') as f:
+ self.assertEqual(contents, f.read())
self._box = self._factory(self._path)
def test_lock_conflict(self):
@@ -834,7 +869,7 @@ class _TestMboxMMDF(TestMailbox):
self._box.lock()
key2 = self._box.add(msg)
self._box.flush()
- self.assert_(self._box._locked)
+ self.assertTrue(self._box._locked)
self._box.close()
@@ -875,9 +910,9 @@ class TestMH(TestMailbox):
self._box.add_folder('one')
self._box.add_folder('two')
self._box.add_folder('three')
- self.assert_(len(self._box.list_folders()) == 3)
- self.assert_(set(self._box.list_folders()) ==
- set(('one', 'two', 'three')))
+ self.assertEqual(len(self._box.list_folders()), 3)
+ self.assertEqual(set(self._box.list_folders()),
+ set(('one', 'two', 'three')))
def test_get_folder(self):
# Open folders
@@ -888,54 +923,54 @@ class TestMH(TestMailbox):
new_folder = self._box.add_folder('foo.bar')
folder0 = self._box.get_folder('foo.bar')
folder0.add(self._template % 'bar')
- self.assert_(os.path.isdir(os.path.join(self._path, 'foo.bar')))
+ self.assertTrue(os.path.isdir(os.path.join(self._path, 'foo.bar')))
folder1 = self._box.get_folder('foo.bar')
- self.assert_(folder1.get_string(folder1.keys()[0]) == \
- self._template % 'bar')
+ self.assertEqual(folder1.get_string(folder1.keys()[0]),
+ self._template % 'bar')
# Test for bug #1569790: verify that folders returned by .get_folder()
# use the same factory function.
- self.assert_(new_folder._factory is self._box._factory)
- self.assert_(folder0._factory is self._box._factory)
+ self.assertIs(new_folder._factory, self._box._factory)
+ self.assertIs(folder0._factory, self._box._factory)
def test_add_and_remove_folders(self):
# Delete folders
self._box.add_folder('one')
self._box.add_folder('two')
- self.assert_(len(self._box.list_folders()) == 2)
- self.assert_(set(self._box.list_folders()) == set(('one', 'two')))
+ self.assertEqual(len(self._box.list_folders()), 2)
+ self.assertEqual(set(self._box.list_folders()), set(('one', 'two')))
self._box.remove_folder('one')
- self.assert_(len(self._box.list_folders()) == 1)
- self.assert_(set(self._box.list_folders()) == set(('two',)))
+ self.assertEqual(len(self._box.list_folders()), 1)
+ self.assertEqual(set(self._box.list_folders()), set(('two', )))
self._box.add_folder('three')
- self.assert_(len(self._box.list_folders()) == 2)
- self.assert_(set(self._box.list_folders()) == set(('two', 'three')))
+ self.assertEqual(len(self._box.list_folders()), 2)
+ self.assertEqual(set(self._box.list_folders()), set(('two', 'three')))
self._box.remove_folder('three')
- self.assert_(len(self._box.list_folders()) == 1)
- self.assert_(set(self._box.list_folders()) == set(('two',)))
+ self.assertEqual(len(self._box.list_folders()), 1)
+ self.assertEqual(set(self._box.list_folders()), set(('two', )))
self._box.remove_folder('two')
- self.assert_(len(self._box.list_folders()) == 0)
- self.assert_(self._box.list_folders() == [])
+ self.assertEqual(len(self._box.list_folders()), 0)
+ self.assertEqual(self._box.list_folders(), [])
def test_sequences(self):
# Get and set sequences
- self.assert_(self._box.get_sequences() == {})
+ self.assertEqual(self._box.get_sequences(), {})
msg0 = mailbox.MHMessage(self._template % 0)
msg0.add_sequence('foo')
key0 = self._box.add(msg0)
- self.assert_(self._box.get_sequences() == {'foo':[key0]})
+ self.assertEqual(self._box.get_sequences(), {'foo':[key0]})
msg1 = mailbox.MHMessage(self._template % 1)
msg1.set_sequences(['bar', 'replied', 'foo'])
key1 = self._box.add(msg1)
- self.assert_(self._box.get_sequences() ==
- {'foo':[key0, key1], 'bar':[key1], 'replied':[key1]})
+ self.assertEqual(self._box.get_sequences(),
+ {'foo':[key0, key1], 'bar':[key1], 'replied':[key1]})
msg0.set_sequences(['flagged'])
self._box[key0] = msg0
- self.assert_(self._box.get_sequences() ==
- {'foo':[key1], 'bar':[key1], 'replied':[key1],
- 'flagged':[key0]})
+ self.assertEqual(self._box.get_sequences(),
+ {'foo':[key1], 'bar':[key1], 'replied':[key1],
+ 'flagged':[key0]})
self._box.remove(key1)
- self.assert_(self._box.get_sequences() == {'flagged':[key0]})
+ self.assertEqual(self._box.get_sequences(), {'flagged':[key0]})
def test_issue2625(self):
msg0 = mailbox.MHMessage(self._template % 0)
@@ -943,6 +978,13 @@ class TestMH(TestMailbox):
key0 = self._box.add(msg0)
refmsg0 = self._box.get_message(key0)
+ def test_issue7627(self):
+ msg0 = mailbox.MHMessage(self._template % 0)
+ key0 = self._box.add(msg0)
+ self._box.lock()
+ self._box.remove(key0)
+ self._box.unlock()
+
def test_pack(self):
# Pack the contents of the mailbox
msg0 = mailbox.MHMessage(self._template % 0)
@@ -957,19 +999,19 @@ class TestMH(TestMailbox):
key1 = self._box.add(msg1)
key2 = self._box.add(msg2)
key3 = self._box.add(msg3)
- self.assert_(self._box.get_sequences() ==
- {'foo':[key0,key1,key2,key3], 'unseen':[key0],
- 'flagged':[key2], 'bar':[key3], 'replied':[key3]})
+ self.assertEqual(self._box.get_sequences(),
+ {'foo':[key0,key1,key2,key3], 'unseen':[key0],
+ 'flagged':[key2], 'bar':[key3], 'replied':[key3]})
self._box.remove(key2)
- self.assert_(self._box.get_sequences() ==
- {'foo':[key0,key1,key3], 'unseen':[key0], 'bar':[key3],
- 'replied':[key3]})
+ self.assertEqual(self._box.get_sequences(),
+ {'foo':[key0,key1,key3], 'unseen':[key0], 'bar':[key3],
+ 'replied':[key3]})
self._box.pack()
- self.assert_(self._box.keys() == [1, 2, 3])
+ self.assertEqual(self._box.keys(), [1, 2, 3])
key0 = key0
key1 = key0 + 1
key2 = key1 + 1
- self.assert_(self._box.get_sequences() ==
+ self.assertEqual(self._box.get_sequences(),
{'foo':[1, 2, 3], 'unseen':[1], 'bar':[3], 'replied':[3]})
# Test case for packing while holding the mailbox locked.
@@ -983,9 +1025,9 @@ class TestMH(TestMailbox):
self._box.lock()
self._box.pack()
self._box.unlock()
- self.assert_(self._box.get_sequences() ==
- {'foo':[1, 2, 3, 4, 5],
- 'unseen':[1], 'bar':[3], 'replied':[3]})
+ self.assertEqual(self._box.get_sequences(),
+ {'foo':[1, 2, 3, 4, 5],
+ 'unseen':[1], 'bar':[3], 'replied':[3]})
def _get_lock_path(self):
return os.path.join(self._path, '.mh_sequences.lock')
@@ -1003,21 +1045,21 @@ class TestBabyl(TestMailbox):
def test_labels(self):
# Get labels from the mailbox
- self.assert_(self._box.get_labels() == [])
+ self.assertEqual(self._box.get_labels(), [])
msg0 = mailbox.BabylMessage(self._template % 0)
msg0.add_label('foo')
key0 = self._box.add(msg0)
- self.assert_(self._box.get_labels() == ['foo'])
+ self.assertEqual(self._box.get_labels(), ['foo'])
msg1 = mailbox.BabylMessage(self._template % 1)
msg1.set_labels(['bar', 'answered', 'foo'])
key1 = self._box.add(msg1)
- self.assert_(set(self._box.get_labels()) == set(['foo', 'bar']))
+ self.assertEqual(set(self._box.get_labels()), set(['foo', 'bar']))
msg0.set_labels(['blah', 'filed'])
self._box[key0] = msg0
- self.assert_(set(self._box.get_labels()) ==
- set(['foo', 'bar', 'blah']))
+ self.assertEqual(set(self._box.get_labels()),
+ set(['foo', 'bar', 'blah']))
self._box.remove(key1)
- self.assert_(set(self._box.get_labels()) == set(['blah']))
+ self.assertEqual(set(self._box.get_labels()), set(['blah']))
class TestMessage(TestBase):
@@ -1045,24 +1087,23 @@ class TestMessage(TestBase):
def test_initialize_with_file(self):
# Initialize based on contents of file
- f = open(self._path, 'w+')
- f.write(_sample_message)
- f.seek(0)
- msg = self._factory(f)
- self._post_initialize_hook(msg)
- self._check_sample(msg)
- f.close()
+ with open(self._path, 'w+') as f:
+ f.write(_sample_message)
+ f.seek(0)
+ msg = self._factory(f)
+ self._post_initialize_hook(msg)
+ self._check_sample(msg)
def test_initialize_with_nothing(self):
# Initialize without arguments
msg = self._factory()
self._post_initialize_hook(msg)
- self.assert_(isinstance(msg, email.message.Message))
- self.assert_(isinstance(msg, mailbox.Message))
- self.assert_(isinstance(msg, self._factory))
- self.assert_(msg.keys() == [])
- self.assert_(not msg.is_multipart())
- self.assert_(msg.get_payload() == None)
+ self.assertIsInstance(msg, email.message.Message)
+ self.assertIsInstance(msg, mailbox.Message)
+ self.assertIsInstance(msg, self._factory)
+ self.assertEqual(msg.keys(), [])
+ self.assertFalse(msg.is_multipart())
+ self.assertEqual(msg.get_payload(), None)
def test_initialize_incorrectly(self):
# Initialize with invalid argument
@@ -1097,72 +1138,73 @@ class TestMaildirMessage(TestMessage):
_factory = mailbox.MaildirMessage
def _post_initialize_hook(self, msg):
- self.assert_(msg._subdir == 'new')
- self.assert_(msg._info == '')
+ self.assertEqual(msg._subdir, 'new')
+ self.assertEqual(msg._info,'')
def test_subdir(self):
# Use get_subdir() and set_subdir()
msg = mailbox.MaildirMessage(_sample_message)
- self.assert_(msg.get_subdir() == 'new')
+ self.assertEqual(msg.get_subdir(), 'new')
msg.set_subdir('cur')
- self.assert_(msg.get_subdir() == 'cur')
+ self.assertEqual(msg.get_subdir(), 'cur')
msg.set_subdir('new')
- self.assert_(msg.get_subdir() == 'new')
+ self.assertEqual(msg.get_subdir(), 'new')
self.assertRaises(ValueError, lambda: msg.set_subdir('tmp'))
- self.assert_(msg.get_subdir() == 'new')
+ self.assertEqual(msg.get_subdir(), 'new')
msg.set_subdir('new')
- self.assert_(msg.get_subdir() == 'new')
+ self.assertEqual(msg.get_subdir(), 'new')
self._check_sample(msg)
def test_flags(self):
# Use get_flags(), set_flags(), add_flag(), remove_flag()
msg = mailbox.MaildirMessage(_sample_message)
- self.assert_(msg.get_flags() == '')
- self.assert_(msg.get_subdir() == 'new')
+ self.assertEqual(msg.get_flags(), '')
+ self.assertEqual(msg.get_subdir(), 'new')
msg.set_flags('F')
- self.assert_(msg.get_subdir() == 'new')
- self.assert_(msg.get_flags() == 'F')
+ self.assertEqual(msg.get_subdir(), 'new')
+ self.assertEqual(msg.get_flags(), 'F')
msg.set_flags('SDTP')
- self.assert_(msg.get_flags() == 'DPST')
+ self.assertEqual(msg.get_flags(), 'DPST')
msg.add_flag('FT')
- self.assert_(msg.get_flags() == 'DFPST')
+ self.assertEqual(msg.get_flags(), 'DFPST')
msg.remove_flag('TDRP')
- self.assert_(msg.get_flags() == 'FS')
- self.assert_(msg.get_subdir() == 'new')
+ self.assertEqual(msg.get_flags(), 'FS')
+ self.assertEqual(msg.get_subdir(), 'new')
self._check_sample(msg)
def test_date(self):
# Use get_date() and set_date()
msg = mailbox.MaildirMessage(_sample_message)
- self.assert_(abs(msg.get_date() - time.time()) < 60)
+ diff = msg.get_date() - time.time()
+ self.assertTrue(abs(diff) < 60, diff)
msg.set_date(0.0)
- self.assert_(msg.get_date() == 0.0)
+ self.assertEqual(msg.get_date(), 0.0)
def test_info(self):
# Use get_info() and set_info()
msg = mailbox.MaildirMessage(_sample_message)
- self.assert_(msg.get_info() == '')
+ self.assertEqual(msg.get_info(), '')
msg.set_info('1,foo=bar')
- self.assert_(msg.get_info() == '1,foo=bar')
+ self.assertEqual(msg.get_info(), '1,foo=bar')
self.assertRaises(TypeError, lambda: msg.set_info(None))
self._check_sample(msg)
def test_info_and_flags(self):
# Test interaction of info and flag methods
msg = mailbox.MaildirMessage(_sample_message)
- self.assert_(msg.get_info() == '')
+ self.assertEqual(msg.get_info(), '')
msg.set_flags('SF')
- self.assert_(msg.get_flags() == 'FS')
- self.assert_(msg.get_info() == '2,FS')
+ self.assertEqual(msg.get_flags(), 'FS')
+ self.assertEqual(msg.get_info(), '2,FS')
msg.set_info('1,')
- self.assert_(msg.get_flags() == '')
- self.assert_(msg.get_info() == '1,')
+ self.assertEqual(msg.get_flags(), '')
+ self.assertEqual(msg.get_info(), '1,')
msg.remove_flag('RPT')
- self.assert_(msg.get_flags() == '')
- self.assert_(msg.get_info() == '1,')
+ self.assertEqual(msg.get_flags(), '')
+ self.assertEqual(msg.get_info(), '1,')
msg.add_flag('D')
- self.assert_(msg.get_flags() == 'D')
- self.assert_(msg.get_info() == '2,D')
+ self.assertEqual(msg.get_flags(), 'D')
+ self.assertEqual(msg.get_info(), '2,D')
self._check_sample(msg)
@@ -1178,14 +1220,14 @@ class _TestMboxMMDFMessage(TestMessage):
msg = mailbox.Message(_sample_message)
msg.set_unixfrom('From foo@bar blah')
msg = mailbox.mboxMessage(msg)
- self.assert_(msg.get_from() == 'foo@bar blah', msg.get_from())
+ self.assertEqual(msg.get_from(), 'foo@bar blah')
def test_from(self):
# Get and set "From " line
msg = mailbox.mboxMessage(_sample_message)
self._check_from(msg)
msg.set_from('foo bar')
- self.assert_(msg.get_from() == 'foo bar')
+ self.assertEqual(msg.get_from(), 'foo bar')
msg.set_from('foo@bar', True)
self._check_from(msg, 'foo@bar')
msg.set_from('blah@temp', time.localtime())
@@ -1194,23 +1236,23 @@ class _TestMboxMMDFMessage(TestMessage):
def test_flags(self):
# Use get_flags(), set_flags(), add_flag(), remove_flag()
msg = mailbox.mboxMessage(_sample_message)
- self.assert_(msg.get_flags() == '')
+ self.assertEqual(msg.get_flags(), '')
msg.set_flags('F')
- self.assert_(msg.get_flags() == 'F')
+ self.assertEqual(msg.get_flags(), 'F')
msg.set_flags('XODR')
- self.assert_(msg.get_flags() == 'RODX')
+ self.assertEqual(msg.get_flags(), 'RODX')
msg.add_flag('FA')
- self.assert_(msg.get_flags() == 'RODFAX')
+ self.assertEqual(msg.get_flags(), 'RODFAX')
msg.remove_flag('FDXA')
- self.assert_(msg.get_flags() == 'RO')
+ self.assertEqual(msg.get_flags(), 'RO')
self._check_sample(msg)
def _check_from(self, msg, sender=None):
# Check contents of "From " line
if sender is None:
sender = "MAILER-DAEMON"
- self.assert_(re.match(sender + r" \w{3} \w{3} [\d ]\d [\d ]\d:\d{2}:"
- r"\d{2} \d{4}", msg.get_from()) is not None)
+ self.assertTrue(re.match(sender + r" \w{3} \w{3} [\d ]\d [\d ]\d:\d{2}:"
+ r"\d{2} \d{4}", msg.get_from()))
class TestMboxMessage(_TestMboxMMDFMessage):
@@ -1223,30 +1265,30 @@ class TestMHMessage(TestMessage):
_factory = mailbox.MHMessage
def _post_initialize_hook(self, msg):
- self.assert_(msg._sequences == [])
+ self.assertEqual(msg._sequences, [])
def test_sequences(self):
# Get, set, join, and leave sequences
msg = mailbox.MHMessage(_sample_message)
- self.assert_(msg.get_sequences() == [])
+ self.assertEqual(msg.get_sequences(), [])
msg.set_sequences(['foobar'])
- self.assert_(msg.get_sequences() == ['foobar'])
+ self.assertEqual(msg.get_sequences(), ['foobar'])
msg.set_sequences([])
- self.assert_(msg.get_sequences() == [])
+ self.assertEqual(msg.get_sequences(), [])
msg.add_sequence('unseen')
- self.assert_(msg.get_sequences() == ['unseen'])
+ self.assertEqual(msg.get_sequences(), ['unseen'])
msg.add_sequence('flagged')
- self.assert_(msg.get_sequences() == ['unseen', 'flagged'])
+ self.assertEqual(msg.get_sequences(), ['unseen', 'flagged'])
msg.add_sequence('flagged')
- self.assert_(msg.get_sequences() == ['unseen', 'flagged'])
+ self.assertEqual(msg.get_sequences(), ['unseen', 'flagged'])
msg.remove_sequence('unseen')
- self.assert_(msg.get_sequences() == ['flagged'])
+ self.assertEqual(msg.get_sequences(), ['flagged'])
msg.add_sequence('foobar')
- self.assert_(msg.get_sequences() == ['flagged', 'foobar'])
+ self.assertEqual(msg.get_sequences(), ['flagged', 'foobar'])
msg.remove_sequence('replied')
- self.assert_(msg.get_sequences() == ['flagged', 'foobar'])
+ self.assertEqual(msg.get_sequences(), ['flagged', 'foobar'])
msg.set_sequences(['foobar', 'replied'])
- self.assert_(msg.get_sequences() == ['foobar', 'replied'])
+ self.assertEqual(msg.get_sequences(), ['foobar', 'replied'])
class TestBabylMessage(TestMessage):
@@ -1254,54 +1296,54 @@ class TestBabylMessage(TestMessage):
_factory = mailbox.BabylMessage
def _post_initialize_hook(self, msg):
- self.assert_(msg._labels == [])
+ self.assertEqual(msg._labels, [])
def test_labels(self):
# Get, set, join, and leave labels
msg = mailbox.BabylMessage(_sample_message)
- self.assert_(msg.get_labels() == [])
+ self.assertEqual(msg.get_labels(), [])
msg.set_labels(['foobar'])
- self.assert_(msg.get_labels() == ['foobar'])
+ self.assertEqual(msg.get_labels(), ['foobar'])
msg.set_labels([])
- self.assert_(msg.get_labels() == [])
+ self.assertEqual(msg.get_labels(), [])
msg.add_label('filed')
- self.assert_(msg.get_labels() == ['filed'])
+ self.assertEqual(msg.get_labels(), ['filed'])
msg.add_label('resent')
- self.assert_(msg.get_labels() == ['filed', 'resent'])
+ self.assertEqual(msg.get_labels(), ['filed', 'resent'])
msg.add_label('resent')
- self.assert_(msg.get_labels() == ['filed', 'resent'])
+ self.assertEqual(msg.get_labels(), ['filed', 'resent'])
msg.remove_label('filed')
- self.assert_(msg.get_labels() == ['resent'])
+ self.assertEqual(msg.get_labels(), ['resent'])
msg.add_label('foobar')
- self.assert_(msg.get_labels() == ['resent', 'foobar'])
+ self.assertEqual(msg.get_labels(), ['resent', 'foobar'])
msg.remove_label('unseen')
- self.assert_(msg.get_labels() == ['resent', 'foobar'])
+ self.assertEqual(msg.get_labels(), ['resent', 'foobar'])
msg.set_labels(['foobar', 'answered'])
- self.assert_(msg.get_labels() == ['foobar', 'answered'])
+ self.assertEqual(msg.get_labels(), ['foobar', 'answered'])
def test_visible(self):
# Get, set, and update visible headers
msg = mailbox.BabylMessage(_sample_message)
visible = msg.get_visible()
- self.assert_(visible.keys() == [])
- self.assert_(visible.get_payload() is None)
+ self.assertEqual(visible.keys(), [])
+ self.assertIs(visible.get_payload(), None)
visible['User-Agent'] = 'FooBar 1.0'
visible['X-Whatever'] = 'Blah'
- self.assert_(msg.get_visible().keys() == [])
+ self.assertEqual(msg.get_visible().keys(), [])
msg.set_visible(visible)
visible = msg.get_visible()
- self.assert_(visible.keys() == ['User-Agent', 'X-Whatever'])
- self.assert_(visible['User-Agent'] == 'FooBar 1.0')
- self.assert_(visible['X-Whatever'] == 'Blah')
- self.assert_(visible.get_payload() is None)
+ self.assertEqual(visible.keys(), ['User-Agent', 'X-Whatever'])
+ self.assertEqual(visible['User-Agent'], 'FooBar 1.0')
+ self.assertEqual(visible['X-Whatever'], 'Blah')
+ self.assertIs(visible.get_payload(), None)
msg.update_visible()
- self.assert_(visible.keys() == ['User-Agent', 'X-Whatever'])
- self.assert_(visible.get_payload() is None)
+ self.assertEqual(visible.keys(), ['User-Agent', 'X-Whatever'])
+ self.assertIs(visible.get_payload(), None)
visible = msg.get_visible()
- self.assert_(visible.keys() == ['User-Agent', 'Date', 'From', 'To',
- 'Subject'])
+ self.assertEqual(visible.keys(), ['User-Agent', 'Date', 'From', 'To',
+ 'Subject'])
for header in ('User-Agent', 'Date', 'From', 'To', 'Subject'):
- self.assert_(visible[header] == msg[header])
+ self.assertEqual(visible[header], msg[header])
class TestMMDFMessage(_TestMboxMMDFMessage):
@@ -1344,9 +1386,9 @@ class TestMessageConversion(TestBase):
date = msg_maildir.get_date()
msg = mailbox.MaildirMessage(msg_maildir)
self._check_sample(msg)
- self.assert_(msg.get_flags() == 'DFPRST')
- self.assert_(msg.get_subdir() == 'cur')
- self.assert_(msg.get_date() == date)
+ self.assertEqual(msg.get_flags(), 'DFPRST')
+ self.assertEqual(msg.get_subdir(), 'cur')
+ self.assertEqual(msg.get_date(), date)
def test_maildir_to_mboxmmdf(self):
# Convert MaildirMessage to mboxmessage and MMDFMessage
@@ -1358,11 +1400,11 @@ class TestMessageConversion(TestBase):
for setting, result in pairs:
msg_maildir.set_flags(setting)
msg = class_(msg_maildir)
- self.assert_(msg.get_flags() == result)
- self.assert_(msg.get_from() == 'MAILER-DAEMON %s' %
- time.asctime(time.gmtime(0.0)))
+ self.assertEqual(msg.get_flags(), result)
+ self.assertEqual(msg.get_from(), 'MAILER-DAEMON %s' %
+ time.asctime(time.gmtime(0.0)))
msg_maildir.set_subdir('cur')
- self.assert_(class_(msg_maildir).get_flags() == 'RODFA')
+ self.assertEqual(class_(msg_maildir).get_flags(), 'RODFA')
def test_maildir_to_mh(self):
# Convert MaildirMessage to MHMessage
@@ -1372,8 +1414,8 @@ class TestMessageConversion(TestBase):
('T', ['unseen']), ('DFPRST', ['replied', 'flagged']))
for setting, result in pairs:
msg_maildir.set_flags(setting)
- self.assert_(mailbox.MHMessage(msg_maildir).get_sequences() == \
- result)
+ self.assertEqual(mailbox.MHMessage(msg_maildir).get_sequences(),
+ result)
def test_maildir_to_babyl(self):
# Convert MaildirMessage to Babyl
@@ -1384,8 +1426,8 @@ class TestMessageConversion(TestBase):
('DFPRST', ['deleted', 'answered', 'forwarded']))
for setting, result in pairs:
msg_maildir.set_flags(setting)
- self.assert_(mailbox.BabylMessage(msg_maildir).get_labels() == \
- result)
+ self.assertEqual(mailbox.BabylMessage(msg_maildir).get_labels(),
+ result)
def test_mboxmmdf_to_maildir(self):
# Convert mboxMessage and MMDFMessage to MaildirMessage
@@ -1397,11 +1439,11 @@ class TestMessageConversion(TestBase):
for setting, result in pairs:
msg_mboxMMDF.set_flags(setting)
msg = mailbox.MaildirMessage(msg_mboxMMDF)
- self.assert_(msg.get_flags() == result)
- self.assert_(msg.get_date() == 0.0, msg.get_date())
+ self.assertEqual(msg.get_flags(), result)
+ self.assertEqual(msg.get_date(), 0.0)
msg_mboxMMDF.set_flags('O')
- self.assert_(mailbox.MaildirMessage(msg_mboxMMDF).get_subdir() == \
- 'cur')
+ self.assertEqual(mailbox.MaildirMessage(msg_mboxMMDF).get_subdir(),
+ 'cur')
def test_mboxmmdf_to_mboxmmdf(self):
# Convert mboxMessage and MMDFMessage to mboxMessage and MMDFMessage
@@ -1411,8 +1453,8 @@ class TestMessageConversion(TestBase):
msg_mboxMMDF.set_from('foo@bar')
for class2_ in (mailbox.mboxMessage, mailbox.MMDFMessage):
msg2 = class2_(msg_mboxMMDF)
- self.assert_(msg2.get_flags() == 'RODFA')
- self.assert_(msg2.get_from() == 'foo@bar')
+ self.assertEqual(msg2.get_flags(), 'RODFA')
+ self.assertEqual(msg2.get_from(), 'foo@bar')
def test_mboxmmdf_to_mh(self):
# Convert mboxMessage and MMDFMessage to MHMessage
@@ -1424,8 +1466,8 @@ class TestMessageConversion(TestBase):
('RODFA', ['replied', 'flagged']))
for setting, result in pairs:
msg_mboxMMDF.set_flags(setting)
- self.assert_(mailbox.MHMessage(msg_mboxMMDF).get_sequences() \
- == result)
+ self.assertEqual(mailbox.MHMessage(msg_mboxMMDF).get_sequences(),
+ result)
def test_mboxmmdf_to_babyl(self):
# Convert mboxMessage and MMDFMessage to BabylMessage
@@ -1437,7 +1479,7 @@ class TestMessageConversion(TestBase):
('RODFA', ['deleted', 'answered']))
for setting, result in pairs:
msg.set_flags(setting)
- self.assert_(mailbox.BabylMessage(msg).get_labels() == result)
+ self.assertEqual(mailbox.BabylMessage(msg).get_labels(), result)
def test_mh_to_maildir(self):
# Convert MHMessage to MaildirMessage
@@ -1445,14 +1487,14 @@ class TestMessageConversion(TestBase):
for setting, result in pairs:
msg = mailbox.MHMessage(_sample_message)
msg.add_sequence(setting)
- self.assert_(mailbox.MaildirMessage(msg).get_flags() == result)
- self.assert_(mailbox.MaildirMessage(msg).get_subdir() == 'cur')
+ self.assertEqual(mailbox.MaildirMessage(msg).get_flags(), result)
+ self.assertEqual(mailbox.MaildirMessage(msg).get_subdir(), 'cur')
msg = mailbox.MHMessage(_sample_message)
msg.add_sequence('unseen')
msg.add_sequence('replied')
msg.add_sequence('flagged')
- self.assert_(mailbox.MaildirMessage(msg).get_flags() == 'FR')
- self.assert_(mailbox.MaildirMessage(msg).get_subdir() == 'cur')
+ self.assertEqual(mailbox.MaildirMessage(msg).get_flags(), 'FR')
+ self.assertEqual(mailbox.MaildirMessage(msg).get_subdir(), 'cur')
def test_mh_to_mboxmmdf(self):
# Convert MHMessage to mboxMessage and MMDFMessage
@@ -1461,13 +1503,13 @@ class TestMessageConversion(TestBase):
msg = mailbox.MHMessage(_sample_message)
msg.add_sequence(setting)
for class_ in (mailbox.mboxMessage, mailbox.MMDFMessage):
- self.assert_(class_(msg).get_flags() == result)
+ self.assertEqual(class_(msg).get_flags(), result)
msg = mailbox.MHMessage(_sample_message)
msg.add_sequence('unseen')
msg.add_sequence('replied')
msg.add_sequence('flagged')
for class_ in (mailbox.mboxMessage, mailbox.MMDFMessage):
- self.assert_(class_(msg).get_flags() == 'OFA')
+ self.assertEqual(class_(msg).get_flags(), 'OFA')
def test_mh_to_mh(self):
# Convert MHMessage to MHMessage
@@ -1475,8 +1517,8 @@ class TestMessageConversion(TestBase):
msg.add_sequence('unseen')
msg.add_sequence('replied')
msg.add_sequence('flagged')
- self.assert_(mailbox.MHMessage(msg).get_sequences() == \
- ['unseen', 'replied', 'flagged'])
+ self.assertEqual(mailbox.MHMessage(msg).get_sequences(),
+ ['unseen', 'replied', 'flagged'])
def test_mh_to_babyl(self):
# Convert MHMessage to BabylMessage
@@ -1485,13 +1527,13 @@ class TestMessageConversion(TestBase):
for setting, result in pairs:
msg = mailbox.MHMessage(_sample_message)
msg.add_sequence(setting)
- self.assert_(mailbox.BabylMessage(msg).get_labels() == result)
+ self.assertEqual(mailbox.BabylMessage(msg).get_labels(), result)
msg = mailbox.MHMessage(_sample_message)
msg.add_sequence('unseen')
msg.add_sequence('replied')
msg.add_sequence('flagged')
- self.assert_(mailbox.BabylMessage(msg).get_labels() == \
- ['unseen', 'answered'])
+ self.assertEqual(mailbox.BabylMessage(msg).get_labels(),
+ ['unseen', 'answered'])
def test_babyl_to_maildir(self):
# Convert BabylMessage to MaildirMessage
@@ -1501,14 +1543,14 @@ class TestMessageConversion(TestBase):
for setting, result in pairs:
msg = mailbox.BabylMessage(_sample_message)
msg.add_label(setting)
- self.assert_(mailbox.MaildirMessage(msg).get_flags() == result)
- self.assert_(mailbox.MaildirMessage(msg).get_subdir() == 'cur')
+ self.assertEqual(mailbox.MaildirMessage(msg).get_flags(), result)
+ self.assertEqual(mailbox.MaildirMessage(msg).get_subdir(), 'cur')
msg = mailbox.BabylMessage(_sample_message)
for label in ('unseen', 'deleted', 'filed', 'answered', 'forwarded',
'edited', 'resent'):
msg.add_label(label)
- self.assert_(mailbox.MaildirMessage(msg).get_flags() == 'PRT')
- self.assert_(mailbox.MaildirMessage(msg).get_subdir() == 'cur')
+ self.assertEqual(mailbox.MaildirMessage(msg).get_flags(), 'PRT')
+ self.assertEqual(mailbox.MaildirMessage(msg).get_subdir(), 'cur')
def test_babyl_to_mboxmmdf(self):
# Convert BabylMessage to mboxMessage and MMDFMessage
@@ -1519,13 +1561,13 @@ class TestMessageConversion(TestBase):
for class_ in (mailbox.mboxMessage, mailbox.MMDFMessage):
msg = mailbox.BabylMessage(_sample_message)
msg.add_label(setting)
- self.assert_(class_(msg).get_flags() == result)
+ self.assertEqual(class_(msg).get_flags(), result)
msg = mailbox.BabylMessage(_sample_message)
for label in ('unseen', 'deleted', 'filed', 'answered', 'forwarded',
'edited', 'resent'):
msg.add_label(label)
for class_ in (mailbox.mboxMessage, mailbox.MMDFMessage):
- self.assert_(class_(msg).get_flags() == 'ODA')
+ self.assertEqual(class_(msg).get_flags(), 'ODA')
def test_babyl_to_mh(self):
# Convert BabylMessage to MHMessage
@@ -1535,13 +1577,13 @@ class TestMessageConversion(TestBase):
for setting, result in pairs:
msg = mailbox.BabylMessage(_sample_message)
msg.add_label(setting)
- self.assert_(mailbox.MHMessage(msg).get_sequences() == result)
+ self.assertEqual(mailbox.MHMessage(msg).get_sequences(), result)
msg = mailbox.BabylMessage(_sample_message)
for label in ('unseen', 'deleted', 'filed', 'answered', 'forwarded',
'edited', 'resent'):
msg.add_label(label)
- self.assert_(mailbox.MHMessage(msg).get_sequences() == \
- ['unseen', 'replied'])
+ self.assertEqual(mailbox.MHMessage(msg).get_sequences(),
+ ['unseen', 'replied'])
def test_babyl_to_babyl(self):
# Convert BabylMessage to BabylMessage
@@ -1551,12 +1593,12 @@ class TestMessageConversion(TestBase):
'edited', 'resent'):
msg.add_label(label)
msg2 = mailbox.BabylMessage(msg)
- self.assert_(msg2.get_labels() == ['unseen', 'deleted', 'filed',
- 'answered', 'forwarded', 'edited',
- 'resent'])
- self.assert_(msg.get_visible().keys() == msg2.get_visible().keys())
+ self.assertEqual(msg2.get_labels(), ['unseen', 'deleted', 'filed',
+ 'answered', 'forwarded', 'edited',
+ 'resent'])
+ self.assertEqual(msg.get_visible().keys(), msg2.get_visible().keys())
for key in msg.get_visible().keys():
- self.assert_(msg.get_visible()[key] == msg2.get_visible()[key])
+ self.assertEqual(msg.get_visible()[key], msg2.get_visible()[key])
class TestProxyFileBase(TestBase):
@@ -1564,69 +1606,66 @@ class TestProxyFileBase(TestBase):
def _test_read(self, proxy):
# Read by byte
proxy.seek(0)
- self.assert_(proxy.read() == 'bar')
+ self.assertEqual(proxy.read(), 'bar')
proxy.seek(1)
- self.assert_(proxy.read() == 'ar')
+ self.assertEqual(proxy.read(), 'ar')
proxy.seek(0)
- self.assert_(proxy.read(2) == 'ba')
+ self.assertEqual(proxy.read(2), 'ba')
proxy.seek(1)
- self.assert_(proxy.read(-1) == 'ar')
+ self.assertEqual(proxy.read(-1), 'ar')
proxy.seek(2)
- self.assert_(proxy.read(1000) == 'r')
+ self.assertEqual(proxy.read(1000), 'r')
def _test_readline(self, proxy):
# Read by line
proxy.seek(0)
- self.assert_(proxy.readline() == 'foo' + os.linesep)
- self.assert_(proxy.readline() == 'bar' + os.linesep)
- self.assert_(proxy.readline() == 'fred' + os.linesep)
- self.assert_(proxy.readline() == 'bob')
+ self.assertEqual(proxy.readline(), 'foo' + os.linesep)
+ self.assertEqual(proxy.readline(), 'bar' + os.linesep)
+ self.assertEqual(proxy.readline(), 'fred' + os.linesep)
+ self.assertEqual(proxy.readline(), 'bob')
proxy.seek(2)
- self.assert_(proxy.readline() == 'o' + os.linesep)
+ self.assertEqual(proxy.readline(), 'o' + os.linesep)
proxy.seek(6 + 2 * len(os.linesep))
- self.assert_(proxy.readline() == 'fred' + os.linesep)
+ self.assertEqual(proxy.readline(), 'fred' + os.linesep)
proxy.seek(6 + 2 * len(os.linesep))
- self.assert_(proxy.readline(2) == 'fr')
- self.assert_(proxy.readline(-10) == 'ed' + os.linesep)
+ self.assertEqual(proxy.readline(2), 'fr')
+ self.assertEqual(proxy.readline(-10), 'ed' + os.linesep)
def _test_readlines(self, proxy):
# Read multiple lines
proxy.seek(0)
- self.assert_(proxy.readlines() == ['foo' + os.linesep,
- 'bar' + os.linesep,
- 'fred' + os.linesep, 'bob'])
+ self.assertEqual(proxy.readlines(), ['foo' + os.linesep,
+ 'bar' + os.linesep,
+ 'fred' + os.linesep, 'bob'])
proxy.seek(0)
- self.assert_(proxy.readlines(2) == ['foo' + os.linesep])
+ self.assertEqual(proxy.readlines(2), ['foo' + os.linesep])
proxy.seek(3 + len(os.linesep))
- self.assert_(proxy.readlines(4 + len(os.linesep)) ==
- ['bar' + os.linesep, 'fred' + os.linesep])
+ self.assertEqual(proxy.readlines(4 + len(os.linesep)),
+ ['bar' + os.linesep, 'fred' + os.linesep])
proxy.seek(3)
- self.assert_(proxy.readlines(1000) == [os.linesep, 'bar' + os.linesep,
- 'fred' + os.linesep, 'bob'])
+ self.assertEqual(proxy.readlines(1000), [os.linesep, 'bar' + os.linesep,
+ 'fred' + os.linesep, 'bob'])
def _test_iteration(self, proxy):
# Iterate by line
proxy.seek(0)
iterator = iter(proxy)
- self.assert_(iterator.next() == 'foo' + os.linesep)
- self.assert_(iterator.next() == 'bar' + os.linesep)
- self.assert_(iterator.next() == 'fred' + os.linesep)
- self.assert_(iterator.next() == 'bob')
- self.assertRaises(StopIteration, lambda: iterator.next())
+ self.assertEqual(list(iterator),
+ ['foo' + os.linesep, 'bar' + os.linesep, 'fred' + os.linesep, 'bob'])
def _test_seek_and_tell(self, proxy):
# Seek and use tell to check position
proxy.seek(3)
- self.assert_(proxy.tell() == 3)
- self.assert_(proxy.read(len(os.linesep)) == os.linesep)
+ self.assertEqual(proxy.tell(), 3)
+ self.assertEqual(proxy.read(len(os.linesep)), os.linesep)
proxy.seek(2, 1)
- self.assert_(proxy.read(1 + len(os.linesep)) == 'r' + os.linesep)
+ self.assertEqual(proxy.read(1 + len(os.linesep)), 'r' + os.linesep)
proxy.seek(-3 - len(os.linesep), 2)
- self.assert_(proxy.read(3) == 'bar')
+ self.assertEqual(proxy.read(3), 'bar')
proxy.seek(2, 0)
- self.assert_(proxy.read() == 'o' + os.linesep + 'bar' + os.linesep)
+ self.assertEqual(proxy.read(), 'o' + os.linesep + 'bar' + os.linesep)
proxy.seek(100)
- self.assert_(proxy.read() == '')
+ self.assertEqual(proxy.read(), '')
def _test_close(self, proxy):
# Close a file
@@ -1649,11 +1688,11 @@ class TestProxyFile(TestProxyFileBase):
self._file.write('foo')
pos = self._file.tell()
proxy0 = mailbox._ProxyFile(self._file)
- self.assert_(proxy0.tell() == pos)
- self.assert_(self._file.tell() == pos)
+ self.assertEqual(proxy0.tell(), pos)
+ self.assertEqual(self._file.tell(), pos)
proxy1 = mailbox._ProxyFile(self._file, 0)
- self.assert_(proxy1.tell() == 0)
- self.assert_(self._file.tell() == pos)
+ self.assertEqual(proxy1.tell(), 0)
+ self.assertEqual(self._file.tell(), pos)
def test_read(self):
self._file.write('bar')
@@ -1698,8 +1737,8 @@ class TestPartialFile(TestProxyFileBase):
self._file.write('foo' + os.linesep + 'bar')
pos = self._file.tell()
proxy = mailbox._PartialFile(self._file, 2, 5)
- self.assert_(proxy.tell() == 0)
- self.assert_(self._file.tell() == pos)
+ self.assertEqual(proxy.tell(), 0)
+ self.assertEqual(self._file.tell(), pos)
def test_read(self):
self._file.write('***bar***')
@@ -1771,18 +1810,16 @@ class MaildirTestCase(unittest.TestCase):
filename = os.extsep.join((str(t), str(pid), "myhostname", "mydomain"))
tmpname = os.path.join(self._dir, "tmp", filename)
newname = os.path.join(self._dir, dir, filename)
- fp = open(tmpname, "w")
- self._msgfiles.append(tmpname)
- if mbox:
- fp.write(FROM_)
- fp.write(DUMMY_MESSAGE)
- fp.close()
+ with open(tmpname, "w") as fp:
+ self._msgfiles.append(tmpname)
+ if mbox:
+ fp.write(FROM_)
+ fp.write(DUMMY_MESSAGE)
if hasattr(os, "link"):
os.link(tmpname, newname)
else:
- fp = open(newname, "w")
- fp.write(DUMMY_MESSAGE)
- fp.close()
+ with open(newname, "w") as fp:
+ fp.write(DUMMY_MESSAGE)
self._msgfiles.append(newname)
return tmpname
@@ -1791,36 +1828,36 @@ class MaildirTestCase(unittest.TestCase):
# Test for regression on bug #117490:
# Make sure the boxes attribute actually gets set.
self.mbox = mailbox.Maildir(test_support.TESTFN)
- #self.assert_(hasattr(self.mbox, "boxes"))
- #self.assert_(len(self.mbox.boxes) == 0)
- self.assert_(self.mbox.next() is None)
- self.assert_(self.mbox.next() is None)
+ #self.assertTrue(hasattr(self.mbox, "boxes"))
+ #self.assertTrue(len(self.mbox.boxes) == 0)
+ self.assertIs(self.mbox.next(), None)
+ self.assertIs(self.mbox.next(), None)
def test_nonempty_maildir_cur(self):
self.createMessage("cur")
self.mbox = mailbox.Maildir(test_support.TESTFN)
- #self.assert_(len(self.mbox.boxes) == 1)
- self.assert_(self.mbox.next() is not None)
- self.assert_(self.mbox.next() is None)
- self.assert_(self.mbox.next() is None)
+ #self.assertTrue(len(self.mbox.boxes) == 1)
+ self.assertIsNot(self.mbox.next(), None)
+ self.assertIs(self.mbox.next(), None)
+ self.assertIs(self.mbox.next(), None)
def test_nonempty_maildir_new(self):
self.createMessage("new")
self.mbox = mailbox.Maildir(test_support.TESTFN)
- #self.assert_(len(self.mbox.boxes) == 1)
- self.assert_(self.mbox.next() is not None)
- self.assert_(self.mbox.next() is None)
- self.assert_(self.mbox.next() is None)
+ #self.assertTrue(len(self.mbox.boxes) == 1)
+ self.assertIsNot(self.mbox.next(), None)
+ self.assertIs(self.mbox.next(), None)
+ self.assertIs(self.mbox.next(), None)
def test_nonempty_maildir_both(self):
self.createMessage("cur")
self.createMessage("new")
self.mbox = mailbox.Maildir(test_support.TESTFN)
- #self.assert_(len(self.mbox.boxes) == 2)
- self.assert_(self.mbox.next() is not None)
- self.assert_(self.mbox.next() is not None)
- self.assert_(self.mbox.next() is None)
- self.assert_(self.mbox.next() is None)
+ #self.assertTrue(len(self.mbox.boxes) == 2)
+ self.assertIsNot(self.mbox.next(), None)
+ self.assertIsNot(self.mbox.next(), None)
+ self.assertIs(self.mbox.next(), None)
+ self.assertIs(self.mbox.next(), None)
def test_unix_mbox(self):
### should be better!
diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py
index 1365851619..744f93c7af 100644
--- a/Lib/test/test_marshal.py
+++ b/Lib/test/test_marshal.py
@@ -129,7 +129,7 @@ class StringTestCase(unittest.TestCase):
def test_buffer(self):
for s in ["", "Andrè Previn", "abc", " "*10000]:
- with test_support._check_py3k_warnings(("buffer.. not supported",
+ with test_support.check_py3k_warnings(("buffer.. not supported",
DeprecationWarning)):
b = buffer(s)
new = marshal.loads(marshal.dumps(b))
@@ -191,7 +191,7 @@ class ContainerTestCase(unittest.TestCase):
t = constructor(self.d.keys())
new = marshal.loads(marshal.dumps(t))
self.assertEqual(t, new)
- self.assert_(isinstance(new, constructor))
+ self.assertTrue(isinstance(new, constructor))
self.assertNotEqual(id(t), id(new))
marshal.dump(t, file(test_support.TESTFN, "wb"))
new = marshal.load(file(test_support.TESTFN, "rb"))
@@ -210,8 +210,8 @@ class BugsTestCase(unittest.TestCase):
def test_version_argument(self):
# Python 2.4.0 crashes for any call to marshal.dumps(x, y)
- self.assertEquals(marshal.loads(marshal.dumps(5, 0)), 5)
- self.assertEquals(marshal.loads(marshal.dumps(5, 1)), 5)
+ self.assertEqual(marshal.loads(marshal.dumps(5, 0)), 5)
+ self.assertEqual(marshal.loads(marshal.dumps(5, 1)), 5)
def test_fuzz(self):
# simple test that it's at least not *totally* trivial to
@@ -252,7 +252,7 @@ class BugsTestCase(unittest.TestCase):
# >>> type(loads(dumps(Int())))
# <type 'int'>
for typ in (int, long, float, complex, tuple, list, dict, set, frozenset):
- # Note: str and unicode sublclasses are not tested because they get handled
+ # Note: str and unicode subclasses are not tested because they get handled
# by marshal's routines for objects supporting the buffer API.
subtyp = type('subtyp', (typ,), {})
self.assertRaises(ValueError, marshal.dumps, subtyp())
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index 9089013eb7..ac4475e2e5 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -7,20 +7,103 @@ import math
import os
import sys
import random
+import struct
eps = 1E-05
NAN = float('nan')
INF = float('inf')
NINF = float('-inf')
+# decorator for skipping tests on non-IEEE 754 platforms
+requires_IEEE_754 = unittest.skipUnless(
+ float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+
+# detect evidence of double-rounding: fsum is not always correctly
+# rounded on machines that suffer from double rounding.
+x, y = 1e16, 2.9999 # use temporary values to defeat peephole optimizer
+HAVE_DOUBLE_ROUNDING = (x + y == 1e16 + 4)
+
# locate file with test values
if __name__ == '__main__':
file = sys.argv[0]
else:
file = __file__
test_dir = os.path.dirname(file) or os.curdir
+math_testcases = os.path.join(test_dir, 'math_testcases.txt')
test_file = os.path.join(test_dir, 'cmath_testcases.txt')
+def to_ulps(x):
+ """Convert a non-NaN float x to an integer, in such a way that
+ adjacent floats are converted to adjacent integers. Then
+ abs(ulps(x) - ulps(y)) gives the difference in ulps between two
+ floats.
+
+ The results from this function will only make sense on platforms
+ where C doubles are represented in IEEE 754 binary64 format.
+
+ """
+ n = struct.unpack('<q', struct.pack('<d', x))[0]
+ if n < 0:
+ n = ~(n+2**63)
+ return n
+
+def ulps_check(expected, got, ulps=20):
+ """Given non-NaN floats `expected` and `got`,
+ check that they're equal to within the given number of ulps.
+
+ Returns None on success and an error message on failure."""
+
+ ulps_error = to_ulps(got) - to_ulps(expected)
+ if abs(ulps_error) <= ulps:
+ return None
+ return "error = {} ulps; permitted error = {} ulps".format(ulps_error,
+ ulps)
+
+def acc_check(expected, got, rel_err=2e-15, abs_err = 5e-323):
+ """Determine whether non-NaN floats a and b are equal to within a
+ (small) rounding error. The default values for rel_err and
+ abs_err are chosen to be suitable for platforms where a float is
+ represented by an IEEE 754 double. They allow an error of between
+ 9 and 19 ulps."""
+
+ # need to special case infinities, since inf - inf gives nan
+ if math.isinf(expected) and got == expected:
+ return None
+
+ error = got - expected
+
+ permitted_error = max(abs_err, rel_err * abs(expected))
+ if abs(error) < permitted_error:
+ return None
+ return "error = {}; permitted error = {}".format(error,
+ permitted_error)
+
+def parse_mtestfile(fname):
+ """Parse a file with test values
+
+ -- starts a comment
+ blank lines, or lines containing only a comment, are ignored
+ other lines are expected to have the form
+ id fn arg -> expected [flag]*
+
+ """
+ with open(fname) as fp:
+ for line in fp:
+ # strip comments, and skip blank lines
+ if '--' in line:
+ line = line[:line.index('--')]
+ if not line.strip():
+ continue
+
+ lhs, rhs = line.split('->')
+ id, fn, arg = lhs.split()
+ rhs_pieces = rhs.split()
+ exp = rhs_pieces[0]
+ flags = rhs_pieces[1:]
+
+ yield (id, fn, float(arg), float(exp), flags)
+
def parse_testfile(fname):
"""Parse a file with test values
@@ -67,7 +150,7 @@ class MathTests(unittest.TestCase):
self.ftest('acos(1)', math.acos(1), 0)
self.assertRaises(ValueError, math.acos, INF)
self.assertRaises(ValueError, math.acos, NINF)
- self.assert_(math.isnan(math.acos(NAN)))
+ self.assertTrue(math.isnan(math.acos(NAN)))
def testAcosh(self):
self.assertRaises(TypeError, math.acosh)
@@ -75,9 +158,9 @@ class MathTests(unittest.TestCase):
self.ftest('acosh(2)', math.acosh(2), 1.3169578969248168)
self.assertRaises(ValueError, math.acosh, 0)
self.assertRaises(ValueError, math.acosh, -1)
- self.assertEquals(math.acosh(INF), INF)
+ self.assertEqual(math.acosh(INF), INF)
self.assertRaises(ValueError, math.acosh, NINF)
- self.assert_(math.isnan(math.acosh(NAN)))
+ self.assertTrue(math.isnan(math.acosh(NAN)))
def testAsin(self):
self.assertRaises(TypeError, math.asin)
@@ -86,16 +169,16 @@ class MathTests(unittest.TestCase):
self.ftest('asin(1)', math.asin(1), math.pi/2)
self.assertRaises(ValueError, math.asin, INF)
self.assertRaises(ValueError, math.asin, NINF)
- self.assert_(math.isnan(math.asin(NAN)))
+ self.assertTrue(math.isnan(math.asin(NAN)))
def testAsinh(self):
self.assertRaises(TypeError, math.asinh)
self.ftest('asinh(0)', math.asinh(0), 0)
self.ftest('asinh(1)', math.asinh(1), 0.88137358701954305)
self.ftest('asinh(-1)', math.asinh(-1), -0.88137358701954305)
- self.assertEquals(math.asinh(INF), INF)
- self.assertEquals(math.asinh(NINF), NINF)
- self.assert_(math.isnan(math.asinh(NAN)))
+ self.assertEqual(math.asinh(INF), INF)
+ self.assertEqual(math.asinh(NINF), NINF)
+ self.assertTrue(math.isnan(math.asinh(NAN)))
def testAtan(self):
self.assertRaises(TypeError, math.atan)
@@ -104,7 +187,7 @@ class MathTests(unittest.TestCase):
self.ftest('atan(1)', math.atan(1), math.pi/4)
self.ftest('atan(inf)', math.atan(INF), math.pi/2)
self.ftest('atan(-inf)', math.atan(NINF), -math.pi/2)
- self.assert_(math.isnan(math.atan(NAN)))
+ self.assertTrue(math.isnan(math.atan(NAN)))
def testAtanh(self):
self.assertRaises(TypeError, math.atan)
@@ -115,7 +198,7 @@ class MathTests(unittest.TestCase):
self.assertRaises(ValueError, math.atanh, -1)
self.assertRaises(ValueError, math.atanh, INF)
self.assertRaises(ValueError, math.atanh, NINF)
- self.assert_(math.isnan(math.atanh(NAN)))
+ self.assertTrue(math.isnan(math.atanh(NAN)))
def testAtan2(self):
self.assertRaises(TypeError, math.atan2)
@@ -132,7 +215,7 @@ class MathTests(unittest.TestCase):
self.assertEqual(math.atan2(0., 0.), 0.)
self.assertEqual(math.atan2(0., 2.3), 0.)
self.assertEqual(math.atan2(0., INF), 0.)
- self.assert_(math.isnan(math.atan2(0., NAN)))
+ self.assertTrue(math.isnan(math.atan2(0., NAN)))
# math.atan2(-0, x)
self.ftest('atan2(-0., -inf)', math.atan2(-0., NINF), -math.pi)
self.ftest('atan2(-0., -2.3)', math.atan2(-0., -2.3), -math.pi)
@@ -140,7 +223,7 @@ class MathTests(unittest.TestCase):
self.assertEqual(math.atan2(-0., 0.), -0.)
self.assertEqual(math.atan2(-0., 2.3), -0.)
self.assertEqual(math.atan2(-0., INF), -0.)
- self.assert_(math.isnan(math.atan2(-0., NAN)))
+ self.assertTrue(math.isnan(math.atan2(-0., NAN)))
# math.atan2(INF, x)
self.ftest('atan2(inf, -inf)', math.atan2(INF, NINF), math.pi*3/4)
self.ftest('atan2(inf, -2.3)', math.atan2(INF, -2.3), math.pi/2)
@@ -148,7 +231,7 @@ class MathTests(unittest.TestCase):
self.ftest('atan2(inf, 0.)', math.atan2(INF, 0.0), math.pi/2)
self.ftest('atan2(inf, 2.3)', math.atan2(INF, 2.3), math.pi/2)
self.ftest('atan2(inf, inf)', math.atan2(INF, INF), math.pi/4)
- self.assert_(math.isnan(math.atan2(INF, NAN)))
+ self.assertTrue(math.isnan(math.atan2(INF, NAN)))
# math.atan2(NINF, x)
self.ftest('atan2(-inf, -inf)', math.atan2(NINF, NINF), -math.pi*3/4)
self.ftest('atan2(-inf, -2.3)', math.atan2(NINF, -2.3), -math.pi/2)
@@ -156,43 +239,43 @@ class MathTests(unittest.TestCase):
self.ftest('atan2(-inf, 0.)', math.atan2(NINF, 0.0), -math.pi/2)
self.ftest('atan2(-inf, 2.3)', math.atan2(NINF, 2.3), -math.pi/2)
self.ftest('atan2(-inf, inf)', math.atan2(NINF, INF), -math.pi/4)
- self.assert_(math.isnan(math.atan2(NINF, NAN)))
+ self.assertTrue(math.isnan(math.atan2(NINF, NAN)))
# math.atan2(+finite, x)
self.ftest('atan2(2.3, -inf)', math.atan2(2.3, NINF), math.pi)
self.ftest('atan2(2.3, -0.)', math.atan2(2.3, -0.), math.pi/2)
self.ftest('atan2(2.3, 0.)', math.atan2(2.3, 0.), math.pi/2)
self.assertEqual(math.atan2(2.3, INF), 0.)
- self.assert_(math.isnan(math.atan2(2.3, NAN)))
+ self.assertTrue(math.isnan(math.atan2(2.3, NAN)))
# math.atan2(-finite, x)
self.ftest('atan2(-2.3, -inf)', math.atan2(-2.3, NINF), -math.pi)
self.ftest('atan2(-2.3, -0.)', math.atan2(-2.3, -0.), -math.pi/2)
self.ftest('atan2(-2.3, 0.)', math.atan2(-2.3, 0.), -math.pi/2)
self.assertEqual(math.atan2(-2.3, INF), -0.)
- self.assert_(math.isnan(math.atan2(-2.3, NAN)))
+ self.assertTrue(math.isnan(math.atan2(-2.3, NAN)))
# math.atan2(NAN, x)
- self.assert_(math.isnan(math.atan2(NAN, NINF)))
- self.assert_(math.isnan(math.atan2(NAN, -2.3)))
- self.assert_(math.isnan(math.atan2(NAN, -0.)))
- self.assert_(math.isnan(math.atan2(NAN, 0.)))
- self.assert_(math.isnan(math.atan2(NAN, 2.3)))
- self.assert_(math.isnan(math.atan2(NAN, INF)))
- self.assert_(math.isnan(math.atan2(NAN, NAN)))
+ self.assertTrue(math.isnan(math.atan2(NAN, NINF)))
+ self.assertTrue(math.isnan(math.atan2(NAN, -2.3)))
+ self.assertTrue(math.isnan(math.atan2(NAN, -0.)))
+ self.assertTrue(math.isnan(math.atan2(NAN, 0.)))
+ self.assertTrue(math.isnan(math.atan2(NAN, 2.3)))
+ self.assertTrue(math.isnan(math.atan2(NAN, INF)))
+ self.assertTrue(math.isnan(math.atan2(NAN, NAN)))
def testCeil(self):
self.assertRaises(TypeError, math.ceil)
# These types will be int in py3k.
- self.assertEquals(float, type(math.ceil(1)))
- self.assertEquals(float, type(math.ceil(1L)))
- self.assertEquals(float, type(math.ceil(1.0)))
+ self.assertEqual(float, type(math.ceil(1)))
+ self.assertEqual(float, type(math.ceil(1L)))
+ self.assertEqual(float, type(math.ceil(1.0)))
self.ftest('ceil(0.5)', math.ceil(0.5), 1)
self.ftest('ceil(1.0)', math.ceil(1.0), 1)
self.ftest('ceil(1.5)', math.ceil(1.5), 2)
self.ftest('ceil(-0.5)', math.ceil(-0.5), 0)
self.ftest('ceil(-1.0)', math.ceil(-1.0), -1)
self.ftest('ceil(-1.5)', math.ceil(-1.5), -1)
- self.assertEquals(math.ceil(INF), INF)
- self.assertEquals(math.ceil(NINF), NINF)
- self.assert_(math.isnan(math.ceil(NAN)))
+ self.assertEqual(math.ceil(INF), INF)
+ self.assertEqual(math.ceil(NINF), NINF)
+ self.assertTrue(math.isnan(math.ceil(NAN)))
class TestCeil(object):
def __float__(self):
@@ -207,39 +290,39 @@ class MathTests(unittest.TestCase):
self.assertRaises(TypeError, math.ceil, t)
self.assertRaises(TypeError, math.ceil, t, 0)
- if float.__getformat__("double").startswith("IEEE"):
- def testCopysign(self):
- self.assertEqual(math.copysign(1, 42), 1.0)
- self.assertEqual(math.copysign(0., 42), 0.0)
- self.assertEqual(math.copysign(1., -42), -1.0)
- self.assertEqual(math.copysign(3, 0.), 3.0)
- self.assertEqual(math.copysign(4., -0.), -4.0)
-
- self.assertRaises(TypeError, math.copysign)
- # copysign should let us distinguish signs of zeros
- self.assertEquals(math.copysign(1., 0.), 1.)
- self.assertEquals(math.copysign(1., -0.), -1.)
- self.assertEquals(math.copysign(INF, 0.), INF)
- self.assertEquals(math.copysign(INF, -0.), NINF)
- self.assertEquals(math.copysign(NINF, 0.), INF)
- self.assertEquals(math.copysign(NINF, -0.), NINF)
- # and of infinities
- self.assertEquals(math.copysign(1., INF), 1.)
- self.assertEquals(math.copysign(1., NINF), -1.)
- self.assertEquals(math.copysign(INF, INF), INF)
- self.assertEquals(math.copysign(INF, NINF), NINF)
- self.assertEquals(math.copysign(NINF, INF), INF)
- self.assertEquals(math.copysign(NINF, NINF), NINF)
- self.assertTrue(math.isnan(math.copysign(NAN, 1.)))
- self.assertTrue(math.isnan(math.copysign(NAN, INF)))
- self.assertTrue(math.isnan(math.copysign(NAN, NINF)))
- self.assertTrue(math.isnan(math.copysign(NAN, NAN)))
- # copysign(INF, NAN) may be INF or it may be NINF, since
- # we don't know whether the sign bit of NAN is set on any
- # given platform.
- self.assertTrue(math.isinf(math.copysign(INF, NAN)))
- # similarly, copysign(2., NAN) could be 2. or -2.
- self.assertEquals(abs(math.copysign(2., NAN)), 2.)
+ @requires_IEEE_754
+ def testCopysign(self):
+ self.assertEqual(math.copysign(1, 42), 1.0)
+ self.assertEqual(math.copysign(0., 42), 0.0)
+ self.assertEqual(math.copysign(1., -42), -1.0)
+ self.assertEqual(math.copysign(3, 0.), 3.0)
+ self.assertEqual(math.copysign(4., -0.), -4.0)
+
+ self.assertRaises(TypeError, math.copysign)
+ # copysign should let us distinguish signs of zeros
+ self.assertEqual(math.copysign(1., 0.), 1.)
+ self.assertEqual(math.copysign(1., -0.), -1.)
+ self.assertEqual(math.copysign(INF, 0.), INF)
+ self.assertEqual(math.copysign(INF, -0.), NINF)
+ self.assertEqual(math.copysign(NINF, 0.), INF)
+ self.assertEqual(math.copysign(NINF, -0.), NINF)
+ # and of infinities
+ self.assertEqual(math.copysign(1., INF), 1.)
+ self.assertEqual(math.copysign(1., NINF), -1.)
+ self.assertEqual(math.copysign(INF, INF), INF)
+ self.assertEqual(math.copysign(INF, NINF), NINF)
+ self.assertEqual(math.copysign(NINF, INF), INF)
+ self.assertEqual(math.copysign(NINF, NINF), NINF)
+ self.assertTrue(math.isnan(math.copysign(NAN, 1.)))
+ self.assertTrue(math.isnan(math.copysign(NAN, INF)))
+ self.assertTrue(math.isnan(math.copysign(NAN, NINF)))
+ self.assertTrue(math.isnan(math.copysign(NAN, NAN)))
+ # copysign(INF, NAN) may be INF or it may be NINF, since
+ # we don't know whether the sign bit of NAN is set on any
+ # given platform.
+ self.assertTrue(math.isinf(math.copysign(INF, NAN)))
+ # similarly, copysign(2., NAN) could be 2. or -2.
+ self.assertEqual(abs(math.copysign(2., NAN)), 2.)
def testCos(self):
self.assertRaises(TypeError, math.cos)
@@ -248,20 +331,20 @@ class MathTests(unittest.TestCase):
self.ftest('cos(pi/2)', math.cos(math.pi/2), 0)
self.ftest('cos(pi)', math.cos(math.pi), -1)
try:
- self.assert_(math.isnan(math.cos(INF)))
- self.assert_(math.isnan(math.cos(NINF)))
+ self.assertTrue(math.isnan(math.cos(INF)))
+ self.assertTrue(math.isnan(math.cos(NINF)))
except ValueError:
self.assertRaises(ValueError, math.cos, INF)
self.assertRaises(ValueError, math.cos, NINF)
- self.assert_(math.isnan(math.cos(NAN)))
+ self.assertTrue(math.isnan(math.cos(NAN)))
def testCosh(self):
self.assertRaises(TypeError, math.cosh)
self.ftest('cosh(0)', math.cosh(0), 1)
self.ftest('cosh(2)-2*cosh(1)**2', math.cosh(2)-2*math.cosh(1)**2, -1) # Thanks to Lambert
- self.assertEquals(math.cosh(INF), INF)
- self.assertEquals(math.cosh(NINF), INF)
- self.assert_(math.isnan(math.cosh(NAN)))
+ self.assertEqual(math.cosh(INF), INF)
+ self.assertEqual(math.cosh(NINF), INF)
+ self.assertTrue(math.isnan(math.cosh(NAN)))
def testDegrees(self):
self.assertRaises(TypeError, math.degrees)
@@ -274,9 +357,9 @@ class MathTests(unittest.TestCase):
self.ftest('exp(-1)', math.exp(-1), 1/math.e)
self.ftest('exp(0)', math.exp(0), 1)
self.ftest('exp(1)', math.exp(1), math.e)
- self.assertEquals(math.exp(INF), INF)
- self.assertEquals(math.exp(NINF), 0.)
- self.assert_(math.isnan(math.exp(NAN)))
+ self.assertEqual(math.exp(INF), INF)
+ self.assertEqual(math.exp(NINF), 0.)
+ self.assertTrue(math.isnan(math.exp(NAN)))
def testFabs(self):
self.assertRaises(TypeError, math.fabs)
@@ -301,9 +384,9 @@ class MathTests(unittest.TestCase):
def testFloor(self):
self.assertRaises(TypeError, math.floor)
# These types will be int in py3k.
- self.assertEquals(float, type(math.floor(1)))
- self.assertEquals(float, type(math.floor(1L)))
- self.assertEquals(float, type(math.floor(1.0)))
+ self.assertEqual(float, type(math.floor(1)))
+ self.assertEqual(float, type(math.floor(1L)))
+ self.assertEqual(float, type(math.floor(1.0)))
self.ftest('floor(0.5)', math.floor(0.5), 0)
self.ftest('floor(1.0)', math.floor(1.0), 1)
self.ftest('floor(1.5)', math.floor(1.5), 1)
@@ -314,9 +397,9 @@ class MathTests(unittest.TestCase):
# This fails on some platforms - so check it here
self.ftest('floor(1.23e167)', math.floor(1.23e167), 1.23e167)
self.ftest('floor(-1.23e167)', math.floor(-1.23e167), -1.23e167)
- self.assertEquals(math.ceil(INF), INF)
- self.assertEquals(math.ceil(NINF), NINF)
- self.assert_(math.isnan(math.floor(NAN)))
+ self.assertEqual(math.ceil(INF), INF)
+ self.assertEqual(math.ceil(NINF), NINF)
+ self.assertTrue(math.isnan(math.floor(NAN)))
class TestFloor(object):
def __float__(self):
@@ -339,19 +422,19 @@ class MathTests(unittest.TestCase):
self.ftest('fmod(-10,1)', math.fmod(-10,1), 0)
self.ftest('fmod(-10,0.5)', math.fmod(-10,0.5), 0)
self.ftest('fmod(-10,1.5)', math.fmod(-10,1.5), -1)
- self.assert_(math.isnan(math.fmod(NAN, 1.)))
- self.assert_(math.isnan(math.fmod(1., NAN)))
- self.assert_(math.isnan(math.fmod(NAN, NAN)))
+ self.assertTrue(math.isnan(math.fmod(NAN, 1.)))
+ self.assertTrue(math.isnan(math.fmod(1., NAN)))
+ self.assertTrue(math.isnan(math.fmod(NAN, NAN)))
self.assertRaises(ValueError, math.fmod, 1., 0.)
self.assertRaises(ValueError, math.fmod, INF, 1.)
self.assertRaises(ValueError, math.fmod, NINF, 1.)
self.assertRaises(ValueError, math.fmod, INF, 0.)
- self.assertEquals(math.fmod(3.0, INF), 3.0)
- self.assertEquals(math.fmod(-3.0, INF), -3.0)
- self.assertEquals(math.fmod(3.0, NINF), 3.0)
- self.assertEquals(math.fmod(-3.0, NINF), -3.0)
- self.assertEquals(math.fmod(0.0, 3.0), 0.0)
- self.assertEquals(math.fmod(0.0, NINF), 0.0)
+ self.assertEqual(math.fmod(3.0, INF), 3.0)
+ self.assertEqual(math.fmod(-3.0, INF), -3.0)
+ self.assertEqual(math.fmod(3.0, NINF), 3.0)
+ self.assertEqual(math.fmod(-3.0, NINF), -3.0)
+ self.assertEqual(math.fmod(0.0, 3.0), 0.0)
+ self.assertEqual(math.fmod(0.0, NINF), 0.0)
def testFrexp(self):
self.assertRaises(TypeError, math.frexp)
@@ -367,10 +450,13 @@ class MathTests(unittest.TestCase):
testfrexp('frexp(1)', math.frexp(1), (0.5, 1))
testfrexp('frexp(2)', math.frexp(2), (0.5, 2))
- self.assertEquals(math.frexp(INF)[0], INF)
- self.assertEquals(math.frexp(NINF)[0], NINF)
- self.assert_(math.isnan(math.frexp(NAN)[0]))
+ self.assertEqual(math.frexp(INF)[0], INF)
+ self.assertEqual(math.frexp(NINF)[0], NINF)
+ self.assertTrue(math.isnan(math.frexp(NAN)[0]))
+ @requires_IEEE_754
+ @unittest.skipIf(HAVE_DOUBLE_ROUNDING,
+ "fsum is not exact on machines with double rounding")
def testFsum(self):
# math.fsum relies on exact rounding for correct operation.
# There's a known problem with IA32 floating-point that causes
@@ -380,14 +466,6 @@ class MathTests(unittest.TestCase):
# problem described in issue #2937, we simply skip the whole
# test.
- if not float.__getformat__("double").startswith("IEEE"):
- return
-
- # on IEEE 754 compliant machines, both of the expressions
- # below should round to 10000000000000002.0.
- if 1e16+2.0 != 1e16+2.9999:
- return
-
# Python version of math.fsum, for comparison. Uses a
# different algorithm based on frexp, ldexp and integer
# arithmetic.
@@ -475,8 +553,8 @@ class MathTests(unittest.TestCase):
self.assertEqual(math.hypot(INF, NAN), INF)
self.assertEqual(math.hypot(NAN, NINF), INF)
self.assertEqual(math.hypot(NINF, NAN), INF)
- self.assert_(math.isnan(math.hypot(1.0, NAN)))
- self.assert_(math.isnan(math.hypot(NAN, -2.0)))
+ self.assertTrue(math.isnan(math.hypot(1.0, NAN)))
+ self.assertTrue(math.isnan(math.hypot(NAN, -2.0)))
def testLdexp(self):
self.assertRaises(TypeError, math.ldexp)
@@ -486,29 +564,29 @@ class MathTests(unittest.TestCase):
self.ftest('ldexp(-1,1)', math.ldexp(-1,1), -2)
self.assertRaises(OverflowError, math.ldexp, 1., 1000000)
self.assertRaises(OverflowError, math.ldexp, -1., 1000000)
- self.assertEquals(math.ldexp(1., -1000000), 0.)
- self.assertEquals(math.ldexp(-1., -1000000), -0.)
- self.assertEquals(math.ldexp(INF, 30), INF)
- self.assertEquals(math.ldexp(NINF, -213), NINF)
- self.assert_(math.isnan(math.ldexp(NAN, 0)))
+ self.assertEqual(math.ldexp(1., -1000000), 0.)
+ self.assertEqual(math.ldexp(-1., -1000000), -0.)
+ self.assertEqual(math.ldexp(INF, 30), INF)
+ self.assertEqual(math.ldexp(NINF, -213), NINF)
+ self.assertTrue(math.isnan(math.ldexp(NAN, 0)))
# large second argument
for n in [10**5, 10L**5, 10**10, 10L**10, 10**20, 10**40]:
- self.assertEquals(math.ldexp(INF, -n), INF)
- self.assertEquals(math.ldexp(NINF, -n), NINF)
- self.assertEquals(math.ldexp(1., -n), 0.)
- self.assertEquals(math.ldexp(-1., -n), -0.)
- self.assertEquals(math.ldexp(0., -n), 0.)
- self.assertEquals(math.ldexp(-0., -n), -0.)
- self.assert_(math.isnan(math.ldexp(NAN, -n)))
+ self.assertEqual(math.ldexp(INF, -n), INF)
+ self.assertEqual(math.ldexp(NINF, -n), NINF)
+ self.assertEqual(math.ldexp(1., -n), 0.)
+ self.assertEqual(math.ldexp(-1., -n), -0.)
+ self.assertEqual(math.ldexp(0., -n), 0.)
+ self.assertEqual(math.ldexp(-0., -n), -0.)
+ self.assertTrue(math.isnan(math.ldexp(NAN, -n)))
self.assertRaises(OverflowError, math.ldexp, 1., n)
self.assertRaises(OverflowError, math.ldexp, -1., n)
- self.assertEquals(math.ldexp(0., n), 0.)
- self.assertEquals(math.ldexp(-0., n), -0.)
- self.assertEquals(math.ldexp(INF, n), INF)
- self.assertEquals(math.ldexp(NINF, n), NINF)
- self.assert_(math.isnan(math.ldexp(NAN, n)))
+ self.assertEqual(math.ldexp(0., n), 0.)
+ self.assertEqual(math.ldexp(-0., n), -0.)
+ self.assertEqual(math.ldexp(INF, n), INF)
+ self.assertEqual(math.ldexp(NINF, n), NINF)
+ self.assertTrue(math.isnan(math.ldexp(NAN, n)))
def testLog(self):
self.assertRaises(TypeError, math.log)
@@ -518,9 +596,9 @@ class MathTests(unittest.TestCase):
self.ftest('log(32,2)', math.log(32,2), 5)
self.ftest('log(10**40, 10)', math.log(10**40, 10), 40)
self.ftest('log(10**40, 10**20)', math.log(10**40, 10**20), 2)
- self.assertEquals(math.log(INF), INF)
+ self.assertEqual(math.log(INF), INF)
self.assertRaises(ValueError, math.log, NINF)
- self.assert_(math.isnan(math.log(NAN)))
+ self.assertTrue(math.isnan(math.log(NAN)))
def testLog1p(self):
self.assertRaises(TypeError, math.log1p)
@@ -528,21 +606,21 @@ class MathTests(unittest.TestCase):
self.ftest('log1p(0)', math.log1p(0), 0)
self.ftest('log1p(e-1)', math.log1p(math.e-1), 1)
self.ftest('log1p(1)', math.log1p(1), math.log(2))
- self.assertEquals(math.log1p(INF), INF)
+ self.assertEqual(math.log1p(INF), INF)
self.assertRaises(ValueError, math.log1p, NINF)
- self.assert_(math.isnan(math.log1p(NAN)))
+ self.assertTrue(math.isnan(math.log1p(NAN)))
n= 2**90
- self.assertAlmostEquals(math.log1p(n), 62.383246250395075)
- self.assertAlmostEquals(math.log1p(n), math.log1p(float(n)))
+ self.assertAlmostEqual(math.log1p(n), 62.383246250395075)
+ self.assertAlmostEqual(math.log1p(n), math.log1p(float(n)))
def testLog10(self):
self.assertRaises(TypeError, math.log10)
self.ftest('log10(0.1)', math.log10(0.1), -1)
self.ftest('log10(1)', math.log10(1), 0)
self.ftest('log10(10)', math.log10(10), 1)
- self.assertEquals(math.log(INF), INF)
+ self.assertEqual(math.log(INF), INF)
self.assertRaises(ValueError, math.log10, NINF)
- self.assert_(math.isnan(math.log10(NAN)))
+ self.assertTrue(math.isnan(math.log10(NAN)))
def testModf(self):
self.assertRaises(TypeError, math.modf)
@@ -556,12 +634,12 @@ class MathTests(unittest.TestCase):
testmodf('modf(1.5)', math.modf(1.5), (0.5, 1.0))
testmodf('modf(-1.5)', math.modf(-1.5), (-0.5, -1.0))
- self.assertEquals(math.modf(INF), (0.0, INF))
- self.assertEquals(math.modf(NINF), (-0.0, NINF))
+ self.assertEqual(math.modf(INF), (0.0, INF))
+ self.assertEqual(math.modf(NINF), (-0.0, NINF))
modf_nan = math.modf(NAN)
- self.assert_(math.isnan(modf_nan[0]))
- self.assert_(math.isnan(modf_nan[1]))
+ self.assertTrue(math.isnan(modf_nan[0]))
+ self.assertTrue(math.isnan(modf_nan[1]))
def testPow(self):
self.assertRaises(TypeError, math.pow)
@@ -573,9 +651,9 @@ class MathTests(unittest.TestCase):
self.assertEqual(math.pow(NINF, 1), NINF)
self.assertEqual((math.pow(1, INF)), 1.)
self.assertEqual((math.pow(1, NINF)), 1.)
- self.assert_(math.isnan(math.pow(NAN, 1)))
- self.assert_(math.isnan(math.pow(2, NAN)))
- self.assert_(math.isnan(math.pow(0, NAN)))
+ self.assertTrue(math.isnan(math.pow(NAN, 1)))
+ self.assertTrue(math.isnan(math.pow(2, NAN)))
+ self.assertTrue(math.isnan(math.pow(0, NAN)))
self.assertEqual(math.pow(1, NAN), 1)
# pow(0., x)
@@ -589,7 +667,7 @@ class MathTests(unittest.TestCase):
self.assertRaises(ValueError, math.pow, 0., -2.3)
self.assertRaises(ValueError, math.pow, 0., -3.)
self.assertRaises(ValueError, math.pow, 0., NINF)
- self.assert_(math.isnan(math.pow(0., NAN)))
+ self.assertTrue(math.isnan(math.pow(0., NAN)))
# pow(INF, x)
self.assertEqual(math.pow(INF, INF), INF)
@@ -602,7 +680,7 @@ class MathTests(unittest.TestCase):
self.assertEqual(math.pow(INF, -2.3), 0.)
self.assertEqual(math.pow(INF, -3.), 0.)
self.assertEqual(math.pow(INF, NINF), 0.)
- self.assert_(math.isnan(math.pow(INF, NAN)))
+ self.assertTrue(math.isnan(math.pow(INF, NAN)))
# pow(-0., x)
self.assertEqual(math.pow(-0., INF), 0.)
@@ -615,7 +693,7 @@ class MathTests(unittest.TestCase):
self.assertRaises(ValueError, math.pow, -0., -2.3)
self.assertRaises(ValueError, math.pow, -0., -3.)
self.assertRaises(ValueError, math.pow, -0., NINF)
- self.assert_(math.isnan(math.pow(-0., NAN)))
+ self.assertTrue(math.isnan(math.pow(-0., NAN)))
# pow(NINF, x)
self.assertEqual(math.pow(NINF, INF), INF)
@@ -628,7 +706,7 @@ class MathTests(unittest.TestCase):
self.assertEqual(math.pow(NINF, -2.3), 0.)
self.assertEqual(math.pow(NINF, -3.), -0.)
self.assertEqual(math.pow(NINF, NINF), 0.)
- self.assert_(math.isnan(math.pow(NINF, NAN)))
+ self.assertTrue(math.isnan(math.pow(NINF, NAN)))
# pow(-1, x)
self.assertEqual(math.pow(-1., INF), 1.)
@@ -641,7 +719,7 @@ class MathTests(unittest.TestCase):
self.assertRaises(ValueError, math.pow, -1., -2.3)
self.assertEqual(math.pow(-1., -3.), -1.)
self.assertEqual(math.pow(-1., NINF), 1.)
- self.assert_(math.isnan(math.pow(-1., NAN)))
+ self.assertTrue(math.isnan(math.pow(-1., NAN)))
# pow(1, x)
self.assertEqual(math.pow(1., INF), 1.)
@@ -702,7 +780,7 @@ class MathTests(unittest.TestCase):
# the following tests have been commented out since they don't
# really belong here: the implementation of ** for floats is
- # independent of the implemention of math.pow
+ # independent of the implementation of math.pow
#self.assertEqual(1**NAN, 1)
#self.assertEqual(1**INF, 1)
#self.assertEqual(1**NINF, 1)
@@ -724,30 +802,30 @@ class MathTests(unittest.TestCase):
self.ftest('sin(pi/2)', math.sin(math.pi/2), 1)
self.ftest('sin(-pi/2)', math.sin(-math.pi/2), -1)
try:
- self.assert_(math.isnan(math.sin(INF)))
- self.assert_(math.isnan(math.sin(NINF)))
+ self.assertTrue(math.isnan(math.sin(INF)))
+ self.assertTrue(math.isnan(math.sin(NINF)))
except ValueError:
self.assertRaises(ValueError, math.sin, INF)
self.assertRaises(ValueError, math.sin, NINF)
- self.assert_(math.isnan(math.sin(NAN)))
+ self.assertTrue(math.isnan(math.sin(NAN)))
def testSinh(self):
self.assertRaises(TypeError, math.sinh)
self.ftest('sinh(0)', math.sinh(0), 0)
self.ftest('sinh(1)**2-cosh(1)**2', math.sinh(1)**2-math.cosh(1)**2, -1)
self.ftest('sinh(1)+sinh(-1)', math.sinh(1)+math.sinh(-1), 0)
- self.assertEquals(math.sinh(INF), INF)
- self.assertEquals(math.sinh(NINF), NINF)
- self.assert_(math.isnan(math.sinh(NAN)))
+ self.assertEqual(math.sinh(INF), INF)
+ self.assertEqual(math.sinh(NINF), NINF)
+ self.assertTrue(math.isnan(math.sinh(NAN)))
def testSqrt(self):
self.assertRaises(TypeError, math.sqrt)
self.ftest('sqrt(0)', math.sqrt(0), 0)
self.ftest('sqrt(1)', math.sqrt(1), 1)
self.ftest('sqrt(4)', math.sqrt(4), 2)
- self.assertEquals(math.sqrt(INF), INF)
+ self.assertEqual(math.sqrt(INF), INF)
self.assertRaises(ValueError, math.sqrt, NINF)
- self.assert_(math.isnan(math.sqrt(NAN)))
+ self.assertTrue(math.isnan(math.sqrt(NAN)))
def testTan(self):
self.assertRaises(TypeError, math.tan)
@@ -755,12 +833,12 @@ class MathTests(unittest.TestCase):
self.ftest('tan(pi/4)', math.tan(math.pi/4), 1)
self.ftest('tan(-pi/4)', math.tan(-math.pi/4), -1)
try:
- self.assert_(math.isnan(math.tan(INF)))
- self.assert_(math.isnan(math.tan(NINF)))
+ self.assertTrue(math.isnan(math.tan(INF)))
+ self.assertTrue(math.isnan(math.tan(NINF)))
except:
self.assertRaises(ValueError, math.tan, INF)
self.assertRaises(ValueError, math.tan, NINF)
- self.assert_(math.isnan(math.tan(NAN)))
+ self.assertTrue(math.isnan(math.tan(NAN)))
def testTanh(self):
self.assertRaises(TypeError, math.tanh)
@@ -768,7 +846,7 @@ class MathTests(unittest.TestCase):
self.ftest('tanh(1)+tanh(-1)', math.tanh(1)+math.tanh(-1), 0)
self.ftest('tanh(inf)', math.tanh(INF), 1)
self.ftest('tanh(-inf)', math.tanh(NINF), -1)
- self.assert_(math.isnan(math.tanh(NAN)))
+ self.assertTrue(math.isnan(math.tanh(NAN)))
# check that tanh(-0.) == -0. on IEEE 754 systems
if float.__getformat__("double").startswith("IEEE"):
self.assertEqual(math.tanh(-0.), -0.)
@@ -798,29 +876,24 @@ class MathTests(unittest.TestCase):
self.assertRaises(TypeError, math.trunc)
self.assertRaises(TypeError, math.trunc, 1, 2)
- # XXX: This is not ideal, but see the comment in math_trunc().
- self.assertRaises(AttributeError, math.trunc, TestNoTrunc())
-
- t = TestNoTrunc()
- t.__trunc__ = lambda *args: args
- self.assertEquals((), math.trunc(t))
- self.assertRaises(TypeError, math.trunc, t, 0)
+ self.assertRaises((AttributeError, TypeError), math.trunc,
+ TestNoTrunc())
def testIsnan(self):
- self.assert_(math.isnan(float("nan")))
- self.assert_(math.isnan(float("inf")* 0.))
- self.failIf(math.isnan(float("inf")))
- self.failIf(math.isnan(0.))
- self.failIf(math.isnan(1.))
+ self.assertTrue(math.isnan(float("nan")))
+ self.assertTrue(math.isnan(float("inf")* 0.))
+ self.assertFalse(math.isnan(float("inf")))
+ self.assertFalse(math.isnan(0.))
+ self.assertFalse(math.isnan(1.))
def testIsinf(self):
- self.assert_(math.isinf(float("inf")))
- self.assert_(math.isinf(float("-inf")))
- self.assert_(math.isinf(1E400))
- self.assert_(math.isinf(-1E400))
- self.failIf(math.isinf(float("nan")))
- self.failIf(math.isinf(0.))
- self.failIf(math.isinf(1.))
+ self.assertTrue(math.isinf(float("inf")))
+ self.assertTrue(math.isinf(float("-inf")))
+ self.assertTrue(math.isinf(1E400))
+ self.assertTrue(math.isinf(-1E400))
+ self.assertFalse(math.isinf(float("nan")))
+ self.assertFalse(math.isinf(0.))
+ self.assertFalse(math.isinf(1.))
# RED_FLAG 16-Oct-2000 Tim
# While 2.0 is more consistent about exceptions than previous releases, it
@@ -860,9 +933,8 @@ class MathTests(unittest.TestCase):
else:
self.fail("sqrt(-1) didn't raise ValueError")
+ @requires_IEEE_754
def test_testfile(self):
- if not float.__getformat__("double").startswith("IEEE"):
- return
for id, fn, ar, ai, er, ei, flags in parse_testfile(test_file):
# Skip if either the input or result is complex, or if
# flags is nonempty
@@ -884,6 +956,69 @@ class MathTests(unittest.TestCase):
self.fail(message)
self.ftest("%s:%s(%r)" % (id, fn, ar), result, er)
+ @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"),
+ "test requires IEEE 754 doubles")
+ def test_mtestfile(self):
+ ALLOWED_ERROR = 20 # permitted error, in ulps
+ fail_fmt = "{}:{}({!r}): expected {!r}, got {!r}"
+
+ failures = []
+ for id, fn, arg, expected, flags in parse_mtestfile(math_testcases):
+ func = getattr(math, fn)
+
+ if 'invalid' in flags or 'divide-by-zero' in flags:
+ expected = 'ValueError'
+ elif 'overflow' in flags:
+ expected = 'OverflowError'
+
+ try:
+ got = func(arg)
+ except ValueError:
+ got = 'ValueError'
+ except OverflowError:
+ got = 'OverflowError'
+
+ accuracy_failure = None
+ if isinstance(got, float) and isinstance(expected, float):
+ if math.isnan(expected) and math.isnan(got):
+ continue
+ if not math.isnan(expected) and not math.isnan(got):
+ if fn == 'lgamma':
+ # we use a weaker accuracy test for lgamma;
+ # lgamma only achieves an absolute error of
+ # a few multiples of the machine accuracy, in
+ # general.
+ accuracy_failure = acc_check(expected, got,
+ rel_err = 5e-15,
+ abs_err = 5e-15)
+ elif fn == 'erfc':
+ # erfc has less-than-ideal accuracy for large
+ # arguments (x ~ 25 or so), mainly due to the
+ # error involved in computing exp(-x*x).
+ #
+ # XXX Would be better to weaken this test only
+ # for large x, instead of for all x.
+ accuracy_failure = ulps_check(expected, got, 2000)
+
+ else:
+ accuracy_failure = ulps_check(expected, got, 20)
+ if accuracy_failure is None:
+ continue
+
+ if isinstance(got, str) and isinstance(expected, str):
+ if got == expected:
+ continue
+
+ fail_msg = fail_fmt.format(id, fn, arg, expected, got)
+ if accuracy_failure is not None:
+ fail_msg += ' ({})'.format(accuracy_failure)
+ failures.append(fail_msg)
+
+ if failures:
+ self.fail('Failures in test_mtestfile:\n ' +
+ '\n '.join(failures))
+
+
def test_main():
from doctest import DocFileSuite
suite = unittest.TestSuite()
diff --git a/Lib/test/test_memoryio.py b/Lib/test/test_memoryio.py
index 85b5e13cdd..68657aaf4b 100644
--- a/Lib/test/test_memoryio.py
+++ b/Lib/test/test_memoryio.py
@@ -4,23 +4,66 @@ BytesIO -- for bytes
"""
from __future__ import unicode_literals
+from __future__ import print_function
import unittest
-from test import test_support
+from test import test_support as support
import io
-import sys
-import array
+import _pyio as pyio
+import pickle
-try:
- import _bytesio
- has_c_implementation = True
-except ImportError:
- has_c_implementation = False
+class MemorySeekTestMixin:
+
+ def testInit(self):
+ buf = self.buftype("1234567890")
+ bytesIo = self.ioclass(buf)
+
+ def testRead(self):
+ buf = self.buftype("1234567890")
+ bytesIo = self.ioclass(buf)
+
+ self.assertEqual(buf[:1], bytesIo.read(1))
+ self.assertEqual(buf[1:5], bytesIo.read(4))
+ self.assertEqual(buf[5:], bytesIo.read(900))
+ self.assertEqual(self.EOF, bytesIo.read())
+
+ def testReadNoArgs(self):
+ buf = self.buftype("1234567890")
+ bytesIo = self.ioclass(buf)
+
+ self.assertEqual(buf, bytesIo.read())
+ self.assertEqual(self.EOF, bytesIo.read())
+
+ def testSeek(self):
+ buf = self.buftype("1234567890")
+ bytesIo = self.ioclass(buf)
+
+ bytesIo.read(5)
+ bytesIo.seek(0)
+ self.assertEqual(buf, bytesIo.read())
+
+ bytesIo.seek(3)
+ self.assertEqual(buf[3:], bytesIo.read())
+ self.assertRaises(TypeError, bytesIo.seek, 0.0)
+
+ def testTell(self):
+ buf = self.buftype("1234567890")
+ bytesIo = self.ioclass(buf)
+
+ self.assertEqual(0, bytesIo.tell())
+ bytesIo.seek(5)
+ self.assertEqual(5, bytesIo.tell())
+ bytesIo.seek(10000)
+ self.assertEqual(10000, bytesIo.tell())
class MemoryTestMixin:
+ def test_detach(self):
+ buf = self.ioclass()
+ self.assertRaises(self.UnsupportedOperation, buf.detach)
+
def write_ops(self, f, t):
self.assertEqual(f.write(t("blah.")), 5)
self.assertEqual(f.seek(0), 0)
@@ -157,7 +200,7 @@ class MemoryTestMixin:
self.assertEqual(memio.readline(), self.EOF)
memio.seek(0)
self.assertEqual(type(memio.readline()), type(buf))
- self.assertEqual(memio.readline(None), buf)
+ self.assertEqual(memio.readline(), buf)
self.assertRaises(TypeError, memio.readline, '')
memio.close()
self.assertRaises(ValueError, memio.readline)
@@ -189,8 +232,8 @@ class MemoryTestMixin:
memio = self.ioclass(buf * 10)
self.assertEqual(iter(memio), memio)
- self.failUnless(hasattr(memio, '__iter__'))
- self.failUnless(hasattr(memio, 'next'))
+ self.assertTrue(hasattr(memio, '__iter__'))
+ self.assertTrue(hasattr(memio, 'next'))
i = 0
for line in memio:
self.assertEqual(line, buf)
@@ -204,7 +247,7 @@ class MemoryTestMixin:
self.assertEqual(i, 10)
memio = self.ioclass(buf * 2)
memio.close()
- self.assertRaises(ValueError, memio.next)
+ self.assertRaises(ValueError, next, memio)
def test_getvalue(self):
buf = self.buftype("1234567890")
@@ -307,12 +350,58 @@ class MemoryTestMixin:
self.assertEqual(test1(), buf)
self.assertEqual(test2(), buf)
+ def test_instance_dict_leak(self):
+ # Test case for issue #6242.
+ # This will be caught by regrtest.py -R if this leak.
+ for _ in range(100):
+ memio = self.ioclass()
+ memio.foo = 1
+
+ def test_pickling(self):
+ buf = self.buftype("1234567890")
+ memio = self.ioclass(buf)
+ memio.foo = 42
+ memio.seek(2)
+
+ class PickleTestMemIO(self.ioclass):
+ def __init__(me, initvalue, foo):
+ self.ioclass.__init__(me, initvalue)
+ me.foo = foo
+ # __getnewargs__ is undefined on purpose. This checks that PEP 307
+ # is used to provide pickling support.
+
+ # Pickle expects the class to be on the module level. Here we use a
+ # little hack to allow the PickleTestMemIO class to derive from
+ # self.ioclass without having to define all combinations explicitly on
+ # the module-level.
+ import __main__
+ PickleTestMemIO.__module__ = '__main__'
+ __main__.PickleTestMemIO = PickleTestMemIO
+ submemio = PickleTestMemIO(buf, 80)
+ submemio.seek(2)
+
+ # We only support pickle protocol 2 and onward since we use extended
+ # __reduce__ API of PEP 307 to provide pickling support.
+ for proto in range(2, pickle.HIGHEST_PROTOCOL):
+ for obj in (memio, submemio):
+ obj2 = pickle.loads(pickle.dumps(obj, protocol=proto))
+ self.assertEqual(obj.getvalue(), obj2.getvalue())
+ self.assertEqual(obj.__class__, obj2.__class__)
+ self.assertEqual(obj.foo, obj2.foo)
+ self.assertEqual(obj.tell(), obj2.tell())
+ obj.close()
+ self.assertRaises(ValueError, pickle.dumps, obj, proto)
+ del __main__.PickleTestMemIO
+
+
+class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase):
+
+ UnsupportedOperation = pyio.UnsupportedOperation
-class PyBytesIOTest(MemoryTestMixin, unittest.TestCase):
@staticmethod
def buftype(s):
return s.encode("ascii")
- ioclass = io._BytesIO
+ ioclass = pyio.BytesIO
EOF = b""
def test_read1(self):
@@ -342,12 +431,18 @@ class PyBytesIOTest(MemoryTestMixin, unittest.TestCase):
self.assertEqual(memio.readinto(b), 0)
self.assertEqual(b, b"")
self.assertRaises(TypeError, memio.readinto, '')
- a = array.array(b'b', map(ord, b"hello world"))
+ import array
+ a = array.array(b'b', b"hello world")
memio = self.ioclass(buf)
memio.readinto(a)
self.assertEqual(a.tostring(), b"1234567890d")
memio.close()
self.assertRaises(ValueError, memio.readinto, b)
+ memio = self.ioclass(b"123")
+ b = bytearray()
+ memio.seek(42)
+ memio.readinto(b)
+ self.assertEqual(b, b"")
def test_relative_seek(self):
buf = self.buftype("1234567890")
@@ -374,18 +469,39 @@ class PyBytesIOTest(MemoryTestMixin, unittest.TestCase):
def test_bytes_array(self):
buf = b"1234567890"
-
- a = array.array(b'b', map(ord, buf))
+ import array
+ a = array.array(b'b', buf)
memio = self.ioclass(a)
self.assertEqual(memio.getvalue(), buf)
self.assertEqual(memio.write(a), 10)
self.assertEqual(memio.getvalue(), buf)
-
-class PyStringIOTest(MemoryTestMixin, unittest.TestCase):
- buftype = unicode
- ioclass = io.StringIO
- EOF = ""
+ def test_issue5449(self):
+ buf = self.buftype("1234567890")
+ self.ioclass(initial_bytes=buf)
+ self.assertRaises(TypeError, self.ioclass, buf, foo=None)
+
+
+class TextIOTestMixin:
+
+ def test_newlines_property(self):
+ memio = self.ioclass(newline=None)
+ # The C StringIO decodes newlines in write() calls, but the Python
+ # implementation only does when reading. This function forces them to
+ # be decoded for testing.
+ def force_decode():
+ memio.seek(0)
+ memio.read()
+ self.assertEqual(memio.newlines, None)
+ memio.write("a\n")
+ force_decode()
+ self.assertEqual(memio.newlines, "\n")
+ memio.write("b\r\n")
+ force_decode()
+ self.assertEqual(memio.newlines, ("\n", "\r\n"))
+ memio.write("c\rd")
+ force_decode()
+ self.assertEqual(memio.newlines, ("\r", "\n", "\r\n"))
def test_relative_seek(self):
memio = self.ioclass()
@@ -397,29 +513,195 @@ class PyStringIOTest(MemoryTestMixin, unittest.TestCase):
self.assertRaises(IOError, memio.seek, 1, 1)
self.assertRaises(IOError, memio.seek, 1, 2)
+ def test_textio_properties(self):
+ memio = self.ioclass()
+
+ # These are just dummy values but we nevertheless check them for fear
+ # of unexpected breakage.
+ self.assertIsNone(memio.encoding)
+ self.assertIsNone(memio.errors)
+ self.assertFalse(memio.line_buffering)
+
+ def test_newline_none(self):
+ # newline=None
+ memio = self.ioclass("a\nb\r\nc\rd", newline=None)
+ self.assertEqual(list(memio), ["a\n", "b\n", "c\n", "d"])
+ memio.seek(0)
+ self.assertEqual(memio.read(1), "a")
+ self.assertEqual(memio.read(2), "\nb")
+ self.assertEqual(memio.read(2), "\nc")
+ self.assertEqual(memio.read(1), "\n")
+ memio = self.ioclass(newline=None)
+ self.assertEqual(2, memio.write("a\n"))
+ self.assertEqual(3, memio.write("b\r\n"))
+ self.assertEqual(3, memio.write("c\rd"))
+ memio.seek(0)
+ self.assertEqual(memio.read(), "a\nb\nc\nd")
+ memio = self.ioclass("a\r\nb", newline=None)
+ self.assertEqual(memio.read(3), "a\nb")
+
+ def test_newline_empty(self):
+ # newline=""
+ memio = self.ioclass("a\nb\r\nc\rd", newline="")
+ self.assertEqual(list(memio), ["a\n", "b\r\n", "c\r", "d"])
+ memio.seek(0)
+ self.assertEqual(memio.read(4), "a\nb\r")
+ self.assertEqual(memio.read(2), "\nc")
+ self.assertEqual(memio.read(1), "\r")
+ memio = self.ioclass(newline="")
+ self.assertEqual(2, memio.write("a\n"))
+ self.assertEqual(2, memio.write("b\r"))
+ self.assertEqual(2, memio.write("\nc"))
+ self.assertEqual(2, memio.write("\rd"))
+ memio.seek(0)
+ self.assertEqual(list(memio), ["a\n", "b\r\n", "c\r", "d"])
+
+ def test_newline_lf(self):
+ # newline="\n"
+ memio = self.ioclass("a\nb\r\nc\rd")
+ self.assertEqual(list(memio), ["a\n", "b\r\n", "c\rd"])
+
+ def test_newline_cr(self):
+ # newline="\r"
+ memio = self.ioclass("a\nb\r\nc\rd", newline="\r")
+ self.assertEqual(memio.read(), "a\rb\r\rc\rd")
+ memio.seek(0)
+ self.assertEqual(list(memio), ["a\r", "b\r", "\r", "c\r", "d"])
+
+ def test_newline_crlf(self):
+ # newline="\r\n"
+ memio = self.ioclass("a\nb\r\nc\rd", newline="\r\n")
+ self.assertEqual(memio.read(), "a\r\nb\r\r\nc\rd")
+ memio.seek(0)
+ self.assertEqual(list(memio), ["a\r\n", "b\r\r\n", "c\rd"])
+
+ def test_issue5265(self):
+ # StringIO can duplicate newlines in universal newlines mode
+ memio = self.ioclass("a\r\nb\r\n", newline=None)
+ self.assertEqual(memio.read(5), "a\nb\n")
+
+
+class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin,
+ TextIOTestMixin, unittest.TestCase):
+ buftype = unicode
+ ioclass = pyio.StringIO
+ UnsupportedOperation = pyio.UnsupportedOperation
+ EOF = ""
+
+
+class PyStringIOPickleTest(TextIOTestMixin, unittest.TestCase):
+ """Test if pickle restores properly the internal state of StringIO.
+ """
+ buftype = unicode
+ UnsupportedOperation = pyio.UnsupportedOperation
+ EOF = ""
+
+ class ioclass(pyio.StringIO):
+ def __new__(cls, *args, **kwargs):
+ return pickle.loads(pickle.dumps(pyio.StringIO(*args, **kwargs)))
+ def __init__(self, *args, **kwargs):
+ pass
+
+
+class CBytesIOTest(PyBytesIOTest):
+ ioclass = io.BytesIO
+ UnsupportedOperation = io.UnsupportedOperation
+
+ test_bytes_array = unittest.skip(
+ "array.array() does not have the new buffer API"
+ )(PyBytesIOTest.test_bytes_array)
+
+
+ def test_getstate(self):
+ memio = self.ioclass()
+ state = memio.__getstate__()
+ self.assertEqual(len(state), 3)
+ bytearray(state[0]) # Check if state[0] supports the buffer interface.
+ self.assertIsInstance(state[1], int)
+ self.assertTrue(isinstance(state[2], dict) or state[2] is None)
+ memio.close()
+ self.assertRaises(ValueError, memio.__getstate__)
+
+ def test_setstate(self):
+ # This checks whether __setstate__ does proper input validation.
+ memio = self.ioclass()
+ memio.__setstate__((b"no error", 0, None))
+ memio.__setstate__((bytearray(b"no error"), 0, None))
+ memio.__setstate__((b"no error", 0, {'spam': 3}))
+ self.assertRaises(ValueError, memio.__setstate__, (b"", -1, None))
+ self.assertRaises(TypeError, memio.__setstate__, ("unicode", 0, None))
+ self.assertRaises(TypeError, memio.__setstate__, (b"", 0.0, None))
+ self.assertRaises(TypeError, memio.__setstate__, (b"", 0, 0))
+ self.assertRaises(TypeError, memio.__setstate__, (b"len-test", 0))
+ self.assertRaises(TypeError, memio.__setstate__)
+ self.assertRaises(TypeError, memio.__setstate__, 0)
+ memio.close()
+ self.assertRaises(ValueError, memio.__setstate__, (b"closed", 0, None))
+
+
+class CStringIOTest(PyStringIOTest):
+ ioclass = io.StringIO
+ UnsupportedOperation = io.UnsupportedOperation
+
# XXX: For the Python version of io.StringIO, this is highly
# dependent on the encoding used for the underlying buffer.
- # def test_widechar(self):
- # buf = self.buftype("\U0002030a\U00020347")
- # memio = self.ioclass(buf)
- #
- # self.assertEqual(memio.getvalue(), buf)
- # self.assertEqual(memio.write(buf), len(buf))
- # self.assertEqual(memio.tell(), len(buf))
- # self.assertEqual(memio.getvalue(), buf)
- # self.assertEqual(memio.write(buf), len(buf))
- # self.assertEqual(memio.tell(), len(buf) * 2)
- # self.assertEqual(memio.getvalue(), buf + buf)
-
-if has_c_implementation:
- class CBytesIOTest(PyBytesIOTest):
- ioclass = io.BytesIO
+ def test_widechar(self):
+ buf = self.buftype("\U0002030a\U00020347")
+ memio = self.ioclass(buf)
+
+ self.assertEqual(memio.getvalue(), buf)
+ self.assertEqual(memio.write(buf), len(buf))
+ self.assertEqual(memio.tell(), len(buf))
+ self.assertEqual(memio.getvalue(), buf)
+ self.assertEqual(memio.write(buf), len(buf))
+ self.assertEqual(memio.tell(), len(buf) * 2)
+ self.assertEqual(memio.getvalue(), buf + buf)
+
+ def test_getstate(self):
+ memio = self.ioclass()
+ state = memio.__getstate__()
+ self.assertEqual(len(state), 4)
+ self.assertIsInstance(state[0], unicode)
+ self.assertIsInstance(state[1], str)
+ self.assertIsInstance(state[2], int)
+ self.assertTrue(isinstance(state[3], dict) or state[3] is None)
+ memio.close()
+ self.assertRaises(ValueError, memio.__getstate__)
+
+ def test_setstate(self):
+ # This checks whether __setstate__ does proper input validation.
+ memio = self.ioclass()
+ memio.__setstate__(("no error", "\n", 0, None))
+ memio.__setstate__(("no error", "", 0, {'spam': 3}))
+ self.assertRaises(ValueError, memio.__setstate__, ("", "f", 0, None))
+ self.assertRaises(ValueError, memio.__setstate__, ("", "", -1, None))
+ self.assertRaises(TypeError, memio.__setstate__, (b"", "", 0, None))
+ # trunk is more tolerant than py3k on the type of the newline param
+ #self.assertRaises(TypeError, memio.__setstate__, ("", b"", 0, None))
+ self.assertRaises(TypeError, memio.__setstate__, ("", "", 0.0, None))
+ self.assertRaises(TypeError, memio.__setstate__, ("", "", 0, 0))
+ self.assertRaises(TypeError, memio.__setstate__, ("len-test", 0))
+ self.assertRaises(TypeError, memio.__setstate__)
+ self.assertRaises(TypeError, memio.__setstate__, 0)
+ memio.close()
+ self.assertRaises(ValueError, memio.__setstate__, ("closed", "", 0, None))
+
+
+class CStringIOPickleTest(PyStringIOPickleTest):
+ UnsupportedOperation = io.UnsupportedOperation
+
+ class ioclass(io.StringIO):
+ def __new__(cls, *args, **kwargs):
+ return pickle.loads(pickle.dumps(io.StringIO(*args, **kwargs),
+ protocol=2))
+ def __init__(self, *args, **kwargs):
+ pass
+
def test_main():
- tests = [PyBytesIOTest, PyStringIOTest]
- if has_c_implementation:
- tests.extend([CBytesIOTest])
- test_support.run_unittest(*tests)
+ tests = [PyBytesIOTest, PyStringIOTest, CBytesIOTest, CStringIOTest,
+ PyStringIOPickleTest, CStringIOPickleTest]
+ support.run_unittest(*tests)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_memoryview.py b/Lib/test/test_memoryview.py
new file mode 100644
index 0000000000..525ddeab23
--- /dev/null
+++ b/Lib/test/test_memoryview.py
@@ -0,0 +1,361 @@
+"""Unit tests for the memoryview
+
+XXX We need more tests! Some tests are in test_bytes
+"""
+
+import unittest
+import sys
+import gc
+import weakref
+import array
+from test import test_support
+import io
+
+
+class AbstractMemoryTests:
+ source_bytes = b"abcdef"
+
+ @property
+ def _source(self):
+ return self.source_bytes
+
+ @property
+ def _types(self):
+ return filter(None, [self.ro_type, self.rw_type])
+
+ def check_getitem_with_type(self, tp):
+ item = self.getitem_type
+ b = tp(self._source)
+ oldrefcount = sys.getrefcount(b)
+ m = self._view(b)
+ self.assertEqual(m[0], item(b"a"))
+ self.assertIsInstance(m[0], bytes)
+ self.assertEqual(m[5], item(b"f"))
+ self.assertEqual(m[-1], item(b"f"))
+ self.assertEqual(m[-6], item(b"a"))
+ # Bounds checking
+ self.assertRaises(IndexError, lambda: m[6])
+ self.assertRaises(IndexError, lambda: m[-7])
+ self.assertRaises(IndexError, lambda: m[sys.maxsize])
+ self.assertRaises(IndexError, lambda: m[-sys.maxsize])
+ # Type checking
+ self.assertRaises(TypeError, lambda: m[None])
+ self.assertRaises(TypeError, lambda: m[0.0])
+ self.assertRaises(TypeError, lambda: m["a"])
+ m = None
+ self.assertEqual(sys.getrefcount(b), oldrefcount)
+
+ def test_getitem(self):
+ for tp in self._types:
+ self.check_getitem_with_type(tp)
+
+ def test_iter(self):
+ for tp in self._types:
+ b = tp(self._source)
+ m = self._view(b)
+ self.assertEqual(list(m), [m[i] for i in range(len(m))])
+
+ def test_repr(self):
+ for tp in self._types:
+ b = tp(self._source)
+ m = self._view(b)
+ self.assertIsInstance(m.__repr__(), str)
+
+ def test_setitem_readonly(self):
+ if not self.ro_type:
+ return
+ b = self.ro_type(self._source)
+ oldrefcount = sys.getrefcount(b)
+ m = self._view(b)
+ def setitem(value):
+ m[0] = value
+ self.assertRaises(TypeError, setitem, b"a")
+ self.assertRaises(TypeError, setitem, 65)
+ self.assertRaises(TypeError, setitem, memoryview(b"a"))
+ m = None
+ self.assertEqual(sys.getrefcount(b), oldrefcount)
+
+ def test_setitem_writable(self):
+ if not self.rw_type:
+ return
+ tp = self.rw_type
+ b = self.rw_type(self._source)
+ oldrefcount = sys.getrefcount(b)
+ m = self._view(b)
+ m[0] = tp(b"0")
+ self._check_contents(tp, b, b"0bcdef")
+ m[1:3] = tp(b"12")
+ self._check_contents(tp, b, b"012def")
+ m[1:1] = tp(b"")
+ self._check_contents(tp, b, b"012def")
+ m[:] = tp(b"abcdef")
+ self._check_contents(tp, b, b"abcdef")
+
+ # Overlapping copies of a view into itself
+ m[0:3] = m[2:5]
+ self._check_contents(tp, b, b"cdedef")
+ m[:] = tp(b"abcdef")
+ m[2:5] = m[0:3]
+ self._check_contents(tp, b, b"ababcf")
+
+ def setitem(key, value):
+ m[key] = tp(value)
+ # Bounds checking
+ self.assertRaises(IndexError, setitem, 6, b"a")
+ self.assertRaises(IndexError, setitem, -7, b"a")
+ self.assertRaises(IndexError, setitem, sys.maxsize, b"a")
+ self.assertRaises(IndexError, setitem, -sys.maxsize, b"a")
+ # Wrong index/slice types
+ self.assertRaises(TypeError, setitem, 0.0, b"a")
+ self.assertRaises(TypeError, setitem, (0,), b"a")
+ self.assertRaises(TypeError, setitem, "a", b"a")
+ # Trying to resize the memory object
+ self.assertRaises(ValueError, setitem, 0, b"")
+ self.assertRaises(ValueError, setitem, 0, b"ab")
+ self.assertRaises(ValueError, setitem, slice(1,1), b"a")
+ self.assertRaises(ValueError, setitem, slice(0,2), b"a")
+
+ m = None
+ self.assertEqual(sys.getrefcount(b), oldrefcount)
+
+ def test_delitem(self):
+ for tp in self._types:
+ b = tp(self._source)
+ m = self._view(b)
+ with self.assertRaises(TypeError):
+ del m[1]
+ with self.assertRaises(TypeError):
+ del m[1:4]
+
+ def test_tobytes(self):
+ for tp in self._types:
+ m = self._view(tp(self._source))
+ b = m.tobytes()
+ # This calls self.getitem_type() on each separate byte of b"abcdef"
+ expected = b"".join(
+ self.getitem_type(c) for c in b"abcdef")
+ self.assertEqual(b, expected)
+ self.assertIsInstance(b, bytes)
+
+ def test_tolist(self):
+ for tp in self._types:
+ m = self._view(tp(self._source))
+ l = m.tolist()
+ self.assertEqual(l, map(ord, b"abcdef"))
+
+ def test_compare(self):
+ # memoryviews can compare for equality with other objects
+ # having the buffer interface.
+ for tp in self._types:
+ m = self._view(tp(self._source))
+ for tp_comp in self._types:
+ self.assertTrue(m == tp_comp(b"abcdef"))
+ self.assertFalse(m != tp_comp(b"abcdef"))
+ self.assertFalse(m == tp_comp(b"abcde"))
+ self.assertTrue(m != tp_comp(b"abcde"))
+ self.assertFalse(m == tp_comp(b"abcde1"))
+ self.assertTrue(m != tp_comp(b"abcde1"))
+ self.assertTrue(m == m)
+ self.assertTrue(m == m[:])
+ self.assertTrue(m[0:6] == m[:])
+ self.assertFalse(m[0:5] == m)
+
+ # Comparison with objects which don't support the buffer API
+ self.assertFalse(m == u"abcdef")
+ self.assertTrue(m != u"abcdef")
+ self.assertFalse(u"abcdef" == m)
+ self.assertTrue(u"abcdef" != m)
+
+ # Unordered comparisons are unimplemented, and therefore give
+ # arbitrary results (they raise a TypeError in py3k)
+
+ def check_attributes_with_type(self, tp):
+ m = self._view(tp(self._source))
+ self.assertEqual(m.format, self.format)
+ self.assertIsInstance(m.format, str)
+ self.assertEqual(m.itemsize, self.itemsize)
+ self.assertEqual(m.ndim, 1)
+ self.assertEqual(m.shape, (6,))
+ self.assertEqual(len(m), 6)
+ self.assertEqual(m.strides, (self.itemsize,))
+ self.assertEqual(m.suboffsets, None)
+ return m
+
+ def test_attributes_readonly(self):
+ if not self.ro_type:
+ return
+ m = self.check_attributes_with_type(self.ro_type)
+ self.assertEqual(m.readonly, True)
+
+ def test_attributes_writable(self):
+ if not self.rw_type:
+ return
+ m = self.check_attributes_with_type(self.rw_type)
+ self.assertEqual(m.readonly, False)
+
+ # Disabled: unicode uses the old buffer API in 2.x
+
+ #def test_getbuffer(self):
+ ## Test PyObject_GetBuffer() on a memoryview object.
+ #for tp in self._types:
+ #b = tp(self._source)
+ #oldrefcount = sys.getrefcount(b)
+ #m = self._view(b)
+ #oldviewrefcount = sys.getrefcount(m)
+ #s = unicode(m, "utf-8")
+ #self._check_contents(tp, b, s.encode("utf-8"))
+ #self.assertEqual(sys.getrefcount(m), oldviewrefcount)
+ #m = None
+ #self.assertEqual(sys.getrefcount(b), oldrefcount)
+
+ def test_gc(self):
+ for tp in self._types:
+ if not isinstance(tp, type):
+ # If tp is a factory rather than a plain type, skip
+ continue
+
+ class MySource(tp):
+ pass
+ class MyObject:
+ pass
+
+ # Create a reference cycle through a memoryview object
+ b = MySource(tp(b'abc'))
+ m = self._view(b)
+ o = MyObject()
+ b.m = m
+ b.o = o
+ wr = weakref.ref(o)
+ b = m = o = None
+ # The cycle must be broken
+ gc.collect()
+ self.assertTrue(wr() is None, wr())
+
+ def test_writable_readonly(self):
+ # Issue #10451: memoryview incorrectly exposes a readonly
+ # buffer as writable causing a segfault if using mmap
+ tp = self.ro_type
+ if tp is None:
+ return
+ b = tp(self._source)
+ m = self._view(b)
+ i = io.BytesIO(b'ZZZZ')
+ self.assertRaises(TypeError, i.readinto, m)
+
+# Variations on source objects for the buffer: bytes-like objects, then arrays
+# with itemsize > 1.
+# NOTE: support for multi-dimensional objects is unimplemented.
+
+class BaseBytesMemoryTests(AbstractMemoryTests):
+ ro_type = bytes
+ rw_type = bytearray
+ getitem_type = bytes
+ itemsize = 1
+ format = 'B'
+
+# Disabled: array.array() does not support the new buffer API in 2.x
+
+#class BaseArrayMemoryTests(AbstractMemoryTests):
+ #ro_type = None
+ #rw_type = lambda self, b: array.array('i', map(ord, b))
+ #getitem_type = lambda self, b: array.array('i', map(ord, b)).tostring()
+ #itemsize = array.array('i').itemsize
+ #format = 'i'
+
+ #def test_getbuffer(self):
+ ## XXX Test should be adapted for non-byte buffers
+ #pass
+
+ #def test_tolist(self):
+ ## XXX NotImplementedError: tolist() only supports byte views
+ #pass
+
+
+# Variations on indirection levels: memoryview, slice of memoryview,
+# slice of slice of memoryview.
+# This is important to test allocation subtleties.
+
+class BaseMemoryviewTests:
+ def _view(self, obj):
+ return memoryview(obj)
+
+ def _check_contents(self, tp, obj, contents):
+ self.assertEqual(obj, tp(contents))
+
+class BaseMemorySliceTests:
+ source_bytes = b"XabcdefY"
+
+ def _view(self, obj):
+ m = memoryview(obj)
+ return m[1:7]
+
+ def _check_contents(self, tp, obj, contents):
+ self.assertEqual(obj[1:7], tp(contents))
+
+ def test_refs(self):
+ for tp in self._types:
+ m = memoryview(tp(self._source))
+ oldrefcount = sys.getrefcount(m)
+ m[1:2]
+ self.assertEqual(sys.getrefcount(m), oldrefcount)
+
+class BaseMemorySliceSliceTests:
+ source_bytes = b"XabcdefY"
+
+ def _view(self, obj):
+ m = memoryview(obj)
+ return m[:7][1:]
+
+ def _check_contents(self, tp, obj, contents):
+ self.assertEqual(obj[1:7], tp(contents))
+
+
+# Concrete test classes
+
+class BytesMemoryviewTest(unittest.TestCase,
+ BaseMemoryviewTests, BaseBytesMemoryTests):
+
+ def test_constructor(self):
+ for tp in self._types:
+ ob = tp(self._source)
+ self.assertTrue(memoryview(ob))
+ self.assertTrue(memoryview(object=ob))
+ self.assertRaises(TypeError, memoryview)
+ self.assertRaises(TypeError, memoryview, ob, ob)
+ self.assertRaises(TypeError, memoryview, argument=ob)
+ self.assertRaises(TypeError, memoryview, ob, argument=True)
+
+#class ArrayMemoryviewTest(unittest.TestCase,
+ #BaseMemoryviewTests, BaseArrayMemoryTests):
+
+ #def test_array_assign(self):
+ ## Issue #4569: segfault when mutating a memoryview with itemsize != 1
+ #a = array.array('i', range(10))
+ #m = memoryview(a)
+ #new_a = array.array('i', range(9, -1, -1))
+ #m[:] = new_a
+ #self.assertEqual(a, new_a)
+
+
+class BytesMemorySliceTest(unittest.TestCase,
+ BaseMemorySliceTests, BaseBytesMemoryTests):
+ pass
+
+#class ArrayMemorySliceTest(unittest.TestCase,
+ #BaseMemorySliceTests, BaseArrayMemoryTests):
+ #pass
+
+class BytesMemorySliceSliceTest(unittest.TestCase,
+ BaseMemorySliceSliceTests, BaseBytesMemoryTests):
+ pass
+
+#class ArrayMemorySliceSliceTest(unittest.TestCase,
+ #BaseMemorySliceSliceTests, BaseArrayMemoryTests):
+ #pass
+
+
+def test_main():
+ test_support.run_unittest(__name__)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_mhlib.py b/Lib/test/test_mhlib.py
index 04571ea3f6..996df44415 100644
--- a/Lib/test/test_mhlib.py
+++ b/Lib/test/test_mhlib.py
@@ -7,7 +7,7 @@
### mhlib. It should.
import unittest
-from test.test_support import run_unittest, TESTFN, TestSkipped, import_module
+from test.test_support import run_unittest, TESTFN, import_module
import os, StringIO
import sys
mhlib = import_module('mhlib', deprecated=True)
@@ -21,8 +21,8 @@ if (sys.platform.startswith("win") or sys.platform=="riscos" or
# link counts, and that causes test_listfolders() here to get back
# an empty list from its call of listallfolders().
# The other tests here pass on Windows.
- raise TestSkipped("skipped on %s -- " % sys.platform +
- "too many Unix assumptions")
+ raise unittest.SkipTest("skipped on %s -- " % sys.platform +
+ "too many Unix assumptions")
_mhroot = TESTFN+"_MH"
_mhpath = os.path.join(_mhroot, "MH")
@@ -148,7 +148,7 @@ class MhlibTests(unittest.TestCase):
writeCurMessage('inbox', 2)
mh = getMH()
- eq = self.assertEquals
+ eq = self.assertEqual
eq(mh.getprofile('Editor'), 'emacs')
eq(mh.getprofile('not-set'), None)
eq(mh.getpath(), os.path.abspath(_mhpath))
@@ -171,7 +171,7 @@ class MhlibTests(unittest.TestCase):
def test_listfolders(self):
mh = getMH()
- eq = self.assertEquals
+ eq = self.assertEqual
folders = mh.listfolders()
folders.sort()
@@ -198,7 +198,7 @@ class MhlibTests(unittest.TestCase):
def test_sequence(self):
mh = getMH()
- eq = self.assertEquals
+ eq = self.assertEqual
writeCurMessage('wide', 55)
f = mh.openfolder('wide')
@@ -253,12 +253,12 @@ class MhlibTests(unittest.TestCase):
def test_modify(self):
mh = getMH()
- eq = self.assertEquals
+ eq = self.assertEqual
mh.makefolder("dummy1")
- self.assert_("dummy1" in mh.listfolders())
+ self.assertIn("dummy1", mh.listfolders())
path = os.path.join(_mhpath, "dummy1")
- self.assert_(os.path.exists(path))
+ self.assertTrue(os.path.exists(path))
f = mh.openfolder('dummy1')
def create(n):
@@ -310,12 +310,12 @@ class MhlibTests(unittest.TestCase):
mh.deletefolder('dummy1')
mh.deletefolder('dummy2')
- self.assert_('dummy1' not in mh.listfolders())
- self.assert_(not os.path.exists(path))
+ self.assertNotIn('dummy1', mh.listfolders())
+ self.assertTrue(not os.path.exists(path))
def test_read(self):
mh = getMH()
- eq = self.assertEquals
+ eq = self.assertEqual
f = mh.openfolder('inbox')
msg = f.openmessage(1)
diff --git a/Lib/test/test_mimetools.py b/Lib/test/test_mimetools.py
index ed01ede893..86a26dc7e5 100644
--- a/Lib/test/test_mimetools.py
+++ b/Lib/test/test_mimetools.py
@@ -31,7 +31,7 @@ class MimeToolsTest(unittest.TestCase):
s = set([""])
for i in xrange(100):
nb = mimetools.choose_boundary()
- self.assert_(nb not in s)
+ self.assertNotIn(nb, s)
s.add(nb)
def test_message(self):
diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py
index 0190c2f3ca..3508b56056 100644
--- a/Lib/test/test_mimetypes.py
+++ b/Lib/test/test_mimetypes.py
@@ -1,6 +1,7 @@
import mimetypes
import StringIO
import unittest
+import sys
from test import test_support
@@ -47,7 +48,7 @@ class MimeTypesTestCase(unittest.TestCase):
def test_guess_all_types(self):
eq = self.assertEqual
- unless = self.failUnless
+ unless = self.assertTrue
# First try strict. Use a set here for testing the results because if
# test_urllib2 is run before test_mimetypes, global state is modified
# such that the 'all' set will have more items in it.
@@ -62,8 +63,31 @@ class MimeTypesTestCase(unittest.TestCase):
eq(all, [])
+@unittest.skipUnless(sys.platform.startswith("win"), "Windows only")
+class Win32MimeTypesTestCase(unittest.TestCase):
+ def setUp(self):
+ # ensure all entries actually come from the Windows registry
+ self.original_types_map = mimetypes.types_map.copy()
+ mimetypes.types_map.clear()
+ mimetypes.init()
+ self.db = mimetypes.MimeTypes()
+
+ def tearDown(self):
+ # restore default settings
+ mimetypes.types_map.clear()
+ mimetypes.types_map.update(self.original_types_map)
+
+ def test_registry_parsing(self):
+ # the original, minimum contents of the MIME database in the
+ # Windows registry is undocumented AFAIK.
+ # Use file types that should *always* exist:
+ eq = self.assertEqual
+ eq(self.db.guess_type("foo.txt"), ("text/plain", None))
+
def test_main():
- test_support.run_unittest(MimeTypesTestCase)
+ test_support.run_unittest(MimeTypesTestCase,
+ Win32MimeTypesTestCase
+ )
if __name__ == "__main__":
diff --git a/Lib/test/test_minidom.py b/Lib/test/test_minidom.py
index 120c37cd74..7b7524a122 100644
--- a/Lib/test/test_minidom.py
+++ b/Lib/test/test_minidom.py
@@ -1,10 +1,8 @@
# test for xml.dom.minidom
-import os
-import sys
import pickle
from StringIO import StringIO
-from test.test_support import verbose, run_unittest, TestSkipped
+from test.test_support import verbose, run_unittest, findfile
import unittest
import xml.dom
@@ -15,12 +13,8 @@ from xml.dom.minidom import parse, Node, Document, parseString
from xml.dom.minidom import getDOMImplementation
-if __name__ == "__main__":
- base = sys.argv[0]
-else:
- base = __file__
-tstfile = os.path.join(os.path.dirname(base), "test"+os.extsep+"xml")
-del base
+tstfile = findfile("test.xml", subdir="xmltestdata")
+
# The tests of DocumentType importing use these helpers to construct
# the documents to work with, since not all DOM builders actually
@@ -52,26 +46,6 @@ def create_doc_with_doctype():
return doc
class MinidomTest(unittest.TestCase):
- def tearDown(self):
- try:
- Node.allnodes
- except AttributeError:
- # We don't actually have the minidom from the standard library,
- # but are picking up the PyXML version from site-packages.
- pass
- else:
- self.confirm(len(Node.allnodes) == 0,
- "assertion: len(Node.allnodes) == 0")
- if len(Node.allnodes):
- print "Garbage left over:"
- if verbose:
- print Node.allnodes.items()[0:10]
- else:
- # Don't print specific nodes if repeatable results
- # are needed
- print len(Node.allnodes)
- Node.allnodes = {}
-
def confirm(self, test, testname = "Test"):
self.assertTrue(test, testname)
@@ -734,7 +708,7 @@ class MinidomTest(unittest.TestCase):
def check_clone_attribute(self, deep, testName):
doc = parseString("<doc attr='value'/>")
attr = doc.documentElement.getAttributeNode("attr")
- self.failIfEqual(attr, None)
+ self.assertNotEqual(attr, None)
clone = attr.cloneNode(deep)
self.confirm(not clone.isSameNode(attr))
self.confirm(not attr.isSameNode(clone))
@@ -754,7 +728,7 @@ class MinidomTest(unittest.TestCase):
def check_clone_pi(self, deep, testName):
doc = parseString("<?target data?><doc/>")
pi = doc.firstChild
- self.assertEquals(pi.nodeType, Node.PROCESSING_INSTRUCTION_NODE)
+ self.assertEqual(pi.nodeType, Node.PROCESSING_INSTRUCTION_NODE)
clone = pi.cloneNode(deep)
self.confirm(clone.target == pi.target
and clone.data == pi.data)
@@ -790,12 +764,181 @@ class MinidomTest(unittest.TestCase):
"testNormalize -- single empty node removed")
doc.unlink()
+ def testNormalizeCombineAndNextSibling(self):
+ doc = parseString("<doc/>")
+ root = doc.documentElement
+ root.appendChild(doc.createTextNode("first"))
+ root.appendChild(doc.createTextNode("second"))
+ root.appendChild(doc.createElement("i"))
+ self.confirm(len(root.childNodes) == 3
+ and root.childNodes.length == 3,
+ "testNormalizeCombineAndNextSibling -- preparation")
+ doc.normalize()
+ self.confirm(len(root.childNodes) == 2
+ and root.childNodes.length == 2
+ and root.firstChild.data == "firstsecond"
+ and root.firstChild is not root.lastChild
+ and root.firstChild.nextSibling is root.lastChild
+ and root.firstChild.previousSibling is None
+ and root.lastChild.previousSibling is root.firstChild
+ and root.lastChild.nextSibling is None
+ , "testNormalizeCombinedAndNextSibling -- result")
+ doc.unlink()
+
+ def testNormalizeDeleteWithPrevSibling(self):
+ doc = parseString("<doc/>")
+ root = doc.documentElement
+ root.appendChild(doc.createTextNode("first"))
+ root.appendChild(doc.createTextNode(""))
+ self.confirm(len(root.childNodes) == 2
+ and root.childNodes.length == 2,
+ "testNormalizeDeleteWithPrevSibling -- preparation")
+ doc.normalize()
+ self.confirm(len(root.childNodes) == 1
+ and root.childNodes.length == 1
+ and root.firstChild.data == "first"
+ and root.firstChild is root.lastChild
+ and root.firstChild.nextSibling is None
+ and root.firstChild.previousSibling is None
+ , "testNormalizeDeleteWithPrevSibling -- result")
+ doc.unlink()
+
+ def testNormalizeDeleteWithNextSibling(self):
+ doc = parseString("<doc/>")
+ root = doc.documentElement
+ root.appendChild(doc.createTextNode(""))
+ root.appendChild(doc.createTextNode("second"))
+ self.confirm(len(root.childNodes) == 2
+ and root.childNodes.length == 2,
+ "testNormalizeDeleteWithNextSibling -- preparation")
+ doc.normalize()
+ self.confirm(len(root.childNodes) == 1
+ and root.childNodes.length == 1
+ and root.firstChild.data == "second"
+ and root.firstChild is root.lastChild
+ and root.firstChild.nextSibling is None
+ and root.firstChild.previousSibling is None
+ , "testNormalizeDeleteWithNextSibling -- result")
+ doc.unlink()
+
+ def testNormalizeDeleteWithTwoNonTextSiblings(self):
+ doc = parseString("<doc/>")
+ root = doc.documentElement
+ root.appendChild(doc.createElement("i"))
+ root.appendChild(doc.createTextNode(""))
+ root.appendChild(doc.createElement("i"))
+ self.confirm(len(root.childNodes) == 3
+ and root.childNodes.length == 3,
+ "testNormalizeDeleteWithTwoSiblings -- preparation")
+ doc.normalize()
+ self.confirm(len(root.childNodes) == 2
+ and root.childNodes.length == 2
+ and root.firstChild is not root.lastChild
+ and root.firstChild.nextSibling is root.lastChild
+ and root.firstChild.previousSibling is None
+ and root.lastChild.previousSibling is root.firstChild
+ and root.lastChild.nextSibling is None
+ , "testNormalizeDeleteWithTwoSiblings -- result")
+ doc.unlink()
+
+ def testNormalizeDeleteAndCombine(self):
+ doc = parseString("<doc/>")
+ root = doc.documentElement
+ root.appendChild(doc.createTextNode(""))
+ root.appendChild(doc.createTextNode("second"))
+ root.appendChild(doc.createTextNode(""))
+ root.appendChild(doc.createTextNode("fourth"))
+ root.appendChild(doc.createTextNode(""))
+ self.confirm(len(root.childNodes) == 5
+ and root.childNodes.length == 5,
+ "testNormalizeDeleteAndCombine -- preparation")
+ doc.normalize()
+ self.confirm(len(root.childNodes) == 1
+ and root.childNodes.length == 1
+ and root.firstChild is root.lastChild
+ and root.firstChild.data == "secondfourth"
+ and root.firstChild.previousSibling is None
+ and root.firstChild.nextSibling is None
+ , "testNormalizeDeleteAndCombine -- result")
+ doc.unlink()
+
+ def testNormalizeRecursion(self):
+ doc = parseString("<doc>"
+ "<o>"
+ "<i/>"
+ "t"
+ #
+ #x
+ "</o>"
+ "<o>"
+ "<o>"
+ "t2"
+ #x2
+ "</o>"
+ "t3"
+ #x3
+ "</o>"
+ #
+ "</doc>")
+ root = doc.documentElement
+ root.childNodes[0].appendChild(doc.createTextNode(""))
+ root.childNodes[0].appendChild(doc.createTextNode("x"))
+ root.childNodes[1].childNodes[0].appendChild(doc.createTextNode("x2"))
+ root.childNodes[1].appendChild(doc.createTextNode("x3"))
+ root.appendChild(doc.createTextNode(""))
+ self.confirm(len(root.childNodes) == 3
+ and root.childNodes.length == 3
+ and len(root.childNodes[0].childNodes) == 4
+ and root.childNodes[0].childNodes.length == 4
+ and len(root.childNodes[1].childNodes) == 3
+ and root.childNodes[1].childNodes.length == 3
+ and len(root.childNodes[1].childNodes[0].childNodes) == 2
+ and root.childNodes[1].childNodes[0].childNodes.length == 2
+ , "testNormalize2 -- preparation")
+ doc.normalize()
+ self.confirm(len(root.childNodes) == 2
+ and root.childNodes.length == 2
+ and len(root.childNodes[0].childNodes) == 2
+ and root.childNodes[0].childNodes.length == 2
+ and len(root.childNodes[1].childNodes) == 2
+ and root.childNodes[1].childNodes.length == 2
+ and len(root.childNodes[1].childNodes[0].childNodes) == 1
+ and root.childNodes[1].childNodes[0].childNodes.length == 1
+ , "testNormalize2 -- childNodes lengths")
+ self.confirm(root.childNodes[0].childNodes[1].data == "tx"
+ and root.childNodes[1].childNodes[0].childNodes[0].data == "t2x2"
+ and root.childNodes[1].childNodes[1].data == "t3x3"
+ , "testNormalize2 -- joined text fields")
+ self.confirm(root.childNodes[0].childNodes[1].nextSibling is None
+ and root.childNodes[0].childNodes[1].previousSibling
+ is root.childNodes[0].childNodes[0]
+ and root.childNodes[0].childNodes[0].previousSibling is None
+ and root.childNodes[0].childNodes[0].nextSibling
+ is root.childNodes[0].childNodes[1]
+ and root.childNodes[1].childNodes[1].nextSibling is None
+ and root.childNodes[1].childNodes[1].previousSibling
+ is root.childNodes[1].childNodes[0]
+ and root.childNodes[1].childNodes[0].previousSibling is None
+ and root.childNodes[1].childNodes[0].nextSibling
+ is root.childNodes[1].childNodes[1]
+ , "testNormalize2 -- sibling pointers")
+ doc.unlink()
+
+
+ def testBug0777884(self):
+ doc = parseString("<o>text</o>")
+ text = doc.documentElement.childNodes[0]
+ self.assertEqual(text.nodeType, Node.TEXT_NODE)
+ # Should run quietly, doing nothing.
+ text.normalize()
+ doc.unlink()
+
def testBug1433694(self):
doc = parseString("<o><i/>t</o>")
node = doc.documentElement
node.childNodes[1].nodeValue = ""
node.normalize()
- self.confirm(node.childNodes[-1].nextSibling == None,
+ self.confirm(node.childNodes[-1].nextSibling is None,
"Final child's .nextSibling should be None")
def testSiblings(self):
@@ -1063,7 +1206,7 @@ class MinidomTest(unittest.TestCase):
doc = parseString("<doc>a</doc>")
elem = doc.documentElement
text = elem.childNodes[0]
- self.assertEquals(text.nodeType, Node.TEXT_NODE)
+ self.assertEqual(text.nodeType, Node.TEXT_NODE)
self.checkWholeText(text, "a")
elem.appendChild(doc.createTextNode("b"))
@@ -1320,6 +1463,13 @@ class MinidomTest(unittest.TestCase):
doc.appendChild(doc.createComment("foo--bar"))
self.assertRaises(ValueError, doc.toxml)
+ def testEmptyXMLNSValue(self):
+ doc = parseString("<element xmlns=''>\n"
+ "<foo/>\n</element>")
+ doc2 = parseString(doc.toxml())
+ self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE)
+
+
def test_main():
run_unittest(MinidomTest)
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 5506956eb6..2c2863ebbe 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -1,7 +1,9 @@
-from test.test_support import TESTFN, run_unittest
-import mmap
+from test.test_support import (TESTFN, run_unittest, import_module, unlink,
+ requires, _2G, _4G)
import unittest
-import os, re, itertools
+import os, re, itertools, socket, sys
+
+mmap = import_module('mmap')
PAGESIZE = mmap.PAGESIZE
@@ -238,6 +240,14 @@ class MmapTests(unittest.TestCase):
prot=mmap.PROT_READ, access=mmap.ACCESS_WRITE)
f.close()
+ # Try writing with PROT_EXEC and without PROT_WRITE
+ prot = mmap.PROT_READ | getattr(mmap, 'PROT_EXEC', 0)
+ with open(TESTFN, "r+b") as f:
+ m = mmap.mmap(f.fileno(), mapsize, prot=prot)
+ self.assertRaises(TypeError, m.write, b"abcdef")
+ self.assertRaises(TypeError, m.write_byte, 0)
+ m.close()
+
def test_bad_file_desc(self):
# Try opening a bad file descriptor...
self.assertRaises(mmap.error, mmap.mmap, -2, 4096)
@@ -325,6 +335,36 @@ class MmapTests(unittest.TestCase):
mf.close()
f.close()
+ def test_length_0_offset(self):
+ # Issue #10916: test mapping of remainder of file by passing 0 for
+ # map length with an offset doesn't cause a segfault.
+ if not hasattr(os, "stat"):
+ self.skipTest("needs os.stat")
+ # NOTE: allocation granularity is currently 65536 under Win64,
+ # and therefore the minimum offset alignment.
+ with open(TESTFN, "wb") as f:
+ f.write((65536 * 2) * b'm') # Arbitrary character
+
+ with open(TESTFN, "rb") as f:
+ mf = mmap.mmap(f.fileno(), 0, offset=65536, access=mmap.ACCESS_READ)
+ try:
+ self.assertRaises(IndexError, mf.__getitem__, 80000)
+ finally:
+ mf.close()
+
+ def test_length_0_large_offset(self):
+ # Issue #10959: test mapping of a file by passing 0 for
+ # map length with a large offset doesn't cause a segfault.
+ if not hasattr(os, "stat"):
+ self.skipTest("needs os.stat")
+
+ with open(TESTFN, "wb") as f:
+ f.write(115699 * b'm') # Arbitrary character
+
+ with open(TESTFN, "w+b") as f:
+ self.assertRaises(ValueError, mmap.mmap, f.fileno(), 0,
+ offset=2147418112)
+
def test_move(self):
# make move works everywhere (64-bit format problem earlier)
f = open(TESTFN, 'w+')
@@ -358,15 +398,22 @@ class MmapTests(unittest.TestCase):
m.move(source, dest, size)
except ValueError:
pass
- self.assertRaises(ValueError, m.move, -1, -1, -1)
- self.assertRaises(ValueError, m.move, -1, -1, 0)
- self.assertRaises(ValueError, m.move, -1, 0, -1)
- self.assertRaises(ValueError, m.move, 0, -1, -1)
- self.assertRaises(ValueError, m.move, -1, 0, 0)
- self.assertRaises(ValueError, m.move, 0, -1, 0)
- self.assertRaises(ValueError, m.move, 0, 0, -1)
+
+ offsets = [(-1, -1, -1), (-1, -1, 0), (-1, 0, -1), (0, -1, -1),
+ (-1, 0, 0), (0, -1, 0), (0, 0, -1)]
+ for source, dest, size in offsets:
+ self.assertRaises(ValueError, m.move, source, dest, size)
+
m.close()
+ m = mmap.mmap(-1, 1) # single byte
+ self.assertRaises(ValueError, m.move, 0, 0, 2)
+ self.assertRaises(ValueError, m.move, 1, 0, 1)
+ self.assertRaises(ValueError, m.move, 0, 1, 1)
+ m.move(0, 0, 1)
+ m.move(0, 0, 0)
+
+
def test_anonymous(self):
# anonymous mmap.mmap(-1, PAGE)
m = mmap.mmap(-1, PAGESIZE)
@@ -409,7 +456,7 @@ class MmapTests(unittest.TestCase):
data = "".join(reversed(data))
L[start:stop:step] = data
m[start:stop:step] = data
- self.assertEquals(m[:], "".join(L))
+ self.assertEqual(m[:], "".join(L))
def make_mmap_file (self, f, halfsize):
# Write 2 pages worth of data to the file
@@ -493,8 +540,8 @@ class MmapTests(unittest.TestCase):
f.close()
def test_error(self):
- self.assert_(issubclass(mmap.error, EnvironmentError))
- self.assert_("mmap.error" in str(mmap.error))
+ self.assertTrue(issubclass(mmap.error, EnvironmentError))
+ self.assertIn("mmap.error", str(mmap.error))
def test_io_methods(self):
data = "0123456789"
@@ -504,27 +551,27 @@ class MmapTests(unittest.TestCase):
f.close()
# Test write_byte()
for i in xrange(len(data)):
- self.assertEquals(m.tell(), i)
- m.write_byte(data[i:i+1])
- self.assertEquals(m.tell(), i+1)
+ self.assertEqual(m.tell(), i)
+ m.write_byte(data[i])
+ self.assertEqual(m.tell(), i+1)
self.assertRaises(ValueError, m.write_byte, "x")
- self.assertEquals(m[:], data)
+ self.assertEqual(m[:], data)
# Test read_byte()
m.seek(0)
for i in xrange(len(data)):
- self.assertEquals(m.tell(), i)
- self.assertEquals(m.read_byte(), data[i:i+1])
- self.assertEquals(m.tell(), i+1)
+ self.assertEqual(m.tell(), i)
+ self.assertEqual(m.read_byte(), data[i])
+ self.assertEqual(m.tell(), i+1)
self.assertRaises(ValueError, m.read_byte)
# Test read()
m.seek(3)
- self.assertEquals(m.read(3), "345")
- self.assertEquals(m.tell(), 6)
+ self.assertEqual(m.read(3), "345")
+ self.assertEqual(m.tell(), 6)
# Test write()
m.seek(3)
m.write("bar")
- self.assertEquals(m.tell(), 6)
- self.assertEquals(m[:], "012bar6789")
+ self.assertEqual(m.tell(), 6)
+ self.assertEqual(m[:], "012bar6789")
m.seek(8)
self.assertRaises(ValueError, m.write, "bar")
@@ -539,18 +586,18 @@ class MmapTests(unittest.TestCase):
m1[:] = data1
m2 = mmap.mmap(-1, len(data2), tagname="foo")
m2[:] = data2
- self.assertEquals(m1[:], data2)
- self.assertEquals(m2[:], data2)
+ self.assertEqual(m1[:], data2)
+ self.assertEqual(m2[:], data2)
m2.close()
m1.close()
- # Test differnt tag
+ # Test different tag
m1 = mmap.mmap(-1, len(data1), tagname="foo")
m1[:] = data1
m2 = mmap.mmap(-1, len(data2), tagname="boo")
m2[:] = data2
- self.assertEquals(m1[:], data1)
- self.assertEquals(m2[:], data2)
+ self.assertEqual(m1[:], data1)
+ self.assertEqual(m2[:], data2)
m2.close()
m1.close()
@@ -578,9 +625,80 @@ class MmapTests(unittest.TestCase):
pass
m.close()
+ def test_invalid_descriptor(self):
+ # socket file descriptors are valid, but out of range
+ # for _get_osfhandle, causing a crash when validating the
+ # parameters to _get_osfhandle.
+ s = socket.socket()
+ try:
+ with self.assertRaises(mmap.error):
+ m = mmap.mmap(s.fileno(), 10)
+ finally:
+ s.close()
+
+
+class LargeMmapTests(unittest.TestCase):
+
+ def setUp(self):
+ unlink(TESTFN)
+
+ def tearDown(self):
+ unlink(TESTFN)
+
+ def _make_test_file(self, num_zeroes, tail):
+ if sys.platform[:3] == 'win' or sys.platform == 'darwin':
+ requires('largefile',
+ 'test requires %s bytes and a long time to run' % str(0x180000000))
+ f = open(TESTFN, 'w+b')
+ try:
+ f.seek(num_zeroes)
+ f.write(tail)
+ f.flush()
+ except (IOError, OverflowError):
+ f.close()
+ raise unittest.SkipTest("filesystem does not have largefile support")
+ return f
+
+ def test_large_offset(self):
+ with self._make_test_file(0x14FFFFFFF, b" ") as f:
+ m = mmap.mmap(f.fileno(), 0, offset=0x140000000, access=mmap.ACCESS_READ)
+ try:
+ self.assertEqual(m[0xFFFFFFF], b" ")
+ finally:
+ m.close()
+
+ def test_large_filesize(self):
+ with self._make_test_file(0x17FFFFFFF, b" ") as f:
+ m = mmap.mmap(f.fileno(), 0x10000, access=mmap.ACCESS_READ)
+ try:
+ self.assertEqual(m.size(), 0x180000000)
+ finally:
+ m.close()
+
+ # Issue 11277: mmap() with large (~4GB) sparse files crashes on OS X.
+
+ def _test_around_boundary(self, boundary):
+ tail = b' DEARdear '
+ start = boundary - len(tail) // 2
+ end = start + len(tail)
+ with self._make_test_file(start, tail) as f:
+ m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
+ try:
+ self.assertEqual(m[start:end], tail)
+ finally:
+ m.close()
+
+ @unittest.skipUnless(sys.maxsize > _4G, "test cannot run on 32-bit systems")
+ def test_around_2GB(self):
+ self._test_around_boundary(_2G)
+
+ @unittest.skipUnless(sys.maxsize > _4G, "test cannot run on 32-bit systems")
+ def test_around_4GB(self):
+ self._test_around_boundary(_4G)
+
def test_main():
- run_unittest(MmapTests)
+ run_unittest(MmapTests, LargeMmapTests)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_module.py b/Lib/test/test_module.py
index ac99773432..5605e3c5af 100644
--- a/Lib/test/test_module.py
+++ b/Lib/test/test_module.py
@@ -1,6 +1,6 @@
# Test the module type
import unittest
-from test.test_support import run_unittest
+from test.test_support import run_unittest, gc_collect
import sys
ModuleType = type(sys)
@@ -10,7 +10,7 @@ class ModuleTests(unittest.TestCase):
# An uninitialized module has no __dict__ or __name__,
# and __doc__ is None
foo = ModuleType.__new__(ModuleType)
- self.failUnless(foo.__dict__ is None)
+ self.assertTrue(foo.__dict__ is None)
self.assertRaises(SystemError, dir, foo)
try:
s = foo.__name__
@@ -53,7 +53,30 @@ class ModuleTests(unittest.TestCase):
self.assertEqual(foo.bar, 42)
self.assertEqual(foo.__dict__,
{"__name__": "foo", "__doc__": "foodoc", "bar": 42})
- self.failUnless(foo.__dict__ is d)
+ self.assertTrue(foo.__dict__ is d)
+
+ @unittest.expectedFailure
+ def test_dont_clear_dict(self):
+ # See issue 7140.
+ def f():
+ foo = ModuleType("foo")
+ foo.bar = 4
+ return foo
+ gc_collect()
+ self.assertEqual(f().__dict__["bar"], 4)
+
+ def test_clear_dict_in_ref_cycle(self):
+ destroyed = []
+ m = ModuleType("foo")
+ m.destroyed = destroyed
+ s = """class A:
+ def __del__(self):
+ destroyed.append(1)
+a = A()"""
+ exec(s, m.__dict__)
+ del m
+ gc_collect()
+ self.assertEqual(destroyed, [1])
def test_main():
run_unittest(ModuleTests)
diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py
index 9d7f76afdf..e71d1e0aeb 100644
--- a/Lib/test/test_modulefinder.py
+++ b/Lib/test/test_modulefinder.py
@@ -211,11 +211,17 @@ def open_file(path):
def create_package(source):
ofi = None
- for line in source.splitlines():
- if line.startswith(" ") or line.startswith("\t"):
- ofi.write(line.strip() + "\n")
- else:
- ofi = open_file(os.path.join(TEST_DIR, line.strip()))
+ try:
+ for line in source.splitlines():
+ if line.startswith(" ") or line.startswith("\t"):
+ ofi.write(line.strip() + "\n")
+ else:
+ if ofi:
+ ofi.close()
+ ofi = open_file(os.path.join(TEST_DIR, line.strip()))
+ finally:
+ if ofi:
+ ofi.close()
class ModuleFinderTest(unittest.TestCase):
def _do_test(self, info, report=False):
@@ -240,12 +246,12 @@ class ModuleFinderTest(unittest.TestCase):
more = list(found - modules)
less = list(modules - found)
# check if we found what we expected, not more, not less
- self.failUnlessEqual((more, less), ([], []))
+ self.assertEqual((more, less), ([], []))
# check for missing and maybe missing modules
bad, maybe = mf.any_missing_maybe()
- self.failUnlessEqual(bad, missing)
- self.failUnlessEqual(maybe, maybe_missing)
+ self.assertEqual(bad, missing)
+ self.assertEqual(maybe, maybe_missing)
finally:
distutils.dir_util.remove_tree(TEST_DIR)
diff --git a/Lib/test/test_msilib.py b/Lib/test/test_msilib.py
new file mode 100644
index 0000000000..5d5b0c48fe
--- /dev/null
+++ b/Lib/test/test_msilib.py
@@ -0,0 +1,46 @@
+""" Test suite for the code in msilib """
+import unittest
+import os
+from test_support import run_unittest, import_module
+msilib = import_module('msilib')
+
+class Test_make_id(unittest.TestCase):
+ #http://msdn.microsoft.com/en-us/library/aa369212(v=vs.85).aspx
+ """The Identifier data type is a text string. Identifiers may contain the
+ ASCII characters A-Z (a-z), digits, underscores (_), or periods (.).
+ However, every identifier must begin with either a letter or an
+ underscore.
+ """
+
+ def test_is_no_change_required(self):
+ self.assertEqual(
+ msilib.make_id("short"), "short")
+ self.assertEqual(
+ msilib.make_id("nochangerequired"), "nochangerequired")
+ self.assertEqual(
+ msilib.make_id("one.dot"), "one.dot")
+ self.assertEqual(
+ msilib.make_id("_"), "_")
+ self.assertEqual(
+ msilib.make_id("a"), "a")
+ #self.assertEqual(
+ # msilib.make_id(""), "")
+
+ def test_invalid_first_char(self):
+ self.assertEqual(
+ msilib.make_id("9.short"), "_9.short")
+ self.assertEqual(
+ msilib.make_id(".short"), "_.short")
+
+ def test_invalid_any_char(self):
+ self.assertEqual(
+ msilib.make_id(".s\x82ort"), "_.s_ort")
+ self.assertEqual (
+ msilib.make_id(".s\x82o?*+rt"), "_.s_o___rt")
+
+
+def test_main():
+ run_unittest(__name__)
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_multibytecodec.py b/Lib/test/test_multibytecodec.py
index 8536f0a9f4..63c1e620b5 100644
--- a/Lib/test/test_multibytecodec.py
+++ b/Lib/test/test_multibytecodec.py
@@ -5,7 +5,6 @@
#
from test import test_support
-from test import test_multibytecodec_support
from test.test_support import TESTFN
import unittest, StringIO, codecs, sys, os
import _multibytecodec
@@ -47,12 +46,9 @@ class Test_MultibyteCodec(unittest.TestCase):
'apple\x92ham\x93spam', 'test.cjktest')
def test_codingspec(self):
- try:
- for enc in ALL_CJKENCODINGS:
- print >> open(TESTFN, 'w'), '# coding:', enc
- exec open(TESTFN)
- finally:
- os.unlink(TESTFN)
+ for enc in ALL_CJKENCODINGS:
+ code = '# coding: {}\n'.format(enc)
+ exec code
def test_init_segfault(self):
# bug #3305: this used to segfault
@@ -226,10 +222,10 @@ class Test_ISO2022(unittest.TestCase):
self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni)
def test_iso2022_jp_g0(self):
- self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
+ self.assertNotIn('\x0e', u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'):
e = u'\u3406'.encode(encoding)
- self.failIf(filter(lambda x: x >= '\x80', e))
+ self.assertFalse(filter(lambda x: x >= '\x80', e))
def test_bug1572832(self):
if sys.maxunicode >= 0x10000:
diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py
index 82e46d66c0..94529096d2 100644
--- a/Lib/test/test_multibytecodec_support.py
+++ b/Lib/test/test_multibytecodec_support.py
@@ -4,8 +4,12 @@
# Common Unittest Routines for CJK codecs
#
-import sys, codecs
-import unittest, re
+import codecs
+import os
+import re
+import sys
+import unittest
+from httplib import HTTPException
from test import test_support
from StringIO import StringIO
@@ -251,9 +255,9 @@ class TestBase_Mapping(unittest.TestCase):
def __init__(self, *args, **kw):
unittest.TestCase.__init__(self, *args, **kw)
try:
- self.open_mapping_file() # test it to report the error early
- except IOError:
- raise test_support.TestSkipped("Could not retrieve "+self.mapfileurl)
+ self.open_mapping_file().close() # test it to report the error early
+ except (IOError, HTTPException):
+ self.skipTest("Could not retrieve "+self.mapfileurl)
def open_mapping_file(self):
return test_support.open_urlresource(self.mapfileurl)
@@ -269,36 +273,38 @@ class TestBase_Mapping(unittest.TestCase):
unichrs = lambda s: u''.join(_unichr(c) for c in s.split('+'))
urt_wa = {}
- for line in self.open_mapping_file():
- if not line:
- break
- data = line.split('#')[0].strip().split()
- if len(data) != 2:
- continue
-
- csetval = eval(data[0])
- if csetval <= 0x7F:
- csetch = chr(csetval & 0xff)
- elif csetval >= 0x1000000:
- csetch = chr(csetval >> 24) + chr((csetval >> 16) & 0xff) + \
- chr((csetval >> 8) & 0xff) + chr(csetval & 0xff)
- elif csetval >= 0x10000:
- csetch = chr(csetval >> 16) + \
- chr((csetval >> 8) & 0xff) + chr(csetval & 0xff)
- elif csetval >= 0x100:
- csetch = chr(csetval >> 8) + chr(csetval & 0xff)
- else:
- continue
+ with self.open_mapping_file() as f:
+ for line in f:
+ if not line:
+ break
+ data = line.split('#')[0].strip().split()
+ if len(data) != 2:
+ continue
+
+ csetval = eval(data[0])
+ if csetval <= 0x7F:
+ csetch = chr(csetval & 0xff)
+ elif csetval >= 0x1000000:
+ csetch = chr(csetval >> 24) + chr((csetval >> 16) & 0xff) + \
+ chr((csetval >> 8) & 0xff) + chr(csetval & 0xff)
+ elif csetval >= 0x10000:
+ csetch = chr(csetval >> 16) + \
+ chr((csetval >> 8) & 0xff) + chr(csetval & 0xff)
+ elif csetval >= 0x100:
+ csetch = chr(csetval >> 8) + chr(csetval & 0xff)
+ else:
+ continue
- unich = unichrs(data[1])
- if unich == u'\ufffd' or unich in urt_wa:
- continue
- urt_wa[unich] = csetch
+ unich = unichrs(data[1])
+ if unich == u'\ufffd' or unich in urt_wa:
+ continue
+ urt_wa[unich] = csetch
- self._testpoint(csetch, unich)
+ self._testpoint(csetch, unich)
def _test_mapping_file_ucm(self):
- ucmdata = self.open_mapping_file().read()
+ with self.open_mapping_file() as f:
+ ucmdata = f.read()
uc = re.findall('<a u="([A-F0-9]{4})" b="([0-9A-F ]+)"/>', ucmdata)
for uni, coded in uc:
unich = unichr(int(uni, 16))
@@ -323,6 +329,10 @@ class TestBase_Mapping(unittest.TestCase):
self.fail('Decoding failed while testing %s -> %s: %s' % (
repr(csetch), repr(unich), exc.reason))
-def load_teststring(encoding):
- from test import cjkencodings_test
- return cjkencodings_test.teststring[encoding]
+def load_teststring(name):
+ dir = os.path.join(os.path.dirname(__file__), 'cjkencodings')
+ with open(os.path.join(dir, name + '.txt'), 'rb') as f:
+ encoded = f.read()
+ with open(os.path.join(dir, name + '-utf8.txt'), 'rb') as f:
+ utf8 = f.read()
+ return encoded, utf8
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index 7582cc3cf4..fe19de0371 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -5,7 +5,6 @@
#
import unittest
-import threading
import Queue
import time
import sys
@@ -13,30 +12,34 @@ import os
import gc
import signal
import array
-import copy
import socket
import random
import logging
-from StringIO import StringIO
from test import test_support
-
+from StringIO import StringIO
+_multiprocessing = test_support.import_module('_multiprocessing')
+# import threading after _multiprocessing to raise a more relevant error
+# message: "No module named _multiprocessing". _multiprocessing is not compiled
+# without thread support.
+import threading
# Work around broken sem_open implementations
-try:
- import multiprocessing.synchronize
-except ImportError, e:
- from test.test_support import TestSkipped
- raise TestSkipped(e)
+test_support.import_module('multiprocessing.synchronize')
import multiprocessing.dummy
import multiprocessing.connection
import multiprocessing.managers
import multiprocessing.heap
import multiprocessing.pool
-import _multiprocessing
from multiprocessing import util
+try:
+ from multiprocessing.sharedctypes import Value, copy
+ HAS_SHAREDCTYPES = True
+except ImportError:
+ HAS_SHAREDCTYPES = False
+
#
#
#
@@ -48,7 +51,7 @@ latin = str
#
LOG_LEVEL = util.SUBWARNING
-#LOG_LEVEL = logging.WARNING
+#LOG_LEVEL = logging.DEBUG
DELTA = 0.1
CHECK_TIMINGS = False # making true makes tests take a lot longer
@@ -66,6 +69,16 @@ HAVE_GETVALUE = not getattr(_multiprocessing,
WIN32 = (sys.platform == "win32")
#
+# Some tests require ctypes
+#
+
+try:
+ from ctypes import Structure, c_int, c_double
+except ImportError:
+ Structure = object
+ c_int = c_double = None
+
+#
# Creates a wrapper for a function which records the time it takes to finish
#
@@ -102,6 +115,13 @@ class BaseTestCase(object):
else:
return self.assertEqual(value, res)
+ # For the sanity of Windows users, rather than crashing or freezing in
+ # multiple ways.
+ def __reduce__(self, *args):
+ raise NotImplementedError("shouldn't try to pickle a test case")
+
+ __reduce_ex__ = __reduce__
+
#
# Return the value of a semaphore
#
@@ -135,17 +155,18 @@ class _TestProcess(BaseTestCase):
self.assertTrue(current.is_alive())
self.assertTrue(not current.daemon)
- self.assertTrue(isinstance(authkey, bytes))
+ self.assertIsInstance(authkey, bytes)
self.assertTrue(len(authkey) > 0)
self.assertEqual(current.ident, os.getpid())
self.assertEqual(current.exitcode, None)
- def _test(self, q, *args, **kwds):
- current = self.current_process()
+ @classmethod
+ def _test(cls, q, *args, **kwds):
+ current = cls.current_process()
q.put(args)
q.put(kwds)
q.put(current.name)
- if self.TYPE != 'threads':
+ if cls.TYPE != 'threads':
q.put(bytes(current.authkey))
q.put(current.pid)
@@ -162,33 +183,34 @@ class _TestProcess(BaseTestCase):
current = self.current_process()
if self.TYPE != 'threads':
- self.assertEquals(p.authkey, current.authkey)
- self.assertEquals(p.is_alive(), False)
- self.assertEquals(p.daemon, True)
- self.assertTrue(p not in self.active_children())
+ self.assertEqual(p.authkey, current.authkey)
+ self.assertEqual(p.is_alive(), False)
+ self.assertEqual(p.daemon, True)
+ self.assertNotIn(p, self.active_children())
self.assertTrue(type(self.active_children()) is list)
self.assertEqual(p.exitcode, None)
p.start()
- self.assertEquals(p.exitcode, None)
- self.assertEquals(p.is_alive(), True)
- self.assertTrue(p in self.active_children())
+ self.assertEqual(p.exitcode, None)
+ self.assertEqual(p.is_alive(), True)
+ self.assertIn(p, self.active_children())
- self.assertEquals(q.get(), args[1:])
- self.assertEquals(q.get(), kwargs)
- self.assertEquals(q.get(), p.name)
+ self.assertEqual(q.get(), args[1:])
+ self.assertEqual(q.get(), kwargs)
+ self.assertEqual(q.get(), p.name)
if self.TYPE != 'threads':
- self.assertEquals(q.get(), current.authkey)
- self.assertEquals(q.get(), p.pid)
+ self.assertEqual(q.get(), current.authkey)
+ self.assertEqual(q.get(), p.pid)
p.join()
- self.assertEquals(p.exitcode, 0)
- self.assertEquals(p.is_alive(), False)
- self.assertTrue(p not in self.active_children())
+ self.assertEqual(p.exitcode, 0)
+ self.assertEqual(p.is_alive(), False)
+ self.assertNotIn(p, self.active_children())
- def _test_terminate(self):
+ @classmethod
+ def _test_terminate(cls):
time.sleep(1000)
def test_terminate(self):
@@ -200,7 +222,7 @@ class _TestProcess(BaseTestCase):
p.start()
self.assertEqual(p.is_alive(), True)
- self.assertTrue(p in self.active_children())
+ self.assertIn(p, self.active_children())
self.assertEqual(p.exitcode, None)
p.terminate()
@@ -210,7 +232,7 @@ class _TestProcess(BaseTestCase):
self.assertTimingAlmostEqual(join.elapsed, 0.0)
self.assertEqual(p.is_alive(), False)
- self.assertTrue(p not in self.active_children())
+ self.assertNotIn(p, self.active_children())
p.join()
@@ -229,21 +251,22 @@ class _TestProcess(BaseTestCase):
self.assertEqual(type(self.active_children()), list)
p = self.Process(target=time.sleep, args=(DELTA,))
- self.assertTrue(p not in self.active_children())
+ self.assertNotIn(p, self.active_children())
p.start()
- self.assertTrue(p in self.active_children())
+ self.assertIn(p, self.active_children())
p.join()
- self.assertTrue(p not in self.active_children())
+ self.assertNotIn(p, self.active_children())
- def _test_recursion(self, wconn, id):
+ @classmethod
+ def _test_recursion(cls, wconn, id):
from multiprocessing import forking
wconn.send(id)
if len(id) < 2:
for i in range(2):
- p = self.Process(
- target=self._test_recursion, args=(wconn, id+[i])
+ p = cls.Process(
+ target=cls._test_recursion, args=(wconn, id+[i])
)
p.start()
p.join()
@@ -326,7 +349,8 @@ def queue_full(q, maxsize):
class _TestQueue(BaseTestCase):
- def _test_put(self, queue, child_can_start, parent_can_continue):
+ @classmethod
+ def _test_put(cls, queue, child_can_start, parent_can_continue):
child_can_start.wait()
for i in range(6):
queue.get()
@@ -390,7 +414,8 @@ class _TestQueue(BaseTestCase):
proc.join()
- def _test_get(self, queue, child_can_start, parent_can_continue):
+ @classmethod
+ def _test_get(cls, queue, child_can_start, parent_can_continue):
child_can_start.wait()
#queue.put(1)
queue.put(2)
@@ -451,7 +476,8 @@ class _TestQueue(BaseTestCase):
proc.join()
- def _test_fork(self, queue):
+ @classmethod
+ def _test_fork(cls, queue):
for i in range(10, 20):
queue.put(i)
# note that at this point the items may only be buffered, so the
@@ -499,7 +525,8 @@ class _TestQueue(BaseTestCase):
q.get()
self.assertEqual(q.qsize(), 0)
- def _test_task_done(self, q):
+ @classmethod
+ def _test_task_done(cls, q):
for obj in iter(q.get, None):
time.sleep(DELTA)
q.task_done()
@@ -508,7 +535,7 @@ class _TestQueue(BaseTestCase):
queue = self.JoinableQueue()
if sys.version_info < (2, 5) and not hasattr(queue, 'task_done'):
- return
+ self.skipTest("requires 'queue.task_done()' method")
workers = [self.Process(target=self._test_task_done, args=(queue,))
for i in xrange(4)]
@@ -611,7 +638,8 @@ class _TestSemaphore(BaseTestCase):
class _TestCondition(BaseTestCase):
- def f(self, cond, sleeping, woken, timeout=None):
+ @classmethod
+ def f(cls, cond, sleeping, woken, timeout=None):
cond.acquire()
sleeping.release()
cond.wait(timeout)
@@ -743,7 +771,8 @@ class _TestCondition(BaseTestCase):
class _TestEvent(BaseTestCase):
- def _test_event(self, event):
+ @classmethod
+ def _test_event(cls, event):
time.sleep(TIMEOUT2)
event.set()
@@ -751,22 +780,24 @@ class _TestEvent(BaseTestCase):
event = self.Event()
wait = TimingWrapper(event.wait)
- # Removed temporaily, due to API shear, this does not
+ # Removed temporarily, due to API shear, this does not
# work with threading._Event objects. is_set == isSet
- #self.assertEqual(event.is_set(), False)
+ self.assertEqual(event.is_set(), False)
- self.assertEqual(wait(0.0), None)
+ # Removed, threading.Event.wait() will return the value of the __flag
+ # instead of None. API Shear with the semaphore backed mp.Event
+ self.assertEqual(wait(0.0), False)
self.assertTimingAlmostEqual(wait.elapsed, 0.0)
- self.assertEqual(wait(TIMEOUT1), None)
+ self.assertEqual(wait(TIMEOUT1), False)
self.assertTimingAlmostEqual(wait.elapsed, TIMEOUT1)
event.set()
# See note above on the API differences
- # self.assertEqual(event.is_set(), True)
- self.assertEqual(wait(), None)
+ self.assertEqual(event.is_set(), True)
+ self.assertEqual(wait(), True)
self.assertTimingAlmostEqual(wait.elapsed, 0.0)
- self.assertEqual(wait(TIMEOUT1), None)
+ self.assertEqual(wait(TIMEOUT1), True)
self.assertTimingAlmostEqual(wait.elapsed, 0.0)
# self.assertEqual(event.is_set(), True)
@@ -775,7 +806,7 @@ class _TestEvent(BaseTestCase):
#self.assertEqual(event.is_set(), False)
self.Process(target=self._test_event, args=(event,)).start()
- self.assertEqual(wait(), None)
+ self.assertEqual(wait(), True)
#
#
@@ -783,6 +814,8 @@ class _TestEvent(BaseTestCase):
class _TestValue(BaseTestCase):
+ ALLOWED_TYPES = ('processes',)
+
codes_values = [
('i', 4343, 24234),
('d', 3.625, -4.25),
@@ -790,15 +823,17 @@ class _TestValue(BaseTestCase):
('c', latin('x'), latin('y'))
]
- def _test(self, values):
- for sv, cv in zip(values, self.codes_values):
+ def setUp(self):
+ if not HAS_SHAREDCTYPES:
+ self.skipTest("requires multiprocessing.sharedctypes")
+
+ @classmethod
+ def _test(cls, values):
+ for sv, cv in zip(values, cls.codes_values):
sv.value = cv[2]
def test_value(self, raw=False):
- if self.TYPE != 'processes':
- return
-
if raw:
values = [self.RawValue(code, value)
for code, value, _ in self.codes_values]
@@ -820,9 +855,6 @@ class _TestValue(BaseTestCase):
self.test_value(raw=True)
def test_getobj_getlock(self):
- if self.TYPE != 'processes':
- return
-
val1 = self.Value('i', 5)
lock1 = val1.get_lock()
obj1 = val1.get_obj()
@@ -850,14 +882,15 @@ class _TestValue(BaseTestCase):
class _TestArray(BaseTestCase):
- def f(self, seq):
+ ALLOWED_TYPES = ('processes',)
+
+ @classmethod
+ def f(cls, seq):
for i in range(1, len(seq)):
seq[i] += seq[i-1]
+ @unittest.skipIf(c_int is None, "requires _ctypes")
def test_array(self, raw=False):
- if self.TYPE != 'processes':
- return
-
seq = [680, 626, 934, 821, 150, 233, 548, 982, 714, 831]
if raw:
arr = self.RawArray('i', seq)
@@ -880,13 +913,34 @@ class _TestArray(BaseTestCase):
self.assertEqual(list(arr[:]), seq)
+ @unittest.skipIf(c_int is None, "requires _ctypes")
+ def test_array_from_size(self):
+ size = 10
+ # Test for zeroing (see issue #11675).
+ # The repetition below strengthens the test by increasing the chances
+ # of previously allocated non-zero memory being used for the new array
+ # on the 2nd and 3rd loops.
+ for _ in range(3):
+ arr = self.Array('i', size)
+ self.assertEqual(len(arr), size)
+ self.assertEqual(list(arr), [0] * size)
+ arr[:] = range(10)
+ self.assertEqual(list(arr), range(10))
+ del arr
+
+ @unittest.skipIf(c_int is None, "requires _ctypes")
def test_rawarray(self):
self.test_array(raw=True)
- def test_getobj_getlock_obj(self):
- if self.TYPE != 'processes':
- return
+ @unittest.skipIf(c_int is None, "requires _ctypes")
+ def test_array_accepts_long(self):
+ arr = self.Array('i', 10L)
+ self.assertEqual(len(arr), 10)
+ raw_arr = self.RawArray('i', 10L)
+ self.assertEqual(len(raw_arr), 10)
+ @unittest.skipIf(c_int is None, "requires _ctypes")
+ def test_getobj_getlock_obj(self):
arr1 = self.Array('i', range(10))
lock1 = arr1.get_lock()
obj1 = arr1.get_obj()
@@ -991,6 +1045,12 @@ class _TestPool(BaseTestCase):
self.assertEqual(pmap(sqr, range(100), chunksize=20),
map(sqr, range(100)))
+ def test_map_chunksize(self):
+ try:
+ self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1)
+ except multiprocessing.TimeoutError:
+ self.fail("pool.map_async with chunksize stalled on null list")
+
def test_async(self):
res = self.pool.apply_async(sqr, (7, TIMEOUT1,))
get = TimingWrapper(res.get)
@@ -1047,6 +1107,39 @@ class _TestPool(BaseTestCase):
join = TimingWrapper(self.pool.join)
join()
self.assertTrue(join.elapsed < 0.2)
+
+class _TestPoolWorkerLifetime(BaseTestCase):
+
+ ALLOWED_TYPES = ('processes', )
+ def test_pool_worker_lifetime(self):
+ p = multiprocessing.Pool(3, maxtasksperchild=10)
+ self.assertEqual(3, len(p._pool))
+ origworkerpids = [w.pid for w in p._pool]
+ # Run many tasks so each worker gets replaced (hopefully)
+ results = []
+ for i in range(100):
+ results.append(p.apply_async(sqr, (i, )))
+ # Fetch the results and verify we got the right answers,
+ # also ensuring all the tasks have completed.
+ for (j, res) in enumerate(results):
+ self.assertEqual(res.get(), sqr(j))
+ # Refill the pool
+ p._repopulate_pool()
+ # Wait until all workers are alive
+ # (countdown * DELTA = 5 seconds max startup process time)
+ countdown = 50
+ while countdown and not all(w.is_alive() for w in p._pool):
+ countdown -= 1
+ time.sleep(DELTA)
+ finalworkerpids = [w.pid for w in p._pool]
+ # All pids should be assigned. See issue #7805.
+ self.assertNotIn(None, origworkerpids)
+ self.assertNotIn(None, finalworkerpids)
+ # Finally, check that the worker pids have changed
+ self.assertNotEqual(sorted(origworkerpids), sorted(finalworkerpids))
+ p.close()
+ p.join()
+
#
# Test that manager has expected number of shared objects left
#
@@ -1063,8 +1156,10 @@ class _TestZZZNumberOfObjects(BaseTestCase):
multiprocessing.active_children() # discard dead process objs
gc.collect() # do garbage collection
refs = self.manager._number_of_objects()
+ debug_info = self.manager._debug_info()
if refs != EXPECTED_NUMBER:
print self.manager._debug_info()
+ print debug_info
self.assertEqual(refs, EXPECTED_NUMBER)
@@ -1158,7 +1253,8 @@ class _TestRemoteManager(BaseTestCase):
ALLOWED_TYPES = ('manager',)
- def _putter(self, address, authkey):
+ @classmethod
+ def _putter(cls, address, authkey):
manager = QueueManager2(
address=address, authkey=authkey, serializer=SERIALIZER
)
@@ -1196,7 +1292,8 @@ class _TestRemoteManager(BaseTestCase):
class _TestManagerRestart(BaseTestCase):
- def _putter(self, address, authkey):
+ @classmethod
+ def _putter(cls, address, authkey):
manager = QueueManager(
address=address, authkey=authkey, serializer=SERIALIZER)
manager.connect()
@@ -1207,7 +1304,11 @@ class _TestManagerRestart(BaseTestCase):
authkey = os.urandom(32)
manager = QueueManager(
address=('localhost', 0), authkey=authkey, serializer=SERIALIZER)
- addr = manager.get_server().address
+ srvr = manager.get_server()
+ addr = srvr.address
+ # Close the connection.Listener socket which gets opened as a part
+ # of manager.get_server(). It's not needed for the test.
+ srvr.listener.close()
manager.start()
p = self.Process(target=self._putter, args=(manager.address, authkey))
@@ -1231,7 +1332,8 @@ class _TestConnection(BaseTestCase):
ALLOWED_TYPES = ('processes', 'threads')
- def _echo(self, conn):
+ @classmethod
+ def _echo(cls, conn):
for msg in iter(conn.recv_bytes, SENTINEL):
conn.send_bytes(msg)
conn.close()
@@ -1380,8 +1482,9 @@ class _TestListenerClient(BaseTestCase):
ALLOWED_TYPES = ('processes', 'threads')
- def _test(self, address):
- conn = self.connection.Client(address)
+ @classmethod
+ def _test(cls, address):
+ conn = cls.connection.Client(address)
conn.send('hello')
conn.close()
@@ -1530,12 +1633,6 @@ class _TestHeap(BaseTestCase):
#
#
-try:
- from ctypes import Structure, Value, copy, c_int, c_double
-except ImportError:
- Structure = object
- c_int = c_double = None
-
class _Foo(Structure):
_fields_ = [
('x', c_int),
@@ -1546,7 +1643,12 @@ class _TestSharedCTypes(BaseTestCase):
ALLOWED_TYPES = ('processes',)
- def _double(self, x, y, foo, arr, string):
+ def setUp(self):
+ if not HAS_SHAREDCTYPES:
+ self.skipTest("requires multiprocessing.sharedctypes")
+
+ @classmethod
+ def _double(cls, x, y, foo, arr, string):
x.value *= 2
y.value *= 2
foo.x *= 2
@@ -1556,15 +1658,12 @@ class _TestSharedCTypes(BaseTestCase):
arr[i] *= 2
def test_sharedctypes(self, lock=False):
- if c_int is None:
- return
-
x = Value('i', 7, lock=lock)
y = Value(c_double, 1.0/3.0, lock=lock)
foo = Value(_Foo, 3, 2, lock=lock)
arr = self.Array('d', range(10), lock=lock)
string = self.Array('c', 20, lock=lock)
- string.value = 'hello'
+ string.value = latin('hello')
p = self.Process(target=self._double, args=(x, y, foo, arr, string))
p.start()
@@ -1582,9 +1681,6 @@ class _TestSharedCTypes(BaseTestCase):
self.test_sharedctypes(lock=True)
def test_copy(self):
- if c_int is None:
- return
-
foo = _Foo(2, 5.0)
bar = copy(foo)
foo.x = 0
@@ -1600,7 +1696,8 @@ class _TestFinalize(BaseTestCase):
ALLOWED_TYPES = ('processes',)
- def _test_finalize(self, conn):
+ @classmethod
+ def _test_finalize(cls, conn):
class Foo(object):
pass
@@ -1631,7 +1728,7 @@ class _TestFinalize(BaseTestCase):
util.Finalize(None, conn.send, args=('STOP',), exitpriority=-100)
- # call mutliprocessing's cleanup function then exit process without
+ # call multiprocessing's cleanup function then exit process without
# garbage collecting locals
util._exit_function()
conn.close()
@@ -1656,13 +1753,17 @@ class _TestImportStar(BaseTestCase):
ALLOWED_TYPES = ('processes',)
def test_import(self):
- modules = (
+ modules = [
'multiprocessing', 'multiprocessing.connection',
'multiprocessing.heap', 'multiprocessing.managers',
'multiprocessing.pool', 'multiprocessing.process',
- 'multiprocessing.reduction', 'multiprocessing.sharedctypes',
+ 'multiprocessing.reduction',
'multiprocessing.synchronize', 'multiprocessing.util'
- )
+ ]
+
+ if c_int is not None:
+ # This module requires _ctypes
+ modules.append('multiprocessing.sharedctypes')
for name in modules:
__import__(name)
@@ -1690,7 +1791,8 @@ class _TestLogging(BaseTestCase):
logger.info('nor will this')
logger.setLevel(LOG_LEVEL)
- def _test_level(self, conn):
+ @classmethod
+ def _test_level(cls, conn):
logger = multiprocessing.get_logger()
conn.send(logger.getEffectiveLevel())
@@ -1716,18 +1818,38 @@ class _TestLogging(BaseTestCase):
root_logger.setLevel(root_level)
logger.setLevel(level=LOG_LEVEL)
+
+# class _TestLoggingProcessName(BaseTestCase):
+#
+# def handle(self, record):
+# assert record.processName == multiprocessing.current_process().name
+# self.__handled = True
+#
+# def test_logging(self):
+# handler = logging.Handler()
+# handler.handle = self.handle
+# self.__handled = False
+# # Bypass getLogger() and side-effects
+# logger = logging.getLoggerClass()(
+# 'multiprocessing.test.TestLoggingProcessName')
+# logger.addHandler(handler)
+# logger.propagate = False
+#
+# logger.warn('foo')
+# assert self.__handled
+
#
# Test to verify handle verification, see issue 3321
#
class TestInvalidHandle(unittest.TestCase):
+ @unittest.skipIf(WIN32, "skipped on Windows")
def test_invalid_handles(self):
- if WIN32:
- return
conn = _multiprocessing.Connection(44977608)
self.assertRaises(IOError, conn.poll)
self.assertRaises(IOError, _multiprocessing.Connection, -1)
+
#
# Functions used to create test cases from the base ones in this module
#
@@ -1744,7 +1866,7 @@ def get_attributes(Source, names):
def create_test_cases(Mixin, type):
result = {}
glob = globals()
- Type = type[0].upper() + type[1:]
+ Type = type.capitalize()
for name in glob.keys():
if name.startswith('_Test'):
@@ -1833,6 +1955,36 @@ class OtherTest(unittest.TestCase):
_FakeConnection(), b'abc')
#
+# Test Manager.start()/Pool.__init__() initializer feature - see issue 5585
+#
+
+def initializer(ns):
+ ns.test += 1
+
+class TestInitializers(unittest.TestCase):
+ def setUp(self):
+ self.mgr = multiprocessing.Manager()
+ self.ns = self.mgr.Namespace()
+ self.ns.test = 0
+
+ def tearDown(self):
+ self.mgr.shutdown()
+
+ def test_manager_initializer(self):
+ m = multiprocessing.managers.SyncManager()
+ self.assertRaises(TypeError, m.start, 1)
+ m.start(initializer, (self.ns,))
+ self.assertEqual(self.ns.test, 1)
+ m.shutdown()
+
+ def test_pool_initializer(self):
+ self.assertRaises(TypeError, multiprocessing.Pool, initializer=1)
+ p = multiprocessing.Pool(1, initializer, (self.ns,))
+ p.close()
+ p.join()
+ self.assertEqual(self.ns.test, 1)
+
+#
# Issue 5155, 5313, 5331: Test process in processes
# Verifies os.close(sys.stdin.fileno) vs. sys.stdin.close() behavior
#
@@ -1898,7 +2050,8 @@ class TestStdinBadfiledescriptor(unittest.TestCase):
flike.flush()
assert sio.getvalue() == 'foo'
-testcases_other = [OtherTest, TestInvalidHandle, TestStdinBadfiledescriptor]
+testcases_other = [OtherTest, TestInvalidHandle, TestInitializers,
+ TestStdinBadfiledescriptor]
#
#
@@ -1909,8 +2062,7 @@ def test_main(run=None):
try:
lock = multiprocessing.RLock()
except OSError:
- from test.test_support import TestSkipped
- raise TestSkipped("OSError raises on RLock creation, see issue 3111!")
+ raise unittest.SkipTest("OSError raises on RLock creation, see issue 3111!")
if run is None:
from test.test_support import run_unittest as run
@@ -1934,8 +2086,14 @@ def test_main(run=None):
loadTestsFromTestCase = unittest.defaultTestLoader.loadTestsFromTestCase
suite = unittest.TestSuite(loadTestsFromTestCase(tc) for tc in testcases)
- with test_support._check_py3k_warnings(
- (".+__(get|set)slice__ has been removed", DeprecationWarning)):
+ # (ncoghlan): Whether or not sys.exc_clear is executed by the threading
+ # module during these tests is at least platform dependent and possibly
+ # non-deterministic on any given platform. So we don't mind if the listed
+ # warnings aren't actually raised.
+ with test_support.check_py3k_warnings(
+ (".+__(get|set)slice__ has been removed", DeprecationWarning),
+ (r"sys.exc_clear\(\) not supported", DeprecationWarning),
+ quiet=True):
run(suite)
ThreadsMixin.pool.terminate()
diff --git a/Lib/test/test_mutex.py b/Lib/test/test_mutex.py
index 4e3f7cd9e5..2882213394 100644
--- a/Lib/test/test_mutex.py
+++ b/Lib/test/test_mutex.py
@@ -9,14 +9,14 @@ class MutexTest(unittest.TestCase):
def called_by_mutex(some_data):
self.assertEqual(some_data, "spam")
- self.assert_(m.test(), "mutex not held")
+ self.assertTrue(m.test(), "mutex not held")
# Nested locking
m.lock(called_by_mutex2, "eggs")
def called_by_mutex2(some_data):
self.assertEquals(some_data, "eggs")
- self.assert_(m.test(), "mutex not held")
- self.assert_(ready_for_2,
+ self.assertTrue(m.test(), "mutex not held")
+ self.assertTrue(ready_for_2,
"called_by_mutex2 called too soon")
m = mutex.mutex()
@@ -26,7 +26,7 @@ class MutexTest(unittest.TestCase):
# unlock both locks
m.unlock()
m.unlock()
- self.failIf(m.test(), "mutex still held")
+ self.assertFalse(m.test(), "mutex still held")
def test_main():
test.test_support.run_unittest(MutexTest)
diff --git a/Lib/test/test_netrc.py b/Lib/test/test_netrc.py
index b536255aba..a988430ae0 100644
--- a/Lib/test/test_netrc.py
+++ b/Lib/test/test_netrc.py
@@ -3,7 +3,13 @@ import netrc, os, unittest, sys
from test import test_support
TEST_NETRC = """
+
+ #this is a comment
+#this is a comment
+# this is a comment
+
machine foo login log1 password pass1 account acct1
+machine bar login log1 password pass# account acct1
macdef macro1
line1
@@ -28,18 +34,21 @@ class NetrcTestCase(unittest.TestCase):
fp = open(temp_filename, mode)
fp.write(TEST_NETRC)
fp.close()
- self.netrc = netrc.netrc(temp_filename)
+ self.nrc = netrc.netrc(temp_filename)
def tearDown (self):
- del self.netrc
os.unlink(temp_filename)
def test_case_1(self):
- self.assert_(self.netrc.macros == {'macro1':['line1\n', 'line2\n'],
- 'macro2':['line3\n', 'line4\n']}
- )
- self.assert_(self.netrc.hosts['foo'] == ('log1', 'acct1', 'pass1'))
- self.assert_(self.netrc.hosts['default'] == ('log2', None, 'pass2'))
+ self.assertEqual(self.nrc.hosts['foo'], ('log1', 'acct1', 'pass1'))
+ self.assertEqual(self.nrc.hosts['default'], ('log2', None, 'pass2'))
+
+ def test_macros(self):
+ self.assertEqual(self.nrc.macros, {'macro1':['line1\n', 'line2\n'],
+ 'macro2':['line3\n', 'line4\n']})
+
+ def test_parses_passwords_with_hash_character(self):
+ self.assertEqual(self.nrc.hosts['bar'], ('log1', 'acct1', 'pass#'))
def test_main():
test_support.run_unittest(NetrcTestCase)
diff --git a/Lib/test/test_new.py b/Lib/test/test_new.py
index 231f4bb745..a84b3d10d4 100644
--- a/Lib/test/test_new.py
+++ b/Lib/test/test_new.py
@@ -154,7 +154,7 @@ class NewTest(unittest.TestCase):
d = new.code(argcount, nlocals, stacksize, flags, codestring,
constants, t, varnames, filename, name,
firstlineno, lnotab)
- self.assert_(type(t[0]) is S, "eek, tuple changed under us!")
+ self.assertTrue(type(t[0]) is S, "eek, tuple changed under us!")
def test_main():
test_support.run_unittest(NewTest)
diff --git a/Lib/test/test_nis.py b/Lib/test/test_nis.py
index c958d4b23a..8d495505d1 100644
--- a/Lib/test/test_nis.py
+++ b/Lib/test/test_nis.py
@@ -1,6 +1,7 @@
from test import test_support
import unittest
-import nis
+
+nis = test_support.import_module('nis')
class NisTests(unittest.TestCase):
def test_maps(self):
@@ -10,7 +11,7 @@ class NisTests(unittest.TestCase):
# NIS is probably not active, so this test isn't useful
if test_support.verbose:
print "Test Skipped:", msg
- # Can't raise TestSkipped as regrtest only recognizes the exception
+ # Can't raise SkipTest as regrtest only recognizes the exception
# import time.
return
try:
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
index 4a0f1c5005..3040a08618 100644
--- a/Lib/test/test_normalization.py
+++ b/Lib/test/test_normalization.py
@@ -1,19 +1,17 @@
-from test.test_support import run_unittest, open_urlresource, TestSkipped
+from test.test_support import run_unittest, open_urlresource
import unittest
+from httplib import HTTPException
import sys
import os
from unicodedata import normalize, unidata_version
-TESTDATAFILE = "NormalizationTest" + os.extsep + "txt"
+TESTDATAFILE = "NormalizationTest.txt"
TESTDATAURL = "http://www.unicode.org/Public/" + unidata_version + "/ucd/" + TESTDATAFILE
-if os.path.exists(TESTDATAFILE):
- f = open(TESTDATAFILE)
- l = f.readline()
- f.close()
- if not unidata_version in l:
- os.unlink(TESTDATAFILE)
+def check_version(testfile):
+ hdr = testfile.readline()
+ return unidata_version in hdr
class RangeError(Exception):
pass
@@ -39,8 +37,14 @@ def unistr(data):
class NormalizationTest(unittest.TestCase):
def test_main(self):
+ part = None
part1_data = {}
- for line in open_urlresource(TESTDATAURL):
+ # Hit the exception early
+ try:
+ testdata = open_urlresource(TESTDATAURL, check_version)
+ except (IOError, HTTPException):
+ self.skipTest("Could not retrieve " + TESTDATAURL)
+ for line in testdata:
if '#' in line:
line = line.split('#')[0]
line = line.strip()
@@ -64,14 +68,14 @@ class NormalizationTest(unittest.TestCase):
continue
# Perform tests
- self.failUnless(c2 == NFC(c1) == NFC(c2) == NFC(c3), line)
- self.failUnless(c4 == NFC(c4) == NFC(c5), line)
- self.failUnless(c3 == NFD(c1) == NFD(c2) == NFD(c3), line)
- self.failUnless(c5 == NFD(c4) == NFD(c5), line)
- self.failUnless(c4 == NFKC(c1) == NFKC(c2) == \
+ self.assertTrue(c2 == NFC(c1) == NFC(c2) == NFC(c3), line)
+ self.assertTrue(c4 == NFC(c4) == NFC(c5), line)
+ self.assertTrue(c3 == NFD(c1) == NFD(c2) == NFD(c3), line)
+ self.assertTrue(c5 == NFD(c4) == NFD(c5), line)
+ self.assertTrue(c4 == NFKC(c1) == NFKC(c2) == \
NFKC(c3) == NFKC(c4) == NFKC(c5),
line)
- self.failUnless(c5 == NFKD(c1) == NFKD(c2) == \
+ self.assertTrue(c5 == NFKD(c1) == NFKD(c2) == \
NFKD(c3) == NFKD(c4) == NFKD(c5),
line)
@@ -84,7 +88,7 @@ class NormalizationTest(unittest.TestCase):
X = unichr(c)
if X in part1_data:
continue
- self.failUnless(X == NFC(X) == NFD(X) == NFKC(X) == NFKD(X), c)
+ self.assertTrue(X == NFC(X) == NFD(X) == NFKC(X) == NFKD(X), c)
def test_bug_834676(self):
# Check for bug 834676
@@ -92,11 +96,6 @@ class NormalizationTest(unittest.TestCase):
def test_main():
- # Hit the exception early
- try:
- open_urlresource(TESTDATAURL)
- except IOError:
- raise TestSkipped("could not retrieve " + TESTDATAURL)
run_unittest(NormalizationTest)
if __name__ == "__main__":
diff --git a/Lib/test/test_ntpath.py b/Lib/test/test_ntpath.py
index a42190786b..e1852c0eb7 100644
--- a/Lib/test/test_ntpath.py
+++ b/Lib/test/test_ntpath.py
@@ -1,7 +1,7 @@
import ntpath
import os
-from test.test_support import verbose, TestFailed
-import test.test_support as test_support
+from test.test_support import TestFailed
+from test import test_support, test_genericpath
import unittest
@@ -123,21 +123,15 @@ class TestNtpath(unittest.TestCase):
tester("ntpath.normpath('C:////a/b')", r'C:\a\b')
tester("ntpath.normpath('//machine/share//a/b')", r'\\machine\share\a\b')
- # Issue 5827: Make sure normpath preserves unicode
- for path in (u'', u'.', u'/', u'\\', u'///foo/.//bar//'):
- self.assertTrue(isinstance(ntpath.normpath(path), unicode),
- 'normpath() returned str instead of unicode')
-
tester("ntpath.normpath('\\\\.\\NUL')", r'\\.\NUL')
tester("ntpath.normpath('\\\\?\\D:/XY\\Z')", r'\\?\D:/XY\Z')
def test_expandvars(self):
- oldenv = os.environ.copy()
- try:
- os.environ.clear()
- os.environ["foo"] = "bar"
- os.environ["{foo"] = "baz1"
- os.environ["{foo}"] = "baz2"
+ with test_support.EnvironmentVarGuard() as env:
+ env.clear()
+ env["foo"] = "bar"
+ env["{foo"] = "baz1"
+ env["{foo}"] = "baz2"
tester('ntpath.expandvars("foo")', "foo")
tester('ntpath.expandvars("$foo bar")', "bar bar")
tester('ntpath.expandvars("${foo}bar")', "barbar")
@@ -157,9 +151,6 @@ class TestNtpath(unittest.TestCase):
tester('ntpath.expandvars("%?bar%")', "%?bar%")
tester('ntpath.expandvars("%foo%%bar")', "bar%bar")
tester('ntpath.expandvars("\'%foo%\'%bar")', "\'%foo%\'%bar")
- finally:
- os.environ.clear()
- os.environ.update(oldenv)
def test_abspath(self):
# ntpath.abspath() can only be used on a system with the "nt" module
@@ -176,23 +167,6 @@ class TestNtpath(unittest.TestCase):
else:
tester('ntpath.abspath("C:\\")', "C:\\")
- # Issue 3426: check that abspath retuns unicode when the arg is
- # unicode and str when it's str, with both ASCII and non-ASCII cwds
- saved_cwd = os.getcwd()
- for cwd in (u'cwd', u'\xe7w\xf0'):
- try:
- os.mkdir(cwd)
- os.chdir(cwd)
- for path in ('', 'foo', 'f\xf2\xf2', '/foo', 'C:\\'):
- self.assertTrue(isinstance(ntpath.abspath(path), str))
- for upath in (u'', u'fuu', u'f\xf9\xf9', u'/fuu', u'U:\\'):
- self.assertTrue(isinstance(ntpath.abspath(upath),
- unicode))
- finally:
- os.chdir(saved_cwd)
- os.rmdir(cwd)
-
-
def test_relpath(self):
currentdir = os.path.split(os.getcwd())[-1]
tester('ntpath.relpath("a")', 'a')
@@ -204,10 +178,25 @@ class TestNtpath(unittest.TestCase):
tester('ntpath.relpath("a", "b/c")', '..\\..\\a')
tester('ntpath.relpath("//conky/mountpoint/a", "//conky/mountpoint/b/c")', '..\\..\\a')
tester('ntpath.relpath("a", "a")', '.')
+ tester('ntpath.relpath("/foo/bar/bat", "/x/y/z")', '..\\..\\..\\foo\\bar\\bat')
+ tester('ntpath.relpath("/foo/bar/bat", "/foo/bar")', 'bat')
+ tester('ntpath.relpath("/foo/bar/bat", "/")', 'foo\\bar\\bat')
+ tester('ntpath.relpath("/", "/foo/bar/bat")', '..\\..\\..')
+ tester('ntpath.relpath("/foo/bar/bat", "/x")', '..\\foo\\bar\\bat')
+ tester('ntpath.relpath("/x", "/foo/bar/bat")', '..\\..\\..\\x')
+ tester('ntpath.relpath("/", "/")', '.')
+ tester('ntpath.relpath("/a", "/a")', '.')
+ tester('ntpath.relpath("/a/b", "/a/b")', '.')
+ tester('ntpath.relpath("c:/foo", "C:/FOO")', '.')
+
+
+class NtCommonTest(test_genericpath.CommonTest):
+ pathmodule = ntpath
+ attributes = ['relpath', 'splitunc']
def test_main():
- test_support.run_unittest(TestNtpath)
+ test_support.run_unittest(TestNtpath, NtCommonTest)
if __name__ == "__main__":
diff --git a/Lib/test/test_old_mailbox.py b/Lib/test/test_old_mailbox.py
index add9406202..e8dff5079b 100644
--- a/Lib/test/test_old_mailbox.py
+++ b/Lib/test/test_old_mailbox.py
@@ -48,18 +48,16 @@ class MaildirTestCase(unittest.TestCase):
filename = os.extsep.join((str(t), str(pid), "myhostname", "mydomain"))
tmpname = os.path.join(self._dir, "tmp", filename)
newname = os.path.join(self._dir, dir, filename)
- fp = open(tmpname, "w")
- self._msgfiles.append(tmpname)
- if mbox:
- fp.write(FROM_)
- fp.write(DUMMY_MESSAGE)
- fp.close()
+ with open(tmpname, "w") as fp:
+ self._msgfiles.append(tmpname)
+ if mbox:
+ fp.write(FROM_)
+ fp.write(DUMMY_MESSAGE)
if hasattr(os, "link"):
os.link(tmpname, newname)
else:
- fp = open(newname, "w")
- fp.write(DUMMY_MESSAGE)
- fp.close()
+ with open(newname, "w") as fp:
+ fp.write(DUMMY_MESSAGE)
self._msgfiles.append(newname)
return tmpname
@@ -67,46 +65,47 @@ class MaildirTestCase(unittest.TestCase):
"""Test an empty maildir mailbox"""
# Test for regression on bug #117490:
self.mbox = mailbox.Maildir(test_support.TESTFN)
- self.assert_(len(self.mbox) == 0)
- self.assert_(self.mbox.next() is None)
- self.assert_(self.mbox.next() is None)
+ self.assertTrue(len(self.mbox) == 0)
+ self.assertTrue(self.mbox.next() is None)
+ self.assertTrue(self.mbox.next() is None)
def test_nonempty_maildir_cur(self):
self.createMessage("cur")
self.mbox = mailbox.Maildir(test_support.TESTFN)
- self.assert_(len(self.mbox) == 1)
- self.assert_(self.mbox.next() is not None)
- self.assert_(self.mbox.next() is None)
- self.assert_(self.mbox.next() is None)
+ self.assertTrue(len(self.mbox) == 1)
+ self.assertTrue(self.mbox.next() is not None)
+ self.assertTrue(self.mbox.next() is None)
+ self.assertTrue(self.mbox.next() is None)
def test_nonempty_maildir_new(self):
self.createMessage("new")
self.mbox = mailbox.Maildir(test_support.TESTFN)
- self.assert_(len(self.mbox) == 1)
- self.assert_(self.mbox.next() is not None)
- self.assert_(self.mbox.next() is None)
- self.assert_(self.mbox.next() is None)
+ self.assertTrue(len(self.mbox) == 1)
+ self.assertTrue(self.mbox.next() is not None)
+ self.assertTrue(self.mbox.next() is None)
+ self.assertTrue(self.mbox.next() is None)
def test_nonempty_maildir_both(self):
self.createMessage("cur")
self.createMessage("new")
self.mbox = mailbox.Maildir(test_support.TESTFN)
- self.assert_(len(self.mbox) == 2)
- self.assert_(self.mbox.next() is not None)
- self.assert_(self.mbox.next() is not None)
- self.assert_(self.mbox.next() is None)
- self.assert_(self.mbox.next() is None)
+ self.assertTrue(len(self.mbox) == 2)
+ self.assertTrue(self.mbox.next() is not None)
+ self.assertTrue(self.mbox.next() is not None)
+ self.assertTrue(self.mbox.next() is None)
+ self.assertTrue(self.mbox.next() is None)
def test_unix_mbox(self):
### should be better!
import email.parser
fname = self.createMessage("cur", True)
n = 0
- for msg in mailbox.PortableUnixMailbox(open(fname),
+ with open(fname) as f:
+ for msg in mailbox.PortableUnixMailbox(f,
email.parser.Parser().parse):
- n += 1
- self.assertEqual(msg["subject"], "Simple Test")
- self.assertEqual(len(str(msg)), len(FROM_)+len(DUMMY_MESSAGE))
+ n += 1
+ self.assertEqual(msg["subject"], "Simple Test")
+ self.assertEqual(len(str(msg)), len(FROM_)+len(DUMMY_MESSAGE))
self.assertEqual(n, 1)
class MboxTestCase(unittest.TestCase):
@@ -119,8 +118,8 @@ class MboxTestCase(unittest.TestCase):
def test_from_regex (self):
# Testing new regex from bug #1633678
- f = open(self._path, 'w')
- f.write("""From fred@example.com Mon May 31 13:24:50 2004 +0200
+ with open(self._path, 'w') as f:
+ f.write("""From fred@example.com Mon May 31 13:24:50 2004 +0200
Subject: message 1
body1
@@ -137,9 +136,9 @@ Subject: message 4
body4
""")
- f.close()
- box = mailbox.UnixMailbox(open(self._path, 'r'))
- self.assert_(len(list(iter(box))) == 4)
+ with open(self._path, 'r') as f:
+ box = mailbox.UnixMailbox(f)
+ self.assertTrue(len(list(iter(box))) == 4)
# XXX We still need more tests!
diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py
index 36bd3ff225..6d117d62b1 100644
--- a/Lib/test/test_opcodes.py
+++ b/Lib/test/test_opcodes.py
@@ -1,6 +1,6 @@
# Python test set -- part 2, opcodes
-from test.test_support import run_unittest, _check_py3k_warnings
+from test.test_support import run_unittest, check_py3k_warnings
import unittest
class OpcodeTest(unittest.TestCase):
@@ -64,7 +64,7 @@ class OpcodeTest(unittest.TestCase):
try: raise DClass, a
except DClass, v:
- self.assert_(isinstance(v, DClass))
+ self.assertIsInstance(v, DClass)
else:
self.fail("no exception")
@@ -72,39 +72,45 @@ class OpcodeTest(unittest.TestCase):
f = eval('lambda: None')
g = eval('lambda: None')
- self.assertNotEquals(f, g)
+ self.assertNotEqual(f, g)
f = eval('lambda a: a')
g = eval('lambda a: a')
- self.assertNotEquals(f, g)
+ self.assertNotEqual(f, g)
f = eval('lambda a=1: a')
g = eval('lambda a=1: a')
- self.assertNotEquals(f, g)
+ self.assertNotEqual(f, g)
f = eval('lambda: 0')
g = eval('lambda: 1')
- self.assertNotEquals(f, g)
+ self.assertNotEqual(f, g)
f = eval('lambda: None')
g = eval('lambda a: None')
- self.assertNotEquals(f, g)
+ self.assertNotEqual(f, g)
f = eval('lambda a: None')
g = eval('lambda b: None')
- self.assertNotEquals(f, g)
+ self.assertNotEqual(f, g)
f = eval('lambda a: None')
g = eval('lambda a=None: None')
- self.assertNotEquals(f, g)
+ self.assertNotEqual(f, g)
f = eval('lambda a=0: None')
g = eval('lambda a=1: None')
- self.assertNotEquals(f, g)
+ self.assertNotEqual(f, g)
+
+ def test_modulo_of_string_subclasses(self):
+ class MyString(str):
+ def __mod__(self, value):
+ return 42
+ self.assertEqual(MyString() % 3, 42)
def test_main():
- with _check_py3k_warnings(("exceptions must derive from BaseException",
+ with check_py3k_warnings(("exceptions must derive from BaseException",
DeprecationWarning),
("catching classes that don't inherit "
"from BaseException is not allowed",
diff --git a/Lib/test/test_openpty.py b/Lib/test/test_openpty.py
index 6471f58ce5..20c4fe239c 100644
--- a/Lib/test/test_openpty.py
+++ b/Lib/test/test_openpty.py
@@ -1,10 +1,10 @@
# Test to see if openpty works. (But don't worry if it isn't available.)
import os, unittest
-from test.test_support import run_unittest, TestSkipped
+from test.test_support import run_unittest
if not hasattr(os, "openpty"):
- raise TestSkipped, "No openpty() available."
+ raise unittest.SkipTest, "No openpty() available."
class OpenptyTest(unittest.TestCase):
diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py
index 4e9b3c481f..81a80201d4 100644
--- a/Lib/test/test_operator.py
+++ b/Lib/test/test_operator.py
@@ -34,166 +34,166 @@ class Seq2(object):
class OperatorTestCase(unittest.TestCase):
def test_lt(self):
- self.failUnlessRaises(TypeError, operator.lt)
- self.failUnlessRaises(TypeError, operator.lt, 1j, 2j)
- self.failIf(operator.lt(1, 0))
- self.failIf(operator.lt(1, 0.0))
- self.failIf(operator.lt(1, 1))
- self.failIf(operator.lt(1, 1.0))
- self.failUnless(operator.lt(1, 2))
- self.failUnless(operator.lt(1, 2.0))
+ self.assertRaises(TypeError, operator.lt)
+ self.assertRaises(TypeError, operator.lt, 1j, 2j)
+ self.assertFalse(operator.lt(1, 0))
+ self.assertFalse(operator.lt(1, 0.0))
+ self.assertFalse(operator.lt(1, 1))
+ self.assertFalse(operator.lt(1, 1.0))
+ self.assertTrue(operator.lt(1, 2))
+ self.assertTrue(operator.lt(1, 2.0))
def test_le(self):
- self.failUnlessRaises(TypeError, operator.le)
- self.failUnlessRaises(TypeError, operator.le, 1j, 2j)
- self.failIf(operator.le(1, 0))
- self.failIf(operator.le(1, 0.0))
- self.failUnless(operator.le(1, 1))
- self.failUnless(operator.le(1, 1.0))
- self.failUnless(operator.le(1, 2))
- self.failUnless(operator.le(1, 2.0))
+ self.assertRaises(TypeError, operator.le)
+ self.assertRaises(TypeError, operator.le, 1j, 2j)
+ self.assertFalse(operator.le(1, 0))
+ self.assertFalse(operator.le(1, 0.0))
+ self.assertTrue(operator.le(1, 1))
+ self.assertTrue(operator.le(1, 1.0))
+ self.assertTrue(operator.le(1, 2))
+ self.assertTrue(operator.le(1, 2.0))
def test_eq(self):
class C(object):
def __eq__(self, other):
raise SyntaxError
__hash__ = None # Silence Py3k warning
- self.failUnlessRaises(TypeError, operator.eq)
- self.failUnlessRaises(SyntaxError, operator.eq, C(), C())
- self.failIf(operator.eq(1, 0))
- self.failIf(operator.eq(1, 0.0))
- self.failUnless(operator.eq(1, 1))
- self.failUnless(operator.eq(1, 1.0))
- self.failIf(operator.eq(1, 2))
- self.failIf(operator.eq(1, 2.0))
+ self.assertRaises(TypeError, operator.eq)
+ self.assertRaises(SyntaxError, operator.eq, C(), C())
+ self.assertFalse(operator.eq(1, 0))
+ self.assertFalse(operator.eq(1, 0.0))
+ self.assertTrue(operator.eq(1, 1))
+ self.assertTrue(operator.eq(1, 1.0))
+ self.assertFalse(operator.eq(1, 2))
+ self.assertFalse(operator.eq(1, 2.0))
def test_ne(self):
class C(object):
def __ne__(self, other):
raise SyntaxError
- self.failUnlessRaises(TypeError, operator.ne)
- self.failUnlessRaises(SyntaxError, operator.ne, C(), C())
- self.failUnless(operator.ne(1, 0))
- self.failUnless(operator.ne(1, 0.0))
- self.failIf(operator.ne(1, 1))
- self.failIf(operator.ne(1, 1.0))
- self.failUnless(operator.ne(1, 2))
- self.failUnless(operator.ne(1, 2.0))
+ self.assertRaises(TypeError, operator.ne)
+ self.assertRaises(SyntaxError, operator.ne, C(), C())
+ self.assertTrue(operator.ne(1, 0))
+ self.assertTrue(operator.ne(1, 0.0))
+ self.assertFalse(operator.ne(1, 1))
+ self.assertFalse(operator.ne(1, 1.0))
+ self.assertTrue(operator.ne(1, 2))
+ self.assertTrue(operator.ne(1, 2.0))
def test_ge(self):
- self.failUnlessRaises(TypeError, operator.ge)
- self.failUnlessRaises(TypeError, operator.ge, 1j, 2j)
- self.failUnless(operator.ge(1, 0))
- self.failUnless(operator.ge(1, 0.0))
- self.failUnless(operator.ge(1, 1))
- self.failUnless(operator.ge(1, 1.0))
- self.failIf(operator.ge(1, 2))
- self.failIf(operator.ge(1, 2.0))
+ self.assertRaises(TypeError, operator.ge)
+ self.assertRaises(TypeError, operator.ge, 1j, 2j)
+ self.assertTrue(operator.ge(1, 0))
+ self.assertTrue(operator.ge(1, 0.0))
+ self.assertTrue(operator.ge(1, 1))
+ self.assertTrue(operator.ge(1, 1.0))
+ self.assertFalse(operator.ge(1, 2))
+ self.assertFalse(operator.ge(1, 2.0))
def test_gt(self):
- self.failUnlessRaises(TypeError, operator.gt)
- self.failUnlessRaises(TypeError, operator.gt, 1j, 2j)
- self.failUnless(operator.gt(1, 0))
- self.failUnless(operator.gt(1, 0.0))
- self.failIf(operator.gt(1, 1))
- self.failIf(operator.gt(1, 1.0))
- self.failIf(operator.gt(1, 2))
- self.failIf(operator.gt(1, 2.0))
+ self.assertRaises(TypeError, operator.gt)
+ self.assertRaises(TypeError, operator.gt, 1j, 2j)
+ self.assertTrue(operator.gt(1, 0))
+ self.assertTrue(operator.gt(1, 0.0))
+ self.assertFalse(operator.gt(1, 1))
+ self.assertFalse(operator.gt(1, 1.0))
+ self.assertFalse(operator.gt(1, 2))
+ self.assertFalse(operator.gt(1, 2.0))
def test_abs(self):
- self.failUnlessRaises(TypeError, operator.abs)
- self.failUnlessRaises(TypeError, operator.abs, None)
- self.failUnless(operator.abs(-1) == 1)
- self.failUnless(operator.abs(1) == 1)
+ self.assertRaises(TypeError, operator.abs)
+ self.assertRaises(TypeError, operator.abs, None)
+ self.assertTrue(operator.abs(-1) == 1)
+ self.assertTrue(operator.abs(1) == 1)
def test_add(self):
- self.failUnlessRaises(TypeError, operator.add)
- self.failUnlessRaises(TypeError, operator.add, None, None)
- self.failUnless(operator.add(3, 4) == 7)
+ self.assertRaises(TypeError, operator.add)
+ self.assertRaises(TypeError, operator.add, None, None)
+ self.assertTrue(operator.add(3, 4) == 7)
def test_bitwise_and(self):
- self.failUnlessRaises(TypeError, operator.and_)
- self.failUnlessRaises(TypeError, operator.and_, None, None)
- self.failUnless(operator.and_(0xf, 0xa) == 0xa)
+ self.assertRaises(TypeError, operator.and_)
+ self.assertRaises(TypeError, operator.and_, None, None)
+ self.assertTrue(operator.and_(0xf, 0xa) == 0xa)
def test_concat(self):
- self.failUnlessRaises(TypeError, operator.concat)
- self.failUnlessRaises(TypeError, operator.concat, None, None)
- self.failUnless(operator.concat('py', 'thon') == 'python')
- self.failUnless(operator.concat([1, 2], [3, 4]) == [1, 2, 3, 4])
- self.failUnless(operator.concat(Seq1([5, 6]), Seq1([7])) == [5, 6, 7])
- self.failUnless(operator.concat(Seq2([5, 6]), Seq2([7])) == [5, 6, 7])
- self.failUnlessRaises(TypeError, operator.concat, 13, 29)
+ self.assertRaises(TypeError, operator.concat)
+ self.assertRaises(TypeError, operator.concat, None, None)
+ self.assertTrue(operator.concat('py', 'thon') == 'python')
+ self.assertTrue(operator.concat([1, 2], [3, 4]) == [1, 2, 3, 4])
+ self.assertTrue(operator.concat(Seq1([5, 6]), Seq1([7])) == [5, 6, 7])
+ self.assertTrue(operator.concat(Seq2([5, 6]), Seq2([7])) == [5, 6, 7])
+ self.assertRaises(TypeError, operator.concat, 13, 29)
def test_countOf(self):
- self.failUnlessRaises(TypeError, operator.countOf)
- self.failUnlessRaises(TypeError, operator.countOf, None, None)
- self.failUnless(operator.countOf([1, 2, 1, 3, 1, 4], 3) == 1)
- self.failUnless(operator.countOf([1, 2, 1, 3, 1, 4], 5) == 0)
+ self.assertRaises(TypeError, operator.countOf)
+ self.assertRaises(TypeError, operator.countOf, None, None)
+ self.assertTrue(operator.countOf([1, 2, 1, 3, 1, 4], 3) == 1)
+ self.assertTrue(operator.countOf([1, 2, 1, 3, 1, 4], 5) == 0)
def test_delitem(self):
a = [4, 3, 2, 1]
- self.failUnlessRaises(TypeError, operator.delitem, a)
- self.failUnlessRaises(TypeError, operator.delitem, a, None)
- self.failUnless(operator.delitem(a, 1) is None)
- self.assert_(a == [4, 2, 1])
+ self.assertRaises(TypeError, operator.delitem, a)
+ self.assertRaises(TypeError, operator.delitem, a, None)
+ self.assertTrue(operator.delitem(a, 1) is None)
+ self.assertTrue(a == [4, 2, 1])
def test_delslice(self):
a = range(10)
- self.failUnlessRaises(TypeError, operator.delslice, a)
- self.failUnlessRaises(TypeError, operator.delslice, a, None, None)
- self.failUnless(operator.delslice(a, 2, 8) is None)
- self.assert_(a == [0, 1, 8, 9])
+ self.assertRaises(TypeError, operator.delslice, a)
+ self.assertRaises(TypeError, operator.delslice, a, None, None)
+ self.assertTrue(operator.delslice(a, 2, 8) is None)
+ self.assertTrue(a == [0, 1, 8, 9])
operator.delslice(a, 0, test_support.MAX_Py_ssize_t)
- self.assert_(a == [])
+ self.assertTrue(a == [])
def test_div(self):
- self.failUnlessRaises(TypeError, operator.div, 5)
- self.failUnlessRaises(TypeError, operator.div, None, None)
- self.failUnless(operator.floordiv(5, 2) == 2)
+ self.assertRaises(TypeError, operator.div, 5)
+ self.assertRaises(TypeError, operator.div, None, None)
+ self.assertTrue(operator.floordiv(5, 2) == 2)
def test_floordiv(self):
- self.failUnlessRaises(TypeError, operator.floordiv, 5)
- self.failUnlessRaises(TypeError, operator.floordiv, None, None)
- self.failUnless(operator.floordiv(5, 2) == 2)
+ self.assertRaises(TypeError, operator.floordiv, 5)
+ self.assertRaises(TypeError, operator.floordiv, None, None)
+ self.assertTrue(operator.floordiv(5, 2) == 2)
def test_truediv(self):
- self.failUnlessRaises(TypeError, operator.truediv, 5)
- self.failUnlessRaises(TypeError, operator.truediv, None, None)
- self.failUnless(operator.truediv(5, 2) == 2.5)
+ self.assertRaises(TypeError, operator.truediv, 5)
+ self.assertRaises(TypeError, operator.truediv, None, None)
+ self.assertTrue(operator.truediv(5, 2) == 2.5)
def test_getitem(self):
a = range(10)
- self.failUnlessRaises(TypeError, operator.getitem)
- self.failUnlessRaises(TypeError, operator.getitem, a, None)
- self.failUnless(operator.getitem(a, 2) == 2)
+ self.assertRaises(TypeError, operator.getitem)
+ self.assertRaises(TypeError, operator.getitem, a, None)
+ self.assertTrue(operator.getitem(a, 2) == 2)
def test_getslice(self):
a = range(10)
- self.failUnlessRaises(TypeError, operator.getslice)
- self.failUnlessRaises(TypeError, operator.getslice, a, None, None)
- self.failUnless(operator.getslice(a, 4, 6) == [4, 5])
+ self.assertRaises(TypeError, operator.getslice)
+ self.assertRaises(TypeError, operator.getslice, a, None, None)
+ self.assertTrue(operator.getslice(a, 4, 6) == [4, 5])
b = operator.getslice(a, 0, test_support.MAX_Py_ssize_t)
- self.assert_(b == a)
+ self.assertTrue(b == a)
def test_indexOf(self):
- self.failUnlessRaises(TypeError, operator.indexOf)
- self.failUnlessRaises(TypeError, operator.indexOf, None, None)
- self.failUnless(operator.indexOf([4, 3, 2, 1], 3) == 1)
+ self.assertRaises(TypeError, operator.indexOf)
+ self.assertRaises(TypeError, operator.indexOf, None, None)
+ self.assertTrue(operator.indexOf([4, 3, 2, 1], 3) == 1)
self.assertRaises(ValueError, operator.indexOf, [4, 3, 2, 1], 0)
def test_invert(self):
- self.failUnlessRaises(TypeError, operator.invert)
- self.failUnlessRaises(TypeError, operator.invert, None)
- self.failUnless(operator.inv(4) == -5)
+ self.assertRaises(TypeError, operator.invert)
+ self.assertRaises(TypeError, operator.invert, None)
+ self.assertTrue(operator.inv(4) == -5)
def test_isCallable(self):
- self.failUnlessRaises(TypeError, operator.isCallable)
+ self.assertRaises(TypeError, operator.isCallable)
class C:
pass
def check(self, o, v):
- self.assertEqual(operator.isCallable(o), v)
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
+ self.assertEqual(operator.isCallable(o), v)
self.assertEqual(callable(o), v)
check(self, 4, 0)
check(self, operator.isCallable, 1)
@@ -201,106 +201,106 @@ class OperatorTestCase(unittest.TestCase):
check(self, C(), 0)
def test_isMappingType(self):
- self.failUnlessRaises(TypeError, operator.isMappingType)
- self.failIf(operator.isMappingType(1))
- self.failIf(operator.isMappingType(operator.isMappingType))
- self.failUnless(operator.isMappingType(operator.__dict__))
- self.failUnless(operator.isMappingType({}))
+ self.assertRaises(TypeError, operator.isMappingType)
+ self.assertFalse(operator.isMappingType(1))
+ self.assertFalse(operator.isMappingType(operator.isMappingType))
+ self.assertTrue(operator.isMappingType(operator.__dict__))
+ self.assertTrue(operator.isMappingType({}))
def test_isNumberType(self):
- self.failUnlessRaises(TypeError, operator.isNumberType)
- self.failUnless(operator.isNumberType(8))
- self.failUnless(operator.isNumberType(8j))
- self.failUnless(operator.isNumberType(8L))
- self.failUnless(operator.isNumberType(8.3))
- self.failIf(operator.isNumberType(dir()))
+ self.assertRaises(TypeError, operator.isNumberType)
+ self.assertTrue(operator.isNumberType(8))
+ self.assertTrue(operator.isNumberType(8j))
+ self.assertTrue(operator.isNumberType(8L))
+ self.assertTrue(operator.isNumberType(8.3))
+ self.assertFalse(operator.isNumberType(dir()))
def test_isSequenceType(self):
- self.failUnlessRaises(TypeError, operator.isSequenceType)
- self.failUnless(operator.isSequenceType(dir()))
- self.failUnless(operator.isSequenceType(()))
- self.failUnless(operator.isSequenceType(xrange(10)))
- self.failUnless(operator.isSequenceType('yeahbuddy'))
- self.failIf(operator.isSequenceType(3))
+ self.assertRaises(TypeError, operator.isSequenceType)
+ self.assertTrue(operator.isSequenceType(dir()))
+ self.assertTrue(operator.isSequenceType(()))
+ self.assertTrue(operator.isSequenceType(xrange(10)))
+ self.assertTrue(operator.isSequenceType('yeahbuddy'))
+ self.assertFalse(operator.isSequenceType(3))
class Dict(dict): pass
- self.failIf(operator.isSequenceType(Dict()))
+ self.assertFalse(operator.isSequenceType(Dict()))
def test_lshift(self):
- self.failUnlessRaises(TypeError, operator.lshift)
- self.failUnlessRaises(TypeError, operator.lshift, None, 42)
- self.failUnless(operator.lshift(5, 1) == 10)
- self.failUnless(operator.lshift(5, 0) == 5)
+ self.assertRaises(TypeError, operator.lshift)
+ self.assertRaises(TypeError, operator.lshift, None, 42)
+ self.assertTrue(operator.lshift(5, 1) == 10)
+ self.assertTrue(operator.lshift(5, 0) == 5)
self.assertRaises(ValueError, operator.lshift, 2, -1)
def test_mod(self):
- self.failUnlessRaises(TypeError, operator.mod)
- self.failUnlessRaises(TypeError, operator.mod, None, 42)
- self.failUnless(operator.mod(5, 2) == 1)
+ self.assertRaises(TypeError, operator.mod)
+ self.assertRaises(TypeError, operator.mod, None, 42)
+ self.assertTrue(operator.mod(5, 2) == 1)
def test_mul(self):
- self.failUnlessRaises(TypeError, operator.mul)
- self.failUnlessRaises(TypeError, operator.mul, None, None)
- self.failUnless(operator.mul(5, 2) == 10)
+ self.assertRaises(TypeError, operator.mul)
+ self.assertRaises(TypeError, operator.mul, None, None)
+ self.assertTrue(operator.mul(5, 2) == 10)
def test_neg(self):
- self.failUnlessRaises(TypeError, operator.neg)
- self.failUnlessRaises(TypeError, operator.neg, None)
- self.failUnless(operator.neg(5) == -5)
- self.failUnless(operator.neg(-5) == 5)
- self.failUnless(operator.neg(0) == 0)
- self.failUnless(operator.neg(-0) == 0)
+ self.assertRaises(TypeError, operator.neg)
+ self.assertRaises(TypeError, operator.neg, None)
+ self.assertTrue(operator.neg(5) == -5)
+ self.assertTrue(operator.neg(-5) == 5)
+ self.assertTrue(operator.neg(0) == 0)
+ self.assertTrue(operator.neg(-0) == 0)
def test_bitwise_or(self):
- self.failUnlessRaises(TypeError, operator.or_)
- self.failUnlessRaises(TypeError, operator.or_, None, None)
- self.failUnless(operator.or_(0xa, 0x5) == 0xf)
+ self.assertRaises(TypeError, operator.or_)
+ self.assertRaises(TypeError, operator.or_, None, None)
+ self.assertTrue(operator.or_(0xa, 0x5) == 0xf)
def test_pos(self):
- self.failUnlessRaises(TypeError, operator.pos)
- self.failUnlessRaises(TypeError, operator.pos, None)
- self.failUnless(operator.pos(5) == 5)
- self.failUnless(operator.pos(-5) == -5)
- self.failUnless(operator.pos(0) == 0)
- self.failUnless(operator.pos(-0) == 0)
+ self.assertRaises(TypeError, operator.pos)
+ self.assertRaises(TypeError, operator.pos, None)
+ self.assertTrue(operator.pos(5) == 5)
+ self.assertTrue(operator.pos(-5) == -5)
+ self.assertTrue(operator.pos(0) == 0)
+ self.assertTrue(operator.pos(-0) == 0)
def test_pow(self):
- self.failUnlessRaises(TypeError, operator.pow)
- self.failUnlessRaises(TypeError, operator.pow, None, None)
- self.failUnless(operator.pow(3,5) == 3**5)
- self.failUnless(operator.__pow__(3,5) == 3**5)
+ self.assertRaises(TypeError, operator.pow)
+ self.assertRaises(TypeError, operator.pow, None, None)
+ self.assertTrue(operator.pow(3,5) == 3**5)
+ self.assertTrue(operator.__pow__(3,5) == 3**5)
self.assertRaises(TypeError, operator.pow, 1)
self.assertRaises(TypeError, operator.pow, 1, 2, 3)
def test_repeat(self):
a = range(3)
- self.failUnlessRaises(TypeError, operator.repeat)
- self.failUnlessRaises(TypeError, operator.repeat, a, None)
- self.failUnless(operator.repeat(a, 2) == a+a)
- self.failUnless(operator.repeat(a, 1) == a)
- self.failUnless(operator.repeat(a, 0) == [])
+ self.assertRaises(TypeError, operator.repeat)
+ self.assertRaises(TypeError, operator.repeat, a, None)
+ self.assertTrue(operator.repeat(a, 2) == a+a)
+ self.assertTrue(operator.repeat(a, 1) == a)
+ self.assertTrue(operator.repeat(a, 0) == [])
a = (1, 2, 3)
- self.failUnless(operator.repeat(a, 2) == a+a)
- self.failUnless(operator.repeat(a, 1) == a)
- self.failUnless(operator.repeat(a, 0) == ())
+ self.assertTrue(operator.repeat(a, 2) == a+a)
+ self.assertTrue(operator.repeat(a, 1) == a)
+ self.assertTrue(operator.repeat(a, 0) == ())
a = '123'
- self.failUnless(operator.repeat(a, 2) == a+a)
- self.failUnless(operator.repeat(a, 1) == a)
- self.failUnless(operator.repeat(a, 0) == '')
+ self.assertTrue(operator.repeat(a, 2) == a+a)
+ self.assertTrue(operator.repeat(a, 1) == a)
+ self.assertTrue(operator.repeat(a, 0) == '')
a = Seq1([4, 5, 6])
- self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6])
- self.failUnless(operator.repeat(a, 1) == [4, 5, 6])
- self.failUnless(operator.repeat(a, 0) == [])
+ self.assertTrue(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6])
+ self.assertTrue(operator.repeat(a, 1) == [4, 5, 6])
+ self.assertTrue(operator.repeat(a, 0) == [])
a = Seq2([4, 5, 6])
- self.failUnless(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6])
- self.failUnless(operator.repeat(a, 1) == [4, 5, 6])
- self.failUnless(operator.repeat(a, 0) == [])
- self.failUnlessRaises(TypeError, operator.repeat, 6, 7)
+ self.assertTrue(operator.repeat(a, 2) == [4, 5, 6, 4, 5, 6])
+ self.assertTrue(operator.repeat(a, 1) == [4, 5, 6])
+ self.assertTrue(operator.repeat(a, 0) == [])
+ self.assertRaises(TypeError, operator.repeat, 6, 7)
def test_rshift(self):
- self.failUnlessRaises(TypeError, operator.rshift)
- self.failUnlessRaises(TypeError, operator.rshift, None, 42)
- self.failUnless(operator.rshift(5, 1) == 2)
- self.failUnless(operator.rshift(5, 0) == 5)
+ self.assertRaises(TypeError, operator.rshift)
+ self.assertRaises(TypeError, operator.rshift, None, 42)
+ self.assertTrue(operator.rshift(5, 1) == 2)
+ self.assertTrue(operator.rshift(5, 0) == 5)
self.assertRaises(ValueError, operator.rshift, 2, -1)
def test_contains(self):
@@ -308,60 +308,61 @@ class OperatorTestCase(unittest.TestCase):
self.assertRaises(TypeError, operator.contains, None, None)
self.assertTrue(operator.contains(range(4), 2))
self.assertFalse(operator.contains(range(4), 5))
- self.assertTrue(operator.sequenceIncludes(range(4), 2))
- self.assertFalse(operator.sequenceIncludes(range(4), 5))
+ with test_support.check_py3k_warnings():
+ self.assertTrue(operator.sequenceIncludes(range(4), 2))
+ self.assertFalse(operator.sequenceIncludes(range(4), 5))
def test_setitem(self):
a = range(3)
- self.failUnlessRaises(TypeError, operator.setitem, a)
- self.failUnlessRaises(TypeError, operator.setitem, a, None, None)
- self.failUnless(operator.setitem(a, 0, 2) is None)
- self.assert_(a == [2, 1, 2])
+ self.assertRaises(TypeError, operator.setitem, a)
+ self.assertRaises(TypeError, operator.setitem, a, None, None)
+ self.assertTrue(operator.setitem(a, 0, 2) is None)
+ self.assertTrue(a == [2, 1, 2])
self.assertRaises(IndexError, operator.setitem, a, 4, 2)
def test_setslice(self):
a = range(4)
- self.failUnlessRaises(TypeError, operator.setslice, a)
- self.failUnlessRaises(TypeError, operator.setslice, a, None, None, None)
- self.failUnless(operator.setslice(a, 1, 3, [2, 1]) is None)
- self.assert_(a == [0, 2, 1, 3])
+ self.assertRaises(TypeError, operator.setslice, a)
+ self.assertRaises(TypeError, operator.setslice, a, None, None, None)
+ self.assertTrue(operator.setslice(a, 1, 3, [2, 1]) is None)
+ self.assertTrue(a == [0, 2, 1, 3])
operator.setslice(a, 0, test_support.MAX_Py_ssize_t, [])
- self.assert_(a == [])
+ self.assertTrue(a == [])
def test_sub(self):
- self.failUnlessRaises(TypeError, operator.sub)
- self.failUnlessRaises(TypeError, operator.sub, None, None)
- self.failUnless(operator.sub(5, 2) == 3)
+ self.assertRaises(TypeError, operator.sub)
+ self.assertRaises(TypeError, operator.sub, None, None)
+ self.assertTrue(operator.sub(5, 2) == 3)
def test_truth(self):
class C(object):
def __nonzero__(self):
raise SyntaxError
- self.failUnlessRaises(TypeError, operator.truth)
- self.failUnlessRaises(SyntaxError, operator.truth, C())
- self.failUnless(operator.truth(5))
- self.failUnless(operator.truth([0]))
- self.failIf(operator.truth(0))
- self.failIf(operator.truth([]))
+ self.assertRaises(TypeError, operator.truth)
+ self.assertRaises(SyntaxError, operator.truth, C())
+ self.assertTrue(operator.truth(5))
+ self.assertTrue(operator.truth([0]))
+ self.assertFalse(operator.truth(0))
+ self.assertFalse(operator.truth([]))
def test_bitwise_xor(self):
- self.failUnlessRaises(TypeError, operator.xor)
- self.failUnlessRaises(TypeError, operator.xor, None, None)
- self.failUnless(operator.xor(0xb, 0xc) == 0x7)
+ self.assertRaises(TypeError, operator.xor)
+ self.assertRaises(TypeError, operator.xor, None, None)
+ self.assertTrue(operator.xor(0xb, 0xc) == 0x7)
def test_is(self):
a = b = 'xyzpdq'
c = a[:3] + b[3:]
- self.failUnlessRaises(TypeError, operator.is_)
- self.failUnless(operator.is_(a, b))
- self.failIf(operator.is_(a,c))
+ self.assertRaises(TypeError, operator.is_)
+ self.assertTrue(operator.is_(a, b))
+ self.assertFalse(operator.is_(a,c))
def test_is_not(self):
a = b = 'xyzpdq'
c = a[:3] + b[3:]
- self.failUnlessRaises(TypeError, operator.is_not)
- self.failIf(operator.is_not(a, b))
- self.failUnless(operator.is_not(a,c))
+ self.assertRaises(TypeError, operator.is_not)
+ self.assertFalse(operator.is_not(a, b))
+ self.assertTrue(operator.is_not(a,c))
def test_attrgetter(self):
class A:
@@ -387,7 +388,7 @@ class OperatorTestCase(unittest.TestCase):
class C(object):
def __getattr__(self, name):
raise SyntaxError
- self.failUnlessRaises(SyntaxError, operator.attrgetter('foo'), C())
+ self.assertRaises(SyntaxError, operator.attrgetter('foo'), C())
# recursive gets
a = A()
@@ -419,7 +420,7 @@ class OperatorTestCase(unittest.TestCase):
class C(object):
def __getitem__(self, name):
raise SyntaxError
- self.failUnlessRaises(SyntaxError, operator.itemgetter(42), C())
+ self.assertRaises(SyntaxError, operator.itemgetter(42), C())
f = operator.itemgetter('name')
self.assertRaises(TypeError, f, a)
@@ -454,12 +455,12 @@ class OperatorTestCase(unittest.TestCase):
f = operator.methodcaller('foo')
self.assertRaises(IndexError, f, a)
f = operator.methodcaller('foo', 1, 2)
- self.assertEquals(f(a), 3)
+ self.assertEqual(f(a), 3)
f = operator.methodcaller('bar')
- self.assertEquals(f(a), 42)
+ self.assertEqual(f(a), 42)
self.assertRaises(TypeError, f, a, a)
f = operator.methodcaller('bar', f=5)
- self.assertEquals(f(a), 5)
+ self.assertEqual(f(a), 5)
def test_inplace(self):
class C(object):
diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py
index 4ab4d89d9a..f86ea0176a 100644
--- a/Lib/test/test_optparse.py
+++ b/Lib/test/test_optparse.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
#
# Test suite for Optik. Supplied by Johannes Gijsbers
# (taradino@softhome.net) -- translated from the original Optik
@@ -19,9 +17,9 @@ from StringIO import StringIO
from test import test_support
-from optparse import make_option, Option, IndentedHelpFormatter, \
- TitledHelpFormatter, OptionParser, OptionContainer, OptionGroup, \
- SUPPRESS_HELP, SUPPRESS_USAGE, OptionError, OptionConflictError, \
+from optparse import make_option, Option, \
+ TitledHelpFormatter, OptionParser, OptionGroup, \
+ SUPPRESS_USAGE, OptionError, OptionConflictError, \
BadOptionError, OptionValueError, Values
from optparse import _match_abbrev
from optparse import _parse_num
@@ -110,7 +108,7 @@ Args were %(args)s.""" % locals ())
except expected_exception, err:
actual_message = str(err)
if isinstance(expected_message, retype):
- self.assert_(expected_message.search(actual_message),
+ self.assertTrue(expected_message.search(actual_message),
"""\
expected exception message pattern:
/%s/
@@ -169,7 +167,7 @@ and kwargs %(kwargs)r
sys.stdout = save_stdout
except InterceptedError, err:
- self.assert_(
+ self.assertTrue(
type(output) is types.StringType,
"expected output to be an ordinary string, not %r"
% type(output))
@@ -342,7 +340,7 @@ class TestOptionParser(BaseTest):
def test_get_option(self):
opt1 = self.parser.get_option("-v")
- self.assert_(isinstance(opt1, Option))
+ self.assertIsInstance(opt1, Option)
self.assertEqual(opt1._short_opts, ["-v", "-n"])
self.assertEqual(opt1._long_opts, ["--verbose", "--noisy"])
self.assertEqual(opt1.action, "store_true")
@@ -353,33 +351,33 @@ class TestOptionParser(BaseTest):
opt2 = self.parser.get_option("--verbose")
opt3 = self.parser.get_option("-n")
opt4 = self.parser.get_option("--noisy")
- self.assert_(opt1 is opt2 is opt3 is opt4)
+ self.assertTrue(opt1 is opt2 is opt3 is opt4)
def test_has_option(self):
- self.assert_(self.parser.has_option("-v"))
- self.assert_(self.parser.has_option("--verbose"))
+ self.assertTrue(self.parser.has_option("-v"))
+ self.assertTrue(self.parser.has_option("--verbose"))
- def assert_removed(self):
- self.assert_(self.parser.get_option("-v") is None)
- self.assert_(self.parser.get_option("--verbose") is None)
- self.assert_(self.parser.get_option("-n") is None)
- self.assert_(self.parser.get_option("--noisy") is None)
+ def assertTrueremoved(self):
+ self.assertTrue(self.parser.get_option("-v") is None)
+ self.assertTrue(self.parser.get_option("--verbose") is None)
+ self.assertTrue(self.parser.get_option("-n") is None)
+ self.assertTrue(self.parser.get_option("--noisy") is None)
- self.failIf(self.parser.has_option("-v"))
- self.failIf(self.parser.has_option("--verbose"))
- self.failIf(self.parser.has_option("-n"))
- self.failIf(self.parser.has_option("--noisy"))
+ self.assertFalse(self.parser.has_option("-v"))
+ self.assertFalse(self.parser.has_option("--verbose"))
+ self.assertFalse(self.parser.has_option("-n"))
+ self.assertFalse(self.parser.has_option("--noisy"))
- self.assert_(self.parser.has_option("-q"))
- self.assert_(self.parser.has_option("--silent"))
+ self.assertTrue(self.parser.has_option("-q"))
+ self.assertTrue(self.parser.has_option("--silent"))
def test_remove_short_opt(self):
self.parser.remove_option("-n")
- self.assert_removed()
+ self.assertTrueremoved()
def test_remove_long_opt(self):
self.parser.remove_option("--verbose")
- self.assert_removed()
+ self.assertTrueremoved()
def test_remove_nonexistent(self):
self.assertRaises(self.parser.remove_option, ('foo',), None,
@@ -429,19 +427,19 @@ class TestTypeAliases(BaseTest):
def test_str_aliases_string(self):
self.parser.add_option("-s", type="str")
- self.assertEquals(self.parser.get_option("-s").type, "string")
+ self.assertEqual(self.parser.get_option("-s").type, "string")
def test_new_type_object(self):
self.parser.add_option("-s", type=str)
- self.assertEquals(self.parser.get_option("-s").type, "string")
+ self.assertEqual(self.parser.get_option("-s").type, "string")
self.parser.add_option("-x", type=int)
- self.assertEquals(self.parser.get_option("-x").type, "int")
+ self.assertEqual(self.parser.get_option("-x").type, "int")
def test_old_type_object(self):
self.parser.add_option("-s", type=types.StringType)
- self.assertEquals(self.parser.get_option("-s").type, "string")
+ self.assertEqual(self.parser.get_option("-s").type, "string")
self.parser.add_option("-x", type=types.IntType)
- self.assertEquals(self.parser.get_option("-x").type, "int")
+ self.assertEqual(self.parser.get_option("-x").type, "int")
# Custom type for testing processing of default values.
@@ -1005,7 +1003,7 @@ class TestOptionGroup(BaseTest):
description="Some more options")
group.set_title("Bacon")
group.add_option("--bacon", type="int")
- self.assert_(self.parser.get_option_group("--bacon"), group)
+ self.assertTrue(self.parser.get_option_group("--bacon"), group)
# -- Test extending and parser.parse_args() ----------------------------
@@ -1101,15 +1099,15 @@ class TestCallback(BaseTest):
if opt == "-x":
self.assertEqual(option._short_opts, ["-x"])
self.assertEqual(option._long_opts, [])
- self.assert_(parser_ is self.parser)
- self.assert_(value is None)
+ self.assertTrue(parser_ is self.parser)
+ self.assertTrue(value is None)
self.assertEqual(vars(parser_.values), {'filename': None})
parser_.values.x = 42
elif opt == "--file":
self.assertEqual(option._short_opts, ["-f"])
self.assertEqual(option._long_opts, ["--file"])
- self.assert_(parser_ is self.parser)
+ self.assertTrue(parser_ is self.parser)
self.assertEqual(value, "foo")
self.assertEqual(vars(parser_.values), {'filename': None, 'x': 42})
@@ -1147,7 +1145,7 @@ class TestCallbackExtraArgs(BaseTest):
def process_tuple(self, option, opt, value, parser_, len, type):
self.assertEqual(len, 3)
- self.assert_(type is int)
+ self.assertTrue(type is int)
if opt == "-p":
self.assertEqual(value, "1,2,3")
@@ -1238,8 +1236,7 @@ class TestCallbackVarArgs(BaseTest):
option_list=options)
def variable_args(self, option, opt, value, parser):
- self.assert_(value is None)
- done = 0
+ self.assertTrue(value is None)
value = []
rargs = parser.rargs
while rargs:
@@ -1294,7 +1291,7 @@ class ConflictBase(BaseTest):
class TestConflict(ConflictBase):
"""Use the default conflict resolution for Optik 1.2: error."""
- def assert_conflict_error(self, func):
+ def assertTrueconflict_error(self, func):
err = self.assertRaises(
func, ("-v", "--version"), {'action' : "callback",
'callback' : self.show_version,
@@ -1306,11 +1303,11 @@ class TestConflict(ConflictBase):
self.assertEqual(err.option_id, "-v/--version")
def test_conflict_error(self):
- self.assert_conflict_error(self.parser.add_option)
+ self.assertTrueconflict_error(self.parser.add_option)
def test_conflict_error_group(self):
group = OptionGroup(self.parser, "Group 1")
- self.assert_conflict_error(group.add_option)
+ self.assertTrueconflict_error(group.add_option)
def test_no_such_conflict_handler(self):
self.assertRaises(
@@ -1330,8 +1327,8 @@ class TestConflictResolve(ConflictBase):
verbose_opt = self.parser.get_option("--verbose")
version_opt = self.parser.get_option("--version")
- self.assert_(v_opt is version_opt)
- self.assert_(v_opt is not verbose_opt)
+ self.assertTrue(v_opt is version_opt)
+ self.assertTrue(v_opt is not verbose_opt)
self.assertEqual(v_opt._long_opts, ["--version"])
self.assertEqual(version_opt._short_opts, ["-v"])
self.assertEqual(version_opt._long_opts, ["--version"])
@@ -1462,7 +1459,7 @@ class TestHelp(BaseTest):
# screws things up for other tests when it's part of the Python
# test suite.
with test_support.EnvironmentVarGuard() as env:
- env.set('COLUMNS', str(columns))
+ env['COLUMNS'] = str(columns)
return InterceptingOptionParser(option_list=options)
def assertHelpEquals(self, expected_output):
@@ -1491,7 +1488,7 @@ class TestHelp(BaseTest):
def test_help_title_formatter(self):
with test_support.EnvironmentVarGuard() as env:
- env.set("COLUMNS", "80")
+ env["COLUMNS"] = "80"
self.parser.formatter = TitledHelpFormatter()
self.assertHelpEquals(_expected_help_title_formatter)
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index db7e9b4105..6435b61fdb 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -3,10 +3,16 @@
# portable than they had been thought to be.
import os
+import errno
import unittest
import warnings
import sys
+import signal
+import subprocess
+import time
from test import test_support
+import mmap
+import uuid
warnings.filterwarnings("ignore", "tempnam", RuntimeWarning, __name__)
warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning, __name__)
@@ -21,7 +27,7 @@ class FileTests(unittest.TestCase):
def test_access(self):
f = os.open(test_support.TESTFN, os.O_CREAT|os.O_RDWR)
os.close(f)
- self.assert_(os.access(test_support.TESTFN, os.W_OK))
+ self.assertTrue(os.access(test_support.TESTFN, os.W_OK))
def test_closerange(self):
first = os.open(test_support.TESTFN, os.O_CREAT|os.O_RDWR)
@@ -36,10 +42,7 @@ class FileTests(unittest.TestCase):
retries += 1
if retries > 10:
# XXX test skipped
- print >> sys.stderr, (
- "couldn't allocate two consecutive fds, "
- "skipping test_closerange")
- return
+ self.skipTest("couldn't allocate two consecutive fds")
first, second = second, os.dup(second)
finally:
os.close(second)
@@ -47,6 +50,7 @@ class FileTests(unittest.TestCase):
os.closerange(first, first + 2)
self.assertRaises(OSError, os.write, first, "a")
+ @test_support.cpython_only
def test_rename(self):
path = unicode(test_support.TESTFN)
old = sys.getrefcount(path)
@@ -67,7 +71,7 @@ class TemporaryFileTests(unittest.TestCase):
def check_tempfile(self, name):
# make sure it doesn't already exist:
- self.failIf(os.path.exists(name),
+ self.assertFalse(os.path.exists(name),
"file already exists for temporary file")
# make sure we can create the file
open(name, "w")
@@ -76,16 +80,18 @@ class TemporaryFileTests(unittest.TestCase):
def test_tempnam(self):
if not hasattr(os, "tempnam"):
return
- warnings.filterwarnings("ignore", "tempnam", RuntimeWarning,
- r"test_os$")
- self.check_tempfile(os.tempnam())
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", "tempnam", RuntimeWarning,
+ r"test_os$")
+ warnings.filterwarnings("ignore", "tempnam", DeprecationWarning)
+ self.check_tempfile(os.tempnam())
- name = os.tempnam(test_support.TESTFN)
- self.check_tempfile(name)
+ name = os.tempnam(test_support.TESTFN)
+ self.check_tempfile(name)
- name = os.tempnam(test_support.TESTFN, "pfx")
- self.assert_(os.path.basename(name)[:3] == "pfx")
- self.check_tempfile(name)
+ name = os.tempnam(test_support.TESTFN, "pfx")
+ self.assertTrue(os.path.basename(name)[:3] == "pfx")
+ self.check_tempfile(name)
def test_tmpfile(self):
if not hasattr(os, "tmpfile"):
@@ -104,64 +110,69 @@ class TemporaryFileTests(unittest.TestCase):
# test that a subsequent call to os.tmpfile() raises the same error. If
# it doesn't, assume we're on XP or below and the user running the test
# has administrative privileges, and proceed with the test as normal.
- if sys.platform == 'win32':
- name = '\\python_test_os_test_tmpfile.txt'
- if os.path.exists(name):
- os.remove(name)
- try:
- fp = open(name, 'w')
- except IOError, first:
- # open() failed, assert tmpfile() fails in the same way.
- # Although open() raises an IOError and os.tmpfile() raises an
- # OSError(), 'args' will be (13, 'Permission denied') in both
- # cases.
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", "tmpfile", DeprecationWarning)
+
+ if sys.platform == 'win32':
+ name = '\\python_test_os_test_tmpfile.txt'
+ if os.path.exists(name):
+ os.remove(name)
try:
- fp = os.tmpfile()
- except OSError, second:
- self.assertEqual(first.args, second.args)
+ fp = open(name, 'w')
+ except IOError, first:
+ # open() failed, assert tmpfile() fails in the same way.
+ # Although open() raises an IOError and os.tmpfile() raises an
+ # OSError(), 'args' will be (13, 'Permission denied') in both
+ # cases.
+ try:
+ fp = os.tmpfile()
+ except OSError, second:
+ self.assertEqual(first.args, second.args)
+ else:
+ self.fail("expected os.tmpfile() to raise OSError")
+ return
else:
- self.fail("expected os.tmpfile() to raise OSError")
- return
- else:
- # open() worked, therefore, tmpfile() should work. Close our
- # dummy file and proceed with the test as normal.
- fp.close()
- os.remove(name)
-
- fp = os.tmpfile()
- fp.write("foobar")
- fp.seek(0,0)
- s = fp.read()
- fp.close()
- self.assert_(s == "foobar")
+ # open() worked, therefore, tmpfile() should work. Close our
+ # dummy file and proceed with the test as normal.
+ fp.close()
+ os.remove(name)
+
+ fp = os.tmpfile()
+ fp.write("foobar")
+ fp.seek(0,0)
+ s = fp.read()
+ fp.close()
+ self.assertTrue(s == "foobar")
def test_tmpnam(self):
- import sys
if not hasattr(os, "tmpnam"):
return
- warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning,
- r"test_os$")
- name = os.tmpnam()
- if sys.platform in ("win32",):
- # The Windows tmpnam() seems useless. From the MS docs:
- #
- # The character string that tmpnam creates consists of
- # the path prefix, defined by the entry P_tmpdir in the
- # file STDIO.H, followed by a sequence consisting of the
- # digit characters '0' through '9'; the numerical value
- # of this string is in the range 1 - 65,535. Changing the
- # definitions of L_tmpnam or P_tmpdir in STDIO.H does not
- # change the operation of tmpnam.
- #
- # The really bizarre part is that, at least under MSVC6,
- # P_tmpdir is "\\". That is, the path returned refers to
- # the root of the current drive. That's a terrible place to
- # put temp files, and, depending on privileges, the user
- # may not even be able to open a file in the root directory.
- self.failIf(os.path.exists(name),
- "file already exists for temporary file")
- else:
- self.check_tempfile(name)
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", "tmpnam", RuntimeWarning,
+ r"test_os$")
+ warnings.filterwarnings("ignore", "tmpnam", DeprecationWarning)
+
+ name = os.tmpnam()
+ if sys.platform in ("win32",):
+ # The Windows tmpnam() seems useless. From the MS docs:
+ #
+ # The character string that tmpnam creates consists of
+ # the path prefix, defined by the entry P_tmpdir in the
+ # file STDIO.H, followed by a sequence consisting of the
+ # digit characters '0' through '9'; the numerical value
+ # of this string is in the range 1 - 65,535. Changing the
+ # definitions of L_tmpnam or P_tmpdir in STDIO.H does not
+ # change the operation of tmpnam.
+ #
+ # The really bizarre part is that, at least under MSVC6,
+ # P_tmpdir is "\\". That is, the path returned refers to
+ # the root of the current drive. That's a terrible place to
+ # put temp files, and, depending on privileges, the user
+ # may not even be able to open a file in the root directory.
+ self.assertFalse(os.path.exists(name),
+ "file already exists for temporary file")
+ else:
+ self.check_tempfile(name)
# Test attributes on return values from os.*stat* family.
class StatAttributeTests(unittest.TestCase):
@@ -184,10 +195,8 @@ class StatAttributeTests(unittest.TestCase):
result = os.stat(self.fname)
# Make sure direct access works
- self.assertEquals(result[stat.ST_SIZE], 3)
- self.assertEquals(result.st_size, 3)
-
- import sys
+ self.assertEqual(result[stat.ST_SIZE], 3)
+ self.assertEqual(result.st_size, 3)
# Make sure all the attributes are there
members = dir(result)
@@ -198,9 +207,9 @@ class StatAttributeTests(unittest.TestCase):
def trunc(x): return int(x)
else:
def trunc(x): return x
- self.assertEquals(trunc(getattr(result, attr)),
- result[getattr(stat, name)])
- self.assert_(attr in members)
+ self.assertEqual(trunc(getattr(result, attr)),
+ result[getattr(stat, name)])
+ self.assertIn(attr, members)
try:
result[200]
@@ -212,7 +221,7 @@ class StatAttributeTests(unittest.TestCase):
try:
result.st_mode = 1
self.fail("No exception thrown")
- except TypeError:
+ except (AttributeError, TypeError):
pass
try:
@@ -234,7 +243,7 @@ class StatAttributeTests(unittest.TestCase):
except TypeError:
pass
- # Use the constructr with a too-long tuple.
+ # Use the constructor with a too-long tuple.
try:
result2 = os.stat_result((0,1,2,3,4,5,6,7,8,9,10,11,12,13,14))
except TypeError:
@@ -249,18 +258,17 @@ class StatAttributeTests(unittest.TestCase):
result = os.statvfs(self.fname)
except OSError, e:
# On AtheOS, glibc always returns ENOSYS
- import errno
if e.errno == errno.ENOSYS:
return
# Make sure direct access works
- self.assertEquals(result.f_bfree, result[3])
+ self.assertEqual(result.f_bfree, result[3])
# Make sure all the attributes are there.
members = ('bsize', 'frsize', 'blocks', 'bfree', 'bavail', 'files',
'ffree', 'favail', 'flag', 'namemax')
for value, member in enumerate(members):
- self.assertEquals(getattr(result, 'f_' + member), result[value])
+ self.assertEqual(getattr(result, 'f_' + member), result[value])
# Make sure that assignment really fails
try:
@@ -282,7 +290,7 @@ class StatAttributeTests(unittest.TestCase):
except TypeError:
pass
- # Use the constructr with a too-long tuple.
+ # Use the constructor with a too-long tuple.
try:
result2 = os.statvfs_result((0,1,2,3,4,5,6,7,8,9,10,11,12,13,14))
except TypeError:
@@ -295,7 +303,7 @@ class StatAttributeTests(unittest.TestCase):
# time stamps in stat, but not in utime.
os.utime(test_support.TESTFN, (st.st_atime, int(st.st_mtime-delta)))
st2 = os.stat(test_support.TESTFN)
- self.assertEquals(st2.st_mtime, int(st.st_mtime-delta))
+ self.assertEqual(st2.st_mtime, int(st.st_mtime-delta))
# Restrict test to Win32, since there is no guarantee other
# systems support centiseconds
@@ -312,7 +320,12 @@ class StatAttributeTests(unittest.TestCase):
def test_1565150(self):
t1 = 1159195039.25
os.utime(self.fname, (t1, t1))
- self.assertEquals(os.stat(self.fname).st_mtime, t1)
+ self.assertEqual(os.stat(self.fname).st_mtime, t1)
+
+ def test_large_time(self):
+ t1 = 5000000000 # some day in 2128
+ os.utime(self.fname, (t1, t1))
+ self.assertEqual(os.stat(self.fname).st_mtime, t1)
def test_1686475(self):
# Verify that an open file can be stat'ed
@@ -344,8 +357,9 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
def test_update2(self):
if os.path.exists("/bin/sh"):
os.environ.update(HELLO="World")
- value = os.popen("/bin/sh -c 'echo $HELLO'").read().strip()
- self.assertEquals(value, "World")
+ with os.popen("/bin/sh -c 'echo $HELLO'") as popen:
+ value = popen.read().strip()
+ self.assertEqual(value, "World")
class WalkTests(unittest.TestCase):
"""Tests for os.walk()."""
@@ -467,7 +481,7 @@ class MakedirTests (unittest.TestCase):
os.makedirs(path)
# Try paths with a '.' in them
- self.failUnlessRaises(OSError, os.makedirs, os.curdir)
+ self.assertRaises(OSError, os.makedirs, os.curdir)
path = os.path.join(base, 'dir1', 'dir2', 'dir3', 'dir4', 'dir5', os.curdir)
os.makedirs(path)
path = os.path.join(base, 'dir1', os.curdir, 'dir2', 'dir3', 'dir4',
@@ -500,18 +514,20 @@ class DevNullTests (unittest.TestCase):
class URandomTests (unittest.TestCase):
def test_urandom(self):
try:
- with test_support.check_warnings():
- self.assertEqual(len(os.urandom(1)), 1)
- self.assertEqual(len(os.urandom(10)), 10)
- self.assertEqual(len(os.urandom(100)), 100)
- self.assertEqual(len(os.urandom(1000)), 1000)
- # see http://bugs.python.org/issue3708
- self.assertEqual(len(os.urandom(0.9)), 0)
- self.assertEqual(len(os.urandom(1.1)), 1)
- self.assertEqual(len(os.urandom(2.0)), 2)
+ self.assertEqual(len(os.urandom(1)), 1)
+ self.assertEqual(len(os.urandom(10)), 10)
+ self.assertEqual(len(os.urandom(100)), 100)
+ self.assertEqual(len(os.urandom(1000)), 1000)
+ # see http://bugs.python.org/issue3708
+ self.assertRaises(TypeError, os.urandom, 0.9)
+ self.assertRaises(TypeError, os.urandom, 1.1)
+ self.assertRaises(TypeError, os.urandom, 2.0)
except NotImplementedError:
pass
+ def test_execvpe_with_bad_arglist(self):
+ self.assertRaises(ValueError, os.execvpe, 'notepad', [], None)
+
class Win32ErrorTests(unittest.TestCase):
def test_rename(self):
self.assertRaises(WindowsError, os.rename, test_support.TESTFN, test_support.TESTFN+".bak")
@@ -523,16 +539,18 @@ class Win32ErrorTests(unittest.TestCase):
self.assertRaises(WindowsError, os.chdir, test_support.TESTFN)
def test_mkdir(self):
- self.assertRaises(WindowsError, os.chdir, test_support.TESTFN)
+ f = open(test_support.TESTFN, "w")
+ try:
+ self.assertRaises(WindowsError, os.mkdir, test_support.TESTFN)
+ finally:
+ f.close()
+ os.unlink(test_support.TESTFN)
def test_utime(self):
self.assertRaises(WindowsError, os.utime, test_support.TESTFN, None)
- def test_access(self):
- self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0)
-
def test_chmod(self):
- self.assertRaises(WindowsError, os.utime, test_support.TESTFN, 0)
+ self.assertRaises(WindowsError, os.chmod, test_support.TESTFN, 0)
class TestInvalidFD(unittest.TestCase):
singles = ["fchdir", "fdopen", "dup", "fdatasync", "fstat",
@@ -548,7 +566,13 @@ class TestInvalidFD(unittest.TestCase):
locals()["test_"+f] = get_single(f)
def check(self, f, *args):
- self.assertRaises(OSError, f, test_support.make_bad_fd(), *args)
+ try:
+ f(test_support.make_bad_fd(), *args)
+ except OSError as e:
+ self.assertEqual(e.errno, errno.EBADF)
+ else:
+ self.fail("%r didn't raise a OSError with a bad file descriptor"
+ % f)
def test_isatty(self):
if hasattr(os, "isatty"):
@@ -566,9 +590,8 @@ class TestInvalidFD(unittest.TestCase):
else:
break
if i < 2:
- # Unable to acquire a range of invalid file descriptors,
- # so skip the test (in 2.6+ this is a unittest.SkipTest).
- return
+ raise unittest.SkipTest(
+ "Unable to acquire a range of invalid file descriptors")
self.assertEqual(os.closerange(fd, fd + i-1), None)
def test_dup2(self):
@@ -587,11 +610,9 @@ class TestInvalidFD(unittest.TestCase):
if hasattr(os, "fpathconf"):
self.check(os.fpathconf, "PC_NAME_MAX")
- #this is a weird one, it raises IOError unlike the others
def test_ftruncate(self):
if hasattr(os, "ftruncate"):
- self.assertRaises(IOError, os.ftruncate, test_support.make_bad_fd(),
- 0)
+ self.check(os.ftruncate, 0)
def test_lseek(self):
if hasattr(os, "lseek"):
@@ -648,7 +669,6 @@ if sys.platform != 'win32':
def test_setreuid_neg1(self):
# Needs to accept -1. We run this in a subprocess to avoid
# altering the test runner's process state (issue8045).
- import subprocess
subprocess.check_call([
sys.executable, '-c',
'import os,sys;os.setreuid(-1,-1);sys.exit(0)'])
@@ -663,7 +683,6 @@ if sys.platform != 'win32':
def test_setregid_neg1(self):
# Needs to accept -1. We run this in a subprocess to avoid
# altering the test runner's process state (issue8045).
- import subprocess
subprocess.check_call([
sys.executable, '-c',
'import os,sys;os.setregid(-1,-1);sys.exit(0)'])
@@ -671,6 +690,120 @@ else:
class PosixUidGidTests(unittest.TestCase):
pass
+@unittest.skipUnless(sys.platform == "win32", "Win32 specific tests")
+class Win32KillTests(unittest.TestCase):
+ def _kill(self, sig):
+ # Start sys.executable as a subprocess and communicate from the
+ # subprocess to the parent that the interpreter is ready. When it
+ # becomes ready, send *sig* via os.kill to the subprocess and check
+ # that the return code is equal to *sig*.
+ import ctypes
+ from ctypes import wintypes
+ import msvcrt
+
+ # Since we can't access the contents of the process' stdout until the
+ # process has exited, use PeekNamedPipe to see what's inside stdout
+ # without waiting. This is done so we can tell that the interpreter
+ # is started and running at a point where it could handle a signal.
+ PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe
+ PeekNamedPipe.restype = wintypes.BOOL
+ PeekNamedPipe.argtypes = (wintypes.HANDLE, # Pipe handle
+ ctypes.POINTER(ctypes.c_char), # stdout buf
+ wintypes.DWORD, # Buffer size
+ ctypes.POINTER(wintypes.DWORD), # bytes read
+ ctypes.POINTER(wintypes.DWORD), # bytes avail
+ ctypes.POINTER(wintypes.DWORD)) # bytes left
+ msg = "running"
+ proc = subprocess.Popen([sys.executable, "-c",
+ "import sys;"
+ "sys.stdout.write('{}');"
+ "sys.stdout.flush();"
+ "input()".format(msg)],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ stdin=subprocess.PIPE)
+ self.addCleanup(proc.stdout.close)
+ self.addCleanup(proc.stderr.close)
+ self.addCleanup(proc.stdin.close)
+
+ count, max = 0, 100
+ while count < max and proc.poll() is None:
+ # Create a string buffer to store the result of stdout from the pipe
+ buf = ctypes.create_string_buffer(len(msg))
+ # Obtain the text currently in proc.stdout
+ # Bytes read/avail/left are left as NULL and unused
+ rslt = PeekNamedPipe(msvcrt.get_osfhandle(proc.stdout.fileno()),
+ buf, ctypes.sizeof(buf), None, None, None)
+ self.assertNotEqual(rslt, 0, "PeekNamedPipe failed")
+ if buf.value:
+ self.assertEqual(msg, buf.value)
+ break
+ time.sleep(0.1)
+ count += 1
+ else:
+ self.fail("Did not receive communication from the subprocess")
+
+ os.kill(proc.pid, sig)
+ self.assertEqual(proc.wait(), sig)
+
+ def test_kill_sigterm(self):
+ # SIGTERM doesn't mean anything special, but make sure it works
+ self._kill(signal.SIGTERM)
+
+ def test_kill_int(self):
+ # os.kill on Windows can take an int which gets set as the exit code
+ self._kill(100)
+
+ def _kill_with_event(self, event, name):
+ tagname = "test_os_%s" % uuid.uuid1()
+ m = mmap.mmap(-1, 1, tagname)
+ m[0] = '0'
+ # Run a script which has console control handling enabled.
+ proc = subprocess.Popen([sys.executable,
+ os.path.join(os.path.dirname(__file__),
+ "win_console_handler.py"), tagname],
+ creationflags=subprocess.CREATE_NEW_PROCESS_GROUP)
+ # Let the interpreter startup before we send signals. See #3137.
+ count, max = 0, 20
+ while count < max and proc.poll() is None:
+ if m[0] == '1':
+ break
+ time.sleep(0.5)
+ count += 1
+ else:
+ self.fail("Subprocess didn't finish initialization")
+ os.kill(proc.pid, event)
+ # proc.send_signal(event) could also be done here.
+ # Allow time for the signal to be passed and the process to exit.
+ time.sleep(0.5)
+ if not proc.poll():
+ # Forcefully kill the process if we weren't able to signal it.
+ os.kill(proc.pid, signal.SIGINT)
+ self.fail("subprocess did not stop on {}".format(name))
+
+ @unittest.skip("subprocesses aren't inheriting CTRL+C property")
+ def test_CTRL_C_EVENT(self):
+ from ctypes import wintypes
+ import ctypes
+
+ # Make a NULL value by creating a pointer with no argument.
+ NULL = ctypes.POINTER(ctypes.c_int)()
+ SetConsoleCtrlHandler = ctypes.windll.kernel32.SetConsoleCtrlHandler
+ SetConsoleCtrlHandler.argtypes = (ctypes.POINTER(ctypes.c_int),
+ wintypes.BOOL)
+ SetConsoleCtrlHandler.restype = wintypes.BOOL
+
+ # Calling this with NULL and FALSE causes the calling process to
+ # handle CTRL+C, rather than ignore it. This property is inherited
+ # by subprocesses.
+ SetConsoleCtrlHandler(NULL, 0)
+
+ self._kill_with_event(signal.CTRL_C_EVENT, "CTRL_C_EVENT")
+
+ def test_CTRL_BREAK_EVENT(self):
+ self._kill_with_event(signal.CTRL_BREAK_EVENT, "CTRL_BREAK_EVENT")
+
+
def test_main():
test_support.run_unittest(
FileTests,
@@ -683,7 +816,8 @@ def test_main():
URandomTests,
Win32ErrorTests,
TestInvalidFD,
- PosixUidGidTests
+ PosixUidGidTests,
+ Win32KillTests
)
if __name__ == "__main__":
diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py
index 2fa9962e0b..7a357a01ef 100644
--- a/Lib/test/test_ossaudiodev.py
+++ b/Lib/test/test_ossaudiodev.py
@@ -1,10 +1,11 @@
from test import test_support
test_support.requires('audio')
-from test.test_support import findfile, TestSkipped
+from test.test_support import findfile
+
+ossaudiodev = test_support.import_module('ossaudiodev')
import errno
-import ossaudiodev
import sys
import sunau
import time
@@ -46,7 +47,7 @@ class OSSAudioDevTests(unittest.TestCase):
except IOError, msg:
if msg.args[0] in (errno.EACCES, errno.ENOENT,
errno.ENODEV, errno.EBUSY):
- raise TestSkipped(msg)
+ raise unittest.SkipTest(msg)
raise
# at least check that these methods can be invoked
@@ -57,7 +58,7 @@ class OSSAudioDevTests(unittest.TestCase):
dsp.fileno()
# Make sure the read-only attributes work.
- self.failIf(dsp.closed)
+ self.assertFalse(dsp.closed)
self.assertEqual(dsp.name, "/dev/dsp")
self.assertEqual(dsp.mode, "w", "bad dsp.mode: %r" % dsp.mode)
@@ -83,7 +84,7 @@ class OSSAudioDevTests(unittest.TestCase):
elapsed_time = t2 - t1
percent_diff = (abs(elapsed_time - expected_time) / expected_time) * 100
- self.failUnless(percent_diff <= 10.0,
+ self.assertTrue(percent_diff <= 10.0,
"elapsed time > 10% off of expected time")
def set_parameters(self, dsp):
@@ -131,7 +132,7 @@ class OSSAudioDevTests(unittest.TestCase):
]:
(fmt, channels, rate) = config
result = dsp.setparameters(fmt, channels, rate, False)
- self.failIfEqual(result, config,
+ self.assertNotEqual(result, config,
"unexpectedly got requested configuration")
try:
@@ -155,7 +156,7 @@ class OSSAudioDevTests(unittest.TestCase):
#self.set_bad_parameters(dsp)
finally:
dsp.close()
- self.failUnless(dsp.closed)
+ self.assertTrue(dsp.closed)
def test_main():
@@ -164,7 +165,7 @@ def test_main():
except (ossaudiodev.error, IOError), msg:
if msg.args[0] in (errno.EACCES, errno.ENOENT,
errno.ENODEV, errno.EBUSY):
- raise TestSkipped(msg)
+ raise unittest.SkipTest(msg)
raise
dsp.close()
test_support.run_unittest(__name__)
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index 6acd1e7eed..33b91bd692 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -1,5 +1,4 @@
import parser
-import os
import unittest
import sys
from test import test_support
@@ -20,8 +19,8 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
except parser.ParserError, why:
self.fail("could not roundtrip %r: %s" % (s, why))
- self.assertEquals(t, st2.totuple(),
- "could not re-generate syntax tree")
+ self.assertEqual(t, st2.totuple(),
+ "could not re-generate syntax tree")
def check_expr(self, s):
self.roundtrip(parser.expr, s)
@@ -33,7 +32,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
code = suite.compile()
scope = {}
exec code in scope
- self.assertTrue(isinstance(scope["x"], unicode))
+ self.assertIsInstance(scope["x"], unicode)
def check_suite(self, s):
self.roundtrip(parser.suite, s)
@@ -59,13 +58,37 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def test_expressions(self):
self.check_expr("foo(1)")
+ self.check_expr("{1:1}")
+ self.check_expr("{1:1, 2:2, 3:3}")
+ self.check_expr("{1:1, 2:2, 3:3,}")
+ self.check_expr("{1}")
+ self.check_expr("{1, 2, 3}")
+ self.check_expr("{1, 2, 3,}")
+ self.check_expr("[]")
+ self.check_expr("[1]")
self.check_expr("[1, 2, 3]")
+ self.check_expr("[1, 2, 3,]")
+ self.check_expr("()")
+ self.check_expr("(1,)")
+ self.check_expr("(1, 2, 3)")
+ self.check_expr("(1, 2, 3,)")
self.check_expr("[x**3 for x in range(20)]")
self.check_expr("[x**3 for x in range(20) if x % 3]")
self.check_expr("[x**3 for x in range(20) if x % 2 if x % 3]")
+ self.check_expr("[x+y for x in range(30) for y in range(20) if x % 2 if y % 3]")
+ #self.check_expr("[x for x in lambda: True, lambda: False if x()]")
self.check_expr("list(x**3 for x in range(20))")
self.check_expr("list(x**3 for x in range(20) if x % 3)")
self.check_expr("list(x**3 for x in range(20) if x % 2 if x % 3)")
+ self.check_expr("list(x+y for x in range(30) for y in range(20) if x % 2 if y % 3)")
+ self.check_expr("{x**3 for x in range(30)}")
+ self.check_expr("{x**3 for x in range(30) if x % 3}")
+ self.check_expr("{x**3 for x in range(30) if x % 2 if x % 3}")
+ self.check_expr("{x+y for x in range(30) for y in range(20) if x % 2 if y % 3}")
+ self.check_expr("{x**3: y**2 for x, y in zip(range(30), range(30))}")
+ self.check_expr("{x**3: y**2 for x, y in zip(range(30), range(30)) if x % 3}")
+ self.check_expr("{x**3: y**2 for x, y in zip(range(30), range(30)) if x % 3 if y % 3}")
+ self.check_expr("{x:y for x in range(30) for y in range(20) if x % 2 if y % 3}")
self.check_expr("foo(*args)")
self.check_expr("foo(*args, **kw)")
self.check_expr("foo(**kw)")
@@ -94,6 +117,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
self.check_expr("lambda foo=bar, blaz=blat+2, **z: 0")
self.check_expr("lambda foo=bar, blaz=blat+2, *y, **z: 0")
self.check_expr("lambda x, *y, **z: 0")
+ self.check_expr("lambda x: 5 if x else 2")
self.check_expr("(x for x in range(10))")
self.check_expr("foo(x for x in range(10))")
@@ -213,6 +237,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def test_with(self):
self.check_suite("with open('x'): pass\n")
self.check_suite("with open('x') as f: pass\n")
+ self.check_suite("with open('x') as f, open('y') as g: pass\n")
def test_try_stmt(self):
self.check_suite("try: pass\nexcept: pass\n")
@@ -233,7 +258,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
def test_position(self):
# An absolutely minimal test of position information. Better
# tests would be a big project.
- code = "def f(x):\n return x + 1\n"
+ code = "def f(x):\n return x + 1"
st1 = parser.suite(code)
st2 = st1.totuple(line_info=1, col_info=1)
@@ -522,14 +547,14 @@ class CompileTestCase(unittest.TestCase):
def test_compile_expr(self):
st = parser.expr('2 + 3')
code = parser.compilest(st)
- self.assertEquals(eval(code), 5)
+ self.assertEqual(eval(code), 5)
def test_compile_suite(self):
st = parser.suite('x = 2; y = x + 3')
code = parser.compilest(st)
globs = {}
exec code in globs
- self.assertEquals(globs['y'], 5)
+ self.assertEqual(globs['y'], 5)
def test_compile_error(self):
st = parser.suite('1 = 3 + 4')
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
new file mode 100644
index 0000000000..f03c20bcf9
--- /dev/null
+++ b/Lib/test/test_pdb.py
@@ -0,0 +1,287 @@
+# A test suite for pdb; at the moment, this only validates skipping of
+# specified test modules (RFE #5142).
+
+import imp
+import sys
+
+from test import test_support
+# This little helper class is essential for testing pdb under doctest.
+from test_doctest import _FakeInput
+
+
+class PdbTestInput(object):
+ """Context manager that makes testing Pdb in doctests easier."""
+
+ def __init__(self, input):
+ self.input = input
+
+ def __enter__(self):
+ self.real_stdin = sys.stdin
+ sys.stdin = _FakeInput(self.input)
+
+ def __exit__(self, *exc):
+ sys.stdin = self.real_stdin
+
+
+def write(x):
+ print x
+
+def test_pdb_displayhook():
+ """This tests the custom displayhook for pdb.
+
+ >>> def test_function(foo, bar):
+ ... import pdb; pdb.Pdb().set_trace()
+ ... pass
+
+ >>> with PdbTestInput([
+ ... 'foo',
+ ... 'bar',
+ ... 'for i in range(5): write(i)',
+ ... 'continue',
+ ... ]):
+ ... test_function(1, None)
+ > <doctest test.test_pdb.test_pdb_displayhook[0]>(3)test_function()
+ -> pass
+ (Pdb) foo
+ 1
+ (Pdb) bar
+ (Pdb) for i in range(5): write(i)
+ 0
+ 1
+ 2
+ 3
+ 4
+ (Pdb) continue
+ """
+
+def test_pdb_breakpoint_commands():
+ """Test basic commands related to breakpoints.
+
+ >>> def test_function():
+ ... import pdb; pdb.Pdb().set_trace()
+ ... print(1)
+ ... print(2)
+ ... print(3)
+ ... print(4)
+
+ First, need to clear bdb state that might be left over from previous tests.
+ Otherwise, the new breakpoints might get assigned different numbers.
+
+ >>> from bdb import Breakpoint
+ >>> Breakpoint.next = 1
+ >>> Breakpoint.bplist = {}
+ >>> Breakpoint.bpbynumber = [None]
+
+ Now test the breakpoint commands. NORMALIZE_WHITESPACE is needed because
+ the breakpoint list outputs a tab for the "stop only" and "ignore next"
+ lines, which we don't want to put in here.
+
+ >>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
+ ... 'break 3',
+ ... 'disable 1',
+ ... 'ignore 1 10',
+ ... 'condition 1 1 < 2',
+ ... 'break 4',
+ ... 'break 4',
+ ... 'break',
+ ... 'clear 3',
+ ... 'break',
+ ... 'condition 1',
+ ... 'enable 1',
+ ... 'clear 1',
+ ... 'commands 2',
+ ... 'print 42',
+ ... 'end',
+ ... 'continue', # will stop at breakpoint 2 (line 4)
+ ... 'clear', # clear all!
+ ... 'y',
+ ... 'tbreak 5',
+ ... 'continue', # will stop at temporary breakpoint
+ ... 'break', # make sure breakpoint is gone
+ ... 'continue',
+ ... ]):
+ ... test_function()
+ > <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>(3)test_function()
+ -> print(1)
+ (Pdb) break 3
+ Breakpoint 1 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:3
+ (Pdb) disable 1
+ (Pdb) ignore 1 10
+ Will ignore next 10 crossings of breakpoint 1.
+ (Pdb) condition 1 1 < 2
+ (Pdb) break 4
+ Breakpoint 2 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
+ (Pdb) break 4
+ Breakpoint 3 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
+ (Pdb) break
+ Num Type Disp Enb Where
+ 1 breakpoint keep no at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:3
+ stop only if 1 < 2
+ ignore next 10 hits
+ 2 breakpoint keep yes at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
+ 3 breakpoint keep yes at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
+ (Pdb) clear 3
+ Deleted breakpoint 3
+ (Pdb) break
+ Num Type Disp Enb Where
+ 1 breakpoint keep no at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:3
+ stop only if 1 < 2
+ ignore next 10 hits
+ 2 breakpoint keep yes at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:4
+ (Pdb) condition 1
+ Breakpoint 1 is now unconditional.
+ (Pdb) enable 1
+ (Pdb) clear 1
+ Deleted breakpoint 1
+ (Pdb) commands 2
+ (com) print 42
+ (com) end
+ (Pdb) continue
+ 1
+ 42
+ > <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>(4)test_function()
+ -> print(2)
+ (Pdb) clear
+ Clear all breaks? y
+ (Pdb) tbreak 5
+ Breakpoint 4 at <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>:5
+ (Pdb) continue
+ 2
+ Deleted breakpoint 4
+ > <doctest test.test_pdb.test_pdb_breakpoint_commands[0]>(5)test_function()
+ -> print(3)
+ (Pdb) break
+ (Pdb) continue
+ 3
+ 4
+ """
+
+
+def test_pdb_skip_modules():
+ """This illustrates the simple case of module skipping.
+
+ >>> def skip_module():
+ ... import string
+ ... import pdb; pdb.Pdb(skip=['string*']).set_trace()
+ ... string.lower('FOO')
+
+ >>> with PdbTestInput([
+ ... 'step',
+ ... 'continue',
+ ... ]):
+ ... skip_module()
+ > <doctest test.test_pdb.test_pdb_skip_modules[0]>(4)skip_module()
+ -> string.lower('FOO')
+ (Pdb) step
+ --Return--
+ > <doctest test.test_pdb.test_pdb_skip_modules[0]>(4)skip_module()->None
+ -> string.lower('FOO')
+ (Pdb) continue
+ """
+
+
+# Module for testing skipping of module that makes a callback
+mod = imp.new_module('module_to_skip')
+exec 'def foo_pony(callback): x = 1; callback(); return None' in mod.__dict__
+
+
+def test_pdb_skip_modules_with_callback():
+ """This illustrates skipping of modules that call into other code.
+
+ >>> def skip_module():
+ ... def callback():
+ ... return None
+ ... import pdb; pdb.Pdb(skip=['module_to_skip*']).set_trace()
+ ... mod.foo_pony(callback)
+
+ >>> with PdbTestInput([
+ ... 'step',
+ ... 'step',
+ ... 'step',
+ ... 'step',
+ ... 'step',
+ ... 'continue',
+ ... ]):
+ ... skip_module()
+ ... pass # provides something to "step" to
+ > <doctest test.test_pdb.test_pdb_skip_modules_with_callback[0]>(5)skip_module()
+ -> mod.foo_pony(callback)
+ (Pdb) step
+ --Call--
+ > <doctest test.test_pdb.test_pdb_skip_modules_with_callback[0]>(2)callback()
+ -> def callback():
+ (Pdb) step
+ > <doctest test.test_pdb.test_pdb_skip_modules_with_callback[0]>(3)callback()
+ -> return None
+ (Pdb) step
+ --Return--
+ > <doctest test.test_pdb.test_pdb_skip_modules_with_callback[0]>(3)callback()->None
+ -> return None
+ (Pdb) step
+ --Return--
+ > <doctest test.test_pdb.test_pdb_skip_modules_with_callback[0]>(5)skip_module()->None
+ -> mod.foo_pony(callback)
+ (Pdb) step
+ > <doctest test.test_pdb.test_pdb_skip_modules_with_callback[1]>(10)<module>()
+ -> pass # provides something to "step" to
+ (Pdb) continue
+ """
+
+
+def test_pdb_continue_in_bottomframe():
+ """Test that "continue" and "next" work properly in bottom frame (issue #5294).
+
+ >>> def test_function():
+ ... import pdb, sys; inst = pdb.Pdb()
+ ... inst.set_trace()
+ ... inst.botframe = sys._getframe() # hackery to get the right botframe
+ ... print(1)
+ ... print(2)
+ ... print(3)
+ ... print(4)
+
+ First, need to clear bdb state that might be left over from previous tests.
+ Otherwise, the new breakpoints might get assigned different numbers.
+
+ >>> from bdb import Breakpoint
+ >>> Breakpoint.next = 1
+ >>> Breakpoint.bplist = {}
+ >>> Breakpoint.bpbynumber = [None]
+
+ >>> with PdbTestInput([
+ ... 'next',
+ ... 'break 7',
+ ... 'continue',
+ ... 'next',
+ ... 'continue',
+ ... 'continue',
+ ... ]):
+ ... test_function()
+ > <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>(4)test_function()
+ -> inst.botframe = sys._getframe() # hackery to get the right botframe
+ (Pdb) next
+ > <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>(5)test_function()
+ -> print(1)
+ (Pdb) break 7
+ Breakpoint 1 at <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>:7
+ (Pdb) continue
+ 1
+ 2
+ > <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>(7)test_function()
+ -> print(3)
+ (Pdb) next
+ 3
+ > <doctest test.test_pdb.test_pdb_continue_in_bottomframe[0]>(8)test_function()
+ -> print(4)
+ (Pdb) continue
+ 4
+ """
+
+
+def test_main():
+ from test import test_pdb
+ test_support.run_doctest(test_pdb, verbosity=True)
+
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index 2985cc28c2..3e8b7ae9a4 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -19,15 +19,14 @@ def dis_single(line):
class TestTranforms(unittest.TestCase):
def test_unot(self):
- # UNARY_NOT JUMP_IF_FALSE POP_TOP --> JUMP_IF_TRUE POP_TOP'
+ # UNARY_NOT POP_JUMP_IF_FALSE --> POP_JUMP_IF_TRUE
def unot(x):
if not x == 2:
del x
asm = disassemble(unot)
- for elem in ('UNARY_NOT', 'JUMP_IF_FALSE'):
- self.assert_(elem not in asm)
- for elem in ('JUMP_IF_TRUE', 'POP_TOP'):
- self.assert_(elem in asm)
+ for elem in ('UNARY_NOT', 'POP_JUMP_IF_FALSE'):
+ self.assertNotIn(elem, asm)
+ self.assertIn('POP_JUMP_IF_TRUE', asm)
def test_elim_inversion_of_is_or_in(self):
for line, elem in (
@@ -37,7 +36,7 @@ class TestTranforms(unittest.TestCase):
('not a not in b', '(in)',),
):
asm = dis_single(line)
- self.assert_(elem in asm)
+ self.assertIn(elem, asm)
def test_none_as_constant(self):
# LOAD_GLOBAL None --> LOAD_CONST None
@@ -46,26 +45,26 @@ class TestTranforms(unittest.TestCase):
return x
asm = disassemble(f)
for elem in ('LOAD_GLOBAL',):
- self.assert_(elem not in asm)
+ self.assertNotIn(elem, asm)
for elem in ('LOAD_CONST', '(None)'):
- self.assert_(elem in asm)
+ self.assertIn(elem, asm)
def f():
'Adding a docstring made this test fail in Py2.5.0'
return None
- self.assert_('LOAD_CONST' in disassemble(f))
- self.assert_('LOAD_GLOBAL' not in disassemble(f))
+ self.assertIn('LOAD_CONST', disassemble(f))
+ self.assertNotIn('LOAD_GLOBAL', disassemble(f))
def test_while_one(self):
- # Skip over: LOAD_CONST trueconst JUMP_IF_FALSE xx POP_TOP
+ # Skip over: LOAD_CONST trueconst POP_JUMP_IF_FALSE xx
def f():
while 1:
pass
return list
asm = disassemble(f)
- for elem in ('LOAD_CONST', 'JUMP_IF_FALSE'):
- self.assert_(elem not in asm)
+ for elem in ('LOAD_CONST', 'POP_JUMP_IF_FALSE'):
+ self.assertNotIn(elem, asm)
for elem in ('JUMP_ABSOLUTE',):
- self.assert_(elem in asm)
+ self.assertIn(elem, asm)
def test_pack_unpack(self):
for line, elem in (
@@ -74,9 +73,9 @@ class TestTranforms(unittest.TestCase):
('a, b, c = a, b, c', 'ROT_THREE',),
):
asm = dis_single(line)
- self.assert_(elem in asm)
- self.assert_('BUILD_TUPLE' not in asm)
- self.assert_('UNPACK_TUPLE' not in asm)
+ self.assertIn(elem, asm)
+ self.assertNotIn('BUILD_TUPLE', asm)
+ self.assertNotIn('UNPACK_TUPLE', asm)
def test_folding_of_tuples_of_constants(self):
for line, elem in (
@@ -87,8 +86,8 @@ class TestTranforms(unittest.TestCase):
('((1, 2), 3, 4)', '(((1, 2), 3, 4))'),
):
asm = dis_single(line)
- self.assert_(elem in asm)
- self.assert_('BUILD_TUPLE' not in asm)
+ self.assertIn(elem, asm)
+ self.assertNotIn('BUILD_TUPLE', asm)
# Bug 1053819: Tuple of constants misidentified when presented with:
# . . . opcode_with_arg 100 unary_opcode BUILD_TUPLE 1 . . .
@@ -126,17 +125,35 @@ class TestTranforms(unittest.TestCase):
('a = 13 | 7', '(15)'), # binary or
):
asm = dis_single(line)
- self.assert_(elem in asm, asm)
- self.assert_('BINARY_' not in asm)
+ self.assertIn(elem, asm, asm)
+ self.assertNotIn('BINARY_', asm)
# Verify that unfoldables are skipped
asm = dis_single('a=2+"b"')
- self.assert_('(2)' in asm)
- self.assert_("('b')" in asm)
+ self.assertIn('(2)', asm)
+ self.assertIn("('b')", asm)
# Verify that large sequences do not result from folding
asm = dis_single('a="x"*1000')
- self.assert_('(1000)' in asm)
+ self.assertIn('(1000)', asm)
+
+ def test_binary_subscr_on_unicode(self):
+ # valid code get optimized
+ asm = dis_single('u"foo"[0]')
+ self.assertIn("(u'f')", asm)
+ self.assertNotIn('BINARY_SUBSCR', asm)
+ asm = dis_single('u"\u0061\uffff"[1]')
+ self.assertIn("(u'\\uffff')", asm)
+ self.assertNotIn('BINARY_SUBSCR', asm)
+
+ # invalid code doesn't get optimized
+ # out of range
+ asm = dis_single('u"fuu"[10]')
+ self.assertIn('BINARY_SUBSCR', asm)
+ # non-BMP char (see #5057)
+ asm = dis_single('u"\U00012345"[0]')
+ self.assertIn('BINARY_SUBSCR', asm)
+
def test_folding_of_unaryops_on_constants(self):
for line, elem in (
@@ -145,8 +162,8 @@ class TestTranforms(unittest.TestCase):
('~-2', '(1)'), # unary invert
):
asm = dis_single(line)
- self.assert_(elem in asm, asm)
- self.assert_('UNARY_' not in asm)
+ self.assertIn(elem, asm, asm)
+ self.assertNotIn('UNARY_', asm)
# Verify that unfoldables are skipped
for line, elem in (
@@ -154,16 +171,16 @@ class TestTranforms(unittest.TestCase):
('~"abc"', "('abc')"), # unary invert
):
asm = dis_single(line)
- self.assert_(elem in asm, asm)
- self.assert_('UNARY_' in asm)
+ self.assertIn(elem, asm, asm)
+ self.assertIn('UNARY_', asm)
def test_elim_extra_return(self):
# RETURN LOAD_CONST None RETURN --> RETURN
def f(x):
return x
asm = disassemble(f)
- self.assert_('LOAD_CONST' not in asm)
- self.assert_('(None)' not in asm)
+ self.assertNotIn('LOAD_CONST', asm)
+ self.assertNotIn('(None)', asm)
self.assertEqual(asm.split().count('RETURN_VALUE'), 1)
def test_elim_jump_to_return(self):
@@ -171,8 +188,8 @@ class TestTranforms(unittest.TestCase):
def f(cond, true_value, false_value):
return true_value if cond else false_value
asm = disassemble(f)
- self.assert_('JUMP_FORWARD' not in asm)
- self.assert_('JUMP_ABSOLUTE' not in asm)
+ self.assertNotIn('JUMP_FORWARD', asm)
+ self.assertNotIn('JUMP_ABSOLUTE', asm)
self.assertEqual(asm.split().count('RETURN_VALUE'), 2)
def test_elim_jump_after_return1(self):
@@ -187,8 +204,8 @@ class TestTranforms(unittest.TestCase):
return 5
return 6
asm = disassemble(f)
- self.assert_('JUMP_FORWARD' not in asm)
- self.assert_('JUMP_ABSOLUTE' not in asm)
+ self.assertNotIn('JUMP_FORWARD', asm)
+ self.assertNotIn('JUMP_ABSOLUTE', asm)
self.assertEqual(asm.split().count('RETURN_VALUE'), 6)
def test_elim_jump_after_return2(self):
@@ -197,7 +214,7 @@ class TestTranforms(unittest.TestCase):
while 1:
if cond1: return 4
asm = disassemble(f)
- self.assert_('JUMP_FORWARD' not in asm)
+ self.assertNotIn('JUMP_FORWARD', asm)
# There should be one jump for the while loop.
self.assertEqual(asm.split().count('JUMP_ABSOLUTE'), 1)
self.assertEqual(asm.split().count('RETURN_VALUE'), 2)
@@ -208,7 +225,7 @@ def test_main(verbose=None):
from test import test_support
test_classes = (TestTranforms,)
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
("backquote not supported", SyntaxWarning)):
test_support.run_unittest(*test_classes)
diff --git a/Lib/test/test_pep247.py b/Lib/test/test_pep247.py
index 691c85a391..423d33383f 100644
--- a/Lib/test/test_pep247.py
+++ b/Lib/test/test_pep247.py
@@ -19,8 +19,8 @@ from test import test_support
class Pep247Test(unittest.TestCase):
def check_module(self, module, key=None):
- self.assert_(hasattr(module, 'digest_size'))
- self.assert_(module.digest_size is None or module.digest_size > 0)
+ self.assertTrue(hasattr(module, 'digest_size'))
+ self.assertTrue(module.digest_size is None or module.digest_size > 0)
if not key is None:
obj1 = module.new(key)
@@ -39,24 +39,24 @@ class Pep247Test(unittest.TestCase):
obj3.update('string')
h2 = obj3.digest()
- self.assertEquals(h1, h2)
+ self.assertEqual(h1, h2)
- self.assert_(hasattr(obj1, 'digest_size'))
+ self.assertTrue(hasattr(obj1, 'digest_size'))
if not module.digest_size is None:
- self.assertEquals(obj1.digest_size, module.digest_size)
+ self.assertEqual(obj1.digest_size, module.digest_size)
- self.assertEquals(obj1.digest_size, len(h1))
+ self.assertEqual(obj1.digest_size, len(h1))
obj1.update('string')
obj_copy = obj1.copy()
- self.assertEquals(obj1.digest(), obj_copy.digest())
- self.assertEquals(obj1.hexdigest(), obj_copy.hexdigest())
+ self.assertEqual(obj1.digest(), obj_copy.digest())
+ self.assertEqual(obj1.hexdigest(), obj_copy.hexdigest())
digest, hexdigest = obj1.digest(), obj1.hexdigest()
hd2 = ""
for byte in digest:
hd2 += '%02x' % ord(byte)
- self.assertEquals(hd2, hexdigest)
+ self.assertEqual(hd2, hexdigest)
def test_md5(self):
self.check_module(md5)
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py
index cb6210b02c..92b82d0f7d 100644
--- a/Lib/test/test_pep277.py
+++ b/Lib/test/test_pep277.py
@@ -1,22 +1,58 @@
# Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import sys, os, unittest
+from unicodedata import normalize
from test import test_support
-if not os.path.supports_unicode_filenames:
- raise test_support.TestSkipped, "test works only on NT+"
filenames = [
- 'abc',
- u'ascii',
- u'Gr\xfc\xdf-Gott',
- u'\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2',
- u'\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435',
- u'\u306b\u307d\u3093',
- u'\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1',
- u'\u66e8\u66e9\u66eb',
- u'\u66e8\u05e9\u3093\u0434\u0393\xdf',
+ '1_abc',
+ u'2_ascii',
+ u'3_Gr\xfc\xdf-Gott',
+ u'4_\u0393\u03b5\u03b9\u03ac-\u03c3\u03b1\u03c2',
+ u'5_\u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435',
+ u'6_\u306b\u307d\u3093',
+ u'7_\u05d4\u05e9\u05e7\u05e6\u05e5\u05e1',
+ u'8_\u66e8\u66e9\u66eb',
+ u'9_\u66e8\u05e9\u3093\u0434\u0393\xdf',
+ # Specific code points: fn, NFC(fn) and NFKC(fn) all differents
+ u'10_\u1fee\u1ffd',
]
+# Mac OS X decomposes Unicode names, using Normal Form D.
+# http://developer.apple.com/mac/library/qa/qa2001/qa1173.html
+# "However, most volume formats do not follow the exact specification for
+# these normal forms. For example, HFS Plus uses a variant of Normal Form D
+# in which U+2000 through U+2FFF, U+F900 through U+FAFF, and U+2F800 through
+# U+2FAFF are not decomposed."
+if sys.platform != 'darwin':
+ filenames.extend([
+ # Specific code points: NFC(fn), NFD(fn), NFKC(fn) and NFKD(fn) all differents
+ u'11_\u0385\u03d3\u03d4',
+ u'12_\u00a8\u0301\u03d2\u0301\u03d2\u0308', # == NFD(u'\u0385\u03d3\u03d4')
+ u'13_\u0020\u0308\u0301\u038e\u03ab', # == NFKC(u'\u0385\u03d3\u03d4')
+ u'14_\u1e9b\u1fc1\u1fcd\u1fce\u1fcf\u1fdd\u1fde\u1fdf\u1fed',
+
+ # Specific code points: fn, NFC(fn) and NFKC(fn) all differents
+ u'15_\u1fee\u1ffd\ufad1',
+ u'16_\u2000\u2000\u2000A',
+ u'17_\u2001\u2001\u2001A',
+ u'18_\u2003\u2003\u2003A', # == NFC(u'\u2001\u2001\u2001A')
+ u'19_\u0020\u0020\u0020A', # u'\u0020' == u' ' == NFKC(u'\u2000') ==
+ # NFKC(u'\u2001') == NFKC(u'\u2003')
+])
+
+
+# Is it Unicode-friendly?
+if not os.path.supports_unicode_filenames:
+ fsencoding = sys.getfilesystemencoding() or sys.getdefaultencoding()
+ try:
+ for name in filenames:
+ name.encode(fsencoding)
+ except UnicodeEncodeError:
+ raise unittest.SkipTest("only NT+ and systems with "
+ "Unicode-friendly filesystem encoding")
+
+
# Destroy directory dirname and all files under it, to one level.
def deltree(dirname):
# Don't hide legitimate errors: if one of these suckers exists, it's
@@ -27,35 +63,45 @@ def deltree(dirname):
os.unlink(os.path.join(dirname, fname))
os.rmdir(dirname)
+
class UnicodeFileTests(unittest.TestCase):
- files = [os.path.join(test_support.TESTFN, f) for f in filenames]
+ files = set(filenames)
+ normal_form = None
def setUp(self):
try:
os.mkdir(test_support.TESTFN)
except OSError:
pass
+ files = set()
for name in self.files:
- f = open(name, 'w')
- f.write((name+'\n').encode("utf-8"))
- f.close()
+ name = os.path.join(test_support.TESTFN, self.norm(name))
+ with open(name, 'w') as f:
+ f.write((name+'\n').encode("utf-8"))
os.stat(name)
+ files.add(name)
+ self.files = files
def tearDown(self):
deltree(test_support.TESTFN)
+ def norm(self, s):
+ if self.normal_form and isinstance(s, unicode):
+ return normalize(self.normal_form, s)
+ return s
+
def _apply_failure(self, fn, filename, expected_exception,
check_fn_in_exception = True):
- try:
+ with self.assertRaises(expected_exception) as c:
fn(filename)
- raise test_support.TestFailed("Expected to fail calling '%s(%r)'"
- % (fn.__name__, filename))
- except expected_exception, details:
- if check_fn_in_exception and details.filename != filename:
- raise test_support.TestFailed("Function '%s(%r) failed with "
- "bad filename in the exception: %r"
- % (fn.__name__, filename,
- details.filename))
+ exc_filename = c.exception.filename
+ # the "filename" exception attribute may be encoded
+ if isinstance(exc_filename, str):
+ filename = filename.encode(sys.getfilesystemencoding())
+ if check_fn_in_exception:
+ self.assertEqual(exc_filename, filename, "Function '%s(%r) failed "
+ "with bad filename in the exception: %r" %
+ (fn.__name__, filename, exc_filename))
def test_failures(self):
# Pass non-existing Unicode filenames all over the place.
@@ -76,39 +122,89 @@ class UnicodeFileTests(unittest.TestCase):
f.close()
os.stat(name)
+ # Skip the test on darwin, because darwin does normalize the filename to
+ # NFD (a variant of Unicode NFD form). Normalize the filename to NFC, NFKC,
+ # NFKD in Python is useless, because darwin will normalize it later and so
+ # open(), os.stat(), etc. don't raise any exception.
+ @unittest.skipIf(sys.platform == 'darwin', 'irrelevant test on Mac OS X')
+ def test_normalize(self):
+ files = set(f for f in self.files if isinstance(f, unicode))
+ others = set()
+ for nf in set(['NFC', 'NFD', 'NFKC', 'NFKD']):
+ others |= set(normalize(nf, file) for file in files)
+ others -= files
+ for name in others:
+ self._apply_failure(open, name, IOError)
+ self._apply_failure(os.stat, name, OSError)
+ self._apply_failure(os.chdir, name, OSError)
+ self._apply_failure(os.rmdir, name, OSError)
+ self._apply_failure(os.remove, name, OSError)
+ # listdir may append a wildcard to the filename, so dont check
+ self._apply_failure(os.listdir, name, OSError, False)
+
+ # Skip the test on darwin, because darwin uses a normalization different
+ # than Python NFD normalization: filenames are different even if we use
+ # Python NFD normalization.
+ @unittest.skipIf(sys.platform == 'darwin', 'irrelevant test on Mac OS X')
def test_listdir(self):
+ sf0 = set(self.files)
f1 = os.listdir(test_support.TESTFN)
f2 = os.listdir(unicode(test_support.TESTFN,
sys.getfilesystemencoding()))
- sf2 = set(u"\\".join((unicode(test_support.TESTFN), f))
- for f in f2)
- self.failUnlessEqual(len(f1), len(self.files))
- self.failUnlessEqual(sf2, set(self.files))
+ sf2 = set(os.path.join(unicode(test_support.TESTFN), f) for f in f2)
+ self.assertEqual(sf0, sf2)
+ self.assertEqual(len(f1), len(f2))
def test_rename(self):
for name in self.files:
- os.rename(name,"tmp")
- os.rename("tmp",name)
+ os.rename(name, "tmp")
+ os.rename("tmp", name)
def test_directory(self):
- dirname = os.path.join(test_support.TESTFN,u'Gr\xfc\xdf-\u66e8\u66e9\u66eb')
+ dirname = os.path.join(test_support.TESTFN,
+ u'Gr\xfc\xdf-\u66e8\u66e9\u66eb')
filename = u'\xdf-\u66e8\u66e9\u66eb'
oldwd = os.getcwd()
os.mkdir(dirname)
os.chdir(dirname)
- f = open(filename, 'w')
- f.write((filename + '\n').encode("utf-8"))
- f.close()
- os.access(filename,os.R_OK)
- os.remove(filename)
- os.chdir(oldwd)
- os.rmdir(dirname)
+ try:
+ with open(filename, 'w') as f:
+ f.write((filename + '\n').encode("utf-8"))
+ os.access(filename,os.R_OK)
+ os.remove(filename)
+ finally:
+ os.chdir(oldwd)
+ os.rmdir(dirname)
+
+
+class UnicodeNFCFileTests(UnicodeFileTests):
+ normal_form = 'NFC'
+
+
+class UnicodeNFDFileTests(UnicodeFileTests):
+ normal_form = 'NFD'
+
+
+class UnicodeNFKCFileTests(UnicodeFileTests):
+ normal_form = 'NFKC'
+
+
+class UnicodeNFKDFileTests(UnicodeFileTests):
+ normal_form = 'NFKD'
+
def test_main():
try:
- test_support.run_unittest(UnicodeFileTests)
+ test_support.run_unittest(
+ UnicodeFileTests,
+ UnicodeNFCFileTests,
+ UnicodeNFDFileTests,
+ UnicodeNFKCFileTests,
+ UnicodeNFKDFileTests,
+ )
finally:
deltree(test_support.TESTFN)
+
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_pep352.py b/Lib/test/test_pep352.py
index 3f23af5add..88b3136651 100644
--- a/Lib/test/test_pep352.py
+++ b/Lib/test/test_pep352.py
@@ -31,7 +31,7 @@ class ExceptionClassTests(unittest.TestCase):
inheritance hierarchy)"""
def test_builtins_new_style(self):
- self.failUnless(issubclass(Exception, object))
+ self.assertTrue(issubclass(Exception, object))
@ignore_deprecation_warnings
def verify_instance_interface(self, ins):
@@ -51,7 +51,7 @@ class ExceptionClassTests(unittest.TestCase):
last_exc = getattr(__builtin__, superclass_name)
except AttributeError:
self.fail("base class %s not a built-in" % superclass_name)
- self.failUnless(superclass_name in exc_set)
+ self.assertIn(superclass_name, exc_set)
exc_set.discard(superclass_name)
superclasses = [] # Loop will insert base exception
last_depth = 0
@@ -78,27 +78,27 @@ class ExceptionClassTests(unittest.TestCase):
elif last_depth > depth:
while superclasses[-1][0] >= depth:
superclasses.pop()
- self.failUnless(issubclass(exc, superclasses[-1][1]),
+ self.assertTrue(issubclass(exc, superclasses[-1][1]),
"%s is not a subclass of %s" % (exc.__name__,
superclasses[-1][1].__name__))
try: # Some exceptions require arguments; just skip them
self.verify_instance_interface(exc())
except TypeError:
pass
- self.failUnless(exc_name in exc_set)
+ self.assertIn(exc_name, exc_set)
exc_set.discard(exc_name)
last_exc = exc
last_depth = depth
finally:
inheritance_tree.close()
- self.failUnlessEqual(len(exc_set), 0, "%s not accounted for" % exc_set)
+ self.assertEqual(len(exc_set), 0, "%s not accounted for" % exc_set)
interface_tests = ("length", "args", "message", "str", "unicode", "repr",
"indexing")
def interface_test_driver(self, results):
for test_name, (given, expected) in zip(self.interface_tests, results):
- self.failUnlessEqual(given, expected, "%s: %s != %s" % (test_name,
+ self.assertEqual(given, expected, "%s: %s != %s" % (test_name,
given, expected))
@ignore_deprecation_warnings
@@ -215,28 +215,19 @@ class UsageTests(unittest.TestCase):
warnings.resetwarnings()
warnings.filterwarnings("error")
str_exc = "spam"
- try:
+ with self.assertRaises(DeprecationWarning):
try:
raise StandardError
except str_exc:
pass
- except DeprecationWarning:
- pass
- except StandardError:
- self.fail("catching a string exception did not raise "
- "DeprecationWarning")
+
# Make sure that even if the string exception is listed in a tuple
# that a warning is raised.
- try:
+ with self.assertRaises(DeprecationWarning):
try:
raise StandardError
except (AssertionError, str_exc):
pass
- except DeprecationWarning:
- pass
- except StandardError:
- self.fail("catching a string exception specified in a tuple did "
- "not raise DeprecationWarning")
def test_main():
diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py
index fb10ffed16..6c83811be8 100644
--- a/Lib/test/test_pickle.py
+++ b/Lib/test/test_pickle.py
@@ -6,6 +6,7 @@ from test import test_support
from test.pickletester import AbstractPickleTests
from test.pickletester import AbstractPickleModuleTests
from test.pickletester import AbstractPersistentPicklerTests
+from test.pickletester import AbstractPicklerUnpicklerObjectTests
class PickleTests(AbstractPickleTests, AbstractPickleModuleTests):
@@ -60,11 +61,18 @@ class PersPicklerTests(AbstractPersistentPicklerTests):
u = PersUnpickler(f)
return u.load()
+class PicklerUnpicklerObjectTests(AbstractPicklerUnpicklerObjectTests):
+
+ pickler_class = pickle.Pickler
+ unpickler_class = pickle.Unpickler
+
+
def test_main():
test_support.run_unittest(
PickleTests,
PicklerTests,
- PersPicklerTests
+ PersPicklerTests,
+ PicklerUnpicklerObjectTests,
)
test_support.run_doctest(pickle)
diff --git a/Lib/test/test_pipes.py b/Lib/test/test_pipes.py
index 072d02360f..c8b8be106c 100644
--- a/Lib/test/test_pipes.py
+++ b/Lib/test/test_pipes.py
@@ -2,10 +2,10 @@ import pipes
import os
import string
import unittest
-from test.test_support import TESTFN, run_unittest, unlink, TestSkipped
+from test.test_support import TESTFN, run_unittest, unlink, reap_children
if os.name != 'posix':
- raise TestSkipped('pipes module only works on posix')
+ raise unittest.SkipTest('pipes module only works on posix')
TESTFN2 = TESTFN + "2"
@@ -23,43 +23,55 @@ class SimplePipeTests(unittest.TestCase):
f = t.open(TESTFN, 'w')
f.write('hello world #1')
f.close()
- self.assertEqual(open(TESTFN).read(), 'HELLO WORLD #1')
+ with open(TESTFN) as f:
+ self.assertEqual(f.read(), 'HELLO WORLD #1')
def testSimplePipe2(self):
- file(TESTFN, 'w').write('hello world #2')
+ with open(TESTFN, 'w') as f:
+ f.write('hello world #2')
t = pipes.Template()
t.append(s_command + ' < $IN > $OUT', pipes.FILEIN_FILEOUT)
t.copy(TESTFN, TESTFN2)
- self.assertEqual(open(TESTFN2).read(), 'HELLO WORLD #2')
+ with open(TESTFN2) as f:
+ self.assertEqual(f.read(), 'HELLO WORLD #2')
def testSimplePipe3(self):
- file(TESTFN, 'w').write('hello world #2')
+ with open(TESTFN, 'w') as f:
+ f.write('hello world #2')
t = pipes.Template()
t.append(s_command + ' < $IN', pipes.FILEIN_STDOUT)
- self.assertEqual(t.open(TESTFN, 'r').read(), 'HELLO WORLD #2')
+ with t.open(TESTFN, 'r') as f:
+ self.assertEqual(f.read(), 'HELLO WORLD #2')
def testEmptyPipeline1(self):
# copy through empty pipe
d = 'empty pipeline test COPY'
- file(TESTFN, 'w').write(d)
- file(TESTFN2, 'w').write('')
+ with open(TESTFN, 'w') as f:
+ f.write(d)
+ with open(TESTFN2, 'w') as f:
+ f.write('')
t=pipes.Template()
t.copy(TESTFN, TESTFN2)
- self.assertEqual(open(TESTFN2).read(), d)
+ with open(TESTFN2) as f:
+ self.assertEqual(f.read(), d)
def testEmptyPipeline2(self):
# read through empty pipe
d = 'empty pipeline test READ'
- file(TESTFN, 'w').write(d)
+ with open(TESTFN, 'w') as f:
+ f.write(d)
t=pipes.Template()
- self.assertEqual(t.open(TESTFN, 'r').read(), d)
+ with t.open(TESTFN, 'r') as f:
+ self.assertEqual(f.read(), d)
def testEmptyPipeline3(self):
# write through empty pipe
d = 'empty pipeline test WRITE'
t = pipes.Template()
- t.open(TESTFN, 'w').write(d)
- self.assertEqual(open(TESTFN).read(), d)
+ with t.open(TESTFN, 'w') as f:
+ f.write(d)
+ with open(TESTFN) as f:
+ self.assertEqual(f.read(), d)
def testQuoting(self):
safeunquoted = string.ascii_letters + string.digits + '@%_-+=:,./'
@@ -186,6 +198,7 @@ class SimplePipeTests(unittest.TestCase):
def test_main():
run_unittest(SimplePipeTests)
+ reap_children()
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_pkg.py b/Lib/test/test_pkg.py
index 3a954ca366..5f1659b0f6 100644
--- a/Lib/test/test_pkg.py
+++ b/Lib/test/test_pkg.py
@@ -51,9 +51,10 @@ class Test(unittest.TestCase):
def tearDown(self):
sys.path[:] = self.syspath
- cleanout(self.root)
+ if self.root: # Only clean if the test was actually run
+ cleanout(self.root)
- # delete all modules concerning the tested hiearchy
+ # delete all modules concerning the tested hierarchy
if self.pkgname:
modules = [name for name in sys.modules
if self.pkgname in name.split('.')]
@@ -101,9 +102,6 @@ class Test(unittest.TestCase):
]
self.mkhier(hier)
- import t2
- self.assertEqual(t2.__doc__, "doc for t2")
-
import t2.sub
import t2.sub.subsub
self.assertEqual(t2.__name__, "t2")
@@ -126,7 +124,7 @@ class Test(unittest.TestCase):
self.assertEqual(subsub.__name__, "t2.sub.subsub")
self.assertEqual(sub.subsub.__name__, "t2.sub.subsub")
for name in ['spam', 'sub', 'subsub', 't2']:
- self.failUnless(locals()["name"], "Failed to import %s" % name)
+ self.assertTrue(locals()["name"], "Failed to import %s" % name)
import t2.sub
import t2.sub.subsub
@@ -136,7 +134,7 @@ class Test(unittest.TestCase):
s = """
from t2 import *
- self.failUnless(dir(), ['self', 'sub'])
+ self.assertTrue(dir(), ['self', 'sub'])
"""
self.run_code(s)
@@ -254,26 +252,37 @@ class Test(unittest.TestCase):
self.assertEqual(fixdir(dir(tas)),
['__doc__', '__file__', '__name__',
'__package__', '__path__'])
- self.failIf(t7)
+ self.assertFalse(t7)
from t7 import sub as subpar
self.assertEqual(fixdir(dir(subpar)),
['__doc__', '__file__', '__name__',
'__package__', '__path__'])
- self.failIf(t7)
- self.failIf(sub)
+ self.assertFalse(t7)
+ self.assertFalse(sub)
from t7.sub import subsub as subsubsub
self.assertEqual(fixdir(dir(subsubsub)),
['__doc__', '__file__', '__name__',
'__package__', '__path__', 'spam'])
- self.failIf(t7)
- self.failIf(sub)
- self.failIf(subsub)
+ self.assertFalse(t7)
+ self.assertFalse(sub)
+ self.assertFalse(subsub)
from t7.sub.subsub import spam as ham
self.assertEqual(ham, 1)
- self.failIf(t7)
- self.failIf(sub)
- self.failIf(subsub)
+ self.assertFalse(t7)
+ self.assertFalse(sub)
+ self.assertFalse(subsub)
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_8(self):
+ hier = [
+ ("t8", None),
+ ("t8 __init__"+os.extsep+"py", "'doc for t8'"),
+ ]
+ self.mkhier(hier)
+ import t8
+ self.assertEqual(t8.__doc__, "doc for t8")
def test_main():
test_support.run_unittest(__name__)
diff --git a/Lib/test/test_pkgimport.py b/Lib/test/test_pkgimport.py
index 5e02b1b6a0..30d48cdcbb 100644
--- a/Lib/test/test_pkgimport.py
+++ b/Lib/test/test_pkgimport.py
@@ -22,7 +22,8 @@ class TestImport(unittest.TestCase):
self.package_dir = os.path.join(self.test_dir,
self.package_name)
os.mkdir(self.package_dir)
- open(os.path.join(self.package_dir, '__init__'+os.extsep+'py'), 'w')
+ open(os.path.join(
+ self.package_dir, '__init__'+os.extsep+'py'), 'w').close()
self.module_path = os.path.join(self.package_dir, 'foo'+os.extsep+'py')
def tearDown(self):
@@ -52,7 +53,7 @@ class TestImport(unittest.TestCase):
try: __import__(self.module_name)
except SyntaxError: pass
else: raise RuntimeError, 'Failed to induce SyntaxError'
- self.assertTrue(self.module_name not in sys.modules)
+ self.assertNotIn(self.module_name, sys.modules)
self.assertFalse(hasattr(sys.modules[self.package_name], 'foo'))
# ...make up a variable name that isn't bound in __builtins__
diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py
index 98d691196a..1ae5888250 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -48,25 +48,73 @@ class PlatformTest(unittest.TestCase):
def test_processor(self):
res = platform.processor()
- def test_python_implementation(self):
- res = platform.python_implementation()
-
- def test_python_version(self):
- res1 = platform.python_version()
- res2 = platform.python_version_tuple()
- self.assertEqual(res1, ".".join(res2))
-
- def test_python_branch(self):
- res = platform.python_branch()
-
- def test_python_revision(self):
- res = platform.python_revision()
-
- def test_python_build(self):
- res = platform.python_build()
-
- def test_python_compiler(self):
- res = platform.python_compiler()
+ def setUp(self):
+ self.save_version = sys.version
+ self.save_subversion = sys.subversion
+ self.save_platform = sys.platform
+
+ def tearDown(self):
+ sys.version = self.save_version
+ sys.subversion = self.save_subversion
+ sys.platform = self.save_platform
+
+ def test_sys_version(self):
+ # Old test.
+ for input, output in (
+ ('2.4.3 (#1, Jun 21 2006, 13:54:21) \n[GCC 3.3.4 (pre 3.3.5 20040809)]',
+ ('CPython', '2.4.3', '', '', '1', 'Jun 21 2006 13:54:21', 'GCC 3.3.4 (pre 3.3.5 20040809)')),
+ ('IronPython 1.0.60816 on .NET 2.0.50727.42',
+ ('IronPython', '1.0.60816', '', '', '', '', '.NET 2.0.50727.42')),
+ ('IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42',
+ ('IronPython', '1.0.0', '', '', '', '', '.NET 2.0.50727.42')),
+ ):
+ # branch and revision are not "parsed", but fetched
+ # from sys.subversion. Ignore them
+ (name, version, branch, revision, buildno, builddate, compiler) \
+ = platform._sys_version(input)
+ self.assertEqual(
+ (name, version, '', '', buildno, builddate, compiler), output)
+
+ # Tests for python_implementation(), python_version(), python_branch(),
+ # python_revision(), python_build(), and python_compiler().
+ sys_versions = {
+ ("2.6.1 (r261:67515, Dec 6 2008, 15:26:00) \n[GCC 4.0.1 (Apple Computer, Inc. build 5370)]",
+ ('CPython', 'tags/r261', '67515'), self.save_platform)
+ :
+ ("CPython", "2.6.1", "tags/r261", "67515",
+ ('r261:67515', 'Dec 6 2008 15:26:00'),
+ 'GCC 4.0.1 (Apple Computer, Inc. build 5370)'),
+ ("IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.3053", None, "cli")
+ :
+ ("IronPython", "2.0.0", "", "", ("", ""),
+ ".NET 2.0.50727.3053"),
+ ("2.5 (trunk:6107, Mar 26 2009, 13:02:18) \n[Java HotSpot(TM) Client VM (\"Apple Computer, Inc.\")]",
+ ('Jython', 'trunk', '6107'), "java1.5.0_16")
+ :
+ ("Jython", "2.5.0", "trunk", "6107",
+ ('trunk:6107', 'Mar 26 2009'), "java1.5.0_16"),
+ ("2.5.2 (63378, Mar 26 2009, 18:03:29)\n[PyPy 1.0.0]",
+ ('PyPy', 'trunk', '63378'), self.save_platform)
+ :
+ ("PyPy", "2.5.2", "trunk", "63378", ('63378', 'Mar 26 2009'),
+ "")
+ }
+ for (version_tag, subversion, sys_platform), info in \
+ sys_versions.iteritems():
+ sys.version = version_tag
+ if subversion is None:
+ if hasattr(sys, "subversion"):
+ del sys.subversion
+ else:
+ sys.subversion = subversion
+ if sys_platform is not None:
+ sys.platform = sys_platform
+ self.assertEqual(platform.python_implementation(), info[0])
+ self.assertEqual(platform.python_version(), info[1])
+ self.assertEqual(platform.python_branch(), info[2])
+ self.assertEqual(platform.python_revision(), info[3])
+ self.assertEqual(platform.python_build(), info[4])
+ self.assertEqual(platform.python_compiler(), info[5])
def test_system_alias(self):
res = platform.system_alias(
@@ -77,12 +125,33 @@ class PlatformTest(unittest.TestCase):
def test_uname(self):
res = platform.uname()
- self.assert_(any(res))
+ self.assertTrue(any(res))
+
+ @unittest.skipUnless(sys.platform.startswith('win'), "windows only test")
+ def test_uname_win32_ARCHITEW6432(self):
+ # Issue 7860: make sure we get architecture from the correct variable
+ # on 64 bit Windows: if PROCESSOR_ARCHITEW6432 exists we should be
+ # using it, per
+ # http://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx
+ try:
+ with test_support.EnvironmentVarGuard() as environ:
+ if 'PROCESSOR_ARCHITEW6432' in environ:
+ del environ['PROCESSOR_ARCHITEW6432']
+ environ['PROCESSOR_ARCHITECTURE'] = 'foo'
+ platform._uname_cache = None
+ system, node, release, version, machine, processor = platform.uname()
+ self.assertEqual(machine, 'foo')
+ environ['PROCESSOR_ARCHITEW6432'] = 'bar'
+ platform._uname_cache = None
+ system, node, release, version, machine, processor = platform.uname()
+ self.assertEqual(machine, 'bar')
+ finally:
+ platform._uname_cache = None
def test_java_ver(self):
res = platform.java_ver()
if sys.platform == 'java':
- self.assert_(all(res))
+ self.assertTrue(all(res))
def test_win32_ver(self):
res = platform.win32_ver()
@@ -107,37 +176,43 @@ class PlatformTest(unittest.TestCase):
real_ver = ln.strip().split()[-1]
break
fd.close()
- self.failIf(real_ver is None)
- self.assertEquals(res[0], real_ver)
+ self.assertFalse(real_ver is None)
+ result_list = res[0].split('.')
+ expect_list = real_ver.split('.')
+ len_diff = len(result_list) - len(expect_list)
+ # On Snow Leopard, sw_vers reports 10.6.0 as 10.6
+ if len_diff > 0:
+ expect_list.extend(['0'] * len_diff)
+ self.assertEqual(result_list, expect_list)
# res[1] claims to contain
# (version, dev_stage, non_release_version)
# That information is no longer available
- self.assertEquals(res[1], ('', '', ''))
+ self.assertEqual(res[1], ('', '', ''))
if sys.byteorder == 'little':
- self.assertEquals(res[2], 'i386')
+ self.assertEqual(res[2], 'i386')
else:
- self.assertEquals(res[2], 'PowerPC')
+ self.assertEqual(res[2], 'PowerPC')
- if sys.platform == 'darwin':
- def test_mac_ver_with_fork(self):
- # Issue7895: platform.mac_ver() crashes when using fork without exec
- #
- # This test checks that the fix for that issue works.
- #
- pid = os.fork()
- if pid == 0:
- # child
- info = platform.mac_ver()
- os._exit(0)
+ @unittest.skipUnless(sys.platform == 'darwin', "OSX only test")
+ def test_mac_ver_with_fork(self):
+ # Issue7895: platform.mac_ver() crashes when using fork without exec
+ #
+ # This test checks that the fix for that issue works.
+ #
+ pid = os.fork()
+ if pid == 0:
+ # child
+ info = platform.mac_ver()
+ os._exit(0)
- else:
- # parent
- cpid, sts = os.waitpid(pid, 0)
- self.assertEquals(cpid, pid)
- self.assertEquals(sts, 0)
+ else:
+ # parent
+ cpid, sts = os.waitpid(pid, 0)
+ self.assertEqual(cpid, pid)
+ self.assertEqual(sts, 0)
def test_dist(self):
res = platform.dist()
diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py
index 47630dce29..e6e0f868d3 100644
--- a/Lib/test/test_plistlib.py
+++ b/Lib/test/test_plistlib.py
@@ -9,7 +9,7 @@ from test import test_support
# This test data was generated through Cocoa's NSDictionary class
TESTDATA = """<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" \
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py
index fb6cd30a04..d33af911e8 100644
--- a/Lib/test/test_poll.py
+++ b/Lib/test/test_poll.py
@@ -1,12 +1,12 @@
# Test case for the os.poll() function
import os, select, random, unittest
-from test.test_support import TestSkipped, TESTFN, run_unittest
+from test.test_support import TESTFN, run_unittest
try:
select.poll
except AttributeError:
- raise TestSkipped, "select.poll not defined -- skipping test_poll"
+ raise unittest.SkipTest, "select.poll not defined -- skipping test_poll"
def find_ready_matching(ready, flag):
diff --git a/Lib/test/test_popen.py b/Lib/test/test_popen.py
index 069f370041..92b5e92ad5 100644
--- a/Lib/test/test_popen.py
+++ b/Lib/test/test_popen.py
@@ -14,13 +14,11 @@ import os, sys
# This results in Python being spawned and printing the sys.argv list.
# We can then eval() the result of this, and see what each argv was.
python = sys.executable
-if ' ' in python:
- python = '"' + python + '"' # quote embedded space for cmdline
class PopenTest(unittest.TestCase):
def _do_test_commandline(self, cmdline, expected):
cmd = '%s -c "import sys;print sys.argv" %s' % (python, cmdline)
- data = os.popen(cmd).read()
+ data = os.popen(cmd).read() + '\n'
got = eval(data)[1:] # strip off argv[0]
self.assertEqual(got, expected)
@@ -40,6 +38,13 @@ class PopenTest(unittest.TestCase):
)
test_support.reap_children()
+ def test_return_code(self):
+ self.assertEqual(os.popen("exit 0").close(), None)
+ if os.name == 'nt':
+ self.assertEqual(os.popen("exit 42").close(), 42)
+ else:
+ self.assertEqual(os.popen("exit 42").close(), 42 << 8)
+
def test_main():
test_support.run_unittest(PopenTest)
diff --git a/Lib/test/test_popen2.py b/Lib/test/test_popen2.py
index 2b7c30d371..ea4107534f 100644
--- a/Lib/test/test_popen2.py
+++ b/Lib/test/test_popen2.py
@@ -12,13 +12,13 @@ import sys
import unittest
import popen2
-from test.test_support import TestSkipped, run_unittest, reap_children
+from test.test_support import run_unittest, reap_children
if sys.platform[:4] == 'beos' or sys.platform[:6] == 'atheos':
# Locks get messed up or something. Generally we're supposed
# to avoid mixing "posix" fork & exec with native threads, and
# they may be right about that after all.
- raise TestSkipped("popen2() doesn't work on " + sys.platform)
+ raise unittest.SkipTest("popen2() doesn't work on " + sys.platform)
# if we don't have os.popen, check that
# we have os.fork. if not, skip the test
@@ -50,15 +50,21 @@ class Popen2Test(unittest.TestCase):
for inst in popen2._active:
inst.wait()
popen2._cleanup()
- self.assertFalse(popen2._active, "_active not empty")
+ self.assertFalse(popen2._active, "popen2._active not empty")
+ # The os.popen*() API delegates to the subprocess module (on Unix)
+ import subprocess
+ for inst in subprocess._active:
+ inst.wait()
+ subprocess._cleanup()
+ self.assertFalse(subprocess._active, "subprocess._active not empty")
reap_children()
def validate_output(self, teststr, expected_out, r, w, e=None):
w.write(teststr)
w.close()
got = r.read()
- self.assertEquals(expected_out, got.strip(), "wrote %r read %r" %
- (teststr, got))
+ self.assertEqual(expected_out, got.strip(), "wrote %r read %r" %
+ (teststr, got))
if e is not None:
got = e.read()
@@ -84,7 +90,7 @@ class Popen2Test(unittest.TestCase):
w, r = os.popen2(["echo", self.teststr])
got = r.read()
- self.assertEquals(got, self.teststr + "\n")
+ self.assertEqual(got, self.teststr + "\n")
w, r = os.popen2(self.cmd)
self.validate_output(self.teststr, self.expected, r, w)
@@ -97,7 +103,7 @@ class Popen2Test(unittest.TestCase):
w, r, e = os.popen3(["echo", self.teststr])
got = r.read()
- self.assertEquals(got, self.teststr + "\n")
+ self.assertEqual(got, self.teststr + "\n")
got = e.read()
self.assertFalse(got, "unexpected %r on stderr" % got)
@@ -111,7 +117,7 @@ class Popen2Test(unittest.TestCase):
w, r = os.popen4(["echo", self.teststr])
got = r.read()
- self.assertEquals(got, self.teststr + "\n")
+ self.assertEqual(got, self.teststr + "\n")
w, r = os.popen4(self.cmd)
self.validate_output(self.teststr, self.expected, r, w)
diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
index 18ed224f7a..4375f71761 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -1,43 +1,306 @@
-import socket
-import threading
+"""Test script for poplib module."""
+
+# Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL
+# a real test suite
+
import poplib
+import asyncore
+import asynchat
+import socket
+import os
import time
+import errno
from unittest import TestCase
from test import test_support
+from test.test_support import HOST
+threading = test_support.import_module('threading')
-HOST = test_support.HOST
-def server(evt, serv):
- serv.listen(5)
- try:
- conn, addr = serv.accept()
- except socket.timeout:
- pass
- else:
- conn.send("+ Hola mundo\n")
- conn.close()
- finally:
- serv.close()
- evt.set()
+# the dummy data returned by server when LIST and RETR commands are issued
+LIST_RESP = '1 1\r\n2 2\r\n3 3\r\n4 4\r\n5 5\r\n.\r\n'
+RETR_RESP = """From: postmaster@python.org\
+\r\nContent-Type: text/plain\r\n\
+MIME-Version: 1.0\r\n\
+Subject: Dummy\r\n\
+\r\n\
+line1\r\n\
+line2\r\n\
+line3\r\n\
+.\r\n"""
+
+
+class DummyPOP3Handler(asynchat.async_chat):
+
+ def __init__(self, conn):
+ asynchat.async_chat.__init__(self, conn)
+ self.set_terminator("\r\n")
+ self.in_buffer = []
+ self.push('+OK dummy pop3 server ready.')
+
+ def collect_incoming_data(self, data):
+ self.in_buffer.append(data)
+
+ def found_terminator(self):
+ line = ''.join(self.in_buffer)
+ self.in_buffer = []
+ cmd = line.split(' ')[0].lower()
+ space = line.find(' ')
+ if space != -1:
+ arg = line[space + 1:]
+ else:
+ arg = ""
+ if hasattr(self, 'cmd_' + cmd):
+ method = getattr(self, 'cmd_' + cmd)
+ method(arg)
+ else:
+ self.push('-ERR unrecognized POP3 command "%s".' %cmd)
+
+ def handle_error(self):
+ raise
+
+ def push(self, data):
+ asynchat.async_chat.push(self, data + '\r\n')
+
+ def cmd_echo(self, arg):
+ # sends back the received string (used by the test suite)
+ self.push(arg)
+
+ def cmd_user(self, arg):
+ if arg != "guido":
+ self.push("-ERR no such user")
+ self.push('+OK password required')
+
+ def cmd_pass(self, arg):
+ if arg != "python":
+ self.push("-ERR wrong password")
+ self.push('+OK 10 messages')
+
+ def cmd_stat(self, arg):
+ self.push('+OK 10 100')
+
+ def cmd_list(self, arg):
+ if arg:
+ self.push('+OK %s %s' %(arg, arg))
+ else:
+ self.push('+OK')
+ asynchat.async_chat.push(self, LIST_RESP)
+
+ cmd_uidl = cmd_list
+
+ def cmd_retr(self, arg):
+ self.push('+OK %s bytes' %len(RETR_RESP))
+ asynchat.async_chat.push(self, RETR_RESP)
+
+ cmd_top = cmd_retr
+
+ def cmd_dele(self, arg):
+ self.push('+OK message marked for deletion.')
+
+ def cmd_noop(self, arg):
+ self.push('+OK done nothing.')
+
+ def cmd_rpop(self, arg):
+ self.push('+OK done nothing.')
+
+
+class DummyPOP3Server(asyncore.dispatcher, threading.Thread):
+
+ handler = DummyPOP3Handler
+
+ def __init__(self, address, af=socket.AF_INET):
+ threading.Thread.__init__(self)
+ asyncore.dispatcher.__init__(self)
+ self.create_socket(af, socket.SOCK_STREAM)
+ self.bind(address)
+ self.listen(5)
+ self.active = False
+ self.active_lock = threading.Lock()
+ self.host, self.port = self.socket.getsockname()[:2]
+
+ def start(self):
+ assert not self.active
+ self.__flag = threading.Event()
+ threading.Thread.start(self)
+ self.__flag.wait()
+
+ def run(self):
+ self.active = True
+ self.__flag.set()
+ while self.active and asyncore.socket_map:
+ self.active_lock.acquire()
+ asyncore.loop(timeout=0.1, count=1)
+ self.active_lock.release()
+ asyncore.close_all(ignore_all=True)
+
+ def stop(self):
+ assert self.active
+ self.active = False
+ self.join()
+
+ def handle_accept(self):
+ conn, addr = self.accept()
+ self.handler = self.handler(conn)
+ self.close()
+
+ def handle_connect(self):
+ self.close()
+ handle_read = handle_connect
+
+ def writable(self):
+ return 0
+
+ def handle_error(self):
+ raise
+
-class GeneralTests(TestCase):
+class TestPOP3Class(TestCase):
+
+ def assertOK(self, resp):
+ self.assertTrue(resp.startswith("+OK"))
+
+ def setUp(self):
+ self.server = DummyPOP3Server((HOST, 0))
+ self.server.start()
+ self.client = poplib.POP3(self.server.host, self.server.port)
+
+ def tearDown(self):
+ self.client.quit()
+ self.server.stop()
+
+ def test_getwelcome(self):
+ self.assertEqual(self.client.getwelcome(), '+OK dummy pop3 server ready.')
+
+ def test_exceptions(self):
+ self.assertRaises(poplib.error_proto, self.client._shortcmd, 'echo -err')
+
+ def test_user(self):
+ self.assertOK(self.client.user('guido'))
+ self.assertRaises(poplib.error_proto, self.client.user, 'invalid')
+
+ def test_pass_(self):
+ self.assertOK(self.client.pass_('python'))
+ self.assertRaises(poplib.error_proto, self.client.user, 'invalid')
+
+ def test_stat(self):
+ self.assertEqual(self.client.stat(), (10, 100))
+
+ def test_list(self):
+ self.assertEqual(self.client.list()[1:],
+ (['1 1', '2 2', '3 3', '4 4', '5 5'], 25))
+ self.assertTrue(self.client.list('1').endswith("OK 1 1"))
+
+ def test_retr(self):
+ expected = ('+OK 116 bytes',
+ ['From: postmaster@python.org', 'Content-Type: text/plain',
+ 'MIME-Version: 1.0', 'Subject: Dummy',
+ '', 'line1', 'line2', 'line3'],
+ 113)
+ self.assertEqual(self.client.retr('foo'), expected)
+
+ def test_dele(self):
+ self.assertOK(self.client.dele('foo'))
+
+ def test_noop(self):
+ self.assertOK(self.client.noop())
+
+ def test_rpop(self):
+ self.assertOK(self.client.rpop('foo'))
+
+ def test_top(self):
+ expected = ('+OK 116 bytes',
+ ['From: postmaster@python.org', 'Content-Type: text/plain',
+ 'MIME-Version: 1.0', 'Subject: Dummy', '',
+ 'line1', 'line2', 'line3'],
+ 113)
+ self.assertEqual(self.client.top(1, 1), expected)
+
+ def test_uidl(self):
+ self.client.uidl()
+ self.client.uidl('foo')
+
+
+SUPPORTS_SSL = False
+if hasattr(poplib, 'POP3_SSL'):
+ import ssl
+
+ SUPPORTS_SSL = True
+ CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert.pem")
+
+ class DummyPOP3_SSLHandler(DummyPOP3Handler):
+
+ def __init__(self, conn):
+ asynchat.async_chat.__init__(self, conn)
+ self.socket = ssl.wrap_socket(self.socket, certfile=CERTFILE,
+ server_side=True,
+ do_handshake_on_connect=False)
+ # Must try handshake before calling push()
+ self._ssl_accepting = True
+ self._do_ssl_handshake()
+ self.set_terminator("\r\n")
+ self.in_buffer = []
+ self.push('+OK dummy pop3 server ready.')
+
+ def _do_ssl_handshake(self):
+ try:
+ self.socket.do_handshake()
+ except ssl.SSLError, err:
+ if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
+ ssl.SSL_ERROR_WANT_WRITE):
+ return
+ elif err.args[0] == ssl.SSL_ERROR_EOF:
+ return self.handle_close()
+ raise
+ except socket.error, err:
+ if err.args[0] == errno.ECONNABORTED:
+ return self.handle_close()
+ else:
+ self._ssl_accepting = False
+
+ def handle_read(self):
+ if self._ssl_accepting:
+ self._do_ssl_handshake()
+ else:
+ DummyPOP3Handler.handle_read(self)
+
+ class TestPOP3_SSLClass(TestPOP3Class):
+ # repeat previous tests by using poplib.POP3_SSL
+
+ def setUp(self):
+ self.server = DummyPOP3Server((HOST, 0))
+ self.server.handler = DummyPOP3_SSLHandler
+ self.server.start()
+ self.client = poplib.POP3_SSL(self.server.host, self.server.port)
+
+ def test__all__(self):
+ self.assertIn('POP3_SSL', poplib.__all__)
+
+
+class TestTimeouts(TestCase):
def setUp(self):
self.evt = threading.Event()
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.settimeout(3)
self.port = test_support.bind_port(self.sock)
- threading.Thread(target=server, args=(self.evt,self.sock)).start()
+ threading.Thread(target=self.server, args=(self.evt,self.sock)).start()
time.sleep(.1)
def tearDown(self):
self.evt.wait()
- def testBasic(self):
- # connects
- pop = poplib.POP3(HOST, self.port)
- pop.sock.close()
+ def server(self, evt, serv):
+ serv.listen(5)
+ try:
+ conn, addr = serv.accept()
+ except socket.timeout:
+ pass
+ else:
+ conn.send("+ Hola mundo\n")
+ conn.close()
+ finally:
+ serv.close()
+ evt.set()
def testTimeoutDefault(self):
self.assertTrue(socket.getdefaulttimeout() is None)
@@ -65,8 +328,16 @@ class GeneralTests(TestCase):
pop.sock.close()
-def test_main(verbose=None):
- test_support.run_unittest(GeneralTests)
+def test_main():
+ tests = [TestPOP3Class, TestTimeouts]
+ if SUPPORTS_SSL:
+ tests.append(TestPOP3_SSLClass)
+ thread_info = test_support.threading_setup()
+ try:
+ test_support.run_unittest(*tests)
+ finally:
+ test_support.threading_cleanup(*thread_info)
+
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index fb830ae9ec..a5db21eefb 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -2,10 +2,8 @@
from test import test_support
-try:
- import posix
-except ImportError:
- raise test_support.TestSkipped, "posix is not available"
+# Skip these tests if there is no posix module.
+posix = test_support.import_module('posix')
import errno
import sys
@@ -16,6 +14,8 @@ import shutil
import sys
import unittest
import warnings
+
+
warnings.filterwarnings('ignore', '.* potential security risk .*',
RuntimeWarning)
@@ -38,21 +38,86 @@ class PosixTester(unittest.TestCase):
"getpid", "getpgrp", "getppid", "getuid",
]
- for name in NO_ARG_FUNCTIONS:
- posix_func = getattr(posix, name, None)
- if posix_func is not None:
- posix_func()
- self.assertRaises(TypeError, posix_func, 1)
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", "", DeprecationWarning)
+ for name in NO_ARG_FUNCTIONS:
+ posix_func = getattr(posix, name, None)
+ if posix_func is not None:
+ posix_func()
+ self.assertRaises(TypeError, posix_func, 1)
+
+ if hasattr(posix, 'getresuid'):
+ def test_getresuid(self):
+ user_ids = posix.getresuid()
+ self.assertEqual(len(user_ids), 3)
+ for val in user_ids:
+ self.assertGreaterEqual(val, 0)
+
+ if hasattr(posix, 'getresgid'):
+ def test_getresgid(self):
+ group_ids = posix.getresgid()
+ self.assertEqual(len(group_ids), 3)
+ for val in group_ids:
+ self.assertGreaterEqual(val, 0)
+
+ if hasattr(posix, 'setresuid'):
+ def test_setresuid(self):
+ current_user_ids = posix.getresuid()
+ self.assertIsNone(posix.setresuid(*current_user_ids))
+ # -1 means don't change that value.
+ self.assertIsNone(posix.setresuid(-1, -1, -1))
+
+ def test_setresuid_exception(self):
+ # Don't do this test if someone is silly enough to run us as root.
+ current_user_ids = posix.getresuid()
+ if 0 not in current_user_ids:
+ new_user_ids = (current_user_ids[0]+1, -1, -1)
+ self.assertRaises(OSError, posix.setresuid, *new_user_ids)
+
+ if hasattr(posix, 'setresgid'):
+ def test_setresgid(self):
+ current_group_ids = posix.getresgid()
+ self.assertIsNone(posix.setresgid(*current_group_ids))
+ # -1 means don't change that value.
+ self.assertIsNone(posix.setresgid(-1, -1, -1))
+
+ def test_setresgid_exception(self):
+ # Don't do this test if someone is silly enough to run us as root.
+ current_group_ids = posix.getresgid()
+ if 0 not in current_group_ids:
+ new_group_ids = (current_group_ids[0]+1, -1, -1)
+ self.assertRaises(OSError, posix.setresgid, *new_group_ids)
+
+ @unittest.skipUnless(hasattr(posix, 'initgroups'),
+ "test needs os.initgroups()")
+ def test_initgroups(self):
+ # It takes a string and an integer; check that it raises a TypeError
+ # for other argument lists.
+ self.assertRaises(TypeError, posix.initgroups)
+ self.assertRaises(TypeError, posix.initgroups, None)
+ self.assertRaises(TypeError, posix.initgroups, 3, "foo")
+ self.assertRaises(TypeError, posix.initgroups, "foo", 3, object())
+
+ # If a non-privileged user invokes it, it should fail with OSError
+ # EPERM.
+ if os.getuid() != 0:
+ name = pwd.getpwuid(posix.getuid()).pw_name
+ try:
+ posix.initgroups(name, 13)
+ except OSError as e:
+ self.assertEqual(e.errno, errno.EPERM)
+ else:
+ self.fail("Expected OSError to be raised by initgroups")
def test_statvfs(self):
if hasattr(posix, 'statvfs'):
- self.assert_(posix.statvfs(os.curdir))
+ self.assertTrue(posix.statvfs(os.curdir))
def test_fstatvfs(self):
if hasattr(posix, 'fstatvfs'):
fp = open(test_support.TESTFN)
try:
- self.assert_(posix.fstatvfs(fp.fileno()))
+ self.assertTrue(posix.fstatvfs(fp.fileno()))
finally:
fp.close()
@@ -72,7 +137,7 @@ class PosixTester(unittest.TestCase):
fp = open(test_support.TESTFN)
try:
fd = posix.dup(fp.fileno())
- self.assert_(isinstance(fd, int))
+ self.assertIsInstance(fd, int)
os.close(fd)
finally:
fp.close()
@@ -138,13 +203,13 @@ class PosixTester(unittest.TestCase):
if hasattr(posix, 'fstat'):
fp = open(test_support.TESTFN)
try:
- self.assert_(posix.fstat(fp.fileno()))
+ self.assertTrue(posix.fstat(fp.fileno()))
finally:
fp.close()
def test_stat(self):
if hasattr(posix, 'stat'):
- self.assert_(posix.stat(test_support.TESTFN))
+ self.assertTrue(posix.stat(test_support.TESTFN))
def _test_all_chown_common(self, chown_func, first_param):
"""Common code for chown, fchown and lchown tests."""
@@ -167,7 +232,8 @@ class PosixTester(unittest.TestCase):
# test a successful chown call
chown_func(first_param, os.getuid(), os.getgid())
- def _test_chown(self):
+ @unittest.skipUnless(hasattr(posix, 'chown'), "test needs os.chown()")
+ def test_chown(self):
# raise an OSError if the file does not exist
os.unlink(test_support.TESTFN)
self.assertRaises(OSError, posix.chown, test_support.TESTFN, -1, -1)
@@ -176,10 +242,8 @@ class PosixTester(unittest.TestCase):
open(test_support.TESTFN, 'w').close()
self._test_all_chown_common(posix.chown, test_support.TESTFN)
- if hasattr(posix, 'chown'):
- test_chown = _test_chown
-
- def _test_fchown(self):
+ @unittest.skipUnless(hasattr(posix, 'fchown'), "test needs os.fchown()")
+ def test_fchown(self):
os.unlink(test_support.TESTFN)
# re-create the file
@@ -190,18 +254,13 @@ class PosixTester(unittest.TestCase):
finally:
test_file.close()
- if hasattr(posix, 'fchown'):
- test_fchown = _test_fchown
-
- def _test_lchown(self):
+ @unittest.skipUnless(hasattr(posix, 'lchown'), "test needs os.lchown()")
+ def test_lchown(self):
os.unlink(test_support.TESTFN)
# create a symlink
os.symlink('/tmp/dummy-symlink-target', test_support.TESTFN)
self._test_all_chown_common(posix.lchown, test_support.TESTFN)
- if hasattr(posix, 'lchown'):
- test_lchown = _test_lchown
-
def test_chdir(self):
if hasattr(posix, 'chdir'):
posix.chdir(os.curdir)
@@ -209,21 +268,21 @@ class PosixTester(unittest.TestCase):
def test_lsdir(self):
if hasattr(posix, 'lsdir'):
- self.assert_(test_support.TESTFN in posix.lsdir(os.curdir))
+ self.assertIn(test_support.TESTFN, posix.lsdir(os.curdir))
def test_access(self):
if hasattr(posix, 'access'):
- self.assert_(posix.access(test_support.TESTFN, os.R_OK))
+ self.assertTrue(posix.access(test_support.TESTFN, os.R_OK))
def test_umask(self):
if hasattr(posix, 'umask'):
old_mask = posix.umask(0)
- self.assert_(isinstance(old_mask, int))
+ self.assertIsInstance(old_mask, int)
posix.umask(old_mask)
def test_strerror(self):
if hasattr(posix, 'strerror'):
- self.assert_(posix.strerror(0))
+ self.assertTrue(posix.strerror(0))
def test_pipe(self):
if hasattr(posix, 'pipe'):
@@ -233,14 +292,18 @@ class PosixTester(unittest.TestCase):
def test_tempnam(self):
if hasattr(posix, 'tempnam'):
- self.assert_(posix.tempnam())
- self.assert_(posix.tempnam(os.curdir))
- self.assert_(posix.tempnam(os.curdir, 'blah'))
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", "tempnam", DeprecationWarning)
+ self.assertTrue(posix.tempnam())
+ self.assertTrue(posix.tempnam(os.curdir))
+ self.assertTrue(posix.tempnam(os.curdir, 'blah'))
def test_tmpfile(self):
if hasattr(posix, 'tmpfile'):
- fp = posix.tmpfile()
- fp.close()
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", "tmpfile", DeprecationWarning)
+ fp = posix.tmpfile()
+ fp.close()
def test_utime(self):
if hasattr(posix, 'utime'):
@@ -274,10 +337,10 @@ class PosixTester(unittest.TestCase):
os.mkdir(base_path)
os.chdir(base_path)
except:
-# Just returning nothing instead of the TestSkipped exception,
+# Just returning nothing instead of the SkipTest exception,
# because the test results in Error in that case.
# Is that ok?
-# raise test_support.TestSkipped, "cannot create directory for testing"
+# raise unittest.SkipTest, "cannot create directory for testing"
return
try:
@@ -285,7 +348,7 @@ class PosixTester(unittest.TestCase):
try:
os.mkdir(dirname)
except:
- raise test_support.TestSkipped, "mkdir cannot create directory sufficiently deep for getcwd test"
+ raise unittest.SkipTest, "mkdir cannot create directory sufficiently deep for getcwd test"
os.chdir(dirname)
try:
@@ -307,53 +370,56 @@ class PosixTester(unittest.TestCase):
os.chdir(curdir)
shutil.rmtree(base_path)
+ @unittest.skipUnless(hasattr(os, 'getegid'), "test needs os.getegid()")
def test_getgroups(self):
- with os.popen('id -G 2>/dev/null') as idg:
+ with os.popen('id -G') as idg:
groups = idg.read().strip()
if not groups:
- # This test needs 'id -G'
- return
+ raise unittest.SkipTest("need working 'id -G'")
# 'id -G' and 'os.getgroups()' should return the same
# groups, ignoring order and duplicates.
+ # #10822 - it is implementation defined whether posix.getgroups()
+ # includes the effective gid so we include it anyway, since id -G does
self.assertEqual(
set([int(x) for x in groups.split()]),
- set(posix.getgroups()))
+ set(posix.getgroups() + [posix.getegid()]))
class PosixGroupsTester(unittest.TestCase):
- if posix.getuid() == 0 and hasattr(posix, 'getgroups') and sys.platform != 'darwin':
-
- def setUp(self):
- self.saved_groups = posix.getgroups()
-
- def tearDown(self):
- if hasattr(posix, 'setgroups'):
- posix.setgroups(self.saved_groups)
- elif hasattr(posix, 'initgroups'):
- name = pwd.getpwuid(posix.getuid()).pw_name
- posix.initgroups(name, self.saved_groups[0])
-
- if hasattr(posix, 'initgroups'):
- def test_initgroups(self):
- # find missing group
-
- groups = sorted(self.saved_groups)
- for g1,g2 in zip(groups[:-1], groups[1:]):
- g = g1 + 1
- if g < g2:
- break
- else:
- g = g2 + 1
- name = pwd.getpwuid(posix.getuid()).pw_name
- posix.initgroups(name, g)
- self.assertIn(g, posix.getgroups())
+ def setUp(self):
+ if posix.getuid() != 0:
+ raise unittest.SkipTest("not enough privileges")
+ if not hasattr(posix, 'getgroups'):
+ raise unittest.SkipTest("need posix.getgroups")
+ if sys.platform == 'darwin':
+ raise unittest.SkipTest("getgroups(2) is broken on OSX")
+ self.saved_groups = posix.getgroups()
+
+ def tearDown(self):
if hasattr(posix, 'setgroups'):
- def test_setgroups(self):
- for groups in [[0], range(16)]:
- posix.setgroups(groups)
- self.assertListEqual(groups, posix.getgroups())
+ posix.setgroups(self.saved_groups)
+ elif hasattr(posix, 'initgroups'):
+ name = pwd.getpwuid(posix.getuid()).pw_name
+ posix.initgroups(name, self.saved_groups[0])
+
+ @unittest.skipUnless(hasattr(posix, 'initgroups'),
+ "test needs posix.initgroups()")
+ def test_initgroups(self):
+ # find missing group
+
+ g = max(self.saved_groups) + 1
+ name = pwd.getpwuid(posix.getuid()).pw_name
+ posix.initgroups(name, g)
+ self.assertIn(g, posix.getgroups())
+
+ @unittest.skipUnless(hasattr(posix, 'setgroups'),
+ "test needs posix.setgroups()")
+ def test_setgroups(self):
+ for groups in [[0], range(16)]:
+ posix.setgroups(groups)
+ self.assertListEqual(groups, posix.getgroups())
def test_main():
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 4cdf551cf2..8bb78d66e2 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -1,7 +1,7 @@
import unittest
-from test import test_support
+from test import test_support, test_genericpath
-import posixpath, os, sys
+import posixpath, os
from posixpath import realpath, abspath, dirname, basename
# An absolute path to a temporary filename for testing. We can't rely on TESTFN
@@ -25,29 +25,11 @@ class PosixPathTest(unittest.TestCase):
test_support.unlink(test_support.TESTFN + suffix)
safe_rmdir(test_support.TESTFN + suffix)
- def assertIs(self, a, b):
- self.assert_(a is b)
-
- def test_normcase(self):
- # Check that normcase() is idempotent
- p = "FoO/./BaR"
- p = posixpath.normcase(p)
- self.assertEqual(p, posixpath.normcase(p))
-
- self.assertRaises(TypeError, posixpath.normcase)
-
def test_join(self):
self.assertEqual(posixpath.join("/foo", "bar", "/bar", "baz"), "/bar/baz")
self.assertEqual(posixpath.join("/foo", "bar", "baz"), "/foo/bar/baz")
self.assertEqual(posixpath.join("/foo/", "bar/", "baz/"), "/foo/bar/baz/")
- self.assertRaises(TypeError, posixpath.join)
-
- def test_splitdrive(self):
- self.assertEqual(posixpath.splitdrive("/foo/bar"), ("", "/foo/bar"))
-
- self.assertRaises(TypeError, posixpath.splitdrive)
-
def test_split(self):
self.assertEqual(posixpath.split("/foo/bar"), ("/foo", "bar"))
self.assertEqual(posixpath.split("/"), ("/", ""))
@@ -55,8 +37,6 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.split("////foo"), ("////", "foo"))
self.assertEqual(posixpath.split("//foo//bar"), ("//foo", "bar"))
- self.assertRaises(TypeError, posixpath.split)
-
def splitextTest(self, path, filename, ext):
self.assertEqual(posixpath.splitext(path), (filename, ext))
self.assertEqual(posixpath.splitext("/" + path), ("/" + filename, ext))
@@ -78,7 +58,6 @@ class PosixPathTest(unittest.TestCase):
self.splitextTest("..", "..", "")
self.splitextTest("........", "........", "")
self.splitextTest("", "", "")
- self.assertRaises(TypeError, posixpath.splitext)
def test_isabs(self):
self.assertIs(posixpath.isabs(""), False)
@@ -87,8 +66,6 @@ class PosixPathTest(unittest.TestCase):
self.assertIs(posixpath.isabs("/foo/bar"), True)
self.assertIs(posixpath.isabs("foo/bar"), False)
- self.assertRaises(TypeError, posixpath.isabs)
-
def test_basename(self):
self.assertEqual(posixpath.basename("/foo/bar"), "bar")
self.assertEqual(posixpath.basename("/"), "")
@@ -96,8 +73,6 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.basename("////foo"), "foo")
self.assertEqual(posixpath.basename("//foo//bar"), "bar")
- self.assertRaises(TypeError, posixpath.basename)
-
def test_dirname(self):
self.assertEqual(posixpath.dirname("/foo/bar"), "/foo")
self.assertEqual(posixpath.dirname("/"), "/")
@@ -105,67 +80,6 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.dirname("////foo"), "////")
self.assertEqual(posixpath.dirname("//foo//bar"), "//foo")
- self.assertRaises(TypeError, posixpath.dirname)
-
- def test_commonprefix(self):
- self.assertEqual(
- posixpath.commonprefix([]),
- ""
- )
- self.assertEqual(
- posixpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"]),
- "/home/swen"
- )
- self.assertEqual(
- posixpath.commonprefix(["/home/swen/spam", "/home/swen/eggs"]),
- "/home/swen/"
- )
- self.assertEqual(
- posixpath.commonprefix(["/home/swen/spam", "/home/swen/spam"]),
- "/home/swen/spam"
- )
-
- testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd', 'aXc', 'abd', 'ab', 'aX', 'abcX']
- for s1 in testlist:
- for s2 in testlist:
- p = posixpath.commonprefix([s1, s2])
- self.assert_(s1.startswith(p))
- self.assert_(s2.startswith(p))
- if s1 != s2:
- n = len(p)
- self.assertNotEqual(s1[n:n+1], s2[n:n+1])
-
- def test_getsize(self):
- f = open(test_support.TESTFN, "wb")
- try:
- f.write("foo")
- f.close()
- self.assertEqual(posixpath.getsize(test_support.TESTFN), 3)
- finally:
- if not f.closed:
- f.close()
-
- def test_time(self):
- f = open(test_support.TESTFN, "wb")
- try:
- f.write("foo")
- f.close()
- f = open(test_support.TESTFN, "ab")
- f.write("bar")
- f.close()
- f = open(test_support.TESTFN, "rb")
- d = f.read()
- f.close()
- self.assertEqual(d, "foobar")
-
- self.assert_(
- posixpath.getctime(test_support.TESTFN) <=
- posixpath.getmtime(test_support.TESTFN)
- )
- finally:
- if not f.closed:
- f.close()
-
def test_islink(self):
self.assertIs(posixpath.islink(test_support.TESTFN + "1"), False)
f = open(test_support.TESTFN + "1", "wb")
@@ -184,56 +98,6 @@ class PosixPathTest(unittest.TestCase):
if not f.close():
f.close()
- self.assertRaises(TypeError, posixpath.islink)
-
- def test_exists(self):
- self.assertIs(posixpath.exists(test_support.TESTFN), False)
- f = open(test_support.TESTFN, "wb")
- try:
- f.write("foo")
- f.close()
- self.assertIs(posixpath.exists(test_support.TESTFN), True)
- self.assertIs(posixpath.lexists(test_support.TESTFN), True)
- finally:
- if not f.close():
- f.close()
-
- self.assertRaises(TypeError, posixpath.exists)
-
- def test_isdir(self):
- self.assertIs(posixpath.isdir(test_support.TESTFN), False)
- f = open(test_support.TESTFN, "wb")
- try:
- f.write("foo")
- f.close()
- self.assertIs(posixpath.isdir(test_support.TESTFN), False)
- os.remove(test_support.TESTFN)
- os.mkdir(test_support.TESTFN)
- self.assertIs(posixpath.isdir(test_support.TESTFN), True)
- os.rmdir(test_support.TESTFN)
- finally:
- if not f.close():
- f.close()
-
- self.assertRaises(TypeError, posixpath.isdir)
-
- def test_isfile(self):
- self.assertIs(posixpath.isfile(test_support.TESTFN), False)
- f = open(test_support.TESTFN, "wb")
- try:
- f.write("foo")
- f.close()
- self.assertIs(posixpath.isfile(test_support.TESTFN), True)
- os.remove(test_support.TESTFN)
- os.mkdir(test_support.TESTFN)
- self.assertIs(posixpath.isfile(test_support.TESTFN), False)
- os.rmdir(test_support.TESTFN)
- finally:
- if not f.close():
- f.close()
-
- self.assertRaises(TypeError, posixpath.isdir)
-
def test_samefile(self):
f = open(test_support.TESTFN + "1", "wb")
try:
@@ -275,8 +139,6 @@ class PosixPathTest(unittest.TestCase):
if not f.close():
f.close()
- self.assertRaises(TypeError, posixpath.samefile)
-
def test_samestat(self):
f = open(test_support.TESTFN + "1", "wb")
try:
@@ -316,13 +178,9 @@ class PosixPathTest(unittest.TestCase):
if not f.close():
f.close()
- self.assertRaises(TypeError, posixpath.samestat)
-
def test_ismount(self):
self.assertIs(posixpath.ismount("/"), True)
- self.assertRaises(TypeError, posixpath.ismount)
-
def test_expanduser(self):
self.assertEqual(posixpath.expanduser("foo"), "foo")
try:
@@ -330,47 +188,20 @@ class PosixPathTest(unittest.TestCase):
except ImportError:
pass
else:
- self.assert_(isinstance(posixpath.expanduser("~/"), basestring))
+ self.assertIsInstance(posixpath.expanduser("~/"), basestring)
# if home directory == root directory, this test makes no sense
if posixpath.expanduser("~") != '/':
self.assertEqual(
posixpath.expanduser("~") + "/",
posixpath.expanduser("~/")
)
- self.assert_(isinstance(posixpath.expanduser("~root/"), basestring))
- self.assert_(isinstance(posixpath.expanduser("~foo/"), basestring))
+ self.assertIsInstance(posixpath.expanduser("~root/"), basestring)
+ self.assertIsInstance(posixpath.expanduser("~foo/"), basestring)
with test_support.EnvironmentVarGuard() as env:
- env.set('HOME', '/')
+ env['HOME'] = '/'
self.assertEqual(posixpath.expanduser("~"), "/")
- self.assertRaises(TypeError, posixpath.expanduser)
-
- def test_expandvars(self):
- oldenv = os.environ.copy()
- try:
- os.environ.clear()
- os.environ["foo"] = "bar"
- os.environ["{foo"] = "baz1"
- os.environ["{foo}"] = "baz2"
- self.assertEqual(posixpath.expandvars("foo"), "foo")
- self.assertEqual(posixpath.expandvars("$foo bar"), "bar bar")
- self.assertEqual(posixpath.expandvars("${foo}bar"), "barbar")
- self.assertEqual(posixpath.expandvars("$[foo]bar"), "$[foo]bar")
- self.assertEqual(posixpath.expandvars("$bar bar"), "$bar bar")
- self.assertEqual(posixpath.expandvars("$?bar"), "$?bar")
- self.assertEqual(posixpath.expandvars("${foo}bar"), "barbar")
- self.assertEqual(posixpath.expandvars("$foo}bar"), "bar}bar")
- self.assertEqual(posixpath.expandvars("${foo"), "${foo")
- self.assertEqual(posixpath.expandvars("${{foo}}"), "baz1}")
- self.assertEqual(posixpath.expandvars("$foo$foo"), "barbar")
- self.assertEqual(posixpath.expandvars("$bar$bar"), "$bar$bar")
- finally:
- os.environ.clear()
- os.environ.update(oldenv)
-
- self.assertRaises(TypeError, posixpath.expandvars)
-
def test_normpath(self):
self.assertEqual(posixpath.normpath(""), ".")
self.assertEqual(posixpath.normpath("/"), "/")
@@ -380,43 +211,6 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.normpath("///foo/.//bar//.//..//.//baz"), "/foo/baz")
self.assertEqual(posixpath.normpath("///..//./foo/.//bar"), "/foo/bar")
- # Issue 5827: Make sure normpath preserves unicode
- for path in (u'', u'.', u'/', u'\\', u'///foo/.//bar//'):
- self.assertTrue(isinstance(posixpath.normpath(path), unicode),
- 'normpath() returned str instead of unicode')
-
- self.assertRaises(TypeError, posixpath.normpath)
-
- def test_abspath(self):
- self.assert_("foo" in posixpath.abspath("foo"))
-
- # Issue 3426: check that abspath retuns unicode when the arg is unicode
- # and str when it's str, with both ASCII and non-ASCII cwds
- saved_cwd = os.getcwd()
- cwds = ['cwd']
- try:
- cwds.append(u'\xe7w\xf0'.encode(sys.getfilesystemencoding()
- or 'ascii'))
- except UnicodeEncodeError:
- pass # the cwd can't be encoded -- test with ascii cwd only
- for cwd in cwds:
- try:
- os.mkdir(cwd)
- os.chdir(cwd)
- for path in ('', 'foo', 'f\xf2\xf2', '/foo', 'C:\\'):
- self.assertTrue(isinstance(posixpath.abspath(path), str))
- for upath in (u'', u'fuu', u'f\xf9\xf9', u'/fuu', u'U:\\'):
- self.assertTrue(isinstance(posixpath.abspath(upath), unicode))
- finally:
- os.chdir(saved_cwd)
- os.rmdir(cwd)
-
- self.assertRaises(TypeError, posixpath.abspath)
-
- def test_realpath(self):
- self.assert_("foo" in realpath("foo"))
- self.assertRaises(TypeError, posixpath.realpath)
-
if hasattr(os, "symlink"):
def test_realpath_basic(self):
# Basic operation.
@@ -486,7 +280,8 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(realpath(ABSTFN + "/link-y/.."), ABSTFN + "/k")
# Relative path.
os.chdir(dirname(ABSTFN))
- self.assertEqual(realpath(basename(ABSTFN) + "/link-y/.."), ABSTFN + "/k")
+ self.assertEqual(realpath(basename(ABSTFN) + "/link-y/.."),
+ ABSTFN + "/k")
finally:
os.chdir(old_path)
test_support.unlink(ABSTFN + "/link-y")
@@ -527,11 +322,27 @@ class PosixPathTest(unittest.TestCase):
self.assertEqual(posixpath.relpath("a/b", "../c"), "../"+curdir+"/a/b")
self.assertEqual(posixpath.relpath("a", "b/c"), "../../a")
self.assertEqual(posixpath.relpath("a", "a"), ".")
+ self.assertEqual(posixpath.relpath("/foo/bar/bat", "/x/y/z"), '../../../foo/bar/bat')
+ self.assertEqual(posixpath.relpath("/foo/bar/bat", "/foo/bar"), 'bat')
+ self.assertEqual(posixpath.relpath("/foo/bar/bat", "/"), 'foo/bar/bat')
+ self.assertEqual(posixpath.relpath("/", "/foo/bar/bat"), '../../..')
+ self.assertEqual(posixpath.relpath("/foo/bar/bat", "/x"), '../foo/bar/bat')
+ self.assertEqual(posixpath.relpath("/x", "/foo/bar/bat"), '../../../x')
+ self.assertEqual(posixpath.relpath("/", "/"), '.')
+ self.assertEqual(posixpath.relpath("/a", "/a"), '.')
+ self.assertEqual(posixpath.relpath("/a/b", "/a/b"), '.')
finally:
os.getcwd = real_getcwd
+
+class PosixCommonTest(test_genericpath.CommonTest):
+ pathmodule = posixpath
+ attributes = ['relpath', 'samefile', 'sameopenfile', 'samestat']
+
+
def test_main():
- test_support.run_unittest(PosixPathTest)
+ test_support.run_unittest(PosixPathTest, PosixCommonTest)
+
if __name__=="__main__":
test_main()
diff --git a/Lib/test/test_pow.py b/Lib/test/test_pow.py
index 361a475ca4..1ee67bc452 100644
--- a/Lib/test/test_pow.py
+++ b/Lib/test/test_pow.py
@@ -5,17 +5,17 @@ class PowTest(unittest.TestCase):
def powtest(self, type):
if type != float:
for i in range(-1000, 1000):
- self.assertEquals(pow(type(i), 0), 1)
- self.assertEquals(pow(type(i), 1), type(i))
- self.assertEquals(pow(type(0), 1), type(0))
- self.assertEquals(pow(type(1), 1), type(1))
+ self.assertEqual(pow(type(i), 0), 1)
+ self.assertEqual(pow(type(i), 1), type(i))
+ self.assertEqual(pow(type(0), 1), type(0))
+ self.assertEqual(pow(type(1), 1), type(1))
for i in range(-100, 100):
- self.assertEquals(pow(type(i), 3), i*i*i)
+ self.assertEqual(pow(type(i), 3), i*i*i)
pow2 = 1
for i in range(0,31):
- self.assertEquals(pow(2, i), pow2)
+ self.assertEqual(pow(2, i), pow2)
if i != 30 : pow2 = pow2*2
for othertype in int, long:
@@ -67,30 +67,30 @@ class PowTest(unittest.TestCase):
def test_other(self):
# Other tests-- not very systematic
- self.assertEquals(pow(3,3) % 8, pow(3,3,8))
- self.assertEquals(pow(3,3) % -8, pow(3,3,-8))
- self.assertEquals(pow(3,2) % -2, pow(3,2,-2))
- self.assertEquals(pow(-3,3) % 8, pow(-3,3,8))
- self.assertEquals(pow(-3,3) % -8, pow(-3,3,-8))
- self.assertEquals(pow(5,2) % -8, pow(5,2,-8))
-
- self.assertEquals(pow(3L,3L) % 8, pow(3L,3L,8))
- self.assertEquals(pow(3L,3L) % -8, pow(3L,3L,-8))
- self.assertEquals(pow(3L,2) % -2, pow(3L,2,-2))
- self.assertEquals(pow(-3L,3L) % 8, pow(-3L,3L,8))
- self.assertEquals(pow(-3L,3L) % -8, pow(-3L,3L,-8))
- self.assertEquals(pow(5L,2) % -8, pow(5L,2,-8))
+ self.assertEqual(pow(3,3) % 8, pow(3,3,8))
+ self.assertEqual(pow(3,3) % -8, pow(3,3,-8))
+ self.assertEqual(pow(3,2) % -2, pow(3,2,-2))
+ self.assertEqual(pow(-3,3) % 8, pow(-3,3,8))
+ self.assertEqual(pow(-3,3) % -8, pow(-3,3,-8))
+ self.assertEqual(pow(5,2) % -8, pow(5,2,-8))
+
+ self.assertEqual(pow(3L,3L) % 8, pow(3L,3L,8))
+ self.assertEqual(pow(3L,3L) % -8, pow(3L,3L,-8))
+ self.assertEqual(pow(3L,2) % -2, pow(3L,2,-2))
+ self.assertEqual(pow(-3L,3L) % 8, pow(-3L,3L,8))
+ self.assertEqual(pow(-3L,3L) % -8, pow(-3L,3L,-8))
+ self.assertEqual(pow(5L,2) % -8, pow(5L,2,-8))
for i in range(-10, 11):
for j in range(0, 6):
for k in range(-7, 11):
if j >= 0 and k != 0:
- self.assertEquals(
+ self.assertEqual(
pow(i,j) % k,
pow(i,j,k)
)
if j >= 0 and k != 0:
- self.assertEquals(
+ self.assertEqual(
pow(long(i),j) % k,
pow(long(i),j,k)
)
@@ -104,7 +104,7 @@ class PowTest(unittest.TestCase):
def test_bug705231(self):
# -1.0 raised to an integer should never blow up. It did if the
# platform pow() was buggy, and Python didn't worm around it.
- eq = self.assertEquals
+ eq = self.assertEqual
a = -1.0
# The next two tests can still fail if the platform floor()
# function doesn't treat all large inputs as integers
diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py
index f6dcc8c149..e0137dfc59 100644
--- a/Lib/test/test_pprint.py
+++ b/Lib/test/test_pprint.py
@@ -117,10 +117,10 @@ class QueryTestCase(unittest.TestCase):
{}, dict2(), dict3(),
self.assertTrue, pprint,
-6, -6L, -6-6j, -1.5, "x", uni("x"), (3,), [3], {3: 6},
- (1,2), [3,4], {5: 6, 7: 8},
+ (1,2), [3,4], {5: 6},
tuple2((1,2)), tuple3((1,2)), tuple3(range(100)),
[3,4], list2([3,4]), list3([3,4]), list3(range(100)),
- {5: 6, 7: 8}, dict2({5: 6}), dict3({5: 6}),
+ dict2({5: 6}), dict3({5: 6}),
range(10, -11, -1)
):
native = repr(simple)
diff --git a/Lib/test/test_print.py b/Lib/test/test_print.py
index 394a2f19b6..b7263470e2 100644
--- a/Lib/test/test_print.py
+++ b/Lib/test/test_print.py
@@ -8,7 +8,6 @@ from __future__ import print_function
import unittest
from test import test_support
-import sys
from StringIO import StringIO
NotDefined = object()
@@ -16,7 +15,7 @@ NotDefined = object()
# A dispatch table all 8 combinations of providing
# sep, end, and file
# I use this machinery so that I'm not just passing default
-# values to print, I'm eiher passing or not passing in the
+# values to print, I'm either passing or not passing in the
# arguments
dispatch = {
(False, False, False):
@@ -128,11 +127,11 @@ class TestPrint(unittest.TestCase):
self.assertEqual(u''.join(buf.buf), 'hi nothing\n')
buf = Recorder(False)
print('hi', 'bye', end=u'\n', file=buf)
- self.assertTrue(isinstance(buf.buf[1], unicode))
- self.assertTrue(isinstance(buf.buf[3], unicode))
+ self.assertIsInstance(buf.buf[1], unicode)
+ self.assertIsInstance(buf.buf[3], unicode)
del buf.buf[:]
print(sep=u'x', file=buf)
- self.assertTrue(isinstance(buf.buf[-1], unicode))
+ self.assertIsInstance(buf.buf[-1], unicode)
def test_main():
diff --git a/Lib/test/test_profile.py b/Lib/test/test_profile.py
index 0016d517f7..aa93d399e8 100755..100644
--- a/Lib/test/test_profile.py
+++ b/Lib/test/test_profile.py
@@ -1,6 +1,5 @@
"""Test suite for the profile module."""
-import os
import sys
import pstats
import unittest
@@ -57,7 +56,7 @@ class ProfileTest(unittest.TestCase):
stats = pstats.Stats(prof, stream=s)
stats.print_stats()
res = s.getvalue()
- self.assertTrue(self.expected_list_sort_output in res,
+ self.assertIn(self.expected_list_sort_output, res,
"Profiling {0!r} didn't report list.sort:\n{1}".format(stmt, res))
@@ -94,7 +93,7 @@ def main():
# Don't remove this comment. Everything below it is auto-generated.
#--cut--------------------------------------------------------------------------
ProfileTest.expected_output['print_stats'] = """\
- 127 function calls (107 primitive calls) in 999.749 CPU seconds
+ 127 function calls (107 primitive calls) in 999.749 seconds
Ordered by: standard name
diff --git a/Lib/test/test_property.py b/Lib/test/test_property.py
index 7a8003f62d..e5fc1745a0 100644
--- a/Lib/test/test_property.py
+++ b/Lib/test/test_property.py
@@ -1,6 +1,7 @@
# Test case for property
# more tests are in test_descr
+import sys
import unittest
from test.test_support import run_unittest
@@ -86,12 +87,11 @@ class PropertyTests(unittest.TestCase):
self.assertEqual(base.spam, 10)
self.assertEqual(base._spam, 10)
delattr(base, "spam")
- self.assert_(not hasattr(base, "spam"))
- self.assert_(not hasattr(base, "_spam"))
+ self.assertTrue(not hasattr(base, "spam"))
+ self.assertTrue(not hasattr(base, "_spam"))
base.spam = 20
self.assertEqual(base.spam, 20)
self.assertEqual(base._spam, 20)
- self.assertEqual(base.__class__.spam.__doc__, "BaseClass.getter")
def test_property_decorator_subclass(self):
# see #1620
@@ -99,14 +99,27 @@ class PropertyTests(unittest.TestCase):
self.assertRaises(PropertyGet, getattr, sub, "spam")
self.assertRaises(PropertySet, setattr, sub, "spam", None)
self.assertRaises(PropertyDel, delattr, sub, "spam")
+
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_property_decorator_subclass_doc(self):
+ sub = SubClass()
self.assertEqual(sub.__class__.spam.__doc__, "SubClass.getter")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_property_decorator_baseclass_doc(self):
+ base = BaseClass()
+ self.assertEqual(base.__class__.spam.__doc__, "BaseClass.getter")
+
def test_property_decorator_doc(self):
base = PropertyDocBase()
sub = PropertyDocSub()
self.assertEqual(base.__class__.spam.__doc__, "spam spam spam")
self.assertEqual(sub.__class__.spam.__doc__, "spam spam spam")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_property_getter_doc_override(self):
newgettersub = PropertySubNewGetter()
self.assertEqual(newgettersub.spam, 5)
@@ -126,16 +139,6 @@ class PropertySubSlots(property):
class PropertySubclassTests(unittest.TestCase):
- def test_docstring_copy(self):
- class Foo(object):
- @PropertySub
- def spam(self):
- """spam wrapped in property subclass"""
- return 1
- self.assertEqual(
- Foo.spam.__doc__,
- "spam wrapped in property subclass")
-
def test_slots_docstring_copy_exception(self):
try:
class Foo(object):
@@ -148,6 +151,20 @@ class PropertySubclassTests(unittest.TestCase):
else:
raise Exception("AttributeError not raised")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
+ def test_docstring_copy(self):
+ class Foo(object):
+ @PropertySub
+ def spam(self):
+ """spam wrapped in property subclass"""
+ return 1
+ self.assertEqual(
+ Foo.spam.__doc__,
+ "spam wrapped in property subclass")
+
+ @unittest.skipIf(sys.flags.optimize <= 2,
+ "Docstrings are omitted with -O2 and above")
def test_property_setter_copies_getter_docstring(self):
class Foo(object):
def __init__(self): self._spam = 1
@@ -179,6 +196,8 @@ class PropertySubclassTests(unittest.TestCase):
FooSub.spam.__doc__,
"spam wrapped in property subclass")
+ @unittest.skipIf(sys.flags.optimize <= 2,
+ "Docstrings are omitted with -O2 and above")
def test_property_new_getter_new_docstring(self):
class Foo(object):
diff --git a/Lib/test/test_pty.py b/Lib/test/test_pty.py
index c00244f10d..05ab598d98 100644
--- a/Lib/test/test_pty.py
+++ b/Lib/test/test_pty.py
@@ -1,10 +1,14 @@
+from test.test_support import verbose, run_unittest, import_module
+
+#Skip these tests if either fcntl or termios is not available
+fcntl = import_module('fcntl')
+import_module('termios')
+
import errno
-import fcntl
import pty
import os
import sys
import signal
-from test.test_support import verbose, TestSkipped, run_unittest
import unittest
TEST_STRING_1 = "I wish to buy a fish license.\n"
@@ -69,7 +73,7 @@ class PtyTest(unittest.TestCase):
debug("Got slave_fd '%d'" % slave_fd)
except OSError:
# " An optional feature could not be imported " ... ?
- raise TestSkipped, "Pseudo-terminals (seemingly) not functional."
+ raise unittest.SkipTest, "Pseudo-terminals (seemingly) not functional."
self.assertTrue(os.isatty(slave_fd), 'slave_fd is not a tty')
@@ -82,7 +86,7 @@ class PtyTest(unittest.TestCase):
fcntl.fcntl(master_fd, fcntl.F_SETFL, orig_flags | os.O_NONBLOCK)
try:
s1 = os.read(master_fd, 1024)
- self.assertEquals('', s1)
+ self.assertEqual('', s1)
except OSError, e:
if e.errno != errno.EAGAIN:
raise
@@ -92,14 +96,14 @@ class PtyTest(unittest.TestCase):
debug("Writing to slave_fd")
os.write(slave_fd, TEST_STRING_1)
s1 = os.read(master_fd, 1024)
- self.assertEquals('I wish to buy a fish license.\n',
- normalize_output(s1))
+ self.assertEqual('I wish to buy a fish license.\n',
+ normalize_output(s1))
debug("Writing chunked output")
os.write(slave_fd, TEST_STRING_2[:5])
os.write(slave_fd, TEST_STRING_2[5:])
s2 = os.read(master_fd, 1024)
- self.assertEquals('For my pet fish, Eric.\n', normalize_output(s2))
+ self.assertEqual('For my pet fish, Eric.\n', normalize_output(s2))
os.close(slave_fd)
os.close(master_fd)
diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py
index 255a34c6d4..67e11b6859 100644
--- a/Lib/test/test_pwd.py
+++ b/Lib/test/test_pwd.py
@@ -1,7 +1,8 @@
+import sys
import unittest
from test import test_support
-import pwd
+pwd = test_support.import_module('pwd')
class PwdTest(unittest.TestCase):
@@ -13,19 +14,19 @@ class PwdTest(unittest.TestCase):
for e in entries:
self.assertEqual(len(e), 7)
self.assertEqual(e[0], e.pw_name)
- self.assert_(isinstance(e.pw_name, basestring))
+ self.assertIsInstance(e.pw_name, basestring)
self.assertEqual(e[1], e.pw_passwd)
- self.assert_(isinstance(e.pw_passwd, basestring))
+ self.assertIsInstance(e.pw_passwd, basestring)
self.assertEqual(e[2], e.pw_uid)
- self.assert_(isinstance(e.pw_uid, int))
+ self.assertIsInstance(e.pw_uid, int)
self.assertEqual(e[3], e.pw_gid)
- self.assert_(isinstance(e.pw_gid, int))
+ self.assertIsInstance(e.pw_gid, int)
self.assertEqual(e[4], e.pw_gecos)
- self.assert_(isinstance(e.pw_gecos, basestring))
+ self.assertIsInstance(e.pw_gecos, basestring)
self.assertEqual(e[5], e.pw_dir)
- self.assert_(isinstance(e.pw_dir, basestring))
+ self.assertIsInstance(e.pw_dir, basestring)
self.assertEqual(e[6], e.pw_shell)
- self.assert_(isinstance(e.pw_shell, basestring))
+ self.assertIsInstance(e.pw_shell, basestring)
# The following won't work, because of duplicate entries
# for one uid
@@ -43,8 +44,8 @@ class PwdTest(unittest.TestCase):
for e in entries:
if not e[0] or e[0] == '+':
continue # skip NIS entries etc.
- self.assert_(pwd.getpwnam(e.pw_name) in entriesbyname[e.pw_name])
- self.assert_(pwd.getpwuid(e.pw_uid) in entriesbyuid[e.pw_uid])
+ self.assertIn(pwd.getpwnam(e.pw_name), entriesbyname[e.pw_name])
+ self.assertIn(pwd.getpwuid(e.pw_uid), entriesbyuid[e.pw_uid])
def test_errors(self):
self.assertRaises(TypeError, pwd.getpwuid)
@@ -83,11 +84,13 @@ class PwdTest(unittest.TestCase):
self.assertRaises(KeyError, pwd.getpwnam, fakename)
- # Choose a non-existent uid.
- fakeuid = 4127
- while fakeuid in byuids:
- fakeuid = (fakeuid * 3) % 0x10000
-
+ # In some cases, byuids isn't a complete list of all users in the
+ # system, so if we try to pick a value not in byuids (via a perturbing
+ # loop, say), pwd.getpwuid() might still be able to find data for that
+ # uid. Using sys.maxint may provoke the same problems, but hopefully
+ # it will be a more repeatable failure.
+ fakeuid = sys.maxint
+ self.assertNotIn(fakeuid, byuids)
self.assertRaises(KeyError, pwd.getpwuid, fakeuid)
def test_main():
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index 3a12251c60..2afd8a1593 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -1,13 +1,10 @@
import unittest
import sys
-from test.test_support import (check_warnings, CleanImport,
- TestSkipped, run_unittest)
+from test.test_support import check_py3k_warnings, CleanImport, run_unittest
import warnings
-from contextlib import nested
-
if not sys.py3kwarning:
- raise TestSkipped('%s must be run with the -3 flag' % __name__)
+ raise unittest.SkipTest('%s must be run with the -3 flag' % __name__)
try:
from test.test_support import __warningregistry__ as _registry
@@ -44,88 +41,68 @@ class TestPy3KWarnings(unittest.TestCase):
def test_backquote(self):
expected = 'backquote not supported in 3.x; use repr()'
- with check_warnings() as w:
+ with check_py3k_warnings((expected, SyntaxWarning)):
exec "`2`" in {}
- self.assertWarning(None, w, expected)
def test_paren_arg_names(self):
expected = 'parenthesized argument names are invalid in 3.x'
def check(s):
- exec s in {}
- self.assertWarning(None, w, expected)
- with check_warnings() as w:
- check("def f((x)): pass")
- check("def f((((x))), (y)): pass")
- check("def f((x), (((y))), m=32): pass")
- # Something like def f((a, (b))): pass will raise the tuple
- # unpacking warning.
-
- def test_bool_assign(self):
+ with check_py3k_warnings((expected, SyntaxWarning)):
+ exec s in {}
+ check("def f((x)): pass")
+ check("def f((((x))), (y)): pass")
+ check("def f((x), (((y))), m=32): pass")
+ # Something like def f((a, (b))): pass will raise the tuple
+ # unpacking warning.
+
+ def test_forbidden_names(self):
# So we don't screw up our globals
def safe_exec(expr):
def f(**kwargs): pass
exec expr in {'f' : f}
- expected = "assignment to True or False is forbidden in 3.x"
- with check_warnings() as w:
- safe_exec("True = False")
- self.assertWarning(None, w, expected)
- w.reset()
- safe_exec("False = True")
- self.assertWarning(None, w, expected)
- w.reset()
- try:
- safe_exec("obj.False = True")
- except NameError: pass
- self.assertWarning(None, w, expected)
- w.reset()
- try:
- safe_exec("obj.True = False")
- except NameError: pass
- self.assertWarning(None, w, expected)
- w.reset()
- safe_exec("def False(): pass")
- self.assertWarning(None, w, expected)
- w.reset()
- safe_exec("def True(): pass")
- self.assertWarning(None, w, expected)
- w.reset()
- safe_exec("class False: pass")
- self.assertWarning(None, w, expected)
- w.reset()
- safe_exec("class True: pass")
- self.assertWarning(None, w, expected)
- w.reset()
- safe_exec("def f(True=43): pass")
- self.assertWarning(None, w, expected)
- w.reset()
- safe_exec("def f(False=None): pass")
- self.assertWarning(None, w, expected)
- w.reset()
- safe_exec("f(False=True)")
- self.assertWarning(None, w, expected)
- w.reset()
- safe_exec("f(True=1)")
- self.assertWarning(None, w, expected)
+ tests = [("True", "assignment to True or False is forbidden in 3.x"),
+ ("False", "assignment to True or False is forbidden in 3.x"),
+ ("nonlocal", "nonlocal is a keyword in 3.x")]
+ with check_py3k_warnings(('', SyntaxWarning)) as w:
+ for keyword, expected in tests:
+ safe_exec("{0} = False".format(keyword))
+ self.assertWarning(None, w, expected)
+ w.reset()
+ try:
+ safe_exec("obj.{0} = True".format(keyword))
+ except NameError:
+ pass
+ self.assertWarning(None, w, expected)
+ w.reset()
+ safe_exec("def {0}(): pass".format(keyword))
+ self.assertWarning(None, w, expected)
+ w.reset()
+ safe_exec("class {0}: pass".format(keyword))
+ self.assertWarning(None, w, expected)
+ w.reset()
+ safe_exec("def f({0}=43): pass".format(keyword))
+ self.assertWarning(None, w, expected)
+ w.reset()
def test_type_inequality_comparisons(self):
expected = 'type inequality comparisons not supported in 3.x'
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(int < str, w, expected)
w.reset()
self.assertWarning(type < object, w, expected)
def test_object_inequality_comparisons(self):
expected = 'comparing unequal types not supported in 3.x'
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(str < [], w, expected)
w.reset()
self.assertWarning(object() < (1, 2), w, expected)
def test_dict_inequality_comparisons(self):
expected = 'dict inequality comparisons not supported in 3.x'
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning({} < {2:3}, w, expected)
w.reset()
self.assertWarning({} <= {}, w, expected)
@@ -142,7 +119,7 @@ class TestPy3KWarnings(unittest.TestCase):
return g
cell0, = f(0).func_closure
cell1, = f(1).func_closure
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(cell0 == cell1, w, expected)
w.reset()
self.assertWarning(cell0 < cell1, w, expected)
@@ -153,7 +130,7 @@ class TestPy3KWarnings(unittest.TestCase):
pass
def g(x):
pass
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(f.func_code < g.func_code, w, expected)
w.reset()
self.assertWarning(f.func_code <= g.func_code, w, expected)
@@ -167,7 +144,7 @@ class TestPy3KWarnings(unittest.TestCase):
'order comparisons not supported in 3.x')
func = eval
meth = {}.get
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(func < meth, w, expected)
w.reset()
self.assertWarning(func > meth, w, expected)
@@ -182,12 +159,22 @@ class TestPy3KWarnings(unittest.TestCase):
self.assertNoWarning(lam == func, w)
self.assertNoWarning(lam != func, w)
+ def test_frame_attributes(self):
+ template = "%s has been removed in 3.x"
+ f = sys._getframe(0)
+ for attr in ("f_exc_traceback", "f_exc_value", "f_exc_type"):
+ expected = template % attr
+ with check_py3k_warnings() as w:
+ self.assertWarning(getattr(f, attr), w, expected)
+ w.reset()
+ self.assertWarning(setattr(f, attr, None), w, expected)
+
def test_sort_cmp_arg(self):
expected = "the cmp argument is not supported in 3.x"
lst = range(5)
cmp = lambda x,y: -1
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(lst.sort(cmp=cmp), w, expected)
w.reset()
self.assertWarning(sorted(lst, cmp=cmp), w, expected)
@@ -198,7 +185,7 @@ class TestPy3KWarnings(unittest.TestCase):
def test_sys_exc_clear(self):
expected = 'sys.exc_clear() not supported in 3.x; use except clauses'
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(sys.exc_clear(), w, expected)
def test_methods_members(self):
@@ -207,17 +194,17 @@ class TestPy3KWarnings(unittest.TestCase):
__methods__ = ['a']
__members__ = ['b']
c = C()
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(dir(c), w, expected)
def test_softspace(self):
expected = 'file.softspace not supported in 3.x'
with file(__file__) as f:
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(f.softspace, w, expected)
def set():
f.softspace = 0
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(set(), w, expected)
def test_slice_methods(self):
@@ -233,7 +220,7 @@ class TestPy3KWarnings(unittest.TestCase):
expected = "in 3.x, __{0}slice__ has been removed; use __{0}item__"
for obj in (Spam(), Egg()):
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(obj[1:2], w, expected.format('get'))
w.reset()
del obj[3:4]
@@ -244,24 +231,23 @@ class TestPy3KWarnings(unittest.TestCase):
def test_tuple_parameter_unpacking(self):
expected = "tuple parameter unpacking has been removed in 3.x"
- with check_warnings() as w:
+ with check_py3k_warnings((expected, SyntaxWarning)):
exec "def f((a, b)): pass"
- self.assertWarning(None, w, expected)
def test_buffer(self):
expected = 'buffer() not supported in 3.x'
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(buffer('a'), w, expected)
def test_file_xreadlines(self):
expected = ("f.xreadlines() not supported in 3.x, "
"try 'for line in f' instead")
with file(__file__) as f:
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
self.assertWarning(f.xreadlines(), w, expected)
def test_hash_inheritance(self):
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
# With object as the base class
class WarnOnlyCmp(object):
def __cmp__(self, other): pass
@@ -309,6 +295,18 @@ class TestPy3KWarnings(unittest.TestCase):
def __hash__(self): pass
self.assertEqual(len(w.warnings), 0)
+ def test_operator(self):
+ from operator import isCallable, sequenceIncludes
+
+ callable_warn = ("operator.isCallable() is not supported in 3.x. "
+ "Use hasattr(obj, '__call__').")
+ seq_warn = ("operator.sequenceIncludes() is not supported "
+ "in 3.x. Use operator.contains().")
+ with check_py3k_warnings() as w:
+ self.assertWarning(isCallable(self), w, callable_warn)
+ w.reset()
+ self.assertWarning(sequenceIncludes(range(3), 2), w, seq_warn)
+
class TestStdlibRemovals(unittest.TestCase):
@@ -325,7 +323,13 @@ class TestStdlibRemovals(unittest.TestCase):
'IOCTL', 'jpeg', 'panel', 'panelparser',
'readcd', 'SV', 'torgb', 'WAIT'),
'darwin' : ('autoGIL', 'Carbon', 'OSATerminology',
- 'icglue', 'Nav', 'MacOS', 'aepack',
+ 'icglue', 'Nav',
+ # MacOS should (and does) give a Py3kWarning, but one of the
+ # earlier tests already imports the MacOS extension which causes
+ # this test to fail. Disabling the test for 'MacOS' avoids this
+ # spurious test failure.
+ #'MacOS',
+ 'aepack',
'aetools', 'aetypes', 'applesingle',
'appletrawmain', 'appletrunner',
'argvemulator', 'bgenlocations',
@@ -347,7 +351,7 @@ class TestStdlibRemovals(unittest.TestCase):
def check_removal(self, module_name, optional=False):
"""Make sure the specified module, when imported, raises a
DeprecationWarning and specifies itself in the message."""
- with nested(CleanImport(module_name), warnings.catch_warnings()):
+ with CleanImport(module_name), warnings.catch_warnings():
warnings.filterwarnings("error", ".+ (module|package) .+ removed",
DeprecationWarning, __name__)
warnings.filterwarnings("error", ".+ removed .+ (module|package)",
@@ -355,9 +359,9 @@ class TestStdlibRemovals(unittest.TestCase):
try:
__import__(module_name, level=0)
except DeprecationWarning as exc:
- self.assert_(module_name in exc.args[0],
- "%s warning didn't contain module name"
- % module_name)
+ self.assertIn(module_name, exc.args[0],
+ "%s warning didn't contain module name"
+ % module_name)
except ImportError:
if not optional:
self.fail("Non-optional module {0} raised an "
@@ -367,7 +371,7 @@ class TestStdlibRemovals(unittest.TestCase):
# They won't rerun their init code even with CleanImport.
if not check_deprecated_module(module_name):
self.fail("DeprecationWarning not raised for {0}"
- .format(module_name))
+ .format(module_name))
def test_platform_independent_removals(self):
# Make sure that the modules that are available on all platforms raise
@@ -391,25 +395,14 @@ class TestStdlibRemovals(unittest.TestCase):
for path_mod in ("ntpath", "macpath", "os2emxpath", "posixpath"):
mod = __import__(path_mod)
reset_module_registry(mod)
- with check_warnings() as w:
+ with check_py3k_warnings() as w:
mod.walk("crashers", dumbo, None)
- self.assertEquals(str(w.message), msg)
-
- def test_commands_members(self):
- import commands
- # commands module tests may have already triggered this warning
- reset_module_registry(commands)
- members = {"mk2arg" : 2, "mkarg" : 1, "getstatus" : 1}
- for name, arg_count in members.items():
- with warnings.catch_warnings():
- warnings.filterwarnings("error")
- func = getattr(commands, name)
- self.assertRaises(DeprecationWarning, func, *([None]*arg_count))
+ self.assertEqual(str(w.message), msg)
def test_reduce_move(self):
from operator import add
# reduce tests may have already triggered this warning
- reset_module_registry(unittest)
+ reset_module_registry(unittest.case)
with warnings.catch_warnings():
warnings.filterwarnings("error", "reduce")
self.assertRaises(DeprecationWarning, reduce, add, range(10))
diff --git a/Lib/test/test_pyclbr.py b/Lib/test/test_pyclbr.py
index 6a971379cb..6aa96d53ea 100644
--- a/Lib/test/test_pyclbr.py
+++ b/Lib/test/test_pyclbr.py
@@ -37,7 +37,7 @@ class PyclbrTest(TestCase):
''' succeed iff hasattr(obj,attr) or attr in ignore. '''
if attr in ignore: return
if not hasattr(obj, attr): print "???", attr
- self.failUnless(hasattr(obj, attr),
+ self.assertTrue(hasattr(obj, attr),
'expected hasattr(%r, %r)' % (obj, attr))
@@ -46,7 +46,7 @@ class PyclbrTest(TestCase):
if key in ignore: return
if key not in obj:
print >>sys.stderr, "***", key
- self.assertTrue(key in obj)
+ self.assertIn(key, obj)
def assertEqualsOrIgnored(self, a, b, ignore):
''' succeed iff a == b or a in ignore or b in ignore '''
@@ -94,12 +94,12 @@ class PyclbrTest(TestCase):
self.assertHasattr(module, name, ignore)
py_item = getattr(module, name)
if isinstance(value, pyclbr.Function):
- self.assert_(isinstance(py_item, (FunctionType, BuiltinFunctionType)))
+ self.assertIsInstance(py_item, (FunctionType, BuiltinFunctionType))
if py_item.__module__ != moduleName:
continue # skip functions that came from somewhere else
- self.assertEquals(py_item.__module__, value.module)
+ self.assertEqual(py_item.__module__, value.module)
else:
- self.failUnless(isinstance(py_item, (ClassType, type)))
+ self.assertIsInstance(py_item, (ClassType, type))
if py_item.__module__ != moduleName:
continue # skip classes that came from somewhere else
@@ -126,7 +126,7 @@ class PyclbrTest(TestCase):
try:
self.assertListEq(foundMethods, actualMethods, ignore)
- self.assertEquals(py_item.__module__, value.module)
+ self.assertEqual(py_item.__module__, value.module)
self.assertEqualsOrIgnored(py_item.__name__, value.name,
ignore)
@@ -150,7 +150,7 @@ class PyclbrTest(TestCase):
def test_easy(self):
self.checkModule('pyclbr')
- self.checkModule('doctest')
+ self.checkModule('doctest', ignore=("DocTestCase",))
# Silence Py3k warning
rfc822 = import_module('rfc822', deprecated=True)
self.checkModule('rfc822', rfc822)
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index d23de74067..8591693238 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -6,11 +6,14 @@ import subprocess
import re
import pydoc
import inspect
+import keyword
import unittest
import xml.etree
import test.test_support
from contextlib import contextmanager
-from test.test_support import TESTFN, forget, rmtree, EnvironmentVarGuard
+from collections import namedtuple
+from test.test_support import (
+ TESTFN, forget, rmtree, EnvironmentVarGuard, reap_children, captured_stdout)
from test import pydoc_mod
@@ -179,8 +182,11 @@ def run_pydoc(module_name, *args):
output of pydoc.
"""
cmd = [sys.executable, pydoc.__file__, " ".join(args), module_name]
- output = subprocess.Popen(cmd, stdout=subprocess.PIPE).stdout.read()
- return output.strip()
+ try:
+ output = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
+ return output.strip()
+ finally:
+ reap_children()
def get_pydoc_html(module):
"Returns pydoc generated output as html"
@@ -216,6 +222,8 @@ def print_diffs(text1, text2):
class PyDocDocTest(unittest.TestCase):
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_html_doc(self):
result, doc_loc = get_pydoc_html(pydoc_mod)
mod_file = inspect.getabsfile(pydoc_mod)
@@ -229,6 +237,8 @@ class PyDocDocTest(unittest.TestCase):
print_diffs(expected_html, result)
self.fail("outputs are not equal, see diff above")
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_text_doc(self):
result, doc_loc = get_pydoc_text(pydoc_mod)
expected_text = expected_text_pattern % \
@@ -258,8 +268,8 @@ class PyDocDocTest(unittest.TestCase):
('i_am_not_here', 'i_am_not_here'),
('test.i_am_not_here_either', 'i_am_not_here_either'),
('test.i_am_not_here.neither_am_i', 'i_am_not_here.neither_am_i'),
- ('i_am_not_here.{0}'.format(modname), 'i_am_not_here.{0}'.format(modname)),
- ('test.{0}'.format(modname), modname),
+ ('i_am_not_here.{}'.format(modname), 'i_am_not_here.{}'.format(modname)),
+ ('test.{}'.format(modname), modname),
)
@contextmanager
@@ -270,21 +280,20 @@ class PyDocDocTest(unittest.TestCase):
sys.path.pop(0)
rmtree(dir)
- with newdirinpath(TESTFN):
- with EnvironmentVarGuard() as env:
- env.set('PYTHONPATH', TESTFN)
- fullmodname = os.path.join(TESTFN, modname)
- sourcefn = fullmodname + os.extsep + "py"
- for importstring, expectedinmsg in testpairs:
- f = open(sourcefn, 'w')
- f.write("import {0}\n".format(importstring))
- f.close()
- try:
- result = run_pydoc(modname)
- finally:
- forget(modname)
- expected = badimport_pattern % (modname, expectedinmsg)
- self.assertEqual(expected, result)
+ with newdirinpath(TESTFN), EnvironmentVarGuard() as env:
+ env['PYTHONPATH'] = TESTFN
+ fullmodname = os.path.join(TESTFN, modname)
+ sourcefn = fullmodname + os.extsep + "py"
+ for importstring, expectedinmsg in testpairs:
+ f = open(sourcefn, 'w')
+ f.write("import {}\n".format(importstring))
+ f.close()
+ try:
+ result = run_pydoc(modname)
+ finally:
+ forget(modname)
+ expected = badimport_pattern % (modname, expectedinmsg)
+ self.assertEqual(expected, result)
def test_input_strip(self):
missing_module = " test.i_am_not_here "
@@ -314,7 +323,7 @@ class TestDescriptions(unittest.TestCase):
# Check that pydocfodder module can be described
from test import pydocfodder
doc = pydoc.render_doc(pydocfodder)
- self.assert_("pydocfodder" in doc)
+ self.assertIn("pydocfodder", doc)
def test_classic_class(self):
class C: "Classic class"
@@ -322,7 +331,7 @@ class TestDescriptions(unittest.TestCase):
self.assertEqual(pydoc.describe(C), 'class C')
self.assertEqual(pydoc.describe(c), 'instance of C')
expected = 'instance of C in module %s' % __name__
- self.assert_(expected in pydoc.render_doc(c))
+ self.assertIn(expected, pydoc.render_doc(c))
def test_class(self):
class C(object): "New-style class"
@@ -331,12 +340,28 @@ class TestDescriptions(unittest.TestCase):
self.assertEqual(pydoc.describe(C), 'class C')
self.assertEqual(pydoc.describe(c), 'C')
expected = 'C in module %s object' % __name__
- self.assert_(expected in pydoc.render_doc(c))
+ self.assertIn(expected, pydoc.render_doc(c))
+
+ def test_namedtuple_public_underscore(self):
+ NT = namedtuple('NT', ['abc', 'def'], rename=True)
+ with captured_stdout() as help_io:
+ help(NT)
+ helptext = help_io.getvalue()
+ self.assertIn('_1', helptext)
+ self.assertIn('_replace', helptext)
+ self.assertIn('_asdict', helptext)
+
+
+class TestHelper(unittest.TestCase):
+ def test_keywords(self):
+ self.assertEqual(sorted(pydoc.Helper.keywords),
+ sorted(keyword.kwlist))
def test_main():
test.test_support.run_unittest(PyDocDocTest,
- TestDescriptions)
+ TestDescriptions,
+ TestHelper)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
index 0628a57c15..75b031ac17 100644
--- a/Lib/test/test_pyexpat.py
+++ b/Lib/test/test_pyexpat.py
@@ -4,9 +4,9 @@
import StringIO, sys
import unittest
-import pyexpat
from xml.parsers import expat
+from test import test_support
from test.test_support import sortdict, run_unittest
@@ -23,17 +23,17 @@ class SetAttributeTest(unittest.TestCase):
def test_returns_unicode(self):
for x, y in self.set_get_pairs:
self.parser.returns_unicode = x
- self.assertEquals(self.parser.returns_unicode, y)
+ self.assertEqual(self.parser.returns_unicode, y)
def test_ordered_attributes(self):
for x, y in self.set_get_pairs:
self.parser.ordered_attributes = x
- self.assertEquals(self.parser.ordered_attributes, y)
+ self.assertEqual(self.parser.ordered_attributes, y)
def test_specified_attributes(self):
for x, y in self.set_get_pairs:
self.parser.specified_attributes = x
- self.assertEquals(self.parser.specified_attributes, y)
+ self.assertEqual(self.parser.specified_attributes, y)
data = '''\
@@ -141,23 +141,23 @@ class ParseTest(unittest.TestCase):
# Verify output
op = out.out
- self.assertEquals(op[0], 'PI: \'xml-stylesheet\' \'href="stylesheet.css"\'')
- self.assertEquals(op[1], "Comment: ' comment data '")
- self.assertEquals(op[2], "Notation declared: ('notation', None, 'notation.jpeg', None)")
- self.assertEquals(op[3], "Unparsed entity decl: ('unparsed_entity', None, 'entity.file', None, 'notation')")
- self.assertEquals(op[4], "Start element: 'root' {'attr1': 'value1', 'attr2': 'value2\\xe1\\xbd\\x80'}")
- self.assertEquals(op[5], "NS decl: 'myns' 'http://www.python.org/namespace'")
- self.assertEquals(op[6], "Start element: 'http://www.python.org/namespace!subelement' {}")
- self.assertEquals(op[7], "Character data: 'Contents of subelements'")
- self.assertEquals(op[8], "End element: 'http://www.python.org/namespace!subelement'")
- self.assertEquals(op[9], "End of NS decl: 'myns'")
- self.assertEquals(op[10], "Start element: 'sub2' {}")
- self.assertEquals(op[11], 'Start of CDATA section')
- self.assertEquals(op[12], "Character data: 'contents of CDATA section'")
- self.assertEquals(op[13], 'End of CDATA section')
- self.assertEquals(op[14], "End element: 'sub2'")
- self.assertEquals(op[15], "External entity ref: (None, 'entity.file', None)")
- self.assertEquals(op[16], "End element: 'root'")
+ self.assertEqual(op[0], 'PI: \'xml-stylesheet\' \'href="stylesheet.css"\'')
+ self.assertEqual(op[1], "Comment: ' comment data '")
+ self.assertEqual(op[2], "Notation declared: ('notation', None, 'notation.jpeg', None)")
+ self.assertEqual(op[3], "Unparsed entity decl: ('unparsed_entity', None, 'entity.file', None, 'notation')")
+ self.assertEqual(op[4], "Start element: 'root' {'attr1': 'value1', 'attr2': 'value2\\xe1\\xbd\\x80'}")
+ self.assertEqual(op[5], "NS decl: 'myns' 'http://www.python.org/namespace'")
+ self.assertEqual(op[6], "Start element: 'http://www.python.org/namespace!subelement' {}")
+ self.assertEqual(op[7], "Character data: 'Contents of subelements'")
+ self.assertEqual(op[8], "End element: 'http://www.python.org/namespace!subelement'")
+ self.assertEqual(op[9], "End of NS decl: 'myns'")
+ self.assertEqual(op[10], "Start element: 'sub2' {}")
+ self.assertEqual(op[11], 'Start of CDATA section')
+ self.assertEqual(op[12], "Character data: 'contents of CDATA section'")
+ self.assertEqual(op[13], 'End of CDATA section')
+ self.assertEqual(op[14], "End element: 'sub2'")
+ self.assertEqual(op[15], "External entity ref: (None, 'entity.file', None)")
+ self.assertEqual(op[16], "End element: 'root'")
def test_unicode(self):
# Try the parse again, this time producing Unicode output
@@ -170,23 +170,23 @@ class ParseTest(unittest.TestCase):
parser.Parse(data, 1)
op = out.out
- self.assertEquals(op[0], 'PI: u\'xml-stylesheet\' u\'href="stylesheet.css"\'')
- self.assertEquals(op[1], "Comment: u' comment data '")
- self.assertEquals(op[2], "Notation declared: (u'notation', None, u'notation.jpeg', None)")
- self.assertEquals(op[3], "Unparsed entity decl: (u'unparsed_entity', None, u'entity.file', None, u'notation')")
- self.assertEquals(op[4], "Start element: u'root' {u'attr1': u'value1', u'attr2': u'value2\\u1f40'}")
- self.assertEquals(op[5], "NS decl: u'myns' u'http://www.python.org/namespace'")
- self.assertEquals(op[6], "Start element: u'http://www.python.org/namespace!subelement' {}")
- self.assertEquals(op[7], "Character data: u'Contents of subelements'")
- self.assertEquals(op[8], "End element: u'http://www.python.org/namespace!subelement'")
- self.assertEquals(op[9], "End of NS decl: u'myns'")
- self.assertEquals(op[10], "Start element: u'sub2' {}")
- self.assertEquals(op[11], 'Start of CDATA section')
- self.assertEquals(op[12], "Character data: u'contents of CDATA section'")
- self.assertEquals(op[13], 'End of CDATA section')
- self.assertEquals(op[14], "End element: u'sub2'")
- self.assertEquals(op[15], "External entity ref: (None, u'entity.file', None)")
- self.assertEquals(op[16], "End element: u'root'")
+ self.assertEqual(op[0], 'PI: u\'xml-stylesheet\' u\'href="stylesheet.css"\'')
+ self.assertEqual(op[1], "Comment: u' comment data '")
+ self.assertEqual(op[2], "Notation declared: (u'notation', None, u'notation.jpeg', None)")
+ self.assertEqual(op[3], "Unparsed entity decl: (u'unparsed_entity', None, u'entity.file', None, u'notation')")
+ self.assertEqual(op[4], "Start element: u'root' {u'attr1': u'value1', u'attr2': u'value2\\u1f40'}")
+ self.assertEqual(op[5], "NS decl: u'myns' u'http://www.python.org/namespace'")
+ self.assertEqual(op[6], "Start element: u'http://www.python.org/namespace!subelement' {}")
+ self.assertEqual(op[7], "Character data: u'Contents of subelements'")
+ self.assertEqual(op[8], "End element: u'http://www.python.org/namespace!subelement'")
+ self.assertEqual(op[9], "End of NS decl: u'myns'")
+ self.assertEqual(op[10], "Start element: u'sub2' {}")
+ self.assertEqual(op[11], 'Start of CDATA section')
+ self.assertEqual(op[12], "Character data: u'contents of CDATA section'")
+ self.assertEqual(op[13], 'End of CDATA section')
+ self.assertEqual(op[14], "End element: u'sub2'")
+ self.assertEqual(op[15], "External entity ref: (None, u'entity.file', None)")
+ self.assertEqual(op[16], "End element: u'root'")
def test_parse_file(self):
# Try parsing a file
@@ -200,23 +200,33 @@ class ParseTest(unittest.TestCase):
parser.ParseFile(file)
op = out.out
- self.assertEquals(op[0], 'PI: u\'xml-stylesheet\' u\'href="stylesheet.css"\'')
- self.assertEquals(op[1], "Comment: u' comment data '")
- self.assertEquals(op[2], "Notation declared: (u'notation', None, u'notation.jpeg', None)")
- self.assertEquals(op[3], "Unparsed entity decl: (u'unparsed_entity', None, u'entity.file', None, u'notation')")
- self.assertEquals(op[4], "Start element: u'root' {u'attr1': u'value1', u'attr2': u'value2\\u1f40'}")
- self.assertEquals(op[5], "NS decl: u'myns' u'http://www.python.org/namespace'")
- self.assertEquals(op[6], "Start element: u'http://www.python.org/namespace!subelement' {}")
- self.assertEquals(op[7], "Character data: u'Contents of subelements'")
- self.assertEquals(op[8], "End element: u'http://www.python.org/namespace!subelement'")
- self.assertEquals(op[9], "End of NS decl: u'myns'")
- self.assertEquals(op[10], "Start element: u'sub2' {}")
- self.assertEquals(op[11], 'Start of CDATA section')
- self.assertEquals(op[12], "Character data: u'contents of CDATA section'")
- self.assertEquals(op[13], 'End of CDATA section')
- self.assertEquals(op[14], "End element: u'sub2'")
- self.assertEquals(op[15], "External entity ref: (None, u'entity.file', None)")
- self.assertEquals(op[16], "End element: u'root'")
+ self.assertEqual(op[0], 'PI: u\'xml-stylesheet\' u\'href="stylesheet.css"\'')
+ self.assertEqual(op[1], "Comment: u' comment data '")
+ self.assertEqual(op[2], "Notation declared: (u'notation', None, u'notation.jpeg', None)")
+ self.assertEqual(op[3], "Unparsed entity decl: (u'unparsed_entity', None, u'entity.file', None, u'notation')")
+ self.assertEqual(op[4], "Start element: u'root' {u'attr1': u'value1', u'attr2': u'value2\\u1f40'}")
+ self.assertEqual(op[5], "NS decl: u'myns' u'http://www.python.org/namespace'")
+ self.assertEqual(op[6], "Start element: u'http://www.python.org/namespace!subelement' {}")
+ self.assertEqual(op[7], "Character data: u'Contents of subelements'")
+ self.assertEqual(op[8], "End element: u'http://www.python.org/namespace!subelement'")
+ self.assertEqual(op[9], "End of NS decl: u'myns'")
+ self.assertEqual(op[10], "Start element: u'sub2' {}")
+ self.assertEqual(op[11], 'Start of CDATA section')
+ self.assertEqual(op[12], "Character data: u'contents of CDATA section'")
+ self.assertEqual(op[13], 'End of CDATA section')
+ self.assertEqual(op[14], "End element: u'sub2'")
+ self.assertEqual(op[15], "External entity ref: (None, u'entity.file', None)")
+ self.assertEqual(op[16], "End element: u'root'")
+
+ # Issue 4877: expat.ParseFile causes segfault on a closed file.
+ fp = open(test_support.TESTFN, 'wb')
+ try:
+ fp.close()
+ parser = expat.ParserCreate()
+ with self.assertRaises(ValueError):
+ parser.ParseFile(fp)
+ finally:
+ test_support.unlink(test_support.TESTFN)
class NamespaceSeparatorTest(unittest.TestCase):
@@ -232,14 +242,14 @@ class NamespaceSeparatorTest(unittest.TestCase):
expat.ParserCreate(namespace_separator=42)
self.fail()
except TypeError, e:
- self.assertEquals(str(e),
+ self.assertEqual(str(e),
'ParserCreate() argument 2 must be string or None, not int')
try:
expat.ParserCreate(namespace_separator='too long')
self.fail()
except ValueError, e:
- self.assertEquals(str(e),
+ self.assertEqual(str(e),
'namespace_separator must be at most one character, omitted, or None')
def test_zero_length(self):
@@ -265,7 +275,7 @@ class InterningTest(unittest.TestCase):
p.EndElementHandler = collector
p.Parse("<e> <e/> <e></e> </e>", 1)
tag = L[0]
- self.assertEquals(len(L), 6)
+ self.assertEqual(len(L), 6)
for entry in L:
# L should have the same string repeated over and over.
self.assertTrue(tag is entry)
@@ -279,7 +289,7 @@ class BufferTextTest(unittest.TestCase):
self.parser.CharacterDataHandler = self.CharacterDataHandler
def check(self, expected, label):
- self.assertEquals(self.stuff, expected,
+ self.assertEqual(self.stuff, expected,
"%s\nstuff = %r\nexpected = %r"
% (label, self.stuff, map(unicode, expected)))
@@ -312,47 +322,47 @@ class BufferTextTest(unittest.TestCase):
# Make sure buffering is turned on
self.assertTrue(self.parser.buffer_text)
self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
- self.assertEquals(self.stuff, ['123'],
- "buffered text not properly collapsed")
+ self.assertEqual(self.stuff, ['123'],
+ "buffered text not properly collapsed")
def test1(self):
# XXX This test exposes more detail of Expat's text chunking than we
# XXX like, but it tests what we need to concisely.
self.setHandlers(["StartElementHandler"])
self.parser.Parse("<a>1<b buffer-text='no'/>2\n3<c buffer-text='yes'/>4\n5</a>", 1)
- self.assertEquals(self.stuff,
- ["<a>", "1", "<b>", "2", "\n", "3", "<c>", "4\n5"],
- "buffering control not reacting as expected")
+ self.assertEqual(self.stuff,
+ ["<a>", "1", "<b>", "2", "\n", "3", "<c>", "4\n5"],
+ "buffering control not reacting as expected")
def test2(self):
self.parser.Parse("<a>1<b/>&lt;2&gt;<c/>&#32;\n&#x20;3</a>", 1)
- self.assertEquals(self.stuff, ["1<2> \n 3"],
- "buffered text not properly collapsed")
+ self.assertEqual(self.stuff, ["1<2> \n 3"],
+ "buffered text not properly collapsed")
def test3(self):
self.setHandlers(["StartElementHandler"])
self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
- self.assertEquals(self.stuff, ["<a>", "1", "<b>", "2", "<c>", "3"],
+ self.assertEqual(self.stuff, ["<a>", "1", "<b>", "2", "<c>", "3"],
"buffered text not properly split")
def test4(self):
self.setHandlers(["StartElementHandler", "EndElementHandler"])
self.parser.CharacterDataHandler = None
self.parser.Parse("<a>1<b/>2<c/>3</a>", 1)
- self.assertEquals(self.stuff,
- ["<a>", "<b>", "</b>", "<c>", "</c>", "</a>"])
+ self.assertEqual(self.stuff,
+ ["<a>", "<b>", "</b>", "<c>", "</c>", "</a>"])
def test5(self):
self.setHandlers(["StartElementHandler", "EndElementHandler"])
self.parser.Parse("<a>1<b></b>2<c/>3</a>", 1)
- self.assertEquals(self.stuff,
+ self.assertEqual(self.stuff,
["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "3", "</a>"])
def test6(self):
self.setHandlers(["CommentHandler", "EndElementHandler",
"StartElementHandler"])
self.parser.Parse("<a>1<b/>2<c></c>345</a> ", 1)
- self.assertEquals(self.stuff,
+ self.assertEqual(self.stuff,
["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "345", "</a>"],
"buffered text not properly split")
@@ -360,10 +370,10 @@ class BufferTextTest(unittest.TestCase):
self.setHandlers(["CommentHandler", "EndElementHandler",
"StartElementHandler"])
self.parser.Parse("<a>1<b/>2<c></c>3<!--abc-->4<!--def-->5</a> ", 1)
- self.assertEquals(self.stuff,
- ["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "3",
- "<!--abc-->", "4", "<!--def-->", "5", "</a>"],
- "buffered text not properly split")
+ self.assertEqual(self.stuff,
+ ["<a>", "1", "<b>", "</b>", "2", "<c>", "</c>", "3",
+ "<!--abc-->", "4", "<!--def-->", "5", "</a>"],
+ "buffered text not properly split")
# Test handling of exception from callback:
@@ -378,9 +388,9 @@ class HandlerExceptionTest(unittest.TestCase):
parser.Parse("<a><b><c/></b></a>", 1)
self.fail()
except RuntimeError, e:
- self.assertEquals(e.args[0], 'a',
- "Expected RuntimeError for element 'a', but" + \
- " found %r" % e.args[0])
+ self.assertEqual(e.args[0], 'a',
+ "Expected RuntimeError for element 'a', but" + \
+ " found %r" % e.args[0])
# Test Current* members:
@@ -399,7 +409,7 @@ class PositionTest(unittest.TestCase):
self.assertTrue(self.upto < len(self.expected_list),
'too many parser events')
expected = self.expected_list[self.upto]
- self.assertEquals(pos, expected,
+ self.assertEqual(pos, expected,
'Expected position %s, got position %s' %(pos, expected))
self.upto += 1
@@ -440,10 +450,10 @@ class ChardataBufferTest(unittest.TestCase):
"""
def test_1025_bytes(self):
- self.assertEquals(self.small_buffer_test(1025), 2)
+ self.assertEqual(self.small_buffer_test(1025), 2)
def test_1000_bytes(self):
- self.assertEquals(self.small_buffer_test(1000), 1)
+ self.assertEqual(self.small_buffer_test(1000), 1)
def test_wrong_size(self):
parser = expat.ParserCreate()
@@ -467,15 +477,15 @@ class ChardataBufferTest(unittest.TestCase):
# once.
self.n = 0
parser.Parse(xml1)
- self.assertEquals(self.n, 1)
+ self.assertEqual(self.n, 1)
# Reassign to buffer_size, but assign the same size.
parser.buffer_size = parser.buffer_size
- self.assertEquals(self.n, 1)
+ self.assertEqual(self.n, 1)
# Try parsing rest of the document
parser.Parse(xml2)
- self.assertEquals(self.n, 2)
+ self.assertEqual(self.n, 2)
def test_disabling_buffer(self):
@@ -486,27 +496,27 @@ class ChardataBufferTest(unittest.TestCase):
parser.CharacterDataHandler = self.counting_handler
parser.buffer_text = 1
parser.buffer_size = 1024
- self.assertEquals(parser.buffer_size, 1024)
+ self.assertEqual(parser.buffer_size, 1024)
# Parse one chunk of XML
self.n = 0
parser.Parse(xml1, 0)
- self.assertEquals(parser.buffer_size, 1024)
- self.assertEquals(self.n, 1)
+ self.assertEqual(parser.buffer_size, 1024)
+ self.assertEqual(self.n, 1)
# Turn off buffering and parse the next chunk.
parser.buffer_text = 0
self.assertFalse(parser.buffer_text)
- self.assertEquals(parser.buffer_size, 1024)
+ self.assertEqual(parser.buffer_size, 1024)
for i in range(10):
parser.Parse(xml2, 0)
- self.assertEquals(self.n, 11)
+ self.assertEqual(self.n, 11)
parser.buffer_text = 1
self.assertTrue(parser.buffer_text)
- self.assertEquals(parser.buffer_size, 1024)
+ self.assertEqual(parser.buffer_size, 1024)
parser.Parse(xml3, 1)
- self.assertEquals(self.n, 12)
+ self.assertEqual(self.n, 12)
@@ -534,14 +544,14 @@ class ChardataBufferTest(unittest.TestCase):
parser.CharacterDataHandler = self.counting_handler
parser.buffer_text = 1
parser.buffer_size = 1024
- self.assertEquals(parser.buffer_size, 1024)
+ self.assertEqual(parser.buffer_size, 1024)
self.n = 0
parser.Parse(xml1, 0)
parser.buffer_size *= 2
- self.assertEquals(parser.buffer_size, 2048)
+ self.assertEqual(parser.buffer_size, 2048)
parser.Parse(xml2, 1)
- self.assertEquals(self.n, 2)
+ self.assertEqual(self.n, 2)
def test_change_size_2(self):
xml1 = "<?xml version='1.0' encoding='iso8859'?><a>a<s>%s" % ('a' * 1023)
@@ -550,14 +560,14 @@ class ChardataBufferTest(unittest.TestCase):
parser.CharacterDataHandler = self.counting_handler
parser.buffer_text = 1
parser.buffer_size = 2048
- self.assertEquals(parser.buffer_size, 2048)
+ self.assertEqual(parser.buffer_size, 2048)
self.n=0
parser.Parse(xml1, 0)
parser.buffer_size //= 2
- self.assertEquals(parser.buffer_size, 1024)
+ self.assertEqual(parser.buffer_size, 1024)
parser.Parse(xml2, 1)
- self.assertEquals(self.n, 4)
+ self.assertEqual(self.n, 4)
class MalformedInputText(unittest.TestCase):
def test1(self):
@@ -567,7 +577,7 @@ class MalformedInputText(unittest.TestCase):
parser.Parse(xml, True)
self.fail()
except expat.ExpatError as e:
- self.assertEquals(str(e), 'unclosed token: line 2, column 0')
+ self.assertEqual(str(e), 'unclosed token: line 2, column 0')
def test2(self):
xml = "<?xml version\xc2\x85='1.0'?>\r\n"
@@ -576,7 +586,7 @@ class MalformedInputText(unittest.TestCase):
parser.Parse(xml, True)
self.fail()
except expat.ExpatError as e:
- self.assertEquals(str(e), 'XML declaration not well-formed: line 1, column 14')
+ self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14')
def test_main():
run_unittest(SetAttributeTest,
diff --git a/Lib/test/test_queue.py b/Lib/test/test_queue.py
index cecb0a1f18..0b38e7e306 100644
--- a/Lib/test/test_queue.py
+++ b/Lib/test/test_queue.py
@@ -1,11 +1,10 @@
# Some simple queue module tests, plus some failure conditions
# to ensure the Queue locks remain stable.
import Queue
-import sys
-import threading
import time
import unittest
from test import test_support
+threading = test_support.import_module('threading')
QUEUE_SIZE = 5
@@ -96,16 +95,16 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
LifoQueue = [222, 333, 111],
PriorityQueue = [111, 222, 333])
actual_order = [q.get(), q.get(), q.get()]
- self.assertEquals(actual_order, target_order[q.__class__.__name__],
- "Didn't seem to queue the correct data!")
+ self.assertEqual(actual_order, target_order[q.__class__.__name__],
+ "Didn't seem to queue the correct data!")
for i in range(QUEUE_SIZE-1):
q.put(i)
- self.assert_(not q.empty(), "Queue should not be empty")
- self.assert_(not q.full(), "Queue should not be full")
+ self.assertTrue(not q.empty(), "Queue should not be empty")
+ self.assertTrue(not q.full(), "Queue should not be full")
last = 2 * QUEUE_SIZE
full = 3 * 2 * QUEUE_SIZE
q.put(last)
- self.assert_(q.full(), "Queue should be full")
+ self.assertTrue(q.full(), "Queue should be full")
try:
q.put(full, block=0)
self.fail("Didn't appear to block with a full queue")
@@ -122,7 +121,7 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
# Empty it
for i in range(QUEUE_SIZE):
q.get()
- self.assert_(q.empty(), "Queue should be empty")
+ self.assertTrue(q.empty(), "Queue should be empty")
try:
q.get(block=0)
self.fail("Didn't appear to block with an empty queue")
@@ -155,8 +154,8 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
for i in xrange(100):
q.put(i)
q.join()
- self.assertEquals(self.cum, sum(range(100)),
- "q.join() did not block until all tasks were done")
+ self.assertEqual(self.cum, sum(range(100)),
+ "q.join() did not block until all tasks were done")
for i in (0,1):
q.put(None) # instruct the threads to close
q.join() # verify that you can join twice
@@ -244,7 +243,7 @@ class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
except FailingQueueException:
pass
q.put("last")
- self.assert_(q.full(), "Queue should be full")
+ self.assertTrue(q.full(), "Queue should be full")
# Test a failing blocking put
q.fail_next_put = True
try:
@@ -266,17 +265,17 @@ class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
# Check the Queue isn't damaged.
# put failed, but get succeeded - re-add
q.put("last")
- self.assert_(q.full(), "Queue should be full")
+ self.assertTrue(q.full(), "Queue should be full")
q.get()
- self.assert_(not q.full(), "Queue should not be full")
+ self.assertTrue(not q.full(), "Queue should not be full")
q.put("last")
- self.assert_(q.full(), "Queue should be full")
+ self.assertTrue(q.full(), "Queue should be full")
# Test a blocking put
self.do_blocking_test(q.put, ("full",), q.get, ())
# Empty it
for i in range(QUEUE_SIZE):
q.get()
- self.assert_(q.empty(), "Queue should be empty")
+ self.assertTrue(q.empty(), "Queue should be empty")
q.put("first")
q.fail_next_get = True
try:
@@ -284,16 +283,16 @@ class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
self.fail("The queue didn't fail when it should have")
except FailingQueueException:
pass
- self.assert_(not q.empty(), "Queue should not be empty")
+ self.assertTrue(not q.empty(), "Queue should not be empty")
q.fail_next_get = True
try:
q.get(timeout=0.1)
self.fail("The queue didn't fail when it should have")
except FailingQueueException:
pass
- self.assert_(not q.empty(), "Queue should not be empty")
+ self.assertTrue(not q.empty(), "Queue should not be empty")
q.get()
- self.assert_(q.empty(), "Queue should be empty")
+ self.assertTrue(q.empty(), "Queue should be empty")
q.fail_next_get = True
try:
self.do_exceptional_blocking_test(q.get, (), q.put, ('empty',),
@@ -302,9 +301,9 @@ class FailingQueueTest(unittest.TestCase, BlockingTestMixin):
except FailingQueueException:
pass
# put succeeded, but get failed.
- self.assert_(not q.empty(), "Queue should not be empty")
+ self.assertTrue(not q.empty(), "Queue should not be empty")
q.get()
- self.assert_(q.empty(), "Queue should be empty")
+ self.assertTrue(q.empty(), "Queue should be empty")
def test_failing_queue(self):
# Test to make sure a queue is functioning correctly.
diff --git a/Lib/test/test_quopri.py b/Lib/test/test_quopri.py
index 56a793c92b..c3c4d1432e 100644
--- a/Lib/test/test_quopri.py
+++ b/Lib/test/test_quopri.py
@@ -130,17 +130,17 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
@withpythonimplementation
def test_encodestring(self):
for p, e in self.STRINGS:
- self.assert_(quopri.encodestring(p) == e)
+ self.assertTrue(quopri.encodestring(p) == e)
@withpythonimplementation
def test_decodestring(self):
for p, e in self.STRINGS:
- self.assert_(quopri.decodestring(e) == p)
+ self.assertTrue(quopri.decodestring(e) == p)
@withpythonimplementation
def test_idempotent_string(self):
for p, e in self.STRINGS:
- self.assert_(quopri.decodestring(quopri.encodestring(e)) == e)
+ self.assertTrue(quopri.decodestring(quopri.encodestring(e)) == e)
@withpythonimplementation
def test_encode(self):
@@ -148,7 +148,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
infp = cStringIO.StringIO(p)
outfp = cStringIO.StringIO()
quopri.encode(infp, outfp, quotetabs=False)
- self.assert_(outfp.getvalue() == e)
+ self.assertTrue(outfp.getvalue() == e)
@withpythonimplementation
def test_decode(self):
@@ -156,28 +156,29 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
infp = cStringIO.StringIO(e)
outfp = cStringIO.StringIO()
quopri.decode(infp, outfp)
- self.assert_(outfp.getvalue() == p)
+ self.assertTrue(outfp.getvalue() == p)
@withpythonimplementation
def test_embedded_ws(self):
for p, e in self.ESTRINGS:
- self.assert_(quopri.encodestring(p, quotetabs=True) == e)
- self.assert_(quopri.decodestring(e) == p)
+ self.assertTrue(quopri.encodestring(p, quotetabs=True) == e)
+ self.assertTrue(quopri.decodestring(e) == p)
@withpythonimplementation
def test_encode_header(self):
for p, e in self.HSTRINGS:
- self.assert_(quopri.encodestring(p, header=True) == e)
+ self.assertTrue(quopri.encodestring(p, header=True) == e)
@withpythonimplementation
def test_decode_header(self):
for p, e in self.HSTRINGS:
- self.assert_(quopri.decodestring(e, header=True) == p)
+ self.assertTrue(quopri.decodestring(e, header=True) == p)
def test_scriptencode(self):
(p, e) = self.STRINGS[-1]
process = subprocess.Popen([sys.executable, "-mquopri"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ self.addCleanup(process.stdout.close)
cout, cerr = process.communicate(p)
# On Windows, Python will output the result to stdout using
# CRLF, as the mode of stdout is text mode. To compare this
@@ -188,6 +189,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
(p, e) = self.STRINGS[-1]
process = subprocess.Popen([sys.executable, "-mquopri", "-d"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ self.addCleanup(process.stdout.close)
cout, cerr = process.communicate(e)
self.assertEqual(cout.splitlines(), p.splitlines())
diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py
index 50d45f2d9b..df82990cc9 100644
--- a/Lib/test/test_random.py
+++ b/Lib/test/test_random.py
@@ -5,7 +5,7 @@ import random
import time
import pickle
import warnings
-from math import log, exp, sqrt, pi, fsum as msum
+from math import log, exp, pi, fsum, sin
from functools import reduce
from test import test_support
@@ -53,10 +53,8 @@ class TestBasicOps(unittest.TestCase):
state3 = self.gen.getstate() # s/b distinct from state2
self.assertNotEqual(state2, state3)
- with test_support._check_py3k_warnings(quiet=True):
+ with test_support.check_py3k_warnings(quiet=True):
self.assertRaises(TypeError, self.gen.jumpahead) # needs an arg
- self.assertRaises(TypeError, self.gen.jumpahead, "ick") # wrong type
- self.assertRaises(TypeError, self.gen.jumpahead, 2.3) # wrong type
self.assertRaises(TypeError, self.gen.jumpahead, 2, 3) # too many
def test_sample(self):
@@ -69,7 +67,7 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(len(s), k)
uniq = set(s)
self.assertEqual(len(uniq), k)
- self.failUnless(uniq <= set(population))
+ self.assertTrue(uniq <= set(population))
self.assertEqual(self.gen.sample([], 0), []) # test edge case N==k==0
def test_sample_distribution(self):
@@ -114,7 +112,7 @@ class TestBasicOps(unittest.TestCase):
samp = self.gen.sample(d, k)
# Verify that we got ints back (keys); the values are complex.
for x in samp:
- self.assert_(type(x) is int)
+ self.assertTrue(type(x) is int)
samp.sort()
self.assertEqual(samp, range(N))
@@ -239,7 +237,7 @@ class SystemRandom_TestBasicOps(TestBasicOps):
cum = 0
for i in xrange(100):
r = self.gen.randrange(span)
- self.assert_(0 <= r < span)
+ self.assertTrue(0 <= r < span)
cum |= r
self.assertEqual(cum, span-1)
@@ -249,7 +247,7 @@ class SystemRandom_TestBasicOps(TestBasicOps):
stop = self.gen.randrange(2 ** (i-2))
if stop <= start:
return
- self.assert_(start <= self.gen.randrange(start, stop) < stop)
+ self.assertTrue(start <= self.gen.randrange(start, stop) < stop)
def test_rangelimits(self):
for start, stop in [(-2,0), (-(2**60)-2,-(2**60)), (2**60,2**60+2)]:
@@ -259,7 +257,7 @@ class SystemRandom_TestBasicOps(TestBasicOps):
def test_genrandbits(self):
# Verify ranges
for k in xrange(1, 1000):
- self.assert_(0 <= self.gen.getrandbits(k) < 2**k)
+ self.assertTrue(0 <= self.gen.getrandbits(k) < 2**k)
# Verify all bits active
getbits = self.gen.getrandbits
@@ -285,17 +283,17 @@ class SystemRandom_TestBasicOps(TestBasicOps):
numbits = i+1
k = int(1.00001 + _log(n, 2))
self.assertEqual(k, numbits)
- self.assert_(n == 2**(k-1))
+ self.assertTrue(n == 2**(k-1))
n += n - 1 # check 1 below the next power of two
k = int(1.00001 + _log(n, 2))
- self.assert_(k in [numbits, numbits+1])
- self.assert_(2**k > n > 2**(k-2))
+ self.assertIn(k, [numbits, numbits+1])
+ self.assertTrue(2**k > n > 2**(k-2))
n -= n >> 15 # check a little farther below the next power of two
k = int(1.00001 + _log(n, 2))
self.assertEqual(k, numbits) # note the stronger assertion
- self.assert_(2**k > n > 2**(k-1)) # note the stronger assertion
+ self.assertTrue(2**k > n > 2**(k-1)) # note the stronger assertion
class MersenneTwister_TestBasicOps(TestBasicOps):
@@ -391,7 +389,7 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
cum = 0
for i in xrange(100):
r = self.gen.randrange(span)
- self.assert_(0 <= r < span)
+ self.assertTrue(0 <= r < span)
cum |= r
self.assertEqual(cum, span-1)
@@ -401,7 +399,7 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
stop = self.gen.randrange(2 ** (i-2))
if stop <= start:
return
- self.assert_(start <= self.gen.randrange(start, stop) < stop)
+ self.assertTrue(start <= self.gen.randrange(start, stop) < stop)
def test_rangelimits(self):
for start, stop in [(-2,0), (-(2**60)-2,-(2**60)), (2**60,2**60+2)]:
@@ -415,7 +413,7 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
97904845777343510404718956115L)
# Verify ranges
for k in xrange(1, 1000):
- self.assert_(0 <= self.gen.getrandbits(k) < 2**k)
+ self.assertTrue(0 <= self.gen.getrandbits(k) < 2**k)
# Verify all bits active
getbits = self.gen.getrandbits
@@ -441,35 +439,43 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
numbits = i+1
k = int(1.00001 + _log(n, 2))
self.assertEqual(k, numbits)
- self.assert_(n == 2**(k-1))
+ self.assertTrue(n == 2**(k-1))
n += n - 1 # check 1 below the next power of two
k = int(1.00001 + _log(n, 2))
- self.assert_(k in [numbits, numbits+1])
- self.assert_(2**k > n > 2**(k-2))
+ self.assertIn(k, [numbits, numbits+1])
+ self.assertTrue(2**k > n > 2**(k-2))
n -= n >> 15 # check a little farther below the next power of two
k = int(1.00001 + _log(n, 2))
self.assertEqual(k, numbits) # note the stronger assertion
- self.assert_(2**k > n > 2**(k-1)) # note the stronger assertion
+ self.assertTrue(2**k > n > 2**(k-1)) # note the stronger assertion
def test_randrange_bug_1590891(self):
start = 1000000000000
stop = -100000000000000000000
step = -200
x = self.gen.randrange(start, stop, step)
- self.assert_(stop < x <= start)
+ self.assertTrue(stop < x <= start)
self.assertEqual((x+stop)%step, 0)
-_gammacoeff = (0.9999999999995183, 676.5203681218835, -1259.139216722289,
- 771.3234287757674, -176.6150291498386, 12.50734324009056,
- -0.1385710331296526, 0.9934937113930748e-05, 0.1659470187408462e-06)
-
-def gamma(z, cof=_gammacoeff, g=7):
- z -= 1.0
- s = msum([cof[0]] + [cof[i] / (z+i) for i in range(1,len(cof))])
- z += 0.5
- return (z+g)**z / exp(z+g) * sqrt(2.0*pi) * s
+def gamma(z, sqrt2pi=(2.0*pi)**0.5):
+ # Reflection to right half of complex plane
+ if z < 0.5:
+ return pi / sin(pi*z) / gamma(1.0-z)
+ # Lanczos approximation with g=7
+ az = z + (7.0 - 0.5)
+ return az ** (z-0.5) / exp(az) * sqrt2pi * fsum([
+ 0.9999999999995183,
+ 676.5203681218835 / z,
+ -1259.139216722289 / (z+1.0),
+ 771.3234287757674 / (z+2.0),
+ -176.6150291498386 / (z+3.0),
+ 12.50734324009056 / (z+4.0),
+ -0.1385710331296526 / (z+5.0),
+ 0.9934937113930748e-05 / (z+6.0),
+ 0.1659470187408462e-06 / (z+7.0),
+ ])
class TestDistributions(unittest.TestCase):
def test_zeroinputs(self):
@@ -528,7 +534,7 @@ class TestModule(unittest.TestCase):
def test__all__(self):
# tests validity but not completeness of the __all__ list
- self.failUnless(set(random.__all__) <= set(dir(random)))
+ self.assertTrue(set(random.__all__) <= set(dir(random)))
def test_random_subclass_with_kwargs(self):
# SF bug #1486663 -- this used to erroneously raise a TypeError
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index f8a564762f..1f739672a2 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1,13 +1,15 @@
from test.test_support import verbose, run_unittest, import_module
import re
from re import Scanner
-import sys, os, traceback
+import sys
+import string
+import traceback
from weakref import proxy
# Misc tests from Tim Peters' re.doc
# WARNING: Don't change details in these tests if you don't know
-# what you're doing. Some of these tests were carefuly modeled to
+# what you're doing. Some of these tests were carefully modeled to
# cover most of the code.
import unittest
@@ -429,17 +431,61 @@ class ReTests(unittest.TestCase):
self.assertEqual(re.search("\s(b)", " b").group(1), "b")
self.assertEqual(re.search("a\s", "a ").group(0), "a ")
- def test_re_escape(self):
- p=""
- for i in range(0, 256):
- p = p + chr(i)
- self.assertEqual(re.match(re.escape(chr(i)), chr(i)) is not None,
- True)
- self.assertEqual(re.match(re.escape(chr(i)), chr(i)).span(), (0,1))
+ def assertMatch(self, pattern, text, match=None, span=None,
+ matcher=re.match):
+ if match is None and span is None:
+ # the pattern matches the whole text
+ match = text
+ span = (0, len(text))
+ elif match is None or span is None:
+ raise ValueError('If match is not None, span should be specified '
+ '(and vice versa).')
+ m = matcher(pattern, text)
+ self.assertTrue(m)
+ self.assertEqual(m.group(), match)
+ self.assertEqual(m.span(), span)
- pat=re.compile(re.escape(p))
- self.assertEqual(pat.match(p) is not None, True)
- self.assertEqual(pat.match(p).span(), (0,256))
+ def test_re_escape(self):
+ alnum_chars = string.ascii_letters + string.digits
+ p = u''.join(unichr(i) for i in range(256))
+ for c in p:
+ if c in alnum_chars:
+ self.assertEqual(re.escape(c), c)
+ elif c == u'\x00':
+ self.assertEqual(re.escape(c), u'\\000')
+ else:
+ self.assertEqual(re.escape(c), u'\\' + c)
+ self.assertMatch(re.escape(c), c)
+ self.assertMatch(re.escape(p), p)
+
+ def test_re_escape_byte(self):
+ alnum_chars = (string.ascii_letters + string.digits).encode('ascii')
+ p = ''.join(chr(i) for i in range(256))
+ for b in p:
+ if b in alnum_chars:
+ self.assertEqual(re.escape(b), b)
+ elif b == b'\x00':
+ self.assertEqual(re.escape(b), b'\\000')
+ else:
+ self.assertEqual(re.escape(b), b'\\' + b)
+ self.assertMatch(re.escape(b), b)
+ self.assertMatch(re.escape(p), p)
+
+ def test_re_escape_non_ascii(self):
+ s = u'xxx\u2620\u2620\u2620xxx'
+ s_escaped = re.escape(s)
+ self.assertEqual(s_escaped, u'xxx\\\u2620\\\u2620\\\u2620xxx')
+ self.assertMatch(s_escaped, s)
+ self.assertMatch(u'.%s+.' % re.escape(u'\u2620'), s,
+ u'x\u2620\u2620\u2620x', (2, 7), re.search)
+
+ def test_re_escape_non_ascii_bytes(self):
+ b = u'y\u2620y\u2620y'.encode('utf-8')
+ b_escaped = re.escape(b)
+ self.assertEqual(b_escaped, b'y\\\xe2\\\x98\\\xa0y\\\xe2\\\x98\\\xa0y')
+ self.assertMatch(b_escaped, b)
+ res = re.findall(re.escape(u'\u2620'.encode('utf-8')), b)
+ self.assertEqual(len(res), 2)
def test_pickling(self):
import pickle
@@ -603,7 +649,7 @@ class ReTests(unittest.TestCase):
unicode
except NameError:
return # no problem if we have no unicode
- self.assert_(re.compile('bug_926075') is not
+ self.assertTrue(re.compile('bug_926075') is not
re.compile(eval("u'bug_926075'")))
def test_bug_931848(self):
@@ -630,6 +676,27 @@ class ReTests(unittest.TestCase):
self.assertEqual(iter.next().span(), (4, 4))
self.assertRaises(StopIteration, iter.next)
+ def test_bug_6561(self):
+ # '\d' should match characters in Unicode category 'Nd'
+ # (Number, Decimal Digit), but not those in 'Nl' (Number,
+ # Letter) or 'No' (Number, Other).
+ decimal_digits = [
+ u'\u0037', # '\N{DIGIT SEVEN}', category 'Nd'
+ u'\u0e58', # '\N{THAI DIGIT SIX}', category 'Nd'
+ u'\uff10', # '\N{FULLWIDTH DIGIT ZERO}', category 'Nd'
+ ]
+ for x in decimal_digits:
+ self.assertEqual(re.match('^\d$', x, re.UNICODE).group(0), x)
+
+ not_decimal_digits = [
+ u'\u2165', # '\N{ROMAN NUMERAL SIX}', category 'Nl'
+ u'\u3039', # '\N{HANGZHOU NUMERAL TWENTY}', category 'Nl'
+ u'\u2082', # '\N{SUBSCRIPT TWO}', category 'No'
+ u'\u32b4', # '\N{CIRCLED NUMBER THIRTY NINE}', category 'No'
+ ]
+ for x in not_decimal_digits:
+ self.assertIsNone(re.match('^\d$', x, re.UNICODE))
+
def test_empty_array(self):
# SF buf 1647541
import array
@@ -691,7 +758,7 @@ class ReTests(unittest.TestCase):
self.assertRaises(OverflowError, _sre.compile, "abc", 0, [long_overflow])
def run_re_tests():
- from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR
+ from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR
if verbose:
print 'Running re_tests test suite'
else:
diff --git a/Lib/test/test_readline.py b/Lib/test/test_readline.py
index a2210d4330..11045c852e 100644
--- a/Lib/test/test_readline.py
+++ b/Lib/test/test_readline.py
@@ -6,9 +6,10 @@ the "real" readline have the same interface for history manipulation. That's
why the tests cover only a small subset of the interface.
"""
import unittest
-from test.test_support import run_unittest
+from test.test_support import run_unittest, import_module
-import readline
+# Skip tests if there is no readline module
+readline = import_module('readline')
class TestHistoryManipulation (unittest.TestCase):
def testHistoryUpdates(self):
diff --git a/Lib/test/test_repr.py b/Lib/test/test_repr.py
index 8c683fb4e2..8b20acdc8e 100644
--- a/Lib/test/test_repr.py
+++ b/Lib/test/test_repr.py
@@ -8,7 +8,7 @@ import os
import shutil
import unittest
-from test.test_support import run_unittest, _check_py3k_warnings
+from test.test_support import run_unittest, check_py3k_warnings
from repr import repr as r # Don't shadow builtin repr
from repr import Repr
@@ -22,7 +22,7 @@ def nestedTuple(nesting):
class ReprTests(unittest.TestCase):
def test_string(self):
- eq = self.assertEquals
+ eq = self.assertEqual
eq(r("abc"), "'abc'")
eq(r("abcdefghijklmnop"),"'abcdefghijklmnop'")
@@ -36,7 +36,7 @@ class ReprTests(unittest.TestCase):
eq(r(s), expected)
def test_tuple(self):
- eq = self.assertEquals
+ eq = self.assertEqual
eq(r((1,)), "(1,)")
t3 = (1, 2, 3)
@@ -51,7 +51,7 @@ class ReprTests(unittest.TestCase):
from array import array
from collections import deque
- eq = self.assertEquals
+ eq = self.assertEqual
# Tuples give up after 6 elements
eq(r(()), "()")
eq(r((1,)), "(1,)")
@@ -101,7 +101,7 @@ class ReprTests(unittest.TestCase):
"array('i', [1, 2, 3, 4, 5, ...])")
def test_numbers(self):
- eq = self.assertEquals
+ eq = self.assertEqual
eq(r(123), repr(123))
eq(r(123L), repr(123L))
eq(r(1.0/3), repr(1.0/3))
@@ -111,7 +111,7 @@ class ReprTests(unittest.TestCase):
eq(r(n), expected)
def test_instance(self):
- eq = self.assertEquals
+ eq = self.assertEqual
i1 = ClassWithRepr("a")
eq(r(i1), repr(i1))
@@ -123,39 +123,39 @@ class ReprTests(unittest.TestCase):
eq(r(i3), ("<ClassWithFailingRepr instance at %x>"%id(i3)))
s = r(ClassWithFailingRepr)
- self.failUnless(s.startswith("<class "))
- self.failUnless(s.endswith(">"))
- self.failUnless(s.find("...") == 8)
+ self.assertTrue(s.startswith("<class "))
+ self.assertTrue(s.endswith(">"))
+ self.assertTrue(s.find("...") == 8)
def test_file(self):
fp = open(unittest.__file__)
- self.failUnless(repr(fp).startswith(
+ self.assertTrue(repr(fp).startswith(
"<open file '%s', mode 'r' at 0x" % unittest.__file__))
fp.close()
- self.failUnless(repr(fp).startswith(
+ self.assertTrue(repr(fp).startswith(
"<closed file '%s', mode 'r' at 0x" % unittest.__file__))
def test_lambda(self):
- self.failUnless(repr(lambda x: x).startswith(
+ self.assertTrue(repr(lambda x: x).startswith(
"<function <lambda"))
# XXX anonymous functions? see func_repr
def test_builtin_function(self):
- eq = self.assertEquals
+ eq = self.assertEqual
# Functions
eq(repr(hash), '<built-in function hash>')
# Methods
- self.failUnless(repr(''.split).startswith(
+ self.assertTrue(repr(''.split).startswith(
'<built-in method split of str object at 0x'))
def test_xrange(self):
- eq = self.assertEquals
+ eq = self.assertEqual
eq(repr(xrange(1)), 'xrange(1)')
eq(repr(xrange(1, 2)), 'xrange(1, 2)')
eq(repr(xrange(1, 2, 3)), 'xrange(1, 4, 3)')
def test_nesting(self):
- eq = self.assertEquals
+ eq = self.assertEqual
# everything is meant to give up after 6 levels.
eq(r([[[[[[[]]]]]]]), "[[[[[[[]]]]]]]")
eq(r([[[[[[[[]]]]]]]]), "[[[[[[[...]]]]]]]")
@@ -174,16 +174,16 @@ class ReprTests(unittest.TestCase):
def test_buffer(self):
# XXX doesn't test buffers with no b_base or read-write buffers (see
# bufferobject.c). The test is fairly incomplete too. Sigh.
- with _check_py3k_warnings():
+ with check_py3k_warnings():
x = buffer('foo')
- self.failUnless(repr(x).startswith('<read-only buffer for 0x'))
+ self.assertTrue(repr(x).startswith('<read-only buffer for 0x'))
def test_cell(self):
# XXX Hmm? How to get at a cell object?
pass
def test_descriptors(self):
- eq = self.assertEquals
+ eq = self.assertEqual
# method descriptors
eq(repr(dict.items), "<method 'items' of 'dict' objects>")
# XXX member descriptors
@@ -193,9 +193,9 @@ class ReprTests(unittest.TestCase):
class C:
def foo(cls): pass
x = staticmethod(C.foo)
- self.failUnless(repr(x).startswith('<staticmethod object at 0x'))
+ self.assertTrue(repr(x).startswith('<staticmethod object at 0x'))
x = classmethod(C.foo)
- self.failUnless(repr(x).startswith('<classmethod object at 0x'))
+ self.assertTrue(repr(x).startswith('<classmethod object at 0x'))
def test_unsortable(self):
# Repr.repr() used to call sorted() on sets, frozensets and dicts
@@ -244,7 +244,7 @@ class LongReprTest(unittest.TestCase):
del sys.path[0]
def test_module(self):
- eq = self.assertEquals
+ eq = self.assertEqual
touch(os.path.join(self.subpkgname, self.pkgname + os.extsep + 'py'))
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import areallylongpackageandmodulenametotestreprtruncation
eq(repr(areallylongpackageandmodulenametotestreprtruncation),
@@ -252,7 +252,7 @@ class LongReprTest(unittest.TestCase):
eq(repr(sys), "<module 'sys' (built-in)>")
def test_type(self):
- eq = self.assertEquals
+ eq = self.assertEqual
touch(os.path.join(self.subpkgname, 'foo'+os.extsep+'py'), '''\
class foo(object):
pass
@@ -273,7 +273,7 @@ class bar:
''')
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import bar
# Module name may be prefixed with "test.", depending on how run.
- self.failUnless(repr(bar.bar).startswith(
+ self.assertTrue(repr(bar.bar).startswith(
"<class %s.bar at 0x" % bar.__name__))
def test_instance(self):
@@ -283,11 +283,11 @@ class baz:
''')
from areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation import baz
ibaz = baz.baz()
- self.failUnless(repr(ibaz).startswith(
+ self.assertTrue(repr(ibaz).startswith(
"<%s.baz instance at 0x" % baz.__name__))
def test_method(self):
- eq = self.assertEquals
+ eq = self.assertEqual
touch(os.path.join(self.subpkgname, 'qux'+os.extsep+'py'), '''\
class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
def amethod(self): pass
@@ -298,7 +298,7 @@ class aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
'<unbound method aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod>')
# Bound method next
iqux = qux.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
- self.failUnless(repr(iqux.amethod).startswith(
+ self.assertTrue(repr(iqux.amethod).startswith(
'<bound method aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.amethod of <%s.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa instance at 0x' \
% (qux.__name__,) ))
@@ -320,8 +320,7 @@ class ClassWithFailingRepr:
def test_main():
run_unittest(ReprTests)
- if os.name != 'mac':
- run_unittest(LongReprTest)
+ run_unittest(LongReprTest)
if __name__ == "__main__":
diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
index f354a1b637..52692a71ce 100644
--- a/Lib/test/test_resource.py
+++ b/Lib/test/test_resource.py
@@ -1,9 +1,9 @@
import unittest
from test import test_support
-
-import resource
import time
+resource = test_support.import_module('resource')
+
# This test is checking a few specific problem spots with the resource module.
class ResourceTest(unittest.TestCase):
diff --git a/Lib/test/test_rfc822.py b/Lib/test/test_rfc822.py
index a05325d253..d8a0280f51 100644
--- a/Lib/test/test_rfc822.py
+++ b/Lib/test/test_rfc822.py
@@ -16,23 +16,23 @@ class MessageTestCase(unittest.TestCase):
def test_get(self):
msg = self.create_message(
'To: "last, first" <userid@foo.net>\n\ntest\n')
- self.assert_(msg.get("to") == '"last, first" <userid@foo.net>')
- self.assert_(msg.get("TO") == '"last, first" <userid@foo.net>')
- self.assert_(msg.get("No-Such-Header") is None)
- self.assert_(msg.get("No-Such-Header", "No-Such-Value")
+ self.assertTrue(msg.get("to") == '"last, first" <userid@foo.net>')
+ self.assertTrue(msg.get("TO") == '"last, first" <userid@foo.net>')
+ self.assertTrue(msg.get("No-Such-Header") is None)
+ self.assertTrue(msg.get("No-Such-Header", "No-Such-Value")
== "No-Such-Value")
def test_setdefault(self):
msg = self.create_message(
'To: "last, first" <userid@foo.net>\n\ntest\n')
- self.assert_(not msg.has_key("New-Header"))
- self.assert_(msg.setdefault("New-Header", "New-Value") == "New-Value")
- self.assert_(msg.setdefault("New-Header", "Different-Value")
+ self.assertTrue(not msg.has_key("New-Header"))
+ self.assertTrue(msg.setdefault("New-Header", "New-Value") == "New-Value")
+ self.assertTrue(msg.setdefault("New-Header", "Different-Value")
== "New-Value")
- self.assert_(msg["new-header"] == "New-Value")
+ self.assertTrue(msg["new-header"] == "New-Value")
- self.assert_(msg.setdefault("Another-Header") == "")
- self.assert_(msg["another-header"] == "")
+ self.assertTrue(msg.setdefault("Another-Header") == "")
+ self.assertTrue(msg["another-header"] == "")
def check(self, msg, results):
"""Check addresses and the date."""
diff --git a/Lib/test/test_richcmp.py b/Lib/test/test_richcmp.py
index 7e4412a03c..70fa0d8289 100644
--- a/Lib/test/test_richcmp.py
+++ b/Lib/test/test_richcmp.py
@@ -106,7 +106,7 @@ class VectorTest(unittest.TestCase):
self.assertEqual(len(realres), len(expres))
for i in xrange(len(realres)):
# results are bool, so we can use "is" here
- self.assert_(realres[i] is expres[i])
+ self.assertTrue(realres[i] is expres[i])
def test_mixed(self):
# check that comparisons involving Vector objects
@@ -163,7 +163,7 @@ class NumberTest(unittest.TestCase):
for op in opmap[opname]:
realres = op(ta, tb)
realres = getattr(realres, "x", realres)
- self.assert_(realres is expres)
+ self.assertTrue(realres is expres)
def test_values(self):
# check all operators and all comparison results
@@ -192,13 +192,13 @@ class MiscTest(unittest.TestCase):
def test_misbehavin(self):
class Misb:
- def __lt__(self, other): return 0
- def __gt__(self, other): return 0
- def __eq__(self, other): return 0
- def __le__(self, other): raise test_support.TestFailed, "This shouldn't happen"
- def __ge__(self, other): raise test_support.TestFailed, "This shouldn't happen"
- def __ne__(self, other): raise test_support.TestFailed, "This shouldn't happen"
- def __cmp__(self, other): raise RuntimeError, "expected"
+ def __lt__(self_, other): return 0
+ def __gt__(self_, other): return 0
+ def __eq__(self_, other): return 0
+ def __le__(self_, other): self.fail("This shouldn't happen")
+ def __ge__(self_, other): self.fail("This shouldn't happen")
+ def __ne__(self_, other): self.fail("This shouldn't happen")
+ def __cmp__(self_, other): raise RuntimeError, "expected"
a = Misb()
b = Misb()
self.assertEqual(a<b, 0)
@@ -239,8 +239,8 @@ class MiscTest(unittest.TestCase):
b.append(17)
# Even recursive lists of different lengths are different,
# but they cannot be ordered
- self.assert_(not (a == b))
- self.assert_(a != b)
+ self.assertTrue(not (a == b))
+ self.assertTrue(a != b)
self.assertRaises(RuntimeError, operator.lt, a, b)
self.assertRaises(RuntimeError, operator.le, a, b)
self.assertRaises(RuntimeError, operator.gt, a, b)
@@ -250,9 +250,9 @@ class MiscTest(unittest.TestCase):
self.assertRaises(RuntimeError, operator.ne, a, b)
a.insert(0, 11)
b.insert(0, 12)
- self.assert_(not (a == b))
- self.assert_(a != b)
- self.assert_(a < b)
+ self.assertTrue(not (a == b))
+ self.assertTrue(a != b)
+ self.assertTrue(a < b)
class DictTest(unittest.TestCase):
@@ -271,19 +271,16 @@ class DictTest(unittest.TestCase):
imag1b[k] = v
imag2 = imag1b.copy()
imag2[k] = v + 1.0
- self.assert_(imag1a == imag1a)
- self.assert_(imag1a == imag1b)
- self.assert_(imag2 == imag2)
- self.assert_(imag1a != imag2)
+ self.assertTrue(imag1a == imag1a)
+ self.assertTrue(imag1a == imag1b)
+ self.assertTrue(imag2 == imag2)
+ self.assertTrue(imag1a != imag2)
for opname in ("lt", "le", "gt", "ge"):
for op in opmap[opname]:
self.assertRaises(TypeError, op, imag1a, imag2)
class ListTest(unittest.TestCase):
- def assertIs(self, a, b):
- self.assert_(a is b)
-
def test_coverage(self):
# exercise all comparisons for lists
x = [42]
@@ -331,7 +328,7 @@ class ListTest(unittest.TestCase):
def test_main():
test_support.run_unittest(VectorTest, NumberTest, MiscTest, ListTest)
- with test_support._check_py3k_warnings(("dict inequality comparisons "
+ with test_support.check_py3k_warnings(("dict inequality comparisons "
"not supported in 3.x",
DeprecationWarning)):
test_support.run_unittest(DictTest)
diff --git a/Lib/test/test_rlcompleter.py b/Lib/test/test_rlcompleter.py
new file mode 100644
index 0000000000..ac0e70dbcb
--- /dev/null
+++ b/Lib/test/test_rlcompleter.py
@@ -0,0 +1,73 @@
+from test import test_support as support
+import unittest
+import __builtin__ as builtins
+import rlcompleter
+
+class CompleteMe(object):
+ """ Trivial class used in testing rlcompleter.Completer. """
+ spam = 1
+
+
+class TestRlcompleter(unittest.TestCase):
+ def setUp(self):
+ self.stdcompleter = rlcompleter.Completer()
+ self.completer = rlcompleter.Completer(dict(spam=int,
+ egg=str,
+ CompleteMe=CompleteMe))
+
+ # forces stdcompleter to bind builtins namespace
+ self.stdcompleter.complete('', 0)
+
+ def test_namespace(self):
+ class A(dict):
+ pass
+ class B(list):
+ pass
+
+ self.assertTrue(self.stdcompleter.use_main_ns)
+ self.assertFalse(self.completer.use_main_ns)
+ self.assertFalse(rlcompleter.Completer(A()).use_main_ns)
+ self.assertRaises(TypeError, rlcompleter.Completer, B((1,)))
+
+ def test_global_matches(self):
+ # test with builtins namespace
+ self.assertEqual(sorted(self.stdcompleter.global_matches('di')),
+ [x+'(' for x in dir(builtins) if x.startswith('di')])
+ self.assertEqual(sorted(self.stdcompleter.global_matches('st')),
+ [x+'(' for x in dir(builtins) if x.startswith('st')])
+ self.assertEqual(self.stdcompleter.global_matches('akaksajadhak'), [])
+
+ # test with a customized namespace
+ self.assertEqual(self.completer.global_matches('CompleteM'),
+ ['CompleteMe('])
+ self.assertEqual(self.completer.global_matches('eg'),
+ ['egg('])
+ # XXX: see issue5256
+ self.assertEqual(self.completer.global_matches('CompleteM'),
+ ['CompleteMe('])
+
+ def test_attr_matches(self):
+ # test with builtins namespace
+ self.assertEqual(self.stdcompleter.attr_matches('str.s'),
+ ['str.{}('.format(x) for x in dir(str)
+ if x.startswith('s')])
+ self.assertEqual(self.stdcompleter.attr_matches('tuple.foospamegg'), [])
+
+ # test with a customized namespace
+ self.assertEqual(self.completer.attr_matches('CompleteMe.sp'),
+ ['CompleteMe.spam'])
+ self.assertEqual(self.completer.attr_matches('Completeme.egg'), [])
+
+ CompleteMe.me = CompleteMe
+ self.assertEqual(self.completer.attr_matches('CompleteMe.me.me.sp'),
+ ['CompleteMe.me.me.spam'])
+ self.assertEqual(self.completer.attr_matches('egg.s'),
+ ['egg.{}('.format(x) for x in dir(str)
+ if x.startswith('s')])
+
+def test_main():
+ support.run_unittest(TestRlcompleter)
+
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py
index 650b603fdb..3376a8a3cb 100644
--- a/Lib/test/test_robotparser.py
+++ b/Lib/test/test_robotparser.py
@@ -20,9 +20,9 @@ class RobotTestCase(unittest.TestCase):
url = self.url
agent = self.agent
if self.good:
- self.failUnless(self.parser.can_fetch(agent, url))
+ self.assertTrue(self.parser.can_fetch(agent, url))
else:
- self.failIf(self.parser.can_fetch(agent, url))
+ self.assertFalse(self.parser.can_fetch(agent, url))
def __str__(self):
return self.str
@@ -202,7 +202,18 @@ bad = ['/folder1/anotherfile.html']
RobotTest(13, doc, good, bad, agent="googlebot")
-# 14. For issue #4108 (obey first * entry)
+# 14. For issue #6325 (query string support)
+doc = """
+User-agent: *
+Disallow: /some/path?name=value
+"""
+
+good = ['/some/path']
+bad = ['/some/path?name=value']
+
+RobotTest(14, doc, good, bad)
+
+# 15. For issue #4108 (obey first * entry)
doc = """
User-agent: *
Disallow: /some/path
@@ -214,22 +225,36 @@ Disallow: /another/path
good = ['/another/path']
bad = ['/some/path']
-RobotTest(14, doc, good, bad)
+RobotTest(15, doc, good, bad)
-class TestCase(unittest.TestCase):
- def runTest(self):
+class NetworkTestCase(unittest.TestCase):
+
+ def testPasswordProtectedSite(self):
+ test_support.requires('network')
+ with test_support.transient_internet('mueblesmoraleda.com'):
+ url = 'http://mueblesmoraleda.com'
+ parser = robotparser.RobotFileParser()
+ parser.set_url(url)
+ try:
+ parser.read()
+ except IOError:
+ self.skipTest('%s is unavailable' % url)
+ self.assertEqual(parser.can_fetch("*", url+"/robots.txt"), False)
+
+ def testPythonOrg(self):
test_support.requires('network')
- # whole site is password-protected.
- url = 'http://mueblesmoraleda.com'
- parser = robotparser.RobotFileParser()
- parser.set_url(url)
- parser.read()
- self.assertEqual(parser.can_fetch("*", url+"/robots.txt"), False)
+ with test_support.transient_internet('www.python.org'):
+ parser = robotparser.RobotFileParser(
+ "http://www.python.org/robots.txt")
+ parser.read()
+ self.assertTrue(
+ parser.can_fetch("*", "http://www.python.org/robots.txt"))
+
def test_main():
test_support.run_unittest(tests)
- TestCase().run()
+ test_support.run_unittest(NetworkTestCase)
if __name__=='__main__':
test_support.verbose = 1
diff --git a/Lib/test/test_runpy.py b/Lib/test/test_runpy.py
index 165cb63df5..dbcb23d330 100644
--- a/Lib/test/test_runpy.py
+++ b/Lib/test/test_runpy.py
@@ -3,10 +3,14 @@ import unittest
import os
import os.path
import sys
+import re
import tempfile
from test.test_support import verbose, run_unittest, forget
-from runpy import _run_code, _run_module_code, run_module
+from test.script_helper import (temp_dir, make_script, compile_script,
+ make_pkg, make_zip_script, make_zip_pkg)
+
+from runpy import _run_code, _run_module_code, run_module, run_path
# Note: This module can't safely test _run_module_as_main as it
# runs its tests in the current process, which would mess with the
# real __main__ module (usually test.regrtest)
@@ -15,6 +19,7 @@ from runpy import _run_code, _run_module_code, run_module
# Set up the test code and expected results
class RunModuleCodeTest(unittest.TestCase):
+ """Unit tests for runpy._run_code and runpy._run_module_code"""
expected_result = ["Top level assignment", "Lower level reference"]
test_source = (
@@ -37,14 +42,14 @@ class RunModuleCodeTest(unittest.TestCase):
def test_run_code(self):
saved_argv0 = sys.argv[0]
d = _run_code(self.test_source, {})
- self.failUnless(d["result"] == self.expected_result)
- self.failUnless(d["__name__"] is None)
- self.failUnless(d["__file__"] is None)
- self.failUnless(d["__loader__"] is None)
- self.failUnless(d["__package__"] is None)
- self.failUnless(d["run_argv0"] is saved_argv0)
- self.failUnless("run_name" not in d)
- self.failUnless(sys.argv[0] is saved_argv0)
+ self.assertEqual(d["result"], self.expected_result)
+ self.assertIs(d["__name__"], None)
+ self.assertIs(d["__file__"], None)
+ self.assertIs(d["__loader__"], None)
+ self.assertIs(d["__package__"], None)
+ self.assertIs(d["run_argv0"], saved_argv0)
+ self.assertNotIn("run_name", d)
+ self.assertIs(sys.argv[0], saved_argv0)
def test_run_module_code(self):
initial = object()
@@ -60,22 +65,23 @@ class RunModuleCodeTest(unittest.TestCase):
file,
loader,
package)
- self.failUnless("result" not in d1)
- self.failUnless(d2["initial"] is initial)
- self.failUnless(d2["result"] == self.expected_result)
- self.failUnless(d2["nested"]["x"] == 1)
- self.failUnless(d2["__name__"] is name)
- self.failUnless(d2["run_name_in_sys_modules"])
- self.failUnless(d2["module_in_sys_modules"])
- self.failUnless(d2["__file__"] is file)
- self.failUnless(d2["run_argv0"] is file)
- self.failUnless(d2["__loader__"] is loader)
- self.failUnless(d2["__package__"] is package)
- self.failUnless(sys.argv[0] is saved_argv0)
- self.failUnless(name not in sys.modules)
+ self.assertNotIn("result", d1)
+ self.assertIs(d2["initial"], initial)
+ self.assertEqual(d2["result"], self.expected_result)
+ self.assertEqual(d2["nested"]["x"], 1)
+ self.assertIs(d2["__name__"], name)
+ self.assertTrue(d2["run_name_in_sys_modules"])
+ self.assertTrue(d2["module_in_sys_modules"])
+ self.assertIs(d2["__file__"], file)
+ self.assertIs(d2["run_argv0"], file)
+ self.assertIs(d2["__loader__"], loader)
+ self.assertIs(d2["__package__"], package)
+ self.assertIs(sys.argv[0], saved_argv0)
+ self.assertNotIn(name, sys.modules)
class RunModuleTest(unittest.TestCase):
+ """Unit tests for runpy.run_module"""
def expect_import_error(self, mod_name):
try:
@@ -94,8 +100,8 @@ class RunModuleTest(unittest.TestCase):
self.expect_import_error("a.bee")
self.expect_import_error(".howard")
self.expect_import_error("..eaten")
- # Package
- self.expect_import_error("logging")
+ # Package without __main__.py
+ self.expect_import_error("multiprocessing")
def test_library_module(self):
run_module("runpy")
@@ -107,9 +113,9 @@ class RunModuleTest(unittest.TestCase):
pkg_file.close()
return pkg_fname
- def _make_pkg(self, source, depth):
+ def _make_pkg(self, source, depth, mod_base="runpy_test"):
pkg_name = "__runpy_pkg__"
- test_fname = "runpy_test"+os.extsep+"py"
+ test_fname = mod_base+os.extsep+"py"
pkg_dir = sub_dir = tempfile.mkdtemp()
if verbose: print " Package tree in:", sub_dir
sys.path.insert(0, pkg_dir)
@@ -124,7 +130,7 @@ class RunModuleTest(unittest.TestCase):
mod_file.write(source)
mod_file.close()
if verbose: print " Created:", mod_fname
- mod_name = (pkg_name+".")*depth + "runpy_test"
+ mod_name = (pkg_name+".")*depth + mod_base
return pkg_dir, mod_fname, mod_name
def _del_pkg(self, top, depth, mod_name):
@@ -159,20 +165,42 @@ class RunModuleTest(unittest.TestCase):
try:
if verbose: print "Running from source:", mod_name
d1 = run_module(mod_name) # Read from source
- self.failUnless("x" in d1)
- self.failUnless(d1["x"] == 1)
+ self.assertIn("x", d1)
+ self.assertTrue(d1["x"] == 1)
del d1 # Ensure __loader__ entry doesn't keep file open
__import__(mod_name)
os.remove(mod_fname)
if verbose: print "Running from compiled:", mod_name
d2 = run_module(mod_name) # Read from bytecode
- self.failUnless("x" in d2)
- self.failUnless(d2["x"] == 1)
+ self.assertIn("x", d2)
+ self.assertTrue(d2["x"] == 1)
del d2 # Ensure __loader__ entry doesn't keep file open
finally:
self._del_pkg(pkg_dir, depth, mod_name)
if verbose: print "Module executed successfully"
+ def _check_package(self, depth):
+ pkg_dir, mod_fname, mod_name = (
+ self._make_pkg("x=1\n", depth, "__main__"))
+ pkg_name, _, _ = mod_name.rpartition(".")
+ forget(mod_name)
+ try:
+ if verbose: print "Running from source:", pkg_name
+ d1 = run_module(pkg_name) # Read from source
+ self.assertIn("x", d1)
+ self.assertTrue(d1["x"] == 1)
+ del d1 # Ensure __loader__ entry doesn't keep file open
+ __import__(mod_name)
+ os.remove(mod_fname)
+ if verbose: print "Running from compiled:", pkg_name
+ d2 = run_module(pkg_name) # Read from bytecode
+ self.assertIn("x", d2)
+ self.assertTrue(d2["x"] == 1)
+ del d2 # Ensure __loader__ entry doesn't keep file open
+ finally:
+ self._del_pkg(pkg_dir, depth, pkg_name)
+ if verbose: print "Package executed successfully"
+
def _add_relative_modules(self, base_dir, source, depth):
if depth <= 1:
raise ValueError("Relative module test needs depth > 1")
@@ -211,19 +239,19 @@ from ..uncle.cousin import nephew
pkg_name = mod_name.rpartition('.')[0]
if verbose: print "Running from source:", mod_name
d1 = run_module(mod_name, run_name=run_name) # Read from source
- self.failUnless("__package__" in d1)
- self.failUnless(d1["__package__"] == pkg_name)
- self.failUnless("sibling" in d1)
- self.failUnless("nephew" in d1)
+ self.assertIn("__package__", d1)
+ self.assertTrue(d1["__package__"] == pkg_name)
+ self.assertIn("sibling", d1)
+ self.assertIn("nephew", d1)
del d1 # Ensure __loader__ entry doesn't keep file open
__import__(mod_name)
os.remove(mod_fname)
if verbose: print "Running from compiled:", mod_name
d2 = run_module(mod_name, run_name=run_name) # Read from bytecode
- self.failUnless("__package__" in d2)
- self.failUnless(d2["__package__"] == pkg_name)
- self.failUnless("sibling" in d2)
- self.failUnless("nephew" in d2)
+ self.assertIn("__package__", d2)
+ self.assertTrue(d2["__package__"] == pkg_name)
+ self.assertIn("sibling", d2)
+ self.assertIn("nephew", d2)
del d2 # Ensure __loader__ entry doesn't keep file open
finally:
self._del_pkg(pkg_dir, depth, mod_name)
@@ -234,6 +262,11 @@ from ..uncle.cousin import nephew
if verbose: print "Testing package depth:", depth
self._check_module(depth)
+ def test_run_package(self):
+ for depth in range(1, 4):
+ if verbose: print "Testing package depth:", depth
+ self._check_package(depth)
+
def test_explicit_relative_import(self):
for depth in range(2, 5):
if verbose: print "Testing relative imports at depth:", depth
@@ -245,9 +278,125 @@ from ..uncle.cousin import nephew
self._check_relative_imports(depth, "__main__")
+class RunPathTest(unittest.TestCase):
+ """Unit tests for runpy.run_path"""
+ # Based on corresponding tests in test_cmd_line_script
+
+ test_source = """\
+# Script may be run with optimisation enabled, so don't rely on assert
+# statements being executed
+def assertEqual(lhs, rhs):
+ if lhs != rhs:
+ raise AssertionError('%r != %r' % (lhs, rhs))
+def assertIs(lhs, rhs):
+ if lhs is not rhs:
+ raise AssertionError('%r is not %r' % (lhs, rhs))
+# Check basic code execution
+result = ['Top level assignment']
+def f():
+ result.append('Lower level reference')
+f()
+assertEqual(result, ['Top level assignment', 'Lower level reference'])
+# Check the sys module
+import sys
+assertIs(globals(), sys.modules[__name__].__dict__)
+argv0 = sys.argv[0]
+"""
+
+ def _make_test_script(self, script_dir, script_basename, source=None):
+ if source is None:
+ source = self.test_source
+ return make_script(script_dir, script_basename, source)
+
+ def _check_script(self, script_name, expected_name, expected_file,
+ expected_argv0, expected_package):
+ result = run_path(script_name)
+ self.assertEqual(result["__name__"], expected_name)
+ self.assertEqual(result["__file__"], expected_file)
+ self.assertIn("argv0", result)
+ self.assertEqual(result["argv0"], expected_argv0)
+ self.assertEqual(result["__package__"], expected_package)
+
+ def _check_import_error(self, script_name, msg):
+ msg = re.escape(msg)
+ self.assertRaisesRegexp(ImportError, msg, run_path, script_name)
+
+ def test_basic_script(self):
+ with temp_dir() as script_dir:
+ mod_name = 'script'
+ script_name = self._make_test_script(script_dir, mod_name)
+ self._check_script(script_name, "<run_path>", script_name,
+ script_name, None)
+
+ def test_script_compiled(self):
+ with temp_dir() as script_dir:
+ mod_name = 'script'
+ script_name = self._make_test_script(script_dir, mod_name)
+ compiled_name = compile_script(script_name)
+ os.remove(script_name)
+ self._check_script(compiled_name, "<run_path>", compiled_name,
+ compiled_name, None)
+
+ def test_directory(self):
+ with temp_dir() as script_dir:
+ mod_name = '__main__'
+ script_name = self._make_test_script(script_dir, mod_name)
+ self._check_script(script_dir, "<run_path>", script_name,
+ script_dir, '')
+
+ def test_directory_compiled(self):
+ with temp_dir() as script_dir:
+ mod_name = '__main__'
+ script_name = self._make_test_script(script_dir, mod_name)
+ compiled_name = compile_script(script_name)
+ os.remove(script_name)
+ self._check_script(script_dir, "<run_path>", compiled_name,
+ script_dir, '')
+
+ def test_directory_error(self):
+ with temp_dir() as script_dir:
+ mod_name = 'not_main'
+ script_name = self._make_test_script(script_dir, mod_name)
+ msg = "can't find '__main__' module in %r" % script_dir
+ self._check_import_error(script_dir, msg)
+
+ def test_zipfile(self):
+ with temp_dir() as script_dir:
+ mod_name = '__main__'
+ script_name = self._make_test_script(script_dir, mod_name)
+ zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name)
+ self._check_script(zip_name, "<run_path>", fname, zip_name, '')
+
+ def test_zipfile_compiled(self):
+ with temp_dir() as script_dir:
+ mod_name = '__main__'
+ script_name = self._make_test_script(script_dir, mod_name)
+ compiled_name = compile_script(script_name)
+ zip_name, fname = make_zip_script(script_dir, 'test_zip', compiled_name)
+ self._check_script(zip_name, "<run_path>", fname, zip_name, '')
+
+ def test_zipfile_error(self):
+ with temp_dir() as script_dir:
+ mod_name = 'not_main'
+ script_name = self._make_test_script(script_dir, mod_name)
+ zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name)
+ msg = "can't find '__main__' module in %r" % zip_name
+ self._check_import_error(zip_name, msg)
+
+ def test_main_recursion_error(self):
+ with temp_dir() as script_dir, temp_dir() as dummy_dir:
+ mod_name = '__main__'
+ source = ("import runpy\n"
+ "runpy.run_path(%r)\n") % dummy_dir
+ script_name = self._make_test_script(script_dir, mod_name, source)
+ zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name)
+ msg = "recursion depth exceeded"
+ self.assertRaisesRegexp(RuntimeError, msg, run_path, zip_name)
+
+
+
def test_main():
- run_unittest(RunModuleCodeTest)
- run_unittest(RunModuleTest)
+ run_unittest(RunModuleCodeTest, RunModuleTest, RunPathTest)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py
index c5829852f1..adb9305c60 100644
--- a/Lib/test/test_sax.py
+++ b/Lib/test/test_sax.py
@@ -1,4 +1,4 @@
-# regression test for SAX 2.0 -*- coding: iso-8859-1 -*-
+# regression test for SAX 2.0 -*- coding: utf-8 -*-
# $Id$
from xml.sax import make_parser, ContentHandler, \
@@ -11,11 +11,14 @@ except SAXReaderNotAvailable:
from xml.sax.saxutils import XMLGenerator, escape, unescape, quoteattr, \
XMLFilterBase
from xml.sax.expatreader import create_parser
+from xml.sax.handler import feature_namespaces
from xml.sax.xmlreader import InputSource, AttributesImpl, AttributesNSImpl
from cStringIO import StringIO
from test.test_support import findfile, run_unittest
import unittest
-import os
+
+TEST_XMLFILE = findfile("test.xml", subdir="xmltestdata")
+TEST_XMLFILE_OUT = findfile("test.xml.out", subdir="xmltestdata")
ns_uri = "http://www.python.org/xml-ns/saxtest/"
@@ -26,16 +29,16 @@ class XmlTestBase(unittest.TestCase):
self.assertRaises(KeyError, attrs.getNameByQName, "attr")
self.assertRaises(KeyError, attrs.getQNameByName, "attr")
self.assertRaises(KeyError, attrs.__getitem__, "attr")
- self.assertEquals(attrs.getLength(), 0)
- self.assertEquals(attrs.getNames(), [])
- self.assertEquals(attrs.getQNames(), [])
- self.assertEquals(len(attrs), 0)
+ self.assertEqual(attrs.getLength(), 0)
+ self.assertEqual(attrs.getNames(), [])
+ self.assertEqual(attrs.getQNames(), [])
+ self.assertEqual(len(attrs), 0)
self.assertFalse(attrs.has_key("attr"))
- self.assertEquals(attrs.keys(), [])
- self.assertEquals(attrs.get("attrs"), None)
- self.assertEquals(attrs.get("attrs", 25), 25)
- self.assertEquals(attrs.items(), [])
- self.assertEquals(attrs.values(), [])
+ self.assertEqual(attrs.keys(), [])
+ self.assertEqual(attrs.get("attrs"), None)
+ self.assertEqual(attrs.get("attrs", 25), 25)
+ self.assertEqual(attrs.items(), [])
+ self.assertEqual(attrs.values(), [])
def verify_empty_nsattrs(self, attrs):
self.assertRaises(KeyError, attrs.getValue, (ns_uri, "attr"))
@@ -43,33 +46,33 @@ class XmlTestBase(unittest.TestCase):
self.assertRaises(KeyError, attrs.getNameByQName, "ns:attr")
self.assertRaises(KeyError, attrs.getQNameByName, (ns_uri, "attr"))
self.assertRaises(KeyError, attrs.__getitem__, (ns_uri, "attr"))
- self.assertEquals(attrs.getLength(), 0)
- self.assertEquals(attrs.getNames(), [])
- self.assertEquals(attrs.getQNames(), [])
- self.assertEquals(len(attrs), 0)
+ self.assertEqual(attrs.getLength(), 0)
+ self.assertEqual(attrs.getNames(), [])
+ self.assertEqual(attrs.getQNames(), [])
+ self.assertEqual(len(attrs), 0)
self.assertFalse(attrs.has_key((ns_uri, "attr")))
- self.assertEquals(attrs.keys(), [])
- self.assertEquals(attrs.get((ns_uri, "attr")), None)
- self.assertEquals(attrs.get((ns_uri, "attr"), 25), 25)
- self.assertEquals(attrs.items(), [])
- self.assertEquals(attrs.values(), [])
+ self.assertEqual(attrs.keys(), [])
+ self.assertEqual(attrs.get((ns_uri, "attr")), None)
+ self.assertEqual(attrs.get((ns_uri, "attr"), 25), 25)
+ self.assertEqual(attrs.items(), [])
+ self.assertEqual(attrs.values(), [])
def verify_attrs_wattr(self, attrs):
- self.assertEquals(attrs.getLength(), 1)
- self.assertEquals(attrs.getNames(), ["attr"])
- self.assertEquals(attrs.getQNames(), ["attr"])
- self.assertEquals(len(attrs), 1)
+ self.assertEqual(attrs.getLength(), 1)
+ self.assertEqual(attrs.getNames(), ["attr"])
+ self.assertEqual(attrs.getQNames(), ["attr"])
+ self.assertEqual(len(attrs), 1)
self.assertTrue(attrs.has_key("attr"))
- self.assertEquals(attrs.keys(), ["attr"])
- self.assertEquals(attrs.get("attr"), "val")
- self.assertEquals(attrs.get("attr", 25), "val")
- self.assertEquals(attrs.items(), [("attr", "val")])
- self.assertEquals(attrs.values(), ["val"])
- self.assertEquals(attrs.getValue("attr"), "val")
- self.assertEquals(attrs.getValueByQName("attr"), "val")
- self.assertEquals(attrs.getNameByQName("attr"), "attr")
- self.assertEquals(attrs["attr"], "val")
- self.assertEquals(attrs.getQNameByName("attr"), "attr")
+ self.assertEqual(attrs.keys(), ["attr"])
+ self.assertEqual(attrs.get("attr"), "val")
+ self.assertEqual(attrs.get("attr", 25), "val")
+ self.assertEqual(attrs.items(), [("attr", "val")])
+ self.assertEqual(attrs.values(), ["val"])
+ self.assertEqual(attrs.getValue("attr"), "val")
+ self.assertEqual(attrs.getValueByQName("attr"), "val")
+ self.assertEqual(attrs.getNameByQName("attr"), "attr")
+ self.assertEqual(attrs["attr"], "val")
+ self.assertEqual(attrs.getQNameByName("attr"), "attr")
class MakeParserTest(unittest.TestCase):
def test_make_parser2(self):
@@ -99,47 +102,47 @@ class MakeParserTest(unittest.TestCase):
class SaxutilsTest(unittest.TestCase):
# ===== escape
def test_escape_basic(self):
- self.assertEquals(escape("Donald Duck & Co"), "Donald Duck &amp; Co")
+ self.assertEqual(escape("Donald Duck & Co"), "Donald Duck &amp; Co")
def test_escape_all(self):
- self.assertEquals(escape("<Donald Duck & Co>"),
- "&lt;Donald Duck &amp; Co&gt;")
+ self.assertEqual(escape("<Donald Duck & Co>"),
+ "&lt;Donald Duck &amp; Co&gt;")
def test_escape_extra(self):
- self.assertEquals(escape("Hei på deg", {"å" : "&aring;"}),
- "Hei p&aring; deg")
+ self.assertEqual(escape("Hei på deg", {"å" : "&aring;"}),
+ "Hei p&aring; deg")
# ===== unescape
def test_unescape_basic(self):
- self.assertEquals(unescape("Donald Duck &amp; Co"), "Donald Duck & Co")
+ self.assertEqual(unescape("Donald Duck &amp; Co"), "Donald Duck & Co")
def test_unescape_all(self):
- self.assertEquals(unescape("&lt;Donald Duck &amp; Co&gt;"),
- "<Donald Duck & Co>")
+ self.assertEqual(unescape("&lt;Donald Duck &amp; Co&gt;"),
+ "<Donald Duck & Co>")
def test_unescape_extra(self):
- self.assertEquals(unescape("Hei på deg", {"å" : "&aring;"}),
- "Hei p&aring; deg")
+ self.assertEqual(unescape("Hei på deg", {"å" : "&aring;"}),
+ "Hei p&aring; deg")
def test_unescape_amp_extra(self):
- self.assertEquals(unescape("&amp;foo;", {"&foo;": "splat"}), "&foo;")
+ self.assertEqual(unescape("&amp;foo;", {"&foo;": "splat"}), "&foo;")
# ===== quoteattr
def test_quoteattr_basic(self):
- self.assertEquals(quoteattr("Donald Duck & Co"),
- '"Donald Duck &amp; Co"')
+ self.assertEqual(quoteattr("Donald Duck & Co"),
+ '"Donald Duck &amp; Co"')
def test_single_quoteattr(self):
- self.assertEquals(quoteattr('Includes "double" quotes'),
- '\'Includes "double" quotes\'')
+ self.assertEqual(quoteattr('Includes "double" quotes'),
+ '\'Includes "double" quotes\'')
def test_double_quoteattr(self):
- self.assertEquals(quoteattr("Includes 'single' quotes"),
- "\"Includes 'single' quotes\"")
+ self.assertEqual(quoteattr("Includes 'single' quotes"),
+ "\"Includes 'single' quotes\"")
def test_single_double_quoteattr(self):
- self.assertEquals(quoteattr("Includes 'single' and \"double\" quotes"),
- "\"Includes 'single' and &quot;double&quot; quotes\"")
+ self.assertEqual(quoteattr("Includes 'single' and \"double\" quotes"),
+ "\"Includes 'single' and &quot;double&quot; quotes\"")
# ===== make_parser
def test_make_parser(self):
@@ -161,7 +164,7 @@ class XmlgenTest(unittest.TestCase):
gen.endElement("doc")
gen.endDocument()
- self.assertEquals(result.getvalue(), start + "<doc></doc>")
+ self.assertEqual(result.getvalue(), start + "<doc></doc>")
def test_xmlgen_content(self):
result = StringIO()
@@ -173,7 +176,7 @@ class XmlgenTest(unittest.TestCase):
gen.endElement("doc")
gen.endDocument()
- self.assertEquals(result.getvalue(), start + "<doc>huhei</doc>")
+ self.assertEqual(result.getvalue(), start + "<doc>huhei</doc>")
def test_xmlgen_pi(self):
result = StringIO()
@@ -185,7 +188,7 @@ class XmlgenTest(unittest.TestCase):
gen.endElement("doc")
gen.endDocument()
- self.assertEquals(result.getvalue(), start + "<?test data?><doc></doc>")
+ self.assertEqual(result.getvalue(), start + "<?test data?><doc></doc>")
def test_xmlgen_content_escape(self):
result = StringIO()
@@ -197,7 +200,7 @@ class XmlgenTest(unittest.TestCase):
gen.endElement("doc")
gen.endDocument()
- self.assertEquals(result.getvalue(),
+ self.assertEqual(result.getvalue(),
start + "<doc>&lt;huhei&amp;</doc>")
def test_xmlgen_attr_escape(self):
@@ -215,7 +218,7 @@ class XmlgenTest(unittest.TestCase):
gen.endElement("doc")
gen.endDocument()
- self.assertEquals(result.getvalue(), start +
+ self.assertEqual(result.getvalue(), start +
("<doc a='\"'><e a=\"'\"></e>"
"<e a=\"'&quot;\"></e>"
"<e a=\"&#10;&#13;&#9;\"></e></doc>"))
@@ -230,7 +233,7 @@ class XmlgenTest(unittest.TestCase):
gen.endElement("doc")
gen.endDocument()
- self.assertEquals(result.getvalue(), start + "<doc> </doc>")
+ self.assertEqual(result.getvalue(), start + "<doc> </doc>")
def test_xmlgen_ns(self):
result = StringIO()
@@ -246,7 +249,7 @@ class XmlgenTest(unittest.TestCase):
gen.endPrefixMapping("ns1")
gen.endDocument()
- self.assertEquals(result.getvalue(), start + \
+ self.assertEqual(result.getvalue(), start + \
('<ns1:doc xmlns:ns1="%s"><udoc></udoc></ns1:doc>' %
ns_uri))
@@ -259,7 +262,7 @@ class XmlgenTest(unittest.TestCase):
gen.endElementNS((None, 'a'), 'a')
gen.endDocument()
- self.assertEquals(result.getvalue(), start+'<a b="c"></a>')
+ self.assertEqual(result.getvalue(), start+'<a b="c"></a>')
def test_1463026_2(self):
result = StringIO()
@@ -272,7 +275,7 @@ class XmlgenTest(unittest.TestCase):
gen.endPrefixMapping(None)
gen.endDocument()
- self.assertEquals(result.getvalue(), start+'<a xmlns="qux"></a>')
+ self.assertEqual(result.getvalue(), start+'<a xmlns="qux"></a>')
def test_1463026_3(self):
result = StringIO()
@@ -285,9 +288,63 @@ class XmlgenTest(unittest.TestCase):
gen.endPrefixMapping('my')
gen.endDocument()
- self.assertEquals(result.getvalue(),
+ self.assertEqual(result.getvalue(),
start+'<my:a xmlns:my="qux" b="c"></my:a>')
+ def test_5027_1(self):
+ # The xml prefix (as in xml:lang below) is reserved and bound by
+ # definition to http://www.w3.org/XML/1998/namespace. XMLGenerator had
+ # a bug whereby a KeyError is thrown because this namespace is missing
+ # from a dictionary.
+ #
+ # This test demonstrates the bug by parsing a document.
+ test_xml = StringIO(
+ '<?xml version="1.0"?>'
+ '<a:g1 xmlns:a="http://example.com/ns">'
+ '<a:g2 xml:lang="en">Hello</a:g2>'
+ '</a:g1>')
+
+ parser = make_parser()
+ parser.setFeature(feature_namespaces, True)
+ result = StringIO()
+ gen = XMLGenerator(result)
+ parser.setContentHandler(gen)
+ parser.parse(test_xml)
+
+ self.assertEqual(result.getvalue(),
+ start + (
+ '<a:g1 xmlns:a="http://example.com/ns">'
+ '<a:g2 xml:lang="en">Hello</a:g2>'
+ '</a:g1>'))
+
+ def test_5027_2(self):
+ # The xml prefix (as in xml:lang below) is reserved and bound by
+ # definition to http://www.w3.org/XML/1998/namespace. XMLGenerator had
+ # a bug whereby a KeyError is thrown because this namespace is missing
+ # from a dictionary.
+ #
+ # This test demonstrates the bug by direct manipulation of the
+ # XMLGenerator.
+ result = StringIO()
+ gen = XMLGenerator(result)
+
+ gen.startDocument()
+ gen.startPrefixMapping('a', 'http://example.com/ns')
+ gen.startElementNS(('http://example.com/ns', 'g1'), 'g1', {})
+ lang_attr = {('http://www.w3.org/XML/1998/namespace', 'lang'): 'en'}
+ gen.startElementNS(('http://example.com/ns', 'g2'), 'g2', lang_attr)
+ gen.characters('Hello')
+ gen.endElementNS(('http://example.com/ns', 'g2'), 'g2')
+ gen.endElementNS(('http://example.com/ns', 'g1'), 'g1')
+ gen.endPrefixMapping('a')
+ gen.endDocument()
+
+ self.assertEqual(result.getvalue(),
+ start + (
+ '<a:g1 xmlns:a="http://example.com/ns">'
+ '<a:g2 xml:lang="en">Hello</a:g2>'
+ '</a:g1>'))
+
class XMLFilterBaseTest(unittest.TestCase):
def test_filter_basic(self):
@@ -303,7 +360,7 @@ class XMLFilterBaseTest(unittest.TestCase):
filter.endElement("doc")
filter.endDocument()
- self.assertEquals(result.getvalue(), start + "<doc>content </doc>")
+ self.assertEqual(result.getvalue(), start + "<doc>content </doc>")
# ===========================================================================
#
@@ -311,7 +368,7 @@ class XMLFilterBaseTest(unittest.TestCase):
#
# ===========================================================================
-xml_test_out = open(findfile("test"+os.extsep+"xml"+os.extsep+"out")).read()
+xml_test_out = open(TEST_XMLFILE_OUT).read()
class ExpatReaderTest(XmlTestBase):
@@ -323,9 +380,9 @@ class ExpatReaderTest(XmlTestBase):
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
- parser.parse(open(findfile("test"+os.extsep+"xml")))
+ parser.parse(open(TEST_XMLFILE))
- self.assertEquals(result.getvalue(), xml_test_out)
+ self.assertEqual(result.getvalue(), xml_test_out)
# ===== DTDHandler support
@@ -353,9 +410,9 @@ class ExpatReaderTest(XmlTestBase):
parser.feed('<doc></doc>')
parser.close()
- self.assertEquals(handler._notations,
+ self.assertEqual(handler._notations,
[("GIF", "-//CompuServe//NOTATION Graphics Interchange Format 89a//EN", None)])
- self.assertEquals(handler._entities, [("img", None, "expat.gif", "GIF")])
+ self.assertEqual(handler._entities, [("img", None, "expat.gif", "GIF")])
# ===== EntityResolver support
@@ -378,8 +435,8 @@ class ExpatReaderTest(XmlTestBase):
parser.feed('<doc>&test;</doc>')
parser.close()
- self.assertEquals(result.getvalue(), start +
- "<doc><entity></entity></doc>")
+ self.assertEqual(result.getvalue(), start +
+ "<doc><entity></entity></doc>")
# ===== Attributes support
@@ -431,18 +488,18 @@ class ExpatReaderTest(XmlTestBase):
attrs = gather._attrs
- self.assertEquals(attrs.getLength(), 1)
- self.assertEquals(attrs.getNames(), [(ns_uri, "attr")])
+ self.assertEqual(attrs.getLength(), 1)
+ self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
self.assertTrue((attrs.getQNames() == [] or
attrs.getQNames() == ["ns:attr"]))
- self.assertEquals(len(attrs), 1)
+ self.assertEqual(len(attrs), 1)
self.assertTrue(attrs.has_key((ns_uri, "attr")))
- self.assertEquals(attrs.get((ns_uri, "attr")), "val")
- self.assertEquals(attrs.get((ns_uri, "attr"), 25), "val")
- self.assertEquals(attrs.items(), [((ns_uri, "attr"), "val")])
- self.assertEquals(attrs.values(), ["val"])
- self.assertEquals(attrs.getValue((ns_uri, "attr")), "val")
- self.assertEquals(attrs[(ns_uri, "attr")], "val")
+ self.assertEqual(attrs.get((ns_uri, "attr")), "val")
+ self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
+ self.assertEqual(attrs.items(), [((ns_uri, "attr"), "val")])
+ self.assertEqual(attrs.values(), ["val"])
+ self.assertEqual(attrs.getValue((ns_uri, "attr")), "val")
+ self.assertEqual(attrs[(ns_uri, "attr")], "val")
# ===== InputSource support
@@ -452,9 +509,9 @@ class ExpatReaderTest(XmlTestBase):
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
- parser.parse(findfile("test"+os.extsep+"xml"))
+ parser.parse(TEST_XMLFILE)
- self.assertEquals(result.getvalue(), xml_test_out)
+ self.assertEqual(result.getvalue(), xml_test_out)
def test_expat_inpsource_sysid(self):
parser = create_parser()
@@ -462,9 +519,9 @@ class ExpatReaderTest(XmlTestBase):
xmlgen = XMLGenerator(result)
parser.setContentHandler(xmlgen)
- parser.parse(InputSource(findfile("test"+os.extsep+"xml")))
+ parser.parse(InputSource(TEST_XMLFILE))
- self.assertEquals(result.getvalue(), xml_test_out)
+ self.assertEqual(result.getvalue(), xml_test_out)
def test_expat_inpsource_stream(self):
parser = create_parser()
@@ -473,10 +530,10 @@ class ExpatReaderTest(XmlTestBase):
parser.setContentHandler(xmlgen)
inpsrc = InputSource()
- inpsrc.setByteStream(open(findfile("test"+os.extsep+"xml")))
+ inpsrc.setByteStream(open(TEST_XMLFILE))
parser.parse(inpsrc)
- self.assertEquals(result.getvalue(), xml_test_out)
+ self.assertEqual(result.getvalue(), xml_test_out)
# ===== IncrementalParser support
@@ -490,7 +547,7 @@ class ExpatReaderTest(XmlTestBase):
parser.feed("</doc>")
parser.close()
- self.assertEquals(result.getvalue(), start + "<doc></doc>")
+ self.assertEqual(result.getvalue(), start + "<doc></doc>")
def test_expat_incremental_reset(self):
result = StringIO()
@@ -511,7 +568,7 @@ class ExpatReaderTest(XmlTestBase):
parser.feed("</doc>")
parser.close()
- self.assertEquals(result.getvalue(), start + "<doc>text</doc>")
+ self.assertEqual(result.getvalue(), start + "<doc>text</doc>")
# ===== Locator support
@@ -525,19 +582,19 @@ class ExpatReaderTest(XmlTestBase):
parser.feed("</doc>")
parser.close()
- self.assertEquals(parser.getSystemId(), None)
- self.assertEquals(parser.getPublicId(), None)
- self.assertEquals(parser.getLineNumber(), 1)
+ self.assertEqual(parser.getSystemId(), None)
+ self.assertEqual(parser.getPublicId(), None)
+ self.assertEqual(parser.getLineNumber(), 1)
def test_expat_locator_withinfo(self):
result = StringIO()
xmlgen = XMLGenerator(result)
parser = create_parser()
parser.setContentHandler(xmlgen)
- parser.parse(findfile("test.xml"))
+ parser.parse(TEST_XMLFILE)
- self.assertEquals(parser.getSystemId(), findfile("test.xml"))
- self.assertEquals(parser.getPublicId(), None)
+ self.assertEqual(parser.getSystemId(), TEST_XMLFILE)
+ self.assertEqual(parser.getPublicId(), None)
# ===========================================================================
@@ -558,7 +615,7 @@ class ErrorReportingTest(unittest.TestCase):
parser.parse(source)
self.fail()
except SAXException, e:
- self.assertEquals(e.getSystemId(), name)
+ self.assertEqual(e.getSystemId(), name)
def test_expat_incomplete(self):
parser = create_parser()
@@ -622,21 +679,21 @@ class XmlReaderTest(XmlTestBase):
attrs = AttributesNSImpl({(ns_uri, "attr") : "val"},
{(ns_uri, "attr") : "ns:attr"})
- self.assertEquals(attrs.getLength(), 1)
- self.assertEquals(attrs.getNames(), [(ns_uri, "attr")])
- self.assertEquals(attrs.getQNames(), ["ns:attr"])
- self.assertEquals(len(attrs), 1)
+ self.assertEqual(attrs.getLength(), 1)
+ self.assertEqual(attrs.getNames(), [(ns_uri, "attr")])
+ self.assertEqual(attrs.getQNames(), ["ns:attr"])
+ self.assertEqual(len(attrs), 1)
self.assertTrue(attrs.has_key((ns_uri, "attr")))
- self.assertEquals(attrs.keys(), [(ns_uri, "attr")])
- self.assertEquals(attrs.get((ns_uri, "attr")), "val")
- self.assertEquals(attrs.get((ns_uri, "attr"), 25), "val")
- self.assertEquals(attrs.items(), [((ns_uri, "attr"), "val")])
- self.assertEquals(attrs.values(), ["val"])
- self.assertEquals(attrs.getValue((ns_uri, "attr")), "val")
- self.assertEquals(attrs.getValueByQName("ns:attr"), "val")
- self.assertEquals(attrs.getNameByQName("ns:attr"), (ns_uri, "attr"))
- self.assertEquals(attrs[(ns_uri, "attr")], "val")
- self.assertEquals(attrs.getQNameByName((ns_uri, "attr")), "ns:attr")
+ self.assertEqual(attrs.keys(), [(ns_uri, "attr")])
+ self.assertEqual(attrs.get((ns_uri, "attr")), "val")
+ self.assertEqual(attrs.get((ns_uri, "attr"), 25), "val")
+ self.assertEqual(attrs.items(), [((ns_uri, "attr"), "val")])
+ self.assertEqual(attrs.values(), ["val"])
+ self.assertEqual(attrs.getValue((ns_uri, "attr")), "val")
+ self.assertEqual(attrs.getValueByQName("ns:attr"), "val")
+ self.assertEqual(attrs.getNameByQName("ns:attr"), (ns_uri, "attr"))
+ self.assertEqual(attrs[(ns_uri, "attr")], "val")
+ self.assertEqual(attrs.getQNameByName((ns_uri, "attr")), "ns:attr")
# During the development of Python 2.5, an attempt to move the "xml"
@@ -672,7 +729,7 @@ class XmlReaderTest(XmlTestBase):
try:
import xml.sax.expatreader
module = xml.sax.expatreader
- self.assertEquals(module.__name__, "xml.sax.expatreader")
+ self.assertEqual(module.__name__, "xml.sax.expatreader")
finally:
sys.modules.update(old_modules)
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index 169a727891..94583e192a 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -1,6 +1,6 @@
import unittest
-from test.test_support import (check_syntax_error, _check_py3k_warnings,
- check_warnings, run_unittest)
+from test.test_support import check_syntax_error, check_py3k_warnings, \
+ check_warnings, run_unittest
class ScopeTests(unittest.TestCase):
@@ -287,19 +287,8 @@ def noproblem3():
inner()
y = 1
- try:
- errorInOuter()
- except UnboundLocalError:
- pass
- else:
- self.fail()
-
- try:
- errorInInner()
- except NameError:
- pass
- else:
- self.fail()
+ self.assertRaises(UnboundLocalError, errorInOuter)
+ self.assertRaises(NameError, errorInInner)
# test for bug #1501934: incorrect LOAD/STORE_GLOBAL generation
exec """
@@ -330,7 +319,7 @@ else:
self.assertEqual(makeReturner2(a=11)()['a'], 11)
- with _check_py3k_warnings(("tuple parameter unpacking has been removed",
+ with check_py3k_warnings(("tuple parameter unpacking has been removed",
SyntaxWarning)):
exec """\
def makeAddPair((a, b)):
@@ -468,7 +457,7 @@ class X:
locals()['looked_up_by_load_name'] = True
passed = looked_up_by_load_name
-self.assert_(X.passed)
+self.assertTrue(X.passed)
"""
def testLocalsFunction(self):
@@ -483,7 +472,7 @@ self.assert_(X.passed)
return g
d = f(2)(4)
- self.assertTrue('h' in d)
+ self.assertIn('h', d)
del d['h']
self.assertEqual(d, {'x': 2, 'y': 7, 'w': 6})
@@ -517,8 +506,8 @@ self.assert_(X.passed)
return C
varnames = f(1).z
- self.assert_("x" not in varnames)
- self.assert_("y" in varnames)
+ self.assertNotIn("x", varnames)
+ self.assertIn("y", varnames)
def testLocalsClass_WithTrace(self):
# Issue23728: after the trace function returns, the locals()
@@ -534,7 +523,7 @@ self.assert_(X.passed)
def f(self):
return x
- self.assertEquals(x, 12) # Used to raise UnboundLocalError
+ self.assertEqual(x, 12) # Used to raise UnboundLocalError
finally:
sys.settrace(None)
@@ -658,6 +647,13 @@ result2 = h()
self.assertEqual(2, global_ns["result2"])
self.assertEqual(9, global_ns["result9"])
+ def testTopIsNotSignificant(self):
+ # See #9997.
+ def top(a):
+ pass
+ def b():
+ global a
+
def test_main():
with check_warnings(("import \* only allowed at module level",
diff --git a/Lib/test/test_scriptpackages.py b/Lib/test/test_scriptpackages.py
index ee14be2bb4..7e02fa02f5 100644
--- a/Lib/test/test_scriptpackages.py
+++ b/Lib/test/test_scriptpackages.py
@@ -2,7 +2,9 @@
import unittest
from test import test_support
-import aetools
+
+# Skip this test if aetools does not exist.
+test_support.import_module('aetools')
class TestScriptpackages(unittest.TestCase):
diff --git a/Lib/test/test_select.py b/Lib/test/test_select.py
index 6cfb96ada5..79b249bf41 100644
--- a/Lib/test/test_select.py
+++ b/Lib/test/test_select.py
@@ -4,6 +4,8 @@ import select
import os
import sys
+@unittest.skipIf(sys.platform[:3] in ('win', 'os2', 'riscos'),
+ "can't easily test on this system")
class SelectTestCase(unittest.TestCase):
class Nope:
@@ -20,21 +22,13 @@ class SelectTestCase(unittest.TestCase):
self.assertRaises(TypeError, select.select, [], [], [], "not a number")
def test_returned_list_identity(self):
- if sys.platform[:3] in ('win', 'mac', 'os2'):
- if test_support.verbose:
- print "can't easily test on this system"
- return
# See issue #8329
r, w, x = select.select([], [], [], 1)
- self.assertFalse(r is w)
- self.assertFalse(r is x)
- self.assertFalse(w is x)
+ self.assertIsNot(r, w)
+ self.assertIsNot(r, x)
+ self.assertIsNot(w, x)
def test_select(self):
- if sys.platform[:3] in ('win', 'mac', 'os2'):
- if test_support.verbose:
- print "can't easily test on this system"
- return
cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
p = os.popen(cmd, 'r')
for tout in (0, 1, 2, 4, 8, 16) + (None,)*10:
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 3539a14065..b8753a1206 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -6,7 +6,6 @@ import weakref
import operator
import copy
import pickle
-import os
from random import randrange, shuffle
import sys
import collections
@@ -66,7 +65,7 @@ class TestJointOps(unittest.TestCase):
self.assertEqual(c in self.s, c in self.d)
self.assertRaises(TypeError, self.s.__contains__, [[]])
s = self.thetype([frozenset(self.letters)])
- self.assert_(self.thetype(self.letters) in s)
+ self.assertIn(self.thetype(self.letters), s)
def test_union(self):
u = self.s.union(self.otherword)
@@ -130,7 +129,7 @@ class TestJointOps(unittest.TestCase):
actual = s1.isdisjoint(s2)
expected = f(s1, s2)
self.assertEqual(actual, expected)
- self.assert_(actual is True or actual is False)
+ self.assertTrue(actual is True or actual is False)
def test_and(self):
i = self.s.intersection(self.otherword)
@@ -213,19 +212,19 @@ class TestJointOps(unittest.TestCase):
def test_sub_and_super(self):
p, q, r = map(self.thetype, ['ab', 'abcde', 'def'])
- self.assert_(p < q)
- self.assert_(p <= q)
- self.assert_(q <= q)
- self.assert_(q > p)
- self.assert_(q >= p)
- self.failIf(q < r)
- self.failIf(q <= r)
- self.failIf(q > r)
- self.failIf(q >= r)
- self.assert_(set('a').issubset('abc'))
- self.assert_(set('abc').issuperset('a'))
- self.failIf(set('a').issubset('cbs'))
- self.failIf(set('cbs').issuperset('a'))
+ self.assertTrue(p < q)
+ self.assertTrue(p <= q)
+ self.assertTrue(q <= q)
+ self.assertTrue(q > p)
+ self.assertTrue(q >= p)
+ self.assertFalse(q < r)
+ self.assertFalse(q <= r)
+ self.assertFalse(q > r)
+ self.assertFalse(q >= r)
+ self.assertTrue(set('a').issubset('abc'))
+ self.assertTrue(set('abc').issuperset('a'))
+ self.assertFalse(set('a').issubset('cbs'))
+ self.assertFalse(set('cbs').issuperset('a'))
def test_pickling(self):
for i in range(pickle.HIGHEST_PROTOCOL + 1):
@@ -273,7 +272,7 @@ class TestJointOps(unittest.TestCase):
s=H()
f=set()
f.add(s)
- self.assert_(s in f)
+ self.assertIn(s, f)
f.remove(s)
f.add(s)
f.discard(s)
@@ -339,7 +338,7 @@ class TestJointOps(unittest.TestCase):
obj.x = iter(container)
del obj, container
gc.collect()
- self.assert_(ref() is None, "Cycle was not collected")
+ self.assertTrue(ref() is None, "Cycle was not collected")
class TestSet(TestJointOps):
thetype = set
@@ -373,7 +372,7 @@ class TestSet(TestJointOps):
def test_add(self):
self.s.add('Q')
- self.assert_('Q' in self.s)
+ self.assertIn('Q', self.s)
dup = self.s.copy()
self.s.add('Q')
self.assertEqual(self.s, dup)
@@ -381,13 +380,13 @@ class TestSet(TestJointOps):
def test_remove(self):
self.s.remove('a')
- self.assert_('a' not in self.s)
+ self.assertNotIn('a', self.s)
self.assertRaises(KeyError, self.s.remove, 'Q')
self.assertRaises(TypeError, self.s.remove, [])
s = self.thetype([frozenset(self.word)])
- self.assert_(self.thetype(self.word) in s)
+ self.assertIn(self.thetype(self.word), s)
s.remove(self.thetype(self.word))
- self.assert_(self.thetype(self.word) not in s)
+ self.assertNotIn(self.thetype(self.word), s)
self.assertRaises(KeyError, self.s.remove, self.thetype(self.word))
def test_remove_keyerror_unpacking(self):
@@ -406,7 +405,7 @@ class TestSet(TestJointOps):
try:
self.s.remove(key)
except KeyError as e:
- self.assert_(e.args[0] is key,
+ self.assertTrue(e.args[0] is key,
"KeyError should be {0}, not {1}".format(key,
e.args[0]))
else:
@@ -414,26 +413,26 @@ class TestSet(TestJointOps):
def test_discard(self):
self.s.discard('a')
- self.assert_('a' not in self.s)
+ self.assertNotIn('a', self.s)
self.s.discard('Q')
self.assertRaises(TypeError, self.s.discard, [])
s = self.thetype([frozenset(self.word)])
- self.assert_(self.thetype(self.word) in s)
+ self.assertIn(self.thetype(self.word), s)
s.discard(self.thetype(self.word))
- self.assert_(self.thetype(self.word) not in s)
+ self.assertNotIn(self.thetype(self.word), s)
s.discard(self.thetype(self.word))
def test_pop(self):
for i in xrange(len(self.s)):
elem = self.s.pop()
- self.assert_(elem not in self.s)
+ self.assertNotIn(elem, self.s)
self.assertRaises(KeyError, self.s.pop)
def test_update(self):
retval = self.s.update(self.otherword)
self.assertEqual(retval, None)
for c in (self.word + self.otherword):
- self.assert_(c in self.s)
+ self.assertIn(c, self.s)
self.assertRaises(PassThru, self.s.update, check_pass_thru())
self.assertRaises(TypeError, self.s.update, [[]])
for p, q in (('cdc', 'abcd'), ('efgfe', 'abcefg'), ('ccb', 'abc'), ('ef', 'abcef')):
@@ -451,16 +450,16 @@ class TestSet(TestJointOps):
def test_ior(self):
self.s |= set(self.otherword)
for c in (self.word + self.otherword):
- self.assert_(c in self.s)
+ self.assertIn(c, self.s)
def test_intersection_update(self):
retval = self.s.intersection_update(self.otherword)
self.assertEqual(retval, None)
for c in (self.word + self.otherword):
if c in self.otherword and c in self.word:
- self.assert_(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assert_(c not in self.s)
+ self.assertNotIn(c, self.s)
self.assertRaises(PassThru, self.s.intersection_update, check_pass_thru())
self.assertRaises(TypeError, self.s.intersection_update, [[]])
for p, q in (('cdc', 'c'), ('efgfe', ''), ('ccb', 'bc'), ('ef', '')):
@@ -478,18 +477,18 @@ class TestSet(TestJointOps):
self.s &= set(self.otherword)
for c in (self.word + self.otherword):
if c in self.otherword and c in self.word:
- self.assert_(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assert_(c not in self.s)
+ self.assertNotIn(c, self.s)
def test_difference_update(self):
retval = self.s.difference_update(self.otherword)
self.assertEqual(retval, None)
for c in (self.word + self.otherword):
if c in self.word and c not in self.otherword:
- self.assert_(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assert_(c not in self.s)
+ self.assertNotIn(c, self.s)
self.assertRaises(PassThru, self.s.difference_update, check_pass_thru())
self.assertRaises(TypeError, self.s.difference_update, [[]])
self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])
@@ -515,18 +514,18 @@ class TestSet(TestJointOps):
self.s -= set(self.otherword)
for c in (self.word + self.otherword):
if c in self.word and c not in self.otherword:
- self.assert_(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assert_(c not in self.s)
+ self.assertNotIn(c, self.s)
def test_symmetric_difference_update(self):
retval = self.s.symmetric_difference_update(self.otherword)
self.assertEqual(retval, None)
for c in (self.word + self.otherword):
if (c in self.word) ^ (c in self.otherword):
- self.assert_(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assert_(c not in self.s)
+ self.assertNotIn(c, self.s)
self.assertRaises(PassThru, self.s.symmetric_difference_update, check_pass_thru())
self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])
for p, q in (('cdc', 'abd'), ('efgfe', 'abcefg'), ('ccb', 'a'), ('ef', 'abcef')):
@@ -539,9 +538,9 @@ class TestSet(TestJointOps):
self.s ^= set(self.otherword)
for c in (self.word + self.otherword):
if (c in self.word) ^ (c in self.otherword):
- self.assert_(c in self.s)
+ self.assertIn(c, self.s)
else:
- self.assert_(c not in self.s)
+ self.assertNotIn(c, self.s)
def test_inplace_on_self(self):
t = self.s.copy()
@@ -565,7 +564,7 @@ class TestSet(TestJointOps):
# C API test only available in a debug build
if hasattr(set, "test_c_api"):
def test_c_api(self):
- self.assertEqual(set('abc').test_c_api(), True)
+ self.assertEqual(set().test_c_api(), True)
class SetSubclass(set):
pass
@@ -769,7 +768,7 @@ class TestBasicOps(unittest.TestCase):
def test_iteration(self):
for v in self.set:
- self.assert_(v in self.values)
+ self.assertIn(v, self.values)
setiter = iter(self.set)
# note: __length_hint__ is an internal undocumented API,
# don't rely on it in your own programs
@@ -804,10 +803,10 @@ class TestBasicOpsSingleton(TestBasicOps):
self.repr = "set([3])"
def test_in(self):
- self.failUnless(3 in self.set)
+ self.assertIn(3, self.set)
def test_not_in(self):
- self.failUnless(2 not in self.set)
+ self.assertNotIn(2, self.set)
#------------------------------------------------------------------------------
@@ -821,10 +820,10 @@ class TestBasicOpsTuple(TestBasicOps):
self.repr = "set([(0, 'zero')])"
def test_in(self):
- self.failUnless((0, "zero") in self.set)
+ self.assertIn((0, "zero"), self.set)
def test_not_in(self):
- self.failUnless(9 not in self.set)
+ self.assertNotIn(9, self.set)
#------------------------------------------------------------------------------
@@ -1116,7 +1115,7 @@ class TestMutate(unittest.TestCase):
popped[self.set.pop()] = None
self.assertEqual(len(popped), len(self.values))
for v in self.values:
- self.failUnless(v in popped)
+ self.assertIn(v, popped)
def test_update_empty_tuple(self):
self.set.update(())
@@ -1349,7 +1348,7 @@ class TestOnlySetsOperator(TestOnlySetsInBinaryOps):
self.otherIsIterable = False
def test_ge_gt_le_lt(self):
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
super(TestOnlySetsOperator, self).test_ge_gt_le_lt()
#------------------------------------------------------------------------------
@@ -1384,23 +1383,17 @@ class TestOnlySetsGenerator(TestOnlySetsInBinaryOps):
class TestCopying(unittest.TestCase):
def test_copy(self):
- dup = self.set.copy()
- with test_support.check_warnings():
- dup_list = sorted(dup)
- set_list = sorted(self.set)
- self.assertEqual(len(dup_list), len(set_list))
- for i in range(len(dup_list)):
- self.failUnless(dup_list[i] is set_list[i])
+ dup = list(self.set.copy())
+ self.assertEqual(len(dup), len(self.set))
+ for el in self.set:
+ self.assertIn(el, dup)
+ pos = dup.index(el)
+ self.assertIs(el, dup.pop(pos))
+ self.assertFalse(dup)
def test_deep_copy(self):
dup = copy.deepcopy(self.set)
- ##print type(dup), repr(dup)
- with test_support.check_warnings():
- dup_list = sorted(dup)
- set_list = sorted(self.set)
- self.assertEqual(len(dup_list), len(set_list))
- for i in range(len(dup_list)):
- self.assertEqual(dup_list[i], set_list[i])
+ self.assertSetEqual(dup, self.set)
#------------------------------------------------------------------------------
@@ -1441,13 +1434,13 @@ class TestIdentities(unittest.TestCase):
def test_binopsVsSubsets(self):
a, b = self.a, self.b
- self.assert_(a - b < a)
- self.assert_(b - a < b)
- self.assert_(a & b < a)
- self.assert_(a & b < b)
- self.assert_(a | b > a)
- self.assert_(a | b > b)
- self.assert_(a ^ b < a | b)
+ self.assertTrue(a - b < a)
+ self.assertTrue(b - a < b)
+ self.assertTrue(a & b < a)
+ self.assertTrue(a & b < b)
+ self.assertTrue(a | b > a)
+ self.assertTrue(a | b > b)
+ self.assertTrue(a ^ b < a | b)
def test_commutativity(self):
a, b = self.a, self.b
@@ -1559,9 +1552,8 @@ class TestVariousIteratorArgs(unittest.TestCase):
def test_constructor(self):
for cons in (set, frozenset):
for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)):
- with test_support.check_warnings():
- for g in (G, I, Ig, S, L, R):
- self.assertEqual(sorted(cons(g(s))), sorted(g(s)))
+ for g in (G, I, Ig, S, L, R):
+ self.assertSetEqual(cons(g(s)), set(g(s)))
self.assertRaises(TypeError, cons , X(s))
self.assertRaises(TypeError, cons , N(s))
self.assertRaises(ZeroDivisionError, cons , E(s))
@@ -1576,8 +1568,7 @@ class TestVariousIteratorArgs(unittest.TestCase):
if isinstance(expected, bool):
self.assertEqual(actual, expected)
else:
- with test_support.check_warnings():
- self.assertEqual(sorted(actual), sorted(expected))
+ self.assertSetEqual(actual, expected)
self.assertRaises(TypeError, meth, X(s))
self.assertRaises(TypeError, meth, N(s))
self.assertRaises(ZeroDivisionError, meth, E(s))
@@ -1591,13 +1582,45 @@ class TestVariousIteratorArgs(unittest.TestCase):
t = s.copy()
getattr(s, methname)(list(g(data)))
getattr(t, methname)(g(data))
- with test_support.check_warnings():
- self.assertEqual(sorted(s), sorted(t))
+ self.assertSetEqual(s, t)
self.assertRaises(TypeError, getattr(set('january'), methname), X(data))
self.assertRaises(TypeError, getattr(set('january'), methname), N(data))
self.assertRaises(ZeroDivisionError, getattr(set('january'), methname), E(data))
+class bad_eq:
+ def __eq__(self, other):
+ if be_bad:
+ set2.clear()
+ raise ZeroDivisionError
+ return self is other
+ def __hash__(self):
+ return 0
+
+class bad_dict_clear:
+ def __eq__(self, other):
+ if be_bad:
+ dict2.clear()
+ return self is other
+ def __hash__(self):
+ return 0
+
+class TestWeirdBugs(unittest.TestCase):
+ def test_8420_set_merge(self):
+ # This used to segfault
+ global be_bad, set2, dict2
+ be_bad = False
+ set1 = {bad_eq()}
+ set2 = {bad_eq() for i in range(75)}
+ be_bad = True
+ self.assertRaises(ZeroDivisionError, set1.update, set2)
+
+ be_bad = False
+ set1 = {bad_dict_clear()}
+ dict2 = {bad_dict_clear(): None}
+ be_bad = True
+ set1.symmetric_difference_update(dict2)
+
# Application tests (based on David Eppstein's graph recipes ====================================
def powerset(U):
@@ -1699,13 +1722,12 @@ class TestGraphs(unittest.TestCase):
edge = vertex # Cuboctahedron vertices are edges in Cube
self.assertEqual(len(edge), 2) # Two cube vertices define an edge
for cubevert in edge:
- self.assert_(cubevert in g)
+ self.assertIn(cubevert, g)
#==============================================================================
def test_main(verbose=None):
- from test import test_sets
test_classes = (
TestSet,
TestSetSubclass,
@@ -1740,6 +1762,7 @@ def test_main(verbose=None):
TestIdentities,
TestVariousIteratorArgs,
TestGraphs,
+ TestWeirdBugs,
)
test_support.run_unittest(*test_classes)
diff --git a/Lib/test/test_setcomps.py b/Lib/test/test_setcomps.py
new file mode 100644
index 0000000000..db5e6f7c97
--- /dev/null
+++ b/Lib/test/test_setcomps.py
@@ -0,0 +1,151 @@
+doctests = """
+########### Tests mostly copied from test_listcomps.py ############
+
+Test simple loop with conditional
+
+ >>> sum({i*i for i in range(100) if i&1 == 1})
+ 166650
+
+Test simple case
+
+ >>> {2*y + x + 1 for x in (0,) for y in (1,)}
+ set([3])
+
+Test simple nesting
+
+ >>> list(sorted({(i,j) for i in range(3) for j in range(4)}))
+ [(0, 0), (0, 1), (0, 2), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 0), (2, 1), (2, 2), (2, 3)]
+
+Test nesting with the inner expression dependent on the outer
+
+ >>> list(sorted({(i,j) for i in range(4) for j in range(i)}))
+ [(1, 0), (2, 0), (2, 1), (3, 0), (3, 1), (3, 2)]
+
+Make sure the induction variable is not exposed
+
+ >>> i = 20
+ >>> sum({i*i for i in range(100)})
+ 328350
+
+ >>> i
+ 20
+
+Verify that syntax error's are raised for setcomps used as lvalues
+
+ >>> {y for y in (1,2)} = 10 # doctest: +IGNORE_EXCEPTION_DETAIL
+ Traceback (most recent call last):
+ ...
+ SyntaxError: ...
+
+ >>> {y for y in (1,2)} += 10 # doctest: +IGNORE_EXCEPTION_DETAIL
+ Traceback (most recent call last):
+ ...
+ SyntaxError: ...
+
+
+Make a nested set comprehension that acts like set(range())
+
+ >>> def srange(n):
+ ... return {i for i in range(n)}
+ >>> list(sorted(srange(10)))
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+Same again, only as a lambda expression instead of a function definition
+
+ >>> lrange = lambda n: {i for i in range(n)}
+ >>> list(sorted(lrange(10)))
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+Generators can call other generators:
+
+ >>> def grange(n):
+ ... for x in {i for i in range(n)}:
+ ... yield x
+ >>> list(sorted(grange(5)))
+ [0, 1, 2, 3, 4]
+
+
+Make sure that None is a valid return value
+
+ >>> {None for i in range(10)}
+ set([None])
+
+########### Tests for various scoping corner cases ############
+
+Return lambdas that use the iteration variable as a default argument
+
+ >>> items = {(lambda i=i: i) for i in range(5)}
+ >>> {x() for x in items} == set(range(5))
+ True
+
+Same again, only this time as a closure variable
+
+ >>> items = {(lambda: i) for i in range(5)}
+ >>> {x() for x in items}
+ set([4])
+
+Another way to test that the iteration variable is local to the list comp
+
+ >>> items = {(lambda: i) for i in range(5)}
+ >>> i = 20
+ >>> {x() for x in items}
+ set([4])
+
+And confirm that a closure can jump over the list comp scope
+
+ >>> items = {(lambda: y) for i in range(5)}
+ >>> y = 2
+ >>> {x() for x in items}
+ set([2])
+
+We also repeat each of the above scoping tests inside a function
+
+ >>> def test_func():
+ ... items = {(lambda i=i: i) for i in range(5)}
+ ... return {x() for x in items}
+ >>> test_func() == set(range(5))
+ True
+
+ >>> def test_func():
+ ... items = {(lambda: i) for i in range(5)}
+ ... return {x() for x in items}
+ >>> test_func()
+ set([4])
+
+ >>> def test_func():
+ ... items = {(lambda: i) for i in range(5)}
+ ... i = 20
+ ... return {x() for x in items}
+ >>> test_func()
+ set([4])
+
+ >>> def test_func():
+ ... items = {(lambda: y) for i in range(5)}
+ ... y = 2
+ ... return {x() for x in items}
+ >>> test_func()
+ set([2])
+
+"""
+
+
+__test__ = {'doctests' : doctests}
+
+def test_main(verbose=None):
+ import sys
+ from test import test_support
+ from test import test_setcomps
+ test_support.run_doctest(test_setcomps, verbose)
+
+ # verify reference counting
+ if verbose and hasattr(sys, "gettotalrefcount"):
+ import gc
+ counts = [None] * 5
+ for i in range(len(counts)):
+ test_support.run_doctest(test_setcomps, verbose)
+ gc.collect()
+ counts[i] = sys.gettotalrefcount()
+ print(counts)
+
+if __name__ == "__main__":
+ test_main(verbose=True)
diff --git a/Lib/test/test_sets.py b/Lib/test/test_sets.py
index 9905d1349c..0754ed74fc 100644
--- a/Lib/test/test_sets.py
+++ b/Lib/test/test_sets.py
@@ -74,7 +74,7 @@ class TestBasicOps(unittest.TestCase):
def test_iteration(self):
for v in self.set:
- self.assert_(v in self.values)
+ self.assertIn(v, self.values)
def test_pickling(self):
p = pickle.dumps(self.set)
@@ -105,10 +105,10 @@ class TestBasicOpsSingleton(TestBasicOps):
self.repr = "Set([3])"
def test_in(self):
- self.failUnless(3 in self.set)
+ self.assertTrue(3 in self.set)
def test_not_in(self):
- self.failUnless(2 not in self.set)
+ self.assertTrue(2 not in self.set)
#------------------------------------------------------------------------------
@@ -122,10 +122,10 @@ class TestBasicOpsTuple(TestBasicOps):
self.repr = "Set([(0, 'zero')])"
def test_in(self):
- self.failUnless((0, "zero") in self.set)
+ self.assertTrue((0, "zero") in self.set)
def test_not_in(self):
- self.failUnless(9 not in self.set)
+ self.assertTrue(9 not in self.set)
#------------------------------------------------------------------------------
@@ -404,7 +404,7 @@ class TestMutate(unittest.TestCase):
popped[self.set.pop()] = None
self.assertEqual(len(popped), len(self.values))
for v in self.values:
- self.failUnless(v in popped)
+ self.assertIn(v, popped)
def test_update_empty_tuple(self):
self.set.union_update(())
@@ -637,7 +637,7 @@ class TestOnlySetsOperator(TestOnlySetsInBinaryOps):
self.otherIsIterable = False
def test_ge_gt_le_lt(self):
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
super(TestOnlySetsOperator, self).test_ge_gt_le_lt()
#------------------------------------------------------------------------------
@@ -686,18 +686,11 @@ class TestCopying(unittest.TestCase):
set_list = sorted(self.set)
self.assertEqual(len(dup_list), len(set_list))
for i, el in enumerate(dup_list):
- self.assertTrue(el is set_list[i])
+ self.assertIs(el, set_list[i])
def test_deep_copy(self):
dup = copy.deepcopy(self.set)
- ##print type(dup), repr(dup)
- with test_support.check_warnings():
- dup_list = sorted(dup)
- set_list = sorted(self.set)
- self.assertEqual(len(dup_list), len(set_list))
- for i in range(len(dup_list)):
- self.assertEqual(dup_list[i], set_list[i])
-
+ self.assertSetEqual(dup, self.set)
#------------------------------------------------------------------------------
@@ -718,7 +711,7 @@ class TestCopyingTriple(TestCopying):
self.set = Set(["zero", 0, None])
def test_copy(self):
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
super(TestCopyingTriple, self).test_copy()
#------------------------------------------------------------------------------
@@ -742,13 +735,13 @@ class TestIdentities(unittest.TestCase):
def test_binopsVsSubsets(self):
a, b = self.a, self.b
- self.assert_(a - b <= a)
- self.assert_(b - a <= b)
- self.assert_(a & b <= a)
- self.assert_(a & b <= b)
- self.assert_(a | b >= a)
- self.assert_(a | b >= b)
- self.assert_(a ^ b <= a | b)
+ self.assertTrue(a - b <= a)
+ self.assertTrue(b - a <= b)
+ self.assertTrue(a & b <= a)
+ self.assertTrue(a & b <= b)
+ self.assertTrue(a | b >= a)
+ self.assertTrue(a | b >= b)
+ self.assertTrue(a ^ b <= a | b)
def test_commutativity(self):
a, b = self.a, self.b
@@ -764,9 +757,9 @@ class TestIdentities(unittest.TestCase):
self.assertEqual(a - a, zero)
self.assertEqual(a | a, a)
self.assertEqual(a & a, a)
- self.assert_(a <= a)
- self.assert_(a >= a)
- self.assert_(a == a)
+ self.assertTrue(a <= a)
+ self.assertTrue(a >= a)
+ self.assertTrue(a == a)
def test_summations(self):
# check that sums of parts equal the whole
diff --git a/Lib/test/test_sha.py b/Lib/test/test_sha.py
index 0647db3d59..6b38435548 100644
--- a/Lib/test/test_sha.py
+++ b/Lib/test/test_sha.py
@@ -18,19 +18,19 @@ class SHATestCase(unittest.TestCase):
# Check digest matches the expected value
obj = sha.new(data)
computed = obj.hexdigest()
- self.assert_(computed == digest)
+ self.assertTrue(computed == digest)
# Verify that the value doesn't change between two consecutive
# digest operations.
computed_again = obj.hexdigest()
- self.assert_(computed == computed_again)
+ self.assertTrue(computed == computed_again)
# Check hexdigest() output matches digest()'s output
digest = obj.digest()
hexd = ""
for c in digest:
hexd += '%02x' % ord(c)
- self.assert_(computed == hexd)
+ self.assertTrue(computed == hexd)
def test_case_1(self):
self.check("abc",
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 2532a492a0..9f9bf45e42 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -7,10 +7,71 @@ import sys
import stat
import os
import os.path
+from os.path import splitdrive
+from distutils.spawn import find_executable, spawn
+from shutil import (_make_tarball, _make_zipfile, make_archive,
+ register_archive_format, unregister_archive_format,
+ get_archive_formats)
+import tarfile
+import warnings
+
from test import test_support
-from test.test_support import TESTFN
+from test.test_support import TESTFN, check_warnings, captured_stdout
+
+TESTFN2 = TESTFN + "2"
+
+try:
+ import grp
+ import pwd
+ UID_GID_SUPPORT = True
+except ImportError:
+ UID_GID_SUPPORT = False
+
+try:
+ import zlib
+except ImportError:
+ zlib = None
+
+try:
+ import zipfile
+ ZIP_SUPPORT = True
+except ImportError:
+ ZIP_SUPPORT = find_executable('zip')
class TestShutil(unittest.TestCase):
+
+ def setUp(self):
+ super(TestShutil, self).setUp()
+ self.tempdirs = []
+
+ def tearDown(self):
+ super(TestShutil, self).tearDown()
+ while self.tempdirs:
+ d = self.tempdirs.pop()
+ shutil.rmtree(d, os.name in ('nt', 'cygwin'))
+
+ def write_file(self, path, content='xxx'):
+ """Writes a file in the given path.
+
+
+ path can be a string or a sequence.
+ """
+ if isinstance(path, (list, tuple)):
+ path = os.path.join(*path)
+ f = open(path, 'w')
+ try:
+ f.write(content)
+ finally:
+ f.close()
+
+ def mkdtemp(self):
+ """Create a temporary directory that will be cleaned up.
+
+ Returns the path of the directory.
+ """
+ d = tempfile.mkdtemp()
+ self.tempdirs.append(d)
+ return d
def test_rmtree_errors(self):
# filename is guaranteed not to exist
filename = tempfile.mktemp()
@@ -45,15 +106,29 @@ class TestShutil(unittest.TestCase):
shutil.rmtree(TESTFN)
def check_args_to_onerror(self, func, arg, exc):
+ # test_rmtree_errors deliberately runs rmtree
+ # on a directory that is chmod 400, which will fail.
+ # This function is run when shutil.rmtree fails.
+ # 99.9% of the time it initially fails to remove
+ # a file in the directory, so the first time through
+ # func is os.remove.
+ # However, some Linux machines running ZFS on
+ # FUSE experienced a failure earlier in the process
+ # at os.listdir. The first failure may legally
+ # be either.
if self.errorState == 0:
- self.assertEqual(func, os.remove)
- self.assertEqual(arg, self.childpath)
- self.failUnless(issubclass(exc[0], OSError))
+ if func is os.remove:
+ self.assertEqual(arg, self.childpath)
+ else:
+ self.assertIs(func, os.listdir,
+ "func must be either os.remove or os.listdir")
+ self.assertEqual(arg, TESTFN)
+ self.assertTrue(issubclass(exc[0], OSError))
self.errorState = 1
else:
self.assertEqual(func, os.rmdir)
self.assertEqual(arg, TESTFN)
- self.failUnless(issubclass(exc[0], OSError))
+ self.assertTrue(issubclass(exc[0], OSError))
self.errorState = 2
def test_rmtree_dont_delete_file(self):
@@ -138,6 +213,7 @@ class TestShutil(unittest.TestCase):
write_data(join(src_dir, 'test_dir2', 'subdir', 'test.txt'), '456')
write_data(join(src_dir, 'test_dir2', 'subdir2', 'test.py'), '456')
+
# testing glob-like patterns
try:
patterns = shutil.ignore_patterns('*.tmp', 'test_dir2')
@@ -201,7 +277,8 @@ class TestShutil(unittest.TestCase):
os.link(src, dst)
self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
- self.assertEqual(open(src,'r').read(), 'cheddar')
+ with open(src, 'r') as f:
+ self.assertEqual(f.read(), 'cheddar')
os.remove(dst)
# Using `src` here would mean we end up with a symlink pointing
@@ -209,7 +286,8 @@ class TestShutil(unittest.TestCase):
# TESTFN/cheese.
os.symlink('cheese', dst)
self.assertRaises(shutil.Error, shutil.copyfile, src, dst)
- self.assertEqual(open(src,'r').read(), 'cheddar')
+ with open(src, 'r') as f:
+ self.assertEqual(f.read(), 'cheddar')
os.remove(dst)
finally:
try:
@@ -229,6 +307,260 @@ class TestShutil(unittest.TestCase):
finally:
shutil.rmtree(TESTFN, ignore_errors=True)
+ if hasattr(os, "mkfifo"):
+ # Issue #3002: copyfile and copytree block indefinitely on named pipes
+ def test_copyfile_named_pipe(self):
+ os.mkfifo(TESTFN)
+ try:
+ self.assertRaises(shutil.SpecialFileError,
+ shutil.copyfile, TESTFN, TESTFN2)
+ self.assertRaises(shutil.SpecialFileError,
+ shutil.copyfile, __file__, TESTFN)
+ finally:
+ os.remove(TESTFN)
+
+ def test_copytree_named_pipe(self):
+ os.mkdir(TESTFN)
+ try:
+ subdir = os.path.join(TESTFN, "subdir")
+ os.mkdir(subdir)
+ pipe = os.path.join(subdir, "mypipe")
+ os.mkfifo(pipe)
+ try:
+ shutil.copytree(TESTFN, TESTFN2)
+ except shutil.Error as e:
+ errors = e.args[0]
+ self.assertEqual(len(errors), 1)
+ src, dst, error_msg = errors[0]
+ self.assertEqual("`%s` is a named pipe" % pipe, error_msg)
+ else:
+ self.fail("shutil.Error should have been raised")
+ finally:
+ shutil.rmtree(TESTFN, ignore_errors=True)
+ shutil.rmtree(TESTFN2, ignore_errors=True)
+
+ @unittest.skipUnless(zlib, "requires zlib")
+ def test_make_tarball(self):
+ # creating something to tar
+ tmpdir = self.mkdtemp()
+ self.write_file([tmpdir, 'file1'], 'xxx')
+ self.write_file([tmpdir, 'file2'], 'xxx')
+ os.mkdir(os.path.join(tmpdir, 'sub'))
+ self.write_file([tmpdir, 'sub', 'file3'], 'xxx')
+
+ tmpdir2 = self.mkdtemp()
+ unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0],
+ "source and target should be on same drive")
+
+ base_name = os.path.join(tmpdir2, 'archive')
+
+ # working with relative paths to avoid tar warnings
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(splitdrive(base_name)[1], '.')
+ finally:
+ os.chdir(old_dir)
+
+ # check if the compressed tarball was created
+ tarball = base_name + '.tar.gz'
+ self.assertTrue(os.path.exists(tarball))
+
+ # trying an uncompressed one
+ base_name = os.path.join(tmpdir2, 'archive')
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(splitdrive(base_name)[1], '.', compress=None)
+ finally:
+ os.chdir(old_dir)
+ tarball = base_name + '.tar'
+ self.assertTrue(os.path.exists(tarball))
+
+ def _tarinfo(self, path):
+ tar = tarfile.open(path)
+ try:
+ names = tar.getnames()
+ names.sort()
+ return tuple(names)
+ finally:
+ tar.close()
+
+ def _create_files(self):
+ # creating something to tar
+ tmpdir = self.mkdtemp()
+ dist = os.path.join(tmpdir, 'dist')
+ os.mkdir(dist)
+ self.write_file([dist, 'file1'], 'xxx')
+ self.write_file([dist, 'file2'], 'xxx')
+ os.mkdir(os.path.join(dist, 'sub'))
+ self.write_file([dist, 'sub', 'file3'], 'xxx')
+ os.mkdir(os.path.join(dist, 'sub2'))
+ tmpdir2 = self.mkdtemp()
+ base_name = os.path.join(tmpdir2, 'archive')
+ return tmpdir, tmpdir2, base_name
+
+ @unittest.skipUnless(zlib, "Requires zlib")
+ @unittest.skipUnless(find_executable('tar') and find_executable('gzip'),
+ 'Need the tar command to run')
+ def test_tarfile_vs_tar(self):
+ tmpdir, tmpdir2, base_name = self._create_files()
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(base_name, 'dist')
+ finally:
+ os.chdir(old_dir)
+
+ # check if the compressed tarball was created
+ tarball = base_name + '.tar.gz'
+ self.assertTrue(os.path.exists(tarball))
+
+ # now create another tarball using `tar`
+ tarball2 = os.path.join(tmpdir, 'archive2.tar.gz')
+ tar_cmd = ['tar', '-cf', 'archive2.tar', 'dist']
+ gzip_cmd = ['gzip', '-f9', 'archive2.tar']
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ with captured_stdout() as s:
+ spawn(tar_cmd)
+ spawn(gzip_cmd)
+ finally:
+ os.chdir(old_dir)
+
+ self.assertTrue(os.path.exists(tarball2))
+ # let's compare both tarballs
+ self.assertEqual(self._tarinfo(tarball), self._tarinfo(tarball2))
+
+ # trying an uncompressed one
+ base_name = os.path.join(tmpdir2, 'archive')
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(base_name, 'dist', compress=None)
+ finally:
+ os.chdir(old_dir)
+ tarball = base_name + '.tar'
+ self.assertTrue(os.path.exists(tarball))
+
+ # now for a dry_run
+ base_name = os.path.join(tmpdir2, 'archive')
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ try:
+ _make_tarball(base_name, 'dist', compress=None, dry_run=True)
+ finally:
+ os.chdir(old_dir)
+ tarball = base_name + '.tar'
+ self.assertTrue(os.path.exists(tarball))
+
+ @unittest.skipUnless(zlib, "Requires zlib")
+ @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run')
+ def test_make_zipfile(self):
+ # creating something to tar
+ tmpdir = self.mkdtemp()
+ self.write_file([tmpdir, 'file1'], 'xxx')
+ self.write_file([tmpdir, 'file2'], 'xxx')
+
+ tmpdir2 = self.mkdtemp()
+ base_name = os.path.join(tmpdir2, 'archive')
+ _make_zipfile(base_name, tmpdir)
+
+ # check if the compressed tarball was created
+ tarball = base_name + '.zip'
+ self.assertTrue(os.path.exists(tarball))
+
+
+ def test_make_archive(self):
+ tmpdir = self.mkdtemp()
+ base_name = os.path.join(tmpdir, 'archive')
+ self.assertRaises(ValueError, make_archive, base_name, 'xxx')
+
+ @unittest.skipUnless(zlib, "Requires zlib")
+ def test_make_archive_owner_group(self):
+ # testing make_archive with owner and group, with various combinations
+ # this works even if there's not gid/uid support
+ if UID_GID_SUPPORT:
+ group = grp.getgrgid(0)[0]
+ owner = pwd.getpwuid(0)[0]
+ else:
+ group = owner = 'root'
+
+ base_dir, root_dir, base_name = self._create_files()
+ base_name = os.path.join(self.mkdtemp() , 'archive')
+ res = make_archive(base_name, 'zip', root_dir, base_dir, owner=owner,
+ group=group)
+ self.assertTrue(os.path.exists(res))
+
+ res = make_archive(base_name, 'zip', root_dir, base_dir)
+ self.assertTrue(os.path.exists(res))
+
+ res = make_archive(base_name, 'tar', root_dir, base_dir,
+ owner=owner, group=group)
+ self.assertTrue(os.path.exists(res))
+
+ res = make_archive(base_name, 'tar', root_dir, base_dir,
+ owner='kjhkjhkjg', group='oihohoh')
+ self.assertTrue(os.path.exists(res))
+
+ @unittest.skipUnless(zlib, "Requires zlib")
+ @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support")
+ def test_tarfile_root_owner(self):
+ tmpdir, tmpdir2, base_name = self._create_files()
+ old_dir = os.getcwd()
+ os.chdir(tmpdir)
+ group = grp.getgrgid(0)[0]
+ owner = pwd.getpwuid(0)[0]
+ try:
+ archive_name = _make_tarball(base_name, 'dist', compress=None,
+ owner=owner, group=group)
+ finally:
+ os.chdir(old_dir)
+
+ # check if the compressed tarball was created
+ self.assertTrue(os.path.exists(archive_name))
+
+ # now checks the rights
+ archive = tarfile.open(archive_name)
+ try:
+ for member in archive.getmembers():
+ self.assertEqual(member.uid, 0)
+ self.assertEqual(member.gid, 0)
+ finally:
+ archive.close()
+
+ def test_make_archive_cwd(self):
+ current_dir = os.getcwd()
+ def _breaks(*args, **kw):
+ raise RuntimeError()
+
+ register_archive_format('xxx', _breaks, [], 'xxx file')
+ try:
+ try:
+ make_archive('xxx', 'xxx', root_dir=self.mkdtemp())
+ except Exception:
+ pass
+ self.assertEqual(os.getcwd(), current_dir)
+ finally:
+ unregister_archive_format('xxx')
+
+ def test_register_archive_format(self):
+
+ self.assertRaises(TypeError, register_archive_format, 'xxx', 1)
+ self.assertRaises(TypeError, register_archive_format, 'xxx', lambda: x,
+ 1)
+ self.assertRaises(TypeError, register_archive_format, 'xxx', lambda: x,
+ [(1, 2), (1, 2, 3)])
+
+ register_archive_format('xxx', lambda: x, [(1, 2)], 'xxx file')
+ formats = [name for name, params in get_archive_formats()]
+ self.assertIn('xxx', formats)
+
+ unregister_archive_format('xxx')
+ formats = [name for name, params in get_archive_formats()]
+ self.assertNotIn('xxx', formats)
+
class TestMove(unittest.TestCase):
@@ -259,9 +591,11 @@ class TestMove(unittest.TestCase):
pass
def _check_move_file(self, src, dst, real_dst):
- contents = open(src, "rb").read()
+ with open(src, "rb") as f:
+ contents = f.read()
shutil.move(src, dst)
- self.assertEqual(contents, open(real_dst, "rb").read())
+ with open(real_dst, "rb") as f:
+ self.assertEqual(contents, f.read())
self.assertFalse(os.path.exists(src))
def _check_move_dir(self, src, dst, real_dst):
@@ -349,8 +683,8 @@ class TestMove(unittest.TestCase):
for src, dst in [('srcdir', 'srcdir/dest')]:
src = os.path.join(TESTFN, src)
dst = os.path.join(TESTFN, dst)
- self.assert_(shutil.destinsrc(src, dst),
- msg='destinsrc() wrongly concluded that '
+ self.assertTrue(shutil._destinsrc(src, dst),
+ msg='_destinsrc() wrongly concluded that '
'dst (%s) is not in src (%s)' % (dst, src))
finally:
shutil.rmtree(TESTFN, ignore_errors=True)
@@ -361,8 +695,8 @@ class TestMove(unittest.TestCase):
for src, dst in [('srcdir', 'src/dest'), ('srcdir', 'srcdir.new')]:
src = os.path.join(TESTFN, src)
dst = os.path.join(TESTFN, dst)
- self.failIf(shutil.destinsrc(src, dst),
- msg='destinsrc() wrongly concluded that '
+ self.assertFalse(shutil._destinsrc(src, dst),
+ msg='_destinsrc() wrongly concluded that '
'dst (%s) is in src (%s)' % (dst, src))
finally:
shutil.rmtree(TESTFN, ignore_errors=True)
@@ -471,6 +805,24 @@ class TestCopyFile(unittest.TestCase):
self.assertTrue(srcfile._exited_with[0] is None)
self.assertTrue(srcfile._raised)
+ def test_move_dir_caseinsensitive(self):
+ # Renames a folder to the same name
+ # but a different case.
+
+ self.src_dir = tempfile.mkdtemp()
+ dst_dir = os.path.join(
+ os.path.dirname(self.src_dir),
+ os.path.basename(self.src_dir).upper())
+ self.assertNotEqual(self.src_dir, dst_dir)
+
+ try:
+ shutil.move(self.src_dir, dst_dir)
+ self.assertTrue(os.path.isdir(dst_dir))
+ finally:
+ if os.path.exists(dst_dir):
+ os.rmdir(dst_dir)
+
+
def test_main():
test_support.run_unittest(TestShutil, TestMove, TestCopyFile)
diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
index ae5b586b28..8feb1455d0 100644
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -1,6 +1,6 @@
import unittest
from test import test_support
-from contextlib import closing, nested
+from contextlib import closing
import gc
import pickle
import select
@@ -9,9 +9,8 @@ import subprocess
import traceback
import sys, os, time, errno
-if sys.platform[:3] in ('win', 'os2') or sys.platform == 'riscos':
- raise test_support.TestSkipped("Can't test signal on %s" % \
- sys.platform)
+if sys.platform in ('os2', 'riscos'):
+ raise unittest.SkipTest("Can't test signal on %s" % sys.platform)
class HandlerBCalled(Exception):
@@ -37,6 +36,7 @@ def ignoring_eintr(__func, *args, **kwargs):
return None
+@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
class InterProcessSignalTests(unittest.TestCase):
MAX_DURATION = 20 # Entire test should last at most 20 sec.
@@ -139,21 +139,19 @@ class InterProcessSignalTests(unittest.TestCase):
self.fail("pause returned of its own accord, and the signal"
" didn't arrive after another second.")
+ # Issue 3864. Unknown if this affects earlier versions of freebsd also.
+ @unittest.skipIf(sys.platform=='freebsd6',
+ 'inter process signals not reliable (do not mix well with threading) '
+ 'on freebsd6')
def test_main(self):
- # Issue 3864, unknown if this affects earlier versions of freebsd also
- if sys.platform=='freebsd6':
- if test_support.verbose:
- sys.stderr.write('skipping -- inter process signals not '
- 'reliable (do not mix well with threading) on freebsd6\n')
- return
# This function spawns a child process to insulate the main
# test-running process from all the signals. It then
# communicates with that child process over a pipe and
# re-raises information about any exceptions the child
# throws. The real work happens in self.run_test().
os_done_r, os_done_w = os.pipe()
- with nested(closing(os.fdopen(os_done_r)),
- closing(os.fdopen(os_done_w, 'w'))) as (done_r, done_w):
+ with closing(os.fdopen(os_done_r)) as done_r, \
+ closing(os.fdopen(os_done_w, 'w')) as done_w:
child = os.fork()
if child == 0:
# In the child process; run the test and report results
@@ -188,6 +186,7 @@ class InterProcessSignalTests(unittest.TestCase):
self.MAX_DURATION)
+@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
class BasicSignalTests(unittest.TestCase):
def trivial_signal_handler(self, *args):
pass
@@ -204,12 +203,31 @@ class BasicSignalTests(unittest.TestCase):
def test_getsignal(self):
hup = signal.signal(signal.SIGHUP, self.trivial_signal_handler)
- self.assertEquals(signal.getsignal(signal.SIGHUP),
- self.trivial_signal_handler)
+ self.assertEqual(signal.getsignal(signal.SIGHUP),
+ self.trivial_signal_handler)
signal.signal(signal.SIGHUP, hup)
- self.assertEquals(signal.getsignal(signal.SIGHUP), hup)
+ self.assertEqual(signal.getsignal(signal.SIGHUP), hup)
+
+
+@unittest.skipUnless(sys.platform == "win32", "Windows specific")
+class WindowsSignalTests(unittest.TestCase):
+ def test_issue9324(self):
+ # Updated for issue #10003, adding SIGBREAK
+ handler = lambda x, y: None
+ for sig in (signal.SIGABRT, signal.SIGBREAK, signal.SIGFPE,
+ signal.SIGILL, signal.SIGINT, signal.SIGSEGV,
+ signal.SIGTERM):
+ # Set and then reset a handler for signals that work on windows
+ signal.signal(sig, signal.signal(sig, handler))
+
+ with self.assertRaises(ValueError):
+ signal.signal(-1, handler)
+ with self.assertRaises(ValueError):
+ signal.signal(7, handler)
+
+@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
class WakeupSignalTests(unittest.TestCase):
TIMEOUT_FULL = 10
TIMEOUT_HALF = 5
@@ -223,10 +241,10 @@ class WakeupSignalTests(unittest.TestCase):
# before select is called
time.sleep(self.TIMEOUT_FULL)
mid_time = time.time()
- self.assert_(mid_time - before_time < self.TIMEOUT_HALF)
+ self.assertTrue(mid_time - before_time < self.TIMEOUT_HALF)
select.select([self.read], [], [], self.TIMEOUT_FULL)
after_time = time.time()
- self.assert_(after_time - mid_time < self.TIMEOUT_HALF)
+ self.assertTrue(after_time - mid_time < self.TIMEOUT_HALF)
def test_wakeup_fd_during(self):
import select
@@ -237,7 +255,7 @@ class WakeupSignalTests(unittest.TestCase):
self.assertRaises(select.error, select.select,
[self.read], [], [], self.TIMEOUT_FULL)
after_time = time.time()
- self.assert_(after_time - before_time < self.TIMEOUT_HALF)
+ self.assertTrue(after_time - before_time < self.TIMEOUT_HALF)
def setUp(self):
import fcntl
@@ -255,33 +273,18 @@ class WakeupSignalTests(unittest.TestCase):
os.close(self.write)
signal.signal(signal.SIGALRM, self.alrm)
+@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
class SiginterruptTest(unittest.TestCase):
- signum = signal.SIGUSR1
def setUp(self):
"""Install a no-op signal handler that can be set to allow
interrupts or not, and arrange for the original signal handler to be
re-installed when the test is finished.
"""
- self._cleanups = []
+ self.signum = signal.SIGUSR1
oldhandler = signal.signal(self.signum, lambda x,y: None)
self.addCleanup(signal.signal, self.signum, oldhandler)
-
- def tearDown(self):
- """Run any cleanup functions which have been registered.
- """
- for (f, a) in self._cleanups:
- f(*a)
-
-
- def addCleanup(self, f, *a):
- """Register a function to be called at the end of the test method
- run.
- """
- self._cleanups.append((f, a))
-
-
def readpipe_interrupted(self):
"""Perform a read during which a signal will arrive. Return True if the
read is interrupted by the signal and raises an exception. Return False
@@ -372,7 +375,7 @@ class SiginterruptTest(unittest.TestCase):
self.assertFalse(i)
-
+@unittest.skipIf(sys.platform == "win32", "Not valid on Windows")
class ItimerTest(unittest.TestCase):
def setUp(self):
self.hndl_called = False
@@ -434,13 +437,10 @@ class ItimerTest(unittest.TestCase):
self.assertEqual(self.hndl_called, True)
+ # Issue 3864. Unknown if this affects earlier versions of freebsd also.
+ @unittest.skipIf(sys.platform in ('freebsd6', 'netbsd5'),
+ 'itimer not reliable (does not mix well with threading) on some BSDs.')
def test_itimer_virtual(self):
- # Issue 3864, unknown if this affects earlier versions of freebsd also
- if sys.platform=='freebsd6':
- if test_support.verbose:
- sys.stderr.write('skipping -- itimer not reliable (does not '
- 'mix well with threading) on freebsd6\n')
- return
self.itimer = signal.ITIMER_VIRTUAL
signal.signal(signal.SIGVTALRM, self.sig_vtalrm)
signal.setitimer(self.itimer, 0.3, 0.2)
@@ -452,22 +452,18 @@ class ItimerTest(unittest.TestCase):
if signal.getitimer(self.itimer) == (0.0, 0.0):
break # sig_vtalrm handler stopped this itimer
else: # Issue 8424
- sys.stderr.write("test_itimer_virtual: timeout: likely cause: "
- "machine too slow or load too high.\n")
- return
+ self.skipTest("timeout: likely cause: machine too slow or load too "
+ "high")
# virtual itimer should be (0.0, 0.0) now
- self.assertEquals(signal.getitimer(self.itimer), (0.0, 0.0))
+ self.assertEqual(signal.getitimer(self.itimer), (0.0, 0.0))
# and the handler should have been called
- self.assertEquals(self.hndl_called, True)
+ self.assertEqual(self.hndl_called, True)
+ # Issue 3864. Unknown if this affects earlier versions of freebsd also.
+ @unittest.skipIf(sys.platform=='freebsd6',
+ 'itimer not reliable (does not mix well with threading) on freebsd6')
def test_itimer_prof(self):
- # Issue 3864, unknown if this affects earlier versions of freebsd also
- if sys.platform=='freebsd6':
- if test_support.verbose:
- sys.stderr.write('skipping -- itimer not reliable (does not '
- 'mix well with threading) on freebsd6\n')
- return
self.itimer = signal.ITIMER_PROF
signal.signal(signal.SIGPROF, self.sig_prof)
signal.setitimer(self.itimer, 0.2, 0.2)
@@ -479,18 +475,18 @@ class ItimerTest(unittest.TestCase):
if signal.getitimer(self.itimer) == (0.0, 0.0):
break # sig_prof handler stopped this itimer
else: # Issue 8424
- sys.stdout.write("test_itimer_prof: timeout: likely cause: "
- "machine too slow or load too high.\n")
- return
+ self.skipTest("timeout: likely cause: machine too slow or load too "
+ "high")
# profiling itimer should be (0.0, 0.0) now
- self.assertEquals(signal.getitimer(self.itimer), (0.0, 0.0))
+ self.assertEqual(signal.getitimer(self.itimer), (0.0, 0.0))
# and the handler should have been called
self.assertEqual(self.hndl_called, True)
def test_main():
test_support.run_unittest(BasicSignalTests, InterProcessSignalTests,
- WakeupSignalTests, SiginterruptTest, ItimerTest)
+ WakeupSignalTests, SiginterruptTest,
+ ItimerTest, WindowsSignalTests)
if __name__ == "__main__":
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index 4a05196429..1988ef3a6c 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -5,19 +5,24 @@ executing have not been removed.
"""
import unittest
-from test.test_support import TestSkipped, run_unittest, TESTFN, EnvironmentVarGuard
+from test.test_support import run_unittest, TESTFN, EnvironmentVarGuard
+from test.test_support import captured_output
import __builtin__
import os
import sys
+import re
import encodings
import subprocess
+import sysconfig
+from copy import copy
+
# Need to make sure to not import 'site' if someone specified ``-S`` at the
# command-line. Detect this by just making sure 'site' has not been imported
# already.
if "site" in sys.modules:
import site
else:
- raise TestSkipped("importation of site.py suppressed")
+ raise unittest.SkipTest("importation of site.py suppressed")
if not os.path.isdir(site.USER_SITE):
# need to add user site directory for tests
@@ -35,10 +40,18 @@ class HelperFunctionsTests(unittest.TestCase):
def setUp(self):
"""Save a copy of sys.path"""
self.sys_path = sys.path[:]
+ self.old_base = site.USER_BASE
+ self.old_site = site.USER_SITE
+ self.old_prefixes = site.PREFIXES
+ self.old_vars = copy(sysconfig._CONFIG_VARS)
def tearDown(self):
"""Restore sys.path"""
- sys.path = self.sys_path
+ sys.path[:] = self.sys_path
+ site.USER_BASE = self.old_base
+ site.USER_SITE = self.old_site
+ site.PREFIXES = self.old_prefixes
+ sysconfig._CONFIG_VARS = self.old_vars
def test_makepath(self):
# Test makepath() have an absolute path for its first return value
@@ -47,26 +60,26 @@ class HelperFunctionsTests(unittest.TestCase):
path_parts = ("Beginning", "End")
original_dir = os.path.join(*path_parts)
abs_dir, norm_dir = site.makepath(*path_parts)
- self.failUnlessEqual(os.path.abspath(original_dir), abs_dir)
+ self.assertEqual(os.path.abspath(original_dir), abs_dir)
if original_dir == os.path.normcase(original_dir):
- self.failUnlessEqual(abs_dir, norm_dir)
+ self.assertEqual(abs_dir, norm_dir)
else:
- self.failUnlessEqual(os.path.normcase(abs_dir), norm_dir)
+ self.assertEqual(os.path.normcase(abs_dir), norm_dir)
def test_init_pathinfo(self):
dir_set = site._init_pathinfo()
for entry in [site.makepath(path)[1] for path in sys.path
if path and os.path.isdir(path)]:
- self.failUnless(entry in dir_set,
- "%s from sys.path not found in set returned "
- "by _init_pathinfo(): %s" % (entry, dir_set))
+ self.assertIn(entry, dir_set,
+ "%s from sys.path not found in set returned "
+ "by _init_pathinfo(): %s" % (entry, dir_set))
def pth_file_tests(self, pth_file):
"""Contain common code for testing results of reading a .pth file"""
- self.failUnless(pth_file.imported in sys.modules,
- "%s not in sys.path" % pth_file.imported)
- self.failUnless(site.makepath(pth_file.good_dir_path)[0] in sys.path)
- self.failUnless(not os.path.exists(pth_file.bad_dir_path))
+ self.assertIn(pth_file.imported, sys.modules,
+ "%s not in sys.modules" % pth_file.imported)
+ self.assertIn(site.makepath(pth_file.good_dir_path)[0], sys.path)
+ self.assertFalse(os.path.exists(pth_file.bad_dir_path))
def test_addpackage(self):
# Make sure addpackage() imports if the line starts with 'import',
@@ -83,6 +96,58 @@ class HelperFunctionsTests(unittest.TestCase):
finally:
pth_file.cleanup()
+ def make_pth(self, contents, pth_dir='.', pth_name=TESTFN):
+ # Create a .pth file and return its (abspath, basename).
+ pth_dir = os.path.abspath(pth_dir)
+ pth_basename = pth_name + '.pth'
+ pth_fn = os.path.join(pth_dir, pth_basename)
+ pth_file = open(pth_fn, 'w')
+ self.addCleanup(lambda: os.remove(pth_fn))
+ pth_file.write(contents)
+ pth_file.close()
+ return pth_dir, pth_basename
+
+ def test_addpackage_import_bad_syntax(self):
+ # Issue 10642
+ pth_dir, pth_fn = self.make_pth("import bad)syntax\n")
+ with captured_output("stderr") as err_out:
+ site.addpackage(pth_dir, pth_fn, set())
+ self.assertRegexpMatches(err_out.getvalue(), "line 1")
+ self.assertRegexpMatches(err_out.getvalue(),
+ re.escape(os.path.join(pth_dir, pth_fn)))
+ # XXX: the previous two should be independent checks so that the
+ # order doesn't matter. The next three could be a single check
+ # but my regex foo isn't good enough to write it.
+ self.assertRegexpMatches(err_out.getvalue(), 'Traceback')
+ self.assertRegexpMatches(err_out.getvalue(), r'import bad\)syntax')
+ self.assertRegexpMatches(err_out.getvalue(), 'SyntaxError')
+
+ def test_addpackage_import_bad_exec(self):
+ # Issue 10642
+ pth_dir, pth_fn = self.make_pth("randompath\nimport nosuchmodule\n")
+ with captured_output("stderr") as err_out:
+ site.addpackage(pth_dir, pth_fn, set())
+ self.assertRegexpMatches(err_out.getvalue(), "line 2")
+ self.assertRegexpMatches(err_out.getvalue(),
+ re.escape(os.path.join(pth_dir, pth_fn)))
+ # XXX: ditto previous XXX comment.
+ self.assertRegexpMatches(err_out.getvalue(), 'Traceback')
+ self.assertRegexpMatches(err_out.getvalue(), 'ImportError')
+
+ @unittest.skipIf(sys.platform == "win32", "Windows does not raise an "
+ "error for file paths containing null characters")
+ def test_addpackage_import_bad_pth_file(self):
+ # Issue 5258
+ pth_dir, pth_fn = self.make_pth("abc\x00def\n")
+ with captured_output("stderr") as err_out:
+ site.addpackage(pth_dir, pth_fn, set())
+ self.assertRegexpMatches(err_out.getvalue(), "line 1")
+ self.assertRegexpMatches(err_out.getvalue(),
+ re.escape(os.path.join(pth_dir, pth_fn)))
+ # XXX: ditto previous XXX comment.
+ self.assertRegexpMatches(err_out.getvalue(), 'Traceback')
+ self.assertRegexpMatches(err_out.getvalue(), 'TypeError')
+
def test_addsitedir(self):
# Same tests for test_addpackage since addsitedir() essentially just
# calls addpackage() for every .pth file in the directory
@@ -98,14 +163,19 @@ class HelperFunctionsTests(unittest.TestCase):
def test_s_option(self):
usersite = site.USER_SITE
- self.assert_(usersite in sys.path)
+ self.assertIn(usersite, sys.path)
+ env = os.environ.copy()
rc = subprocess.call([sys.executable, '-c',
- 'import sys; sys.exit(%r in sys.path)' % usersite])
- self.assertEqual(rc, 1)
+ 'import sys; sys.exit(%r in sys.path)' % usersite],
+ env=env)
+ self.assertEqual(rc, 1, "%r is not in sys.path (sys.exit returned %r)"
+ % (usersite, rc))
+ env = os.environ.copy()
rc = subprocess.call([sys.executable, '-s', '-c',
- 'import sys; sys.exit(%r in sys.path)' % usersite])
+ 'import sys; sys.exit(%r in sys.path)' % usersite],
+ env=env)
self.assertEqual(rc, 0)
env = os.environ.copy()
@@ -122,6 +192,65 @@ class HelperFunctionsTests(unittest.TestCase):
env=env)
self.assertEqual(rc, 1)
+ def test_getuserbase(self):
+ site.USER_BASE = None
+ user_base = site.getuserbase()
+
+ # the call sets site.USER_BASE
+ self.assertEqual(site.USER_BASE, user_base)
+
+ # let's set PYTHONUSERBASE and see if it uses it
+ site.USER_BASE = None
+ import sysconfig
+ sysconfig._CONFIG_VARS = None
+
+ with EnvironmentVarGuard() as environ:
+ environ['PYTHONUSERBASE'] = 'xoxo'
+ self.assertTrue(site.getuserbase().startswith('xoxo'),
+ site.getuserbase())
+
+ def test_getusersitepackages(self):
+ site.USER_SITE = None
+ site.USER_BASE = None
+ user_site = site.getusersitepackages()
+
+ # the call sets USER_BASE *and* USER_SITE
+ self.assertEqual(site.USER_SITE, user_site)
+ self.assertTrue(user_site.startswith(site.USER_BASE), user_site)
+
+ def test_getsitepackages(self):
+ site.PREFIXES = ['xoxo']
+ dirs = site.getsitepackages()
+
+ if sys.platform in ('os2emx', 'riscos'):
+ self.assertEqual(len(dirs), 1)
+ wanted = os.path.join('xoxo', 'Lib', 'site-packages')
+ self.assertEqual(dirs[0], wanted)
+ elif os.sep == '/':
+ self.assertEqual(len(dirs), 2)
+ wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
+ 'site-packages')
+ self.assertEqual(dirs[0], wanted)
+ wanted = os.path.join('xoxo', 'lib', 'site-python')
+ self.assertEqual(dirs[1], wanted)
+ else:
+ self.assertEqual(len(dirs), 2)
+ self.assertEqual(dirs[0], 'xoxo')
+ wanted = os.path.join('xoxo', 'lib', 'site-packages')
+ self.assertEqual(dirs[1], wanted)
+
+ # let's try the specific Apple location
+ if (sys.platform == "darwin" and
+ sysconfig.get_config_var("PYTHONFRAMEWORK")):
+ site.PREFIXES = ['Python.framework']
+ dirs = site.getsitepackages()
+ self.assertEqual(len(dirs), 4)
+ wanted = os.path.join('~', 'Library', 'Python',
+ sys.version[:3], 'site-packages')
+ self.assertEqual(dirs[2], os.path.expanduser(wanted))
+ wanted = os.path.join('/Library', 'Python', sys.version[:3],
+ 'site-packages')
+ self.assertEqual(dirs[3], wanted)
class PthFile(object):
"""Helper class for handling testing of .pth files"""
@@ -187,7 +316,7 @@ class ImportSideEffectTests(unittest.TestCase):
def tearDown(self):
"""Restore sys.path"""
- sys.path = self.sys_path
+ sys.path[:] = self.sys_path
def test_abs__file__(self):
# Make sure all imported modules have their __file__ attribute
@@ -209,7 +338,7 @@ class ImportSideEffectTests(unittest.TestCase):
site.removeduppaths()
seen_paths = set()
for path in sys.path:
- self.failUnless(path not in seen_paths)
+ self.assertNotIn(path, seen_paths)
seen_paths.add(path)
def test_add_build_dir(self):
@@ -220,17 +349,17 @@ class ImportSideEffectTests(unittest.TestCase):
def test_setting_quit(self):
# 'quit' and 'exit' should be injected into __builtin__
- self.failUnless(hasattr(__builtin__, "quit"))
- self.failUnless(hasattr(__builtin__, "exit"))
+ self.assertTrue(hasattr(__builtin__, "quit"))
+ self.assertTrue(hasattr(__builtin__, "exit"))
def test_setting_copyright(self):
# 'copyright' and 'credits' should be in __builtin__
- self.failUnless(hasattr(__builtin__, "copyright"))
- self.failUnless(hasattr(__builtin__, "credits"))
+ self.assertTrue(hasattr(__builtin__, "copyright"))
+ self.assertTrue(hasattr(__builtin__, "credits"))
def test_setting_help(self):
# 'help' should be set in __builtin__
- self.failUnless(hasattr(__builtin__, "help"))
+ self.assertTrue(hasattr(__builtin__, "help"))
def test_aliasing_mbcs(self):
if sys.platform == "win32":
@@ -244,7 +373,7 @@ class ImportSideEffectTests(unittest.TestCase):
def test_setdefaultencoding_removed(self):
# Make sure sys.setdefaultencoding is gone
- self.failUnless(not hasattr(sys, "setdefaultencoding"))
+ self.assertTrue(not hasattr(sys, "setdefaultencoding"))
def test_sitecustomize_executed(self):
# If sitecustomize is available, it should have been imported.
diff --git a/Lib/test/test_slice.py b/Lib/test/test_slice.py
index 2f65308cda..3304d6b4e3 100644
--- a/Lib/test/test_slice.py
+++ b/Lib/test/test_slice.py
@@ -71,7 +71,7 @@ class SliceTest(unittest.TestCase):
obj = AnyClass()
s = slice(obj)
- self.assert_(s.stop is obj)
+ self.assertTrue(s.stop is obj)
def test_indices(self):
self.assertEqual(slice(None ).indices(10), (0, 10, 1))
@@ -115,9 +115,9 @@ class SliceTest(unittest.TestCase):
tmp.append((i, j, k))
x = X()
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
x[1:2] = 42
- self.assertEquals(tmp, [(1, 2, 42)])
+ self.assertEqual(tmp, [(1, 2, 42)])
def test_pickle(self):
s = slice(10, 20, 3)
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
index 644cbf7be6..42a10bee1d 100644
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -1,7 +1,6 @@
import asyncore
import email.utils
import socket
-import threading
import smtpd
import smtplib
import StringIO
@@ -9,9 +8,14 @@ import sys
import time
import select
-from unittest import TestCase
+import unittest
from test import test_support
+try:
+ import threading
+except ImportError:
+ threading = None
+
HOST = test_support.HOST
def server(evt, buf, serv):
@@ -36,20 +40,25 @@ def server(evt, buf, serv):
serv.close()
evt.set()
-class GeneralTests(TestCase):
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class GeneralTests(unittest.TestCase):
def setUp(self):
+ self._threads = test_support.threading_setup()
self.evt = threading.Event()
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.settimeout(15)
self.port = test_support.bind_port(self.sock)
servargs = (self.evt, "220 Hola mundo\n", self.sock)
- threading.Thread(target=server, args=servargs).start()
+ self.thread = threading.Thread(target=server, args=servargs)
+ self.thread.start()
self.evt.wait()
self.evt.clear()
def tearDown(self):
self.evt.wait()
+ self.thread.join()
+ test_support.threading_cleanup(*self._threads)
def testBasic1(self):
# connects
@@ -134,7 +143,8 @@ MSG_END = '------------ END MESSAGE ------------\n'
# test server times out, causing the test to fail.
# Test behavior of smtpd.DebuggingServer
-class DebuggingServerTests(TestCase):
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class DebuggingServerTests(unittest.TestCase):
def setUp(self):
# temporarily replace sys.stdout to capture DebuggingServer output
@@ -142,6 +152,7 @@ class DebuggingServerTests(TestCase):
self.output = StringIO.StringIO()
sys.stdout = self.output
+ self._threads = test_support.threading_setup()
self.serv_evt = threading.Event()
self.client_evt = threading.Event()
# Pick a random unused port by passing 0 for the port number
@@ -149,7 +160,8 @@ class DebuggingServerTests(TestCase):
# Keep a note of what port was assigned
self.port = self.serv.socket.getsockname()[1]
serv_args = (self.serv, self.serv_evt, self.client_evt)
- threading.Thread(target=debugging_server, args=serv_args).start()
+ self.thread = threading.Thread(target=debugging_server, args=serv_args)
+ self.thread.start()
# wait until server thread has assigned a port number
self.serv_evt.wait()
@@ -160,6 +172,8 @@ class DebuggingServerTests(TestCase):
self.client_evt.set()
# wait for the server thread to terminate
self.serv_evt.wait()
+ self.thread.join()
+ test_support.threading_cleanup(*self._threads)
# restore sys.stdout
sys.stdout = self.old_stdout
@@ -227,7 +241,7 @@ class DebuggingServerTests(TestCase):
self.assertEqual(self.output.getvalue(), mexpect)
-class NonConnectingTests(TestCase):
+class NonConnectingTests(unittest.TestCase):
def testNotConnected(self):
# Test various operations on an unconnected SMTP object that
@@ -248,24 +262,29 @@ class NonConnectingTests(TestCase):
# test response of client to a non-successful HELO message
-class BadHELOServerTests(TestCase):
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class BadHELOServerTests(unittest.TestCase):
def setUp(self):
self.old_stdout = sys.stdout
self.output = StringIO.StringIO()
sys.stdout = self.output
+ self._threads = test_support.threading_setup()
self.evt = threading.Event()
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.settimeout(15)
self.port = test_support.bind_port(self.sock)
servargs = (self.evt, "199 no hello for you!\n", self.sock)
- threading.Thread(target=server, args=servargs).start()
+ self.thread = threading.Thread(target=server, args=servargs)
+ self.thread.start()
self.evt.wait()
self.evt.clear()
def tearDown(self):
self.evt.wait()
+ self.thread.join()
+ test_support.threading_cleanup(*self._threads)
sys.stdout = self.old_stdout
def testFailingHELO(self):
@@ -347,6 +366,9 @@ class SimSMTPChannel(smtpd.SMTPChannel):
else:
self.push('550 No access for you!')
+ def handle_error(self):
+ raise
+
class SimSMTPServer(smtpd.SMTPServer):
@@ -365,12 +387,17 @@ class SimSMTPServer(smtpd.SMTPServer):
def add_feature(self, feature):
self._extra_features.append(feature)
+ def handle_error(self):
+ raise
+
# Test various SMTP & ESMTP commands/behaviors that require a simulated server
# (i.e., something with more features than DebuggingServer)
-class SMTPSimTests(TestCase):
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class SMTPSimTests(unittest.TestCase):
def setUp(self):
+ self._threads = test_support.threading_setup()
self.serv_evt = threading.Event()
self.client_evt = threading.Event()
# Pick a random unused port by passing 0 for the port number
@@ -378,7 +405,8 @@ class SMTPSimTests(TestCase):
# Keep a note of what port was assigned
self.port = self.serv.socket.getsockname()[1]
serv_args = (self.serv, self.serv_evt, self.client_evt)
- threading.Thread(target=debugging_server, args=serv_args).start()
+ self.thread = threading.Thread(target=debugging_server, args=serv_args)
+ self.thread.start()
# wait until server thread has assigned a port number
self.serv_evt.wait()
@@ -389,6 +417,8 @@ class SMTPSimTests(TestCase):
self.client_evt.set()
# wait for the server thread to terminate
self.serv_evt.wait()
+ self.thread.join()
+ test_support.threading_cleanup(*self._threads)
def testBasic(self):
# smoke test
diff --git a/Lib/test/test_smtpnet.py b/Lib/test/test_smtpnet.py
index 5b2e91adbd..2dc39eb8f7 100644
--- a/Lib/test/test_smtpnet.py
+++ b/Lib/test/test_smtpnet.py
@@ -11,9 +11,16 @@ class SmtpSSLTest(unittest.TestCase):
remotePort = 465
def test_connect(self):
- #Silently skip test if no SSL; in 2.7 we use SkipTest instead.
- if not hasattr(smtplib, 'SMTP_SSL'): return
- server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
+ test_support.get_attribute(smtplib, 'SMTP_SSL')
+ with test_support.transient_internet(self.testServer):
+ server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
+ server.ehlo()
+ server.quit()
+
+ def test_connect_default_port(self):
+ test_support.get_attribute(smtplib, 'SMTP_SSL')
+ with test_support.transient_internet(self.testServer):
+ server = smtplib.SMTP_SSL(self.testServer)
server.ehlo()
server.quit()
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 3874a0f97e..12e09dddeb 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -6,15 +6,39 @@ from test import test_support
import errno
import socket
import select
-import thread, threading
import time
import traceback
import Queue
import sys
import os
import array
+import contextlib
from weakref import proxy
import signal
+import math
+
+def try_address(host, port=0, family=socket.AF_INET):
+ """Try to bind a socket on the given host:port and return True
+ if that has been possible."""
+ try:
+ sock = socket.socket(family, socket.SOCK_STREAM)
+ sock.bind((host, port))
+ except (socket.error, socket.gaierror):
+ return False
+ else:
+ sock.close()
+ return True
+
+HOST = test_support.HOST
+MSG = b'Michael Gilfix was here\n'
+SUPPORTS_IPV6 = socket.has_ipv6 and try_address('::1', family=socket.AF_INET6)
+
+try:
+ import thread
+ import threading
+except ImportError:
+ thread = None
+ threading = None
HOST = test_support.HOST
MSG = 'Michael Gilfix was here\n'
@@ -123,7 +147,7 @@ class ThreadableTest:
self.server_ready.wait()
self.client_ready.set()
self.clientSetUp()
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
if not callable(test_func):
raise TypeError("test_func must be a callable function.")
try:
@@ -162,6 +186,11 @@ class ThreadedUDPSocketTest(SocketUDPTest, ThreadableTest):
def clientSetUp(self):
self.cli = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ def clientTearDown(self):
+ self.cli.close()
+ self.cli = None
+ ThreadableTest.clientTearDown(self)
+
class SocketConnectedTest(ThreadedTCPSocketTest):
def __init__(self, methodName='runTest'):
@@ -238,13 +267,52 @@ class GeneralModuleTests(unittest.TestCase):
raise socket.herror
def raise_gaierror(*args, **kwargs):
raise socket.gaierror
- self.failUnlessRaises(socket.error, raise_error,
+ self.assertRaises(socket.error, raise_error,
"Error raising socket exception.")
- self.failUnlessRaises(socket.error, raise_herror,
+ self.assertRaises(socket.error, raise_herror,
"Error raising socket exception.")
- self.failUnlessRaises(socket.error, raise_gaierror,
+ self.assertRaises(socket.error, raise_gaierror,
"Error raising socket exception.")
+ def testSendtoErrors(self):
+ # Testing that sendto doens't masks failures. See #10169.
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ self.addCleanup(s.close)
+ s.bind(('', 0))
+ sockname = s.getsockname()
+ # 2 args
+ with self.assertRaises(UnicodeEncodeError):
+ s.sendto(u'\u2620', sockname)
+ with self.assertRaises(TypeError) as cm:
+ s.sendto(5j, sockname)
+ self.assertIn('not complex', str(cm.exception))
+ with self.assertRaises(TypeError) as cm:
+ s.sendto('foo', None)
+ self.assertIn('not NoneType', str(cm.exception))
+ # 3 args
+ with self.assertRaises(UnicodeEncodeError):
+ s.sendto(u'\u2620', 0, sockname)
+ with self.assertRaises(TypeError) as cm:
+ s.sendto(5j, 0, sockname)
+ self.assertIn('not complex', str(cm.exception))
+ with self.assertRaises(TypeError) as cm:
+ s.sendto('foo', 0, None)
+ self.assertIn('not NoneType', str(cm.exception))
+ with self.assertRaises(TypeError) as cm:
+ s.sendto('foo', 'bar', sockname)
+ self.assertIn('an integer is required', str(cm.exception))
+ with self.assertRaises(TypeError) as cm:
+ s.sendto('foo', None, None)
+ self.assertIn('an integer is required', str(cm.exception))
+ # wrong number of args
+ with self.assertRaises(TypeError) as cm:
+ s.sendto('foo')
+ self.assertIn('(1 given)', str(cm.exception))
+ with self.assertRaises(TypeError) as cm:
+ s.sendto('foo', 0, sockname, 4)
+ self.assertIn('(4 given)', str(cm.exception))
+
+
def testCrucialConstants(self):
# Testing for mission critical constants
socket.AF_INET
@@ -264,7 +332,7 @@ class GeneralModuleTests(unittest.TestCase):
except socket.error:
# Probably name lookup wasn't set up right; skip this test
return
- self.assert_(ip.find('.') >= 0, "Error resolving host to ip.")
+ self.assertTrue(ip.find('.') >= 0, "Error resolving host to ip.")
try:
hname, aliases, ipaddrs = socket.gethostbyaddr(ip)
except socket.error:
@@ -327,8 +395,10 @@ class GeneralModuleTests(unittest.TestCase):
# Find one service that exists, then check all the related interfaces.
# I've ordered this by protocols that have both a tcp and udp
# protocol, at least for modern Linuxes.
- if sys.platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6',
- 'freebsd7', 'freebsd8', 'darwin'):
+ if (sys.platform.startswith('linux') or
+ sys.platform.startswith('freebsd') or
+ sys.platform.startswith('netbsd') or
+ sys.platform == 'darwin'):
# avoid the 'echo' service on this platform, as there is an
# assumption breaking non-standard port/protocol entry
services = ('daytime', 'qotd', 'domain')
@@ -357,6 +427,9 @@ class GeneralModuleTests(unittest.TestCase):
eq(socket.getservbyport(port, 'tcp'), service)
if udpport is not None:
eq(socket.getservbyport(udpport, 'udp'), service)
+ # Make sure getservbyport does not accept out of range ports.
+ self.assertRaises(OverflowError, socket.getservbyport, -1)
+ self.assertRaises(OverflowError, socket.getservbyport, 65536)
def testDefaultTimeout(self):
# Testing default timeout
@@ -391,8 +464,8 @@ class GeneralModuleTests(unittest.TestCase):
return # No inet_aton, nothing to check
# Test that issue1008086 and issue767150 are fixed.
# It must return 4 bytes.
- self.assertEquals('\x00'*4, socket.inet_aton('0.0.0.0'))
- self.assertEquals('\xff'*4, socket.inet_aton('255.255.255.255'))
+ self.assertEqual('\x00'*4, socket.inet_aton('0.0.0.0'))
+ self.assertEqual('\xff'*4, socket.inet_aton('255.255.255.255'))
def testIPv4toString(self):
if not hasattr(socket, 'inet_pton'):
@@ -400,16 +473,16 @@ class GeneralModuleTests(unittest.TestCase):
from socket import inet_aton as f, inet_pton, AF_INET
g = lambda a: inet_pton(AF_INET, a)
- self.assertEquals('\x00\x00\x00\x00', f('0.0.0.0'))
- self.assertEquals('\xff\x00\xff\x00', f('255.0.255.0'))
- self.assertEquals('\xaa\xaa\xaa\xaa', f('170.170.170.170'))
- self.assertEquals('\x01\x02\x03\x04', f('1.2.3.4'))
- self.assertEquals('\xff\xff\xff\xff', f('255.255.255.255'))
+ self.assertEqual('\x00\x00\x00\x00', f('0.0.0.0'))
+ self.assertEqual('\xff\x00\xff\x00', f('255.0.255.0'))
+ self.assertEqual('\xaa\xaa\xaa\xaa', f('170.170.170.170'))
+ self.assertEqual('\x01\x02\x03\x04', f('1.2.3.4'))
+ self.assertEqual('\xff\xff\xff\xff', f('255.255.255.255'))
- self.assertEquals('\x00\x00\x00\x00', g('0.0.0.0'))
- self.assertEquals('\xff\x00\xff\x00', g('255.0.255.0'))
- self.assertEquals('\xaa\xaa\xaa\xaa', g('170.170.170.170'))
- self.assertEquals('\xff\xff\xff\xff', g('255.255.255.255'))
+ self.assertEqual('\x00\x00\x00\x00', g('0.0.0.0'))
+ self.assertEqual('\xff\x00\xff\x00', g('255.0.255.0'))
+ self.assertEqual('\xaa\xaa\xaa\xaa', g('170.170.170.170'))
+ self.assertEqual('\xff\xff\xff\xff', g('255.255.255.255'))
def testIPv6toString(self):
if not hasattr(socket, 'inet_pton'):
@@ -422,10 +495,10 @@ class GeneralModuleTests(unittest.TestCase):
return
f = lambda a: inet_pton(AF_INET6, a)
- self.assertEquals('\x00' * 16, f('::'))
- self.assertEquals('\x00' * 16, f('0::0'))
- self.assertEquals('\x00\x01' + '\x00' * 14, f('1::'))
- self.assertEquals(
+ self.assertEqual('\x00' * 16, f('::'))
+ self.assertEqual('\x00' * 16, f('0::0'))
+ self.assertEqual('\x00\x01' + '\x00' * 14, f('1::'))
+ self.assertEqual(
'\x45\xef\x76\xcb\x00\x1a\x56\xef\xaf\xeb\x0b\xac\x19\x24\xae\xae',
f('45ef:76cb:1a:56ef:afeb:bac:1924:aeae')
)
@@ -436,14 +509,14 @@ class GeneralModuleTests(unittest.TestCase):
from socket import inet_ntoa as f, inet_ntop, AF_INET
g = lambda a: inet_ntop(AF_INET, a)
- self.assertEquals('1.0.1.0', f('\x01\x00\x01\x00'))
- self.assertEquals('170.85.170.85', f('\xaa\x55\xaa\x55'))
- self.assertEquals('255.255.255.255', f('\xff\xff\xff\xff'))
- self.assertEquals('1.2.3.4', f('\x01\x02\x03\x04'))
+ self.assertEqual('1.0.1.0', f('\x01\x00\x01\x00'))
+ self.assertEqual('170.85.170.85', f('\xaa\x55\xaa\x55'))
+ self.assertEqual('255.255.255.255', f('\xff\xff\xff\xff'))
+ self.assertEqual('1.2.3.4', f('\x01\x02\x03\x04'))
- self.assertEquals('1.0.1.0', g('\x01\x00\x01\x00'))
- self.assertEquals('170.85.170.85', g('\xaa\x55\xaa\x55'))
- self.assertEquals('255.255.255.255', g('\xff\xff\xff\xff'))
+ self.assertEqual('1.0.1.0', g('\x01\x00\x01\x00'))
+ self.assertEqual('170.85.170.85', g('\xaa\x55\xaa\x55'))
+ self.assertEqual('255.255.255.255', g('\xff\xff\xff\xff'))
def testStringToIPv6(self):
if not hasattr(socket, 'inet_ntop'):
@@ -456,47 +529,62 @@ class GeneralModuleTests(unittest.TestCase):
return
f = lambda a: inet_ntop(AF_INET6, a)
- self.assertEquals('::', f('\x00' * 16))
- self.assertEquals('::1', f('\x00' * 15 + '\x01'))
- self.assertEquals(
+ self.assertEqual('::', f('\x00' * 16))
+ self.assertEqual('::1', f('\x00' * 15 + '\x01'))
+ self.assertEqual(
'aef:b01:506:1001:ffff:9997:55:170',
f('\x0a\xef\x0b\x01\x05\x06\x10\x01\xff\xff\x99\x97\x00\x55\x01\x70')
)
# XXX The following don't test module-level functionality...
- def testSockName(self):
- # Testing getsockname(). Use a temporary socket to elicit an unused
- # ephemeral port that we can use later in the test.
+ def _get_unused_port(self, bind_address='0.0.0.0'):
+ """Use a temporary socket to elicit an unused ephemeral port.
+
+ Args:
+ bind_address: Hostname or IP address to search for a port on.
+
+ Returns: A most likely to be unused port.
+ """
tempsock = socket.socket()
- tempsock.bind(("0.0.0.0", 0))
- (host, port) = tempsock.getsockname()
+ tempsock.bind((bind_address, 0))
+ host, port = tempsock.getsockname()
tempsock.close()
- del tempsock
+ return port
+ def testSockName(self):
+ # Testing getsockname()
+ port = self._get_unused_port()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(sock.close)
sock.bind(("0.0.0.0", port))
name = sock.getsockname()
# XXX(nnorwitz): http://tinyurl.com/os5jz seems to indicate
# it reasonable to get the host's addr in addition to 0.0.0.0.
# At least for eCos. This is required for the S/390 to pass.
- my_ip_addr = socket.gethostbyname(socket.gethostname())
- self.assert_(name[0] in ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
+ try:
+ my_ip_addr = socket.gethostbyname(socket.gethostname())
+ except socket.error:
+ # Probably name lookup wasn't set up right; skip this test
+ return
+ self.assertIn(name[0], ("0.0.0.0", my_ip_addr), '%s invalid' % name[0])
self.assertEqual(name[1], port)
def testGetSockOpt(self):
# Testing getsockopt()
# We know a socket should start without reuse==0
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(sock.close)
reuse = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)
- self.failIf(reuse != 0, "initial mode is reuse")
+ self.assertFalse(reuse != 0, "initial mode is reuse")
def testSetSockOpt(self):
# Testing setsockopt()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(sock.close)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
reuse = sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR)
- self.failIf(reuse == 0, "failed to set reuse mode")
+ self.assertFalse(reuse == 0, "failed to set reuse mode")
def testSendAfterClose(self):
# testing send() after close() with timeout
@@ -513,15 +601,114 @@ class GeneralModuleTests(unittest.TestCase):
self.assertEqual(sock.proto, 0)
sock.close()
+ def test_getsockaddrarg(self):
+ host = '0.0.0.0'
+ port = self._get_unused_port(bind_address=host)
+ big_port = port + 65536
+ neg_port = port - 65536
+ sock = socket.socket()
+ try:
+ self.assertRaises(OverflowError, sock.bind, (host, big_port))
+ self.assertRaises(OverflowError, sock.bind, (host, neg_port))
+ sock.bind((host, port))
+ finally:
+ sock.close()
+
+ @unittest.skipUnless(os.name == "nt", "Windows specific")
def test_sock_ioctl(self):
- if os.name != "nt":
- return
- self.assert_(hasattr(socket.socket, 'ioctl'))
- self.assert_(hasattr(socket, 'SIO_RCVALL'))
- self.assert_(hasattr(socket, 'RCVALL_ON'))
- self.assert_(hasattr(socket, 'RCVALL_OFF'))
+ self.assertTrue(hasattr(socket.socket, 'ioctl'))
+ self.assertTrue(hasattr(socket, 'SIO_RCVALL'))
+ self.assertTrue(hasattr(socket, 'RCVALL_ON'))
+ self.assertTrue(hasattr(socket, 'RCVALL_OFF'))
+ self.assertTrue(hasattr(socket, 'SIO_KEEPALIVE_VALS'))
+ s = socket.socket()
+ self.addCleanup(s.close)
+ self.assertRaises(ValueError, s.ioctl, -1, None)
+ s.ioctl(socket.SIO_KEEPALIVE_VALS, (1, 100, 100))
+
+ def testGetaddrinfo(self):
+ try:
+ socket.getaddrinfo('localhost', 80)
+ except socket.gaierror as err:
+ if err.errno == socket.EAI_SERVICE:
+ # see http://bugs.python.org/issue1282647
+ self.skipTest("buggy libc version")
+ raise
+ # len of every sequence is supposed to be == 5
+ for info in socket.getaddrinfo(HOST, None):
+ self.assertEqual(len(info), 5)
+ # host can be a domain name, a string representation of an
+ # IPv4/v6 address or None
+ socket.getaddrinfo('localhost', 80)
+ socket.getaddrinfo('127.0.0.1', 80)
+ socket.getaddrinfo(None, 80)
+ if SUPPORTS_IPV6:
+ socket.getaddrinfo('::1', 80)
+ # port can be a string service name such as "http", a numeric
+ # port number or None
+ socket.getaddrinfo(HOST, "http")
+ socket.getaddrinfo(HOST, 80)
+ socket.getaddrinfo(HOST, None)
+ # test family and socktype filters
+ infos = socket.getaddrinfo(HOST, None, socket.AF_INET)
+ for family, _, _, _, _ in infos:
+ self.assertEqual(family, socket.AF_INET)
+ infos = socket.getaddrinfo(HOST, None, 0, socket.SOCK_STREAM)
+ for _, socktype, _, _, _ in infos:
+ self.assertEqual(socktype, socket.SOCK_STREAM)
+ # test proto and flags arguments
+ socket.getaddrinfo(HOST, None, 0, 0, socket.SOL_TCP)
+ socket.getaddrinfo(HOST, None, 0, 0, 0, socket.AI_PASSIVE)
+ # a server willing to support both IPv4 and IPv6 will
+ # usually do this
+ socket.getaddrinfo(None, 0, socket.AF_UNSPEC, socket.SOCK_STREAM, 0,
+ socket.AI_PASSIVE)
+
+
+ def check_sendall_interrupted(self, with_timeout):
+ # socketpair() is not stricly required, but it makes things easier.
+ if not hasattr(signal, 'alarm') or not hasattr(socket, 'socketpair'):
+ self.skipTest("signal.alarm and socket.socketpair required for this test")
+ # Our signal handlers clobber the C errno by calling a math function
+ # with an invalid domain value.
+ def ok_handler(*args):
+ self.assertRaises(ValueError, math.acosh, 0)
+ def raising_handler(*args):
+ self.assertRaises(ValueError, math.acosh, 0)
+ 1 // 0
+ c, s = socket.socketpair()
+ old_alarm = signal.signal(signal.SIGALRM, raising_handler)
+ try:
+ if with_timeout:
+ # Just above the one second minimum for signal.alarm
+ c.settimeout(1.5)
+ with self.assertRaises(ZeroDivisionError):
+ signal.alarm(1)
+ c.sendall(b"x" * (1024**2))
+ if with_timeout:
+ signal.signal(signal.SIGALRM, ok_handler)
+ signal.alarm(1)
+ self.assertRaises(socket.timeout, c.sendall, b"x" * (1024**2))
+ finally:
+ signal.signal(signal.SIGALRM, old_alarm)
+ c.close()
+ s.close()
+
+ def test_sendall_interrupted(self):
+ self.check_sendall_interrupted(False)
+
+ def test_sendall_interrupted_with_timeout(self):
+ self.check_sendall_interrupted(True)
+
+ def testListenBacklog0(self):
+ srv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ srv.bind((HOST, 0))
+ # backlog = 0
+ srv.listen(0)
+ srv.close()
+@unittest.skipUnless(thread, 'Threading required for this test.')
class BasicTCPTest(SocketConnectedTest):
def __init__(self, methodName='runTest'):
@@ -583,12 +770,23 @@ class BasicTCPTest(SocketConnectedTest):
return # On Windows, this doesn't exist
fd = self.cli_conn.fileno()
sock = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(sock.close)
msg = sock.recv(1024)
self.assertEqual(msg, MSG)
def _testFromFd(self):
self.serv_conn.send(MSG)
+ def testDup(self):
+ # Testing dup()
+ sock = self.cli_conn.dup()
+ self.addCleanup(sock.close)
+ msg = sock.recv(1024)
+ self.assertEqual(msg, MSG)
+
+ def _testDup(self):
+ self.serv_conn.send(MSG)
+
def testShutdown(self):
# Testing shutdown()
msg = self.cli_conn.recv(1024)
@@ -602,6 +800,7 @@ class BasicTCPTest(SocketConnectedTest):
self.serv_conn.send(MSG)
self.serv_conn.shutdown(2)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class BasicUDPTest(ThreadedUDPSocketTest):
def __init__(self, methodName='runTest'):
@@ -630,6 +829,7 @@ class BasicUDPTest(ThreadedUDPSocketTest):
def _testRecvFromNegative(self):
self.cli.sendto(MSG, 0, (HOST, self.port))
+@unittest.skipUnless(thread, 'Threading required for this test.')
class TCPCloserTest(ThreadedTCPSocketTest):
def testClose(self):
@@ -645,6 +845,7 @@ class TCPCloserTest(ThreadedTCPSocketTest):
self.cli.connect((HOST, self.port))
time.sleep(1.0)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class BasicSocketPairTest(SocketPairTest):
def __init__(self, methodName='runTest'):
@@ -664,6 +865,7 @@ class BasicSocketPairTest(SocketPairTest):
msg = self.cli.recv(1024)
self.assertEqual(msg, MSG)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class NonBlockingTCPTests(ThreadedTCPSocketTest):
def __init__(self, methodName='runTest'):
@@ -678,7 +880,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
except socket.error:
pass
end = time.time()
- self.assert_((end - start) < 1.0, "Error setting non-blocking mode.")
+ self.assertTrue((end - start) < 1.0, "Error setting non-blocking mode.")
def _testSetBlocking(self):
pass
@@ -695,6 +897,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
read, write, err = select.select([self.serv], [], [])
if self.serv in read:
conn, addr = self.serv.accept()
+ conn.close()
else:
self.fail("Error trying to do accept after select.")
@@ -705,6 +908,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
def testConnect(self):
# Testing non-blocking connect
conn, addr = self.serv.accept()
+ conn.close()
def _testConnect(self):
self.cli.settimeout(10)
@@ -723,6 +927,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
read, write, err = select.select([conn], [], [])
if conn in read:
msg = conn.recv(len(MSG))
+ conn.close()
self.assertEqual(msg, MSG)
else:
self.fail("Error during select call to non-blocking socket.")
@@ -732,6 +937,7 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
time.sleep(0.1)
self.cli.send(MSG)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class FileObjectClassTestCase(SocketConnectedTest):
bufsize = -1 # Use default buffer size
@@ -745,7 +951,7 @@ class FileObjectClassTestCase(SocketConnectedTest):
def tearDown(self):
self.serv_file.close()
- self.assert_(self.serv_file.closed)
+ self.assertTrue(self.serv_file.closed)
self.serv_file = None
SocketConnectedTest.tearDown(self)
@@ -755,7 +961,7 @@ class FileObjectClassTestCase(SocketConnectedTest):
def clientTearDown(self):
self.cli_file.close()
- self.assert_(self.cli_file.closed)
+ self.assertTrue(self.cli_file.closed)
self.cli_file = None
SocketConnectedTest.clientTearDown(self)
@@ -830,10 +1036,10 @@ class FileObjectClassTestCase(SocketConnectedTest):
self.cli_file.write("End Of Line")
def testClosedAttr(self):
- self.assert_(not self.serv_file.closed)
+ self.assertTrue(not self.serv_file.closed)
def _testClosedAttr(self):
- self.assert_(not self.cli_file.closed)
+ self.assertTrue(not self.cli_file.closed)
class FileObjectInterruptedTestCase(unittest.TestCase):
@@ -860,8 +1066,8 @@ class FileObjectInterruptedTestCase(unittest.TestCase):
lambda : "",
])
fo = socket._fileobject(mock_sock, **kwargs)
- self.assertEquals(fo.readline(size), "This is the first line\n")
- self.assertEquals(fo.readline(size), "And the second line is here\n")
+ self.assertEqual(fo.readline(size), "This is the first line\n")
+ self.assertEqual(fo.readline(size), "And the second line is here\n")
def _test_read(self, size=-1, **kwargs):
mock_sock = self.MockSocket(recv_funcs=[
@@ -871,7 +1077,7 @@ class FileObjectInterruptedTestCase(unittest.TestCase):
lambda : "",
])
fo = socket._fileobject(mock_sock, **kwargs)
- self.assertEquals(fo.read(size), "This is the first line\n"
+ self.assertEqual(fo.read(size), "This is the first line\n"
"And the second line is here\n")
def test_default(self):
@@ -896,8 +1102,8 @@ class FileObjectInterruptedTestCase(unittest.TestCase):
lambda : "",
])
fo = socket._fileobject(mock_sock, bufsize=0)
- self.assertEquals(fo.readline(size), "aa\n")
- self.assertEquals(fo.readline(size), "BBbb")
+ self.assertEqual(fo.readline(size), "aa\n")
+ self.assertEqual(fo.readline(size), "BBbb")
def test_no_buffer(self):
self._test_readline_no_buffer()
@@ -954,13 +1160,45 @@ class BasicTCPTest2(NetworkConnectionTest, BasicTCPTest):
"""
class NetworkConnectionNoServer(unittest.TestCase):
- def testWithoutServer(self):
+ class MockSocket(socket.socket):
+ def connect(self, *args):
+ raise socket.timeout('timed out')
+
+ @contextlib.contextmanager
+ def mocked_socket_module(self):
+ """Return a socket which times out on connect"""
+ old_socket = socket.socket
+ socket.socket = self.MockSocket
+ try:
+ yield
+ finally:
+ socket.socket = old_socket
+
+ def test_connect(self):
port = test_support.find_unused_port()
- self.failUnlessRaises(
- socket.error,
- lambda: socket.create_connection((HOST, port))
- )
+ cli = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.addCleanup(cli.close)
+ with self.assertRaises(socket.error) as cm:
+ cli.connect((HOST, port))
+ self.assertEqual(cm.exception.errno, errno.ECONNREFUSED)
+
+ def test_create_connection(self):
+ # Issue #9792: errors raised by create_connection() should have
+ # a proper errno attribute.
+ port = test_support.find_unused_port()
+ with self.assertRaises(socket.error) as cm:
+ socket.create_connection((HOST, port))
+ self.assertEqual(cm.exception.errno, errno.ECONNREFUSED)
+
+ def test_create_connection_timeout(self):
+ # Issue #9792: create_connection() should not recast timeout errors
+ # as generic socket errors.
+ with self.mocked_socket_module():
+ with self.assertRaises(socket.timeout):
+ socket.create_connection((HOST, 1234))
+
+@unittest.skipUnless(thread, 'Threading required for this test.')
class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
def __init__(self, methodName='runTest'):
@@ -968,7 +1206,7 @@ class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
ThreadableTest.__init__(self)
def clientSetUp(self):
- pass
+ self.source_port = test_support.find_unused_port()
def clientTearDown(self):
self.cli.close()
@@ -977,30 +1215,43 @@ class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
def _justAccept(self):
conn, addr = self.serv.accept()
+ conn.close()
testFamily = _justAccept
def _testFamily(self):
self.cli = socket.create_connection((HOST, self.port), timeout=30)
+ self.addCleanup(self.cli.close)
self.assertEqual(self.cli.family, 2)
+ testSourceAddress = _justAccept
+ def _testSourceAddress(self):
+ self.cli = socket.create_connection((HOST, self.port), timeout=30,
+ source_address=('', self.source_port))
+ self.addCleanup(self.cli.close)
+ self.assertEqual(self.cli.getsockname()[1], self.source_port)
+ # The port number being used is sufficient to show that the bind()
+ # call happened.
+
testTimeoutDefault = _justAccept
def _testTimeoutDefault(self):
# passing no explicit timeout uses socket's global default
- self.assert_(socket.getdefaulttimeout() is None)
+ self.assertTrue(socket.getdefaulttimeout() is None)
socket.setdefaulttimeout(42)
try:
self.cli = socket.create_connection((HOST, self.port))
+ self.addCleanup(self.cli.close)
finally:
socket.setdefaulttimeout(None)
- self.assertEquals(self.cli.gettimeout(), 42)
+ self.assertEqual(self.cli.gettimeout(), 42)
testTimeoutNone = _justAccept
def _testTimeoutNone(self):
# None timeout means the same as sock.settimeout(None)
- self.assert_(socket.getdefaulttimeout() is None)
+ self.assertTrue(socket.getdefaulttimeout() is None)
socket.setdefaulttimeout(30)
try:
self.cli = socket.create_connection((HOST, self.port), timeout=None)
+ self.addCleanup(self.cli.close)
finally:
socket.setdefaulttimeout(None)
self.assertEqual(self.cli.gettimeout(), None)
@@ -1013,8 +1264,10 @@ class NetworkConnectionAttributesTest(SocketTCPTest, ThreadableTest):
testTimeoutValueNonamed = _justAccept
def _testTimeoutValueNonamed(self):
self.cli = socket.create_connection((HOST, self.port), 30)
+ self.addCleanup(self.cli.close)
self.assertEqual(self.cli.gettimeout(), 30)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class NetworkConnectionBehaviourTest(SocketTCPTest, ThreadableTest):
def __init__(self, methodName='runTest'):
@@ -1031,6 +1284,7 @@ class NetworkConnectionBehaviourTest(SocketTCPTest, ThreadableTest):
def testInsideTimeout(self):
conn, addr = self.serv.accept()
+ self.addCleanup(conn.close)
time.sleep(3)
conn.send("done!")
testOutsideTimeout = testInsideTimeout
@@ -1042,31 +1296,7 @@ class NetworkConnectionBehaviourTest(SocketTCPTest, ThreadableTest):
def _testOutsideTimeout(self):
self.cli = sock = socket.create_connection((HOST, self.port), timeout=1)
- self.failUnlessRaises(socket.timeout, lambda: sock.recv(5))
-
-class TestIssue9543(SocketTCPTest, NetworkConnectionTest):
- """
- This test exercises the code in the _fileobject.flush() method when the
- whole write buffer hasn't been flushed.
- See http://bugs.python.org/issue9543
- """
- # XXX: this is just a sanity check, proper tests for flush() should still
- # be added
- def setUp(self):
- SocketTCPTest.setUp(self)
- NetworkConnectionTest.clientSetUp(self)
-
- def test_issue9543(self):
- self.cli.close()
- file_a = self.serv.makefile('w')
- file_a.write('x')
- # flush() will try to send data to self.cli and raise an error because
- # it's closed
- self.assertRaises(socket.error, file_a.flush)
- # close() will raise an error too, because it calls flush() before
- # closing the file
- self.assertRaises(socket.error, file_a.close)
- self.assertTrue(file_a.closed)
+ self.assertRaises(socket.timeout, lambda: sock.recv(5))
class Urllib2FileobjectTest(unittest.TestCase):
@@ -1086,12 +1316,12 @@ class Urllib2FileobjectTest(unittest.TestCase):
s = MockSocket()
f = socket._fileobject(s)
f.close()
- self.assert_(not s.closed)
+ self.assertTrue(not s.closed)
s = MockSocket()
f = socket._fileobject(s, close=True)
f.close()
- self.assert_(s.closed)
+ self.assertTrue(s.closed)
class TCPTimeoutTest(SocketTCPTest):
@@ -1099,7 +1329,7 @@ class TCPTimeoutTest(SocketTCPTest):
def raise_timeout(*args, **kwargs):
self.serv.settimeout(1.0)
self.serv.accept()
- self.failUnlessRaises(socket.timeout, raise_timeout,
+ self.assertRaises(socket.timeout, raise_timeout,
"Error generating a timeout exception (TCP)")
def testTimeoutZero(self):
@@ -1156,7 +1386,7 @@ class UDPTimeoutTest(SocketTCPTest):
def raise_timeout(*args, **kwargs):
self.serv.settimeout(1.0)
self.serv.recv(1024)
- self.failUnlessRaises(socket.timeout, raise_timeout,
+ self.assertRaises(socket.timeout, raise_timeout,
"Error generating a timeout exception (UDP)")
def testTimeoutZero(self):
@@ -1176,10 +1406,10 @@ class UDPTimeoutTest(SocketTCPTest):
class TestExceptions(unittest.TestCase):
def testExceptionTree(self):
- self.assert_(issubclass(socket.error, Exception))
- self.assert_(issubclass(socket.herror, socket.error))
- self.assert_(issubclass(socket.gaierror, socket.error))
- self.assert_(issubclass(socket.timeout, socket.error))
+ self.assertTrue(issubclass(socket.error, Exception))
+ self.assertTrue(issubclass(socket.herror, socket.error))
+ self.assertTrue(issubclass(socket.gaierror, socket.error))
+ self.assertTrue(issubclass(socket.timeout, socket.error))
class TestLinuxAbstractNamespace(unittest.TestCase):
@@ -1208,6 +1438,7 @@ class TestLinuxAbstractNamespace(unittest.TestCase):
self.assertRaises(socket.error, s.bind, address)
+@unittest.skipUnless(thread, 'Threading required for this test.')
class BufferIOTest(SocketConnectedTest):
"""
Test the buffer versions of socket.recv() and socket.send().
@@ -1215,30 +1446,66 @@ class BufferIOTest(SocketConnectedTest):
def __init__(self, methodName='runTest'):
SocketConnectedTest.__init__(self, methodName=methodName)
- def testRecvInto(self):
+ def testRecvIntoArray(self):
buf = array.array('c', ' '*1024)
nbytes = self.cli_conn.recv_into(buf)
self.assertEqual(nbytes, len(MSG))
msg = buf.tostring()[:len(MSG)]
self.assertEqual(msg, MSG)
- def _testRecvInto(self):
- with test_support._check_py3k_warnings():
+ def _testRecvIntoArray(self):
+ with test_support.check_py3k_warnings():
buf = buffer(MSG)
self.serv_conn.send(buf)
- def testRecvFromInto(self):
+ def testRecvIntoBytearray(self):
+ buf = bytearray(1024)
+ nbytes = self.cli_conn.recv_into(buf)
+ self.assertEqual(nbytes, len(MSG))
+ msg = buf[:len(MSG)]
+ self.assertEqual(msg, MSG)
+
+ _testRecvIntoBytearray = _testRecvIntoArray
+
+ def testRecvIntoMemoryview(self):
+ buf = bytearray(1024)
+ nbytes = self.cli_conn.recv_into(memoryview(buf))
+ self.assertEqual(nbytes, len(MSG))
+ msg = buf[:len(MSG)]
+ self.assertEqual(msg, MSG)
+
+ _testRecvIntoMemoryview = _testRecvIntoArray
+
+ def testRecvFromIntoArray(self):
buf = array.array('c', ' '*1024)
nbytes, addr = self.cli_conn.recvfrom_into(buf)
self.assertEqual(nbytes, len(MSG))
msg = buf.tostring()[:len(MSG)]
self.assertEqual(msg, MSG)
- def _testRecvFromInto(self):
- with test_support._check_py3k_warnings():
+ def _testRecvFromIntoArray(self):
+ with test_support.check_py3k_warnings():
buf = buffer(MSG)
self.serv_conn.send(buf)
+ def testRecvFromIntoBytearray(self):
+ buf = bytearray(1024)
+ nbytes, addr = self.cli_conn.recvfrom_into(buf)
+ self.assertEqual(nbytes, len(MSG))
+ msg = buf[:len(MSG)]
+ self.assertEqual(msg, MSG)
+
+ _testRecvFromIntoBytearray = _testRecvFromIntoArray
+
+ def testRecvFromIntoMemoryview(self):
+ buf = bytearray(1024)
+ nbytes, addr = self.cli_conn.recvfrom_into(memoryview(buf))
+ self.assertEqual(nbytes, len(MSG))
+ msg = buf[:len(MSG)]
+ self.assertEqual(msg, MSG)
+
+ _testRecvFromIntoMemoryview = _testRecvFromIntoArray
+
TIPC_STYPE = 2000
TIPC_LOWER = 200
@@ -1320,9 +1587,8 @@ class TIPCThreadableTest (unittest.TestCase, ThreadableTest):
def test_main():
tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
- TestExceptions, BufferIOTest, BasicTCPTest2]
- if sys.platform != 'mac':
- tests.extend([ BasicUDPTest, UDPTimeoutTest ])
+ TestExceptions, BufferIOTest, BasicTCPTest2, BasicUDPTest,
+ UDPTimeoutTest ]
tests.extend([
NonBlockingTCPTests,
@@ -1335,7 +1601,6 @@ def test_main():
NetworkConnectionNoServer,
NetworkConnectionAttributesTest,
NetworkConnectionBehaviourTest,
- TestIssue9543,
])
if hasattr(socket, "socketpair"):
tests.append(BasicSocketPairTest)
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index 27e1d3fa36..4825a4aed5 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -3,21 +3,21 @@ Test suite for SocketServer.py.
"""
import contextlib
-import errno
import imp
import os
import select
import signal
import socket
import tempfile
-import threading
-import time
import unittest
import SocketServer
import test.test_support
-from test.test_support import reap_children, verbose, TestSkipped
-from test.test_support import TESTFN as TEST_FILE
+from test.test_support import reap_children, reap_threads, verbose
+try:
+ import threading
+except ImportError:
+ threading = None
test.test_support.requires("network")
@@ -57,10 +57,11 @@ def simple_subprocess(testcase):
os._exit(72)
yield None
pid2, status = os.waitpid(pid, 0)
- testcase.assertEquals(pid2, pid)
- testcase.assertEquals(72 << 8, status)
+ testcase.assertEqual(pid2, pid)
+ testcase.assertEqual(72 << 8, status)
+@unittest.skipUnless(threading, 'Threading required for this test.')
class SocketServerTest(unittest.TestCase):
"""Test all socket servers."""
@@ -119,9 +120,11 @@ class SocketServerTest(unittest.TestCase):
if verbose: print "creating server"
server = MyServer(addr, MyHandler)
- self.assertEquals(server.server_address, server.socket.getsockname())
+ self.assertEqual(server.server_address, server.socket.getsockname())
return server
+ @unittest.skipUnless(threading, 'Threading required for this test.')
+ @reap_threads
def run_server(self, svrcls, hdlrbase, testfunc):
server = self.make_server(self.pickaddr(svrcls.address_family),
svrcls, hdlrbase)
@@ -158,7 +161,7 @@ class SocketServerTest(unittest.TestCase):
while data and '\n' not in buf:
data = receive(s, 100)
buf += data
- self.assertEquals(buf, TEST_STR)
+ self.assertEqual(buf, TEST_STR)
s.close()
def dgram_examine(self, proto, addr):
@@ -168,7 +171,7 @@ class SocketServerTest(unittest.TestCase):
while data and '\n' not in buf:
data = receive(s, 100)
buf += data
- self.assertEquals(buf, TEST_STR)
+ self.assertEqual(buf, TEST_STR)
s.close()
def test_TCPServer(self):
@@ -243,6 +246,7 @@ class SocketServerTest(unittest.TestCase):
# SocketServer.DatagramRequestHandler,
# self.dgram_examine)
+ @reap_threads
def test_shutdown(self):
# Issue #2302: shutdown() should always succeed in making an
# other thread leave serve_forever().
@@ -271,7 +275,7 @@ class SocketServerTest(unittest.TestCase):
def test_main():
if imp.lock_held():
# If the import lock is held, the threads will hang
- raise TestSkipped("can't run when import lock is held")
+ raise unittest.SkipTest("can't run when import lock is held")
test.test_support.run_unittest(SocketServerTest)
diff --git a/Lib/test/test_sort.py b/Lib/test/test_sort.py
index de175c5a7e..d75abc4917 100644
--- a/Lib/test/test_sort.py
+++ b/Lib/test/test_sort.py
@@ -274,7 +274,7 @@ def test_main(verbose=None):
TestBugs,
)
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
("the cmp argument is not supported", DeprecationWarning)):
test_support.run_unittest(*test_classes)
diff --git a/Lib/test/test_sqlite.py b/Lib/test/test_sqlite.py
index d63bb1d0f8..db273316ea 100644
--- a/Lib/test/test_sqlite.py
+++ b/Lib/test/test_sqlite.py
@@ -1,9 +1,8 @@
-from test.test_support import run_unittest, TestSkipped
+from test.test_support import run_unittest, import_module
+
+# Skip test if _sqlite3 module was not built.
+import_module('_sqlite3')
-try:
- import _sqlite3
-except ImportError:
- raise TestSkipped('no sqlite available')
from sqlite3.test import (dbapi, types, userfunctions, py25tests,
factory, transactions, hooks, regression,
dump)
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index c1e53ec1a6..3df4d0c34c 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -6,27 +6,21 @@ from test import test_support
import asyncore
import socket
import select
-import errno
-import subprocess
import time
import gc
import os
import errno
import pprint
import urllib, urlparse
-import shutil
import traceback
import weakref
+import functools
+import platform
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
-# Optionally test SSL support, if we have it in the tested platform
-skip_expected = False
-try:
- import ssl
-except ImportError:
- skip_expected = True
+ssl = test_support.import_module("ssl")
HOST = test_support.HOST
CERTFILE = None
@@ -57,8 +51,37 @@ class BasicTests(unittest.TestCase):
else:
raise
+# Issue #9415: Ubuntu hijacks their OpenSSL and forcefully disables SSLv2
+def skip_if_broken_ubuntu_ssl(func):
+ if hasattr(ssl, 'PROTOCOL_SSLv2'):
+ # We need to access the lower-level wrapper in order to create an
+ # implicit SSL context without trying to connect or listen.
+ try:
+ import _ssl
+ except ImportError:
+ # The returned function won't get executed, just ignore the error
+ pass
+ @functools.wraps(func)
+ def f(*args, **kwargs):
+ try:
+ s = socket.socket(socket.AF_INET)
+ _ssl.sslwrap(s._sock, 0, None, None,
+ ssl.CERT_NONE, ssl.PROTOCOL_SSLv2, None, None)
+ except ssl.SSLError as e:
+ if (ssl.OPENSSL_VERSION_INFO == (0, 9, 8, 15, 15) and
+ platform.linux_distribution() == ('debian', 'squeeze/sid', '')
+ and 'Invalid SSL protocol variant specified' in str(e)):
+ raise unittest.SkipTest("Patched Ubuntu OpenSSL breaks behaviour")
+ return func(*args, **kwargs)
+ return f
+ else:
+ return func
+
+
+class BasicSocketTests(unittest.TestCase):
+
def test_constants(self):
- ssl.PROTOCOL_SSLv2
+ #ssl.PROTOCOL_SSLv2
ssl.PROTOCOL_SSLv23
ssl.PROTOCOL_SSLv3
ssl.PROTOCOL_TLSv1
@@ -100,6 +123,52 @@ class BasicTests(unittest.TestCase):
if not p2.endswith('\n' + ssl.PEM_FOOTER + '\n'):
self.fail("DER-to-PEM didn't include correct footer:\n%r\n" % p2)
+ def test_openssl_version(self):
+ n = ssl.OPENSSL_VERSION_NUMBER
+ t = ssl.OPENSSL_VERSION_INFO
+ s = ssl.OPENSSL_VERSION
+ self.assertIsInstance(n, (int, long))
+ self.assertIsInstance(t, tuple)
+ self.assertIsInstance(s, str)
+ # Some sanity checks follow
+ # >= 0.9
+ self.assertGreaterEqual(n, 0x900000)
+ # < 2.0
+ self.assertLess(n, 0x20000000)
+ major, minor, fix, patch, status = t
+ self.assertGreaterEqual(major, 0)
+ self.assertLess(major, 2)
+ self.assertGreaterEqual(minor, 0)
+ self.assertLess(minor, 256)
+ self.assertGreaterEqual(fix, 0)
+ self.assertLess(fix, 256)
+ self.assertGreaterEqual(patch, 0)
+ self.assertLessEqual(patch, 26)
+ self.assertGreaterEqual(status, 0)
+ self.assertLessEqual(status, 15)
+ # Version string as returned by OpenSSL, the format might change
+ self.assertTrue(s.startswith("OpenSSL {:d}.{:d}.{:d}".format(major, minor, fix)),
+ (s, t))
+
+ def test_ciphers(self):
+ if not test_support.is_resource_enabled('network'):
+ return
+ remote = ("svn.python.org", 443)
+ with test_support.transient_internet(remote[0]):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_NONE, ciphers="ALL")
+ s.connect(remote)
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_NONE, ciphers="DEFAULT")
+ s.connect(remote)
+ # Error checking occurs when connecting, because the SSL context
+ # isn't created before.
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_NONE, ciphers="^$:,;?*'dorothyx")
+ with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"):
+ s.connect(remote)
+
+ @test_support.cpython_only
def test_refcycle(self):
# Issue #7943: an SSL object doesn't create reference cycles with
# itself.
@@ -109,120 +178,173 @@ class BasicTests(unittest.TestCase):
del ss
self.assertEqual(wr(), None)
+ def test_wrapped_unconnected(self):
+ # The _delegate_methods in socket.py are correctly delegated to by an
+ # unconnected SSLSocket, so they will raise a socket.error rather than
+ # something unexpected like TypeError.
+ s = socket.socket(socket.AF_INET)
+ ss = ssl.wrap_socket(s)
+ self.assertRaises(socket.error, ss.recv, 1)
+ self.assertRaises(socket.error, ss.recv_into, bytearray(b'x'))
+ self.assertRaises(socket.error, ss.recvfrom, 1)
+ self.assertRaises(socket.error, ss.recvfrom_into, bytearray(b'x'), 1)
+ self.assertRaises(socket.error, ss.send, b'x')
+ self.assertRaises(socket.error, ss.sendto, b'x', ('0.0.0.0', 0))
+
class NetworkedTests(unittest.TestCase):
def test_connect(self):
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_NONE)
- s.connect(("svn.python.org", 443))
- c = s.getpeercert()
- if c:
- self.fail("Peer cert %s shouldn't be here!")
- s.close()
-
- # this should fail because we have no verification certs
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_REQUIRED)
- try:
+ with test_support.transient_internet("svn.python.org"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_NONE)
s.connect(("svn.python.org", 443))
- except ssl.SSLError:
- pass
- finally:
+ c = s.getpeercert()
+ if c:
+ self.fail("Peer cert %s shouldn't be here!")
s.close()
- # this should succeed because we specify the root cert
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_REQUIRED,
- ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
- try:
- s.connect(("svn.python.org", 443))
- finally:
- s.close()
+ # this should fail because we have no verification certs
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED)
+ try:
+ s.connect(("svn.python.org", 443))
+ except ssl.SSLError:
+ pass
+ finally:
+ s.close()
+
+ # this should succeed because we specify the root cert
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
+ try:
+ s.connect(("svn.python.org", 443))
+ finally:
+ s.close()
+
+ def test_connect_ex(self):
+ # Issue #11326: check connect_ex() implementation
+ with test_support.transient_internet("svn.python.org"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
+ try:
+ self.assertEqual(0, s.connect_ex(("svn.python.org", 443)))
+ self.assertTrue(s.getpeercert())
+ finally:
+ s.close()
+ def test_non_blocking_connect_ex(self):
+ # Issue #11326: non-blocking connect_ex() should allow handshake
+ # to proceed after the socket gets ready.
+ with test_support.transient_internet("svn.python.org"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=SVN_PYTHON_ORG_ROOT_CERT,
+ do_handshake_on_connect=False)
+ try:
+ s.setblocking(False)
+ rc = s.connect_ex(('svn.python.org', 443))
+ # EWOULDBLOCK under Windows, EINPROGRESS elsewhere
+ self.assertIn(rc, (0, errno.EINPROGRESS, errno.EWOULDBLOCK))
+ # Wait for connect to finish
+ select.select([], [s], [], 5.0)
+ # Non-blocking handshake
+ while True:
+ try:
+ s.do_handshake()
+ break
+ except ssl.SSLError as err:
+ if err.args[0] == ssl.SSL_ERROR_WANT_READ:
+ select.select([s], [], [], 5.0)
+ elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
+ select.select([], [s], [], 5.0)
+ else:
+ raise
+ # SSL established
+ self.assertTrue(s.getpeercert())
+ finally:
+ s.close()
+
+ @unittest.skipIf(os.name == "nt", "Can't use a socket as a file under Windows")
def test_makefile_close(self):
# Issue #5238: creating a file-like object with makefile() shouldn't
# delay closing the underlying "real socket" (here tested with its
# file descriptor, hence skipping the test under Windows).
- if os.name == "nt":
- if test_support.verbose:
- print "Skipped: can't use a socket as a file under Windows"
- return
- ss = ssl.wrap_socket(socket.socket(socket.AF_INET))
- ss.connect(("svn.python.org", 443))
- fd = ss.fileno()
- f = ss.makefile()
- f.close()
- # The fd is still open
- os.read(fd, 0)
- # Closing the SSL socket should close the fd too
- ss.close()
- gc.collect()
- try:
+ with test_support.transient_internet("svn.python.org"):
+ ss = ssl.wrap_socket(socket.socket(socket.AF_INET))
+ ss.connect(("svn.python.org", 443))
+ fd = ss.fileno()
+ f = ss.makefile()
+ f.close()
+ # The fd is still open
os.read(fd, 0)
- except OSError, e:
- self.assertEqual(e.errno, errno.EBADF)
- else:
- self.fail("OSError wasn't raised")
+ # Closing the SSL socket should close the fd too
+ ss.close()
+ gc.collect()
+ with self.assertRaises(OSError) as e:
+ os.read(fd, 0)
+ self.assertEqual(e.exception.errno, errno.EBADF)
def test_non_blocking_handshake(self):
- s = socket.socket(socket.AF_INET)
- s.connect(("svn.python.org", 443))
- s.setblocking(False)
- s = ssl.wrap_socket(s,
- cert_reqs=ssl.CERT_NONE,
- do_handshake_on_connect=False)
- count = 0
- while True:
- try:
- count += 1
- s.do_handshake()
- break
- except ssl.SSLError, err:
- if err.args[0] == ssl.SSL_ERROR_WANT_READ:
- select.select([s], [], [])
- elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
- select.select([], [s], [])
- else:
- raise
- s.close()
- if test_support.verbose:
- sys.stdout.write("\nNeeded %d calls to do_handshake() to establish session.\n" % count)
+ with test_support.transient_internet("svn.python.org"):
+ s = socket.socket(socket.AF_INET)
+ s.connect(("svn.python.org", 443))
+ s.setblocking(False)
+ s = ssl.wrap_socket(s,
+ cert_reqs=ssl.CERT_NONE,
+ do_handshake_on_connect=False)
+ count = 0
+ while True:
+ try:
+ count += 1
+ s.do_handshake()
+ break
+ except ssl.SSLError, err:
+ if err.args[0] == ssl.SSL_ERROR_WANT_READ:
+ select.select([s], [], [])
+ elif err.args[0] == ssl.SSL_ERROR_WANT_WRITE:
+ select.select([], [s], [])
+ else:
+ raise
+ s.close()
+ if test_support.verbose:
+ sys.stdout.write("\nNeeded %d calls to do_handshake() to establish session.\n" % count)
def test_get_server_certificate(self):
- pem = ssl.get_server_certificate(("svn.python.org", 443))
- if not pem:
- self.fail("No server certificate on svn.python.org:443!")
+ with test_support.transient_internet("svn.python.org"):
+ pem = ssl.get_server_certificate(("svn.python.org", 443))
+ if not pem:
+ self.fail("No server certificate on svn.python.org:443!")
- try:
- pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=CERTFILE)
- except ssl.SSLError:
- #should fail
- pass
- else:
- self.fail("Got server certificate %s for svn.python.org!" % pem)
+ try:
+ pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=CERTFILE)
+ except ssl.SSLError:
+ #should fail
+ pass
+ else:
+ self.fail("Got server certificate %s for svn.python.org!" % pem)
- pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
- if not pem:
- self.fail("No server certificate on svn.python.org:443!")
- if test_support.verbose:
- sys.stdout.write("\nVerified certificate for svn.python.org:443 is\n%s\n" % pem)
+ pem = ssl.get_server_certificate(("svn.python.org", 443), ca_certs=SVN_PYTHON_ORG_ROOT_CERT)
+ if not pem:
+ self.fail("No server certificate on svn.python.org:443!")
+ if test_support.verbose:
+ sys.stdout.write("\nVerified certificate for svn.python.org:443 is\n%s\n" % pem)
- # Test disabled: OPENSSL_VERSION* not available in Python 2.6
def test_algorithms(self):
- if test_support.verbose:
- sys.stdout.write("test_algorithms disabled, "
- "as it fails on some old OpenSSL versions")
- return
# Issue #8484: all algorithms should be available when verifying a
# certificate.
+ # SHA256 was added in OpenSSL 0.9.8
+ if ssl.OPENSSL_VERSION_INFO < (0, 9, 8, 0, 15):
+ self.skipTest("SHA256 not available on %r" % ssl.OPENSSL_VERSION)
# NOTE: https://sha256.tbs-internet.com is another possible test host
- remote = ("sha2.hboeck.de", 443)
+ remote = ("sha256.tbs-internet.com", 443)
sha256_cert = os.path.join(os.path.dirname(__file__), "sha256.pem")
- s = ssl.wrap_socket(socket.socket(socket.AF_INET),
- cert_reqs=ssl.CERT_REQUIRED,
- ca_certs=sha256_cert,)
- with test_support.transient_internet():
+ with test_support.transient_internet("sha256.tbs-internet.com"):
+ s = ssl.wrap_socket(socket.socket(socket.AF_INET),
+ cert_reqs=ssl.CERT_REQUIRED,
+ ca_certs=sha256_cert,)
try:
s.connect(remote)
if test_support.verbose:
@@ -276,7 +398,8 @@ else:
certfile=self.server.certificate,
ssl_version=self.server.protocol,
ca_certs=self.server.cacerts,
- cert_reqs=self.server.certreqs)
+ cert_reqs=self.server.certreqs,
+ ciphers=self.server.ciphers)
except ssl.SSLError:
# XXX Various errors can have happened here, for example
# a mismatching protocol version, an invalid certificate,
@@ -362,7 +485,7 @@ else:
def __init__(self, certificate, ssl_version=None,
certreqs=None, cacerts=None,
chatty=True, connectionchatty=False, starttls_server=False,
- wrap_accepting_socket=False):
+ wrap_accepting_socket=False, ciphers=None):
if ssl_version is None:
ssl_version = ssl.PROTOCOL_TLSv1
@@ -372,6 +495,7 @@ else:
self.protocol = ssl_version
self.certreqs = certreqs
self.cacerts = cacerts
+ self.ciphers = ciphers
self.chatty = chatty
self.connectionchatty = connectionchatty
self.starttls_server = starttls_server
@@ -382,7 +506,8 @@ else:
certfile=self.certificate,
cert_reqs = self.certreqs,
ca_certs = self.cacerts,
- ssl_version = self.protocol)
+ ssl_version = self.protocol,
+ ciphers = self.ciphers)
if test_support.verbose and self.chatty:
sys.stdout.write(' server: wrapped server socket as %s\n' % str(self.sock))
self.port = test_support.bind_port(self.sock)
@@ -628,14 +753,14 @@ else:
if test_support.verbose:
sys.stdout.write("\nsocket.error is %s\n" % x[1])
else:
- self.fail("Use of invalid cert should have failed!")
+ raise AssertionError("Use of invalid cert should have failed!")
finally:
server.stop()
server.join()
def server_params_test(certfile, protocol, certreqs, cacertsfile,
client_certfile, client_protocol=None, indata="FOO\n",
- chatty=True, connectionchatty=False,
+ ciphers=None, chatty=True, connectionchatty=False,
wrap_accepting_socket=False):
"""
Launch a server, connect a client to it and try various reads
@@ -645,6 +770,7 @@ else:
certreqs=certreqs,
ssl_version=protocol,
cacerts=cacertsfile,
+ ciphers=ciphers,
chatty=chatty,
connectionchatty=connectionchatty,
wrap_accepting_socket=wrap_accepting_socket)
@@ -659,23 +785,25 @@ else:
s = ssl.wrap_socket(socket.socket(),
certfile=client_certfile,
ca_certs=cacertsfile,
+ ciphers=ciphers,
cert_reqs=certreqs,
ssl_version=client_protocol)
s.connect((HOST, server.port))
- if connectionchatty:
- if test_support.verbose:
- sys.stdout.write(
- " client: sending %s...\n" % (repr(indata)))
- s.write(indata)
- outdata = s.read()
- if connectionchatty:
- if test_support.verbose:
- sys.stdout.write(" client: read %s\n" % repr(outdata))
- if outdata != indata.lower():
- self.fail(
- "bad data <<%s>> (%d) received; expected <<%s>> (%d)\n"
- % (outdata[:min(len(outdata),20)], len(outdata),
- indata[:min(len(indata),20)].lower(), len(indata)))
+ for arg in [indata, bytearray(indata), memoryview(indata)]:
+ if connectionchatty:
+ if test_support.verbose:
+ sys.stdout.write(
+ " client: sending %s...\n" % (repr(arg)))
+ s.write(arg)
+ outdata = s.read()
+ if connectionchatty:
+ if test_support.verbose:
+ sys.stdout.write(" client: read %s\n" % repr(outdata))
+ if outdata != indata.lower():
+ raise AssertionError(
+ "bad data <<%s>> (%d) received; expected <<%s>> (%d)\n"
+ % (outdata[:min(len(outdata),20)], len(outdata),
+ indata[:min(len(indata),20)].lower(), len(indata)))
s.write("over\n")
if connectionchatty:
if test_support.verbose:
@@ -703,9 +831,12 @@ else:
ssl.get_protocol_name(server_protocol),
certtype))
try:
+ # NOTE: we must enable "ALL" ciphers, otherwise an SSLv23 client
+ # will send an SSLv3 hello (rather than SSLv2) starting from
+ # OpenSSL 1.0.0 (see issue #8322).
server_params_test(CERTFILE, server_protocol, certsreqs,
CERTFILE, CERTFILE, client_protocol,
- chatty=False)
+ ciphers="ALL", chatty=False)
# Protocol mismatch can result in either an SSLError, or a
# "Connection reset by peer" error.
except ssl.SSLError:
@@ -764,6 +895,7 @@ else:
finally:
t.join()
+ @skip_if_broken_ubuntu_ssl
def test_echo(self):
"""Basic test of an SSL client connecting to a server"""
if test_support.verbose:
@@ -829,12 +961,11 @@ else:
bad_cert_test(os.path.join(os.path.dirname(__file__) or os.curdir,
"badkey.pem"))
+ @skip_if_broken_ubuntu_ssl
def test_protocol_sslv2(self):
"""Connecting to an SSLv2 server with various client options"""
if test_support.verbose:
- sys.stdout.write("\ntest_protocol_sslv2 disabled, "
- "as it fails on OpenSSL 1.0.0+")
- return
+ sys.stdout.write("\n")
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_OPTIONAL)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv2, True, ssl.CERT_REQUIRED)
@@ -842,12 +973,11 @@ else:
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3, False)
try_protocol_combo(ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_TLSv1, False)
+ @skip_if_broken_ubuntu_ssl
def test_protocol_sslv23(self):
"""Connecting to an SSLv23 server with various client options"""
if test_support.verbose:
- sys.stdout.write("\ntest_protocol_sslv23 disabled, "
- "as it fails on OpenSSL 1.0.0+")
- return
+ sys.stdout.write("\n")
try:
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv2, True)
except (ssl.SSLError, socket.error), x:
@@ -868,29 +998,29 @@ else:
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_SSLv23, True, ssl.CERT_REQUIRED)
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, True, ssl.CERT_REQUIRED)
+ @skip_if_broken_ubuntu_ssl
def test_protocol_sslv3(self):
"""Connecting to an SSLv3 server with various client options"""
if test_support.verbose:
- sys.stdout.write("\ntest_protocol_sslv3 disabled, "
- "as it fails on OpenSSL 1.0.0+")
- return
+ sys.stdout.write("\n")
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True, ssl.CERT_OPTIONAL)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv3, True, ssl.CERT_REQUIRED)
- try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv2, False)
+ if hasattr(ssl, 'PROTOCOL_SSLv2'):
+ try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv2, False)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_SSLv23, False)
try_protocol_combo(ssl.PROTOCOL_SSLv3, ssl.PROTOCOL_TLSv1, False)
+ @skip_if_broken_ubuntu_ssl
def test_protocol_tlsv1(self):
"""Connecting to a TLSv1 server with various client options"""
if test_support.verbose:
- sys.stdout.write("\ntest_protocol_tlsv1 disabled, "
- "as it fails on OpenSSL 1.0.0+")
- return
+ sys.stdout.write("\n")
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True)
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True, ssl.CERT_OPTIONAL)
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_TLSv1, True, ssl.CERT_REQUIRED)
- try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv2, False)
+ if hasattr(ssl, 'PROTOCOL_SSLv2'):
+ try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv2, False)
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv3, False)
try_protocol_combo(ssl.PROTOCOL_TLSv1, ssl.PROTOCOL_SSLv23, False)
@@ -975,7 +1105,7 @@ else:
# now fetch the same data from the HTTPS server
url = 'https://127.0.0.1:%d/%s' % (
server.port, os.path.split(CERTFILE)[1])
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
f = urllib.urlopen(url)
dlen = f.info().getheader("content-length")
if dlen and (int(dlen) > 0):
@@ -1091,7 +1221,7 @@ else:
outdata = s.read()
outdata = outdata.decode('ASCII', 'strict')
if outdata != indata.lower():
- raise support.TestFailed(
+ self.fail(
"While sending with <<%s>> bad data "
"<<%r>> (%d) received; "
"expected <<%r>> (%d)\n" % (
@@ -1101,12 +1231,12 @@ else:
)
except ValueError as e:
if expect_success:
- raise support.TestFailed(
+ self.fail(
"Failed to send with method <<%s>>; "
"expected to succeed.\n" % (meth_name,)
)
if not str(e).startswith(meth_name):
- raise support.TestFailed(
+ self.fail(
"Method <<%s>> failed with unexpected "
"exception message: %s\n" % (
meth_name, e
@@ -1120,7 +1250,7 @@ else:
outdata = recv_meth(*args)
outdata = outdata.decode('ASCII', 'strict')
if outdata != indata.lower():
- raise support.TestFailed(
+ self.fail(
"While receiving with <<%s>> bad data "
"<<%r>> (%d) received; "
"expected <<%r>> (%d)\n" % (
@@ -1130,12 +1260,12 @@ else:
)
except ValueError as e:
if expect_success:
- raise support.TestFailed(
+ self.fail(
"Failed to receive with method <<%s>>; "
"expected to succeed.\n" % (meth_name,)
)
if not str(e).startswith(meth_name):
- raise support.TestFailed(
+ self.fail(
"Method <<%s>> failed with unexpected "
"exception message: %s\n" % (
meth_name, e
@@ -1179,12 +1309,8 @@ else:
c.settimeout(0.2)
c.connect((host, port))
# Will attempt handshake and time out
- try:
- ssl.wrap_socket(c)
- except ssl.SSLError, e:
- self.assertTrue("timed out" in str(e), str(e))
- else:
- self.fail("SSLError wasn't raised")
+ self.assertRaisesRegexp(ssl.SSLError, "timed out",
+ ssl.wrap_socket, c)
finally:
c.close()
try:
@@ -1192,12 +1318,8 @@ else:
c.settimeout(0.2)
c = ssl.wrap_socket(c)
# Will attempt handshake and time out
- try:
- c.connect((host, port))
- except ssl.SSLError, e:
- self.assertTrue("timed out" in str(e), str(e))
- else:
- self.fail("SSLError wasn't raised")
+ self.assertRaisesRegexp(ssl.SSLError, "timed out",
+ c.connect, (host, port))
finally:
c.close()
finally:
@@ -1207,9 +1329,6 @@ else:
def test_main(verbose=False):
- if skip_expected:
- raise test_support.TestSkipped("No SSL support")
-
global CERTFILE, SVN_PYTHON_ORG_ROOT_CERT
CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir,
"keycert.pem")
@@ -1221,7 +1340,7 @@ def test_main(verbose=False):
not os.path.exists(SVN_PYTHON_ORG_ROOT_CERT)):
raise test_support.TestFailed("Can't read certificate files!")
- tests = [BasicTests]
+ tests = [BasicTests, BasicSocketTests]
if test_support.is_resource_enabled('network'):
tests.append(NetworkedTests)
diff --git a/Lib/test/test_startfile.py b/Lib/test/test_startfile.py
index c4d12d708e..9dce8fd6ac 100644
--- a/Lib/test/test_startfile.py
+++ b/Lib/test/test_startfile.py
@@ -9,9 +9,12 @@
import unittest
from test import test_support
+import os
+from os import path
+from time import sleep
+
+startfile = test_support.get_attribute(os, 'startfile')
-# use this form so that the test is skipped when startfile is not available:
-from os import startfile, path
class TestCase(unittest.TestCase):
def test_nonexisting(self):
@@ -24,11 +27,16 @@ class TestCase(unittest.TestCase):
empty = path.join(path.dirname(__file__), "empty.vbs")
startfile(empty)
startfile(empty, "open")
+ # Give the child process some time to exit before we finish.
+ # Otherwise the cleanup code will not be able to delete the cwd,
+ # because it is still in use.
+ sleep(0.1)
def test_empty_u(self):
empty = path.join(path.dirname(__file__), "empty.vbs")
startfile(unicode(empty, "mbcs"))
startfile(unicode(empty, "mbcs"), "open")
+ sleep(0.1)
def test_main():
test_support.run_unittest(TestCase)
diff --git a/Lib/test/test_str.py b/Lib/test/test_str.py
index de988a8872..2ecf3276b4 100644
--- a/Lib/test/test_str.py
+++ b/Lib/test/test_str.py
@@ -86,7 +86,7 @@ class StrTest(
def __unicode__(self):
return "not unicode"
- self.assert_(str(Foo0()).startswith("<")) # this is different from __unicode__
+ self.assertTrue(str(Foo0()).startswith("<")) # this is different from __unicode__
self.assertEqual(str(Foo1()), "foo")
self.assertEqual(str(Foo2()), "foo")
self.assertEqual(str(Foo3()), "foo")
@@ -276,7 +276,7 @@ class StrTest(
# format specifiers for user defined type
self.assertEqual('{0:abc}'.format(C()), 'abc')
- # !r and !s coersions
+ # !r and !s coercions
self.assertEqual('{0!s}'.format('Hello'), 'Hello')
self.assertEqual('{0!s:}'.format('Hello'), 'Hello')
self.assertEqual('{0!s:15}'.format('Hello'), 'Hello ')
@@ -290,12 +290,15 @@ class StrTest(
self.assertEqual('{0}'.format([]), '[]')
self.assertEqual('{0}'.format([1]), '[1]')
self.assertEqual('{0}'.format(E('data')), 'E(data)')
- self.assertEqual('{0:^10}'.format(E('data')), ' E(data) ')
- self.assertEqual('{0:^10s}'.format(E('data')), ' E(data) ')
self.assertEqual('{0:d}'.format(G('data')), 'G(data)')
- self.assertEqual('{0:>15s}'.format(G('data')), ' string is data')
self.assertEqual('{0!s}'.format(G('data')), 'string is data')
+ msg = 'object.__format__ with a non-empty format string is deprecated'
+ with test_support.check_warnings((msg, PendingDeprecationWarning)):
+ self.assertEqual('{0:^10}'.format(E('data')), ' E(data) ')
+ self.assertEqual('{0:^10s}'.format(E('data')), ' E(data) ')
+ self.assertEqual('{0:>15s}'.format(G('data')), ' string is data')
+
self.assertEqual("{0:date: %Y-%m-%d}".format(I(year=2007,
month=8,
day=27)),
@@ -347,9 +350,9 @@ class StrTest(
self.assertRaises(ValueError, "{0!}".format, 0)
self.assertRaises(ValueError, "{0!rs}".format, 0)
self.assertRaises(ValueError, "{!}".format)
- self.assertRaises(ValueError, "{:}".format)
- self.assertRaises(ValueError, "{:s}".format)
- self.assertRaises(ValueError, "{}".format)
+ self.assertRaises(IndexError, "{:}".format)
+ self.assertRaises(IndexError, "{:s}".format)
+ self.assertRaises(IndexError, "{}".format)
# issue 6089
self.assertRaises(ValueError, "{0[0]x}".format, [None])
@@ -368,9 +371,61 @@ class StrTest(
self.assertRaises(ValueError, format, "", "-")
self.assertRaises(ValueError, "{0:=s}".format, '')
+ def test_format_auto_numbering(self):
+ class C:
+ def __init__(self, x=100):
+ self._x = x
+ def __format__(self, spec):
+ return spec
+
+ self.assertEqual('{}'.format(10), '10')
+ self.assertEqual('{:5}'.format('s'), 's ')
+ self.assertEqual('{!r}'.format('s'), "'s'")
+ self.assertEqual('{._x}'.format(C(10)), '10')
+ self.assertEqual('{[1]}'.format([1, 2]), '2')
+ self.assertEqual('{[a]}'.format({'a':4, 'b':2}), '4')
+ self.assertEqual('a{}b{}c'.format(0, 1), 'a0b1c')
+
+ self.assertEqual('a{:{}}b'.format('x', '^10'), 'a x b')
+ self.assertEqual('a{:{}x}b'.format(20, '#'), 'a0x14b')
+
+ # can't mix and match numbering and auto-numbering
+ self.assertRaises(ValueError, '{}{1}'.format, 1, 2)
+ self.assertRaises(ValueError, '{1}{}'.format, 1, 2)
+ self.assertRaises(ValueError, '{:{1}}'.format, 1, 2)
+ self.assertRaises(ValueError, '{0:{}}'.format, 1, 2)
+
+ # can mix and match auto-numbering and named
+ self.assertEqual('{f}{}'.format(4, f='test'), 'test4')
+ self.assertEqual('{}{f}'.format(4, f='test'), '4test')
+ self.assertEqual('{:{f}}{g}{}'.format(1, 3, g='g', f=2), ' 1g3')
+ self.assertEqual('{f:{}}{}{g}'.format(2, 4, f=1, g='g'), ' 14g')
+
def test_buffer_is_readonly(self):
self.assertRaises(TypeError, sys.stdin.readinto, b"")
+ def test_encode_and_decode_kwargs(self):
+ self.assertEqual('abcde'.encode('ascii', 'replace'),
+ 'abcde'.encode('ascii', errors='replace'))
+ self.assertEqual('abcde'.encode('ascii', 'ignore'),
+ 'abcde'.encode(encoding='ascii', errors='ignore'))
+ self.assertEqual('Andr\202 x'.decode('ascii', 'ignore'),
+ 'Andr\202 x'.decode('ascii', errors='ignore'))
+ self.assertEqual('Andr\202 x'.decode('ascii', 'replace'),
+ 'Andr\202 x'.decode(encoding='ascii', errors='replace'))
+
+ def test_startswith_endswith_errors(self):
+ with self.assertRaises(UnicodeDecodeError):
+ '\xff'.startswith(u'x')
+ with self.assertRaises(UnicodeDecodeError):
+ '\xff'.endswith(u'x')
+ for meth in ('foo'.startswith, 'foo'.endswith):
+ with self.assertRaises(TypeError) as cm:
+ meth(['f'])
+ exc = str(cm.exception)
+ self.assertIn('unicode', exc)
+ self.assertIn('str', exc)
+ self.assertIn('tuple', exc)
def test_main():
test_support.run_unittest(StrTest)
diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py
index 9328db0090..b26ebec93d 100755..100644
--- a/Lib/test/test_strftime.py
+++ b/Lib/test/test_strftime.py
@@ -4,7 +4,6 @@ Unittest for time.strftime
import calendar
import sys
-import os
import re
from test import test_support
import time
diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py
index 48677e045b..0d07b91394 100644
--- a/Lib/test/test_string.py
+++ b/Lib/test/test_string.py
@@ -176,7 +176,7 @@ class ModuleTest(unittest.TestCase):
# test all parameters used
class CheckAllUsedFormatter(string.Formatter):
def check_unused_args(self, used_args, args, kwargs):
- # Track which arguments actuallly got used
+ # Track which arguments actually got used
unused_args = set(kwargs.keys())
unused_args.update(range(0, len(args)))
@@ -202,13 +202,13 @@ class ModuleTest(unittest.TestCase):
class BytesAliasTest(unittest.TestCase):
def test_builtin(self):
- self.assert_(str is bytes)
+ self.assertTrue(str is bytes)
def test_syntax(self):
self.assertEqual(b"spam", "spam")
self.assertEqual(br"egg\foo", "egg\\foo")
- self.assert_(type(b""), str)
- self.assert_(type(br""), str)
+ self.assertTrue(type(b""), str)
+ self.assertTrue(type(br""), str)
def test_main():
test_support.run_unittest(StringTest, ModuleTest, BytesAliasTest)
diff --git a/Lib/test/test_stringprep.py b/Lib/test/test_stringprep.py
index 60425dddc1..15bdf87652 100644
--- a/Lib/test/test_stringprep.py
+++ b/Lib/test/test_stringprep.py
@@ -8,66 +8,66 @@ from stringprep import *
class StringprepTests(unittest.TestCase):
def test(self):
- self.failUnless(in_table_a1(u"\u0221"))
- self.failIf(in_table_a1(u"\u0222"))
+ self.assertTrue(in_table_a1(u"\u0221"))
+ self.assertFalse(in_table_a1(u"\u0222"))
- self.failUnless(in_table_b1(u"\u00ad"))
- self.failIf(in_table_b1(u"\u00ae"))
+ self.assertTrue(in_table_b1(u"\u00ad"))
+ self.assertFalse(in_table_b1(u"\u00ae"))
- self.failUnless(map_table_b2(u"\u0041"), u"\u0061")
- self.failUnless(map_table_b2(u"\u0061"), u"\u0061")
+ self.assertTrue(map_table_b2(u"\u0041"), u"\u0061")
+ self.assertTrue(map_table_b2(u"\u0061"), u"\u0061")
- self.failUnless(map_table_b3(u"\u0041"), u"\u0061")
- self.failUnless(map_table_b3(u"\u0061"), u"\u0061")
+ self.assertTrue(map_table_b3(u"\u0041"), u"\u0061")
+ self.assertTrue(map_table_b3(u"\u0061"), u"\u0061")
- self.failUnless(in_table_c11(u"\u0020"))
- self.failIf(in_table_c11(u"\u0021"))
+ self.assertTrue(in_table_c11(u"\u0020"))
+ self.assertFalse(in_table_c11(u"\u0021"))
- self.failUnless(in_table_c12(u"\u00a0"))
- self.failIf(in_table_c12(u"\u00a1"))
+ self.assertTrue(in_table_c12(u"\u00a0"))
+ self.assertFalse(in_table_c12(u"\u00a1"))
- self.failUnless(in_table_c12(u"\u00a0"))
- self.failIf(in_table_c12(u"\u00a1"))
+ self.assertTrue(in_table_c12(u"\u00a0"))
+ self.assertFalse(in_table_c12(u"\u00a1"))
- self.failUnless(in_table_c11_c12(u"\u00a0"))
- self.failIf(in_table_c11_c12(u"\u00a1"))
+ self.assertTrue(in_table_c11_c12(u"\u00a0"))
+ self.assertFalse(in_table_c11_c12(u"\u00a1"))
- self.failUnless(in_table_c21(u"\u001f"))
- self.failIf(in_table_c21(u"\u0020"))
+ self.assertTrue(in_table_c21(u"\u001f"))
+ self.assertFalse(in_table_c21(u"\u0020"))
- self.failUnless(in_table_c22(u"\u009f"))
- self.failIf(in_table_c22(u"\u00a0"))
+ self.assertTrue(in_table_c22(u"\u009f"))
+ self.assertFalse(in_table_c22(u"\u00a0"))
- self.failUnless(in_table_c21_c22(u"\u009f"))
- self.failIf(in_table_c21_c22(u"\u00a0"))
+ self.assertTrue(in_table_c21_c22(u"\u009f"))
+ self.assertFalse(in_table_c21_c22(u"\u00a0"))
- self.failUnless(in_table_c3(u"\ue000"))
- self.failIf(in_table_c3(u"\uf900"))
+ self.assertTrue(in_table_c3(u"\ue000"))
+ self.assertFalse(in_table_c3(u"\uf900"))
- self.failUnless(in_table_c4(u"\uffff"))
- self.failIf(in_table_c4(u"\u0000"))
+ self.assertTrue(in_table_c4(u"\uffff"))
+ self.assertFalse(in_table_c4(u"\u0000"))
- self.failUnless(in_table_c5(u"\ud800"))
- self.failIf(in_table_c5(u"\ud7ff"))
+ self.assertTrue(in_table_c5(u"\ud800"))
+ self.assertFalse(in_table_c5(u"\ud7ff"))
- self.failUnless(in_table_c6(u"\ufff9"))
- self.failIf(in_table_c6(u"\ufffe"))
+ self.assertTrue(in_table_c6(u"\ufff9"))
+ self.assertFalse(in_table_c6(u"\ufffe"))
- self.failUnless(in_table_c7(u"\u2ff0"))
- self.failIf(in_table_c7(u"\u2ffc"))
+ self.assertTrue(in_table_c7(u"\u2ff0"))
+ self.assertFalse(in_table_c7(u"\u2ffc"))
- self.failUnless(in_table_c8(u"\u0340"))
- self.failIf(in_table_c8(u"\u0342"))
+ self.assertTrue(in_table_c8(u"\u0340"))
+ self.assertFalse(in_table_c8(u"\u0342"))
# C.9 is not in the bmp
- # self.failUnless(in_table_c9(u"\U000E0001"))
- # self.failIf(in_table_c8(u"\U000E0002"))
+ # self.assertTrue(in_table_c9(u"\U000E0001"))
+ # self.assertFalse(in_table_c8(u"\U000E0002"))
- self.failUnless(in_table_d1(u"\u05be"))
- self.failIf(in_table_d1(u"\u05bf"))
+ self.assertTrue(in_table_d1(u"\u05be"))
+ self.assertFalse(in_table_d1(u"\u05bf"))
- self.failUnless(in_table_d2(u"\u0041"))
- self.failIf(in_table_d2(u"\u0040"))
+ self.assertTrue(in_table_d2(u"\u0041"))
+ self.assertFalse(in_table_d2(u"\u0040"))
# This would generate a hash of all predicates. However, running
# it is quite expensive, and only serves to detect changes in the
diff --git a/Lib/test/test_strop.py b/Lib/test/test_strop.py
index 7cda83f79f..8ce29efeb1 100644
--- a/Lib/test/test_strop.py
+++ b/Lib/test/test_strop.py
@@ -10,104 +10,104 @@ from test import test_support
class StropFunctionTestCase(unittest.TestCase):
def test_atoi(self):
- self.assert_(strop.atoi(" 1 ") == 1)
+ self.assertTrue(strop.atoi(" 1 ") == 1)
self.assertRaises(ValueError, strop.atoi, " 1x")
self.assertRaises(ValueError, strop.atoi, " x1 ")
def test_atol(self):
- self.assert_(strop.atol(" 1 ") == 1L)
+ self.assertTrue(strop.atol(" 1 ") == 1L)
self.assertRaises(ValueError, strop.atol, " 1x")
self.assertRaises(ValueError, strop.atol, " x1 ")
def test_atof(self):
- self.assert_(strop.atof(" 1 ") == 1.0)
+ self.assertTrue(strop.atof(" 1 ") == 1.0)
self.assertRaises(ValueError, strop.atof, " 1x")
self.assertRaises(ValueError, strop.atof, " x1 ")
def test_capitalize(self):
- self.assert_(strop.capitalize(" hello ") == " hello ")
- self.assert_(strop.capitalize("hello ") == "Hello ")
+ self.assertTrue(strop.capitalize(" hello ") == " hello ")
+ self.assertTrue(strop.capitalize("hello ") == "Hello ")
def test_find(self):
- self.assert_(strop.find("abcdefghiabc", "abc") == 0)
- self.assert_(strop.find("abcdefghiabc", "abc", 1) == 9)
- self.assert_(strop.find("abcdefghiabc", "def", 4) == -1)
+ self.assertTrue(strop.find("abcdefghiabc", "abc") == 0)
+ self.assertTrue(strop.find("abcdefghiabc", "abc", 1) == 9)
+ self.assertTrue(strop.find("abcdefghiabc", "def", 4) == -1)
def test_rfind(self):
- self.assert_(strop.rfind("abcdefghiabc", "abc") == 9)
+ self.assertTrue(strop.rfind("abcdefghiabc", "abc") == 9)
def test_lower(self):
- self.assert_(strop.lower("HeLLo") == "hello")
+ self.assertTrue(strop.lower("HeLLo") == "hello")
def test_upper(self):
- self.assert_(strop.upper("HeLLo") == "HELLO")
+ self.assertTrue(strop.upper("HeLLo") == "HELLO")
def test_swapcase(self):
- self.assert_(strop.swapcase("HeLLo cOmpUteRs") == "hEllO CoMPuTErS")
+ self.assertTrue(strop.swapcase("HeLLo cOmpUteRs") == "hEllO CoMPuTErS")
def test_strip(self):
- self.assert_(strop.strip(" \t\n hello \t\n ") == "hello")
+ self.assertTrue(strop.strip(" \t\n hello \t\n ") == "hello")
def test_lstrip(self):
- self.assert_(strop.lstrip(" \t\n hello \t\n ") == "hello \t\n ")
+ self.assertTrue(strop.lstrip(" \t\n hello \t\n ") == "hello \t\n ")
def test_rstrip(self):
- self.assert_(strop.rstrip(" \t\n hello \t\n ") == " \t\n hello")
+ self.assertTrue(strop.rstrip(" \t\n hello \t\n ") == " \t\n hello")
def test_replace(self):
replace = strop.replace
- self.assert_(replace("one!two!three!", '!', '@', 1)
+ self.assertTrue(replace("one!two!three!", '!', '@', 1)
== "one@two!three!")
- self.assert_(replace("one!two!three!", '!', '@', 2)
+ self.assertTrue(replace("one!two!three!", '!', '@', 2)
== "one@two@three!")
- self.assert_(replace("one!two!three!", '!', '@', 3)
+ self.assertTrue(replace("one!two!three!", '!', '@', 3)
== "one@two@three@")
- self.assert_(replace("one!two!three!", '!', '@', 4)
+ self.assertTrue(replace("one!two!three!", '!', '@', 4)
== "one@two@three@")
# CAUTION: a replace count of 0 means infinity only to strop,
# not to the string .replace() method or to the
# string.replace() function.
- self.assert_(replace("one!two!three!", '!', '@', 0)
+ self.assertTrue(replace("one!two!three!", '!', '@', 0)
== "one@two@three@")
- self.assert_(replace("one!two!three!", '!', '@')
+ self.assertTrue(replace("one!two!three!", '!', '@')
== "one@two@three@")
- self.assert_(replace("one!two!three!", 'x', '@')
+ self.assertTrue(replace("one!two!three!", 'x', '@')
== "one!two!three!")
- self.assert_(replace("one!two!three!", 'x', '@', 2)
+ self.assertTrue(replace("one!two!three!", 'x', '@', 2)
== "one!two!three!")
def test_split(self):
split = strop.split
- self.assert_(split("this is the split function")
+ self.assertTrue(split("this is the split function")
== ['this', 'is', 'the', 'split', 'function'])
- self.assert_(split("a|b|c|d", '|') == ['a', 'b', 'c', 'd'])
- self.assert_(split("a|b|c|d", '|', 2) == ['a', 'b', 'c|d'])
- self.assert_(split("a b c d", None, 1) == ['a', 'b c d'])
- self.assert_(split("a b c d", None, 2) == ['a', 'b', 'c d'])
- self.assert_(split("a b c d", None, 3) == ['a', 'b', 'c', 'd'])
- self.assert_(split("a b c d", None, 4) == ['a', 'b', 'c', 'd'])
- self.assert_(split("a b c d", None, 0) == ['a', 'b', 'c', 'd'])
- self.assert_(split("a b c d", None, 2) == ['a', 'b', 'c d'])
+ self.assertTrue(split("a|b|c|d", '|') == ['a', 'b', 'c', 'd'])
+ self.assertTrue(split("a|b|c|d", '|', 2) == ['a', 'b', 'c|d'])
+ self.assertTrue(split("a b c d", None, 1) == ['a', 'b c d'])
+ self.assertTrue(split("a b c d", None, 2) == ['a', 'b', 'c d'])
+ self.assertTrue(split("a b c d", None, 3) == ['a', 'b', 'c', 'd'])
+ self.assertTrue(split("a b c d", None, 4) == ['a', 'b', 'c', 'd'])
+ self.assertTrue(split("a b c d", None, 0) == ['a', 'b', 'c', 'd'])
+ self.assertTrue(split("a b c d", None, 2) == ['a', 'b', 'c d'])
def test_join(self):
- self.assert_(strop.join(['a', 'b', 'c', 'd']) == 'a b c d')
- self.assert_(strop.join(('a', 'b', 'c', 'd'), '') == 'abcd')
- self.assert_(strop.join(Sequence()) == 'w x y z')
+ self.assertTrue(strop.join(['a', 'b', 'c', 'd']) == 'a b c d')
+ self.assertTrue(strop.join(('a', 'b', 'c', 'd'), '') == 'abcd')
+ self.assertTrue(strop.join(Sequence()) == 'w x y z')
# try a few long ones
- self.assert_(strop.join(['x' * 100] * 100, ':')
+ self.assertTrue(strop.join(['x' * 100] * 100, ':')
== (('x' * 100) + ":") * 99 + "x" * 100)
- self.assert_(strop.join(('x' * 100,) * 100, ':')
+ self.assertTrue(strop.join(('x' * 100,) * 100, ':')
== (('x' * 100) + ":") * 99 + "x" * 100)
def test_maketrans(self):
- self.assert_(strop.maketrans("abc", "xyz") == transtable)
+ self.assertTrue(strop.maketrans("abc", "xyz") == transtable)
self.assertRaises(ValueError, strop.maketrans, "abc", "xyzq")
def test_translate(self):
- self.assert_(strop.translate("xyzabcdef", transtable, "def")
+ self.assertTrue(strop.translate("xyzabcdef", transtable, "def")
== "xyzxyz")
def test_data_attributes(self):
@@ -123,7 +123,7 @@ class StropFunctionTestCase(unittest.TestCase):
except OverflowError:
pass
else:
- self.assertEquals(len(r), len(a) * 3)
+ self.assertEqual(len(r), len(a) * 3)
@test_support.precisionbigmemtest(size=test_support._2G - 1, memuse=1)
def test_stropjoin_huge_tup(self, size):
@@ -133,7 +133,7 @@ class StropFunctionTestCase(unittest.TestCase):
except OverflowError:
pass # acceptable on 32-bit
else:
- self.assertEquals(len(r), len(a) * 3)
+ self.assertEqual(len(r), len(a) * 3)
transtable = '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377'
diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py
index df0dc866b9..63760c314d 100644
--- a/Lib/test/test_strptime.py
+++ b/Lib/test/test_strptime.py
@@ -13,7 +13,7 @@ import _strptime
class getlang_Tests(unittest.TestCase):
"""Test _getlang"""
def test_basic(self):
- self.failUnlessEqual(_strptime._getlang(), locale.getlocale(locale.LC_TIME))
+ self.assertEqual(_strptime._getlang(), locale.getlocale(locale.LC_TIME))
class LocaleTime_Tests(unittest.TestCase):
"""Tests for _strptime.LocaleTime.
@@ -36,9 +36,9 @@ class LocaleTime_Tests(unittest.TestCase):
"""
strftime_output = time.strftime(directive, self.time_tuple).lower()
comparison = testing[self.time_tuple[tuple_position]]
- self.failUnless(strftime_output in testing, "%s: not found in tuple" %
- error_msg)
- self.failUnless(comparison == strftime_output,
+ self.assertIn(strftime_output, testing,
+ "%s: not found in tuple" % error_msg)
+ self.assertTrue(comparison == strftime_output,
"%s: position within tuple incorrect; %s != %s" %
(error_msg, comparison, strftime_output))
@@ -61,18 +61,18 @@ class LocaleTime_Tests(unittest.TestCase):
def test_am_pm(self):
# Make sure AM/PM representation done properly
strftime_output = time.strftime("%p", self.time_tuple).lower()
- self.failUnless(strftime_output in self.LT_ins.am_pm,
- "AM/PM representation not in tuple")
+ self.assertIn(strftime_output, self.LT_ins.am_pm,
+ "AM/PM representation not in tuple")
if self.time_tuple[3] < 12: position = 0
else: position = 1
- self.failUnless(strftime_output == self.LT_ins.am_pm[position],
+ self.assertTrue(strftime_output == self.LT_ins.am_pm[position],
"AM/PM representation in the wrong position within the tuple")
def test_timezone(self):
# Make sure timezone is correct
timezone = time.strftime("%Z", self.time_tuple).lower()
if timezone:
- self.failUnless(timezone in self.LT_ins.timezone[0] or \
+ self.assertTrue(timezone in self.LT_ins.timezone[0] or
timezone in self.LT_ins.timezone[1],
"timezone %s not found in %s" %
(timezone, self.LT_ins.timezone))
@@ -86,26 +86,26 @@ class LocaleTime_Tests(unittest.TestCase):
# output.
magic_date = (1999, 3, 17, 22, 44, 55, 2, 76, 0)
strftime_output = time.strftime("%c", magic_date)
- self.failUnless(strftime_output == time.strftime(self.LT_ins.LC_date_time,
+ self.assertTrue(strftime_output == time.strftime(self.LT_ins.LC_date_time,
magic_date),
"LC_date_time incorrect")
strftime_output = time.strftime("%x", magic_date)
- self.failUnless(strftime_output == time.strftime(self.LT_ins.LC_date,
+ self.assertTrue(strftime_output == time.strftime(self.LT_ins.LC_date,
magic_date),
"LC_date incorrect")
strftime_output = time.strftime("%X", magic_date)
- self.failUnless(strftime_output == time.strftime(self.LT_ins.LC_time,
+ self.assertTrue(strftime_output == time.strftime(self.LT_ins.LC_time,
magic_date),
"LC_time incorrect")
LT = _strptime.LocaleTime()
LT.am_pm = ('', '')
- self.failUnless(LT.LC_time, "LocaleTime's LC directives cannot handle "
+ self.assertTrue(LT.LC_time, "LocaleTime's LC directives cannot handle "
"empty strings")
def test_lang(self):
# Make sure lang is set to what _getlang() returns
# Assuming locale has not changed between now and when self.LT_ins was created
- self.failUnlessEqual(self.LT_ins.lang, _strptime._getlang())
+ self.assertEqual(self.LT_ins.lang, _strptime._getlang())
class TimeRETests(unittest.TestCase):
@@ -119,13 +119,13 @@ class TimeRETests(unittest.TestCase):
def test_pattern(self):
# Test TimeRE.pattern
pattern_string = self.time_re.pattern(r"%a %A %d")
- self.failUnless(pattern_string.find(self.locale_time.a_weekday[2]) != -1,
+ self.assertTrue(pattern_string.find(self.locale_time.a_weekday[2]) != -1,
"did not find abbreviated weekday in pattern string '%s'" %
pattern_string)
- self.failUnless(pattern_string.find(self.locale_time.f_weekday[4]) != -1,
+ self.assertTrue(pattern_string.find(self.locale_time.f_weekday[4]) != -1,
"did not find full weekday in pattern string '%s'" %
pattern_string)
- self.failUnless(pattern_string.find(self.time_re['d']) != -1,
+ self.assertTrue(pattern_string.find(self.time_re['d']) != -1,
"did not find 'd' directive pattern string '%s'" %
pattern_string)
@@ -133,23 +133,23 @@ class TimeRETests(unittest.TestCase):
# Make sure any characters in the format string that might be taken as
# regex syntax is escaped.
pattern_string = self.time_re.pattern("\d+")
- self.failUnless(r"\\d\+" in pattern_string,
- "%s does not have re characters escaped properly" %
- pattern_string)
+ self.assertIn(r"\\d\+", pattern_string,
+ "%s does not have re characters escaped properly" %
+ pattern_string)
def test_compile(self):
# Check that compiled regex is correct
found = self.time_re.compile(r"%A").match(self.locale_time.f_weekday[6])
- self.failUnless(found and found.group('A') == self.locale_time.f_weekday[6],
+ self.assertTrue(found and found.group('A') == self.locale_time.f_weekday[6],
"re object for '%A' failed")
compiled = self.time_re.compile(r"%a %b")
found = compiled.match("%s %s" % (self.locale_time.a_weekday[4],
self.locale_time.a_month[4]))
- self.failUnless(found,
+ self.assertTrue(found,
"Match failed with '%s' regex and '%s' string" %
(compiled.pattern, "%s %s" % (self.locale_time.a_weekday[4],
self.locale_time.a_month[4])))
- self.failUnless(found.group('a') == self.locale_time.a_weekday[4] and
+ self.assertTrue(found.group('a') == self.locale_time.a_weekday[4] and
found.group('b') == self.locale_time.a_month[4],
"re object couldn't find the abbreviated weekday month in "
"'%s' using '%s'; group 'a' = '%s', group 'b' = %s'" %
@@ -159,7 +159,7 @@ class TimeRETests(unittest.TestCase):
'U','w','W','x','X','y','Y','Z','%'):
compiled = self.time_re.compile("%" + directive)
found = compiled.match(time.strftime("%" + directive))
- self.failUnless(found, "Matching failed on '%s' using '%s' regex" %
+ self.assertTrue(found, "Matching failed on '%s' using '%s' regex" %
(time.strftime("%" + directive),
compiled.pattern))
@@ -168,14 +168,14 @@ class TimeRETests(unittest.TestCase):
# Fixes bug #661354
test_locale = _strptime.LocaleTime()
test_locale.timezone = (frozenset(), frozenset())
- self.failUnless(_strptime.TimeRE(test_locale).pattern("%Z") == '',
+ self.assertTrue(_strptime.TimeRE(test_locale).pattern("%Z") == '',
"with timezone == ('',''), TimeRE().pattern('%Z') != ''")
def test_matching_with_escapes(self):
# Make sure a format that requires escaping of characters works
compiled_re = self.time_re.compile("\w+ %m")
found = compiled_re.match("\w+ 10")
- self.failUnless(found, "Escaping failed of format '\w+ 10'")
+ self.assertTrue(found, "Escaping failed of format '\w+ 10'")
def test_locale_data_w_regex_metacharacters(self):
# Check that if locale data contains regex metacharacters they are
@@ -186,7 +186,7 @@ class TimeRETests(unittest.TestCase):
"Tokyo (standard time)")),
frozenset("Tokyo (daylight time)"))
time_re = _strptime.TimeRE(locale_time)
- self.failUnless(time_re.compile("%Z").match("Tokyo (standard time)"),
+ self.assertTrue(time_re.compile("%Z").match("Tokyo (standard time)"),
"locale data that contains regex metacharacters is not"
" properly escaped")
@@ -195,8 +195,8 @@ class TimeRETests(unittest.TestCase):
# so as to not allow to subpatterns to end up next to each other and
# "steal" characters from each other.
pattern = self.time_re.pattern('%j %H')
- self.failUnless(not re.match(pattern, "180"))
- self.failUnless(re.match(pattern, "18 0"))
+ self.assertTrue(not re.match(pattern, "180"))
+ self.assertTrue(re.match(pattern, "18 0"))
class StrptimeTests(unittest.TestCase):
@@ -229,7 +229,7 @@ class StrptimeTests(unittest.TestCase):
"""Helper fxn in testing."""
strf_output = time.strftime("%" + directive, self.time_tuple)
strp_output = _strptime._strptime_time(strf_output, "%" + directive)
- self.failUnless(strp_output[position] == self.time_tuple[position],
+ self.assertTrue(strp_output[position] == self.time_tuple[position],
"testing of '%s' directive failed; '%s' -> %s != %s" %
(directive, strf_output, strp_output[position],
self.time_tuple[position]))
@@ -243,7 +243,7 @@ class StrptimeTests(unittest.TestCase):
for bound in bounds:
strp_output = _strptime._strptime_time(bound, '%y')
expected_result = century + int(bound)
- self.failUnless(strp_output[0] == expected_result,
+ self.assertTrue(strp_output[0] == expected_result,
"'y' test failed; passed in '%s' "
"and returned '%s'" % (bound, strp_output[0]))
@@ -261,7 +261,7 @@ class StrptimeTests(unittest.TestCase):
self.helper('H', 3)
strf_output = time.strftime("%I %p", self.time_tuple)
strp_output = _strptime._strptime_time(strf_output, "%I %p")
- self.failUnless(strp_output[3] == self.time_tuple[3],
+ self.assertTrue(strp_output[3] == self.time_tuple[3],
"testing of '%%I %%p' directive failed; '%s' -> %s != %s" %
(strf_output, strp_output[3], self.time_tuple[3]))
@@ -295,30 +295,25 @@ class StrptimeTests(unittest.TestCase):
# Check for equal timezone names deals with bad locale info when this
# occurs; first found in FreeBSD 4.4.
strp_output = _strptime._strptime_time("UTC", "%Z")
- self.failUnlessEqual(strp_output.tm_isdst, 0)
+ self.assertEqual(strp_output.tm_isdst, 0)
strp_output = _strptime._strptime_time("GMT", "%Z")
- self.failUnlessEqual(strp_output.tm_isdst, 0)
- if sys.platform == "mac":
- # Timezones don't really work on MacOS9
- return
+ self.assertEqual(strp_output.tm_isdst, 0)
time_tuple = time.localtime()
strf_output = time.strftime("%Z") #UTC does not have a timezone
strp_output = _strptime._strptime_time(strf_output, "%Z")
locale_time = _strptime.LocaleTime()
if time.tzname[0] != time.tzname[1] or not time.daylight:
- self.failUnless(strp_output[8] == time_tuple[8],
+ self.assertTrue(strp_output[8] == time_tuple[8],
"timezone check failed; '%s' -> %s != %s" %
(strf_output, strp_output[8], time_tuple[8]))
else:
- self.failUnless(strp_output[8] == -1,
+ self.assertTrue(strp_output[8] == -1,
"LocaleTime().timezone has duplicate values and "
"time.daylight but timezone value not set to -1")
def test_bad_timezone(self):
# Explicitly test possibility of bad timezone;
# when time.tzname[0] == time.tzname[1] and time.daylight
- if sys.platform == "mac":
- return #MacOS9 has severely broken timezone support.
tz_name = time.tzname[0]
if tz_name.upper() in ("UTC", "GMT"):
return
@@ -328,7 +323,7 @@ class StrptimeTests(unittest.TestCase):
time.tzname = (tz_name, tz_name)
time.daylight = 1
tz_value = _strptime._strptime_time(tz_name, "%Z")[8]
- self.failUnlessEqual(tz_value, -1,
+ self.assertEqual(tz_value, -1,
"%s lead to a timezone value of %s instead of -1 when "
"time.daylight set to %s and passing in %s" %
(time.tzname, tz_value, time.daylight, tz_name))
@@ -355,25 +350,25 @@ class StrptimeTests(unittest.TestCase):
# Make sure % signs are handled properly
strf_output = time.strftime("%m %% %Y", self.time_tuple)
strp_output = _strptime._strptime_time(strf_output, "%m %% %Y")
- self.failUnless(strp_output[0] == self.time_tuple[0] and
+ self.assertTrue(strp_output[0] == self.time_tuple[0] and
strp_output[1] == self.time_tuple[1],
"handling of percent sign failed")
def test_caseinsensitive(self):
# Should handle names case-insensitively.
strf_output = time.strftime("%B", self.time_tuple)
- self.failUnless(_strptime._strptime_time(strf_output.upper(), "%B"),
+ self.assertTrue(_strptime._strptime_time(strf_output.upper(), "%B"),
"strptime does not handle ALL-CAPS names properly")
- self.failUnless(_strptime._strptime_time(strf_output.lower(), "%B"),
+ self.assertTrue(_strptime._strptime_time(strf_output.lower(), "%B"),
"strptime does not handle lowercase names properly")
- self.failUnless(_strptime._strptime_time(strf_output.capitalize(), "%B"),
+ self.assertTrue(_strptime._strptime_time(strf_output.capitalize(), "%B"),
"strptime does not handle capword names properly")
def test_defaults(self):
# Default return value should be (1900, 1, 1, 0, 0, 0, 0, 1, 0)
defaults = (1900, 1, 1, 0, 0, 0, 0, 1, -1)
strp_output = _strptime._strptime_time('1', '%m')
- self.failUnless(strp_output == defaults,
+ self.assertTrue(strp_output == defaults,
"Default values for strptime() are incorrect;"
" %s != %s" % (strp_output, defaults))
@@ -384,7 +379,7 @@ class StrptimeTests(unittest.TestCase):
# escaped.
# Test instigated by bug #796149 .
need_escaping = ".^$*+?{}\[]|)("
- self.failUnless(_strptime._strptime_time(need_escaping, need_escaping))
+ self.assertTrue(_strptime._strptime_time(need_escaping, need_escaping))
class Strptime12AMPMTests(unittest.TestCase):
"""Test a _strptime regression in '%I %p' at 12 noon (12 PM)"""
@@ -417,7 +412,7 @@ class CalculationTests(unittest.TestCase):
format_string = "%Y %m %d %H %M %S %w %Z"
result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
format_string)
- self.failUnless(result.tm_yday == self.time_tuple.tm_yday,
+ self.assertTrue(result.tm_yday == self.time_tuple.tm_yday,
"Calculation of tm_yday failed; %s != %s" %
(result.tm_yday, self.time_tuple.tm_yday))
@@ -426,7 +421,7 @@ class CalculationTests(unittest.TestCase):
format_string = "%Y %H %M %S %w %j %Z"
result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
format_string)
- self.failUnless(result.tm_year == self.time_tuple.tm_year and
+ self.assertTrue(result.tm_year == self.time_tuple.tm_year and
result.tm_mon == self.time_tuple.tm_mon and
result.tm_mday == self.time_tuple.tm_mday,
"Calculation of Gregorian date failed;"
@@ -440,7 +435,7 @@ class CalculationTests(unittest.TestCase):
format_string = "%Y %m %d %H %S %j %Z"
result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
format_string)
- self.failUnless(result.tm_wday == self.time_tuple.tm_wday,
+ self.assertTrue(result.tm_wday == self.time_tuple.tm_wday,
"Calculation of day of the week failed;"
"%s != %s" % (result.tm_wday, self.time_tuple.tm_wday))
@@ -453,7 +448,7 @@ class CalculationTests(unittest.TestCase):
dt_date = datetime_date(*ymd_tuple)
strp_input = dt_date.strftime(format_string)
strp_output = _strptime._strptime_time(strp_input, format_string)
- self.failUnless(strp_output[:3] == ymd_tuple,
+ self.assertTrue(strp_output[:3] == ymd_tuple,
"%s(%s) test failed w/ '%s': %s != %s (%s != %s)" %
(test_reason, directive, strp_input,
strp_output[:3], ymd_tuple,
@@ -494,10 +489,10 @@ class CacheTests(unittest.TestCase):
_strptime._strptime_time("10", "%d")
_strptime._strptime_time("2005", "%Y")
_strptime._TimeRE_cache.locale_time.lang = "Ni"
- original_time_re = id(_strptime._TimeRE_cache)
+ original_time_re = _strptime._TimeRE_cache
_strptime._strptime_time("10", "%d")
- self.failIfEqual(original_time_re, id(_strptime._TimeRE_cache))
- self.failUnlessEqual(len(_strptime._regex_cache), 1)
+ self.assertIsNot(original_time_re, _strptime._TimeRE_cache)
+ self.assertEqual(len(_strptime._regex_cache), 1)
def test_regex_cleanup(self):
# Make sure cached regexes are discarded when cache becomes "full".
@@ -510,16 +505,15 @@ class CacheTests(unittest.TestCase):
_strptime._regex_cache[bogus_key] = None
bogus_key += 1
_strptime._strptime_time("10", "%d")
- self.failUnlessEqual(len(_strptime._regex_cache), 1)
+ self.assertEqual(len(_strptime._regex_cache), 1)
def test_new_localetime(self):
# A new LocaleTime instance should be created when a new TimeRE object
# is created.
- locale_time_id = id(_strptime._TimeRE_cache.locale_time)
+ locale_time_id = _strptime._TimeRE_cache.locale_time
_strptime._TimeRE_cache.locale_time.lang = "Ni"
_strptime._strptime_time("10", "%d")
- self.failIfEqual(locale_time_id,
- id(_strptime._TimeRE_cache.locale_time))
+ self.assertIsNot(locale_time_id, _strptime._TimeRE_cache.locale_time)
def test_TimeRE_recreation(self):
# The TimeRE instance should be recreated upon changing the locale.
@@ -531,18 +525,18 @@ class CacheTests(unittest.TestCase):
try:
_strptime._strptime_time('10', '%d')
# Get id of current cache object.
- first_time_re_id = id(_strptime._TimeRE_cache)
+ first_time_re = _strptime._TimeRE_cache
try:
# Change the locale and force a recreation of the cache.
locale.setlocale(locale.LC_TIME, ('de_DE', 'UTF8'))
_strptime._strptime_time('10', '%d')
# Get the new cache object's id.
- second_time_re_id = id(_strptime._TimeRE_cache)
+ second_time_re = _strptime._TimeRE_cache
# They should not be equal.
- self.failIfEqual(first_time_re_id, second_time_re_id)
+ self.assertIsNot(first_time_re, second_time_re)
# Possible test locale is not supported while initial locale is.
# If this is the case just suppress the exception and fall-through
- # to the reseting to the original locale.
+ # to the resetting to the original locale.
except locale.Error:
pass
# Make sure we don't trample on the locale setting once we leave the
diff --git a/Lib/test/test_strtod.py b/Lib/test/test_strtod.py
new file mode 100644
index 0000000000..7bc595daf3
--- /dev/null
+++ b/Lib/test/test_strtod.py
@@ -0,0 +1,399 @@
+# Tests for the correctly-rounded string -> float conversions
+# introduced in Python 2.7 and 3.1.
+
+import random
+import struct
+import unittest
+import re
+import sys
+from test import test_support
+
+if getattr(sys, 'float_repr_style', '') != 'short':
+ raise unittest.SkipTest('correctly-rounded string->float conversions '
+ 'not available on this system')
+
+# Correctly rounded str -> float in pure Python, for comparison.
+
+strtod_parser = re.compile(r""" # A numeric string consists of:
+ (?P<sign>[-+])? # an optional sign, followed by
+ (?=\d|\.\d) # a number with at least one digit
+ (?P<int>\d*) # having a (possibly empty) integer part
+ (?:\.(?P<frac>\d*))? # followed by an optional fractional part
+ (?:E(?P<exp>[-+]?\d+))? # and an optional exponent
+ \Z
+""", re.VERBOSE | re.IGNORECASE).match
+
+# Pure Python version of correctly rounded string->float conversion.
+# Avoids any use of floating-point by returning the result as a hex string.
+def strtod(s, mant_dig=53, min_exp = -1021, max_exp = 1024):
+ """Convert a finite decimal string to a hex string representing an
+ IEEE 754 binary64 float. Return 'inf' or '-inf' on overflow.
+ This function makes no use of floating-point arithmetic at any
+ stage."""
+
+ # parse string into a pair of integers 'a' and 'b' such that
+ # abs(decimal value) = a/b, along with a boolean 'negative'.
+ m = strtod_parser(s)
+ if m is None:
+ raise ValueError('invalid numeric string')
+ fraction = m.group('frac') or ''
+ intpart = int(m.group('int') + fraction)
+ exp = int(m.group('exp') or '0') - len(fraction)
+ negative = m.group('sign') == '-'
+ a, b = intpart*10**max(exp, 0), 10**max(0, -exp)
+
+ # quick return for zeros
+ if not a:
+ return '-0x0.0p+0' if negative else '0x0.0p+0'
+
+ # compute exponent e for result; may be one too small in the case
+ # that the rounded value of a/b lies in a different binade from a/b
+ d = a.bit_length() - b.bit_length()
+ d += (a >> d if d >= 0 else a << -d) >= b
+ e = max(d, min_exp) - mant_dig
+
+ # approximate a/b by number of the form q * 2**e; adjust e if necessary
+ a, b = a << max(-e, 0), b << max(e, 0)
+ q, r = divmod(a, b)
+ if 2*r > b or 2*r == b and q & 1:
+ q += 1
+ if q.bit_length() == mant_dig+1:
+ q //= 2
+ e += 1
+
+ # double check that (q, e) has the right form
+ assert q.bit_length() <= mant_dig and e >= min_exp - mant_dig
+ assert q.bit_length() == mant_dig or e == min_exp - mant_dig
+
+ # check for overflow and underflow
+ if e + q.bit_length() > max_exp:
+ return '-inf' if negative else 'inf'
+ if not q:
+ return '-0x0.0p+0' if negative else '0x0.0p+0'
+
+ # for hex representation, shift so # bits after point is a multiple of 4
+ hexdigs = 1 + (mant_dig-2)//4
+ shift = 3 - (mant_dig-2)%4
+ q, e = q << shift, e - shift
+ return '{}0x{:x}.{:0{}x}p{:+d}'.format(
+ '-' if negative else '',
+ q // 16**hexdigs,
+ q % 16**hexdigs,
+ hexdigs,
+ e + 4*hexdigs)
+
+TEST_SIZE = 10
+
+class StrtodTests(unittest.TestCase):
+ def check_strtod(self, s):
+ """Compare the result of Python's builtin correctly rounded
+ string->float conversion (using float) to a pure Python
+ correctly rounded string->float implementation. Fail if the
+ two methods give different results."""
+
+ try:
+ fs = float(s)
+ except OverflowError:
+ got = '-inf' if s[0] == '-' else 'inf'
+ except MemoryError:
+ got = 'memory error'
+ else:
+ got = fs.hex()
+ expected = strtod(s)
+ self.assertEqual(expected, got,
+ "Incorrectly rounded str->float conversion for {}: "
+ "expected {}, got {}".format(s, expected, got))
+
+ def test_short_halfway_cases(self):
+ # exact halfway cases with a small number of significant digits
+ for k in 0, 5, 10, 15, 20:
+ # upper = smallest integer >= 2**54/5**k
+ upper = -(-2**54//5**k)
+ # lower = smallest odd number >= 2**53/5**k
+ lower = -(-2**53//5**k)
+ if lower % 2 == 0:
+ lower += 1
+ for i in xrange(TEST_SIZE):
+ # Select a random odd n in [2**53/5**k,
+ # 2**54/5**k). Then n * 10**k gives a halfway case
+ # with small number of significant digits.
+ n, e = random.randrange(lower, upper, 2), k
+
+ # Remove any additional powers of 5.
+ while n % 5 == 0:
+ n, e = n // 5, e + 1
+ assert n % 10 in (1, 3, 7, 9)
+
+ # Try numbers of the form n * 2**p2 * 10**e, p2 >= 0,
+ # until n * 2**p2 has more than 20 significant digits.
+ digits, exponent = n, e
+ while digits < 10**20:
+ s = '{}e{}'.format(digits, exponent)
+ self.check_strtod(s)
+ # Same again, but with extra trailing zeros.
+ s = '{}e{}'.format(digits * 10**40, exponent - 40)
+ self.check_strtod(s)
+ digits *= 2
+
+ # Try numbers of the form n * 5**p2 * 10**(e - p5), p5
+ # >= 0, with n * 5**p5 < 10**20.
+ digits, exponent = n, e
+ while digits < 10**20:
+ s = '{}e{}'.format(digits, exponent)
+ self.check_strtod(s)
+ # Same again, but with extra trailing zeros.
+ s = '{}e{}'.format(digits * 10**40, exponent - 40)
+ self.check_strtod(s)
+ digits *= 5
+ exponent -= 1
+
+ def test_halfway_cases(self):
+ # test halfway cases for the round-half-to-even rule
+ for i in xrange(100 * TEST_SIZE):
+ # bit pattern for a random finite positive (or +0.0) float
+ bits = random.randrange(2047*2**52)
+
+ # convert bit pattern to a number of the form m * 2**e
+ e, m = divmod(bits, 2**52)
+ if e:
+ m, e = m + 2**52, e - 1
+ e -= 1074
+
+ # add 0.5 ulps
+ m, e = 2*m + 1, e - 1
+
+ # convert to a decimal string
+ if e >= 0:
+ digits = m << e
+ exponent = 0
+ else:
+ # m * 2**e = (m * 5**-e) * 10**e
+ digits = m * 5**-e
+ exponent = e
+ s = '{}e{}'.format(digits, exponent)
+ self.check_strtod(s)
+
+ def test_boundaries(self):
+ # boundaries expressed as triples (n, e, u), where
+ # n*10**e is an approximation to the boundary value and
+ # u*10**e is 1ulp
+ boundaries = [
+ (10000000000000000000, -19, 1110), # a power of 2 boundary (1.0)
+ (17976931348623159077, 289, 1995), # overflow boundary (2.**1024)
+ (22250738585072013831, -327, 4941), # normal/subnormal (2.**-1022)
+ (0, -327, 4941), # zero
+ ]
+ for n, e, u in boundaries:
+ for j in xrange(1000):
+ digits = n + random.randrange(-3*u, 3*u)
+ exponent = e
+ s = '{}e{}'.format(digits, exponent)
+ self.check_strtod(s)
+ n *= 10
+ u *= 10
+ e -= 1
+
+ def test_underflow_boundary(self):
+ # test values close to 2**-1075, the underflow boundary; similar
+ # to boundary_tests, except that the random error doesn't scale
+ # with n
+ for exponent in xrange(-400, -320):
+ base = 10**-exponent // 2**1075
+ for j in xrange(TEST_SIZE):
+ digits = base + random.randrange(-1000, 1000)
+ s = '{}e{}'.format(digits, exponent)
+ self.check_strtod(s)
+
+ def test_bigcomp(self):
+ for ndigs in 5, 10, 14, 15, 16, 17, 18, 19, 20, 40, 41, 50:
+ dig10 = 10**ndigs
+ for i in xrange(10 * TEST_SIZE):
+ digits = random.randrange(dig10)
+ exponent = random.randrange(-400, 400)
+ s = '{}e{}'.format(digits, exponent)
+ self.check_strtod(s)
+
+ def test_parsing(self):
+ # make '0' more likely to be chosen than other digits
+ digits = '000000123456789'
+ signs = ('+', '-', '')
+
+ # put together random short valid strings
+ # \d*[.\d*]?e
+ for i in xrange(1000):
+ for j in xrange(TEST_SIZE):
+ s = random.choice(signs)
+ intpart_len = random.randrange(5)
+ s += ''.join(random.choice(digits) for _ in xrange(intpart_len))
+ if random.choice([True, False]):
+ s += '.'
+ fracpart_len = random.randrange(5)
+ s += ''.join(random.choice(digits)
+ for _ in xrange(fracpart_len))
+ else:
+ fracpart_len = 0
+ if random.choice([True, False]):
+ s += random.choice(['e', 'E'])
+ s += random.choice(signs)
+ exponent_len = random.randrange(1, 4)
+ s += ''.join(random.choice(digits)
+ for _ in xrange(exponent_len))
+
+ if intpart_len + fracpart_len:
+ self.check_strtod(s)
+ else:
+ try:
+ float(s)
+ except ValueError:
+ pass
+ else:
+ assert False, "expected ValueError"
+
+ def test_particular(self):
+ # inputs that produced crashes or incorrectly rounded results with
+ # previous versions of dtoa.c, for various reasons
+ test_strings = [
+ # issue 7632 bug 1, originally reported failing case
+ '2183167012312112312312.23538020374420446192e-370',
+ # 5 instances of issue 7632 bug 2
+ '12579816049008305546974391768996369464963024663104e-357',
+ '17489628565202117263145367596028389348922981857013e-357',
+ '18487398785991994634182916638542680759613590482273e-357',
+ '32002864200581033134358724675198044527469366773928e-358',
+ '94393431193180696942841837085033647913224148539854e-358',
+ '73608278998966969345824653500136787876436005957953e-358',
+ '64774478836417299491718435234611299336288082136054e-358',
+ '13704940134126574534878641876947980878824688451169e-357',
+ '46697445774047060960624497964425416610480524760471e-358',
+ # failing case for bug introduced by METD in r77451 (attempted
+ # fix for issue 7632, bug 2), and fixed in r77482.
+ '28639097178261763178489759107321392745108491825303e-311',
+ # two numbers demonstrating a flaw in the bigcomp 'dig == 0'
+ # correction block (issue 7632, bug 3)
+ '1.00000000000000001e44',
+ '1.0000000000000000100000000000000000000001e44',
+ # dtoa.c bug for numbers just smaller than a power of 2 (issue
+ # 7632, bug 4)
+ '99999999999999994487665465554760717039532578546e-47',
+ # failing case for off-by-one error introduced by METD in
+ # r77483 (dtoa.c cleanup), fixed in r77490
+ '965437176333654931799035513671997118345570045914469' #...
+ '6213413350821416312194420007991306908470147322020121018368e0',
+ # incorrect lsb detection for round-half-to-even when
+ # bc->scale != 0 (issue 7632, bug 6).
+ '104308485241983990666713401708072175773165034278685' #...
+ '682646111762292409330928739751702404658197872319129' #...
+ '036519947435319418387839758990478549477777586673075' #...
+ '945844895981012024387992135617064532141489278815239' #...
+ '849108105951619997829153633535314849999674266169258' #...
+ '928940692239684771590065027025835804863585454872499' #...
+ '320500023126142553932654370362024104462255244034053' #...
+ '203998964360882487378334860197725139151265590832887' #...
+ '433736189468858614521708567646743455601905935595381' #...
+ '852723723645799866672558576993978025033590728687206' #...
+ '296379801363024094048327273913079612469982585674824' #...
+ '156000783167963081616214710691759864332339239688734' #...
+ '656548790656486646106983450809073750535624894296242' #...
+ '072010195710276073042036425579852459556183541199012' #...
+ '652571123898996574563824424330960027873516082763671875e-1075',
+ # demonstration that original fix for issue 7632 bug 1 was
+ # buggy; the exit condition was too strong
+ '247032822920623295e-341',
+ # demonstrate similar problem to issue 7632 bug1: crash
+ # with 'oversized quotient in quorem' message.
+ '99037485700245683102805043437346965248029601286431e-373',
+ '99617639833743863161109961162881027406769510558457e-373',
+ '98852915025769345295749278351563179840130565591462e-372',
+ '99059944827693569659153042769690930905148015876788e-373',
+ '98914979205069368270421829889078356254059760327101e-372',
+ # issue 7632 bug 5: the following 2 strings convert differently
+ '1000000000000000000000000000000000000000e-16',
+ '10000000000000000000000000000000000000000e-17',
+ # issue 7632 bug 7
+ '991633793189150720000000000000000000000000000000000000000e-33',
+ # And another, similar, failing halfway case
+ '4106250198039490000000000000000000000000000000000000000e-38',
+ # issue 7632 bug 8: the following produced 10.0
+ '10.900000000000000012345678912345678912345',
+
+ # two humongous values from issue 7743
+ '116512874940594195638617907092569881519034793229385' #...
+ '228569165191541890846564669771714896916084883987920' #...
+ '473321268100296857636200926065340769682863349205363' #...
+ '349247637660671783209907949273683040397979984107806' #...
+ '461822693332712828397617946036239581632976585100633' #...
+ '520260770761060725403904123144384571612073732754774' #...
+ '588211944406465572591022081973828448927338602556287' #...
+ '851831745419397433012491884869454462440536895047499' #...
+ '436551974649731917170099387762871020403582994193439' #...
+ '761933412166821484015883631622539314203799034497982' #...
+ '130038741741727907429575673302461380386596501187482' #...
+ '006257527709842179336488381672818798450229339123527' #...
+ '858844448336815912020452294624916993546388956561522' #...
+ '161875352572590420823607478788399460162228308693742' #...
+ '05287663441403533948204085390898399055004119873046875e-1075',
+
+ '525440653352955266109661060358202819561258984964913' #...
+ '892256527849758956045218257059713765874251436193619' #...
+ '443248205998870001633865657517447355992225852945912' #...
+ '016668660000210283807209850662224417504752264995360' #...
+ '631512007753855801075373057632157738752800840302596' #...
+ '237050247910530538250008682272783660778181628040733' #...
+ '653121492436408812668023478001208529190359254322340' #...
+ '397575185248844788515410722958784640926528544043090' #...
+ '115352513640884988017342469275006999104519620946430' #...
+ '818767147966495485406577703972687838176778993472989' #...
+ '561959000047036638938396333146685137903018376496408' #...
+ '319705333868476925297317136513970189073693314710318' #...
+ '991252811050501448326875232850600451776091303043715' #...
+ '157191292827614046876950225714743118291034780466325' #...
+ '085141343734564915193426994587206432697337118211527' #...
+ '278968731294639353354774788602467795167875117481660' #...
+ '4738791256853675690543663283782215866825e-1180',
+
+ # exercise exit conditions in bigcomp comparison loop
+ '2602129298404963083833853479113577253105939995688e2',
+ '260212929840496308383385347911357725310593999568896e0',
+ '26021292984049630838338534791135772531059399956889601e-2',
+ '260212929840496308383385347911357725310593999568895e0',
+ '260212929840496308383385347911357725310593999568897e0',
+ '260212929840496308383385347911357725310593999568996e0',
+ '260212929840496308383385347911357725310593999568866e0',
+ # 2**53
+ '9007199254740992.00',
+ # 2**1024 - 2**970: exact overflow boundary. All values
+ # smaller than this should round to something finite; any value
+ # greater than or equal to this one overflows.
+ '179769313486231580793728971405303415079934132710037' #...
+ '826936173778980444968292764750946649017977587207096' #...
+ '330286416692887910946555547851940402630657488671505' #...
+ '820681908902000708383676273854845817711531764475730' #...
+ '270069855571366959622842914819860834936475292719074' #...
+ '168444365510704342711559699508093042880177904174497792',
+ # 2**1024 - 2**970 - tiny
+ '179769313486231580793728971405303415079934132710037' #...
+ '826936173778980444968292764750946649017977587207096' #...
+ '330286416692887910946555547851940402630657488671505' #...
+ '820681908902000708383676273854845817711531764475730' #...
+ '270069855571366959622842914819860834936475292719074' #...
+ '168444365510704342711559699508093042880177904174497791.999',
+ # 2**1024 - 2**970 + tiny
+ '179769313486231580793728971405303415079934132710037' #...
+ '826936173778980444968292764750946649017977587207096' #...
+ '330286416692887910946555547851940402630657488671505' #...
+ '820681908902000708383676273854845817711531764475730' #...
+ '270069855571366959622842914819860834936475292719074' #...
+ '168444365510704342711559699508093042880177904174497792.001',
+ # 1 - 2**-54, +-tiny
+ '999999999999999944488848768742172978818416595458984375e-54',
+ '9999999999999999444888487687421729788184165954589843749999999e-54',
+ '9999999999999999444888487687421729788184165954589843750000001e-54',
+ ]
+ for s in test_strings:
+ self.check_strtod(s)
+
+def test_main():
+ test_support.run_unittest(StrtodTests)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index b7c2127df5..5a63135a1a 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -3,28 +3,23 @@ import array
import unittest
import struct
import inspect
-import warnings
-from test.test_support import run_unittest, check_warnings, _check_py3k_warnings
-
-
-from functools import wraps
-from test.test_support import TestFailed, verbose, run_unittest
+from test.test_support import run_unittest, check_warnings, check_py3k_warnings
import sys
ISBIGENDIAN = sys.byteorder == "big"
IS32BIT = sys.maxsize == 0x7fffffff
+integer_codes = 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q'
+
testmod_filename = os.path.splitext(__file__)[0] + '.py'
+# Native 'q' packing isn't available on systems that don't have the C
+# long long type.
try:
- import _struct
-except ImportError:
- PY_STRUCT_RANGE_CHECKING = 0
- PY_STRUCT_OVERFLOW_MASKING = 1
- PY_STRUCT_FLOAT_COERCE = 2
+ struct.pack('q', 5)
+except struct.error:
+ HAVE_LONG_LONG = False
else:
- PY_STRUCT_RANGE_CHECKING = getattr(_struct, '_PY_STRUCT_RANGE_CHECKING', 0)
- PY_STRUCT_OVERFLOW_MASKING = getattr(_struct, '_PY_STRUCT_OVERFLOW_MASKING', 0)
- PY_STRUCT_FLOAT_COERCE = getattr(_struct, '_PY_STRUCT_FLOAT_COERCE', 0)
+ HAVE_LONG_LONG = True
def string_reverse(s):
return "".join(reversed(s))
@@ -35,56 +30,20 @@ def bigendian_to_native(value):
else:
return string_reverse(value)
-def with_warning_restore(func):
- @wraps(func)
- def decorator(*args, **kw):
- with warnings.catch_warnings():
- # We need this function to warn every time, so stick an
- # unqualifed 'always' at the head of the filter list
- warnings.simplefilter("always")
- warnings.filterwarnings("error", category=DeprecationWarning)
- return func(*args, **kw)
- return decorator
-
-@with_warning_restore
-def deprecated_err(func, *args):
- try:
- func(*args)
- except (struct.error, TypeError):
- pass
- except DeprecationWarning:
- if not PY_STRUCT_OVERFLOW_MASKING:
- raise TestFailed, "%s%s expected to raise DeprecationWarning" % (
- func.__name__, args)
- else:
- raise TestFailed, "%s%s did not raise error" % (
- func.__name__, args)
-
-
class StructTest(unittest.TestCase):
- @with_warning_restore
def check_float_coerce(self, format, number):
- # SF bug 1530559. struct.pack raises TypeError where it used to convert.
- if PY_STRUCT_FLOAT_COERCE == 2:
- # Test for pre-2.5 struct module
- with check_warnings((".*integer argument expected, got float",
- DeprecationWarning)) as w:
- packed = struct.pack(format, number)
- floored = struct.unpack(format, packed)[0]
- self.assertEqual(floored, int(number),
- "did not correcly coerce float to int")
- return
- try:
- struct.pack(format, number)
- except (struct.error, TypeError):
- if PY_STRUCT_FLOAT_COERCE:
- self.fail("expected DeprecationWarning for float coerce")
- except DeprecationWarning:
- if not PY_STRUCT_FLOAT_COERCE:
- self.fail("expected to raise struct.error for float coerce")
- else:
- self.fail("did not raise error for float coerce")
+ # SF bug 1530559. struct.pack raises TypeError where it used
+ # to convert.
+ with check_warnings((".*integer argument expected, got float",
+ DeprecationWarning)) as w:
+ got = struct.pack(format, number)
+ lineno = inspect.currentframe().f_lineno - 1
+ self.assertEqual(w.filename, testmod_filename)
+ self.assertEqual(w.lineno, lineno)
+ self.assertEqual(len(w.warnings), 1)
+ expected = struct.pack(format, int(number))
+ self.assertEqual(got, expected)
def test_isbigendian(self):
self.assertEqual((struct.pack('=i', 1)[0] == chr(0)), ISBIGENDIAN)
@@ -103,36 +62,13 @@ class StructTest(unittest.TestCase):
self.assertRaises(struct.error, struct.pack, 'iii', 3)
self.assertRaises(struct.error, struct.pack, 'i', 3, 3, 3)
- self.assertRaises(struct.error, struct.pack, 'i', 'foo')
- self.assertRaises(struct.error, struct.pack, 'P', 'foo')
+ self.assertRaises((TypeError, struct.error), struct.pack, 'i', 'foo')
+ self.assertRaises((TypeError, struct.error), struct.pack, 'P', 'foo')
self.assertRaises(struct.error, struct.unpack, 'd', 'flap')
s = struct.pack('ii', 1, 2)
self.assertRaises(struct.error, struct.unpack, 'iii', s)
self.assertRaises(struct.error, struct.unpack, 'i', s)
- def test_warnings_stacklevel(self):
- # Python versions between 2.6 and 2.6.5 were producing
- # warning messages at the wrong stacklevel.
- def inner(fn, *args):
- return inspect.currentframe().f_lineno, fn(*args)
-
- def check_warning_stacklevel(fn, *args):
- with warnings.catch_warnings(record=True) as w:
- # "always" to make sure __warningregistry__ isn't affected
- warnings.simplefilter("always")
- lineno, result = inner(fn, *args)
- for warn in w:
- self.assertEqual(warn.lineno, lineno)
-
- # out of range warnings
- check_warning_stacklevel(struct.pack, '<L', -1)
- check_warning_stacklevel(struct.pack, 'L', -1)
- check_warning_stacklevel(struct.pack, '<h', 65536)
- check_warning_stacklevel(struct.pack, '<l', 2**100)
-
- # float warnings
- check_warning_stacklevel(struct.pack, 'L', 3.1)
-
def test_transitiveness(self):
c = 'a'
b = 1
@@ -208,147 +144,91 @@ class StructTest(unittest.TestCase):
self.assertEqual(struct.calcsize(xfmt), len(res))
rev = struct.unpack(xfmt, res)[0]
if rev != arg:
- self.assert_(asy)
-
- def test_native_qQ(self):
- # can't pack -1 as unsigned regardless
- self.assertRaises((struct.error, TypeError), struct.pack, "Q", -1)
- # can't pack string as 'q' regardless
- self.assertRaises(struct.error, struct.pack, "q", "a")
- # ditto, but 'Q'
- self.assertRaises(struct.error, struct.pack, "Q", "a")
-
- try:
- struct.pack("q", 5)
- except struct.error:
- # does not have native q/Q
- pass
- else:
- bytes = struct.calcsize('q')
- # The expected values here are in big-endian format, primarily
- # because I'm on a little-endian machine and so this is the
- # clearest way (for me) to force the code to get exercised.
- for format, input, expected in (
- ('q', -1, '\xff' * bytes),
- ('q', 0, '\x00' * bytes),
- ('Q', 0, '\x00' * bytes),
- ('q', 1L, '\x00' * (bytes-1) + '\x01'),
- ('Q', (1L << (8*bytes))-1, '\xff' * bytes),
- ('q', (1L << (8*bytes-1))-1, '\x7f' + '\xff' * (bytes - 1))):
- got = struct.pack(format, input)
- native_expected = bigendian_to_native(expected)
- self.assertEqual(got, native_expected)
- retrieved = struct.unpack(format, got)[0]
- self.assertEqual(retrieved, input)
-
- def test_standard_integers(self):
- # Standard integer tests (bBhHiIlLqQ).
+ self.assertTrue(asy)
+
+ def test_calcsize(self):
+ expected_size = {
+ 'b': 1, 'B': 1,
+ 'h': 2, 'H': 2,
+ 'i': 4, 'I': 4,
+ 'l': 4, 'L': 4,
+ 'q': 8, 'Q': 8,
+ }
+
+ # standard integer sizes
+ for code in integer_codes:
+ for byteorder in ('=', '<', '>', '!'):
+ format = byteorder+code
+ size = struct.calcsize(format)
+ self.assertEqual(size, expected_size[code])
+
+ # native integer sizes, except 'q' and 'Q'
+ for format_pair in ('bB', 'hH', 'iI', 'lL'):
+ for byteorder in ['', '@']:
+ signed_size = struct.calcsize(byteorder + format_pair[0])
+ unsigned_size = struct.calcsize(byteorder + format_pair[1])
+ self.assertEqual(signed_size, unsigned_size)
+
+ # bounds for native integer sizes
+ self.assertEqual(struct.calcsize('b'), 1)
+ self.assertLessEqual(2, struct.calcsize('h'))
+ self.assertLessEqual(4, struct.calcsize('l'))
+ self.assertLessEqual(struct.calcsize('h'), struct.calcsize('i'))
+ self.assertLessEqual(struct.calcsize('i'), struct.calcsize('l'))
+
+ # tests for native 'q' and 'Q' when applicable
+ if HAVE_LONG_LONG:
+ self.assertEqual(struct.calcsize('q'), struct.calcsize('Q'))
+ self.assertLessEqual(8, struct.calcsize('q'))
+ self.assertLessEqual(struct.calcsize('l'), struct.calcsize('q'))
+
+ def test_integers(self):
+ # Integer tests (bBhHiIlLqQ).
import binascii
class IntTester(unittest.TestCase):
-
- # XXX Most std integer modes fail to test for out-of-range.
- # The "i" and "l" codes appear to range-check OK on 32-bit boxes, but
- # fail to check correctly on some 64-bit ones (Tru64 Unix + Compaq C
- # reported by Mark Favas).
- BUGGY_RANGE_CHECK = "bBhHiIlL"
-
- def __init__(self, formatpair, bytesize):
- self.assertEqual(len(formatpair), 2)
- self.formatpair = formatpair
- for direction in "<>!=":
- for code in formatpair:
- format = direction + code
- self.assertEqual(struct.calcsize(format), bytesize)
- self.bytesize = bytesize
- self.bitsize = bytesize * 8
- self.signed_code, self.unsigned_code = formatpair
- self.unsigned_min = 0
- self.unsigned_max = 2L**self.bitsize - 1
- self.signed_min = -(2L**(self.bitsize-1))
- self.signed_max = 2L**(self.bitsize-1) - 1
+ def __init__(self, format):
+ super(IntTester, self).__init__(methodName='test_one')
+ self.format = format
+ self.code = format[-1]
+ self.direction = format[:-1]
+ if not self.direction in ('', '@', '=', '<', '>', '!'):
+ raise ValueError("unrecognized packing direction: %s" %
+ self.direction)
+ self.bytesize = struct.calcsize(format)
+ self.bitsize = self.bytesize * 8
+ if self.code in tuple('bhilq'):
+ self.signed = True
+ self.min_value = -(2L**(self.bitsize-1))
+ self.max_value = 2L**(self.bitsize-1) - 1
+ elif self.code in tuple('BHILQ'):
+ self.signed = False
+ self.min_value = 0
+ self.max_value = 2L**self.bitsize - 1
+ else:
+ raise ValueError("unrecognized format code: %s" %
+ self.code)
def test_one(self, x, pack=struct.pack,
unpack=struct.unpack,
unhexlify=binascii.unhexlify):
- # Try signed.
- code = self.signed_code
- if self.signed_min <= x <= self.signed_max:
- # Try big-endian.
- expected = long(x)
- if x < 0:
- expected += 1L << self.bitsize
- self.assert_(expected > 0)
- expected = hex(expected)[2:-1] # chop "0x" and trailing 'L'
- if len(expected) & 1:
- expected = "0" + expected
- expected = unhexlify(expected)
- expected = "\x00" * (self.bytesize - len(expected)) + expected
-
- # Pack work?
- format = ">" + code
- got = pack(format, x)
- self.assertEqual(got, expected)
-
- # Unpack work?
- retrieved = unpack(format, got)[0]
- self.assertEqual(x, retrieved)
-
- # Adding any byte should cause a "too big" error.
- self.assertRaises((struct.error, TypeError), unpack, format,
- '\x01' + got)
- # Try little-endian.
- format = "<" + code
- expected = string_reverse(expected)
-
- # Pack work?
- got = pack(format, x)
- self.assertEqual(got, expected)
-
- # Unpack work?
- retrieved = unpack(format, got)[0]
- self.assertEqual(x, retrieved)
-
- # Adding any byte should cause a "too big" error.
- self.assertRaises((struct.error, TypeError), unpack, format,
- '\x01' + got)
- else:
- # x is out of range -- verify pack realizes that.
- if not PY_STRUCT_RANGE_CHECKING and code in self.BUGGY_RANGE_CHECK:
- if verbose:
- print "Skipping buggy range check for code", code
- else:
- deprecated_err(pack, ">" + code, x)
- deprecated_err(pack, "<" + code, x)
-
- # Much the same for unsigned.
- code = self.unsigned_code
- if self.unsigned_min <= x <= self.unsigned_max:
- # Try big-endian.
- format = ">" + code
+ format = self.format
+ if self.min_value <= x <= self.max_value:
expected = long(x)
- expected = hex(expected)[2:-1] # chop "0x" and trailing 'L'
+ if self.signed and x < 0:
+ expected += 1L << self.bitsize
+ self.assertGreaterEqual(expected, 0)
+ expected = '%x' % expected
if len(expected) & 1:
expected = "0" + expected
expected = unhexlify(expected)
- expected = "\x00" * (self.bytesize - len(expected)) + expected
-
- # Pack work?
- got = pack(format, x)
- self.assertEqual(got, expected)
-
- # Unpack work?
- retrieved = unpack(format, got)[0]
- self.assertEqual(x, retrieved)
-
- # Adding any byte should cause a "too big" error.
- self.assertRaises((struct.error, TypeError), unpack, format,
- '\x01' + got)
-
- # Try little-endian.
- format = "<" + code
- expected = string_reverse(expected)
+ expected = ("\x00" * (self.bytesize - len(expected)) +
+ expected)
+ if (self.direction == '<' or
+ self.direction in ('', '@', '=') and not ISBIGENDIAN):
+ expected = string_reverse(expected)
+ self.assertEqual(len(expected), self.bytesize)
# Pack work?
got = pack(format, x)
@@ -361,15 +241,10 @@ class StructTest(unittest.TestCase):
# Adding any byte should cause a "too big" error.
self.assertRaises((struct.error, TypeError), unpack, format,
'\x01' + got)
-
else:
# x is out of range -- verify pack realizes that.
- if not PY_STRUCT_RANGE_CHECKING and code in self.BUGGY_RANGE_CHECK:
- if verbose:
- print "Skipping buggy range check for code", code
- else:
- deprecated_err(pack, ">" + code, x)
- deprecated_err(pack, "<" + code, x)
+ self.assertRaises((OverflowError, ValueError, struct.error),
+ pack, format, x)
def run(self):
from random import randrange
@@ -386,34 +261,104 @@ class StructTest(unittest.TestCase):
val = (val << 8) | randrange(256)
values.append(val)
- # Try all those, and their negations, and +-1 from them. Note
- # that this tests all power-of-2 boundaries in range, and a few out
- # of range, plus +-(2**n +- 1).
+ # Values absorbed from other tests
+ values.extend([300, 700000, sys.maxint*4])
+
+ # Try all those, and their negations, and +-1 from
+ # them. Note that this tests all power-of-2
+ # boundaries in range, and a few out of range, plus
+ # +-(2**n +- 1).
for base in values:
for val in -base, base:
for incr in -1, 0, 1:
x = val + incr
- try:
- x = int(x)
- except OverflowError:
- pass
- self.test_one(x)
+ self.test_one(int(x))
+ self.test_one(long(x))
# Some error cases.
- for direction in "<>":
- for code in self.formatpair:
- for badobject in "a string", 3+42j, randrange:
- self.assertRaises((struct.error, TypeError),
- struct.pack, direction + code,
- badobject)
-
- for args in [("bB", 1),
- ("hH", 2),
- ("iI", 4),
- ("lL", 4),
- ("qQ", 8)]:
- t = IntTester(*args)
- t.run()
+ class NotAnIntNS(object):
+ def __int__(self):
+ return 42
+
+ def __long__(self):
+ return 1729L
+
+ class NotAnIntOS:
+ def __int__(self):
+ return 85
+
+ def __long__(self):
+ return -163L
+
+ # Objects with an '__index__' method should be allowed
+ # to pack as integers. That is assuming the implemented
+ # '__index__' method returns and 'int' or 'long'.
+ class Indexable(object):
+ def __init__(self, value):
+ self._value = value
+
+ def __index__(self):
+ return self._value
+
+ # If the '__index__' method raises a type error, then
+ # '__int__' should be used with a deprecation warning.
+ class BadIndex(object):
+ def __index__(self):
+ raise TypeError
+
+ def __int__(self):
+ return 42
+
+ self.assertRaises((TypeError, struct.error),
+ struct.pack, self.format,
+ "a string")
+ self.assertRaises((TypeError, struct.error),
+ struct.pack, self.format,
+ randrange)
+ with check_warnings(("integer argument expected, "
+ "got non-integer", DeprecationWarning)):
+ with self.assertRaises((TypeError, struct.error)):
+ struct.pack(self.format, 3+42j)
+
+ # an attempt to convert a non-integer (with an
+ # implicit conversion via __int__) should succeed,
+ # with a DeprecationWarning
+ for nonint in NotAnIntNS(), NotAnIntOS(), BadIndex():
+ with check_warnings((".*integer argument expected, got non"
+ "-integer", DeprecationWarning)) as w:
+ got = struct.pack(self.format, nonint)
+ lineno = inspect.currentframe().f_lineno - 1
+ self.assertEqual(w.filename, testmod_filename)
+ self.assertEqual(w.lineno, lineno)
+ self.assertEqual(len(w.warnings), 1)
+ expected = struct.pack(self.format, int(nonint))
+ self.assertEqual(got, expected)
+
+ # Check for legitimate values from '__index__'.
+ for obj in (Indexable(0), Indexable(10), Indexable(17),
+ Indexable(42), Indexable(100), Indexable(127)):
+ try:
+ struct.pack(format, obj)
+ except:
+ self.fail("integer code pack failed on object "
+ "with '__index__' method")
+
+ # Check for bogus values from '__index__'.
+ for obj in (Indexable('a'), Indexable(u'b'), Indexable(None),
+ Indexable({'a': 1}), Indexable([1, 2, 3])):
+ self.assertRaises((TypeError, struct.error),
+ struct.pack, self.format,
+ obj)
+
+ byteorders = '', '@', '=', '<', '>', '!'
+ for code in integer_codes:
+ for byteorder in byteorders:
+ if (byteorder in ('', '@') and code in ('q', 'Q') and
+ not HAVE_LONG_LONG):
+ continue
+ format = byteorder+code
+ t = IntTester(format)
+ t.run()
def test_p_code(self):
# Test p ("Pascal string") code.
@@ -466,36 +411,13 @@ class StructTest(unittest.TestCase):
big = math.ldexp(big, 127 - 24)
self.assertRaises(OverflowError, struct.pack, ">f", big)
- if PY_STRUCT_RANGE_CHECKING:
- def test_1229380(self):
- # SF bug 1229380. No struct.pack exception for some out of
- # range integers
- import sys
- for endian in ('', '>', '<'):
- for cls in (int, long):
- for fmt in ('B', 'H', 'I', 'L'):
- deprecated_err(struct.pack, endian + fmt, cls(-1))
-
- deprecated_err(struct.pack, endian + 'B', cls(300))
- deprecated_err(struct.pack, endian + 'H', cls(70000))
-
- deprecated_err(struct.pack, endian + 'I', sys.maxint * 4L)
- deprecated_err(struct.pack, endian + 'L', sys.maxint * 4L)
-
- def XXXtest_1530559(self):
- # XXX This is broken: see the bug report
+ def test_1530559(self):
# SF bug 1530559. struct.pack raises TypeError where it used to convert.
for endian in ('', '>', '<'):
- for fmt in ('B', 'H', 'I', 'L', 'b', 'h', 'i', 'l'):
+ for fmt in integer_codes:
self.check_float_coerce(endian + fmt, 1.0)
self.check_float_coerce(endian + fmt, 1.5)
- def test_issue4228(self):
- # Packing a long may yield either 32 or 64 bits
- with check_warnings(quiet=True):
- x = struct.pack('L', -1)[:4]
- self.assertEqual(x, '\xff'*4)
-
def test_unpack_from(self, cls=str):
data = cls('abcd01234')
fmt = '4s'
@@ -528,12 +450,15 @@ class StructTest(unittest.TestCase):
# Go beyond boundaries.
small_buf = array.array('c', ' '*10)
- self.assertRaises(struct.error, s.pack_into, small_buf, 0, test_string)
- self.assertRaises(struct.error, s.pack_into, small_buf, 2, test_string)
+ self.assertRaises((ValueError, struct.error), s.pack_into, small_buf, 0,
+ test_string)
+ self.assertRaises((ValueError, struct.error), s.pack_into, small_buf, 2,
+ test_string)
# Test bogus offset (issue 3694)
sb = small_buf
- self.assertRaises(TypeError, struct.pack_into, b'1', sb, None)
+ self.assertRaises((TypeError, struct.error), struct.pack_into, b'', sb,
+ None)
def test_pack_into_fn(self):
test_string = 'Reykjavik rocks, eow!'
@@ -553,11 +478,13 @@ class StructTest(unittest.TestCase):
# Go beyond boundaries.
small_buf = array.array('c', ' '*10)
- self.assertRaises(struct.error, pack_into, small_buf, 0, test_string)
- self.assertRaises(struct.error, pack_into, small_buf, 2, test_string)
+ self.assertRaises((ValueError, struct.error), pack_into, small_buf, 0,
+ test_string)
+ self.assertRaises((ValueError, struct.error), pack_into, small_buf, 2,
+ test_string)
def test_unpack_with_buffer(self):
- with _check_py3k_warnings(("buffer.. not supported in 3.x",
+ with check_py3k_warnings(("buffer.. not supported in 3.x",
DeprecationWarning)):
# SF bug 1563759: struct.unpack doesn't support buffer protocol objects
data1 = array.array('B', '\x12\x34\x56\x78')
@@ -569,6 +496,9 @@ class StructTest(unittest.TestCase):
self.test_unpack_from(cls=buffer)
def test_bool(self):
+ class ExplodingBool(object):
+ def __nonzero__(self):
+ raise IOError
for prefix in tuple("<>!=")+('',):
false = (), [], [], '', 0
true = [1], 'test', 5, -1, 0xffffffffL+1, 0xffffffff//2
@@ -597,18 +527,21 @@ class StructTest(unittest.TestCase):
self.assertFalse(prefix, msg='encoded bool is not one byte: %r'
%packed)
- for c in '\x01\x7f\xff\x0f\xf0':
- self.assertTrue(struct.unpack('>?', c)[0])
+ self.assertRaises(IOError, struct.pack, prefix + '?',
+ ExplodingBool())
+
+ for c in [b'\x01', b'\x7f', b'\xff', b'\x0f', b'\xf0']:
+ self.assertTrue(struct.unpack('>?', c)[0])
- if IS32BIT:
- def test_crasher(self):
- self.assertRaises(MemoryError, struct.pack, "357913941c", "a")
+ @unittest.skipUnless(IS32BIT, "Specific to 32bit machines")
+ def test_crasher(self):
+ self.assertRaises(MemoryError, struct.pack, "357913941c", "a")
def test_count_overflow(self):
- hugecount = '{0}b'.format(sys.maxsize+1)
+ hugecount = '{}b'.format(sys.maxsize+1)
self.assertRaises(struct.error, struct.calcsize, hugecount)
- hugecount2 = '{0}b{1}H'.format(sys.maxsize//2, sys.maxsize//2)
+ hugecount2 = '{}b{}H'.format(sys.maxsize//2, sys.maxsize//2)
self.assertRaises(struct.error, struct.calcsize, hugecount2)
def test_main():
diff --git a/Lib/test/test_structmembers.py b/Lib/test/test_structmembers.py
index 1f20923226..0cc58c3c72 100644
--- a/Lib/test/test_structmembers.py
+++ b/Lib/test/test_structmembers.py
@@ -5,7 +5,7 @@ from _testcapi import _test_structmembersType, \
LONG_MAX, LONG_MIN, ULONG_MAX, \
LLONG_MAX, LLONG_MIN, ULLONG_MAX
-import warnings, exceptions, unittest, sys
+import unittest
from test import test_support
ts=_test_structmembersType(False, 1, 2, 3, 4, 5, 6, 7, 8,
@@ -15,99 +15,90 @@ class ReadWriteTests(unittest.TestCase):
def test_bool(self):
ts.T_BOOL = True
- self.assertEquals(ts.T_BOOL, True)
+ self.assertEqual(ts.T_BOOL, True)
ts.T_BOOL = False
- self.assertEquals(ts.T_BOOL, False)
+ self.assertEqual(ts.T_BOOL, False)
self.assertRaises(TypeError, setattr, ts, 'T_BOOL', 1)
def test_byte(self):
ts.T_BYTE = CHAR_MAX
- self.assertEquals(ts.T_BYTE, CHAR_MAX)
+ self.assertEqual(ts.T_BYTE, CHAR_MAX)
ts.T_BYTE = CHAR_MIN
- self.assertEquals(ts.T_BYTE, CHAR_MIN)
+ self.assertEqual(ts.T_BYTE, CHAR_MIN)
ts.T_UBYTE = UCHAR_MAX
- self.assertEquals(ts.T_UBYTE, UCHAR_MAX)
+ self.assertEqual(ts.T_UBYTE, UCHAR_MAX)
def test_short(self):
ts.T_SHORT = SHRT_MAX
- self.assertEquals(ts.T_SHORT, SHRT_MAX)
+ self.assertEqual(ts.T_SHORT, SHRT_MAX)
ts.T_SHORT = SHRT_MIN
- self.assertEquals(ts.T_SHORT, SHRT_MIN)
+ self.assertEqual(ts.T_SHORT, SHRT_MIN)
ts.T_USHORT = USHRT_MAX
- self.assertEquals(ts.T_USHORT, USHRT_MAX)
+ self.assertEqual(ts.T_USHORT, USHRT_MAX)
def test_int(self):
ts.T_INT = INT_MAX
- self.assertEquals(ts.T_INT, INT_MAX)
+ self.assertEqual(ts.T_INT, INT_MAX)
ts.T_INT = INT_MIN
- self.assertEquals(ts.T_INT, INT_MIN)
+ self.assertEqual(ts.T_INT, INT_MIN)
ts.T_UINT = UINT_MAX
- self.assertEquals(ts.T_UINT, UINT_MAX)
+ self.assertEqual(ts.T_UINT, UINT_MAX)
def test_long(self):
ts.T_LONG = LONG_MAX
- self.assertEquals(ts.T_LONG, LONG_MAX)
+ self.assertEqual(ts.T_LONG, LONG_MAX)
ts.T_LONG = LONG_MIN
- self.assertEquals(ts.T_LONG, LONG_MIN)
+ self.assertEqual(ts.T_LONG, LONG_MIN)
ts.T_ULONG = ULONG_MAX
- self.assertEquals(ts.T_ULONG, ULONG_MAX)
+ self.assertEqual(ts.T_ULONG, ULONG_MAX)
- if hasattr(ts, "T_LONGLONG"):
- def test_longlong(self):
- ts.T_LONGLONG = LLONG_MAX
- self.assertEquals(ts.T_LONGLONG, LLONG_MAX)
- ts.T_LONGLONG = LLONG_MIN
- self.assertEquals(ts.T_LONGLONG, LLONG_MIN)
+ @unittest.skipUnless(hasattr(ts, "T_LONGLONG"), "long long not present")
+ def test_longlong(self):
+ ts.T_LONGLONG = LLONG_MAX
+ self.assertEqual(ts.T_LONGLONG, LLONG_MAX)
+ ts.T_LONGLONG = LLONG_MIN
+ self.assertEqual(ts.T_LONGLONG, LLONG_MIN)
- ts.T_ULONGLONG = ULLONG_MAX
- self.assertEquals(ts.T_ULONGLONG, ULLONG_MAX)
+ ts.T_ULONGLONG = ULLONG_MAX
+ self.assertEqual(ts.T_ULONGLONG, ULLONG_MAX)
- ## make sure these will accept a plain int as well as a long
- ts.T_LONGLONG = 3
- self.assertEquals(ts.T_LONGLONG, 3)
- ts.T_ULONGLONG = 4
- self.assertEquals(ts.T_ULONGLONG, 4)
+ ## make sure these will accept a plain int as well as a long
+ ts.T_LONGLONG = 3
+ self.assertEqual(ts.T_LONGLONG, 3)
+ ts.T_ULONGLONG = 4
+ self.assertEqual(ts.T_ULONGLONG, 4)
def test_inplace_string(self):
- self.assertEquals(ts.T_STRING_INPLACE, "hi")
+ self.assertEqual(ts.T_STRING_INPLACE, "hi")
self.assertRaises(TypeError, setattr, ts, "T_STRING_INPLACE", "s")
self.assertRaises(TypeError, delattr, ts, "T_STRING_INPLACE")
class TestWarnings(unittest.TestCase):
- def has_warned(self, w):
- self.assertEqual(w.category, RuntimeWarning)
def test_byte_max(self):
- with test_support.check_warnings() as w:
+ with test_support.check_warnings(('', RuntimeWarning)):
ts.T_BYTE = CHAR_MAX+1
- self.has_warned(w)
def test_byte_min(self):
- with test_support.check_warnings() as w:
+ with test_support.check_warnings(('', RuntimeWarning)):
ts.T_BYTE = CHAR_MIN-1
- self.has_warned(w)
def test_ubyte_max(self):
- with test_support.check_warnings() as w:
+ with test_support.check_warnings(('', RuntimeWarning)):
ts.T_UBYTE = UCHAR_MAX+1
- self.has_warned(w)
def test_short_max(self):
- with test_support.check_warnings() as w:
+ with test_support.check_warnings(('', RuntimeWarning)):
ts.T_SHORT = SHRT_MAX+1
- self.has_warned(w)
def test_short_min(self):
- with test_support.check_warnings() as w:
+ with test_support.check_warnings(('', RuntimeWarning)):
ts.T_SHORT = SHRT_MIN-1
- self.has_warned(w)
def test_ushort_max(self):
- with test_support.check_warnings() as w:
+ with test_support.check_warnings(('', RuntimeWarning)):
ts.T_USHORT = USHRT_MAX+1
- self.has_warned(w)
-
def test_main(verbose=None):
diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py
index 83c7ccf57d..daa12aa4c0 100644
--- a/Lib/test/test_structseq.py
+++ b/Lib/test/test_structseq.py
@@ -28,7 +28,7 @@ class StructSeqTest(unittest.TestCase):
def test_repr(self):
t = time.gmtime()
- self.assert_(repr(t))
+ self.assertTrue(repr(t))
t = time.gmtime(0)
self.assertEqual(repr(t),
"time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, "
@@ -50,8 +50,8 @@ class StructSeqTest(unittest.TestCase):
def test_contains(self):
t1 = time.gmtime()
for item in t1:
- self.assert_(item in t1)
- self.assert_(-42 not in t1)
+ self.assertIn(item, t1)
+ self.assertNotIn(-42, t1)
def test_hash(self):
t1 = time.gmtime()
@@ -61,11 +61,11 @@ class StructSeqTest(unittest.TestCase):
t1 = time.gmtime()
t2 = type(t1)(t1)
self.assertEqual(t1, t2)
- self.assert_(not (t1 < t2))
- self.assert_(t1 <= t2)
- self.assert_(not (t1 > t2))
- self.assert_(t1 >= t2)
- self.assert_(not (t1 != t2))
+ self.assertTrue(not (t1 < t2))
+ self.assertTrue(t1 <= t2)
+ self.assertTrue(not (t1 > t2))
+ self.assertTrue(t1 >= t2)
+ self.assertTrue(not (t1 != t2))
def test_fields(self):
t = time.gmtime()
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py
index 7dde01313e..b635ef397c 100644
--- a/Lib/test/test_subprocess.py
+++ b/Lib/test/test_subprocess.py
@@ -8,6 +8,7 @@ import errno
import tempfile
import time
import re
+import sysconfig
mswindows = (sys.platform == "win32")
@@ -21,36 +22,39 @@ if mswindows:
else:
SETBINARY = ''
-# In a debug build, stuff like "[6580 refs]" is printed to stderr at
-# shutdown time. That frustrates tests trying to check stderr produced
-# from a spawned Python process.
-def remove_stderr_debug_decorations(stderr):
- return re.sub(r"\[\d+ refs\]\r?\n?$", "", stderr)
-class ProcessTestCase(unittest.TestCase):
+try:
+ mkstemp = tempfile.mkstemp
+except AttributeError:
+ # tempfile.mkstemp is not available
+ def mkstemp():
+ """Replacement for mkstemp, calling mktemp."""
+ fname = tempfile.mktemp()
+ return os.open(fname, os.O_RDWR|os.O_CREAT), fname
+
+
+class BaseTestCase(unittest.TestCase):
def setUp(self):
# Try to minimize the number of children we have so this test
# doesn't crash on some buildbots (Alphas in particular).
- if hasattr(test_support, "reap_children"):
- test_support.reap_children()
+ test_support.reap_children()
def tearDown(self):
- # Try to minimize the number of children we have so this test
- # doesn't crash on some buildbots (Alphas in particular).
- if hasattr(test_support, "reap_children"):
- test_support.reap_children()
+ for inst in subprocess._active:
+ inst.wait()
+ subprocess._cleanup()
+ self.assertFalse(subprocess._active, "subprocess._active not empty")
- def mkstemp(self):
- """wrapper for mkstemp, calling mktemp if mkstemp is not available"""
- if hasattr(tempfile, "mkstemp"):
- return tempfile.mkstemp()
- else:
- fname = tempfile.mktemp()
- return os.open(fname, os.O_RDWR|os.O_CREAT), fname
+ def assertStderrEqual(self, stderr, expected, msg=None):
+ # In a debug build, stuff like "[6580 refs]" is printed to stderr at
+ # shutdown time. That frustrates tests trying to check stderr produced
+ # from a spawned Python process.
+ actual = re.sub(r"\[\d+ refs\]\r?\n?$", "", stderr)
+ self.assertEqual(actual, expected, msg)
+
+
+class ProcessTestCase(BaseTestCase):
- #
- # Generic tests
- #
def test_call_seq(self):
# call() function with sequence argument
rc = subprocess.call([sys.executable, "-c",
@@ -65,28 +69,56 @@ class ProcessTestCase(unittest.TestCase):
def test_check_call_nonzero(self):
# check_call() function with non-zero return code
- try:
+ with self.assertRaises(subprocess.CalledProcessError) as c:
subprocess.check_call([sys.executable, "-c",
"import sys; sys.exit(47)"])
- except subprocess.CalledProcessError, e:
- self.assertEqual(e.returncode, 47)
- else:
- self.fail("Expected CalledProcessError")
+ self.assertEqual(c.exception.returncode, 47)
+
+ def test_check_output(self):
+ # check_output() function with zero return code
+ output = subprocess.check_output(
+ [sys.executable, "-c", "print 'BDFL'"])
+ self.assertIn('BDFL', output)
+
+ def test_check_output_nonzero(self):
+ # check_call() function with non-zero return code
+ with self.assertRaises(subprocess.CalledProcessError) as c:
+ subprocess.check_output(
+ [sys.executable, "-c", "import sys; sys.exit(5)"])
+ self.assertEqual(c.exception.returncode, 5)
+
+ def test_check_output_stderr(self):
+ # check_output() function stderr redirected to stdout
+ output = subprocess.check_output(
+ [sys.executable, "-c", "import sys; sys.stderr.write('BDFL')"],
+ stderr=subprocess.STDOUT)
+ self.assertIn('BDFL', output)
+
+ def test_check_output_stdout_arg(self):
+ # check_output() function stderr redirected to stdout
+ with self.assertRaises(ValueError) as c:
+ output = subprocess.check_output(
+ [sys.executable, "-c", "print 'will not be run'"],
+ stdout=sys.stdout)
+ self.fail("Expected ValueError when stdout arg supplied.")
+ self.assertIn('stdout', c.exception.args[0])
def test_call_kwargs(self):
# call() function with keyword args
newenv = os.environ.copy()
newenv["FRUIT"] = "banana"
rc = subprocess.call([sys.executable, "-c",
- 'import sys, os;' \
- 'sys.exit(os.getenv("FRUIT")=="banana")'],
- env=newenv)
+ 'import sys, os;'
+ 'sys.exit(os.getenv("FRUIT")=="banana")'],
+ env=newenv)
self.assertEqual(rc, 1)
def test_stdin_none(self):
# .stdin is None when not redirected
p = subprocess.Popen([sys.executable, "-c", 'print "banana"'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
p.wait()
self.assertEqual(p.stdin, None)
@@ -97,6 +129,8 @@ class ProcessTestCase(unittest.TestCase):
'test of stdout in a different '
'process ..."'],
stdin=subprocess.PIPE, stderr=subprocess.PIPE)
+ self.addCleanup(p.stdin.close)
+ self.addCleanup(p.stderr.close)
p.wait()
self.assertEqual(p.stdout, None)
@@ -104,12 +138,26 @@ class ProcessTestCase(unittest.TestCase):
# .stderr is None when not redirected
p = subprocess.Popen([sys.executable, "-c", 'print "banana"'],
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stdin.close)
p.wait()
self.assertEqual(p.stderr, None)
- def test_executable(self):
- p = subprocess.Popen(["somethingyoudonthave",
- "-c", "import sys; sys.exit(47)"],
+ def test_executable_with_cwd(self):
+ python_dir = os.path.dirname(os.path.realpath(sys.executable))
+ p = subprocess.Popen(["somethingyoudonthave", "-c",
+ "import sys; sys.exit(47)"],
+ executable=sys.executable, cwd=python_dir)
+ p.wait()
+ self.assertEqual(p.returncode, 47)
+
+ @unittest.skipIf(sysconfig.is_python_build(),
+ "need an installed Python. See #7774")
+ def test_executable_without_cwd(self):
+ # For a normal installation, it should work without 'cwd'
+ # argument. For test runs in the build directory, see #7774.
+ p = subprocess.Popen(["somethingyoudonthave", "-c",
+ "import sys; sys.exit(47)"],
executable=sys.executable)
p.wait()
self.assertEqual(p.returncode, 47)
@@ -152,6 +200,7 @@ class ProcessTestCase(unittest.TestCase):
p = subprocess.Popen([sys.executable, "-c",
'import sys; sys.stdout.write("orange")'],
stdout=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
self.assertEqual(p.stdout.read(), "orange")
def test_stdout_filedes(self):
@@ -180,8 +229,8 @@ class ProcessTestCase(unittest.TestCase):
p = subprocess.Popen([sys.executable, "-c",
'import sys; sys.stderr.write("strawberry")'],
stderr=subprocess.PIPE)
- self.assertEqual(remove_stderr_debug_decorations(p.stderr.read()),
- "strawberry")
+ self.addCleanup(p.stderr.close)
+ self.assertStderrEqual(p.stderr.read(), "strawberry")
def test_stderr_filedes(self):
# stderr is set to open file descriptor
@@ -192,8 +241,7 @@ class ProcessTestCase(unittest.TestCase):
stderr=d)
p.wait()
os.lseek(d, 0, 0)
- self.assertEqual(remove_stderr_debug_decorations(os.read(d, 1024)),
- "strawberry")
+ self.assertStderrEqual(os.read(d, 1024), "strawberry")
def test_stderr_fileobj(self):
# stderr is set to open file object
@@ -203,43 +251,39 @@ class ProcessTestCase(unittest.TestCase):
stderr=tf)
p.wait()
tf.seek(0)
- self.assertEqual(remove_stderr_debug_decorations(tf.read()),
- "strawberry")
+ self.assertStderrEqual(tf.read(), "strawberry")
def test_stdout_stderr_pipe(self):
# capture stdout and stderr to the same pipe
p = subprocess.Popen([sys.executable, "-c",
- 'import sys;' \
- 'sys.stdout.write("apple");' \
- 'sys.stdout.flush();' \
+ 'import sys;'
+ 'sys.stdout.write("apple");'
+ 'sys.stdout.flush();'
'sys.stderr.write("orange")'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
- output = p.stdout.read()
- stripped = remove_stderr_debug_decorations(output)
- self.assertEqual(stripped, "appleorange")
+ self.addCleanup(p.stdout.close)
+ self.assertStderrEqual(p.stdout.read(), "appleorange")
def test_stdout_stderr_file(self):
# capture stdout and stderr to the same open file
tf = tempfile.TemporaryFile()
p = subprocess.Popen([sys.executable, "-c",
- 'import sys;' \
- 'sys.stdout.write("apple");' \
- 'sys.stdout.flush();' \
+ 'import sys;'
+ 'sys.stdout.write("apple");'
+ 'sys.stdout.flush();'
'sys.stderr.write("orange")'],
stdout=tf,
stderr=tf)
p.wait()
tf.seek(0)
- output = tf.read()
- stripped = remove_stderr_debug_decorations(output)
- self.assertEqual(stripped, "appleorange")
+ self.assertStderrEqual(tf.read(), "appleorange")
def test_stdout_filedes_of_stdout(self):
# stdout is set to 1 (#1531862).
cmd = r"import sys, os; sys.exit(os.write(sys.stdout.fileno(), '.\n'))"
rc = subprocess.call([sys.executable, "-c", cmd], stdout=1)
- self.assertEquals(rc, 2)
+ self.assertEqual(rc, 2)
def test_cwd(self):
tmpdir = tempfile.gettempdir()
@@ -250,10 +294,11 @@ class ProcessTestCase(unittest.TestCase):
tmpdir = os.getcwd()
os.chdir(cwd)
p = subprocess.Popen([sys.executable, "-c",
- 'import sys,os;' \
+ 'import sys,os;'
'sys.stdout.write(os.getcwd())'],
stdout=subprocess.PIPE,
cwd=tmpdir)
+ self.addCleanup(p.stdout.close)
normcase = os.path.normcase
self.assertEqual(normcase(p.stdout.read()), normcase(tmpdir))
@@ -261,15 +306,17 @@ class ProcessTestCase(unittest.TestCase):
newenv = os.environ.copy()
newenv["FRUIT"] = "orange"
p = subprocess.Popen([sys.executable, "-c",
- 'import sys,os;' \
+ 'import sys,os;'
'sys.stdout.write(os.getenv("FRUIT"))'],
stdout=subprocess.PIPE,
env=newenv)
+ self.addCleanup(p.stdout.close)
self.assertEqual(p.stdout.read(), "orange")
def test_communicate_stdin(self):
p = subprocess.Popen([sys.executable, "-c",
- 'import sys; sys.exit(sys.stdin.read() == "pear")'],
+ 'import sys;'
+ 'sys.exit(sys.stdin.read() == "pear")'],
stdin=subprocess.PIPE)
p.communicate("pear")
self.assertEqual(p.returncode, 1)
@@ -288,7 +335,7 @@ class ProcessTestCase(unittest.TestCase):
stderr=subprocess.PIPE)
(stdout, stderr) = p.communicate()
self.assertEqual(stdout, None)
- self.assertEqual(remove_stderr_debug_decorations(stderr), "pineapple")
+ self.assertStderrEqual(stderr, "pineapple")
def test_communicate(self):
p = subprocess.Popen([sys.executable, "-c",
@@ -298,26 +345,29 @@ class ProcessTestCase(unittest.TestCase):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
(stdout, stderr) = p.communicate("banana")
self.assertEqual(stdout, "banana")
- self.assertEqual(remove_stderr_debug_decorations(stderr),
- "pineapple")
+ self.assertStderrEqual(stderr, "pineapple")
# This test is Linux specific for simplicity to at least have
# some coverage. It is not a platform specific bug.
- if os.path.isdir('/proc/%d/fd' % os.getpid()):
- # Test for the fd leak reported in http://bugs.python.org/issue2791.
- def test_communicate_pipe_fd_leak(self):
- fd_directory = '/proc/%d/fd' % os.getpid()
- num_fds_before_popen = len(os.listdir(fd_directory))
- p = subprocess.Popen([sys.executable, '-c', 'print()'],
- stdout=subprocess.PIPE)
- p.communicate()
- num_fds_after_communicate = len(os.listdir(fd_directory))
- del p
- num_fds_after_destruction = len(os.listdir(fd_directory))
- self.assertEqual(num_fds_before_popen, num_fds_after_destruction)
- self.assertEqual(num_fds_before_popen, num_fds_after_communicate)
+ @unittest.skipUnless(os.path.isdir('/proc/%d/fd' % os.getpid()),
+ "Linux specific")
+ # Test for the fd leak reported in http://bugs.python.org/issue2791.
+ def test_communicate_pipe_fd_leak(self):
+ fd_directory = '/proc/%d/fd' % os.getpid()
+ num_fds_before_popen = len(os.listdir(fd_directory))
+ p = subprocess.Popen([sys.executable, "-c", "print()"],
+ stdout=subprocess.PIPE)
+ p.communicate()
+ num_fds_after_communicate = len(os.listdir(fd_directory))
+ del p
+ num_fds_after_destruction = len(os.listdir(fd_directory))
+ self.assertEqual(num_fds_before_popen, num_fds_after_destruction)
+ self.assertEqual(num_fds_before_popen, num_fds_after_communicate)
def test_communicate_returns(self):
# communicate() should return None if no redirection is active
@@ -340,12 +390,15 @@ class ProcessTestCase(unittest.TestCase):
os.close(y)
p = subprocess.Popen([sys.executable, "-c",
'import sys,os;'
- 'sys.stdout.write(sys.stdin.read(47));' \
- 'sys.stderr.write("xyz"*%d);' \
+ 'sys.stdout.write(sys.stdin.read(47));'
+ 'sys.stderr.write("xyz"*%d);'
'sys.stdout.write(sys.stdin.read())' % pipe_buf],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
string_to_write = "abc"*pipe_buf
(stdout, stderr) = p.communicate(string_to_write)
self.assertEqual(stdout, string_to_write)
@@ -353,15 +406,18 @@ class ProcessTestCase(unittest.TestCase):
def test_writes_before_communicate(self):
# stdin.write before communicate()
p = subprocess.Popen([sys.executable, "-c",
- 'import sys,os;' \
+ 'import sys,os;'
'sys.stdout.write(sys.stdin.read())'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
p.stdin.write("banana")
(stdout, stderr) = p.communicate("split")
self.assertEqual(stdout, "bananasplit")
- self.assertEqual(remove_stderr_debug_decorations(stderr), "")
+ self.assertStderrEqual(stderr, "")
def test_universal_newlines(self):
p = subprocess.Popen([sys.executable, "-c",
@@ -379,6 +435,7 @@ class ProcessTestCase(unittest.TestCase):
'sys.stdout.write("\\nline6");'],
stdout=subprocess.PIPE,
universal_newlines=1)
+ self.addCleanup(p.stdout.close)
stdout = p.stdout.read()
if hasattr(file, 'newlines'):
# Interpreter with universal newline support
@@ -406,6 +463,8 @@ class ProcessTestCase(unittest.TestCase):
'sys.stdout.write("\\nline6");'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=1)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
(stdout, stderr) = p.communicate()
if hasattr(file, 'newlines'):
# Interpreter with universal newline support
@@ -413,24 +472,45 @@ class ProcessTestCase(unittest.TestCase):
"line1\nline2\nline3\nline4\nline5\nline6")
else:
# Interpreter without universal newline support
- self.assertEqual(stdout, "line1\nline2\rline3\r\nline4\r\nline5\nline6")
+ self.assertEqual(stdout,
+ "line1\nline2\rline3\r\nline4\r\nline5\nline6")
def test_no_leaking(self):
# Make sure we leak no resources
- if not hasattr(test_support, "is_resource_enabled") \
- or test_support.is_resource_enabled("subprocess") and not mswindows:
+ if not mswindows:
max_handles = 1026 # too much for most UNIX systems
else:
- max_handles = 65
- for i in range(max_handles):
- p = subprocess.Popen([sys.executable, "-c",
- "import sys;sys.stdout.write(sys.stdin.read())"],
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- data = p.communicate("lime")[0]
- self.assertEqual(data, "lime")
-
+ max_handles = 2050 # too much for (at least some) Windows setups
+ handles = []
+ try:
+ for i in range(max_handles):
+ try:
+ handles.append(os.open(test_support.TESTFN,
+ os.O_WRONLY | os.O_CREAT))
+ except OSError as e:
+ if e.errno != errno.EMFILE:
+ raise
+ break
+ else:
+ self.skipTest("failed to reach the file descriptor limit "
+ "(tried %d)" % max_handles)
+ # Close a couple of them (should be enough for a subprocess)
+ for i in range(10):
+ os.close(handles.pop())
+ # Loop creating some subprocesses. If one of them leaks some fds,
+ # the next loop iteration will fail by reaching the max fd limit.
+ for i in range(15):
+ p = subprocess.Popen([sys.executable, "-c",
+ "import sys;"
+ "sys.stdout.write(sys.stdin.read())"],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ data = p.communicate(b"lime")[0]
+ self.assertEqual(data, b"lime")
+ finally:
+ for h in handles:
+ os.close(h)
def test_list2cmdline(self):
self.assertEqual(subprocess.list2cmdline(['a b c', 'd', 'e']),
@@ -462,7 +542,7 @@ class ProcessTestCase(unittest.TestCase):
# but, based on system scheduling we can't control, it's possible
# poll() never returned None. It "should be" very rare that it
# didn't go around at least twice.
- self.assert_(count >= 2)
+ self.assertGreaterEqual(count, 2)
# Subsequent invocations should just return the returncode
self.assertEqual(p.poll(), 0)
@@ -478,12 +558,8 @@ class ProcessTestCase(unittest.TestCase):
def test_invalid_bufsize(self):
# an invalid type of the bufsize argument should raise
# TypeError.
- try:
+ with self.assertRaises(TypeError):
subprocess.Popen([sys.executable, "-c", "pass"], "orange")
- except TypeError:
- pass
- else:
- self.fail("Expected TypeError")
def test_leaking_fds_on_error(self):
# see bug #5179: Popen leaks file descriptors to PIPEs if
@@ -492,280 +568,417 @@ class ProcessTestCase(unittest.TestCase):
# value for that limit, but Windows has 2048, so we loop
# 1024 times (each call leaked two fds).
for i in range(1024):
- try:
+ # Windows raises IOError. Others raise OSError.
+ with self.assertRaises(EnvironmentError) as c:
subprocess.Popen(['nonexisting_i_hope'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
- # Windows raises IOError
- except (IOError, OSError), err:
- if err.errno != 2: # ignore "no such file"
- raise
-
- #
- # POSIX tests
- #
- if not mswindows:
- def test_exceptions(self):
- # catched & re-raised exceptions
- try:
- p = subprocess.Popen([sys.executable, "-c", ""],
- cwd="/this/path/does/not/exist")
- except OSError, e:
- # The attribute child_traceback should contain "os.chdir"
- # somewhere.
- self.assertNotEqual(e.child_traceback.find("os.chdir"), -1)
- else:
- self.fail("Expected OSError")
-
- def _suppress_core_files(self):
- """Try to prevent core files from being created.
- Returns previous ulimit if successful, else None.
- """
- if sys.platform == 'darwin':
- # Check if the 'Crash Reporter' on OSX was configured
- # in 'Developer' mode and warn that it will get triggered
- # when it is.
- #
- # This assumes that this context manager is used in tests
- # that might trigger the next manager.
- value = subprocess.Popen(['/usr/bin/defaults', 'read',
+ # ignore errors that indicate the command was not found
+ if c.exception.errno not in (errno.ENOENT, errno.EACCES):
+ raise c.exception
+
+ def test_handles_closed_on_exception(self):
+ # If CreateProcess exits with an error, ensure the
+ # duplicate output handles are released
+ ifhandle, ifname = mkstemp()
+ ofhandle, ofname = mkstemp()
+ efhandle, efname = mkstemp()
+ try:
+ subprocess.Popen (["*"], stdin=ifhandle, stdout=ofhandle,
+ stderr=efhandle)
+ except OSError:
+ os.close(ifhandle)
+ os.remove(ifname)
+ os.close(ofhandle)
+ os.remove(ofname)
+ os.close(efhandle)
+ os.remove(efname)
+ self.assertFalse(os.path.exists(ifname))
+ self.assertFalse(os.path.exists(ofname))
+ self.assertFalse(os.path.exists(efname))
+
+ def test_communicate_epipe(self):
+ # Issue 10963: communicate() should hide EPIPE
+ p = subprocess.Popen([sys.executable, "-c", 'pass'],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
+ p.communicate("x" * 2**20)
+
+ def test_communicate_epipe_only_stdin(self):
+ # Issue 10963: communicate() should hide EPIPE
+ p = subprocess.Popen([sys.executable, "-c", 'pass'],
+ stdin=subprocess.PIPE)
+ self.addCleanup(p.stdin.close)
+ time.sleep(2)
+ p.communicate("x" * 2**20)
+
+# context manager
+class _SuppressCoreFiles(object):
+ """Try to prevent core files from being created."""
+ old_limit = None
+
+ def __enter__(self):
+ """Try to save previous ulimit, then set it to (0, 0)."""
+ try:
+ import resource
+ self.old_limit = resource.getrlimit(resource.RLIMIT_CORE)
+ resource.setrlimit(resource.RLIMIT_CORE, (0, 0))
+ except (ImportError, ValueError, resource.error):
+ pass
+
+ if sys.platform == 'darwin':
+ # Check if the 'Crash Reporter' on OSX was configured
+ # in 'Developer' mode and warn that it will get triggered
+ # when it is.
+ #
+ # This assumes that this context manager is used in tests
+ # that might trigger the next manager.
+ value = subprocess.Popen(['/usr/bin/defaults', 'read',
'com.apple.CrashReporter', 'DialogType'],
stdout=subprocess.PIPE).communicate()[0]
- if value.strip() == b'developer':
- print "this tests triggers the Crash Reporter, that is intentional"
- sys.stdout.flush()
-
- try:
- import resource
- old_limit = resource.getrlimit(resource.RLIMIT_CORE)
- resource.setrlimit(resource.RLIMIT_CORE, (0,0))
- return old_limit
- except (ImportError, ValueError, resource.error):
- return None
-
- def _unsuppress_core_files(self, old_limit):
- """Return core file behavior to default."""
- if old_limit is None:
- return
- try:
- import resource
- resource.setrlimit(resource.RLIMIT_CORE, old_limit)
- except (ImportError, ValueError, resource.error):
- return
-
- def test_run_abort(self):
- # returncode handles signal termination
- old_limit = self._suppress_core_files()
- try:
- p = subprocess.Popen([sys.executable,
- "-c", "import os; os.abort()"])
- finally:
- self._unsuppress_core_files(old_limit)
- p.wait()
- self.assertEqual(-p.returncode, signal.SIGABRT)
+ if value.strip() == b'developer':
+ print "this tests triggers the Crash Reporter, that is intentional"
+ sys.stdout.flush()
+
+ def __exit__(self, *args):
+ """Return core file behavior to default."""
+ if self.old_limit is None:
+ return
+ try:
+ import resource
+ resource.setrlimit(resource.RLIMIT_CORE, self.old_limit)
+ except (ImportError, ValueError, resource.error):
+ pass
+
+
+@unittest.skipIf(mswindows, "POSIX specific tests")
+class POSIXProcessTestCase(BaseTestCase):
- def test_preexec(self):
- # preexec function
+ def test_exceptions(self):
+ # caught & re-raised exceptions
+ with self.assertRaises(OSError) as c:
+ p = subprocess.Popen([sys.executable, "-c", ""],
+ cwd="/this/path/does/not/exist")
+ # The attribute child_traceback should contain "os.chdir" somewhere.
+ self.assertIn("os.chdir", c.exception.child_traceback)
+
+ def test_run_abort(self):
+ # returncode handles signal termination
+ with _SuppressCoreFiles():
p = subprocess.Popen([sys.executable, "-c",
- 'import sys,os;' \
- 'sys.stdout.write(os.getenv("FRUIT"))'],
+ "import os; os.abort()"])
+ p.wait()
+ self.assertEqual(-p.returncode, signal.SIGABRT)
+
+ def test_preexec(self):
+ # preexec function
+ p = subprocess.Popen([sys.executable, "-c",
+ "import sys, os;"
+ "sys.stdout.write(os.getenv('FRUIT'))"],
stdout=subprocess.PIPE,
preexec_fn=lambda: os.putenv("FRUIT", "apple"))
- self.assertEqual(p.stdout.read(), "apple")
-
- def test_args_string(self):
- # args is a string
- f, fname = self.mkstemp()
- os.write(f, "#!/bin/sh\n")
- os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" %
- sys.executable)
- os.close(f)
- os.chmod(fname, 0700)
- p = subprocess.Popen(fname)
- p.wait()
- os.remove(fname)
- self.assertEqual(p.returncode, 47)
-
- def test_invalid_args(self):
- # invalid arguments should raise ValueError
- self.assertRaises(ValueError, subprocess.call,
- [sys.executable,
- "-c", "import sys; sys.exit(47)"],
- startupinfo=47)
- self.assertRaises(ValueError, subprocess.call,
- [sys.executable,
- "-c", "import sys; sys.exit(47)"],
- creationflags=47)
-
- def test_shell_sequence(self):
- # Run command through the shell (sequence)
- newenv = os.environ.copy()
- newenv["FRUIT"] = "apple"
- p = subprocess.Popen(["echo $FRUIT"], shell=1,
- stdout=subprocess.PIPE,
- env=newenv)
- self.assertEqual(p.stdout.read().strip(), "apple")
-
- def test_shell_string(self):
- # Run command through the shell (string)
- newenv = os.environ.copy()
- newenv["FRUIT"] = "apple"
- p = subprocess.Popen("echo $FRUIT", shell=1,
- stdout=subprocess.PIPE,
- env=newenv)
- self.assertEqual(p.stdout.read().strip(), "apple")
-
- def test_call_string(self):
- # call() function with string argument on UNIX
- f, fname = self.mkstemp()
- os.write(f, "#!/bin/sh\n")
- os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" %
- sys.executable)
- os.close(f)
- os.chmod(fname, 0700)
- rc = subprocess.call(fname)
- os.remove(fname)
- self.assertEqual(rc, 47)
-
- def test_specific_shell(self):
- # Issue #9265: Incorrect name passed as arg[0].
- shells = []
- for prefix in ['/bin', '/usr/bin/', '/usr/local/bin']:
- for name in ['bash', 'ksh']:
- sh = os.path.join(prefix, name)
- if os.path.isfile(sh):
- shells.append(sh)
- if not shells: # Will probably work for any shell but csh.
- return # skip test
- sh = '/bin/sh'
- if os.path.isfile(sh) and not os.path.islink(sh):
- # Test will fail if /bin/sh is a symlink to csh.
- shells.append(sh)
- for sh in shells:
- p = subprocess.Popen("echo $0", executable=sh, shell=True,
- stdout=subprocess.PIPE)
- self.assertEqual(p.stdout.read().strip(), sh)
-
- def DISABLED_test_send_signal(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
-
- self.assert_(p.poll() is None, p.poll())
- p.send_signal(signal.SIGINT)
- self.assertNotEqual(p.wait(), 0)
-
- def DISABLED_test_kill(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
-
- self.assert_(p.poll() is None, p.poll())
- p.kill()
- self.assertEqual(p.wait(), -signal.SIGKILL)
-
- def DISABLED_test_terminate(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
-
- self.assert_(p.poll() is None, p.poll())
- p.terminate()
- self.assertEqual(p.wait(), -signal.SIGTERM)
-
- #
- # Windows tests
- #
- if mswindows:
- def test_startupinfo(self):
- # startupinfo argument
- # We uses hardcoded constants, because we do not want to
- # depend on win32all.
- STARTF_USESHOWWINDOW = 1
- SW_MAXIMIZE = 3
- startupinfo = subprocess.STARTUPINFO()
- startupinfo.dwFlags = STARTF_USESHOWWINDOW
- startupinfo.wShowWindow = SW_MAXIMIZE
- # Since Python is a console process, it won't be affected
- # by wShowWindow, but the argument should be silently
- # ignored
- subprocess.call([sys.executable, "-c", "import sys; sys.exit(0)"],
- startupinfo=startupinfo)
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(p.stdout.read(), "apple")
+
+ def test_args_string(self):
+ # args is a string
+ f, fname = mkstemp()
+ os.write(f, "#!/bin/sh\n")
+ os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" %
+ sys.executable)
+ os.close(f)
+ os.chmod(fname, 0o700)
+ p = subprocess.Popen(fname)
+ p.wait()
+ os.remove(fname)
+ self.assertEqual(p.returncode, 47)
- def test_creationflags(self):
- # creationflags argument
- CREATE_NEW_CONSOLE = 16
- sys.stderr.write(" a DOS box should flash briefly ...\n")
- subprocess.call(sys.executable +
- ' -c "import time; time.sleep(0.25)"',
- creationflags=CREATE_NEW_CONSOLE)
-
- def test_invalid_args(self):
- # invalid arguments should raise ValueError
- self.assertRaises(ValueError, subprocess.call,
- [sys.executable,
- "-c", "import sys; sys.exit(47)"],
- preexec_fn=lambda: 1)
- self.assertRaises(ValueError, subprocess.call,
- [sys.executable,
- "-c", "import sys; sys.exit(47)"],
- stdout=subprocess.PIPE,
- close_fds=True)
+ def test_invalid_args(self):
+ # invalid arguments should raise ValueError
+ self.assertRaises(ValueError, subprocess.call,
+ [sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ startupinfo=47)
+ self.assertRaises(ValueError, subprocess.call,
+ [sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ creationflags=47)
+
+ def test_shell_sequence(self):
+ # Run command through the shell (sequence)
+ newenv = os.environ.copy()
+ newenv["FRUIT"] = "apple"
+ p = subprocess.Popen(["echo $FRUIT"], shell=1,
+ stdout=subprocess.PIPE,
+ env=newenv)
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(p.stdout.read().strip(), "apple")
- def test_close_fds(self):
- # close file descriptors
- rc = subprocess.call([sys.executable, "-c",
- "import sys; sys.exit(47)"],
- close_fds=True)
- self.assertEqual(rc, 47)
-
- def test_shell_sequence(self):
- # Run command through the shell (sequence)
- newenv = os.environ.copy()
- newenv["FRUIT"] = "physalis"
- p = subprocess.Popen(["set"], shell=1,
- stdout=subprocess.PIPE,
- env=newenv)
- self.assertNotEqual(p.stdout.read().find("physalis"), -1)
-
- def test_shell_string(self):
- # Run command through the shell (string)
- newenv = os.environ.copy()
- newenv["FRUIT"] = "physalis"
- p = subprocess.Popen("set", shell=1,
- stdout=subprocess.PIPE,
- env=newenv)
- self.assertNotEqual(p.stdout.read().find("physalis"), -1)
+ def test_shell_string(self):
+ # Run command through the shell (string)
+ newenv = os.environ.copy()
+ newenv["FRUIT"] = "apple"
+ p = subprocess.Popen("echo $FRUIT", shell=1,
+ stdout=subprocess.PIPE,
+ env=newenv)
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(p.stdout.read().strip(), "apple")
+
+ def test_call_string(self):
+ # call() function with string argument on UNIX
+ f, fname = mkstemp()
+ os.write(f, "#!/bin/sh\n")
+ os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" %
+ sys.executable)
+ os.close(f)
+ os.chmod(fname, 0700)
+ rc = subprocess.call(fname)
+ os.remove(fname)
+ self.assertEqual(rc, 47)
- def test_call_string(self):
- # call() function with string argument on Windows
- rc = subprocess.call(sys.executable +
- ' -c "import sys; sys.exit(47)"')
- self.assertEqual(rc, 47)
+ def test_specific_shell(self):
+ # Issue #9265: Incorrect name passed as arg[0].
+ shells = []
+ for prefix in ['/bin', '/usr/bin/', '/usr/local/bin']:
+ for name in ['bash', 'ksh']:
+ sh = os.path.join(prefix, name)
+ if os.path.isfile(sh):
+ shells.append(sh)
+ if not shells: # Will probably work for any shell but csh.
+ self.skipTest("bash or ksh required for this test")
+ sh = '/bin/sh'
+ if os.path.isfile(sh) and not os.path.islink(sh):
+ # Test will fail if /bin/sh is a symlink to csh.
+ shells.append(sh)
+ for sh in shells:
+ p = subprocess.Popen("echo $0", executable=sh, shell=True,
+ stdout=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(p.stdout.read().strip(), sh)
+
+ def _kill_process(self, method, *args):
+ # Do not inherit file handles from the parent.
+ # It should fix failures on some platforms.
+ p = subprocess.Popen([sys.executable, "-c", """if 1:
+ import sys, time
+ sys.stdout.write('x\\n')
+ sys.stdout.flush()
+ time.sleep(30)
+ """],
+ close_fds=True,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ # Wait for the interpreter to be completely initialized before
+ # sending any signal.
+ p.stdout.read(1)
+ getattr(p, method)(*args)
+ return p
+
+ def test_send_signal(self):
+ p = self._kill_process('send_signal', signal.SIGINT)
+ _, stderr = p.communicate()
+ self.assertIn('KeyboardInterrupt', stderr)
+ self.assertNotEqual(p.wait(), 0)
+
+ def test_kill(self):
+ p = self._kill_process('kill')
+ _, stderr = p.communicate()
+ self.assertStderrEqual(stderr, '')
+ self.assertEqual(p.wait(), -signal.SIGKILL)
+
+ def test_terminate(self):
+ p = self._kill_process('terminate')
+ _, stderr = p.communicate()
+ self.assertStderrEqual(stderr, '')
+ self.assertEqual(p.wait(), -signal.SIGTERM)
+
+ def check_close_std_fds(self, fds):
+ # Issue #9905: test that subprocess pipes still work properly with
+ # some standard fds closed
+ stdin = 0
+ newfds = []
+ for a in fds:
+ b = os.dup(a)
+ newfds.append(b)
+ if a == 0:
+ stdin = b
+ try:
+ for fd in fds:
+ os.close(fd)
+ out, err = subprocess.Popen([sys.executable, "-c",
+ 'import sys;'
+ 'sys.stdout.write("apple");'
+ 'sys.stdout.flush();'
+ 'sys.stderr.write("orange")'],
+ stdin=stdin,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE).communicate()
+ err = test_support.strip_python_stderr(err)
+ self.assertEqual((out, err), (b'apple', b'orange'))
+ finally:
+ for b, a in zip(newfds, fds):
+ os.dup2(b, a)
+ for b in newfds:
+ os.close(b)
+
+ def test_close_fd_0(self):
+ self.check_close_std_fds([0])
+
+ def test_close_fd_1(self):
+ self.check_close_std_fds([1])
+
+ def test_close_fd_2(self):
+ self.check_close_std_fds([2])
+
+ def test_close_fds_0_1(self):
+ self.check_close_std_fds([0, 1])
+
+ def test_close_fds_0_2(self):
+ self.check_close_std_fds([0, 2])
+
+ def test_close_fds_1_2(self):
+ self.check_close_std_fds([1, 2])
+
+ def test_close_fds_0_1_2(self):
+ # Issue #10806: test that subprocess pipes still work properly with
+ # all standard fds closed.
+ self.check_close_std_fds([0, 1, 2])
+
+ def test_wait_when_sigchild_ignored(self):
+ # NOTE: sigchild_ignore.py may not be an effective test on all OSes.
+ sigchild_ignore = test_support.findfile("sigchild_ignore.py",
+ subdir="subprocessdata")
+ p = subprocess.Popen([sys.executable, sigchild_ignore],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ self.assertEqual(0, p.returncode, "sigchild_ignore.py exited"
+ " non-zero with this error:\n%s" % stderr)
+
+
+@unittest.skipUnless(mswindows, "Windows specific tests")
+class Win32ProcessTestCase(BaseTestCase):
+
+ def test_startupinfo(self):
+ # startupinfo argument
+ # We uses hardcoded constants, because we do not want to
+ # depend on win32all.
+ STARTF_USESHOWWINDOW = 1
+ SW_MAXIMIZE = 3
+ startupinfo = subprocess.STARTUPINFO()
+ startupinfo.dwFlags = STARTF_USESHOWWINDOW
+ startupinfo.wShowWindow = SW_MAXIMIZE
+ # Since Python is a console process, it won't be affected
+ # by wShowWindow, but the argument should be silently
+ # ignored
+ subprocess.call([sys.executable, "-c", "import sys; sys.exit(0)"],
+ startupinfo=startupinfo)
- def DISABLED_test_send_signal(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
+ def test_creationflags(self):
+ # creationflags argument
+ CREATE_NEW_CONSOLE = 16
+ sys.stderr.write(" a DOS box should flash briefly ...\n")
+ subprocess.call(sys.executable +
+ ' -c "import time; time.sleep(0.25)"',
+ creationflags=CREATE_NEW_CONSOLE)
+
+ def test_invalid_args(self):
+ # invalid arguments should raise ValueError
+ self.assertRaises(ValueError, subprocess.call,
+ [sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ preexec_fn=lambda: 1)
+ self.assertRaises(ValueError, subprocess.call,
+ [sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ stdout=subprocess.PIPE,
+ close_fds=True)
+
+ def test_close_fds(self):
+ # close file descriptors
+ rc = subprocess.call([sys.executable, "-c",
+ "import sys; sys.exit(47)"],
+ close_fds=True)
+ self.assertEqual(rc, 47)
- self.assert_(p.poll() is None, p.poll())
- p.send_signal(signal.SIGTERM)
- self.assertNotEqual(p.wait(), 0)
+ def test_shell_sequence(self):
+ # Run command through the shell (sequence)
+ newenv = os.environ.copy()
+ newenv["FRUIT"] = "physalis"
+ p = subprocess.Popen(["set"], shell=1,
+ stdout=subprocess.PIPE,
+ env=newenv)
+ self.addCleanup(p.stdout.close)
+ self.assertIn("physalis", p.stdout.read())
- def DISABLED_test_kill(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
+ def test_shell_string(self):
+ # Run command through the shell (string)
+ newenv = os.environ.copy()
+ newenv["FRUIT"] = "physalis"
+ p = subprocess.Popen("set", shell=1,
+ stdout=subprocess.PIPE,
+ env=newenv)
+ self.addCleanup(p.stdout.close)
+ self.assertIn("physalis", p.stdout.read())
+
+ def test_call_string(self):
+ # call() function with string argument on Windows
+ rc = subprocess.call(sys.executable +
+ ' -c "import sys; sys.exit(47)"')
+ self.assertEqual(rc, 47)
- self.assert_(p.poll() is None, p.poll())
- p.kill()
- self.assertNotEqual(p.wait(), 0)
+ def _kill_process(self, method, *args):
+ # Some win32 buildbot raises EOFError if stdin is inherited
+ p = subprocess.Popen([sys.executable, "-c", """if 1:
+ import sys, time
+ sys.stdout.write('x\\n')
+ sys.stdout.flush()
+ time.sleep(30)
+ """],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ self.addCleanup(p.stdin.close)
+ # Wait for the interpreter to be completely initialized before
+ # sending any signal.
+ p.stdout.read(1)
+ getattr(p, method)(*args)
+ _, stderr = p.communicate()
+ self.assertStderrEqual(stderr, '')
+ returncode = p.wait()
+ self.assertNotEqual(returncode, 0)
+
+ def test_send_signal(self):
+ self._kill_process('send_signal', signal.SIGTERM)
+
+ def test_kill(self):
+ self._kill_process('kill')
+
+ def test_terminate(self):
+ self._kill_process('terminate')
+
+
+@unittest.skipUnless(getattr(subprocess, '_has_poll', False),
+ "poll system call not supported")
+class ProcessTestCaseNoPoll(ProcessTestCase):
+ def setUp(self):
+ subprocess._has_poll = False
+ ProcessTestCase.setUp(self)
- def DISABLED_test_terminate(self):
- p = subprocess.Popen([sys.executable,
- "-c", "input()"])
+ def tearDown(self):
+ subprocess._has_poll = True
+ ProcessTestCase.tearDown(self)
- self.assert_(p.poll() is None, p.poll())
- p.terminate()
- self.assertNotEqual(p.wait(), 0)
class HelperFunctionTests(unittest.TestCase):
- def _test_eintr_retry_call(self):
+ @unittest.skipIf(mswindows, "errno and EINTR make no sense on windows")
+ def test_eintr_retry_call(self):
record_calls = []
def fake_os_func(*args):
record_calls.append(args)
@@ -781,15 +994,60 @@ class HelperFunctionTests(unittest.TestCase):
subprocess._eintr_retry_call(fake_os_func, 666))
self.assertEqual([(256, 999), (666,), (666,)], record_calls)
- if not mswindows:
- test_eintr_retry_call = _test_eintr_retry_call
+@unittest.skipUnless(mswindows, "mswindows only")
+class CommandsWithSpaces (BaseTestCase):
+
+ def setUp(self):
+ super(CommandsWithSpaces, self).setUp()
+ f, fname = mkstemp(".py", "te st")
+ self.fname = fname.lower ()
+ os.write(f, b"import sys;"
+ b"sys.stdout.write('%d %s' % (len(sys.argv), [a.lower () for a in sys.argv]))"
+ )
+ os.close(f)
+
+ def tearDown(self):
+ os.remove(self.fname)
+ super(CommandsWithSpaces, self).tearDown()
+
+ def with_spaces(self, *args, **kwargs):
+ kwargs['stdout'] = subprocess.PIPE
+ p = subprocess.Popen(*args, **kwargs)
+ self.addCleanup(p.stdout.close)
+ self.assertEqual(
+ p.stdout.read ().decode("mbcs"),
+ "2 [%r, 'ab cd']" % self.fname
+ )
+
+ def test_shell_string_with_spaces(self):
+ # call() function with string argument with spaces on Windows
+ self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
+ "ab cd"), shell=1)
+
+ def test_shell_sequence_with_spaces(self):
+ # call() function with sequence argument with spaces on Windows
+ self.with_spaces([sys.executable, self.fname, "ab cd"], shell=1)
+
+ def test_noshell_string_with_spaces(self):
+ # call() function with string argument with spaces on Windows
+ self.with_spaces('"%s" "%s" "%s"' % (sys.executable, self.fname,
+ "ab cd"))
+
+ def test_noshell_sequence_with_spaces(self):
+ # call() function with sequence argument with spaces on Windows
+ self.with_spaces([sys.executable, self.fname, "ab cd"])
def test_main():
- test_support.run_unittest(ProcessTestCase,
- HelperFunctionTests)
- if hasattr(test_support, "reap_children"):
- test_support.reap_children()
+ unit_tests = (ProcessTestCase,
+ POSIXProcessTestCase,
+ Win32ProcessTestCase,
+ ProcessTestCaseNoPoll,
+ HelperFunctionTests,
+ CommandsWithSpaces)
+
+ test_support.run_unittest(*unit_tests)
+ test_support.reap_children()
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_sunaudiodev.py b/Lib/test/test_sunaudiodev.py
index 2c5e7d4a6e..c96f711819 100644
--- a/Lib/test/test_sunaudiodev.py
+++ b/Lib/test/test_sunaudiodev.py
@@ -1,4 +1,5 @@
-from test.test_support import findfile, TestFailed, TestSkipped, import_module
+from test.test_support import findfile, TestFailed, import_module
+import unittest
sunaudiodev = import_module('sunaudiodev', deprecated=True)
import os
@@ -8,7 +9,7 @@ except KeyError:
audiodev = "/dev/audio"
if not os.path.exists(audiodev):
- raise TestSkipped("no audio device found!")
+ raise unittest.SkipTest("no audio device found!")
def play_sound_file(path):
fp = open(path, 'r')
diff --git a/Lib/test/test_sundry.py b/Lib/test/test_sundry.py
index 9ffd39bbeb..6e2b7971f7 100644
--- a/Lib/test/test_sundry.py
+++ b/Lib/test/test_sundry.py
@@ -22,7 +22,6 @@ class TestUntestedModules(unittest.TestCase):
import distutils.filelist
if sys.platform.startswith('win'):
import distutils.msvccompiler
- import distutils.mwerkscompiler
import distutils.text_file
import distutils.unixccompiler
@@ -66,7 +65,6 @@ class TestUntestedModules(unittest.TestCase):
import pstats
import py_compile
import rexec
- import rlcompleter
import sched
import sndhdr
import statvfs
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index 2212fce991..81bb3ca017 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -5,26 +5,39 @@ if __name__ != 'test.test_support':
import contextlib
import errno
+import functools
+import gc
import socket
import sys
import os
+import platform
import shutil
import warnings
import unittest
+import importlib
+import UserDict
import re
+import time
+try:
+ import thread
+except ImportError:
+ thread = None
-__all__ = ["Error", "TestFailed", "TestSkipped", "ResourceDenied", "import_module",
+__all__ = ["Error", "TestFailed", "ResourceDenied", "import_module",
"verbose", "use_resources", "max_memuse", "record_original_stdout",
"get_original_stdout", "unload", "unlink", "rmtree", "forget",
"is_resource_enabled", "requires", "find_unused_port", "bind_port",
"fcmp", "have_unicode", "is_jython", "TESTFN", "HOST", "FUZZ",
- "findfile", "verify", "vereq", "sortdict", "check_syntax_error",
- "open_urlresource", "check_warnings", "_check_py3k_warnings",
+ "SAVEDCWD", "temp_cwd", "findfile", "sortdict", "check_syntax_error",
+ "open_urlresource", "check_warnings", "check_py3k_warnings",
"CleanImport", "EnvironmentVarGuard", "captured_output",
"captured_stdout", "TransientResource", "transient_internet",
"run_with_locale", "set_memlimit", "bigmemtest", "bigaddrspacetest",
"BasicTestRunner", "run_unittest", "run_doctest", "threading_setup",
- "threading_cleanup", "reap_children"]
+ "threading_cleanup", "reap_children", "cpython_only",
+ "check_impl_detail", "get_attribute", "py3k_bytes",
+ "import_fresh_module"]
+
class Error(Exception):
"""Base class for regression test exceptions."""
@@ -32,37 +45,116 @@ class Error(Exception):
class TestFailed(Error):
"""Test failed."""
-class TestSkipped(Error):
- """Test skipped.
-
- This can be raised to indicate that a test was deliberatly
- skipped, but not because a feature wasn't available. For
- example, if some resource can't be used, such as the network
- appears to be unavailable, this should be raised instead of
- TestFailed.
- """
-
-class ResourceDenied(TestSkipped):
+class ResourceDenied(unittest.SkipTest):
"""Test skipped because it requested a disallowed resource.
This is raised when a test calls requires() for a resource that
- has not be enabled. It is used to distinguish between expected
+ has not been enabled. It is used to distinguish between expected
and unexpected skips.
"""
-def import_module(name, deprecated=False):
- """Import the module to be tested, raising TestSkipped if it is not
- available."""
- with warnings.catch_warnings():
- if deprecated:
+@contextlib.contextmanager
+def _ignore_deprecated_imports(ignore=True):
+ """Context manager to suppress package and module deprecation
+ warnings when importing them.
+
+ If ignore is False, this context manager has no effect."""
+ if ignore:
+ with warnings.catch_warnings():
warnings.filterwarnings("ignore", ".+ (module|package)",
DeprecationWarning)
+ yield
+ else:
+ yield
+
+
+def import_module(name, deprecated=False):
+ """Import and return the module to be tested, raising SkipTest if
+ it is not available.
+
+ If deprecated is True, any module or package deprecation messages
+ will be suppressed."""
+ with _ignore_deprecated_imports(deprecated):
+ try:
+ return importlib.import_module(name)
+ except ImportError, msg:
+ raise unittest.SkipTest(str(msg))
+
+
+def _save_and_remove_module(name, orig_modules):
+ """Helper function to save and remove a module from sys.modules
+
+ Raise ImportError if the module can't be imported."""
+ # try to import the module and raise an error if it can't be imported
+ if name not in sys.modules:
+ __import__(name)
+ del sys.modules[name]
+ for modname in list(sys.modules):
+ if modname == name or modname.startswith(name + '.'):
+ orig_modules[modname] = sys.modules[modname]
+ del sys.modules[modname]
+
+def _save_and_block_module(name, orig_modules):
+ """Helper function to save and block a module in sys.modules
+
+ Return True if the module was in sys.modules, False otherwise."""
+ saved = True
+ try:
+ orig_modules[name] = sys.modules[name]
+ except KeyError:
+ saved = False
+ sys.modules[name] = None
+ return saved
+
+
+def import_fresh_module(name, fresh=(), blocked=(), deprecated=False):
+ """Imports and returns a module, deliberately bypassing the sys.modules cache
+ and importing a fresh copy of the module. Once the import is complete,
+ the sys.modules cache is restored to its original state.
+
+ Modules named in fresh are also imported anew if needed by the import.
+ If one of these modules can't be imported, None is returned.
+
+ Importing of modules named in blocked is prevented while the fresh import
+ takes place.
+
+ If deprecated is True, any module or package deprecation messages
+ will be suppressed."""
+ # NOTE: test_heapq, test_json, and test_warnings include extra sanity
+ # checks to make sure that this utility function is working as expected
+ with _ignore_deprecated_imports(deprecated):
+ # Keep track of modules saved for later restoration as well
+ # as those which just need a blocking entry removed
+ orig_modules = {}
+ names_to_remove = []
+ _save_and_remove_module(name, orig_modules)
try:
- module = __import__(name, level=0)
+ for fresh_name in fresh:
+ _save_and_remove_module(fresh_name, orig_modules)
+ for blocked_name in blocked:
+ if not _save_and_block_module(blocked_name, orig_modules):
+ names_to_remove.append(blocked_name)
+ fresh_module = importlib.import_module(name)
except ImportError:
- raise TestSkipped("No module named " + name)
- else:
- return module
+ fresh_module = None
+ finally:
+ for orig_name, module in orig_modules.items():
+ sys.modules[orig_name] = module
+ for name_to_remove in names_to_remove:
+ del sys.modules[name_to_remove]
+ return fresh_module
+
+
+def get_attribute(obj, name):
+ """Get an attribute, raising SkipTest if AttributeError is raised."""
+ try:
+ attribute = getattr(obj, name)
+ except AttributeError:
+ raise unittest.SkipTest("module %s has no attribute %s" % (
+ obj.__name__, name))
+ else:
+ return attribute
+
verbose = 1 # Flag set to 0 by regrtest.py
use_resources = None # Flag set to [] by regrtest.py
@@ -124,7 +216,7 @@ def requires(resource, msg=None):
possibility of False being returned occurs when regrtest.py is executing."""
# see if the caller's module is __main__ - if so, treat as if
# the resource was set
- if sys._getframe().f_back.f_globals.get("__name__") == "__main__":
+ if sys._getframe(1).f_globals.get("__name__") == "__main__":
return
if not is_resource_enabled(resource):
if msg is None:
@@ -270,55 +362,83 @@ else:
# 2 latin characters.
TESTFN_UNICODE = unicode("@test-\xe0\xf2", "latin-1")
TESTFN_ENCODING = sys.getfilesystemencoding()
- # TESTFN_UNICODE_UNENCODEABLE is a filename that should *not* be
+ # TESTFN_UNENCODABLE is a filename that should *not* be
# able to be encoded by *either* the default or filesystem encoding.
# This test really only makes sense on Windows NT platforms
# which have special Unicode support in posixmodule.
if (not hasattr(sys, "getwindowsversion") or
sys.getwindowsversion()[3] < 2): # 0=win32s or 1=9x/ME
- TESTFN_UNICODE_UNENCODEABLE = None
+ TESTFN_UNENCODABLE = None
else:
# Japanese characters (I think - from bug 846133)
- TESTFN_UNICODE_UNENCODEABLE = eval('u"@test-\u5171\u6709\u3055\u308c\u308b"')
+ TESTFN_UNENCODABLE = eval('u"@test-\u5171\u6709\u3055\u308c\u308b"')
try:
# XXX - Note - should be using TESTFN_ENCODING here - but for
# Windows, "mbcs" currently always operates as if in
# errors=ignore' mode - hence we get '?' characters rather than
# the exception. 'Latin1' operates as we expect - ie, fails.
# See [ 850997 ] mbcs encoding ignores errors
- TESTFN_UNICODE_UNENCODEABLE.encode("Latin1")
+ TESTFN_UNENCODABLE.encode("Latin1")
except UnicodeEncodeError:
pass
else:
print \
'WARNING: The filename %r CAN be encoded by the filesystem. ' \
'Unicode filename tests may not be effective' \
- % TESTFN_UNICODE_UNENCODEABLE
+ % TESTFN_UNENCODABLE
-# Make sure we can write to TESTFN, try in /tmp if we can't
-fp = None
-try:
- fp = open(TESTFN, 'w+')
-except IOError:
- TMP_TESTFN = os.path.join('/tmp', TESTFN)
+
+# Disambiguate TESTFN for parallel testing, while letting it remain a valid
+# module name.
+TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid())
+
+# Save the initial cwd
+SAVEDCWD = os.getcwd()
+
+@contextlib.contextmanager
+def temp_cwd(name='tempcwd', quiet=False):
+ """
+ Context manager that creates a temporary directory and set it as CWD.
+
+ The new CWD is created in the current directory and it's named *name*.
+ If *quiet* is False (default) and it's not possible to create or change
+ the CWD, an error is raised. If it's True, only a warning is raised
+ and the original CWD is used.
+ """
+ if isinstance(name, unicode):
+ try:
+ name = name.encode(sys.getfilesystemencoding() or 'ascii')
+ except UnicodeEncodeError:
+ if not quiet:
+ raise unittest.SkipTest('unable to encode the cwd name with '
+ 'the filesystem encoding.')
+ saved_dir = os.getcwd()
+ is_temporary = False
+ try:
+ os.mkdir(name)
+ os.chdir(name)
+ is_temporary = True
+ except OSError:
+ if not quiet:
+ raise
+ warnings.warn('tests may fail, unable to change the CWD to ' + name,
+ RuntimeWarning, stacklevel=3)
try:
- fp = open(TMP_TESTFN, 'w+')
- TESTFN = TMP_TESTFN
- del TMP_TESTFN
- except IOError:
- print ('WARNING: tests will fail, unable to write to: %s or %s' %
- (TESTFN, TMP_TESTFN))
-if fp is not None:
- fp.close()
- unlink(TESTFN)
-del fp
-
-def findfile(file, here=__file__):
+ yield os.getcwd()
+ finally:
+ os.chdir(saved_dir)
+ if is_temporary:
+ rmtree(name)
+
+
+def findfile(file, here=__file__, subdir=None):
"""Try to find a file on sys.path and the working directory. If it is not
found the argument passed to the function is returned (this does not
necessarily signal failure; could still be the legitimate path)."""
if os.path.isabs(file):
return file
+ if subdir is not None:
+ file = os.path.join(subdir, file)
path = sys.path
path = [os.path.dirname(here)] + path
for dn in path:
@@ -326,30 +446,6 @@ def findfile(file, here=__file__):
if os.path.exists(fn): return fn
return file
-def verify(condition, reason='test failed'):
- """Verify that condition is true. If not, raise TestFailed.
-
- The optional argument reason can be given to provide
- a better error text.
- """
-
- if not condition:
- raise TestFailed(reason)
-
-def vereq(a, b):
- """Raise TestFailed if a == b is false.
-
- This is better than verify(a == b) because, in case of failure, the
- error message incorporates repr(a) and repr(b) so you can see the
- inputs.
-
- Note that "not (a == b)" isn't necessarily the same as "a != b"; the
- former is tested.
- """
-
- if not (a == b):
- raise TestFailed("%r == %r" % (a, b))
-
def sortdict(dict):
"Like repr(dict), but in sorted order."
items = dict.items()
@@ -371,35 +467,49 @@ def make_bad_fd():
unlink(TESTFN)
def check_syntax_error(testcase, statement):
- try:
- compile(statement, '<test string>', 'exec')
- except SyntaxError:
- pass
- else:
- testcase.fail('Missing SyntaxError: "%s"' % statement)
+ testcase.assertRaises(SyntaxError, compile, statement,
+ '<test string>', 'exec')
-def open_urlresource(url):
+def open_urlresource(url, check=None):
import urlparse, urllib2
- requires('urlfetch')
filename = urlparse.urlparse(url)[2].split('/')[-1] # '/': it's URL!
- for path in [os.path.curdir, os.path.pardir]:
- fn = os.path.join(path, filename)
- if os.path.exists(fn):
- return open(fn)
+ fn = os.path.join(os.path.dirname(__file__), "data", filename)
+
+ def check_valid_file(fn):
+ f = open(fn)
+ if check is None:
+ return f
+ elif check(f):
+ f.seek(0)
+ return f
+ f.close()
+
+ if os.path.exists(fn):
+ f = check_valid_file(fn)
+ if f is not None:
+ return f
+ unlink(fn)
+
+ # Verify the requirement before downloading the file
+ requires('urlfetch')
print >> get_original_stdout(), '\tfetching %s ...' % url
f = urllib2.urlopen(url, timeout=15)
try:
- with open(filename, "wb") as out:
+ with open(fn, "wb") as out:
s = f.read()
while s:
out.write(s)
s = f.read()
finally:
f.close()
- return open(filename)
+
+ f = check_valid_file(fn)
+ if f is not None:
+ return f
+ raise TestFailed('invalid resource "%s"' % fn)
class WarningsRecorder(object):
@@ -489,7 +599,7 @@ def check_warnings(*filters, **kwargs):
@contextlib.contextmanager
-def _check_py3k_warnings(*filters, **kwargs):
+def check_py3k_warnings(*filters, **kwargs):
"""Context manager to silence py3k warnings.
Accept 2-tuples as positional arguments:
@@ -500,7 +610,7 @@ def _check_py3k_warnings(*filters, **kwargs):
(default False)
Without argument, it defaults to:
- _check_py3k_warnings(("", DeprecationWarning), quiet=False)
+ check_py3k_warnings(("", DeprecationWarning), quiet=False)
"""
if sys.py3kwarning:
if not filters:
@@ -520,7 +630,7 @@ class CleanImport(object):
Use like this:
with CleanImport("foo"):
- __import__("foo") # new reference
+ importlib.import_module("foo") # new reference
"""
def __init__(self, *module_names):
@@ -543,26 +653,39 @@ class CleanImport(object):
sys.modules.update(self.original_modules)
-class EnvironmentVarGuard(object):
+class EnvironmentVarGuard(UserDict.DictMixin):
"""Class to help protect the environment variable properly. Can be used as
a context manager."""
def __init__(self):
+ self._environ = os.environ
self._changed = {}
- def set(self, envvar, value):
+ def __getitem__(self, envvar):
+ return self._environ[envvar]
+
+ def __setitem__(self, envvar, value):
# Remember the initial value on the first access
if envvar not in self._changed:
- self._changed[envvar] = os.environ.get(envvar)
- os.environ[envvar] = value
+ self._changed[envvar] = self._environ.get(envvar)
+ self._environ[envvar] = value
- def unset(self, envvar):
+ def __delitem__(self, envvar):
# Remember the initial value on the first access
if envvar not in self._changed:
- self._changed[envvar] = os.environ.get(envvar)
- if envvar in os.environ:
- del os.environ[envvar]
+ self._changed[envvar] = self._environ.get(envvar)
+ if envvar in self._environ:
+ del self._environ[envvar]
+
+ def keys(self):
+ return self._environ.keys()
+
+ def set(self, envvar, value):
+ self[envvar] = value
+
+ def unset(self, envvar):
+ del self[envvar]
def __enter__(self):
return self
@@ -570,10 +693,36 @@ class EnvironmentVarGuard(object):
def __exit__(self, *ignore_exc):
for (k, v) in self._changed.items():
if v is None:
- if k in os.environ:
- del os.environ[k]
+ if k in self._environ:
+ del self._environ[k]
else:
- os.environ[k] = v
+ self._environ[k] = v
+ os.environ = self._environ
+
+
+class DirsOnSysPath(object):
+ """Context manager to temporarily add directories to sys.path.
+
+ This makes a copy of sys.path, appends any directories given
+ as positional arguments, then reverts sys.path to the copied
+ settings when the context ends.
+
+ Note that *all* sys.path modifications in the body of the
+ context manager, including replacement of the object,
+ will be reverted at the end of the block.
+ """
+
+ def __init__(self, *paths):
+ self.original_value = sys.path[:]
+ self.original_object = sys.path
+ sys.path.extend(paths)
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, *ignore_exc):
+ sys.path = self.original_object
+ sys.path[:] = self.original_value
class TransientResource(object):
@@ -602,25 +751,71 @@ class TransientResource(object):
raise ResourceDenied("an optional resource is not available")
-def transient_internet():
+@contextlib.contextmanager
+def transient_internet(resource_name, timeout=30.0, errnos=()):
"""Return a context manager that raises ResourceDenied when various issues
with the Internet connection manifest themselves as exceptions."""
- time_out = TransientResource(IOError, errno=errno.ETIMEDOUT)
- socket_peer_reset = TransientResource(socket.error, errno=errno.ECONNRESET)
- ioerror_peer_reset = TransientResource(IOError, errno=errno.ECONNRESET)
- return contextlib.nested(time_out, socket_peer_reset, ioerror_peer_reset)
+ default_errnos = [
+ ('ECONNREFUSED', 111),
+ ('ECONNRESET', 104),
+ ('EHOSTUNREACH', 113),
+ ('ENETUNREACH', 101),
+ ('ETIMEDOUT', 110),
+ ]
+ default_gai_errnos = [
+ ('EAI_NONAME', -2),
+ ('EAI_NODATA', -5),
+ ]
+
+ denied = ResourceDenied("Resource '%s' is not available" % resource_name)
+ captured_errnos = errnos
+ gai_errnos = []
+ if not captured_errnos:
+ captured_errnos = [getattr(errno, name, num)
+ for (name, num) in default_errnos]
+ gai_errnos = [getattr(socket, name, num)
+ for (name, num) in default_gai_errnos]
+
+ def filter_error(err):
+ n = getattr(err, 'errno', None)
+ if (isinstance(err, socket.timeout) or
+ (isinstance(err, socket.gaierror) and n in gai_errnos) or
+ n in captured_errnos):
+ if not verbose:
+ sys.stderr.write(denied.args[0] + "\n")
+ raise denied
+
+ old_timeout = socket.getdefaulttimeout()
+ try:
+ if timeout is not None:
+ socket.setdefaulttimeout(timeout)
+ yield
+ except IOError as err:
+ # urllib can wrap original socket errors multiple times (!), we must
+ # unwrap to get at the original error.
+ while True:
+ a = err.args
+ if len(a) >= 1 and isinstance(a[0], IOError):
+ err = a[0]
+ # The error can also be wrapped as args[1]:
+ # except socket.error as msg:
+ # raise IOError('socket error', msg).with_traceback(sys.exc_info()[2])
+ elif len(a) >= 2 and isinstance(a[1], IOError):
+ err = a[1]
+ else:
+ break
+ filter_error(err)
+ raise
+ # XXX should we catch generic exceptions and look for their
+ # __cause__ or __context__?
+ finally:
+ socket.setdefaulttimeout(old_timeout)
@contextlib.contextmanager
def captured_output(stream_name):
- """Run the 'with' statement body using a StringIO object in place of a
- specific attribute on the sys module.
- Example use (with 'stream_name=stdout')::
-
- with captured_stdout() as s:
- print "hello"
- assert s.getvalue() == "hello"
- """
+ """Return a context manager used by captured_stdout and captured_stdin
+ that temporarily replaces the sys stream *stream_name* with a StringIO."""
import StringIO
orig_stdout = getattr(sys, stream_name)
setattr(sys, stream_name, StringIO.StringIO())
@@ -630,8 +825,33 @@ def captured_output(stream_name):
setattr(sys, stream_name, orig_stdout)
def captured_stdout():
+ """Capture the output of sys.stdout:
+
+ with captured_stdout() as s:
+ print "hello"
+ self.assertEqual(s.getvalue(), "hello")
+ """
return captured_output("stdout")
+def captured_stdin():
+ return captured_output("stdin")
+
+def gc_collect():
+ """Force as many objects as possible to be collected.
+
+ In non-CPython implementations of Python, this is needed because timely
+ deallocation is not guaranteed by the garbage collector. (Even in CPython
+ this can be the case in case of reference cycles.) This means that __del__
+ methods may be called later than expected and weakrefs may remain alive for
+ longer than expected. This function tries its best to force all garbage
+ objects to disappear.
+ """
+ gc.collect()
+ if is_jython:
+ time.sleep(0.1)
+ gc.collect()
+ gc.collect()
+
#=======================================================================
# Decorator for running a function in a different locale, correctly resetting
@@ -723,7 +943,7 @@ def bigmemtest(minsize, memuse, overhead=5*_1M):
# to make sure they work. We still want to avoid using
# too much memory, though, but we do that noisily.
maxsize = 5147
- self.failIf(maxsize * memuse + overhead > 20 * _1M)
+ self.assertFalse(maxsize * memuse + overhead > 20 * _1M)
else:
maxsize = int((max_memuse - overhead) / memuse)
if maxsize < minsize:
@@ -782,6 +1002,55 @@ class BasicTestRunner:
test(result)
return result
+def _id(obj):
+ return obj
+
+def requires_resource(resource):
+ if is_resource_enabled(resource):
+ return _id
+ else:
+ return unittest.skip("resource {0!r} is not enabled".format(resource))
+
+def cpython_only(test):
+ """
+ Decorator for tests only applicable on CPython.
+ """
+ return impl_detail(cpython=True)(test)
+
+def impl_detail(msg=None, **guards):
+ if check_impl_detail(**guards):
+ return _id
+ if msg is None:
+ guardnames, default = _parse_guards(guards)
+ if default:
+ msg = "implementation detail not available on {0}"
+ else:
+ msg = "implementation detail specific to {0}"
+ guardnames = sorted(guardnames.keys())
+ msg = msg.format(' or '.join(guardnames))
+ return unittest.skip(msg)
+
+def _parse_guards(guards):
+ # Returns a tuple ({platform_name: run_me}, default_value)
+ if not guards:
+ return ({'cpython': True}, False)
+ is_true = guards.values()[0]
+ assert guards.values() == [is_true] * len(guards) # all True or all False
+ return (guards, not is_true)
+
+# Use the following check to guard CPython's implementation-specific tests --
+# or to run them only on the implementation(s) guarded by the arguments.
+def check_impl_detail(**guards):
+ """This function returns True or False depending on the host platform.
+ Examples:
+ if check_impl_detail(): # only on CPython (default)
+ if check_impl_detail(jython=True): # only on Jython
+ if check_impl_detail(cpython=False): # everywhere except on CPython
+ """
+ guards, default = _parse_guards(guards)
+ return guards.get(platform.python_implementation().lower(), default)
+
+
def _run_suite(suite):
"""Run tests from a unittest.TestSuite-derived class."""
@@ -855,24 +1124,48 @@ def run_doctest(module, verbosity=None):
#=======================================================================
# Threading support to prevent reporting refleaks when running regrtest.py -R
+# NOTE: we use thread._count() rather than threading.enumerate() (or the
+# moral equivalent thereof) because a threading.Thread object is still alive
+# until its __bootstrap() method has returned, even after it has been
+# unregistered from the threading module.
+# thread._count(), on the other hand, only gets decremented *after* the
+# __bootstrap() method has returned, which gives us reliable reference counts
+# at the end of a test run.
+
def threading_setup():
- import threading
- return len(threading._active), len(threading._limbo)
+ if thread:
+ return thread._count(),
+ else:
+ return 1,
-def threading_cleanup(num_active, num_limbo):
- import threading
- import time
+def threading_cleanup(nb_threads):
+ if not thread:
+ return
_MAX_COUNT = 10
- count = 0
- while len(threading._active) != num_active and count < _MAX_COUNT:
- count += 1
+ for count in range(_MAX_COUNT):
+ n = thread._count()
+ if n == nb_threads:
+ break
time.sleep(0.1)
+ # XXX print a warning in case of failure?
- count = 0
- while len(threading._limbo) != num_limbo and count < _MAX_COUNT:
- count += 1
- time.sleep(0.1)
+def reap_threads(func):
+ """Use this function when threads are being used. This will
+ ensure that the threads are cleaned up even when the test fails.
+ If threading is unavailable this function does nothing.
+ """
+ if not thread:
+ return func
+
+ @functools.wraps(func)
+ def decorator(*args):
+ key = threading_setup()
+ try:
+ return func(*args)
+ finally:
+ threading_cleanup(*key)
+ return decorator
def reap_children():
"""Use this function at the end of test_main() whenever sub-processes
@@ -893,3 +1186,48 @@ def reap_children():
break
except:
break
+
+def py3k_bytes(b):
+ """Emulate the py3k bytes() constructor.
+
+ NOTE: This is only a best effort function.
+ """
+ try:
+ # memoryview?
+ return b.tobytes()
+ except AttributeError:
+ try:
+ # iterable of ints?
+ return b"".join(chr(x) for x in b)
+ except TypeError:
+ return bytes(b)
+
+def args_from_interpreter_flags():
+ """Return a list of command-line arguments reproducing the current
+ settings in sys.flags."""
+ flag_opt_map = {
+ 'bytes_warning': 'b',
+ 'dont_write_bytecode': 'B',
+ 'ignore_environment': 'E',
+ 'no_user_site': 's',
+ 'no_site': 'S',
+ 'optimize': 'O',
+ 'py3k_warning': '3',
+ 'verbose': 'v',
+ }
+ args = []
+ for flag, opt in flag_opt_map.items():
+ v = getattr(sys.flags, flag)
+ if v > 0:
+ args.append('-' + opt * v)
+ return args
+
+def strip_python_stderr(stderr):
+ """Strip the stderr of a Python process from potential debug output
+ emitted by the interpreter.
+
+ This will typically be run on the result of the communicate() method
+ of a subprocess.Popen object.
+ """
+ stderr = re.sub(br"\[\d+ refs\]\r?\n?$", b"", stderr).strip()
+ return stderr
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index 0b4190d2d5..71994ad227 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -3,7 +3,6 @@ Test the API of the symtable module.
"""
import symtable
import unittest
-import warnings
from test import test_support
@@ -54,22 +53,6 @@ class SymtableTest(unittest.TestCase):
internal = find_block(spam, "internal")
foo = find_block(top, "foo")
- def test_noops(self):
- # Check methods that don't work. They should warn and return False.
- def check(w, msg):
- self.assertEqual(str(w.message), msg)
- sym = self.top.lookup("glob")
- with test_support.check_warnings() as w:
- warnings.simplefilter("always", DeprecationWarning)
- self.assertFalse(sym.is_vararg())
- check(w, "is_vararg() is obsolete and will be removed")
- w.reset()
- self.assertFalse(sym.is_keywordarg())
- check(w, "is_keywordarg() is obsolete and will be removed")
- w.reset()
- self.assertFalse(sym.is_in_tuple())
- check(w, "is_in_tuple() is obsolete and will be removed")
-
def test_type(self):
self.assertEqual(self.top.get_type(), "module")
self.assertEqual(self.Mine.get_type(), "class")
@@ -107,7 +90,7 @@ class SymtableTest(unittest.TestCase):
func = self.spam
self.assertEqual(func.get_parameters(), ("a", "b", "kw", "var"))
self.assertEqual(func.get_locals(),
- ("a", "b", "bar", "internal", "kw", "var", "x"))
+ ("a", "b", "internal", "kw", "var", "x"))
self.assertEqual(func.get_globals(), ("bar", "glob"))
self.assertEqual(self.internal.get_frees(), ("x",))
@@ -147,7 +130,7 @@ class SymtableTest(unittest.TestCase):
self.assertTrue(self.top.lookup("namespace_test").is_namespace())
self.assertFalse(self.spam.lookup("x").is_namespace())
- self.assert_(self.top.lookup("spam").get_namespace() is self.spam)
+ self.assertTrue(self.top.lookup("spam").get_namespace() is self.spam)
ns_test = self.top.lookup("namespace_test")
self.assertEqual(len(ns_test.get_namespaces()), 2)
self.assertRaises(ValueError, ns_test.get_namespace)
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index 2c27bf1e52..7994fe67e7 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -27,15 +27,15 @@ In ast.c, syntax errors are raised by calling ast_error().
Errors from set_context():
-TODO(jhylton): "assignment to None" is inconsistent with other messages
-
>>> obj.None = 1
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[1]>, line 1)
+ File "<doctest test.test_syntax[1]>", line 1
+SyntaxError: cannot assign to None
>>> None = 1
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[2]>, line 1)
+ File "<doctest test.test_syntax[2]>", line 1
+SyntaxError: cannot assign to None
It's a syntax error to assign to the empty tuple. Why isn't it an
error to assign to the empty list? It will always raise some error at
@@ -43,35 +43,43 @@ runtime.
>>> () = 1
Traceback (most recent call last):
-SyntaxError: can't assign to () (<doctest test.test_syntax[3]>, line 1)
+ File "<doctest test.test_syntax[3]>", line 1
+SyntaxError: can't assign to ()
>>> f() = 1
Traceback (most recent call last):
-SyntaxError: can't assign to function call (<doctest test.test_syntax[4]>, line 1)
+ File "<doctest test.test_syntax[4]>", line 1
+SyntaxError: can't assign to function call
>>> del f()
Traceback (most recent call last):
-SyntaxError: can't delete function call (<doctest test.test_syntax[5]>, line 1)
+ File "<doctest test.test_syntax[5]>", line 1
+SyntaxError: can't delete function call
>>> a + 1 = 2
Traceback (most recent call last):
-SyntaxError: can't assign to operator (<doctest test.test_syntax[6]>, line 1)
+ File "<doctest test.test_syntax[6]>", line 1
+SyntaxError: can't assign to operator
>>> (x for x in x) = 1
Traceback (most recent call last):
-SyntaxError: can't assign to generator expression (<doctest test.test_syntax[7]>, line 1)
+ File "<doctest test.test_syntax[7]>", line 1
+SyntaxError: can't assign to generator expression
>>> 1 = 1
Traceback (most recent call last):
-SyntaxError: can't assign to literal (<doctest test.test_syntax[8]>, line 1)
+ File "<doctest test.test_syntax[8]>", line 1
+SyntaxError: can't assign to literal
>>> "abc" = 1
Traceback (most recent call last):
-SyntaxError: can't assign to literal (<doctest test.test_syntax[9]>, line 1)
+ File "<doctest test.test_syntax[8]>", line 1
+SyntaxError: can't assign to literal
>>> `1` = 1
Traceback (most recent call last):
-SyntaxError: can't assign to repr (<doctest test.test_syntax[10]>, line 1)
+ File "<doctest test.test_syntax[10]>", line 1
+SyntaxError: can't assign to repr
If the left-hand side of an assignment is a list or tuple, an illegal
expression inside that contain should still cause a syntax error.
@@ -80,22 +88,26 @@ them.
>>> (a, "b", c) = (1, 2, 3)
Traceback (most recent call last):
-SyntaxError: can't assign to literal (<doctest test.test_syntax[11]>, line 1)
+ File "<doctest test.test_syntax[11]>", line 1
+SyntaxError: can't assign to literal
>>> [a, b, c + 1] = [1, 2, 3]
Traceback (most recent call last):
-SyntaxError: can't assign to operator (<doctest test.test_syntax[12]>, line 1)
+ File "<doctest test.test_syntax[12]>", line 1
+SyntaxError: can't assign to operator
>>> a if 1 else b = 1
Traceback (most recent call last):
-SyntaxError: can't assign to conditional expression (<doctest test.test_syntax[13]>, line 1)
+ File "<doctest test.test_syntax[13]>", line 1
+SyntaxError: can't assign to conditional expression
From compiler_complex_args():
>>> def f(None=1):
... pass
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[14]>, line 1)
+ File "<doctest test.test_syntax[14]>", line 1
+SyntaxError: cannot assign to None
From ast_for_arguments():
@@ -103,22 +115,26 @@ From ast_for_arguments():
>>> def f(x, y=1, z):
... pass
Traceback (most recent call last):
-SyntaxError: non-default argument follows default argument (<doctest test.test_syntax[15]>, line 1)
+ File "<doctest test.test_syntax[15]>", line 1
+SyntaxError: non-default argument follows default argument
>>> def f(x, None):
... pass
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[16]>, line 1)
+ File "<doctest test.test_syntax[16]>", line 1
+SyntaxError: cannot assign to None
>>> def f(*None):
... pass
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[17]>, line 1)
+ File "<doctest test.test_syntax[17]>", line 1
+SyntaxError: cannot assign to None
>>> def f(**None):
... pass
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[18]>, line 1)
+ File "<doctest test.test_syntax[18]>", line 1
+SyntaxError: cannot assign to None
From ast_for_funcdef():
@@ -126,7 +142,8 @@ From ast_for_funcdef():
>>> def None(x):
... pass
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[19]>, line 1)
+ File "<doctest test.test_syntax[19]>", line 1
+SyntaxError: cannot assign to None
From ast_for_call():
@@ -138,7 +155,8 @@ From ast_for_call():
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> f(x for x in L, 1)
Traceback (most recent call last):
-SyntaxError: Generator expression must be parenthesized if not sole argument (<doctest test.test_syntax[23]>, line 1)
+ File "<doctest test.test_syntax[23]>", line 1
+SyntaxError: Generator expression must be parenthesized if not sole argument
>>> f((x for x in L), 1)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
@@ -170,7 +188,8 @@ SyntaxError: Generator expression must be parenthesized if not sole argument (<d
... i244, i245, i246, i247, i248, i249, i250, i251, i252,
... i253, i254, i255)
Traceback (most recent call last):
-SyntaxError: more than 255 arguments (<doctest test.test_syntax[25]>, line 1)
+ File "<doctest test.test_syntax[25]>", line 1
+SyntaxError: more than 255 arguments
The actual error cases counts positional arguments, keyword arguments,
and generator expression arguments separately. This test combines the
@@ -204,42 +223,50 @@ three.
... (x for x in i244), i245, i246, i247, i248, i249, i250, i251,
... i252=1, i253=1, i254=1, i255=1)
Traceback (most recent call last):
-SyntaxError: more than 255 arguments (<doctest test.test_syntax[26]>, line 1)
+ File "<doctest test.test_syntax[26]>", line 1
+SyntaxError: more than 255 arguments
>>> f(lambda x: x[0] = 3)
Traceback (most recent call last):
-SyntaxError: lambda cannot contain assignment (<doctest test.test_syntax[27]>, line 1)
+ File "<doctest test.test_syntax[27]>", line 1
+SyntaxError: lambda cannot contain assignment
The grammar accepts any test (basically, any expression) in the
keyword slot of a call site. Test a few different options.
>>> f(x()=2)
Traceback (most recent call last):
-SyntaxError: keyword can't be an expression (<doctest test.test_syntax[28]>, line 1)
+ File "<doctest test.test_syntax[28]>", line 1
+SyntaxError: keyword can't be an expression
>>> f(a or b=1)
Traceback (most recent call last):
-SyntaxError: keyword can't be an expression (<doctest test.test_syntax[29]>, line 1)
+ File "<doctest test.test_syntax[29]>", line 1
+SyntaxError: keyword can't be an expression
>>> f(x.y=1)
Traceback (most recent call last):
-SyntaxError: keyword can't be an expression (<doctest test.test_syntax[30]>, line 1)
+ File "<doctest test.test_syntax[30]>", line 1
+SyntaxError: keyword can't be an expression
-From ast_for_expr_stmt():
+More set_context():
>>> (x for x in x) += 1
Traceback (most recent call last):
-SyntaxError: augmented assignment to generator expression not possible (<doctest test.test_syntax[31]>, line 1)
+ File "<doctest test.test_syntax[31]>", line 1
+SyntaxError: can't assign to generator expression
>>> None += 1
Traceback (most recent call last):
-SyntaxError: assignment to None (<doctest test.test_syntax[32]>, line 1)
+ File "<doctest test.test_syntax[32]>", line 1
+SyntaxError: cannot assign to None
>>> f() += 1
Traceback (most recent call last):
-SyntaxError: illegal expression for augmented assignment (<doctest test.test_syntax[33]>, line 1)
+ File "<doctest test.test_syntax[33]>", line 1
+SyntaxError: can't assign to function call
Test continue in finally in weird combinations.
-continue in for loop under finally shouuld be ok.
+continue in for loop under finally should be ok.
>>> def test():
... try:
@@ -261,7 +288,8 @@ Start simple, a continue in a finally should not be allowed.
... continue
Traceback (most recent call last):
...
- SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[36]>, line 6)
+ File "<doctest test.test_syntax[36]>", line 6
+ SyntaxError: 'continue' not supported inside 'finally' clause
This is essentially a continue in a finally which should not be allowed.
@@ -276,7 +304,8 @@ This is essentially a continue in a finally which should not be allowed.
... pass
Traceback (most recent call last):
...
- SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[37]>, line 7)
+ File "<doctest test.test_syntax[37]>", line 6
+ SyntaxError: 'continue' not supported inside 'finally' clause
>>> def foo():
... try:
@@ -285,7 +314,8 @@ This is essentially a continue in a finally which should not be allowed.
... continue
Traceback (most recent call last):
...
- SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[38]>, line 5)
+ File "<doctest test.test_syntax[38]>", line 5
+ SyntaxError: 'continue' not supported inside 'finally' clause
>>> def foo():
... for a in ():
@@ -295,7 +325,8 @@ This is essentially a continue in a finally which should not be allowed.
... continue
Traceback (most recent call last):
...
- SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[39]>, line 6)
+ File "<doctest test.test_syntax[39]>", line 6
+ SyntaxError: 'continue' not supported inside 'finally' clause
>>> def foo():
... for a in ():
@@ -308,7 +339,8 @@ This is essentially a continue in a finally which should not be allowed.
... pass
Traceback (most recent call last):
...
- SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[40]>, line 7)
+ File "<doctest test.test_syntax[40]>", line 7
+ SyntaxError: 'continue' not supported inside 'finally' clause
>>> def foo():
... for a in ():
@@ -320,7 +352,8 @@ This is essentially a continue in a finally which should not be allowed.
... continue
Traceback (most recent call last):
...
- SyntaxError: 'continue' not supported inside 'finally' clause (<doctest test.test_syntax[41]>, line 8)
+ File "<doctest test.test_syntax[41]>", line 8
+ SyntaxError: 'continue' not supported inside 'finally' clause
There is one test for a break that is not in a loop. The compiler
uses a single data structure to keep track of try-finally and loops,
@@ -335,7 +368,8 @@ isn't, there should be a syntax error.
... print 3
Traceback (most recent call last):
...
- SyntaxError: 'break' outside loop (<doctest test.test_syntax[42]>, line 3)
+ File "<doctest test.test_syntax[42]>", line 3
+ SyntaxError: 'break' outside loop
This should probably raise a better error than a SystemError (or none at all).
In 2.5 there was a missing exception and an assert was triggered in a debug
@@ -377,7 +411,8 @@ leading to spurious errors.
... pass
Traceback (most recent call last):
...
- SyntaxError: can't assign to function call (<doctest test.test_syntax[44]>, line 2)
+ File "<doctest test.test_syntax[44]>", line 2
+ SyntaxError: can't assign to function call
>>> if 1:
... pass
@@ -385,7 +420,8 @@ leading to spurious errors.
... x() = 1
Traceback (most recent call last):
...
- SyntaxError: can't assign to function call (<doctest test.test_syntax[45]>, line 4)
+ File "<doctest test.test_syntax[45]>", line 4
+ SyntaxError: can't assign to function call
>>> if 1:
... x() = 1
@@ -395,7 +431,8 @@ leading to spurious errors.
... pass
Traceback (most recent call last):
...
- SyntaxError: can't assign to function call (<doctest test.test_syntax[46]>, line 2)
+ File "<doctest test.test_syntax[46]>", line 2
+ SyntaxError: can't assign to function call
>>> if 1:
... pass
@@ -405,7 +442,8 @@ leading to spurious errors.
... pass
Traceback (most recent call last):
...
- SyntaxError: can't assign to function call (<doctest test.test_syntax[47]>, line 4)
+ File "<doctest test.test_syntax[47]>", line 4
+ SyntaxError: can't assign to function call
>>> if 1:
... pass
@@ -415,12 +453,32 @@ leading to spurious errors.
... x() = 1
Traceback (most recent call last):
...
- SyntaxError: can't assign to function call (<doctest test.test_syntax[48]>, line 6)
+ File "<doctest test.test_syntax[48]>", line 6
+ SyntaxError: can't assign to function call
>>> f(a=23, a=234)
Traceback (most recent call last):
...
-SyntaxError: keyword argument repeated (<doctest test.test_syntax[49]>, line 1)
+ File "<doctest test.test_syntax[49]>", line 1
+SyntaxError: keyword argument repeated
+
+>>> del ()
+Traceback (most recent call last):
+ ...
+ File "<doctest test.test_syntax[50]>", line 1
+SyntaxError: can't delete ()
+
+>>> {1, 2, 3} = 42
+Traceback (most recent call last):
+ ...
+ File "<doctest test.test_syntax[50]>", line 1
+SyntaxError: can't assign to literal
+
+Corner-case that used to crash:
+
+ >>> def f(*xx, **__debug__): pass
+ Traceback (most recent call last):
+ SyntaxError: cannot assign to __debug__
"""
@@ -506,7 +564,7 @@ class SyntaxTestCase(unittest.TestCase):
def test_main():
test_support.run_unittest(SyntaxTestCase)
from test import test_syntax
- with test_support._check_py3k_warnings(("backquote not supported",
+ with test_support.check_py3k_warnings(("backquote not supported",
SyntaxWarning)):
test_support.run_doctest(test_syntax, verbosity=True)
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index fd6fb2bda1..49f5388291 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -1,10 +1,14 @@
# -*- coding: iso-8859-1 -*-
import unittest, test.test_support
-import sys, cStringIO, os
+import sys, os, cStringIO
import struct
+import operator
class SysModuleTest(unittest.TestCase):
+ def tearDown(self):
+ test.test_support.reap_children()
+
def test_original_displayhook(self):
import __builtin__
savestdout = sys.stdout
@@ -19,7 +23,7 @@ class SysModuleTest(unittest.TestCase):
dh(None)
self.assertEqual(out.getvalue(), "")
- self.assert_(not hasattr(__builtin__, "_"))
+ self.assertTrue(not hasattr(__builtin__, "_"))
dh(42)
self.assertEqual(out.getvalue(), "42\n")
self.assertEqual(__builtin__._, 42)
@@ -59,7 +63,7 @@ class SysModuleTest(unittest.TestCase):
eh(*sys.exc_info())
sys.stderr = savestderr
- self.assert_(err.getvalue().endswith("ValueError: 42\n"))
+ self.assertTrue(err.getvalue().endswith("ValueError: 42\n"))
# FIXME: testing the code for a lost or replaced excepthook in
# Python/pythonrun.c::PyErr_PrintEx() is tricky.
@@ -71,17 +75,17 @@ class SysModuleTest(unittest.TestCase):
# check that it worked.
def clear_check(exc):
typ, value, traceback = sys.exc_info()
- self.assert_(typ is not None)
- self.assert_(value is exc)
- self.assert_(traceback is not None)
+ self.assertTrue(typ is not None)
+ self.assertTrue(value is exc)
+ self.assertTrue(traceback is not None)
- with test.test_support._check_py3k_warnings():
+ with test.test_support.check_py3k_warnings():
sys.exc_clear()
typ, value, traceback = sys.exc_info()
- self.assert_(typ is None)
- self.assert_(value is None)
- self.assert_(traceback is None)
+ self.assertTrue(typ is None)
+ self.assertTrue(value is None)
+ self.assertTrue(traceback is None)
def clear():
try:
@@ -101,10 +105,10 @@ class SysModuleTest(unittest.TestCase):
clear()
typ2, value2, traceback2 = sys.exc_info()
- self.assert_(typ1 is typ2)
- self.assert_(value1 is exc)
- self.assert_(value1 is value2)
- self.assert_(traceback1 is traceback2)
+ self.assertTrue(typ1 is typ2)
+ self.assertTrue(value1 is exc)
+ self.assertTrue(value1 is value2)
+ self.assertTrue(traceback1 is traceback2)
# Check that an exception can be cleared outside of an except block
clear_check(exc)
@@ -116,7 +120,7 @@ class SysModuleTest(unittest.TestCase):
try:
sys.exit(0)
except SystemExit, exc:
- self.assertEquals(exc.code, 0)
+ self.assertEqual(exc.code, 0)
except:
self.fail("wrong exception")
else:
@@ -127,7 +131,7 @@ class SysModuleTest(unittest.TestCase):
try:
sys.exit(42)
except SystemExit, exc:
- self.assertEquals(exc.code, 42)
+ self.assertEqual(exc.code, 42)
except:
self.fail("wrong exception")
else:
@@ -137,7 +141,7 @@ class SysModuleTest(unittest.TestCase):
try:
sys.exit((42,))
except SystemExit, exc:
- self.assertEquals(exc.code, 42)
+ self.assertEqual(exc.code, 42)
except:
self.fail("wrong exception")
else:
@@ -147,7 +151,7 @@ class SysModuleTest(unittest.TestCase):
try:
sys.exit("exit")
except SystemExit, exc:
- self.assertEquals(exc.code, "exit")
+ self.assertEqual(exc.code, "exit")
except:
self.fail("wrong exception")
else:
@@ -157,7 +161,7 @@ class SysModuleTest(unittest.TestCase):
try:
sys.exit((17, 23))
except SystemExit, exc:
- self.assertEquals(exc.code, (17, 23))
+ self.assertEqual(exc.code, (17, 23))
except:
self.fail("wrong exception")
else:
@@ -199,17 +203,17 @@ class SysModuleTest(unittest.TestCase):
if test.test_support.have_unicode:
self.assertRaises(TypeError, sys.getdefaultencoding, 42)
# can't check more than the type, as the user might have changed it
- self.assert_(isinstance(sys.getdefaultencoding(), str))
+ self.assertIsInstance(sys.getdefaultencoding(), str)
- # testing sys.settrace() is done in test_trace.py
- # testing sys.setprofile() is done in test_profile.py
+ # testing sys.settrace() is done in test_sys_settrace.py
+ # testing sys.setprofile() is done in test_sys_setprofile.py
def test_setcheckinterval(self):
self.assertRaises(TypeError, sys.setcheckinterval)
orig = sys.getcheckinterval()
for n in 0, 100, 120, orig: # orig last to restore starting state
sys.setcheckinterval(n)
- self.assertEquals(sys.getcheckinterval(), n)
+ self.assertEqual(sys.getcheckinterval(), n)
def test_recursionlimit(self):
self.assertRaises(TypeError, sys.getrecursionlimit, 42)
@@ -221,19 +225,38 @@ class SysModuleTest(unittest.TestCase):
sys.setrecursionlimit(oldlimit)
def test_getwindowsversion(self):
- if hasattr(sys, "getwindowsversion"):
- v = sys.getwindowsversion()
- self.assert_(isinstance(v, tuple))
- self.assertEqual(len(v), 5)
- self.assert_(isinstance(v[0], int))
- self.assert_(isinstance(v[1], int))
- self.assert_(isinstance(v[2], int))
- self.assert_(isinstance(v[3], int))
- self.assert_(isinstance(v[4], str))
+ # Raise SkipTest if sys doesn't have getwindowsversion attribute
+ test.test_support.get_attribute(sys, "getwindowsversion")
+ v = sys.getwindowsversion()
+ self.assertEqual(len(v), 5)
+ self.assertIsInstance(v[0], int)
+ self.assertIsInstance(v[1], int)
+ self.assertIsInstance(v[2], int)
+ self.assertIsInstance(v[3], int)
+ self.assertIsInstance(v[4], str)
+ self.assertRaises(IndexError, operator.getitem, v, 5)
+ self.assertIsInstance(v.major, int)
+ self.assertIsInstance(v.minor, int)
+ self.assertIsInstance(v.build, int)
+ self.assertIsInstance(v.platform, int)
+ self.assertIsInstance(v.service_pack, str)
+ self.assertIsInstance(v.service_pack_minor, int)
+ self.assertIsInstance(v.service_pack_major, int)
+ self.assertIsInstance(v.suite_mask, int)
+ self.assertIsInstance(v.product_type, int)
+ self.assertEqual(v[0], v.major)
+ self.assertEqual(v[1], v.minor)
+ self.assertEqual(v[2], v.build)
+ self.assertEqual(v[3], v.platform)
+ self.assertEqual(v[4], v.service_pack)
+
+ # This is how platform.py calls it. Make sure tuple
+ # still has 5 elements
+ maj, min, buildno, plat, csd = sys.getwindowsversion()
def test_dlopenflags(self):
if hasattr(sys, "setdlopenflags"):
- self.assert_(hasattr(sys, "getdlopenflags"))
+ self.assertTrue(hasattr(sys, "getdlopenflags"))
self.assertRaises(TypeError, sys.getdlopenflags, 42)
oldflags = sys.getdlopenflags()
self.assertRaises(TypeError, sys.setdlopenflags)
@@ -254,12 +277,12 @@ class SysModuleTest(unittest.TestCase):
del n
self.assertEqual(sys.getrefcount(None), c)
if hasattr(sys, "gettotalrefcount"):
- self.assert_(isinstance(sys.gettotalrefcount(), int))
+ self.assertIsInstance(sys.gettotalrefcount(), int)
def test_getframe(self):
self.assertRaises(TypeError, sys._getframe, 42, 42)
self.assertRaises(ValueError, sys._getframe, 2000000000)
- self.assert_(
+ self.assertTrue(
SysModuleTest.test_getframe.im_func.func_code \
is sys._getframe().f_code
)
@@ -278,6 +301,7 @@ class SysModuleTest(unittest.TestCase):
self.current_frames_without_threads()
# Test sys._current_frames() in a WITH_THREADS build.
+ @test.test_support.reap_threads
def current_frames_with_threads(self):
import threading, thread
import traceback
@@ -310,12 +334,12 @@ class SysModuleTest(unittest.TestCase):
d = sys._current_frames()
main_id = thread.get_ident()
- self.assert_(main_id in d)
- self.assert_(thread_id in d)
+ self.assertIn(main_id, d)
+ self.assertIn(thread_id, d)
# Verify that the captured main-thread frame is _this_ frame.
frame = d.pop(main_id)
- self.assert_(frame is sys._getframe())
+ self.assertTrue(frame is sys._getframe())
# Verify that the captured thread frame is blocked in g456, called
# from f123. This is a litte tricky, since various bits of
@@ -333,7 +357,7 @@ class SysModuleTest(unittest.TestCase):
# And the next record must be for g456().
filename, lineno, funcname, sourceline = stack[i+1]
self.assertEqual(funcname, "g456")
- self.assert_(sourceline in ["leave_g.wait()", "entered_g.set()"])
+ self.assertIn(sourceline, ["leave_g.wait()", "entered_g.set()"])
# Reap the spawned thread.
leave_g.set()
@@ -345,56 +369,74 @@ class SysModuleTest(unittest.TestCase):
# "thread id" 0.
d = sys._current_frames()
self.assertEqual(len(d), 1)
- self.assert_(0 in d)
- self.assert_(d[0] is sys._getframe())
+ self.assertIn(0, d)
+ self.assertTrue(d[0] is sys._getframe())
def test_attributes(self):
- self.assert_(isinstance(sys.api_version, int))
- self.assert_(isinstance(sys.argv, list))
- self.assert_(sys.byteorder in ("little", "big"))
- self.assert_(isinstance(sys.builtin_module_names, tuple))
- self.assert_(isinstance(sys.copyright, basestring))
- self.assert_(isinstance(sys.exec_prefix, basestring))
- self.assert_(isinstance(sys.executable, basestring))
+ self.assertIsInstance(sys.api_version, int)
+ self.assertIsInstance(sys.argv, list)
+ self.assertIn(sys.byteorder, ("little", "big"))
+ self.assertIsInstance(sys.builtin_module_names, tuple)
+ self.assertIsInstance(sys.copyright, basestring)
+ self.assertIsInstance(sys.exec_prefix, basestring)
+ self.assertIsInstance(sys.executable, basestring)
self.assertEqual(len(sys.float_info), 11)
self.assertEqual(sys.float_info.radix, 2)
- self.assert_(isinstance(sys.hexversion, int))
- self.assert_(isinstance(sys.maxint, int))
+ self.assertEqual(len(sys.long_info), 2)
+ self.assertTrue(sys.long_info.bits_per_digit % 5 == 0)
+ self.assertTrue(sys.long_info.sizeof_digit >= 1)
+ self.assertEqual(type(sys.long_info.bits_per_digit), int)
+ self.assertEqual(type(sys.long_info.sizeof_digit), int)
+ self.assertIsInstance(sys.hexversion, int)
+ self.assertIsInstance(sys.maxint, int)
if test.test_support.have_unicode:
- self.assert_(isinstance(sys.maxunicode, int))
- self.assert_(isinstance(sys.platform, basestring))
- self.assert_(isinstance(sys.prefix, basestring))
- self.assert_(isinstance(sys.version, basestring))
+ self.assertIsInstance(sys.maxunicode, int)
+ self.assertIsInstance(sys.platform, basestring)
+ self.assertIsInstance(sys.prefix, basestring)
+ self.assertIsInstance(sys.version, basestring)
vi = sys.version_info
- self.assert_(isinstance(vi, tuple))
+ self.assertIsInstance(vi[:], tuple)
self.assertEqual(len(vi), 5)
- self.assert_(isinstance(vi[0], int))
- self.assert_(isinstance(vi[1], int))
- self.assert_(isinstance(vi[2], int))
- self.assert_(vi[3] in ("alpha", "beta", "candidate", "final"))
- self.assert_(isinstance(vi[4], int))
+ self.assertIsInstance(vi[0], int)
+ self.assertIsInstance(vi[1], int)
+ self.assertIsInstance(vi[2], int)
+ self.assertIn(vi[3], ("alpha", "beta", "candidate", "final"))
+ self.assertIsInstance(vi[4], int)
+ self.assertIsInstance(vi.major, int)
+ self.assertIsInstance(vi.minor, int)
+ self.assertIsInstance(vi.micro, int)
+ self.assertIn(vi.releaselevel, ("alpha", "beta", "candidate", "final"))
+ self.assertIsInstance(vi.serial, int)
+ self.assertEqual(vi[0], vi.major)
+ self.assertEqual(vi[1], vi.minor)
+ self.assertEqual(vi[2], vi.micro)
+ self.assertEqual(vi[3], vi.releaselevel)
+ self.assertEqual(vi[4], vi.serial)
+ self.assertTrue(vi > (1,0,0))
+ self.assertIsInstance(sys.float_repr_style, str)
+ self.assertIn(sys.float_repr_style, ('short', 'legacy'))
def test_43581(self):
# Can't use sys.stdout, as this is a cStringIO object when
# the test runs under regrtest.
- self.assert_(sys.__stdout__.encoding == sys.__stderr__.encoding)
+ self.assertTrue(sys.__stdout__.encoding == sys.__stderr__.encoding)
def test_sys_flags(self):
- self.failUnless(sys.flags)
+ self.assertTrue(sys.flags)
attrs = ("debug", "py3k_warning", "division_warning", "division_new",
"inspect", "interactive", "optimize", "dont_write_bytecode",
"no_site", "ignore_environment", "tabcheck", "verbose",
"unicode", "bytes_warning")
for attr in attrs:
- self.assert_(hasattr(sys.flags, attr), attr)
+ self.assertTrue(hasattr(sys.flags, attr), attr)
self.assertEqual(type(getattr(sys.flags, attr)), int, attr)
- self.assert_(repr(sys.flags))
+ self.assertTrue(repr(sys.flags))
def test_clear_type_cache(self):
sys._clear_type_cache()
def test_ioencoding(self):
- import subprocess,os
+ import subprocess
env = dict(os.environ)
# Test character: cent sign, encoded as 0x4A (ASCII J) in CP424,
@@ -403,13 +445,13 @@ class SysModuleTest(unittest.TestCase):
env["PYTHONIOENCODING"] = "cp424"
p = subprocess.Popen([sys.executable, "-c", 'print unichr(0xa2)'],
stdout = subprocess.PIPE, env=env)
- out = p.stdout.read().strip()
+ out = p.communicate()[0].strip()
self.assertEqual(out, unichr(0xa2).encode("cp424"))
env["PYTHONIOENCODING"] = "ascii:replace"
p = subprocess.Popen([sys.executable, "-c", 'print unichr(0xa2)'],
stdout = subprocess.PIPE, env=env)
- out = p.stdout.read().strip()
+ out = p.communicate()[0].strip()
self.assertEqual(out, '?')
def test_call_tracing(self):
@@ -429,7 +471,7 @@ class SysModuleTest(unittest.TestCase):
executable=sys.executable, stdout=subprocess.PIPE, cwd=python_dir)
executable = p.communicate()[0].strip()
p.wait()
- self.assert_(executable in ["''", repr(sys.executable)], executable)
+ self.assertIn(executable, ["''", repr(sys.executable)])
class SizeofTest(unittest.TestCase):
@@ -449,6 +491,7 @@ class SizeofTest(unittest.TestCase):
if hasattr(sys, "gettotalrefcount"):
self.header += '2P'
self.vheader += '2P'
+ self.longdigit = sys.long_info.sizeof_digit
import _testcapi
self.gc_headsize = _testcapi.SIZEOF_PYGC_HEAD
self.file = open(test.test_support.TESTFN, 'wb')
@@ -499,7 +542,7 @@ class SizeofTest(unittest.TestCase):
# bool
check(True, size(h + 'l'))
# buffer
- with test.test_support._check_py3k_warnings():
+ with test.test_support.check_py3k_warnings():
check(buffer(''), size(h + '2P2Pil'))
# builtin_function_or_method
check(len, size(h + '3P'))
@@ -521,7 +564,7 @@ class SizeofTest(unittest.TestCase):
class class_oldstyle():
def method():
pass
- check(class_oldstyle, size(h + '6P'))
+ check(class_oldstyle, size(h + '7P'))
# instance (old-style class)
check(class_oldstyle(), size(h + '3P'))
# instancemethod (old-style class)
@@ -529,7 +572,7 @@ class SizeofTest(unittest.TestCase):
# complex
check(complex(0,1), size(h + '2d'))
# code
- check(get_cell().func_code, size(h + '4i8Pi2P'))
+ check(get_cell().func_code, size(h + '4i8Pi3P'))
# BaseException
check(BaseException(), size(h + '3P'))
# UnicodeEncodeError
@@ -626,12 +669,13 @@ class SizeofTest(unittest.TestCase):
# listreverseiterator (list)
check(reversed([]), size(h + 'lP'))
# long
- check(0L, size(vh + 'H') - self.H)
- check(1L, size(vh + 'H'))
- check(-1L, size(vh + 'H'))
- check(32768L, size(vh + 'H') + self.H)
- check(32768L*32768L-1, size(vh + 'H') + self.H)
- check(32768L*32768L, size(vh + 'H') + 2*self.H)
+ check(0L, size(vh))
+ check(1L, size(vh) + self.longdigit)
+ check(-1L, size(vh) + self.longdigit)
+ PyLong_BASE = 2**sys.long_info.bits_per_digit
+ check(long(PyLong_BASE), size(vh) + 2*self.longdigit)
+ check(long(PyLong_BASE**2-1), size(vh) + 2*self.longdigit)
+ check(long(PyLong_BASE**2), size(vh) + 3*self.longdigit)
# module
check(unittest, size(h + 'P'))
# None
@@ -646,6 +690,7 @@ class SizeofTest(unittest.TestCase):
x = property(getx, setx, delx, "")
check(x, size(h + '4Pi'))
# PyCObject
+ # PyCapsule
# XXX
# rangeiterator
check(iter(xrange(1)), size(h + '4l'))
@@ -676,8 +721,8 @@ class SizeofTest(unittest.TestCase):
# slice
check(slice(1), size(h + '3P'))
# str
- check('', size(vh + 'lic'))
- check('abc', size(vh + 'lic') + 3*self.c)
+ check('', struct.calcsize(vh + 'li') + 1)
+ check('abc', struct.calcsize(vh + 'li') + 1 + 3*self.c)
# super
check(super(int), size(h + '3P'))
# tuple
diff --git a/Lib/test/test_profilehooks.py b/Lib/test/test_sys_setprofile.py
index 3e02830ef6..e82559f8fc 100644
--- a/Lib/test/test_profilehooks.py
+++ b/Lib/test/test_sys_setprofile.py
@@ -1,3 +1,4 @@
+import gc
import pprint
import sys
import unittest
@@ -12,14 +13,14 @@ class TestGetProfile(unittest.TestCase):
sys.setprofile(None)
def test_empty(self):
- assert sys.getprofile() == None
+ self.assertIsNone(sys.getprofile())
def test_setget(self):
def fn(*args):
pass
sys.setprofile(fn)
- assert sys.getprofile() == fn
+ self.assertIs(sys.getprofile(), fn)
class HookWatcher:
def __init__(self):
@@ -352,19 +353,19 @@ protect_ident = ident(protect)
def capture_events(callable, p=None):
- try:
- sys.setprofile()
- except TypeError:
- pass
- else:
- raise test_support.TestFailed(
- 'sys.setprofile() did not raise TypeError')
-
if p is None:
p = HookWatcher()
- sys.setprofile(p.callback)
- protect(callable, p)
- sys.setprofile(None)
+ # Disable the garbage collector. This prevents __del__s from showing up in
+ # traces.
+ old_gc = gc.isenabled()
+ gc.disable()
+ try:
+ sys.setprofile(p.callback)
+ protect(callable, p)
+ sys.setprofile(None)
+ finally:
+ if old_gc:
+ gc.enable()
return p.get_events()[1:-1]
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py
new file mode 100644
index 0000000000..df8c56f758
--- /dev/null
+++ b/Lib/test/test_sys_settrace.py
@@ -0,0 +1,789 @@
+# Testing the line trace facility.
+
+from test import test_support
+import unittest
+import sys
+import difflib
+import gc
+
+# A very basic example. If this fails, we're in deep trouble.
+def basic():
+ return 1
+
+basic.events = [(0, 'call'),
+ (1, 'line'),
+ (1, 'return')]
+
+# Many of the tests below are tricky because they involve pass statements.
+# If there is implicit control flow around a pass statement (in an except
+# clause or else caluse) under what conditions do you set a line number
+# following that clause?
+
+
+# The entire "while 0:" statement is optimized away. No code
+# exists for it, so the line numbers skip directly from "del x"
+# to "x = 1".
+def arigo_example():
+ x = 1
+ del x
+ while 0:
+ pass
+ x = 1
+
+arigo_example.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (5, 'line'),
+ (5, 'return')]
+
+# check that lines consisting of just one instruction get traced:
+def one_instr_line():
+ x = 1
+ del x
+ x = 1
+
+one_instr_line.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (3, 'return')]
+
+def no_pop_tops(): # 0
+ x = 1 # 1
+ for a in range(2): # 2
+ if a: # 3
+ x = 1 # 4
+ else: # 5
+ x = 1 # 6
+
+no_pop_tops.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (6, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (4, 'line'),
+ (2, 'line'),
+ (2, 'return')]
+
+def no_pop_blocks():
+ y = 1
+ while not y:
+ bla
+ x = 1
+
+no_pop_blocks.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (4, 'line'),
+ (4, 'return')]
+
+def called(): # line -3
+ x = 1
+
+def call(): # line 0
+ called()
+
+call.events = [(0, 'call'),
+ (1, 'line'),
+ (-3, 'call'),
+ (-2, 'line'),
+ (-2, 'return'),
+ (1, 'return')]
+
+def raises():
+ raise Exception
+
+def test_raise():
+ try:
+ raises()
+ except Exception, exc:
+ x = 1
+
+test_raise.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (-3, 'call'),
+ (-2, 'line'),
+ (-2, 'exception'),
+ (-2, 'return'),
+ (2, 'exception'),
+ (3, 'line'),
+ (4, 'line'),
+ (4, 'return')]
+
+def _settrace_and_return(tracefunc):
+ sys.settrace(tracefunc)
+ sys._getframe().f_back.f_trace = tracefunc
+def settrace_and_return(tracefunc):
+ _settrace_and_return(tracefunc)
+
+settrace_and_return.events = [(1, 'return')]
+
+def _settrace_and_raise(tracefunc):
+ sys.settrace(tracefunc)
+ sys._getframe().f_back.f_trace = tracefunc
+ raise RuntimeError
+def settrace_and_raise(tracefunc):
+ try:
+ _settrace_and_raise(tracefunc)
+ except RuntimeError, exc:
+ pass
+
+settrace_and_raise.events = [(2, 'exception'),
+ (3, 'line'),
+ (4, 'line'),
+ (4, 'return')]
+
+# implicit return example
+# This test is interesting because of the else: pass
+# part of the code. The code generate for the true
+# part of the if contains a jump past the else branch.
+# The compiler then generates an implicit "return None"
+# Internally, the compiler visits the pass statement
+# and stores its line number for use on the next instruction.
+# The next instruction is the implicit return None.
+def ireturn_example():
+ a = 5
+ b = 5
+ if a == b:
+ b = a+1
+ else:
+ pass
+
+ireturn_example.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (4, 'line'),
+ (6, 'line'),
+ (6, 'return')]
+
+# Tight loop with while(1) example (SF #765624)
+def tightloop_example():
+ items = range(0, 3)
+ try:
+ i = 0
+ while 1:
+ b = items[i]; i+=1
+ except IndexError:
+ pass
+
+tightloop_example.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (4, 'line'),
+ (5, 'line'),
+ (5, 'line'),
+ (5, 'line'),
+ (5, 'line'),
+ (5, 'exception'),
+ (6, 'line'),
+ (7, 'line'),
+ (7, 'return')]
+
+def tighterloop_example():
+ items = range(1, 4)
+ try:
+ i = 0
+ while 1: i = items[i]
+ except IndexError:
+ pass
+
+tighterloop_example.events = [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (3, 'line'),
+ (4, 'line'),
+ (4, 'line'),
+ (4, 'line'),
+ (4, 'line'),
+ (4, 'exception'),
+ (5, 'line'),
+ (6, 'line'),
+ (6, 'return')]
+
+def generator_function():
+ try:
+ yield True
+ "continued"
+ finally:
+ "finally"
+def generator_example():
+ # any() will leave the generator before its end
+ x = any(generator_function())
+
+ # the following lines were not traced
+ for x in range(10):
+ y = x
+
+generator_example.events = ([(0, 'call'),
+ (2, 'line'),
+ (-6, 'call'),
+ (-5, 'line'),
+ (-4, 'line'),
+ (-4, 'return'),
+ (-4, 'call'),
+ (-4, 'exception'),
+ (-1, 'line'),
+ (-1, 'return')] +
+ [(5, 'line'), (6, 'line')] * 10 +
+ [(5, 'line'), (5, 'return')])
+
+
+class Tracer:
+ def __init__(self):
+ self.events = []
+ def trace(self, frame, event, arg):
+ self.events.append((frame.f_lineno, event))
+ return self.trace
+ def traceWithGenexp(self, frame, event, arg):
+ (o for o in [1])
+ self.events.append((frame.f_lineno, event))
+ return self.trace
+
+class TraceTestCase(unittest.TestCase):
+
+ # Disable gc collection when tracing, otherwise the
+ # deallocators may be traced as well.
+ def setUp(self):
+ self.using_gc = gc.isenabled()
+ gc.disable()
+
+ def tearDown(self):
+ if self.using_gc:
+ gc.enable()
+
+ def compare_events(self, line_offset, events, expected_events):
+ events = [(l - line_offset, e) for (l, e) in events]
+ if events != expected_events:
+ self.fail(
+ "events did not match expectation:\n" +
+ "\n".join(difflib.ndiff([str(x) for x in expected_events],
+ [str(x) for x in events])))
+
+ def run_and_compare(self, func, events):
+ tracer = Tracer()
+ sys.settrace(tracer.trace)
+ func()
+ sys.settrace(None)
+ self.compare_events(func.func_code.co_firstlineno,
+ tracer.events, events)
+
+ def run_test(self, func):
+ self.run_and_compare(func, func.events)
+
+ def run_test2(self, func):
+ tracer = Tracer()
+ func(tracer.trace)
+ sys.settrace(None)
+ self.compare_events(func.func_code.co_firstlineno,
+ tracer.events, func.events)
+
+ def set_and_retrieve_none(self):
+ sys.settrace(None)
+ assert sys.gettrace() is None
+
+ def set_and_retrieve_func(self):
+ def fn(*args):
+ pass
+
+ sys.settrace(fn)
+ try:
+ assert sys.gettrace() is fn
+ finally:
+ sys.settrace(None)
+
+ def test_01_basic(self):
+ self.run_test(basic)
+ def test_02_arigo(self):
+ self.run_test(arigo_example)
+ def test_03_one_instr(self):
+ self.run_test(one_instr_line)
+ def test_04_no_pop_blocks(self):
+ self.run_test(no_pop_blocks)
+ def test_05_no_pop_tops(self):
+ self.run_test(no_pop_tops)
+ def test_06_call(self):
+ self.run_test(call)
+ def test_07_raise(self):
+ self.run_test(test_raise)
+
+ def test_08_settrace_and_return(self):
+ self.run_test2(settrace_and_return)
+ def test_09_settrace_and_raise(self):
+ self.run_test2(settrace_and_raise)
+ def test_10_ireturn(self):
+ self.run_test(ireturn_example)
+ def test_11_tightloop(self):
+ self.run_test(tightloop_example)
+ def test_12_tighterloop(self):
+ self.run_test(tighterloop_example)
+
+ def test_13_genexp(self):
+ self.run_test(generator_example)
+ # issue1265: if the trace function contains a generator,
+ # and if the traced function contains another generator
+ # that is not completely exhausted, the trace stopped.
+ # Worse: the 'finally' clause was not invoked.
+ tracer = Tracer()
+ sys.settrace(tracer.traceWithGenexp)
+ generator_example()
+ sys.settrace(None)
+ self.compare_events(generator_example.__code__.co_firstlineno,
+ tracer.events, generator_example.events)
+
+ def test_14_onliner_if(self):
+ def onliners():
+ if True: False
+ else: True
+ return 0
+ self.run_and_compare(
+ onliners,
+ [(0, 'call'),
+ (1, 'line'),
+ (3, 'line'),
+ (3, 'return')])
+
+ def test_15_loops(self):
+ # issue1750076: "while" expression is skipped by debugger
+ def for_example():
+ for x in range(2):
+ pass
+ self.run_and_compare(
+ for_example,
+ [(0, 'call'),
+ (1, 'line'),
+ (2, 'line'),
+ (1, 'line'),
+ (2, 'line'),
+ (1, 'line'),
+ (1, 'return')])
+
+ def while_example():
+ # While expression should be traced on every loop
+ x = 2
+ while x > 0:
+ x -= 1
+ self.run_and_compare(
+ while_example,
+ [(0, 'call'),
+ (2, 'line'),
+ (3, 'line'),
+ (4, 'line'),
+ (3, 'line'),
+ (4, 'line'),
+ (3, 'line'),
+ (3, 'return')])
+
+ def test_16_blank_lines(self):
+ exec("def f():\n" + "\n" * 256 + " pass")
+ self.run_and_compare(
+ f,
+ [(0, 'call'),
+ (257, 'line'),
+ (257, 'return')])
+
+
+class RaisingTraceFuncTestCase(unittest.TestCase):
+ def trace(self, frame, event, arg):
+ """A trace function that raises an exception in response to a
+ specific trace event."""
+ if event == self.raiseOnEvent:
+ raise ValueError # just something that isn't RuntimeError
+ else:
+ return self.trace
+
+ def f(self):
+ """The function to trace; raises an exception if that's the case
+ we're testing, so that the 'exception' trace event fires."""
+ if self.raiseOnEvent == 'exception':
+ x = 0
+ y = 1 // x
+ else:
+ return 1
+
+ def run_test_for_event(self, event):
+ """Tests that an exception raised in response to the given event is
+ handled OK."""
+ self.raiseOnEvent = event
+ try:
+ for i in xrange(sys.getrecursionlimit() + 1):
+ sys.settrace(self.trace)
+ try:
+ self.f()
+ except ValueError:
+ pass
+ else:
+ self.fail("exception not thrown!")
+ except RuntimeError:
+ self.fail("recursion counter not reset")
+
+ # Test the handling of exceptions raised by each kind of trace event.
+ def test_call(self):
+ self.run_test_for_event('call')
+ def test_line(self):
+ self.run_test_for_event('line')
+ def test_return(self):
+ self.run_test_for_event('return')
+ def test_exception(self):
+ self.run_test_for_event('exception')
+
+ def test_trash_stack(self):
+ def f():
+ for i in range(5):
+ print i # line tracing will raise an exception at this line
+
+ def g(frame, why, extra):
+ if (why == 'line' and
+ frame.f_lineno == f.func_code.co_firstlineno + 2):
+ raise RuntimeError, "i am crashing"
+ return g
+
+ sys.settrace(g)
+ try:
+ f()
+ except RuntimeError:
+ # the test is really that this doesn't segfault:
+ import gc
+ gc.collect()
+ else:
+ self.fail("exception not propagated")
+
+
+# 'Jump' tests: assigning to frame.f_lineno within a trace function
+# moves the execution position - it's how debuggers implement a Jump
+# command (aka. "Set next statement").
+
+class JumpTracer:
+ """Defines a trace function that jumps from one place to another,
+ with the source and destination lines of the jump being defined by
+ the 'jump' property of the function under test."""
+
+ def __init__(self, function):
+ self.function = function
+ self.jumpFrom = function.jump[0]
+ self.jumpTo = function.jump[1]
+ self.done = False
+
+ def trace(self, frame, event, arg):
+ if not self.done and frame.f_code == self.function.func_code:
+ firstLine = frame.f_code.co_firstlineno
+ if event == 'line' and frame.f_lineno == firstLine + self.jumpFrom:
+ # Cope with non-integer self.jumpTo (because of
+ # no_jump_to_non_integers below).
+ try:
+ frame.f_lineno = firstLine + self.jumpTo
+ except TypeError:
+ frame.f_lineno = self.jumpTo
+ self.done = True
+ return self.trace
+
+# The first set of 'jump' tests are for things that are allowed:
+
+def jump_simple_forwards(output):
+ output.append(1)
+ output.append(2)
+ output.append(3)
+
+jump_simple_forwards.jump = (1, 3)
+jump_simple_forwards.output = [3]
+
+def jump_simple_backwards(output):
+ output.append(1)
+ output.append(2)
+
+jump_simple_backwards.jump = (2, 1)
+jump_simple_backwards.output = [1, 1, 2]
+
+def jump_out_of_block_forwards(output):
+ for i in 1, 2:
+ output.append(2)
+ for j in [3]: # Also tests jumping over a block
+ output.append(4)
+ output.append(5)
+
+jump_out_of_block_forwards.jump = (3, 5)
+jump_out_of_block_forwards.output = [2, 5]
+
+def jump_out_of_block_backwards(output):
+ output.append(1)
+ for i in [1]:
+ output.append(3)
+ for j in [2]: # Also tests jumping over a block
+ output.append(5)
+ output.append(6)
+ output.append(7)
+
+jump_out_of_block_backwards.jump = (6, 1)
+jump_out_of_block_backwards.output = [1, 3, 5, 1, 3, 5, 6, 7]
+
+def jump_to_codeless_line(output):
+ output.append(1)
+ # Jumping to this line should skip to the next one.
+ output.append(3)
+
+jump_to_codeless_line.jump = (1, 2)
+jump_to_codeless_line.output = [3]
+
+def jump_to_same_line(output):
+ output.append(1)
+ output.append(2)
+ output.append(3)
+
+jump_to_same_line.jump = (2, 2)
+jump_to_same_line.output = [1, 2, 3]
+
+# Tests jumping within a finally block, and over one.
+def jump_in_nested_finally(output):
+ try:
+ output.append(2)
+ finally:
+ output.append(4)
+ try:
+ output.append(6)
+ finally:
+ output.append(8)
+ output.append(9)
+
+jump_in_nested_finally.jump = (4, 9)
+jump_in_nested_finally.output = [2, 9]
+
+# The second set of 'jump' tests are for things that are not allowed:
+
+def no_jump_too_far_forwards(output):
+ try:
+ output.append(2)
+ output.append(3)
+ except ValueError, e:
+ output.append('after' in str(e))
+
+no_jump_too_far_forwards.jump = (3, 6)
+no_jump_too_far_forwards.output = [2, True]
+
+def no_jump_too_far_backwards(output):
+ try:
+ output.append(2)
+ output.append(3)
+ except ValueError, e:
+ output.append('before' in str(e))
+
+no_jump_too_far_backwards.jump = (3, -1)
+no_jump_too_far_backwards.output = [2, True]
+
+# Test each kind of 'except' line.
+def no_jump_to_except_1(output):
+ try:
+ output.append(2)
+ except:
+ e = sys.exc_info()[1]
+ output.append('except' in str(e))
+
+no_jump_to_except_1.jump = (2, 3)
+no_jump_to_except_1.output = [True]
+
+def no_jump_to_except_2(output):
+ try:
+ output.append(2)
+ except ValueError:
+ e = sys.exc_info()[1]
+ output.append('except' in str(e))
+
+no_jump_to_except_2.jump = (2, 3)
+no_jump_to_except_2.output = [True]
+
+def no_jump_to_except_3(output):
+ try:
+ output.append(2)
+ except ValueError, e:
+ output.append('except' in str(e))
+
+no_jump_to_except_3.jump = (2, 3)
+no_jump_to_except_3.output = [True]
+
+def no_jump_to_except_4(output):
+ try:
+ output.append(2)
+ except (ValueError, RuntimeError), e:
+ output.append('except' in str(e))
+
+no_jump_to_except_4.jump = (2, 3)
+no_jump_to_except_4.output = [True]
+
+def no_jump_forwards_into_block(output):
+ try:
+ output.append(2)
+ for i in 1, 2:
+ output.append(4)
+ except ValueError, e:
+ output.append('into' in str(e))
+
+no_jump_forwards_into_block.jump = (2, 4)
+no_jump_forwards_into_block.output = [True]
+
+def no_jump_backwards_into_block(output):
+ try:
+ for i in 1, 2:
+ output.append(3)
+ output.append(4)
+ except ValueError, e:
+ output.append('into' in str(e))
+
+no_jump_backwards_into_block.jump = (4, 3)
+no_jump_backwards_into_block.output = [3, 3, True]
+
+def no_jump_into_finally_block(output):
+ try:
+ try:
+ output.append(3)
+ x = 1
+ finally:
+ output.append(6)
+ except ValueError, e:
+ output.append('finally' in str(e))
+
+no_jump_into_finally_block.jump = (4, 6)
+no_jump_into_finally_block.output = [3, 6, True] # The 'finally' still runs
+
+def no_jump_out_of_finally_block(output):
+ try:
+ try:
+ output.append(3)
+ finally:
+ output.append(5)
+ output.append(6)
+ except ValueError, e:
+ output.append('finally' in str(e))
+
+no_jump_out_of_finally_block.jump = (5, 1)
+no_jump_out_of_finally_block.output = [3, True]
+
+# This verifies the line-numbers-must-be-integers rule.
+def no_jump_to_non_integers(output):
+ try:
+ output.append(2)
+ except ValueError, e:
+ output.append('integer' in str(e))
+
+no_jump_to_non_integers.jump = (2, "Spam")
+no_jump_to_non_integers.output = [True]
+
+# This verifies that you can't set f_lineno via _getframe or similar
+# trickery.
+def no_jump_without_trace_function():
+ try:
+ previous_frame = sys._getframe().f_back
+ previous_frame.f_lineno = previous_frame.f_lineno
+ except ValueError, e:
+ # This is the exception we wanted; make sure the error message
+ # talks about trace functions.
+ if 'trace' not in str(e):
+ raise
+ else:
+ # Something's wrong - the expected exception wasn't raised.
+ raise RuntimeError, "Trace-function-less jump failed to fail"
+
+
+class JumpTestCase(unittest.TestCase):
+ def compare_jump_output(self, expected, received):
+ if received != expected:
+ self.fail( "Outputs don't match:\n" +
+ "Expected: " + repr(expected) + "\n" +
+ "Received: " + repr(received))
+
+ def run_test(self, func):
+ tracer = JumpTracer(func)
+ sys.settrace(tracer.trace)
+ output = []
+ func(output)
+ sys.settrace(None)
+ self.compare_jump_output(func.output, output)
+
+ def test_01_jump_simple_forwards(self):
+ self.run_test(jump_simple_forwards)
+ def test_02_jump_simple_backwards(self):
+ self.run_test(jump_simple_backwards)
+ def test_03_jump_out_of_block_forwards(self):
+ self.run_test(jump_out_of_block_forwards)
+ def test_04_jump_out_of_block_backwards(self):
+ self.run_test(jump_out_of_block_backwards)
+ def test_05_jump_to_codeless_line(self):
+ self.run_test(jump_to_codeless_line)
+ def test_06_jump_to_same_line(self):
+ self.run_test(jump_to_same_line)
+ def test_07_jump_in_nested_finally(self):
+ self.run_test(jump_in_nested_finally)
+ def test_08_no_jump_too_far_forwards(self):
+ self.run_test(no_jump_too_far_forwards)
+ def test_09_no_jump_too_far_backwards(self):
+ self.run_test(no_jump_too_far_backwards)
+ def test_10_no_jump_to_except_1(self):
+ self.run_test(no_jump_to_except_1)
+ def test_11_no_jump_to_except_2(self):
+ self.run_test(no_jump_to_except_2)
+ def test_12_no_jump_to_except_3(self):
+ self.run_test(no_jump_to_except_3)
+ def test_13_no_jump_to_except_4(self):
+ self.run_test(no_jump_to_except_4)
+ def test_14_no_jump_forwards_into_block(self):
+ self.run_test(no_jump_forwards_into_block)
+ def test_15_no_jump_backwards_into_block(self):
+ self.run_test(no_jump_backwards_into_block)
+ def test_16_no_jump_into_finally_block(self):
+ self.run_test(no_jump_into_finally_block)
+ def test_17_no_jump_out_of_finally_block(self):
+ self.run_test(no_jump_out_of_finally_block)
+ def test_18_no_jump_to_non_integers(self):
+ self.run_test(no_jump_to_non_integers)
+ def test_19_no_jump_without_trace_function(self):
+ no_jump_without_trace_function()
+
+ def test_20_large_function(self):
+ d = {}
+ exec("""def f(output): # line 0
+ x = 0 # line 1
+ y = 1 # line 2
+ ''' # line 3
+ %s # lines 4-1004
+ ''' # line 1005
+ x += 1 # line 1006
+ output.append(x) # line 1007
+ return""" % ('\n' * 1000,), d)
+ f = d['f']
+
+ f.jump = (2, 1007)
+ f.output = [0]
+ self.run_test(f)
+
+ def test_jump_to_firstlineno(self):
+ # This tests that PDB can jump back to the first line in a
+ # file. See issue #1689458. It can only be triggered in a
+ # function call if the function is defined on a single line.
+ code = compile("""
+# Comments don't count.
+output.append(2) # firstlineno is here.
+output.append(3)
+output.append(4)
+""", "<fake module>", "exec")
+ class fake_function:
+ func_code = code
+ jump = (2, 0)
+ tracer = JumpTracer(fake_function)
+ sys.settrace(tracer.trace)
+ namespace = {"output": []}
+ exec code in namespace
+ sys.settrace(None)
+ self.compare_jump_output([2, 3, 2, 3, 4], namespace["output"])
+
+
+def test_main():
+ test_support.run_unittest(
+ TraceTestCase,
+ RaisingTraceFuncTestCase,
+ JumpTestCase
+ )
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
new file mode 100644
index 0000000000..95fbe0ea61
--- /dev/null
+++ b/Lib/test/test_sysconfig.py
@@ -0,0 +1,316 @@
+"""Tests for 'site'.
+
+Tests assume the initial paths in sys.path once the interpreter has begun
+executing have not been removed.
+
+"""
+import unittest
+import sys
+import os
+import shutil
+import subprocess
+from copy import copy, deepcopy
+
+from test.test_support import run_unittest, TESTFN, unlink, get_attribute
+
+import sysconfig
+from sysconfig import (get_paths, get_platform, get_config_vars,
+ get_path, get_path_names, _INSTALL_SCHEMES,
+ _get_default_scheme, _expand_vars,
+ get_scheme_names, get_config_var)
+
+class TestSysConfig(unittest.TestCase):
+
+ def setUp(self):
+ """Make a copy of sys.path"""
+ super(TestSysConfig, self).setUp()
+ self.sys_path = sys.path[:]
+ self.makefile = None
+ # patching os.uname
+ if hasattr(os, 'uname'):
+ self.uname = os.uname
+ self._uname = os.uname()
+ else:
+ self.uname = None
+ self._uname = None
+ os.uname = self._get_uname
+ # saving the environment
+ self.name = os.name
+ self.platform = sys.platform
+ self.version = sys.version
+ self.sep = os.sep
+ self.join = os.path.join
+ self.isabs = os.path.isabs
+ self.splitdrive = os.path.splitdrive
+ self._config_vars = copy(sysconfig._CONFIG_VARS)
+ self.old_environ = deepcopy(os.environ)
+
+ def tearDown(self):
+ """Restore sys.path"""
+ sys.path[:] = self.sys_path
+ if self.makefile is not None:
+ os.unlink(self.makefile)
+ self._cleanup_testfn()
+ if self.uname is not None:
+ os.uname = self.uname
+ else:
+ del os.uname
+ os.name = self.name
+ sys.platform = self.platform
+ sys.version = self.version
+ os.sep = self.sep
+ os.path.join = self.join
+ os.path.isabs = self.isabs
+ os.path.splitdrive = self.splitdrive
+ sysconfig._CONFIG_VARS = copy(self._config_vars)
+ for key, value in self.old_environ.items():
+ if os.environ.get(key) != value:
+ os.environ[key] = value
+
+ for key in os.environ.keys():
+ if key not in self.old_environ:
+ del os.environ[key]
+
+ super(TestSysConfig, self).tearDown()
+
+ def _set_uname(self, uname):
+ self._uname = uname
+
+ def _get_uname(self):
+ return self._uname
+
+ def _cleanup_testfn(self):
+ path = TESTFN
+ if os.path.isfile(path):
+ os.remove(path)
+ elif os.path.isdir(path):
+ shutil.rmtree(path)
+
+ def test_get_path_names(self):
+ self.assertEqual(get_path_names(), sysconfig._SCHEME_KEYS)
+
+ def test_get_paths(self):
+ scheme = get_paths()
+ default_scheme = _get_default_scheme()
+ wanted = _expand_vars(default_scheme, None)
+ wanted = wanted.items()
+ wanted.sort()
+ scheme = scheme.items()
+ scheme.sort()
+ self.assertEqual(scheme, wanted)
+
+ def test_get_path(self):
+ # xxx make real tests here
+ for scheme in _INSTALL_SCHEMES:
+ for name in _INSTALL_SCHEMES[scheme]:
+ res = get_path(name, scheme)
+
+ def test_get_config_vars(self):
+ cvars = get_config_vars()
+ self.assertIsInstance(cvars, dict)
+ self.assertTrue(cvars)
+
+ def test_get_platform(self):
+ # windows XP, 32bits
+ os.name = 'nt'
+ sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
+ '[MSC v.1310 32 bit (Intel)]')
+ sys.platform = 'win32'
+ self.assertEqual(get_platform(), 'win32')
+
+ # windows XP, amd64
+ os.name = 'nt'
+ sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
+ '[MSC v.1310 32 bit (Amd64)]')
+ sys.platform = 'win32'
+ self.assertEqual(get_platform(), 'win-amd64')
+
+ # windows XP, itanium
+ os.name = 'nt'
+ sys.version = ('2.4.4 (#71, Oct 18 2006, 08:34:43) '
+ '[MSC v.1310 32 bit (Itanium)]')
+ sys.platform = 'win32'
+ self.assertEqual(get_platform(), 'win-ia64')
+
+ # macbook
+ os.name = 'posix'
+ sys.version = ('2.5 (r25:51918, Sep 19 2006, 08:49:13) '
+ '\n[GCC 4.0.1 (Apple Computer, Inc. build 5341)]')
+ sys.platform = 'darwin'
+ self._set_uname(('Darwin', 'macziade', '8.11.1',
+ ('Darwin Kernel Version 8.11.1: '
+ 'Wed Oct 10 18:23:28 PDT 2007; '
+ 'root:xnu-792.25.20~1/RELEASE_I386'), 'PowerPC'))
+ get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
+
+ get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
+ '-fwrapv -O3 -Wall -Wstrict-prototypes')
+
+ maxint = sys.maxint
+ try:
+ sys.maxint = 2147483647
+ self.assertEqual(get_platform(), 'macosx-10.3-ppc')
+ sys.maxint = 9223372036854775807
+ self.assertEqual(get_platform(), 'macosx-10.3-ppc64')
+ finally:
+ sys.maxint = maxint
+
+
+ self._set_uname(('Darwin', 'macziade', '8.11.1',
+ ('Darwin Kernel Version 8.11.1: '
+ 'Wed Oct 10 18:23:28 PDT 2007; '
+ 'root:xnu-792.25.20~1/RELEASE_I386'), 'i386'))
+ get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'
+
+ get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
+ '-fwrapv -O3 -Wall -Wstrict-prototypes')
+
+ maxint = sys.maxint
+ try:
+ sys.maxint = 2147483647
+ self.assertEqual(get_platform(), 'macosx-10.3-i386')
+ sys.maxint = 9223372036854775807
+ self.assertEqual(get_platform(), 'macosx-10.3-x86_64')
+ finally:
+ sys.maxint = maxint
+
+ # macbook with fat binaries (fat, universal or fat64)
+ get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
+ get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+
+ self.assertEqual(get_platform(), 'macosx-10.4-fat')
+
+ get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+
+ self.assertEqual(get_platform(), 'macosx-10.4-intel')
+
+ get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+ self.assertEqual(get_platform(), 'macosx-10.4-fat3')
+
+ get_config_vars()['CFLAGS'] = ('-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+ self.assertEqual(get_platform(), 'macosx-10.4-universal')
+
+ get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc64 -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3')
+
+ self.assertEqual(get_platform(), 'macosx-10.4-fat64')
+
+ for arch in ('ppc', 'i386', 'x86_64', 'ppc64'):
+ get_config_vars()['CFLAGS'] = ('-arch %s -isysroot '
+ '/Developer/SDKs/MacOSX10.4u.sdk '
+ '-fno-strict-aliasing -fno-common '
+ '-dynamic -DNDEBUG -g -O3'%(arch,))
+
+ self.assertEqual(get_platform(), 'macosx-10.4-%s'%(arch,))
+
+ # linux debian sarge
+ os.name = 'posix'
+ sys.version = ('2.3.5 (#1, Jul 4 2007, 17:28:59) '
+ '\n[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)]')
+ sys.platform = 'linux2'
+ self._set_uname(('Linux', 'aglae', '2.6.21.1dedibox-r7',
+ '#1 Mon Apr 30 17:25:38 CEST 2007', 'i686'))
+
+ self.assertEqual(get_platform(), 'linux-i686')
+
+ # XXX more platforms to tests here
+
+ def test_get_config_h_filename(self):
+ config_h = sysconfig.get_config_h_filename()
+ self.assertTrue(os.path.isfile(config_h), config_h)
+
+ def test_get_scheme_names(self):
+ wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user',
+ 'posix_home', 'posix_prefix', 'posix_user')
+ self.assertEqual(get_scheme_names(), wanted)
+
+ def test_symlink(self):
+ # Issue 7880
+ symlink = get_attribute(os, "symlink")
+ def get(python):
+ cmd = [python, '-c',
+ 'import sysconfig; print sysconfig.get_platform()']
+ p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
+ return p.communicate()
+ real = os.path.realpath(sys.executable)
+ link = os.path.abspath(TESTFN)
+ symlink(real, link)
+ try:
+ self.assertEqual(get(real), get(link))
+ finally:
+ unlink(link)
+
+ def test_user_similar(self):
+ # Issue 8759 : make sure the posix scheme for the users
+ # is similar to the global posix_prefix one
+ base = get_config_var('base')
+ user = get_config_var('userbase')
+ for name in ('stdlib', 'platstdlib', 'purelib', 'platlib'):
+ global_path = get_path(name, 'posix_prefix')
+ user_path = get_path(name, 'posix_user')
+ self.assertEqual(user_path, global_path.replace(base, user))
+
+ @unittest.skipUnless(sys.platform == "darwin", "test only relevant on MacOSX")
+ def test_platform_in_subprocess(self):
+ my_platform = sysconfig.get_platform()
+
+ # Test without MACOSX_DEPLOYMENT_TARGET in the environment
+
+ env = os.environ.copy()
+ if 'MACOSX_DEPLOYMENT_TARGET' in env:
+ del env['MACOSX_DEPLOYMENT_TARGET']
+
+ with open('/dev/null', 'w') as devnull_fp:
+ p = subprocess.Popen([
+ sys.executable, '-c',
+ 'import sysconfig; print(sysconfig.get_platform())',
+ ],
+ stdout=subprocess.PIPE,
+ stderr=devnull_fp,
+ env=env)
+ test_platform = p.communicate()[0].strip()
+ test_platform = test_platform.decode('utf-8')
+ status = p.wait()
+
+ self.assertEqual(status, 0)
+ self.assertEqual(my_platform, test_platform)
+
+
+ # Test with MACOSX_DEPLOYMENT_TARGET in the environment, and
+ # using a value that is unlikely to be the default one.
+ env = os.environ.copy()
+ env['MACOSX_DEPLOYMENT_TARGET'] = '10.1'
+
+ p = subprocess.Popen([
+ sys.executable, '-c',
+ 'import sysconfig; print(sysconfig.get_platform())',
+ ],
+ stdout=subprocess.PIPE,
+ stderr=open('/dev/null'),
+ env=env)
+ test_platform = p.communicate()[0].strip()
+ test_platform = test_platform.decode('utf-8')
+ status = p.wait()
+
+ self.assertEqual(status, 0)
+ self.assertEqual(my_platform, test_platform)
+
+def test_main():
+ run_unittest(TestSysConfig)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
index 909b08cece..6962f8e2d7 100644
--- a/Lib/test/test_tarfile.py
+++ b/Lib/test/test_tarfile.py
@@ -3,7 +3,6 @@
import sys
import os
import shutil
-import tempfile
import StringIO
from hashlib import md5
import errno
@@ -55,7 +54,7 @@ class UstarReadTest(ReadTest):
tarinfo = self.tar.getmember("ustar/regtype")
fobj = self.tar.extractfile(tarinfo)
data = fobj.read()
- self.assert_((len(data), md5sum(data)) == (tarinfo.size, md5_regtype),
+ self.assertTrue((len(data), md5sum(data)) == (tarinfo.size, md5_regtype),
"regular file extraction failed")
def test_fileobj_readlines(self):
@@ -66,11 +65,11 @@ class UstarReadTest(ReadTest):
lines1 = fobj1.readlines()
lines2 = fobj2.readlines()
- self.assert_(lines1 == lines2,
+ self.assertTrue(lines1 == lines2,
"fileobj.readlines() failed")
- self.assert_(len(lines2) == 114,
+ self.assertTrue(len(lines2) == 114,
"fileobj.readlines() failed")
- self.assert_(lines2[83] == \
+ self.assertTrue(lines2[83] ==
"I will gladly admit that Python is not the fastest running scripting language.\n",
"fileobj.readlines() failed")
@@ -81,7 +80,7 @@ class UstarReadTest(ReadTest):
fobj2 = self.tar.extractfile(tarinfo)
lines1 = fobj1.readlines()
lines2 = [line for line in fobj2]
- self.assert_(lines1 == lines2,
+ self.assertTrue(lines1 == lines2,
"fileobj.__iter__() failed")
def test_fileobj_seek(self):
@@ -95,48 +94,114 @@ class UstarReadTest(ReadTest):
text = fobj.read()
fobj.seek(0)
- self.assert_(0 == fobj.tell(),
+ self.assertTrue(0 == fobj.tell(),
"seek() to file's start failed")
fobj.seek(2048, 0)
- self.assert_(2048 == fobj.tell(),
+ self.assertTrue(2048 == fobj.tell(),
"seek() to absolute position failed")
fobj.seek(-1024, 1)
- self.assert_(1024 == fobj.tell(),
+ self.assertTrue(1024 == fobj.tell(),
"seek() to negative relative position failed")
fobj.seek(1024, 1)
- self.assert_(2048 == fobj.tell(),
+ self.assertTrue(2048 == fobj.tell(),
"seek() to positive relative position failed")
s = fobj.read(10)
- self.assert_(s == data[2048:2058],
+ self.assertTrue(s == data[2048:2058],
"read() after seek failed")
fobj.seek(0, 2)
- self.assert_(tarinfo.size == fobj.tell(),
+ self.assertTrue(tarinfo.size == fobj.tell(),
"seek() to file's end failed")
- self.assert_(fobj.read() == "",
+ self.assertTrue(fobj.read() == "",
"read() at file's end did not return empty string")
fobj.seek(-tarinfo.size, 2)
- self.assert_(0 == fobj.tell(),
+ self.assertTrue(0 == fobj.tell(),
"relative seek() to file's start failed")
fobj.seek(512)
s1 = fobj.readlines()
fobj.seek(512)
s2 = fobj.readlines()
- self.assert_(s1 == s2,
+ self.assertTrue(s1 == s2,
"readlines() after seek failed")
fobj.seek(0)
- self.assert_(len(fobj.readline()) == fobj.tell(),
+ self.assertTrue(len(fobj.readline()) == fobj.tell(),
"tell() after readline() failed")
fobj.seek(512)
- self.assert_(len(fobj.readline()) + 512 == fobj.tell(),
+ self.assertTrue(len(fobj.readline()) + 512 == fobj.tell(),
"tell() after seek() and readline() failed")
fobj.seek(0)
line = fobj.readline()
- self.assert_(fobj.read() == data[len(line):],
+ self.assertTrue(fobj.read() == data[len(line):],
"read() after readline() failed")
fobj.close()
+ # Test if symbolic and hard links are resolved by extractfile(). The
+ # test link members each point to a regular member whose data is
+ # supposed to be exported.
+ def _test_fileobj_link(self, lnktype, regtype):
+ a = self.tar.extractfile(lnktype)
+ b = self.tar.extractfile(regtype)
+ self.assertEqual(a.name, b.name)
-class MiscReadTest(ReadTest):
+ def test_fileobj_link1(self):
+ self._test_fileobj_link("ustar/lnktype", "ustar/regtype")
+
+ def test_fileobj_link2(self):
+ self._test_fileobj_link("./ustar/linktest2/lnktype", "ustar/linktest1/regtype")
+
+ def test_fileobj_symlink1(self):
+ self._test_fileobj_link("ustar/symtype", "ustar/regtype")
+
+ def test_fileobj_symlink2(self):
+ self._test_fileobj_link("./ustar/linktest2/symtype", "ustar/linktest1/regtype")
+
+
+class CommonReadTest(ReadTest):
+
+ def test_empty_tarfile(self):
+ # Test for issue6123: Allow opening empty archives.
+ # This test checks if tarfile.open() is able to open an empty tar
+ # archive successfully. Note that an empty tar archive is not the
+ # same as an empty file!
+ tarfile.open(tmpname, self.mode.replace("r", "w")).close()
+ try:
+ tar = tarfile.open(tmpname, self.mode)
+ tar.getnames()
+ except tarfile.ReadError:
+ self.fail("tarfile.open() failed on empty archive")
+ self.assertListEqual(tar.getmembers(), [])
+
+ def test_null_tarfile(self):
+ # Test for issue6123: Allow opening empty archives.
+ # This test guarantees that tarfile.open() does not treat an empty
+ # file as an empty tar archive.
+ open(tmpname, "wb").close()
+ self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, self.mode)
+ self.assertRaises(tarfile.ReadError, tarfile.open, tmpname)
+
+ def test_ignore_zeros(self):
+ # Test TarFile's ignore_zeros option.
+ if self.mode.endswith(":gz"):
+ _open = gzip.GzipFile
+ elif self.mode.endswith(":bz2"):
+ _open = bz2.BZ2File
+ else:
+ _open = open
+
+ for char in ('\0', 'a'):
+ # Test if EOFHeaderError ('\0') and InvalidHeaderError ('a')
+ # are ignored correctly.
+ fobj = _open(tmpname, "wb")
+ fobj.write(char * 1024)
+ fobj.write(tarfile.TarInfo("foo").tobuf())
+ fobj.close()
+
+ tar = tarfile.open(tmpname, mode="r", ignore_zeros=True)
+ self.assertListEqual(tar.getnames(), ["foo"],
+ "ignore_zeros=True should have skipped the %r-blocks" % char)
+ tar.close()
+
+
+class MiscReadTest(CommonReadTest):
def test_no_name_argument(self):
fobj = open(self.tarname, "rb")
@@ -202,7 +267,7 @@ class MiscReadTest(ReadTest):
# Old V7 tars create directory members using an AREGTYPE
# header with a "/" appended to the filename field.
tarinfo = self.tar.getmember("misc/dirtype-old-v7")
- self.assert_(tarinfo.type == tarfile.DIRTYPE,
+ self.assertTrue(tarinfo.type == tarfile.DIRTYPE,
"v7 dirtype failed")
def test_xstar_type(self):
@@ -216,15 +281,15 @@ class MiscReadTest(ReadTest):
def test_check_members(self):
for tarinfo in self.tar:
- self.assert_(int(tarinfo.mtime) == 07606136617,
+ self.assertTrue(int(tarinfo.mtime) == 07606136617,
"wrong mtime for %s" % tarinfo.name)
if not tarinfo.name.startswith("ustar/"):
continue
- self.assert_(tarinfo.uname == "tarfile",
+ self.assertTrue(tarinfo.uname == "tarfile",
"wrong uname for %s" % tarinfo.name)
def test_find_members(self):
- self.assert_(self.tar.getmembers()[-1].name == "misc/eof",
+ self.assertTrue(self.tar.getmembers()[-1].name == "misc/eof",
"could not find all members")
def test_extract_hardlink(self):
@@ -267,23 +332,23 @@ class MiscReadTest(ReadTest):
def test_init_close_fobj(self):
# Issue #7341: Close the internal file object in the TarFile
# constructor in case of an error. For the test we rely on
- # the fact that opening an invalid file raises a ReadError.
- invalid = os.path.join(TEMPDIR, "invalid")
- open(invalid, "wb").write("foo")
+ # the fact that opening an empty file raises a ReadError.
+ empty = os.path.join(TEMPDIR, "empty")
+ open(empty, "wb").write("")
try:
tar = object.__new__(tarfile.TarFile)
try:
- tar.__init__(invalid)
+ tar.__init__(empty)
except tarfile.ReadError:
self.assertTrue(tar.fileobj.closed)
else:
self.fail("ReadError not raised")
finally:
- os.remove(invalid)
+ os.remove(empty)
-class StreamReadTest(ReadTest):
+class StreamReadTest(CommonReadTest):
mode="r|"
@@ -291,7 +356,7 @@ class StreamReadTest(ReadTest):
tarinfo = self.tar.next() # get "regtype" (can't use getmember)
fobj = self.tar.extractfile(tarinfo)
data = fobj.read()
- self.assert_((len(data), md5sum(data)) == (tarinfo.size, md5_regtype),
+ self.assertTrue((len(data), md5sum(data)) == (tarinfo.size, md5_regtype),
"regular file extraction failed")
def test_provoke_stream_error(self):
@@ -308,7 +373,7 @@ class StreamReadTest(ReadTest):
t2 = tar2.next()
if t1 is None:
break
- self.assert_(t2 is not None, "stream.next() failed.")
+ self.assertTrue(t2 is not None, "stream.next() failed.")
if t2.islnk() or t2.issym():
self.assertRaises(tarfile.StreamError, tar2.extractfile, t2)
@@ -318,8 +383,8 @@ class StreamReadTest(ReadTest):
v2 = tar2.extractfile(t2)
if v1 is None:
continue
- self.assert_(v2 is not None, "stream.extractfile() failed")
- self.assert_(v1.read() == v2.read(), "stream extraction failed")
+ self.assertTrue(v2 is not None, "stream.extractfile() failed")
+ self.assertTrue(v1.read() == v2.read(), "stream extraction failed")
tar1.close()
@@ -380,7 +445,7 @@ class MemberReadTest(ReadTest):
def _test_member(self, tarinfo, chksum=None, **kwargs):
if chksum is not None:
- self.assert_(md5sum(self.tar.extractfile(tarinfo).read()) == chksum,
+ self.assertTrue(md5sum(self.tar.extractfile(tarinfo).read()) == chksum,
"wrong md5sum for %s" % tarinfo.name)
kwargs["mtime"] = 07606136617
@@ -391,7 +456,7 @@ class MemberReadTest(ReadTest):
kwargs["uname"] = "tarfile"
kwargs["gname"] = "tarfile"
for k, v in kwargs.iteritems():
- self.assert_(getattr(tarinfo, k) == v,
+ self.assertTrue(getattr(tarinfo, k) == v,
"wrong value in %s field of %s" % (k, tarinfo.name))
def test_find_regtype(self):
@@ -440,7 +505,7 @@ class MemberReadTest(ReadTest):
def test_find_ustar_longname(self):
name = "ustar/" + "12345/" * 39 + "1234567/longname"
- self.assert_(name in self.tar.getnames())
+ self.assertIn(name, self.tar.getnames())
def test_find_regtype_oldv7(self):
tarinfo = self.tar.getmember("misc/regtype-old-v7")
@@ -461,7 +526,7 @@ class LongnameTest(ReadTest):
tarinfo = self.tar.getmember(longname)
except KeyError:
self.fail("longname not found")
- self.assert_(tarinfo.type != tarfile.DIRTYPE, "read longname as dirtype")
+ self.assertTrue(tarinfo.type != tarfile.DIRTYPE, "read longname as dirtype")
def test_read_longlink(self):
longname = self.subdir + "/" + "123/" * 125 + "longname"
@@ -470,7 +535,7 @@ class LongnameTest(ReadTest):
tarinfo = self.tar.getmember(longlink)
except KeyError:
self.fail("longlink not found")
- self.assert_(tarinfo.linkname == longname, "linkname wrong")
+ self.assertTrue(tarinfo.linkname == longname, "linkname wrong")
def test_truncated_longname(self):
longname = self.subdir + "/" + "123/" * 125 + "longname"
@@ -501,7 +566,7 @@ class GNUReadTest(LongnameTest):
fobj1 = self.tar.extractfile(tarinfo1)
tarinfo2 = self.tar.getmember("gnu/sparse")
fobj2 = self.tar.extractfile(tarinfo2)
- self.assert_(fobj1.read() == fobj2.read(),
+ self.assertTrue(fobj1.read() == fobj2.read(),
"sparse file extraction failed")
@@ -550,7 +615,7 @@ class WriteTestBase(unittest.TestCase):
tar = tarfile.open(fileobj=fobj, mode=self.mode)
tar.addfile(tarfile.TarInfo("foo"))
tar.close()
- self.assert_(fobj.closed is False, "external fileobjs must never closed")
+ self.assertTrue(fobj.closed is False, "external fileobjs must never closed")
class WriteTest(WriteTestBase):
@@ -569,7 +634,7 @@ class WriteTest(WriteTestBase):
tar.close()
tar = tarfile.open(tmpname)
- self.assert_(tar.getnames()[0] == name,
+ self.assertTrue(tar.getnames()[0] == name,
"failed to store 100 char filename")
tar.close()
@@ -582,7 +647,7 @@ class WriteTest(WriteTestBase):
fobj.close()
tar.add(path)
tar.close()
- self.assert_(os.path.getsize(tmpname) > 0,
+ self.assertTrue(os.path.getsize(tmpname) > 0,
"tarfile is empty")
# The test_*_size tests test for bug #1167128.
@@ -647,16 +712,16 @@ class WriteTest(WriteTestBase):
dstname = os.path.abspath(tmpname)
tar = tarfile.open(tmpname, self.mode)
- self.assert_(tar.name == dstname, "archive name must be absolute")
+ self.assertTrue(tar.name == dstname, "archive name must be absolute")
tar.add(dstname)
- self.assert_(tar.getnames() == [], "added the archive to itself")
+ self.assertTrue(tar.getnames() == [], "added the archive to itself")
cwd = os.getcwd()
os.chdir(TEMPDIR)
tar.add(dstname)
os.chdir(cwd)
- self.assert_(tar.getnames() == [], "added the archive to itself")
+ self.assertTrue(tar.getnames() == [], "added the archive to itself")
def test_exclude(self):
tempdir = os.path.join(TEMPDIR, "exclude")
@@ -666,11 +731,12 @@ class WriteTest(WriteTestBase):
name = os.path.join(tempdir, name)
open(name, "wb").close()
- def exclude(name):
- return os.path.isfile(name)
+ exclude = os.path.isfile
tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
- tar.add(tempdir, arcname="empty_dir", exclude=exclude)
+ with test_support.check_warnings(("use the filter argument",
+ DeprecationWarning)):
+ tar.add(tempdir, arcname="empty_dir", exclude=exclude)
tar.close()
tar = tarfile.open(tmpname, "r")
@@ -679,6 +745,192 @@ class WriteTest(WriteTestBase):
finally:
shutil.rmtree(tempdir)
+ def test_filter(self):
+ tempdir = os.path.join(TEMPDIR, "filter")
+ os.mkdir(tempdir)
+ try:
+ for name in ("foo", "bar", "baz"):
+ name = os.path.join(tempdir, name)
+ open(name, "wb").close()
+
+ def filter(tarinfo):
+ if os.path.basename(tarinfo.name) == "bar":
+ return
+ tarinfo.uid = 123
+ tarinfo.uname = "foo"
+ return tarinfo
+
+ tar = tarfile.open(tmpname, self.mode, encoding="iso8859-1")
+ tar.add(tempdir, arcname="empty_dir", filter=filter)
+ tar.close()
+
+ tar = tarfile.open(tmpname, "r")
+ for tarinfo in tar:
+ self.assertEqual(tarinfo.uid, 123)
+ self.assertEqual(tarinfo.uname, "foo")
+ self.assertEqual(len(tar.getmembers()), 3)
+ tar.close()
+ finally:
+ shutil.rmtree(tempdir)
+
+ # Guarantee that stored pathnames are not modified. Don't
+ # remove ./ or ../ or double slashes. Still make absolute
+ # pathnames relative.
+ # For details see bug #6054.
+ def _test_pathname(self, path, cmp_path=None, dir=False):
+ # Create a tarfile with an empty member named path
+ # and compare the stored name with the original.
+ foo = os.path.join(TEMPDIR, "foo")
+ if not dir:
+ open(foo, "w").close()
+ else:
+ os.mkdir(foo)
+
+ tar = tarfile.open(tmpname, self.mode)
+ tar.add(foo, arcname=path)
+ tar.close()
+
+ tar = tarfile.open(tmpname, "r")
+ t = tar.next()
+ tar.close()
+
+ if not dir:
+ os.remove(foo)
+ else:
+ os.rmdir(foo)
+
+ self.assertEqual(t.name, cmp_path or path.replace(os.sep, "/"))
+
+ def test_pathnames(self):
+ self._test_pathname("foo")
+ self._test_pathname(os.path.join("foo", ".", "bar"))
+ self._test_pathname(os.path.join("foo", "..", "bar"))
+ self._test_pathname(os.path.join(".", "foo"))
+ self._test_pathname(os.path.join(".", "foo", "."))
+ self._test_pathname(os.path.join(".", "foo", ".", "bar"))
+ self._test_pathname(os.path.join(".", "foo", "..", "bar"))
+ self._test_pathname(os.path.join(".", "foo", "..", "bar"))
+ self._test_pathname(os.path.join("..", "foo"))
+ self._test_pathname(os.path.join("..", "foo", ".."))
+ self._test_pathname(os.path.join("..", "foo", ".", "bar"))
+ self._test_pathname(os.path.join("..", "foo", "..", "bar"))
+
+ self._test_pathname("foo" + os.sep + os.sep + "bar")
+ self._test_pathname("foo" + os.sep + os.sep, "foo", dir=True)
+
+ def test_abs_pathnames(self):
+ if sys.platform == "win32":
+ self._test_pathname("C:\\foo", "foo")
+ else:
+ self._test_pathname("/foo", "foo")
+ self._test_pathname("///foo", "foo")
+
+ def test_cwd(self):
+ # Test adding the current working directory.
+ cwd = os.getcwd()
+ os.chdir(TEMPDIR)
+ try:
+ open("foo", "w").close()
+
+ tar = tarfile.open(tmpname, self.mode)
+ tar.add(".")
+ tar.close()
+
+ tar = tarfile.open(tmpname, "r")
+ for t in tar:
+ self.assert_(t.name == "." or t.name.startswith("./"))
+ tar.close()
+ finally:
+ os.chdir(cwd)
+
+ @unittest.skipUnless(hasattr(os, 'symlink'), "needs os.symlink")
+ def test_extractall_symlinks(self):
+ # Test if extractall works properly when tarfile contains symlinks
+ tempdir = os.path.join(TEMPDIR, "testsymlinks")
+ temparchive = os.path.join(TEMPDIR, "testsymlinks.tar")
+ os.mkdir(tempdir)
+ try:
+ source_file = os.path.join(tempdir,'source')
+ target_file = os.path.join(tempdir,'symlink')
+ with open(source_file,'w') as f:
+ f.write('something\n')
+ os.symlink(source_file, target_file)
+ tar = tarfile.open(temparchive,'w')
+ tar.add(source_file, arcname=os.path.basename(source_file))
+ tar.add(target_file, arcname=os.path.basename(target_file))
+ tar.close()
+ # Let's extract it to the location which contains the symlink
+ tar = tarfile.open(temparchive,'r')
+ # this should not raise OSError: [Errno 17] File exists
+ try:
+ tar.extractall(path=tempdir)
+ except OSError:
+ self.fail("extractall failed with symlinked files")
+ finally:
+ tar.close()
+ finally:
+ os.unlink(temparchive)
+ shutil.rmtree(tempdir)
+
+ @unittest.skipUnless(hasattr(os, 'symlink'), "needs os.symlink")
+ def test_extractall_broken_symlinks(self):
+ # Test if extractall works properly when tarfile contains broken
+ # symlinks
+ tempdir = os.path.join(TEMPDIR, "testsymlinks")
+ temparchive = os.path.join(TEMPDIR, "testsymlinks.tar")
+ os.mkdir(tempdir)
+ try:
+ source_file = os.path.join(tempdir,'source')
+ target_file = os.path.join(tempdir,'symlink')
+ with open(source_file,'w') as f:
+ f.write('something\n')
+ os.symlink(source_file, target_file)
+ tar = tarfile.open(temparchive,'w')
+ tar.add(target_file, arcname=os.path.basename(target_file))
+ tar.close()
+ # remove the real file
+ os.unlink(source_file)
+ # Let's extract it to the location which contains the symlink
+ tar = tarfile.open(temparchive,'r')
+ # this should not raise OSError: [Errno 17] File exists
+ try:
+ tar.extractall(path=tempdir)
+ except OSError:
+ self.fail("extractall failed with broken symlinked files")
+ finally:
+ tar.close()
+ finally:
+ os.unlink(temparchive)
+ shutil.rmtree(tempdir)
+
+ @unittest.skipUnless(hasattr(os, 'link'), "needs os.link")
+ def test_extractall_hardlinks(self):
+ # Test if extractall works properly when tarfile contains symlinks
+ tempdir = os.path.join(TEMPDIR, "testsymlinks")
+ temparchive = os.path.join(TEMPDIR, "testsymlinks.tar")
+ os.mkdir(tempdir)
+ try:
+ source_file = os.path.join(tempdir,'source')
+ target_file = os.path.join(tempdir,'symlink')
+ with open(source_file,'w') as f:
+ f.write('something\n')
+ os.link(source_file, target_file)
+ tar = tarfile.open(temparchive,'w')
+ tar.add(source_file, arcname=os.path.basename(source_file))
+ tar.add(target_file, arcname=os.path.basename(target_file))
+ tar.close()
+ # Let's extract it to the location which contains the symlink
+ tar = tarfile.open(temparchive,'r')
+ # this should not raise OSError: [Errno 17] File exists
+ try:
+ tar.extractall(path=tempdir)
+ except OSError:
+ self.fail("extractall failed with linked files")
+ finally:
+ tar.close()
+ finally:
+ os.unlink(temparchive)
+ shutil.rmtree(tempdir)
class StreamWriteTest(WriteTestBase):
@@ -697,14 +949,14 @@ class StreamWriteTest(WriteTestBase):
dec = bz2.BZ2Decompressor()
data = open(tmpname, "rb").read()
data = dec.decompress(data)
- self.assert_(len(dec.unused_data) == 0,
+ self.assertTrue(len(dec.unused_data) == 0,
"found trailing data")
else:
fobj = open(tmpname, "rb")
data = fobj.read()
fobj.close()
- self.assert_(data.count("\0") == tarfile.RECORDSIZE,
+ self.assertTrue(data.count("\0") == tarfile.RECORDSIZE,
"incorrect zero padding")
def test_file_mode(self):
@@ -762,16 +1014,18 @@ class GNUWriteTest(unittest.TestCase):
v1 = self._calc_size(name, link)
v2 = tar.offset
- self.assert_(v1 == v2, "GNU longname/longlink creation failed")
+ self.assertTrue(v1 == v2, "GNU longname/longlink creation failed")
tar.close()
tar = tarfile.open(tmpname)
member = tar.next()
- self.failIf(member is None, "unable to read longname member")
- self.assert_(tarinfo.name == member.name and \
- tarinfo.linkname == member.linkname, \
- "unable to read longname member")
+ self.assertIsNotNone(member,
+ "unable to read longname member")
+ self.assertEqual(tarinfo.name, member.name,
+ "unable to read longname member")
+ self.assertEqual(tarinfo.linkname, member.linkname,
+ "unable to read longname member")
def test_longname_1023(self):
self._test(("longnam/" * 127) + "longnam")
@@ -829,18 +1083,18 @@ class HardlinkTest(unittest.TestCase):
# The same name will be added as a REGTYPE every
# time regardless of st_nlink.
tarinfo = self.tar.gettarinfo(self.foo)
- self.assert_(tarinfo.type == tarfile.REGTYPE,
+ self.assertTrue(tarinfo.type == tarfile.REGTYPE,
"add file as regular failed")
def test_add_hardlink(self):
tarinfo = self.tar.gettarinfo(self.bar)
- self.assert_(tarinfo.type == tarfile.LNKTYPE,
+ self.assertTrue(tarinfo.type == tarfile.LNKTYPE,
"add file as hardlink failed")
def test_dereference_hardlink(self):
self.tar.dereference = True
tarinfo = self.tar.gettarinfo(self.bar)
- self.assert_(tarinfo.type == tarfile.REGTYPE,
+ self.assertTrue(tarinfo.type == tarfile.REGTYPE,
"dereferencing hardlink failed")
@@ -860,10 +1114,10 @@ class PaxWriteTest(GNUWriteTest):
tar = tarfile.open(tmpname)
if link:
l = tar.getmembers()[0].linkname
- self.assert_(link == l, "PAX longlink creation failed")
+ self.assertTrue(link == l, "PAX longlink creation failed")
else:
n = tar.getmembers()[0].name
- self.assert_(name == n, "PAX longname creation failed")
+ self.assertTrue(name == n, "PAX longname creation failed")
def test_pax_global_header(self):
pax_headers = {
@@ -873,7 +1127,7 @@ class PaxWriteTest(GNUWriteTest):
u"test": u"äöü",
u"äöü": u"test"}
- tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT, \
+ tar = tarfile.open(tmpname, "w", format=tarfile.PAX_FORMAT,
pax_headers=pax_headers)
tar.addfile(tarfile.TarInfo("test"))
tar.close()
@@ -885,8 +1139,8 @@ class PaxWriteTest(GNUWriteTest):
# Test if all the fields are unicode.
for key, val in tar.pax_headers.iteritems():
- self.assert_(type(key) is unicode)
- self.assert_(type(val) is unicode)
+ self.assertTrue(type(key) is unicode)
+ self.assertTrue(type(val) is unicode)
if key in tarfile.PAX_NUMBER_FIELDS:
try:
tarfile.PAX_NUMBER_FIELDS[key](val)
@@ -934,7 +1188,7 @@ class UstarUnicodeTest(unittest.TestCase):
tar.close()
tar = tarfile.open(tmpname, encoding=encoding)
- self.assert_(type(tar.getnames()[0]) is not unicode)
+ self.assertTrue(type(tar.getnames()[0]) is not unicode)
self.assertEqual(tar.getmembers()[0].name, name.encode(encoding))
tar.close()
@@ -958,10 +1212,10 @@ class UstarUnicodeTest(unittest.TestCase):
def test_unicode_argument(self):
tar = tarfile.open(tarname, "r", encoding="iso8859-1", errors="strict")
for t in tar:
- self.assert_(type(t.name) is str)
- self.assert_(type(t.linkname) is str)
- self.assert_(type(t.uname) is str)
- self.assert_(type(t.gname) is str)
+ self.assertTrue(type(t.name) is str)
+ self.assertTrue(type(t.linkname) is str)
+ self.assertTrue(type(t.uname) is str)
+ self.assertTrue(type(t.gname) is str)
tar.close()
def test_uname_unicode(self):
@@ -1053,12 +1307,12 @@ class AppendTest(unittest.TestCase):
self._test()
def test_empty(self):
- open(self.tarname, "w").close()
+ tarfile.open(self.tarname, "w:").close()
self._add_testfile()
self._test()
def test_empty_fileobj(self):
- fobj = StringIO.StringIO()
+ fobj = StringIO.StringIO("\0" * 1024)
self._add_testfile(fobj)
fobj.seek(0)
self._test(fileobj=fobj)
@@ -1088,6 +1342,29 @@ class AppendTest(unittest.TestCase):
self._create_testtar("w:bz2")
self.assertRaises(tarfile.ReadError, tarfile.open, tmpname, "a")
+ # Append mode is supposed to fail if the tarfile to append to
+ # does not end with a zero block.
+ def _test_error(self, data):
+ open(self.tarname, "wb").write(data)
+ self.assertRaises(tarfile.ReadError, self._add_testfile)
+
+ def test_null(self):
+ self._test_error("")
+
+ def test_incomplete(self):
+ self._test_error("\0" * 13)
+
+ def test_premature_eof(self):
+ data = tarfile.TarInfo("foo").tobuf()
+ self._test_error(data)
+
+ def test_trailing_garbage(self):
+ data = tarfile.TarInfo("foo").tobuf()
+ self._test_error(data + "\0" * 13)
+
+ def test_invalid(self):
+ self._test_error("a" * 512)
+
class LimitsTest(unittest.TestCase):
@@ -1148,6 +1425,88 @@ class LimitsTest(unittest.TestCase):
tarinfo.tobuf(tarfile.PAX_FORMAT)
+class ContextManagerTest(unittest.TestCase):
+
+ def test_basic(self):
+ with tarfile.open(tarname) as tar:
+ self.assertFalse(tar.closed, "closed inside runtime context")
+ self.assertTrue(tar.closed, "context manager failed")
+
+ def test_closed(self):
+ # The __enter__() method is supposed to raise IOError
+ # if the TarFile object is already closed.
+ tar = tarfile.open(tarname)
+ tar.close()
+ with self.assertRaises(IOError):
+ with tar:
+ pass
+
+ def test_exception(self):
+ # Test if the IOError exception is passed through properly.
+ with self.assertRaises(Exception) as exc:
+ with tarfile.open(tarname) as tar:
+ raise IOError
+ self.assertIsInstance(exc.exception, IOError,
+ "wrong exception raised in context manager")
+ self.assertTrue(tar.closed, "context manager failed")
+
+ def test_no_eof(self):
+ # __exit__() must not write end-of-archive blocks if an
+ # exception was raised.
+ try:
+ with tarfile.open(tmpname, "w") as tar:
+ raise Exception
+ except:
+ pass
+ self.assertEqual(os.path.getsize(tmpname), 0,
+ "context manager wrote an end-of-archive block")
+ self.assertTrue(tar.closed, "context manager failed")
+
+ def test_eof(self):
+ # __exit__() must write end-of-archive blocks, i.e. call
+ # TarFile.close() if there was no error.
+ with tarfile.open(tmpname, "w"):
+ pass
+ self.assertNotEqual(os.path.getsize(tmpname), 0,
+ "context manager wrote no end-of-archive block")
+
+ def test_fileobj(self):
+ # Test that __exit__() did not close the external file
+ # object.
+ fobj = open(tmpname, "wb")
+ try:
+ with tarfile.open(fileobj=fobj, mode="w") as tar:
+ raise Exception
+ except:
+ pass
+ self.assertFalse(fobj.closed, "external file object was closed")
+ self.assertTrue(tar.closed, "context manager failed")
+ fobj.close()
+
+
+class LinkEmulationTest(ReadTest):
+
+ # Test for issue #8741 regression. On platforms that do not support
+ # symbolic or hard links tarfile tries to extract these types of members as
+ # the regular files they point to.
+ def _test_link_extraction(self, name):
+ self.tar.extract(name, TEMPDIR)
+ data = open(os.path.join(TEMPDIR, name), "rb").read()
+ self.assertEqual(md5sum(data), md5_regtype)
+
+ def test_hardlink_extraction1(self):
+ self._test_link_extraction("ustar/lnktype")
+
+ def test_hardlink_extraction2(self):
+ self._test_link_extraction("./ustar/linktest2/lnktype")
+
+ def test_symlink_extraction1(self):
+ self._test_link_extraction("ustar/symtype")
+
+ def test_symlink_extraction2(self):
+ self._test_link_extraction("./ustar/linktest2/symtype")
+
+
class GzipMiscReadTest(MiscReadTest):
tarname = gzipname
mode = "r:gz"
@@ -1189,10 +1548,16 @@ class Bz2PartialReadTest(unittest.TestCase):
raise AssertionError("infinite loop detected in tarfile.open()")
self.hit_eof = self.pos == self.len
return StringIO.StringIO.read(self, n)
+ def seek(self, *args):
+ self.hit_eof = False
+ return StringIO.StringIO.seek(self, *args)
data = bz2.compress(tarfile.TarInfo("foo").tobuf())
for x in range(len(data) + 1):
- tarfile.open(fileobj=MyStringIO(data[:x]), mode=mode)
+ try:
+ tarfile.open(fileobj=MyStringIO(data[:x]), mode=mode)
+ except tarfile.ReadError:
+ pass # we have no interest in ReadErrors
def test_partial_input(self):
self._test_partial_input("r")
@@ -1221,10 +1586,13 @@ def test_main():
PaxUnicodeTest,
AppendTest,
LimitsTest,
+ ContextManagerTest,
]
if hasattr(os, "link"):
tests.append(HardlinkTest)
+ else:
+ tests.append(LinkEmulationTest)
fobj = open(tarname, "rb")
data = fobj.read()
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index 6a87ce203f..e8ba58fdd6 100644
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -3,9 +3,21 @@
import unittest
import os
from test import test_support
+
+# Skip this test if the _tkinter module wasn't built.
+_tkinter = test_support.import_module('_tkinter')
+
from Tkinter import Tcl
from _tkinter import TclError
+
+class TkinterTest(unittest.TestCase):
+
+ def testFlattenLen(self):
+ # flatten(<object with no length>)
+ self.assertRaises(TypeError, _tkinter._flatten, True)
+
+
class TclTest(unittest.TestCase):
def setUp(self):
@@ -115,41 +127,6 @@ class TclTest(unittest.TestCase):
tcl = self.interp
self.assertRaises(TclError,tcl.eval,'package require DNE')
- def testLoadTk(self):
- import os
- if 'DISPLAY' not in os.environ:
- # skipping test of clean upgradeability
- return
- tcl = Tcl()
- self.assertRaises(TclError,tcl.winfo_geometry)
- tcl.loadtk()
- self.assertEqual('1x1+0+0', tcl.winfo_geometry())
- tcl.destroy()
-
- def testLoadTkFailure(self):
- import os
- old_display = None
- import sys
- if sys.platform.startswith(('win', 'darwin', 'cygwin')):
- return # no failure possible on windows?
- if 'DISPLAY' in os.environ:
- old_display = os.environ['DISPLAY']
- del os.environ['DISPLAY']
- # on some platforms, deleting environment variables
- # doesn't actually carry through to the process level
- # because they don't support unsetenv
- # If that's the case, abort.
- display = os.popen('echo $DISPLAY').read().strip()
- if display:
- return
- try:
- tcl = Tcl()
- self.assertRaises(TclError, tcl.winfo_geometry)
- self.assertRaises(TclError, tcl.loadtk)
- finally:
- if old_display is not None:
- os.environ['DISPLAY'] = old_display
-
def testLoadWithUNC(self):
import sys
if sys.platform != 'win32':
@@ -170,13 +147,14 @@ class TclTest(unittest.TestCase):
env.unset("TCL_LIBRARY")
f = os.popen('%s -c "import Tkinter; print Tkinter"' % (unc_name,))
- self.assert_('Tkinter.py' in f.read())
+ self.assertTrue('Tkinter.py' in f.read())
# exit code must be zero
self.assertEqual(f.close(), None)
+
def test_main():
- test_support.run_unittest(TclTest)
+ test_support.run_unittest(TclTest, TkinterTest)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_telnetlib.py b/Lib/test/test_telnetlib.py
index 838f6fb490..e40c1fe421 100644
--- a/Lib/test/test_telnetlib.py
+++ b/Lib/test/test_telnetlib.py
@@ -1,20 +1,43 @@
import socket
-import threading
import telnetlib
import time
+import Queue
from unittest import TestCase
from test import test_support
+threading = test_support.import_module('threading')
HOST = test_support.HOST
+EOF_sigil = object()
-def server(evt, serv):
+def server(evt, serv, dataq=None):
+ """ Open a tcp server in three steps
+ 1) set evt to true to let the parent know we are ready
+ 2) [optional] if is not False, write the list of data from dataq.get()
+ to the socket.
+ 3) set evt to true to let the parent know we're done
+ """
serv.listen(5)
evt.set()
try:
conn, addr = serv.accept()
+ if dataq:
+ data = ''
+ new_data = dataq.get(True, 0.5)
+ dataq.task_done()
+ for item in new_data:
+ if item == EOF_sigil:
+ break
+ if type(item) in [int, float]:
+ time.sleep(item)
+ else:
+ data += item
+ written = conn.send(data)
+ data = data[written:]
except socket.timeout:
pass
+ else:
+ conn.close()
finally:
serv.close()
evt.set()
@@ -26,13 +49,15 @@ class GeneralTests(TestCase):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.settimeout(3)
self.port = test_support.bind_port(self.sock)
- threading.Thread(target=server, args=(self.evt,self.sock)).start()
+ self.thread = threading.Thread(target=server, args=(self.evt,self.sock))
+ self.thread.start()
self.evt.wait()
self.evt.clear()
time.sleep(.1)
def tearDown(self):
self.evt.wait()
+ self.thread.join()
def testBasic(self):
# connects
@@ -71,9 +96,277 @@ class GeneralTests(TestCase):
self.assertEqual(telnet.sock.gettimeout(), 30)
telnet.sock.close()
+def _read_setUp(self):
+ self.evt = threading.Event()
+ self.dataq = Queue.Queue()
+ self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.sock.settimeout(3)
+ self.port = test_support.bind_port(self.sock)
+ self.thread = threading.Thread(target=server, args=(self.evt,self.sock, self.dataq))
+ self.thread.start()
+ self.evt.wait()
+ self.evt.clear()
+ time.sleep(.1)
+
+def _read_tearDown(self):
+ self.evt.wait()
+ self.thread.join()
+
+class ReadTests(TestCase):
+ setUp = _read_setUp
+ tearDown = _read_tearDown
+
+ # use a similar approach to testing timeouts as test_timeout.py
+ # these will never pass 100% but make the fuzz big enough that it is rare
+ block_long = 0.6
+ block_short = 0.3
+ def test_read_until_A(self):
+ """
+ read_until(expected, [timeout])
+ Read until the expected string has been seen, or a timeout is
+ hit (default is no timeout); may block.
+ """
+ want = ['x' * 10, 'match', 'y' * 10, EOF_sigil]
+ self.dataq.put(want)
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ data = telnet.read_until('match')
+ self.assertEqual(data, ''.join(want[:-2]))
+
+ def test_read_until_B(self):
+ # test the timeout - it does NOT raise socket.timeout
+ want = ['hello', self.block_long, 'not seen', EOF_sigil]
+ self.dataq.put(want)
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ data = telnet.read_until('not seen', self.block_short)
+ self.assertEqual(data, want[0])
+ self.assertEqual(telnet.read_all(), 'not seen')
+
+ def test_read_all_A(self):
+ """
+ read_all()
+ Read all data until EOF; may block.
+ """
+ want = ['x' * 500, 'y' * 500, 'z' * 500, EOF_sigil]
+ self.dataq.put(want)
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ data = telnet.read_all()
+ self.assertEqual(data, ''.join(want[:-1]))
+ return
+
+ def _test_blocking(self, func):
+ self.dataq.put([self.block_long, EOF_sigil])
+ self.dataq.join()
+ start = time.time()
+ data = func()
+ self.assertTrue(self.block_short <= time.time() - start)
+
+ def test_read_all_B(self):
+ self._test_blocking(telnetlib.Telnet(HOST, self.port).read_all)
+
+ def test_read_all_C(self):
+ self.dataq.put([EOF_sigil])
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ telnet.read_all()
+ telnet.read_all() # shouldn't raise
+
+ def test_read_some_A(self):
+ """
+ read_some()
+ Read at least one byte or EOF; may block.
+ """
+ # test 'at least one byte'
+ want = ['x' * 500, EOF_sigil]
+ self.dataq.put(want)
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ data = telnet.read_all()
+ self.assertTrue(len(data) >= 1)
+
+ def test_read_some_B(self):
+ # test EOF
+ self.dataq.put([EOF_sigil])
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ self.assertEqual('', telnet.read_some())
+
+ def test_read_some_C(self):
+ self._test_blocking(telnetlib.Telnet(HOST, self.port).read_some)
+
+ def _test_read_any_eager_A(self, func_name):
+ """
+ read_very_eager()
+ Read all data available already queued or on the socket,
+ without blocking.
+ """
+ want = [self.block_long, 'x' * 100, 'y' * 100, EOF_sigil]
+ expects = want[1] + want[2]
+ self.dataq.put(want)
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ func = getattr(telnet, func_name)
+ data = ''
+ while True:
+ try:
+ data += func()
+ self.assertTrue(expects.startswith(data))
+ except EOFError:
+ break
+ self.assertEqual(expects, data)
+
+ def _test_read_any_eager_B(self, func_name):
+ # test EOF
+ self.dataq.put([EOF_sigil])
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ time.sleep(self.block_short)
+ func = getattr(telnet, func_name)
+ self.assertRaises(EOFError, func)
+
+ # read_eager and read_very_eager make the same gaurantees
+ # (they behave differently but we only test the gaurantees)
+ def test_read_very_eager_A(self):
+ self._test_read_any_eager_A('read_very_eager')
+ def test_read_very_eager_B(self):
+ self._test_read_any_eager_B('read_very_eager')
+ def test_read_eager_A(self):
+ self._test_read_any_eager_A('read_eager')
+ def test_read_eager_B(self):
+ self._test_read_any_eager_B('read_eager')
+ # NB -- we need to test the IAC block which is mentioned in the docstring
+ # but not in the module docs
+
+ def _test_read_any_lazy_B(self, func_name):
+ self.dataq.put([EOF_sigil])
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ func = getattr(telnet, func_name)
+ telnet.fill_rawq()
+ self.assertRaises(EOFError, func)
+
+ def test_read_lazy_A(self):
+ want = ['x' * 100, EOF_sigil]
+ self.dataq.put(want)
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ time.sleep(self.block_short)
+ self.assertEqual('', telnet.read_lazy())
+ data = ''
+ while True:
+ try:
+ read_data = telnet.read_lazy()
+ data += read_data
+ if not read_data:
+ telnet.fill_rawq()
+ except EOFError:
+ break
+ self.assertTrue(want[0].startswith(data))
+ self.assertEqual(data, want[0])
+
+ def test_read_lazy_B(self):
+ self._test_read_any_lazy_B('read_lazy')
+
+ def test_read_very_lazy_A(self):
+ want = ['x' * 100, EOF_sigil]
+ self.dataq.put(want)
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ time.sleep(self.block_short)
+ self.assertEqual('', telnet.read_very_lazy())
+ data = ''
+ while True:
+ try:
+ read_data = telnet.read_very_lazy()
+ except EOFError:
+ break
+ data += read_data
+ if not read_data:
+ telnet.fill_rawq()
+ self.assertEqual('', telnet.cookedq)
+ telnet.process_rawq()
+ self.assertTrue(want[0].startswith(data))
+ self.assertEqual(data, want[0])
+
+ def test_read_very_lazy_B(self):
+ self._test_read_any_lazy_B('read_very_lazy')
+
+class nego_collector(object):
+ def __init__(self, sb_getter=None):
+ self.seen = ''
+ self.sb_getter = sb_getter
+ self.sb_seen = ''
+
+ def do_nego(self, sock, cmd, opt):
+ self.seen += cmd + opt
+ if cmd == tl.SE and self.sb_getter:
+ sb_data = self.sb_getter()
+ self.sb_seen += sb_data
+
+tl = telnetlib
+class OptionTests(TestCase):
+ setUp = _read_setUp
+ tearDown = _read_tearDown
+ # RFC 854 commands
+ cmds = [tl.AO, tl.AYT, tl.BRK, tl.EC, tl.EL, tl.GA, tl.IP, tl.NOP]
+
+ def _test_command(self, data):
+ """ helper for testing IAC + cmd """
+ self.setUp()
+ self.dataq.put(data)
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ nego = nego_collector()
+ telnet.set_option_negotiation_callback(nego.do_nego)
+ txt = telnet.read_all()
+ cmd = nego.seen
+ self.assertTrue(len(cmd) > 0) # we expect at least one command
+ self.assertIn(cmd[0], self.cmds)
+ self.assertEqual(cmd[1], tl.NOOPT)
+ self.assertEqual(len(''.join(data[:-1])), len(txt + cmd))
+ nego.sb_getter = None # break the nego => telnet cycle
+ self.tearDown()
+
+ def test_IAC_commands(self):
+ # reset our setup
+ self.dataq.put([EOF_sigil])
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ self.tearDown()
+
+ for cmd in self.cmds:
+ self._test_command(['x' * 100, tl.IAC + cmd, 'y'*100, EOF_sigil])
+ self._test_command(['x' * 10, tl.IAC + cmd, 'y'*10, EOF_sigil])
+ self._test_command([tl.IAC + cmd, EOF_sigil])
+ # all at once
+ self._test_command([tl.IAC + cmd for (cmd) in self.cmds] + [EOF_sigil])
+ self.assertEqual('', telnet.read_sb_data())
+
+ def test_SB_commands(self):
+ # RFC 855, subnegotiations portion
+ send = [tl.IAC + tl.SB + tl.IAC + tl.SE,
+ tl.IAC + tl.SB + tl.IAC + tl.IAC + tl.IAC + tl.SE,
+ tl.IAC + tl.SB + tl.IAC + tl.IAC + 'aa' + tl.IAC + tl.SE,
+ tl.IAC + tl.SB + 'bb' + tl.IAC + tl.IAC + tl.IAC + tl.SE,
+ tl.IAC + tl.SB + 'cc' + tl.IAC + tl.IAC + 'dd' + tl.IAC + tl.SE,
+ EOF_sigil,
+ ]
+ self.dataq.put(send)
+ telnet = telnetlib.Telnet(HOST, self.port)
+ self.dataq.join()
+ nego = nego_collector(telnet.read_sb_data)
+ telnet.set_option_negotiation_callback(nego.do_nego)
+ txt = telnet.read_all()
+ self.assertEqual(txt, '')
+ want_sb_data = tl.IAC + tl.IAC + 'aabb' + tl.IAC + 'cc' + tl.IAC + 'dd'
+ self.assertEqual(nego.sb_seen, want_sb_data)
+ self.assertEqual('', telnet.read_sb_data())
+ nego.sb_getter = None # break the nego => telnet cycle
def test_main(verbose=None):
- test_support.run_unittest(GeneralTests)
+ test_support.run_unittest(GeneralTests, ReadTests, OptionTests)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index 6101431954..b50214a75a 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -3,7 +3,6 @@ import tempfile
import os
import sys
import re
-import errno
import warnings
import unittest
@@ -24,9 +23,7 @@ has_spawnl = hasattr(os, 'spawnl')
# TEST_FILES may need to be tweaked for systems depending on the maximum
# number of files that can be opened at one time (see ulimit -n)
-if sys.platform == 'mac':
- TEST_FILES = 32
-elif sys.platform in ('openbsd3', 'openbsd4'):
+if sys.platform in ('openbsd3', 'openbsd4'):
TEST_FILES = 48
else:
TEST_FILES = 100
@@ -59,7 +56,7 @@ class TC(unittest.TestCase):
"file '%s' does not end with '%s'" % (nbase, suf))
nbase = nbase[len(pre):len(nbase)-len(suf)]
- self.assert_(self.str_check.match(nbase),
+ self.assertTrue(self.str_check.match(nbase),
"random string '%s' does not match /^[a-zA-Z0-9_-]{6}$/"
% nbase)
@@ -88,7 +85,7 @@ class test_exports(TC):
for key in dict:
if key[0] != '_' and key not in expected:
unexp.append(key)
- self.failUnless(len(unexp) == 0,
+ self.assertTrue(len(unexp) == 0,
"unexpected keys: %s" % unexp)
test_classes.append(test_exports)
@@ -113,7 +110,7 @@ class test__RandomNameSequence(TC):
for i in xrange(TEST_FILES):
s = r.next()
self.nameCheck(s, '', '', '')
- self.failIf(s in dict)
+ self.assertNotIn(s, dict)
dict[s] = 1
def test_supports_iter(self):
@@ -140,10 +137,9 @@ class test__candidate_tempdir_list(TC):
cand = tempfile._candidate_tempdir_list()
- self.failIf(len(cand) == 0)
+ self.assertFalse(len(cand) == 0)
for c in cand:
- self.assert_(isinstance(c, basestring),
- "%s is not a string" % c)
+ self.assertIsInstance(c, basestring)
def test_wanted_dirs(self):
# _candidate_tempdir_list contains the expected directories
@@ -153,21 +149,21 @@ class test__candidate_tempdir_list(TC):
for envname in 'TMPDIR', 'TEMP', 'TMP':
dirname = os.getenv(envname)
if not dirname:
- env.set(envname, os.path.abspath(envname))
+ env[envname] = os.path.abspath(envname)
cand = tempfile._candidate_tempdir_list()
for envname in 'TMPDIR', 'TEMP', 'TMP':
dirname = os.getenv(envname)
if not dirname: raise ValueError
- self.assert_(dirname in cand)
+ self.assertIn(dirname, cand)
try:
dirname = os.getcwd()
except (AttributeError, os.error):
dirname = os.curdir
- self.assert_(dirname in cand)
+ self.assertIn(dirname, cand)
# Not practical to try to verify the presence of OS-specific
# paths in this list.
@@ -184,14 +180,14 @@ class test__get_candidate_names(TC):
def test_retval(self):
# _get_candidate_names returns a _RandomNameSequence object
obj = tempfile._get_candidate_names()
- self.assert_(isinstance(obj, tempfile._RandomNameSequence))
+ self.assertIsInstance(obj, tempfile._RandomNameSequence)
def test_same_thing(self):
# _get_candidate_names always returns the same object
a = tempfile._get_candidate_names()
b = tempfile._get_candidate_names()
- self.assert_(a is b)
+ self.assertTrue(a is b)
test_classes.append(test__get_candidate_names)
@@ -254,12 +250,12 @@ class test__mkstemp_inner(TC):
def test_file_mode(self):
# _mkstemp_inner creates files with the proper mode
if not has_stat:
- return # ugh, can't use TestSkipped.
+ return # ugh, can't use SkipTest.
file = self.do_create()
mode = stat.S_IMODE(os.stat(file.name).st_mode)
expected = 0600
- if sys.platform in ('win32', 'os2emx', 'mac'):
+ if sys.platform in ('win32', 'os2emx'):
# There's no distinction among 'user', 'group' and 'world';
# replicate the 'user' bits.
user = expected >> 6
@@ -269,7 +265,7 @@ class test__mkstemp_inner(TC):
def test_noinherit(self):
# _mkstemp_inner file handles are not inherited by child processes
if not has_spawnl:
- return # ugh, can't use TestSkipped.
+ return # ugh, can't use SkipTest.
if test_support.verbose:
v="v"
@@ -300,14 +296,14 @@ class test__mkstemp_inner(TC):
decorated = sys.executable
retval = os.spawnl(os.P_WAIT, sys.executable, decorated, tester, v, fd)
- self.failIf(retval < 0,
+ self.assertFalse(retval < 0,
"child process caught fatal signal %d" % -retval)
- self.failIf(retval > 0, "child process reports failure %d"%retval)
+ self.assertFalse(retval > 0, "child process reports failure %d"%retval)
def test_textmode(self):
# _mkstemp_inner can create files in text mode
if not has_textmode:
- return # ugh, can't use TestSkipped.
+ return # ugh, can't use SkipTest.
self.do_create(bin=0).write("blat\n")
# XXX should test that the file really is a text file
@@ -322,8 +318,8 @@ class test_gettempprefix(TC):
# gettempprefix returns a nonempty prefix string
p = tempfile.gettempprefix()
- self.assert_(isinstance(p, basestring))
- self.assert_(len(p) > 0)
+ self.assertIsInstance(p, basestring)
+ self.assertTrue(len(p) > 0)
def test_usable_template(self):
# gettempprefix returns a usable prefix string
@@ -354,9 +350,9 @@ class test_gettempdir(TC):
# gettempdir returns a directory which exists
dir = tempfile.gettempdir()
- self.assert_(os.path.isabs(dir) or dir == os.curdir,
+ self.assertTrue(os.path.isabs(dir) or dir == os.curdir,
"%s is not an absolute path" % dir)
- self.assert_(os.path.isdir(dir),
+ self.assertTrue(os.path.isdir(dir),
"%s is not a directory" % dir)
def test_directory_writable(self):
@@ -377,7 +373,7 @@ class test_gettempdir(TC):
a = tempfile.gettempdir()
b = tempfile.gettempdir()
- self.assert_(a is b)
+ self.assertTrue(a is b)
test_classes.append(test_gettempdir)
@@ -471,14 +467,14 @@ class test_mkdtemp(TC):
def test_mode(self):
# mkdtemp creates directories with the proper mode
if not has_stat:
- return # ugh, can't use TestSkipped.
+ return # ugh, can't use SkipTest.
dir = self.do_create()
try:
mode = stat.S_IMODE(os.stat(dir).st_mode)
mode &= 0777 # Mask off sticky bits inherited from /tmp
expected = 0700
- if sys.platform in ('win32', 'os2emx', 'mac'):
+ if sys.platform in ('win32', 'os2emx'):
# There's no distinction among 'user', 'group' and 'world';
# replicate the 'user' bits.
user = expected >> 6
@@ -580,7 +576,7 @@ class test_NamedTemporaryFile(TC):
def test_creates_named(self):
# NamedTemporaryFile creates files with names
f = tempfile.NamedTemporaryFile()
- self.failUnless(os.path.exists(f.name),
+ self.assertTrue(os.path.exists(f.name),
"NamedTemporaryFile %s does not exist" % f.name)
def test_del_on_close(self):
@@ -590,7 +586,7 @@ class test_NamedTemporaryFile(TC):
f = tempfile.NamedTemporaryFile(dir=dir)
f.write('blat')
f.close()
- self.failIf(os.path.exists(f.name),
+ self.assertFalse(os.path.exists(f.name),
"NamedTemporaryFile %s exists after close" % f.name)
finally:
os.rmdir(dir)
@@ -604,7 +600,7 @@ class test_NamedTemporaryFile(TC):
tmp = f.name
f.write('blat')
f.close()
- self.failUnless(os.path.exists(f.name),
+ self.assertTrue(os.path.exists(f.name),
"NamedTemporaryFile %s missing after close" % f.name)
finally:
if tmp is not None:
@@ -625,12 +621,12 @@ class test_NamedTemporaryFile(TC):
def test_context_manager(self):
# A NamedTemporaryFile can be used as a context manager
with tempfile.NamedTemporaryFile() as f:
- self.failUnless(os.path.exists(f.name))
- self.failIf(os.path.exists(f.name))
+ self.assertTrue(os.path.exists(f.name))
+ self.assertFalse(os.path.exists(f.name))
def use_closed():
with f:
pass
- self.failUnlessRaises(ValueError, use_closed)
+ self.assertRaises(ValueError, use_closed)
# How to test the mode and bufsize parameters?
@@ -653,21 +649,21 @@ class test_SpooledTemporaryFile(TC):
def test_basic(self):
# SpooledTemporaryFile can create files
f = self.do_create()
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
f = self.do_create(max_size=100, pre="a", suf=".txt")
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
def test_del_on_close(self):
# A SpooledTemporaryFile is deleted when closed
dir = tempfile.mkdtemp()
try:
f = tempfile.SpooledTemporaryFile(max_size=10, dir=dir)
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
f.write('blat ' * 5)
- self.failUnless(f._rolled)
+ self.assertTrue(f._rolled)
filename = f.name
f.close()
- self.failIf(os.path.exists(filename),
+ self.assertFalse(os.path.exists(filename),
"SpooledTemporaryFile %s exists after close" % filename)
finally:
os.rmdir(dir)
@@ -675,46 +671,63 @@ class test_SpooledTemporaryFile(TC):
def test_rewrite_small(self):
# A SpooledTemporaryFile can be written to multiple within the max_size
f = self.do_create(max_size=30)
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
for i in range(5):
f.seek(0, 0)
f.write('x' * 20)
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
def test_write_sequential(self):
# A SpooledTemporaryFile should hold exactly max_size bytes, and roll
# over afterward
f = self.do_create(max_size=30)
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
f.write('x' * 20)
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
f.write('x' * 10)
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
f.write('x')
- self.failUnless(f._rolled)
+ self.assertTrue(f._rolled)
+
+ def test_writelines(self):
+ # Verify writelines with a SpooledTemporaryFile
+ f = self.do_create()
+ f.writelines((b'x', b'y', b'z'))
+ f.seek(0)
+ buf = f.read()
+ self.assertEqual(buf, b'xyz')
+
+ def test_writelines_sequential(self):
+ # A SpooledTemporaryFile should hold exactly max_size bytes, and roll
+ # over afterward
+ f = self.do_create(max_size=35)
+ f.writelines((b'x' * 20, b'x' * 10, b'x' * 5))
+ self.assertFalse(f._rolled)
+ f.write(b'x')
+ self.assertTrue(f._rolled)
def test_sparse(self):
# A SpooledTemporaryFile that is written late in the file will extend
# when that occurs
f = self.do_create(max_size=30)
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
f.seek(100, 0)
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
f.write('x')
- self.failUnless(f._rolled)
+ self.assertTrue(f._rolled)
def test_fileno(self):
# A SpooledTemporaryFile should roll over to a real file on fileno()
f = self.do_create(max_size=30)
- self.failIf(f._rolled)
- self.failUnless(f.fileno() > 0)
- self.failUnless(f._rolled)
+ self.assertFalse(f._rolled)
+ self.assertTrue(f.fileno() > 0)
+ self.assertTrue(f._rolled)
def test_multiple_close_before_rollover(self):
# A SpooledTemporaryFile can be closed many times without error
f = tempfile.SpooledTemporaryFile()
f.write('abc\n')
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
f.close()
try:
f.close()
@@ -726,7 +739,7 @@ class test_SpooledTemporaryFile(TC):
# A SpooledTemporaryFile can be closed many times without error
f = tempfile.SpooledTemporaryFile(max_size=1)
f.write('abc\n')
- self.failUnless(f._rolled)
+ self.assertTrue(f._rolled)
f.close()
try:
f.close()
@@ -746,46 +759,46 @@ class test_SpooledTemporaryFile(TC):
write("a" * 35)
write("b" * 35)
seek(0, 0)
- self.failUnless(read(70) == 'a'*35 + 'b'*35)
+ self.assertTrue(read(70) == 'a'*35 + 'b'*35)
def test_context_manager_before_rollover(self):
# A SpooledTemporaryFile can be used as a context manager
with tempfile.SpooledTemporaryFile(max_size=1) as f:
- self.failIf(f._rolled)
- self.failIf(f.closed)
- self.failUnless(f.closed)
+ self.assertFalse(f._rolled)
+ self.assertFalse(f.closed)
+ self.assertTrue(f.closed)
def use_closed():
with f:
pass
- self.failUnlessRaises(ValueError, use_closed)
+ self.assertRaises(ValueError, use_closed)
def test_context_manager_during_rollover(self):
# A SpooledTemporaryFile can be used as a context manager
with tempfile.SpooledTemporaryFile(max_size=1) as f:
- self.failIf(f._rolled)
+ self.assertFalse(f._rolled)
f.write('abc\n')
f.flush()
- self.failUnless(f._rolled)
- self.failIf(f.closed)
- self.failUnless(f.closed)
+ self.assertTrue(f._rolled)
+ self.assertFalse(f.closed)
+ self.assertTrue(f.closed)
def use_closed():
with f:
pass
- self.failUnlessRaises(ValueError, use_closed)
+ self.assertRaises(ValueError, use_closed)
def test_context_manager_after_rollover(self):
# A SpooledTemporaryFile can be used as a context manager
f = tempfile.SpooledTemporaryFile(max_size=1)
f.write('abc\n')
f.flush()
- self.failUnless(f._rolled)
+ self.assertTrue(f._rolled)
with f:
- self.failIf(f.closed)
- self.failUnless(f.closed)
+ self.assertFalse(f.closed)
+ self.assertTrue(f.closed)
def use_closed():
with f:
pass
- self.failUnlessRaises(ValueError, use_closed)
+ self.assertRaises(ValueError, use_closed)
test_classes.append(test_SpooledTemporaryFile)
diff --git a/Lib/test/test_textwrap.py b/Lib/test/test_textwrap.py
index c91e242dfd..63a54d9f21 100644
--- a/Lib/test/test_textwrap.py
+++ b/Lib/test/test_textwrap.py
@@ -29,7 +29,7 @@ class BaseTestCase(unittest.TestCase):
def check(self, result, expect):
- self.assertEquals(result, expect,
+ self.assertEqual(result, expect,
'expected:\n%s\nbut got:\n%s' % (
self.show(expect), self.show(result)))
@@ -39,9 +39,9 @@ class BaseTestCase(unittest.TestCase):
def check_split(self, text, expect):
result = self.wrapper._split(text)
- self.assertEquals(result, expect,
- "\nexpected %r\n"
- "but got %r" % (expect, result))
+ self.assertEqual(result, expect,
+ "\nexpected %r\n"
+ "but got %r" % (expect, result))
class WrapTestCase(BaseTestCase):
@@ -349,9 +349,10 @@ What a mess!
self.check_wrap(text, 50, [u"Hello there, how are you today?"])
self.check_wrap(text, 20, [u"Hello there, how are", "you today?"])
olines = self.wrapper.wrap(text)
- assert isinstance(olines, list) and isinstance(olines[0], unicode)
+ self.assertIsInstance(olines, list)
+ self.assertIsInstance(olines[0], unicode)
otext = self.wrapper.fill(text)
- assert isinstance(otext, unicode)
+ self.assertIsInstance(otext, unicode)
def test_no_split_at_umlaut(self):
text = u"Die Empf\xe4nger-Auswahl"
@@ -503,7 +504,7 @@ class DedentTestCase(unittest.TestCase):
def assertUnchanged(self, text):
"""assert that dedent() has no effect on 'text'"""
- self.assertEquals(text, dedent(text))
+ self.assertEqual(text, dedent(text))
def test_dedent_nomargin(self):
# No lines indented.
@@ -526,17 +527,17 @@ class DedentTestCase(unittest.TestCase):
# All lines indented by two spaces.
text = " Hello there.\n How are ya?\n Oh good."
expect = "Hello there.\nHow are ya?\nOh good."
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
# Same, with blank lines.
text = " Hello there.\n\n How are ya?\n Oh good.\n"
expect = "Hello there.\n\nHow are ya?\nOh good.\n"
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
# Now indent one of the blank lines.
text = " Hello there.\n \n How are ya?\n Oh good.\n"
expect = "Hello there.\n\nHow are ya?\nOh good.\n"
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
def test_dedent_uneven(self):
# Lines indented unevenly.
@@ -550,27 +551,27 @@ def foo():
while 1:
return foo
'''
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
# Uneven indentation with a blank line.
text = " Foo\n Bar\n\n Baz\n"
expect = "Foo\n Bar\n\n Baz\n"
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
# Uneven indentation with a whitespace-only line.
text = " Foo\n Bar\n \n Baz\n"
expect = "Foo\n Bar\n\n Baz\n"
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
# dedent() should not mangle internal tabs
def test_dedent_preserve_internal_tabs(self):
text = " hello\tthere\n how are\tyou?"
expect = "hello\tthere\nhow are\tyou?"
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
# make sure that it preserves tabs when it's not making any
# changes at all
- self.assertEquals(expect, dedent(expect))
+ self.assertEqual(expect, dedent(expect))
# dedent() should not mangle tabs in the margin (i.e.
# tabs and spaces both count as margin, but are *not*
@@ -586,17 +587,17 @@ def foo():
# dedent() only removes whitespace that can be uniformly removed!
text = "\thello there\n\thow are you?"
expect = "hello there\nhow are you?"
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
text = " \thello there\n \thow are you?"
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
text = " \t hello there\n \t how are you?"
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
text = " \thello there\n \t how are you?"
expect = "hello there\n how are you?"
- self.assertEquals(expect, dedent(text))
+ self.assertEqual(expect, dedent(text))
def test_main():
diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py
index 4d2c06ef10..544e70d2fd 100644
--- a/Lib/test/test_thread.py
+++ b/Lib/test/test_thread.py
@@ -2,9 +2,10 @@ import os
import unittest
import random
from test import test_support
-import thread
+thread = test_support.import_module('thread')
import time
import sys
+import weakref
from test import lock_tests
@@ -64,10 +65,10 @@ class ThreadRunningTests(BasicThreadTest):
def test_stack_size(self):
# Various stack size tests.
- self.assertEquals(thread.stack_size(), 0, "intial stack size is not 0")
+ self.assertEqual(thread.stack_size(), 0, "initial stack size is not 0")
thread.stack_size(0)
- self.assertEquals(thread.stack_size(), 0, "stack_size not reset to default")
+ self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default")
if os.name not in ("nt", "os2", "posix"):
return
@@ -87,7 +88,7 @@ class ThreadRunningTests(BasicThreadTest):
fail_msg = "stack_size(%d) failed - should succeed"
for tss in (262144, 0x100000, 0):
thread.stack_size(tss)
- self.assertEquals(thread.stack_size(), tss, fail_msg % tss)
+ self.assertEqual(thread.stack_size(), tss, fail_msg % tss)
verbose_print("successfully set stack_size(%d)" % tss)
for tss in (262144, 0x100000):
@@ -103,6 +104,32 @@ class ThreadRunningTests(BasicThreadTest):
thread.stack_size(0)
+ def test__count(self):
+ # Test the _count() function.
+ orig = thread._count()
+ mut = thread.allocate_lock()
+ mut.acquire()
+ started = []
+ def task():
+ started.append(None)
+ mut.acquire()
+ mut.release()
+ thread.start_new_thread(task, ())
+ while not started:
+ time.sleep(0.01)
+ self.assertEqual(thread._count(), orig + 1)
+ # Allow the task to finish.
+ mut.release()
+ # The only reliable way to be sure that the thread ended from the
+ # interpreter's point of view is to wait for the function object to be
+ # destroyed.
+ done = []
+ wr = weakref.ref(task, lambda _: done.append(None))
+ del task
+ while not done:
+ time.sleep(0.01)
+ self.assertEqual(thread._count(), orig)
+
class Barrier:
def __init__(self, num_threads):
@@ -174,7 +201,10 @@ class TestForkInThread(unittest.TestCase):
def setUp(self):
self.read_fd, self.write_fd = os.pipe()
- def _test_forkinthread(self):
+ @unittest.skipIf(sys.platform.startswith('win'),
+ "This test is only appropriate for POSIX-like systems.")
+ @test_support.reap_threads
+ def test_forkinthread(self):
def thread1():
try:
pid = os.fork() # fork in a thread
@@ -192,9 +222,6 @@ class TestForkInThread(unittest.TestCase):
self.assertEqual(os.read(self.read_fd, 2), "OK",
"Unable to fork() in thread")
- if not sys.platform.startswith('win'):
- test_forkinthread = _test_forkinthread
-
def tearDown(self):
try:
os.close(self.read_fd)
diff --git a/Lib/test/test_threaded_import.py b/Lib/test/test_threaded_import.py
index 602ad2af90..b31fdf1363 100644
--- a/Lib/test/test_threaded_import.py
+++ b/Lib/test/test_threaded_import.py
@@ -5,8 +5,9 @@
# complains several times about module random having no attribute
# randrange, and then Python hangs.
-import thread
-from test.test_support import verbose, TestSkipped, TestFailed
+import unittest
+from test.test_support import verbose, TestFailed, import_module
+thread = import_module('thread')
critical_section = thread.allocate_lock()
done = thread.allocate_lock()
@@ -56,7 +57,7 @@ def test_main(): # magic name! see above
import imp
if imp.lock_held():
# This triggers on, e.g., from test import autotest.
- raise TestSkipped("can't run when import lock is held")
+ raise unittest.SkipTest("can't run when import lock is held")
done.acquire()
for N in (20, 50) * 3:
diff --git a/Lib/test/test_threadedtempfile.py b/Lib/test/test_threadedtempfile.py
index 753f38847e..81d9687be2 100644
--- a/Lib/test/test_threadedtempfile.py
+++ b/Lib/test/test_threadedtempfile.py
@@ -16,11 +16,10 @@ provoking a 2.0 failure under Linux.
NUM_THREADS = 20
FILES_PER_THREAD = 50
-import thread # If this fails, we can't test this module
-import threading
import tempfile
-from test.test_support import threading_setup, threading_cleanup, run_unittest
+from test.test_support import threading_setup, threading_cleanup, run_unittest, import_module
+threading = import_module('threading')
import unittest
import StringIO
from traceback import print_exc
@@ -69,8 +68,8 @@ class ThreadedTempFileTest(unittest.TestCase):
msg = "Errors: errors %d ok %d\n%s" % (len(errors), ok,
'\n'.join(errors))
- self.assertEquals(errors, [], msg)
- self.assertEquals(ok, NUM_THREADS * FILES_PER_THREAD)
+ self.assertEqual(errors, [], msg)
+ self.assertEqual(ok, NUM_THREADS * FILES_PER_THREAD)
def test_main():
run_unittest(ThreadedTempFileTest)
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 054df7ba69..0062634f7e 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -5,11 +5,13 @@ from test.test_support import verbose
import random
import re
import sys
-import threading
-import thread
+thread = test.test_support.import_module('thread')
+threading = test.test_support.import_module('threading')
import time
import unittest
import weakref
+import os
+import subprocess
from test import lock_tests
@@ -43,7 +45,7 @@ class TestThread(threading.Thread):
self.nrunning.inc()
if verbose:
print self.nrunning.get(), 'tasks are running'
- self.testcase.assert_(self.nrunning.get() <= 3)
+ self.testcase.assertTrue(self.nrunning.get() <= 3)
time.sleep(delay)
if verbose:
@@ -51,12 +53,21 @@ class TestThread(threading.Thread):
with self.mutex:
self.nrunning.dec()
- self.testcase.assert_(self.nrunning.get() >= 0)
+ self.testcase.assertTrue(self.nrunning.get() >= 0)
if verbose:
print '%s is finished. %d tasks are running' % (
self.name, self.nrunning.get())
-class ThreadTests(unittest.TestCase):
+class BaseTestCase(unittest.TestCase):
+ def setUp(self):
+ self._threads = test.test_support.threading_setup()
+
+ def tearDown(self):
+ test.test_support.threading_cleanup(*self._threads)
+ test.test_support.reap_children()
+
+
+class ThreadTests(BaseTestCase):
# Create a bunch of threads, let each do some work, wait until all are
# done.
@@ -75,18 +86,18 @@ class ThreadTests(unittest.TestCase):
for i in range(NUMTASKS):
t = TestThread("<thread %d>"%i, self, sema, mutex, numrunning)
threads.append(t)
- self.failUnlessEqual(t.ident, None)
- self.assert_(re.match('<TestThread\(.*, initial\)>', repr(t)))
+ self.assertEqual(t.ident, None)
+ self.assertTrue(re.match('<TestThread\(.*, initial\)>', repr(t)))
t.start()
if verbose:
print 'waiting for all tasks to complete'
for t in threads:
t.join(NUMTASKS)
- self.assert_(not t.is_alive())
- self.failIfEqual(t.ident, 0)
+ self.assertTrue(not t.is_alive())
+ self.assertNotEqual(t.ident, 0)
self.assertFalse(t.ident is None)
- self.assert_(re.match('<TestThread\(.*, \w+ -?\d+\)>', repr(t)))
+ self.assertTrue(re.match('<TestThread\(.*, \w+ -?\d+\)>', repr(t)))
if verbose:
print 'all tasks done'
self.assertEqual(numrunning.get(), 0)
@@ -144,9 +155,8 @@ class ThreadTests(unittest.TestCase):
tid = thread.start_new_thread(f, (mutex,))
# Wait for the thread to finish.
mutex.acquire()
- self.assert_(tid in threading._active)
- self.assert_(isinstance(threading._active[tid],
- threading._DummyThread))
+ self.assertIn(tid, threading._active)
+ self.assertIsInstance(threading._active[tid], threading._DummyThread)
del threading._active[tid]
# PyThreadState_SetAsyncExc() is a CPython-only gimmick, not (currently)
@@ -166,6 +176,27 @@ class ThreadTests(unittest.TestCase):
exception = ctypes.py_object(AsyncExc)
+ # First check it works when setting the exception from the same thread.
+ tid = thread.get_ident()
+
+ try:
+ result = set_async_exc(ctypes.c_long(tid), exception)
+ # The exception is async, so we might have to keep the VM busy until
+ # it notices.
+ while True:
+ pass
+ except AsyncExc:
+ pass
+ else:
+ # This code is unreachable but it reflects the intent. If we wanted
+ # to be smarter the above loop wouldn't be infinite.
+ self.fail("AsyncExc not raised")
+ try:
+ self.assertEqual(result, 1) # one thread state modified
+ except UnboundLocalError:
+ # The exception was raised too quickly for us to get the result.
+ pass
+
# `worker_started` is set by the thread when it's inside a try/except
# block waiting to catch the asynchronously set AsyncExc exception.
# `worker_saw_exception` is set by the thread upon catching that
@@ -201,10 +232,11 @@ class ThreadTests(unittest.TestCase):
# Now raise an exception in the worker thread.
if verbose:
print " waiting for worker thread to get started"
- worker_started.wait()
+ ret = worker_started.wait()
+ self.assertTrue(ret)
if verbose:
print " verifying worker hasn't exited"
- self.assert_(not t.finished)
+ self.assertTrue(not t.finished)
if verbose:
print " attempting to raise asynch exception in worker"
result = set_async_exc(ctypes.c_long(t.id), exception)
@@ -212,7 +244,7 @@ class ThreadTests(unittest.TestCase):
if verbose:
print " waiting for worker to say it caught the exception"
worker_saw_exception.wait(timeout=10)
- self.assert_(t.finished)
+ self.assertTrue(t.finished)
if verbose:
print " all OK -- joining worker"
if t.finished:
@@ -245,7 +277,6 @@ class ThreadTests(unittest.TestCase):
print("test_finalize_with_runnning_thread can't import ctypes")
return # can't do anything
- import subprocess
rc = subprocess.call([sys.executable, "-c", """if 1:
import ctypes, sys, time, thread
@@ -276,8 +307,7 @@ class ThreadTests(unittest.TestCase):
def test_finalize_with_trace(self):
# Issue1733757
# Avoid a deadlock when sys.settrace steps into threading._shutdown
- import subprocess
- rc = subprocess.call([sys.executable, "-c", """if 1:
+ p = subprocess.Popen([sys.executable, "-c", """if 1:
import sys, threading
# A deadlock-killer, to prevent the
@@ -297,14 +327,20 @@ class ThreadTests(unittest.TestCase):
return func
sys.settrace(func)
- """])
- self.failIf(rc == 2, "interpreted was blocked")
- self.failUnless(rc == 0, "Unexpected error")
+ """],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
+ stdout, stderr = p.communicate()
+ rc = p.returncode
+ self.assertFalse(rc == 2, "interpreted was blocked")
+ self.assertTrue(rc == 0,
+ "Unexpected error: " + repr(stderr))
def test_join_nondaemon_on_shutdown(self):
# Issue 1722344
# Raising SystemExit skipped threading._shutdown
- import subprocess
p = subprocess.Popen([sys.executable, "-c", """if 1:
import threading
from time import sleep
@@ -320,6 +356,8 @@ class ThreadTests(unittest.TestCase):
"""],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
+ self.addCleanup(p.stdout.close)
+ self.addCleanup(p.stderr.close)
stdout, stderr = p.communicate()
self.assertEqual(stdout.strip(),
"Woke up, sleep function is: <built-in function sleep>")
@@ -340,7 +378,7 @@ class ThreadTests(unittest.TestCase):
t.start()
t.join()
l = enum()
- self.assertFalse(t in l,
+ self.assertNotIn(t, l,
"#1703448 triggered after %d trials: %s" % (i, l))
finally:
sys.setcheckinterval(old_interval)
@@ -364,20 +402,20 @@ class ThreadTests(unittest.TestCase):
weak_cyclic_object = weakref.ref(cyclic_object)
cyclic_object.thread.join()
del cyclic_object
- self.assertEquals(None, weak_cyclic_object(),
- msg=('%d references still around' %
- sys.getrefcount(weak_cyclic_object())))
+ self.assertEqual(None, weak_cyclic_object(),
+ msg=('%d references still around' %
+ sys.getrefcount(weak_cyclic_object())))
raising_cyclic_object = RunSelfFunction(should_raise=True)
weak_raising_cyclic_object = weakref.ref(raising_cyclic_object)
raising_cyclic_object.thread.join()
del raising_cyclic_object
- self.assertEquals(None, weak_raising_cyclic_object(),
- msg=('%d references still around' %
- sys.getrefcount(weak_raising_cyclic_object())))
+ self.assertEqual(None, weak_raising_cyclic_object(),
+ msg=('%d references still around' %
+ sys.getrefcount(weak_raising_cyclic_object())))
-class ThreadJoinOnShutdown(unittest.TestCase):
+class ThreadJoinOnShutdown(BaseTestCase):
def _run_and_join(self, script):
script = """if 1:
@@ -389,13 +427,13 @@ class ThreadJoinOnShutdown(unittest.TestCase):
print 'end of thread'
\n""" + script
- import subprocess
p = subprocess.Popen([sys.executable, "-c", script], stdout=subprocess.PIPE)
rc = p.wait()
data = p.stdout.read().replace('\r', '')
+ p.stdout.close()
self.assertEqual(data, "end of main\nend of thread\n")
- self.failIf(rc == 2, "interpreter was blocked")
- self.failUnless(rc == 0, "Unexpected error")
+ self.assertFalse(rc == 2, "interpreter was blocked")
+ self.assertTrue(rc == 0, "Unexpected error")
def test_1_join_on_shutdown(self):
# The usual case: on exit, wait for a non-daemon thread
@@ -436,7 +474,8 @@ class ThreadJoinOnShutdown(unittest.TestCase):
return
# Skip platforms with known problems forking from a worker thread.
# See http://bugs.python.org/issue3863.
- if sys.platform in ('freebsd4', 'freebsd5', 'freebsd6', 'os2emx'):
+ if sys.platform in ('freebsd4', 'freebsd5', 'freebsd6', 'netbsd5',
+ 'os2emx'):
print >>sys.stderr, ('Skipping test_3_join_in_forked_from_thread'
' due to known OS bugs on'), sys.platform
return
@@ -459,8 +498,154 @@ class ThreadJoinOnShutdown(unittest.TestCase):
"""
self._run_and_join(script)
+ def assertScriptHasOutput(self, script, expected_output):
+ p = subprocess.Popen([sys.executable, "-c", script],
+ stdout=subprocess.PIPE)
+ rc = p.wait()
+ data = p.stdout.read().decode().replace('\r', '')
+ self.assertEqual(rc, 0, "Unexpected error")
+ self.assertEqual(data, expected_output)
+
+ @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
+ def test_4_joining_across_fork_in_worker_thread(self):
+ # There used to be a possible deadlock when forking from a child
+ # thread. See http://bugs.python.org/issue6643.
+
+ # Skip platforms with known problems forking from a worker thread.
+ # See http://bugs.python.org/issue3863.
+ if sys.platform in ('freebsd4', 'freebsd5', 'freebsd6', 'os2emx'):
+ raise unittest.SkipTest('due to known OS bugs on ' + sys.platform)
+
+ # The script takes the following steps:
+ # - The main thread in the parent process starts a new thread and then
+ # tries to join it.
+ # - The join operation acquires the Lock inside the thread's _block
+ # Condition. (See threading.py:Thread.join().)
+ # - We stub out the acquire method on the condition to force it to wait
+ # until the child thread forks. (See LOCK ACQUIRED HERE)
+ # - The child thread forks. (See LOCK HELD and WORKER THREAD FORKS
+ # HERE)
+ # - The main thread of the parent process enters Condition.wait(),
+ # which releases the lock on the child thread.
+ # - The child process returns. Without the necessary fix, when the
+ # main thread of the child process (which used to be the child thread
+ # in the parent process) attempts to exit, it will try to acquire the
+ # lock in the Thread._block Condition object and hang, because the
+ # lock was held across the fork.
+
+ script = """if 1:
+ import os, time, threading
+
+ finish_join = False
+ start_fork = False
+
+ def worker():
+ # Wait until this thread's lock is acquired before forking to
+ # create the deadlock.
+ global finish_join
+ while not start_fork:
+ time.sleep(0.01)
+ # LOCK HELD: Main thread holds lock across this call.
+ childpid = os.fork()
+ finish_join = True
+ if childpid != 0:
+ # Parent process just waits for child.
+ os.waitpid(childpid, 0)
+ # Child process should just return.
+
+ w = threading.Thread(target=worker)
+
+ # Stub out the private condition variable's lock acquire method.
+ # This acquires the lock and then waits until the child has forked
+ # before returning, which will release the lock soon after. If
+ # someone else tries to fix this test case by acquiring this lock
+ # before forking instead of resetting it, the test case will
+ # deadlock when it shouldn't.
+ condition = w._block
+ orig_acquire = condition.acquire
+ call_count_lock = threading.Lock()
+ call_count = 0
+ def my_acquire():
+ global call_count
+ global start_fork
+ orig_acquire() # LOCK ACQUIRED HERE
+ start_fork = True
+ if call_count == 0:
+ while not finish_join:
+ time.sleep(0.01) # WORKER THREAD FORKS HERE
+ with call_count_lock:
+ call_count += 1
+ condition.acquire = my_acquire
+
+ w.start()
+ w.join()
+ print('end of main')
+ """
+ self.assertScriptHasOutput(script, "end of main\n")
+
+ @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
+ def test_5_clear_waiter_locks_to_avoid_crash(self):
+ # Check that a spawned thread that forks doesn't segfault on certain
+ # platforms, namely OS X. This used to happen if there was a waiter
+ # lock in the thread's condition variable's waiters list. Even though
+ # we know the lock will be held across the fork, it is not safe to
+ # release locks held across forks on all platforms, so releasing the
+ # waiter lock caused a segfault on OS X. Furthermore, since locks on
+ # OS X are (as of this writing) implemented with a mutex + condition
+ # variable instead of a semaphore, while we know that the Python-level
+ # lock will be acquired, we can't know if the internal mutex will be
+ # acquired at the time of the fork.
+
+ # Skip platforms with known problems forking from a worker thread.
+ # See http://bugs.python.org/issue3863.
+ if sys.platform in ('freebsd4', 'freebsd5', 'freebsd6', 'os2emx'):
+ raise unittest.SkipTest('due to known OS bugs on ' + sys.platform)
+ script = """if True:
+ import os, time, threading
+
+ start_fork = False
+
+ def worker():
+ # Wait until the main thread has attempted to join this thread
+ # before continuing.
+ while not start_fork:
+ time.sleep(0.01)
+ childpid = os.fork()
+ if childpid != 0:
+ # Parent process just waits for child.
+ (cpid, rc) = os.waitpid(childpid, 0)
+ assert cpid == childpid
+ assert rc == 0
+ print('end of worker thread')
+ else:
+ # Child process should just return.
+ pass
+
+ w = threading.Thread(target=worker)
+
+ # Stub out the private condition variable's _release_save method.
+ # This releases the condition's lock and flips the global that
+ # causes the worker to fork. At this point, the problematic waiter
+ # lock has been acquired once by the waiter and has been put onto
+ # the waiters list.
+ condition = w._block
+ orig_release_save = condition._release_save
+ def my_release_save():
+ global start_fork
+ orig_release_save()
+ # Waiter lock held here, condition lock released.
+ start_fork = True
+ condition._release_save = my_release_save
+
+ w.start()
+ w.join()
+ print('end of main thread')
+ """
+ output = "end of worker thread\nend of main thread\n"
+ self.assertScriptHasOutput(script, output)
+
-class ThreadingExceptionTests(unittest.TestCase):
+class ThreadingExceptionTests(BaseTestCase):
# A RuntimeError should be raised if Thread.start() is called
# multiple times.
def test_start_thread_again(self):
diff --git a/Lib/test/test_threading_local.py b/Lib/test/test_threading_local.py
index 96c0267709..4c9f2961ae 100644
--- a/Lib/test/test_threading_local.py
+++ b/Lib/test/test_threading_local.py
@@ -1,10 +1,15 @@
import unittest
from doctest import DocTestSuite
from test import test_support
-import threading
import weakref
import gc
+# Modules under test
+_thread = test_support.import_module('thread')
+threading = test_support.import_module('threading')
+import _threading_local
+
+
class Weak(object):
pass
@@ -13,7 +18,7 @@ def target(local, weaklist):
local.weak = weak
weaklist.append(weakref.ref(weak))
-class ThreadingLocalTest(unittest.TestCase):
+class BaseLocalTest:
def test_local_refs(self):
self._local_refs(20)
@@ -21,7 +26,7 @@ class ThreadingLocalTest(unittest.TestCase):
self._local_refs(100)
def _local_refs(self, n):
- local = threading.local()
+ local = self._local()
weaklist = []
for i in range(n):
t = threading.Thread(target=target, args=(local, weaklist))
@@ -32,15 +37,15 @@ class ThreadingLocalTest(unittest.TestCase):
gc.collect()
self.assertEqual(len(weaklist), n)
- # XXX threading.local keeps the local of the last stopped thread alive.
+ # XXX _threading_local keeps the local of the last stopped thread alive.
deadlist = [weak for weak in weaklist if weak() is None]
- self.assertEqual(len(deadlist), n-1)
+ self.assertIn(len(deadlist), (n-1, n))
# Assignment to the same thread local frees it sometimes (!)
local.someothervar = None
gc.collect()
deadlist = [weak for weak in weaklist if weak() is None]
- self.assert_(len(deadlist) in (n-1, n), (n, len(deadlist)))
+ self.assertIn(len(deadlist), (n-1, n), (n, len(deadlist)))
def test_derived(self):
# Issue 3088: if there is a threads switch inside the __init__
@@ -48,7 +53,7 @@ class ThreadingLocalTest(unittest.TestCase):
# is created but not correctly set on the object.
# The first member set may be bogus.
import time
- class Local(threading.local):
+ class Local(self._local):
def __init__(self):
time.sleep(0.01)
local = Local()
@@ -69,7 +74,7 @@ class ThreadingLocalTest(unittest.TestCase):
def test_derived_cycle_dealloc(self):
# http://bugs.python.org/issue6990
- class Local(threading.local):
+ class Local(self._local):
pass
locals = None
passed = [False]
@@ -105,11 +110,108 @@ class ThreadingLocalTest(unittest.TestCase):
self.assertTrue(passed[0])
+ def test_arguments(self):
+ # Issue 1522237
+ from thread import _local as local
+ from _threading_local import local as py_local
+
+ for cls in (local, py_local):
+ class MyLocal(cls):
+ def __init__(self, *args, **kwargs):
+ pass
+
+ MyLocal(a=1)
+ MyLocal(1)
+ self.assertRaises(TypeError, cls, a=1)
+ self.assertRaises(TypeError, cls, 1)
+
+ def _test_one_class(self, c):
+ self._failed = "No error message set or cleared."
+ obj = c()
+ e1 = threading.Event()
+ e2 = threading.Event()
+
+ def f1():
+ obj.x = 'foo'
+ obj.y = 'bar'
+ del obj.y
+ e1.set()
+ e2.wait()
+
+ def f2():
+ try:
+ foo = obj.x
+ except AttributeError:
+ # This is expected -- we haven't set obj.x in this thread yet!
+ self._failed = "" # passed
+ else:
+ self._failed = ('Incorrectly got value %r from class %r\n' %
+ (foo, c))
+ sys.stderr.write(self._failed)
+
+ t1 = threading.Thread(target=f1)
+ t1.start()
+ e1.wait()
+ t2 = threading.Thread(target=f2)
+ t2.start()
+ t2.join()
+ # The test is done; just let t1 know it can exit, and wait for it.
+ e2.set()
+ t1.join()
+
+ self.assertFalse(self._failed, self._failed)
+
+ def test_threading_local(self):
+ self._test_one_class(self._local)
+
+ def test_threading_local_subclass(self):
+ class LocalSubclass(self._local):
+ """To test that subclasses behave properly."""
+ self._test_one_class(LocalSubclass)
+
+ def _test_dict_attribute(self, cls):
+ obj = cls()
+ obj.x = 5
+ self.assertEqual(obj.__dict__, {'x': 5})
+ with self.assertRaises(AttributeError):
+ obj.__dict__ = {}
+ with self.assertRaises(AttributeError):
+ del obj.__dict__
+
+ def test_dict_attribute(self):
+ self._test_dict_attribute(self._local)
+
+ def test_dict_attribute_subclass(self):
+ class LocalSubclass(self._local):
+ """To test that subclasses behave properly."""
+ self._test_dict_attribute(LocalSubclass)
+
+
+class ThreadLocalTest(unittest.TestCase, BaseLocalTest):
+ _local = _thread._local
+
+ # Fails for the pure Python implementation
+ def test_cycle_collection(self):
+ class X:
+ pass
+
+ x = X()
+ x.local = self._local()
+ x.local.x = x
+ wr = weakref.ref(x)
+ del x
+ gc.collect()
+ self.assertIs(wr(), None)
+
+class PyThreadingLocalTest(unittest.TestCase, BaseLocalTest):
+ _local = _threading_local.local
+
def test_main():
suite = unittest.TestSuite()
suite.addTest(DocTestSuite('_threading_local'))
- suite.addTest(unittest.makeSuite(ThreadingLocalTest))
+ suite.addTest(unittest.makeSuite(ThreadLocalTest))
+ suite.addTest(unittest.makeSuite(PyThreadingLocalTest))
try:
from thread import _local
diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py
index 286c2e420f..2f7eb607c7 100644
--- a/Lib/test/test_threadsignals.py
+++ b/Lib/test/test_threadsignals.py
@@ -1,14 +1,14 @@
"""PyUnit testing that threads honor our signal semantics"""
import unittest
-import thread
import signal
import os
import sys
-from test.test_support import run_unittest, TestSkipped
+from test.test_support import run_unittest, import_module, reap_threads
+thread = import_module('thread')
if sys.platform[:3] in ('win', 'os2') or sys.platform=='riscos':
- raise TestSkipped, "Can't test signal on %s" % sys.platform
+ raise unittest.SkipTest, "Can't test signal on %s" % sys.platform
process_pid = os.getpid()
signalled_all=thread.allocate_lock()
@@ -39,6 +39,7 @@ class ThreadSignals(unittest.TestCase):
wait for it to finish. Check that we got both signals
and that they were run by the main thread.
"""
+ @reap_threads
def test_signals(self):
signalled_all.acquire()
self.spawnSignallingThread()
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index d173ae1ca2..0f00b1af52 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -1,6 +1,7 @@
from test import test_support
import time
import unittest
+import sys
class TimeTestCase(unittest.TestCase):
@@ -18,9 +19,9 @@ class TimeTestCase(unittest.TestCase):
time.clock()
def test_conversions(self):
- self.assert_(time.ctime(self.t)
+ self.assertTrue(time.ctime(self.t)
== time.asctime(time.localtime(self.t)))
- self.assert_(long(time.mktime(time.localtime(self.t)))
+ self.assertTrue(long(time.mktime(time.localtime(self.t)))
== long(self.t))
def test_sleep(self):
@@ -37,6 +38,13 @@ class TimeTestCase(unittest.TestCase):
except ValueError:
self.fail('conversion specifier: %r failed.' % format)
+ # Issue #10762: Guard against invalid/non-supported format string
+ # so that Python don't crash (Windows crashes when the format string
+ # input to [w]strftime is not kosher.
+ if sys.platform.startswith('win'):
+ with self.assertRaises(ValueError):
+ time.strftime('%f')
+
def test_strftime_bounds_checking(self):
# Make sure that strftime() checks the bounds of the various parts
#of the time tuple (0 is valid for *all* values).
@@ -87,11 +95,6 @@ class TimeTestCase(unittest.TestCase):
(1900, 1, 1, 0, 0, 0, 0, -1, -1))
self.assertRaises(ValueError, time.strftime, '',
(1900, 1, 1, 0, 0, 0, 0, 367, -1))
- # Check daylight savings flag [-1, 1]
- self.assertRaises(ValueError, time.strftime, '',
- (1900, 1, 1, 0, 0, 0, 0, 1, -2))
- self.assertRaises(ValueError, time.strftime, '',
- (1900, 1, 1, 0, 0, 0, 0, 1, 2))
def test_default_values_for_zero(self):
# Make sure that using all zeros uses the proper default values.
@@ -99,7 +102,7 @@ class TimeTestCase(unittest.TestCase):
# based on its value.
expected = "2000 01 01 00 00 00 1 001"
result = time.strftime("%Y %m %d %H %M %S %w %j", (0,)*9)
- self.assertEquals(expected, result)
+ self.assertEqual(expected, result)
def test_strptime(self):
# Should be able to go round-trip from strftime to strptime without
@@ -126,13 +129,13 @@ class TimeTestCase(unittest.TestCase):
# (12345, 1, 0, 0, 0, 0, 0, 0, 0))
# XXX: For now, just make sure we don't have a crash:
try:
- time.asctime((12345, 1, 0, 0, 0, 0, 0, 0, 0))
+ time.asctime((12345, 1, 1, 0, 0, 0, 0, 1, 0))
except ValueError:
pass
+ @unittest.skipIf(not hasattr(time, "tzset"),
+ "time module has no attribute tzset")
def test_tzset(self):
- if not hasattr(time, "tzset"):
- return # Can't test this; don't want the test suite to fail
from os import environ
@@ -158,36 +161,36 @@ class TimeTestCase(unittest.TestCase):
time.tzset()
environ['TZ'] = utc
time.tzset()
- self.failUnlessEqual(
+ self.assertEqual(
time.gmtime(xmas2002), time.localtime(xmas2002)
)
- self.failUnlessEqual(time.daylight, 0)
- self.failUnlessEqual(time.timezone, 0)
- self.failUnlessEqual(time.localtime(xmas2002).tm_isdst, 0)
+ self.assertEqual(time.daylight, 0)
+ self.assertEqual(time.timezone, 0)
+ self.assertEqual(time.localtime(xmas2002).tm_isdst, 0)
# Make sure we can switch to US/Eastern
environ['TZ'] = eastern
time.tzset()
- self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002))
- self.failUnlessEqual(time.tzname, ('EST', 'EDT'))
- self.failUnlessEqual(len(time.tzname), 2)
- self.failUnlessEqual(time.daylight, 1)
- self.failUnlessEqual(time.timezone, 18000)
- self.failUnlessEqual(time.altzone, 14400)
- self.failUnlessEqual(time.localtime(xmas2002).tm_isdst, 0)
- self.failUnlessEqual(len(time.tzname), 2)
+ self.assertNotEqual(time.gmtime(xmas2002), time.localtime(xmas2002))
+ self.assertEqual(time.tzname, ('EST', 'EDT'))
+ self.assertEqual(len(time.tzname), 2)
+ self.assertEqual(time.daylight, 1)
+ self.assertEqual(time.timezone, 18000)
+ self.assertEqual(time.altzone, 14400)
+ self.assertEqual(time.localtime(xmas2002).tm_isdst, 0)
+ self.assertEqual(len(time.tzname), 2)
# Now go to the southern hemisphere.
environ['TZ'] = victoria
time.tzset()
- self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002))
- self.failUnless(time.tzname[0] == 'AEST', str(time.tzname[0]))
- self.failUnless(time.tzname[1] == 'AEDT', str(time.tzname[1]))
- self.failUnlessEqual(len(time.tzname), 2)
- self.failUnlessEqual(time.daylight, 1)
- self.failUnlessEqual(time.timezone, -36000)
- self.failUnlessEqual(time.altzone, -39600)
- self.failUnlessEqual(time.localtime(xmas2002).tm_isdst, 1)
+ self.assertNotEqual(time.gmtime(xmas2002), time.localtime(xmas2002))
+ self.assertTrue(time.tzname[0] == 'AEST', str(time.tzname[0]))
+ self.assertTrue(time.tzname[1] == 'AEDT', str(time.tzname[1]))
+ self.assertEqual(len(time.tzname), 2)
+ self.assertEqual(time.daylight, 1)
+ self.assertEqual(time.timezone, -36000)
+ self.assertEqual(time.altzone, -39600)
+ self.assertEqual(time.localtime(xmas2002).tm_isdst, 1)
finally:
# Repair TZ environment variable in case any other tests
@@ -219,14 +222,25 @@ class TimeTestCase(unittest.TestCase):
gt1 = time.gmtime(None)
t0 = time.mktime(gt0)
t1 = time.mktime(gt1)
- self.assert_(0 <= (t1-t0) < 0.2)
+ self.assertTrue(0 <= (t1-t0) < 0.2)
def test_localtime_without_arg(self):
lt0 = time.localtime()
lt1 = time.localtime(None)
t0 = time.mktime(lt0)
t1 = time.mktime(lt1)
- self.assert_(0 <= (t1-t0) < 0.2)
+ self.assertTrue(0 <= (t1-t0) < 0.2)
+
+ def test_mktime(self):
+ # Issue #1726687
+ for t in (-2, -1, 0, 1):
+ try:
+ tt = time.localtime(t)
+ except (OverflowError, ValueError):
+ pass
+ else:
+ self.assertEqual(time.mktime(tt), t)
+
def test_main():
test_support.run_unittest(TimeTestCase)
diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py
index 460e0d6572..4bc125e128 100644
--- a/Lib/test/test_timeout.py
+++ b/Lib/test/test_timeout.py
@@ -119,28 +119,30 @@ class TimeoutTestCase(unittest.TestCase):
self.sock.settimeout(_timeout)
_t1 = time.time()
- self.failUnlessRaises(socket.error, self.sock.connect, addr)
+ self.assertRaises(socket.error, self.sock.connect, addr)
_t2 = time.time()
_delta = abs(_t1 - _t2)
- self.assert_(_delta < _timeout + self.fuzz,
+ self.assertTrue(_delta < _timeout + self.fuzz,
"timeout (%g) is more than %g seconds more than expected (%g)"
%(_delta, self.fuzz, _timeout))
def testRecvTimeout(self):
# Test recv() timeout
_timeout = 0.02
- self.sock.connect(self.addr_remote)
- self.sock.settimeout(_timeout)
- _t1 = time.time()
- self.failUnlessRaises(socket.error, self.sock.recv, 1024)
- _t2 = time.time()
+ with test_support.transient_internet(self.addr_remote[0]):
+ self.sock.connect(self.addr_remote)
+ self.sock.settimeout(_timeout)
- _delta = abs(_t1 - _t2)
- self.assert_(_delta < _timeout + self.fuzz,
- "timeout (%g) is %g seconds more than expected (%g)"
- %(_delta, self.fuzz, _timeout))
+ _t1 = time.time()
+ self.assertRaises(socket.timeout, self.sock.recv, 1024)
+ _t2 = time.time()
+
+ _delta = abs(_t1 - _t2)
+ self.assertTrue(_delta < _timeout + self.fuzz,
+ "timeout (%g) is %g seconds more than expected (%g)"
+ %(_delta, self.fuzz, _timeout))
def testAcceptTimeout(self):
# Test accept() timeout
@@ -151,11 +153,11 @@ class TimeoutTestCase(unittest.TestCase):
self.sock.listen(5)
_t1 = time.time()
- self.failUnlessRaises(socket.error, self.sock.accept)
+ self.assertRaises(socket.error, self.sock.accept)
_t2 = time.time()
_delta = abs(_t1 - _t2)
- self.assert_(_delta < _timeout + self.fuzz,
+ self.assertTrue(_delta < _timeout + self.fuzz,
"timeout (%g) is %g seconds more than expected (%g)"
%(_delta, self.fuzz, _timeout))
@@ -168,11 +170,11 @@ class TimeoutTestCase(unittest.TestCase):
test_support.bind_port(self.sock, self.localhost)
_t1 = time.time()
- self.failUnlessRaises(socket.error, self.sock.recvfrom, 8192)
+ self.assertRaises(socket.error, self.sock.recvfrom, 8192)
_t2 = time.time()
_delta = abs(_t1 - _t2)
- self.assert_(_delta < _timeout + self.fuzz,
+ self.assertTrue(_delta < _timeout + self.fuzz,
"timeout (%g) is %g seconds more than expected (%g)"
%(_delta, self.fuzz, _timeout))
diff --git a/Lib/test/test_tk.py b/Lib/test/test_tk.py
new file mode 100644
index 0000000000..49ca53fa62
--- /dev/null
+++ b/Lib/test/test_tk.py
@@ -0,0 +1,35 @@
+import os
+import unittest
+from test import test_support
+
+# Skip test if _tkinter wasn't built.
+test_support.import_module('_tkinter')
+
+import Tkinter
+
+try:
+ Tkinter.Button()
+except Tkinter.TclError, msg:
+ # assuming tk is not available
+ raise unittest.SkipTest("tk not available: %s" % msg)
+
+this_dir = os.path.dirname(os.path.abspath(__file__))
+lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir,
+ 'lib-tk', 'test'))
+
+with test_support.DirsOnSysPath(lib_tk_test):
+ import runtktests
+
+def test_main(enable_gui=False):
+ if enable_gui:
+ if test_support.use_resources is None:
+ test_support.use_resources = ['gui']
+ elif 'gui' not in test_support.use_resources:
+ test_support.use_resources.append('gui')
+
+ with test_support.DirsOnSysPath(lib_tk_test):
+ test_support.run_unittest(
+ *runtktests.get_tests(text=False, packages=['test_tkinter']))
+
+if __name__ == '__main__':
+ test_main(enable_gui=True)
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py
index ae5f410b7a..38da106cb6 100644
--- a/Lib/test/test_tokenize.py
+++ b/Lib/test/test_tokenize.py
@@ -56,7 +56,7 @@ doesn't match the first.
... return tokens1 == tokens2
...
-There are some standard formattig practises that are easy to get right.
+There are some standard formatting practices that are easy to get right.
>>> roundtrip("if x == 1:\\n"
... " print x\\n")
@@ -493,13 +493,13 @@ Two string literals on the same line
True
Test roundtrip on random python modules.
-pass the '-ucompiler' option to process the full directory.
+pass the '-ucpu' option to process the full directory.
>>>
>>> tempdir = os.path.dirname(f) or os.curdir
>>> testfiles = glob.glob(os.path.join(tempdir, "test*.py"))
- >>> if not test_support.is_resource_enabled("compiler"):
+ >>> if not test_support.is_resource_enabled("cpu"):
... testfiles = random.sample(testfiles, 10)
...
>>> for testfile in testfiles:
@@ -508,11 +508,28 @@ pass the '-ucompiler' option to process the full directory.
... break
... else: True
True
+
+Evil tabs
+ >>> dump_tokens("def f():\\n\\tif x\\n \\tpass")
+ NAME 'def' (1, 0) (1, 3)
+ NAME 'f' (1, 4) (1, 5)
+ OP '(' (1, 5) (1, 6)
+ OP ')' (1, 6) (1, 7)
+ OP ':' (1, 7) (1, 8)
+ NEWLINE '\\n' (1, 8) (1, 9)
+ INDENT '\\t' (2, 0) (2, 1)
+ NAME 'if' (2, 1) (2, 3)
+ NAME 'x' (2, 4) (2, 5)
+ NEWLINE '\\n' (2, 5) (2, 6)
+ INDENT ' \\t' (3, 0) (3, 9)
+ NAME 'pass' (3, 9) (3, 13)
+ DEDENT '' (4, 0) (4, 0)
+ DEDENT '' (4, 0) (4, 0)
"""
from test import test_support
-from tokenize import (tokenize, untokenize, generate_tokens, NUMBER, NAME, OP,
+from tokenize import (untokenize, generate_tokens, NUMBER, NAME, OP,
STRING, ENDMARKER, tok_name)
from StringIO import StringIO
import os
diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py
index 8e3d4838c5..2292ad6155 100644
--- a/Lib/test/test_trace.py
+++ b/Lib/test/test_trace.py
@@ -1,768 +1,341 @@
-# Testing the line trace facility.
-
-from test import test_support
-import unittest
+import os
import sys
-import difflib
-import gc
-
-# A very basic example. If this fails, we're in deep trouble.
-def basic():
- return 1
-
-basic.events = [(0, 'call'),
- (1, 'line'),
- (1, 'return')]
-
-# Many of the tests below are tricky because they involve pass statements.
-# If there is implicit control flow around a pass statement (in an except
-# clause or else caluse) under what conditions do you set a line number
-# following that clause?
-
-
-# The entire "while 0:" statement is optimized away. No code
-# exists for it, so the line numbers skip directly from "del x"
-# to "x = 1".
-def arigo_example():
- x = 1
- del x
- while 0:
- pass
- x = 1
-
-arigo_example.events = [(0, 'call'),
- (1, 'line'),
- (2, 'line'),
- (5, 'line'),
- (5, 'return')]
-
-# check that lines consisting of just one instruction get traced:
-def one_instr_line():
- x = 1
- del x
- x = 1
-
-one_instr_line.events = [(0, 'call'),
- (1, 'line'),
- (2, 'line'),
- (3, 'line'),
- (3, 'return')]
-
-def no_pop_tops(): # 0
- x = 1 # 1
- for a in range(2): # 2
- if a: # 3
- x = 1 # 4
- else: # 5
- x = 1 # 6
-
-no_pop_tops.events = [(0, 'call'),
- (1, 'line'),
- (2, 'line'),
- (3, 'line'),
- (6, 'line'),
- (2, 'line'),
- (3, 'line'),
- (4, 'line'),
- (2, 'line'),
- (2, 'return')]
-
-def no_pop_blocks():
- y = 1
- while not y:
- bla
- x = 1
-
-no_pop_blocks.events = [(0, 'call'),
- (1, 'line'),
- (2, 'line'),
- (4, 'line'),
- (4, 'return')]
-
-def called(): # line -3
- x = 1
-
-def call(): # line 0
- called()
-
-call.events = [(0, 'call'),
- (1, 'line'),
- (-3, 'call'),
- (-2, 'line'),
- (-2, 'return'),
- (1, 'return')]
-
-def raises():
- raise Exception
-
-def test_raise():
- try:
- raises()
- except Exception, exc:
- x = 1
-
-test_raise.events = [(0, 'call'),
- (1, 'line'),
- (2, 'line'),
- (-3, 'call'),
- (-2, 'line'),
- (-2, 'exception'),
- (-2, 'return'),
- (2, 'exception'),
- (3, 'line'),
- (4, 'line'),
- (4, 'return')]
-
-def _settrace_and_return(tracefunc):
- sys.settrace(tracefunc)
- sys._getframe().f_back.f_trace = tracefunc
-def settrace_and_return(tracefunc):
- _settrace_and_return(tracefunc)
-
-settrace_and_return.events = [(1, 'return')]
-
-def _settrace_and_raise(tracefunc):
- sys.settrace(tracefunc)
- sys._getframe().f_back.f_trace = tracefunc
- raise RuntimeError
-def settrace_and_raise(tracefunc):
- try:
- _settrace_and_raise(tracefunc)
- except RuntimeError, exc:
- pass
-
-settrace_and_raise.events = [(2, 'exception'),
- (3, 'line'),
- (4, 'line'),
- (4, 'return')]
-
-# implicit return example
-# This test is interesting because of the else: pass
-# part of the code. The code generate for the true
-# part of the if contains a jump past the else branch.
-# The compiler then generates an implicit "return None"
-# Internally, the compiler visits the pass statement
-# and stores its line number for use on the next instruction.
-# The next instruction is the implicit return None.
-def ireturn_example():
- a = 5
- b = 5
- if a == b:
- b = a+1
- else:
- pass
-
-ireturn_example.events = [(0, 'call'),
- (1, 'line'),
- (2, 'line'),
- (3, 'line'),
- (4, 'line'),
- (6, 'line'),
- (6, 'return')]
-
-# Tight loop with while(1) example (SF #765624)
-def tightloop_example():
- items = range(0, 3)
- try:
- i = 0
- while 1:
- b = items[i]; i+=1
- except IndexError:
- pass
-
-tightloop_example.events = [(0, 'call'),
- (1, 'line'),
- (2, 'line'),
- (3, 'line'),
- (4, 'line'),
- (5, 'line'),
- (5, 'line'),
- (5, 'line'),
- (5, 'line'),
- (5, 'exception'),
- (6, 'line'),
- (7, 'line'),
- (7, 'return')]
-
-def tighterloop_example():
- items = range(1, 4)
- try:
- i = 0
- while 1: i = items[i]
- except IndexError:
- pass
-
-tighterloop_example.events = [(0, 'call'),
- (1, 'line'),
- (2, 'line'),
- (3, 'line'),
- (4, 'line'),
- (4, 'line'),
- (4, 'line'),
- (4, 'line'),
- (4, 'exception'),
- (5, 'line'),
- (6, 'line'),
- (6, 'return')]
-
-def generator_function():
- try:
- yield True
- "continued"
- finally:
- "finally"
-def generator_example():
- # any() will leave the generator before its end
- x = any(generator_function())
-
- # the following lines were not traced
- for x in range(10):
- y = x
-
-generator_example.events = ([(0, 'call'),
- (2, 'line'),
- (-6, 'call'),
- (-5, 'line'),
- (-4, 'line'),
- (-4, 'return'),
- (-4, 'call'),
- (-4, 'exception'),
- (-1, 'line'),
- (-1, 'return')] +
- [(5, 'line'), (6, 'line')] * 10 +
- [(5, 'line'), (5, 'return')])
-
-
-class Tracer:
- def __init__(self):
- self.events = []
- def trace(self, frame, event, arg):
- self.events.append((frame.f_lineno, event))
- return self.trace
- def traceWithGenexp(self, frame, event, arg):
- (o for o in [1])
- self.events.append((frame.f_lineno, event))
- return self.trace
-
-class TraceTestCase(unittest.TestCase):
-
- # Disable gc collection when tracing, otherwise the
- # deallocators may be traced as well.
- def setUp(self):
- self.using_gc = gc.isenabled()
- gc.disable()
+from test.test_support import (run_unittest, TESTFN, rmtree, unlink,
+ captured_stdout)
+import unittest
+
+import trace
+from trace import CoverageResults, Trace
+
+from test.tracedmodules import testmod
+
+
+#------------------------------- Utilities -----------------------------------#
+
+def fix_ext_py(filename):
+ """Given a .pyc/.pyo filename converts it to the appropriate .py"""
+ if filename.endswith(('.pyc', '.pyo')):
+ filename = filename[:-1]
+ return filename
+
+def my_file_and_modname():
+ """The .py file and module name of this file (__file__)"""
+ modname = os.path.splitext(os.path.basename(__file__))[0]
+ return fix_ext_py(__file__), modname
+
+def get_firstlineno(func):
+ return func.__code__.co_firstlineno
+
+#-------------------- Target functions for tracing ---------------------------#
+#
+# The relative line numbers of lines in these functions matter for verifying
+# tracing. Please modify the appropriate tests if you change one of the
+# functions. Absolute line numbers don't matter.
+#
+
+def traced_func_linear(x, y):
+ a = x
+ b = y
+ c = a + b
+ return c
+
+def traced_func_loop(x, y):
+ c = x
+ for i in range(5):
+ c += y
+ return c
+
+def traced_func_importing(x, y):
+ return x + y + testmod.func(1)
+
+def traced_func_simple_caller(x):
+ c = traced_func_linear(x, x)
+ return c + x
+
+def traced_func_importing_caller(x):
+ k = traced_func_simple_caller(x)
+ k += traced_func_importing(k, x)
+ return k
+
+def traced_func_generator(num):
+ c = 5 # executed once
+ for i in range(num):
+ yield i + c
+def traced_func_calling_generator():
+ k = 0
+ for i in traced_func_generator(10):
+ k += i
+
+def traced_doubler(num):
+ return num * 2
+
+def traced_caller_list_comprehension():
+ k = 10
+ mylist = [traced_doubler(i) for i in range(k)]
+ return mylist
+
+
+class TracedClass(object):
+ def __init__(self, x):
+ self.a = x
+
+ def inst_method_linear(self, y):
+ return self.a + y
+
+ def inst_method_calling(self, x):
+ c = self.inst_method_linear(x)
+ return c + traced_func_linear(x, c)
+
+ @classmethod
+ def class_method_linear(cls, y):
+ return y * 2
+
+ @staticmethod
+ def static_method_linear(y):
+ return y * 2
+
+
+#------------------------------ Test cases -----------------------------------#
+
+
+class TestLineCounts(unittest.TestCase):
+ """White-box testing of line-counting, via runfunc"""
+ def setUp(self):
+ self.tracer = Trace(count=1, trace=0, countfuncs=0, countcallers=0)
+ self.my_py_filename = fix_ext_py(__file__)
+
+ def test_traced_func_linear(self):
+ result = self.tracer.runfunc(traced_func_linear, 2, 5)
+ self.assertEqual(result, 7)
+
+ # all lines are executed once
+ expected = {}
+ firstlineno = get_firstlineno(traced_func_linear)
+ for i in range(1, 5):
+ expected[(self.my_py_filename, firstlineno + i)] = 1
+
+ self.assertEqual(self.tracer.results().counts, expected)
+
+ def test_traced_func_loop(self):
+ self.tracer.runfunc(traced_func_loop, 2, 3)
+
+ firstlineno = get_firstlineno(traced_func_loop)
+ expected = {
+ (self.my_py_filename, firstlineno + 1): 1,
+ (self.my_py_filename, firstlineno + 2): 6,
+ (self.my_py_filename, firstlineno + 3): 5,
+ (self.my_py_filename, firstlineno + 4): 1,
+ }
+ self.assertEqual(self.tracer.results().counts, expected)
+
+ def test_traced_func_importing(self):
+ self.tracer.runfunc(traced_func_importing, 2, 5)
+
+ firstlineno = get_firstlineno(traced_func_importing)
+ expected = {
+ (self.my_py_filename, firstlineno + 1): 1,
+ (fix_ext_py(testmod.__file__), 2): 1,
+ (fix_ext_py(testmod.__file__), 3): 1,
+ }
+
+ self.assertEqual(self.tracer.results().counts, expected)
+
+ def test_trace_func_generator(self):
+ self.tracer.runfunc(traced_func_calling_generator)
+
+ firstlineno_calling = get_firstlineno(traced_func_calling_generator)
+ firstlineno_gen = get_firstlineno(traced_func_generator)
+ expected = {
+ (self.my_py_filename, firstlineno_calling + 1): 1,
+ (self.my_py_filename, firstlineno_calling + 2): 11,
+ (self.my_py_filename, firstlineno_calling + 3): 10,
+ (self.my_py_filename, firstlineno_gen + 1): 1,
+ (self.my_py_filename, firstlineno_gen + 2): 11,
+ (self.my_py_filename, firstlineno_gen + 3): 10,
+ }
+ self.assertEqual(self.tracer.results().counts, expected)
+
+ def test_trace_list_comprehension(self):
+ self.tracer.runfunc(traced_caller_list_comprehension)
+
+ firstlineno_calling = get_firstlineno(traced_caller_list_comprehension)
+ firstlineno_called = get_firstlineno(traced_doubler)
+ expected = {
+ (self.my_py_filename, firstlineno_calling + 1): 1,
+ (self.my_py_filename, firstlineno_calling + 2): 11,
+ (self.my_py_filename, firstlineno_calling + 3): 1,
+ (self.my_py_filename, firstlineno_called + 1): 10,
+ }
+ self.assertEqual(self.tracer.results().counts, expected)
+
+
+ def test_linear_methods(self):
+ # XXX todo: later add 'static_method_linear' and 'class_method_linear'
+ # here, once issue1764286 is resolved
+ #
+ for methname in ['inst_method_linear',]:
+ tracer = Trace(count=1, trace=0, countfuncs=0, countcallers=0)
+ traced_obj = TracedClass(25)
+ method = getattr(traced_obj, methname)
+ tracer.runfunc(method, 20)
+
+ firstlineno = get_firstlineno(method)
+ expected = {
+ (self.my_py_filename, firstlineno + 1): 1,
+ }
+ self.assertEqual(tracer.results().counts, expected)
+
+class TestRunExecCounts(unittest.TestCase):
+ """A simple sanity test of line-counting, via runctx (exec)"""
+ def setUp(self):
+ self.my_py_filename = fix_ext_py(__file__)
+
+ def test_exec_counts(self):
+ self.tracer = Trace(count=1, trace=0, countfuncs=0, countcallers=0)
+ code = r'''traced_func_loop(2, 5)'''
+ code = compile(code, __file__, 'exec')
+ self.tracer.runctx(code, globals(), vars())
+
+ firstlineno = get_firstlineno(traced_func_loop)
+ expected = {
+ (self.my_py_filename, firstlineno + 1): 1,
+ (self.my_py_filename, firstlineno + 2): 6,
+ (self.my_py_filename, firstlineno + 3): 5,
+ (self.my_py_filename, firstlineno + 4): 1,
+ }
+
+ # When used through 'run', some other spurious counts are produced, like
+ # the settrace of threading, which we ignore, just making sure that the
+ # counts fo traced_func_loop were right.
+ #
+ for k in expected.keys():
+ self.assertEqual(self.tracer.results().counts[k], expected[k])
+
+
+class TestFuncs(unittest.TestCase):
+ """White-box testing of funcs tracing"""
+ def setUp(self):
+ self.tracer = Trace(count=0, trace=0, countfuncs=1)
+ self.filemod = my_file_and_modname()
+
+ def test_simple_caller(self):
+ self.tracer.runfunc(traced_func_simple_caller, 1)
+
+ expected = {
+ self.filemod + ('traced_func_simple_caller',): 1,
+ self.filemod + ('traced_func_linear',): 1,
+ }
+ self.assertEqual(self.tracer.results().calledfuncs, expected)
+
+ def test_loop_caller_importing(self):
+ self.tracer.runfunc(traced_func_importing_caller, 1)
+
+ expected = {
+ self.filemod + ('traced_func_simple_caller',): 1,
+ self.filemod + ('traced_func_linear',): 1,
+ self.filemod + ('traced_func_importing_caller',): 1,
+ self.filemod + ('traced_func_importing',): 1,
+ (fix_ext_py(testmod.__file__), 'testmod', 'func'): 1,
+ }
+ self.assertEqual(self.tracer.results().calledfuncs, expected)
+
+ def test_inst_method_calling(self):
+ obj = TracedClass(20)
+ self.tracer.runfunc(obj.inst_method_calling, 1)
+
+ expected = {
+ self.filemod + ('TracedClass.inst_method_calling',): 1,
+ self.filemod + ('TracedClass.inst_method_linear',): 1,
+ self.filemod + ('traced_func_linear',): 1,
+ }
+ self.assertEqual(self.tracer.results().calledfuncs, expected)
+
+
+class TestCallers(unittest.TestCase):
+ """White-box testing of callers tracing"""
+ def setUp(self):
+ self.tracer = Trace(count=0, trace=0, countcallers=1)
+ self.filemod = my_file_and_modname()
+
+ def test_loop_caller_importing(self):
+ self.tracer.runfunc(traced_func_importing_caller, 1)
+
+ expected = {
+ ((os.path.splitext(trace.__file__)[0] + '.py', 'trace', 'Trace.runfunc'),
+ (self.filemod + ('traced_func_importing_caller',))): 1,
+ ((self.filemod + ('traced_func_simple_caller',)),
+ (self.filemod + ('traced_func_linear',))): 1,
+ ((self.filemod + ('traced_func_importing_caller',)),
+ (self.filemod + ('traced_func_simple_caller',))): 1,
+ ((self.filemod + ('traced_func_importing_caller',)),
+ (self.filemod + ('traced_func_importing',))): 1,
+ ((self.filemod + ('traced_func_importing',)),
+ (fix_ext_py(testmod.__file__), 'testmod', 'func')): 1,
+ }
+ self.assertEqual(self.tracer.results().callers, expected)
+
+
+# Created separately for issue #3821
+class TestCoverage(unittest.TestCase):
def tearDown(self):
- if self.using_gc:
- gc.enable()
-
- def compare_events(self, line_offset, events, expected_events):
- events = [(l - line_offset, e) for (l, e) in events]
- if events != expected_events:
- self.fail(
- "events did not match expectation:\n" +
- "\n".join(difflib.ndiff([str(x) for x in expected_events],
- [str(x) for x in events])))
-
- def run_and_compare(self, func, events):
- tracer = Tracer()
- sys.settrace(tracer.trace)
- func()
- sys.settrace(None)
- self.compare_events(func.func_code.co_firstlineno,
- tracer.events, events)
-
- def run_test(self, func):
- self.run_and_compare(func, func.events)
-
- def run_test2(self, func):
- tracer = Tracer()
- func(tracer.trace)
- sys.settrace(None)
- self.compare_events(func.func_code.co_firstlineno,
- tracer.events, func.events)
-
- def set_and_retrieve_none(self):
- sys.settrace(None)
- assert sys.gettrace() is None
-
- def set_and_retrieve_func(self):
- def fn(*args):
- pass
-
- sys.settrace(fn)
- try:
- assert sys.gettrace() is fn
- finally:
- sys.settrace(None)
-
- def test_01_basic(self):
- self.run_test(basic)
- def test_02_arigo(self):
- self.run_test(arigo_example)
- def test_03_one_instr(self):
- self.run_test(one_instr_line)
- def test_04_no_pop_blocks(self):
- self.run_test(no_pop_blocks)
- def test_05_no_pop_tops(self):
- self.run_test(no_pop_tops)
- def test_06_call(self):
- self.run_test(call)
- def test_07_raise(self):
- self.run_test(test_raise)
-
- def test_08_settrace_and_return(self):
- self.run_test2(settrace_and_return)
- def test_09_settrace_and_raise(self):
- self.run_test2(settrace_and_raise)
- def test_10_ireturn(self):
- self.run_test(ireturn_example)
- def test_11_tightloop(self):
- self.run_test(tightloop_example)
- def test_12_tighterloop(self):
- self.run_test(tighterloop_example)
-
- def test_13_genexp(self):
- self.run_test(generator_example)
- # issue1265: if the trace function contains a generator,
- # and if the traced function contains another generator
- # that is not completely exhausted, the trace stopped.
- # Worse: the 'finally' clause was not invoked.
- tracer = Tracer()
- sys.settrace(tracer.traceWithGenexp)
- generator_example()
- sys.settrace(None)
- self.compare_events(generator_example.__code__.co_firstlineno,
- tracer.events, generator_example.events)
-
- def test_14_onliner_if(self):
- def onliners():
- if True: False
- else: True
- return 0
- self.run_and_compare(
- onliners,
- [(0, 'call'),
- (1, 'line'),
- (3, 'line'),
- (3, 'return')])
-
- def test_15_loops(self):
- # issue1750076: "while" expression is skipped by debugger
- def for_example():
- for x in range(2):
- pass
- self.run_and_compare(
- for_example,
- [(0, 'call'),
- (1, 'line'),
- (2, 'line'),
- (1, 'line'),
- (2, 'line'),
- (1, 'line'),
- (1, 'return')])
-
- def while_example():
- # While expression should be traced on every loop
- x = 2
- while x > 0:
- x -= 1
- self.run_and_compare(
- while_example,
- [(0, 'call'),
- (2, 'line'),
- (3, 'line'),
- (4, 'line'),
- (3, 'line'),
- (4, 'line'),
- (3, 'line'),
- (3, 'return')])
-
- def test_16_blank_lines(self):
- exec("def f():\n" + "\n" * 256 + " pass")
- self.run_and_compare(
- f,
- [(0, 'call'),
- (257, 'line'),
- (257, 'return')])
-
-
-class RaisingTraceFuncTestCase(unittest.TestCase):
- def trace(self, frame, event, arg):
- """A trace function that raises an exception in response to a
- specific trace event."""
- if event == self.raiseOnEvent:
- raise ValueError # just something that isn't RuntimeError
- else:
- return self.trace
-
- def f(self):
- """The function to trace; raises an exception if that's the case
- we're testing, so that the 'exception' trace event fires."""
- if self.raiseOnEvent == 'exception':
- x = 0
- y = 1 // x
- else:
- return 1
-
- def run_test_for_event(self, event):
- """Tests that an exception raised in response to the given event is
- handled OK."""
- self.raiseOnEvent = event
- try:
- for i in xrange(sys.getrecursionlimit() + 1):
- sys.settrace(self.trace)
- try:
- self.f()
- except ValueError:
- pass
- else:
- self.fail("exception not thrown!")
- except RuntimeError:
- self.fail("recursion counter not reset")
-
- # Test the handling of exceptions raised by each kind of trace event.
- def test_call(self):
- self.run_test_for_event('call')
- def test_line(self):
- self.run_test_for_event('line')
- def test_return(self):
- self.run_test_for_event('return')
- def test_exception(self):
- self.run_test_for_event('exception')
-
- def test_trash_stack(self):
- def f():
- for i in range(5):
- print i # line tracing will raise an exception at this line
-
- def g(frame, why, extra):
- if (why == 'line' and
- frame.f_lineno == f.func_code.co_firstlineno + 2):
- raise RuntimeError, "i am crashing"
- return g
-
- sys.settrace(g)
- try:
- f()
- except RuntimeError:
- # the test is really that this doesn't segfault:
- import gc
- gc.collect()
- else:
- self.fail("exception not propagated")
-
-
-# 'Jump' tests: assigning to frame.f_lineno within a trace function
-# moves the execution position - it's how debuggers implement a Jump
-# command (aka. "Set next statement").
-
-class JumpTracer:
- """Defines a trace function that jumps from one place to another,
- with the source and destination lines of the jump being defined by
- the 'jump' property of the function under test."""
-
- def __init__(self, function):
- self.function = function
- self.jumpFrom = function.jump[0]
- self.jumpTo = function.jump[1]
- self.done = False
-
- def trace(self, frame, event, arg):
- if not self.done and frame.f_code == self.function.func_code:
- firstLine = frame.f_code.co_firstlineno
- if frame.f_lineno == firstLine + self.jumpFrom:
- # Cope with non-integer self.jumpTo (because of
- # no_jump_to_non_integers below).
- try:
- frame.f_lineno = firstLine + self.jumpTo
- except TypeError:
- frame.f_lineno = self.jumpTo
- self.done = True
- return self.trace
-
-# The first set of 'jump' tests are for things that are allowed:
-
-def jump_simple_forwards(output):
- output.append(1)
- output.append(2)
- output.append(3)
-
-jump_simple_forwards.jump = (1, 3)
-jump_simple_forwards.output = [3]
-
-def jump_simple_backwards(output):
- output.append(1)
- output.append(2)
-
-jump_simple_backwards.jump = (2, 1)
-jump_simple_backwards.output = [1, 1, 2]
-
-def jump_out_of_block_forwards(output):
- for i in 1, 2:
- output.append(2)
- for j in [3]: # Also tests jumping over a block
- output.append(4)
- output.append(5)
-
-jump_out_of_block_forwards.jump = (3, 5)
-jump_out_of_block_forwards.output = [2, 5]
-
-def jump_out_of_block_backwards(output):
- output.append(1)
- for i in [1]:
- output.append(3)
- for j in [2]: # Also tests jumping over a block
- output.append(5)
- output.append(6)
- output.append(7)
-
-jump_out_of_block_backwards.jump = (6, 1)
-jump_out_of_block_backwards.output = [1, 3, 5, 1, 3, 5, 6, 7]
-
-def jump_to_codeless_line(output):
- output.append(1)
- # Jumping to this line should skip to the next one.
- output.append(3)
-
-jump_to_codeless_line.jump = (1, 2)
-jump_to_codeless_line.output = [3]
-
-def jump_to_same_line(output):
- output.append(1)
- output.append(2)
- output.append(3)
-
-jump_to_same_line.jump = (2, 2)
-jump_to_same_line.output = [1, 2, 3]
-
-# Tests jumping within a finally block, and over one.
-def jump_in_nested_finally(output):
- try:
- output.append(2)
- finally:
- output.append(4)
- try:
- output.append(6)
- finally:
- output.append(8)
- output.append(9)
-
-jump_in_nested_finally.jump = (4, 9)
-jump_in_nested_finally.output = [2, 9]
-
-# The second set of 'jump' tests are for things that are not allowed:
-
-def no_jump_too_far_forwards(output):
- try:
- output.append(2)
- output.append(3)
- except ValueError, e:
- output.append('after' in str(e))
-
-no_jump_too_far_forwards.jump = (3, 6)
-no_jump_too_far_forwards.output = [2, True]
-
-def no_jump_too_far_backwards(output):
- try:
- output.append(2)
- output.append(3)
- except ValueError, e:
- output.append('before' in str(e))
-
-no_jump_too_far_backwards.jump = (3, -1)
-no_jump_too_far_backwards.output = [2, True]
-
-# Test each kind of 'except' line.
-def no_jump_to_except_1(output):
- try:
- output.append(2)
- except:
- e = sys.exc_info()[1]
- output.append('except' in str(e))
-
-no_jump_to_except_1.jump = (2, 3)
-no_jump_to_except_1.output = [True]
-
-def no_jump_to_except_2(output):
- try:
- output.append(2)
- except ValueError:
- e = sys.exc_info()[1]
- output.append('except' in str(e))
-
-no_jump_to_except_2.jump = (2, 3)
-no_jump_to_except_2.output = [True]
-
-def no_jump_to_except_3(output):
- try:
- output.append(2)
- except ValueError, e:
- output.append('except' in str(e))
-
-no_jump_to_except_3.jump = (2, 3)
-no_jump_to_except_3.output = [True]
-
-def no_jump_to_except_4(output):
- try:
- output.append(2)
- except (ValueError, RuntimeError), e:
- output.append('except' in str(e))
-
-no_jump_to_except_4.jump = (2, 3)
-no_jump_to_except_4.output = [True]
-
-def no_jump_forwards_into_block(output):
- try:
- output.append(2)
- for i in 1, 2:
- output.append(4)
- except ValueError, e:
- output.append('into' in str(e))
-
-no_jump_forwards_into_block.jump = (2, 4)
-no_jump_forwards_into_block.output = [True]
-
-def no_jump_backwards_into_block(output):
- try:
- for i in 1, 2:
- output.append(3)
- output.append(4)
- except ValueError, e:
- output.append('into' in str(e))
-
-no_jump_backwards_into_block.jump = (4, 3)
-no_jump_backwards_into_block.output = [3, 3, True]
-
-def no_jump_into_finally_block(output):
- try:
- try:
- output.append(3)
- x = 1
- finally:
- output.append(6)
- except ValueError, e:
- output.append('finally' in str(e))
-
-no_jump_into_finally_block.jump = (4, 6)
-no_jump_into_finally_block.output = [3, 6, True] # The 'finally' still runs
-
-def no_jump_out_of_finally_block(output):
- try:
- try:
- output.append(3)
- finally:
- output.append(5)
- output.append(6)
- except ValueError, e:
- output.append('finally' in str(e))
-
-no_jump_out_of_finally_block.jump = (5, 1)
-no_jump_out_of_finally_block.output = [3, True]
-
-# This verifies the line-numbers-must-be-integers rule.
-def no_jump_to_non_integers(output):
- try:
- output.append(2)
- except ValueError, e:
- output.append('integer' in str(e))
-
-no_jump_to_non_integers.jump = (2, "Spam")
-no_jump_to_non_integers.output = [True]
-
-# This verifies that you can't set f_lineno via _getframe or similar
-# trickery.
-def no_jump_without_trace_function():
- try:
- previous_frame = sys._getframe().f_back
- previous_frame.f_lineno = previous_frame.f_lineno
- except ValueError, e:
- # This is the exception we wanted; make sure the error message
- # talks about trace functions.
- if 'trace' not in str(e):
- raise
- else:
- # Something's wrong - the expected exception wasn't raised.
- raise RuntimeError, "Trace-function-less jump failed to fail"
-
-
-class JumpTestCase(unittest.TestCase):
- def compare_jump_output(self, expected, received):
- if received != expected:
- self.fail( "Outputs don't match:\n" +
- "Expected: " + repr(expected) + "\n" +
- "Received: " + repr(received))
-
- def run_test(self, func):
- tracer = JumpTracer(func)
- sys.settrace(tracer.trace)
- output = []
- func(output)
- sys.settrace(None)
- self.compare_jump_output(func.output, output)
-
- def test_01_jump_simple_forwards(self):
- self.run_test(jump_simple_forwards)
- def test_02_jump_simple_backwards(self):
- self.run_test(jump_simple_backwards)
- def test_03_jump_out_of_block_forwards(self):
- self.run_test(jump_out_of_block_forwards)
- def test_04_jump_out_of_block_backwards(self):
- self.run_test(jump_out_of_block_backwards)
- def test_05_jump_to_codeless_line(self):
- self.run_test(jump_to_codeless_line)
- def test_06_jump_to_same_line(self):
- self.run_test(jump_to_same_line)
- def test_07_jump_in_nested_finally(self):
- self.run_test(jump_in_nested_finally)
- def test_08_no_jump_too_far_forwards(self):
- self.run_test(no_jump_too_far_forwards)
- def test_09_no_jump_too_far_backwards(self):
- self.run_test(no_jump_too_far_backwards)
- def test_10_no_jump_to_except_1(self):
- self.run_test(no_jump_to_except_1)
- def test_11_no_jump_to_except_2(self):
- self.run_test(no_jump_to_except_2)
- def test_12_no_jump_to_except_3(self):
- self.run_test(no_jump_to_except_3)
- def test_13_no_jump_to_except_4(self):
- self.run_test(no_jump_to_except_4)
- def test_14_no_jump_forwards_into_block(self):
- self.run_test(no_jump_forwards_into_block)
- def test_15_no_jump_backwards_into_block(self):
- self.run_test(no_jump_backwards_into_block)
- def test_16_no_jump_into_finally_block(self):
- self.run_test(no_jump_into_finally_block)
- def test_17_no_jump_out_of_finally_block(self):
- self.run_test(no_jump_out_of_finally_block)
- def test_18_no_jump_to_non_integers(self):
- self.run_test(no_jump_to_non_integers)
- def test_19_no_jump_without_trace_function(self):
- no_jump_without_trace_function()
-
- def test_20_large_function(self):
- d = {}
- exec("""def f(output): # line 0
- x = 0 # line 1
- y = 1 # line 2
- ''' # line 3
- %s # lines 4-1004
- ''' # line 1005
- x += 1 # line 1006
- output.append(x) # line 1007
- return""" % ('\n' * 1000,), d)
- f = d['f']
-
- f.jump = (2, 1007)
- f.output = [0]
- self.run_test(f)
+ rmtree(TESTFN)
+ unlink(TESTFN)
+
+ def _coverage(self, tracer,
+ cmd='from test import test_pprint; test_pprint.test_main()'):
+ tracer.run(cmd)
+ r = tracer.results()
+ r.write_results(show_missing=True, summary=True, coverdir=TESTFN)
+
+ def test_coverage(self):
+ tracer = trace.Trace(trace=0, count=1)
+ with captured_stdout() as stdout:
+ self._coverage(tracer)
+ stdout = stdout.getvalue()
+ self.assertTrue("pprint.py" in stdout)
+ self.assertTrue("case.py" in stdout) # from unittest
+ files = os.listdir(TESTFN)
+ self.assertTrue("pprint.cover" in files)
+ self.assertTrue("unittest.case.cover" in files)
+
+ def test_coverage_ignore(self):
+ # Ignore all files, nothing should be traced nor printed
+ libpath = os.path.normpath(os.path.dirname(os.__file__))
+ # sys.prefix does not work when running from a checkout
+ tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix, libpath],
+ trace=0, count=1)
+ with captured_stdout() as stdout:
+ self._coverage(tracer)
+ if os.path.exists(TESTFN):
+ files = os.listdir(TESTFN)
+ self.assertEqual(files, [])
+
+ def test_issue9936(self):
+ tracer = trace.Trace(trace=0, count=1)
+ modname = 'test.tracedmodules.testmod'
+ # Ensure that the module is executed in import
+ if modname in sys.modules:
+ del sys.modules[modname]
+ cmd = ("import test.tracedmodules.testmod as t;"
+ "t.func(0); t.func2();")
+ with captured_stdout() as stdout:
+ self._coverage(tracer, cmd)
+ stdout.seek(0)
+ stdout.readline()
+ coverage = {}
+ for line in stdout:
+ lines, cov, module = line.split()[:3]
+ coverage[module] = (int(lines), int(cov[:-1]))
+ # XXX This is needed to run regrtest.py as a script
+ modname = trace.fullmodname(sys.modules[modname].__file__)
+ self.assertIn(modname, coverage)
+ self.assertEqual(coverage[modname], (5, 100))
+
def test_main():
- test_support.run_unittest(
- TraceTestCase,
- RaisingTraceFuncTestCase,
- JumpTestCase
- )
+ run_unittest(__name__)
+
-if __name__ == "__main__":
+if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index 8b93844f28..8076be8a78 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -9,16 +9,6 @@ from test.test_support import run_unittest, is_jython, Error
import traceback
-try:
- raise KeyError
-except KeyError:
- type_, value, tb = sys.exc_info()
- file_ = StringIO()
- traceback_print(tb, file_)
- example_traceback = file_.getvalue()
-else:
- raise Error("unable to create test traceback string")
-
class TracebackCases(unittest.TestCase):
# For now, a very minimal set of tests. I want to be sure that
@@ -48,16 +38,16 @@ class TracebackCases(unittest.TestCase):
def test_caret(self):
err = self.get_exception_format(self.syntax_error_with_caret,
SyntaxError)
- self.assert_(len(err) == 4)
- self.assert_(err[1].strip() == "return x!")
- self.assert_("^" in err[2]) # third line has caret
- self.assert_(err[1].find("!") == err[2].find("^")) # in the right place
+ self.assertTrue(len(err) == 4)
+ self.assertTrue(err[1].strip() == "return x!")
+ self.assertIn("^", err[2]) # third line has caret
+ self.assertTrue(err[1].find("!") == err[2].find("^")) # in the right place
err = self.get_exception_format(self.syntax_error_with_caret_2,
SyntaxError)
- self.assert_("^" in err[2]) # third line has caret
- self.assert_(err[2].count('\n') == 1) # and no additional newline
- self.assert_(err[1].find("+") == err[2].find("^")) # in the right place
+ self.assertIn("^", err[2]) # third line has caret
+ self.assertTrue(err[2].count('\n') == 1) # and no additional newline
+ self.assertTrue(err[1].find("+") == err[2].find("^")) # in the right place
def test_nocaret(self):
if is_jython:
@@ -65,19 +55,19 @@ class TracebackCases(unittest.TestCase):
return
err = self.get_exception_format(self.syntax_error_without_caret,
SyntaxError)
- self.assert_(len(err) == 3)
- self.assert_(err[1].strip() == "[x for x in x] = x")
+ self.assertTrue(len(err) == 3)
+ self.assertTrue(err[1].strip() == "[x for x in x] = x")
def test_bad_indentation(self):
err = self.get_exception_format(self.syntax_error_bad_indentation,
IndentationError)
- self.assert_(len(err) == 4)
- self.assert_(err[1].strip() == "print 2")
- self.assert_("^" in err[2])
- self.assert_(err[1].find("2") == err[2].find("^"))
+ self.assertTrue(len(err) == 4)
+ self.assertTrue(err[1].strip() == "print 2")
+ self.assertIn("^", err[2])
+ self.assertTrue(err[1].find("2") == err[2].find("^"))
def test_bug737473(self):
- import sys, os, tempfile, time
+ import os, tempfile, time
savedpath = sys.path[:]
testdir = tempfile.mkdtemp()
@@ -114,7 +104,7 @@ def test():
test_bug737473.test()
except NotImplementedError:
src = traceback.extract_tb(sys.exc_traceback)[-1][-1]
- self.failUnlessEqual(src, 'raise NotImplementedError')
+ self.assertEqual(src, 'raise NotImplementedError')
finally:
sys.path[:] = savedpath
for f in os.listdir(testdir):
@@ -181,14 +171,29 @@ def test():
class TracebackFormatTests(unittest.TestCase):
- def test_traceback_indentation(self):
+ def test_traceback_format(self):
+ try:
+ raise KeyError('blah')
+ except KeyError:
+ type_, value, tb = sys.exc_info()
+ traceback_fmt = 'Traceback (most recent call last):\n' + \
+ ''.join(traceback.format_tb(tb))
+ file_ = StringIO()
+ traceback_print(tb, file_)
+ python_fmt = file_.getvalue()
+ else:
+ raise Error("unable to create test traceback string")
+
+ # Make sure that Python and the traceback module format the same thing
+ self.assertEqual(traceback_fmt, python_fmt)
+
# Make sure that the traceback is properly indented.
- tb_lines = example_traceback.splitlines()
- self.assertEquals(len(tb_lines), 3)
+ tb_lines = python_fmt.splitlines()
+ self.assertEqual(len(tb_lines), 3)
banner, location, source_line = tb_lines
- self.assert_(banner.startswith('Traceback'))
- self.assert_(location.startswith(' File'))
- self.assert_(source_line.startswith(' raise'))
+ self.assertTrue(banner.startswith('Traceback'))
+ self.assertTrue(location.startswith(' File'))
+ self.assertTrue(source_line.startswith(' raise'))
def test_main():
diff --git a/Lib/test/test_transformer.py b/Lib/test/test_transformer.py
index 65909372e6..1891ac486e 100644
--- a/Lib/test/test_transformer.py
+++ b/Lib/test/test_transformer.py
@@ -17,11 +17,11 @@ class Tests(unittest.TestCase):
for s in snippets:
a = transformer.parse(s)
- assert isinstance(a, ast.Module)
+ self.assertIsInstance(a, ast.Module)
child1 = a.getChildNodes()[0]
- assert isinstance(child1, ast.Stmt)
+ self.assertIsInstance(child1, ast.Stmt)
child2 = child1.getChildNodes()[0]
- assert isinstance(child2, ast.Assign)
+ self.assertIsInstance(child2, ast.Assign)
# This actually tests the compiler, but it's a way to assure the ast
# is correct
diff --git a/Lib/test/test_ttk_guionly.py b/Lib/test/test_ttk_guionly.py
new file mode 100644
index 0000000000..60a57f09e3
--- /dev/null
+++ b/Lib/test/test_ttk_guionly.py
@@ -0,0 +1,40 @@
+import os
+import unittest
+from test import test_support
+
+# Skip this test if _tkinter wasn't built.
+test_support.import_module('_tkinter')
+
+import ttk
+from _tkinter import TclError
+
+try:
+ ttk.Button()
+except TclError, msg:
+ # assuming ttk is not available
+ raise unittest.SkipTest("ttk not available: %s" % msg)
+
+this_dir = os.path.dirname(os.path.abspath(__file__))
+lib_tk_test = os.path.abspath(os.path.join(this_dir, os.path.pardir,
+ 'lib-tk', 'test'))
+
+with test_support.DirsOnSysPath(lib_tk_test):
+ import runtktests
+
+def test_main(enable_gui=False):
+ if enable_gui:
+ if test_support.use_resources is None:
+ test_support.use_resources = ['gui']
+ elif 'gui' not in test_support.use_resources:
+ test_support.use_resources.append('gui')
+
+ with test_support.DirsOnSysPath(lib_tk_test):
+ from test_ttk.support import get_tk_root
+ try:
+ test_support.run_unittest(
+ *runtktests.get_tests(text=False, packages=['test_ttk']))
+ finally:
+ get_tk_root().destroy()
+
+if __name__ == '__main__':
+ test_main(enable_gui=True)
diff --git a/Lib/test/test_ttk_textonly.py b/Lib/test/test_ttk_textonly.py
new file mode 100644
index 0000000000..ed92043d7b
--- /dev/null
+++ b/Lib/test/test_ttk_textonly.py
@@ -0,0 +1,19 @@
+import os
+from test import test_support
+
+# Skip this test if _tkinter does not exist.
+test_support.import_module('_tkinter')
+
+this_dir = os.path.dirname(os.path.abspath(__file__))
+lib_tk_test = os.path.abspath(os.path.join(this_dir, '..', 'lib-tk', 'test'))
+
+with test_support.DirsOnSysPath(lib_tk_test):
+ import runtktests
+
+def test_main():
+ with test_support.DirsOnSysPath(lib_tk_test):
+ test_support.run_unittest(
+ *runtktests.get_tests(gui=False, packages=['test_ttk']))
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_tuple.py b/Lib/test/test_tuple.py
index 15bc2956cf..0c308f0e06 100644
--- a/Lib/test/test_tuple.py
+++ b/Lib/test/test_tuple.py
@@ -1,15 +1,17 @@
from test import test_support, seq_tests
+import gc
+
class TupleTest(seq_tests.CommonTest):
type2test = tuple
def test_constructors(self):
- super(TupleTest, self).test_len()
+ super(TupleTest, self).test_constructors()
# calling built-in types without argument must return empty
self.assertEqual(tuple(), ())
t0_3 = (0, 1, 2, 3)
t0_3_bis = tuple(t0_3)
- self.assert_(t0_3 is t0_3_bis)
+ self.assertTrue(t0_3 is t0_3_bis)
self.assertEqual(tuple([]), ())
self.assertEqual(tuple([0, 1, 2, 3]), (0, 1, 2, 3))
self.assertEqual(tuple(''), ())
@@ -17,8 +19,8 @@ class TupleTest(seq_tests.CommonTest):
def test_truth(self):
super(TupleTest, self).test_truth()
- self.assert_(not ())
- self.assert_((42, ))
+ self.assertTrue(not ())
+ self.assertTrue((42, ))
def test_len(self):
super(TupleTest, self).test_len()
@@ -31,14 +33,14 @@ class TupleTest(seq_tests.CommonTest):
u = (0, 1)
u2 = u
u += (2, 3)
- self.assert_(u is not u2)
+ self.assertTrue(u is not u2)
def test_imul(self):
super(TupleTest, self).test_imul()
u = (0, 1)
u2 = u
u *= 3
- self.assert_(u is not u2)
+ self.assertTrue(u is not u2)
def test_tupleresizebug(self):
# Check that a specific bug in _PyTuple_Resize() is squashed.
@@ -69,7 +71,7 @@ class TupleTest(seq_tests.CommonTest):
inps = base + [(i, j) for i in base for j in xp] + \
[(i, j) for i in xp for j in base] + xp + zip(base)
collisions = len(inps) - len(set(map(hash, inps)))
- self.assert_(collisions <= 15)
+ self.assertTrue(collisions <= 15)
def test_repr(self):
l0 = tuple()
@@ -82,6 +84,76 @@ class TupleTest(seq_tests.CommonTest):
self.assertEqual(repr(a0), "()")
self.assertEqual(repr(a2), "(0, 1, 2)")
+ def _not_tracked(self, t):
+ # Nested tuples can take several collections to untrack
+ gc.collect()
+ gc.collect()
+ self.assertFalse(gc.is_tracked(t), t)
+
+ def _tracked(self, t):
+ self.assertTrue(gc.is_tracked(t), t)
+ gc.collect()
+ gc.collect()
+ self.assertTrue(gc.is_tracked(t), t)
+
+ @test_support.cpython_only
+ def test_track_literals(self):
+ # Test GC-optimization of tuple literals
+ x, y, z = 1.5, "a", []
+
+ self._not_tracked(())
+ self._not_tracked((1,))
+ self._not_tracked((1, 2))
+ self._not_tracked((1, 2, "a"))
+ self._not_tracked((1, 2, (None, True, False, ()), int))
+ self._not_tracked((object(),))
+ self._not_tracked(((1, x), y, (2, 3)))
+
+ # Tuples with mutable elements are always tracked, even if those
+ # elements are not tracked right now.
+ self._tracked(([],))
+ self._tracked(([1],))
+ self._tracked(({},))
+ self._tracked((set(),))
+ self._tracked((x, y, z))
+
+ def check_track_dynamic(self, tp, always_track):
+ x, y, z = 1.5, "a", []
+
+ check = self._tracked if always_track else self._not_tracked
+ check(tp())
+ check(tp([]))
+ check(tp(set()))
+ check(tp([1, x, y]))
+ check(tp(obj for obj in [1, x, y]))
+ check(tp(set([1, x, y])))
+ check(tp(tuple([obj]) for obj in [1, x, y]))
+ check(tuple(tp([obj]) for obj in [1, x, y]))
+
+ self._tracked(tp([z]))
+ self._tracked(tp([[x, y]]))
+ self._tracked(tp([{x: y}]))
+ self._tracked(tp(obj for obj in [x, y, z]))
+ self._tracked(tp(tuple([obj]) for obj in [x, y, z]))
+ self._tracked(tuple(tp([obj]) for obj in [x, y, z]))
+
+ @test_support.cpython_only
+ def test_track_dynamic(self):
+ # Test GC-optimization of dynamically constructed tuples.
+ self.check_track_dynamic(tuple, False)
+
+ @test_support.cpython_only
+ def test_track_subtypes(self):
+ # Tuple subtypes must always be tracked
+ class MyTuple(tuple):
+ pass
+ self.check_track_dynamic(MyTuple, True)
+
+ @test_support.cpython_only
+ def test_bug7466(self):
+ # Trying to untrack an unfinished tuple could crash Python
+ self._not_tracked(tuple(gc.collect() for i in range(101)))
+
def test_main():
test_support.run_unittest(TupleTest)
diff --git a/Lib/test/test_typechecks.py b/Lib/test/test_typechecks.py
index 32aa660346..83f0114b1b 100644
--- a/Lib/test/test_typechecks.py
+++ b/Lib/test/test_typechecks.py
@@ -29,10 +29,6 @@ class SubInt(Integer):
pass
-class Evil:
- def __instancecheck__(self, inst): return False
-
-
class TypeChecksTest(unittest.TestCase):
def testIsSubclassInternal(self):
@@ -75,11 +71,18 @@ class TypeChecksTest(unittest.TestCase):
self.assertEqual(isinstance(42, SubInt), False)
self.assertEqual(isinstance(42, (SubInt,)), False)
- def testInfiniteRecursionCaughtProperly(self):
- e = Evil()
- # This invokes isinstance() recursively, until the stack is exhausted.
- self.assertRaises(RuntimeError, isinstance, e, Evil)
- # XXX How to check the same situation for issubclass()?
+ def test_oldstyle(self):
+ # These should just be ignored.
+ class X:
+ def __instancecheck__(self, inst):
+ return True
+ def __subclasscheck__(self, cls):
+ return True
+ class Sub(X): pass
+ self.assertNotIsInstance(3, X)
+ self.assertIsInstance(X(), X)
+ self.assertFalse(issubclass(int, X))
+ self.assertTrue(issubclass(Sub, X))
def test_main():
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index dee1ca7d70..60f6d2f1e2 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -1,7 +1,7 @@
# Python test set -- part 6, built-in types
from test.test_support import run_unittest, have_unicode, run_with_locale, \
- _check_py3k_warnings
+ check_py3k_warnings
import unittest
import sys
import locale
@@ -21,7 +21,6 @@ class TypesTests(unittest.TestCase):
if not {'x': 1}: self.fail('{\'x\': 1} is false instead of true')
def f(): pass
class C: pass
- import sys
x = C()
if not f: self.fail('f is false instead of true')
if not C: self.fail('C is false instead of true')
@@ -114,6 +113,9 @@ class TypesTests(unittest.TestCase):
self.assertEqual(1.5e-101.__format__('e'), '1.500000e-101')
self.assertEqual('%e' % 1.5e-101, '1.500000e-101')
+ self.assertEqual('%g' % 1.0, '1')
+ self.assertEqual('%#g' % 1.0, '1.00000')
+
def test_normal_integers(self):
# Ensure the first 256 integers are shared
a = 256
@@ -403,6 +405,9 @@ class TypesTests(unittest.TestCase):
test(123456, "#012X", '0X000001E240')
test(-123456, "#012X", '-0X00001E240')
+ # issue 5782, commas with no specifier type
+ test(1234, '010,', '00,001,234')
+
# make sure these are errors
# precision disallowed
@@ -413,6 +418,9 @@ class TypesTests(unittest.TestCase):
self.assertRaises(TypeError, 3 .__format__, None)
self.assertRaises(TypeError, 3 .__format__, 0)
+ # can't have ',' with 'c'
+ self.assertRaises(ValueError, 3 .__format__, ",c")
+
# ensure that only int and float type specifiers work
for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] +
[chr(x) for x in range(ord('A'), ord('Z')+1)]):
@@ -428,6 +436,17 @@ class TypesTests(unittest.TestCase):
self.assertEqual(value.__format__(format_spec),
float(value).__format__(format_spec))
+ # Issue 6902
+ test(123456, "0<20", '12345600000000000000')
+ test(123456, "1<20", '12345611111111111111')
+ test(123456, "*<20", '123456**************')
+ test(123456, "0>20", '00000000000000123456')
+ test(123456, "1>20", '11111111111111123456')
+ test(123456, "*>20", '**************123456')
+ test(123456, "0=20", '00000000000000123456')
+ test(123456, "1=20", '11111111111111123456')
+ test(123456, "*=20", '**************123456')
+
def test_long__format__(self):
def test(i, format_spec, result):
# make sure we're not accidentally checking ints
@@ -525,6 +544,16 @@ class TypesTests(unittest.TestCase):
for value in [0L, 1L, -1L, 100L, -100L, 1234567890L, -1234567890L]:
self.assertEqual(value.__format__(format_spec),
float(value).__format__(format_spec))
+ # Issue 6902
+ test(123456L, "0<20", '12345600000000000000')
+ test(123456L, "1<20", '12345611111111111111')
+ test(123456L, "*<20", '123456**************')
+ test(123456L, "0>20", '00000000000000123456')
+ test(123456L, "1>20", '11111111111111123456')
+ test(123456L, "*>20", '**************123456')
+ test(123456L, "0=20", '00000000000000123456')
+ test(123456L, "1=20", '11111111111111123456')
+ test(123456L, "*=20", '**************123456')
@run_with_locale('LC_NUMERIC', 'en_US.UTF8')
def test_float__format__locale(self):
@@ -593,10 +622,25 @@ class TypesTests(unittest.TestCase):
test(-1.0, ' f', '-1.000000')
test( 1.0, '+f', '+1.000000')
test(-1.0, '+f', '-1.000000')
- test(1.1234e90, 'f', '1.1234e+90')
- test(1.1234e90, 'F', '1.1234e+90')
- test(1.1234e200, 'f', '1.1234e+200')
- test(1.1234e200, 'F', '1.1234e+200')
+
+ # Python versions <= 2.6 switched from 'f' to 'g' formatting for
+ # values larger than 1e50. No longer.
+ f = 1.1234e90
+ for fmt in 'f', 'F':
+ # don't do a direct equality check, since on some
+ # platforms only the first few digits of dtoa
+ # will be reliable
+ result = f.__format__(fmt)
+ self.assertEqual(len(result), 98)
+ self.assertEqual(result[-7], '.')
+ self.assertIn(result[:12], ('112340000000', '112339999999'))
+ f = 1.1234e200
+ for fmt in 'f', 'F':
+ result = f.__format__(fmt)
+ self.assertEqual(len(result), 208)
+ self.assertEqual(result[-7], '.')
+ self.assertIn(result[:12], ('112340000000', '112339999999'))
+
test( 1.0, 'e', '1.000000e+00')
test(-1.0, 'e', '-1.000000e+00')
@@ -610,11 +654,40 @@ class TypesTests(unittest.TestCase):
# a totaly empty format specifier means something else.
# So, just use a sign flag
test(1e200, '+g', '+1e+200')
- test(1e200, '+', '+1.0e+200')
+ test(1e200, '+', '+1e+200')
+ test(1.1e200, '+g', '+1.1e+200')
+ test(1.1e200, '+', '+1.1e+200')
+
test(1.1e200, '+g', '+1.1e+200')
test(1.1e200, '+', '+1.1e+200')
- # % formatting
+ # 0 padding
+ test(1234., '010f', '1234.000000')
+ test(1234., '011f', '1234.000000')
+ test(1234., '012f', '01234.000000')
+ test(-1234., '011f', '-1234.000000')
+ test(-1234., '012f', '-1234.000000')
+ test(-1234., '013f', '-01234.000000')
+ test(-1234.12341234, '013f', '-01234.123412')
+ test(-123456.12341234, '011.2f', '-0123456.12')
+
+ # issue 5782, commas with no specifier type
+ test(1.2, '010,.2', '0,000,001.2')
+
+ # 0 padding with commas
+ test(1234., '011,f', '1,234.000000')
+ test(1234., '012,f', '1,234.000000')
+ test(1234., '013,f', '01,234.000000')
+ test(-1234., '012,f', '-1,234.000000')
+ test(-1234., '013,f', '-1,234.000000')
+ test(-1234., '014,f', '-01,234.000000')
+ test(-12345., '015,f', '-012,345.000000')
+ test(-123456., '016,f', '-0,123,456.000000')
+ test(-123456., '017,f', '-0,123,456.000000')
+ test(-123456.12341234, '017,f', '-0,123,456.123412')
+ test(-123456.12341234, '013,.2f', '-0,123,456.12')
+
+ # % formatting
test(-1.0, '%', '-100.000000%')
# format spec must be string
@@ -638,9 +711,43 @@ class TypesTests(unittest.TestCase):
self.assertRaises(ValueError, format, 0.0, '#')
self.assertRaises(ValueError, format, 0.0, '#20f')
+ # Issue 6902
+ test(12345.6, "0<20", '12345.60000000000000')
+ test(12345.6, "1<20", '12345.61111111111111')
+ test(12345.6, "*<20", '12345.6*************')
+ test(12345.6, "0>20", '000000000000012345.6')
+ test(12345.6, "1>20", '111111111111112345.6')
+ test(12345.6, "*>20", '*************12345.6')
+ test(12345.6, "0=20", '000000000000012345.6')
+ test(12345.6, "1=20", '111111111111112345.6')
+ test(12345.6, "*=20", '*************12345.6')
+
+ def test_format_spec_errors(self):
+ # int, float, and string all share the same format spec
+ # mini-language parser.
+
+ # Check that we can't ask for too many digits. This is
+ # probably a CPython specific test. It tries to put the width
+ # into a C long.
+ self.assertRaises(ValueError, format, 0, '1'*10000 + 'd')
+
+ # Similar with the precision.
+ self.assertRaises(ValueError, format, 0, '.' + '1'*10000 + 'd')
+
+ # And may as well test both.
+ self.assertRaises(ValueError, format, 0, '1'*1000 + '.' + '1'*10000 + 'd')
+
+ # Make sure commas aren't allowed with various type codes
+ for code in 'xXobns':
+ self.assertRaises(ValueError, format, 0, ',' + code)
+
+ def test_internal_sizes(self):
+ self.assertGreater(object.__basicsize__, 0)
+ self.assertGreater(tuple.__itemsize__, 0)
+
def test_main():
- with _check_py3k_warnings(
+ with check_py3k_warnings(
("buffer.. not supported", DeprecationWarning),
("classic long division", DeprecationWarning)):
run_unittest(TypesTests)
diff --git a/Lib/test/test_unary.py b/Lib/test/test_unary.py
index 9854f64d0c..598fca8fcf 100644
--- a/Lib/test/test_unary.py
+++ b/Lib/test/test_unary.py
@@ -6,32 +6,32 @@ from test.test_support import run_unittest, have_unicode
class UnaryOpTestCase(unittest.TestCase):
def test_negative(self):
- self.assert_(-2 == 0 - 2)
- self.assert_(-0 == 0)
- self.assert_(--2 == 2)
- self.assert_(-2L == 0 - 2L)
- self.assert_(-2.0 == 0 - 2.0)
- self.assert_(-2j == 0 - 2j)
+ self.assertTrue(-2 == 0 - 2)
+ self.assertTrue(-0 == 0)
+ self.assertTrue(--2 == 2)
+ self.assertTrue(-2L == 0 - 2L)
+ self.assertTrue(-2.0 == 0 - 2.0)
+ self.assertTrue(-2j == 0 - 2j)
def test_positive(self):
- self.assert_(+2 == 2)
- self.assert_(+0 == 0)
- self.assert_(++2 == 2)
- self.assert_(+2L == 2L)
- self.assert_(+2.0 == 2.0)
- self.assert_(+2j == 2j)
+ self.assertTrue(+2 == 2)
+ self.assertTrue(+0 == 0)
+ self.assertTrue(++2 == 2)
+ self.assertTrue(+2L == 2L)
+ self.assertTrue(+2.0 == 2.0)
+ self.assertTrue(+2j == 2j)
def test_invert(self):
- self.assert_(-2 == 0 - 2)
- self.assert_(-0 == 0)
- self.assert_(--2 == 2)
- self.assert_(-2L == 0 - 2L)
+ self.assertTrue(-2 == 0 - 2)
+ self.assertTrue(-0 == 0)
+ self.assertTrue(--2 == 2)
+ self.assertTrue(-2L == 0 - 2L)
def test_no_overflow(self):
nines = "9" * 32
- self.assert_(eval("+" + nines) == eval("+" + nines + "L"))
- self.assert_(eval("-" + nines) == eval("-" + nines + "L"))
- self.assert_(eval("~" + nines) == eval("~" + nines + "L"))
+ self.assertTrue(eval("+" + nines) == eval("+" + nines + "L"))
+ self.assertTrue(eval("-" + nines) == eval("-" + nines + "L"))
+ self.assertTrue(eval("~" + nines) == eval("~" + nines + "L"))
def test_negation_of_exponentiation(self):
# Make sure '**' does the right thing; these form a
diff --git a/Lib/test/test_undocumented_details.py b/Lib/test/test_undocumented_details.py
index bc9007b306..a8fc280c67 100644
--- a/Lib/test/test_undocumented_details.py
+++ b/Lib/test/test_undocumented_details.py
@@ -1,6 +1,5 @@
-from test.test_support import run_unittest, _check_py3k_warnings
+from test.test_support import run_unittest, check_py3k_warnings
import unittest
-import sys
class TestImplementationComparisons(unittest.TestCase):
@@ -33,7 +32,7 @@ class TestImplementationComparisons(unittest.TestCase):
self.assertTrue(g_cell != h_cell)
def test_main():
- with _check_py3k_warnings():
+ with check_py3k_warnings():
run_unittest(TestImplementationComparisons)
if __name__ == '__main__':
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index 35134ec81e..bd43dbc57b 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -1,4 +1,3 @@
-# -*- coding: iso-8859-1 -*-
""" Test script for the Unicode implementation.
Written by Marc-Andre Lemburg (mal@lemburg.com).
@@ -34,11 +33,21 @@ class UnicodeTest(
):
type2test = unicode
+ def assertEqual(self, first, second, msg=None):
+ # strict assertEqual method: reject implicit bytes/unicode equality
+ super(UnicodeTest, self).assertEqual(first, second, msg)
+ if isinstance(first, unicode) or isinstance(second, unicode):
+ self.assertIsInstance(first, unicode)
+ self.assertIsInstance(second, unicode)
+ elif isinstance(first, str) or isinstance(second, str):
+ self.assertIsInstance(first, str)
+ self.assertIsInstance(second, str)
+
def checkequalnofix(self, result, object, methodname, *args):
method = getattr(object, methodname)
realresult = method(*args)
self.assertEqual(realresult, result)
- self.assert_(type(realresult) is type(result))
+ self.assertTrue(type(realresult) is type(result))
# if the original is returned make sure that
# this doesn't happen with subclasses
@@ -50,7 +59,7 @@ class UnicodeTest(
method = getattr(object, methodname)
realresult = method(*args)
self.assertEqual(realresult, result)
- self.assert_(object is not realresult)
+ self.assertTrue(object is not realresult)
def test_literals(self):
self.assertEqual(u'\xff', u'\u00ff')
@@ -197,28 +206,28 @@ class UnicodeTest(
def test_comparison(self):
# Comparisons:
- self.assertEqual(u'abc', 'abc')
- self.assertEqual('abc', u'abc')
- self.assertEqual(u'abc', u'abc')
- self.assert_(u'abcd' > 'abc')
- self.assert_('abcd' > u'abc')
- self.assert_(u'abcd' > u'abc')
- self.assert_(u'abc' < 'abcd')
- self.assert_('abc' < u'abcd')
- self.assert_(u'abc' < u'abcd')
+ self.assertTrue(u'abc' == 'abc')
+ self.assertTrue('abc' == u'abc')
+ self.assertTrue(u'abc' == u'abc')
+ self.assertTrue(u'abcd' > 'abc')
+ self.assertTrue('abcd' > u'abc')
+ self.assertTrue(u'abcd' > u'abc')
+ self.assertTrue(u'abc' < 'abcd')
+ self.assertTrue('abc' < u'abcd')
+ self.assertTrue(u'abc' < u'abcd')
if 0:
# Move these tests to a Unicode collation module test...
# Testing UTF-16 code point order comparisons...
# No surrogates, no fixup required.
- self.assert_(u'\u0061' < u'\u20ac')
+ self.assertTrue(u'\u0061' < u'\u20ac')
# Non surrogate below surrogate value, no fixup required
- self.assert_(u'\u0061' < u'\ud800\udc02')
+ self.assertTrue(u'\u0061' < u'\ud800\udc02')
# Non surrogate above surrogate value, fixup required
def test_lecmp(s, s2):
- self.assert_(s < s2)
+ self.assertTrue(s < s2)
def test_fixup(s):
s2 = u'\ud800\udc01'
@@ -258,7 +267,7 @@ class UnicodeTest(
test_fixup(u'\uff61')
# Surrogates on both sides, no fixup required
- self.assert_(u'\ud800\udc02' < u'\ud84d\udc56')
+ self.assertTrue(u'\ud800\udc02' < u'\ud84d\udc56')
def test_islower(self):
string_tests.MixinStrUnicodeUserStringTest.test_islower(self)
@@ -316,65 +325,67 @@ class UnicodeTest(
def test_contains(self):
# Testing Unicode contains method
- self.assert_('a' in u'abdb')
- self.assert_('a' in u'bdab')
- self.assert_('a' in u'bdaba')
- self.assert_('a' in u'bdba')
- self.assert_('a' in u'bdba')
- self.assert_(u'a' in u'bdba')
- self.assert_(u'a' not in u'bdb')
- self.assert_(u'a' not in 'bdb')
- self.assert_(u'a' in 'bdba')
- self.assert_(u'a' in ('a',1,None))
- self.assert_(u'a' in (1,None,'a'))
- self.assert_(u'a' in (1,None,u'a'))
- self.assert_('a' in ('a',1,None))
- self.assert_('a' in (1,None,'a'))
- self.assert_('a' in (1,None,u'a'))
- self.assert_('a' not in ('x',1,u'y'))
- self.assert_('a' not in ('x',1,None))
- self.assert_(u'abcd' not in u'abcxxxx')
- self.assert_(u'ab' in u'abcd')
- self.assert_('ab' in u'abc')
- self.assert_(u'ab' in 'abc')
- self.assert_(u'ab' in (1,None,u'ab'))
- self.assert_(u'' in u'abc')
- self.assert_('' in u'abc')
+ self.assertIn('a', u'abdb')
+ self.assertIn('a', u'bdab')
+ self.assertIn('a', u'bdaba')
+ self.assertIn('a', u'bdba')
+ self.assertIn('a', u'bdba')
+ self.assertIn(u'a', u'bdba')
+ self.assertNotIn(u'a', u'bdb')
+ self.assertNotIn(u'a', 'bdb')
+ self.assertIn(u'a', 'bdba')
+ self.assertIn(u'a', ('a',1,None))
+ self.assertIn(u'a', (1,None,'a'))
+ self.assertIn(u'a', (1,None,u'a'))
+ self.assertIn('a', ('a',1,None))
+ self.assertIn('a', (1,None,'a'))
+ self.assertIn('a', (1,None,u'a'))
+ self.assertNotIn('a', ('x',1,u'y'))
+ self.assertNotIn('a', ('x',1,None))
+ self.assertNotIn(u'abcd', u'abcxxxx')
+ self.assertIn(u'ab', u'abcd')
+ self.assertIn('ab', u'abc')
+ self.assertIn(u'ab', 'abc')
+ self.assertIn(u'ab', (1,None,u'ab'))
+ self.assertIn(u'', u'abc')
+ self.assertIn('', u'abc')
# If the following fails either
# the contains operator does not propagate UnicodeErrors or
# someone has changed the default encoding
- self.assertRaises(UnicodeError, 'g\xe2teau'.__contains__, u'\xe2')
-
- self.assert_(u'' in '')
- self.assert_('' in u'')
- self.assert_(u'' in u'')
- self.assert_(u'' in 'abc')
- self.assert_('' in u'abc')
- self.assert_(u'' in u'abc')
- self.assert_(u'\0' not in 'abc')
- self.assert_('\0' not in u'abc')
- self.assert_(u'\0' not in u'abc')
- self.assert_(u'\0' in '\0abc')
- self.assert_('\0' in u'\0abc')
- self.assert_(u'\0' in u'\0abc')
- self.assert_(u'\0' in 'abc\0')
- self.assert_('\0' in u'abc\0')
- self.assert_(u'\0' in u'abc\0')
- self.assert_(u'a' in '\0abc')
- self.assert_('a' in u'\0abc')
- self.assert_(u'a' in u'\0abc')
- self.assert_(u'asdf' in 'asdf')
- self.assert_('asdf' in u'asdf')
- self.assert_(u'asdf' in u'asdf')
- self.assert_(u'asdf' not in 'asd')
- self.assert_('asdf' not in u'asd')
- self.assert_(u'asdf' not in u'asd')
- self.assert_(u'asdf' not in '')
- self.assert_('asdf' not in u'')
- self.assert_(u'asdf' not in u'')
+ self.assertRaises(UnicodeDecodeError, 'g\xe2teau'.__contains__, u'\xe2')
+ self.assertRaises(UnicodeDecodeError, u'g\xe2teau'.__contains__, '\xe2')
+
+ self.assertIn(u'', '')
+ self.assertIn('', u'')
+ self.assertIn(u'', u'')
+ self.assertIn(u'', 'abc')
+ self.assertIn('', u'abc')
+ self.assertIn(u'', u'abc')
+ self.assertNotIn(u'\0', 'abc')
+ self.assertNotIn('\0', u'abc')
+ self.assertNotIn(u'\0', u'abc')
+ self.assertIn(u'\0', '\0abc')
+ self.assertIn('\0', u'\0abc')
+ self.assertIn(u'\0', u'\0abc')
+ self.assertIn(u'\0', 'abc\0')
+ self.assertIn('\0', u'abc\0')
+ self.assertIn(u'\0', u'abc\0')
+ self.assertIn(u'a', '\0abc')
+ self.assertIn('a', u'\0abc')
+ self.assertIn(u'a', u'\0abc')
+ self.assertIn(u'asdf', 'asdf')
+ self.assertIn('asdf', u'asdf')
+ self.assertIn(u'asdf', u'asdf')
+ self.assertNotIn(u'asdf', 'asd')
+ self.assertNotIn('asdf', u'asd')
+ self.assertNotIn(u'asdf', u'asd')
+ self.assertNotIn(u'asdf', '')
+ self.assertNotIn('asdf', u'')
+ self.assertNotIn(u'asdf', u'')
self.assertRaises(TypeError, u"abc".__contains__)
+ self.assertRaises(TypeError, u"abc".__contains__, object())
def test_formatting(self):
string_tests.MixinStrUnicodeUserStringTest.test_formatting(self)
@@ -396,8 +407,10 @@ class UnicodeTest(
for num in range(0x00,0x80):
char = chr(num)
- self.assertEqual(u"%c" % char, char)
- self.assertEqual(u"%c" % num, char)
+ self.assertEqual(u"%c" % char, unicode(char))
+ self.assertEqual(u"%c" % num, unicode(char))
+ self.assertTrue(char == u"%c" % char)
+ self.assertTrue(char == u"%c" % num)
# Issue 7649
for num in range(0x80,0x100):
uchar = unichr(num)
@@ -429,6 +442,17 @@ class UnicodeTest(
return u'\u1234'
self.assertEqual('%s' % Wrapper(), u'\u1234')
+ def test_startswith_endswith_errors(self):
+ for meth in (u'foo'.startswith, u'foo'.endswith):
+ with self.assertRaises(UnicodeDecodeError):
+ meth('\xff')
+ with self.assertRaises(TypeError) as cm:
+ meth(['f'])
+ exc = str(cm.exception)
+ self.assertIn('unicode', exc)
+ self.assertIn('str', exc)
+ self.assertIn('tuple', exc)
+
@test_support.run_with_locale('LC_ALL', 'de_DE', 'fr_FR')
def test_format_float(self):
# should not format with a comma, but always with C locale
@@ -511,7 +535,7 @@ class UnicodeTest(
)
if not sys.platform.startswith('java'):
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
buf = buffer('character buffers are decoded to unicode')
self.assertEqual(
unicode(
@@ -537,19 +561,30 @@ class UnicodeTest(
(u'+?', '+-?'),
(ur'\\?', '+AFwAXA?'),
(ur'\\\?', '+AFwAXABc?'),
- (ur'++--', '+-+---')
+ (ur'++--', '+-+---'),
+ (u'\U000abcde', '+2m/c3g-'), # surrogate pairs
+ (u'/', '/'),
]
for (x, y) in utfTests:
self.assertEqual(x.encode('utf-7'), y)
- # surrogates not supported
+ # Unpaired surrogates not supported
self.assertRaises(UnicodeError, unicode, '+3ADYAA-', 'utf-7')
- self.assertEqual(unicode('+3ADYAA-', 'utf-7', 'replace'), u'\ufffd')
+ self.assertEqual(unicode('+3ADYAA-', 'utf-7', 'replace'), u'\ufffd\ufffd')
- # Issue #2242: crash on some Windows/MSVC versions
- self.assertRaises(UnicodeDecodeError, '+\xc1'.decode, 'utf-7')
+ # Direct encoded characters
+ set_d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?"
+ # Optional direct characters
+ set_o = '!"#$%&*;<=>@[]^_`{|}'
+ for c in set_d:
+ self.assertEqual(c.encode('utf7'), c.encode('ascii'))
+ self.assertEqual(c.encode('ascii').decode('utf7'), unicode(c))
+ self.assertTrue(c == c.encode('ascii').decode('utf7'))
+ for c in set_o:
+ self.assertEqual(c.encode('ascii').decode('utf7'), unicode(c))
+ self.assertTrue(c == c.encode('ascii').decode('utf7'))
def test_codecs_utf8(self):
self.assertEqual(u''.encode('utf-8'), '')
@@ -582,9 +617,9 @@ class UnicodeTest(
)
# UTF-8 specific decoding tests
- self.assertEqual(unicode('\xf0\xa3\x91\x96', 'utf-8'), u'\U00023456' )
- self.assertEqual(unicode('\xf0\x90\x80\x82', 'utf-8'), u'\U00010002' )
- self.assertEqual(unicode('\xe2\x82\xac', 'utf-8'), u'\u20ac' )
+ self.assertEqual(unicode('\xf0\xa3\x91\x96', 'utf-8'), u'\U00023456')
+ self.assertEqual(unicode('\xf0\x90\x80\x82', 'utf-8'), u'\U00010002')
+ self.assertEqual(unicode('\xe2\x82\xac', 'utf-8'), u'\u20ac')
# Other possible utf-8 test cases:
# * strict decoding testing for all of the
@@ -643,11 +678,17 @@ class UnicodeTest(
# see http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf
# (table 3-7) and http://www.rfc-editor.org/rfc/rfc3629.txt
#for cb in map(chr, range(0xA0, 0xC0)):
- #sys.__stdout__.write('\\xED\\x%02x\\x80\n' % ord(cb))
#self.assertRaises(UnicodeDecodeError,
#('\xED'+cb+'\x80').decode, 'utf-8')
#self.assertRaises(UnicodeDecodeError,
#('\xED'+cb+'\xBF').decode, 'utf-8')
+ # but since they are valid on Python 2 add a test for that:
+ for cb, surrogate in zip(map(chr, range(0xA0, 0xC0)),
+ map(unichr, range(0xd800, 0xe000, 64))):
+ encoded = '\xED'+cb+'\x80'
+ self.assertEqual(encoded.decode('utf-8'), surrogate)
+ self.assertEqual(surrogate.encode('utf-8'), encoded)
+
for cb in map(chr, range(0x80, 0x90)):
self.assertRaises(UnicodeDecodeError,
('\xF0'+cb+'\x80\x80').decode, 'utf-8')
@@ -758,12 +799,20 @@ class UnicodeTest(
self.assertRaises(UnicodeError, u'Andr\202 x'.encode, 'ascii','strict')
self.assertEqual(u'Andr\202 x'.encode('ascii','ignore'), "Andr x")
self.assertEqual(u'Andr\202 x'.encode('ascii','replace'), "Andr? x")
+ self.assertEqual(u'Andr\202 x'.encode('ascii', 'replace'),
+ u'Andr\202 x'.encode('ascii', errors='replace'))
+ self.assertEqual(u'Andr\202 x'.encode('ascii', 'ignore'),
+ u'Andr\202 x'.encode(encoding='ascii', errors='ignore'))
# Error handling (decoding)
self.assertRaises(UnicodeError, unicode, 'Andr\202 x', 'ascii')
self.assertRaises(UnicodeError, unicode, 'Andr\202 x', 'ascii','strict')
self.assertEqual(unicode('Andr\202 x','ascii','ignore'), u"Andr x")
self.assertEqual(unicode('Andr\202 x','ascii','replace'), u'Andr\uFFFD x')
+ self.assertEqual(u'abcde'.decode('ascii', 'ignore'),
+ u'abcde'.decode('ascii', errors='ignore'))
+ self.assertEqual(u'abcde'.decode('ascii', 'replace'),
+ u'abcde'.decode(encoding='ascii', errors='replace'))
# Error handling (unknown character names)
self.assertEqual("\\N{foo}xx".decode("unicode-escape", "ignore"), u"xx")
@@ -840,8 +889,8 @@ class UnicodeTest(
s = ''.join(map(chr, xrange(128)))
for encoding in (
'cp037', 'cp1026',
- 'cp437', 'cp500', 'cp737', 'cp775', 'cp850',
- 'cp852', 'cp855', 'cp860', 'cp861', 'cp862',
+ 'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850',
+ 'cp852', 'cp855', 'cp858', 'cp860', 'cp861', 'cp862',
'cp863', 'cp865', 'cp866',
'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6',
@@ -868,8 +917,8 @@ class UnicodeTest(
s = ''.join(map(chr, xrange(128, 256)))
for encoding in (
'cp037', 'cp1026',
- 'cp437', 'cp500', 'cp737', 'cp775', 'cp850',
- 'cp852', 'cp855', 'cp860', 'cp861', 'cp862',
+ 'cp437', 'cp500', 'cp720', 'cp737', 'cp775', 'cp850',
+ 'cp852', 'cp855', 'cp858', 'cp860', 'cp861', 'cp862',
'cp863', 'cp865', 'cp866',
'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15',
'iso8859_2', 'iso8859_4', 'iso8859_5',
@@ -1190,7 +1239,7 @@ class UnicodeTest(
# format specifiers for user defined type
self.assertEqual(u'{0:abc}'.format(C()), u'abc')
- # !r and !s coersions
+ # !r and !s coercions
self.assertEqual(u'{0!s}'.format(u'Hello'), u'Hello')
self.assertEqual(u'{0!s:}'.format(u'Hello'), u'Hello')
self.assertEqual(u'{0!s:15}'.format(u'Hello'), u'Hello ')
@@ -1204,12 +1253,15 @@ class UnicodeTest(
self.assertEqual(u'{0}'.format([]), u'[]')
self.assertEqual(u'{0}'.format([1]), u'[1]')
self.assertEqual(u'{0}'.format(E(u'data')), u'E(data)')
- self.assertEqual(u'{0:^10}'.format(E(u'data')), u' E(data) ')
- self.assertEqual(u'{0:^10s}'.format(E(u'data')), u' E(data) ')
self.assertEqual(u'{0:d}'.format(G(u'data')), u'G(data)')
- self.assertEqual(u'{0:>15s}'.format(G(u'data')), u' string is data')
self.assertEqual(u'{0!s}'.format(G(u'data')), u'string is data')
+ msg = 'object.__format__ with a non-empty format string is deprecated'
+ with test_support.check_warnings((msg, PendingDeprecationWarning)):
+ self.assertEqual(u'{0:^10}'.format(E(u'data')), u' E(data) ')
+ self.assertEqual(u'{0:^10s}'.format(E(u'data')), u' E(data) ')
+ self.assertEqual(u'{0:>15s}'.format(G(u'data')), u' string is data')
+
self.assertEqual(u"{0:date: %Y-%m-%d}".format(I(year=2007,
month=8,
day=27)),
@@ -1261,9 +1313,9 @@ class UnicodeTest(
self.assertRaises(ValueError, u"{0!}".format, 0)
self.assertRaises(ValueError, u"{0!rs}".format, 0)
self.assertRaises(ValueError, u"{!}".format)
- self.assertRaises(ValueError, u"{:}".format)
- self.assertRaises(ValueError, u"{:s}".format)
- self.assertRaises(ValueError, u"{}".format)
+ self.assertRaises(IndexError, u"{:}".format)
+ self.assertRaises(IndexError, u"{:s}".format)
+ self.assertRaises(IndexError, u"{}".format)
big = u"23098475029384702983476098230754973209482573"
self.assertRaises(ValueError, (u"{" + big + u"}").format)
self.assertRaises(ValueError, (u"{[" + big + u"]}").format, [0])
@@ -1294,6 +1346,36 @@ class UnicodeTest(
# will fail
self.assertRaises(UnicodeEncodeError, "foo{0}".format, u'\u1000bar')
+ def test_format_auto_numbering(self):
+ class C:
+ def __init__(self, x=100):
+ self._x = x
+ def __format__(self, spec):
+ return spec
+
+ self.assertEqual(u'{}'.format(10), u'10')
+ self.assertEqual(u'{:5}'.format('s'), u's ')
+ self.assertEqual(u'{!r}'.format('s'), u"'s'")
+ self.assertEqual(u'{._x}'.format(C(10)), u'10')
+ self.assertEqual(u'{[1]}'.format([1, 2]), u'2')
+ self.assertEqual(u'{[a]}'.format({'a':4, 'b':2}), u'4')
+ self.assertEqual(u'a{}b{}c'.format(0, 1), u'a0b1c')
+
+ self.assertEqual(u'a{:{}}b'.format('x', '^10'), u'a x b')
+ self.assertEqual(u'a{:{}x}b'.format(20, '#'), u'a0x14b')
+
+ # can't mix and match numbering and auto-numbering
+ self.assertRaises(ValueError, u'{}{1}'.format, 1, 2)
+ self.assertRaises(ValueError, u'{1}{}'.format, 1, 2)
+ self.assertRaises(ValueError, u'{:{1}}'.format, 1, 2)
+ self.assertRaises(ValueError, u'{0:{}}'.format, 1, 2)
+
+ # can mix and match auto-numbering and named
+ self.assertEqual(u'{f}{}'.format(4, f='test'), u'test4')
+ self.assertEqual(u'{}{f}'.format(4, f='test'), u'4test')
+ self.assertEqual(u'{:{f}}{g}{}'.format(1, 3, g='g', f=2), u' 1g3')
+ self.assertEqual(u'{f:{}}{}{g}'.format(2, 4, f=1, g='g'), u' 14g')
+
def test_raiseMemError(self):
# Ensure that the freelist contains a consistent object, even
# when a string allocation fails with a MemoryError.
@@ -1311,8 +1393,8 @@ class UnicodeTest(
def __unicode__(self):
return u'__unicode__ overridden'
u = U(u'xxx')
- self.assertEquals("%s" % u, u'__unicode__ overridden')
- self.assertEquals("{0}".format(u), u'__unicode__ overridden')
+ self.assertEqual("%s" % u, u'__unicode__ overridden')
+ self.assertEqual("{}".format(u), '__unicode__ overridden')
def test_main():
diff --git a/Lib/test/test_unicode_file.py b/Lib/test/test_unicode_file.py
index 305f98b79a..f04bad3964 100644
--- a/Lib/test/test_unicode_file.py
+++ b/Lib/test/test_unicode_file.py
@@ -5,14 +5,14 @@ import os, glob, time, shutil
import unicodedata
import unittest
-from test.test_support import run_unittest, TestSkipped, TESTFN_UNICODE
-from test.test_support import TESTFN_ENCODING, TESTFN_UNICODE_UNENCODEABLE
+from test.test_support import run_unittest, TESTFN_UNICODE
+from test.test_support import TESTFN_ENCODING, TESTFN_UNENCODABLE
try:
TESTFN_ENCODED = TESTFN_UNICODE.encode(TESTFN_ENCODING)
except (UnicodeError, TypeError):
# Either the file system encoding is None, or the file name
# cannot be encoded in the file system encoding.
- raise TestSkipped("No Unicode filesystem semantics on this platform.")
+ raise unittest.SkipTest("No Unicode filesystem semantics on this platform.")
if TESTFN_ENCODED.decode(TESTFN_ENCODING) != TESTFN_UNICODE:
# The file system encoding does not support Latin-1
@@ -26,10 +26,10 @@ if TESTFN_ENCODED.decode(TESTFN_ENCODING) != TESTFN_UNICODE:
# MBCS will not report the error properly
raise UnicodeError, "mbcs encoding problem"
except (UnicodeError, TypeError):
- raise TestSkipped("Cannot find a suiteable filename.")
+ raise unittest.SkipTest("Cannot find a suiteable filename.")
if TESTFN_ENCODED.decode(TESTFN_ENCODING) != TESTFN_UNICODE:
- raise TestSkipped("Cannot find a suitable filename.")
+ raise unittest.SkipTest("Cannot find a suitable filename.")
def remove_if_exists(filename):
if os.path.exists(filename):
@@ -42,19 +42,19 @@ class TestUnicodeFiles(unittest.TestCase):
# Do all the tests we can given only a single filename. The file should
# exist.
def _do_single(self, filename):
- self.failUnless(os.path.exists(filename))
- self.failUnless(os.path.isfile(filename))
- self.failUnless(os.access(filename, os.R_OK))
- self.failUnless(os.path.exists(os.path.abspath(filename)))
- self.failUnless(os.path.isfile(os.path.abspath(filename)))
- self.failUnless(os.access(os.path.abspath(filename), os.R_OK))
+ self.assertTrue(os.path.exists(filename))
+ self.assertTrue(os.path.isfile(filename))
+ self.assertTrue(os.access(filename, os.R_OK))
+ self.assertTrue(os.path.exists(os.path.abspath(filename)))
+ self.assertTrue(os.path.isfile(os.path.abspath(filename)))
+ self.assertTrue(os.access(os.path.abspath(filename), os.R_OK))
os.chmod(filename, 0777)
os.utime(filename, None)
os.utime(filename, (time.time(), time.time()))
# Copy/rename etc tests using the same filename
self._do_copyish(filename, filename)
# Filename should appear in glob output
- self.failUnless(
+ self.assertTrue(
os.path.abspath(filename)==os.path.abspath(glob.glob(filename)[0]))
# basename should appear in listdir.
path, base = os.path.split(os.path.abspath(filename))
@@ -71,7 +71,7 @@ class TestUnicodeFiles(unittest.TestCase):
base = unicodedata.normalize("NFD", base)
file_list = [unicodedata.normalize("NFD", f) for f in file_list]
- self.failUnless(base in file_list)
+ self.assertIn(base, file_list)
# Do as many "equivalancy' tests as we can - ie, check that although we
# have different types for the filename, they refer to the same file.
@@ -79,12 +79,12 @@ class TestUnicodeFiles(unittest.TestCase):
# Note we only check "filename1 against filename2" - we don't bother
# checking "filename2 against 1", as we assume we are called again with
# the args reversed.
- self.failUnless(type(filename1)!=type(filename2),
+ self.assertTrue(type(filename1)!=type(filename2),
"No point checking equivalent filenames of the same type")
# stat and lstat should return the same results.
- self.failUnlessEqual(os.stat(filename1),
+ self.assertEqual(os.stat(filename1),
os.stat(filename2))
- self.failUnlessEqual(os.lstat(filename1),
+ self.assertEqual(os.lstat(filename1),
os.lstat(filename2))
# Copy/rename etc tests using equivalent filename
self._do_copyish(filename1, filename2)
@@ -92,19 +92,19 @@ class TestUnicodeFiles(unittest.TestCase):
# Tests that copy, move, etc one file to another.
def _do_copyish(self, filename1, filename2):
# Should be able to rename the file using either name.
- self.failUnless(os.path.isfile(filename1)) # must exist.
+ self.assertTrue(os.path.isfile(filename1)) # must exist.
os.rename(filename1, filename2 + ".new")
- self.failUnless(os.path.isfile(filename1+".new"))
+ self.assertTrue(os.path.isfile(filename1+".new"))
os.rename(filename1 + ".new", filename2)
- self.failUnless(os.path.isfile(filename2))
+ self.assertTrue(os.path.isfile(filename2))
shutil.copy(filename1, filename2 + ".new")
os.unlink(filename1 + ".new") # remove using equiv name.
# And a couple of moves, one using each name.
shutil.move(filename1, filename2 + ".new")
- self.failUnless(not os.path.exists(filename2))
+ self.assertTrue(not os.path.exists(filename2))
shutil.move(filename1 + ".new", filename2)
- self.failUnless(os.path.exists(filename1))
+ self.assertTrue(os.path.exists(filename1))
# Note - due to the implementation of shutil.move,
# it tries a rename first. This only fails on Windows when on
# different file systems - and this test can't ensure that.
@@ -131,7 +131,7 @@ class TestUnicodeFiles(unittest.TestCase):
cwd_result = unicodedata.normalize("NFD", cwd_result)
name_result = unicodedata.normalize("NFD", name_result)
- self.failUnlessEqual(os.path.basename(cwd_result),name_result)
+ self.assertEqual(os.path.basename(cwd_result),name_result)
finally:
os.chdir(cwd)
finally:
@@ -147,7 +147,7 @@ class TestUnicodeFiles(unittest.TestCase):
self._do_single(filename)
finally:
os.unlink(filename)
- self.failUnless(not os.path.exists(filename))
+ self.assertTrue(not os.path.exists(filename))
# and again with os.open.
f = os.open(filename, os.O_CREAT)
os.close(f)
@@ -158,7 +158,7 @@ class TestUnicodeFiles(unittest.TestCase):
def _test_equivalent(self, filename1, filename2):
remove_if_exists(filename1)
- self.failUnless(not os.path.exists(filename2))
+ self.assertTrue(not os.path.exists(filename2))
f = file(filename1, "w")
f.close()
try:
@@ -171,8 +171,8 @@ class TestUnicodeFiles(unittest.TestCase):
def test_single_files(self):
self._test_single(TESTFN_ENCODED)
self._test_single(TESTFN_UNICODE)
- if TESTFN_UNICODE_UNENCODEABLE is not None:
- self._test_single(TESTFN_UNICODE_UNENCODEABLE)
+ if TESTFN_UNENCODABLE is not None:
+ self._test_single(TESTFN_UNENCODABLE)
def test_equivalent_files(self):
self._test_equivalent(TESTFN_ENCODED, TESTFN_UNICODE)
@@ -188,9 +188,9 @@ class TestUnicodeFiles(unittest.TestCase):
self._do_directory(TESTFN_UNICODE+ext, TESTFN_ENCODED+ext, False)
self._do_directory(TESTFN_UNICODE+ext, TESTFN_UNICODE+ext, False)
# Our directory name that can't use a non-unicode name.
- if TESTFN_UNICODE_UNENCODEABLE is not None:
- self._do_directory(TESTFN_UNICODE_UNENCODEABLE+ext,
- TESTFN_UNICODE_UNENCODEABLE+ext,
+ if TESTFN_UNENCODABLE is not None:
+ self._do_directory(TESTFN_UNENCODABLE+ext,
+ TESTFN_UNENCODABLE+ext,
False)
def test_main():
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
index 509628bb2f..c30ecf4c5b 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -20,11 +20,11 @@ encoding = 'utf-8'
class UnicodeMethodsTest(unittest.TestCase):
# update this, if the database changes
- expectedchecksum = '6ec65b65835614ec00634c674bba0e50cd32c189'
+ expectedchecksum = '4504dffd035baea02c5b9de82bebc3d65e0e0baf'
def test_method_checksum(self):
h = hashlib.sha1()
- for i in range(65536):
+ for i in range(0x10000):
char = unichr(i)
data = [
# Predicates (single char)
@@ -79,7 +79,7 @@ class UnicodeDatabaseTest(unittest.TestCase):
class UnicodeFunctionsTest(UnicodeDatabaseTest):
# update this, if the database changes
- expectedchecksum = '3136d5afd787dc2bcb1bdcac95e385349fbebbca'
+ expectedchecksum = '6ccf1b1a36460d2694f9b0b0f0324942fe70ede6'
def test_function_checksum(self):
data = []
@@ -118,6 +118,7 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
self.assertEqual(self.db.numeric(u'9'), 9)
self.assertEqual(self.db.numeric(u'\u215b'), 0.125)
self.assertEqual(self.db.numeric(u'\u2468'), 9.0)
+ self.assertEqual(self.db.numeric(u'\ua627'), 7.0)
self.assertEqual(self.db.numeric(u'\U00020000', None), None)
self.assertRaises(TypeError, self.db.numeric)
@@ -235,7 +236,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
self.assertEqual(popen.returncode, 1)
error = "SyntaxError: (unicode error) \N escapes not supported " \
"(can't load unicodedata module)"
- self.assertTrue(error in popen.stderr.read())
+ self.assertIn(error, popen.stderr.read())
def test_decimal_numeric_consistent(self):
# Test that decimal and numeric are consistent,
@@ -248,7 +249,7 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
if dec != -1:
self.assertEqual(dec, self.db.numeric(c))
count += 1
- self.assert_(count >= 10) # should have tested at least the ASCII digits
+ self.assertTrue(count >= 10) # should have tested at least the ASCII digits
def test_digit_numeric_consistent(self):
# Test that digit and numeric are consistent,
@@ -261,21 +262,21 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
if dec != -1:
self.assertEqual(dec, self.db.numeric(c))
count += 1
- self.assert_(count >= 10) # should have tested at least the ASCII digits
+ self.assertTrue(count >= 10) # should have tested at least the ASCII digits
def test_bug_1704793(self):
- self.assertEquals(self.db.lookup("GOTHIC LETTER FAIHU"), u'\U00010346')
+ self.assertEqual(self.db.lookup("GOTHIC LETTER FAIHU"), u'\U00010346')
def test_ucd_510(self):
import unicodedata
# In UCD 5.1.0, a mirrored property changed wrt. UCD 3.2.0
- self.assert_(unicodedata.mirrored(u"\u0f3a"))
- self.assert_(not unicodedata.ucd_3_2_0.mirrored(u"\u0f3a"))
+ self.assertTrue(unicodedata.mirrored(u"\u0f3a"))
+ self.assertTrue(not unicodedata.ucd_3_2_0.mirrored(u"\u0f3a"))
# Also, we now have two ways of representing
# the upper-case mapping: as delta, or as absolute value
- self.assert_(u"a".upper()==u'A')
- self.assert_(u"\u1d79".upper()==u'\ua77d')
- self.assert_(u".".upper()==u".")
+ self.assertTrue(u"a".upper()==u'A')
+ self.assertTrue(u"\u1d79".upper()==u'\ua77d')
+ self.assertTrue(u".".upper()==u".")
def test_bug_5828(self):
self.assertEqual(u"\u1d79".lower(), u"\u1d79")
@@ -294,6 +295,17 @@ class UnicodeMiscTest(UnicodeDatabaseTest):
self.assertEqual(u"\u01c5".title(), u"\u01c5")
self.assertEqual(u"\u01c6".title(), u"\u01c5")
+ def test_linebreak_7643(self):
+ for i in range(0x10000):
+ lines = (unichr(i) + u'A').splitlines()
+ if i in (0x0a, 0x0b, 0x0c, 0x0d, 0x85,
+ 0x1c, 0x1d, 0x1e, 0x2028, 0x2029):
+ self.assertEqual(len(lines), 2,
+ r"\u%.4x should be a linebreak" % i)
+ else:
+ self.assertEqual(len(lines), 1,
+ r"\u%.4x should not be a linebreak" % i)
+
def test_main():
test.test_support.run_unittest(
UnicodeMiscTest,
diff --git a/Lib/test/test_unittest.py b/Lib/test/test_unittest.py
index 5626542c65..86a998b6f4 100644
--- a/Lib/test/test_unittest.py
+++ b/Lib/test/test_unittest.py
@@ -1,2300 +1,12 @@
-"""Test script for unittest.
+import unittest.test
-By Collin Winter <collinw at gmail.com>
-
-Still need testing:
- TestCase.{assert,fail}* methods (some are tested implicitly)
-"""
-
-import sys
from test import test_support
-import unittest
-from unittest import TestCase
-import types
-
-### Support code
-################################################################
-
-class LoggingResult(unittest.TestResult):
- def __init__(self, log):
- self._events = log
- super(LoggingResult, self).__init__()
-
- def startTest(self, test):
- self._events.append('startTest')
- super(LoggingResult, self).startTest(test)
-
- def stopTest(self, test):
- self._events.append('stopTest')
- super(LoggingResult, self).stopTest(test)
-
- def addFailure(self, *args):
- self._events.append('addFailure')
- super(LoggingResult, self).addFailure(*args)
-
- def addError(self, *args):
- self._events.append('addError')
- super(LoggingResult, self).addError(*args)
-
-class TestEquality(object):
- # Check for a valid __eq__ implementation
- def test_eq(self):
- for obj_1, obj_2 in self.eq_pairs:
- self.assertEqual(obj_1, obj_2)
- self.assertEqual(obj_2, obj_1)
-
- # Check for a valid __ne__ implementation
- def test_ne(self):
- for obj_1, obj_2 in self.ne_pairs:
- self.failIfEqual(obj_1, obj_2)
- self.failIfEqual(obj_2, obj_1)
-
-class TestHashing(object):
- # Check for a valid __hash__ implementation
- def test_hash(self):
- for obj_1, obj_2 in self.eq_pairs:
- try:
- assert hash(obj_1) == hash(obj_2)
- except KeyboardInterrupt:
- raise
- except AssertionError:
- self.fail("%s and %s do not hash equal" % (obj_1, obj_2))
- except Exception, e:
- self.fail("Problem hashing %s and %s: %s" % (obj_1, obj_2, e))
-
- for obj_1, obj_2 in self.ne_pairs:
- try:
- assert hash(obj_1) != hash(obj_2)
- except KeyboardInterrupt:
- raise
- except AssertionError:
- self.fail("%s and %s hash equal, but shouldn't" % (obj_1, obj_2))
- except Exception, e:
- self.fail("Problem hashing %s and %s: %s" % (obj_1, obj_2, e))
-
-
-################################################################
-### /Support code
-
-class Test_TestLoader(TestCase):
-
- ### Tests for TestLoader.loadTestsFromTestCase
- ################################################################
-
- # "Return a suite of all tests cases contained in the TestCase-derived
- # class testCaseClass"
- def test_loadTestsFromTestCase(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
-
- tests = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
-
- loader = unittest.TestLoader()
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)
-
- # "Return a suite of all tests cases contained in the TestCase-derived
- # class testCaseClass"
- #
- # Make sure it does the right thing even if no tests were found
- def test_loadTestsFromTestCase__no_matches(self):
- class Foo(unittest.TestCase):
- def foo_bar(self): pass
-
- empty_suite = unittest.TestSuite()
-
- loader = unittest.TestLoader()
- self.assertEqual(loader.loadTestsFromTestCase(Foo), empty_suite)
-
- # "Return a suite of all tests cases contained in the TestCase-derived
- # class testCaseClass"
- #
- # What happens if loadTestsFromTestCase() is given an object
- # that isn't a subclass of TestCase? Specifically, what happens
- # if testCaseClass is a subclass of TestSuite?
- #
- # This is checked for specifically in the code, so we better add a
- # test for it.
- def test_loadTestsFromTestCase__TestSuite_subclass(self):
- class NotATestCase(unittest.TestSuite):
- pass
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromTestCase(NotATestCase)
- except TypeError:
- pass
- else:
- self.fail('Should raise TypeError')
-
- # "Return a suite of all tests cases contained in the TestCase-derived
- # class testCaseClass"
- #
- # Make sure loadTestsFromTestCase() picks up the default test method
- # name (as specified by TestCase), even though the method name does
- # not match the default TestLoader.testMethodPrefix string
- def test_loadTestsFromTestCase__default_method_name(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- loader = unittest.TestLoader()
- # This has to be false for the test to succeed
- self.failIf('runTest'.startswith(loader.testMethodPrefix))
-
- suite = loader.loadTestsFromTestCase(Foo)
- self.failUnless(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [Foo('runTest')])
-
- ################################################################
- ### /Tests for TestLoader.loadTestsFromTestCase
-
- ### Tests for TestLoader.loadTestsFromModule
- ################################################################
-
- # "This method searches `module` for classes derived from TestCase"
- def test_loadTestsFromModule__TestCase_subclass(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromModule(m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- expected = [loader.suiteClass([MyTestCase('test')])]
- self.assertEqual(list(suite), expected)
-
- # "This method searches `module` for classes derived from TestCase"
- #
- # What happens if no tests are found (no TestCase instances)?
- def test_loadTestsFromModule__no_TestCase_instances(self):
- m = types.ModuleType('m')
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromModule(m)
- self.failUnless(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [])
-
- # "This method searches `module` for classes derived from TestCase"
- #
- # What happens if no tests are found (TestCases instances, but no tests)?
- def test_loadTestsFromModule__no_TestCase_tests(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromModule(m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- self.assertEqual(list(suite), [loader.suiteClass()])
-
- # "This method searches `module` for classes derived from TestCase"s
- #
- # What happens if loadTestsFromModule() is given something other
- # than a module?
- #
- # XXX Currently, it succeeds anyway. This flexibility
- # should either be documented or loadTestsFromModule() should
- # raise a TypeError
- #
- # XXX Certain people are using this behaviour. We'll add a test for it
- def test_loadTestsFromModule__not_a_module(self):
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
-
- class NotAModule(object):
- test_2 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromModule(NotAModule)
-
- reference = [unittest.TestSuite([MyTestCase('test')])]
- self.assertEqual(list(suite), reference)
-
- ################################################################
- ### /Tests for TestLoader.loadTestsFromModule()
-
- ### Tests for TestLoader.loadTestsFromName()
- ################################################################
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Is ValueError raised in response to an empty name?
- def test_loadTestsFromName__empty_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('')
- except ValueError, e:
- self.assertEqual(str(e), "Empty module name")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when the name contains invalid characters?
- def test_loadTestsFromName__malformed_name(self):
- loader = unittest.TestLoader()
-
- # XXX Should this raise ValueError or ImportError?
- try:
- loader.loadTestsFromName('abc () //')
- except ValueError:
- pass
- except ImportError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve ... to a
- # module"
- #
- # What happens when a module by that name can't be found?
- def test_loadTestsFromName__unknown_module_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('sdasfasfasdf')
- except ImportError, e:
- self.assertEqual(str(e), "No module named sdasfasfasdf")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise ImportError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when the module is found, but the attribute can't?
- def test_loadTestsFromName__unknown_attr_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('unittest.sdasfasfasdf')
- except AttributeError, e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when we provide the module, but the attribute can't be
- # found?
- def test_loadTestsFromName__relative_unknown_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('sdasfasfasdf', unittest)
- except AttributeError, e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # Does loadTestsFromName raise ValueError when passed an empty
- # name relative to a provided module?
- #
- # XXX Should probably raise a ValueError instead of an AttributeError
- def test_loadTestsFromName__relative_empty_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromName('', unittest)
- except AttributeError, e:
- pass
- else:
- self.fail("Failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens when an impossible name is given, relative to the provided
- # `module`?
- def test_loadTestsFromName__relative_malformed_name(self):
- loader = unittest.TestLoader()
-
- # XXX Should this raise AttributeError or ValueError?
- try:
- loader.loadTestsFromName('abc () //', unittest)
- except ValueError:
- pass
- except AttributeError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise ValueError")
-
- # "The method optionally resolves name relative to the given module"
- #
- # Does loadTestsFromName raise TypeError when the `module` argument
- # isn't a module object?
- #
- # XXX Accepts the not-a-module object, ignorning the object's type
- # This should raise an exception or the method name should be changed
- #
- # XXX Some people are relying on this, so keep it for now
- def test_loadTestsFromName__relative_not_a_module(self):
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
-
- class NotAModule(object):
- test_2 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('test_2', NotAModule)
-
- reference = [MyTestCase('test')]
- self.assertEqual(list(suite), reference)
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Does it raise an exception if the name resolves to an invalid
- # object?
- def test_loadTestsFromName__relative_bad_object(self):
- m = types.ModuleType('m')
- m.testcase_1 = object()
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromName('testcase_1', m)
- except TypeError:
- pass
- else:
- self.fail("Should have raised TypeError")
-
- # "The specifier name is a ``dotted name'' that may
- # resolve either to ... a test case class"
- def test_loadTestsFromName__relative_TestCase_subclass(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('testcase_1', m)
- self.failUnless(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [MyTestCase('test')])
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- def test_loadTestsFromName__relative_TestSuite(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testsuite = unittest.TestSuite([MyTestCase('test')])
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('testsuite', m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- self.assertEqual(list(suite), [MyTestCase('test')])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a test method within a test case class"
- def test_loadTestsFromName__relative_testmethod(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('testcase_1.test', m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- self.assertEqual(list(suite), [MyTestCase('test')])
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Does loadTestsFromName() raise the proper exception when trying to
- # resolve "a test method within a test case class" that doesn't exist
- # for the given name (relative to a provided module)?
- def test_loadTestsFromName__relative_invalid_testmethod(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromName('testcase_1.testfoo', m)
- except AttributeError, e:
- self.assertEqual(str(e), "type object 'MyTestCase' has no attribute 'testfoo'")
- else:
- self.fail("Failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a ... TestSuite instance"
- def test_loadTestsFromName__callable__TestSuite(self):
- m = types.ModuleType('m')
- testcase_1 = unittest.FunctionTestCase(lambda: None)
- testcase_2 = unittest.FunctionTestCase(lambda: None)
- def return_TestSuite():
- return unittest.TestSuite([testcase_1, testcase_2])
- m.return_TestSuite = return_TestSuite
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('return_TestSuite', m)
- self.failUnless(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [testcase_1, testcase_2])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase ... instance"
- def test_loadTestsFromName__callable__TestCase_instance(self):
- m = types.ModuleType('m')
- testcase_1 = unittest.FunctionTestCase(lambda: None)
- def return_TestCase():
- return testcase_1
- m.return_TestCase = return_TestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromName('return_TestCase', m)
- self.failUnless(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [testcase_1])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase or TestSuite instance"
- #
- # What happens if the callable returns something else?
- def test_loadTestsFromName__callable__wrong_type(self):
- m = types.ModuleType('m')
- def return_wrong():
- return 6
- m.return_wrong = return_wrong
-
- loader = unittest.TestLoader()
- try:
- suite = loader.loadTestsFromName('return_wrong', m)
- except TypeError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise TypeError")
-
- # "The specifier can refer to modules and packages which have not been
- # imported; they will be imported as a side-effect"
- def test_loadTestsFromName__module_not_loaded(self):
- # We're going to try to load this module as a side-effect, so it
- # better not be loaded before we try.
- #
- # Why pick audioop? Google shows it isn't used very often, so there's
- # a good chance that it won't be imported when this test is run
- module_name = 'audioop'
-
- import sys
- if module_name in sys.modules:
- del sys.modules[module_name]
-
- loader = unittest.TestLoader()
- try:
- suite = loader.loadTestsFromName(module_name)
-
- self.failUnless(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [])
-
- # audioop should now be loaded, thanks to loadTestsFromName()
- self.failUnless(module_name in sys.modules)
- finally:
- if module_name in sys.modules:
- del sys.modules[module_name]
-
- ################################################################
- ### Tests for TestLoader.loadTestsFromName()
-
- ### Tests for TestLoader.loadTestsFromNames()
- ################################################################
-
- # "Similar to loadTestsFromName(), but takes a sequence of names rather
- # than a single name."
- #
- # What happens if that sequence of names is empty?
- def test_loadTestsFromNames__empty_name_list(self):
- loader = unittest.TestLoader()
-
- suite = loader.loadTestsFromNames([])
- self.failUnless(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [])
-
- # "Similar to loadTestsFromName(), but takes a sequence of names rather
- # than a single name."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens if that sequence of names is empty?
- #
- # XXX Should this raise a ValueError or just return an empty TestSuite?
- def test_loadTestsFromNames__relative_empty_name_list(self):
- loader = unittest.TestLoader()
-
- suite = loader.loadTestsFromNames([], unittest)
- self.failUnless(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [])
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Is ValueError raised in response to an empty name?
- def test_loadTestsFromNames__empty_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames([''])
- except ValueError, e:
- self.assertEqual(str(e), "Empty module name")
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when presented with an impossible module name?
- def test_loadTestsFromNames__malformed_name(self):
- loader = unittest.TestLoader()
-
- # XXX Should this raise ValueError or ImportError?
- try:
- loader.loadTestsFromNames(['abc () //'])
- except ValueError:
- pass
- except ImportError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when no module can be found for the given name?
- def test_loadTestsFromNames__unknown_module_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames(['sdasfasfasdf'])
- except ImportError, e:
- self.assertEqual(str(e), "No module named sdasfasfasdf")
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise ImportError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # What happens when the module can be found, but not the attribute?
- def test_loadTestsFromNames__unknown_attr_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames(['unittest.sdasfasfasdf', 'unittest'])
- except AttributeError, e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens when given an unknown attribute on a specified `module`
- # argument?
- def test_loadTestsFromNames__unknown_name_relative_1(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames(['sdasfasfasdf'], unittest)
- except AttributeError, e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # Do unknown attributes (relative to a provided module) still raise an
- # exception even in the presence of valid attribute names?
- def test_loadTestsFromNames__unknown_name_relative_2(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames(['TestCase', 'sdasfasfasdf'], unittest)
- except AttributeError, e:
- self.assertEqual(str(e), "'module' object has no attribute 'sdasfasfasdf'")
- else:
- self.fail("TestLoader.loadTestsFromName failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens when faced with the empty string?
- #
- # XXX This currently raises AttributeError, though ValueError is probably
- # more appropriate
- def test_loadTestsFromNames__relative_empty_name(self):
- loader = unittest.TestLoader()
-
- try:
- loader.loadTestsFromNames([''], unittest)
- except AttributeError:
- pass
- else:
- self.fail("Failed to raise ValueError")
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- # ...
- # "The method optionally resolves name relative to the given module"
- #
- # What happens when presented with an impossible attribute name?
- def test_loadTestsFromNames__relative_malformed_name(self):
- loader = unittest.TestLoader()
-
- # XXX Should this raise AttributeError or ValueError?
- try:
- loader.loadTestsFromNames(['abc () //'], unittest)
- except AttributeError:
- pass
- except ValueError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise ValueError")
-
- # "The method optionally resolves name relative to the given module"
- #
- # Does loadTestsFromNames() make sure the provided `module` is in fact
- # a module?
- #
- # XXX This validation is currently not done. This flexibility should
- # either be documented or a TypeError should be raised.
- def test_loadTestsFromNames__relative_not_a_module(self):
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
-
- class NotAModule(object):
- test_2 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['test_2'], NotAModule)
-
- reference = [unittest.TestSuite([MyTestCase('test')])]
- self.assertEqual(list(suite), reference)
-
- # "The specifier name is a ``dotted name'' that may resolve either to
- # a module, a test case class, a TestSuite instance, a test method
- # within a test case class, or a callable object which returns a
- # TestCase or TestSuite instance."
- #
- # Does it raise an exception if the name resolves to an invalid
- # object?
- def test_loadTestsFromNames__relative_bad_object(self):
- m = types.ModuleType('m')
- m.testcase_1 = object()
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromNames(['testcase_1'], m)
- except TypeError:
- pass
- else:
- self.fail("Should have raised TypeError")
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a test case class"
- def test_loadTestsFromNames__relative_TestCase_subclass(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['testcase_1'], m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- expected = loader.suiteClass([MyTestCase('test')])
- self.assertEqual(list(suite), [expected])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a TestSuite instance"
- def test_loadTestsFromNames__relative_TestSuite(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testsuite = unittest.TestSuite([MyTestCase('test')])
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['testsuite'], m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- self.assertEqual(list(suite), [m.testsuite])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to ... a
- # test method within a test case class"
- def test_loadTestsFromNames__relative_testmethod(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['testcase_1.test'], m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- ref_suite = unittest.TestSuite([MyTestCase('test')])
- self.assertEqual(list(suite), [ref_suite])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to ... a
- # test method within a test case class"
- #
- # Does the method gracefully handle names that initially look like they
- # resolve to "a test method within a test case class" but don't?
- def test_loadTestsFromNames__relative_invalid_testmethod(self):
- m = types.ModuleType('m')
- class MyTestCase(unittest.TestCase):
- def test(self):
- pass
- m.testcase_1 = MyTestCase
-
- loader = unittest.TestLoader()
- try:
- loader.loadTestsFromNames(['testcase_1.testfoo'], m)
- except AttributeError, e:
- self.assertEqual(str(e), "type object 'MyTestCase' has no attribute 'testfoo'")
- else:
- self.fail("Failed to raise AttributeError")
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a ... TestSuite instance"
- def test_loadTestsFromNames__callable__TestSuite(self):
- m = types.ModuleType('m')
- testcase_1 = unittest.FunctionTestCase(lambda: None)
- testcase_2 = unittest.FunctionTestCase(lambda: None)
- def return_TestSuite():
- return unittest.TestSuite([testcase_1, testcase_2])
- m.return_TestSuite = return_TestSuite
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['return_TestSuite'], m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- expected = unittest.TestSuite([testcase_1, testcase_2])
- self.assertEqual(list(suite), [expected])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase ... instance"
- def test_loadTestsFromNames__callable__TestCase_instance(self):
- m = types.ModuleType('m')
- testcase_1 = unittest.FunctionTestCase(lambda: None)
- def return_TestCase():
- return testcase_1
- m.return_TestCase = return_TestCase
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['return_TestCase'], m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- ref_suite = unittest.TestSuite([testcase_1])
- self.assertEqual(list(suite), [ref_suite])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase or TestSuite instance"
- #
- # Are staticmethods handled correctly?
- def test_loadTestsFromNames__callable__call_staticmethod(self):
- m = types.ModuleType('m')
- class Test1(unittest.TestCase):
- def test(self):
- pass
-
- testcase_1 = Test1('test')
- class Foo(unittest.TestCase):
- @staticmethod
- def foo():
- return testcase_1
- m.Foo = Foo
-
- loader = unittest.TestLoader()
- suite = loader.loadTestsFromNames(['Foo.foo'], m)
- self.failUnless(isinstance(suite, loader.suiteClass))
-
- ref_suite = unittest.TestSuite([testcase_1])
- self.assertEqual(list(suite), [ref_suite])
-
- # "The specifier name is a ``dotted name'' that may resolve ... to
- # ... a callable object which returns a TestCase or TestSuite instance"
- #
- # What happens when the callable returns something else?
- def test_loadTestsFromNames__callable__wrong_type(self):
- m = types.ModuleType('m')
- def return_wrong():
- return 6
- m.return_wrong = return_wrong
-
- loader = unittest.TestLoader()
- try:
- suite = loader.loadTestsFromNames(['return_wrong'], m)
- except TypeError:
- pass
- else:
- self.fail("TestLoader.loadTestsFromNames failed to raise TypeError")
-
- # "The specifier can refer to modules and packages which have not been
- # imported; they will be imported as a side-effect"
- def test_loadTestsFromNames__module_not_loaded(self):
- # We're going to try to load this module as a side-effect, so it
- # better not be loaded before we try.
- #
- # Why pick audioop? Google shows it isn't used very often, so there's
- # a good chance that it won't be imported when this test is run
- module_name = 'audioop'
-
- import sys
- if module_name in sys.modules:
- del sys.modules[module_name]
-
- loader = unittest.TestLoader()
- try:
- suite = loader.loadTestsFromNames([module_name])
-
- self.failUnless(isinstance(suite, loader.suiteClass))
- self.assertEqual(list(suite), [unittest.TestSuite()])
-
- # audioop should now be loaded, thanks to loadTestsFromName()
- self.failUnless(module_name in sys.modules)
- finally:
- if module_name in sys.modules:
- del sys.modules[module_name]
-
- ################################################################
- ### /Tests for TestLoader.loadTestsFromNames()
-
- ### Tests for TestLoader.getTestCaseNames()
- ################################################################
-
- # "Return a sorted sequence of method names found within testCaseClass"
- #
- # Test.foobar is defined to make sure getTestCaseNames() respects
- # loader.testMethodPrefix
- def test_getTestCaseNames(self):
- class Test(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foobar(self): pass
-
- loader = unittest.TestLoader()
-
- self.assertEqual(loader.getTestCaseNames(Test), ['test_1', 'test_2'])
-
- # "Return a sorted sequence of method names found within testCaseClass"
- #
- # Does getTestCaseNames() behave appropriately if no tests are found?
- def test_getTestCaseNames__no_tests(self):
- class Test(unittest.TestCase):
- def foobar(self): pass
-
- loader = unittest.TestLoader()
-
- self.assertEqual(loader.getTestCaseNames(Test), [])
-
- # "Return a sorted sequence of method names found within testCaseClass"
- #
- # Are not-TestCases handled gracefully?
- #
- # XXX This should raise a TypeError, not return a list
- #
- # XXX It's too late in the 2.5 release cycle to fix this, but it should
- # probably be revisited for 2.6
- def test_getTestCaseNames__not_a_TestCase(self):
- class BadCase(int):
- def test_foo(self):
- pass
-
- loader = unittest.TestLoader()
- names = loader.getTestCaseNames(BadCase)
-
- self.assertEqual(names, ['test_foo'])
-
- # "Return a sorted sequence of method names found within testCaseClass"
- #
- # Make sure inherited names are handled.
- #
- # TestP.foobar is defined to make sure getTestCaseNames() respects
- # loader.testMethodPrefix
- def test_getTestCaseNames__inheritance(self):
- class TestP(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foobar(self): pass
-
- class TestC(TestP):
- def test_1(self): pass
- def test_3(self): pass
-
- loader = unittest.TestLoader()
-
- names = ['test_1', 'test_2', 'test_3']
- self.assertEqual(loader.getTestCaseNames(TestC), names)
-
- ################################################################
- ### /Tests for TestLoader.getTestCaseNames()
-
- ### Tests for TestLoader.testMethodPrefix
- ################################################################
-
- # "String giving the prefix of method names which will be interpreted as
- # test methods"
- #
- # Implicit in the documentation is that testMethodPrefix is respected by
- # all loadTestsFrom* methods.
- def test_testMethodPrefix__loadTestsFromTestCase(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
-
- tests_1 = unittest.TestSuite([Foo('foo_bar')])
- tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
-
- loader = unittest.TestLoader()
- loader.testMethodPrefix = 'foo'
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests_1)
-
- loader.testMethodPrefix = 'test'
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests_2)
-
- # "String giving the prefix of method names which will be interpreted as
- # test methods"
- #
- # Implicit in the documentation is that testMethodPrefix is respected by
- # all loadTestsFrom* methods.
- def test_testMethodPrefix__loadTestsFromModule(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests_1 = [unittest.TestSuite([Foo('foo_bar')])]
- tests_2 = [unittest.TestSuite([Foo('test_1'), Foo('test_2')])]
-
- loader = unittest.TestLoader()
- loader.testMethodPrefix = 'foo'
- self.assertEqual(list(loader.loadTestsFromModule(m)), tests_1)
-
- loader.testMethodPrefix = 'test'
- self.assertEqual(list(loader.loadTestsFromModule(m)), tests_2)
-
- # "String giving the prefix of method names which will be interpreted as
- # test methods"
- #
- # Implicit in the documentation is that testMethodPrefix is respected by
- # all loadTestsFrom* methods.
- def test_testMethodPrefix__loadTestsFromName(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests_1 = unittest.TestSuite([Foo('foo_bar')])
- tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
-
- loader = unittest.TestLoader()
- loader.testMethodPrefix = 'foo'
- self.assertEqual(loader.loadTestsFromName('Foo', m), tests_1)
-
- loader.testMethodPrefix = 'test'
- self.assertEqual(loader.loadTestsFromName('Foo', m), tests_2)
-
- # "String giving the prefix of method names which will be interpreted as
- # test methods"
- #
- # Implicit in the documentation is that testMethodPrefix is respected by
- # all loadTestsFrom* methods.
- def test_testMethodPrefix__loadTestsFromNames(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests_1 = unittest.TestSuite([unittest.TestSuite([Foo('foo_bar')])])
- tests_2 = unittest.TestSuite([Foo('test_1'), Foo('test_2')])
- tests_2 = unittest.TestSuite([tests_2])
-
- loader = unittest.TestLoader()
- loader.testMethodPrefix = 'foo'
- self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests_1)
-
- loader.testMethodPrefix = 'test'
- self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests_2)
-
- # "The default value is 'test'"
- def test_testMethodPrefix__default_value(self):
- loader = unittest.TestLoader()
- self.failUnless(loader.testMethodPrefix == 'test')
-
- ################################################################
- ### /Tests for TestLoader.testMethodPrefix
-
- ### Tests for TestLoader.sortTestMethodsUsing
- ################################################################
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames() and all the loadTestsFromX() methods"
- def test_sortTestMethodsUsing__loadTestsFromTestCase(self):
- def reversed_cmp(x, y):
- return -cmp(x, y)
-
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- tests = loader.suiteClass([Foo('test_2'), Foo('test_1')])
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames() and all the loadTestsFromX() methods"
- def test_sortTestMethodsUsing__loadTestsFromModule(self):
- def reversed_cmp(x, y):
- return -cmp(x, y)
-
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- m.Foo = Foo
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- tests = [loader.suiteClass([Foo('test_2'), Foo('test_1')])]
- self.assertEqual(list(loader.loadTestsFromModule(m)), tests)
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames() and all the loadTestsFromX() methods"
- def test_sortTestMethodsUsing__loadTestsFromName(self):
- def reversed_cmp(x, y):
- return -cmp(x, y)
-
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- m.Foo = Foo
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- tests = loader.suiteClass([Foo('test_2'), Foo('test_1')])
- self.assertEqual(loader.loadTestsFromName('Foo', m), tests)
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames() and all the loadTestsFromX() methods"
- def test_sortTestMethodsUsing__loadTestsFromNames(self):
- def reversed_cmp(x, y):
- return -cmp(x, y)
-
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- m.Foo = Foo
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- tests = [loader.suiteClass([Foo('test_2'), Foo('test_1')])]
- self.assertEqual(list(loader.loadTestsFromNames(['Foo'], m)), tests)
-
- # "Function to be used to compare method names when sorting them in
- # getTestCaseNames()"
- #
- # Does it actually affect getTestCaseNames()?
- def test_sortTestMethodsUsing__getTestCaseNames(self):
- def reversed_cmp(x, y):
- return -cmp(x, y)
-
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = reversed_cmp
-
- test_names = ['test_2', 'test_1']
- self.assertEqual(loader.getTestCaseNames(Foo), test_names)
-
- # "The default value is the built-in cmp() function"
- def test_sortTestMethodsUsing__default_value(self):
- loader = unittest.TestLoader()
- self.failUnless(loader.sortTestMethodsUsing is cmp)
-
- # "it can be set to None to disable the sort."
- #
- # XXX How is this different from reassigning cmp? Are the tests returned
- # in a random order or something? This behaviour should die
- def test_sortTestMethodsUsing__None(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
-
- loader = unittest.TestLoader()
- loader.sortTestMethodsUsing = None
-
- test_names = ['test_2', 'test_1']
- self.assertEqual(set(loader.getTestCaseNames(Foo)), set(test_names))
-
- ################################################################
- ### /Tests for TestLoader.sortTestMethodsUsing
-
- ### Tests for TestLoader.suiteClass
- ################################################################
-
- # "Callable object that constructs a test suite from a list of tests."
- def test_suiteClass__loadTestsFromTestCase(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
-
- tests = [Foo('test_1'), Foo('test_2')]
-
- loader = unittest.TestLoader()
- loader.suiteClass = list
- self.assertEqual(loader.loadTestsFromTestCase(Foo), tests)
-
- # It is implicit in the documentation for TestLoader.suiteClass that
- # all TestLoader.loadTestsFrom* methods respect it. Let's make sure
- def test_suiteClass__loadTestsFromModule(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests = [[Foo('test_1'), Foo('test_2')]]
-
- loader = unittest.TestLoader()
- loader.suiteClass = list
- self.assertEqual(loader.loadTestsFromModule(m), tests)
-
- # It is implicit in the documentation for TestLoader.suiteClass that
- # all TestLoader.loadTestsFrom* methods respect it. Let's make sure
- def test_suiteClass__loadTestsFromName(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests = [Foo('test_1'), Foo('test_2')]
-
- loader = unittest.TestLoader()
- loader.suiteClass = list
- self.assertEqual(loader.loadTestsFromName('Foo', m), tests)
-
- # It is implicit in the documentation for TestLoader.suiteClass that
- # all TestLoader.loadTestsFrom* methods respect it. Let's make sure
- def test_suiteClass__loadTestsFromNames(self):
- m = types.ModuleType('m')
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def foo_bar(self): pass
- m.Foo = Foo
-
- tests = [[Foo('test_1'), Foo('test_2')]]
- loader = unittest.TestLoader()
- loader.suiteClass = list
- self.assertEqual(loader.loadTestsFromNames(['Foo'], m), tests)
-
- # "The default value is the TestSuite class"
- def test_suiteClass__default_value(self):
- loader = unittest.TestLoader()
- self.failUnless(loader.suiteClass is unittest.TestSuite)
-
- ################################################################
- ### /Tests for TestLoader.suiteClass
-
-### Support code for Test_TestSuite
-################################################################
-
-class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
- def test_3(self): pass
- def runTest(self): pass
-
-def _mk_TestSuite(*names):
- return unittest.TestSuite(Foo(n) for n in names)
-
-################################################################
-### /Support code for Test_TestSuite
-
-class Test_TestSuite(TestCase, TestEquality):
-
- ### Set up attributes needed by inherited tests
- ################################################################
-
- # Used by TestEquality.test_eq
- eq_pairs = [(unittest.TestSuite(), unittest.TestSuite())
- ,(unittest.TestSuite(), unittest.TestSuite([]))
- ,(_mk_TestSuite('test_1'), _mk_TestSuite('test_1'))]
-
- # Used by TestEquality.test_ne
- ne_pairs = [(unittest.TestSuite(), _mk_TestSuite('test_1'))
- ,(unittest.TestSuite([]), _mk_TestSuite('test_1'))
- ,(_mk_TestSuite('test_1', 'test_2'), _mk_TestSuite('test_1', 'test_3'))
- ,(_mk_TestSuite('test_1'), _mk_TestSuite('test_2'))]
-
- ################################################################
- ### /Set up attributes needed by inherited tests
-
- ### Tests for TestSuite.__init__
- ################################################################
-
- # "class TestSuite([tests])"
- #
- # The tests iterable should be optional
- def test_init__tests_optional(self):
- suite = unittest.TestSuite()
-
- self.assertEqual(suite.countTestCases(), 0)
-
- # "class TestSuite([tests])"
- # ...
- # "If tests is given, it must be an iterable of individual test cases
- # or other test suites that will be used to build the suite initially"
- #
- # TestSuite should deal with empty tests iterables by allowing the
- # creation of an empty suite
- def test_init__empty_tests(self):
- suite = unittest.TestSuite([])
-
- self.assertEqual(suite.countTestCases(), 0)
-
- # "class TestSuite([tests])"
- # ...
- # "If tests is given, it must be an iterable of individual test cases
- # or other test suites that will be used to build the suite initially"
- #
- # TestSuite should allow any iterable to provide tests
- def test_init__tests_from_any_iterable(self):
- def tests():
- yield unittest.FunctionTestCase(lambda: None)
- yield unittest.FunctionTestCase(lambda: None)
-
- suite_1 = unittest.TestSuite(tests())
- self.assertEqual(suite_1.countTestCases(), 2)
-
- suite_2 = unittest.TestSuite(suite_1)
- self.assertEqual(suite_2.countTestCases(), 2)
-
- suite_3 = unittest.TestSuite(set(suite_1))
- self.assertEqual(suite_3.countTestCases(), 2)
-
- # "class TestSuite([tests])"
- # ...
- # "If tests is given, it must be an iterable of individual test cases
- # or other test suites that will be used to build the suite initially"
- #
- # Does TestSuite() also allow other TestSuite() instances to be present
- # in the tests iterable?
- def test_init__TestSuite_instances_in_tests(self):
- def tests():
- ftc = unittest.FunctionTestCase(lambda: None)
- yield unittest.TestSuite([ftc])
- yield unittest.FunctionTestCase(lambda: None)
-
- suite = unittest.TestSuite(tests())
- self.assertEqual(suite.countTestCases(), 2)
-
- ################################################################
- ### /Tests for TestSuite.__init__
-
- # Container types should support the iter protocol
- def test_iter(self):
- test1 = unittest.FunctionTestCase(lambda: None)
- test2 = unittest.FunctionTestCase(lambda: None)
- suite = unittest.TestSuite((test1, test2))
-
- self.assertEqual(list(suite), [test1, test2])
-
- # "Return the number of tests represented by the this test object.
- # ...this method is also implemented by the TestSuite class, which can
- # return larger [greater than 1] values"
- #
- # Presumably an empty TestSuite returns 0?
- def test_countTestCases_zero_simple(self):
- suite = unittest.TestSuite()
-
- self.assertEqual(suite.countTestCases(), 0)
-
- # "Return the number of tests represented by the this test object.
- # ...this method is also implemented by the TestSuite class, which can
- # return larger [greater than 1] values"
- #
- # Presumably an empty TestSuite (even if it contains other empty
- # TestSuite instances) returns 0?
- def test_countTestCases_zero_nested(self):
- class Test1(unittest.TestCase):
- def test(self):
- pass
-
- suite = unittest.TestSuite([unittest.TestSuite()])
-
- self.assertEqual(suite.countTestCases(), 0)
-
- # "Return the number of tests represented by the this test object.
- # ...this method is also implemented by the TestSuite class, which can
- # return larger [greater than 1] values"
- def test_countTestCases_simple(self):
- test1 = unittest.FunctionTestCase(lambda: None)
- test2 = unittest.FunctionTestCase(lambda: None)
- suite = unittest.TestSuite((test1, test2))
-
- self.assertEqual(suite.countTestCases(), 2)
-
- # "Return the number of tests represented by the this test object.
- # ...this method is also implemented by the TestSuite class, which can
- # return larger [greater than 1] values"
- #
- # Make sure this holds for nested TestSuite instances, too
- def test_countTestCases_nested(self):
- class Test1(unittest.TestCase):
- def test1(self): pass
- def test2(self): pass
-
- test2 = unittest.FunctionTestCase(lambda: None)
- test3 = unittest.FunctionTestCase(lambda: None)
- child = unittest.TestSuite((Test1('test2'), test2))
- parent = unittest.TestSuite((test3, child, Test1('test1')))
-
- self.assertEqual(parent.countTestCases(), 4)
-
- # "Run the tests associated with this suite, collecting the result into
- # the test result object passed as result."
- #
- # And if there are no tests? What then?
- def test_run__empty_suite(self):
- events = []
- result = LoggingResult(events)
-
- suite = unittest.TestSuite()
-
- suite.run(result)
-
- self.assertEqual(events, [])
-
- # "Note that unlike TestCase.run(), TestSuite.run() requires the
- # "result object to be passed in."
- def test_run__requires_result(self):
- suite = unittest.TestSuite()
-
- try:
- suite.run()
- except TypeError:
- pass
- else:
- self.fail("Failed to raise TypeError")
-
- # "Run the tests associated with this suite, collecting the result into
- # the test result object passed as result."
- def test_run(self):
- events = []
- result = LoggingResult(events)
-
- class LoggingCase(unittest.TestCase):
- def run(self, result):
- events.append('run %s' % self._testMethodName)
-
- def test1(self): pass
- def test2(self): pass
-
- tests = [LoggingCase('test1'), LoggingCase('test2')]
-
- unittest.TestSuite(tests).run(result)
-
- self.assertEqual(events, ['run test1', 'run test2'])
-
- # "Add a TestCase ... to the suite"
- def test_addTest__TestCase(self):
- class Foo(unittest.TestCase):
- def test(self): pass
-
- test = Foo('test')
- suite = unittest.TestSuite()
-
- suite.addTest(test)
-
- self.assertEqual(suite.countTestCases(), 1)
- self.assertEqual(list(suite), [test])
-
- # "Add a ... TestSuite to the suite"
- def test_addTest__TestSuite(self):
- class Foo(unittest.TestCase):
- def test(self): pass
-
- suite_2 = unittest.TestSuite([Foo('test')])
-
- suite = unittest.TestSuite()
- suite.addTest(suite_2)
-
- self.assertEqual(suite.countTestCases(), 1)
- self.assertEqual(list(suite), [suite_2])
-
- # "Add all the tests from an iterable of TestCase and TestSuite
- # instances to this test suite."
- #
- # "This is equivalent to iterating over tests, calling addTest() for
- # each element"
- def test_addTests(self):
- class Foo(unittest.TestCase):
- def test_1(self): pass
- def test_2(self): pass
-
- test_1 = Foo('test_1')
- test_2 = Foo('test_2')
- inner_suite = unittest.TestSuite([test_2])
-
- def gen():
- yield test_1
- yield test_2
- yield inner_suite
-
- suite_1 = unittest.TestSuite()
- suite_1.addTests(gen())
-
- self.assertEqual(list(suite_1), list(gen()))
-
- # "This is equivalent to iterating over tests, calling addTest() for
- # each element"
- suite_2 = unittest.TestSuite()
- for t in gen():
- suite_2.addTest(t)
-
- self.assertEqual(suite_1, suite_2)
-
- # "Add all the tests from an iterable of TestCase and TestSuite
- # instances to this test suite."
- #
- # What happens if it doesn't get an iterable?
- def test_addTest__noniterable(self):
- suite = unittest.TestSuite()
-
- try:
- suite.addTests(5)
- except TypeError:
- pass
- else:
- self.fail("Failed to raise TypeError")
-
- def test_addTest__noncallable(self):
- suite = unittest.TestSuite()
- self.assertRaises(TypeError, suite.addTest, 5)
-
- def test_addTest__casesuiteclass(self):
- suite = unittest.TestSuite()
- self.assertRaises(TypeError, suite.addTest, Test_TestSuite)
- self.assertRaises(TypeError, suite.addTest, unittest.TestSuite)
-
- def test_addTests__string(self):
- suite = unittest.TestSuite()
- self.assertRaises(TypeError, suite.addTests, "foo")
-
-
-class Test_FunctionTestCase(TestCase):
-
- # "Return the number of tests represented by the this test object. For
- # TestCase instances, this will always be 1"
- def test_countTestCases(self):
- test = unittest.FunctionTestCase(lambda: None)
-
- self.assertEqual(test.countTestCases(), 1)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if setUp() raises
- # an exception.
- def test_run_call_order__error_in_setUp(self):
- events = []
- result = LoggingResult(events)
-
- def setUp():
- events.append('setUp')
- raise RuntimeError('raised by setUp')
-
- def test():
- events.append('test')
-
- def tearDown():
- events.append('tearDown')
-
- expected = ['startTest', 'setUp', 'addError', 'stopTest']
- unittest.FunctionTestCase(test, setUp, tearDown).run(result)
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if the test raises
- # an error (as opposed to a failure).
- def test_run_call_order__error_in_test(self):
- events = []
- result = LoggingResult(events)
-
- def setUp():
- events.append('setUp')
-
- def test():
- events.append('test')
- raise RuntimeError('raised by test')
-
- def tearDown():
- events.append('tearDown')
-
- expected = ['startTest', 'setUp', 'test', 'addError', 'tearDown',
- 'stopTest']
- unittest.FunctionTestCase(test, setUp, tearDown).run(result)
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if the test signals
- # a failure (as opposed to an error).
- def test_run_call_order__failure_in_test(self):
- events = []
- result = LoggingResult(events)
-
- def setUp():
- events.append('setUp')
-
- def test():
- events.append('test')
- self.fail('raised by test')
-
- def tearDown():
- events.append('tearDown')
-
- expected = ['startTest', 'setUp', 'test', 'addFailure', 'tearDown',
- 'stopTest']
- unittest.FunctionTestCase(test, setUp, tearDown).run(result)
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if tearDown() raises
- # an exception.
- def test_run_call_order__error_in_tearDown(self):
- events = []
- result = LoggingResult(events)
-
- def setUp():
- events.append('setUp')
-
- def test():
- events.append('test')
-
- def tearDown():
- events.append('tearDown')
- raise RuntimeError('raised by tearDown')
-
- expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError',
- 'stopTest']
- unittest.FunctionTestCase(test, setUp, tearDown).run(result)
- self.assertEqual(events, expected)
-
- # "Return a string identifying the specific test case."
- #
- # Because of the vague nature of the docs, I'm not going to lock this
- # test down too much. Really all that can be asserted is that the id()
- # will be a string (either 8-byte or unicode -- again, because the docs
- # just say "string")
- def test_id(self):
- test = unittest.FunctionTestCase(lambda: None)
-
- self.failUnless(isinstance(test.id(), basestring))
-
- # "Returns a one-line description of the test, or None if no description
- # has been provided. The default implementation of this method returns
- # the first line of the test method's docstring, if available, or None."
- def test_shortDescription__no_docstring(self):
- test = unittest.FunctionTestCase(lambda: None)
-
- self.assertEqual(test.shortDescription(), None)
-
- # "Returns a one-line description of the test, or None if no description
- # has been provided. The default implementation of this method returns
- # the first line of the test method's docstring, if available, or None."
- def test_shortDescription__singleline_docstring(self):
- desc = "this tests foo"
- test = unittest.FunctionTestCase(lambda: None, description=desc)
-
- self.assertEqual(test.shortDescription(), "this tests foo")
-
-class Test_TestResult(TestCase):
- # Note: there are not separate tests for TestResult.wasSuccessful(),
- # TestResult.errors, TestResult.failures, TestResult.testsRun or
- # TestResult.shouldStop because these only have meaning in terms of
- # other TestResult methods.
- #
- # Accordingly, tests for the aforenamed attributes are incorporated
- # in with the tests for the defining methods.
- ################################################################
-
- def test_init(self):
- result = unittest.TestResult()
-
- self.failUnless(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 0)
- self.assertEqual(result.shouldStop, False)
-
- # "This method can be called to signal that the set of tests being
- # run should be aborted by setting the TestResult's shouldStop
- # attribute to True."
- def test_stop(self):
- result = unittest.TestResult()
-
- result.stop()
-
- self.assertEqual(result.shouldStop, True)
-
- # "Called when the test case test is about to be run. The default
- # implementation simply increments the instance's testsRun counter."
- def test_startTest(self):
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
-
- result = unittest.TestResult()
-
- result.startTest(test)
-
- self.failUnless(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- result.stopTest(test)
-
- # "Called after the test case test has been executed, regardless of
- # the outcome. The default implementation does nothing."
- def test_stopTest(self):
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
-
- result = unittest.TestResult()
-
- result.startTest(test)
-
- self.failUnless(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- result.stopTest(test)
-
- # Same tests as above; make sure nothing has changed
- self.failUnless(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- # "addSuccess(test)"
- # ...
- # "Called when the test case test succeeds"
- # ...
- # "wasSuccessful() - Returns True if all tests run so far have passed,
- # otherwise returns False"
- # ...
- # "testsRun - The total number of tests run so far."
- # ...
- # "errors - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test which raised an
- # unexpected exception. Contains formatted
- # tracebacks instead of sys.exc_info() results."
- # ...
- # "failures - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test where a failure was
- # explicitly signalled using the TestCase.fail*() or TestCase.assert*()
- # methods. Contains formatted tracebacks instead
- # of sys.exc_info() results."
- def test_addSuccess(self):
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
-
- result = unittest.TestResult()
-
- result.startTest(test)
- result.addSuccess(test)
- result.stopTest(test)
-
- self.failUnless(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- # "addFailure(test, err)"
- # ...
- # "Called when the test case test signals a failure. err is a tuple of
- # the form returned by sys.exc_info(): (type, value, traceback)"
- # ...
- # "wasSuccessful() - Returns True if all tests run so far have passed,
- # otherwise returns False"
- # ...
- # "testsRun - The total number of tests run so far."
- # ...
- # "errors - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test which raised an
- # unexpected exception. Contains formatted
- # tracebacks instead of sys.exc_info() results."
- # ...
- # "failures - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test where a failure was
- # explicitly signalled using the TestCase.fail*() or TestCase.assert*()
- # methods. Contains formatted tracebacks instead
- # of sys.exc_info() results."
- def test_addFailure(self):
- import sys
-
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
- try:
- test.fail("foo")
- except:
- exc_info_tuple = sys.exc_info()
-
- result = unittest.TestResult()
-
- result.startTest(test)
- result.addFailure(test, exc_info_tuple)
- result.stopTest(test)
-
- self.failIf(result.wasSuccessful())
- self.assertEqual(len(result.errors), 0)
- self.assertEqual(len(result.failures), 1)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- test_case, formatted_exc = result.failures[0]
- self.failUnless(test_case is test)
- self.failUnless(isinstance(formatted_exc, str))
-
- # "addError(test, err)"
- # ...
- # "Called when the test case test raises an unexpected exception err
- # is a tuple of the form returned by sys.exc_info():
- # (type, value, traceback)"
- # ...
- # "wasSuccessful() - Returns True if all tests run so far have passed,
- # otherwise returns False"
- # ...
- # "testsRun - The total number of tests run so far."
- # ...
- # "errors - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test which raised an
- # unexpected exception. Contains formatted
- # tracebacks instead of sys.exc_info() results."
- # ...
- # "failures - A list containing 2-tuples of TestCase instances and
- # formatted tracebacks. Each tuple represents a test where a failure was
- # explicitly signalled using the TestCase.fail*() or TestCase.assert*()
- # methods. Contains formatted tracebacks instead
- # of sys.exc_info() results."
- def test_addError(self):
- import sys
-
- class Foo(unittest.TestCase):
- def test_1(self):
- pass
-
- test = Foo('test_1')
- try:
- raise TypeError()
- except:
- exc_info_tuple = sys.exc_info()
-
- result = unittest.TestResult()
-
- result.startTest(test)
- result.addError(test, exc_info_tuple)
- result.stopTest(test)
-
- self.failIf(result.wasSuccessful())
- self.assertEqual(len(result.errors), 1)
- self.assertEqual(len(result.failures), 0)
- self.assertEqual(result.testsRun, 1)
- self.assertEqual(result.shouldStop, False)
-
- test_case, formatted_exc = result.errors[0]
- self.failUnless(test_case is test)
- self.failUnless(isinstance(formatted_exc, str))
-
-### Support code for Test_TestCase
-################################################################
-
-class Foo(unittest.TestCase):
- def runTest(self): pass
- def test1(self): pass
-
-class Bar(Foo):
- def test2(self): pass
-
-################################################################
-### /Support code for Test_TestCase
-
-class Test_TestCase(TestCase, TestEquality, TestHashing):
-
- ### Set up attributes used by inherited tests
- ################################################################
-
- # Used by TestHashing.test_hash and TestEquality.test_eq
- eq_pairs = [(Foo('test1'), Foo('test1'))]
-
- # Used by TestEquality.test_ne
- ne_pairs = [(Foo('test1'), Foo('runTest'))
- ,(Foo('test1'), Bar('test1'))
- ,(Foo('test1'), Bar('test2'))]
-
- ################################################################
- ### /Set up attributes used by inherited tests
-
-
- # "class TestCase([methodName])"
- # ...
- # "Each instance of TestCase will run a single test method: the
- # method named methodName."
- # ...
- # "methodName defaults to "runTest"."
- #
- # Make sure it really is optional, and that it defaults to the proper
- # thing.
- def test_init__no_test_name(self):
- class Test(unittest.TestCase):
- def runTest(self): raise MyException()
- def test(self): pass
-
- self.assertEqual(Test().id()[-13:], '.Test.runTest')
-
- # "class TestCase([methodName])"
- # ...
- # "Each instance of TestCase will run a single test method: the
- # method named methodName."
- def test_init__test_name__valid(self):
- class Test(unittest.TestCase):
- def runTest(self): raise MyException()
- def test(self): pass
-
- self.assertEqual(Test('test').id()[-10:], '.Test.test')
-
- # "class TestCase([methodName])"
- # ...
- # "Each instance of TestCase will run a single test method: the
- # method named methodName."
- def test_init__test_name__invalid(self):
- class Test(unittest.TestCase):
- def runTest(self): raise MyException()
- def test(self): pass
-
- try:
- Test('testfoo')
- except ValueError:
- pass
- else:
- self.fail("Failed to raise ValueError")
-
- # "Return the number of tests represented by the this test object. For
- # TestCase instances, this will always be 1"
- def test_countTestCases(self):
- class Foo(unittest.TestCase):
- def test(self): pass
-
- self.assertEqual(Foo('test').countTestCases(), 1)
-
- # "Return the default type of test result object to be used to run this
- # test. For TestCase instances, this will always be
- # unittest.TestResult; subclasses of TestCase should
- # override this as necessary."
- def test_defaultTestResult(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- result = Foo().defaultTestResult()
- self.assertEqual(type(result), unittest.TestResult)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if setUp() raises
- # an exception.
- def test_run_call_order__error_in_setUp(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(unittest.TestCase):
- def setUp(self):
- events.append('setUp')
- raise RuntimeError('raised by Foo.setUp')
-
- def test(self):
- events.append('test')
-
- def tearDown(self):
- events.append('tearDown')
-
- Foo('test').run(result)
- expected = ['startTest', 'setUp', 'addError', 'stopTest']
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if the test raises
- # an error (as opposed to a failure).
- def test_run_call_order__error_in_test(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(unittest.TestCase):
- def setUp(self):
- events.append('setUp')
-
- def test(self):
- events.append('test')
- raise RuntimeError('raised by Foo.test')
-
- def tearDown(self):
- events.append('tearDown')
-
- expected = ['startTest', 'setUp', 'test', 'addError', 'tearDown',
- 'stopTest']
- Foo('test').run(result)
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if the test signals
- # a failure (as opposed to an error).
- def test_run_call_order__failure_in_test(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(unittest.TestCase):
- def setUp(self):
- events.append('setUp')
-
- def test(self):
- events.append('test')
- self.fail('raised by Foo.test')
-
- def tearDown(self):
- events.append('tearDown')
-
- expected = ['startTest', 'setUp', 'test', 'addFailure', 'tearDown',
- 'stopTest']
- Foo('test').run(result)
- self.assertEqual(events, expected)
-
- # "When a setUp() method is defined, the test runner will run that method
- # prior to each test. Likewise, if a tearDown() method is defined, the
- # test runner will invoke that method after each test. In the example,
- # setUp() was used to create a fresh sequence for each test."
- #
- # Make sure the proper call order is maintained, even if tearDown() raises
- # an exception.
- def test_run_call_order__error_in_tearDown(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(unittest.TestCase):
- def setUp(self):
- events.append('setUp')
-
- def test(self):
- events.append('test')
-
- def tearDown(self):
- events.append('tearDown')
- raise RuntimeError('raised by Foo.tearDown')
-
- Foo('test').run(result)
- expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError',
- 'stopTest']
- self.assertEqual(events, expected)
-
- # "This class attribute gives the exception raised by the test() method.
- # If a test framework needs to use a specialized exception, possibly to
- # carry additional information, it must subclass this exception in
- # order to ``play fair'' with the framework. The initial value of this
- # attribute is AssertionError"
- def test_failureException__default(self):
- class Foo(unittest.TestCase):
- def test(self):
- pass
-
- self.failUnless(Foo('test').failureException is AssertionError)
-
- # "This class attribute gives the exception raised by the test() method.
- # If a test framework needs to use a specialized exception, possibly to
- # carry additional information, it must subclass this exception in
- # order to ``play fair'' with the framework."
- #
- # Make sure TestCase.run() respects the designated failureException
- def test_failureException__subclassing__explicit_raise(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(unittest.TestCase):
- def test(self):
- raise RuntimeError()
-
- failureException = RuntimeError
-
- self.failUnless(Foo('test').failureException is RuntimeError)
-
-
- Foo('test').run(result)
- expected = ['startTest', 'addFailure', 'stopTest']
- self.assertEqual(events, expected)
-
- # "This class attribute gives the exception raised by the test() method.
- # If a test framework needs to use a specialized exception, possibly to
- # carry additional information, it must subclass this exception in
- # order to ``play fair'' with the framework."
- #
- # Make sure TestCase.run() respects the designated failureException
- def test_failureException__subclassing__implicit_raise(self):
- events = []
- result = LoggingResult(events)
-
- class Foo(unittest.TestCase):
- def test(self):
- self.fail("foo")
-
- failureException = RuntimeError
-
- self.failUnless(Foo('test').failureException is RuntimeError)
-
-
- Foo('test').run(result)
- expected = ['startTest', 'addFailure', 'stopTest']
- self.assertEqual(events, expected)
-
- # "The default implementation does nothing."
- def test_setUp(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- # ... and nothing should happen
- Foo().setUp()
-
- # "The default implementation does nothing."
- def test_tearDown(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- # ... and nothing should happen
- Foo().tearDown()
-
- # "Return a string identifying the specific test case."
- #
- # Because of the vague nature of the docs, I'm not going to lock this
- # test down too much. Really all that can be asserted is that the id()
- # will be a string (either 8-byte or unicode -- again, because the docs
- # just say "string")
- def test_id(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- self.failUnless(isinstance(Foo().id(), basestring))
-
- # "Returns a one-line description of the test, or None if no description
- # has been provided. The default implementation of this method returns
- # the first line of the test method's docstring, if available, or None."
- def test_shortDescription__no_docstring(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- pass
-
- self.assertEqual(Foo().shortDescription(), None)
-
- # "Returns a one-line description of the test, or None if no description
- # has been provided. The default implementation of this method returns
- # the first line of the test method's docstring, if available, or None."
- def test_shortDescription__singleline_docstring(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- "this tests foo"
- pass
-
- self.assertEqual(Foo().shortDescription(), "this tests foo")
-
- # "Returns a one-line description of the test, or None if no description
- # has been provided. The default implementation of this method returns
- # the first line of the test method's docstring, if available, or None."
- def test_shortDescription__multiline_docstring(self):
- class Foo(unittest.TestCase):
- def runTest(self):
- """this tests foo
- blah, bar and baz are also tested"""
- pass
-
- self.assertEqual(Foo().shortDescription(), "this tests foo")
-
- # "If result is omitted or None, a temporary result object is created
- # and used, but is not made available to the caller"
- def test_run__uses_defaultTestResult(self):
- events = []
-
- class Foo(unittest.TestCase):
- def test(self):
- events.append('test')
-
- def defaultTestResult(self):
- return LoggingResult(events)
-
- # Make run() find a result object on its own
- Foo('test').run()
-
- expected = ['startTest', 'test', 'stopTest']
- self.assertEqual(events, expected)
-
-class Test_Assertions(TestCase):
- def test_AlmostEqual(self):
- self.failUnlessAlmostEqual(1.00000001, 1.0)
- self.failIfAlmostEqual(1.0000001, 1.0)
- self.assertRaises(AssertionError,
- self.failUnlessAlmostEqual, 1.0000001, 1.0)
- self.assertRaises(AssertionError,
- self.failIfAlmostEqual, 1.00000001, 1.0)
-
- self.failUnlessAlmostEqual(1.1, 1.0, places=0)
- self.assertRaises(AssertionError,
- self.failUnlessAlmostEqual, 1.1, 1.0, places=1)
-
- self.failUnlessAlmostEqual(0, .1+.1j, places=0)
- self.failIfAlmostEqual(0, .1+.1j, places=1)
- self.assertRaises(AssertionError,
- self.failUnlessAlmostEqual, 0, .1+.1j, places=1)
- self.assertRaises(AssertionError,
- self.failIfAlmostEqual, 0, .1+.1j, places=0)
-
-
-
-######################################################################
-## Main
-######################################################################
def test_main():
- test_support.run_unittest(Test_TestCase, Test_TestLoader,
- Test_TestSuite, Test_TestResult, Test_FunctionTestCase,
- Test_Assertions)
+ test_support.run_unittest(unittest.test.suite())
+ test_support.reap_children()
+
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_univnewlines.py b/Lib/test/test_univnewlines.py
index 50218842c3..a0a909058c 100644
--- a/Lib/test/test_univnewlines.py
+++ b/Lib/test/test_univnewlines.py
@@ -1,20 +1,28 @@
# Tests universal newline support for both reading and parsing files.
+
+# NOTE: this file tests the new `io` library backported from Python 3.x.
+# Similar tests for the builtin file object can be found in test_univnewlines2k.py.
+
+from __future__ import print_function
+from __future__ import unicode_literals
+
+import io
+import _pyio as pyio
import unittest
import os
import sys
-from test import test_support
+from test import test_support as support
if not hasattr(sys.stdin, 'newlines'):
- raise test_support.TestSkipped, \
- "This Python does not have universal newline support"
+ raise unittest.SkipTest(
+ "This Python does not have universal newline support")
FATX = 'x' * (2**14)
DATA_TEMPLATE = [
"line1=1",
- "line2='this is a very long line designed to go past the magic " +
- "hundred character limit that is inside fileobject.c and which " +
- "is meant to speed up the common case, but we also want to test " +
+ "line2='this is a very long line designed to go past any default " +
+ "buffer limits that exist in io.py but we also want to test " +
"the uncommon case, naturally.'",
"def line3():pass",
"line4 = '%s'" % FATX,
@@ -28,71 +36,58 @@ DATA_CRLF = "\r\n".join(DATA_TEMPLATE) + "\r\n"
# before end-of-file.
DATA_MIXED = "\n".join(DATA_TEMPLATE) + "\r"
DATA_SPLIT = [x + "\n" for x in DATA_TEMPLATE]
-del x
class TestGenericUnivNewlines(unittest.TestCase):
# use a class variable DATA to define the data to write to the file
# and a class variable NEWLINE to set the expected newlines value
- READMODE = 'U'
+ READMODE = 'r'
WRITEMODE = 'wb'
def setUp(self):
- fp = open(test_support.TESTFN, self.WRITEMODE)
- fp.write(self.DATA)
- fp.close()
+ data = self.DATA
+ if "b" in self.WRITEMODE:
+ data = data.encode("ascii")
+ with self.open(support.TESTFN, self.WRITEMODE) as fp:
+ fp.write(data)
def tearDown(self):
try:
- os.unlink(test_support.TESTFN)
+ os.unlink(support.TESTFN)
except:
pass
def test_read(self):
- fp = open(test_support.TESTFN, self.READMODE)
- data = fp.read()
+ with self.open(support.TESTFN, self.READMODE) as fp:
+ data = fp.read()
self.assertEqual(data, DATA_LF)
- self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
+ self.assertEqual(set(fp.newlines), set(self.NEWLINE))
def test_readlines(self):
- fp = open(test_support.TESTFN, self.READMODE)
- data = fp.readlines()
+ with self.open(support.TESTFN, self.READMODE) as fp:
+ data = fp.readlines()
self.assertEqual(data, DATA_SPLIT)
- self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
+ self.assertEqual(set(fp.newlines), set(self.NEWLINE))
def test_readline(self):
- fp = open(test_support.TESTFN, self.READMODE)
- data = []
- d = fp.readline()
- while d:
- data.append(d)
+ with self.open(support.TESTFN, self.READMODE) as fp:
+ data = []
d = fp.readline()
+ while d:
+ data.append(d)
+ d = fp.readline()
self.assertEqual(data, DATA_SPLIT)
- self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
+ self.assertEqual(set(fp.newlines), set(self.NEWLINE))
def test_seek(self):
- fp = open(test_support.TESTFN, self.READMODE)
- fp.readline()
- pos = fp.tell()
- data = fp.readlines()
- self.assertEqual(data, DATA_SPLIT[1:])
- fp.seek(pos)
- data = fp.readlines()
+ with self.open(support.TESTFN, self.READMODE) as fp:
+ fp.readline()
+ pos = fp.tell()
+ data = fp.readlines()
+ self.assertEqual(data, DATA_SPLIT[1:])
+ fp.seek(pos)
+ data = fp.readlines()
self.assertEqual(data, DATA_SPLIT[1:])
- def test_execfile(self):
- namespace = {}
- with test_support._check_py3k_warnings():
- execfile(test_support.TESTFN, namespace)
- func = namespace['line3']
- self.assertEqual(func.func_code.co_firstlineno, 3)
- self.assertEqual(namespace['line4'], FATX)
-
-
-class TestNativeNewlines(TestGenericUnivNewlines):
- NEWLINE = None
- DATA = DATA_LF
- READMODE = 'r'
- WRITEMODE = 'w'
class TestCRNewlines(TestGenericUnivNewlines):
NEWLINE = '\r'
@@ -107,10 +102,10 @@ class TestCRLFNewlines(TestGenericUnivNewlines):
DATA = DATA_CRLF
def test_tell(self):
- fp = open(test_support.TESTFN, self.READMODE)
- self.assertEqual(repr(fp.newlines), repr(None))
- data = fp.readline()
- pos = fp.tell()
+ with self.open(support.TESTFN, self.READMODE) as fp:
+ self.assertEqual(repr(fp.newlines), repr(None))
+ data = fp.readline()
+ pos = fp.tell()
self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
class TestMixedNewlines(TestGenericUnivNewlines):
@@ -119,13 +114,22 @@ class TestMixedNewlines(TestGenericUnivNewlines):
def test_main():
- test_support.run_unittest(
- TestNativeNewlines,
- TestCRNewlines,
- TestLFNewlines,
- TestCRLFNewlines,
- TestMixedNewlines
- )
+ base_tests = (TestCRNewlines,
+ TestLFNewlines,
+ TestCRLFNewlines,
+ TestMixedNewlines)
+ tests = []
+ # Test the C and Python implementations.
+ for test in base_tests:
+ class CTest(test):
+ open = io.open
+ CTest.__name__ = str("C" + test.__name__)
+ class PyTest(test):
+ open = staticmethod(pyio.open)
+ PyTest.__name__ = str("Py" + test.__name__)
+ tests.append(CTest)
+ tests.append(PyTest)
+ support.run_unittest(*tests)
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_univnewlines2k.py b/Lib/test/test_univnewlines2k.py
new file mode 100644
index 0000000000..4eca31d8ba
--- /dev/null
+++ b/Lib/test/test_univnewlines2k.py
@@ -0,0 +1,130 @@
+# Tests universal newline support for both reading and parsing files.
+import unittest
+import os
+import sys
+from test import test_support
+
+if not hasattr(sys.stdin, 'newlines'):
+ raise unittest.SkipTest, \
+ "This Python does not have universal newline support"
+
+FATX = 'x' * (2**14)
+
+DATA_TEMPLATE = [
+ "line1=1",
+ "line2='this is a very long line designed to go past the magic " +
+ "hundred character limit that is inside fileobject.c and which " +
+ "is meant to speed up the common case, but we also want to test " +
+ "the uncommon case, naturally.'",
+ "def line3():pass",
+ "line4 = '%s'" % FATX,
+ ]
+
+DATA_LF = "\n".join(DATA_TEMPLATE) + "\n"
+DATA_CR = "\r".join(DATA_TEMPLATE) + "\r"
+DATA_CRLF = "\r\n".join(DATA_TEMPLATE) + "\r\n"
+
+# Note that DATA_MIXED also tests the ability to recognize a lone \r
+# before end-of-file.
+DATA_MIXED = "\n".join(DATA_TEMPLATE) + "\r"
+DATA_SPLIT = [x + "\n" for x in DATA_TEMPLATE]
+del x
+
+class TestGenericUnivNewlines(unittest.TestCase):
+ # use a class variable DATA to define the data to write to the file
+ # and a class variable NEWLINE to set the expected newlines value
+ READMODE = 'U'
+ WRITEMODE = 'wb'
+
+ def setUp(self):
+ with open(test_support.TESTFN, self.WRITEMODE) as fp:
+ fp.write(self.DATA)
+
+ def tearDown(self):
+ try:
+ os.unlink(test_support.TESTFN)
+ except:
+ pass
+
+ def test_read(self):
+ with open(test_support.TESTFN, self.READMODE) as fp:
+ data = fp.read()
+ self.assertEqual(data, DATA_LF)
+ self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
+
+ def test_readlines(self):
+ with open(test_support.TESTFN, self.READMODE) as fp:
+ data = fp.readlines()
+ self.assertEqual(data, DATA_SPLIT)
+ self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
+
+ def test_readline(self):
+ with open(test_support.TESTFN, self.READMODE) as fp:
+ data = []
+ d = fp.readline()
+ while d:
+ data.append(d)
+ d = fp.readline()
+ self.assertEqual(data, DATA_SPLIT)
+ self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
+
+ def test_seek(self):
+ with open(test_support.TESTFN, self.READMODE) as fp:
+ fp.readline()
+ pos = fp.tell()
+ data = fp.readlines()
+ self.assertEqual(data, DATA_SPLIT[1:])
+ fp.seek(pos)
+ data = fp.readlines()
+ self.assertEqual(data, DATA_SPLIT[1:])
+
+ def test_execfile(self):
+ namespace = {}
+ with test_support.check_py3k_warnings():
+ execfile(test_support.TESTFN, namespace)
+ func = namespace['line3']
+ self.assertEqual(func.func_code.co_firstlineno, 3)
+ self.assertEqual(namespace['line4'], FATX)
+
+
+class TestNativeNewlines(TestGenericUnivNewlines):
+ NEWLINE = None
+ DATA = DATA_LF
+ READMODE = 'r'
+ WRITEMODE = 'w'
+
+class TestCRNewlines(TestGenericUnivNewlines):
+ NEWLINE = '\r'
+ DATA = DATA_CR
+
+class TestLFNewlines(TestGenericUnivNewlines):
+ NEWLINE = '\n'
+ DATA = DATA_LF
+
+class TestCRLFNewlines(TestGenericUnivNewlines):
+ NEWLINE = '\r\n'
+ DATA = DATA_CRLF
+
+ def test_tell(self):
+ with open(test_support.TESTFN, self.READMODE) as fp:
+ self.assertEqual(repr(fp.newlines), repr(None))
+ data = fp.readline()
+ pos = fp.tell()
+ self.assertEqual(repr(fp.newlines), repr(self.NEWLINE))
+
+class TestMixedNewlines(TestGenericUnivNewlines):
+ NEWLINE = ('\r', '\n')
+ DATA = DATA_MIXED
+
+
+def test_main():
+ test_support.run_unittest(
+ TestNativeNewlines,
+ TestCRNewlines,
+ TestLFNewlines,
+ TestCRLFNewlines,
+ TestMixedNewlines
+ )
+
+if __name__ == '__main__':
+ test_main()
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index 84b6f253ab..e7e54a2dd8 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -5,6 +5,7 @@ import httplib
import unittest
from test import test_support
import os
+import sys
import mimetools
import tempfile
import StringIO
@@ -44,7 +45,7 @@ class urlopen_FileTests(unittest.TestCase):
# Make sure object returned by urlopen() has the specified methods
for attr in ("read", "readline", "readlines", "fileno",
"close", "info", "geturl", "getcode", "__iter__"):
- self.assert_(hasattr(self.returned_obj, attr),
+ self.assertTrue(hasattr(self.returned_obj, attr),
"object returned by urlopen() lacks %s attribute" %
attr)
@@ -66,8 +67,7 @@ class urlopen_FileTests(unittest.TestCase):
def test_fileno(self):
file_num = self.returned_obj.fileno()
- self.assert_(isinstance(file_num, int),
- "fileno() did not return an int")
+ self.assertIsInstance(file_num, int, "fileno() did not return an int")
self.assertEqual(os.read(file_num, len(self.text)), self.text,
"Reading on the file descriptor returned by fileno() "
"did not return the expected text")
@@ -78,7 +78,7 @@ class urlopen_FileTests(unittest.TestCase):
self.returned_obj.close()
def test_info(self):
- self.assert_(isinstance(self.returned_obj.info(), mimetools.Message))
+ self.assertIsInstance(self.returned_obj.info(), mimetools.Message)
def test_geturl(self):
self.assertEqual(self.returned_obj.geturl(), self.pathname)
@@ -113,7 +113,7 @@ class ProxyTests(unittest.TestCase):
self.env.set('NO_PROXY', 'localhost')
proxies = urllib.getproxies_environment()
# getproxies_environment use lowered case truncated (no '_proxy') keys
- self.assertEquals('localhost', proxies['no'])
+ self.assertEqual('localhost', proxies['no'])
class urlopen_HttpTests(unittest.TestCase):
@@ -149,6 +149,16 @@ class urlopen_HttpTests(unittest.TestCase):
finally:
self.unfakehttp()
+ def test_url_fragment(self):
+ # Issue #11703: geturl() omits fragments in the original URL.
+ url = 'http://docs.python.org/library/urllib.html#OK'
+ self.fakehttp('Hello!')
+ try:
+ fp = urllib.urlopen(url)
+ self.assertEqual(fp.geturl(), url)
+ finally:
+ self.unfakehttp()
+
def test_read_bogus(self):
# urlopen() should raise IOError for many error codes.
self.fakehttp('''HTTP/1.1 401 Authentication Required
@@ -242,9 +252,9 @@ class urlretrieve_FileTests(unittest.TestCase):
# a headers value is returned.
result = urllib.urlretrieve("file:%s" % test_support.TESTFN)
self.assertEqual(result[0], test_support.TESTFN)
- self.assert_(isinstance(result[1], mimetools.Message),
- "did not get a mimetools.Message instance as second "
- "returned value")
+ self.assertIsInstance(result[1], mimetools.Message,
+ "did not get a mimetools.Message instance as "
+ "second returned value")
def test_copy(self):
# Test that setting the filename argument works.
@@ -253,7 +263,7 @@ class urlretrieve_FileTests(unittest.TestCase):
result = urllib.urlretrieve(self.constructLocalFileUrl(
test_support.TESTFN), second_temp)
self.assertEqual(second_temp, result[0])
- self.assert_(os.path.exists(second_temp), "copy of the file was not "
+ self.assertTrue(os.path.exists(second_temp), "copy of the file was not "
"made")
FILE = file(second_temp, 'rb')
try:
@@ -267,9 +277,9 @@ class urlretrieve_FileTests(unittest.TestCase):
def test_reporthook(self):
# Make sure that the reporthook works.
def hooktester(count, block_size, total_size, count_holder=[0]):
- self.assert_(isinstance(count, int))
- self.assert_(isinstance(block_size, int))
- self.assert_(isinstance(total_size, int))
+ self.assertIsInstance(count, int)
+ self.assertIsInstance(block_size, int)
+ self.assertIsInstance(total_size, int)
self.assertEqual(count, count_holder[0])
count_holder[0] = count_holder[0] + 1
second_temp = "%s.2" % test_support.TESTFN
@@ -396,6 +406,7 @@ class QuotingTests(unittest.TestCase):
"using quote(): %s != %s" % (expected, result))
self.assertEqual(expected, result,
"using quote_plus(): %s != %s" % (expected, result))
+ self.assertRaises(TypeError, urllib.quote, None)
def test_quoting_space(self):
# Make sure quote() and quote_plus() handle spaces as specified in
@@ -526,7 +537,7 @@ class urlencode_Tests(unittest.TestCase):
expect_somewhere = ["1st=1", "2nd=2", "3rd=3"]
result = urllib.urlencode(given)
for expected in expect_somewhere:
- self.assert_(expected in result,
+ self.assertIn(expected, result,
"testing %s: %s not found in %s" %
(test_type, expected, result))
self.assertEqual(result.count('&'), 2,
@@ -535,7 +546,7 @@ class urlencode_Tests(unittest.TestCase):
amp_location = result.index('&')
on_amp_left = result[amp_location - 1]
on_amp_right = result[amp_location + 1]
- self.assert_(on_amp_left.isdigit() and on_amp_right.isdigit(),
+ self.assertTrue(on_amp_left.isdigit() and on_amp_right.isdigit(),
"testing %s: '&' not located in proper place in %s" %
(test_type, result))
self.assertEqual(len(result), (5 * 3) + 2, #5 chars per thing and amps
@@ -573,8 +584,7 @@ class urlencode_Tests(unittest.TestCase):
result = urllib.urlencode(given, True)
for value in given["sequence"]:
expect = "sequence=%s" % value
- self.assert_(expect in result,
- "%s not found in %s" % (expect, result))
+ self.assertIn(expect, result)
self.assertEqual(result.count('&'), 2,
"Expected 2 '&'s, got %s" % result.count('&'))
@@ -621,8 +631,42 @@ class Pathname_Tests(unittest.TestCase):
"url2pathname() failed; %s != %s" %
(expect, result))
+ @unittest.skipUnless(sys.platform == 'win32',
+ 'test specific to the nturl2path library')
+ def test_ntpath(self):
+ given = ('/C:/', '///C:/', '/C|//')
+ expect = 'C:\\'
+ for url in given:
+ result = urllib.url2pathname(url)
+ self.assertEqual(expect, result,
+ 'nturl2path.url2pathname() failed; %s != %s' %
+ (expect, result))
+ given = '///C|/path'
+ expect = 'C:\\path'
+ result = urllib.url2pathname(given)
+ self.assertEqual(expect, result,
+ 'nturl2path.url2pathname() failed; %s != %s' %
+ (expect, result))
+
+class Utility_Tests(unittest.TestCase):
+ """Testcase to test the various utility functions in the urllib."""
+
+ def test_splitpasswd(self):
+ """Some of the password examples are not sensible, but it is added to
+ confirming to RFC2617 and addressing issue4675.
+ """
+ self.assertEqual(('user', 'ab'),urllib.splitpasswd('user:ab'))
+ self.assertEqual(('user', 'a\nb'),urllib.splitpasswd('user:a\nb'))
+ self.assertEqual(('user', 'a\tb'),urllib.splitpasswd('user:a\tb'))
+ self.assertEqual(('user', 'a\rb'),urllib.splitpasswd('user:a\rb'))
+ self.assertEqual(('user', 'a\fb'),urllib.splitpasswd('user:a\fb'))
+ self.assertEqual(('user', 'a\vb'),urllib.splitpasswd('user:a\vb'))
+ self.assertEqual(('user', 'a:b'),urllib.splitpasswd('user:a:b'))
+
+
class URLopener_Tests(unittest.TestCase):
"""Testcase to test the open method of URLopener class."""
+
def test_quoted_open(self):
class DummyURLopener(urllib.URLopener):
def open_spam(self, url):
@@ -639,7 +683,7 @@ class URLopener_Tests(unittest.TestCase):
# Just commented them out.
# Can't really tell why keep failing in windows and sparc.
-# Everywhere else they work ok, but on those machines, someteimes
+# Everywhere else they work ok, but on those machines, sometimes
# fail in one of the tests, sometimes in other. I have a linux, and
# the tests go ok.
# If anybody has one of the problematic enviroments, please help!
@@ -688,7 +732,7 @@ class URLopener_Tests(unittest.TestCase):
# def testTimeoutNone(self):
# # global default timeout is ignored
# import socket
-# self.assert_(socket.getdefaulttimeout() is None)
+# self.assertTrue(socket.getdefaulttimeout() is None)
# socket.setdefaulttimeout(30)
# try:
# ftp = urllib.ftpwrapper("myuser", "mypass", "localhost", 9093, [])
@@ -700,7 +744,7 @@ class URLopener_Tests(unittest.TestCase):
# def testTimeoutDefault(self):
# # global default timeout is used
# import socket
-# self.assert_(socket.getdefaulttimeout() is None)
+# self.assertTrue(socket.getdefaulttimeout() is None)
# socket.setdefaulttimeout(30)
# try:
# ftp = urllib.ftpwrapper("myuser", "mypass", "localhost", 9093, [])
@@ -731,6 +775,7 @@ def test_main():
UnquotingTests,
urlencode_Tests,
Pathname_Tests,
+ Utility_Tests,
URLopener_Tests,
#FTPWrapperTests,
)
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 8250aab935..e96f948a9b 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -24,9 +24,7 @@ class TrivialTests(unittest.TestCase):
# And more hacking to get it to work on MacOS. This assumes
# urllib.pathname2url works, unfortunately...
- if os.name == 'mac':
- fname = '/' + fname.replace(':', '/')
- elif os.name == 'riscos':
+ if os.name == 'riscos':
import string
fname = os.expand(fname)
fname = fname.translate(string.maketrans("/.", "./"))
@@ -47,7 +45,7 @@ class TrivialTests(unittest.TestCase):
('a, b, "c", "d", "e,f", g, h', ['a', 'b', '"c"', '"d"', '"e,f"', 'g', 'h']),
('a="b\\"c", d="e\\,f", g="h\\\\i"', ['a="b"c"', 'd="e,f"', 'g="h\\i"'])]
for string, list in tests:
- self.assertEquals(urllib2.parse_http_list(string), list)
+ self.assertEqual(urllib2.parse_http_list(string), list)
def test_request_headers_dict():
@@ -288,7 +286,7 @@ class MockHTTPClass:
def set_debuglevel(self, level):
self.level = level
- def _set_tunnel(self, host, port=None, headers=None):
+ def set_tunnel(self, host, port=None, headers=None):
self._tunnel_host = host
self._tunnel_port = port
if headers:
@@ -580,15 +578,15 @@ class OpenerDirectorTests(unittest.TestCase):
# *_request
self.assertEqual((handler, name), calls[i])
self.assertEqual(len(args), 1)
- self.assert_(isinstance(args[0], Request))
+ self.assertIsInstance(args[0], Request)
else:
# *_response
self.assertEqual((handler, name), calls[i])
self.assertEqual(len(args), 2)
- self.assert_(isinstance(args[0], Request))
+ self.assertIsInstance(args[0], Request)
# response from opener.open is None, because there's no
# handler that defines http_open to handle it
- self.assert_(args[1] is None or
+ self.assertTrue(args[1] is None or
isinstance(args[1], MockResponse))
@@ -624,22 +622,32 @@ class HandlerTests(unittest.TestCase):
h = NullFTPHandler(data)
o = h.parent = MockOpener()
- for url, host, port, type_, dirs, filename, mimetype in [
+ for url, host, port, user, passwd, type_, dirs, filename, mimetype in [
("ftp://localhost/foo/bar/baz.html",
- "localhost", ftplib.FTP_PORT, "I",
+ "localhost", ftplib.FTP_PORT, "", "", "I",
+ ["foo", "bar"], "baz.html", "text/html"),
+ ("ftp://parrot@localhost/foo/bar/baz.html",
+ "localhost", ftplib.FTP_PORT, "parrot", "", "I",
+ ["foo", "bar"], "baz.html", "text/html"),
+ ("ftp://%25parrot@localhost/foo/bar/baz.html",
+ "localhost", ftplib.FTP_PORT, "%parrot", "", "I",
+ ["foo", "bar"], "baz.html", "text/html"),
+ ("ftp://%2542parrot@localhost/foo/bar/baz.html",
+ "localhost", ftplib.FTP_PORT, "%42parrot", "", "I",
["foo", "bar"], "baz.html", "text/html"),
("ftp://localhost:80/foo/bar/",
- "localhost", 80, "D",
+ "localhost", 80, "", "", "D",
["foo", "bar"], "", None),
("ftp://localhost/baz.gif;type=a",
- "localhost", ftplib.FTP_PORT, "A",
+ "localhost", ftplib.FTP_PORT, "", "", "A",
[], "baz.gif", None), # XXX really this should guess image/gif
]:
req = Request(url)
req.timeout = None
r = h.ftp_open(req)
# ftp authentication not yet implemented by FTPHandler
- self.assert_(h.user == h.passwd == "")
+ self.assertEqual(h.user, user)
+ self.assertEqual(h.passwd, passwd)
self.assertEqual(h.host, socket.gethostbyname(host))
self.assertEqual(h.port, port)
self.assertEqual(h.dirs, dirs)
@@ -736,11 +744,11 @@ class HandlerTests(unittest.TestCase):
h.file_open(req)
# XXXX remove OSError when bug fixed
except (urllib2.URLError, OSError):
- self.assert_(not ftp)
+ self.assertTrue(not ftp)
else:
- self.assert_(o.req is req)
+ self.assertTrue(o.req is req)
self.assertEqual(req.type, "ftp")
- self.assertEqual(req.type is "ftp", ftp)
+ self.assertEqual(req.type == "ftp", ftp)
def test_http(self):
@@ -783,8 +791,8 @@ class HandlerTests(unittest.TestCase):
r = MockResponse(200, "OK", {}, "")
newreq = h.do_request_(req)
if data is None: # GET
- self.assert_("Content-length" not in req.unredirected_hdrs)
- self.assert_("Content-type" not in req.unredirected_hdrs)
+ self.assertNotIn("Content-length", req.unredirected_hdrs)
+ self.assertNotIn("Content-type", req.unredirected_hdrs)
else: # POST
self.assertEqual(req.unredirected_hdrs["Content-length"], "0")
self.assertEqual(req.unredirected_hdrs["Content-type"],
@@ -830,6 +838,25 @@ class HandlerTests(unittest.TestCase):
p_ds_req = h.do_request_(ds_req)
self.assertEqual(p_ds_req.unredirected_hdrs["Host"],"example.com")
+ def test_fixpath_in_weirdurls(self):
+ # Issue4493: urllib2 to supply '/' when to urls where path does not
+ # start with'/'
+
+ h = urllib2.AbstractHTTPHandler()
+ o = h.parent = MockOpener()
+
+ weird_url = 'http://www.python.org?getspam'
+ req = Request(weird_url)
+ newreq = h.do_request_(req)
+ self.assertEqual(newreq.get_host(),'www.python.org')
+ self.assertEqual(newreq.get_selector(),'/?getspam')
+
+ url_without_path = 'http://www.python.org'
+ req = Request(url_without_path)
+ newreq = h.do_request_(req)
+ self.assertEqual(newreq.get_host(),'www.python.org')
+ self.assertEqual(newreq.get_selector(),'')
+
def test_errors(self):
h = urllib2.HTTPErrorProcessor()
o = h.parent = MockOpener()
@@ -839,19 +866,19 @@ class HandlerTests(unittest.TestCase):
# all 2xx are passed through
r = MockResponse(200, "OK", {}, "", url)
newr = h.http_response(req, r)
- self.assert_(r is newr)
- self.assert_(not hasattr(o, "proto")) # o.error not called
+ self.assertTrue(r is newr)
+ self.assertTrue(not hasattr(o, "proto")) # o.error not called
r = MockResponse(202, "Accepted", {}, "", url)
newr = h.http_response(req, r)
- self.assert_(r is newr)
- self.assert_(not hasattr(o, "proto")) # o.error not called
+ self.assertTrue(r is newr)
+ self.assertTrue(not hasattr(o, "proto")) # o.error not called
r = MockResponse(206, "Partial content", {}, "", url)
newr = h.http_response(req, r)
- self.assert_(r is newr)
- self.assert_(not hasattr(o, "proto")) # o.error not called
+ self.assertTrue(r is newr)
+ self.assertTrue(not hasattr(o, "proto")) # o.error not called
# anything else calls o.error (and MockOpener returns None, here)
r = MockResponse(502, "Bad gateway", {}, "", url)
- self.assert_(h.http_response(req, r) is None)
+ self.assertTrue(h.http_response(req, r) is None)
self.assertEqual(o.proto, "http") # o.error called
self.assertEqual(o.args, (req, r, 502, "Bad gateway", {}))
@@ -863,12 +890,12 @@ class HandlerTests(unittest.TestCase):
req = Request("http://example.com/")
r = MockResponse(200, "OK", {}, "")
newreq = h.http_request(req)
- self.assert_(cj.ach_req is req is newreq)
- self.assertEquals(req.get_origin_req_host(), "example.com")
- self.assert_(not req.is_unverifiable())
+ self.assertTrue(cj.ach_req is req is newreq)
+ self.assertEqual(req.get_origin_req_host(), "example.com")
+ self.assertTrue(not req.is_unverifiable())
newr = h.http_response(req, r)
- self.assert_(cj.ec_req is req)
- self.assert_(cj.ec_r is r is newr)
+ self.assertTrue(cj.ec_req is req)
+ self.assertTrue(cj.ec_r is r is newr)
def test_redirect(self):
from_url = "http://example.com/a.html"
@@ -891,23 +918,23 @@ class HandlerTests(unittest.TestCase):
MockHeaders({"location": to_url}))
except urllib2.HTTPError:
# 307 in response to POST requires user OK
- self.assert_(code == 307 and data is not None)
+ self.assertTrue(code == 307 and data is not None)
self.assertEqual(o.req.get_full_url(), to_url)
try:
self.assertEqual(o.req.get_method(), "GET")
except AttributeError:
- self.assert_(not o.req.has_data())
+ self.assertTrue(not o.req.has_data())
# now it's a GET, there should not be headers regarding content
# (possibly dragged from before being a POST)
headers = [x.lower() for x in o.req.headers]
- self.assertTrue("content-length" not in headers)
- self.assertTrue("content-type" not in headers)
+ self.assertNotIn("content-length", headers)
+ self.assertNotIn("content-type", headers)
self.assertEqual(o.req.headers["Nonsense"],
"viking=withhold")
- self.assert_("Spam" not in o.req.headers)
- self.assert_("Spam" not in o.req.unredirected_hdrs)
+ self.assertNotIn("Spam", o.req.headers)
+ self.assertNotIn("Spam", o.req.unredirected_hdrs)
# loop detection
req = Request(from_url)
@@ -950,6 +977,7 @@ class HandlerTests(unittest.TestCase):
h = urllib2.HTTPRedirectHandler()
o = h.parent = MockOpener()
req = Request(from_url)
+ req.timeout = socket._GLOBAL_DEFAULT_TIMEOUT
for scheme in invalid_schemes:
invalid_url = scheme + '://' + schemeless_url
@@ -977,7 +1005,16 @@ class HandlerTests(unittest.TestCase):
cp = urllib2.HTTPCookieProcessor(cj)
o = build_test_opener(hh, hdeh, hrh, cp)
o.open("http://www.example.com/")
- self.assert_(not hh.req.has_header("Cookie"))
+ self.assertTrue(not hh.req.has_header("Cookie"))
+
+ def test_redirect_fragment(self):
+ redirected_url = 'http://www.example.com/index.html#OK\r\n\r\n'
+ hh = MockHTTPHandler(302, 'Location: ' + redirected_url)
+ hdeh = urllib2.HTTPDefaultErrorHandler()
+ hrh = urllib2.HTTPRedirectHandler()
+ o = build_test_opener(hh, hdeh, hrh)
+ fp = o.open('http://www.example.com')
+ self.assertEqual(fp.geturl(), redirected_url.strip())
def test_proxy(self):
o = OpenerDirector()
@@ -1037,16 +1074,16 @@ class HandlerTests(unittest.TestCase):
req.add_header("Proxy-Authorization","FooBar")
req.add_header("User-Agent","Grail")
self.assertEqual(req.get_host(), "www.example.com")
- self.assertTrue(req._tunnel_host is None)
+ self.assertIsNone(req._tunnel_host)
r = o.open(req)
# Verify Proxy-Authorization gets tunneled to request.
# httpsconn req_headers do not have the Proxy-Authorization header but
# the req will have.
- self.assertFalse(("Proxy-Authorization","FooBar") in
+ self.assertNotIn(("Proxy-Authorization","FooBar"),
https_handler.httpconn.req_headers)
- self.assertTrue(("User-Agent","Grail") in
- https_handler.httpconn.req_headers)
- self.assertFalse(req._tunnel_host is None)
+ self.assertIn(("User-Agent","Grail"),
+ https_handler.httpconn.req_headers)
+ self.assertIsNotNone(req._tunnel_host)
self.assertEqual(req.get_host(), "proxy.example.com:3128")
self.assertEqual(req.get_header("Proxy-authorization"),"FooBar")
@@ -1213,7 +1250,7 @@ class MiscTests(unittest.TestCase):
if h.__class__ == handler_class:
break
else:
- self.assert_(False)
+ self.assertTrue(False)
class RequestTests(unittest.TestCase):
@@ -1228,10 +1265,10 @@ class RequestTests(unittest.TestCase):
self.assertEqual("GET", self.get.get_method())
def test_add_data(self):
- self.assert_(not self.get.has_data())
+ self.assertTrue(not self.get.has_data())
self.assertEqual("GET", self.get.get_method())
self.get.add_data("spam")
- self.assert_(self.get.has_data())
+ self.assertTrue(self.get.has_data())
self.assertEqual("POST", self.get.get_method())
def test_get_full_url(self):
@@ -1254,12 +1291,26 @@ class RequestTests(unittest.TestCase):
self.assertEqual("www.python.org", req.get_host())
def test_proxy(self):
- self.assert_(not self.get.has_proxy())
+ self.assertTrue(not self.get.has_proxy())
self.get.set_proxy("www.perl.org", "http")
- self.assert_(self.get.has_proxy())
+ self.assertTrue(self.get.has_proxy())
self.assertEqual("www.python.org", self.get.get_origin_req_host())
self.assertEqual("www.perl.org", self.get.get_host())
+ def test_wrapped_url(self):
+ req = Request("<URL:http://www.python.org>")
+ self.assertEqual("www.python.org", req.get_host())
+
+ def test_url_fragment(self):
+ req = Request("http://www.python.org/?qs=query#fragment=true")
+ self.assertEqual("/?qs=query", req.get_selector())
+ req = Request("http://www.python.org/#fun=true")
+ self.assertEqual("/", req.get_selector())
+
+ # Issue 11703: geturl() omits fragment in the original URL.
+ url = 'http://docs.python.org/library/urllib2.html#OK'
+ req = Request(url)
+ self.assertEqual(req.get_full_url(), url)
def test_main(verbose=None):
from test import test_urllib2
diff --git a/Lib/test/test_urllib2_localnet.py b/Lib/test/test_urllib2_localnet.py
index 564343ab4f..0fda770901 100644
--- a/Lib/test/test_urllib2_localnet.py
+++ b/Lib/test/test_urllib2_localnet.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
-import threading
import urlparse
import urllib2
import BaseHTTPServer
@@ -8,6 +7,7 @@ import unittest
import hashlib
from test import test_support
mimetools = test_support.import_module('mimetools', deprecated=True)
+threading = test_support.import_module('threading')
# Loopback http server infrastructure
@@ -195,7 +195,11 @@ class FakeProxyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
testing.
"""
- digest_auth_handler = DigestAuthHandler()
+ def __init__(self, digest_auth_handler, *args, **kwargs):
+ # This has to be set before calling our parent's __init__(), which will
+ # try to call do_GET().
+ self.digest_auth_handler = digest_auth_handler
+ BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
def log_message(self, format, *args):
# Uncomment the next line for debugging.
@@ -216,7 +220,15 @@ class FakeProxyHandler(BaseHTTPServer.BaseHTTPRequestHandler):
# Test cases
-class ProxyAuthTests(unittest.TestCase):
+class BaseTestCase(unittest.TestCase):
+ def setUp(self):
+ self._threads = test_support.threading_setup()
+
+ def tearDown(self):
+ test_support.threading_cleanup(*self._threads)
+
+
+class ProxyAuthTests(BaseTestCase):
URL = "http://localhost"
USER = "tester"
@@ -224,49 +236,52 @@ class ProxyAuthTests(unittest.TestCase):
REALM = "TestRealm"
def setUp(self):
- FakeProxyHandler.digest_auth_handler.set_users({
- self.USER : self.PASSWD
- })
- FakeProxyHandler.digest_auth_handler.set_realm(self.REALM)
-
- self.server = LoopbackHttpServerThread(FakeProxyHandler)
+ super(ProxyAuthTests, self).setUp()
+ self.digest_auth_handler = DigestAuthHandler()
+ self.digest_auth_handler.set_users({self.USER: self.PASSWD})
+ self.digest_auth_handler.set_realm(self.REALM)
+ def create_fake_proxy_handler(*args, **kwargs):
+ return FakeProxyHandler(self.digest_auth_handler, *args, **kwargs)
+
+ self.server = LoopbackHttpServerThread(create_fake_proxy_handler)
self.server.start()
self.server.ready.wait()
proxy_url = "http://127.0.0.1:%d" % self.server.port
handler = urllib2.ProxyHandler({"http" : proxy_url})
- self._digest_auth_handler = urllib2.ProxyDigestAuthHandler()
- self.opener = urllib2.build_opener(handler, self._digest_auth_handler)
+ self.proxy_digest_handler = urllib2.ProxyDigestAuthHandler()
+ self.opener = urllib2.build_opener(handler, self.proxy_digest_handler)
def tearDown(self):
self.server.stop()
+ super(ProxyAuthTests, self).tearDown()
def test_proxy_with_bad_password_raises_httperror(self):
- self._digest_auth_handler.add_password(self.REALM, self.URL,
+ self.proxy_digest_handler.add_password(self.REALM, self.URL,
self.USER, self.PASSWD+"bad")
- FakeProxyHandler.digest_auth_handler.set_qop("auth")
+ self.digest_auth_handler.set_qop("auth")
self.assertRaises(urllib2.HTTPError,
self.opener.open,
self.URL)
def test_proxy_with_no_password_raises_httperror(self):
- FakeProxyHandler.digest_auth_handler.set_qop("auth")
+ self.digest_auth_handler.set_qop("auth")
self.assertRaises(urllib2.HTTPError,
self.opener.open,
self.URL)
def test_proxy_qop_auth_works(self):
- self._digest_auth_handler.add_password(self.REALM, self.URL,
+ self.proxy_digest_handler.add_password(self.REALM, self.URL,
self.USER, self.PASSWD)
- FakeProxyHandler.digest_auth_handler.set_qop("auth")
+ self.digest_auth_handler.set_qop("auth")
result = self.opener.open(self.URL)
while result.read():
pass
result.close()
def test_proxy_qop_auth_int_works_or_throws_urlerror(self):
- self._digest_auth_handler.add_password(self.REALM, self.URL,
+ self.proxy_digest_handler.add_password(self.REALM, self.URL,
self.USER, self.PASSWD)
- FakeProxyHandler.digest_auth_handler.set_qop("auth-int")
+ self.digest_auth_handler.set_qop("auth-int")
try:
result = self.opener.open(self.URL)
except urllib2.URLError:
@@ -322,7 +337,7 @@ def GetRequestHandler(responses):
return FakeHTTPRequestHandler
-class TestUrlopen(unittest.TestCase):
+class TestUrlopen(BaseTestCase):
"""Tests urllib2.urlopen using the network.
These tests are not exhaustive. Assuming that testing using files does a
@@ -356,8 +371,8 @@ class TestUrlopen(unittest.TestCase):
data = f.read()
f.close()
- self.assertEquals(data, expected_response)
- self.assertEquals(handler.requests, ['/', '/somewhere_else'])
+ self.assertEqual(data, expected_response)
+ self.assertEqual(handler.requests, ['/', '/somewhere_else'])
finally:
self.server.stop()
@@ -377,8 +392,8 @@ class TestUrlopen(unittest.TestCase):
data = f.read()
f.close()
- self.assertEquals(data, expected_response)
- self.assertEquals(handler.requests, ['/weeble'])
+ self.assertEqual(data, expected_response)
+ self.assertEqual(handler.requests, ['/weeble'])
finally:
self.server.stop()
@@ -392,8 +407,8 @@ class TestUrlopen(unittest.TestCase):
data = f.read()
f.close()
- self.assertEquals(data, expected_response)
- self.assertEquals(handler.requests, ['/bizarre'])
+ self.assertEqual(data, expected_response)
+ self.assertEqual(handler.requests, ['/bizarre'])
finally:
self.server.stop()
@@ -406,8 +421,8 @@ class TestUrlopen(unittest.TestCase):
data = f.read()
f.close()
- self.assertEquals(data, expected_response)
- self.assertEquals(handler.requests, ['/bizarre', 'get=with_feeling'])
+ self.assertEqual(data, expected_response)
+ self.assertEqual(handler.requests, ['/bizarre', 'get=with_feeling'])
finally:
self.server.stop()
@@ -429,10 +444,10 @@ class TestUrlopen(unittest.TestCase):
try:
open_url = urllib2.urlopen("http://localhost:%s" % handler.port)
for attr in ("read", "close", "info", "geturl"):
- self.assert_(hasattr(open_url, attr), "object returned from "
+ self.assertTrue(hasattr(open_url, attr), "object returned from "
"urlopen lacks the %s attribute" % attr)
try:
- self.assert_(open_url.read(), "calling 'read' failed")
+ self.assertTrue(open_url.read(), "calling 'read' failed")
finally:
open_url.close()
finally:
@@ -444,9 +459,9 @@ class TestUrlopen(unittest.TestCase):
try:
open_url = urllib2.urlopen("http://localhost:%s" % handler.port)
info_obj = open_url.info()
- self.assert_(isinstance(info_obj, mimetools.Message),
- "object returned by 'info' is not an instance of "
- "mimetools.Message")
+ self.assertIsInstance(info_obj, mimetools.Message,
+ "object returned by 'info' is not an "
+ "instance of mimetools.Message")
self.assertEqual(info_obj.getsubtype(), "plain")
finally:
self.server.stop()
@@ -486,6 +501,30 @@ class TestUrlopen(unittest.TestCase):
# parameterize the framework with a mock resolver.
urllib2.urlopen, "http://sadflkjsasf.i.nvali.d./")
+ def test_iteration(self):
+ expected_response = "pycon 2008..."
+ handler = self.start_server([(200, [], expected_response)])
+ try:
+ data = urllib2.urlopen("http://localhost:%s" % handler.port)
+ for line in data:
+ self.assertEqual(line, expected_response)
+ finally:
+ self.server.stop()
+
+ def ztest_line_iteration(self):
+ lines = ["We\n", "got\n", "here\n", "verylong " * 8192 + "\n"]
+ expected_response = "".join(lines)
+ handler = self.start_server([(200, [], expected_response)])
+ try:
+ data = urllib2.urlopen("http://localhost:%s" % handler.port)
+ for index, line in enumerate(data):
+ self.assertEqual(line, lines[index],
+ "Fetched line number %s doesn't match expected:\n"
+ " Expected length was %s, got %s" %
+ (index, len(lines[index]), len(line)))
+ finally:
+ self.server.stop()
+ self.assertEqual(index + 1, len(lines))
def test_main():
# We will NOT depend on the network resource flag
@@ -494,8 +533,7 @@ def test_main():
# the next line.
#test_support.requires("network")
- test_support.run_unittest(ProxyAuthTests)
- test_support.run_unittest(TestUrlopen)
+ test_support.run_unittest(ProxyAuthTests, TestUrlopen)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_urllib2net.py b/Lib/test/test_urllib2net.py
index 162b816487..867fcfa41e 100644
--- a/Lib/test/test_urllib2net.py
+++ b/Lib/test/test_urllib2net.py
@@ -6,7 +6,6 @@ from test.test_urllib2 import sanepathname2url
import socket
import urllib2
-import sys
import os
import sys
@@ -75,7 +74,7 @@ class AuthTests(unittest.TestCase):
class CloseSocketTest(unittest.TestCase):
def test_close(self):
- import socket, httplib, gc
+ import httplib
# calling .close() on urllib2's response objects should close the
# underlying socket
@@ -83,15 +82,15 @@ class CloseSocketTest(unittest.TestCase):
# delve deep into response to fetch socket._socketobject
response = _urlopen_with_retry("http://www.python.org/")
abused_fileobject = response.fp
- self.assert_(abused_fileobject.__class__ is socket._fileobject)
+ self.assertTrue(abused_fileobject.__class__ is socket._fileobject)
httpresponse = abused_fileobject._sock
- self.assert_(httpresponse.__class__ is httplib.HTTPResponse)
+ self.assertTrue(httpresponse.__class__ is httplib.HTTPResponse)
fileobject = httpresponse.fp
- self.assert_(fileobject.__class__ is socket._fileobject)
+ self.assertTrue(fileobject.__class__ is socket._fileobject)
- self.assert_(not fileobject.closed)
+ self.assertTrue(not fileobject.closed)
response.close()
- self.assert_(fileobject.closed)
+ self.assertTrue(fileobject.closed)
class OtherNetworkTests(unittest.TestCase):
def setUp(self):
@@ -155,8 +154,39 @@ class OtherNetworkTests(unittest.TestCase):
## self._test_urls(urls, self._extra_handlers()+[bauth, dauth])
+ def test_urlwithfrag(self):
+ urlwith_frag = "http://docs.python.org/glossary.html#glossary"
+ with test_support.transient_internet(urlwith_frag):
+ req = urllib2.Request(urlwith_frag)
+ res = urllib2.urlopen(req)
+ self.assertEqual(res.geturl(),
+ "http://docs.python.org/glossary.html#glossary")
+
+ def test_fileno(self):
+ req = urllib2.Request("http://www.python.org")
+ opener = urllib2.build_opener()
+ res = opener.open(req)
+ try:
+ res.fileno()
+ except AttributeError:
+ self.fail("HTTPResponse object should return a valid fileno")
+ finally:
+ res.close()
+
+ def test_custom_headers(self):
+ url = "http://www.example.com"
+ with test_support.transient_internet(url):
+ opener = urllib2.build_opener()
+ request = urllib2.Request(url)
+ self.assertFalse(request.header_items())
+ opener.open(request)
+ self.assertTrue(request.header_items())
+ self.assertTrue(request.has_header('User-agent'))
+ request.add_header('User-Agent','Test-Agent')
+ opener.open(request)
+ self.assertEqual(request.get_header('User-agent'),'Test-Agent')
+
def _test_urls(self, urls, handlers, retry=True):
- import socket
import time
import logging
debug = logging.getLogger("test_urllib2").debug
@@ -170,29 +200,30 @@ class OtherNetworkTests(unittest.TestCase):
url, req, expected_err = url
else:
req = expected_err = None
- debug(url)
- try:
- f = urlopen(url, req, TIMEOUT)
- except EnvironmentError, err:
- debug(err)
- if expected_err:
- msg = ("Didn't get expected error(s) %s for %s %s, got %s: %s" %
- (expected_err, url, req, type(err), err))
- self.assert_(isinstance(err, expected_err), msg)
- except urllib2.URLError as err:
- if isinstance(err[0], socket.timeout):
- print >>sys.stderr, "<timeout: %s>" % url
- continue
- else:
- raise
- else:
+ with test_support.transient_internet(url):
+ debug(url)
try:
- with test_support.transient_internet():
- buf = f.read()
- debug("read %d bytes" % len(buf))
- except socket.timeout:
- print >>sys.stderr, "<timeout: %s>" % url
- f.close()
+ f = urlopen(url, req, TIMEOUT)
+ except EnvironmentError as err:
+ debug(err)
+ if expected_err:
+ msg = ("Didn't get expected error(s) %s for %s %s, got %s: %s" %
+ (expected_err, url, req, type(err), err))
+ self.assertIsInstance(err, expected_err, msg)
+ except urllib2.URLError as err:
+ if isinstance(err[0], socket.timeout):
+ print >>sys.stderr, "<timeout: %s>" % url
+ continue
+ else:
+ raise
+ else:
+ try:
+ with test_support.transient_internet(url):
+ buf = f.read()
+ debug("read %d bytes" % len(buf))
+ except socket.timeout:
+ print >>sys.stderr, "<timeout: %s>" % url
+ f.close()
debug("******** next url coming up...")
time.sleep(0.1)
@@ -209,59 +240,71 @@ class OtherNetworkTests(unittest.TestCase):
class TimeoutTest(unittest.TestCase):
def test_http_basic(self):
self.assertTrue(socket.getdefaulttimeout() is None)
- u = _urlopen_with_retry("http://www.python.org")
- self.assertTrue(u.fp._sock.fp._sock.gettimeout() is None)
+ url = "http://www.python.org"
+ with test_support.transient_internet(url, timeout=None):
+ u = _urlopen_with_retry(url)
+ self.assertTrue(u.fp._sock.fp._sock.gettimeout() is None)
def test_http_default_timeout(self):
self.assertTrue(socket.getdefaulttimeout() is None)
- socket.setdefaulttimeout(60)
- try:
- u = _urlopen_with_retry("http://www.python.org")
- finally:
- socket.setdefaulttimeout(None)
- self.assertEqual(u.fp._sock.fp._sock.gettimeout(), 60)
+ url = "http://www.python.org"
+ with test_support.transient_internet(url):
+ socket.setdefaulttimeout(60)
+ try:
+ u = _urlopen_with_retry(url)
+ finally:
+ socket.setdefaulttimeout(None)
+ self.assertEqual(u.fp._sock.fp._sock.gettimeout(), 60)
def test_http_no_timeout(self):
self.assertTrue(socket.getdefaulttimeout() is None)
- socket.setdefaulttimeout(60)
- try:
- u = _urlopen_with_retry("http://www.python.org", timeout=None)
- finally:
- socket.setdefaulttimeout(None)
- self.assertTrue(u.fp._sock.fp._sock.gettimeout() is None)
+ url = "http://www.python.org"
+ with test_support.transient_internet(url):
+ socket.setdefaulttimeout(60)
+ try:
+ u = _urlopen_with_retry(url, timeout=None)
+ finally:
+ socket.setdefaulttimeout(None)
+ self.assertTrue(u.fp._sock.fp._sock.gettimeout() is None)
def test_http_timeout(self):
- u = _urlopen_with_retry("http://www.python.org", timeout=120)
- self.assertEqual(u.fp._sock.fp._sock.gettimeout(), 120)
+ url = "http://www.python.org"
+ with test_support.transient_internet(url):
+ u = _urlopen_with_retry(url, timeout=120)
+ self.assertEqual(u.fp._sock.fp._sock.gettimeout(), 120)
- FTP_HOST = "ftp://ftp.mirror.nl/pub/mirror/gnu/"
+ FTP_HOST = "ftp://ftp.mirror.nl/pub/gnu/"
def test_ftp_basic(self):
self.assertTrue(socket.getdefaulttimeout() is None)
- u = _urlopen_with_retry(self.FTP_HOST)
- self.assertTrue(u.fp.fp._sock.gettimeout() is None)
+ with test_support.transient_internet(self.FTP_HOST, timeout=None):
+ u = _urlopen_with_retry(self.FTP_HOST)
+ self.assertTrue(u.fp.fp._sock.gettimeout() is None)
def test_ftp_default_timeout(self):
self.assertTrue(socket.getdefaulttimeout() is None)
- socket.setdefaulttimeout(60)
- try:
- u = _urlopen_with_retry(self.FTP_HOST)
- finally:
- socket.setdefaulttimeout(None)
- self.assertEqual(u.fp.fp._sock.gettimeout(), 60)
+ with test_support.transient_internet(self.FTP_HOST):
+ socket.setdefaulttimeout(60)
+ try:
+ u = _urlopen_with_retry(self.FTP_HOST)
+ finally:
+ socket.setdefaulttimeout(None)
+ self.assertEqual(u.fp.fp._sock.gettimeout(), 60)
def test_ftp_no_timeout(self):
self.assertTrue(socket.getdefaulttimeout() is None)
- socket.setdefaulttimeout(60)
- try:
- u = _urlopen_with_retry(self.FTP_HOST, timeout=None)
- finally:
- socket.setdefaulttimeout(None)
- self.assertTrue(u.fp.fp._sock.gettimeout() is None)
+ with test_support.transient_internet(self.FTP_HOST):
+ socket.setdefaulttimeout(60)
+ try:
+ u = _urlopen_with_retry(self.FTP_HOST, timeout=None)
+ finally:
+ socket.setdefaulttimeout(None)
+ self.assertTrue(u.fp.fp._sock.gettimeout() is None)
def test_ftp_timeout(self):
- u = _urlopen_with_retry(self.FTP_HOST, timeout=60)
- self.assertEqual(u.fp.fp._sock.gettimeout(), 60)
+ with test_support.transient_internet(self.FTP_HOST):
+ u = _urlopen_with_retry(self.FTP_HOST, timeout=60)
+ self.assertEqual(u.fp.fp._sock.gettimeout(), 60)
def test_main():
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py
index 1e9cf0d786..8cba2dc779 100644
--- a/Lib/test/test_urllibnet.py
+++ b/Lib/test/test_urllibnet.py
@@ -7,9 +7,10 @@ import socket
import urllib
import sys
import os
-mimetools = test_support.import_module("mimetools", deprecated=True)
import time
+mimetools = test_support.import_module("mimetools", deprecated=True)
+
def _open_with_retry(func, host, *args, **kwargs):
# Connecting to remote hosts is flaky. Make it more robust
@@ -61,10 +62,10 @@ class urlopenNetworkTests(unittest.TestCase):
open_url = self.urlopen("http://www.python.org/")
for attr in ("read", "readline", "readlines", "fileno", "close",
"info", "geturl"):
- self.assert_(hasattr(open_url, attr), "object returned from "
+ self.assertTrue(hasattr(open_url, attr), "object returned from "
"urlopen lacks the %s attribute" % attr)
try:
- self.assert_(open_url.read(), "calling 'read' failed")
+ self.assertTrue(open_url.read(), "calling 'read' failed")
finally:
open_url.close()
@@ -72,10 +73,10 @@ class urlopenNetworkTests(unittest.TestCase):
# Test both readline and readlines.
open_url = self.urlopen("http://www.python.org/")
try:
- self.assert_(isinstance(open_url.readline(), basestring),
- "readline did not return a string")
- self.assert_(isinstance(open_url.readlines(), list),
- "readlines did not return a list")
+ self.assertIsInstance(open_url.readline(), basestring,
+ "readline did not return a string")
+ self.assertIsInstance(open_url.readlines(), list,
+ "readlines did not return a list")
finally:
open_url.close()
@@ -86,9 +87,9 @@ class urlopenNetworkTests(unittest.TestCase):
info_obj = open_url.info()
finally:
open_url.close()
- self.assert_(isinstance(info_obj, mimetools.Message),
- "object returned by 'info' is not an instance of "
- "mimetools.Message")
+ self.assertIsInstance(info_obj, mimetools.Message,
+ "object returned by 'info' is not an "
+ "instance of mimetools.Message")
self.assertEqual(info_obj.getsubtype(), "html")
def test_geturl(self):
@@ -122,7 +123,7 @@ class urlopenNetworkTests(unittest.TestCase):
fd = open_url.fileno()
FILE = os.fdopen(fd)
try:
- self.assert_(FILE.read(), "reading from file created using fd "
+ self.assertTrue(FILE.read(), "reading from file created using fd "
"returned by fileno failed")
finally:
FILE.close()
@@ -149,11 +150,11 @@ class urlretrieveNetworkTests(unittest.TestCase):
def test_basic(self):
# Test basic functionality.
file_location,info = self.urlretrieve("http://www.python.org/")
- self.assert_(os.path.exists(file_location), "file location returned by"
+ self.assertTrue(os.path.exists(file_location), "file location returned by"
" urlretrieve is not a valid path")
FILE = file(file_location)
try:
- self.assert_(FILE.read(), "reading from the file location returned"
+ self.assertTrue(FILE.read(), "reading from the file location returned"
" by urlretrieve failed")
finally:
FILE.close()
@@ -164,10 +165,10 @@ class urlretrieveNetworkTests(unittest.TestCase):
file_location,info = self.urlretrieve("http://www.python.org/",
test_support.TESTFN)
self.assertEqual(file_location, test_support.TESTFN)
- self.assert_(os.path.exists(file_location))
+ self.assertTrue(os.path.exists(file_location))
FILE = file(file_location)
try:
- self.assert_(FILE.read(), "reading from temporary file failed")
+ self.assertTrue(FILE.read(), "reading from temporary file failed")
finally:
FILE.close()
os.unlink(file_location)
@@ -176,8 +177,8 @@ class urlretrieveNetworkTests(unittest.TestCase):
# Make sure header returned as 2nd value from urlretrieve is good.
file_location, header = self.urlretrieve("http://www.python.org/")
os.unlink(file_location)
- self.assert_(isinstance(header, mimetools.Message),
- "header is not an instance of mimetools.Message")
+ self.assertIsInstance(header, mimetools.Message,
+ "header is not an instance of mimetools.Message")
def test_data_header(self):
logo = "http://www.python.org/community/logos/python-logo-master-v3-TM.png"
@@ -191,9 +192,10 @@ class urlretrieveNetworkTests(unittest.TestCase):
self.fail('Date value not in %r format', dateformat)
+
def test_main():
test_support.requires('network')
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
("urllib.urlopen.. has been removed", DeprecationWarning)):
test_support.run_unittest(URLTimeoutTest,
urlopenNetworkTests,
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index c437ee0d14..996148592f 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -97,6 +97,9 @@ class UrlParseTestCase(unittest.TestCase):
'', '', ''),
('mms', 'wms.sys.hinet.net', '/cts/Drama/09006251100.asf',
'', '')),
+ ('nfs://server/path/to/file.txt',
+ ('nfs', 'server', '/path/to/file.txt', '', '', ''),
+ ('nfs', 'server', '/path/to/file.txt', '', '')),
('svn+ssh://svn.zope.org/repos/main/ZConfig/trunk/',
('svn+ssh', 'svn.zope.org', '/repos/main/ZConfig/trunk/',
'', '', ''),
@@ -193,10 +196,13 @@ class UrlParseTestCase(unittest.TestCase):
#self.checkJoin(RFC1808_BASE, 'http:g', 'http:g')
#self.checkJoin(RFC1808_BASE, 'http:', 'http:')
+ def test_RFC2368(self):
+ # Issue 11467: path that starts with a number is not parsed correctly
+ self.assertEqual(urlparse.urlparse('mailto:1337@example.org'),
+ ('mailto', '', '1337@example.org', '', '', ''))
+
def test_RFC2396(self):
# cases from RFC 2396
-
-
self.checkJoin(RFC2396_BASE, 'g:h', 'g:h')
self.checkJoin(RFC2396_BASE, 'g', 'http://a/b/c/g')
self.checkJoin(RFC2396_BASE, './g', 'http://a/b/c/g')
@@ -290,7 +296,10 @@ class UrlParseTestCase(unittest.TestCase):
self.checkJoin(RFC3986_BASE, 'g#s/./x','http://a/b/c/g#s/./x')
self.checkJoin(RFC3986_BASE, 'g#s/../x','http://a/b/c/g#s/../x')
#self.checkJoin(RFC3986_BASE, 'http:g','http:g') # strict parser
- self.checkJoin(RFC3986_BASE, 'http:g','http://a/b/c/g') #relaxed parser
+ self.checkJoin(RFC3986_BASE, 'http:g','http://a/b/c/g') # relaxed parser
+
+ # Test for issue9721
+ self.checkJoin('http://a/b/c/de', ';x','http://a/b/c/;x')
def test_urljoins(self):
self.checkJoin(SIMPLE_BASE, 'g:h','g:h')
@@ -323,6 +332,40 @@ class UrlParseTestCase(unittest.TestCase):
self.checkJoin(SIMPLE_BASE, 'http:g?y','http://a/b/c/g?y')
self.checkJoin(SIMPLE_BASE, 'http:g?y/./x','http://a/b/c/g?y/./x')
+ def test_RFC2732(self):
+ for url, hostname, port in [
+ ('http://Test.python.org:5432/foo/', 'test.python.org', 5432),
+ ('http://12.34.56.78:5432/foo/', '12.34.56.78', 5432),
+ ('http://[::1]:5432/foo/', '::1', 5432),
+ ('http://[dead:beef::1]:5432/foo/', 'dead:beef::1', 5432),
+ ('http://[dead:beef::]:5432/foo/', 'dead:beef::', 5432),
+ ('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]:5432/foo/',
+ 'dead:beef:cafe:5417:affe:8fa3:deaf:feed', 5432),
+ ('http://[::12.34.56.78]:5432/foo/', '::12.34.56.78', 5432),
+ ('http://[::ffff:12.34.56.78]:5432/foo/',
+ '::ffff:12.34.56.78', 5432),
+ ('http://Test.python.org/foo/', 'test.python.org', None),
+ ('http://12.34.56.78/foo/', '12.34.56.78', None),
+ ('http://[::1]/foo/', '::1', None),
+ ('http://[dead:beef::1]/foo/', 'dead:beef::1', None),
+ ('http://[dead:beef::]/foo/', 'dead:beef::', None),
+ ('http://[dead:beef:cafe:5417:affe:8FA3:deaf:feed]/foo/',
+ 'dead:beef:cafe:5417:affe:8fa3:deaf:feed', None),
+ ('http://[::12.34.56.78]/foo/', '::12.34.56.78', None),
+ ('http://[::ffff:12.34.56.78]/foo/',
+ '::ffff:12.34.56.78', None),
+ ]:
+ urlparsed = urlparse.urlparse(url)
+ self.assertEqual((urlparsed.hostname, urlparsed.port) , (hostname, port))
+
+ for invalid_url in [
+ 'http://::12.34.56.78]/',
+ 'http://[::1/foo/',
+ 'ftp://[::1/foo/bad]/bad',
+ 'http://[::1/foo/bad]/bad',
+ 'http://[::ffff:12.34.56.78']:
+ self.assertRaises(ValueError, urlparse.urlparse, invalid_url)
+
def test_urldefrag(self):
for url, defrag, frag in [
('http://python.org#frag', 'http://python.org', 'frag'),
@@ -441,6 +484,26 @@ class UrlParseTestCase(unittest.TestCase):
self.assertEqual(urlparse.urlparse("x-newscheme://foo.com/stuff"),
('x-newscheme','foo.com','/stuff','','',''))
+ def test_withoutscheme(self):
+ # Test urlparse without scheme
+ # Issue 754016: urlparse goes wrong with IP:port without scheme
+ # RFC 1808 specifies that netloc should start with //, urlparse expects
+ # the same, otherwise it classifies the portion of url as path.
+ self.assertEqual(urlparse.urlparse("path"),
+ ('','','path','','',''))
+ self.assertEqual(urlparse.urlparse("//www.python.org:80"),
+ ('','www.python.org:80','','','',''))
+ self.assertEqual(urlparse.urlparse("http://www.python.org:80"),
+ ('http','www.python.org:80','','','',''))
+
+ def test_portseparator(self):
+ # Issue 754016 makes changes for port separator ':' from scheme separator
+ self.assertEqual(urlparse.urlparse("path:80"),
+ ('','','path:80','','',''))
+ self.assertEqual(urlparse.urlparse("http:"),('http','','','','',''))
+ self.assertEqual(urlparse.urlparse("https:"),('https','','','','',''))
+ self.assertEqual(urlparse.urlparse("http://www.python.org:80"),
+ ('http','www.python.org:80','','','',''))
def test_main():
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
index df9588cc2e..d5cecd8612 100644
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -38,9 +38,9 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
self.assertEqual(UserDict.UserDict().fromkeys('one two'.split()), d4)
self.assertEqual(UserDict.UserDict.fromkeys('one two'.split(), 1), d5)
self.assertEqual(UserDict.UserDict().fromkeys('one two'.split(), 1), d5)
- self.assert_(u1.fromkeys('one two'.split()) is not u1)
- self.assert_(isinstance(u1.fromkeys('one two'.split()), UserDict.UserDict))
- self.assert_(isinstance(u2.fromkeys('one two'.split()), UserDict.IterableUserDict))
+ self.assertTrue(u1.fromkeys('one two'.split()) is not u1)
+ self.assertIsInstance(u1.fromkeys('one two'.split()), UserDict.UserDict)
+ self.assertIsInstance(u2.fromkeys('one two'.split()), UserDict.IterableUserDict)
# Test __repr__
self.assertEqual(str(u0), str(d0))
@@ -95,10 +95,10 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
# Test has_key and "in".
for i in u2.keys():
- self.assertTrue(i in u2)
+ self.assertIn(i, u2)
self.assertEqual(i in u1, i in d1)
self.assertEqual(i in u0, i in d0)
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
self.assertTrue(u2.has_key(i))
self.assertEqual(u1.has_key(i), d1.has_key(i))
self.assertEqual(u0.has_key(i), d0.has_key(i))
@@ -132,7 +132,7 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
# Test setdefault
t = UserDict.UserDict()
self.assertEqual(t.setdefault("x", 42), 42)
- self.assert_(t.has_key("x"))
+ self.assertTrue(t.has_key("x"))
self.assertEqual(t.setdefault("x", 23), 42)
# Test pop
@@ -162,8 +162,8 @@ class UserDictTest(mapping_tests.TestHashMappingProtocol):
d = D({1: 2, 3: 4})
self.assertEqual(d[1], 2)
self.assertEqual(d[3], 4)
- self.assert_(2 not in d)
- self.assert_(2 not in d.keys())
+ self.assertNotIn(2, d)
+ self.assertNotIn(2, d.keys())
self.assertEqual(d[2], 42)
class E(UserDict.UserDict):
def __missing__(self, key):
@@ -270,12 +270,12 @@ class UserDictMixinTest(mapping_tests.TestMappingProtocol):
## Now, test the DictMixin methods one by one
# has_key
- self.assert_(s.has_key(10))
- self.assert_(not s.has_key(20))
+ self.assertTrue(s.has_key(10))
+ self.assertTrue(not s.has_key(20))
# __contains__
- self.assert_(10 in s)
- self.assert_(20 not in s)
+ self.assertIn(10, s)
+ self.assertNotIn(20, s)
# __iter__
self.assertEqual([k for k in s], [10, 30])
@@ -310,7 +310,7 @@ class UserDictMixinTest(mapping_tests.TestMappingProtocol):
# pop
self.assertEqual(s.pop(10), 'ten')
- self.assert_(10 not in s)
+ self.assertNotIn(10, s)
s[10] = 'ten'
self.assertEqual(s.pop("x", 1), 1)
s["x"] = 42
@@ -318,7 +318,7 @@ class UserDictMixinTest(mapping_tests.TestMappingProtocol):
# popitem
k, v = s.popitem()
- self.assert_(k not in s)
+ self.assertNotIn(k, s)
s[k] = v
# clear
diff --git a/Lib/test/test_userlist.py b/Lib/test/test_userlist.py
index ffe4aa17e0..3b601bc955 100644
--- a/Lib/test/test_userlist.py
+++ b/Lib/test/test_userlist.py
@@ -53,7 +53,7 @@ class UserListTest(list_tests.CommonTest):
self.assertEqual(iter(T((1,2))).next(), "0!!!")
def test_main():
- with test_support._check_py3k_warnings(
+ with test_support.check_py3k_warnings(
(".+__(get|set|del)slice__ has been removed", DeprecationWarning)):
test_support.run_unittest(UserListTest)
diff --git a/Lib/test/test_userstring.py b/Lib/test/test_userstring.py
index ee7a1f4853..2625985a7c 100755
--- a/Lib/test/test_userstring.py
+++ b/Lib/test/test_userstring.py
@@ -104,17 +104,17 @@ class MutableStringTest(UserStringTest):
data.reverse()
L[start:stop:step] = data
s[start:stop:step] = "".join(data)
- self.assertEquals(s, "".join(L))
+ self.assertEqual(s, "".join(L))
del L[start:stop:step]
del s[start:stop:step]
- self.assertEquals(s, "".join(L))
+ self.assertEqual(s, "".join(L))
def test_immutable(self):
s = self.type2test("foobar")
s2 = s.immutable()
self.assertEqual(s, s2)
- self.assert_(isinstance(s2, UserString))
+ self.assertIsInstance(s2, UserString)
def test_iadd(self):
s = self.type2test("foo")
diff --git a/Lib/test/test_uu.py b/Lib/test/test_uu.py
index 25d9b608b2..95c9552cbe 100644
--- a/Lib/test/test_uu.py
+++ b/Lib/test/test_uu.py
@@ -161,6 +161,23 @@ class UUFileTest(unittest.TestCase):
finally:
self._kill(f)
+ def test_decode_filename(self):
+ f = None
+ try:
+ test_support.unlink(self.tmpin)
+ f = open(self.tmpin, 'w')
+ f.write(encodedtextwrapped % (0644, self.tmpout))
+ f.close()
+
+ uu.decode(self.tmpin)
+
+ f = open(self.tmpout, 'r')
+ s = f.read()
+ f.close()
+ self.assertEqual(s, plaintext)
+ finally:
+ self._kill(f)
+
def test_decodetwice(self):
# Verify that decode() will refuse to overwrite an existing file
f = None
diff --git a/Lib/test/test_wait3.py b/Lib/test/test_wait3.py
index 9de64b21ea..150783b655 100644
--- a/Lib/test/test_wait3.py
+++ b/Lib/test/test_wait3.py
@@ -3,18 +3,19 @@
import os
import time
+import unittest
from test.fork_wait import ForkWait
-from test.test_support import TestSkipped, run_unittest, reap_children
+from test.test_support import run_unittest, reap_children
try:
os.fork
except AttributeError:
- raise TestSkipped, "os.fork not defined -- skipping test_wait3"
+ raise unittest.SkipTest, "os.fork not defined -- skipping test_wait3"
try:
os.wait3
except AttributeError:
- raise TestSkipped, "os.wait3 not defined -- skipping test_wait3"
+ raise unittest.SkipTest, "os.wait3 not defined -- skipping test_wait3"
class Wait3Test(ForkWait):
def wait_impl(self, cpid):
diff --git a/Lib/test/test_wait4.py b/Lib/test/test_wait4.py
index 9f7fc14a64..d04a11bde1 100644
--- a/Lib/test/test_wait4.py
+++ b/Lib/test/test_wait4.py
@@ -4,17 +4,12 @@
import os
import time
from test.fork_wait import ForkWait
-from test.test_support import TestSkipped, run_unittest, reap_children
+from test.test_support import run_unittest, reap_children, get_attribute
-try:
- os.fork
-except AttributeError:
- raise TestSkipped, "os.fork not defined -- skipping test_wait4"
+# If either of these do not exist, skip this test.
+get_attribute(os, 'fork')
+get_attribute(os, 'wait4')
-try:
- os.wait4
-except AttributeError:
- raise TestSkipped, "os.wait4 not defined -- skipping test_wait4"
class Wait4Test(ForkWait):
def wait_impl(self, cpid):
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py
index f55502a3a4..5c4fa59861 100644
--- a/Lib/test/test_warnings.py
+++ b/Lib/test/test_warnings.py
@@ -4,24 +4,16 @@ import os
import StringIO
import sys
import unittest
+import subprocess
from test import test_support
+from test.script_helper import assert_python_ok
import warning_tests
import warnings as original_warnings
-sys.modules['_warnings'] = 0
-del sys.modules['warnings']
-
-import warnings as py_warnings
-
-del sys.modules['_warnings']
-del sys.modules['warnings']
-
-import warnings as c_warnings
-
-sys.modules['warnings'] = original_warnings
-
+py_warnings = test_support.import_fresh_module('warnings', blocked=['_warnings'])
+c_warnings = test_support.import_fresh_module('warnings', fresh=['_warnings'])
@contextmanager
def warnings_state(module):
@@ -88,7 +80,7 @@ class FilterTests(object):
self.module.resetwarnings()
self.module.filterwarnings("ignore", category=UserWarning)
self.module.warn("FilterTests.test_ignore", UserWarning)
- self.assertEquals(len(w), 0)
+ self.assertEqual(len(w), 0)
def test_always(self):
with original_warnings.catch_warnings(record=True,
@@ -97,9 +89,9 @@ class FilterTests(object):
self.module.filterwarnings("always", category=UserWarning)
message = "FilterTests.test_always"
self.module.warn(message, UserWarning)
- self.assert_(message, w[-1].message)
+ self.assertTrue(message, w[-1].message)
self.module.warn(message, UserWarning)
- self.assert_(w[-1].message, message)
+ self.assertTrue(w[-1].message, message)
def test_default(self):
with original_warnings.catch_warnings(record=True,
@@ -110,10 +102,10 @@ class FilterTests(object):
for x in xrange(2):
self.module.warn(message, UserWarning)
if x == 0:
- self.assertEquals(w[-1].message, message)
+ self.assertEqual(w[-1].message, message)
del w[:]
elif x == 1:
- self.assertEquals(len(w), 0)
+ self.assertEqual(len(w), 0)
else:
raise ValueError("loop variant unhandled")
@@ -124,10 +116,10 @@ class FilterTests(object):
self.module.filterwarnings("module", category=UserWarning)
message = UserWarning("FilterTests.test_module")
self.module.warn(message, UserWarning)
- self.assertEquals(w[-1].message, message)
+ self.assertEqual(w[-1].message, message)
del w[:]
self.module.warn(message, UserWarning)
- self.assertEquals(len(w), 0)
+ self.assertEqual(len(w), 0)
def test_once(self):
with original_warnings.catch_warnings(record=True,
@@ -137,14 +129,14 @@ class FilterTests(object):
message = UserWarning("FilterTests.test_once")
self.module.warn_explicit(message, UserWarning, "test_warnings.py",
42)
- self.assertEquals(w[-1].message, message)
+ self.assertEqual(w[-1].message, message)
del w[:]
self.module.warn_explicit(message, UserWarning, "test_warnings.py",
13)
- self.assertEquals(len(w), 0)
+ self.assertEqual(len(w), 0)
self.module.warn_explicit(message, UserWarning, "test_warnings2.py",
42)
- self.assertEquals(len(w), 0)
+ self.assertEqual(len(w), 0)
def test_inheritance(self):
with original_warnings.catch_warnings(module=self.module) as w:
@@ -165,7 +157,7 @@ class FilterTests(object):
self.module.warn("FilterTests.test_ordering", UserWarning)
except UserWarning:
self.fail("order handling for actions failed")
- self.assertEquals(len(w), 0)
+ self.assertEqual(len(w), 0)
def test_filterwarnings(self):
# Test filterwarnings().
@@ -179,7 +171,7 @@ class FilterTests(object):
text = 'handle normally'
self.module.warn(text)
self.assertEqual(str(w[-1].message), text)
- self.assert_(w[-1].category is UserWarning)
+ self.assertTrue(w[-1].category is UserWarning)
self.module.filterwarnings("ignore", "", Warning, "", 0)
text = 'filtered out'
@@ -192,7 +184,7 @@ class FilterTests(object):
text = 'nonmatching text'
self.module.warn(text)
self.assertEqual(str(w[-1].message), text)
- self.assert_(w[-1].category is UserWarning)
+ self.assertTrue(w[-1].category is UserWarning)
class CFilterTests(BaseTest, FilterTests):
module = c_warnings
@@ -213,7 +205,7 @@ class WarnTests(unittest.TestCase):
text = 'multi %d' %i # Different text on each call.
self.module.warn(text)
self.assertEqual(str(w[-1].message), text)
- self.assert_(w[-1].category is UserWarning)
+ self.assertTrue(w[-1].category is UserWarning)
def test_filename(self):
with warnings_state(self.module):
@@ -328,7 +320,7 @@ class WarnTests(unittest.TestCase):
sys.argv = argv
def test_warn_explicit_type_errors(self):
- # warn_explicit() shoud error out gracefully if it is given objects
+ # warn_explicit() should error out gracefully if it is given objects
# of the wrong types.
# lineno is expected to be an integer.
self.assertRaises(TypeError, self.module.warn_explicit,
@@ -352,15 +344,28 @@ class WarnTests(unittest.TestCase):
return ("A bad formatted string %(err)" %
{"err" : "there is no %(err)s"})
- self.assertRaises(ValueError, self.module.warn, BadStrWarning())
+ with self.assertRaises(ValueError):
+ self.module.warn(BadStrWarning())
class CWarnTests(BaseTest, WarnTests):
module = c_warnings
+ # As an early adopter, we sanity check the
+ # test_support.import_fresh_module utility function
+ def test_accelerated(self):
+ self.assertFalse(original_warnings is self.module)
+ self.assertFalse(hasattr(self.module.warn, 'func_code'))
+
class PyWarnTests(BaseTest, WarnTests):
module = py_warnings
+ # As an early adopter, we sanity check the
+ # test_support.import_fresh_module utility function
+ def test_pure_python(self):
+ self.assertFalse(original_warnings is self.module)
+ self.assertTrue(hasattr(self.module.warn, 'func_code'))
+
class WCmdLineTests(unittest.TestCase):
@@ -377,6 +382,22 @@ class WCmdLineTests(unittest.TestCase):
self.module._setoption('error::Warning::0')
self.assertRaises(UserWarning, self.module.warn, 'convert to error')
+ def test_improper_option(self):
+ # Same as above, but check that the message is printed out when
+ # the interpreter is executed. This also checks that options are
+ # actually parsed at all.
+ rc, out, err = assert_python_ok("-Wxxx", "-c", "pass")
+ self.assertIn(b"Invalid -W option ignored: invalid action: 'xxx'", err)
+
+ def test_warnings_bootstrap(self):
+ # Check that the warnings module does get loaded when -W<some option>
+ # is used (see issue #10372 for an example of silent bootstrap failure).
+ rc, out, err = assert_python_ok("-Wi", "-c",
+ "import sys; sys.modules['warnings'].warn('foo', RuntimeWarning)")
+ # '-Wi' was observed
+ self.assertFalse(out.strip())
+ self.assertNotIn(b'RuntimeWarning', err)
+
class CWCmdLineTests(BaseTest, WCmdLineTests):
module = c_warnings
@@ -412,24 +433,59 @@ class _WarningsTests(BaseTest):
self.module.resetwarnings()
self.module.filterwarnings("once", category=UserWarning)
self.module.warn_explicit(message, UserWarning, "file", 42)
- self.failUnlessEqual(w[-1].message, message)
+ self.assertEqual(w[-1].message, message)
del w[:]
self.module.warn_explicit(message, UserWarning, "file", 42)
- self.assertEquals(len(w), 0)
+ self.assertEqual(len(w), 0)
# Test the resetting of onceregistry.
self.module.onceregistry = {}
__warningregistry__ = {}
self.module.warn('onceregistry test')
- self.failUnlessEqual(w[-1].message.args, message.args)
+ self.assertEqual(w[-1].message.args, message.args)
# Removal of onceregistry is okay.
del w[:]
del self.module.onceregistry
__warningregistry__ = {}
self.module.warn_explicit(message, UserWarning, "file", 42)
- self.assertEquals(len(w), 0)
+ self.assertEqual(len(w), 0)
finally:
self.module.onceregistry = original_registry
+ def test_default_action(self):
+ # Replacing or removing defaultaction should be okay.
+ message = UserWarning("defaultaction test")
+ original = self.module.defaultaction
+ try:
+ with original_warnings.catch_warnings(record=True,
+ module=self.module) as w:
+ self.module.resetwarnings()
+ registry = {}
+ self.module.warn_explicit(message, UserWarning, "<test>", 42,
+ registry=registry)
+ self.assertEqual(w[-1].message, message)
+ self.assertEqual(len(w), 1)
+ self.assertEqual(len(registry), 1)
+ del w[:]
+ # Test removal.
+ del self.module.defaultaction
+ __warningregistry__ = {}
+ registry = {}
+ self.module.warn_explicit(message, UserWarning, "<test>", 43,
+ registry=registry)
+ self.assertEqual(w[-1].message, message)
+ self.assertEqual(len(w), 1)
+ self.assertEqual(len(registry), 1)
+ del w[:]
+ # Test setting.
+ self.module.defaultaction = "ignore"
+ __warningregistry__ = {}
+ registry = {}
+ self.module.warn_explicit(message, UserWarning, "<test>", 44,
+ registry=registry)
+ self.assertEqual(len(w), 0)
+ finally:
+ self.module.defaultaction = original
+
def test_showwarning_missing(self):
# Test that showwarning() missing is okay.
text = 'del showwarning test'
@@ -439,17 +495,17 @@ class _WarningsTests(BaseTest):
with test_support.captured_output('stderr') as stream:
self.module.warn(text)
result = stream.getvalue()
- self.failUnless(text in result)
+ self.assertIn(text, result)
def test_showwarning_not_callable(self):
- self.module.filterwarnings("always", category=UserWarning)
- old_showwarning = self.module.showwarning
- self.module.showwarning = 23
- try:
- self.assertRaises(TypeError, self.module.warn, "Warning!")
- finally:
- self.module.showwarning = old_showwarning
- self.module.resetwarnings()
+ with original_warnings.catch_warnings(module=self.module):
+ self.module.filterwarnings("always", category=UserWarning)
+ old_showwarning = self.module.showwarning
+ self.module.showwarning = 23
+ try:
+ self.assertRaises(TypeError, self.module.warn, "Warning!")
+ finally:
+ self.module.showwarning = old_showwarning
def test_show_warning_output(self):
# With showarning() missing, make sure that output is okay.
@@ -460,19 +516,19 @@ class _WarningsTests(BaseTest):
with test_support.captured_output('stderr') as stream:
warning_tests.inner(text)
result = stream.getvalue()
- self.failUnlessEqual(result.count('\n'), 2,
+ self.assertEqual(result.count('\n'), 2,
"Too many newlines in %r" % result)
first_line, second_line = result.split('\n', 1)
expected_file = os.path.splitext(warning_tests.__file__)[0] + '.py'
first_line_parts = first_line.rsplit(':', 3)
path, line, warning_class, message = first_line_parts
line = int(line)
- self.failUnlessEqual(expected_file, path)
- self.failUnlessEqual(warning_class, ' ' + UserWarning.__name__)
- self.failUnlessEqual(message, ' ' + text)
+ self.assertEqual(expected_file, path)
+ self.assertEqual(warning_class, ' ' + UserWarning.__name__)
+ self.assertEqual(message, ' ' + text)
expected_line = ' ' + linecache.getline(path, line).strip() + '\n'
assert expected_line
- self.failUnlessEqual(second_line, expected_line)
+ self.assertEqual(second_line, expected_line)
class WarningsDisplayTests(unittest.TestCase):
@@ -489,13 +545,13 @@ class WarningsDisplayTests(unittest.TestCase):
format = "%s:%s: %s: %s\n %s\n"
expect = format % (file_name, line_num, category.__name__, message,
file_line)
- self.failUnlessEqual(expect, self.module.formatwarning(message,
+ self.assertEqual(expect, self.module.formatwarning(message,
category, file_name, line_num))
# Test the 'line' argument.
file_line += " for the win!"
expect = format % (file_name, line_num, category.__name__, message,
file_line)
- self.failUnlessEqual(expect, self.module.formatwarning(message,
+ self.assertEqual(expect, self.module.formatwarning(message,
category, file_name, line_num, file_line))
def test_showwarning(self):
@@ -509,7 +565,7 @@ class WarningsDisplayTests(unittest.TestCase):
line_num)
self.module.showwarning(message, category, file_name, line_num,
file_object)
- self.failUnlessEqual(file_object.getvalue(), expect)
+ self.assertEqual(file_object.getvalue(), expect)
# Test 'line' argument.
expected_file_line += "for the win!"
expect = self.module.formatwarning(message, category, file_name,
@@ -517,7 +573,7 @@ class WarningsDisplayTests(unittest.TestCase):
file_object = StringIO.StringIO()
self.module.showwarning(message, category, file_name, line_num,
file_object, expected_file_line)
- self.failUnlessEqual(expect, file_object.getvalue())
+ self.assertEqual(expect, file_object.getvalue())
class CWarningsDisplayTests(BaseTest, WarningsDisplayTests):
module = c_warnings
@@ -537,20 +593,20 @@ class CatchWarningTests(BaseTest):
# Ensure both showwarning and filters are restored when recording
with wmod.catch_warnings(module=wmod, record=True):
wmod.filters = wmod.showwarning = object()
- self.assert_(wmod.filters is orig_filters)
- self.assert_(wmod.showwarning is orig_showwarning)
+ self.assertTrue(wmod.filters is orig_filters)
+ self.assertTrue(wmod.showwarning is orig_showwarning)
# Same test, but with recording disabled
with wmod.catch_warnings(module=wmod, record=False):
wmod.filters = wmod.showwarning = object()
- self.assert_(wmod.filters is orig_filters)
- self.assert_(wmod.showwarning is orig_showwarning)
+ self.assertTrue(wmod.filters is orig_filters)
+ self.assertTrue(wmod.showwarning is orig_showwarning)
def test_catch_warnings_recording(self):
wmod = self.module
# Ensure warnings are recorded when requested
with wmod.catch_warnings(module=wmod, record=True) as w:
self.assertEqual(w, [])
- self.assert_(type(w) is list)
+ self.assertTrue(type(w) is list)
wmod.simplefilter("always")
wmod.warn("foo")
self.assertEqual(str(w[-1].message), "foo")
@@ -563,8 +619,8 @@ class CatchWarningTests(BaseTest):
# Ensure warnings are not recorded when not requested
orig_showwarning = wmod.showwarning
with wmod.catch_warnings(module=wmod, record=False) as w:
- self.assert_(w is None)
- self.assert_(wmod.showwarning is orig_showwarning)
+ self.assertTrue(w is None)
+ self.assertTrue(wmod.showwarning is orig_showwarning)
def test_catch_warnings_reentry_guard(self):
wmod = self.module
@@ -585,17 +641,17 @@ class CatchWarningTests(BaseTest):
orig_showwarning = wmod.showwarning
# Ensure default behaviour is not to record warnings
with wmod.catch_warnings(module=wmod) as w:
- self.assert_(w is None)
- self.assert_(wmod.showwarning is orig_showwarning)
- self.assert_(wmod.filters is not orig_filters)
- self.assert_(wmod.filters is orig_filters)
+ self.assertTrue(w is None)
+ self.assertTrue(wmod.showwarning is orig_showwarning)
+ self.assertTrue(wmod.filters is not orig_filters)
+ self.assertTrue(wmod.filters is orig_filters)
if wmod is sys.modules['warnings']:
# Ensure the default module is this one
with wmod.catch_warnings() as w:
- self.assert_(w is None)
- self.assert_(wmod.showwarning is orig_showwarning)
- self.assert_(wmod.filters is not orig_filters)
- self.assert_(wmod.filters is orig_filters)
+ self.assertTrue(w is None)
+ self.assertTrue(wmod.showwarning is orig_showwarning)
+ self.assertTrue(wmod.filters is not orig_filters)
+ self.assertTrue(wmod.filters is orig_filters)
def test_check_warnings(self):
# Explicit tests for the test_support convenience wrapper
@@ -620,21 +676,14 @@ class CatchWarningTests(BaseTest):
with test_support.check_warnings(('foo', UserWarning)):
wmod.warn("foo")
- try:
+ with self.assertRaises(AssertionError):
with test_support.check_warnings(('', RuntimeWarning)):
# defaults to quiet=False with argument
pass
- except AssertionError:
- pass
- else:
- self.fail("Dind't raise AssertionError")
- try:
+ with self.assertRaises(AssertionError):
with test_support.check_warnings(('foo', RuntimeWarning)):
wmod.warn("foo")
- except AssertionError:
- pass
- else:
- self.fail("Dind't raise AssertionError")
+
class CCatchWarningTests(CatchWarningTests):
module = c_warnings
@@ -643,38 +692,42 @@ class PyCatchWarningTests(CatchWarningTests):
module = py_warnings
-class ShowwarningDeprecationTests(BaseTest):
-
- """Test the deprecation of the old warnings.showwarning() API works."""
-
- @staticmethod
- def bad_showwarning(message, category, filename, lineno, file=None):
- pass
-
- @staticmethod
- def ok_showwarning(*args):
- pass
-
- def test_deprecation(self):
- # message, category, filename, lineno[, file[, line]]
- args = ("message", UserWarning, "file name", 42)
- with original_warnings.catch_warnings(module=self.module):
- self.module.filterwarnings("error", category=DeprecationWarning)
- self.module.showwarning = self.bad_showwarning
- self.assertRaises(DeprecationWarning, self.module.warn_explicit,
- *args)
- self.module.showwarning = self.ok_showwarning
- try:
- self.module.warn_explicit(*args)
- except DeprecationWarning as exc:
- self.fail('showwarning(*args) should not trigger a '
- 'DeprecationWarning')
-
-class CShowwarningDeprecationTests(ShowwarningDeprecationTests):
+class EnvironmentVariableTests(BaseTest):
+
+ def test_single_warning(self):
+ newenv = os.environ.copy()
+ newenv["PYTHONWARNINGS"] = "ignore::DeprecationWarning"
+ p = subprocess.Popen([sys.executable,
+ "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+ stdout=subprocess.PIPE, env=newenv)
+ self.assertEqual(p.communicate()[0], "['ignore::DeprecationWarning']")
+ self.assertEqual(p.wait(), 0)
+
+ def test_comma_separated_warnings(self):
+ newenv = os.environ.copy()
+ newenv["PYTHONWARNINGS"] = ("ignore::DeprecationWarning,"
+ "ignore::UnicodeWarning")
+ p = subprocess.Popen([sys.executable,
+ "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+ stdout=subprocess.PIPE, env=newenv)
+ self.assertEqual(p.communicate()[0],
+ "['ignore::DeprecationWarning', 'ignore::UnicodeWarning']")
+ self.assertEqual(p.wait(), 0)
+
+ def test_envvar_and_command_line(self):
+ newenv = os.environ.copy()
+ newenv["PYTHONWARNINGS"] = "ignore::DeprecationWarning"
+ p = subprocess.Popen([sys.executable, "-W" "ignore::UnicodeWarning",
+ "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"],
+ stdout=subprocess.PIPE, env=newenv)
+ self.assertEqual(p.communicate()[0],
+ "['ignore::UnicodeWarning', 'ignore::DeprecationWarning']")
+ self.assertEqual(p.wait(), 0)
+
+class CEnvironmentVariableTests(EnvironmentVariableTests):
module = c_warnings
-
-class PyShowwarningDeprecationTests(ShowwarningDeprecationTests):
+class PyEnvironmentVariableTests(EnvironmentVariableTests):
module = py_warnings
@@ -687,8 +740,8 @@ def test_main():
_WarningsTests,
CWarningsDisplayTests, PyWarningsDisplayTests,
CCatchWarningTests, PyCatchWarningTests,
- CShowwarningDeprecationTests,
- PyShowwarningDeprecationTests,
+ CEnvironmentVariableTests,
+ PyEnvironmentVariableTests
)
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 9bcb090613..bc2982fadb 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -70,11 +70,11 @@ class ReferencesTestCase(TestBase):
ref1 = weakref.ref(o, self.callback)
ref2 = weakref.ref(o, self.callback)
del o
- self.assert_(ref1() is None,
+ self.assertTrue(ref1() is None,
"expected reference to be invalidated")
- self.assert_(ref2() is None,
+ self.assertTrue(ref2() is None,
"expected reference to be invalidated")
- self.assert_(self.cbcalled == 2,
+ self.assertTrue(self.cbcalled == 2,
"callback not called the right number of times")
def test_multiple_selfref_callbacks(self):
@@ -108,15 +108,15 @@ class ReferencesTestCase(TestBase):
self.assertRaises(weakref.ReferenceError, check, ref1)
self.assertRaises(weakref.ReferenceError, check, ref2)
self.assertRaises(weakref.ReferenceError, bool, weakref.proxy(C()))
- self.assert_(self.cbcalled == 2)
+ self.assertTrue(self.cbcalled == 2)
def check_basic_ref(self, factory):
o = factory()
ref = weakref.ref(o)
- self.assert_(ref() is not None,
+ self.assertTrue(ref() is not None,
"weak reference to live object should be live")
o2 = ref()
- self.assert_(o is o2,
+ self.assertTrue(o is o2,
"<ref>() should return original object if live")
def check_basic_callback(self, factory):
@@ -124,9 +124,9 @@ class ReferencesTestCase(TestBase):
o = factory()
ref = weakref.ref(o, self.callback)
del o
- self.assert_(self.cbcalled == 1,
+ self.assertTrue(self.cbcalled == 1,
"callback did not properly set 'cbcalled'")
- self.assert_(ref() is None,
+ self.assertTrue(ref() is None,
"ref2 should be dead after deleting object reference")
def test_ref_reuse(self):
@@ -136,19 +136,19 @@ class ReferencesTestCase(TestBase):
# between these two; it should make no difference
proxy = weakref.proxy(o)
ref2 = weakref.ref(o)
- self.assert_(ref1 is ref2,
+ self.assertTrue(ref1 is ref2,
"reference object w/out callback should be re-used")
o = C()
proxy = weakref.proxy(o)
ref1 = weakref.ref(o)
ref2 = weakref.ref(o)
- self.assert_(ref1 is ref2,
+ self.assertTrue(ref1 is ref2,
"reference object w/out callback should be re-used")
- self.assert_(weakref.getweakrefcount(o) == 2,
+ self.assertTrue(weakref.getweakrefcount(o) == 2,
"wrong weak ref count for object")
del proxy
- self.assert_(weakref.getweakrefcount(o) == 1,
+ self.assertTrue(weakref.getweakrefcount(o) == 1,
"wrong weak ref count for object after deleting proxy")
def test_proxy_reuse(self):
@@ -156,7 +156,7 @@ class ReferencesTestCase(TestBase):
proxy1 = weakref.proxy(o)
ref = weakref.ref(o)
proxy2 = weakref.proxy(o)
- self.assert_(proxy1 is proxy2,
+ self.assertTrue(proxy1 is proxy2,
"proxy object w/out callback should have been re-used")
def test_basic_proxy(self):
@@ -165,16 +165,15 @@ class ReferencesTestCase(TestBase):
L = UserList.UserList()
p = weakref.proxy(L)
- self.failIf(p, "proxy for empty UserList should be false")
+ self.assertFalse(p, "proxy for empty UserList should be false")
p.append(12)
self.assertEqual(len(L), 1)
- self.failUnless(p, "proxy for non-empty UserList should be true")
- with test_support._check_py3k_warnings():
+ self.assertTrue(p, "proxy for non-empty UserList should be true")
+ with test_support.check_py3k_warnings():
p[:] = [2, 3]
self.assertEqual(len(L), 2)
self.assertEqual(len(p), 2)
- self.failUnless(3 in p,
- "proxy didn't support __contains__() properly")
+ self.assertIn(3, p, "proxy didn't support __contains__() properly")
p[1] = 5
self.assertEqual(L[1], 5)
self.assertEqual(p[1], 5)
@@ -184,7 +183,7 @@ class ReferencesTestCase(TestBase):
## self.assertEqual(repr(L2), repr(p2))
L3 = UserList.UserList(range(10))
p3 = weakref.proxy(L3)
- with test_support._check_py3k_warnings():
+ with test_support.check_py3k_warnings():
self.assertEqual(L3[:], p3[:])
self.assertEqual(L3[5:], p3[5:])
self.assertEqual(L3[:5], p3[:5])
@@ -198,7 +197,7 @@ class ReferencesTestCase(TestBase):
def __unicode__(self):
return u"unicode"
instance = C()
- self.assertTrue("__unicode__" in dir(weakref.proxy(instance)))
+ self.assertIn("__unicode__", dir(weakref.proxy(instance)))
self.assertEqual(unicode(weakref.proxy(instance)), u"unicode")
def test_proxy_index(self):
@@ -239,19 +238,19 @@ class ReferencesTestCase(TestBase):
o = Object(1)
p1 = makeref(o, None)
p2 = makeref(o, None)
- self.assert_(p1 is p2, "both callbacks were None in the C API")
+ self.assertTrue(p1 is p2, "both callbacks were None in the C API")
del p1, p2
p1 = makeref(o)
p2 = makeref(o, None)
- self.assert_(p1 is p2, "callbacks were NULL, None in the C API")
+ self.assertTrue(p1 is p2, "callbacks were NULL, None in the C API")
del p1, p2
p1 = makeref(o)
p2 = makeref(o)
- self.assert_(p1 is p2, "both callbacks were NULL in the C API")
+ self.assertTrue(p1 is p2, "both callbacks were NULL in the C API")
del p1, p2
p1 = makeref(o, None)
p2 = makeref(o)
- self.assert_(p1 is p2, "callbacks were None, NULL in the C API")
+ self.assertTrue(p1 is p2, "callbacks were None, NULL in the C API")
def test_callable_proxy(self):
o = Callable()
@@ -259,13 +258,13 @@ class ReferencesTestCase(TestBase):
self.check_proxy(o, ref1)
- self.assert_(type(ref1) is weakref.CallableProxyType,
+ self.assertTrue(type(ref1) is weakref.CallableProxyType,
"proxy is not of callable type")
ref1('twinkies!')
- self.assert_(o.bar == 'twinkies!',
+ self.assertTrue(o.bar == 'twinkies!',
"call through proxy not passed through to original")
ref1(x='Splat.')
- self.assert_(o.bar == 'Splat.',
+ self.assertTrue(o.bar == 'Splat.',
"call through proxy not passed through to original")
# expect due to too few args
@@ -276,24 +275,24 @@ class ReferencesTestCase(TestBase):
def check_proxy(self, o, proxy):
o.foo = 1
- self.assert_(proxy.foo == 1,
+ self.assertTrue(proxy.foo == 1,
"proxy does not reflect attribute addition")
o.foo = 2
- self.assert_(proxy.foo == 2,
+ self.assertTrue(proxy.foo == 2,
"proxy does not reflect attribute modification")
del o.foo
- self.assert_(not hasattr(proxy, 'foo'),
+ self.assertTrue(not hasattr(proxy, 'foo'),
"proxy does not reflect attribute removal")
proxy.foo = 1
- self.assert_(o.foo == 1,
+ self.assertTrue(o.foo == 1,
"object does not reflect attribute addition via proxy")
proxy.foo = 2
- self.assert_(
+ self.assertTrue(
o.foo == 2,
"object does not reflect attribute modification via proxy")
del proxy.foo
- self.assert_(not hasattr(o, 'foo'),
+ self.assertTrue(not hasattr(o, 'foo'),
"object does not reflect attribute removal via proxy")
def test_proxy_deletion(self):
@@ -317,21 +316,21 @@ class ReferencesTestCase(TestBase):
o = C()
ref1 = weakref.ref(o)
ref2 = weakref.ref(o, self.callback)
- self.assert_(weakref.getweakrefcount(o) == 2,
+ self.assertTrue(weakref.getweakrefcount(o) == 2,
"got wrong number of weak reference objects")
proxy1 = weakref.proxy(o)
proxy2 = weakref.proxy(o, self.callback)
- self.assert_(weakref.getweakrefcount(o) == 4,
+ self.assertTrue(weakref.getweakrefcount(o) == 4,
"got wrong number of weak reference objects")
del ref1, ref2, proxy1, proxy2
- self.assert_(weakref.getweakrefcount(o) == 0,
+ self.assertTrue(weakref.getweakrefcount(o) == 0,
"weak reference objects not unlinked from"
" referent when discarded.")
# assumes ints do not support weakrefs
- self.assert_(weakref.getweakrefcount(1) == 0,
+ self.assertTrue(weakref.getweakrefcount(1) == 0,
"got wrong number of weak reference objects for int")
def test_getweakrefs(self):
@@ -339,22 +338,22 @@ class ReferencesTestCase(TestBase):
ref1 = weakref.ref(o, self.callback)
ref2 = weakref.ref(o, self.callback)
del ref1
- self.assert_(weakref.getweakrefs(o) == [ref2],
+ self.assertTrue(weakref.getweakrefs(o) == [ref2],
"list of refs does not match")
o = C()
ref1 = weakref.ref(o, self.callback)
ref2 = weakref.ref(o, self.callback)
del ref2
- self.assert_(weakref.getweakrefs(o) == [ref1],
+ self.assertTrue(weakref.getweakrefs(o) == [ref1],
"list of refs does not match")
del ref1
- self.assert_(weakref.getweakrefs(o) == [],
+ self.assertTrue(weakref.getweakrefs(o) == [],
"list of refs not cleared")
# assumes ints do not support weakrefs
- self.assert_(weakref.getweakrefs(1) == [],
+ self.assertTrue(weakref.getweakrefs(1) == [],
"list of refs does not match for int")
def test_newstyle_number_ops(self):
@@ -362,8 +361,8 @@ class ReferencesTestCase(TestBase):
pass
f = F(2.0)
p = weakref.proxy(f)
- self.assert_(p + 1.0 == 3.0)
- self.assert_(1.0 + p == 3.0) # this used to SEGV
+ self.assertTrue(p + 1.0 == 3.0)
+ self.assertTrue(1.0 + p == 3.0) # this used to SEGV
def test_callbacks_protected(self):
# Callbacks protected from already-set exceptions?
@@ -616,7 +615,7 @@ class ReferencesTestCase(TestBase):
c.wr = weakref.ref(d, callback) # this won't trigger
d.wr = weakref.ref(callback, d.cb) # ditto
external_wr = weakref.ref(callback, safe_callback) # but this will
- self.assert_(external_wr() is callback)
+ self.assertTrue(external_wr() is callback)
# The weakrefs attached to c and d should get cleared, so that
# C.cb is never called. But external_wr isn't part of the cyclic
@@ -686,6 +685,26 @@ class ReferencesTestCase(TestBase):
# No exception should be raised here
gc.collect()
+ def test_classes(self):
+ # Check that both old-style classes and new-style classes
+ # are weakrefable.
+ class A(object):
+ pass
+ class B:
+ pass
+ l = []
+ weakref.ref(int)
+ a = weakref.ref(A, l.append)
+ A = None
+ gc.collect()
+ self.assertEqual(a(), None)
+ self.assertEqual(l, [a])
+ b = weakref.ref(B, l.append)
+ B = None
+ gc.collect()
+ self.assertEqual(b(), None)
+ self.assertEqual(l, [a, b])
+
class SubclassableWeakrefTestCase(TestBase):
@@ -699,12 +718,12 @@ class SubclassableWeakrefTestCase(TestBase):
return super(MyRef, self).__call__()
o = Object("foo")
mr = MyRef(o, value=24)
- self.assert_(mr() is o)
- self.assert_(mr.called)
+ self.assertTrue(mr() is o)
+ self.assertTrue(mr.called)
self.assertEqual(mr.value, 24)
del o
- self.assert_(mr() is None)
- self.assert_(mr.called)
+ self.assertTrue(mr() is None)
+ self.assertTrue(mr.called)
def test_subclass_refs_dont_replace_standard_refs(self):
class MyRef(weakref.ref):
@@ -712,16 +731,16 @@ class SubclassableWeakrefTestCase(TestBase):
o = Object(42)
r1 = MyRef(o)
r2 = weakref.ref(o)
- self.assert_(r1 is not r2)
+ self.assertTrue(r1 is not r2)
self.assertEqual(weakref.getweakrefs(o), [r2, r1])
self.assertEqual(weakref.getweakrefcount(o), 2)
r3 = MyRef(o)
self.assertEqual(weakref.getweakrefcount(o), 3)
refs = weakref.getweakrefs(o)
self.assertEqual(len(refs), 3)
- self.assert_(r2 is refs[0])
- self.assert_(r1 in refs[1:])
- self.assert_(r3 in refs[1:])
+ self.assertTrue(r2 is refs[0])
+ self.assertIn(r1, refs[1:])
+ self.assertIn(r3, refs[1:])
def test_subclass_refs_dont_conflate_callbacks(self):
class MyRef(weakref.ref):
@@ -729,10 +748,10 @@ class SubclassableWeakrefTestCase(TestBase):
o = Object(42)
r1 = MyRef(o, id)
r2 = MyRef(o, str)
- self.assert_(r1 is not r2)
+ self.assertTrue(r1 is not r2)
refs = weakref.getweakrefs(o)
- self.assert_(r1 in refs)
- self.assert_(r2 in refs)
+ self.assertIn(r1, refs)
+ self.assertIn(r2, refs)
def test_subclass_refs_with_slots(self):
class MyRef(weakref.ref):
@@ -749,7 +768,7 @@ class SubclassableWeakrefTestCase(TestBase):
self.assertEqual(r.slot1, "abc")
self.assertEqual(r.slot2, "def")
self.assertEqual(r.meth(), "abcdef")
- self.failIf(hasattr(r, "__dict__"))
+ self.assertFalse(hasattr(r, "__dict__"))
def test_subclass_refs_with_cycle(self):
# Bug #3110
@@ -807,23 +826,23 @@ class MappingTestCase(TestBase):
#
dict, objects = self.make_weak_valued_dict()
for o in objects:
- self.assert_(weakref.getweakrefcount(o) == 1,
+ self.assertTrue(weakref.getweakrefcount(o) == 1,
"wrong number of weak references to %r!" % o)
- self.assert_(o is dict[o.arg],
+ self.assertTrue(o is dict[o.arg],
"wrong object returned by weak dict!")
items1 = dict.items()
items2 = dict.copy().items()
items1.sort()
items2.sort()
- self.assert_(items1 == items2,
+ self.assertTrue(items1 == items2,
"cloning of weak-valued dictionary did not work!")
del items1, items2
- self.assert_(len(dict) == self.COUNT)
+ self.assertTrue(len(dict) == self.COUNT)
del objects[0]
- self.assert_(len(dict) == (self.COUNT - 1),
+ self.assertTrue(len(dict) == (self.COUNT - 1),
"deleting object did not cause dictionary update")
del objects, o
- self.assert_(len(dict) == 0,
+ self.assertTrue(len(dict) == 0,
"deleting the values did not clear the dictionary")
# regression on SF bug #447152:
dict = weakref.WeakValueDictionary()
@@ -838,26 +857,26 @@ class MappingTestCase(TestBase):
#
dict, objects = self.make_weak_keyed_dict()
for o in objects:
- self.assert_(weakref.getweakrefcount(o) == 1,
+ self.assertTrue(weakref.getweakrefcount(o) == 1,
"wrong number of weak references to %r!" % o)
- self.assert_(o.arg is dict[o],
+ self.assertTrue(o.arg is dict[o],
"wrong object returned by weak dict!")
items1 = dict.items()
items2 = dict.copy().items()
- self.assert_(set(items1) == set(items2),
+ self.assertTrue(set(items1) == set(items2),
"cloning of weak-keyed dictionary did not work!")
del items1, items2
- self.assert_(len(dict) == self.COUNT)
+ self.assertTrue(len(dict) == self.COUNT)
del objects[0]
- self.assert_(len(dict) == (self.COUNT - 1),
+ self.assertTrue(len(dict) == (self.COUNT - 1),
"deleting object did not cause dictionary update")
del objects, o
- self.assert_(len(dict) == 0,
+ self.assertTrue(len(dict) == 0,
"deleting the keys did not clear the dictionary")
o = Object(42)
dict[o] = "What is the meaning of the universe?"
- self.assertTrue(o in dict)
- self.assertTrue(34 not in dict)
+ self.assertIn(o, dict)
+ self.assertNotIn(34, dict)
def test_weak_keyed_iters(self):
dict, objects = self.make_weak_keyed_dict()
@@ -869,7 +888,7 @@ class MappingTestCase(TestBase):
objects2 = list(objects)
for wr in refs:
ob = wr()
- self.assertTrue(ob in dict)
+ self.assertIn(ob, dict)
self.assertEqual(ob.arg, dict[ob])
objects2.remove(ob)
self.assertEqual(len(objects2), 0)
@@ -879,7 +898,7 @@ class MappingTestCase(TestBase):
self.assertEqual(len(list(dict.iterkeyrefs())), len(objects))
for wr in dict.iterkeyrefs():
ob = wr()
- self.assertTrue(ob in dict)
+ self.assertIn(ob, dict)
self.assertEqual(ob.arg, dict[ob])
objects2.remove(ob)
self.assertEqual(len(objects2), 0)
@@ -914,37 +933,37 @@ class MappingTestCase(TestBase):
items = dict.items()
for item in dict.iteritems():
items.remove(item)
- self.assert_(len(items) == 0, "iteritems() did not touch all items")
+ self.assertTrue(len(items) == 0, "iteritems() did not touch all items")
# key iterator, via __iter__():
keys = dict.keys()
for k in dict:
keys.remove(k)
- self.assert_(len(keys) == 0, "__iter__() did not touch all keys")
+ self.assertTrue(len(keys) == 0, "__iter__() did not touch all keys")
# key iterator, via iterkeys():
keys = dict.keys()
for k in dict.iterkeys():
keys.remove(k)
- self.assert_(len(keys) == 0, "iterkeys() did not touch all keys")
+ self.assertTrue(len(keys) == 0, "iterkeys() did not touch all keys")
# value iterator:
values = dict.values()
for v in dict.itervalues():
values.remove(v)
- self.assert_(len(values) == 0,
+ self.assertTrue(len(values) == 0,
"itervalues() did not touch all values")
def test_make_weak_keyed_dict_from_dict(self):
o = Object(3)
dict = weakref.WeakKeyDictionary({o:364})
- self.assert_(dict[o] == 364)
+ self.assertTrue(dict[o] == 364)
def test_make_weak_keyed_dict_from_weak_keyed_dict(self):
o = Object(3)
dict = weakref.WeakKeyDictionary({o:364})
dict2 = weakref.WeakKeyDictionary(dict)
- self.assert_(dict[o] == 364)
+ self.assertTrue(dict[o] == 364)
def make_weak_keyed_dict(self):
dict = weakref.WeakKeyDictionary()
@@ -964,19 +983,19 @@ class MappingTestCase(TestBase):
weakdict = klass()
weakdict[key1] = value1
weakdict[key2] = value2
- self.assert_(len(weakdict) == 2)
+ self.assertTrue(len(weakdict) == 2)
k, v = weakdict.popitem()
- self.assert_(len(weakdict) == 1)
+ self.assertTrue(len(weakdict) == 1)
if k is key1:
- self.assert_(v is value1)
+ self.assertTrue(v is value1)
else:
- self.assert_(v is value2)
+ self.assertTrue(v is value2)
k, v = weakdict.popitem()
- self.assert_(len(weakdict) == 0)
+ self.assertTrue(len(weakdict) == 0)
if k is key1:
- self.assert_(v is value1)
+ self.assertTrue(v is value1)
else:
- self.assert_(v is value2)
+ self.assertTrue(v is value2)
def test_weak_valued_dict_popitem(self):
self.check_popitem(weakref.WeakValueDictionary,
@@ -987,21 +1006,21 @@ class MappingTestCase(TestBase):
C(), "value 1", C(), "value 2")
def check_setdefault(self, klass, key, value1, value2):
- self.assert_(value1 is not value2,
+ self.assertTrue(value1 is not value2,
"invalid test"
" -- value parameters must be distinct objects")
weakdict = klass()
o = weakdict.setdefault(key, value1)
- self.assertTrue(o is value1)
- self.assertTrue(key in weakdict)
- self.assertTrue(weakdict.get(key) is value1)
- self.assertTrue(weakdict[key] is value1)
+ self.assertIs(o, value1)
+ self.assertIn(key, weakdict)
+ self.assertIs(weakdict.get(key), value1)
+ self.assertIs(weakdict[key], value1)
o = weakdict.setdefault(key, value2)
- self.assertTrue(o is value1)
- self.assertTrue(key in weakdict)
- self.assertTrue(weakdict.get(key) is value1)
- self.assertTrue(weakdict[key] is value1)
+ self.assertIs(o, value1)
+ self.assertIn(key, weakdict)
+ self.assertIs(weakdict.get(key), value1)
+ self.assertIs(weakdict[key], value1)
def test_weak_valued_dict_setdefault(self):
self.check_setdefault(weakref.WeakValueDictionary,
@@ -1020,17 +1039,17 @@ class MappingTestCase(TestBase):
weakdict.update(dict)
self.assertEqual(len(weakdict), len(dict))
for k in weakdict.keys():
- self.assertTrue(k in dict,
+ self.assertIn(k, dict,
"mysterious new key appeared in weak dict")
v = dict.get(k)
- self.assertTrue(v is weakdict[k])
- self.assertTrue(v is weakdict.get(k))
+ self.assertIs(v, weakdict[k])
+ self.assertIs(v, weakdict.get(k))
for k in dict.keys():
- self.assertTrue(k in weakdict,
+ self.assertIn(k, weakdict,
"original key disappeared in weak dict")
v = dict[k]
- self.assertTrue(v is weakdict[k])
- self.assertTrue(v is weakdict.get(k))
+ self.assertIs(v, weakdict[k])
+ self.assertIs(v, weakdict.get(k))
def test_weak_valued_dict_update(self):
self.check_update(weakref.WeakValueDictionary,
@@ -1046,10 +1065,10 @@ class MappingTestCase(TestBase):
o2 = Object('2')
d[o1] = 'something'
d[o2] = 'something'
- self.assert_(len(d) == 2)
+ self.assertTrue(len(d) == 2)
del d[o1]
- self.assert_(len(d) == 1)
- self.assert_(d.keys() == [o2])
+ self.assertTrue(len(d) == 1)
+ self.assertTrue(d.keys() == [o2])
def test_weak_valued_delitem(self):
d = weakref.WeakValueDictionary()
@@ -1057,10 +1076,10 @@ class MappingTestCase(TestBase):
o2 = Object('2')
d['something'] = o1
d['something else'] = o2
- self.assert_(len(d) == 2)
+ self.assertTrue(len(d) == 2)
del d['something']
- self.assert_(len(d) == 1)
- self.assert_(d.items() == [('something else', o2)])
+ self.assertTrue(len(d) == 1)
+ self.assertTrue(d.items() == [('something else', o2)])
def test_weak_keyed_bad_delitem(self):
d = weakref.WeakKeyDictionary()
diff --git a/Lib/test/test_weakset.py b/Lib/test/test_weakset.py
new file mode 100644
index 0000000000..89c2822b6e
--- /dev/null
+++ b/Lib/test/test_weakset.py
@@ -0,0 +1,377 @@
+import unittest
+from test import test_support
+from weakref import proxy, ref, WeakSet
+import operator
+import copy
+import string
+import os
+from random import randrange, shuffle
+import sys
+import warnings
+import collections
+import gc
+import contextlib
+
+
+class Foo:
+ pass
+
+class SomeClass(object):
+ def __init__(self, value):
+ self.value = value
+ def __eq__(self, other):
+ if type(other) != type(self):
+ return False
+ return other.value == self.value
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
+ def __hash__(self):
+ return hash((SomeClass, self.value))
+
+class TestWeakSet(unittest.TestCase):
+
+ def setUp(self):
+ # need to keep references to them
+ self.items = [SomeClass(c) for c in ('a', 'b', 'c')]
+ self.items2 = [SomeClass(c) for c in ('x', 'y', 'z')]
+ self.letters = [SomeClass(c) for c in string.ascii_letters]
+ self.s = WeakSet(self.items)
+ self.d = dict.fromkeys(self.items)
+ self.obj = SomeClass('F')
+ self.fs = WeakSet([self.obj])
+
+ def test_methods(self):
+ weaksetmethods = dir(WeakSet)
+ for method in dir(set):
+ if method == 'test_c_api' or method.startswith('_'):
+ continue
+ self.assertIn(method, weaksetmethods,
+ "WeakSet missing method " + method)
+
+ def test_new_or_init(self):
+ self.assertRaises(TypeError, WeakSet, [], 2)
+
+ def test_len(self):
+ self.assertEqual(len(self.s), len(self.d))
+ self.assertEqual(len(self.fs), 1)
+ del self.obj
+ self.assertEqual(len(self.fs), 0)
+
+ def test_contains(self):
+ for c in self.letters:
+ self.assertEqual(c in self.s, c in self.d)
+ # 1 is not weakref'able, but that TypeError is caught by __contains__
+ self.assertNotIn(1, self.s)
+ self.assertIn(self.obj, self.fs)
+ del self.obj
+ self.assertNotIn(SomeClass('F'), self.fs)
+
+ def test_union(self):
+ u = self.s.union(self.items2)
+ for c in self.letters:
+ self.assertEqual(c in u, c in self.d or c in self.items2)
+ self.assertEqual(self.s, WeakSet(self.items))
+ self.assertEqual(type(u), WeakSet)
+ self.assertRaises(TypeError, self.s.union, [[]])
+ for C in set, frozenset, dict.fromkeys, list, tuple:
+ x = WeakSet(self.items + self.items2)
+ c = C(self.items2)
+ self.assertEqual(self.s.union(c), x)
+
+ def test_or(self):
+ i = self.s.union(self.items2)
+ self.assertEqual(self.s | set(self.items2), i)
+ self.assertEqual(self.s | frozenset(self.items2), i)
+
+ def test_intersection(self):
+ i = self.s.intersection(self.items2)
+ for c in self.letters:
+ self.assertEqual(c in i, c in self.d and c in self.items2)
+ self.assertEqual(self.s, WeakSet(self.items))
+ self.assertEqual(type(i), WeakSet)
+ for C in set, frozenset, dict.fromkeys, list, tuple:
+ x = WeakSet([])
+ self.assertEqual(self.s.intersection(C(self.items2)), x)
+
+ def test_isdisjoint(self):
+ self.assertTrue(self.s.isdisjoint(WeakSet(self.items2)))
+ self.assertTrue(not self.s.isdisjoint(WeakSet(self.letters)))
+
+ def test_and(self):
+ i = self.s.intersection(self.items2)
+ self.assertEqual(self.s & set(self.items2), i)
+ self.assertEqual(self.s & frozenset(self.items2), i)
+
+ def test_difference(self):
+ i = self.s.difference(self.items2)
+ for c in self.letters:
+ self.assertEqual(c in i, c in self.d and c not in self.items2)
+ self.assertEqual(self.s, WeakSet(self.items))
+ self.assertEqual(type(i), WeakSet)
+ self.assertRaises(TypeError, self.s.difference, [[]])
+
+ def test_sub(self):
+ i = self.s.difference(self.items2)
+ self.assertEqual(self.s - set(self.items2), i)
+ self.assertEqual(self.s - frozenset(self.items2), i)
+
+ def test_symmetric_difference(self):
+ i = self.s.symmetric_difference(self.items2)
+ for c in self.letters:
+ self.assertEqual(c in i, (c in self.d) ^ (c in self.items2))
+ self.assertEqual(self.s, WeakSet(self.items))
+ self.assertEqual(type(i), WeakSet)
+ self.assertRaises(TypeError, self.s.symmetric_difference, [[]])
+
+ def test_xor(self):
+ i = self.s.symmetric_difference(self.items2)
+ self.assertEqual(self.s ^ set(self.items2), i)
+ self.assertEqual(self.s ^ frozenset(self.items2), i)
+
+ def test_sub_and_super(self):
+ pl, ql, rl = map(lambda s: [SomeClass(c) for c in s], ['ab', 'abcde', 'def'])
+ p, q, r = map(WeakSet, (pl, ql, rl))
+ self.assertTrue(p < q)
+ self.assertTrue(p <= q)
+ self.assertTrue(q <= q)
+ self.assertTrue(q > p)
+ self.assertTrue(q >= p)
+ self.assertFalse(q < r)
+ self.assertFalse(q <= r)
+ self.assertFalse(q > r)
+ self.assertFalse(q >= r)
+ self.assertTrue(set('a').issubset('abc'))
+ self.assertTrue(set('abc').issuperset('a'))
+ self.assertFalse(set('a').issubset('cbs'))
+ self.assertFalse(set('cbs').issuperset('a'))
+
+ def test_gc(self):
+ # Create a nest of cycles to exercise overall ref count check
+ s = WeakSet(Foo() for i in range(1000))
+ for elem in s:
+ elem.cycle = s
+ elem.sub = elem
+ elem.set = WeakSet([elem])
+
+ def test_subclass_with_custom_hash(self):
+ # Bug #1257731
+ class H(WeakSet):
+ def __hash__(self):
+ return int(id(self) & 0x7fffffff)
+ s=H()
+ f=set()
+ f.add(s)
+ self.assertIn(s, f)
+ f.remove(s)
+ f.add(s)
+ f.discard(s)
+
+ def test_init(self):
+ s = WeakSet()
+ s.__init__(self.items)
+ self.assertEqual(s, self.s)
+ s.__init__(self.items2)
+ self.assertEqual(s, WeakSet(self.items2))
+ self.assertRaises(TypeError, s.__init__, s, 2);
+ self.assertRaises(TypeError, s.__init__, 1);
+
+ def test_constructor_identity(self):
+ s = WeakSet(self.items)
+ t = WeakSet(s)
+ self.assertNotEqual(id(s), id(t))
+
+ def test_hash(self):
+ self.assertRaises(TypeError, hash, self.s)
+
+ def test_clear(self):
+ self.s.clear()
+ self.assertEqual(self.s, WeakSet([]))
+ self.assertEqual(len(self.s), 0)
+
+ def test_copy(self):
+ dup = self.s.copy()
+ self.assertEqual(self.s, dup)
+ self.assertNotEqual(id(self.s), id(dup))
+
+ def test_add(self):
+ x = SomeClass('Q')
+ self.s.add(x)
+ self.assertIn(x, self.s)
+ dup = self.s.copy()
+ self.s.add(x)
+ self.assertEqual(self.s, dup)
+ self.assertRaises(TypeError, self.s.add, [])
+ self.fs.add(Foo())
+ self.assertTrue(len(self.fs) == 1)
+ self.fs.add(self.obj)
+ self.assertTrue(len(self.fs) == 1)
+
+ def test_remove(self):
+ x = SomeClass('a')
+ self.s.remove(x)
+ self.assertNotIn(x, self.s)
+ self.assertRaises(KeyError, self.s.remove, x)
+ self.assertRaises(TypeError, self.s.remove, [])
+
+ def test_discard(self):
+ a, q = SomeClass('a'), SomeClass('Q')
+ self.s.discard(a)
+ self.assertNotIn(a, self.s)
+ self.s.discard(q)
+ self.assertRaises(TypeError, self.s.discard, [])
+
+ def test_pop(self):
+ for i in range(len(self.s)):
+ elem = self.s.pop()
+ self.assertNotIn(elem, self.s)
+ self.assertRaises(KeyError, self.s.pop)
+
+ def test_update(self):
+ retval = self.s.update(self.items2)
+ self.assertEqual(retval, None)
+ for c in (self.items + self.items2):
+ self.assertIn(c, self.s)
+ self.assertRaises(TypeError, self.s.update, [[]])
+
+ def test_update_set(self):
+ self.s.update(set(self.items2))
+ for c in (self.items + self.items2):
+ self.assertIn(c, self.s)
+
+ def test_ior(self):
+ self.s |= set(self.items2)
+ for c in (self.items + self.items2):
+ self.assertIn(c, self.s)
+
+ def test_intersection_update(self):
+ retval = self.s.intersection_update(self.items2)
+ self.assertEqual(retval, None)
+ for c in (self.items + self.items2):
+ if c in self.items2 and c in self.items:
+ self.assertIn(c, self.s)
+ else:
+ self.assertNotIn(c, self.s)
+ self.assertRaises(TypeError, self.s.intersection_update, [[]])
+
+ def test_iand(self):
+ self.s &= set(self.items2)
+ for c in (self.items + self.items2):
+ if c in self.items2 and c in self.items:
+ self.assertIn(c, self.s)
+ else:
+ self.assertNotIn(c, self.s)
+
+ def test_difference_update(self):
+ retval = self.s.difference_update(self.items2)
+ self.assertEqual(retval, None)
+ for c in (self.items + self.items2):
+ if c in self.items and c not in self.items2:
+ self.assertIn(c, self.s)
+ else:
+ self.assertNotIn(c, self.s)
+ self.assertRaises(TypeError, self.s.difference_update, [[]])
+ self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])
+
+ def test_isub(self):
+ self.s -= set(self.items2)
+ for c in (self.items + self.items2):
+ if c in self.items and c not in self.items2:
+ self.assertIn(c, self.s)
+ else:
+ self.assertNotIn(c, self.s)
+
+ def test_symmetric_difference_update(self):
+ retval = self.s.symmetric_difference_update(self.items2)
+ self.assertEqual(retval, None)
+ for c in (self.items + self.items2):
+ if (c in self.items) ^ (c in self.items2):
+ self.assertIn(c, self.s)
+ else:
+ self.assertNotIn(c, self.s)
+ self.assertRaises(TypeError, self.s.symmetric_difference_update, [[]])
+
+ def test_ixor(self):
+ self.s ^= set(self.items2)
+ for c in (self.items + self.items2):
+ if (c in self.items) ^ (c in self.items2):
+ self.assertIn(c, self.s)
+ else:
+ self.assertNotIn(c, self.s)
+
+ def test_inplace_on_self(self):
+ t = self.s.copy()
+ t |= t
+ self.assertEqual(t, self.s)
+ t &= t
+ self.assertEqual(t, self.s)
+ t -= t
+ self.assertEqual(t, WeakSet())
+ t = self.s.copy()
+ t ^= t
+ self.assertEqual(t, WeakSet())
+
+ def test_eq(self):
+ # issue 5964
+ self.assertTrue(self.s == self.s)
+ self.assertTrue(self.s == WeakSet(self.items))
+ self.assertFalse(self.s == set(self.items))
+ self.assertFalse(self.s == list(self.items))
+ self.assertFalse(self.s == tuple(self.items))
+ self.assertFalse(self.s == 1)
+
+ def test_weak_destroy_while_iterating(self):
+ # Issue #7105: iterators shouldn't crash when a key is implicitly removed
+ # Create new items to be sure no-one else holds a reference
+ items = [SomeClass(c) for c in ('a', 'b', 'c')]
+ s = WeakSet(items)
+ it = iter(s)
+ next(it) # Trigger internal iteration
+ # Destroy an item
+ del items[-1]
+ gc.collect() # just in case
+ # We have removed either the first consumed items, or another one
+ self.assertIn(len(list(it)), [len(items), len(items) - 1])
+ del it
+ # The removal has been committed
+ self.assertEqual(len(s), len(items))
+
+ def test_weak_destroy_and_mutate_while_iterating(self):
+ # Issue #7105: iterators shouldn't crash when a key is implicitly removed
+ items = [SomeClass(c) for c in string.ascii_letters]
+ s = WeakSet(items)
+ @contextlib.contextmanager
+ def testcontext():
+ try:
+ it = iter(s)
+ next(it)
+ # Schedule an item for removal and recreate it
+ u = SomeClass(str(items.pop()))
+ gc.collect() # just in case
+ yield u
+ finally:
+ it = None # should commit all removals
+
+ with testcontext() as u:
+ self.assertNotIn(u, s)
+ with testcontext() as u:
+ self.assertRaises(KeyError, s.remove, u)
+ self.assertNotIn(u, s)
+ with testcontext() as u:
+ s.add(u)
+ self.assertIn(u, s)
+ t = s.copy()
+ with testcontext() as u:
+ s.update(t)
+ self.assertEqual(len(s), len(t))
+ with testcontext() as u:
+ s.clear()
+ self.assertEqual(len(s), 0)
+
+
+def test_main(verbose=None):
+ test_support.run_unittest(TestWeakSet)
+
+if __name__ == "__main__":
+ test_main(verbose=True)
diff --git a/Lib/test/test_whichdb.py b/Lib/test/test_whichdb.py
index 5a8d6305ef..427e323f49 100644
--- a/Lib/test/test_whichdb.py
+++ b/Lib/test/test_whichdb.py
@@ -41,7 +41,7 @@ for name in anydbm._names:
try:
# Silence Py3k warning
mod = test.test_support.import_module(name, deprecated=True)
- except test.test_support.TestSkipped:
+ except unittest.SkipTest:
continue
def test_whichdb_name(self, name=name, mod=mod):
diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py
index 902309a558..12ab3baada 100644
--- a/Lib/test/test_winreg.py
+++ b/Lib/test/test_winreg.py
@@ -1,15 +1,36 @@
# Test the windows specific win32reg module.
# Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey
-from _winreg import *
import os, sys
import unittest
-
from test import test_support
threading = test_support.import_module("threading")
from platform import machine
+# Do this first so test will be skipped if module doesn't exist
+test_support.import_module('_winreg')
+# Now import everything
+from _winreg import *
+
+try:
+ REMOTE_NAME = sys.argv[sys.argv.index("--remote")+1]
+except (IndexError, ValueError):
+ REMOTE_NAME = None
+
+# tuple of (major, minor)
+WIN_VER = sys.getwindowsversion()[:2]
+# Some tests should only run on 64-bit architectures where WOW64 will be.
+WIN64_MACHINE = True if machine() == "AMD64" else False
+
+# Starting with Windows 7 and Windows Server 2008 R2, WOW64 no longer uses
+# registry reflection and formerly reflected keys are shared instead.
+# Windows 7 and Windows Server 2008 R2 are version 6.1. Due to this, some
+# tests are only valid up until 6.1
+HAS_REFLECTION = True if WIN_VER < (6, 1) else False
+
test_key_name = "SOFTWARE\\Python Registry Test Key - Delete Me"
+# On OS'es that support reflection we should test with a reflected key
+test_reflect_key_name = "SOFTWARE\\Classes\\Python Test Key - Delete Me"
test_data = [
("Int Value", 45, REG_DWORD),
@@ -31,10 +52,30 @@ if test_support.have_unicode:
"values"], REG_MULTI_SZ),
]
-class WinregTests(unittest.TestCase):
- remote_name = None
+class BaseWinregTests(unittest.TestCase):
+
+ def setUp(self):
+ # Make sure that the test key is absent when the test
+ # starts.
+ self.delete_tree(HKEY_CURRENT_USER, test_key_name)
- def WriteTestData(self, root_key):
+ def delete_tree(self, root, subkey):
+ try:
+ hkey = OpenKey(root, subkey, KEY_ALL_ACCESS)
+ except WindowsError:
+ # subkey does not exist
+ return
+ while True:
+ try:
+ subsubkey = EnumKey(hkey, 0)
+ except WindowsError:
+ # no more subkeys
+ break
+ self.delete_tree(hkey, subsubkey)
+ CloseKey(hkey)
+ DeleteKey(root, subkey)
+
+ def _write_test_data(self, root_key, CreateKey=CreateKey):
# Set the default value for this key.
SetValue(root_key, test_key_name, REG_SZ, "Default value")
key = CreateKey(root_key, test_key_name)
@@ -47,11 +88,11 @@ class WinregTests(unittest.TestCase):
# Check we wrote as many items as we thought.
nkeys, nvalues, since_mod = QueryInfoKey(key)
- self.assertEquals(nkeys, 1, "Not the correct number of sub keys")
- self.assertEquals(nvalues, 1, "Not the correct number of values")
+ self.assertEqual(nkeys, 1, "Not the correct number of sub keys")
+ self.assertEqual(nvalues, 1, "Not the correct number of values")
nkeys, nvalues, since_mod = QueryInfoKey(sub_key)
- self.assertEquals(nkeys, 0, "Not the correct number of sub keys")
- self.assertEquals(nvalues, len(test_data),
+ self.assertEqual(nkeys, 0, "Not the correct number of sub keys")
+ self.assertEqual(nvalues, len(test_data),
"Not the correct number of values")
# Close this key this way...
# (but before we do, copy the key as an integer - this allows
@@ -74,11 +115,11 @@ class WinregTests(unittest.TestCase):
except EnvironmentError:
pass
- def ReadTestData(self, root_key):
+ def _read_test_data(self, root_key, OpenKey=OpenKey):
# Check we can get default value for this key.
val = QueryValue(root_key, test_key_name)
- self.assertEquals(val, "Default value",
- "Registry didn't give back the correct value")
+ self.assertEqual(val, "Default value",
+ "Registry didn't give back the correct value")
key = OpenKey(root_key, test_key_name)
# Read the sub-keys
@@ -90,22 +131,22 @@ class WinregTests(unittest.TestCase):
data = EnumValue(sub_key, index)
except EnvironmentError:
break
- self.assertEquals(data in test_data, True,
- "Didn't read back the correct test data")
+ self.assertIn(data, test_data,
+ "Didn't read back the correct test data")
index = index + 1
- self.assertEquals(index, len(test_data),
- "Didn't read the correct number of items")
+ self.assertEqual(index, len(test_data),
+ "Didn't read the correct number of items")
# Check I can directly access each item
for value_name, value_data, value_type in test_data:
read_val, read_typ = QueryValueEx(sub_key, value_name)
- self.assertEquals(read_val, value_data,
- "Could not directly read the value")
- self.assertEquals(read_typ, value_type,
- "Could not directly read the value")
+ self.assertEqual(read_val, value_data,
+ "Could not directly read the value")
+ self.assertEqual(read_typ, value_type,
+ "Could not directly read the value")
sub_key.Close()
# Enumerate our main key.
read_val = EnumKey(key, 0)
- self.assertEquals(read_val, "sub_key", "Read subkey value wrong")
+ self.assertEqual(read_val, "sub_key", "Read subkey value wrong")
try:
EnumKey(key, 1)
self.fail("Was able to get a second key when I only have one!")
@@ -114,7 +155,7 @@ class WinregTests(unittest.TestCase):
key.Close()
- def DeleteTestData(self, root_key):
+ def _delete_test_data(self, root_key):
key = OpenKey(root_key, test_key_name, 0, KEY_ALL_ACCESS)
sub_key = OpenKey(key, "sub_key", 0, KEY_ALL_ACCESS)
# It is not necessary to delete the values before deleting
@@ -124,8 +165,8 @@ class WinregTests(unittest.TestCase):
DeleteValue(sub_key, value_name)
nkeys, nvalues, since_mod = QueryInfoKey(sub_key)
- self.assertEquals(nkeys, 0, "subkey not empty before delete")
- self.assertEquals(nvalues, 0, "subkey not empty before delete")
+ self.assertEqual(nkeys, 0, "subkey not empty before delete")
+ self.assertEqual(nvalues, 0, "subkey not empty before delete")
sub_key.Close()
DeleteKey(key, "sub_key")
@@ -144,30 +185,53 @@ class WinregTests(unittest.TestCase):
except WindowsError: # Use this error name this time
pass
- def TestAll(self, root_key):
- self.WriteTestData(root_key)
- self.ReadTestData(root_key)
- self.DeleteTestData(root_key)
+ def _test_all(self, root_key):
+ self._write_test_data(root_key)
+ self._read_test_data(root_key)
+ self._delete_test_data(root_key)
+
+class LocalWinregTests(BaseWinregTests):
- def testLocalMachineRegistryWorks(self):
- self.TestAll(HKEY_CURRENT_USER)
+ def test_registry_works(self):
+ self._test_all(HKEY_CURRENT_USER)
- def testConnectRegistryToLocalMachineWorks(self):
+ def test_registry_works_extended_functions(self):
+ # Substitute the regular CreateKey and OpenKey calls with their
+ # extended counterparts.
+ # Note: DeleteKeyEx is not used here because it is platform dependent
+ cke = lambda key, sub_key: CreateKeyEx(key, sub_key, 0, KEY_ALL_ACCESS)
+ self._write_test_data(HKEY_CURRENT_USER, cke)
+
+ oke = lambda key, sub_key: OpenKeyEx(key, sub_key, 0, KEY_READ)
+ self._read_test_data(HKEY_CURRENT_USER, oke)
+
+ self._delete_test_data(HKEY_CURRENT_USER)
+
+ def test_connect_registry_to_local_machine_works(self):
# perform minimal ConnectRegistry test which just invokes it
h = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
+ self.assertNotEqual(h.handle, 0)
h.Close()
+ self.assertEqual(h.handle, 0)
- def testRemoteMachineRegistryWorks(self):
- if not self.remote_name:
- return # remote machine name not specified
- remote_key = ConnectRegistry(self.remote_name, HKEY_CURRENT_USER)
- self.TestAll(remote_key)
+ def test_inexistant_remote_registry(self):
+ connect = lambda: ConnectRegistry("abcdefghijkl", HKEY_CURRENT_USER)
+ self.assertRaises(WindowsError, connect)
- def testExpandEnvironmentStrings(self):
+ def test_expand_environment_strings(self):
r = ExpandEnvironmentStrings(u"%windir%\\test")
self.assertEqual(type(r), unicode)
self.assertEqual(r, os.environ["windir"] + "\\test")
+ def test_context_manager(self):
+ # ensure that the handle is closed if an exception occurs
+ try:
+ with ConnectRegistry(None, HKEY_LOCAL_MACHINE) as h:
+ self.assertNotEqual(h.handle, 0)
+ raise WindowsError
+ except WindowsError:
+ self.assertEqual(h.handle, 0)
+
def test_changing_value(self):
# Issue2810: A race condition in 2.6 and 3.1 may cause
# EnumValue or QueryValue to throw "WindowsError: More data is
@@ -197,7 +261,8 @@ class WinregTests(unittest.TestCase):
finally:
done = True
thread.join()
- DeleteKey(HKEY_CURRENT_USER, test_key_name+'\\changing_value')
+ with OpenKey(HKEY_CURRENT_USER, test_key_name, 0, KEY_ALL_ACCESS) as key:
+ DeleteKey(key, 'changing_value')
DeleteKey(HKEY_CURRENT_USER, test_key_name)
def test_long_key(self):
@@ -211,7 +276,8 @@ class WinregTests(unittest.TestCase):
num_subkeys, num_values, t = QueryInfoKey(key)
EnumKey(key, 0)
finally:
- DeleteKey(HKEY_CURRENT_USER, '\\'.join((test_key_name, name)))
+ with OpenKey(HKEY_CURRENT_USER, test_key_name, 0, KEY_ALL_ACCESS) as key:
+ DeleteKey(key, name)
DeleteKey(HKEY_CURRENT_USER, test_key_name)
def test_dynamic_key(self):
@@ -220,14 +286,131 @@ class WinregTests(unittest.TestCase):
EnumValue(HKEY_PERFORMANCE_DATA, 0)
QueryValueEx(HKEY_PERFORMANCE_DATA, None)
+ # Reflection requires XP x64/Vista at a minimum. XP doesn't have this stuff
+ # or DeleteKeyEx so make sure their use raises NotImplementedError
+ @unittest.skipUnless(WIN_VER < (5, 2), "Requires Windows XP")
+ def test_reflection_unsupported(self):
+ try:
+ with CreateKey(HKEY_CURRENT_USER, test_key_name) as ck:
+ self.assertNotEqual(ck.handle, 0)
+
+ key = OpenKey(HKEY_CURRENT_USER, test_key_name)
+ self.assertNotEqual(key.handle, 0)
+
+ with self.assertRaises(NotImplementedError):
+ DisableReflectionKey(key)
+ with self.assertRaises(NotImplementedError):
+ EnableReflectionKey(key)
+ with self.assertRaises(NotImplementedError):
+ QueryReflectionKey(key)
+ with self.assertRaises(NotImplementedError):
+ DeleteKeyEx(HKEY_CURRENT_USER, test_key_name)
+ finally:
+ DeleteKey(HKEY_CURRENT_USER, test_key_name)
+
+
+@unittest.skipUnless(REMOTE_NAME, "Skipping remote registry tests")
+class RemoteWinregTests(BaseWinregTests):
+
+ def test_remote_registry_works(self):
+ remote_key = ConnectRegistry(REMOTE_NAME, HKEY_CURRENT_USER)
+ self._test_all(remote_key)
+
+
+@unittest.skipUnless(WIN64_MACHINE, "x64 specific registry tests")
+class Win64WinregTests(BaseWinregTests):
+
+ def test_reflection_functions(self):
+ # Test that we can call the query, enable, and disable functions
+ # on a key which isn't on the reflection list with no consequences.
+ with OpenKey(HKEY_LOCAL_MACHINE, "Software") as key:
+ # HKLM\Software is redirected but not reflected in all OSes
+ self.assertTrue(QueryReflectionKey(key))
+ self.assertEqual(None, EnableReflectionKey(key))
+ self.assertEqual(None, DisableReflectionKey(key))
+ self.assertTrue(QueryReflectionKey(key))
+
+ @unittest.skipUnless(HAS_REFLECTION, "OS doesn't support reflection")
+ def test_reflection(self):
+ # Test that we can create, open, and delete keys in the 32-bit
+ # area. Because we are doing this in a key which gets reflected,
+ # test the differences of 32 and 64-bit keys before and after the
+ # reflection occurs (ie. when the created key is closed).
+ try:
+ with CreateKeyEx(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_ALL_ACCESS | KEY_WOW64_32KEY) as created_key:
+ self.assertNotEqual(created_key.handle, 0)
+
+ # The key should now be available in the 32-bit area
+ with OpenKey(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_ALL_ACCESS | KEY_WOW64_32KEY) as key:
+ self.assertNotEqual(key.handle, 0)
+
+ # Write a value to what currently is only in the 32-bit area
+ SetValueEx(created_key, "", 0, REG_SZ, "32KEY")
+
+ # The key is not reflected until created_key is closed.
+ # The 64-bit version of the key should not be available yet.
+ open_fail = lambda: OpenKey(HKEY_CURRENT_USER,
+ test_reflect_key_name, 0,
+ KEY_READ | KEY_WOW64_64KEY)
+ self.assertRaises(WindowsError, open_fail)
+
+ # Now explicitly open the 64-bit version of the key
+ with OpenKey(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_ALL_ACCESS | KEY_WOW64_64KEY) as key:
+ self.assertNotEqual(key.handle, 0)
+ # Make sure the original value we set is there
+ self.assertEqual("32KEY", QueryValue(key, ""))
+ # Set a new value, which will get reflected to 32-bit
+ SetValueEx(key, "", 0, REG_SZ, "64KEY")
+
+ # Reflection uses a "last-writer wins policy, so the value we set
+ # on the 64-bit key should be the same on 32-bit
+ with OpenKey(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_READ | KEY_WOW64_32KEY) as key:
+ self.assertEqual("64KEY", QueryValue(key, ""))
+ finally:
+ DeleteKeyEx(HKEY_CURRENT_USER, test_reflect_key_name,
+ KEY_WOW64_32KEY, 0)
+
+ @unittest.skipUnless(HAS_REFLECTION, "OS doesn't support reflection")
+ def test_disable_reflection(self):
+ # Make use of a key which gets redirected and reflected
+ try:
+ with CreateKeyEx(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_ALL_ACCESS | KEY_WOW64_32KEY) as created_key:
+ # QueryReflectionKey returns whether or not the key is disabled
+ disabled = QueryReflectionKey(created_key)
+ self.assertEqual(type(disabled), bool)
+ # HKCU\Software\Classes is reflected by default
+ self.assertFalse(disabled)
+
+ DisableReflectionKey(created_key)
+ self.assertTrue(QueryReflectionKey(created_key))
+
+ # The key is now closed and would normally be reflected to the
+ # 64-bit area, but let's make sure that didn't happen.
+ open_fail = lambda: OpenKeyEx(HKEY_CURRENT_USER,
+ test_reflect_key_name, 0,
+ KEY_READ | KEY_WOW64_64KEY)
+ self.assertRaises(WindowsError, open_fail)
+
+ # Make sure the 32-bit key is actually there
+ with OpenKeyEx(HKEY_CURRENT_USER, test_reflect_key_name, 0,
+ KEY_READ | KEY_WOW64_32KEY) as key:
+ self.assertNotEqual(key.handle, 0)
+ finally:
+ DeleteKeyEx(HKEY_CURRENT_USER, test_reflect_key_name,
+ KEY_WOW64_32KEY, 0)
+
+
def test_main():
- test_support.run_unittest(WinregTests)
+ test_support.run_unittest(LocalWinregTests, RemoteWinregTests,
+ Win64WinregTests)
if __name__ == "__main__":
- try:
- WinregTests.remote_name = sys.argv[sys.argv.index("--remote")+1]
- except (IndexError, ValueError):
+ if not REMOTE_NAME:
print "Remote registry calls can be tested using",
print "'test_winreg.py --remote \\\\machine_name'"
- WinregTests.remote_name = None
test_main()
diff --git a/Lib/test/test_winsound.py b/Lib/test/test_winsound.py
index de444220c6..821d68418d 100644
--- a/Lib/test/test_winsound.py
+++ b/Lib/test/test_winsound.py
@@ -5,12 +5,11 @@ from test import test_support
import time
import os
import subprocess
-import ctypes
winsound = test_support.import_module('winsound')
+ctypes = test_support.import_module('ctypes')
import _winreg
-
def has_sound(sound):
"""Find out if a particular event is configured with a default sound"""
try:
@@ -103,9 +102,8 @@ class PlaySoundTest(unittest.TestCase):
"none", winsound.SND_ASYNC | winsound.SND_MEMORY
)
+ @unittest.skipUnless(has_sound("SystemAsterisk"), "No default SystemAsterisk")
def test_alias_asterisk(self):
- if not has_sound("SystemAsterisk"):
- return
if _have_soundcard():
winsound.PlaySound('SystemAsterisk', winsound.SND_ALIAS)
else:
@@ -115,9 +113,8 @@ class PlaySoundTest(unittest.TestCase):
'SystemAsterisk', winsound.SND_ALIAS
)
+ @unittest.skipUnless(has_sound("SystemExclamation"), "No default SystemExclamation")
def test_alias_exclamation(self):
- if not has_sound("SystemExclamation"):
- return
if _have_soundcard():
winsound.PlaySound('SystemExclamation', winsound.SND_ALIAS)
else:
@@ -127,9 +124,8 @@ class PlaySoundTest(unittest.TestCase):
'SystemExclamation', winsound.SND_ALIAS
)
+ @unittest.skipUnless(has_sound("SystemExit"), "No default SystemExit")
def test_alias_exit(self):
- if not has_sound("SystemExit"):
- return
if _have_soundcard():
winsound.PlaySound('SystemExit', winsound.SND_ALIAS)
else:
@@ -139,9 +135,8 @@ class PlaySoundTest(unittest.TestCase):
'SystemExit', winsound.SND_ALIAS
)
+ @unittest.skipUnless(has_sound("SystemHand"), "No default SystemHand")
def test_alias_hand(self):
- if not has_sound("SystemHand"):
- return
if _have_soundcard():
winsound.PlaySound('SystemHand', winsound.SND_ALIAS)
else:
@@ -151,9 +146,8 @@ class PlaySoundTest(unittest.TestCase):
'SystemHand', winsound.SND_ALIAS
)
+ @unittest.skipUnless(has_sound("SystemQuestion"), "No default SystemQuestion")
def test_alias_question(self):
- if not has_sound("SystemQuestion"):
- return
if _have_soundcard():
winsound.PlaySound('SystemQuestion', winsound.SND_ALIAS)
else:
diff --git a/Lib/test/test_with.py b/Lib/test/test_with.py
index 1364bef5ac..496451833c 100644
--- a/Lib/test/test_with.py
+++ b/Lib/test/test_with.py
@@ -213,11 +213,17 @@ class ContextmanagerAssertionMixin(object):
def raiseTestException(self):
raise self.TEST_EXCEPTION
- def assertAfterWithManagerInvariantsWithError(self, mock_manager):
+ def assertAfterWithManagerInvariantsWithError(self, mock_manager,
+ exc_type=None):
self.assertTrue(mock_manager.enter_called)
self.assertTrue(mock_manager.exit_called)
- self.assertEqual(mock_manager.exit_args[0], RuntimeError)
- self.assertEqual(mock_manager.exit_args[1], self.TEST_EXCEPTION)
+ if exc_type is None:
+ self.assertEqual(mock_manager.exit_args[1], self.TEST_EXCEPTION)
+ exc_type = type(self.TEST_EXCEPTION)
+ self.assertEqual(mock_manager.exit_args[0], exc_type)
+ # Test the __exit__ arguments. Issue #7853
+ self.assertIsInstance(mock_manager.exit_args[1], exc_type)
+ self.assertIsNot(mock_manager.exit_args[2], None)
def assertAfterWithGeneratorInvariantsWithError(self, mock_generator):
self.assertTrue(mock_generator.yielded)
@@ -283,15 +289,6 @@ class NestedNonexceptionalTestCase(unittest.TestCase,
with Nested(mock_contextmanager_generator()):
pass
- def testSingleArgUnbound(self):
- mock_contextmanager = mock_contextmanager_generator()
- mock_nested = MockNested(mock_contextmanager)
- with mock_nested:
- self.assertInWithManagerInvariants(mock_contextmanager)
- self.assertInWithManagerInvariants(mock_nested)
- self.assertAfterWithManagerInvariantsNoError(mock_contextmanager)
- self.assertAfterWithManagerInvariantsNoError(mock_nested)
-
def testSingleArgBoundToNonTuple(self):
m = mock_contextmanager_generator()
# This will bind all the arguments to nested() into a single list
@@ -364,6 +361,16 @@ class ExceptionalTestCase(unittest.TestCase, ContextmanagerAssertionMixin):
self.assertAfterWithManagerInvariantsWithError(cm)
self.assertAfterWithGeneratorInvariantsWithError(self.resource)
+ def testExceptionNormalized(self):
+ cm = mock_contextmanager_generator()
+ def shouldThrow():
+ with cm as self.resource:
+ # Note this relies on the fact that 1 // 0 produces an exception
+ # that is not normalized immediately.
+ 1 // 0
+ self.assertRaises(ZeroDivisionError, shouldThrow)
+ self.assertAfterWithManagerInvariantsWithError(cm, ZeroDivisionError)
+
def testNestedSingleStatements(self):
mock_a = mock_contextmanager_generator()
mock_b = mock_contextmanager_generator()
@@ -654,12 +661,89 @@ class ExitSwallowsExceptionTestCase(unittest.TestCase):
self.fail("ZeroDivisionError should have been raised")
+class NestedWith(unittest.TestCase):
+
+ class Dummy(object):
+ def __init__(self, value=None, gobble=False):
+ if value is None:
+ value = self
+ self.value = value
+ self.gobble = gobble
+ self.enter_called = False
+ self.exit_called = False
+
+ def __enter__(self):
+ self.enter_called = True
+ return self.value
+
+ def __exit__(self, *exc_info):
+ self.exit_called = True
+ self.exc_info = exc_info
+ if self.gobble:
+ return True
+
+ class InitRaises(object):
+ def __init__(self): raise RuntimeError()
+
+ class EnterRaises(object):
+ def __enter__(self): raise RuntimeError()
+ def __exit__(self, *exc_info): pass
+
+ class ExitRaises(object):
+ def __enter__(self): pass
+ def __exit__(self, *exc_info): raise RuntimeError()
+
+ def testNoExceptions(self):
+ with self.Dummy() as a, self.Dummy() as b:
+ self.assertTrue(a.enter_called)
+ self.assertTrue(b.enter_called)
+ self.assertTrue(a.exit_called)
+ self.assertTrue(b.exit_called)
+
+ def testExceptionInExprList(self):
+ try:
+ with self.Dummy() as a, self.InitRaises():
+ pass
+ except:
+ pass
+ self.assertTrue(a.enter_called)
+ self.assertTrue(a.exit_called)
+
+ def testExceptionInEnter(self):
+ try:
+ with self.Dummy() as a, self.EnterRaises():
+ self.fail('body of bad with executed')
+ except RuntimeError:
+ pass
+ else:
+ self.fail('RuntimeError not reraised')
+ self.assertTrue(a.enter_called)
+ self.assertTrue(a.exit_called)
+
+ def testExceptionInExit(self):
+ body_executed = False
+ with self.Dummy(gobble=True) as a, self.ExitRaises():
+ body_executed = True
+ self.assertTrue(a.enter_called)
+ self.assertTrue(a.exit_called)
+ self.assertTrue(body_executed)
+ self.assertNotEqual(a.exc_info[0], None)
+
+ def testEnterReturnsTuple(self):
+ with self.Dummy(value=(1,2)) as (a1, a2), \
+ self.Dummy(value=(10, 20)) as (b1, b2):
+ self.assertEqual(1, a1)
+ self.assertEqual(2, a2)
+ self.assertEqual(10, b1)
+ self.assertEqual(20, b2)
+
def test_main():
run_unittest(FailureTestCase, NonexceptionalTestCase,
NestedNonexceptionalTestCase, ExceptionalTestCase,
NonLocalFlowControlTestCase,
AssignmentTargetTestCase,
- ExitSwallowsExceptionTestCase)
+ ExitSwallowsExceptionTestCase,
+ NestedWith)
if __name__ == '__main__':
diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py
index 0d7659570c..45ca620c3a 100755..100644
--- a/Lib/test/test_wsgiref.py
+++ b/Lib/test/test_wsgiref.py
@@ -151,7 +151,7 @@ class IntegrationTests(TestCase):
start_response("200 OK", ('Content-Type','text/plain'))
return ["Hello, world!"]
out, err = run_amock(validator(bad_app))
- self.failUnless(out.endswith(
+ self.assertTrue(out.endswith(
"A server error occurred. Please contact the administrator."
))
self.assertEqual(
@@ -179,15 +179,15 @@ class UtilityTests(TestCase):
# Check defaulting when empty
env = {}
util.setup_testing_defaults(env)
- if isinstance(value,StringIO):
- self.failUnless(isinstance(env[key],StringIO))
+ if isinstance(value, StringIO):
+ self.assertIsInstance(env[key], StringIO)
else:
- self.assertEqual(env[key],value)
+ self.assertEqual(env[key], value)
# Check existing value
env = {key:alt}
util.setup_testing_defaults(env)
- self.failUnless(env[key] is alt)
+ self.assertTrue(env[key] is alt)
def checkCrossDefault(self,key,value,**kw):
util.setup_testing_defaults(kw)
@@ -214,15 +214,15 @@ class UtilityTests(TestCase):
compare_generic_iter(make_it,match)
it = make_it()
- self.failIf(it.filelike.closed)
+ self.assertFalse(it.filelike.closed)
for item in it:
pass
- self.failIf(it.filelike.closed)
+ self.assertFalse(it.filelike.closed)
it.close()
- self.failUnless(it.filelike.closed)
+ self.assertTrue(it.filelike.closed)
def testSimpleShifts(self):
@@ -306,6 +306,10 @@ class UtilityTests(TestCase):
self.checkReqURI("http://127.0.0.1/spam", SCRIPT_NAME="/spam")
self.checkReqURI("http://127.0.0.1/spammity/spam",
SCRIPT_NAME="/spammity", PATH_INFO="/spam")
+ self.checkReqURI("http://127.0.0.1/spammity/spam;ham",
+ SCRIPT_NAME="/spammity", PATH_INFO="/spam;ham")
+ self.checkReqURI("http://127.0.0.1/spammity/spam;cookie=1234,5678",
+ SCRIPT_NAME="/spammity", PATH_INFO="/spam;cookie=1234,5678")
self.checkReqURI("http://127.0.0.1/spammity/spam?say=ni",
SCRIPT_NAME="/spammity", PATH_INFO="/spam",QUERY_STRING="say=ni")
self.checkReqURI("http://127.0.0.1/spammity/spam", 0,
@@ -320,14 +324,14 @@ class UtilityTests(TestCase):
"TE Trailers Transfer-Encoding Upgrade"
).split():
for alt in hop, hop.title(), hop.upper(), hop.lower():
- self.failUnless(util.is_hop_by_hop(alt))
+ self.assertTrue(util.is_hop_by_hop(alt))
# Not comprehensive, just a few random header names
for hop in (
"Accept Cache-Control Date Pragma Trailer Via Warning"
).split():
for alt in hop, hop.title(), hop.upper(), hop.lower():
- self.failIf(util.is_hop_by_hop(alt))
+ self.assertFalse(util.is_hop_by_hop(alt))
class HeaderTests(TestCase):
@@ -338,17 +342,17 @@ class HeaderTests(TestCase):
self.assertEqual(Headers(test[:]).keys(), ['x'])
self.assertEqual(Headers(test[:]).values(), ['y'])
self.assertEqual(Headers(test[:]).items(), test)
- self.failIf(Headers(test).items() is test) # must be copy!
+ self.assertFalse(Headers(test).items() is test) # must be copy!
h=Headers([])
del h['foo'] # should not raise an error
h['Foo'] = 'bar'
for m in h.has_key, h.__contains__, h.get, h.get_all, h.__getitem__:
- self.failUnless(m('foo'))
- self.failUnless(m('Foo'))
- self.failUnless(m('FOO'))
- self.failIf(m('bar'))
+ self.assertTrue(m('foo'))
+ self.assertTrue(m('Foo'))
+ self.assertTrue(m('FOO'))
+ self.assertFalse(m('bar'))
self.assertEqual(h['foo'],'bar')
h['foo'] = 'baz'
@@ -435,7 +439,7 @@ class HandlerTests(TestCase):
if k not in empty:
self.assertEqual(env[k],v)
for k,v in empty.items():
- self.assertTrue(k in env)
+ self.assertIn(k, env)
def testEnviron(self):
h = TestHandler(X="Y")
@@ -448,7 +452,7 @@ class HandlerTests(TestCase):
h = BaseCGIHandler(None,None,None,{})
h.setup_environ()
for key in 'wsgi.url_scheme', 'wsgi.input', 'wsgi.errors':
- self.assertTrue(key in h.environ)
+ self.assertIn(key, h.environ)
def testScheme(self):
h=TestHandler(HTTPS="on"); h.setup_environ()
@@ -477,6 +481,11 @@ class HandlerTests(TestCase):
s('200 OK',[])(e['wsgi.url_scheme'])
return []
+ def trivial_app4(e,s):
+ # Simulate a response to a HEAD request
+ s('200 OK',[('Content-Length', '12345')])
+ return []
+
h = TestHandler()
h.run(trivial_app1)
self.assertEqual(h.stdout.getvalue(),
@@ -493,10 +502,12 @@ class HandlerTests(TestCase):
"http")
-
-
-
-
+ h = TestHandler()
+ h.run(trivial_app4)
+ self.assertEqual(h.stdout.getvalue(),
+ b'Status: 200 OK\r\n'
+ b'Content-Length: 12345\r\n'
+ b'\r\n')
def testBasicErrorOutput(self):
@@ -523,8 +534,7 @@ class HandlerTests(TestCase):
"Content-Length: %d\r\n"
"\r\n%s" % (h.error_status,len(h.error_body),h.error_body))
- self.assertTrue("AssertionError" in h.stderr.getvalue(),
- "AssertionError not in stderr")
+ self.assertNotEqual(h.stderr.getvalue().find("AssertionError"), -1)
def testErrorAfterOutput(self):
MSG = "Some output has been sent"
@@ -537,8 +547,7 @@ class HandlerTests(TestCase):
self.assertEqual(h.stdout.getvalue(),
"Status: 200 OK\r\n"
"\r\n"+MSG)
- self.assertTrue("AssertionError" in h.stderr.getvalue(),
- "AssertionError not in stderr")
+ self.assertNotEqual(h.stderr.getvalue().find("AssertionError"), -1)
def testHeaderFormats(self):
@@ -577,7 +586,7 @@ class HandlerTests(TestCase):
if proto=="HTTP/0.9":
self.assertEqual(h.stdout.getvalue(),"")
else:
- self.failUnless(
+ self.assertTrue(
re.match(stdpat%(version,sw), h.stdout.getvalue()),
(stdpat%(version,sw), h.stdout.getvalue())
)
diff --git a/Lib/test/test_xdrlib.py b/Lib/test/test_xdrlib.py
index 8fc88a5f2e..9ba8885c0a 100644
--- a/Lib/test/test_xdrlib.py
+++ b/Lib/test/test_xdrlib.py
@@ -12,6 +12,7 @@ class XDRTest(unittest.TestCase):
a = ['what', 'is', 'hapnin', 'doctor']
p.pack_int(42)
+ p.pack_int(-17)
p.pack_uint(9)
p.pack_bool(True)
p.pack_bool(False)
@@ -29,16 +30,17 @@ class XDRTest(unittest.TestCase):
self.assertEqual(up.get_position(), 0)
self.assertEqual(up.unpack_int(), 42)
+ self.assertEqual(up.unpack_int(), -17)
self.assertEqual(up.unpack_uint(), 9)
- self.assert_(up.unpack_bool() is True)
+ self.assertTrue(up.unpack_bool() is True)
# remember position
pos = up.get_position()
- self.assert_(up.unpack_bool() is False)
+ self.assertTrue(up.unpack_bool() is False)
# rewind and unpack again
up.set_position(pos)
- self.assert_(up.unpack_bool() is False)
+ self.assertTrue(up.unpack_bool() is False)
self.assertEqual(up.unpack_uhyper(), 45L)
self.assertAlmostEqual(up.unpack_float(), 1.9)
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 2e24ed1b07..26e8eab796 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -1,22 +1,47 @@
# xml.etree test. This file contains enough tests to make sure that
-# all included components work as they should. For a more extensive
-# test suite, see the selftest script in the ElementTree distribution.
+# all included components work as they should.
+# Large parts are extracted from the upstream test suite.
+
+# IMPORTANT: the same doctests are run from "test_xml_etree_c" in
+# order to ensure consistency between the C implementation and the
+# Python implementation.
+#
+# For this purpose, the module-level "ET" symbol is temporarily
+# monkey-patched when running the "test_xml_etree_c" test suite.
+# Don't re-import "xml.etree.ElementTree" module in the docstring,
+# except if the test is specific to the Python implementation.
-import doctest
import sys
+import cgi
from test import test_support
+from test.test_support import findfile
+
+from xml.etree import ElementTree as ET
+
+SIMPLE_XMLFILE = findfile("simple.xml", subdir="xmltestdata")
+SIMPLE_NS_XMLFILE = findfile("simple-ns.xml", subdir="xmltestdata")
-SAMPLE_XML = """
+SAMPLE_XML = """\
<body>
- <tag>text</tag>
- <tag />
+ <tag class='a'>text</tag>
+ <tag class='b' />
<section>
- <tag>subtext</tag>
+ <tag class='b' id='inner'>subtext</tag>
</section>
</body>
"""
+SAMPLE_SECTION = """\
+<section>
+ <tag class='b' id='inner'>subtext</tag>
+ <nexttag />
+ <nextsection>
+ <tag />
+ </nextsection>
+</section>
+"""
+
SAMPLE_XML_NS = """
<body xmlns="http://effbot.org/ns">
<tag>text</tag>
@@ -27,6 +52,7 @@ SAMPLE_XML_NS = """
</body>
"""
+
def sanity():
"""
Import sanity.
@@ -40,38 +66,99 @@ def check_method(method):
if not hasattr(method, '__call__'):
print method, "not callable"
-def serialize(ET, elem, encoding=None):
+def serialize(elem, to_string=True, **options):
import StringIO
file = StringIO.StringIO()
tree = ET.ElementTree(elem)
- if encoding:
- tree.write(file, encoding)
+ tree.write(file, **options)
+ if to_string:
+ return file.getvalue()
else:
- tree.write(file)
- return file.getvalue()
+ file.seek(0)
+ return file
def summarize(elem):
+ if elem.tag == ET.Comment:
+ return "<Comment>"
return elem.tag
def summarize_list(seq):
- return map(summarize, seq)
+ return [summarize(elem) for elem in seq]
+
+def normalize_crlf(tree):
+ for elem in tree.iter():
+ if elem.text:
+ elem.text = elem.text.replace("\r\n", "\n")
+ if elem.tail:
+ elem.tail = elem.tail.replace("\r\n", "\n")
+
+def check_string(string):
+ len(string)
+ for char in string:
+ if len(char) != 1:
+ print "expected one-character string, got %r" % char
+ new_string = string + ""
+ new_string = string + " "
+ string[:0]
+
+def check_mapping(mapping):
+ len(mapping)
+ keys = mapping.keys()
+ items = mapping.items()
+ for key in keys:
+ item = mapping[key]
+ mapping["key"] = "value"
+ if mapping["key"] != "value":
+ print "expected value string, got %r" % mapping["key"]
+
+def check_element(element):
+ if not ET.iselement(element):
+ print "not an element"
+ if not hasattr(element, "tag"):
+ print "no tag member"
+ if not hasattr(element, "attrib"):
+ print "no attrib member"
+ if not hasattr(element, "text"):
+ print "no text member"
+ if not hasattr(element, "tail"):
+ print "no tail member"
+
+ check_string(element.tag)
+ check_mapping(element.attrib)
+ if element.text is not None:
+ check_string(element.text)
+ if element.tail is not None:
+ check_string(element.tail)
+ for elem in element:
+ check_element(elem)
+
+# --------------------------------------------------------------------
+# element tree tests
def interface():
- """
+ r"""
Test element tree interface.
- >>> from xml.etree import ElementTree as ET
+ >>> element = ET.Element("tag")
+ >>> check_element(element)
+ >>> tree = ET.ElementTree(element)
+ >>> check_element(tree.getroot())
- >>> element = ET.Element("tag", key="value")
+ >>> element = ET.Element("t\xe4g", key="value")
>>> tree = ET.ElementTree(element)
+ >>> repr(element) # doctest: +ELLIPSIS
+ "<Element 't\\xe4g' at 0x...>"
+ >>> element = ET.Element("tag", key="value")
Make sure all standard element methods exist.
>>> check_method(element.append)
+ >>> check_method(element.extend)
>>> check_method(element.insert)
>>> check_method(element.remove)
>>> check_method(element.getchildren)
>>> check_method(element.find)
+ >>> check_method(element.iterfind)
>>> check_method(element.findall)
>>> check_method(element.findtext)
>>> check_method(element.clear)
@@ -79,38 +166,134 @@ def interface():
>>> check_method(element.set)
>>> check_method(element.keys)
>>> check_method(element.items)
+ >>> check_method(element.iter)
+ >>> check_method(element.itertext)
>>> check_method(element.getiterator)
+ These methods return an iterable. See bug 6472.
+
+ >>> check_method(element.iter("tag").next)
+ >>> check_method(element.iterfind("tag").next)
+ >>> check_method(element.iterfind("*").next)
+ >>> check_method(tree.iter("tag").next)
+ >>> check_method(tree.iterfind("tag").next)
+ >>> check_method(tree.iterfind("*").next)
+
+ These aliases are provided:
+
+ >>> assert ET.XML == ET.fromstring
+ >>> assert ET.PI == ET.ProcessingInstruction
+ >>> assert ET.XMLParser == ET.XMLTreeBuilder
+ """
+
+def simpleops():
+ """
Basic method sanity checks.
- >>> serialize(ET, element) # 1
+ >>> elem = ET.XML("<body><tag/></body>")
+ >>> serialize(elem)
+ '<body><tag /></body>'
+ >>> e = ET.Element("tag2")
+ >>> elem.append(e)
+ >>> serialize(elem)
+ '<body><tag /><tag2 /></body>'
+ >>> elem.remove(e)
+ >>> serialize(elem)
+ '<body><tag /></body>'
+ >>> elem.insert(0, e)
+ >>> serialize(elem)
+ '<body><tag2 /><tag /></body>'
+ >>> elem.remove(e)
+ >>> elem.extend([e])
+ >>> serialize(elem)
+ '<body><tag /><tag2 /></body>'
+ >>> elem.remove(e)
+
+ >>> element = ET.Element("tag", key="value")
+ >>> serialize(element) # 1
'<tag key="value" />'
>>> subelement = ET.Element("subtag")
>>> element.append(subelement)
- >>> serialize(ET, element) # 2
+ >>> serialize(element) # 2
'<tag key="value"><subtag /></tag>'
>>> element.insert(0, subelement)
- >>> serialize(ET, element) # 3
+ >>> serialize(element) # 3
'<tag key="value"><subtag /><subtag /></tag>'
>>> element.remove(subelement)
- >>> serialize(ET, element) # 4
+ >>> serialize(element) # 4
'<tag key="value"><subtag /></tag>'
>>> element.remove(subelement)
- >>> serialize(ET, element) # 5
+ >>> serialize(element) # 5
'<tag key="value" />'
>>> element.remove(subelement)
Traceback (most recent call last):
ValueError: list.remove(x): x not in list
- >>> serialize(ET, element) # 6
+ >>> serialize(element) # 6
'<tag key="value" />'
+ >>> element[0:0] = [subelement, subelement, subelement]
+ >>> serialize(element[1])
+ '<subtag />'
+ >>> element[1:9] == [element[1], element[2]]
+ True
+ >>> element[:9:2] == [element[0], element[2]]
+ True
+ >>> del element[1:2]
+ >>> serialize(element)
+ '<tag key="value"><subtag /><subtag /></tag>'
+ """
+
+def cdata():
+ """
+ Test CDATA handling (etc).
+
+ >>> serialize(ET.XML("<tag>hello</tag>"))
+ '<tag>hello</tag>'
+ >>> serialize(ET.XML("<tag>&#104;&#101;&#108;&#108;&#111;</tag>"))
+ '<tag>hello</tag>'
+ >>> serialize(ET.XML("<tag><![CDATA[hello]]></tag>"))
+ '<tag>hello</tag>'
+ """
+
+# Only with Python implementation
+def simplefind():
+ """
+ Test find methods using the elementpath fallback.
+
+ >>> from xml.etree import ElementTree
+
+ >>> CurrentElementPath = ElementTree.ElementPath
+ >>> ElementTree.ElementPath = ElementTree._SimpleElementPath()
+ >>> elem = ElementTree.XML(SAMPLE_XML)
+ >>> elem.find("tag").tag
+ 'tag'
+ >>> ElementTree.ElementTree(elem).find("tag").tag
+ 'tag'
+ >>> elem.findtext("tag")
+ 'text'
+ >>> elem.findtext("tog")
+ >>> elem.findtext("tog", "default")
+ 'default'
+ >>> ElementTree.ElementTree(elem).findtext("tag")
+ 'text'
+ >>> summarize_list(elem.findall("tag"))
+ ['tag', 'tag']
+ >>> summarize_list(elem.findall(".//tag"))
+ ['tag', 'tag', 'tag']
+
+ Path syntax doesn't work in this case.
+
+ >>> elem.find("section/tag")
+ >>> elem.findtext("section/tag")
+ >>> summarize_list(elem.findall("section/tag"))
+ []
+
+ >>> ElementTree.ElementPath = CurrentElementPath
"""
def find():
"""
Test find methods (including xpath syntax).
- >>> from xml.etree import ElementTree as ET
-
>>> elem = ET.XML(SAMPLE_XML)
>>> elem.find("tag").tag
'tag'
@@ -118,39 +301,67 @@ def find():
'tag'
>>> elem.find("section/tag").tag
'tag'
+ >>> elem.find("./tag").tag
+ 'tag'
+ >>> ET.ElementTree(elem).find("./tag").tag
+ 'tag'
+ >>> ET.ElementTree(elem).find("/tag").tag
+ 'tag'
+ >>> elem[2] = ET.XML(SAMPLE_SECTION)
+ >>> elem.find("section/nexttag").tag
+ 'nexttag'
>>> ET.ElementTree(elem).find("section/tag").tag
'tag'
+ >>> ET.ElementTree(elem).find("tog")
+ >>> ET.ElementTree(elem).find("tog/foo")
>>> elem.findtext("tag")
'text'
+ >>> elem.findtext("section/nexttag")
+ ''
+ >>> elem.findtext("section/nexttag", "default")
+ ''
>>> elem.findtext("tog")
>>> elem.findtext("tog", "default")
'default'
>>> ET.ElementTree(elem).findtext("tag")
'text'
+ >>> ET.ElementTree(elem).findtext("tog/foo")
+ >>> ET.ElementTree(elem).findtext("tog/foo", "default")
+ 'default'
+ >>> ET.ElementTree(elem).findtext("./tag")
+ 'text'
+ >>> ET.ElementTree(elem).findtext("/tag")
+ 'text'
>>> elem.findtext("section/tag")
'subtext'
>>> ET.ElementTree(elem).findtext("section/tag")
'subtext'
+ >>> summarize_list(elem.findall("."))
+ ['body']
>>> summarize_list(elem.findall("tag"))
['tag', 'tag']
+ >>> summarize_list(elem.findall("tog"))
+ []
+ >>> summarize_list(elem.findall("tog/foo"))
+ []
>>> summarize_list(elem.findall("*"))
['tag', 'tag', 'section']
>>> summarize_list(elem.findall(".//tag"))
- ['tag', 'tag', 'tag']
+ ['tag', 'tag', 'tag', 'tag']
>>> summarize_list(elem.findall("section/tag"))
['tag']
>>> summarize_list(elem.findall("section//tag"))
- ['tag']
+ ['tag', 'tag']
>>> summarize_list(elem.findall("section/*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection']
>>> summarize_list(elem.findall("section//*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection', 'tag']
>>> summarize_list(elem.findall("section/.//*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection', 'tag']
>>> summarize_list(elem.findall("*/*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection']
>>> summarize_list(elem.findall("*//*"))
- ['tag']
+ ['tag', 'nexttag', 'nextsection', 'tag']
>>> summarize_list(elem.findall("*/tag"))
['tag']
>>> summarize_list(elem.findall("*/./tag"))
@@ -158,13 +369,40 @@ def find():
>>> summarize_list(elem.findall("./tag"))
['tag', 'tag']
>>> summarize_list(elem.findall(".//tag"))
- ['tag', 'tag', 'tag']
+ ['tag', 'tag', 'tag', 'tag']
>>> summarize_list(elem.findall("././tag"))
['tag', 'tag']
- >>> summarize_list(ET.ElementTree(elem).findall("/tag"))
+ >>> summarize_list(elem.findall(".//tag[@class]"))
+ ['tag', 'tag', 'tag']
+ >>> summarize_list(elem.findall(".//tag[@class='a']"))
+ ['tag']
+ >>> summarize_list(elem.findall(".//tag[@class='b']"))
+ ['tag', 'tag']
+ >>> summarize_list(elem.findall(".//tag[@id]"))
+ ['tag']
+ >>> summarize_list(elem.findall(".//section[tag]"))
+ ['section']
+ >>> summarize_list(elem.findall(".//section[element]"))
+ []
+ >>> summarize_list(elem.findall("../tag"))
+ []
+ >>> summarize_list(elem.findall("section/../tag"))
['tag', 'tag']
>>> summarize_list(ET.ElementTree(elem).findall("./tag"))
['tag', 'tag']
+
+ Following example is invalid in 1.2.
+ A leading '*' is assumed in 1.3.
+
+ >>> elem.findall("section//") == elem.findall("section//*")
+ True
+
+ ET's Path module handles this case incorrectly; this gives
+ a warning in 1.3, and the behaviour will be modified in 1.4.
+
+ >>> summarize_list(ET.ElementTree(elem).findall("/tag"))
+ ['tag', 'tag']
+
>>> elem = ET.XML(SAMPLE_XML_NS)
>>> summarize_list(elem.findall("tag"))
[]
@@ -174,22 +412,230 @@ def find():
['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag']
"""
-def parseliteral():
- r"""
+def file_init():
+ """
+ >>> import StringIO
- >>> from xml.etree import ElementTree as ET
+ >>> stringfile = StringIO.StringIO(SAMPLE_XML)
+ >>> tree = ET.ElementTree(file=stringfile)
+ >>> tree.find("tag").tag
+ 'tag'
+ >>> tree.find("section/tag").tag
+ 'tag'
+
+ >>> tree = ET.ElementTree(file=SIMPLE_XMLFILE)
+ >>> tree.find("element").tag
+ 'element'
+ >>> tree.find("element/../empty-element").tag
+ 'empty-element'
+ """
+
+def bad_find():
+ """
+ Check bad or unsupported path expressions.
+
+ >>> elem = ET.XML(SAMPLE_XML)
+ >>> elem.findall("/tag")
+ Traceback (most recent call last):
+ SyntaxError: cannot use absolute path on element
+ """
+
+def path_cache():
+ """
+ Check that the path cache behaves sanely.
+
+ >>> elem = ET.XML(SAMPLE_XML)
+ >>> for i in range(10): ET.ElementTree(elem).find('./'+str(i))
+ >>> cache_len_10 = len(ET.ElementPath._cache)
+ >>> for i in range(10): ET.ElementTree(elem).find('./'+str(i))
+ >>> len(ET.ElementPath._cache) == cache_len_10
+ True
+ >>> for i in range(20): ET.ElementTree(elem).find('./'+str(i))
+ >>> len(ET.ElementPath._cache) > cache_len_10
+ True
+ >>> for i in range(600): ET.ElementTree(elem).find('./'+str(i))
+ >>> len(ET.ElementPath._cache) < 500
+ True
+ """
+
+def copy():
+ """
+ Test copy handling (etc).
+
+ >>> import copy
+ >>> e1 = ET.XML("<tag>hello<foo/></tag>")
+ >>> e2 = copy.copy(e1)
+ >>> e3 = copy.deepcopy(e1)
+ >>> e1.find("foo").tag = "bar"
+ >>> serialize(e1)
+ '<tag>hello<bar /></tag>'
+ >>> serialize(e2)
+ '<tag>hello<bar /></tag>'
+ >>> serialize(e3)
+ '<tag>hello<foo /></tag>'
+
+ """
+
+def attrib():
+ """
+ Test attribute handling.
+ >>> elem = ET.Element("tag")
+ >>> elem.get("key") # 1.1
+ >>> elem.get("key", "default") # 1.2
+ 'default'
+ >>> elem.set("key", "value")
+ >>> elem.get("key") # 1.3
+ 'value'
+
+ >>> elem = ET.Element("tag", key="value")
+ >>> elem.get("key") # 2.1
+ 'value'
+ >>> elem.attrib # 2.2
+ {'key': 'value'}
+
+ >>> attrib = {"key": "value"}
+ >>> elem = ET.Element("tag", attrib)
+ >>> attrib.clear() # check for aliasing issues
+ >>> elem.get("key") # 3.1
+ 'value'
+ >>> elem.attrib # 3.2
+ {'key': 'value'}
+
+ >>> attrib = {"key": "value"}
+ >>> elem = ET.Element("tag", **attrib)
+ >>> attrib.clear() # check for aliasing issues
+ >>> elem.get("key") # 4.1
+ 'value'
+ >>> elem.attrib # 4.2
+ {'key': 'value'}
+
+ >>> elem = ET.Element("tag", {"key": "other"}, key="value")
+ >>> elem.get("key") # 5.1
+ 'value'
+ >>> elem.attrib # 5.2
+ {'key': 'value'}
+
+ >>> elem = ET.Element('test')
+ >>> elem.text = "aa"
+ >>> elem.set('testa', 'testval')
+ >>> elem.set('testb', 'test2')
+ >>> ET.tostring(elem)
+ '<test testa="testval" testb="test2">aa</test>'
+ >>> sorted(elem.keys())
+ ['testa', 'testb']
+ >>> sorted(elem.items())
+ [('testa', 'testval'), ('testb', 'test2')]
+ >>> elem.attrib['testb']
+ 'test2'
+ >>> elem.attrib['testb'] = 'test1'
+ >>> elem.attrib['testc'] = 'test2'
+ >>> ET.tostring(elem)
+ '<test testa="testval" testb="test1" testc="test2">aa</test>'
+ """
+
+def makeelement():
+ """
+ Test makeelement handling.
+
+ >>> elem = ET.Element("tag")
+ >>> attrib = {"key": "value"}
+ >>> subelem = elem.makeelement("subtag", attrib)
+ >>> if subelem.attrib is attrib:
+ ... print "attrib aliasing"
+ >>> elem.append(subelem)
+ >>> serialize(elem)
+ '<tag><subtag key="value" /></tag>'
+
+ >>> elem.clear()
+ >>> serialize(elem)
+ '<tag />'
+ >>> elem.append(subelem)
+ >>> serialize(elem)
+ '<tag><subtag key="value" /></tag>'
+ >>> elem.extend([subelem, subelem])
+ >>> serialize(elem)
+ '<tag><subtag key="value" /><subtag key="value" /><subtag key="value" /></tag>'
+ >>> elem[:] = [subelem]
+ >>> serialize(elem)
+ '<tag><subtag key="value" /></tag>'
+ >>> elem[:] = tuple([subelem])
+ >>> serialize(elem)
+ '<tag><subtag key="value" /></tag>'
+
+ """
+
+def parsefile():
+ """
+ Test parsing from file.
+
+ >>> tree = ET.parse(SIMPLE_XMLFILE)
+ >>> normalize_crlf(tree)
+ >>> tree.write(sys.stdout)
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+ >>> tree = ET.parse(SIMPLE_NS_XMLFILE)
+ >>> normalize_crlf(tree)
+ >>> tree.write(sys.stdout)
+ <ns0:root xmlns:ns0="namespace">
+ <ns0:element key="value">text</ns0:element>
+ <ns0:element>text</ns0:element>tail
+ <ns0:empty-element />
+ </ns0:root>
+
+ >>> with open(SIMPLE_XMLFILE) as f:
+ ... data = f.read()
+
+ >>> parser = ET.XMLParser()
+ >>> parser.version # doctest: +ELLIPSIS
+ 'Expat ...'
+ >>> parser.feed(data)
+ >>> print serialize(parser.close())
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+
+ >>> parser = ET.XMLTreeBuilder() # 1.2 compatibility
+ >>> parser.feed(data)
+ >>> print serialize(parser.close())
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+
+ >>> target = ET.TreeBuilder()
+ >>> parser = ET.XMLParser(target=target)
+ >>> parser.feed(data)
+ >>> print serialize(parser.close())
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+ """
+
+def parseliteral():
+ """
>>> element = ET.XML("<html><body>text</body></html>")
>>> ET.ElementTree(element).write(sys.stdout)
<html><body>text</body></html>
>>> element = ET.fromstring("<html><body>text</body></html>")
>>> ET.ElementTree(element).write(sys.stdout)
<html><body>text</body></html>
+ >>> sequence = ["<html><body>", "text</bo", "dy></html>"]
+ >>> element = ET.fromstringlist(sequence)
>>> print ET.tostring(element)
<html><body>text</body></html>
- >>> print ET.tostring(element, "ascii")
- <?xml version='1.0' encoding='ascii'?>
+ >>> print "".join(ET.tostringlist(element))
<html><body>text</body></html>
+ >>> ET.tostring(element, "ascii")
+ "<?xml version='1.0' encoding='ascii'?>\\n<html><body>text</body></html>"
>>> _, ids = ET.XMLID("<html><body>text</body></html>")
>>> len(ids)
0
@@ -200,20 +646,600 @@ def parseliteral():
'body'
"""
+def iterparse():
+ """
+ Test iterparse interface.
+
+ >>> iterparse = ET.iterparse
+
+ >>> context = iterparse(SIMPLE_XMLFILE)
+ >>> action, elem = next(context)
+ >>> print action, elem.tag
+ end element
+ >>> for action, elem in context:
+ ... print action, elem.tag
+ end element
+ end empty-element
+ end root
+ >>> context.root.tag
+ 'root'
+
+ >>> context = iterparse(SIMPLE_NS_XMLFILE)
+ >>> for action, elem in context:
+ ... print action, elem.tag
+ end {namespace}element
+ end {namespace}element
+ end {namespace}empty-element
+ end {namespace}root
+
+ >>> events = ()
+ >>> context = iterparse(SIMPLE_XMLFILE, events)
+ >>> for action, elem in context:
+ ... print action, elem.tag
+
+ >>> events = ()
+ >>> context = iterparse(SIMPLE_XMLFILE, events=events)
+ >>> for action, elem in context:
+ ... print action, elem.tag
-def check_encoding(ET, encoding):
+ >>> events = ("start", "end")
+ >>> context = iterparse(SIMPLE_XMLFILE, events)
+ >>> for action, elem in context:
+ ... print action, elem.tag
+ start root
+ start element
+ end element
+ start element
+ end element
+ start empty-element
+ end empty-element
+ end root
+
+ >>> events = ("start", "end", "start-ns", "end-ns")
+ >>> context = iterparse(SIMPLE_NS_XMLFILE, events)
+ >>> for action, elem in context:
+ ... if action in ("start", "end"):
+ ... print action, elem.tag
+ ... else:
+ ... print action, elem
+ start-ns ('', 'namespace')
+ start {namespace}root
+ start {namespace}element
+ end {namespace}element
+ start {namespace}element
+ end {namespace}element
+ start {namespace}empty-element
+ end {namespace}empty-element
+ end {namespace}root
+ end-ns None
+
+ >>> events = ("start", "end", "bogus")
+ >>> with open(SIMPLE_XMLFILE, "rb") as f:
+ ... iterparse(f, events)
+ Traceback (most recent call last):
+ ValueError: unknown event 'bogus'
+
+ >>> import StringIO
+
+ >>> source = StringIO.StringIO(
+ ... "<?xml version='1.0' encoding='iso-8859-1'?>\\n"
+ ... "<body xmlns='http://&#233;ffbot.org/ns'\\n"
+ ... " xmlns:cl\\xe9='http://effbot.org/ns'>text</body>\\n")
+ >>> events = ("start-ns",)
+ >>> context = iterparse(source, events)
+ >>> for action, elem in context:
+ ... print action, elem
+ start-ns ('', u'http://\\xe9ffbot.org/ns')
+ start-ns (u'cl\\xe9', 'http://effbot.org/ns')
+
+ >>> source = StringIO.StringIO("<document />junk")
+ >>> try:
+ ... for action, elem in iterparse(source):
+ ... print action, elem.tag
+ ... except ET.ParseError, v:
+ ... print v
+ junk after document element: line 1, column 12
+ """
+
+def writefile():
+ """
+ >>> elem = ET.Element("tag")
+ >>> elem.text = "text"
+ >>> serialize(elem)
+ '<tag>text</tag>'
+ >>> ET.SubElement(elem, "subtag").text = "subtext"
+ >>> serialize(elem)
+ '<tag>text<subtag>subtext</subtag></tag>'
+
+ Test tag suppression
+ >>> elem.tag = None
+ >>> serialize(elem)
+ 'text<subtag>subtext</subtag>'
+ >>> elem.insert(0, ET.Comment("comment"))
+ >>> serialize(elem) # assumes 1.3
+ 'text<!--comment--><subtag>subtext</subtag>'
+ >>> elem[0] = ET.PI("key", "value")
+ >>> serialize(elem)
+ 'text<?key value?><subtag>subtext</subtag>'
+ """
+
+def custom_builder():
+ """
+ Test parser w. custom builder.
+
+ >>> with open(SIMPLE_XMLFILE) as f:
+ ... data = f.read()
+ >>> class Builder:
+ ... def start(self, tag, attrib):
+ ... print "start", tag
+ ... def end(self, tag):
+ ... print "end", tag
+ ... def data(self, text):
+ ... pass
+ >>> builder = Builder()
+ >>> parser = ET.XMLParser(target=builder)
+ >>> parser.feed(data)
+ start root
+ start element
+ end element
+ start element
+ end element
+ start empty-element
+ end empty-element
+ end root
+
+ >>> with open(SIMPLE_NS_XMLFILE) as f:
+ ... data = f.read()
+ >>> class Builder:
+ ... def start(self, tag, attrib):
+ ... print "start", tag
+ ... def end(self, tag):
+ ... print "end", tag
+ ... def data(self, text):
+ ... pass
+ ... def pi(self, target, data):
+ ... print "pi", target, repr(data)
+ ... def comment(self, data):
+ ... print "comment", repr(data)
+ >>> builder = Builder()
+ >>> parser = ET.XMLParser(target=builder)
+ >>> parser.feed(data)
+ pi pi 'data'
+ comment ' comment '
+ start {namespace}root
+ start {namespace}element
+ end {namespace}element
+ start {namespace}element
+ end {namespace}element
+ start {namespace}empty-element
+ end {namespace}empty-element
+ end {namespace}root
+
+ """
+
+def getchildren():
+ """
+ Test Element.getchildren()
+
+ >>> with open(SIMPLE_XMLFILE, "r") as f:
+ ... tree = ET.parse(f)
+ >>> for elem in tree.getroot().iter():
+ ... summarize_list(elem.getchildren())
+ ['element', 'element', 'empty-element']
+ []
+ []
+ []
+ >>> for elem in tree.getiterator():
+ ... summarize_list(elem.getchildren())
+ ['element', 'element', 'empty-element']
+ []
+ []
+ []
+
+ >>> elem = ET.XML(SAMPLE_XML)
+ >>> len(elem.getchildren())
+ 3
+ >>> len(elem[2].getchildren())
+ 1
+ >>> elem[:] == elem.getchildren()
+ True
+ >>> child1 = elem[0]
+ >>> child2 = elem[2]
+ >>> del elem[1:2]
+ >>> len(elem.getchildren())
+ 2
+ >>> child1 == elem[0]
+ True
+ >>> child2 == elem[1]
+ True
+ >>> elem[0:2] = [child2, child1]
+ >>> child2 == elem[0]
+ True
+ >>> child1 == elem[1]
+ True
+ >>> child1 == elem[0]
+ False
+ >>> elem.clear()
+ >>> elem.getchildren()
+ []
+ """
+
+def writestring():
+ """
+ >>> elem = ET.XML("<html><body>text</body></html>")
+ >>> ET.tostring(elem)
+ '<html><body>text</body></html>'
+ >>> elem = ET.fromstring("<html><body>text</body></html>")
+ >>> ET.tostring(elem)
+ '<html><body>text</body></html>'
"""
- >>> from xml.etree import ElementTree as ET
- >>> check_encoding(ET, "ascii")
- >>> check_encoding(ET, "us-ascii")
- >>> check_encoding(ET, "iso-8859-1")
- >>> check_encoding(ET, "iso-8859-15")
- >>> check_encoding(ET, "cp437")
- >>> check_encoding(ET, "mac-roman")
+def check_encoding(encoding):
+ """
+ >>> check_encoding("ascii")
+ >>> check_encoding("us-ascii")
+ >>> check_encoding("iso-8859-1")
+ >>> check_encoding("iso-8859-15")
+ >>> check_encoding("cp437")
+ >>> check_encoding("mac-roman")
"""
ET.XML("<?xml version='1.0' encoding='%s'?><xml />" % encoding)
+def encoding():
+ r"""
+ Test encoding issues.
+
+ >>> elem = ET.Element("tag")
+ >>> elem.text = u"abc"
+ >>> serialize(elem)
+ '<tag>abc</tag>'
+ >>> serialize(elem, encoding="utf-8")
+ '<tag>abc</tag>'
+ >>> serialize(elem, encoding="us-ascii")
+ '<tag>abc</tag>'
+ >>> serialize(elem, encoding="iso-8859-1")
+ "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>abc</tag>"
+
+ >>> elem.text = "<&\"\'>"
+ >>> serialize(elem)
+ '<tag>&lt;&amp;"\'&gt;</tag>'
+ >>> serialize(elem, encoding="utf-8")
+ '<tag>&lt;&amp;"\'&gt;</tag>'
+ >>> serialize(elem, encoding="us-ascii") # cdata characters
+ '<tag>&lt;&amp;"\'&gt;</tag>'
+ >>> serialize(elem, encoding="iso-8859-1")
+ '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag>&lt;&amp;"\'&gt;</tag>'
+
+ >>> elem.attrib["key"] = "<&\"\'>"
+ >>> elem.text = None
+ >>> serialize(elem)
+ '<tag key="&lt;&amp;&quot;\'&gt;" />'
+ >>> serialize(elem, encoding="utf-8")
+ '<tag key="&lt;&amp;&quot;\'&gt;" />'
+ >>> serialize(elem, encoding="us-ascii")
+ '<tag key="&lt;&amp;&quot;\'&gt;" />'
+ >>> serialize(elem, encoding="iso-8859-1")
+ '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="&lt;&amp;&quot;\'&gt;" />'
+
+ >>> elem.text = u'\xe5\xf6\xf6<>'
+ >>> elem.attrib.clear()
+ >>> serialize(elem)
+ '<tag>&#229;&#246;&#246;&lt;&gt;</tag>'
+ >>> serialize(elem, encoding="utf-8")
+ '<tag>\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;</tag>'
+ >>> serialize(elem, encoding="us-ascii")
+ '<tag>&#229;&#246;&#246;&lt;&gt;</tag>'
+ >>> serialize(elem, encoding="iso-8859-1")
+ "<?xml version='1.0' encoding='iso-8859-1'?>\n<tag>\xe5\xf6\xf6&lt;&gt;</tag>"
+
+ >>> elem.attrib["key"] = u'\xe5\xf6\xf6<>'
+ >>> elem.text = None
+ >>> serialize(elem)
+ '<tag key="&#229;&#246;&#246;&lt;&gt;" />'
+ >>> serialize(elem, encoding="utf-8")
+ '<tag key="\xc3\xa5\xc3\xb6\xc3\xb6&lt;&gt;" />'
+ >>> serialize(elem, encoding="us-ascii")
+ '<tag key="&#229;&#246;&#246;&lt;&gt;" />'
+ >>> serialize(elem, encoding="iso-8859-1")
+ '<?xml version=\'1.0\' encoding=\'iso-8859-1\'?>\n<tag key="\xe5\xf6\xf6&lt;&gt;" />'
+ """
+
+def methods():
+ r"""
+ Test serialization methods.
+
+ >>> e = ET.XML("<html><link/><script>1 &lt; 2</script></html>")
+ >>> e.tail = "\n"
+ >>> serialize(e)
+ '<html><link /><script>1 &lt; 2</script></html>\n'
+ >>> serialize(e, method=None)
+ '<html><link /><script>1 &lt; 2</script></html>\n'
+ >>> serialize(e, method="xml")
+ '<html><link /><script>1 &lt; 2</script></html>\n'
+ >>> serialize(e, method="html")
+ '<html><link><script>1 < 2</script></html>\n'
+ >>> serialize(e, method="text")
+ '1 < 2\n'
+ """
+
+def iterators():
+ """
+ Test iterators.
+
+ >>> e = ET.XML("<html><body>this is a <i>paragraph</i>.</body>..</html>")
+ >>> summarize_list(e.iter())
+ ['html', 'body', 'i']
+ >>> summarize_list(e.find("body").iter())
+ ['body', 'i']
+ >>> summarize(next(e.iter()))
+ 'html'
+ >>> "".join(e.itertext())
+ 'this is a paragraph...'
+ >>> "".join(e.find("body").itertext())
+ 'this is a paragraph.'
+ >>> next(e.itertext())
+ 'this is a '
+
+ Method iterparse should return an iterator. See bug 6472.
+
+ >>> sourcefile = serialize(e, to_string=False)
+ >>> next(ET.iterparse(sourcefile)) # doctest: +ELLIPSIS
+ ('end', <Element 'i' at 0x...>)
+
+ >>> tree = ET.ElementTree(None)
+ >>> tree.iter()
+ Traceback (most recent call last):
+ AttributeError: 'NoneType' object has no attribute 'iter'
+ """
+
+ENTITY_XML = """\
+<!DOCTYPE points [
+<!ENTITY % user-entities SYSTEM 'user-entities.xml'>
+%user-entities;
+]>
+<document>&entity;</document>
+"""
+
+def entity():
+ """
+ Test entity handling.
+
+ 1) good entities
+
+ >>> e = ET.XML("<document title='&#x8230;'>test</document>")
+ >>> serialize(e)
+ '<document title="&#33328;">test</document>'
+
+ 2) bad entities
+
+ >>> ET.XML("<document>&entity;</document>")
+ Traceback (most recent call last):
+ ParseError: undefined entity: line 1, column 10
+
+ >>> ET.XML(ENTITY_XML)
+ Traceback (most recent call last):
+ ParseError: undefined entity &entity;: line 5, column 10
+
+ 3) custom entity
+
+ >>> parser = ET.XMLParser()
+ >>> parser.entity["entity"] = "text"
+ >>> parser.feed(ENTITY_XML)
+ >>> root = parser.close()
+ >>> serialize(root)
+ '<document>text</document>'
+ """
+
+def error(xml):
+ """
+
+ Test error handling.
+
+ >>> issubclass(ET.ParseError, SyntaxError)
+ True
+ >>> error("foo").position
+ (1, 0)
+ >>> error("<tag>&foo;</tag>").position
+ (1, 5)
+ >>> error("foobar<").position
+ (1, 6)
+
+ """
+ try:
+ ET.XML(xml)
+ except ET.ParseError:
+ return sys.exc_value
+
+def namespace():
+ """
+ Test namespace issues.
+
+ 1) xml namespace
+
+ >>> elem = ET.XML("<tag xml:lang='en' />")
+ >>> serialize(elem) # 1.1
+ '<tag xml:lang="en" />'
+
+ 2) other "well-known" namespaces
+
+ >>> elem = ET.XML("<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' />")
+ >>> serialize(elem) # 2.1
+ '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" />'
+
+ >>> elem = ET.XML("<html:html xmlns:html='http://www.w3.org/1999/xhtml' />")
+ >>> serialize(elem) # 2.2
+ '<html:html xmlns:html="http://www.w3.org/1999/xhtml" />'
+
+ >>> elem = ET.XML("<soap:Envelope xmlns:soap='http://schemas.xmlsoap.org/soap/envelope' />")
+ >>> serialize(elem) # 2.3
+ '<ns0:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope" />'
+
+ 3) unknown namespaces
+ >>> elem = ET.XML(SAMPLE_XML_NS)
+ >>> print serialize(elem)
+ <ns0:body xmlns:ns0="http://effbot.org/ns">
+ <ns0:tag>text</ns0:tag>
+ <ns0:tag />
+ <ns0:section>
+ <ns0:tag>subtext</ns0:tag>
+ </ns0:section>
+ </ns0:body>
+ """
+
+def qname():
+ """
+ Test QName handling.
+
+ 1) decorated tags
+
+ >>> elem = ET.Element("{uri}tag")
+ >>> serialize(elem) # 1.1
+ '<ns0:tag xmlns:ns0="uri" />'
+ >>> elem = ET.Element(ET.QName("{uri}tag"))
+ >>> serialize(elem) # 1.2
+ '<ns0:tag xmlns:ns0="uri" />'
+ >>> elem = ET.Element(ET.QName("uri", "tag"))
+ >>> serialize(elem) # 1.3
+ '<ns0:tag xmlns:ns0="uri" />'
+ >>> elem = ET.Element(ET.QName("uri", "tag"))
+ >>> subelem = ET.SubElement(elem, ET.QName("uri", "tag1"))
+ >>> subelem = ET.SubElement(elem, ET.QName("uri", "tag2"))
+ >>> serialize(elem) # 1.4
+ '<ns0:tag xmlns:ns0="uri"><ns0:tag1 /><ns0:tag2 /></ns0:tag>'
+
+ 2) decorated attributes
+
+ >>> elem.clear()
+ >>> elem.attrib["{uri}key"] = "value"
+ >>> serialize(elem) # 2.1
+ '<ns0:tag xmlns:ns0="uri" ns0:key="value" />'
+
+ >>> elem.clear()
+ >>> elem.attrib[ET.QName("{uri}key")] = "value"
+ >>> serialize(elem) # 2.2
+ '<ns0:tag xmlns:ns0="uri" ns0:key="value" />'
+
+ 3) decorated values are not converted by default, but the
+ QName wrapper can be used for values
+
+ >>> elem.clear()
+ >>> elem.attrib["{uri}key"] = "{uri}value"
+ >>> serialize(elem) # 3.1
+ '<ns0:tag xmlns:ns0="uri" ns0:key="{uri}value" />'
+
+ >>> elem.clear()
+ >>> elem.attrib["{uri}key"] = ET.QName("{uri}value")
+ >>> serialize(elem) # 3.2
+ '<ns0:tag xmlns:ns0="uri" ns0:key="ns0:value" />'
+
+ >>> elem.clear()
+ >>> subelem = ET.Element("tag")
+ >>> subelem.attrib["{uri1}key"] = ET.QName("{uri2}value")
+ >>> elem.append(subelem)
+ >>> elem.append(subelem)
+ >>> serialize(elem) # 3.3
+ '<ns0:tag xmlns:ns0="uri" xmlns:ns1="uri1" xmlns:ns2="uri2"><tag ns1:key="ns2:value" /><tag ns1:key="ns2:value" /></ns0:tag>'
+
+ 4) Direct QName tests
+
+ >>> str(ET.QName('ns', 'tag'))
+ '{ns}tag'
+ >>> str(ET.QName('{ns}tag'))
+ '{ns}tag'
+ >>> q1 = ET.QName('ns', 'tag')
+ >>> q2 = ET.QName('ns', 'tag')
+ >>> q1 == q2
+ True
+ >>> q2 = ET.QName('ns', 'other-tag')
+ >>> q1 == q2
+ False
+ >>> q1 == 'ns:tag'
+ False
+ >>> q1 == '{ns}tag'
+ True
+ """
+
+def doctype_public():
+ """
+ Test PUBLIC doctype.
+
+ >>> elem = ET.XML('<!DOCTYPE html PUBLIC'
+ ... ' "-//W3C//DTD XHTML 1.0 Transitional//EN"'
+ ... ' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
+ ... '<html>text</html>')
+
+ """
+
+def xpath_tokenizer(p):
+ """
+ Test the XPath tokenizer.
+
+ >>> # tests from the xml specification
+ >>> xpath_tokenizer("*")
+ ['*']
+ >>> xpath_tokenizer("text()")
+ ['text', '()']
+ >>> xpath_tokenizer("@name")
+ ['@', 'name']
+ >>> xpath_tokenizer("@*")
+ ['@', '*']
+ >>> xpath_tokenizer("para[1]")
+ ['para', '[', '1', ']']
+ >>> xpath_tokenizer("para[last()]")
+ ['para', '[', 'last', '()', ']']
+ >>> xpath_tokenizer("*/para")
+ ['*', '/', 'para']
+ >>> xpath_tokenizer("/doc/chapter[5]/section[2]")
+ ['/', 'doc', '/', 'chapter', '[', '5', ']', '/', 'section', '[', '2', ']']
+ >>> xpath_tokenizer("chapter//para")
+ ['chapter', '//', 'para']
+ >>> xpath_tokenizer("//para")
+ ['//', 'para']
+ >>> xpath_tokenizer("//olist/item")
+ ['//', 'olist', '/', 'item']
+ >>> xpath_tokenizer(".")
+ ['.']
+ >>> xpath_tokenizer(".//para")
+ ['.', '//', 'para']
+ >>> xpath_tokenizer("..")
+ ['..']
+ >>> xpath_tokenizer("../@lang")
+ ['..', '/', '@', 'lang']
+ >>> xpath_tokenizer("chapter[title]")
+ ['chapter', '[', 'title', ']']
+ >>> xpath_tokenizer("employee[@secretary and @assistant]")
+ ['employee', '[', '@', 'secretary', '', 'and', '', '@', 'assistant', ']']
+
+ >>> # additional tests
+ >>> xpath_tokenizer("{http://spam}egg")
+ ['{http://spam}egg']
+ >>> xpath_tokenizer("./spam.egg")
+ ['.', '/', 'spam.egg']
+ >>> xpath_tokenizer(".//{http://spam}egg")
+ ['.', '//', '{http://spam}egg']
+ """
+ from xml.etree import ElementPath
+ out = []
+ for op, tag in ElementPath.xpath_tokenizer(p):
+ out.append(op or tag)
+ return out
+
+def processinginstruction():
+ """
+ Test ProcessingInstruction directly
+
+ >>> ET.tostring(ET.ProcessingInstruction('test', 'instruction'))
+ '<?test instruction?>'
+ >>> ET.tostring(ET.PI('test', 'instruction'))
+ '<?test instruction?>'
+
+ Issue #2746
+
+ >>> ET.tostring(ET.PI('test', '<testing&>'))
+ '<?test <testing&>?>'
+ >>> ET.tostring(ET.PI('test', u'<testing&>\xe3'), 'latin1')
+ "<?xml version='1.0' encoding='latin1'?>\\n<?test <testing&>\\xe3?>"
+ """
#
# xinclude tests (samples from appendix C of the xinclude specification)
@@ -247,6 +1273,14 @@ XINCLUDE["C2.xml"] = """\
XINCLUDE["count.txt"] = "324387"
+XINCLUDE["C2b.xml"] = """\
+<?xml version='1.0'?>
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+ <p>This document has been <em>accessed</em>
+ <xi:include href="count.txt" parse="text"/> times.</p>
+</document>
+"""
+
XINCLUDE["C3.xml"] = """\
<?xml version='1.0'?>
<document xmlns:xi="http://www.w3.org/2001/XInclude">
@@ -279,9 +1313,9 @@ XINCLUDE["default.xml"] = """\
<?xml version='1.0'?>
<document xmlns:xi="http://www.w3.org/2001/XInclude">
<p>Example.</p>
- <xi:include href="samples/simple.xml"/>
+ <xi:include href="{}"/>
</document>
-"""
+""".format(cgi.escape(SIMPLE_XMLFILE, True))
def xinclude_loader(href, parse="xml", encoding=None):
try:
@@ -302,7 +1336,7 @@ def xinclude():
>>> document = xinclude_loader("C1.xml")
>>> ElementInclude.include(document, xinclude_loader)
- >>> print serialize(ET, document) # C1
+ >>> print serialize(document) # C1
<document>
<p>120 Mz is adequate for an average home user.</p>
<disclaimer>
@@ -316,17 +1350,27 @@ def xinclude():
>>> document = xinclude_loader("C2.xml")
>>> ElementInclude.include(document, xinclude_loader)
- >>> print serialize(ET, document) # C2
+ >>> print serialize(document) # C2
<document>
<p>This document has been accessed
324387 times.</p>
</document>
+ Textual inclusion after sibling element (based on modified XInclude C.2)
+
+ >>> document = xinclude_loader("C2b.xml")
+ >>> ElementInclude.include(document, xinclude_loader)
+ >>> print(serialize(document)) # C2b
+ <document>
+ <p>This document has been <em>accessed</em>
+ 324387 times.</p>
+ </document>
+
Textual inclusion of XML example (XInclude C.3)
>>> document = xinclude_loader("C3.xml")
>>> ElementInclude.include(document, xinclude_loader)
- >>> print serialize(ET, document) # C3
+ >>> print serialize(document) # C3
<document>
<p>The following is the source of the "data.xml" resource:</p>
<example>&lt;?xml version='1.0'?&gt;
@@ -343,13 +1387,500 @@ def xinclude():
>>> ElementInclude.include(document, xinclude_loader)
Traceback (most recent call last):
IOError: resource not found
- >>> # print serialize(ET, document) # C5
+ >>> # print serialize(document) # C5
+ """
+
+def xinclude_default():
+ """
+ >>> from xml.etree import ElementInclude
+
+ >>> document = xinclude_loader("default.xml")
+ >>> ElementInclude.include(document)
+ >>> print serialize(document) # default
+ <document>
+ <p>Example.</p>
+ <root>
+ <element key="value">text</element>
+ <element>text</element>tail
+ <empty-element />
+ </root>
+ </document>
+ """
+
+#
+# badly formatted xi:include tags
+
+XINCLUDE_BAD = {}
+
+XINCLUDE_BAD["B1.xml"] = """\
+<?xml version='1.0'?>
+<document xmlns:xi="http://www.w3.org/2001/XInclude">
+ <p>120 Mz is adequate for an average home user.</p>
+ <xi:include href="disclaimer.xml" parse="BAD_TYPE"/>
+</document>
+"""
+
+XINCLUDE_BAD["B2.xml"] = """\
+<?xml version='1.0'?>
+<div xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:fallback></xi:fallback>
+</div>
+"""
+
+def xinclude_failures():
+ r"""
+ Test failure to locate included XML file.
+
+ >>> from xml.etree import ElementInclude
+
+ >>> def none_loader(href, parser, encoding=None):
+ ... return None
+
+ >>> document = ET.XML(XINCLUDE["C1.xml"])
+ >>> ElementInclude.include(document, loader=none_loader)
+ Traceback (most recent call last):
+ FatalIncludeError: cannot load 'disclaimer.xml' as 'xml'
+
+ Test failure to locate included text file.
+
+ >>> document = ET.XML(XINCLUDE["C2.xml"])
+ >>> ElementInclude.include(document, loader=none_loader)
+ Traceback (most recent call last):
+ FatalIncludeError: cannot load 'count.txt' as 'text'
+
+ Test bad parse type.
+
+ >>> document = ET.XML(XINCLUDE_BAD["B1.xml"])
+ >>> ElementInclude.include(document, loader=none_loader)
+ Traceback (most recent call last):
+ FatalIncludeError: unknown parse type in xi:include tag ('BAD_TYPE')
+
+ Test xi:fallback outside xi:include.
+
+ >>> document = ET.XML(XINCLUDE_BAD["B2.xml"])
+ >>> ElementInclude.include(document, loader=none_loader)
+ Traceback (most recent call last):
+ FatalIncludeError: xi:fallback tag must be child of xi:include ('{http://www.w3.org/2001/XInclude}fallback')
+ """
+
+# --------------------------------------------------------------------
+# reported bugs
+
+def bug_xmltoolkit21():
+ """
+
+ marshaller gives obscure errors for non-string values
+
+ >>> elem = ET.Element(123)
+ >>> serialize(elem) # tag
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+ >>> elem = ET.Element("elem")
+ >>> elem.text = 123
+ >>> serialize(elem) # text
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+ >>> elem = ET.Element("elem")
+ >>> elem.tail = 123
+ >>> serialize(elem) # tail
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+ >>> elem = ET.Element("elem")
+ >>> elem.set(123, "123")
+ >>> serialize(elem) # attribute key
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+ >>> elem = ET.Element("elem")
+ >>> elem.set("123", 123)
+ >>> serialize(elem) # attribute value
+ Traceback (most recent call last):
+ TypeError: cannot serialize 123 (type int)
+
+ """
+
+def bug_xmltoolkit25():
+ """
+
+ typo in ElementTree.findtext
+
+ >>> elem = ET.XML(SAMPLE_XML)
+ >>> tree = ET.ElementTree(elem)
+ >>> tree.findtext("tag")
+ 'text'
+ >>> tree.findtext("section/tag")
+ 'subtext'
+
+ """
+
+def bug_xmltoolkit28():
+ """
+
+ .//tag causes exceptions
+
+ >>> tree = ET.XML("<doc><table><tbody/></table></doc>")
+ >>> summarize_list(tree.findall(".//thead"))
+ []
+ >>> summarize_list(tree.findall(".//tbody"))
+ ['tbody']
+
+ """
+
+def bug_xmltoolkitX1():
+ """
+
+ dump() doesn't flush the output buffer
+
+ >>> tree = ET.XML("<doc><table><tbody/></table></doc>")
+ >>> ET.dump(tree); sys.stdout.write("tail")
+ <doc><table><tbody /></table></doc>
+ tail
+
+ """
+
+def bug_xmltoolkit39():
+ """
+
+ non-ascii element and attribute names doesn't work
+
+ >>> tree = ET.XML("<?xml version='1.0' encoding='iso-8859-1'?><t\xe4g />")
+ >>> ET.tostring(tree, "utf-8")
+ '<t\\xc3\\xa4g />'
+
+ >>> tree = ET.XML("<?xml version='1.0' encoding='iso-8859-1'?><tag \xe4ttr='v&#228;lue' />")
+ >>> tree.attrib
+ {u'\\xe4ttr': u'v\\xe4lue'}
+ >>> ET.tostring(tree, "utf-8")
+ '<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />'
+
+ >>> tree = ET.XML("<?xml version='1.0' encoding='iso-8859-1'?><t\xe4g>text</t\xe4g>")
+ >>> ET.tostring(tree, "utf-8")
+ '<t\\xc3\\xa4g>text</t\\xc3\\xa4g>'
+
+ >>> tree = ET.Element(u"t\u00e4g")
+ >>> ET.tostring(tree, "utf-8")
+ '<t\\xc3\\xa4g />'
+
+ >>> tree = ET.Element("tag")
+ >>> tree.set(u"\u00e4ttr", u"v\u00e4lue")
+ >>> ET.tostring(tree, "utf-8")
+ '<tag \\xc3\\xa4ttr="v\\xc3\\xa4lue" />'
+
+ """
+
+def bug_xmltoolkit54():
+ """
+
+ problems handling internally defined entities
+
+ >>> e = ET.XML("<!DOCTYPE doc [<!ENTITY ldots '&#x8230;'>]><doc>&ldots;</doc>")
+ >>> serialize(e)
+ '<doc>&#33328;</doc>'
+
+ """
+
+def bug_xmltoolkit55():
+ """
+
+ make sure we're reporting the first error, not the last
+
+ >>> e = ET.XML("<!DOCTYPE doc SYSTEM 'doc.dtd'><doc>&ldots;&ndots;&rdots;</doc>")
+ Traceback (most recent call last):
+ ParseError: undefined entity &ldots;: line 1, column 36
+
+ """
+
+class ExceptionFile:
+ def read(self, x):
+ raise IOError
+
+def xmltoolkit60():
+ """
+
+ Handle crash in stream source.
+ >>> tree = ET.parse(ExceptionFile())
+ Traceback (most recent call last):
+ IOError
+
+ """
+
+XMLTOOLKIT62_DOC = """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE patent-application-publication SYSTEM "pap-v15-2001-01-31.dtd" []>
+<patent-application-publication>
+<subdoc-abstract>
+<paragraph id="A-0001" lvl="0">A new cultivar of Begonia plant named &lsquo;BCT9801BEG&rsquo;.</paragraph>
+</subdoc-abstract>
+</patent-application-publication>"""
+
+
+def xmltoolkit62():
+ """
+
+ Don't crash when using custom entities.
+
+ >>> xmltoolkit62()
+ u'A new cultivar of Begonia plant named \u2018BCT9801BEG\u2019.'
+
+ """
+ ENTITIES = {u'rsquo': u'\u2019', u'lsquo': u'\u2018'}
+ parser = ET.XMLTreeBuilder()
+ parser.entity.update(ENTITIES)
+ parser.feed(XMLTOOLKIT62_DOC)
+ t = parser.close()
+ return t.find('.//paragraph').text
+
+def xmltoolkit63():
+ """
+
+ Check reference leak.
+ >>> xmltoolkit63()
+ >>> count = sys.getrefcount(None)
+ >>> for i in range(1000):
+ ... xmltoolkit63()
+ >>> sys.getrefcount(None) - count
+ 0
+
+ """
+ tree = ET.TreeBuilder()
+ tree.start("tag", {})
+ tree.data("text")
+ tree.end("tag")
+
+# --------------------------------------------------------------------
+
+
+def bug_200708_newline():
+ r"""
+
+ Preserve newlines in attributes.
+
+ >>> e = ET.Element('SomeTag', text="def _f():\n return 3\n")
+ >>> ET.tostring(e)
+ '<SomeTag text="def _f():&#10; return 3&#10;" />'
+ >>> ET.XML(ET.tostring(e)).get("text")
+ 'def _f():\n return 3\n'
+ >>> ET.tostring(ET.XML(ET.tostring(e)))
+ '<SomeTag text="def _f():&#10; return 3&#10;" />'
+
+ """
+
+def bug_200708_close():
+ """
+
+ Test default builder.
+ >>> parser = ET.XMLParser() # default
+ >>> parser.feed("<element>some text</element>")
+ >>> summarize(parser.close())
+ 'element'
+
+ Test custom builder.
+ >>> class EchoTarget:
+ ... def close(self):
+ ... return ET.Element("element") # simulate root
+ >>> parser = ET.XMLParser(EchoTarget())
+ >>> parser.feed("<element>some text</element>")
+ >>> summarize(parser.close())
+ 'element'
+
+ """
+
+def bug_200709_default_namespace():
+ """
+
+ >>> e = ET.Element("{default}elem")
+ >>> s = ET.SubElement(e, "{default}elem")
+ >>> serialize(e, default_namespace="default") # 1
+ '<elem xmlns="default"><elem /></elem>'
+
+ >>> e = ET.Element("{default}elem")
+ >>> s = ET.SubElement(e, "{default}elem")
+ >>> s = ET.SubElement(e, "{not-default}elem")
+ >>> serialize(e, default_namespace="default") # 2
+ '<elem xmlns="default" xmlns:ns1="not-default"><elem /><ns1:elem /></elem>'
+
+ >>> e = ET.Element("{default}elem")
+ >>> s = ET.SubElement(e, "{default}elem")
+ >>> s = ET.SubElement(e, "elem") # unprefixed name
+ >>> serialize(e, default_namespace="default") # 3
+ Traceback (most recent call last):
+ ValueError: cannot use non-qualified names with default_namespace option
+
+ """
+
+def bug_200709_register_namespace():
+ """
+
+ >>> ET.tostring(ET.Element("{http://namespace.invalid/does/not/exist/}title"))
+ '<ns0:title xmlns:ns0="http://namespace.invalid/does/not/exist/" />'
+ >>> ET.register_namespace("foo", "http://namespace.invalid/does/not/exist/")
+ >>> ET.tostring(ET.Element("{http://namespace.invalid/does/not/exist/}title"))
+ '<foo:title xmlns:foo="http://namespace.invalid/does/not/exist/" />'
+
+ And the Dublin Core namespace is in the default list:
+
+ >>> ET.tostring(ET.Element("{http://purl.org/dc/elements/1.1/}title"))
+ '<dc:title xmlns:dc="http://purl.org/dc/elements/1.1/" />'
+
+ """
+
+def bug_200709_element_comment():
+ """
+
+ Not sure if this can be fixed, really (since the serializer needs
+ ET.Comment, not cET.comment).
+
+ >>> a = ET.Element('a')
+ >>> a.append(ET.Comment('foo'))
+ >>> a[0].tag == ET.Comment
+ True
+
+ >>> a = ET.Element('a')
+ >>> a.append(ET.PI('foo'))
+ >>> a[0].tag == ET.PI
+ True
"""
-def test_main():
+def bug_200709_element_insert():
+ """
+
+ >>> a = ET.Element('a')
+ >>> b = ET.SubElement(a, 'b')
+ >>> c = ET.SubElement(a, 'c')
+ >>> d = ET.Element('d')
+ >>> a.insert(0, d)
+ >>> summarize_list(a)
+ ['d', 'b', 'c']
+ >>> a.insert(-1, d)
+ >>> summarize_list(a)
+ ['d', 'b', 'd', 'c']
+
+ """
+
+def bug_200709_iter_comment():
+ """
+
+ >>> a = ET.Element('a')
+ >>> b = ET.SubElement(a, 'b')
+ >>> comment_b = ET.Comment("TEST-b")
+ >>> b.append(comment_b)
+ >>> summarize_list(a.iter(ET.Comment))
+ ['<Comment>']
+
+ """
+
+# --------------------------------------------------------------------
+# reported on bugs.python.org
+
+def bug_1534630():
+ """
+
+ >>> bob = ET.TreeBuilder()
+ >>> e = bob.data("data")
+ >>> e = bob.start("tag", {})
+ >>> e = bob.end("tag")
+ >>> e = bob.close()
+ >>> serialize(e)
+ '<tag />'
+
+ """
+
+def check_issue6233():
+ """
+
+ >>> e = ET.XML("<?xml version='1.0' encoding='utf-8'?><body>t\\xc3\\xa3g</body>")
+ >>> ET.tostring(e, 'ascii')
+ "<?xml version='1.0' encoding='ascii'?>\\n<body>t&#227;g</body>"
+ >>> e = ET.XML("<?xml version='1.0' encoding='iso-8859-1'?><body>t\\xe3g</body>")
+ >>> ET.tostring(e, 'ascii')
+ "<?xml version='1.0' encoding='ascii'?>\\n<body>t&#227;g</body>"
+
+ """
+
+def check_issue3151():
+ """
+
+ >>> e = ET.XML('<prefix:localname xmlns:prefix="${stuff}"/>')
+ >>> e.tag
+ '{${stuff}}localname'
+ >>> t = ET.ElementTree(e)
+ >>> ET.tostring(e)
+ '<ns0:localname xmlns:ns0="${stuff}" />'
+
+ """
+
+def check_issue6565():
+ """
+
+ >>> elem = ET.XML("<body><tag/></body>")
+ >>> summarize_list(elem)
+ ['tag']
+ >>> newelem = ET.XML(SAMPLE_XML)
+ >>> elem[:] = newelem[:]
+ >>> summarize_list(elem)
+ ['tag', 'tag', 'section']
+
+ """
+
+# --------------------------------------------------------------------
+
+
+class CleanContext(object):
+ """Provide default namespace mapping and path cache."""
+ checkwarnings = None
+
+ def __init__(self, quiet=False):
+ if sys.flags.optimize >= 2:
+ # under -OO, doctests cannot be run and therefore not all warnings
+ # will be emitted
+ quiet = True
+ deprecations = (
+ # Search behaviour is broken if search path starts with "/".
+ ("This search is broken in 1.3 and earlier, and will be fixed "
+ "in a future version. If you rely on the current behaviour, "
+ "change it to '.+'", FutureWarning),
+ # Element.getchildren() and Element.getiterator() are deprecated.
+ ("This method will be removed in future versions. "
+ "Use .+ instead.", DeprecationWarning),
+ ("This method will be removed in future versions. "
+ "Use .+ instead.", PendingDeprecationWarning),
+ # XMLParser.doctype() is deprecated.
+ ("This method of XMLParser is deprecated. Define doctype.. "
+ "method on the TreeBuilder target.", DeprecationWarning))
+ self.checkwarnings = test_support.check_warnings(*deprecations,
+ quiet=quiet)
+
+ def __enter__(self):
+ from xml.etree import ElementTree
+ self._nsmap = ElementTree._namespace_map
+ self._path_cache = ElementTree.ElementPath._cache
+ # Copy the default namespace mapping
+ ElementTree._namespace_map = self._nsmap.copy()
+ # Copy the path cache (should be empty)
+ ElementTree.ElementPath._cache = self._path_cache.copy()
+ self.checkwarnings.__enter__()
+
+ def __exit__(self, *args):
+ from xml.etree import ElementTree
+ # Restore mapping and path cache
+ ElementTree._namespace_map = self._nsmap
+ ElementTree.ElementPath._cache = self._path_cache
+ self.checkwarnings.__exit__(*args)
+
+
+def test_main(module_name='xml.etree.ElementTree'):
from test import test_xml_etree
- test_support.run_doctest(test_xml_etree, verbosity=True)
+
+ use_py_module = (module_name == 'xml.etree.ElementTree')
+
+ # The same doctests are used for both the Python and the C implementations
+ assert test_xml_etree.ET.__name__ == module_name
+
+ # XXX the C module should give the same warnings as the Python module
+ with CleanContext(quiet=not use_py_module):
+ test_support.run_doctest(test_xml_etree, verbosity=True)
+
+ # The module should not be changed by the tests
+ assert test_xml_etree.ET.__name__ == module_name
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py
index 7c570001d0..474a4b4e18 100644
--- a/Lib/test/test_xml_etree_c.py
+++ b/Lib/test/test_xml_etree_c.py
@@ -1,31 +1,13 @@
# xml.etree test for cElementTree
-import doctest
-import sys
-
from test import test_support
+from test.test_support import precisionbigmemtest, _2G
+import unittest
-from xml.etree import cElementTree as ET
+cET = test_support.import_module('xml.etree.cElementTree')
-SAMPLE_XML = """
-<body>
- <tag>text</tag>
- <tag />
- <section>
- <tag>subtext</tag>
- </section>
-</body>
-"""
-SAMPLE_XML_NS = """
-<body xmlns="http://effbot.org/ns">
- <tag>text</tag>
- <tag />
- <section>
- <tag>subtext</tag>
- </section>
-</body>
-"""
+# cElementTree specific tests
def sanity():
"""
@@ -34,191 +16,40 @@ def sanity():
>>> from xml.etree import cElementTree
"""
-def check_method(method):
- if not hasattr(method, '__call__'):
- print method, "not callable"
-
-def serialize(ET, elem, encoding=None):
- import StringIO
- file = StringIO.StringIO()
- tree = ET.ElementTree(elem)
- if encoding:
- tree.write(file, encoding)
- else:
- tree.write(file)
- return file.getvalue()
-
-def summarize(elem):
- return elem.tag
-
-def summarize_list(seq):
- return map(summarize, seq)
-
-def interface():
- """
- Test element tree interface.
-
- >>> element = ET.Element("tag", key="value")
- >>> tree = ET.ElementTree(element)
- Make sure all standard element methods exist.
+class MiscTests(unittest.TestCase):
+ # Issue #8651.
+ @precisionbigmemtest(size=_2G + 100, memuse=1)
+ def test_length_overflow(self, size):
+ if size < _2G + 100:
+ self.skipTest("not enough free memory, need at least 2 GB")
+ data = b'x' * size
+ parser = cET.XMLParser()
+ try:
+ self.assertRaises(OverflowError, parser.feed, data)
+ finally:
+ data = None
- >>> check_method(element.append)
- >>> check_method(element.insert)
- >>> check_method(element.remove)
- >>> check_method(element.getchildren)
- >>> check_method(element.find)
- >>> check_method(element.findall)
- >>> check_method(element.findtext)
- >>> check_method(element.clear)
- >>> check_method(element.get)
- >>> check_method(element.set)
- >>> check_method(element.keys)
- >>> check_method(element.items)
- >>> check_method(element.getiterator)
-
- Basic method sanity checks.
-
- >>> serialize(ET, element) # 1
- '<tag key="value" />'
- >>> subelement = ET.Element("subtag")
- >>> element.append(subelement)
- >>> serialize(ET, element) # 2
- '<tag key="value"><subtag /></tag>'
- >>> element.insert(0, subelement)
- >>> serialize(ET, element) # 3
- '<tag key="value"><subtag /><subtag /></tag>'
- >>> element.remove(subelement)
- >>> serialize(ET, element) # 4
- '<tag key="value"><subtag /></tag>'
- >>> element.remove(subelement)
- >>> serialize(ET, element) # 5
- '<tag key="value" />'
- >>> element.remove(subelement)
- Traceback (most recent call last):
- ValueError: list.remove(x): x not in list
- >>> serialize(ET, element) # 6
- '<tag key="value" />'
- """
-
-def find():
- """
- Test find methods (including xpath syntax).
-
- >>> elem = ET.XML(SAMPLE_XML)
- >>> elem.find("tag").tag
- 'tag'
- >>> ET.ElementTree(elem).find("tag").tag
- 'tag'
- >>> elem.find("section/tag").tag
- 'tag'
- >>> ET.ElementTree(elem).find("section/tag").tag
- 'tag'
- >>> elem.findtext("tag")
- 'text'
- >>> elem.findtext("tog")
- >>> elem.findtext("tog", "default")
- 'default'
- >>> ET.ElementTree(elem).findtext("tag")
- 'text'
- >>> elem.findtext("section/tag")
- 'subtext'
- >>> ET.ElementTree(elem).findtext("section/tag")
- 'subtext'
- >>> summarize_list(elem.findall("tag"))
- ['tag', 'tag']
- >>> summarize_list(elem.findall("*"))
- ['tag', 'tag', 'section']
- >>> summarize_list(elem.findall(".//tag"))
- ['tag', 'tag', 'tag']
- >>> summarize_list(elem.findall("section/tag"))
- ['tag']
- >>> summarize_list(elem.findall("section//tag"))
- ['tag']
- >>> summarize_list(elem.findall("section/*"))
- ['tag']
- >>> summarize_list(elem.findall("section//*"))
- ['tag']
- >>> summarize_list(elem.findall("section/.//*"))
- ['tag']
- >>> summarize_list(elem.findall("*/*"))
- ['tag']
- >>> summarize_list(elem.findall("*//*"))
- ['tag']
- >>> summarize_list(elem.findall("*/tag"))
- ['tag']
- >>> summarize_list(elem.findall("*/./tag"))
- ['tag']
- >>> summarize_list(elem.findall("./tag"))
- ['tag', 'tag']
- >>> summarize_list(elem.findall(".//tag"))
- ['tag', 'tag', 'tag']
- >>> summarize_list(elem.findall("././tag"))
- ['tag', 'tag']
- >>> summarize_list(ET.ElementTree(elem).findall("/tag"))
- ['tag', 'tag']
- >>> summarize_list(ET.ElementTree(elem).findall("./tag"))
- ['tag', 'tag']
- >>> elem = ET.XML(SAMPLE_XML_NS)
- >>> summarize_list(elem.findall("tag"))
- []
- >>> summarize_list(elem.findall("{http://effbot.org/ns}tag"))
- ['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag']
- >>> summarize_list(elem.findall(".//{http://effbot.org/ns}tag"))
- ['{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag', '{http://effbot.org/ns}tag']
- """
-
-def parseliteral():
- r"""
-
- >>> element = ET.XML("<html><body>text</body></html>")
- >>> ET.ElementTree(element).write(sys.stdout)
- <html><body>text</body></html>
- >>> element = ET.fromstring("<html><body>text</body></html>")
- >>> ET.ElementTree(element).write(sys.stdout)
- <html><body>text</body></html>
- >>> print ET.tostring(element)
- <html><body>text</body></html>
- >>> print ET.tostring(element, "ascii")
- <?xml version='1.0' encoding='ascii'?>
- <html><body>text</body></html>
- >>> _, ids = ET.XMLID("<html><body>text</body></html>")
- >>> len(ids)
- 0
- >>> _, ids = ET.XMLID("<html><body id='body'>text</body></html>")
- >>> len(ids)
- 1
- >>> ids["body"].tag
- 'body'
- """
-
-def check_encoding(encoding):
- """
- >>> check_encoding("ascii")
- >>> check_encoding("us-ascii")
- >>> check_encoding("iso-8859-1")
- >>> check_encoding("iso-8859-15")
- >>> check_encoding("cp437")
- >>> check_encoding("mac-roman")
- """
- ET.XML(
- "<?xml version='1.0' encoding='%s'?><xml />" % encoding
- )
-
-def bug_1534630():
- """
- >>> bob = ET.TreeBuilder()
- >>> e = bob.data("data")
- >>> e = bob.start("tag", {})
- >>> e = bob.end("tag")
- >>> e = bob.close()
- >>> serialize(ET, e)
- '<tag />'
- """
def test_main():
- from test import test_xml_etree_c
+ from test import test_xml_etree, test_xml_etree_c
+
+ # Run the tests specific to the C implementation
test_support.run_doctest(test_xml_etree_c, verbosity=True)
+ # Assign the C implementation before running the doctests
+ # Patch the __name__, to prevent confusion with the pure Python test
+ pyET = test_xml_etree.ET
+ py__name__ = test_xml_etree.__name__
+ test_xml_etree.ET = cET
+ if __name__ != '__main__':
+ test_xml_etree.__name__ = __name__
+ try:
+ # Run the same test suite as xml.etree.ElementTree
+ test_xml_etree.test_main(module_name='xml.etree.cElementTree')
+ finally:
+ test_xml_etree.ET = pyET
+ test_xml_etree.__name__ = py__name__
+
if __name__ == '__main__':
test_main()
diff --git a/Lib/test/test_xmllib.py b/Lib/test/test_xmllib.py
index 68b883a0e5..966978a92d 100644
--- a/Lib/test/test_xmllib.py
+++ b/Lib/test/test_xmllib.py
@@ -36,9 +36,9 @@ class XMLParserTestCase(unittest.TestCase):
h.feed(nsdoc)
h.close()
# The default namespace applies to elements...
- self.assertEquals(h.name, "URI foo")
+ self.assertEqual(h.name, "URI foo")
# but not to attributes
- self.assertEquals(h.attr, {'attr':'val'})
+ self.assertEqual(h.attr, {'attr':'val'})
def test_main():
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index b9ac2e79ca..6310c97bd7 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -5,16 +5,20 @@ import time
import unittest
import xmlrpclib
import SimpleXMLRPCServer
-import threading
import mimetools
import httplib
import socket
import StringIO
import os
-from imp import reload
+import re
from test import test_support
try:
+ import threading
+except ImportError:
+ threading = None
+
+try:
unicode
except NameError:
have_unicode = False
@@ -40,8 +44,8 @@ alist = [{'astring': 'foo@bar.baz.spam',
class XMLRPCTestCase(unittest.TestCase):
def test_dump_load(self):
- self.assertEquals(alist,
- xmlrpclib.loads(xmlrpclib.dumps((alist,)))[0][0])
+ self.assertEqual(alist,
+ xmlrpclib.loads(xmlrpclib.dumps((alist,)))[0][0])
def test_dump_bare_datetime(self):
# This checks that an unwrapped datetime.date object can be handled
@@ -51,41 +55,41 @@ class XMLRPCTestCase(unittest.TestCase):
dt = datetime.datetime(2005, 02, 10, 11, 41, 23)
s = xmlrpclib.dumps((dt,))
(newdt,), m = xmlrpclib.loads(s, use_datetime=1)
- self.assertEquals(newdt, dt)
- self.assertEquals(m, None)
+ self.assertEqual(newdt, dt)
+ self.assertEqual(m, None)
(newdt,), m = xmlrpclib.loads(s, use_datetime=0)
- self.assertEquals(newdt, xmlrpclib.DateTime('20050210T11:41:23'))
+ self.assertEqual(newdt, xmlrpclib.DateTime('20050210T11:41:23'))
def test_datetime_before_1900(self):
# same as before but with a date before 1900
dt = datetime.datetime(1, 02, 10, 11, 41, 23)
s = xmlrpclib.dumps((dt,))
(newdt,), m = xmlrpclib.loads(s, use_datetime=1)
- self.assertEquals(newdt, dt)
- self.assertEquals(m, None)
+ self.assertEqual(newdt, dt)
+ self.assertEqual(m, None)
(newdt,), m = xmlrpclib.loads(s, use_datetime=0)
- self.assertEquals(newdt, xmlrpclib.DateTime('00010210T11:41:23'))
+ self.assertEqual(newdt, xmlrpclib.DateTime('00010210T11:41:23'))
def test_cmp_datetime_DateTime(self):
now = datetime.datetime.now()
dt = xmlrpclib.DateTime(now.timetuple())
- self.assert_(dt == now)
- self.assert_(now == dt)
+ self.assertTrue(dt == now)
+ self.assertTrue(now == dt)
then = now + datetime.timedelta(seconds=4)
- self.assert_(then >= dt)
- self.assert_(dt < then)
+ self.assertTrue(then >= dt)
+ self.assertTrue(dt < then)
def test_bug_1164912 (self):
d = xmlrpclib.DateTime()
((new_d,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((d,),
methodresponse=True))
- self.assert_(isinstance(new_d.value, str))
+ self.assertIsInstance(new_d.value, str)
# Check that the output of dumps() is still an 8-bit string
s = xmlrpclib.dumps((new_d,), methodresponse=True)
- self.assert_(isinstance(s, str))
+ self.assertIsInstance(s, str)
def test_newstyle_class(self):
class T(object):
@@ -94,7 +98,7 @@ class XMLRPCTestCase(unittest.TestCase):
t.x = 100
t.y = "Hello"
((t2,), dummy) = xmlrpclib.loads(xmlrpclib.dumps((t,)))
- self.assertEquals(t2, t.__dict__)
+ self.assertEqual(t2, t.__dict__)
def test_dump_big_long(self):
self.assertRaises(OverflowError, xmlrpclib.dumps, (2L**99,))
@@ -137,8 +141,8 @@ class XMLRPCTestCase(unittest.TestCase):
value = alist + [None]
arg1 = (alist + [None],)
strg = xmlrpclib.dumps(arg1, allow_none=True)
- self.assertEquals(value,
- xmlrpclib.loads(strg)[0][0])
+ self.assertEqual(value,
+ xmlrpclib.loads(strg)[0][0])
self.assertRaises(TypeError, xmlrpclib.dumps, (arg1,))
def test_default_encoding_issues(self):
@@ -160,28 +164,28 @@ class XMLRPCTestCase(unittest.TestCase):
"""
# sys.setdefaultencoding() normally doesn't exist after site.py is
- # loaded. reload(sys) is the way to get it back.
+ # loaded. Import a temporary fresh copy to get access to it
+ # but then restore the original copy to avoid messing with
+ # other potentially modified sys module attributes
old_encoding = sys.getdefaultencoding()
- setdefaultencoding_existed = hasattr(sys, "setdefaultencoding")
- reload(sys) # ugh!
- sys.setdefaultencoding("iso-8859-1")
- try:
- (s, d), m = xmlrpclib.loads(utf8)
- finally:
- sys.setdefaultencoding(old_encoding)
- if not setdefaultencoding_existed:
- del sys.setdefaultencoding
+ with test_support.CleanImport('sys'):
+ import sys as temp_sys
+ temp_sys.setdefaultencoding("iso-8859-1")
+ try:
+ (s, d), m = xmlrpclib.loads(utf8)
+ finally:
+ temp_sys.setdefaultencoding(old_encoding)
items = d.items()
if have_unicode:
- self.assertEquals(s, u"abc \x95")
- self.assert_(isinstance(s, unicode))
- self.assertEquals(items, [(u"def \x96", u"ghi \x97")])
- self.assert_(isinstance(items[0][0], unicode))
- self.assert_(isinstance(items[0][1], unicode))
+ self.assertEqual(s, u"abc \x95")
+ self.assertIsInstance(s, unicode)
+ self.assertEqual(items, [(u"def \x96", u"ghi \x97")])
+ self.assertIsInstance(items[0][0], unicode)
+ self.assertIsInstance(items[0][1], unicode)
else:
- self.assertEquals(s, "abc \xc2\x95")
- self.assertEquals(items, [("def \xc2\x96", "ghi \xc2\x97")])
+ self.assertEqual(s, "abc \xc2\x95")
+ self.assertEqual(items, [("def \xc2\x96", "ghi \xc2\x97")])
class HelperTestCase(unittest.TestCase):
@@ -200,8 +204,8 @@ class FaultTestCase(unittest.TestCase):
f = xmlrpclib.Fault(42, 'Test Fault')
s = xmlrpclib.dumps((f,))
(newf,), m = xmlrpclib.loads(s)
- self.assertEquals(newf, {'faultCode': 42, 'faultString': 'Test Fault'})
- self.assertEquals(m, None)
+ self.assertEqual(newf, {'faultCode': 42, 'faultString': 'Test Fault'})
+ self.assertEqual(m, None)
s = xmlrpclib.Marshaller().dumps(f)
self.assertRaises(xmlrpclib.Fault, xmlrpclib.loads, s)
@@ -268,12 +272,12 @@ class BinaryTestCase(unittest.TestCase):
self.assertEqual(str(t2), d)
-PORT = None
+ADDR = PORT = URL = None
# The evt is set twice. First when the server is ready to serve.
# Second when the server has been shutdown. The user must clear
# the event after it has been set the first time to catch the second set.
-def http_server(evt, numrequests):
+def http_server(evt, numrequests, requestHandler=None):
class TestInstanceClass:
def div(self, x, y):
return x // y
@@ -294,13 +298,20 @@ def http_server(evt, numrequests):
s.setblocking(True)
return s, port
+ if not requestHandler:
+ requestHandler = SimpleXMLRPCServer.SimpleXMLRPCRequestHandler
+ serv = MyXMLRPCServer(("localhost", 0), requestHandler,
+ logRequests=False, bind_and_activate=False)
try:
- serv = MyXMLRPCServer(("localhost", 0),
- logRequests=False, bind_and_activate=False)
serv.socket.settimeout(3)
serv.server_bind()
- global PORT
- PORT = serv.socket.getsockname()[1]
+ global ADDR, PORT, URL
+ ADDR, PORT = serv.socket.getsockname()
+ #connect to IP address directly. This avoids socket.create_connection()
+ #trying to connect to to "localhost" using all address families, which
+ #causes slowdown e.g. on vista which supports AF_INET6. The server listens
+ #on AF_INET only.
+ URL = "http://%s:%d"%(ADDR, PORT)
serv.server_activate()
serv.register_introspection_functions()
serv.register_multicall_functions()
@@ -322,6 +333,66 @@ def http_server(evt, numrequests):
PORT = None
evt.set()
+def http_multi_server(evt, numrequests, requestHandler=None):
+ class TestInstanceClass:
+ def div(self, x, y):
+ return x // y
+
+ def _methodHelp(self, name):
+ if name == 'div':
+ return 'This is the div function'
+
+ def my_function():
+ '''This is my function'''
+ return True
+
+ class MyXMLRPCServer(SimpleXMLRPCServer.MultiPathXMLRPCServer):
+ def get_request(self):
+ # Ensure the socket is always non-blocking. On Linux, socket
+ # attributes are not inherited like they are on *BSD and Windows.
+ s, port = self.socket.accept()
+ s.setblocking(True)
+ return s, port
+
+ if not requestHandler:
+ requestHandler = SimpleXMLRPCServer.SimpleXMLRPCRequestHandler
+ class MyRequestHandler(requestHandler):
+ rpc_paths = []
+
+ serv = MyXMLRPCServer(("localhost", 0), MyRequestHandler,
+ logRequests=False, bind_and_activate=False)
+ serv.socket.settimeout(3)
+ serv.server_bind()
+ try:
+ global ADDR, PORT, URL
+ ADDR, PORT = serv.socket.getsockname()
+ #connect to IP address directly. This avoids socket.create_connection()
+ #trying to connect to to "localhost" using all address families, which
+ #causes slowdown e.g. on vista which supports AF_INET6. The server listens
+ #on AF_INET only.
+ URL = "http://%s:%d"%(ADDR, PORT)
+ serv.server_activate()
+ paths = ["/foo", "/foo/bar"]
+ for path in paths:
+ d = serv.add_dispatcher(path, SimpleXMLRPCServer.SimpleXMLRPCDispatcher())
+ d.register_introspection_functions()
+ d.register_multicall_functions()
+ serv.get_dispatcher(paths[0]).register_function(pow)
+ serv.get_dispatcher(paths[1]).register_function(lambda x,y: x+y, 'add')
+ evt.set()
+
+ # handle up to 'numrequests' requests
+ while numrequests > 0:
+ serv.handle_request()
+ numrequests -= 1
+
+ except socket.timeout:
+ pass
+ finally:
+ serv.socket.close()
+ PORT = None
+ evt.set()
+
# This function prevents errors like:
# <ProtocolError for localhost:57527/RPC2: 500 Internal Server Error>
def is_unavailable_exception(e):
@@ -343,37 +414,43 @@ def is_unavailable_exception(e):
return False
-# NOTE: The tests in SimpleServerTestCase will ignore failures caused by
-# "temporarily unavailable" exceptions raised in SimpleXMLRPCServer. This
-# condition occurs infrequently on some platforms, frequently on others, and
-# is apparently caused by using SimpleXMLRPCServer with a non-blocking socket.
-# If the server class is updated at some point in the future to handle this
-# situation more gracefully, these tests should be modified appropriately.
+@unittest.skipUnless(threading, 'Threading required for this test.')
+class BaseServerTestCase(unittest.TestCase):
+ requestHandler = None
+ request_count = 1
+ threadFunc = staticmethod(http_server)
-class SimpleServerTestCase(unittest.TestCase):
def setUp(self):
# enable traceback reporting
SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header = True
self.evt = threading.Event()
# start server thread to handle requests
- serv_args = (self.evt, 1)
- threading.Thread(target=http_server, args=serv_args).start()
+ serv_args = (self.evt, self.request_count, self.requestHandler)
+ threading.Thread(target=self.threadFunc, args=serv_args).start()
# wait for the server to be ready
- self.evt.wait()
+ self.evt.wait(10)
self.evt.clear()
def tearDown(self):
# wait on the server thread to terminate
- self.evt.wait()
+ self.evt.wait(10)
# disable traceback reporting
SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header = False
+# NOTE: The tests in SimpleServerTestCase will ignore failures caused by
+# "temporarily unavailable" exceptions raised in SimpleXMLRPCServer. This
+# condition occurs infrequently on some platforms, frequently on others, and
+# is apparently caused by using SimpleXMLRPCServer with a non-blocking socket
+# If the server class is updated at some point in the future to handle this
+# situation more gracefully, these tests should be modified appropriately.
+
+class SimpleServerTestCase(BaseServerTestCase):
def test_simple1(self):
try:
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
self.assertEqual(p.pow(6,8), 6**8)
except (xmlrpclib.ProtocolError, socket.error), e:
# ignore failures due to non-blocking socket 'unavailable' errors
@@ -381,11 +458,26 @@ class SimpleServerTestCase(unittest.TestCase):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
+ def test_nonascii(self):
+ start_string = 'P\N{LATIN SMALL LETTER Y WITH CIRCUMFLEX}t'
+ end_string = 'h\N{LATIN SMALL LETTER O WITH HORN}n'
+
+ try:
+ p = xmlrpclib.ServerProxy(URL)
+ self.assertEqual(p.add(start_string, end_string),
+ start_string + end_string)
+ except (xmlrpclib.ProtocolError, socket.error) as e:
+ # ignore failures due to non-blocking socket unavailable errors.
+ if not is_unavailable_exception(e):
+ # protocol error; provide additional information in test output
+ self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
+
+
# [ch] The test 404 is causing lots of false alarms.
def XXXtest_404(self):
# send POST with httplib, it should return 404 header and
# 'Not Found' message.
- conn = httplib.HTTPConnection('localhost', PORT)
+ conn = httplib.HTTPConnection(ADDR, PORT)
conn.request('POST', '/this-is-not-valid')
response = conn.getresponse()
conn.close()
@@ -395,7 +487,7 @@ class SimpleServerTestCase(unittest.TestCase):
def test_introspection1(self):
try:
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
meth = p.system.listMethods()
expected_methods = set(['pow', 'div', 'my_function', 'add',
'system.listMethods', 'system.methodHelp',
@@ -410,7 +502,7 @@ class SimpleServerTestCase(unittest.TestCase):
def test_introspection2(self):
try:
# test _methodHelp()
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
divhelp = p.system.methodHelp('div')
self.assertEqual(divhelp, 'This is the div function')
except (xmlrpclib.ProtocolError, socket.error), e:
@@ -419,10 +511,12 @@ class SimpleServerTestCase(unittest.TestCase):
# protocol error; provide additional information in test output
self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
+ @unittest.skipIf(sys.flags.optimize >= 2,
+ "Docstrings are omitted with -O2 and above")
def test_introspection3(self):
try:
# test native doc
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
myfunction = p.system.methodHelp('my_function')
self.assertEqual(myfunction, 'This is my function')
except (xmlrpclib.ProtocolError, socket.error), e:
@@ -435,7 +529,7 @@ class SimpleServerTestCase(unittest.TestCase):
# the SimpleXMLRPCServer doesn't support signatures, but
# at least check that we can try making the call
try:
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
divsig = p.system.methodSignature('div')
self.assertEqual(divsig, 'signatures not supported')
except (xmlrpclib.ProtocolError, socket.error), e:
@@ -446,7 +540,7 @@ class SimpleServerTestCase(unittest.TestCase):
def test_multicall(self):
try:
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
multicall = xmlrpclib.MultiCall(p)
multicall.add(2,3)
multicall.pow(6,8)
@@ -463,7 +557,7 @@ class SimpleServerTestCase(unittest.TestCase):
def test_non_existing_multicall(self):
try:
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
multicall = xmlrpclib.MultiCall(p)
multicall.this_is_not_exists()
result = multicall()
@@ -487,11 +581,181 @@ class SimpleServerTestCase(unittest.TestCase):
self.assertRaises(AttributeError,
SimpleXMLRPCServer.resolve_dotted_attribute, str, '__add')
- self.assert_(SimpleXMLRPCServer.resolve_dotted_attribute(str, 'title'))
+ self.assertTrue(SimpleXMLRPCServer.resolve_dotted_attribute(str, 'title'))
# Get the test to run faster by sending a request with test_simple1.
# This avoids waiting for the socket timeout.
self.test_simple1()
+class MultiPathServerTestCase(BaseServerTestCase):
+ threadFunc = staticmethod(http_multi_server)
+ request_count = 2
+ def test_path1(self):
+ p = xmlrpclib.ServerProxy(URL+"/foo")
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertRaises(xmlrpclib.Fault, p.add, 6, 8)
+ def test_path2(self):
+ p = xmlrpclib.ServerProxy(URL+"/foo/bar")
+ self.assertEqual(p.add(6,8), 6+8)
+ self.assertRaises(xmlrpclib.Fault, p.pow, 6, 8)
+
+#A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism
+#does indeed serve subsequent requests on the same connection
+class BaseKeepaliveServerTestCase(BaseServerTestCase):
+ #a request handler that supports keep-alive and logs requests into a
+ #class variable
+ class RequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHandler):
+ parentClass = SimpleXMLRPCServer.SimpleXMLRPCRequestHandler
+ protocol_version = 'HTTP/1.1'
+ myRequests = []
+ def handle(self):
+ self.myRequests.append([])
+ self.reqidx = len(self.myRequests)-1
+ return self.parentClass.handle(self)
+ def handle_one_request(self):
+ result = self.parentClass.handle_one_request(self)
+ self.myRequests[self.reqidx].append(self.raw_requestline)
+ return result
+
+ requestHandler = RequestHandler
+ def setUp(self):
+ #clear request log
+ self.RequestHandler.myRequests = []
+ return BaseServerTestCase.setUp(self)
+
+#A test case that verifies that a server using the HTTP/1.1 keep-alive mechanism
+#does indeed serve subsequent requests on the same connection
+class KeepaliveServerTestCase1(BaseKeepaliveServerTestCase):
+ def test_two(self):
+ p = xmlrpclib.ServerProxy(URL)
+ #do three requests.
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+
+ #they should have all been handled by a single request handler
+ self.assertEqual(len(self.RequestHandler.myRequests), 1)
+
+ #check that we did at least two (the third may be pending append
+ #due to thread scheduling)
+ self.assertGreaterEqual(len(self.RequestHandler.myRequests[-1]), 2)
+
+#test special attribute access on the serverproxy, through the __call__
+#function.
+class KeepaliveServerTestCase2(BaseKeepaliveServerTestCase):
+ #ask for two keepalive requests to be handled.
+ request_count=2
+
+ def test_close(self):
+ p = xmlrpclib.ServerProxy(URL)
+ #do some requests with close.
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ p("close")() #this should trigger a new keep-alive request
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(p.pow(6,8), 6**8)
+
+ #they should have all been two request handlers, each having logged at least
+ #two complete requests
+ self.assertEqual(len(self.RequestHandler.myRequests), 2)
+ self.assertGreaterEqual(len(self.RequestHandler.myRequests[-1]), 2)
+ self.assertGreaterEqual(len(self.RequestHandler.myRequests[-2]), 2)
+
+ def test_transport(self):
+ p = xmlrpclib.ServerProxy(URL)
+ #do some requests with close.
+ self.assertEqual(p.pow(6,8), 6**8)
+ p("transport").close() #same as above, really.
+ self.assertEqual(p.pow(6,8), 6**8)
+ self.assertEqual(len(self.RequestHandler.myRequests), 2)
+
+#A test case that verifies that gzip encoding works in both directions
+#(for a request and the response)
+class GzipServerTestCase(BaseServerTestCase):
+ #a request handler that supports keep-alive and logs requests into a
+ #class variable
+ class RequestHandler(SimpleXMLRPCServer.SimpleXMLRPCRequestHandler):
+ parentClass = SimpleXMLRPCServer.SimpleXMLRPCRequestHandler
+ protocol_version = 'HTTP/1.1'
+
+ def do_POST(self):
+ #store content of last request in class
+ self.__class__.content_length = int(self.headers["content-length"])
+ return self.parentClass.do_POST(self)
+ requestHandler = RequestHandler
+
+ class Transport(xmlrpclib.Transport):
+ #custom transport, stores the response length for our perusal
+ fake_gzip = False
+ def parse_response(self, response):
+ self.response_length=int(response.getheader("content-length", 0))
+ return xmlrpclib.Transport.parse_response(self, response)
+
+ def send_content(self, connection, body):
+ if self.fake_gzip:
+ #add a lone gzip header to induce decode error remotely
+ connection.putheader("Content-Encoding", "gzip")
+ return xmlrpclib.Transport.send_content(self, connection, body)
+
+ def setUp(self):
+ BaseServerTestCase.setUp(self)
+
+ def test_gzip_request(self):
+ t = self.Transport()
+ t.encode_threshold = None
+ p = xmlrpclib.ServerProxy(URL, transport=t)
+ self.assertEqual(p.pow(6,8), 6**8)
+ a = self.RequestHandler.content_length
+ t.encode_threshold = 0 #turn on request encoding
+ self.assertEqual(p.pow(6,8), 6**8)
+ b = self.RequestHandler.content_length
+ self.assertTrue(a>b)
+
+ def test_bad_gzip_request(self):
+ t = self.Transport()
+ t.encode_threshold = None
+ t.fake_gzip = True
+ p = xmlrpclib.ServerProxy(URL, transport=t)
+ cm = self.assertRaisesRegexp(xmlrpclib.ProtocolError,
+ re.compile(r"\b400\b"))
+ with cm:
+ p.pow(6, 8)
+
+ def test_gsip_response(self):
+ t = self.Transport()
+ p = xmlrpclib.ServerProxy(URL, transport=t)
+ old = self.requestHandler.encode_threshold
+ self.requestHandler.encode_threshold = None #no encoding
+ self.assertEqual(p.pow(6,8), 6**8)
+ a = t.response_length
+ self.requestHandler.encode_threshold = 0 #always encode
+ self.assertEqual(p.pow(6,8), 6**8)
+ b = t.response_length
+ self.requestHandler.encode_threshold = old
+ self.assertTrue(a>b)
+
+#Test special attributes of the ServerProxy object
+class ServerProxyTestCase(unittest.TestCase):
+ def setUp(self):
+ unittest.TestCase.setUp(self)
+ if threading:
+ self.url = URL
+ else:
+ # Without threading, http_server() and http_multi_server() will not
+ # be executed and URL is still equal to None. 'http://' is a just
+ # enough to choose the scheme (HTTP)
+ self.url = 'http://'
+
+ def test_close(self):
+ p = xmlrpclib.ServerProxy(self.url)
+ self.assertEqual(p('close')(), None)
+
+ def test_transport(self):
+ t = xmlrpclib.Transport()
+ p = xmlrpclib.ServerProxy(self.url, transport=t)
+ self.assertEqual(p('transport'), t)
+
# This is a contrived way to make a failure occur on the server side
# in order to test the _send_traceback_header flag on the server
class FailingMessageClass(mimetools.Message):
@@ -502,6 +766,7 @@ class FailingMessageClass(mimetools.Message):
return mimetools.Message.__getitem__(self, key)
+@unittest.skipUnless(threading, 'Threading required for this test.')
class FailingServerTestCase(unittest.TestCase):
def setUp(self):
self.evt = threading.Event()
@@ -531,7 +796,7 @@ class FailingServerTestCase(unittest.TestCase):
# test a call that shouldn't fail just as a smoke test
try:
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
self.assertEqual(p.pow(6,8), 6**8)
except (xmlrpclib.ProtocolError, socket.error), e:
# ignore failures due to non-blocking socket 'unavailable' errors
@@ -544,7 +809,7 @@ class FailingServerTestCase(unittest.TestCase):
SimpleXMLRPCServer.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass
try:
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
p.pow(6,8)
except (xmlrpclib.ProtocolError, socket.error), e:
# ignore failures due to non-blocking socket 'unavailable' errors
@@ -564,7 +829,7 @@ class FailingServerTestCase(unittest.TestCase):
SimpleXMLRPCServer.SimpleXMLRPCServer._send_traceback_header = True
try:
- p = xmlrpclib.ServerProxy('http://localhost:%d' % PORT)
+ p = xmlrpclib.ServerProxy(URL)
p.pow(6,8)
except (xmlrpclib.ProtocolError, socket.error), e:
# ignore failures due to non-blocking socket 'unavailable' errors
@@ -585,63 +850,63 @@ class CGIHandlerTestCase(unittest.TestCase):
def test_cgi_get(self):
with test_support.EnvironmentVarGuard() as env:
- env.set('REQUEST_METHOD', 'GET')
+ env['REQUEST_METHOD'] = 'GET'
# if the method is GET and no request_text is given, it runs handle_get
# get sysout output
- tmp = sys.stdout
- sys.stdout = open(test_support.TESTFN, "w")
- self.cgi.handle_request()
- sys.stdout.close()
- sys.stdout = tmp
+ with test_support.captured_stdout() as data_out:
+ self.cgi.handle_request()
# parse Status header
- handle = open(test_support.TESTFN, "r").read()
+ data_out.seek(0)
+ handle = data_out.read()
status = handle.split()[1]
message = ' '.join(handle.split()[2:4])
self.assertEqual(status, '400')
self.assertEqual(message, 'Bad Request')
- os.remove(test_support.TESTFN)
def test_cgi_xmlrpc_response(self):
data = """<?xml version='1.0'?>
-<methodCall>
- <methodName>test_method</methodName>
- <params>
- <param>
- <value><string>foo</string></value>
- </param>
- <param>
- <value><string>bar</string></value>
- </param>
- </params>
-</methodCall>
-"""
- open("xmldata.txt", "w").write(data)
- tmp1 = sys.stdin
- tmp2 = sys.stdout
-
- sys.stdin = open("xmldata.txt", "r")
- sys.stdout = open(test_support.TESTFN, "w")
-
- with test_support.EnvironmentVarGuard() as env:
- env.set('CONTENT_LENGTH', str(len(data)))
+ <methodCall>
+ <methodName>test_method</methodName>
+ <params>
+ <param>
+ <value><string>foo</string></value>
+ </param>
+ <param>
+ <value><string>bar</string></value>
+ </param>
+ </params>
+ </methodCall>
+ """
+
+ with test_support.EnvironmentVarGuard() as env, \
+ test_support.captured_stdout() as data_out, \
+ test_support.captured_stdin() as data_in:
+ data_in.write(data)
+ data_in.seek(0)
+ env['CONTENT_LENGTH'] = str(len(data))
self.cgi.handle_request()
-
- sys.stdin.close()
- sys.stdout.close()
- sys.stdin = tmp1
- sys.stdout = tmp2
+ data_out.seek(0)
# will respond exception, if so, our goal is achieved ;)
- handle = open(test_support.TESTFN, "r").read()
+ handle = data_out.read()
# start with 44th char so as not to get http header, we just need only xml
self.assertRaises(xmlrpclib.Fault, xmlrpclib.loads, handle[44:])
- os.remove("xmldata.txt")
- os.remove(test_support.TESTFN)
+ # Also test the content-length returned by handle_request
+ # Using the same test method inorder to avoid all the datapassing
+ # boilerplate code.
+ # Test for bug: http://bugs.python.org/issue5040
+
+ content = handle[handle.find("<?xml"):]
+
+ self.assertEqual(
+ int(re.search('Content-Length: (\d+)', handle).group(1)),
+ len(content))
+
class FakeSocket:
@@ -658,9 +923,12 @@ class FakeSocket:
def getvalue(self):
return self.data.getvalue()
- def makefile(self, x, y):
+ def makefile(self, x='r', y=-1):
raise RuntimeError
+ def close(self):
+ pass
+
class FakeTransport(xmlrpclib.Transport):
"""A Transport instance that records instead of sending a request.
@@ -671,7 +939,7 @@ class FakeTransport(xmlrpclib.Transport):
def make_connection(self, host):
conn = xmlrpclib.Transport.make_connection(self, host)
- conn._conn.sock = self.fake_socket = FakeSocket()
+ conn.sock = self.fake_socket = FakeSocket()
return conn
class TransportSubclassTestCase(unittest.TestCase):
@@ -695,7 +963,7 @@ class TransportSubclassTestCase(unittest.TestCase):
conn.putheader("X-Test", "test_custom_user_agent")
req = self.issue_request(TestTransport)
- self.assert_("X-Test: test_custom_user_agent\r\n" in req)
+ self.assertIn("X-Test: test_custom_user_agent\r\n", req)
def test_send_host(self):
class TestTransport(FakeTransport):
@@ -705,7 +973,7 @@ class TransportSubclassTestCase(unittest.TestCase):
conn.putheader("X-Test", "test_send_host")
req = self.issue_request(TestTransport)
- self.assert_("X-Test: test_send_host\r\n" in req)
+ self.assertIn("X-Test: test_send_host\r\n", req)
def test_send_request(self):
class TestTransport(FakeTransport):
@@ -715,7 +983,7 @@ class TransportSubclassTestCase(unittest.TestCase):
conn.putheader("X-Test", "test_send_request")
req = self.issue_request(TestTransport)
- self.assert_("X-Test: test_send_request\r\n" in req)
+ self.assertIn("X-Test: test_send_request\r\n", req)
def test_send_content(self):
class TestTransport(FakeTransport):
@@ -725,20 +993,24 @@ class TransportSubclassTestCase(unittest.TestCase):
xmlrpclib.Transport.send_content(self, conn, body)
req = self.issue_request(TestTransport)
- self.assert_("X-Test: test_send_content\r\n" in req)
+ self.assertIn("X-Test: test_send_content\r\n", req)
+@test_support.reap_threads
def test_main():
xmlrpc_tests = [XMLRPCTestCase, HelperTestCase, DateTimeTestCase,
BinaryTestCase, FaultTestCase, TransportSubclassTestCase]
-
- # The test cases against a SimpleXMLRPCServer raise a socket error
- # 10035 (WSAEWOULDBLOCK) in the server thread handle_request call when
- # run on Windows. This only happens on the first test to run, but it
- # fails every time and so these tests are skipped on win32 platforms.
- if sys.platform != 'win32':
- xmlrpc_tests.append(SimpleServerTestCase)
- xmlrpc_tests.append(FailingServerTestCase)
- xmlrpc_tests.append(CGIHandlerTestCase)
+ xmlrpc_tests.append(SimpleServerTestCase)
+ xmlrpc_tests.append(KeepaliveServerTestCase1)
+ xmlrpc_tests.append(KeepaliveServerTestCase2)
+ try:
+ import gzip
+ xmlrpc_tests.append(GzipServerTestCase)
+ except ImportError:
+ pass #gzip not supported in this build
+ xmlrpc_tests.append(MultiPathServerTestCase)
+ xmlrpc_tests.append(ServerProxyTestCase)
+ xmlrpc_tests.append(FailingServerTestCase)
+ xmlrpc_tests.append(CGIHandlerTestCase)
test_support.run_unittest(*xmlrpc_tests)
diff --git a/Lib/test/test_xpickle.py b/Lib/test/test_xpickle.py
index 3ffb74409d..2ce1dcbb24 100644
--- a/Lib/test/test_xpickle.py
+++ b/Lib/test/test_xpickle.py
@@ -1,19 +1,42 @@
# test_pickle dumps and loads pickles via pickle.py.
# test_cpickle does the same, but via the cPickle module.
# This test covers the other two cases, making pickles with one module and
-# loading them via the other.
+# loading them via the other. It also tests backwards compatibility with
+# previous version of Python by bouncing pickled objects through Python 2.4
+# and Python 2.5 running this file.
-import pickle
import cPickle
+import os
+import os.path
+import pickle
+import subprocess
+import sys
+import types
+import unittest
from test import test_support
-from test.pickletester import AbstractPickleTests
+
+# Most distro-supplied Pythons don't include the tests
+# or test support files, and some don't include a way to get these back even if
+# you're will to install extra packages (like Ubuntu). Doing things like this
+# "provides" a pickletester module for older versions of Python that may be
+# installed without it. Note that one other design for this involves messing
+# with sys.path, which is less precise.
+mod_path = os.path.abspath(os.path.join(os.path.dirname(__file__),
+ "pickletester.py"))
+pickletester = types.ModuleType("test.pickletester")
+exec compile(open(mod_path).read(), mod_path, 'exec') in pickletester.__dict__
+AbstractPickleTests = pickletester.AbstractPickleTests
+if pickletester.__name__ in sys.modules:
+ raise RuntimeError("Did not expect to find test.pickletester loaded")
+sys.modules[pickletester.__name__] = pickletester
+
class DumpCPickle_LoadPickle(AbstractPickleTests):
error = KeyError
- def dumps(self, arg, proto=0, fast=0):
+ def dumps(self, arg, proto=0, fast=False):
# Ignore fast
return cPickle.dumps(arg, proto)
@@ -25,7 +48,7 @@ class DumpPickle_LoadCPickle(AbstractPickleTests):
error = cPickle.BadPickleGet
- def dumps(self, arg, proto=0, fast=0):
+ def dumps(self, arg, proto=0, fast=False):
# Ignore fast
return pickle.dumps(arg, proto)
@@ -33,11 +56,205 @@ class DumpPickle_LoadCPickle(AbstractPickleTests):
# Ignore fast
return cPickle.loads(buf)
+def have_python_version(name):
+ """Check whether the given name is a valid Python binary and has
+ test.test_support.
+
+ This respects your PATH.
+
+ Args:
+ name: short string name of a Python binary such as "python2.4".
+
+ Returns:
+ True if the name is valid, False otherwise.
+ """
+ return os.system(name + " -c 'import test.test_support'") == 0
+
+
+class AbstractCompatTests(AbstractPickleTests):
+
+ module = None
+ python = None
+ error = None
+
+ def setUp(self):
+ self.assertTrue(self.python)
+ self.assertTrue(self.module)
+ self.assertTrue(self.error)
+
+ def send_to_worker(self, python, obj, proto):
+ """Bounce a pickled object through another version of Python.
+
+ This will pickle the object, send it to a child process where it will be
+ unpickled, then repickled and sent back to the parent process.
+
+ Args:
+ python: the name of the Python binary to start.
+ obj: object to pickle.
+ proto: pickle protocol number to use.
+
+ Returns:
+ The pickled data received from the child process.
+ """
+ # Prevent the subprocess from picking up invalid .pyc files.
+ target = __file__
+ if target[-1] in ("c", "o"):
+ target = target[:-1]
+
+ data = self.module.dumps((proto, obj), proto)
+ worker = subprocess.Popen([python, target, "worker"],
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ stdout, stderr = worker.communicate(data)
+ if worker.returncode != 0:
+ raise RuntimeError(stderr)
+ return stdout
+
+ def dumps(self, arg, proto=0, fast=False):
+ return self.send_to_worker(self.python, arg, proto)
+
+ def loads(self, input):
+ return self.module.loads(input)
+
+ # These tests are disabled because they require some special setup
+ # on the worker that's hard to keep in sync.
+ def test_global_ext1(self):
+ pass
+
+ def test_global_ext2(self):
+ pass
+
+ def test_global_ext4(self):
+ pass
+
+ # This is a cut-down version of pickletester's test_float. Backwards
+ # compatibility for the values in for_bin_protos was explicitly broken in
+ # r68903 to fix a bug.
+ def test_float(self):
+ for_bin_protos = [4.94e-324, 1e-310]
+ neg_for_bin_protos = [-x for x in for_bin_protos]
+ test_values = [0.0, 7e-308, 6.626e-34, 0.1, 0.5,
+ 3.14, 263.44582062374053, 6.022e23, 1e30]
+ test_proto0_values = test_values + [-x for x in test_values]
+ test_values = test_proto0_values + for_bin_protos + neg_for_bin_protos
+
+ for value in test_proto0_values:
+ pickle = self.dumps(value, 0)
+ got = self.loads(pickle)
+ self.assertEqual(value, got)
+
+ for proto in pickletester.protocols[1:]:
+ for value in test_values:
+ pickle = self.dumps(value, proto)
+ got = self.loads(pickle)
+ self.assertEqual(value, got)
+
+ # Backwards compatibility was explicitly broken in r67934 to fix a bug.
+ def test_unicode_high_plane(self):
+ pass
+
+ if test_support.have_unicode:
+ # This is a cut-down version of pickletester's test_unicode. Backwards
+ # compatibility was explicitly broken in r67934 to fix a bug.
+ def test_unicode(self):
+ endcases = [u'', u'<\\u>', u'<\\\u1234>', u'<\n>', u'<\\>']
+ for proto in pickletester.protocols:
+ for u in endcases:
+ p = self.dumps(u, proto)
+ u2 = self.loads(p)
+ self.assertEqual(u2, u)
+
+
+def run_compat_test(python_name):
+ return (test_support.is_resource_enabled("xpickle") and
+ have_python_version(python_name))
+
+
+# Test backwards compatibility with Python 2.4.
+if not run_compat_test("python2.4"):
+ class CPicklePython24Compat(unittest.TestCase):
+ pass
+else:
+ class CPicklePython24Compat(AbstractCompatTests):
+
+ module = cPickle
+ python = "python2.4"
+ error = cPickle.BadPickleGet
+
+ # Disable these tests for Python 2.4. Making them pass would require
+ # nontrivially monkeypatching the pickletester module in the worker.
+ def test_reduce_calls_base(self):
+ pass
+
+ def test_reduce_ex_calls_base(self):
+ pass
+
+class PicklePython24Compat(CPicklePython24Compat):
+
+ module = pickle
+ error = KeyError
+
+
+# Test backwards compatibility with Python 2.5.
+if not run_compat_test("python2.5"):
+ class CPicklePython25Compat(unittest.TestCase):
+ pass
+else:
+ class CPicklePython25Compat(AbstractCompatTests):
+
+ module = cPickle
+ python = "python2.5"
+ error = cPickle.BadPickleGet
+
+class PicklePython25Compat(CPicklePython25Compat):
+
+ module = pickle
+ error = KeyError
+
+
+# Test backwards compatibility with Python 2.6.
+if not run_compat_test("python2.6"):
+ class CPicklePython26Compat(unittest.TestCase):
+ pass
+else:
+ class CPicklePython26Compat(AbstractCompatTests):
+
+ module = cPickle
+ python = "python2.6"
+ error = cPickle.BadPickleGet
+
+class PicklePython26Compat(CPicklePython26Compat):
+
+ module = pickle
+ error = KeyError
+
+
+def worker_main(in_stream, out_stream):
+ message = cPickle.load(in_stream)
+ protocol, obj = message
+ cPickle.dump(obj, out_stream, protocol)
+
+
def test_main():
+ if not test_support.is_resource_enabled("xpickle"):
+ print >>sys.stderr, "test_xpickle -- skipping backwards compat tests."
+ print >>sys.stderr, "Use 'regrtest.py -u xpickle' to run them."
+ sys.stderr.flush()
+
test_support.run_unittest(
DumpCPickle_LoadPickle,
- DumpPickle_LoadCPickle
+ DumpPickle_LoadCPickle,
+ CPicklePython24Compat,
+ CPicklePython25Compat,
+ CPicklePython26Compat,
+ PicklePython24Compat,
+ PicklePython25Compat,
+ PicklePython26Compat,
)
if __name__ == "__main__":
- test_main()
+ if "worker" in sys.argv:
+ worker_main(sys.stdin, sys.stdout)
+ else:
+ test_main()
diff --git a/Lib/test/test_xrange.py b/Lib/test/test_xrange.py
index dbfeb43833..e3c799e822 100644
--- a/Lib/test/test_xrange.py
+++ b/Lib/test/test_xrange.py
@@ -37,14 +37,14 @@ class XrangeTest(unittest.TestCase):
if x == y:
continue
elif x == sentinel:
- self.fail('{0}: iterator ended unexpectedly '
- 'at position {1}; expected {2}'.format(test_id, i, y))
+ self.fail('{}: iterator ended unexpectedly '
+ 'at position {}; expected {}'.format(test_id, i, y))
elif y == sentinel:
- self.fail('{0}: unexpected excess element {1} at '
- 'position {2}'.format(test_id, x, i))
+ self.fail('{}: unexpected excess element {} at '
+ 'position {}'.format(test_id, x, i))
else:
- self.fail('{0}: wrong element at position {1};'
- 'expected {2}, got {3}'.format(test_id, i, y, x))
+ self.fail('{}: wrong element at position {};'
+ 'expected {}, got {}'.format(test_id, i, y, x))
def test_xrange(self):
self.assertEqual(list(xrange(3)), [0, 1, 2])
@@ -63,25 +63,25 @@ class XrangeTest(unittest.TestCase):
self.assertEqual(list(xrange(a+4, a, -2)), [a+4, a+2])
seq = list(xrange(a, b, c))
- self.assert_(a in seq)
- self.assert_(b not in seq)
+ self.assertIn(a, seq)
+ self.assertNotIn(b, seq)
self.assertEqual(len(seq), 2)
seq = list(xrange(b, a, -c))
- self.assert_(b in seq)
- self.assert_(a not in seq)
+ self.assertIn(b, seq)
+ self.assertNotIn(a, seq)
self.assertEqual(len(seq), 2)
seq = list(xrange(-a, -b, -c))
- self.assert_(-a in seq)
- self.assert_(-b not in seq)
+ self.assertIn(-a, seq)
+ self.assertNotIn(-b, seq)
self.assertEqual(len(seq), 2)
self.assertRaises(TypeError, xrange)
self.assertRaises(TypeError, xrange, 1, 2, 3, 4)
self.assertRaises(ValueError, xrange, 1, 2, 0)
- self.assertRaises(OverflowError, xrange, 1e100, 1e101, 1e101)
+ self.assertRaises(OverflowError, xrange, 10**100, 10**101, 10**101)
self.assertRaises(TypeError, xrange, 0, "spam")
self.assertRaises(TypeError, xrange, 0, 42, "spam")
@@ -101,8 +101,8 @@ class XrangeTest(unittest.TestCase):
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
for t in testcases:
r = xrange(*t)
- self.assertEquals(list(pickle.loads(pickle.dumps(r, proto))),
- list(r))
+ self.assertEqual(list(pickle.loads(pickle.dumps(r, proto))),
+ list(r))
def test_range_iterators(self):
# see issue 7298
@@ -122,7 +122,7 @@ class XrangeTest(unittest.TestCase):
pass
else:
iter2 = pyrange(start, end, step)
- test_id = "xrange({0}, {1}, {2})".format(start, end, step)
+ test_id = "xrange({}, {}, {})".format(start, end, step)
# check first 100 entries
self.assert_iterators_equal(iter1, iter2, test_id, limit=100)
@@ -132,8 +132,7 @@ class XrangeTest(unittest.TestCase):
pass
else:
iter2 = pyrange_reversed(start, end, step)
- test_id = "reversed(xrange({0}, {1}, {2}))".format(
- start, end, step)
+ test_id = "reversed(xrange({}, {}, {}))".format(start, end, step)
self.assert_iterators_equal(iter1, iter2, test_id, limit=100)
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index a2c3a2c3fe..c4a64a3b4b 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -4,14 +4,21 @@ try:
except ImportError:
zlib = None
-import zipfile, os, unittest, sys, shutil, struct
+import os
+import io
+import sys
+import time
+import shutil
+import struct
+import zipfile
+import unittest
from StringIO import StringIO
from tempfile import TemporaryFile
from random import randint, random
+from unittest import skipUnless
-import test.test_support as support
-from test.test_support import TESTFN, run_unittest, findfile
+from test.test_support import TESTFN, run_unittest, findfile, unlink
TESTFN2 = TESTFN + "2"
TESTFNDIR = TESTFN + "d"
@@ -22,373 +29,440 @@ SMALL_TEST_DATA = [('_ziptest1', '1q2w3e4r5t'),
('/ziptest2dir/ziptest3dir/_ziptest3', 'azsxdcfvgb'),
('ziptest2dir/ziptest3dir/ziptest4dir/_ziptest3', '6y7u8i9o0p')]
+
class TestsWithSourceFile(unittest.TestCase):
def setUp(self):
self.line_gen = ["Zipfile test line %d. random float: %f" % (i, random())
- for i in xrange(FIXEDTEST_SIZE)]
+ for i in xrange(FIXEDTEST_SIZE)]
self.data = '\n'.join(self.line_gen) + '\n'
# Make a source file with some lines
- fp = open(TESTFN, "wb")
- fp.write(self.data)
- fp.close()
+ with open(TESTFN, "wb") as fp:
+ fp.write(self.data)
- def makeTestArchive(self, f, compression):
+ def make_test_archive(self, f, compression):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(f, "w", compression)
- zipfp.write(TESTFN, "another"+os.extsep+"name")
- zipfp.write(TESTFN, TESTFN)
- zipfp.writestr("strfile", self.data)
- zipfp.close()
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ zipfp.write(TESTFN, "another.name")
+ zipfp.write(TESTFN, TESTFN)
+ zipfp.writestr("strfile", self.data)
- def zipTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- self.assertEqual(zipfp.read(TESTFN), self.data)
- self.assertEqual(zipfp.read("another"+os.extsep+"name"), self.data)
- self.assertEqual(zipfp.read("strfile"), self.data)
-
- # Print the ZIP directory
- fp = StringIO()
- stdout = sys.stdout
- try:
- sys.stdout = fp
-
- zipfp.printdir()
- finally:
- sys.stdout = stdout
-
- directory = fp.getvalue()
- lines = directory.splitlines()
- self.assertEquals(len(lines), 4) # Number of files + header
-
- self.assert_('File Name' in lines[0])
- self.assert_('Modified' in lines[0])
- self.assert_('Size' in lines[0])
-
- fn, date, time, size = lines[1].split()
- self.assertEquals(fn, 'another.name')
- # XXX: timestamp is not tested
- self.assertEquals(size, str(len(self.data)))
-
- # Check the namelist
- names = zipfp.namelist()
- self.assertEquals(len(names), 3)
- self.assert_(TESTFN in names)
- self.assert_("another"+os.extsep+"name" in names)
- self.assert_("strfile" in names)
-
- # Check infolist
- infos = zipfp.infolist()
- names = [ i.filename for i in infos ]
- self.assertEquals(len(names), 3)
- self.assert_(TESTFN in names)
- self.assert_("another"+os.extsep+"name" in names)
- self.assert_("strfile" in names)
- for i in infos:
- self.assertEquals(i.file_size, len(self.data))
-
- # check getinfo
- for nm in (TESTFN, "another"+os.extsep+"name", "strfile"):
- info = zipfp.getinfo(nm)
- self.assertEquals(info.filename, nm)
- self.assertEquals(info.file_size, len(self.data))
-
- # Check that testzip doesn't raise an exception
- zipfp.testzip()
- zipfp.close()
-
- def testStored(self):
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ self.assertEqual(zipfp.read(TESTFN), self.data)
+ self.assertEqual(zipfp.read("another.name"), self.data)
+ self.assertEqual(zipfp.read("strfile"), self.data)
+
+ # Print the ZIP directory
+ fp = StringIO()
+ stdout = sys.stdout
+ try:
+ sys.stdout = fp
+ zipfp.printdir()
+ finally:
+ sys.stdout = stdout
+
+ directory = fp.getvalue()
+ lines = directory.splitlines()
+ self.assertEqual(len(lines), 4) # Number of files + header
+
+ self.assertIn('File Name', lines[0])
+ self.assertIn('Modified', lines[0])
+ self.assertIn('Size', lines[0])
+
+ fn, date, time_, size = lines[1].split()
+ self.assertEqual(fn, 'another.name')
+ self.assertTrue(time.strptime(date, '%Y-%m-%d'))
+ self.assertTrue(time.strptime(time_, '%H:%M:%S'))
+ self.assertEqual(size, str(len(self.data)))
+
+ # Check the namelist
+ names = zipfp.namelist()
+ self.assertEqual(len(names), 3)
+ self.assertIn(TESTFN, names)
+ self.assertIn("another.name", names)
+ self.assertIn("strfile", names)
+
+ # Check infolist
+ infos = zipfp.infolist()
+ names = [i.filename for i in infos]
+ self.assertEqual(len(names), 3)
+ self.assertIn(TESTFN, names)
+ self.assertIn("another.name", names)
+ self.assertIn("strfile", names)
+ for i in infos:
+ self.assertEqual(i.file_size, len(self.data))
+
+ # check getinfo
+ for nm in (TESTFN, "another.name", "strfile"):
+ info = zipfp.getinfo(nm)
+ self.assertEqual(info.filename, nm)
+ self.assertEqual(info.file_size, len(self.data))
+
+ # Check that testzip doesn't raise an exception
+ zipfp.testzip()
+
+ def test_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipTest(f, zipfile.ZIP_STORED)
+ self.zip_test(f, zipfile.ZIP_STORED)
- def zipOpenTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_open_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- zipdata1 = []
- zipopen1 = zipfp.open(TESTFN)
- while 1:
- read_data = zipopen1.read(256)
- if not read_data:
- break
- zipdata1.append(read_data)
-
- zipdata2 = []
- zipopen2 = zipfp.open("another"+os.extsep+"name")
- while 1:
- read_data = zipopen2.read(256)
- if not read_data:
- break
- zipdata2.append(read_data)
-
- self.assertEqual(''.join(zipdata1), self.data)
- self.assertEqual(''.join(zipdata2), self.data)
- zipfp.close()
-
- def testOpenStored(self):
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ zipdata1 = []
+ with zipfp.open(TESTFN) as zipopen1:
+ while True:
+ read_data = zipopen1.read(256)
+ if not read_data:
+ break
+ zipdata1.append(read_data)
+
+ zipdata2 = []
+ with zipfp.open("another.name") as zipopen2:
+ while True:
+ read_data = zipopen2.read(256)
+ if not read_data:
+ break
+ zipdata2.append(read_data)
+
+ self.assertEqual(''.join(zipdata1), self.data)
+ self.assertEqual(''.join(zipdata2), self.data)
+
+ def test_open_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipOpenTest(f, zipfile.ZIP_STORED)
+ self.zip_open_test(f, zipfile.ZIP_STORED)
- def testOpenViaZipInfo(self):
+ def test_open_via_zip_info(self):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- zipfp.writestr("name", "foo")
- zipfp.writestr("name", "bar")
- zipfp.close()
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ zipfp.writestr("name", "foo")
+ zipfp.writestr("name", "bar")
+
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp:
+ infos = zipfp.infolist()
+ data = ""
+ for info in infos:
+ with zipfp.open(info) as f:
+ data += f.read()
+ self.assertTrue(data == "foobar" or data == "barfoo")
+ data = ""
+ for info in infos:
+ data += zipfp.read(info)
+ self.assertTrue(data == "foobar" or data == "barfoo")
+
+ def zip_random_open_test(self, f, compression):
+ self.make_test_archive(f, compression)
- zipfp = zipfile.ZipFile(TESTFN2, "r")
- infos = zipfp.infolist()
- data = ""
- for info in infos:
- data += zipfp.open(info).read()
- self.assert_(data == "foobar" or data == "barfoo")
- data = ""
- for info in infos:
- data += zipfp.read(info)
- self.assert_(data == "foobar" or data == "barfoo")
- zipfp.close()
+ # Read the ZIP archive
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ zipdata1 = []
+ with zipfp.open(TESTFN) as zipopen1:
+ while True:
+ read_data = zipopen1.read(randint(1, 1024))
+ if not read_data:
+ break
+ zipdata1.append(read_data)
+
+ self.assertEqual(''.join(zipdata1), self.data)
+
+ def test_random_open_stored(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_random_open_test(f, zipfile.ZIP_STORED)
- def zipRandomOpenTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def test_univeral_readaheads(self):
+ f = StringIO()
- # Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- zipdata1 = []
- zipopen1 = zipfp.open(TESTFN)
- while 1:
- read_data = zipopen1.read(randint(1, 1024))
- if not read_data:
- break
- zipdata1.append(read_data)
-
- self.assertEqual(''.join(zipdata1), self.data)
- zipfp.close()
+ data = 'a\r\n' * 16 * 1024
+ with zipfile.ZipFile(f, 'w', zipfile.ZIP_STORED) as zipfp:
+ zipfp.writestr(TESTFN, data)
- def testRandomOpenStored(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipRandomOpenTest(f, zipfile.ZIP_STORED)
+ data2 = ''
+ with zipfile.ZipFile(f, 'r') as zipfp:
+ with zipfp.open(TESTFN, 'rU') as zipopen:
+ for line in zipopen:
+ data2 += line
+
+ self.assertEqual(data, data2.replace('\n', '\r\n'))
- def zipReadlineTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_readline_read_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- zipopen = zipfp.open(TESTFN)
- for line in self.line_gen:
- linedata = zipopen.readline()
- self.assertEqual(linedata, line + '\n')
+ with zipfile.ZipFile(f, "r") as zipfp:
+ with zipfp.open(TESTFN) as zipopen:
+ data = ''
+ while True:
+ read = zipopen.readline()
+ if not read:
+ break
+ data += read
- zipfp.close()
+ read = zipopen.read(100)
+ if not read:
+ break
+ data += read
+
+ self.assertEqual(data, self.data)
- def zipReadlinesTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_readline_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- ziplines = zipfp.open(TESTFN).readlines()
- for line, zipline in zip(self.line_gen, ziplines):
- self.assertEqual(zipline, line + '\n')
+ with zipfile.ZipFile(f, "r") as zipfp:
+ with zipfp.open(TESTFN) as zipopen:
+ for line in self.line_gen:
+ linedata = zipopen.readline()
+ self.assertEqual(linedata, line + '\n')
- zipfp.close()
+ def zip_readlines_test(self, f, compression):
+ self.make_test_archive(f, compression)
- def zipIterlinesTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ # Read the ZIP archive
+ with zipfile.ZipFile(f, "r") as zipfp:
+ with zipfp.open(TESTFN) as zo:
+ ziplines = zo.readlines()
+ for line, zipline in zip(self.line_gen, ziplines):
+ self.assertEqual(zipline, line + '\n')
+
+ def zip_iterlines_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- for line, zipline in zip(self.line_gen, zipfp.open(TESTFN)):
- self.assertEqual(zipline, line + '\n')
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for line, zipline in zip(self.line_gen, zipfp.open(TESTFN)):
+ self.assertEqual(zipline, line + '\n')
- zipfp.close()
+ def test_readline_read_stored(self):
+ # Issue #7610: calls to readline() interleaved with calls to read().
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_readline_read_test(f, zipfile.ZIP_STORED)
- def testReadlineStored(self):
+ def test_readline_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipReadlineTest(f, zipfile.ZIP_STORED)
+ self.zip_readline_test(f, zipfile.ZIP_STORED)
- def testReadlinesStored(self):
+ def test_readlines_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipReadlinesTest(f, zipfile.ZIP_STORED)
+ self.zip_readlines_test(f, zipfile.ZIP_STORED)
- def testIterlinesStored(self):
+ def test_iterlines_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipIterlinesTest(f, zipfile.ZIP_STORED)
+ self.zip_iterlines_test(f, zipfile.ZIP_STORED)
- if zlib:
- def testDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_test(f, zipfile.ZIP_DEFLATED)
- def testOpenDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipOpenTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_open_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_open_test(f, zipfile.ZIP_DEFLATED)
+
+ @skipUnless(zlib, "requires zlib")
+ def test_random_open_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_random_open_test(f, zipfile.ZIP_DEFLATED)
- def testRandomOpenDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipRandomOpenTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readline_read_deflated(self):
+ # Issue #7610: calls to readline() interleaved with calls to read().
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_readline_read_test(f, zipfile.ZIP_DEFLATED)
- def testReadlineDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipReadlineTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readline_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_readline_test(f, zipfile.ZIP_DEFLATED)
- def testReadlinesDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipReadlinesTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readlines_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_readlines_test(f, zipfile.ZIP_DEFLATED)
- def testIterlinesDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipIterlinesTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_iterlines_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_iterlines_test(f, zipfile.ZIP_DEFLATED)
- def testLowCompression(self):
- # Checks for cases where compressed data is larger than original
- # Create the ZIP archive
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_low_compression(self):
+ """Check for cases where compressed data is larger than original."""
+ # Create the ZIP archive
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED) as zipfp:
zipfp.writestr("strfile", '12')
- zipfp.close()
- # Get an open object for strfile
- zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_DEFLATED)
- openobj = zipfp.open("strfile")
- self.assertEqual(openobj.read(1), '1')
- self.assertEqual(openobj.read(1), '2')
+ # Get an open object for strfile
+ with zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_DEFLATED) as zipfp:
+ with zipfp.open("strfile") as openobj:
+ self.assertEqual(openobj.read(1), '1')
+ self.assertEqual(openobj.read(1), '2')
- def testAbsoluteArcnames(self):
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- zipfp.write(TESTFN, "/absolute")
- zipfp.close()
+ def test_absolute_arcnames(self):
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ zipfp.write(TESTFN, "/absolute")
- zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED)
- self.assertEqual(zipfp.namelist(), ["absolute"])
- zipfp.close()
+ with zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) as zipfp:
+ self.assertEqual(zipfp.namelist(), ["absolute"])
- def testAppendToZipFile(self):
- # Test appending to an existing zipfile
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- zipfp.write(TESTFN, TESTFN)
- zipfp.close()
- zipfp = zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED)
- zipfp.writestr("strfile", self.data)
- self.assertEqual(zipfp.namelist(), [TESTFN, "strfile"])
- zipfp.close()
+ def test_append_to_zip_file(self):
+ """Test appending to an existing zipfile."""
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ zipfp.write(TESTFN, TESTFN)
+
+ with zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED) as zipfp:
+ zipfp.writestr("strfile", self.data)
+ self.assertEqual(zipfp.namelist(), [TESTFN, "strfile"])
- def testAppendToNonZipFile(self):
- # Test appending to an existing file that is not a zipfile
+ def test_append_to_non_zip_file(self):
+ """Test appending to an existing file that is not a zipfile."""
# NOTE: this test fails if len(d) < 22 because of the first
# line "fpin.seek(-22, 2)" in _EndRecData
- d = 'I am not a ZipFile!'*10
- f = file(TESTFN2, 'wb')
- f.write(d)
- f.close()
- zipfp = zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED)
- zipfp.write(TESTFN, TESTFN)
- zipfp.close()
-
- f = file(TESTFN2, 'rb')
- f.seek(len(d))
- zipfp = zipfile.ZipFile(f, "r")
- self.assertEqual(zipfp.namelist(), [TESTFN])
- zipfp.close()
- f.close()
-
- def test_WriteDefaultName(self):
- # Check that calling ZipFile.write without arcname specified produces the expected result
- zipfp = zipfile.ZipFile(TESTFN2, "w")
- zipfp.write(TESTFN)
- self.assertEqual(zipfp.read(TESTFN), file(TESTFN).read())
- zipfp.close()
-
- def test_PerFileCompression(self):
- # Check that files within a Zip archive can have different compression options
- zipfp = zipfile.ZipFile(TESTFN2, "w")
- zipfp.write(TESTFN, 'storeme', zipfile.ZIP_STORED)
- zipfp.write(TESTFN, 'deflateme', zipfile.ZIP_DEFLATED)
- sinfo = zipfp.getinfo('storeme')
- dinfo = zipfp.getinfo('deflateme')
- self.assertEqual(sinfo.compress_type, zipfile.ZIP_STORED)
- self.assertEqual(dinfo.compress_type, zipfile.ZIP_DEFLATED)
- zipfp.close()
-
- def test_WriteToReadonly(self):
- # Check that trying to call write() on a readonly ZipFile object
- # raises a RuntimeError
- zipf = zipfile.ZipFile(TESTFN2, mode="w")
- zipf.writestr("somefile.txt", "bogus")
- zipf.close()
- zipf = zipfile.ZipFile(TESTFN2, mode="r")
- self.assertRaises(RuntimeError, zipf.write, TESTFN)
- zipf.close()
-
- def testExtract(self):
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- for fpath, fdata in SMALL_TEST_DATA:
- zipfp.writestr(fpath, fdata)
- zipfp.close()
-
- zipfp = zipfile.ZipFile(TESTFN2, "r")
- for fpath, fdata in SMALL_TEST_DATA:
- writtenfile = zipfp.extract(fpath)
+ data = 'I am not a ZipFile!'*10
+ with open(TESTFN2, 'wb') as f:
+ f.write(data)
+
+ with zipfile.ZipFile(TESTFN2, "a", zipfile.ZIP_STORED) as zipfp:
+ zipfp.write(TESTFN, TESTFN)
+
+ with open(TESTFN2, 'rb') as f:
+ f.seek(len(data))
+ with zipfile.ZipFile(f, "r") as zipfp:
+ self.assertEqual(zipfp.namelist(), [TESTFN])
+
+ def test_write_default_name(self):
+ """Check that calling ZipFile.write without arcname specified
+ produces the expected result."""
+ with zipfile.ZipFile(TESTFN2, "w") as zipfp:
+ zipfp.write(TESTFN)
+ self.assertEqual(zipfp.read(TESTFN), open(TESTFN).read())
+
+ @skipUnless(zlib, "requires zlib")
+ def test_per_file_compression(self):
+ """Check that files within a Zip archive can have different
+ compression options."""
+ with zipfile.ZipFile(TESTFN2, "w") as zipfp:
+ zipfp.write(TESTFN, 'storeme', zipfile.ZIP_STORED)
+ zipfp.write(TESTFN, 'deflateme', zipfile.ZIP_DEFLATED)
+ sinfo = zipfp.getinfo('storeme')
+ dinfo = zipfp.getinfo('deflateme')
+ self.assertEqual(sinfo.compress_type, zipfile.ZIP_STORED)
+ self.assertEqual(dinfo.compress_type, zipfile.ZIP_DEFLATED)
+
+ def test_write_to_readonly(self):
+ """Check that trying to call write() on a readonly ZipFile object
+ raises a RuntimeError."""
+ with zipfile.ZipFile(TESTFN2, mode="w") as zipfp:
+ zipfp.writestr("somefile.txt", "bogus")
+
+ with zipfile.ZipFile(TESTFN2, mode="r") as zipfp:
+ self.assertRaises(RuntimeError, zipfp.write, TESTFN)
+
+ def test_extract(self):
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ zipfp.writestr(fpath, fdata)
+
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ writtenfile = zipfp.extract(fpath)
+
+ # make sure it was written to the right place
+ if os.path.isabs(fpath):
+ correctfile = os.path.join(os.getcwd(), fpath[1:])
+ else:
+ correctfile = os.path.join(os.getcwd(), fpath)
+ correctfile = os.path.normpath(correctfile)
+
+ self.assertEqual(writtenfile, correctfile)
+
+ # make sure correct data is in correct file
+ self.assertEqual(fdata, open(writtenfile, "rb").read())
+ os.remove(writtenfile)
- # make sure it was written to the right place
- if os.path.isabs(fpath):
- correctfile = os.path.join(os.getcwd(), fpath[1:])
- else:
- correctfile = os.path.join(os.getcwd(), fpath)
- correctfile = os.path.normpath(correctfile)
+ # remove the test file subdirectories
+ shutil.rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
- self.assertEqual(writtenfile, correctfile)
+ def test_extract_all(self):
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED) as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ zipfp.writestr(fpath, fdata)
- # make sure correct data is in correct file
- self.assertEqual(fdata, file(writtenfile, "rb").read())
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp:
+ zipfp.extractall()
+ for fpath, fdata in SMALL_TEST_DATA:
+ if os.path.isabs(fpath):
+ outfile = os.path.join(os.getcwd(), fpath[1:])
+ else:
+ outfile = os.path.join(os.getcwd(), fpath)
- os.remove(writtenfile)
-
- zipfp.close()
+ self.assertEqual(fdata, open(outfile, "rb").read())
+ os.remove(outfile)
# remove the test file subdirectories
shutil.rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
- def testExtractAll(self):
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED)
- for fpath, fdata in SMALL_TEST_DATA:
- zipfp.writestr(fpath, fdata)
- zipfp.close()
-
- zipfp = zipfile.ZipFile(TESTFN2, "r")
- zipfp.extractall()
- for fpath, fdata in SMALL_TEST_DATA:
- if os.path.isabs(fpath):
- outfile = os.path.join(os.getcwd(), fpath[1:])
- else:
- outfile = os.path.join(os.getcwd(), fpath)
+ def test_writestr_compression(self):
+ zipfp = zipfile.ZipFile(TESTFN2, "w")
+ zipfp.writestr("a.txt", "hello world", compress_type=zipfile.ZIP_STORED)
+ if zlib:
+ zipfp.writestr("b.txt", "hello world", compress_type=zipfile.ZIP_DEFLATED)
- self.assertEqual(fdata, file(outfile, "rb").read())
+ info = zipfp.getinfo('a.txt')
+ self.assertEqual(info.compress_type, zipfile.ZIP_STORED)
- os.remove(outfile)
+ if zlib:
+ info = zipfp.getinfo('b.txt')
+ self.assertEqual(info.compress_type, zipfile.ZIP_DEFLATED)
- zipfp.close()
-
- # remove the test file subdirectories
- shutil.rmtree(os.path.join(os.getcwd(), 'ziptest2dir'))
def zip_test_writestr_permissions(self, f, compression):
# Make sure that writestr creates files with mode 0600,
# when it is passed a name rather than a ZipInfo instance.
- self.makeTestArchive(f, compression)
- zipfp = zipfile.ZipFile(f, "r")
- zinfo = zipfp.getinfo('strfile')
- self.assertEqual(zinfo.external_attr, 0600 << 16)
+ self.make_test_archive(f, compression)
+ with zipfile.ZipFile(f, "r") as zipfp:
+ zinfo = zipfp.getinfo('strfile')
+ self.assertEqual(zinfo.external_attr, 0600 << 16)
def test_writestr_permissions(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
self.zip_test_writestr_permissions(f, zipfile.ZIP_STORED)
+ def test_close(self):
+ """Check that the zipfile is closed after the 'with' block."""
+ with zipfile.ZipFile(TESTFN2, "w") as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ zipfp.writestr(fpath, fdata)
+ self.assertTrue(zipfp.fp is not None, 'zipfp is not open')
+ self.assertTrue(zipfp.fp is None, 'zipfp is not closed')
+
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp:
+ self.assertTrue(zipfp.fp is not None, 'zipfp is not open')
+ self.assertTrue(zipfp.fp is None, 'zipfp is not closed')
+
+ def test_close_on_exception(self):
+ """Check that the zipfile is closed if an exception is raised in the
+ 'with' block."""
+ with zipfile.ZipFile(TESTFN2, "w") as zipfp:
+ for fpath, fdata in SMALL_TEST_DATA:
+ zipfp.writestr(fpath, fdata)
+
+ try:
+ with zipfile.ZipFile(TESTFN2, "r") as zipfp2:
+ raise zipfile.BadZipfile()
+ except zipfile.BadZipfile:
+ self.assertTrue(zipfp2.fp is None, 'zipfp is not closed')
+
def tearDown(self):
- os.remove(TESTFN)
- os.remove(TESTFN2)
+ unlink(TESTFN)
+ unlink(TESTFN2)
+
class TestZip64InSmallFiles(unittest.TestCase):
# These tests test the ZIP64 functionality without using large files,
@@ -398,206 +472,218 @@ class TestZip64InSmallFiles(unittest.TestCase):
self._limit = zipfile.ZIP64_LIMIT
zipfile.ZIP64_LIMIT = 5
- line_gen = ("Test of zipfile line %d." % i for i in range(0, FIXEDTEST_SIZE))
+ line_gen = ("Test of zipfile line %d." % i
+ for i in range(0, FIXEDTEST_SIZE))
self.data = '\n'.join(line_gen)
# Make a source file with some lines
- fp = open(TESTFN, "wb")
- fp.write(self.data)
- fp.close()
-
- def largeFileExceptionTest(self, f, compression):
- zipfp = zipfile.ZipFile(f, "w", compression)
- self.assertRaises(zipfile.LargeZipFile,
- zipfp.write, TESTFN, "another"+os.extsep+"name")
- zipfp.close()
+ with open(TESTFN, "wb") as fp:
+ fp.write(self.data)
- def largeFileExceptionTest2(self, f, compression):
- zipfp = zipfile.ZipFile(f, "w", compression)
- self.assertRaises(zipfile.LargeZipFile,
- zipfp.writestr, "another"+os.extsep+"name", self.data)
- zipfp.close()
+ def large_file_exception_test(self, f, compression):
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ self.assertRaises(zipfile.LargeZipFile,
+ zipfp.write, TESTFN, "another.name")
+
+ def large_file_exception_test2(self, f, compression):
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ self.assertRaises(zipfile.LargeZipFile,
+ zipfp.writestr, "another.name", self.data)
- def testLargeFileException(self):
+ def test_large_file_exception(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.largeFileExceptionTest(f, zipfile.ZIP_STORED)
- self.largeFileExceptionTest2(f, zipfile.ZIP_STORED)
+ self.large_file_exception_test(f, zipfile.ZIP_STORED)
+ self.large_file_exception_test2(f, zipfile.ZIP_STORED)
- def zipTest(self, f, compression):
+ def zip_test(self, f, compression):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(f, "w", compression, allowZip64=True)
- zipfp.write(TESTFN, "another"+os.extsep+"name")
- zipfp.write(TESTFN, TESTFN)
- zipfp.writestr("strfile", self.data)
- zipfp.close()
+ with zipfile.ZipFile(f, "w", compression, allowZip64=True) as zipfp:
+ zipfp.write(TESTFN, "another.name")
+ zipfp.write(TESTFN, TESTFN)
+ zipfp.writestr("strfile", self.data)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- self.assertEqual(zipfp.read(TESTFN), self.data)
- self.assertEqual(zipfp.read("another"+os.extsep+"name"), self.data)
- self.assertEqual(zipfp.read("strfile"), self.data)
-
- # Print the ZIP directory
- fp = StringIO()
- stdout = sys.stdout
- try:
- sys.stdout = fp
-
- zipfp.printdir()
- finally:
- sys.stdout = stdout
-
- directory = fp.getvalue()
- lines = directory.splitlines()
- self.assertEquals(len(lines), 4) # Number of files + header
-
- self.assert_('File Name' in lines[0])
- self.assert_('Modified' in lines[0])
- self.assert_('Size' in lines[0])
-
- fn, date, time, size = lines[1].split()
- self.assertEquals(fn, 'another.name')
- # XXX: timestamp is not tested
- self.assertEquals(size, str(len(self.data)))
-
- # Check the namelist
- names = zipfp.namelist()
- self.assertEquals(len(names), 3)
- self.assert_(TESTFN in names)
- self.assert_("another"+os.extsep+"name" in names)
- self.assert_("strfile" in names)
-
- # Check infolist
- infos = zipfp.infolist()
- names = [ i.filename for i in infos ]
- self.assertEquals(len(names), 3)
- self.assert_(TESTFN in names)
- self.assert_("another"+os.extsep+"name" in names)
- self.assert_("strfile" in names)
- for i in infos:
- self.assertEquals(i.file_size, len(self.data))
-
- # check getinfo
- for nm in (TESTFN, "another"+os.extsep+"name", "strfile"):
- info = zipfp.getinfo(nm)
- self.assertEquals(info.filename, nm)
- self.assertEquals(info.file_size, len(self.data))
-
- # Check that testzip doesn't raise an exception
- zipfp.testzip()
-
-
- zipfp.close()
-
- def testStored(self):
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ self.assertEqual(zipfp.read(TESTFN), self.data)
+ self.assertEqual(zipfp.read("another.name"), self.data)
+ self.assertEqual(zipfp.read("strfile"), self.data)
+
+ # Print the ZIP directory
+ fp = StringIO()
+ stdout = sys.stdout
+ try:
+ sys.stdout = fp
+ zipfp.printdir()
+ finally:
+ sys.stdout = stdout
+
+ directory = fp.getvalue()
+ lines = directory.splitlines()
+ self.assertEqual(len(lines), 4) # Number of files + header
+
+ self.assertIn('File Name', lines[0])
+ self.assertIn('Modified', lines[0])
+ self.assertIn('Size', lines[0])
+
+ fn, date, time_, size = lines[1].split()
+ self.assertEqual(fn, 'another.name')
+ self.assertTrue(time.strptime(date, '%Y-%m-%d'))
+ self.assertTrue(time.strptime(time_, '%H:%M:%S'))
+ self.assertEqual(size, str(len(self.data)))
+
+ # Check the namelist
+ names = zipfp.namelist()
+ self.assertEqual(len(names), 3)
+ self.assertIn(TESTFN, names)
+ self.assertIn("another.name", names)
+ self.assertIn("strfile", names)
+
+ # Check infolist
+ infos = zipfp.infolist()
+ names = [i.filename for i in infos]
+ self.assertEqual(len(names), 3)
+ self.assertIn(TESTFN, names)
+ self.assertIn("another.name", names)
+ self.assertIn("strfile", names)
+ for i in infos:
+ self.assertEqual(i.file_size, len(self.data))
+
+ # check getinfo
+ for nm in (TESTFN, "another.name", "strfile"):
+ info = zipfp.getinfo(nm)
+ self.assertEqual(info.filename, nm)
+ self.assertEqual(info.file_size, len(self.data))
+
+ # Check that testzip doesn't raise an exception
+ zipfp.testzip()
+
+ def test_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipTest(f, zipfile.ZIP_STORED)
+ self.zip_test(f, zipfile.ZIP_STORED)
+ @skipUnless(zlib, "requires zlib")
+ def test_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.zip_test(f, zipfile.ZIP_DEFLATED)
- if zlib:
- def testDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipTest(f, zipfile.ZIP_DEFLATED)
+ def test_absolute_arcnames(self):
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED,
+ allowZip64=True) as zipfp:
+ zipfp.write(TESTFN, "/absolute")
- def testAbsoluteArcnames(self):
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_STORED, allowZip64=True)
- zipfp.write(TESTFN, "/absolute")
- zipfp.close()
-
- zipfp = zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED)
- self.assertEqual(zipfp.namelist(), ["absolute"])
- zipfp.close()
+ with zipfile.ZipFile(TESTFN2, "r", zipfile.ZIP_STORED) as zipfp:
+ self.assertEqual(zipfp.namelist(), ["absolute"])
def tearDown(self):
zipfile.ZIP64_LIMIT = self._limit
- os.remove(TESTFN)
- os.remove(TESTFN2)
+ unlink(TESTFN)
+ unlink(TESTFN2)
+
class PyZipFileTests(unittest.TestCase):
- def testWritePyfile(self):
- zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
- fn = __file__
- if fn.endswith('.pyc') or fn.endswith('.pyo'):
- fn = fn[:-1]
+ def test_write_pyfile(self):
+ with zipfile.PyZipFile(TemporaryFile(), "w") as zipfp:
+ fn = __file__
+ if fn.endswith('.pyc') or fn.endswith('.pyo'):
+ fn = fn[:-1]
- zipfp.writepy(fn)
+ zipfp.writepy(fn)
- bn = os.path.basename(fn)
- self.assert_(bn not in zipfp.namelist())
- self.assert_(bn + 'o' in zipfp.namelist() or bn + 'c' in zipfp.namelist())
- zipfp.close()
+ bn = os.path.basename(fn)
+ self.assertNotIn(bn, zipfp.namelist())
+ self.assertTrue(bn + 'o' in zipfp.namelist() or
+ bn + 'c' in zipfp.namelist())
+ with zipfile.PyZipFile(TemporaryFile(), "w") as zipfp:
+ fn = __file__
+ if fn.endswith(('.pyc', '.pyo')):
+ fn = fn[:-1]
- zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
- fn = __file__
- if fn.endswith('.pyc') or fn.endswith('.pyo'):
- fn = fn[:-1]
+ zipfp.writepy(fn, "testpackage")
- zipfp.writepy(fn, "testpackage")
+ bn = "%s/%s" % ("testpackage", os.path.basename(fn))
+ self.assertNotIn(bn, zipfp.namelist())
+ self.assertTrue(bn + 'o' in zipfp.namelist() or
+ bn + 'c' in zipfp.namelist())
- bn = "%s/%s"%("testpackage", os.path.basename(fn))
- self.assert_(bn not in zipfp.namelist())
- self.assert_(bn + 'o' in zipfp.namelist() or bn + 'c' in zipfp.namelist())
- zipfp.close()
-
- def testWritePythonPackage(self):
+ def test_write_python_package(self):
import email
packagedir = os.path.dirname(email.__file__)
- zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
- zipfp.writepy(packagedir)
+ with zipfile.PyZipFile(TemporaryFile(), "w") as zipfp:
+ zipfp.writepy(packagedir)
- # Check for a couple of modules at different levels of the hieararchy
- names = zipfp.namelist()
- self.assert_('email/__init__.pyo' in names or 'email/__init__.pyc' in names)
- self.assert_('email/mime/text.pyo' in names or 'email/mime/text.pyc' in names)
+ # Check for a couple of modules at different levels of the
+ # hierarchy
+ names = zipfp.namelist()
+ self.assertTrue('email/__init__.pyo' in names or
+ 'email/__init__.pyc' in names)
+ self.assertTrue('email/mime/text.pyo' in names or
+ 'email/mime/text.pyc' in names)
- def testWritePythonDirectory(self):
+ def test_write_python_directory(self):
os.mkdir(TESTFN2)
try:
- fp = open(os.path.join(TESTFN2, "mod1.py"), "w")
- fp.write("print 42\n")
- fp.close()
+ with open(os.path.join(TESTFN2, "mod1.py"), "w") as fp:
+ fp.write("print(42)\n")
- fp = open(os.path.join(TESTFN2, "mod2.py"), "w")
- fp.write("print 42 * 42\n")
- fp.close()
+ with open(os.path.join(TESTFN2, "mod2.py"), "w") as fp:
+ fp.write("print(42 * 42)\n")
- fp = open(os.path.join(TESTFN2, "mod2.txt"), "w")
- fp.write("bla bla bla\n")
- fp.close()
+ with open(os.path.join(TESTFN2, "mod2.txt"), "w") as fp:
+ fp.write("bla bla bla\n")
zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
zipfp.writepy(TESTFN2)
names = zipfp.namelist()
- self.assert_('mod1.pyc' in names or 'mod1.pyo' in names)
- self.assert_('mod2.pyc' in names or 'mod2.pyo' in names)
- self.assert_('mod2.txt' not in names)
+ self.assertTrue('mod1.pyc' in names or 'mod1.pyo' in names)
+ self.assertTrue('mod2.pyc' in names or 'mod2.pyo' in names)
+ self.assertNotIn('mod2.txt', names)
finally:
shutil.rmtree(TESTFN2)
- def testWriteNonPyfile(self):
- zipfp = zipfile.PyZipFile(TemporaryFile(), "w")
- file(TESTFN, 'w').write('most definitely not a python file')
- self.assertRaises(RuntimeError, zipfp.writepy, TESTFN)
- os.remove(TESTFN)
+ def test_write_non_pyfile(self):
+ with zipfile.PyZipFile(TemporaryFile(), "w") as zipfp:
+ open(TESTFN, 'w').write('most definitely not a python file')
+ self.assertRaises(RuntimeError, zipfp.writepy, TESTFN)
+ os.remove(TESTFN)
class OtherTests(unittest.TestCase):
- def testUnicodeFilenames(self):
- zf = zipfile.ZipFile(TESTFN, "w")
- zf.writestr(u"foo.txt", "Test for unicode filename")
- zf.writestr(u"\xf6.txt", "Test for unicode filename")
- self.assertTrue(isinstance(zf.infolist()[0].filename, unicode))
- zf.close()
- zf = zipfile.ZipFile(TESTFN, "r")
- self.assertEqual(zf.filelist[0].filename, "foo.txt")
- self.assertEqual(zf.filelist[1].filename, u"\xf6.txt")
- zf.close()
-
- def testCreateNonExistentFileForAppend(self):
+ zips_with_bad_crc = {
+ zipfile.ZIP_STORED: (
+ b'PK\003\004\024\0\0\0\0\0 \213\212;:r'
+ b'\253\377\f\0\0\0\f\0\0\0\005\0\0\000af'
+ b'ilehello,AworldP'
+ b'K\001\002\024\003\024\0\0\0\0\0 \213\212;:'
+ b'r\253\377\f\0\0\0\f\0\0\0\005\0\0\0\0'
+ b'\0\0\0\0\0\0\0\200\001\0\0\0\000afi'
+ b'lePK\005\006\0\0\0\0\001\0\001\0003\000'
+ b'\0\0/\0\0\0\0\0'),
+ zipfile.ZIP_DEFLATED: (
+ b'PK\x03\x04\x14\x00\x00\x00\x08\x00n}\x0c=FA'
+ b'KE\x10\x00\x00\x00n\x00\x00\x00\x05\x00\x00\x00af'
+ b'ile\xcbH\xcd\xc9\xc9W(\xcf/\xcaI\xc9\xa0'
+ b'=\x13\x00PK\x01\x02\x14\x03\x14\x00\x00\x00\x08\x00n'
+ b'}\x0c=FAKE\x10\x00\x00\x00n\x00\x00\x00\x05'
+ b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x00'
+ b'\x00afilePK\x05\x06\x00\x00\x00\x00\x01\x00'
+ b'\x01\x003\x00\x00\x003\x00\x00\x00\x00\x00'),
+ }
+
+ def test_unicode_filenames(self):
+ with zipfile.ZipFile(TESTFN, "w") as zf:
+ zf.writestr(u"foo.txt", "Test for unicode filename")
+ zf.writestr(u"\xf6.txt", "Test for unicode filename")
+ self.assertIsInstance(zf.infolist()[0].filename, unicode)
+
+ with zipfile.ZipFile(TESTFN, "r") as zf:
+ self.assertEqual(zf.filelist[0].filename, "foo.txt")
+ self.assertEqual(zf.filelist[1].filename, u"\xf6.txt")
+
+ def test_create_non_existent_file_for_append(self):
if os.path.exists(TESTFN):
os.unlink(TESTFN)
@@ -605,52 +691,74 @@ class OtherTests(unittest.TestCase):
content = 'hello, world. this is some content.'
try:
- zf = zipfile.ZipFile(TESTFN, 'a')
- zf.writestr(filename, content)
- zf.close()
- except IOError, (errno, errmsg):
+ with zipfile.ZipFile(TESTFN, 'a') as zf:
+ zf.writestr(filename, content)
+ except IOError:
self.fail('Could not append data to a non-existent zip file.')
- self.assert_(os.path.exists(TESTFN))
+ self.assertTrue(os.path.exists(TESTFN))
- zf = zipfile.ZipFile(TESTFN, 'r')
- self.assertEqual(zf.read(filename), content)
- zf.close()
+ with zipfile.ZipFile(TESTFN, 'r') as zf:
+ self.assertEqual(zf.read(filename), content)
- def testCloseErroneousFile(self):
+ def test_close_erroneous_file(self):
# This test checks that the ZipFile constructor closes the file object
- # it opens if there's an error in the file. If it doesn't, the traceback
- # holds a reference to the ZipFile object and, indirectly, the file object.
+ # it opens if there's an error in the file. If it doesn't, the
+ # traceback holds a reference to the ZipFile object and, indirectly,
+ # the file object.
# On Windows, this causes the os.unlink() call to fail because the
# underlying file is still open. This is SF bug #412214.
#
- fp = open(TESTFN, "w")
- fp.write("this is not a legal zip file\n")
- fp.close()
+ with open(TESTFN, "w") as fp:
+ fp.write("this is not a legal zip file\n")
try:
zf = zipfile.ZipFile(TESTFN)
except zipfile.BadZipfile:
pass
- def testIsZipErroneousFile(self):
- # This test checks that the is_zipfile function correctly identifies
- # a file that is not a zip file
- fp = open(TESTFN, "w")
- fp.write("this is not a legal zip file\n")
- fp.close()
+ def test_is_zip_erroneous_file(self):
+ """Check that is_zipfile() correctly identifies non-zip files."""
+ # - passing a filename
+ with open(TESTFN, "w") as fp:
+ fp.write("this is not a legal zip file\n")
chk = zipfile.is_zipfile(TESTFN)
- self.assert_(chk is False)
-
- def testIsZipValidFile(self):
- # This test checks that the is_zipfile function correctly identifies
- # a file that is a zip file
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
+ self.assertFalse(chk)
+ # - passing a file object
+ with open(TESTFN, "rb") as fp:
+ chk = zipfile.is_zipfile(fp)
+ self.assertTrue(not chk)
+ # - passing a file-like object
+ fp = StringIO()
+ fp.write("this is not a legal zip file\n")
+ chk = zipfile.is_zipfile(fp)
+ self.assertTrue(not chk)
+ fp.seek(0, 0)
+ chk = zipfile.is_zipfile(fp)
+ self.assertTrue(not chk)
+
+ def test_is_zip_valid_file(self):
+ """Check that is_zipfile() correctly identifies zip files."""
+ # - passing a filename
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
chk = zipfile.is_zipfile(TESTFN)
- self.assert_(chk is True)
-
- def testNonExistentFileRaisesIOError(self):
+ self.assertTrue(chk)
+ # - passing a file object
+ with open(TESTFN, "rb") as fp:
+ chk = zipfile.is_zipfile(fp)
+ self.assertTrue(chk)
+ fp.seek(0, 0)
+ zip_contents = fp.read()
+ # - passing a file-like object
+ fp = StringIO()
+ fp.write(zip_contents)
+ chk = zipfile.is_zipfile(fp)
+ self.assertTrue(chk)
+ fp.seek(0, 0)
+ chk = zipfile.is_zipfile(fp)
+ self.assertTrue(chk)
+
+ def test_non_existent_file_raises_IOError(self):
# make sure we don't raise an AttributeError when a partially-constructed
# ZipFile instance is finalized; this tests for regression on SF tracker
# bug #403871.
@@ -665,21 +773,19 @@ class OtherTests(unittest.TestCase):
self.assertRaises(IOError, zipfile.ZipFile, TESTFN)
def test_empty_file_raises_BadZipFile(self):
- f = open(TESTFN, 'w')
- f.close()
+ with open(TESTFN, 'w') as f:
+ pass
self.assertRaises(zipfile.BadZipfile, zipfile.ZipFile, TESTFN)
- f = open(TESTFN, 'w')
- f.write("short file")
- f.close()
+ with open(TESTFN, 'w') as fp:
+ fp.write("short file")
self.assertRaises(zipfile.BadZipfile, zipfile.ZipFile, TESTFN)
- def testClosedZipRaisesRuntimeError(self):
- # Verify that testzip() doesn't swallow inappropriate exceptions.
+ def test_closed_zip_raises_RuntimeError(self):
+ """Verify that testzip() doesn't swallow inappropriate exceptions."""
data = StringIO()
- zipf = zipfile.ZipFile(data, mode="w")
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
+ with zipfile.ZipFile(data, mode="w") as zipf:
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
# This is correct; calling .read on a closed ZipFile should throw
# a RuntimeError, and so should calling .testzip. An earlier
@@ -689,109 +795,192 @@ class OtherTests(unittest.TestCase):
self.assertRaises(RuntimeError, zipf.open, "foo.txt")
self.assertRaises(RuntimeError, zipf.testzip)
self.assertRaises(RuntimeError, zipf.writestr, "bogus.txt", "bogus")
- file(TESTFN, 'w').write('zipfile test data')
+ open(TESTFN, 'w').write('zipfile test data')
self.assertRaises(RuntimeError, zipf.write, TESTFN)
- def test_BadConstructorMode(self):
- # Check that bad modes passed to ZipFile constructor are caught
+ def test_bad_constructor_mode(self):
+ """Check that bad modes passed to ZipFile constructor are caught."""
self.assertRaises(RuntimeError, zipfile.ZipFile, TESTFN, "q")
- def test_BadOpenMode(self):
- # Check that bad modes passed to ZipFile.open are caught
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipf = zipfile.ZipFile(TESTFN, mode="r")
- # read the data to make sure the file is there
- zipf.read("foo.txt")
- self.assertRaises(RuntimeError, zipf.open, "foo.txt", "q")
- zipf.close()
-
- def test_Read0(self):
- # Check that calling read(0) on a ZipExtFile object returns an empty
- # string and doesn't advance file pointer
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- # read the data to make sure the file is there
- f = zipf.open("foo.txt")
- for i in xrange(FIXEDTEST_SIZE):
- self.assertEqual(f.read(0), '')
-
- self.assertEqual(f.read(), "O, for a Muse of Fire!")
- zipf.close()
-
- def test_OpenNonexistentItem(self):
- # Check that attempting to call open() for an item that doesn't
- # exist in the archive raises a RuntimeError
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- self.assertRaises(KeyError, zipf.open, "foo.txt", "r")
+ def test_bad_open_mode(self):
+ """Check that bad modes passed to ZipFile.open are caught."""
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- def test_BadCompressionMode(self):
- # Check that bad compression methods passed to ZipFile.open are caught
+ with zipfile.ZipFile(TESTFN, mode="r") as zipf:
+ # read the data to make sure the file is there
+ zipf.read("foo.txt")
+ self.assertRaises(RuntimeError, zipf.open, "foo.txt", "q")
+
+ def test_read0(self):
+ """Check that calling read(0) on a ZipExtFile object returns an empty
+ string and doesn't advance file pointer."""
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+ # read the data to make sure the file is there
+ with zipf.open("foo.txt") as f:
+ for i in xrange(FIXEDTEST_SIZE):
+ self.assertEqual(f.read(0), '')
+
+ self.assertEqual(f.read(), "O, for a Muse of Fire!")
+
+ def test_open_non_existent_item(self):
+ """Check that attempting to call open() for an item that doesn't
+ exist in the archive raises a RuntimeError."""
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ self.assertRaises(KeyError, zipf.open, "foo.txt", "r")
+
+ def test_bad_compression_mode(self):
+ """Check that bad compression methods passed to ZipFile.open are
+ caught."""
self.assertRaises(RuntimeError, zipfile.ZipFile, TESTFN, "w", -1)
- def test_NullByteInFilename(self):
- # Check that a filename containing a null byte is properly terminated
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.writestr("foo.txt\x00qqq", "O, for a Muse of Fire!")
- self.assertEqual(zipf.namelist(), ['foo.txt'])
+ def test_null_byte_in_filename(self):
+ """Check that a filename containing a null byte is properly
+ terminated."""
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.writestr("foo.txt\x00qqq", "O, for a Muse of Fire!")
+ self.assertEqual(zipf.namelist(), ['foo.txt'])
- def test_StructSizes(self):
- # check that ZIP internal structure sizes are calculated correctly
+ def test_struct_sizes(self):
+ """Check that ZIP internal structure sizes are calculated correctly."""
self.assertEqual(zipfile.sizeEndCentDir, 22)
self.assertEqual(zipfile.sizeCentralDir, 46)
self.assertEqual(zipfile.sizeEndCentDir64, 56)
self.assertEqual(zipfile.sizeEndCentDir64Locator, 20)
- def testComments(self):
- # This test checks that comments on the archive are handled properly
+ def test_comments(self):
+ """Check that comments on the archive are handled properly."""
# check default comment is empty
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- self.assertEqual(zipf.comment, '')
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipfr = zipfile.ZipFile(TESTFN, mode="r")
- self.assertEqual(zipfr.comment, '')
- zipfr.close()
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ self.assertEqual(zipf.comment, '')
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+
+ with zipfile.ZipFile(TESTFN, mode="r") as zipf:
+ self.assertEqual(zipf.comment, '')
# check a simple short comment
comment = 'Bravely taking to his feet, he beat a very brave retreat.'
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.comment = comment
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipfr = zipfile.ZipFile(TESTFN, mode="r")
- self.assertEqual(zipfr.comment, comment)
- zipfr.close()
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.comment = comment
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+ with zipfile.ZipFile(TESTFN, mode="r") as zipf:
+ self.assertEqual(zipf.comment, comment)
# check a comment of max length
comment2 = ''.join(['%d' % (i**3 % 10) for i in xrange((1 << 16)-1)])
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.comment = comment2
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipfr = zipfile.ZipFile(TESTFN, mode="r")
- self.assertEqual(zipfr.comment, comment2)
- zipfr.close()
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.comment = comment2
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+
+ with zipfile.ZipFile(TESTFN, mode="r") as zipf:
+ self.assertEqual(zipf.comment, comment2)
# check a comment that is too long is truncated
- zipf = zipfile.ZipFile(TESTFN, mode="w")
- zipf.comment = comment2 + 'oops'
- zipf.writestr("foo.txt", "O, for a Muse of Fire!")
- zipf.close()
- zipfr = zipfile.ZipFile(TESTFN, mode="r")
- self.assertEqual(zipfr.comment, comment2)
- zipfr.close()
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ zipf.comment = comment2 + 'oops'
+ zipf.writestr("foo.txt", "O, for a Muse of Fire!")
+ with zipfile.ZipFile(TESTFN, mode="r") as zipf:
+ self.assertEqual(zipf.comment, comment2)
+
+ def check_testzip_with_bad_crc(self, compression):
+ """Tests that files with bad CRCs return their name from testzip."""
+ zipdata = self.zips_with_bad_crc[compression]
+
+ with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
+ # testzip returns the name of the first corrupt file, or None
+ self.assertEqual('afile', zipf.testzip())
+
+ def test_testzip_with_bad_crc_stored(self):
+ self.check_testzip_with_bad_crc(zipfile.ZIP_STORED)
+
+ @skipUnless(zlib, "requires zlib")
+ def test_testzip_with_bad_crc_deflated(self):
+ self.check_testzip_with_bad_crc(zipfile.ZIP_DEFLATED)
+
+ def check_read_with_bad_crc(self, compression):
+ """Tests that files with bad CRCs raise a BadZipfile exception when read."""
+ zipdata = self.zips_with_bad_crc[compression]
+
+ # Using ZipFile.read()
+ with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
+ self.assertRaises(zipfile.BadZipfile, zipf.read, 'afile')
+
+ # Using ZipExtFile.read()
+ with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
+ with zipf.open('afile', 'r') as corrupt_file:
+ self.assertRaises(zipfile.BadZipfile, corrupt_file.read)
+
+ # Same with small reads (in order to exercise the buffering logic)
+ with zipfile.ZipFile(io.BytesIO(zipdata), mode="r") as zipf:
+ with zipf.open('afile', 'r') as corrupt_file:
+ corrupt_file.MIN_READ_SIZE = 2
+ with self.assertRaises(zipfile.BadZipfile):
+ while corrupt_file.read(2):
+ pass
+
+ def test_read_with_bad_crc_stored(self):
+ self.check_read_with_bad_crc(zipfile.ZIP_STORED)
+
+ @skipUnless(zlib, "requires zlib")
+ def test_read_with_bad_crc_deflated(self):
+ self.check_read_with_bad_crc(zipfile.ZIP_DEFLATED)
+
+ def check_read_return_size(self, compression):
+ # Issue #9837: ZipExtFile.read() shouldn't return more bytes
+ # than requested.
+ for test_size in (1, 4095, 4096, 4097, 16384):
+ file_size = test_size + 1
+ junk = b''.join(struct.pack('B', randint(0, 255))
+ for x in range(file_size))
+ with zipfile.ZipFile(io.BytesIO(), "w", compression) as zipf:
+ zipf.writestr('foo', junk)
+ with zipf.open('foo', 'r') as fp:
+ buf = fp.read(test_size)
+ self.assertEqual(len(buf), test_size)
+
+ def test_read_return_size_stored(self):
+ self.check_read_return_size(zipfile.ZIP_STORED)
+
+ @skipUnless(zlib, "requires zlib")
+ def test_read_return_size_deflated(self):
+ self.check_read_return_size(zipfile.ZIP_DEFLATED)
+
+ def test_empty_zipfile(self):
+ # Check that creating a file in 'w' or 'a' mode and closing without
+ # adding any files to the archives creates a valid empty ZIP file
+ with zipfile.ZipFile(TESTFN, mode="w") as zipf:
+ pass
+ try:
+ zipf = zipfile.ZipFile(TESTFN, mode="r")
+ except zipfile.BadZipfile:
+ self.fail("Unable to create empty ZIP file in 'w' mode")
+
+ with zipfile.ZipFile(TESTFN, mode="a") as zipf:
+ pass
+ try:
+ zipf = zipfile.ZipFile(TESTFN, mode="r")
+ except:
+ self.fail("Unable to create empty ZIP file in 'a' mode")
+
+ def test_open_empty_file(self):
+ # Issue 1710703: Check that opening a file with less than 22 bytes
+ # raises a BadZipfile exception (rather than the previously unhelpful
+ # IOError)
+ with open(TESTFN, 'w') as f:
+ pass
+ self.assertRaises(zipfile.BadZipfile, zipfile.ZipFile, TESTFN, 'r')
def tearDown(self):
- support.unlink(TESTFN)
- support.unlink(TESTFN2)
+ unlink(TESTFN)
+ unlink(TESTFN2)
+
class DecryptionTests(unittest.TestCase):
- # This test checks that ZIP decryption works. Since the library does not
- # support encryption at the moment, we use a pre-generated encrypted
- # ZIP file
+ """Check that ZIP decryption works. Since the library does not
+ support encryption at the moment, we use a pre-generated encrypted
+ ZIP file."""
data = (
'PK\x03\x04\x14\x00\x01\x00\x00\x00n\x92i.#y\xef?&\x00\x00\x00\x1a\x00'
@@ -815,13 +1004,11 @@ class DecryptionTests(unittest.TestCase):
plain2 = '\x00'*512
def setUp(self):
- fp = open(TESTFN, "wb")
- fp.write(self.data)
- fp.close()
+ with open(TESTFN, "wb") as fp:
+ fp.write(self.data)
self.zip = zipfile.ZipFile(TESTFN, "r")
- fp = open(TESTFN2, "wb")
- fp.write(self.data2)
- fp.close()
+ with open(TESTFN2, "wb") as fp:
+ fp.write(self.data2)
self.zip2 = zipfile.ZipFile(TESTFN2, "r")
def tearDown(self):
@@ -830,176 +1017,185 @@ class DecryptionTests(unittest.TestCase):
self.zip2.close()
os.unlink(TESTFN2)
- def testNoPassword(self):
+ def test_no_password(self):
# Reading the encrypted file without password
# must generate a RunTime exception
self.assertRaises(RuntimeError, self.zip.read, "test.txt")
self.assertRaises(RuntimeError, self.zip2.read, "zero")
- def testBadPassword(self):
+ def test_bad_password(self):
self.zip.setpassword("perl")
self.assertRaises(RuntimeError, self.zip.read, "test.txt")
self.zip2.setpassword("perl")
self.assertRaises(RuntimeError, self.zip2.read, "zero")
- def testGoodPassword(self):
+ @skipUnless(zlib, "requires zlib")
+ def test_good_password(self):
self.zip.setpassword("python")
- self.assertEquals(self.zip.read("test.txt"), self.plain)
+ self.assertEqual(self.zip.read("test.txt"), self.plain)
self.zip2.setpassword("12345")
- self.assertEquals(self.zip2.read("zero"), self.plain2)
+ self.assertEqual(self.zip2.read("zero"), self.plain2)
class TestsWithRandomBinaryFiles(unittest.TestCase):
def setUp(self):
datacount = randint(16, 64)*1024 + randint(1, 1024)
- self.data = ''.join((struct.pack('<f', random()*randint(-1000, 1000)) for i in xrange(datacount)))
+ self.data = ''.join(struct.pack('<f', random()*randint(-1000, 1000))
+ for i in xrange(datacount))
# Make a source file with some lines
- fp = open(TESTFN, "wb")
- fp.write(self.data)
- fp.close()
+ with open(TESTFN, "wb") as fp:
+ fp.write(self.data)
def tearDown(self):
- support.unlink(TESTFN)
- support.unlink(TESTFN2)
+ unlink(TESTFN)
+ unlink(TESTFN2)
- def makeTestArchive(self, f, compression):
+ def make_test_archive(self, f, compression):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(f, "w", compression)
- zipfp.write(TESTFN, "another"+os.extsep+"name")
- zipfp.write(TESTFN, TESTFN)
- zipfp.close()
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ zipfp.write(TESTFN, "another.name")
+ zipfp.write(TESTFN, TESTFN)
- def zipTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def zip_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- testdata = zipfp.read(TESTFN)
- self.assertEqual(len(testdata), len(self.data))
- self.assertEqual(testdata, self.data)
- self.assertEqual(zipfp.read("another"+os.extsep+"name"), self.data)
- zipfp.close()
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ testdata = zipfp.read(TESTFN)
+ self.assertEqual(len(testdata), len(self.data))
+ self.assertEqual(testdata, self.data)
+ self.assertEqual(zipfp.read("another.name"), self.data)
- def testStored(self):
+ def test_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipTest(f, zipfile.ZIP_STORED)
+ self.zip_test(f, zipfile.ZIP_STORED)
- def zipOpenTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ @skipUnless(zlib, "requires zlib")
+ def test_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_test(f, zipfile.ZIP_DEFLATED)
- # Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- zipdata1 = []
- zipopen1 = zipfp.open(TESTFN)
- while 1:
- read_data = zipopen1.read(256)
- if not read_data:
- break
- zipdata1.append(read_data)
-
- zipdata2 = []
- zipopen2 = zipfp.open("another"+os.extsep+"name")
- while 1:
- read_data = zipopen2.read(256)
- if not read_data:
- break
- zipdata2.append(read_data)
-
- testdata1 = ''.join(zipdata1)
- self.assertEqual(len(testdata1), len(self.data))
- self.assertEqual(testdata1, self.data)
-
- testdata2 = ''.join(zipdata2)
- self.assertEqual(len(testdata1), len(self.data))
- self.assertEqual(testdata1, self.data)
- zipfp.close()
+ def zip_open_test(self, f, compression):
+ self.make_test_archive(f, compression)
- def testOpenStored(self):
+ # Read the ZIP archive
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ zipdata1 = []
+ with zipfp.open(TESTFN) as zipopen1:
+ while True:
+ read_data = zipopen1.read(256)
+ if not read_data:
+ break
+ zipdata1.append(read_data)
+
+ zipdata2 = []
+ with zipfp.open("another.name") as zipopen2:
+ while True:
+ read_data = zipopen2.read(256)
+ if not read_data:
+ break
+ zipdata2.append(read_data)
+
+ testdata1 = ''.join(zipdata1)
+ self.assertEqual(len(testdata1), len(self.data))
+ self.assertEqual(testdata1, self.data)
+
+ testdata2 = ''.join(zipdata2)
+ self.assertEqual(len(testdata2), len(self.data))
+ self.assertEqual(testdata2, self.data)
+
+ def test_open_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipOpenTest(f, zipfile.ZIP_STORED)
+ self.zip_open_test(f, zipfile.ZIP_STORED)
- def zipRandomOpenTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ @skipUnless(zlib, "requires zlib")
+ def test_open_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_open_test(f, zipfile.ZIP_DEFLATED)
- # Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r", compression)
- zipdata1 = []
- zipopen1 = zipfp.open(TESTFN)
- while 1:
- read_data = zipopen1.read(randint(1, 1024))
- if not read_data:
- break
- zipdata1.append(read_data)
-
- testdata = ''.join(zipdata1)
- self.assertEqual(len(testdata), len(self.data))
- self.assertEqual(testdata, self.data)
- zipfp.close()
+ def zip_random_open_test(self, f, compression):
+ self.make_test_archive(f, compression)
- def testRandomOpenStored(self):
+ # Read the ZIP archive
+ with zipfile.ZipFile(f, "r", compression) as zipfp:
+ zipdata1 = []
+ with zipfp.open(TESTFN) as zipopen1:
+ while True:
+ read_data = zipopen1.read(randint(1, 1024))
+ if not read_data:
+ break
+ zipdata1.append(read_data)
+
+ testdata = ''.join(zipdata1)
+ self.assertEqual(len(testdata), len(self.data))
+ self.assertEqual(testdata, self.data)
+
+ def test_random_open_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.zipRandomOpenTest(f, zipfile.ZIP_STORED)
+ self.zip_random_open_test(f, zipfile.ZIP_STORED)
+
+ @skipUnless(zlib, "requires zlib")
+ def test_random_open_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), io.BytesIO()):
+ self.zip_random_open_test(f, zipfile.ZIP_DEFLATED)
+
+@skipUnless(zlib, "requires zlib")
class TestsWithMultipleOpens(unittest.TestCase):
def setUp(self):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED)
- zipfp.writestr('ones', '1'*FIXEDTEST_SIZE)
- zipfp.writestr('twos', '2'*FIXEDTEST_SIZE)
- zipfp.close()
+ with zipfile.ZipFile(TESTFN2, "w", zipfile.ZIP_DEFLATED) as zipfp:
+ zipfp.writestr('ones', '1'*FIXEDTEST_SIZE)
+ zipfp.writestr('twos', '2'*FIXEDTEST_SIZE)
- def testSameFile(self):
+ def test_same_file(self):
# Verify that (when the ZipFile is in control of creating file objects)
# multiple open() calls can be made without interfering with each other.
- zipf = zipfile.ZipFile(TESTFN2, mode="r")
- zopen1 = zipf.open('ones')
- zopen2 = zipf.open('ones')
- data1 = zopen1.read(500)
- data2 = zopen2.read(500)
- data1 += zopen1.read(500)
- data2 += zopen2.read(500)
- self.assertEqual(data1, data2)
- zipf.close()
-
- def testDifferentFile(self):
+ with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
+ zopen1 = zipf.open('ones')
+ zopen2 = zipf.open('ones')
+ data1 = zopen1.read(500)
+ data2 = zopen2.read(500)
+ data1 += zopen1.read(500)
+ data2 += zopen2.read(500)
+ self.assertEqual(data1, data2)
+
+ def test_different_file(self):
# Verify that (when the ZipFile is in control of creating file objects)
# multiple open() calls can be made without interfering with each other.
- zipf = zipfile.ZipFile(TESTFN2, mode="r")
- zopen1 = zipf.open('ones')
- zopen2 = zipf.open('twos')
- data1 = zopen1.read(500)
- data2 = zopen2.read(500)
- data1 += zopen1.read(500)
- data2 += zopen2.read(500)
- self.assertEqual(data1, '1'*FIXEDTEST_SIZE)
- self.assertEqual(data2, '2'*FIXEDTEST_SIZE)
- zipf.close()
-
- def testInterleaved(self):
+ with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
+ with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2:
+ data1 = zopen1.read(500)
+ data2 = zopen2.read(500)
+ data1 += zopen1.read(500)
+ data2 += zopen2.read(500)
+ self.assertEqual(data1, '1'*FIXEDTEST_SIZE)
+ self.assertEqual(data2, '2'*FIXEDTEST_SIZE)
+
+ def test_interleaved(self):
# Verify that (when the ZipFile is in control of creating file objects)
# multiple open() calls can be made without interfering with each other.
- zipf = zipfile.ZipFile(TESTFN2, mode="r")
- zopen1 = zipf.open('ones')
- data1 = zopen1.read(500)
- zopen2 = zipf.open('twos')
- data2 = zopen2.read(500)
- data1 += zopen1.read(500)
- data2 += zopen2.read(500)
- self.assertEqual(data1, '1'*FIXEDTEST_SIZE)
- self.assertEqual(data2, '2'*FIXEDTEST_SIZE)
- zipf.close()
+ with zipfile.ZipFile(TESTFN2, mode="r") as zipf:
+ with zipf.open('ones') as zopen1, zipf.open('twos') as zopen2:
+ data1 = zopen1.read(500)
+ data2 = zopen2.read(500)
+ data1 += zopen1.read(500)
+ data2 += zopen2.read(500)
+ self.assertEqual(data1, '1'*FIXEDTEST_SIZE)
+ self.assertEqual(data2, '2'*FIXEDTEST_SIZE)
def tearDown(self):
- os.remove(TESTFN2)
+ unlink(TESTFN2)
+
class TestWithDirectory(unittest.TestCase):
def setUp(self):
os.mkdir(TESTFN2)
- def testExtractDir(self):
- zipf = zipfile.ZipFile(findfile("zipdir.zip"))
- zipf.extractall(TESTFN2)
+ def test_extract_dir(self):
+ with zipfile.ZipFile(findfile("zipdir.zip")) as zipf:
+ zipf.extractall(TESTFN2)
self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a")))
self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b")))
self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c")))
@@ -1007,9 +1203,9 @@ class TestWithDirectory(unittest.TestCase):
def test_bug_6050(self):
# Extraction should succeed if directories already exist
os.mkdir(os.path.join(TESTFN2, "a"))
- self.testExtractDir()
+ self.test_extract_dir()
- def testStoreDir(self):
+ def test_store_dir(self):
os.mkdir(os.path.join(TESTFN2, "x"))
zipf = zipfile.ZipFile(TESTFN, "w")
zipf.write(os.path.join(TESTFN2, "x"), "x")
@@ -1018,12 +1214,13 @@ class TestWithDirectory(unittest.TestCase):
def tearDown(self):
shutil.rmtree(TESTFN2)
if os.path.exists(TESTFN):
- os.remove(TESTFN)
+ unlink(TESTFN)
class UniversalNewlineTests(unittest.TestCase):
def setUp(self):
- self.line_gen = ["Test of zipfile line %d." % i for i in xrange(FIXEDTEST_SIZE)]
+ self.line_gen = ["Test of zipfile line %d." % i
+ for i in xrange(FIXEDTEST_SIZE)]
self.seps = ('\r', '\r\n', '\n')
self.arcdata, self.arcfiles = {}, {}
for n, s in enumerate(self.seps):
@@ -1031,105 +1228,135 @@ class UniversalNewlineTests(unittest.TestCase):
self.arcfiles[s] = '%s-%d' % (TESTFN, n)
open(self.arcfiles[s], "wb").write(self.arcdata[s])
- def makeTestArchive(self, f, compression):
+ def make_test_archive(self, f, compression):
# Create the ZIP archive
- zipfp = zipfile.ZipFile(f, "w", compression)
- for fn in self.arcfiles.values():
- zipfp.write(fn, fn)
- zipfp.close()
+ with zipfile.ZipFile(f, "w", compression) as zipfp:
+ for fn in self.arcfiles.values():
+ zipfp.write(fn, fn)
- def readTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def read_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- for sep, fn in self.arcfiles.items():
- zipdata = zipfp.open(fn, "rU").read()
- self.assertEqual(self.arcdata[sep], zipdata)
-
- zipfp.close()
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for sep, fn in self.arcfiles.items():
+ with zipfp.open(fn, "rU") as fp:
+ zipdata = fp.read()
+ self.assertEqual(self.arcdata[sep], zipdata)
- def readlineTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def readline_read_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
zipfp = zipfile.ZipFile(f, "r")
for sep, fn in self.arcfiles.items():
- zipopen = zipfp.open(fn, "rU")
- for line in self.line_gen:
- linedata = zipopen.readline()
- self.assertEqual(linedata, line + '\n')
+ with zipfp.open(fn, "rU") as zipopen:
+ data = ''
+ while True:
+ read = zipopen.readline()
+ if not read:
+ break
+ data += read
+
+ read = zipopen.read(5)
+ if not read:
+ break
+ data += read
+
+ self.assertEqual(data, self.arcdata['\n'])
zipfp.close()
- def readlinesTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ def readline_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- for sep, fn in self.arcfiles.items():
- ziplines = zipfp.open(fn, "rU").readlines()
- for line, zipline in zip(self.line_gen, ziplines):
- self.assertEqual(zipline, line + '\n')
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for sep, fn in self.arcfiles.items():
+ with zipfp.open(fn, "rU") as zipopen:
+ for line in self.line_gen:
+ linedata = zipopen.readline()
+ self.assertEqual(linedata, line + '\n')
- zipfp.close()
+ def readlines_test(self, f, compression):
+ self.make_test_archive(f, compression)
- def iterlinesTest(self, f, compression):
- self.makeTestArchive(f, compression)
+ # Read the ZIP archive
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for sep, fn in self.arcfiles.items():
+ with zipfp.open(fn, "rU") as fp:
+ ziplines = fp.readlines()
+ for line, zipline in zip(self.line_gen, ziplines):
+ self.assertEqual(zipline, line + '\n')
+
+ def iterlines_test(self, f, compression):
+ self.make_test_archive(f, compression)
# Read the ZIP archive
- zipfp = zipfile.ZipFile(f, "r")
- for sep, fn in self.arcfiles.items():
- for line, zipline in zip(self.line_gen, zipfp.open(fn, "rU")):
- self.assertEqual(zipline, line + '\n')
+ with zipfile.ZipFile(f, "r") as zipfp:
+ for sep, fn in self.arcfiles.items():
+ for line, zipline in zip(self.line_gen, zipfp.open(fn, "rU")):
+ self.assertEqual(zipline, line + '\n')
- zipfp.close()
+ def test_read_stored(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.read_test(f, zipfile.ZIP_STORED)
+
+ def test_readline_read_stored(self):
+ # Issue #7610: calls to readline() interleaved with calls to read().
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.readline_read_test(f, zipfile.ZIP_STORED)
- def testReadStored(self):
+ def test_readline_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.readTest(f, zipfile.ZIP_STORED)
+ self.readline_test(f, zipfile.ZIP_STORED)
- def testReadlineStored(self):
+ def test_readlines_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.readlineTest(f, zipfile.ZIP_STORED)
+ self.readlines_test(f, zipfile.ZIP_STORED)
- def testReadlinesStored(self):
+ def test_iterlines_stored(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.readlinesTest(f, zipfile.ZIP_STORED)
+ self.iterlines_test(f, zipfile.ZIP_STORED)
- def testIterlinesStored(self):
+ @skipUnless(zlib, "requires zlib")
+ def test_read_deflated(self):
for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.iterlinesTest(f, zipfile.ZIP_STORED)
+ self.read_test(f, zipfile.ZIP_DEFLATED)
- if zlib:
- def testReadDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.readTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readline_read_deflated(self):
+ # Issue #7610: calls to readline() interleaved with calls to read().
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.readline_read_test(f, zipfile.ZIP_DEFLATED)
- def testReadlineDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.readlineTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readline_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.readline_test(f, zipfile.ZIP_DEFLATED)
- def testReadlinesDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.readlinesTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_readlines_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.readlines_test(f, zipfile.ZIP_DEFLATED)
- def testIterlinesDeflated(self):
- for f in (TESTFN2, TemporaryFile(), StringIO()):
- self.iterlinesTest(f, zipfile.ZIP_DEFLATED)
+ @skipUnless(zlib, "requires zlib")
+ def test_iterlines_deflated(self):
+ for f in (TESTFN2, TemporaryFile(), StringIO()):
+ self.iterlines_test(f, zipfile.ZIP_DEFLATED)
def tearDown(self):
for sep, fn in self.arcfiles.items():
os.remove(fn)
- support.unlink(TESTFN)
- support.unlink(TESTFN2)
+ unlink(TESTFN)
+ unlink(TESTFN2)
def test_main():
run_unittest(TestsWithSourceFile, TestZip64InSmallFiles, OtherTests,
PyZipFileTests, DecryptionTests, TestsWithMultipleOpens,
- TestWithDirectory,
- UniversalNewlineTests, TestsWithRandomBinaryFiles)
+ TestWithDirectory, UniversalNewlineTests,
+ TestsWithRandomBinaryFiles)
if __name__ == "__main__":
test_main()
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index 87869aec01..a66738a778 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -6,11 +6,17 @@ import struct
import time
import unittest
-import zlib # implied prerequisite
-from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
from test import test_support
from test.test_importhooks import ImportHooksBaseTestCase, test_src, test_co
+# some tests can be ran even without zlib
+try:
+ import zlib
+except ImportError:
+ zlib = None
+
+from zipfile import ZipFile, ZipInfo, ZIP_STORED, ZIP_DEFLATED
+
import zipimport
import linecache
import doctest
@@ -19,11 +25,6 @@ import StringIO
from traceback import extract_tb, extract_stack, print_tb
raise_src = 'def do_raise(): raise TypeError\n'
-# so we only run testAFakeZlib once if this test is run repeatedly
-# which happens when we look for ref leaks
-test_imported = False
-
-
def make_pyc(co, mtime):
data = marshal.dumps(co)
if type(mtime) is type(0.0):
@@ -53,6 +54,7 @@ TESTPACK = "ziptestpackage"
TESTPACK2 = "ziptestpackage2"
TEMP_ZIP = os.path.abspath("junk95142" + os.extsep + "zip")
+
class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
compression = ZIP_STORED
@@ -96,8 +98,8 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
if expected_ext:
file = mod.get_file()
- self.assertEquals(file, os.path.join(TEMP_ZIP,
- *modules) + expected_ext)
+ self.assertEqual(file, os.path.join(TEMP_ZIP,
+ *modules) + expected_ext)
finally:
z.close()
os.remove(TEMP_ZIP)
@@ -212,31 +214,31 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
z.close()
zi = zipimport.zipimporter(TEMP_ZIP)
- self.assertEquals(zi.archive, TEMP_ZIP)
- self.assertEquals(zi.is_package(TESTPACK), True)
+ self.assertEqual(zi.archive, TEMP_ZIP)
+ self.assertEqual(zi.is_package(TESTPACK), True)
mod = zi.load_module(TESTPACK)
- self.assertEquals(zi._get_filename(TESTPACK), mod.__file__)
+ self.assertEqual(zi.get_filename(TESTPACK), mod.__file__)
- self.assertEquals(zi.is_package(packdir + '__init__'), False)
- self.assertEquals(zi.is_package(packdir + TESTPACK2), True)
- self.assertEquals(zi.is_package(packdir2 + TESTMOD), False)
+ self.assertEqual(zi.is_package(packdir + '__init__'), False)
+ self.assertEqual(zi.is_package(packdir + TESTPACK2), True)
+ self.assertEqual(zi.is_package(packdir2 + TESTMOD), False)
mod_path = packdir2 + TESTMOD
mod_name = module_path_to_dotted_name(mod_path)
- pkg = __import__(mod_name)
+ __import__(mod_name)
mod = sys.modules[mod_name]
- self.assertEquals(zi.get_source(TESTPACK), None)
- self.assertEquals(zi.get_source(mod_path), None)
- self.assertEquals(zi._get_filename(mod_path), mod.__file__)
+ self.assertEqual(zi.get_source(TESTPACK), None)
+ self.assertEqual(zi.get_source(mod_path), None)
+ self.assertEqual(zi.get_filename(mod_path), mod.__file__)
# To pass in the module name instead of the path, we must use the right importer
loader = mod.__loader__
- self.assertEquals(loader.get_source(mod_name), None)
- self.assertEquals(loader._get_filename(mod_name), mod.__file__)
+ self.assertEqual(loader.get_source(mod_name), None)
+ self.assertEqual(loader.get_filename(mod_name), mod.__file__)
# test prefix and archivepath members
zi2 = zipimport.zipimporter(TEMP_ZIP + os.sep + TESTPACK)
- self.assertEquals(zi2.archive, TEMP_ZIP)
- self.assertEquals(zi2.prefix, TESTPACK + os.sep)
+ self.assertEqual(zi2.archive, TEMP_ZIP)
+ self.assertEqual(zi2.prefix, TESTPACK + os.sep)
finally:
z.close()
os.remove(TEMP_ZIP)
@@ -256,26 +258,26 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
z.close()
zi = zipimport.zipimporter(TEMP_ZIP + os.sep + packdir)
- self.assertEquals(zi.archive, TEMP_ZIP)
- self.assertEquals(zi.prefix, packdir)
- self.assertEquals(zi.is_package(TESTPACK2), True)
+ self.assertEqual(zi.archive, TEMP_ZIP)
+ self.assertEqual(zi.prefix, packdir)
+ self.assertEqual(zi.is_package(TESTPACK2), True)
mod = zi.load_module(TESTPACK2)
- self.assertEquals(zi._get_filename(TESTPACK2), mod.__file__)
+ self.assertEqual(zi.get_filename(TESTPACK2), mod.__file__)
- self.assertEquals(zi.is_package(TESTPACK2 + os.sep + '__init__'), False)
- self.assertEquals(zi.is_package(TESTPACK2 + os.sep + TESTMOD), False)
+ self.assertEqual(zi.is_package(TESTPACK2 + os.sep + '__init__'), False)
+ self.assertEqual(zi.is_package(TESTPACK2 + os.sep + TESTMOD), False)
mod_path = TESTPACK2 + os.sep + TESTMOD
mod_name = module_path_to_dotted_name(mod_path)
- pkg = __import__(mod_name)
+ __import__(mod_name)
mod = sys.modules[mod_name]
- self.assertEquals(zi.get_source(TESTPACK2), None)
- self.assertEquals(zi.get_source(mod_path), None)
- self.assertEquals(zi._get_filename(mod_path), mod.__file__)
+ self.assertEqual(zi.get_source(TESTPACK2), None)
+ self.assertEqual(zi.get_source(mod_path), None)
+ self.assertEqual(zi.get_filename(mod_path), mod.__file__)
# To pass in the module name instead of the path, we must use the right importer
loader = mod.__loader__
- self.assertEquals(loader.get_source(mod_name), None)
- self.assertEquals(loader._get_filename(mod_name), mod.__file__)
+ self.assertEqual(loader.get_source(mod_name), None)
+ self.assertEqual(loader.get_filename(mod_name), mod.__file__)
finally:
z.close()
os.remove(TEMP_ZIP)
@@ -289,8 +291,8 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
z.writestr(name, data)
z.close()
zi = zipimport.zipimporter(TEMP_ZIP)
- self.assertEquals(data, zi.get_data(name))
- self.assert_('zipimporter object' in repr(zi))
+ self.assertEqual(data, zi.get_data(name))
+ self.assertIn('zipimporter object', repr(zi))
finally:
z.close()
os.remove(TEMP_ZIP)
@@ -357,7 +359,6 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
def testDoctestSuite(self):
self.runDoctest(self.doDoctestSuite)
-
def doTraceback(self, module):
try:
module.do_raise()
@@ -372,7 +373,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
s = StringIO.StringIO()
print_tb(tb, 1, s)
- self.failUnless(s.getvalue().endswith(raise_src))
+ self.assertTrue(s.getvalue().endswith(raise_src))
else:
raise AssertionError("This ought to be impossible")
@@ -381,6 +382,7 @@ class UncompressedZipImportTestCase(ImportHooksBaseTestCase):
self.doTest(None, files, TESTMOD, call=self.doTraceback)
+@unittest.skipUnless(zlib, "requires zlib")
class CompressedZipImportTestCase(UncompressedZipImportTestCase):
compression = ZIP_DEFLATED
@@ -456,19 +458,7 @@ class BadFileZipImportTestCase(unittest.TestCase):
zipimport._zip_directory_cache.clear()
-def cleanup():
- # this is necessary if test is run repeated (like when finding leaks)
- global test_imported
- if test_imported:
- zipimport._zip_directory_cache.clear()
- if hasattr(UncompressedZipImportTestCase, 'testAFakeZlib'):
- delattr(UncompressedZipImportTestCase, 'testAFakeZlib')
- if hasattr(CompressedZipImportTestCase, 'testAFakeZlib'):
- delattr(CompressedZipImportTestCase, 'testAFakeZlib')
- test_imported = True
-
def test_main():
- cleanup()
try:
test_support.run_unittest(
UncompressedZipImportTestCase,
diff --git a/Lib/test/test_zipimport_support.py b/Lib/test/test_zipimport_support.py
index b2cf6b7ec9..4f41518d70 100644
--- a/Lib/test/test_zipimport_support.py
+++ b/Lib/test/test_zipimport_support.py
@@ -2,7 +2,6 @@
# for working with modules located inside zipfiles
# The tests are centralised in this fashion to make it easy to drop them
# if a platform doesn't support zipimport
-import unittest
import test.test_support
import os
import os.path
@@ -15,6 +14,8 @@ import inspect
import linecache
import pdb
import warnings
+from test.script_helper import (spawn_python, kill_python, run_python,
+ temp_dir, make_script, make_zip_script)
verbose = test.test_support.verbose
@@ -30,11 +31,6 @@ verbose = test.test_support.verbose
# Retrieve some helpers from other test cases
from test import test_doctest, sample_doctest
from test.test_importhooks import ImportHooksBaseTestCase
-from test.test_cmd_line_script import temp_dir, _run_python, \
- _spawn_python, _kill_python, \
- _make_test_script, \
- _compile_test_script, \
- _make_test_zip, _make_test_pkg
def _run_object_doctest(obj, module):
@@ -79,10 +75,10 @@ class ZipSupportTests(ImportHooksBaseTestCase):
def test_inspect_getsource_issue4223(self):
test_src = "def foo(): pass\n"
with temp_dir() as d:
- init_name = _make_test_script(d, '__init__', test_src)
+ init_name = make_script(d, '__init__', test_src)
name_in_zip = os.path.join('zip_pkg',
os.path.basename(init_name))
- zip_name, run_name = _make_test_zip(d, 'test_zip',
+ zip_name, run_name = make_zip_script(d, 'test_zip',
init_name, name_in_zip)
os.remove(init_name)
sys.path.insert(0, zip_name)
@@ -107,9 +103,9 @@ class ZipSupportTests(ImportHooksBaseTestCase):
sample_src = sample_src.replace("test.test_doctest",
"test_zipped_doctest")
with temp_dir() as d:
- script_name = _make_test_script(d, 'test_zipped_doctest',
+ script_name = make_script(d, 'test_zipped_doctest',
test_src)
- zip_name, run_name = _make_test_zip(d, 'test_zip',
+ zip_name, run_name = make_zip_script(d, 'test_zip',
script_name)
z = zipfile.ZipFile(zip_name, 'a')
z.writestr("sample_zipped_doctest.py", sample_src)
@@ -194,23 +190,23 @@ class ZipSupportTests(ImportHooksBaseTestCase):
""")
pattern = 'File "%s", line 2, in %s'
with temp_dir() as d:
- script_name = _make_test_script(d, 'script', test_src)
- exit_code, data = _run_python(script_name)
+ script_name = make_script(d, 'script', test_src)
+ exit_code, data = run_python(script_name)
expected = pattern % (script_name, "__main__.Test")
if verbose:
print "Expected line", expected
print "Got stdout:"
print data
- self.assert_(expected in data)
- zip_name, run_name = _make_test_zip(d, "test_zip",
+ self.assertIn(expected, data)
+ zip_name, run_name = make_zip_script(d, "test_zip",
script_name, '__main__.py')
- exit_code, data = _run_python(zip_name)
+ exit_code, data = run_python(zip_name)
expected = pattern % (run_name, "__main__.Test")
if verbose:
print "Expected line", expected
print "Got stdout:"
print data
- self.assert_(expected in data)
+ self.assertIn(expected, data)
def test_pdb_issue4201(self):
test_src = textwrap.dedent("""\
@@ -221,17 +217,17 @@ class ZipSupportTests(ImportHooksBaseTestCase):
pdb.runcall(f)
""")
with temp_dir() as d:
- script_name = _make_test_script(d, 'script', test_src)
- p = _spawn_python(script_name)
+ script_name = make_script(d, 'script', test_src)
+ p = spawn_python(script_name)
p.stdin.write('l\n')
- data = _kill_python(p)
- self.assert_(script_name in data)
- zip_name, run_name = _make_test_zip(d, "test_zip",
+ data = kill_python(p)
+ self.assertIn(script_name, data)
+ zip_name, run_name = make_zip_script(d, "test_zip",
script_name, '__main__.py')
- p = _spawn_python(zip_name)
+ p = spawn_python(zip_name)
p.stdin.write('l\n')
- data = _kill_python(p)
- self.assert_(run_name in data)
+ data = kill_python(p)
+ self.assertIn(run_name, data)
def test_main():
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index 1b802b88d3..7f631437b5 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -1,16 +1,23 @@
import unittest
-from test import test_support
-import zlib
+from test.test_support import TESTFN, run_unittest, import_module, unlink, requires
import binascii
import random
-from test.test_support import precisionbigmemtest, _1G
+from test.test_support import precisionbigmemtest, _1G, _4G
+import sys
+
+try:
+ import mmap
+except ImportError:
+ mmap = None
+
+zlib = import_module('zlib')
class ChecksumTestCase(unittest.TestCase):
# checksum test cases
def test_crc32start(self):
self.assertEqual(zlib.crc32(""), zlib.crc32("", 0))
- self.assert_(zlib.crc32("abc", 0xffffffff))
+ self.assertTrue(zlib.crc32("abc", 0xffffffff))
def test_crc32empty(self):
self.assertEqual(zlib.crc32("", 0), 0)
@@ -19,7 +26,7 @@ class ChecksumTestCase(unittest.TestCase):
def test_adler32start(self):
self.assertEqual(zlib.adler32(""), zlib.adler32("", 1))
- self.assert_(zlib.adler32("abc", 0xffffffff))
+ self.assertTrue(zlib.adler32("abc", 0xffffffff))
def test_adler32empty(self):
self.assertEqual(zlib.adler32("", 0), 0)
@@ -137,14 +144,9 @@ class CompressTestCase(BaseCompressTestCase, unittest.TestCase):
def test_incomplete_stream(self):
# An useful error message is given
x = zlib.compress(HAMLET_SCENE)
- try:
- zlib.decompress(x[:-1])
- except zlib.error as e:
- self.assertTrue(
- "Error -5 while decompressing data: incomplete or truncated stream"
- in str(e), str(e))
- else:
- self.fail("zlib.error not raised")
+ self.assertRaisesRegexp(zlib.error,
+ "Error -5 while decompressing data: incomplete or truncated stream",
+ zlib.decompress, x[:-1])
# Memory use of the following functions takes into account overallocation
@@ -260,7 +262,7 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
while cb:
#max_length = 1 + len(cb)//10
chunk = dco.decompress(cb, dcx)
- self.failIf(len(chunk) > dcx,
+ self.assertFalse(len(chunk) > dcx,
'chunk too big (%d>%d)' % (len(chunk), dcx))
bufs.append(chunk)
cb = dco.unconsumed_tail
@@ -285,7 +287,7 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
while cb:
max_length = 1 + len(cb)//10
chunk = dco.decompress(cb, max_length)
- self.failIf(len(chunk) > max_length,
+ self.assertFalse(len(chunk) > max_length,
'chunk too big (%d>%d)' % (len(chunk),max_length))
bufs.append(chunk)
cb = dco.unconsumed_tail
@@ -294,7 +296,7 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
else:
while chunk:
chunk = dco.decompress('', max_length)
- self.failIf(len(chunk) > max_length,
+ self.assertFalse(len(chunk) > max_length,
'chunk too big (%d>%d)' % (len(chunk),max_length))
bufs.append(chunk)
self.assertEqual(data, ''.join(bufs), 'Wrong data retrieved')
@@ -308,6 +310,15 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
self.assertRaises(ValueError, dco.decompress, "", -1)
self.assertEqual('', dco.unconsumed_tail)
+ def test_clear_unconsumed_tail(self):
+ # Issue #12050: calling decompress() without providing max_length
+ # should clear the unconsumed_tail attribute.
+ cdata = "x\x9cKLJ\x06\x00\x02M\x01" # "abc"
+ dco = zlib.decompressobj()
+ ddata = dco.decompress(cdata, 1)
+ ddata += dco.decompress(dco.unconsumed_tail)
+ self.assertEqual(dco.unconsumed_tail, "")
+
def test_flushes(self):
# Test flush() with the various options, using all the
# different levels in order to provide more variations.
@@ -368,7 +379,7 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
# caused a core dump.)
co = zlib.compressobj(zlib.Z_BEST_COMPRESSION)
- self.failUnless(co.flush()) # Returns a zlib header
+ self.assertTrue(co.flush()) # Returns a zlib header
dco = zlib.decompressobj()
self.assertEqual(dco.flush(), "") # Returns nothing
@@ -550,7 +561,7 @@ LAERTES
def test_main():
- test_support.run_unittest(
+ run_unittest(
ChecksumTestCase,
ExceptionTestCase,
CompressTestCase,
diff --git a/Lib/test/testtar.tar b/Lib/test/testtar.tar
index b5bb46b16e..bac0e2628f 100644
--- a/Lib/test/testtar.tar
+++ b/Lib/test/testtar.tar
Binary files differ
diff --git a/Lib/test/tracedmodules/__init__.py b/Lib/test/tracedmodules/__init__.py
new file mode 100644
index 0000000000..13fa4f2be9
--- /dev/null
+++ b/Lib/test/tracedmodules/__init__.py
@@ -0,0 +1,4 @@
+"""This package contains modules that help testing the trace.py module. Note
+that the exact location of functions in these modules is important, as trace.py
+takes the real line numbers into account.
+"""
diff --git a/Lib/test/tracedmodules/testmod.py b/Lib/test/tracedmodules/testmod.py
new file mode 100644
index 0000000000..642776ea88
--- /dev/null
+++ b/Lib/test/tracedmodules/testmod.py
@@ -0,0 +1,9 @@
+def func(x):
+ b = x + 1
+ return b + 2
+
+def func2():
+ """Test function for issue 9936 """
+ return (1,
+ 2,
+ 3)
diff --git a/Lib/test/win_console_handler.py b/Lib/test/win_console_handler.py
new file mode 100644
index 0000000000..0ffcee2e91
--- /dev/null
+++ b/Lib/test/win_console_handler.py
@@ -0,0 +1,49 @@
+"""Script used to test os.kill on Windows, for issue #1220212
+
+This script is started as a subprocess in test_os and is used to test the
+CTRL_C_EVENT and CTRL_BREAK_EVENT signals, which requires a custom handler
+to be written into the kill target.
+
+See http://msdn.microsoft.com/en-us/library/ms685049%28v=VS.85%29.aspx for a
+similar example in C.
+"""
+
+from ctypes import wintypes, WINFUNCTYPE
+import signal
+import ctypes
+import mmap
+import sys
+
+# Function prototype for the handler function. Returns BOOL, takes a DWORD.
+HandlerRoutine = WINFUNCTYPE(wintypes.BOOL, wintypes.DWORD)
+
+def _ctrl_handler(sig):
+ """Handle a sig event and return 0 to terminate the process"""
+ if sig == signal.CTRL_C_EVENT:
+ pass
+ elif sig == signal.CTRL_BREAK_EVENT:
+ pass
+ else:
+ print("UNKNOWN EVENT")
+ return 0
+
+ctrl_handler = HandlerRoutine(_ctrl_handler)
+
+
+SetConsoleCtrlHandler = ctypes.windll.kernel32.SetConsoleCtrlHandler
+SetConsoleCtrlHandler.argtypes = (HandlerRoutine, wintypes.BOOL)
+SetConsoleCtrlHandler.restype = wintypes.BOOL
+
+if __name__ == "__main__":
+ # Add our console control handling function with value 1
+ if not SetConsoleCtrlHandler(ctrl_handler, 1):
+ print("Unable to add SetConsoleCtrlHandler")
+ exit(-1)
+
+ # Awaken mail process
+ m = mmap.mmap(-1, 1, sys.argv[1])
+ m[0] = '1'
+
+ # Do nothing but wait for the signal
+ while True:
+ pass
diff --git a/Lib/test/xmltestdata/simple-ns.xml b/Lib/test/xmltestdata/simple-ns.xml
new file mode 100644
index 0000000000..f1f34b2e29
--- /dev/null
+++ b/Lib/test/xmltestdata/simple-ns.xml
@@ -0,0 +1,7 @@
+<?pi data?>
+<!-- comment -->
+<root xmlns='namespace'>
+ <element key='value'>text</element>
+ <element>text</element>tail
+ <empty-element/>
+</root>
diff --git a/Lib/test/xmltestdata/simple.xml b/Lib/test/xmltestdata/simple.xml
new file mode 100644
index 0000000000..b88c2c7e69
--- /dev/null
+++ b/Lib/test/xmltestdata/simple.xml
@@ -0,0 +1,6 @@
+<!-- comment -->
+<root>
+ <element key='value'>text</element>
+ <element>text</element>tail
+ <empty-element/>
+</root>
diff --git a/Lib/test/test.xml b/Lib/test/xmltestdata/test.xml
index 9af92fb435..9af92fb435 100644
--- a/Lib/test/test.xml
+++ b/Lib/test/xmltestdata/test.xml
diff --git a/Lib/test/test.xml.out b/Lib/test/xmltestdata/test.xml.out
index d4ab1abcb6..d4ab1abcb6 100644
--- a/Lib/test/test.xml.out
+++ b/Lib/test/xmltestdata/test.xml.out