Fix tests compilation in clang

This commit is contained in:
David Capello 2014-08-17 20:40:10 -03:00
parent 51ab478f49
commit 76a26802e0
8 changed files with 78 additions and 50 deletions

View File

@ -22,8 +22,12 @@
using namespace app; using namespace app;
inline std::ostream& operator<<(std::ostream& os, const Color& color) { namespace app {
inline std::ostream& operator<<(std::ostream& os, const Color& color) {
return os << color.toString(); return os << color.toString();
}
} }
TEST(Color, fromRgb) TEST(Color, fromRgb)

View File

@ -31,6 +31,15 @@
using namespace app; using namespace app;
using namespace raster; using namespace raster;
namespace app {
std::ostream& operator<<(std::ostream& os, const DocumentRange& range) {
return os << "{ layers: [" << range.layerBegin() << ", " << range.layerEnd() << "]"
<< ", frames: [" << range.frameBegin() << ", " << range.frameEnd() << "] }";
}
}
typedef base::UniquePtr<Document> DocumentPtr; typedef base::UniquePtr<Document> DocumentPtr;
#define EXPECT_LAYER_ORDER(a, b, c, d) \ #define EXPECT_LAYER_ORDER(a, b, c, d) \
@ -123,11 +132,6 @@ inline DocumentRange frames_range(int frame) {
return range(0, frame, 0, frame, DocumentRange::kFrames); return range(0, frame, 0, frame, DocumentRange::kFrames);
} }
std::ostream& operator<<(std::ostream& os, const DocumentRange& range) {
return os << "{ layers: [" << range.layerBegin() << ", " << range.layerEnd() << "]"
<< ", frames: [" << range.frameBegin() << ", " << range.frameEnd() << "] }";
}
TEST_F(DocRangeOps, MoveLayersNoOp) { TEST_F(DocRangeOps, MoveLayersNoOp) {
// Move one layer to the same place // Move one layer to the same place

View File

@ -11,9 +11,12 @@
using namespace base; using namespace base;
std::ostream& operator<<(std::ostream& os, const Version& ver) namespace base {
{
std::ostream& operator<<(std::ostream& os, const Version& ver) {
return os << convert_to<std::string>(ver); return os << convert_to<std::string>(ver);
}
} }
TEST(Version, Ctor) TEST(Version, Ctor)

View File

@ -9,10 +9,11 @@
#include "css/css.h" #include "css/css.h"
using namespace css; using namespace css;
using namespace std;
ostream& operator<<(ostream& os, const Value& value) namespace css {
{
std::ostream& operator<<(std::ostream& os, const Value& value)
{
os << "(" << value.type(); os << "(" << value.type();
if (value.type() == Value::Number) if (value.type() == Value::Number)
@ -22,7 +23,9 @@ ostream& operator<<(ostream& os, const Value& value)
os << ")"; os << ")";
return os; return os;
} }
} // namespace css
TEST(Css, Style) TEST(Css, Style)
{ {

View File

@ -12,8 +12,10 @@
using namespace gfx; using namespace gfx;
using namespace std; using namespace std;
ostream& operator<<(ostream& os, const Hsv& hsv) namespace gfx {
{
ostream& operator<<(ostream& os, const Hsv& hsv)
{
return os << "(" return os << "("
<< hsv.hueInt() << ", " << hsv.hueInt() << ", "
<< hsv.saturationInt() << ", " << hsv.saturationInt() << ", "
@ -21,6 +23,8 @@ ostream& operator<<(ostream& os, const Hsv& hsv)
<< hsv.hue() << ", " << hsv.hue() << ", "
<< hsv.saturation() << ", " << hsv.saturation() << ", "
<< hsv.value() << ")"; << hsv.value() << ")";
}
} }
TEST(Hsv, Ctor) TEST(Hsv, Ctor)

View File

@ -13,13 +13,17 @@
using namespace std; using namespace std;
using namespace gfx; using namespace gfx;
ostream& operator<<(ostream& os, const Rect& rect) namespace gfx {
{
ostream& operator<<(ostream& os, const Rect& rect)
{
return os << "(" return os << "("
<< rect.x << ", " << rect.x << ", "
<< rect.y << ", " << rect.y << ", "
<< rect.w << ", " << rect.w << ", "
<< rect.h << ")"; << rect.h << ")";
}
} }
TEST(Rect, Ctor) TEST(Rect, Ctor)

View File

@ -12,13 +12,16 @@
using namespace std; using namespace std;
using namespace gfx; using namespace gfx;
ostream& operator<<(ostream& os, const Rect& rect) namespace gfx {
{
ostream& operator<<(ostream& os, const Rect& rect) {
return os << "(" return os << "("
<< rect.x << ", " << rect.x << ", "
<< rect.y << ", " << rect.y << ", "
<< rect.w << ", " << rect.w << ", "
<< rect.h << ")"; << rect.h << ")";
}
} }
ostream& operator<<(ostream& os, const Region& rgn) ostream& operator<<(ostream& os, const Region& rgn)

View File

@ -12,12 +12,15 @@
using namespace gfx; using namespace gfx;
using namespace std; using namespace std;
ostream& operator<<(ostream& os, const Rgb& rgb) namespace gfx {
{
ostream& operator<<(ostream& os, const Rgb& rgb) {
return os << "(" return os << "("
<< rgb.red() << ", " << rgb.red() << ", "
<< rgb.green() << ", " << rgb.green() << ", "
<< rgb.blue() << ")"; << rgb.blue() << ")";
}
} }
TEST(Rgb, Ctor) TEST(Rgb, Ctor)