}
}
return result;
+}
+
+TEST(MacroTest, "Common/Sanity")
+{
+ FAIL_UNLESS(1);
+ FAIL_UNLESS(1 == 1);
+ FAIL_UNLESS_EQUAL(0, 0);
+ FAIL_IF(0);
+ FAIL_IF(0 == 1);
+ FAIL_IF_EQUAL(0, 1);
+ FAIL_UNLESS_GE(1, 1);
+ FAIL_UNLESS_GE(1, 0);
+ ASSERT(1);
+ ASSERT_MSG(1, "sanity failed");
}
\ No newline at end of file
#include <iostream>
#include <boost/foreach.hpp>
+#include <boost/test/utils/wrap_stringstream.hpp>
#include <map>
#include <vector>
#include <check.h> // Check unit testing framework... see http://check.sourceforge.net
#define ASSERT(expr) fail_unless(expr)
#endif
+#define ASSERT_MSG(expr, msg) \
+{ \
+ boost::wrap_stringstream s; \
+ s.ref() << msg; \
+ ck_assert_msg(expr, s.str().c_str()); \
+}
+
#define TEST(name, suite) \
class class_ ## name { \
public: \
void checkResize(int w, int h, unsigned tries)
{
if (not resizeDone_) {
- ASSERT(tries != 0);
+ ASSERT_MSG(tries != 0,
+ "failed to get EVAS_CALLBACK_RESIZE event ("
+ << w << ","
+ << h << ")"
+ );
queueStep(boost::bind(&WindowResizeTest::checkResize, boost::ref(*this), w, h, --tries));
} else {
window_.checkSize(std::max(1, w), std::max(1, h));
- checkServerSize(Geometry(), 20);
+ checkServerSize(Geometry(), 100);
}
}
and window_.getHeight() == geometry.height);
if (not sizeMatch) {
- ASSERT(tries != 0);
+ ASSERT_MSG(tries != 0, ""
+ << "client size ("
+ << window_.getWidth() << ","
+ << window_.getHeight() << ") != "
+ << "server size ("
+ << geometry.width << ","
+ << geometry.height << ")"
+ );
GeometryCallback cb = boost::bind(&WindowResizeTest::checkServerSize, boost::ref(*this), _1, --tries);
getSurfaceGeometry(elm_win_wl_window_get(window_)->surface, cb);
} else {
WaylandFits::QueryRequest* WaylandFits::makeGeometryRequest(wl_surface* surface) const
{
- QueryRequest* request(new QueryRequest);
- request->data = new Geometry;
+ QueryRequest* request(new QueryRequest); // caller responsible for deleting
+ request->data = new Geometry; // caller responsible for deleting
static const wfits_query_result_listener listener = {
query_result_surface_geometry,