Lines Matching refs:strings

291 	/* use strcmp() instead of strncmp() here to be absolutely sure strings match */
702 const char *strings[4];
738 rc = of_property_read_string_index(np, "string-property", 0, strings);
739 unittest(rc == 0 && !strcmp(strings[0], "foobar"), "of_property_read_string_index() failure; rc=%i\n", rc);
740 strings[0] = NULL;
741 rc = of_property_read_string_index(np, "string-property", 1, strings);
742 unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
743 rc = of_property_read_string_index(np, "phandle-list-names", 0, strings);
744 unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
745 rc = of_property_read_string_index(np, "phandle-list-names", 1, strings);
746 unittest(rc == 0 && !strcmp(strings[0], "second"), "of_property_read_string_index() failure; rc=%i\n", rc);
747 rc = of_property_read_string_index(np, "phandle-list-names", 2, strings);
748 unittest(rc == 0 && !strcmp(strings[0], "third"), "of_property_read_string_index() failure; rc=%i\n", rc);
749 strings[0] = NULL;
750 rc = of_property_read_string_index(np, "phandle-list-names", 3, strings);
751 unittest(rc == -ENODATA && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
752 strings[0] = NULL;
753 rc = of_property_read_string_index(np, "unterminated-string", 0, strings);
754 unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
755 rc = of_property_read_string_index(np, "unterminated-string-list", 0, strings);
756 unittest(rc == 0 && !strcmp(strings[0], "first"), "of_property_read_string_index() failure; rc=%i\n", rc);
757 strings[0] = NULL;
758 rc = of_property_read_string_index(np, "unterminated-string-list", 2, strings); /* should fail */
759 unittest(rc == -EILSEQ && strings[0] == NULL, "of_property_read_string_index() failure; rc=%i\n", rc);
760 strings[1] = NULL;
763 rc = of_property_read_string_array(np, "string-property", strings, 4);
765 rc = of_property_read_string_array(np, "phandle-list-names", strings, 4);
767 rc = of_property_read_string_array(np, "unterminated-string", strings, 4);
770 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 4);
772 /* -- parsing the correctly formed strings should still work: */
773 strings[2] = NULL;
774 rc = of_property_read_string_array(np, "unterminated-string-list", strings, 2);
775 unittest(rc == 2 && strings[2] == NULL, "of_property_read_string_array() failure; rc=%i\n", rc);
776 strings[1] = NULL;
777 rc = of_property_read_string_array(np, "phandle-list-names", strings, 1);
778 unittest(rc == 1 && strings[1] == NULL, "Overwrote end of string array; rc=%i, str='%s'\n", rc, strings[1]);