-
Notifications
You must be signed in to change notification settings - Fork 1
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
Norym
committed
Jul 13, 2020
1 parent
044798c
commit 1b75674
Showing
4 changed files
with
43 additions
and
11 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 |
---|---|---|
|
@@ -2,27 +2,63 @@ | |
/* Copyright (c) 2020 Project WomoLIN */ | ||
/* Author Myron Franze <[email protected]> */ | ||
|
||
#include "../interface/helper.h" | ||
|
||
#include <gtest/gtest.h> | ||
|
||
namespace siguni::gtest | ||
{ | ||
|
||
class CHelperExtractKeyValueTest : public ::testing::Test {}; | ||
class CHelperSignalStringsFindFirstCharacter : public ::testing::Test {}; | ||
|
||
TEST_F( CHelperExtractKeyValueTest, ValidKeyValuePair ) { | ||
// TODO | ||
TEST_F( CHelperSignalStringsFindFirstCharacter, PositionTests ) { | ||
|
||
std::string testString = "^OneCaptureByteAtPostion0"; | ||
auto pos = helper::CSignalStrings::FindFirstCharacter( testString, '^'); | ||
ASSERT_EQ( 0, pos ); | ||
|
||
pos = helper::CSignalStrings::FindFirstCharacter( testString, '^', 0); | ||
ASSERT_EQ( 0, pos ); | ||
|
||
testString = ">^OneCaptureByteAtPosition1"; | ||
pos = helper::CSignalStrings::FindFirstCharacter( testString, '^'); | ||
ASSERT_EQ( 1, pos ); | ||
|
||
pos = helper::CSignalStrings::FindFirstCharacter( testString, '^', 1); | ||
ASSERT_EQ( 1, pos ); | ||
|
||
testString = "^Two^CaptureBytes"; | ||
pos = helper::CSignalStrings::FindFirstCharacter( testString, '^'); | ||
ASSERT_EQ( 0, pos ); | ||
|
||
// with offset 1, we expect the position of the second pos | ||
pos = helper::CSignalStrings::FindFirstCharacter( testString, '^', 1); | ||
ASSERT_EQ( 4, pos ); | ||
|
||
testString = "AtEndPosition^"; | ||
pos = helper::CSignalStrings::FindFirstCharacter( testString, '^' ); | ||
ASSERT_EQ( 13, pos ); | ||
|
||
testString = "NoCaptureByte"; | ||
pos = helper::CSignalStrings::FindFirstCharacter( testString, '^' ); | ||
ASSERT_EQ( -1, pos ); | ||
} | ||
|
||
TEST_F( CHelperExtractKeyValueTest, TwoSeparators ) { | ||
class CHelperSignalStringsFindLastCharacter : public ::testing::Test {}; | ||
|
||
TEST_F( CHelperSignalStringsFindLastCharacter, PositionTests ) { | ||
|
||
// TODO | ||
} | ||
|
||
class CHelperGetValueItemsTest : public ::testing::Test {}; | ||
class CHelperSignalStringsExtractKeyValue : public ::testing::Test {}; | ||
|
||
TEST_F( CHelperSignalStringsExtractKeyValue, PositionTests ) { | ||
|
||
TEST_F( CHelperGetValueItemsTest, ValidKeyValuePair ) { | ||
// TODO | ||
} | ||
|
||
|
||
|
||
|
||
} |
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
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