Lines Matching refs:unittest
35 #define unittest(result, fmt, ...) ({ \ macro
53 unittest(np && !strcmp("/testcase-data", np->full_name), in of_unittest_find_node_by_name()
59 unittest(!np, "trailing '/' on /testcase-data/ should fail\n"); in of_unittest_find_node_by_name()
62 unittest(np && !strcmp("/testcase-data/phandle-tests/consumer-a", np->full_name), in of_unittest_find_node_by_name()
67 unittest(np && !strcmp("/testcase-data", np->full_name), in of_unittest_find_node_by_name()
73 unittest(!np, "trailing '/' on testcase-alias/ should fail\n"); in of_unittest_find_node_by_name()
76 unittest(np && !strcmp("/testcase-data/phandle-tests/consumer-a", np->full_name), in of_unittest_find_node_by_name()
81 unittest(!np, "non-existent path returned node %s\n", np->full_name); in of_unittest_find_node_by_name()
85 unittest(!np, "non-existent alias returned node %s\n", np->full_name); in of_unittest_find_node_by_name()
89 unittest(!np, "non-existent alias with relative path returned node %s\n", np->full_name); in of_unittest_find_node_by_name()
93 unittest(np && !strcmp("testoption", options), in of_unittest_find_node_by_name()
98 unittest(np && !strcmp("test/option", options), in of_unittest_find_node_by_name()
103 unittest(np && !strcmp("test/option", options), in of_unittest_find_node_by_name()
108 unittest(np, "NULL option path test failed\n"); in of_unittest_find_node_by_name()
113 unittest(np && !strcmp("testaliasoption", options), in of_unittest_find_node_by_name()
119 unittest(np && !strcmp("test/alias/option", options), in of_unittest_find_node_by_name()
124 unittest(np, "NULL option alias path test failed\n"); in of_unittest_find_node_by_name()
129 unittest(np && !options, "option clearing test failed\n"); in of_unittest_find_node_by_name()
134 unittest(np && !options, "option clearing root node test failed\n"); in of_unittest_find_node_by_name()
152 unittest(0, "kzalloc() failed\n"); in of_unittest_dynamic()
160 unittest(of_add_property(np, prop) == 0, "Adding a new property failed\n"); in of_unittest_dynamic()
167 unittest(of_add_property(np, prop) != 0, in of_unittest_dynamic()
173 unittest(of_update_property(np, prop) == 0, in of_unittest_dynamic()
181 unittest(of_update_property(np, prop) == 0, in of_unittest_dynamic()
185 unittest(of_remove_property(np, prop) == 0, in of_unittest_dynamic()
193 unittest(prop->value != NULL, "Unable to allocate large buffer\n"); in of_unittest_dynamic()
195 unittest(of_add_property(np, prop) == 0, in of_unittest_dynamic()
236 unittest(child_count > 0, "Device node data structure is corrupted\n"); in of_unittest_check_tree_linkage()
237 unittest(child_count == allnode_count, in of_unittest_check_tree_linkage()
277 unittest(dup_count == 0, "Found %i duplicates in %i phandles\n", in of_unittest_check_phandles()
300 unittest(rc == 7, "of_count_phandle_with_args() returned %i, expected 7\n", rc); in of_unittest_parse_phandle_with_args()
353 unittest(passed, "index %i - data error on node %s rc=%i\n", in of_unittest_parse_phandle_with_args()
360 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc); in of_unittest_parse_phandle_with_args()
363 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc); in of_unittest_parse_phandle_with_args()
368 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
371 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
376 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
379 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
384 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
387 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
403 unittest(rc == 0, "first expected:0 got:%i\n", rc); in of_unittest_property_string()
405 unittest(rc == 1, "second expected:1 got:%i\n", rc); in of_unittest_property_string()
407 unittest(rc == 2, "third expected:2 got:%i\n", rc); in of_unittest_property_string()
409 unittest(rc == -ENODATA, "unmatched string; rc=%i\n", rc); in of_unittest_property_string()
411 unittest(rc == -EINVAL, "missing property; rc=%i\n", rc); in of_unittest_property_string()
413 unittest(rc == -ENODATA, "empty property; rc=%i\n", rc); in of_unittest_property_string()
415 unittest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc); in of_unittest_property_string()
419 unittest(rc == 1, "Incorrect string count; rc=%i\n", rc); in of_unittest_property_string()
421 unittest(rc == 3, "Incorrect string count; rc=%i\n", rc); in of_unittest_property_string()
423 unittest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc); in of_unittest_property_string()
425 unittest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc); in of_unittest_property_string()
429 …unittest(rc == 0 && !strcmp(strings[0], "foobar"), "of_property_read_string_index() failure; rc=%i… in of_unittest_property_string()
432 …unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n",… in of_unittest_property_string()
434 …unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\… in of_unittest_property_string()
436 …unittest(rc == 0 && !strcmp(strings[0], "second"), "of_property_read_string_index() failure; rc=%i… in of_unittest_property_string()
438 …unittest(rc == 0 && !strcmp(strings[0], "third"), "of_property_read_string_index() failure; rc=%i\… in of_unittest_property_string()
441 …unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n",… in of_unittest_property_string()
444 …unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", … in of_unittest_property_string()
446 …unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\… in of_unittest_property_string()
449 …unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", … in of_unittest_property_string()
454 unittest(rc == 1, "Incorrect string count; rc=%i\n", rc); in of_unittest_property_string()
456 unittest(rc == 3, "Incorrect string count; rc=%i\n", rc); in of_unittest_property_string()
458 unittest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc); in of_unittest_property_string()
461 unittest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc); in of_unittest_property_string()
465 unittest(rc == 2 && strings[2] == NULL, "of_property_read_string_array() failure; rc=%i\n", rc); in of_unittest_property_string()
468 …unittest(rc == 1 && strings[1] == NULL, "Overwrote end of string array; rc=%i, str='%s'\n", rc, st… in of_unittest_property_string()
483 unittest(new && propcmp(&p1, new), "empty property didn't copy correctly\n"); in of_unittest_property_copy()
489 unittest(new && propcmp(&p2, new), "non-empty property didn't copy correctly\n"); in of_unittest_property_copy()
506 unittest(n1, "testcase setup failure\n"); in of_unittest_changeset()
508 unittest(n2, "testcase setup failure\n"); in of_unittest_changeset()
510 unittest(n21, "testcase setup failure %p\n", n21); in of_unittest_changeset()
512 unittest(nremove, "testcase setup failure\n"); in of_unittest_changeset()
514 unittest(ppadd, "testcase setup failure\n"); in of_unittest_changeset()
516 unittest(ppupdate, "testcase setup failure\n"); in of_unittest_changeset()
523 unittest(ppremove, "failed to find removal prop"); in of_unittest_changeset()
526 unittest(!of_changeset_attach_node(&chgset, n1), "fail attach n1\n"); in of_unittest_changeset()
527 unittest(!of_changeset_attach_node(&chgset, n2), "fail attach n2\n"); in of_unittest_changeset()
528 unittest(!of_changeset_detach_node(&chgset, nremove), "fail remove node\n"); in of_unittest_changeset()
529 unittest(!of_changeset_attach_node(&chgset, n21), "fail attach n21\n"); in of_unittest_changeset()
530 unittest(!of_changeset_add_property(&chgset, parent, ppadd), "fail add prop\n"); in of_unittest_changeset()
531 unittest(!of_changeset_update_property(&chgset, parent, ppupdate), "fail update prop\n"); in of_unittest_changeset()
532 unittest(!of_changeset_remove_property(&chgset, parent, ppremove), "fail remove prop\n"); in of_unittest_changeset()
534 unittest(!of_changeset_apply(&chgset), "apply failed\n"); in of_unittest_changeset()
538 unittest((np = of_find_node_by_path("/testcase-data/changeset/n2/n21")), in of_unittest_changeset()
543 unittest(!of_changeset_revert(&chgset), "revert failed\n"); in of_unittest_changeset()
572 unittest(passed, "index %i - data error on node %s rc=%i\n", in of_unittest_parse_interrupts()
618 unittest(passed, "index %i - data error on node %s rc=%i\n", in of_unittest_parse_interrupts()
688 unittest(passed, "index %i - data error on node %s rc=%i\n", in of_unittest_parse_interrupts_extended()
738 unittest(0, "missing testcase node %s\n", in of_unittest_match_node()
745 unittest(0, "%s didn't match anything\n", in of_unittest_match_node()
751 unittest(0, "%s got wrong match. expected %s, got %s\n", in of_unittest_match_node()
756 unittest(1, "passed"); in of_unittest_match_node()
779 unittest(pdev, "device 1 creation failed\n"); in of_unittest_platform_populate()
782 unittest(irq == -EPROBE_DEFER, "device deferred probe failed - %d\n", irq); in of_unittest_platform_populate()
787 unittest(pdev, "device 2 creation failed\n"); in of_unittest_platform_populate()
789 unittest(irq < 0 && irq != -EPROBE_DEFER, "device parsing error failed - %d\n", irq); in of_unittest_platform_populate()
792 unittest(np, "No testcase data in device tree\n"); in of_unittest_platform_populate()
798 unittest(!rc, "testbus registration failed; rc=%i\n", rc); in of_unittest_platform_populate()
806 unittest(of_find_device_by_node(grandchild), in of_unittest_platform_populate()
814 unittest(!of_find_device_by_node(grandchild), in of_unittest_platform_populate()
1178 unittest(0, "could not find overlay node @\"%s\"\n", in of_unittest_apply_overlay()
1186 unittest(0, "could not create overlay from \"%s\"\n", in of_unittest_apply_overlay()
1212 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_apply_overlay_check()
1227 unittest(0, "overlay @\"%s\" failed to create @\"%s\" %s\n", in of_unittest_apply_overlay_check()
1246 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_apply_revert_overlay_check()
1262 unittest(0, "overlay @\"%s\" failed to create @\"%s\" %s\n", in of_unittest_apply_revert_overlay_check()
1271 unittest(0, "overlay @\"%s\" failed to be destroyed @\"%s\"\n", in of_unittest_apply_revert_overlay_check()
1279 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_apply_revert_overlay_check()
1299 unittest(1, "overlay test %d passed\n", 0); in of_unittest_overlay_0()
1312 unittest(1, "overlay test %d passed\n", 1); in of_unittest_overlay_1()
1325 unittest(1, "overlay test %d passed\n", 2); in of_unittest_overlay_2()
1338 unittest(1, "overlay test %d passed\n", 3); in of_unittest_overlay_3()
1351 unittest(1, "overlay test %d passed\n", 4); in of_unittest_overlay_4()
1364 unittest(1, "overlay test %d passed\n", 5); in of_unittest_overlay_5()
1379 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_overlay_6()
1393 unittest(0, "could not find overlay node @\"%s\"\n", in of_unittest_overlay_6()
1400 unittest(0, "could not create overlay from \"%s\"\n", in of_unittest_overlay_6()
1412 unittest(0, "overlay @\"%s\" failed @\"%s\" %s\n", in of_unittest_overlay_6()
1424 unittest(0, "overlay @\"%s\" failed destroy @\"%s\"\n", in of_unittest_overlay_6()
1437 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_overlay_6()
1446 unittest(1, "overlay test %d passed\n", 6); in of_unittest_overlay_6()
1463 unittest(0, "could not find overlay node @\"%s\"\n", in of_unittest_overlay_8()
1470 unittest(0, "could not create overlay from \"%s\"\n", in of_unittest_overlay_8()
1481 unittest(0, "overlay @\"%s\" was destroyed @\"%s\"\n", in of_unittest_overlay_8()
1492 unittest(0, "overlay @\"%s\" not destroyed @\"%s\"\n", in of_unittest_overlay_8()
1501 unittest(1, "overlay test %d passed\n", 8); in of_unittest_overlay_8()
1512 if (unittest(ret == 0, in of_unittest_overlay_10()
1518 if (unittest(child_path, "overlay test %d failed; kasprintf\n", 10)) in of_unittest_overlay_10()
1523 if (unittest(ret, "overlay test %d failed; no child device\n", 10)) in of_unittest_overlay_10()
1535 if (unittest(ret == 0, in of_unittest_overlay_11()
1779 if (unittest(ret == 0, in of_unittest_overlay_i2c_init()
1784 if (unittest(ret == 0, in of_unittest_overlay_i2c_init()
1790 if (unittest(ret == 0, in of_unittest_overlay_i2c_init()
1816 unittest(1, "overlay test %d passed\n", 12); in of_unittest_overlay_i2c_12()
1829 unittest(1, "overlay test %d passed\n", 13); in of_unittest_overlay_i2c_13()
1846 unittest(1, "overlay test %d passed\n", 15); in of_unittest_overlay_i2c_15()
1863 unittest(0, "could not register unittest driver\n"); in of_unittest_overlay()
1869 unittest(0, "could not find bus_path \"%s\"\n", bus_path); in of_unittest_overlay()
1876 unittest(0, "could not populate bus @ \"%s\"\n", bus_path); in of_unittest_overlay()
1881 unittest(0, "could not find unittest0 @ \"%s\"\n", in of_unittest_overlay()
1887 unittest(0, "unittest1 @ \"%s\" should not exist\n", in of_unittest_overlay()
1892 unittest(1, "basic infrastructure of overlays passed"); in of_unittest_overlay()
1908 if (unittest(of_unittest_overlay_i2c_init() == 0, "i2c init failed\n")) in of_unittest_overlay()