File: test_AlignedVector.cpp

package info (click to toggle)
rkcommon 1.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,276 kB
  • sloc: cpp: 33,504; sh: 31; makefile: 13
file content (23 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2009 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "../catch.hpp"

#include "rkcommon/containers/AlignedVector.h"

using rkcommon::containers::AlignedVector;

SCENARIO("verify alignment", "[AlignedVector]")
{
  GIVEN("An AlignedVector<> with reserved memory")
  {
    AlignedVector<int> aligned_vec;

    aligned_vec.resize(500);

    THEN("The allocated memory should be aligned")
    {
      REQUIRE(rkcommon::memory::isAligned(aligned_vec.data()));
    }
  }
}