• R/O
  • HTTP
  • SSH
  • HTTPS

MiMicSDK: Commit

MiMicSDK


Commit MetaInfo

Revision993994432113c0215490831d19828835d1f599ff (tree)
Zeit2014-07-20 21:17:31
Autornyatla <nyatla@4719...>
Commiternyatla

Log Message

テストケースの更新

git-svn-id: http://svn.osdn.jp/svnroot/mimic/trunk@386 47198e57-cb75-475f-84c4-a814cd6f29e0

Ändern Zusammenfassung

Diff

--- a/misc/mbedJS/mbddJS.API/test.I2CSlave.html
+++ b/misc/mbedJS/mbddJS.API/test.I2CSlave.html
@@ -151,6 +151,7 @@ function async()
151151 function sync()
152152 {
153153 log();
154+ alert(mbedJS.I2CSlave.RxStatus.NoData);
154155 var g=function*(){
155156 try{
156157 var v;
--- a/misc/mbedJS/mbddJS.API/test.MCU.html
+++ b/misc/mbedJS/mbddJS.API/test.MCU.html
@@ -34,6 +34,7 @@ function async()
3434 log("[PASS]onGetInfo:"+v.version+","+v.platform+","+v.mcu.name+","+v.mcu.eth+","+v.memory.free);
3535 var pin=new mbedJS.DigitalIn(mcu,mbedJS.PinName.P0_22,{
3636 onNew:function(){
37+ log("...");
3738 mcu.disposeObject(pin._oid);
3839 }});
3940 },
@@ -49,7 +50,129 @@ function async()
4950 }
5051 });
5152 }
52-
53+function async2()
54+{
55+ log();
56+ log("ASYNC2");
57+ var mcu=new mbedJS.Mcu("192.168.128.39",
58+ {
59+ onNew:function(){
60+ log("[PASS]onNew");
61+ mcu.getInfo(function(v){
62+ log("[PASS]onGetInfo:"+v.version+","+v.platform+","+v.mcu.name+","+v.mcu.eth+","+v.memory.free);
63+ var pin=new mbedJS.DigitalIn(mcu,mbedJS.PinName.P0_22,function(){
64+ log("...");
65+ mcu.disposeObject(pin._oid,function(v){
66+ log("[PASS]onDisposeObject:"+v);
67+ mcu.close();
68+ });
69+ });
70+ });
71+ },
72+ onClose:function(){
73+ log("[PASS]onClose");
74+ },
75+ onError:function(){
76+ alert("Error");
77+ }
78+ });
79+}
80+function dispose1()
81+{
82+ log();
83+ log("d1");
84+ var mcu=new mbedJS.Mcu("192.168.128.39",
85+ {
86+ onNew:function(){
87+ log("[PASS]onNew");
88+ var pin=new mbedJS.DigitalIn(mcu,mbedJS.PinName.P0_22,function(){
89+ pin.dispose(function(v){
90+ log("[PASS]onDispose:"+v);
91+ mcu.close();
92+ });
93+ });
94+ },
95+ onClose:function(){
96+ log("[PASS]onClose");
97+ },
98+ onError:function(){
99+ alert("Error");
100+ }
101+ });
102+}
103+function dispose2()
104+{
105+ log();
106+ log("d1");
107+ var mcu=new mbedJS.Mcu("192.168.128.39",
108+ {
109+ onNew:function(){
110+ log("[PASS]onNew");
111+ var pin=new mbedJS.DigitalIn(mcu,mbedJS.PinName.P0_22,{
112+ onNew:function(){
113+ log("[PASS]onNew:");
114+ pin.dispose();
115+ },
116+ onDispose:function(v){
117+ log("[PASS]onDispose:"+v);
118+ mcu.close();
119+ }
120+ });
121+ },
122+ onClose:function(){
123+ log("[PASS]onClose");
124+ },
125+ onError:function(){
126+ alert("Error");
127+ }
128+ });
129+}
130+function dispose3()
131+{
132+ log();
133+ log("d3");
134+ var mcu=new mbedJS.Mcu("192.168.128.39",
135+ {
136+ onNew:function(){
137+ log("[PASS]onNew");
138+ var pin=new mbedJS.DigitalIn(mcu,mbedJS.PinName.P0_22,{
139+ onNew:function(){
140+ log("[PASS]onNew:");
141+ pin.dispose();
142+ mcu.close();
143+ }
144+ });
145+ },
146+ onClose:function(){
147+ log("[PASS]onClose");
148+ },
149+ onError:function(){
150+ alert("Error");
151+ }
152+ });
153+}
154+function dispose4()
155+{
156+ var g=function*(){
157+ try{
158+ log();
159+ var mcu=new mbedJS.Mcu("192.168.128.39",g);
160+ log(2);
161+ var v;
162+ yield mcu.waitForNew();
163+ var pin= new mbedJS.DigitalIn(mcu,mbedJS.PinName.P0_22,g);
164+ yield pin.waitForNew();
165+ v=yield pin.dispose();
166+ log("[PASS]dispose:"+v);
167+ yield mcu.close();
168+ log("[PASS]close");
169+ }catch(e){
170+ alert(e);
171+ mcu.shutdown();
172+ }
173+ }();
174+ g.next();
175+}
53176 /**
54177 * 誤った使用方法でExceptionが出た場合にシャットダウンできるかのテスト
55178 */
@@ -85,7 +208,11 @@ log(3);
85208 <h1>MCU test</h1>
86209 <hr/>
87210 <button onclick="async();">ASYNC</button>
211+<button onclick="async2();">ASYNC2</button>
88212 <button onclick="sync();">SYNC</button>
89-<button onclick="sync2();">SYNC2</button>
213+<button onclick="dispose1();">D1</button>
214+<button onclick="dispose2();">D2</button>
215+<button onclick="dispose3();">D3</button>
216+<button onclick="dispose4();">D4</button>
90217 <textarea id="console" rows="15" cols="80"></textarea>
91218 </body>
\ No newline at end of file
--- a/misc/mbedJS/mbddJS.API/test.Serial.html
+++ b/misc/mbedJS/mbddJS.API/test.Serial.html
@@ -50,7 +50,7 @@ function async()
5050 },
5151 onSend_break:function(){
5252 log("[PASS]onSend_break:");
53- uart.format(8,uart.Parity.None,1);
53+ uart.format(8,mbedJS.Serial.Parity.None,1);
5454 },
5555 onFormat:function(){
5656 log("[PASS]onForma:");
@@ -107,7 +107,7 @@ function async2()
107107 log("[PASS]onBaud:");
108108 uart.send_break(function(){
109109 log("[PASS]onSend_break:");
110- uart.format(8,uart.Parity.None,1,function(){
110+ uart.format(8,mbedJS.Serial.Parity.None,1,function(){
111111 log("[PASS]onForma:");
112112 uart.readable(function(v){
113113 log("[PASS]onReadable:"+v);
@@ -160,7 +160,7 @@ function sync()
160160 log("[PASS]onBaud:");
161161 yield uart.send_break();
162162 log("[PASS]onSend_break:");
163- yield uart.format(8,uart.Parity.None,1);
163+ yield uart.format(8,mbedJS.Serial.Parity.None,1);
164164 log("[PASS]onForma:");
165165 v=yield uart.readable();
166166 log("[PASS]onReadable:"+v);
@@ -188,7 +188,6 @@ function sync()
188188 }
189189
190190
191-
192191 </script>
193192 </head>
194193 <body>
Show on old repository browser