mirror of
https://github.com/wassname/ray.git
synced 2026-09-11 12:43:20 +08:00
task queue tests and extensions (#18)
* task queue tests and extensions * clean up test
This commit is contained in:
committed by
Robert Nishihara
parent
313241e303
commit
7a079547b0
@@ -0,0 +1,27 @@
|
||||
#include "greatest.h"
|
||||
|
||||
#include "common.h"
|
||||
|
||||
SUITE(common_tests);
|
||||
|
||||
TEST sha1_test(void) {
|
||||
static char hex[2 * UNIQUE_ID_SIZE + 1];
|
||||
static unsigned char id[UNIQUE_ID_SIZE];
|
||||
unique_id uid = globally_unique_id();
|
||||
sha1_to_hex(&uid.id[0], &hex[0]);
|
||||
hex_to_sha1(&hex[0], &id[0]);
|
||||
ASSERT(memcmp(&uid.id[0], &id[0], 20) == 0);
|
||||
PASS();
|
||||
}
|
||||
|
||||
SUITE(common_tests) {
|
||||
RUN_TEST(sha1_test);
|
||||
}
|
||||
|
||||
GREATEST_MAIN_DEFS();
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
GREATEST_MAIN_BEGIN();
|
||||
RUN_SUITE(common_tests);
|
||||
GREATEST_MAIN_END();
|
||||
}
|
||||
Reference in New Issue
Block a user