harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r549434 - in /harmony/enhanced/classlib/trunk/modules/portlib: ./ src/test/native/hycpu/unix/ src/test/native/hycpu/windows/ src/test/native/hyfile/shared/ src/test/native/hyfile/unix/ src/test/native/hyfile/windows/ src/test/native/hyfilet...
Date Thu, 21 Jun 2007 08:54:06 GMT
Author: leoli
Date: Thu Jun 21 01:54:01 2007
New Revision: 549434

URL: http://svn.apache.org/viewvc?view=rev&rev=549434
Log:
Apply patch HARMONY-4258 ([classlib][portlib] Modify the native test for hyfile and add the native test for hyfiletext)

Added:
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/shared/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/shared/hyfiletext.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/unix/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/windows/
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/windows/makefile
Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/build.xml
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/windows/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/windows/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/windows/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/windows/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile
    harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile

Modified: harmony/enhanced/classlib/trunk/modules/portlib/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/build.xml?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/build.xml Thu Jun 21 01:54:01 2007
@@ -184,6 +184,7 @@
         <make dir="${hy.portlib.src.test.native}/hycpu/${hy.os.family}" />
         <make dir="${hy.portlib.src.test.native}/hyerror/${hy.os.family}" />
         <make dir="${hy.portlib.src.test.native}/hyfile/${hy.os.family}" />
+        <make dir="${hy.portlib.src.test.native}/hyfiletext/${hy.os.family}" />
         <make dir="${hy.portlib.src.test.native}/hygp/${hy.os.family}" />
         <make dir="${hy.portlib.src.test.native}/hymem/${hy.os.family}" />
         <make dir="${hy.portlib.src.test.native}/hynls/${hy.os.family}" />
@@ -202,7 +203,8 @@
         <!-- <exec-native test="init" /> -->
         <exec-native test="hycpu" />
         <exec-native test="hyerror" />
-        <!-- <exec-native test="hyfile" /> -->
+        <exec-native test="hyfile" />
+        <exec-native test="hyfiletext" />
         <exec-native test="hygp" />
         <exec-native test="hymem" />
         <exec-native test="hynls" />
@@ -227,6 +229,8 @@
         <make dir="${hy.portlib.src.test.native}/hyerror/${hy.os.family}" 
               target="clean" />
         <make dir="${hy.portlib.src.test.native}/hyfile/${hy.os.family}" 
+              target="clean" />
+        <make dir="${hy.portlib.src.test.native}/hyfiletext/${hy.os.family}" 
               target="clean" />
         <make dir="${hy.portlib.src.test.native}/hygp/${hy.os.family}" 
               target="clean" />

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/unix/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/unix/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/unix/makefile Thu Jun 21 01:54:01 2007
@@ -1,31 +1,32 @@
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-
-#
-# Makefile for 'hycpu'
-#
-
-include $(HY_HDK)/build/make/defines.mk
-
-INCLUDES += -I../../hycunit
-BUILDFILES = $(SHAREDSUB)hycpu.o
-BUILDFILES += ../../hycunit/hycunit.o
-MDLLIBFILES += $(DLLPATH)libhyprt$(HY_LINKLIB_SUFFIX)
-ifeq ($(HY_NO_THR),true)
-MDLLIBFILES += $(LIBPATH)libhythr$(HY_LINKLIB_SUFFIX)
-endif
-EXENAME = ../hycpu
-
-include $(HY_HDK)/build/make/rules.mk
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for 'hycpu'
+#
+
+include $(HY_HDK)/build/make/defines.mk
+
+INCLUDES += -I../../hycunit
+BUILDFILES = $(SHAREDSUB)hycpu.o
+BUILDFILES += ../../hycunit/hycunit.o
+MDLLIBFILES += $(DLLPATH)libhyprt$(HY_LINKLIB_SUFFIX)
+ifeq ($(HY_NO_THR),true)
+MDLLIBFILES += $(LIBPATH)libhythr$(HY_LINKLIB_SUFFIX)
+endif
+EXENAME = ../hycpu
+
+CLEANFILES=../TEST-*.xml
+include $(HY_HDK)/build/make/rules.mk

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/windows/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/windows/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hycpu/windows/makefile Thu Jun 21 01:54:01 2007
@@ -32,5 +32,6 @@
 
 EXEFLAGS=$(conlflags) -subsystem:console
 EXEDLLFILES=$(conlibsdll)
+CLEANFILES=..\TEST-*.xml
 
 !include <$(HY_HDK)\build\make\rules.mak>

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c Thu Jun 21 01:54:01 2007
@@ -14,25 +14,48 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
+
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 
 #include "hycomp.h"
 #include "hyport.h"
+#include "hycunit.h"
 
+#define CDEV_CURRENT_FUNCTION _prototypes_private
+encodeUTF8CharN (UDATA unicode, U_8 * result, U_32 bytesRemaining);
+#undef CDEV_CURRENT_FUNCTION
 void cleanup(HyPortLibrary hyportLibrary);
+void generateAbsoluteFilePath(struct HyPortLibrary *hyportLibrary,char *dist , char *fileName);
+void forVprintfTest(struct HyPortLibrary *hyportLibrary,IDATA fd,char* format,...);
+
+int test_hyfile_open(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_write(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_write_text(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_printf(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_sync(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_set_length(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_move(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_seek(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_read(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_length(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_attr(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_error_message(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_findfirst(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_findnext(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_findclose(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_mkdir(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_unlinkdir(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_lastmod(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_vprintf(struct HyPortLibrary *hyportLibrary);
 
 int main (int argc, char **argv, char **envp)
 {
   HyPortLibrary hyportLibrary;
   HyPortLibraryVersion portLibraryVersion;
-  IDATA fd;
-  IDATA bytes;
-  IDATA rc;
-  I_64 offset;
-  char buf[20];
-  I_64 length;
+  int ret = 0;
 
   printf("hyfile:\n");
 
@@ -46,156 +69,906 @@
 
   printf("  portlib initialized\n");
 
-  fd = hyportLibrary.file_open(&hyportLibrary, "hytest.tmp",
+  Hytest_init(&hyportLibrary, "Portlib.Hyfile");
+  Hytest_func(&hyportLibrary, test_hyfile_open, "hyfile_open");
+  Hytest_func(&hyportLibrary, test_hyfile_write, "hyfile_write");
+  Hytest_func(&hyportLibrary, test_hyfile_write_text, "hyfile_write_text");
+  Hytest_func(&hyportLibrary, test_hyfile_printf, "hyfile_printf");
+  Hytest_func(&hyportLibrary, test_hyfile_sync, "hyfile_sync");
+  Hytest_func(&hyportLibrary, test_hyfile_set_length, "hyfile_set_length");
+  Hytest_func(&hyportLibrary, test_hyfile_move, "hyfile_move");
+  Hytest_func(&hyportLibrary, test_hyfile_seek, "hyfile_seek");
+  Hytest_func(&hyportLibrary, test_hyfile_read, "hyfile_read");
+  Hytest_func(&hyportLibrary, test_hyfile_length, "hyfile_length");
+  Hytest_func(&hyportLibrary, test_hyfile_attr, "hyfile_attr");
+  Hytest_func(&hyportLibrary, test_hyfile_error_message, "hyfile_error_message");
+  Hytest_func(&hyportLibrary, test_hyfile_findfirst, "hyfile_findfirst");
+  Hytest_func(&hyportLibrary, test_hyfile_findnext, "hyfile_findnext");
+  Hytest_func(&hyportLibrary, test_hyfile_findclose, "hyfile_findclose");
+  Hytest_func(&hyportLibrary, test_hyfile_mkdir, "hyfile_mkdir");
+  Hytest_func(&hyportLibrary, test_hyfile_unlinkdir, "hyfile_unlinkdir");
+  Hytest_func(&hyportLibrary, test_hyfile_lastmod, "hyfile_lastmod");
+  Hytest_func(&hyportLibrary, test_hyfile_vprintf, "hyfile_vprintf");
+  ret = Hytest_close_and_output(&hyportLibrary);  
+  
+  if (0 != hyportLibrary.port_shutdown_library (&hyportLibrary)) {
+    fprintf(stderr, "portlib shutdown failed\n");
+    return 1;
+  }
+  printf("  portlib shutdown\n");
+
+  return ret;
+}
+
+void cleanup(HyPortLibrary hyportLibrary)
+{
+  char tmpAbsolutePath[255];
+  generateAbsoluteFilePath(&hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  hyportLibrary.file_unlink(&hyportLibrary, tmpAbsolutePath);
+  generateAbsoluteFilePath(&hyportLibrary,tmpAbsolutePath,"hytest.tmp2");
+  hyportLibrary.file_unlink(&hyportLibrary, tmpAbsolutePath);
+  generateAbsoluteFilePath(&hyportLibrary,tmpAbsolutePath,"hytest.dir.tmp");
+  hyportLibrary.file_unlinkdir(&hyportLibrary, tmpAbsolutePath);
+}
+
+void generateAbsoluteFilePath(struct HyPortLibrary *hyportLibrary,char *dist , char *fileName)
+{
+  char* buf;
+  int i=0;
+  hyportLibrary->sysinfo_get_executable_name(hyportLibrary,"",&buf);
+  i=strlen(buf)-1;
+  for(;i>=0;i--)
+  {
+    if(buf[i]==DIR_SEPARATOR)
+    {
+      buf[i+1]='\0';
+      break;
+    }
+  }
+  strcpy(dist,buf);
+  strcpy(&dist[i+1],fileName);
+  hyportLibrary->mem_free_memory(hyportLibrary, buf);
+}
+
+int test_hyfile_open(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_open......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
                                HyOpenCreate | HyOpenWrite | HyOpenTruncate,
                                0600);
   printf("  fd = %d\n", fd);
-  if (!fd) {
-    fprintf(stderr, "Failed to open hytest.tmp for write %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  return 0;
+}
 
-  bytes = hyportLibrary.file_write(&hyportLibrary, fd, (void*)"testing", 7);
+int test_hyfile_write(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  IDATA bytes;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_write......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s\n(%s)",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  bytes = hyportLibrary->file_write(hyportLibrary, fd, (void*)"testing", 7);
   printf("  hyfile_write wrote %d bytes\n", bytes);
   if (bytes != 7) {
-    fprintf(stderr, "hyfile_write wrote %d bytes not %d\n", bytes, 7);
-    cleanup(hyportLibrary);
-    exit(1);
+    Hytest_setErrMsg(hyportLibrary, "Output should be [%d] not [%d] (%s)\n", 7, bytes,HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  return 0;
+}
 
-  rc = hyportLibrary.file_write_text(&hyportLibrary, fd, "testing", 7);
+int test_hyfile_write_text(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_write_text......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_write_text(hyportLibrary, fd, "testing", 7);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_write_text write failed: %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
   if (rc != 0) {
-    fprintf(stderr, "hyfile_write_text write failed: %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  return 0;
+}
 
-  hyportLibrary.file_printf(&hyportLibrary, fd, "%d%c%s", 1, '2', "3");
-  rc = hyportLibrary.file_sync(&hyportLibrary, fd);
+int test_hyfile_printf(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  IDATA bytes;
+  char tmpAbsolutePath[255];
+  char buf[255];
+  
+  printf("testing hyfile_printf......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  hyportLibrary->file_printf(hyportLibrary, fd, "%09d %7.4d %7.2f",9,-2,3.1415926535);
+  
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenRead, 0000);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open hytest.tmp for read %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  bytes = hyportLibrary->file_read(hyportLibrary, fd, buf, 25);
+  printf("  bytes = %d\n", bytes);
+  buf[bytes] = '\0';
+  printf("  buf = %s\n", buf);
+  
+  if (bytes != 25) {
+    Hytest_setErrMsg(hyportLibrary, "Output should be [%d] not [%d](%s)\n",25,bytes,HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+
+  if (strcmp(buf, "000000009   -0002    3.14") != 0) {
+    Hytest_setErrMsg(hyportLibrary, "Output should be [%s] not [%s] (%s)\n","000000009   -0002    3.14",buf,HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
   if (rc != 0) {
-    fprintf(stderr, "hyfile_sync failed %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  return 0;
+}
 
-  rc = hyportLibrary.file_close(&hyportLibrary, fd);
+int test_hyfile_sync(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_sync......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  hyportLibrary->file_printf(hyportLibrary, fd, "%d%c%s\n", 1, '2', "3");
+  rc = hyportLibrary->file_sync(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_sync failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
   if (rc != 0) {
-    fprintf(stderr, "hyfile_close failed %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  return 0;
+}
 
-  rc = hyportLibrary.file_move(&hyportLibrary, "hytest.tmp", "hytest.tmp2");
+int test_hyfile_set_length(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_set_length......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_set_length (hyportLibrary, fd, 200);
+  if(0 != rc)
+  {
+    Hytest_setErrMsg(hyportLibrary, "Failed to set file hytest.tmp2's length  %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
   if (rc != 0) {
-    fprintf(stderr, "hyfile_move failed %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  return 0;
+}
 
-  fd = hyportLibrary.file_open(&hyportLibrary, "hytest.tmp2",
-                               HyOpenRead, 0000);
+int test_hyfile_move(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  char tmp2AbsolutePath[255];
+  
+  printf("testing hyfile_move......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
   printf("  fd = %d\n", fd);
-  if (!fd) {
-    fprintf(stderr, "Failed to open hytest.tmp2 for read %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  generateAbsoluteFilePath(hyportLibrary,tmp2AbsolutePath,"hytest2.tmp");
+  rc = hyportLibrary->file_move(hyportLibrary, tmpAbsolutePath, tmp2AbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_move failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmp2AbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  return 0;
+}
 
-  offset = hyportLibrary.file_seek(&hyportLibrary, fd, -10, HySeekEnd);
+int test_hyfile_seek(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  I_64 offset;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_seek......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_set_length (hyportLibrary, fd, 200);
+  if(0 != rc)
+  {
+    Hytest_setErrMsg(hyportLibrary, "Failed to set file hytest.tmp2's length  %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  offset = hyportLibrary->file_seek(hyportLibrary, fd, -193, HySeekEnd);
   printf("  offset = %d\n", offset);
   if (offset != 7) {
-    fprintf(stderr, "Failed to seek hytest.tmp2\n");
-    cleanup(hyportLibrary);
-    exit(1);
+    Hytest_setErrMsg(hyportLibrary, "Output should be [%d] not [%d] (%s)\n",7,offset,HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  return 0;
+}
 
-  bytes = hyportLibrary.file_read(&hyportLibrary, fd, buf, 10);
+int test_hyfile_read(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  IDATA bytes;
+  char tmpAbsolutePath[255];
+  char buf[20];
+  
+  printf("testing hyfile_read......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_write_text(hyportLibrary, fd, "0123456789", 10);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_write_text write failed: %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenRead, 0000);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open hytest.tmp for read %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  bytes = hyportLibrary->file_read(hyportLibrary, fd, buf, 5);
   printf("  bytes = %d\n", bytes);
   buf[bytes] = '\0';
   printf("  buf = %s\n", buf);
-  if (bytes != 10) {
-    fprintf(stderr, "Failed to read hytest.tmp2\n");
-    cleanup(hyportLibrary);
-    exit(1);
+  
+  if (bytes != 5) {
+    Hytest_setErrMsg(hyportLibrary, "Output should be [%d] not [%d] (%s)\n",5,bytes,HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+
+  if (strcmp(buf, "01234") != 0) {
+    Hytest_setErrMsg(hyportLibrary, "Output should be [%s] not [%s] (%s)\n","02134",buf,HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  return 0;
+}
 
-  if (strcmp(buf, "testing123") != 0) {
-    fprintf(stderr, "Failed to read correct content from hytest.tmp2\n");
-    cleanup(hyportLibrary);
-    exit(1);
+int test_hyfile_length(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  I_64 length;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_length......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_set_length (hyportLibrary, fd, 200);
+  if(0 != rc)
+  {
+    Hytest_setErrMsg(hyportLibrary, "Failed to set file hytest.tmp2's length  %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  length = hyportLibrary->file_length(hyportLibrary, tmpAbsolutePath);
+  printf("  length = %d\n", length);
+  if (length != 200) {
+    Hytest_setErrMsg(hyportLibrary, "Output should be [%d] not [%d] (%s)\n",200,length,HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  return 0;
+}
 
-  rc = hyportLibrary.file_close(&hyportLibrary, fd);
+int test_hyfile_attr(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  printf("testing hyfile_attr......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    hyportLibrary->file_close(hyportLibrary, fd);
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  if (hyportLibrary->file_attr(hyportLibrary, tmpAbsolutePath) != HyIsFile) {
+    Hytest_setErrMsg(hyportLibrary, "hytest.tmp has incorrect type(%s)\n",HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
   if (rc != 0) {
-    fprintf(stderr, "hyfile_close failed %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  return 0;
+}
 
-  length = hyportLibrary.file_length(&hyportLibrary, "hytest.tmp2");
-  printf("  length = %d\n", length);
-  if (length != 17) {
-    fprintf(stderr, "hytest.tmp2 has incorrect length\n");
-    cleanup(hyportLibrary);
-    exit(1);
+int test_hyfile_error_message(struct HyPortLibrary *hyportLibrary)
+{
+  printf("testing hyfile_error_message......\n");
+  printf("  file_error_message: %s\n",hyportLibrary->file_error_message(hyportLibrary));
+  return 0;
+}
+
+int test_hyfile_findfirst(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  char tmpAbsolutePath[255];
+  char buf[100];
+  
+  printf("testing hyfile_findfirst......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"");
+
+  
+  fd = hyportLibrary->file_findfirst(hyportLibrary , tmpAbsolutePath, buf);
+  printf("  resultbuf: %s\n",buf);
+  if(fd==-1){
+    Hytest_setErrMsg(hyportLibrary, "Can not find file.(%s)\n",HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;	
   }
+  return 0;
+}
 
-  if (hyportLibrary.file_attr(&hyportLibrary, "hytest.tmp2") != HyIsFile) {
-    fprintf(stderr, "hytest.tmp2 has incorrect type\n");
-    cleanup(hyportLibrary);
-    exit(1);
+int test_hyfile_findnext(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  char buf[100];
+  
+  printf("testing hyfile_findnext......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"");
+  
+  fd = hyportLibrary->file_findfirst(hyportLibrary , tmpAbsolutePath, buf);
+  printf("  resultbuf: %s\n",buf);
+  if(fd==-1){
+    Hytest_setErrMsg(hyportLibrary, "Can not find file.(%s)\n",HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;	
+  }
+  
+  rc = hyportLibrary->file_findnext(hyportLibrary, fd, buf);
+  if(rc == 0 ) {
+    printf("  find next successfully! resultbuf: %s\n",buf);
+  }
+  else if(rc == -1){
+   printf("  find failed!\n");
   }
+  
+  return 0;
+}
 
-  rc = hyportLibrary.file_unlink(&hyportLibrary, "hytest.tmp2");
-  if (rc != 0) {
-    fprintf(stderr, "hyfile_unlink failed %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+int test_hyfile_findclose(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  char buf[100];
+  
+  printf("testing hyfile_findclose......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"");
+  
+  fd = hyportLibrary->file_findfirst(hyportLibrary , tmpAbsolutePath, buf);
+  printf("  resultbuf: %s\n",buf);
+  if(fd==-1){
+    Hytest_setErrMsg(hyportLibrary, "Can not find file.(%s)\n",HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_findnext(hyportLibrary, fd, buf);
+  if(rc == 0 ) {
+    printf("  find next successfully! resultbuf: %s\n",buf);
+  }
+  else if(rc == -1){
+   printf("  find failed!\n");
   }
+  
+  hyportLibrary->file_findclose(hyportLibrary , fd);
+  return 0;
+}
 
-  rc = hyportLibrary.file_mkdir(&hyportLibrary, "hytest.dir.tmp");
+int test_hyfile_mkdir(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  char utf8Dir[10];
+  int utf8len=0;
+  
+  utf8Dir[0]='d';
+  utf8Dir[1]='i';
+  utf8Dir[2]='r';
+  utf8len = encodeUTF8CharN (0x3400, &utf8Dir[3], 7);
+  utf8Dir[utf8len+3]='\0';
+  
+  printf("testing hyfile_mkdir......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,utf8Dir);
+  
+  rc = hyportLibrary->file_mkdir(hyportLibrary, tmpAbsolutePath);
   if (rc != 0) {
-    fprintf(stderr, "hyfile_mkdir failed %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+    Hytest_setErrMsg(hyportLibrary, "hyfile_mkdir failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  if (hyportLibrary->file_attr(hyportLibrary, tmpAbsolutePath) != HyIsDir) {
+    Hytest_setErrMsg(hyportLibrary, "hytest.dir.tmp has incorrect type(%s)\n",HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
-
-  if (hyportLibrary.file_attr(&hyportLibrary, "hytest.dir.tmp") != HyIsDir) {
-    fprintf(stderr, "hytest.dir.tmp has incorrect type\n");
-    cleanup(hyportLibrary);
-    exit(1);
+  
+  rc = hyportLibrary->file_unlinkdir(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlinkdir failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  return 0;
+}
 
-  rc = hyportLibrary.file_unlinkdir(&hyportLibrary, "hytest.dir.tmp");
+int test_hyfile_unlinkdir(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_unlinkdir......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.dir.tmp");
+  rc = hyportLibrary->file_mkdir(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_mkdir failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  if (hyportLibrary->file_attr(hyportLibrary, tmpAbsolutePath) != HyIsDir) {
+    Hytest_setErrMsg(hyportLibrary, "hytest.dir.tmp has incorrect type(%s)\n",HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlinkdir(hyportLibrary, tmpAbsolutePath);
   if (rc != 0) {
-    fprintf(stderr, "hyfile_unlinkdir failed %s\n",
-            hyportLibrary.error_last_error_message(&hyportLibrary));
-    cleanup(hyportLibrary);
-    exit(1);
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlinkdir failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
+  return 0;
+}
 
-  if (0 != hyportLibrary.port_shutdown_library (&hyportLibrary)) {
-    fprintf(stderr, "portlib shutdown failed\n");
-    return 1;
+int test_hyfile_lastmod(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  I_64 time;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_lastmod......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
   }
-  printf("  portlib shutdown\n");
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  time = hyportLibrary->file_lastmod (hyportLibrary, tmpAbsolutePath);  
+  printf("  last modify time = %I64d\n", time);
+  if (time == -1) {
+    Hytest_setErrMsg(hyportLibrary, "fail to get last modify time(%s)\n",HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  return 0;
+}
 
+int test_hyfile_vprintf(struct HyPortLibrary *hyportLibrary)
+{
+  
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  
+  printf("testing hyfile_printf......\n");
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (fd==-1) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytest.tmp%s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  forVprintfTest(hyportLibrary,fd,"%09d",9);
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s(%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
   return 0;
 }
 
-void cleanup(HyPortLibrary hyportLibrary)
+void forVprintfTest(struct HyPortLibrary *hyportLibrary,IDATA fd,char* format,...)
 {
-  hyportLibrary.file_unlink(&hyportLibrary, "hytest.tmp");
-  hyportLibrary.file_unlink(&hyportLibrary, "hytest.tmp2");
-  hyportLibrary.file_unlinkdir(&hyportLibrary, "hytest.dir.tmp");
+  va_list args;
+  va_start (args, format);
+  hyportLibrary->file_vprintf (hyportLibrary, fd, format, args);
+  va_end (args);
 }

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/unix/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/unix/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/unix/makefile Thu Jun 21 01:54:01 2007
@@ -1,29 +1,32 @@
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-
-#
-# Makefile for 'hyfile'
-#
-
-include $(HY_HDK)/build/make/defines.mk
-
-BUILDFILES = $(SHAREDSUB)hyfile.o
-MDLLIBFILES += $(DLLPATH)libhyprt$(HY_LINKLIB_SUFFIX)
-ifeq ($(HY_NO_THR),true)
-MDLLIBFILES += $(LIBPATH)libhythr$(HY_LINKLIB_SUFFIX)
-endif
-EXENAME = ../hyfile
-
-include $(HY_HDK)/build/make/rules.mk
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for 'hyfile'
+#
+
+include $(HY_HDK)/build/make/defines.mk
+
+INCLUDES += -I../../hycunit
+BUILDFILES = $(SHAREDSUB)hyfile.o
+BUILDFILES += ../../hycunit/hycunit.o
+MDLLIBFILES += $(DLLPATH)libhyprt$(HY_LINKLIB_SUFFIX)
+ifeq ($(HY_NO_THR),true)
+MDLLIBFILES += $(LIBPATH)libhythr$(HY_LINKLIB_SUFFIX)
+endif
+EXENAME = ../hyfile
+
+CLEANFILES=../TEST-*.xml
+include $(HY_HDK)/build/make/rules.mk

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/windows/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/windows/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/windows/makefile Thu Jun 21 01:54:01 2007
@@ -20,9 +20,10 @@
 !include <$(HY_HDK)\build\make\defines.mak>
 
 EXENAME=..\hyfile.exe
-HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB)
+HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB) /I..\..\hycunit
 
 BUILDFILES = $(SHAREDSUB)hyfile.obj
+BUILDFILES = $(BUILDFILES) ..\..\hycunit\hycunit.obj
 MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hyprt$(HY_LINKLIB_SUFFIX)
 
 !IF "$(HY_NO_THR)" == "true"
@@ -31,5 +32,6 @@
 
 EXEFLAGS=$(conlflags) -subsystem:console
 EXEDLLFILES=$(conlibsdll)
+CLEANFILES=..\TEST-*.xml
 
 !include <$(HY_HDK)\build\make\rules.mak>

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/shared/hyfiletext.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/shared/hyfiletext.c?view=auto&rev=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/shared/hyfiletext.c (added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/shared/hyfiletext.c Thu Jun 21 01:54:01 2007
@@ -0,0 +1,230 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "hycomp.h"
+#include "hyport.h"
+#include "hycunit.h"
+
+void cleanup(HyPortLibrary hyportLibrary);
+void generateAbsoluteFilePath(struct HyPortLibrary *hyportLibrary,char *dist , char *fileName);
+int test_hybuf_write_text(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_write_text(struct HyPortLibrary *hyportLibrary);
+int test_hyfile_read_text(struct HyPortLibrary *hyportLibrary);
+
+
+
+int main (int argc, char **argv, char **envp)
+{
+  HyPortLibrary hyportLibrary;
+  HyPortLibraryVersion portLibraryVersion;
+  char* buf=NULL;
+  int ret;
+  
+  printf("hyfiletext:\n");
+  
+  HYPORT_SET_VERSION (&portLibraryVersion, HYPORT_CAPABILITY_MASK);
+  if (0 != hyport_init_library (&hyportLibrary, &portLibraryVersion,
+                                sizeof (HyPortLibrary)))
+  {
+    fprintf(stderr, "portlib init failed\n");
+    return 1;
+  }
+  
+  
+  Hytest_init(&hyportLibrary, "Portlib.Hyfiletext");
+  Hytest_func(&hyportLibrary, test_hybuf_write_text, "hybuf_write_text");
+  Hytest_func(&hyportLibrary, test_hyfile_write_text, "hyfile_write_text");
+  Hytest_func(&hyportLibrary, test_hyfile_read_text, "hyfile_read_text");
+  ret = Hytest_close_and_output(&hyportLibrary);
+  
+  if (0 != hyportLibrary.port_shutdown_library (&hyportLibrary)) {
+    fprintf(stderr, "portlib shutdown failed\n");
+    return 1;
+  }
+  printf("  portlib shutdown\n");
+
+  return ret;
+}
+
+void cleanup(HyPortLibrary hyportLibrary)
+{
+  hyportLibrary.file_unlink(&hyportLibrary, "hytexttest.tmp");
+}
+
+void generateAbsoluteFilePath(struct HyPortLibrary *hyportLibrary,char *dist , char *fileName)
+{
+  char* buf;
+  int i=0;
+  hyportLibrary->sysinfo_get_executable_name(hyportLibrary,"",&buf);
+  i=strlen(buf)-1;
+  for(;i>=0;i--)
+  {
+    if(buf[i]==DIR_SEPARATOR)
+    {
+      buf[i+1]='\0';
+      break;
+    }
+  }
+  strcpy(dist,buf);
+  strcpy(&dist[i+1],fileName);
+  hyportLibrary->mem_free_memory(hyportLibrary, buf);
+}
+
+int test_hybuf_write_text(struct HyPortLibrary *hyportLibrary)
+{
+  char inbuf[] = {0xE2,0x89,0xA0};
+  char* outbuf = NULL;
+  outbuf = hyportLibrary->buf_write_text(hyportLibrary,inbuf,3);
+  if(!outbuf)
+  {
+    Hytest_setErrMsg(hyportLibrary, "Failed to run function buf_write_text %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    return -1;
+  }
+  printf("  %s",outbuf);
+  return 0;
+}
+
+int test_hyfile_write_text(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char tmpAbsolutePath[255];
+  char* outbuf = NULL;
+  char inbuf[] = {0xE2,0x89,0xA0};
+  
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytexttest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (!fd) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytexttest.tmp%s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_write_text(hyportLibrary, fd, inbuf ,3);
+  if(rc != 0)
+  {
+    Hytest_setErrMsg(hyportLibrary, "Failed to write text to hytexttest.tmp %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;	
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  return 0;
+}
+
+int test_hyfile_read_text(struct HyPortLibrary *hyportLibrary)
+{
+  IDATA fd;
+  IDATA rc;
+  char* out2 = NULL;
+  char outbuf[10];
+  char inbuf[] = {0xE2,0x89,0xA0};
+  char tmpAbsolutePath[255];
+  
+  generateAbsoluteFilePath(hyportLibrary,tmpAbsolutePath,"hytexttest.tmp");
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenCreate | HyOpenWrite | HyOpenTruncate,
+                               0600);
+  printf("  fd = %d\n", fd);
+  if (!fd) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open file hytexttest.tmp%s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_write_text(hyportLibrary, fd, inbuf ,3);
+  if(rc != 0)
+  {
+    Hytest_setErrMsg(hyportLibrary, "Failed to write text to hytexttest.tmp %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;	
+  }
+  
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  fd = hyportLibrary->file_open(hyportLibrary, tmpAbsolutePath,
+                               HyOpenRead, 0000);
+  printf("  fd = %d\n", fd);
+  if (!fd) {
+    Hytest_setErrMsg(hyportLibrary, "Failed to open hytest.tmp2 for read %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+ 
+  out2 = hyportLibrary->file_read_text(hyportLibrary, fd, outbuf, 10);
+  if(!out2)
+  {
+    Hytest_setErrMsg(hyportLibrary, "Failed to read text from hytexttest.tmp %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;	
+  }
+  else
+  {
+    printf("  %s\n",outbuf);
+  }
+
+  rc = hyportLibrary->file_close(hyportLibrary, fd);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_close failed %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  
+  rc = hyportLibrary->file_unlink(hyportLibrary, tmpAbsolutePath);
+  if (rc != 0) {
+    Hytest_setErrMsg(hyportLibrary, "hyfile_unlink failed %s (%s)\n",
+            hyportLibrary->error_last_error_message(hyportLibrary),HY_GET_CALLSITE());
+    cleanup(*hyportLibrary);
+    return -1;
+  }
+  return 0;
+}

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/unix/makefile?view=auto&rev=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/unix/makefile (added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/unix/makefile Thu Jun 21 01:54:01 2007
@@ -0,0 +1,32 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for 'hyfiletext'
+#
+
+include $(HY_HDK)/build/make/defines.mk
+
+INCLUDES += -I../../hycunit
+BUILDFILES = $(SHAREDSUB)hyfiletext.o
+BUILDFILES += ../../hycunit/hycunit.o
+MDLLIBFILES += $(DLLPATH)libhyprt$(HY_LINKLIB_SUFFIX)
+ifeq ($(HY_NO_THR),true)
+MDLLIBFILES += $(LIBPATH)libhythr$(HY_LINKLIB_SUFFIX)
+endif
+EXENAME = ../hyfiletext
+
+CLEANFILES=../TEST-*.xml
+include $(HY_HDK)/build/make/rules.mk

Added: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/windows/makefile?view=auto&rev=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/windows/makefile (added)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfiletext/windows/makefile Thu Jun 21 01:54:01 2007
@@ -0,0 +1,37 @@
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for module 'hyfiletext.exe'
+#
+
+!include <$(HY_HDK)\build\make\defines.mak>
+
+EXENAME=..\hyfiletext.exe
+HYCFLAGS = $(HYCFLAGS) /I$(SHAREDSUB) /I..\..\hycunit
+
+BUILDFILES = $(SHAREDSUB)hyfiletext.obj
+BUILDFILES = $(BUILDFILES) ..\..\hycunit\hycunit.obj
+MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hyprt$(HY_LINKLIB_SUFFIX)
+
+!IF "$(HY_NO_THR)" == "true"
+MDLLIBFILES = $(MDLLIBFILES) $(LIBPATH)hythr$(HY_LINKLIB_SUFFIX)
+!ENDIF
+
+EXEFLAGS=$(conlflags) -subsystem:console
+EXEDLLFILES=$(conlibsdll)
+CLEANFILES=..\TEST-*.xml
+
+!include <$(HY_HDK)\build\make\rules.mak>

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/unix/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/unix/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/unix/makefile Thu Jun 21 01:54:01 2007
@@ -1,31 +1,32 @@
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-
-#
-# Makefile for 'hygp'
-#
-
-include $(HY_HDK)/build/make/defines.mk
-
-INCLUDES += -I../../hycunit
-BUILDFILES = $(SHAREDSUB)hygp.o
-BUILDFILES += ../../hycunit/hycunit.o
-MDLLIBFILES += $(DLLPATH)libhyprt$(HY_LINKLIB_SUFFIX)
-ifeq ($(HY_NO_THR),true)
-MDLLIBFILES += $(LIBPATH)libhythr$(HY_LINKLIB_SUFFIX)
-endif
-EXENAME = ../hygp
-
-include $(HY_HDK)/build/make/rules.mk
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for 'hygp'
+#
+
+include $(HY_HDK)/build/make/defines.mk
+
+INCLUDES += -I../../hycunit
+BUILDFILES = $(SHAREDSUB)hygp.o
+BUILDFILES += ../../hycunit/hycunit.o
+MDLLIBFILES += $(DLLPATH)libhyprt$(HY_LINKLIB_SUFFIX)
+ifeq ($(HY_NO_THR),true)
+MDLLIBFILES += $(LIBPATH)libhythr$(HY_LINKLIB_SUFFIX)
+endif
+EXENAME = ../hygp
+
+CLEANFILES=../TEST-*.xml
+include $(HY_HDK)/build/make/rules.mk

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/windows/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/windows/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hygp/windows/makefile Thu Jun 21 01:54:01 2007
@@ -32,5 +32,6 @@
 
 EXEFLAGS=$(conlflags) -subsystem:console
 EXEDLLFILES=$(conlibsdll)
+CLEANFILES=..\TEST-*.xml
 
 !include <$(HY_HDK)\build\make\rules.mak>

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/unix/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/unix/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/unix/makefile Thu Jun 21 01:54:01 2007
@@ -1,31 +1,32 @@
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-
-#
-# Makefile for 'hymem'
-#
-
-include $(HY_HDK)/build/make/defines.mk
-
-INCLUDES += -I../../hycunit
-BUILDFILES = $(SHAREDSUB)hymem.o
-BUILDFILES += ../../hycunit/hycunit.o
-MDLLIBFILES += $(DLLPATH)libhyprt$(HY_LINKLIB_SUFFIX)
-ifeq ($(HY_NO_THR),true)
-MDLLIBFILES += $(LIBPATH)libhythr$(HY_LINKLIB_SUFFIX)
-endif
-EXENAME = ../hymem
-
-include $(HY_HDK)/build/make/rules.mk
+#  Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  See the NOTICE file distributed with
+#  this work for additional information regarding copyright ownership.
+#  The ASF licenses this file to You under the Apache License, Version 2.0
+#  (the "License"); you may not use this file except in compliance with
+#  the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+#
+# Makefile for 'hymem'
+#
+
+include $(HY_HDK)/build/make/defines.mk
+
+INCLUDES += -I../../hycunit
+BUILDFILES = $(SHAREDSUB)hymem.o
+BUILDFILES += ../../hycunit/hycunit.o
+MDLLIBFILES += $(DLLPATH)libhyprt$(HY_LINKLIB_SUFFIX)
+ifeq ($(HY_NO_THR),true)
+MDLLIBFILES += $(LIBPATH)libhythr$(HY_LINKLIB_SUFFIX)
+endif
+EXENAME = ../hymem
+
+CLEANFILES=../TEST-*.xml
+include $(HY_HDK)/build/make/rules.mk

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/windows/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/windows/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hymem/windows/makefile Thu Jun 21 01:54:01 2007
@@ -32,5 +32,6 @@
 
 EXEFLAGS=$(conlflags) -subsystem:console
 EXEDLLFILES=$(conlibsdll)
+CLEANFILES=..\TEST-*.xml
 
 !include <$(HY_HDK)\build\make\rules.mak>

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/unix/makefile Thu Jun 21 01:54:01 2007
@@ -28,4 +28,5 @@
 endif
 EXENAME = ../hytime
 
+CLEANFILES=../TEST-*.xml
 include $(HY_HDK)/build/make/rules.mk

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile?view=diff&rev=549434&r1=549433&r2=549434
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hytime/windows/makefile Thu Jun 21 01:54:01 2007
@@ -32,5 +32,6 @@
 
 EXEFLAGS=$(conlflags) -subsystem:console
 EXEDLLFILES=$(conlibsdll)
+CLEANFILES=..\TEST-*.xml
 
 !include <$(HY_HDK)\build\make\rules.mak>



Mime
View raw message