harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r464686 - /incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
Date Mon, 16 Oct 2006 21:48:28 GMT
Author: geirm
Date: Mon Oct 16 14:48:27 2006
New Revision: 464686

URL: http://svn.apache.org/viewvc?view=rev&rev=464686
Log:
HARMONY-1672

The org.apache.harmony.text.tests.java.text.ChoiceFormatTest.test_parseLjava_lang_StringLjava_text_ParsePosition()

fails on drlvm interpreter:

junit.framework.AssertionFailedError: Case insensitive expected:<0> but was:<-2147483648>
at 
org.apache.harmony.text.tests.java.text.ChoiceFormatTest.test_parseLjava_lang_StringLjava_text_ParsePosition(ChoiceFormatTest.java:359)

at java.lang.reflect.VMReflection.invokeMethod(Native Method)

patch fixes, test case passes

Ubuntu 6 - test case, smoke, c-unit, ~kernel



Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp?view=diff&rev=464686&r1=464685&r2=464686
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/interpreter/src/interpreter.cpp Mon Oct 16 14:48:27
2006
@@ -35,6 +35,11 @@
 #include "thread_manager.h"
 #include <sstream>
 
+#ifndef PLATFORM_POSIX
+#include <float.h>
+#define isnan _isnan
+#endif
+
 // ppervov: HACK: allows using STL modifiers (dec/hex) and special constants (endl)
 using namespace std;
 
@@ -722,7 +727,9 @@
     if (exponent < max_exp) {
         res.i = (int) arg.d;
     } else {
-        if (arg.d > 0) {
+        if (isnan(arg.d)) {
+            res.i = 0;
+        } else if (arg.d > 0) {
             res.i = (int32)2147483647;
         } else {
             res.i = (int32)2147483648u;
@@ -745,7 +752,9 @@
     if (exponent < max_exp) {
         arg.i = (int32) arg.f;
     } else {
-        if (arg.f > 0) {
+        if (isnan(arg.f)) {
+            arg.i = 0;
+        } else if (arg.f > 0) {
             arg.i = (int32)2147483647;
         } else {
             arg.i = (int32)2147483648u;
@@ -767,7 +776,9 @@
     if (exponent < max_exp) {
         res.i64 = (int64) arg.d;
     } else {
-        if (arg.d > 0) {
+        if (isnan(arg.d)) {
+            res.i64 = (int64) 0;
+        } else if (arg.d > 0) {
             res.i64 = (int64)(((uint64)(int64)-1) >> 1); // 7FFFF......
         } else {
             res.i64 = ((int64)-1) << 63; // 80000......
@@ -791,7 +802,9 @@
     if (exponent < max_exp) {
         res.i64 = (int64) arg.f;
     } else {
-        if (arg.f > 0) {
+        if (isnan(arg.f)) {
+            res.i64 = (int64) 0;
+        } else if (arg.f > 0) {
             res.i64 = (int64)(((uint64)(int64)-1) >> 1); // 7FFFF......
         } else {
             res.i64 = ((int64)-1) << 63; // 80000......



Mime
View raw message