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()
232 unittest(child_count > 0, "Device node data structure is corrupted\n"); in of_unittest_check_tree_linkage()
233 unittest(child_count == allnode_count, in of_unittest_check_tree_linkage()
273 unittest(dup_count == 0, "Found %i duplicates in %i phandles\n", in of_unittest_check_phandles()
296 unittest(rc == 7, "of_count_phandle_with_args() returned %i, expected 7\n", rc); in of_unittest_parse_phandle_with_args()
349 unittest(passed, "index %i - data error on node %s rc=%i\n", in of_unittest_parse_phandle_with_args()
356 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc); in of_unittest_parse_phandle_with_args()
359 unittest(rc == -ENOENT, "expected:%i got:%i\n", -ENOENT, rc); in of_unittest_parse_phandle_with_args()
364 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
367 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
372 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
375 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
380 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
383 unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc); in of_unittest_parse_phandle_with_args()
399 unittest(rc == 0, "first expected:0 got:%i\n", rc); in of_unittest_property_string()
401 unittest(rc == 1, "second expected:1 got:%i\n", rc); in of_unittest_property_string()
403 unittest(rc == 2, "third expected:2 got:%i\n", rc); in of_unittest_property_string()
405 unittest(rc == -ENODATA, "unmatched string; rc=%i\n", rc); in of_unittest_property_string()
407 unittest(rc == -EINVAL, "missing property; rc=%i\n", rc); in of_unittest_property_string()
409 unittest(rc == -ENODATA, "empty property; rc=%i\n", rc); in of_unittest_property_string()
411 unittest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc); in of_unittest_property_string()
415 unittest(rc == 1, "Incorrect string count; rc=%i\n", rc); in of_unittest_property_string()
417 unittest(rc == 3, "Incorrect string count; rc=%i\n", rc); in of_unittest_property_string()
419 unittest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc); in of_unittest_property_string()
421 unittest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc); in of_unittest_property_string()
425unittest(rc == 0 && !strcmp(strings[0], "foobar"), "of_property_read_string_index() failure; rc=%i… in of_unittest_property_string()
428unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n",… in of_unittest_property_string()
430unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\… in of_unittest_property_string()
432unittest(rc == 0 && !strcmp(strings[0], "second"), "of_property_read_string_index() failure; rc=%i… in of_unittest_property_string()
434unittest(rc == 0 && !strcmp(strings[0], "third"), "of_property_read_string_index() failure; rc=%i\… in of_unittest_property_string()
437unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n",… in of_unittest_property_string()
440unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", … in of_unittest_property_string()
442unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\… in of_unittest_property_string()
445unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", … in of_unittest_property_string()
450 unittest(rc == 1, "Incorrect string count; rc=%i\n", rc); in of_unittest_property_string()
452 unittest(rc == 3, "Incorrect string count; rc=%i\n", rc); in of_unittest_property_string()
454 unittest(rc == -EILSEQ, "unterminated string; rc=%i\n", rc); in of_unittest_property_string()
457 unittest(rc == -EILSEQ, "unterminated string array; rc=%i\n", rc); in of_unittest_property_string()
461 unittest(rc == 2 && strings[2] == NULL, "of_property_read_string_array() failure; rc=%i\n", rc); in of_unittest_property_string()
464unittest(rc == 1 && strings[1] == NULL, "Overwrote end of string array; rc=%i, str='%s'\n", rc, st… in of_unittest_property_string()
479 unittest(new && propcmp(&p1, new), "empty property didn't copy correctly\n"); in of_unittest_property_copy()
485 unittest(new && propcmp(&p2, new), "non-empty property didn't copy correctly\n"); in of_unittest_property_copy()
502 unittest(n1, "testcase setup failure\n"); in of_unittest_changeset()
504 unittest(n2, "testcase setup failure\n"); in of_unittest_changeset()
506 unittest(n21, "testcase setup failure %p\n", n21); in of_unittest_changeset()
508 unittest(nremove, "testcase setup failure\n"); in of_unittest_changeset()
510 unittest(ppadd, "testcase setup failure\n"); in of_unittest_changeset()
512 unittest(ppupdate, "testcase setup failure\n"); in of_unittest_changeset()
519 unittest(ppremove, "failed to find removal prop"); in of_unittest_changeset()
522 unittest(!of_changeset_attach_node(&chgset, n1), "fail attach n1\n"); in of_unittest_changeset()
523 unittest(!of_changeset_attach_node(&chgset, n2), "fail attach n2\n"); in of_unittest_changeset()
524 unittest(!of_changeset_detach_node(&chgset, nremove), "fail remove node\n"); in of_unittest_changeset()
525 unittest(!of_changeset_attach_node(&chgset, n21), "fail attach n21\n"); in of_unittest_changeset()
526 unittest(!of_changeset_add_property(&chgset, parent, ppadd), "fail add prop\n"); in of_unittest_changeset()
527 unittest(!of_changeset_update_property(&chgset, parent, ppupdate), "fail update prop\n"); in of_unittest_changeset()
528 unittest(!of_changeset_remove_property(&chgset, parent, ppremove), "fail remove prop\n"); in of_unittest_changeset()
530 unittest(!of_changeset_apply(&chgset), "apply failed\n"); in of_unittest_changeset()
534 unittest((np = of_find_node_by_path("/testcase-data/changeset/n2/n21")), in of_unittest_changeset()
539 unittest(!of_changeset_revert(&chgset), "revert failed\n"); in of_unittest_changeset()
568 unittest(passed, "index %i - data error on node %s rc=%i\n", in of_unittest_parse_interrupts()
614 unittest(passed, "index %i - data error on node %s rc=%i\n", in of_unittest_parse_interrupts()
684 unittest(passed, "index %i - data error on node %s rc=%i\n", in of_unittest_parse_interrupts_extended()
734 unittest(0, "missing testcase node %s\n", in of_unittest_match_node()
741 unittest(0, "%s didn't match anything\n", in of_unittest_match_node()
747 unittest(0, "%s got wrong match. expected %s, got %s\n", in of_unittest_match_node()
752 unittest(1, "passed"); in of_unittest_match_node()
775 unittest(pdev, "device 1 creation failed\n"); in of_unittest_platform_populate()
778 unittest(irq == -EPROBE_DEFER, "device deferred probe failed - %d\n", irq); in of_unittest_platform_populate()
783 unittest(pdev, "device 2 creation failed\n"); in of_unittest_platform_populate()
785 unittest(irq < 0 && irq != -EPROBE_DEFER, "device parsing error failed - %d\n", irq); in of_unittest_platform_populate()
788 unittest(np, "No testcase data in device tree\n"); in of_unittest_platform_populate()
794 unittest(!rc, "testbus registration failed; rc=%i\n", rc); in of_unittest_platform_populate()
802 unittest(of_find_device_by_node(grandchild), in of_unittest_platform_populate()
810 unittest(!of_find_device_by_node(grandchild), in of_unittest_platform_populate()
1175 unittest(0, "could not find overlay node @\"%s\"\n", in of_unittest_apply_overlay()
1183 unittest(0, "could not create overlay from \"%s\"\n", in of_unittest_apply_overlay()
1209 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_apply_overlay_check()
1224 unittest(0, "overlay @\"%s\" failed to create @\"%s\" %s\n", in of_unittest_apply_overlay_check()
1243 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_apply_revert_overlay_check()
1259 unittest(0, "overlay @\"%s\" failed to create @\"%s\" %s\n", in of_unittest_apply_revert_overlay_check()
1268 unittest(0, "overlay @\"%s\" failed to be destroyed @\"%s\"\n", in of_unittest_apply_revert_overlay_check()
1276 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_apply_revert_overlay_check()
1296 unittest(1, "overlay test %d passed\n", 0); in of_unittest_overlay_0()
1309 unittest(1, "overlay test %d passed\n", 1); in of_unittest_overlay_1()
1322 unittest(1, "overlay test %d passed\n", 2); in of_unittest_overlay_2()
1335 unittest(1, "overlay test %d passed\n", 3); in of_unittest_overlay_3()
1348 unittest(1, "overlay test %d passed\n", 4); in of_unittest_overlay_4()
1361 unittest(1, "overlay test %d passed\n", 5); in of_unittest_overlay_5()
1376 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_overlay_6()
1390 unittest(0, "could not find overlay node @\"%s\"\n", in of_unittest_overlay_6()
1397 unittest(0, "could not create overlay from \"%s\"\n", in of_unittest_overlay_6()
1409 unittest(0, "overlay @\"%s\" failed @\"%s\" %s\n", in of_unittest_overlay_6()
1421 unittest(0, "overlay @\"%s\" failed destroy @\"%s\"\n", in of_unittest_overlay_6()
1434 unittest(0, "overlay @\"%s\" with device @\"%s\" %s\n", in of_unittest_overlay_6()
1443 unittest(1, "overlay test %d passed\n", 6); in of_unittest_overlay_6()
1460 unittest(0, "could not find overlay node @\"%s\"\n", in of_unittest_overlay_8()
1467 unittest(0, "could not create overlay from \"%s\"\n", in of_unittest_overlay_8()
1478 unittest(0, "overlay @\"%s\" was destroyed @\"%s\"\n", in of_unittest_overlay_8()
1489 unittest(0, "overlay @\"%s\" not destroyed @\"%s\"\n", in of_unittest_overlay_8()
1498 unittest(1, "overlay test %d passed\n", 8); in of_unittest_overlay_8()
1509 if (unittest(ret == 0, in of_unittest_overlay_10()
1515 if (unittest(child_path, "overlay test %d failed; kasprintf\n", 10)) in of_unittest_overlay_10()
1520 if (unittest(ret, "overlay test %d failed; no child device\n", 10)) in of_unittest_overlay_10()
1532 if (unittest(ret == 0, in of_unittest_overlay_11()
1778 if (unittest(ret == 0, in of_unittest_overlay_i2c_init()
1783 if (unittest(ret == 0, in of_unittest_overlay_i2c_init()
1789 if (unittest(ret == 0, in of_unittest_overlay_i2c_init()
1815 unittest(1, "overlay test %d passed\n", 12); in of_unittest_overlay_i2c_12()
1828 unittest(1, "overlay test %d passed\n", 13); in of_unittest_overlay_i2c_13()
1845 unittest(1, "overlay test %d passed\n", 15); in of_unittest_overlay_i2c_15()
1862 unittest(0, "could not register unittest driver\n"); in of_unittest_overlay()
1868 unittest(0, "could not find bus_path \"%s\"\n", bus_path); in of_unittest_overlay()
1875 unittest(0, "could not populate bus @ \"%s\"\n", bus_path); in of_unittest_overlay()
1880 unittest(0, "could not find unittest0 @ \"%s\"\n", in of_unittest_overlay()
1886 unittest(0, "unittest1 @ \"%s\" should not exist\n", in of_unittest_overlay()
1891 unittest(1, "basic infrastructure of overlays passed"); in of_unittest_overlay()
1907 if (unittest(of_unittest_overlay_i2c_init() == 0, "i2c init failed\n")) in of_unittest_overlay()