]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.fastlz/native/fastlz_test.c
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.fastlz / native / fastlz_test.c
diff --git a/bundles/org.simantics.fastlz/native/fastlz_test.c b/bundles/org.simantics.fastlz/native/fastlz_test.c
new file mode 100644 (file)
index 0000000..9584a59
--- /dev/null
@@ -0,0 +1,55 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+#include <stdio.h>\r
+#include <string.h>\r
+#include "fastlz_write.h"\r
+\r
+#define SIZE 500000\r
+\r
+int main(int argn, char** args) {\r
+\r
+    /*FILE* handle = fopen("d:/testi.flz", "rb");\r
+    int i;\r
+\r
+    printf("A\n");\r
+\r
+    initRead(handle);\r
+    printf("B\n");\r
+    char* array = (char*)malloc(SIZE);\r
+\r
+    read(array, 0, SIZE);\r
+    printf("C\n");\r
+    deinitRead();\r
+    printf("D\n");\r
+    \r
+    printf("Hello:\n");\r
+    for(i=0;i<SIZE;++i)\r
+        printf("%c", array[i]);\r
+\r
+    free(array);\r
+    fclose(handle);*/\r
+\r
+    FILE* handle = fopen("testi.flz", "wb");\r
+\r
+    char temp[10];\r
+    int i;\r
+\r
+    initWrite(handle);\r
+    for(i=0;i<100000;++i) {\r
+        sprintf(temp, "%d\n", i);\r
+        write(temp, 0, strlen(temp));\r
+    }\r
+    deinitWrite();\r
+\r
+    fclose(handle);\r
+    \r
+}\r