Skip to content

Commit

Permalink
Merge pull request #95 from hwangswan/comment
Browse files Browse the repository at this point in the history
Comment
  • Loading branch information
trhgquan authored Feb 8, 2022
2 parents ad2e438 + 425318d commit 5fc017d
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 43 deletions.
27 changes: 2 additions & 25 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ name: C/C++ CI
on:
push:
branches: [ master ]
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
pull_request:
branches: [ master ]

jobs:
linter:
Expand All @@ -34,31 +30,12 @@ jobs:

- name: make
run: make
if: ${{ github.event_name == 'push' }}

- name: make (with test coverage)
run: make gcov
if: ${{ github.event_name == 'pull_request_target' }}

- name: make - copy test into testing folder
run: make init_test

- name: make - test
run: make test

- name: make - init code coverage
run: |
sudo apt-get install -y lcov && make lcov
if: ${{ github.event_name == 'pull_request_target' }}

- name: upload code coverage report
uses: zgosalvez/github-actions-report-lcov@v1
with:
coverage-files: coverage.info
minimum-coverage: 80
artifact-name: code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.event_name == 'pull_request_target' }}

- name: cleaning afterworks
run: make clean
2 changes: 2 additions & 0 deletions src/Grade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
/**
* Default constructor
*
* @return void
*/
Grade::Grade() { _grade = 0.0; }

Expand All @@ -29,6 +30,7 @@ Grade::Grade(const Grade &other) { _grade = other._grade; }
/**
* Destructor
*
* @return void
*/
Grade::~Grade() {
// Do nothing.
Expand Down
2 changes: 2 additions & 0 deletions src/Grade.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Grade {
/**
* Default constructor
*
* @return void
*/
Grade();

Expand All @@ -48,6 +49,7 @@ class Grade {
/**
* Destructor
*
* @return void
*/
~Grade();

Expand Down
10 changes: 10 additions & 0 deletions src/InputHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@

#include "InputHelper.h"

/**
* InputHelper default constructor
*
* @return void
*/
InputHelper::InputHelper() {
// Do nothing
}

/**
* InputHelper destructor
*
* @return void
*/
InputHelper::~InputHelper() {
// Do nothing
}
Expand Down
12 changes: 11 additions & 1 deletion src/InputHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,26 @@ enum { ALLOW_PARSING_ERROR = 1 << 0, IGNORE_PARSING_ERROR = 1 << 1 };
}

/**
* InputHelper
* InputHelper class
*
*/
class InputHelper {
private:
int _inputFlag = 0;

/**
* InputHelper default constructor
*
* @return void
*/
InputHelper();

public:
/**
* InputHelper destructor
*
* @return void
*/
~InputHelper();

/**
Expand Down
14 changes: 13 additions & 1 deletion src/OutputHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@

#include "OutputHelper.h"

/**
* OutputHelper default constructor
*
* @return void
*/
OutputHelper::OutputHelper() {
// Do nothing
}

/**
* OutputHelper destructor
*
* @return void
*/
OutputHelper::~OutputHelper() {
// Do nothing
}
Expand Down Expand Up @@ -53,6 +63,7 @@ void OutputHelper::setOutputFlag(int flag) { _outputFlag |= flag; }
/**
* Print the textart
*
* @return void
*/
void OutputHelper::printTextart() {
std::ifstream textartFile(OutputConstants::TEXTART_FILE);
Expand All @@ -70,6 +81,7 @@ void OutputHelper::printTextart() {
/**
* Print a separator line.
*
* @return void
*/
void OutputHelper::printSeparator() {
std::cout << std::setfill('-');
Expand Down Expand Up @@ -129,8 +141,8 @@ void OutputHelper::printTable(

/**
* Output in table format
* (without last conclusion row)
*
* (without last conclusion row)
*/
if (!isCSVOutput()) {
printTableFormat(tableData);
Expand Down
16 changes: 16 additions & 0 deletions src/OutputHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,26 @@ enum {
};
} // namespace OutputConstants

/**
* OutputHelper class
*
*/
class OutputHelper {
private:
int _outputFlag = 0;

/**
* OutputHelper default constructor
*
* @return void
*/
OutputHelper();

private:
/**
* Print a separator line.
*
* @return void
*/
void printSeparator();

Expand Down Expand Up @@ -78,6 +88,11 @@ class OutputHelper {
void printTableFormat(const std::vector<std::vector<std::string>> &);

public:
/**
* OutputHelper destructor
*
* @return void
*/
~OutputHelper();

/**
Expand Down Expand Up @@ -112,6 +127,7 @@ class OutputHelper {
/**
* Print the textart
*
* @return void
*/
void printTextart();

Expand Down
10 changes: 10 additions & 0 deletions src/PersonalExcept.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@

#include "PersonalExcept.h"

/**
* PersonalExcept default constructor
*
* @return void
*/
PersonalExcept::PersonalExcept() {
// Do nothing.
}

/**
* PersonalExcept destructor
*
* @return void
*/
PersonalExcept::~PersonalExcept() {
// Do nothing.
}
Expand Down
10 changes: 10 additions & 0 deletions src/PersonalExcept.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,18 @@ class PersonalExcept : public PersonalGPA {
std::multiset<std::string> _ignoredCourses;

public:
/**
* PersonalExcept default constructor
*
* @return void
*/
PersonalExcept();

/**
* PersonalExcept destructor
*
* @return void
*/
~PersonalExcept();

/**
Expand Down
9 changes: 8 additions & 1 deletion src/PersonalFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

#include "PersonalFactory.h"

/**
* PersonalFactory default constructor
* This will push prototypes (classes) to a list - to create later.
*
* @return void
*/
PersonalFactory::PersonalFactory() {
// Push list of prototypes.
_prototypes.push_back(std::make_shared<PersonalGPA>());
Expand All @@ -14,8 +20,9 @@ PersonalFactory::PersonalFactory() {
}

/**
* Destructor
* PersonalFactory destructor
*
* @return void
*/
PersonalFactory::~PersonalFactory() {
// Do nothing.
Expand Down
9 changes: 7 additions & 2 deletions src/PersonalFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ class PersonalFactory {
// List of prototypes.
std::vector<std::shared_ptr<PersonalGPA>> _prototypes;

// Setting up.
/**
* PersonalFactory default constructor
*
* @return void
*/
PersonalFactory();

public:
/**
* Destructor
* PersonalFactory destructor
*
* @return void
*/
~PersonalFactory();

Expand Down
6 changes: 4 additions & 2 deletions src/PersonalGPA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@
#include "PersonalGPA.h"

/**
* Constructor for PersonalGPA
* PersonalGPA default constructor
*
* @return void
*/
PersonalGPA::PersonalGPA() {
// Do nothing;
}

/**
* Destructor for PersonalGPA
* PersonalGPA destructor
*
* @return void
*/
PersonalGPA::~PersonalGPA() {
// Do nothing;
Expand Down
6 changes: 4 additions & 2 deletions src/PersonalGPA.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ class PersonalGPA {

public:
/**
* Constructor for PersonalGPA
* PersonalGPA default constructor
*
* @return void
*/
PersonalGPA();

/**
* Destructor for PersonalGPA
* PersonalGPA destructor
*
* @return void
*/
~PersonalGPA();

Expand Down
10 changes: 10 additions & 0 deletions src/PersonalSpecific.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@

#include "PersonalSpecific.h"

/**
* PersonalSpecific default constructor
*
* @return void
*/
PersonalSpecific::PersonalSpecific() {
// Do nothing
}

/**
* PersonalSpecific destructor
*
* @return void
*/
PersonalSpecific::~PersonalSpecific() {
// Do nothing
}
Expand Down
10 changes: 10 additions & 0 deletions src/PersonalSpecific.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@
*/
class PersonalSpecific : public PersonalGPA {
public:
/**
* PersonalSpecific default constructor
*
* @return void
*/
PersonalSpecific();

/**
* PersonalSpecific destructor
*
* @return void
*/
~PersonalSpecific();

/**
Expand Down
Loading

0 comments on commit 5fc017d

Please sign in to comment.