axis-c-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r1125619 - in /axis/axis1/c/trunk/tests/auto_build/testcases/client: c/ cpp/
Date Sat, 21 May 2011 02:40:46 GMT
Author: nadiramra
Date: Sat May 21 02:40:45 2011
New Revision: 1125619

URL: http://svn.apache.org/viewvc?rev=1125619&view=rev
Log:
Minor - Test cases should take into account daylight saving time

Modified:
    axis/axis1/c/trunk/tests/auto_build/testcases/client/c/CommonClientTestCode.h
    axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gDayClient.c
    axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthClient.c
    axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthDayClient.c
    axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/CommonClientTestCode.hpp
    axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp
    axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthClient.cpp
    axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthDayClient.cpp

Modified: axis/axis1/c/trunk/tests/auto_build/testcases/client/c/CommonClientTestCode.h
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/tests/auto_build/testcases/client/c/CommonClientTestCode.h?rev=1125619&r1=1125618&r2=1125619&view=diff
==============================================================================
--- axis/axis1/c/trunk/tests/auto_build/testcases/client/c/CommonClientTestCode.h (original)
+++ axis/axis1/c/trunk/tests/auto_build/testcases/client/c/CommonClientTestCode.h Sat May
21 02:40:45 2011
@@ -204,6 +204,62 @@ struct tm * adjustTimeStruct(struct tm *
     return t;
 }
 
+struct tm * adjustTimeStruct2(struct tm *t)
+{
+    time_t timeInSecs;
+    struct tm *temp;
+
+    dumpTimeStruct(t, "before\n");
+
+    if (isDSTInEffect())
+        t->tm_isdst = 1;
+
+    timeInSecs= mktime (t);
+
+    temp = localtime(&timeInSecs);
+
+    *t = *temp;
+
+    dumpTimeStruct(t, "after\n");
+
+    return t;
+}
+
+struct tm *adjustTimeStruct3(struct tm *t)
+{
+    // Hack....seems that DST affects month/day
+    time_t timeInSecs;
+    struct tm *temp;
+
+    dumpTimeStruct(t, "before\n");
+
+    if (isDSTInEffect())
+    {
+        ++(t->tm_mday);
+        ++(t->tm_mon);
+    }
+
+
+    dumpTimeStruct(t, "after\n");
+
+    return t;
+}
+
+struct tm *adjustTimeStruct4(struct tm *t)
+{
+    // Hack....seems that DST affects month/day
+    time_t timeInSecs;
+    struct tm *temp;
+
+    dumpTimeStruct(t, "before\n");
+
+    if (isDSTInEffect())
+        ++(t->tm_mday);
+
+    dumpTimeStruct(t, "after\n");
+
+    return t;
+}
 
 
 static C_BOOL exceptionOccurred = C_FALSE;

Modified: axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gDayClient.c
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gDayClient.c?rev=1125619&r1=1125618&r2=1125619&view=diff
==============================================================================
--- axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gDayClient.c (original)
+++ axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gDayClient.c Sat May 21 02:40:45
2011
@@ -49,14 +49,14 @@ int main(int argc, char* argv[])
 
     // Test non-nillable element
     result = asNonNillableElement(ws, input);
-    strftime(returnString, 50, "%d", &result);
+    strftime(returnString, 50, "%d", adjustTimeStruct3(&result));
     printf( "non-nillable element=%s\n" , returnString );
 
     // Test nillable element, with a value
     nillableResult = asNillableElement(ws, &input);
     if (nillableResult)
     {
-        strftime(returnString, 50, "%d", nillableResult);
+        strftime(returnString, 50, "%d", adjustTimeStruct3(nillableResult));
         printf( "nillable element=%s\n" , returnString );
         axiscAxisDelete(nillableResult, XSDC_GDAY);
     }
@@ -67,7 +67,7 @@ int main(int argc, char* argv[])
     nillableResult = asNillableElement(ws, NULL);
     if (nillableResult)
     {
-        strftime(returnString, 50, "%d", nillableResult);
+        strftime(returnString, 50, "%d", adjustTimeStruct3(nillableResult));
         printf( "nil element=%s\n" , returnString );
         axiscAxisDelete(nillableResult, XSDC_GDAY);
     }
@@ -82,7 +82,7 @@ int main(int argc, char* argv[])
         requiredAttributeInput.requiredAttribute = input;
         requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
         result = requiredAttributeResult->requiredAttribute;
-        strftime(returnString, 50, "%d", &result);
+        strftime(returnString, 50, "%d", adjustTimeStruct3(&result));
         printf( "required attribute=%s\n" , returnString );
         Axis_Delete_RequiredAttributeElement(requiredAttributeResult, 0);
     }
@@ -144,7 +144,7 @@ int main(int argc, char* argv[])
 
         for (i = 0; i < outputSize ; i++)
         {
-            strftime(returnString, 50, "%d", output[i]);
+            strftime(returnString, 50, "%d", adjustTimeStruct3((struct tm *)output[i]));
             printf( "  element[%d]=%s\n" , i, returnString );
         }
         axiscAxisDelete(arrayResult, XSDC_ARRAY);
@@ -158,7 +158,7 @@ int main(int argc, char* argv[])
         complexTypeInput.complexTypeElement = input;
         complexTypeResult = asComplexType(ws, &complexTypeInput);
         result = complexTypeResult->complexTypeElement;
-        strftime(returnString, 50, "%d", &result);
+        strftime(returnString, 50, "%d", adjustTimeStruct3(&result));
         printf( "within complex type=%s\n" , returnString );
         Axis_Delete_SimpleComplexType(complexTypeResult, 0);
     }

Modified: axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthClient.c
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthClient.c?rev=1125619&r1=1125618&r2=1125619&view=diff
==============================================================================
--- axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthClient.c (original)
+++ axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthClient.c Sat May 21 02:40:45
2011
@@ -49,14 +49,14 @@ int main(int argc, char* argv[])
 
     // Test non-nillable element
     result = asNonNillableElement(ws, input);
-    strftime(returnString, 50, "%b", &result);
+    strftime(returnString, 50, "%b", adjustTimeStruct3(&result));
     printf( "non-nillable element=%s\n" , returnString );
 
     // Test nillable element, with a value
     nillableResult = asNillableElement(ws, &input);
     if (nillableResult)
     {
-        strftime(returnString, 50, "%b", nillableResult);
+        strftime(returnString, 50, "%b", adjustTimeStruct3(nillableResult));
         printf( "nillable element=%s\n" , returnString );
         axiscAxisDelete(nillableResult, XSDC_GMONTH);
     }
@@ -67,7 +67,7 @@ int main(int argc, char* argv[])
     nillableResult = asNillableElement(ws, NULL);
     if (nillableResult)
     {
-        strftime(returnString, 50, "%b", nillableResult);
+        strftime(returnString, 50, "%b", adjustTimeStruct3(nillableResult));
         printf( "nil element=%s\n" , returnString );
         axiscAxisDelete(nillableResult, XSDC_GMONTH);
     }
@@ -82,7 +82,7 @@ int main(int argc, char* argv[])
         requiredAttributeInput.requiredAttribute = input;
         requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
         result = requiredAttributeResult->requiredAttribute;
-        strftime(returnString, 50, "%b", &result);
+        strftime(returnString, 50, "%b", adjustTimeStruct3(&result));
         printf( "required attribute=%s\n" , returnString );
         Axis_Delete_RequiredAttributeElement(requiredAttributeResult, 0);
     }
@@ -145,7 +145,7 @@ int main(int argc, char* argv[])
 
         for (i = 0; i < outputSize ; i++)
         {
-            strftime(returnString, 50, "%b", output[i]);
+            strftime(returnString, 50, "%b", adjustTimeStruct3((struct tm *)output[i]));
             printf( "  element[%d]=%s\n" , i, returnString );
         }
         axiscAxisDelete(arrayResult, XSDC_ARRAY);
@@ -159,7 +159,7 @@ int main(int argc, char* argv[])
         complexTypeInput.complexTypeElement =input;
         complexTypeResult = asComplexType(ws, &complexTypeInput);
         result = complexTypeResult->complexTypeElement;
-        strftime(returnString, 50, "%b", &result);
+        strftime(returnString, 50, "%b", adjustTimeStruct3(&result));
         printf( "within complex type=%s\n" , returnString );
         Axis_Delete_SimpleComplexType(complexTypeResult, 0);
     }

Modified: axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthDayClient.c
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthDayClient.c?rev=1125619&r1=1125618&r2=1125619&view=diff
==============================================================================
--- axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthDayClient.c (original)
+++ axis/axis1/c/trunk/tests/auto_build/testcases/client/c/XSD_gMonthDayClient.c Sat May 21
02:40:45 2011
@@ -50,14 +50,14 @@ int main(int argc, char* argv[])
 
     // Test non-nillable element
     result = asNonNillableElement(ws, input);
-    strftime(returnString, 50, "%b %d", &result);
+    strftime(returnString, 50, "%b %d", adjustTimeStruct4(&result));
     printf( "non-nillable element=%s\n" , returnString );
 
     // Test nillable element, with a value
     nillableResult = asNillableElement(ws, &input);
     if (nillableResult)
     {
-        strftime(returnString, 50, "%b %d", nillableResult);
+        strftime(returnString, 50, "%b %d", adjustTimeStruct4(nillableResult));
         printf( "nillable element=%s\n" , returnString );
         axiscAxisDelete(nillableResult, XSDC_GMONTHDAY);
     }
@@ -68,7 +68,7 @@ int main(int argc, char* argv[])
     nillableResult = asNillableElement(ws, NULL);
     if (nillableResult)
     {
-        strftime(returnString, 50, "%b %d", nillableResult);
+        strftime(returnString, 50, "%b %d", adjustTimeStruct4(nillableResult));
         printf( "nil element=%s\n" , returnString );
         axiscAxisDelete(nillableResult, XSDC_GMONTHDAY);
     }
@@ -83,7 +83,7 @@ int main(int argc, char* argv[])
         requiredAttributeInput.requiredAttribute = input;
         requiredAttributeResult = asRequiredAttribute(ws, &requiredAttributeInput);
         result = requiredAttributeResult->requiredAttribute;
-        strftime(returnString, 50, "%b %d", &result);
+        strftime(returnString, 50, "%b %d", adjustTimeStruct4(&result));
         printf( "required attribute=%s\n" , returnString );
         Axis_Delete_RequiredAttributeElement(requiredAttributeResult, 0);
     }
@@ -144,7 +144,7 @@ int main(int argc, char* argv[])
 
         for (i = 0; i < outputSize ; i++)
         {
-            strftime(returnString, 50, "%b %d", output[i]);
+            strftime(returnString, 50, "%b %d", adjustTimeStruct4((struct tm *)output[i]));
             printf( "  element[%d]=%s\n" , i, returnString );
         }
         axiscAxisDelete(arrayResult, XSDC_ARRAY);
@@ -158,7 +158,7 @@ int main(int argc, char* argv[])
         complexTypeInput.complexTypeElement =input;
         complexTypeResult = asComplexType(ws, &complexTypeInput);
         result = complexTypeResult->complexTypeElement;
-        strftime(returnString, 50, "%b %d", &result);
+        strftime(returnString, 50, "%b %d", adjustTimeStruct4(&result));
         printf( "within complex type=%s\n" , returnString );
         Axis_Delete_SimpleComplexType(complexTypeResult, 0);
     }

Modified: axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/CommonClientTestCode.hpp
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/CommonClientTestCode.hpp?rev=1125619&r1=1125618&r2=1125619&view=diff
==============================================================================
--- axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/CommonClientTestCode.hpp (original)
+++ axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/CommonClientTestCode.hpp Sat
May 21 02:40:45 2011
@@ -312,5 +312,39 @@ struct tm * adjustTimeStruct2(struct tm 
     return t;
 }
 
+struct tm *adjustTimeStruct3(struct tm *t)
+{
+    // Hack....seems that DST affects month/day
+    time_t timeInSecs;
+    struct tm *temp;
 
+    dumpTimeStruct(t, "before\n");
+
+    if (isDSTInEffect())
+    {
+        ++(t->tm_mday);
+        ++(t->tm_mon);
+    }
+
+
+    dumpTimeStruct(t, "after\n");
+
+    return t;
+}
+
+struct tm *adjustTimeStruct4(struct tm *t)
+{
+    // Hack....seems that DST affects month/day
+    time_t timeInSecs;
+    struct tm *temp;
+
+    dumpTimeStruct(t, "before\n");
+
+    if (isDSTInEffect())
+        ++(t->tm_mday);
+
+    dumpTimeStruct(t, "after\n");
+
+    return t;
+}
 #endif

Modified: axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp?rev=1125619&r1=1125618&r2=1125619&view=diff
==============================================================================
--- axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp (original)
+++ axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gDayClient.cpp Sat May 21
02:40:45 2011
@@ -28,6 +28,7 @@
 #include <ctype.h>
 #include <iostream>
 
+#include "CommonClientTestCode.hpp"
 
 int main(int argc, char* argv[])
 {
@@ -58,14 +59,14 @@ int main(int argc, char* argv[])
 
         // Test non-nillable element
         result = ws->asNonNillableElement(input);
-        strftime(returnString, 50, "%d", &result);
+        strftime(returnString, 50, "%d", adjustTimeStruct3(&result));
         cout << "non-nillable element=" << returnString << endl;
 
         // Test nillable element, with a value
         nillableResult = ws->asNillableElement(&input);
         if (nillableResult)
         {
-            strftime(returnString, 50, "%d", nillableResult);
+            strftime(returnString, 50, "%d", adjustTimeStruct3(nillableResult));
             cout << "nillable element=" << returnString << endl;
             delete nillableResult;
         }
@@ -76,7 +77,7 @@ int main(int argc, char* argv[])
         nillableResult = ws->asNillableElement(NULL);
         if (nillableResult)
         {
-            strftime(returnString, 50, "%d", nillableResult);
+            strftime(returnString, 50, "%d", adjustTimeStruct3(nillableResult));
             cout << "nil element=" << returnString << endl;
             delete nillableResult;
         }
@@ -90,7 +91,7 @@ int main(int argc, char* argv[])
         requiredAttributeInput.setrequiredAttribute(input);
         requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
         result = requiredAttributeResult->getrequiredAttribute();
-        strftime(returnString, 50, "%d", &result);
+        strftime(returnString, 50, "%d", adjustTimeStruct3(&result));
         cout << "required attribute=" << returnString << endl;
         delete requiredAttributeResult;
 
@@ -141,7 +142,7 @@ int main(int argc, char* argv[])
         cout << "array of " << outputSize << " elements" << endl;
         for (i = 0; i < outputSize ; i++)
         {
-            strftime(returnString, 50, "%d", output[i]);
+            strftime(returnString, 50, "%d", adjustTimeStruct3((struct tm *)output[i]));
             cout << "  element[" << i << "]=" << returnString <<
endl;
         }
         // Clear up input array        
@@ -156,7 +157,7 @@ int main(int argc, char* argv[])
         complexTypeInput.setcomplexTypeElement(input);
         complexTypeResult = ws->asComplexType(&complexTypeInput);
         result = complexTypeResult->getcomplexTypeElement();
-        strftime(returnString, 50, "%d", &result);
+        strftime(returnString, 50, "%d", adjustTimeStruct3(&result));
         cout << "within complex type=" << returnString << endl;
         delete complexTypeResult;
 

Modified: axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthClient.cpp
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthClient.cpp?rev=1125619&r1=1125618&r2=1125619&view=diff
==============================================================================
--- axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthClient.cpp (original)
+++ axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthClient.cpp Sat May
21 02:40:45 2011
@@ -28,6 +28,7 @@
 #include <ctype.h>
 #include <iostream>
 
+#include "CommonClientTestCode.hpp"
 
 int main(int argc, char* argv[])
 {
@@ -58,14 +59,14 @@ int main(int argc, char* argv[])
 
         // Test non-nillable element
         result = ws->asNonNillableElement(input);
-        strftime(returnString, 50, "%b", &result);
+        strftime(returnString, 50, "%b", adjustTimeStruct3(&result));
         cout << "non-nillable element=" << returnString << endl;
 
         // Test nillable element, with a value
         nillableResult = ws->asNillableElement(&input);
         if (nillableResult)
         {
-            strftime(returnString, 50, "%b", nillableResult);
+            strftime(returnString, 50, "%b", adjustTimeStruct3(nillableResult));
             cout << "nillable element=" << returnString << endl;
             delete nillableResult;
         }
@@ -76,7 +77,7 @@ int main(int argc, char* argv[])
         nillableResult = ws->asNillableElement(NULL);
         if (nillableResult)
         {
-            strftime(returnString, 50, "%b", nillableResult);
+            strftime(returnString, 50, "%b", adjustTimeStruct3(nillableResult));
             cout << "nil element=" << returnString << endl;
             delete nillableResult;
         }
@@ -90,7 +91,7 @@ int main(int argc, char* argv[])
         requiredAttributeInput.setrequiredAttribute(input);
         requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
         result = requiredAttributeResult->getrequiredAttribute();
-        strftime(returnString, 50, "%b", &result);
+        strftime(returnString, 50, "%b", adjustTimeStruct3(&result));
         cout << "required attribute=" << returnString << endl;
         delete requiredAttributeResult;
 
@@ -143,7 +144,7 @@ int main(int argc, char* argv[])
         cout << "array of " << outputSize << " elements" << endl;
         for (i = 0; i < outputSize ; i++)
         {
-            strftime(returnString, 50, "%b", output[i]);
+            strftime(returnString, 50, "%b", adjustTimeStruct3((struct tm *)output[i]));
             cout << "  element[" << i << "]=" << returnString <<
endl;            
         }
         // Clear up input array        
@@ -158,7 +159,7 @@ int main(int argc, char* argv[])
         complexTypeInput.setcomplexTypeElement(input);
         complexTypeResult = ws->asComplexType(&complexTypeInput);
         result = complexTypeResult->getcomplexTypeElement();
-        strftime(returnString, 50, "%b", &result);
+        strftime(returnString, 50, "%b", adjustTimeStruct3(&result));
         cout << "within complex type=" << returnString << endl;
         delete complexTypeResult;
 

Modified: axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthDayClient.cpp
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthDayClient.cpp?rev=1125619&r1=1125618&r2=1125619&view=diff
==============================================================================
--- axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthDayClient.cpp (original)
+++ axis/axis1/c/trunk/tests/auto_build/testcases/client/cpp/XSD_gMonthDayClient.cpp Sat May
21 02:40:45 2011
@@ -27,6 +27,7 @@
 #include <axis/AxisException.hpp>
 #include <ctype.h>
 #include <iostream>
+#include "CommonClientTestCode.hpp"
 
 
 int main(int argc, char* argv[])
@@ -58,14 +59,14 @@ int main(int argc, char* argv[])
 
         // Test non-nillable element
         result = ws->asNonNillableElement(input);
-        strftime(returnString, 50, "%b %d", &result);
+        strftime(returnString, 50, "%b %d", adjustTimeStruct4(&result));
         cout << "non-nillable element=" << returnString << endl;
 
         // Test nillable element, with a value
         nillableResult = ws->asNillableElement(&input);
         if (nillableResult)
         {
-            strftime(returnString, 50, "%b %d", nillableResult);
+            strftime(returnString, 50, "%b %d", adjustTimeStruct4(nillableResult));
             cout << "nillable element=" << returnString << endl;
             delete nillableResult;
         }
@@ -76,7 +77,7 @@ int main(int argc, char* argv[])
         nillableResult = ws->asNillableElement(NULL);
         if (nillableResult)
         {
-            strftime(returnString, 50, "%b %d", nillableResult);
+            strftime(returnString, 50, "%b %d", adjustTimeStruct4(nillableResult));
             cout << "nil element=" << returnString << endl;
             delete nillableResult;
         }
@@ -90,7 +91,7 @@ int main(int argc, char* argv[])
         requiredAttributeInput.setrequiredAttribute(input);
         requiredAttributeResult = ws->asRequiredAttribute(&requiredAttributeInput);
         result = requiredAttributeResult->getrequiredAttribute();
-        strftime(returnString, 50, "%b %d", &result);
+        strftime(returnString, 50, "%b %d", adjustTimeStruct4(&result));
         cout << "required attribute=" << returnString << endl;
         delete requiredAttributeResult;
 
@@ -141,7 +142,7 @@ int main(int argc, char* argv[])
         cout << "array of " << outputSize << " elements" << endl;
         for (i = 0; i < outputSize ; i++)
         {
-            strftime(returnString, 50, "%b %d", output[i]);
+            strftime(returnString, 50, "%b %d", adjustTimeStruct4((struct tm *)output[i]));
             cout << "  element[" << i << "]=" << returnString <<
endl;
         }
         // Clear up input array        
@@ -156,7 +157,7 @@ int main(int argc, char* argv[])
         complexTypeInput.setcomplexTypeElement(input);
         complexTypeResult = ws->asComplexType(&complexTypeInput);
         result = complexTypeResult->getcomplexTypeElement();
-        strftime(returnString, 50, "%b %d", &result);
+        strftime(returnString, 50, "%b %d", adjustTimeStruct4(&result));
         cout << "within complex type=" << returnString << endl;
         delete complexTypeResult;
 



Mime
View raw message