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;
inline std::ostream& operator<<(std::ostream& os, const Color& color) {
return os << color.toString();
namespace app {
inline std::ostream& operator<<(std::ostream& os, const Color& color) {
return os << color.toString();
}
}
TEST(Color, fromRgb)

View File

@ -31,6 +31,15 @@
using namespace app;
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;
#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);
}
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) {
// Move one layer to the same place

View File

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

View File

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

View File

@ -12,15 +12,19 @@
using namespace gfx;
using namespace std;
ostream& operator<<(ostream& os, const Hsv& hsv)
{
return os << "("
<< hsv.hueInt() << ", "
<< hsv.saturationInt() << ", "
<< hsv.valueInt() << "); real: ("
<< hsv.hue() << ", "
<< hsv.saturation() << ", "
<< hsv.value() << ")";
namespace gfx {
ostream& operator<<(ostream& os, const Hsv& hsv)
{
return os << "("
<< hsv.hueInt() << ", "
<< hsv.saturationInt() << ", "
<< hsv.valueInt() << "); real: ("
<< hsv.hue() << ", "
<< hsv.saturation() << ", "
<< hsv.value() << ")";
}
}
TEST(Hsv, Ctor)

View File

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

View File

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

View File

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