]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.fastlz/native/fastlz_test.c
Merge commit '876ede6'
[simantics/platform.git] / bundles / org.simantics.fastlz / native / fastlz_test.c
1 /*******************************************************************************\r
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
3  * in Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 #include <stdio.h>\r
13 #include <string.h>\r
14 #include "fastlz_write.h"\r
15 \r
16 #define SIZE 500000\r
17 \r
18 int main(int argn, char** args) {\r
19 \r
20     /*FILE* handle = fopen("d:/testi.flz", "rb");\r
21     int i;\r
22 \r
23     printf("A\n");\r
24 \r
25     initRead(handle);\r
26     printf("B\n");\r
27     char* array = (char*)malloc(SIZE);\r
28 \r
29     read(array, 0, SIZE);\r
30     printf("C\n");\r
31     deinitRead();\r
32     printf("D\n");\r
33     \r
34     printf("Hello:\n");\r
35     for(i=0;i<SIZE;++i)\r
36         printf("%c", array[i]);\r
37 \r
38     free(array);\r
39     fclose(handle);*/\r
40 \r
41     FILE* handle = fopen("testi.flz", "wb");\r
42 \r
43     char temp[10];\r
44     int i;\r
45 \r
46     initWrite(handle);\r
47     for(i=0;i<100000;++i) {\r
48         sprintf(temp, "%d\n", i);\r
49         write(temp, 0, strlen(temp));\r
50     }\r
51     deinitWrite();\r
52 \r
53     fclose(handle);\r
54     \r
55 }\r