mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
byteCodePrint is ok
This commit is contained in:
parent
eb35a8c536
commit
d83265d345
@ -2132,8 +2132,7 @@ TEST(asmer, asmer_to_instructUnit) {
|
||||
ByteCodeFrame bytecode_frame;
|
||||
byteCodeFrame_init(&bytecode_frame);
|
||||
byteCodeFrame_appendFromAsm(&bytecode_frame, asm_line);
|
||||
constPool_print(&(bytecode_frame.const_pool));
|
||||
instructArray_print(&(bytecode_frame.instruct_array));
|
||||
byteCodeFrame_print(&bytecode_frame);
|
||||
size_t byteCode_size = byteCodeFrame_getSize(&bytecode_frame);
|
||||
EXPECT_EQ(byteCode_size, 33);
|
||||
EXPECT_STREQ(constPool_getNext(&(bytecode_frame.const_pool)), (char*)"2");
|
||||
|
@ -997,6 +997,11 @@ exit:
|
||||
return;
|
||||
}
|
||||
|
||||
size_t byteCodeFrame_getSize(ByteCodeFrame* bf){
|
||||
size_t byteCodeFrame_getSize(ByteCodeFrame* bf) {
|
||||
return bf->const_pool.size + bf->instruct_array.size;
|
||||
}
|
||||
|
||||
void byteCodeFrame_print(ByteCodeFrame* self) {
|
||||
constPool_print(&(self->const_pool));
|
||||
instructArray_print(&(self->instruct_array));
|
||||
}
|
||||
|
@ -138,5 +138,6 @@ void instructArray_append(InstructArray* ins_array, InstructUnit* ins_unit);
|
||||
void instructUnit_init(InstructUnit* ins_unit);
|
||||
void instructUnit_print(InstructUnit* self);
|
||||
void instructArray_print(InstructArray* self);
|
||||
void byteCodeFrame_print(ByteCodeFrame* self);
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user