2 * Copyright 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
6 #ifndef NATIVE_CLIENT_SRC_SHARED_GIO_GIO_TEST_BASE_H_
7 #define NATIVE_CLIENT_SRC_SHARED_GIO_GIO_TEST_BASE_H_
10 * NaCl Generic I/O test utilities.
13 #include "native_client/src/shared/gio/gio.h"
15 const int expected_file_size = 32;
17 /** Returns character expected to be at file_pos */
18 char GioExpectedCharAt(char initial_char, int file_pos);
20 /** Initializes a GioMemoryFile to conform to requirements of these tests,
21 modulo the length assumption. */
22 void GioInitTestMemFile(char* mem_buff, char initial_char, int in_size);
25 * Must be given a file with contents:
26 * [initial_char+0, initial_char+1, ..., initial_char+expected_file_size-1]. */
27 void GioReadTestWithOffset(struct Gio* my_file,
30 /** Should be given a scratch file that can be written to without worry. */
31 void GioWriteTest(struct Gio* my_file,
35 * Must be given a file with contents
36 * [initial_char+0, initial_char+1, ..., initial_char+expected_file_size-1].
38 void GioSeekTestWithOffset(struct Gio* my_file,
42 /** Closes and destroys the file. */
43 void GioCloseTest(struct Gio* my_file);
45 #endif /* NATIVE_CLIENT_SRC_SHARED_GIO_GIO_TEST_BASE_H_ */