-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented variables and add googletest as submodule.
- Loading branch information
Showing
11 changed files
with
79 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "test/lib/googletest"] | ||
path = test/lib/googletest | ||
url = [email protected]:google/googletest.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include "sigma_algebra.h" | ||
|
||
|
||
class Event; // Forward declaration | ||
|
||
class SimpleEvent : public SimpleSetWrapper<Event, SimpleEvent, std::tuple<int>> { | ||
|
||
}; | ||
|
||
/** | ||
* Class that represents the product algebra. | ||
*/ | ||
class Event : public CompositeSetWrapper<Event, SimpleEvent, std::tuple<int>> { | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
project(GoogleTests) | ||
|
||
add_subdirectory(lib) | ||
|
||
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) | ||
|
||
add_subdirectory(test_interval) | ||
# adding the Google_Tests_run target | ||
add_executable(RunUnitTest test_interval.cpp | ||
test_set.cpp | ||
test_variable.cpp) | ||
|
||
include_directories(${SRC_DIR}/random_events/include) | ||
|
||
# linking Google_Tests_run with random_events_lib which will be tested | ||
target_link_libraries(RunUnitTest random_events_lib) | ||
|
||
target_link_libraries(RunUnitTest gtest gtest_main) |
Submodule googletest
added at
d83fee
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include "gtest/gtest.h" | ||
#include "interval.h" | ||
#include "variable.h" | ||
#include "set.h" | ||
|
||
TEST(Variable, Continuous) { | ||
Continuous continuous("x"); | ||
EXPECT_EQ(continuous.name, "x"); | ||
EXPECT_EQ(continuous.domain, reals()); | ||
} | ||
|
||
TEST(Variable, Symbolic) { | ||
auto variable = Symbolic("x", Set({"a", "b", "c"})); | ||
EXPECT_EQ(variable.name, "x"); | ||
EXPECT_EQ(variable.domain, Set({"a", "b", "c"})); | ||
} | ||
|
||
TEST(Variable, Integer) { | ||
auto variable = Integer("x"); | ||
EXPECT_EQ(variable.name, "x"); | ||
EXPECT_EQ(variable.domain, reals()); | ||
} |