-
Notifications
You must be signed in to change notification settings - Fork 1
/
MemManagerTest.java
47 lines (41 loc) · 993 Bytes
/
MemManagerTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import junit.framework.TestCase;
import org.junit.Before;
import org.junit.Test;
// -------------------------------------------------------------------------
/**
* test memmanager class.
*
* @author wenfeng ren
* @version Sep 16, 2014
*/
public class MemManagerTest extends TestCase
{
/**
* declaration
*/
MemManager mem;
/**
* declare artist name to test
*/
String name = "Blind Lemon Jefferson";
@Before
public void setUp()
throws Exception
{
//
mem = new MemManager(32);
}
// ----------------------------------------------------------
/**
* Place a description of your method here.
*/
@Test
public void testGet()
{
byte[] data = Client.stringToByte(name);
Handle handle = mem.insert(data, data.length);
byte[] space = new byte[data.length];
int copySize = mem.get(space, handle, space.length);
assertEquals(21, copySize);
}
}