projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added config.h to .gitignore
[pulseview.git]
/
test
/
logicdatasnapshot.cpp
diff --git
a/test/logicdatasnapshot.cpp
b/test/logicdatasnapshot.cpp
index 32bbe81aefbee117cfcfd0fc89d12d595aa05aad..02d719566e34a54295f3c34aeb1868204e055c33 100644
(file)
--- a/
test/logicdatasnapshot.cpp
+++ b/
test/logicdatasnapshot.cpp
@@
-1,5
+1,5
@@
/*
/*
- * This file is part of the
sigrok
project.
+ * This file is part of the
PulseView
project.
*
* Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
*
*
* Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
*
@@
-18,16
+18,19
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <extdef.h>
+
#define __STDC_LIMIT_MACROS
#include <stdint.h>
#include <boost/test/unit_test.hpp>
#define __STDC_LIMIT_MACROS
#include <stdint.h>
#include <boost/test/unit_test.hpp>
-#include "../extdef.h"
-#include "../logicdatasnapshot.h"
+#include "../pv/logicdatasnapshot.h"
using namespace std;
using namespace std;
+using pv::LogicDataSnapshot;
+
BOOST_AUTO_TEST_SUITE(LogicDataSnapshotTest)
void push_logic(LogicDataSnapshot &s, unsigned int length, uint8_t value)
BOOST_AUTO_TEST_SUITE(LogicDataSnapshotTest)
void push_logic(LogicDataSnapshot &s, unsigned int length, uint8_t value)
@@
-255,8
+258,8
@@
BOOST_AUTO_TEST_CASE(LargeData)
}
//----- Test LogicDataSnapshot::get_subsampled_edges -----//
}
//----- Test LogicDataSnapshot::get_subsampled_edges -----//
+ // Check in normal case
vector<LogicDataSnapshot::EdgePair> edges;
vector<LogicDataSnapshot::EdgePair> edges;
-
s.get_subsampled_edges(edges, 0, Length-1, 1, 7);
BOOST_CHECK_EQUAL(edges.size(), 32);
s.get_subsampled_edges(edges, 0, Length-1, 1, 7);
BOOST_CHECK_EQUAL(edges.size(), 32);
@@
-268,6
+271,12
@@
BOOST_AUTO_TEST_CASE(LargeData)
}
BOOST_CHECK_EQUAL(edges[31].first, 999999);
}
BOOST_CHECK_EQUAL(edges[31].first, 999999);
+
+ // Check in very low zoom case
+ edges.clear();
+ s.get_subsampled_edges(edges, 0, Length-1, 50e6f, 7);
+
+ BOOST_CHECK_EQUAL(edges.size(), 2);
}
BOOST_AUTO_TEST_CASE(Pulses)
}
BOOST_AUTO_TEST_CASE(Pulses)