Changeset 85844 in webkit


Ignore:
Timestamp:
May 5, 2011 1:36:27 AM (13 years ago)
Author:
hans@chromium.org
Message:

2011-05-03 Hans Wennborg <hans@chromium.org>

Reviewed by Steve Block.

IndexedDB: Unit tests for LevelDB key coding functions
https://bugs.webkit.org/show_bug.cgi?id=59692

Fix some embarrassing bugs uncovered by unit tests.

No new functionality, but this is now covered by unit tests in the Chromium WebKit port.

  • storage/IDBLevelDBCoding.cpp: (WebCore::IDBLevelDBCoding::decodeInt): (WebCore::IDBLevelDBCoding::decodeVarInt):

2011-05-03 Hans Wennborg <hans@chromium.org>

Reviewed by Steve Block.

IndexedDB: Unit tests for LevelDB key coding functions
https://bugs.webkit.org/show_bug.cgi?id=59692

Add unit tests for the basic key coding functions used by the LevelDB back-end.

  • WebKit.gypi:
  • tests/IDBLevelDBCodingTest.cpp: Added. (IDBLevelDBCoding::TEST):
Location:
trunk/Source
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r85839 r85844  
     12011-05-03  Hans Wennborg  <hans@chromium.org>
     2
     3        Reviewed by Steve Block.
     4
     5        IndexedDB: Unit tests for LevelDB key coding functions
     6        https://bugs.webkit.org/show_bug.cgi?id=59692
     7
     8        Fix some embarrassing bugs uncovered by unit tests.
     9
     10        No new functionality, but this is now covered by unit tests in the Chromium WebKit port.
     11
     12        * storage/IDBLevelDBCoding.cpp:
     13        (WebCore::IDBLevelDBCoding::decodeInt):
     14        (WebCore::IDBLevelDBCoding::decodeVarInt):
     15
    1162011-05-05  Young Han Lee  <joybro@company100.net>
    217
  • trunk/Source/WebCore/storage/IDBLevelDBCoding.cpp

    r85045 r85844  
    190190    int64_t ret = 0;
    191191
     192    int shift = 0;
    192193    while (begin < end) {
    193194        unsigned char c = *begin++;
    194         ret = (ret << 8) | c;
     195        ret |= static_cast<int64_t>(c) << shift;
     196        shift += 8;
    195197    }
    196198
     
    206208        n >>= 7;
    207209        if (n)
    208             c |= 128;
     210            c |= 0x80;
    209211        ret.append(c);
    210212    } while (n);
     
    217219    ASSERT(limit >= p);
    218220    foundInt = 0;
     221    int shift = 0;
    219222
    220223    do {
     
    222225            return 0;
    223226
    224         foundInt = (foundInt << 7) | (*p & 0x7f);
    225     } while (*p++ & 128);
     227        unsigned char c = *p;
     228        foundInt |= static_cast<int64_t>(c & 0x7f) << shift;
     229        shift += 7;
     230    } while (*p++ & 0x80);
    226231    return p;
    227232}
  • trunk/Source/WebKit/chromium/ChangeLog

    r85833 r85844  
     12011-05-03  Hans Wennborg  <hans@chromium.org>
     2
     3        Reviewed by Steve Block.
     4
     5        IndexedDB: Unit tests for LevelDB key coding functions
     6        https://bugs.webkit.org/show_bug.cgi?id=59692
     7
     8        Add unit tests for the basic key coding functions used by the LevelDB back-end.
     9
     10        * WebKit.gypi:
     11        * tests/IDBLevelDBCodingTest.cpp: Added.
     12        (IDBLevelDBCoding::TEST):
     13
    1142011-05-04  MORITA Hajime  <morrita@google.com>
    215
  • trunk/Source/WebKit/chromium/WebKit.gypi

    r85244 r85844  
    5858            'tests/IDBBindingUtilitiesTest.cpp',
    5959            'tests/IDBKeyPathTest.cpp',
     60            'tests/IDBLevelDBCodingTest.cpp',
    6061            'tests/KeyboardTest.cpp',
    6162            'tests/KURLTest.cpp',
Note: See TracChangeset for help on using the changeset viewer.