rice 1.7.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Doxyfile +1 -1
- data/Makefile.in +29 -18
- data/README +59 -129
- data/aclocal.m4 +32 -29
- data/config.guess +103 -217
- data/config.sub +42 -25
- data/configure +10 -14
- data/depcomp +3 -2
- data/extconf.rb +39 -21
- data/install-sh +170 -196
- data/missing +3 -3
- data/rice/Makefile.am +0 -5
- data/rice/Makefile.in +21 -15
- data/rice/detail/env.hpp +0 -8
- data/rice/detail/method_data.cpp +0 -20
- data/rice/detail/ruby.hpp +0 -13
- data/rice/detail/ruby_version_code.hpp +1 -1
- data/ruby.ac +3 -8
- data/ruby/Makefile.in +17 -5
- data/ruby/lib/Makefile.in +17 -6
- data/ruby/lib/mkmf-rice.rb.in +9 -13
- data/ruby/lib/version.rb +1 -1
- data/sample/Makefile.am +4 -4
- data/sample/Makefile.in +21 -9
- data/test/Makefile.am +2 -7
- data/test/Makefile.in +32 -41
- data/test/ext/Makefile.am +12 -14
- data/test/ext/Makefile.in +29 -19
- data/test/test_To_From_Ruby.cpp +6 -0
- data/test/test_rice.rb +0 -4
- metadata +3 -12
- data/rice/Critical_Guard.hpp +0 -40
- data/rice/Critical_Guard.ipp +0 -26
- data/rice/VM.cpp +0 -82
- data/rice/VM.hpp +0 -32
- data/rice/detail/mininode.cpp +0 -1220
- data/rice/detail/mininode.hpp +0 -320
- data/rice/detail/rubysig.hpp +0 -19
- data/test/test_Critical_Guard.cpp +0 -51
- data/test/test_VM.cpp +0 -26
data/rice/detail/mininode.hpp
DELETED
@@ -1,320 +0,0 @@
|
|
1
|
-
#ifndef Rice__detail__mininode__hpp
|
2
|
-
#define Rice__detail__mininode__hpp
|
3
|
-
|
4
|
-
#include "ruby.hpp"
|
5
|
-
|
6
|
-
// TODO: This is silly, autoconf...
|
7
|
-
#undef PACKAGE_NAME
|
8
|
-
#undef PACKAGE_STRING
|
9
|
-
#undef PACKAGE_TARNAME
|
10
|
-
#undef PACKAGE_VERSION
|
11
|
-
|
12
|
-
#include "../config.hpp"
|
13
|
-
|
14
|
-
// TODO: This is silly, autoconf...
|
15
|
-
#undef PACKAGE_NAME
|
16
|
-
#undef PACKAGE_STRING
|
17
|
-
#undef PACKAGE_TARNAME
|
18
|
-
#undef PACKAGE_VERSION
|
19
|
-
|
20
|
-
#if !defined(HAVE_NODE_H) && !defined(REALLY_HAVE_RUBY_NODE_H)
|
21
|
-
|
22
|
-
namespace Rice
|
23
|
-
{
|
24
|
-
|
25
|
-
namespace detail
|
26
|
-
{
|
27
|
-
|
28
|
-
namespace Mininode
|
29
|
-
{
|
30
|
-
|
31
|
-
typedef struct RNode {
|
32
|
-
unsigned long flags;
|
33
|
-
void * reserved;
|
34
|
-
union {
|
35
|
-
struct RNode * node;
|
36
|
-
VALUE (*cfunc)(ANYARGS);
|
37
|
-
} u1;
|
38
|
-
union {
|
39
|
-
struct RNode * node;
|
40
|
-
VALUE value;
|
41
|
-
} u2;
|
42
|
-
union {
|
43
|
-
struct RNode * node;
|
44
|
-
} u3;
|
45
|
-
} NODE;
|
46
|
-
|
47
|
-
#define nd_cfnc u1.cfunc
|
48
|
-
#define nd_rval u2.value
|
49
|
-
|
50
|
-
/* TODO: No way to know the correct size of node_type */
|
51
|
-
enum node_type {
|
52
|
-
NODE_FOO,
|
53
|
-
};
|
54
|
-
|
55
|
-
extern "C"
|
56
|
-
void rb_add_method(VALUE, ID, NODE *, int);
|
57
|
-
|
58
|
-
extern "C"
|
59
|
-
NODE *rb_node_newnode(enum node_type, VALUE, VALUE, VALUE);
|
60
|
-
|
61
|
-
template<typename T, typename A0, typename A1, typename A2>
|
62
|
-
inline NODE * NEW_NODE(T t, A0 a0, A1 a1, A2 a2)
|
63
|
-
{
|
64
|
-
return rb_node_newnode((node_type)t, (VALUE)a0, (VALUE)a1, (VALUE)a2);
|
65
|
-
}
|
66
|
-
|
67
|
-
#define NODE_METHOD Rice::detail::Mininode::get_NODE_METHOD()
|
68
|
-
#define NODE_FBODY Rice::detail::Mininode::get_NODE_FBODY()
|
69
|
-
#define NODE_CFUNC Rice::detail::Mininode::get_NODE_CFUNC()
|
70
|
-
#define NODE_SCOPE Rice::detail::Mininode::get_NODE_SCOPE()
|
71
|
-
#define NODE_BLOCK Rice::detail::Mininode::get_NODE_BLOCK()
|
72
|
-
#define NODE_IF Rice::detail::Mininode::get_NODE_IF()
|
73
|
-
#define NODE_CASE Rice::detail::Mininode::get_NODE_CASE()
|
74
|
-
#define NODE_WHEN Rice::detail::Mininode::get_NODE_WHEN()
|
75
|
-
#define NODE_OPT_N Rice::detail::Mininode::get_NODE_OPT_N()
|
76
|
-
#define NODE_WHILE Rice::detail::Mininode::get_NODE_WHILE()
|
77
|
-
#define NODE_UNTIL Rice::detail::Mininode::get_NODE_UNTIL()
|
78
|
-
#define NODE_ITER Rice::detail::Mininode::get_NODE_ITER()
|
79
|
-
#define NODE_FOR Rice::detail::Mininode::get_NODE_FOR()
|
80
|
-
#define NODE_BREAK Rice::detail::Mininode::get_NODE_BREAK()
|
81
|
-
#define NODE_NEXT Rice::detail::Mininode::get_NODE_NEXT()
|
82
|
-
#define NODE_REDO Rice::detail::Mininode::get_NODE_REDO()
|
83
|
-
#define NODE_RETRY Rice::detail::Mininode::get_NODE_RETRY()
|
84
|
-
#define NODE_BEGIN Rice::detail::Mininode::get_NODE_BEGIN()
|
85
|
-
#define NODE_RESCUE Rice::detail::Mininode::get_NODE_RESCUE()
|
86
|
-
#define NODE_RESBODY Rice::detail::Mininode::get_NODE_RESBODY()
|
87
|
-
#define NODE_ENSURE Rice::detail::Mininode::get_NODE_ENSURE()
|
88
|
-
#define NODE_AND Rice::detail::Mininode::get_NODE_AND()
|
89
|
-
#define NODE_OR Rice::detail::Mininode::get_NODE_OR()
|
90
|
-
#define NODE_MASGN Rice::detail::Mininode::get_NODE_MASGN()
|
91
|
-
#define NODE_LASGN Rice::detail::Mininode::get_NODE_LASGN()
|
92
|
-
#define NODE_DASGN Rice::detail::Mininode::get_NODE_DASGN()
|
93
|
-
#define NODE_DASGN_CURR Rice::detail::Mininode::get_NODE_DASGN_CURR()
|
94
|
-
#define NODE_GASGN Rice::detail::Mininode::get_NODE_GASGN()
|
95
|
-
#define NODE_IASGN Rice::detail::Mininode::get_NODE_IASGN()
|
96
|
-
#define NODE_IASGN2 Rice::detail::Mininode::get_NODE_IASGN2()
|
97
|
-
#define NODE_CDECL Rice::detail::Mininode::get_NODE_CDECL()
|
98
|
-
#define NODE_CVDECL Rice::detail::Mininode::get_NODE_CVDECL()
|
99
|
-
#define NODE_OP_ASGN1 Rice::detail::Mininode::get_NODE_OP_ASGN1()
|
100
|
-
#define NODE_OP_ASGN2 Rice::detail::Mininode::get_NODE_OP_ASGN2()
|
101
|
-
#define NODE_OP_ASGN_AND Rice::detail::Mininode::get_NODE_OP_ASGN_AND()
|
102
|
-
#define NODE_OP_ASGN_OR Rice::detail::Mininode::get_NODE_OP_ASGN_OR()
|
103
|
-
#define NODE_CALL Rice::detail::Mininode::get_NODE_CALL()
|
104
|
-
#define NODE_FCALL Rice::detail::Mininode::get_NODE_FCALL()
|
105
|
-
#define NODE_VCALL Rice::detail::Mininode::get_NODE_VCALL()
|
106
|
-
#define NODE_SUPER Rice::detail::Mininode::get_NODE_SUPER()
|
107
|
-
#define NODE_ZSUPER Rice::detail::Mininode::get_NODE_ZSUPER()
|
108
|
-
#define NODE_ARRAY Rice::detail::Mininode::get_NODE_ARRAY()
|
109
|
-
#define NODE_ZARRAY Rice::detail::Mininode::get_NODE_ZARRAY()
|
110
|
-
#define NODE_VALUES Rice::detail::Mininode::get_NODE_VALUES()
|
111
|
-
#define NODE_HASH Rice::detail::Mininode::get_NODE_HASH()
|
112
|
-
#define NODE_RETURN Rice::detail::Mininode::get_NODE_RETURN()
|
113
|
-
#define NODE_YIELD Rice::detail::Mininode::get_NODE_YIELD()
|
114
|
-
#define NODE_LVAR Rice::detail::Mininode::get_NODE_LVAR()
|
115
|
-
#define NODE_DVAR Rice::detail::Mininode::get_NODE_DVAR()
|
116
|
-
#define NODE_GVAR Rice::detail::Mininode::get_NODE_GVAR()
|
117
|
-
#define NODE_IVAR Rice::detail::Mininode::get_NODE_IVAR()
|
118
|
-
#define NODE_CONST Rice::detail::Mininode::get_NODE_CONST()
|
119
|
-
#define NODE_CVAR Rice::detail::Mininode::get_NODE_CVAR()
|
120
|
-
#define NODE_NTH_REF Rice::detail::Mininode::get_NODE_NTH_REF()
|
121
|
-
#define NODE_BACK_REF Rice::detail::Mininode::get_NODE_BACK_REF()
|
122
|
-
#define NODE_MATCH Rice::detail::Mininode::get_NODE_MATCH()
|
123
|
-
#define NODE_MATCH2 Rice::detail::Mininode::get_NODE_MATCH2()
|
124
|
-
#define NODE_MATCH3 Rice::detail::Mininode::get_NODE_MATCH3()
|
125
|
-
#define NODE_LIT Rice::detail::Mininode::get_NODE_LIT()
|
126
|
-
#define NODE_STR Rice::detail::Mininode::get_NODE_STR()
|
127
|
-
#define NODE_DSTR Rice::detail::Mininode::get_NODE_DSTR()
|
128
|
-
#define NODE_XSTR Rice::detail::Mininode::get_NODE_XSTR()
|
129
|
-
#define NODE_DXSTR Rice::detail::Mininode::get_NODE_DXSTR()
|
130
|
-
#define NODE_EVSTR Rice::detail::Mininode::get_NODE_EVSTR()
|
131
|
-
#define NODE_DREGX Rice::detail::Mininode::get_NODE_DREGX()
|
132
|
-
#define NODE_DREGX_ONCE Rice::detail::Mininode::get_NODE_DREGX_ONCE()
|
133
|
-
#define NODE_ARGS Rice::detail::Mininode::get_NODE_ARGS()
|
134
|
-
#define NODE_ARGS_AUX Rice::detail::Mininode::get_NODE_ARGS_AUX()
|
135
|
-
#define NODE_OPT_ARG Rice::detail::Mininode::get_NODE_OPT_ARG()
|
136
|
-
#define NODE_POSTARG Rice::detail::Mininode::get_NODE_POSTARG()
|
137
|
-
#define NODE_ARGSCAT Rice::detail::Mininode::get_NODE_ARGSCAT()
|
138
|
-
#define NODE_ARGSPUSH Rice::detail::Mininode::get_NODE_ARGSPUSH()
|
139
|
-
#define NODE_SPLAT Rice::detail::Mininode::get_NODE_SPLAT()
|
140
|
-
#define NODE_TO_ARY Rice::detail::Mininode::get_NODE_TO_ARY()
|
141
|
-
#define NODE_BLOCK_ARG Rice::detail::Mininode::get_NODE_BLOCK_ARG()
|
142
|
-
#define NODE_BLOCK_PASS Rice::detail::Mininode::get_NODE_BLOCK_PASS()
|
143
|
-
#define NODE_DEFN Rice::detail::Mininode::get_NODE_DEFN()
|
144
|
-
#define NODE_ALIAS Rice::detail::Mininode::get_NODE_ALIAS()
|
145
|
-
#define NODE_VALIAS Rice::detail::Mininode::get_NODE_VALIAS()
|
146
|
-
#define NODE_UNDEF Rice::detail::Mininode::get_NODE_UNDEF()
|
147
|
-
#define NODE_CLASS Rice::detail::Mininode::get_NODE_CLASS()
|
148
|
-
#define NODE_MODULE Rice::detail::Mininode::get_NODE_MODULE()
|
149
|
-
#define NODE_SCLASS Rice::detail::Mininode::get_NODE_SCLASS()
|
150
|
-
#define NODE_COLON2 Rice::detail::Mininode::get_NODE_COLON2()
|
151
|
-
#define NODE_COLON3 Rice::detail::Mininode::get_NODE_COLON3()
|
152
|
-
#define NODE_DOT2 Rice::detail::Mininode::get_NODE_DOT2()
|
153
|
-
#define NODE_DOT3 Rice::detail::Mininode::get_NODE_DOT3()
|
154
|
-
#define NODE_FLIP2 Rice::detail::Mininode::get_NODE_FLIP2()
|
155
|
-
#define NODE_FLIP3 Rice::detail::Mininode::get_NODE_FLIP3()
|
156
|
-
#define NODE_ATTRSET Rice::detail::Mininode::get_NODE_ATTRSET()
|
157
|
-
#define NODE_SELF Rice::detail::Mininode::get_NODE_SELF()
|
158
|
-
#define NODE_NIL Rice::detail::Mininode::get_NODE_NIL()
|
159
|
-
#define NODE_TRUE Rice::detail::Mininode::get_NODE_TRUE()
|
160
|
-
#define NODE_FALSE Rice::detail::Mininode::get_NODE_FALSE()
|
161
|
-
#define NODE_ERRINFO Rice::detail::Mininode::get_NODE_ERRINFO()
|
162
|
-
#define NODE_DEFINED Rice::detail::Mininode::get_NODE_DEFINED()
|
163
|
-
#define NODE_POSTEXE Rice::detail::Mininode::get_NODE_POSTEXE()
|
164
|
-
#define NODE_ALLOCA Rice::detail::Mininode::get_NODE_ALLOCA()
|
165
|
-
#define NODE_BMETHOD Rice::detail::Mininode::get_NODE_BMETHOD()
|
166
|
-
#define NODE_MEMO Rice::detail::Mininode::get_NODE_MEMO()
|
167
|
-
#define NODE_IFUNC Rice::detail::Mininode::get_NODE_IFUNC()
|
168
|
-
#define NODE_DSYM Rice::detail::Mininode::get_NODE_DSYM()
|
169
|
-
#define NODE_ATTRASGN Rice::detail::Mininode::get_NODE_ATTRASGN()
|
170
|
-
#define NODE_PRELUDE Rice::detail::Mininode::get_NODE_PRELUDE()
|
171
|
-
#define NODE_LAMBDA Rice::detail::Mininode::get_NODE_LAMBDA()
|
172
|
-
#define NODE_OPTBLOCK Rice::detail::Mininode::get_NODE_OPTBLOCK()
|
173
|
-
#define NODE_LAST Rice::detail::Mininode::get_NODE_LAST()
|
174
|
-
|
175
|
-
int get_NODE_METHOD();
|
176
|
-
int get_NODE_FBODY();
|
177
|
-
int get_NODE_CFUNC();
|
178
|
-
int get_NODE_SCOPE();
|
179
|
-
int get_NODE_BLOCK();
|
180
|
-
int get_NODE_IF();
|
181
|
-
int get_NODE_CASE();
|
182
|
-
int get_NODE_WHEN();
|
183
|
-
int get_NODE_OPT_N();
|
184
|
-
int get_NODE_WHILE();
|
185
|
-
int get_NODE_UNTIL();
|
186
|
-
int get_NODE_ITER();
|
187
|
-
int get_NODE_FOR();
|
188
|
-
int get_NODE_BREAK();
|
189
|
-
int get_NODE_NEXT();
|
190
|
-
int get_NODE_REDO();
|
191
|
-
int get_NODE_RETRY();
|
192
|
-
int get_NODE_BEGIN();
|
193
|
-
int get_NODE_RESCUE();
|
194
|
-
int get_NODE_RESBODY();
|
195
|
-
int get_NODE_ENSURE();
|
196
|
-
int get_NODE_AND();
|
197
|
-
int get_NODE_OR();
|
198
|
-
int get_NODE_MASGN();
|
199
|
-
int get_NODE_LASGN();
|
200
|
-
int get_NODE_DASGN();
|
201
|
-
int get_NODE_DASGN_CURR();
|
202
|
-
int get_NODE_GASGN();
|
203
|
-
int get_NODE_IASGN();
|
204
|
-
int get_NODE_IASGN2();
|
205
|
-
int get_NODE_CDECL();
|
206
|
-
int get_NODE_CVDECL();
|
207
|
-
int get_NODE_OP_ASGN1();
|
208
|
-
int get_NODE_OP_ASGN2();
|
209
|
-
int get_NODE_OP_ASGN_AND();
|
210
|
-
int get_NODE_OP_ASGN_OR();
|
211
|
-
int get_NODE_CALL();
|
212
|
-
int get_NODE_FCALL();
|
213
|
-
int get_NODE_VCALL();
|
214
|
-
int get_NODE_SUPER();
|
215
|
-
int get_NODE_ZSUPER();
|
216
|
-
int get_NODE_ARRAY();
|
217
|
-
int get_NODE_ZARRAY();
|
218
|
-
int get_NODE_VALUES();
|
219
|
-
int get_NODE_HASH();
|
220
|
-
int get_NODE_RETURN();
|
221
|
-
int get_NODE_YIELD();
|
222
|
-
int get_NODE_LVAR();
|
223
|
-
int get_NODE_DVAR();
|
224
|
-
int get_NODE_GVAR();
|
225
|
-
int get_NODE_IVAR();
|
226
|
-
int get_NODE_CONST();
|
227
|
-
int get_NODE_CVAR();
|
228
|
-
int get_NODE_NTH_REF();
|
229
|
-
int get_NODE_BACK_REF();
|
230
|
-
int get_NODE_MATCH();
|
231
|
-
int get_NODE_MATCH2();
|
232
|
-
int get_NODE_MATCH3();
|
233
|
-
int get_NODE_LIT();
|
234
|
-
int get_NODE_STR();
|
235
|
-
int get_NODE_DSTR();
|
236
|
-
int get_NODE_XSTR();
|
237
|
-
int get_NODE_DXSTR();
|
238
|
-
int get_NODE_EVSTR();
|
239
|
-
int get_NODE_DREGX();
|
240
|
-
int get_NODE_DREGX_ONCE();
|
241
|
-
int get_NODE_ARGS();
|
242
|
-
int get_NODE_ARGS_AUX();
|
243
|
-
int get_NODE_OPT_ARG();
|
244
|
-
int get_NODE_POSTARG();
|
245
|
-
int get_NODE_ARGSCAT();
|
246
|
-
int get_NODE_ARGSPUSH();
|
247
|
-
int get_NODE_SPLAT();
|
248
|
-
int get_NODE_TO_ARY();
|
249
|
-
int get_NODE_BLOCK_ARG();
|
250
|
-
int get_NODE_BLOCK_PASS();
|
251
|
-
int get_NODE_DEFN();
|
252
|
-
int get_NODE_ALIAS();
|
253
|
-
int get_NODE_VALIAS();
|
254
|
-
int get_NODE_UNDEF();
|
255
|
-
int get_NODE_CLASS();
|
256
|
-
int get_NODE_MODULE();
|
257
|
-
int get_NODE_SCLASS();
|
258
|
-
int get_NODE_COLON2();
|
259
|
-
int get_NODE_COLON3();
|
260
|
-
int get_NODE_DOT2();
|
261
|
-
int get_NODE_DOT3();
|
262
|
-
int get_NODE_FLIP2();
|
263
|
-
int get_NODE_FLIP3();
|
264
|
-
int get_NODE_ATTRSET();
|
265
|
-
int get_NODE_SELF();
|
266
|
-
int get_NODE_NIL();
|
267
|
-
int get_NODE_TRUE();
|
268
|
-
int get_NODE_FALSE();
|
269
|
-
int get_NODE_ERRINFO();
|
270
|
-
int get_NODE_DEFINED();
|
271
|
-
int get_NODE_POSTEXE();
|
272
|
-
int get_NODE_ALLOCA();
|
273
|
-
int get_NODE_BMETHOD();
|
274
|
-
int get_NODE_MEMO();
|
275
|
-
int get_NODE_IFUNC();
|
276
|
-
int get_NODE_DSYM();
|
277
|
-
int get_NODE_ATTRASGN();
|
278
|
-
int get_NODE_PRELUDE();
|
279
|
-
int get_NODE_LAMBDA();
|
280
|
-
int get_NODE_OPTBLOCK();
|
281
|
-
int get_NODE_LAST();
|
282
|
-
|
283
|
-
static const int NOEX_PUBLIC = 0x0;
|
284
|
-
|
285
|
-
inline NODE * NEW_METHOD(NODE * body, VALUE origin, int noex)
|
286
|
-
{
|
287
|
-
return NEW_NODE(NODE_METHOD, origin, body, noex);
|
288
|
-
}
|
289
|
-
|
290
|
-
#ifdef RUBY_VM
|
291
|
-
|
292
|
-
inline NODE * NEW_FBODY(NODE * body, ID id)
|
293
|
-
{
|
294
|
-
return NEW_NODE(NODE_FBODY, id, body, 0);
|
295
|
-
}
|
296
|
-
|
297
|
-
#else
|
298
|
-
|
299
|
-
inline NODE * NEW_FBODY(NODE * body, ID id, VALUE origin)
|
300
|
-
{
|
301
|
-
return NEW_NODE(NODE_FBODY, body, id, origin);
|
302
|
-
}
|
303
|
-
|
304
|
-
#endif // RUBY_VM
|
305
|
-
|
306
|
-
inline NODE * NEW_CFUNC(RUBY_METHOD_FUNC cfunc, int arity)
|
307
|
-
{
|
308
|
-
return NEW_NODE(NODE_CFUNC, cfunc, arity, 0);
|
309
|
-
}
|
310
|
-
|
311
|
-
} // namespace Mininode
|
312
|
-
|
313
|
-
} // namespace detail
|
314
|
-
|
315
|
-
} // namespace Rice
|
316
|
-
|
317
|
-
#endif
|
318
|
-
|
319
|
-
#endif // Rice__detail__mininode__hpp
|
320
|
-
|
data/rice/detail/rubysig.hpp
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
#ifndef Rice__detail__rubysig__hpp_
|
2
|
-
#define Rice__detail__rubysig__hpp_
|
3
|
-
|
4
|
-
#include "ruby_version_code.hpp"
|
5
|
-
|
6
|
-
/**
|
7
|
-
* Helper header for the rubysig.h ruby include file, which does
|
8
|
-
* not have extern "C"
|
9
|
-
*/
|
10
|
-
|
11
|
-
#if RICE__RUBY_VERSION_CODE < 190
|
12
|
-
|
13
|
-
extern "C" {
|
14
|
-
#include "rubysig.h"
|
15
|
-
}
|
16
|
-
|
17
|
-
#endif
|
18
|
-
|
19
|
-
#endif
|
@@ -1,51 +0,0 @@
|
|
1
|
-
#include "unittest.hpp"
|
2
|
-
#include "rice/Critical_Guard.hpp"
|
3
|
-
#include <stdexcept>
|
4
|
-
|
5
|
-
#if RICE__RUBY_VERSION_CODE < 190
|
6
|
-
|
7
|
-
using namespace Rice;
|
8
|
-
|
9
|
-
TESTSUITE(Critical_Guard);
|
10
|
-
|
11
|
-
SETUP(Critical_Guard)
|
12
|
-
{
|
13
|
-
ruby_init();
|
14
|
-
}
|
15
|
-
|
16
|
-
TESTCASE(normal_path)
|
17
|
-
{
|
18
|
-
rb_thread_critical = 1;
|
19
|
-
{
|
20
|
-
Critical_Guard g;
|
21
|
-
ASSERT(rb_thread_critical);
|
22
|
-
}
|
23
|
-
ASSERT(!rb_thread_critical);
|
24
|
-
}
|
25
|
-
|
26
|
-
TESTCASE(unset_thread_critical_on_destruction)
|
27
|
-
{
|
28
|
-
rb_thread_critical = 1;
|
29
|
-
{
|
30
|
-
Critical_Guard g;
|
31
|
-
ASSERT(rb_thread_critical);
|
32
|
-
}
|
33
|
-
ASSERT(!rb_thread_critical);
|
34
|
-
}
|
35
|
-
|
36
|
-
TESTCASE(exception)
|
37
|
-
{
|
38
|
-
rb_thread_critical = 1;
|
39
|
-
try
|
40
|
-
{
|
41
|
-
Critical_Guard g;
|
42
|
-
throw std::runtime_error("testing");
|
43
|
-
}
|
44
|
-
catch(...)
|
45
|
-
{
|
46
|
-
}
|
47
|
-
ASSERT(!rb_thread_critical);
|
48
|
-
}
|
49
|
-
|
50
|
-
#endif
|
51
|
-
|
data/test/test_VM.cpp
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#include "unittest.hpp"
|
2
|
-
#include "rice/VM.hpp"
|
3
|
-
#include "rice/Object.hpp"
|
4
|
-
#include <memory>
|
5
|
-
|
6
|
-
using namespace Rice;
|
7
|
-
|
8
|
-
std_unique_ptr<VM> vm;
|
9
|
-
|
10
|
-
TESTSUITE(VM);
|
11
|
-
|
12
|
-
SETUP(VM)
|
13
|
-
{
|
14
|
-
std::vector<const char *> args;
|
15
|
-
args.push_back("test_VM");
|
16
|
-
args.push_back("-e");
|
17
|
-
args.push_back("puts \"HELLO\"");
|
18
|
-
vm.reset(new VM(args));
|
19
|
-
}
|
20
|
-
|
21
|
-
TESTCASE(create_object)
|
22
|
-
{
|
23
|
-
Object o;
|
24
|
-
o.call("to_s");
|
25
|
-
}
|
26
|
-
|