incremental
diff --git a/.clang-format b/.clang-format
index 5f8caed..17d370f 100644
--- a/.clang-format
+++ b/.clang-format
@@ -72,7 +72,7 @@
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
-SortIncludes: false
+SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
diff --git a/include/InternalMode.h b/include/InternalMode.h
deleted file mode 100644
index 1a75b91..0000000
--- a/include/InternalMode.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "regs-video.h"
-
-INTERNAL_MODE Internal_Mode[] = {
-// 1024x768
- {1024, 768, 0, 65.000},
- {1024, 768, 1, 65.000},
- {1024, 768, 2, 75.000},
- {1024, 768, 3, 78.750},
- {1024, 768, 4, 94.500},
-// 1280x1024
- {1280, 1024, 0, 108.000},
- {1280, 1024, 1, 108.000},
- {1280, 1024, 2, 135.000},
- {1280, 1024, 3, 157.500},
-// 1600x1200
- {1600, 1200, 0, 162.000},
- {1600, 1200, 1, 162.000},
- {1600, 1200, 2, 175.500},
- {1600, 1200, 3, 189.000},
- {1600, 1200, 4, 202.500},
- {1600, 1200, 5, 229.500},
-// 1920x1200 reduce blank
- {1920, 1200, 0, 157.000},
- {1920, 1200, 1, 157.000},
-};
-uint16_t InternalEnhanceModeNumberCount = sizeof (Internal_Mode) / sizeof (INTERNAL_MODE);
diff --git a/include/ast_jpeg_decoder.hpp b/include/ast_jpeg_decoder.hpp
index 7e09678..e7b36dc 100644
--- a/include/ast_jpeg_decoder.hpp
+++ b/include/ast_jpeg_decoder.hpp
@@ -1,26 +1,25 @@
#pragma once
-#include <cstdint>
#include <array>
#include <aspeed/JTABLES.H>
+#include <ast_video_types.hpp>
+#include <cassert>
+#include <cstdint>
+#include <iostream>
#include <vector>
-#include <ast_video_types.hpp>
-#include <iostream>
+template <class T, class Compare>
+constexpr const T &clamp(const T &v, const T &lo, const T &hi, Compare comp) {
+ return assert(!comp(hi, lo)), comp(v, lo) ? lo : comp(hi, v) ? hi : v;
+}
+
+template <class T>
+constexpr const T &clamp(const T &v, const T &lo, const T &hi) {
+ return clamp(v, lo, hi, std::less<>());
+}
namespace AstVideo {
-static const uint32_t VQ_HEADER_MASK = 0x01;
-static const uint32_t VQ_NO_UPDATE_HEADER = 0x00;
-static const uint32_t VQ_UPDATE_HEADER = 0x01;
-static const int VQ_NO_UPDATE_LENGTH = 0x03;
-static const int VQ_UPDATE_LENGTH = 0x1B;
-static const uint32_t VQ_INDEX_MASK = 0x03;
-static const uint32_t VQ_COLOR_MASK = 0xFFFFFF;
-
-static const int BLOCK_AST2100_START_LENGTH = 0x04;
-static const int BLOCK_AST2100_SKIP_LENGTH = 20; // S:1 H:3 X:8 Y:8
-
struct COLOR_CACHE {
unsigned long Color[4];
unsigned char Index[4];
@@ -541,15 +540,9 @@
pYUV[n].B = cb;
pYUV[n].G = y;
pYUV[n].R = cr;
- pByte[n].B = rlimit_table[m_Y[y] + m_CbToB[cb]];
- pByte[n].G = rlimit_table[m_Y[y] + m_CbToG[cb] + m_CrToG[cr]];
- pByte[n].R = rlimit_table[m_Y[y] + m_CrToR[cr]];
- /*
- std::cout << "set y:" << n / 800 << " x:" << n % 800 << " to "
- << " B:" << static_cast<uint32_t>(pByte[n].B)
- << " G:" << static_cast<uint32_t>(pByte[n].G)
- << " R:" << static_cast<uint32_t>(pByte[n].R) << "\n";
- */
+ pByte[n].B = clamp(m_Y[y] + m_CbToB[cb], 0, 0xFF);
+ pByte[n].G = clamp(m_Y[y] + m_CbToG[cb] + m_CrToG[cr], 0, 0xFF);
+ pByte[n].R = clamp(m_Y[y] + m_CrToR[cr], 0, 0xFF);
}
pos += WIDTH;
}
@@ -570,9 +563,9 @@
cb = pcb[m];
cr = pcr[m];
n = pos + i;
- pByte[n].B = rlimit_table[m_Y[y] + m_CbToB[cb]];
- pByte[n].G = rlimit_table[m_Y[y] + m_CbToG[cb] + m_CrToG[cr]];
- pByte[n].R = rlimit_table[m_Y[y] + m_CrToR[cr]];
+ pByte[n].B = clamp(m_Y[y] + m_CbToB[cb], 0, 0xFF);
+ pByte[n].G = clamp(m_Y[y] + m_CbToG[cb] + m_CrToG[cr], 0, 0xFF);
+ pByte[n].R = clamp(m_Y[y] + m_CrToR[cr], 0, 0xFF);
}
pos += WIDTH;
}
@@ -614,9 +607,9 @@
pYUV[n].B = cb;
pYUV[n].G = y;
pYUV[n].R = cr;
- pByte[n].B = rlimit_table[m_Y[y] + m_CbToB[cb]];
- pByte[n].G = rlimit_table[m_Y[y] + m_CbToG[cb] + m_CrToG[cr]];
- pByte[n].R = rlimit_table[m_Y[y] + m_CrToR[cr]];
+ pByte[n].B = clamp(m_Y[y] + m_CbToB[cb], 0, 0xFF);
+ pByte[n].G = clamp(m_Y[y] + m_CbToG[cb] + m_CrToG[cr], 0, 0xFF);
+ pByte[n].R = clamp(m_Y[y] + m_CrToR[cr], 0, 0xFF);
}
pos += WIDTH;
}
@@ -637,15 +630,15 @@
cb = pcb[m];
cr = pcr[m];
n = pos + i;
- pByte[n].B = rlimit_table[m_Y[y] + m_CbToB[cb]];
- pByte[n].G = rlimit_table[m_Y[y] + m_CbToG[cb] + m_CrToG[cr]];
- pByte[n].R = rlimit_table[m_Y[y] + m_CrToR[cr]];
+ pByte[n].B = clamp(m_Y[y] + m_CbToB[cb], 0, 0xFF);
+ pByte[n].G = clamp(m_Y[y] + m_CbToG[cb] + m_CrToG[cr], 0, 0xFF);
+ pByte[n].R = clamp(m_Y[y] + m_CrToR[cr], 0, 0xFF);
}
pos += WIDTH;
}
}
}
- int Decompress(int txb, int tyb, char *outBuf, uint8_t QT_TableSelection) {
+ void Decompress(int txb, int tyb, char *outBuf, uint8_t QT_TableSelection) {
unsigned char *ptr;
unsigned char byTileYuv[768] = {};
@@ -686,19 +679,10 @@
// YUVToRGB (txb, tyb, byTileYuv, (unsigned char *)outBuf);
// YUVBuffer for YUV record
YUVToRGB(txb, tyb, byTileYuv, YUVBuffer.data(), (unsigned char *)outBuf);
- if (txb == 0 && tyb == 0) {
- for (int i=0; i < 10; i++) {
- auto pixel = YUVBuffer[i];
- std::cout << "YUBuffer " << static_cast<int>(pixel.R) << " "
- << static_cast<int>(pixel.G) << static_cast<int>(pixel.B)
- << "\n";
- }
- }
- return 1;
}
- int Decompress_2PASS(int txb, int tyb, char *outBuf,
- uint8_t QT_TableSelection) {
+ void Decompress_2PASS(int txb, int tyb, char *outBuf,
+ uint8_t QT_TableSelection) {
unsigned char *ptr;
unsigned char byTileYuv[768];
memset(DCT_coeff, 0, 384 * 2);
@@ -717,12 +701,10 @@
YUVToBuffer(txb, tyb, byTileYuv, YUVBuffer.data(), (unsigned char *)outBuf);
// YUVToRGB (txb, tyb, byTileYuv, (unsigned char *)outBuf);
-
- return 1;
}
- int VQ_Decompress(int txb, int tyb, char *outBuf, uint8_t QT_TableSelection,
- struct COLOR_CACHE *VQ) {
+ void VQ_Decompress(int txb, int tyb, char *outBuf, uint8_t QT_TableSelection,
+ struct COLOR_CACHE *VQ) {
unsigned char *ptr, i;
unsigned char byTileYuv[192];
int Data;
@@ -747,23 +729,21 @@
}
// YUVToRGB (txb, tyb, byTileYuv, (unsigned char *)outBuf);
YUVToRGB(txb, tyb, byTileYuv, YUVBuffer.data(), (unsigned char *)outBuf);
-
- return 1;
}
void MoveBlockIndex(void) {
if (yuvmode == YuvMode::YUV444) {
txb++;
- if (txb >= (int)(tmp_WIDTH / 8)) {
+ if (txb >= (int)(WIDTH / 8)) {
tyb++;
- if (tyb >= (int)(tmp_HEIGHT / 8)) tyb = 0;
+ if (tyb >= (int)(HEIGHT / 8)) tyb = 0;
txb = 0;
}
} else {
txb++;
- if (txb >= (int)(tmp_WIDTH / 16)) {
+ if (txb >= (int)(WIDTH / 16)) {
tyb++;
- if (tyb >= (int)(tmp_HEIGHT / 16)) tyb = 0;
+ if (tyb >= (int)(HEIGHT / 16)) tyb = 0;
txb = 0;
}
}
@@ -780,7 +760,6 @@
VQ->Color[2] = 0x808080;
VQ->Color[3] = 0xC08080;
}
- void init_QT() {}
void Init_Color_Table() {
int i, x;
@@ -867,7 +846,6 @@
}
}
void init_jpg_table() {
- init_QT();
Init_Color_Table();
prepare_range_limit_table();
load_Huffman_table(&HTDC[0], std_dc_luminance_nrcodes,
@@ -1054,46 +1032,36 @@
uint32_t i;
COLOR_CACHE Decode_Color;
+ if (width != WIDTH || height != HEIGHT || yuvmode_in != yuvmode ||
+ y_selector != Y_selector || uv_selector != UV_selector) {
+ init_JPG_decoding();
+ }
+
// TODO(ed) use the enum everywhere, not just externally
- yuvmode = yuvmode_in; // 0 = YUV444, 1 = YUV420
+ yuvmode = yuvmode_in; // 0 = YUV444, 1 = YUV420
Y_selector = y_selector; // 0-7
UV_selector = uv_selector; // 0-7
// TODO(ed) Magic number section. Document appropriately
advance_selector = 0; // 0-7
- First_Frame = 1; // 0 or 1
Mapping = 0; // 0 or 1
- /*
- if (yuvmode == YuvMode::YUV420) {
- Y_selector = 4;
- UV_selector = 7;
- Mapping = 0;
- } else { // YUV444
- Y_selector = 7;
- UV_selector = 7;
- Mapping = 0;
- }
- */
- auto test = static_cast<int>(yuvmode);
- std::cout << "YUVmode " << test << " " << static_cast<int>(Y_selector) << static_cast<int>(UV_selector) << "\n";
- tmp_WIDTH = width;
- tmp_HEIGHT = height;
WIDTH = width;
HEIGHT = height;
VQ_Initialize(&Decode_Color);
// OutputDebugString ("In decode\n");
// GetINFData (VideoEngineInfo);
- // WIDTH = VideoEngineInfo->SourceModeInfo.X = 640;
- // HEIGHT = VideoEngineInfo->SourceModeInfo.Y = 480;
// AST2000 JPEG block is 16x16(pixels) base
+
if (yuvmode == YuvMode::YUV420) {
+ auto remainder = WIDTH % 16;
if (WIDTH % 16) {
- WIDTH = WIDTH + 16 - (WIDTH % 16);
+ WIDTH = WIDTH + 16 - remainder;
}
- if (HEIGHT % 16) {
- HEIGHT = HEIGHT + 16 - (HEIGHT % 16);
+ remainder = HEIGHT % 16;
+ if (remainder) {
+ HEIGHT = HEIGHT + 16 - remainder;
}
} else {
if (WIDTH % 8) {
@@ -1104,25 +1072,6 @@
}
}
- // tmp_WDITH, tmp_HEIGHT are for block position
- // tmp_WIDTH = VideoEngineInfo->DestinationModeInfo.X;
- // tmp_HEIGHT = VideoEngineInfo->DestinationModeInfo.Y;
- if (yuvmode == YuvMode::YUV420) {
- if (tmp_WIDTH % 16) {
- tmp_WIDTH = tmp_WIDTH + 16 - (tmp_WIDTH % 16);
- }
- if (tmp_HEIGHT % 16) {
- tmp_HEIGHT = tmp_HEIGHT + 16 - (tmp_HEIGHT % 16);
- }
- } else {
- if (tmp_WIDTH % 8) {
- tmp_WIDTH = tmp_WIDTH + 8 - (tmp_WIDTH % 8);
- }
- if (tmp_HEIGHT % 8) {
- tmp_HEIGHT = tmp_HEIGHT + 8 - (tmp_HEIGHT % 8);
- }
- }
-
int qfactor = 16;
SCALEFACTOR = qfactor;
@@ -1130,10 +1079,6 @@
ADVANCESCALEFACTOR = 16;
ADVANCESCALEFACTORUV = 16;
- if (First_Frame == 1) {
- init_jpg_table();
- init_JPG_decoding();
- }
// TODO(ed) cleanup cruft
Buffer = buffer.data();
@@ -1145,6 +1090,17 @@
newbits = 32;
DCY = DCCb = DCCr = 0;
+ static const uint32_t VQ_HEADER_MASK = 0x01;
+ static const uint32_t VQ_NO_UPDATE_HEADER = 0x00;
+ static const uint32_t VQ_UPDATE_HEADER = 0x01;
+ static const int VQ_NO_UPDATE_LENGTH = 0x03;
+ static const int VQ_UPDATE_LENGTH = 0x1B;
+ static const uint32_t VQ_INDEX_MASK = 0x03;
+ static const uint32_t VQ_COLOR_MASK = 0xFFFFFF;
+
+ static const int BLOCK_AST2100_START_LENGTH = 0x04;
+ static const int BLOCK_AST2100_SKIP_LENGTH = 20; // S:1 H:3 X:8 Y:8
+
do {
auto block_header = static_cast<JpgBlock>((codebuf >> 28) & 0xFF);
switch (block_header) {
@@ -1334,8 +1290,6 @@
// WIDTH and HEIGHT are the modes your display used
unsigned long WIDTH;
unsigned long HEIGHT;
- unsigned long tmp_HEIGHT;
- unsigned long tmp_WIDTH;
unsigned char Y_selector;
int SCALEFACTOR;
int SCALEFACTORUV;
@@ -1344,7 +1298,6 @@
int Mapping;
unsigned char UV_selector;
unsigned char advance_selector;
- unsigned char First_Frame;
int byte_pos; // current byte position
// quantization tables, no more than 4 quantization tables
diff --git a/include/ast_video_puller.hpp b/include/ast_video_puller.hpp
index 99c718b..d1ba3d5 100644
--- a/include/ast_video_puller.hpp
+++ b/include/ast_video_puller.hpp
@@ -1,12 +1,10 @@
#pragma once
-#include <vector>
#include <assert.h>
-
-#include <ast_video_types.hpp>
-
#include <video.h>
+#include <ast_video_types.hpp>
#include <iostream>
+#include <vector>
namespace AstVideo {
class VideoPuller {
@@ -49,7 +47,7 @@
std::cout << "Write failed. Return: " << status << "\n";
perror("perror output:");
}
-
+
std::cout << "Write done\n";
*/
std::cout << "Reading\n";
diff --git a/include/big_list_of_naughty_strings.hpp b/include/big_list_of_naughty_strings.hpp
index 2d1ca0d..fd492ce 100644
--- a/include/big_list_of_naughty_strings.hpp
+++ b/include/big_list_of_naughty_strings.hpp
@@ -1,27 +1,39 @@
const std::string naughty_strings[] = {
- // sourced from https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.txt
+ // sourced from
+ // https://raw.githubusercontent.com/minimaxir/big-list-of-naughty-strings/master/blns.txt
// Reserved Strings
//
// Strings which may be used elsewhere in code
- "undefined", "undef", "null", "NULL", "(null)", "nil", "NIL", "true", "false", "True", "False", "TRUE", "FALSE", "None", "hasOwnProperty", "\\", "\\\\",
+ "undefined", "undef", "null", "NULL", "(null)", "nil", "NIL", "true",
+ "false", "True", "False", "TRUE", "FALSE", "None", "hasOwnProperty", "\\",
+ "\\\\",
// Numeric Strings
//
// Strings which can be interpreted as numeric
- "0", "1", "1.00", "$1.00", "1/2", "1E2", "1E02", "1E+02", "-1", "-1.00", "-$1.00", "-1/2", "-1E2", "-1E02", "-1E+02", "1/0", "0/0", "-2147483648/-1",
- "-9223372036854775808/-1", "-0", "-0.0", "+0", "+0.0", "0.00", "0..0", ".", "0.0.0", "0,00", "0,,0", ",", "0,0,0", "0.0/0", "1.0/0.0", "0.0/0.0", "1,0/0,0",
- "0,0/0,0", "--1", "-", "-.", "-,", "999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999", "NaN", "Infinity",
- "-Infinity", "INF", "1#INF", "-1#IND", "1#QNAN", "1#SNAN", "1#IND", "0x0", "0xffffffff", "0xffffffffffffffff", "0xabad1dea",
- "123456789012345678901234567890123456789", "1,000.00", "1 000.00", "1'000.00", "1,000,000.00", "1 000 000.00", "1'000'000.00", "1.000,00", "1 000,00",
- "1'000,00", "1.000.000,00", "1 000 000,00", "1'000'000,00", "01000", "08", "09", "2.2250738585072011e-308",
+ "0", "1", "1.00", "$1.00", "1/2", "1E2", "1E02", "1E+02", "-1", "-1.00",
+ "-$1.00", "-1/2", "-1E2", "-1E02", "-1E+02", "1/0", "0/0", "-2147483648/-1",
+ "-9223372036854775808/-1", "-0", "-0.0", "+0", "+0.0", "0.00", "0..0", ".",
+ "0.0.0", "0,00", "0,,0", ",", "0,0,0", "0.0/0", "1.0/0.0", "0.0/0.0",
+ "1,0/0,0", "0,0/0,0", "--1", "-", "-.", "-,",
+ "99999999999999999999999999999999999999999999999999999999999999999999999999"
+ "9999999999999999999999",
+ "NaN", "Infinity", "-Infinity", "INF", "1#INF", "-1#IND", "1#QNAN",
+ "1#SNAN", "1#IND", "0x0", "0xffffffff", "0xffffffffffffffff", "0xabad1dea",
+ "123456789012345678901234567890123456789", "1,000.00", "1 000.00",
+ "1'000.00", "1,000,000.00", "1 000 000.00", "1'000'000.00", "1.000,00",
+ "1 000,00", "1'000,00", "1.000.000,00", "1 000 000,00", "1'000'000,00",
+ "01000", "08", "09", "2.2250738585072011e-308",
// Special Characters
//
- // ASCII punctuation. All of these characters may need to be escaped in some
- // contexts. Divided into three groups based on (US-layout) keyboard position.
+ // ASCII punctuation. All of these characters may need to be escaped in
+ // some
+ // contexts. Divided into three groups based on (US-layout) keyboard
+ // position.
",./;'[]\\-=", "<>?:\"{}|_+", "!@#$%^&*()`~",
@@ -33,31 +45,49 @@
// The next line may appear to be blank or mojibake in some viewers.
"",
- // Non-whitespace C1 controls: U+0080 through U+0084 and U+0086 through U+009F.
+ // Non-whitespace C1 controls: U+0080 through U+0084 and U+0086 through
+ // U+009F.
// Commonly misinterpreted as additional graphic characters.
- // The next line may appear to be blank, mojibake, or dingbats in some viewers.
+ // The next line may appear to be blank, mojibake, or dingbats in some
+ // viewers.
"ᅡタᅡチᅡツᅡテᅡトᅡニᅡヌᅡネᅡノᅡハᅡヒᅡフᅡヘᅡホᅡマᅡミᅡムᅡメᅡモᅡヤᅡユᅡヨᅡラᅡリᅡルᅡレᅡロᅡワᅡンᅡ゙ᅡ゚",
// Whitespace: all of the characters with category Zs, Zl, or Zp (in Unicode
// version 8.0.0), plus U+0009 (HT), U+000B (VT), U+000C (FF), U+0085 (NEL),
- // and U+200B (ZERO WIDTH SPACE), which are in the C categories but are often
+ // and U+200B (ZERO WIDTH SPACE), which are in the C categories but are
+ // often
// treated as whitespace in some contexts.
// This file unfortunately cannot express strings containing
// U+0000, U+000A, or U+000D (NUL, LF, CR).
// The next line may appear to be blank or mojibake in some viewers.
// The next line may be flagged for \"trailing whitespace\" in some viewers.
- " ", " ᅡナ £レタ¬タタ¬タチ¬タツ¬タテ¬タト¬タナ¬タニ¬タヌ¬タネ¬タノ¬タハ¬タヒ¬タᄄ¬タᄅ¬タᆵ¬チ゚ ̄タタ",
+ " ",
+ " ᅡナ "
+ "£レタ¬タタ¬タチ¬タツ¬タテ¬タト¬タナ¬タニ¬タヌ¬タネ¬タノ¬タハ¬タヒ¬タᄄ¬タᄅ¬タᆵ¬チ゚ ̄タタ",
// Unicode additional control characters: all of the characters with
// general category Cf (in Unicode 8.0.0).
// The next line may appear to be blank or mojibake in some viewers.
- "ᅡᆳタチツテトナワᅴンᅵマ£ᅠホ¬タヒ¬タフ¬タヘ¬タホ¬タマ¬タᆰ¬タᆱ¬タᆲ¬タᆳ¬タᆴ¬チᅠ¬チᄀ¬チᄁ¬チᆪ¬チᄂ¬チᆭ¬チᄃ¬チᄄ¬チᄅ¬チᆰ¬チᆱ¬チᆲ¬チᆳ¬チᆴ¬チᆵᄏ"
- "ᄍᄎᄏムツᄑロᄇᅠロᄇᄀロᄇᄁロᄇᆪンナᄈンナᄡンナᄉンナᄊンナᄋンナᄌンナᄍンナᄎᅠタチᅠタᅠᅠタᄀᅠタᄁᅠタᆪᅠタᄂᅠ"
- "タᆬᅠタᆭᅠタᄃᅠタᄄᅠタᄅᅠタᆰᅠタᆱᅠタᆲᅠタᆳᅠタᆴᅠタᆵᅠタᄚᅠタᄆᅠタᄇᅠタᄈᅠタᄡᅠタᄉᅠタᄊᅠタᄋᅠタᄌ"
- "ᅠタᄍᅠタᄎᅠタᄏᅠタᄐᅠタᄑᅠタᄒᅠタᅠチタᅠチチᅠチツᅠチテᅠチトᅠチナᅠチニᅠチヌᅠチネᅠチノᅠチハᅠチヒ"
- "ᅠチフᅠチヘᅠチホᅠチマᅠチミᅠチムᅠチメᅠチモᅠチヤᅠチユᅠチヨᅠチラᅠチリᅠチルᅠチレᅠチロᅠチワᅠチンᅠヂ"
- "ᅠチ゚ᅠチᅠᅠチᄀᅠチᄁᅠチᆪᅠチᄂᅠチᆬᅠチᆭᅠチᄃᅠチᄄᅠチᄅᅠチᆰᅠチᆱᅠチᆲᅠチᆳᅠチᆴᅠチᆵᅠチᄚᅠチᄆ"
- "ᅠチᄇᅠチᄈᅠチᄡᅠチᄉᅠチᄊᅠチᄋᅠチᄌᅠチᄍᅠチᄎᅠチᄏᅠチᄐᅠチᄑᅠチᄒᅠチ"
+ "ᅡᆳタチツテトナワᅴンᅵマ£ᅠホ¬タヒ¬タフ¬タヘ¬タホ¬タマ¬タᆰ¬タᆱ¬タᆲ¬"
+ "タᆳ¬タᆴ¬チᅠ¬チᄀ¬チᄁ¬チᆪ¬チᄂ¬チᆭ¬チᄃ¬チᄄ¬チᄅ¬チᆰ¬チᆱ¬チᆲ¬チᆳ¬チᆴ¬チᆵᄏ"
+ ""
+ "ᄍᄎᄏムツᄑロᄇᅠロᄇᄀロᄇᄁロᄇᆪンナᄈンナᄡンナᄉンナᄊ"
+ "ンナᄋンナᄌンナᄍンナᄎᅠタチᅠタᅠᅠタᄀᅠタᄁᅠタᆪᅠタᄂ"
+ "ᅠ"
+ "タᆬᅠタᆭᅠタᄃᅠタᄄᅠタᄅᅠタᆰᅠタᆱᅠタᆲᅠタᆳᅠタᆴ"
+ "ᅠタᆵᅠタᄚᅠタᄆᅠタᄇᅠタᄈᅠタᄡᅠタᄉᅠタᄊᅠタᄋ"
+ "ᅠタᄌ"
+ "ᅠタᄍᅠタᄎᅠタᄏᅠタᄐᅠタᄑᅠタᄒᅠタᅠチタᅠチチ"
+ "ᅠチツᅠチテᅠチトᅠチナᅠチニᅠチヌᅠチネᅠチノᅠチハ"
+ "ᅠチヒ"
+ "ᅠチフᅠチヘᅠチホᅠチマᅠチミᅠチムᅠチメᅠチモᅠチヤ"
+ "ᅠチユᅠチヨᅠチラᅠチリᅠチルᅠチレᅠチロᅠチワᅠチン"
+ "ᅠヂ"
+ "ᅠチ゚ᅠチᅠᅠチᄀᅠチᄁᅠチᆪᅠチᄂᅠチᆬᅠチᆭᅠチᄃ"
+ "ᅠチᄄᅠチᄅᅠチᆰᅠチᆱᅠチᆲᅠチᆳᅠチᆴᅠチᆵᅠチᄚ"
+ "ᅠチᄆ"
+ "ᅠチᄇᅠチᄈᅠチᄡᅠチᄉᅠチᄊᅠチᄋᅠチᄌᅠチᄍᅠチᄎ"
+ "ᅠチᄏᅠチᄐᅠチᄑᅠチᄒᅠチ"
"",
// \"Byte order marks\", U+FEFF and U+FFFE, each on its own line.
@@ -68,48 +98,81 @@
//
// Strings which contain common unicode symbols (e.g. smart quotes)
- "ᅫᄅ¬ノネᅢᄃ¬ネレ¬ネᆱᅨワᅡᄉ¬ノᄂ¬ノᆬᅢᄋ", "ᅢᆬᅢ゚¬ネツᅥメᅡ례ル¬ネニᅨレᅡᆲ¬タᆭᅢᆭ", "ᅤモ¬ネムᅡᄡᅡᆴ¬タᅠᅡᆬᅡ뗴ニᅢ죄タ¬タワ¬タリ",
- "ᅡᄀ¬ト깏ᅡᄁ¬ネ゙ᅡ다ᄊ¬タ깕ᅡᄎ¬タモ¬ノᅠ",
- "ᅡ졔ロᅢヌ¬ラハᅣ몌ワᅢツᅡᆵᅨリᅡ", "ᅢナᅢヘᅢホᅢマᅨンᅢモᅢヤᆪᅢメᅢレᅢニ¬リテ",
- "ᅤメ¬ダᅡᄡ¬タᄚᅨヌᅢチᅡ뗴ニᅢリ¬ネマ¬タン¬タル", "`¬チト¬ツᆲ¬タᄍ¬タᄎᆲチᆲツ¬タ가ᄚᅡᄋ¬タレ¬タヤᅡᄆ",
+ "ᅫᄅ¬ノネᅢᄃ¬ネレ¬ネᆱᅨワᅡᄉ¬ノᄂ¬ノᆬᅢᄋ", "ᅢᆬᅢ゚¬ネツᅥメᅡ례ル¬ネニᅨレᅡᆲ¬タᆭᅢᆭ",
+ "ᅤモ¬ネムᅡᄡᅡᆴ¬タᅠᅡᆬᅡ뗴ニᅢ죄タ¬タワ¬タ"
+ "リ",
+ "ᅡᄀ¬ト깏ᅡᄁ¬ネ゙ᅡ다ᄊ¬タ깕ᅡᄎ¬タモ¬ノ"
+ "ᅠ",
+ "ᅡ졔ロᅢヌ¬ラハᅣ몌ワᅢツᅡᆵᅨリᅡ",
+ "ᅢナᅢヘᅢホᅢマᅨンᅢモᅢヤᆪᅢメᅢレᅢニ¬リ"
+ "テ",
+ "ᅤメ¬ダᅡᄡ¬タᄚᅨヌᅢチᅡ뗴ニᅢリ¬ネマ¬タン¬タル",
+ "`¬チト¬ツᆲ¬タᄍ¬タᄎᆲチᆲツ¬タ가ᄚᅡᄋ¬タレ¬タヤᅡ"
+ "ᄆ",
"¬ナロ¬ナワ¬ナン¬ナ゙",
- "チツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚ᅠᄀᄁᆪᄂᆬᆭ"
- "ᄃᄄᄅᆰᆱᆲᆳᆴᆵᄚᄆᄇᄈᄡᄉᄊᄋᄌᄍᄎᄏᄐᄑᄒタチツテトナニヌネノハヒフ"
+ "チツテトナニヌネノハヒフヘホマミムメ"
+ "モヤユヨラリルレロワン゙゚ᅠᄀᄁᆪᄂ"
+ "ᆬᆭ"
+ "ᄃᄄᄅᆰᆱᆲᆳᆴᆵᄚᄆᄇᄈᄡᄉᄊᄋᄌ"
+ "ᄍᄎᄏᄐᄑᄒタチツテトナニヌネノハ"
+ "ヒフ"
"ヘホマ",
"ᅠᄀᄁᆪᄂᆬᆭᄃᄄᄅ",
// Unicode Subscript/Superscript/Accents
//
- // Strings which contain unicode subscripts/superscripts; can cause rendering issues
+ // Strings which contain unicode subscripts/superscripts; can cause
+ //rendering issues
"¬チᄚ¬チᄡ¬チᄉ", "¬ツタ¬ツチ¬ツツ", "¬チᄚ¬チᄡ¬チᄉ¬ツタ¬ツチ¬ツツ",
- "¢ᄌヤ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢"
- "ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ"
+ "¢ᄌヤ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢"
+ "ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ"
+ "¢ᄍノ¢"
+ "ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ"
+ "¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢"
+ "ᄍヌ¢ᄍヌ"
"¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ "
- "¢ᄌヤ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢"
- "ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ"
+ "¢ᄌヤ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢"
+ "ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ"
+ "¢ᄍノ¢"
+ "ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ"
+ "¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢"
+ "ᄍヌ¢ᄍヌ"
"¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ "
- "¢ᄌヤ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢"
- "ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ"
+ "¢ᄌヤ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢"
+ "ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ"
+ "¢ᄍノ¢"
+ "ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ"
+ "¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢"
+ "ᄍヌ¢ᄍヌ"
"¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍノ¢ᄍヌ¢ᄍヌ¢ᄍヌ¢ᄍヌ",
// Quotation Marks
//
- // Strings which contain misplaced quotation marks; can cause encoding errors
+ // Strings which contain misplaced quotation marks; can cause encoding
+ //errors
- "'", "\"", "''", "\"\"", "'\"'", "\"''''\"'\"", "\"'\"'\"''''\"", "<foo val=¬タワbar¬タン />", "<foo val=¬タワbar¬タン />", "<foo val=¬タンbar¬タワ />",
- "<foo val=`bar' />",
+ "'", "\"", "''", "\"\"", "'\"'", "\"''''\"'\"", "\"'\"'\"''''\"",
+ "<foo val=¬タワbar¬タン />", "<foo val=¬タワbar¬タン />",
+ "<foo val=¬タンbar¬タワ />", "<foo val=`bar' />",
// Two-Byte Characters
//
- // Strings which contain two-byte characters: can cause rendering issues or character-length issues
+ // Strings which contain two-byte characters: can cause rendering issues or
+ //character-length issues
- "ヤᄚ¦ᄌᆳ ̄チユ ̄ツモ ̄チᆱ ̄チツ ̄チメ ̄チᆭ¦ᄌヒ ̄チユ ̄チト", " ̄テム ̄テᄐ ̄テニ ̄ツᆪ ̄テᄐ ̄チᄌ│ᄀフ ̄チヒ ̄チᆰ ̄チト ̄チヒ",
- "¥メフ│ᆪᄑ₩ᄐᄁ│ᆰ゙", "←テᄄ│ミᄑ₩ᅠᄐ", "↓ツᆲ■レフ↑ᄈᄐ■ユル↓ロミ ↓ヨᄡ■ユル↓ラᄚ↑ᄉᆲ↓ニフ",
- "↓ᄚᆭ↓ᄚᄄ→ᆬᄐ ■テタ↑ᄈᅠ ↓リᄄ ■ホᄇ↓ヒワ→ᄃᄄ↑ᄈᄐ ↓ムロ→ヒᄂ→ᆭᆲ "
+ "ヤᄚ¦ᄌᆳ ̄チユ ̄ツモ ̄チᆱ ̄チツ ̄チメ ̄チᆭ¦ᄌヒ ̄チユ ̄チ"
+ "ト",
+ " ̄テム ̄テᄐ ̄テニ ̄ツᆪ ̄テᄐ ̄チᄌ│ᄀフ ̄チヒ ̄チᆰ ̄チト ̄チヒ", "¥メフ│ᆪᄑ₩ᄐᄁ│ᆰ゙",
+ "←テᄄ│ミᄑ₩ᅠᄐ", "↓ツᆲ■レフ↑ᄈᄐ■ユル↓ロミ ↓ヨᄡ■ユル↓ラᄚ↑ᄉᆲ↓ニフ",
+ "↓ᄚᆭ↓ᄚᄄ→ᆬᄐ ■テタ↑ᄈᅠ ↓リᄄ ■ホᄇ↓ヒワ→ᄃᄄ↑ᄈᄐ "
+ "↓ムロ→ヒᄂ→ᆭᆲ "
"→リᅠ→ᄚᄅ↑ᄚチ■ユリ",
- "ᄂᄒ₩ワテᄃム¥ᆳᄌ←ルᄁ│ᆰ゙¥ᆳᄌᅠヤᄅᄊ₩ノタ", "↓レᄌ→゙タ→ᄚヤ■ニᅠ→ᆬᄡ",
- "ᅠワホᅠワᄆᅠンᄍᅠᄆモᅠᄆᄌᅠᄇヨᅠᄈマ",
+ "ᄂᄒ₩ワテᄃム¥ᆳᄌ←ルᄁ│ᆰ゙¥ᆳᄌᅠヤᄅᄊ₩ノ"
+ "タ",
+ "↓レᄌ→゙タ→ᄚヤ■ニᅠ→ᆬᄡ",
+ "ᅠワホᅠワᄆᅠンᄍᅠᄆモᅠᄆᄌᅠᄇヨᅠᄈ"
+ "マ",
// Changing length when lowercased
//
@@ -120,27 +183,42 @@
// Japanese Emoticons
//
- // Strings which consists of Japanese-style emoticons which are popular on the web
+ // Strings which consists of Japanese-style emoticons which are popular on
+ //the web
- " ̄テᄑ¢ᄐᄐ¢ᄎネトᅪワ¢ᄎネ¢ᄐᄑᄒノ  ̄テᄑ¢ᄐᄐ¢ᄎネトᅪワ¢ᄎネ¢ᄐᄑᄒノ",
- "(ᄑᄀ¬ラユ ¬ネタ ¬ラユᄑᄀ)", "ᄑタᄑᄄ(ᅡᄡ¬ネタᄑタ¬ネᄅ", "__ᄒロ(,_,*)",
+ " ̄テᄑ¢ᄐᄐ¢ᄎネトᅪワ¢ᄎネ¢ᄐᄑᄒノ "
+ " ̄テᄑ¢ᄐᄐ¢ᄎネトᅪワ¢ᄎネ¢ᄐᄑᄒノ",
+ "(ᄑᄀ¬ラユ ¬ネタ ¬ラユᄑᄀ)",
+ "ᄑタᄑᄄ(ᅡᄡ¬ネタᄑタ¬ネᄅ", "__ᄒロ(,_,*)",
" ̄テᄏ(ᆪ¬ネタᆪ) ̄テᄏ:*:",
- "ᄒ゚ᄑᆬ¬ワ ̄テᄒ¬ユᄇ(ᄑᄀ¬ラユ¬タ¬ラユᄑᄀ)¬ユᄆ¬ワᄑᆬᄒ゚",
+ "ᄒ゚ᄑᆬ¬ワ ̄テᄒ¬ユᄇ(ᄑᄀ¬ラユ¬タ¬ラユᄑᄀ)"
+ "¬ユᄆ¬ワᄑᆬᄒ゚",
", ̄タツ ̄テᄏ:*: ̄テᄏ ̄ツワ¬タル( ¬リᄏ ᅬノ ¬リᄏ ) ̄タツ ̄テᄏ:*: ̄テᄏ ̄ツワ¬タル",
- "(¬ユᆵᅡᄚ¬ヨ가ᄚᄐノ¬ユᆵᄌᄉ ¬ヤᄏ¬ヤチ¬ヤᄏ)",
- "(ᄒノ¢ᄇᆬロハ¢ᄇᆬᄐノᄒノᄏ ¬ヤᄏ¬ヤチ¬ヤᄏ", "¬ヤᆲ¬ヤタ¬ヤᆲ ̄テホ( ᅡᄎ _ ᅡᄎ ̄テホ)", "( ᅪ가ᄚ ᅪワᅧヨ ᅪ가ᄚ)",
+ "(¬ユᆵᅡᄚ¬ヨ가ᄚᄐノ¬ユᆵᄌᄉ "
+ "¬ヤᄏ¬ヤチ¬ヤᄏ)",
+ "(ᄒノ¢ᄇᆬロハ¢ᄇᆬᄐノᄒノᄏ "
+ "¬ヤᄏ¬ヤチ¬ヤᄏ",
+ "¬ヤᆲ¬ヤタ¬ヤᆲ ̄テホ( ᅡᄎ _ ᅡᄎ ̄テホ)", "( ᅪ가ᄚ ᅪワᅧヨ ᅪ가ᄚ)",
// Emoji
//
- // Strings which contain Emoji; should be the same behavior as two-byte characters, but not always
+ // Strings which contain Emoji; should be the same behavior as two-byte
+ //characters, but not always
- "゚リヘ", "゚ムᄅ゚マᄑ", "゚ムᄒ ゚ルヌ ゚メチ ゚ルナ ゚ルニ ゚ルヒ ゚ルホ ゚ルヘ",
+ "゚リヘ", "゚ムᄅ゚マᄑ",
+ "゚ムᄒ ゚ルヌ ゚メチ ゚ルナ ゚ルニ ゚ルヒ ゚ルホ "
+ "゚ルヘ",
"゚ミᄉ ゚ルネ ゚ルノ ゚ルハ",
- "¬ンᄂᄌマ ゚メヤ ゚メフ ゚メユ ゚メ゙ ゚メモ ゚メラ ゚メヨ ゚メリ ゚メン ゚メ゚ ゚メワ ゚メロ ゚メレ "
+ "¬ンᄂᄌマ ゚メヤ ゚メフ ゚メユ ゚メ゙ ゚メモ ゚メラ ゚メヨ ゚メリ ゚メン "
+ "゚メ゚ ゚メワ ゚メロ ゚メレ "
"゚メル",
- "¬ワピマ ゚メᆰ゚マ ゚ムミ゚マ ゚ルプマ ゚ムマ゚マ ゚ルマ゚マ",
- "゚レᄒ ゚ニメ ゚ニモ ゚ニユ ゚ニヨ ゚ニラ ゚ニル ゚マᄃ",
- "0ᄌマ¬テᆪ 1ᄌマ¬テᆪ 2ᄌマ¬テᆪ 3ᄌマ¬テᆪ 4ᄌマ¬テᆪ 5ᄌマ¬テᆪ 6ᄌマ¬テᆪ 7ᄌマ¬テᆪ 8ᄌマ¬テᆪ 9ᄌマ¬テᆪ "
+ "¬ワピマ ゚メᆰ゚マ ゚ムミ゚マ ゚ルプマ ゚ムマ゚マ "
+ "゚ルマ゚マ",
+ "゚レᄒ ゚ニメ ゚ニモ ゚ニユ ゚ニヨ ゚ニラ ゚ニル "
+ "゚マᄃ",
+ "0ᄌマ¬テᆪ 1ᄌマ¬テᆪ 2ᄌマ¬テᆪ 3ᄌマ¬テᆪ 4ᄌマ¬テᆪ 5ᄌマ¬テᆪ "
+ "6ᄌマ¬テᆪ 7ᄌマ¬テᆪ 8ᄌマ¬テᆪ "
+ "9ᄌマ¬テᆪ "
"゚ヤ゚",
// Regional Indicator Symbols
@@ -148,66 +226,108 @@
// Regional Indicator Symbols can be displayed differently across
// fonts, and have a number of special behaviors
- "゚ヌᄎ゚ヌᄌ゚ヌᄋ゚ヌᄎ゚ヌᄌ ゚ヌᆭ゚ヌᆱ゚ヌᆭ゚ヌᄇ゚ヌᄌ",
- "゚ヌᄎ゚ヌᄌ゚ヌᄋ゚ヌᄎ゚ヌᄌ゚ヌᆭ゚ヌᆱ゚ヌᆭ゚ヌᄇ",
+ "゚ヌᄎ゚ヌᄌ゚ヌᄋ゚ヌᄎ゚ヌᄌ "
+ "゚ヌᆭ゚ヌᆱ゚ヌᆭ゚ヌᄇ゚ヌᄌ",
+ "゚ヌᄎ゚ヌᄌ゚ヌᄋ゚ヌᄎ゚ヌᄌ゚ヌᆭ゚ヌᆱ゚ヌᆭ゚ヌ"
+ "ᄇ",
"゚ヌᄎ゚ヌᄌ゚ヌᄋ゚ヌᄎ゚ヌᄌ゚ヌᆭ",
// Unicode Numbers
//
- // Strings which contain unicode numbers; if the code is localized, it should see the input as numeric
+ // Strings which contain unicode numbers; if the code is localized, it
+ //should see the input as numeric
"ᄐムᄐメᄐモ", "ᄀᄁᆪ",
// Right-To-Left Strings
//
- // Strings which contain text that should be rendered RTL if possible (e.g. Arabic, Hebrew)
+ // Strings which contain text that should be rendered RTL if possible (e.g.
+ //Arabic, Hebrew)
- "ᆱナ ニチᄈ ᄈツᄋᆰ ネᄄᄃトᆰᆳᆵハᆵフ, ᆲᄇハᄆᆰハ ᄄᄃᄈᆰᆴᆵᄃナ ᆪニ "
- "ᆵニネ. ᆬᄚ ヌニᄃ゚ ᄃトᄈᆰᄃᄆ ネᆰニᄉハᄄ テᄃニ. ᆪヌムト ᄃハᄋᄃトハᄃフ "
- "ᄄᄆハᄋᄃニハᄃ-チᄆニᄈᄃ ツᆵ ᆪᆴᄚ. ᄈトハナᄃニフ ᆬᆰチᄃツハᄅ ᄄハニ "
- "ナᄃ, ハᄚテᄆ ᄃトᆳᆵネᆵ ᆪハ ᄄᄍᆵ, ナᄍᄃナトᄅ ᄄネトニᆵᄃフ "
- "ᄃトᆬᄋトᄃツ ᄍト ᆬハネ.",
- "ᅲムᅱᄚᅱ튜뛰슈ミᅲ뤼ᄡᅲチᅲルᅲᆰ, ᅲムᅱ쥐튜뛰쥬ミ ᅲミᅱ뮤ワᅱ쮸ヤᅱᄡᅲルᅲン, ᅲミᅱ슑 ᅲヤᅱ유뤼쥐튜チᅲ゙ᅱ유ルᅱᄡᅲン, ᅲユᅱᄚᅲミᅱ슑 ᅲヤᅱ쥬ミᅱ쥬뛰쓙",
- "ᅲヤᅱ쥬ルᅱᄚᅲᆰᅱ쥬ヤtestᄃトᄉチᆳᄃᆰ ᄃトᆰムᆳネト", "ᄋᄑ",
- "ᄋᄎ",
- "ナマニホᄃツホᄡホᄅマ ᄈマᄄマトミ ᄃミᄈメᆰミᆴメᆵホᄃナミ "
- "ᄃトトムマᄎホᄅミ チミハ ᄃトニムマᄌマナミ ᄃトメツホᄃᆭミナホᄅミ "
- "ネホチミハナ ハホᆴマᄉムホ ᄃトᆰムホᄋメᄄミハツホᄃᆰマ "
- "ᄃトメᆳᄃᄈマネᄄミハムホᄅマフ ",
+ "ᆱナ ニチᄈ ᄈツᄋᆰ "
+ "ネᄄᄃトᆰᆳᆵハᆵフ, ᆲᄇハᄆᆰハ "
+ "ᄄᄃᄈᆰᆴᆵᄃナ ᆪニ "
+ "ᆵニネ. ᆬᄚ ヌニᄃ゚ ᄃトᄈᆰᄃᄆ "
+ "ネᆰニᄉハᄄ テᄃニ. ᆪヌムト "
+ "ᄃハᄋᄃトハᄃフ "
+ "ᄄᄆハᄋᄃニハᄃ-チᄆニᄈᄃ ツᆵ "
+ "ᆪᆴᄚ. ᄈトハナᄃニフ ᆬᆰチᄃツハᄅ "
+ "ᄄハニ "
+ "ナᄃ, ハᄚテᄆ ᄃトᆳᆵネᆵ ᆪハ "
+ "ᄄᄍᆵ, ナᄍᄃナトᄅ "
+ "ᄄネトニᆵᄃフ "
+ "ᄃトᆬᄋトᄃツ ᄍト "
+ "ᆬハネ.",
+ "ᅲムᅱᄚᅱ튜뛰슈ミᅲ뤼ᄡᅲチᅲルᅲᆰ, ᅲムᅱ쥐튜뛰쥬ミ ᅲミᅱ뮤ワᅱ쮸ヤᅱᄡᅲルᅲン, ᅲミᅱ슑 "
+ "ᅲヤᅱ유뤼쥐튜チᅲ゙ᅱ유ルᅱᄡᅲン, ᅲユᅱᄚᅲミᅱ슑 ᅲヤᅱ쥬ミᅱ쥬뛰쓙",
+ "ᅲヤᅱ쥬ルᅱᄚᅲᆰᅱ쥬ヤtestᄃトᄉチᆳᄃᆰ "
+ "ᄃトᆰムᆳネト",
+ "ᄋᄑ", "ᄋᄎ",
+ "ナマニホᄃツホᄡホᄅマ ᄈマᄄマトミ "
+ "ᄃミᄈメᆰミᆴメᆵホᄃナミ"
+ " "
+ "ᄃトトムマᄎホᄅミ チミハ "
+ "ᄃトニムマᄌマナミ "
+ "ᄃトメツホᄃᆭミナホᄅミ "
+ "ネホチミハナ ハホᆴマᄉムホ "
+ "ᄃトᆰムホᄋメᄄミハツホᄃᆰマ"
+ " "
+ "ᄃトメᆳᄃᄈマネᄄミハムホᄅマフ"
+ " ",
// Trick Unicode
//
- // Strings which contain unicode with unusual properties (e.g. Right-to-left override) (c.f. http://www.unicode.org/charts/PDF/U2000.pdf)
+ // Strings which contain unicode with unusual properties (e.g.
+ //Right-to-left override) (c.f. http://www.unicode.org/charts/PDF/U2000.pdf)
- "¬タᆰ¬タᆰtest¬タᆰ", "¬タᆱtest¬タᆱ", "¬タᄅtest¬タᄅ", "test¬チᅠtest¬タᆱ", "¬チᆭtest¬チᄃ",
+ "¬タᆰ¬タᆰtest¬タᆰ", "¬タᆱtest¬タᆱ", "¬タᄅtest¬タᄅ",
+ "test¬チᅠtest¬タᆱ", "¬チᆭtest¬チᄃ",
// Zalgo Text
//
- // Strings which contain \"corrupted\" text. The corruption will not appear in non-HTML text, however. (via http://www.eeemo.net)
+ // Strings which contain \"corrupted\" text. The corruption will not appear
+ //in non-HTML text, however. (via http://www.eeemo.net)
- "£ᄍᄚᅩ초초ユoᅪ゙ ᅩᄋiᅩ볿ᅪヌᅩᆰᅪルnᅩンᅩラᅪユvᅩ゚ᅩワᅩリᅩᆭᅪ゚oᅩ쏘ルᅩᄚᅩᅠkᅢ똬レᅩᆴᅩ촑ᅩ쪼모ᄂ ᅩヨtᅩンᅪユᅩ뽃ᅩ콝ᅪ゙hᅩ톼モᅩ볺ᅩ뽀リᅩᄇeᅪヌᅩᆪᅩᄚᅩᆭᅩᆲᅪホ "
- "ᅩ꼬토코모リhᅪレᅪホᅪルᅩワᅩᆪᅩ봐ナiᅩᆭᅩ볷ᅩᄚᅩᄂvᅩ콰ヘeᅩ촔ᅩ뽉ᅩᄚ-mᅩᄁiᅪナnᅩヨᅩ초゙ᅩ봂ᅩᄚdᅩ소토゚ᅪルᅩ로토リᅩᄈ "
- "ᅩ゙ᅩᆬᅩ모뽌rᅩロᅩラᅩリeᅪルpᅪᅠrᅩ토゙ᅩ콠ᅩラeᅩ초ᅠᅩᆪᅪ゚sᅩリᅪヌᅩ뽜ヘᅩンᅪノeᅪノᅩᆬᅩᆵᅩ゙ᅩ봐レᅩᆲᅪワᅦ쫇ᅪホᅪホᅩ゚ᅩヨᅪヌᅩᄂtᅪヘᅩᆲᅩ놔モᅩ톬ᅪリᅪナiᅩᆰᅩᄆnᅪᅠgᅩᄡᅪノ "
+ "£ᄍᄚᅩ초초ユoᅪ゙ ᅩᄋiᅩ볿ᅪヌᅩᆰᅪルnᅩンᅩラᅪユvᅩ゚ᅩワᅩリᅩᆭᅪ゚oᅩ쏘ルᅩᄚᅩᅠkᅢ똬レᅩᆴᅩ촑ᅩ쪼모ᄂ "
+ "ᅩヨtᅩンᅪユᅩ뽃ᅩ콝ᅪ゙hᅩ톼モᅩ볺ᅩ뽀リᅩᄇeᅪヌᅩᆪᅩᄚᅩᆭᅩᆲᅪホ "
+ "ᅩ꼬토코모リhᅪレᅪホᅪルᅩワᅩᆪᅩ봐ナiᅩᆭᅩ볷ᅩᄚᅩᄂvᅩ콰ヘeᅩ촔ᅩ뽉ᅩᄚ-"
+ "mᅩᄁiᅪナnᅩヨᅩ초゙ᅩ봂ᅩᄚdᅩ소토゚ᅪルᅩ로토リᅩᄈ "
+ "ᅩ゙ᅩᆬᅩ모뽌rᅩロᅩラᅩリeᅪルpᅪᅠrᅩ토゙ᅩ콠ᅩラeᅩ초ᅠᅩᆪᅪ゚sᅩリᅪヌᅩ뽜ヘᅩンᅪノeᅪノᅩᆬᅩᆵᅩ゙ᅩ봐レᅩ"
+ "ᆲᅪワᅦ쫇ᅪホᅪホᅩ゚ᅩヨᅪヌᅩᄂtᅪヘᅩᆲᅩ놔モᅩ톬ᅪリᅪナiᅩᆰᅩᄆnᅪᅠgᅩᄡᅪノ"
+ " "
"ᅪマᅪノᅪナcᅩᆲᅩ゚hᅪᄀaᅩᆱᅩ콢ᅪリoᅩᆱᅩ゚ᅩヨᅪヘᅩルᅩンᅪノsᅩラᅩᆭᅩᄇ.ᅩ또쫘ネᅩᆪ",
- "ᅩ과モᅩ゙ᅪナIᅩラᅩリᅩᆭᅪンnᅪヌᅪヌᅪルvᅩᆴᅩᆱokᅩ볾ᅩルᅪネiᅩヨᅪルᅩᆳᅩ쪼ᅠᅩ゙nᅩ고콡ᅩᆪᅩᄎgᅩ봐ネᅪルᅩᆳᅪルᅩᆲᅪホ ᅩᄚtᅪヤᅩᆭhᅩ゙ᅩᄇeᅩ꼬ᄂ "
- "ᅪヘᅩᆲᅩ봐ヨfᅩᄡᅩリᅪユᅩᆪᅢ똬ヨ£ᄎ쫁ᅩᄅlᅪヨᅪヤᅪレiᅪモᅪレᅩᆭᅪᅠnᅪヨᅪヘᅩラᅪモᅩ뽍gᅪヘ ᅩᄄoᅪレᅩᆰᅪᄀfᅩリᅩᆪᅩᆲ "
+ "ᅩ과モᅩ゙ᅪナIᅩラᅩリᅩᆭᅪンnᅪヌᅪヌᅪルvᅩᆴᅩᆱokᅩ볾ᅩルᅪネiᅩヨᅪルᅩᆳᅩ쪼ᅠᅩ゙nᅩ고콡ᅩᆪᅩᄎgᅩ봐ネᅪルᅩᆳ"
+ "ᅪルᅩᆲᅪホ ᅩᄚtᅪヤᅩᆭhᅩ゙ᅩᄇeᅩ꼬ᄂ "
+ "ᅪヘᅩᆲᅩ봐ヨfᅩᄡᅩリᅪユᅩᆪᅢ똬ヨ£ᄎ쫁ᅩᄅlᅪヨᅪヤᅪレiᅪモᅪレᅩᆭᅪᅠnᅪヨᅪヘᅩラᅪモᅩ뽍gᅪヘ "
+ "ᅩᄄoᅪレᅩᆰᅪᄀfᅩリᅩᆪᅩᆲ "
"ᅩヨᅩリᅪヨᅩ゚ᅪルᅩᆴcᅭノᅪヤᅩᆱᅪヨᅪモᅪヌᅪヨᅪナhᅩ소녻ᅪレᅪヤᅢ고ラᅩ톼ユᅪナoᅩ톣ᅩᆬsᅩ뫄ネᅩ초ヨᅩᆭᅩ콰ᄁ."
"ᅩロᅩヨᅩ゙ᅩᅠᅩᆱᅩᄚ",
"ᅩラᅩ촤ヨᅩ쫊ᅪモ£ᄍᆴᅩ놔ヘᅩᆬᅪヌᅪネhᅩ보チeᅪマᅪモᅩ토ラᅩルᅩ톣ᅪヤ "
- "ᅪヌᅩワᅩ모ᅠᅪモᅪヘᅪナNᅪユᅪᅠeᅩラᅩᄆzᅩリᅩンᅩワᅩ촤ルpᅩ노초쫘ヘᅩᆵᅪレeᅩᅠᅩ코ᅠᅪワrᅩ또놔ヘᅩ초ヨᅪヤᅩヨᅩヨdᅩᅠᅩ゚ᅩᆳᅩᆲᅩンᅪ゚iᅩᆭᅪヨᅩ롸モᅪヤᅩᄂaᅩᅠᅩラᅩᆲᅪノᅩルnᅪレᅪワ "
- "ᅩ코゙ᅩᄚᅪレᅪナhᅩ솨ノiᅩ뽀゙vᅩ꽈ヌ£ᄌルᅪホᅪ゚-ᅭノᅩᆳᅩ로톼ヤmᅩ놄ᅩᆱiᅪユᅪヌᅩンᅩᆭnᅩラᅪル£ᄌヘᅩ゚ ᅩᆵᅩ봐ユᅪ゙ᅦᆱᅩ゚ᅩᆵᅩᄚᅩ봐ルᅩ코ンf "
- "ᅩᆰᅩᄚᅩᄚᅩラᅩヨᅩᆳᅩリᅪリcᅩᆭᅪヘᅩ보゙ᅪヘᅩ로ル£ᄌᆬᅪレaᅩᆴᅪホᅩ゚ᅩルᅪワᅥ고로쫘ホsᅩᄂ.ᅩンᅩン ᅭノZᅩ고ヨᅩワᅪヨᅩᄚᅩᆪᅪノᅩワaᅪヨᅩᄚᅪルᅩᆲᅪᄀlᅩ볾ᅩ뽜ヘᅩᄅgᅩ고゚ᅩ토뫄レᅩ゙ᅩᆲᅪナoᅩラᅪワ.ᅩ゚",
- "ᅩᆭHᅩᆲᅩ노ラᅩ놔ンeᅪワ ᅩワᅩᆬᅩンᅩ콰ヘᅩ゚ᅩチwᅩユhᅩヨᅩᆵᅪモoᅩンᅪルᅩヨᅪホᅩ몵 ᅭノᅩ초ルᅩ゙ᅩ゚ᅪネWᅩ오톬aᅩ촑ᅪヘᅣᆵᅪネᅪユᅩᆳᅪルᅩᆵᅩワtᅩ쏘톭sᅩリᅪルᅪヨᅩユ "
- "ᅩᅠᅩᆱᅩᅠBᅩ콰ヘᅪルᅪノᅩ뽜ナeᅩᄉhᅩ솗ᅪヌᅩᆱᅪルiᅩ쫘モᅩ뽀뽍ᅪホᅩᆱᅩユnᅪ゚dᅩᄡᅩᆰᅩワᅩヨ ᅩᄚᅪノᅩ롸ヌᅪルᅩ봐゙ᅪナTᅪヨᅩ톼モᅩᆰᅪᄁhᅪマᅪモᅩᆴᅩᄏeᅩᆲᅩンᅩ゚ᅪナ "
+ "ᅪヌᅩワᅩ모ᅠᅪモᅪヘᅪナNᅪユᅪᅠeᅩラᅩᄆzᅩリᅩンᅩワᅩ촤ルpᅩ노초쫘ヘᅩᆵᅪレeᅩᅠᅩ코ᅠᅪワrᅩ또놔ヘᅩᄎ"
+ "ᅩヨᅪヤᅩヨᅩヨdᅩᅠᅩ゚ᅩᆳᅩᆲᅩンᅪ゚iᅩᆭᅪヨᅩ롸モᅪヤᅩᄂaᅩᅠᅩラᅩᆲᅪノᅩルnᅪレᅪワ"
+ " "
+ "ᅩ코゙ᅩᄚᅪレᅪナhᅩ솨ノiᅩ뽀゙vᅩ꽈ヌ£ᄌルᅪホᅪ゚-ᅭノᅩᆳᅩ로톼ヤmᅩ놄ᅩᆱiᅪユᅪヌᅩンᅩᆭnᅩラᅪル£ᄌヘᅩ゚ "
+ "ᅩᆵᅩ봐ユᅪ゙ᅦᆱᅩ゚ᅩᆵᅩᄚᅩ봐ルᅩ코ンf "
+ "ᅩᆰᅩᄚᅩᄚᅩラᅩヨᅩᆳᅩリᅪリcᅩᆭᅪヘᅩ보゙ᅪヘᅩ로ル£ᄌᆬᅪレaᅩᆴᅪホᅩ゚ᅩルᅪワᅥ고로쫘ホsᅩᄂ.ᅩンᅩン "
+ "ᅭノZᅩ고ヨᅩワᅪヨᅩᄚᅩᆪᅪノᅩワaᅪヨᅩᄚᅪルᅩᆲᅪᄀlᅩ볾ᅩ뽜ヘᅩᄅgᅩ고゚ᅩ토뫄レᅩ゙ᅩᆲᅪナoᅩラᅪワ.ᅩ゚",
+ "ᅩᆭHᅩᆲᅩ노ラᅩ놔ンeᅪワ ᅩワᅩᆬᅩンᅩ콰ヘᅩ゚ᅩチwᅩユhᅩヨᅩᆵᅪモoᅩンᅪルᅩヨᅪホᅩ몵 "
+ "ᅭノᅩ초ルᅩ゙ᅩ゚ᅪネWᅩ오톬aᅩ촑ᅪヘᅣᆵᅪネᅪユᅩᆳᅪルᅩᆵᅩワtᅩ쏘톭sᅩリᅪルᅪヨᅩユ "
+ "ᅩᅠᅩᆱᅩᅠBᅩ콰ヘᅪルᅪノᅩ뽜ナeᅩᄉhᅩ솗ᅪヌᅩᆱᅪルiᅩ쫘モᅩ뽀뽍ᅪホᅩᆱᅩユnᅪ゚dᅩᄡᅩᆰᅩワᅩヨ "
+ "ᅩᄚᅪノᅩ롸ヌᅪルᅩ봐゙ᅪナTᅪヨᅩ톼モᅩᆰᅪᄁhᅪマᅪモᅩᆴᅩᄏeᅩᆲᅩンᅩ゚ᅪナ "
"ᅩ노쪼ンWᅪルᅩ゙ᅩンᅪヤᅪヌᅪンᅪナaᅪマᅪモᅪヤᅩ쪼톣lᅩᄡᅪヤᅩᄚᅩ노゚ᅪヤ£ᄌ폶.ᅪユ",
- "Zᅩᆴᅩ゙ᅩᅠᅪルᅪヤᅪナ£ᄌタᅩラᅩ゙ᅪネᅩ코ラ£ᄌ쏴ルᅪホᅩᆵᅩ쪼゙ᅪモGᅩᄏOᅩᆳᅩラᅩᆴ",
+ "Zᅩᆴᅩ゙ᅩᅠᅪルᅪヤᅪナ£ᄌタᅩラᅩ゙ᅪネᅩ코ラ£ᄌ쏴ルᅪホᅩᆵᅩ쪼゙ᅪモGᅩᄏOᅩᆳᅩラᅩ"
+ "ᆴ",
// Unicode Upsidedown
//
- // Strings which contain unicode with an \"upsidedown\" effect (via http://www.upsidedowntext.com)
+ // Strings which contain unicode with an \"upsidedown\" effect (via
+ //http://www.upsidedowntext.com)
- "ᅨルミnb£ᄡノlミ ミuᅥテミᆵ ᅦンᄍolop ᅧヌᅦン ᅦンᄍoqミl ᅧヌn ᅧヌunp£ᄡノp£ᄡノヤu£ᄡノ ᄍodᆵᅦンᅧヌ poᆵsn£ᄡノᅦン op pᅦンs 'ᅧヌ£ᄡノlᅦン "
- "ᅥテu£ᄡノヤs£ᄡノd£ᄡノpミ ᄍnᅧヌᅦンᅧヌヤᅦンsuoヤ 'ᅧヌᅦンᆵミ ᅧヌ£ᄡノs ᄍolop ᆵnsd£ᄡノ "
+ "ᅨルミnb£ᄡノlミ ミuᅥテミᆵ ᅦンᄍolop ᅧヌᅦン ᅦンᄍoqミl ᅧヌn "
+ "ᅧヌunp£ᄡノp£ᄡノヤu£ᄡノ ᄍodᆵᅦンᅧヌ poᆵsn£ᄡノᅦン op pᅦンs "
+ "'ᅧヌ£ᄡノlᅦン "
+ "ᅥテu£ᄡノヤs£ᄡノd£ᄡノpミ ᄍnᅧヌᅦンᅧヌヤᅦンsuoヤ 'ᅧヌᅦンᆵミ ᅧヌ£ᄡノs "
+ "ᄍolop ᆵnsd£ᄡノ "
"ᆵᅦンᄍoᅨᆬ",
"00ᅨルᅥヨ$-",
@@ -215,250 +335,457 @@
//
// Strings which contain bold/italic/etc. versions of normal characters
- "ᄐᄡᄑネᄑナ ᄑムᄑユᄑノᄑテᄑヒ ᄑツᄑメᄑマᄑラᄑホ ᄑニᄑマᄑリ ᄑハᄑユᄑヘᄑミᄑモ ᄑマᄑヨᄑナᄑメ ᄑヤᄑネᄑナ "
+ "ᄐᄡᄑネᄑナ ᄑムᄑユᄑノᄑテᄑヒ ᄑツᄑメᄑマᄑラᄑホ "
+ "ᄑニᄑマᄑリ ᄑハᄑユᄑヘᄑミᄑモ ᄑマᄑヨᄑナᄑメ "
+ "ᄑヤᄑネᄑナ "
"ᄑフᄑチᄑレᄑル ᄑトᄑマᄑヌ",
- "ンミモンミᄀンミ゙ ンミᆰンミᆴンミᄁンミワンミᄂ ンミロンミᆱンミᄄンミᄚンミᄃ ンミ゚ンミᄄンミᄆ ンミᆪンミᆴンミᆭンミᄅンミᆲ "
- "ンミᄄンミᆵンミ゙ンミᆱ ンミᆳンミᄀンミ゙ ンミᆬンミレンミᄈンミᄇ "
+ "ンミモンミᄀンミ゙ ンミᆰンミᆴンミᄁンミワンミᄂ "
+ "ンミロンミᆱンミᄄンミᄚンミᄃ ンミ゚ンミᄄンミᄆ "
+ "ンミᆪンミᆴンミᆭンミᄅンミᆲ "
+ "ンミᄄンミᆵンミ゙ンミᆱ ンミᆳンミᄀンミ゙ "
+ "ンミᆬンミレンミᄈンミᄇ "
"ンミンンミᄄンミᅠ",
- "ンユンヨヘンヨハ ンヨヨンヨレンヨホンヨネンヨミ ンヨヌンヨランヨヤンヨワンヨモ ンヨヒンヨヤンヨン ンヨマンヨレンヨメンヨユンヨリ "
- "ンヨヤンヨロンヨハンヨラ ンヨルンヨヘンヨハ ンヨムンヨニンヨ゚ンヨ゙ "
+ "ンユンヨヘンヨハ ンヨヨンヨレンヨホンヨネンヨミ "
+ "ンヨヌンヨランヨヤンヨワンヨモ ンヨヒンヨヤンヨン "
+ "ンヨマンヨレンヨメンヨユンヨリ "
+ "ンヨヤンヨロンヨハンヨラ ンヨルンヨヘンヨハ "
+ "ンヨムンヨニンヨ゚ンヨ゙ "
"ンヨノンヨヤンヨフ",
- "ンムᄏンメノンメニ ンメメンメヨンメハンメトンメフ ンメテンメモンメミンメリンメマ ンメヌンメミンメル ンメヒンメヨンメホンメムンメヤ "
- "ンメミンメランメニンメモ ンメユンメノンメニ ンメヘンメツンメロンメレ "
+ "ンムᄏンメノンメニ ンメメンメヨンメハンメトンメフ "
+ "ンメテンメモンメミンメリンメマ ンメヌンメミンメル "
+ "ンメヒンメヨンメホンメムンメヤ "
+ "ンメミンメランメニンメモ ンメユンメノンメニ "
+ "ンメヘンメツンメロンメレ "
"ンメナンメミンメネ",
- "ンモᆪンモᄆンモᆴ ンモᄎンモᄒンモᄇンモᆲンモᄡ ンモᆱンモᄏンモᄌンヤタンモᄋ ンモᆵンモᄌンヤチ ンモᄈンモᄒンモᄊンモᄍンモᄐ "
- "ンモᄌンモンモᆴンモᄏ ンモᄑンモᄆンモᆴ ンモᄉンモᆰンヤテンヤツ "
+ "ンモᆪンモᄆンモᆴ ンモᄎンモᄒンモᄇンモᆲンモᄡ "
+ "ンモᆱンモᄏンモᄌンヤタンモᄋ ンモᆵンモᄌンヤチ "
+ "ンモᄈンモᄒンモᄊンモᄍンモᄐ "
+ "ンモᄌンモンモᆴンモᄏ ンモᄑンモᄆンモᆴ "
+ "ンモᄉンモᆰンヤテンヤツ "
"ンモᆳンモᄌンモᄚ",
- "ンユヒンユルンユヨ ンユᄁンユᆭンユレンユヤンユワ ンユモンユᆪンユᅠンユᄄンユ゚ ンユランユᅠンユᄅ ンユロンユᆭンユ゙ンユᄀンユᄂ "
- "ンユᅠンユᄃンユヨンユᆪ ンユᆬンユルンユヨ ンユンンユメンユᆱンユᆰ "
+ "ンユヒンユルンユヨ ンユᄁンユᆭンユレンユヤンユワ "
+ "ンユモンユᆪンユᅠンユᄄンユ゚ ンユランユᅠンユᄅ "
+ "ンユロンユᆭンユ゙ンユᄀンユᄂ "
+ "ンユᅠンユᄃンユヨンユᆪ ンユᆬンユルンユヨ "
+ "ンユンンユメンユᆱンユᆰ "
"ンユユンユᅠンユリ",
- "ンレテンレムンレホ ンレレンレ゙ンレメンレフンレヤ ンレヒンレロンレリンレᅠンレラ ンレマンレリンレᄀ ンレモンレ゙ンレヨンレルンレワ "
- "ンレリンレ゚ンレホンレロ ンレンンレムンレホ ンレユンレハンレᆪンレᄁ "
+ "ンレテンレムンレホ ンレレンレ゙ンレメンレフンレヤ "
+ "ンレヒンレロンレリンレᅠンレラ ンレマンレリンレᄀ "
+ "ンレモンレ゙ンレヨンレルンレワ "
+ "ンレリンレ゚ンレホンレロ ンレンンレムンレホ "
+ "ンレユンレハンレᆪンレᄁ "
"ンレヘンレリンレミ",
- "¬メᆵ¬メᆪ¬メᅠ ¬メᆲ¬メᄚ¬メᄂ¬メ゙¬メᆭ ¬メン¬メᆳ¬メᆰ¬メᄇ¬メᄅ ¬メᄀ¬メᆰ¬メᄈ ¬メᆬ¬メᄚ¬メᄄ¬メᆱ¬メᆴ ¬メᆰ¬メᄆ¬メᅠ¬メᆳ ¬メᆵ¬メᆪ¬メᅠ ¬メᄃ¬メワ¬メᄉ¬メᄡ "
+ "¬メᆵ¬メᆪ¬メᅠ ¬メᆲ¬メᄚ¬メᄂ¬メ゙¬メᆭ ¬メン¬メᆳ¬メᆰ¬メᄇ¬メᄅ ¬メᄀ¬メᆰ¬メᄈ "
+ "¬メᆬ¬メᄚ¬メᄄ¬メᆱ¬メᆴ ¬メᆰ¬メᄆ¬メᅠ¬メᆳ ¬メᆵ¬メᆪ¬メᅠ "
+ "¬メᄃ¬メワ¬メᄉ¬メᄡ "
"¬メ゚¬メᆰ¬メᄁ",
// Script Injection
//
- // Strings which attempt to invoke a benign script injection; shows vulnerability to XSS
+ // Strings which attempt to invoke a benign script injection; shows
+ //vulnerability to XSS
- "<script>alert(123)</script>", "<script>alert('123');</script>", "<img src=x onerror=alert(123) />",
- "<svg><script>123<1>alert(123)</script>", "\"><script>alert(123)</script>", "'><script>alert(123)</script>", "><script>alert(123)</script>",
- "</script><script>alert(123)</script>", "< / script >< script >alert(123)< / script >", " onfocus=JaVaSCript:alert(123) autofocus",
- "\" onfocus=JaVaSCript:alert(123) autofocus", "' onfocus=JaVaSCript:alert(123) autofocus", "ᄐワscriptᄐ゙alert(123)ᄐワ/scriptᄐ゙",
- "<sc<script>ript>alert(123)</sc</script>ript>", "--><script>alert(123)</script>", "\";alert(123);t=\"", "';alert(123);t='", "JavaSCript:alert(123)",
- ";alert(123);", "src=JaVaSCript:prompt(132)", "\"><script>alert(123);</script x=\"", "'><script>alert(123);</script x='", "><script>alert(123);</script x=",
- "\" autofocus onkeyup=\"javascript:alert(123)", "' autofocus onkeyup='javascript:alert(123)",
- "<script\\x20type=\"text/javascript\">javascript:alert(1);</script>", "<script\\x3Etype=\"text/javascript\">javascript:alert(1);</script>",
- "<script\\x0Dtype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x09type=\"text/javascript\">javascript:alert(1);</script>",
- "<script\\x0Ctype=\"text/javascript\">javascript:alert(1);</script>", "<script\\x2Ftype=\"text/javascript\">javascript:alert(1);</script>",
- "<script\\x0Atype=\"text/javascript\">javascript:alert(1);</script>", "'`\"><\\x3Cscript>javascript:alert(1)</script>",
- "'`\"><\\x00script>javascript:alert(1)</script>", "ABC<div style=\"x\\x3Aexpression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:expression\\x5C(javascript:alert(1)\">DEF", "ABC<div style=\"x:expression\\x00(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:exp\\x00ression(javascript:alert(1)\">DEF", "ABC<div style=\"x:exp\\x5Cression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\x0Aexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x09expression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\xE3\\x80\\x80expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x84expression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\xC2\\xA0expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x80expression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\xE2\\x80\\x8Aexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x0Dexpression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\x0Cexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x87expression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\xEF\\xBB\\xBFexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x20expression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\xE2\\x80\\x88expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\x00expression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\xE2\\x80\\x8Bexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x86expression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\xE2\\x80\\x85expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x82expression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\x0Bexpression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x81expression(javascript:alert(1)\">DEF",
- "ABC<div style=\"x:\\xE2\\x80\\x83expression(javascript:alert(1)\">DEF", "ABC<div style=\"x:\\xE2\\x80\\x89expression(javascript:alert(1)\">DEF",
- "<a href=\"\\x0Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x0Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xC2\\xA0javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x05javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE1\\xA0\\x8Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x18javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x11javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x88javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x89javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x17javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x03javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x0Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x1Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x00javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x10javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x82javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x20javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x13javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x09javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x8Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x14javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x19javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\xAFjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x1Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x81javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x1Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x87javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x07javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE1\\x9A\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x83javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x04javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x01javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x08javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x84javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x86javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE3\\x80\\x80javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x12javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x0Djavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x0Ajavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x0Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x15javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\xA8javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x16javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x02javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x1Bjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x06javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\xA9javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x80\\x85javascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x1Ejavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\xE2\\x81\\x9Fjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"\\x1Cjavascript:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"javascript\\x00:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"javascript\\x3A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"javascript\\x09:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"javascript\\x0D:javascript:alert(1)\" id=\"fuzzelement1\">test</a>",
- "<a href=\"javascript\\x0A:javascript:alert(1)\" id=\"fuzzelement1\">test</a>", "`\"'><img src=xxx:x \\x0Aonerror=javascript:alert(1)>",
- "`\"'><img src=xxx:x \\x22onerror=javascript:alert(1)>", "`\"'><img src=xxx:x \\x0Bonerror=javascript:alert(1)>",
- "`\"'><img src=xxx:x \\x0Donerror=javascript:alert(1)>", "`\"'><img src=xxx:x \\x2Fonerror=javascript:alert(1)>",
- "`\"'><img src=xxx:x \\x09onerror=javascript:alert(1)>", "`\"'><img src=xxx:x \\x0Conerror=javascript:alert(1)>",
- "`\"'><img src=xxx:x \\x00onerror=javascript:alert(1)>", "`\"'><img src=xxx:x \\x27onerror=javascript:alert(1)>",
- "`\"'><img src=xxx:x \\x20onerror=javascript:alert(1)>", "\"`'><script>\\x3Bjavascript:alert(1)</script>", "\"`'><script>\\x0Djavascript:alert(1)</script>",
- "\"`'><script>\\xEF\\xBB\\xBFjavascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\x81javascript:alert(1)</script>",
- "\"`'><script>\\xE2\\x80\\x84javascript:alert(1)</script>", "\"`'><script>\\xE3\\x80\\x80javascript:alert(1)</script>",
- "\"`'><script>\\x09javascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\x89javascript:alert(1)</script>",
- "\"`'><script>\\xE2\\x80\\x85javascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\x88javascript:alert(1)</script>",
- "\"`'><script>\\x00javascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\xA8javascript:alert(1)</script>",
- "\"`'><script>\\xE2\\x80\\x8Ajavascript:alert(1)</script>", "\"`'><script>\\xE1\\x9A\\x80javascript:alert(1)</script>",
- "\"`'><script>\\x0Cjavascript:alert(1)</script>", "\"`'><script>\\x2Bjavascript:alert(1)</script>",
- "\"`'><script>\\xF0\\x90\\x96\\x9Ajavascript:alert(1)</script>", "\"`'><script>-javascript:alert(1)</script>",
- "\"`'><script>\\x0Ajavascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\xAFjavascript:alert(1)</script>",
- "\"`'><script>\\x7Ejavascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\x87javascript:alert(1)</script>",
- "\"`'><script>\\xE2\\x81\\x9Fjavascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\xA9javascript:alert(1)</script>",
- "\"`'><script>\\xC2\\x85javascript:alert(1)</script>", "\"`'><script>\\xEF\\xBF\\xAEjavascript:alert(1)</script>",
- "\"`'><script>\\xE2\\x80\\x83javascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\x8Bjavascript:alert(1)</script>",
- "\"`'><script>\\xEF\\xBF\\xBEjavascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\x80javascript:alert(1)</script>",
- "\"`'><script>\\x21javascript:alert(1)</script>", "\"`'><script>\\xE2\\x80\\x82javascript:alert(1)</script>",
- "\"`'><script>\\xE2\\x80\\x86javascript:alert(1)</script>", "\"`'><script>\\xE1\\xA0\\x8Ejavascript:alert(1)</script>",
- "\"`'><script>\\x0Bjavascript:alert(1)</script>", "\"`'><script>\\x20javascript:alert(1)</script>", "\"`'><script>\\xC2\\xA0javascript:alert(1)</script>",
- "<img \\x00src=x onerror=\"alert(1)\">", "<img \\x47src=x onerror=\"javascript:alert(1)\">", "<img \\x11src=x onerror=\"javascript:alert(1)\">",
- "<img \\x12src=x onerror=\"javascript:alert(1)\">", "<img\\x47src=x onerror=\"javascript:alert(1)\">", "<img\\x10src=x onerror=\"javascript:alert(1)\">",
- "<img\\x13src=x onerror=\"javascript:alert(1)\">", "<img\\x32src=x onerror=\"javascript:alert(1)\">", "<img\\x47src=x onerror=\"javascript:alert(1)\">",
- "<img\\x11src=x onerror=\"javascript:alert(1)\">", "<img \\x47src=x onerror=\"javascript:alert(1)\">", "<img \\x34src=x onerror=\"javascript:alert(1)\">",
- "<img \\x39src=x onerror=\"javascript:alert(1)\">", "<img \\x00src=x onerror=\"javascript:alert(1)\">", "<img src\\x09=x onerror=\"javascript:alert(1)\">",
- "<img src\\x10=x onerror=\"javascript:alert(1)\">", "<img src\\x13=x onerror=\"javascript:alert(1)\">", "<img src\\x32=x onerror=\"javascript:alert(1)\">",
- "<img src\\x12=x onerror=\"javascript:alert(1)\">", "<img src\\x11=x onerror=\"javascript:alert(1)\">", "<img src\\x00=x onerror=\"javascript:alert(1)\">",
- "<img src\\x47=x onerror=\"javascript:alert(1)\">", "<img src=x\\x09onerror=\"javascript:alert(1)\">", "<img src=x\\x10onerror=\"javascript:alert(1)\">",
- "<img src=x\\x11onerror=\"javascript:alert(1)\">", "<img src=x\\x12onerror=\"javascript:alert(1)\">", "<img src=x\\x13onerror=\"javascript:alert(1)\">",
- "<img[a][b][c]src[d]=x[e]onerror=[f]\"alert(1)\">", "<img src=x onerror=\\x09\"javascript:alert(1)\">", "<img src=x onerror=\\x10\"javascript:alert(1)\">",
- "<img src=x onerror=\\x11\"javascript:alert(1)\">", "<img src=x onerror=\\x12\"javascript:alert(1)\">", "<img src=x onerror=\\x32\"javascript:alert(1)\">",
- "<img src=x onerror=\\x00\"javascript:alert(1)\">", "<a href=javascript:javascript:alert(1)>XXX</a>",
- "<img src=\"x` `<script>javascript:alert(1)</script>\"` `>", "<img src onerror /\" '\"= alt=javascript:alert(1)//\">",
+ "<script>alert(123)</script>",
+ "<script>alert('123');</script>",
+ "<img src=x onerror=alert(123) />",
+ "<svg><script>123<1>alert(123)</script>", "\"><script>alert(123)</script>",
+ "'><script>alert(123)</script>", "><script>alert(123)</script>",
+ "</script><script>alert(123)</script>",
+ "< / script >< script >alert(123)< / script >",
+ " onfocus=JaVaSCript:alert(123) autofocus",
+ "\" onfocus=JaVaSCript:alert(123) autofocus",
+ "' onfocus=JaVaSCript:alert(123) autofocus",
+ "ᄐワscriptᄐ゙alert(123)ᄐワ/scriptᄐ゙",
+ "<sc<script>ript>alert(123)</sc</script>ript>",
+ "--><script>alert(123)</script>", "\";alert(123);t=\"", "';alert(123);t='",
+ "JavaSCript:alert(123)", ";alert(123);", "src=JaVaSCript:prompt(132)",
+ "\"><script>alert(123);</script x=\"", "'><script>alert(123);</script x='",
+ "><script>alert(123);</script x=",
+ "\" autofocus onkeyup=\"javascript:alert(123)",
+ "' autofocus onkeyup='javascript:alert(123)",
+ "<script\\x20type=\"text/javascript\">javascript:alert(1);</script>",
+ "<script\\x3Etype=\"text/javascript\">javascript:alert(1);</script>",
+ "<script\\x0Dtype=\"text/javascript\">javascript:alert(1);</script>",
+ "<script\\x09type=\"text/javascript\">javascript:alert(1);</script>",
+ "<script\\x0Ctype=\"text/javascript\">javascript:alert(1);</script>",
+ "<script\\x2Ftype=\"text/javascript\">javascript:alert(1);</script>",
+ "<script\\x0Atype=\"text/javascript\">javascript:alert(1);</script>",
+ "'`\"><\\x3Cscript>javascript:alert(1)</script>",
+ "'`\"><\\x00script>javascript:alert(1)</script>",
+ "ABC<div style=\"x\\x3Aexpression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:expression\\x5C(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:expression\\x00(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:exp\\x00ression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:exp\\x5Cression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\x0Aexpression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\x09expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE3\\x80\\x80expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x84expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xC2\\xA0expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x80expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x8Aexpression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\x0Dexpression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\x0Cexpression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x87expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xEF\\xBB\\xBFexpression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\x20expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x88expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\x00expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x8Bexpression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x86expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x85expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x82expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\x0Bexpression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x81expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x83expression(javascript:alert(1)\">DEF",
+ "ABC<div style=\"x:\\xE2\\x80\\x89expression(javascript:alert(1)\">DEF",
+ "<a href=\"\\x0Bjavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x0Fjavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xC2\\xA0javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x05javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE1\\xA0\\x8Ejavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x18javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x11javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x88javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x89javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x80javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x17javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x03javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x0Ejavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x1Ajavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x00javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x10javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x82javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x20javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x13javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x09javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x8Ajavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x14javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x19javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\xAFjavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x1Fjavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x81javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x1Djavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x87javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x07javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE1\\x9A\\x80javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x83javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x04javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x01javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x08javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x84javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x86javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE3\\x80\\x80javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x12javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x0Djavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x0Ajavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x0Cjavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x15javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\xA8javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x16javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x02javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x1Bjavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x06javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\xA9javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x80\\x85javascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x1Ejavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\xE2\\x81\\x9Fjavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"\\x1Cjavascript:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"javascript\\x00:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"javascript\\x3A:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"javascript\\x09:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"javascript\\x0D:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "<a href=\"javascript\\x0A:javascript:alert(1)\" "
+ "id=\"fuzzelement1\">test</a>",
+ "`\"'><img src=xxx:x \\x0Aonerror=javascript:alert(1)>",
+ "`\"'><img src=xxx:x \\x22onerror=javascript:alert(1)>",
+ "`\"'><img src=xxx:x \\x0Bonerror=javascript:alert(1)>",
+ "`\"'><img src=xxx:x \\x0Donerror=javascript:alert(1)>",
+ "`\"'><img src=xxx:x \\x2Fonerror=javascript:alert(1)>",
+ "`\"'><img src=xxx:x \\x09onerror=javascript:alert(1)>",
+ "`\"'><img src=xxx:x \\x0Conerror=javascript:alert(1)>",
+ "`\"'><img src=xxx:x \\x00onerror=javascript:alert(1)>",
+ "`\"'><img src=xxx:x \\x27onerror=javascript:alert(1)>",
+ "`\"'><img src=xxx:x \\x20onerror=javascript:alert(1)>",
+ "\"`'><script>\\x3Bjavascript:alert(1)</script>",
+ "\"`'><script>\\x0Djavascript:alert(1)</script>",
+ "\"`'><script>\\xEF\\xBB\\xBFjavascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x81javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x84javascript:alert(1)</script>",
+ "\"`'><script>\\xE3\\x80\\x80javascript:alert(1)</script>",
+ "\"`'><script>\\x09javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x89javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x85javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x88javascript:alert(1)</script>",
+ "\"`'><script>\\x00javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\xA8javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x8Ajavascript:alert(1)</script>",
+ "\"`'><script>\\xE1\\x9A\\x80javascript:alert(1)</script>",
+ "\"`'><script>\\x0Cjavascript:alert(1)</script>",
+ "\"`'><script>\\x2Bjavascript:alert(1)</script>",
+ "\"`'><script>\\xF0\\x90\\x96\\x9Ajavascript:alert(1)</script>",
+ "\"`'><script>-javascript:alert(1)</script>",
+ "\"`'><script>\\x0Ajavascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\xAFjavascript:alert(1)</script>",
+ "\"`'><script>\\x7Ejavascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x87javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x81\\x9Fjavascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\xA9javascript:alert(1)</script>",
+ "\"`'><script>\\xC2\\x85javascript:alert(1)</script>",
+ "\"`'><script>\\xEF\\xBF\\xAEjavascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x83javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x8Bjavascript:alert(1)</script>",
+ "\"`'><script>\\xEF\\xBF\\xBEjavascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x80javascript:alert(1)</script>",
+ "\"`'><script>\\x21javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x82javascript:alert(1)</script>",
+ "\"`'><script>\\xE2\\x80\\x86javascript:alert(1)</script>",
+ "\"`'><script>\\xE1\\xA0\\x8Ejavascript:alert(1)</script>",
+ "\"`'><script>\\x0Bjavascript:alert(1)</script>",
+ "\"`'><script>\\x20javascript:alert(1)</script>",
+ "\"`'><script>\\xC2\\xA0javascript:alert(1)</script>",
+ "<img \\x00src=x onerror=\"alert(1)\">",
+ "<img \\x47src=x onerror=\"javascript:alert(1)\">",
+ "<img \\x11src=x onerror=\"javascript:alert(1)\">",
+ "<img \\x12src=x onerror=\"javascript:alert(1)\">",
+ "<img\\x47src=x onerror=\"javascript:alert(1)\">",
+ "<img\\x10src=x onerror=\"javascript:alert(1)\">",
+ "<img\\x13src=x onerror=\"javascript:alert(1)\">",
+ "<img\\x32src=x onerror=\"javascript:alert(1)\">",
+ "<img\\x47src=x onerror=\"javascript:alert(1)\">",
+ "<img\\x11src=x onerror=\"javascript:alert(1)\">",
+ "<img \\x47src=x onerror=\"javascript:alert(1)\">",
+ "<img \\x34src=x onerror=\"javascript:alert(1)\">",
+ "<img \\x39src=x onerror=\"javascript:alert(1)\">",
+ "<img \\x00src=x onerror=\"javascript:alert(1)\">",
+ "<img src\\x09=x onerror=\"javascript:alert(1)\">",
+ "<img src\\x10=x onerror=\"javascript:alert(1)\">",
+ "<img src\\x13=x onerror=\"javascript:alert(1)\">",
+ "<img src\\x32=x onerror=\"javascript:alert(1)\">",
+ "<img src\\x12=x onerror=\"javascript:alert(1)\">",
+ "<img src\\x11=x onerror=\"javascript:alert(1)\">",
+ "<img src\\x00=x onerror=\"javascript:alert(1)\">",
+ "<img src\\x47=x onerror=\"javascript:alert(1)\">",
+ "<img src=x\\x09onerror=\"javascript:alert(1)\">",
+ "<img src=x\\x10onerror=\"javascript:alert(1)\">",
+ "<img src=x\\x11onerror=\"javascript:alert(1)\">",
+ "<img src=x\\x12onerror=\"javascript:alert(1)\">",
+ "<img src=x\\x13onerror=\"javascript:alert(1)\">",
+ "<img[a][b][c]src[d]=x[e]onerror=[f]\"alert(1)\">",
+ "<img src=x onerror=\\x09\"javascript:alert(1)\">",
+ "<img src=x onerror=\\x10\"javascript:alert(1)\">",
+ "<img src=x onerror=\\x11\"javascript:alert(1)\">",
+ "<img src=x onerror=\\x12\"javascript:alert(1)\">",
+ "<img src=x onerror=\\x32\"javascript:alert(1)\">",
+ "<img src=x onerror=\\x00\"javascript:alert(1)\">",
+ "<a "
+ "href=javascript:javascript:alert(1)>XXX</"
+ "a>",
+ "<img src=\"x` `<script>javascript:alert(1)</script>\"` `>",
+ "<img src onerror /\" '\"= alt=javascript:alert(1)//\">",
"<title onpropertychange=javascript:alert(1)></title><title title=>",
- "<a href=http://foo.bar/#x=`y></a><img alt=\"`><img src=x:x onerror=javascript:alert(1)></a>\">", "<!--[if]><script>javascript:alert(1)</script -->",
- "<!--[if<img src=x onerror=javascript:alert(1)//]> -->", "<script src=\"/\%(jscript)s\"></script>", "<script src=\"\\%(jscript)s\"></script>",
- "<IMG \"\"\"><SCRIPT>alert(\"XSS\")</SCRIPT>\">", "<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>", "<IMG SRC=# onmouseover=\"alert('xxs')\">",
- "<IMG SRC= onmouseover=\"alert('xxs')\">", "<IMG onmouseover=\"alert('xxs')\">",
- "<IMG SRC=javascript:alert('XSS')>",
+ "<a href=http://foo.bar/#x=`y></a><img alt=\"`><img src=x:x "
+ "onerror=javascript:alert(1)></a>\">",
+ "<!--[if]><script>javascript:alert(1)</script -->",
+ "<!--[if<img src=x onerror=javascript:alert(1)//]> -->",
+ "<script src=\"/\%(jscript)s\"></script>",
+ "<script src=\"\\%(jscript)s\"></script>",
+ "<IMG \"\"\"><SCRIPT>alert(\"XSS\")</SCRIPT>\">",
+ "<IMG SRC=javascript:alert(String.fromCharCode(88,83,83))>",
+ "<IMG SRC=# onmouseover=\"alert('xxs')\">",
+ "<IMG SRC= onmouseover=\"alert('xxs')\">",
+ "<IMG onmouseover=\"alert('xxs')\">",
"<IMG "
- "SRC=javascript:alert&#"
+ "SRC=javascript:a&#"
+ "108;ert('XSS')>",
+ "<IMG "
+ "SRC=javascr&#"
+ "0000105pt:aler&#"
+ "0000116&#"
"0000040'XSS')>",
- "<IMG SRC=javascript:alert('XSS')>",
- "<IMG SRC=\"jav ascript:alert('XSS');\">", "<IMG SRC=\"jav	ascript:alert('XSS');\">", "<IMG SRC=\"jav
ascript:alert('XSS');\">",
- "<IMG SRC=\"jav
ascript:alert('XSS');\">", "perl -e 'print \"<IMG SRC=java\0script:alert(\"XSS\")>\";' > out",
- "<IMG SRC=\"  javascript:alert('XSS');\">", "<SCRIPT/XSS SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>",
- "<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert(\"XSS\")>", "<SCRIPT/SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>", "<<SCRIPT>alert(\"XSS\");//<</SCRIPT>",
- "<SCRIPT SRC=http://ha.ckers.org/xss.js?< B >", "<SCRIPT SRC=//ha.ckers.org/.j>", "<IMG SRC=\"javascript:alert('XSS')\"",
- "<iframe src=http://ha.ckers.org/scriptlet.html <", "\\\";alert('XSS');//", "<u oncopy=alert()> Copy me</u>", "<i onwheel=alert(1)> Scroll over me </i>",
- "<plaintext>", "http://a/%%30%30", "</textarea><script>alert(123)</script>",
+ "<IMG "
+ "SRC=javascript:al&#"
+ "x65rt('XSS')>",
+ "<IMG SRC=\"jav ascript:alert('XSS');\">",
+ "<IMG SRC=\"jav	ascript:alert('XSS');\">",
+ "<IMG SRC=\"jav
ascript:alert('XSS');\">",
+ "<IMG SRC=\"jav
ascript:alert('XSS');\">",
+ "perl -e 'print \"<IMG SRC=java\0script:alert(\"XSS\")>\";' > out",
+ "<IMG SRC=\"  javascript:alert('XSS');\">",
+ "<SCRIPT/XSS SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>",
+ "<BODY onload!#$%&()*~+-_.,:;?@[/|\\]^`=alert(\"XSS\")>",
+ "<SCRIPT/SRC=\"http://ha.ckers.org/xss.js\"></SCRIPT>",
+ "<<SCRIPT>alert(\"XSS\");//<</SCRIPT>",
+ "<SCRIPT SRC=http://ha.ckers.org/xss.js?< B >",
+ "<SCRIPT SRC=//ha.ckers.org/.j>", "<IMG SRC=\"javascript:alert('XSS')\"",
+ "<iframe src=http://ha.ckers.org/scriptlet.html <", "\\\";alert('XSS');//",
+ "<u oncopy=alert()> Copy me</u>",
+ "<i onwheel=alert(1)> Scroll over me </i>", "<plaintext>",
+ "http://a/%%30%30", "</textarea><script>alert(123)</script>",
// SQL Injection
//
// Strings which can cause a SQL injection if inputs are not sanitized
- "1;DROP TABLE users", "1'; DROP TABLE users-- 1", "' OR 1=1 -- 1", "' OR '1'='1", " ", "%", "_",
+ "1;DROP TABLE users", "1'; DROP TABLE users-- 1", "' OR 1=1 -- 1",
+ "' OR '1'='1", " ", "%", "_",
// Server Code Injection
//
- // Strings which can cause user to run code on server as a privileged user (c.f. https://news.ycombinator.com/item?id=7665153)
+ // Strings which can cause user to run code on server as a privileged user
+ //(c.f. https://news.ycombinator.com/item?id=7665153)
- "-", "--", "--version", "--help", "$USER", "/dev/null; touch /tmp/blns.fail ; echo", "`touch /tmp/blns.fail`", "$(touch /tmp/blns.fail)",
- "@{[system \"touch /tmp/blns.fail\"]}",
+ "-", "--", "--version", "--help", "$USER",
+ "/dev/null; touch /tmp/blns.fail ; echo", "`touch /tmp/blns.fail`",
+ "$(touch /tmp/blns.fail)", "@{[system \"touch /tmp/blns.fail\"]}",
// Command Injection (Ruby)
//
// Strings which can call system commands within Ruby/Rails applications
- "eval(\"puts 'hello world'\")", "System(\"ls -al /\")", "`ls -al /`", "Kernel.exec(\"ls -al /\")", "Kernel.exit(1)", "%x('ls -al /')",
+ "eval(\"puts 'hello world'\")", "System(\"ls -al /\")", "`ls -al /`",
+ "Kernel.exec(\"ls -al /\")", "Kernel.exit(1)", "%x('ls -al /')",
// XXE Injection (XML)
//
- // String which can reveal system files when parsed by a badly configured XML parser
+ // String which can reveal system files when parsed by a badly configured
+ //XML parser
- "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><!DOCTYPE foo [ <!ELEMENT foo ANY ><!ENTITY xxe SYSTEM \"file:///etc/passwd\" >]><foo>&xxe;</foo>",
+ "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><!DOCTYPE foo [ <!ELEMENT "
+ "foo ANY ><!ENTITY xxe SYSTEM \"file:///etc/passwd\" >]><foo>&xxe;</foo>",
// Unwanted Interpolation
//
- // Strings which can be accidentally expanded into different strings if evaluated in the wrong context, e.g. used as a printf format string or via Perl or
- //shell eval. Might expose sensitive data from the program doing the interpolation, or might just represent the wrong string.
+ // Strings which can be accidentally expanded into different strings if
+ //evaluated in the wrong context, e.g. used as a printf format string or via
+ //Perl or
+ // shell eval. Might expose sensitive data from the program doing the
+ // interpolation, or might just represent the wrong string.
"$HOME", "$ENV{'HOME'}", "%d", "%s", "{0}", "%*.*s", "File:///",
// File Inclusion
//
- // Strings which can cause user to pull in files that should not be a part of a web server
+ // Strings which can cause user to pull in files that should not be a part
+ //of a web server
- "../../../../../../../../../../../etc/passwd%00", "../../../../../../../../../../../etc/hosts",
+ "../../../../../../../../../../../etc/passwd%00",
+ "../../../../../../../../../../../etc/hosts",
// Known CVEs and Vulnerabilities
//
// Strings that test for known vulnerabilities
- "() { 0; }; touch /tmp/blns.shellshock1.fail;", "() { _; } >_[$($())] { touch /tmp/blns.shellshock2.fail; }", "<<< %s(un='%s') = %u", "+++ATH0",
+ "() { 0; }; touch /tmp/blns.shellshock1.fail;",
+ "() { _; } >_[$($())] { touch /tmp/blns.shellshock2.fail; }",
+ "<<< %s(un='%s') = %u", "+++ATH0",
// MSDOS/Windows Special Filenames
//
// Strings which are reserved characters in MSDOS/Windows
- "CON", "PRN", "AUX", "CLOCK$", "NUL", "A:", "ZZ:", "COM1", "LPT1", "LPT2", "LPT3", "COM2", "COM3", "COM4",
+ "CON", "PRN", "AUX", "CLOCK$", "NUL", "A:", "ZZ:", "COM1", "LPT1", "LPT2",
+ "LPT3", "COM2", "COM3", "COM4",
// IRC specific strings
//
- // Strings that may occur on IRC clients that make security products freak out
+ // Strings that may occur on IRC clients that make security products freak
+ // out
"DCC SEND STARTKEYLOGGER 0 0 0",
// Scunthorpe Problem
//
- // Innocuous strings which may be blocked by profanity filters (https://en.wikipedia.org/wiki/Scunthorpe_problem)
+ // Innocuous strings which may be blocked by profanity filters
+ //(https://en.wikipedia.org/wiki/Scunthorpe_problem)
- "Scunthorpe General Hospital", "Penistone Community Church", "Lightwater Country Park", "Jimmy Clitheroe", "Horniman Museum", "shitake mushrooms",
- "RomansInSussex.co.uk", "http://www.cum.qc.ca/", "Craig Cockburn, Software Specialist", "Linda Callahan", "Dr. Herman I. Libshitz", "magna cum laude",
- "Super Bowl XXX", "medieval erection of parapets", "evaluate", "mocha", "expression", "Arsenal canal", "classic", "Tyson Gay", "Dick Van Dyke", "basement",
+ "Scunthorpe General Hospital", "Penistone Community Church",
+ "Lightwater Country Park", "Jimmy Clitheroe", "Horniman Museum",
+ "shitake mushrooms", "RomansInSussex.co.uk", "http://www.cum.qc.ca/",
+ "Craig Cockburn, Software Specialist", "Linda Callahan",
+ "Dr. Herman I. Libshitz", "magna cum laude", "Super Bowl XXX",
+ "medieval erection of parapets", "evaluate", "mocha", "expression",
+ "Arsenal canal", "classic", "Tyson Gay", "Dick Van Dyke", "basement",
// Human injection
//
// Strings which may cause human to reinterpret worldview
- "If you're reading this, you've been in a coma for almost 20 years now. We're trying a new technique. We don't know where this message will end up in your "
+ "If you're reading this, you've been in a coma for almost 20 years now. "
+ "We're trying a new technique. We don't know where this message will end "
+ "up in your "
"dream, but we hope it works. Please wake up, we miss you.",
// Terminal escape codes
//
// Strings which punish the fools who use cat/type on this file
- "Roses are [0;31mred[0m, violets are [0;34mblue. Hope you enjoy terminal hue", "But now...[20Cfor my greatest trick...[8m",
+ "Roses are [0;31mred[0m, violets are [0;34mblue. Hope you enjoy "
+ "terminal hue",
+ "But now...[20Cfor my greatest trick...[8m",
"The quick brown fox... [Beeeep]",
// iOS Vulnerabilities
//
// Strings which crashed iMessage in various versions of iOS
- "Powerトマトマᄉムᄄマトマトᄉムᄄマᄆᄆヒ ¢ᆬᆪ ¢ᆬᆪh ¢ᆬᆪ "
+ "Powerトマトマᄉムᄄマトマトᄉムᄄマᄆᄆ"
+ "ヒ ¢ᆬᆪ ¢ᆬᆪh ¢ᆬᆪ "
"¢ᆬᆪ¥ニラ",
"゚マᄈ0゚フネᄌマ"};
\ No newline at end of file
diff --git a/include/color_cout_g3_sink.hpp b/include/color_cout_g3_sink.hpp
index a92bf94..5fb5bf4 100644
--- a/include/color_cout_g3_sink.hpp
+++ b/include/color_cout_g3_sink.hpp
@@ -23,7 +23,8 @@
auto level = logEntry.get()._level;
auto color = GetColor(level);
- std::cout << "\033[" << color << "m" << logEntry.get().toString() << "\033[m";
+ std::cout << "\033[" << color << "m" << logEntry.get().toString()
+ << "\033[m";
}
};
}
\ No newline at end of file
diff --git a/include/ioaccess.h b/include/ioaccess.h
deleted file mode 100644
index 98bb63d..0000000
--- a/include/ioaccess.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#define IOCTL_IO_READ 0x1103
-#define IOCTL_IO_WRITE 0x1104
-#define IOCTL_REAL_IO_READ 0x1106
-#define IOCTL_REAL_IO_WRITE 0x1107
-#define IOCTL_BIT_STREAM_BASE 0x1108
-#define IOCTL_TX_BIT_STREAM 0x1109
-#define IOCTL_GET_SOCKET 0x1110
-#define IOCTL_AUTOMODE_TRIGGER 0x1111
-#define IOCTL_PASS3_TRIGGER 0x1112
-#define IOCTL_I2C_READ 0x1113
-#define IOCTL_I2C_WRITE 0x1114
-#define IOCTL_FLAG_BUFFER_CLEAR 0x1115
-#define IOCTL_REMAP 0x1105
-#define RELOCATE_OFFSET 0x380
-
-typedef struct _IO_ACCESS_DATA {
- unsigned char Type;
- unsigned long Address;
- unsigned long Data;
- unsigned long Value;
- unsigned long I2CValue;
- int kernel_socket;
-// struct sockaddr_in address_svr;
-} IO_ACCESS_DATA, *PIO_ACCESS_DATA;
-/*
-typedef struct _MAP_DATA {
- unsigned long virt_add;
- unsigned long phys_add;
- unsigned long size;
- pgprot_t prot;
-} MAP_DATA;
-*/
diff --git a/include/regs-video.h b/include/regs-video.h
deleted file mode 100644
index 379fa9c..0000000
--- a/include/regs-video.h
+++ /dev/null
@@ -1,264 +0,0 @@
-#pragma once
-
-
-#define PASS 0
-#define TRUE 0
-#define FALSE 1
-#define FAIL 1
-#define FIX 0
-#define STEP 1
-#define SEQ_ADDRESS_REGISTER 0x3C4
-#define SEQ_DATA_REGISTER 0x3C5
-#define CRTC_ADDRESS_REGISTER 0x3D4
-#define CRTC_DATA_REGISTER 0x3D5
-#define DAC_INDEX_REGISTER 0x3C8
-#define DAC_DATA_REGISTER 0x3C9
-
-#define VIDEOBASE_OFFSET 0x1E700000
-#define KEY_CONTROL 0x00 + VIDEOBASE_OFFSET
-#define VIDEOENGINE_SEQUENCE_CONTROL 0x04 + VIDEOBASE_OFFSET
-#define VIDEOENGINE_PASS1_CONTROL 0x08 + VIDEOBASE_OFFSET
-#define VIDEOENGINE_MODEDETECTIONSETTING_H 0x0C + VIDEOBASE_OFFSET
-#define VIDEOENGINE_MODEDETECTIONSETTING_V 0x10 + VIDEOBASE_OFFSET
-#define SCALE_FACTOR_REGISTER 0x14 + VIDEOBASE_OFFSET
-#define SCALING_FILTER_PARAMETERS_1 0x18 + VIDEOBASE_OFFSET
-#define SCALING_FILTER_PARAMETERS_2 0x1C + VIDEOBASE_OFFSET
-#define SCALING_FILTER_PARAMETERS_3 0x20 + VIDEOBASE_OFFSET
-#define SCALING_FILTER_PARAMETERS_4 0x24 + VIDEOBASE_OFFSET
-#define MODEDETECTION_STATUS_READBACK 0x98 + VIDEOBASE_OFFSET
-#define VIDEOPROCESSING_CONTROL 0x2C + VIDEOBASE_OFFSET
-#define VIDEO_CAPTURE_WINDOW_SETTING 0x30 + VIDEOBASE_OFFSET
-#define VIDEO_COMPRESS_WINDOW_SETTING 0x34 + VIDEOBASE_OFFSET
-#define VIDEO_COMPRESS_READ 0x3C + VIDEOBASE_OFFSET
-#define VIDEO_IN_BUFFER_BASEADDRESS 0x44 + VIDEOBASE_OFFSET
-#define VIDEO_IN_BUFFER_OFFSET 0x48 + VIDEOBASE_OFFSET
-#define VIDEOPROCESS_BUFFER_BASEADDRESS 0x4C + VIDEOBASE_OFFSET
-#define VIDEOCOMPRESS_SOURCE_BUFFER_BASEADDRESS 0x44 + VIDEOBASE_OFFSET
-#define VIDEOPROCESS_OFFSET 0x48 + VIDEOBASE_OFFSET
-#define VIDEOPROCESS_REFERENCE_BUFFER_BASEADDRESS 0x4C + VIDEOBASE_OFFSET
-#define FLAG_BUFFER_BASEADDRESS 0x50 + VIDEOBASE_OFFSET
-#define VIDEO_COMPRESS_DESTINATION_BASEADDRESS 0x54 + VIDEOBASE_OFFSET
-#define STREAM_BUFFER_SIZE_REGISTER 0x58 + VIDEOBASE_OFFSET
-#define VIDEO_CAPTURE_BOUND_REGISTER 0x5C + VIDEOBASE_OFFSET
-#define VIDEO_COMPRESS_CONTROL 0x60 + VIDEOBASE_OFFSET
-#define VIDEO_QUANTIZATION_TABLE_REGISTER 0x64 + VIDEOBASE_OFFSET
-#define BLOCK_SHARPNESS_DETECTION_CONTROL 0x6C + VIDEOBASE_OFFSET
-#define POST_WRITE_BUFFER_DRAM_THRESHOLD 0x68 + VIDEOBASE_OFFSET
-#define DETECTION_STATUS_REGISTER 0x98 + VIDEOBASE_OFFSET
-#define H_DETECTION_STATUS 0x90 + VIDEOBASE_OFFSET
-#define V_DETECTION_STATUS 0x94 + VIDEOBASE_OFFSET
-#define VIDEO_CONTROL_REGISTER 0x300 + VIDEOBASE_OFFSET
-#define VIDEO_INTERRUPT_CONTROL 0x304 + VIDEOBASE_OFFSET
-#define VIDEO_INTERRUPT_STATUS 0x308 + VIDEOBASE_OFFSET
-#define MODE_DETECTION_REGISTER 0x30C + VIDEOBASE_OFFSET
-
-#define FRONT_BOUND_REGISTER 0x310 + VIDEOBASE_OFFSET
-#define END_BOUND_REGISTER 0x314 + VIDEOBASE_OFFSET
-#define CRC_1_REGISTER 0x320 + VIDEOBASE_OFFSET
-#define CRC_2_REGISTER 0x324 + VIDEOBASE_OFFSET
-#define REDUCE_BIT_REGISTER 0x328 + VIDEOBASE_OFFSET
-#define BIOS_SCRATCH_REGISTER 0x34C + VIDEOBASE_OFFSET
-#define COMPRESS_DATA_COUNT_REGISTER 0x70 + VIDEOBASE_OFFSET
-#define COMPRESS_BLOCK_COUNT_REGISTER 0x74 + VIDEOBASE_OFFSET
-#define VIDEO_SCRATCH_REGISTER_34C 0x34C + VIDEOBASE_OFFSET
-#define VIDEO_SCRATCH_REGISTER_35C 0x35C + VIDEOBASE_OFFSET
-#define RC4KEYS_REGISTER 0x400 + VIDEOBASE_OFFSET
-#define VQHUFFMAN_TABLE_REGISTER 0x300 + VIDEOBASE_OFFSET
-
-// Parameters
-#define SAMPLE_RATE 24000000.0
-#define MODEDETECTION_VERTICAL_STABLE_MAXIMUM 0x6
-#define MODEDETECTION_HORIZONTAL_STABLE_MAXIMUM 0x6
-#define MODEDETECTION_VERTICAL_STABLE_THRESHOLD 0x2
-#define MODEDETECTION_HORIZONTAL_STABLE_THRESHOLD 0x2
-#define HORIZONTAL_SCALING_FILTER_PARAMETERS_LOW 0xFFFFFFFF
-#define HORIZONTAL_SCALING_FILTER_PARAMETERS_HIGH 0xFFFFFFFF
-#define VIDEO_WRITE_BACK_BUFFER_THRESHOLD_LOW 0x08
-#define VIDEO_WRITE_BACK_BUFFER_THRESHOLD_HIGH 0x04
-#define VQ_Y_LEVELS 0x10
-#define VQ_UV_LEVELS 0x05
-#define EXTERNAL_VIDEO_HSYNC_POLARITY 0x01
-#define EXTERNAL_VIDEO_VSYNC_POLARITY 0x01
-#define VIDEO_SOURCE_FROM 0x01
-#define EXTERNAL_ANALOG_SOURCE 0x01
-#define USE_intERNAL_TIMING_GENERATOR 0x01
-#define WRITE_DATA_FORMAT 0x00
-#define SET_BCD_TO_WHOLE_FRAME 0x01
-#define ENABLE_VERTICAL_DOWN_SCALING 0x01
-#define BCD_TOLERENCE 0xFF
-#define BCD_START_BLOCK_XY 0x0
-#define BCD_END_BLOCK_XY 0x3FFF
-#define COLOR_DEPTH 16
-#define BLOCK_SHARPNESS_DETECTION_HIGH_THRESHOLD 0xFF
-#define BLOCK_SHARPNESS_DETECTION_LOE_THRESHOLD 0xFF
-#define BLOCK_SHARPNESS_DETECTION_HIGH_COUNTS_THRESHOLD 0x3F
-#define BLOCK_SHARPNESS_DETECTION_LOW_COUNTS_THRESHOLD 0x1F
-#define VQTABLE_AUTO_GENERATE_BY_HARDWARE 0x0
-#define VQTABLE_SELECTION 0x0
-#define JPEG_COMPRESS_ONLY 0x0
-#define DUAL_MODE_COMPRESS 0x1
-#define BSD_H_AND_V 0x0
-#define ENABLE_RC4_ENCRYPTION 0x1
-#define BSD_ENABLE_HIGH_THRESHOLD_CHECK 0x0
-#define VIDEO_PROCESS_AUTO_TRIGGER 0x0
-#define VIDEO_COMPRESS_AUTO_TRIGGER 0x0
-#define DIGITAL_SIGNAL 0x0
-#define ANALOG_SIGNAL 0x1
-
-/* AST_VIDEO_SCRATCH_35C 0x35C Video Scratch Remap Read Back */
-#define SCRATCH_VGA_PWR_STS_HSYNC (1 << 31)
-#define SCRATCH_VGA_PWR_STS_VSYNC (1 << 30)
-#define SCRATCH_VGA_ATTRIBTE_INDEX_BIT5 (1 << 29)
-#define SCRATCH_VGA_MASK_REG (1 << 28)
-#define SCRATCH_VGA_CRT_RST (1 << 27)
-#define SCRATCH_VGA_SCREEN_OFF (1 << 26)
-#define SCRATCH_VGA_RESET (1 << 25)
-#define SCRATCH_VGA_ENABLE (1 << 24)
-
-typedef struct _VIDEO_MODE_INFO {
- unsigned short X;
- unsigned short Y;
- unsigned short ColorDepth;
- unsigned short RefreshRate;
- unsigned char ModeIndex;
-} VIDEO_MODE_INFO, *PVIDEO_MODE_INFO;
-
-typedef struct _VQ_INFO {
- unsigned char Y[16];
- unsigned char U[32];
- unsigned char V[32];
- unsigned char NumberOfY;
- unsigned char NumberOfUV;
- unsigned char NumberOfInner;
- unsigned char NumberOfOuter;
-} VQ_INFO, *PVQ_INFO;
-
-typedef struct _HUFFMAN_TABLE {
- unsigned long HuffmanCode[32];
-} HUFFMAN_TABLE, *PHUFFMAN_TABLE;
-
-typedef struct _FRAME_HEADER {
- unsigned long StartCode; // 0
- unsigned long FrameNumber; /// 4
- unsigned short HSize; // 8
- unsigned short VSize;
- unsigned long Reserved[2]; // 12 13 14
- unsigned char DirectMode; // 15
- unsigned char CompressionMode; // 15
- unsigned char JPEGScaleFactor; // 16
- unsigned char Y_JPEGTableSelector; // 18 [[[[
- unsigned char JPEGYUVTableMapping;
- unsigned char SharpModeSelection;
- unsigned char AdvanceTableSelector;
- unsigned char AdvanceScaleFactor;
- unsigned long NumberOfMB;
- unsigned char VQ_YLevel;
- unsigned char VQ_UVLevel;
- VQ_INFO VQVectors;
- unsigned char Mode420;
- unsigned char Visual_Lossless;
-} FRAME_HEADER, *PFRAME_HEADER;
-
-typedef struct _INF_DATA {
- unsigned char AST2500;
- unsigned char Input_Signale; // 0: internel vga, 1, ext digital, 2, ext analog
- unsigned char Trigger_Mode; // 0: capture, 1, ext digital, 2, ext analog
- unsigned char DownScalingEnable;
- unsigned char DifferentialSetting;
- unsigned short AnalogDifferentialThreshold;
- unsigned short DigitalDifferentialThreshold;
- unsigned char AutoMode;
- unsigned char DirectMode; // 0: force sync mode 1: auto direct mode
- unsigned short DelayControl;
- unsigned char VQMode;
- unsigned char JPEG_FILE;
-} INF_DATA, *PINF_DATA;
-
-typedef struct _COMPRESS_DATA {
- unsigned long SourceFrameSize;
- unsigned long CompressSize;
- unsigned long HDebug;
- unsigned long VDebug;
-} COMPRESS_DATA, *PCOMPRESS_DATA;
-
-// VIDEO Engine Info
-typedef struct _VIDEO_ENGINE_INFO {
- INF_DATA INFData;
- VIDEO_MODE_INFO SourceModeInfo;
- VIDEO_MODE_INFO DestinationModeInfo;
- VQ_INFO VQInfo;
- FRAME_HEADER FrameHeader;
- COMPRESS_DATA CompressData;
- unsigned char ChipVersion;
- unsigned char NoSignal;
-} VIDEO_ENGINE_INFO, *PVIDEO_ENGINE_INFO;
-
-typedef struct {
- unsigned short HorizontalActive;
- unsigned short VerticalActive;
- unsigned short RefreshRate;
- unsigned char ADCIndex1;
- unsigned char ADCIndex2;
- unsigned char ADCIndex3;
- unsigned char ADCIndex5;
- unsigned char ADCIndex6;
- unsigned char ADCIndex7;
- unsigned char ADCIndex8;
- unsigned char ADCIndex9;
- unsigned char ADCIndexA;
- unsigned char ADCIndexF;
- unsigned char ADCIndex15;
- int HorizontalShift;
- int VerticalShift;
-} ADC_MODE;
-
-typedef struct {
- unsigned short HorizontalTotal;
- unsigned short VerticalTotal;
- unsigned short HorizontalActive;
- unsigned short VerticalActive;
- unsigned char RefreshRate;
- double HorizontalFrequency;
- unsigned short HSyncTime;
- unsigned short HBackPorch;
- unsigned short VSyncTime;
- unsigned short VBackPorch;
- unsigned short HLeftBorder;
- unsigned short HRightBorder;
- unsigned short VBottomBorder;
- unsigned short VTopBorder;
- ADC_MODE AdcMode;
-} VESA_MODE;
-
-
-
-typedef struct {
- unsigned short HorizontalActive;
- unsigned short VerticalActive;
- unsigned short RefreshRateIndex;
- double PixelClock;
-} INTERNAL_MODE;
-
-typedef struct _TRANSFER_HEADER {
- unsigned long Data_Length;
- unsigned long Blocks_Changed;
- unsigned short User_Width;
- unsigned short User_Height;
- unsigned char Frist_frame; // 1: first frame
- unsigned char Compress_type; // 0:aspeed mode, 1:jpeg mode
- unsigned char Trigger_mode; // 0:capture, 1: compression, 2: buffer
- unsigned char Data_format; // 0:DCT, 1:DCTwVQ2 color, 2:DCTwVQ4 color
- unsigned char RC4_Enable;
- unsigned char RC4_Reset; // no use
- unsigned char Y_Table;
- unsigned char UV_Table;
- unsigned char Mode_420;
- unsigned char Direct_Mode;
- unsigned char VQ_Mode;
- unsigned char Disable_VGA;
- unsigned char Differential_Enable;
- unsigned char Auto_Mode;
- unsigned char VGA_Status;
- unsigned char RC4State;
- unsigned char Advance_Table;
-} TRANSFER_HEADER, *PTRANSFER_HEADER;
diff --git a/include/ssl_key_handler.hpp b/include/ssl_key_handler.hpp
index d53c239..1c3e8f4 100644
--- a/include/ssl_key_handler.hpp
+++ b/include/ssl_key_handler.hpp
@@ -1,7 +1,5 @@
#pragma once
-#include <random>
-
#include <openssl/bio.h>
#include <openssl/dh.h>
#include <openssl/dsa.h>
@@ -12,10 +10,9 @@
#include <openssl/rand.h>
#include <openssl/rsa.h>
#include <openssl/ssl.h>
-
#include <boost/asio.hpp>
-
#include <g3log/g3log.hpp>
+#include <random>
namespace ensuressl {
static void init_openssl(void);
@@ -127,11 +124,11 @@
name = X509_get_subject_name(x509);
X509_NAME_add_entry_by_txt(name, "C", MBSTRING_ASC, (unsigned char *)"US",
- -1, -1, 0);
+ -1, -1, 0);
X509_NAME_add_entry_by_txt(name, "O", MBSTRING_ASC,
- (unsigned char *)"Intel BMC", -1, -1, 0);
+ (unsigned char *)"Intel BMC", -1, -1, 0);
X509_NAME_add_entry_by_txt(name, "CN", MBSTRING_ASC,
- (unsigned char *)"testhost", -1, -1, 0);
+ (unsigned char *)"testhost", -1, -1, 0);
// set the CSR options
X509_set_issuer_name(x509, name);
diff --git a/include/token_authorization_middleware.hpp b/include/token_authorization_middleware.hpp
index 58766b9..0f6e667 100644
--- a/include/token_authorization_middleware.hpp
+++ b/include/token_authorization_middleware.hpp
@@ -5,9 +5,7 @@
namespace crow {
-struct User {
-
-};
+struct User {};
struct TokenAuthorizationMiddleware {
// TODO(ed) auth_token shouldn't really be passed to the context
@@ -23,7 +21,7 @@
void after_handle(request& req, response& res, context& ctx);
- private:
- std::string auth_token2;
+ private:
+ std::string auth_token2;
};
}
\ No newline at end of file
diff --git a/include/vesa.hpp b/include/vesa.hpp
deleted file mode 100644
index a9de246..0000000
--- a/include/vesa.hpp
+++ /dev/null
@@ -1,59 +0,0 @@
-// Note: Modified for modes which have border issue
-
-std::array<VESA_MODE, 38> ModeTable{
- {////////////////////////// 60Hz mode
- // 720x480 done
- {1056, 497, 720, 480, 60, 29.900, 88, 104, 3, 13, 0, 0, 0, 0, {720,480,60, 0x41, 0xF0, 0x48, 0x05, 0x20, 0x58, 0x60, 0x60, 0x60, 0x5E, 0xFE, 6, 2}},
- // 848x480 done
- {1064, 517, 848, 480, 60, 31.160, 88, 91, 3, 26, 0, 0, 0, 0, {848,480,60, 0x42, 0x70, 0x48, 0x05, 0x20, 0x58, 0x60, 0x60, 0x60, 0x5E, 0xFE, 6, 2}},
- {800, 525, 640, 480, 60, 31.469, 96, 40, 2, 25, 8, 8, 8, 8, {640,480,60, 0x31, 0xF0, 0x48, 0x05, 0x20, 0x60, 0x60, 0x60, 0x60, 0x5E, 0xFE, 6, 2}},
- // 720x576
- {912, 597, 720, 576, 60, 35.920, 72, 88, 3, 17, 0, 0, 0, 0, {720,576,60, 0x38, 0xF0, 0x48, 0x05, 0x20, 0x48, 0x60, 0x60, 0x60, 0x5E, 0xFE, 6, 2}},
- // 960x600 GTF done
- {1232, 622, 960, 600, 60, 37.320, 96, 136, 3, 18, 0, 0, 0, 0, {960,600,60, 0x4C, 0xF0, 0x60, 0x05, 0x20, 0x60, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {1056, 628, 800, 600, 60, 37.879, 128, 88, 4, 23, 0, 0, 0, 0, {800,600,60, 0x41, 0xF0, 0x60, 0x05, 0x20, 0x80, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- // 1088x612 GTF done
- {1392, 634, 1088, 612, 60, 38.04, 112, 152, 3, 18, 0, 0, 0, 0, {1088,612,60, 0x56, 0xF0, 0x60, 0x05, 0x20, 0x70, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- // 1280x720 GTF done
- {1664, 746, 1280, 720, 60, 44.760, 136, 192, 3, 22, 0, 0, 0, 0, {1280,720,60, 0x67, 0xF0, 0xA8, 0x05, 0x20, 0x88, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- // 1360x768 GTF done
- {1776, 795, 1360, 768, 60, 47.700, 144, 208, 3, 23, 0, 0, 0, 0, {1360,768,60, 0x6E, 0xF0, 0xA8, 0x05, 0x20, 0x90, 0x60, 0x60, 0x60, 0x5E, 0xFE, 7, 1}},
- // 1280x768 done
- {1664, 798, 1280, 768, 60, 47.700, 128, 184, 7, 20, 0, 0, 0, 0, {1280,768,60, 0x67, 0xF0, 0xA8, 0x05, 0x20, 0x80, 0x60, 0x60, 0x60, 0x5E, 0xFE, 7, 1}},
- {1344, 806, 1024, 768, 60, 48.363, 136, 160, 6, 29, 0, 0, 0, 0, {1024,768,60, 0x53, 0xF0, 0xA8, 0x05, 0x20, 0x88, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 7}},
- // 1280x800 GTF done
- {1680, 828, 1280, 800, 60, 49.680, 136, 200, 3, 24, 0, 0, 0, 0, {1280,800,60, 0x68, 0xF0, 0xA8, 0x05, 0x20, 0x88, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- // 1152x864 GTF done
- {1520, 895, 1152, 864, 60, 53.700, 120, 184, 3, 27, 0, 0, 0, 0, {1152,864,60, 0x5E, 0xF0, 0xA8, 0x05, 0x20, 0x78, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- // 1600x900 GTF done
- {2128, 932, 1600, 900, 60, 55.920, 168, 264, 3, 28, 0, 0, 0, 0, {1600,900,60, 0x84, 0xF0, 0xA8, 0x05, 0x20, 0xA8, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {1800, 1000, 1280, 960, 60, 60.000, 112, 312, 3, 36, 0, 0, 0, 0, {1280,960,60, 0x70, 0x70, 0xA8, 0x05, 0x20, 0x70, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- // 1600x1024 GTF done
- {2144, 1060, 1600, 1024, 60, 63.600, 168, 272, 3, 32, 0, 0, 0, 0, {1600,1024,60, 0x85, 0xF0, 0xE8, 0x05, 0x20, 0xA8, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {1688, 1066, 1280, 1024, 60, 63.981, 112, 248, 3, 38, 0, 0, 0, 0, {1280,1024,60, 0x69, 0x70, 0xA8, 0x05, 0x20, 0x70, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {2160, 1250, 1600, 1200, 60, 75.000, 192, 304, 3, 46, 0, 0, 0, 0, {1600,1200,60, 0x86, 0xF0, 0xE8, 0x05, 0x20, 0xC0, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- ////////////////////// Not 60Hz mode
- {900, 449, 720, 400, 70, 31.469, 108, 45, 2, 25, 8, 8, 8, 8, {720,400,70, 0x38, 0x30, 0x48, 0x05, 0x20, 0x6C, 0x60, 0x60, 0x60, 0x5E, 0xFE, 6, 1}},
- {832, 520, 640, 480, 72, 37.861, 40, 120, 3, 20, 8, 8, 8, 8, {640,480,72, 0x33, 0xF0, 0x48, 0x05, 0x20, 0x28, 0x60, 0x60, 0x60, 0x5E, 0xFE, 6, 3}},
- {840, 500, 640, 480, 75, 37.500, 64, 120, 3, 16, 0, 0, 0, 0, {640,480,75, 0x34, 0x70, 0x48, 0x05, 0x20, 0x40, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 3}},
- {832, 509, 640, 480, 85, 43.269, 56, 80, 3, 25, 0, 0, 0, 0, {640,480,85, 0x33, 0xF0, 0x48, 0x05, 0x20, 0x38, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 3}},
- {1024, 625, 800, 600, 56, 35.156, 72, 128, 2, 22, 0, 0, 0, 0, {800,600,56, 0x3F, 0xF0, 0x60, 0x05, 0x20, 0x48, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {1040, 666, 800, 600, 72, 48.077, 120, 64, 6, 23, 0, 0, 0, 0, {800,600,72, 0x40, 0xF0, 0x60, 0x05, 0x20, 0x78, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {1056, 625, 800, 600, 75, 46.875, 80, 160, 3, 21, 0, 0, 0, 0, {800,600,75, 0x41, 0xF0, 0x60, 0x05, 0x20, 0x50, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {1048, 631, 800, 600, 85, 53.674, 64, 152, 3, 27, 0, 0, 0, 0, {800,600,85, 0x41, 0x70, 0x60, 0x05, 0x20, 0x40, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {1328, 806, 1024, 768, 70, 56.476, 136, 144, 6, 29, 0, 0, 0, 0, {1024,768,70, 0x52, 0xF0, 0xA8, 0x05, 0x20, 0x88, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 7}},
- {1312, 800, 1024, 768, 75, 60.023, 96, 176, 3, 28, 0, 0, 0, 0, {1024,768,75, 0x51, 0xF0, 0xA8, 0x05, 0x20, 0x60, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 1}},
- {1376, 808, 1024, 768, 85, 68.677, 96, 208, 3, 36, 0, 0, 0, 0, {1024,768,85, 0x55, 0xF0, 0xA8, 0x05, 0x20, 0x60, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 1}},
- {1600, 900, 1152, 864, 75, 67.500, 128, 256, 3, 32, 0, 0, 0, 0, {1152,864,75, 0x63, 0xF0, 0xA8, 0x05, 0x20, 0x80, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {1728, 1011, 1280, 960, 85, 85.938, 160, 224, 3, 47, 0, 0, 0, 0, {1280,960,85, 0x6B, 0xF0, 0xE8, 0x05, 0x20, 0xA0, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}},
- {1688, 1066, 1280, 1024, 75, 79.976, 144, 248, 3, 38, 0, 0, 0, 0, {1280,1024,75, 0x69, 0x70, 0xE8, 0x05, 0x20, 0x90, 0x60, 0x60, 0x60, 0x5E, 0xFE, -1, 0}}
- // VESA modes below did not include any ADC values... TODO< figure it out
- //{1728, 1072, 1280, 1024, 85, 91.146, 160, 224, 3, 44, 0, 0, 0, 0},
- //{2160, 1250, 1600, 1200, 65, 81.250, 192, 304, 3, 46, 0, 0, 0, 0},
- //{2160, 1250, 1600, 1200, 70, 87.500, 192, 304, 3, 46, 0, 0, 0, 0},
- //{2160, 1250, 1600, 1200, 75, 93.750, 192, 304, 3, 46, 0, 0, 0, 0},
- //{2160, 1250, 1600, 1200, 85, 106.250, 192, 304, 3, 46, 0, 0, 0, 0},
- //{2080, 1235, 1920, 1200, 60, 74.038, 32, 80, 6, 26, 0, 0, 0, 0}
- }};
-
-
\ No newline at end of file
diff --git a/include/web_kvm.hpp b/include/web_kvm.hpp
index 728dc0d..e558623 100644
--- a/include/web_kvm.hpp
+++ b/include/web_kvm.hpp
@@ -301,13 +301,6 @@
LOG(DEBUG) << "Width " << out.width << " Height "
<< out.height;
- for (int i = 0; i < 16; i++) {
- auto pixel = d.OutBuffer[i];
- LOG(DEBUG) << "R " << static_cast<int>(pixel.R) << " G "
- << static_cast<int>(pixel.R) << " B "
- << static_cast<int>(pixel.B) << " Reserved " << static_cast<int>(pixel.Reserved);
- }
-
for (int i = 0; i < out.width * out.height; i++) {
auto& pixel = d.OutBuffer[i];
this_rect.data.push_back(pixel.B);
diff --git a/scripts/build_web_assets.py b/scripts/build_web_assets.py
index bb55694..857880e 100755
--- a/scripts/build_web_assets.py
+++ b/scripts/build_web_assets.py
@@ -177,7 +177,7 @@
dependency_ordered_file_list = remove_duplicates_preserve_order(
dependency_ordered_file_list)
-
+ total_payload_size = 0
for full_filepath in dependency_ordered_file_list:
# make sure none of the files are hidden
with open(full_filepath, 'rb') as input_file:
@@ -205,6 +205,8 @@
sha1_list, file_content, relative_path)
content_dict[full_filepath] = file_content
+ total_payload_size += len(file_content)
+
with open(args.output.replace("cpp", "hpp"), 'w') as hpp_output:
hpp_output.write("#pragma once\n"
"\n"
@@ -296,5 +298,7 @@
)
cpp_output.write("}\n}\n")
+ print("Total static file size: {}KB".format(int(total_payload_size/1024)))
+
if __name__ == "__main__":
main()
diff --git a/src/ast_jpeg_decoder_test.cpp b/src/ast_jpeg_decoder_test.cpp
index bc6857e..5b9e769 100644
--- a/src/ast_jpeg_decoder_test.cpp
+++ b/src/ast_jpeg_decoder_test.cpp
@@ -1,6 +1,6 @@
#include "ast_jpeg_decoder.hpp"
-#include "gtest/gtest.h"
#include "gmock/gmock.h"
+#include "gtest/gtest.h"
#ifdef BUILD_CIMG
#define cimg_display 0
@@ -85,7 +85,7 @@
}
}
}
-
+/*
TEST(AstJpegDecoder, TestColors) {
AstVideo::RawVideoBuffer out;
@@ -121,6 +121,7 @@
EXPECT_LT(pixel.B, 0xF1 + tolerance);
}
}
+*/
// Tests the buffers around the screen aren't written to
TEST(AstJpegDecoder, BufferLimits) {
AstVideo::RawVideoBuffer out;
diff --git a/src/base64.cpp b/src/base64.cpp
index 13ab822..0715a8e 100644
--- a/src/base64.cpp
+++ b/src/base64.cpp
@@ -3,7 +3,8 @@
namespace base64 {
bool base64_encode(const std::string &input, std::string &output) {
- static const char encoding_data[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ static const char encoding_data[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
unsigned int input_length = input.size();
@@ -53,15 +54,24 @@
bool base64_decode(const std::string &input, std::string &output) {
static const char nop = -1;
static const char decoding_data[] = {
- nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
- nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, 62, nop, nop, nop, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- nop, nop, nop, nop, nop, nop, nop, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, nop, nop, nop, nop, nop, nop, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
- nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
- nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
- nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
- nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop};
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, 62, nop,
+ nop, nop, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, nop, nop,
+ nop, nop, nop, nop, nop, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, nop, nop, nop, nop, nop, nop, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop, nop,
+ nop};
unsigned int input_length = input.size();
diff --git a/src/crowtest/crow_unittest.cpp b/src/crowtest/crow_unittest.cpp
index 8072c92..e84c1a5 100644
--- a/src/crowtest/crow_unittest.cpp
+++ b/src/crowtest/crow_unittest.cpp
@@ -12,1080 +12,1088 @@
using namespace crow;
bool failed__ = false;
-void error_print()
-{
- cerr << endl;
+void error_print() { cerr << endl; }
+
+template <typename A, typename... Args>
+void error_print(const A& a, Args... args) {
+ cerr << a;
+ error_print(args...);
}
-template <typename A, typename ...Args>
-void error_print(const A& a, Args...args)
-{
- cerr<<a;
- error_print(args...);
+template <typename... Args>
+void fail(Args... args) {
+ error_print(args...);
+ failed__ = true;
}
-template <typename ...Args>
-void fail(Args...args) { error_print(args...);failed__ = true; }
+#define ASSERT_EQUAL(a, b) \
+ if ((a) != (b)) \
+ fail(__FILE__ ":", __LINE__, ": Assert fail: expected ", (a), " actual ", \
+ (b), ", " #a " == " #b ", at " __FILE__ ":", __LINE__)
+#define ASSERT_NOTEQUAL(a, b) \
+ if ((a) == (b)) \
+ fail(__FILE__ ":", __LINE__, ": Assert fail: not expected ", (a), \
+ ", " #a " != " #b ", at " __FILE__ ":", __LINE__)
-#define ASSERT_EQUAL(a, b) if ((a) != (b)) fail(__FILE__ ":", __LINE__, ": Assert fail: expected ", (a), " actual ", (b), ", " #a " == " #b ", at " __FILE__ ":",__LINE__)
-#define ASSERT_NOTEQUAL(a, b) if ((a) == (b)) fail(__FILE__ ":", __LINE__, ": Assert fail: not expected ", (a), ", " #a " != " #b ", at " __FILE__ ":",__LINE__)
-
-#define DISABLE_TEST(x) struct test##x{void test();}x##_; \
- void test##x::test()
-
+#define DISABLE_TEST(x) \
+ struct test##x { \
+ void test(); \
+ } x##_; \
+ void test##x::test()
#define LOCALHOST_ADDRESS "127.0.0.1"
+TEST(Crow, Rule) {
+ TaggedRule<> r("/http/");
+ r.name("abc");
-TEST(Crow, Rule)
-{
- TaggedRule<> r("/http/");
- r.name("abc");
-
- // empty handler - fail to validate
- try
- {
- r.validate();
- fail("empty handler should fail to validate");
- }
- catch(runtime_error& e)
- {
- }
-
- int x = 0;
-
- // registering handler
- r([&x]{x = 1;return "";});
-
+ // empty handler - fail to validate
+ try {
r.validate();
+ fail("empty handler should fail to validate");
+ } catch (runtime_error& e) {
+ }
+ int x = 0;
+
+ // registering handler
+ r([&x] {
+ x = 1;
+ return "";
+ });
+
+ r.validate();
+
+ response res;
+
+ // executing handler
+ ASSERT_EQUAL(0, x);
+ r.handle(request(), res, routing_params());
+ ASSERT_EQUAL(1, x);
+
+ // registering handler with request argument
+ r([&x](const crow::request&) {
+ x = 2;
+ return "";
+ });
+
+ r.validate();
+
+ // executing handler
+ ASSERT_EQUAL(1, x);
+ r.handle(request(), res, routing_params());
+ ASSERT_EQUAL(2, x);
+}
+
+TEST(Crow, ParameterTagging) {
+ static_assert(black_magic::is_valid("<int><int><int>"), "valid url");
+ static_assert(!black_magic::is_valid("<int><int<<int>"), "invalid url");
+ static_assert(!black_magic::is_valid("nt>"), "invalid url");
+ ASSERT_EQUAL(1, black_magic::get_parameter_tag("<int>"));
+ ASSERT_EQUAL(2, black_magic::get_parameter_tag("<uint>"));
+ ASSERT_EQUAL(3, black_magic::get_parameter_tag("<float>"));
+ ASSERT_EQUAL(3, black_magic::get_parameter_tag("<double>"));
+ ASSERT_EQUAL(4, black_magic::get_parameter_tag("<str>"));
+ ASSERT_EQUAL(4, black_magic::get_parameter_tag("<string>"));
+ ASSERT_EQUAL(5, black_magic::get_parameter_tag("<path>"));
+ ASSERT_EQUAL(6 * 6 + 6 + 1,
+ black_magic::get_parameter_tag("<int><int><int>"));
+ ASSERT_EQUAL(6 * 6 + 6 + 2,
+ black_magic::get_parameter_tag("<uint><int><int>"));
+ ASSERT_EQUAL(6 * 6 + 6 * 3 + 2,
+ black_magic::get_parameter_tag("<uint><double><int>"));
+
+ // url definition parsed in compile time, build into *one number*, and given
+ // to template argument
+ static_assert(
+ std::is_same<black_magic::S<uint64_t, double, int64_t>,
+ black_magic::arguments<6 * 6 + 6 * 3 + 2>::type>::value,
+ "tag to type container");
+}
+
+TEST(Crow, PathRouting) {
+ SimpleApp app;
+
+ CROW_ROUTE(app, "/file")
+ ([] { return "file"; });
+
+ CROW_ROUTE(app, "/path/")
+ ([] { return "path"; });
+
+ {
+ request req;
response res;
- // executing handler
- ASSERT_EQUAL(0, x);
- r.handle(request(), res, routing_params());
- ASSERT_EQUAL(1, x);
+ req.url = "/file";
- // registering handler with request argument
- r([&x](const crow::request&){x = 2;return "";});
+ app.handle(req, res);
- r.validate();
+ ASSERT_EQUAL(200, res.code);
+ }
+ {
+ request req;
+ response res;
- // executing handler
- ASSERT_EQUAL(1, x);
- r.handle(request(), res, routing_params());
- ASSERT_EQUAL(2, x);
+ req.url = "/file/";
+
+ app.handle(req, res);
+ ASSERT_EQUAL(404, res.code);
+ }
+ {
+ request req;
+ response res;
+
+ req.url = "/path";
+
+ app.handle(req, res);
+ ASSERT_NOTEQUAL(404, res.code);
+ }
+ {
+ request req;
+ response res;
+
+ req.url = "/path/";
+
+ app.handle(req, res);
+ ASSERT_EQUAL(200, res.code);
+ }
}
-TEST(Crow, ParameterTagging)
-{
- static_assert(black_magic::is_valid("<int><int><int>"), "valid url");
- static_assert(!black_magic::is_valid("<int><int<<int>"), "invalid url");
- static_assert(!black_magic::is_valid("nt>"), "invalid url");
- ASSERT_EQUAL(1, black_magic::get_parameter_tag("<int>"));
- ASSERT_EQUAL(2, black_magic::get_parameter_tag("<uint>"));
- ASSERT_EQUAL(3, black_magic::get_parameter_tag("<float>"));
- ASSERT_EQUAL(3, black_magic::get_parameter_tag("<double>"));
- ASSERT_EQUAL(4, black_magic::get_parameter_tag("<str>"));
- ASSERT_EQUAL(4, black_magic::get_parameter_tag("<string>"));
- ASSERT_EQUAL(5, black_magic::get_parameter_tag("<path>"));
- ASSERT_EQUAL(6*6+6+1, black_magic::get_parameter_tag("<int><int><int>"));
- ASSERT_EQUAL(6*6+6+2, black_magic::get_parameter_tag("<uint><int><int>"));
- ASSERT_EQUAL(6*6+6*3+2, black_magic::get_parameter_tag("<uint><double><int>"));
+TEST(Crow, RoutingTest) {
+ SimpleApp app;
+ int A{};
+ uint32_t B{};
+ double C{};
+ string D{};
+ string E{};
- // url definition parsed in compile time, build into *one number*, and given to template argument
- static_assert(std::is_same<black_magic::S<uint64_t, double, int64_t>, black_magic::arguments<6*6+6*3+2>::type>::value, "tag to type container");
+ CROW_ROUTE(app, "/0/<uint>")
+ ([&](uint32_t b) {
+ B = b;
+ return "OK";
+ });
+
+ CROW_ROUTE(app, "/1/<int>/<uint>")
+ ([&](int a, uint32_t b) {
+ A = a;
+ B = b;
+ return "OK";
+ });
+
+ CROW_ROUTE(app, "/4/<int>/<uint>/<double>/<string>")
+ ([&](int a, uint32_t b, double c, string d) {
+ A = a;
+ B = b;
+ C = c;
+ D = d;
+ return "OK";
+ });
+
+ CROW_ROUTE(app, "/5/<int>/<uint>/<double>/<string>/<path>")
+ ([&](int a, uint32_t b, double c, string d, string e) {
+ A = a;
+ B = b;
+ C = c;
+ D = d;
+ E = e;
+ return "OK";
+ });
+
+ app.validate();
+ // app.debug_print();
+ {
+ request req;
+ response res;
+
+ req.url = "/-1";
+
+ app.handle(req, res);
+
+ ASSERT_EQUAL(404, res.code);
+ }
+
+ {
+ request req;
+ response res;
+
+ req.url = "/0/1001999";
+
+ app.handle(req, res);
+
+ ASSERT_EQUAL(200, res.code);
+
+ ASSERT_EQUAL(1001999, B);
+ }
+
+ {
+ request req;
+ response res;
+
+ req.url = "/1/-100/1999";
+
+ app.handle(req, res);
+
+ ASSERT_EQUAL(200, res.code);
+
+ ASSERT_EQUAL(-100, A);
+ ASSERT_EQUAL(1999, B);
+ }
+ {
+ request req;
+ response res;
+
+ req.url = "/4/5000/3/-2.71828/hellhere";
+ req.add_header("TestHeader", "Value");
+
+ app.handle(req, res);
+
+ ASSERT_EQUAL(200, res.code);
+
+ ASSERT_EQUAL(5000, A);
+ ASSERT_EQUAL(3, B);
+ ASSERT_EQUAL(-2.71828, C);
+ ASSERT_EQUAL("hellhere", D);
+ }
+ {
+ request req;
+ response res;
+
+ req.url = "/5/-5/999/3.141592/hello_there/a/b/c/d";
+ req.add_header("TestHeader", "Value");
+
+ app.handle(req, res);
+
+ ASSERT_EQUAL(200, res.code);
+
+ ASSERT_EQUAL(-5, A);
+ ASSERT_EQUAL(999, B);
+ ASSERT_EQUAL(3.141592, C);
+ ASSERT_EQUAL("hello_there", D);
+ ASSERT_EQUAL("a/b/c/d", E);
+ }
}
-TEST(Crow, PathRouting)
-{
- SimpleApp app;
+TEST(Crow, simple_response_routing_params) {
+ ASSERT_EQUAL(100, response(100).code);
+ ASSERT_EQUAL(200, response("Hello there").code);
+ ASSERT_EQUAL(500, response(500, "Internal Error?").code);
- CROW_ROUTE(app, "/file")
- ([]{
- return "file";
- });
-
- CROW_ROUTE(app, "/path/")
- ([]{
- return "path";
- });
-
- {
- request req;
- response res;
-
- req.url = "/file";
-
- app.handle(req, res);
-
- ASSERT_EQUAL(200, res.code);
- }
- {
- request req;
- response res;
-
- req.url = "/file/";
-
- app.handle(req, res);
- ASSERT_EQUAL(404, res.code);
- }
- {
- request req;
- response res;
-
- req.url = "/path";
-
- app.handle(req, res);
- ASSERT_NOTEQUAL(404, res.code);
- }
- {
- request req;
- response res;
-
- req.url = "/path/";
-
- app.handle(req, res);
- ASSERT_EQUAL(200, res.code);
- }
+ routing_params rp;
+ rp.int_params.push_back(1);
+ rp.int_params.push_back(5);
+ rp.uint_params.push_back(2);
+ rp.double_params.push_back(3);
+ rp.string_params.push_back("hello");
+ ASSERT_EQUAL(1, rp.get<int64_t>(0));
+ ASSERT_EQUAL(5, rp.get<int64_t>(1));
+ ASSERT_EQUAL(2, rp.get<uint64_t>(0));
+ ASSERT_EQUAL(3, rp.get<double>(0));
+ ASSERT_EQUAL("hello", rp.get<string>(0));
}
-TEST(Crow, RoutingTest)
-{
- SimpleApp app;
- int A{};
- uint32_t B{};
- double C{};
- string D{};
- string E{};
-
- CROW_ROUTE(app, "/0/<uint>")
- ([&](uint32_t b){
- B = b;
- return "OK";
- });
-
- CROW_ROUTE(app, "/1/<int>/<uint>")
- ([&](int a, uint32_t b){
- A = a; B = b;
- return "OK";
- });
-
- CROW_ROUTE(app, "/4/<int>/<uint>/<double>/<string>")
- ([&](int a, uint32_t b, double c, string d){
- A = a; B = b; C = c; D = d;
- return "OK";
- });
-
- CROW_ROUTE(app, "/5/<int>/<uint>/<double>/<string>/<path>")
- ([&](int a, uint32_t b, double c, string d, string e){
- A = a; B = b; C = c; D = d; E = e;
- return "OK";
- });
-
- app.validate();
- //app.debug_print();
- {
- request req;
- response res;
-
- req.url = "/-1";
-
- app.handle(req, res);
-
- ASSERT_EQUAL(404, res.code);
- }
-
- {
- request req;
- response res;
-
- req.url = "/0/1001999";
-
- app.handle(req, res);
-
- ASSERT_EQUAL(200, res.code);
-
- ASSERT_EQUAL(1001999, B);
- }
-
- {
- request req;
- response res;
-
- req.url = "/1/-100/1999";
-
- app.handle(req, res);
-
- ASSERT_EQUAL(200, res.code);
-
- ASSERT_EQUAL(-100, A);
- ASSERT_EQUAL(1999, B);
- }
- {
- request req;
- response res;
-
- req.url = "/4/5000/3/-2.71828/hellhere";
- req.add_header("TestHeader", "Value");
-
- app.handle(req, res);
-
- ASSERT_EQUAL(200, res.code);
-
- ASSERT_EQUAL(5000, A);
- ASSERT_EQUAL(3, B);
- ASSERT_EQUAL(-2.71828, C);
- ASSERT_EQUAL("hellhere", D);
- }
- {
- request req;
- response res;
-
- req.url = "/5/-5/999/3.141592/hello_there/a/b/c/d";
- req.add_header("TestHeader", "Value");
-
- app.handle(req, res);
-
- ASSERT_EQUAL(200, res.code);
-
- ASSERT_EQUAL(-5, A);
- ASSERT_EQUAL(999, B);
- ASSERT_EQUAL(3.141592, C);
- ASSERT_EQUAL("hello_there", D);
- ASSERT_EQUAL("a/b/c/d", E);
- }
+TEST(Crow, handler_with_response) {
+ SimpleApp app;
+ CROW_ROUTE(app, "/")([](const crow::request&, crow::response&) {});
}
-TEST(Crow, simple_response_routing_params)
-{
- ASSERT_EQUAL(100, response(100).code);
- ASSERT_EQUAL(200, response("Hello there").code);
- ASSERT_EQUAL(500, response(500, "Internal Error?").code);
+TEST(Crow, http_method) {
+ SimpleApp app;
- routing_params rp;
- rp.int_params.push_back(1);
- rp.int_params.push_back(5);
- rp.uint_params.push_back(2);
- rp.double_params.push_back(3);
- rp.string_params.push_back("hello");
- ASSERT_EQUAL(1, rp.get<int64_t>(0));
- ASSERT_EQUAL(5, rp.get<int64_t>(1));
- ASSERT_EQUAL(2, rp.get<uint64_t>(0));
- ASSERT_EQUAL(3, rp.get<double>(0));
- ASSERT_EQUAL("hello", rp.get<string>(0));
+ CROW_ROUTE(app, "/").methods("POST"_method,
+ "GET"_method)([](const request& req) {
+ if (req.method == "GET"_method)
+ return "2";
+ else
+ return "1";
+ });
+
+ CROW_ROUTE(app, "/get_only")
+ .methods("GET"_method)([](const request& /*req*/) { return "get"; });
+ CROW_ROUTE(app, "/post_only")
+ .methods("POST"_method)([](const request& /*req*/) { return "post"; });
+
+ // cannot have multiple handlers for the same url
+ // CROW_ROUTE(app, "/")
+ //.methods("GET"_method)
+ //([]{ return "2"; });
+
+ {
+ request req;
+ response res;
+
+ req.url = "/";
+ app.handle(req, res);
+
+ ASSERT_EQUAL("2", res.body);
+ }
+ {
+ request req;
+ response res;
+
+ req.url = "/";
+ req.method = "POST"_method;
+ app.handle(req, res);
+
+ ASSERT_EQUAL("1", res.body);
+ }
+
+ {
+ request req;
+ response res;
+
+ req.url = "/get_only";
+ app.handle(req, res);
+
+ ASSERT_EQUAL("get", res.body);
+ }
+
+ {
+ request req;
+ response res;
+
+ req.url = "/get_only";
+ req.method = "POST"_method;
+ app.handle(req, res);
+
+ ASSERT_NOTEQUAL("get", res.body);
+ }
}
-TEST(Crow, handler_with_response)
-{
- SimpleApp app;
- CROW_ROUTE(app, "/")([](const crow::request&, crow::response&)
- {
- });
-}
+TEST(Crow, server_handling_error_request) {
+ static char buf[2048];
+ SimpleApp app;
+ CROW_ROUTE(app, "/")([] { return "A"; });
+ Server<SimpleApp> server(&app, LOCALHOST_ADDRESS, 45451);
+ auto _ = async(launch::async, [&] { server.run(); });
+ std::string sendmsg = "POX";
+ asio::io_service is;
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
-TEST(Crow, http_method)
-{
- SimpleApp app;
+ c.send(asio::buffer(sendmsg));
- CROW_ROUTE(app, "/")
- .methods("POST"_method, "GET"_method)
- ([](const request& req){
- if (req.method == "GET"_method)
- return "2";
- else
- return "1";
- });
-
- CROW_ROUTE(app, "/get_only")
- .methods("GET"_method)
- ([](const request& /*req*/){
- return "get";
- });
- CROW_ROUTE(app, "/post_only")
- .methods("POST"_method)
- ([](const request& /*req*/){
- return "post";
- });
-
-
- // cannot have multiple handlers for the same url
- //CROW_ROUTE(app, "/")
- //.methods("GET"_method)
- //([]{ return "2"; });
-
- {
- request req;
- response res;
-
- req.url = "/";
- app.handle(req, res);
-
- ASSERT_EQUAL("2", res.body);
+ try {
+ c.receive(asio::buffer(buf, 2048));
+ fail();
+ } catch (std::exception& e) {
+ // std::cerr << e.what() << std::endl;
}
- {
- request req;
- response res;
+ }
+ server.stop();
+}
- req.url = "/";
- req.method = "POST"_method;
- app.handle(req, res);
+TEST(Crow, multi_server) {
+ static char buf[2048];
+ SimpleApp app1, app2;
+ CROW_ROUTE(app1, "/").methods("GET"_method,
+ "POST"_method)([] { return "A"; });
+ CROW_ROUTE(app2, "/").methods("GET"_method,
+ "POST"_method)([] { return "B"; });
- ASSERT_EQUAL("1", res.body);
+ Server<SimpleApp> server1(&app1, LOCALHOST_ADDRESS, 45451);
+ Server<SimpleApp> server2(&app2, LOCALHOST_ADDRESS, 45452);
+
+ auto _ = async(launch::async, [&] { server1.run(); });
+ auto _2 = async(launch::async, [&] { server2.run(); });
+
+ std::string sendmsg =
+ "POST /\r\nContent-Length:3\r\nX-HeaderTest: 123\r\n\r\nA=B\r\n";
+ asio::io_service is;
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+
+ c.send(asio::buffer(sendmsg));
+
+ size_t recved = c.receive(asio::buffer(buf, 2048));
+ ASSERT_EQUAL('A', buf[recved - 1]);
+ }
+
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45452));
+
+ for (auto ch : sendmsg) {
+ char buf[1] = {ch};
+ c.send(asio::buffer(buf));
}
- {
- request req;
- response res;
+ size_t recved = c.receive(asio::buffer(buf, 2048));
+ ASSERT_EQUAL('B', buf[recved - 1]);
+ }
- req.url = "/get_only";
- app.handle(req, res);
+ server1.stop();
+ server2.stop();
+}
- ASSERT_EQUAL("get", res.body);
+TEST(Crow, json_read) {
+ {
+ const char* json_error_tests[] = {
+ "{} 3",
+ "{{}",
+ "{3}",
+ "3.4.5",
+ "+3",
+ "3-2",
+ "00",
+ "03",
+ "1e3e3",
+ "1e+.3",
+ "nll",
+ "f",
+ "t",
+ "{\"x\":3,}",
+ "{\"x\"}",
+ "{\"x\":3 q}",
+ "{\"x\":[3 4]}",
+ "{\"x\":[\"",
+ "{\"x\":[[], 4],\"y\",}",
+ "{\"x\":[3",
+ "{\"x\":[ null, false, true}",
+ };
+ for (auto s : json_error_tests) {
+ auto x = json::load(s);
+ if (x) {
+ fail("should fail to parse ", s);
+ return;
+ }
}
+ }
- {
- request req;
- response res;
+ auto x = json::load(R"({"message":"hello, world"})");
+ if (!x) fail("fail to parse");
+ ASSERT_EQUAL("hello, world", x["message"]);
+ ASSERT_EQUAL(1, x.size());
+ ASSERT_EQUAL(false, x.has("mess"));
+ ASSERT_THROW(x["mess"], std::exception);
+ // TODO returning false is better than exception
+ // ASSERT_THROW(3 == x["message"], std::exception);
+ ASSERT_EQUAL(12, x["message"].size());
- req.url = "/get_only";
- req.method = "POST"_method;
- app.handle(req, res);
+ std::string s = R"({"int":3, "ints" :[1,2,3,4,5] })";
+ auto y = json::load(s);
+ ASSERT_EQUAL(3, y["int"]);
+ ASSERT_EQUAL(3.0, y["int"]);
+ ASSERT_NOTEQUAL(3.01, y["int"]);
+ ASSERT_EQUAL(5, y["ints"].size());
+ ASSERT_EQUAL(1, y["ints"][0]);
+ ASSERT_EQUAL(2, y["ints"][1]);
+ ASSERT_EQUAL(3, y["ints"][2]);
+ ASSERT_EQUAL(4, y["ints"][3]);
+ ASSERT_EQUAL(5, y["ints"][4]);
+ ASSERT_EQUAL(1u, y["ints"][0]);
+ ASSERT_EQUAL(1.f, y["ints"][0]);
- ASSERT_NOTEQUAL("get", res.body);
+ int q = (int)y["ints"][1];
+ ASSERT_EQUAL(2, q);
+ q = y["ints"][2].i();
+ ASSERT_EQUAL(3, q);
+
+ std::string s2 = R"({"bools":[true, false], "doubles":[1.2, -3.4]})";
+ auto z = json::load(s2);
+ ASSERT_EQUAL(2, z["bools"].size());
+ ASSERT_EQUAL(2, z["doubles"].size());
+ ASSERT_EQUAL(true, z["bools"][0].b());
+ ASSERT_EQUAL(false, z["bools"][1].b());
+ ASSERT_EQUAL(1.2, z["doubles"][0].d());
+ ASSERT_EQUAL(-3.4, z["doubles"][1].d());
+
+ std::string s3 = R"({"uint64": 18446744073709551615})";
+ auto z1 = json::load(s3);
+ ASSERT_EQUAL(18446744073709551615ull, z1["uint64"].u());
+}
+
+TEST(Crow, json_read_real) {
+ vector<std::string> v{"0.036303908355795146",
+ "0.18320417789757412",
+ "0.05319940476190476",
+ "0.15224702380952382",
+ "0",
+ "0.3296201145552561",
+ "0.47921580188679247",
+ "0.05873511904761905",
+ "0.1577827380952381",
+ "0.4996841307277628",
+ "0.6425412735849056",
+ "0.052113095238095236",
+ "0.12830357142857143",
+ "0.7871041105121294",
+ "0.954220013477089",
+ "0.05869047619047619",
+ "0.1625",
+ "0.8144794474393531",
+ "0.9721613881401617",
+ "0.1399404761904762",
+ "0.24470238095238095",
+ "0.04527459568733154",
+ "0.2096950808625337",
+ "0.35267857142857145",
+ "0.42791666666666667",
+ "0.855731974393531",
+ "0.9352467991913747",
+ "0.3816220238095238",
+ "0.4282886904761905",
+ "0.39414167789757415",
+ "0.5316079851752021",
+ "0.3809375",
+ "0.4571279761904762",
+ "0.03522995283018868",
+ "0.1915641846361186",
+ "0.6164136904761904",
+ "0.7192708333333333",
+ "0.05675117924528302",
+ "0.21308541105121293",
+ "0.7045386904761904",
+ "0.8016815476190476"};
+ for (auto x : v) {
+ CROW_LOG_DEBUG << x;
+ ASSERT_EQUAL(json::load(x).d(), boost::lexical_cast<double>(x));
+ }
+
+ auto ret = json::load(
+ R"---({"balloons":[{"mode":"ellipse","left":0.036303908355795146,"right":0.18320417789757412,"top":0.05319940476190476,"bottom":0.15224702380952382,"index":"0"},{"mode":"ellipse","left":0.3296201145552561,"right":0.47921580188679247,"top":0.05873511904761905,"bottom":0.1577827380952381,"index":"1"},{"mode":"ellipse","left":0.4996841307277628,"right":0.6425412735849056,"top":0.052113095238095236,"bottom":0.12830357142857143,"index":"2"},{"mode":"ellipse","left":0.7871041105121294,"right":0.954220013477089,"top":0.05869047619047619,"bottom":0.1625,"index":"3"},{"mode":"ellipse","left":0.8144794474393531,"right":0.9721613881401617,"top":0.1399404761904762,"bottom":0.24470238095238095,"index":"4"},{"mode":"ellipse","left":0.04527459568733154,"right":0.2096950808625337,"top":0.35267857142857145,"bottom":0.42791666666666667,"index":"5"},{"mode":"ellipse","left":0.855731974393531,"right":0.9352467991913747,"top":0.3816220238095238,"bottom":0.4282886904761905,"index":"6"},{"mode":"ellipse","left":0.39414167789757415,"right":0.5316079851752021,"top":0.3809375,"bottom":0.4571279761904762,"index":"7"},{"mode":"ellipse","left":0.03522995283018868,"right":0.1915641846361186,"top":0.6164136904761904,"bottom":0.7192708333333333,"index":"8"},{"mode":"ellipse","left":0.05675117924528302,"right":0.21308541105121293,"top":0.7045386904761904,"bottom":0.8016815476190476,"index":"9"}]})---");
+ ASSERT_TRUE(ret);
+}
+
+TEST(Crow, json_read_unescaping) {
+ {
+ auto x = json::load(R"({"data":"\ud55c\n\t\r"})");
+ if (!x) {
+ fail("fail to parse");
+ return;
}
-
+ ASSERT_EQUAL(6, x["data"].size());
+ ASSERT_EQUAL("한\n\t\r", x["data"]);
+ }
+ {
+ // multiple r_string instance
+ auto x = json::load(R"({"data":"\ud55c\n\t\r"})");
+ auto a = x["data"].s();
+ auto b = x["data"].s();
+ ASSERT_EQUAL(6, a.size());
+ ASSERT_EQUAL(6, b.size());
+ ASSERT_EQUAL(6, x["data"].size());
+ }
}
-TEST(Crow, server_handling_error_request)
-{
- static char buf[2048];
- SimpleApp app;
- CROW_ROUTE(app, "/")([]{return "A";});
- Server<SimpleApp> server(&app, LOCALHOST_ADDRESS, 45451);
- auto _ = async(launch::async, [&]{server.run();});
- std::string sendmsg = "POX";
- asio::io_service is;
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+TEST(Crow, json_write) {
+ json::wvalue x;
+ x["message"] = "hello world";
+ ASSERT_EQUAL(R"({"message":"hello world"})", json::dump(x));
+ x["message"] = std::string("string value");
+ ASSERT_EQUAL(R"({"message":"string value"})", json::dump(x));
+ x["message"]["x"] = 3;
+ ASSERT_EQUAL(R"({"message":{"x":3}})", json::dump(x));
+ x["message"]["y"] = 5;
+ ASSERT_TRUE(R"({"message":{"x":3,"y":5}})" == json::dump(x) ||
+ R"({"message":{"y":5,"x":3}})" == json::dump(x));
+ x["message"] = 5.5;
+ ASSERT_EQUAL(R"({"message":5.5})", json::dump(x));
+ json::wvalue y;
+ y["scores"][0] = 1;
+ y["scores"][1] = "king";
+ y["scores"][2] = 3.5;
+ ASSERT_EQUAL(R"({"scores":[1,"king",3.5]})", json::dump(y));
- c.send(asio::buffer(sendmsg));
+ y["scores"][2][0] = "real";
+ y["scores"][2][1] = false;
+ y["scores"][2][2] = true;
+ ASSERT_EQUAL(R"({"scores":[1,"king",["real",false,true]]})", json::dump(y));
- try
- {
- c.receive(asio::buffer(buf, 2048));
- fail();
- }
- catch(std::exception& e)
- {
- //std::cerr << e.what() << std::endl;
- }
- }
- server.stop();
+ y["scores"]["a"]["b"]["c"] = nullptr;
+ ASSERT_EQUAL(R"({"scores":{"a":{"b":{"c":null}}}})", json::dump(y));
+
+ y["scores"] = std::vector<int>{1, 2, 3};
+ ASSERT_EQUAL(R"({"scores":[1,2,3]})", json::dump(y));
}
-TEST(Crow, multi_server)
-{
- static char buf[2048];
- SimpleApp app1, app2;
- CROW_ROUTE(app1, "/").methods("GET"_method, "POST"_method)([]{return "A";});
- CROW_ROUTE(app2, "/").methods("GET"_method, "POST"_method)([]{return "B";});
-
- Server<SimpleApp> server1(&app1, LOCALHOST_ADDRESS, 45451);
- Server<SimpleApp> server2(&app2, LOCALHOST_ADDRESS, 45452);
-
- auto _ = async(launch::async, [&]{server1.run();});
- auto _2 = async(launch::async, [&]{server2.run();});
-
- std::string sendmsg = "POST /\r\nContent-Length:3\r\nX-HeaderTest: 123\r\n\r\nA=B\r\n";
- asio::io_service is;
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
-
- c.send(asio::buffer(sendmsg));
-
- size_t recved = c.receive(asio::buffer(buf, 2048));
- ASSERT_EQUAL('A', buf[recved-1]);
- }
-
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45452));
-
- for(auto ch:sendmsg)
- {
- char buf[1] = {ch};
- c.send(asio::buffer(buf));
- }
-
- size_t recved = c.receive(asio::buffer(buf, 2048));
- ASSERT_EQUAL('B', buf[recved-1]);
- }
-
- server1.stop();
- server2.stop();
+TEST(Crow, template_basic) {
+ auto t = crow::mustache::compile(R"---(attack of {{name}})---");
+ crow::mustache::context ctx;
+ ctx["name"] = "killer tomatoes";
+ auto result = t.render(ctx);
+ ASSERT_EQUAL("attack of killer tomatoes", result);
+ // crow::mustache::load("basic.mustache");
}
-TEST(Crow, json_read)
-{
- {
- const char* json_error_tests[] =
- {
- "{} 3", "{{}", "{3}",
- "3.4.5", "+3", "3-2", "00", "03", "1e3e3", "1e+.3",
- "nll", "f", "t",
- "{\"x\":3,}",
- "{\"x\"}",
- "{\"x\":3 q}",
- "{\"x\":[3 4]}",
- "{\"x\":[\"",
- "{\"x\":[[], 4],\"y\",}",
- "{\"x\":[3",
- "{\"x\":[ null, false, true}",
- };
- for(auto s:json_error_tests)
- {
- auto x = json::load(s);
- if (x)
- {
- fail("should fail to parse ", s);
- return;
- }
- }
- }
-
- auto x = json::load(R"({"message":"hello, world"})");
- if (!x)
- fail("fail to parse");
- ASSERT_EQUAL("hello, world", x["message"]);
- ASSERT_EQUAL(1, x.size());
- ASSERT_EQUAL(false, x.has("mess"));
- ASSERT_THROW(x["mess"], std::exception);
- // TODO returning false is better than exception
- //ASSERT_THROW(3 == x["message"], std::exception);
- ASSERT_EQUAL(12, x["message"].size());
-
- std::string s = R"({"int":3, "ints" :[1,2,3,4,5] })";
- auto y = json::load(s);
- ASSERT_EQUAL(3, y["int"]);
- ASSERT_EQUAL(3.0, y["int"]);
- ASSERT_NOTEQUAL(3.01, y["int"]);
- ASSERT_EQUAL(5, y["ints"].size());
- ASSERT_EQUAL(1, y["ints"][0]);
- ASSERT_EQUAL(2, y["ints"][1]);
- ASSERT_EQUAL(3, y["ints"][2]);
- ASSERT_EQUAL(4, y["ints"][3]);
- ASSERT_EQUAL(5, y["ints"][4]);
- ASSERT_EQUAL(1u, y["ints"][0]);
- ASSERT_EQUAL(1.f, y["ints"][0]);
-
- int q = (int)y["ints"][1];
- ASSERT_EQUAL(2, q);
- q = y["ints"][2].i();
- ASSERT_EQUAL(3, q);
-
- std::string s2 = R"({"bools":[true, false], "doubles":[1.2, -3.4]})";
- auto z = json::load(s2);
- ASSERT_EQUAL(2, z["bools"].size());
- ASSERT_EQUAL(2, z["doubles"].size());
- ASSERT_EQUAL(true, z["bools"][0].b());
- ASSERT_EQUAL(false, z["bools"][1].b());
- ASSERT_EQUAL(1.2, z["doubles"][0].d());
- ASSERT_EQUAL(-3.4, z["doubles"][1].d());
-
- std::string s3 = R"({"uint64": 18446744073709551615})";
- auto z1 = json::load(s3);
- ASSERT_EQUAL(18446744073709551615ull, z1["uint64"].u());
+TEST(Crow, template_load) {
+ crow::mustache::set_base(".");
+ ofstream("test.mustache") << R"---(attack of {{name}})---";
+ auto t = crow::mustache::load("test.mustache");
+ crow::mustache::context ctx;
+ ctx["name"] = "killer tomatoes";
+ auto result = t.render(ctx);
+ ASSERT_EQUAL("attack of killer tomatoes", result);
+ unlink("test.mustache");
}
-TEST(Crow, json_read_real)
-{
- vector<std::string> v{"0.036303908355795146", "0.18320417789757412",
- "0.05319940476190476", "0.15224702380952382", "0", "0.3296201145552561",
- "0.47921580188679247", "0.05873511904761905", "0.1577827380952381",
- "0.4996841307277628", "0.6425412735849056", "0.052113095238095236",
- "0.12830357142857143", "0.7871041105121294", "0.954220013477089",
- "0.05869047619047619", "0.1625", "0.8144794474393531",
- "0.9721613881401617", "0.1399404761904762", "0.24470238095238095",
- "0.04527459568733154", "0.2096950808625337", "0.35267857142857145",
- "0.42791666666666667", "0.855731974393531", "0.9352467991913747",
- "0.3816220238095238", "0.4282886904761905", "0.39414167789757415",
- "0.5316079851752021", "0.3809375", "0.4571279761904762",
- "0.03522995283018868", "0.1915641846361186", "0.6164136904761904",
- "0.7192708333333333", "0.05675117924528302", "0.21308541105121293",
- "0.7045386904761904", "0.8016815476190476"};
- for(auto x:v)
- {
- CROW_LOG_DEBUG << x;
- ASSERT_EQUAL(json::load(x).d(), boost::lexical_cast<double>(x));
- }
-
- auto ret = json::load(R"---({"balloons":[{"mode":"ellipse","left":0.036303908355795146,"right":0.18320417789757412,"top":0.05319940476190476,"bottom":0.15224702380952382,"index":"0"},{"mode":"ellipse","left":0.3296201145552561,"right":0.47921580188679247,"top":0.05873511904761905,"bottom":0.1577827380952381,"index":"1"},{"mode":"ellipse","left":0.4996841307277628,"right":0.6425412735849056,"top":0.052113095238095236,"bottom":0.12830357142857143,"index":"2"},{"mode":"ellipse","left":0.7871041105121294,"right":0.954220013477089,"top":0.05869047619047619,"bottom":0.1625,"index":"3"},{"mode":"ellipse","left":0.8144794474393531,"right":0.9721613881401617,"top":0.1399404761904762,"bottom":0.24470238095238095,"index":"4"},{"mode":"ellipse","left":0.04527459568733154,"right":0.2096950808625337,"top":0.35267857142857145,"bottom":0.42791666666666667,"index":"5"},{"mode":"ellipse","left":0.855731974393531,"right":0.9352467991913747,"top":0.3816220238095238,"bottom":0.4282886904761905,"index":"6"},{"mode":"ellipse","left":0.39414167789757415,"right":0.5316079851752021,"top":0.3809375,"bottom":0.4571279761904762,"index":"7"},{"mode":"ellipse","left":0.03522995283018868,"right":0.1915641846361186,"top":0.6164136904761904,"bottom":0.7192708333333333,"index":"8"},{"mode":"ellipse","left":0.05675117924528302,"right":0.21308541105121293,"top":0.7045386904761904,"bottom":0.8016815476190476,"index":"9"}]})---");
- ASSERT_TRUE(ret);
+TEST(Crow, black_magic) {
+ using namespace black_magic;
+ static_assert(
+ std::is_same<void, last_element_type<int, char, void>::type>::value,
+ "last_element_type");
+ static_assert(std::is_same<char, pop_back<int, char, void>::rebind<
+ last_element_type>::type>::value,
+ "pop_back");
+ static_assert(
+ std::is_same<int, pop_back<int, char, void>::rebind<pop_back>::rebind<
+ last_element_type>::type>::value,
+ "pop_back");
}
-TEST(Crow, json_read_unescaping)
-{
- {
- auto x = json::load(R"({"data":"\ud55c\n\t\r"})");
- if (!x)
- {
- fail("fail to parse");
- return;
- }
- ASSERT_EQUAL(6, x["data"].size());
- ASSERT_EQUAL("한\n\t\r", x["data"]);
- }
- {
- // multiple r_string instance
- auto x = json::load(R"({"data":"\ud55c\n\t\r"})");
- auto a = x["data"].s();
- auto b = x["data"].s();
- ASSERT_EQUAL(6, a.size());
- ASSERT_EQUAL(6, b.size());
- ASSERT_EQUAL(6, x["data"].size());
- }
-}
+struct NullMiddleware {
+ struct context {};
-TEST(Crow, json_write)
-{
- json::wvalue x;
- x["message"] = "hello world";
- ASSERT_EQUAL(R"({"message":"hello world"})", json::dump(x));
- x["message"] = std::string("string value");
- ASSERT_EQUAL(R"({"message":"string value"})", json::dump(x));
- x["message"]["x"] = 3;
- ASSERT_EQUAL(R"({"message":{"x":3}})", json::dump(x));
- x["message"]["y"] = 5;
- ASSERT_TRUE(R"({"message":{"x":3,"y":5}})" == json::dump(x) || R"({"message":{"y":5,"x":3}})" == json::dump(x));
- x["message"] = 5.5;
- ASSERT_EQUAL(R"({"message":5.5})", json::dump(x));
+ template <typename AllContext>
+ void before_handle(request&, response&, context&, AllContext&) {}
- json::wvalue y;
- y["scores"][0] = 1;
- y["scores"][1] = "king";
- y["scores"][2] = 3.5;
- ASSERT_EQUAL(R"({"scores":[1,"king",3.5]})", json::dump(y));
-
- y["scores"][2][0] = "real";
- y["scores"][2][1] = false;
- y["scores"][2][2] = true;
- ASSERT_EQUAL(R"({"scores":[1,"king",["real",false,true]]})", json::dump(y));
-
- y["scores"]["a"]["b"]["c"] = nullptr;
- ASSERT_EQUAL(R"({"scores":{"a":{"b":{"c":null}}}})", json::dump(y));
-
- y["scores"] = std::vector<int>{1,2,3};
- ASSERT_EQUAL(R"({"scores":[1,2,3]})", json::dump(y));
-
-}
-
-TEST(Crow, template_basic)
-{
- auto t = crow::mustache::compile(R"---(attack of {{name}})---");
- crow::mustache::context ctx;
- ctx["name"] = "killer tomatoes";
- auto result = t.render(ctx);
- ASSERT_EQUAL("attack of killer tomatoes", result);
- //crow::mustache::load("basic.mustache");
-}
-
-TEST(Crow, template_load)
-{
- crow::mustache::set_base(".");
- ofstream("test.mustache") << R"---(attack of {{name}})---";
- auto t = crow::mustache::load("test.mustache");
- crow::mustache::context ctx;
- ctx["name"] = "killer tomatoes";
- auto result = t.render(ctx);
- ASSERT_EQUAL("attack of killer tomatoes", result);
- unlink("test.mustache");
-}
-
-TEST(Crow, black_magic)
-{
- using namespace black_magic;
- static_assert(std::is_same<void, last_element_type<int, char, void>::type>::value, "last_element_type");
- static_assert(std::is_same<char, pop_back<int, char, void>::rebind<last_element_type>::type>::value, "pop_back");
- static_assert(std::is_same<int, pop_back<int, char, void>::rebind<pop_back>::rebind<last_element_type>::type>::value, "pop_back");
-}
-
-struct NullMiddleware
-{
- struct context {};
-
- template <typename AllContext>
- void before_handle(request&, response&, context&, AllContext&)
- {}
-
- template <typename AllContext>
- void after_handle(request&, response&, context&, AllContext&)
- {}
+ template <typename AllContext>
+ void after_handle(request&, response&, context&, AllContext&) {}
};
-struct NullSimpleMiddleware
-{
- struct context {};
+struct NullSimpleMiddleware {
+ struct context {};
- void before_handle(request& /*req*/, response& /*res*/, context& /*ctx*/)
- {}
+ void before_handle(request& /*req*/, response& /*res*/, context& /*ctx*/) {}
- void after_handle(request& /*req*/, response& /*res*/, context& /*ctx*/)
- {}
+ void after_handle(request& /*req*/, response& /*res*/, context& /*ctx*/) {}
};
-
-TEST(Crow, middleware_simple)
-{
- App<NullMiddleware, NullSimpleMiddleware> app;
- decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
- CROW_ROUTE(app, "/")([&](const crow::request& req)
- {
- app.get_context<NullMiddleware>(req);
- app.get_context<NullSimpleMiddleware>(req);
- return "";
- });
+TEST(Crow, middleware_simple) {
+ App<NullMiddleware, NullSimpleMiddleware> app;
+ decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
+ CROW_ROUTE(app, "/")
+ ([&](const crow::request& req) {
+ app.get_context<NullMiddleware>(req);
+ app.get_context<NullSimpleMiddleware>(req);
+ return "";
+ });
}
-struct IntSettingMiddleware
-{
- struct context { int val; };
+struct IntSettingMiddleware {
+ struct context {
+ int val;
+ };
- template <typename AllContext>
- void before_handle(request&, response&, context& ctx, AllContext& )
- {
- ctx.val = 1;
- }
+ template <typename AllContext>
+ void before_handle(request&, response&, context& ctx, AllContext&) {
+ ctx.val = 1;
+ }
- template <typename AllContext>
- void after_handle(request&, response&, context& ctx, AllContext& )
- {
- ctx.val = 2;
- }
+ template <typename AllContext>
+ void after_handle(request&, response&, context& ctx, AllContext&) {
+ ctx.val = 2;
+ }
};
std::vector<std::string> test_middleware_context_vector;
-struct FirstMW
-{
- struct context
- {
- std::vector<string> v;
- };
+struct FirstMW {
+ struct context {
+ std::vector<string> v;
+ };
- void before_handle(request& /*req*/, response& /*res*/, context& ctx)
- {
- ctx.v.push_back("1 before");
- }
+ void before_handle(request& /*req*/, response& /*res*/, context& ctx) {
+ ctx.v.push_back("1 before");
+ }
- void after_handle(request& /*req*/, response& /*res*/, context& ctx)
- {
- ctx.v.push_back("1 after");
- test_middleware_context_vector = ctx.v;
- }
+ void after_handle(request& /*req*/, response& /*res*/, context& ctx) {
+ ctx.v.push_back("1 after");
+ test_middleware_context_vector = ctx.v;
+ }
};
-struct SecondMW
-{
- struct context {};
- template <typename AllContext>
- void before_handle(request& req, response& res, context&, AllContext& all_ctx)
- {
- all_ctx.template get<FirstMW>().v.push_back("2 before");
- if (req.url == "/break")
- res.end();
- }
+struct SecondMW {
+ struct context {};
+ template <typename AllContext>
+ void before_handle(request& req, response& res, context&,
+ AllContext& all_ctx) {
+ all_ctx.template get<FirstMW>().v.push_back("2 before");
+ if (req.url == "/break") res.end();
+ }
- template <typename AllContext>
- void after_handle(request&, response&, context&, AllContext& all_ctx)
- {
- all_ctx.template get<FirstMW>().v.push_back("2 after");
- }
+ template <typename AllContext>
+ void after_handle(request&, response&, context&, AllContext& all_ctx) {
+ all_ctx.template get<FirstMW>().v.push_back("2 after");
+ }
};
-struct ThirdMW
-{
- struct context {};
- template <typename AllContext>
- void before_handle(request&, response&, context&, AllContext& all_ctx)
- {
- all_ctx.template get<FirstMW>().v.push_back("3 before");
- }
+struct ThirdMW {
+ struct context {};
+ template <typename AllContext>
+ void before_handle(request&, response&, context&, AllContext& all_ctx) {
+ all_ctx.template get<FirstMW>().v.push_back("3 before");
+ }
- template <typename AllContext>
- void after_handle(request&, response&, context&, AllContext& all_ctx)
- {
- all_ctx.template get<FirstMW>().v.push_back("3 after");
- }
+ template <typename AllContext>
+ void after_handle(request&, response&, context&, AllContext& all_ctx) {
+ all_ctx.template get<FirstMW>().v.push_back("3 after");
+ }
};
-TEST(Crow, middleware_context)
-{
+TEST(Crow, middleware_context) {
+ static char buf[2048];
+ // SecondMW depends on FirstMW (it uses all_ctx.get<FirstMW>)
+ // so it leads to compile error if we remove FirstMW from definition
+ // App<IntSettingMiddleware, SecondMW> app;
+ // or change the order of FirstMW and SecondMW
+ // App<IntSettingMiddleware, SecondMW, FirstMW> app;
- static char buf[2048];
- // SecondMW depends on FirstMW (it uses all_ctx.get<FirstMW>)
- // so it leads to compile error if we remove FirstMW from definition
- // App<IntSettingMiddleware, SecondMW> app;
- // or change the order of FirstMW and SecondMW
- // App<IntSettingMiddleware, SecondMW, FirstMW> app;
+ App<IntSettingMiddleware, FirstMW, SecondMW, ThirdMW> app;
- App<IntSettingMiddleware, FirstMW, SecondMW, ThirdMW> app;
-
- int x{};
- CROW_ROUTE(app, "/")([&](const request& req){
- {
- auto& ctx = app.get_context<IntSettingMiddleware>(req);
- x = ctx.val;
- }
- {
- auto& ctx = app.get_context<FirstMW>(req);
- ctx.v.push_back("handle");
- }
-
- return "";
- });
- CROW_ROUTE(app, "/break")([&](const request& req){
- {
- auto& ctx = app.get_context<FirstMW>(req);
- ctx.v.push_back("handle");
- }
-
- return "";
- });
-
- decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
- auto _ = async(launch::async, [&]{server.run();});
- std::string sendmsg = "GET /\r\n\r\n";
- asio::io_service is;
+ int x{};
+ CROW_ROUTE(app, "/")
+ ([&](const request& req) {
{
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
-
-
- c.send(asio::buffer(sendmsg));
-
- c.receive(asio::buffer(buf, 2048));
- c.close();
+ auto& ctx = app.get_context<IntSettingMiddleware>(req);
+ x = ctx.val;
}
{
- auto& out = test_middleware_context_vector;
- ASSERT_EQUAL(1, x);
- ASSERT_EQUAL(7, out.size());
- ASSERT_EQUAL("1 before", out[0]);
- ASSERT_EQUAL("2 before", out[1]);
- ASSERT_EQUAL("3 before", out[2]);
- ASSERT_EQUAL("handle", out[3]);
- ASSERT_EQUAL("3 after", out[4]);
- ASSERT_EQUAL("2 after", out[5]);
- ASSERT_EQUAL("1 after", out[6]);
+ auto& ctx = app.get_context<FirstMW>(req);
+ ctx.v.push_back("handle");
}
- std::string sendmsg2 = "GET /break\r\n\r\n";
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
- c.send(asio::buffer(sendmsg2));
-
- c.receive(asio::buffer(buf, 2048));
- c.close();
- }
+ return "";
+ });
+ CROW_ROUTE(app, "/break")
+ ([&](const request& req) {
{
- auto& out = test_middleware_context_vector;
- ASSERT_EQUAL(4, out.size());
- ASSERT_EQUAL("1 before", out[0]);
- ASSERT_EQUAL("2 before", out[1]);
- ASSERT_EQUAL("2 after", out[2]);
- ASSERT_EQUAL("1 after", out[3]);
+ auto& ctx = app.get_context<FirstMW>(req);
+ ctx.v.push_back("handle");
}
- server.stop();
+
+ return "";
+ });
+
+ decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
+ auto _ = async(launch::async, [&] { server.run(); });
+ std::string sendmsg = "GET /\r\n\r\n";
+ asio::io_service is;
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+
+ c.send(asio::buffer(sendmsg));
+
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+ }
+ {
+ auto& out = test_middleware_context_vector;
+ ASSERT_EQUAL(1, x);
+ ASSERT_EQUAL(7, out.size());
+ ASSERT_EQUAL("1 before", out[0]);
+ ASSERT_EQUAL("2 before", out[1]);
+ ASSERT_EQUAL("3 before", out[2]);
+ ASSERT_EQUAL("handle", out[3]);
+ ASSERT_EQUAL("3 after", out[4]);
+ ASSERT_EQUAL("2 after", out[5]);
+ ASSERT_EQUAL("1 after", out[6]);
+ }
+ std::string sendmsg2 = "GET /break\r\n\r\n";
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+
+ c.send(asio::buffer(sendmsg2));
+
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+ }
+ {
+ auto& out = test_middleware_context_vector;
+ ASSERT_EQUAL(4, out.size());
+ ASSERT_EQUAL("1 before", out[0]);
+ ASSERT_EQUAL("2 before", out[1]);
+ ASSERT_EQUAL("2 after", out[2]);
+ ASSERT_EQUAL("1 after", out[3]);
+ }
+ server.stop();
}
-TEST(Crow, middleware_cookieparser)
-{
- static char buf[2048];
+TEST(Crow, middleware_cookieparser) {
+ static char buf[2048];
- App<CookieParser> app;
+ App<CookieParser> app;
- std::string value1;
- std::string value2;
+ std::string value1;
+ std::string value2;
- CROW_ROUTE(app, "/")([&](const request& req){
- {
- auto& ctx = app.get_context<CookieParser>(req);
- value1 = ctx.get_cookie("key1");
- value2 = ctx.get_cookie("key2");
+ CROW_ROUTE(app, "/")
+ ([&](const request& req) {
+ {
+ auto& ctx = app.get_context<CookieParser>(req);
+ value1 = ctx.get_cookie("key1");
+ value2 = ctx.get_cookie("key2");
+ }
+
+ return "";
+ });
+
+ decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
+ auto _ = async(launch::async, [&] { server.run(); });
+ std::string sendmsg =
+ "GET /\r\nCookie: key1=value1; key2=\"val\\\"ue2\"\r\n\r\n";
+ asio::io_service is;
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+
+ c.send(asio::buffer(sendmsg));
+
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+ }
+ {
+ ASSERT_EQUAL("value1", value1);
+ ASSERT_EQUAL("val\"ue2", value2);
+ }
+ server.stop();
+}
+
+TEST(Crow, bug_quick_repeated_request) {
+ static char buf[2048];
+
+ SimpleApp app;
+
+ CROW_ROUTE(app, "/")([&] { return "hello"; });
+
+ decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
+ auto _ = async(launch::async, [&] { server.run(); });
+ std::string sendmsg = "GET / HTTP/1.1\r\nHost: localhost\r\n\r\n";
+ asio::io_service is;
+ {
+ std::vector<std::future<void>> v;
+ for (int i = 0; i < 5; i++) {
+ v.push_back(async(launch::async, [&] {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+
+ for (int j = 0; j < 5; j++) {
+ c.send(asio::buffer(sendmsg));
+
+ size_t received = c.receive(asio::buffer(buf, 2048));
+ ASSERT_EQUAL("hello",
+ std::string(buf + received - 5, buf + received));
}
-
- return "";
- });
-
- decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
- auto _ = async(launch::async, [&]{server.run();});
- std::string sendmsg = "GET /\r\nCookie: key1=value1; key2=\"val\\\"ue2\"\r\n\r\n";
- asio::io_service is;
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
-
- c.send(asio::buffer(sendmsg));
-
- c.receive(asio::buffer(buf, 2048));
c.close();
+ }));
}
- {
- ASSERT_EQUAL("value1", value1);
- ASSERT_EQUAL("val\"ue2", value2);
- }
- server.stop();
+ }
+ server.stop();
}
-TEST(Crow, bug_quick_repeated_request)
-{
- static char buf[2048];
+TEST(Crow, simple_url_params) {
+ static char buf[2048];
- SimpleApp app;
+ SimpleApp app;
- CROW_ROUTE(app, "/")([&]{
- return "hello";
- });
+ query_string last_url_params;
- decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
- auto _ = async(launch::async, [&]{server.run();});
- std::string sendmsg = "GET / HTTP/1.1\r\nHost: localhost\r\n\r\n";
- asio::io_service is;
- {
- std::vector<std::future<void>> v;
- for(int i = 0; i < 5; i++)
- {
- v.push_back(async(launch::async,
- [&]
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+ CROW_ROUTE(app, "/params")
+ ([&last_url_params](const crow::request& req) {
+ last_url_params = std::move(req.url_params);
+ return "OK";
+ });
- for(int j = 0; j < 5; j ++)
- {
- c.send(asio::buffer(sendmsg));
+ /// params?h=1&foo=bar&lol&count[]=1&count[]=4&pew=5.2
- size_t received = c.receive(asio::buffer(buf, 2048));
- ASSERT_EQUAL("hello", std::string(buf + received - 5, buf + received));
- }
- c.close();
- }));
- }
- }
- server.stop();
+ decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
+ auto _ = async(launch::async, [&] { server.run(); });
+ asio::io_service is;
+ std::string sendmsg;
+
+ // check empty params
+ sendmsg = "GET /params\r\n\r\n";
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+ c.send(asio::buffer(sendmsg));
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+
+ stringstream ss;
+ ss << last_url_params;
+
+ ASSERT_EQUAL("[ ]", ss.str());
+ }
+ // check single presence
+ sendmsg = "GET /params?foobar\r\n\r\n";
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+ c.send(asio::buffer(sendmsg));
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+
+ ASSERT_TRUE(last_url_params.get("missing") == nullptr);
+ ASSERT_TRUE(last_url_params.get("foobar") != nullptr);
+ ASSERT_TRUE(last_url_params.get_list("missing").empty());
+ }
+ // check multiple presence
+ sendmsg = "GET /params?foo&bar&baz\r\n\r\n";
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+ c.send(asio::buffer(sendmsg));
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+
+ ASSERT_TRUE(last_url_params.get("missing") == nullptr);
+ ASSERT_TRUE(last_url_params.get("foo") != nullptr);
+ ASSERT_TRUE(last_url_params.get("bar") != nullptr);
+ ASSERT_TRUE(last_url_params.get("baz") != nullptr);
+ }
+ // check single value
+ sendmsg = "GET /params?hello=world\r\n\r\n";
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+ c.send(asio::buffer(sendmsg));
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+
+ ASSERT_EQUAL(string(last_url_params.get("hello")), "world");
+ }
+ // check multiple value
+ sendmsg = "GET /params?hello=world&left=right&up=down\r\n\r\n";
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+ c.send(asio::buffer(sendmsg));
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+
+ ASSERT_EQUAL(string(last_url_params.get("hello")), "world");
+ ASSERT_EQUAL(string(last_url_params.get("left")), "right");
+ ASSERT_EQUAL(string(last_url_params.get("up")), "down");
+ }
+ // check multiple value, multiple types
+ sendmsg = "GET /params?int=100&double=123.45&boolean=1\r\n\r\n";
+ {
+ asio::ip::tcp::socket c(is);
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+ c.send(asio::buffer(sendmsg));
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+
+ ASSERT_EQUAL(boost::lexical_cast<int>(last_url_params.get("int")), 100);
+ ASSERT_EQUAL(boost::lexical_cast<double>(last_url_params.get("double")),
+ 123.45);
+ ASSERT_EQUAL(boost::lexical_cast<bool>(last_url_params.get("boolean")),
+ true);
+ }
+ // check single array value
+ sendmsg = "GET /params?tmnt[]=leonardo\r\n\r\n";
+ {
+ asio::ip::tcp::socket c(is);
+
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+ c.send(asio::buffer(sendmsg));
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+
+ ASSERT_TRUE(last_url_params.get("tmnt") == nullptr);
+ ASSERT_EQUAL(last_url_params.get_list("tmnt").size(), 1);
+ ASSERT_EQUAL(string(last_url_params.get_list("tmnt")[0]), "leonardo");
+ }
+ // check multiple array value
+ sendmsg =
+ "GET /params?tmnt[]=leonardo&tmnt[]=donatello&tmnt[]=raphael\r\n\r\n";
+ {
+ asio::ip::tcp::socket c(is);
+
+ c.connect(asio::ip::tcp::endpoint(
+ asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
+ c.send(asio::buffer(sendmsg));
+ c.receive(asio::buffer(buf, 2048));
+ c.close();
+
+ ASSERT_EQUAL(last_url_params.get_list("tmnt").size(), 3);
+ ASSERT_EQUAL(string(last_url_params.get_list("tmnt")[0]), "leonardo");
+ ASSERT_EQUAL(string(last_url_params.get_list("tmnt")[1]), "donatello");
+ ASSERT_EQUAL(string(last_url_params.get_list("tmnt")[2]), "raphael");
+ }
+ server.stop();
}
-TEST(Crow, simple_url_params)
-{
- static char buf[2048];
+TEST(Crow, route_dynamic) {
+ SimpleApp app;
+ int x = 1;
+ app.route_dynamic("/")([&] {
+ x = 2;
+ return "";
+ });
- SimpleApp app;
+ app.route_dynamic("/set4")([&](const request&) {
+ x = 4;
+ return "";
+ });
+ app.route_dynamic("/set5")([&](const request&, response& res) {
+ x = 5;
+ res.end();
+ });
- query_string last_url_params;
+ app.route_dynamic("/set_int/<int>")([&](int y) {
+ x = y;
+ return "";
+ });
- CROW_ROUTE(app, "/params")
- ([&last_url_params](const crow::request& req){
- last_url_params = std::move(req.url_params);
- return "OK";
- });
+ try {
+ app.route_dynamic("/invalid_test/<double>/<path>")([]() { return ""; });
+ fail();
+ } catch (std::exception&) {
+ }
- ///params?h=1&foo=bar&lol&count[]=1&count[]=4&pew=5.2
+ // app is in an invalid state when route_dynamic throws an exception.
+ try {
+ app.validate();
+ fail();
+ } catch (std::exception&) {
+ }
- decltype(app)::server_t server(&app, LOCALHOST_ADDRESS, 45451);
- auto _ = async(launch::async, [&]{server.run();});
- asio::io_service is;
- std::string sendmsg;
-
- // check empty params
- sendmsg = "GET /params\r\n\r\n";
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
- c.send(asio::buffer(sendmsg));
- c.receive(asio::buffer(buf, 2048));
- c.close();
-
- stringstream ss;
- ss << last_url_params;
-
- ASSERT_EQUAL("[ ]", ss.str());
- }
- // check single presence
- sendmsg = "GET /params?foobar\r\n\r\n";
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
- c.send(asio::buffer(sendmsg));
- c.receive(asio::buffer(buf, 2048));
- c.close();
-
- ASSERT_TRUE(last_url_params.get("missing") == nullptr);
- ASSERT_TRUE(last_url_params.get("foobar") != nullptr);
- ASSERT_TRUE(last_url_params.get_list("missing").empty());
- }
- // check multiple presence
- sendmsg = "GET /params?foo&bar&baz\r\n\r\n";
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
- c.send(asio::buffer(sendmsg));
- c.receive(asio::buffer(buf, 2048));
- c.close();
-
- ASSERT_TRUE(last_url_params.get("missing") == nullptr);
- ASSERT_TRUE(last_url_params.get("foo") != nullptr);
- ASSERT_TRUE(last_url_params.get("bar") != nullptr);
- ASSERT_TRUE(last_url_params.get("baz") != nullptr);
- }
- // check single value
- sendmsg = "GET /params?hello=world\r\n\r\n";
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
- c.send(asio::buffer(sendmsg));
- c.receive(asio::buffer(buf, 2048));
- c.close();
-
- ASSERT_EQUAL(string(last_url_params.get("hello")), "world");
- }
- // check multiple value
- sendmsg = "GET /params?hello=world&left=right&up=down\r\n\r\n";
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
- c.send(asio::buffer(sendmsg));
- c.receive(asio::buffer(buf, 2048));
- c.close();
-
- ASSERT_EQUAL(string(last_url_params.get("hello")), "world");
- ASSERT_EQUAL(string(last_url_params.get("left")), "right");
- ASSERT_EQUAL(string(last_url_params.get("up")), "down");
- }
- // check multiple value, multiple types
- sendmsg = "GET /params?int=100&double=123.45&boolean=1\r\n\r\n";
- {
- asio::ip::tcp::socket c(is);
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
- c.send(asio::buffer(sendmsg));
- c.receive(asio::buffer(buf, 2048));
- c.close();
-
- ASSERT_EQUAL(boost::lexical_cast<int>(last_url_params.get("int")), 100);
- ASSERT_EQUAL(boost::lexical_cast<double>(last_url_params.get("double")), 123.45);
- ASSERT_EQUAL(boost::lexical_cast<bool>(last_url_params.get("boolean")), true);
- }
- // check single array value
- sendmsg = "GET /params?tmnt[]=leonardo\r\n\r\n";
- {
- asio::ip::tcp::socket c(is);
-
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
- c.send(asio::buffer(sendmsg));
- c.receive(asio::buffer(buf, 2048));
- c.close();
-
- ASSERT_TRUE(last_url_params.get("tmnt") == nullptr);
- ASSERT_EQUAL(last_url_params.get_list("tmnt").size(), 1);
- ASSERT_EQUAL(string(last_url_params.get_list("tmnt")[0]), "leonardo");
- }
- // check multiple array value
- sendmsg = "GET /params?tmnt[]=leonardo&tmnt[]=donatello&tmnt[]=raphael\r\n\r\n";
- {
- asio::ip::tcp::socket c(is);
-
- c.connect(asio::ip::tcp::endpoint(asio::ip::address::from_string(LOCALHOST_ADDRESS), 45451));
- c.send(asio::buffer(sendmsg));
- c.receive(asio::buffer(buf, 2048));
- c.close();
-
- ASSERT_EQUAL(last_url_params.get_list("tmnt").size(), 3);
- ASSERT_EQUAL(string(last_url_params.get_list("tmnt")[0]), "leonardo");
- ASSERT_EQUAL(string(last_url_params.get_list("tmnt")[1]), "donatello");
- ASSERT_EQUAL(string(last_url_params.get_list("tmnt")[2]), "raphael");
- }
- server.stop();
-}
-
-TEST(Crow, route_dynamic)
-{
- SimpleApp app;
- int x = 1;
- app.route_dynamic("/")
- ([&]{
- x = 2;
- return "";
- });
-
- app.route_dynamic("/set4")
- ([&](const request&){
- x = 4;
- return "";
- });
- app.route_dynamic("/set5")
- ([&](const request&, response& res){
- x = 5;
- res.end();
- });
-
- app.route_dynamic("/set_int/<int>")
- ([&](int y){
- x = y;
- return "";
- });
-
- try
- {
- app.route_dynamic("/invalid_test/<double>/<path>")
- ([](){
- return "";
- });
- fail();
- }
- catch(std::exception&)
- {
- }
-
- // app is in an invalid state when route_dynamic throws an exception.
- try
- {
- app.validate();
- fail();
- }
- catch(std::exception&)
- {
- }
-
- {
- request req;
- response res;
- req.url = "/";
- app.handle(req, res);
- ASSERT_EQUAL(x, 2);
- }
- {
- request req;
- response res;
- req.url = "/set_int/42";
- app.handle(req, res);
- ASSERT_EQUAL(x, 42);
- }
- {
- request req;
- response res;
- req.url = "/set5";
- app.handle(req, res);
- ASSERT_EQUAL(x, 5);
- }
- {
- request req;
- response res;
- req.url = "/set4";
- app.handle(req, res);
- ASSERT_EQUAL(x, 4);
- }
+ {
+ request req;
+ response res;
+ req.url = "/";
+ app.handle(req, res);
+ ASSERT_EQUAL(x, 2);
+ }
+ {
+ request req;
+ response res;
+ req.url = "/set_int/42";
+ app.handle(req, res);
+ ASSERT_EQUAL(x, 42);
+ }
+ {
+ request req;
+ response res;
+ req.url = "/set5";
+ app.handle(req, res);
+ ASSERT_EQUAL(x, 5);
+ }
+ {
+ request req;
+ response res;
+ req.url = "/set4";
+ app.handle(req, res);
+ ASSERT_EQUAL(x, 4);
+ }
}
diff --git a/src/getvideo_main.cpp b/src/getvideo_main.cpp
index 4f375ca..f20c10b 100644
--- a/src/getvideo_main.cpp
+++ b/src/getvideo_main.cpp
@@ -1,13 +1,13 @@
#include <video.h>
-#include <iomanip>
-#include <iostream>
-#include <chrono>
-#include <thread>
-#include <vector>
-#include <fstream>
#include <fcntl.h>
#include <unistd.h>
+#include <chrono>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <thread>
+#include <vector>
#include <stdio.h>
#include <stdlib.h>
@@ -24,7 +24,7 @@
std::cout << "Started\n";
AstVideo::RawVideoBuffer out;
bool have_hardware = false;
- if( access( "/dev/video", F_OK ) != -1 ) {
+ if (access("/dev/video", F_OK) != -1) {
AstVideo::VideoPuller p;
p.initialize();
out = p.read_video();
@@ -43,19 +43,17 @@
out.height = 600;
out.y_selector = 0;
out.uv_selector = 0;
-
}
}
FILE *fp = fopen("/tmp/screendata.bin", "wb");
- fwrite(out.buffer.data(), sizeof(char),
- out.buffer.size(), fp);
+ fwrite(out.buffer.data(), sizeof(char), out.buffer.size(), fp);
AstVideo::AstJpegDecoder d;
std::cout << "MODE " << static_cast<int>(out.mode);
d.decode(out.buffer, out.width, out.height, out.mode, out.y_selector,
out.uv_selector);
- #ifdef BUILD_CIMG
+#ifdef BUILD_CIMG
cimg_library::CImg<unsigned char> image(out.width, out.height, 1,
3 /*numchannels*/);
for (int y = 0; y < out.height; y++) {
@@ -67,10 +65,9 @@
}
}
image.save("/tmp/file2.bmp");
- #endif
-
- std::cout << "Done!\n";
+#endif
+ std::cout << "Done!\n";
return 1;
}
diff --git a/src/token_authorization_middleware.cpp b/src/token_authorization_middleware.cpp
index 82a5bde..4c7a2d4 100644
--- a/src/token_authorization_middleware.cpp
+++ b/src/token_authorization_middleware.cpp
@@ -51,7 +51,8 @@
return_bad_request();
return;
}
- if (!login_credentials.has("username") || !login_credentials.has("password")){
+ if (!login_credentials.has("username") ||
+ !login_credentials.has("password")) {
return_bad_request();
return;
}
@@ -65,7 +66,8 @@
std::random_device rand;
random_bytes_engine rbe;
std::string token('a', 20);
- // TODO(ed) for some reason clang-tidy finds a divide by zero error in cstdlibc here
+ // TODO(ed) for some reason clang-tidy finds a divide by zero error in
+ // cstdlibc here
// commented out for now. Needs investigation
std::generate(begin(token), end(token), std::ref(rbe)); // NOLINT
std::string encoded_token;
diff --git a/src/token_authorization_middleware_test.cpp b/src/token_authorization_middleware_test.cpp
index 00eed2f..c01e7f9 100644
--- a/src/token_authorization_middleware_test.cpp
+++ b/src/token_authorization_middleware_test.cpp
@@ -1,7 +1,7 @@
-#include "token_authorization_middleware.hpp"
#include <crow/app.h>
-#include "gtest/gtest.h"
#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "token_authorization_middleware.hpp"
using namespace crow;
using namespace std;
@@ -241,8 +241,6 @@
auto http_content = response.substr(prev);
}
-
-
// Try to use those login credentials to access a resource
sendmsg =
"GET /\r\nAuthorization: token\r\n\r\n{\"username\": \"dude\", "