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