Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 67602 invoked from network); 12 Aug 2009 16:35:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Aug 2009 16:35:37 -0000 Received: (qmail 44755 invoked by uid 500); 12 Aug 2009 16:35:44 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 44668 invoked by uid 500); 12 Aug 2009 16:35:44 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 44659 invoked by uid 99); 12 Aug 2009 16:35:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Aug 2009 16:35:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Aug 2009 16:35:40 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3C07423888EC; Wed, 12 Aug 2009 16:35:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r803585 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr_getopt.h include/arch/windows/acr_arch.h os/win32/main.c shared/getopt.c test/testsuite.c Date: Wed, 12 Aug 2009 16:35:19 -0000 To: commits@commons.apache.org From: mturk@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090812163519.3C07423888EC@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mturk Date: Wed Aug 12 16:35:18 2009 New Revision: 803585 URL: http://svn.apache.org/viewvc?rev=803585&view=rev Log: Fix Win32 late dll order Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_getopt.h commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c commons/sandbox/runtime/trunk/src/main/native/shared/getopt.c commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_getopt.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_getopt.h?rev=803585&r1=803584&r2=803585&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/include/acr_getopt.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/acr_getopt.h Wed Aug 12 16:35:18 2009 @@ -40,7 +40,7 @@ #define ACR_GETOPT_LONGONLY 0x04 /* operate as getopt_long_only */ #define ACR_GETOPT_POSIXLY 0x08 /* Used instead POSIXLY_CORRECT env var */ -/** +/** * An @c apr_getopt_t error callback function. * * @a arg is this @c apr_getopt_t's @c errarg member. @@ -51,7 +51,7 @@ typedef struct acr_getopt_t acr_getopt_t; /** * Structure to store command line argument information. - */ + */ struct acr_getopt_t { /** function to print error message (NULL == no messages) */ acr_getopt_err_fn_t *errfn; Modified: commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h?rev=803585&r1=803584&r2=803585&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/arch/windows/acr_arch.h Wed Aug 12 16:35:18 2009 @@ -395,9 +395,9 @@ SYSDLL_WS2_32 = 5, /* ws2_32 From WinSock2.h */ SYSDLL_SHELL32 = 6, /* shell32 From ShellAPI.h */ SYSDLL_ADVAPI32 = 7, /* advapi32 From WinBase.h */ - SYSDLL_JVM = 8, /* jvm From our own jvm.dll */ - SYSDLL_KTMW32 = 9, /* ktmw32 From Ktmw32.h */ - SYSDLL_MSVCRT = 10, /* ktmw32 From Ktmw32.h */ + SYSDLL_MSVCRT = 8, /* msvcrt */ + SYSDLL_JVM = 9, /* jvm From our own jvm.dll */ + SYSDLL_KTMW32 = 10, /* ktmw32 From Ktmw32.h */ SYSDLL_defined = 11 /* must define as last idx_ + 1 */ } acr_dlltoken_e; Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c?rev=803585&r1=803584&r2=803585&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c Wed Aug 12 16:35:18 2009 @@ -129,6 +129,7 @@ "ws2_32.dll", "shell32.dll", "advapi32.dll", + "msvcrt.dll", "jvm.dll", "ktmw32.dll" }; @@ -181,7 +182,7 @@ rc = GetLastError(); SetErrorMode(em); } - if (!late_dll_handles[fnLib] && (fnLib < SYSDLL_KTMW32)) { + if (!late_dll_handles[fnLib] && (fnLib < SYSDLL_JVM)) { /* Unable to load required library */ return rc; } Modified: commons/sandbox/runtime/trunk/src/main/native/shared/getopt.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/getopt.c?rev=803585&r1=803584&r2=803585&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/shared/getopt.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/shared/getopt.c Wed Aug 12 16:35:18 2009 @@ -471,7 +471,7 @@ *p = '\0'; for (*valuep = ++p; *p && *p != ',' && !acr_isspace(*p); ++p); - if (*p) + if (*p) *p++ = '\0'; } else Modified: commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c?rev=803585&r1=803584&r2=803585&view=diff ============================================================================== --- commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/test/testsuite.c Wed Aug 12 16:35:18 2009 @@ -33,6 +33,7 @@ #include "acr_shm.h" #include "acr_crypto.h" #include "acr_getopt.h" +#include "acr_env.h" #include "acr_version.h" #if defined (WIN32) @@ -48,6 +49,8 @@ #endif +static int tests_failed = 0; + static acr_getopt_option_t toptions[] = { {"help", ACR_GETOPT_NO_ARGUMENT, NULL, 'h', NULL }, {"test", ACR_GETOPT_REQUIRED_ARGUMENT, NULL, 't', NULL }, @@ -55,12 +58,42 @@ {NULL, 0, NULL, 0, NULL } }; + +static int test_getenv(int argc, const char *const argv[]) +{ + int failed = 0; + const char *envval; + + envval = ACR_EnvGet("PATH"); + if (!envval) + failed++; + ACR_EnvSet("ACR_TEST_SUITE_VAR", ""); + envval = ACR_EnvGet("ACR_TEST_SUITE_VAR"); + if (envval) + failed++; + ACR_EnvSet("ACR_TEST_SUITE_VAR", "1"); + envval = ACR_EnvGet("ACR_TEST_SUITE_VAR"); + if (!envval) + failed++; + ACR_EnvDelete("ACR_TEST_SUITE_VAR"); + envval = ACR_EnvGet("ACR_TEST_SUITE_VAR"); + if (envval) + failed++; + tests_failed += failed; + if (failed) + fprintf(stderr, "getenv: Failed (%d)\n", failed); + else + fprintf(stdout, "getenv: OK\n"); + + return 0; +} + int main(int argc, const char *const argv[]) { int rv = 0; acr_getopt_t *os; int ch; - + const char *run_test = NULL; fprintf(stdout, "Running Apache Commons Runtime %s (%s version) test suite.\n", ACR_VERSION_STRING, ACR_GetLibraryBuilt()); @@ -83,7 +116,7 @@ goto cleanup; break; case 't' : - fprintf(stdout, "Using test %s\n", os->arg); + run_test = os->arg; break; default: fprintf(stderr, "\n\nUsage (TODO)\n"); @@ -94,10 +127,21 @@ } argc -= os->ind; argv += os->ind; + if (ACR_EnvGet("ACR_TEST")) { + run_test = ACR_EnvGet("ACR_TEST"); + } + if (run_test) { + fprintf(stdout, "Selected test: %s\n", run_test); + if (!stricmp(run_test, "all")) { + } + else if (!stricmp(run_test, "getenv")) { + rv = test_getenv(argc, argv); + } + } cleanup: ACR_GetoptFree(os); - return 0; + return rv; }