mirror of https://github.com/vitalif/grive2
Move old tests to fix build errors, fixes #14
parent
70ec926e2a
commit
5da32905ea
|
@ -117,6 +117,7 @@ IF ( CPPUNIT_FOUND )
|
||||||
|
|
||||||
# list of test source files here
|
# list of test source files here
|
||||||
file(GLOB TEST_SRC
|
file(GLOB TEST_SRC
|
||||||
|
test/base/*.cc
|
||||||
test/drive/*.cc
|
test/drive/*.cc
|
||||||
test/util/*.cc
|
test/util/*.cc
|
||||||
test/xml/*.cc
|
test/xml/*.cc
|
||||||
|
|
|
@ -22,9 +22,9 @@
|
||||||
#include "util/log/DefaultLog.hh"
|
#include "util/log/DefaultLog.hh"
|
||||||
|
|
||||||
#include "drive/EntryTest.hh"
|
#include "drive/EntryTest.hh"
|
||||||
#include "drive/ResourceTest.hh"
|
#include "base/ResourceTest.hh"
|
||||||
#include "drive/ResourceTreeTest.hh"
|
#include "base/ResourceTreeTest.hh"
|
||||||
#include "drive/StateTest.hh"
|
#include "base/StateTest.hh"
|
||||||
#include "util/DateTimeTest.hh"
|
#include "util/DateTimeTest.hh"
|
||||||
#include "util/FunctionTest.hh"
|
#include "util/FunctionTest.hh"
|
||||||
#include "util/ConfigTest.hh"
|
#include "util/ConfigTest.hh"
|
||||||
|
@ -38,7 +38,7 @@ int main( int argc, char **argv )
|
||||||
gr::LogBase::Inst( std::auto_ptr<gr::LogBase>(new gr::log::DefaultLog) ) ;
|
gr::LogBase::Inst( std::auto_ptr<gr::LogBase>(new gr::log::DefaultLog) ) ;
|
||||||
|
|
||||||
CppUnit::TextUi::TestRunner runner;
|
CppUnit::TextUi::TestRunner runner;
|
||||||
runner.addTest( EntryTest::suite( ) ) ;
|
runner.addTest( Entry1Test::suite( ) ) ;
|
||||||
runner.addTest( StateTest::suite( ) ) ;
|
runner.addTest( StateTest::suite( ) ) ;
|
||||||
runner.addTest( ResourceTest::suite( ) ) ;
|
runner.addTest( ResourceTest::suite( ) ) ;
|
||||||
runner.addTest( ResourceTreeTest::suite( ) ) ;
|
runner.addTest( ResourceTreeTest::suite( ) ) ;
|
||||||
|
|
|
@ -21,9 +21,9 @@
|
||||||
|
|
||||||
#include "Assert.hh"
|
#include "Assert.hh"
|
||||||
|
|
||||||
#include "drive/Resource.hh"
|
#include "base/Resource.hh"
|
||||||
|
|
||||||
#include "drive/Entry.hh"
|
#include "drive/Entry1.hh"
|
||||||
#include "xml/Node.hh"
|
#include "xml/Node.hh"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -60,7 +60,7 @@ void ResourceTest::TestNormal( )
|
||||||
xml::Node entry = xml::Node::Element( "entry" ) ;
|
xml::Node entry = xml::Node::Element( "entry" ) ;
|
||||||
entry.AddElement( "updated" ).AddText( "2012-05-09T16:13:22.401Z" ) ;
|
entry.AddElement( "updated" ).AddText( "2012-05-09T16:13:22.401Z" ) ;
|
||||||
|
|
||||||
Entry remote( entry ) ;
|
Entry1 remote( entry ) ;
|
||||||
subject.FromRemote( remote, DateTime() ) ;
|
subject.FromRemote( remote, DateTime() ) ;
|
||||||
GRUT_ASSERT_EQUAL( "local_changed", subject.StateStr() ) ;
|
GRUT_ASSERT_EQUAL( "local_changed", subject.StateStr() ) ;
|
||||||
}
|
}
|
|
@ -21,15 +21,14 @@
|
||||||
|
|
||||||
#include "Assert.hh"
|
#include "Assert.hh"
|
||||||
|
|
||||||
#include "drive/ResourceTree.hh"
|
#include "base/ResourceTree.hh"
|
||||||
#include "drive/Resource.hh"
|
#include "base/Resource.hh"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
namespace grut {
|
namespace grut {
|
||||||
|
|
||||||
using namespace gr ;
|
using namespace gr ;
|
||||||
using namespace gr::v1 ;
|
|
||||||
|
|
||||||
ResourceTreeTest::ResourceTreeTest( )
|
ResourceTreeTest::ResourceTreeTest( )
|
||||||
{
|
{
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "Assert.hh"
|
#include "Assert.hh"
|
||||||
|
|
||||||
#include "drive/State.hh"
|
#include "base/State.hh"
|
||||||
#include "json/Val.hh"
|
#include "json/Val.hh"
|
||||||
#include "util/log/Log.hh"
|
#include "util/log/Log.hh"
|
||||||
|
|
||||||
|
@ -30,7 +30,6 @@
|
||||||
namespace grut {
|
namespace grut {
|
||||||
|
|
||||||
using namespace gr ;
|
using namespace gr ;
|
||||||
using namespace gr::v1 ;
|
|
||||||
|
|
||||||
StateTest::StateTest( )
|
StateTest::StateTest( )
|
||||||
{
|
{
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include "Assert.hh"
|
#include "Assert.hh"
|
||||||
|
|
||||||
#include "drive/Entry.hh"
|
#include "drive/Entry1.hh"
|
||||||
#include "xml/Node.hh"
|
#include "xml/Node.hh"
|
||||||
#include "xml/NodeSet.hh"
|
#include "xml/NodeSet.hh"
|
||||||
#include "xml/TreeBuilder.hh"
|
#include "xml/TreeBuilder.hh"
|
||||||
|
@ -33,17 +33,17 @@ namespace grut {
|
||||||
using namespace gr ;
|
using namespace gr ;
|
||||||
using namespace gr::v1 ;
|
using namespace gr::v1 ;
|
||||||
|
|
||||||
EntryTest::EntryTest( )
|
Entry1Test::Entry1Test( )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntryTest::TestXml( )
|
void Entry1Test::TestXml( )
|
||||||
{
|
{
|
||||||
xml::Node root = xml::TreeBuilder::ParseFile( TEST_DATA "entry.xml" ) ;
|
xml::Node root = xml::TreeBuilder::ParseFile( TEST_DATA "entry.xml" ) ;
|
||||||
|
|
||||||
CPPUNIT_ASSERT( !root["entry"].empty() ) ;
|
CPPUNIT_ASSERT( !root["entry"].empty() ) ;
|
||||||
|
|
||||||
Entry subject( root["entry"].front() ) ;
|
Entry1 subject( root["entry"].front() ) ;
|
||||||
GRUT_ASSERT_EQUAL( "snes", subject.Title() ) ;
|
GRUT_ASSERT_EQUAL( "snes", subject.Title() ) ;
|
||||||
GRUT_ASSERT_EQUAL( "\"WxYPGE8CDyt7ImBk\"", subject.ETag() ) ;
|
GRUT_ASSERT_EQUAL( "\"WxYPGE8CDyt7ImBk\"", subject.ETag() ) ;
|
||||||
GRUT_ASSERT_EQUAL( "https://docs.google.com/feeds/default/private/full/folder%3A0B5KhdsbryVeGMl83OEV1ZVc3cUE",
|
GRUT_ASSERT_EQUAL( "https://docs.google.com/feeds/default/private/full/folder%3A0B5KhdsbryVeGMl83OEV1ZVc3cUE",
|
||||||
|
@ -53,7 +53,7 @@ void EntryTest::TestXml( )
|
||||||
GRUT_ASSERT_EQUAL( "https://docs.google.com/feeds/default/private/full/folder%3A0B5KhdsbryVeGNEZjdUxzZHl3Sjg",
|
GRUT_ASSERT_EQUAL( "https://docs.google.com/feeds/default/private/full/folder%3A0B5KhdsbryVeGNEZjdUxzZHl3Sjg",
|
||||||
subject.ParentHrefs().front() ) ;
|
subject.ParentHrefs().front() ) ;
|
||||||
|
|
||||||
GRUT_ASSERT_EQUAL( "folder", subject.Kind() ) ;
|
GRUT_ASSERT_EQUAL( true, subject.IsDir() ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // end of namespace grut
|
} // end of namespace grut
|
||||||
|
|
|
@ -24,13 +24,13 @@
|
||||||
|
|
||||||
namespace grut {
|
namespace grut {
|
||||||
|
|
||||||
class EntryTest : public CppUnit::TestFixture
|
class Entry1Test : public CppUnit::TestFixture
|
||||||
{
|
{
|
||||||
public :
|
public :
|
||||||
EntryTest( ) ;
|
Entry1Test( ) ;
|
||||||
|
|
||||||
// declare suit function
|
// declare suit function
|
||||||
CPPUNIT_TEST_SUITE( EntryTest ) ;
|
CPPUNIT_TEST_SUITE( Entry1Test ) ;
|
||||||
CPPUNIT_TEST( TestXml ) ;
|
CPPUNIT_TEST( TestXml ) ;
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue