~ubuntu-branches/ubuntu/utopic/eclipse-linuxtools/utopic

« back to all changes in this revision

Viewing changes to lttng/org.eclipse.linuxtools.ctf.core.tests/src/org/eclipse/linuxtools/ctf/core/tests/types/IntegerDefinitionTest.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2014-05-12 18:11:40 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20140512181140-w237r3vsah1tmybz
Tags: 2.2.1-1
* New upstream release.
* Refreshed d/patches.
* Removed eclipse-cdt-valgrind-remote package, all its functionality
  is now provided by eclipse-cdt-profiling-framework-remote.
* Added remove-license-feature.patch.
* Bump Standards-Version to 3.9.5.
* Enable eclipse-changelog package.
* Enable eclipse-rpm-editor package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*******************************************************************************
 
2
 * Copyright (c) 2013 Ericsson
 
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
 
1
12
package org.eclipse.linuxtools.ctf.core.tests.types;
2
13
 
3
14
import static org.junit.Assert.assertEquals;
5
16
 
6
17
import java.nio.ByteOrder;
7
18
 
 
19
import org.eclipse.linuxtools.ctf.core.event.io.BitBuffer;
8
20
import org.eclipse.linuxtools.ctf.core.event.types.Encoding;
9
21
import org.eclipse.linuxtools.ctf.core.event.types.IDefinitionScope;
10
22
import org.eclipse.linuxtools.ctf.core.event.types.IntegerDeclaration;
11
23
import org.eclipse.linuxtools.ctf.core.event.types.IntegerDefinition;
12
 
import org.eclipse.linuxtools.internal.ctf.core.event.io.BitBuffer;
13
 
import org.junit.After;
14
24
import org.junit.Before;
15
25
import org.junit.Test;
16
26
 
24
34
public class IntegerDefinitionTest {
25
35
 
26
36
    private IntegerDefinition fixture;
27
 
    String name = "testInt"; //$NON-NLS-1$
28
 
    String clockName = "clock"; //$NON-NLS-1$
29
 
    /**
30
 
     * Launch the test.
31
 
     *
32
 
     * @param args
33
 
     *            the command line arguments
34
 
     */
35
 
    public static void main(String[] args) {
36
 
        new org.junit.runner.JUnitCore().run(IntegerDefinitionTest.class);
37
 
    }
 
37
    String name = "testInt";
 
38
    String clockName = "clock";
38
39
 
39
40
    /**
40
 
     * Perform pre-test initialization. We know the structDef won't be null (or
41
 
     * else the tests will fail), so we can safely suppress the warning.
 
41
     * Perform pre-test initialization.
42
42
     */
43
43
    @Before
44
44
    public void setUp() {
45
 
 
46
 
//        StructDefinition structDef = null;
47
 
//        boolean found = false;
48
 
        IntegerDeclaration id = new IntegerDeclaration( 1, true, 1, ByteOrder.BIG_ENDIAN, Encoding.NONE, clockName, 8);
 
45
        IntegerDeclaration id = new IntegerDeclaration(1, false, 1, ByteOrder.BIG_ENDIAN, Encoding.NONE, clockName, 8);
49
46
        fixture = id.createDefinition(null, name);
50
47
    }
51
48
 
52
49
    /**
53
 
     * Perform post-test clean-up.
54
 
     */
55
 
    @After
56
 
    public void tearDown() {
57
 
        // Add additional tear down code here
58
 
    }
59
 
 
60
 
    /**
61
50
     * Run the IntegerDefinition(IntegerDeclaration,DefinitionScope,String)
62
51
     * constructor test.
63
52
     */
64
53
    @Test
65
54
    public void testIntegerDefinition() {
66
 
        IntegerDeclaration declaration = new IntegerDeclaration(1, true, 1,
 
55
        IntegerDeclaration declaration = new IntegerDeclaration(1, false, 1,
67
56
                ByteOrder.BIG_ENDIAN, Encoding.ASCII, null, 8);
68
57
        IDefinitionScope definitionScope = null;
69
 
        String fieldName = ""; //$NON-NLS-1$
 
58
        String fieldName = "";
70
59
 
71
60
        IntegerDefinition result = new IntegerDefinition(declaration,
72
61
                definitionScope, fieldName);