Skip to content

Commit

Permalink
Fix more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sourav Moitra <sourav.moitr@gmail.com>
  • Loading branch information
xw19 committed Dec 1, 2024
1 parent d59d158 commit 15e8100
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/ocispec/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def get_obj_arr_obj_array(obj, c_file, prefix):
c_file.append(' for (i = 0; i < len; i++)\n')
c_file.append(' {\n')
if obj.doublearray:
c_file.append(' json_t *subsubroot = json_object();\n')
c_file.append(' json_t *subsubroot = json_object();//lalala2\n')
c_file.append(" size_t j;\n")
c_file.append(f' for (j = 0; j < ptr->{obj.fixname}_item_lens[i]; j++)\n')
c_file.append(' {\n')
Expand All @@ -384,7 +384,11 @@ def get_obj_arr_obj_array(obj, c_file, prefix):
c_file.append(' }\n')
c_file.append(' stat = json_array_append(subroot, subsubroot);\n')
else:
c_file.append(f' stat = gen_{typename} (subroot, ptr->{obj.fixname}[i], err);\n')
c_file.append(f' json_t *obj = json_object();\n')
c_file.append(f' stat = gen_{typename} (obj, ptr->{obj.fixname}[i], err);\n')
c_file.append(" if (stat != JSON_GEN_SUCCESS)\n")
c_file.append(" GEN_SET_ERROR_AND_RETURN (stat, err);\n")
c_file.append(" stat = json_array_append(subroot, obj);\n")
c_file.append(" if (stat != JSON_GEN_SUCCESS)\n")
c_file.append(" GEN_SET_ERROR_AND_RETURN (stat, err);\n")
c_file.append(' }\n')
Expand Down

0 comments on commit 15e8100

Please sign in to comment.