projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tests: Add tests for Segment class
[pulseview.git]
/
test
/
data
/
analogsegment.cpp
diff --git
a/test/data/analogsegment.cpp
b/test/data/analogsegment.cpp
index fd7b887085acdf5acb8f8de7dd71db08be7137cb..5ecfe8a2977130b6ccaa0562febbda70d66387f8 100644
(file)
--- a/
test/data/analogsegment.cpp
+++ b/
test/data/analogsegment.cpp
@@
-14,8
+14,7
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <extdef.h>
*/
#include <extdef.h>
@@
-55,7
+54,7
@@
BOOST_AUTO_TEST_CASE(Basic)
const AnalogSegment::Envelope &m = s.envelope_levels_[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(m.data_length, 0);
const AnalogSegment::Envelope &m = s.envelope_levels_[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(m.data_length, 0);
- BOOST_CHECK(m.samples ==
NULL
);
+ BOOST_CHECK(m.samples ==
nullptr
);
}
// Push 8 samples of all zeros
}
// Push 8 samples of all zeros
@@
-69,7
+68,7
@@
BOOST_AUTO_TEST_CASE(Basic)
const AnalogSegment::Envelope &m = s.envelope_levels_[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(m.data_length, 0);
const AnalogSegment::Envelope &m = s.envelope_levels_[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(m.data_length, 0);
- BOOST_CHECK(m.samples ==
NULL
);
+ BOOST_CHECK(m.samples ==
nullptr
);
}
// Push 8 samples of 1.0s to bring the total up to 16
}
// Push 8 samples of 1.0s to bring the total up to 16
@@
-80,7
+79,7
@@
BOOST_AUTO_TEST_CASE(Basic)
const AnalogSegment::Envelope &e0 = s.envelope_levels_[0];
BOOST_CHECK_EQUAL(e0.length, 1);
BOOST_CHECK_EQUAL(e0.data_length, AnalogSegment::EnvelopeDataUnit);
const AnalogSegment::Envelope &e0 = s.envelope_levels_[0];
BOOST_CHECK_EQUAL(e0.length, 1);
BOOST_CHECK_EQUAL(e0.data_length, AnalogSegment::EnvelopeDataUnit);
- BOOST_REQUIRE(e0.samples !=
NULL
);
+ BOOST_REQUIRE(e0.samples !=
nullptr
);
BOOST_CHECK_EQUAL(e0.samples[0].min, 0.0f);
BOOST_CHECK_EQUAL(e0.samples[0].max, 1.0f);
BOOST_CHECK_EQUAL(e0.samples[0].min, 0.0f);
BOOST_CHECK_EQUAL(e0.samples[0].max, 1.0f);
@@
-90,7
+89,7
@@
BOOST_AUTO_TEST_CASE(Basic)
const AnalogSegment::Envelope &m = s.envelope_levels_[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(m.data_length, 0);
const AnalogSegment::Envelope &m = s.envelope_levels_[i];
BOOST_CHECK_EQUAL(m.length, 0);
BOOST_CHECK_EQUAL(m.data_length, 0);
- BOOST_CHECK(m.samples ==
NULL
);
+ BOOST_CHECK(m.samples ==
nullptr
);
}
// Push 240 samples of all zeros to bring the total up to 256
}
// Push 240 samples of all zeros to bring the total up to 256
@@
-107,7
+106,7
@@
BOOST_AUTO_TEST_CASE(Basic)
const AnalogSegment::Envelope &e1 = s.envelope_levels_[1];
BOOST_CHECK_EQUAL(e1.length, 1);
BOOST_CHECK_EQUAL(e1.data_length, AnalogSegment::EnvelopeDataUnit);
const AnalogSegment::Envelope &e1 = s.envelope_levels_[1];
BOOST_CHECK_EQUAL(e1.length, 1);
BOOST_CHECK_EQUAL(e1.data_length, AnalogSegment::EnvelopeDataUnit);
- BOOST_REQUIRE(e1.samples !=
NULL
);
+ BOOST_REQUIRE(e1.samples !=
nullptr
);
BOOST_CHECK_EQUAL(e1.samples[0].min, -1.0f);
BOOST_CHECK_EQUAL(e1.samples[0].max, 1.0f);
}
BOOST_CHECK_EQUAL(e1.samples[0].min, -1.0f);
BOOST_CHECK_EQUAL(e1.samples[0].max, 1.0f);
}