mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Add tokens
This commit is contained in:
1 parent
7a142168be
commit
737e31ff3a
17 files changed
+498
-36
No files matched your search
+2
-2
@@ -77,8 +77,8 @@ const char* test_wuffs_json_decode_tokens() {
|
||||
&dec, sizeof dec, WUFFS_VERSION,
|
||||
WUFFS_INITIALIZE__LEAVE_INTERNAL_BUFFERS_UNINITIALIZED));
|
||||
|
||||
wuffs_base__io_buffer got = ((wuffs_base__io_buffer){
|
||||
.data = global_got_slice,
|
||||
wuffs_base__token_buffer got = ((wuffs_base__token_buffer){
|
||||
.data = global_got_token_slice,
|
||||
});
|
||||
wuffs_base__io_buffer src = ((wuffs_base__io_buffer){
|
||||
.data = global_src_slice,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#define BUFFER_SIZE (64 * 1024 * 1024)
|
||||
#define TOKEN_BUFFER_SIZE (8 * 1024)
|
||||
|
||||
#define WUFFS_TESTLIB_ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
||||
@@ -30,12 +31,18 @@ uint8_t global_work_array[BUFFER_SIZE];
|
||||
uint8_t global_src_array[BUFFER_SIZE];
|
||||
uint8_t global_pixel_array[BUFFER_SIZE];
|
||||
|
||||
wuffs_base__token global_got_token_array[TOKEN_BUFFER_SIZE];
|
||||
wuffs_base__token global_want_token_array[TOKEN_BUFFER_SIZE];
|
||||
|
||||
wuffs_base__slice_u8 global_got_slice;
|
||||
wuffs_base__slice_u8 global_want_slice;
|
||||
wuffs_base__slice_u8 global_work_slice;
|
||||
wuffs_base__slice_u8 global_src_slice;
|
||||
wuffs_base__slice_u8 global_pixel_slice;
|
||||
|
||||
wuffs_base__slice_token global_got_token_slice;
|
||||
wuffs_base__slice_token global_want_token_slice;
|
||||
|
||||
void wuffs_testlib__initialize_global_xxx_slices() {
|
||||
global_got_slice = ((wuffs_base__slice_u8){
|
||||
.ptr = global_got_array,
|
||||
@@ -57,6 +64,15 @@ void wuffs_testlib__initialize_global_xxx_slices() {
|
||||
.ptr = global_pixel_array,
|
||||
.len = BUFFER_SIZE,
|
||||
});
|
||||
|
||||
global_got_token_slice = ((wuffs_base__slice_token){
|
||||
.ptr = global_got_token_array,
|
||||
.len = TOKEN_BUFFER_SIZE,
|
||||
});
|
||||
global_want_token_slice = ((wuffs_base__slice_token){
|
||||
.ptr = global_want_token_array,
|
||||
.len = TOKEN_BUFFER_SIZE,
|
||||
});
|
||||
}
|
||||
|
||||
char fail_msg[65536] = {0};
|
||||
|
||||
Reference in new issue
Block a user