pcm/PcmChannels: use struct ConstBuffer
This commit is contained in:
parent
af3b454805
commit
2b44a2c9bd
@ -62,11 +62,8 @@ PcmChannelsConverter::Close()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ConstBuffer<void>
|
ConstBuffer<void>
|
||||||
PcmChannelsConverter::Convert(ConstBuffer<void> src, Error &error)
|
PcmChannelsConverter::Convert(ConstBuffer<void> src, gcc_unused Error &error)
|
||||||
{
|
{
|
||||||
const void *result = nullptr;
|
|
||||||
size_t result_size = 0;
|
|
||||||
|
|
||||||
switch (format) {
|
switch (format) {
|
||||||
case SampleFormat::UNDEFINED:
|
case SampleFormat::UNDEFINED:
|
||||||
case SampleFormat::S8:
|
case SampleFormat::S8:
|
||||||
@ -75,41 +72,26 @@ PcmChannelsConverter::Convert(ConstBuffer<void> src, Error &error)
|
|||||||
gcc_unreachable();
|
gcc_unreachable();
|
||||||
|
|
||||||
case SampleFormat::S16:
|
case SampleFormat::S16:
|
||||||
result = pcm_convert_channels_16(buffer, dest_channels,
|
return pcm_convert_channels_16(buffer, dest_channels,
|
||||||
src_channels,
|
src_channels,
|
||||||
(const int16_t *)src.data,
|
ConstBuffer<int16_t>::FromVoid(src)).ToVoid();
|
||||||
src.size, &result_size);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SampleFormat::S24_P32:
|
case SampleFormat::S24_P32:
|
||||||
result = pcm_convert_channels_24(buffer, dest_channels,
|
return pcm_convert_channels_24(buffer, dest_channels,
|
||||||
src_channels,
|
src_channels,
|
||||||
(const int32_t *)src.data,
|
ConstBuffer<int32_t>::FromVoid(src)).ToVoid();
|
||||||
src.size, &result_size);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SampleFormat::S32:
|
case SampleFormat::S32:
|
||||||
result = pcm_convert_channels_32(buffer, dest_channels,
|
return pcm_convert_channels_32(buffer, dest_channels,
|
||||||
src_channels,
|
src_channels,
|
||||||
(const int32_t *)src.data,
|
ConstBuffer<int32_t>::FromVoid(src)).ToVoid();
|
||||||
src.size, &result_size);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SampleFormat::FLOAT:
|
case SampleFormat::FLOAT:
|
||||||
result = pcm_convert_channels_float(buffer, dest_channels,
|
return pcm_convert_channels_float(buffer, dest_channels,
|
||||||
src_channels,
|
src_channels,
|
||||||
(const float *)src.data,
|
ConstBuffer<float>::FromVoid(src)).ToVoid();
|
||||||
src.size, &result_size);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == nullptr) {
|
assert(false);
|
||||||
error.Format(pcm_convert_domain,
|
gcc_unreachable();
|
||||||
"Conversion from %u to %u channels "
|
|
||||||
"is not implemented",
|
|
||||||
src_channels, dest_channels);
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return { result, result_size };
|
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "PcmChannels.hxx"
|
#include "PcmChannels.hxx"
|
||||||
#include "PcmBuffer.hxx"
|
#include "PcmBuffer.hxx"
|
||||||
#include "PcmUtils.hxx"
|
#include "util/ConstBuffer.hxx"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
@ -73,31 +73,28 @@ pcm_convert_channels_16_n_to_2(int16_t *gcc_restrict dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int16_t *
|
ConstBuffer<int16_t>
|
||||||
pcm_convert_channels_16(PcmBuffer &buffer,
|
pcm_convert_channels_16(PcmBuffer &buffer,
|
||||||
unsigned dest_channels,
|
unsigned dest_channels,
|
||||||
unsigned src_channels, const int16_t *src,
|
unsigned src_channels,
|
||||||
size_t src_size, size_t *dest_size_r)
|
ConstBuffer<int16_t> src)
|
||||||
{
|
{
|
||||||
assert(src_size % (sizeof(*src) * src_channels) == 0);
|
assert(src.size % src_channels == 0);
|
||||||
|
|
||||||
size_t dest_size = src_size / src_channels * dest_channels;
|
const size_t dest_size = src.size / src_channels * dest_channels;
|
||||||
*dest_size_r = dest_size;
|
int16_t *dest = buffer.GetT<int16_t>(dest_size);
|
||||||
|
|
||||||
int16_t *dest = (int16_t *)buffer.Get(dest_size);
|
|
||||||
const int16_t *src_end = pcm_end_pointer(src, src_size);
|
|
||||||
|
|
||||||
if (src_channels == 1 && dest_channels == 2)
|
if (src_channels == 1 && dest_channels == 2)
|
||||||
MonoToStereo(dest, src, src_end);
|
MonoToStereo(dest, src.begin(), src.end());
|
||||||
else if (src_channels == 2 && dest_channels == 1)
|
else if (src_channels == 2 && dest_channels == 1)
|
||||||
pcm_convert_channels_16_2_to_1(dest, src, src_end);
|
pcm_convert_channels_16_2_to_1(dest, src.begin(), src.end());
|
||||||
else if (dest_channels == 2)
|
else if (dest_channels == 2)
|
||||||
pcm_convert_channels_16_n_to_2(dest, src_channels, src,
|
pcm_convert_channels_16_n_to_2(dest, src_channels,
|
||||||
src_end);
|
src.begin(), src.end());
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return dest;
|
return { dest, dest_size };
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -136,32 +133,28 @@ pcm_convert_channels_24_n_to_2(int32_t *gcc_restrict dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int32_t *
|
ConstBuffer<int32_t>
|
||||||
pcm_convert_channels_24(PcmBuffer &buffer,
|
pcm_convert_channels_24(PcmBuffer &buffer,
|
||||||
unsigned dest_channels,
|
unsigned dest_channels,
|
||||||
unsigned src_channels, const int32_t *src,
|
unsigned src_channels,
|
||||||
size_t src_size, size_t *dest_size_r)
|
ConstBuffer<int32_t> src)
|
||||||
{
|
{
|
||||||
assert(src_size % (sizeof(*src) * src_channels) == 0);
|
assert(src.size % src_channels == 0);
|
||||||
|
|
||||||
size_t dest_size = src_size / src_channels * dest_channels;
|
size_t dest_size = src.size / src_channels * dest_channels;
|
||||||
*dest_size_r = dest_size;
|
int32_t *dest = buffer.GetT<int32_t>(dest_size);
|
||||||
|
|
||||||
int32_t *dest = (int32_t *)buffer.Get(dest_size);
|
|
||||||
const int32_t *src_end = (const int32_t *)
|
|
||||||
pcm_end_pointer(src, src_size);
|
|
||||||
|
|
||||||
if (src_channels == 1 && dest_channels == 2)
|
if (src_channels == 1 && dest_channels == 2)
|
||||||
MonoToStereo(dest, src, src_end);
|
MonoToStereo(dest, src.begin(), src.end());
|
||||||
else if (src_channels == 2 && dest_channels == 1)
|
else if (src_channels == 2 && dest_channels == 1)
|
||||||
pcm_convert_channels_24_2_to_1(dest, src, src_end);
|
pcm_convert_channels_24_2_to_1(dest, src.begin(), src.end());
|
||||||
else if (dest_channels == 2)
|
else if (dest_channels == 2)
|
||||||
pcm_convert_channels_24_n_to_2(dest, src_channels, src,
|
pcm_convert_channels_24_n_to_2(dest, src_channels,
|
||||||
src_end);
|
src.begin(), src.end());
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return dest;
|
return { dest, dest_size };
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -199,32 +192,28 @@ pcm_convert_channels_32_n_to_2(int32_t *dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int32_t *
|
ConstBuffer<int32_t>
|
||||||
pcm_convert_channels_32(PcmBuffer &buffer,
|
pcm_convert_channels_32(PcmBuffer &buffer,
|
||||||
unsigned dest_channels,
|
unsigned dest_channels,
|
||||||
unsigned src_channels, const int32_t *src,
|
unsigned src_channels,
|
||||||
size_t src_size, size_t *dest_size_r)
|
ConstBuffer<int32_t> src)
|
||||||
{
|
{
|
||||||
assert(src_size % (sizeof(*src) * src_channels) == 0);
|
assert(src.size % src_channels == 0);
|
||||||
|
|
||||||
size_t dest_size = src_size / src_channels * dest_channels;
|
size_t dest_size = src.size / src_channels * dest_channels;
|
||||||
*dest_size_r = dest_size;
|
int32_t *dest = buffer.GetT<int32_t>(dest_size);
|
||||||
|
|
||||||
int32_t *dest = (int32_t *)buffer.Get(dest_size);
|
|
||||||
const int32_t *src_end = (const int32_t *)
|
|
||||||
pcm_end_pointer(src, src_size);
|
|
||||||
|
|
||||||
if (src_channels == 1 && dest_channels == 2)
|
if (src_channels == 1 && dest_channels == 2)
|
||||||
MonoToStereo(dest, src, src_end);
|
MonoToStereo(dest, src.begin(), src.end());
|
||||||
else if (src_channels == 2 && dest_channels == 1)
|
else if (src_channels == 2 && dest_channels == 1)
|
||||||
pcm_convert_channels_32_2_to_1(dest, src, src_end);
|
pcm_convert_channels_32_2_to_1(dest, src.begin(), src.end());
|
||||||
else if (dest_channels == 2)
|
else if (dest_channels == 2)
|
||||||
pcm_convert_channels_32_n_to_2(dest, src_channels, src,
|
pcm_convert_channels_32_n_to_2(dest, src_channels,
|
||||||
src_end);
|
src.begin(), src.end());
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return dest;
|
return { dest, dest_size };
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -262,29 +251,27 @@ pcm_convert_channels_float_n_to_2(float *dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const float *
|
ConstBuffer<float>
|
||||||
pcm_convert_channels_float(PcmBuffer &buffer,
|
pcm_convert_channels_float(PcmBuffer &buffer,
|
||||||
unsigned dest_channels,
|
unsigned dest_channels,
|
||||||
unsigned src_channels, const float *src,
|
unsigned src_channels,
|
||||||
size_t src_size, size_t *dest_size_r)
|
ConstBuffer<float> src)
|
||||||
{
|
{
|
||||||
assert(src_size % (sizeof(*src) * src_channels) == 0);
|
assert(src.size % src_channels == 0);
|
||||||
|
|
||||||
size_t dest_size = src_size / src_channels * dest_channels;
|
size_t dest_size = src.size / src_channels * dest_channels;
|
||||||
*dest_size_r = dest_size;
|
float *dest = buffer.GetT<float>(dest_size);
|
||||||
|
|
||||||
float *dest = (float *)buffer.Get(dest_size);
|
|
||||||
const float *src_end = (const float *)pcm_end_pointer(src, src_size);
|
|
||||||
|
|
||||||
if (src_channels == 1 && dest_channels == 2)
|
if (src_channels == 1 && dest_channels == 2)
|
||||||
MonoToStereo(dest, src, src_end);
|
MonoToStereo(dest, src.begin(), src.end());
|
||||||
else if (src_channels == 2 && dest_channels == 1)
|
else if (src_channels == 2 && dest_channels == 1)
|
||||||
pcm_convert_channels_float_2_to_1(dest, src, src_end);
|
pcm_convert_channels_float_2_to_1(dest,
|
||||||
|
src.begin(), src.end());
|
||||||
else if (dest_channels == 2)
|
else if (dest_channels == 2)
|
||||||
pcm_convert_channels_float_n_to_2(dest, src_channels, src,
|
pcm_convert_channels_float_n_to_2(dest, src_channels,
|
||||||
src_end);
|
src.begin(), src.end());
|
||||||
else
|
else
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
return dest;
|
return { dest, dest_size };
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
class PcmBuffer;
|
class PcmBuffer;
|
||||||
|
template<typename T> struct ConstBuffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the number of channels in 16 bit PCM data.
|
* Changes the number of channels in 16 bit PCM data.
|
||||||
@ -32,15 +33,13 @@ class PcmBuffer;
|
|||||||
* @param dest_channels the number of channels requested
|
* @param dest_channels the number of channels requested
|
||||||
* @param src_channels the number of channels in the source buffer
|
* @param src_channels the number of channels in the source buffer
|
||||||
* @param src the source PCM buffer
|
* @param src the source PCM buffer
|
||||||
* @param src_size the number of bytes in #src
|
|
||||||
* @param dest_size_r returns the number of bytes of the destination buffer
|
|
||||||
* @return the destination buffer
|
* @return the destination buffer
|
||||||
*/
|
*/
|
||||||
const int16_t *
|
ConstBuffer<int16_t>
|
||||||
pcm_convert_channels_16(PcmBuffer &buffer,
|
pcm_convert_channels_16(PcmBuffer &buffer,
|
||||||
unsigned dest_channels,
|
unsigned dest_channels,
|
||||||
unsigned src_channels, const int16_t *src,
|
unsigned src_channels,
|
||||||
size_t src_size, size_t *dest_size_r);
|
ConstBuffer<int16_t> src);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the number of channels in 24 bit PCM data (aligned at 32
|
* Changes the number of channels in 24 bit PCM data (aligned at 32
|
||||||
@ -50,15 +49,13 @@ pcm_convert_channels_16(PcmBuffer &buffer,
|
|||||||
* @param dest_channels the number of channels requested
|
* @param dest_channels the number of channels requested
|
||||||
* @param src_channels the number of channels in the source buffer
|
* @param src_channels the number of channels in the source buffer
|
||||||
* @param src the source PCM buffer
|
* @param src the source PCM buffer
|
||||||
* @param src_size the number of bytes in #src
|
|
||||||
* @param dest_size_r returns the number of bytes of the destination buffer
|
|
||||||
* @return the destination buffer
|
* @return the destination buffer
|
||||||
*/
|
*/
|
||||||
const int32_t *
|
ConstBuffer<int32_t>
|
||||||
pcm_convert_channels_24(PcmBuffer &buffer,
|
pcm_convert_channels_24(PcmBuffer &buffer,
|
||||||
unsigned dest_channels,
|
unsigned dest_channels,
|
||||||
unsigned src_channels, const int32_t *src,
|
unsigned src_channels,
|
||||||
size_t src_size, size_t *dest_size_r);
|
ConstBuffer<int32_t> src);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the number of channels in 32 bit PCM data.
|
* Changes the number of channels in 32 bit PCM data.
|
||||||
@ -67,15 +64,13 @@ pcm_convert_channels_24(PcmBuffer &buffer,
|
|||||||
* @param dest_channels the number of channels requested
|
* @param dest_channels the number of channels requested
|
||||||
* @param src_channels the number of channels in the source buffer
|
* @param src_channels the number of channels in the source buffer
|
||||||
* @param src the source PCM buffer
|
* @param src the source PCM buffer
|
||||||
* @param src_size the number of bytes in #src
|
|
||||||
* @param dest_size_r returns the number of bytes of the destination buffer
|
|
||||||
* @return the destination buffer
|
* @return the destination buffer
|
||||||
*/
|
*/
|
||||||
const int32_t *
|
ConstBuffer<int32_t>
|
||||||
pcm_convert_channels_32(PcmBuffer &buffer,
|
pcm_convert_channels_32(PcmBuffer &buffer,
|
||||||
unsigned dest_channels,
|
unsigned dest_channels,
|
||||||
unsigned src_channels, const int32_t *src,
|
unsigned src_channels,
|
||||||
size_t src_size, size_t *dest_size_r);
|
ConstBuffer<int32_t> src);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the number of channels in 32 bit float PCM data.
|
* Changes the number of channels in 32 bit float PCM data.
|
||||||
@ -84,14 +79,12 @@ pcm_convert_channels_32(PcmBuffer &buffer,
|
|||||||
* @param dest_channels the number of channels requested
|
* @param dest_channels the number of channels requested
|
||||||
* @param src_channels the number of channels in the source buffer
|
* @param src_channels the number of channels in the source buffer
|
||||||
* @param src the source PCM buffer
|
* @param src the source PCM buffer
|
||||||
* @param src_size the number of bytes in #src
|
|
||||||
* @param dest_size_r returns the number of bytes of the destination buffer
|
|
||||||
* @return the destination buffer
|
* @return the destination buffer
|
||||||
*/
|
*/
|
||||||
const float *
|
ConstBuffer<float>
|
||||||
pcm_convert_channels_float(PcmBuffer &buffer,
|
pcm_convert_channels_float(PcmBuffer &buffer,
|
||||||
unsigned dest_channels,
|
unsigned dest_channels,
|
||||||
unsigned src_channels, const float *src,
|
unsigned src_channels,
|
||||||
size_t src_size, size_t *dest_size_r);
|
ConstBuffer<float> src);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -22,67 +22,60 @@
|
|||||||
#include "test_pcm_util.hxx"
|
#include "test_pcm_util.hxx"
|
||||||
#include "pcm/PcmChannels.hxx"
|
#include "pcm/PcmChannels.hxx"
|
||||||
#include "pcm/PcmBuffer.hxx"
|
#include "pcm/PcmBuffer.hxx"
|
||||||
|
#include "util/ConstBuffer.hxx"
|
||||||
|
|
||||||
void
|
void
|
||||||
PcmChannelsTest::TestChannels16()
|
PcmChannelsTest::TestChannels16()
|
||||||
{
|
{
|
||||||
constexpr unsigned N = 256;
|
constexpr size_t N = 256;
|
||||||
const auto src = TestDataBuffer<int16_t, N * 2>();
|
const auto src = TestDataBuffer<int16_t, N * 2>();
|
||||||
|
|
||||||
PcmBuffer buffer;
|
PcmBuffer buffer;
|
||||||
|
|
||||||
/* stereo to mono */
|
/* stereo to mono */
|
||||||
|
|
||||||
size_t dest_size;
|
auto dest = pcm_convert_channels_16(buffer, 1, 2, { src, N * 2 });
|
||||||
const int16_t *dest =
|
CPPUNIT_ASSERT(!dest.IsNull());
|
||||||
pcm_convert_channels_16(buffer, 1, 2, src, sizeof(src),
|
CPPUNIT_ASSERT_EQUAL(N, dest.size);
|
||||||
&dest_size);
|
|
||||||
CPPUNIT_ASSERT(dest != NULL);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(sizeof(src) / 2, dest_size);
|
|
||||||
for (unsigned i = 0; i < N; ++i)
|
for (unsigned i = 0; i < N; ++i)
|
||||||
CPPUNIT_ASSERT_EQUAL(int16_t((src[i * 2] + src[i * 2 + 1]) / 2),
|
CPPUNIT_ASSERT_EQUAL(int16_t((src[i * 2] + src[i * 2 + 1]) / 2),
|
||||||
dest[i]);
|
dest.data[i]);
|
||||||
|
|
||||||
/* mono to stereo */
|
/* mono to stereo */
|
||||||
|
|
||||||
dest = pcm_convert_channels_16(buffer, 2, 1, src, sizeof(src),
|
dest = pcm_convert_channels_16(buffer, 2, 1, { src, N * 2 });
|
||||||
&dest_size);
|
CPPUNIT_ASSERT(!dest.IsNull());
|
||||||
CPPUNIT_ASSERT(dest != NULL);
|
CPPUNIT_ASSERT_EQUAL(N * 4, dest.size);
|
||||||
CPPUNIT_ASSERT_EQUAL(sizeof(src) * 2, dest_size);
|
|
||||||
for (unsigned i = 0; i < N; ++i) {
|
for (unsigned i = 0; i < N; ++i) {
|
||||||
CPPUNIT_ASSERT_EQUAL(src[i], dest[i * 2]);
|
CPPUNIT_ASSERT_EQUAL(src[i], dest.data[i * 2]);
|
||||||
CPPUNIT_ASSERT_EQUAL(src[i], dest[i * 2 + 1]);
|
CPPUNIT_ASSERT_EQUAL(src[i], dest.data[i * 2 + 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
PcmChannelsTest::TestChannels32()
|
PcmChannelsTest::TestChannels32()
|
||||||
{
|
{
|
||||||
constexpr unsigned N = 256;
|
constexpr size_t N = 256;
|
||||||
const auto src = TestDataBuffer<int32_t, N * 2>();
|
const auto src = TestDataBuffer<int32_t, N * 2>();
|
||||||
|
|
||||||
PcmBuffer buffer;
|
PcmBuffer buffer;
|
||||||
|
|
||||||
/* stereo to mono */
|
/* stereo to mono */
|
||||||
|
|
||||||
size_t dest_size;
|
auto dest = pcm_convert_channels_32(buffer, 1, 2, { src, N * 2 });
|
||||||
const int32_t *dest =
|
CPPUNIT_ASSERT(!dest.IsNull());
|
||||||
pcm_convert_channels_32(buffer, 1, 2, src, sizeof(src),
|
CPPUNIT_ASSERT_EQUAL(N, dest.size);
|
||||||
&dest_size);
|
|
||||||
CPPUNIT_ASSERT(dest != NULL);
|
|
||||||
CPPUNIT_ASSERT_EQUAL(sizeof(src) / 2, dest_size);
|
|
||||||
for (unsigned i = 0; i < N; ++i)
|
for (unsigned i = 0; i < N; ++i)
|
||||||
CPPUNIT_ASSERT_EQUAL(int32_t(((int64_t)src[i * 2] + (int64_t)src[i * 2 + 1]) / 2),
|
CPPUNIT_ASSERT_EQUAL(int32_t(((int64_t)src[i * 2] + (int64_t)src[i * 2 + 1]) / 2),
|
||||||
dest[i]);
|
dest.data[i]);
|
||||||
|
|
||||||
/* mono to stereo */
|
/* mono to stereo */
|
||||||
|
|
||||||
dest = pcm_convert_channels_32(buffer, 2, 1, src, sizeof(src),
|
dest = pcm_convert_channels_32(buffer, 2, 1, { src, N * 2 });
|
||||||
&dest_size);
|
CPPUNIT_ASSERT(!dest.IsNull());
|
||||||
CPPUNIT_ASSERT(dest != NULL);
|
CPPUNIT_ASSERT_EQUAL(N * 4, dest.size);
|
||||||
CPPUNIT_ASSERT_EQUAL(sizeof(src) * 2, dest_size);
|
|
||||||
for (unsigned i = 0; i < N; ++i) {
|
for (unsigned i = 0; i < N; ++i) {
|
||||||
CPPUNIT_ASSERT_EQUAL(src[i], dest[i * 2]);
|
CPPUNIT_ASSERT_EQUAL(src[i], dest.data[i * 2]);
|
||||||
CPPUNIT_ASSERT_EQUAL(src[i], dest[i * 2 + 1]);
|
CPPUNIT_ASSERT_EQUAL(src[i], dest.data[i * 2 + 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user