3fc060d232c7d0059870a7e43baba013f5c9ea8a
[yaffs2.git] / direct / test-framework / timothy_tests / quick_tests / test_yaffs_flush.c
1 /*
2  * YAFFS: Yet another FFS. A NAND-flash specific file system.
3  *
4  * Copyright (C) 2002-2011 Aleph One Ltd.
5  *   for Toby Churchill Ltd and Brightstar Engineering
6  *
7  * Created by Timothy Manning <timothy@yaffs.net>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License version 2 as
11  * published by the Free Software Foundation.
12  */
13
14 #include "test_yaffs_flush.h"
15 #include "test_yaffs_open.h"
16
17 static int handle =-1;
18
19 int test_yaffs_flush(void)
20 {
21         int output=-1;
22         handle = test_yaffs_open();
23         if (handle >= 0){
24                 output =yaffs_flush(handle);
25         } else {
26                 print_message("failed to open file\n",2);
27         }
28         return output;
29 }
30
31
32 int test_yaffs_flush_clean(void)
33 {
34         if (handle>=0){
35                 return yaffs_close(handle);
36         } else {
37                 return -1;
38         }
39 }
40