~ubuntu-branches/ubuntu/quantal/nettle/quantal

« back to all changes in this revision

Viewing changes to testsuite/base16-test.c

  • Committer: Bazaar Package Importer
  • Author(s): Marek Habersack
  • Date: 2004-05-04 15:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20040504155602-7jbhw5mabvwksl3j
Tags: upstream-1.10
ImportĀ upstreamĀ versionĀ 1.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "testutils.h"
 
2
#include "base16.h"
 
3
 
 
4
int
 
5
test_main(void)
 
6
{
 
7
  ASSERT(BASE16_ENCODE_LENGTH(0) == 0);
 
8
  ASSERT(BASE16_ENCODE_LENGTH(1) == 2);
 
9
  ASSERT(BASE16_ENCODE_LENGTH(2) == 4);
 
10
 
 
11
  ASSERT(BASE16_DECODE_LENGTH(0) == 0);
 
12
  ASSERT(BASE16_DECODE_LENGTH(1) == 1);
 
13
  ASSERT(BASE16_DECODE_LENGTH(2) == 1);
 
14
  ASSERT(BASE16_DECODE_LENGTH(3) == 2);
 
15
  ASSERT(BASE16_DECODE_LENGTH(4) == 2);
 
16
  
 
17
  test_armor(&nettle_base16, 0, "", "");
 
18
  test_armor(&nettle_base16, 1, "H", "48");
 
19
  test_armor(&nettle_base16, 2, "He", "4865");
 
20
  test_armor(&nettle_base16, 3, "Hel", "48656c");
 
21
  test_armor(&nettle_base16, 4, "Hell", "48656c6c");
 
22
  test_armor(&nettle_base16, 5, "Hello", "48656c6c6f");
 
23
  test_armor(&nettle_base16, 6, "Hello", "48656c6c6f00");
 
24
  
 
25
  SUCCESS();
 
26
}
 
27