Sync worktree updates into main repo folder
This commit is contained in:
parent
bc1a502c1d
commit
c4d2b5d9d1
21 changed files with 1565 additions and 347 deletions
|
|
@ -20,16 +20,17 @@
|
|||
|
||||
#include "device/device.h"
|
||||
|
||||
#define E2E_PATH_MAX 160
|
||||
#define E2E_PATH_MAX 160 /* base_dir: /tmp/tr4mpass_e2e_<pid> */
|
||||
#define E2E_PATH_FULL_MAX 200 /* base_dir + longest suffix (/mobileactivationd) */
|
||||
|
||||
typedef struct {
|
||||
char base_dir[E2E_PATH_MAX];
|
||||
char ibss[E2E_PATH_MAX];
|
||||
char ibec[E2E_PATH_MAX];
|
||||
char devtree[E2E_PATH_MAX];
|
||||
char trustcache[E2E_PATH_MAX];
|
||||
char ramdisk[E2E_PATH_MAX];
|
||||
char patched_mad[E2E_PATH_MAX];
|
||||
char ibss[E2E_PATH_FULL_MAX];
|
||||
char ibec[E2E_PATH_FULL_MAX];
|
||||
char devtree[E2E_PATH_FULL_MAX];
|
||||
char trustcache[E2E_PATH_FULL_MAX];
|
||||
char ramdisk[E2E_PATH_FULL_MAX];
|
||||
char patched_mad[E2E_PATH_FULL_MAX];
|
||||
} e2e_fixture_t;
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -139,6 +139,10 @@ void curl_easy_cleanup(CURL *handle)
|
|||
free(e);
|
||||
}
|
||||
|
||||
/* Modern curl.h wraps these two functions in __extension__ type-checking
|
||||
* macros. Undefine them so our mock function definitions are visible to
|
||||
* the linker without the macro interfering. */
|
||||
#undef curl_easy_setopt
|
||||
CURLcode curl_easy_setopt(CURL *handle, CURLoption option, ...)
|
||||
{
|
||||
struct mock_curl_easy *e = (struct mock_curl_easy *)handle;
|
||||
|
|
@ -211,6 +215,7 @@ CURLcode curl_easy_perform(CURL *handle)
|
|||
return CURLE_OK;
|
||||
}
|
||||
|
||||
#undef curl_easy_getinfo
|
||||
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO info, ...)
|
||||
{
|
||||
struct mock_curl_easy *e = (struct mock_curl_easy *)handle;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,13 @@ extern int g_failures;
|
|||
#define ASSERT_NEQ(a, b) ASSERT((a) != (b))
|
||||
#define ASSERT_NULL(p) ASSERT((p) == NULL)
|
||||
#define ASSERT_NOTNULL(p) ASSERT((p) != NULL)
|
||||
#define ASSERT_STREQ(a, b) ASSERT((a) && (b) && strcmp((a), (b)) == 0)
|
||||
#define ASSERT_STRSTR(h, n) ASSERT((h) && (n) && strstr((h), (n)) != NULL)
|
||||
#define ASSERT_MEM_EQ(a, b, n) ASSERT((a) && (b) && memcmp((a), (b), (n)) == 0)
|
||||
/* ASSERT_STREQ / ASSERT_STRSTR: do not null-guard the second argument —
|
||||
* it is always a string literal or stack array (always non-null), and
|
||||
* the check triggers -Waddress on GCC. Keep the first-arg guard for
|
||||
* ASSERT_MEM_EQ since the first argument (heap pointer) may be NULL. */
|
||||
#define ASSERT_STREQ(a, b) ASSERT(strcmp((a), (b)) == 0)
|
||||
#define ASSERT_STRSTR(h, n) ASSERT(strstr((h), (n)) != NULL)
|
||||
#define ASSERT_MEM_EQ(a, b, n) ASSERT((a) && memcmp((a), (b), (n)) == 0)
|
||||
#define ASSERT_LT(a, b) ASSERT((a) < (b))
|
||||
#define ASSERT_GT(a, b) ASSERT((a) > (b))
|
||||
|
||||
|
|
|
|||
|
|
@ -52,9 +52,10 @@ unset_ramdisk_env(void)
|
|||
static int
|
||||
write_tmp_blob(const char *path)
|
||||
{
|
||||
static const char payload[16] =
|
||||
"\x00\x01\x02\x03\x04\x05\x06\x07"
|
||||
"\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f";
|
||||
static const unsigned char payload[16] = {
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
|
||||
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f
|
||||
};
|
||||
FILE *f = fopen(path, "wb");
|
||||
if (!f) return -1;
|
||||
if (fwrite(payload, 1, sizeof(payload), f) != sizeof(payload)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue