Пример #1
0
int main (int argc, char **argv, char **envp)
{
  HyPortLibrary hyportLibrary;
  HyPortLibraryVersion portLibraryVersion;
  int ret;

  printf("hymem:\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;
  }

  printf("  portlib initialized\n");
  
  Hytest_init(&hyportLibrary, "Portlib.Hymem");
  Hytest_func(&hyportLibrary, test_hymem_allocate_memory, "hymem_allocate_memory");
  Hytest_func(&hyportLibrary, test_hymem_allocate_memory_callSite, "hymem_allocate_memory_callSite");
  Hytest_func(&hyportLibrary, test_hymem_free_memory, "hymem_free_memory");
  Hytest_func(&hyportLibrary, test_hymem_reallocate_memory, "hymem_reallocate_memory");
  Hytest_func(&hyportLibrary, test_hymem_shutdown, "hymem_shutdown");
  Hytest_func(&hyportLibrary, test_hymem_startup, "hymem_startup");
  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;
}
Пример #2
0
int main (int argc, char **argv, char **envp)
{
  HyPortLibrary hyportLibrary;
  HyPortLibraryVersion portLibraryVersion;

  printf("init:\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;
  }

  printf("  portlib initialized\n");
  
  if (0 != hyportLibrary.port_shutdown_library (&hyportLibrary)) {
    fprintf(stderr, "portlib shutdown failed\n");
    return 1;
  }
  printf("  portlib shutdown\n");

  return 0;
}
Пример #3
0
int main (int argc, char **argv, char **envp)
{
  HyPortLibrary hyportLibrary;
  HyPortLibraryVersion portLibraryVersion;
  int ret;

  printf("hytime:\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;
  }

  printf("  portlib initialized\n");

#ifdef HY_NO_THR
  privateThreadLibrary = hyportLibrary.port_get_thread_library(&hyportLibrary);
#endif

  Hytest_init(&hyportLibrary, "Portlib.Hytime");
  Hytest_func(&hyportLibrary, test_hytime_current_time_millis, "hytime_current_time_millis");
  Hytest_func(&hyportLibrary, test_hytime_msec_clock, "hytime_msec_clock");
  Hytest_func(&hyportLibrary, test_hytime_hires_clock, "hytime_hires_clock");
  Hytest_func(&hyportLibrary, test_hytime_hires_delta, "hytime_hires_delta");
  Hytest_func(&hyportLibrary, test_hytime_hires_frequency, "hytime_hires_frequency");
  Hytest_func(&hyportLibrary, test_hytime_usec_clock, "hytime_usec_clock");
  Hytest_func(&hyportLibrary, test_hytime_shutdown, "hytime_shutdown");
  Hytest_func(&hyportLibrary, test_hytime_startup, "hytime_startup");
  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;
}
Пример #4
0
int main (int argc, char **argv, char **envp)
{
  HyPortLibrary hyportLibrary;
  HyPortLibraryVersion portLibraryVersion;
  int ret;
  
  printf("hyport:\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;
  }
  
  printf("  portlib initialized\n");
  
  Hytest_init(&hyportLibrary, "Portlib.Hyport");
  Hytest_func(&hyportLibrary, test_hyport_init_library, "hyport_init_library");
  Hytest_func(&hyportLibrary, test_hyport_shutdown_library, "hyport_shutdown_library");
  Hytest_func(&hyportLibrary, test_hyport_getSize, "hyport_getSize");
  Hytest_func(&hyportLibrary, test_hyport_create_library, "hyport_create_library");
  Hytest_func(&hyportLibrary, test_hyport_allocate_library, "hyport_allocate_library");
  Hytest_func(&hyportLibrary, test_hyport_getVersion, "hyport_getVersion");
  Hytest_func(&hyportLibrary, test_hyport_isCompatible, "hyport_isCompatible");
  Hytest_func(&hyportLibrary, test_hyport_isFunctionOverridden, "hyport_isFunctionOverridden");
  
  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;
}