source: trunk/lib_ir/test_link.py @ 3923

Last change on this file since 3923 was 3909, checked in by linmengl, 5 years ago

initial commit of lib_ir

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#! /bin/python
2
3import subprocess
4import sys
5failed = False
6
7def check(res, should):
8    if res.strip() != should.strip():
9        print "Test faild."
10        failed = True
11        sys.exit(1)
12
13res = subprocess.check_output(["./test_link", "10"])
14should = """
1500000000000000000000000000001010000000000000000000000000000010100000000000000000000000000000101000000000000000000000000000001010
16"""
17check(res, should)
18
19res = subprocess.check_output(["./test_link", "123123"])
20should = """
2100000000000000011110000011110011000000000000000111100000111100110000000000000001111000001111001100000000000000011110000011110011
22"""
23check(res, should)
24
25res = subprocess.check_output(["./test_link", "234"])
26should = """
2700000000000000000000000011101010000000000000000000000000111010100000000000000000000000001110101000000000000000000000000011101010
28"""
29check(res, should)
30
31res = subprocess.check_output(["./test_link", "23345"])
32should = """
3300000000000000000101101100110001000000000000000001011011001100010000000000000000010110110011000100000000000000000101101100110001
34"""
35check(res, should)
36
37if not failed:
38    print "Test succeed!"
Note: See TracBrowser for help on using the repository browser.