Changeset 1913 for trunk/lib


Ignore:
Timestamp:
Feb 8, 2012, 4:27:42 PM (7 years ago)
Author:
ksherdy
Message:

Updated hash function name.

Location:
trunk/lib/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/test/Makefile

    r1876 r1913  
    1919        $(CC) -o byte_compare_test byte_compare_test.cpp $(AFLAGS)
    2020
    21 hash_util_test: hash_util_test.cpp
     21hash_util_test: hash_util_test.cpp ../hash_util.hpp
    2222        $(CC) -o hash_util_test hash_util_test.cpp $(AFLAGS)
    2323
  • trunk/lib/test/hash_util_test.cpp

    r1886 r1913  
    9696    */
    9797
    98     // Length 8 (bits), Expect stream_hash<8>, stream_hash<1> to return equal values.
     98    // Length 8 (bits), Expect shift_hash<8>, shift_hash<1> to return equal values.
    9999    /*
    100100    hash_size = 8;
    101101    for(uint32_t idx=0;idx<sizeof(uint64_t);idx++) {
    102102
    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;
     103        // shift_hash<1>
     104        r = shift_hash<1>((uint8_t *) &b0,(uint8_t *) &b2, idx*8, 8, hash_size);
     105        cout << dec << "shift_hash<1> = " << r << endl << endl;
    106106        cout << endl << endl;
    107107
    108         r = stream_hash<8>((uint8_t *) &b0,(uint8_t *) &b2, idx, 1, hash_size);
    109         cout << dec << "stream_hash<8> = " << r << endl << endl;
     108        r = shift_hash<8>((uint8_t *) &b0,(uint8_t *) &b2, idx, 1, hash_size);
     109        cout << dec << "shift_hash<8> = " << r << endl << endl;
    110110        cout << endl << endl;
    111111
     
    113113    */
    114114
    115     // Length 16 (bits), Expect stream_hash<8>, stream_hash<1> to return equal values.
     115    // Length 16 (bits), Expect shift_hash<8>, shift_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         // 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;
     120        // shift_hash<1>
     121        r = shift_hash<1>((uint8_t *) &b1,(uint8_t *) &b2, idx*8, 16, hash_size);
     122        cout << dec << "shift_hash<1> = " << r << endl << endl;
    123123        cout << endl << endl;
    124124
    125         r = stream_hash<8>((uint8_t *) &b1,(uint8_t *) &b2, idx, 2, hash_size);
    126         cout << dec << "stream_hash<8> = " << r << endl << endl;
     125        r = shift_hash<8>((uint8_t *) &b1,(uint8_t *) &b2, idx, 2, hash_size);
     126        cout << dec << "shift_hash<8> = " << r << endl << endl;
    127127        cout << endl << endl;
    128128
     
    130130    */
    131131
    132     // Some stream_hash<1> cases.
    133     /*
     132    // Some shift_hash<1> cases.
     133        /*
    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 = stream_hash<1>((uint8_t *) &b0,(uint8_t *) &b1, idx, lgth, hash_size);
    138              cout << dec << "stream_hash<1> = " << r << endl << endl;
     137             r = shift_hash<1>((uint8_t *) &b0,(uint8_t *) &b1, idx, lgth, hash_size);
     138             cout << dec << "shift_hash<1> = " << r << endl << endl;
    139139             cout  << endl;
    140140        }
    141141    }
    142     */
     142        */
    143143
    144     // Some stream_hash<8> cases.
    145     /*
     144    // Some shift_hash<8> cases.
    146145    hash_size = 8;
    147146    for(uint32_t lgth=2;lgth<sizeof(uint64_t)+1;lgth++) {
    148147        for(uint32_t idx=0;idx<sizeof(uint64_t)-lgth+1;idx++) {
    149              r = stream_hash<8>((uint8_t *) &b0,(uint8_t *) &b1, idx, lgth, hash_size);
    150              cout << dec << "stream_hash<8> = " << r << endl;
     148             r = shift_hash<8>((uint8_t *) &b0,(uint8_t *) &b1, idx, lgth, hash_size);
     149             cout << dec << "shift_hash<8> = " << r << endl;
    151150             cout << endl << endl;
    152151        }
    153152    }
    154     */
    155153
    156154    return 1;
Note: See TracChangeset for help on using the changeset viewer.