Ruby GTK3移行後のメインリポジトリ
Revisão | 6adcb45c6ee5f60c0cf1f36bfc01d36a990ed548 (tree) |
---|---|
Hora | 2016-02-02 22:47:08 |
Autor | Shyouzou Sugitani <shy@user...> |
Commiter | Shyouzou Sugitani |
update test-kawari8.rb
@@ -11,9 +11,20 @@ end | ||
11 | 11 | |
12 | 12 | path = ARGV[0].to_s.encode("Shift_JIS") |
13 | 13 | #print path, "\n" |
14 | -Test.load(path, path.bytesize) | |
14 | +path_ptr = Fiddle::Pointer.malloc( | |
15 | + path.bytesize + 1, | |
16 | + freefunc=nil # Kawari8 will free this pointer | |
17 | +) | |
18 | +Test.load(path_ptr, path.bytesize) | |
15 | 19 | test_text = "NOTIFY SHIORI/3.0\r\nCharset: Shift_JIS\r\nID: TEST 日本語\r\n\r\n".encode("Shift_JIS") |
16 | -test_len = [test_text.bytesize].pack("q") | |
17 | -result = Test.request(test_text, test_len) | |
18 | -print result.to_s.force_encoding("Shift_JIS").encode("UTF-8") | |
20 | +test_len = [test_text.bytesize].pack("l!") | |
21 | +test_ptr = Fiddle::Pointer.malloc( | |
22 | + test_text.bytesize + 1, | |
23 | + freefunc=nil # Kawari8 will free this pointer | |
24 | +) | |
25 | +test_ptr[0, test_text.bytesize] = test_text | |
26 | +result = Test.request(test_ptr, test_len) | |
27 | +test_len, = test_len.unpack("l!") | |
28 | +#print result.methods.sort, "\n" | |
29 | +print result[0, test_len].to_s.force_encoding("Shift_JIS").encode("UTF-8") | |
19 | 30 | Test.unload() |