Changeset 66808 in webkit


Ignore:
Timestamp:
Sep 5, 2010 9:38:44 PM (14 years ago)
Author:
kbr@google.com
Message:

2010-09-05 Kenneth Russell <kbr@google.com>

Reviewed by Darin Fisher.

Add unit tests for red-black tree and (POD) arena
https://bugs.webkit.org/show_bug.cgi?id=45060

  • WebKit.gyp:
  • tests/PODArenaTest.cpp: Added. (WebCore::TestClass1::TestClass2::TestClass2): (WebCore::TEST_F):
  • tests/PODRedBlackTreeTest.cpp: Added. (WebCore::TEST):
  • tests/TreeTestHelpers.cpp: Added. (WebCore::TreeTestHelpers::generateSeed): (WebCore::TreeTestHelpers::initRandom): (WebCore::TreeTestHelpers::nextRandom):
  • tests/TreeTestHelpers.h: Added.

2010-09-05 Kenneth Russell <kbr@google.com>

Reviewed by Darin Fisher.

Add unit tests for red-black tree and (POD) arena
https://bugs.webkit.org/show_bug.cgi?id=45060

  • platform/graphics/gpu/PODArena.h: Made DefaultChunkSize public so unit tests can access it. Fixed copyright header.
  • platform/graphics/gpu/PODInterval.h: Fixed copyright header.
  • platform/graphics/gpu/PODIntervalTree.h: Fixed copyright header.
  • platform/graphics/gpu/PODRedBlackTree.h: Fixed copyright header.
Location:
trunk
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r66802 r66808  
     12010-09-05  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Add unit tests for red-black tree and (POD) arena
     6        https://bugs.webkit.org/show_bug.cgi?id=45060
     7
     8        * platform/graphics/gpu/PODArena.h: Made DefaultChunkSize public so unit tests can access it. Fixed copyright header.
     9        * platform/graphics/gpu/PODInterval.h: Fixed copyright header.
     10        * platform/graphics/gpu/PODIntervalTree.h: Fixed copyright header.
     11        * platform/graphics/gpu/PODRedBlackTree.h: Fixed copyright header.
     12
    1132010-09-05  Jeremy Orlow  <jorlow@chromium.org>
    214
  • trunk/WebCore/platform/graphics/gpu/PODArena.h

    r66704 r66808  
    11/*
    2  * Copyright 2010, Google Inc.
    3  * All rights reserved.
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions are
    7  * met:
     5 * modification, are permitted provided that the following conditions
     6 * are met:
    87 *
    9  *     * Redistributions of source code must retain the above copyright
    10  * notice, this list of conditions and the following disclaimer.
    11  *     * Redistributions in binary form must reproduce the above
    12  * copyright notice, this list of conditions and the following disclaimer
    13  * in the documentation and/or other materials provided with the
    14  * distribution.
    15  *     * Neither the name of Google Inc. nor the names of its
    16  * contributors may be used to endorse or promote products derived from
    17  * this software without specific prior written permission.
     8 * 1.  Redistributions of source code must retain the above copyright
     9 *     notice, this list of conditions and the following disclaimer.
     10 * 2.  Redistributions in binary form must reproduce the above copyright
     11 *     notice, this list of conditions and the following disclaimer in the
     12 *     documentation and/or other materials provided with the distribution.
    1813 *
    19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
     18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3024 */
    3125
     
    114108    }
    115109
     110    // The initial size of allocated chunks; increases as necessary to
     111    // satisfy large allocations. Mainly public for unit tests.
     112    enum {
     113        DefaultChunkSize = 16384
     114    };
     115
    116116protected:
    117117    ~PODArena() { }
     
    128128        , m_current(0)
    129129        , m_currentChunkSize(DefaultChunkSize) { }
    130 
    131     enum {
    132         DefaultChunkSize = 16384
    133     };
    134130
    135131    // Returns the alignment requirement for classes and structs on the
  • trunk/WebCore/platform/graphics/gpu/PODInterval.h

    r66779 r66808  
    11/*
    2  * Copyright 2010, Google Inc.
    3  * All rights reserved.
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions are
    7  * met:
     5 * modification, are permitted provided that the following conditions
     6 * are met:
    87 *
    9  *     * Redistributions of source code must retain the above copyright
    10  * notice, this list of conditions and the following disclaimer.
    11  *     * Redistributions in binary form must reproduce the above
    12  * copyright notice, this list of conditions and the following disclaimer
    13  * in the documentation and/or other materials provided with the
    14  * distribution.
    15  *     * Neither the name of Google Inc. nor the names of its
    16  * contributors may be used to endorse or promote products derived from
    17  * this software without specific prior written permission.
     8 * 1.  Redistributions of source code must retain the above copyright
     9 *     notice, this list of conditions and the following disclaimer.
     10 * 2.  Redistributions in binary form must reproduce the above copyright
     11 *     notice, this list of conditions and the following disclaimer in the
     12 *     documentation and/or other materials provided with the distribution.
    1813 *
    19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
     18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3024 */
    31 
    3225
    3326#ifndef PODInterval_h
  • trunk/WebCore/platform/graphics/gpu/PODIntervalTree.h

    r66779 r66808  
    11/*
    2  * Copyright 2010, Google Inc.
    3  * All rights reserved.
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions are
    7  * met:
     5 * modification, are permitted provided that the following conditions
     6 * are met:
    87 *
    9  *     * Redistributions of source code must retain the above copyright
    10  * notice, this list of conditions and the following disclaimer.
    11  *     * Redistributions in binary form must reproduce the above
    12  * copyright notice, this list of conditions and the following disclaimer
    13  * in the documentation and/or other materials provided with the
    14  * distribution.
    15  *     * Neither the name of Google Inc. nor the names of its
    16  * contributors may be used to endorse or promote products derived from
    17  * this software without specific prior written permission.
     8 * 1.  Redistributions of source code must retain the above copyright
     9 *     notice, this list of conditions and the following disclaimer.
     10 * 2.  Redistributions in binary form must reproduce the above copyright
     11 *     notice, this list of conditions and the following disclaimer in the
     12 *     documentation and/or other materials provided with the distribution.
    1813 *
    19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
     18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3024 */
    31 
    3225
    3326#ifndef PODIntervalTree_h
  • trunk/WebCore/platform/graphics/gpu/PODRedBlackTree.h

    r66704 r66808  
    11/*
    2  * Copyright 2010, Google Inc.
    3  * All rights reserved.
     2 * Copyright (C) 2010 Google Inc. All rights reserved.
    43 *
    54 * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions are
    7  * met:
     5 * modification, are permitted provided that the following conditions
     6 * are met:
    87 *
    9  *     * Redistributions of source code must retain the above copyright
    10  * notice, this list of conditions and the following disclaimer.
    11  *     * Redistributions in binary form must reproduce the above
    12  * copyright notice, this list of conditions and the following disclaimer
    13  * in the documentation and/or other materials provided with the
    14  * distribution.
    15  *     * Neither the name of Google Inc. nor the names of its
    16  * contributors may be used to endorse or promote products derived from
    17  * this software without specific prior written permission.
     8 * 1.  Redistributions of source code must retain the above copyright
     9 *     notice, this list of conditions and the following disclaimer.
     10 * 2.  Redistributions in binary form must reproduce the above copyright
     11 *     notice, this list of conditions and the following disclaimer in the
     12 *     documentation and/or other materials provided with the distribution.
    1813 *
    19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    23  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    24  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    25  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    29  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
     18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
     21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3024 */
    3125
  • trunk/WebKit/chromium/ChangeLog

    r66794 r66808  
     12010-09-05  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Add unit tests for red-black tree and (POD) arena
     6        https://bugs.webkit.org/show_bug.cgi?id=45060
     7
     8        * WebKit.gyp:
     9        * tests/PODArenaTest.cpp: Added.
     10        (WebCore::TestClass1::TestClass2::TestClass2):
     11        (WebCore::TEST_F):
     12        * tests/PODRedBlackTreeTest.cpp: Added.
     13        (WebCore::TEST):
     14        * tests/TreeTestHelpers.cpp: Added.
     15        (WebCore::TreeTestHelpers::generateSeed):
     16        (WebCore::TreeTestHelpers::initRandom):
     17        (WebCore::TreeTestHelpers::nextRandom):
     18        * tests/TreeTestHelpers.h: Added.
     19
    1202010-09-03  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
    221
  • trunk/WebKit/chromium/WebKit.gyp

    r66637 r66808  
    739739                        'tests/KeyboardTest.cpp',
    740740                        'tests/KURLTest.cpp',
     741                        'tests/PODArenaTest.cpp',
     742                        'tests/PODRedBlackTreeTest.cpp',
    741743                        'tests/RunAllTests.cpp',
    742744                        'tests/TilingDataTest.cpp',
     745                        'tests/TreeTestHelpers.cpp',
     746                        'tests/TreeTestHelpers.h',
    743747                    ],
    744748                    'conditions': [
Note: See TracChangeset for help on using the changeset viewer.