diff options
author | Martin Fischer <martin@push-f.com> | 2021-12-05 01:44:45 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-12-05 01:53:28 +0100 |
commit | 799f2d02bea9bb16780bce01d4f3d831954bf9f0 (patch) | |
tree | a9c2d425aee007cf0f16cd2172f5f1a88f31d18b /test/src/PercentEncodedCharacterDecoderTests.cpp | |
parent | c3255c4473dd3976361ac52899c504c7f70c4be9 (diff) |
remove C++ implementation
Diffstat (limited to 'test/src/PercentEncodedCharacterDecoderTests.cpp')
-rw-r--r-- | test/src/PercentEncodedCharacterDecoderTests.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/test/src/PercentEncodedCharacterDecoderTests.cpp b/test/src/PercentEncodedCharacterDecoderTests.cpp deleted file mode 100644 index fcc4286..0000000 --- a/test/src/PercentEncodedCharacterDecoderTests.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file PercentEncodedCharacterDecoderTests.cpp - * - * This module contains the unit tests of the Uri::PercentEncodedCharacterDecoder class. - * - * © 2018 by Richard Walters - */ - -#include <gtest/gtest.h> -#include <src/PercentEncodedCharacterDecoder.hpp> -#include <stddef.h> -#include <vector> - -TEST(PercentEncodedCharacterDecoderTests, GoodSequences) { - Uri::PercentEncodedCharacterDecoder pec; - struct TestVector { - char sequence[2]; - char expectedOutput; - }; - const std::vector< TestVector > testVectors{ - {{'4', '1'}, 'A'}, - {{'5', 'A'}, 'Z'}, - {{'6', 'e'}, 'n'}, - {{'e', '1'}, (char)0xe1}, - {{'C', 'A'}, (char)0xca}, - }; - size_t index = 0; - for (auto testVector: testVectors) { - pec = Uri::PercentEncodedCharacterDecoder(); - ASSERT_FALSE(pec.Done()); - ASSERT_TRUE(pec.NextEncodedCharacter(testVector.sequence[0])); - ASSERT_FALSE(pec.Done()); - ASSERT_TRUE(pec.NextEncodedCharacter(testVector.sequence[1])); - ASSERT_TRUE(pec.Done()); - ASSERT_EQ(testVector.expectedOutput, pec.GetDecodedCharacter()) << index; - ++index; - } -} - -TEST(PercentEncodedCharacterDecoderTests, BadSequences) { - Uri::PercentEncodedCharacterDecoder pec; - std::vector< char > testVectors{ - 'G', 'g', '.', 'z', '-', ' ', 'V', - }; - for (auto testVector: testVectors) { - pec = Uri::PercentEncodedCharacterDecoder(); - ASSERT_FALSE(pec.Done()); - ASSERT_FALSE(pec.NextEncodedCharacter(testVector)); - } -} |