Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaweees committed Nov 23, 2024
1 parent 98fca94 commit 6f23fc5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ CMakeFiles/
CPackSourceConfig.cmake
CMakeSettings.json
CTestTestfile.cmake
*_tests[1-9]*_include.cmake
*_tests.cmake

# Build files
.cache/
Expand Down
2 changes: 1 addition & 1 deletion examples/example1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
#include "my_project/library.hpp"

int main() {
std::cout << "Sum: " << my_project::add(2, 3) << std::endl;
std::cout << "Sum: " << KiwiCPP::add(2, 3) << std::endl;
return 0;
}
4 changes: 2 additions & 2 deletions include/my_project/library.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

namespace my_project {
namespace KiwiCPP {
int add(int a, int b);
} // namespace my_project
} // namespace KiwiCPP
6 changes: 3 additions & 3 deletions src/library.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "my_project/library.hpp"
#include "../include/my_project/library.hpp"

namespace my_project {
namespace KiwiCPP {
int add(int a, int b) { return a + b; }
} // namespace my_project
} // namespace KiwiCPP
10 changes: 5 additions & 5 deletions tests/test_library.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <gtest/gtest.h>

#include "my_project/library.hpp"
#include "../include/my_project/library.hpp"

TEST(LibraryTest, Add) {
// Consider adding more test cases
EXPECT_EQ(my_project::add(2, 3), 5);
EXPECT_EQ(my_project::add(-1, 1), 0);
EXPECT_EQ(my_project::add(0, 0), 0); // test zero case
EXPECT_EQ(my_project::add(-2, -3), -5); // test negative numbers
EXPECT_EQ(KiwiCPP::add(2, 3), 5);
EXPECT_EQ(KiwiCPP::add(-1, 1), 0);
EXPECT_EQ(KiwiCPP::add(0, 0), 0);
EXPECT_EQ(KiwiCPP::add(-2, -3), -5);
}

0 comments on commit 6f23fc5

Please sign in to comment.