aboutsummaryrefslogtreecommitdiff
path: root/lib/test-string_helpers.c
AgeCommit message (Collapse)AuthorFilesLines
2014-10-14lib / string_helpers: introduce string_escape_mem()Andy Shevchenko1-4/+236
This is almost the opposite function to string_unescape(). Nevertheless it handles \0 and could be used for any byte buffer. The documentation is supplied together with the function prototype. The test cases covers most of the scenarios and would be expanded later on. [[email protected]: avoid 1k stack consumption] Signed-off-by: Andy Shevchenko <[email protected]> Cc: "John W . Linville" <[email protected]> Cc: Johannes Berg <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Joe Perches <[email protected]> Cc: Wu Fengguang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2014-10-14lib / string_helpers: refactoring the test suiteAndy Shevchenko1-12/+27
This patch prepares test suite for a following update. It introduces test_string_check_buf() helper which checks the result and dumps an error. Signed-off-by: Andy Shevchenko <[email protected]> Cc: "John W . Linville" <[email protected]> Cc: Johannes Berg <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-04-30lib/string_helpers: introduce generic string_unescapeAndy Shevchenko1-0/+103
There are several places in kernel where modules unescapes input to convert C-Style Escape Sequences into byte codes. The patch provides generic implementation of such approach. Test cases are also included into the patch. [[email protected]: clarify comment] [[email protected]: export get_random_int() to modules] Signed-off-by: Andy Shevchenko <[email protected]> Cc: Samuel Thibault <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jason Baron <[email protected]> Cc: Alexander Viro <[email protected]> Cc: William Hubbs <[email protected]> Cc: Chris Brannon <[email protected]> Cc: Kirk Reiser <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>