-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2497 from uklotzde/libraryscannerhash
LibraryScanner: Improve hashing of directory contents
- Loading branch information
Showing
15 changed files
with
180 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#include "util/cache.h" | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include <QtDebug> | ||
|
||
namespace { | ||
|
||
class CacheTest : public testing::Test { | ||
}; | ||
|
||
TEST_F(CacheTest, InvalidCacheKey) { | ||
EXPECT_FALSE(mixxx::isValidCacheKey( | ||
mixxx::invalidCacheKey())); | ||
} | ||
|
||
TEST_F(CacheTest, InvalidCacheKeyEmptyByteArray) { | ||
EXPECT_FALSE(mixxx::isValidCacheKey( | ||
mixxx::cacheKeyFromMessageDigest(QByteArray()))); | ||
EXPECT_FALSE(mixxx::isValidCacheKey( | ||
mixxx::cacheKeyFromMessageDigest(""))); | ||
EXPECT_FALSE(mixxx::isValidCacheKey( | ||
mixxx::cacheKeyFromMessageDigest("\0"))); | ||
} | ||
|
||
TEST_F(CacheTest, ValidCacheKey) { | ||
EXPECT_TRUE(mixxx::isValidCacheKey( | ||
mixxx::cacheKeyFromMessageDigest(QByteArrayLiteral("test")))); | ||
} | ||
|
||
TEST_F(CacheTest, ValidCacheKeySingleZeroAscii) { | ||
EXPECT_TRUE(mixxx::isValidCacheKey( | ||
mixxx::cacheKeyFromMessageDigest(QByteArray("0")))); | ||
} | ||
|
||
TEST_F(CacheTest, ValidCacheKeySingleZeroByte) { | ||
EXPECT_TRUE(mixxx::isValidCacheKey( | ||
mixxx::cacheKeyFromMessageDigest(QByteArray("\0", 1)))); | ||
} | ||
|
||
} // anonymous namespace |
Oops, something went wrong.