/magstudentportal/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk

« back to all changes in this revision

Viewing changes to src/test/java/TestHash.java

  • Committer: Gustav Hartvigsson
  • Date: 2017-09-08 09:27:14 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20170908092714-0ec9sycrel71us0w
* making sure that the hash function works as expedted

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
import common.Utils;
9
9
 
 
10
import javax.rmi.CORBA.Util;
 
11
import java.util.Objects;
 
12
 
10
13
public class TestHash {
11
14
  @Test
12
 
  public void test1 () {
 
15
  public void
 
16
  test1 () {
13
17
    System.out.println(Utils.hash_func("Hello World"));
14
18
  }
15
19
 
 
20
  @Test
 
21
  public void
 
22
  test2 () {
 
23
    String s0 = Utils.hash_func("Hello World");
 
24
    String s1 = Utils.hash_func("hello World");
 
25
    assert (! Objects.equals (s0, s1));
 
26
    System.out.println ("Hello World: " + s0);
 
27
    System.out.println ("hello World: " + s1);
 
28
  }
 
29
 
 
30
  @Test public void
 
31
  test3 () {
 
32
    String s0 = new String ("Hello World!");
 
33
    String s1 = "Hello World!";
 
34
 
 
35
    String h0 = Utils.hash_func (s0);
 
36
    String h1 = Utils.hash_func (s1);
 
37
 
 
38
    assert (Objects.equals (h0, h1));
 
39
  }
 
40
 
16
41
}