<commit_before>#include "xCivilTime.hpp"
#include <iostream>
#include <fstream>

CPPUNIT_TEST_SUITE_REGISTRATION (xCivilTime);

using namespace gpstk;

void xCivilTime :: setUp (void)
{
}

void xCivilTime :: setFromInfoTest (void)
{
	Rinex3::CivilTime setFromInfo1;
	Rinex3::CivilTime setFromInfo2;
	Rinex3::CivilTime setFromInfo3;
	Rinex3::CivilTime setFromInfo4;
	Rinex3::CivilTime setFromInfo5;
	
	gpstk::TimeTag::IdToValue Id;
	Id.insert(make_pair('b',"Dec"));
	Id.insert(make_pair('d',"31"));
	Id.insert(make_pair('Y',"2008"));
	Id.insert(make_pair('H',"12"));
	Id.insert(make_pair('M',"00"));
	Id.insert(make_pair('S',"00"));
	Id.insert(make_pair('P',"02"));
	CPPUNIT_ASSERT(setFromInfo1.setFromInfo(Id));

	Rinex3::CivilTime Check(2008,12,31,12,0,0,GPS);
	CPPUNIT_ASSERT_EQUAL(setFromInfo1,Check);
	Id.erase('b');
	Id.erase('Y');
	Id.insert(make_pair('m',"12"));
	Id.insert(make_pair('y',"06"));
	CPPUNIT_ASSERT(setFromInfo2.setFromInfo(Id));
	Id.erase('y');
	Id.insert(make_pair('y',"006"));
	CPPUNIT_ASSERT(setFromInfo3.setFromInfo(Id));
	Id.erase('y');
	CPPUNIT_ASSERT(setFromInfo4.setFromInfo(Id));
	Id.erase('m');
	Id.insert(make_pair('b',"AAA"));
	CPPUNIT_ASSERT(!(setFromInfo5.setFromInfo(Id)));
}

void xCivilTime :: operatorTest (void)
{
	Rinex3::CivilTime Zero;
	
	Rinex3::CivilTime Aug21(2008,8,21,13,30,15.);
	Rinex3::CivilTime LessThanYear(2005,8,21,13,30,15.);
	Rinex3::CivilTime LessThanMonth(2008,7,21,13,30,15.);
	Rinex3::CivilTime LessThanDay(2008,8,20,13,30,15.);
	Rinex3::CivilTime LessThanHour(2008,8,21,12,30,15.);
	Rinex3::CivilTime LessThanMinute(2008,8,21,13,20,15.);
	Rinex3::CivilTime LessThanSecond(2008,8,21,13,30,0.);
	
	Rinex3::CivilTime Aug21Copy(Aug21);
	
	Rinex3::CivilTime Aug21Copy2 = Aug21Copy;
	Aug21Copy2 = Aug21Copy;
	//Equality Assertion
	CPPUNIT_ASSERT_EQUAL(Aug21,Aug21Copy);
	//Non-equality Assertion
	CPPUNIT_ASSERT(Aug21 != LessThanYear);<commit_msg>Commited a change to test a possible use for CommonTime<commit_after>#include "xCivilTime.hpp"
#include "UnixTime.hpp"
#include <iostream>
#include <fstream>

CPPUNIT_TEST_SUITE_REGISTRATION (xCivilTime);

using namespace gpstk;

void xCivilTime :: setUp (void)
{
}

void xCivilTime :: setFromInfoTest (void)
{
	Rinex3::CivilTime setFromInfo1;
	Rinex3::CivilTime setFromInfo2;
	Rinex3::CivilTime setFromInfo3;
	Rinex3::CivilTime setFromInfo4;
	Rinex3::CivilTime setFromInfo5;
	
	gpstk::TimeTag::IdToValue Id;
	Id.insert(make_pair('b',"Dec"));
	Id.insert(make_pair('d',"31"));
	Id.insert(make_pair('Y',"2008"));
	Id.insert(make_pair('H',"12"));
	Id.insert(make_pair('M',"00"));
	Id.insert(make_pair('S',"00"));
	Id.insert(make_pair('P',"02"));
	CPPUNIT_ASSERT(setFromInfo1.setFromInfo(Id));

	Rinex3::CivilTime Check(2008,12,31,12,0,0,GPS);
	CPPUNIT_ASSERT_EQUAL(setFromInfo1,Check);
	Id.erase('b');
	Id.erase('Y');
	Id.insert(make_pair('m',"12"));
	Id.insert(make_pair('y',"06"));
	CPPUNIT_ASSERT(setFromInfo2.setFromInfo(Id));
	Id.erase('y');
	Id.insert(make_pair('y',"006"));
	CPPUNIT_ASSERT(setFromInfo3.setFromInfo(Id));
	Id.erase('y');
	CPPUNIT_ASSERT(setFromInfo4.setFromInfo(Id));
	Id.erase('m');
	Id.insert(make_pair('b',"AAA"));
	CPPUNIT_ASSERT(!(setFromInfo5.setFromInfo(Id)));

	CommonTime time;
	time = Check.convertToCommonTime();
	std::cout << Check.printf("%04Y %02m %02d %02H %02M") << std::endl;
	std::cout << ((Rinex3::CivilTime)(time)).printf("%04Y %02m %02d %02H %02M")<< std::endl;
	std::cout << ((Rinex3::UnixTime)(time)).printf("%010U")<< std::endl;
}

void xCivilTime :: operatorTest (void)
{
	Rinex3::CivilTime Zero;
	
	Rinex3::CivilTime Aug21(2008,8,21,13,30,15.);
	Rinex3::CivilTime LessThanYear(2005,8,21,13,30,15.);
	Rinex3::CivilTime LessThanMonth(2008,7,21,13,30,15.);
	Rinex3::CivilTime LessThanDay(2008,8,20,13,30,15.);
	Rinex3::CivilTime LessThanHour(2008,8,21,12,30,15.);
	Rinex3::CivilTime LessThanMinute(2008,8,21,13,20,15.);
	Rinex3::CivilTime LessThanSecond(2008,8,21,13,30,0.);
	
	Rinex3::CivilTime Aug21Copy(Aug21);
	
	Rinex3::CivilTime Aug21Copy2 = Aug21Copy;
	Aug21Copy2 = Aug21Copy;
	//Equality Assertion
	CPPUNIT_ASSERT_EQUAL(Aug21,Aug21Copy);
	//Non-equality Assertion
	CPPUNIT_ASSERT(Aug21 != LessThanYear);
{'fraction_non_alphanumeric': 0.19124368535001202, 'fraction_numerical': 0.08876593697377917, 'mean_word_length': 8.647331786542923, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 7, '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': '2226240', 'n_tokens_mistral': 1988, 'n_tokens_neox': 1757, 'n_words': 209}