Your revised test compiles without error and runs successfully for me. It would be useful to see if it is a problem reading or writing. You can look at the data in the generated ptex file with ptxinfo. Here's what I get with your file:
> ptxinfo -d test2.ptx
meshType: quad
dataType: uint8
numChannels: 3
alphaChannel: (none)
uBorderMode: clamp
vBorderMode: clamp
numFaces: 1
hasEdits: no
hasMipMaps: no
numMetaKeys: 0
face 0: res: 1 1 (2 x 2) adjface: -1 -1 -1 -1 adjedge: 0 0 0 0 flags: (none)
data (2 x 2):
(0, 0): 0.000 0.000 1.000
(1, 0): 0.000 0.004 1.000
(0, 1): 0.000 0.008 1.000
(1, 1): 0.000 0.012 1.000
texels: 4
Note that ptxinfo shows integer data scaled to a normalized range (1.0 = 255)
You might try calling PtexWriter::close explicitly and check the return value and error string. You might also try reading and writing from separate test programs.