SpiecsEngine
 
Loading...
Searching...
No Matches
Tuple_test.h
Go to the documentation of this file.
1/**
2* @file Tuple_test.h.
3* @brief The Tuple_test Definitions.
4* @author Spices.
5*/
6
7#pragma once
8#include <gmock/gmock.h>
9#include <Core/Container/Tuple.h>
10#include "Instrumentor.h"
11
12namespace SpicesTest {
13
14 /**
15 * @brief Testing std::tuple Helper Function.
16 */
18
20
21 auto t = std::make_tuple(1, 2.0f, "Hellp", nullptr);
22
23 int index = 0;
24
25 scl::IterTuple(t, [&](auto&& elem) {
26
27 if (index == 0)
28 {
29 EXPECT_EQ((void*)&elem, (void*)&std::get<0>(t));
30 }
31 else if (index == 1)
32 {
33 EXPECT_EQ((void*)&elem, (void*)&std::get<1>(t));
34 }
35 else if (index == 2)
36 {
37 EXPECT_EQ((void*)&elem, (void*)&std::get<2>(t));
38 }
39 else if (index == 3)
40 {
41 EXPECT_EQ((void*)&elem, (void*)&std::get<3>(t));
42 }
43
44 index++;
45 });
46 }
47}
#define SPICES_FUNC_SIG
#define SPICESTEST_PROFILE_SCOPE_LINE2(name, line)
#define SPICESTEST_PROFILE_SCOPE(name)
#define SPICES_PROFILE
#define SPICESTEST_PROFILE_END_SESSION()
#define SPICESTEST_PROFILE_BEGIN_SESSION(name, filepath)
#define SPICESTEST_PROFILE_SCOPE_LINE(name, line)
#define SPICESTEST_PROFILE_FUNCTION()
InstrumentationTimer(const char *name)
std::chrono::time_point< std::chrono::steady_clock > m_StartTimepoint
Instrumentor(Instrumentor &&)=delete
static Instrumentor & Get()
void BeginSession(const std::string &name, const std::string &filepath="results.json")
void WriteProfile(const ProfileResult &result)
InstrumentationSession * m_CurrentSession
std::ofstream m_OutputStream
Instrumentor(const Instrumentor &)=delete
void Test(float f)
Basic Override Class Function.
void Test()
Basic Override Class Function.
void TearDown() override
Testing class TearDown function.
std::vector< scl::directed_acyclic_node > m_Nodes
void SetUp() override
Testing class initialize function.
The interface is inherited from testing::Test. Registy on Initialize.
scl::kd_tree< 2 > m_KDTree
Create a KDTree with 2 dimensions.
Definition KDTree_test.h:57
void TearDown() override
Testing class TearDown function.
Definition KDTree_test.h:52
void SetUp() override
Testing class initialize function.
Definition KDTree_test.h:27
The interface is inherited from testing::Test. Registry on Initialize.
Definition KDTree_test.h:21
scl::linked_unordered_map< int, std::string > c1
scl::linked_unordered_map< float, std::string > c2
scl::linked_unordered_map< std::string, std::string > c0
void SetUp() override
Testing class initialize function.
void TearDown() override
Testing class TearDown function.
The interface is inherited from testing::Test. Registry on Initialize.
void SetUp() override
The interface is inherited from testing::Test. Registry on Initialize.
void TearDown() override
Testing class TearDown function.
Unit Test for RuntimeMemoryBlock.
The kd_tree with K dimensions container Class. K the number of dimensions. Every node in the tree is ...
Definition KDTree.h:27
The container combines hashmap and list together. Used in the case that we want iter a hashmap in ord...
void build()
Malloc a memory to begin_.
void add_element(const std::string &name, const std::string &type)
Add a element to object_, means a memory block will be occupied with given param type.
runtime_memory_block()=default
Constructor Function.
void * get_addr() const
Get the begin_.
The container is wrapper of a continue memory block. Used in Material::BuildMaterial(),...
int main(int argc, char **argv)
The Entry of SpicesTest.
Definition main.cpp:76
constexpr auto CleanupOutputString(const char(&expr)[N], const char(&remove)[K])
TEST_F(runtime_memory_block_test, Initialize)
Testing if initialize successfully.
TEST_F(directed_acyclic_graph_test, Addnode)
Testing if add node successfully.
TEST_F(linked_unordered_map_test, Initialize)
Testing if initialize successfully.
TEST_F(kd_tree_test, Insert)
Testing if Insert successfully.
Definition KDTree_test.h:63
TEST(tuple_test, IterTuple)
Testing std::tuple Helper Function.
Definition Tuple_test.h:17
std::thread::id ThreadID
std::chrono::microseconds ElapsedTime
FloatingPointMicroseconds Start