Skip to content

Commit

Permalink
Add dict test
Browse files Browse the repository at this point in the history
  • Loading branch information
Du Toit Spies committed Nov 27, 2023
1 parent d679e66 commit a203a9e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hpy/debug/src/autogen_debug_ctx_init.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hpy/devel/include/hpy/cpython/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@ HPyAPI_FUNC HPyContext * _HPyGetContext(void) {
ctx->h_UnicodeType = _py2h((PyObject *)&PyUnicode_Type);
ctx->h_TupleType = _py2h((PyObject *)&PyTuple_Type);
ctx->h_ListType = _py2h((PyObject *)&PyList_Type);
ctx->h_DictType = _py2h((PyObject *)&PyDict_Type);
ctx->h_ComplexType = _py2h((PyObject *)&PyComplex_Type);
ctx->h_BytesType = _py2h((PyObject *)&PyBytes_Type);
ctx->h_MemoryViewType = _py2h((PyObject *)&PyMemoryView_Type);
ctx->h_CapsuleType = _py2h((PyObject *)&PyCapsule_Type);
ctx->h_SliceType = _py2h((PyObject *)&PySlice_Type);
ctx->h_DictType = _py2h((PyObject *)&PyDict_Type);
/* Reflection */
ctx->h_Builtins = _py2h(PyEval_GetBuiltins());
}
Expand Down
2 changes: 1 addition & 1 deletion hpy/tools/autogen/public_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ HPy_ID(73) HPy h_FloatType; /* built-in 'float' */
HPy_ID(74) HPy h_UnicodeType; /* built-in 'str' */
HPy_ID(75) HPy h_TupleType; /* built-in 'tuple' */
HPy_ID(76) HPy h_ListType; /* built-in 'list' */
HPy_ID(263) HPy h_DictType; /* built-in 'dict' */
HPy_ID(238) HPy h_ComplexType; /* built-in 'complex' */
HPy_ID(239) HPy h_BytesType; /* built-in 'bytes' */
HPy_ID(240) HPy h_MemoryViewType; /* built-in 'memoryview' */
HPy_ID(241) HPy h_CapsuleType; /* built-in 'capsule' */
HPy_ID(242) HPy h_SliceType; /* built-in 'slice' */
HPy_ID(263) HPy h_DictType; /* built-in 'dict' */

/* Reflection */
HPy_ID(243) HPy h_Builtins; /* dict of builtins */
Expand Down
2 changes: 1 addition & 1 deletion hpy/trace/src/autogen_trace_ctx_init.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion hpy/universal/src/hpymodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,12 +671,12 @@ static void init_universal_ctx(HPyContext *ctx)
ctx->h_UnicodeType = _py2h((PyObject *)&PyUnicode_Type);
ctx->h_TupleType = _py2h((PyObject *)&PyTuple_Type);
ctx->h_ListType = _py2h((PyObject *)&PyList_Type);
ctx->h_DictType = _py2h((PyObject *)&PyDict_Type);
ctx->h_ComplexType = _py2h((PyObject *)&PyComplex_Type);
ctx->h_BytesType = _py2h((PyObject *)&PyBytes_Type);
ctx->h_MemoryViewType = _py2h((PyObject *)&PyMemoryView_Type);
ctx->h_CapsuleType = _py2h((PyObject *)&PyCapsule_Type);
ctx->h_SliceType = _py2h((PyObject *)&PySlice_Type);
ctx->h_DictType = _py2h((PyObject *)&PyDict_Type);
/* Reflection */
ctx->h_Builtins = _py2h(PyEval_GetBuiltins());
}
Expand Down
3 changes: 2 additions & 1 deletion test/test_00_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def test_builtin_handles(self):
case 20: h = ctx->h_MemoryViewType; break;
case 21: h = ctx->h_SliceType; break;
case 22: h = ctx->h_Builtins; break;
case 23: h = ctx->h_DictType; break;
case 2048: h = ctx->h_CapsuleType; break;
default:
HPyErr_SetString(ctx, ctx->h_ValueError, "invalid choice");
Expand All @@ -278,7 +279,7 @@ def test_builtin_handles(self):
'<NULL>', None, False, True, ValueError, TypeError, IndexError,
SystemError, object, type, bool, int, float, str, tuple, list,
NotImplemented, Ellipsis, complex, bytes, memoryview, slice,
builtins.__dict__
builtins.__dict__, dict
)
for i, obj in enumerate(builtin_objs):
if i == 0:
Expand Down

0 comments on commit a203a9e

Please sign in to comment.