summaryrefslogtreecommitdiffstats
path: root/tests/msgb/msgb_test.ok
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-10-10 16:53:21 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-10-22 20:09:26 +0000
commitc5b47cc03200c983981ac4b8de20fb0e26d4f873 (patch)
tree9072d96478518ce0e5e16be537a746ab9b429620 /tests/msgb/msgb_test.ok
parentfcf81b5deb8d02ba45907e90bb6668c67986a028 (diff)
add function msgb_printf() to print formatted text into msg buf
In ASCII string based protocols it a printf() version that prints directly to the message buffer may be useful. Add function msgb_printf(), make sure that msg buffer bounderies are not exceeded. If the end of the tail buffer is hit, return with an error code. Change-Id: I15e1af68616309555d0ed9ac5da027c9833d42e3
Diffstat (limited to 'tests/msgb/msgb_test.ok')
-rw-r--r--tests/msgb/msgb_test.ok8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/msgb/msgb_test.ok b/tests/msgb/msgb_test.ok
index 6603fe71..826c809c 100644
--- a/tests/msgb/msgb_test.ok
+++ b/tests/msgb/msgb_test.ok
@@ -32,4 +32,12 @@ Testing msgb_resize_area
Original: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
Extended: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
Shrinked: [L1]> 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 [L2]> 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [L3]> 28 29 2a 2b 2c 2d 2e 2f 30 31 [L4]> 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
+Add normal text:
+#1: rc=0, total_len=47, msg->data=|this is a test 4711, testme, 4711|
+#2: rc=0, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text|
+#3: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text||more 23 fee tex
+#4: rc=-22, total_len=63, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 ABC
+#5: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB|
+#6: rc=0, total_len=79, msg->data=|this is a test 4711, testme, 4711||some more text||more 123456 AB|
+#7: before: 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 after: rc=-22, 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 ==> ok, no change
Success.