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,10 +22,14 @@
using namespace app;
namespace app {
inline std::ostream& operator<<(std::ostream& os, const Color& color) {
return os << color.toString();
}
}
TEST(Color, fromRgb)
{
EXPECT_EQ(32, Color::fromRgb(32, 16, 255).getRed());

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,11 +11,14 @@
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);
}
}
TEST(Version, Ctor)
{
Version v0;

View File

@ -9,9 +9,10 @@
#include "css/css.h"
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();
@ -24,6 +25,8 @@ ostream& operator<<(ostream& os, const Value& value)
return os;
}
} // namespace css
TEST(Css, Style)
{
Rule background("background");

View File

@ -12,6 +12,8 @@
using namespace gfx;
using namespace std;
namespace gfx {
ostream& operator<<(ostream& os, const Hsv& hsv)
{
return os << "("
@ -23,6 +25,8 @@ ostream& operator<<(ostream& os, const Hsv& hsv)
<< hsv.value() << ")";
}
}
TEST(Hsv, Ctor)
{
EXPECT_EQ(35.0, Hsv(35.0, 0.50, 0.75).hue());

View File

@ -13,6 +13,8 @@
using namespace std;
using namespace gfx;
namespace gfx {
ostream& operator<<(ostream& os, const Rect& rect)
{
return os << "("
@ -22,6 +24,8 @@ ostream& operator<<(ostream& os, const Rect& rect)
<< rect.h << ")";
}
}
TEST(Rect, Ctor)
{
EXPECT_EQ(Rect(0, 0, 0, 0), Rect());

View File

@ -12,8 +12,9 @@
using namespace std;
using namespace gfx;
ostream& operator<<(ostream& os, const Rect& rect)
{
namespace gfx {
ostream& operator<<(ostream& os, const Rect& rect) {
return os << "("
<< rect.x << ", "
<< rect.y << ", "
@ -21,6 +22,8 @@ ostream& operator<<(ostream& os, const Rect& rect)
<< rect.h << ")";
}
}
ostream& operator<<(ostream& os, const Region& rgn)
{
os << "{";

View File

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