summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2016-05-28* test/test_unicode_normalize.rb: Add test to check for availability ofduerst
Unicode data file; refactoring; fix an error with tests for destructive method (unicode_normalize!). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-28test_file_exhaustive.rb: blocking flocknobu
* test/ruby/test_file_exhaustive.rb (test_flock): add assertions for the blocking cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-28* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-28* test/ruby/enc/test_case_comprehensive.rb: Add error messages to testsduerst
for data file availability; refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-28git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55187 ↵duerst
b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-27variable.c: hidden constantsnobu
* variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-27transcode.c: scrub in the given encodingnobu
* transcode.c (str_transcode0): scrub in the given encoding when the source encoding is given, not in the encoding of the receiver. [ruby-core:75732] [Bug #12431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-26* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-26* test/ruby/enc/test_case_comprehensive.rb: Add set of comprehensiveduerst
(across most Unicode characters; later across most character encodings) tests for case mapping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-25* regparse.c (fetch_token_in_cc): raise error if given octal escapednaruse
character is too big. [Bug #12420] [Bug #12423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-25openssl: drop OpenSSL 0.9.6/0.9.7 supportrhe
* ext/openssl, test/openssl: Drop OpenSSL < 0.9.8 support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-25* regcomp.c (compile_length_tree): return error code immediatelynaruse
if compile_length_tree raised error [Bug #12418] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24* enc/unicode.c: Fix flag error for switch from titlecase to lowercase.duerst
* test/ruby/enc/test_case_mapping.rb: Tests for above error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24openssl: add EC.generaterhe
* ext/openssl/ossl_pkey_ec.c (ec_key_new_from_group): Create a new EC_KEY on given EC group. Extracted from ossl_ec_key_initialize(). (ossl_ec_key_s_generate): Added. Create a new EC instance and generate a random private and public key. (ossl_ec_key_initialize): Use ec_key_new_from_group(). (Init_ossl_ec): Define the new method EC.generate. This change is for consistency with other PKey types. [ruby-core:45541] [Bug #6567] * test/openssl/test_pkey_ec.rb: Test that EC.generate works. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24openssl: rename EC#generate_key to EC#generate_key!rhe
* ext/openssl/ossl_pkey_ec.c (ossl_ec_key_generate_key): Fix up RDoc. (Init_ossl_ec): Rename EC#generate_key to EC#generate_key!. Make the old name an alias of #generate_key!. This change is for consistency with other PKey types. [ruby-core:45541] [Bug #6567] * test/openssl/test_pkey_ec.rb: Use EC#generate_key! instead of EC#generate_key. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-24openssl: make Cipher#key= and #iv= reject too long valuesrhe
* ext/openssl/ossl_cipher.c (ossl_cipher_set_key, ossl_cipher_set_iv): Reject too long values as well as too short ones. Currently they just truncate the input but this would hide bugs and lead to unexpected encryption/decryption results. * test/openssl/test_cipher.rb: Test that Cipher#key= and #iv= reject Strings with invalid length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-23bigdecimal.c: fix FloatDomainErrornobu
* ext/bigdecimal/bigdecimal.c (GetVpValueWithPrec): consider non-finite float values not to raise FloatDomainError. [ruby-core:75682] [Bug #12414] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22use finalizer trick instead of thread.seki
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 * test/ruby/enc/test_case_options.rb: adjust test class nameduerst
to match file name git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22 * rename test/ruby/enc/test_casing_options.rb to test_case_options.rbduerst
for consistency git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22-test-/integernobu
* ext/-test-/integer/core_ext.c: move testutil/integer.c. * test/lib/-test-/integer.rb: extract implementation details from test/unit/assertions.rb. [Bug #12408] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-22move duplicate assertionsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21just check Integernobu
* test/ruby/test_bignum.rb (test_pow): just assert to be an Integer. * test/ruby/test_integer_comb.rb (check_class): ditto. * test/ruby/test_numeric.rb (test_coerce): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21hash method valuesnobu
* test/ruby/test_{complex,range,rational,struct}.rb (test_hash): hash values should be an Integer, not only a Fixnum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21openssl: fix possible SEGV on race between SSLSocket#stop and #connectrhe
* ext/openssl/ossl_ssl.c (ossl_ssl_stop): Don't free the SSL struct here. Since some methods such as SSLSocket#connect releases GVL, there is a chance of use after free if we free the SSL from another thread. SSLSocket#stop was documented as "prepares it for another connection" so this is a slightly incompatible change. However when this sentence was added (r30090, Add toplevel documentation for OpenSSL, 2010-12-06), it didn't actually. The current behavior is from r40304 (Correct shutdown behavior w.r.t GC., 2013-04-15). [ruby-core:74978] [Bug #12292] * ext/openssl/lib/openssl/ssl.rb (sysclose): Update doc. * test/openssl/test_ssl.rb: Test this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-21openssl: add OpenSSL::PKey::EC#private? and #public?rhe
* ext/openssl/ossl_pkey_ec.c: rename PKey::EC#private_key? and #public_key? to #private? and #public? for consistency with other PKey types. Old names remain as alias. [ruby-core:45541] [Bug #6567] * test/openssl/test_pkey_ec.rb (test_check_key): check private? and public? works correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-20openssl: improve handling of password for encrypted PEMrhe
* ext/openssl/ossl.c (ossl_pem_passwd_value): Added. Convert the argument to String with StringValue() and validate the length is in 4..PEM_BUFSIZE. PEM_BUFSIZE is a macro defined in OpenSSL headers. (ossl_pem_passwd_cb): When reading/writing encrypted PEM format, we used to pass the password to PEM_def_callback() directly but it was problematic. It is not NUL character safe. And surprisingly, it silently truncates the password to 1024 bytes. [GH ruby/openssl#51] * ext/openssl/ossl.h: Add function prototype declaration of newly added ossl_pem_passwd_value(). * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): Use ossl_pem_passwd_value() to validate the password String. * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize, ossl_dsa_export): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_initialize, ossl_ec_key_to_string): ditto. * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize, ossl_rsa_export): ditto. * test/openssl/test_pkey_{dsa,ec,rsa}.rb: test this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-20openssl: don't test default session lifetime valuerhe
OpenSSL's default session timeout for TLS v1.0 method is not 300 seconds but 7200. The TLS v1.0 specification[1] mentions about it as just "An upper limit of 24 hours is suggested for session ID lifetimes,". And according to OpenSSL 1.0.2h source comment[2], the value 7200 is decided just because "the 24 hours mentioned in the TLSv1 spec is way too long for http, the cache would over fill". The reason why the default lifetime is set to 300 is maybe an OpenSSL bug. We always call SSL_CTX_new() with SSLv23_method(), and this set ssl_ctx->session to 300, the default value for SSLv23_method(). But the following SSL_set_ssl_method() call does not update it. By the way this will be fixed in OpenSSL 1.1.0. [1] https://tools.ietf.org/html/rfc2246#appendix-F.1.4 [2] https://git.openssl.org/?p=openssl.git;a=blob;f=ssl/t1_lib.c;h=dd5bd0050d89f5585c1b06a227eb8221ebf984f1;hb=5dd94f1847c744929a3bd24819f1c99644bb18c7#l193 * test/openssl/test_ssl_session.rb (test_session): remove assertion of the default session timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19fix document of Regexp#match?kazu
* re.c (rb_reg_match_m_p): [DOC] fix return value in rdoc. * test/ruby/test_regexp.rb (TestRegexp#test_match_p): add some tests from document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19* test/ruby/test_array.rb (TestArray#test_push_over_ary_max): it seems to takeusa
long time on mswinci. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19openssl: check argument type in OpenSSL::X509::Attribute#value=rhe
* ext/openssl/ossl_x509attr.c (ossl_x509attr_set_value): check that the argument is an OpenSSL::ASN1::Data before converting to ASN1_TYPE. This fixes SEGV on OpenSSL::X509::Attribute#value=(non-asn1-value). * test/openssl/test_x509attr.rb: add tests for OpenSSL::X509::Attribute. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19assertions.rb: leave timeout to invoke_rubynobu
* test/lib/test/unit/assertions.rb (assert_separately): leave timeout to invoke_ruby, which handles outputs and status of the target process since r51539. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19re.c: fix match?nobu
* re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-19re.c: match? should return nil if no matchnobu
* re.c (rb_reg_match_m_p): should return nil if no match, as the document says. [Feature #8110] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18* re.c (rb_reg_match_m_p): Introduce Regexp#match?, which returnsnaruse
bool and doesn't save backref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18openssl: fix test failure due to the previous commitrhe
* test/openssl/test_pkey_ec.rb (test_ec_point_mul): My previous commit r55059 was broken. I should have been more careful. Sorry. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18openssl: fix test failure of OpenSSL::TestEC#test_ec_point_mulrhe
* test/openssl/test_pkey_ec.rb (test_ec_point_mul): CentOS 7 patches OpenSSL to reject curves defined over a small field. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18test_random.rb: skip old OpenSSLnobu
* test/openssl/test_random.rb (OpenSSL::TestRandom): ignore out-of-date OpenSSL before 1.0, as well as other tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18openssl/test_random.rb: requires utils.rbnobu
* test/openssl/test_random.rb: requires test/openssl/utils.rb for OpenSSL::TestCase now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18string.c: integer overflownobu
* string.c (rb_str_modify_expand): check integer overflow. [ruby-core:75592] [Bug #12390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18* re.c (match_ary_subseq): get subseq of match array without creatingnaruse
temporary array. * re.c (match_ary_aref): get element(s) of match array without creating temporary array. * re.c (match_aref): Use match_ary_subseq with handling irregulars. * re.c (match_values_at): Use match_ary_aref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18openssl: clear OpenSSL error queue before return to Rubyrhe
* ext/openssl/ossl_x509cert.c (ossl_x509_verify): X509_verify() family may put errors on 0 return (0 means verification failure). Clear OpenSSL error queue before return to Ruby. Since the queue is thread global, remaining errors in the queue can cause an unexpected error in the next OpenSSL operation. [ruby-core:48284] [Bug #7215] * ext/openssl/ossl_x509crl.c (ossl_x509crl_verify): ditto. * ext/openssl/ossl_x509req.c (ossl_x509req_verify): ditto. * ext/openssl/ossl_x509store.c (ossl_x509stctx_verify): ditto. * ext/openssl/ossl_pkey_dh.c (dh_generate): clear the OpenSSL error queue before re-raising exception. * ext/openssl/ossl_pkey_dsa.c (dsa_generate): ditto. * ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto. * ext/openssl/ossl_ssl.c (ossl_start_ssl): ditto. * test/openssl: check that OpenSSL.errors is empty every time after running a test case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18ext/openssl: refactor OpenSSL::PKey::EC::Point#mulrhe
* ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): Validate the arguments before passing to EC_POINT(s)_mul(). Add description of this method. [ruby-core:65152] [Bug #10268] * test/openssl/test_pkey_ec.rb (test_ec_point_mul): Test that OpenSSL::PKey::EC::Point#mul works. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18openssl: fix equality test methods of OpenSSL::BNrhe
* ext/openssl/ossl_bn.c (try_convert_to_bnptr): Extracted from GetBNPtr(). This doesn't raise exception but returns NULL on error. (GetBNPtr): Raise TypeError if conversion fails. (ossl_bn_eq): Implement BN#==. (ossl_bn_eql): #eql? should not raise TypeError even if the argument is not compatible with BN. (ossl_bn_hash): Implement BN#hash. * ext/openssl/ossl_bn.c (Init_ossl_bn): Define #== and #hash. * test/openssl/test_bn.rb: Test BN#eql?, #== and #hash git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-18test/win32ole/test_win32ole_variant.rb: use other than Integernobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17re.c: fix up r55036nobu
* re.c (match_values_at): fix regression at r55036. MatchData#values_at accepts Range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17* re.c (match_values_at): MatchData#values_at supports named capturesnaruse
[Feature #9179] * re.c (namev_to_backref_number): separeted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17Optimize enum_sum for a range from int to intmrkn
* enum.c (enum_sum): Optimize for a range from int to int. * test/ruby/test_enum.rb (test_range_sum): Move from test_range.rb, and add assertions for some conditions. * test/ruby/test_enum.rb (test_hash_sum): Move from test_hash.rb. * test/ruby/test_hash.rb, test/ruby/test_range.rb: Remove test_sum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17Implement Enumerable#summrkn
* enum.c (enum_sum): Implement Enumerable#sum. * test/ruby/test_enum.rb (test_sum): Test sum for Enumerable. * test/ruby/test_hash.rb (test_sum): Test sum for Hash. * test/ruby/test_range.rb (test_sum): Test sum for Range. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17Use Integer instead of Fixnum and Bignum.akr
* object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c, lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb, lib/rubygems/specification.rb, lib/uri/generic.rb, bootstraptest/test_eval.rb, basictest/test.rb, test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb, test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb, test/csv/test_data_converters.rb, test/date/test_date.rb, test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb, test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb, test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb, test/ruby/test_bignum.rb, test/ruby/test_case.rb, test/ruby/test_class.rb, test/ruby/test_complex.rb, test/ruby/test_enum.rb, test/ruby/test_eval.rb, test/ruby/test_iseq.rb, test/ruby/test_literal.rb, test/ruby/test_math.rb, test/ruby/test_module.rb, test/ruby/test_numeric.rb, test/ruby/test_range.rb, test/ruby/test_rational.rb, test/ruby/test_refinement.rb, test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb, test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb, test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e