File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2023-2024 Arm Limited.
2+ * Copyright (c) 2023-2025 Arm Limited.
33 *
44 * SPDX-License-Identifier: MIT
55 */
@@ -75,7 +75,7 @@ struct counter_sample {
7575
7676 /* * Default constructor */
7777 counter_sample ()
78- : counter_sample(hwcpipe_counter(), 0 , 0UL ) {}
78+ : counter_sample(hwcpipe_counter(), 0 , static_cast < uint64_t >( 0UL ) ) {}
7979};
8080
8181/* *
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2023-2024 Arm Limited.
2+ * Copyright (c) 2023-2025 Arm Limited.
33 *
44 * SPDX-License-Identifier: MIT
55 */
@@ -44,12 +44,22 @@ struct hwcpipe_sampler_mock_policy {
4444using namespace hwcpipe ::mock;
4545using sampler_t = hwcpipe::sampler<hwcpipe_sampler_mock_policy>;
4646
47+ TEST_CASE (" counter_sampler__DefaultConstructor" ) {
48+ SECTION (" uint64" ) {
49+ counter_sample sample;
50+
51+ REQUIRE (sample.timestamp == 0 );
52+ REQUIRE (sample.value .uint64 == static_cast <uint64_t >(0UL ));
53+ REQUIRE (sample.type == counter_sample::type::uint64);
54+ }
55+ }
56+
4757TEST_CASE (" counter_sampler__CorrectTypesAreAssigned" ) {
4858 SECTION (" uint64" ) {
49- counter_sample sample{hwcpipe_counter (), 0xbaadcafe , 42UL };
59+ counter_sample sample{hwcpipe_counter (), 0xbaadcafe , static_cast < uint64_t >( 42UL ) };
5060
5161 REQUIRE (sample.timestamp == 0xbaadcafe );
52- REQUIRE (sample.value .uint64 == 42 );
62+ REQUIRE (sample.value .uint64 == static_cast < uint64_t >( 42 ) );
5363 REQUIRE (sample.type == counter_sample::type::uint64);
5464 }
5565
You can’t perform that action at this time.
0 commit comments