Lines Matching refs:strings
300 /* use strcmp() instead of strncmp() here to be absolutely sure strings match */
711 const char *strings[4];
747 rc = of_property_read_string_index(np, "string-property", 0, strings);
748 unittest(rc == 0 && !strcmp(strings[0], "foobar"), "of_property_read_string_index() failure; rc=%i\n", rc);
749 strings[0] = NULL;
750 rc = of_property_read_string_index(np, "string-property", 1, strings);
751 unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
752 rc = of_property_read_string_index(np, "phandle-list-names", 0, strings);
753 unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
754 rc = of_property_read_string_index(np, "phandle-list-names", 1, strings);
755 unittest(rc == 0 && !strcmp(strings[0], "second"), "of_property_read_string_index() failure; rc=%i\n", rc);
756 rc = of_property_read_string_index(np, "phandle-list-names", 2, strings);
757 unittest(rc == 0 && !strcmp(strings[0], "third"), "of_property_read_string_index() failure; rc=%i\n", rc);
758 strings[0] = NULL;
759 rc = of_property_read_string_index(np, "phandle-list-names", 3, strings);
760 unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
761 strings[0] = NULL;
762 rc = of_property_read_string_index(np, "unterminated-string", 0, strings);
763 unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
764 rc = of_property_read_string_index(np, "unterminated-string-list", 0, strings);
765 unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
766 strings[0] = NULL;
767 rc = of_property_read_string_index(np, "unterminated-string-list", 2, strings); /* should fail */
768 unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
769 strings[1] = NULL;
772 rc = of_property_read_string_array(np, "string-property", strings, 4);
774 rc = of_property_read_string_array(np, "phandle-list-names", strings, 4);
776 rc = of_property_read_string_array(np, "unterminated-string", strings, 4);
779 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 4);
781 /* -- parsing the correctly formed strings should still work: */
782 strings[2] = NULL;
783 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 2);
784 unittest(rc == 2 && strings[2] == NULL, "of_property_read_string_array() failure; rc=%i\n", rc);
785 strings[1] = NULL;
786 rc = of_property_read_string_array(np, "phandle-list-names", strings, 1);
787 unittest(rc == 1 && strings[1] == NULL, "Overwrote end of string array; rc=%i, str='%s'\n", rc, strings[1]);