Changeset 1886 for trunk


Ignore:
Timestamp:
Jan 26, 2012, 3:49:12 PM (7 years ago)
Author:
ksherdy
Message:

Updated test cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/test/hash_util_test.cpp

    r1880 r1886  
    9696    */
    9797
    98     // Length 8 (bits), Expect hash<8>, hash<1> to return equal values.
     98    // Length 8 (bits), Expect stream_hash<8>, stream_hash<1> to return equal values.
    9999    /*
    100100    hash_size = 8;
    101101    for(uint32_t idx=0;idx<sizeof(uint64_t);idx++) {
    102102
    103         // hash<1>
    104         r = hash<1>((uint8_t *) &b0,(uint8_t *) &b2, idx*8, 8, hash_size);
    105         cout << dec << "hash<1> = " << r << endl << endl;
     103        // stream_hash<1>
     104        r = stream_hash<1>((uint8_t *) &b0,(uint8_t *) &b2, idx*8, 8, hash_size);
     105        cout << dec << "stream_hash<1> = " << r << endl << endl;
    106106        cout << endl << endl;
    107107
    108         r = hash<8>((uint8_t *) &b0,(uint8_t *) &b2, idx, 1, hash_size);
    109         cout << dec << "hash<8> = " << r << endl << endl;
     108        r = stream_hash<8>((uint8_t *) &b0,(uint8_t *) &b2, idx, 1, hash_size);
     109        cout << dec << "stream_hash<8> = " << r << endl << endl;
    110110        cout << endl << endl;
    111111
     
    113113    */
    114114
    115     // Length 16 (bits), Expect hash<8>, hash<1> to return equal values.
     115    // Length 16 (bits), Expect stream_hash<8>, stream_hash<1> to return equal values.
    116116    /*
    117117    hash_size = 16;
    118118    for(uint32_t idx=0;idx<sizeof(uint64_t)-1;idx++) {
    119119
    120         // hash<1>
    121         r = hash<1>((uint8_t *) &b1,(uint8_t *) &b2, idx*8, 16, hash_size);
    122         cout << dec << "hash<1> = " << r << endl << endl;
     120        // stream_hash<1>
     121        r = stream_hash<1>((uint8_t *) &b1,(uint8_t *) &b2, idx*8, 16, hash_size);
     122        cout << dec << "stream_hash<1> = " << r << endl << endl;
    123123        cout << endl << endl;
    124124
    125         r = hash<8>((uint8_t *) &b1,(uint8_t *) &b2, idx, 2, hash_size);
    126         cout << dec << "hash<8> = " << r << endl << endl;
     125        r = stream_hash<8>((uint8_t *) &b1,(uint8_t *) &b2, idx, 2, hash_size);
     126        cout << dec << "stream_hash<8> = " << r << endl << endl;
    127127        cout << endl << endl;
    128128
     
    130130    */
    131131
    132     // Some hash<1> cases.
     132    // Some stream_hash<1> cases.
    133133    /*
    134134    hash_size = 9;
    135135    for(uint32_t lgth=16;lgth<sizeof(uint64_t)*8+1;lgth+=16) {
    136136        for(uint32_t idx=1;idx<sizeof(uint64_t)*8-lgth+1;idx++) {
    137              r = hash<1>((uint8_t *) &b0,(uint8_t *) &b1, idx, lgth, hash_size);
    138              cout << dec << "hash<1> = " << r << endl << endl;
     137             r = stream_hash<1>((uint8_t *) &b0,(uint8_t *) &b1, idx, lgth, hash_size);
     138             cout << dec << "stream_hash<1> = " << r << endl << endl;
    139139             cout  << endl;
    140140        }
     
    142142    */
    143143
    144     // Some hash<8> cases.
     144    // Some stream_hash<8> cases.
    145145    /*
    146146    hash_size = 8;
    147147    for(uint32_t lgth=2;lgth<sizeof(uint64_t)+1;lgth++) {
    148148        for(uint32_t idx=0;idx<sizeof(uint64_t)-lgth+1;idx++) {
    149              r = hash<8>((uint8_t *) &b0,(uint8_t *) &b1, idx, lgth, hash_size);
    150              cout << dec << "hash<8> = " << r << endl;
     149             r = stream_hash<8>((uint8_t *) &b0,(uint8_t *) &b1, idx, lgth, hash_size);
     150             cout << dec << "stream_hash<8> = " << r << endl;
    151151             cout << endl << endl;
    152152        }
Note: See TracChangeset for help on using the changeset viewer.