1 // Copyright 2020 The Pigweed Authors
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
7 // https://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
15 // Functions to test that the tokenization macro works correctly in C code.
16 // These are defined in tokenize_test.c and global_handlers_test.c.
22 #include "pw_preprocessor/util.h"
26 #define TEST_FORMAT_STRING_SHORT_FLOAT "Hello %s! %hd %e"
28 void pw_tokenizer_ToBufferTest_StringShortFloat(void* buffer,
31 #define TEST_FORMAT_SEQUENTIAL_ZIG_ZAG "%u%d%02x%X%hu%hhd%d%ld%lu%lld%llu%c%c%c"
33 void pw_tokenizer_ToBufferTest_SequentialZigZag(void* buffer,
36 void pw_tokenizer_ToCallbackTest_SequentialZigZag(
37 void (*callback)(const uint8_t* buffer, size_t size));
39 #define TEST_FORMAT_REQUIRES_8 "Won't fit : %s%d"
41 void pw_tokenizer_ToBufferTest_Requires8(void* buffer, size_t* buffer_size);
43 void pw_tokenizer_ToGlobalHandlerTest_SequentialZigZag(void);
45 void pw_tokenizer_ToGlobalHandlerWithPayloadTest_SequentialZigZag(void);