Lines Matching defs:array
176 json_t *array, *copy;
179 array = json_loads(json_array_text, 0, NULL);
180 if(!array)
181 fail("unable to parse an array");
183 copy = json_copy(array);
185 fail("unable to copy an array");
186 if(copy == array)
187 fail("copying an array doesn't copy");
188 if(!json_equal(copy, array))
189 fail("copying an array produces an inequal copy");
193 if(json_array_get(array, i) != json_array_get(copy, i))
194 fail("copying an array modifies its elements");
197 json_decref(array);
205 json_t *array, *copy;
208 array = json_loads(json_array_text, 0, NULL);
209 if(!array)
210 fail("unable to parse an array");
212 copy = json_deep_copy(array);
214 fail("unable to deep copy an array");
215 if(copy == array)
216 fail("deep copying an array doesn't copy");
217 if(!json_equal(copy, array))
218 fail("deep copying an array produces an inequal copy");
222 if(json_array_get(array, i) == json_array_get(copy, i))
223 fail("deep copying an array doesn't copy its elements");
226 json_decref(array);