From d1cd99244f96bd95bbd67cc737248df346dec08b Mon Sep 17 00:00:00 2001 From: egor-tensin Date: Thu, 25 Apr 2024 03:50:51 +0000 Subject: =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20egor-tensin/cimp?= =?UTF-8?q?le@8e652dd2cb69928ea1596aa3e59845fef6854e2c=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dex.buf.c.ed8381695b8bbc07634acc8fcf3aab27.html | 517 +++++++++++++++++++++ 1 file changed, 517 insertions(+) create mode 100644 coverage/index.buf.c.ed8381695b8bbc07634acc8fcf3aab27.html (limited to 'coverage/index.buf.c.ed8381695b8bbc07634acc8fcf3aab27.html') diff --git a/coverage/index.buf.c.ed8381695b8bbc07634acc8fcf3aab27.html b/coverage/index.buf.c.ed8381695b8bbc07634acc8fcf3aab27.html new file mode 100644 index 0000000..7988fce --- /dev/null +++ b/coverage/index.buf.c.ed8381695b8bbc07634acc8fcf3aab27.html @@ -0,0 +1,517 @@ + + + + + + GCC Code Coverage Report + + + + + +

GCC Code Coverage Report

+ +
+ +
+
+ + + + + + + + + + + + + +
Directory:src/
File:src/buf.c
Date:2024-04-25 03:45:42
+
+
+ + + + + + + + + + + + + + + + + + + +
ExecTotalCoverage
Lines:161888.9%
Branches:1425.0%
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LineBranchExecSource
1 + /*
2 + * Copyright (c) 2023 Egor Tensin <egor@tensin.name>
3 + * This file is part of the "cimple" project.
4 + * For details, see https://github.com/egor-tensin/cimple.
5 + * Distributed under the MIT License.
6 + */
7 +
8 + #include "buf.h"
9 + #include "log.h"
10 +
11 + #include <stdint.h>
12 + #include <stdlib.h>
13 + #include <string.h>
14 +
15 + struct buf {
16 + uint32_t size;
17 + const void *data;
18 + };
19 +
20 + 92012int buf_create(struct buf **_buf, const void *data, uint32_t size)
21 + {
22 + 92012 struct buf *buf = malloc(sizeof(struct buf));
23 +
+ 1/2 +
+
✗ Branch 0 not taken.
+
✓ Branch 1 taken 92012 times.
+
+
+
92012 if (!buf) {
24 + log_errno("malloc");
25 + return -1;
26 + }
27 +
28 + 92012 buf->data = data;
29 + 92012 buf->size = size;
30 +
31 + 92012 *_buf = buf;
32 + 92012 return 0;
33 + }
34 +
35 + 46006int buf_create_from_string(struct buf **buf, const char *str)
36 + {
37 + 46006 return buf_create(buf, str, strlen(str) + 1);
38 + }
39 +
40 + 92012void buf_destroy(struct buf *buf)
41 + {
42 + 92012 free(buf);
43 + 92012}
44 +
45 + 92012uint32_t buf_get_size(const struct buf *buf)
46 + {
47 + 92012 return buf->size;
48 + }
49 +
50 + 138018const void *buf_get_data(const struct buf *buf)
51 + {
52 + 138018 return buf->data;
53 + }
54 +
+
+ +
+ + + + -- cgit v1.2.3