Skip to content

Commit

Permalink
-Include unit test code in format checks.
Browse files Browse the repository at this point in the history
-Format unit test code.
  • Loading branch information
lorenzo-gomez-windhover committed Sep 4, 2024
1 parent f6cd03b commit 31f31c5
Show file tree
Hide file tree
Showing 13 changed files with 648 additions and 754 deletions.
5 changes: 3 additions & 2 deletions clang_format_all_config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
root_dir: "src"
root_dir: "."

#When true, files will only be checked. None will be modified.
check_all: true
Expand All @@ -21,4 +21,5 @@ exclude_dirs:
- "lc"
- "prmlib"
- "cfs_lib"
- "vm"
- "vm"
- "Catch2"
5 changes: 3 additions & 2 deletions clang_format_all_config_format.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
root_dir: "src"
root_dir: "."

#When true, files will only be checked. None will be modified.
check_all: false
Expand All @@ -21,4 +21,5 @@ exclude_dirs:
- "lc"
- "prmlib"
- "cfs_lib"
- "vm"
- "vm"
- "Catch2"
16 changes: 6 additions & 10 deletions unit-test/TestElfFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
* Author: vagrant
*/

#include "../src/ElfFile.h"
#include "catch.hpp"
#include <limits.h>

#include "../src/ElfFile.h"
#include "catch.hpp"

/**
*@todo This testing module is not done yet.
*/

TEST_CASE( "Correctness of a Module object instance", "[Module] " ) {
TEST_CASE("Correctness of a Module object instance", "[Module] ")
{
std::string newElfName{"ABC"};
uint32_t elfId = 102;
ElfFile myElf{newElfName};
Expand All @@ -25,11 +26,6 @@ TEST_CASE( "Correctness of a Module object instance", "[Module] " ) {
newElfName.insert(0, resolvedPath);

myElf.setId(elfId);
REQUIRE( myElf.getName() == newElfName );
REQUIRE( myElf.getId() == elfId );

REQUIRE(myElf.getName() == newElfName);
REQUIRE(myElf.getId() == elfId);
}




32 changes: 18 additions & 14 deletions unit-test/TestEnumeration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* Created on: Aug 12, 2020
* Author: vagrant
*/
#include "catch.hpp"
#include "Enumeration.h"
#include "catch.hpp"

/**
* @brief Unit tests for Enumeration class.
Expand All @@ -16,9 +16,9 @@ TEST_CASE("Test Enumeration name correctness", "[Enumeration]")
std::string symbolName{"string"};
std::string elfName{"ABC"};

ElfFile symbolModule{elfName};
ElfFile symbolModule{elfName};

Symbol enumSymbol{symbolModule};
Symbol enumSymbol{symbolModule};
enumSymbol.setName(symbolName);
std::string colorName{"Color"};

Expand All @@ -34,11 +34,11 @@ TEST_CASE("Test Enumeration value correctness", "[Enumeration]")
std::string symbolName{"string"};
std::string elfName{"ABC"};

ElfFile symbolModule{elfName};
ElfFile symbolModule{elfName};

Symbol enumSymbol{symbolModule};
Symbol enumSymbol{symbolModule};
enumSymbol.setName(symbolName);
uint64_t value{714};
uint64_t value{714};

Enumeration colorEnumeration{enumSymbol};

Expand All @@ -47,33 +47,37 @@ TEST_CASE("Test Enumeration value correctness", "[Enumeration]")
REQUIRE(colorEnumeration.getValue() == value);
}

TEST_CASE("Test Constructor Enumeration(Symbol &symbol) "
" correctness ", "[Enumeration]")
TEST_CASE(
"Test Constructor Enumeration(Symbol &symbol) "
" correctness ",
"[Enumeration]")
{
std::string symbolName{"string"};
std::string elfName{"ABC"};

ElfFile symbolModule{elfName};
ElfFile symbolModule{elfName};

Symbol enumSymbol{symbolModule};
Symbol enumSymbol{symbolModule};
enumSymbol.setName(symbolName);

Enumeration colorEnumeration{enumSymbol};

REQUIRE(colorEnumeration.getSymbol().getName() == symbolName);
}

TEST_CASE("Test Constructor Enumeration(Symbol &symbol, std::string &name, uint64_t value) "
" correctness ", "[Enumeration]")
TEST_CASE(
"Test Constructor Enumeration(Symbol &symbol, std::string &name, uint64_t value) "
" correctness ",
"[Enumeration]")
{
std::string symbolName{"string"};
std::string enumName{"Color"};
uint64_t value{714};
std::string elfName{"ABC"};

ElfFile symbolModule{elfName};
ElfFile symbolModule{elfName};

Symbol enumSymbol{symbolModule};
Symbol enumSymbol{symbolModule};
enumSymbol.setName(symbolName);

Enumeration colorEnumeration{enumSymbol, enumName, value};
Expand Down
1 change: 1 addition & 0 deletions unit-test/TestIDataContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Author: vagrant
*/
#include <catch.hpp>

#include "IDataContainer.h"

/**
Expand Down
4 changes: 0 additions & 4 deletions unit-test/TestLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@
* Created on: Aug 21, 2020
* Author: vagrant
*/




Loading

0 comments on commit 31f31c5

Please sign in to comment.