9#include <ecl/dataobjects/ECLWaveforms.h>
10#include <ecl/digitization/BitStream.h>
11#include <ecl/digitization/ECLCompress.h>
12#include <gtest/gtest.h>
30 EXPECT_EQ(q.getStore().size(), 0);
37 vector<unsigned int> t(N);
40 EXPECT_EQ(q.getStore().size(), N);
50 EXPECT_EQ(q.getPos(), 0);
51 EXPECT_EQ(q.getStore().size(), 1);
55 EXPECT_EQ(q2.getPos(), 0);
56 EXPECT_EQ(q2.getStore().size(), N);
65 for (
unsigned int i = 0; i < 32; i++) {
66 unsigned int k = 1u << i;
69 EXPECT_EQ(q.getPos(), 528);
71 for (
unsigned int i = 0; i < 32; i++) {
72 unsigned int k0 = 1u << i, k = q.getNBits(i + 1);
75 EXPECT_EQ(q.getPos(), 528);
79 for (
unsigned int i = 0; i < 32; i++) {
80 unsigned int k0 = 1u << i, k = q.getNBits(i + 1);
83 EXPECT_EQ(q.getPos(), 528);
95 for (
int off = 0; off < 32; ++off) {
100 for (
int i = 0; i < 31; i++) A[i] = 4000 + ((i % 2) * 1000 - 500);
106 for (
int i = 0; i < 31; i++) EXPECT_EQ(A[i], B[i]);
119 for (
int off = 0; off < 32; ++off) {
124 for (
int i = 0; i < 31; i++) A[i] = 4000 + ((i % 2) * 1000 - 500);
130 for (
int i = 0; i < 31; i++) EXPECT_EQ(A[i], B[i]);
140 width_t widths_phs2_scale10[] = {
174 ECLDCTCompress q(1, 3500, widths_phs2_scale10);
177 for (
int off = 0; off < 1; ++off) {
182 for (
int i = 0; i < 31; i++) A[i] = 4000 + ((i % 2) * 1000 - 500);
188 for (
int i = 0; i < 31; i++) EXPECT_NEAR(A[i], B[i], 10);
Declare ECLBaseCompress test.
ECL waveform compression/decompression to/from the BitStream storage with the BASE algorithm.
Declare ECLDCTCompress test.
Declare ECLDeltaCompress test.
ECL waveform compression/decompression to/from the BitStream storage with the DELTA algorithm.
Abstract base class for different kinds of events.
Bit widths for the prefix coding to encode integers which are mainly concentrated around zero and pro...