Skip to content

Commit c327c0d

Browse files
committed
unix: Remove test class and code.
1 parent 2c9c200 commit c327c0d

1 file changed

Lines changed: 5 additions & 50 deletions

File tree

unix/main.c

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -203,51 +203,6 @@ STATIC void do_str(const char *str) {
203203
execute_from_lexer(lex, MP_PARSE_SINGLE_INPUT, false);
204204
}
205205

206-
typedef struct _test_obj_t {
207-
mp_obj_base_t base;
208-
int value;
209-
} test_obj_t;
210-
211-
STATIC void test_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
212-
test_obj_t *self = self_in;
213-
print(env, "<test %d>", self->value);
214-
}
215-
216-
STATIC mp_obj_t test_get(mp_obj_t self_in) {
217-
test_obj_t *self = self_in;
218-
return mp_obj_new_int(self->value);
219-
}
220-
221-
STATIC mp_obj_t test_set(mp_obj_t self_in, mp_obj_t arg) {
222-
test_obj_t *self = self_in;
223-
self->value = mp_obj_get_int(arg);
224-
return mp_const_none;
225-
}
226-
227-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(test_get_obj, test_get);
228-
STATIC MP_DEFINE_CONST_FUN_OBJ_2(test_set_obj, test_set);
229-
230-
STATIC const mp_map_elem_t test_locals_dict_table[] = {
231-
{ MP_OBJ_NEW_QSTR(MP_QSTR_get), (mp_obj_t)&test_get_obj },
232-
{ MP_OBJ_NEW_QSTR(MP_QSTR_set), (mp_obj_t)&test_set_obj },
233-
};
234-
235-
STATIC MP_DEFINE_CONST_DICT(test_locals_dict, test_locals_dict_table);
236-
237-
STATIC const mp_obj_type_t test_type = {
238-
{ &mp_type_type },
239-
.name = MP_QSTR_Test,
240-
.print = test_print,
241-
.locals_dict = (mp_obj_t)&test_locals_dict,
242-
};
243-
244-
mp_obj_t test_obj_new(int value) {
245-
test_obj_t *o = m_new_obj(test_obj_t);
246-
o->base.type = &test_type;
247-
o->value = value;
248-
return o;
249-
}
250-
251206
int usage(char **argv) {
252207
printf(
253208
"usage: %s [-X <opt>] [-c <command>] [<filename>]\n"
@@ -378,7 +333,6 @@ int main(int argc, char **argv) {
378333

379334
mp_obj_list_init(mp_sys_argv, 0);
380335

381-
mp_store_name(qstr_from_str("test"), test_obj_new(42));
382336
mp_store_name(qstr_from_str("mem_info"), mp_make_function_n(0, mem_info));
383337
mp_store_name(qstr_from_str("qstr_info"), mp_make_function_n(0, qstr_info));
384338
#if MICROPY_ENABLE_GC
@@ -392,10 +346,11 @@ int main(int argc, char **argv) {
392346
// pass
393347
// test_obj = TestClass()
394348
// test_obj.attr = 42
395-
mp_obj_t test_class_type, test_class_instance;
396-
test_class_type = mp_obj_new_type(QSTR_FROM_STR_STATIC("TestClass"), mp_const_empty_tuple, mp_obj_new_dict(0));
397-
mp_store_name(QSTR_FROM_STR_STATIC("test_obj"), test_class_instance = mp_call_function_0(test_class_type));
398-
mp_store_attr(test_class_instance, QSTR_FROM_STR_STATIC("attr"), mp_obj_new_int(42));
349+
//
350+
// mp_obj_t test_class_type, test_class_instance;
351+
// test_class_type = mp_obj_new_type(QSTR_FROM_STR_STATIC("TestClass"), mp_const_empty_tuple, mp_obj_new_dict(0));
352+
// mp_store_name(QSTR_FROM_STR_STATIC("test_obj"), test_class_instance = mp_call_function_0(test_class_type));
353+
// mp_store_attr(test_class_instance, QSTR_FROM_STR_STATIC("attr"), mp_obj_new_int(42));
399354

400355
/*
401356
printf("bytes:\n");

0 commit comments

Comments
 (0)