<commit_before>// $Id: Time_test.C,v 1.2 2000/08/28 18:03:50 oliver Exp $
#include <BALL/CONCEPT/classTest.h>

///////////////////////////

#include <BALL/CONCEPT/timeStamp.h>

///////////////////////////

START_TEST(Time, "$Id: Time_test.C,v 1.2 2000/08/28 18:03:50 oliver Exp $")

/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////

using namespace BALL;

// tests for class Time::

Time* t_ptr;
CHECK(Time::Time())
	t_ptr = new Time;
	TEST_NOT_EQUAL(t_ptr, 0)
RESULT

CHECK(Time::~Time())
	delete t_ptr;
RESULT

CHECK(Time::getSeconds() const )
	Time t;
	TEST_EQUAL(t.getSeconds(), 0)
RESULT


CHECK(Time::getMicroSeconds() const )
	Time t;
	TEST_EQUAL(t.getMicroSeconds(), 0)
RESULT


CHECK(Time::set(long secs, long usecs) throw())
	Time t;
	TEST_EQUAL(t.getSeconds(), 0)
	TEST_EQUAL(t.getMicroSeconds(), 0)
	t.set(1,1);
	TEST_EQUAL(t.getSeconds(), 1)
	TEST_EQUAL(t.getMicroSeconds(), 1)
	t.set(9999,12345);
	TEST_EQUAL(t.getSeconds(), 9999)
	TEST_EQUAL(t.getMicroSeconds(), 12345)
RESULT


CHECK(Time::Time(const Time& time))
	Time t1;
	t1.set(12345678, 23456789);
	Time t2(t1);
	TEST_EQUAL(t2, t1)
	TEST_EQUAL(t2.getSeconds(), 12345678)
	TEST_EQUAL(t2.getMicroSeconds(), 23456789)
RESULT

CHECK(Time::set(const Time& time) throw())	
	Time t1, t2;
	t1.set(12345678, 23456789);
	t2.set(t1);
	TEST_EQUAL(t2, t1)
	TEST_EQUAL(t2.getSeconds(), 12345678)
	TEST_EQUAL(t2.getMicroSeconds(), 23456789)
RESULT


CHECK(Time::Time& operator = (const Time& time) throw())
	Time t1, t2;
	t1.set(12345678, 23456789);
	t2 = t1;
	TEST_EQUAL(t2, t1)
	TEST_EQUAL(t2.getSeconds(), 12345678)
	TEST_EQUAL(t2.getMicroSeconds(), 23456789)
RESULT


CHECK(Time::bool operator < (const Time& time) const  throw())
	Time t1, t2;
	t1.set(12345678, 23456789);
	t2.set(12345679, 23456789);
	TEST_EQUAL((t2 < t1), false)
	TEST_EQUAL((t1 < t2), true)
	t2.set(12345678, 23456789);
	TEST_EQUAL((t2 < t1), false)
	TEST_EQUAL((t1 < t2), false)
	t2.set(12345678, 2345);
	TEST_EQUAL((t2 < t1), true)
	TEST_EQUAL((t1 < t2), false)
RESULT


CHECK(Time::bool operator > (const Time& time) const  throw())
	Time t1, t2;
	t1.set(12345678, 23456789);
	t2.set(12345679, 23456789);<commit_msg>added: test for clear method<commit_after>// $Id: Time_test.C,v 1.3 2000/10/16 20:04:34 oliver Exp $
#include <BALL/CONCEPT/classTest.h>

///////////////////////////

#include <BALL/CONCEPT/timeStamp.h>

///////////////////////////

START_TEST(Time, "$Id: Time_test.C,v 1.3 2000/10/16 20:04:34 oliver Exp $")

/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////

using namespace BALL;

// tests for class Time::

Time* t_ptr;
CHECK(Time::Time())
	t_ptr = new Time;
	TEST_NOT_EQUAL(t_ptr, 0)
RESULT

CHECK(Time::~Time())
	delete t_ptr;
RESULT

CHECK(Time::getSeconds() const )
	Time t;
	TEST_EQUAL(t.getSeconds(), 0)
RESULT


CHECK(Time::getMicroSeconds() const )
	Time t;
	TEST_EQUAL(t.getMicroSeconds(), 0)
RESULT


CHECK(Time::set(long secs, long usecs) throw())
	Time t;
	TEST_EQUAL(t.getSeconds(), 0)
	TEST_EQUAL(t.getMicroSeconds(), 0)
	t.set(1,1);
	TEST_EQUAL(t.getSeconds(), 1)
	TEST_EQUAL(t.getMicroSeconds(), 1)
	t.set(9999,12345);
	TEST_EQUAL(t.getSeconds(), 9999)
	TEST_EQUAL(t.getMicroSeconds(), 12345)
RESULT


CHECK(Time::Time(const Time& time))
	Time t1;
	t1.set(12345678, 23456789);
	Time t2(t1);
	TEST_EQUAL(t2, t1)
	TEST_EQUAL(t2.getSeconds(), 12345678)
	TEST_EQUAL(t2.getMicroSeconds(), 23456789)
RESULT

CHECK(Time::set(const Time& time) throw())	
	Time t1, t2;
	t1.set(12345678, 23456789);
	t2.set(t1);
	TEST_EQUAL(t2, t1)
	TEST_EQUAL(t2.getSeconds(), 12345678)
	TEST_EQUAL(t2.getMicroSeconds(), 23456789)
RESULT


CHECK(Time::Time& operator = (const Time& time) throw())
	Time t1, t2;
	t1.set(12345678, 23456789);
	t2 = t1;
	TEST_EQUAL(t2, t1)
	TEST_EQUAL(t2.getSeconds(), 12345678)
	TEST_EQUAL(t2.getMicroSeconds(), 23456789)
RESULT

CHECK(void Time::clear() throw())
	Time t1;
	Time t2;
	TEST_EQUAL(t1, t2)
	TEST_EQUAL(t1.getSeconds(), 0)
	TEST_EQUAL(t1.getMicroSeconds(), 0)
	t1.set(12345, 23456);
	TEST_EQUAL(t1.getSeconds(), 12345)
	TEST_EQUAL(t1.getMicroSeconds(), 23456)
	t1.clear();
	TEST_EQUAL(t1, t2)
RESULT


CHECK(Time::bool operator < (const Time& time) const  throw())
	Time t1, t2;
	t1.set(12345678, 23456789);
	t2.set(12345679, 23456789);
	TEST_EQUAL((t2 < t1), false)
	TEST_EQUAL((t1 < t2), true)
	t2.set(12345678, 23456789);
	TEST_EQUAL((t2 < t1), false)
	TEST_EQUAL((t1 < t2), false)
	t2.set(12345678, 2345);
	TEST_EQUAL((t2 < t1), true)
	TEST_EQUAL((t1 < t2), false)
RESULT


CHECK(Time::bool operator > (const Time& time) const  throw())
	Time t1, t2;
	t1.set(12345678, 23456789);
	t2.set(12345679, 23456789);
{'fraction_non_alphanumeric': 0.22825858075384292, 'fraction_numerical': 0.131396083385976, 'mean_word_length': 3.6071774975751696, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3065182', 'n_tokens_mistral': 2320, 'n_tokens_neox': 1907, 'n_words': 386}