• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Ruby GTK3移行後のメインリポジトリ


Commit MetaInfo

Revisãoe2c2fec7d5b9b1cf08ae0c010ebaa8fdc31c8b95 (tree)
Hora2015-03-15 10:56:30
AutorShyouzou Sugitani <shy@user...>
CommiterShyouzou Sugitani

Mensagem de Log

split test code to separate files(5)

Mudança Sumário

Diff

--- a/lib/ninix/install.rb
+++ b/lib/ninix/install.rb
@@ -3,7 +3,7 @@
33 # install.py - an installer module for ninix
44 # Copyright (C) 2001, 2002 by Tamito KAJIYAMA
55 # Copyright (C) 2002, 2003 by MATSUMURA Namihiko <nie@counterghost.net>
6-# Copyright (C) 2002-2014 by Shyouzou Sugitani <shy@users.sourceforge.jp>
6+# Copyright (C) 2002-2015 by Shyouzou Sugitani <shy@users.sourceforge.jp>
77 # Copyright (C) 2003 by Shun-ichi TAHARA <jado@flowernet.gr.jp>
88 #
99 # This program is free software; you can redistribute it and/or modify it
@@ -820,8 +820,3 @@ module Install
820820 end
821821 end
822822 end
823-
824-#installer = Install::Installer.new()
825-##archive = "/home/shy/ukagaka/Ghost/Anko/Anko_re.nar"
826-#archive = "http://altenotiz.sakura.ne.jp/ghost/exice_z102.zip"
827-#installer.install(archive, "/home/shy/TEST")
--- a/lib/ninix/sstp.rb
+++ b/lib/ninix/sstp.rb
@@ -594,72 +594,4 @@ module SSTP
594594 return sentence
595595 end
596596 end
597-
598- class TEST
599-
600- def initialize
601- port = 9801
602- sstpd = SSTPServer.new(port)
603- sstpd.set_responsible(self)
604-# @request_handler = nil
605- print('Serving SSTP on port ' + port.to_i.to_s + ' ...' + "\n")
606- opt = sstpd.getsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR)
607- print('Allow reuse address: ' + opt.int.to_s + "\n")
608- @cantalk = 0
609- while true
610- s = sstpd.accept
611- handler = SSTPRequestHandler.new(sstpd, s)
612- buffer = s.gets
613- handler.handle(buffer)
614- if sstpd.has_request_handler
615- #sstpd.send_answer("TEST")
616- #sstpd.send_no_content
617- #sstpd.send_sstp_break
618- #sstpd.send_response(511)
619- sstpd.send_timeout
620- end
621- s.close
622- end
623- #serv.shutdown_request("TEST")
624- end
625-
626-# def has_request_handler
627-# if @request_handler != nil
628-# return true
629-# else
630-# return false
631-# end
632-# end
633-#
634-# def set_request_handler(handler) ## FIXME
635-# @request_handler = handler
636-# end
637-
638- def handle_request(event, *args)
639- if event == "GET"
640- print("ARGS: ", args, "\n")
641- if args[0] == "get_sakura_cantalk"
642-# print("CANTALK :", @cantalk, "\n")
643- if @cantalk == 1
644- @cantalk = 0
645- return true
646- else
647- @cantalk = 1
648- return false
649- end
650- elsif args[0] == "get_ghost_names"
651- return ["A", "B", "C"]
652- elsif args[0] == "check_request_queue"
653- return [100, 200]
654- else
655- return "日本語テスト"
656- end
657- elsif event == "NOTIFY"
658- print("NOTIFY: ", args, "\n")
659- return 1
660- end
661- end
662- end
663597 end
664-
665-SSTP::TEST.new
--- a/lib/ninix/sstplib.rb
+++ b/lib/ninix/sstplib.rb
@@ -178,29 +178,4 @@ module SSTPLib
178178 t[2], m, t[0], t[3], t[4], t[5], (-time.timezone / 36).to_i)
179179 end
180180 end
181-
182-
183- class TEST
184-
185- def initialize(port = 9801)
186- sstpd = SSTPServer.new('', port)
187- print('Serving SSTP on port ' + port.to_i.to_s + ' ...' + "\n")
188- opt = sstpd.getsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR)
189- print('Allow reuse address: ' + opt.int.to_s + "\n")
190- while true
191- s = sstpd.accept
192- handler = BaseSSTPRequestHandler.new(self, s)
193- buffer = s.gets
194- handler.handle(buffer)
195- s.close
196- end
197- end
198-
199- def request_parent(args)
200- print("ARGS: ", args, "\n")
201- return 1
202- end
203- end
204181 end
205-
206-SSTPLib::TEST.new
--- /dev/null
+++ b/test/test-install.rb
@@ -0,0 +1,16 @@
1+require "ninix/install"
2+
3+module NinixTest
4+
5+ class InstallTest
6+
7+ def initialize
8+ installer = Install::Installer.new()
9+ archive = File.expand_path("~/ukagaka/Ghost/Anko/Anko_re.nar")
10+ #archive = "http://altenotiz.sakura.ne.jp/ghost/exice_z102.zip"
11+ installer.install(archive, File.expand_path("~/TEST"))
12+ end
13+ end
14+end
15+
16+NinixTest::InstallTest.new
--- /dev/null
+++ b/test/test-sakura-vanish.rb
@@ -0,0 +1,24 @@
1+require "ninix/sakura"
2+
3+module NinixTest
4+
5+ class VanishTest
6+
7+ def initialize
8+ dialog = Sakura::VanishDialog.new
9+ dialog.set_responsible(self)
10+ dialog.set_message("test")
11+ dialog.show()
12+ Gtk.main
13+ end
14+
15+ def handle_request(event_type, event, *arglist, **argdict)
16+ if event_type == "NOTIFY"
17+ print("NOTIFY: ", event, "\n")
18+ end
19+ end
20+ end
21+end
22+
23+test = NinixTest::VanishTest.new
24+test.do_tests
--- /dev/null
+++ b/test/test-sstp.rb
@@ -0,0 +1,73 @@
1+# coding: utf-8
2+require "ninix/sstp"
3+
4+module NinixTest
5+
6+ class SSTPTest
7+
8+ def initialize
9+ port = 9801
10+ sstpd = SSTP::SSTPServer.new(port)
11+ sstpd.set_responsible(self)
12+# @request_handler = nil
13+ print('Serving SSTP on port ' + port.to_i.to_s + ' ...' + "\n")
14+ opt = sstpd.getsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR)
15+ print('Allow reuse address: ' + opt.int.to_s + "\n")
16+ @cantalk = 0
17+ while true
18+ s = sstpd.accept
19+ handler = SSTP::SSTPRequestHandler.new(sstpd, s)
20+ buffer = s.gets
21+ handler.handle(buffer)
22+ if sstpd.has_request_handler
23+ #sstpd.send_answer("TEST")
24+ #sstpd.send_no_content
25+ #sstpd.send_sstp_break
26+ #sstpd.send_response(511)
27+ sstpd.send_timeout
28+ end
29+ s.close
30+ end
31+ #serv.shutdown_request("TEST")
32+ end
33+
34+# def has_request_handler
35+# if @request_handler != nil
36+# return true
37+# else
38+# return false
39+# end
40+# end
41+#
42+# def set_request_handler(handler) ## FIXME
43+# @request_handler = handler
44+# end
45+
46+ def handle_request(event, *args)
47+ if event == "GET"
48+ print("ARGS: ", args, "\n")
49+ if args[0] == "get_sakura_cantalk"
50+# print("CANTALK :", @cantalk, "\n")
51+ if @cantalk == 1
52+ @cantalk = 0
53+ return true
54+ else
55+ @cantalk = 1
56+ return false
57+ end
58+ elsif args[0] == "get_ghost_names"
59+ return ["A", "B", "C"]
60+ elsif args[0] == "check_request_queue"
61+ return [100, 200]
62+ else
63+ return "日本語テスト"
64+ end
65+ elsif event == "NOTIFY"
66+ print("NOTIFY: ", args, "\n")
67+ return 1
68+ end
69+ end
70+ end
71+end
72+
73+NinixTest::SSTPTest.new
--- /dev/null
+++ b/test/test-sstplib.rb
@@ -0,0 +1,28 @@
1+require "ninix/sstplib"
2+
3+module NinixTest
4+
5+ class SSTPLibTest
6+
7+ def initialize(port = 9801)
8+ sstpd = SSTPLib::SSTPServer.new('', port)
9+ print('Serving SSTP on port ' + port.to_i.to_s + ' ...' + "\n")
10+ opt = sstpd.getsockopt(Socket::SOL_SOCKET, Socket::SO_REUSEADDR)
11+ print('Allow reuse address: ' + opt.int.to_s + "\n")
12+ while true
13+ s = sstpd.accept
14+ handler = SSTPLib::BaseSSTPRequestHandler.new(self, s)
15+ buffer = s.gets
16+ handler.handle(buffer)
17+ s.close
18+ end
19+ end
20+
21+ def request_parent(args)
22+ print("ARGS: ", args, "\n")
23+ return 1
24+ end
25+ end
26+end
27+
28+NinixTest::SSTPLibTest.new