History

Add encoder test

jwwang committed 12 years ago

Commit 6f58a0c1 parent cb0053f6 files · +170 −12Browse files

Showing the changes to test/decoder_test.cpp (1 of 6 files). Show all

Unified · Split

test/decoder_test.cpp+1−11
@@ -11,17 +11,7 @@ · 10 unmodified lines
11#include "codec_api.h"11#include "codec_api.h"
12 12
13#include "utils/BufferedData.h"13#include "utils/BufferedData.h"
14 14#include "utils/HashFunctions.h"
15static bool CompareHash(unsigned char(&digest)[SHA_DIGEST_LENGTH],
16 const char* hashStr) {
17
18 char hashStrCmp[SHA_DIGEST_LENGTH * 2 + 1];
19 for (int i = 0; i < SHA_DIGEST_LENGTH; ++i) {
20 sprintf(&hashStrCmp[i*2], "%.2x", digest[i]);
21 }
22 hashStrCmp[SHA_DIGEST_LENGTH * 2] = '\0';
23 return strncmp(hashStr, hashStrCmp, SHA_DIGEST_LENGTH * 2) == 0;
24}
25 15
26static void UpdateHashFromPlane(SHA_CTX* ctx, const uint8_t* plane,16static void UpdateHashFromPlane(SHA_CTX* ctx, const uint8_t* plane,
27 int width, int height, int stride) {17 int width, int height, int stride) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t