package edu.syr.pcpratts.rootbeer.testcases.rootbeertest.serialization;

import edu.syr.pcpratts.rootbeer.runtime.Kernel;

public class AutoboxingRunOnGpu implements Kernel {

  private Double m_result;
  public void gpuMethod() {
    m_result = returnDouble();
  }

  private double returnDouble() {
    return 10;
  }
  
  public double getResult(){
    return m_result;
  }

  public boolean compare(AutoboxingRunOnGpu rhs) {
    try {
      if(getResult() != rhs.getResult()){
        System.out.println("m_result");
        System.out.println("lhs: "+getResult());
        System.out.println("rhs: "+rhs.getResult());
        return false;
      }
      return true;
    } catch(Exception ex){
      System.out.println("exception thrown");
      return false;
    }
  }
  
}

@@ -188,16 +188,59 @@
 ouble m_
+double_result;%0A  private Integer m_integer_
 result;%0A
@@ -273,16 +273,23 @@
 %7B%0A    m_
+double_
 result =
@@ -305,16 +305,56 @@
 uble();%0A
+    m_integer_result = returnInteger();%0A
   %7D%0A%0A  p
@@ -406,16 +406,693 @@
 %0A  %7D%0A  %0A
+  private int returnInteger() %7B%0A    return 0; %0A    // values between -128 and 0 will fail because of problems in%0A    // static_getter_java_lang_Integer$IntegerCache_high or%0A    // static_getter_java_lang_Integer$IntegerCache_cache%0A    /*%0A       if ( i0  %3C  -128   ) goto label0;%0A       $i1  = static_getter_java_lang_Integer$IntegerCache_high(gc_info, exception);%0A       if ( i0  %3E  $i1   ) goto label0;%0A       $r0  = static_getter_java_lang_Integer$IntegerCache_cache(gc_info, exception);%0A       $i2  =  i0  +  128  ;%0A       $r1  = java_lang_Integer__array_get(gc_info, $r0, $i2, exception);%0A       if(*exception != 0) %7B%0A       return 0; %7D%0A       return  $r1 ;%0A     */%0A  %7D%0A  %0A
   public
@@ -1102,16 +1102,22 @@
 uble get
+Double
 Result()
@@ -1131,16 +1131,23 @@
 eturn m_
+double_
 result;%0A
@@ -1146,24 +1146,98 @@
 result;%0A  %7D%0A
+  %0A  public double getIntegerResult()%7B%0A    return m_integer_result;%0A  %7D%0A  
 %0A  public bo
@@ -1298,16 +1298,22 @@
   if(get
+Double
 Result()
@@ -1319,24 +1319,30 @@
 ) != rhs.get
+Double
 Result())%7B%0A 
@@ -1370,16 +1370,23 @@
 ntln(%22m_
+double_
 result%22)
@@ -1425,16 +1425,22 @@
 s: %22+get
+Double
 Result()
@@ -1484,16 +1484,272 @@
 +rhs.get
+DoubleResult());%0A        return false;%0A      %7D%0A      if(getIntegerResult() != rhs.getIntegerResult())%7B%0A        System.out.println(%22m_integer_result%22);%0A        System.out.println(%22lhs: %22+getIntegerResult());%0A        System.out.println(%22rhs: %22+rhs.getInteger
 Result()

Update AutoboxingTest (Add Integer check)