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

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines