Closed xpe closed 7 years ago
I'm tracing through the code. Here's what I see.
To take one test:
@Test
public void testArgumentTimestamp2000() {
final List<Object> args = new ArrayList<Object>(1);
Calendar calendar = Calendar.getInstance();
calendar.clear();
calendar.set(2000, 0, 0);
args.add(calendar.getTime());
final OSCMessage message = new OSCMessage("/timestamp2000", args);
final byte[] answer = { 47, 116, 105, 109, 101, 115, 116, 97, 109, 112, 50, 48, 48, 48, 0, 0, 44, 116, 0, 0, -68, 22, 98, 112, 0, 0, 0, 0 };
final byte[] result = message.getByteArray();
checkResultEqualsAnswer(result, answer);
}
In public class OSCMessage extends AbstractOSCPacket
private void computeArgumentsByteArray(OSCJavaToByteArrayConverter stream) {
stream.write(',');
stream.writeTypes(arguments);
for (final Object argument : arguments) {
stream.write(argument);
}
}
In public class OSCJavaToByteArrayConverter
:
public void write(Date timestamp) {
writeInteger64ToByteArray(javaToNtpTimeStamp(timestamp.getTime()));
}
I'm going to stop here. I don't know the history of those commits. It could just be a simple matter of stale tests.
thanks xpe for the reporting! :-) i foudn the problem and fixed it already, locally (basically, it is because your system and the one where the reference code was generated, probably used a different time-zone). in turn though, i found some other problem which i will fix first, before pushing the fix for this.. or maybe not either way, the fix will come soon, but this is just a faulty test code problem, not really a problem with the library. thanks again for your time and effort! :-)
I'd like to chime in that this is still an issue, I'm experiencing it with a very similar setup
It is fixed in the develop
branch and will be in master
somewhen in the future. The fix is in commit: 46ff3df4d55d0fd77bb4006a0156050967134c8a
My environment is a Mac running OSX 10.10.1 with Java 1.8.
Running
mvn test
, as of commit 9d26e1f240db75c2bd8e9154187a4361faa0703f, gives these results: