Files
breeze/tests/friend_requests_host_test.c
T
waozi f25b4dfd5e Build Apps and Crypto as locked packages and take the node-app ABI from Apps
Apps and Crypto are now ordinary Ziran dependencies, pinned in ziran.lock
and linked by scripts/packages.sh, instead of local checkouts handed to the
build. Every dependency and the toolchain are on their latest revisions.

scripts/package-paths.sh is the one list of NAME=DIR package paths; the
native, web, Windows and Android builds, the source check, the bundle
scripts and the tests all use it, so they resolve packages the same way.
The shared Apps controller bundle is built from the locked Apps package,
and its reviewed digest matches that build.

Node apps, the feature cells and the host import the module ABI and the
node-app types and codec from the Apps package. Inner Breeze no longer
keeps its own copies, its codec generator, or the unused protocol module.

Test hosts include zir_string.h for the string helpers they call.
2026-10-18 23:20:13 -03:00

40 lines
952 B
C

#include "friend_requests_behavior.h"
#include "zir_string.h"
#include "friend_requests.h"
#include <stddef.h>
#include <string.h>
static const char *response = "{\"incoming\":[{},{}],\"outgoing\":[]}";
int32_t
storage_get_social_cache_json(String kind, uint8_t *out, int64_t out_size)
{
size_t length = strlen(response);
if(!StringEqual(kind, StringView("friends.requests", 16)) ||
out_size < 0 || length >= (size_t)out_size)
return 0;
memcpy(out, response, length + 1);
return 1;
}
String
app_text_from_cstring(uint8_t *text, int32_t capacity)
{
size_t length = 0;
while (length < (size_t)capacity && text[length] != 0)
length++;
return StringView((const char *)text, length);
}
int
main(void)
{
if(Answer() != 42 || PendingRequestCountNow() != 2)
return 1;
response = "{\"incoming\":[],\"outgoing\":[]}";
if(PendingRequestCountNow() != 0)
return 2;
return 0;
}