-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
1 deletion.
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
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,25 @@ | ||
#include "gtest/gtest.h" | ||
|
||
#include "DefaultPackageStructure.h" | ||
|
||
TEST(DefaultPackageTest, defaultPackageStructure) | ||
{ | ||
// just test that DefaultPackageStructure is available in global namespace | ||
DefaultPackageStructure data; | ||
|
||
data.value = 10; | ||
default_package_import::top::TopStructure topStructure; | ||
topStructure.type = 1; | ||
topStructure.data = 1234; | ||
data.topStructure = topStructure; | ||
Child child; | ||
child.value = 0xdeadbeef; | ||
data.childStructure = child; | ||
|
||
zserio::View view(data, 4); | ||
|
||
ASSERT_EQ(10, view.value()); | ||
ASSERT_EQ(1, view.topStructure().type()); | ||
ASSERT_EQ(1234, view.topStructure().data()); | ||
ASSERT_EQ(0xdeadbeef, view.childStructure().value()); | ||
} |
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,28 @@ | ||
#include "gtest/gtest.h" | ||
#include "index_workaround/index/Test.h" | ||
#include "test_utils/TestUtility.h" | ||
|
||
namespace index_workaround | ||
{ | ||
|
||
class IndexTest : public ::testing::Test | ||
{ | ||
protected: | ||
static constexpr uint32_t ARRAY_SIZE = 10; | ||
}; | ||
|
||
TEST_F(IndexTest, writeRead) | ||
{ | ||
::index_workaround::index::Test data; | ||
data.indexes.resize(ARRAY_SIZE); | ||
data.indexesForParameterized.resize(ARRAY_SIZE); | ||
for (uint32_t i = 0; i < ARRAY_SIZE; ++i) | ||
{ | ||
data.array.emplace_back(i); | ||
data.parameterizedArray.emplace_back(i); | ||
} | ||
|
||
test_utils::writeReadTest(data); | ||
} | ||
|
||
} // namespace index_workaround |
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,25 @@ | ||
#include "gtest/gtest.h" | ||
#include "package_name_conflict/PackageNameConflictImported.h" | ||
#include "package_name_conflict/PackageNameConflictLocal.h" | ||
#include "test_utils/WriteReadTest.h" | ||
|
||
namespace package_name_conflict | ||
{ | ||
|
||
TEST(PackageNameConflictTest, packageNameConflictLocal) | ||
{ | ||
// just test that PackageNameConflictLocal includes correct Blob | ||
PackageNameConflictLocal data{Blob{13}}; | ||
|
||
test_utils::writeReadTest(data); | ||
} | ||
|
||
TEST(PackageNameConflictTest, packageNameConflictImported) | ||
{ | ||
// just test that PackageNameConflictImported includes correct Blob | ||
PackageNameConflictImported data{::package_name_conflict::package_name_conflict::Blob{"test"}}; | ||
|
||
test_utils::writeReadTest(data); | ||
} | ||
|
||
} // namespace package_name_conflict |
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,28 @@ | ||
#include "gtest/gtest.h" | ||
#include "reader/Test.h" | ||
#include "test_utils/WriteReadTest.h" | ||
|
||
namespace reader | ||
{ | ||
|
||
class ReaderTest : public ::testing::Test | ||
{ | ||
protected: | ||
static constexpr uint32_t ARRAY_SIZE = 10; | ||
}; | ||
|
||
TEST_F(ReaderTest, writeRead) | ||
{ | ||
::reader::Test data; | ||
data.indexes.resize(ARRAY_SIZE); | ||
data.indexesForParameterized.resize(ARRAY_SIZE); | ||
for (uint32_t i = 0; i < ARRAY_SIZE; ++i) | ||
{ | ||
data.array.emplace_back(i); | ||
data.parameterizedArray.emplace_back(i); | ||
} | ||
|
||
test_utils::writeReadTest(data); | ||
} | ||
|
||
} // namespace reader |