From 799f2d02bea9bb16780bce01d4f3d831954bf9f0 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sun, 5 Dec 2021 01:44:45 +0100 Subject: remove C++ implementation --- test/src/PercentEncodedCharacterDecoderTests.cpp | 50 ------------------------ 1 file changed, 50 deletions(-) delete mode 100644 test/src/PercentEncodedCharacterDecoderTests.cpp (limited to 'test/src/PercentEncodedCharacterDecoderTests.cpp') 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 -#include -#include -#include - -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)); - } -} -- cgit v1.2.3