Skip to content

Commit

Permalink
Move old tests to fix build errors, fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Jun 27, 2015
1 parent 70ec926 commit 5da3290
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 20 deletions.
1 change: 1 addition & 0 deletions libgrive/CMakeLists.txt
Expand Up @@ -117,6 +117,7 @@ IF ( CPPUNIT_FOUND )

# list of test source files here
file(GLOB TEST_SRC
test/base/*.cc
test/drive/*.cc
test/util/*.cc
test/xml/*.cc
Expand Down
8 changes: 4 additions & 4 deletions libgrive/test/UnitTest.cc
Expand Up @@ -22,9 +22,9 @@
#include "util/log/DefaultLog.hh"

#include "drive/EntryTest.hh"
#include "drive/ResourceTest.hh"
#include "drive/ResourceTreeTest.hh"
#include "drive/StateTest.hh"
#include "base/ResourceTest.hh"
#include "base/ResourceTreeTest.hh"
#include "base/StateTest.hh"
#include "util/DateTimeTest.hh"
#include "util/FunctionTest.hh"
#include "util/ConfigTest.hh"
Expand All @@ -38,7 +38,7 @@ int main( int argc, char **argv )
gr::LogBase::Inst( std::auto_ptr<gr::LogBase>(new gr::log::DefaultLog) ) ;

CppUnit::TextUi::TestRunner runner;
runner.addTest( EntryTest::suite( ) ) ;
runner.addTest( Entry1Test::suite( ) ) ;
runner.addTest( StateTest::suite( ) ) ;
runner.addTest( ResourceTest::suite( ) ) ;
runner.addTest( ResourceTreeTest::suite( ) ) ;
Expand Down
Expand Up @@ -21,9 +21,9 @@

#include "Assert.hh"

#include "drive/Resource.hh"
#include "base/Resource.hh"

#include "drive/Entry.hh"
#include "drive/Entry1.hh"
#include "xml/Node.hh"

#include <iostream>
Expand Down Expand Up @@ -60,7 +60,7 @@ void ResourceTest::TestNormal( )
xml::Node entry = xml::Node::Element( "entry" ) ;
entry.AddElement( "updated" ).AddText( "2012-05-09T16:13:22.401Z" ) ;

Entry remote( entry ) ;
Entry1 remote( entry ) ;
subject.FromRemote( remote, DateTime() ) ;
GRUT_ASSERT_EQUAL( "local_changed", subject.StateStr() ) ;
}
Expand Down
File renamed without changes.
Expand Up @@ -21,15 +21,14 @@

#include "Assert.hh"

#include "drive/ResourceTree.hh"
#include "drive/Resource.hh"
#include "base/ResourceTree.hh"
#include "base/Resource.hh"

#include <iostream>

namespace grut {

using namespace gr ;
using namespace gr::v1 ;

ResourceTreeTest::ResourceTreeTest( )
{
Expand Down
File renamed without changes.
Expand Up @@ -21,7 +21,7 @@

#include "Assert.hh"

#include "drive/State.hh"
#include "base/State.hh"
#include "json/Val.hh"
#include "util/log/Log.hh"

Expand All @@ -30,7 +30,6 @@
namespace grut {

using namespace gr ;
using namespace gr::v1 ;

StateTest::StateTest( )
{
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions libgrive/test/drive/EntryTest.cc
Expand Up @@ -21,7 +21,7 @@

#include "Assert.hh"

#include "drive/Entry.hh"
#include "drive/Entry1.hh"
#include "xml/Node.hh"
#include "xml/NodeSet.hh"
#include "xml/TreeBuilder.hh"
Expand All @@ -33,17 +33,17 @@ namespace grut {
using namespace gr ;
using namespace gr::v1 ;

EntryTest::EntryTest( )
Entry1Test::Entry1Test( )
{
}

void EntryTest::TestXml( )
void Entry1Test::TestXml( )
{
xml::Node root = xml::TreeBuilder::ParseFile( TEST_DATA "entry.xml" ) ;

CPPUNIT_ASSERT( !root["entry"].empty() ) ;

Entry subject( root["entry"].front() ) ;
Entry1 subject( root["entry"].front() ) ;
GRUT_ASSERT_EQUAL( "snes", subject.Title() ) ;
GRUT_ASSERT_EQUAL( "\"WxYPGE8CDyt7ImBk\"", subject.ETag() ) ;
GRUT_ASSERT_EQUAL( "https://docs.google.com/feeds/default/private/full/folder%3A0B5KhdsbryVeGMl83OEV1ZVc3cUE",
Expand All @@ -53,7 +53,7 @@ void EntryTest::TestXml( )
GRUT_ASSERT_EQUAL( "https://docs.google.com/feeds/default/private/full/folder%3A0B5KhdsbryVeGNEZjdUxzZHl3Sjg",
subject.ParentHrefs().front() ) ;

GRUT_ASSERT_EQUAL( "folder", subject.Kind() ) ;
GRUT_ASSERT_EQUAL( true, subject.IsDir() ) ;
}

} // end of namespace grut
6 changes: 3 additions & 3 deletions libgrive/test/drive/EntryTest.hh
Expand Up @@ -24,13 +24,13 @@

namespace grut {

class EntryTest : public CppUnit::TestFixture
class Entry1Test : public CppUnit::TestFixture
{
public :
EntryTest( ) ;
Entry1Test( ) ;

// declare suit function
CPPUNIT_TEST_SUITE( EntryTest ) ;
CPPUNIT_TEST_SUITE( Entry1Test ) ;
CPPUNIT_TEST( TestXml ) ;
CPPUNIT_TEST_SUITE_END();

Expand Down

0 comments on commit 5da3290

Please sign in to comment.