SkelCL
SkelCL is a high level multi GPU skeleton library developed at the university of Münster, Germany.
 All Classes Namespaces Files Functions Variables Typedefs Groups
SHA1Tests.cpp
1 /*****************************************************************************
2  * Copyright (c) 2011-2012 The SkelCL Team as listed in CREDITS.txt *
3  * http://skelcl.uni-muenster.de *
4  * *
5  * This file is part of SkelCL. *
6  * SkelCL is available under multiple licenses. *
7  * The different licenses are subject to terms and condition as provided *
8  * in the files specifying the license. See "LICENSE.txt" for details *
9  * *
10  *****************************************************************************
11  * *
12  * SkelCL is free software: you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation, either version 3 of the License, or *
15  * (at your option) any later version. See "LICENSE-gpl.txt" for details. *
16  * *
17  * SkelCL is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU General Public License for more details. *
21  * *
22  *****************************************************************************
23  * *
24  * For non-commercial academic use see the license specified in the file *
25  * "LICENSE-academic.txt". *
26  * *
27  *****************************************************************************
28  * *
29  * If you are interested in other licensing models, including a commercial- *
30  * license, please contact the author at michel.steuwer@uni-muenster.de *
31  * *
32  *****************************************************************************/
33 
37 
38 #include <string>
39 
40 #include <pvsutil/Logger.h>
41 
42 #include <SkelCL/detail/Util.h>
43 
44 #include "Test.h"
47 
48 class SHA1Test : public ::testing::Test {
49 protected:
50  SHA1Test() {
51  pvsutil::defaultLogger.setLoggingLevel(pvsutil::Logger::Severity::Debug);
52  }
53 
54  ~SHA1Test() {
55  }
56 };
57 
58 TEST_F(SHA1Test, EmptyHash) {
59  std::string text("");
60  std::string expected("da39a3ee5e6b4b0d3255bfef95601890afd80709");
61 
62  EXPECT_EQ(expected, skelcl::detail::util::hash(text));
63 }
64 
65 TEST_F(SHA1Test, lazyDog) {
66  std::string text("The quick brown fox jumps over the lazy dog");
67  std::string expected("2fd4e1c67a2d28fced849ee1bb76e7391b93eb12");
68 
69  EXPECT_EQ(expected, skelcl::detail::util::hash(text));
70 }
71 
72 TEST_F(SHA1Test, lazyCog) {
73  std::string text("The quick brown fox jumps over the lazy cog");
74  std::string expected("de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3");
75 
76  EXPECT_EQ(expected, skelcl::detail::util::hash(text));
77 }
78 
80