aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJoão Valverde <j@v6e.pt>2022-10-16 11:35:33 +0100
committerJoão Valverde <j@v6e.pt>2022-10-20 20:05:15 +0100
commit603354203b608a0d94b91c61791b2ec3052a870b (patch)
tree0af9a0877eac5e6f14819d9802188682cdc1640c /test
parent000c2c0bf463c171b0ffb3650f15b4b5a108fbef (diff)
epan/proto: Replace format text()
The proto.h APIs expect valid UTF-8 so replace uses of format_text() with a label copy function that just does formatting and does not check for encoding errors. Avoid multiple levels of temporary string allocations. Make sure the copy does not truncate a multibyte character and produce invalid strings. Add debug checks for UTF-8 encoding errors instead. We escape C0 and C1 control codes (because control codes) and ASCII whitespace (and bell). Overall the goal is to be more efficient and optimized and help detect misuse of APIs by passing invalid UTF-8. Add a unit test for ws_label_strcat.
Diffstat (limited to 'test')
-rw-r--r--test/suite_unittests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/suite_unittests.py b/test/suite_unittests.py
index ce42697921..7c1e644268 100644
--- a/test/suite_unittests.py
+++ b/test/suite_unittests.py
@@ -45,6 +45,12 @@ class case_unittests(subprocesstest.SubprocessTestCase):
'''wscbor_test'''
self.assertRun(program('wscbor_test'), env=base_env)
+ def test_unit_epan(self, program, base_env):
+ '''epan unit tests'''
+ self.assertRun((program('test_epan'),
+ '--verbose'
+ ), env=base_env)
+
def test_unit_wsutil(self, program, base_env):
'''wsutil unit tests'''
self.assertRun((program('test_wsutil'),