A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mc] Do not use mc_{global_variables,local_variables,variables_type}_{libsimgrid...
[simgrid.git]
/
src
/
xbt
/
xbt_sha.c
diff --git
a/src/xbt/xbt_sha.c
b/src/xbt/xbt_sha.c
index
29016d9
..
d03cd89
100644
(file)
--- a/
src/xbt/xbt_sha.c
+++ b/
src/xbt/xbt_sha.c
@@
-6,7
+6,7
@@
*/
/* Later adapted to fit into SimGrid. Distributed under LGPL v2.1, Feb 1999.*/
*/
/* Later adapted to fit into SimGrid. Distributed under LGPL v2.1, Feb 1999.*/
-/* Copyright (c) 2008
, 2009, 2010
. The SimGrid Team.
+/* Copyright (c) 2008
-2013
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-99,7
+99,7
@@
static void xbt_sha_finalize(xbt_sha_t sha)
/** @brief returns the sha hash into a newly allocated buffer (+ reset sha object) */
char *xbt_sha_read(xbt_sha_t sha)
{
/** @brief returns the sha hash into a newly allocated buffer (+ reset sha object) */
char *xbt_sha_read(xbt_sha_t sha)
{
- char *res = xbt_malloc(4
0
);
+ char *res = xbt_malloc(4
1
);
xbt_sha_print(sha, res);
return res;
}
xbt_sha_print(sha, res);
return res;
}
@@
-195,16
+195,13
@@
static void test_sha(const char *clear, const char *hashed)
char hash[41];
xbt_sha(clear, hash);
char hash[41];
xbt_sha(clear, hash);
- xbt_test_add
1
("==== Test with '%s'", clear);
- xbt_test_assert
3
(!memcmp(hash, hashed, 40), "Wrong sha: %40s!=%40s (%s)",
+ xbt_test_add("==== Test with '%s'", clear);
+ xbt_test_assert(!memcmp(hash, hashed, 40), "Wrong sha: %40s!=%40s (%s)",
hash, hashed, mycmp(hash, hashed, 40));
}
XBT_TEST_SUITE("hash", "Various hash functions");
hash, hashed, mycmp(hash, hashed, 40));
}
XBT_TEST_SUITE("hash", "Various hash functions");
-XBT_LOG_NEW_DEFAULT_CATEGORY(hash, "Tests of various hash functions ");
-
-
XBT_TEST_UNIT("sha", test_crypto_sha, "Test of the sha algorithm")
{
/* Empty string as test vector */
XBT_TEST_UNIT("sha", test_crypto_sha, "Test of the sha algorithm")
{
/* Empty string as test vector */