/ Check-in [f3a6a64e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Cleanup header usage in lsmtest for files that require _O_BINARY.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f3a6a64ec90e6cf24aadf62aef4f92104be5ba6790f7fca040eff7abc31f1061
User & Date: mistachkin 2017-07-10 18:57:03
Context
2017-07-10
19:03
Fix an obsolete statement about Lemon in the README.md file. check-in: 4f6ce7a3 user: drh tags: trunk
18:57
Cleanup header usage in lsmtest for files that require _O_BINARY. check-in: f3a6a64e user: mistachkin tags: trunk
18:52
Updates to the repository README.md file. check-in: 7bfd3ab7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/lsm1/lsm-test/lsmtest.h.

     3      3   #define __WRAPPER_INT_H_
     4      4   
     5      5   #include "lsmtest_tdb.h"
     6      6   #include "sqlite3.h"
     7      7   #include "lsm.h"
     8      8   
     9      9   #include <assert.h>
           10  +#include <stdarg.h>
    10     11   #include <stdlib.h>
    11     12   #include <string.h>
    12     13   #include <stdio.h>
           14  +#ifndef _WIN32
           15  +# include <unistd.h>
           16  +#endif
           17  +#include <sys/types.h>
           18  +#include <sys/stat.h>
           19  +#include <fcntl.h>
           20  +#include <ctype.h>
           21  +#include <stdlib.h>
           22  +#include <errno.h>
    13     23   
    14     24   #ifdef __cplusplus
    15     25   extern "C" {
    16     26   #endif
    17     27   
    18         -#ifndef _O_BINARY
    19         -# define _O_BINARY (0)
    20         -#endif
    21         -
    22     28   #ifdef _WIN32
    23     29   # include "windows.h"
    24     30   # define gettimeofday win32GetTimeOfDay
    25     31   # define F_OK  (0)
    26     32   # define sleep(sec) Sleep(1000 * (sec))
    27     33   # define usleep(usec) Sleep(((usec) + 999) / 1000)
    28     34   # ifdef _MSC_VER
................................................................................
    51     57   #define MIN(x,y) ((x)<(y) ? (x) : (y))
    52     58   #define MAX(x,y) ((x)>(y) ? (x) : (y))
    53     59   
    54     60   #define unused_parameter(x) (void)(x)
    55     61   
    56     62   #define TESTDB_DEFAULT_PAGE_SIZE   4096
    57     63   #define TESTDB_DEFAULT_CACHE_SIZE  2048
           64  +
           65  +#ifndef _O_BINARY
           66  +# define _O_BINARY (0)
           67  +#endif
    58     68   
    59     69   /*
    60     70   ** Ideally, these should be in wrapper.c. But they are here instead so that 
    61     71   ** they can be used by the C++ database wrappers in wrapper2.cc.
    62     72   */
    63     73   typedef struct DatabaseMethods DatabaseMethods;
    64     74   struct TestDb {

Changes to ext/lsm1/lsm-test/lsmtest6.c.

   236    236       lsm_csr_close(pCsr);
   237    237       *pRc = rc;
   238    238     }
   239    239   }
   240    240   
   241    241   #define LSMTEST6_TESTDB "testdb.lsm" 
   242    242   
   243         -#ifndef _WIN32
   244         -# include <unistd.h>
   245         -#endif
   246         -#include <sys/types.h>
   247         -#include <sys/stat.h>
   248         -#include <fcntl.h>
   249         -
   250    243   void testDeleteLsmdb(const char *zFile){
   251    244     char *zLog = testMallocPrintf("%s-log", zFile);
   252    245     char *zShm = testMallocPrintf("%s-shm", zFile);
   253    246     unlink(zFile);
   254    247     unlink(zLog);
   255    248     unlink(zShm);
   256    249     testFree(zLog);

Changes to ext/lsm1/lsm-test/lsmtest_io.c.

    51     51   **     $ echo "2M@6M 1492K@4M S 4096@4K S" | lsmtest io testfile.db 4096 
    52     52   **     3544K written in 127 ms
    53     53   **
    54     54   */
    55     55   
    56     56   #include "lsmtest.h"
    57     57   
    58         -#include <sys/types.h>
    59         -#include <sys/stat.h>
    60         -#include <fcntl.h>
    61         -#ifndef _WIN32
    62         -# include <unistd.h>
    63         -#endif
    64         -#include <ctype.h>
    65         -
    66     58   typedef struct IoContext IoContext;
    67     59   
    68     60   struct IoContext {
    69     61     int fd;
    70     62     int nWrite;
    71     63   };
    72     64   

Changes to ext/lsm1/lsm-test/lsmtest_main.c.

     1      1   
     2         -#include "stdarg.h"
     3      2   #include "lsmtest.h"
     4         -#include "stdio.h"
     5         -#include "assert.h"
     6         -#include "string.h"
     7         -#include "stdlib.h"
     8         -
     9      3   #include <sqlite3.h>
    10         -
    11         -#ifndef _WIN32
    12         -# include <unistd.h>
    13         -#endif
    14         -#include <stdlib.h>
    15         -#include <sys/types.h>
    16         -#include <sys/stat.h>
    17         -#include <fcntl.h>
    18         -#include <errno.h>
    19         -
    20      4   
    21      5   void test_failed(){ 
    22      6     assert( 0 );
    23      7     return; 
    24      8   }
    25      9   
    26     10   #define testSetError(rc) testSetErrorFunc(rc, pRc, __FILE__, __LINE__)