ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/AtomicLongFieldUpdaterTest.java
(Generate patch)

Comparing jsr166/src/test/tck/AtomicLongFieldUpdaterTest.java (file contents):
Revision 1.8 by dl, Tue Jan 20 20:20:56 2004 UTC vs.
Revision 1.9 by dl, Wed May 25 14:27:37 2005 UTC

# Line 78 | Line 78 | public class AtomicLongFieldUpdaterTest
78          assertEquals(2,a.get(this));
79          a.set(this,-3);
80          assertEquals(-3,a.get(this));
81        
81      }
82 +
83 +    /**
84 +     *  get returns the last value lazySet by same thread
85 +     */
86 +    public void testGetLazySet(){
87 +        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
88 +        try {
89 +            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
90 +        } catch (RuntimeException ok) {
91 +            return;
92 +        }
93 +        x = 1;
94 +        assertEquals(1,a.get(this));
95 +        a.lazySet(this,2);
96 +        assertEquals(2,a.get(this));
97 +        a.lazySet(this,-3);
98 +        assertEquals(-3,a.get(this));
99 +    }
100 +
101 +
102      /**
103       * compareAndSet succeeds in changing value if equal to expected else fails
104       */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines