Commit | Line | Data |
---|---|---|
4bd7f2db | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2013, 2014 Ericsson |
4bd7f2db AM |
3 | * All rights reserved. This program and the accompanying materials |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * Matthew Khouzam - Initial API and implementation | |
10 | *******************************************************************************/ | |
11 | ||
f357bcd4 | 12 | package org.eclipse.tracecompass.ctf.core.tests.trace; |
866e5b51 FC |
13 | |
14 | import static org.junit.Assert.assertEquals; | |
15 | import static org.junit.Assert.assertNotNull; | |
16 | ||
f357bcd4 | 17 | import org.eclipse.tracecompass.internal.ctf.core.trace.StreamInputPacketIndexEntry; |
866e5b51 FC |
18 | import org.junit.Before; |
19 | import org.junit.Test; | |
20 | ||
21 | /** | |
22 | * The class <code>StreamInputPacketIndexEntryTest</code> contains tests for the | |
23 | * class <code>{@link StreamInputPacketIndexEntry}</code>. | |
ce2388e0 | 24 | * |
866e5b51 FC |
25 | * @author ematkho |
26 | * @version $Revision: 1.0 $ | |
27 | */ | |
d84419e1 | 28 | public class CTFStreamInputPacketIndexEntryTest { |
866e5b51 FC |
29 | |
30 | private StreamInputPacketIndexEntry fixture; | |
31 | ||
866e5b51 FC |
32 | /** |
33 | * Perform pre-test initialization. | |
34 | */ | |
35 | @Before | |
36 | public void setUp() { | |
37 | fixture = new StreamInputPacketIndexEntry(1L); | |
38 | } | |
39 | ||
866e5b51 FC |
40 | /** |
41 | * Run the StreamInputPacketIndexEntry(long) constructor test. | |
42 | */ | |
43 | @Test | |
44 | public void testStreamInputPacketIndexEntry_1() { | |
4a9c1f07 AM |
45 | String expectedResult = "StreamInputPacketIndexEntry [offsetBytes=1, " + |
46 | "timestampBegin=0, timestampEnd=0]"; | |
866e5b51 FC |
47 | |
48 | assertNotNull(fixture); | |
49 | assertEquals(expectedResult, fixture.toString()); | |
50 | } | |
51 | ||
52 | /** | |
53 | * Run the String toString() method test. | |
54 | */ | |
55 | @Test | |
56 | public void testToString() { | |
4a9c1f07 AM |
57 | String expectedResult = "StreamInputPacketIndexEntry [offsetBytes=1,"+ |
58 | " timestampBegin=1, timestampEnd=1]"; | |
bfe038ff | 59 | |
866e5b51 | 60 | |
ce2388e0 FC |
61 | fixture.setContentSizeBits(1); |
62 | fixture.setDataOffsetBits(1); | |
63 | fixture.setTimestampEnd(1L); | |
64 | fixture.setPacketSizeBits(1); | |
65 | fixture.setTimestampBegin(1L); | |
866e5b51 FC |
66 | |
67 | assertEquals(expectedResult, fixture.toString()); | |
68 | } | |
69 | } |