mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-14 07:03:44 +01:00
f8ef7c65d1
This gives an indication in the log that Tor was built with Rust support, as well as laying some groundwork for further string-returning APIs to be converted to Rust
32 lines
588 B
C
32 lines
588 B
C
/* Copyright (c) 2017, The Tor Project, Inc. */
|
|
/* See LICENSE for licensing information */
|
|
|
|
#include "orconfig.h"
|
|
#include "compat_rust.h"
|
|
#include "test.h"
|
|
#include "util.h"
|
|
|
|
static void
|
|
test_welcome_string(void *arg)
|
|
{
|
|
(void)arg;
|
|
rust_str_t s = rust_welcome_string();
|
|
const char *c_str = rust_str_get(s);
|
|
tt_assert(c_str);
|
|
size_t len = strlen(c_str);
|
|
#ifdef HAVE_RUST
|
|
tt_assert(len > 0);
|
|
#else
|
|
tt_assert(len == 0);
|
|
#endif
|
|
|
|
done:
|
|
rust_str_free(s);
|
|
}
|
|
|
|
struct testcase_t rust_tests[] = {
|
|
{ "welcome_string", test_welcome_string, 0, NULL, NULL },
|
|
END_OF_TESTCASES
|
|
};
|
|
|