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 {
return os << color.toString();
inline std::ostream& operator<<(std::ostream& os, const Color& color) {
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 {
{
return os << convert_to<std::string>(ver); std::ostream& operator<<(std::ostream& os, const Version& ver) {
return os << convert_to<std::string>(ver);
}
} }
TEST(Version, Ctor) TEST(Version, Ctor)

View File

@ -9,20 +9,23 @@
#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 {
{
os << "(" << value.type();
if (value.type() == Value::Number) std::ostream& operator<<(std::ostream& os, const Value& value)
os << ", " << value.number() << " [" << value.unit() << "]"; {
else if (value.type() == Value::String) os << "(" << value.type();
os << ", " << value.string();
os << ")"; if (value.type() == Value::Number)
return os; os << ", " << value.number() << " [" << value.unit() << "]";
} else if (value.type() == Value::String)
os << ", " << value.string();
os << ")";
return os;
}
} // namespace css
TEST(Css, Style) TEST(Css, Style)
{ {

View File

@ -12,15 +12,19 @@
using namespace gfx; using namespace gfx;
using namespace std; using namespace std;
ostream& operator<<(ostream& os, const Hsv& hsv) namespace gfx {
{
return os << "(" ostream& operator<<(ostream& os, const Hsv& hsv)
<< hsv.hueInt() << ", " {
<< hsv.saturationInt() << ", " return os << "("
<< hsv.valueInt() << "); real: (" << hsv.hueInt() << ", "
<< hsv.hue() << ", " << hsv.saturationInt() << ", "
<< hsv.saturation() << ", " << hsv.valueInt() << "); real: ("
<< hsv.value() << ")"; << hsv.hue() << ", "
<< hsv.saturation() << ", "
<< 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 {
{
return os << "(" ostream& operator<<(ostream& os, const Rect& rect)
<< rect.x << ", " {
<< rect.y << ", " return os << "("
<< rect.w << ", " << rect.x << ", "
<< rect.h << ")"; << rect.y << ", "
<< rect.w << ", "
<< 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 {
{
return os << "(" ostream& operator<<(ostream& os, const Rect& rect) {
<< rect.x << ", " return os << "("
<< rect.y << ", " << rect.x << ", "
<< rect.w << ", " << rect.y << ", "
<< rect.h << ")"; << rect.w << ", "
<< 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 {
{
return os << "(" ostream& operator<<(ostream& os, const Rgb& rgb) {
<< rgb.red() << ", " return os << "("
<< rgb.green() << ", " << rgb.red() << ", "
<< rgb.blue() << ")"; << rgb.green() << ", "
<< rgb.blue() << ")";
}
} }
TEST(Rgb, Ctor) TEST(Rgb, Ctor)