aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_string.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-26 19:23:13 +0100
committerDavid Robillard <d@drobilla.net>2020-12-31 13:25:56 +0100
commitd101d926946a5e8067a90d157b6553aae7bddc19 (patch)
treee997425e9f972e402830d9ab8cb65005068e9619 /test/test_string.c
parent8a93d0b3be5b6d80a1bef85bc73b2661f5ab4376 (diff)
downloadserd-d101d926946a5e8067a90d157b6553aae7bddc19.tar.gz
serd-d101d926946a5e8067a90d157b6553aae7bddc19.tar.bz2
serd-d101d926946a5e8067a90d157b6553aae7bddc19.zip
Format all code with clang-format
Diffstat (limited to 'test/test_string.c')
-rw-r--r--test/test_string.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/test/test_string.c b/test/test_string.c
index 1e11f5b4..225eca4f 100644
--- a/test/test_string.c
+++ b/test/test_string.c
@@ -26,39 +26,39 @@
static void
test_strlen(void)
{
- const uint8_t str[] = { '"', '5', 0xE2, 0x82, 0xAC, '"', '\n', 0 };
+ const uint8_t str[] = {'"', '5', 0xE2, 0x82, 0xAC, '"', '\n', 0};
- size_t n_bytes = 0;
- SerdNodeFlags flags = 0;
- size_t len = serd_strlen(str, &n_bytes, &flags);
- assert(len == 5 && n_bytes == 7 &&
- flags == (SERD_HAS_QUOTE | SERD_HAS_NEWLINE));
- len = serd_strlen(str, NULL, &flags);
- assert(len == 5);
+ size_t n_bytes = 0;
+ SerdNodeFlags flags = 0;
+ size_t len = serd_strlen(str, &n_bytes, &flags);
+ assert(len == 5 && n_bytes == 7 &&
+ flags == (SERD_HAS_QUOTE | SERD_HAS_NEWLINE));
+ len = serd_strlen(str, NULL, &flags);
+ assert(len == 5);
- assert(serd_strlen(str, &n_bytes, NULL) == 5);
+ assert(serd_strlen(str, &n_bytes, NULL) == 5);
}
static void
test_strerror(void)
{
- const uint8_t* msg = serd_strerror(SERD_SUCCESS);
- assert(!strcmp((const char*)msg, "Success"));
- for (int i = SERD_FAILURE; i <= SERD_ERR_INTERNAL; ++i) {
- msg = serd_strerror((SerdStatus)i);
- assert(strcmp((const char*)msg, "Success"));
- }
+ const uint8_t* msg = serd_strerror(SERD_SUCCESS);
+ assert(!strcmp((const char*)msg, "Success"));
+ for (int i = SERD_FAILURE; i <= SERD_ERR_INTERNAL; ++i) {
+ msg = serd_strerror((SerdStatus)i);
+ assert(strcmp((const char*)msg, "Success"));
+ }
- msg = serd_strerror((SerdStatus)-1);
- assert(!strcmp((const char*)msg, "Unknown error"));
+ msg = serd_strerror((SerdStatus)-1);
+ assert(!strcmp((const char*)msg, "Unknown error"));
}
int
main(void)
{
- test_strlen();
- test_strerror();
+ test_strlen();
+ test_strerror();
- printf("Success\n");
- return 0;
+ printf("Success\n");
+ return 0;
}