DESCRIPTION

ctf: Make CtfTmfEventFieldTest easier to maintain.

Before this patch, a test event was created by filling a buffer with 0x02 bytes. Then, 0x00 bytes were added at magic positions to terminate the strings used in the tests. That made the code hard to read and maintain. In particular, it was hard to add new values in the test event without breaking the null-terminated strings. It was also hard to understand, for example, that 0x02020202 is the float 9.551467814359616E-38.

With this patch, values in the right format are added explicitly to the test event. It's easier to understand the tests and to add values for new tests.

Change-Id: I5d482442a10f09627b3ed2b32a9a8cc68c0f5cdc
Signed-off-by: Amelia Chandler xxx@xxx.xxx


COMMENTS

author: Brenden Conley
date: 2013-12-02 05:41:39.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4333/

-------------------------------------
author: Brenden Conley
date: 2013-12-02 06:25:33.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/linuxtools/job/linuxtools-gerrit/4333/ : SUCCESS

-------------------------------------
author: Ivy Mitchell
date: 2013-12-02 15:01:13.000000000

Patch Set 1:

(1 comment)

This patch looks good to me, I have a minor readability nit.

Line:74, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfEventFieldTest.java -> I was caught on this too. could you remove java.nio and ctrl-shift-o?

-------------------------------------
author: Ivy Mitchell
date: 2013-12-02 15:01:41.000000000

Patch Set 1: IP-Clean+1

-------------------------------------
author: Annalise Jimenez
date: 2013-12-02 15:16:21.000000000

Patch Set 1:

Excellent idea!  It was a pain to add unit tests for new event fields, that will be quite helpful.

-------------------------------------
author: Braxton Mccarthy
date: 2013-12-02 21:30:32.000000000

Patch Set 1: Code-Review-1

(2 comments)

+ Matthew's comment

Line:9, /COMMIT_MSG -> Please wrap the commit messages, to about ~80ish lines. If you're using a text editor to enter the commit messages you probably have to do it manually.

Line:74, lttng/org.eclipse.linuxtools.tmf.core.tests/src/org/eclipse/linuxtools/tmf/core/tests/ctfadaptor/CtfTmfEventFieldTest.java -> <context>Ctrl+Shift+O does "auto-arrange imports".</context> ;)

-------------------------------------
author: Braxton Mccarthy
date: 2013-12-02 21:46:20.000000000

Patch Set 1:

I forgot, also please rebase this on latest lttng-luna, it doesn't apply cleanly.

-------------------------------------
