id stringlengths 22 129 | text stringlengths 60 19.5k | arch stringclasses 9
values | syntax stringclasses 5
values | kind stringclasses 4
values | repo stringclasses 32
values | path stringlengths 7 108 | license stringclasses 10
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 15
values | source_url stringlengths 85 192 | line_start int64 1 5.48k | line_end int64 4 5.5k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
zephyrproject-rtos/zephyr:tests/unit/math_extras/tests.inc:1 | /*
* Copyright (c) 2019 Facebook
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/ztest.h>
#include <zephyr/sys/math_extras.h>
#include <inttypes.h>
static void VNAME(u32_add)(void)
{
uint32_t result = 42;
zassert_false(u32_add_overflow(2, 3, &result));
zassert_equal(result, 5);
zassert_false(u32... | arm64 | gas-like | handwritten | zephyrproject-rtos/zephyr | tests/unit/math_extras/tests.inc | Apache-2.0 | 5e802fe73d979b1e0aa9d675429be303a0d2e7b2 | github | rtos | https://github.com/zephyrproject-rtos/zephyr/blob/5e802fe73d979b1e0aa9d675429be303a0d2e7b2/tests/unit/math_extras/tests.inc | 1 | 60 |
zephyrproject-rtos/zephyr:tests/unit/math_extras/tests.inc:2 | zassert_false(u32_mul_overflow(UINT32_MAX, 1, &result));
zassert_equal(result, UINT32_MAX);
zassert_true(u32_mul_overflow(UINT32_MAX, 2, &result));
zassert_equal(result, UINT32_MAX * 2);
zassert_false(u32_mul_overflow(1, UINT32_MAX, &result));
zassert_equal(result, UINT32_MAX);
zassert_true(u32_mul_overflow(2, U... | arm64 | gas-like | handwritten | zephyrproject-rtos/zephyr | tests/unit/math_extras/tests.inc | Apache-2.0 | 5e802fe73d979b1e0aa9d675429be303a0d2e7b2 | github | rtos | https://github.com/zephyrproject-rtos/zephyr/blob/5e802fe73d979b1e0aa9d675429be303a0d2e7b2/tests/unit/math_extras/tests.inc | 41 | 100 |
zephyrproject-rtos/zephyr:tests/unit/math_extras/tests.inc:3 | zassert_false(u64_mul_overflow(2, 3, &result));
zassert_equal(result, 6);
zassert_false(u64_mul_overflow(UINT64_MAX, 1, &result));
zassert_equal(result, UINT64_MAX);
zassert_true(u64_mul_overflow(UINT64_MAX, 2, &result));
zassert_equal(result, UINT64_MAX * 2);
zassert_false(u64_mul_overflow(1, UINT64_MAX, &resu... | arm64 | gas-like | handwritten | zephyrproject-rtos/zephyr | tests/unit/math_extras/tests.inc | Apache-2.0 | 5e802fe73d979b1e0aa9d675429be303a0d2e7b2 | github | rtos | https://github.com/zephyrproject-rtos/zephyr/blob/5e802fe73d979b1e0aa9d675429be303a0d2e7b2/tests/unit/math_extras/tests.inc | 81 | 140 |
zephyrproject-rtos/zephyr:tests/unit/math_extras/tests.inc:4 | size_t result = 42;
zassert_false(size_mul_overflow(2, 3, &result));
zassert_equal(result, 6);
zassert_false(size_mul_overflow(SIZE_MAX, 1, &result));
zassert_equal(result, SIZE_MAX);
zassert_true(size_mul_overflow(SIZE_MAX, 2, &result));
zassert_equal(result, SIZE_MAX * 2);
zassert_false(size_mul_overflow(1,... | arm64 | gas-like | handwritten | zephyrproject-rtos/zephyr | tests/unit/math_extras/tests.inc | Apache-2.0 | 5e802fe73d979b1e0aa9d675429be303a0d2e7b2 | github | rtos | https://github.com/zephyrproject-rtos/zephyr/blob/5e802fe73d979b1e0aa9d675429be303a0d2e7b2/tests/unit/math_extras/tests.inc | 121 | 180 |
zephyrproject-rtos/zephyr:tests/unit/math_extras/tests.inc:5 | zassert_equal(u32_count_trailing_zeros(1), 0);
zassert_equal(u32_count_trailing_zeros(6), 1);
zassert_equal(u32_count_trailing_zeros(0x00f00f00), 8);
zassert_equal(u32_count_trailing_zeros(0xf00ffc00), 10);
zassert_equal(u32_count_trailing_zeros(0xffffffff), 0);
zassert_equal(u32_count_trailing_zeros(0x80000000), ... | arm64 | gas-like | handwritten | zephyrproject-rtos/zephyr | tests/unit/math_extras/tests.inc | Apache-2.0 | 5e802fe73d979b1e0aa9d675429be303a0d2e7b2 | github | rtos | https://github.com/zephyrproject-rtos/zephyr/blob/5e802fe73d979b1e0aa9d675429be303a0d2e7b2/tests/unit/math_extras/tests.inc | 161 | 203 |
zephyrproject-rtos/zephyr:tests/unit/math_extras/tests.inc:5 | zassert_equal(u32_count_trailing_zeros(1), 0);
zassert_equal(u32_count_trailing_zeros(6), 1);
zassert_equal(u32_count_trailing_zeros(0x00f00f00), 8);
zassert_equal(u32_count_trailing_zeros(0xf00ffc00), 10);
zassert_equal(u32_count_trailing_zeros(0xffffffff), 0);
zassert_equal(u32_count_trailing_zeros(0x80000000), ... | arm64 | gas-like | handwritten | zephyrproject-rtos/zephyr | tests/unit/math_extras/tests.inc | Apache-2.0 | 94ed533c31ee1dde8117e995630e27373927a17c | github | rtos | https://github.com/zephyrproject-rtos/zephyr/blob/94ed533c31ee1dde8117e995630e27373927a17c/tests/unit/math_extras/tests.inc | 161 | 179 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.