Bug 116445 - Move MD5, SHA1 unit tests from WTF to TestWebKitAPI
Summary: Move MD5, SHA1 unit tests from WTF to TestWebKitAPI
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-20 10:31 PDT by Zan Dobersek
Modified: 2013-05-31 03:06 PDT (History)
5 users (show)

See Also:


Attachments
Provisional patch (16.53 KB, patch)
2013-05-20 10:43 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch (20.97 KB, patch)
2013-05-30 12:00 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff
Patch for landing (20.22 KB, patch)
2013-05-31 01:50 PDT, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2013-05-20 10:31:54 PDT
Move MD5, SHA1 unit tests from WTF to TestWebKitAPI
Comment 1 Zan Dobersek 2013-05-20 10:43:40 PDT
Created attachment 202291 [details]
Provisional patch

Still needs to add the new files to the XCode build system.
Comment 2 Zan Dobersek 2013-05-30 12:00:19 PDT
Created attachment 203369 [details]
Patch
Comment 3 Benjamin Poulain 2013-05-30 16:28:29 PDT
Comment on attachment 203369 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=203369&action=review

Great!

> Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:761
> +				CD5393C91757BAC400C07123 /* SHA1.cpp */,
> +				CD5393C71757BA9700C07123 /* MD5.cpp */,

The build section should be sorted alphabetically.

> Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:1182
>  				2E7765CF16C4D81100BA2BB1 /* mainMac.mm in Sources */,
> +				CD5393C81757BA9700C07123 /* MD5.cpp in Sources */,
> +				CD5393CA1757BAC400C07123 /* SHA1.cpp in Sources */,

Ditto.

> Tools/TestWebKitAPI/Tests/WTF/MD5.cpp:29
> +/*
> + * Copyright (C) 2010 Google Inc. All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions are
> + * met:
> + *
> + *     * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + *     * Redistributions in binary form must reproduce the above
> + * copyright notice, this list of conditions and the following disclaimer
> + * in the documentation and/or other materials provided with the
> + * distribution.
> + *     * Neither the name of Google Inc. nor the names of its
> + * contributors may be used to endorse or promote products derived from
> + * this software without specific prior written permission.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
> + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
> + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
> + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
> + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
> + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
> + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> + */

I am not sure this is the right copyright.

If the test comes from the original sqlite code, it should be the one starting with "This code implements the MD5 message-digest algorithm."

> Tools/TestWebKitAPI/Tests/WTF/MD5.cpp:54
> +    // MD5 Test suite from http://www.ietf.org/rfc/rfc1321.txt

Missing period.

> Tools/TestWebKitAPI/Tests/WTF/SHA1.cpp:1
> +/*

ditto for the copyright.
Comment 4 Zan Dobersek 2013-05-31 01:01:27 PDT
Comment on attachment 203369 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=203369&action=review

>> Tools/TestWebKitAPI/Tests/WTF/SHA1.cpp:1
>> +/*
> 
> ditto for the copyright.

There's no other copyright located in Source/WTF/wtf/SHA1.cpp apart from this one and the three lines of comment about RFC3174 that I don't believe count as copyright.
Should I leave this one as it is or concoct something third?
Comment 5 Benjamin Poulain 2013-05-31 01:43:26 PDT
(In reply to comment #4)
> There's no other copyright located in Source/WTF/wtf/SHA1.cpp apart from this one and the three lines of comment about RFC3174 that I don't believe count as copyright.
> Should I leave this one as it is or concoct something third?

You are right, my bad.
I assumed that was the same as the other file.
Comment 6 Zan Dobersek 2013-05-31 01:50:49 PDT
Created attachment 203424 [details]
Patch for landing
Comment 7 Zan Dobersek 2013-05-31 01:59:48 PDT
(In reply to comment #6)
> Created an attachment (id=203424) [details]
> Patch for landing

Addressed the review comments. Uses the Source/WTF/wtf/MD5.cpp copyright that explains the origin of this code but omits the instructions on how to use the MD5 class as that's not relevant here.

Benjamin, can you please cq+ if the patch looks OK to you now?
Comment 8 Benjamin Poulain 2013-05-31 02:10:48 PDT
Comment on attachment 203424 [details]
Patch for landing

Looks good.
Comment 9 WebKit Commit Bot 2013-05-31 03:06:25 PDT
Comment on attachment 203424 [details]
Patch for landing

Clearing flags on attachment: 203424

Committed r151012: <http://trac.webkit.org/changeset/151012>
Comment 10 WebKit Commit Bot 2013-05-31 03:06:29 PDT
All reviewed patches have been landed.  Closing bug.