Import Upstream version 2.7.18
This commit is contained in:
BIN
Lib/test/185test.db
Normal file
BIN
Lib/test/185test.db
Normal file
Binary file not shown.
BIN
Lib/test/Sine-1000Hz-300ms.aif
Normal file
BIN
Lib/test/Sine-1000Hz-300ms.aif
Normal file
Binary file not shown.
1
Lib/test/__init__.py
Normal file
1
Lib/test/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
# Dummy file to make this directory a package.
|
||||
3
Lib/test/__main__.py
Normal file
3
Lib/test/__main__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from test import regrtest
|
||||
|
||||
regrtest.main_in_temp_cwd()
|
||||
2358
Lib/test/_mock_backport.py
Normal file
2358
Lib/test/_mock_backport.py
Normal file
File diff suppressed because it is too large
Load Diff
81
Lib/test/allsans.pem
Normal file
81
Lib/test/allsans.pem
Normal file
@@ -0,0 +1,81 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIG/QIBADANBgkqhkiG9w0BAQEFAASCBucwggbjAgEAAoIBgQCg/pM6dP7BTFNc
|
||||
qe6wIJIBB7HjwL42bp0vjcCVl4Z3MRWFswYpfxy+o+8+PguMp4K6zndA5fwNkK/H
|
||||
3HmtanncUfPqnV0usN0NHQGh/f9xRoNmB1q2L7kTuO99o0KLQgvonRT2snf8rq9n
|
||||
tPRzhHUGYhog7zzNxetYV309PHpPr19BcKepDtM5RMk2aBnoN5vtItorjXiDosFm
|
||||
6o5wQHrcupcVydszba6P75BEbc1XIWvq2Fv8muaw4pCe81QYINyLqgcPNO/nF3Os
|
||||
5EI4HKjCNRSCOhOcWqYctXLXN9lBdMBBvQc3zDmYzh1eIZewzZXPVEQT33xPkhxz
|
||||
HNmhcIctpWX4LTRF6FulkcbeuZDga3gkZYJf/M6IpU1WYXr6q8sNxbgmRRX/NuHo
|
||||
V9oDwBzLG07rKUiqRHfjGqoCRmmVeVYpryvXUNjHGH0nlVzz/8lTUxAnJorO3Fdc
|
||||
I+6zKLUPICdAlvz51AH6yopgPFhrdgA0pV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CS0cEpiiP
|
||||
3CEUgzfEbF0X89GDKEey4H3Irvosbvt2hEcf2RNpahLUL/fUv53bDmHNmL8qJg5E
|
||||
UJVMOHvOpSOjqoqeRuSyG0GnnAuUwcxdrZY6UzLdslhuq9F8UjgHr6KSMx56G9uK
|
||||
LmTy5njMab0in2xL/YRX/0nogK3BHqpUHrfCdEYZkciRxtAa+OPpWn4dcZi+Fpf7
|
||||
ZYSgPLNt+djtFDMIAk5Bo+XDaQdW3dhF0w44enrGAOV0xPE+/jOuenNhKBafjuNb
|
||||
lkeSr45+QZsi1rd18ny8z3uuaGqIAziFgmllZOH2D8giTn6+5jZcCNZCoGKUkPI9
|
||||
l/GMWwxg4HQYYlZcsZzTCem9Rb2XcrasAbmhFapMtR+QAwSed5vKE7ZdtQhj74kB
|
||||
7Q0E7Lkgpp6BaObb2As8/f0K/UlSVSvrYk+i3JT9wK/qqkRGxsTFEF7N9t0rKu8y
|
||||
4JdQDtZCI552MsFvYW6m+IOYgxg=
|
||||
-----END CERTIFICATE-----
|
||||
BIN
Lib/test/audiodata/pluck-pcm16.aiff
Normal file
BIN
Lib/test/audiodata/pluck-pcm16.aiff
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm16.au
Normal file
BIN
Lib/test/audiodata/pluck-pcm16.au
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm16.wav
Normal file
BIN
Lib/test/audiodata/pluck-pcm16.wav
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm24.aiff
Normal file
BIN
Lib/test/audiodata/pluck-pcm24.aiff
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm24.wav
Normal file
BIN
Lib/test/audiodata/pluck-pcm24.wav
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm32.aiff
Normal file
BIN
Lib/test/audiodata/pluck-pcm32.aiff
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm32.au
Normal file
BIN
Lib/test/audiodata/pluck-pcm32.au
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm32.wav
Normal file
BIN
Lib/test/audiodata/pluck-pcm32.wav
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm8.aiff
Normal file
BIN
Lib/test/audiodata/pluck-pcm8.aiff
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm8.au
Normal file
BIN
Lib/test/audiodata/pluck-pcm8.au
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-pcm8.wav
Normal file
BIN
Lib/test/audiodata/pluck-pcm8.wav
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-ulaw.aifc
Normal file
BIN
Lib/test/audiodata/pluck-ulaw.aifc
Normal file
Binary file not shown.
BIN
Lib/test/audiodata/pluck-ulaw.au
Normal file
BIN
Lib/test/audiodata/pluck-ulaw.au
Normal file
Binary file not shown.
BIN
Lib/test/audiotest.au
Normal file
BIN
Lib/test/audiotest.au
Normal file
Binary file not shown.
284
Lib/test/audiotests.py
Normal file
284
Lib/test/audiotests.py
Normal file
@@ -0,0 +1,284 @@
|
||||
from test.test_support import findfile, TESTFN, unlink
|
||||
import unittest
|
||||
import array
|
||||
import io
|
||||
import pickle
|
||||
import sys
|
||||
import base64
|
||||
|
||||
class UnseekableIO(file):
|
||||
def tell(self):
|
||||
raise io.UnsupportedOperation
|
||||
|
||||
def seek(self, *args, **kwargs):
|
||||
raise io.UnsupportedOperation
|
||||
|
||||
def fromhex(s):
|
||||
return base64.b16decode(s.replace(' ', ''))
|
||||
|
||||
def byteswap2(data):
|
||||
a = array.array('h')
|
||||
a.fromstring(data)
|
||||
a.byteswap()
|
||||
return a.tostring()
|
||||
|
||||
def byteswap3(data):
|
||||
ba = bytearray(data)
|
||||
ba[::3] = data[2::3]
|
||||
ba[2::3] = data[::3]
|
||||
return bytes(ba)
|
||||
|
||||
def byteswap4(data):
|
||||
a = array.array('i')
|
||||
a.fromstring(data)
|
||||
a.byteswap()
|
||||
return a.tostring()
|
||||
|
||||
|
||||
class AudioTests:
|
||||
close_fd = False
|
||||
|
||||
def setUp(self):
|
||||
self.f = self.fout = None
|
||||
|
||||
def tearDown(self):
|
||||
if self.f is not None:
|
||||
self.f.close()
|
||||
if self.fout is not None:
|
||||
self.fout.close()
|
||||
unlink(TESTFN)
|
||||
|
||||
def check_params(self, f, nchannels, sampwidth, framerate, nframes,
|
||||
comptype, compname):
|
||||
self.assertEqual(f.getnchannels(), nchannels)
|
||||
self.assertEqual(f.getsampwidth(), sampwidth)
|
||||
self.assertEqual(f.getframerate(), framerate)
|
||||
self.assertEqual(f.getnframes(), nframes)
|
||||
self.assertEqual(f.getcomptype(), comptype)
|
||||
self.assertEqual(f.getcompname(), compname)
|
||||
|
||||
params = f.getparams()
|
||||
self.assertEqual(params,
|
||||
(nchannels, sampwidth, framerate, nframes, comptype, compname))
|
||||
|
||||
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
|
||||
dump = pickle.dumps(params, proto)
|
||||
self.assertEqual(pickle.loads(dump), params)
|
||||
|
||||
|
||||
class AudioWriteTests(AudioTests):
|
||||
|
||||
def create_file(self, testfile):
|
||||
f = self.fout = self.module.open(testfile, 'wb')
|
||||
f.setnchannels(self.nchannels)
|
||||
f.setsampwidth(self.sampwidth)
|
||||
f.setframerate(self.framerate)
|
||||
f.setcomptype(self.comptype, self.compname)
|
||||
return f
|
||||
|
||||
def check_file(self, testfile, nframes, frames):
|
||||
f = self.module.open(testfile, 'rb')
|
||||
try:
|
||||
self.assertEqual(f.getnchannels(), self.nchannels)
|
||||
self.assertEqual(f.getsampwidth(), self.sampwidth)
|
||||
self.assertEqual(f.getframerate(), self.framerate)
|
||||
self.assertEqual(f.getnframes(), nframes)
|
||||
self.assertEqual(f.readframes(nframes), frames)
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
def test_write_params(self):
|
||||
f = self.create_file(TESTFN)
|
||||
f.setnframes(self.nframes)
|
||||
f.writeframes(self.frames)
|
||||
self.check_params(f, self.nchannels, self.sampwidth, self.framerate,
|
||||
self.nframes, self.comptype, self.compname)
|
||||
f.close()
|
||||
|
||||
def test_write(self):
|
||||
f = self.create_file(TESTFN)
|
||||
f.setnframes(self.nframes)
|
||||
f.writeframes(self.frames)
|
||||
f.close()
|
||||
|
||||
self.check_file(TESTFN, self.nframes, self.frames)
|
||||
|
||||
def test_incompleted_write(self):
|
||||
with open(TESTFN, 'wb') as testfile:
|
||||
testfile.write(b'ababagalamaga')
|
||||
f = self.create_file(testfile)
|
||||
f.setnframes(self.nframes + 1)
|
||||
f.writeframes(self.frames)
|
||||
f.close()
|
||||
|
||||
with open(TESTFN, 'rb') as testfile:
|
||||
self.assertEqual(testfile.read(13), b'ababagalamaga')
|
||||
self.check_file(testfile, self.nframes, self.frames)
|
||||
|
||||
def test_multiple_writes(self):
|
||||
with open(TESTFN, 'wb') as testfile:
|
||||
testfile.write(b'ababagalamaga')
|
||||
f = self.create_file(testfile)
|
||||
f.setnframes(self.nframes)
|
||||
framesize = self.nchannels * self.sampwidth
|
||||
f.writeframes(self.frames[:-framesize])
|
||||
f.writeframes(self.frames[-framesize:])
|
||||
f.close()
|
||||
|
||||
with open(TESTFN, 'rb') as testfile:
|
||||
self.assertEqual(testfile.read(13), b'ababagalamaga')
|
||||
self.check_file(testfile, self.nframes, self.frames)
|
||||
|
||||
def test_overflowed_write(self):
|
||||
with open(TESTFN, 'wb') as testfile:
|
||||
testfile.write(b'ababagalamaga')
|
||||
f = self.create_file(testfile)
|
||||
f.setnframes(self.nframes - 1)
|
||||
f.writeframes(self.frames)
|
||||
f.close()
|
||||
|
||||
with open(TESTFN, 'rb') as testfile:
|
||||
self.assertEqual(testfile.read(13), b'ababagalamaga')
|
||||
self.check_file(testfile, self.nframes, self.frames)
|
||||
|
||||
def test_unseekable_read(self):
|
||||
f = self.create_file(TESTFN)
|
||||
f.setnframes(self.nframes)
|
||||
f.writeframes(self.frames)
|
||||
f.close()
|
||||
|
||||
with UnseekableIO(TESTFN, 'rb') as testfile:
|
||||
self.check_file(testfile, self.nframes, self.frames)
|
||||
|
||||
def test_unseekable_write(self):
|
||||
with UnseekableIO(TESTFN, 'wb') as testfile:
|
||||
f = self.create_file(testfile)
|
||||
f.setnframes(self.nframes)
|
||||
f.writeframes(self.frames)
|
||||
f.close()
|
||||
self.fout = None
|
||||
|
||||
self.check_file(TESTFN, self.nframes, self.frames)
|
||||
|
||||
def test_unseekable_incompleted_write(self):
|
||||
with UnseekableIO(TESTFN, 'wb') as testfile:
|
||||
testfile.write(b'ababagalamaga')
|
||||
f = self.create_file(testfile)
|
||||
f.setnframes(self.nframes + 1)
|
||||
try:
|
||||
f.writeframes(self.frames)
|
||||
except IOError:
|
||||
pass
|
||||
try:
|
||||
f.close()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
with open(TESTFN, 'rb') as testfile:
|
||||
self.assertEqual(testfile.read(13), b'ababagalamaga')
|
||||
self.check_file(testfile, self.nframes + 1, self.frames)
|
||||
|
||||
def test_unseekable_overflowed_write(self):
|
||||
with UnseekableIO(TESTFN, 'wb') as testfile:
|
||||
testfile.write(b'ababagalamaga')
|
||||
f = self.create_file(testfile)
|
||||
f.setnframes(self.nframes - 1)
|
||||
try:
|
||||
f.writeframes(self.frames)
|
||||
except IOError:
|
||||
pass
|
||||
try:
|
||||
f.close()
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
with open(TESTFN, 'rb') as testfile:
|
||||
self.assertEqual(testfile.read(13), b'ababagalamaga')
|
||||
framesize = self.nchannels * self.sampwidth
|
||||
self.check_file(testfile, self.nframes - 1, self.frames[:-framesize])
|
||||
|
||||
|
||||
class AudioTestsWithSourceFile(AudioTests):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.sndfilepath = findfile(cls.sndfilename, subdir='audiodata')
|
||||
|
||||
def test_read_params(self):
|
||||
f = self.f = self.module.open(self.sndfilepath)
|
||||
#self.assertEqual(f.getfp().name, self.sndfilepath)
|
||||
self.check_params(f, self.nchannels, self.sampwidth, self.framerate,
|
||||
self.sndfilenframes, self.comptype, self.compname)
|
||||
|
||||
def test_close(self):
|
||||
with open(self.sndfilepath, 'rb') as testfile:
|
||||
f = self.f = self.module.open(testfile)
|
||||
self.assertFalse(testfile.closed)
|
||||
f.close()
|
||||
self.assertEqual(testfile.closed, self.close_fd)
|
||||
with open(TESTFN, 'wb') as testfile:
|
||||
fout = self.fout = self.module.open(testfile, 'wb')
|
||||
self.assertFalse(testfile.closed)
|
||||
with self.assertRaises(self.module.Error):
|
||||
fout.close()
|
||||
self.assertEqual(testfile.closed, self.close_fd)
|
||||
fout.close() # do nothing
|
||||
|
||||
def test_read(self):
|
||||
framesize = self.nchannels * self.sampwidth
|
||||
chunk1 = self.frames[:2 * framesize]
|
||||
chunk2 = self.frames[2 * framesize: 4 * framesize]
|
||||
f = self.f = self.module.open(self.sndfilepath)
|
||||
self.assertEqual(f.readframes(0), b'')
|
||||
self.assertEqual(f.tell(), 0)
|
||||
self.assertEqual(f.readframes(2), chunk1)
|
||||
f.rewind()
|
||||
pos0 = f.tell()
|
||||
self.assertEqual(pos0, 0)
|
||||
self.assertEqual(f.readframes(2), chunk1)
|
||||
pos2 = f.tell()
|
||||
self.assertEqual(pos2, 2)
|
||||
self.assertEqual(f.readframes(2), chunk2)
|
||||
f.setpos(pos2)
|
||||
self.assertEqual(f.readframes(2), chunk2)
|
||||
f.setpos(pos0)
|
||||
self.assertEqual(f.readframes(2), chunk1)
|
||||
with self.assertRaises(self.module.Error):
|
||||
f.setpos(-1)
|
||||
with self.assertRaises(self.module.Error):
|
||||
f.setpos(f.getnframes() + 1)
|
||||
|
||||
def test_copy(self):
|
||||
f = self.f = self.module.open(self.sndfilepath)
|
||||
fout = self.fout = self.module.open(TESTFN, 'wb')
|
||||
fout.setparams(f.getparams())
|
||||
i = 0
|
||||
n = f.getnframes()
|
||||
while n > 0:
|
||||
i += 1
|
||||
fout.writeframes(f.readframes(i))
|
||||
n -= i
|
||||
fout.close()
|
||||
fout = self.fout = self.module.open(TESTFN, 'rb')
|
||||
f.rewind()
|
||||
self.assertEqual(f.getparams(), fout.getparams())
|
||||
self.assertEqual(f.readframes(f.getnframes()),
|
||||
fout.readframes(fout.getnframes()))
|
||||
|
||||
def test_read_not_from_start(self):
|
||||
with open(TESTFN, 'wb') as testfile:
|
||||
testfile.write(b'ababagalamaga')
|
||||
with open(self.sndfilepath, 'rb') as f:
|
||||
testfile.write(f.read())
|
||||
|
||||
with open(TESTFN, 'rb') as testfile:
|
||||
self.assertEqual(testfile.read(13), b'ababagalamaga')
|
||||
f = self.module.open(testfile, 'rb')
|
||||
try:
|
||||
self.assertEqual(f.getnchannels(), self.nchannels)
|
||||
self.assertEqual(f.getsampwidth(), self.sampwidth)
|
||||
self.assertEqual(f.getframerate(), self.framerate)
|
||||
self.assertEqual(f.getnframes(), self.sndfilenframes)
|
||||
self.assertEqual(f.readframes(self.nframes), self.frames)
|
||||
finally:
|
||||
f.close()
|
||||
6
Lib/test/autotest.py
Normal file
6
Lib/test/autotest.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# This should be equivalent to running regrtest.py from the cmdline.
|
||||
# It can be especially handy if you're in an interactive shell, e.g.,
|
||||
# from test import autotest.
|
||||
|
||||
from test import regrtest
|
||||
regrtest.main()
|
||||
1
Lib/test/bad_coding.py
Normal file
1
Lib/test/bad_coding.py
Normal file
@@ -0,0 +1 @@
|
||||
# -*- coding: uft-8 -*-
|
||||
2
Lib/test/bad_coding2.py
Normal file
2
Lib/test/bad_coding2.py
Normal file
@@ -0,0 +1,2 @@
|
||||
#coding: utf8
|
||||
print '我'
|
||||
2
Lib/test/bad_coding3.py
Normal file
2
Lib/test/bad_coding3.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# coding: string-escape
|
||||
\x70\x72\x69\x6e\x74\x20\x32\x2b\x32\x0a
|
||||
36
Lib/test/badcert.pem
Normal file
36
Lib/test/badcert.pem
Normal file
@@ -0,0 +1,36 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L
|
||||
opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH
|
||||
fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB
|
||||
AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU
|
||||
D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA
|
||||
IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM
|
||||
oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0
|
||||
ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/
|
||||
loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j
|
||||
oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA
|
||||
z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq
|
||||
ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV
|
||||
q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
Just bad cert data
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIICXwIBAAKBgQC8ddrhm+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9L
|
||||
opdJhTvbGfEj0DQs1IE8M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVH
|
||||
fhi/VwovESJlaBOp+WMnfhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQAB
|
||||
AoGBAK0FZpaKj6WnJZN0RqhhK+ggtBWwBnc0U/ozgKz2j1s3fsShYeiGtW6CK5nU
|
||||
D1dZ5wzhbGThI7LiOXDvRucc9n7vUgi0alqPQ/PFodPxAN/eEYkmXQ7W2k7zwsDA
|
||||
IUK0KUhktQbLu8qF/m8qM86ba9y9/9YkXuQbZ3COl5ahTZrhAkEA301P08RKv3KM
|
||||
oXnGU2UHTuJ1MAD2hOrPxjD4/wxA/39EWG9bZczbJyggB4RHu0I3NOSFjAm3HQm0
|
||||
ANOu5QK9owJBANgOeLfNNcF4pp+UikRFqxk5hULqRAWzVxVrWe85FlPm0VVmHbb/
|
||||
loif7mqjU8o1jTd/LM7RD9f2usZyE2psaw8CQQCNLhkpX3KO5kKJmS9N7JMZSc4j
|
||||
oog58yeYO8BBqKKzpug0LXuQultYv2K4veaIO04iL9VLe5z9S/Q1jaCHBBuXAkEA
|
||||
z8gjGoi1AOp6PBBLZNsncCvcV/0aC+1se4HxTNo2+duKSDnbq+ljqOM+E7odU+Nq
|
||||
ewvIWOG//e8fssd0mq3HywJBAJ8l/c8GVmrpFTx8r/nZ2Pyyjt3dH1widooDXYSV
|
||||
q6Gbf41Llo5sYAtmxdndTLASuHKecacTgZVhy0FryZpLKrU=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
Just bad cert data
|
||||
-----END CERTIFICATE-----
|
||||
40
Lib/test/badkey.pem
Normal file
40
Lib/test/badkey.pem
Normal file
@@ -0,0 +1,40 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Bad Key, though the cert should be OK
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD
|
||||
VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x
|
||||
IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT
|
||||
U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1
|
||||
NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl
|
||||
bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m
|
||||
dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj
|
||||
aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh
|
||||
m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8
|
||||
M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn
|
||||
fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC
|
||||
AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb
|
||||
08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx
|
||||
CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/
|
||||
iHkC6gGdBJhogs4=
|
||||
-----END CERTIFICATE-----
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Bad Key, though the cert should be OK
|
||||
-----END RSA PRIVATE KEY-----
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICpzCCAhCgAwIBAgIJAP+qStv1cIGNMA0GCSqGSIb3DQEBBQUAMIGJMQswCQYD
|
||||
VQQGEwJVUzERMA8GA1UECBMIRGVsYXdhcmUxEzARBgNVBAcTCldpbG1pbmd0b24x
|
||||
IzAhBgNVBAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMQwwCgYDVQQLEwNT
|
||||
U0wxHzAdBgNVBAMTFnNvbWVtYWNoaW5lLnB5dGhvbi5vcmcwHhcNMDcwODI3MTY1
|
||||
NDUwWhcNMTMwMjE2MTY1NDUwWjCBiTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCERl
|
||||
bGF3YXJlMRMwEQYDVQQHEwpXaWxtaW5ndG9uMSMwIQYDVQQKExpQeXRob24gU29m
|
||||
dHdhcmUgRm91bmRhdGlvbjEMMAoGA1UECxMDU1NMMR8wHQYDVQQDExZzb21lbWFj
|
||||
aGluZS5weXRob24ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8ddrh
|
||||
m+LutBvjYcQlnH21PPIseJ1JVG2HMmN2CmZk2YukO+9LopdJhTvbGfEj0DQs1IE8
|
||||
M+kTUyOmuKfVrFMKwtVeCJphrAnhoz7TYOuLBSqt7lVHfhi/VwovESJlaBOp+WMn
|
||||
fhcduPEYHYx/6cnVapIkZnLt30zu2um+DzA9jQIDAQABoxUwEzARBglghkgBhvhC
|
||||
AQEEBAMCBkAwDQYJKoZIhvcNAQEFBQADgYEAF4Q5BVqmCOLv1n8je/Jw9K669VXb
|
||||
08hyGzQhkemEBYQd6fzQ9A/1ZzHkJKb1P6yreOLSEh4KcxYPyrLRC1ll8nr5OlCx
|
||||
CMhKkTnR6qBsdNV0XtdU2+N25hqW+Ma4ZeqsN/iiJVCGNOZGnvQuvCAGWF8+J/f/
|
||||
iHkC6gGdBJhogs4=
|
||||
-----END CERTIFICATE-----
|
||||
10
Lib/test/badsyntax_future3.py
Normal file
10
Lib/test/badsyntax_future3.py
Normal file
@@ -0,0 +1,10 @@
|
||||
"""This is a test"""
|
||||
from __future__ import nested_scopes
|
||||
from __future__ import rested_snopes
|
||||
|
||||
def f(x):
|
||||
def g(y):
|
||||
return x + y
|
||||
return g
|
||||
|
||||
result = f(2)(4)
|
||||
10
Lib/test/badsyntax_future4.py
Normal file
10
Lib/test/badsyntax_future4.py
Normal file
@@ -0,0 +1,10 @@
|
||||
"""This is a test"""
|
||||
import __future__
|
||||
from __future__ import nested_scopes
|
||||
|
||||
def f(x):
|
||||
def g(y):
|
||||
return x + y
|
||||
return g
|
||||
|
||||
result = f(2)(4)
|
||||
12
Lib/test/badsyntax_future5.py
Normal file
12
Lib/test/badsyntax_future5.py
Normal file
@@ -0,0 +1,12 @@
|
||||
"""This is a test"""
|
||||
from __future__ import nested_scopes
|
||||
import foo
|
||||
from __future__ import nested_scopes
|
||||
|
||||
|
||||
def f(x):
|
||||
def g(y):
|
||||
return x + y
|
||||
return g
|
||||
|
||||
result = f(2)(4)
|
||||
10
Lib/test/badsyntax_future6.py
Normal file
10
Lib/test/badsyntax_future6.py
Normal file
@@ -0,0 +1,10 @@
|
||||
"""This is a test"""
|
||||
"this isn't a doc string"
|
||||
from __future__ import nested_scopes
|
||||
|
||||
def f(x):
|
||||
def g(y):
|
||||
return x + y
|
||||
return g
|
||||
|
||||
result = f(2)(4)
|
||||
11
Lib/test/badsyntax_future7.py
Normal file
11
Lib/test/badsyntax_future7.py
Normal file
@@ -0,0 +1,11 @@
|
||||
"""This is a test"""
|
||||
|
||||
from __future__ import nested_scopes; import string; from __future__ import \
|
||||
nested_scopes
|
||||
|
||||
def f(x):
|
||||
def g(y):
|
||||
return x + y
|
||||
return g
|
||||
|
||||
result = f(2)(4)
|
||||
10
Lib/test/badsyntax_future8.py
Normal file
10
Lib/test/badsyntax_future8.py
Normal file
@@ -0,0 +1,10 @@
|
||||
"""This is a test"""
|
||||
|
||||
from __future__ import *
|
||||
|
||||
def f(x):
|
||||
def g(y):
|
||||
return x + y
|
||||
return g
|
||||
|
||||
print f(2)(4)
|
||||
10
Lib/test/badsyntax_future9.py
Normal file
10
Lib/test/badsyntax_future9.py
Normal file
@@ -0,0 +1,10 @@
|
||||
"""This is a test"""
|
||||
|
||||
from __future__ import nested_scopes, braces
|
||||
|
||||
def f(x):
|
||||
def g(y):
|
||||
return x + y
|
||||
return g
|
||||
|
||||
print f(2)(4)
|
||||
2
Lib/test/badsyntax_nocaret.py
Normal file
2
Lib/test/badsyntax_nocaret.py
Normal file
@@ -0,0 +1,2 @@
|
||||
def f(x):
|
||||
[x for x in x] = x
|
||||
181
Lib/test/bisect_cmd.py
Executable file
181
Lib/test/bisect_cmd.py
Executable file
@@ -0,0 +1,181 @@
|
||||
#!/usr/bin/env python2
|
||||
"""
|
||||
Command line tool to bisect failing CPython tests.
|
||||
|
||||
Find the test_os test method which alters the environment:
|
||||
|
||||
./python -m test.bisect_cmd --fail-env-changed test_os
|
||||
|
||||
Find a reference leak in "test_os", write the list of failing tests into the
|
||||
"bisect" file:
|
||||
|
||||
./python -m test.bisect_cmd -o bisect -R 3:3 test_os
|
||||
|
||||
Load an existing list of tests from a file using -i option:
|
||||
|
||||
./python -m test --list-cases -m FileTests test_os > tests
|
||||
./python -m test.bisect_cmd -i tests test_os
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import os.path
|
||||
import math
|
||||
import random
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
|
||||
|
||||
def write_tests(filename, tests):
|
||||
with open(filename, "w") as fp:
|
||||
for name in tests:
|
||||
print(name, file=fp)
|
||||
fp.flush()
|
||||
|
||||
|
||||
def write_output(filename, tests):
|
||||
if not filename:
|
||||
return
|
||||
print("Write %s tests into %s" % (len(tests), filename))
|
||||
write_tests(filename, tests)
|
||||
return filename
|
||||
|
||||
|
||||
def format_shell_args(args):
|
||||
return ' '.join(args)
|
||||
|
||||
|
||||
def list_cases(args):
|
||||
cmd = [sys.executable, '-m', 'test', '--list-cases']
|
||||
cmd.extend(args.test_args)
|
||||
proc = subprocess.Popen(cmd,
|
||||
stdout=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
try:
|
||||
stdout = proc.communicate()[0]
|
||||
except:
|
||||
proc.stdout.close()
|
||||
proc.kill()
|
||||
proc.wait()
|
||||
raise
|
||||
exitcode = proc.wait()
|
||||
if exitcode:
|
||||
cmd = format_shell_args(cmd)
|
||||
print("Failed to list tests: %s failed with exit code %s"
|
||||
% (cmd, exitcode))
|
||||
sys.exit(exitcode)
|
||||
tests = stdout.splitlines()
|
||||
return tests
|
||||
|
||||
|
||||
def run_tests(args, tests, huntrleaks=None):
|
||||
tmp = tempfile.mktemp()
|
||||
try:
|
||||
write_tests(tmp, tests)
|
||||
|
||||
cmd = [sys.executable, '-m', 'test', '--matchfile', tmp]
|
||||
cmd.extend(args.test_args)
|
||||
print("+ %s" % format_shell_args(cmd))
|
||||
proc = subprocess.Popen(cmd)
|
||||
try:
|
||||
exitcode = proc.wait()
|
||||
except:
|
||||
proc.kill()
|
||||
proc.wait()
|
||||
raise
|
||||
return exitcode
|
||||
finally:
|
||||
if os.path.exists(tmp):
|
||||
os.unlink(tmp)
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-i', '--input',
|
||||
help='Test names produced by --list-tests written '
|
||||
'into a file. If not set, run --list-tests')
|
||||
parser.add_argument('-o', '--output',
|
||||
help='Result of the bisection')
|
||||
parser.add_argument('-n', '--max-tests', type=int, default=1,
|
||||
help='Maximum number of tests to stop the bisection '
|
||||
'(default: 1)')
|
||||
parser.add_argument('-N', '--max-iter', type=int, default=100,
|
||||
help='Maximum number of bisection iterations '
|
||||
'(default: 100)')
|
||||
# FIXME: document that following arguments are test arguments
|
||||
|
||||
args, test_args = parser.parse_known_args()
|
||||
args.test_args = test_args
|
||||
return args
|
||||
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
|
||||
if args.input:
|
||||
with open(args.input) as fp:
|
||||
tests = [line.strip() for line in fp]
|
||||
else:
|
||||
tests = list_cases(args)
|
||||
|
||||
print("Start bisection with %s tests" % len(tests))
|
||||
print("Test arguments: %s" % format_shell_args(args.test_args))
|
||||
print("Bisection will stop when getting %s or less tests "
|
||||
"(-n/--max-tests option), or after %s iterations "
|
||||
"(-N/--max-iter option)"
|
||||
% (args.max_tests, args.max_iter))
|
||||
output = write_output(args.output, tests)
|
||||
print()
|
||||
|
||||
start_time = time.time()
|
||||
iteration = 1
|
||||
try:
|
||||
while len(tests) > args.max_tests and iteration <= args.max_iter:
|
||||
ntest = len(tests)
|
||||
ntest = max(ntest // 2, 1)
|
||||
subtests = random.sample(tests, ntest)
|
||||
|
||||
print("[+] Iteration %s: run %s tests/%s"
|
||||
% (iteration, len(subtests), len(tests)))
|
||||
print()
|
||||
|
||||
exitcode = run_tests(args, subtests)
|
||||
|
||||
print("ran %s tests/%s" % (ntest, len(tests)))
|
||||
print("exit", exitcode)
|
||||
if exitcode:
|
||||
print("Tests failed: use this new subtest")
|
||||
tests = subtests
|
||||
output = write_output(args.output, tests)
|
||||
else:
|
||||
print("Tests succeeded: skip this subtest, try a new subbset")
|
||||
print()
|
||||
iteration += 1
|
||||
except KeyboardInterrupt:
|
||||
print()
|
||||
print("Bisection interrupted!")
|
||||
print()
|
||||
|
||||
print("Tests (%s):" % len(tests))
|
||||
for test in tests:
|
||||
print("* %s" % test)
|
||||
print()
|
||||
|
||||
if output:
|
||||
print("Output written into %s" % output)
|
||||
|
||||
dt = math.ceil(time.time() - start_time)
|
||||
if len(tests) <= args.max_tests:
|
||||
print("Bisection completed in %s iterations and %s"
|
||||
% (iteration, datetime.timedelta(seconds=dt)))
|
||||
sys.exit(1)
|
||||
else:
|
||||
print("Bisection failed after %s iterations and %s"
|
||||
% (iteration, datetime.timedelta(seconds=dt)))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
16
Lib/test/capath/0e4015b9.0
Normal file
16
Lib/test/capath/0e4015b9.0
Normal file
@@ -0,0 +1,16 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIClTCCAf6gAwIBAgIJAKGU95wKR8pTMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
|
||||
BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u
|
||||
IFNvZnR3YXJlIEZvdW5kYXRpb24xIzAhBgNVBAMMGnNlbGYtc2lnbmVkLnB5dGhv
|
||||
bnRlc3QubmV0MB4XDTE0MTEwMjE4MDkyOVoXDTI0MTAzMDE4MDkyOVowcDELMAkG
|
||||
A1UEBhMCWFkxFzAVBgNVBAcMDkNhc3RsZSBBbnRocmF4MSMwIQYDVQQKDBpQeXRo
|
||||
b24gU29mdHdhcmUgRm91bmRhdGlvbjEjMCEGA1UEAwwac2VsZi1zaWduZWQucHl0
|
||||
aG9udGVzdC5uZXQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANDXQXW9tjyZ
|
||||
Xt0Iv2tLL1+jinr4wGg36ioLDLFkMf+2Y1GL0v0BnKYG4N1OKlAU15LXGeGer8vm
|
||||
Sv/yIvmdrELvhAbbo3w4a9TMYQA4XkIVLdvu3mvNOAet+8PMJxn26dbDhG809ALv
|
||||
EHY57lQsBS3G59RZyBPVqAqmImWNJnVzAgMBAAGjNzA1MCUGA1UdEQQeMByCGnNl
|
||||
bGYtc2lnbmVkLnB5dGhvbnRlc3QubmV0MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN
|
||||
AQEFBQADgYEAIuzAhgMouJpNdf3URCHIineyoSt6WK/9+eyUcjlKOrDoXNZaD72h
|
||||
TXMeKYoWvJyVcSLKL8ckPtDobgP2OTt0UkyAaj0n+ZHaqq1lH2yVfGUA1ILJv515
|
||||
C8BqbvVZuqm3i7ygmw3bqE/lYMgOrYtXXnqOrz6nvsE6Yc9V9rFflOM=
|
||||
-----END CERTIFICATE-----
|
||||
14
Lib/test/capath/4e1295a3.0
Normal file
14
Lib/test/capath/4e1295a3.0
Normal file
@@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
|
||||
VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
|
||||
bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
|
||||
dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
|
||||
DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
|
||||
EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
|
||||
dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
|
||||
EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
|
||||
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
|
||||
L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
|
||||
BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
|
||||
9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
|
||||
-----END CERTIFICATE-----
|
||||
41
Lib/test/capath/5ed36f99.0
Normal file
41
Lib/test/capath/5ed36f99.0
Normal file
@@ -0,0 +1,41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aTuxZZKmxoGCXJzN600BiqXfEVWqFcofN8CCmHBh22p8lqOOLlQ+TyGpkO/c
|
||||
gr/c6EWtTZBzCDyUZbAEmXZ/4rzCahWqlwQ3JNgelE5tDlG+1sSPypZt90Pf6DBl
|
||||
Jzt7u0NDY8RD97LsaMzhGY4i+5jhe1o+ATc7iwiwovOVThrLm82asduycPAtStvY
|
||||
sONvRUgzEv/+PDIqVPfE94rwiCPCR/5kenHA0R6mY7AHfqQv0wGP3J8rtsYIqQ+T
|
||||
SCX8Ev2fQtzzxD72V7DX3WnRBnc0CkvSyqD/HMaMyRa+xMwyN2hzXwj7UfdJUzYF
|
||||
CpUCTPJ5GhD22Dp1nPMd8aINcGeGG7MW9S/lpOt5hvk9C8JzC6WZrG/8Z7jlLwum
|
||||
GCSNe9FINSkYQKyTYOGWhlC0elnYjyELn8+CkcY7v2vcB5G5l1YjqrZslMZIBjzk
|
||||
zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
|
||||
omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
|
||||
-----END CERTIFICATE-----
|
||||
14
Lib/test/capath/6e88d7b8.0
Normal file
14
Lib/test/capath/6e88d7b8.0
Normal file
@@ -0,0 +1,14 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIICLDCCAdYCAQAwDQYJKoZIhvcNAQEEBQAwgaAxCzAJBgNVBAYTAlBUMRMwEQYD
|
||||
VQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5ldXJv
|
||||
bmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMTEmJy
|
||||
dXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZpMB4X
|
||||
DTk2MDkwNTAzNDI0M1oXDTk2MTAwNTAzNDI0M1owgaAxCzAJBgNVBAYTAlBUMRMw
|
||||
EQYDVQQIEwpRdWVlbnNsYW5kMQ8wDQYDVQQHEwZMaXNib2ExFzAVBgNVBAoTDk5l
|
||||
dXJvbmlvLCBMZGEuMRgwFgYDVQQLEw9EZXNlbnZvbHZpbWVudG8xGzAZBgNVBAMT
|
||||
EmJydXR1cy5uZXVyb25pby5wdDEbMBkGCSqGSIb3DQEJARYMc2FtcG9AaWtpLmZp
|
||||
MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAL7+aty3S1iBA/+yxjxv4q1MUTd1kjNw
|
||||
L4lYKbpzzlmC5beaQXeQ2RmGMTXU+mDvuqItjVHOK3DvPK7lTcSGftUCAwEAATAN
|
||||
BgkqhkiG9w0BAQQFAANBAFqPEKFjk6T6CKTHvaQeEAsX0/8YHPHqH/9AnhSjrwuX
|
||||
9EBc0n6bVGhN7XaXd6sJ7dym9sbsWxb+pJdurnkxjx4=
|
||||
-----END CERTIFICATE-----
|
||||
41
Lib/test/capath/99d0fa06.0
Normal file
41
Lib/test/capath/99d0fa06.0
Normal file
@@ -0,0 +1,41 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
|
||||
IENBMR4wHAYDVQQLExVodHRwOi8vd3d3LmNhY2VydC5vcmcxIjAgBgNVBAMTGUNB
|
||||
IENlcnQgU2lnbmluZyBBdXRob3JpdHkxITAfBgkqhkiG9w0BCQEWEnN1cHBvcnRA
|
||||
Y2FjZXJ0Lm9yZzAeFw0wMzAzMzAxMjI5NDlaFw0zMzAzMjkxMjI5NDlaMHkxEDAO
|
||||
BgNVBAoTB1Jvb3QgQ0ExHjAcBgNVBAsTFWh0dHA6Ly93d3cuY2FjZXJ0Lm9yZzEi
|
||||
MCAGA1UEAxMZQ0EgQ2VydCBTaWduaW5nIEF1dGhvcml0eTEhMB8GCSqGSIb3DQEJ
|
||||
ARYSc3VwcG9ydEBjYWNl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||||
zk6q5PYvCdxTby78dOs6Y5nCpqyJvKeyRKANihDjbPIky/qbn3BHLt4Ui9SyIAmW
|
||||
omTxJBzcoTWcFbLUvFUufQb1nA5V9FrWk9p2rSVzTMVD
|
||||
-----END CERTIFICATE-----
|
||||
16
Lib/test/capath/ce7b8643.0
Normal file
16
Lib/test/capath/ce7b8643.0
Normal file
@@ -0,0 +1,16 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIClTCCAf6gAwIBAgIJAKGU95wKR8pTMA0GCSqGSIb3DQEBBQUAMHAxCzAJBgNV
|
||||
BAYTAlhZMRcwFQYDVQQHDA5DYXN0bGUgQW50aHJheDEjMCEGA1UECgwaUHl0aG9u
|
||||
IFNvZnR3YXJlIEZvdW5kYXRpb24xIzAhBgNVBAMMGnNlbGYtc2lnbmVkLnB5dGhv
|
||||
bnRlc3QubmV0MB4XDTE0MTEwMjE4MDkyOVoXDTI0MTAzMDE4MDkyOVowcDELMAkG
|
||||
A1UEBhMCWFkxFzAVBgNVBAcMDkNhc3RsZSBBbnRocmF4MSMwIQYDVQQKDBpQeXRo
|
||||
b24gU29mdHdhcmUgRm91bmRhdGlvbjEjMCEGA1UEAwwac2VsZi1zaWduZWQucHl0
|
||||
aG9udGVzdC5uZXQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANDXQXW9tjyZ
|
||||
Xt0Iv2tLL1+jinr4wGg36ioLDLFkMf+2Y1GL0v0BnKYG4N1OKlAU15LXGeGer8vm
|
||||
Sv/yIvmdrELvhAbbo3w4a9TMYQA4XkIVLdvu3mvNOAet+8PMJxn26dbDhG809ALv
|
||||
EHY57lQsBS3G59RZyBPVqAqmImWNJnVzAgMBAAGjNzA1MCUGA1UdEQQeMByCGnNl
|
||||
bGYtc2lnbmVkLnB5dGhvbnRlc3QubmV0MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcN
|
||||
AQEFBQADgYEAIuzAhgMouJpNdf3URCHIineyoSt6WK/9+eyUcjlKOrDoXNZaD72h
|
||||
TXMeKYoWvJyVcSLKL8ckPtDobgP2OTt0UkyAaj0n+ZHaqq1lH2yVfGUA1ILJv515
|
||||
C8BqbvVZuqm3i7ygmw3bqE/lYMgOrYtXXnqOrz6nvsE6Yc9V9rFflOM=
|
||||
-----END CERTIFICATE-----
|
||||
34
Lib/test/capath/efa5f9c3.0
Normal file
34
Lib/test/capath/efa5f9c3.0
Normal file
@@ -0,0 +1,34 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIF9zCCA9+gAwIBAgIUH98b4Fw/DyugC9cV7VK7ZODzHsIwDQYJKoZIhvcNAQEL
|
||||
BQAwgYoxCzAJBgNVBAYTAlhZMRcwFQYDVQQIDA5DYXN0bGUgQW50aHJheDEYMBYG
|
||||
A1UEBwwPQXJndW1lbnQgQ2xpbmljMSMwIQYDVQQKDBpQeXRob24gU29mdHdhcmUg
|
||||
Rm91bmRhdGlvbjEjMCEGA1UEAwwac2VsZi1zaWduZWQucHl0aG9udGVzdC5uZXQw
|
||||
HhcNMTkwNTA4MDEwMjQzWhcNMjcwNzI0MDEwMjQzWjCBijELMAkGA1UEBhMCWFkx
|
||||
FzAVBgNVBAgMDkNhc3RsZSBBbnRocmF4MRgwFgYDVQQHDA9Bcmd1bWVudCBDbGlu
|
||||
aWMxIzAhBgNVBAoMGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMSMwIQYDVQQD
|
||||
DBpzZWxmLXNpZ25lZC5weXRob250ZXN0Lm5ldDCCAiIwDQYJKoZIhvcNAQEBBQAD
|
||||
ggIPADCCAgoCggIBAMKdJlyCThkahwoBb7pl5q64Pe9Fn5jrIvzsveHTc97TpjV2
|
||||
RLfICnXKrltPk/ohkVl6K5SUZQZwMVzFubkyxE0nZPHYHlpiKWQxbsYVkYv01rix
|
||||
IFdLvaxxbGYke2jwQao31s4o61AdlsfK1SdpHQUynBBMssqI3SB4XPmcA7e+wEEx
|
||||
jxjVish4ixA1vuIZOx8yibu+CFCf/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qu7ARaxkdaZWhYaA2YyknwANdFfNpfH+elCLIk
|
||||
BUt5S3f4i7DaUePTvKukCZiCq4Oyln7RcOn5If73wCeLB/ZM9Ei1HforyLWP1CN8
|
||||
XLfpHaoeoPSWIveI0XHUl65LsPN2UbMbul/F23hwl+h8+BLmyAS680Yhn4zEN6Ku
|
||||
B7Po90HoFa1Du3bmx4jsN73UkT/dwMTi6K072FbipnC1904oGlWmLwvAHvrtxxmL
|
||||
Pl3pvEaZIu8wa/PNF6Y7J7VIewikIJq6Ta6FrWeFfzMWOj2qA1ZZi6fUaDSNYvuV
|
||||
J5quYKCc/O+I/yDDf8wyBbZ/gvUXzUHTMYGG+bFrn1p7XDbYYeEJ6R/xEg==
|
||||
-----END CERTIFICATE-----
|
||||
2
Lib/test/cfgparser.1
Normal file
2
Lib/test/cfgparser.1
Normal file
@@ -0,0 +1,2 @@
|
||||
[Foo Bar]
|
||||
foo=newbar
|
||||
9
Lib/test/cjkencodings/big5-utf8.txt
Normal file
9
Lib/test/cjkencodings/big5-utf8.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
如何在 Python 中使用既有的 C library?
|
||||
在資訊科技快速發展的今天, 開發及測試軟體的速度是不容忽視的
|
||||
課題. 為加快開發及測試的速度, 我們便常希望能利用一些已開發好的
|
||||
library, 並有一個 fast prototyping 的 programming language 可
|
||||
供使用. 目前有許許多多的 library 是以 C 寫成, 而 Python 是一個
|
||||
fast prototyping 的 programming language. 故我們希望能將既有的
|
||||
C library 拿到 Python 的環境中測試及整合. 其中最主要也是我們所
|
||||
要討論的問題就是:
|
||||
|
||||
9
Lib/test/cjkencodings/big5.txt
Normal file
9
Lib/test/cjkencodings/big5.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
<EFBFBD>p<EFBFBD><EFBFBD><EFBFBD>b Python <20><><EFBFBD>ϥάJ<CEAC><4A><EFBFBD><EFBFBD> C library?
|
||||
<EFBFBD>@<40>b<EFBFBD><62><EFBFBD>T<EFBFBD><54><EFBFBD>ާֳt<D6B3>o<EFBFBD>i<EFBFBD><69><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>}<7D>o<EFBFBD>δ<EFBFBD><CEB4>ճn<D5B3>骺<EFBFBD>t<EFBFBD>O<D7AC><4F><EFBFBD>e<EFBFBD><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD>D. <20><><EFBFBD>[<5B>ֶ}<7D>o<EFBFBD>δ<EFBFBD><CEB4>ժ<EFBFBD><D5AA>t<EFBFBD><74>, <20>ڭ̫K<CCAB>`<60>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>Q<EFBFBD>Τ@<40>Ǥw<C7A4>}<7D>o<EFBFBD>n<EFBFBD><6E>
|
||||
library, <20>æ<EFBFBD><C3A6>@<40><> fast prototyping <20><> programming language <20>i
|
||||
<EFBFBD>Ѩϥ<EFBFBD>. <20>ثe<D8AB><65><EFBFBD>\<5C>\<5C>h<EFBFBD>h<EFBFBD><68> library <20>O<EFBFBD>H C <20>g<EFBFBD><67>, <20><> Python <20>O<EFBFBD>@<40><>
|
||||
fast prototyping <20><> programming language. <20>G<EFBFBD>ڭ̧Ʊ<CCA7><C6B1><EFBFBD><EFBFBD>N<EFBFBD>J<EFBFBD><4A><EFBFBD><EFBFBD>
|
||||
C library <20><><EFBFBD><EFBFBD> Python <20><><EFBFBD><EFBFBD><EFBFBD>Ҥ<EFBFBD><D2A4><EFBFBD><EFBFBD>դξ<D5A4><CEBE>X. <20>䤤<EFBFBD>̥D<CCA5>n<EFBFBD>]<5D>O<EFBFBD>ڭ̩<DAAD>
|
||||
<EFBFBD>n<EFBFBD>Q<EFBFBD>ת<EFBFBD><EFBFBD><EFBFBD><EFBFBD>D<EFBFBD>N<EFBFBD>O:
|
||||
|
||||
2
Lib/test/cjkencodings/big5hkscs-utf8.txt
Normal file
2
Lib/test/cjkencodings/big5hkscs-utf8.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
𠄌Ě鵮罓洆
|
||||
ÊÊ̄ê êê̄
|
||||
2
Lib/test/cjkencodings/big5hkscs.txt
Normal file
2
Lib/test/cjkencodings/big5hkscs.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
<EFBFBD>E<EFBFBD>\<5C>s<EFBFBD>ڍ<EFBFBD>
|
||||
<EFBFBD>f<EFBFBD>b<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
9
Lib/test/cjkencodings/cp949-utf8.txt
Normal file
9
Lib/test/cjkencodings/cp949-utf8.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
똠방각하 펲시콜라
|
||||
|
||||
㉯㉯납!! 因九月패믤릔궈 ⓡⓖ훀¿¿¿ 긍뒙 ⓔ뎨 ㉯. .
|
||||
亞영ⓔ능횹 . . . . 서울뤄 뎐학乙 家훀 ! ! !ㅠ.ㅠ
|
||||
흐흐흐 ㄱㄱㄱ☆ㅠ_ㅠ 어릨 탸콰긐 뎌응 칑九들乙 ㉯드긐
|
||||
설릌 家훀 . . . . 굴애쉌 ⓔ궈 ⓡ릘㉱긐 因仁川女中까즼
|
||||
와쒀훀 ! ! 亞영ⓔ 家능궈 ☆上관 없능궈능 亞능뒈훀 글애듴
|
||||
ⓡ려듀九 싀풔숴훀 어릨 因仁川女中싁⑨들앜!! ㉯㉯납♡ ⌒⌒*
|
||||
|
||||
9
Lib/test/cjkencodings/cp949.txt
Normal file
9
Lib/test/cjkencodings/cp949.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
<EFBFBD>c<EFBFBD>氢<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD>
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!! <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>В<EFBFBD><D092>p<EFBFBD><70> <20>ި<EFBFBD><DEA8>R<EFBFBD><52><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ѵ<EFBFBD> <20><>. .
|
||||
䬿<EFBFBD><EFBFBD>Ѵ<EFBFBD><EFBFBD><EFBFBD> . . . . <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ʫ<>R ! ! !<21><>.<2E><>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>٤<EFBFBD>_<EFBFBD><5F> <20> <20><><EFBFBD><EFBFBD><EFBFBD>O <20><><EFBFBD><EFBFBD> <20>h<EFBFBD><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>O
|
||||
<EFBFBD><EFBFBD><EFBFBD>j ʫ<>R . . . . <20><><EFBFBD>֚f <20>ѱ<EFBFBD> <20>ސt<DE90>O <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD>;<EFBFBD><EFBFBD>R ! ! 䬿<><E4ACBF><EFBFBD> ʫ<>ɱ<EFBFBD> <20><>߾<EFBFBD><DFBE> <20><><EFBFBD>ɱŴ<C9B1> 䬴ɵ<E4ACB4><C9B5>R <20>۾֊<DBBE>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ǵ<EFBFBD><C7B4><EFBFBD>R <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĩ<EFBFBD><C4A8><EFBFBD><EFBFBD><EFBFBD>!! <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ҡ<EFBFBD>*
|
||||
|
||||
8
Lib/test/cjkencodings/euc_jisx0213-utf8.txt
Normal file
8
Lib/test/cjkencodings/euc_jisx0213-utf8.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Python の開発は、1990 年ごろから開始されています。
|
||||
開発者の Guido van Rossum は教育用のプログラミング言語「ABC」の開発に参加していましたが、ABC は実用上の目的にはあまり適していませんでした。
|
||||
このため、Guido はより実用的なプログラミング言語の開発を開始し、英国 BBS 放送のコメディ番組「モンティ パイソン」のファンである Guido はこの言語を「Python」と名づけました。
|
||||
このような背景から生まれた Python の言語設計は、「シンプル」で「習得が容易」という目標に重点が置かれています。
|
||||
多くのスクリプト系言語ではユーザの目先の利便性を優先して色々な機能を言語要素として取り入れる場合が多いのですが、Python ではそういった小細工が追加されることはあまりありません。
|
||||
言語自体の機能は最小限に押さえ、必要な機能は拡張モジュールとして追加する、というのが Python のポリシーです。
|
||||
|
||||
ノか゚ ト゚ トキ喝塀 𡚴𪎌 麀齁𩛰
|
||||
8
Lib/test/cjkencodings/euc_jisx0213.txt
Normal file
8
Lib/test/cjkencodings/euc_jisx0213.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Python <20>γ<EFBFBD>ȯ<EFBFBD>ϡ<EFBFBD>1990 ǯ<><C7AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>鳫<EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD>
|
||||
<EFBFBD><EFBFBD>ȯ<EFBFBD>Ԥ<EFBFBD> Guido van Rossum <20>϶<EFBFBD><CFB6><EFBFBD><EFBFBD>ѤΥץ<CEA5><D7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߥ<DFA5><F3A5B0B8><EFBFBD><EFBFBD><EFBFBD>ABC<42>פγ<D7A4>ȯ<EFBFBD>˻<EFBFBD><CBBB>ä<EFBFBD><C3A4>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ABC <20>ϼ<EFBFBD><CFBC>Ѿ<EF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||||
<EFBFBD><EFBFBD><EFBFBD>켫<EFBFBD>Τε<EFBFBD>ǽ<EFBFBD>ϺǾ<EFBFBD><EFBFBD>¤˲<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פʵ<EFBFBD>ǽ<EFBFBD>ϳ<EFBFBD>ĥ<EFBFBD>⥸<EFBFBD>塼<EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲä<EFBFBD><EFBFBD>롢<EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD> Python <20>Υݥꥷ<DDA5><EAA5B7><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD>
|
||||
|
||||
<EFBFBD>Τ<EFBFBD> <20><> <20>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ԏ<EFBFBD><D48F><EFBFBD><EFBFBD><EFBFBD>
|
||||
7
Lib/test/cjkencodings/euc_jp-utf8.txt
Normal file
7
Lib/test/cjkencodings/euc_jp-utf8.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Python の開発は、1990 年ごろから開始されています。
|
||||
開発者の Guido van Rossum は教育用のプログラミング言語「ABC」の開発に参加していましたが、ABC は実用上の目的にはあまり適していませんでした。
|
||||
このため、Guido はより実用的なプログラミング言語の開発を開始し、英国 BBS 放送のコメディ番組「モンティ パイソン」のファンである Guido はこの言語を「Python」と名づけました。
|
||||
このような背景から生まれた Python の言語設計は、「シンプル」で「習得が容易」という目標に重点が置かれています。
|
||||
多くのスクリプト系言語ではユーザの目先の利便性を優先して色々な機能を言語要素として取り入れる場合が多いのですが、Python ではそういった小細工が追加されることはあまりありません。
|
||||
言語自体の機能は最小限に押さえ、必要な機能は拡張モジュールとして追加する、というのが Python のポリシーです。
|
||||
|
||||
7
Lib/test/cjkencodings/euc_jp.txt
Normal file
7
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 -0,0 +1,7 @@
|
||||
◎ 파이썬(Python)은 배우기 쉽고, 강력한 프로그래밍 언어입니다. 파이썬은
|
||||
효율적인 고수준 데이터 구조와 간단하지만 효율적인 객체지향프로그래밍을
|
||||
지원합니다. 파이썬의 우아(優雅)한 문법과 동적 타이핑, 그리고 인터프리팅
|
||||
환경은 파이썬을 스크립팅과 여러 분야에서와 대부분의 플랫폼에서의 빠른
|
||||
애플리케이션 개발을 할 수 있는 이상적인 언어로 만들어줍니다.
|
||||
|
||||
☆첫가끝: 날아라 쓔쓔쓩~ 닁큼! 뜽금없이 전홥니다. 뷁. 그런거 읎다.
|
||||
7
Lib/test/cjkencodings/euc_kr.txt
Normal file
7
Lib/test/cjkencodings/euc_kr.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
<EFBFBD><EFBFBD> <20><><EFBFBD>̽<EFBFBD>(Python)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>α<CEB1><D7B7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>. <20><><EFBFBD>̽<EFBFBD><CCBD><EFBFBD>
|
||||
ȿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȿ<><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>α<CEB1><D7B7><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>մϴ<EFBFBD>. <20><><EFBFBD>̽<EFBFBD><CCBD><EFBFBD> <20><><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8><EFBFBD><EFBFBD>, <20><EFBFBD><D7B8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ȯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>̽<EFBFBD><CCBD><EFBFBD> <20><>ũ<EFBFBD><C5A9><EFBFBD>ð<EFBFBD> <20><><EFBFBD><EFBFBD> <20>о߿<D0BE><DFBF><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>κ<EFBFBD><CEBA><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD>ø<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̼<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20>ִ<EFBFBD> <20>̻<EFBFBD><CCBB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴϴ<DDB4>.
|
||||
|
||||
<EFBFBD><EFBFBD>ù<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD>ƶ<EFBFBD> <20>Ԥ<EFBFBD><D4A4>ФԤԤ<D4A4><D4A4>ФԾ<D0A4>~ <20>Ԥ<EFBFBD><D4A4>Ҥ<EFBFBD>ŭ! <20>Ԥ<EFBFBD><D4A4>Ѥ<EFBFBD><D1A4>ݾ<EFBFBD><DDBE><EFBFBD> <20><><EFBFBD>Ԥ<EFBFBD><D4A4>Ȥ<EFBFBD><C8A4>ϴ<EFBFBD>. <20>Ԥ<EFBFBD><D4A4>Τ<EFBFBD>. <20><EFBFBD><D7B7><EFBFBD> <20>Ԥ<EFBFBD><D4A4>Ѥ<EFBFBD><D1A4><EFBFBD>.
|
||||
15
Lib/test/cjkencodings/gb18030-utf8.txt
Normal file
15
Lib/test/cjkencodings/gb18030-utf8.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
Python(派森)语言是一种功能强大而完善的通用型计算机程序设计语言,
|
||||
已经具有十多年的发展历史,成熟且稳定。这种语言具有非常简捷而清晰
|
||||
的语法特点,适合完成各种高层任务,几乎可以在所有的操作系统中
|
||||
运行。这种语言简单而强大,适合各种人士学习使用。目前,基于这
|
||||
种语言的相关技术正在飞速的发展,用户数量急剧扩大,相关的资源非常多。
|
||||
如何在 Python 中使用既有的 C library?
|
||||
在資訊科技快速發展的今天, 開發及測試軟體的速度是不容忽視的
|
||||
課題. 為加快開發及測試的速度, 我們便常希望能利用一些已開發好的
|
||||
library, 並有一個 fast prototyping 的 programming language 可
|
||||
供使用. 目前有許許多多的 library 是以 C 寫成, 而 Python 是一個
|
||||
fast prototyping 的 programming language. 故我們希望能將既有的
|
||||
C library 拿到 Python 的環境中測試及整合. 其中最主要也是我們所
|
||||
要討論的問題就是:
|
||||
파이썬은 강력한 기능을 지닌 범용 컴퓨터 프로그래밍 언어다.
|
||||
|
||||
15
Lib/test/cjkencodings/gb18030.txt
Normal file
15
Lib/test/cjkencodings/gb18030.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
Python<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD>ͼ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<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD><EFBFBD>ٵķ<EFBFBD>չ<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>dz<EFBFBD><EFBFBD>ࡣ
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Python <20><>ʹ<EFBFBD>ü<EFBFBD><C3BC>е<EFBFBD> C library?
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>YӍ<EFBFBD>Ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٰlչ<EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD>, <20>_<EFBFBD>l<EFBFBD><6C><EFBFBD>yԇܛ<D487>w<EFBFBD><77><EFBFBD>ٶ<EFBFBD><D9B6>Dz<EFBFBD><C7B2>ݺ<EFBFBD>ҕ<EFBFBD><D295>
|
||||
<EFBFBD>n<EFBFBD>}. <20><><EFBFBD>ӿ<EFBFBD><D3BF>_<EFBFBD>l<EFBFBD><6C><EFBFBD>yԇ<79><D487><EFBFBD>ٶ<EFBFBD>, <20>҂<EFBFBD><D282>㳣ϣ<E3B3A3><CFA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һЩ<D2BB><D0A9><EFBFBD>_<EFBFBD>l<EFBFBD>õ<EFBFBD>
|
||||
library, <20>K<EFBFBD><4B>һ<EFBFBD><D2BB> fast prototyping <20><> programming language <20><>
|
||||
<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>. Ŀǰ<C4BF><C7B0><EFBFBD>S<EFBFBD>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD> library <20><><EFBFBD><EFBFBD> C <20><><EFBFBD><EFBFBD>, <20><> Python <20><>һ<EFBFBD><D2BB>
|
||||
fast prototyping <20><> programming language. <20><><EFBFBD>҂<EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD>܌<EFBFBD><DC8C><EFBFBD><EFBFBD>е<EFBFBD>
|
||||
C library <20>õ<EFBFBD> Python <20>ĭh<C4AD><68><EFBFBD>Мyԇ<79><D487><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҪҲ<D2AA><D2B2><EFBFBD>҂<EFBFBD><D282><EFBFBD>
|
||||
ҪӑՓ<EFBFBD>Ć<EFBFBD><EFBFBD>}<7D><><EFBFBD><EFBFBD>:
|
||||
<EFBFBD>5<EFBFBD>1<EFBFBD>3<EFBFBD>3<EFBFBD>2<EFBFBD>1<EFBFBD>3<EFBFBD>1 <20>7<EFBFBD>6<EFBFBD>0<EFBFBD>4<EFBFBD>6<EFBFBD>3 <20>8<EFBFBD>5<EFBFBD>8<EFBFBD>6<EFBFBD>3<EFBFBD>5 <20>3<EFBFBD>1<EFBFBD>9<EFBFBD>5 <20>0<EFBFBD>9<EFBFBD>3<EFBFBD>0 <20>4<EFBFBD>3<EFBFBD>5<EFBFBD>7<EFBFBD>5<EFBFBD>5 <20>5<EFBFBD>5<EFBFBD>0<EFBFBD>9<EFBFBD>8<EFBFBD>9<EFBFBD>9<EFBFBD>3<EFBFBD>0<EFBFBD>4 <20>2<EFBFBD>9<EFBFBD>2<EFBFBD>5<EFBFBD>9<EFBFBD>9.
|
||||
|
||||
6
Lib/test/cjkencodings/gb2312-utf8.txt
Normal file
6
Lib/test/cjkencodings/gb2312-utf8.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
Python(派森)语言是一种功能强大而完善的通用型计算机程序设计语言,
|
||||
已经具有十多年的发展历史,成熟且稳定。这种语言具有非常简捷而清晰
|
||||
的语法特点,适合完成各种高层任务,几乎可以在所有的操作系统中
|
||||
运行。这种语言简单而强大,适合各种人士学习使用。目前,基于这
|
||||
种语言的相关技术正在飞速的发展,用户数量急剧扩大,相关的资源非常多。
|
||||
|
||||
6
Lib/test/cjkencodings/gb2312.txt
Normal file
6
Lib/test/cjkencodings/gb2312.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
Python<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>
|
||||
<EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD>չ<EFBFBD><EFBFBD>ʷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ծ<EFBFBD><EFBFBD>зdz<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص㣬<EFBFBD>ʺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɸ<EFBFBD><EFBFBD>ָ߲<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>еIJ<EFBFBD><EFBFBD><EFBFBD>ϵͳ<EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD>С<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʺϸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʿѧϰʹ<EFBFBD>á<EFBFBD>Ŀǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ե<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD><EFBFBD>ٵķ<EFBFBD>չ<EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD>Դ<EFBFBD>dz<EFBFBD><EFBFBD>ࡣ
|
||||
|
||||
14
Lib/test/cjkencodings/gbk-utf8.txt
Normal file
14
Lib/test/cjkencodings/gbk-utf8.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
Python(派森)语言是一种功能强大而完善的通用型计算机程序设计语言,
|
||||
已经具有十多年的发展历史,成熟且稳定。这种语言具有非常简捷而清晰
|
||||
的语法特点,适合完成各种高层任务,几乎可以在所有的操作系统中
|
||||
运行。这种语言简单而强大,适合各种人士学习使用。目前,基于这
|
||||
种语言的相关技术正在飞速的发展,用户数量急剧扩大,相关的资源非常多。
|
||||
如何在 Python 中使用既有的 C library?
|
||||
在資訊科技快速發展的今天, 開發及測試軟體的速度是不容忽視的
|
||||
課題. 為加快開發及測試的速度, 我們便常希望能利用一些已開發好的
|
||||
library, 並有一個 fast prototyping 的 programming language 可
|
||||
供使用. 目前有許許多多的 library 是以 C 寫成, 而 Python 是一個
|
||||
fast prototyping 的 programming language. 故我們希望能將既有的
|
||||
C library 拿到 Python 的環境中測試及整合. 其中最主要也是我們所
|
||||
要討論的問題就是:
|
||||
|
||||
14
Lib/test/cjkencodings/gbk.txt
Normal file
14
Lib/test/cjkencodings/gbk.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
Python<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>ֹ<EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ԣ<EFBFBD>
|
||||
<EFBFBD>Ѿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD>չ<EFBFBD><EFBFBD>ʷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E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
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Python <20><>ʹ<EFBFBD>ü<EFBFBD><C3BC>е<EFBFBD> C library?
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>YӍ<EFBFBD>Ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٰlչ<EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD>, <20>_<EFBFBD>l<EFBFBD><6C><EFBFBD>yԇܛ<D487>w<EFBFBD><77><EFBFBD>ٶ<EFBFBD><D9B6>Dz<EFBFBD><C7B2>ݺ<EFBFBD>ҕ<EFBFBD><D295>
|
||||
<EFBFBD>n<EFBFBD>}. <20><><EFBFBD>ӿ<EFBFBD><D3BF>_<EFBFBD>l<EFBFBD><6C><EFBFBD>yԇ<79><D487><EFBFBD>ٶ<EFBFBD>, <20>҂<EFBFBD><D282>㳣ϣ<E3B3A3><CFA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һЩ<D2BB><D0A9><EFBFBD>_<EFBFBD>l<EFBFBD>õ<EFBFBD>
|
||||
library, <20>K<EFBFBD><4B>һ<EFBFBD><D2BB> fast prototyping <20><> programming language <20><>
|
||||
<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD>. Ŀǰ<C4BF><C7B0><EFBFBD>S<EFBFBD>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD><EFBFBD> library <20><><EFBFBD><EFBFBD> C <20><><EFBFBD><EFBFBD>, <20><> Python <20><>һ<EFBFBD><D2BB>
|
||||
fast prototyping <20><> programming language. <20><><EFBFBD>҂<EFBFBD>ϣ<EFBFBD><CFA3><EFBFBD>܌<EFBFBD><DC8C><EFBFBD><EFBFBD>е<EFBFBD>
|
||||
C library <20>õ<EFBFBD> Python <20>ĭh<C4AD><68><EFBFBD>Мyԇ<79><D487><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҪҲ<D2AA><D2B2><EFBFBD>҂<EFBFBD><D282><EFBFBD>
|
||||
ҪӑՓ<EFBFBD>Ć<EFBFBD><EFBFBD>}<7D><><EFBFBD><EFBFBD>:
|
||||
|
||||
2
Lib/test/cjkencodings/hz-utf8.txt
Normal file
2
Lib/test/cjkencodings/hz-utf8.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
This sentence is in ASCII.
|
||||
The next sentence is in GB.己所不欲,勿施於人。Bye.
|
||||
2
Lib/test/cjkencodings/hz.txt
Normal file
2
Lib/test/cjkencodings/hz.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
This sentence is in ASCII.
|
||||
The next sentence is in GB.~{<:Ky2;S{#,NpJ)l6HK!#~}Bye.
|
||||
7
Lib/test/cjkencodings/iso2022_jp-utf8.txt
Normal file
7
Lib/test/cjkencodings/iso2022_jp-utf8.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Python の開発は、1990 年ごろから開始されています。
|
||||
開発者の Guido van Rossum は教育用のプログラミング言語「ABC」の開発に参加していましたが、ABC は実用上の目的にはあまり適していませんでした。
|
||||
このため、Guido はより実用的なプログラミング言語の開発を開始し、英国 BBS 放送のコメディ番組「モンティ パイソン」のファンである Guido はこの言語を「Python」と名づけました。
|
||||
このような背景から生まれた Python の言語設計は、「シンプル」で「習得が容易」という目標に重点が置かれています。
|
||||
多くのスクリプト系言語ではユーザの目先の利便性を優先して色々な機能を言語要素として取り入れる場合が多いのですが、Python ではそういった小細工が追加されることはあまりありません。
|
||||
言語自体の機能は最小限に押さえ、必要な機能は拡張モジュールとして追加する、というのが Python のポリシーです。
|
||||
|
||||
7
Lib/test/cjkencodings/iso2022_jp.txt
Normal file
7
Lib/test/cjkencodings/iso2022_jp.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Python $B$N3+H/$O!"(B1990 $BG/$4$m$+$i3+;O$5$l$F$$$^$9!#(B
|
||||
$B3+H/<T$N(B Guido van Rossum $B$O650iMQ$N%W%m%0%i%_%s%08@8l!V(BABC$B!W$N3+H/$K;22C$7$F$$$^$7$?$,!"(BABC $B$O<BMQ>e$NL\E*$K$O$"$^$jE,$7$F$$$^$;$s$G$7$?!#(B
|
||||
$B$3$N$?$a!"(BGuido $B$O$h$j<BMQE*$J%W%m%0%i%_%s%08@8l$N3+H/$r3+;O$7!"1Q9q(B BBS $BJ|Aw$N%3%a%G%#HVAH!V%b%s%F%#(B $B%Q%$%=%s!W$N%U%!%s$G$"$k(B Guido $B$O$3$N8@8l$r!V(BPython$B!W$HL>$E$1$^$7$?!#(B
|
||||
$B$3$N$h$&$JGX7J$+$i@8$^$l$?(B Python $B$N8@8l@_7W$O!"!V%7%s%W%k!W$G!V=,F@$,MF0W!W$H$$$&L\I8$K=EE@$,CV$+$l$F$$$^$9!#(B
|
||||
$BB?$/$N%9%/%j%W%H7O8@8l$G$O%f!<%6$NL\@h$NMxJX@-$rM%@h$7$F?'!9$J5!G=$r8@8lMWAG$H$7$F<h$jF~$l$k>l9g$,B?$$$N$G$9$,!"(BPython $B$G$O$=$&$$$C$?>.:Y9)$,DI2C$5$l$k$3$H$O$"$^$j$"$j$^$;$s!#(B
|
||||
$B8@8l<+BN$N5!G=$O:G>.8B$K2!$5$(!"I,MW$J5!G=$O3HD%%b%8%e!<%k$H$7$FDI2C$9$k!"$H$$$&$N$,(B Python $B$N%]%j%7!<$G$9!#(B
|
||||
|
||||
7
Lib/test/cjkencodings/iso2022_kr-utf8.txt
Normal file
7
Lib/test/cjkencodings/iso2022_kr-utf8.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
◎ 파이썬(Python)은 배우기 쉽고, 강력한 프로그래밍 언어입니다. 파이썬은
|
||||
효율적인 고수준 데이터 구조와 간단하지만 효율적인 객체지향프로그래밍을
|
||||
지원합니다. 파이썬의 우아(優雅)한 문법과 동적 타이핑, 그리고 인터프리팅
|
||||
환경은 파이썬을 스크립팅과 여러 분야에서와 대부분의 플랫폼에서의 빠른
|
||||
애플리케이션 개발을 할 수 있는 이상적인 언어로 만들어줍니다.
|
||||
|
||||
☆첫가끝: 날아라 쓩~ 큼! 금없이 전니다. 그런거 다.
|
||||
7
Lib/test/cjkencodings/iso2022_kr.txt
Normal file
7
Lib/test/cjkencodings/iso2022_kr.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
$)C!] FD@L=c(Python)@: 9h?l1b =10m, 0-7BGQ GA7N1W7!9V >p>n@T4O4Y. FD@L=c@:
|
||||
H?@2@{@N 0m<vAX 5%@LEM 18A6?M 0#4\GOAv88 H?@2@{@N 04C<AvGbGA7N1W7!9V@;
|
||||
Av?xGU4O4Y. FD@L=c@G ?l>F(iPd:)GQ 9.9}0z 5?@{ E8@LGN, 1W8.0m @NEMGA8.FC
|
||||
H/0f@: FD@L=c@; =:E)83FC0z ?)7/ :P>_?!<-?M 4k:N:P@G GC7'F{?!<-@G :|8%
|
||||
>VGC8.DI@L<G 039_@; GR <v @V4B @L;s@{@N >p>n7N 885i>nA]4O4Y.
|
||||
|
||||
!YC90!3!: 3/>F6s >1~ E-! 1]>x@L @|4O4Y. 1W710E 4Y.
|
||||
9
Lib/test/cjkencodings/johab-utf8.txt
Normal file
9
Lib/test/cjkencodings/johab-utf8.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
똠방각하 펲시콜라
|
||||
|
||||
㉯㉯납!! 因九月패믤릔궈 ⓡⓖ훀¿¿¿ 긍뒙 ⓔ뎨 ㉯. .
|
||||
亞영ⓔ능횹 . . . . 서울뤄 뎐학乙 家훀 ! ! !ㅠ.ㅠ
|
||||
흐흐흐 ㄱㄱㄱ☆ㅠ_ㅠ 어릨 탸콰긐 뎌응 칑九들乙 ㉯드긐
|
||||
설릌 家훀 . . . . 굴애쉌 ⓔ궈 ⓡ릘㉱긐 因仁川女中까즼
|
||||
와쒀훀 ! ! 亞영ⓔ 家능궈 ☆上관 없능궈능 亞능뒈훀 글애듴
|
||||
ⓡ려듀九 싀풔숴훀 어릨 因仁川女中싁⑨들앜!! ㉯㉯납♡ ⌒⌒*
|
||||
|
||||
9
Lib/test/cjkencodings/johab.txt
Normal file
9
Lib/test/cjkencodings/johab.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
<EFBFBD><EFBFBD><EFBFBD>w<EFBFBD>b<EFBFBD>a <20>\<5C><>ũ<EFBFBD>a
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>s!! <20>g<EFBFBD><67><EFBFBD>Ú<55><CC81><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>zٯٯٯ <20>w<EFBFBD><77> <20>ѕ<EFBFBD> <20><>. .
|
||||
<EFBFBD><<3C>w<EFBFBD>ѓw<D193>s . . . . <20>ᶉ<EFBFBD><E1B689> <20>e<EFBFBD>b<EFBFBD><62> <20>;<3B>z ! ! !<21>A.<2E>A
|
||||
<EFBFBD>a<EFBFBD>a<EFBFBD>a <20>A<EFBFBD>A<EFBFBD>A<EFBFBD>i<EFBFBD>A_<41>A <20>៚ ȡ<><C8A1><EFBFBD>z <20>a<EFBFBD>w ×✗i<E29C97><69> <20><><EFBFBD>a<EFBFBD>z
|
||||
<EFBFBD><EFBFBD><EFBFBD>z <20>;<3B>z . . . . <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ъ<EFBFBD> <20>ޟ<EFBFBD><DE9F>z <20>g<EFBFBD>b<EFBFBD>I<EFBFBD><49><EFBFBD><EFBFBD><EFBFBD>a<EFBFBD><61>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>z ! ! <20><<3C>w<EFBFBD><77> <20>;<3B>w<EFBFBD><77> <20>i꾉<69> <20><><EFBFBD>w<EFBFBD><77><EFBFBD>w <20><<3C>w<EFBFBD><77><EFBFBD>z <20>i<EFBFBD><69><EFBFBD>z
|
||||
<EFBFBD>ޝa<EFBFBD>A<EFBFBD><EFBFBD> <20><>Ρ<EFBFBD><CEA1><EFBFBD>z <20>៚ <20>g<EFBFBD>b<EFBFBD>I<EFBFBD><49><EFBFBD>鯂<EFBFBD><E9AF82><EFBFBD>i<EFBFBD>z!! <20><><EFBFBD><EFBFBD><EFBFBD>sٽ <20>b<EFBFBD>b*
|
||||
|
||||
7
Lib/test/cjkencodings/shift_jis-utf8.txt
Normal file
7
Lib/test/cjkencodings/shift_jis-utf8.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Python の開発は、1990 年ごろから開始されています。
|
||||
開発者の Guido van Rossum は教育用のプログラミング言語「ABC」の開発に参加していましたが、ABC は実用上の目的にはあまり適していませんでした。
|
||||
このため、Guido はより実用的なプログラミング言語の開発を開始し、英国 BBS 放送のコメディ番組「モンティ パイソン」のファンである Guido はこの言語を「Python」と名づけました。
|
||||
このような背景から生まれた Python の言語設計は、「シンプル」で「習得が容易」という目標に重点が置かれています。
|
||||
多くのスクリプト系言語ではユーザの目先の利便性を優先して色々な機能を言語要素として取り入れる場合が多いのですが、Python ではそういった小細工が追加されることはあまりありません。
|
||||
言語自体の機能は最小限に押さえ、必要な機能は拡張モジュールとして追加する、というのが Python のポリシーです。
|
||||
|
||||
7
Lib/test/cjkencodings/shift_jis.txt
Normal file
7
Lib/test/cjkencodings/shift_jis.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Python <20>̊J<CC8A><4A><EFBFBD>́A1990 <20>N<EFBFBD><4E><EFBFBD>납<EFBFBD><EB82A9><EFBFBD>J<EFBFBD>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82>B
|
||||
<EFBFBD>J<EFBFBD><EFBFBD><EFBFBD>҂<EFBFBD> Guido van Rossum <20>͋<EFBFBD><CD8B><EFBFBD><EFBFBD>p<EFBFBD>̃v<CC83><76><EFBFBD>O<EFBFBD><4F><EFBFBD>~<7E><><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>uABC<42>v<EFBFBD>̊J<CC8A><4A><EFBFBD>ɎQ<C98E><51><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>AABC <20>͎<EFBFBD><CD8E>p<EFBFBD><70><EFBFBD>̖ړI<DA93>ɂ͂<C982><CD82>܂<EFBFBD><DC82>K<EFBFBD><4B><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD><EFBFBD>B
|
||||
<EFBFBD><EFBFBD><EFBFBD>̂<EFBFBD><EFBFBD>߁AGuido <20>͂<EFBFBD><CD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>I<EFBFBD>ȃv<C883><76><EFBFBD>O<EFBFBD><4F><EFBFBD>~<7E><><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>̊J<CC8A><4A><EFBFBD><EFBFBD><EFBFBD>J<EFBFBD>n<EFBFBD><6E><EFBFBD>A<EFBFBD>p<EFBFBD><70> BBS <20><><EFBFBD><EFBFBD><EFBFBD>̃R<CC83><52><EFBFBD>f<EFBFBD>B<EFBFBD>ԑg<D491>u<EFBFBD><75><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD>B <20>p<EFBFBD>C<EFBFBD>\<5C><><EFBFBD>v<EFBFBD>̃t<CC83>@<40><><EFBFBD>ł<EFBFBD><C582><EFBFBD> Guido <20>͂<EFBFBD><CD82>̌<EFBFBD><CC8C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>uPython<6F>v<EFBFBD>Ɩ<EFBFBD><C696>Â<EFBFBD><C382>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
|
||||
<EFBFBD><EFBFBD><EFBFBD>̂悤<EFBFBD>Ȕw<EFBFBD>i<EFBFBD><EFBFBD><EFBFBD>琶<EFBFBD>܂ꂽ Python <20>̌<EFBFBD><CC8C><EFBFBD><EFBFBD>v<DD8C>́A<CD81>u<EFBFBD>V<EFBFBD><56><EFBFBD>v<EFBFBD><76><EFBFBD>v<EFBFBD>Łu<C581>K<EFBFBD><4B><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD>Ձv<D581>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD>ڕW<DA95>ɏd<C98F>_<EFBFBD><5F><EFBFBD>u<EFBFBD><75><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82>B
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̃X<EFBFBD>N<EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>g<EFBFBD>n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł̓<EFBFBD><EFBFBD>[<5B>U<EFBFBD>̖ڐ<CC96><DA90>̗<EFBFBD><CC97><EFBFBD><D690><EFBFBD><EFBFBD>D<EFBFBD>悵<EFBFBD>ĐF<C490>X<EFBFBD>ȋ@<40>\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>f<EFBFBD>Ƃ<EFBFBD><C682>Ď<EFBFBD><C48E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꍇ<EFBFBD><EA8D87><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂ł<CC82><C582><EFBFBD><EFBFBD>APython <20>ł͂<C582><CD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>H<D78D><48><EFBFBD>lj<EFBFBD><C789><EFBFBD><EFBFBD><EFBFBD><EFBFBD>邱<EFBFBD>Ƃ͂<C682><CD82>܂肠<DC82><E882A0><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
|
||||
<EFBFBD><EFBFBD><EFBFBD>ꎩ<EFBFBD>̂̋@<40>\<5C>͍ŏ<CD8D><C58F><EFBFBD><EFBFBD>ɉ<EFBFBD><C989><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>K<EFBFBD>v<EFBFBD>ȋ@<40>\<5C>͊g<CD8A><67><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD><57><EFBFBD>[<5B><><EFBFBD>Ƃ<EFBFBD><C682>Ēlj<C492><C789><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD>̂<EFBFBD> Python <20>̃|<7C><><EFBFBD>V<EFBFBD>[<5B>ł<EFBFBD><C582>B
|
||||
|
||||
8
Lib/test/cjkencodings/shift_jisx0213-utf8.txt
Normal file
8
Lib/test/cjkencodings/shift_jisx0213-utf8.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Python の開発は、1990 年ごろから開始されています。
|
||||
開発者の Guido van Rossum は教育用のプログラミング言語「ABC」の開発に参加していましたが、ABC は実用上の目的にはあまり適していませんでした。
|
||||
このため、Guido はより実用的なプログラミング言語の開発を開始し、英国 BBS 放送のコメディ番組「モンティ パイソン」のファンである Guido はこの言語を「Python」と名づけました。
|
||||
このような背景から生まれた Python の言語設計は、「シンプル」で「習得が容易」という目標に重点が置かれています。
|
||||
多くのスクリプト系言語ではユーザの目先の利便性を優先して色々な機能を言語要素として取り入れる場合が多いのですが、Python ではそういった小細工が追加されることはあまりありません。
|
||||
言語自体の機能は最小限に押さえ、必要な機能は拡張モジュールとして追加する、というのが Python のポリシーです。
|
||||
|
||||
ノか゚ ト゚ トキ喝塀 𡚴𪎌 麀齁𩛰
|
||||
8
Lib/test/cjkencodings/shift_jisx0213.txt
Normal file
8
Lib/test/cjkencodings/shift_jisx0213.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
Python <20>̊J<CC8A><4A><EFBFBD>́A1990 <20>N<EFBFBD><4E><EFBFBD>납<EFBFBD><EB82A9><EFBFBD>J<EFBFBD>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82>B
|
||||
<EFBFBD>J<EFBFBD><EFBFBD><EFBFBD>҂<EFBFBD> Guido van Rossum <20>͋<EFBFBD><CD8B><EFBFBD><EFBFBD>p<EFBFBD>̃v<CC83><76><EFBFBD>O<EFBFBD><4F><EFBFBD>~<7E><><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>uABC<42>v<EFBFBD>̊J<CC8A><4A><EFBFBD>ɎQ<C98E><51><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>AABC <20>͎<EFBFBD><CD8E>p<EFBFBD><70><EFBFBD>̖ړI<DA93>ɂ͂<C982><CD82>܂<EFBFBD><DC82>K<EFBFBD><4B><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82><EFBFBD><EFBFBD>ł<EFBFBD><C582><EFBFBD><EFBFBD>B
|
||||
<EFBFBD><EFBFBD><EFBFBD>̂<EFBFBD><EFBFBD>߁AGuido <20>͂<EFBFBD><CD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>I<EFBFBD>ȃv<C883><76><EFBFBD>O<EFBFBD><4F><EFBFBD>~<7E><><EFBFBD>O<EFBFBD><4F><EFBFBD><EFBFBD><EFBFBD>̊J<CC8A><4A><EFBFBD><EFBFBD><EFBFBD>J<EFBFBD>n<EFBFBD><6E><EFBFBD>A<EFBFBD>p<EFBFBD><70> BBS <20><><EFBFBD><EFBFBD><EFBFBD>̃R<CC83><52><EFBFBD>f<EFBFBD>B<EFBFBD>ԑg<D491>u<EFBFBD><75><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD>B <20>p<EFBFBD>C<EFBFBD>\<5C><><EFBFBD>v<EFBFBD>̃t<CC83>@<40><><EFBFBD>ł<EFBFBD><C582><EFBFBD> Guido <20>͂<EFBFBD><CD82>̌<EFBFBD><CC8C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>uPython<6F>v<EFBFBD>Ɩ<EFBFBD><C696>Â<EFBFBD><C382>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
|
||||
<EFBFBD><EFBFBD><EFBFBD>̂悤<EFBFBD>Ȕw<EFBFBD>i<EFBFBD><EFBFBD><EFBFBD>琶<EFBFBD>܂ꂽ Python <20>̌<EFBFBD><CC8C><EFBFBD><EFBFBD>v<DD8C>́A<CD81>u<EFBFBD>V<EFBFBD><56><EFBFBD>v<EFBFBD><76><EFBFBD>v<EFBFBD>Łu<C581>K<EFBFBD><4B><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD>Ձv<D581>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD>ڕW<DA95>ɏd<C98F>_<EFBFBD><5F><EFBFBD>u<EFBFBD><75><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD><DC82>B
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̃X<EFBFBD>N<EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>g<EFBFBD>n<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ł̓<EFBFBD><EFBFBD>[<5B>U<EFBFBD>̖ڐ<CC96><DA90>̗<EFBFBD><CC97><EFBFBD><D690><EFBFBD><EFBFBD>D<EFBFBD>悵<EFBFBD>ĐF<C490>X<EFBFBD>ȋ@<40>\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>f<EFBFBD>Ƃ<EFBFBD><C682>Ď<EFBFBD><C48E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꍇ<EFBFBD><EA8D87><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂ł<CC82><C582><EFBFBD><EFBFBD>APython <20>ł͂<C582><CD82><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>H<D78D><48><EFBFBD>lj<EFBFBD><C789><EFBFBD><EFBFBD><EFBFBD><EFBFBD>邱<EFBFBD>Ƃ͂<C682><CD82>܂肠<DC82><E882A0><EFBFBD>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
|
||||
<EFBFBD><EFBFBD><EFBFBD>ꎩ<EFBFBD>̂̋@<40>\<5C>͍ŏ<CD8D><C58F><EFBFBD><EFBFBD>ɉ<EFBFBD><C989><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>K<EFBFBD>v<EFBFBD>ȋ@<40>\<5C>͊g<CD8A><67><EFBFBD><EFBFBD><EFBFBD>W<EFBFBD><57><EFBFBD>[<5B><><EFBFBD>Ƃ<EFBFBD><C682>Ēlj<C492><C789><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD>̂<EFBFBD> Python <20>̃|<7C><><EFBFBD>V<EFBFBD>[<5B>ł<EFBFBD><C582>B
|
||||
|
||||
<EFBFBD>m<EFBFBD><EFBFBD> <20><> <20>g<EFBFBD>L<EFBFBD>K<EFBFBD>y <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
2365
Lib/test/cmath_testcases.txt
Normal file
2365
Lib/test/cmath_testcases.txt
Normal file
File diff suppressed because it is too large
Load Diff
16
Lib/test/crashers/README
Normal file
16
Lib/test/crashers/README
Normal file
@@ -0,0 +1,16 @@
|
||||
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
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
19
Lib/test/crashers/bogus_code_obj.py
Normal file
19
Lib/test/crashers/bogus_code_obj.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
Broken bytecode objects can easily crash the interpreter.
|
||||
|
||||
This is not going to be fixed. It is generally agreed that there is no
|
||||
point in writing a bytecode verifier and putting it in CPython just for
|
||||
this. Moreover, a verifier is bound to accept only a subset of all safe
|
||||
bytecodes, so it could lead to unnecessary breakage.
|
||||
|
||||
For security purposes, "restricted" interpreters are not going to let
|
||||
the user build or load random bytecodes anyway. Otherwise, this is a
|
||||
"won't fix" case.
|
||||
|
||||
"""
|
||||
|
||||
import types
|
||||
|
||||
co = types.CodeType(0, 0, 0, 0, '\x04\x71\x00\x00', (),
|
||||
(), (), '', '', 1, '')
|
||||
exec co
|
||||
29
Lib/test/crashers/borrowed_ref_1.py
Normal file
29
Lib/test/crashers/borrowed_ref_1.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""
|
||||
_PyType_Lookup() returns a borrowed reference.
|
||||
This attacks the call in dictobject.c.
|
||||
"""
|
||||
|
||||
class A(object):
|
||||
pass
|
||||
|
||||
class B(object):
|
||||
def __del__(self):
|
||||
print 'hi'
|
||||
del D.__missing__
|
||||
|
||||
class D(dict):
|
||||
class __missing__:
|
||||
def __init__(self, *args):
|
||||
pass
|
||||
|
||||
|
||||
d = D()
|
||||
a = A()
|
||||
a.cycle = a
|
||||
a.other = B()
|
||||
del a
|
||||
|
||||
prev = None
|
||||
while 1:
|
||||
d[5]
|
||||
prev = (prev,)
|
||||
38
Lib/test/crashers/borrowed_ref_2.py
Normal file
38
Lib/test/crashers/borrowed_ref_2.py
Normal file
@@ -0,0 +1,38 @@
|
||||
"""
|
||||
_PyType_Lookup() returns a borrowed reference.
|
||||
This attacks PyObject_GenericSetAttr().
|
||||
|
||||
NB. on my machine this crashes in 2.5 debug but not release.
|
||||
"""
|
||||
|
||||
class A(object):
|
||||
pass
|
||||
|
||||
class B(object):
|
||||
def __del__(self):
|
||||
print "hi"
|
||||
del C.d
|
||||
|
||||
class D(object):
|
||||
def __set__(self, obj, value):
|
||||
self.hello = 42
|
||||
|
||||
class C(object):
|
||||
d = D()
|
||||
|
||||
def g():
|
||||
pass
|
||||
|
||||
|
||||
c = C()
|
||||
a = A()
|
||||
a.cycle = a
|
||||
a.other = B()
|
||||
|
||||
lst = [None] * 1000000
|
||||
i = 0
|
||||
del a
|
||||
while 1:
|
||||
c.d = 42 # segfaults in PyMethod_New(im_func=D.__set__, im_self=d)
|
||||
lst[i] = c.g # consume the free list of instancemethod objects
|
||||
i += 1
|
||||
30
Lib/test/crashers/buffer_mutate.py
Normal file
30
Lib/test/crashers/buffer_mutate.py
Normal file
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# The various methods of bufferobject.c (here buffer_subscript()) call
|
||||
# get_buf() before calling potentially more Python code (here via
|
||||
# PySlice_GetIndicesEx()). But get_buf() already returned a void*
|
||||
# pointer. This void* pointer can become invalid if the object
|
||||
# underlying the buffer is mutated (here a bytearray object).
|
||||
#
|
||||
# As usual, please keep in mind that the three "here" in the sentence
|
||||
# above are only examples. Each can be changed easily and lead to
|
||||
# another crasher.
|
||||
#
|
||||
# This crashes for me on Linux 32-bits with CPython 2.6 and 2.7
|
||||
# with a segmentation fault.
|
||||
#
|
||||
|
||||
|
||||
class PseudoIndex(object):
|
||||
def __index__(self):
|
||||
for c in "foobar"*n:
|
||||
a.append(c)
|
||||
return n * 4
|
||||
|
||||
|
||||
for n in range(1, 100000, 100):
|
||||
a = bytearray("test"*n)
|
||||
buf = buffer(a)
|
||||
|
||||
s = buf[:PseudoIndex():1]
|
||||
#print repr(s)
|
||||
#assert s == "test"*n
|
||||
5
Lib/test/crashers/compiler_recursion.py
Normal file
5
Lib/test/crashers/compiler_recursion.py
Normal file
@@ -0,0 +1,5 @@
|
||||
"""
|
||||
The compiler (>= 2.5) recurses happily.
|
||||
"""
|
||||
|
||||
compile('()'*9**5, '?', 'exec')
|
||||
44
Lib/test/crashers/decref_before_assignment.py
Normal file
44
Lib/test/crashers/decref_before_assignment.py
Normal file
@@ -0,0 +1,44 @@
|
||||
"""
|
||||
General example for an attack against code like this:
|
||||
|
||||
Py_DECREF(obj->attr); obj->attr = ...;
|
||||
|
||||
here in Module/_json.c:scanner_init().
|
||||
|
||||
Explanation: if the first Py_DECREF() calls either a __del__ or a
|
||||
weakref callback, it will run while the 'obj' appears to have in
|
||||
'obj->attr' still the old reference to the object, but not holding
|
||||
the reference count any more.
|
||||
|
||||
Status: progress has been made replacing these cases, but there is an
|
||||
infinite number of such cases.
|
||||
"""
|
||||
|
||||
import _json, weakref
|
||||
|
||||
class Ctx1(object):
|
||||
encoding = "utf8"
|
||||
strict = None
|
||||
object_hook = None
|
||||
object_pairs_hook = None
|
||||
parse_float = None
|
||||
parse_int = None
|
||||
parse_constant = None
|
||||
|
||||
class Foo(unicode):
|
||||
pass
|
||||
|
||||
def delete_me(*args):
|
||||
print scanner.encoding.__dict__
|
||||
|
||||
class Ctx2(Ctx1):
|
||||
@property
|
||||
def encoding(self):
|
||||
global wref
|
||||
f = Foo("utf8")
|
||||
f.abc = globals()
|
||||
wref = weakref.ref(f, delete_me)
|
||||
return f
|
||||
|
||||
scanner = _json.make_scanner(Ctx1())
|
||||
scanner.__init__(Ctx2())
|
||||
36
Lib/test/crashers/gc_has_finalizer.py
Normal file
36
Lib/test/crashers/gc_has_finalizer.py
Normal file
@@ -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()
|
||||
32
Lib/test/crashers/gc_inspection.py
Normal file
32
Lib/test/crashers/gc_inspection.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""
|
||||
gc.get_referrers() can be used to see objects before they are fully built.
|
||||
|
||||
Note that this is only an example. There are many ways to crash Python
|
||||
by using gc.get_referrers(), as well as many extension modules (even
|
||||
when they are using perfectly documented patterns to build objects).
|
||||
|
||||
Identifying and removing all places that expose to the GC a
|
||||
partially-built object is a long-term project. A patch was proposed on
|
||||
SF specifically for this example but I consider fixing just this single
|
||||
example a bit pointless (#1517042).
|
||||
|
||||
A fix would include a whole-scale code review, possibly with an API
|
||||
change to decouple object creation and GC registration, and according
|
||||
fixes to the documentation for extension module writers. It's unlikely
|
||||
to happen, though. So this is currently classified as
|
||||
"gc.get_referrers() is dangerous, use only for debugging".
|
||||
"""
|
||||
|
||||
import gc
|
||||
|
||||
|
||||
def g():
|
||||
marker = object()
|
||||
yield marker
|
||||
# now the marker is in the tuple being constructed
|
||||
[tup] = [x for x in gc.get_referrers(marker) if type(x) is tuple]
|
||||
print tup
|
||||
print tup[1]
|
||||
|
||||
|
||||
tuple(g())
|
||||
16
Lib/test/crashers/infinite_loop_re.py
Normal file
16
Lib/test/crashers/infinite_loop_re.py
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
# This was taken from http://python.org/sf/1541697
|
||||
# It's not technically a crasher. It may not even truly be infinite,
|
||||
# however, I haven't waited a long time to see the result. It takes
|
||||
# 100% of CPU while running this and should be fixed.
|
||||
|
||||
import re
|
||||
starttag = re.compile(r'<[a-zA-Z][-_.:a-zA-Z0-9]*\s*('
|
||||
r'\s*([a-zA-Z_][-:.a-zA-Z_0-9]*)(\s*=\s*'
|
||||
r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~@]'
|
||||
r'[][\-a-zA-Z0-9./,:;+*%?!&$\(\)_#=~\'"@]*(?=[\s>/<])))?'
|
||||
r')*\s*/?\s*(?=[<>])')
|
||||
|
||||
if __name__ == '__main__':
|
||||
foo = '<table cellspacing="0" cellpadding="0" style="border-collapse'
|
||||
starttag.match(foo)
|
||||
35
Lib/test/crashers/loosing_mro_ref.py
Normal file
35
Lib/test/crashers/loosing_mro_ref.py
Normal file
@@ -0,0 +1,35 @@
|
||||
"""
|
||||
There is a way to put keys of any type in a type's dictionary.
|
||||
I think this allows various kinds of crashes, but so far I have only
|
||||
found a convoluted attack of _PyType_Lookup(), which uses the mro of the
|
||||
type without holding a strong reference to it. Probably works with
|
||||
super.__getattribute__() too, which uses the same kind of code.
|
||||
"""
|
||||
|
||||
class MyKey(object):
|
||||
def __hash__(self):
|
||||
return hash('mykey')
|
||||
|
||||
def __cmp__(self, other):
|
||||
# the following line decrefs the previous X.__mro__
|
||||
X.__bases__ = (Base2,)
|
||||
# trash all tuples of length 3, to make sure that the items of
|
||||
# the previous X.__mro__ are really garbage
|
||||
z = []
|
||||
for i in range(1000):
|
||||
z.append((i, None, None))
|
||||
return -1
|
||||
|
||||
|
||||
class Base(object):
|
||||
mykey = 'from Base'
|
||||
|
||||
class Base2(object):
|
||||
mykey = 'from Base2'
|
||||
|
||||
# you can't add a non-string key to X.__dict__, but it can be
|
||||
# there from the beginning :-)
|
||||
X = type('X', (Base,), {MyKey(): 5})
|
||||
|
||||
print X.mykey
|
||||
# I get a segfault, or a slightly wrong assertion error in a debug build.
|
||||
31
Lib/test/crashers/mutation_inside_cyclegc.py
Normal file
31
Lib/test/crashers/mutation_inside_cyclegc.py
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
# The cycle GC collector can be executed when any GC-tracked object is
|
||||
# allocated, e.g. during a call to PyList_New(), PyDict_New(), ...
|
||||
# Moreover, it can invoke arbitrary Python code via a weakref callback.
|
||||
# This means that there are many places in the source where an arbitrary
|
||||
# mutation could unexpectedly occur.
|
||||
|
||||
# The example below shows list_slice() not expecting the call to
|
||||
# PyList_New to mutate the input list. (Of course there are many
|
||||
# more examples like this one.)
|
||||
|
||||
|
||||
import weakref
|
||||
|
||||
class A(object):
|
||||
pass
|
||||
|
||||
def callback(x):
|
||||
del lst[:]
|
||||
|
||||
|
||||
keepalive = []
|
||||
|
||||
for i in range(100):
|
||||
lst = [str(i)]
|
||||
a = A()
|
||||
a.cycle = a
|
||||
keepalive.append(weakref.ref(a, callback))
|
||||
del a
|
||||
while lst:
|
||||
keepalive.append(lst[:])
|
||||
47
Lib/test/crashers/nasty_eq_vs_dict.py
Normal file
47
Lib/test/crashers/nasty_eq_vs_dict.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# from http://mail.python.org/pipermail/python-dev/2001-June/015239.html
|
||||
|
||||
# if you keep changing a dictionary while looking up a key, you can
|
||||
# provoke an infinite recursion in C
|
||||
|
||||
# At the time neither Tim nor Michael could be bothered to think of a
|
||||
# way to fix it.
|
||||
|
||||
class Yuck:
|
||||
def __init__(self):
|
||||
self.i = 0
|
||||
|
||||
def make_dangerous(self):
|
||||
self.i = 1
|
||||
|
||||
def __hash__(self):
|
||||
# direct to slot 4 in table of size 8; slot 12 when size 16
|
||||
return 4 + 8
|
||||
|
||||
def __eq__(self, other):
|
||||
if self.i == 0:
|
||||
# leave dict alone
|
||||
pass
|
||||
elif self.i == 1:
|
||||
# fiddle to 16 slots
|
||||
self.__fill_dict(6)
|
||||
self.i = 2
|
||||
else:
|
||||
# fiddle to 8 slots
|
||||
self.__fill_dict(4)
|
||||
self.i = 1
|
||||
|
||||
return 1
|
||||
|
||||
def __fill_dict(self, n):
|
||||
self.i = 0
|
||||
dict.clear()
|
||||
for i in range(n):
|
||||
dict[i] = i
|
||||
dict[self] = "OK!"
|
||||
|
||||
y = Yuck()
|
||||
dict = {y: "OK!"}
|
||||
|
||||
z = Yuck()
|
||||
y.make_dangerous()
|
||||
print dict[z]
|
||||
16
Lib/test/crashers/recursion_limit_too_high.py
Normal file
16
Lib/test/crashers/recursion_limit_too_high.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# The following example may crash or not depending on the platform.
|
||||
# E.g. on 32-bit Intel Linux in a "standard" configuration it seems to
|
||||
# crash on Python 2.5 (but not 2.4 nor 2.3). On Windows the import
|
||||
# eventually fails to find the module, possibly because we run out of
|
||||
# file handles.
|
||||
|
||||
# The point of this example is to show that sys.setrecursionlimit() is a
|
||||
# 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.
|
||||
|
||||
import sys
|
||||
if 'recursion_limit_too_high' in sys.modules:
|
||||
del sys.modules['recursion_limit_too_high']
|
||||
import recursion_limit_too_high
|
||||
15
Lib/test/crashers/recursive_call.py
Executable file
15
Lib/test/crashers/recursive_call.py
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# No bug report AFAIK, mail on python-dev on 2006-01-10
|
||||
|
||||
# This is a "won't fix" case. It is known that setting a high enough
|
||||
# recursion limit crashes by overflowing the stack. Unless this is
|
||||
# redesigned somehow, it won't go away.
|
||||
|
||||
import sys
|
||||
|
||||
sys.setrecursionlimit(1 << 30)
|
||||
f = lambda f:f(f)
|
||||
|
||||
if __name__ == '__main__':
|
||||
f(f)
|
||||
29
Lib/test/crashers/warnings_del_crasher.py
Normal file
29
Lib/test/crashers/warnings_del_crasher.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""
|
||||
Expose a race in the _warnings module, which is the C backend for the
|
||||
warnings module. The "_warnings" module tries to access attributes of the
|
||||
"warnings" module (because of the API it has to support), but doing so
|
||||
during interpreter shutdown is problematic. Specifically, the call to
|
||||
PyImport_GetModuleDict() in Python/_warnings.c:get_warnings_attr will
|
||||
abort() if the modules dict has already been cleaned up.
|
||||
|
||||
This crasher is timing-dependent, and more threads (NUM_THREADS) may be
|
||||
necessary to expose it reliably on different systems.
|
||||
"""
|
||||
|
||||
import threading
|
||||
import warnings
|
||||
|
||||
NUM_THREADS = 10
|
||||
|
||||
class WarnOnDel(object):
|
||||
def __del__(self):
|
||||
warnings.warn("oh no something went wrong", UserWarning)
|
||||
|
||||
def do_work():
|
||||
while True:
|
||||
w = WarnOnDel()
|
||||
|
||||
for i in range(NUM_THREADS):
|
||||
t = threading.Thread(target=do_work)
|
||||
t.setDaemon(1)
|
||||
t.start()
|
||||
46
Lib/test/curses_tests.py
Executable file
46
Lib/test/curses_tests.py
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $
|
||||
#
|
||||
# Interactive test suite for the curses module.
|
||||
# This script displays various things and the user should verify whether
|
||||
# they display correctly.
|
||||
#
|
||||
|
||||
import curses
|
||||
from curses import textpad
|
||||
|
||||
def test_textpad(stdscr, insert_mode=False):
|
||||
ncols, nlines = 8, 3
|
||||
uly, ulx = 3, 2
|
||||
if insert_mode:
|
||||
mode = 'insert mode'
|
||||
else:
|
||||
mode = 'overwrite mode'
|
||||
|
||||
stdscr.addstr(uly-3, ulx, "Use Ctrl-G to end editing (%s)." % mode)
|
||||
stdscr.addstr(uly-2, ulx, "Be sure to try typing in the lower-right corner.")
|
||||
win = curses.newwin(nlines, ncols, uly, ulx)
|
||||
textpad.rectangle(stdscr, uly-1, ulx-1, uly + nlines, ulx + ncols)
|
||||
stdscr.refresh()
|
||||
|
||||
box = textpad.Textbox(win, insert_mode)
|
||||
contents = box.edit()
|
||||
stdscr.addstr(uly+ncols+2, 0, "Text entered in the box\n")
|
||||
stdscr.addstr(repr(contents))
|
||||
stdscr.addstr('\n')
|
||||
stdscr.addstr('Press any key')
|
||||
stdscr.getch()
|
||||
|
||||
for i in range(3):
|
||||
stdscr.move(uly+ncols+2 + i, 0)
|
||||
stdscr.clrtoeol()
|
||||
|
||||
def main(stdscr):
|
||||
stdscr.clear()
|
||||
test_textpad(stdscr, False)
|
||||
test_textpad(stdscr, True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
curses.wrapper(main)
|
||||
2
Lib/test/data/README
Normal file
2
Lib/test/data/README
Normal file
@@ -0,0 +1,2 @@
|
||||
This empty directory serves as destination for temporary files
|
||||
created by some tests, in particular, the test_codecmaps_* tests.
|
||||
161
Lib/test/decimaltestdata/abs.decTest
Normal file
161
Lib/test/decimaltestdata/abs.decTest
Normal file
@@ -0,0 +1,161 @@
|
||||
------------------------------------------------------------------------
|
||||
-- abs.decTest -- decimal absolute value --
|
||||
-- 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 primarily tests the existence of the operator.
|
||||
-- Additon, subtraction, rounding, and more overflows are tested
|
||||
-- elsewhere.
|
||||
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 384
|
||||
minexponent: -383
|
||||
extended: 1
|
||||
|
||||
absx001 abs '1' -> '1'
|
||||
absx002 abs '-1' -> '1'
|
||||
absx003 abs '1.00' -> '1.00'
|
||||
absx004 abs '-1.00' -> '1.00'
|
||||
absx005 abs '0' -> '0'
|
||||
absx006 abs '0.00' -> '0.00'
|
||||
absx007 abs '00.0' -> '0.0'
|
||||
absx008 abs '00.00' -> '0.00'
|
||||
absx009 abs '00' -> '0'
|
||||
|
||||
absx010 abs '-2' -> '2'
|
||||
absx011 abs '2' -> '2'
|
||||
absx012 abs '-2.00' -> '2.00'
|
||||
absx013 abs '2.00' -> '2.00'
|
||||
absx014 abs '-0' -> '0'
|
||||
absx015 abs '-0.00' -> '0.00'
|
||||
absx016 abs '-00.0' -> '0.0'
|
||||
absx017 abs '-00.00' -> '0.00'
|
||||
absx018 abs '-00' -> '0'
|
||||
|
||||
absx020 abs '-2000000' -> '2000000'
|
||||
absx021 abs '2000000' -> '2000000'
|
||||
precision: 7
|
||||
absx022 abs '-2000000' -> '2000000'
|
||||
absx023 abs '2000000' -> '2000000'
|
||||
precision: 6
|
||||
absx024 abs '-2000000' -> '2.00000E+6' Rounded
|
||||
absx025 abs '2000000' -> '2.00000E+6' Rounded
|
||||
precision: 3
|
||||
absx026 abs '-2000000' -> '2.00E+6' Rounded
|
||||
absx027 abs '2000000' -> '2.00E+6' Rounded
|
||||
|
||||
absx030 abs '+0.1' -> '0.1'
|
||||
absx031 abs '-0.1' -> '0.1'
|
||||
absx032 abs '+0.01' -> '0.01'
|
||||
absx033 abs '-0.01' -> '0.01'
|
||||
absx034 abs '+0.001' -> '0.001'
|
||||
absx035 abs '-0.001' -> '0.001'
|
||||
absx036 abs '+0.000001' -> '0.000001'
|
||||
absx037 abs '-0.000001' -> '0.000001'
|
||||
absx038 abs '+0.000000000001' -> '1E-12'
|
||||
absx039 abs '-0.000000000001' -> '1E-12'
|
||||
|
||||
-- examples from decArith
|
||||
precision: 9
|
||||
absx040 abs '2.1' -> '2.1'
|
||||
absx041 abs '-100' -> '100'
|
||||
absx042 abs '101.5' -> '101.5'
|
||||
absx043 abs '-101.5' -> '101.5'
|
||||
|
||||
-- more fixed, potential LHS swaps/overlays if done by subtract 0
|
||||
precision: 9
|
||||
absx060 abs '-56267E-10' -> '0.0000056267'
|
||||
absx061 abs '-56267E-5' -> '0.56267'
|
||||
absx062 abs '-56267E-2' -> '562.67'
|
||||
absx063 abs '-56267E-1' -> '5626.7'
|
||||
absx065 abs '-56267E-0' -> '56267'
|
||||
|
||||
-- overflow tests
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
precision: 3
|
||||
absx120 abs 9.999E+999999999 -> Infinity Inexact Overflow Rounded
|
||||
|
||||
-- subnormals and underflow
|
||||
precision: 3
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
absx210 abs 1.00E-999 -> 1.00E-999
|
||||
absx211 abs 0.1E-999 -> 1E-1000 Subnormal
|
||||
absx212 abs 0.10E-999 -> 1.0E-1000 Subnormal
|
||||
absx213 abs 0.100E-999 -> 1.0E-1000 Subnormal Rounded
|
||||
absx214 abs 0.01E-999 -> 1E-1001 Subnormal
|
||||
-- next is rounded to Emin
|
||||
absx215 abs 0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow
|
||||
absx216 abs 0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
|
||||
absx217 abs 0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow
|
||||
absx218 abs 0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
|
||||
absx219 abs 0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
|
||||
absx220 abs 0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
|
||||
|
||||
absx230 abs -1.00E-999 -> 1.00E-999
|
||||
absx231 abs -0.1E-999 -> 1E-1000 Subnormal
|
||||
absx232 abs -0.10E-999 -> 1.0E-1000 Subnormal
|
||||
absx233 abs -0.100E-999 -> 1.0E-1000 Subnormal Rounded
|
||||
absx234 abs -0.01E-999 -> 1E-1001 Subnormal
|
||||
-- next is rounded to Emin
|
||||
absx235 abs -0.999E-999 -> 1.00E-999 Inexact Rounded Subnormal Underflow
|
||||
absx236 abs -0.099E-999 -> 1.0E-1000 Inexact Rounded Subnormal Underflow
|
||||
absx237 abs -0.009E-999 -> 1E-1001 Inexact Rounded Subnormal Underflow
|
||||
absx238 abs -0.001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
|
||||
absx239 abs -0.0009E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
|
||||
absx240 abs -0.0001E-999 -> 0E-1001 Inexact Rounded Subnormal Underflow Clamped
|
||||
|
||||
-- long operand tests
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
absx301 abs 12345678000 -> 1.23456780E+10 Rounded
|
||||
absx302 abs 1234567800 -> 1.23456780E+9 Rounded
|
||||
absx303 abs 1234567890 -> 1.23456789E+9 Rounded
|
||||
absx304 abs 1234567891 -> 1.23456789E+9 Inexact Rounded
|
||||
absx305 abs 12345678901 -> 1.23456789E+10 Inexact Rounded
|
||||
absx306 abs 1234567896 -> 1.23456790E+9 Inexact Rounded
|
||||
|
||||
precision: 15
|
||||
absx321 abs 12345678000 -> 12345678000
|
||||
absx322 abs 1234567800 -> 1234567800
|
||||
absx323 abs 1234567890 -> 1234567890
|
||||
absx324 abs 1234567891 -> 1234567891
|
||||
absx325 abs 12345678901 -> 12345678901
|
||||
absx326 abs 1234567896 -> 1234567896
|
||||
|
||||
|
||||
-- Specials
|
||||
precision: 9
|
||||
|
||||
-- specials
|
||||
absx520 abs 'Inf' -> 'Infinity'
|
||||
absx521 abs '-Inf' -> 'Infinity'
|
||||
absx522 abs NaN -> NaN
|
||||
absx523 abs sNaN -> NaN Invalid_operation
|
||||
absx524 abs NaN22 -> NaN22
|
||||
absx525 abs sNaN33 -> NaN33 Invalid_operation
|
||||
absx526 abs -NaN22 -> -NaN22
|
||||
absx527 abs -sNaN33 -> -NaN33 Invalid_operation
|
||||
|
||||
-- Null tests
|
||||
absx900 abs # -> NaN Invalid_operation
|
||||
|
||||
2716
Lib/test/decimaltestdata/add.decTest
Normal file
2716
Lib/test/decimaltestdata/add.decTest
Normal file
File diff suppressed because it is too large
Load Diff
338
Lib/test/decimaltestdata/and.decTest
Normal file
338
Lib/test/decimaltestdata/and.decTest
Normal file
@@ -0,0 +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
|
||||
1411
Lib/test/decimaltestdata/base.decTest
Normal file
1411
Lib/test/decimaltestdata/base.decTest
Normal file
File diff suppressed because it is too large
Load Diff
211
Lib/test/decimaltestdata/clamp.decTest
Normal file
211
Lib/test/decimaltestdata/clamp.decTest
Normal file
@@ -0,0 +1,211 @@
|
||||
------------------------------------------------------------------------
|
||||
-- clamp.decTest -- clamped exponent tests (format-independent) --
|
||||
-- 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 --
|
||||
------------------------------------------------------------------------
|
||||
version: 2.59
|
||||
|
||||
-- This set of tests uses the same limits as the 8-byte concrete
|
||||
-- representation, but applies clamping without using format-specific
|
||||
-- conversions.
|
||||
|
||||
extended: 1
|
||||
precision: 16
|
||||
rounding: half_even
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
clamp: 1
|
||||
|
||||
-- General testcases
|
||||
|
||||
-- Normality
|
||||
clam010 apply 1234567890123456 -> 1234567890123456
|
||||
clam011 apply 1234567890123456.0 -> 1234567890123456 Rounded
|
||||
clam012 apply 1234567890123456.1 -> 1234567890123456 Rounded Inexact
|
||||
clam013 apply -1234567890123456 -> -1234567890123456
|
||||
clam014 apply -1234567890123456.0 -> -1234567890123456 Rounded
|
||||
clam015 apply -1234567890123456.1 -> -1234567890123456 Rounded Inexact
|
||||
|
||||
|
||||
-- Nmax and similar
|
||||
clam022 apply 9.999999999999999E+384 -> 9.999999999999999E+384
|
||||
clam024 apply 1.234567890123456E+384 -> 1.234567890123456E+384
|
||||
-- fold-downs (more below)
|
||||
clam030 apply 1.23E+384 -> 1.230000000000000E+384 Clamped
|
||||
clam032 apply 1E+384 -> 1.000000000000000E+384 Clamped
|
||||
|
||||
clam051 apply 12345 -> 12345
|
||||
clam053 apply 1234 -> 1234
|
||||
clam055 apply 123 -> 123
|
||||
clam057 apply 12 -> 12
|
||||
clam059 apply 1 -> 1
|
||||
clam061 apply 1.23 -> 1.23
|
||||
clam063 apply 123.45 -> 123.45
|
||||
|
||||
-- Nmin and below
|
||||
clam071 apply 1E-383 -> 1E-383
|
||||
clam073 apply 1.000000000000000E-383 -> 1.000000000000000E-383
|
||||
clam075 apply 1.000000000000001E-383 -> 1.000000000000001E-383
|
||||
|
||||
clam077 apply 0.100000000000000E-383 -> 1.00000000000000E-384 Subnormal
|
||||
clam079 apply 0.000000000000010E-383 -> 1.0E-397 Subnormal
|
||||
clam081 apply 0.00000000000001E-383 -> 1E-397 Subnormal
|
||||
clam083 apply 0.000000000000001E-383 -> 1E-398 Subnormal
|
||||
|
||||
-- underflows
|
||||
clam090 apply 1e-398 -> #0000000000000001 Subnormal
|
||||
clam091 apply 1.9e-398 -> #0000000000000002 Subnormal Underflow Inexact Rounded
|
||||
clam092 apply 1.1e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded
|
||||
clam093 apply 1.00000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded
|
||||
clam094 apply 1.00000000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded
|
||||
clam095 apply 1.000000000000001e-398 -> #0000000000000001 Subnormal Underflow Inexact Rounded
|
||||
clam096 apply 0.1e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped
|
||||
clam097 apply 0.00000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped
|
||||
clam098 apply 0.00000000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped
|
||||
clam099 apply 0.000000000000001e-398 -> #0000000000000000 Subnormal Underflow Inexact Rounded Clamped
|
||||
|
||||
-- Same again, negatives
|
||||
-- Nmax and similar
|
||||
clam122 apply -9.999999999999999E+384 -> -9.999999999999999E+384
|
||||
clam124 apply -1.234567890123456E+384 -> -1.234567890123456E+384
|
||||
-- fold-downs (more below)
|
||||
clam130 apply -1.23E+384 -> -1.230000000000000E+384 Clamped
|
||||
clam132 apply -1E+384 -> -1.000000000000000E+384 Clamped
|
||||
|
||||
clam151 apply -12345 -> -12345
|
||||
clam153 apply -1234 -> -1234
|
||||
clam155 apply -123 -> -123
|
||||
clam157 apply -12 -> -12
|
||||
clam159 apply -1 -> -1
|
||||
clam161 apply -1.23 -> -1.23
|
||||
clam163 apply -123.45 -> -123.45
|
||||
|
||||
-- Nmin and below
|
||||
clam171 apply -1E-383 -> -1E-383
|
||||
clam173 apply -1.000000000000000E-383 -> -1.000000000000000E-383
|
||||
clam175 apply -1.000000000000001E-383 -> -1.000000000000001E-383
|
||||
|
||||
clam177 apply -0.100000000000000E-383 -> -1.00000000000000E-384 Subnormal
|
||||
clam179 apply -0.000000000000010E-383 -> -1.0E-397 Subnormal
|
||||
clam181 apply -0.00000000000001E-383 -> -1E-397 Subnormal
|
||||
clam183 apply -0.000000000000001E-383 -> -1E-398 Subnormal
|
||||
|
||||
-- underflows
|
||||
clam189 apply -1e-398 -> #8000000000000001 Subnormal
|
||||
clam190 apply -1.0e-398 -> #8000000000000001 Subnormal Rounded
|
||||
clam191 apply -1.9e-398 -> #8000000000000002 Subnormal Underflow Inexact Rounded
|
||||
clam192 apply -1.1e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded
|
||||
clam193 apply -1.00000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded
|
||||
clam194 apply -1.00000000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded
|
||||
clam195 apply -1.000000000000001e-398 -> #8000000000000001 Subnormal Underflow Inexact Rounded
|
||||
clam196 apply -0.1e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped
|
||||
clam197 apply -0.00000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped
|
||||
clam198 apply -0.00000000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped
|
||||
clam199 apply -0.000000000000001e-398 -> #8000000000000000 Subnormal Underflow Inexact Rounded Clamped
|
||||
|
||||
-- zeros
|
||||
clam401 apply 0E-500 -> 0E-398 Clamped
|
||||
clam402 apply 0E-400 -> 0E-398 Clamped
|
||||
clam403 apply 0E-398 -> 0E-398
|
||||
clam404 apply 0.000000000000000E-383 -> 0E-398
|
||||
clam405 apply 0E-2 -> 0.00
|
||||
clam406 apply 0 -> 0
|
||||
clam407 apply 0E+3 -> 0E+3
|
||||
clam408 apply 0E+369 -> 0E+369
|
||||
-- clamped zeros...
|
||||
clam410 apply 0E+370 -> 0E+369 Clamped
|
||||
clam411 apply 0E+384 -> 0E+369 Clamped
|
||||
clam412 apply 0E+400 -> 0E+369 Clamped
|
||||
clam413 apply 0E+500 -> 0E+369 Clamped
|
||||
|
||||
-- negative zeros
|
||||
clam420 apply -0E-500 -> -0E-398 Clamped
|
||||
clam421 apply -0E-400 -> -0E-398 Clamped
|
||||
clam422 apply -0E-398 -> -0E-398
|
||||
clam423 apply -0.000000000000000E-383 -> -0E-398
|
||||
clam424 apply -0E-2 -> -0.00
|
||||
clam425 apply -0 -> -0
|
||||
clam426 apply -0E+3 -> -0E+3
|
||||
clam427 apply -0E+369 -> -0E+369
|
||||
-- clamped zeros...
|
||||
clam431 apply -0E+370 -> -0E+369 Clamped
|
||||
clam432 apply -0E+384 -> -0E+369 Clamped
|
||||
clam433 apply -0E+400 -> -0E+369 Clamped
|
||||
clam434 apply -0E+500 -> -0E+369 Clamped
|
||||
|
||||
-- fold-down full sequence
|
||||
clam601 apply 1E+384 -> 1.000000000000000E+384 Clamped
|
||||
clam603 apply 1E+383 -> 1.00000000000000E+383 Clamped
|
||||
clam605 apply 1E+382 -> 1.0000000000000E+382 Clamped
|
||||
clam607 apply 1E+381 -> 1.000000000000E+381 Clamped
|
||||
clam609 apply 1E+380 -> 1.00000000000E+380 Clamped
|
||||
clam611 apply 1E+379 -> 1.0000000000E+379 Clamped
|
||||
clam613 apply 1E+378 -> 1.000000000E+378 Clamped
|
||||
clam615 apply 1E+377 -> 1.00000000E+377 Clamped
|
||||
clam617 apply 1E+376 -> 1.0000000E+376 Clamped
|
||||
clam619 apply 1E+375 -> 1.000000E+375 Clamped
|
||||
clam621 apply 1E+374 -> 1.00000E+374 Clamped
|
||||
clam623 apply 1E+373 -> 1.0000E+373 Clamped
|
||||
clam625 apply 1E+372 -> 1.000E+372 Clamped
|
||||
clam627 apply 1E+371 -> 1.00E+371 Clamped
|
||||
clam629 apply 1E+370 -> 1.0E+370 Clamped
|
||||
clam631 apply 1E+369 -> 1E+369
|
||||
clam633 apply 1E+368 -> 1E+368
|
||||
-- same with 9s
|
||||
clam641 apply 9E+384 -> 9.000000000000000E+384 Clamped
|
||||
clam643 apply 9E+383 -> 9.00000000000000E+383 Clamped
|
||||
clam645 apply 9E+382 -> 9.0000000000000E+382 Clamped
|
||||
clam647 apply 9E+381 -> 9.000000000000E+381 Clamped
|
||||
clam649 apply 9E+380 -> 9.00000000000E+380 Clamped
|
||||
clam651 apply 9E+379 -> 9.0000000000E+379 Clamped
|
||||
clam653 apply 9E+378 -> 9.000000000E+378 Clamped
|
||||
clam655 apply 9E+377 -> 9.00000000E+377 Clamped
|
||||
clam657 apply 9E+376 -> 9.0000000E+376 Clamped
|
||||
clam659 apply 9E+375 -> 9.000000E+375 Clamped
|
||||
clam661 apply 9E+374 -> 9.00000E+374 Clamped
|
||||
clam663 apply 9E+373 -> 9.0000E+373 Clamped
|
||||
clam665 apply 9E+372 -> 9.000E+372 Clamped
|
||||
clam667 apply 9E+371 -> 9.00E+371 Clamped
|
||||
clam669 apply 9E+370 -> 9.0E+370 Clamped
|
||||
clam671 apply 9E+369 -> 9E+369
|
||||
clam673 apply 9E+368 -> 9E+368
|
||||
|
||||
-- subnormals clamped to 0-Etiny
|
||||
precision: 16
|
||||
maxExponent: 384
|
||||
minExponent: -383
|
||||
clam681 apply 7E-398 -> 7E-398 Subnormal
|
||||
clam682 apply 0E-398 -> 0E-398
|
||||
clam683 apply 7E-399 -> 1E-398 Subnormal Underflow Inexact Rounded
|
||||
clam684 apply 4E-399 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded
|
||||
clam685 apply 7E-400 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded
|
||||
clam686 apply 7E-401 -> 0E-398 Clamped Subnormal Underflow Inexact Rounded
|
||||
clam687 apply 0E-399 -> 0E-398 Clamped
|
||||
clam688 apply 0E-400 -> 0E-398 Clamped
|
||||
clam689 apply 0E-401 -> 0E-398 Clamped
|
||||
|
||||
-- example from documentation
|
||||
precision: 7
|
||||
rounding: half_even
|
||||
maxExponent: +96
|
||||
minExponent: -95
|
||||
|
||||
clamp: 0
|
||||
clam700 apply 1.23E+96 -> 1.23E+96
|
||||
|
||||
clamp: 1
|
||||
clam701 apply 1.23E+96 -> 1.230000E+96 Clamped
|
||||
131
Lib/test/decimaltestdata/class.decTest
Normal file
131
Lib/test/decimaltestdata/class.decTest
Normal file
@@ -0,0 +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
|
||||
|
||||
|
||||
|
||||
758
Lib/test/decimaltestdata/compare.decTest
Normal file
758
Lib/test/decimaltestdata/compare.decTest
Normal file
@@ -0,0 +1,758 @@
|
||||
------------------------------------------------------------------------
|
||||
-- compare.decTest -- decimal 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).
|
||||
|
||||
extended: 1
|
||||
|
||||
precision: 9
|
||||
rounding: half_up
|
||||
maxExponent: 999
|
||||
minexponent: -999
|
||||
|
||||
-- sanity checks
|
||||
comx001 compare -2 -2 -> 0
|
||||
comx002 compare -2 -1 -> -1
|
||||
comx003 compare -2 0 -> -1
|
||||
comx004 compare -2 1 -> -1
|
||||
comx005 compare -2 2 -> -1
|
||||
comx006 compare -1 -2 -> 1
|
||||
comx007 compare -1 -1 -> 0
|
||||
comx008 compare -1 0 -> -1
|
||||
comx009 compare -1 1 -> -1
|
||||
comx010 compare -1 2 -> -1
|
||||
comx011 compare 0 -2 -> 1
|
||||
comx012 compare 0 -1 -> 1
|
||||
comx013 compare 0 0 -> 0
|
||||
comx014 compare 0 1 -> -1
|
||||
comx015 compare 0 2 -> -1
|
||||
comx016 compare 1 -2 -> 1
|
||||
comx017 compare 1 -1 -> 1
|
||||
comx018 compare 1 0 -> 1
|
||||
comx019 compare 1 1 -> 0
|
||||
comx020 compare 1 2 -> -1
|
||||
comx021 compare 2 -2 -> 1
|
||||
comx022 compare 2 -1 -> 1
|
||||
comx023 compare 2 0 -> 1
|
||||
comx025 compare 2 1 -> 1
|
||||
comx026 compare 2 2 -> 0
|
||||
|
||||
comx031 compare -20 -20 -> 0
|
||||
comx032 compare -20 -10 -> -1
|
||||
comx033 compare -20 00 -> -1
|
||||
comx034 compare -20 10 -> -1
|
||||
comx035 compare -20 20 -> -1
|
||||
comx036 compare -10 -20 -> 1
|
||||
comx037 compare -10 -10 -> 0
|
||||
comx038 compare -10 00 -> -1
|
||||
comx039 compare -10 10 -> -1
|
||||
comx040 compare -10 20 -> -1
|
||||
comx041 compare 00 -20 -> 1
|
||||
comx042 compare 00 -10 -> 1
|
||||
comx043 compare 00 00 -> 0
|
||||
comx044 compare 00 10 -> -1
|
||||
comx045 compare 00 20 -> -1
|
||||
comx046 compare 10 -20 -> 1
|
||||
comx047 compare 10 -10 -> 1
|
||||
comx048 compare 10 00 -> 1
|
||||
comx049 compare 10 10 -> 0
|
||||
comx050 compare 10 20 -> -1
|
||||
comx051 compare 20 -20 -> 1
|
||||
comx052 compare 20 -10 -> 1
|
||||
comx053 compare 20 00 -> 1
|
||||
comx055 compare 20 10 -> 1
|
||||
comx056 compare 20 20 -> 0
|
||||
|
||||
comx061 compare -2.0 -2.0 -> 0
|
||||
comx062 compare -2.0 -1.0 -> -1
|
||||
comx063 compare -2.0 0.0 -> -1
|
||||
comx064 compare -2.0 1.0 -> -1
|
||||
comx065 compare -2.0 2.0 -> -1
|
||||
comx066 compare -1.0 -2.0 -> 1
|
||||
comx067 compare -1.0 -1.0 -> 0
|
||||
comx068 compare -1.0 0.0 -> -1
|
||||
comx069 compare -1.0 1.0 -> -1
|
||||
comx070 compare -1.0 2.0 -> -1
|
||||
comx071 compare 0.0 -2.0 -> 1
|
||||
comx072 compare 0.0 -1.0 -> 1
|
||||
comx073 compare 0.0 0.0 -> 0
|
||||
comx074 compare 0.0 1.0 -> -1
|
||||
comx075 compare 0.0 2.0 -> -1
|
||||
comx076 compare 1.0 -2.0 -> 1
|
||||
comx077 compare 1.0 -1.0 -> 1
|
||||
comx078 compare 1.0 0.0 -> 1
|
||||
comx079 compare 1.0 1.0 -> 0
|
||||
comx080 compare 1.0 2.0 -> -1
|
||||
comx081 compare 2.0 -2.0 -> 1
|
||||
comx082 compare 2.0 -1.0 -> 1
|
||||
comx083 compare 2.0 0.0 -> 1
|
||||
comx085 compare 2.0 1.0 -> 1
|
||||
comx086 compare 2.0 2.0 -> 0
|
||||
|
||||
-- now some cases which might overflow if subtract were used
|
||||
maxexponent: 999999999
|
||||
minexponent: -999999999
|
||||
comx095 compare 9.99999999E+999999999 9.99999999E+999999999 -> 0
|
||||
comx096 compare -9.99999999E+999999999 9.99999999E+999999999 -> -1
|
||||
comx097 compare 9.99999999E+999999999 -9.99999999E+999999999 -> 1
|
||||
comx098 compare -9.99999999E+999999999 -9.99999999E+999999999 -> 0
|
||||
|
||||
-- some differing length/exponent cases
|
||||
comx100 compare 7.0 7.0 -> 0
|
||||
comx101 compare 7.0 7 -> 0
|
||||
comx102 compare 7 7.0 -> 0
|
||||
comx103 compare 7E+0 7.0 -> 0
|
||||
comx104 compare 70E-1 7.0 -> 0
|
||||
comx105 compare 0.7E+1 7 -> 0
|
||||
comx106 compare 70E-1 7 -> 0
|
||||
comx107 compare 7.0 7E+0 -> 0
|
||||
comx108 compare 7.0 70E-1 -> 0
|
||||
comx109 compare 7 0.7E+1 -> 0
|
||||
comx110 compare 7 70E-1 -> 0
|
||||
|
||||
comx120 compare 8.0 7.0 -> 1
|
||||
comx121 compare 8.0 7 -> 1
|
||||
comx122 compare 8 7.0 -> 1
|
||||
comx123 compare 8E+0 7.0 -> 1
|
||||
comx124 compare 80E-1 7.0 -> 1
|
||||
comx125 compare 0.8E+1 7 -> 1
|
||||
comx126 compare 80E-1 7 -> 1
|
||||
comx127 compare 8.0 7E+0 -> 1
|
||||
comx128 compare 8.0 70E-1 -> 1
|
||||
comx129 compare 8 0.7E+1 -> 1
|
||||
comx130 compare 8 70E-1 -> 1
|
||||
|
||||
comx140 compare 8.0 9.0 -> -1
|
||||
comx141 compare 8.0 9 -> -1
|
||||
comx142 compare 8 9.0 -> -1
|
||||
comx143 compare 8E+0 9.0 -> -1
|
||||
comx144 compare 80E-1 9.0 -> -1
|
||||
comx145 compare 0.8E+1 9 -> -1
|
||||
comx146 compare 80E-1 9 -> -1
|
||||
comx147 compare 8.0 9E+0 -> -1
|
||||
comx148 compare 8.0 90E-1 -> -1
|
||||
comx149 compare 8 0.9E+1 -> -1
|
||||
comx150 compare 8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes -+ ..
|
||||
comx200 compare -7.0 7.0 -> -1
|
||||
comx201 compare -7.0 7 -> -1
|
||||
comx202 compare -7 7.0 -> -1
|
||||
comx203 compare -7E+0 7.0 -> -1
|
||||
comx204 compare -70E-1 7.0 -> -1
|
||||
comx205 compare -0.7E+1 7 -> -1
|
||||
comx206 compare -70E-1 7 -> -1
|
||||
comx207 compare -7.0 7E+0 -> -1
|
||||
comx208 compare -7.0 70E-1 -> -1
|
||||
comx209 compare -7 0.7E+1 -> -1
|
||||
comx210 compare -7 70E-1 -> -1
|
||||
|
||||
comx220 compare -8.0 7.0 -> -1
|
||||
comx221 compare -8.0 7 -> -1
|
||||
comx222 compare -8 7.0 -> -1
|
||||
comx223 compare -8E+0 7.0 -> -1
|
||||
comx224 compare -80E-1 7.0 -> -1
|
||||
comx225 compare -0.8E+1 7 -> -1
|
||||
comx226 compare -80E-1 7 -> -1
|
||||
comx227 compare -8.0 7E+0 -> -1
|
||||
comx228 compare -8.0 70E-1 -> -1
|
||||
comx229 compare -8 0.7E+1 -> -1
|
||||
comx230 compare -8 70E-1 -> -1
|
||||
|
||||
comx240 compare -8.0 9.0 -> -1
|
||||
comx241 compare -8.0 9 -> -1
|
||||
comx242 compare -8 9.0 -> -1
|
||||
comx243 compare -8E+0 9.0 -> -1
|
||||
comx244 compare -80E-1 9.0 -> -1
|
||||
comx245 compare -0.8E+1 9 -> -1
|
||||
comx246 compare -80E-1 9 -> -1
|
||||
comx247 compare -8.0 9E+0 -> -1
|
||||
comx248 compare -8.0 90E-1 -> -1
|
||||
comx249 compare -8 0.9E+1 -> -1
|
||||
comx250 compare -8 90E-1 -> -1
|
||||
|
||||
-- and again, with sign changes +- ..
|
||||
comx300 compare 7.0 -7.0 -> 1
|
||||
comx301 compare 7.0 -7 -> 1
|
||||
comx302 compare 7 -7.0 -> 1
|
||||
comx303 compare 7E+0 -7.0 -> 1
|
||||
comx304 compare 70E-1 -7.0 -> 1
|
||||
comx305 compare .7E+1 -7 -> 1
|
||||
comx306 compare 70E-1 -7 -> 1
|
||||
comx307 compare 7.0 -7E+0 -> 1
|
||||
comx308 compare 7.0 -70E-1 -> 1
|
||||
comx309 compare 7 -.7E+1 -> 1
|
||||
comx310 compare 7 -70E-1 -> 1
|
||||
|
||||
comx320 compare 8.0 -7.0 -> 1
|
||||
comx321 compare 8.0 -7 -> 1
|
||||
comx322 compare 8 -7.0 -> 1
|
||||
comx323 compare 8E+0 -7.0 -> 1
|
||||
comx324 compare 80E-1 -7.0 -> 1
|
||||
comx325 compare .8E+1 -7 -> 1
|
||||
comx326 compare 80E-1 -7 -> 1
|
||||
comx327 compare 8.0 -7E+0 -> 1
|
||||
comx328 compare 8.0 -70E-1 -> 1
|
||||
comx329 compare 8 -.7E+1 -> 1
|
||||
comx330 compare 8 -70E-1 -> 1
|
||||
|
||||
comx340 compare 8.0 -9.0 -> 1
|
||||
comx341 compare 8.0 -9 -> 1
|
||||
comx342 compare 8 -9.0 -> 1
|
||||
comx343 compare 8E+0 -9.0 -> 1
|
||||
comx344 compare 80E-1 -9.0 -> 1
|
||||
comx345 compare .8E+1 -9 -> 1
|
||||
comx346 compare 80E-1 -9 -> 1
|
||||
comx347 compare 8.0 -9E+0 -> 1
|
||||
comx348 compare 8.0 -90E-1 -> 1
|
||||
comx349 compare 8 -.9E+1 -> 1
|
||||
comx350 compare 8 -90E-1 -> 1
|
||||
|
||||
-- and again, with sign changes -- ..
|
||||
comx400 compare -7.0 -7.0 -> 0
|
||||
comx401 compare -7.0 -7 -> 0
|
||||
comx402 compare -7 -7.0 -> 0
|
||||
comx403 compare -7E+0 -7.0 -> 0
|
||||
comx404 compare -70E-1 -7.0 -> 0
|
||||
comx405 compare -.7E+1 -7 -> 0
|
||||
comx406 compare -70E-1 -7 -> 0
|
||||
comx407 compare -7.0 -7E+0 -> 0
|
||||
comx408 compare -7.0 -70E-1 -> 0
|
||||
comx409 compare -7 -.7E+1 -> 0
|
||||
comx410 compare -7 -70E-1 -> 0
|
||||
|
||||
comx420 compare -8.0 -7.0 -> -1
|
||||
comx421 compare -8.0 -7 -> -1
|
||||
comx422 compare -8 -7.0 -> -1
|
||||
comx423 compare -8E+0 -7.0 -> -1
|
||||
comx424 compare -80E-1 -7.0 -> -1
|
||||
comx425 compare -.8E+1 -7 -> -1
|
||||
comx426 compare -80E-1 -7 -> -1
|
||||
comx427 compare -8.0 -7E+0 -> -1
|
||||
comx428 compare -8.0 -70E-1 -> -1
|
||||
comx429 compare -8 -.7E+1 -> -1
|
||||
comx430 compare -8 -70E-1 -> -1
|
||||
|
||||
comx440 compare -8.0 -9.0 -> 1
|
||||
comx441 compare -8.0 -9 -> 1
|
||||
comx442 compare -8 -9.0 -> 1
|
||||
comx443 compare -8E+0 -9.0 -> 1
|
||||
comx444 compare -80E-1 -9.0 -> 1
|
||||
comx445 compare -.8E+1 -9 -> 1
|
||||
comx446 compare -80E-1 -9 -> 1
|
||||
comx447 compare -8.0 -9E+0 -> 1
|
||||
comx448 compare -8.0 -90E-1 -> 1
|
||||
comx449 compare -8 -.9E+1 -> 1
|
||||
comx450 compare -8 -90E-1 -> 1
|
||||
|
||||
-- misalignment traps for little-endian
|
||||
comx451 compare 1.0 0.1 -> 1
|
||||
comx452 compare 0.1 1.0 -> -1
|
||||
comx453 compare 10.0 0.1 -> 1
|
||||
comx454 compare 0.1 10.0 -> -1
|
||||
comx455 compare 100 1.0 -> 1
|
||||
comx456 compare 1.0 100 -> -1
|
||||
comx457 compare 1000 10.0 -> 1
|
||||
comx458 compare 10.0 1000 -> -1
|
||||
comx459 compare 10000 100.0 -> 1
|
||||
comx460 compare 100.0 10000 -> -1
|
||||
comx461 compare 100000 1000.0 -> 1
|
||||
comx462 compare 1000.0 100000 -> -1
|
||||
comx463 compare 1000000 10000.0 -> 1
|
||||
comx464 compare 10000.0 1000000 -> -1
|
||||
|
||||
-- testcases that subtract to lots of zeros at boundaries [pgr]
|
||||
precision: 40
|
||||
comx470 compare 123.4560000000000000E789 123.456E789 -> 0
|
||||
comx471 compare 123.456000000000000E-89 123.456E-89 -> 0
|
||||
comx472 compare 123.45600000000000E789 123.456E789 -> 0
|
||||
comx473 compare 123.4560000000000E-89 123.456E-89 -> 0
|
||||
comx474 compare 123.456000000000E789 123.456E789 -> 0
|
||||
comx475 compare 123.45600000000E-89 123.456E-89 -> 0
|
||||
comx476 compare 123.4560000000E789 123.456E789 -> 0
|
||||
comx477 compare 123.456000000E-89 123.456E-89 -> 0
|
||||
comx478 compare 123.45600000E789 123.456E789 -> 0
|
||||
comx479 compare 123.4560000E-89 123.456E-89 -> 0
|
||||
comx480 compare 123.456000E789 123.456E789 -> 0
|
||||
comx481 compare 123.45600E-89 123.456E-89 -> 0
|
||||
comx482 compare 123.4560E789 123.456E789 -> 0
|
||||
comx483 compare 123.456E-89 123.456E-89 -> 0
|
||||
comx484 compare 123.456E-89 123.4560000000000000E-89 -> 0
|
||||
comx485 compare 123.456E789 123.456000000000000E789 -> 0
|
||||
comx486 compare 123.456E-89 123.45600000000000E-89 -> 0
|
||||
comx487 compare 123.456E789 123.4560000000000E789 -> 0
|
||||
comx488 compare 123.456E-89 123.456000000000E-89 -> 0
|
||||
comx489 compare 123.456E789 123.45600000000E789 -> 0
|
||||
comx490 compare 123.456E-89 123.4560000000E-89 -> 0
|
||||
comx491 compare 123.456E789 123.456000000E789 -> 0
|
||||
comx492 compare 123.456E-89 123.45600000E-89 -> 0
|
||||
comx493 compare 123.456E789 123.4560000E789 -> 0
|
||||
comx494 compare 123.456E-89 123.456000E-89 -> 0
|
||||
comx495 compare 123.456E789 123.45600E789 -> 0
|
||||
comx496 compare 123.456E-89 123.4560E-89 -> 0
|
||||
comx497 compare 123.456E789 123.456E789 -> 0
|
||||
|
||||
-- wide-ranging, around precision; signs equal
|
||||
precision: 9
|
||||
comx500 compare 1 1E-15 -> 1
|
||||
comx501 compare 1 1E-14 -> 1
|
||||
comx502 compare 1 1E-13 -> 1
|
||||
comx503 compare 1 1E-12 -> 1
|
||||
comx504 compare 1 1E-11 -> 1
|
||||
comx505 compare 1 1E-10 -> 1
|
||||
comx506 compare 1 1E-9 -> 1
|
||||
comx507 compare 1 1E-8 -> 1
|
||||
comx508 compare 1 1E-7 -> 1
|
||||
comx509 compare 1 1E-6 -> 1
|
||||
comx510 compare 1 1E-5 -> 1
|
||||
comx511 compare 1 1E-4 -> 1
|
||||
comx512 compare 1 1E-3 -> 1
|
||||
comx513 compare 1 1E-2 -> 1
|
||||
comx514 compare 1 1E-1 -> 1
|
||||
comx515 compare 1 1E-0 -> 0
|
||||
comx516 compare 1 1E+1 -> -1
|
||||
comx517 compare 1 1E+2 -> -1
|
||||
comx518 compare 1 1E+3 -> -1
|
||||
comx519 compare 1 1E+4 -> -1
|
||||
comx521 compare 1 1E+5 -> -1
|
||||
comx522 compare 1 1E+6 -> -1
|
||||
comx523 compare 1 1E+7 -> -1
|
||||
comx524 compare 1 1E+8 -> -1
|
||||
comx525 compare 1 1E+9 -> -1
|
||||
comx526 compare 1 1E+10 -> -1
|
||||
comx527 compare 1 1E+11 -> -1
|
||||
comx528 compare 1 1E+12 -> -1
|
||||
comx529 compare 1 1E+13 -> -1
|
||||
comx530 compare 1 1E+14 -> -1
|
||||
comx531 compare 1 1E+15 -> -1
|
||||
-- LR swap
|
||||
comx540 compare 1E-15 1 -> -1
|
||||
comx541 compare 1E-14 1 -> -1
|
||||
comx542 compare 1E-13 1 -> -1
|
||||
comx543 compare 1E-12 1 -> -1
|
||||
comx544 compare 1E-11 1 -> -1
|
||||
comx545 compare 1E-10 1 -> -1
|
||||
comx546 compare 1E-9 1 -> -1
|
||||
comx547 compare 1E-8 1 -> -1
|
||||
comx548 compare 1E-7 1 -> -1
|
||||
comx549 compare 1E-6 1 -> -1
|
||||
comx550 compare 1E-5 1 -> -1
|
||||
comx551 compare 1E-4 1 -> -1
|
||||
comx552 compare 1E-3 1 -> -1
|
||||
comx553 compare 1E-2 1 -> -1
|
||||
comx554 compare 1E-1 1 -> -1
|
||||
comx555 compare 1E-0 1 -> 0
|
||||
comx556 compare 1E+1 1 -> 1
|
||||
comx557 compare 1E+2 1 -> 1
|
||||
comx558 compare 1E+3 1 -> 1
|
||||
comx559 compare 1E+4 1 -> 1
|
||||
comx561 compare 1E+5 1 -> 1
|
||||
comx562 compare 1E+6 1 -> 1
|
||||
comx563 compare 1E+7 1 -> 1
|
||||
comx564 compare 1E+8 1 -> 1
|
||||
comx565 compare 1E+9 1 -> 1
|
||||
comx566 compare 1E+10 1 -> 1
|
||||
comx567 compare 1E+11 1 -> 1
|
||||
comx568 compare 1E+12 1 -> 1
|
||||
comx569 compare 1E+13 1 -> 1
|
||||
comx570 compare 1E+14 1 -> 1
|
||||
comx571 compare 1E+15 1 -> 1
|
||||
-- similar with a useful coefficient, one side only
|
||||
comx580 compare 0.000000987654321 1E-15 -> 1
|
||||
comx581 compare 0.000000987654321 1E-14 -> 1
|
||||
comx582 compare 0.000000987654321 1E-13 -> 1
|
||||
comx583 compare 0.000000987654321 1E-12 -> 1
|
||||
comx584 compare 0.000000987654321 1E-11 -> 1
|
||||
comx585 compare 0.000000987654321 1E-10 -> 1
|
||||
comx586 compare 0.000000987654321 1E-9 -> 1
|
||||
comx587 compare 0.000000987654321 1E-8 -> 1
|
||||
comx588 compare 0.000000987654321 1E-7 -> 1
|
||||
comx589 compare 0.000000987654321 1E-6 -> -1
|
||||
comx590 compare 0.000000987654321 1E-5 -> -1
|
||||
comx591 compare 0.000000987654321 1E-4 -> -1
|
||||
comx592 compare 0.000000987654321 1E-3 -> -1
|
||||
comx593 compare 0.000000987654321 1E-2 -> -1
|
||||
comx594 compare 0.000000987654321 1E-1 -> -1
|
||||
comx595 compare 0.000000987654321 1E-0 -> -1
|
||||
comx596 compare 0.000000987654321 1E+1 -> -1
|
||||
comx597 compare 0.000000987654321 1E+2 -> -1
|
||||
comx598 compare 0.000000987654321 1E+3 -> -1
|
||||
comx599 compare 0.000000987654321 1E+4 -> -1
|
||||
|
||||
-- check some unit-y traps
|
||||
precision: 20
|
||||
comx600 compare 12 12.2345 -> -1
|
||||
comx601 compare 12.0 12.2345 -> -1
|
||||
comx602 compare 12.00 12.2345 -> -1
|
||||
comx603 compare 12.000 12.2345 -> -1
|
||||
comx604 compare 12.0000 12.2345 -> -1
|
||||
comx605 compare 12.00000 12.2345 -> -1
|
||||
comx606 compare 12.000000 12.2345 -> -1
|
||||
comx607 compare 12.0000000 12.2345 -> -1
|
||||
comx608 compare 12.00000000 12.2345 -> -1
|
||||
comx609 compare 12.000000000 12.2345 -> -1
|
||||
comx610 compare 12.1234 12 -> 1
|
||||
comx611 compare 12.1234 12.0 -> 1
|
||||
comx612 compare 12.1234 12.00 -> 1
|
||||
comx613 compare 12.1234 12.000 -> 1
|
||||
comx614 compare 12.1234 12.0000 -> 1
|
||||
comx615 compare 12.1234 12.00000 -> 1
|
||||
comx616 compare 12.1234 12.000000 -> 1
|
||||
comx617 compare 12.1234 12.0000000 -> 1
|
||||
comx618 compare 12.1234 12.00000000 -> 1
|
||||
comx619 compare 12.1234 12.000000000 -> 1
|
||||
comx620 compare -12 -12.2345 -> 1
|
||||
comx621 compare -12.0 -12.2345 -> 1
|
||||
comx622 compare -12.00 -12.2345 -> 1
|
||||
comx623 compare -12.000 -12.2345 -> 1
|
||||
comx624 compare -12.0000 -12.2345 -> 1
|
||||
comx625 compare -12.00000 -12.2345 -> 1
|
||||
comx626 compare -12.000000 -12.2345 -> 1
|
||||
comx627 compare -12.0000000 -12.2345 -> 1
|
||||
comx628 compare -12.00000000 -12.2345 -> 1
|
||||
comx629 compare -12.000000000 -12.2345 -> 1
|
||||
comx630 compare -12.1234 -12 -> -1
|
||||
comx631 compare -12.1234 -12.0 -> -1
|
||||
comx632 compare -12.1234 -12.00 -> -1
|
||||
comx633 compare -12.1234 -12.000 -> -1
|
||||
comx634 compare -12.1234 -12.0000 -> -1
|
||||
comx635 compare -12.1234 -12.00000 -> -1
|
||||
comx636 compare -12.1234 -12.000000 -> -1
|
||||
comx637 compare -12.1234 -12.0000000 -> -1
|
||||
comx638 compare -12.1234 -12.00000000 -> -1
|
||||
comx639 compare -12.1234 -12.000000000 -> -1
|
||||
precision: 9
|
||||
|
||||
-- extended zeros
|
||||
comx640 compare 0 0 -> 0
|
||||
comx641 compare 0 -0 -> 0
|
||||
comx642 compare 0 -0.0 -> 0
|
||||
comx643 compare 0 0.0 -> 0
|
||||
comx644 compare -0 0 -> 0
|
||||
comx645 compare -0 -0 -> 0
|
||||
comx646 compare -0 -0.0 -> 0
|
||||
comx647 compare -0 0.0 -> 0
|
||||
comx648 compare 0.0 0 -> 0
|
||||
comx649 compare 0.0 -0 -> 0
|
||||
comx650 compare 0.0 -0.0 -> 0
|
||||
comx651 compare 0.0 0.0 -> 0
|
||||
comx652 compare -0.0 0 -> 0
|
||||
comx653 compare -0.0 -0 -> 0
|
||||
comx654 compare -0.0 -0.0 -> 0
|
||||
comx655 compare -0.0 0.0 -> 0
|
||||
|
||||
comx656 compare -0E1 0.0 -> 0
|
||||
comx657 compare -0E2 0.0 -> 0
|
||||
comx658 compare 0E1 0.0 -> 0
|
||||
comx659 compare 0E2 0.0 -> 0
|
||||
comx660 compare -0E1 0 -> 0
|
||||
comx661 compare -0E2 0 -> 0
|
||||
comx662 compare 0E1 0 -> 0
|
||||
comx663 compare 0E2 0 -> 0
|
||||
comx664 compare -0E1 -0E1 -> 0
|
||||
comx665 compare -0E2 -0E1 -> 0
|
||||
comx666 compare 0E1 -0E1 -> 0
|
||||
comx667 compare 0E2 -0E1 -> 0
|
||||
comx668 compare -0E1 -0E2 -> 0
|
||||
comx669 compare -0E2 -0E2 -> 0
|
||||
comx670 compare 0E1 -0E2 -> 0
|
||||
comx671 compare 0E2 -0E2 -> 0
|
||||
comx672 compare -0E1 0E1 -> 0
|
||||
comx673 compare -0E2 0E1 -> 0
|
||||
comx674 compare 0E1 0E1 -> 0
|
||||
comx675 compare 0E2 0E1 -> 0
|
||||
comx676 compare -0E1 0E2 -> 0
|
||||
comx677 compare -0E2 0E2 -> 0
|
||||
comx678 compare 0E1 0E2 -> 0
|
||||
comx679 compare 0E2 0E2 -> 0
|
||||
|
||||
-- trailing zeros; unit-y
|
||||
precision: 20
|
||||
comx680 compare 12 12 -> 0
|
||||
comx681 compare 12 12.0 -> 0
|
||||
comx682 compare 12 12.00 -> 0
|
||||
comx683 compare 12 12.000 -> 0
|
||||
comx684 compare 12 12.0000 -> 0
|
||||
comx685 compare 12 12.00000 -> 0
|
||||
comx686 compare 12 12.000000 -> 0
|
||||
comx687 compare 12 12.0000000 -> 0
|
||||
comx688 compare 12 12.00000000 -> 0
|
||||
comx689 compare 12 12.000000000 -> 0
|
||||
comx690 compare 12 12 -> 0
|
||||
comx691 compare 12.0 12 -> 0
|
||||
comx692 compare 12.00 12 -> 0
|
||||
comx693 compare 12.000 12 -> 0
|
||||
comx694 compare 12.0000 12 -> 0
|
||||
comx695 compare 12.00000 12 -> 0
|
||||
comx696 compare 12.000000 12 -> 0
|
||||
comx697 compare 12.0000000 12 -> 0
|
||||
comx698 compare 12.00000000 12 -> 0
|
||||
comx699 compare 12.000000000 12 -> 0
|
||||
|
||||
-- long operand checks
|
||||
maxexponent: 999
|
||||
minexponent: -999
|
||||
precision: 9
|
||||
comx701 compare 12345678000 1 -> 1
|
||||
comx702 compare 1 12345678000 -> -1
|
||||
comx703 compare 1234567800 1 -> 1
|
||||
comx704 compare 1 1234567800 -> -1
|
||||
comx705 compare 1234567890 1 -> 1
|
||||
comx706 compare 1 1234567890 -> -1
|
||||
comx707 compare 1234567891 1 -> 1
|
||||
comx708 compare 1 1234567891 -> -1
|
||||
comx709 compare 12345678901 1 -> 1
|
||||
comx710 compare 1 12345678901 -> -1
|
||||
comx711 compare 1234567896 1 -> 1
|
||||
comx712 compare 1 1234567896 -> -1
|
||||
comx713 compare -1234567891 1 -> -1
|
||||
comx714 compare 1 -1234567891 -> 1
|
||||
comx715 compare -12345678901 1 -> -1
|
||||
comx716 compare 1 -12345678901 -> 1
|
||||
comx717 compare -1234567896 1 -> -1
|
||||
comx718 compare 1 -1234567896 -> 1
|
||||
|
||||
precision: 15
|
||||
-- same with plenty of precision
|
||||
comx721 compare 12345678000 1 -> 1
|
||||
comx722 compare 1 12345678000 -> -1
|
||||
comx723 compare 1234567800 1 -> 1
|
||||
comx724 compare 1 1234567800 -> -1
|
||||
comx725 compare 1234567890 1 -> 1
|
||||
comx726 compare 1 1234567890 -> -1
|
||||
comx727 compare 1234567891 1 -> 1
|
||||
comx728 compare 1 1234567891 -> -1
|
||||
comx729 compare 12345678901 1 -> 1
|
||||
comx730 compare 1 12345678901 -> -1
|
||||
comx731 compare 1234567896 1 -> 1
|
||||
comx732 compare 1 1234567896 -> -1
|
||||
|
||||
-- residue cases
|
||||
precision: 5
|
||||
comx740 compare 1 0.9999999 -> 1
|
||||
comx741 compare 1 0.999999 -> 1
|
||||
comx742 compare 1 0.99999 -> 1
|
||||
comx743 compare 1 1.0000 -> 0
|
||||
comx744 compare 1 1.00001 -> -1
|
||||
comx745 compare 1 1.000001 -> -1
|
||||
comx746 compare 1 1.0000001 -> -1
|
||||
comx750 compare 0.9999999 1 -> -1
|
||||
comx751 compare 0.999999 1 -> -1
|
||||
comx752 compare 0.99999 1 -> -1
|
||||
comx753 compare 1.0000 1 -> 0
|
||||
comx754 compare 1.00001 1 -> 1
|
||||
comx755 compare 1.000001 1 -> 1
|
||||
comx756 compare 1.0000001 1 -> 1
|
||||
|
||||
-- a selection of longies
|
||||
comx760 compare -36852134.84194296250843579428931 -5830629.8347085025808756560357940 -> -1
|
||||
comx761 compare -36852134.84194296250843579428931 -36852134.84194296250843579428931 -> 0
|
||||
comx762 compare -36852134.94194296250843579428931 -36852134.84194296250843579428931 -> -1
|
||||
comx763 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
-- precisions above or below the difference should have no effect
|
||||
precision: 11
|
||||
comx764 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 10
|
||||
comx765 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 9
|
||||
comx766 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 8
|
||||
comx767 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 7
|
||||
comx768 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 6
|
||||
comx769 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 5
|
||||
comx770 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 4
|
||||
comx771 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 3
|
||||
comx772 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 2
|
||||
comx773 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
precision: 1
|
||||
comx774 compare -36852134.84194296250843579428931 -36852134.94194296250843579428931 -> 1
|
||||
|
||||
-- Specials
|
||||
precision: 9
|
||||
comx780 compare Inf -Inf -> 1
|
||||
comx781 compare Inf -1000 -> 1
|
||||
comx782 compare Inf -1 -> 1
|
||||
comx783 compare Inf -0 -> 1
|
||||
comx784 compare Inf 0 -> 1
|
||||
comx785 compare Inf 1 -> 1
|
||||
comx786 compare Inf 1000 -> 1
|
||||
comx787 compare Inf Inf -> 0
|
||||
comx788 compare -1000 Inf -> -1
|
||||
comx789 compare -Inf Inf -> -1
|
||||
comx790 compare -1 Inf -> -1
|
||||
comx791 compare -0 Inf -> -1
|
||||
comx792 compare 0 Inf -> -1
|
||||
comx793 compare 1 Inf -> -1
|
||||
comx794 compare 1000 Inf -> -1
|
||||
comx795 compare Inf Inf -> 0
|
||||
|
||||
comx800 compare -Inf -Inf -> 0
|
||||
comx801 compare -Inf -1000 -> -1
|
||||
comx802 compare -Inf -1 -> -1
|
||||
comx803 compare -Inf -0 -> -1
|
||||
comx804 compare -Inf 0 -> -1
|
||||
comx805 compare -Inf 1 -> -1
|
||||
comx806 compare -Inf 1000 -> -1
|
||||
comx807 compare -Inf Inf -> -1
|
||||
comx808 compare -Inf -Inf -> 0
|
||||
comx809 compare -1000 -Inf -> 1
|
||||
comx810 compare -1 -Inf -> 1
|
||||
comx811 compare -0 -Inf -> 1
|
||||
comx812 compare 0 -Inf -> 1
|
||||
comx813 compare 1 -Inf -> 1
|
||||
comx814 compare 1000 -Inf -> 1
|
||||
comx815 compare Inf -Inf -> 1
|
||||
|
||||
comx821 compare NaN -Inf -> NaN
|
||||
comx822 compare NaN -1000 -> NaN
|
||||
comx823 compare NaN -1 -> NaN
|
||||
comx824 compare NaN -0 -> NaN
|
||||
comx825 compare NaN 0 -> NaN
|
||||
comx826 compare NaN 1 -> NaN
|
||||
comx827 compare NaN 1000 -> NaN
|
||||
comx828 compare NaN Inf -> NaN
|
||||
comx829 compare NaN NaN -> NaN
|
||||
comx830 compare -Inf NaN -> NaN
|
||||
comx831 compare -1000 NaN -> NaN
|
||||
comx832 compare -1 NaN -> NaN
|
||||
comx833 compare -0 NaN -> NaN
|
||||
comx834 compare 0 NaN -> NaN
|
||||
comx835 compare 1 NaN -> NaN
|
||||
comx836 compare 1000 NaN -> NaN
|
||||
comx837 compare Inf NaN -> NaN
|
||||
comx838 compare -NaN -NaN -> -NaN
|
||||
comx839 compare +NaN -NaN -> NaN
|
||||
comx840 compare -NaN +NaN -> -NaN
|
||||
|
||||
comx841 compare sNaN -Inf -> NaN Invalid_operation
|
||||
comx842 compare sNaN -1000 -> NaN Invalid_operation
|
||||
comx843 compare sNaN -1 -> NaN Invalid_operation
|
||||
comx844 compare sNaN -0 -> NaN Invalid_operation
|
||||
comx845 compare sNaN 0 -> NaN Invalid_operation
|
||||
comx846 compare sNaN 1 -> NaN Invalid_operation
|
||||
comx847 compare sNaN 1000 -> NaN Invalid_operation
|
||||
comx848 compare sNaN NaN -> NaN Invalid_operation
|
||||
comx849 compare sNaN sNaN -> NaN Invalid_operation
|
||||
comx850 compare NaN sNaN -> NaN Invalid_operation
|
||||
comx851 compare -Inf sNaN -> NaN Invalid_operation
|
||||
comx852 compare -1000 sNaN -> NaN Invalid_operation
|
||||
comx853 compare -1 sNaN -> NaN Invalid_operation
|
||||
comx854 compare -0 sNaN -> NaN Invalid_operation
|
||||
comx855 compare 0 sNaN -> NaN Invalid_operation
|
||||
comx856 compare 1 sNaN -> NaN Invalid_operation
|
||||
comx857 compare 1000 sNaN -> NaN Invalid_operation
|
||||
comx858 compare Inf sNaN -> NaN Invalid_operation
|
||||
comx859 compare NaN sNaN -> NaN Invalid_operation
|
||||
|
||||
-- propagating NaNs
|
||||
comx860 compare NaN9 -Inf -> NaN9
|
||||
comx861 compare NaN8 999 -> NaN8
|
||||
comx862 compare NaN77 Inf -> NaN77
|
||||
comx863 compare -NaN67 NaN5 -> -NaN67
|
||||
comx864 compare -Inf -NaN4 -> -NaN4
|
||||
comx865 compare -999 -NaN33 -> -NaN33
|
||||
comx866 compare Inf NaN2 -> NaN2
|
||||
comx867 compare -NaN41 -NaN42 -> -NaN41
|
||||
comx868 compare +NaN41 -NaN42 -> NaN41
|
||||
comx869 compare -NaN41 +NaN42 -> -NaN41
|
||||
comx870 compare +NaN41 +NaN42 -> NaN41
|
||||
|
||||
comx871 compare -sNaN99 -Inf -> -NaN99 Invalid_operation
|
||||
comx872 compare sNaN98 -11 -> NaN98 Invalid_operation
|
||||
comx873 compare sNaN97 NaN -> NaN97 Invalid_operation
|
||||
comx874 compare sNaN16 sNaN94 -> NaN16 Invalid_operation
|
||||
comx875 compare NaN85 sNaN83 -> NaN83 Invalid_operation
|
||||
comx876 compare -Inf sNaN92 -> NaN92 Invalid_operation
|
||||
comx877 compare 088 sNaN81 -> NaN81 Invalid_operation
|
||||
comx878 compare Inf sNaN90 -> NaN90 Invalid_operation
|
||||
comx879 compare NaN -sNaN89 -> -NaN89 Invalid_operation
|
||||
|
||||
-- overflow and underflow tests .. subnormal results now allowed
|
||||
maxExponent: 999999999
|
||||
minexponent: -999999999
|
||||
comx880 compare +1.23456789012345E-0 9E+999999999 -> -1
|
||||
comx881 compare 9E+999999999 +1.23456789012345E-0 -> 1
|
||||
comx882 compare +0.100 9E-999999999 -> 1
|
||||
comx883 compare 9E-999999999 +0.100 -> -1
|
||||
comx885 compare -1.23456789012345E-0 9E+999999999 -> -1
|
||||
comx886 compare 9E+999999999 -1.23456789012345E-0 -> 1
|
||||
comx887 compare -0.100 9E-999999999 -> -1
|
||||
comx888 compare 9E-999999999 -0.100 -> 1
|
||||
|
||||
comx889 compare 1e-599999999 1e-400000001 -> -1
|
||||
comx890 compare 1e-599999999 1e-400000000 -> -1
|
||||
comx891 compare 1e-600000000 1e-400000000 -> -1
|
||||
comx892 compare 9e-999999998 0.01 -> -1
|
||||
comx893 compare 9e-999999998 0.1 -> -1
|
||||
comx894 compare 0.01 9e-999999998 -> 1
|
||||
comx895 compare 1e599999999 1e400000001 -> 1
|
||||
comx896 compare 1e599999999 1e400000000 -> 1
|
||||
comx897 compare 1e600000000 1e400000000 -> 1
|
||||
comx898 compare 9e999999998 100 -> 1
|
||||
comx899 compare 9e999999998 10 -> 1
|
||||
comx900 compare 100 9e999999998 -> -1
|
||||
-- signs
|
||||
comx901 compare 1e+777777777 1e+411111111 -> 1
|
||||
comx902 compare 1e+777777777 -1e+411111111 -> 1
|
||||
comx903 compare -1e+777777777 1e+411111111 -> -1
|
||||
comx904 compare -1e+777777777 -1e+411111111 -> -1
|
||||
comx905 compare 1e-777777777 1e-411111111 -> -1
|
||||
comx906 compare 1e-777777777 -1e-411111111 -> 1
|
||||
comx907 compare -1e-777777777 1e-411111111 -> -1
|
||||
comx908 compare -1e-777777777 -1e-411111111 -> 1
|
||||
|
||||
-- spread zeros
|
||||
comx910 compare 0E-383 0 -> 0
|
||||
comx911 compare 0E-383 -0 -> 0
|
||||
comx912 compare -0E-383 0 -> 0
|
||||
comx913 compare -0E-383 -0 -> 0
|
||||
comx914 compare 0E-383 0E+384 -> 0
|
||||
comx915 compare 0E-383 -0E+384 -> 0
|
||||
comx916 compare -0E-383 0E+384 -> 0
|
||||
comx917 compare -0E-383 -0E+384 -> 0
|
||||
comx918 compare 0 0E+384 -> 0
|
||||
comx919 compare 0 -0E+384 -> 0
|
||||
comx920 compare -0 0E+384 -> 0
|
||||
comx921 compare -0 -0E+384 -> 0
|
||||
comx930 compare 0E+384 0 -> 0
|
||||
comx931 compare 0E+384 -0 -> 0
|
||||
comx932 compare -0E+384 0 -> 0
|
||||
comx933 compare -0E+384 -0 -> 0
|
||||
comx934 compare 0E+384 0E-383 -> 0
|
||||
comx935 compare 0E+384 -0E-383 -> 0
|
||||
comx936 compare -0E+384 0E-383 -> 0
|
||||
comx937 compare -0E+384 -0E-383 -> 0
|
||||
comx938 compare 0 0E-383 -> 0
|
||||
comx939 compare 0 -0E-383 -> 0
|
||||
comx940 compare -0 0E-383 -> 0
|
||||
comx941 compare -0 -0E-383 -> 0
|
||||
|
||||
-- Null tests
|
||||
comx990 compare 10 # -> NaN Invalid_operation
|
||||
comx991 compare # 10 -> NaN Invalid_operation
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user