/** * Unit test framework entry point for this set of unit tests. */ void testDir_win32_runTests() { int status; pcsl_mem_initialize(NULL, 0); pcsl_string_initialize(); status = init(); assertTrue("init failed", status == 0); /* Tests for additional API needed for JSR-75 */ testDirectories(); // Temporarily disabled for POSIX //testSizes(); // Temporarily disabled for POSIX //testAttributes(); // Temporarily disabled for POSIX //testTimes(); tearDown(); pcsl_string_finalize(); pcsl_mem_finalize(); }
int main(int argc, char **argv) { #if ENABLE_PCSL pcsl_mem_initialize(NULL, 0); #endif // Call this before any other Jvm_ functions. JVM_Initialize(); // Ignore arg[0] -- the name of the program. argc --; argv ++; while (true) { int n = JVM_ParseOneArg(argc, argv); if (n < 0) { JVMSPI_DisplayUsage(NULL); return -1; } else if (n == 0) { break; } argc -= n; argv += n; } int rv; if (JVM_GetConfig(JVM_CONFIG_SLAVE_MODE) == KNI_FALSE) { // Run the VM in regular mode -- JVM_Start won't return until // the VM completes execution. rv = JVM_Start(NULL, NULL, argc, argv); } else { JVM_Start(NULL, NULL, argc, argv); for (;;) { jlong timeout = JVM_TimeSlice(); if (timeout <= ((jlong)-2)) { break; } else { int blocked_threads_count; JVMSPI_BlockedThreadInfo * blocked_threads; blocked_threads = SNI_GetBlockedThreads(&blocked_threads_count); JVMSPI_CheckEvents(blocked_threads, blocked_threads_count, timeout); } } rv = JVM_CleanUp(); } printf("ADSEXITCODE=%d\n", rv); #if ENABLE_PCSL pcsl_mem_finalize(); #endif return rv; }
/* * Unit test framework entry point for this set of unit tests. * */ void testMem_runTests() { pcsl_mem_initialize(NULL, 5000); testAllocation(); testMalloc(); testAllocateChunk(); /* * comment out this test. The implementation changes the * specified max size, to align with a page * need revisit: what the new max size is. So we can't * compare against it. */ /* testModifyChunkSize(); */ testDoubleInit(); testHeapSize(); testCalloc(); testRealloc(); testStrdup(); pcsl_mem_finalize(); }
int main(int argc, char **argv) { int code = 0; #if ENABLE_PCSL pcsl_mem_initialize(NULL, 0); #endif // Call this before any other Jvm_ functions. JVM_Initialize(); // Ignore arg[0] -- the name of the program. argc --; argv ++; while (true) { int n = JVM_ParseOneArg(argc, argv); if (n < 0) { printf("Unknown argument: %s\n", argv[0]); JVMSPI_DisplayUsage(NULL); code = -1; goto end; } else if (n == 0) { break; } argc -= n; argv += n; } if (JVM_GetConfig(JVM_CONFIG_SLAVE_MODE) == KNI_FALSE) { // Run the VM in regular mode -- JVM_Start won't return until // the VM completes execution. code = JVM_Start(NULL, NULL, argc, argv); } else { // Run the VM in slave mode -- we keep calling JVM_TimeSlice(), // which executes bytecodes for a small amount and returns. This // mode is necessary for platforms that need to keep the main // control loop outside of of the VM. // // Note that this mode is not necessary on Win32. We do it here // just as a demo. JVM_Start(NULL, NULL, argc, argv); for (;;) { jlong timeout = JVM_TimeSlice(); if (timeout <= -2) { break; } else { int blocked_threads_count; JVMSPI_BlockedThreadInfo * blocked_threads; blocked_threads = SNI_GetBlockedThreads(&blocked_threads_count); JVMSPI_CheckEvents(blocked_threads, blocked_threads_count, timeout); } } code = JVM_CleanUp(); } end: #if ENABLE_PCSL pcsl_mem_finalize(); #endif return code; }