0.0.002
ddat interop with dat js cable interop with cabal js ddat's frontend = dat-thang cable fe = cable-thang dillo support based on cel's dillo-dat bootstrap node xplatform support Signed-off-by: divo <418@cryspace.space>
This commit is contained in:
1 parent
f0f91540be
commit
b735900f2e
323 files changed
+134347
-343
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#include "sleep_replication.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
sleep_feed_t feed;
|
||||
sleep_replication_t replica;
|
||||
sleep_replication_request_t request;
|
||||
memset(&feed, 0, sizeof(feed));
|
||||
assert(sleep_replication_init(&replica, &feed, 1) == 0);
|
||||
for (uint64_t i = 0; i < SLEEP_REPLICATION_QUEUE; i++) {
|
||||
request.index = i; request.bytes = 0;
|
||||
request.hash = request.nodes = 1;
|
||||
assert(sleep_replication_request(&replica, &request) == 0);
|
||||
}
|
||||
assert(sleep_replication_want(&replica, 1000, 1) == -1);
|
||||
assert(errno == ENOSPC && replica.request_count == SLEEP_REPLICATION_QUEUE);
|
||||
assert(sleep_replication_unwant(&replica, 0, 64) == 0);
|
||||
assert(replica.request_count == 64);
|
||||
assert(sleep_replication_want(&replica, 1000, 2) == 0);
|
||||
assert(replica.request_count == 66);
|
||||
assert(sleep_replication_want(&replica, 1000, 2) == 0);
|
||||
assert(replica.request_count == 66);
|
||||
assert(sleep_replication_next(&replica, &request) == 1 && request.index == 64);
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user