Skip to content

Commit

Permalink
corrected issues with Pointer in generated PointerTest
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrimble committed Jan 20, 2017
1 parent cf0c697 commit 7662f56
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/test/velocity/org/bridj/PointerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -675,10 +675,15 @@ public void testUpdateDirectBufferOnNonBufferBoundPointer() {
assertTrue(!it.hasNext());
}

#if ($prim.Name == "Pointer")
#set ($rawTypeRef = "?")
#else
#set ($rawTypeRef = $prim.rawTypeRef)
#end
@Test
public void testPointerTo_${prim.Name}_Values() {
// Test pointerToInts(int...)
Pointer<${prim.rawTypeRef}> p = Pointer.pointerTo${prim.CapName}s(${prim.value($v1)}, ${prim.value($v2)}, ${prim.value($v3)});
Pointer<${rawTypeRef}> p = Pointer.pointerTo${prim.CapName}s(${prim.value($v1)}, ${prim.value($v2)}, ${prim.value($v3)});
assertEquals(${prim.value($v1)}, (${prim.Name})p.get(0)$precisionArg);
assertEquals(${prim.value($v2)}, (${prim.Name})p.get(1)$precisionArg);
assertEquals(${prim.value($v3)}, (${prim.Name})p.get(2)$precisionArg);
Expand All @@ -699,7 +704,7 @@ public void testUpdateDirectBufferOnNonBufferBoundPointer() {
}
@Test
public void testPointerTo_${prim.Name}_Value() {
Pointer<${prim.rawTypeRef}> p = Pointer.pointerTo${prim.CapName}(${prim.value($v1)});
Pointer<${rawTypeRef}> p = Pointer.pointerTo${prim.CapName}(${prim.value($v1)});
assertEquals(${prim.value($v1)}, (${prim.Name})p.get(0)$precisionArg);

p = Pointer.pointerTo${prim.CapName}(${prim.rawValue($v1)});
Expand Down

0 comments on commit 7662f56

Please sign in to comment.