# frozen_string_literal: false require "test/unit" begin require "Win32API" rescue LoadError end class TestWin32API < Test::Unit::TestCase def test_params_string m2w = Win32API.new("kernel32", "MultiByteToWideChar", "ilpipi", "i") str = "utf-8 string".encode("utf-8") buf = "\0" * (str.size * 2) assert_equal str.size, m2w.call(65001, 0, str, str.bytesize, buf, str.size) assert_equal str.encode("utf-16le"), buf.force_encoding("utf-16le") end def test_params_array m2w = Win32API.new("kernel32", "MultiByteToWideChar", ["i", "l", "p", "i", "p", "i"], "i") str = "utf-8 string".encode("utf-8") buf = "\0" * (str.size * 2) assert_equal str.size, m2w.call(65001, 0, str, str.bytesize, buf, str.size) assert_equal str.encode("utf-16le"), buf.force_encoding("utf-16le") end end if defined?(Win32API) 8'>ruby_1_8 The Ruby Programming Language
summaryrefslogtreecommitdiff
path: root/eval_intern.h
AgeCommit message (Expand)Author
2020-11-11Threads in a ractor will be killed with the ractorKoichi Sasada
2020-10-26Ignore <internal: entries from core library methods for Kernel#warn(message, ...Benoit Daloze
2020-10-14fix releasing timing.Koichi Sasada
2020-10-14support exception when lock_rec > 0Koichi Sasada
2019-12-13Create backtrace location array directlyNobuyoshi Nakada
2019-11-14delete unused functions卜部昌平
2019-08-08solve "duplicate :raise event" [Bug #15877]Koichi Sasada
2019-05-31Use UNALIGNED_MEMBER_PTRNobuyoshi Nakada
2019-05-31Also GCC 9 provides -Waddress-of-packed-memberNobuyoshi Nakada
2018-07-30reduce copy & pasteshyouhei
2018-01-18eval_intern.h: duplicate checknobu
2017-12-06eval_intern.h: fix a typomame
2017-12-06eval_intern.h: prevent core dump with clang and make test-allmame
2017-12-06remove `PUSH_TAG`/`EXEC_AG`/`POP_TAG`/`JUMO_TAG`.ko1
2017-11-16make a func static.ko1
2017-11-16make a func static.ko1
2017-11-07`rb_execution_context_t *` should not be `th`ko1
2017-11-07fix commentko1
2017-11-07* eval_intern.h (rb_threadptr_tag_state): rename to rb_ec_tag_state.ko1
2017-11-07* eval_intern.h: rename macros rb_thread_raised_* toko1
2017-11-07rename to rb_ec_set_raised().ko1
2017-11-07th->ec: rb_threadptr_reset_raised()ko1
2017-10-29`th` -> `ec` for rb_raise_method_missing().ko1
2017-10-29rb_ec_stack_check()ko1
2017-10-28`th` -> `ec` for backtrace functions.ko1
2017-10-28`th` -> `ec` for rb_longjmp() and related functions.ko1
2017-10-28move fields from `th` to `ec`.ko1
2017-10-26introduce EC_*_TAG() instead of TH_*_TAG()ko1
2017-10-26Use rb_execution_context_t instead of rb_thread_tko1
2017-09-25vm.c: unused functionnobu
2017-07-30UNALIGNED_MEMBER_ACCESS only for clangnobu
2017-07-30UNALIGNED_MEMBER_ACCESSnobu
2017-06-26move several fields from rb_thread_t to rb_execution_context_t.ko1
2017-06-23move "state" to rb_vm_tag.ko1
2017-06-23rename th->state to th->tag_state.ko1
2017-06-23use "enum ruby_tag_type" and TAG_NONE.ko1