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 // This function tests the C implementation of tokenization API. These functions
16 // are called from the main C++ test file.
18 #include "pw_tokenizer/tokenize_to_global_handler.h"
19 #include "pw_tokenizer/tokenize_to_global_handler_with_payload.h"
20 #include "pw_tokenizer_private/tokenize_test.h"
23 #error "This is a test of C code and must be compiled as C, not C++."
26 // This test invokes the tokenization API with a variety of types. To simplify
27 // validating the encoded data, numbers that are sequential when zig-zag encoded
28 // are used as arguments.
29 void pw_tokenizer_ToGlobalHandlerTest_SequentialZigZag(void) {
30 PW_TOKENIZE_TO_GLOBAL_HANDLER(TEST_FORMAT_SEQUENTIAL_ZIG_ZAG,
47 void pw_tokenizer_ToGlobalHandlerWithPayloadTest_SequentialZigZag(void) {
48 PW_TOKENIZE_TO_GLOBAL_HANDLER_WITH_PAYLOAD((pw_tokenizer_Payload)600613,
49 TEST_FORMAT_SEQUENTIAL_ZIG_ZAG,