harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vera Petrashkova (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-4302) [buildtest][vts] 3 vm/jvms/threads tests do not initialize used variables
Date Fri, 29 Jun 2007 05:34:05 GMT
[buildtest][vts] 3  vm/jvms/threads tests do not initialize used variables
--------------------------------------------------------------------------

                 Key: HARMONY-4302
                 URL: https://issues.apache.org/jira/browse/HARMONY-4302
             Project: Harmony
          Issue Type: Bug
          Components: build - test - ci
            Reporter: Vera Petrashkova
         Attachments: threads.patch

The following VTS VM tests are incorrect:
    vm/jvms/threads/threads201/threads20101/threads20101.xml
    vm/jvms/threads/threads209/threads20901/threads20901.xml
    vm/jvms/threads/threads189/threads18901/threads18901.xml

According to these tests descriptions (for example, see threads18901.xml)
they should assign "a" and "b" variables during initialization, 
then they modify "c" and "d" variable using "a" and "b" and check the values of "c" and "d".
--------------------
  <Description>
      The test initializes the following fields
              a = 1;              <<<<<<<<<<<<<<
              b = 2;              <<<<<<<<<<<<<<
              c = d = 0;
      and starts two threads. The first thread concurrently calls
      the following method:
          public void anny() {
              a = 3;
              b = 4;
          }
      While the second thread calls concurrently the following method:
          public void betty() {
              c = a;
              d = b;
          }
      (both methods are not synchronized)
      After threads finished their calls, the master thread makes 
      a synchronous check
      of c and d values, for c to be either 1 or 3, for d to be either 2 or 4.

      The procedure is repeated until timeout specified by delay parameter is 
      reached.
      Covered assertions assert_thread189
  </Description>
----------------------

But actually all these tests assign "c" and "d" variables during initialization:
--------------threads18901p.j-------------------
.method public <init>()V
    .limit stack 2
    .limit locals 1
    aload_0
    invokespecial
org/apache/harmony/vts/test/vm/jvms/threads/share/InterruptibleTest/<init>()V
    aload_0
    iconst_1
    putfield
org/apache/harmony/vts/test/vm/jvms/threads/threads189/threads18901/threads18901p/c I   <<<<<
c instead of  a
    aload_0
    iconst_2
    putfield
org/apache/harmony/vts/test/vm/jvms/threads/threads189/threads18901/threads18901p/d I   <<<<
< d instead of  b
    return
.end method
----------------threads20101p.j---------------------
.method public <init>()V
    .limit stack 2
    .limit locals 1

    aload_0
    invokespecial
org/apache/harmony/vts/test/vm/jvms/threads/share/InterruptibleTest/<init>()V
    aload_0
    iconst_1
    putfield
org/apache/harmony/vts/test/vm/jvms/threads/threads201/threads20101/threads20101p/c I  <<<<<
c instead of  a
    aload_0
    iconst_2
    putfield
org/apache/harmony/vts/test/vm/jvms/threads/threads201/threads20101/threads20101p/d I  <<<<<
d instead of  b
    return
.end method
-----------threads20901p.j-------------------------
.method public <init>()V
    .limit stack 2
    .limit locals 1

    aload_0
    invokespecial
org/apache/harmony/vts/test/vm/jvms/threads/share/InterruptibleTest/<init>()V
    aload_0
    iconst_1
    putfield
org/apache/harmony/vts/test/vm/jvms/threads/threads209/threads20901/threads20901p/c I  <<<<<
c instead of  a

    aload_0
    iconst_2
    putfield
org/apache/harmony/vts/test/vm/jvms/threads/threads209/threads20901/threads20901p/d I   <<<<<
d instead of  b
    return
.end method
----------------------------

As the result if the second thread (Betty) executes before the first thread
(Anny) then "c" and "d" have wrong value 0  and these tests fail.

The initialization of "c" and "d" should be replaced by the initialization "a" and "b"


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message