Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / native_client / src / shared / gio / gio_test_base.h
1 /*
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.
5  */
6 #ifndef NATIVE_CLIENT_SRC_SHARED_GIO_GIO_TEST_BASE_H_
7 #define NATIVE_CLIENT_SRC_SHARED_GIO_GIO_TEST_BASE_H_
8
9 /*
10  * NaCl Generic I/O test utilities.
11  */
12
13 #include "native_client/src/shared/gio/gio.h"
14
15 const int expected_file_size = 32;
16
17 /** Returns character expected to be at file_pos */
18 char GioExpectedCharAt(char initial_char, int file_pos);
19
20 /*
21  * Must be given a file with contents:
22  * [initial_char+0, initial_char+1, ..., initial_char+expected_file_size-1]. */
23 void GioReadTestWithOffset(struct Gio* my_file,
24                            char initial_char);
25
26 /** Should be given a scratch file that can be written to without worry. */
27 void GioWriteTest(struct Gio* my_file,
28                   bool fixed_length);
29
30 /*
31  * Must be given a file with contents
32  * [initial_char+0, initial_char+1, ..., initial_char+expected_file_size-1].
33  */
34 void GioSeekTestWithOffset(struct Gio* my_file,
35                            char initial_char,
36                            bool wrap_err);
37
38 /** Closes and destroys the file. */
39 void GioCloseTest(struct Gio* my_file);
40
41 #endif  /* NATIVE_CLIENT_SRC_SHARED_GIO_GIO_TEST_BASE_H_ */