source: Vago/Libs/quazip-0.7.2/qztest/testquachecksum32.cpp@ 1050

Last change on this file since 1050 was 1050, checked in by s10k, 8 years ago
File size: 1.5 KB
Line 
1/*
2Copyright (C) 2005-2014 Sergey A. Tachenov
3
4This file is part of QuaZIP test suite.
5
6QuaZIP is free software: you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation, either version 2.1 of the License, or
9(at your option) any later version.
10
11QuaZIP is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License
17along with QuaZIP. If not, see <http://www.gnu.org/licenses/>.
18
19See COPYING file for the full LGPL text.
20
21Original ZIP package is copyrighted by Gilles Vollant and contributors,
22see quazip/(un)zip.h files for details. Basically it's the zlib license.
23*/
24
25#include "testquachecksum32.h"
26
27#include <quazip/quaadler32.h>
28#include <quazip/quacrc32.h>
29
30#include <QtTest/QtTest>
31
32void TestQuaChecksum32::calculate()
33{
34 QuaCrc32 crc32;
35 QCOMPARE(crc32.calculate("Wikipedia"), 0xADAAC02Eu);
36 QuaAdler32 adler32;
37 QCOMPARE(adler32.calculate("Wikipedia"), 0x11E60398u);
38}
39
40void TestQuaChecksum32::update()
41{
42 QuaCrc32 crc32;
43 crc32.update("Wiki");
44 crc32.update("pedia");
45 QCOMPARE(crc32.value(), 0xADAAC02Eu);
46 QuaAdler32 adler32;
47 adler32.update("Wiki");
48 adler32.update("pedia");
49 QCOMPARE(adler32.value(), 0x11E60398u);
50}
Note: See TracBrowser for help on using the repository browser.